summaryrefslogtreecommitdiffstats
path: root/contrib/gdb
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-06-27 23:04:23 +0000
committerobrien <obrien@FreeBSD.org>2002-06-27 23:04:23 +0000
commit24c014fcd5bfe9e57a1208a57b8c0f9aa77261ec (patch)
tree3a27b96108bccb91c5b154b69c30b24950c25d89 /contrib/gdb
parenta9ab854862b9e8f268eb8bbbac00742895dbb2c3 (diff)
parentf458c59c2304bcdacc00cd43ff1a93f184c407d0 (diff)
downloadFreeBSD-src-24c014fcd5bfe9e57a1208a57b8c0f9aa77261ec.zip
FreeBSD-src-24c014fcd5bfe9e57a1208a57b8c0f9aa77261ec.tar.gz
This commit was generated by cvs2svn to compensate for changes in r98944,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/gdb')
-rw-r--r--contrib/gdb/ChangeLog7746
-rw-r--r--contrib/gdb/MAINTAINERS114
-rw-r--r--contrib/gdb/Makefile.in674
-rw-r--r--contrib/gdb/config-ml.in230
-rwxr-xr-xcontrib/gdb/config.guess1046
-rw-r--r--contrib/gdb/config.if14
-rwxr-xr-xcontrib/gdb/config.sub689
-rwxr-xr-xcontrib/gdb/configure87
-rw-r--r--contrib/gdb/configure.in608
-rw-r--r--contrib/gdb/gdb/CONTRIBUTE90
-rw-r--r--contrib/gdb/gdb/ChangeLog3899
-rw-r--r--contrib/gdb/gdb/ChangeLog-19903155
-rw-r--r--contrib/gdb/gdb/ChangeLog-19915175
-rw-r--r--contrib/gdb/gdb/ChangeLog-19926285
-rw-r--r--contrib/gdb/gdb/ChangeLog-19937597
-rw-r--r--contrib/gdb/gdb/ChangeLog-19945705
-rw-r--r--contrib/gdb/gdb/ChangeLog-19954915
-rw-r--r--contrib/gdb/gdb/ChangeLog-19965116
-rw-r--r--contrib/gdb/gdb/ChangeLog-19972909
-rw-r--r--contrib/gdb/gdb/ChangeLog-19987220
-rw-r--r--contrib/gdb/gdb/ChangeLog-19999296
-rw-r--r--contrib/gdb/gdb/ChangeLog-20008204
-rw-r--r--contrib/gdb/gdb/ChangeLog-20019895
-rw-r--r--contrib/gdb/gdb/ChangeLog-3.x4838
-rw-r--r--contrib/gdb/gdb/MAINTAINERS421
-rw-r--r--contrib/gdb/gdb/Makefile.in1757
-rw-r--r--contrib/gdb/gdb/NEWS458
-rw-r--r--contrib/gdb/gdb/PROBLEMS32
-rw-r--r--contrib/gdb/gdb/README446
-rw-r--r--contrib/gdb/gdb/TODO572
-rw-r--r--contrib/gdb/gdb/acinclude.m4123
-rw-r--r--contrib/gdb/gdb/aclocal.m4409
-rw-r--r--contrib/gdb/gdb/alphabsd-nat.c211
-rw-r--r--contrib/gdb/gdb/alphafbsd-tdep.c53
-rw-r--r--contrib/gdb/gdb/annotate.c230
-rw-r--r--contrib/gdb/gdb/annotate.h190
-rw-r--r--contrib/gdb/gdb/arc-tdep.c248
-rw-r--r--contrib/gdb/gdb/arch-utils.c861
-rw-r--r--contrib/gdb/gdb/arch-utils.h163
-rw-r--r--contrib/gdb/gdb/arm-linux-nat.c698
-rw-r--r--contrib/gdb/gdb/arm-linux-tdep.c547
-rw-r--r--contrib/gdb/gdb/arm-tdep.h174
-rw-r--r--contrib/gdb/gdb/armnbsd-nat.c464
-rw-r--r--contrib/gdb/gdb/armnbsd-tdep.c85
-rw-r--r--contrib/gdb/gdb/ax-gdb.c803
-rw-r--r--contrib/gdb/gdb/ax-gdb.h107
-rw-r--r--contrib/gdb/gdb/ax-general.c285
-rw-r--r--contrib/gdb/gdb/ax.h311
-rw-r--r--contrib/gdb/gdb/bcache.c442
-rw-r--r--contrib/gdb/gdb/bcache.h158
-rw-r--r--contrib/gdb/gdb/blockframe.c670
-rw-r--r--contrib/gdb/gdb/breakpoint.c7102
-rw-r--r--contrib/gdb/gdb/breakpoint.h909
-rw-r--r--contrib/gdb/gdb/buildsym.c147
-rw-r--r--contrib/gdb/gdb/buildsym.h32
-rw-r--r--contrib/gdb/gdb/c-exp.y104
-rw-r--r--contrib/gdb/gdb/c-lang.c419
-rw-r--r--contrib/gdb/gdb/c-lang.h91
-rw-r--r--contrib/gdb/gdb/c-typeprint.c861
-rw-r--r--contrib/gdb/gdb/c-valprint.c343
-rw-r--r--contrib/gdb/gdb/call-cmds.h47
-rw-r--r--contrib/gdb/gdb/ch-exp.c1320
-rw-r--r--contrib/gdb/gdb/ch-lang.c328
-rw-r--r--contrib/gdb/gdb/ch-lang.h55
-rw-r--r--contrib/gdb/gdb/ch-typeprint.c500
-rw-r--r--contrib/gdb/gdb/ch-valprint.c173
-rw-r--r--contrib/gdb/gdb/cli-out.c377
-rw-r--r--contrib/gdb/gdb/cli-out.h27
-rw-r--r--contrib/gdb/gdb/cli/cli-cmds.c826
-rw-r--r--contrib/gdb/gdb/cli/cli-cmds.h125
-rw-r--r--contrib/gdb/gdb/cli/cli-decode.c1409
-rw-r--r--contrib/gdb/gdb/cli/cli-decode.h385
-rw-r--r--contrib/gdb/gdb/cli/cli-script.c1228
-rw-r--r--contrib/gdb/gdb/cli/cli-script.h48
-rw-r--r--contrib/gdb/gdb/cli/cli-setshow.c382
-rw-r--r--contrib/gdb/gdb/cli/cli-setshow.h36
-rw-r--r--contrib/gdb/gdb/cli/cli-utils.c21
-rw-r--r--contrib/gdb/gdb/cli/cli-utils.h22
-rw-r--r--contrib/gdb/gdb/command.h382
-rw-r--r--contrib/gdb/gdb/complaints.c142
-rw-r--r--contrib/gdb/gdb/complaints.h46
-rw-r--r--contrib/gdb/gdb/completer.c713
-rw-r--r--contrib/gdb/gdb/completer.h44
-rw-r--r--contrib/gdb/gdb/config.in226
-rw-r--r--contrib/gdb/gdb/config/alpha/alpha-linux.mh7
-rw-r--r--contrib/gdb/gdb/config/alpha/alpha-linux.mt2
-rw-r--r--contrib/gdb/gdb/config/alpha/alpha-osf1.mh4
-rw-r--r--contrib/gdb/gdb/config/alpha/alpha-osf2.mh5
-rw-r--r--contrib/gdb/gdb/config/alpha/alpha-osf3.mh5
-rw-r--r--contrib/gdb/gdb/config/alpha/fbsd.mh5
-rw-r--r--contrib/gdb/gdb/config/alpha/fbsd.mt3
-rw-r--r--contrib/gdb/gdb/config/alpha/nm-fbsd.h45
-rw-r--r--contrib/gdb/gdb/config/alpha/nm-linux.h61
-rw-r--r--contrib/gdb/gdb/config/alpha/nm-osf.h30
-rw-r--r--contrib/gdb/gdb/config/alpha/nm-osf2.h29
-rw-r--r--contrib/gdb/gdb/config/alpha/nm-osf3.h27
-rw-r--r--contrib/gdb/gdb/config/alpha/tm-alphalinux.h45
-rw-r--r--contrib/gdb/gdb/config/alpha/tm-fbsd.h45
-rw-r--r--contrib/gdb/gdb/config/alpha/xm-alphalinux.h33
-rw-r--r--contrib/gdb/gdb/config/alpha/xm-alphaosf.h31
-rw-r--r--contrib/gdb/gdb/config/i386/cygwin.mh5
-rw-r--r--contrib/gdb/gdb/config/i386/embed.mt3
-rw-r--r--contrib/gdb/gdb/config/i386/fbsd.mh8
-rw-r--r--contrib/gdb/gdb/config/i386/fbsd.mt2
-rw-r--r--contrib/gdb/gdb/config/i386/go32.mh19
-rw-r--r--contrib/gdb/gdb/config/i386/go32.mt3
-rw-r--r--contrib/gdb/gdb/config/i386/i386aix.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386bsd.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386dgux.mh5
-rw-r--r--contrib/gdb/gdb/config/i386/i386gnu.mh4
-rw-r--r--contrib/gdb/gdb/config/i386/i386gnu.mt2
-rw-r--r--contrib/gdb/gdb/config/i386/i386lynx.mh6
-rw-r--r--contrib/gdb/gdb/config/i386/i386m3.mh3
-rw-r--r--contrib/gdb/gdb/config/i386/i386mach.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386mk.mh2
-rw-r--r--contrib/gdb/gdb/config/i386/i386sco.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386sco4.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386sco5.mh3
-rw-r--r--contrib/gdb/gdb/config/i386/i386sol2.mh5
-rw-r--r--contrib/gdb/gdb/config/i386/i386sol2.mt2
-rw-r--r--contrib/gdb/gdb/config/i386/i386v.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386v32.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/i386v4.mh5
-rw-r--r--contrib/gdb/gdb/config/i386/i386v42mp.mh11
-rw-r--r--contrib/gdb/gdb/config/i386/linux.mh13
-rw-r--r--contrib/gdb/gdb/config/i386/linux.mt5
-rw-r--r--contrib/gdb/gdb/config/i386/nbsd.mh11
-rw-r--r--contrib/gdb/gdb/config/i386/nbsd.mt4
-rw-r--r--contrib/gdb/gdb/config/i386/nbsdelf.mh4
-rw-r--r--contrib/gdb/gdb/config/i386/nbsdelf.mt5
-rw-r--r--contrib/gdb/gdb/config/i386/ncr3000.mh4
-rw-r--r--contrib/gdb/gdb/config/i386/ncr3000.mt2
-rw-r--r--contrib/gdb/gdb/config/i386/nm-cygwin.h38
-rw-r--r--contrib/gdb/gdb/config/i386/nm-fbsd.h110
-rw-r--r--contrib/gdb/gdb/config/i386/nm-gnu.h27
-rw-r--r--contrib/gdb/gdb/config/i386/nm-go32.h38
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386.h120
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386aix.h27
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386bsd.h33
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386lynx.h25
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386mach.h32
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386sco.h33
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386sco4.h31
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386sco5.h29
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386sol2.h69
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386v.h33
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386v4.h28
-rw-r--r--contrib/gdb/gdb/config/i386/nm-i386v42mp.h29
-rw-r--r--contrib/gdb/gdb/config/i386/nm-linux.h126
-rw-r--r--contrib/gdb/gdb/config/i386/nm-m3.h25
-rw-r--r--contrib/gdb/gdb/config/i386/nm-nbsd.h35
-rw-r--r--contrib/gdb/gdb/config/i386/nm-nbsdelf.h28
-rw-r--r--contrib/gdb/gdb/config/i386/nm-obsd.h110
-rw-r--r--contrib/gdb/gdb/config/i386/nm-ptx4.h34
-rw-r--r--contrib/gdb/gdb/config/i386/nm-symmetry.h34
-rw-r--r--contrib/gdb/gdb/config/i386/nm-x86-64.h90
-rw-r--r--contrib/gdb/gdb/config/i386/obsd.mh7
-rw-r--r--contrib/gdb/gdb/config/i386/obsd.mt3
-rw-r--r--contrib/gdb/gdb/config/i386/ptx.mh2
-rw-r--r--contrib/gdb/gdb/config/i386/ptx4.mh3
-rw-r--r--contrib/gdb/gdb/config/i386/symmetry.mh1
-rw-r--r--contrib/gdb/gdb/config/i386/tm-cygwin.h134
-rw-r--r--contrib/gdb/gdb/config/i386/tm-fbsd.h99
-rw-r--r--contrib/gdb/gdb/config/i386/tm-go32.h68
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386.h372
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386aix.h71
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386bsd.h30
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386gnu.h68
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386lynx.h27
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386m3.h32
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386mk.h39
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386nw.h36
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386os9k.h34
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386sco5.h35
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386sol2.h67
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386v.h159
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386v4.h41
-rw-r--r--contrib/gdb/gdb/config/i386/tm-i386v42mp.h95
-rw-r--r--contrib/gdb/gdb/config/i386/tm-linux.h132
-rw-r--r--contrib/gdb/gdb/config/i386/tm-nbsd.h68
-rw-r--r--contrib/gdb/gdb/config/i386/tm-nbsdelf.h28
-rw-r--r--contrib/gdb/gdb/config/i386/tm-obsd.h77
-rw-r--r--contrib/gdb/gdb/config/i386/tm-ptx.h53
-rw-r--r--contrib/gdb/gdb/config/i386/tm-ptx4.h28
-rw-r--r--contrib/gdb/gdb/config/i386/tm-symmetry.h54
-rw-r--r--contrib/gdb/gdb/config/i386/tm-vxworks.h28
-rw-r--r--contrib/gdb/gdb/config/i386/vxworks.mt3
-rw-r--r--contrib/gdb/gdb/config/i386/x86-64linux.mh11
-rw-r--r--contrib/gdb/gdb/config/i386/x86-64linux.mt5
-rw-r--r--contrib/gdb/gdb/config/i386/xm-cygwin.h38
-rw-r--r--contrib/gdb/gdb/config/i386/xm-go32.h41
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386.h30
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386aix.h32
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386bsd.h32
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386gnu.h30
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386m3.h30
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386mach.h32
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386mk.h27
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386sco.h30
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386v.h48
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386v32.h25
-rw-r--r--contrib/gdb/gdb/config/i386/xm-i386v4.h27
-rw-r--r--contrib/gdb/gdb/config/i386/xm-nbsd.h29
-rw-r--r--contrib/gdb/gdb/config/i386/xm-ptx.h31
-rw-r--r--contrib/gdb/gdb/config/i386/xm-ptx4.h30
-rw-r--r--contrib/gdb/gdb/config/i386/xm-symmetry.h30
-rw-r--r--contrib/gdb/gdb/config/ia64/aix.mh8
-rw-r--r--contrib/gdb/gdb/config/ia64/aix.mt4
-rw-r--r--contrib/gdb/gdb/config/ia64/linux.mh10
-rw-r--r--contrib/gdb/gdb/config/ia64/linux.mt6
-rw-r--r--contrib/gdb/gdb/config/ia64/nm-aix.h37
-rw-r--r--contrib/gdb/gdb/config/ia64/nm-linux.h79
-rw-r--r--contrib/gdb/gdb/config/ia64/tm-aix.h32
-rw-r--r--contrib/gdb/gdb/config/ia64/tm-ia64.h252
-rw-r--r--contrib/gdb/gdb/config/ia64/tm-linux.h34
-rw-r--r--contrib/gdb/gdb/config/ia64/xm-aix.h28
-rw-r--r--contrib/gdb/gdb/config/ia64/xm-linux.h28
-rw-r--r--contrib/gdb/gdb/config/nm-linux.h74
-rw-r--r--contrib/gdb/gdb/config/none/nm-none.h19
-rw-r--r--contrib/gdb/gdb/config/none/none.mh5
-rw-r--r--contrib/gdb/gdb/config/none/none.mt4
-rw-r--r--contrib/gdb/gdb/config/none/tm-none.h24
-rw-r--r--contrib/gdb/gdb/config/none/xm-none.h19
-rw-r--r--contrib/gdb/gdb/config/tm-linux.h42
-rw-r--r--contrib/gdb/gdb/config/tm-vxworks.h23
-rw-r--r--contrib/gdb/gdb/configure3832
-rw-r--r--contrib/gdb/gdb/configure.host69
-rw-r--r--contrib/gdb/gdb/configure.in919
-rw-r--r--contrib/gdb/gdb/configure.tgt188
-rw-r--r--contrib/gdb/gdb/copying.awk6
-rw-r--r--contrib/gdb/gdb/copying.c16
-rw-r--r--contrib/gdb/gdb/corefile.c337
-rw-r--r--contrib/gdb/gdb/corelow.c456
-rw-r--r--contrib/gdb/gdb/cp-abi.c109
-rw-r--r--contrib/gdb/gdb/cp-abi.h173
-rw-r--r--contrib/gdb/gdb/cp-valprint.c512
-rw-r--r--contrib/gdb/gdb/dbug-rom.c161
-rw-r--r--contrib/gdb/gdb/dcache.c551
-rw-r--r--contrib/gdb/gdb/dcache.h51
-rw-r--r--contrib/gdb/gdb/dink32-rom.c82
-rw-r--r--contrib/gdb/gdb/doc/ChangeLog1118
-rw-r--r--contrib/gdb/gdb/doc/Makefile.in183
-rw-r--r--contrib/gdb/gdb/doc/agentexpr.texi2
-rw-r--r--contrib/gdb/gdb/doc/all-cfg.texi69
-rw-r--r--contrib/gdb/gdb/doc/annotate.texi400
-rw-r--r--contrib/gdb/gdb/doc/configure34
-rw-r--r--contrib/gdb/gdb/doc/configure.in1
-rw-r--r--contrib/gdb/gdb/doc/fdl.texi368
-rw-r--r--contrib/gdb/gdb/doc/gdbint.texinfo4664
-rw-r--r--contrib/gdb/gdb/doc/gpl.texi409
-rw-r--r--contrib/gdb/gdb/doc/refcard.tex18
-rw-r--r--contrib/gdb/gdb/doublest.c788
-rw-r--r--contrib/gdb/gdb/doublest.h83
-rw-r--r--contrib/gdb/gdb/dsrec.c311
-rw-r--r--contrib/gdb/gdb/dst.h1671
-rw-r--r--contrib/gdb/gdb/dstread.c1607
-rw-r--r--contrib/gdb/gdb/dwarf2cfi.c1784
-rw-r--r--contrib/gdb/gdb/dwarf2cfi.h66
-rw-r--r--contrib/gdb/gdb/dwarf2read.c2292
-rw-r--r--contrib/gdb/gdb/dwarfread.c2813
-rw-r--r--contrib/gdb/gdb/elfread.c481
-rw-r--r--contrib/gdb/gdb/environ.c67
-rw-r--r--contrib/gdb/gdb/environ.h71
-rw-r--r--contrib/gdb/gdb/eval.c894
-rw-r--r--contrib/gdb/gdb/event-loop.c1151
-rw-r--r--contrib/gdb/gdb/event-loop.h95
-rw-r--r--contrib/gdb/gdb/event-top.c1171
-rw-r--r--contrib/gdb/gdb/event-top.h111
-rw-r--r--contrib/gdb/gdb/expprint.c508
-rw-r--r--contrib/gdb/gdb/expression.h615
-rw-r--r--contrib/gdb/gdb/f-exp.y51
-rw-r--r--contrib/gdb/gdb/f-lang.c616
-rw-r--r--contrib/gdb/gdb/f-lang.h112
-rw-r--r--contrib/gdb/gdb/f-typeprint.c186
-rw-r--r--contrib/gdb/gdb/f-valprint.c682
-rw-r--r--contrib/gdb/gdb/findvar.c1188
-rw-r--r--contrib/gdb/gdb/fork-child.c195
-rw-r--r--contrib/gdb/gdb/frame.c225
-rw-r--r--contrib/gdb/gdb/frame.h244
-rw-r--r--contrib/gdb/gdb/gcore.c497
-rw-r--r--contrib/gdb/gdb/gdb-events.c353
-rw-r--r--contrib/gdb/gdb/gdb-events.h113
-rwxr-xr-xcontrib/gdb/gdb/gdb-events.sh607
-rw-r--r--contrib/gdb/gdb/gdb-stabs.h95
-rw-r--r--contrib/gdb/gdb/gdb.12
-rw-r--r--contrib/gdb/gdb/gdb.h60
-rw-r--r--contrib/gdb/gdb/gdb_assert.h55
-rw-r--r--contrib/gdb/gdb/gdb_dirent.h40
-rwxr-xr-xcontrib/gdb/gdb/gdb_indent.sh62
-rw-r--r--contrib/gdb/gdb/gdb_proc_service.h86
-rw-r--r--contrib/gdb/gdb/gdb_regex.h30
-rw-r--r--contrib/gdb/gdb/gdb_stat.h36
-rw-r--r--contrib/gdb/gdb/gdb_string.h73
-rw-r--r--contrib/gdb/gdb/gdb_thread_db.h450
-rw-r--r--contrib/gdb/gdb/gdb_vfork.h28
-rw-r--r--contrib/gdb/gdb/gdb_wait.h121
-rw-r--r--contrib/gdb/gdb/gdbarch.c5205
-rw-r--r--contrib/gdb/gdb/gdbarch.h2599
-rwxr-xr-xcontrib/gdb/gdb/gdbarch.sh2240
-rw-r--r--contrib/gdb/gdb/gdbcmd.h58
-rw-r--r--contrib/gdb/gdb/gdbcore.h164
-rw-r--r--contrib/gdb/gdb/gdbinit.in2
-rw-r--r--contrib/gdb/gdb/gdbserver/Makefile.in167
-rw-r--r--contrib/gdb/gdb/gdbserver/README49
-rw-r--r--contrib/gdb/gdb/gdbserver/acconfig.h9
-rw-r--r--contrib/gdb/gdb/gdbserver/aclocal.m4100
-rw-r--r--contrib/gdb/gdb/gdbserver/config.in26
-rw-r--r--contrib/gdb/gdb/gdbserver/configure1602
-rw-r--r--contrib/gdb/gdb/gdbserver/configure.in139
-rw-r--r--contrib/gdb/gdb/gdbserver/configure.srv65
-rw-r--r--contrib/gdb/gdb/gdbserver/gdbserver.115
-rw-r--r--contrib/gdb/gdb/gdbserver/i387-fp.c290
-rw-r--r--contrib/gdb/gdb/gdbserver/i387-fp.h33
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-arm-low.c47
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-i386-low.c123
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-ia64-low.c297
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-low.c484
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-low.h37
-rw-r--r--contrib/gdb/gdb/gdbserver/linux-x86-64-low.c76
-rw-r--r--contrib/gdb/gdb/gdbserver/low-hppabsd.c146
-rw-r--r--contrib/gdb/gdb/gdbserver/low-lynx.c405
-rw-r--r--contrib/gdb/gdb/gdbserver/low-nbsd.c599
-rw-r--r--contrib/gdb/gdb/gdbserver/low-sim.c126
-rw-r--r--contrib/gdb/gdb/gdbserver/low-sparc.c148
-rw-r--r--contrib/gdb/gdb/gdbserver/low-sun3.c126
-rw-r--r--contrib/gdb/gdb/gdbserver/regcache.c147
-rw-r--r--contrib/gdb/gdb/gdbserver/regcache.h49
-rw-r--r--contrib/gdb/gdb/gdbserver/remote-utils.c218
-rw-r--r--contrib/gdb/gdb/gdbserver/server.c160
-rw-r--r--contrib/gdb/gdb/gdbserver/server.h122
-rw-r--r--contrib/gdb/gdb/gdbserver/terminal.h51
-rw-r--r--contrib/gdb/gdb/gdbthread.h242
-rw-r--r--contrib/gdb/gdb/gdbtypes.c2546
-rw-r--r--contrib/gdb/gdb/gdbtypes.h1082
-rw-r--r--contrib/gdb/gdb/gnu-v2-abi.c429
-rw-r--r--contrib/gdb/gdb/gnu-v3-abi.c434
-rw-r--r--contrib/gdb/gdb/gregset.h56
-rw-r--r--contrib/gdb/gdb/hpacc-abi.c328
-rw-r--r--contrib/gdb/gdb/hpux-thread.c308
-rw-r--r--contrib/gdb/gdb/i386-linux-nat.c955
-rw-r--r--contrib/gdb/gdb/i386-linux-tdep.c530
-rw-r--r--contrib/gdb/gdb/i386-nat.c635
-rw-r--r--contrib/gdb/gdb/i386-tdep.h116
-rw-r--r--contrib/gdb/gdb/i386bsd-nat.c400
-rw-r--r--contrib/gdb/gdb/i386bsd-tdep.c84
-rw-r--r--contrib/gdb/gdb/i386fbsd-nat.c102
-rw-r--r--contrib/gdb/gdb/i386nbsd-nat.c132
-rw-r--r--contrib/gdb/gdb/i386nbsd-tdep.c32
-rw-r--r--contrib/gdb/gdb/i387-nat.c346
-rw-r--r--contrib/gdb/gdb/i387-nat.h56
-rw-r--r--contrib/gdb/gdb/i387-tdep.c421
-rw-r--r--contrib/gdb/gdb/ia64-aix-nat.c161
-rw-r--r--contrib/gdb/gdb/ia64-aix-tdep.c107
-rw-r--r--contrib/gdb/gdb/ia64-linux-nat.c644
-rw-r--r--contrib/gdb/gdb/ia64-linux-tdep.c87
-rw-r--r--contrib/gdb/gdb/ia64-tdep.c2240
-rw-r--r--contrib/gdb/gdb/inf-loop.c132
-rw-r--r--contrib/gdb/gdb/inf-loop.h29
-rw-r--r--contrib/gdb/gdb/infcmd.c1417
-rw-r--r--contrib/gdb/gdb/inferior.h443
-rw-r--r--contrib/gdb/gdb/inflow.c347
-rw-r--r--contrib/gdb/gdb/infrun.c4709
-rw-r--r--contrib/gdb/gdb/inftarg.c618
-rw-r--r--contrib/gdb/gdb/infttrace.c5426
-rw-r--r--contrib/gdb/gdb/jv-exp.y45
-rw-r--r--contrib/gdb/gdb/jv-lang.c459
-rw-r--r--contrib/gdb/gdb/jv-lang.h76
-rw-r--r--contrib/gdb/gdb/jv-typeprint.c114
-rw-r--r--contrib/gdb/gdb/jv-valprint.c173
-rw-r--r--contrib/gdb/gdb/kod-cisco.c317
-rw-r--r--contrib/gdb/gdb/kod.c229
-rw-r--r--contrib/gdb/gdb/kod.h61
-rw-r--r--contrib/gdb/gdb/language.c1620
-rw-r--r--contrib/gdb/gdb/language.h355
-rw-r--r--contrib/gdb/gdb/lin-lwp.c1549
-rw-r--r--contrib/gdb/gdb/linespec.c1273
-rw-r--r--contrib/gdb/gdb/linespec.h27
-rw-r--r--contrib/gdb/gdb/linux-proc.c556
-rw-r--r--contrib/gdb/gdb/m2-exp.y22
-rw-r--r--contrib/gdb/gdb/m2-lang.c452
-rw-r--r--contrib/gdb/gdb/m2-lang.h44
-rw-r--r--contrib/gdb/gdb/m2-typeprint.c46
-rw-r--r--contrib/gdb/gdb/m2-valprint.c50
-rw-r--r--contrib/gdb/gdb/maint.c605
-rw-r--r--contrib/gdb/gdb/mdebugread.c2086
-rw-r--r--contrib/gdb/gdb/mem-break.c59
-rw-r--r--contrib/gdb/gdb/memattr.c535
-rw-r--r--contrib/gdb/gdb/memattr.h91
-rw-r--r--contrib/gdb/gdb/mi/ChangeLog1765
-rw-r--r--contrib/gdb/gdb/mi/gdbmi.texinfo3810
-rw-r--r--contrib/gdb/gdb/mi/mi-cmd-break.c245
-rw-r--r--contrib/gdb/gdb/mi/mi-cmd-disas.c499
-rw-r--r--contrib/gdb/gdb/mi/mi-cmd-stack.c309
-rw-r--r--contrib/gdb/gdb/mi/mi-cmd-var.c501
-rw-r--r--contrib/gdb/gdb/mi/mi-cmds.c261
-rw-r--r--contrib/gdb/gdb/mi/mi-cmds.h125
-rw-r--r--contrib/gdb/gdb/mi/mi-console.c118
-rw-r--r--contrib/gdb/gdb/mi/mi-console.h27
-rw-r--r--contrib/gdb/gdb/mi/mi-getopt.c76
-rw-r--r--contrib/gdb/gdb/mi/mi-getopt.h60
-rw-r--r--contrib/gdb/gdb/mi/mi-main.c1527
-rw-r--r--contrib/gdb/gdb/mi/mi-out.c456
-rw-r--r--contrib/gdb/gdb/mi/mi-out.h33
-rw-r--r--contrib/gdb/gdb/mi/mi-parse.c239
-rw-r--r--contrib/gdb/gdb/mi/mi-parse.h55
-rw-r--r--contrib/gdb/gdb/minsyms.c573
-rw-r--r--contrib/gdb/gdb/mipsread.c173
-rw-r--r--contrib/gdb/gdb/nlm/Makefile.in6
-rw-r--r--contrib/gdb/gdb/nlm/gdbserve.c51
-rw-r--r--contrib/gdb/gdb/nlm/i386.c20
-rw-r--r--contrib/gdb/gdb/nlm/ppc.c29
-rw-r--r--contrib/gdb/gdb/nlmread.c143
-rw-r--r--contrib/gdb/gdb/objfiles.h533
-rw-r--r--contrib/gdb/gdb/ocd.c454
-rw-r--r--contrib/gdb/gdb/ocd.h106
-rw-r--r--contrib/gdb/gdb/p-exp.y1485
-rw-r--r--contrib/gdb/gdb/p-lang.c465
-rw-r--r--contrib/gdb/gdb/p-lang.h75
-rw-r--r--contrib/gdb/gdb/p-typeprint.c809
-rw-r--r--contrib/gdb/gdb/p-valprint.c1117
-rw-r--r--contrib/gdb/gdb/parse.c780
-rw-r--r--contrib/gdb/gdb/parser-defs.h160
-rw-r--r--contrib/gdb/gdb/ppc-bdm.c266
-rw-r--r--contrib/gdb/gdb/ppc-linux-nat.c532
-rw-r--r--contrib/gdb/gdb/ppc-linux-tdep.c814
-rw-r--r--contrib/gdb/gdb/ppc-tdep.h69
-rw-r--r--contrib/gdb/gdb/ppcnbsd-nat.c145
-rw-r--r--contrib/gdb/gdb/printcmd.c1215
-rwxr-xr-xcontrib/gdb/gdb/proc-api.c789
-rwxr-xr-xcontrib/gdb/gdb/proc-events.c1777
-rwxr-xr-xcontrib/gdb/gdb/proc-flags.c291
-rw-r--r--contrib/gdb/gdb/proc-service.c312
-rw-r--r--contrib/gdb/gdb/proc-utils.h102
-rwxr-xr-xcontrib/gdb/gdb/proc-why.c175
-rw-r--r--contrib/gdb/gdb/regcache.c817
-rw-r--r--contrib/gdb/gdb/regcache.h82
-rw-r--r--contrib/gdb/gdb/regformats/reg-arm.dat28
-rw-r--r--contrib/gdb/gdb/regformats/reg-i386-linux.dat44
-rw-r--r--contrib/gdb/gdb/regformats/reg-i386.dat43
-rw-r--r--contrib/gdb/gdb/regformats/reg-ia64.dat603
-rw-r--r--contrib/gdb/gdb/regformats/reg-ppc.dat76
-rw-r--r--contrib/gdb/gdb/regformats/reg-x86-64.dat53
-rwxr-xr-xcontrib/gdb/gdb/regformats/regdat.sh169
-rw-r--r--contrib/gdb/gdb/regformats/regdef.h46
-rw-r--r--contrib/gdb/gdb/remote-rdi.c482
-rw-r--r--contrib/gdb/gdb/remote-utils.c309
-rw-r--r--contrib/gdb/gdb/remote-utils.h113
-rw-r--r--contrib/gdb/gdb/remote.h57
-rw-r--r--contrib/gdb/gdb/reply_mig_hack.awk4
-rw-r--r--contrib/gdb/gdb/scm-exp.c274
-rw-r--r--contrib/gdb/gdb/scm-lang.c127
-rw-r--r--contrib/gdb/gdb/scm-lang.h48
-rw-r--r--contrib/gdb/gdb/scm-tags.h90
-rw-r--r--contrib/gdb/gdb/scm-valprint.c123
-rw-r--r--contrib/gdb/gdb/ser-pipe.c161
-rw-r--r--contrib/gdb/gdb/ser-tcp.c438
-rw-r--r--contrib/gdb/gdb/ser-unix.h53
-rw-r--r--contrib/gdb/gdb/serial.c583
-rw-r--r--contrib/gdb/gdb/serial.h320
-rw-r--r--contrib/gdb/gdb/signals.c837
-rw-r--r--contrib/gdb/gdb/signals/signals.c844
-rw-r--r--contrib/gdb/gdb/sol-thread.c1161
-rw-r--r--contrib/gdb/gdb/solib-legacy.c152
-rw-r--r--contrib/gdb/gdb/solib-osf.c616
-rw-r--r--contrib/gdb/gdb/solib-sunos.c895
-rw-r--r--contrib/gdb/gdb/solib-svr4.c1359
-rw-r--r--contrib/gdb/gdb/solib-svr4.h78
-rw-r--r--contrib/gdb/gdb/solib.h100
-rw-r--r--contrib/gdb/gdb/solist.h126
-rw-r--r--contrib/gdb/gdb/source.c861
-rw-r--r--contrib/gdb/gdb/source.h34
-rw-r--r--contrib/gdb/gdb/sparc-linux-nat.c100
-rw-r--r--contrib/gdb/gdb/sparc-nat.c347
-rw-r--r--contrib/gdb/gdb/sparc-stub.c778
-rw-r--r--contrib/gdb/gdb/sparc-tdep.c3209
-rw-r--r--contrib/gdb/gdb/sparcl-stub.c946
-rw-r--r--contrib/gdb/gdb/sparcl-tdep.c869
-rw-r--r--contrib/gdb/gdb/sparclet-rom.c316
-rw-r--r--contrib/gdb/gdb/sparclet-stub.c1167
-rw-r--r--contrib/gdb/gdb/stabsread.c2716
-rw-r--r--contrib/gdb/gdb/stabsread.h201
-rw-r--r--contrib/gdb/gdb/stack.c1133
-rw-r--r--contrib/gdb/gdb/symfile.h354
-rw-r--r--contrib/gdb/gdb/symmisc.c647
-rw-r--r--contrib/gdb/gdb/symtab.h1285
-rw-r--r--contrib/gdb/gdb/terminal.h39
-rw-r--r--contrib/gdb/gdb/thread-db.c1044
-rw-r--r--contrib/gdb/gdb/top.h91
-rw-r--r--contrib/gdb/gdb/tracepoint.c2419
-rw-r--r--contrib/gdb/gdb/tracepoint.h161
-rw-r--r--contrib/gdb/gdb/typeprint.c228
-rw-r--r--contrib/gdb/gdb/typeprint.h38
-rw-r--r--contrib/gdb/gdb/ui-file.c487
-rw-r--r--contrib/gdb/gdb/ui-file.h93
-rw-r--r--contrib/gdb/gdb/ui-out.c1147
-rw-r--r--contrib/gdb/gdb/ui-out.h275
-rwxr-xr-xcontrib/gdb/gdb/uw-thread.c1059
-rw-r--r--contrib/gdb/gdb/valarith.c660
-rw-r--r--contrib/gdb/gdb/valops.c2315
-rw-r--r--contrib/gdb/gdb/valprint.c904
-rw-r--r--contrib/gdb/gdb/valprint.h64
-rw-r--r--contrib/gdb/gdb/value.h563
-rw-r--r--contrib/gdb/gdb/values.c1087
-rw-r--r--contrib/gdb/gdb/varobj.c2492
-rw-r--r--contrib/gdb/gdb/varobj.h100
-rw-r--r--contrib/gdb/gdb/version.h33
-rw-r--r--contrib/gdb/gdb/version.in1
-rw-r--r--contrib/gdb/gdb/wrapper.c333
-rw-r--r--contrib/gdb/gdb/wrapper.h49
-rw-r--r--contrib/gdb/gdb/x86-64-linux-nat.c449
-rw-r--r--contrib/gdb/gdb/x86-64-linux-tdep.c136
-rw-r--r--contrib/gdb/gdb/x86-64-tdep.c1102
-rw-r--r--contrib/gdb/gdb/x86-64-tdep.h34
-rw-r--r--contrib/gdb/gdb/xcoffsolib.h88
514 files changed, 242791 insertions, 44801 deletions
diff --git a/contrib/gdb/ChangeLog b/contrib/gdb/ChangeLog
new file mode 100644
index 0000000..83ec2be
--- /dev/null
+++ b/contrib/gdb/ChangeLog
@@ -0,0 +1,7746 @@
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (do-tar-bz2): Delete rule. Replace with ...
+ (do-tar, do-bz2): New rules.
+ (taz): Update. Replace do-tar-bz2 with do-tar and do-bz2.
+ (gdb-tar): New rule.
+ (gdb-taz): Rewrite. Use gdb-tar and do-bz2.
+ (insight_dejagnu.tar): New rule.
+ (insight.tar): New rule.
+ (gdb+dejagnu.tar): New rule.
+ (gdb.tar): New rule.
+
+2002-02-28 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libstdcxx_flags): Don't add libstdc++-v3 flags for
+ libjava.
+ (CXX_FOR_TARGET): Add -shared-libgcc for libstdc++-v3 and libjava.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ * texinfo/texinfo.tex: Update to version 2002-02-14.08.
+
+2002-02-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.guess: Import from master sources, rev 1.232.
+ * config.sub: Import from master sources, rev 1.246.
+
+2002-02-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (MAKEINFO): Don't assume makeinfo will be built just
+ because its Makefile is there; test for the executable instead.
+
+2002-02-09 Alexandre Oliva <aoliva@redhat.com>
+
+ Contribute sh64-elf.
+ 2000-12-01 Alexandre Oliva <aoliva@redhat.com>
+ * configure.in: Added sh64-*-*.
+
+2002-02-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Remove advertising clause from
+ Berkeley and Red Hat licenses.
+
+2002-02-01 Mo DeJong <supermo@bayarea.net>
+
+ * Makefile.in: Add all-tix to deps for all-snavigator
+ so that tix is built when building snavigator.
+
+2002-02-01 Ben Elliston <bje@redhat.com>
+
+ * config.guess: Import from master sources, rev 1.229.
+ * config.sub: Import from master sources, rev 1.240.
+
+2002-01-27 Daniel Jacobowitz <drow@mvista.com>
+
+ From Steve Ellcey <sje@cup.hp.com>:
+ * libtool.m4 (HPUX_IA64_MODE): Set to 32 or 64 based on ABI.
+ (lt_cv_deplibs_check_method, lt_cv_file_magic_cmd,
+ lt_cv_file_magic_test_file): Set to appropriate values for HP-UX
+ IA64.
+ * ltcf-c.sh (archive_cmds, hardcode_*): Ditto.
+ * ltconfig (shlibpath_*, dynamic_linker, library_names_spec,
+ soname_spec, sys_lib_search_path_spec): Ditto.
+
+2002-01-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.in (*-*-netbsd*): New. Skip target-newlib,
+ target-libiberty, and target-libgloss. Skip Java-related
+ libraries if not supported for NetBSD on target CPU.
+
+2002-01-23 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * configure.in: Import StrongARM and XScale target_configdirs from
+ FSF GCC version.
+
+2002-01-16 H.J. Lu (hjl@gnu.org)
+
+ * config.guess: Import from master sources, rev 1.225.
+ * config.sub: Import from master sources, rev 1.238.
+
+ * MAINTAINERS: Updated notes on config.guess and config.sub.
+
+2002-01-11 Steve Ellcey <sje@cup.hp.com>
+
+ * configure.in (ia64*-*-hpux*): New target for IA64 HP-UX,
+ ld and gdb are not supported.
+
+2002-01-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * Change reference to Cygnus Solutions to be Red Hat.
+
+2002-01-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Update generic copyright date.
+
+2002-01-07 Mark Salter <msalter@redhat.com>
+
+ * configure.in: Remove target-bsp and target-cygmon from arm builds.
+ Allow target-libgloss to be built for arm, strongarm, and xscale.
+
+2002-01-03 Ben Elliston <bje@redhat.com>
+
+ * MAINTAINERS: Update URL for config.* scripts.
+
+2001-12-18 Alan Modra <amodra@bigpond.net.au>
+
+ * config.sub: Import latest version.
+ * config.guess: Likewise.
+
+2001-12-13 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * configure.in (FLAGS_FOR_TARGET): Remove -nostdinc and -isystem
+ options for i[3456]86-pc-linux* native builds.
+
+2001-12-05 Laurent Guerby <guerby@acm.org>
+
+ * MAINTAINERS: gcc adopts symlink-tree, refer more to
+ libiberty.
+
+ Import this patch from gcc:
+
+ 2000-12-09 Laurynas Biveinis <lauras@softhome.net>
+
+ * symlink-tree: handle DOS-style absolute paths.
+
+2001-11-28 DJ Delorie <dj@redhat.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ When build != host, create libiberty for the build machine.
+
+ * Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace
+ CONFIG_ARGUMENTS.
+ (ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR):
+ New variables.
+ (ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables
+ and rules.
+ (all.normal): Depend on ALL_BUILD_MODULES.
+ (CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS.
+ (all-build-libiberty): Depend on configure-build-libiberty.
+
+ * configure: Calculate and substitute proper value for
+ ALL_BUILD_MODULES.
+ * configure.in: Create the build subdirectory.
+ Calculate and substitute TARGET_CONFIGARGS (formerly
+ CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new).
+
+2001-11-26 Geoffrey Keating <geoffk@redhat.com>
+
+ * config.sub: Update to version 1.232 on subversion.
+
+2001-11-20 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * Makefile.in (do-proto-toplev): Use msgfmt to generate .gmo
+ files from .po files for a distribution.
+
+2001-11-19 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * COPYING.NEWLIB: Mention preserved notice in specific parts.
+
+2001-11-13 Jeff Holcomb <jeffh@redhat.com>
+
+ Merged from net gcc:
+ 2001-07-30 Jeff Sturm <jsturm@one-pont.com>
+ * ltcf-c.sh: Use $objext, not $ac_objext.
+ 2001-07-27 Mark Kettenis <kettenis@gnu.org>
+ * ltcf-cxx.sh: Add support for GNU.
+ 2001-07-22 Timothy Wall <twall@redhat.com>
+ * ltcf-c.sh: Don't disable shared libraries for AIX5/IA64. Preserve
+ default settings if using GNU tools with that configuration.
+ * ltcf-cxx.sh: Ditto.
+ * ltcf-gcj.sh: Ditto.
+ 2001-07-21 Michael Chastain <chastain@redhat.com>
+ * ltconfig: Set max_cmd_len to a maximum of 512Kb, as it seems some
+ HPUX 11.0 systems have trouble with 1MB. Mark as gcc-local.
+ * ltmain.sh: Mark as gcc-local.
+
+2001-11-13 Jeff Holcomb <jeffh@redhat.com>
+
+ * Makefile.in (all-bison): Revert 2001-10-24.
+ Don't depend on texinfo.
+
+2001-11-12 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * COPYING.NEWLIB: Add BSD-style license/copyright blurb for my work.
+
+2001-11-08 Phil Edwards <pedwards@disaster.jaj.com>
+
+ * configure.in (--enable-languages): Be more permissive about
+ syntax. Check for empty lists better. Warn about $LANGUAGES.
+
+2001-11-06 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * Makefile.in (MAKEINFO): Use "missing" for makeinfo older than 4.0.
+
+2001-10-24 Jeff Holcomb <jeffh@redhat.com>
+
+ Makefile.in (all-bison): Don't depend on texinfo.
+
+2001-10-03 Alan Modra <amodra@bigpond.net.au>
+
+ * gettext.m4: Test po/POTFILES.in exists before trying to read.
+
+2001-09-29 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (configure-target-gperf): Depend on $(ALL_GCC_CXX).
+
+2001-09-28 Hans-Peter Nilsson <hp@axis.com>
+
+ * config.sub, config.guess: Import latest from subversions.
+
+2001-09-21 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET,
+ DLLTOOL_FOR_TARGET, WINDRES_FOR_TARGET, AR_FOR_TARGET,
+ RANLIB_FOR_TARGET, NM_FOR_TARGET): Don't use double quotes to
+ avoid quotes nesting problems.
+ (NATIVE_CHECK_MODULES): Ditto, just for consistency.
+ (DO_X): Export only variables that are set.
+
+2001-09-19 Ben Elliston <bje@redhat.com>
+
+ * configure.in (sparc-sun-solaris2*): Don't use /usr/bin/which on
+ Solaris when testing for the /usr/ucb/cc compiler; it has incorrect
+ semantics. Use the shell built-in "type" command instead.
+
+2001-09-15 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * config.sub: Reverted the earlier change, this version is not the
+ master file.
+
+2001-09-14 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * config.sub: Change machine triplets from mipsel*-* to mips*el-*.
+ Add support for mips64.
+
+2001-09-03 Jeff Holcomb <jeffh@redhat.com>
+
+ * configure.in: Enable libstdc++-v3 for h8300 targets.
+
+2001-08-30 Eric Christopher <echristo@redhat.com>
+ Jason Eckhardt <jle@redhat.com>
+
+ * config.sub: Add support for mipsisa32.
+
+2001-08-30 Eric Christopher <echristo@redhat.com>
+
+ * config.sub, config.guess: Import latest from subversions.
+
+2001-08-20 Alan Modra <amodra@bigpond.net.au>
+
+ * config.sub, config.guess: Import latest from subversions.
+
+2001-07-26 DJ Delorie <dj@redhat.com>
+
+ * MAINTAINERS: Clarify libiberty merge rules and procedures.
+
+2001-06-19 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.in: Revert 2001-06-17.
+ (VER): If AM_INIT_AUTOMAKE uses BFD_VERSION, get version from bfd/.
+
+2001-06-17 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.in (gas.tar.bz2): Pass TOOL=bfd PACKAGE=gas to make.
+ (gas+binutils.tar.bz2): Likewise.
+ (binutils.tar.bz2): Pass TOOL=bfd PACKAGE=binutils to make.
+
+Fri Jun 8 11:14:02 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (VER): When present, extract the version number from
+ the file version.in.
+
+2001-06-08 Alexandre Oliva <aoliva@redhat.com>, Jeff Sturm <jsturm@one-point.com>
+
+ * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): If
+ gcc/xgcc is built, use -print-prog-name to find out the program
+ name to use.
+
+2001-06-04 Mark Mitchell <mark@codesourcery.com>
+
+ * ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris,
+ with_gcc]: Use `gcc -shared' to build a shared library.
+
+2001-06-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared
+ archives.
+
+2001-05-28 Simon Patarin <simon.patarin@inria.fr>
+
+ * ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared
+ libraries when using g++ with native linker.
+
+2001-05-28 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256.
+
+2001-05-24 Tom Rix <trix@redhat.com>
+
+ * configure.in : enable ld for aix
+
+2001-05-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag)
+ [aix4*|aix5*]: Prepend blank.
+
+2001-05-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number
+ of subdir/configure scripts to use the new libtool.m4.
+
+2001-05-14 H.J. Lu <hjl@gnu.org>
+
+ * config.if (libc_interface): Set to -libc6.2- for cross
+ compiling to Linux/glibc 2.2.
+
+2001-05-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs) [*-cygwin*, *-mingw*, *-beos]: Disable
+ libgcj.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs): Don't reset it from scratch in the
+ target case; only append to it.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs) [hppa*-*-*, mips*-*-irix6*,
+ sparc-*-solaris2.8]: Disable ${libgcj}.
+
+2001-04-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libgcj_saved): Copy from $libgcj.
+ (libgcj): Zero out if --enable-libgcj; add to noconfigdirs is
+ --disable-libgcj.
+
+2001-04-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, ltcf-cxx.sh: Upgraded to libtool 1.4a
+ 1.641.2.228.
+
+2001-04-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.226.
+
+2001-04-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
+ New macros.
+ (bootstrap, cross): Use RECURSE_FLAGS.
+ * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.
+
+2001-03-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3.
+
+2001-03-23 Nick Clifton <nickc@redhat.com>
+
+ * README-maintainer-mode: Add note about inability to use "make
+ distclean" in maintainer mode.
+
+2001-03-22 Alexandre Oliva <aoliva@redhat.com>
+
+ Re-installed:
+ 2001-01-02 Laurynas Biveinis <lauras@softhome.net>
+ * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add
+ '-DPIC' to ac_cv_prog_cc_pic for DJGPP.
+ * ltcf-cxx.sh: Likewise.
+ * ltcf-gcj.sh: Likewise.
+
+2001-03-22 Philip Blundell <philb@gnu.org>
+
+ * config.sub, config.guess: Import latest from subversions.
+
+2001-03-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198.
+
+2001-03-20 Michael Chastain <chastain@redhat.com>
+
+ * Makefile.in: all-m4 depends on all-texinfo.
+
+2001-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (ALL_GCC, ALL_GCC_C, ALL_GCC_CXX): Set before use.
+
+2001-02-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Remove DJ Delorie's address because it is no
+ longer valid.
+
+2001-02-16 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (noconfigdirs): Allow configuration of texinfo
+ for Cygwin hosts.
+
+2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * config.guess: Add linux target for S/390.
+ * config.sub: Likewise.
+ * configure.in: Likewise.
+
+2001-02-06 Ben Elliston <bje@redhat.com>
+
+ * configure: Output host type to stdout, not stderr.
+
+2001-02-04 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * config.guess: Import from subversions.gnu.org (revision 1.181).
+ * config.sub: Import from subversions.gnu.org (revision 1.199).
+
+2001-01-30 Alan Modra <alan@linuxcare.com.au>
+
+ * config.guess: Handle hppa64-linux systems.
+
+2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * ltcf-cxx.sh (ac_cv_prog_cc_pic_works, ac_cv_prog_cc_static_works):
+ Don't unset, it's non-portable and no longer necessary, set to empty
+ instead.
+
+2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>, Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * ltconfig: Shell portability fix for the tagname validity check.
+
+2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * ltcf-cxx.sh: Use parentheses around eval $ac_compile.
+
+2001-01-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-c.sh (ld_shlibs) [aix5*]: Disable on unknown CPU types.
+ * ltcf-cxx.sh, ltcf-gcj.sh: Likewise.
+
+2001-01-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltmain.sh (TAG disable-shared, TAG disable-static): Make sure we
+ keep at least one of build_libtool_libs or build_old_libs set to
+ yes.
+
+2001-01-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-gcj.sh (lt_simple_link_test_code): Remove stray `(0)'.
+ * libtool.m4 (_AC_LIBTOOL_GCJ): Pass $CPPFLAGS on.
+
+2000-11-07 Philip Blundell <pb@futuretv.com>
+
+ * Makefile.in (ETC_SUPPORT): Also add configbuild.* and configdev.*.
+
+2000-11-03 Philip Blundell <pb@futuretv.com>
+
+ * Makefile.in (ETC_SUPPORT): Add configure.texi and associated info
+ files.
+
+2001-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * COPYING.NEWLIB: Put into source repository.
+
+2001-01-15 Ben Elliston <bje@redhat.com>
+
+ * configure.in (host_tools): Add sid.
+ Always configure cgen.
+ * Makefile.in (all-sid): New target.
+ (check-sid, clean-sid, install-sid): Likewise.
+
+2001-01-07 Andreas Jaeger <aj@suse.de>
+
+ * config.sub, config.guess: Update from subversions.
+
+2000-12-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Disable language-specific target libraries for
+ languages that aren't enabled.
+
+2000-11-24 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (xscale-elf): Add target.
+ (xscale-coff): Add target.
+ (c4x, c5x, tic54x): Move after ARM targets.
+
+2000-11-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-gcj.sh: Added file, required by 2000-11-18 merge.
+
+2000-11-20 Ian Lance Taylor <ian@zembu.com>
+
+ * ltcf-cxx.sh: Added file, required by 2000-11-18 merge.
+
+2000-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in: Merge with GCC and libgcj.
+ (ALL_GCC_C, ALL_GCC_CXX): New macros. Use them as dependencies of
+ configure-target-<library> when their configure scripts need the C
+ or C++ library to have already been built to work properly.
+ (do_proto_toplev): Set them to an empty string.
+
+2000-11-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (HOST_LIB_PATH, TARGET_LIB_PATH): New macros.
+ (REALLY_SET_LIB_PATH): Use them.
+
+2000-11-06 Christopher Faylor <cgf@cygnus.com>
+
+ * config.sub: Add support for Sun Chorus
+
+2000-11-02 Per Lundberg <plundis@chaosdev.org>
+
+ * config.sub: Add support for the *-storm-chaos OS.
+
+2000-10-30 Stephane Carrez <stcarrez@worldnet.fr>
+
+ * configure.in (noconfigdirs): Don't compile some
+ of the libraries for 68HC11 & 68hc12 targets.
+
+2000-09-30 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4: Updated from libtool
+ multi-language branch, to work around Solaris' /bin/sh bug. Rebuilt
+ all affected `configure' scripts.
+
+2000-09-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (DEVO_SUPPORT): Added gettext.m4, libtool.m4 and
+ ltcf-c.sh.
+
+2000-09-12 Philip Blundell <philb@gnu.org>
+
+ * config.sub, config.guess: Update from subversions.
+
+2000-09-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (all-zlib): Added dummy target.
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh: Updated from libtool
+ multi-language branch.
+
+2000-09-05 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (all-bootstrap): Added all-texinfo and all-zlib.
+ (bootstrap*): Depend on all-bootstrap.
+
+2000-09-02 Alexandre Oliva <aoliva@redhat.com>, DJ Delorie <dj@redhat.com>
+
+ * configure.in (FLAGS_FOR_TARGET): Use -nostdinc even for Canadian
+ crosses, but add gcc/include to the header search path for them.
+
+2000-08-31 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh: Updated from libtool multi-language branch.
+ * libtool.m4, ltcf-c.sh: Copied from libtool multi-language branch.
+ * gettext.m4: New file, extracted from aclocal.m4.
+
+2000-08-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * config-ml.in (CC, CXX): Avoid trailing whitespace.
+ (LD_LIBRARY_PATH, SHLIB_PATH): Adjust for multilibs and export to
+ sub-configures.
+
+2000-08-20 Doug Evans <dje@casey.transmeta.com>
+
+ * Makefile.in (ALL_MODULES): Add all-cgen.
+ (CROSS_CHECK_MODULES,INSTALL_MODULES,CLEAN_MODULES): Similarily.
+ (all-cgen): New target.
+ (all-opcodes,all-sim): Depend on all-cgen.
+ * configure.in (host_tools): Add cgen.
+ Only configure cgen if --enable-cgen-maint.
+
+2000-08-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * config-ml.in (CC, CXX): Don't introduce a leading space.
+
+2000-08-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libstdcxx_flags): Use
+ libstdc++-v3/src/libstdc++.INC.
+
+2000-08-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libstdcxx_flags): Use libstdc++-v3/src/INCLUDES.
+
+2000-08-11 Jason Merrill <jason@redhat.com>
+
+ * configure.in (CC_FOR_TARGET, CHILL_FOR_TARGET,
+ CXX_FOR_TARGET): Add -B$$r/gcc/ here.
+ (FLAGS_FOR_TARGET): Not here.
+ (CHILL_FOR_TARGET, CXX_FOR_TARGET): Don't check the list of languages.
+
+2000-08-07 DJ Delorie <dj@redhat.com>
+
+ * configure.in (FLAGS_FOR_TARGET): invert test for xgcc, should mean
+ "if we're also building gcc, and it's a gcc that will run on the
+ build machine, we want to use its includes instead of the system's
+ default includes".
+
+2000-08-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libstdcxx_flags): Don't use `"'.
+
+ * config-ml.in: Adjust multilib search paths to the
+ appropriate multilib tree.
+
+2000-08-02 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (CHILL_FOR_TARGET, CXX_FOR_TARGET): Convert blanks to
+ commas in $LANGUAGES.
+
+2000-08-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (qCXX_FOR_TARGET): Use echo instead of expr.
+
+2000-07-31 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (qCXX_FOR_TARGET): Quote `&' characters in
+ CXX_FOR_TARGET for sed.
+
+2000-07-30 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (CC_FOR_TARGET, CHILL_FOR_TARGET, CXX_FOR_TARGET):
+ Do not override if already set in the environment or in configure.
+ Don't duplicate $(FLAGS_FOR_TARGET) if it already appears in them.
+ (FLAGS_FOR_TARGET): Don't use host directories on Canadian crosses.
+
+2000-07-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (FLAGS_FOR_TARGET): New macro.
+ (GCC_FOR_TARGET): Use it.
+ (CC_FOR_TARGET, CXX_FOR_TARGET, CHILL_FOR_TARGET): Now defined...
+ * configure.in: ... here.
+ (FLAGS_FOR_TARGET): Define. Add ld build dir to -L path.
+ (libstdcxx_flags): Define and append to CXX_FOR_TARGET.
+
+2000-07-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (configure-target-libf2c): Depend on $(ALL_GCC).
+ (configure-target-libchill, configure-target-libobjc): Likewise.
+
+ * configure.in: Use the same cache file for all target libs.
+ * config-ml.in: But different cache files per multilib variant.
+
+2000-07-23 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * configure (topsrcdir): Don't use dirname.
+
+2000-07-20 Jason Merrill <jason@redhat.com>
+
+ * configure.in: Remove all references to libg++ and librx.
+
+ * configure, configure.in, Makefile.in: Unify gcc and binutils.
+
+2000-07-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * config.sub: Update to subversions version 2000-07-06.
+
+2000-07-12 Andrew Haley <aph@cygnus.com>
+
+ * configure.in (host_makefile_frag): Use mh-ia64pic on IA-64 hosts.
+ (target_makefile_frag): Use mt-ia64pic on IA-64 targets.
+
+2000-07-07 Phil Edwards <pme@sourceware.cygnus.com>
+
+ * symlink-tree: Check number of arguments.
+
+2000-06-06 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * texinfo/texinfo.tex: Update to version 2000-05-28.15.
+
+2000-07-05 Jim Wilson <wilson@cygnus.com>
+
+ * Makefile.in (CXX_FOR_TARGET): Add libstdc++ to the library
+ search path for a g++ extracted from the build tree. This
+ will allow link tests run by configure scripts in
+ subdirectories to succeed.
+
+2000-07-01 Koundinya K <kk@ddeorg.soft.net>
+
+ * ltconfig: Add support for mips-dde-sysv4.2MP
+
+2000-06-28 Corinna Vinschen <vinschen@cygnus.com>
+
+ * ltconfig: Check for host_os beeing one of `cygwin', `mingw' or
+ `os2'. Force ac_cv_exeext to be ".exe" in that case.
+
+2000-06-19 Timothy Wall <twall@cygnus.com>
+
+ * configure.in (noconfigdirs): Set noconfigdirs for tic54x target.
+ * config.sub: Add tic54x target.
+
+2000-06-07 Phillip Thomas <pthomas@suse.de>
+
+ * README-maintainer-mode: New file: Contains notes on using
+ --enable-maintainer-mode with binutils.
+
+2000-05-29 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * texinfo/texinfo.tex: Update. Version from makeinfo 4.0.
+
+2000-05-30 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config.sub: Import CVS version 1.167 Tue May 30 09:00:07 2000.
+ * config.guess: Import CVS version 1.148 Tue May 30 09:00:06 2000
+
+20000-05-21 H.J. Lu (hjl@gnu.org)
+
+ * Makefile.in (CC_FOR_TARGET): Make sure as/ld in the gcc
+ directory are used if they exist. Make sure
+ $(build_tooldir)/include is searched for header files,
+ $(build_tooldir)/lib/ for library files.
+ (GCC_FOR_TARGET): Likewise.
+ (CXX_FOR_TARGET): Likewise.
+
+2000-05-18 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in (hppa*64*-*-*): Do build ld for this configuration.
+
+2000-05-17 Alexandre Oliva <aoliva@cygnus.com>
+
+ * Makefile.in (configure-target-libiberty): Depend on
+ configure-target-newlib.
+
+2000-05-16 Alexandre Oliva <aoliva@cygnus.com>
+
+ * configure.in, Makefile.in: Merge all libffi-related
+ configury stuff from the libgcj tree.
+
+2000-05-16 Andrew Cagney <cagney@b1.cygnus.com>
+
+ Thu Apr 27 11:01:48 2000 Andrew Cagney <cagney@b1.cygnus.com>:
+ * Makefile.in (do-tar-bz2, do-md5sum): Skip CVS directories.
+
+2000-05-16 Andrew Cagney <cagney@b1.cygnus.com>
+
+ Wed Apr 26 17:03:53 2000 Andrew Cagney <cagney@b1.cygnus.com>:
+ * Makefile.in (do-djunpack): New target. Update djunpack.bat with
+ current version information. Add to proto-toplev directory.
+ (gdb-taz): Build do-djunpack.
+
+2000-05-15 David Edelsohn <edelsohn@gnu.org>
+
+ * configure.in: Special case powerpc*-*-aix* target_makefile_frag.
+
+2000-05-13 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * ltmain.sh: Preserve in relink_command any environment
+ variables that may affect the linker behavior.
+
+2000-05-12 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub (basic_machine): Recognize hppa64 as a valid cpu type.
+
+2000-05-10 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (ia64*-*-elf*): Add gdb and friends to noconfigdirs.
+
+2000-05-08 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * djunpack.bat: Change the Sed script to replace @V@ in fnchange.lst
+ with the version name.
+
+2000-05-01 Benjamin Kosnik <bkoz@cygnus.com>
+
+ * config.if: Tweak.
+
+2000-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * djunpack.bat: New file.
+
+2000-04-19 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2,
+ gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2,
+ dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2,
+ insight+dejagnu.tar.bz2, newlib.tar.bz2): Pass MD5PROG to sub-make.
+
+2000-04-16 Dave Pitts <dpitts@cozx.com>
+
+ * config.sub (case $basic_machine): Change default for "ibm-*"
+ to "openedition".
+
+2000-04-12 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (gdb-taz): New target. GDB specific archive.
+ (do-md5sum): New target.
+ (MD5PROG): Define.
+ (PACKAGE): Default to TOOL.
+ (VER): Default to a shell script.
+ (taz): Rewrite target. Move real work to do-proto-toplev. Include
+ md5 checksum generation.
+ (do-proto-toplev): New target. Create $(PACKAGE)-$(VER) link.
+ (do-tar-bz2): Delete creation of $(PACKAGE)-$(VER) link.
+ (gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2,
+ insight.tar.bz2): Use gdb-taz to create archive.
+
+2000-04-07 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure (warn_cflags): Delete.
+
+2000-04-05 Benjamin Kosnik <bkoz@cygnus.com>
+ Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
+
+ * configure.in (enable_libstdcxx_v3): Add.
+ (target_libs): Add bits here to switch between libstdc++-v2 and
+ libstdc++-v3.
+ * config.if: And this file too.
+ * Makefile.in: Add libstdc++-v3 targets.
+
+2000-04-05 Michael Meissner <meissner@redhat.com>
+
+ * config.sub (d30v): Add d30v as a basic machine type.
+
+2000-03-29 Jason Merrill <jason@casey.cygnus.com>
+
+ * configure.in: -linux-gnu*, not -linux-gnu.
+
+2000-03-03 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (taz): Set PACKAGE to TOOL when not defined.
+ (do-tar-bz2): Replace TOOL with PACKAGE.
+ (gdb.tar.bz2): Remove GDBTK from GDB package.
+ (gdb+dejagnu.tar.bz2, insight.tar.bz2, insight+dejagnu.tar.bz2,
+ dejagnu.tar.bz2): New packages.
+
+2000-02-27 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Add entry for mips*-*-linux*, move catch all
+ *-*-*linux* entry below this one.
+
+2000-02-27 Ian Lance Taylor <ian@zembu.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.3.4.
+
+2000-02-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Support an OS of "wince".
+
+2000-02-24 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config.guess, config.sub: Updated to match config's 2000-02-15
+ version.
+
+2000-02-23 Linas Vepstas <linas@linas.org>
+
+ * config.sub: Add support for Linux/IBM 370.
+ * configure.in: Likewise.
+
+2000-02-22 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Add mips-pe, sh-pe and arm-wince-pe targets.
+
+2000-02-20 Christopher Faylor <cgf@cygnus.com>
+
+ * config.guess: Guess "cygwin" rather than "cygwin32".
+
+2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure (gcc_version): When setting, narrow search to
+ lines containing `version_string'.
+
+2000-02-15 Denis Chertykov <denisc@overta.ru>
+
+ * config.sub: Add support for avr target.
+
+2000-02-01 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config.sub: Add mmix-knuth-mmixware.
+
+2000-01-27 Christopher Faylor <cgf@redhat.com>
+
+ * Makefile.in (CC_FOR_TARGET): Add new winsup directory
+ structure stuff to -L library search.
+ (CXX_FOR_TARGET): Ditto.
+ (CROSS_CHECK_MODULES): Fix spelling mistake.
+
+2000-01-24 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (CXX_FOR_TARGET): Use g++, not xgcc, to invoke
+ the C++ compiler.
+
+2000-01-12 Richard Henderson <rth@cygnus.com>
+
+ * configure.in: Don't build some bits for beos.
+
+2000-01-12 Joel Sherrill (joel@OARcorp.com)
+
+ * Makefile.in (CC_FOR_TARGET): Use newlib libraries as well
+ as include files.
+
+2000-01-06 Geoff Keating <geoffk@cygnus.com>
+
+ * configure.in: Use mt-aix43 to handle *_TARGET defs,
+ not mh-aix43.
+
+1999-12-14 Richard Henderson <rth@cygnus.com>
+
+ * config.guess (alpha-osf, alpha-linux): Detect ev67.
+ * config.sub: Accept alphaev[78], alphaev8.
+
+1999-12-03 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * config.guess, config.sub: Update from autoconf.
+
+Tue Nov 23 00:57:41 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config-ml.in (sparc*-*-*): Disable sparcv9 support if the
+ necessary libraries are missing.
+
+1999-10-25 Andreas Schwab <schwab@suse.de>
+
+ * configure: Fix quoting inside arguments of eval.
+
+1999-10-21 Nick Clifton <nickc@cygnus.com>
+
+ * config-ml.in: Allow suppression of some ARM multilibs.
+
+Tue Sep 7 23:33:57 1999 Linas Vepstas <linas@linas.org>
+
+ * config.guess: Add OS/390 match pattern.
+ * config.sub: Add mvs, openedition targets.
+ * configure.in (i370-ibm-opened*): New.
+
+1999-09-04 Steve Chamberlain <sac@pobox.com>
+
+ * config.sub: Add support for configuring for pj.
+
+1999-08-31 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub (maybe_os): Add support for configuring for fr30.
+
+1999-08-25 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Do not configure or build ld for AIX
+ platforms. ld is known to be broken on these platforms.
+
+Wed Aug 25 01:12:25 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config-ml.in: Pass compiler flag corresponding to multidirs to
+ subdir configures.
+
+1999-08-09 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in (LDFLAGS): Define.
+
+1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * configure.in (i[3456]-*-mingw32*): Don't put gprof in
+ noconfigdirs.
+ (*-*-cygwin*): Likewise.
+
+1999-08-08 Ian Lance Taylor <ian@zembu.com>
+
+ * mkdep: New file.
+ * Makefile.in (GAS_SUPPORT_DIRS): Add mkdep.
+ (BINUTILS_SUPPORT_DIRS): Add mkdep.
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * configure (tmpfile): Change cONf$$ to cNf$$ to avoid an overly
+ long file name when using DJGPP on MS-DOS.
+
+Wed Aug 4 02:07:14 1999 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub (vxworks case): Use os=-vxworks, not os=vxworks.
+
+1999-07-30 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * Makefile.in (check-target-libio): Remove all-target-libstdc++
+ dependency as this causes "make check" to globally "make all"
+
+Tue Jun 22 23:45:18 1999 Tom Tromey <tromey@cygnus.com>
+
+ * configure.in (target_libs): Added target-zlib.
+ * Makefile.in (ALL_TARGET_MODULES): Added zlib.
+ (CONFIGURE_TARGET_MODULES): Likewise.
+ (CHECK_TARGET_MODULES): Likewise.
+ (INSTALL_TARGET_MODULES): Likewise.
+ (CLEAN_TARGET_MODULES): Likewise.
+ (configure-target-zlib): New target.
+ (all-target-zlib): Likewise.
+ (all-target-libjava): Depend on all-target-zlib.
+ (configure-target-libjava): Depend on configure-target-zlib.
+
+ * Makefile.in (configure-target-libjava): Depend on
+ configure-target-newlib.
+ (configure-target-boehm-gc): New target.
+ (configure-target-qthreads): New target.
+
+ * configure.in (target_libs): Added target-qthreads.
+ * Makefile.in (ALL_TARGET_MODULES): Added qthreads.
+ (CONFIGURE_TARGET_MODULES): Likewise.
+ (CHECK_TARGET_MODULES): Likewise.
+ (INSTALL_TARGET_MODULES): Likewise.
+ (CLEAN_TARGET_MODULES): Likewise.
+ (all-target-qthreads): New target.
+ (configure-target-libjava): Depend on configure-target-qthreads.
+ (all-target-libjava): Depend on all-target-qthreads.
+
+ * Makefile.in (ALL_TARGET_MODULES): Added libjava, boehm-gc.
+ (CONFIGURE_TARGET_MODULES): Likewise.
+ (CHECK_TARGET_MODULES): Likewise.
+ (INSTALL_TARGET_MODULES): Likewise.
+ (CLEAN_TARGET_MODULES): Likewise.
+ (all-target-libjava): New target.
+ (all-target-boehm-gc): Likewise.
+ * configure.in (target_libs): Added libjava, boehm-gc.
+
+1999-07-22 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in (binutils.tar.bz2): Don't pass makeall.bat and
+ configure.bat in SUPPORT_FILES.
+ (gas+binutils.tar.bz2): Likewise.
+
+ * makeall.bat: Remove; obsolete.
+
+1999-07-21 Ian Lance Taylor <ian@zembu.com>
+
+ From Mark Elbrecht:
+ * configure.bat: Remove; obsolete.
+
+1999-07-11 Ian Lance Taylor <ian@zembu.com>
+
+ * configure: Add -W -Wall to the default CFLAGS when compiling with
+ gcc.
+
+Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * configure.in: Build ld, binutils & gas for hppa*-*-linux-gnu*.
+
+1999-06-30 Mark Mitchell <mark@codesourcery.com>
+
+ * configure.in: Build ld on IRIX6.
+
+1999-06-12 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.in: Change distribution targets to use bzip2 instead of
+ gzip.
+ (TEXINFO_SUPPORT): Set to just texinfo/texinfo.tex.
+ (taz): Don't use texinfo/gpl.texinfo or texinfo/lgpl.texinfo.
+
+1999-06-04 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Add mcore target.
+
+1999-05-30 Cort Dougan <cort@cs.nmt.edu>
+
+ * config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux.
+
+1999-05-25 H.J. Lu (hjl@gnu.org)
+
+ * config.guess (dummy): Changed to $dummy.
+
+1999-05-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Tidied up case statements.
+
+1999-05-22 Ben Elliston <bje@cygnus.com>
+
+ * config.guess: Handle NEC UX/4800. Contributed by Jiro Takabatake
+ <jiro@din.or.jp>.
+
+ * config.guess: Merge with FSF version. Future changes will be
+ more accurately recorded in this ChangeLog.
+ * config.sub: Likewise.
+
+1999-05-20 Stephen L Moshier <moshier@world.std.com>
+
+ * Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include.
+
+1999-04-30 Tom Tromey <tromey@cygnus.com>
+
+ * ltmain.sh: [mode link] Always use CC given by ltconfig.
+
+1999-04-23 Tom Tromey <tromey@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.2f.
+
+1999-04-20 Drew Moseley <dmoseley@cygnus.com>
+
+ * configure.in (noconfigdirs): Don't build libstub for arm-elf targets.
+ (noconfigdirs): Don't build any bsp stuff for for arm-oabi targets.
+ Bad merge removed these two changes.
+
+Tue Apr 13 22:50:54 1999 Donn Terry (donn@interix.com)
+ Martin Heller (Ing.-Buero_Heller@t-online.de)
+
+ * config.guess (interix Alpha): Add.
+
+1999-04-11 Richard Henderson <rth@cygnus.com>
+
+ * configure.in (i?86-*-beos*): Do config gperf; don't config
+ gdb, newlib, or libgloss.
+
+1999-04-11 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * config-ml.in: On mips*-*-*, if multidirs contains mabi=64, try to
+ link a trivial program with -mabi=64. If it fails, remove mabi=64
+ from multidirs.
+
+1999-04-10 Philipp Thomas (kthomas@gwdg.de)
+
+ * config.sub: Set basic_machine to i586 when target_alias = k6-*.
+
+1999-04-08 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Add support for mcore targets.
+
+1999-04-07 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*): Use config/mt-d30v as makefile fragment,
+ not mt-ospace, in order to shut up assembler warning about using
+ symbols that are named the same as registers.
+
+1999-04-07 Drew Moseley <dmoseley@cygnus.com>
+
+ * Makefile.in (all-target-cygmon): Added all-target-bsp to the
+ dependency list for all-target-cygmon.
+
+1999-04-05 Doug Evans <devans@casey.cygnus.com>
+
+ * config-ml.in: Check $host, not $target, for selective multilibs.
+ (arm-*-*): Allow disabling of biendian, h/w fp, 26 bit apcs,
+ thumb interworking, and underscore prefix multilibs.
+
+1999-04-04 Ian Lance Taylor <ian@zembu.com>
+
+ * missing: Update to version from current automake.
+
+Fri Apr 2 15:11:32 1999 H.J. Lu (hjl@gnu.org)
+
+ * configure (gxx_include_dir): Removed.
+
+ * configure.in (gxx_include_dir): Handle it.
+ * Makefile.in: Likewise.
+
+1999-03-29 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * config.sub (mips64vr4111,mips64vr4111el) Add.
+
+1999-03-21 Ben Elliston <bje@cygnus.com>
+
+ * config.guess: Correct typo for detecting ELF on FreeBSD.
+
+Thu Mar 18 00:17:50 1999 Mark Elbrecht <snowball3@usa.net>
+
+ * config/mh-go32: Delete.
+ * config/mh-djgpp: New. Renamed from mh-go32.
+ * configure.in (pc-msdosdjgpp): Set host_makefile_frag to
+ config/mh-djgpp.
+
+Thu Mar 11 18:37:23 1999 Drew Moseley <dmoseley@cygnus.com>
+
+ * Makefile.in (all-target-bsp): Added all-gcc all-binutils and
+ all-target-newlib to dependency list for all-target-bsp.
+
+Thu Mar 11 01:19:31 1999 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * config.sub: Add i386-uwin support.
+ * config.guess: Likewise.
+
+Thu Mar 11 01:07:55 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * configure.in: cleanup, add mh-*pic handling for arm, special
+ case powerpc*-*-aix*
+
+Wed Mar 10 18:35:07 1999 Jeff Johnston <jjohnstn@cygnus.com>
+
+ * configure.in (noconfigdirs): Removed target-libgloss so libnosys.a
+ can be built.
+
+Wed Mar 10 17:39:09 1999 Drew Moseley <dmoseley@cygnus.com>
+
+ * configure.in: Added bsp support to arm-*-coff and arm-*-elf
+ targets.
+
+1999-03-02 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Rename CYGNUS LOCAL to EGCS LOCAL
+
+1999-02-28 Geoffrey Noer <noer@cygnus.com>
+
+ * config.sub: Check for "cygwin*" rather than "cygwin32*"
+
+1999-02-24 Nick Clifton <nickc@cygnus.com>
+
+ * config.sub: Fix typo in arm recognition.
+
+1999-02-24 Drew Moseley <dmoseley@cygnus.com>
+
+ * configure.in (noconfigdirs): Changed target_configdirs to
+ include target-bsp only for m68k-*-elf* and m68k-*-coff*
+ rather than m68k-*-* since it is not known to work on
+ m68k-aout. Ditto for arm-*-*oabi.
+
+1999-02-24 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (*-*-windows*): Remove, no longer used.
+ * config/mh-windows: Ditto.
+
+1999-02-19 Ben Elliston <bje@cygnus.com>
+
+ * config.guess: Automatically recognise ELF on FreeBSD. From Niall
+ Smart and improved by Andrew Cagney.
+
+1999-02-18 Marc Espie <espie@cvs.openbsd.org>
+
+ * config.guess: Recognize openbsd-*-hppa.
+
+1999-02-17 H.J. Lu (hjl@gnu.org)
+
+ * Makefile.in (REALLY_SET_LIB_PATH): Append $$$(RPATH_ENVVAR)
+ only if it is not empty.
+
+1999-02-17 Nick Clifton <nickc@cygnus.com>
+
+ Patch from: Scott Bambrough <scottb@corelcomputer.com>
+
+ * config.guess: Modified to recognize uname's armv* syntax.
+
+ * config.sub: Modified to recognize uname's armv* syntax.
+
+1999-02-17 Mark Salter <msalter@cygnus.com>
+
+ * configure.in: Added target-bsp for sparclite.
+
+1999-02-08 Richard Henderson <rth@cygnus.com>
+
+ * config.sub: Recognize alphapca5[67] and up to alphaev8.
+
+1999-02-08 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Add support for strongarm port.
+ * config.sub: Add support for strongarm target.
+
+1999-02-07 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * configure.in (*-*-cygwin32*): Use config/mh-cygwin instead of
+ the old name config/mh-cygwin32.
+ Enable texinfo.
+
+1999-02-04 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Do build ld for ix86 Solaris.
+
+1999-02-02 Jim Wilson <wilson@cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Set AR to $AR instead of
+ $AR_FOR_TARGET. Likewise for RANLIB.
+
+1999-02-02 Catherine Moore <clm@cygnus.com>
+
+ * config.sub (oabi): Recognize.
+ * configure.in (arm-*-oabi): Handle.
+
+1999-01-30 Robert Lipe (robertlipe@usa.net)
+
+ * config.guess: Improve detection of i686 on UnixWare 7.
+
+1999-01-30 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * config.guess: Add support for i386-pc-interix.
+ * config.sub: Likewise.
+ * configure.in: Likewise.
+ * config/mh-interix: New file.
+
+1999-01-18 Christopher Faylor <cgf@cygnus.com>
+
+ * Makefile.in: Remove unneeded all-target-libio from
+ from all-target-winsup target since it is now unneeded.
+ Add all-target-libtermcap in its place since it is now
+ needed.
+
+1998-12-30 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: makefile stub for cygwin target is probably
+ unnecessary. Remove it for now.
+ * config/mt-cygwin: Remove.
+
+1998-12-30 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: libtermcap.a should be built when cygwin is the
+ target as well as the host.
+ * config.guess: Allow mixed case in cygwin uname output.
+ * Makefile.in: Add libtermcap target.
+ * config/mt-cygwin: New file. libtermcap target info.
+
+1998-12-23 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Clean up handling of hppa2.0.
+
+1998-12-22 Rodney Brown (rodneybrown@pmsc.com)
+
+ * config.guess: Use C code to identify more HP machines.
+
+Thu Dec 17 01:22:30 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Handle hppa2.0.
+
+Tue Dec 15 17:02:58 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * configure.in: Add cygmon for x86-coff and x86-elf. Configure
+ cygmon for all sparclite targets, regardless of object format.
+
+1998-12-15 Mark Salter <msalter@cygnus.com>
+
+ * configure.in: Added target-bsp for several target architectures.
+
+ * Makefile.in: Added rules for bsp.
+
+Fri Dec 4 01:34:02 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess: Improve detection of hppa2.0 processors.
+
+Fri Dec 4 01:33:05 1998 Niall Smart <nialls@euristix.ie>
+
+ * config.guess: Recognize FreeBSD using ELF automatically.
+
+1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (skip-this-dir): Add handling for new shell script, which
+ might be created by a sub-directory's configure to indicate, this particular
+ directory is "unwanted".
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Likewise.
+
+Wed Nov 18 18:28:45 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * ltconfig: import from libtool, after changing libtool to
+ account for the cygwin name change.
+
+Wed Nov 18 18:09:14 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: CC_FOR_TARGET and CXX_FOR_TARGET should also
+ include newlib/libc/sys/cygwin and newlib/libc/sys/cygwin32.
+
+Wed Nov 18 20:13:29 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Add libtermcap to list of cygwin dependencies.
+
+1998-11-17 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that
+ they include winsup/include when it's a cygwin target.
+
+1998-11-12 Tom Tromey <tromey@cygnus.com>
+
+ * configure.in (host_tools): Added zip.
+ * Makefile.in (all-target-libjava): Depend on all-zip.
+ (all-zip): New target.
+ (ALL_MODULES): Added all-zip.
+ (NATIVE_CHECK_MODULES): Added check-zip.
+ (INSTALL_MODULES): Added install-zip.
+ (CLEAN_MODULES): Added clean-zip.
+
+1998-11-12 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: lose "32" from comment about cygwin.
+
+1998-11-05 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Use -Os to build target libraries for the fr30.
+
+1998-11-04 Dave Brolley <brolley@cygnus.com>
+
+ * config.sub: Add fr30.
+
+1998-11-02 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: drop "32" from config/mh-cygwin32. Check
+ cygwin* instead of cygwin32*.
+ * config.sub: Check cygwin* instead of cygwin32*.
+
+1998-10-22 Robert Lipe <robertl@dgii.com>
+
+ * config.guess: Match any version of Unixware7.
+
+1998-10-20 Syd Polk <spolk@cygnus.com>
+
+ * Makefile.in configure.in: Add the ability to use tcl8.1 and tk8.1
+ if desired.
+
+1998-10-18 Jeffrey A Law (law@cygnus.com)
+
+ * config.if (cxx_interface, libstdcxx_interface): Do not try to set
+ these if the appropriate directories and files to not exist.
+
+1998-10-14 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (DEVO_SUPPORT): Add config.if.
+
+1998-10-13 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure: Add pattern to replace "build_tooldir"'s
+ definition in the generated Makefile with "tooldir"'s
+ actual value.
+
+Tue Oct 13 09:17:06 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Bring back lost sparcv9.
+
+ * Makefile.in (all-snvavigator): Remove all-flexlm dependency.
+
+Mon Oct 12 12:09:44 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (CHILL_FOR_TARGET): Mirror recent changes to
+ CC_FOR_TARGET and friends.
+
+Mon Oct 12 12:09:30 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * Makefile.in (build_tooldir): New variable, same as tooldir.
+ (CC_FOR_TARGET, GCC_FOR_TARGET, CXX_FOR_TARGET): Add
+ -B$(build_tooldir)/bin/.
+ (BASE_FLAGS_TO_PASS): Pass build_tooldir down.
+
+Wed Sep 30 22:20:50 1998 Robert Lipe <robertl@dgii.com>
+
+ * config.sub: Add support for i[34567]86-pc-udk.
+ * configure.in: Likewise.
+
+Wed Sep 30 19:23:48 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: add bzip2 package building bits for user
+ tools module
+ * configure.in: ditto
+
+Wed Sep 30 03:00:05 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (TARGET_CONFIGDIRS): Add libobjc.
+ (ALL_TARGET_MODULES): Add all-target-libobjc.
+ (CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES): Similarly.
+ (INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES): Similarly.
+ (all-target-libchill): Add dependencies.
+ * configure.in (target_libs): Add libchill.
+
+1998-09-30 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure.in (target_subdir): Remove duplicate line.
+
+Tue Sep 29 22:45:41 1998 Felix Lee <flee@cygnus.com>
+
+ * Makefile.in (all-automake): fix dependencies.
+
+Mon Sep 28 04:04:27 1998 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Minor cleanups for building in the $(target_alias)
+ subdir.
+
+1998-09-22 Jim Wilson <wilson@cygnus.com>
+
+ * Makefile.in (bootstrap): Set r and s before make all. Use
+ BASE_FLAGS_TO_PASS in make all.
+ (cross): Likewise.
+
+1998-09-20 Mark Mitchell <mark@markmitchell.com>
+
+ * Makefile.in (bootstrap): Pass TARGET_FLAGS_TO_PASS to `make all'.
+
+Sun Sep 20 00:13:02 1998 Richard Henderson <rth@cygnus.com>
+
+ * config.sub: Fix typo in last change.
+
+1998-09-19 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config.sub: Add support for C4x target.
+ * configure.in: Likewise.
+
+1998-09-13 David S. Miller <davem@pierdol.cobaltmicro.com>
+
+ * config.sub: Recognize sparcv9 just like sparc64.
+
+Wed Sep 9 15:44:52 1998 Robert Lipe <robertl@dgii.com>
+
+ * config.guess: Match "Pent II" or "PentII" for OpenServer.
+
+Tue Sep 8 01:18:39 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess: Correctly identify Pentium II sco boxes.
+
+ * config.guess: Fix "tr" code. From Weiwen Liu.
+
+Sat Sep 5 13:56:52 1998 John Hughes <john@Calva.COM>
+
+ * configure.in: Do not assume x86-svr4 or x86-unixware can handle
+ stabs.
+
+Sat Sep 5 02:12:02 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (TARGET_CONFIGDIRS): Add libchill.
+ (ALL_TARGET_MODULES): Add all-target-libchill.
+ (CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES): Similarly.
+ (INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES): Similarly.
+ (all-target-libchill): Add dependencies.
+ * configure.in (target_libs): Add libchill.
+
+Sun Aug 30 22:27:02 1998 Lutz Wohlrab <lutz.wohlrab@informatik.tu-chemnitz.de>
+
+ * config.guess: Avoid assumptions about "tr" behaves when
+ LANG is set to something other than English.
+
+Sun Aug 30 22:14:44 1998 H.J. Lu (hjl@gnu.org)
+
+ * configure (gxx_include_dir): Changed to
+ '${prefix}/include/g++'-${libstdcxx_interface}.
+
+ * config.if: New to determine the interfaces.
+
+Sun Aug 30 21:15:19 1998 Mark Klein (mklein@dis.com)
+
+ * config.guess: Detect and handle MPE/IX.
+ * config.sub: Deal with MPE/IX.
+
+Sat Aug 29 14:32:55 1998 David Edelsohn <edelsohn@mhpcc.edu>
+
+ * configure.in: Use mh-aix43.
+
+1998-07-29 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure: Fix --without/--disable cases for gxx-include-dir.
+
+Fri Aug 28 12:28:26 1998 Per Bothner <bothner@cygnus.com>
+
+ * mdata-sh: Imported. Needed for automake support.
+
+Thu Aug 13 12:49:29 1998 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.in (taz): Try "chmod -R og=u ." before
+ "chmod og=u `find . -print`".
+
+Fri Jul 31 09:38:33 1998 Catherine Moore <clm@cygnus.com>
+
+ * configure.in: Add arm-elf and thumb-elf support.
+
+Mon Jul 27 16:23:58 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * Makefile.in: Undo previous patch.
+
+Fri Jul 24 19:55:24 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * Makefile.in (INSTALL_TARGET): Move EXTRA_TARGET_HOST_INSTALL_MODULES
+ to here ...
+ (install-no-fixedincludes): and here
+ (INSTALL_MODULES): ... from here.
+
+Fri Jul 24 17:01:42 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Merge with FSF.
+
+ * config.guess: Merge with FSF.
+
+Fri Jul 24 08:43:36 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * configure (extraconfigdirs): New variable.
+ (SUBDIRS): Add extraconfigdirs and recurse on them too.
+ * Makefile.in (all): Move higher in file.
+ (EXTRA_TARGET_HOST_ALL_MODULES): New variable.
+ (EXTRA_TARGET_HOST_{INSTALL,CHECK}_MODULES): New variables.
+ (ALL_MODULES): Add EXTRA_TARGET_HOST_ALL_MODULES.
+ (CROSS_CHECK_MODULES): Add EXTRA_TARGET_HOST_CHECK_MODULES.
+ (INSTALL_MODULES): Add EXTRA_TARGET_HOST_INSTALL_MODULES.
+
+1998-07-23 Brendan Kehoe <brendan@cygnus.com>
+
+ * Makefile.in (all-target-libjava): Depend on all-gcc and
+ all-target-newlib.
+ (configure-target-libjava): Depend on $(ALL_GCC).
+
+Sat Jul 18 14:32:43 CDT 1998 Robert Lipe <robertl@dgii.com>
+
+ * config.guess: (*-pc-sco3.2v5) Add detection for Pentium II.
+ (*-pc-unixware7) Add detection for Pentium II, Pentium Pro.
+
+Fri Jul 17 13:30:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ylwrap: Change absolute path checks to check for DOS style path
+ names.
+
+ * ylwrap: Don't use a full path name if the source file is in the
+ same directory. From hjl@lucon.org (H.J. Lu).
+
+ * config-ml.in: Default to being verbose, to match Feb 18 change to
+ configure.
+
+Thu Jul 16 12:29:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Brought over from egcs:
+
+ Sat Jun 27 22:46:32 1998 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in (target_subdir): Set to ${target_alias} instead
+ of "libraries".
+
+ Mon Sep 1 16:45:44 1997 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (target_subdir): Set to libraries if enable_multilib.
+
+Wed Jul 15 01:00:54 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If there are any
+ multilibs, force reconfiguration the first time we create
+ multilib.out in a subdirectory, in case TARGET_SUBDIR is `.'.
+
+Tue Jul 14 23:41:03 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Strip any --no option from CONFIG_ARGUMENTS, to
+ avoid confusion with --no-recursion.
+
+Tue Jul 14 15:37:41 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: Win32 hosts shouldn't use install -x
+ * install-sh: remove -x option, and special .exe-handling
+ hack.
+
+Tue Jul 14 15:28:41 1998 Richard Henderson <rth@cygnus.com>
+
+ * config.guess: Recognize i586-pc-beos.
+ * configure.in: Don't build some bits for beos.
+
+Tue Jul 14 13:22:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: If CC is set but CFLAGS is not, and CC is gcc, make
+ CFLAGS default to -O2.
+
+ * ltmain.sh: Add some hacks to make SunOS --enable-shared work
+ when using GNU ld.
+
+Fri Jul 10 13:18:23 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltmain.sh: Correct install when using a different shell.
+
+Tue Jul 7 15:24:38 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.2b.
+
+Thu Jul 2 13:57:36 1998 Klaus Kaempf <kkaempf@rmi.de>
+
+ * makefile.vms: Update to build binutils/makefile.vms. Add install
+ target.
+
+Wed Jul 1 16:45:21 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig: Update to correct AIX handling.
+
+Sat Jun 27 22:46:32 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Add TARGET_SUBDIR.
+
+ * configure.in (target_subdir): Set to ${target_alias} instead
+ of "libraries".
+
+1998-06-26 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Add gcc_version_trigger.
+ (Makefile): Depend on $(gcc_version_trigger).
+
+ * configure (gcc_version): Change default initializer to empty
+ string.
+ (gcc_version_trigger): New variable; pass this variable down
+ to subdir configures to enable them checking gcc's version
+ themselves. Emit make macros for both gcc_version vars.
+ (topsrcdir): Initialize reliably.
+ (recursion line): Remove --with-gcc-version=${gcc_version}.
+
+1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (enable_version_specific_runtime_libs): Implement new flag
+ --enable-version-specific-runtime-libs which installs C++ runtime stuff
+ in $(libsubdir); emit definition in each generated Makefile.
+ (gxx_include_dir): Initialize depending on
+ $enable_version_specific_runtime_libs.
+
+1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (gcc_version): Initialize properly depending on
+ how and where configure is started.
+ (recursion line): Pass a --with-gcc-version=${gcc_version}
+ to configures in subdirs.
+
+Wed Jun 24 16:01:59 1998 John Metzler <jmetzler@cygnus.com>
+
+ * configure.in (noconfigdirs): Add configure pattern for mips tx39
+ cygmon
+
+Tue Jun 23 22:42:32 1998 Mark Alexander <marka@cygnus.com>
+
+ * configure.in: Add cygmon and libstub support for mn10200.
+
+1998-06-19 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (gcc_version): Add new variable describing the
+ particular gcc version we're building.
+ * Makefile.in (libsubdir): Add new macro for the directory
+ in which the compiler finds executables, libraries, etc.
+ (BASE_FLAGS_TO_PASS): Pass down gcc_version, target_alias
+ and libsubdir.
+
+Fri Jun 19 02:36:59 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * Makefile.in (local-clean): Remove *.log.
+ (warning.log): Built with warn_summary from build.log.
+ (mail-report.log): Run test_summary.
+ (mail-report-with-warnings.log): Run test_summary including
+ warning.log in the report.
+
+Thu Jun 18 11:26:03 1998 Robert Lipe <robertl@dgii.com>
+
+ * config.guess: Detection of Pentium II for *-sco-3.2v5*.
+
+Mon Jun 15 14:53:54 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (grep): Grep no longer depends on libiberty.
+
+Fri Jun 12 14:03:34 1998 Syd Polk <spolk@cygnus.com>
+
+ * Makefile.in: all-snavigator needs all-libgui.
+
+Thu Jun 11 19:43:47 1998 Mark Alexander <marka@cygnus.com>
+
+ * configure.in: Add cygmon and libstub support for mn10300.
+
+Wed Jun 10 11:19:47 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * missing: Update to version from automake 1.3.
+
+ * ltmain.sh: On installation, don't get confused if the same name
+ appears more than once in the list of library names.
+
+Wed Jun 3 14:51:42 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Accept m68060 and m5200 as CPU names.
+
+Mon Jun 1 17:25:16 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Use && rather than using -a in test, because odd
+ strings can confuse test.
+ * configure.in: Likewise.
+
+Thu May 28 19:31:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Bring in Visual C++ support.
+
+Sat May 23 23:44:13 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * Makefile.in (boostrap2-lean, bootstrap3-lean,
+ bootstrap4-lean): New targets.
+
+Mon May 11 23:55:56 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mpw-* Delete. Not used.
+
+Mon May 11 23:11:34 1998 Jeffrey A Law (law@cygnus.com)
+
+ * COPYING.LIB: Update FSF address.
+
+Fri May 8 01:30:20 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.2a.
+
+ * Makefile.in (GASB_SUPPORT_DIRS): Remove intl; already included via
+ GAS_SUPPORT_DIRS.
+
+Thu May 7 17:27:35 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Avoid producing a version number if
+ -version-info was not used.
+
+Tue May 5 18:02:24 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add --with-newlib to CONFIG_ARGUMENTS if we are
+ building with newlib.
+
+1998-04-30 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Remove backslash at end;
+ Solaris `make' causes it to continue to next definition.
+
+Tue Apr 28 16:24:24 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (install-gdbtk): Call this 'install-gdb' so that
+ the right GUI libraries and files are installed along with GDB.
+
+Tue Apr 28 18:11:24 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Change alpha to alpha* in several places.
+
+Tue Apr 28 07:42:00 1998 Mark Alexander <marka@cygnus.com>
+
+ * config.sub: Recognize sparc86x.
+
+Tue Apr 28 07:35:02 1998 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (--enable-target-optspace): Remove debug echo.
+
+Thu Apr 23 21:31:16 1998 Jim Wilson <wilson@cygnus.com>
+
+ * configure: Set CXXFLAGS from CXXFLAGS, not CFLAGS.
+
+Thu Apr 23 12:26:38 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig: Update cygwin32 support.
+
+ * Makefile.in (GAS_SUPPORT_DIRS): Add intl.
+ (BINUTILS_SUPPORT_DIRS, GASB_SUPPORT_DIRS): Likewise.
+ (GDB_SUPPORT_DIRS): Likewise.
+
+Wed Apr 22 12:30:10 1998 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (target_makefile_frag): If --enable-target-optspace,
+ use -Os to compile target libraries rather than -O2. Default to
+ using -Os for d10v and m32r if --{enable,disable}-target-optspace is
+ not used.
+ * configure.in (target_cflags): Ditto for d30v.
+
+Tue Apr 21 23:06:54 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (all-bfd): Depend on all-intl.
+ (all-binutils): Likewise.
+ (all-gas): Likewise.
+ (all-gprof): Likewise.
+ (all-ld): Likewise.
+
+1998-04-19 Brendan Kehoe <brendan@cygnus.com>
+
+ * configure.in (host_tools): Fix typo, lbtool -> libtool.
+
+Fri Apr 17 16:20:42 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (all-bfd): Depend upon all-libiberty.
+
+ * ltconfig, ltmain.sh: Bring in newer cygwin32 support.
+
+Fri Apr 17 12:22:22 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * Makefile.in: Add libstub.
+
+ * configure.in: Ditto. Build libstub for targets that have cygmon
+ support.
+
+Tue Apr 14 18:01:55 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't set PICFLAG on ix86-cygwin32.
+
+Tue Apr 14 12:24:45 1998 J. Kean Johnston <jkj@sco.com>
+
+ * configure.in: Recognise i[3456]96-*-sysv5* as a valid host, and
+ use mh-sysv5 if specified. Support gprof on SCO Open Server.
+
+Tue Apr 14 11:33:51 1998 Krister Walfridsson <cato@df.lth.se>
+
+ * configure: Define DEFAULT_M4 by searching PATH.
+ * Makfile.in: Use DEFAULT_M4.
+
+Mon Apr 13 15:37:24 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig: Add cygwin32 support.
+
+ * Makefile.in, configure.in: Add libtool as a native only directory
+ to configure and build.
+
+Sun Apr 12 20:58:46 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (INSTALL_MODULES): Remove texinfo.
+
+Wed Apr 8 13:18:56 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): XFOO lines shortened.
+
+Thu Apr 2 14:48:44 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: add ash make rules
+ * configure.in: add ash to native_only and host_tools lists
+
+Thu Mar 26 12:53:20 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (all-gettext, all-intl): New targets.
+ (ALL_MODULES): Added all-gettext, all-intl.
+ (CROSS_CHECK_MODULES): Added check-gettext, check-intl.
+ (INSTALL_MODULES): Added install-gettext, install-intl.
+ (CLEAN_MODULES): Added clean-gettext, clean-intl.
+
+ * configure.in (host_tools): Added gettext.
+ (native_only): Likewise.
+ (noconfigdirs) [various cases]: Likewise.
+ (host_libs): Added intl.
+
+Thu Mar 26 15:00:11 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * configure: Do not disable building gdbtk for cygwin32 hosts.
+
+Wed Mar 25 10:04:18 1998 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Add thumb-coff target.
+ * config.sub: Add thumb-coff target.
+
+Wed Mar 25 11:49:12 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in: Revert yesterday's change.
+ (all-target-winsup): all-target-librx stays out of here.
+
+Tue Mar 24 16:58:29 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (TARGET_CONFIGDIRS, ALL_TARGET_MODULES,
+ CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES,
+ INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES, all-target-winsup):
+ Remove references to librx and libg++.
+
+Tue Mar 24 18:28:12 1998 Eric Mumpower <nocturne@cygnus.com>
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Pass $(lispdir) down to
+ recursive makes
+
+Tue Mar 24 11:37:45 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET): Use $(TARGET_SUBDIR) when passing -B
+ for newlib directory.
+ (CXX_FOR_TARGET): Likewise.
+
+Mon Mar 23 11:30:21 1998 Jeffrey A Law (law@cygnus.com)
+
+ * ltconfig: Update after libtool/ltconfig.in change for
+ hpux11.
+
+Fri Mar 20 18:51:43 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update to libtool 1.2.
+
+Fri Mar 20 09:32:14 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * Makefile.in (install-gcc): Don't specify LANGUAGES here.
+ (install-gcc-cross): Instead, override LANGUAGES here.
+
+1998-03-18 Dave Love <d.love@dl.ac.uk>
+
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Set CONFIG_SITE to a
+ non-existent file since /dev/null loses with bash 2.0/autoconf 2.12.
+
+Wed Mar 18 09:24:59 1998 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in: Add Thumb-pe target.
+
+Tue Mar 17 16:59:00 1998 Syd Polk <spolk@cygnus.com>
+
+ * Makefile.in - changed sn targets to snavigator
+ * configure.in - changed sn targets to snavigator
+
+Tue Mar 17 10:33:28 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * config-ml.in: After building symlink tree call make distclean
+ if a Makefile got linked into ${ml_dir}/${ml_libdir}; this happens
+ to be the case for libiberty.
+
+Tue Mar 17 10:22:37 1998 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * configure: When making link, also check the current
+ directory. The configure scripts may create one.
+
+Fri Mar 6 01:02:03 1998 Richard Henderson <rth@cygnus.com>
+
+ * config.sub: Accept alphapca56 and alphaev6 properly.
+
+Fri Mar 6 00:14:55 1998 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * configure.in: Revert 3 Jan change for powerpc-linux-gnulibc1.
+
+Mon Feb 23 15:09:18 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de
+
+ * config.sub (sco5): Fix typo.
+
+Mon Feb 23 14:46:06 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL_MODULES): Move install-tcl before
+ install-itcl.
+ (install-itcl): Remove dependency on install-tcl.
+
+Mon Feb 23 09:53:28 1998 Mark Alexander <marka@cygnus.com>
+
+ * configure.in: Remove libgloss from noconfigdirs for MN10300.
+
+Thu Feb 19 13:40:41 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't build libgui for a cygwin32 target when not on
+ a cygwin32 host.
+
+Wed Feb 18 12:29:00 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure (redirect): Set to null, so default behavior of
+ configure is now --verbose.
+
+1998-02-16 Dave Love <d.love@dl.ac.uk>
+
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Run configure with
+ CONFIG_SITE=/dev/null to forestall lossage with site configuration.
+
+Mon Feb 16 12:23:53 1998 Manfred Hollstein <Manfred.Hollstein@ks.sel.alcatel.de>
+
+ * Makefile.in (BASE_FLAGS_TO_PASS, EXTRA_TARGET_FLAGS): Really add
+ this change to sync Makefile.in with its ChangeLog entries.
+
+Thu Feb 12 15:03:08 1998 H.J. Lu <hjl@gnu.org>
+
+ * ltmain.sh (mkdir): Check that the directory doesn't exist
+ before we exit with error, so that we don't get races during
+ parallel builds.
+
+Sat Feb 7 15:19:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update from libtool 1.0i.
+
+Fri Feb 6 01:33:52 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Don't pass PICFLAG and
+ PICFLAG_FOR_TARGET.
+ (EXTRA_TARGET_FLAGS): Don't pass PICFLAG_FOR_TARGET.
+
+ * configure: Emit a definition for the new macro enable_shared
+ into each Makefile.
+
+ * config/mh-sparcpic (PICFLAG): Define to properly according
+ to current multilib configuration.
+ * config/mt-sparcpic (PICFLAG_FOR_TARGET): Define to properly
+ according to current multilib configuration.
+
+Thu Feb 5 17:01:12 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in (host_tools, native_only): Add libtool.
+
+Wed Feb 4 16:53:58 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: add target-gperf to noconfigdirs for Cygwin32.
+ Fix typo in ming config comment.
+
+Wed Feb 4 18:56:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltconfig, ltmain.sh: Update from libtool 1.0h.
+
+Mon Feb 2 19:38:19 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Add tic30 cases, and map c30 to tic30.
+
+Sun Feb 1 02:40:41 1998 Richard Henderson <rth@cygnus.com>
+
+ * Makefile.in (TARGET_CONFIGDIRS): Add libf2c.
+ (ALL_TARGET_MODULES, CONFIGURE_TARGET_MODULES): Similarly
+ (CHECK_TARGET_MODULES, INSTALL_TARGET_MODULES): Similarly
+ (CLEAN_TARGET_MODULES): Similarly
+ (all-target-libf2c): Add dependences.
+ * configure.in (target_libs): Add libf2c.
+
+Fri Jan 30 17:18:32 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: Remove expect from noconfigdirs when target
+ is cygwin32. OK to build expect and dejagnu with Canadian
+ Cross.
+
+Wed Jan 28 12:58:49 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Do build expect, dejagnu, and cvssrc for a cygwin32
+ host.
+
+ * config.guess: Use ${UNAME_MACHINE} rather than i386 for cygwin32
+ and mingw32.
+
+Wed Jan 28 10:26:37 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Remove passing $(local_prefix)
+ here as it is not defined in the toplevel Makefile.
+
+Tue Jan 27 23:25:06 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (package_makefile_rules_frag): New variable, which names
+ a file with generic rules, ...
+ Change comment to mention we now have FIVE parts.
+ * configure: Undo last change.
+
+Tue Jan 27 23:15:55 1998 Lassi A. Tuura <lat@iki.fi>
+
+ * config.guess: More accurate determination of HP processor types.
+ * config.sub: More accurate determination of HP processor types.
+
+Sat Jan 24 01:59:45 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure (package_makefile_frag): Move inserting the
+ ${package_makefile_frag} to where it should be according
+ to the comment.
+
+Fri Jan 23 00:29:28 1998 Philip Blundell <pb@nexus.co.uk>
+
+ * config.guess: Add support for Linux/ARM.
+
+Thu Jan 22 15:14:01 1998 Fred Fish <fnf@cygnus.com>
+
+ * .cvsignore: Remove *-info and *-install since they match
+ release-info and mpw-install, which we don't want to just ignore.
+
+Thu Jan 22 01:38:33 1998 Richard Henderson <rth@cygnus.com>
+
+ * configure.in: Revert 3 Jan change for alpha-linux-gnulibc1.
+
+Sat Jan 17 21:28:08 1998 Pieter Nagel <pnagel@epiuse.co.za>
+
+ * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and
+ local_prefix to sub-make invocations.
+
+Sat Jan 17 21:04:59 1998 H.J. Lu (hjl@gnu.org)
+
+ * configure.in: Check makefile fragments in the source
+ directory.
+
+Fri Jan 16 00:41:37 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * configure.in: Check whether host and target makefile
+ fragments exist before adding them to *_makefile_frag.
+
+Wed Jan 14 23:39:10 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * configure.in (target_configdirs): Add cygmon for sparc64-elf.
+
+Wed Jan 14 12:48:07 1998 Keith Seitz <keiths@pizza.cygnus.com>
+
+ * configure.in: Make sure we only replace RPATH_ENVVAR on
+ lines which begin with RPATH_ENVVAR, i.e. add "^" to the
+ regexp to sed.
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Pass RRPATH_ENVVAR down
+ to sub-makes.
+
+1998-01-13 Lee Iverson (leei@ai.sri.com)
+
+ * config-ml.in (multi-do): LDFLAGS must include multilib
+ designator.
+
+Tue Jan 13 01:13:24 1998 Robert Lipe (robertl@dgii.com)
+
+ * config.guess: Recognize i[3456]-i586-UnixWare7-sysv5.
+
+Sun Jan 4 01:06:55 1998 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * config.sub: Add mingw32 support.
+ * configure.in: Likewise.
+ * config/mh-mingw32: New file.
+
+Sat Jan 3 12:11:05 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
+
+ * configure.in: Finalize support for {alpha|powerpc}*-*-linux-gnulibc1
+
+Sun Dec 28 11:28:58 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (INSTALL_TARGET): Do install-gcc first.
+ * configure (gxx_include_dir): Provide a definition for subdirs
+ which do not use autoconf.
+
+Wed Dec 24 22:46:55 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess: Sync with egcs. Picks up new alpha support,
+ BeOS & some additional linux support.
+
+Tue Dec 23 12:44:24 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess: HP 9000/803 is a PA1.1 machine.
+
+Mon Dec 22 02:39:24 1997 Richard Henderson <rth@cygnus.com>
+
+ * configure.in: It's alpha*-...
+
+Sun Dec 21 16:53:12 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * configure.in (host_makefile_frag, target_makefile_frag):
+ Handle multiple config files.
+ (alpha-*-linux*): Treat alpha-*-linux* as alpha-*-linux* and
+ alpha-*-*.
+
+Thu Dec 18 13:13:03 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * mkdep: New file.
+
+Wed Dec 17 09:53:02 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*-*): Allow configuring of libide, vmake, etc.
+
+Tue Dec 16 17:36:05 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Add libgui directory.
+ (GDB_TK): Add all-libgui.
+ * configure.in: Add libgui directory.
+ * configure: Add all-libgui to GDB_TK.
+
+Mon Dec 15 16:12:28 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config-ml.in (multidirs): Add m32r to multilib list.
+
+Fri Dec 12 10:43:31 1997 Brendan Kehoe <brendan@canuck.cygnus.com>
+
+ * Makefile.in (all-target-gperf): Change dependency to
+ all-target-libstdc++.
+
+Thu Dec 11 23:30:51 1997 Fred Fish <fnf@ninemoons.com>
+
+ * config.guess: Add BeOS support.
+
+Wed Dec 10 15:10:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Source directory cvs renamed to cvssrc:
+ * configure.in (host_tools): Change cvs to cvssrc.
+ (native_only): Likewise.
+ (noconfigdirs) [various cases]: Likewise.
+ * Makefile.in (ALL_MODULES): Change all-cvs to all-cvssrc.
+ (CROSS_CHECK_MODULES): Change check-cvs to check-cvssrc.
+ (INSTALL_MODULES): Change install-cvs to install-cvssrc.
+ (CLEAN_MODULES): Change clean-cvs to clean-cvssrc.
+ (all-cvssrc): Rename target from all-cvs.
+
+Wed Dec 3 07:55:59 1997 Jeffrey A Law (law@cygnus.com)
+
+ * configure (gxx_include_dir): Fix thinko.
+
+Tue Dec 2 10:55:34 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (INSTALL_TARGET_CROSS): Define.
+ (install-cross, install-gcc-cross): New targets.
+
+Tue Dec 2 10:08:31 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (noconfigdirs): Add support for Thumb target.
+
+ * config.sub (maybe_os): Add support for Thumb target.
+
+Sun Nov 30 16:12:27 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * Makefile.in: Add rules for cygmon.
+
+ * configure.in: Build cygmon for sparc-elf and sparclite-aout.
+
+Thu Nov 27 01:31:30 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (INSTALL_TARGET): Do install-gcc first.
+ * configure (gxx_include_dir): Provide a definition for subdirs
+ which do not use autoconf.
+
+Wed Nov 26 11:53:33 1997 Keith Seitz <keiths@onions.cygnus.com>
+
+ * Makefile.in, configure, configure.in, ChangeLog: merge with foundry's
+ 11/18/97 build
+
+Wed Nov 26 16:08:50 1997 Jeffrey A Law (law@cygnus.com)
+
+ * From Franz Sirl.
+ * config.guess (powerpc*-*-linux): Handle glibc2 beta release
+ found on RedHat Linux systems.
+
+Fri Nov 21 09:51:01 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess (alpha stuff): Merge with FSF to avoid incorrect
+ guesses.
+
+Thu Nov 13 11:38:37 1997 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in (i[3456]86-ncr-sysv4.3*): Tweak.
+
+Mon Nov 10 15:23:21 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * ltmain.sh: If mkdir fails, check whether the directory was created
+ anyhow by some other process.
+
+Mon Nov 10 14:38:03 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*-*): Configure all directories.
+
+Sun Nov 9 17:36:20 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*-*): Configure newlib, libiberty directories
+ for the D30V.
+
+Sat Nov 8 14:42:59 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*-*): Configure target-libgloss on the D30V.
+
+Fri Nov 7 10:34:09 1997 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * include/libiberty.h: Add extern "C" { so it can be used with C++
+ progrms.
+ * include/remote-sim.h: Add extern "C" { so it can be used with C++
+ programs.
+
+Thu Oct 30 11:09:29 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (d30v-*-*): Configure GCC now.
+
+Mon Oct 27 13:17:24 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in: Remove a "second pass" of tweaking noconfigdirs,
+ is no longer needed.
+
+Mon Oct 27 12:03:53 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in: check-target-libio depends on all-target-libstdc++.
+
+Sun Oct 26 11:48:27 1997 Manfred Hollstein (manfred@s-direktnet.de)
+
+ * Makefile.in (bootstrap-lean): Combined with `normal' bootstrap
+ targets using "$@" to provide support for similar but not identical
+ targets without having to duplicate code.
+
+Mon Oct 20 15:28:49 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * makefile.vms: Fix to work with DEC C.
+
+Tue Oct 7 23:58:57 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config.sub: Add mips-tx39-elf to marketing names.
+
+Tue Oct 7 14:24:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltmain.sh: Handle symlinks in generated script.
+
+Wed Oct 1 13:11:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Handle autoconf style directory options: --bindir,
+ --datadir, --includedir, --infodir, --libdir, --libexecdir,
+ --mandir, --oldincludedir, --sbindir, --sharedstatedir,
+ --sysconfdir.
+ * Makefile.in (sbindir, libexecdir, sysconfdir): New variables.
+ (sharedstatedir, localstatedir, oldincludedir): New variables.
+ (BASE_FLAGS_TO_PASS): Pass down bindir, datadir, includedir,
+ infodir, libdir, libexecdir, localstatedir, mandir, oldincludedir,
+ sbindir, sharedstatedir, and sysconfdir.
+
+Mon Sep 29 00:38:08 1997 Aaron Jackson <jackson@negril.msrce.howard.edu>
+
+ * Makefile.in (bootstrap-lean): New target.
+
+Wed Sep 24 18:06:27 1997 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * configure.in (d30v): Remove tcl, tk, expect, gdb, itcl, tix, db,
+ sn, and gnuserv from noconfigdirs.
+
+Wed Sep 24 15:18:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltmain.sh: Tweak shell pattern to avoid bug in NetBSD /bin/sh.
+
+Thu Sep 18 23:58:27 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (cross): New target.
+
+Thu Sep 18 21:43:23 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
+ Jeff Law <law@cygnus.com>
+
+ * Makefile.in (bootstrap2, bootstrap3): New targets.
+ (all-bootstrap): Remove outdated and confusing target.
+ (bootstrap, bootstrap2, bootstrap3): Don't pass BOOT_CFLAGS down.
+
+Thu Sep 18 15:37:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure (tooldir): enable_gdbtk=YES for cygwin32, NO for
+ windows. Consistent with gdb/configure.
+
+1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
+
+ * config/mt-linux: Define CXXFLAGS to make sure -fvtable-thunks is
+ used.
+ * configure.in: Name Linux target fragment.
+
+ * configure: Rewrite so that project Makefile fragment is inserted
+ first and appears last in the resulting Makefile.
+
+Tue Sep 16 09:55:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (install-itcl): Install tcl first.
+
+Sun Sep 14 20:53:42 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mh-cygwin32: ok to build split texinfo files
+
+Fri Sep 12 16:19:20 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: remove bison from noconfigdirs for Cygwin32 host
+
+Thu Sep 11 16:40:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * Makefile.in (local-distclean): Also remove mh-frag mt-frag.
+
+ * configure.in (skipdirs): Add target-librx for Linux.
+ (alpha-*-linux*): Use config/mh-elfalphapic and config/mt-elfalphapic.
+
+Wed Sep 10 21:29:54 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (bootstrap): New target.
+
+Wed Sep 10 15:19:22 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Accept 'amigados' for backward compatability.
+
+Mon Sep 8 20:46:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.guess: Merge with FSF.
+
+Sun Sep 7 23:18:32 1997 Fred Fish <fnf@ninemoons.com>
+
+ * config.sub: Change 'amigados' to 'amigaos' to match current usage.
+
+Sun Sep 7 15:55:28 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config.sub: Add "marketing-names" patch.
+
+Fri Sep 5 16:11:28 1997 Joel Sherrill (joel@OARcorp.com)
+
+ * configure.in (*-*-rtems*): Do not build libgloss for rtems.
+
+Fri Sep 5 12:27:17 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Handle v850-elf.
+
+Wed Sep 3 22:01:58 1997 Fred Fish <fnf@ninemoons.com>
+
+ * .cvsignore (*-install): Remove.
+
+Wed Sep 3 12:15:24 1997 Chris Provenzano <proven@cygnus.com>
+
+ * ltconfig: Set CONFIG_SHELL in libtool.
+ * ltmain.sh: Use CONFIG_SHELL instead of /bin/sh
+
+Mon Sep 1 16:45:44 1997 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (target_subdir): Set to libraries if enable_multilib.
+
+Wed Aug 27 16:15:11 1997 Jim Wilson <wilson@cygnus.com>
+
+ * config.guess: Update from gcc directory.
+
+Tue Aug 26 16:46:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (all-sim): Depends on all-readline.
+
+Wed Aug 20 19:57:37 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (BISON, YACC): Use $$s.
+ (all-bison): Depend on all-texinfo.
+
+Tue Aug 19 01:41:32 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (BISON): Add -L flag.
+ (YACC): Likewise.
+
+Mon Aug 18 11:30:50 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (noconfigdirs): Add support for v850e target.
+
+ * config.sub (maybe_os): Add support for v850e target.
+
+Mon Aug 18 11:30:50 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (noconfigdirs): Add support for v850ea target.
+
+ * config.sub (maybe_os): Add support for v850ea target.
+
+Mon Aug 18 09:24:06 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config.sub: Add mipstx39. Delete r3900.
+
+Mon Aug 18 17:20:10 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (all-autoconf): Depends on all-texinfo.
+
+Fri Aug 15 23:09:26 1997 Michael Meissner <meissner@cygnus.com>
+
+ * config-ml.in ({powerpc,rs6000}*-*-*): Update to current AIX and
+ eabi targets.
+
+Thu Aug 14 14:42:17 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Get CFLAGS and CXXFLAGS from Makefile, if possible.
+
+ * configure: When handling a Canadian Cross, handle YACC as well as
+ BISON. Just set BISON to bison. When setting YACC, prefer bison.
+ * Makefile.in (all-bison): Depend upon all-texinfo.
+
+Tue Aug 12 20:09:48 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (BISON): bison, not byacc or bison -y.
+ (YACC): bison -y or byacc or yacc.
+ (various): Add *-bison as appropriate.
+ (taz): No need to mess with BISON anymore.
+
+Tue Aug 12 22:33:08 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: If OSTYPE matches *win32*, try to find a good value for
+ CONFIG_SHELL.
+
+Sun Aug 10 14:41:11 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (taz): Get the version number from AM_INIT_AUTOMAKE in
+ configure.in if it is present.
+
+Sat Aug 9 00:58:01 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (LD_FOR_TARGET): Change ld.new to ld-new.
+
+Fri Aug 8 16:30:13 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.sub: Recognize `arc' cpu.
+ * configure.in: Likewise.
+ * config-ml.in: Likewise.
+
+Thu Aug 7 11:02:34 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in ($(INSTALL_X11_MODULES)): Depend upon installdirs.
+
+Wed Aug 6 16:27:29 1997 Chris Provenzano <proven@cygnus.com>
+
+ * configure: Changed sed delimiter from ':' to '|' when
+ attempting to substitute ${config_shell} for SHELL. On
+ NT ${config_shell} may contain a ':' in it.
+
+Wed Aug 6 12:29:05 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Fix for non-bash shells.
+
+Wed Aug 6 00:42:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (AS_FOR_TARGET): Change as.new to as-new.
+
+Tue Aug 5 14:08:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (NM_FOR_TARGET): Change nm.new to nm-new.
+
+ * ylwrap: If the program is a relative path, force it to be
+ absolute.
+
+Tue Aug 5 12:12:44 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure (tooldir): Set BISON to `bison -y' and not just bison.
+
+Mon Aug 4 22:59:02 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET): When winsup/Makefile present,
+ correctly specify the target build directory $(TARGET_SUBDIR)/winsup
+ for libraries.
+
+Mon Aug 4 12:40:24 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Fix handling of macros with values
+ separated by spaces.
+
+Thu Jul 31 19:49:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ylwrap: New file.
+ * Makefile.in (DEVO_SUPPORT): Add ylwrap.
+
+ * ltmain.sh: Handle /bin/sh at start of install program.
+
+ * Makefile.in (DEVO_SUPPORT): Add ltconfig, ltmain.sh, and missing.
+
+ * ltconfig, ltmain.sh: New files, from libtool 1.0.
+ * missing: New file, from automake 1.2.
+
+Thu Jul 24 12:57:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Treat tix like tk, putting it in X11_MODULES. Add
+ check-tk to CHECK_X11_MODULES.
+
+Wed Jul 23 17:03:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Merge with FSF.
+
+Tue Jul 22 19:08:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.guess: Merge with FSF.
+
+Tue Jul 22 14:50:42 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * configure: Treat msdosdjgpp like go32.
+ * configure.in: Likewise. Don't remove gprof for go32.
+
+ * configure: Change Makefile.tem2 to Makefile.tm2.
+
+Mon Jul 21 10:31:26 1997 Stephen Peters <speters@cygnus.com>
+
+ * configure.in (noconfigdirs): For alpha-dec-osf*, don't ignore grep.
+
+Tue Jul 15 14:33:03 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * install-sh (chmodcmd): Set to null if the DST directory already
+ exists. Same as Nov 11th change.
+
+Mon Jul 14 11:01:15 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * configure (GDB_TK): Needs itcl and tix.
+
+Mon Jul 14 00:32:10 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * config.guess: Update from FSF.
+
+Fri Jul 11 11:57:11 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * Makefile.in (GDB_TK): Depend on itcl and tix.
+
+Fri Jul 4 13:25:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL_PROGRAM_ARGS): New variable.
+ (INSTALL_PROGRAM): Use $(INSTALL_PROGRAM_ARGS).
+ (INSTALL_SCRIPT): New variable.
+ (BASE_FLAGS_TO_PASS): Pass down INSTALL_SCRIPT.
+ * configure.in: If host is *-*-cygwin32*, set INSTALL_PROGRAM_ARGS
+ to -x.
+ * install-sh: Add support for -x option.
+
+Mon Jun 30 15:51:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in, Makefile.in: Treat tix like itcl.
+
+Thu Jun 26 13:59:19 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (WINDRES): New variable.
+ (WINDRES_FOR_TARGET): New variable.
+ (BASE_FLAGS_TO_PASS): Add WINDRES_FOR_TARGET.
+ (EXTRA_HOST_FLAGS): Add WINDRES.
+ (EXTRA_TARGET_FLAGS): Add WINDRES.
+ (EXTRA_GCC_FLAGS): Add WINDRES.
+ ($(DO_X)): Pass down WINDRES.
+ ($(CONFIGURE_TARGET_MODULES)): Set WINDRES when configuring.
+ * configure: Treat WINDRES like DLLTOOL, and WINDRES_FOR_TARGET like
+ DLLTOOL_FOR_TARGET.
+
+Wed Jun 25 15:01:26 1997 Felix Lee <flee@cygnus.com>
+
+ * configure.in: configure sim before gdb for win32-x-ppc
+
+Wed Jun 25 12:18:54 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ Move gperf into the toplevel, from libg++.
+ * configure.in (target_tools): Add target-gperf.
+ (native_only): Add target-gperf.
+ * Makefile.in (all-target-gperf): New target, depend on
+ all-target-libg++.
+ (configure-target-gperf): Empty rule.
+ (ALL_TARGET_MODULES): Add all-target-gperf.
+ (CONFIGURE_TARGET_MODULES): Add configure-target-gperf.
+ (CHECK_TARGET_MODULES): Add check-target-gperf.
+ (INSTALL_TARGET_MODULES): Add install-target-gperf.
+ (CLEAN_TARGET_MODULES): Add clean-target-gperf.
+
+Mon Jun 23 10:51:53 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub (mn10200): Recognize new basic machine.
+
+Thu Jun 19 14:16:42 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in: Don't set ENABLE_MULTILIB, so we'll be passing
+ --enable-multilib down to subdirs; setting TARGET_SUBDIR was enough.
+
+Tue Jun 17 15:31:20 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in: If we're building mips-sgi-irix6* native, turn on
+ ENABLE_MULTILIB and set TARGET_SUBDIR.
+
+Tue Jun 17 12:20:59 1997 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (all-sn): Depend on all-grep.
+
+Mon Jun 16 11:11:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use mh-ppcpic and mt-ppcpic for powerpc*-* targets.
+
+ * configure: Set CFLAGS and CXXFLAGS, and substitute them into
+ Makefile. From Jeff Makey <jeff@cts.com>.
+ * Makefile.in: Add comment for CFLAGS and CXXFLAGS.
+
+ * Makefile.in (DISTBISONFILES): Remove.
+ (taz): Don't futz with DISTBISONFILES. Change BISON to use
+ $(DEFAULT_YACC).
+
+ * configure.in: Build itl, db, sn, etc., when building for native
+ cygwin32.
+
+ * Makefile.in (LD): New variable.
+ (EXTRA_HOST_FLAGS): Pass down LD.
+ ($(DO_X)): Likewise.
+
+Mon Jun 16 11:10:35 1997 Philip Blundell <Philip.Blundell@pobox.com>
+
+ * Makefile.in (INSTALL): Use $(SHELL) when executing install-sh.
+
+Fri Jun 13 10:22:56 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * configure.in (targargs): Strip out any supplied --build argument
+ before adding our own. Always add --build.
+
+Thu Jun 12 21:12:28 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * configure.in (targargs): Pass --build if we're doing
+ a cross-compile.
+
+Fri Jun 6 21:38:40 1997 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * configure: Use '|' instead of ":" as the separator in
+ sed. Otherwise sed chokes on NT path names with drive
+ designators. Also look for "?:*" as the leading characters in an
+ absolute pathname.
+
+Mon Jun 2 13:05:20 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config.sub: Support for r3900.
+
+Wed May 21 17:33:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use install-sh, not install.sh.
+
+Wed May 14 16:06:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (taz): Improve check for BISON so it doesn't try to
+ apply it twice.
+
+Fri May 9 17:22:05 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL_MODULES): Put install-opcodes before
+ install-binutils.
+
+Thu May 8 17:29:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Add automake targets.
+ * configure.in (host_tools): Add automake.
+
+Tue May 6 15:49:52 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Default CXX to c++, not gcc.
+ * Makefile.in (CXX): Set to c++, not gcc.
+ (CXX_FOR_TARGET): When cross, transform c++, not gcc.
+
+Thu May 1 10:11:43 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * install-sh: try appending a .exe if source file doesn't
+ exist
+
+Wed Apr 30 12:05:36 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * configure.in: Turn on multilib by default.
+ (cross_only): Remove target-libiberty.
+
+ * Makefile.in (all-gcc): Don't depend on libiberty.
+
+Mon Apr 28 18:39:45 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config.guess: improve algorithm for recognizing Gnu Hurd x86.
+
+Thu Apr 24 19:30:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (DEVO_SUPPORT): Add mpw-install.
+ (DISTBISONFILES): Add ld/Makefile.in
+
+Tue Apr 22 17:17:28 1997 Geoffrey Noer <noer@pizza.cygnus.com>
+
+ * configure.in: if target is cygwin32 but host isn't cygwin32,
+ don't configure gdb tcl tk expect, not just gdb.
+
+Mon Apr 21 13:33:39 1997 Tom Tromey <tromey@cygnus.com>
+
+ * configure.in: Added gnuserv everywhere sn appears.
+
+ * Makefile.in (ALL_MODULES): Added all-gnuserv.
+ (CROSS_CHECK_MODULES): Added check-gnuserv.
+ (INSTALL_MODULES): Added install-gnuserv.
+ (CLEAN_MODULES): Added clean-gnuserv.
+ (all-gnuserv): New target.
+
+Thu Apr 17 13:57:06 1997 Per Fogelstrom <pefo@openbsd.org>
+
+ * config.guess: Fixes for MIPS OpenBSD systems.
+
+Tue Apr 15 12:21:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL_XFORM): Remove.
+ (BASE_FLAGS_TO_PASS): Remove INSTALL_XFORM.
+
+ * mkinstalldirs: New file, copied from automake.
+ * Makefile.in (installdirs): Rename from install-dirs. Use
+ mkinstalldirs. Change all users.
+ (DEVO_SUPPORT): Add mkinstalldirs.
+
+Mon Apr 14 11:21:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * install-sh: Rename from install.sh.
+ * Makefile.in (INSTALL): Change install.sh to install-sh.
+ (DEVO_SUPPORT): Likewise.
+
+ * configure: Use ${config_shell} with ${moveifchange}. From Thomas
+ Graichen <graichen@rzpd.de>.
+
+Fri Apr 11 16:37:10 1997 Niklas Hallqvist <niklas@appli.se>
+
+ * config.guess: Recognize OpenBSD systems correctly.
+
+Fri Apr 11 17:07:04 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * README, Makefile.in (ETC_SUPPORT): Remove references to
+ cfg-paper*, configure.{texi,man,info*}._
+
+Sun Apr 6 18:47:57 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * Makefile.in (all.normal): Ensure that gcc is built after all
+ the x11 - ie gdb - targets.
+
+Tue Apr 1 16:28:50 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * makefile.vms: Don't run conf-a-gas.
+
+Mon Mar 31 16:26:55 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * configure.in (hppa1.1-*-rtems*): New target, like hppa-*-*elf*.
+
+Sun Mar 30 12:38:27 1997 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Remove noconfigdirs case since gdb also
+ configures and builds for tic80-coff.
+
+Fri Mar 28 18:28:52 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Set cache_file to config.cache.
+ * Makefile.in (local-distclean): Remove config.cache.
+
+Wed Mar 26 18:49:39 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * COPYING: Update FSF address.
+
+Wed Mar 26 10:38:25 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (tic80-*-*): Remove G++ libraries and libgloss from
+ noconfigdirs.
+
+Mon Mar 24 15:02:39 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (install-dirs): Don't crash if prefix, and hence
+ MAKEDIRS, is empty.
+
+Mon Mar 24 12:40:55 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.sub: Tweak mn10300 entry.
+
+Fri Mar 21 15:35:27 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (host_tools): Put sim before gdb, so gdb's
+ configure.tgt can determine if the simulator was configured.
+
+Sun Mar 16 16:07:08 1997 Fred Fish <fnf@cygnus.com>
+
+ * config.sub: Move BeOS $os case to be with other Cygnus
+ local cases.
+
+Sun Mar 16 01:34:55 1997 Martin Hunt <hunt@cygnus.com>
+
+ * config.sub: Remove misplaced comment that broke Linux.
+
+Sat Mar 15 22:50:15 1997 Fred Fish <fnf@cygnus.com>
+
+ * config.sub: Add BeOS support.
+
+Mon Mar 10 13:30:11 1997 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (CHECK_X11_MODULES): Don't run check-tk.
+
+Wed Mar 5 12:09:29 1997 Martin <hunt@cygnus.com>
+
+ * configure.in (noconfigdirs): Remove tcl and tk from
+ noconfigdirs for cygwin32 builds.
+
+Fri Feb 28 18:20:15 1997 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (tic80-*-*): Remove ld from noconfigdirs.
+
+Thu Feb 27 14:57:26 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (GAS_SUPPORT_DIRS, BINUTILS_SUPPORT_DIRS): Remove
+ make-all.com, use makefile.vms instead.
+
+Tue Feb 25 18:46:14 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config.sub: Accept -lnews*.
+
+Tue Feb 25 13:19:14 1997 Andrew Cagney <cagney@kremvax.tpgi.com.au>
+
+ * configure.in (noconfigdirs): Disable target-newlib,
+ target-examples and target-libiberty for d30v.
+
+Fri Feb 21 17:56:25 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * configure.in (noconfigdirs): Enable ld for d30v.
+
+Fri Feb 21 20:58:51 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in (tic80-*-*): Build compiler.
+
+Sun Feb 16 15:41:09 1997 Andrew Cagney <cagney@critters.cygnus.com>
+
+ * configure.in (d30v-*): Remove sim directory from list of
+ unsupported d30v directories
+
+Tue Feb 18 17:32:42 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * config.sub, configure.in: Add d30v target cpu.
+
+Thu Feb 13 22:04:44 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * makefile.vms: New file.
+ * make-all.com: Remove.
+
+Wed Feb 12 12:54:18 1997 Jim Wilson <wilson@cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Add LIBGCC2_DEBUG_CFLAGS.
+
+Sat Feb 8 20:36:49 1997 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.in (all-itcl): The rule is all-itcl, not all-tcl.
+
+Tue Feb 4 11:39:29 1997 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (ALL_MODULES): Added all-db.
+ (CROSS_CHECK_MODULES): Addec check-db.
+ (INSTALL_MODULES): Added install-db.
+ (CLEAN_MODULES): Added clean-db.
+
+Mon Feb 3 13:29:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.guess: Merge with latest FSF sources.
+
+Tue Jan 28 09:20:37 1997 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (ALL_MODULES): Added all-itcl.
+ (CROSS_CHECK_MODULES): Added check-itcl.
+ (INSTALL_MODULES): Added install-itcl.
+ (CLEAN_MODULES): Added clean-itcl.
+
+Thu Jan 23 01:44:27 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: build gdb for mn10200
+
+Fri Jan 17 15:32:15 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (all-target-winsup): Depend on all-target-libio.
+
+Mon Jan 13 22:46:54 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (tic80-*-*): Turn off most targets right now.
+
+Fri Jan 3 16:04:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (MAKEINFO): Check for the existence of the Makefile,
+ rather than the makeinfo program.
+ (do-info): Depend upon all-texinfo.
+
+Tue Dec 31 16:00:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Remove uses of config/mh-linux.
+
+ * config.sub, config.guess: Merge with latest FSF sources.
+
+Fri Dec 27 23:04:33 1996 Fred Fish <fnf@cygnus.com>
+
+ * config.sub (case $basic_machine): Add tic80 entries.
+
+Fri Dec 27 12:07:59 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub, config.guess: Merge with latest FSF sources.
+
+Wed Dec 18 22:46:39 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-build.in: Build ld before gcc, use NewFolderRecursive.
+ * mpw-config.in: Test for NewFolderRecursive.
+ * mpw-install: Use symbolic name for startup filename.
+ * mpw-README: Add various additional details.
+
+Wed Dec 18 13:11:46 1996 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (mips*-sgi-irix6*): Remove binutils from noconfigdirs.
+
+Wed Dec 18 10:29:31 1996 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Do build gcc and the target libraries for
+ the mn10200.
+
+Wed Dec 4 16:53:05 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: don't avoid building gdb for mn10300 any more
+ * Makefile.in: double-quote GCC_FOR_TARGET line in EXTRA_GCC_FLAGS
+ instead of single-quoting it.
+
+Tue Dec 3 23:26:50 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * configure.in: Don't use --with-stabs on IRIX 6.
+
+Tue Dec 3 09:05:25 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (m32r): Build gdb, libg++ now.
+
+Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in (mips*-sgi-irix6*): Remove gdb and related
+ directories from noconfigdirs.
+
+Tue Nov 26 11:45:33 1996 Kim Knuttila <krk@cygnus.com>
+
+ * config.sub (basic_machine): added mips16 configuration
+
+Sat Nov 23 19:26:22 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.sub: Handle d10v-unknown.
+
+Sat Nov 23 10:23:01 1996 Gavin Koch <gavin@cygnus.com>
+
+ * config.sub: Handle v850-unknown.
+
+Thu Nov 21 16:19:44 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: add findutils
+ * configure.in: add findutils to list of host_tools
+
+Wed Nov 20 10:09:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config.sub: Handle mn10200 and mn10300.
+
+Tue Nov 19 16:35:14 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (d10v-*): Do not build librx.
+
+Mon Nov 18 13:28:41 1996 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in (mn10300): Build everything except gdb & libgloss.
+
+Wed Nov 13 14:59:46 1996 Per Bothner <bothner@deneb.cygnus.com>
+
+ * config.guess: Patch for Dansk Data Elektronik servers,
+ from Niels Skou Olsen <nso@dde.dk>.
+
+ For ncr, use /bin/uname rather than uname, since GNU uname does not
+ support -p. Suggested by Mark Mitchell <mmitchell@usa.net>.
+
+ Patch for MIPS R4000 running System V,
+ from Eric S. Raymond <esr@snark.thyrsus.com>.
+
+ Fix thinko for nextstep.
+
+ Patch for OSF1 in i?86, from Dan Murphy <dlm@osf.org> via Harlan Stenn.
+
+ Sat Jun 24 18:58:17 1995 Morten Welinder <terra+@cs.cmu.edu>
+ * config.guess: Guess mips-dec-mach_bsd4.3.
+
+ Thu Oct 10 04:07:04 1996 Harlan Stenn <harlan@pfcs.com>
+ * config.guess (i?86-ncr-sysv*): Emit just enough of the minor
+ release numbers.
+ * config.guess (mips-mips-riscos*): Emit just enough of the
+ release number.
+
+ Tue Oct 8 10:37:22 1996 Frank Vance <fvance@waii.com>
+ * config.guess (sparc-auspex-sunos*): Added.
+ (f300-fujitsu-*): Added.
+
+ Wed Sep 25 22:00:35 1996 Jeff Woolsey <woolsey@jlw.com>
+ * config.guess: Recognize a Tadpole as a sparc.
+
+Wed Nov 13 00:53:09 1996 David J. MacKenzie <djm@churchy.gnu.ai.mit.edu>
+
+ * config.guess: Don't assume that NextStep version is either 2 or
+ 3. NextStep 4 (aka OpenStep 4) has come out now.
+
+Mon Nov 11 23:52:03 1996 David J. MacKenzie <djm@churchy.gnu.ai.mit.edu>
+
+ * config.guess: Support Cray T90 that reports itself as "CRAY TS".
+ From Rik Faith <faith@cs.unc.edu>.
+
+Fri Nov 8 11:34:58 1996 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
+
+ * config.sub: Contributions from bug-gnu-utils to:
+ Support plain "hppa" (no version given) architecture, reported by
+ OpenStep.
+ OpenBSD like NetBSD.
+ LynxOs is not a hardware supplier.
+
+ * config.guess: Contributions from bug-gnu-utils to add support for:
+ OpenBSD like NetBSD.
+ Stratus systems.
+ More Pyramid systems.
+ i[n>4]86 Intel chips.
+ M680[n>4]0 Motorola chips.
+ Use unknown instead of lynx for hardware manufacturer.
+
+Mon Nov 11 10:09:08 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * install.sh (chmodcmd): Set to null if the DST directory already
+ exists.
+
+Mon Nov 11 10:43:41 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (powerpc*-{eabi,elf,linux,rtem,sysv,solaris}*): Do
+ not use mt-ppc target Makefile fragment any more.
+
+Sun Nov 3 19:17:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in (*-*-windows): Exclude everything but those dirs
+ needed to build windows.
+
+Tue Oct 29 16:41:31 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (all-target-winsup): Depend on all-target-librx.
+
+Mon Oct 28 17:32:46 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in: Exclude mmalloc from i386-windows.
+ * config/mh-windows: Add rules for building MSVC makefiles.
+
+Thu Oct 24 09:22:46 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Undo my previous change.
+
+Thu Oct 24 12:12:04 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): Pass down GCC_FOR_TARGET
+ unconditionally.
+ (MAKEOVERRIDES): Define (revert this part of October 18 change).
+
+Thu Oct 24 09:02:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (FLAGS_TO_PASS): Add $(HOST_FLAGS) to allow the
+ host to add it's own flags.
+ * config/mh-windows (HOST_FLAGS): Set srcroot, which is needed
+ for MSVC build procedure.
+
+Tue Oct 22 15:20:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Handle GCC_FOR_TARGET like CC_FOR_TARGET.
+
+Fri Oct 18 13:37:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET): Check for xgcc, not Makefile.
+ (CXX_FOR_TARGET): Likewise.
+ (GCC_FOR_TARGET): Define.
+ (BASE_FLAGS_TO_PASS): Remove GCC_FOR_TARGET.
+ (EXTRA_GCC_FLAGS): Define GCC_FOR_TARGET based on whether
+ CC_FOR_TARGET was specified on the command line.
+ (MAKEOVERRIDES): Don't define.
+
+Thu Oct 17 10:27:56 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (m32r): Fix spelling of libg++ libs.
+
+Thu Oct 10 10:37:17 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config.sub (-apple*): Remove, now redundant.
+
+Thu Oct 10 12:30:54 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Don't get confused by CPU-VENDOR-linux-gnu.
+
+ * configure: Rework yesterday's sed script patch.
+
+ * config.sub: Merge with FSF.
+
+Wed Oct 9 17:24:59 1996 Per Bothner <bothner@deneb.cygnus.com>
+
+ * config.guess: Merge from FSF.
+
+ 1996-09-12 Richard Stallman <rms@ethanol.gnu.ai.mit.edu>
+ * config.guess: Use pc instead of unknown, for pc clone systems.
+ Change linux to linux-gnu.
+
+ Mon Jul 15 23:51:11 1996 Karl Heuer <kwzh@gnu.ai.mit.edu>
+ * config.guess: Avoid non-portable tr syntax.
+
+Wed Oct 9 06:06:46 1996 Jeffrey A Law (law@cygnus.com)
+
+ * test-build.mk (HOLES): Add "xargs" for gdb.
+
+ * configure: Avoid hpux10.20 sed bug.
+
+Tue Oct 8 08:32:48 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in config/mh-windows: Add support for windows host
+ (that is a build done under the Microsoft build environment).
+
+Tue Oct 8 10:39:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Replace all uses of srcroot with s, to shrink
+ command line lengths.
+
+ Patches from Geoffrey Noer <noer@cygnus.com>:
+ * configure.in: If configuring for newlib, pass --with-newlib to
+ subdirectories.
+ * Makefile.in (CC_FOR_TARGET): If winsup/Makefile exists, pass a
+ -Bnewlib/ and -Lwinsup to gcc.
+ (CXX_FOR_TARGET): Likewise.
+
+Mon Oct 7 10:59:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (ETC_SUPPORT): Add configure.
+
+Fri Oct 4 12:22:58 1996 Angela Marie Thomas (angela@cygnus.com)
+
+ * configure.in: Use config/mh-dgux386 for i[345]86-dg-dgux
+ host configuration file.
+
+Thu Oct 3 09:28:25 1996 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Break mn10x00 support into separate
+ mn10200 and mn10300 configurations.
+ * config.sub: Likewise.
+
+Wed Oct 2 22:27:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Add lots of stuff to noconfigdirs for
+ the mn10x00 targets.
+
+ * config.sub, configure.in: Add mn10x00 support.
+
+Wed Oct 2 15:52:36 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ * make-all.com: Call conf-a-gas, not config-a-gas.
+
+Tue Oct 1 01:28:41 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * configure.in (noconfigdirs): Don't build libgloss for arm-coff
+ targets.
+
+Mon Sep 30 14:24:01 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-README: Add much more detail for native PowerMac.
+ * mpw-install: New file.
+ * mpw-configure: Add --norecursion and --help options.
+ * mpw-config.in: Translate readme and install files when
+ copying to objdir.
+ * mpw-build.in: Don't always depend on byacc and flex.
+ (install-only-top): New action.
+
+Fri Sep 27 17:39:44 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in: You can now configure GDB for the v850.
+
+Tue Sep 24 19:05:12 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (noconfigdirs): Don't configure any C++ dirs
+ if targeting D10V.
+
+Tue Sep 17 12:15:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Recognize mips64vr5000.
+
+Mon Sep 16 17:00:52 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use a single line for host_tools and native_only.
+
+Tue Sep 16 09:55:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (install-itcl): Install tcl first.
+
+Sun Sep 14 20:53:42 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mh-cygwin32: ok to build split texinfo files
+
+Fri Sep 12 16:19:20 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: remove bison from noconfigdirs for Cygwin32 host
+
+Mon Sep 9 12:21:30 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.sub, configure.in: Add entries for m32r.
+
+Mon Sep 8 20:46:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.guess: Merge with FSF.
+
+Thu Sep 5 13:52:47 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (inet-install): Don't run install-gzip.
+
+Wed Sep 4 17:26:13 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in: Don't config lots of things for *-*-windows*.
+
+Sat Aug 31 11:45:57 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Test for mpw-true, true, and null-command scripts.
+ (host_libs, host_tools): Copy from configure.in.
+ * mpw-configure: Don't complain about directories not found.
+
+Thu Aug 29 16:44:58 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (i[345]86): Recognize i686 for pentium pro.
+ (i[3456]86-*-dgux*): Use config/mh-sysv for the host configuration
+ file.
+
+ * config.guess (i[345]86): Ditto.
+
+Mon Aug 26 18:34:42 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * configure.in (noconfigdirs): Removed gdb for D10V.
+
+Thu Aug 22 17:13:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Remove ld, target-libio, target-libg++, and
+ target-libstdc++ from noconfigdirs.
+
+Wed Aug 21 18:56:38 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure: Fix three locations where shell scripts were
+ being run directly rather than with config_shell.
+
+Tue Aug 20 13:08:47 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * configure.in (v850-*-*): Set up initial $noconfigdirs.
+ * config.sub (basic_machine): Recognize v850.
+
+Thu Aug 15 12:19:33 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Handle multiple enable/disable options and
+ pass them down recursively, handle -c and -s flags appropriately
+ depending on choice of compiler, add escape mechanism for
+ quoted arguments to gC.
+
+Mon Aug 12 13:15:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (powerpc*-*-*): For eabi, system V.4, Linux, and
+ solaris targets, use config/mt-ppc to set C{,XX}FLAGS_FOR_TARGETS
+ so that -mrelocatable-lib and -mno-eabi are used.
+
+ * Makefile.in (CONFIGURE_TARGET_MODULES): If target compiler does
+ not support --print-multi-lib, don't abort.
+
+Sun Aug 11 20:51:50 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/mh-cygwin32 (CFLAGS): Define _WIN32 to be compatible
+ with normal Windows compilation environment.
+
+Thu Aug 8 12:18:59 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ * make-all.com: Run config-a-gas.
+ * setup.com: Don't copy subdirectory files around.
+
+Tue Jul 30 17:49:31 1996 Brendan Kehoe <brendan@cygnus.com>
+
+ * configure.in (*-*-ose): Remove exclusion of libgloss for this
+ target, it now compiles correctly.
+
+Sat Jul 27 15:10:43 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Generate Mac include for elf/dwarf2.h.
+
+Tue Jul 23 10:47:04 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * configure.in (d10v-*-*): Remove ld from $noconfigdirs.
+
+Mon Jul 22 13:28:51 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in (native_only): Add prms.
+
+Mon Jul 22 12:27:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (GAS_SUPPORT_DIRS): Add make-all.com and setup.com.
+ (BINUTILS_SUPPORT_DIRS): Likewise.
+
+Thu Jul 18 12:55:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (d10v-*-*): Don't configure ld or gdb until the
+ d10v support is added.
+
+Wed Jul 17 14:33:09 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * configure.in (d10v-*-*): New target.
+
+Mon Jul 15 11:53:00 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess (HP 9000/811): Recognize this as a PA1.1
+ machine.
+
+Fri Jul 12 23:21:17 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (do-tar-gz): New target, split out from tail end of
+ taz target. Run each command separately, don't use pipes.
+ (taz): Use it.
+
+Fri Jul 12 12:08:04 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Look for g-mpw-make.sed in config/mpw.
+ * mpw-build.in: No builds should depend on building byacc or flex,
+ they are assumed to be installed already.
+
+Fri Jul 12 09:52:52 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (CONFIGURE_TARGET_MODULES): Set r environment
+ variable that CC_FOR_TARGET needs.
+
+Thu Jul 11 10:09:45 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (CONFIGURE_TARGET_MODULES): Determine if the multlib
+ options have changed since the last time the subdirectory was
+ configured, and if it has, reconfigure.
+ (CLEAN_TARGET_MODULES): Delete multilib.out and tmpmulti.out, which
+ CONFIGURE_TARGET_MODULES uses to remember the old multilib options.
+
+Wed Jul 10 18:56:59 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (ALL_MODULES,CROSS_CHECK_MODULES,INSTALL_MODULES,
+ CLEAN_MODULES): Add bash.
+ (all-bash): New target.
+
+Mon Jul 8 17:33:14 1996 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (mips-sgi-irix6*): Use mh-irix6 instead of mh-irix5.
+
+Mon Jul 1 13:31:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.sub (basic_machine): Recognize d10v as a valid processor.
+
+Fri Jun 28 12:14:35 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Add support for --bindir.
+ * mpw-build.in: Use a GCC-specific build script for GCC actions.
+
+Wed Jun 26 17:20:12 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: add bash, time, gawk to list of hosttools and things
+ to only build for native toolchains
+
+Tue Jun 25 23:09:03 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (docdir): Remove.
+
+Tue Jun 25 19:00:08 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (datadir): Set to $(prefix)/share.
+
+Mon Jun 24 23:26:07 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: build diff and patch for cygwin32-hosted
+ toolchains.
+
+Mon Jun 24 15:01:12 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
+
+ * config.sub: Accept -rtems*.
+
+Sun Jun 23 22:41:54 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: enable dosrel for cygwin32-hosted builds,
+ remove diff from the list of things not buildable
+ via Canadian Cross
+
+Sat Jun 22 11:39:01 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (TARGET_SUBDIR): Move comment to previous line so we
+ don't get ". ".
+
+Fri Jun 21 17:24:48 1996 Jim Wilson <wilson@cygnus.com>
+
+ * configure.in (mips*-sgi-irix6*): Set noconfigdirs appropriately.
+
+Thu Jun 20 16:57:40 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (taz): Handle case where tex3patch didn't even get
+ checked out. Also, if it was found, put the symlink in a new util
+ subdirectory.
+
+Thu Jun 20 12:20:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.guess (*:Linux:*:*): Add support for PowerPC Linux.
+
+Tue Jun 18 14:24:12 1996 Klaus Kaempf (kkaempf@progis.de)
+
+ * config.sub: Recognize -openvms.
+ * configure.in (alpha*-*-*vms*): Set noconfigdirs.
+ * make-all.com, setup.com: New files.
+
+Mon Jun 17 16:34:46 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (taz): tex3patch moved to texinfo/util.
+
+Sat Jun 15 17:13:25 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure: enable_gdbtk=no for cygwin32-hosted toolchains
+ * configure.in: remove make from disable-if-Can-Cross list
+ enable gdb if ${host} and ${target} are cygwin32
+
+Fri Jun 7 18:16:52 1996 Harlan Stenn <harlan@pfcs.com>
+
+ * config.guess (i?86-ncr-sysv*): Emit minor release numbers.
+ Recognize the NCR 4850 machine and NCR Pentium-based platforms.
+
+Wed Jun 5 00:09:17 1996 Per Bothner <bothner@wombat.gnu.ai.mit.edu>
+
+ * config.guess: Combine mips-mips-riscos cases, and use cpp to
+ distinguish sysv/svr4/bsd variants.
+ Based on a patch from Harlan Stenn <harlan@pfcs.com>.
+
+Fri Jun 7 14:24:49 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * configure.in: Added copyright notice.
+ * move-if-change: Added copyright notice.
+
+Thu Jun 6 16:27:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (powerpcle-*-solaris*): Until we get shared
+ libraries working, don't build gdb, sim, make, tcl, tk, or
+ expect.
+
+Tue Jun 4 20:41:45 1996 Per Bothner <bothner@deneb.cygnus.com>
+
+ * config.guess: Merge with FSF:
+
+ Mon Jun 3 08:49:14 1996 Karl Heuer <kwzh@gnu.ai.mit.edu>
+ * config.guess (*:Linux:*:*): Add guess for sparc-unknown-linux.
+
+ Fri May 24 18:34:53 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * config.guess (AViiON:dgux:*:*): Fix typo in recognizing mc88110.
+
+ Fri Apr 12 20:03:59 1996 Per Bothner <bothner@spiff.gnu.ai.mit.edu>
+ * config.guess: Combine two OSF1 rules.
+ Also recognize field test versions. From mjr@zk3.dec.com.
+ * config.guess (dgux): Use /usr/bin/uname rather than uname,
+ because GNU uname does not support -p. From pmr@pajato.com.
+
+Tue Jun 4 11:07:25 1996 Tom Tromey <tromey@csk3.cygnus.com>
+
+ * Makefile.in (MAKEDIRS): Removed $(tooldir).
+
+Tue May 28 12:30:50 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-README: Document GCCIncludes.
+
+Sun May 26 15:16:27 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (alpha-*-linux*): Set enable_shared to yes.
+
+Tue May 21 15:41:39 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Handle --enable-FOO and --disable-FOO.
+
+Mon May 20 10:12:29 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in (*-*-cygwin32): Configure make.
+
+Tue May 7 14:19:42 1996 Tom Tromey <tromey@snuffle.cygnus.com>
+
+ * Makefile.in (inet-install): Quote value of INSTALL_MODULES.
+
+Fri May 3 08:57:17 1996 Tom Tromey <tromey@lisa.cygnus.com>
+
+ * Makefile.in (all-inet): Depend on all-perl.
+
+ * Makefile.in (inet-install): New target.
+
+ * Makefile.in (all-inet): Depend on all-tcl.
+ (all-inet): Depend on all-send-pr.
+
+Tue Apr 30 13:55:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (powerpcle-*-solaris*): Turn off tk and tcl
+ temporarily.
+
+Thu Apr 25 11:48:20 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't configure --with-gnu-ld on AIX.
+
+Thu Apr 25 06:33:36 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * configure.in (powerpcle-*-solaris*): Turn off gdb temporarily.
+
+Tue Apr 23 09:07:39 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (ALL_MODULES): Added all-inet.
+ (CROSS_CHECK_MODULES): Added check-inet.
+ (INSTALL_MODULES): Added install-inet.
+ (CLEAN_MODULES): Added clean-inet.
+ (all-indent): New target.
+
+ * configure.in (host_tools): Added inet.
+ (native_only): Added inet.
+ (noconfigdirs): Added inet.
+
+Fri Apr 19 15:35:29 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't configure libgloss if we are not configuring
+ newlib.
+
+Wed Apr 17 19:30:01 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * configure.in: Don't configure libgloss for unsupported
+ architectures.
+
+Tue Apr 16 11:17:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (CLEAN_MODULES): Add clean-apache.
+
+Mon Apr 15 15:09:05 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (ALL_MODULES): Include all-apache.
+ (CROSS_CHECK_MODULES): Include check-apache.
+ (INSTALL_MODULES): Include install-apache.
+ (all-apache): New target.
+
+ * configure.in: Added apache everywhere perl is seen.
+
+Mon Apr 15 14:59:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in: Add support for clean-{module} and
+ clean-target-{module} rules.
+
+Wed Apr 10 21:37:41 PDT 1996 Marilyn E. Sander <msander@cygnus.com>
+
+ * configure.in (*-*-ose) do not build libgloss.
+
+Mon Apr 8 16:16:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.guess (prep*:SunOS:5.*:*): Turn into
+ powerpele-unknown-solaris2.
+
+Mon Apr 8 14:45:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Permit --enable-shared to specify a list of
+ directories.
+
+Fri Apr 5 08:17:57 1996 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (host==solaris): Pass only the first word of $CC
+ to /usr/bin/which when checking if we're using /usr/ccs/bin/cc.
+
+Fri Apr 5 03:16:13 1996 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): pass down $(MAKE).
+
+Thu Mar 28 14:11:11 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (ALL_MODULES): Include all-perl.
+ (CROSS_CHECK_MODULES): Include check-perl.
+ (INSTALL_MODULES): Include install-perl.
+ (ALL_X11_MODULES): Include all-guile.
+ (CHECK_X11_MODULES): Include check-guile.
+ (INSTALL_X11_MODULES): Include install-guile.
+ (all-perl): New target.
+ (all-guile): New target.
+
+ * configure.in (host_tools): Include perl and guile.
+ (native_only): Include perl and guile.
+ (noconfigdirs): Don't build guile and perl; no ports have been
+ done.
+
+Tue Mar 26 21:18:50 1996 Andrew Cagney <cagney@kremvax.highland.com.au>
+
+ * configure (--enable-*): Handle quoted option lists such as
+ --enable-sim-cflags='-g0 -O' better.
+
+Thu Mar 21 11:53:08 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in ({,inst}all-target): New rule so we can make and
+ install all of the target directories easily.
+
+Wed Mar 20 18:10:57 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.in: Add missing global flag in sed substitution when
+ deleting `target-' from ${configdirs}.
+
+Thu Mar 14 19:15:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (DO_X): Don't get confused if CC contains `=' in an
+ option.
+
+ * configure.in (mips*-nec-sysvr4*): Use a host_makefile_frag of
+ config/mh-necv4.
+
+ * install.sh: Correct misspelling of transformbasename.
+
+ * config.guess: Recognize mips-*-sysv*.
+
+Mon Mar 11 15:36:42 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * config.sub: Recognize mon960.
+
+Sun Mar 10 13:18:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Restore Canadian Cross handling of BISON and LEX,
+ removed in Feb 20 change.
+
+Fri Mar 8 20:07:09 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * README: Suggestions from Torbjorn Granlund <tege@matematik.su.se>:
+ Mention make install. Remove the old copyright date as well the
+ clumsy and rather pointless copyright on the README file.
+
+Fri Mar 8 17:51:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If there is a
+ Makefile after running symlink-tree, then run `make distclean' to
+ avoid clobbering any generated files in srcdir.
+
+Tue Mar 5 08:21:44 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (m68k-*-netbsd*): Build everything now.
+
+Wed Feb 28 12:25:46 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * Makefile.in (taz): Fix quoting.
+
+Tue Feb 27 11:33:57 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * configure.in (sparclet-*-*): Build everything now.
+
+Tue Feb 27 14:31:51 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.in (m68k-*-linux*): New host.
+
+Mon Feb 26 14:32:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Check for bison before byacc.
+
+Tue Feb 20 23:12:35 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in configure: Change the way LEX and BISON/YACC are
+ set. configure now defines DEFAULT_LEX and DEFAULT_YACC by
+ searching PATH. These are used as fallbacks by Makefile.in if
+ flex/bison/byacc aren't in objdir.
+
+Mon Feb 19 11:45:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Make everything which depends upon all-bfd also
+ depend upon all-opcodes, in case --with-commonbfdlib is used.
+
+Thu Feb 15 19:50:50 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (host *-*-cygwin32): Don't build gdb if we are
+ building NT native compilers on Unix.
+
+Thu Feb 15 17:42:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't get CC from the host Makefile fragment if we
+ can find gcc in PATH, or if this is a Canadian Cross. Move the
+ Solaris test for /usr/ucb/cc to the post target script, just after
+ the compiler sanity test.
+
+Wed Feb 14 16:57:40 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Merge with FSF.
+
+Tue Feb 13 14:27:48 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (RPATH_ENVVAR): New variable.
+ (REALLY_SET_LIB_PATH): Use it.
+ * configure.in: On HP/UX, set RPATH_ENVVAR to SHLIB_PATH.
+
+Mon Feb 12 15:28:49 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config.sub, configure.in: Recognize sparclet cpu.
+
+Mon Feb 12 15:33:59 1996 Christian Bauernfeind <chrisbfd@theorie3.physik.uni-erlangen.de>
+
+ * config.guess: Support m68k-cbm-sysv4.
+
+Sat Feb 10 12:06:42 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * config.guess (*:Linux:*:*): Guess m68k-unknown-linux and
+ m68k-unknown-linuxaout from linker help string. Put quotes around
+ $ld_help_string.
+
+Thu Dec 7 09:03:24 1995 Tom Horsley <Tom.Horsley@mail.hcsc.com>
+
+ * config.guess (powerpc-harris-powerunix): Add guess for port
+ to new target.
+
+Thu Feb 8 15:37:52 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * config.guess (UNAME_VERSION): Recognize X4.x as an OSF version.
+
+Mon Feb 5 16:36:51 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: If --enable-shared was used, set SET_LIB_PATH to
+ $(REALLY_SET_LIB_PATH) in Makefile.
+ * Makefile.in (SET_LIB_PATH): New variable.
+ (REALLY_SET_LIB_PATH): New variable.
+ ($(DO_X)): Use $(SET_LIB_PATH).
+ (install.all, gcc-no-fixedincludes, $(ALL_MODULES)): Likewise.
+ ($(NATIVE_CHECK_MODULES), $(CROSS_CHECK_MODULES)): Likewise.
+ ($(INSTALL_MODULES), $(CONFIGURE_TARGET_MODULES)): Likewise.
+ ($(ALL_TARGET_MODULES), $(CHECK_TARGET_MODULES)): Likewise.
+ ($(INSTALL_TARGET_MODULES), $(ALL_X11_MODULES)): Likewise.
+ ($(CHECK_X11_MODULES), $(INSTALL_X11_MODULES)): Likewise.
+ (all-gcc, all-bootstrap, check-gcc, install-gcc): Likewise.
+ (install-dosrel): Likewise.
+ (all-opcodes): Depend upon all-libiberty.
+
+Sun Feb 4 16:51:11 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * config.guess (*:CYGWIN*): New
+
+Sat Feb 3 10:42:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (all-target-winsup): All all-target-libiberty.
+
+Fri Feb 2 17:58:56 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (noconfigdirs): Add missing # in front of comment.
+
+Thu Feb 1 14:38:13 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: add second pass to things added to noconfigdirs
+ so *-gm-magic can exclude libgloss properly.
+
+Thu Feb 1 11:10:16 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure (extralibs_name, rez_name): Set correctly
+ for MWC68K compiler.
+
+ * mpw-README: Add more info on the necessary build tools.
+
+Thu Feb 1 10:22:38 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * configure.in, config.sub: Recognize cygwin32.
+
+Wed Jan 31 14:17:10 1996 Richard Henderson <rth@tamu.edu>
+
+ * config.guess, config.sub: Recognize A/UX.
+
+Wed Jan 31 13:52:14 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Merge with gcc/config.sub.
+
+Thu Jan 25 11:01:10 1996 Raymond Jou <rjou@mexican.cygnus.com>
+
+ * mpw-build.in (do-binutils): Add build of stamps.
+
+Thu Jan 25 17:05:26 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * config.sub: Add recognition for mips64vr4100*-* targets.
+
+Wed Jan 24 12:47:55 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * test-build.mk: Add checking of `hpux9' rather than just `hpux'.
+ Add creation of gconfigargs with `--enable-shared' turned on.
+ ($(host)-stamp-stage2-configured): Pass $(gconfigargs).
+ ($(host)-stamp-stage3-configured): Likewise.
+ (HOLES): Add chatr and ldd.
+ (i386-ncr-sysv4.3*): Add use of /usr/ccs/bin in the PATH and HOLE_DIRS.
+
+Wed Jan 24 20:32:30 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * configure: Pass --nfp to recursive configures.
+
+Mon Jan 22 10:41:56 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * Makefile.in (DLLTOOL): New.
+ (DLLTOOL_FOR_TARGET): New.
+ (EXTRA_HOST_FLAGS): Pass down DLLTOOL.
+ (EXTRA_TARGET_FLAGS): Ditto.
+ (EXTRA_GCC_FLAGS): Ditto.
+ (CONFIGURE_TARGET_MODULES): Ditto.
+ (DO_X): Ditto.
+ * configure: Add DLLTOOL.
+
+Fri Jan 19 13:30:15 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ SCO OpenServer 5 changes from Robert Lipe <robertl@dgii.com>:
+ * configure.in (i[345]86-*-sco3.2v5*): Use mh-sysv instead of
+ mh-sco, since old workarounds no longer needed, and don't
+ build ld, since libraries have weak symbols in COFF.
+
+Sun Jan 14 23:01:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (CONFIGURE_TARGET_MODULES): Add missing ';'.
+
+Fri Jan 12 15:25:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Make sure that ${CC} can be used to compile an
+ executable.
+
+Sat Jan 6 07:23:33 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * Makefile.in (all-gdb): Depend on $(GDB_TK).
+ * configure (GDB_TK): Set GDB_TK to either "all-tcl all-tk" or
+ nothing depending on whether gdbtk is being built.
+
+Wed Jan 3 17:54:41 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (newlib.tar.gz): Delete building of newlib's info files.
+
+Mon Jan 1 19:09:14 1996 Brendan Kehoe <brendan@rtl.cygnus.com>
+
+ * configure.in (noconfigdirs): Put ld or gas in this early, if the
+ user specifically used --with-gnu-ld=no or --with-gnu-as=no.
+
+Sat Dec 30 16:08:57 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config-ml.in: Add support for
+ --disable-{softfloat,m68881,m68000,m68020} on m68*-*-*.
+ Simplify setting of multidirs from --disable-foo.
+
+Fri Dec 29 07:56:11 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (EXTRA_GCC_FLAGS): If any of the make variables
+ LANGUAGES, BOOT_CFLAGS, STMP_FIXPROTO, LIMITS_H_TEST,
+ LIBGCC1_TEST, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES, and ENQUIRE are
+ non-empty, pass them on to the GCC make.
+ (all-bootstrap): New rule that is like all-gcc, except it executes
+ the GCC bootstrap rule instead of the GCC all rule.
+
+Wed Dec 27 15:51:48 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config-ml.in (ml_realsrcdir): New, to account for ${subdir}.
+
+Tue Dec 26 11:45:31 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.guess (AViiON:dgux:*:*): Update from FSF to add pentium
+ DG/UX support.
+
+Fri Dec 15 10:01:27 1995 Stan Cox <coxs@dg-rtp.dg.com>
+
+ * config.sub (i*86*) Change [345] to [3456]
+
+Wed Dec 20 17:41:40 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in (noconfigdirs): Add gas or ld if --with-gnu-as=no or
+ --with-gnu-ld=no.
+
+Wed Dec 20 15:15:35 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config-ml.in (rs6000*, powerpc*): Add switches to control which
+ AIX multilibs get built.
+
+Mon Dec 18 17:55:46 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (i386-win32): Don't build expect if we're not
+ building the tcl subdir.
+
+Mon Dec 18 11:47:19 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in: (configure-target-examples, all-target-examples):
+ New targets, configure and build example programs.
+
+Fri Dec 15 16:13:03 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: If an mpw-config.in generated a file mk.sed,
+ use it as input to sedit the generated MPW makefile.
+ * mpw-README: Add a suggestion about Gestalt.h.
+
+Wed Dec 13 16:43:51 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Accept *-*-ieee*.
+
+Tue Dec 12 11:52:57 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (local-distclean): Remove $(TARGET_SUBDIR). From
+ Ronald F. Guilmette <rfg@monkeys.com>.
+
+Mon Dec 11 15:31:58 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (host==powerpc-pe): Add many directories to noconfigdirs
+ for powerpc-pe native.
+ (target==i386-win32): add tcl, make to noconfigdirs if canadian cross.
+ (target==powerpc-pe): duplicate i386-win32 entry.
+
+Sat Dec 9 14:58:28 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * configure.in (noconfigdirs): Exclude target-newlib for all versions
+ of vxworks, not just vxworks5.1.
+
+Mon Dec 4 12:05:40 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Add support for exec-prefix.
+
+Mon Dec 4 10:22:50 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * config.guess: Recognize HP model 816 machines as having
+ a PA1.1 processor.
+
+Mon Dec 4 12:38:15 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Ignore new autoconf configure options.
+
+Thu Nov 30 14:45:25 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/mt-v810 (CC_FOR_TARGET): Add -ansi flag. NEC compiler
+ defaults to K&R mode, but doesn't have varargs.h, so we have to
+ compile in ANSI mode.
+
+Thu Nov 30 16:57:33 1995 Per Bothner <bothner@wombat.gnu.ai.mit.edu>
+
+ * config.guess: Recognize Pentium under SCO.
+ From Robert Lipe <robertl@arnet.com>.
+
+Wed Nov 29 13:49:08 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (noconfigdirs): Disable target-libio on v810-*-*.
+ * config/mt-v810 (CC_FOR_TARGET, AS_FOR_TARGET, AR_FOR_TARGET,
+ RANLIB_FOR_TARGET): Set as appropriate for NEC v810 toolchain.
+
+Wed Nov 29 12:12:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't configure gas for alpha-dec-osf*.
+
+Tue Nov 28 17:16:48 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Default to --with-stabs for some targets for which
+ it makes sense: mips*-*-*, alpha*-*-osf*, i[345]86*-*-sysv4* and
+ i[345]86*-*-unixware*.
+
+Mon Nov 27 13:44:15 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config-ml.in: Get list of multidirs using gcc --print-multi-lib
+ rather than basing it on the target. Simplify handling of options
+ controlling which directories to configure. Remove extraneous
+ slash in multi-clean target.
+
+Fri Nov 24 17:29:29 1995 Doug Evans <dje@deneb.cygnus.com>
+
+ * config-ml.in: Prefix more variables with ml_ so they don't collide
+ with configure's.
+
+Wed Nov 22 11:27:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Don't turn -v into --v.
+
+Tue Nov 21 16:48:02 1995 Doug Evans <dje@deneb.cygnus.com>
+
+ * configure.in (targargs): Fix typo.
+
+ * Makefile.in (DEVO_SUPPORT): Add symlink-tree.
+
+Tue Nov 21 14:08:28 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Strip --host and --target options from
+ CONFIG_ARGUMENTS, and always configure for --host only. Add
+ --with-cross-host option when building with a cross-compiler.
+ * configure: Canonicalize the arguments put into config.status by
+ always using `=' for an option with an argument. Pass a presumed
+ --host or --target explicitly.
+
+Fri Nov 17 17:50:30 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config.sub: Merge -macos*, -magic*, -pe*, and -win32 cases
+ into general OS recognition case.
+
+Fri Nov 17 17:42:25 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (target_configdirs): add target-winsup only
+ for win32 target systems.
+
+Thu Nov 16 14:04:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (all-target-libgloss): Depend upon
+ configure-target-newlib, since when libgloss is built it looks to
+ see if the newlib directory exists.
+
+Wed Nov 15 14:47:52 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (DEVO_SUPPORT): Use config-ml.in instead of
+ cfg-ml-*.in.
+
+Wed Nov 15 11:45:23 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Handle LD and LD_FOR_TARGET when configuring a
+ Canadian Cross.
+
+Tue Nov 14 15:03:12 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * config/mh-i386win32: add LD_FOR_TARGET.
+
+Tue Nov 14 14:56:11 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (target_libs): add target-winsup.
+ (target==i386-win32): add patch diff flex make to $noconfigdirs.
+ (target==ppcle-pe): remove ld from $noconfigdirs.
+
+Tue Nov 14 01:25:50 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (CONFIGURE_TARGET_MODULES): Pass --with-target-subdir.
+ Preserve relative path names in $srcdir. Build symlink tree if
+ configuring cross target dir and srcdir=. (= no VPATH support).
+ (configure-target-libg++): Depend on configure-target-librx.
+ * cfg-ml-com.in, cfg-ml-pos.in: Deleted.
+ * config-ml.in: New file.
+ * symlink-tree: New file.
+ * configure: Ensure srcdir="." if that's what it is.
+
+Mon Nov 13 12:34:20 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-README: Clarify some phrasing, add notes about CodeWarrior
+ includes and FLEX_SKELETON setting.
+ * mpw-configure (--with-gnu-ld): New option, controls whether
+ to use PPCLink or ld with PowerMac GCC.
+ * mpw-build.in (all-grez, do-grez, install-grez): New targets.
+ * mpw-config.in: Configure grez if targeting Mac.
+
+ * config.sub: Accept pmac and pmac-mpw as names for PowerMacs,
+ accept mpw and mac-mpw as names for m68k Macs, change macos7 to
+ just macos.
+ * configure.in: Configure grez resource compiler if targeting Mac.
+ * Makefile.in (all-grez, install-grez): New targets.
+
+Wed Nov 8 17:33:51 1995 Jason Merrill <jason@yorick.cygnus.com>
+
+ * configure: CXX defaults to gcc, not g++. If we find
+ gcc in the path, set CC to gcc -O2.
+
+Tue Nov 7 15:45:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Default ${build} correctly. Avoid picking up extra
+ spaces when reading CC and CXX from Makefile. When doing a
+ Canadian Cross, use plausible default values for numerous
+ variables.
+ * configure.in: When doing a Canadian Cross, don't try to
+ configure tools whose configure script can't handle it.
+
+Mon Nov 6 19:32:17 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * cfg-ml-com.in (sh-*-*): Add m2 and ml/m2 to multidirs.
+
+Sun Nov 5 00:15:41 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * configure: Remove dubious bug reporting address.
+
+Fri Nov 3 08:17:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If subdir has
+ configure script, run that instead of this directory's configure.
+ In either case, print a message that we're configuring the sub-dir.
+
+Thu Nov 2 23:23:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * configure.in: Before checking for the existence of various files,
+ use sed to filter out "target-".
+
+Thu Nov 2 13:24:56 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (DO_X): Split rule to decrease command line length
+ for systems with small ARG_MAX values. From phdm@info.ucl.ac.be
+ (Philippe De Muyter).
+
+Wed Nov 1 15:18:35 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in (all-patch): depend on all-libiberty.
+
+Wed Nov 1 12:23:20 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: If the only directory in target_configdirs which
+ actually exists is libiberty, then set target_configdirs to empty,
+ to avoid trying to build a target libiberty in a gas or gdb
+ distribution.
+
+Tue Oct 31 17:52:39 1995 J.T. Conklin <jtc@slave.cygnus.com>
+
+ * configure.in (host_makefile_frag): Use m68k-sun-sunos* instead
+ of m68k-sun-* when selecting mh-sun3 to avoid matching NetBSD/sun3
+ systems.
+
+Tue Oct 31 16:57:32 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * configure.in (copy_dirs): Use sys-include instead of include
+ for --with-headers option.
+
+Tue Oct 31 10:29:36 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * Makefile.in, configure.in: Make winsup builds work with
+ new scheme.
+
+Mon Oct 30 18:57:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Build the linker on AIX.
+
+Mon Oct 30 12:27:16 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Add $(TARGET_SUBDIR)
+ where needed.
+
+Mon Oct 30 12:45:25 1995 Doug Evans <dje@cygnus.com>
+
+ * Makefile.in (all-gcc): Fix typo.
+
+Sat Oct 28 10:27:59 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in ($(CHECK_TARGET_MODULES)): Fix typo.
+
+Fri Oct 27 23:14:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * configure.in: Rename libFOO to target-libFOO, and xiberty
+ to target-xiberty, to provide more flexibility.
+ (target_subdir): Define. Create if cross.
+ Set TARGET_SUBDIR in Makefile to ${target_subdir}.
+ * Makefile.in: Rename all-libFOO -> all-target-libFOO, all-xiberty
+ -> all-target-libiberty, configure-libFOO -> configure-target-libFOO,
+ check-libFOO -> check-target-libFOO, etc.
+ ($(DO_X)): Iterate over TARGET_CONFIGDIRS after SUBDIRS.
+ ($(CONFIGURE_TARGET_MODULES), $(CHECK_TARGET_MODULES),
+ $(ALL_TARGET_MODULES), $(INSTALL_TARGET_MODULES)): Update accordingly.
+ (configure-target-XXX): Depend on $(ALL_GCC), not all-gcc, to
+ allow ALL_GCC="" to only configure.
+ (DEVO_SUPPORT): Add cfg-ml-com.in and cfg-ml-pos.in.
+ (ETC_SUPPORT, ETC_SUPPORT_PFX): Merge; update 'taz' accordingly.
+ (LIBGXX_SUPPORT_DIRS): Remove xiberty.
+
+Sat Oct 28 01:53:49 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (taz): Build "info" in etc explicitly.
+
+Fri Oct 27 09:32:30 1995 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Make sure that CC is undefined (as opposed to
+ null) if toplevel/config/mh-{host} doesn't define it. Fixes a
+ problem with autoconf trying to configure on a host without GCC.
+
+Thu Oct 26 22:35:01 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Set host alias from choice of host compiler,
+ only use generic MPW Makefile sed if present, edit a file
+ named "hacked_Makefile.in" instead of "Makefile.in" if present.
+ * mpw-README: Add problem notes about CW6 and CW7.
+
+Thu Oct 26 05:45:10 1995 Ken Raeburn <raeburn@kr-pc.cygnus.com>
+
+ * Makefile.in (taz): Use ";" instead of ";;".
+
+Wed Oct 25 15:18:24 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (taz): Grep for '^diststuff:' or '^info:' in
+ sub-directory Makefiles, instead of using DISTSTUFFDIRS and
+ DISTDOCDIRS.
+ (DISTSTUFFDIRS, DISTDOCDIRS): Removed - no longer used.
+ (newlib.tar.gz): Don't pass DISTDOCDIRS to recursive make.
+
+Wed Oct 25 14:43:55 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (DISTDOCDIRS): Remove ld gprof bnutils gas libg++ gdb
+ and gnats, because they are now subsumed by DISTSTUFFDIRS.
+ Move bfd to DISTSTUFFDIRS.
+
+Tue Oct 24 18:19:09 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in (X11_LIB): Removed.
+ (X11_FLAGS_TO_PASS): pass only X11_EXTRA_CFLAGS and X11_EXTRA_LIBS.
+
+ * configure.in (host_makefile_frag): mh-aix & mh-sun removed.
+
+Sun Oct 22 13:04:42 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in (powerpc*): Shorten some of the multilib directory
+ names.
+
+Fri Oct 20 18:02:10 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in (powerpc*-eabi*): Add mcall-aixdesc varients.
+
+Thu Oct 19 10:40:57 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * configure.in (i[345]86-*-win32): Always build newlib.
+ Don't configure cvs, autoconf or texinfo.
+ * Makefile.in (LD_FOR_TARGET): New.
+ (BASE_FLAGS_TO_PASS, EXTRA_TARGET_FLAGS, CONFIGURE_TARGET_MODULES):
+ Pass down LD_FOR_TARGET.
+
+Wed Oct 18 15:53:56 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * winsup: New directory.
+ * Makefile.in: Build winsup.
+ * configure.in: Winsup is configured when target is win32.
+ Can only build win32 target GDB when native.
+
+Mon Oct 16 09:42:31 1995 Jeffrey A Law (law@cygnus.com)
+
+ * config.guess: Recognize HP model 819 machines as having
+ a PA 1.1 processor.
+
+Mon Oct 16 10:49:43 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Fix sed loop which substitutes for CC and CXX to
+ avoid bug found in various sed implementations.
+
+Wed Oct 11 16:16:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in (powerpc-*-eabisim): Delete separate rule for
+ simulator. Use standard powerpc-*-eabi*.
+
+Mon Oct 9 17:21:56 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Stop putting gas and binutils in noconfigdirs for
+ powerpc-*-aix* and rs6000-*-*.
+
+Mon Oct 9 12:38:40 1995 Michael Meissner <meissner@cygnus.com>
+
+ * cfg-ml-com.in (powerpc*-*-eabisim*): Add support for building
+ -mcall-aixdesc libraries.
+
+Fri Oct 6 16:17:57 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * config.sub (arm | armel | armeb): Fix shell syntax.
+
+Fri Oct 6 14:40:28 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in ({powerpc,rs6000}-ibm-aix*): Add multilibs for
+ -msoft-float and -mcpu=common support.
+ (powerpc*-*-eabisim*): Add support for building -mcall-aix
+ libraries.
+
+Thu Oct 5 13:26:37 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in: Allow configuration and build of emacs19 for the alpha.
+
+Wed Oct 4 22:05:36 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (CC): Get ^CC, not just any old CC, from
+ ${host_makefile_frag}.
+
+Wed Oct 4 21:55:00 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (CC): Try to get CC from
+ ${srcdir}/${host_makefile_frag}, not ${host_makefile_frag}.
+
+Wed Oct 4 21:44:12 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in (TARGET_CONFIGDIRS): configure targetdirs
+ only if it exists in $(srcdir).
+
+Wed Oct 4 11:52:31 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: If CC and CXX are not set in the environment, set
+ them, based on either an existing Makefile or on searching for gcc
+ in PATH. Substitute for CC and CXX in Makefile.
+ * configure.in: Remove libm from target_libs. Separate
+ target_configdirs from configdirs. If CC is not set in
+ environment, try to get it from a host Makefile fragment. Rewrite
+ changes of configdirs to use skipdirs instead. A few minor
+ tweaks. Take directories out of target_configdirs as they are
+ taken out of configdirs. Remove existing Makefile files from
+ subdirectories. Substitute for TARGET_CONFIGDIRS and
+ CONFIG_ARGUMENTS in Makefile.
+ * Makefile.in (TARGET_CONFIGDIRS): New variable, automatically set
+ by configure.in.
+ (CONFIG_ARGUMENTS): Likewise.
+ (CONFIGURE_TARGET_MODULES): New variable.
+ ($(DO_X)): Loop over TARGET_CONFIGDIRS as well as SUBDIRS.
+ ($(CONFIGURE_TARGET_MODULES)): New target.
+ (configure-libg++, configure-libio): New targets.
+ (all-libg++): Depend upon configure-libg++.
+ (all-libio): Depend upon configure-libio.
+ (configure-libgloss, all-libgloss): New targets.
+ (configure-libstdc++): New target.
+ (all-libstdc++): Depend upon configure-libstdc++.
+ (configure-librx, all-librx): New targets.
+ (configure-newlib): New target.
+ (all-newlib): Depend upon configure-newlib
+ (configure-xiberty): New target.
+ (all-xiberty): Depend upon configure-xiberty.
+
+Sat Sep 30 04:32:59 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (host i[345]86-*-win32): Expand the
+ noconfigdirs again.
+
+Thu Sep 28 21:18:49 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-configure: Fix sed command file name.
+
+Thu Sep 28 17:39:56 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * configure.in (host i[345]86-*-win32): Reduce the
+ noconfigdirs again.
+
+Wed Sep 27 12:24:00 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't configure ld and gdb for powerpc*-*-winnt*
+ or powerpc*-*-pe*, since they are not yet supported.
+
+Tue Sep 26 14:30:01 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ Add PowerMac support and many other enhancements.
+ * mpw-configure: New option --cc to select compiler to use,
+ paste options set according to --cc into the generated
+ Makefile, generate the Makefile by sed'ing the Unix Makefile.in
+ if mpw-make.sed is present.
+ * mpw-config.in: Don't test for gC1, test for mpw-touch,
+ add forward includes for PowerPC include files.
+ * mpw-build.in: Build using Makefile.PPC if present.
+ (do-byacc, etc): Remove separate version resource builds.
+ (do-gas): Build "stamps" before "all".
+ (do-gcc): Build "stamps-h" and "stamps-c" before "all".
+ * mpw-README: Update to reflect --cc option, PowerMac support,
+ and recently-reported compatibility problems.
+
+Fri Sep 22 12:15:42 1995 Doug Evans <dje@deneb.cygnus.com>
+
+ * cfg-ml-com.in (m68*-*-*): Only build multilibs for
+ embedded m68k systems (-aout, -coff, -elf, -vxworks).
+ (--with-multilib-top): Pass to recursive invocations.
+
+Tue Sep 19 13:51:05 1995 J.T. Conklin <jtc@blues.cygnus.com>
+
+ * configure.in (noconfigdirs): Disable libg++ and libstdc++ on
+ v810-*-*.
+
+Mon Sep 18 23:08:26 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (noconfigdirs): Disable bfd, binutils, gas, gcc,
+ gdb, ld and opcodes on v810-*-*.
+
+Sat Sep 16 18:31:08 PDT 1995 Angela Marie Thomas <angela@cygnus.com>
+
+ * config/mh-ncrsvr43: Removed AR_FLAGS
+
+Tue Sep 12 18:03:31 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (DO_X): Change do-realclean to do-maintainer-clean.
+ (local-maintainer-clean): New target.
+ (maintainer-clean): New target.
+ (realclean): Just depend upon maintainer-clean.
+
+Fri Sep 8 17:11:14 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (noconfigdirs): Disable gdb on m68k-*-netbsd*.
+
+Fri Sep 8 16:46:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Build ld in mips*-*-bsd* case.
+
+Thu Sep 7 20:03:41 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * config.sub: Accept -lites* OS. From Ian Dall.
+
+Fri Sep 1 08:06:58 1995 James G. Smith <jsmith@beauty.cygnus.com>
+
+ * config.sub: recognise mips64vr4300 and mips64vr4300el as valid
+ targets.
+
+Wed Aug 30 21:06:50 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in: treat i386-win32 canadian cross the same as
+ i386-go32 canadian cross.
+
+Thu Aug 24 14:53:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in (powerpc*-*-eabisim): Add support for PowerPC
+ running under the simulator to build a reduced set of libraries.
+ (powerpc-*-eabiaix): Add fine grained multilib support added to
+ other powerpc targets yesterday.
+
+Wed Aug 23 09:41:56 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * cfg-ml-com.in (powerpc*): Add support for -disable-biendian,
+ -disable-softfloat, -disable-relocatable, -disable-aix, and
+ -disable-sysv to control which multilib libraries get built.
+
+Thu Aug 17 16:03:41 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ * configure: Add Makefile.tem to list of files to remove in trap
+ handler.
+
+Mon Aug 14 19:27:56 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * config.guess (*Linux*): Add missing "exit"s.
+ Also, need specific check for alpha-unknown-linux (uses COFF).
+
+Fri Aug 11 15:38:20 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * config.guess: Merge with FSF:
+
+ Wed Jun 28 17:57:27 1995 David Edelsohn <edelsohn@mhpcc.edu>
+ * config.guess (AIX4): More robust release numbering discovery.
+
+ Thu Jun 22 19:01:24 1995 Kenneth Stailey (kstailey@eagle.dol-esa.gov)
+ * config.guess (i386-sequent-ptx): Properly get version number.
+
+ Thu Jun 22 18:36:42 1995 Uwe Seimet (seimet@iris1.chemie.uni-kl.de)
+ * config.guess (mips:*:4*:UMIPS): New case.
+
+Mon Aug 7 09:21:35 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (i386-go32 host): Fix typo (deja-gnu -> dejagnu).
+ (i386-win32 host): Likewise. Don't build readline.
+
+Sat Aug 5 09:51:49 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * Makefile.in (GDBTK_SUPPORT_DIRS): Define and pass as part of
+ SUPPORT_FILES to submakes.
+
+Fri Aug 4 13:04:36 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (GDB_SUPPORT_DIRS): Add utils.
+ (DEVO_SUPPORT): Add mpw-README, mpw-build.in, mpw-config.h and
+ mpw-configure.
+
+Wed Aug 2 16:32:40 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * configure.in (appdirs): Use =, not ==, in test expression when
+ trying to build the text to print in the warning message for
+ Solaris users.
+
+Mon Jul 31 09:56:18 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * cfg-ml-com.in (z8k-*-coff): Add 'std' multilib build.
+
+Fri Jul 28 00:16:31 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * config.guess: Recognize lynx-2.3.
+
+Thu Jul 27 15:47:59 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * config.sub (z8ksim): Deleted
+ (z8k-*-coff): New, this is the one true name of the target.
+
+Thu Jul 27 14:33:33 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * cfg-ml-pos.in (dotdot): Work around SunOS sed bug.
+
+Thu Jul 27 13:31:05 1995 Fred Fish (fnf@cygnus.com)
+
+ * config.guess (*:Linux:*:*): First try asking the linker what the
+ default object file format is (elf, aout, or coff). Then if this
+ fails, try previous methods.
+
+Thu Jul 27 11:28:17 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in: Don't build newlib for *-*-vxworks5.1.
+
+Thu Jul 27 11:18:47 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in: Don't build newlib for a29k-*-vxworks5.1.
+ * test-build.mk: Add setting of --with-headers for a29k-vxworks5.1.
+
+Tue Jul 25 21:25:39 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * cfg-ml-pos.in (MULTITOP): Trim excess trailing "/.".
+
+Fri Jul 21 10:41:12 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * cfg-ml-com.in: New file.
+ * cfg-ml-pos.in: New file.
+
+Wed Jul 19 00:37:27 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * COPYING.NEWLIB: Add HP free copyright to list.
+
+Tue Jul 18 10:58:51 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.sub: Recognize -eabi* for the system, not just -eabi.
+
+Mon Jul 3 13:44:51 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * Makfile.in (DLLTOOL_FOR_TARGET): New name, pass it down.
+ * config.sub, configure.in (win32): New target and host.
+
+Wed Jun 28 23:57:08 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * configure.in: Add i386-pe configuration.
+
+Fri Jun 23 14:28:44 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-build.in (install): Install GDB after LD.
+
+Thu Jun 22 17:10:53 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in (elf/mips.h): Always forward-include, needed
+ for GDB to build.
+
+Wed Jun 21 15:17:30 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * testsuite: New directory for customer acceptance and whole tool
+ chain tests.
+
+Wed Jun 21 16:50:29 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * configure: If per-host line isn't found, but AC_OUTPUT is found
+ and a configure script exists, run it instead.
+
+Thu Jun 15 21:09:24 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * config.guess: Update from FSF, for alpha-dec-winnt3.5 and Crays.
+
+Tue Jun 13 21:43:27 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * configure: Set build_{cpu,vendor,os,alias} to host values when
+ --build isn't specified.
+
+Mon Jun 5 18:26:36 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * Makefile.in (PICFLAG, PICFLAG_FOR_TARGET): New macros.
+ (FLAGS_TO_PASS): Pass them.
+ (EXTRA_TARGET_FLAGS): Ditto.
+
+ * config/m?-*pic: Define PICFLAG* instead of LIB*FLAGS*.
+
+Wed May 31 22:27:42 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * Makefile.in (all-libg++): Depend on all-libstdc++.
+
+Thu May 25 22:40:59 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (noconfigdirs): Enable all packages for
+ i386-unknown-netbsd.
+
+Sat May 20 13:22:31 1995 Angela Marie Thomas <angela@cirdan.cygnus.com>
+
+ * configure.in (noconfigdirs): Don't configure tk for i386-go32
+ hosted builds (DOS builds)
+
+Thu May 18 18:08:49 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ Changes for ARM based on patches from Richard Earnshaw:
+ * config.sub: Handle armeb and armel.
+ * configure.in: Omit arm linker only for riscix.
+
+Thu May 11 17:23:26 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * config.guess: Update from FSF.
+
+Tue May 9 15:52:05 1995 Michael Meissner <meissner@cygnus.com>
+
+ * config.sub: Recognize powerpcle as the little endian varient of
+ the PowerPC. Recgonize ppc as a PowerPC variant, and ppcle as a
+ powerpcle variant. Convert pentium into i586, not i486. Add p5
+ alias for i586. Map new x86 variants p6, k5, nexgen into i586
+ temporarily.
+
+Tue May 2 16:29:41 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * configure.in (hppa*-*-lites*): Treat like hppa*-*-*elf*.
+
+Sun Apr 30 21:38:09 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config.sub: Accept -lites* as a basic system type.
+
+Thu Apr 27 11:33:29 1995 Michael Meissner (meissner@cygnus.com)
+
+ * config.guess (*:Linux:*:*): Check for whether the pre-BFD linker is
+ installed, and if so return linuxoldld as the system name.
+
+Wed Apr 26 10:59:02 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config.guess: Add hppa1.1-hp-lites support.
+
+Tue Apr 25 11:08:11 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * configure.in: Don't build newlib for m68k-vxworks5.1.
+
+Wed Apr 19 17:02:43 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * configure.in (mips-sgi-irix6): Use mh-irix5.
+
+Fri Apr 14 15:21:17 1995 Doug Evans <dje@chestnut.cygnus.com>
+
+ * Makefile.in (all-gcc): Depend on all-ld (for libgcc1-test).
+
+Wed Apr 12 16:06:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * test-build.mk: Enable building of shared libraries on IRIX 5 and
+ OSF/1. Fix compiler flags.
+ * build-all.mk: Support Linux and OSF/1 3.0. Fix compiler flags.
+
+Tue Apr 11 18:55:40 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in: Recognize --with-newlib.
+ (sparc-*-sunos4*): Build sim, dejagnu, expect, tcl if cross target.
+
+Mon Apr 10 14:38:20 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in: move {all,check,install}-gdb from *_MODULES
+ to *_X11_MODULES due to gdbtk needing X include files et al.
+
+Mon Apr 10 11:42:22 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ Merge in support for Mac MPW as a host.
+ (Old change descriptions retained for informational value.)
+
+ * mpw-config.in: Add generic include forwards for cpu-specific
+ include files in aout and elf directories.
+
+ * mpw-configure: Added copyright.
+ * mpw-config.in: Check for presence of required build tools.
+ (target_libs): Add newlib.
+ (target_tools): Add examples.
+ (Read Me): Generate as "Read Me for MPW" instead.
+ * mpw-build.in: Base sub-builds on all-foo instead of do-foo.
+ (all-byacc, do-byacc, all-flex, do-flex, do-newlib): New actions.
+ (do-gas, do-gcc, do-gdb, do-ld): Build Version.r first.
+
+ * mpw-configure: Remove subdir-specific makefile hackery,
+ delete mk.tmp after using it.
+
+ * mpw-build.in (all): Display start and end times.
+
+ * mpw-configure (host_canonical): Set.
+ (target_cpu): Always add to makefiles.
+ (ARCHDEFS, EMUL): Add to makefile only if nonempty.
+ (TM_FILE, XM_FILE, NM_FILE): No longer add to makefile.
+ (mpw-mh-mpw): Look for in srcdir and srcroot.
+ Use sed instead of mpw-edit-prefix to edit prefix definitions.
+
+ * mpw-build.in: (install-only): New target.
+
+ * mpw-configure (host_alias, target_alias): Rename from hostalias
+ and targetalias, add into generated Makefile.
+ (mk.tmp): If present, add into generated Makefile.
+ * mpw-build.in (all-gas): Build config.h first before gas proper.
+
+ * mpw-configure (config.status): Write only if changed.
+ * mpw-config.in (readline): Configure it (not built, just used for
+ definitions).
+
+ * mpw-config.in (elf/mips.h): Add a forward include.
+
+ * mpw-config.in: Forward-include most .h files in include into
+ extra-include.
+ (readline): Don't build.
+ mpw-build.in (install): Install GDB.
+
+ * mpw-configure (prefix, mpw_prefix): Handle it.
+ * mpw-config.in (mmalloc, readline): Don't configure.
+ * mpw-build.in (thisscript): Rename to ThisScript.
+ Use mpw-build instead of BuildProgram everywhere.
+ (mmalloc, readline): Don't build.
+ * mpw-README: New file, basic documentation about the MPW port.
+
+ * mpw-config.in: Use forward-include to create include files.
+
+ * mpw-configure: Add more things to the top of each configured
+ Makefile, including contents of config/mpw-mh-mpw.
+ * mpw-config.in (extra-include): Create this directory and fill it
+ with Posix-like include files when configuring.
+
+ * config.sub (apple, mac, mpw): Add various aliases.
+
+ * mpw-build.in: New file, top-level build script fragment for MPW.
+ * mpw-configure: New file, configure script for MPW.
+ * mpw-config.in: New file, config fragment for MPW.
+
+Fri Apr 7 19:33:16 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in (host_libs): Remove glob, since it is gone from the
+ sources.
+
+Fri Mar 31 11:36:17 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in: define empty GDB_NLM_DEPS var.
+
+ * configure.in(target_makefile_frag): use config/mt-netware
+ for netware targets.
+
+Thu Mar 30 13:51:43 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.sub: Merge in recent FSF changes. Remove linux special
+ cases.
+
+Tue Mar 28 14:47:34 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ build-all.mk,config/mh-solaris: revert these two changes:
+
+ Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * build-all.mk: Use CC=cc -Xs on Solaris.
+
+ Mon Mar 29 19:59:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/mh-solaris: SunPRO C needs -Xs to be able to get a
+ working xmakefile for Emacs.
+
+Tue Mar 21 10:43:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * glob/*: Removed. Schauer's 24 Feb 1994 readline change made us
+ stop using it.
+ * Makefile.in: Nuke all references to glob subdirectory.
+
+Thu Mar 16 13:35:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * configure.in: Fix --enable-shared logic in per-host.
+
+Mon Mar 13 12:33:15 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in (*-hp-hpux[78]*): Use mh-hpux8.
+
+Mon Mar 6 10:21:58 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in (noconfigdirs): Don't build gas on AIX, for
+ powerpc*-*-aix* as well as for rs6000*-*-aix*.
+
+Wed Mar 1 12:51:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Fix --cache-file to work if the file argument is a
+ relative path.
+
+Tue Feb 28 17:36:07 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: If the --cache-file is used, pass it down to
+ configure in subdirectories.
+
+Mon Feb 27 12:52:46 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config.sub: add vxworks29k configuration.
+
+Fri Feb 10 16:12:26 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (taz): Do "diststuff" part quietly.
+
+Sun Feb 5 14:16:35 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.sub: Mini-merge with gcc/config.sub.
+
+Sat Feb 4 12:11:35 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * config.guess (IRIX): Sed - to _.
+
+Fri Feb 3 11:54:42 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (source-vault, binary-vault): New targets.
+
+Thu Jan 26 13:00:11 1995 Michael Meissner <meissner@cygnus.com>
+
+ * config.sub: Recognize -eabi as a basic system type.
+
+Thu Jan 12 13:13:23 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * configure.in (enable_shared stuff): Fix typo.
+
+Thu Jan 12 01:36:51 1995 deanm@medulla.LABS.TEK.COM (Dean Messing)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): Fix typo in passing LIBCXXFLAGS*.
+
+Wed Jan 11 16:29:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * Makefile.in (LIBCXXFLAGS_FOR_TARGET): Add -fno-implicit-templates.
+
+Mon Jan 9 12:48:01 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * configure.in (rs6000-*-*): Don't build gas.
+
+Wed Jan 4 23:53:49 1995 Ian Lance Taylor <ian@tweedledumb.cygnus.com>
+
+ * Makefile.in: Use /x/x/ instead of /brokensed/brokensed/, to
+ reduce command line length.
+ (AS_FOR_TARGET): Check for as.new, not Makefile.
+ (NM_FOR_TARGET): Check for nm.new, not Makefile.
+
+Wed Jan 4 13:02:39 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * config.guess: Merge from FSF.
+
+Thu Dec 15 17:11:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * configure: Don't use $ when handling program_suffix.
+
+Mon Dec 12 12:09:37 1994 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Configure tk for hppa/hpux.
+
+Fri Dec 2 15:55:38 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (LIBGXX_SUPPORT_DIRS): Add libstdc++.
+
+Tue Nov 29 19:37:56 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in: Move -fno-implicit-template from CXXFLAGS
+ to LIBCXXFLAGS. Tests are better run without it.
+
+Wed Nov 23 10:29:25 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * Makefile.in (all-ispell): Depend on all-emacs19 instead of all-emacs.
+
+Mon Nov 21 11:14:01 1994 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (*-*-netware*): Don't configure xiberty.
+
+Mon Nov 14 08:49:15 1994 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Remove tk from native_only list.
+
+Fri Nov 11 15:31:26 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * build-all.mk: Add mips-ncd-elf target to sun4 targets
+ for special NCD build.
+
+Mon Nov 7 20:58:17 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (DEVO_SUPPORT): Remove configure.bat and
+ makeall.bat, they're only useful for binutils snapshots.
+ (binutils.tar.gz, gas+binutils.tar.gz): Add configure.bat and
+ makeall.bat to specified SUPPORT_FILES.
+
+Mon Nov 7 17:25:18 1994 Bill Cox (bill@cirdan.cygnus.com)
+
+ * build-all.mk: Add Ericsson targets to sun4 and solaris
+ hosts. Add BNR's sun4 target to solaris host, so their
+ build-from-source will be tested in-house first.
+
+Sat Nov 5 18:43:30 1994 Jason Merrill (jason@phydeaux.cygnus.com)
+
+ * Makefile.in (LIBCFLAGS): New variable.
+ (CFLAGS_FOR_TARGET): Ditto.
+ (LIBCFLAGS_FOR_TARGET): Ditto.
+ (LIBCXXFLAGS): Ditto.
+ (CXXFLAGS_FOR_TARGET): Ditto.
+ (LIBCXXFLAGS_FOR_TARGET): Ditto.
+ (BASE_FLAGS_TO_PASS): Pass them.
+ (EXTRA_TARGET_FLAGS): Ditto.
+
+ * configure.in, config/m[th]-*pic: Support --enable-shared.
+
+Sat Nov 5 15:44:00 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * configure.in (target_libs): Include libstdc++ again.
+ * config.guess: Update from FSF (for FreeBSD).
+
+Thu Nov 3 16:32:30 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (DEVO_SUPPORT): Include configure.bat and
+ makeall.bat.
+ (DISTDOCDIRS): Add `etc'.
+ (ETC_SUPPORT_PFX): New variable.
+ (taz): Include anything from etc starting with a word in
+ ETC_SUPPORT_PFX.
+
+Wed Oct 26 16:19:35 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * config.sub: Update for recent FSF changes. Remove obsolete
+ h8300hds entry. Add -windows* and -osx as basic os. Minor
+ spacing changes.
+
+Thu Oct 20 18:41:56 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * configure.in (target_libs): Remove libstdc++ for libg++-2.6.1.
+
+ * config.guess: Merge with FSF.
+ * configure.in: Match on i?86-ncr-sysv4.3, not i?86-ncr-sysv43.
+
+Thu Oct 20 19:26:56 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * configure: Since the "trap 0" handler will override the exit
+ status on many systems, only use it for "exit 1", and make it set
+ a non-zero exit status; reset it before "exit 0". Also, check
+ exit status of config.sub, and error out if it failed.
+
+Wed Oct 19 18:49:55 1994 Rob Savoye (rob@cygnus.com)
+
+ * Makefile.in: (ALL_TARGET_MODULES,INSTALL_TARGET_MODULES) Build
+ and install libgloss.
+
+Tue Oct 18 15:25:24 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * Makefile.in (all-binutils): Depend upon all-byacc.
+
+ * configure.in: Don't build emacs on Irix 5.
+
+Mon Oct 17 16:22:12 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * configure.in (*-*-netware*): Add libio.
+
+Thu Oct 13 15:51:20 1994 Jason Merrill (jason@phydeaux.cygnus.com)
+
+ * Makefile.in (ALL_TARGET_MODULES): Add libstdc++.
+ (CHECK_TARGET_MODULES): Ditto.
+ (INSTALL_TARGET_MODULES): Ditto.
+ (TARGET_LIBS): Ditto.
+ (all-libstdc++): Note dependencies.
+
+Thu Oct 13 01:43:08 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (BINUTILS_SUPPORT_DIRS): Add gas.
+
+Tue Oct 11 12:12:29 1994 Jason Merrill (jason@phydeaux.cygnus.com)
+
+ * Makefile.in (CXXFLAGS): Use -fno-implicit-templates instead of
+ -fexternal-templates.
+
+ * configure.in (target_libs): Add libstdc++.
+ (noconfigdirs): Add libstdc++ as appropriate.
+
+Thu Oct 6 18:00:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Update from FSF.
+
+Tue Oct 4 12:05:42 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * configure: Use ${config_shell} when running ${configsub}.
+
+Mon Oct 3 14:28:34 1994 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.sub: No longer recognize h8300h.
+
+Mon Oct 3 12:40:54 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * config.sub: Remove extraneous differences between config.sub and
+ gcc/config.sub.
+
+Sat Oct 1 00:23:12 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (DISTSTUFFDIRS): Add gas.
+
+Thu Sep 22 19:04:55 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * COPYING.NEWLIB: New file.
+
+Mon Sep 19 18:25:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess (HP-UX): Patch from Harlan Stenn
+ <harlan@landmark.com> to also emit release level.
+
+Wed Sep 7 13:15:25 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * config.guess (sun4*:SunOS:*:*): Change '-JL' to '_JL'.
+
+Tue Sep 6 23:23:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.sub: Merge nextstep cleanup from FSF.
+
+Mon Sep 5 05:01:30 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * configure.in (arm-*-*): Don't configure ld for this target.
+
+Thu Sep 1 09:35:00 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * configure.in (*-*-netware): don't configure libg++, libio,
+ librx, or newlib.
+
+Wed Aug 31 13:52:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in (alpha-dec-osf*): Use osf*, not osf1*. Don't
+ configure ld--it works, but it doesn't support shared libraries.
+
+Sun Aug 28 18:13:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess (*-unknown-freebsd*): Get rid of possible
+ trailing "(Release)" in version string.
+ Patch from Paul Richards <paul@isl.cf.ac.uk>.
+
+Sat Aug 27 15:00:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Fix i486-ncr-sysv43 -> i486-ncr-sysv4.3.
+ Fix type: *-next-neststep -> *-next-nextstep.
+
+ * config.guess: Merge from FSF:
+
+ Fri Aug 26 18:45:25 1994 Philippe De Muyter (phdm@info.ucl.ac.be)
+
+ * config.guess: Recognize powerpc-ibm-aix3.2.5.
+
+ Wed Apr 20 06:36:32 1994 Philippe De Muyter (phdm@info.ucl.ac.be)
+
+ * config.guess: Recognize UnixWare 1.1 (UNAME_SYSTEM is SYSTEM_V
+ instead of UNIX_SV for UnixWare 1.0).
+
+Sat Aug 27 01:56:30 1994 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (all-gdb): Add dependencies on all-gcc and all-ld
+ to make gdb/nlm/* build after the compiler and linker.
+
+Fri Aug 26 14:30:05 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess (netbsd, freebsd, linux): Accept any machine,
+ not just i[34]86.
+ (m68k-atari-sysv4): Relocate to match FSF version.
+
+ * config.guess: More merges from the FSF:
+
+ Add a space before function call or macro invocation.
+
+ Tue May 10 16:53:55 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * config.guess: Add trap cmd to remove dummy.c and dummy when
+ interrupted.
+
+ Wed Apr 20 18:07:13 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
+
+ * config.guess (dummy.c): Redirect stderr for `hostinfo' command.
+ (dummy): Redirect stderr from compilation of dummy.c.
+
+ Sat Apr 9 14:59:28 1994 Christian Kranz (kranz@sent5.uni-duisburg.de)
+
+ * config.guess: Distinguish between NeXTStep 2.1 and 3.x.
+
+Fri Aug 26 13:42:20 1994 Ken Raeburn (raeburn@kr-laptop.cygnus.com)
+
+ * configure: Accept and ignore --cache*, for compatibility with
+ new autoconf.
+
+Fri Aug 26 13:05:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Merge from FSF:
+
+ Thu Aug 25 20:28:51 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu>
+
+ * config.guess (Pyramid*:OSx*:*:*): New case.
+ (PATH): Add /.attbin at end for finding uname.
+ (dummy.c): Handle i860-alliant-bsd. Follow whitespace conventions.
+
+ Wed Aug 17 18:21:02 1994 Tor Egge (tegge@pvv.unit.no)
+
+ * config.guess (M88*:DolphinOS:*:*): New case.
+
+ Thu Aug 11 17:00:13 1994 Stan Cox (coxs@dg-rtp.dg.com)
+
+ * config.guess (AViiON:dgux:*:*): Use TARGET_BINARY_INTERFACE
+ to select whether to use ELF or COFF.
+
+ Sun Jul 24 16:20:53 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu>
+
+ * config.guess: Recognize i860-stardent-sysv and i860-unknown-sysv.
+
+ Sun May 1 10:23:10 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
+
+ * config.guess: Guess the OS version for HPUX.
+
+ Tue Mar 1 21:53:03 1994 Karl Heuer (kwzh@hal.gnu.ai.mit.edu)
+
+ * config.guess (UNAME_VERSION): Recognize aix3.2.4 and aix3.2.5.
+
+Fri Aug 26 11:19:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in: Recognize --with-headers, --with-libs, and
+ --without-newlib.
+ * Makefile.in (all-xiberty): Depend upon all-ld.
+
+Wed Aug 24 12:36:50 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in: Change i[34]86 to i[345]86.
+
+Mon Aug 22 10:58:33 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure (version): A few more tweaks to help message.
+
+Fri Aug 19 12:40:25 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in: Remove (for now) librx as a host library,
+ now that we're building it for target.
+
+Fri Aug 19 10:49:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure: Fix up help message; from karl@owl.hq.ileaf.com
+ (Karl Berry).
+
+Tue Aug 16 16:11:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * configure.in: Also configure librx.
+
+Mon Aug 15 16:51:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in: Update various rules to reflect that librx
+ is now needed for libg++.
+
+Fri Aug 12 18:07:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * config.sub: Accept mips64orion and mips64orionel as a CPU name.
+
+Mon Aug 8 11:36:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in: Configure the examples directory.
+
+Thu Aug 4 16:12:36 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure: Simplify Jun 2 1994 change.
+
+Wed Aug 3 04:58:16 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * change CC to /usr/latest/bin/gcc for lynx host builds, since
+ /bin/gcc isn't good enough to build gcc.
+
+Wed Jul 27 09:07:14 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (GDB_SUPPORT_FILES): Remove
+ (setup-dirs-gdb, gdb.tar.gz, make-gdb.tar.gz): Remove old rules.
+ (gdb.tar.gz): Add new rule to use standard distribution building
+ mechanism.
+
+Mon Jul 25 11:10:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Warn about use of /usr/ucb/cc on Solaris. From
+ Bill Cox <bill@cygnus.com>.
+
+Sat Jul 23 12:19:46 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Recognize ISC. Patch from kwzh@gnu.ai.mit.edu.
+
+Fri Jul 22 17:53:59 1994 Stu Grossman (grossman@cygnus.com)
+
+ * configure: Search current dir first in .gdbinit.
+
+Fri Jul 22 11:28:30 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.sub: Recognize freebsd (merged from gcc config.sub).
+
+Thu Jul 21 14:10:52 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.sub: Refer to NeXT's operating system as nextstep.
+
+ * config.sub (case $basic_machine): Re-order the cases, to match
+ the order in the FSF version (which is mostly alphabethical).
+ Merge in some additions and changes from the FSF.
+
+Sat Jul 16 12:03:08 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config.guess: Recognize m68k-atari-sysv4 and m88k-harris-csux7.
+ * config.sub: Recognize cxux7.
+ * configure.in: Use mh-cxux for m88k-harris-cxux*.
+
+Mon Jul 11 14:37:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.sub: Fix typo powerpc -> powerpc-*.
+
+Sat Jul 9 13:03:43 1994 Michael Tiemann (tiemann@blues.cygnus.com)
+
+ * Makefile.in: `all-emacs19' depends on `all-byacc'.
+
+ * Makefile.in: Add all-emacs19 and install-emacs19 rules (in
+ parallel with all-emacs and install-emacs). Top-level command
+ `make all-emacs19 CC=gcc' now behaves as `make all-emacs CC=gcc'.
+
+Thu Jun 30 16:53:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * test-build.mk ($(host)-stamp-stage2-installed): Remove
+ $(relbindir)/make before doing ``make install'', and use
+ $(GNU_MAKE) while doing it. Avoids problem on SunOS with
+ installing over running make binary.
+ ($(host)-stamp-stage3-installed): Likewise.
+
+Tue Jun 28 13:43:25 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize Mach.
+
+Mon Jun 27 16:41:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure: Check ${exec_prefixoption}, not ${exec_prefix}, to
+ see whether --exec-prefix was used.
+
+Sun Jun 26 21:15:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * README: Explicitly mention libg++/README. (Zoo's idea.)
+
+Tue Jun 21 12:45:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Add all-librx target similar to all-libproc.
+
+Wed Jun 8 23:11:55 1994 Stu Grossman (grossman@cygnus.com)
+
+ * config.guess: Rearrange tests for Alpha-OSF1 to properly deal
+ with post 1.2 uname bogosity.
+
+Thu Jun 9 00:27:59 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure: Remove temporary files on receipt of a signal.
+
+Tue Jun 7 12:06:24 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: If there is a package_makefile_frag, remove
+ ${subdir}/Makefile.tem after copying it in.
+
+Mon Jun 6 21:35:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * build_all.mk: support rs6000 lynx identifies itself as
+ rs6000-lynx-lynxos2.2.2. Also, use /usr/cygnus/progressive/bin/gcc
+ since /bin/gcc is too feeble to compile a modern gcc.
+
+Mon Jun 6 16:06:34 1994 Karen Christiansen (karen@cirdan.cygnus.com)
+
+ * brought devo/test-build.mk update-to-date with progressive/
+ test-build.mk. Add lynx targets and hppa flag info.
+
+Sat Jun 4 17:23:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * configure.in: Use mh-ncrsvr43. Patch from
+ Tom McConnell <tmcconne@sedona.intel.com>.
+
+Fri Jun 3 17:47:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess (i386-unknown-bsdi): No longer need to
+ check #if defined(__bsdi__) && defined(__i386__).
+
+Thu Jun 2 18:56:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure: Set program_transform_nameoption correctly.
+
+Thu Jun 2 10:57:06 1994 Karen Christiansen (karen@cirdan.cygnus.com)
+
+ * brought build-all.mk update-to-date with progressive build-all.mk,
+ added new targets and hppa info.
+
+Thu Jun 2 00:12:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure: If config.guess result is a prefix of the user
+ specified target, assume a native build and use the user specified
+ target as the host alias. Remove SunOS patch suffix removal hack.
+ * configure.in: Remove SunOS patch suffix removal hack.
+
+ * Makefile.in (CROSS_CHECK_MODULES): Remove check-flex, since it's
+ in NATIVE_CHECK_MODULES.
+
+Wed Jun 1 10:49:41 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * Makefile.in: Rename HOST_ONLY to NATIVE.
+ * configure: Delete SunOs patch suffix from host_canonical
+ and build_canonical variables that are prepended to Makefiles.
+ * configure.in: Add comments for easier maintenance.
+
+Tue May 31 19:39:47 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Add all-libproc target similar to all-gui.
+
+Tue May 31 17:16:33 1994 Tom Lord (lord@cygnus.com)
+
+ * Makefile.in (CHECK_MODULES): split into
+ HOST_ONLY_CHECK_MODULES and CROSS_CHECK_MODULES.
+
+Tue May 31 16:36:36 1994 Paul Eggert (eggert@twinsun.com)
+
+ * config.guess (i386-unknown-bsdi): New system to guess.
+
+Wed May 25 16:47:10 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Add all-gui target (but not yet build by "all").
+
+Thu May 26 08:53:19 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * config.sub: Move deletion of patch suffix from here...
+ * configure.in: To here, at Ian's suggestion. The top-
+ level scripts might need to know of a patch level.
+
+Wed May 25 09:15:54 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * config.sub: Strip off patch suffix so rtl is recognized
+ as a sunos4.1.3 machine, even though it's been patched.
+
+Fri May 20 08:25:49 1994 Steve Chamberlain (sac@deneb.cygnus.com)
+
+ * Makefile.in (INSTALL_LAST): Delete.
+ (INSTALL_DOSREL): New.
+
+Thu May 19 17:12:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Use ld for i[34]86-*-sysv4* and sparc-*-solaris2*.
+ Don't set use_gnu_ld to no for *-*-sysv4; that only controls
+ whether we pass down --with-gnu-ld anyhow.
+
+Thu May 19 09:29:12 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * Makefile.in (INSTALL_LAST): Change operation so it works
+ on more flavors of make.
+ * configure.in (go32): Don't build libg++ or libio.
+
+Fri May 13 13:28:34 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * Makefile.in (Move HOST_PREFIX_1 and friends up so
+ they can be overriden by templates.
+
+Sat May 7 16:46:44 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * configure.in (target==go32): Don't build gdb.
+ * dosrel: New directory.
+
+Fri May 6 14:19:25 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * configure.in (host==go32): Configure dosrel too.
+ * Makefile.in (INTALL_TARGET): Call INSTALL_LAST last.
+ (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): Undefine, they should
+ be set by incoming names or templates.
+ (INSTALL_LAST): New rule.
+ * config/mh-go32: New fragment.
+
+Thu May 5 17:35:05 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config.sub (sparclitefrw, sparclitefrwcompat): Don't set the os.
+
+Thu May 5 20:06:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * config/mh-lynxrs6k: Renamed from mh-lynxosrs6k, to make it
+ unique in 8.3 naming schemes.
+ * configure.in (appdirs): New variable. Currently empty, but will
+ be used in gas distribution. If nonempty, lists a set of
+ directories at least one of which must get configured, or top
+ level configuration is considered to have failed.
+ (rs6000-*-lynxos*): Use new file name.
+
+Thu May 5 13:38:36 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Eliminate XTRAFLAGS.
+ * Makefile.in (CC_FOR_TARGET): If newlib exists, refer to the
+ newlib include files using -idirafter, and also use -nostdinc.
+ (CXX_FOR_TARGET): Likewise.
+ (XTRAFLAGS): Removed.
+ (BASE_FLAGS_TO_PASS): Remove XTRAFLAGS_FOR_TARGET.
+ (EXTRA_HOST_FLAGS): Remove XTRAFLAGS.
+ (EXTRA_TARGET_FLAGS, EXTRA_GCC_FLAGS): Likewise.
+ ($(DO_X)): Don't pass down XTRAFLAGS.
+
+Thu May 5 00:16:36 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * configure.in (mips*-dec-bsd*): New target; do build linker.
+ (mips*-*-bsd*): New target; don't build linker.
+
+Wed May 4 20:10:10 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * configure.in: support rs6000-*-lynxos* configuration.
+ support sunos4 as a cross target.
+
+ * config.sub: look for lynx*, not lynx since the OS version may
+ legitimately be part of the name.
+
+Tue May 3 21:48:11 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * configure.in (i[34]86-*-sco*): Move to be with other i386
+ targets.
+ (romp-*-*): New target. Skip various binary utilities.
+ (vax-*-*): New target. Don't build newlib.
+ (vax-*-vms): Renamed from *-*-vms. Don't build opcodes or newlib.
+
+Thu Apr 28 15:03:05 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure.in: Only set host_makefile_frag if config
+ directory exists.
+
+Wed Apr 27 12:14:30 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * install.sh: If $dstdir exists, don't check whether each
+ component does.
+
+Tue Apr 26 18:11:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * test-build.mk (HOLES): Add sleep; used by rcs/src/conf.sh.
+
+Mon Apr 25 15:06:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in (*-*-lynxos*): Don't configure newlib for either
+ native or cross Lynx.
+
+Sat Apr 16 11:58:16 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * config.sub (sparc64-elf): Fix os.
+ (z8k): Remove duplicate.
+
+Thu Apr 14 23:33:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * Makefile.in (gcc-no-fixedincludes): Touch gcc/include/fixed, not
+ gcc/stmp-fixproto, to try to prevent fixproto from being run.
+
+Wed Apr 13 15:14:52 1994 Bill Cox (bill@cygnus.com)
+
+ * configure: Make file links cleanly even if Lynx fails on
+ an NFS symlink (at least fail cleanly).
+
+Mon Apr 11 10:58:56 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * test-build.mk (CC): For mips-sgi-irix4, change -XNh1500 to
+ -XNh2000.
+
+Sat Apr 9 15:10:45 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure: Unknown options are fatal again.
+
+Fri Apr 8 12:01:41 1994 David J. Mackenzie (djm@cygnus.com)
+
+ * configure: Ignore --x-includes and --x-libraries, for Autoconf
+ compatibility.
+
+Thu Apr 7 17:31:43 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * build-all.mk: Add `clean' target.
+
+Wed Apr 6 20:44:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config.guess: Add SINIX support.
+ * configure.in: Add mips-*-sysv4* support.
+
+Mon Apr 4 17:41:44 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * build-all.mk: Document all useful targets.
+ If canonhost is sparc-sun-solaris2.3, change it to sparc-sun-solaris2.
+ If canonhost is mips-sgi-irix4.0.5H, change it to mips-sgi-irix4.
+
+Thu Mar 31 04:55:57 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure: Support --silent, --quiet.
+
+Wed Mar 30 21:37:38 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure: Support --disable-FEATURE.
+
+Tue Mar 29 19:15:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize NCR running SVR4.3.
+
+Mon Mar 28 14:55:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Make BSDI generate i386-unknown-bsd386.
+ Patch from Paul Eggert <eggert@twinsun.com>.
+
+Mon Mar 28 12:54:52 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in (powerpc-*-aix*): Treat like rs6000-*-*.
+
+Sat Mar 26 11:25:48 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure: Make unrecognized options give nonfatal warnings
+ instead of fatal errors, and pass them to any subdirectory
+ configures in case they recognize them.
+ Make --x equivalent to --with-x.
+
+Fri Mar 25 21:52:10 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure: Add --enable-* options. Clean up usage message and
+ some comments.
+
+Thu Mar 24 09:12:53 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * Makefile.in (NM_FOR_TARGET): Build tree version is now nm.new.
+
+Sun Mar 20 11:28:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * configure.in (hppa*-*-*): Enable binutils.
+
+Sat Mar 19 11:50:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.sub: Recognize cisco.
+
+Fri Mar 18 16:42:32 1994 Jason Merrill (jason@deneb.cygnus.com)
+
+ * Makefile.in (CXXFLAGS): Add -fexternal-templates.
+
+Tue Mar 15 11:25:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: about target *-hitachi-hiuxwe2, don't print more
+ than one configuration name. Add comment.
+
+Sun Mar 6 23:13:38 1994 Hisashi MINAMINO (minamino@sra.co.jp)
+
+ * config.guess: about target *-hitachi-hiuxwe2, fixed
+ machine guessing order. [Hitachi's CPU_IS_HP_MC68K
+ macro is incorrect.]
+
+Sun Mar 13 09:10:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (TAGS): Just build TAGS in each subdirectory, rather
+ than the "make ls" stuff which used to be here.
+
+Fri Mar 11 12:52:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Recognize i[34]86-unknown-freebsd.
+ From Shawn M Carey <smcarey@rodan.syr.edu>.
+
+Thu Mar 3 14:24:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * configure.in (noconfigdirs for alpha): Remove libg++ and libio.
+
+Wed Mar 2 13:28:48 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * config.guess: Check for ptx.
+
+Mon Feb 28 16:46:50 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * config.sub: Add os9k checking.
+
+Thu Feb 24 07:09:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config.guess: Handle OSF1 running on HPPA processors
+
+Fri Feb 18 14:14:00 1994 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * configure: If subdir configure fails, print out a message with
+ subdirectory name, in case subdir's configure code didn't identify
+ itself.
+
+Fri Feb 18 12:50:15 1994 Doug Evans (dje@cygnus.com)
+
+ * configure.in: Remove embedded newlines from configdirs.
+ Avoid mismatches of substrings. Fix matching strings at end
+ of configdirs.
+
+Fri Feb 11 15:33:33 1994 Stu Grossman (grossman at cygnus.com)
+
+ * config.guess: Add Lynx/rs6000 config support.
+
+Tue Feb 8 13:41:09 1994 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * configure.in (alpha-dec-osf1*, alpha*-*-*): Build gas.
+
+Mon Feb 7 15:42:36 1994 Jeffrey A. Law (law@cygnus.com)
+
+ * configure.in (hppa*-*-osf*): Treat this just like most other
+ PA configurations (eg no binutils or ld).
+ (hppa*-*-*elf*): These configurations have binutils and ld.
+
+Sun Feb 6 16:35:07 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config.sub (hiux): Fix typo. From m-kasahr@sramhc.sra.co.JP.
+
+Sat Feb 5 01:00:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in (rs6000-*-*): Build gas.
+
+Wed Feb 2 13:57:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * Makefile.in: Avoid bug in losing hpux sed.
+
+Wed Feb 2 14:53:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in, test-build.mk: Remove MUNCH_NM; it was only needed
+ for GDB and GDB has been fixed to not need it.
+
+Mon Jan 31 18:40:55 1994 Stu Grossman (grossman at cygnus.com)
+
+ * config/mh-lynxosrs6k: Account for lack of ranlib!
+
+Sun Jan 30 17:58:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * config.guess: Recognize vax hosts.
+
+Fri Jan 28 15:29:38 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * configure (while loop): Don't use "break 2" inside case
+ statement -- the case statement isn't an enclosing loop.
+
+Mon Jan 24 18:40:06 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Clean up NeXT support, to allow nextstep
+ on Intel machines. Make OS be nextstep.
+
+Sun Jan 23 18:47:22 1994 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
+
+ * config.guess: Add alternate forms for Convex.
+
+Thu Jan 20 16:13:41 1994 Stu Grossman (grossman at cygnus.com)
+
+ * configure: Completely rewrite option processing. Take
+ advantage of pattern-matching to avoid invoking test frequently.
+ Also clean up host and target defaulting logic.
+
+Mon Jan 17 15:06:56 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * Makefile.in: Replace all occurrances of "rootme" with "r" and
+ "$${rootme}" with "$$r", to increase the likelihood that the do-*
+ commands (plus user environment) will fit SCO limits.
+
+Thu Jan 6 11:20:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Don't issue warnings about directories which are
+ not being configured if -norecursion is set. Correct test for
+ --with-gnu-as and --with-gnu-ld to not get confused by substring
+ matches.
+
+ * configure.in: Don't build gas for alpha-dec-osf1*.
+
+Tue Jan 4 17:10:19 1994 Stu Grossman (grossman at cygnus.com)
+
+ * configure: Back out Per's change of 12/19/1993. It changes the
+ behavior of configure in unexpected and confusing ways.
+
+ Also, use different delim char when calculating
+ program_transform_name so that the name can contain slashes.
+
+Sat Jan 1 13:45:31 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * configure.in, config.sub: Add support for VSTa micro-kernel.
+
+Sat Dec 25 20:00:47 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * configure.in: Nuke hacks which were used to get a special
+ version of GAS for HPPA configurations.
+
+Sun Dec 19 20:40:44 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * configure: If only ${target_alias} is given, use that
+ as the default for ${host_alias}.
+ * configure: Add missing back-slashes before nested quotes.
+
+Wed Dec 15 18:07:18 1993 david d `zoo' zuhn (zoo@andros.cygnus.com)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): add YACC=$(BISON)
+
+Tue Dec 14 21:25:33 1993 Per Bothner (bothner@cygnus.com)
+
+ * config.guess: Recognize some Tektronix configurations.
+ From Kaveh R. Ghazi <ghazi@noc.rutgers.edu>.
+
+Sat Dec 11 11:18:00 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * config.sub: Match any flavor of SH.
+
+Thu Dec 2 17:16:58 1993 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * configure.in: Don't try to configure newlib for Alpha.
+
+Thu Dec 2 14:35:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Don't build ld for Irix 5. Don't build gas,
+ libg++ or libio for any Alpha target.
+
+ * configure.in (mips*-sgi-irix5*): New target; use mh-irix5.
+ * config/mh-irix5. New file for Irix 5.
+
+Wed Dec 1 17:00:33 1993 Jason Merrill (jason@deneb.cygnus.com)
+
+ * Makefile.in (GZIPPROG): Renamed from GZIP, which gzip uses for
+ default arguments -- so it tried to compress itself.
+
+Tue Nov 30 13:45:15 1993 david d `zoo' zuhn (zoo@andros.cygnus.com)
+
+ * configure.in (notsupp): ensure that a space is always at the end
+ of the configdirs list, since the grep checks for an explicit space
+
+Tue Nov 16 15:04:27 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in (target i386-sysv4.2): don't build ld, since static
+ versions of many libraries are not available.
+
+Tue Nov 16 14:28:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize Apollos (using environment variables).
+ * configure.in: Don't configure ld, binutils, or gprof for Apollo.
+
+Thu Nov 11 12:03:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize Sony news mips running newsos.
+
+Wed Nov 10 16:57:00 1993 Mark Eichin (eichin@cygnus.com)
+
+ * Makefile.in (all-cygnus, build-cygnus): "fi else" needs to be
+ "fi ; else" for bash.
+
+Tue Nov 9 15:54:01 1993 Mark Eichin (eichin@cygnus.com)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): pass SHELL.
+
+Fri Nov 5 08:07:27 1993 D. V. Henkel-Wallace (gumby@blues.cygnus.com)
+
+ * config.sub: accept unixware as an alias for svr4.2.
+ Fix some inconsistancies with the gcc version.
+
+Fri Nov 5 15:14:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (DISTDOCDIRS): Add gdb.
+
+Fri Nov 5 11:59:42 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in (DISTDOCDIRS): Add libg++ and libio.
+
+Fri Nov 5 10:35:05 1993 Ken Raeburn (raeburn@rover.cygnus.com)
+
+ * Makefile.in (taz): Only build "info" in DISTDOCDIRS.
+ (DISTDOCDIRS): Don't assume libg++ and gdb folks necessarily want
+ this now.
+
+Thu Nov 4 18:58:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.sub: Accept hiux* as an OS name.
+
+ * Makefile.in: Change RUNTEST_FLAGS back to RUNTESTFLAGS per
+ etc/make-stds.texi. The underscore came from gcc, and dje now
+ agrees that RUNTESTFLAGS is the correct name.
+
+Thu Nov 4 10:49:01 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * install.sh: Remove 'set -e'. It makes any conditionals
+ in the script useless.
+
+ * config.guess: Automatically recognize arm-acorn-riscix
+ Patch from Richard Earnshaw (rwe11@cl.cam.ac.uk).
+
+Thu Nov 04 08:08:04 1993 Jeffrey Wheat (cassidy@cygnus.com)
+
+ * Makefile.in: Change RUNTESTFLAGS to RUNTEST_FLAGS
+
+Wed Nov 3 22:09:46 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * Makefile.in (DISTDOCDIRS): New variable.
+ (taz): Edit local Makefile.in sooner, instead of proto-toplev
+ Makefile.in later. Build "info" and "dvi" in DISTDOCDIRS.
+
+Wed Nov 3 21:31:52 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in (hppa target): check the source directory for the
+ pagas sub-directory
+
+Wed Nov 3 11:12:22 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config.sub: Allow -aout* and -elf*.
+
+Wed Nov 3 11:08:33 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * configure.in: Don't build ld on i386-solaris2, same as for
+ sparc-solaris2.
+
+Tue Nov 2 14:21:25 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in (taz): Add texinfo/lgpl.texinfo (for libg++).
+
+Tue Nov 2 13:38:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Configure gdb for alpha.
+
+Mon Nov 1 10:42:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (CXXFLAGS): Add -O.
+
+Wed Oct 27 10:45:06 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config.guess: added support for DG Aviion
+
+Tue Oct 26 14:37:37 1993 Ken Raeburn (raeburn@rover.cygnus.com)
+
+ * configure.in: Produce warning message for subdirectories not
+ configurable for this host/target combination. Don't try to
+ configure gdb for vms.
+
+Mon Oct 25 11:22:15 1993 Ken Raeburn (raeburn@rover.cygnus.com)
+
+ * Makefile.in (taz): Replace "byacc" with "bison -y" in the
+ appropriate files before making "diststuff".
+ (DISTBISONFILES): New var: list of files to be edited.
+ (DISTSTUFFDIRS): Add binutils.
+
+Fri Oct 22 20:32:15 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config.sub: also handle mipsel and mips64el (for little endian mips)
+
+Fri Oct 22 07:59:20 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Add * to end of all OS names.
+
+Thu Oct 21 11:38:28 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * configure.in: Build newlib for LynxOS native.
+
+Wed Oct 20 09:56:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Add support for delta 88k running SVR3.
+
+ * configure.in: Add comment about HP compiler vs. emacs.
+
+Tue Oct 19 16:02:22 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: don't build ld on solaris2 (not a viable option
+ due to bugs in getpwnam & getpwuid)
+
+Tue Oct 19 15:13:56 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * configure.in: Accept alpha-dec-osf1*, not just -osf1, since
+ config.guess will produce a full version number.
+
+Tue Oct 19 15:58:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Build linker and binutils for alpha-dec-osf1.
+
+Tue Oct 19 11:41:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Remove -O from CXXFLAGS for consistency with CFLAGS,
+ and gdb/testsuite/Makefile.in.
+
+Sat Oct 9 18:39:07 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: recognize mips*- instead of mips-
+
+Fri Oct 8 14:15:39 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * config.sub: Accept linux*coff and linux*elf as operating
+ systems.
+
+Tue Oct 7 14:24:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltmain.sh: Handle symlinks in generated script.
+
+Thu Oct 7 12:57:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config.sub: Recognize mips64, and mips3 as an alias for it.
+
+Wed Oct 6 13:54:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Remove alpha-dec-osf*, no longer necessary now that
+ gdb knows how to handle OSF/1 shared libraries.
+
+Tue Oct 5 11:55:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Recognize hppa*-*-hiux* (currently synonym for hpux).
+ * config.guess: Recognize Hitachi's HIUX.
+ * config.sub: Recognize h3050r* and hppahitachi.
+ Remove redundant cases for hp9k[23]*.
+
+Mon Oct 4 16:15:09 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: default to '--with-gnu-as' and '--with-gnu-ld'
+ if gas and ld are in the source tree and are in ${configdirs}.
+ If ${use_gnu_as} or ${use_gnu_ld} are 'no', then don't set the
+ --with options (but still pass them down on the command line,
+ if they were explicitly specified).
+
+Wed Oct 1 13:11:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Handle autoconf style directory options: --bindir,
+ --datadir, --includedir, --infodir, --libdir, --libexecdir,
+ --mandir, --oldincludedir, --sbindir, --sharedstatedir,
+ --sysconfdir.
+ * Makefile.in (sbindir, libexecdir, sysconfdir): New variables.
+ (sharedstatedir, localstatedir, oldincludedir): New variables.
+ (BASE_FLAGS_TO_PASS): Pass down bindir, datadir, includedir,
+ infodir, libdir, libexecdir, localstatedir, mandir, oldincludedir,
+ sbindir, sharedstatedir, and sysconfdir.
+
+Fri Sep 24 19:11:13 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure: substitute SHELL value in Makefile.in with
+ ${CONFIG_SHELL}
+
+Wed Sep 24 15:18:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ltmain.sh: Tweak shell pattern to avoid bug in NetBSD /bin/sh.
+
+Thu Sep 23 18:05:13 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Build gas, ld, and binutils for *-*-sysv4* and
+ *-*-solaris2* targets.
+
+Sun Sep 19 17:01:41 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * Makefile.in: define M4, and pass it down to sub-makes;
+ all-autoconf now depends on all-m4
+
+Sat Sep 18 00:38:23 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * Makefile.in ({AR,RANLIB}_FOR_TARGET): make contingent on
+ presence of {ar,ranlib} instead of a configured directory
+
+Wed Sep 15 08:41:44 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * config.guess: Accept 34?? as well as 33?? for NCR.
+
+Mon Sep 13 12:28:43 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: grab mt-hppa for HPPA targets; use 'gas ' instead
+ of 'gas' in sed commands, since 'gash' is now in the tree as well.
+
+Fri Sep 10 11:23:52 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure: grab values for $(CC) and $(CXX) from the
+ environment, so that someone can do "CC=gcc configure; make" and
+ have it work right (matching the way that autoconf works now)
+
+ * configure.in, Makefile.in: add support for gash, the tcl
+ interface to Galaxy
+
+ * config.guess: add NetBSD variants (hp300, x86)
+
+Thu Sep 9 16:48:52 1993 Jason Merrill (jason@deneb.cygnus.com)
+
+ * install.sh: Support -d option (in the manner of SunOS 4 install,
+ as it is more deterministic than that of GNU install)
+ (chmodcmd): Set file to mode 755 by default (should also do default
+ chgrp and chown, but I don't feel like dealing with that now)
+
+Tue Sep 7 11:59:39 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config.sub: Remove h8300hhms alias.
+
+Tue Aug 31 11:00:09 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Match *-*-solaris2* not *-sun-solaris2*.
+
+Mon Aug 30 18:29:10 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * Makefile.in (gcc-no-fixedincludes): touch stmp-fixproto as well
+ as stmp-fixinc
+
+Wed Aug 25 16:35:59 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config.sub: recognize m88110-bug-coff.
+
+Tue Aug 24 10:23:24 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * Makefile.in (all-libio): all dependencies on the toolchain used
+ to build this (gcc, gas, ld, etc)
+
+Fri Aug 20 17:24:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Deal with OSF/1 1.3 on alpha.
+
+Thu Aug 19 11:43:04 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * install.sh: add some 'else true' clauses for portability
+
+ * configure.in: don't build libio for h8[35]00-*-* targets
+
+Tue Aug 17 19:02:31 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in: Add support for new libio.
+
+Sun Aug 15 20:48:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * install.sh: If one command fails, don't try the rest. Don't try
+ to remove $dsttmp (via trap) unless we have already created it.
+ If $src doesn't exist, detect it and exit with an error.
+
+ * config.guess: Recognize BSD on hp300.
+
+Wed Aug 11 18:35:13 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * config.guess: Map (9000/[34]??:HP-UX:*:*) to m68k-hp-hpux.
+ Bug report from "Hamish (H.I.) Macdonald" <hamish@bnr.ca>.
+
+Wed Aug 11 15:37:51 1993 Jason Merrill (jason@deneb.cygnus.com)
+
+ * Makefile.in (all-send-pr): depends on all-prms
+
+Wed Aug 11 16:56:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Fix typo (9000/8??:4.3bsd -> 9000/7??:4.3bsd).
+
+Fri Aug 6 14:45:02 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config.guess: From michael@mercury.cs.mun.ca (Michael Rendell):
+ Added test for mips-mips-riscos5.
+
+Thu Aug 5 15:45:08 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: use mh-hp300 for 68k HP hosts
+
+Mon Aug 2 11:56:53 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure: add support for CONFIG_SHELL, so that you can use
+ some alternate shell for evaluating configure scripts
+
+Sun Aug 1 11:36:27 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (make-gdb.tar.gz): Sed bug reporting address
+ in configure script to bug-gdb@prep.ai.mit.edu when building
+ distribution archive.
+ * Makefile.in (COMPRESS): Remove def.
+ * Makefile.in (gdb.tar.gz, make-gdb.tar.gz): Renamed from
+ gdb.tar.Z and make-gdb.tar.Z respectively.
+ * Makefile.in (make-gdb.tar.gz): Now only build gzip'd archive.
+ * Makefile.in (make-gdb.tar.gz): Minor changes to move closer
+ to convergence with 'taz' target in Makefile.in.
+
+Fri Jul 30 12:34:57 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * install.sh (dsttmp): use trap to ensure that tmp files go
+ away on error conditions
+
+Wed Jul 28 11:57:36 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * Makefile.in (BASE_FLAGS_TO_PASS): remove LOADLIBES
+
+Tue Jul 27 12:43:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (install-dirs): Deal with a prefix like /gnu;
+ its parent is '/' not ''.
+
+ * Makefile.in (DEVO_SUPPORT): Add comments about ChangeLog.
+
+Fri Jul 23 09:53:37 1993 Jason Merrill (jason@wahini.cygnus.com)
+
+ * configure: if ${newsrcdir}/configure doesn't exist, don't assume
+ that ${newsrcdir}/configure.in does.
+
+Tue Jul 20 11:28:50 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * test-build.mk: support for CONFIG_SHELL
+
+Mon Jul 19 21:54:46 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * config.sub (netware): Add as a basic system type.
+
+Wed Jul 14 12:03:11 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in (Makefile): depend on configure.in. Also drop the
+ $(srcdir)/ from the dependency on Makefile.in.
+
+Tue Jul 13 20:10:58 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config.sub: Recognize h8300hhms as h8300h-hitachi-hms.
+ (h8300hhms is temporary until multi-libraries are implemented).
+ * configure.in: Handle h8300h too.
+
+Sun Jul 11 17:35:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize dpx/2 as m68k-bull-sysv3.
+
+Thu Jul 8 18:26:12 1993 John Gilmore (gnu@cygnus.com)
+
+ * configure: Remove extraneous output when guessing host type.
+ * config.guess: Remove extraneous output when guessing using C
+ compiler rather than uname, or when guessing fails.
+
+Wed Jul 7 17:58:14 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
+
+ * Makefile.in: remove all.cross and install.cross targets
+
+ * configure: remove CROSS=-DCROSS_COMPILE and ALL=all.cross
+ definitions
+
+Tue Jul 6 10:39:44 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * configure.in (target sh): Build gprof.
+
+Thu Jul 1 16:52:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.sub: change -solaris to -solaris2
+
+Thu Jul 1 15:46:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Use config/mh-riscos for mips-*-sysv*.
+
+Wed Jun 30 09:31:58 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: Correct error message for missing Makefile.in to
+ print correct directory.
+
+Tue Jun 29 13:52:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * install.sh: kludge around 386BSD shell bug
+
+Tue Jun 29 13:06:49 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config.guess: Recognize NeXT.
+ * config.guess: Recognize i486-ncr-sysv4.
+ * Makefile.in (taz): rm $(TOOL)-$$VER before linking.
+
+Tue Jun 29 12:50:57 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (MAKEINFOFLAGS): New variable.
+ (FLAGS_TO_PASS): Pass MAKEINFO as MAKEINFO MAKEINFOFLAGS.
+ * build-all.mk, test-build.mk: Pass down --no-split as
+ MAKEINFOFLAGS when hosted on DOS. Compile DOS hosted without -g.
+
+Thu Jun 24 13:39:11 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in (DEVO_SUPPORT): Add COPYING COPYING.LIB install.sh.
+
+Wed Jun 23 12:59:21 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in (libg++.tar.z): New rule.
+ * Makefile.in (taz): Replace 'configure -rm' by 'make distclean'.
+ * Makefile.in (taz): Only do a single chmod.
+
+Fri Jun 18 12:03:10 1993 david d `zoo' zuhn (zoo at majipoor.cygnus.com)
+
+ * install.sh: don't use dirname anymore (replaced with sed usage)
+
+Thu Jun 17 18:43:42 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in: Change extension for gzip'd files from '.z' to
+ '.gz' per new FSF standard usage.
+
+Thu Jun 17 16:58:50 1993 david d `zoo' zuhn (zoo at majipoor.cygnus.com)
+
+ * configure: put quotes around the final value of program_transform_name
+
+Tue Jun 15 16:48:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: new install.sh support; update install-info rules
+
+Wed Jun 9 12:31:34 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in: Build diff for crosses, but not for go32 host.
+
+ * configure.in: Build gprof only for native, and don't build it
+ for mips-*-*, rs6000-*-*, or i[34]86-*-sco*.
+
+Mon Jun 7 13:12:11 1993 david d `zoo' zuhn (zoo at deneb.cygnus.com)
+
+ * configure.in: don't build gas,ld,binutils on for *-*-sysv4
+
+Mon Jun 7 11:40:11 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * configure.in (host_tools): Add prms.
+
+Fri Jun 4 13:30:42 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: install gcc, do installation of $(INSTALL_MODULES)
+ with $(FLAGS_TO_PASS) on the command line
+
+ * config.sub: Recognize lynx and lynxos
+
+Fri Jun 4 10:59:56 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.sub: Accept -ecoff*, not just -ecoff.
+
+Thu Jun 3 17:38:54 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * Makefile.in (taz): Use .gz suffix instead of .z.
+ (binutils.tar.gz, gas+binutils.tar.gz, gas.tar.gz): Fixed target
+ names.
+
+Thu Jun 3 00:27:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in (vault-install): add an 'else true' (for Ultrix)
+
+Wed Jun 2 18:19:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in (install-no-fixedincludes): install gcc last, so
+ that rebuilds that might happen during 'make install' don't get
+ bogus gcc include files
+
+Wed Jun 2 16:14:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ Change from Utah for HPPA support:
+ * config.guess: Recognize hppa1.x-hp-bsd.
+
+Wed Jun 2 11:53:33 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config.guess: Add support for Motorola Delta 68k, up to r3v7.
+ Patch from pot@fly.cnuce.cnr.it (Francesco Potorti`).
+
+Tue Jun 1 17:48:42 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * config.sub: Add support for rom68k and bug boot monitors.
+
+Mon May 31 09:36:37 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in: Make all-opcodes depend on all-bfd.
+
+Thu May 27 08:05:31 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.guess: Added special check for i[34]86-univel-sysv4*.
+
+Wed May 26 16:33:40 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.guess: For i[34]86-unknown-sysv4 use UNAME_MACHINE for
+ the processor rather than assuming i486.
+
+Wed May 26 09:40:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.guess: Recognize SunOS6 as Solaris3.
+
+Tue May 25 23:03:11 1993 Per Bothner (bothner@cygnus.com)
+
+ * config.guess: Fix typo. Avoid #elif (not in K&R 1).
+ Recognize SunOS 5.* only (and not [6-9].*) as being Solaris2.
+
+Tue May 25 12:44:18 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * build-all.mk (all-cross): New target for Canadian Cross.
+ Added Q2 go32 targets.
+ * test-build.mk: Configure go32 cross sparclite-aout and
+ mips-idt-ecoff -with-gnu-ld. Moved build binary directory from
+ PARTIAL_HOLE_DIRS to BUILD_HOLES_DIRS.
+
+Mon May 24 15:30:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: fix Alpha GDB typo; also, don't build DejaGnu for
+ GO32 hosted toolchains
+
+Mon May 24 14:18:41 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * configure: change so "-exec-prefix" gets passed down rather
+ than "-exec_prefix" so autoconf generated Makefiles get the
+ exec_prefix set right.
+
+Fri May 21 10:42:25 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.guess: get the Solaris2 minor version number
+
+ * Makefile.in: add standards.texi and make-stds.texi to ETC_SUPPORT
+
+Fri May 21 06:20:52 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * config.guess: Recognize some Sequent platforms.
+
+Thu May 20 14:33:48 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: added the vault-install target
+
+ * configure.in: actually use the Sun3 makefile fragment that's in
+ config, also added the release dir to configdirs
+
+Thu May 20 14:19:18 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * Makefile.in (taz): Fix modes on stuff in $(TOOL) dir also.
+
+Tue May 18 20:26:41 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: remove some program from Alpha targetted toolchains
+
+Tue May 18 15:23:19 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * Makefile.in (DISTSTUFFDIRS): Renamed from PROTODIRS. Add ld and
+ gprof.
+ (taz): Run "make diststuff" in those directories instead of "make
+ proto-dir". Look for "VERSION=" only at start of line in subdir
+ Makefile. Use "gzip -9" for compression.
+ (TEXINFO_SUPPORT, DIST_SUPPORT, BINUTILS_SUPPORT_DIRS): New vars.
+ (binutils.tar.z): New target.
+
+Mon May 17 17:01:15 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * Makefile.in (taz): Include gpl.texinfo.
+
+Fri May 14 06:48:38 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * Makefile.in (setup-dirs): Merged into "taz" target.
+ (taz): Only do `proto-dir' stuff if a directory is actually needed
+ for this target.
+
+Wed May 12 13:09:44 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (MUNCH_NM): New variable, defined to be $(NM).
+ (FLAGS_TO_PASS): Pass down MUNCH_NM.
+ (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): New variables.
+ (EXTRA_GCC_FLAGS): Pass down HOST_* variables.
+ (gcc-no-fixedincludes): Correct for current gcc Makefile.
+
+Tue May 11 10:14:25 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (make-gdb.tar.Z): Add configure, config.guess,
+ config.sub, and move-if-change to gdb testsuite distribution
+ archive, so the testsuite can be extracted, configured, and
+ run separately from the gdb distribution. Blow away the Chill
+ tests that require a Chill compiled executable, since GNU Chill
+ is not yet publically available.
+
+Mon May 10 17:22:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * test-build.mk: set environment variables in a single command,
+ instead of a list of assignments and exports
+
+ * config.guess: recognize Alpha/OSF1 systems
+
+Mon May 10 14:55:51 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure: Change help message to prefer --options rather than
+ -options.
+
+Mon May 10 05:58:35 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * config.sub: Convergent Tech. "miniframe" uses m68010, sez
+ zippy@ecst.csuchico.edu.
+ * config.guess: Recognize miniframe.
+
+Sun May 9 17:47:57 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * Makefile.in: Use srcroot to find runtest rather than rootme.
+ Pass RUNTESTFLAGS and EXPECT down in BASE_FLAGS_TO_PASS.
+
+Fri May 7 14:55:59 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * test-build.mk: Extensive additions to support building on a
+ machine other than the host.
+
+Wed May 5 08:35:04 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * configure (tooldir): Fix for i386-aix again.
+
+Mon May 3 19:00:27 1993 Per Bothner (bothner@cygnus.com)
+
+ * configure, Makefile.in: Change definition of $(tooldir)
+ to match the FSF.
+
+Fri Apr 30 15:55:21 1993 Fred Fish (fnf@cygnus.com)
+
+ * config.guess: Recognize i[34]86/SVR4.
+
+Fri Apr 30 15:52:46 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * Makefile.in (all-gdb): gdb depends on sim.
+
+Thu Apr 29 23:30:48 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (gdb.tar.Z): Make prototype gdb testsuite directory
+ at the same time we make the prototype gdb directory.
+ * Makefile.in (make-gdb.tar.Z): Make the testsuite distribution
+ files at the same time as the gdb base release distribution.
+
+Thu Apr 29 12:50:37 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (check): Use individual check targets rather than
+ DO_X rule.
+ (check-gcc): Added.
+
+Thu Apr 29 09:50:07 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config.sub: Use sysv3.2 not sysv32 for canonical OS
+ for System V release 3.2.
+
+Thu Apr 29 10:33:22 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * config.sub: Recognize hppaosf.
+ * configure.in: Do configure ld/binutils/gas for it.
+
+Tue Apr 27 06:25:34 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * configure (tooldir): Alter syntax used to set this, for systems
+ where "\$" isn't handled right, like i386-aix.
+
+Thu Apr 22 08:17:35 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: Pass program-transform-name, not
+ program_transform_name, to recursive configures.
+
+Thu Apr 22 02:58:21 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * Makefile.in (gas+binutils.tar.z): New rule for building snapshots
+ of gas+ld+binutils.
+
+Mon Apr 19 17:41:30 1993 Per Bothner (bothner@cygnus.com)
+
+ * config.guess: Recognize AIX3.2 as distinct from 3.1.
+
+Sat Apr 17 17:19:50 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: rename m88k-motorola-m88kbcs to m88k-motorola-sysv
+
+ * config/mh-delta88: remove extraneous GCC references
+
+Tue Apr 13 16:52:16 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * Makefile.in (PRMS): Set back to all-prms.
+
+Sat Apr 10 12:04:07 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * test-build.mk: Pass -with-gnu-as for known MIPS native and MIPS
+ targets, rather than for MIPS hosts.
+
+Fri Apr 9 13:51:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: add comment for --with-x default values
+
+ * config.guess: handle Motorola Delta88 box for SVR3 and SVR4.
+
+ * Makefile.in: add check-* targets for each of the directories in
+ the tree. Add a definition of RUNTEST that will use the one we
+ just built, if it exists. Pass this down via FLAGS_TO_PASS.
+
+Thu Apr 8 09:21:30 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in: Removed obsolete references to bfd_target and
+ target_makefile_frag.
+
+ * build-all.mk: Set assorted targets for Q2.
+ * config.sub: Recognize z8k-sim and h8300-hms.
+ * test-build.mk: Really don't pass host to configure.
+ (HOLES): Added uname.
+
+Wed Apr 7 15:48:19 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: Handle an empty program-prefix, program-suffix or
+ program-transform-name correctly.
+
+Tue Apr 6 13:48:41 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * build-all.mk: -G 8 no longer required for MIPS targets.
+ * test-build.mk: Don't pass host argument to configure; make it
+ guess.
+
+Tue Apr 6 10:36:53 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (gdb.tar.Z): Fix for building gzip'd distribution.
+ * Makefile.in (COMPRESS): New macro, like GZIP.
+
+Fri Apr 2 09:02:31 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * test-build.mk: Use -with-gnu-as for mips-sgi-irix4 as well.
+
+ * build-all.mk: Set GCC to gcc -O -G 8 for MIPS targets, since gcc
+ with gas currently defaults to -G 0.
+
+Thu Apr 1 08:25:42 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (all-flex): flex depends on byacc.
+
+ * build-all.mk: If host not specified, use config.guess. Pass TAG
+ to test-build.mk as RELEASE_TAG.
+ * test-build.mk (configargs): New variable containing arguments to
+ pass to configure. Set to -with-gnu-as on mips-dec-ultrix.
+ (FLAGS_TO_PASS): Pass down RELEASE_TAG.
+
+ * config.guess: Use /bin/uname when checking -X argument on SCO,
+ to avoid invoking GNU uname which doesn't understand -X.
+
+ * test-build.mk: Don't use /usr/unsupported/bin/as on AIX.
+
+ * configure.in: Build gas for mips-*-*.
+
+Wed Mar 31 21:20:58 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in (all.normal): insert missing backslash.
+
+Wed Mar 31 12:31:56 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * build-all.mk, config/mh-irix4: Bump -XNh value to 1500 to match
+ gcc requirements.
+
+ * Makefile.in: Complete overhaul to merge many almost identical
+ targets.
+
+Tue Mar 30 20:17:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * Makefile.in (setup-dirs-gdb): Renamed from setup-dirs.
+ (gdb.tar.Z): Adjusted.
+
+ * Makefile.in (setup-dirs, taz): New targets; should be general
+ enough to adapt for gdb sometime. Build only .z file.
+ (gas.tar.z): New target.
+
+Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * build-all.mk: Use CC=cc -Xs on Solaris.
+
+Mon Mar 29 19:59:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/mh-sun3: cc needs -J to compile cp-parse.c correctly
+
+ * config/mh-solaris: SunPRO C needs -Xs to be able to get a
+ working xmakefile for Emacs.
+
+Thu Mar 25 15:14:30 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in: Incorporate changes suggested by wilson@cygnus.com
+ for handling BISON for FSF releases.
+
+Thu Mar 25 06:19:48 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * configure: Actually implement the change zoo just documented.
+
+Wed Mar 24 13:02:44 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+
+ * configure: when using config.guess, only set target_alias when
+ it's not already been set (ie, on the command line)
+
+Mon Mar 22 23:07:39 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: add installcheck target, set PRMS to install-prms
+
+Sun Mar 21 16:46:12 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure: add support for package_makefile_fragment, handle the
+ case where a directory has a configure.in file but no Makefile.in
+ more gracefully (with an actual understandable error message, even);
+ add support for --without (and add this to the usage message); also
+ explicitly add a --host=${host_alias} to the command line when
+ config.guess is used
+
+Sun Mar 21 12:11:58 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * configure: Must use both --host and --target in recursive calls.
+
+Thu Mar 18 12:31:35 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: Change deja-gnu to dejagnu.
+
+Mon Mar 15 15:44:35 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (h8300-*-*, h8500-*-*): Don't build libg++.
+
+Fri Mar 12 18:30:14 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: canonicalize all instances to *-*-solaris2*,
+ also strip out a number of tools to not build for go32 host
+
+Wed Mar 10 12:08:27 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * config.guess: add GPL.
+
+ * Makefile.in, config.guess, config.sub, configure: bump
+ copyrights to 93.
+
+Wed Mar 10 07:12:48 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (do-info): Removed obsolete check for existence of
+ localenv file.
+
+ * Makefile.in (MAKEOVERRIDES): Define to be empty.
+
+Wed Mar 10 03:11:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: a couple of 'else true' for decstation,
+ support for TclX
+
+ * configure.in: configure tclX too; don't remove Tk on RS/6000 anymore
+
+Tue Mar 9 16:06:12 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in (setup-dirs): change invocation of make to $(MAKE).
+
+Mon Mar 8 14:52:11 1993 Ken Raeburn (raeburn@cambridge)
+
+ * config.guess: Recognize i386-ibm-aix (PS/2).
+ * configure.in: Use config/mh-aix386 file for it.
+
+Mon Mar 8 11:12:43 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (GCC_FOR_TARGET): Eliminated definition; use
+ CC_FOR_TARGET instead.
+ (BASE_FLAGS_TO_PASS): Pass GCC_FOR_TARGET=$(CC_FOR_TARGET).
+
+Wed Mar 3 16:00:28 1993 Steve Chamberlain (sac@ok.cygnus.com)
+
+ * Makefile.in: Add sim to list of directories sent with gdb
+
+Wed Mar 3 11:42:39 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * configure.in: Put back mips-dec-bsd* case.
+
+Tue Mar 2 21:15:58 1993 Fred Fish (fnf@cygnus.com)
+
+ (Ultrix 2.2 support from Michael Rendell <michael@mercury.cs.mun.ca>)
+ * configure.in (vax-*-ultrix2*): Add Ultrix 2.2 triplet.
+ * config.guess: Change 'VAX*:ULTRIX:*:*' to 'VAX*:ULTRIX*:*:*'.
+ * config/mh-vaxult2: New file.
+
+Tue Mar 2 18:11:03 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: remove no-op mips-dec-bsd* in "case $target"
+
+ * Makefile.in (dir.info): only run gen-info-dir if it exists,
+ (install-info): install dir.info only if it exists,
+ (all-expect, install-expect): pass along X11_FLAGS_TO_PASS
+
+Tue Mar 2 09:01:30 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * configure.in: For vms target, skip bfd, ld, binutils. Do build
+ gas for mips-dec-bsd.
+
+Tue Mar 2 08:35:24 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure (makesrcdir): If ${srcdir} is relative and not ".",
+ and ${subdir} is not ".", set makesrcdir based on ${invsubdir}.
+
+Tue Feb 23 14:18:28 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * configure.in: Added "dejagnu" to hosttools list.
+
+Mon Feb 22 23:28:38 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config.sub, configure.in, config.guess: Add support
+ for Bosx, an AIX variant from Bull.
+ Patches from F.Pierresteguy@frcl.bull.fr.
+
+Sun Feb 21 11:15:22 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * devo/dejagnu: Initial creation of devo/dejagnu.
+ Migrated dejagnu testcases and support files for testing software
+ tools to reside as subdirectories, currently called "testsuite",
+ within the directory of the software tool. Migrated all programs,
+ support libraries, etc. beloging to dejagnu proper from
+ devo/deja-gnu to devo/dejagnu. These files were moved "as is"
+ with no modifications. The changes to these files which will
+ allow them to configure, build, and execute properly will be made
+ in a future update.
+
+Fri Feb 19 20:19:39 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * Makefile.in: Change send_pr to send-pr.
+ * configure.in: Likewise.
+ * send_pr: Renamed directory to send-pr.
+
+Fri Feb 19 19:00:13 1993 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in: Add some extra semi-colons (needed if SHELL=bash).
+
+Fri Feb 19 00:59:33 1993 John Gilmore (gnu@cygnus.com)
+
+ * README: Update for gdb-4.8 release.
+ * Makefile.in (gdb.tar.Z): Add texinfo/tex3patch. Build
+ gdb-xxx.tar.z (gzip'd) file also.
+
+Thu Feb 18 09:16:17 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: make all-diff depend on all-libiberty
+
+Tue Feb 16 16:06:31 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * config.guess: add vax-ultrix in the spirit of mips-ultrix.
+
+Tue Feb 16 05:57:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in, Makefile.in: add hello, tar, gzip, recode, indent
+
+Tue Feb 16 00:58:20 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (DEVO_SUPPORT): Remove etc directory
+ (ETC_SUPPORT): Only add the files GDB wants from etc/.
+ (gdb.tar.Z): Use ETC_SUPPORT. Use byacc when building the file.
+
+Thu Feb 11 20:14:28 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: makeinfo binary is in a new location
+
+Tue Feb 9 12:42:27 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.sub: Accept -ecoff as an OS.
+
+ * Makefile.in: Various changes to eliminate a level of make
+ recursion and reduce the required command line length.
+ (BASE_FLAGS_TO_PASS): New variable holding flags passed to all
+ sub-makes.
+ (EXTRA_HOST_FLAGS, EXTRA_TARGET_FLAGS, EXTRA_GCC_FLAGS): New
+ variables holding settings for specific sub-makes.
+ (FLAGS_TO_PASS, TARGET_FLAGS_TO_PASS, GCC_FLAGS_TO_PASS): Rewrote
+ in terms of BASE_FLAGS_TO_PASS.
+ (TARGET_LIBS): New variable listing directories which use
+ TARGET_FLAGS_TO_PASS.
+ (subdir_do): Eliminated.
+ (do-*): New set of targets to replace subdir_do.
+ (various): All targets which used subdir_do now depend on do-*.
+ (local-clean): Renamed from do_clean.
+ (local-distclean): New target, dependency of distclean and
+ realclean.
+ (install-info): Don't create directories. Depend on dir.info
+ rather than calling make recursively.
+ (install-dir.info): Eliminated.
+ (install-info-dirs): Create all info directories here.
+ (dir.info): Depend upon do-install-info.
+
+ * test-build.mk (HOLES): Added false.
+
+Sat Feb 6 14:05:09 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config.guess: Recognize BSDI and BSDJ (Jolitz 386bsd).
+
+Thu Feb 4 20:49:18 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in (info): remove dependency on all-texinfo. The
+ problem was really in texinfo/C, not at this level.
+
+Thu Feb 4 13:38:41 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (info): Added dependency on all-texinfo (PR 2112).
+
+Thu Feb 4 01:50:53 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (make-gdb.tar.Z): Change BISON to 'bison -y' for
+ GDB releases.
+
+Wed Feb 3 17:22:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure: Include srcdir in message about target of link not
+ being found. Don't convert `-' to `_' in `with' options being
+ passed to subdirs.
+
+Tue Feb 2 18:57:59 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: add uudecode to host_tools
+
+ * Makefile.in: added {all,install}-uudecode targets, added them to
+ the appropriate lists
+
+Tue Feb 2 11:45:53 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (all-gcc): Added dependency on all-gas.
+
+ * configure.in (mips-*-*): Build ld and binutils.
+
+Mon Feb 1 12:35:41 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure: check return code from mkdir, print error message and
+ exit on failure.
+
+Sat Jan 30 16:40:28 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (make-gdb.tar.Z): New location for texinfo.tex.
+
+Thu Jan 28 15:09:59 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * test-build.mk (HOLES): Added tar, cpio and uudecode.
+
+Wed Jan 27 16:50:32 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * config.sub (h8500): Recognize this as a cpu type.
+
+Sat Jan 23 20:32:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure: source directory missing is no longer a warning
+
+ * configure.in: recognize irix[34]* instead of irix[34]
+
+ * Makefile.in: define and pass down X11_LIB
+
+ * config/mh-sco: define X11_LIB to the mess that SCO ODT requires
+
+Sat Jan 23 13:49:40 1993 Per Bothner (bothner@cygnus.com)
+
+ * guess-systype: Renamed to ...
+ * config.guess: ... by popular request.
+ * configure.in, Makefile.in: Update accordingly.
+
+Thu Jan 21 12:20:55 1993 Per Bothner (bothner@cygnus.com)
+
+ * guess-systype: Patches from John Eaton <jwe@che.utexas.edu>:
+ + Add Convex, Cray/Unicos, and Encore/Multimax support.
+ + Execute ./dummy instead of assuming . is in PATH.
+
+Tue Jan 19 17:18:06 1993 Per Bothner (bothner@cygnus.com)
+
+ * guess-systype: New shell script. Attempts to guess the
+ canonical host name of the executing host.
+ Only a few hosts are supported so far.
+ * configure: Call guess-systype if no host is specified.
+
+Tue Jan 19 08:26:07 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (gcc-no-fixedincludes): Made to work with current
+ gcc Makefile.
+
+
+Fri Jan 15 10:27:02 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (GCC_FLAGS_TO_PASS): New variable.
+ (all-gcc, install-gcc, subdir_do): Use it.
+
+Wed Jan 13 17:06:45 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * Makefile.in: Rename uninstalled gcc driver from gcc to xgcc.
+
+Wed Jan 6 20:29:16 1993 Mike Werner (mtw@rtl.cygnus.com)
+
+ * Makefile.in: Removed explicit setting of SUBDIRS. SUBDIRS is now
+ set exclusively by configure, using configure.in .
+
+Wed Jan 6 13:44:11 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * test-build.mk: set $PATH for all builds
+
+ * Makefile.in: pass TARGET_FLAGS_TO_PASS for xiberty and libm
+
+Wed Jan 6 11:02:10 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (GCC_FOR_TARGET): Supply a default that matches
+ the one used in gcc/Makefile.in, so that a null expansion doesn't
+ override the one needed to build gcc with a native cc.
+
+
+Tue Jan 5 07:55:12 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure: Accept -with arguments.
+
+Sun Jan 3 15:15:09 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * Makefile.in: added h8300sim
+
+Tue Dec 29 15:06:00 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/mh-sco: Don't override BISON definition.
+
+ * build-all.mk: If canonhost is i386-unknown-sco3.2v4, change it
+ to i386-sco3.2v4. Set TARGETS and CFLAGS for i386-sco3.2v4.
+ (all-cygnus, native, build-cygnus): Make
+ $(canonhost)-stamp-3stage-done, not $(host)....
+ * test-build.mk (stamp-3stage-compared): Use tail +10c for
+ i386-sco3.2v4. Added else true to if command.
+
+Mon Dec 28 12:08:56 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * config.sub: (from FSF) Sequent uses a BSD-like OS.
+
+Mon Dec 28 08:32:06 1992 Minh Tran-Le (mtranle@paris.intellicorp.com)
+
+ * configure.in (i[34]86-*-isc*): added; uses mh-sysv.
+
+Thu Dec 24 17:26:24 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: don't remove binutils from Solaris builds
+
+Thu Dec 24 14:08:38 1992 david d`zoo' zuhn (zoo@cygnus.com)
+
+ * Makefile.in: get rid of earlier definitions for *clean,
+ also handle the recursive info rule better
+
+Thu Dec 24 12:40:21 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in (mostlyclean, distclean, realclean): Fix to
+ do more-or-less the right thing.
+
+Wed Dec 16 10:25:31 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: Add lines defining CC and CXX, and use CXX rather
+ than gcc in definitions of CXX_FOR_BUILD and CXX_FOR_TARGET.
+
+Tue Dec 15 00:34:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: change all $(host_cpu)-$(host_vendor)-$(host_os) to
+ $(host_canonical).
+
+ * configure.in: split the configdirs list into 4 categories (native
+ v. cross, library v. tool) and handle the cross-only and native-
+ only in more reasonable (and correct!) way.
+
+Mon Dec 14 17:04:22 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in (hppa*-*-*): Don't remove bfd and gdb from
+ configdirs anymore.
+
+Sun Dec 13 00:37:26 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: extensive cleanup:: removed all of the explicit
+ clean-* targets, collapsed many wrappers around subdir_do into
+ one, added additional targets to satisfy standards.texi, deleted
+ some old targets, some changes for consistency
+
+Fri Dec 11 20:18:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: handle some programs as cross-only, and others as
+ native only
+
+ * test-build.mk: handle partial holes in a more generic manner
+
+ * Makefile.in: m4 depends on libiberty
+
+Mon Dec 7 06:43:27 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/mh-sco: don't default $(CC) to gcc
+
+Thu Dec 3 21:52:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: add m4, textutils, fileutils, sed, shellutils,
+ time, wdiff, and find to configdirs
+
+ * Makefile.in: all, clean, and install rules for the new programs
+ added to configure.in
+
+Mon Nov 30 14:54:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: use mh-sun for all *-sun-* hosts
+
+ * config/mh-solaris: rework standard X location to use
+ $OPENWINHOME, if defined.
+
+ * config/mh-sun: handle X11 include locations
+
+ * config/mh-decstation: define NeedFunctionPrototypes to 0, to
+ work around dain-bramaged DECwindows include files
+
+Fri Nov 27 18:35:54 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: define flags for X11 include files and library file
+ locations, pass them down to the programs that need this info
+
+ * build-all.mk: added a 'native' target, to 3stage the native toolchain
+
+ * config/{mh-hpux,mh-solaris}: define the "standard" locations for
+ the vendor supplied X11 headers and libraries
+
+Sun Nov 22 18:59:13 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: start building libg++ for HP-UX targets
+
+Wed Nov 18 19:33:11 1992 John Gilmore (gnu@cygnus.com)
+
+ * README: Update references to files moved into etc/.
+
+Sun Nov 15 09:36:08 1992 Fred Fish (fnf@cygnus.com)
+
+ * config.sub (i386sol2, i486sol2): i[34]86-unknown-solaris2.
+ * configure.in (i[34]86-*-solaris2*): Use config/mh-sysv4.
+
+Thu Nov 12 08:50:42 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: accept dash as well as underscore in long option
+ names for FSF compatibility.
+
+Wed Nov 11 08:04:37 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.sub: added -sco3.2v4 support from FSF.
+
+Sun Nov 8 21:14:30 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: expand the section that adds or removes
+ directories from the list of programs to build, to handle native
+ vs. cross in addition to host v. native
+
+Sat Nov 7 18:52:27 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in: Replace C++ in macro names with CXX.
+ This is less likely to break ...
+
+Sat Nov 7 15:16:58 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * test-build.mk: add -w to GNU_MAKE
+
+Fri Nov 6 23:10:37 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.sub: remove 'sparc'-->'sparc-sun' default transformation,
+ add 'sparc' to list of recognized cpus. This needed to make
+ 'sparc-aout' expand to 'sparc-unknown-aout' instead of 'sparc-sun-aout'.
+ Delete some redundant ose68 variants. Recognize -wrs as an os,
+ then changes that into $CPU-wrs-vxworks.
+
+ * configure.in: remove most references to gdbtest, regularize
+ target based program removal
+
+ * test-build.mk: import from p3 tree (many fixes and changes)
+
+Fri Nov 6 20:59:00 1992 david d `zoo' zuhn (zoo@cygnus.com)
+
+ * Makefile.in: added rules to handle tcl, tk, and expect
+
+ * configure.in: handle those directories if they exist
+
+Thu Nov 5 14:35:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.sub: removed bogus hppabsd and hppahpux names, since
+ "hppa" is not a valid cpu (hppa1.1 or hppa1.0 are, though)
+
+Thu Oct 29 00:12:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: all-gcc now depends on all-binutils. all-libg++
+ depends upon all-xiberty
+
+ * Makefile.in: changes from p3, including:
+
+ Thu Oct 8 15:00:17 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (XTRAFLAGS): include newlib directories if
+ newlib/Makefile exists, rather than if host != target.
+
+ Fri Sep 25 13:41:52 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added -nostdinc to XTRAFLAGS if we are using gcc
+ from the same source tree and not building a cross-compiler. This
+ matters for the libg++ configuration if reconfiguring a tree that
+ has already been installed.
+
+ Thu Sep 10 10:35:51 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added -I for newlib/targ-include to XTRAFLAGS, to
+ pick up the machine and system specific header files.
+
+ * Makefile.in: added AS_FOR_TARGET, passed down in
+ TARGET_FLAGS_TO_PASS. Added CC_FOR_BUILD, which is intended to be
+ the C compiler to use to create programs which are run in the
+ build environment, set it to default to $(CC), and passed it down
+ in FLAGS_TO_PASS and TARGET_FLAGS_TO_PASS.
+
+ Mon Sep 7 22:34:42 1992 Ian Lance Taylor (ian@cirdan.cygnus.com)
+
+ * Makefile.in: add $(host) = $(target) tests back to *_FOR_TARGET.
+ We need them for unusual native builds, like systems without
+ ranlib.
+
+ * configure: also define $(host_canonical) and
+ $(target_canonical), which are the full, canonical names for the
+ given host and target
+
+Sun Nov 1 16:38:17 1992 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in: Added separate definitions for C++.
+
+Fri Oct 30 11:37:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (configdirs): Add deja-gnu.
+
+Fri Oct 23 00:39:18 1992 John Gilmore (gnu@cygnus.com)
+
+ * README: Update for configure.texi and gdb-4.7 release.
+
+Wed Oct 21 21:54:27 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in: Move "all" target to top of file.
+ Previously, first target was ".PHONY" which caused BSD4.4 make
+ to build .PHONY when make was run without arguments.
+
+Mon Oct 19 01:17:54 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in: Add COPYING.LIB to GDB releases, now that there's
+ Library-copylefted code in libiberty.
+
+Tue Oct 13 01:22:32 1992 John Gilmore (gnu@cygnus.com)
+
+ * config.sub: Replace m68kmote with plain old m68k.
+
+Fri Oct 9 03:14:24 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in: Remove space from blank line, avoid Make complaints.
+
+Thu Oct 8 18:41:45 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * config.sub: Complain if no argument is given. Added support for
+ 386bsd as OS and target alias.
+
+Thu Oct 8 15:07:22 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (XTRAFLAGS): include newlib directories if
+ newlib/Makefile exists, rather than if host != target.
+
+Mon Oct 5 03:00:09 1992 Mark Eichin (eichin at tweedledumber.cygnus.com)
+
+ * config.sub: recognize sparclite-wrs-vxworks.
+
+ * Makefile.in (install-xiberty): added *-xiberty make rules (from
+ p3.) Added clean-xiberty to clean.
+
+Thu Oct 1 17:59:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: use *-*-* instead of nested cases for host and target
+
+Tue Sep 29 14:11:18 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added -nostdinc to XTRAFLAGS if we are using gcc
+ from the same source tree and not building a cross-compiler. This
+ matters for the libg++ configuration if reconfiguring a tree that
+ has already been installed.
+
+Sep 20 08:53:10 1992 Fred Fish (fnf@cygnus.com)
+
+ * config.sub (i486v/i486v4): Merge in from FSF version.
+
+Fri Sep 18 00:32:00 1992 Mark Eichin (eichin@cygnus.com)
+
+ * configure: only set PWD if it is already set.
+
+Thu Sep 17 23:05:53 1992 Mark Eichin (eichin@cygnus.com)
+
+ * configure: just set PWD=`pwd` at the top, since Ultrix sh
+ doesn't have unset and all success paths (and most error paths)
+ out set it anyway. (Note: should change all uses of ${PWD=`pwd`}
+ to just ${PWD} to avoid confusion.)
+
+Tue Sep 15 16:00:54 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: always set $(tooldir) to $(libdir)/$(target_alias),
+ even for a native compilation.
+
+Tue Sep 15 02:22:56 1992 John Gilmore (gnu@cygnus.com)
+
+ Changes to make the gdb.tar.Z rule work better.
+
+ * Makefile.in (GDB_SUPPORT_DIRS): Add opcodes.
+ (DEVO_SUPPORT): Add configure.texi.
+ (bfd-ilrt.tar.Z): Remove ancient rule.
+
+Thu Sep 10 10:43:19 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added -I for newlib/targ-include to XTRAFLAGS, to
+ pick up the machine and system specific header files.
+
+ * configure.in, config.sub: added new target m68010-adobe-scout,
+ with alias of adobe68k. Changed configure.in to check for
+ -scout before -sco* to avoid a false match.
+
+ * Makefile.in: added AS_FOR_TARGET, passed down in
+ TARGET_FLAGS_TO_PASS. Added CC_FOR_BUILD, which is intended to be
+ the C compiler to use to create programs which are run in the
+ build environment, set it to default to $(CC), and passed it down
+ in FLAGS_TO_PASS and TARGET_FLAGS_TO_PASS.
+
+Wed Sep 9 12:21:42 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added TARGET_FLAGS_TO_PASS, CC_FOR_TARGET,
+ AR_FOR_TARGET, RANLIB_FOR_TARGET, NM_FOR_TARGET. Pass
+ TARGET_FLAGS_TO_PASS, which defines CC, AR, RANLIB and NM as the
+ FOR_TARGET variants, to newlib and libg++.
+
+Tue Sep 8 17:28:30 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * Makefile.in (all-gas, all-gdb): Require all-opcodes to be built
+ first.
+
+Wed Sep 2 02:50:05 1992 John Gilmore (gnu@cygnus.com)
+
+ * config.sub: Accept `elf' as an environment.
+
+Tue Sep 1 15:48:30 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * Makefile.in (all-opcodes): cd into the right directory
+
+Sun Aug 30 21:12:11 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure: added -program_transform_name option, used as
+ argument to sed when installing programs.
+ configure.texi: added documentation for -program_prefix,
+ -program_suffix and -program_transform_name.
+
+Thu Aug 27 21:59:44 1992 John Gilmore (gnu@cygnus.com)
+
+ * config.sub: Accept i486 where i386 ok.
+
+Thu Aug 27 13:04:42 1992 Brendan Kehoe (brendan@rtl.cygnus.com)
+
+ * config.sub: accept we32k
+
+Mon Aug 24 14:05:14 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * config.sub, configure.in: accept OSE68000 and OSE68k.
+
+ * Makefile.in: don't create all directories for ``make install'';
+ let the subdirectories create the ones they need.
+
+Tue Aug 11 23:13:17 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * COPYING: new file, GPL v2
+
+Tue Aug 4 01:12:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: use the new gen-info-dir, which needs a template
+ argument (which also lives in texinfo)
+
+ * configure.texi, standards.texi: fix INFO-DIR-ENTRY
+
+Mon Aug 3 15:41:28 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/mh-solaris: removed the -xs from CFLAGS (let the people
+ with Sun's C compiler deal with it themselved)
+
+Mon Aug 3 00:34:17 1992 Fred Fish (fnf@cygnus.com)
+
+ * config.sub (ncr3000): Change i386 to i486.
+
+Thu Jul 23 00:12:17 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: add install-rcs, install-grep to
+ install-no-fixedincludes, removed install-bison and install-libgcc
+
+Tue Jul 21 01:01:50 1992 david d `zoo' zuhn (zoo@cygnus.com)
+
+ * configure.in: grab the HPUX makefile fragment if on HPUX
+
+Mon Jul 20 11:02:09 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * Makefile.in: eradicate bison spoor (ditto libgcc).
+ configure.in: recognise m68{k,000}-ericsson-OSE.
+ es1800 is alias for m68k-ericsson-OSE
+
+Sun Jul 19 17:49:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: rearrange the parts that remove programs from
+ configdirs, based now on HOST==TARGET or by canonical triple.
+
+Fri Jul 17 22:52:49 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * test-build.mk: recurse explicitly with -f test-build.mk when
+ appropriate. predicate stage3 and comparison on the existence
+ of gcc. That is, if gcc isn't around, we aren't three-staging.
+ On very clean, also remove ...stamp-co. Build in-place before
+ doing other builds.
+
+Thu Jul 16 18:33:09 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * Makefile.in, configure.in: add tgas
+
+Thu Jul 16 16:05:28 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: a number of changes merged in from progressive.
+
+ * configure.in: add libm.
+
+ * .cvsignore: ignore some stuff that comes from test-build.mk.
+
+Wed Jul 8 00:01:30 1992 Stu Grossman (grossman at cygnus.com)
+
+ * config/mh-solaris: Use -xs when compiling so that Sun-C puts
+ a symbol-table into the executable.
+
+Tue Jul 7 00:24:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * config.sub: Add es1800 (m68k-ericsson-es1800).
+
+Tue Jun 30 20:24:41 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * configure: Add program_suffix (parallel to program_prefix)
+ * Makefile.in: adjust directory-creating script for losing decstation
+
+Mon Jun 22 23:43:48 1992 Per Bothner (bothner@cygnus.com)
+
+ * configure: Minor $subdir-related fixes.
+
+Mon Jun 22 18:30:26 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * configure: fix various problems with propogating
+ makefile_target_frag in subdirs.
+ * configure.in: config libgcc if its there
+
+Fri Jun 19 15:19:40 1992 Stu Grossman (grossman at cygnus.com)
+
+ * config.sub: HPPA merge.
+
+Mon Jun 15 12:31:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/mh-ncr3000 (INSTALL): Don't use /usr/ucb/install,
+ it is broken on ncr 3000's.
+
+Sun Jun 14 10:29:19 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Replace all-bison with all-byacc in all
+ dependency lines for other tools (which now use byacc).
+
+Fri Jun 12 22:21:57 1992 John Gilmore (gnu at cygnus.com)
+
+ * config.sub: Add sun4sol2 => sparc-sun-solaris2.
+
+Tue Jun 9 17:18:11 1992 Fred Fish (fnf at cygnus.com)
+
+ * config/{mh-ncr3000, mh-sysv4}: Add INSTALL.
+
+Thu Jun 4 12:07:32 1992 Mark Eichin (eichin@cygnus.com)
+
+ * Makefile.in: make gprof rules similar to byacc rules (instead of
+ vestigal $(unsubdir) that didn't work...)
+
+Thu Jun 4 00:37:05 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config.sub: Add support for Linux.
+ * Makefile.in: Use $(FLAGS_TO_PASS) more consistently
+ (at least for libg++).
+
+Tue Jun 02 20:03:00 1992 david d `zoo' zuhn (zoo@cygnus.com)
+
+ * configure.texi: fix doc for the -nfp option to configure
+
+Tue Jun 2 17:20:52 1992 Michael Tiemann (tiemann@cygnus.com)
+
+ * Makefile.in (all-binutils): ar needs flex, so depend on all-flex.
+
+Sun May 31 15:04:08 1992 Mark Eichin (eichin at cygnus.com)
+
+ * config.sub: changed [^-]+ to [^-][^-]* so that it works under
+ Sun sed. (BSD 4.3 sed doesn't handle [^-]+ either.)
+ * configure.in: added solaris* host_makefile_frag hook.
+
+Sun May 31 01:10:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.sub: changed recognition of m68000 so that various
+ m68k types can be specified via m680[01234]0
+
+Sat May 30 21:01:06 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config.sub (basic_machine): fix sed so that '-foo' isn't
+ completely substituted out while .+'-foo' loses the '-foo'
+
+Wed May 27 23:18:52 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * config.sub ($os): Add -aout.
+
+Fri May 22 14:00:02 1992 Per Bothner (bothner@cygnus.com)
+
+ * configure: If host_makefile_frag is absolute, don't
+ prefix ${invsubdir} (relevant to libg++ auto-configure).
+
+Thu May 21 18:00:09 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * Makefile.in (tooldir): Define it.
+ (all-ld): Depend on all-flex.
+
+Sun May 10 21:45:59 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in (check): Fix libg++ special case.
+
+Fri May 8 08:31:41 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: do not bury `pwd` into config.status, thus do fewer
+ pwd's.
+
+ * configure: print the "Building in" message only when building in
+ other than "." AND verbose.
+
+ * configure: remove -s, rework -v to better accomodate guested
+ configures.
+
+ * standards.texi: updated to 3 may, fixed librid <-> libdir typo.
+
+Fri May 1 18:00:50 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: macroize flags passed on recursion. remove
+ fileutils.
+
+Thu Apr 30 08:56:20 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: get makesrcdir right for subdirs deeper than 1.
+
+ * Makefile.in: pass INSTALL, INSTALL_DATA, INSTALL_PROGRAM on
+ install.
+
+Fri Apr 24 15:51:51 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: don't print subdir_do or recursion lines.
+
+Fri Apr 24 15:22:04 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * standards.texi: added menu item.
+
+ * Makefile.in: build and install standards.info.
+
+ * standards.texi: new file.
+
+Wed Apr 22 18:06:55 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure: test for and move config.status pieces from
+ ${subdir}/.
+
+Wed Apr 22 14:38:34 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/mh-delta88, config/mh-ncr3000: Replace MINUS_G with
+ CFLAGS per new configuration strategy.
+ * configure: Test for existance of files before trying to mv
+ them, to avoid numerous non-existance messages.
+
+Tue Apr 21 12:31:33 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: correct final line of config.status.
+
+ * configure: patch from eggert. Avoids a protection problem if
+ the original Makefile.in is read only.
+
+ * configure: use move-if-change from gcc to create config.status.
+ Some makefiles depend on config.status to tell if a directory
+ has been reconfigured for a different host. This change
+ prevents those directories from remaking everything in the case
+ where the reconfig was only intended to rebuild a Makefile.
+
+ * configure: test for config.sub with "config.sub sun4" rather
+ than "config.sub ${host_alias}". Otherwise we can't tell a bad
+ host alias from a missing config.sub.
+
+Mon Apr 20 18:16:36 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: explicitly pass CFLAGS on recursion. no longer pass
+ MINUS_G (this can be done with CFLAGS). Default CFLAGS to -g.
+
+Fri Apr 17 18:27:51 1992 Per Bothner (bothner@cygnus.com)
+
+ * configure: mkdir ${subdir} as needed.
+
+Wed Apr 15 17:37:22 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in,configure.in: added autoconf.
+
+Wed Apr 15 17:27:34 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: no longer pass against on recursion.
+
+ * Makefile.in: added .NOEXPORT: so that stray makefile_frag
+ definitions are not inherited.
+
+ * configure: correct makesrcdir when subdir is .
+
+Tue Apr 14 11:56:09 1992 Per Bothner (bothner@cygnus.com)
+
+ * configure: Add support for 'subdirs' variable, which is
+ like 'configdirs', except that configure doesn't re-invoke
+ itself for subdirs, it just creates a Makefile for each subdir.
+ * configure.texi: Document subdirs.
+
+Mon Apr 13 18:50:16 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: added flex to configdirs
+
+Mon Apr 13 18:43:55 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: remove clean-stamps from clean.
+
+Sat Apr 11 03:52:03 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Add gdbtest to configdirs.
+
+Fri Apr 10 23:11:49 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (MINUS_G): Add macro, default to -g, pass on
+ to recursive makes.
+ * configure.in: Recognize new ncr3000 config.
+
+Wed Apr 8 23:08:12 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed references to gdbm.
+
+Tue Apr 7 16:48:20 1992 Per Bothner (bothner@cygnus.com)
+
+ * config.sub: Don't canonicalize os value
+ newsos* to bsd (readline needs to check for newsos).
+ (This fix was earlier made Jan 31, but got re-broken.)
+
+Mon Apr 6 14:34:08 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: sco is an os, not a vendor!
+
+ * configure: Quote $( better. Keep various shells happy.
+
+Tue Mar 31 16:32:57 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: eliminate stamp-files.
+
+Mon Mar 30 22:20:23 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: add send_pr. remove "force" from .stmp-gprof rule.
+ Supress echoing of all the "if [ -d ... $(MAKE)" lines.
+
+Wed Mar 25 15:20:04 1992 Stu Grossman (grossman@cygnus.com)
+
+ * config.sub: fix iris/iris3.
+
+Wed Mar 25 10:34:19 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: re-add -rm.
+
+Tue Mar 24 23:50:16 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Maskefile.in: add .stmp-rcs to all.
+
+ * configure.in: remove gas from rs6000 build, use aix host fragment.
+
+Mon Mar 23 19:43:35 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: pass down site_option during recursion.
+
+Thu Mar 19 16:49:36 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (all.cross): Add .stmp-bfd .stmp-readline.
+
+Wed Mar 18 15:29:33 1992 Mike Stump (mrs@cygnus.com)
+
+ * configure: Change exec_prefix so that it really defaults to prefix.
+
+Sat Mar 14 17:20:38 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in, configure.in: Add support for mmalloc library.
+
+Fri Mar 13 18:44:18 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: add stmp dependencies for a few more things.
+
+Thu Mar 12 04:56:24 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure: adjusted error message on objdir/srcdir configure
+ collision, per john's suggestion.
+
+ * Makefile.in: add libiberty stmp to all and all.cross.
+
+Wed Mar 11 02:07:52 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: remove force dependencies, add grep to all.
+
+Tue Mar 10 21:49:18 1992 K. Richard Pixley (rich@mars.cygnus.com)
+
+ * Makefile.in: drop flex. make stamp files work.
+
+ * configure: added test for conflicting configuration in srcdir,
+ remove trailing slashes from srcdir. Otherwise emacs gdb mode
+ gets cranky. use relative paths for configure and srcdir
+ whenever possible. Send some error messages to stderr that were
+ going to stdout.
+
+Tue Mar 10 18:01:55 1992 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in: Fix libg++ rule to check for gcc directory
+ before using gcc/gcc. Also pass XTRAFLAGS.
+
+Thu Mar 5 21:45:07 1992 K. Richard Pixley (rich@sendai)
+
+ * Makefile.in: added stmp-files so that directories aren't polled
+ when they are already built.
+
+ * configure.texi: fixed a node pointer problem.
+
+Thu Mar 5 12:05:58 1992 Stu Grossman (grossman at cygnus.com)
+
+ * config.sub configure.in config/mh-irix4 gdb/configure.in
+ gdb/mips-tdep.c gdb/mipsread.c gdb/procfs.c gdb/signame.h
+ gdb/tm-irix3.h gdb/tm-mips.h gdb/xm-irix4.h gdb/config/mt-irix3
+ gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x.
+
+Wed Mar 4 02:57:46 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure: -recurring becomes -silent. corrected help message
+ for -site= option.
+
+ * Makefile.in: mkdir $(exec_prefix) and $(tooldir).
+
+Tue Mar 3 14:51:21 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * configure: when building Makefile for crosses, replace
+ tooldir and program_prefix. default srcdir from location of
+ config.sub. remove "for host in hosts" and "for target in
+ targets" loops.
+
+Wed Feb 26 19:48:25 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: Do not pass bindir or mandir to cvs.
+
+Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed traces of namesubdir,
+ -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
+ copyrights to '92, changed some from Cygnus to FSF.
+
+ * configure.texi: remove most references to multiple hosts,
+ multiple targets, subdirs, etc.
+
+ * configure.man: removed rcsid. reference config.sub not
+ config.subr.
+
+ * Makefile.in: mkdir $(infodir) on install-info.
+
+Wed Feb 19 15:41:13 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.texi: Explain better about .gdbinit and about
+ the environment that configure.in sections run in.
+
+Fri Feb 7 07:55:00 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Ultrix is only a decstation if it's a MIPS.
+
+Fri Jan 31 21:54:51 1992 John Gilmore (gnu at cygnus.com)
+
+ * README: DOC.configure => cfg-paper.texi.
+
+Fri Jan 31 21:48:18 1992 Stu Grossman (grossman at cygnus.com)
+
+ * config.sub (near case $os): Don't convert newsos* to bsd!
+
+Fri Jan 31 02:27:32 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Reinstall change from gdb-4.3 that reduces
+ the number of copies of COPYING that go into the GDB tar file.
+
+Thu Jan 30 16:17:30 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bfd/configure.in, config/mh-sco, gdb/config/mh-i386sco,
+ gdb/config/mt-i386v32, gdb/configure.in, readline/configure.in:
+ Fix SCO configuration stuff.
+
+Tue Jan 28 23:51:07 1992 Per Bothner (bothner at cygnus.com)
+
+ * Makefile.in: For libg++, make sure the -I pointing
+ to the gcc directory goes *after* all the libg++-local -I flags.
+ Also, move just-gcc dependency from just-libg++ to all-libg++.
+
+Tue Jan 28 12:56:24 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure: Change -x to -f to keep Ultrix /bin/test happy.
+
+Sat Jan 18 17:45:11 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (make-gdb.tar.Z): Remove texinfo targets.
+
+Sat Jan 18 17:03:21 1992 Fred Fish (fnf at cygnus.com)
+
+ * config.sub: Add stratus configuration frags. Also
+ submitted to FSF.
+
+Sat Jan 18 15:35:29 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (DEV_SUPPORT): add configure.man.
+
+ * config.sub(Decode manufacturer-specific): add -none*.
+
+Fri Jan 17 17:58:05 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: remove form feeds to make Sun's make happy.
+ (DEVO_SUPPORT): DOC.configure => cfg-paper.texi.
+
+Sat Jan 4 16:11:44 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in (AR_FLAGS): Make quieter.
+
+Thu Jan 2 22:57:12 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Add libg++.
+ * configure: When verbose, don't output the command line at each
+ level; it will be unremarkably the same as the previous version,
+ which will be the same as what the user typed.
+
+Fri Dec 27 16:26:47 1991 K. Richard Pixley (rich at cygnus.com)
+
+ * configure.in, Makefile.in: fix clean-info, add flex. add
+ fileutils.
+
+ * configure: be less sensitive to spaces in Makefile.in. Do not
+ look for sources in "..". Doing so breaks subdirectories that
+ might have their own configure. If a subdir has it's own
+ configure script, use it.
+
+Thu Dec 26 16:30:26 1991 K. Richard Pixley (rich at cygnus.com)
+
+ * cfg-paper.texi: some changes suggested by rms.
+
+Thu Dec 26 10:13:36 1991 Fred Fish (fnf at cygnus.com)
+
+ * config.sub: Merge in some small additions from the FSF version,
+ taken from the gcc distribution, to bring the Cygnus and FSF
+ versions into closer sync.
+
+Fri Dec 20 11:34:18 1991 Fred Fish (fnf at cygnus.com)
+
+ * configure.in: Changed svr4 references to sysv4.
+
+Thu Dec 19 15:54:29 1991 K. Richard Pixley (rich at cygnus.com)
+
+ * configure: added -V for version number option.
+
+Wed Dec 18 15:39:34 1991 K. Richard Pixley (rich at cygnus.com)
+
+ * DOC.configure, cfg-paper.texi: revised, updated, and texinfo'd.
+ renamed from DOC.configure to cfg-paper.texi.
+
+Mon Dec 16 23:05:19 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure, config.subr, config.sub: config.subr is now
+ config.sub again.
+
+Fri Dec 13 01:17:06 1991 K. Richard Pixley (rich at cygnus.com)
+
+ * configure.texi: new file, in progress.
+
+ * Makefile.in: build info file and install the man page for
+ configure.
+
+ * configure.man: new file, first cut.
+
+ * configure: find config.subr again now that configuration "none"
+ has gone. removed all traces of the -ansi option. removed all
+ traces of the -languages option.
+
+ * config.subr: resync from rms.
+
+1991-12-11 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure, config.sub, config.subr: merge config.sub into
+ config.subr, call the result config.subr, remove config.sub, use
+ config.subr.
+
+ * Makefile.in: revised install for dir.info.
+
+1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure.in: add decstation host makefile frag.
+
+ * Makefile.in: BISON now bison -y again. also install-gcc on
+ install. clean-gdbm on clean. infodir belongs in datadir.
+ Make directories for info install. Build dir.info here then
+ install it.
+
+1991-12-09 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: fix for bad directory tests.
+
+1991-12-07 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure: \{1,2\} appears to be a sysv'ism. Use a different
+ regexp. -srcdir relative was being handled incorrectly.
+
+ * Makefile.in: unwrapped some for loops so that parallel makes
+ work again and so one can focus one's attention on a particular
+ package.
+
+1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure: added PWD as a stand in for `pwd` (for speed). use
+ elif wherever possible. make -srcdir work without -objdir.
+ -objdir= commented out.
+
+1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * configure: +options become --options. -subdirs commented out.
+ added -host, -datadir. Renamed -destdir to -prefix. Comment in
+ Makefile now at top of generated Makefile. Removed cvs log
+ entries. added -srcdir. create .gdbinit only if there is one
+ in ${srcdir}.
+
+ * Makefile.in: idestdir and ddestdir go away. Added copyrights
+ and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
+ and mandir now keyed off datadir by default.
+
+1991-11-22 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Freshly created ChangeLog.
+
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 76
+version-control: never
+End:
diff --git a/contrib/gdb/MAINTAINERS b/contrib/gdb/MAINTAINERS
new file mode 100644
index 0000000..75f3240
--- /dev/null
+++ b/contrib/gdb/MAINTAINERS
@@ -0,0 +1,114 @@
+Please feel free to add, edit, delete this file.
+Please do not make ChangeLog entries.
+
+COPYING, COPYING.LIB, README
+ http://gnu.org.
+
+Makefile.in; configure; configure.in
+ Please notify the following of any committed patches.
+ binutils@sources.redhat.com
+ gdb-patches@sources.redhat.com
+
+bfd/; binutils/; gas/; gprof/; ld/; opcodes/; BFD's part of include/
+ binutils: http://sources.redhat.com/binutils/
+ Patches to binutils@sources.redhat.com.
+ Please notify the following of any interface changes:
+ gdb-patches@sources.redhat.com
+
+cgen/; cgen parts of opcodes/, sim/ & include/
+ cgen: http://sources.redhat.com/cgen/
+ Patches to cgen@sources.redhat.com
+ May need separate opcodes/ or sim/ approval for
+ commits of regenerated files there.
+
+config.guess; config.sub; dejagnu/config.guess;
+readline/support/config.sub; readline/support/config.guess
+ config: http://savannah.gnu.org/projects/config
+ Patches to config-patches@gnu.org.
+ Changes need to be done in tandem with the official CONFIG
+ sources or submitted to the master file maintainer and brought
+ in via a merge.
+ Please notify the following of any committed patches:
+ binutils@sources.redhat.com
+ gdb-patches@sources.redhat.com
+
+dejagnu/
+ Notify http://dejagnu.sourceforge.net/ of generic changes.
+ Generic patches to gdb-patches@sources.redhat.com;
+ Other dependents of dejagnu include sid@, binutils@, gcc@, etc.
+
+gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/
+ gdb: http://sources.redhat.com/gdb/
+ Patches to gdb-patches@sources.redhat.com.
+ See also gdb/MAINTAINERS, sim/MAINTAINERS, mmalloc/MAINTAINERS.
+
+include/
+ See binutils/, gdb/, sid/, gcc/, libiberty/ etc.
+
+libiberty/; libiberty's part of include/
+ gcc: http://gcc.gnu.org
+ Changes need to be done in tandem with the official GCC
+ sources or submitted to the master file maintainer and brought
+ in via a merge. Note: approved patches in gcc's libiberty
+ are automatically approved in this libiberty also; feel free
+ to merge them yourself if needed sooner than the next merge.
+ Otherwise, changes are automatically merged, usually within
+ a day.
+
+ltconfig; ltmain.sh
+ libtool: http://gnu.org
+ Changes need to be done in tandem with the official LIBTOOL
+ sources or submitted to the master file maintainer and brought
+ in via a merge.
+
+mkinstalldirs; move-if-change
+ autoconf: http://gnu.org
+ Patches to autoconf-patches@gnu.org.
+ Changes need to be done in tandem with the official AUTOCONF
+ sources or submitted to the master file maintainer and brought
+ in via a merge.
+
+symlink-tree
+ gcc: http://gcc.gnu.org
+ See libiberty.
+
+newlib/; libgloss/
+ http://sources.redhat.com/newlib/
+ Patches to newlib@sources.redhat.com.
+
+sid/; SID's part of cgen/ & dejagnu/
+ sid: http://sources.redhat.com/sid/
+ Patches to sid@sources.redhat.com
+
+texinfo/texinfo.tex
+ texinfo: http://ftp.gnu.org.
+ Latest version can be found on ftp://ftp.gnu.org and can be
+ imported at any (reasonable) time.
+ Please not use GCC's texinfo. Please do not import texinfo.
+
+tcl/; tix/; itcl/; tk/; libgui/
+ insight: http://sources.redhat.com/insight/
+ Contact insight@sources.redhat.com.
+
+winsup/
+ cygwin: http://sources.redhat.com/cygwin
+ Patches to cygwin-patches@sources.redhat.com.
+ General discussion cygwin@sources.redhat.com.
+ See also winsup/MAINTAINERS.
+
+expect/; config-ml.in; mpw-README; mpw-build.in; mpw-config.in;
+mpw-configure; mpw-install; setup.com; missing; makefile.vms; utils/;
+config/; config.if; makefile.vms; missing; ylwrap; mkdep; etc/;
+install-sh; intl/
+ Ask DJ Delorie <dj@redhat.com> after reading the libiberty entry.
+
+modules file
+ Obviously changes to this file should not go through
+ overseers@sources.redhat.com. If you understand the file
+ format (or can cut-and-paste existing entries), modify it. If
+ it scares you, get someone who does understand it to help you.
+ Be prepared to fix it if you do break it.
+
+/* Local variables: */
+/* change-log-default-name: "/dev/null" */
+/* End: */
diff --git a/contrib/gdb/Makefile.in b/contrib/gdb/Makefile.in
index 6465ee1..32e97d5 100644
--- a/contrib/gdb/Makefile.in
+++ b/contrib/gdb/Makefile.in
@@ -1,7 +1,7 @@
#
# Makefile for directory with subdirs to build.
-# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
-# Free Software Foundation
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,8 +35,10 @@ includedir=${prefix}/include
oldincludedir=/usr/include
infodir=${prefix}/info
mandir=${prefix}/man
+gxx_include_dir=${includedir}/g++
-tooldir = $(exec_prefix)/$(target)
+tooldir = $(exec_prefix)/$(target_alias)
+build_tooldir = $(exec_prefix)/$(target_alias)
program_transform_name =
@@ -83,6 +85,7 @@ HOST_PREFIX_1 = loser-
CFLAGS = -g
CXXFLAGS = -g -O2
+LDFLAGS =
LIBCFLAGS = $(CFLAGS)
CFLAGS_FOR_TARGET = $(CFLAGS)
LDFLAGS_FOR_TARGET =
@@ -108,8 +111,8 @@ NM = nm
LD = ld
-# Not plain GZIP, since gzip looks there for extra command-line options.
-GZIPPROG = gzip
+BZIPPROG = bzip2
+MD5PROG = md5sum
# These values are substituted by configure.
DEFAULT_YACC = yacc
@@ -138,9 +141,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \
then echo $$r/m4/m4 ; \
else echo ${DEFAULT_M4} ; fi`
-MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
+# For an installed makeinfo, we require it to be from texinfo 4 or
+# higher, else we use the "missing" dummy.
+MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
then echo $$r/texinfo/makeinfo/makeinfo ; \
- else echo makeinfo ; fi`
+ else if (makeinfo --version \
+ | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
+ then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
# This just becomes part of the MAKEINFO definition passed down to
# sub-makes. It lets flags be given on the command line while still
@@ -166,16 +173,22 @@ OTHERS =
# This is set by the configure script to the list of directories which
# should be built using the target tools.
-
-
-TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon
+TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon libf2c libchill libobjc
# Target libraries are put under this directory:
# Changed by configure to $(target_alias) if cross.
TARGET_SUBDIR = .
-# This is set by the configure script to the arguments passed to configure.
-CONFIG_ARGUMENTS =
+BUILD_CONFIGDIRS = libiberty
+BUILD_SUBDIR = .
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the target.
+TARGET_CONFIGARGS =
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the build system.
+BUILD_CONFIGARGS =
# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
# was used.
@@ -185,10 +198,19 @@ SET_LIB_PATH =
# the libraries. This may be changed by configure.in.
RPATH_ENVVAR = LD_LIBRARY_PATH
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that programs built for the host machine work.
+HOST_LIB_PATH = $$r/bfd:$$r/opcodes
+
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that prorgams built for the target machine work.
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libstdc++
+
# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
+# Some platforms don't like blank entries, so we remove duplicate,
+# leading and trailing colons.
REALLY_SET_LIB_PATH = \
- $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
- export $(RPATH_ENVVAR);
+ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
ALL = all.normal
INSTALL_TARGET = installdirs \
@@ -205,72 +227,26 @@ INSTALL_TARGET_CROSS = installdirs \
$(INSTALL_X11_MODULES) \
$(INSTALL_DOSREL)
-CC_FOR_TARGET = ` \
- if [ -f $$r/gcc/xgcc ] ; then \
- if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
- case "$(target_canonical)" in \
- i[3456]86-*-cygwin*) \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \
- ;; \
- *) \
- echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
- ;; \
- esac \
- else \
- echo $$r/gcc/xgcc -B$$r/gcc/; \
- fi; \
- else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
- echo $(CC); \
- else \
- t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
- fi; \
- fi`
+# Should be substed by configure.in
+FLAGS_FOR_TARGET =
+CC_FOR_TARGET =
+CHILL_FOR_TARGET =
+CXX_FOR_TARGET =
+CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
-# If CC_FOR_TARGET is not overriden on the command line, then this
+# If GCC_FOR_TARGET is not overriden on the command line, then this
# variable is passed down to the gcc Makefile, where it is used to
# build libgcc2.a. We define it here so that it can itself be
# overridden on the command line.
-GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
-
-CHILL_FOR_TARGET = ` \
- if [ -f $$r/gcc/xgcc ] ; then \
- echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
- else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
- echo $(CC); \
- else \
- t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
- fi; \
- fi`
-
-CXX_FOR_TARGET = ` \
- if [ -f $$r/gcc/xgcc ] ; then \
- if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
- case "$(target_canonical)" in \
- i[3456]86-*-cygwin*) \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \
- ;; \
- *) \
- echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
- ;; \
- esac \
- else \
- echo $$r/gcc/xgcc -B$$r/gcc/; \
- fi; \
- else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
- echo $(CXX); \
- else \
- t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
- fi; \
- fi`
+GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
AS_FOR_TARGET = ` \
if [ -f $$r/gas/as-new ] ; then \
echo $$r/gas/as-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=as ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(AS); \
else \
t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
@@ -280,8 +256,10 @@ AS_FOR_TARGET = ` \
LD_FOR_TARGET = ` \
if [ -f $$r/ld/ld-new ] ; then \
echo $$r/ld/ld-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=ld ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(LD); \
else \
t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
@@ -292,7 +270,7 @@ DLLTOOL_FOR_TARGET = ` \
if [ -f $$r/binutils/dlltool ] ; then \
echo $$r/binutils/dlltool ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(DLLTOOL); \
else \
t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
@@ -303,7 +281,7 @@ WINDRES_FOR_TARGET = ` \
if [ -f $$r/binutils/windres ] ; then \
echo $$r/binutils/windres ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(WINDRES); \
else \
t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
@@ -314,7 +292,7 @@ AR_FOR_TARGET = ` \
if [ -f $$r/binutils/ar ] ; then \
echo $$r/binutils/ar ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(AR); \
else \
t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
@@ -325,8 +303,12 @@ RANLIB_FOR_TARGET = ` \
if [ -f $$r/binutils/ranlib ] ; then \
echo $$r/binutils/ranlib ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
- echo $(RANLIB); \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
+ if [ x'$(RANLIB)' != x ]; then \
+ echo $(RANLIB); \
+ else \
+ echo ranlib; \
+ fi; \
else \
t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
fi; \
@@ -335,8 +317,10 @@ RANLIB_FOR_TARGET = ` \
NM_FOR_TARGET = ` \
if [ -f $$r/binutils/nm-new ] ; then \
echo $$r/binutils/nm-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=nm ; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
echo $(NM); \
else \
t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
@@ -417,12 +401,21 @@ BASE_FLAGS_TO_PASS = \
"sharedstatedir=$(sharedstatedir)" \
"sysconfdir=$(sysconfdir)" \
"tooldir=$(tooldir)" \
+ "build_tooldir=$(build_tooldir)" \
"gxx_include_dir=$(gxx_include_dir)" \
"gcc_version=$(gcc_version)" \
"gcc_version_trigger=$(gcc_version_trigger)" \
"target_alias=$(target_alias)" \
"libsubdir=$(libsubdir)"
+# For any flags above that may contain shell code that varies from one
+# target library to another. When doing recursive invocations of the
+# top-level Makefile, we don't want the outer make to evaluate them,
+# so we pass these variables down unchanged. They must not contain
+# single nor double quotes.
+RECURSE_FLAGS = \
+ CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+
# Flags to pass down to most sub-makes, in which we're building with
# the host environment.
# If any variables are added here, they must be added to do-*, below.
@@ -504,6 +497,18 @@ EXTRA_GCC_FLAGS = \
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
# This is a list of the targets for all of the modules which are compiled
+# using the build machine's native compiler. Configure edits the second
+# macro for build!=host builds.
+ALL_BUILD_MODULES_LIST = \
+ all-build-libiberty
+ALL_BUILD_MODULES =
+
+# This is a list of the configure targets for all of the modules which
+# are compiled using the native tools.
+CONFIGURE_BUILD_MODULES = \
+ configure-build-libiberty
+
+# This is a list of the targets for all of the modules which are compiled
# using $(FLAGS_TO_PASS).
ALL_MODULES = \
all-apache \
@@ -516,6 +521,7 @@ ALL_MODULES = \
all-bison \
all-byacc \
all-bzip2 \
+ all-cgen \
all-cvssrc \
all-db \
all-dejagnu \
@@ -558,7 +564,9 @@ ALL_MODULES = \
all-sed \
all-send-pr \
all-shellutils \
+ all-sid \
all-sim \
+ all-snavigator \
all-tar \
all-tcl \
all-tcl8.1 \
@@ -569,6 +577,7 @@ ALL_MODULES = \
all-uudecode \
all-wdiff \
all-zip \
+ all-zlib \
$(EXTRA_TARGET_HOST_ALL_MODULES)
# This is a list of the check targets for all of the modules which are
@@ -592,6 +601,7 @@ CROSS_CHECK_MODULES = \
check-bfd \
check-binutils \
check-bzip2 \
+ check-cgen \
check-cvssrc \
check-db \
check-dejagnu \
@@ -630,6 +640,8 @@ CROSS_CHECK_MODULES = \
check-sed \
check-send-pr \
check-shellutils \
+ check-snavigator \
+ check-sid \
check-sim \
check-tar \
check-tcl \
@@ -662,6 +674,7 @@ INSTALL_MODULES = \
install-binutils \
install-bison \
install-byacc \
+ install-cgen \
install-cvssrc \
install-db \
install-dejagnu \
@@ -704,7 +717,9 @@ INSTALL_MODULES = \
install-sed \
install-send-pr \
install-shellutils \
+ install-sid \
install-sim \
+ install-snavigator \
install-tar \
install-textutils \
install-tgas \
@@ -759,9 +774,13 @@ INSTALL_X11_MODULES = \
ALL_TARGET_MODULES = \
all-target-libio \
all-target-libstdc++ \
+ all-target-libstdc++-v3 \
all-target-librx \
all-target-libg++ \
all-target-newlib \
+ all-target-libf2c \
+ all-target-libchill \
+ all-target-libobjc \
all-target-libtermcap \
all-target-winsup \
all-target-libgloss \
@@ -769,6 +788,11 @@ ALL_TARGET_MODULES = \
all-target-gperf \
all-target-examples \
all-target-libstub \
+ all-target-libffi \
+ all-target-libjava \
+ all-target-zlib \
+ all-target-boehm-gc \
+ all-target-qthreads \
all-target-bsp \
all-target-cygmon
@@ -777,9 +801,13 @@ ALL_TARGET_MODULES = \
CONFIGURE_TARGET_MODULES = \
configure-target-libio \
configure-target-libstdc++ \
+ configure-target-libstdc++-v3 \
configure-target-librx \
configure-target-libg++ \
configure-target-newlib \
+ configure-target-libf2c \
+ configure-target-libchill \
+ configure-target-libobjc \
configure-target-libtermcap \
configure-target-winsup \
configure-target-libgloss \
@@ -787,6 +815,11 @@ CONFIGURE_TARGET_MODULES = \
configure-target-gperf \
configure-target-examples \
configure-target-libstub \
+ configure-target-libffi \
+ configure-target-libjava \
+ configure-target-zlib \
+ configure-target-boehm-gc \
+ configure-target-qthreads \
configure-target-bsp \
configure-target-cygmon
@@ -795,10 +828,19 @@ CONFIGURE_TARGET_MODULES = \
CHECK_TARGET_MODULES = \
check-target-libio \
check-target-libstdc++ \
+ check-target-libstdc++-v3 \
check-target-libg++ \
check-target-newlib \
+ check-target-libf2c \
+ check-target-libchill \
+ check-target-libobjc \
check-target-winsup \
check-target-libiberty \
+ check-target-libffi \
+ check-target-libjava \
+ check-target-zlib \
+ check-target-boehm-gc \
+ check-target-qthreads \
check-target-gperf
# This is a list of the install targets for all of the modules which are
@@ -806,13 +848,21 @@ CHECK_TARGET_MODULES = \
INSTALL_TARGET_MODULES = \
install-target-libio \
install-target-libstdc++ \
+ install-target-libstdc++-v3 \
install-target-libg++ \
install-target-newlib \
+ install-target-libf2c \
+ install-target-libchill \
+ install-target-libobjc \
install-target-libtermcap \
install-target-winsup \
install-target-libgloss \
install-target-libiberty \
install-target-bsp \
+ install-target-libjava \
+ install-target-zlib \
+ install-target-boehm-gc \
+ install-target-qthreads \
install-target-gperf
# This is a list of the targets for which we can do a clean-{target}.
@@ -827,6 +877,7 @@ CLEAN_MODULES = \
clean-bison \
clean-byacc \
clean-bzip2 \
+ clean-cgen \
clean-cvssrc \
clean-db \
clean-dejagnu \
@@ -869,7 +920,9 @@ CLEAN_MODULES = \
clean-sed \
clean-send-pr \
clean-shellutils \
+ clean-sid \
clean-sim \
+ clean-snavigator \
clean-tar \
clean-tcl \
clean-texinfo \
@@ -878,21 +931,31 @@ CLEAN_MODULES = \
clean-time \
clean-uudecode \
clean-wdiff \
- clean-zip
+ clean-zip \
+ clean-zlib
# All of the target modules that can be cleaned
CLEAN_TARGET_MODULES = \
clean-target-libio \
clean-target-libstdc++ \
+ clean-target-libstdc++-v3 \
clean-target-librx \
clean-target-libg++ \
clean-target-newlib \
+ clean-target-libf2c \
+ clean-target-libchill \
+ clean-target-libobjc \
clean-target-winsup \
clean-target-libgloss \
clean-target-libiberty \
clean-target-gperf \
clean-target-examples \
clean-target-libstub \
+ clean-target-libffi \
+ clean-target-libjava \
+ clean-target-zlib \
+ clean-target-boehm-gc \
+ clean-target-qthreads \
clean-target-bsp \
clean-target-cygmon
@@ -911,6 +974,7 @@ CLEAN_X11_MODULES = \
# The target built for a native build.
.PHONY: all.normal
all.normal: \
+ $(ALL_BUILD_MODULES) \
$(ALL_MODULES) \
$(ALL_X11_MODULES) \
$(ALL_TARGET_MODULES) \
@@ -944,16 +1008,15 @@ $(DO_X):
case $$i in \
gcc) \
for flag in $(EXTRA_GCC_FLAGS); do \
- eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
;; \
*) \
for flag in $(EXTRA_HOST_FLAGS); do \
- eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
;; \
esac ; \
- export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
if (cd ./$$i; \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
@@ -970,9 +1033,8 @@ $(DO_X):
for i in $(TARGET_CONFIGDIRS) -dummy-; do \
if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
for flag in $(EXTRA_TARGET_FLAGS); do \
- eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
+ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
- export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
if (cd $(TARGET_SUBDIR)/$$i; \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
@@ -1047,7 +1109,12 @@ $(CLEAN_TARGET_MODULES):
true; \
fi
-clean-target: $(CLEAN_TARGET_MODULES)
+clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
+clean-target-libgcc:
+ test ! -d gcc/libgcc || \
+ (cd gcc/libgcc && find . -type d -print) | \
+ while read d; do rm -f gcc/$$d/libgcc.a || : ; done
+ -rm -rf gcc/libgcc
# Check target.
@@ -1149,6 +1216,105 @@ gcc-no-fixedincludes:
mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi
+# This rule is used to build the modules which are built with the
+# build machine's native compiler.
+.PHONY: $(ALL_BUILD_MODULES)
+$(ALL_BUILD_MODULES):
+ dir=`echo $@ | sed -e 's/all-build-//'`; \
+ if [ -f ./$${dir}/Makefile ] ; then \
+ r=`pwd`; export r; \
+ s=`cd $(srcdir); pwd`; export s; \
+ (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
+ else \
+ true; \
+ fi
+
+# This rule is used to configure the modules which are built with the
+# native tools.
+.PHONY: $(CONFIGURE_BUILD_MODULES)
+$(CONFIGURE_BUILD_MODULES):
+ @dir=`echo $@ | sed -e 's/configure-build-//'`; \
+ if [ ! -d $(BUILD_SUBDIR) ]; then \
+ true; \
+ elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
+ true; \
+ elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
+ if [ -d $(srcdir)/$${dir} ]; then \
+ [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
+ r=`pwd`; export r; \
+ s=`cd $(srcdir); pwd`; export s; \
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+ LD="$(LD_FOR_BUILD)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+ NM="$(NM_FOR_BUILD)"; export NM; \
+ RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+ echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
+ cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(BUILD_SUBDIR)" in \
+ .) topdir="../$(srcdir)" ;; \
+ *) topdir="../../$(srcdir)" ;; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ else \
+ exit 1; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/$${dir}"; \
+ libsrcdir="$$s/$${dir}"; \
+ fi; \
+ if [ -f $${libsrcdir}/configure ] ; then \
+ rm -f no-such-file skip-this-dir; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(BUILD_CONFIGARGS) $${srcdiroption} \
+ --with-build-subdir="$(BUILD_SUBDIR)"; \
+ else \
+ rm -f no-such-file skip-this-dir; \
+ CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
+ $(BUILD_CONFIGARGS) $${srcdiroption} \
+ --with-build-subdir="$(BUILD_SUBDIR)"; \
+ fi || exit 1; \
+ if [ -f skip-this-dir ] ; then \
+ sh skip-this-dir; \
+ rm -f skip-this-dir; \
+ cd ..; rmdir $${dir} || true; \
+ else \
+ true; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ else \
+ true; \
+ fi
# This rule is used to build the modules which use FLAGS_TO_PASS. To
# build a target all-X means to cd to X and make all.
@@ -1174,7 +1340,7 @@ $(ALL_MODULES) all-gui all-libproc:
.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
$(NATIVE_CHECK_MODULES):
- @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
dir=`echo $@ | sed -e 's/check-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
@@ -1294,12 +1460,12 @@ $(CONFIGURE_TARGET_MODULES):
if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(CONFIG_ARGUMENTS) $${srcdiroption} \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
else \
rm -f no-such-file skip-this-dir; \
CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
- $(CONFIG_ARGUMENTS) $${srcdiroption} \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
fi; \
if [ -f skip-this-dir ] ; then \
@@ -1325,7 +1491,8 @@ $(ALL_TARGET_MODULES):
r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+ (cd $(TARGET_SUBDIR)/$${dir}; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
else \
true; \
fi
@@ -1339,7 +1506,8 @@ $(CHECK_TARGET_MODULES):
r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+ (cd $(TARGET_SUBDIR)/$${dir}; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
else \
true; \
fi
@@ -1428,12 +1596,12 @@ all-gcc:
# in parallel.
#
.PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
-bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
+bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
@r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
echo "Bootstrapping the compiler"; \
- cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
+ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
@r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
case "$@" in \
@@ -1449,12 +1617,12 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
esac; \
$(SET_LIB_PATH) \
echo "$$msg"; \
- cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
+ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
@r=`pwd`; export r; \
s=`cd $(srcdir); pwd` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) all
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
.PHONY: cross
cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
@@ -1462,12 +1630,13 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
echo "Building the C and C++ compiler"; \
- cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
+ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
@r=`pwd`; export r; \
s=`cd $(srcdir); pwd` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+ LANGUAGES="c c++" all
.PHONY: check-gcc
check-gcc:
@@ -1518,6 +1687,9 @@ install-dosrel: installdirs info
install-dosrel-fake:
+ALL_GCC = all-gcc
+ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
+ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3
# This is a list of inter-dependencies among modules.
all-apache:
@@ -1528,20 +1700,23 @@ all-bash:
all-bfd: all-libiberty all-intl
all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
all-bison: all-texinfo
-configure-target-bsp: $(ALL_GCC)
-all-target-bsp: configure-target-bsp all-gas all-ld all-gcc
+configure-target-boehm-gc: $(ALL_GCC_CXX) configure-target-qthreads
+all-target-boehm-gc: configure-target-boehm-gc
+configure-target-bsp: $(ALL_GCC_C)
+all-target-bsp: configure-target-bsp
all-byacc:
all-bzip2:
+all-cgen: all-libiberty
all-cvssrc:
-configure-target-cygmon: $(ALL_GCC)
-all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub
+configure-target-cygmon: $(ALL_GCC_C)
+all-target-cygmon: configure-target-cygmon all-target-libiberty all-target-libio all-target-libstub all-target-bsp
all-db:
all-dejagnu: all-tcl all-expect all-tk
all-diff: all-libiberty
all-emacs:
all-emacs19: all-bison all-byacc
all-etc:
-configure-target-examples: $(ALL_GCC)
+configure-target-examples: $(ALL_GCC_C)
all-target-examples: configure-target-examples
all-expect: all-tcl all-tk
all-fileutils: all-libiberty
@@ -1551,16 +1726,16 @@ all-flex: all-libiberty all-bison all-byacc
all-gas: all-libiberty all-opcodes all-bfd all-intl
all-gash: all-tcl
all-gawk:
-ALL_GCC = all-gcc
-all-gcc: all-bison all-byacc all-binutils all-gas all-ld
-all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld
+all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
+all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
all-gettext:
all-gnuserv:
-configure-target-gperf: $(ALL_GCC)
-all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
+configure-target-gperf: $(ALL_GCC_CXX)
+all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3
all-gprof: all-libiberty all-bfd all-opcodes all-intl
+all-grep: all-libiberty
all-grez: all-libiberty all-bfd all-opcodes
all-gui: all-gdb all-libproc all-target-librx
all-guile:
@@ -1572,40 +1747,59 @@ all-intl:
all-ispell: all-emacs19
all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1
all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
-configure-target-libg++: $(ALL_GCC) configure-target-librx
-all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
+configure-target-libg++: $(ALL_GCC_CXX) configure-target-librx
+all-target-libg++: configure-target-libg++ all-target-libiberty all-target-librx
configure-target-libgloss: $(ALL_GCC)
all-target-libgloss: configure-target-libgloss configure-target-newlib
-configure-target-libio: $(ALL_GCC)
+configure-target-libio: $(ALL_GCC_C)
all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
check-target-libio: all-target-libstdc++
all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
all-libiberty:
-configure-target-librx: $(ALL_GCC) configure-target-newlib
+
+all-build-libiberty: configure-build-libiberty
+
+configure-target-libffi: $(ALL_GCC_C)
+all-target-libffi: configure-target-libffi
+configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
+all-target-libjava: configure-target-libjava all-zip all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
+configure-target-librx: $(ALL_GCC_C)
all-target-librx: configure-target-librx
-configure-target-libstdc++: $(ALL_GCC)
-all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
-configure-target-libstub: $(ALL_GCC)
+configure-target-libstdc++: $(ALL_GCC_C)
+all-target-libstdc++: configure-target-libstdc++ all-target-libiberty all-target-libio
+configure-target-libstdc++-v3: $(ALL_GCC_C)
+all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty
+configure-target-libstub: $(ALL_GCC_C)
all-target-libstub: configure-target-libstub
all-libtool:
-all-m4: all-libiberty
+configure-target-libf2c: $(ALL_GCC_C)
+all-target-libf2c: configure-target-libf2c all-target-libiberty
+configure-target-libchill: $(ALL_GCC_C)
+all-target-libchill: configure-target-libchill all-target-libiberty
+configure-target-libobjc: $(ALL_GCC_C)
+all-target-libobjc: configure-target-libobjc all-target-libiberty
+all-m4: all-libiberty all-texinfo
all-make: all-libiberty
all-mmalloc:
configure-target-newlib: $(ALL_GCC)
-configure-target-libtermcap: $(ALL_GCC)
-all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
-all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc
-all-opcodes: all-bfd all-libiberty
+all-target-newlib: configure-target-newlib
+configure-target-libtermcap: $(ALL_GCC_C)
+all-target-libtermcap: configure-target-libtermcap
+all-opcodes: all-bfd all-libiberty all-cgen
all-patch: all-libiberty
all-perl:
all-prms: all-libiberty
+configure-target-qthreads: $(ALL_GCC_C)
+all-target-qthreads: configure-target-qthreads
all-rcs:
all-readline:
all-recode: all-libiberty
all-sed: all-libiberty
all-send-pr: all-prms
all-shellutils:
-all-sim: all-libiberty all-bfd all-opcodes all-readline
+all-sid: all-tcl all-tk
+all-sim: all-libiberty all-bfd all-opcodes all-readline all-cgen
+all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
all-tar: all-libiberty
all-tcl:
all-tcl8.1:
@@ -1618,14 +1812,19 @@ all-tgas: all-libiberty all-bfd all-opcodes
all-time:
all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1
all-wdiff:
-all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup
-configure-target-winsup: configure-target-newlib
+configure-target-winsup: $(ALL_GCC_C)
+all-target-winsup: all-target-libiberty all-target-libtermcap configure-target-winsup
all-uudecode: all-libiberty
all-zip:
-configure-target-libiberty: $(ALL_GCC)
-all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
+all-zlib:
+configure-target-zlib: $(ALL_GCC_C)
+all-target-zlib: configure-target-zlib
+configure-target-libiberty: $(ALL_GCC_C)
+all-target-libiberty: configure-target-libiberty
all-target: $(ALL_TARGET_MODULES)
install-target: $(INSTALL_TARGET_MODULES)
+install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
+install-sid: install-tcl install-tk
### other supporting targets
MAKEDIRS= \
@@ -1671,22 +1870,88 @@ DEVO_SUPPORT= README Makefile.in configure configure.in \
config.guess config.if config.sub config move-if-change \
mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
- mkinstalldirs ltconfig ltmain.sh missing ylwrap
+ mkinstalldirs ltconfig ltmain.sh missing ylwrap \
+ libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
# Files in devo/etc used in any net release.
# ChangeLog omitted because it may refer to files which are not in this
# distribution (perhaps it would be better to include it anyway).
ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
- make-stds.texi standards.info*
+ make-stds.texi standards.info* configure.texi configure.info* \
+ configbuild.* configdev.*
+
# When you use `make setup-dirs' or `make taz' you should always redefine
# this macro.
SUPPORT_FILES = list-of-support-files-for-tool-in-question
-.PHONY: taz
+# NOTE: No double quotes in the below. It is used within shell script
+# as VER="$(VER)"
+VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
+ sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
+ elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
+ sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
+ elif test -f $(TOOL)/version.in; then \
+ head -1 $(TOOL)/version.in; \
+ elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
+ sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
+ else \
+ echo VERSION; \
+ fi`
+PACKAGE = $(TOOL)
-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
- texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+.PHONY: taz
+taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
+ $(MAKE) -f Makefile.in do-proto-toplev \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-md5sum \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-tar \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-bz2 \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+
+.PHONY: gdb-tar
+gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
+ $(MAKE) -f Makefile.in do-proto-toplev \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-md5sum \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-djunpack \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-tar \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+
+.PHONY: gdb-taz
+gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
+ $(MAKE) -f Makefile.in gdb-tar \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+ $(MAKE) -f Makefile.in do-bz2 \
+ TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(SUPPORT_FILES)"
+
+.PHONY: do-proto-toplev
+do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
+ echo "==> Making $(PACKAGE)-$(VER)/"
# Take out texinfo from a few places.
sed -e '/^all\.normal: /s/\all-texinfo //' \
-e '/^ install-texinfo /d' \
@@ -1695,7 +1960,8 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
#
./configure sun4
[ -z "$(CONFIGURE_TARGET_MODULES)" ] \
- || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
+ || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
+ ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
# Make links, and run "make diststuff" or "make info" when needed.
rm -rf proto-toplev ; mkdir proto-toplev
@@ -1715,7 +1981,7 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
fi ; \
else ln -s ../$$d proto-toplev/$$d ; fi ; \
done
- cd etc ; $(MAKE) info
+ cd etc && $(MAKE) info
$(MAKE) distclean
#
mkdir proto-toplev/etc
@@ -1731,67 +1997,144 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
#
mkdir proto-toplev/texinfo
ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
- ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
- ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
if test -r texinfo/util/tex3patch ; then \
mkdir proto-toplev/texinfo/util && \
ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
else true; fi
chmod -R og=u . || chmod og=u `find . -print`
- if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
- ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
- else \
- ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
- fi; \
- $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
-
-do-tar-gz:
- echo "==> Making $(TOOL)-$(VER).tar.gz"
- -rm -f $(TOOL)-$(VER)
- ln -s proto-toplev $(TOOL)-$(VER)
- tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
- $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
-
-TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
+ #
+ # Create .gmo files from .po files.
+ for f in `find . -name '*.po' -type f -print`; do \
+ msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
+ done
+ #
+ -rm -f $(PACKAGE)-$(VER)
+ ln -s proto-toplev $(PACKAGE)-$(VER)
+
+.PHONY: do-tar
+do-tar:
+ echo "==> Making $(PACKAGE)-$(VER).tar"
+ -rm -f $(PACKAGE)-$(VER).tar
+ find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
+ | tar cTfh - $(PACKAGE)-$(VER).tar
+
+.PHONY: do-bz2
+do-bz2:
+ echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
+ -rm -f $(PACKAGE)-$(VER).tar.bz2
+ $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
+
+.PHONY: do-md5sum
+do-md5sum:
+ echo "==> Adding md5 checksum to top-level directory"
+ cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
+ | xargs $(MD5PROG) > ../md5.sum
+ mv md5.sum proto-toplev
+
+.PHONY: do-djunpack
+do-djunpack:
+ echo "==> Adding updated djunpack.bat to top-level directory"
+ echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
+ sed < djunpack.bat > djunpack.new \
+ -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
+ mv djunpack.new djunpack.bat
+ -rm -f proto-toplev/djunpack.bat
+ ln -s ../djunpack.bat proto-toplev/djunpack.bat
+
+TEXINFO_SUPPORT= texinfo/texinfo.tex
DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
-.PHONY: gas.tar.gz
-GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms
-gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
+.PHONY: gas.tar.bz2
+GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
+gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
$(MAKE) -f Makefile.in taz TOOL=gas \
+ MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
# The FSF "binutils" release includes gprof and ld.
-.PHONY: binutils.tar.gz
-BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms
-binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
+.PHONY: binutils.tar.bz2
+BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
+binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
$(MAKE) -f Makefile.in taz TOOL=binutils \
- SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
-.PHONY: gas+binutils.tar.gz
+.PHONY: gas+binutils.tar.bz2
GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
-gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
+gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
$(MAKE) -f Makefile.in taz TOOL=gas \
- SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
-.PHONY: libg++.tar.gz
+.PHONY: libg++.tar.bz2
LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
-libg++.tar.gz: $(DIST_SUPPORT) libg++
+libg++.tar.bz2: $(DIST_SUPPORT) libg++
$(MAKE) -f Makefile.in taz TOOL=libg++ \
+ MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
GNATS_SUPPORT_DIRS=include libiberty send-pr
-gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
+gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
$(MAKE) -f Makefile.in taz TOOL=gnats \
+ MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
-.PHONY: gdb.tar.gz
+.PHONY: gdb.tar.bz2
GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
-gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
- $(MAKE) -f Makefile.in taz TOOL=gdb \
+gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
+.PHONY: gdb.tar
+gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \
+ MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
-.PHONY: newlib.tar.gz
+DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
+.PHONY: dejagnu.tar.bz2
+dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
+ $(MAKE) -f Makefile.in taz TOOL=dejagnu \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
+
+.PHONY: gdb+dejagnu.tar.bz2
+GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
+gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
+.PHONY: gdb+dejagnu.tar
+gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
+
+.PHONY: insight.tar.bz2
+INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
+insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
+.PHONY: insight.tar
+insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=insight \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
+
+.PHONY: insight+dejagnu.tar.bz2
+INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
+insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
+.PHONY: insight+dejagnu.tar
+insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
+ $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
+ MD5PROG="$(MD5PROG)" \
+ SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
+
+.PHONY: newlib.tar.bz2
NEWLIB_SUPPORT_DIRS=libgloss
# taz configures for the sun4 target which won't configure newlib.
# We need newlib configured so that the .info files are made.
@@ -1804,8 +2147,9 @@ NEWLIB_SUPPORT_DIRS=libgloss
# the make distclean. For now punt on the issue of shipping newlib info files
# with newlib net releases and wait for a day when some native target (sun4?)
# supports newlib (if only minimally).
-newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
+newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
$(MAKE) -f Makefile.in taz TOOL=newlib \
+ MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
diff --git a/contrib/gdb/config-ml.in b/contrib/gdb/config-ml.in
index 3a159cf..c968bf0 100644
--- a/contrib/gdb/config-ml.in
+++ b/contrib/gdb/config-ml.in
@@ -72,14 +72,16 @@
# We have to handle being invoked by both Cygnus configure and Autoconf.
#
# Cygnus configure incoming variables:
-# srcdir, subdir, target, arguments
+# srcdir, subdir, host, arguments
#
# Autoconf incoming variables:
-# srcdir, target, ac_configure_args
+# srcdir, host, ac_configure_args
#
-# We *could* figure srcdir and target out, but we'd have to do work that
+# We *could* figure srcdir and host out, but we'd have to do work that
# our caller has already done to figure them out and requiring these two
# seems reasonable.
+# Note that `host' in this case is GCC's `target'. Target libraries are
+# configured for a particular host.
if [ -n "${ac_configure_args}" ]; then
Makefile=${ac_file-Makefile}
@@ -204,7 +206,10 @@ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
fi
done
-case "${target}" in
+# Target libraries are configured for the host they run on, so we check
+# $host here, not $target.
+
+case "${host}" in
arc-*-elf*)
if [ x$enable_biendian != xyes ]
then
@@ -218,6 +223,75 @@ arc-*-elf*)
done
fi
;;
+arm-*-*)
+ if [ x"$enable_fpu" = xno ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *fpu*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x"$enable_26bit" = xno ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *26bit*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x"$enable_underscore" = xno ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *under*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x"$enable_interwork" = xno ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *interwork*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x$enable_biendian = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *le* ) : ;;
+ *be* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x"$enable_nofmult" = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *nofmult* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ ;;
m68*-*-*)
if [ x$enable_softfloat = xno ]
then
@@ -299,6 +373,28 @@ mips*-*-*)
esac
done
fi
+ case " $multidirs " in
+ *" mabi=64 "*)
+ # We will not be able to create libraries with -mabi=64 if
+ # we cannot even link a trivial program. It usually
+ # indicates the 64bit libraries are missing.
+ if echo 'main() {}' > conftest.c &&
+ ${CC-gcc} -mabi=64 conftest.c -o conftest; then
+ :
+ else
+ echo Could not link program with -mabi=64, disabling it.
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *mabi=64* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ rm -f conftest.c conftest
+ ;;
+ esac
;;
powerpc*-*-* | rs6000*-*-*)
if [ x$enable_softfloat = xno ]
@@ -379,6 +475,30 @@ powerpc*-*-* | rs6000*-*-*)
done
fi
;;
+sparc*-*-*)
+ case " $multidirs " in
+ *" m64 "*)
+ # We will not be able to create libraries with -m64 if
+ # we cannot even link a trivial program. It usually
+ # indicates the 64bit libraries are missing.
+ if echo 'main() {}' > conftest.c &&
+ ${CC-gcc} -m64 conftest.c -o conftest; then
+ :
+ else
+ echo Could not link program with -m64, disabling it.
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *m64* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ rm -f conftest.c conftest
+ ;;
+ esac
+ ;;
esac
# Remove extraneous blanks from multidirs.
@@ -409,6 +529,8 @@ multi-do:
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
CFLAGS="$(CFLAGS) $${flags}" \
+ prefix="$(prefix)" \
+ exec_prefix="$(exec_prefix)" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -552,7 +674,24 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
echo "pwd: `pwd`"
fi
- if [ -d ${ml_dir} ]; then true; else mkdir ${ml_dir}; fi
+ if [ -d ${ml_dir} ]; then true; else
+ # ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
+ pathcomp=""
+ for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+ if test ! -d "$pathcomp"; then
+ exit $lasterr
+ fi
+ pathcomp="$pathcomp/"
+ done
+ fi
if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
# Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
@@ -603,9 +742,86 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
cd ${ml_dir}/${ml_libdir}
if [ -f ${ml_newsrcdir}/configure ]; then
- ml_recprog=${ml_newsrcdir}/configure
+ ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache"
+ fi
+
+ # find compiler flag corresponding to ${ml_dir}
+ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
+ dir=`echo $i | sed -e 's/;.*$//'`
+ if [ "${dir}" = "${ml_dir}" ]; then
+ flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
+ break
+ fi
+ done
+ ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags"'
+
+ if [ "${with_target_subdir}" = "." ]; then
+ CC_=$CC' '
+ CXX_=$CXX' '
+ else
+ # Create a regular expression that matches any string as long
+ # as ML_POPDIR.
+ popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'`
+ CC_=
+ for arg in ${CC}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
+ "${ML_POPDIR}"/*)
+ CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ *)
+ CC_="${CC_}${arg} " ;;
+ esac
+ done
+
+ CXX_=
+ for arg in ${CXX}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ "${ML_POPDIR}"/*)
+ CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ *)
+ CXX_="${CXX_}${arg} " ;;
+ esac
+ done
+
+ if test "x${LD_LIBRARY_PATH+set}" = xset; then
+ LD_LIBRARY_PATH_=
+ for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
+ case "$arg" in
+ "${ML_POPDIR}"/*)
+ arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
+ ;;
+ esac
+ if test "x$LD_LIBRARY_PATH_" != x; then
+ LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
+ else
+ LD_LIBRARY_PATH_=$arg
+ fi
+ done
+ ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
+ fi
+
+ if test "x${SHLIB_PATH+set}" = xset; then
+ SHLIB_PATH_=
+ for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
+ case "$arg" in
+ "${ML_POPDIR}"/*)
+ arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
+ ;;
+ esac
+ if test "x$SHLIB_PATH_" != x; then
+ SHLIB_PATH_=$SHLIB_PATH_:$arg
+ else
+ SHLIB_PATH_=$arg
+ fi
+ done
+ ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
+ fi
fi
- if eval ${ml_config_shell} ${ml_recprog} \
+
+ if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
${ml_arguments} ${ml_srcdiroption} ; then
true
diff --git a/contrib/gdb/config.guess b/contrib/gdb/config.guess
index 3263584..db494f8 100755
--- a/contrib/gdb/config.guess
+++ b/contrib/gdb/config.guess
@@ -1,7 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
-#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-02-19'
+
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -21,36 +24,193 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int dummy(){}" > $dummy.c ;
+ for c in cc gcc c89 ; do
+ ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+ if test $? = 0 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ rm -f $dummy.c $dummy.o $dummy.rel ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
+ UNAME_MACHINE_ARCH=unknown
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -59,90 +219,89 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- cat <<EOF >dummy.s
+ cat <<EOF >$dummy.s
+ .data
+\$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
.globl main
+ .align 4
.ent main
main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
.end main
EOF
- ${CC-cc} dummy.s -o dummy 2>/dev/null
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
+ case `./$dummy` in
+ 0-0)
UNAME_MACHINE="alpha"
;;
- 15)
+ 1-0)
UNAME_MACHINE="alphaev5"
;;
- 14)
+ 1-1)
UNAME_MACHINE="alphaev56"
;;
- 10)
+ 1-101)
UNAME_MACHINE="alphapca56"
;;
- 16)
+ 2-303)
UNAME_MACHINE="alphaev6"
;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
+ 2-1307)
+ UNAME_MACHINE="alphaev68"
+ ;;
esac
fi
- rm -f dummy.s dummy
+ rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-cbm-sysv4
+ echo m68k-unknown-sysv4
exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
- arc64:OpenBSD:*:*)
- echo mips64el-unknown-openbsd${UNAME_RELEASE}
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hkmips:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
- arm32:NetBSD:*:*)
- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- SR2?01:HI-UX/MPP:*:*)
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -150,7 +309,7 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
- NILE:*:*:dcosx)
+ NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
@@ -181,7 +340,7 @@ EOF
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
@@ -195,30 +354,32 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -231,12 +392,18 @@ EOF
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
- 2020:CLIX:*:*)
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >dummy.c
- int main (argc, argv) int argc; char **argv; {
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -251,12 +418,15 @@ EOF
exit (-1);
}
EOF
- ${CC-cc} dummy.c -o dummy \
- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy \
+ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -272,15 +442,18 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
echo m88k-dg-dgux${UNAME_RELEASE}
- else
+ else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
fi
- else echo i586-dg-dgux${UNAME_RELEASE}
- fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
@@ -301,12 +474,21 @@ EOF
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
+ i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
@@ -317,8 +499,8 @@ EOF
exit(0);
}
EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -326,8 +508,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
- *:AIX:*:4)
- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -335,7 +518,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=4.${UNAME_RELEASE}
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@@ -345,7 +528,7 @@ EOF
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
@@ -360,33 +543,48 @@ EOF
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
- *9??*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9] )
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
- sed 's/^ //' << EOF >dummy.c
+ #define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
-
+
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
- #endif
+ #endif
long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
+
+ switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
+ case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
- switch (bits)
+ switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
@@ -394,20 +592,26 @@ EOF
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
- #endif
+ #endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
- (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
- rm -f dummy.c dummy
+ (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ rm -f $dummy.c $dummy
+ fi ;;
esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
@@ -432,8 +636,8 @@ EOF
exit (0);
}
EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,13 +646,16 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
- i?86:OSF1:*:*)
+ i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
@@ -476,63 +683,68 @@ EOF
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE}
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- F300:UNIX_System_V:*:*)
+ CRAY*T3D:*:*:*)
+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- i?86:BSD/386:*:* | *:BSD/OS:*:*)
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
- *:FreeBSD:*:*)
- if test -x /usr/bin/objformat; then
- if test "elf" = "`/usr/bin/objformat`"; then
- echo ${UNAME_MACHINE}-unknown-freebsdelf`echo${UNAME_RELEASE}|sed -e 's/[-_].*//'`
- exit 0
- fi
- fi
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
- i*:[Cc][Yy][Gg][Ww][Ii][Nn]*:*)
- echo ${UNAME_MACHINE}-pc-cygwin32
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:3*)
+ echo i386-pc-interix3
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i386-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin32
+ echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -540,174 +752,142 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
- *:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- arm* | sa110*) UNAME_MACHINE="arm" ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ rm -f $dummy.c
+ test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
esac
-
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
- # first see if it will tell us.
- ld_help_string=`ld --help 2>&1`
- ld_supported_emulations=`echo $ld_help_string \
- | sed -ne '/supported emulations:/!d
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
- s/.*supported emulations: *//
+ s/.*supported targets: *//
s/ .*//
p'`
- case "$ld_supported_emulations" in
- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc)
- # Determine Lib Version
- cat >dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#if defined(__GLIBC__)
- printf("%s %s\n", __libc_version, __libc_release);
-#else
- printf("unkown\n");
-#endif
- return 0;
-}
-EOF
- LIBC=""
- ${CC-cc} dummy.c -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy | grep 1\.99 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f dummy.c dummy
- echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- LIBC=""
- ${CC-cc} dummy.s -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
-
- objdump --private-headers dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f dummy.s dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >dummy.c <<EOF
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ rm -f $dummy.c
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
- i?86:UNIX_SV:4.2MP:2.*)
+ i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
@@ -715,26 +895,23 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
- i?86:*:5:7*)
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
-# 5.0.4c returns "Pent II". 5.0.5 returns PentII
- (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
- exit 0 ;;
- i?86:*:3.2:*)
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@@ -743,18 +920,20 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*PentII' >/dev/null) \
+ (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pent II' >/dev/null) \
+ (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
pc:*:*:*)
+ # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
@@ -778,7 +957,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -789,24 +968,30 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i?86:LynxOS:2.*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
@@ -818,8 +1003,8 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
@@ -831,13 +1016,17 @@ EOF
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
- news*:NEWS-OS:*:6*)
+ news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
@@ -853,12 +1042,91 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ if test "${UNAME_MACHINE}" = "x86pc"; then
+ UNAME_MACHINE=pc
+ echo i386-${UNAME_MACHINE}-nto-qnx
+ else
+ echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+ fi
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-cat >dummy.c <<EOF
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -896,7 +1164,10 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -941,11 +1212,24 @@ main ()
#endif
#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
#endif
#if defined (alliant) && defined (i860)
@@ -956,8 +1240,8 @@ main ()
}
EOF
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@@ -989,6 +1273,48 @@ then
esac
fi
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/contrib/gdb/config.if b/contrib/gdb/config.if
index bcc0269..3958928 100644
--- a/contrib/gdb/config.if
+++ b/contrib/gdb/config.if
@@ -21,9 +21,15 @@ else
if_topsrcdir=${top_srcdir}
fi
-if [ -f ${if_topsrcdir}/libstdc++/Makefile.in ]; then
+if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
+ libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
+else
+ libstdcxx_srcdir=${if_topsrcdir}/libstdc++
+fi
+
+if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
# We check libstdc++ for libstdcxx_interface.
-libstdcxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/libstdc++/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
+libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'`
else
libstdcxx_interface=
fi
@@ -76,8 +82,8 @@ EOF
exit 1
fi
else
- # Cross compiling. Assume glibc 2.1.
- libc_interface=-libc6.1-
+ # Cross compiling. Assume glibc 2.2.
+ libc_interface=-libc6.2-
fi
;;
*)
diff --git a/contrib/gdb/config.sub b/contrib/gdb/config.sub
index 3ce1136..4ac7ab2 100755
--- a/contrib/gdb/config.sub
+++ b/contrib/gdb/config.sub
@@ -1,6 +1,10 @@
#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-02-22'
+
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -25,6 +29,9 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
@@ -45,42 +52,73 @@
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
-esac
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
-# CYGNUS LOCAL marketing-names
-# Here we handle any "marketing" names - translating them to
-# standard triplets
-case $1 in
- mips-tx39-elf)
- set mipstx39-unknown-elf
- ;;
- *)
- ;;
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
esac
-# END CYGNUS LOCAL marketing-names
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- linux-gnu*)
+ nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -106,20 +144,28 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
+ -apple | -axis)
os=
basic_machine=$1
;;
- -sim | -cisco | -oki | -wec | -winbond ) # CYGNUS LOCAL
+ -sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
- -scout) # CYGNUS LOCAL
+ -scout)
;;
- -wrs) # CYGNUS LOCAL
- os=vxworks
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
basic_machine=$1
;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -168,70 +214,60 @@ case $os in
-psos*)
os=-psos
;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 \
- | tron | a29k | 580 | i960 | h8300 \
- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | alpha | alphaev[45678] | alphaev56 | alphapca5[67] \
- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | sparc86x | v850 \
- | c4x)
- basic_machine=$basic_machine-unknown
- ;;
- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
- | h8500 | w65 | fr30) # CYGNUS LOCAL
- basic_machine=$basic_machine-unknown
- ;;
- strongarm) # CYGNUS LOCAL nickc/strongarm
- basic_machine=$basic_machine-unknown
- ;;
- thumb)
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
- basic_machine=$basic_machine-unknown
- ;;
- mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
- basic_machine=$basic_machine-unknown
- ;;
- mips16)
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dsp16xx \
+ | fr30 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el | mips64vr4300 \
+ | mips64vr4300el | mips64vr5000 | mips64vr5000el \
+ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+ | mipsisa32 \
+ | mn10200 | mn10300 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
+ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
basic_machine=$basic_machine-unknown
;;
- tic30) # CYGNUS LOCAL ian/tic30
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
+ os=-none
;;
- c30) # CYGNUS LOCAL ian/tic30
- basic_machine=tic30-unknown
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
- v850e) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- v850ea) # CYGNUS LOCAL jtc/v850
- basic_machine=$basic_machine-unknown
- ;;
- d10v)
- basic_machine=$basic_machine-unknown
- ;;
- d30v) # CYGNUS LOCAL hunt/d30v
- basic_machine=$basic_machine-unknown
- ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
+ i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -240,51 +276,49 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
- | xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* \
- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
- | alpha-* | alphaev[45678]-* | alphaev56-* | alphapca5[67]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
- | xps100-* | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mipstx39-* | mipstx39el-* \
- | f301-* \
- | fr30-*) # CYGNUS LOCAL
- ;;
- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
- ;;
- strongarm-*) # CYGNUS LOCAL nickc/strongarm
- ;;
- thumb-*) # CYGNUS LOCAL angela/thumb
- ;;
- v850-*) # CYGNUS LOCAL
- ;;
- v850e-*) # CYGNUS LOCAL
- ;;
- v850ea-*) # CYGNUS LOCAL
- ;;
- d30v-*) # CYGNUS LOCAL
- ;;
- mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
- ;;
- mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
- ;;
- mips16-*) # CYGNUS LOCAL krk/mips16
- ;;
- tic30-*) # CYGNUS LOCAL ian/tic30
- ;;
- c30-*) # CYGNUS LOCAL ian/tic30
- basic_machine=tic30-unknown
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c54x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd) # CYGNUS LOCAL
+ 386bsd)
basic_machine=i386-unknown
os=-bsd
;;
@@ -294,11 +328,11 @@ case $basic_machine in
3b*)
basic_machine=we32k-att
;;
- a29khif) # CYGNUS LOCAL
+ a29khif)
basic_machine=a29k-amd
os=-udi
;;
- adobe68k) # CYGNUS LOCAL
+ adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
@@ -317,21 +351,21 @@ case $basic_machine in
os=-sysv
;;
amiga | amiga-*)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
;;
amigaos | amigados)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
- apollo68bsd) # CYGNUS LOCAL
+ apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
@@ -343,6 +377,10 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -363,27 +401,30 @@ case $basic_machine in
basic_machine=c38-convex
os=-bsd
;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [ctj]90-cray)
- basic_machine=c90-cray
+ cray | j90)
+ basic_machine=j90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
@@ -411,7 +452,7 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
- es1800 | OSE68k | ose68k | ose | OSE) # CYGNUS LOCAL
+ es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
@@ -425,6 +466,10 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -433,11 +478,11 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
- h8300xray) # CYGNUS LOCAL
+ h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
- h8500hms) # CYGNUS LOCAL
+ h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
@@ -456,22 +501,6 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
- w89k-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- op50n-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- op60c-*) # CYGNUS LOCAL
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- hppro) # CYGNUS LOCAL
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
@@ -481,22 +510,21 @@ case $basic_machine in
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
- hp9k78[0-9] | hp78[0-9] )
+ hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
- hp9k8[0-9][13679] | hp8[0-9][13679] )
+ hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -505,47 +533,42 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
- hppaosf) # CYGNUS LOCAL
+ hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
- os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
+ i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
- i[34567]86v4*)
+ i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
- i[34567]86v)
+ i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
- i[34567]86sol2)
+ i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
- i386mach) # CYGNUS LOCAL
+ i386mach)
basic_machine=i386-mach
os=-mach
;;
- i386-vsta | vsta) # CYGNUS LOCAL
+ i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
- i386-go32 | go32) # CYGNUS LOCAL
- basic_machine=i386-unknown
- os=-go32
- ;;
- i386-mingw32 | mingw32)
- basic_machine=i386-unknown
- os=-mingw32
- ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -571,16 +594,16 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
miniframe)
basic_machine=m68000-convergent
;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -588,22 +611,38 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- monitor) # CYGNUS LOCAL
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
basic_machine=m68k-rom68k
os=-coff
;;
- msdos) # CYGNUS LOCAL
- basic_machine=i386-unknown
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
os=-msdos
;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
- basic_machine=i386-unknown # CYGNUS LOCAL
+ basic_machine=i386-unknown
os=-netbsd
;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
@@ -616,7 +655,7 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
- necv70) # CYGNUS LOCAL
+ necv70)
basic_machine=v70-nec
os=-sysv
;;
@@ -645,18 +684,33 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
- mon960) # CYGNUS LOCAL
+ mon960)
basic_machine=i960-intel
os=-mon960
;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
np1)
basic_machine=np1-gould
;;
- OSE68000 | ose68000) # CYGNUS LOCAL
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
- os68k) # CYGNUS LOCAL
+ os68k)
basic_machine=m68k-none
os=-os68k
;;
@@ -677,28 +731,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | nexen)
+ pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
- pentiumpro | p6 | k6 | 6x86)
+ pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
- basic_machine=i786-pc
+ basic_machine=i686-pc
;;
- pentium-* | p5-* | k5-* | nexen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | k6-* | 6x86-*)
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
- power) basic_machine=rs6000-ibm
+ power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@@ -710,10 +764,24 @@ case $basic_machine in
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
ps2)
basic_machine=i386-ibm
;;
- rom68k) # CYGNUS LOCAL
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
@@ -723,7 +791,13 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
- sa29200) # CYGNUS LOCAL
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
basic_machine=a29k-amd
os=-udi
;;
@@ -734,7 +808,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs) # CYGNUS LOCAL
+ sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -745,10 +819,10 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
- st2000) # CYGNUS LOCAL
+ st2000)
basic_machine=m68k-tandem
;;
- stratus) # CYGNUS LOCAL
+ stratus)
basic_machine=i860-stratus
os=-sysv4
;;
@@ -792,16 +866,40 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
+ t3d)
+ basic_machine=alpha-cray
+ os=-unicos
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -813,7 +911,7 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
- v810 | necv810) # CYGNUS LOCAL
+ v810 | necv810)
basic_machine=v810-nec
os=-none
;;
@@ -840,18 +938,26 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
- w65*) # CYGNUS LOCAL
- basic_machine=w65-wdc
- os=-none
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ windows32)
+ basic_machine=i386-pc
+ os=-windows32-msvcrt
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
- z8k-*-coff) # CYGNUS LOCAL
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
@@ -862,22 +968,15 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
- w89k) # CYGNUS LOCAL
+ w89k)
basic_machine=hppa1.1-winbond
;;
- op50n) # CYGNUS LOCAL
+ op50n)
basic_machine=hppa1.1-oki
;;
- op60c) # CYGNUS LOCAL
+ op60c)
basic_machine=hppa1.1-oki
;;
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
romp)
basic_machine=romp-ibm
;;
@@ -887,13 +986,23 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
- sparc | sparcv9)
+ sh3 | sh4 | sh3eb | sh4eb)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -905,16 +1014,19 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
- mac | mpw | mac-mpw) # CYGNUS LOCAL
+ mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
- pmac | pmac-mpw) # CYGNUS LOCAL
+ pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
+ c4x*)
+ basic_machine=c4x-none
+ os=-coff
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -971,19 +1083,35 @@ case $os in
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk*)
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
- # CYGNUS LOCAL
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto*)
+ os=-nto-qnx
+ ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
- # END CYGNUS LOCAL
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -993,6 +1121,12 @@ case $os in
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
-osfrose*)
os=-osfrose
;;
@@ -1008,15 +1142,24 @@ case $os in
-acis*)
os=-aos
;;
- -386bsd) # CYGNUS LOCAL
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
-ns2 )
os=-nextstep2
;;
+ -nsk*)
+ os=-nsk
+ ;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -1042,15 +1185,18 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
- -ose*) # CYGNUS LOCAL
+ -ose*)
os=-ose
;;
- -es1800*) # CYGNUS LOCAL
+ -es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
-none)
;;
*)
@@ -1076,9 +1222,16 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
+ arm*-rebel)
+ os=-linux
+ ;;
arm*-semi)
os=-aout
;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
pdp11-*)
os=-none
;;
@@ -1097,15 +1250,18 @@ case $basic_machine in
# default.
# os=-sunos4
;;
- m68*-cisco) # CYGNUS LOCAL
+ m68*-cisco)
os=-aout
;;
- mips*-cisco) # CYGNUS LOCAL
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
os=-elf
;;
- mips*-*) # CYGNUS LOCAL
- os=-elf
- ;;
+ or32-*)
+ os=-coff
+ ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1118,13 +1274,13 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-wec) # CYGNUS LOCAL
+ *-wec)
os=-proelf
;;
- *-winbond) # CYGNUS LOCAL
+ *-winbond)
os=-proelf
;;
- *-oki) # CYGNUS LOCAL
+ *-oki)
os=-proelf
;;
*-hp)
@@ -1187,18 +1343,21 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
- f301-fujitsu)
+ f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
- *-rom68k) # CYGNUS LOCAL
+ *-rom68k)
os=-coff
;;
- *-*bug) # CYGNUS LOCAL
+ *-*bug)
os=-coff
;;
- *-apple) # CYGNUS LOCAL
+ *-apple)
os=-macos
;;
+ *-atari*)
+ os=-mint
+ ;;
*)
os=-none
;;
@@ -1244,7 +1403,7 @@ case $basic_machine in
-genix*)
vendor=ns
;;
- -mvs*)
+ -mvs* | -opened*)
vendor=ibm
;;
-ptx*)
@@ -1256,15 +1415,29 @@ case $basic_machine in
-aux*)
vendor=apple
;;
- -hms*) # CYGNUS LOCAL
+ -hms*)
vendor=hitachi
;;
- -mpw* | -macos*) # CYGNUS LOCAL
+ -mpw* | -macos*)
vendor=apple
;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/contrib/gdb/configure b/contrib/gdb/configure
index a63a3fb..477bbe0 100755
--- a/contrib/gdb/configure
+++ b/contrib/gdb/configure
@@ -3,7 +3,7 @@
### WARNING: this file contains embedded tabs. Do not run untabify on this file.
# Configuration script
-# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 1997
+# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -86,7 +86,7 @@ subdirs=
target_alias=NOTARGET
target_makefile_frag=
undefs=NOUNDEFS
-version="$Revision: 1.270 $"
+version="$Revision: 1.13 $"
x11=default
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
@@ -237,7 +237,7 @@ do
esac
enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval "$enableopt='$optarg'"
+ eval "$enableopt=\$optarg"
enableoptions="$enableoptions '$option'"
;;
--exec-prefix* | --ex*)
@@ -370,7 +370,7 @@ do
esac
withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $withopt="$optarg"
+ eval $withopt="\$optarg"
withoptions="$withoptions $option"
;;
--without-*)
@@ -450,7 +450,7 @@ case "${fatal}" in
fi
;;
esac
- echo "Configuring for a ${host_alias} host." 1>&2
+ echo "Configuring for a ${host_alias} host."
arguments="--host=$host_alias $arguments"
else
echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
@@ -518,7 +518,8 @@ fi
configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
-topsrcdir=`cd \`dirname ${progname}\`; pwd`
+## the sed command below emulates the dirname command
+topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; pwd`
# this is a hack. sun4 must always be a valid host alias or this will fail.
@@ -576,7 +577,6 @@ case "${srcdir}" in
fi
esac
-
# default exec_prefix
case "${exec_prefixoption}" in
"") exec_prefix="\$(prefix)" ;;
@@ -587,12 +587,12 @@ esac
# the gcc version number changes.
if [ "${with_gcc_version_trigger+set}" = set ]; then
gcc_version_trigger="$with_gcc_version_trigger"
- gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${with_gcc_version_trigger}`
+ gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
else
# If gcc's sources are available, define the trigger file.
if [ -f ${topsrcdir}/gcc/version.c ] ; then
gcc_version_trigger=${topsrcdir}/gcc/version.c
- gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
+ gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
case "$arguments" in
*--with-gcc-version-trigger=$gcc_version_trigger* )
;;
@@ -655,8 +655,8 @@ case "${TMPDIR}" in
*) ;;
esac
-# keep this filename short for &%*%$*# 14 char file names
-tmpfile=${TMPDIR}/cONf$$
+# keep this filename short for &%*%$*# 14 char file names and 8+3 file names
+tmpfile=${TMPDIR}/cNf$$
# Note that under many versions of sh a trap handler for 0 will *override* any
# exit status you explicitly specify! At this point, the only non-error exit
# is at the end of the script; these actions are duplicated there, minus
@@ -912,9 +912,10 @@ if [ "${build}" != "${host}" ]; then
tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
+ tools="${tools} OBJCOPY OBJDUMP"
for var in ${tools}; do
- if [ -z "`eval 'echo $'"${var}"`" ] && [ -r Makefile ]; then
+ if eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then
sed -n -e ':loop
/\\$/ N
s/\\\n//g
@@ -923,7 +924,7 @@ t loop
< Makefile > Makefile.v
t=`tail -1 Makefile.v`
if [ -n "${t}" ]; then
- eval "${var}='${t}'"
+ eval "${var}=\${t}"
fi
rm -f Makefile.v
fi
@@ -955,6 +956,8 @@ t loop
RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib}
WINDRES=${WINDRES-${host_alias}-windres}
WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres}
+ OBJCOPY=${OBJCOPY-${host_alias}-objcopy}
+ OBJDUMP=${OBJDUMP-${host_alias}-objdump}
if [ -z "${YACC}" ]; then
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
@@ -1005,6 +1008,8 @@ t loop
export NM
export RANLIB
export WINDRES
+ export OBJCOPY
+ export OBJDUMP
else
# If CC is still not set, try to get gcc.
if [ -z "${CC}" ]; then
@@ -1057,6 +1062,27 @@ export CXX
export CFLAGS
export CXXFLAGS
+# FIXME: This should be in configure.in, not configure
+case "$host" in
+ *go32*)
+ enable_gdbtk=no ;;
+ *msdosdjgpp*)
+ enable_gdbtk=no ;;
+esac
+
+# FIXME: This should be in configure.in, not configure
+# Determine whether gdb needs tk/tcl or not.
+if [ "$enable_gdbtk" != "no" ]; then
+ GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui"
+else
+ GDB_TK=""
+fi
+
+all_build_modules=
+if test x"${build_alias}" != x"${host_alias}"
+then
+ all_build_modules='$(ALL_BUILD_MODULES_LIST)'
+fi
for subdir in . ${subdirs} ; do
@@ -1315,35 +1341,6 @@ EOF
echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
fi
- # provide a proper gxx_include_dir to all subdirs.
- # Note, if you change the default, make sure to fix both here
- # and in the gcc subdirectory.
- # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
- gxx_include_dir=
- if test -n "${with_gxx_include_dir}"; then
- case "${with_gxx_include_dir}" in
- yes )
- echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2
- exit 1
- ;;
- no )
- ;;
- * )
- gxx_include_dir=${with_gxx_include_dir}
- ;;
- esac
- fi
- if test x${gxx_include_dir} = x; then
- if test x${enable_version_specific_runtime_libs} = xyes; then
- echo gxx_include_dir = '${libsubdir}/include/g++' >> ${Makefile}
- else
- . ${topsrcdir}/config.if
- echo gxx_include_dir = '${prefix}/include/g++'-${libstdcxx_interface} >> ${Makefile}
- fi
- else
- echo gxx_include_dir = ${gxx_include_dir} >> ${Makefile}
- fi
-
# record if we want to build shared libs.
if test -z "${enable_shared}"; then
echo enable_shared = no >> ${Makefile}
@@ -1387,6 +1384,7 @@ EOF
-e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \
-e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \
-e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \
+ -e "s|^ALL_BUILD_MODULES =.*|ALL_BUILD_MODULES =${all_build_modules}|" \
-e "/^CC[ ]*=/{
:loop1
/\\\\$/ N
@@ -1422,17 +1420,20 @@ EOF
-e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
-e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
-e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \
+ -e "s|^build_tooldir[ ]*=.*$|build_tooldir = ${tooldir}|" \
-e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
-e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
-e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \
${subdir}/Makefile.tem >> ${Makefile}
+ sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem
+ mv -f ${Makefile}.tem ${Makefile}
# If this is a Canadian Cross, preset the values of many more
# tools.
if [ "${build}" != "${host}" ]; then
for var in ${tools}; do
- val=`eval 'echo $'"${var}"`
+ eval val=\$${var}
sed -e "/^${var}[ ]*=/{
:loop1
/\\\\$/ N
diff --git a/contrib/gdb/configure.in b/contrib/gdb/configure.in
index eb7fc71..baf9d73 100644
--- a/contrib/gdb/configure.in
+++ b/contrib/gdb/configure.in
@@ -14,8 +14,7 @@
## For more information on these two systems, check out the documentation
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
-# Free Software Foundation, Inc.
+# Copyright (C) 1992-99, 2000, 2001 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -48,10 +47,14 @@ if [ "${enable_gdbgui}" = "yes" ] ; then
host_libs="${host_libs} libgui"
fi
+libstdcxx_version="target-libstdc++-v3"
+# Don't use libstdc++-v3's flags to configure/build itself.
+libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
-host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
+host_tools="texinfo byacc flex bison binutils ld gas gcc cgen sid sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
@@ -59,10 +62,15 @@ host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr
target_libs="target-libiberty \
target-libgloss \
target-newlib \
- target-libio \
- target-librx \
- target-libstdc++ \
- target-libg++"
+ ${libstdcxx_version} \
+ target-libf2c \
+ target-libchill \
+ target-libffi \
+ target-libjava \
+ target-zlib \
+ target-boehm-gc \
+ target-qthreads \
+ target-libobjc"
# these tools are built using the target libs, and are intended to run only
# in the target environment
@@ -155,6 +163,9 @@ case "${host}" in
mips*-*-sysv*)
host_makefile_frag="${host_makefile_frag} config/mh-riscos"
;;
+ i370-ibm-opened*)
+ host_makefile_frag="${host_makefile_frag} config/mh-openedition"
+ ;;
i[3456]86-*-sysv5*)
host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
;;
@@ -185,11 +196,8 @@ case "${host}" in
i[3456]86-*-aix*)
host_makefile_frag="${host_makefile_frag} config/mh-aix386"
;;
- i[3456]86-*-go32*)
- host_makefile_frag="${host_makefile_frag} config/mh-go32"
- ;;
i[3456]86-*-msdosdjgpp*)
- host_makefile_frag="${host_makefile_frag} config/mh-go32"
+ host_makefile_frag="${host_makefile_frag} config/mh-djgpp"
;;
*-cygwin*)
host_makefile_frag="${host_makefile_frag} config/mh-cygwin"
@@ -197,6 +205,9 @@ case "${host}" in
*-mingw32*)
host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
;;
+ *-interix*)
+ host_makefile_frag="${host_makefile_frag} config/mh-interix"
+ ;;
*-windows*)
host_makefile_frag="${host_makefile_frag} config/mh-windows"
;;
@@ -224,9 +235,6 @@ case "${host}" in
*-*-lynxos*)
host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
;;
- *-*-aix4.[3456789]* | *-*-aix[56789].*)
- host_makefile_frag="${host_makefile_frag} config/mh-aix43"
- ;;
*-*-sysv4*)
host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
;;
@@ -277,25 +285,40 @@ esac
if [ x${shared} = xyes ]; then
case "${host}" in
- hppa*)
+ alpha*-*-linux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
+ ;;
+ arm*-*-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-armpic"
+ ;;
+ hppa*-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-papic"
;;
i[3456]86-*-cygwin*)
# We don't want -fPIC on Cygwin.
;;
- i[3456]86-*)
+ i[3456]86-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
;;
- sparc64-*)
+ i370-*-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-i370pic"
+ ;;
+ ia64-*-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-ia64pic"
+ ;;
+ sparc64-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
;;
- powerpc*-*)
+ powerpc*-*-aix*)
+ # We don't want -fPIC on AIX.
+ ;;
+ powerpc*-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
;;
- alpha*-*-linux*)
- host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
+ s390-* | s390x-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-s390pic"
;;
- *)
+ *-*-*)
if test -f ${srcdir}/config/mh-${host_cpu}pic; then
host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
fi
@@ -324,9 +347,15 @@ case "${target}" in
powerpc-*-netware*)
target_makefile_frag="${target_makefile_frag} config/mt-netware"
;;
- *-*-linux-gnu)
+ *-*-linux-gnu*)
target_makefile_frag="${target_makefile_frag} config/mt-linux"
;;
+ *-*-aix4.[3456789]* | *-*-aix[56789].*)
+ target_makefile_frag="${target_makefile_frag} config/mt-aix43"
+ ;;
+ mips*-*-pe | sh*-*-pe | *arm-wince-pe)
+ target_makefile_frag="${target_makefile_frag} config/mt-wince"
+ ;;
esac
# If --enable-target-optspace always use -Os instead of -O2 to build
@@ -336,8 +365,10 @@ case "${enable_target_optspace}:${target}" in
yes:*)
target_makefile_frag="${target_makefile_frag} config/mt-ospace"
;;
- # CYGNUS LOCAL d10v, d30v, fr30
- :m32r-* | :d10v-* | :d30v-* | :fr30-*)
+ :d30v-*)
+ target_makefile_frag="${target_makefile_frag} config/mt-d30v"
+ ;;
+ :m32r-* | :d10v-* | :fr30-*)
target_makefile_frag="${target_makefile_frag} config/mt-ospace"
;;
no:* | :*)
@@ -397,6 +428,18 @@ if [ ! -d ${target_subdir} ] ; then
fi
fi
+build_subdir=${build_alias}
+
+if [ x"${build_alias}" != x"${host}" ] ; then
+ if [ ! -d ${build_subdir} ] ; then
+ if mkdir ${build_subdir} ; then true
+ else
+ echo "'*** could not make ${PWD=`pwd`}/${build_subdir}" 1>&2
+ exit 1
+ fi
+ fi
+fi
+
copy_dirs=
# Handle --with-headers=XXX. The contents of the named directory are
@@ -511,20 +554,17 @@ case "${host}" in
noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
;;
i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
- noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
+ noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext libffi"
;;
i[3456]86-*-mingw32*)
# noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
- noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
+ noconfigdirs="expect dejagnu cvs autoconf automake send-pr rcs guile perl texinfo apache inet libtool"
;;
+ i[3456]86-*-beos*)
+ noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
+ ;;
*-*-cygwin*)
- noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
- ;;
- *-*-windows*)
-# This is only used to build WinGDB...
-# note that powerpc-eabi depends on sim configured before gdb.
- configdirs="bfd libiberty opcodes readline sim gdb"
- target_configdirs=
+ noconfigdirs="autoconf automake send-pr rcs guile perl apache inet"
;;
*-*-netbsd*)
noconfigdirs="rcs"
@@ -532,18 +572,48 @@ case "${host}" in
ppc*-*-pe)
noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
;;
+ powerpc-*-beos*)
+ noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
+ ;;
esac
+# Save it here so that, even in case of --enable-libgcj, if the Java
+# front-end isn't enabled, we still get libgcj disabled.
+libgcj_saved=$libgcj
+case $enable_libgcj in
+yes)
+ # If we reset it here, it won't get added to noconfigdirs in the
+ # target-specific build rules, so it will be forcibly enabled
+ # (unless the Java language itself isn't enabled).
+ libgcj=
+ ;;
+no)
+ # Make sure we get it printed in the list of not supported target libs.
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+esac
+
case "${target}" in
+ *-*-netbsd*)
+ # Skip some stuff on all NetBSD configurations.
+ skipdirs="$skipdirs target-newlib target-libiberty target-libgloss"
+
+ # Skip some stuff that's unsupported on some NetBSD configurations.
+ case "${target}" in
+ *)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+ esac
+ ;;
*-*-netware)
- noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss target-libffi"
;;
*-*-rtems*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
*-*-vxworks*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
alpha*-dec-osf*)
# ld works, but does not support shared libraries. emacs doesn't
@@ -552,90 +622,101 @@ case "${target}" in
noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
;;
alpha*-*-*vms*)
- noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
- ;;
- alpha*-*-linux*)
- # newlib is not 64 bit ready
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- # linux has rx in libc
- skipdirs="$skipdirs target-librx"
+ noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss target-libffi"
;;
alpha*-*-*)
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+ noconfigdirs="$noconfigdirs target-libjava target-libffi target-zlib"
+ noconfigdirs="$noconfigdirs target-boehm-gc target-qthreads target-examples"
+ noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
+ noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
+ noconfigdirs="$noconfigdirs expect dejagnu"
+ # the C++ libraries don't build on top of CE's C libraries
+ noconfigdirs="$noconfigdirs ${libstdcxx_version}"
+ skipdirs="$skipdirs target-newlib"
+ case "${host}" in
+ *-*-cygwin*) ;; # keep gdb and readline
+ *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
+ ;;
+ esac
+ ;;
arc-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
arm-*-pe*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
- arm-*-coff*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- arm-*-elf*)
- noconfigdirs="$noconfigdirs target-libgloss"
- if [ x${is_cross_compiler} != xno ] ; then
- target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
- fi
- ;;
arm-*-oabi*)
- noconfigdirs="$noconfigdirs target-libgloss"
- if [ x${is_cross_compiler} != xno ] ; then
- target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
- fi
- ;;
- c4x-*-*)
- noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
thumb-*-coff)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
-# CYGNUS LOCAL clm/arm-elf
thumb-*-elf)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
thumb-*-oabi)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
-# END CYGNUS LOCAL
-# CYGNUS LOCAL nickc/strongarm
strongarm-*-elf)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
- target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
strongarm-*-coff)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libffi"
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
+ fi
;;
-# END CYGNUS LOCAL
- thumb-*-pe) # CYGNUS LOCAL nickc/thumb
- noconfigdirs="$noconfigdirs target-libgloss"
+ xscale-*-elf)
+ noconfigdirs="$noconfigdirs target-libffi"
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
+ fi
+ ;;
+ xscale-*-coff)
+ noconfigdirs="$noconfigdirs target-libffi"
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
+ fi
+ ;;
+ thumb-*-pe)
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
arm-*-riscix*)
- noconfigdirs="$noconfigdirs ld target-libgloss"
+ noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
+ ;;
+ c4x-*-*)
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
+ ;;
+ c54x*-*-* | tic54x-*-*)
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi gcc gdb newlib"
;;
d10v-*-*)
- noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
-# CYGNUS LOCAL d30v
d30v-*-*)
;;
-# END CYGNUS LOCAL
-# CYGNUS LOCAL fr30
fr30-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
;;
-# END CYGNUS LOCAL
- h8300*-*-* | \
+ h8300*-*-*)
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
h8500-*-*)
- noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
hppa*-*-*elf* | \
- hppa*-*-lites*)
+ hppa*-*-linux-gnu* | \
+ hppa*-*-lites* | \
+ hppa*64*-*-*)
# Do configure ld/binutils/gas for this case.
;;
hppa*-*-*)
@@ -646,7 +727,17 @@ case "${target}" in
"" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
*) ;;
esac
- noconfigdirs="$noconfigdirs ld shellutils"
+ # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
+ # build on HP-UX 10.20.
+ noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
+ ;;
+ ia64*-*-elf*)
+ # No gdb support yet.
+ noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
+ ;;
+ ia64*-**-hpux*)
+ # No gdb or ld support yet.
+ noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld"
;;
i[3456]86-*-coff | i[3456]86-*-elf)
if [ x${is_cross_compiler} != xno ] ; then
@@ -655,15 +746,11 @@ case "${target}" in
;;
i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
# but don't build gdb
- noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
- ;;
- *-*-linux*)
- # linux has rx in libc
- skipdirs="$skipdirs target-librx"
+ noconfigdirs="$noconfigdirs gdb ${libstdcxx_version} target-libffi"
;;
i[3456]86-*-mingw32*)
target_configdirs="$target_configdirs target-mingw"
- noconfigdirs="$noconfigdirs expect target-libgloss"
+ noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
# Can't build gdb for mingw32 if not native.
case "${host}" in
@@ -674,7 +761,7 @@ case "${target}" in
;;
*-*-cygwin*)
target_configdirs="$target_configdirs target-libtermcap target-winsup"
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
@@ -686,15 +773,15 @@ case "${target}" in
esac
;;
i[3456]86-*-pe)
- noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
i[3456]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
# and is not configured to handle mixed ELF and COFF.
- noconfigdirs="$noconfigdirs ld target-libgloss"
+ noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
;;
i[3456]86-*-sco*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
+ noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
i[3456]86-*-solaris2*)
noconfigdirs="$noconfigdirs target-libgloss"
@@ -706,40 +793,52 @@ case "${target}" in
*) ;;
esac
# but that's okay since emacs doesn't work anyway
- noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
+ noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss target-libffi"
;;
- m68k-*-*)
+ i[3456]86-*-beos*)
+ noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
+ ;;
+ m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
+ noconfigdirs="$noconfigdirs target-libiberty target-librx target-libg++ target-libstdc++ target-libio target-libf2c target-libchill target-zlib target-libobjc"
+ ;;
+ m68k-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
- target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
+ fi
+ ;;
+ m68k-*-coff*)
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
mn10200-*-*)
- noconfigdirs="$noconfigdirs"
+ noconfigdirs="$noconfigdirs target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
fi
;;
mn10300-*-*)
- noconfigdirs="$noconfigdirs"
+ noconfigdirs="$noconfigdirs target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
;;
powerpc-*-aix*)
# copied from rs6000-*-* entry
- noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
- # This is needed until gcc and ld are fixed to work together.
- use_gnu_ld=no
+ use_gnu_ld=yes
;;
powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
target_configdirs="$target_configdirs target-winsup"
- noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
+ noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv target-libffi"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
;;
# This is temporary until we can link against shared libraries
powerpcle-*-solaris*)
- noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
+ noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv target-libffi"
+ ;;
+ powerpc-*-beos*)
+ noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
;;
powerpc-*-eabi)
if [ x${is_cross_compiler} != xno ] ; then
@@ -748,19 +847,17 @@ case "${target}" in
;;
rs6000-*-lynxos*)
# The CVS server code doesn't work on the RS/6000
- # Newlib makes problems for libg++ in crosses.
- noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
+ noconfigdirs="$noconfigdirs target-newlib gprof cvssrc target-libffi"
;;
rs6000-*-aix*)
- noconfigdirs="$noconfigdirs gprof"
- # This is needed until gcc and ld are fixed to work together.
- use_gnu_ld=no
+ noconfigdirs="$noconfigdirs gprof target-libffi"
+ use_gnu_ld=yes
;;
rs6000-*-*)
- noconfigdirs="$noconfigdirs gprof"
+ noconfigdirs="$noconfigdirs gprof target-libffi"
;;
m68k-apollo-*)
- noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
+ noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss target-libffi"
;;
mips*-*-irix5*)
# The GNU linker does not support shared libraries.
@@ -768,25 +865,29 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
;;
mips*-*-irix6*)
- # The GNU assembler and linker do not support IRIX 6.
+ # The GNU assembler does not support IRIX 6.
# emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
- noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
+ # Linking libjava exceeds command-line length limits on at least
+ # IRIX 6.2, but not on IRIX 6.5.
+ # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
+ # <oldham@codesourcery.com>
+ noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss ${libgcj}"
;;
mips*-dec-bsd*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
+ noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
mips*-*-bsd*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
+ noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
mipstx39-*-*)
- noconfigdirs="$noconfigdirs gprof" # same as generic mips
+ noconfigdirs="$noconfigdirs gprof target-libffi" # same as generic mips
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
;;
mips*-*-*)
- noconfigdirs="$noconfigdirs gprof"
+ noconfigdirs="$noconfigdirs gprof target-libffi"
;;
romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss target-libffi"
;;
sh-*-*)
case "${host}" in
@@ -795,7 +896,10 @@ case "${target}" in
i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
*) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
esac
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
+ ;;
+ sh64-*-*)
+ noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
;;
sparc-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
@@ -806,11 +910,13 @@ case "${target}" in
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
fi
+ noconfigdirs="$noconfigdirs target-libffi"
;;
sparclite-*-*)
if [ x${is_cross_compiler} != xno ] ; then
- target_configdirs="${target_configdirs} target-libstub target-cygmon"
+ target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
+ noconfigdirs="$noconfigdirs target-libffi"
;;
sparc-*-sunos4*)
if [ x${is_cross_compiler} != xno ] ; then
@@ -819,32 +925,43 @@ case "${target}" in
use_gnu_ld=no
fi
;;
+ sparc-*-solaris*)
+ case "${host}" in
+ sparc-*-solaris2.8)
+ # According to Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, libjava
+ # won't build correctly on Solaris 8 if there's a
+ # previously-installed version of GCC in the configured prefix.
+ # This problem does not show up on earlier versions of Solaris.
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+ esac
+ ;;
v810-*-*)
- noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
+ noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss target-libffi"
;;
v850-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
- v850e-*-*) # CYGNUS LOCAL v850e
- noconfigdirs="$noconfigdirs target-libgloss"
+ v850e-*-*)
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
v850ea-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;; # END CYGNUS LOCAL
+ noconfigdirs="$noconfigdirs target-libgloss target-libffi"
+ ;;
vax-*-vms)
- noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
+ noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss target-libffi"
;;
vax-*-*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
*-*-lynxos*)
- # Newlib makes problems for libg++ in crosses.
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
*-*-macos* | \
*-*-mpw*)
# Macs want a resource compiler.
configdirs="$configdirs grez"
+ noconfigdirs="$noconfigdirs target-libffi"
;;
esac
@@ -867,6 +984,61 @@ if [ x$with_gnu_as = xno ]; then
noconfigdirs="$noconfigdirs gas"
fi
+# Figure out what language subdirectories are present.
+# Look if the user specified --enable-languages="..."; if not, use
+# the environment variable $LANGUAGES if defined. $LANGUAGES might
+# go away some day.
+# NB: embedded tabs in this IF block -- do not untabify
+if test x"${enable_languages+set}" != xset; then
+ if test x"${LANGUAGES+set}" = xset; then
+ enable_languages="${LANGUAGES}"
+ echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+ else
+ enable_languages=all
+ fi
+else
+ if test x"${enable_languages}" = x ||
+ test x"${enable_languages}" = xyes;
+ then
+ echo configure.in: --enable-languages needs at least one language argument 1>&2
+ exit 1
+ fi
+fi
+enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'`
+
+subdirs=
+for lang in ${srcdir}/gcc/*/config-lang.in ..
+do
+ case $lang in
+ ..) ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+ ${srcdir}/gcc/[*]/config-lang.in) ;;
+ *)
+ lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
+ build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
+ if test "x$lang_alias" = x
+ then
+ echo "$lang doesn't set \$language." 1>&2
+ exit 1
+ fi
+ case ${build_by_default},${enable_languages}, in
+ *,$lang_alias,*) add_this_lang=yes ;;
+ no,*) add_this_lang=no ;;
+ *,all,*) add_this_lang=yes ;;
+ *) add_this_lang=no ;;
+ esac
+ if test x"${add_this_lang}" = xyes; then
+ eval target_libs='"$target_libs "'\"$this_lang_libs\"
+ else
+ eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs\"
+ fi
+ ;;
+ esac
+done
+
+
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
# $target_configdirs.
# If we have the source for $noconfigdirs entries, add them to $notsupp.
@@ -1007,6 +1179,12 @@ if [ x${shared} = xyes ]; then
i[3456]86-*)
target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
;;
+ ia64-*)
+ target_makefile_frag="${target_makefile_frag} config/mt-ia64pic"
+ ;;
+ powerpc*-*-aix*)
+ # We don't want -fPIC on AIX.
+ ;;
powerpc*-*)
target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
;;
@@ -1052,7 +1230,7 @@ rm -f conftest*
case "${host}" in
sparc-sun-solaris2*)
CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
- if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
+ if [ "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ] ; then
could_use=
[ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
if [ -d /opt/cygnus/bin ] ; then
@@ -1094,7 +1272,8 @@ if [ "${shared}" = "yes" ]; then
esac
fi
-# Record target_configdirs and the configure arguments in Makefile.
+# Record target_configdirs and the configure arguments for target and
+# build configuration in Makefile.
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
targargs=`echo "${arguments}" | \
sed -e 's/--no[^ ]*//' \
@@ -1103,6 +1282,11 @@ targargs=`echo "${arguments}" | \
-e 's/--bu[a-z-]*=[^ ]*//' \
-e 's/--ta[a-z-]*=[^ ]*//'`
+# For the build-side libraries, we just need to pretend we're native,
+# and not use the same cache file. Multilibs are neither needed nor
+# desired.
+buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${targargs}"
+
# Passing a --with-cross-host argument lets the target libraries know
# whether they are being built with a cross-compiler or being built
# native. However, it would be better to use other mechanisms to make the
@@ -1123,10 +1307,170 @@ if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib "
targargs="--with-newlib ${targargs}"
fi
-targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
+# Pass the appropriate --host, --build, and --cache-file arguments.
+targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
+
+# provide a proper gxx_include_dir.
+# Note, if you change the default, make sure to fix both here and in
+# the gcc, libio, and libstdc++ subdirectories.
+# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
+gxx_include_dir=
+if test -n "${with_gxx_include_dir}"; then
+ case "${with_gxx_include_dir}" in
+ yes )
+ echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
+ exit 1
+ ;;
+ no )
+ ;;
+ * )
+ gxx_include_dir=${with_gxx_include_dir}
+ ;;
+ esac
+fi
+if test x${gxx_include_dir} = x; then
+ if test x${enable_version_specific_runtime_libs} = xyes; then
+ gxx_include_dir='${libsubdir}/include/g++'
+ else
+ . ${topsrcdir}/config.if
+ gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
+ fi
+else
+ gxx_include_dir=${gxx_include_dir}
+fi
+
+FLAGS_FOR_TARGET=
+case " $skipdirs " in
+*" target-newlib "*) ;;
+*)
+ case "$target" in
+ *-cygwin*)
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;;
+ esac
+
+ # If we're not building GCC, don't discard standard headers.
+ if test -d ${topsrcdir}/gcc; then
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
+
+ if test "${build}" != "${host}"; then
+ # On Canadian crosses, CC_FOR_TARGET will have already been set
+ # by `configure', so we won't have an opportunity to add -Bgcc/
+ # to it. This is right: we don't want to search that directory
+ # for binaries, but we want the header files in there, so add
+ # them explicitly.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
+
+ # Someone might think of using the pre-installed headers on
+ # Canadian crosses, in case the installed compiler is not fully
+ # compatible with the compiler being built. In this case, it
+ # would be better to flag an error than risking having
+ # incompatible object files being constructed. We can't
+ # guarantee that an error will be flagged, but let's hope the
+ # compiler will do it, when presented with incompatible header
+ # files.
+ fi
+ fi
+
+ case "${target}-${is_cross_compiler}" in
+ i[3456]86-pc-linux*-no)
+ # Here host == target, so we don't need to build gcc,
+ # so we don't want to discard standard headers.
+ FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/'
+ ;;
+ *)
+ # If we're building newlib, use its generic headers last, but search
+ # for any libc-related directories first (so make it the last -B
+ # switch).
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
+ ;;
+ esac
+ ;;
+esac
+
+# On Canadian crosses, we'll be searching the right directories for
+# the previously-installed cross compiler, so don't bother to add
+# flags for directories within the install tree of the compiler
+# being built; programs in there won't even run.
+if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
+ # Search for pre-installed headers if nothing else fits.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
+fi
+
+if test "x${use_gnu_ld}" = x && test "x${with_gnu_ld}" != xno &&
+ echo " ${configdirs} " | grep " ld " > /dev/null &&
+ test -d ${srcdir}/ld; then
+ # Arrange for us to find uninstalled linker scripts.
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
+fi
+
+if test "x${CC_FOR_TARGET+set}" = xset; then
+ :
+elif test -d ${topsrcdir}/gcc; then
+ CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
+elif test "$host" = "$target"; then
+ CC_FOR_TARGET='$(CC)'
+else
+ CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
+fi
+# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
+# if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
+case $CC_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+
+if test "x${CHILL_FOR_TARGET+set}" = xset; then
+ :
+elif test -d ${topsrcdir}/gcc; then
+ CHILL_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/'
+elif test "$host" = "$target"; then
+ CHILL_FOR_TARGET='$(CC)'
+else
+ CHILL_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
+fi
+case $CHILL_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+
+if test "x${CXX_FOR_TARGET+set}" = xset; then
+ :
+elif test -d ${topsrcdir}/gcc; then
+ # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
+ # of g++ for linking C++ or Java, because g++ has -shared-libgcc by
+ # default whereas gcc does not.
+ CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+elif test "$host" = "$target"; then
+ CXX_FOR_TARGET='$(CXX)'
+else
+ CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
+fi
+case $CXX_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
+
+# We want to defer the evaluation of `cmd`s and shell variables in
+# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
+# bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
+# quotes, but we still have to duplicate `$'s so that shell variables
+# can be expanded by the nested make as shell variables, not as make
+# macros.
+qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
+
sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
- -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
+ -e "s%^TARGET_CONFIGARGS[ ]*=.*$%TARGET_CONFIGARGS = ${targargs}%" \
+ -e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
+ -e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
+ -e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
+ -e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
+ -e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \
-e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
+ -e "s%^BUILD_SUBDIR[ ]*=.*$%BUILD_SUBDIR = ${build_subdir}%" \
+ -e "s%^BUILD_CONFIGARGS[ ]*=.*$%BUILD_CONFIGARGS = ${buildargs}%" \
+ -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
Makefile > Makefile.tem
rm -f Makefile
mv -f Makefile.tem Makefile
diff --git a/contrib/gdb/gdb/CONTRIBUTE b/contrib/gdb/gdb/CONTRIBUTE
index 4f02ddf..96c943c 100644
--- a/contrib/gdb/gdb/CONTRIBUTE
+++ b/contrib/gdb/gdb/CONTRIBUTE
@@ -21,7 +21,7 @@ package. We welcome all of the above and feel free to ask on the GDB
mailing lists if you are looking for feedback or for people to review
a work in progress.
-Ref: http://sourceware.cygnus.com/gdb
+Ref: http://www.gnu.org/software/gdb/
Finally, there are certain legal requirements and style issues which
all contributors need to be aware of.
@@ -29,58 +29,29 @@ all contributors need to be aware of.
o Coding Standards
All contributions must conform to the GNU Coding Standard.
- http://www.gnu.ai.mit.edu/prep/standards_toc.html
Submissions which do not conform to the standards will be
returned with a request to reformat the changes.
- For GDB, that standard is more tightly defined. GDB's
- coding standard is determined by the output of
- gnu-indent.
+ GDB has certain additional coding requirements. Those
+ requirements are explained in the GDB internals documentation
+ in the gdb/doc directory.
- This situation came about because, by the start of '99,
- GDB's coding style was so bad an inconsistent that it was
- decided to restart things from scratch.
+ Ref: http://www.gnu.org/prep/standards_toc.html
o Copyright Assignment
- There are certain legal requirements
-
Before we can accept code contributions from you, we need a
- copyright assignment form filled out.
-
- If you've developed some addition or patch to GDB that you
- would like to contribute, you should fill out a copyright
- assignment form and send it in to the FSF. We are unable to
- use code from you until this is on-file at the FSF, so get
- that paperwork in! This form covers one batch of changes.
- Ref: http://gcc.gnu.org/fsf-forms/assignment-instructions.html
-
- If you think you're going to be doing continuing work on GDB, it
- would be easier to use a different form, which arranges to
- assign the copyright for all your future changes to GDB. It is
- called assign.future. Please note that if you switch
- employers, the new employer will need to fill out the
- disclaim.future form; there is no need to fill out the
- assign.future form again.
- Ref: http://gcc.gnu.org/fsf-forms/assign.future
- Ref: http://gcc.gnu.org/fsf-forms/disclaim.future
-
- There are several other forms you can fill out for different
- circumstances (e.g. to contribute an entirely new program, to
- contribute significant changes to a manual, etc.)
- Ref: http://gcc.gnu.org/fsf-forms/copyrights.html
-
- Small changes can be accepted without a copyright assignment
- form on file.
-
- This is pretty confusing! If you are unsure of what is
- necessary, just ask the GDB mailing list and we'll figure out
- what is best for you.
-
- Note: Many of these forms have a place for "name of
- program". Insert the name of one program in that place -- in
- this case, "GDB".
+ copyright assignment form filled out and filed with the FSF.
+
+ See some documentation by the FSF for details and contact us
+ (either via the GDB mailing list or the GDB maintainer that is
+ taking care of your contributions) to obtain the relevant
+ forms.
+
+ Small changes can be accepted without a copyright assignment form on file.
+
+ Ref: http://www.gnu.org/prep/maintain.html#SEC6
o Submitting Patches
@@ -98,18 +69,17 @@ o Submitting Patches
unlike some other projects, we do require ChangeLogs also for
documentation (i.e., .texi files).
- The patch itself. If you are accessing the CVS repository at:
- Cygnus, use "cvs update; cvs diff -c3p"; else, use "diff -c3p
- OLD NEW" or "diff -up OLD NEW". If your version of diff does
- not support these options, then get the latest version of GNU
- diff.
+ The patch itself. If you are accessing the CVS repository use
+ "cvs update; cvs diff -cp"; else, use "diff -cp OLD NEW" or
+ "diff -up OLD NEW". If your version of diff does not support
+ these options, then get the latest version of GNU diff.
We accept patches as plain text (preferred for the compilers
themselves), MIME attachments (preferred for the web pages),
or as uuencoded gzipped text.
When you have all these pieces, bundle them up in a mail
- message and send it to gdb-patches@sourceware.cygnus.com. All
+ message and send it to gdb-patches@sources.redhat.com. All
patches and related discussion should be sent to the
gdb-patches mailinglist. For further information on the GDB
CVS repository, see the Anonymous read-only CVS access and
@@ -151,3 +121,23 @@ o If ``gdb/configure.in'' is modified then you don't
The maintainer will re-generate those files
using autoconf (2.13 as of 2000-02-29).
+
+
+o If ``gdb/gdbarch.sh'' is modified, you don't
+ need to include patches to the generated files
+ ``gdbarch.h'' and ``gdbarch.c''.
+
+ See ``gdb/configure.in'' above.
+
+
+o When submitting a patch that fixes a bug
+ in GDB's bug database a brief reference
+ to the bug can be included in the ChangeLog
+ vis
+
+ * CONTRIBUTE: Mention PR convention.
+ Fix PR gdb/4705.
+
+ The text ``PR gdb/4705'' should also be included
+ in the CVS commit message. That causes the
+ patch to automatically be archived with the PR.
diff --git a/contrib/gdb/gdb/ChangeLog b/contrib/gdb/gdb/ChangeLog
index 0ae5117..5bc9ff7 100644
--- a/contrib/gdb/gdb/ChangeLog
+++ b/contrib/gdb/gdb/ChangeLog
@@ -1,1112 +1,3267 @@
-1999-04-07 Jim Blandy <jimb@zwingli.cygnus.com>
+2002-06-22 Andrew Cagney <ac131313@redhat.com>
- * GDB 4.18 released.
+ * NEWS: Mention below.
-1999-04-06 Jim Blandy <jimb@zwingli.cygnus.com>
+ Merge from mainline:
+ 2002-05-12 Fred Fish <fnf@redhat.com>:
+ * symfile.c (default_symfile_offsets): Arrange for uninitialized
+ sect_index_xxx members to index the first slot in section_offsets
+ if all of the section_offsets are zero.
- * README: Change revision numbers in text to "4.18".
- * Makefile.in (VERSION): Set to 4.18.
+2002-06-20 Elena Zannoni <ezannoni@redhat.com>
-1999-04-06 Stan Shebs <shebs@andros.cygnus.com>
+ * event-top.c (command_handler): Don't use space_at_cmd_start
+ unless there is sbrk() on the host. Assign time and space data
+ to union fields of the appropriate length.
- * solib.c (clear_solib): Don't call disable_breakpoints_in_shlibs,
- this breaks rerunning on sun4 native.
+2002-06-16 Andrew Cagney <ac131313@redhat.com>
-1999-04-05 Stan Shebs <shebs@andros.cygnus.com>
+ * NEWS: Mention below.
- * NEWS: Incorporate suggestions from David Taylor and Jason Molenda.
-
-1999-04-02 Jim Blandy <jimb@zwingli.cygnus.com>
+ Merge from mainline:
+ 2002-04-22 J. Brobecker <brobecker@gnat.com>:
+ * symfile.h (get_section_index): Define.
+ * symfile.c (get_section_index): New function.
+ * mdebugread.c (SC_IS_SBSS): New macro.
+ (SC_IS_BSS): Return true for the scBss storage class only, as
+ the scSBss storage class refers to the .sbss section.
+ (parse_partial_symbols): Discard the symbols which associated
+ section does not exist.
+ Make sure to use the .sbss section index for symbols which
+ storage class is scBss, rather than using the .bss section index.
- * README: Note that GDB requires an ANSI C compiler, and explain
- how to get GCC.
+2002-05-28 Theodore A. Roth <troth@verinet.com>
- * README: Update.
- It says we provide HTML documentation, but we don't.
- The instructions for building the .info files were wrong.
- It didn't mention that texinfo.tex was provided with GDB.
- It didn't mention the intl, texinfo, etc, or util directories.
- (Perhaps util would be best left unmentioned.)
- It didn't mention the --enable-build-warnings flag, or the --host
- flag.
- It didn't mention remote-array.c or remote-d10v.c.
- It had an old address for reporting bugs. It's now gdb@gnu.org.
- It mentioned xxgdb, which is obsolete, but didn't mention DDD.
+ * MAINTAINERS: Add myself as AVR maintainer.
+ * NEWS: Note new avr target.
- * config/sparc/nm-linux.h: Don't redefine PT_ATTACH to use the
- deprecated PTRACE_SUNATTACH compatibility commands. The
- definitions from <sys/ptrace.h> are fine.
+2002-06-07 Michal Ludvig <mludvig@suse.cz>
-1999-04-01 Stan Shebs <shebs@andros.cygnus.com>
+ Merge from mainline:
- * NEWS: Add more notes about user-visible changes.
+ 2002-05-27 Michal Ludvig <mludvig@suse.cz>
-1999-04-01 Jim Blandy <jimb@zwingli.cygnus.com>
+ * x86-64-tdep.c (x86_64_skip_prologue): Remove obsolete
+ note. Let PC point right after the prologue before looking
+ up symbols.
- Fix for cross-debugging on an AIX host from Johanna Svenningsson:
- * ax-gdb.h (enum axs_lvalue_kind): Remove trailing comma from enum.
- * ax.h (enum agent_op, enum agent_flaws): Same.
- * tracepoint.h (enum actionline_type): Same.
- * config/xm-aix4.h: Add declaration for termdef.
+2002-05-28 Theodore A. Roth <troth@verinet.com>
-1999-03-31 Stan Shebs <shebs@andros.cygnus.com>
+ * Makefile.in: Add support for AVR target.
+ * configure.tgt: Add support for AVR target.
+ * avr-tdep.c: New file.
+ * config/avr/avr.mt: New file.
- * jv-lang.h (dynamics_objfile): Remove decl, conflicts with static
- decl in jv-lang.c.
+2002-05-23 Andrew Cagney <ac131313@redhat.com>
-1999-03-31 Jim Blandy <jimb@zwingli.cygnus.com>
+ From Ross Alexander at NEC Europe:
+ * config/pa/hpux11w.mh (NATDEPFILES): Add solib.o.
- Mon Mar 29 14:40:44 1999 David Taylor <taylor@ryobi.cygnus.com>
+2002-05-23 Andrew Cagney <ac131313@redhat.com>
- * valops.c (search_struct_field): revert HP merge change
- to this function -- it causes messages to be printed about
- member class ambiguity when the compiler is happy.
- (search_struct_field_aux): delete -- added as part of HP merge
- change; with aforementioned change it is no longer called.
+ * PROBLEMS: Mention s390 and FreeBSD 4.4 build problems.
-1999-03-26 Jim Blandy <jimb@zwingli.cygnus.com>
+2002-05-22 Michal Ludvig <mludvig@suse.cz>
- Merged change from Keith Seitz:
+ * dwarf2cfi.c (frame_state_for): Added safety check for a valid
+ fde->cie_ptr.
+ (dwarf2_build_frame_info): Corrected handling of eh_frame.
+ (dwarf2_build_frame_info): Add offset to fde->initial_location
+ so that frames of shared libraries are mapped correctly.
+ (execute_stack_op): Change type of 'result' from ULONGEST to
+ CORE_ADDR.
- 1999-03-16 Keith Seitz <keiths@cygnus.com>
+2002-05-14 Michal Ludvig <mludvig@suse.cz>
- * remote.c (reomte_binary_checked): New file global.
- (check_binary_download): New function to check if
- stub supports binary downloading that works with
- stubs that are not eight bit clean.
- (remote_write_bytes): Check for binary download capability
- and use it if available.
- Remove references to global remote_binary_length. What a hack.
- (putpkt_binary): New function.
- (putpkt): Call putpkt_binary.
- Use xor to escape trouble characters.
- * m32r-stub.c (bin2mem): Follow escape char convention change.
+ Merge from mainline:
- Applied patch from Stu Grossman:
+ 2002-05-14 Michal Ludvig <mludvig@suse.cz>
+ * dwarf2cfi.c (context_cpy): Copy registers correctly.
+ (update_context): Use __func__ in warnings.
+
+ 2002-05-07 Michal Ludvig <mludvig@suse.cz>
+ * dwarf2cfi.c: Code cleanup, removed unused variables,
+ added default labels to switch {} statements.
- Mon Feb 22 12:32:19 1999 Per Bothner <bothner@cygnus.com>
+2002-05-01 Andreas Schwab <schwab@suse.de>
- * jv-valprint.c (java_val_print): Restore line that somehow got lost.
+ * config/s390/s390.mh (NATDEPFILES): Remove solib.o, add
+ linux-proc.o and gcore.o.
-1999-03-24 Stan Shebs <shebs@andros.cygnus.com>
+2002-04-30 Michael Chastain <mec@shout.net>
- * Makefile (VERSION): Bump to 4.17.87.
+ Merge from trunk. This also fixes PR gdb/172.
- Attempt to sort out SCO-related configs.
- * configure.host (i[3456]86-*-sysv4.2*): Use instead of
- i[3456]86-*-sysv4.2MP and i[3456]86-*-sysv4.2uw2*.
- (i[3456]86-*-sysv5*): Recognize.
- * configure.tgt (i[3456]86-*-sco3.2v5*, i[3456]86-*-sco3.2v4*):
- Recognize.
+ 2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr>
-Wed Mar 24 01:01:27 1999 Andrew Cagney <cagney@sludge.cygnus.com>
+ Fix PR gdb/508.
+ * symfile.c (add_filename_language): Fix wrong xrealloc size argument.
- * rs6000-tdep.c (rs6000_software_single_step): Change SIGNAL to
- unsigned int.
+2002-04-29 GDB Administrator <gdbadmin@sourceware.cygnus.com>
- From Rodney Brown <rodneybrown@pmsc.com>:
- * target.h (enum thread_control_capabilities), breakpoint.h (enum
- bptype), breakpoint.c (enum insertion_state_t): Strict ISO-C
- doesn't allow trailing comma in enum definition.
-
-1999-03-23 Jason Molenda (jsm@bugshack.cygnus.com)
+ * version.in: Bump to version 5.2.0-0000-00-00-cvs.
- * hppa-tdep.c (pa_register_look_aside): Remove CPU_HPPA_RISC_20
- check, test for presence of struct save_state_t and the ss_wide
- member directly.
- * configure.in: Remove CPU_HPPA_RISC_20 test. Add tests for
- HAVE_STRUCT_SAVE_STATE_T and HAVE_STRUCT_MEMBER_SS_WIDE.
- * acconfig.h: Add HAVE_STRUCT_SAVE_STATE_T HAVE_STRUCT_MEMBER_SS_WIDE.
- * configure, config.in: Regenerated.
+2002-04-26 GDB Administrator <gdbadmin@sourceware.cygnus.com>
-Tue Mar 23 17:22:57 1999 Philippe De Muyter <phdm@macqel.be>
+ GDB 5.2 Released.
+ * version.in: Update to version 5.2.
- * remote.c, parse.c: Include ctype.h.
+2002-04-26 Michal Ludvig <mludvig@suse.cz>
-Mon Mar 22 13:25:13 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+ * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging
+ code without frame pointers.
- * infttrace.c (proc_wait): rename to ptrace_wait.
+2002-04-25 Andrew Cagney <ac131313@redhat.com>
-1999-03-17 Jason Molenda (jsm@bugshack.cygnus.com)
+ * README: Update to GDB 5.2.
- * configure.in (HAVE_MULTIPLE_PROC_FDS): Don't define for Solaris
- hosts--gdb doesn't support this yet.
- * configure: Regenerated.
+2002-04-19 Eli Zaretskii <eliz@is.elta.co.il>
-Tue Mar 16 01:11:33 1999 Andrew Cagney <cagney@rhino.cygnus.com>
+ * config/djgpp/README: Update.
- * target.h (struct target_ops), target.c (debug_to_query),
- remote.c (pack_hex_byte, remote_query): Promote char parameters to
- int. Stops compile problems with pedantic ISO-C compilers.
+ * go32-nat.c (store_register): Cast &a_tss to `char *', to avoid
+ compiler warning.
-Tue Mar 16 15:29:04 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-04-18 GDB Administrator <gdbadmin@sourceware.cygnus.com>
- * jv-lang.c, jv-lang.h (java_primitive_type): Declare argument
- as int instead of char.
+ * version.in: Bump to version 5.1.91.
-1999-03-15 Jim Blandy <jimb@zwingli.cygnus.com>
+2002-04-15 Andrew Cagney <ac131313@redhat.com>
- Merged changes for binary downloads from Michael Snyder:
-
- Fri Mar 12 13:11:48 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+ * PROBLEMS: Mention hppa2.0-hp-hpux10.20 compile problems.
- * remote.c (remote_write_bytes): fix 'X' packet protocol so that it
- can't overwrite the end of its buffer with escaped characters.
+2002-04-15 Pierre Muller <muller@ics.u-strasbg.fr>
-1999-03-12 Jim Blandy <jimb@zwingli.cygnus.com>
+ Merge from trunk:
- Merged changes for HP/UX 9 from Jason Molenda:
+ 2002-04-09 Pierre Muller <muller@ics.u-strasbg.fr>
- 1999-03-08 Jason Molenda (jsm@bugshack.cygnus.com)
+ * p-exp.y (yylex): Handle also the fact that is_a_field_of_this
+ is non zero as a found symbol.
- * infttrace.c (hppa_get_process_events): Removed. Function only
- usable on HPUX 10 and above. It is not called by any other part
- of GDB.
- * hppah-nat.c (hppa_get_process_events): Ditto.
- (child_pid_to_exec_file): Only call ptrace with PT_GET_PROCESS_PATHNAME
- if that symbol has been defined.
- * config/pa/nm-hppah.h: Don't set up prototypes et al for
- hppa_get_process_events.
+2002-04-15 Andrew Cagney <ac131313@redhat.com>
+
+ * bcache.c: Include <stddef.h> and <stdlib.h> after "defs.h".
+ Update copyright.
- * config/pa/hppahpux.mh (TERM_LIB): Do not initialize, let autoconf
- determine best library automatically.
- * config/pa/hpux1020.mh: Ditto.
- * config/pa/hpux1100.mh: Ditto.
- * configure.in (TERM_LIB): Also check for libHcurses.
- * configure: Regenerated.
+ * hpread.c (hpread_getlntt): Add declaration.
+ Also fix PR gdb/391.
- Merged changes to accomodate the Hurd:
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * acinclude.m4 (AM_PROG_CC_STDC): Import from automake 1.6.
+ * aclocal.m4, configure: Re-generate.
+ Fix PR gdb/391.
- Thu Mar 11 18:05:11 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+2002-04-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * MAINTAINERS (sh-elf): Change warning flag to ,-Werror.
+
+2002-04-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * remote-e7000.c (write_small, e7000_read_inferior_memory,
+ e7000_read_inferior_memory_large, e7000_insert_breakpoint,
+ e7000_remove_breakpoint): Use paddr_nz() to print addresses.
+
+2002-04-10 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (child_resume, child_xfer_memory): Delete.
+ (PTRACE_XFER_TYPE): Moved to config/i386/nm-x86-64.h.
+ (kernel_u_size): Added.
+ * config/i386/nm-x86-64.h (CHILD_XFER_MEMORY, CHILD_RESUME): Delete.
+ (PTRACE_XFER_TYPE): Moved here from config/i386/nm-x86-64.h.
+
+2002-04-08 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ from 2002-03-22 Christopher Faylor <cgf@redhat.com> patch
+ in main branch.
+ * win32-nat.c (child_create_inferior): Check for proper shell to use
+ here, in case the user changes it on the fly.
+ (_initialize_inftarg): Remove shell path considerations.
+
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ I believe Jeff Law denies responsability for this one:
+ * config/pa/hpux11w.mh (MH_CFLAGS): Add -Dvfork=fork.
+ * config/pa/hpux11.mh (MH_CFLAGS): Add -Dvfork=fork.
+ * config/pa/hpux1020.mh (MH_CFLAGS): Add -Dvfork=fork.
+ Work-around for PR gdb/366.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Misc): List Daniel Jacobowitz as the GDBSERVER
+ maintainer.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * README (Reporting Bugs in GDB): Document the bug web page as the
+ prefered way of submitting bugs.
+ Fix PR gdb/402.
+
+2002-04-07 Andreas Schwab <schwab@suse.de>
+
+ * m68klinux-nat.c (fill_fpregset): Properly pass address of
+ buffer to regcache_collect.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from trunk:
+
+ 2002-03-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * dbxread.c (process_one_symbol): Extend the first N_SLINE
+ in a function to cover the entire beginning of the function
+ as well if it does not already.
+
+2002-04-04 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI
+ change sync with glibc.
+
+2002-04-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * rs6000-tdep.c: Change #include of "bfd/libcoff.h"
+ and "bfd/libbfd.h" to "libcoff.h" and "libbfd.h".
+
+2002-03-29 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from trunk:
+
+ 2002-03-27 Daniel Jacobowitz <drow@mvista.com>
- * infptrace.c (proc_wait): Rename to ptrace_wait.
- * inftarg.c (child_wait): call ptrace_wait instead of proc_wait.
- * inferior.h: Declare ptrace_wait instead of proc_wait.
+ * gdbserver/server.c (main): Call target_signal_to_host_p
+ and target_signal_to_host on signals received from the remote.
+ * gdbserver/remote-utils.c (prepare_resume_reply): Call
+ target_signal_from_host on signals sent to the remote.
+ * gdbserver/server.h: Add prototypes. Include "gdb/signals.h".
+ * gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}.
-1999-03-11 Jim Blandy <jimb@zwingli.cygnus.com>
- * Makefile.in (VERSION): click to 4.17.86, for next snapshot.
+ 2002-03-20 Martin M. Hunt <hunt@redhat.com>
-1999-03-09 Rodney Brown <RodneyBrown@pmsc.com>
+ * gdbserver/remote-utils.c (remote_open): Don't call
+ getprotobyname, we're all using TCP here so just use
+ IPPROTO_TCP.
+ * gdbserver/gdbreplay.c (remote_open): Ditto.
- Get working on UnixWare 2.1.1.
- * acconfig.h: Update for defines for procfs.c.
- * configure.in: Identify defines for procfs.c.
- * configure.host: i386-*-sysv4.2uw2* => i386v42mp
- * configure.tgt: i386-*-sysv4.2uw2* => i386v42mp
- * configure, config.in: Regenerate.
- * procfs.c: Rename HAVE_NO_PRRUN_T to HAVE_PRRUN_T (autoconf
- standard), wrap UNIXWARE difference in THE_PR_LWP macro for
- legibility.
- * config/i386/tm-i386v42mp.h: Remove HAVE_PSTATUS_T,
- HAVE_NO_PRRUN_T; now set by configure.
-1999-03-04 Jim Blandy <jimb@zwingli.cygnus.com>
+ 2002-03-13 Michal Ludvig <mludvig@suse.cz>
- Merged changes from Jason Molenda:
+ * gdbserver/remote-util.c (remote_open): Print remote-side's
+ IP address when remote debugging over the network.
+
+2002-03-29 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from trunk:
+ 2002-03-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals/signals.c: Include "server.h" in gdbserver build.
+ (target_signal_from_name): Don't use STREQ.
+ (_initialize_signals): Likewise. Don't include function in
+ gdbserver build.
+
+2002-03-29 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from trunk:
+ * signals/signals.c: New file, copied from signals.c.
+
+2002-03-27 Andrew Cagney <ac131313@redhat.com>
+
+ From veksler at il.ibm.com:
+ * utils.c (gdb_realpath): If canonicalize_file_name fails, return
+ the xstrduped original path.
+ Fix PR gdb/417.
+
+ From 2002-03-14 Richard Henderson <rth@redhat.com>
+ * configure.in: Detect declaration for canonicalize_file_name.
+ * utils.c (canonicalize_file_name): Declare, if needed.
+ (gdb_realpath): Prefer realpath if available and usable.
+ * config.in, configure: Rebuild.
+
+2002-03-27 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_skip_prologue): Rewritten from scratch.
+ * x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines.
+ (x86_64_num_regs, x86_64_num_gregs): Added extern variables.
+ * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS.
+ (x86_64_linux_dr_get_status, supply_gregset),
+ (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs.
+ * x86-64-tdep.c (x86_64_register_raw_size_table): Delete.
+ (x86_64_register_info_table): Add.
+ (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add.
+ (x86_64_register_raw_size, x86_64_register_virtual_type),
+ (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new
+ general x86_64_register_info_table.
+ (i386_gdbarch_init): gdbarch_register_bytes is now set
+ dynamicaly during initialization.
+ * regformats/reg-x86-64.dat: Synced with changes to registers above.
+ * gdbserver/linux-x86-64-low.c: Ditto.
- 1999-02-24 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-03-27 Andreas Jaeger <aj@suse.de>
+
+ * dwarf2cfi.c: Give credit to Daniel Berlin, reformat copyright
+ comment.
+
+2002-03-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * coffread.c: Remove redundant static declarations. Replace
+ occurrences of `PTR' with `void *'.
+ * elfread.c, mdebugread.c, minsyms.c, mipsread.c: Likewise.
+ * top.h (quit_cover): Likewise.
+ * defs.h (catch_errors): Likewise.
+
+2002-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (sh-elf): Change warning flag to -w.
+
+2002-03-20 David O'Brien <obrien@FreeBSD.org>
+
+ * sparc-nat.c: Include sys/param.h where possible.
+
+2002-03-12 David O'Brien <obrien@FreeBSD.org>
+
+ * config/sparc/fbsd.mh: Fix copyright.
+ * config/sparc/fbsd.mt: Likewise.
+
+2002-03-09 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Jim Ingham and Klee Dienes to ``write after
+ approval''.
+
+2002-03-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long.
+ (num_regs, regmap): Move inside HAVE_LINUX_USRREGS.
+ (register_addr, REGISTER_RAW_SIZE): Likewise.
+ (usr_store_inferior_registers): Use PTRACE_XFER_TYPE.
+ * gdbserver/linux-x86-64-low.c: Remove extra #endif.
+
+2002-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX.
+ * configure: Rebuilt.
+
+2002-03-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (_initialize_m68hc11_tdep): Don't set tm_print_insn.
+ (m68hc11_gdbarch_init): But use set_gdbarch_print_insn instead.
+
+2002-03-05 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Past Maintainers): Add Frank Ch. Eigler.
+
+2002-03-05 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Fix Mac OS X and Objective-C/C++.
+
+2002-03-05 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Update headings, 5.2 has branched.
+
+2002-03-01 David O'Brien <obrien@FreeBSD.org>
+
+ * configure.host (sparc64-*-freebsd): Add.
+ * configure.tgt: Likewise.
+ * config/sparc/fbsd.mh: New file.
+ * config/sparc/fbsd.mt: Likewise.
+ * config/sparc/nm-fbsd.h: Likewise.
+ * config/sparc/tm-fbsd.h: Likewise.
- * configure.in: Set CPU_HPPA_RISC_20 if the host CPU is a PA 2.0
- processor.
- * acconfig.h: Add CPU_HPPA_RISC_20
+2002-03-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/djgpp/fnchange.lst: Add regformats/reg-i386-linux.dat and
+ regformats/reg-s390x.dat.
+
+2002-03-01 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c: Add FIXME explaining true/false problem.
+
+2002-02-28 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Past Maintainers): Add J.T. Conklin.
+
+2002-02-28 Michael Chastain <mec@shout.net>
+
+ * MAINTAINERS: Fix typo: gdb.satbs -> gdb.stabs .
+
+2002-02-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-s390-low.c: New file.
+ * regformats/reg-s390.dat: New file.
+ * regformats/reg-s390x.dat: New file.
+ * gdbserver/configure.srv: Add S/390.
+ * gdbserver/Makefile.in: Add S/390.
+ * configure.tgt: Enable gdbserver for S/390.
+
+2002-02-28 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (_initialize_go32_nat): Don't use periods in the
+ first line of the doc string for "info dos", except at the end of
+ the sentence, since the short help stops at the first period.
+
+2002-02-28 Jason Merrill <jason@redhat.com>
+
+ * dwarf2read.c (dwarf_cfi_name): Add new codes.
+
+2002-02-27 Fred Fish <fnf@redhat.com>
+
+ * blockframe.c (generic_fix_call_dummy): Fix obvious typo in
+ comment (dumy -> dummy).
+
+2002-02-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * symtab.c (gdb_mangle_name): Handle fully mangled v3 abi physnames.
+
+2002-02-27 Rodney Brown <rbrown64@csc.com.au>
+
+ * utils.c (gdb_realpath): Add pathconf fallback for sco3.2v5.
+
+2002-02-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/acconfig.h: New file.
+ * gdbserver/i387-fp.c: New file.
+ * gdbserver/i387-fp.h: New file.
+ * gdbserver/linux-x86-64.c: New file.
+ * regformats/reg-x86-64.dat: New file.
+ * configure.tgt: Add x86_64-*-linux* gdbserver support.
+ * gdbserver/configure.srv: Add x86_64-*-linux* and regset support.
+ * gdbserver/configure.in: Add support for regsets.
+ * gdbserver/config.in: Regenerate.
+ * gdbserver/configure: Regenerate.
+ * gdbserver/Makefile.in: Likewise. Add $(linux_low_h).
+ * gdbserver/linux-low.h: New file.
+ * gdbserver/linux-low.c: Include "linux-low.h". Add support
+ for regsets.
+ * gdbserver/linux-arm-low.c: Include "linux-low.h".
+ * gdbserver/linux-ia64-low.c: Include "linux-low.h".
+ * gdbserver/linux-m68k-low.c: Include "linux-low.h".
+ * gdbserver/linux-mips-low.c: Include "linux-low.h".
+ * gdbserver/linux-ppc-low.c: Include "linux-low.h".
+ * gdbserver/linux-sh-low.c: Include "linux-low.h".
+ * gdbserver/linux-i386-low.c: Include "linux-low.h". Include
+ "i387-fp.h". Add PTRACE_GETREGS and friends.
+ * gdbserver/regcache.c (supply_register): New function.
+ (supply_register_by_name): New function.
+ (collect_register): New function.
+ (collect_register_by_name): New function.
+
+2002-02-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/Makefile.in (INTERNAL_CFLAGS): Remove -DGDBSERVER.
+ (config.status): Add configure.srv dependency.
+ (server_h): Add config.h dependency.
+
+2002-02-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * regformats/reg-i386-linux.dat: New file, with $orig_eax.
+ * gdbserver/Makefile.in: Add rules for reg-i386-linux.o.
+ * gdbserver/configure.srv: Change i386-*-linux* to use
+ reg-i386-linux.o.
+
+2002-02-26 Andrew Cagney <ac131313@redhat.com>
+
+ * x86-64-tdep.c: Re-indent. Update copyright date.
+
+2002-02-26 Andrew Cagney <ac131313@redhat.com>
+
+ From Michal Ludvig <mludvig@suse.cz>:
+ * x86-64-tdep.c (value.h): Delete.
+ (gdb_assert.h): Include.
+ (x86_64_register_convert_to_virtual,
+ x86_64_register_convert_to_raw ): Add check which lets only
+ floating-point values to be converted.
+ (value_push): Delete.
+ (x86_64_push_arguments): Order of arguments pushed on stack fixed.
+ (i386_gdbarch_init): Number of register_bytes fixed.
+
+2002-02-26 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add x86-64 target.
+
+2002-02-26 Andrew Cagney <ac131313@redhat.com>
+
+ * memattr.c (mem_command): Eliminate ``true'' and ``false''.
+ * osfsolib.c (solib_map_sections): Ditto.
+ * irix5-nat.c (solib_map_sections): Ditto.
+ * corelow.c (gdb_check_format): Ditto.
+ * symfile.c (symfile_bfd_open): Ditto.
+ * solib.c (solib_map_sections): Ditto.
+ Fix PR gdb/354.
+
+2002-02-26 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (_initialize_remote): By default, disable ``e'' and
+ ``E'' step out-of-range packets.
+
+2002-02-26 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/tm-linux.h (FRAME_SAVED_PC): Define as
+ m68k_linux_frame_saved_pc.
+ (IN_SIGTRAMP): Define as m68k_linux_in_sigtramp instead of
+ in_sigtramp.
+ (SIGCONTEXT_PC_OFFSET): Remove.
+ * m68klinux-nat.c (m68k_linux_frame_saved_pc,
+ m68k_linux_sigtramp_saved_pc): New functions.
+ (IS_SIGTRAMP, IS_RT_SIGTRAMP): Define.
+ (SIGCONTEXT_PC_OFFSET): Moved here from config/m68k/tm-linux.h.
+ (UCONTEXT_PC_OFFSET): Define.
+ (m68k_linux_in_sigtramp): Renamed from in_sigtramp, handle both
+ non-RT and RT signal trampolines.
+
+2002-02-26 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/arm/tm-embed.h (TARGET_UPAGES): Delete.
+ (TARGET_NBPG, STACK_END_ADDR): Delete
+ (VARIABLES_INSIDE_BLOCK): Delete.
+
+2002-02-25 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (perror_with_name): Make string parameter constant.
+ (print_sys_errmsg): Ditto.
+ (query): Ditto.
+ * defs.h (perror_with_name): Update.
+ (print_sys_errmsg): Update.
+ (query): Update.
+
+2002-02-25 Daniel Jacobowitz <drow@mvista.com>
+
+ From Eliot Dresselhaus <eliot@ayrnetworks.com>:
+ * gdbserver/linux-mips-low.c (cannot_fetch_register): Fix typo.
+
+2002-02-25 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * rs6000-nat.c (set_host_arch): Do not switch to a new architecture
+ if it already matches the current architecture from the exec file.
+ Include arch-utils.h for gdbarch_info_init prototype.
+ * Makefile.in (rs6000-nat.o): Update dependencies.
+
+2002-02-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/djconfig.sh: Set NM=nm and CFLAGS="-g -O2" in the
+ list of exported variables.
+
+2002-02-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/configure.srv: New file.
+ * gdbserver/configure.in: Use configure.srv instead
+ of the host/target makefile fragments. Set GDBSERVER_DEPFILES
+ from it.
+ * gdbserver/configure: Regenerated.
+ * gdbserver/terminal.h: New file.
+ * gdbserver/Makefile.in: Update for configure changes. Remove
+ more unneeded include paths.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ From wiz at danbala:
+ * config/sparc/tm-sp64.h: Fix grammar and typos.
+ Fix PR gdb/287.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ * lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux''
+ with either ``GNU/Linux'' or ``Linux kernel''. Update copyright.
+ * m68klinux-nat.c, sparc-linux-nat.c, x86-64-linux-nat.c: Ditto.
+ * x86-64-linux-tdep.c, gregset.h, gdb_wait.h: Ditto.
+ * ia64-linux-nat.c, infrun.c, linux-proc.c: Ditto.
+ * proc-service.c, i386-linux-tdep.c, ppc-linux-tdep.c: Ditto.
+ * s390-tdep.c: Ditto.
+ * config/nm-linux.h, config/alpha/nm-linux.h: Ditto.
+ * config/alpha/tm-alpha.h, config/alpha/tm-alphalinux.h:
+ * config/alpha/xm-alphalinux.h, config/i386/nm-linux.h: Ditto.
+ * config/i386/nm-x86-64.h, config/i386/tm-linux.h: Ditto.
+ * config/m68k/tm-linux.h, config/mips/nm-linux.h: Ditto.
+ * config/mips/tm-linux.h, config/mips/xm-linux.h: Ditto.
+ * config/powerpc/tm-linux.h, config/s390/nm-linux.h: Ditto.
+ * config/s390/tm-linux.h, config/sh/tm-linux.h: Ditto.
+ * config/sparc/nm-linux.h, config/sparc/tm-linux.h: Ditto.
+ * config/sparc/tm-sp64linux.h, config/sparc/xm-linux.h: Ditto.
+ Fix PR gdb/378.
+
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ * lin-thread.c: Delete file.
+ * configure.in (gdb_cv_struct_reg_r_gs): Update comment to refer
+ to gdb_proc_service.h.
+ * configure: Re-generate.
+
+ * ocd.c (ocd_open): Do not try to open the "ocd" device.
+ * serial.c (serial_open): Delete check for "ocd".
+ Fix PR gdb/349.
+
+ * Makefile.in (linux-thread.o): Delete target.
+ * linux-thread.c: Delete file.
+
+ * config/djgpp/fnchange.lst: Rename bfd/elf32-sh64.c. Tweak other
+ renamed SH files to be consistent.
+
+ * symtab.c (sort_search_symbols): Use xfree.
+
+2002-02-23 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-linux-tdep.c (arm_linux_init_abi): Register
+ IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE
+ * config/arm/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE): Replace old
+ definition with undef, since we don't want the sysvr4 definition.
+ (SKIP_TRAMPOLINE_CODE): Likewise.
+
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-02-22 Alfred M. Szmidt <ams@kemisten.nu>:
+
+ * configure.in: (AC_CHECK_FUNCS) Added test for
+ canonicalize_file_name Regenerated.
* config.in, configure: Regenerated.
- * hppa-tdep.c (pa_register_look_aside): Only refer to new
- structure elements if we are on a PA2.0 system.
- * defs.h: Include limits.h.
+ * utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is
+ defined use canonicalize_file_name.
- Merged changes from Stu Grossman:
-
- Wed Feb 17 10:10:27 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
+2002-02-23 Michael Chastain <mec@shout.net>
- * gdbtypes.h (get_discrete_bounds): Remove duplicate decl.
+ * MAINTAINERS: Remove Michael Chastain from "paper trail" list.
- * jv-typeprint.c (java_type_print_base): Change fputs => fputs_filtered.
-
- Mon Jan 25 18:30:57 1999 Per Bothner <bothner@cygnus.com>
-
- * jv-lang.h (JAVA_OBJECT_SIZE): Change from hard-wired constant.
- (java_primitive_type_from_name, get_java_object_header_size): Declare.
- * jv-lang.c (java_class_from_object): Use get_java_object_type.
- * jv-lang.c: Update Class field names: dtable->vtable,
- msize->method_count, nfields->field_count, bfsize->size_in_bytes,
- nmethods->method_count.
- (type_from_class): Demangle array type names.
- (java_link_class_type): Array type names are now demangled.
- (get_java_object_type): If not defined yet, try looking it up.
- (get_java_object_header_size): New function.
- (java_primitive_type_from_name): New function.
- (java_demangled_signature_length, java_demangled_signature_copy): New.
- (java_demangle_type_signature): Re-implement using above functions.
- (evaluate_subexp_java): For UNOP_IND, call evaluate_subexp_java
- to evaluate subexp (not evaluate_subexp_standard).
- For BINOP_SUBSCRIPT update for new array type naming scheme.
- * jv-valprint.c (java_value_print): Use java_class_from_object.
- Update array printing to new array type naming convention.
- (java_val_print): Doing check_typedef when printing a pointer is
- is a waste of effort. Also, handle TYPE_CODE_INT, to make sure
- Java bytes as not printed as C chars.
-
- Fri Jan 8 16:58:22 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
-
- * blockframe.c (find_pc_sect_partial_function): Search full symtabs as
- a last ditch effort (after the partial & minimal symtabs).
- * defs.h utils.c: Fixup prototypes for vprintf_filtered,
- vfprintf_filtered, vfprintf_unfiltered and vprintf_unfiltered to return
- ints to match their standard equivalents.
- * defs.h symtab.c top.c: Create skip_prologue_hook to allow Java to
- control the prologue skipping process.
- * jv-typeprint.c (java_type_print_base): Remove extern for
- jv_class_demangle, add new arg for objfile (NULL).
- * symtab.h: Remove struct sourcevector and struct source. Definately
- not needed.
- * values.c (value_virtual_fn_field): Fixes code to handle new vtable
- debug info format. Patch from marka.
-
- Wed Dec 16 23:11:25 1998 Stu Grossman <grossman@fencer.cygnus.com>
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
- * jv-lang.c (java_class_from_object java_class_is_primitive
- is_object_type): Change dtable to vtable.
- * (java_primitive_type): Change arg to type char.
- * (_initialize_java_language): Make java_char_type be unsigned.
- * jv-lang.h: Fixup prototypes.
-
- Mon Dec 7 19:02:15 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
-
- * jv-valprint.c (java_value_print): Fix printing of values where
- run time type != compile time type.
-
- Fri Dec 4 15:23:38 1998 Stu Grossman <grossman@fencer.cygnus.com>
-
- * Makefile.in: Whack out m2-typeprint.c.
- * c-typeprint.c (c_type_print_varspec_suffix) typeprint.h: Make this
- global. It's needed by Java.
- * (c_type_print_base): Whack prefix off of qualified method names
- (names with name spaces).
- * gdbtypes.h (struct cplus_struct_type): Add bits for Java attributes.
- Shrink voffset
- to 16 bits to compensate for added bits above (hopefully this is still
- enough).
- * Add new accessor macros (TYPE_FND_FIELD_PUBLIC, ...) for all new
- attribute bits.
- * jv-typeprint.c (java_type_print_base): Fix printing of method
- attributes. Handle JVM style manglings.
- * (java_print_type): Enable code type print varspec_suffix to allow
- array indices to print out.
- * jv-valprint.c (java_val_print): Minor formatting.
- * m2-lang.c (m2_language_d): Change m2_print_type to c_print_type.
- * stabsread.c (read_member_functions): Save public and static attributes.
-
-1999-03-02 Stan Shebs <shebs@andros.cygnus.com>
-
- From Gary Thomas <gthomas@cygnus.co.uk>:
- * arm-tdep.c (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT,
- THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Use illegal instruction
- instead of SWI 24.
- * config/arm/tm-arm.h (CALL_DUMMY): Ditto.
- (IN_SIGTRAMP): Define.
-
-1999-03-01 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in (TERM_LIB): Move the code which sets this to a
- better place.
-
-1999-02-25 Stan Shebs <shebs@andros.cygnus.com>
-
- * breakpoint.c (SOLIB_LOADED_LIBRARY_PATHNAME,
- SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_CREATE_CATCH_LOAD_HOOK,
- SOLIB_CREATE_CATCH_UNLOAD_HOOK): Supply default definitions.
- * infrun.c (SOLIB_IN_DYNAMIC_LINKER): Ditto.
-
-1999-02-23 Jim Blandy <jimb@zwingli.cygnus.com>
-
- Patch from Jason Molenda (jsm@bugshack.cygnus.com)
- * configure.in (TERM_LIB): Move checking for TERM_LIB, substituting.
- * configure, aclocal.m4, config.in: Regenerated.
-
-1999-02-22 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in (VERSION): Bump to 4.17.85, for the release process.
-
- Patch from Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- * breakpoint.c (watch_command_1): Reformat comment.
-
- Patch from Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- * c-typeprint.c (c_type_print_base): Reformat comments.
-
- Patch from Edith Epstein <eepstein@sophia.cygnus.com>:
- * config/pa/nm-hppah.h: Added prototype declarations for
- hppa_enable_page_protection_events and
- hppa_disable_page_protection_events.
-
- Patch from Edith Epstein <eepstein@sophia.cygnus.com>:
- * infttrace.c (hppa_insert_hw_watchpoint): Make sure that
- function always returns a value.
- (hppa_remove_hw_watchpoint): Make sure that function always
- returns a value.
-
- Patch from Edith Epstein <eepstein@sophia.cygnus.com>:
- * inftarg.c (child_wait): Fixed code that checks whether
- or not the target program has done a fork/vfork.
- related_pid does not have a value unless the target
- program has forked/vforked.
-
-1999-02-22 Jim Blandy <jimb@zwingli.cygnus.com>
+ * README: Remove references to cygnus.com.
+ * MAINTAINERS: Change Past Maintainer addresses to ``foo at bar
+ dot com'' form. Remove references to cygnus.com and sourceware.
- * tm-h8500.h, i386lynx-nat.c: Removed. These files are long
- dead; it seems that they only appeared due to some CVS weirdness.
- If they appear again, we may need to distribute garlic and holy
- water.
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
-1999-02-16 Jim Blandy <jimb@zwingli.cygnus.com>
+ From 2002-02-19 Paul Eggert <eggert@twinsun.com>:
+ * Makefile.in (VER): Change "head -1" to "sed q", since POSIX
+ 1003.1-2001 no longer allows "head -1".
+ * gdb/Makefile.in (version.c): Likewise.
+ * gdb/doc/Makefile.in (GDBvn.texi): Likewise.
+ * gdb/CONTRIBUTE: Change "diff -c3" to "diff -c", which is
+ equivalent. POSIX 1003.1-2001 no longer allows "diff -c3".
- * Makefile.in (VERSION): Bump to 4.17.2.
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
-Sun Feb 14 18:21:08 1999 Mark Alexander <marka@cygnus.com>
+ * cli/cli-decode.c (cmd_cfunc_eq): New function.
+ * command.h (cmd_cfunc_eq): Declare.
+ * cli/cli-decode.h (cmd_cfunc_eq): Ditto.
- * config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
- coffread.c will correctly handle char or short function parameters.
+ * cli/cli-cmds.h (is_complete_command): Change parameter to a
+ ``struct cmd_list_element *''.
+ * cli/cli-cmds.c (is_complete_command): Update. Use
+ cmd_cfunc_eq.
+ * top.c (execute_command): Pass the command to
+ is_complete_command.
+ * tracepoint.c: Replace function.cfunc with cmd_cfunc_eq.
-1999-02-11 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
- * configure, aclocal.m4: Regenerate with correct version of aclocal.
+ From 2002-02-20 Martin Schwidefsky <schwidefsky@de.ibm.com>:
+ * config/s390/tm-s390.h (GDB_TARGET_IS_ESAME): Use renamed
+ architecture defines.
+ * s390-tdep.c (s390_gdbarch_init): Likewise.
-1999-02-10 Syd Polk <spolk@cygnus.com>
+2002-02-23 Richard Earnshaw <rearnsha@arm.com>
- * acinclude.m4: Fix for new location of itclConfig.sh and itkConfig.sh.
- * aclocal.m4: Regnerate.
- * configure: Regenerate.
+ * arm-linux-tdep.c (arm_linux_extract_return_value): Make static.
+ (arm_linux_push_arguments): Likewise.
+ (arm_linux_init_abi): Register them. Also register linux-specific
+ call_dummy_words.
+ (find_minsym_and_objfile): Use strcmp, not STREQ.
+ * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Delete.
+ (arm_linux_call_dummy_words): Delete declaration.
+ (EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS): Delete.
+ (arm_linux_extract_return_value, arm_linux_push_arguments): Delete
+ declarations.
+ (LOWEST_PC): Delete.
-1999-02-10 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-02-23 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
- * demangle.c: Fix comments to mention "set demangle-style"
- instead of "set demangle".
- Run through indent to fix minor indenting problems.
+ * maint.c (print_section_info): Do not prepend `0x' to filepos
+ output, it will be handled by local_hex_string_custom.
-Wed Feb 10 17:53:09 1999 Bob Manson <manson@charmed.cygnus.com>
+2002-02-23 Richard Earnshaw <rearnsha@arm.com>
- * i386-tdep.c (gdb_print_insn_i386): Add missing returns.
+ * arm-linux-nat.c (store_newfpe_single): Use regcache_collect.
+ (store_newfpe_double, store_newfpe_extended, store_fpregister)
+ (store_register, store_regs, fill_gregset, fill_fpregset): Likewise.
-Wed Feb 10 13:17:21 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-02-22 Jim Blandy <jimb@redhat.com>
- Declare Gould configuration obsolete:
- * configure.host, configure.tgt: Comment out Gould configs.
- * Makefile.in: Comment out Gould-related actions.
- * gould-xdep.c, gould-tdep.c, config/gould/*: Comment out.
- * NEWS: Mention obsolete status.
+ Indicate that the bcache functions don't change the strings
+ they're passed.
+ * bcache.h (bcache, hash): Add `const' keywords to declarations.
+ * bcache.c (bcache, hash): Add `const' keywords to definitions.
-1999-02-09 DJ Delorie <dj@cygnus.com>
+2002-02-22 Pierre Muller <muller@ics.u-strasbg.fr>
- * sparcl-tdep.c: UDP download works in cygwin
+ * win32-nat.c (child_create_inferior): Fix create flags setting bug.
-1999-02-08 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-02-21 Christopher Faylor <cgf@redhat.com>
- * gnu-regex.c: Check ENABLE_NLS instead of HAVE_LIBINTL_H.
- * configure.in: Don't check for libintl.h.
- * configure, config.in: Regenerated.
+ * win32-nat.c (register_loaded_dll): Just use raw name when we can't
+ find the complete path to a loaded DLL.
-Mon Feb 8 18:10:50 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-02-21 Fred Fish <fnf@redhat.com>
- * NEWS: Mention new X packet and PowerPC variant support.
+ * dbxread.c (process_one_symbol): When finding an N_FUN symbol
+ that marks the end of the range of a function, enter a line number
+ entry that has a line number of zero and a PC offset that matches
+ the end of the function. This starts a range of PC's for which no
+ line number information is known.
+ * symtab.c (find_pc_sect_line): If our best fit is in a range of
+ PC's for which no line number info is found (line number is zero)
+ then we didn't find any valid line information.
+ * symtab.h: Document use of zero line number entry.
-1999-02-08 Nick Clifton <nickc@cygnus.com>
+2002-02-21 Elena Zannoni <ezannoni@redhat.com>
- * configure.host: Add support for StrongARM host.
- * configure.tgt: Add support for StrongARM target.
+ * ppc-linux-nat.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Define.
+ (have_ptrace_getvrregs): Define for run time checks.
+ (gdb_vrregset_t): New type for Altivec register handling.
+ (fetch_register, store_register): Fetch/store altivec register
+ when needed.
+ (fetch_altivec_register, store_altivec_register): New functions.
+ (supply_vrregset, fill_vrregset): New functions.
+ (fetch_altivec_registers, store_altivec_registers): New functions.
+ (fetch_ppc_registers, store_ppc_registers): Fetch/store altivec
+ registers as well.
-Mon Feb 8 12:05:05 1999 David Taylor <taylor@texas.cygnus.com>
+2002-02-21 Jiri Smid <smid@suse.cz>
- * dsrec.c (make_srec): Cast targ_addr to int in call to sprintf
- otherwise on big endian machine with a bfd_vma of 64 bits,
- *everything* gets loaded at location 0.
+ * config/i386/x86-64linux.mh (NATDEPFILES): Remove x86-64-nat.o.
-Mon Feb 7 10:05:43 1999 Frank Ch. Eigler <fche@cygnus.com>
+2002-02-21 Richard Earnshaw <rearnsha@arm.com>
- * infrun.c (wait_for_inferior): Allow SIGTRAP to be "pass"ed
- to target program.
+ * Makefile.in (armnbsd-nat.o): Update dependencies.
+ * armnbsd-nat.c (supply_gregset): New function. Common code to
+ supply the integer register set.
+ (supply_fparegset): New function. Similar for FPA registers.
+ (fetch_regs, fetch_fp_regs): Use them.
+ (fetch_core_registers): Likewise.
+ (fetch_elfcore_registers): New function.
+ (arm_netbsd_elfcore_fns): New core-file type specification.
+ (_initialize_arm_netbsd_nat): Register it.
-Fri Feb 5 16:46:14 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-02-21 Richard Earnshaw <rearnsha@arm.com>
- * NEWS: Add mentions of various new things.
+ * armnbsd-nat.c: Include gdbcore.h.
+ (FETCH_INFERIOR_REGISTERS): Just error if this isn't defined.
+ (fetch_regs, fetch_fp_regs, store_regs, store_fp_regs): Add explicit
+ 'void' to declaration, to shut up ARI.
+ (fetch_core_registers): Make static. Rewrite using supply_register.
+ (arm_netbsd_core_fns): New core-file type specification.
+ (_initialize_arm_netbsd_nat): New function.
-Thu Feb 4 00:19:14 1999 Christopher Faylor <cgf@cygnus.com>
+2002-02-21 Christopher Faylor <cgf@redhat.com>
- * configure.in: Move termcap determination later in the
- file to catch setting of cygwin flag.
- * configure: Regenerate.
+ * win32-nat.c (register_loaded_dll): Correctly check for invalid handle
+ value.
-Wed Feb 3 14:16:38 1999 Christopher Faylor <cgf@cygnus.com>
+2002-02-20 Christopher Faylor <cgf@redhat.com>
- * config/i386/cygwin.mh: Move TERMCAP test code to configure.in.
- * configure.in: Treat libtermcap.a detection as a special case
- when hosting on cygwin.
- * configure: Regenerate.
+ * win32-nat.c (register_loaded_dll): Handle case where FindFirstFile
+ fails.
-1999-02-03 Keith Seitz <keiths@cygnus.com>
-
- * remote.c (remote_binary_download, remote_binary_length): New
- static globals for dealing with binary transmissions.
- (remote_write_bytes): Add support for binary downloads
- by shadowing the "M" packet with a new "X" packet. This
- defaults to ON; if the stub does not understand this, it
- will fall back to using "M".
- (putpkt): Add support for binary downloading.
- * monitor.c (monitor_expect): The mon2000 monitor
- on the MSA2000 will also emit random DC1/DC3 chars.
- * m32r-stub.c: Change all char's to unsigned char's
- to support binary downloading.
- (handle_exception): Add support for binary downloading
- via a new "X" packet.
- (getpacket): Do NOT strip eighth bit of incoming chars.
- Watch out for escaped characters in the incoming stream.
- (putpacket): Do NOT strip eighth bit of incoming chars.
- (bin2mem): New function to write binary data directly to
- memory.
- * m32r-rom.c: Add new "mon2000" target.
-
-Tue Feb 2 18:40:29 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * hp-psymtab-read.c (hpread_build_psymtabs): Coerce first arg
- passed to make_cleanup to the correct type.
- (hpread_quick_traverse): Change fifth arg to call to
- hpread_end_psymtab to be 0.
- Compare CURR_MODULE_END to 0 rather than NULL.
- Get rid of ifdef'ed out code.
- (scan_procs): Get rid of ifdef'ed out code.
-
- * somread.c (som_symfile_read): Coerce first argument passed to
- make_cleanup to the correct type.
-
-Tue Feb 2 17:36:29 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * hp-psymtab-read.c (do_pxdb): New function. Check whether the
- file needs to be processed by pxdb (an HP debug info massaging
- tool), if so call it.
- (hpread_build_psymtabs): Initialize scan_start to 0 and
- simplify flow of control.
-
- * somread.c (som_symfile_read): Add call to do_pxdb (),
- in hp-psymtab-read.c.
-
- * symfile.c (symbol_file_add): Remove ifdef'ed out HPUX specific
- code.
- (symfile_bfd_open): Remove HPUXHPPA ifdef'ed code. Code is now
- in hp-psymtab-read.c.
+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * jv-exp.y (parse_number): Change type of implicit longs
+ to builtin_type_uint64.
+
+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (mywait): Change argument to waitpid
+ to be an integer instead of a `union wait'.
+
+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-linux-nat.c: Call the operating system GNU/Linux.
+ * mips-linux-tdep.c: Likewise.
+ * mips-tdep.c: Likewise.
+
+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/265.
+ * jv-exp.y (parse_number): Handle 64-bit integers.
+
+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/configure.in: Remove AM_PROC_CC_STDC. Change
+ AC_STDC_HEADERS to AC_HEADER_STDC.
+ * gdbserver/configure: Regenerated.
+
+2002-02-20 Richard Earnshaw <rearnsha@arm.com>
+
+ * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC
+ is defined.
+ * sparc-tdep.c (get_longjmp_target): Likewise.
+
+2002-02-20 Richard Earnshaw <rearnsha@arm.com>
+
+ * News: Add news about ARM and Multi-arch. Mention the new target
+ arm*-*-netbsd*.
+
+2002-02-19 Jim Blandy <jimb@redhat.com>
-1999-02-02 Martin Hunt <hunt@cygnus.com>
+ * stabsread.c (error_type_complaint): Improve error message.
- * printcmd.c (print_scalar_formatted): Use strcat to concat all
- the output together before calling fprintf_filtered().
+2002-02-19 Daniel Jacobowitz <drow@mvista.com>
-1999-02-01 Jason Molenda (jsm@bugshack.cygnus.com)
+ * gdbserver/README: Update documentation.
+ * gdbserver/configure.in: Update configury to match documentation.
+ * gdbserver/Makefile.in: Likewise.
+ * gdbserver/configure: Regenerated.
+ * gdbserver/aclocal.m4: New file, generated by aclocal.
+ * gdbserver/config.in: New file, generated by autoheader.
- * configure.in: Require autoconf 2.13.
- (AM_EXEEXT): Replace with new AC_EXEEXT.
- * acinclude.m4: Move itcl header macros from aclocal.m4 to here.
- * aclocal.m4: Regenerated.
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/djgpp/fnchange.lst: Add change rules for armnbsd-tdep.c and
+ armnbsd-nat.c.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.h (enum arm_float_model): New enum.
+ (struct gdbarch_tdep): Add fp_model.
+ * arm-tdep.c (arm_gdbarch_init): Set fp_model in tdep. Defer setting
+ up floating-point conversions until we know the floating-point model
+ in use by the inferior. Don't complain about being unable to
+ determine the ABI of the inferior when we don't have one.
+ (arm_extract_return_value): Support different floating-point models.
+ (arm_store_return_value): Likewise.
+ * armnbsd-tdep.c (arm_netbsd_aout_init_abi): Set fp_model in tdep to
+ ARM_FLOAT_SOFT.
+ (arm_netbsd_elf_init_abi): Set fp_model to ARM_FLOAT_SOFT_VFP.
+
+2002-02-19 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * i386-tdep.c (i386_gdbarch_init): Eliminate incorrect use
+ of ``current_gdbarch''.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * armnbsd-nat.c : ANSIfy all function declarations.
+ (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs): New.
+ (fetch_inferior_registers): Re-implement in terms of above.
+ (store_register, store_regs, store_fp_register, store_fp_regs): New.
+ (store_inferior_registers): Re-implement in terms of above.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-linux-nat.c: Linux -> GNU/Linux when not talking about the
+ kernel.
+ * arm-linux-tdep.c: Likewise.
+ * config/arm/tm-linux.h: Likewise.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch.
+ * config/arm/nbsd.mt (TM_FILE): Delete.
+ * config/arm/tm-nbsd.h: Delete.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_gdbarch_init): Initialize TARGET_CHAR_SIGNED.
+ Initialize CALL_DUMMY_LENGTH.
+
+2002-02-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * armnbsd-tdep.c (arm_netbsd_aout_in_solib_call_trampoline): New
+ function.
+ (arm_netbsd_aout_init_abi): Initialize IN_SOLIB_CALL_TRAMPOLINE.
+ * config/arm/tm-nbsd.h: Don't include config/tm-nbsd.h, it only
+ defines one thing and that is incorrect for this port.
+ (IN_SOLIB_CALL_TRAMPOLINE): Delete.
+
+2002-02-18 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * go32-nat.c: add i386-tdep.h include to import FP_REGNUM_P macro.
+
+2002-02-18 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * win32-nat.c (display_selector): New function. Displays information
+ about the information returned by GetThreadSelectorEntry API function.
+ (display_selectors): New function. Displays the infomation of
+ the selector given as argument, or of CS, DS ans FS selectors
+ if no argument is given.
+ ( _initialize_inftarg): Add "w32" as info prefix command.
+ Add "info w32 selector" as command calling display_selectors.
+
+2002-02-19 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * i386-tdep.c (get_longjmp_target): Fix compilation failure
+ by setting dummy values to JB_PC and JB_ELEMENT_SIZE
+ if not defined.
+
+2002-02-18 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/arm/nbsd.mt (TDEPFILES): Add solib-sunos.o.
+
+2002-02-18 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_set_call_dummy_breakpoint_offset): New function.
+ (arm_fix_call_dummy): Call it.
+ (arm_call_dummy_breakpoint_offset): Delete.
+ (arm_gdbarch_init): Initialize call_dummy_breakpoint_offset.
+ * config/arm/tm-arm.h (CALL_DUMMY_BREAKPOINT_OFFSET): Delete.
+
+2002-02-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2.
+ Default to func_frame_chain_valid.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * frame.h (FRAME_CHAIN_VALID): Delete definition.
+
+2002-02-18 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-linux-nat.c: Update copyright.
+ (fetch_register, store_register): Add tid parameter, don't compute
+ tid here.
+ (fetch_ppc_registers, store_ppc_registers): Add tid
+ parameter. Pass it along to callees.
+ (fetch_inferior_registers, store_inferior_registers): Compute tid
+ here, and pass it to calleed functions.
+ (fill_gregset, supply_fpregset): Clean up formatting.
+
+2002-02-18 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_gdbarch_init): Initialize coerce_float_to_double.
+ * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Delete.
+
+2002-02-18 Richard Earnshaw <rearnsha@arm.com>
+
+ * gdbarch.sh (GET_LONGJMP_TARGET): Add rule.
+ * gdbarch.c gdbarch.h: Regenerate.
+ * breakpoint.c (create_longjmp_breakpoint): Always compile this
+ function.
+ (breakpoint_reset): Test GET_LONGJMP_TARGET_P().
+ * infrun.c (GET_LONGJMP_TARGET): Delete default definition.
+ (handle_inferior_event): Test GET_LONGJMP_TARGET_P().
+
+ * arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields.
+ * arm-tdep.c (arm_get_longjmp_target): New function.
+ (arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes
+ this to a positive value register arm_get_longjmp_target as the
+ longjmp handler.
+ * arm-linux-tdep.c (arm_get_longjmp_target): Delete.
+ (arm_linux_init_abi): Set up longjmp description in tdep.
+ * armnbsd-nat.c (get_longjmp_target): Delete.
+ * armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp
+ description in tdep.
+ * config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete.
+ (get_longjmp_target): Delete declaration.
+ (GET_LONGJMP_TARGET): Delete.
+ * config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration.
+ (GET_LONGJMP_TARGET): Delete.
+
+2002-02-17 Kevin Buettner <kevinb@redhat.com>
+
+ From Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * ia64-tdep.c (ia64_gdbarch_init): Eliminate incorrect use
+ of ``current_gdbarch''.
+
+2002-02-17 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-cmds.c (compare_strings): New function.
+ (complete_command): Only print each unique item once.
+ * completer.h (complete_line): Declare.
+ * completer.c (complete_line): New function.
+ (line_completion_function): Use it.
+
+2002-02-16 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (TARGET_LONG_DOUBLE_BIT): Default to 64.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-02-16 Daniel Jacobowitz <drow@mvista.com>
+
+ * valarith.c (value_x_unop): Fix decrement; support post-decrement.
+
+2002-02-16 Daniel Jacobowitz <drow@mvista.com>
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>:
+ * valops.c (value_arg_coerce): Don't take the address of a reference
+ to convert an argument to a reference.
+
+2002-02-15 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (get_image_name): New function.
+ (handle_load_dll): Use get_image_name function.
+ (get_child_debug_event): Avoid registering debug events until possibly
+ execed process is started.
+ (child_create_inferior): Allow invocation via shell so that command
+ line redirection, etc. works ok.
+ (_initialize_inftarg): Add new command: "set shell" to control whether
+ a shell is used to start a process.
+
+2002-02-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-mips-low.c (cannot_fetch_register): Use find_regno
+ instead of find_register_by_number.
+ (cannot_store_register): Likewise.
+
+2002-02-14 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * dwarf2read.c: Replace fprintf (stderr, ...) by
+ fprintf_unfiltered (gdb_stderr, ...).
+
+2002-02-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/gdbserver.1: Document --attach.
+
+2002-02-15 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.h (struct gdbarch_tdep): Add fields for breakpoint
+ descriptions.
+ * arm-tdep.c (arm_default_arm_le_breakpoint)
+ (arm_default_arm_be_breakpoint, arm_default_thumb_le_breakpoint)
+ (arm_default_thumb_be_breakpoint): New. Initialize them from
+ traditional breakpoint defines.
+ (arm_breakpoint_from_pc): Use new gdbarch_tdep entries.
+ (arm_gdbarch_init): Initialize new breakpoint variables.
+ * arm-linux-tdep.c (arm_linux_arm_le_breakpoint): New.
+ (arm_linux_init_abi): Initialize linux-specific breakpoint.
+ * armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint): New.
+ (arm_netbsd_aout_init_abi, arm_netbsd_elf_init_abi): Split common
+ code out to ...
+ (arm_netbsd_init_abi_common): ... here; new function.
+ * config/arm/tm-arm.h (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT)
+ (THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Delete.
+ * config/arm/tm-linux.h (ARM_LE_BREAKPOINT): Delete.
+ * config/arm/tm-nbsd.h (ARM_LE_BREAKPOINT): Delete.
+
+2002-02-15 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.h (enum arm_abi): New enum.
+ (struct gdbarch_tdep): New structure.
+ (LOWEST_PC): Provide a default.
+ (arm_gdbarch_register_os_abi): Declare new function.
+ * arm-tdep.c (arm_abi_names): New array.
+ (process_note_abi_tag_sections): New function.
+ (get_elfosabi): New function.
+ (arm_gdbarch_register_os_abi): New function.
+ (arm_gdbarch_init): Try to determine the ABI of the inferior. If
+ support for that ABI has been built in, then call the appropriate
+ configuration routine. Use gdbarch_num_regs() to get the number
+ of registers.
+ (arm_dump_tdep): New function.
+ (arm_init_abi_eabi_v1, arm_init_abi_eabi_v2, arm_init_abi_apcs): New
+ place-holder functions.
+ (_initialize_arm_tdep): Register them.
+ * config/arm/tm-arm.h (LOWEST_PC): Delete.
+
+ * armnbsd-tdep.c: New file.
+ * Makefile.in (armnbsd-tdep.o): Add dependencies.
+ * config/arm/nbsd.mt (TDEPFILES): Add it.
+ * config/arm/tm-nbsd.h (LOWEST_PC): Delete.
+
+ * armnbsd-nat.c: Include regcache.h.
+ * Makefile.in (armnbsd-nat.o): Update dependency list.
+
+ * arm-tdep.c (arm_get_next_pc): Use printf_filtered for error message.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/Makefile.in: Fix typos in target rules.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix part of PR gdb/267.
+ * linespec.c (find_methods): Handle constructors specially for now.
+
+2002-02-14 Corinna Vinschen <vinschen@redhat.com>
+
+ * arm-tdep.c (arm_push_arguments): Eliminate special float type
+ handling.
+ * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Define to call
+ standard_coerce_float_to_double().
+
+2002-02-14 Christopher Faylor <cgf@redhat.com>
+
+ * config/i386/xm-cygwin.h: Revert inadvertent reinclusion of
+ GDBINIT_FILENAME.
+
+2002-02-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Don't call
+ find_variant_by_name, because it confuses the multiarch
+ framework. Return NULL if there isn't an architecture with the
+ user supplied name, instead of forcing a different one without
+ recording the change with the multiarch machinery.
+ (find_variant_by_name): Delete.
+
+2002-02-14 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * config/i386/i386sol2.mh (NATDEPFILES): Add i387-nat.o, needed by
+ i386v4-nat.o now. Add gcore.o, Solaris x86 supports gcore.
+
+2002-02-13 Martin M. Hunt <hunt@redhat.com>
+
+ * stack.c (print_frame_info_base): When calling
+ print_frame_info_listing_hook, set current_source_symtab.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS,
+ and remove unused $(INCLUDE_DIR).
+ Add regcache.c to OBS.
+ Add generated register protocol files to clean target.
+ Update dependencies for new objects, obsolete old target code.
+
+ * gdbserver/linux-low.c: Remove all platform-specific code to
+ new files. Remove various dead code. Update to use regcache
+ functionality.
+ * gdbserver/remote-utils.c (fromhex): Add return statement
+ to quiet warning.
+ (putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer
+ constant.
+ (input_interrupt): Add integer parameter to match prototype
+ of a signal handler.
+ (outreg): Use register_data ().
+ (prepare_resume_reply): Use gdbserver_expedite_regs.
+ * gdbserver/server.c (main): Dynamically allocate own_buf because
+ PBUFSIZ is no longer constant. Use registers_to_string () and
+ registers_from_string ().
+ * gdbserver/server.h: No longer include "defs.h". Add prototypes
+ for error (), fatal (), and warning (). Update definition of
+ PBUFSIZ to use regcache functionality. Add include guard.
+ * gdbserver/utils.c (fatal): Add missing ``const''.
+ (warning): New function.
+
+ * regformats/regdat.sh: Include "regcache.h" in generated files.
+ Provide init_registers () function.
+ * regformats/regdef.h: Add prototype for set_register_cache ().
+ Add include guard.
+
+ * gdbserver/linux-arm-low.c: New file.
+ * gdbserver/linux-i386-low.c: New file.
+ * gdbserver/linux-ia64-low.c: New file.
+ * gdbserver/linux-m68k-low.c: New file.
+ * gdbserver/linux-mips-low.c: New file.
+ * gdbserver/linux-ppc-low.c: New file.
+ * gdbserver/linux-sh-low.c: New file.
+
+ * gdbserver/regcache.c: New file.
+ * gdbserver/regcache.h: New file.
+
+ * gdbserver/low-linux.c: Removed obsolete file.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/arm/linux.mt: Update GDBSERVER_DEPFILES.
+ * config/i386/linux.mt: Likewise.
+ * config/ia64/linux.mt: Likewise.
+ * config/m68k/linux.mh: Likewise.
+ * config/powerpc/linux.mh: Likewise.
+ * config/mips/linux.mt: Likewise.
+
+ * config/sh/linux.mt: Add GDBSERVER_DEPFILES.
+
+ * config/i386/i386lynx.mh: Mark gdbserver variables
+ as (currently) obsolete for this target.
+ * config/i386/nbsd.mt: Likewise.
+ * config/i386/nbsdelf.mt: Likewise.
+ * config/m32r/m32r.mt: Likewise.
+ * config/m68k/m68klynx.mh: Likewise.
+ * config/m68k/nbsd.mt: Likewise.
+ * config/m68k/sun3os4.mh: Likewise.
+ * config/mips/vr5000.mt: Likewise.
+ * config/ns32k/nbsd.mt: Likewise.
+ * config/pa/hppabsd.mh: Likewise.
+ * config/pa/hppaosf.mh: Likewise.
+ * config/powerpc/nbsd.mt: Likewise.
+ * config/rs6000/rs6000lynx.mh: Likewise.
+ * config/s390/s390.mt: Likewise.
+ * config/s390/s390x.mt: Likewise.
+ * config/sparc/sparclynx.mh: Likewise.
+ * config/sparc/sun4os4.mh: Likewise.
+ * config/i386/x86-64linux.mt: Likewise.
+ * config/sparc/linux.mh: Likewise.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.tgt: Configure gdbserver only for known working
+ targets. Set ${build_gdbserver} instead of modifying ${configdirs}.
+ * configure.in: Check ${build_gdbserver}. Put gdbserver/ into
+ SUBDIRS if it is configured. Update comment for ${nativefile}.
* configure: Regenerated.
-1999-02-01 Jim Blandy <jimb@zwingli.cygnus.com>
+2002-02-13 Michael Snyder <msnyder@redhat.com>
- Allow PPC users to select which PPC/RS6000 variant they're
- debugging at run-time. At the moment, the only thing this affects
- is the set of registers visible.
- * config/rs6000/tm-rs6000.h (REGISTER_NAME): Define this as a call
- to the function rs6000_register_name.
- (rs6000_register_name): Include extern decl.
- (NUM_REGS): Bump to 183. What's the right way to do this?
- (FIRST_UISA_SP_REGNUM, LAST_UISA_SP_REGNUM): Renamed from
- FIRST_SP_REGNUM, LAST_SP_REGNUM.
- (REGISTER_BYTES): Recompute this.
- * rs6000-tdep.c: Renamed all uses of FIRST_SP_REGNUM and
- LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
- some concomitant formatting changes.
- #include "gdbcmd.h", so we can define commands here.
- (struct variant): New structure.
- (COMMON_UISA_REG_NAMES, PPC_UISA_SPR_NAMES, PPC_SEGMENT_REG_NAMES,
- PPC_32_OEA_SPR_NAMES, num_registers): New macros.
- (register_names_rs6000, register_names_uisa, register_names_403,
- register_names_403GC, register_names_505, register_names_860,
- register_names_601, register_names_602, register_names_603,
- register_names_604, register_names_750, variants): New variables.
- (rs6000_register_name, install_variant, find_variant_by_name,
- install_variant_by_name, list_variants, show_current_variant,
- set_processor, show_processor): New functions.
- (_initialize_rs6000_tdep): Define new commands `set processor' and
- `show processor', and call install_variant_by_name to set the
- default variant.
- * rs6000-nat.c: Renamed all uses of FIRST_SP_REGNUM and
- LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
- some concomitant formatting changes.
- * configure.in: Accept the `--with-cpu' flag, to specify a default
- processor variant.
- * acconfig.h: Provide a blurb for TARGET_CPU_DEFAULT, which is set
- by configure's `--with-cpu' flag.
- * config.in, configure: Regenerated.
+ * gcore.c (gcore_command): Use gcore_default_target instead of NULL.
+ (default_gcore_mach): Just return 0, work around a problem in bfd.
+ (default_gcore_target): OK to return NULL if exec_bfd is null.
+ (make_mem_sec): Use a cast, avoid a warning.
-Sun Jan 31 15:24:24 1999 Stan Shebs <shebs@andros.cygnus.com>
+ * procfs.c (find_memory_regions_callback): Use a cast instead of
+ calling host_pointer_to_address (which complains if
+ sizeof (host pointer) != sizeof (target pointer)).
+ (procfs_make_note_section): Avoid overflow in psargs string.
- * buildsym.h, buildsym.c: Convert to ANSI-only.
+ * procfs.c (procfs_make_note_section): Make the default
+ implementation return an error.
+
+2002-02-13 Rodney Brown <rbrown64@csc.com.au>
+
+ * procfs.c (procfs_make_note_section): Provide a default definition
+ (for alpha-dec-osf4.0f). Fix typos.
+
+2002-02-13 Elena Zannoni <ezannoni@redhat.com>
+
+ * linux-proc.c: Add include of regcache.h.
+ * Makefile.in (linux-proc.o): Add dependency on regcache.h.
+
+2002-02-13 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-01-18 Greg McGary <greg@mcgary.org>:
+ * memattr.c (create_mem_region): Disallow useless empty region.
+ Regions are half-open intervals, so allow [A..B) [B..C) as
+ non-overlapping.
+
+2002-02-13 Michael Chastain <mec@shout.net>
+
+ * defs.h: Kill CONST_PTR.
+ * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
+ * c-lang.c (c_builtin_types): Likewise.
+ * ch-lang.c (ch_builtin_types): Likewise.
+ * f-lang.c (f_builtin_types): Likewise.
+ * language.c (unknown_builtin_types): Likewise.
+ * m2-lang.c (m2_builtin_types): Likewise.
+ * p-lang.c (pascal_builtin_types): Likewise.
+ * scm-lang.c (c_builtin_types): Likewise.
+
+2002-02-13 Keith Seitz <keiths@redhat.com>
+
+ * arm-tdep.h (arm_get_next_pc): Add declaration.
+
+2002-02-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_use_struct_convention): Make static. Move to be
+ with other related struct-returning functions.
+ (arm_extract_struct_value_address): New function.
+ (arm_gdbarch_init): Initialize the above in multi-arch vector. Also
+ initialize float_format, double_format and long_double_format as
+ appropriate to the endianness of the target.
+ * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Delete.
+ (arm_use_struct_convention): Delete declaration.
+ (USE_STRUCT_CONVENTION, EXTRACT_STRUCT_VALUE_ADDRESS): Delete.
+
+2002-02-13 Keith Seitz <keiths@redhat.com>
+
+ * defs.h (core_addr_to_string_nz): New function.
+
+2002-02-13 Mark Kettenis <kettenis@gnu.org>
+
+ Apply missing bits of 2002-01-15 patch.
+ * i386v4-nat.c (supply_fpregset): Use i387_supply_fsave.
+ (fill_fpregset): Use i387_fill_fsave.
+
+2002-02-12 Keith Seitz <keiths@redhat.com>
+
+ * utils.c (core_addr_to_string): Use phex instead of phex_nz.
+ (core_addr_to_string_nz): New function.
+
+2002-02-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-linux-nat.c: Really include arm-tdep.h.
+ * config/arm/tm-linux.h (struct type, struct value): Declare.
+
+2002-02-11 Michael Snyder <msnyder@redhat.com>
+
+ * procfs.c: Include elf-bfd.h (for elfcore_write functions).
+ (gcore section): Ifdef for Solaris and Unixware only.
+ (procfs_do_thread_registers): Unixware needs one lwpstatus
+ per thread (not one prstatus or pstatus).
+ (procfs_make_note_section): Iterate only over kernel threads (lwps),
+ not over all gdb threads. For unixware, call elfcore_write_pstatus
+ once before iterating over threads.
+
+2002-02-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.h: New file.
+ * arm-tdep.c: Include arm-tdep.h.
+ (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call)
+ (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy)
+ (arm_print_float_info, arm_register_type, convert_to_extended)
+ (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special)
+ (arm_extract_return_value, arm_register_name): Make static.
+ (arm_software_single_step): Similarly. Fix types in declaration.
+ (arm_register_byte, arm_register_raw_size, arm_register_virtual_size)
+ (arm_store_return_value, arm_store_struct_return): New functions.
+ (arm_gdbarch_init): Register the above functions. Also register
+ call_dummy_start_offset, sizeof_call_dummy_words,
+ function_start_offset, inner_than, decr_pc_after_break, fp_regnum,
+ sp_regnum, pc_regnum, register_bytes, num_regs, max_register_raw_size,
+ max_register_virtual_size, register_size. Set up
+ prologue_cache.saved_regs here, rather than ...
+ (_initialize_arm_tdep): ... here.
+ * config/arm/tm-arm.h (struct type, struct value): Delete forward
+ declarations.
+ (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call)
+ (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy)
+ (arm_print_float_info, arm_register_type, convert_to_extended)
+ (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special)
+ (arm_extract_return_value, arm_register_name): Delete declarations.
+ (SMASH_TEXT_ADDRESS, ADDR_BITS_REMOVE, FUNCTION_START_OFFSET)
+ (SKIP_PROLOGUE, SAVED_PC_AFTER_CALL, INNER_THAN, BREAKPOINT_FROM_PC)
+ (DECR_PC_AFTER_BREAK, PRINT_FLOAT_INFO, REGISTER_SIZE, NUM_REGS)
+ (REGISTER_NAME, REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE)
+ (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE)
+ (MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN)
+ (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, CALL_DUMMY_WORDS)
+ (SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_START_OFFSET, FIX_CALL_DUMMY)
+ (SOFTWARE_SINGLE_STEP_P, SOFTWARE_SINGLE_STEP)
+ (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) Delete.
+ (arm_pc_is_thumb, arm_pc_is_thumb_dummy, thumb_get_next_pc)
+ (arm_get_next_pc): No-longer static -- these are needed by the RDI
+ interface.
+ * arm-linux-nat.c arm-linux-tdep.c armnbsd-nat.c: Include arm-tdep.h.
+ * remote-rdi.c remote-rdp.c: Likewise.
+ * Makefile.in (arm-linux-nat.o, arm-linux-tdep.o arm-tdep.o)
+ (armnbsd-nat.o, remote-rdi.o, remote_rdp.o): Update dependencies.
+ * config/arm/tm-nbsd.h (SOFTWARE_SINGLE_STEP_P): Delete bogus
+ definition.
+
+ * arm-tdep.h (ARM_A1_REGNUM, ARM_A4_REGNUM, ARM_AP_REGNUM)
+ (ARM_SP_REGNUM, ARM_LR_REGNUM, ARM_PC_REGNUM, ARM_F0_REGNUM)
+ (ARM_F3_REGNUM, ARM_F7_REGNUM, ARM_FPS_REGNUM, ARM_PS_REGNUM): Renamed
+ from non-ARM_ prefixed definitions.
+ * arm-tdep.c armnbsd-nat.c arm-linux-nat.c arm-linux-tdep.c: Update
+ all uses of above.
+ * remote-rdi.c remote-rdp.c: Likewise.
+ * arm-linux-nat.c (ARM_CPSR_REGNUM): Renamed from CPSR_REGNUM.
+
+2002-02-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_frameless_function_invocation)
+ (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args)
+ (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc)
+ (arm_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame)
+ (arm_pop_frame, arm_get_next_pc): Make static.
+ (arm_gdbarch_init): Register above in gdbarch structure.
+ (arm_read_fp): Renamed from arm_target_read_fp.
+ (arm_pc_is_thumb, arm_pc_is_thumb_dummy): Make static.
+ * config/arm/tm-arm.h (arm_frameless_function_invocation)
+ (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args)
+ (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc)
+ (arm_target_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame)
+ (arm_pop_frame, arm_get_next_pc, arm_pc_is_thumb)
+ (arm_pc_is_thumb_dummy): Delete declarations.
+ (INIT_EXTRA_FRAME_INFO, TARGET_READ_FP, FRAME_CHAIN)
+ (FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS)
+ (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, FRAME_ARGS_SKIP)
+ (FRAME_INIT_SAVED_REGS, PUSH_DUMMY_FRAME, POP_FRAME): Delete.
+
+2002-02-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.c (compare_search_syms): New function.
+ (sort_search_symbols): New function.
+ (search_symbols): Sort symbols after searching rather than
+ before.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Linux -> GNU/Linux.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: For for level one methods, disallow a definition
+ when partially multi-arched. Add comments explaining rationale.
+ * gdbarch.h: Re-generate.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Don't require when
+ multi-arch partial.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Map LEVEL onto a symbolic GT_LEVEL. Exit on bad
+ field. Use diff -u.
+ * gdbarch.c: Re-generate.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/tm-mips.h (CALL_DUMMY_LOCATION): Delete.
+ * gdbarch.sh (PUSH_RETURN_ADDRESS): Don't require when multi-arch
+ partial.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (REGISTER_CONVERTIBLE): Don't require when
+ multi-arch partial.
+ (PUSH_ARGUMENTS): Switch to using predefault.
+ * gdbarch.c: Regenerate.
+
+2002-02-10 Andrew Cagney <ac131313@redhat.com>
+
+ * valops.c (PUSH_ARGUMENTS): Delete definition.
+ * gdbarch.sh (PUSH_ARGUMENTS): Don't require when multi-arch
+ partial. Default to default_push_arguments.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-02-09 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (throw_exception): Rename return_to_top_level. Update
+ comments.
+ * utils.c (error_stream, internal_verror, quit): Ditto.
+ * top.c (throw_exception, catcher): Ditto.
+ * sparclet-rom.c (sparclet_load): Ditto.
+ * remote.c (interrupt_query, minitelnet): Ditto.
+ * remote-sds.c (interrupt_query): Ditto.
+ * remote-mips.c (mips_error, mips_kill): Ditto.
+ * ocd.c (interrupt_query): Ditto.
+ * monitor.c (monitor_interrupt_query): Ditto.
+ * m3-nat.c (suspend_all_threads, thread_resume_command): Ditto.
+ * target.h: Update comment.
- * buildsym.h, buildsym.c: Reformat to standard.
+ * m3-nat.c, ocd.c, sparclet-rom.c: Update copyright.
- * buildsym.c (merge_symbol_lists): Remove unused variable.
- (_initialize_buildsym): Remove, does nothing.
+2002-02-09 Andrew Cagney <ac131313@redhat.com>
-1999-01-31 J.T. Conklin <jtc@redbacknetworks.com>
+ * gdbarch.sh (TARGET_LONG_DOUBLE_FORMAT): Default to
+ default_double_format.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * findvar.c (floatformat_unknown): Delete variable definition.
+ * doublest.h (floatformat_unknown): Delete variable declaration.
- * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
- sparcl-stub, sparclet-stub.c: Change declaration of putDebugChar
- to include explicit void return type as per documentation. Fix up
- occasions where stubs erroneously checked return type.
+2002-02-09 Jim Blandy <jimb@redhat.com>
-Sun Jan 31 13:18:33 1999 Stan Shebs <shebs@andros.cygnus.com>
+ * stabsread.c (read_type): Add code to parse Sun's syntax for
+ prototyped function types.
- From J.T. Conklin <jtc@redbacknetworks.com>:
- * remote.c (remote_query): Fix tipo.
+2002-02-09 Andrew Cagney <ac131313@redhat.com>
-Fri Jan 29 15:25:09 1999 Stan Shebs <shebs@andros.cygnus.com>
+ * Makefile.in (SUBDIR_CLI_INITS): Set to SUBDIR_CLI_SRCS.
+ (SUBDIR_MI_INITS): Set to SUBDIR_MI_SRCS.
- * configure.tgt (v850): Add wildcard to match.
+2002-02-09 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
-Fri Jan 29 16:44:01 1999 Edith Epstein <eepstein@sophia.cygnus.com>
+ * xcoffsolib.c (_initialize_xcoffsolib): Renamed from
+ _initialize_solib. Fixes name clash with solib.c:_initialize_solib,
+ now _initialize_xcoffsolib gets called again and overrides the
+ commands from solib.c in a native configuration.
- * inferior.h: Ran indent.
+2002-02-09 Mark Kettenis <kettenis@gnu.org>
- * fork-child.c: Ran indent.
+ * doublest.c (store_typed_floating): Don't try to return a value.
+ Fixes PR gdb/290.
- * infrun.c : Ran indent.
+2002-02-08 Jim Blandy <jimb@redhat.com>
-Fri Jan 29 12:57:34 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ * c-typeprint.c (c_type_print_varspec_suffix): If a function type
+ is prototyped and has no arguments, print its argument list as
+ `(void)'.
- * infrun.c (_initialize_infrun): Do not stop or print anything
- when a SIGWINCH is received.
+2002-02-08 Chris Demetriou <cgd@broadcom.com>
- * Makefile.in (m2-exp.tab.c): Use YACC not BISON.
- (f-exp.tab.c): Ditto.
- (jv-exp.tab.c): Ditto.
- (c-exp.tab.c): Ditto.
- (YACC): Define as @YACC@.
+ * MAINTAINERS (write-after-approval): Add myself.
+ (paper-trail): I've escaped!
-1999-01-29 Martin Hunt <hunt@cygnus.com>
+2002-02-08 Christopher Faylor <cgf@redhat.com>
- Changes from Keith Seitz <keiths@cygnus.com>
- * valops.c (value_assign): Add calls to register_changed_hook and
- memory_changed_hook to inform UIs that the user has changed
- the target's registers/memory.
- * findvar.c (write_register_gen): Remove call to pc_changed_hook.
- * defs.h: Remove declaration for pc_changed_hook and
- add declarations for register_changed_hook and
- memory_changed_hook.
- * top.c: Ditto.
+ * win32-nat.c (cygwin_pid_to_str): Revert 2002-02-08 change xasprintf
+ changes.
+ (_initialize_check_for_gdb_ini): Ditto.
-1999-01-29 Mark Alexander <marka@cygnus.com>
+2002-02-08 Martin M. Hunt <hunt@redhat.com>
- * procfs.c (wait_fd): Handle deleted threads correctly.
+ * win32-nat.c (cygwin_pid_to_str): Fix typo.
+ xaprintf -> xasprintf.
-1999-01-28 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-02-08 Pierre Muller <muller@ics.u-strasbg.fr>
- * utils.c (init_page_info): Force window size if running under emacs.
+ * win32-nat.c: Remove use of printf and sprintf functions.
-1999-01-27 James Ingham <jingham@cygnus.com>
+2002-02-08 Richard Earnshaw <rearnsha@arm.com>
- * typeprint.c (whatis_exp): Remove static declaration.
+ * arm-tdep.c (arm_frame_chain_valid): Make static.
+ (arm_push_arguments): Likewise.
+ (arm_gdbarch_init): New function.
+ (_initialize_arm_tdep): Call it.
+ * config/arm/tm-arm.h (GDB_MULTI_ARCH): Set to 1.
+ (TARGET_DOUBLE_FORMAT): Test TARGET_BYTE_ORDER, not target_byte_order.
+ (FRAME_CHAIN_VALID): Delete.
+ (arm_frame_chain_valid): Delete declaration.
+ (PUSH_ARGUMENTS): Delete.
+ (arm_push_arguments): Delete declaration.
+ (CALL_DUMMY_P): Delete.
-Wed Jan 27 16:50:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+2002-02-08 Andrew Cagney <ac131313@redhat.com>
+ Corinna Vinschen <vinschen@redhat.com>
- * hp-psymtab-read.c: Reformat using indent.
+ * gdbtypes.c (build_gdbtypes): Disable setting a specific float format
+ on builtin float types.
-Wed Jan 27 13:20:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+2002-02-08 Daniel Jacobowitz <drow@mvista.com>
- * hp-psymtab-read.c: Reformat comments, update copyright.
+ * utils.c: Include <curses.h> before "bfd.h".
+ * tui/tui-hooks.c: Likewise.
+ * tui/tui.c: Likewise.
+ * tui/tuiCommand.c: Likewise.
+ * tui/tuiData.c: Likewise.
+ * tui/tuiDataWin.c: Likewise.
+ * tui/tuiDisassem.c: Likewise.
+ * tui/tuiGeneralWin.c: Likewise.
+ * tui/tuiIO.c: Likewise.
+ * tui/tuiLayout.c: Likewise.
+ * tui/tuiRegs.c: Likewise.
+ * tui/tuiSource.c: Likewise.
+ * tui/tuiSourceWin.c: Likewise.
+ * tui/tuiStack.c: Likewise.
+ * tui/tuiWin.c: Likewise.
-Tue Jan 26 16:02:47 1999 Mark Alexander <marka@cygnus.com>
+2002-02-07 Elena Zannoni <ezannoni@redhat.com>
- * v850-tdep.c (v850_generic_reg_names, v850e_reg_names,
- v850_register_names, v850_processor_type_table): Declare tables
- and structures for handling differences in register names for
- v850 and v850e.
- (struct reg_list): Define new structure for creating tables
- of register bit masks in v850e instrutions.
- (handle_prepare, handle_pushm): New helpers for v850_scan_prologue.
- (v850_scan_prologue): Recognize v850e instructions: callt, prepare,
- and pushm.
- (v850_target_architecture_hook): New function to set register
- names based on current machine.
- (_initialize_v850_tdep): Set up target_architecture_hook.
- * config/v850/tm-v850.h (v850_register_names): Declare.
- (REGISTER_NAME): Define to refer to v850_register_names.
- (SR0_REGNUM, CTBP_REGNUM): Define.
- (PS_REGNUM): Redefine in terms of SR0_REGNUM.
+ * sh-tdep.c (sh_nofp_frame_init_saved_regs): Extend where[] array
+ to include space for pseudoregs as well. Update loops accordingly.
+ (sh_fp_frame_init_saved_regs): Ditto.
+ (sh_init_extra_frame_info, sh_pop_frame): Split long lines.
-Tue Jan 26 18:27:26 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+2002-02-07 Andrew Cagney <ac131313@redhat.com>
- * Makefile.in (c-exp.tab.c): Use BISON instead of YACC, to pick
- the correct value from configure output.
- (jv-exp.tab.c): Ditto.
- (f-exp.tab.c): Ditto.
- (m2-exp.tab.c): Ditto.
+ * MAINTAINERS: Andreas Schwab is GNU/Linux m68k maintainer.
+ Add Richard Earnshaw to Arm maintainers.
-1999-01-26 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-02-07 Andrew Cagney <ac131313@redhat.com>
- * breakpoint.h (ep_is_exception_catchpoint): Add prototype.
- * frame.h (select_and_print_frame): Add prototype.
- * stack.c (func_command): Call select_and_print_frame with correct
- number of arguments. Reformat whitespace.
+ * defs.h (warning_begin): Delete declaration.
-Tue Jan 26 16:53:54 1999 Fernando Nasser <fnasser@cygnus.com>
+ * config/powerpc/tm-ppcle-eabi.h (TARGET_BYTE_ORDER_DEFAULT):
+ Delete macro.
- * remote.c (remote_query): fix maximum packet size to account for
- remote_debug use.
- (putpkt): add comment to alert about extra byte need.
+2002-02-07 Michael Snyder <msnyder@redhat.com>
-Mon Jan 25 19:55:30 1999 Mark Alexander <marka@cygnus.com>
+ * solib-legacy.c (legacy_svr4_fetch_link_map_offsets):
+ Logic bug, remove misplaced else.
- * sh-tdep.c (sh_target_architecture_hook): Return immediately
- when a matching machine is found.
+2002-02-07 Klee Dienes <klee@apple.com>
-Fri Jan 22 09:10:35 1999 Mark Alexander <marka@cygnus.com>
+ * fork-inferior.c (fork_inferior): Add '!' to the list of
+ characters that need to be quoted when building a string for the
+ shell. Quote '!' specifically with a backslash, since CSH chokes
+ when trying to evaluate "str!str".
- * remote-mips.c (mips_initialize): Fix parameters to clear_breakpoint.
- (common_breakpoint): Restore support for instruction breakpoints
- on non-LSI targets.
+2002-02-06 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * rdi-share/host.h: Only provide a typedef for bool if it is not
+ defined.
+
+2002-02-04 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.h (enum bptype): Add new overlay event bp type.
+ (enable_overlay_breakpoints, disable_overlay_breakpoints): Export.
+
+ * breakpoint.c (create_internal_breakpoint): New function.
+ (internal_breakpoint_number): Moved into create_internal_breakpoint.
+ (create_longjmp_breakpoint): Use create_internal_breakpoint.
+ (create_thread_event_breakpoint): Ditto.
+ (create_solib_event_breakpoint): Ditto.
+ (create_overlay_event_breakpoint): New function.
+ (enable_overlay_breakpoints, disable_overlay_breakpoints): New funcs.
+ (update_breakpoints_after_exec): Delete and re-initialize
+ overlay event breakpoints after an exec. Add FIXME comment
+ about longjmp breakpoint.
+ (print_it_typical): Ignore overlay event breakpoints.
+ (print_one_breakpoint): Ditto.
+ (mention): Ditto.
+ (bpstat_what): Do not stop for overlay event breakpoints.
+ (delete_breakpoint): Don't delete overlay event breakpoints.
+ (breakpoint_re_set_one): Delete the overlay event breakpoint.
+ (breakpoint_re_set): Re-create overlay event breakpoint.
+
+ * symfile.c (overlay_auto_command): Enable overlay breakpoints.
+ (overlay_manual_command): Disable overlay breakpoints.
+ (overlay_off_command): Disable overlay breakpoints.
+
+2002-02-06 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c: Include elf-bfd.h and coff/internal.h.
+ (MSYMBOL_SET_SPECIAL, MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Move defines
+ to here from config/tm-arm.h.
+ (coff_sym_is_thumb): Make static.
+ (arm_elf_make_msymbol_special): New function.
+ (arm_coff_make_msymbol_special): New function.
+ * config/arm/tm-arm.h (MSYMBOL_SET_SPECIAL): Delete definition.
+ (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Likewise.
+ (coff_sym_is_thumb): Delete declaration.
+ (arm_elf_make_msymbol_special): Declare.
+ (arm_coff_make_msymbol_special): Declare.
+ (ELF_MAKE_MSYMBOL_SPECIAL): Call arm_elf_make_msymbol_special.
+ (COFF_MAKE_MSYMBOL_SPECIAL): Call arm_coff_make_msymbol_special.
+
+2002-02-06 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_software_single_step): ANSIfy function declaration.
+
+2002-02-06 Richard Earnshaw <rearnsha@arm.com>
+
+ * gdbarch.sh (PRINT_FLOAT_INFO): Add rule.
+ * gdbarch.c gdbarch.h: Regenerate.
+ * arch-utils.c (default_print_float_info): New function.
+ * arch-utils.h (default_print_float_info): Prototype it.
+ * infcmd.c (float_info): Call PRINT_FLOAT_INFO.
+ * doc/gdbint.texinfo (FLOAT_INFO): Mark as deprecated.
+ (PRINT_FLOAT_INFO): Document it.
+
+ * arm-tdep.c (arm_print_float_info): Renamed from arm_float_info.
+ * config/arm/tm-arm.h (FLOAT_INFO): Delete.
+ (PRINT_FLOAT_INFO): Define.
+
+2002-02-06 Pierre Muller <muller@ics.u-strasbg.fr>
-Thu Jan 21 17:16:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+ * win32-nat.c (_initialize_check_for_gdb_ini):
+ Add typecast to sprintf argument to suppress a warning.
- * stack.c: Close open comment.
- * symtab.c (find_pc_sect_line): Ditto.
+2002-02-05 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * win32-nat.c (last_sig): Changed type of variable to target_signal,
+ to allow easier handling of pass state.
+ (DEBUG_EXCEPTION_SIMPLE): New macro, used in handle_exception,
+ that gives exception name and address.
+ (handle_exception): Use DEBUG_EXCEPTION_SIMPLE macro
+ and set last_sig value to ourstatus->value.sig. Some missing
+ exceptions added.
+ (child_continue): Correctly report continue_status.
+ (get_child_debug_event,do_initial_child_stuff): Set last_sig to
+ TARGET_SIGNAL_0 (new default value).
+ (child_resume): consider sig argument passed to decide if
+ the exception should be passed to debuggee or not.
+
+2002-02-05 Michael Snyder <msnyder@redhat.com>
+
+ * regcache.c (fetch_register): Call target_fetch_register
+ only if we don't call FETCH_PSEUDO_REGISTER.
+ (store_register): Call target_store_register only if we
+ don't call STORE_PSEUDO_REGISTER.
+
+2002-02-05 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbarch.sh: Add definitions for COFF_MAKEMSYMBOL_SPECIAL and
+ ELF_MAKE_MSYMBOL_SPECIAL.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * arch-utils.c (default_make_msymbol_special): New function.
+ * arch-utils.h (default_make_msymbol_special): Export.
+ * elfread.c (elf_symtab_read): Compile use of
+ ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now
+ multiarched.
+ * coffread.c (coff_symtab_read): Ditto, for
+ COFF_MAKE_MSYMBOL_SPECIAL.
+
+2002-02-05 Jim Blandy <jimb@redhat.com>
+
+ * solib-svr4.c (svr4_truncate_ptr): New function.
+ (svr4_relocate_section_addresses): Do the address arithmetic with
+ the appropriate truncation for target addresses, even when
+ CORE_ADDR is larger than a target address.
+
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (mywait): Cast second argument of waitpid
+ to (int *).
+
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (kill_inferior): Remove commented out
+ code.
-Thu Jan 21 17:51:51 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
- * procfs.c (init_procfs_ops): New function, fills in procfs_ops,
- init only nonzero fields, leave to_require_attach and
- to_require_detach empty, not needed for /proc systems yet.
- (_initialize_procfs): Call init_procfs_ops.
+ * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX.
- From J.T. Conklin <jtc@redbacknetworks.com>:
- * top.c (init_main): Fix tipo in description of the remotetimeout
- variable.
- * breakpoint.c (bpstat_stop_status): Handle systems where
- DECR_PC_AFTER_BREAK != DECR_PC_AFTER_HW_BREAK.
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
-Thu Jan 21 17:25:46 1999 Mark Alexander <marka@cygnus.com>
+ * gdbserver/linux-low.c: Remove unused include files.
- * mon960-rom.c (_initialize_mon960): Call init_mon960_cmds
- to fill in mon960_cmds structure properly.
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
-Wed Jan 20 17:53:22 1999 Stan Shebs <shebs@andros.cygnus.com>
+ * gdbserver/linux-low.c: Define PTRACE_ARG3_TYPE.
+ (read_inferior_memory): Use it.
+ (write_inferior_memory): Likewise.
- * remote-sds.c (sds_ops): Define only once.
- (init_sds_ops, sds_command, _initialize_remote_sds): Declare.
- (init_sds_ops): Init only non-zero fields.
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
-Wed Jan 20 15:45:15 1999 Mark Alexander <marka@cygnus.com>
+ * gdbserver/linux-low.c (create_inferior): Call strerror instead of
+ grubbing through sys_errlist.
- * h8300-tdep.c (original_register_names, h8300h_register_names,
- h8300_register_names): Define new variables.
- (set_register_names): New function to set register names based on
- current CPU type.
- (h8300_command, h8300h_command, h8300s_command): Call
- set_register_names.
- * config/h8300/tm-h8300.h (h8300_register_names): Declare.
- (REGISTER_NAME): Define to refer to h8300_register_names.
+2002-02-05 Daniel Jacobowitz <drow@mvista.com>
-1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * gdbserver/linux-low.c: New file, copied exactly from low-linux.c.
- * sol-thread.c abug-rom.c cpu32bug-rom.c dbug-rom.c m32r-rom.c
- mac-nat.c mon960-rom.c op50-rom.c ppc-bdm.c remote-adapt.c
- remote-array.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c
- remote-est.c remote-hms.c remote-mm.c remote-nindy.c remote-nrom.c
- remote-os9k.c remote-rdp.c remote-sds.c remote-sim.c remote-st.c
- remote-udi.c rom68k-rom.c sh3-rom.c sparcl-tdep.c sparclet-rom.c
- v850ice.c win32-nat.c: cosmetic changes to conform to coding
- standards.
+2002-02-04 Pierre Muller <muller@ics.u-strasbg.fr>
+ * win32-nat.c (handle_exception): Handle Ctrl-Break exception.
-1999-01-19 Jim Blandy <jimb@zwingli.cygnus.com>
+2002-02-04 Andrew Cagney <ac131313@redhat.com>
- Use aclocal to generate GDB's aclocal.m4 script.
- * acinclude.m4: New file, containing the hand-written local macro
- definitions that used to be in aclocal.m4. Don't sinclude
- ../bfd/aclocal.m4 any more; running aclocal in this directory will
- get us the definitions we need. HOWEVER: Do sinclude
- ../bfd/acinclude.m4, because we need the definition of
- BFD_NEED_DECLARATION.
- * aclocal.m4: Regenerated by aclocal.
- * configure: Regenerated by autoconf.
+ * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions.
+ (do_sfunc, set_cmd_sfunc): New functions.
-Tue Jan 19 10:27:23 1999 David Taylor <taylor@texas.cygnus.com>
+ * command.h (struct cmd_list_element): Add field func.
+ * cli/cli-decode.h (struct cmd_list_element): Ditto.
+ * command.h (set_cmd_sfunc, set_cmd_cfunc): Declare.
+ * cli/cli-decode.h: Ditto.
- * breakpoint.c (disable_breakpoints_in_shlibs): new parameter,
- silent, controls whether to print message about removal of shared
- library breakpoints.
- * breakpoint.h (disable_breakpoints_in_shlibs): decl updated.
- * irix5-nat.c (clear_solib): call disable_breakpoints_in_shlibs.
- * osfsolib.c (clear_solib): ditto.
- * solib.c (clear_solib): ditto.
- * somsolib.c (som_solib_restart): update call to
- disable_breakpoints_in_shlibs.
+ * cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc.
+ (help_all, help_cmd_list): Ditto.
+ (find_cmd, complete_on_cmdlist): Ditto.
+ * top.c (execute_command): Ditto.
- * target.h (child_post_attach): only declare if CHILD_POST_ATTACH
- is define.
+ * cli/cli-setshow.c (do_setshow_command): Call func instead of
+ function.sfunc.
-Tue Jan 19 18:07:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
+ * infcmd.c (notice_args_read): Fix function signature.
- * corelow.c (solib_add_stub): Ditto.
- (core_file_to_sym_file): Cast make_cleanup parameter.
+ * cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc.
+ * cli/cli-decode.c (add_set_cmd): Ditto.
+ * utils.c (initialize_utils): Ditto.
+ * maint.c (_initialize_maint_cmds): Ditto.
+ * infrun.c (_initialize_infrun): Ditto.
+ * demangle.c (_initialize_demangler): Ditto.
+ * remote.c (add_packet_config_cmd): Ditto.
+ * mips-tdep.c (_initialize_mips_tdep): Ditto.
+ * cris-tdep.c (_initialize_cris_tdep): Ditto.
+ * proc-api.c (_initialize_proc_api): Ditto.
+ * kod.c (_initialize_kod): Ditto.
+ * valprint.c (_initialize_valprint): Ditto.
+ * top.c (init_main): Ditto.
+ * infcmd.c (_initialize_infcmd): Ditto.
+ * corefile.c (_initialize_core): Ditto.
+ * arm-tdep.c (_initialize_arm_tdep): Ditto.
+ * arch-utils.c (initialize_current_architecture): Ditto.
+ (_initialize_gdbarch_utils): Ditto.
+ * alpha-tdep.c (_initialize_alpha_tdep): Ditto.
- * solib.c (symbol_add_stub, solib_map_sections): Change argument
- to PTR insted of a char*. Matches catch_errors interface.
+ * cli/cli-decode.c (add_cmd): Use set_cmd_cfunc.
+ * wince.c (_initialize_inftarg): Ditto.
+ * symfile.c (_initialize_symfile): Ditto.
+ * mips-tdep.c (_initialize_mips_tdep): Ditto.
+ * language.c (_initialize_language): Ditto.
+ * arc-tdep.c (_initialize_arc_tdep): Ditto.
-Mon Jan 18 14:01:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+2002-02-04 Michael Snyder <msnyder@redhat.com>
- * remote-array.c (array_open): Don't use fprintf_filtered to send
- data to the log file.
+ * memattr.c (_initialize_mem): Elaborate the help for 'mem' command.
- * remote-array.c (handle_load_dll): Change argument type to PTR so
- that it is compatible with catch_errors.
- * ocd.c (ocd_start_remote): Ditto.
- * remote-sds.c (sds_start_remote): Ditto.
+2002-02-04 Daniel Jacobowitz <drow@mvista.com>
- * win32-nat.c (win32_child_thread_alive): Namespace proof
- child_thread_alive.
- (init_child_ops): Update.
+ * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS.
+ Add rules for building the register data files.
-Mon Jan 18 12:03:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+2002-02-04 Daniel Jacobowitz <drow@mvista.com>
- * remote-rdi.c (arm_rdi_open): Set gdb_hostif.hostosarg and
- gdb_hostif.dbgarg to NULL instead of stdout.
- (voiddummy, myprint, mywritec): Use gdb_stdout instead of stdout.
+ * regformats/regdat.sh: Add braces to the definition of
+ expedite_regs_${arch}.
-Mon Jan 18 16:40:50 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-02-04 Daniel Jacobowitz <drow@mvista.com>
- * ser-ocd.c (ocd_open): Handle Unix case gracefully.
+ * regformats/regdef.h (struct reg): Add comment describing the
+ requirements for offset and size fields.
- * target.c (dummy_target): Don't initialize statically.
- (init_dummy_target): New function, fills in dummy_target.
- (initialize_targets): Use it.
- * hpux-thread.c (hpux_thread_ops): Don't initialize statically.
- (init_hpux_thread_ops): New function, fills in hpux_thread_ops.
- (_initialize_hpux_thread): Use it.
- * m3-nat.c (m3_ops): Don't initialize statically.
- (init_m3_ops): New function, fills in m3_ops.
- (_initialize_m3): Use it.
+2002-02-04 Andreas Schwab <schwab@suse.de>
-1999-01-18 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * config/ia64/linux.mh: Don't set NAT_CLIBS and REGEX.
+ * config/ia64/linux.mt: Don't set GDBSERVER_LIBS.
- * sol-thread.c: delete compile time initialization of target_ops
- (_initialize_sol_thread): initialize target_ops at run time.
- * hpux-thread.c: added target_ops entry.
- * m3-nat.c: ditto.
+2002-02-04 Richard Earnshaw <rearnsha@arm.com>
-Mon Jan 18 15:19:13 1999 David Taylor <taylor@texas.cygnus.com>
+ * gdbarch.sh (copyright): Update years in generated header.
+ (SMASH_TEXT_ADDRESS): Add rule.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS.
+ * dbxread.c: Likewise.
+ * dwarfread.c: Likewise.
+ * elfread.c: Likewise.
+ * somread.c: Likewise.
- * procfs.c (procfs_ops): delete compile time initialization.
- (_initialize_procfs): initialize procfs_ops at run time.
-
-Mon Jan 18 12:51:44 1999 Christopher Faylor <cgf@cygnus.com>
+ * arm-tdep.c (arm_smash_text_address): New function.
+ * config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above.
- * configure.in: Ensure that -luser32 is always linked in
- for cygwin build.
- * configure: Regenerated.
+2002-02-04 Pierre Muller <muller@ics.u-strasbg.fr>
-Mon Jan 18 08:38:05 1999 Mark Alexander <marka@cygnus.com>
+ Add support for hardware watchpoints on win32 native.
+ * win32-nat.c (CONTEXT_DEBUG_DR macro): Add use of
+ CONTEXT_DEBUG_REGISTERS.
+ (dr variable): New variable. Static array containing a local copy
+ of debug registers.
+ (debug_registers_changed): New variable. Reflects when debug registers
+ are changed and need to be written to inferior.
+ (debug_registers_used): New variable. Reflects when any debug register
+ was set, used when new threads are created.
+ (cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): New functions used by
+ i386-nat code.
+ (thread_rec): Set dr array if id is the thread of current_event .
+ (child_continue, child_resume): Change the debug registers for all
+ threads if debug_registers_changed.
+ (child_add_thread): Change the debug registers if debug_registers_used.
+ * config/i386/cygwin.mh: Add use of i386-nat.o file.
+ Link nm.h to new nm-cygwin.h file.
+ + config/i386/nm-cygwin.h: New file. Contains the macros used for use
+ of hardware registers.
- * values.c (value_virtual_fn_field): Clear the pointed-to
- offset when casting to the base class.
+2002-02-03 Andrew Cagney <ac131313@redhat.com>
-Mon Jan 18 10:30:51 1999 David Taylor <taylor@texas.cygnus.com>
+ * valprint.c (print_floating): Allow non TYPE_CODE_FLT types.
+ Restore behavour broken by 2002-01-20 Andrew Cagney
+ <ac131313@redhat.com> IEEE_FLOAT removal.
- * remote-udi.c (init_udi_ops): change non-existant udi_run_ops to
- udi_ops; delete NULL initializers.
+2002-02-03 Daniel Jacobowitz <drow@mvista.com>
-Mon Jan 18 12:03:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+ * c-valprint.c (c_val_print): Pass a proper valaddr to
+ cp_print_class_method.
+ * valops.c (search_struct_method): If there is only one method
+ and args is NULL, return that method.
- * serial.c (serial_close): gdb_fclose tages gdb_file** arg, not
- gdb_file*.
+2002-02-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.c (init_simd_type): Use TYPE_TAG_NAME instead of
+ accessing tag_name directly.
- * f-valprint.c, target.c, gdbarch.c: Pass gdb_stderr not stderr.
+2002-02-03 Daniel Jacobowitz <drow@mvista.com>
-Mon Jan 18 10:46:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+ * ax-gdb.c (find_field): Use TYPE_TAG_NAME instead
+ of accessing tag_name directly.
- * stack.c (print_frame_info_base): Don't cast call to
- catch_errors.
- (print_args_stub): Change char* arg to PTR.
- * symmisc.c (print_symbol): Ditto.
- * top.c (quit_cover): Ditto.
- * remote.c (remote_open_1, remote_start_remote): Ditto.
- * infrun.c (normal_stop, hook_stop_stub, restore_selected_frame):
- Ditto.
+2002-02-03 Daniel Jacobowitz <drow@mvista.com>
- * stack.c (backtrace_command): Cast first arg of make_cleanup to
- make_cleanup_func.
- * remote.c (remote_kill): Cast putpkt arg to catch_errors_ftype.
+ PR gdb/280
+ * gdbtypes.c (replace_type): New function.
+ * gdbtypes.h (replace_type): Add prototype.
+ * stabsread.c (read_type): Use replace_type.
-Mon Jan 18 08:47:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * defs.h (catch_errors_ftype): Define.
- (catch_errors): Replace char* arg with PTR arg.
- * top.c (catch_errors): Update
-
- * breakpoint.c (bpstat_stop_status, bpstat_stop_status,
- delete_breakpoint, breakpoint_re_set): Delete all casts in call to
- catch_errors.
- (breakpoint_cond_eval, watchpoint_check,
- cover_target_enable_exception_callback, breakpoint_re_set_one):
- Arg is PTR not char*.
-
- * breakpoint.c (cover_target_enable_exception_callback): Change
- type to int. Check for cast values of 0 and -1. Return a result!
- (insert_breakpoints): Move declaration of SAL and ARGS to where
- they are used.
+2002-02-03 Richard Earnshaw <rearnsha@arm.com>
-1999-01-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * Makefile.in (memattr.o): Add missing dependencies rule.
- * remote.c (remote_query): new function - creates proper interface
- to the remote protocol "q" command.
+2002-02-03 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
-Fri Jan 15 17:11:48 EST 1999 Zdenek Radouch (radouch@cygnus.com)
+ * breakpoint.c (break_at_finish_command): Really export.
+ (break_at_finish_at_depth_command): Ditto.
+ (tbreak_at_finish_command): Ditto.
+ * hppa-tdep.c: Include completer.h.
+ * Makefile.in (hppa-tdep.o): Add dependency on $(completer_h).
+ (COMMON_OBS): Remove duplicate ui-file.o, frame.o, doublest.o.
- * config/fr30/tm-fr30.h: Changed ABI to match GCC change
- (always use pointer for structs passed by value).
+2002-02-01 Andrew Cagney <ac131313@redhat.com>
-1999-01-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * utils.c (do_write): New function.
+ (error_stream): Rewrite combining the code from error_begin and
+ verror.
+ (verror): Rewrite using error_stream.
+ (error_begin): Delete function.
- * target.h: added entry for target queries (to_query)
- target.c: ditto.
+2002-02-01 Andrew Cagney <ac131313@redhat.com>
-Thu Jan 14 18:29:17 1999 David Taylor <taylor@texas.cygnus.com>
+ * utils.c (error_begin): Make static.
+ * defs.h (error_begin): Delete declaration.
- * remote-mm.c (mm_wait): fix stream arg to gdb_flush.
- * remote-udi.c (udi_wait): fix stream arg to fwrite.
- * symmisc.c (maintenance_check_symtabs): fix stream argument to
- print_address_numeric.
-
-Wed Jan 13 19:33:16 1999 David Taylor <taylor@texas.cygnus.com>
-
- * breakpoint.c (insert_breakpoints): insert cast to eliminate
- warning.
-
-Wed Jan 13 14:59:02 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
-
- * infrun.c (set/show scheduler-locking) New command. Set a
- mode bit that will control how GDB attempts to control thread
- scheduling for step, continue, etc. (resume): make use of
- the schedule-locking mode.
- * target.h (struct target_ops): new field to_has_thread_control.
- * sol-thread.c: initialize target_ops to_has_thread_control.
- * procfs.c: ditto.
- * target.c: ditto.
- * m3-nat.c: ditto.
- * remote.c: ditto.
- * hpux-thread.c: ditto.
- * thread.c: cull duplicate prototypes. Move prototypes to top.
- * serial.c: indentation cleanup.
- * breakpoint.c: add casts to eliminate compiler warnings.
-
-Tue Jan 12 17:00:00 1999 Edith Epstein <eepstein@sophia.cygnus.com>
+ * linespec.c (cplusplus_error): Replace cplusplus_hint.
+ (decode_line_1): Use cplusplus_error instead of error_begin,
+ cplusplus_hint and return_to_top_level.
+ * coffread.c (coff_symfile_read): Use error instead of error_begin
+ and return_to_top_level.
+ * infrun.c (default_skip_permanent_breakpoint): Ditto.
- * inftarg.c (child_create_inferior): fixed HPUXHPPA specific
- call to fork_inferior. The shell param is now NULL.
+2002-02-01 Andrew Cagney <ac131313@redhat.com>
-1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com)
+ * language.h (type_error, range_error): Make string parameter
+ constant.
+ * language.c (warning_pre_print): Delete extern declaration.
+ * dwarfread.c (warning_pre_print): Ditto.
+ * language.c (type_error, range_error): Rewrite to use verror and
+ vwarning instead of warning_begin.
- * monitor.c (init_base_monitor_ops): Whitespace cleanup.
- (_initialize_remote_monitors): Same.
+2002-02-01 Michael Snyder <msnyder@redhat.com>
-1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com)
+ * breakpoint.c (breakpoint_re_set): Delete ancient #if 0 code.
+ (set_ignore_count): Move misplaced comment back where it belongs.
- * monitor.c (init_monitor_ops): Initialize the monitor_ops
- structure if it hasn't already been done.
+2002-02-01 Andrew Cagney <ac131313@redhat.com>
-Tue Jan 12 14:50:10 1999 Stan Shebs <shebs@andros.cygnus.com>
+ * command.h (NO_FUNCTION): Delete macro.
+ * cli/cli-decode.h (NO_FUNCTION): Ditto.
+ * top.c (execute_command): Replace NO_FUNCTION with NULL.
+ * tracepoint.c (_initialize_tracepoint): Ditto.
+ * cli/cli-decode.c (add_set_cmd): Ditto.
+ * cli/cli-cmds.c (init_cli_cmds): Ditto.
- * inftarg.c (child_ops): Don't initialize statically.
- (init_child_ops): New function, fills in child_ops.
- (_initialize_inftarg): Use it.
- (child_post_attach): Declare extern.
- (child_wait): Fix ambiguous parens.
- (child_attach_to_process): Remove unused local wstatus.
- (child_insert_fork_catchpoint, child_remove_fork_catchpoint,
- child_insert_vfork_catchpoint, child_remove_vfork_catchpoint,
- child_has_forked, child_insert_exec_catchpoint,
- child_remove_exec_catchpoint): Return a value.
+2002-02-01 Daniel Jacobowitz <drow@mvista.com>
-Mon Jan 11 16:43:44 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+ * gnu-v3-abi.c (gnuv3_virtual_fn_field): Update comments.
+ Update ``this'' pointer when calling virtual functions.
- * remote.c (remote_wait): Add inferior_pid to thread list only
- if it is not already there.
+2002-02-01 Michael Snyder <msnyder@redhat.com>
-1999-01-11 Jason Molenda (jsm@bugshack.cygnus.com)
+ * breakpoint.c (create_temp_exception_breakpoint): Delete.
+ * hppa-tdep.c: Deprecate xbreak, txbreak and bx commands.
- * scm-tags.h: Update FSF's address on copyright notice.
- * ser-e7kpc.c: Same.
- * gnu-nat.h: Same.
+2002-02-01 Daniel Jacobowitz <drow@mvista.com>
-Mon Jan 11 13:45:57 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
+ * regformats/reg-arm.dat: New file.
+ * regformats/reg-i386.dat: New file.
+ * regformats/reg-ia64.dat: New file.
+ * regformats/reg-m68k.dat: New file.
+ * regformats/reg-mips.dat: New file.
+ * regformats/reg-ppc.dat: New file.
+ * regformats/reg-sh.dat: New file.
+ * regformats/regdef.h: New file.
+ * regformats/regdat.sh: New file.
- * dwarf2read.c (dump_die): Change stderr to gdb_stderr.
- * expprint.c (print_subexp): fprintf => fprintf_unfiltered.
- * jv-typeprint.c (java_type_print_base): fputs => fputs_filtered.
- * stack.c (struct function_bounds): Remove superfluous `typedef'.
- * symfile.c (list_overlays_command): stdout => gdb_stdout.
- * symmisc.c (maintenance_check_symtabs): stdout => gdb_stdout.
- * utils.c (print_spaces): Make more efficient.
-
-Mon Jan 11 13:55:51 1999 David Taylor <taylor@texas.cygnus.com>
+2002-02-01 Richard Earnshaw <reanrsha@arm.com>
- * utils (print_spaces): fix arg to strcat; fix formatting.
+ * arm-tdep.c (arm_frameless_function_invocation): Add some comments.
+ (arm_frame_args_address, arm_frame_locals_address): New functions.
+ (arm_frame_num_args): New function.
+ * config/tm-arm.h (FRAME_ARGS_ADDRESS): Call arm_frame_args_address.
+ (FRAME_LOCALS_ADDRESS): Call arm_frame_locals_address.
+ (FRMA_NUM_ARGS): Call arm_frame_num_args.
-Fri Jan 8 11:57:24 1999 Stan Shebs <shebs@andros.cygnus.com>
+2002-01-31 Michael Snyder <msnyder@redhat.com>
- * exec.c (exec_ops): Don't initialize statically.
- (init_exec_ops): New function, fills in exec_ops.
- (_initialize_exec): Use it.
+ * breakpoint.c (break_at_finish_command): Export.
+ (break_at_finish_at_depth_command): Export.
+ (tbreak_at_finish_command): Export.
+ (_initialize_breakpoint): Delete "xbreak" and "tbreak" commands.
+ * hppa-tdep.c (_initialize_hppa_tdep): Add "xbreak" and
+ "tbreak" commands, which are HPPA specific.
-Thu Jan 7 17:50:15 EST 1999 Zdenek Radouch (radouch@cygnus.com)
+ * printcmd.c (disassemble_command): Remove an ancient
+ artifact of an old merge.
- Beta FR30 port.
- * fr30-tdep.c
- * config/fr30/tm-fr30.h
-
-Wed Jan 6 12:28:35 1999 David Taylor <taylor@texas.cygnus.com>
+ * symfile.h (enum overlay_debugging_state):
+ Define enum constant values for overlay mode.
+ * symfile.c (overlay_debugging): Use enums instead of literals.
+ (overlay_is_mapped, overlay_auto_command,
+ overlay_manual_command): Ditto.
- * configure.in: Add an --enable-tui argument. Construct
- tui/Makefile from tui/Makefile.in. Use AM_PROG_CC_STDC. If we
- have the GUI, then we need this to process libgui.h.
- (ENABLE_CFLAGS): define and export BUILD_TUI.
- (AC_CHECK_HEADERS): Add check for term.h.
-
- * configure.host (hppa-*-hpux10.20, hppa-*-hpux11.0*): New configs.
-
- * config.in, configure : regenerated.
-
- * Makefile.in: Allow the TUI code to be conditionally enabled.
- (TUI_LIBRARY): New variable, value are set by the configuration
- script. Set to the empty string when the TUI isn't enabled.
- (gdb$(GDBEXT)): Use those, instead of referring to all-tui and
- tui/libtui.a directly.
- (BUILD_TUI): build the tui -- only when configured with
- --enable-tui.
- (YLWRAP): use ylwrap to avoid problems on systems w/o bison.
- (gdb$(EXEEXT)): make it dependent on BUILD_TUI.
- (all-tui): remove dependency from phony target.
- (c-exp.tab.c): use ylwrap instead of bison.
- (jv-exp.tab.c): ditto.
- (f-exp.tab.c): ditto.
- (m2-exp.tab.c): ditto.
- (ALLDEPFILES): add somread.c, hp-psymtab-read.c, hp-symtab-read.c.
- (SFILES): remove the above files
- (COMMON_OBS): remove somread.o
- (SFILES): Add the tui files to this, so they get included in etags
- tables.
- (gdb$(EXEEXT)): Add all-tui to the list of dependencies, and add
- tui/libtui.a to the link list.
- (all-tui): New rule, which does a recursive make in the tui
- subdir.
- (tui/libtui.a): When recursing, pass down ${FLAGS_TO_PASS}. And
- don't echo the make command. This is closer to what the other
- recursions do.
- (HFILES_NO_SRCDIR): add hpread.h
- (COMMON_OBS): add hp-psymtab-read.o, hp-symtab-read.o
- (SFILES): add hp-psymtab-read.c, hp-symtab-read.c add rules for
- the new files. Remove hpread.c, hpread.o
- (gdb$(EXEEXT)): Depend on the actual tui library, not on a
- fictitious target. Since the fictitious target never existed,
- make would always relink.
- (tui/libtui.a): Always recurse to make sure the library is up to
- date.
-
-Wed Jan 6 12:05:12 1999 Stan Shebs <shebs@andros.cygnus.com>
-
- * remote.c: Pacify --enable-build-warnings, reformat code
- to conform to standards, fix spelling errors.
- (ishex, stubhex, record_currthread, etc): Declare.
- (ishex, stubhex): Declare char arg as int.
- (pack_string): Comment out, never used but possibly useful.
- (threadref_to_int, remote_get_threadinfo, etc): Make static.
-
-Wed Jan 6 11:43:32 1999 David Taylor <taylor@texas.cygnus.com>
-
- The following changes were made by Elena Zannoni
- <ezannoni@cygnus.com> and Edith Epstein <eepstein@cygnus.com> as
- part of a project to merge in changes made by HP.
-
- * c-exp.y: use external flag hp_som_som_object_present to decide
- whether code was compiled by HP's compilers. Add two new C++
- tokens for true and false.
- (yylex): check for template name is done differently for the
- HP/aCC compiler case. Change some of the template processing code
- for handling HP aCC templates. Handle true and false tokens.
-
-Tue Jan 5 11:13:36 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
-
- * remote.c (record_curthread): Must not modify inferior_pid when
- called from wait_for_inferior. Instead, if a new thread-id is
- detected, call add_thread.
- (MAGIC_NULL_PID): new macro, use instead of the magic number
- "42000".
- (remote_find_new_threads): if inferior_pid is unknown, get and use
- the current thread id.
- (remote_start_remote): on connecting, attempt to get the current
- thread id for inferior_pid.
- (remote_resume): If pid == -1, then resume any-thread (not the
- current thread specifically). Also some cosmetic fixups.
-
- * thread.c (info_threads_command): don't initialize current_pid
- until after call to FIND_NEW_THREADS (which may change inferior_pid).
- Also some cosmetic fixups.
- * infrun.c: cosmetic fixups and casts to avoid warnings.
- * infcmd.c: cosmetic fixups, mainly long lines.
-
-Tue Jan 5 11:55:57 1999 David Taylor <taylor@texas.cygnus.com>
+ * breakpoint.c (insert_breakpoints, remove_breakpoint,
+ breakpoint_here_p, breakpoint_inserted_here_p,
+ breakpoint_thread_match, bpstat_stop_status,
+ describe_other_breakpoints, check_duplicates, clear_command):
+ Coding standard fixes.
- * target.c (noprocess): terminate sentence with a period.
- * breakpoint.c (catch_command_1): ditto.
+ * target.c (target_xfer_memory): Add spaces, coding standard.
+ (do_xfer_memory): Add missing line to trust-readonly
+ code: check bfd SEC_READONLY flag for section.
- * c-valprint.c (c_value_print): remove hack^2 from HP; it causes
- testsuite losses with no real gain.
+2002-01-31 Andrew Cagney <ac131313@redhat.com>
- * inferior.h (START_INFERIOR_TRAPS_EXPECTED): restore, but only
- if tm-*.h hasn't overridden default value.
+ * PROBLEMS: Fix typo, 5.1->5.1.1.
-1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-01-30 Daniel Jacobowitz <drow@mvista.com>
- * configure.in: Fix whitespace indentation for --help.
- * configure: Regenerated.
+ * symtab.c (find_pc_sect_psymtab): Do not search psymtabs for
+ data symbols, since we search based on textlow and texthigh.
+ (find_pc_sect_symtab): Likewise.
+
+2002-01-30 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (vwarning): Declare.
+ * utils.c (vwarning): New function.
+ (warning): Call vwarning.
+ (warning_begin): Delete function.
+
+ * rs6000-nat.c (vmap_ldinfo): Use the function warning to print
+ the warning message.
+ * d10v-tdep.c (d10v_address_to_pointer) [0]: Delete call to
+ warning_begin.
+
+2002-01-30 Michael Snyder <msnyder@redhat.com>
+
+ * NEWS: Mention "set trust-readonly-sections" command.
+ Mention generate-core-file command.
+
+2002-01-15 Michael Snyder <msnyder@redhat.com>
+
+ * target.c: New command, "set trust-readonly-sections on".
+ (do_xfer_memory): Honor the suggestion to trust readonly sections
+ by reading them from the object file instead of from the target.
+ (initialize_targets): Register command "set trust-readonly-sections".
+
+2002-01-29 Andrew Cagney <ac131313@redhat.com>
+
+ * parse.c (target_map_name_to_register): Simplify, search regs and
+ pseudo-regs using a single loop.
+
+2002-01-30 Andrew Cagney <ac131313@redhat.com>
+
+ * PROBLEMS: Note that the i386 fix was missing from 5.1.1.
+
+2002-01-15 Rodney Brown <rbrown64@csc.com.au>
+
+ * config/i386/tm-i386v4.h: Define HAVE_I387_REGS.
+ * config/i386/i386v42mp.mh: Add i387-nat.o .
+ * i386v4-nat.c: Include i387-nat.h.
+ (supply_fpregset): Use i387_supply_fsave.
+ (fill_fpregset): Use i387_fill_fsave.
+
+2002-01-30 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_call_dummy_words): Define.
+ * arm-linux-tdep.c (arm_linux_call_dummy_words): Define.
+ * config/arm/tm-arm.h (CALL_DUMMY_P): Define.
+ (CALL_DUMMY_WORDS): Define.
+ (arm_call_dummy_words): Declare.
+ * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Define.
+ (arm_linux_call_dummy_words): Declare.
+
+2002-01-30 Andreas Schwab <schwab@suse.de>
+
+ * m68klinux-nat.c: Fix last change to use regcache_collect
+ instead of referencing registers[] directly.
+
+2002-01-29 Andrew Cagney <ac131313@redhat.com>
-1999-01-04 Manuel Bouyer <bouyer@antioche.lip6.fr>
+ * parse.c (target_map_name_to_register): Delete code wrapped in
+ #ifdef REGISTER_NAME_ALIAS_HOOK.
- * main.c: Add --write command line option, document -w.
- * gdb.1: Document --write.
+2002-01-28 Michael Snyder <msnyder@redhat.com>
+
+ * regcache.c (legacy_read_register_gen): Need to be able to
+ read pseudo-register as well as real register.
+ (legacy_write_register_gen): Ditto.
+
+2002-01-28 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/tm-wince.h (TARGET_BYTE_ORDER): Delete.
+ * config/sparc/tm-sparc.h (TARGET_BYTE_ORDER): Delete.
+ * config/ns32k/tm-umax.h (TARGET_BYTE_ORDER): Delete.
+ * config/ia64/tm-ia64.h (TARGET_BYTE_ORDER): Delete.
+ * config/m32r/tm-m32r.h (TARGET_BYTE_ORDER): Delete.
+ * config/m68k/tm-m68k.h (TARGET_BYTE_ORDER): Delete.
+ * config/m88k/tm-m88k.h (TARGET_BYTE_ORDER): Delete.
+ * config/mn10200/tm-mn10200.h (TARGET_BYTE_ORDER): Delete.
+ * config/pa/tm-hppa.h (TARGET_BYTE_ORDER): Delete.
+ * config/sh/tm-wince.h (TARGET_BYTE_ORDER): Delete.
+ * config/v850/tm-v850.h (TARGET_BYTE_ORDER): Delete.
+ * config/vax/tm-vax.h (TARGET_BYTE_ORDER): Delete.
+ * config/z8k/tm-z8k.h (TARGET_BYTE_ORDER): Delete.
+ * config/i960/tm-i960.h (TARGET_BYTE_ORDER): Delete.
+ * config/i386/tm-i386.h (TARGET_BYTE_ORDER): Delete.
+ * config/h8500/tm-h8500.h (TARGET_BYTE_ORDER): Delete.
+ * config/h8300/tm-h8300.h (TARGET_BYTE_ORDER): Delete.
+ * config/fr30/tm-fr30.h (TARGET_BYTE_ORDER): Delete.
+ * config/d30v/tm-d30v.h (TARGET_BYTE_ORDER): Delete.
+ * config/alpha/tm-alpha.h (TARGET_BYTE_ORDER): Delete.
+
+2002-01-28 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (TARGET_BYTE_ORDER_DEFAULT): Delete macro.
+ (target_byte_order): Initialize to BFD_ENDIAN_BIG.
+ (initialize_current_architecture): Update target_byte_order using
+ information from BFD.
+ * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_DEFAULT):
+ * config/arm/tm-arm.h (TARGET_BYTE_ORDER_DEFAULT): Delete.
+
+2002-01-28 Andrew Cagney <ac131313@redhat.com>
+
+ * config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here...
+ * vax-tdep.c (INVALID_FLOAT): To here. Document why it is broken.
+
+ * rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in
+ #ifdef INVALID_FLOAT.
+ * infcmd.c (do_registers_info): Ditto.
+ * values.c (unpack_double): Ditto. Add comment.
+
+ * config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was
+ already commented out.
+
+2002-01-26 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
+ * m68klinux-nat.c: Update ptrace interface for fetching/storing
+ registers and add support for PTRACE_GETREGS.
+
+2002-01-24 Andrew Cagney <ac131313@redhat.com>
+
+ GDB 5.1.1 released from 5.1 branch.
+ * NEWS: Add 5.1.1 news.
+ * README: Sync with 5.1 branch.
+
+2002-01-23 Fred Fish <fnf@redhat.com>
+
+ * mdebugread.c (parse_partial_symbols): Only copy stabstring1 to
+ stabstring on initial malloc. Reallocing will copy it for us,
+ if necessary.
+
+2002-01-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * Makefile.in (hpread_h): Delete.
+ (HFILES_NO_SRCDIR): Remove hpread.h.
+ (ALLDEPFILES): Remove hp-psymtab-read.c and hp-symtab-read.c.
+ (hpread.o): Update dependencies.
+ (hp-psymtab-read.o, hp-symtab-read.o): Remove.
+
+ * hp-psymtab-read.c: Remove file.
+ * hp-symtab-read.c: Remove file.
+ * hpread.h: Remove file.
+
+ * hpread.c: Merge all contents of hp-psymtab-read.c,
+ hp-symtab-read.c and hpread.h into this file, as it was prior to
+ January 1999.
+
+ * config/pa/hpux11w.mh, config/pa/hpux11.mh,
+ config/pa/hpux1020.mh, config/pa/hppaosf.mh,
+ config/pa/hppahpux.mh, config/pa/hppabsd.mh (NATDEPFILES):
+ Remove hp-psymtab-read.o and hp-symtab-read.o, add hpread.o.
+
+2002-01-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset,
+ fill_gregset): Call gdbarch_tdep() just once, assign result to
+ variable and use that, instead of calling the function several
+ times.
+
+2002-01-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.host: Accept sparcv9 as alias for sparc64.
+ * configure.tgt: Likewise.
+
+2002-01-22 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (build_so_list_from_mapfile)
+ (aix5_relocate_main_executable): Fix xcalloc() calls so order of
+ arguments is not reversed.
+ * solib-sunos.c (sunos_relocate_main_executable): Likewise.
+ * solib-svr4.c (svr4_relocate_main_executable): Likewise.
+
+2002-01-22 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_pseudo_register_read): New function. Renamed and
+ modified version of obsolete sh_fetch_pseudo_register.
+ (sh_fetch_pseudo_register): Rename to sh_pseudo_register_read.
+ (sh4_register_read): New function.
+ (sh_pseudo_register_write): New function. Renamed and modified
+ version of obsolete sh_store_pseudo_register.
+ (sh_store_pseudo_register): Rename to sh_pseudo_register_write.
+ (sh4_register_write): New function.
+ (sh_gdbarch_init): Remove setting of gdbarch function
+ fetch_pseudo_register and store_pseudo_register. Remove setting of
+ register_convert_to_raw, register_convert_to_virtual,
+ register_convertible.
+ (sh_sh4_register_convertible): Delete. No longer needed. All is
+ taken care by architecture specific functions
+ register_read/register_write.
+ (sh_sh4_register_convert_to_virtual): Make static.
+ (sh_sh4_register_convert_to_raw): Ditto.
+
+2002-01-22 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.c (floatformat_is_negative): Assert FMT is non NULL.
+ (floatformat_is_nan, floatformat_mantissa): Ditto.
+
+ * gdbtypes.c (_initialize_gdbtypes): Initialize TYPE_FLOATFORMAT
+ for builtin_type_ieee_single_little, builtin_type_ieee_double_big,
+ builtin_type_ieee_double_little,
+ builtin_type_ieee_double_littlebyte_bigword,
+ builtin_type_m68881_ext, builtin_type_i960_ext,
+ builtin_type_m88110_ext, builtin_type_m88110_harris_ext,
+ builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword,
+ builtin_type_ia64_spill_big, builtin_type_ia64_spill_little and
+ builtin_type_ia64_quad_big, builtin_type_ia64_quad_little.
+
+2002-01-22 Corinna Vinschen <vinschen@redhat.com>
+
+ * xstormy16-tdep.c (xstormy16_scan_prologue): Add frameless
+ parameter. Set frameless flag if it exists and depended of
+ whether the scanned function is frameless or not.
+ (xstormy16_skip_prologue): If function is frameless, return
+ result of xstormy16_scan_prologue().
+ (xstormy16_frame_init_saved_regs): Adjust xstormy16_scan_prologue()
+ call.
+
+2002-01-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_fp_frame_init_saved_regs, sh_push_arguments,
+ sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
+ sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs,
+ sh_sh4_register_byte, sh_sh4_register_raw_size,
+ sh_sh3e_register_virtual_type, sh_sh4_register_virtual_type,
+ sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual,
+ sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register,
+ sh_store_pseudo_register, sh_do_pseudo_register): Call
+ gdbarch_tdep() just once, assign result to variable and use that,
+ instead of calling the function several times.
+
+2002-01-20 Mark Kettenis <kettenis@gnu.org>
+
+ * go32-nat.c (fetch_register): Use FP_REGNUM_P and FPC_REGNUM_P
+ macros instead of LAST_FPU_CTRL_REGNUM.
+ (store_register): Likewise.
+
+2002-01-21 Jim Blandy <jimb@redhat.com>
+
+ * infcmd.c (run_command): Check that the `exec' target layer's BFD
+ is up-to-date before running the program, not just when a program
+ exits.
+
+2002-01-21 Fred Fish <fnf@redhat.com>
+
+ * arm-tdep.c (thumb_skip_prologue): Quit scanning prologue
+ when we have found all instructions we are looking for.
+
+2002-01-21 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (arm_register_name): New function.
+ (arm_registers_names): Make static.
+ * config/arm/tm-arm.h (arm_register_names): Delete declaration.
+ (arm_register_name): Declare.
+ (REGISTER_NAME): Use it.
+
+2002-01-21 Richard Earnshaw <rearnsha@arm.com>
+ Kevin Buettner <kevinb@redhat.com>
+
+ Convert arm targets to new FRAME interface.
+ * arm-tdep.c (struct frame_extra_info): Remove fsr.
+ (arm_frame_find_save_regs): Delete.
+ (arm_frame_init_saved_regs): New.
+ (arm_init_extra_frame_info): Alloacte saved_regs as required.
+ Allocate extra_info as required. Convert all uses of fsr.regs
+ to use saved_regs, similarly all uses of EXTRA_FRAME_INFO fields
+ to use extra_info.
+ (thumb_scan_prologue, arm_scan_prologue, arm_find_callers_reg)
+ (arm_frame_chain, arm_frame_saved_pc, arm_pop_frame): Likewise.
+ (check_prologue_cache, save_prologue_cache): Likewise.
+ (_initialize_arm_tdep): Ensure prologue_cache is correctly set up.
+ * config/arm/tm-arm.h (EXTRA_FRAME_INFO): Delete.
+ (FRAME_FIND_SAVED_REGS): Delete.
+ (arm_frame_find_saved_regs): Delete prototype.
+ (arm_frame_init_saved_regs): New prototype.
+ (FRAME_INIT_SAVED_REGS): Define.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * config/arc/tm-arc.h (IEEE_FLOAT): Delete.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ From Jeff Law <law@redhat.com>:
+ * infttrace.c: Include <sys/pstat.h>.
+ (child_pid_to_exec_file): Revamp. Use pstat call to get the
+ exec file if the ttrace equivalent fails.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * rdi-share/devsw.c (openLogFile): Delete unused ``struct tm lt''.
+ (closeLogFile): Ditto.
+
+2002-01-20 Michael Chastain <mec@shout.net>
+
+ * top.c (print_gdb_version): Bump copyright year to 2002.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Blanket Write Privs): Add Kevin Buettner, Elena
+ Zannoni and Eli Zaretskii.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * buildsym.c: Update copyright years.
+ * c-typeprint.c: Likewise.
+ * dwarf2read.c: Likewise.
+ * f-typeprint.c: Likewise.
+ * gdbtypes.c: Likewise.
+ * gdbtypes.h: Likewise.
+ * hp-symtab-read.c: Likewise.
+ * hpread.c: Likewise.
+ * mdebugread.c: Likewise.
+ * p-typeprint.c: Likewise.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-sim.c (gdbsim_open): Simplify code testing the macro
+ TARGET_BYTE_ORDER_SELECTABLE_P. Assume the target is always
+ byte-order selectable.
+ * sparc-tdep.c (sparc_target_architecture_hook): Ditto.
+ * arch-utils.c: Ditto.
+ (set_endian): Ditto.
+ (set_endian_from_file): Ditto.
+ * gdbserver/low-sim.c (create_inferior): Ditto.
+ * gdbarch.sh: Ditto.
+ * gdbarch.h: Re-generate.
+ * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE_P):
+ * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE):
+ * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER_SELECTABLE):
+ * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_SELECTABLE_P):
+ * config/arm/tm-wince.h (TARGET_BYTE_ORDER_SELECTABLE_P):
+ * config/arm/tm-linux.h (TARGET_BYTE_ORDER_SELECTABLE_P):
+ * config/arc/tm-arc.h (TARGET_BYTE_ORDER_SELECTABLE):
+ * config/arm/tm-arm.h (TARGET_BYTE_ORDER_SELECTABLE_P): Delete
+ macro definition.
+ * config/mips/tm-wince.h: Remove #undef of macro
+ TARGET_BYTE_ORDER_SELECTABLE.
+ * config/sh/tm-wince.h: Ditto.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.h (struct cplus_struct_type): Add is_artificial to
+ member function fields. Add accessor macro
+ TYPE_FN_FIELD_ARTIFICIAL.
+ * dwarf2read.c (dwarf2_add_member_fn): Check for artificial methods.
+ * c-typeprint.c (c_type_print_base): Skip artificial member
+ functions.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * f-typeprint.c: Delete unused function f_type_print_args.
+ * p-typeprint.c: Delete unused function pascal_type_print_args.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.h (struct type): Fix whitespace. Remove obsolete
+ comment. Add ``artificial'' to ``union field_location''.
+
+ * dwarf2read.c: Remove ad-hoc TYPE_FIELD_ARTIFICIAL.
+
+ * buildsym.c (finish_block): Initialize TYPE_FIELD_ARTIFICIAL to 0.
+ * mdebugread.c (parse_symbol): Likewise.
+ * stabsread.c (define_symbol): Likewise.
+ * hp-symtab-read.c (hpread_function_type): Likewise, instead of
+ initializing TYPE_FIELD_BITPOS to n (obsolete).
+ (hpread_doc_function_type): Likewise.
+ * hpread.c (hpread_function_type): Likewise.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.in (host_makefile_frag): Only require a host makefile
+ fragment when a native build.
+ * configure: Re-generate.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.h (floatformat_from_type): Declare.
+ * doublest.c (floatformat_from_type): New function.
+ (convert_typed_floating): Use.
+
+ * valprint.c (print_floating): Replace checks for IEEE_FLOAT with
+ call to function floatformat_from_type.
+
+ * gdbarch.sh (IEEE_FLOAT): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * config/i960/tm-i960.h (IEEE_FLOAT): Delete macro.
+ * config/i386/tm-i386.h (IEEE_FLOAT): Ditto.
+ * config/z8k/tm-z8k.h (IEEE_FLOAT): Ditto.
+ * config/sparc/tm-sparc.h (IEEE_FLOAT): Ditto.
+ * config/pa/tm-hppa.h (IEEE_FLOAT): Ditto.
+ * config/m88k/tm-m88k.h (IEEE_FLOAT): Ditto.
+ * config/m68k/tm-m68k.h (IEEE_FLOAT): Ditto.
+ * config/h8500/tm-h8500.h (IEEE_FLOAT): Ditto.
+ * config/h8300/tm-h8300.h (IEEE_FLOAT): Ditto.
+ * config/fr30/tm-fr30.h (IEEE_FLOAT): Ditto.
+ * config/arm/tm-arm.h (IEEE_FLOAT): Ditto.
+ * config/alpha/tm-alpha.h (IEEE_FLOAT): Ditto.
+
+ * s390-tdep.c (s390_gdbarch_init): Do not set ieee_float.
+ * x86-64-tdep.c (i386_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+
+2002-01-20 Jiri Smid <smid@suse.cz>
+
+ * configure.host, configure.tgt: Support x86-64.
+ * NEWS: Note new target x86-64.
+
+ * config/i386/x86-64linux.mh (NATDEPFILES): x86-64-nat.o removed.
+ * x86-64-linux-nat.c (x86_64_register_u_addr): New function.
+ * config/i386/nm-x86-64.h (ATTACH_LWP): Removed.
+ * Makefile.in (x86-64-tdep.o, x86-64-linux-tdep.o,
+ x86-64-linux-nat.o): Fix dependencies.
+
+2002-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c: Remove #ifndef MALLOC_INCOMPATIBLE.
+ * config/sparc/xm-sun4os4.h (PTRACE_ARG3_TYPE): Move macro ....
+ * config/sparc/nm-sun4os4.h (PTRACE_ARG3_TYPE): ... to here.
+ * config/sparc/xm-sun4os4.h: Delete file.
+ * config/sparc/sun4os4.mh (XM_FILE): Delete makefile variable.
+
+2002-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * config/sparc/sparclynx.mh (XM_FILE): Delete.
+ * config/rs6000/rs6000lynx.mh (XM_FILE): Delete.
+ * config/m68k/m68klynx.mh (XM_FILE): Delete.
+ * config/i386/i386lynx.mh (XM_FILE): Delete.
+ * config/rs6000/xm-rs6000ly.h: Delete file.
+ * config/sparc/xm-sparclynx.h: Delete file.
+ * config/m68k/xm-m68klynx.h: Delete file.
+ * config/i386/xm-i386lynx.h: Delete file.
+ * config/xm-lynx.h: Delete file.
+ * config/djgpp/fnchange.lst: Update.
+
+2002-01-19 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_register_byte): New function.
+ (alpha_register_raw_size): Ditto.
+ (alpha_register_virtual_size): Ditto.
+ (alpha_skip_prologue_internal): Renamed from
+ alpha_skip_prologue.
+ (alpha_skip_prologue): New version that calls
+ alpha_skip_prologue_internal.
+ (alpha_in_lenient_prologue): Use alpha_skip_prologue_internal.
+ * config/alpha/tm-alpha.h (SKIP_PROLOGUE): Remove
+ second argument from alpha_skip_prologue.
+ (REGISTER_BYTE): Use alpha_register_byte.
+ (REGISTER_RAW_SIZE): Use alpha_register_raw_size.
+ (REGISTER_VIRTUAL_SIZE): Use alpha_register_virtual_size.
+ (FRAMELESS_FUNCTION_INVOCATION): Use
+ generic_frameless_function_invocation_not.
+ (FRAME_NUM_ARGS): Use frame_num_args_unknown.
+ (COERCE_FLOAT_TO_DOUBLE): Use standard_coerce_float_to_double.
+
+2002-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/xm-news-mips.h: Delete file.
+ * config/mips/news-mips.mh (XM_FILE): Delete makefile variable.
+
+ * config/m88k/xm-m88k.h: Delete file.
+ * config/m88k/xm-dgux.h: Do not include xm-m88k.h.
+ * config/m88k/xm-delta88v4.h: Ditto.
+ * config/m88k/xm-delta88.h: Ditto.
+
+ * config/alpha/xm-fbsd.h: Delete file.
+ * config/alpha/fbsd.mh (XM_FILE): Delete makefile variable.
+
+ * config/sparc/xm-sparc.h: Delete file.
+ * Makefile.in (xm-sun4os4.h): Delete dependency.
+ * config/sparc/xm-sun4sol2.h: Do not include xm-sparc.h.
+ * config/sparc/xm-sun4os4.h: Ditto.
+ * config/sparc/xm-linux.h: Ditto.
+
+ * config/i386/xm-windows.h: Delete file.
+
+2002-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c: Include <sys/param.h> for MAXPATHLEN.
+ (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined.
+
+2002-01-19 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_call_dummy_words): New.
+ * config/alpha/tm-alpha.h (CALL_DUMMY): Remove.
+ (CALL_DUMMY_P): Define.
+ (CALL_DUMMY_WORDS): Define.
+ (SIZEOF_CALL_DUMMY_WORDS): Define.
+
+2002-01-19 Per Bothner <per@bothner.com>
+
+ * gnu-v3-abi.c (gnuv3_rtti_type): Guard that vtable_symbol_name
+ isn't NULL, which can happen with some gcj-3.x-produced code.
+
+2002-01-19 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_register_virtual_type): New function.
+ (alpha_init_frame_pc_first): Ditto.
+ (alpha_fix_call_dummy): Ditto.
+ (alpha_store_struct_return): Ditto.
+ (alpha_extract_struct_value_address): Ditto.
+ * config/alpha/tm-alpha.h (REGISTER_VIRTUAL_TYPE): Use
+ alpha_register_virtual_type.
+ (STORE_STRUCT_RETURN): Use alpha_store_struct_return.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Use
+ alpha_extract_struct_value_address.
+ (FIX_CALL_DUMMY): Use alpha_fix_call_dummy.
+ (INIT_FRAME_PC): Use init_frame_pc_noop.
+ (INIT_FRAME_PC_FIRST): Use alpha_init_frame_pc_first.
+
+2002-01-19 Mark Kettenis <kettenis@gnu.org>
+
+ * i386gnu-nat.c: Include "i386-tdep.h".
+ (fetch_fpregs): Simplify code dealing with uninitialized floating
+ point states such that it doesn't require FP7_REGNUM.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (frame_extra_info): New.
+ (alpha_find_saved_regs): Make static. Use
+ frame->extra_info.
+ (alpha_frame_init_saved_regs): New function.
+ (alpha_frame_saved_pc): Use frame->extra_info.
+ (temp_saved_regs): Don't declare as struct frame_saved_regs.
+ (heuristic_proc_desc): Adjust for temp_saved_regs changes.
+ (init_extra_frame_info): Rename to...
+ (alpha_init_extra_frame_info): ...this. Use frame->extra_info.
+ (alpha_print_extra_frame_info): New function.
+ (alpha_frame_locals_address): Ditto.
+ (alpha_frame_args_address): Ditto.
+ (alpha_pop_frame): Use frame->extra_info.
+ * config/alpha/tm-alpha.h (FRAME_ARGS_ADDRESS): Use
+ alpha_frame_args_address.
+ (FRAME_LOCALS_ADDRESS): Use alpha_frame_locals_address.
+ (alpha_find_saved_regs): Remove prototype.
+ (FRAME_INIT_SAVED_REGS): Use alpha_frame_init_saved_regs.
+ (EXTRA_FRAME_INFO): Remove.
+ (INIT_EXTRA_FRAME_INFO): Use alpha_init_extra_frame_info.
+ (PRINT_EXTRA_FRAME_INFO): Use alpha_print_extra_frame_info.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_osf_in_sigtramp): New function.
+ (alpha_cannot_fetch_register): Ditto.
+ (alpha_cannot_store_register): Ditto.
+ (alpha_register_convertible): Ditto.
+ (alpha_use_struct_convention): Ditto.
+ * config/alpha/tm-alpha.h: Update copyright years.
+ (IN_SIGTRAMP): Use alpha_osf_in_sigtramp.
+ (INNER_THAN): Use core_addr_lessthan.
+ (CANNOT_FETCH_REGISTER): Use alpha_cannot_fetch_register.
+ (CANNOT_STORE_REGISTER): Use alpha_cannot_store_register.
+ (REGISTER_CONVERTIBLE): Use alpha_register_convertible.
+ (USE_STRUCT_CONVENTION): Use alpha_use_struct_convention.
+ (FRAME_CHAIN): Remove unnecessary cast.
+
+2002-01-18 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Document that testsuite/gdb.hp/gdb.threads-hp/ is
+ obsolete.
+
+2002-01-18 Andrew Cagney <ac131313@redhat.com>
+
+ * infptrace.c: Remove ATTRIBUTE_UNUSED. Update copyright.
+ * monitor.c, remote-array.c, remote-bug.c: Ditto.
+ * remote-e7000.c, remote-es.c, remote-mips.c: Ditto.
+ * remote-nindy.c, remote-os9k.c, remote-rdi.c: Ditto.
+ * remote-rdp.c, remote-sds.c, remote-sim.c: Ditto.
+ * remote-st.c, remote-vx.c, remote.c, win32-nat.c: Ditto.
+ * x86-64-linux-nat.c: Ditto.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_register_name): New function.
+ * config/alpha/tm-alpha.h (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): Define.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/nm-nbsd.h (KERNEL_U_ADDR): Remove.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c: Update copyright years.
+ (alpha_next_pc): New function.
+ (alpha_software_single_step): Ditto.
+ * config/alpha/tm-alpha.h: Add prototype for
+ alpha_software_single_step.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alphabsd-nat.c: Update copyright years.
+ (fill_gregset): Use regcache_collect.
+ (fill_fpregset): Likewise.
+ (fetch_inferior_registers): Only fetch integer registers
+ if requested to do so.
+ (store_inferior_registers): Only store integer registers
+ if requested to do so.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * config/alpha/alpha-osf3.mh (XDEPFILES): Delete.
+ * config/alpha/alpha-osf2.mh (XDEPFILES): Delete.
+ * config/alpha/alpha-osf1.mh (XDEPFILES): Delete.
+ * config/alpha/alpha-linux.mh (XDEPFILES): Delete.
+ * config/alpha/fbsd.mh (XDEPFILES): Delete.
+ * config/arm/linux.mh (XDEPFILES): Delete.
+ * config/arm/nbsd.mh (XDEPFILES): Delete.
+ * config/i386/i386dgux.mh (XDEPFILES): Delete.
+ * config/i386/i386sol2.mh (XDEPFILES): Delete.
+ * config/i386/i386m3.mh (XDEPFILES): Delete.
+ (NATDEPFILES): Move i387-tdep.o and core-aout.o to here.
+ * config/i386/i386gnu.mh (XDEPFILES): Delete.
+ * config/i386/fbsd.mh (XDEPFILES): Delete.
+ * config/i386/i386bsd.mh (XDEPFILES): Delete.
+ * config/i386/i386sco5.mh (XDEPFILES): Delete.
+ * config/i386/i386v4.mh (XDEPFILES): Delete.
+ * config/i386/i386v42mp.mh (XDEPFILES): Delete.
+ * config/i386/i386sco4.mh (XDEPFILES): Delete.
+ * config/i386/i386aix.mh (XDEPFILES): Delete.
+ * config/i386/go32.mh (XDEPFILES): Delete.
+ * config/i386/cygwin.mh (XDEPFILES): Delete.
+ * config/i386/i386lynx.mh (XDEPFILES): Delete.
+ * config/i386/i386mach.mh (XDEPFILES): Delete.
+ * config/i386/i386v32.mh (XDEPFILES): Delete.
+ * config/i386/linux.mh (XDEPFILES): Delete.
+ * config/i386/nbsdelf.mh (XDEPFILES): Delete.
+ * config/i386/ncr3000.mh (XDEPFILES): Delete.
+ * config/i386/i386mk.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/i386/i386sco.mh (XDEPFILES): Delete.
+ * config/i386/i386v.mh (XDEPFILES): Delete.
+ * config/i386/nbsd.mh (XDEPFILES): Delete.
+ * config/i386/ptx.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/i386/ptx4.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/i386/symmetry.mh (XDEPFILES): Delete.
+ * config/i386/obsd.mh (XDEPFILES): Delete.
+ * config/i386/x86-64linux.mh (XDEPFILES): Delete.
+ * config/ia64/linux.mh (XDEPFILES): Delete.
+ * config/ia64/aix.mh (XDEPFILES): Delete.
+ * config/m68k/apollo68b.mh (XDEPFILES): Delete.
+ * config/m68k/dpx2.mh (XDEPFILES): Delete.
+ * config/m68k/3b1.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/m68k/apollo68v.mh (XDEPFILES): Delete.
+ * config/m68k/hp300bsd.mh (XDEPFILES): Delete.
+ * config/m68k/linux.mh (XDEPFILES): Delete.
+ * config/m68k/m68klynx.mh (XDEPFILES): Delete.
+ * config/m68k/m68kv4.mh (XDEPFILES): Delete.
+ * config/m68k/nbsd.mh (XDEPFILES): Delete.
+ * config/m68k/sun2os3.mh (XDEPFILES): Delete.
+ * config/m68k/sun2os4.mh (XDEPFILES): Delete.
+ * config/m68k/sun3os3.mh (XDEPFILES): Delete.
+ * config/m68k/sun3os4.mh (XDEPFILES): Delete.
+ * config/m88k/delta88.mh (XDEPFILES): Delete.
+ * config/m88k/delta88v4.mh (XDEPFILES): Delete.
+ * config/m88k/m88k.mh (XDEPFILES): Delete.
+ * config/mips/littlemips.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/mips/linux.mh (XDEPFILES): Delete.
+ * config/mips/irix6.mh (XDEPFILES): Delete.
+ * config/mips/irix5.mh (XDEPFILES): Delete.
+ * config/mips/irix4.mh (XDEPFILES): Delete.
+ * config/mips/irix3.mh (XDEPFILES): Delete.
+ * config/mips/decstation.mh (XDEPFILES): Delete.
+ * config/mips/mipsm3.mh (XDEPFILES): Delete.
+ (NATDEPFILES): Move core-aout.o to here.
+ * config/ns32k/nbsd.mh (XDEPFILES): Delete.
+ * config/pa/hpux1020.mh (XDEPFILES): Delete.
+ * config/pa/hppabsd.mh (XDEPFILES): Delete.
+ * config/pa/hppahpux.mh (XDEPFILES): Delete.
+ * config/pa/hpux11w.mh (XDEPFILES): Delete.
+ * config/pa/hppaosf.mh (XDEPFILES): Delete.
+ * config/pa/hpux11.mh (XDEPFILES): Delete.
+ * config/powerpc/aix.mh (XDEPFILES): Delete.
+ * config/powerpc/nbsd.mh (XDEPFILES): Delete.
+ * config/powerpc/linux.mh (XDEPFILES): Delete.
+ * config/romp/rtbsd.mh: Rename XDEPFILES.
+ * config/rs6000/rs6000lynx.mh (XDEPFILES): Delete.
+ * config/rs6000/aix4.mh (XDEPFILES): Delete.
+ * config/rs6000/rs6000.mh (XDEPFILES): Delete.
+ * config/s390/s390.mh (XDEPFILES): Delete.
+ * config/vax/vaxbsd.mh (NATDEPFILES): Rename XDEPFILES.
+ * config/sparc/sun4sol2.mh (XDEPFILES): Delete.
+ * config/sparc/sun4os4.mh (XDEPFILES): Delete.
+ * config/sparc/sparclynx.mh (XDEPFILES): Delete.
+ * config/sparc/nbsdelf.mh (XDEPFILES): Delete.
+ * config/sparc/nbsd.mh (XDEPFILES): Delete.
+ * config/sparc/linux.mh (XDEPFILES): Delete.
+ * config/vax/vaxult.mh (XDEPFILES): Delete.
+ * config/vax/vaxult2.mh (XDEPFILES): Delete.
+ * Makefile.in (DEPFILES): Remove XDEPFILES.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (internal_verror): Fix comments, default is yes not no.
+ Update queries to match. Default to quit and dump core.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.c: Update assuming #if UI_OUT is always true. Update
+ copyright.
+ * defs.h, event-top.c, gdbcmd.h: Ditto.
+ * infcmd.c, infrun.c, main.c, printcmd.c, remote.c: Ditto.
+ * source.c, stack.c, symfile.c, symtab.c, thread.c: Ditto.
+ * top.c, cli/cli-cmds.c, cli/cli-decode.c: Ditto.
+ * cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.c: Ditto.
+ * mi/ChangeLog, mi/mi-cmd-break.c, mi/mi-cmd-stack.c: Ditto.
+ * mi/mi-main.c:Ditto.
+
+ * stack.c, symfile.c: Update copyright.
+
+2002-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/low-hppabsd.c, gdbserver/low-lynx.c,
+ gdbserver/low-nbsd.c, gdbserver/low-sim.c,
+ gdbserver/low-sparc.c, gdbserver/low-sun3.c,
+ gdbserver/low-linux.c, gdbserver/server.c: Correct copyright notices.
+
+2002-01-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/low-hppabsd.c (myattach): New function, returning -1.
+ * gdbserver/low-lynx.c (myattach): Likewise.
+ * gdbserver/low-nbsd.c (myattach): Likewise.
+ * gdbserver/low-sim.c (myattach): Likewise.
+ * gdbserver/low-sparc.c (myattach): Likewise.
+ * gdbserver/low-sun3.c (myattach): Likewise.
+
+ * gdbserver/low-linux.c (myattach): New function.
+
+ * gdbserver/server.c (attach_inferior): New function.
+ (main): Handle "--attach".
+
+2002-01-16 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (language support): Daniel Jacobwitz is C++
+ maintainer.
+
+2002-01-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * c-typeprint.c (is_type_conversion_operator): Add additional
+ check for non-conversion operators.
+
+2002-01-15 Michael Snyder <msnyder@redhat.com>
+
+ * linux-proc.c: Add "info proc" command, a la procfs.c.
+ (read_mapping): New function, abstract and re-use code.
+ (linux_find_memory_regions): Use new func read_mapping.
+ (linux_info_proc_cmd): New function, implement "info proc".
+ (_initialize_linux_proc): Add new command "info proc".
+
+2002-01-15 Michael Snyder <msnyder@redhat.com>
+
+ * symfile.c (generic_load): Use bfd_map_over_sections method
+ instead of manipulating bfd structure members directly.
+ (add_section_size_callback): New function, bfd sections callback
+ used by generic_load.
+ (load_sections_callback): New function, bfd sections callback
+ used by generic_load.
+
+2002-01-15 Elena Zannoni <ezannoni@redhat.com>
+
+ [Based on work by Jim Blandy]
+ * gdbtypes.h (builtin_type_v16qi, builtin_type_v8hi): Export.
+ (builtin_type_vec128): Export.
+ * gdbtypes.c (builtin_type_v16qi, builtin_type_v8hi): New SIMD
+ types.
+ (builtin_type_vec128): New builtin type for 128 bit vector
+ registers.
+ (build_gdbtypes): Initialize builtin_type_v16qi and
+ builtin_type_v8hi. Create the vec128 register builtin type
+ structure.
+ (build_builtin_type_vec128): New function.
+ (_initialize_gdbtypes): Register builtin_type_v16qi and
+ builtin_type_v8hi with gdbarch. Same for builtin_type_vec128.
+ * rs6000-tdep.c (rs6000_register_virtual_type): Change type of
+ AltiVec register to new builtin type.
+
+2001-01-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * stabsread.c (read_type): Pass dbx_lookup_type (typenums)
+ to make_cv_type.
+
+2002-01-14 Andrew Cagney <ac131313@redhat.com>
+
+ * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Rename
+ CLEAN_UP_REGISTER_VALUE.
+ * regcache.c (supply_register): Update only call.
+
+2002-01-14 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*,
+ a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and
+ a29k-*-vxworks* targets as obsolete.
+
+2002-01-14 Michael Snyder <msnyder@redhat.com>
+
+ * linux-proc.c (linux_do_thread_registers): Ignore fpxregs
+ until we can resolve portability issues.
+ * gregset.h: Remove references to fpxregs.
+ * gcore.c (gcore_command): Initialize note_sec to NULL.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ * signals.c (target_signal_to_name): Rewrite. Only use
+ signals[].name when in bounds and non-NULL.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ From Petr Ledvina <ledvinap@kae.zcu.cz>:
+ * signals.c (target_signal_to_name): Verify that SIG is within the
+ bounds of the signals array.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Remove arm-coff and arm-pe from target list.
+
+2002-01-13 Keith Seitz <keiths@redhat.com>
+
+ * stack.c (print_frame_info_base): Print the frame's pc
+ only if when print_frame_info_listing_hook is not defined.
+
+2002-01-13 Keith Seitz <keiths@redhat.com>
+
+ * varobj.c (varobj_set_value): Make sure that there were no
+ errors evaluating the object before attempting to set its
+ value.
+ value_cast now properly adjusts VALUE_ADDRESS for baseclasses,
+ so this offset adjustment is no longer necessary.
+ (create_child): Don't set the error flag if the child is
+ a CPLUS_FAKE_CHILD.
+ (value_of_child): If value_fetch_lazy fails, return NULL
+ so that callers will be notified that an error occurred.
+ (c_value_of_variable): Delay check of variable's validity
+ until later. We actually want all structs and unions to have
+ the value "{...}".
+ Do not return "???" for variables which could not be evaluated.
+ This error condition must be returned to the caller so that it
+ can get the error condition from gdb.
+ (cplus_name_of_child): Adjust index for vptr before figuring
+ out the name of the child.
+ (cplus_value_of_child): If a child's (real) parent is not valid,
+ don't even bother trying to give a value for it. Just return
+ an error. Change all instances in this function.
+ (cplus_type_of_child): If our parent is one of the "fake"
+ parents, we need to get at the type of the real parent, and
+ derive the child's true type using this information.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-01-09 John Marshall <johnm@falch.net>:
+ * CONTRIBUTE, README, TODO: Change sourceware.cygnus.com to
+ sources.redhat.com, and tweak some related URLs which had
+ suffered from linkrot.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ From Jeff law:
+ * hppa-tdep.c (hppa_push_arguments): Correct handling of 5-7 byte
+ structures passed in registers.
+
+2002-01-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (save_npx) [__DJGPP_MINOR__ < 3]: Remove extraneous
+ white space which prevented compilation. Reported by DSK
+ <dsk@student.unsw.edu.au>.
+
+2002-01-11 Michael Snyder <msnyder@redhat.com>
+
+ * symfile.c (build_section_addr_info_from_section_tab):
+ Use bfd access method instead of manipulating bfd directly.
+ (syms_from_objfile): Ditto.
+ (simple_overlay_update_1): Ditto.
+ (simple_overlay_update): Ditto.
+ (generic_load): Ditto.
+ (overlay_unmapped_address): FIXME comment, bfd access methods.
+ (sections_overlap): FIXME comment, bfd access methods.
+ (pc_in_mapped_range): FIXME comment, bfd access methods.
+ (pc_in_unmapped_range): FIXME comment, bfd access methods.
+ (section_is_mapped): FIXME comment, bfd access methods.
+ (section_is_overlay): FIXME comment, bfd access methods.
+
+ * symfile.c (generic_load): Whitespace and long line cleanups.
+ Remove duplicate variable, change several local variables to
+ more appropriate data types.
+ (print_transfer_performance): Use %lu instead of %ld for ulongs.
+
+2002-01-12 Andrew Cagney <ac131313@redhat.com>
+
+ From Peter Schauer:
+ * language.c (longest_local_hex_string_custom): Use phex_nz to
+ convert NUM to a hex string.
+
+2002-01-12 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_gdbarch_init): Move setting of long_bit earlier in
+ the function.
+ Update Copyright year.
+
+2002-01-12 Andrew Cagney <ac131313@redhat.com>
+
+ * language.c (longest_raw_hex_string): Delete unused function.
+
+2002-01-11 Petr Sorfa <petrs@caldera.com>
+
+ * MAINTAINERS (write-after-approval): Add myself.
+ * dwarf2read.c (read_tag_string_type): Handling of
+ DW_AT_byte_size.
+ (read_tag_string_type): FORTRAN fix to prevent propagation of
+ first string size.
+ (set_cu_language): Handling of DW_LANG_Fortran95
+
+2002-01-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid ->
+ GETPID(inferior_ptid).
+ (store_inferior_registers): Likewise.
+
+2002-01-10 Jason Merrill <jason@redhat.com>
+
+ * dwarf2read.c (decode_locdesc): Implement DW_OP_litn, DW_OP_dup.
+ Fix DW_OP_minus.
+
+2002-01-10 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Add renames for bfd/ChangeLog-0001
+ and bfd/elf32-sh-nbsd.c.
+
+2002-01-10 Michael Snyder <msnyder@redhat.com>
+
+ * NEWS: Mention --pid and corefile/proc-id behavior change.
+
+ * Makefile.in: Add rules for gcore.o and linux-proc.o.
+ * gcore.c: Include cli/cli-decode.h instead of command.h.
+
+ * main.c (captured_main): Add new command line option "--pid".
+ If the second command line argument (following the symbol-file)
+ begins with a digit, try to attach to it before trying to open
+ it as a corefile.
+ (print_gdb_help): Document the "--pid" argument.
+
+2002-01-10 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * completer.c (command_completer): New function.
+
+ * completer.h <command_completer>: Add prototype.
+
+ * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the
+ completer for the "help" command.
+
+2002-01-09 Jason Merrill <jason@redhat.com>
+
+ * c-typeprint.c (is_type_conversion_operator): Fix thinko.
+
+2002-01-09 Michael Snyder <msnyder@redhat.com>
+
+ * i386-linux-nat.c (fill_fpxregset): Make global.
+ (store_fpxregset): Ditto.
+
+ * gregset.h (gdb_fpxregset_t): Define.
+ (supply_fpxregset): Prototype.
+ (fill_fpxregset): Prototype.
+
+ * exec.c (exec_make_note_section): Don't call elfcore_write_prpsinfo.
+
+2002-01-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/arm/arm-tdep.h (arm_software_single_step): Remove PARAMS.
+ * config/arm/nm-nbsd.h (arm_register_u_addr): Likewise.
+ * config/arm/tm-nbsd.h (get_longjmp_target): Likewise.
+
+2002-01-09 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Update target maintainer rules so that any
+ Maintainer can approve a tested patch for a maintenance-only
+ target.
+
+2002-01-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * MAINTAINERS (write-after-approval): Add myself.
+
+ * arm-tdep.c (arm_init_extra_frame_info): Cast NULL argument to
+ IN_SIGTRAMP.
+
+2002-01-08 Michael Snyder <msnyder@redhat.com>
+
+ * linux-proc.c (child_pid_to_exec_file): Use readlink to get the
+ real name of the executable, rather than the /proc name.
+
+2002-01-03 Michael Snyder <msnyder@redhat.com>
+
+ Implement a "generate-core-file" command in gdb, save target state.
+ * gcore.c: New file. Implement new command 'generate-core-file'.
+ Save a corefile image of the current state of the inferior.
+ * linux-proc.c: Add linux-specific code for saving corefiles.
+ * target.h (struct target_ops): Add new target vectors for saving
+ corefiles; to_find_memory_regions and to_make_corefile_notes.
+ (target_find_memory_regions): New macro.
+ (target_make_corefile_notes): New macro.
+ * target.c (update_current_target): Inherit new target methods.
+ (dummy_find_memory_regions): New place-holder method.
+ (dummy_make_corefile_notes): New place-holder method.
+ (init_dummy_target): Initialize new dummy target vectors.
+ * exec.c (exec_set_find_memory_regions): New function.
+ Allow the exec_ops vector for memory regions to be taken over.
+ (exec_make_note_section): New function, target vector method.
+ * defs.h (exec_set_find_memory_regions): Export prototype.
+ * procfs.c (proc_find_memory_regions): New function, corefile method.
+ (procfs_make_note_section): New function, corefile method.
+ (init_procfs_ops): Set new target vector pointers.
+ (find_memory_regions_callback): New function.
+ (procfs_do_thread_registers): New function.
+ (procfs_corefile_thread_callback): New function.
+ * sol-thread.c (sol_find_memory_regions): New function.
+ (sol_make_note_section): New function.
+ (init_sol_thread_ops): Initialize new target vectors.
+ * inftarg.c (inftarg_set_find_memory_regions): New function.
+ Allow to_find_memory_regions vector to be taken over.
+ (inftarg_set_make_corefile_notes): New function.
+ Allow to_make_corefile_notes vector to be taken over.
+ * thread-db.c (thread_db_new_objfile): Don't activate thread-db
+ interface layer if not target_has_execution (may be a corefile).
+ * config/i386/linux.mh: Add gcore.o to NATDEPFILES.
+ * config/sparc/sun4sol2.mh: Ditto.
+ * config/alpha/alpha-linux.mh: Ditto.
+ * config/arm/linux.mh: Ditto.
+ * config/i386/x86-64linux.mh: Ditto.
+ * config/ia64/linux.mh: Ditto.
+ * config/m68k/linux.mh: Ditto.
+ * config/mips/linux.mh: Ditto.
+ * config/powerpc/linux.mh: Ditto.
+ * config/sparc/linux.mh: Ditto.
+
+2002-01-07 Michael Snyder <msnyder@redhat.com>
+
+ * arm-linux-nat.c: Remove references to regcache.c internal data
+ (registers[] and register_valid[]).
+
+2002-01-07 Michael Snyder <msnyder@redhat.com>
+
+ * linux-proc.c: New file. Implement child_pid_to_exec_file,
+ so that attaching to a pid will automatically read the process's
+ symbol file and shlibs.
+ * Makefile.in: Add rule for linux-proc.o.
+ * config/nm-linux.h: Define CHILD_PID_TO_EXEC_FILE.
+ * config/alpha/alpha-linux.mh: Add linux-proc.o to NATDEPFILES.
+ * config/arm/linux.mh: Ditto.
+ * config/i386/linux.mh: Ditto.
+ * config/i386/x86-64linux.mh: Ditto.
+ * config/ia64/linux.mh: Ditto.
+ * config/m68k/linux.mh: Ditto.
+ * config/mips/linux.mh: Ditto.
+ * config/powerpc/linux.mh: Ditto.
+ * config/sparc/linux.mh: Ditto.
+
+2002-01-06 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * win32-nat.c: Add i386-tdep.h dependency.
+
+2002-01-07 Michael Snyder <msnyder@redhat.com>
+
+ * solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT
+ instead of bfd_get_arch_size. Don't bail out just because
+ there's no exec_bfd.
+
+ * cp-valprint.c (cp_print_value): FIXME comment, alloca size.
+ * p-valprint.c (pascal_object_print_value): Ditto.
+ * somread.c (som_symtab_read): Ditto.
+ * symfile.c (simple_free_overlay_region_table): Ditto.
+ * valops.c (value_assign): Ditto.
+
+ * tracepoint.c (tracepoint_save_command): From Klee Dienes --
+ use tilde_expand and strerror for opening save-tracepoints file.
+
+ * thread-db.c (thread_db_new_objfile): Indendation fix.
+
+ * infptrace.c (GDB_MAX_ALLOCA): New define.
+ (child_xfer_memory): Use xmalloc/xfree instead of alloca if the
+ size of the buffer exceeds GDB_MAX_ALLOCA (default 1 megabyte,
+ can be overridden with whatever value is appropriate to the host).
+ * infttrace.c (child_xfer_memory): Add FIXME warning about use of
+ alloca to allocate potentially large buffer.
+ * rs6000-nat.c (child_xfer_memory): Ditto.
+ * symm-nat.c (child_xfer_memory): Ditto.
+ * x86-64-linux-nat.c (child_xfer_memory): Ditto.
+
+2002-01-07 Jackie Smith Cashion <jsmith@redhat.com>
+
+ From Nick Clifton <nickc@redhat.com>
+ * d10v-tdep.c: Set STACK_START to 0x200bffe.
+
+2002-01-07 Michael Snyder <msnyder@redhat.com>
+
+ * solib-legacy.c (legacy_svr4_fetch_link_map_offsets):
+ Don't use exec_bfd if it's NULL.
+
+2002-01-06 Mark Kettenis <kettenis@gnu.org>
+
+ * valops.c (value_arg_coerce): Fix formatting.
+
+2002-01-06 Andrew Cagney <ac131313@redhat.com>
+
+ * hp-psymtab-read.c: Include "gdb_string.h" instead of <string.h>.
+ * gnu-nat.c: Ditto.
+
+2002-01-06 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Note that alpha-dec-osf4.0a, arc-elf, arm-coff,
+ arm-elf, arm-pe, d30v-elf, fr30-elf, h8300hms, h8500hms,
+ i960-coff, m32r-elf, m68k-elf, m88k, mcore-elf, mn10200-elf,
+ ns32k-netbsd, hppa1.1-hp-proelf, v850-elf, vax-dec-vms5.5 and
+ z8k-coff have not been multi-arched. Update z8k-coff build
+ status.
+
+2002-01-06 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Mark a29k target as obsolete.
+ * Makefile.in (a29k-tdep.o, remote-adapt.o, remote-eb.o)
+ (remote-mm.o, remote-udi.o): Obsolete. Remove references in
+ comments.
+ * NEWS: Note that a29k targets are obsolete.
+ * a29k-tdep.c: Mark as obsolete.
+ * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*,
+ a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and
+ a29k-*-vxworks* targets as obsolete.
+ * remote-adapt.c: Obsolete.
+ * remote-eb.c: Obsolete.
+ * remote-mm.c: Obsolete.
+ * remote-udi.c: Obsolete.
+ * config/a29k/a29k-udi.mt: Obsolete.
+ * config/a29k/a29k.mt: Obsolete.
+ * config/a29k/tm-a29k.h: Obsolete.
+ * config/a29k/tm-vx29k.h: Obsolete.
+ * config/a29k/vx29k.mt: Obsolete.
+
+2002-01-05 Andrew Cagney <ac131313@redhat.com>
+
+ * rs6000-tdep.c (rs6000_do_registers_info): Replace BIG_ENDIAN
+ with BFD_ENDIAN_BIG.
+
+2002-01-05 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.in (AC_CHECK_HEADERS): Do not check for <endian.h>.
+ * configure, config.in: Re-generate.
+ * config/vax/xm-vaxbsd.h: Do not include <machine/endian.h>.
+ * defs.h: Do not include <endian.h>.
+
+2002-01-05 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * acconfig.h (HAVE_PT_GETXMMREGS): New.
+ * config.in: Regenerate.
+ * configure.in: Update copyright years.
+ Add test for PT_GETXMMREGS supplied by <sys/ptrace.h>.
+ * configure: Regenerate.
+ * i386bsd-nat.c: Update copyright years.
+ (fill_gregset): Use regcache_collect.
+ (fetch_inferior_registers): Only fetch integer registers
+ if requested to do so. Add support for XMM registers
+ using PT_GETXMMREGS.
+ (store_inferior_registers): Only store integer registers
+ if requested to do so. Add support for XMM registers
+ using PT_SETXMMREGS.
+ * i386nbsd-nat.c (fetch_inferior_registers): Remove.
+ (store_inferior_registers): Remove.
+ (fetch_core_registers): Use supply_gregset and i387_supply_fsave.
+ (fetch_elfcore_registers): New function.
+ (i386nbsd_elfcore_fns): New.
+ (_initialize_i386nbsd_nat): Register i386nbsd_elfcore_fns.
+ * config/i386/nbsd.mh (NATDEPFILES): Add i387-nat.o and
+ i386bsd-nat.o.
+ * config/i386/nbsdelf.mh (NATDEPFILES): Likewise.
+ * config/i386/nbsd.mt (TDEPFILES): Add i386bsd-nat.o.
+ * config/i386/nbsdelf.mt (TDEPFILES): Likewise.
+ * config/i386/tm-nbsd.h: Update copyright years.
+ (HAVE_SSE_REGS): Define.
+ (IN_SIGTRAMP): Define as i386bsd_in_sigtramp.
+ (SIGTRAMP_START): Redefine as i386bsd_sigtramp_start.
+ (SIGTRAMP_END): Redefine as i386bsd_sigtramp_end.
+ (SIGCONTEXT_PC_OFFSET): Remove.
+ (FRAME_SAVED_PC): Define as i386bsd_frame_saved_pc.
+
+2002-01-05 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.tgt: Remove powerpc-*-macos* target.
+ * config/m68k/xm-mpw.h: Delete file.
+ * config/xm-mpw.h: Delete file.
+ * ser-mac.c: Delete file.
+ * mpw-make.sed: Delete file.
+ * mpw-config.in: Delete file.
+ * mac-xdep.c: Delete file.
+ * mac-gdb.r: Delete file.
+ * mac-defs.h: Delete file.
+ * mac-nat.c: Delete file.
+ * config/powerpc/macos.mh: Delete file.
+ * config/powerpc/macos.mt: Delete file.
+ * config/powerpc/nm-macos.h: Delete file.
+ * config/powerpc/tm-macos.h: Delete file.
+ * source.c (openp, open_source_file): Remove obsolete code.
+ * top.c (gdb_readline): Ditto.
+ * utils.c (query): Ditto.
+ * event-top.c (display_gdb_prompt): Ditto.
+ * Makefile.in (ser-mac.o): Delete obsolete target.
+ * NEWS: Update.
+
+2002-01-04 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (BIG_ENDIAN): Delete macro definition.
+ * a29k-tdep.c, arch-utils.c, arm-tdep.c, ax-gdb.c, ch-exp.c,
+ coffread.c, cris-tdep.c, d10v-tdep.c, d30v-tdep.c, defs.h,
+ findvar.c, infcmd.c, mem-break.c, mips-tdep.c, mn10300-tdep.c,
+ printcmd.c, remote-os9k.c, remote-rdi.c, remote-rdp.c,
+ remote-sim.c, remote.c, rs6000-tdep.c, sh-tdep.c, sparcl-tdep.c,
+ stabsread.c, valops.c, valprint.c, config/a29k/tm-a29k.h,
+ config/a29k/tm-vx29k.h, config/arm/tm-arm.h,
+ config/d30v/tm-d30v.h, config/fr30/tm-fr30.h,
+ config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ config/m32r/tm-m32r.h, config/m68k/tm-m68k.h,
+ config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h,
+ config/sparc/tm-sparc.h, config/z8k/tm-z8k.h, mi/mi-cmd-disas.c,
+ mi/mi-main.c: Replace BIG_ENDIAN with BFD_ENDIAN_BIG.
+ * gdbarch.sh: Replace BIG_ENDIAN with BFD_ENDIAN_BIG.
+ * gdbarch.c: Re-generate.
+
+2002-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * thread-db.c (thread_db_new_objfile): Do not enable thread_db
+ for core files.
+
+2002-01-04 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/arm/nbsd.mh (XDEPFILES): Remove ser-tcp.o.
+
+2002-01-04 Andrew Cagney <ac131313@redhat.com>
+
+ * value.h (value_ptr): Delete typedef.
+
+2002-01-04 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * i386nbsd-nat.c: Update copyright years.
+ Include i386-tdep.h.
+
+2002-01-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * stabsread.c: Update copyright years.
+
+ From Debashis Mahata <debashis.mahata@wipro.com>:
+ (read_struct_fields): Deal with Sun C compiler erroneous stab
+ output for structs and unions.
+ Fix PR gdb/269.
+
+2002-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * p-valprint.c: Include "cp-abi.h" for baseclass_offset
+ prototype.
+
+2002-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * cp-abi.c: Fix whitespace.
+ (baseclass_offset): New wrapper function.
+ * cp-abi.h (baseclass_offset): Add prototype.
+ (struct cp_abi_ops): Add baseclass_offset pointer.
+
+ * valops.c (vb_match): Move to...
+ * gnu-v2-abi.c (vb_match): here.
+ * valops.c (baseclass_offset): Move to...
+ * gnu-v2-abi.c (gnuv2_baseclass_offset): here, and rename.
+
+ * gnu-v3-abi.c (gnuv3_baseclass_offset): New function.
+
+ * gnu-v2-abi.c (init_gnuv2_ops): Initialize baseclass_offset.
+ * gnu-v3-abi.c (init_gnuv3_ops): Likewise.
+ * hpacc-abi.c (init_hpacc_ops): Likewise.
+
+2002-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * valops.c (find_overload_match): Accept obj as a
+ reference parameter. Update it before returning.
+ * value.h (find_overload_match): Update prototype.
+ * eval.c (evaluate_subexp_standard): Pass object to
+ find_overload_match by reference.
-1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com)
+2002-01-03 Andrew Cagney <ac131313@redhat.com>
+
+ * valarith.c: Replace value_ptr with struct value pointer. Remove
+ register attribute from value declarations.
+ * valops.c: Ditto.
+ * value.h: Ditto.
+ * scm-lang.c (scm_lookup_name): Ditto.
- * configure.in: Require autoconf 2.12.1 or higher.
- * doc/configure.in: Ditto.
- * nlm/configure.in: Ditto.
- * rdi-share/configure.in: Ditto.
- * testsuite/configure.in: Ditto.
- * doc/Makefile.in: Don't hardcode $(SHELL).
- * nlm/Makefile.in: Ditto.
- * rdi-share/Makefile.in: Ditto.
- * testsuite/Makefile.in: Ditto.
+2002-01-03 Michael Snyder <msnyder@redhat.com>
-Mon Jan 4 12:53:03 1999 Stan Shebs <shebs@andros.cygnus.com>
+ Abstract the functionality of iterating over mapped memory
+ regions into a general purpose iterator function.
+ * procfs.c (iterate_over_mappings): New function, general purpose
+ iterator for memory sections.
+ (proc_iterate_over_mappings): Reimplement using iterate_over_mappings.
+ (solib_mappings_callback): New function, callback for above.
+ (info_proc_mappings): Reimpliment using iterate_over_mappings.
+ (info_mappings_callback): New function, callback for above.
- * remote-vx.c (init_vx_ops, init_vx_run_ops): Remove unneeded
- inits of new fields, including ref to bogus field.
- (vx_ops, vx_run_ops): Make static.
+ * procfs.c (proc_set_watchpoint): Add cast to suppress warning.
-Mon Jan 4 15:05:29 1999 David Taylor <taylor@texas.cygnus.com>
+2002-01-01 Mark Kettenis <kettenis@gnu.org>
- * inferior.h (START_INFERIOR_TRAPS_EXPECTED): delete,
- already defined in tm.h.
+ * i386-tdep.h (struct gdbarch_tdep): Add `os_ident' member.
+ * i386-tdep.c: Include "elf-bfd.h".
+ (process_note_abi_tag_sections): New function.
+ (i386_gdbarch_init): Add code to recognize various OS/ABI
+ combinations.
- * inftarg.c: change <sys/unistd.h> to <unistd.h> and
- conditionalize its inclusion.
- * infttrace.c: ditto.
+ * maint.c (_initialize_maint_cmds): Add missing \ in
+ string-literal.
-For older changes see ChangeLog-98
+For older changes see ChangeLog-2001
Local Variables:
mode: change-log
diff --git a/contrib/gdb/gdb/ChangeLog-1990 b/contrib/gdb/gdb/ChangeLog-1990
new file mode 100644
index 0000000..25cf860
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1990
@@ -0,0 +1,3155 @@
+Fri Dec 28 00:13:42 1990 John Gilmore (gnu at cygint)
+
+ Further stabilization for the Intel 960.
+
+ * Makefile.dist: Parameterize the location of the "include"
+ and "bfd" directories, as well as "getopt". Add symfile.c.
+ Link in both dbxread and coffread. Fix up "make depend" to
+ rewack the locations of include, bfd, and getopt in its output.
+
+ * README: Document moving include files, improve some of
+ the other doc.
+
+ * coffread.c: Move common code out to symfile.c. Change
+ symbol_file_command style interface to use new *_symfile_init
+ and *_symfile_read interface under BFD. Use BFD internal
+ info to locate line table, symbols, etc.
+
+ * core.c (core_fetch_registers): Rename to get_core_registers
+ to avoid confusion with fetch_core_registers.
+ (register_addr): Move to coredep.c, which is already machine
+ dependent. This leaves core.c pretty clean of dependencies.
+
+ * coredep.c (register_addr): Accept this routine from core.c.
+
+ * dbxread.c: Move common code (with coffread.c, etc) into new
+ symfile.c. Each psymtab now contains a pointer to the
+ format-dependent function that knows how to read it in. Make
+ some things static.
+ (dbx_psymtab_to_symtab): Renamed from psymtab_to_symtab_2.
+ (process_one_symbol): Add code to complain about a "compiler bug
+ we muzzle here", if we actually see it.
+
+ * eval.c (evaluate_subexp): Insert missing "break" statements
+ in code that determines whether a variable is an lvalue in
+ memory, register, or whatever. I detected this via a compiler
+ bug in which it *almost* mashed out the whole switch statement.
+
+ * gdb-int.texinfo: Add minor sections on configuring gdb for
+ release, and about the README file.
+
+ * infcmd.c (registers_info): Fix formatting somewhat. Still
+ not as pretty as before, but it handles byte swapping.
+
+ * remote-nindy.c: If data cache routines are interrupted while
+ waiting for the remote end, be sure that any uninitialized cache
+ blocks are on the free list, not on the valid list!
+
+ * symfile.h: Flesh out this header file with all the various
+ routines and variables that have been merged in from dbxread.c
+ coffread.c, and symtab.c to symfile.c.
+
+ * symfile.c: New file, containing code common to dbxread.c,
+ coffread.c, and some code from symtab.c. All generic code for
+ reading symbol files should be in here now.
+ (unrecord_misc_function): Remove unused function.
+
+ * symtab.h: Remove file-reading things to symfile.h.
+
+ * symtab.c: Remove file-reading things to symfile.c.
+
+ * tm-i960.h: Fix FRAME_CHAIN types; define PRINT_RANDOM_SIGNAL
+ to decode i960 fault types.
+
+ * target.h, remote.c, remote-eb.c, remote-vx.c, remote-nindy.c,
+ target.c: Change type of the "resume" function from int to void,
+ since its result was never used.
+
+Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint)
+
+ * main.c: Replace "stupid" with "caution"; you now "set caution
+ on or off".
+
+ * printcmd.c (print_scalar_formatted): Fix typo in 'g' format
+
+ * infcmd.c (do_registers_info): Call val_print to deal with the
+ byte order of the registers being printed. FIXME, this makes
+ the formatting of the output uglier.
+
+ * infcmd.c (wait_for_inferior): If PRINT_RANDOM_SIGNAL is
+ defined, call it for signals the debugger doesn't itself use.
+ The i960 uses this for more detailed fault information.
+
+ * remote.c (remote_open): If arg is null, print help rather than
+ dumping core.
+
+ * sparc-xdep.c (register_valid): Avoid declaring size, since
+ various modules will think of various sizes depending on the
+ architecture of their tm-file. FIXME, we need protection against
+ actually entering one of those modules, which would clobber
+ storage if not for the target architecture compiled into gdb.
+
+ * stack.c (up_command, down_command): Always print the frame
+ you arrive at.
+ (up_silently_command, down_silently_command): New commands
+ for use in scripts.
+
+ * i960-pinsn.c (reg), i960-tdep.c: Lint.
+
+ * i960-tdep.c (i960_frame_chain_valid): Lookup_symbol now takes
+ more parameters than it used to.
+
+ * findvar.c (registers): Increase slop to 256 bytes, which should
+ protect us against even most RISC machines with large register
+ sets.
+ (locate_var_value): Move declaration inside related ifdef.
+
+ * remote-nindy.c (): Use TIOCSETN rather than TIOCSETP
+ throughout, to avoid throwing away buffered input from the board.
+ (nindy_wait): Supply_register takes addr_of_value, not value.
+ (i960_print_fault): Renamed from i80960_fault.
+ (nindy_fetch_registers): Avoid have_regs stuff, just get them.
+ (nindy_store_registers): Avoid regs_changed stuff, just stuff
+ them.
+ (nindy_create_inferior): Don't bother to write PC_REGNUM since
+ we can set the PC in the call to proceed(). Unpush nindy_ops
+ before pushing it on top, to avoid message to user. Eliminate
+ commentary from Unix machines that just misleads here.
+ (reset_command): Fix error message to suggest target command.
+
+Wed Dec 19 11:03:56 1990 John Gilmore (gnu at cygint)
+
+ Release 3.92.5 as frozen.
+
+ Stabilize the merged release...with help from lint, Saber C,
+ gcc -W, etc.
+
+ Everywhere: Add include files needed to declare return types
+ of functions called.
+
+ * gdb.texinfo: Roland Pesch is documenting gdb, glory be!
+
+ * breakpoint.h: Add undeclared breakpoint functions, and some
+ functions for display handling since I couldn't think of a better
+ .h to put them in.
+
+ * breakpoint.c (insert_breakpoints): Make code for disabling
+ shared library bkpts more likely to work. It's used when we
+ rerun a program and stop before the shared library has been
+ mapped in.
+ (breakpoint_cond_eval, bpstat_stop_status): Pass arg as int,
+ cast from pointer, so it squeezes through catch_errors.
+ (bpstat_stop_status): Fix logic broken some time ago. We now
+ always create a bpstat if the stop address matches a breakpoint,
+ even if we don't stop there -- just like the old code used to do
+ before I got my fingers into it (sigh).
+ (breakpoint_1): Print "ignore count" after "stop only if"
+ condition, since that's how it actually works.
+ (mention): Handle watchpoints as well as breakpoints.
+ (watch_command): use set_raw_breakpoint and mention to do most
+ of the work (and initialize all the fields!). Only pass one
+ arg to parse_c_expression, since that's all it takes.
+
+ * command.c (not_just_help_class_command): Rename arg to args
+ since we ignore "unused argument" warnings on vars named "args".
+ inflow.c (child_terminal_info): ditto.
+ infptrace.c (kill_inferior): ditto
+ main.c (catch_errors, version_info, quit_command, pwd_command,
+ source_command, dump_me_command, editing_info,
+ set_history_size_command, set_history, show_history,
+ set_verbose): ditto
+ stack.c (locals_info): ditto
+ target.c (target_files_info): ditto
+ valprint.c (set_input_radix, set_output_radix): ditto
+
+ * core.c: Remove old variables for handling core and exec file
+ sections (data_start, data_end, stack_start, stack_end,
+ reg_stack_start, reg_stack_end, reg_stack_offset, text_start,
+ text_end, exec_data_start, exec_data_end, text_offset,
+ exec_data_offset, data_offset, stack_offset). They're
+ superseded the more general build_section_table and
+ xfer_memory.
+ (get_exec_file): Mention the `file' command.
+ (read_memory_check): Rename to memory_error, and only call it
+ in the case of an actual error.
+ (read_memory, write_memory): call memory_error.
+ (core_fetch_registers): Register section name is ".reg".
+
+ coredep.c: Remove a bunch of crud now that all this file does
+ is pull the registers out of a core file.
+ (fetch_core_registers): Rewrite to actually work, I hope.
+
+ dbxread.c: Use a.out.gnu.h, not system a.out, now.
+ Replace index() with strchr(). Remove all the pre-BFD macro
+ definitions for accessing the symbol file.
+ (struct dbx_symfile_info): Encapsulate the information that
+ dbx_symfile_init needs to pass to dbx_symfile_read in this
+ struct.
+
+ (dbx_new_init, dbx_symfile_init, dbx_symfile_read,
+ dbx_symfile_discard): Rearrange symbol file reading to divide
+ the format-specific part from the format-independent part,
+ leaving the format-independent part such as file name expansion
+ and opening in symtab.c. This replaces
+ partial_symbol_file_open and partial_symbol_file_read.
+ Symbol_file_read, add_file, add_file_target_command,
+ add_file_addr_command move to symtab.c. Pass an explicit
+ "mainline" flag for when reading the main symbol table, rather
+ than relying on the offset address to be zero or nonzero.
+
+ (dbx_symfile_read): Don't allow void *'s to be printed as
+ typedefs.
+ (SWAP_SYMBOL): Use bfd routines to byte-swap the symbols.
+ (ADD_PSYMBOL_TO_LIST): Make the "function call rather than
+ macro" debug version really work.
+ (read_dbx_symtab): Remove unref'd parameter inclink.
+ Avoid swapping N_SLINE symbols, for speed.
+ Merge N_TEXT!N_EXT case with the other external symbol
+ definitions' case. Add comments.
+ (start_psymtab): Allocate the symfile name in the psymtab on
+ the psymbol_obstack, rather than using the caller's storage.
+ (end_psymtab): Only allocate a dependencies list if there are
+ more than zero.
+ (psymtab_to_symtab_2): Use BFD when reopening file to read
+ its symbols for real.
+ (read_struct_type): Add FIXME comments where it needs work
+ for C++ bogosity.
+ (read_huge_number): Add FIXME about overflows.
+ (read_range_type): Add FIXME about comparing a long to 1<<32.
+
+ * coffread.c: Minor changes to move things closer to the new
+ regime with symtab.c and dbxread.c Major work is still needed
+ here.
+
+ * exec.c (exec_file_command): Remove old variables (see core.c
+ above).
+ (xfer_memory): If memory transfer is right at the end of a
+ section, don't lose.
+
+ * findvar.c (get_saved_register): If value is in a real
+ register, LVAL is lval_register, not lval_memory.
+
+ frame.h: Declare print_sel_frame and record_selected_frame.
+
+ gdb-int.texinfo: New file, for GDB internals documentation.
+ Very simple, unformatted doc of cleanups is there for now.
+
+ gdbcore.h: Remove obsolete variables that described a.out
+ section addresses and offsets. (See core.c above.)
+ Declare fetch_core_registers and registers_fetched.
+
+ getopt.c: Declare char *alloca(); even on SPARC.
+
+ infcmd.c (run_command): Call target_kill rather than
+ kill_inferior.
+ (step_command, next_command, stepi_command, nexti_command):
+ Declare from_tty parameter even though we don't use it.
+ (run_stack_dummy): argument BUFFER is a char array, not
+ a pointer to REGISTER_TYPE.
+ (finish_command): using_struct_return needed a value *,
+ not a struct symbol *.
+
+ * infptrace.c (child_xfer_memory): To avoid dependency on
+ where sections are in memory, try PT_WRITE_D and if that fails,
+ try PT_WRITE_I. Most Unixes don't care which you use.
+
+ * infrun.c (step_resume_break_shadow): Change to array to
+ match other breakpoint shadow storage.
+ (clear_proceed_status): Pass address of bpstat to
+ bpstat_clear, not the bpstat itself.
+ (child_create_inferior): FIXME comment about if the child
+ exits.
+ (start_inferior): Remove old function.
+ (child_open): Use target_kill rather than kill_inferior.
+ (wait_for_inferior): Ditto.
+ (insert_step_breakpoint, remote_step_breakpoint): Use
+ new step_resume_break_shadow.
+
+ * inftarg.c (child_wait): If all child processes die,
+ pretend that the one being waited for exited with signal 42.
+
+ * main.c (command_line_input): When scanning for comments,
+ don't coredump on unclosed quotes.
+ (quit_command): Use target_kill rther than kill_inferior.
+ (_initialize_main): Rename class_user from "user" to
+ "user-defined".
+
+ * printcmd.c (print_command_1): Initialize "fmt" if no format
+ is specified by the user.
+ (print_frame_args): Only add to args_printed if we are
+ actually fetching args from the stack (avoiding undefined
+ arg_size).
+ (_initialize_printcmd): Remove bogus \{ from string.
+
+ * remote-eb.c (eb_open): Avoid coredump on no argument.
+
+ * remote-nindy.c: Bring out of Intel environment into new
+ target environment. Remove all conditional compilation on
+ I80960. Massive hacking throughout.
+ (nindy_xfer_inferior_memory): New routine stolen from
+ infptrace.c.
+ (nindy_create_inferior): New routine pieced together, probably
+ not quite working yet.
+ (nindy_ops): New target_ops struct for nindy.
+
+ * remote-vx.c: Use write_memory rather than target_write_memory
+ to get error checking.
+ (vx_add_file_command, vx_open): Use symbol_file_add rather than
+ add_file.
+ (vx_create_inferior): Use target_terminal_ours...
+
+ * signame.c (_initialize_signame): Always initialize, since
+ we need the table for things other than psignal.
+
+ * solib.c (solib_add): Use symbol_file_add, not add_file.
+ (solib_address): Return boolean result rather than struct
+ pointer which nobody else knows the type of.
+
+ * sparc-tdep.c, valops.c: Use write_memory rather than
+ target_write_memory, to get error checking.
+
+ * stack.c (locals_info, catch_info, args_info,
+ get_selected_block, frame_command, up_command): Use
+ target_has_stack, rather than have_inferior_p or
+ have_core_file_p.
+
+ * sun3-xdep.c (fetch_core_registers): Rewrite for new BFD regime.
+
+ * symfile.h: New file, defining the interface between the
+ generic and object-file-specific symbol reading code.
+
+ * symtab.c: Move generic symbol-reading interface to symtab.c,
+ from dbxread.c, coffread.c, mipsread.c, etc. Add symtab_fns
+ table to map BFD targets to symbol-reading modules in GDB.
+ Change index to strchr.
+ (lookup_struct_elt_type): Use error() rather than hand-made
+ simulations thereof.
+ (lookup_partial_symbol): Speedup slightly when length == 0.
+ (symbol_file_add): New function.
+ (symbol_file_command): Call it.
+ (symfile_open, symfile_init): New function.
+ (add_file_target_command, add_file_addr_command): moved from
+ dbxread.c.
+
+ * target.c (target_command): use target_kill.
+
+ * target.h (target_files_info): Don't declare, never called
+ from outside.
+
+ * tm-sun2.h, tm-sun3.h (STACK_END_ADDR): Use system include
+ files to determine stack end address.
+
+ * valarith.c (value_x_binop, value_x_unop): Change error message
+ to be more useful. Pass proper argument to value_struct_elt.
+
+ * valops.c (value_assign): FIXME comment that long long
+ bitfields will break here.
+
+ * Makefile.dist: Add symfile.h, remote-nindy.c, remote-eb.c.
+ Update `make saber_gdb' to work better.
+
+ * TODO: A woman's work is never done.
+
+ * cplus-dem.c, environ.c, inferior.h, infrun.c, inftarg.c,
+ main.c, obstack.c, printcmd.c, remote-eb.c, remote-nindy.c,
+ remote-vx.c, remote.c, solib.c, source.c, sparc-pinsn.c,
+ sparc-tdep.c, sparc-xdep.c, symmisc.c, symtab.c, symtab.h
+ target.c, terminal.h, tm-sparc.h, tm-sunos.h, utils.c,
+ valops.c, valprint.c, exec.c: Lint.
+
+
+Wed Dec 12 23:44:15 1990 John Gilmore (gnu at cygnus.com)
+
+ Continuing Intel 960 port merge of GDB.
+
+ * Makefile.dist: Merge i960 "nindy-share" files. Rename
+ malloc.h to gmalloc.h to avoid name conflicts in /usr/include.
+ Don't ship gdb.dvi in tar file. Link gdb with init.o, not init.c.
+ Wack over "make depend" so it handles files in subdirectories
+ vx-share, nindy-share, bfd, and in the current directory.
+
+ * blockframe.c (get_prev_frame_info): Remove fatal error
+ if stack not defined.
+
+ * core.c (core_open, core_detach): New functions that handle
+ the old "core-file" command as "target core" and "detach" instead.
+ (core_file_command): Call them.
+ (core_xfer_memory): Use common routine xfer_memory.
+
+ * dbxread.c: Include a.out.gnu.h, not system a.out.h.
+ dbxread now uses bfd for everything but symbol reading itself.
+ BFD internals are used to drag out the relevant file offsets.
+ (partial_symbol_file_open): Change args all around for BFD.
+
+ * symtab.c: Rename "value" to "val" everywhere, so we can
+ #include "value.h".
+ (symbol_file_command): New command, moved from dbxread.c
+ and coffread.c. It uses BFD to read the file, then vectors
+ based on its type, to dbx or coff symbol readers.
+ * symtab.h: Extern a few vars for symbol_file_command.
+
+ * target.h: Breakpoint takes a char * save area, not a char **.
+
+ * valprint.c (val_print): When unpacking bitfields, offset
+ the address in gdb of the value, if it is declared with a shorter
+ type. Remove the last "runtime kludge test" of host byte order.
+
+ * utils.c: Remove old my_bfd_read routine.
+
+ * stack.c (frame_info): Use target_has_stack. Print program counter
+ register's actual name rather than "pc", since it's called the
+ "ip" (instruction pointer) on the i960 (sigh).
+
+ * target.c (target_command): Add command for selecting a target
+ type and calling its open routine. This is used for initiating
+ communication with a particular target, in a generic way.
+
+ * tm-i960.h: Update for modern gdb. Remove semicolons from
+ various macros. Handle reading struct return convention, and
+ error-out attempts to return structs with the "return" command.
+ Be sure gdb doesn't think we know how to call functions in the
+ inferior.
+
+ * i960-tdep.c: Rename FRAME_CHAIN_VALID and FRAME_FIND_SAVED_REGS
+ to i960_xxx in lower case.
+ (arg_address): Circumvent errors due to LOC_ARG_BLOCK
+ not being defined yet.
+
+ * remote.c (remote_open): Call start_remote to initialize
+ wait_for_inferior during open.
+ (remote_xfer_inferior_memory): Return length written rather
+ than errno value.
+
+ * remote-vx.c (target_command -> vx_open): Use new generic
+ target command.
+ * remote-eb.c, inftarg.c, exec.c: ditto.
+
+ * infrun.c: Fix comments.
+ (attach_program -> child_open): Use new generic target command.
+ (wait_for_inferior): Clear saved register values before target_wait,
+ so target_wait can set some of them if convenient.
+
+ * infptrace.c (fetch_inferior_registers, store_inferior_registers):
+ Return success indicator, not void.
+ (child_xfer_memory): Avoid fetching initial word if we'll
+ overwrite it anyway.
+
+ * infcmd.c (attach_command): Use new generic target open routine.
+ (_initialize_infcmd): Update doc on attach and detach commands.
+ (do_registers_info): Merge in a byte-order problem as a FIXME
+ comment.
+
+ * findvar.c (find_saved_register): Avoid problem in current frame.
+ (read_relative_register): Ditto.
+ (write_register): Convert byte order on the way out.
+
+ * exec.c (file_command): Add.
+ (add_to_section_table, exec_command): Use new bfd_map_over_sections.
+ (xfer_memory): Common function between core_xfer_memory and
+ exec_xfer_memory.
+ (exec_xfer_memory): Use it.
+
+ * pn-opcode.h: Document that a "PN" is a Gould PowerNode.
+
+ * breakpoint.c, breakpoint.h, symtab.h, value.h, frame.h, utils.c,
+ valops.c, stack.c, target.c, sparc-xdep.c, source.c, printcmd.c,
+ infcmd.c, i960-pinsn.c, eval.c, defs.h: lint and gcc -Wall.
+
+Sun Dec 2 16:45:06 1990 John Gilmore (gnu at cygnus.com)
+
+ Merge Intel 960 port of gdb, continuing...
+
+ * dbxread.c (partial_symbol_file_open, partial_symbol_file_read,
+ symbol_file_command): Pass from_tty arg to hush 'em up.
+
+ * coffread.c (symbol_file_command): Avoid output if from_tty != 1.
+ Add magic numbers for 960 COFF format.
+
+Fri Nov 30 09:18:20 1990 John Gilmore (gnu at cygnus.com)
+
+ Merge Intel 960 port of gdb, from Intel "1.2" release.
+
+ CHANGE_LOG entries from their port, which was based on
+ gdb+-2.8.0:
+
+ Thu Sep 6 11:02:22 PDT 1990
+ Remove temp file if download is interrupted.
+
+ Wed Aug 1 09:08:33 PDT 1990
+ Now uses binary protocol to talk to NINDY.
+ Old hex protocol (NINDY 2.13 and older) supported with -O switch.
+ Times out after 5 seconds when trying to talk to NINDY.
+
+ Tue May 29 12:54:49 PDT 1990
+ Added variable baud rate (-b switch).
+ Source code reorganization.
+
+ Thu Apr 26 11:09:55 PDT 1990
+ More cleanup of batch mode; specifically, execute "-s", "-e", and
+ "-se" switches as soon as they are encountered on the invocation line.
+
+ Fri Apr 20 13:47:15 PDT 1990
+ Add -brk switch.
+
+ Thu Apr 19 09:54:28 PDT 1990
+ Add 'reset' command.
+
+ Wed Apr 18 09:48:07 PDT 1990
+ After opening remote tty, wait for 1 second to go by without input
+ from it before trying to talk to NINDY (fixes problems with the
+ Heurikon HK80/V960E).
+
+ Mon Apr 4 16:33:05 PDT 1990
+ Some output was not being suppressed in 'batch' mode.
+
+ Thu Mar 22 15:31:11 PST 1990
+ Ask user if old symbol table should be deleted when new file is
+ downloaded.
+
+ Allow user to run a program downloaded before gdb960 was brought up.
+
+ Correct "exec-file" help message for i80960 context.
+
+ Correct bug in calculating user space address: could occasionally
+ corrupt user program.
+
+ Make sure to zero low-order bits in rip's because of bug in 960CA
+ A-step part: could cause operation faults when "next"ing across
+ a function call.
+
+ Correct bug that made it impossible to get source line numbers for
+ code loaded at addresses higher than 0x7fffffff.
+
+ Wed Jan 10 12:43:22 PST 1990
+ Open remote tty for exclusive use.
+
+ Fri Jan 5 12:14:42 PST 1990
+ Correct disassembly (CA manual was right after all):
+ opcode for sysctl is 0x659
+
+ Mon Oct 23 12:03:04 PDT 1989
+ Use G960BASE and G960BIN environment variables to find 'sx' utility.
+
+ Mon Oct 16 14:15:09 PDT 1989
+ "sfr0"-"sfr31" should have been named "sf0"-"sf31"
+
+ Mon Oct 2 15:56:31 PDT 1989
+
+ Added 960CA disassembly support.
+
+ To simplify maintenance:
+ - eliminated use of symblic links on pinsn.c: use i960-pinsn.c
+ directly instead.
+ - eliminated opcode.h: incorporates tables into i960-pinsn.c
+ - moved 960-specific routines from i960-pinsn.c to i960-md.c
+ - made disassembly interface identical to that in gdmp960.
+
+
+
+Wed Nov 28 21:32:48 1990 John Gilmore (gnu at cygint)
+
+ * target.h: Allow targets to stack. Add target_has_memory,
+ _registers, etc. Restructure memory access and "info files"
+ to walk the target stack.
+ * exec.c, core.c, inftarg.c, remote.c, remote-vx.c, remote-eb.c,
+ target.c: Change tables to match target.h.
+ * inflow.c (child_mourn_inferior): pop child_ops.
+ (generic_mourn_inferior): Use new has_stack flag.
+ * infptrace.c (child_xfer_memory): New memory regime.
+ * inftarg.c (child_files_info): New "info files" regime.
+ * remote-eb.c: New memory regime, new info files.
+ * remote-vx.c: New memory regime, new info files. Now use
+ separate targets for VxWorks attachment to machine, and
+ actually running a process under VxWorks, since one has
+ stack & execution & regs and the other doesn't.
+ * remote.c: New memory regime, new info files.
+ * sparc-xdep.c (fetch_core-registers): New memory regime.
+ * target.c: New routines and support for stacked targets,
+ new memory regime, new info files regime.
+
+
+ Generalize section handling for an arbitrary number of sections,
+ including use of the new BFD (binary file) library.
+ * gdbcore.h: Add struct section_table.
+ * exec.c (build_section_table): Iterate all sections and
+ record what gdb needs to know about them.
+ (exec_command): Use it.
+ (exec_xfer_memory): Use the table.
+ (exec_files_info): Print the table.
+ * core.c (core_file_command, core_xfer_memory, core_files_info):
+ Likewise.
+ * source.c (find_source_lines): Use bfd_get_mtime.
+ * dbxread.c: Quick changes to make it compile with new BFD.
+ * utils.c (error): Avoid using bfd_error in generic routines.
+
+ * core.c (core_fetch_registers): Get from the ".regs" section of
+ the BFD core file.
+ * sparc-xdep.c (fetch_core_registers): Use the .regs info.
+
+ * inferior.h (attach_flag): Export.
+ * infcmd.c (run_command): use new target_create_inferior.
+ * infrun.c (child_create_inferior): Don't return result.
+ * Makefile.dist (VERSION): 3.91.4.
+
+Fri Nov 23 28:15:38 1990 John Gilmore (gnu at cygint)
+
+ * breakpoint.c (bpstat_num): Handle breakpoints which have
+ since been deleted, such as temporary breakpoints.
+ infcmd.c (program_info): ditto.
+
+ * core.c (core_file_command): Display the frame where the core
+ dump occurred.
+
+ * main.c: lint.
+
+ * remote-vx.c (target_command): Merge in target command from
+ targ-vx.c. A few other cleanups.
+
+ * TODO, Projects: Lots more stuff to do...
+
+Fri Nov 23 18:15:38 1990 John Gilmore (gnu at cygint)
+
+ Massive changes to wall off the remote-debugging interface
+ behind a function vector. The port to handle VxWorks targets
+ is also part of this.
+
+ All files: Replace references to renamed functions,
+ remove references to remote_debugging, remove references to
+ have_include_file, have_core_file in favor of target_has_stack,
+ target_has_memory, etc.
+
+ * Modularize the breakpoint interface.
+ breakpoint.h (BREAKPOINT_MAX): New define sets max length of
+ a breakpoint instruction.
+ breakpoint.c: struct breakpoint's shadow_contents now sized as
+ BREAKPOINT_MAX.
+ (insert_breakpoints): Vector to target to install breakpoints.
+ (remove_breakpoints): Vector to target here too.
+ Remove REMOTE_SA_SPARC kludges and other remote_debugging.
+ sparc-tdep.c (single_step): Use new breakpoint interface for
+ the single-step breakpoints.
+ mem-break.c (memory_insert_breakpoint, memory_remove_breakpoint):
+ New file, contains routines to insert and remove breakpoints by
+ reading out the old contents and later replacing them. This is
+ how ptrace breakpoints work, and many remote systems as well.
+
+ * tm-vxworks68.h: New config file, overrides a few things for
+ Wind River's preferences.
+
+ * target.h: New file, for transfer vector used to talk to the
+ inferior (child, attached, core, exec, remote, etc). All accesses
+ to the thing being debugged should come through these vectors.
+ target.c: New file, routines to handle transfer vector.
+ (various files): Add transfer vectors XXX_ops for the various
+ targets and pseudo-targets (core files, etc) we support.
+
+ * breakpoint.c (bpstat_stop_status): Further explorations of
+ watchpoints and why things don't work all the time.
+ (bpstat_alloc): New fn to allocate a bpstat and chain it.
+
+ * config.gdb: Only add "source ${srcdir}/.gdbinit" to
+ the local gdbinit if it doesn't already have it.
+
+ * core.c (core_ops): add and install.
+ Allow core debugging without exec file.
+
+ * dbxread.c (free_and_init_header_files): Merge two fns.
+ (end_symtab): Free named symbol table when a new version comes in.
+ (read_dbx_symtab): Relocate all kinds of symbols with base
+ address. First step toward handling different text, data, bss
+ reloc.
+ (add_file_addr_command): Renamed add_file_command.
+ (add_file_command): Vector to remote handler.
+ Add "load" as an alias for "add-file" command.
+
+ * defs.h: Allow "volatile" to be used in non-ANSI; use it for
+ non-returning functions.
+
+ * exec.c: Add exec_ops, and push it as a target when an exec
+ file is specified.
+
+ * infcmd.c (run_command): Pass executable file name and arg list
+ separately when starting an inferior. Permit "run" when no exec
+ file is specified, for VxWorks.
+ (detach_command): Move to child_detach in inftarg.c.
+
+ * inftarg.c: New file. Unix-child-specific routines, and the
+ child_ops structure.
+
+ * inferior.h (registers): Export "registers" as the way for
+ target dependent register handlers to find gdb's local copy of
+ the registers. Rename "stop_after_attach" to "stop_soon_quietly"
+ since it is now used by places that want wait_for_inferior to
+ handle the grunge but want to see every trap from the inferior.
+
+ * inflow.c (create_inferior): Pull out, and merge into infrun.c.
+ Eliminate remote_debugging hooks in terminal handling.
+
+ * infrun.c: Replace start_inferior with child_create_inferior.
+ Move all the hair of Unix shells and ptrace idiosyncracies into
+ child_create_inferior, so remote handlers don't have to deal.
+ Remove running_in_shell. Rename stop_after_attach to
+ stop_soon_quietly, and use it in a few other places where we want
+ to just call wait_for_inferior and get control back on the first
+ trap. trap_expected now never takes a value > 1.
+ (init_wait_for_inferior): Initialize static vars when a new
+ process is created.
+
+ main.c (gdbinit): Add new hook for .gdbinit file name, let
+ it be overridden by config files as GDBINIT_FILENAME.
+ (DEFAULT_PROMPT): Add new hook for overriding (gdb) prompt.
+ Both of these are used for VxWorks gdb.
+
+ mcheck.c: rename include file "gmalloc.c" to avoid problems
+ with system include file "malloc.c".
+
+ param-no-tm.h: New include file, same as param.h but does not
+ include the default "tm.h" file. This is used in files where
+ the target is known, e.g. remote-eb.c or sparc-xdep.c.
+
+ param.h: Now just a shell that includes tm.h and param-no-tm.h.
+
+ remote-vx.c: New file, VxWorks remote debugging support. Uses
+ RPC routines that are shared with the target system, in directory
+ ${srcdir}/vx-share.
+
+ remote.c: Vectorize remote interface.
+
+ source.c: Globalize source_path, and make an alias "l" for "list"
+ since we now have the "load" command.
+
+ sparc-xdep.c: Use new param-no-tm.h.
+
+ symmisc.c (free_named_symtab): Add new function from Wind River.
+ However, ifdef it out for now while we think about what it should
+ really be doing.
+
+ tm-sun3.h, xm-sparc.h, xm-sun3.h, xm-symmetry.h: Move
+ PREPARE_TO_STORE to
+ the xm- file, and change its name to CHILD_PREPARE_TO_STORE, since
+ non-Unix-children handle this with their own code in the target
+ transfer vector.
+
+ Makefile.dist: Roll version to 3.92.3. Add vx-share stuff to
+ source and target lists. Add vx-share to default list of include
+ directories. Add new files to src and target lists: mem-break,
+ target, inftarg, remote-eb, remote-vx, targ-vx. Be sure the
+ ${srcdir} versions of munch and createtags are used.
+
+ * valops.c (find_function_addr): Split out of call_function.
+ (call_function_by_hand): Rename call_function; this function
+ calls functions in the target by laboriously patching the target
+ word-by-word with the right stack, args, regs, etc.
+
+
+Mon Nov 5 17:29:10 1990 John Gilmore (gnu at cygint)
+
+ Handle AMD 29000 a bit better.
+
+ * remote-eb.c (readchar): Mask received char log to make it readable.
+ (remote_start): Pass arguments down to executing program.
+ Make startaddr unsigned.
+ infrun.c (start_inferior): Accept args, pass them to
+ remote_start.
+ infcmd.c (run_command): Pass args down to start_inferior.
+
+ * tconfig/am29k-aout, tconfig/am29k-coff: New files specifying
+ the target object file format.
+ tm-29k.h: Pay heed to COFF_ENCAPSULATE.
+
+ * am29k-pinsn.c (print_insn): Print 0x on hex numbers in disassembly.
+ am29k-tdep.c (examine_prologue): Better checking of function prefixes.
+
+Sun Oct 7 18:20:45 1990 John Gilmore (gnu at cygint)
+
+ * Makefile.dist (VERSION): Roll version to 3.91.9 and freeze.
+ * TODO: We did a few things, we have more to do though.
+
+ * xm-sparc.h (CLEAR_DEFERRED_STORES): Define.
+ * inflow.c (inferior_died): Clear deferred stores.
+
+ * Debug problems with dummy frames and calls to the inferior.
+ * tm-sparc.h (PUSH_DUMMY_FRAME, POP_FRAME): Move to sparc-tdep.c.
+ * sparc-tdep.c (do_restore_insn): Simplify.
+ (sparc_frame_find_saved_regs): Simplify and fix what we find.
+ (sparc_push_dummy_frame): Simplify and fix what we push.
+ (sparc_pop_frame): Slightly more hair here, deciding whether
+ we are restoring a saved PC or returning to a return address in %i7.
+ * sparc-xdep.c (read_inferior_registers): Debug if valid reg is read.
+
+ * utils.c (xmalloc, xrealloc): Return type depends on __STDC__.
+ * symtab.h (xmalloc): ditto, for obstack_chunk_alloc.
+ * obstack.h (chunkfun): ditto.
+ * defs.h (xmalloc, xrealloc): ditto
+
+ * utils.c (quit): Grab the terminal from the child if necessary.
+
+ * inflow.c (term_status_command): Rename to term_info, change
+ to "info terminal".
+
+ * sparc-pinsn.c (print_insn): Disassembly prefers real instructions.
+ (is_delayed_branch): Speed up.
+ * sparc-opcode.h: Add ALIAS bit to aliases. Fix up opcode tables.
+ Still missing some float ops, and needs testing.
+
+ * Support for input and output radixes other than base 10
+ * defs.h (input_radix, output_radix): Declare.
+ * expread.y (yyparse, parse_number): Handle changes of input
+ radix, and ambiguous names-or-numbers in radixes >10.
+ * printcmd.c (print_scalar_formatted): Print formatted hex
+ numbers in varying column widths.
+ * valprint.c (val_print): Use output_format to print scalar ints.
+ (set_input_radix, set_output_radix, set_radix): Create.
+ (set_output_radix): Set output_format from output_radix.
+ (_initialize_valprint): add `set radix' but leave the others off.
+
+ * main.c (execute_command): Let stupid questions be turned off.
+ (_initialize_main): Handle "set stupidity", etc.
+
+ * main.c, inflow.c, inferior.h, frame.h, command.c, defs.h,
+ sparc-pinsn.c, sparc-xdep.c, value.h, valops.c, values.c: Lint.
+
+Tue Oct 2 11:20:02 1990 John Gilmore (gnu at cygint)
+
+ * TODO, Makefile.dist, ChangeLog: Freeze for 3.91.8 release.
+ bfd stuff is still screwed up, but with some manual work, it
+ compiles.
+
+ * breakpoint.c (bpstat_do_actions): Start over if a command
+ proceeds the inferior, since the inferior will have stopped and
+ will need to have its new stop-actions taken care of.
+
+ * dbxread.c (read_struct_type): Expression gives Sun3 4.0.3
+ compiler fits, simplify it.
+
+ * gdb.texinfo (directory command): Doc new dir command.
+ source.c (directory_command): "dir" now puts things on the front
+ of the path, moves dups up front, and handles multiple names
+ on the command line, inserting each one in order. It also
+ blows away cached line and full_filename info.
+
+ * stack.c (backtrace_command): Skip "more stack frames follow"
+ unless interactive.
+
+ * Change #ifndef HAVE_VPRINTF to #define MISSING_VPRINTF in
+ xm-convex.h, xm-hp300bsd.h, xm-isi.h, xm-merlin.h, xm-news.h,
+ xm-np1.h, xm-pn.h, xm-pyr.h, xm-symmetry.h, xm-umax.h, xm-vax.h.
+ The only odd one was Gould NP1, which had defined vprintf to
+ "printf"!!!
+
+ * Merge Ted Goldstein <tedg@Eng.sun.com>'s changes for epoch.
+ printcmd.c (print_command_1): Pass 'inspect' flag down as a global
+ variable, inspect_it.
+ valprint.c (print_string, val_print): Use the global inspect_it
+ to indicate whether to print in Epoch style or normal style.
+
+Mon Oct 1 23:55:26 1990 John Gilmore (gnu at cygint)
+
+ * printcmd.c (call_command): add an alias for the "print" command
+ which runs expressions and doesn't print the result if void.
+ (print_command_1): implement it.
+
+ * command.c: Remove #if 0'd code. Initialize all the fields
+ in add_cmd (). Rename do_nothing_command to
+ not_just_help_class_command, and make it externally visible.
+ command.h: add user_commands to struct.
+ * main.c (define_command): Don't overload c->function with a char
+ string as well as a function pointer.
+
+ * eval.c (evaluate_subexp): Reinstall tiemann changes to
+ calling convention of value_struct_elt () that got dropped in
+ merge.
+
+ * tm-sparc.h (FRAME_FIND_SAVED_REGS): move to sparc-xdep.c.
+ sparc-tdep.c (sparc_frame_find_saved_regs): ditto.
+
+ * tm-sparc.h (POP_FRAME): replace some constants with defines.
+
+ * sparc-xdep.c (store_inferior_registers): defer stores to regs
+ until a good time (e.g. when we are about to run the child),
+ saving ptrace calls.
+ * infrun.c (proceed): handle DO_DEFERRED_STORES.
+ * tm-sparc.h: define DO_DEFERRED_STORES.
+
+ * sparc-xdep.c (store_inferior_registers): when storing float
+ registers, don't store stack regs too. When storing the SP,
+ however, DO store the stack regs too. This fixes a bug in which
+ the dummy frame is not recognized when a call_function finishes,
+ because its frame pointer (in the stack regs) was never
+ initialized.
+ (read_inferior_registers): Mark WIM and TBR and FPS and CPS valid
+ even though we don't know how to read them from an inferior.
+ valops.c (call_function): Comment about storing SP.
+
+ * infrun.c (save_inferior_status): Save away the original bpstat
+ chain so it can be restored later. Install the copied version for
+ use by whoever saved the status. It will be blow away by
+ restore_inferior_status, and the original chain restored. This is
+ important for people who have pointers into the original.
+
+ * breakpoint.c, command.h, copying.awk, dbxread.c, defs.h,
+ findvar.c, frame.h, obstack.h, obstack.c, inflow.c, value.h,
+ main.c, printcmd.c, sparc-tdep.c, symtab.c, valprint.c: lint
+
+
+Fri Sep 28 20:32:46 1990 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.dist: Roll version to 3.91.8. Add bfd.h and bfdconfig.h
+ temporarily to the makefile. Add am29k-opcode.h and WHATS.NEW.
+ Add stuff.c and kdb-start.c to the OTHERS list for tar files.
+
+Fri Sep 28 19:12:12 1990 John Gilmore (gnu at cygint)
+
+ * Merge Mike Tiemann's multiple inheritance changes from Sun.
+ Store the baseclasses in a type struct starting from array element
+ 0 rather than from the unusual array element 1.
+
+ dbxread.c: the above.
+ (virtual_context): Add
+ Read new debug information about which virtual function table
+ a virtual function is from, and store it in fn_field.fcontext.
+
+ symtab.h: Add fcontextt. Fix baseclass indices. Typo in
+ TYPE_FN_FIELD_STATIC_P.
+
+ symtab.c: the above.
+ valops.c: the above. Handle pointer casts of object *'s.
+ (search_struct_method): Add.
+ (value_struct_elt): First arg is now a pointer to a value, and is
+ modified on return.
+
+ valprint.c: the above.
+ values.c (value_virtual_fn_field): Add type arg. Handle
+ offsetting to the proper object when calling virtual fns.
+ The above.
+ (baseclass_addr): Add valuep arg.
+
+ * README: Document the current state of BFD config (missing).
+ * TODO, ChangeLog, Makefile.dist: Roll version.
+ * WHATS.NEW: Add summary of changes since 3.5.
+
+Thu Sep 27 16:23:12 1990 John Gilmore (gnu at cygint)
+
+ * dbxread.c (read_struct_type): Clear bit vectors whenever
+ we allocate one.
+ symtab.c (B_CLRALL): define.
+
+ * tm-sparc.h (STORE_RETURN_VALUE): Avoid clobbering types by
+ using == rather than =. Huh... This fixes the dreaded problem
+ wherein builtin_type_int becomes TYPE_CODE_FLT.
+
+ * core.c (info_files): Show the inferior pid.
+
+ * config.gdb: Avoid putting "dir" command into .gdbinit. GDB
+ already knows how to look in the source directory.
+
+ * Remove psymtab hair from many places. Remove duplicated code
+ for searching symbol tables. Hide psymtabs from most places.
+ Make it fast to get from a psymtab to its symtab.
+
+ blockframe.c (blockvector_for_pc): Remove psymtab hair.
+ coffread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2.
+ mipsread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2.
+ dbxread.c: export psymtab_to_symtab, make it work if called N times.
+ (psymtab_to_symtab): Rename to psymtab_to_symtab2. Initialize
+ new symtab completely. New psymtabs get symtab pointer
+ initialized to zero. Remove MI warning printf.
+ symtab.h: Comments. Add psymtab to symtab pointer.
+ (PSYMTAB_TO_SYMTAB): New macro.
+ symtab.c: use PSYMTAB_TO_SYMTAB. Add psymtab_to_symtab and export it.
+ source.c: use PSYMTAB_TO_SYMTAB. Remove symtab version and
+ compilation fields.
+ stack.c (backtrace_command): Avoid pre-pass to read symbols, if
+ verbose is not set.
+ (print_frame_info): Avoid special-casing symbols that have not yet
+ been read in.
+
+ * source.c (open_source_file): Quick path if we have already
+ located the source file by its full name.
+
+ * symtab.c (lookup_symbol): Use find_pc_symtab rather than
+ find_pc_psymtab. When a name is found in the misc function
+ vector, search the symbol table for its mangled name, not the
+ name that the user typed.
+
+ * bfd.h: Fix missing comment terminators, make #endifs match.
+
+ * valarith.c (value_less): Handle unsigned int comparisons.
+ Add FIXME about pointer compares, which assume host and target
+ pointers are the same.
+
+ * command.c (do_nothing_command): lint
+ dbxread.c: lint. Remove sort_syms. Document C++ visibility info,
+ fix comments on debug symbol format for visibility. Actually set
+ visibility of symbols.
+ main.c (echo_command): lint; use <readline/history.h>.
+ tm-sparc.h (FRAME_FIND_SAVED_REGS): lint
+ obstack.h (_obstack_blank): Rearrange pointer math to avoid
+ pointing past end of allocated memory; saber complains.
+ obstack.h: Declare the external functions that we use.
+ valarith.h: use <string.h>
+ solib.c (solib_add): lint.
+
+Fri Sep 21 17:05:19 1990 John Gilmore (gnu at cygint)
+
+ * main.c (initialize_main): Default info_verbose to off, now that
+ symbol reading is fast.
+ (quit_command): Avoid clobbering exec_bfd while quitting.
+
+ * Initial BFD (binary file diddling library) merger:
+ coffread.c: Change AOUTHDR to struct exe_hdr.
+ dbxread.c: ditto.
+ core.c: initialize initialized data at compile time.
+ (core_file_command): Move from coredep.c, convert to bfd.
+ (xfer_core_file): Convert to bfd.
+ exec.c (exec_file_command): use bfd routines.
+ gdbcore.h: BFD.
+ mips-tdep.c: Remove exec_file_command and friends.
+ source.c: bfd.
+
+ * coredep.c: (fetch_core_registers) Convert core_file_command to
+ fetch_core_registers.
+ mips-xdep.c, sparc-xdep.c, sun3-xdep.c: ditto.
+
+ * utils.c: (error): Bogus crap, FIXME, to print bfd errors.
+ (my_bfd_read): More bogosity, which I don't think we call.
+ (program_name): Remove this atrocity asap!
+
+Wed Sep 19 13:36:41 1990 John Gilmore (gnu at cygint)
+
+ * From Per Bothner:
+ values.c: allocate_repeat_value was not clearing the
+ optimized_out field.
+ (value_static_field): minor stylistic fix (wrong macro was used).
+ valops.c (value_struct_elt_for_address): didn't work for C++
+ static fields.
+
+ * signame.c (_initialize_signame): Initialize signal names once.
+
+ * breakpoint.h, command.c, copying.awk, defs.h, environ.c,
+ exec.c, frame.h, infcmd.c, inferior.h, main.c, munch, sun3-xdep.c,
+ symtab.h, tm-29k.h, valprint.c, value.h, values.c: Lint.
+
+ * remote-eb.c: Support user-settable baud rates on the serial port.
+
+ * tm-sun3.h (PREPARE_TO_STORE): fix typo.
+
+Fri Sep 14 13:28:29 1990 John Gilmore (gnu at cygint)
+
+ * tconfig/sun3os4: Remove warning about native assembler,
+ since it also occurs in the xconfig file.
+
+ * findvar.c (registers): Allocate some slop after `registers'
+ to prevent stray accesses from trashing the next variable.
+
+ * tm-68k.h (REGISTER_BYTES): Allocate the right number of bytes
+ on the sun-3, by changing the #ifdef from `sun3' (which is not
+ defined by cc) to `sun'. Symptom was trashed builtin_type_XXX
+ vars, which happened to follow `registers' in the executable.
+
+ * readline/history.c (history_search): Heed gcc-2's advice
+ and parenthesize && inside ||).
+
+ * am29k-opcode.h, am29k-pinsn.c, am29k-tdep.c, remote-eb.c,
+ tm-29k.c: Insert FSF copyright headers.
+
+ * remote-eb.c: Better comments.
+
+ * Makefile.dist: Update to 3.91.6.
+ * TODO: note PREPARE_TO_STORE problem.
+
+Thu Sep 13 09:52:33 1990 Jim Kingdon (kingdon at cygint)
+
+ * stack.c (frame_info): Only use FRAME_FIND_SAVED_REGS if defined.
+
+ * remote.c: Wrap the whole file in #if !defined (SPECIAL_REMOTE).
+
+ * infrun.c (wait_for_inferior, at end): Don't set up
+ prev_* if the inferior no longer exists.
+
+ * inferior.h (CALL_DUMMY_LOCATION): New macro, to replace
+ CANNOT_EXECUTE_STACK.
+ valops.c (call_function): Use it.
+
+ * tm-convex.h: Add CALL_DUMMY_LENGTH for use by PC_IN_CALL_DUMMY.
+
+ * inferior.h (PC_IN_CALL_DUMMY): New macro.
+ infrun.c (wait_for_inferior, 2 places): Use it.
+
+ * values.c (value_being_returned): Only use
+ EXTRACT_STRUCT_VALUE_ADDRESS if defined.
+
+ * Move PREPARE_TO_STORE from xm-sun3.h to tm-sun3.h to do the
+ right thing for remote-eb.c.
+
+ * sun3-xdep.c: Remove extraneous call to remote_store_registers.
+ * sun386-xdep.c, hp300hpux-xdep.c, sparc-xdep.c: Ditto.
+
+ * blockframe.c: Put get_frame_saved_regs inside #if !defined
+ (FRAME_FIND_SAVED_REGS).
+
+ * findvar.c ({fetch,store}_registers): Check for
+ REMOTE_{FETCH_STORE}_REGISTER macro.
+
+ * findvar.c (get_saved_register): Add argument lval and
+ change meaning of argument addr.
+ findvar.c: Change calls to get_saved_register to reflect
+ new calling convention.
+ valops.c (value_assign): Use get_saved_register instead of
+ find_saved_register.
+
+Sun Sep 2 12:40:20 1990 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * coffread.c (read_one_sym): Make temp_aux an AUXENT, not
+ an (uninitialized) pointer to one. Use "&" when passing it
+ to fread.
+
+Fri Aug 31 22:57:54 1990 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * coffread.c (getfilename): Use DGUX x_offset and x_name if
+ defined.
+
+ * coffread.c (symbol_file_command): Put semicolon after
+ "int from_tty".
+ Put safe_to_init_tdesc_context in #if defined (TDESC).
+ Put #ifdef TDESCs in 1st column for non-ANSI cpp's.
+ coffread.c: #include <sys/stat.h>.
+ (read_coff_symtab): Typo: in_source_files -> in_source_file.
+ Add missing ')' in check for "lc%" and friends. Remove
+ extraneous '}'.
+ Declare read_one_sym() at top of file.
+ (read_file_hdr): Put in extra #ifdefs so MC68MAGIC and
+ MC68WRMAGIC can have the same value without causing a duplicate
+ case.
+
+Thu Sep 13 15:55:36 1990 John Gilmore (gnu at cygint)
+
+ * Allow a Makefile to be built without building the
+ tm and xm file links that screw up builds in subdirectories.
+ This is done with `config.gdb none', then you can do things
+ like `make gdb.tar.Z'.
+ * tconfig/none: Config file for no target system
+ * xconfig/none: Config file for no host system
+ * config.gdb: If no TM or XM files are called out by the
+ host or target file, don't make links for them.
+
+ * cplus-dem.c: Add documentation.
+
+ * dbxread.c (read_ofile_symtab): Turn a fatal error into a
+ simple error, so the user's gdb doesn't crash due to some object
+ file problem (e.g. somebody is rebuilding the file out from under
+ gdb).
+
+ * printcmd.c (print_address_symbolic): demangle the symbol.
+
+ * Makefile.dist (OTHERS): Remove tdesc-lib because it has
+ Motorola copyrights in it. Make "make gdb.tar.Z" work.
+ (alldeps.mak): sort and uniq all results from this; duplicates
+ hose gdb.tar.Z link building. Remove RCS files from
+ tconfig and xconfig. Add config files for sun386. Add
+ a few odd files to OTHERS and HFILES.
+
+Mon Sep 10 21:20:24 1990 John Gilmore (gnu at cygint)
+
+ * Makefile.dist: Pull solib.c to tconfig/sun?os4.
+ Roll version number to 3.91.5. Make lint work in bindir.
+
+ * README: Document cross-debugging and new file structure.
+
+ * blockframe.c: Lint. Include "value.h" to declare read_register.
+ (find_pc_partial_function): remove duplicate line.
+
+ * command.h: Lint. Declare error_no_arg and dont_repeat.
+
+ * tm-news.h: Remove inadvertently duplicated stuff.
+
+ * mipsread.c: Remove cache_pc_function stuff, now done cleanly.
+ Clean up usage of misc_function_type. Declare some CORE_ADDRs.
+
+ * config.gdb: Allow `config.gdb host target' form. Clean
+ up previous change that printed bogus messages when you just said
+ `config.gdb'.
+
+ * core.c: #include "command.h" for lint.
+ * dbxread.c: lint
+ * eval.c: lint
+ * main.c: Remove some casts of enums. Lint.
+ * source.c: lint
+ * symtab.c: lint
+ * symtab.h: lint
+ * expread.y: lint
+ * valarith.c: lint
+
+ * printcmd.c (initialize_printcmd): Fix thinko in inspect cmd.
+
+ * sparc-tdep.c (isannulled): Take instruction as parameter, don't
+ read it from memory. This will allow us to save ptrace calls
+ eventually. Changed caller single_step too.
+
+ * sparc-xdep.c (fetch_inferior_registers): Avoid reading regs
+ that we aren't going to use, saving many ptrace calls, especially
+ when watchpointing or single stepping. Use some #define's for
+ constants.
+ (store_inferior_registers): Ditto.
+ (core_file_command): Use some #define's for constants.
+
+ * tm-sparc.h: Add #define's for some register numbers, so we
+ can eliminate the use of random constants in sparc-xdep.c.
+
+ * stack.c (frame_command, print_frame_info, up_command,
+ down_command) Remove frame_changed, since it
+ causes a bug and doesn't seem to do anything useful. In some
+ places it was used as a flag, in others as a stack level (?).
+
+ * utils.c: Use MISSING_VPRINTF rather than HAVE_VPRINTF, so the
+ default is to use the portable (vprintf) version rather than the
+ kludge version.
+ * xm-news.h (MISSING_VPRINTF): Add.
+
+ * valprint.c (val_print): Demangle fancy vtbl printouts. Lint.
+
+Sat Sep 8 00:24:12 1990 John Gilmore (gnu at cygint)
+
+ * Remove stuff that forces -Bstatic linking of gdb, and warnings
+ about linking debugged programs -Bstatic in the sun?os4 config
+ files in tconfig and xconfig subdirectories.
+
+ * main.c (main): Remove unreached exit(0) now that we exit
+ via quit_command().
+
+ * Create TODO file for online bug list. There are too many
+ "little" bugs to keep track of on paper.
+
+ * Change Projects file to refer to bug-gdb@cygnus.com
+ rather than kingdon@ai.
+
+Fri Sep 7 23:35:15 1990 John Gilmore (gnu at cygint)
+
+ * Makefile.dist (VERSION): 3.91.4 now.
+
+ * symtab.c (init_misc_bunches): Rename from init_misc_functions.
+ (condense_misc_bunches): Add sanity check that misc_count is
+ the same as the number of symbols in the bunch.
+
+ * coffread.c: rename init_misc_bunches. Pass an argument
+ to condense_misc_bunches (a zero).
+
+ * dbxread.c (partial_symbol_file_read): Call init_misc_bunches
+ every time we are called; don't rely on our caller to do it.
+ (add_file): Remove call to init_misc_bunches.
+
+ * mipsread.c: Only warn, don't error, if unknown symbol types.
+ This keeps an old gdb from falling on its face if it sees newly
+ extended symbol info. Rename init_misc_bunches.
+
+Fri Sep 7 22:58:15 1990 John Gilmore (gnu at cygint)
+
+ * Merge in changes from Per Bothner for DECstations and other
+ MIPS stuff. The rest is Bothner speaking:
+
+ The next message is a merger of Alessando Forin's mips port with
+ mine. I've tried to use my good if biased judgment to get
+ the best of both. It *does* need testing.
+
+ Some of the changes are general, *not* mips-specific.
+
+ param.h:
+ Didn't believe in little-endian bit order.
+ There are still inconsistencies about whether flags
+ like BITS_BIG_ENDIAN are integer (#if ...) or
+ boolean (#ifdef ...). I tried to paper over them.
+
+ dbxread.c,coffread.c,mipsread.c,symtab.c,symtab.h:
+ Moved some misc_function code that was common to
+ {dbx,coff,mips}read.c to symtab.c.
+ In the process, I think I cleaned things up a bit.
+ At the same time, moved obsavestring and obconcat to symtab.c.
+
+ dbxread.c:
+ Removed obsolete condense_addl_misc_bunches (use
+ condense_misc_bunches(1) instead).
+
+ exec.c:
+ Needed to include <sys/dir>, at least on DECstations.
+
+ valops.c, mips-tdep.c, tm-mips.h:
+ Added PUSH_ARGUMENTS macro to support funny argument-pushing
+ conventions (when STACK_ALIGN is insufficient).
+ Needed on mips, where doubles need 8-byte alignment,
+ but ints only need 4.
+
+ mips-opcode.h:
+ Removed cruft that was not being used.
+ Merged in many fixes (most from Frank Yellin, fy@lucid.com).
+
+ mips-pinsn.c:
+ Print $ before register-names (I think that makes things a little
+ more consistent).
+ Never print two instructions, even if one delays.
+ Removed hex-disassemble set_cmd. (This is not mips-specific,
+ so I think the argument is whether it is generally worthwhile or not.
+ I'm inclined to think not, given how easy it is to
+ convert between radixes in gdb.)
+
+ mipsread.c:
+ This is basically Alessando's code.
+ It doesn't use obstacks; I changed it to use obstacks
+ in a few minor places where using malloc causes a
+ memory leak. (Probably, more places could/should be changed.)
+ I added record_misc_function where it was missing.
+ In symbol_file_command and add_file_command, I tried
+ to make the code consistent with more recent versions.
+ Minor sylistic changes in parse_procedure.
+ Make a .gdbinfo. psuedo-symbol point back to the real
+ procedure symbol (using the isym field).
+
+ mips-tdep.c:
+ This is basically from my port, but with a lot of details
+ and a number of routines merged in from Alessando's version.
+ I basically used my code "raw" backtrace (use heuristics
+ from the actual code, rather than symbol table info) - though
+ the idea is Alessandro's. I feel my code is a little cleaner
+ here, particularly in being a little more flexible, such as being
+ able to handle gcc-produced code (which it now can).
+ It also doesn't do frame caching (which is not useful
+ more recent gdb versions).
+ I also used my code for push_/pop_dummy, more or less.
+ I tried to incorporate AF's code for testing sigtramp
+ while backtracing; I probably got it wrong.
+ Added mips_print_register, which tries to scrunch as much
+ information as possible on a screen...
+ Removed the skip-prologue set_cmd. As with hex-disassemble (see
+ under mips-pinsn.c), I don't see anything mips-specific here,
+ and I don't see it being all that useful anyway.
+
+ tm-mips.h:
+ Added a $fp psuedo-reg distinct from $fp (nice for gcc).
+ Use more register names (rather than hard-cases numbers).
+
+Thu Sep 6 18:33:15 1990 John Gilmore (gnu at cygint)
+
+ * Hack up 3.90.11 changes:
+
+ * Makefile.dist (depend): parameterize $(GCC).
+ Add solib.c and solib.o.
+ (readline): Fix vpath for both absolute or relative SRCDIR.
+
+ * blockframe.c: Fix from Schaefer@asc.slb.com for shared libs.
+ Also, let the part I didn't understand at least compile so
+ I can test the rest. FIXME.
+
+ * dbxread.c: Fix thinko using strcmp.
+ (init_psymbol_list): declare static.
+ (partial_symbol_file_open): Comment cleanups better, avoid
+ cleaning up the string table since the caller will do that.
+ Move the stat for mod time into symbol_file_command, temporarily.
+ (There should be a mod time for each symbol file, eventually,
+ to control its rereading. FIXME.)
+
+ * infptrace.c (PT_WRITE_D): use same value as PT_WRITE_I for
+ SunOS, which gives error for shared libs otherwise. (From
+ Schaefer, probably FIXME needs work for portability.)
+
+ * solib.c: Move #include "param.h" to work.
+ Lowercase all the Uppercase Letters In the Messages.
+ (find_solib): Clean up inferior_so_name for debug printouts.
+ Allow no argument, to mean all shared libraries.
+
+ * symmisc.c: include param.h to get CLEAR_SOLIB.
+
+Wed Sep 5 18:00:08 1990 John Gilmore (gnu at cygint)
+
+ * Merge in Kingdon's changes from FSF: the diffs from 3.90.9
+ to 3.90.11. ChangeLog entries below are from this.
+
+Wed Jun 13 09:17:39 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * Version 3.90.11.
+
+ * Makefile.dist (HFILES): Add tm-sunos.h.
+
+Tue Jun 12 16:15:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.10.
+
+ * Makefile.dist (gdb.tar.Z): Change linking of config so it works.
+
+Thu Jun 7 16:22:27 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
+
+ * sparc-opcode.h Added single-operand version of rett.
+
+Mon Jun 4 18:12:31 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * m-sparc.h (REG_STRUCT_HAS_ADDR, STRUCT_ARG_SYM_GARBAGE):
+ Put parens around gcc_p in expansion.
+
+Thu May 24 15:44:51 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * utils.c (lines_to_list): Return 10 if lines_per_page == 0.
+
+Wed May 23 16:36:04 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Changes for Sun shared libraries:
+ blockframe.c (find_pc_partial_function): If a non-text symbol
+ is found, set *address = pc - FUNCTION_START_OFFSET.
+ breakpoint.c (insert_breakpoints) [DISABLE_UNSETTABLE_BREAK]:
+ Disable breakpoints instead of giving an error.
+ source.c (select_source_symtab): Initialize cs_pst.
+ symmisc.c: Call CLEAR_SOLIB if defined.
+ symtab.h: Make text{low,high} CORE_ADDR not int.
+ (psymtab): New field addr.
+ solib.c: New file.
+ dbxread.c: Move DECLARE_FILE_HEADERS outside functions.
+ (record_misc_function): Give correct type for N_DATA symbols.
+ (condense_misc_bunches): do "misc_function_count = j" regardless
+ of inclink.
+ Take code which is shared between symbol_file_command and
+ add_file_command and put it into partial_symbol_file_{open,read}.
+ Split add_file_command into add_file_command and add_file.
+ Make psymtab_to_symtab read in the string table if the file
+ is not symfile.
+ Two new parameters to read_dbx_symtab and start_psymtab.
+ tm-sunos.h: New file.
+
+Tue May 22 17:43:03 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * infcmd.c: Change cont_command to continue_command and "cont"
+ to "continue".
+
+Mon May 21 14:41:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * breakpoint.c (enable_breakpoint): Get value of watchpoint.
+
+ * defs.h [sparc]: Use <alloca.h> regardless of __GNUC__.
+
+ * values.c (USE_STRUCT_CONVENTION): Check for structures of
+ size 1,2,4,8 rather than size < 8.
+
+ * dbxread.c (dbx_lookup_type): Do f->length *= 2 as many times
+ as necessary, not just once.
+
+ * sparc-opcode.h: Add a bunch of new opcodes which Sun as supports.
+
+Thu May 17 15:04:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * {t,x}m-sun386.h, sun386-xdep.c, {x,t}config/sun386
+
+ * tm-news.h: Add CALL_DUMMY_*.
+
+ * tm-68k.h: Remove duplicate comment at FRAME_FIND_SAVED_REGS.
+
+ * config.gdb: In list_host, list_target, use ${i}, not $i.
+
+Tue May 15 21:27:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * source.c (find_source_lines) [BROKEN_LARGE_ALLOCA]: Use xmalloc.
+
+ * sparc-opcode.h: Change all store floating-point state register
+ instructions to have the right match & lose fields.
+
+Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist: Move -I${srcdir} to GLOBAL_CFLAGS and pass
+ VPATH to readline.
+ config.gdb: If srcdir != ., create readline directory and
+ copy a makefile into it.
+
+ * wait.h, infrun.c: Change WRETCODE to WEXITSTATUS for
+ consistency with POSIX.
+
+ * breakpoint.c (bpstat_stop_status): Disable watchpoint
+ when we exit its exp_valid_block.
+
+Tue Sep 4 11:46:46 1990 John Gilmore (gnu at cygint)
+
+ * Makefile.dist: Bump version to 3.91.3.
+
+ * Clean up handling of breakpoint commands (somewhat).
+ Prompted by Tiemann bug report "cont 10" doesn't work any more.
+
+ inferior.h: Add breakpoint_proceeded to inferior status struct
+ and globals; save it and restore it.
+ (clear_breakpoint_commands): Cleanup, remove old #define.
+
+ infrun.c (clear_proceed_status): Set breakpoint_proceeded.
+ (save_inferior_status, restore_inferior_status): handle it also.
+ (proceed): Remove earlier code that set breakpoint_proceeded.
+ It is now set only in clear_proceed_status.
+ (clear_proceed_status): Cleanup, use bpstat_clear rather
+ than clear_breakpoint_commands. No callers need the stop_bpstat
+ between clear_proceed_status and proceed.
+
+ infcmd.c: Add breakpoint_proceeded definition and comment.
+ (cont_command, jump_command, signal_command): Move call to
+ clear_proceed_status right next to call to proceed.
+
+ breakpoint.c (bpstat_do_actions): Avoid clobbering our
+ caller's argument while running down the chain of breakpoints.
+ Use new variable "breakpoint_proceeded" to determine when
+ a command that it executes moves the inferior past the
+ breakpoint.
+ (bpstat_clear): Handle NULL argument.
+ (bpstat_clear_actions): Avoid useless call to
+ breakpoint_auto_delete.
+ (delete_breakpoint): Clean up bpstat's that are pointing to
+ the deleted breakpoint from the stop_bpstat chain.
+ (breakpoint_auto_delete): Simplify.
+
+ * Clean up handling of EOF, error on stdin, etc. This was
+ prompted by a network problem that caused gdb to go into an
+ infinite loop filling up its malloc'd memory.
+
+ main.c (return_to_top_level): Cleanup: call bpstat_clear_actions,
+ not clear_breakpoints_commands, which is now gone.
+ (main): If command_loop returns (e.g. from EOF on stdin), do
+ a quit_command (looping back to command_loop if quit_command
+ doesn't really quit).
+ (command_loop): check result from command_line_input and
+ exit if it returns NULL, rather than passing the NULL to
+ execute_command.
+ (gdb_readline): Free malloc'd result space before returning
+ NULL for EOF.
+
+ * utils.c (query): Handle C-d to mean "yes", just as if the
+ input was not a terminal. Also avoid infinite loop if EOF
+ occurs in mid-input-line before newline. This allows
+ query to be used at EOF on stdin with reasonable results.
+
+ * infrun.c (proceed): Set breakpoint_proceeded.
+
+ * values.c (value_as_long): Avoid infinite recursion for enums.
+ (_initialize_values): Fix typo in help msg (kingdon).
+
+ * Makefile.dist (RL_LIB): Use RL_LIB_DEP for dependencies,
+ RL_LIB for linking. This allows -lreadline for linking
+ and nothing for dependencies, once readline is a real library.
+
+ * config.gdb: Jim Kingdon: give useful error message if the
+ host or target type is not recognized.
+
+ * defs.h (alloca): SPARC <alloca.h> does not declare alloca,
+ it just defines it. Dumb, but deal with it.
+
+ * Jim Kingdon suggests:
+ in xconfig/sun3os4, CFLAGS should be XM_CFLAGS.
+
+Wed Aug 29 18:03:27 1990 John Gilmore (gnu at cygint)
+
+ * Makefile.dist (VERSION): Bump version # to 3.91.2.
+
+ * Clean up Bothner's changes.
+
+ * blockframe.c (clear_pc_function_cache): New function.
+ * blockframe.c: remake cache_pc_function_* static.
+ * dbxread.c (symbol_file_command): remove references to
+ cache_pc_function_* variables.
+ * dbxread.c (read_struct_type): Use VOFFSET_STATIC.
+ * printcmd.c: Avoid kludging a global variable (addressprint)
+ to avoid printing the address of a string twice. Instead,
+ pass the format letter 's' down low enough that it can be seen
+ to avoid this problem.
+ (print_formatted): Pass format arg to value_print.
+ (restore_addressprint): Remove function.
+ (do_examine): Avoid hacking addressprint, cleanups and such.
+ (print_frame_args): Add a comment to a Bothner change.
+ * symtab.h: define VOFFSET_STATIC and use it instead of "-1".
+ * symmisc.c (free_all_symtabs): Call clear_pc_function_cache
+ to wipe out the values cached in blockframe.c.
+ * symtab.c (find_method): Add comment saying how big you must
+ allocate to be "big enough". Per being terse again.
+ * valprint.c (val_print): Handle format letter "s" to print
+ strings without addresses. Add comment to vtbl printing code
+ which casts with wild abandon. Rearrange reference-printing
+ code so it prints:
+ @0xaddr: value (print w/addressprint)
+ value (print w/~addressprint)
+ @0xaddr (parameter lists w/addressprint)
+ or nothing (parameter lists w/o addressprint)
+
+Tue Aug 28 10:47:18 1990 John Gilmore (gnu at cygint)
+
+ * Merge more changes from Per Bothner:
+
+Gdb's handling of TYPE_CODE_REF was so counter-C++ (and otherwise
+annoying) that I tried to improve it. Here are my suggestions.
+
+ These patches all attempt to handle TYPE_CODE_REF (as in C++) better.
+
+ findvar.c:
+ Do automatic de-reference when taking the address of a reference.
+ printcmd.c:
+ Don't deref_ref when printing parameter lists.
+ valops.c:
+ More attempts at treating refernences properly.
+ valprint.c:
+ In val_print, if deref_ref==0, don't print dangling " = ".
+ value.h:
+ Add COERCE_REF macro, which de-references an REF.
+
+ * Merge changes from Per Bothner:
+
+* Fixed (Sony news)-specific configuration problems.
+* Fixed other problems with using vanilla pcc and libc (enum problems;
+assumption that vsprintf exists).
+* Some major speed-ups (finc_pc_partial_function now caches a match;
+parsing avoids duplicate symbol_lookup calls).
+* Changed handling of baseclasses (no longer use baseclasses field
+of struct type, use the first n_baseclasses fields instead).
+* Various minor changes/fixes, most C++-related.
+
+blockframe.c:
+Cache the most previous match from find_pc_partial_function.
+(Save both low and high ends of matching function's pc range.)
+This speeds up the loop of infrun.c:wait_for_inferior quite
+a bit, and makes step/next commands much zippier.
+command.c:
+Added an enum->int cast (otherwise, some compilers barf).
+dbxread.c:
+No longer set baseclass offset to 0, since multiple
+inheritance now mostly works.
+Added a number of casts, to shut up compiler warnings
+(after stabs where made enums, not ints).
+When discarding a symbol table (in symbol_file_command),
+must clear the cache introduced in blockframe.c.
+Don't convert $vtbl_ptr_type to vtbl any more.
+Get rid of TYPE_BASECLASEES and baseclass_vec (see also symtab.h).
+Mask off sign bit emitted by g++ for virtual table offset.
+Set voffset to -1 (not 1) for static member functions.
+expread.y:
+Changed parsing/lexing of names to avoid doing symbol lookup twice
+(once when lexing to determine symbol class, once for real).
+Now only call symbol_lookup once. Fields of 'this' win especially big.
+printcmd.c:
+Subpress printing addr twice in the case of 'x/s addr'.
+symtab.c:
+lookup_basetype_type is no longer used.
+Add find_methods as recursive helper function to decode_line_1.
+This allows multiple inheritance to work.
+Also, once one or more matches has been found, do not look in
+base-classes. (Baseclass methods would be overridden, anyway.)
+symtab.h:
+Removed baseclasses array in struct type.
+Instead of using baseclasses[i], use fields[i-1].
+Added virtual_field_bits[i] to indicate if the i'th baseclass is virtual.
+Changed sign convention of voffset (previous was inconsistent).
+tm-news.h:
+Some macros (CALL_DUMMY and relatives) were missing. Put them back.
+utils.c:
+Used to assume existence of vsprintf. Re-written to not need it
+if HAVE_VPRINTF is undefined.
+valops.c:
+typecmp was too pessimistic. Made it less so.
+valprint.c:
+Don't print space after address.
+If vtable points to a misc symbol (with 0 offset), print it,
+since that indicates the actual class of the object.
+Changed ype_print_derivation_info to use new inheritance
+scheme (without baseclasses vector).
+values.c:
+In value_primitive_field, fixed some bugs left over from previous set of fixes.
+Also, changes needed because TYPE_BASECLASSES were removed.
+xm-news.h:
+REGISTER_U_ADDR didn't work for PC. Rewrote to use an array.
+
+Tue Aug 21 20:08:54 1990 John Gilmore (gnu at cygint)
+
+ * source.c:
+ If there is no path set, and the symbols don't indicate what directory
+ a file was compiled in, look in the current directory. But either
+ a path or a known compilation directory will prevent this.
+
+ * dbxread.c:
+ Three independent bug fixes:
+ * Remove the #if 0 block that breaks some stuff.
+ * SunOS 4.1 fixed the promoted-parameter-wrong-addr bug in Sun C;
+ adapt gdb to either SunOS 4.0.* or 4.1.
+ * MAX_OF_TYPE and MIN_OF_TYPE thinko. By tedg@sun, I think.
+
+ * symtab.c:
+ Instantiate the class T when looking for methods in it. (Tiemann@sun)
+
+ * valprint.c:
+ (type_print) Demangle the name being printed.
+ (type_print_base) Handle botched demangling without coredump (tiemann).
+
+ * values.c:
+ (check_stub_method): Document routine.
+ (tiemann) fix bug for no-arg functions
+ Avoid clobbering beyond end of malloc'd storage.
+ Terminate the argument list properly.
+
+Sat Aug 18 01:29:59 1990 Per Bothner (bothner@cs.wisc.edu)
+
+ * Changes merged by John Gilmore:
+
+breakpoint.c:
+ In breakpoint_1, use new print_address_symbolic instead
+ of find_pc_partial_function. (This forces use of assembler-level
+ addresses, and avoids misleading non-mangled source-level names.)
+cplus-dem.c:
+ Generalize ansi argument such that -1 means skip arglist totally.
+ Removed global variable print_ansi_qualifiers (which made
+ code non-reentrant), in favor of extra explicit arguments
+ to internal routines.
+printcmd.c:
+ Add new helper function print_address_symbolic.
+ Use find_pc_misc_function instead of find_pc_partial_function
+ (since we want assembler-level symbols here).
+stack.c:
+ Print unknown function as just "f (...)", not "f (...) (...)".
+ Use new fputs_demangled explicitly.
+symtab.c:
+ Fixed a typing violation (problem: value.h cannot be imported
+ without renaming many variable in this file).
+ lookup_symbol: If no matching misc_func, look for a C++-mangled name.
+ decode_line_1: Moved forward some never-reached code.
+ Made decode_line_2 skip function prologues correctly.
+utils.c:
+ fputs_filtered should not demangle by default.
+ Add new fputs_demangled to demangle on demand..
+valops.c:
+ Change value_struct_elt to use value_primitive_field (using recursive
+ utility function search_struct_field). This allows foo.bar to work
+ for multiple inheritance (so far only for data fields).
+ Change check_field in the same way (recursive helper function
+ to support multiple inheritance).
+ (Note: there are more of these problems that I haven't fixed.
+ Any code that says TYPE_BASECLASS (t, 1) is probably wrong.)
+ value_of_this: 'this' symbol name is now just "this", note "$this".
+valprint.c:
+ Don't print static members.
+ Avoid printing "members of <type>" if there are none.
+ Simplified type_print_derivation_info by merging duplicate code.
+ Remove useless blank lines in type_print_base (ptype command).
+value.h:
+ Added declaration of new routine value_primitive_field.
+values.c:
+ Added value_primitive_field which is generalized version of
+ value_field that can handle multiple inheritance (non-zero offsets etc).
+ Re-implemented value_field to call value_primitive_field.
+
+Fri Aug 17 23:33:44 1990 John Gilmore (gnu at cygint)
+
+ * infcmd.c -- insert else to avoid 'delete env' coredump when you
+ delete the whole environment. Karl Berry reported the bug.
+ * source.c - fix openp to avoid //'s in filenames, which
+ trigger an Emacs bug causing it to not be able to find files
+ when running gdb in a window.
+ * dbxread.c - zap the #if 0 that botches the add-file code.
+ It seems to work a lot better without all the code commented out.
+
+Fri Jul 20 16:58:46 1990 John Gilmore (gnu at cygnus.com)
+
+ * Merge Tiemann's and Ted Goldstein's changes, detailed below,
+ into gdb-3.90.9.
+
+Tue Jul 17 19:34:33 1990 Ted Goldstein (tedg at golem)
+
+ * Makefile - added a ${CFLAGS} to a couple of entries,
+ added remote-sa.sparc.c
+ * added remote.sa-sparc.c, a modification of remote.c
+ which conducts a dialog directly with the SparcStation prom.
+ * breakpoint.c, infrun.c, sparcdep.c added
+ remote_insert_breakpoint(), and remote_remove_breakpoint()
+ to breakpoint.c instead of directly writing breakpoint instructions.
+ * sparcdep.c on remote_debugging,there is no need
+ to remove signle step breakpoint instructions.
+ * main.c added "-epoch" flag and "int epoch_interface" to main.c
+ global variable
+ * printcmd.c - epoch interface sends lisp expressions to open up
+ epoch windows on inspection.
+ * valprint.c - added arrayprint, and addressprint and made adding
+ format controls easier
+ * wait.h added a couple of undef's because we were getting
+ complaints about WSTOPSIG and WTERMSIG begin redefined.
+
+
+Wed Jul 4 05:27:51 1990 Michael Tiemann (tiemann at masham)
+
+ * symtab.c (decode_line_1): Add support for handling method stubs
+ in the type information.
+
+Tue Jul 3 09:39:18 1990 Michael Tiemann (tiemann at masham)
+
+ * values.c (baseclass_addr): Run loop from INDEX+1 to
+ N_BASECLASSES; otherwise, we can still get into a loop.
+ @@ This should be restructured to use a cleaner search strategy.
+
+Sun Jul 1 12:28:51 1990 Michael Tiemann (tiemann at masham)
+
+ * dbxread.c (define_symbol,read_type): Grok GNU C++'s new
+ abbreviation "Tt" for tags which have the same name as their
+ typedecls.
+
+Fri Jun 29 01:03:46 1990 Michael Tiemann (tiemann at masham)
+
+ * symtab.c (list_symbols): add ability to set breakpoints on all
+ the functions which match a particular regular expression.
+
+Tue Jun 26 04:26:29 1990 Michael Tiemann (tiemann at masham)
+
+ * cplus-dem.c (cplus_demangle): New parameter ANSI says whether we
+ should print ANSI qualifiers (such as `const' and `volatile').
+ All callers changed to call with ANSI == 1, except from
+ `check_method_stub', which uses old-style syntax.
+
+ * symseg.h (struct fn_field): Remove unneccessary `args' field.
+ * symtab.h (TYPE_FN_FIELD_ARGS): Redefined.
+
+ * values.c (check_stub_method): New function.
+
+ * cplus-dem.c (do_type): Handle "long long" (encoded as 'x').
+
+ * dbxread.c (read_type): Handle new GNU C++ method type stubs.
+ * valprint (type_print_base): Ditto.
+
+ * symtab.c (gdb_mangle_typename): New function.
+
+Tue Jun 5 00:18:43 1990 Michael Tiemann (tiemann at gzilla)
+
+ * breakpoint.c (catch_command): New function. Provides a
+ mechanism to set breakpoints based on catch clauses.
+ (disable_catch): Similar, but disables breakpoints on catch
+ clauses.
+ (delete_catch): Similar, but deleted breakpoints on catch clauses.
+
+Sun Jun 3 22:54:08 1990 Michael Tiemann (tiemann at gzilla)
+
+ * blockframe.c (blockvector_for_pc): New function.
+ * blockframe.c (block_for_pc): Changed to call
+ `blockvector_for_pc' and get the block itself.
+
+ * stack.c (catch_info): New function. Prints info about
+ exceptions which can be caught in the current frame.
+ * stack.c (print_frame_label_vars): New function. Similar to
+ `print_frame_local_vars'.
+ * stack.c (print_block_frame_labels): Prints out labels that are
+ defined in this frame. These labels are exceptions that can be
+ caught.
+
+ * dbxread.c: Updated to handle N_CATCH symtab types.
+
+Thu May 3 22:10:00 1990 Michael Tiemann (tiemann at teacake)
+
+ * valprint.c (everywhere): TYPE_NAME (TYPE) no longer comes in the
+ form "struct ..." for GNU C++. Don't flush any part of TYPE_NAME
+ when printing the type.
+
+Wed May 2 22:43:04 1990 Michael Tiemann (tiemann at teacake)
+
+ * valprint.c (val_print): Use `baseclass_addr' to access the
+ baseclasses pointed to via the derived class object at VALADDR.
+
+ * values.c (baseclass_addr): New function. Casts derived pointers
+ to baseclass pointers taking virtual baseclasses and multiple
+ inheritance into account.
+
+Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.9.
+
+Fri May 4 12:12:55 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * breakpoint.c (watch_command, bpstat_stop_status): Deal with
+ exp_valid_block field correctly.
+
+ * infrun.c (wait_for_inferior): When checking "don't even think
+ about breakpoints" if stop_signal == SIGTRAP && trap_expected,
+ also check step_resume_breakpoint.
+ Insert breakpoints and continue (not step) if
+ step_resume_break_address != NULL, even if another_trap.
+ If trap_expected and we enter sigtramp, then set up a
+ step_resume_break.
+ If trap_expected is set when we hit the step_resume_break,
+ set another_trap.
+ When calling resume and trap_expected says tell resume to step
+ (2 places), also check step_resume_break_address.
+
+ * infrun.c (wait_for_inferior): Don't set
+ prev_{pc,sp,func_{start,name}} before calling wait ().
+ Do set them after exiting loop.
+ Move their declarations outside functions.
+ (start_inferior): Initialize them.
+
+Thu May 3 00:15:11 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * infrun.c (wait_for_inferior, after check for trap_expected > 1):
+ Restore old code which distinguishes between trap_expected and
+ running_in_shell, just make the latter take any non-TRAP signal,
+ not just SEGV.
+
+ * values.c (allocate_value): Zero VALUE_OPTIMIZED_OUT flag.
+
+ * Makefile.dist (pinsn.o): Use PINSN_CC to compile.
+ xconfig/3b1 (CC,PINSN_CC): Define.
+
+ * xconfig/altos, altos-dep.c: Rename altos-dep.c to altos-xdep.c.
+
+ * Version 3.90.8
+
+ * breakpoint.c (bpstat_stop_status),
+ infrun.c (wait_for_inferior) [SHIFT_INST_REGS]: New code.
+
+ * param.h, tm-88k.h: Define ADDR_BITS_*.
+ infcmd.c (jump_command, read_pc), infrun.c (wait_for_inferior),
+ printcmd.c (do_one_display): Use them.
+
+ * utils.c: Split #ifdef USG into a USG_UTILS and a QUEUE_MISSING.
+ xm-88k.h: Define USG_UTILS.
+
+Wed May 2 00:05:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * printcmd.c (printf_command) [__INT_VARARGS_H]: New code.
+ (printf_command): Add from_tty parameter.
+
+ * valprint.c (value_print): Check VALUE_OPTIMIZED_OUT flag.
+
+ * value.h: Add optimized_out field and change lazy field to
+ char. Add macro VALUE_OPTIMIZED_OUT.
+
+ * i386-pinsn.c: Change from Eirik Fuller to write to stream directly
+ instead of stuffing things in buffers (oappend, etc).
+
+ * breakpoint.c (bpstat_do_actions): If *BSP is set to NULL by
+ execute_command, exit both loops.
+
+ * Makefile.dist: Don't set TARGET_ARCH. Add .c.o rule.
+
+Tue May 1 17:07:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist (RAPP_OBS, rapp),
+ rgdb.c, rserial.c, rudp.c, serial.c, udp.c, xdep.h,
+ remote.h: Added.
+ m68k-xdep.c, coredep.c: Wrap in #if !defined (RDB).
+
+ * valops.c (value_struct_elt), values.c (value_static_field):
+ Change error messages to remove references to `info methods'.
+
+Tue Apr 24 10:25:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * More 88k changes:
+ infrun.c (start_inferior): Add START_INFERIOR_HOOK.
+ infcmd.c [SHIFT_INST_REGS]: New code.
+ findvar.c (read_relative_register_raw_bytes): Return a value.
+ infcmd.c (do_registers_info): Check value from
+ read_relative_register_raw_bytes.
+
+ * command.c (delete_cmd): Free the struct cmd_list_element(s)
+ we are removing.
+
+Mon Apr 23 10:42:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * More 88k changes:
+ findvar.c (get_saved_register): New function.
+ findvar.c: Rewrite code which called find_saved_register to
+ call get_saved_register instead.
+
+Sun Apr 22 14:47:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * valprint.c (val_print): Change error message printed when
+ the type has TYPE_FLAG_STUB set.
+
+ * valprint.c (val_print): Check for TYPE_CODE_UNDEF.
+
+ * findvar.c (write_register): Set register_valid (regno).
+
+ * valops.c (call_function): Check for NULL return from block_for_pc.
+
+Fri Apr 20 11:31:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * findvar.c (write_register): Add PREPARE_TO_STORE.
+ {sun3,sparc,symmetry}-xdep.c (PREPARE_TO_STORE): Add.
+ infptrace.c, {mips,pyr,symmetry,sun3,arm,hp300hpux}-xdep.c
+ (store_inferior_registers): Don't call read_register_bytes.
+ symmetry-xdep.c (store_inferior_registers):
+ #if 0 out code to fetch registers.
+
+ * values.c (value_as_long): Call COERCE_ARRAY.
+
+ * tm-sun3.h: Include tm-68k.h not m-68k.h
+
+ * sparc-tdep.c (single_step): Set next_pc, npc4 within
+ if (!one_stepped), not outside it.
+
+ * Changes from Data General for 88k:
+ * coffread.c (read_file_hdr): Add *88*MAGIC.
+ * coffread.c (have_symbol_file_p): New function.
+ * coffread.c [COFF_CHECK_X_ZEROES] [TDESC]: New code.
+ * coffread.c (read_one_sym): If there is more than one
+ aux entry, don't give an error message, just ignore the
+ extra ones.
+ * coffread.c (process_coff_symbol): Replace clipper with
+ BELIEVE_PCC_PROMOTION in #ifdef's.
+ * coffread.c: Define L_LNNO32 if not defined.
+ (enter_linenos): Use it.
+ * blockframe.c: Add INIT_FRAME_PC hook and use it in
+ get_prev_frame_info.
+ m-m88k.h: Use INIT_{FRAME_PC,EXTRA_FRAME_INFO} to do tdesc stuff.
+ Use dummy versions of FRAME_CHAIN_*.
+ * Makefile.dist, xconfig/i386*: Rename M_CLIBS to XM_CLIBS and add
+ TM_CLIBS and CDEPS.
+ tdesc/libdc.o: New target.
+ tdesc.{c,h}, tdesc/*, {t,x}config/m88k: New files.
+
+Thu Apr 12 15:47:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * m68k-opcode.h (bras, bsrs): Use "Bw" not "Bg".
+
+Tue Apr 10 20:50:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.7.
+
+ * xm-mips.h (BYTE_ORDER): If not defined, make it LITTLE_ENDIAN.
+
+ * mips-xdep.c ({fetch,store}_inferior_registers): Remove variable
+ offset and just use register_addr (regno, 1).
+ (core_file_command): Remove variable reg_offset and just use
+ register_addr (regno, 0).
+
+ * gdbcore.h [COFF_FORMAT]: #undef a_magic before redefining it.
+
+ * infrun.c ("if (trap_expected && stop_signal != SIGTRAP)", near end
+ of wait_for_inferior): Always pass 0 as first arg to resume.
+ #if 0 out "SIGSEGV in shell" test right above it (now redundant).
+
+ * i386-pinsn.c (oappend_address): New function.
+ (oappend): Make it "static void" and declare at top of file.
+ (OP_J, OP_DIR): Use oappend_address.
+
+Mon Apr 9 15:22:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * mips-xdep.c: Include <mips/inst.h> not "mips/inst.h".
+
+ * wait.h [HAVE_WAIT_STRUCT]: Put #defines in #if !defined so that
+ it's OK if they are defined in <sys/wait.h>.
+
+ * findvar.c (fetch_registers): Pass "registers", not "&registers",
+ to remote_fetch_registers.
+
+ * mips-tdep.c (_initialize_mipsdep): Remove hex_disassembler
+ and re-write skip_prologue to use add_set_cmd.
+
+ * Makefile.dist (alldeps.mak): Don't put \ after the last
+ filename in each list.
+
+Sun Apr 8 01:59:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.6.
+
+ * Makefile.dist (alldeps.mak): "XM_FILE" -> "XM_FILE=".
+
+ * valarith.c (value_x_{un,bin}op): use "operator" not "operator "
+ to match dbxread.c change of 16 Mar 90.
+
+ * valarith.c (value_x_unop): Pass &static_memfuncp,
+ not static_memfuncp.
+
+ * breakpoint.c: Add watchpoint stuff.
+ breakpoint.h: Add bpstat_should_step.
+ infrun.c (proceed, wait_for_inferior): Use it.
+ breakpoint.h: Add bpstat_print (and rename old bpstat_print
+ to bpstat_should_print).
+ infrun.c (normal_stop): Use it.
+
+ * value.h: Add value_free. Declare a few functions.
+
+Sat Apr 7 21:43:43 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Remove PROFILE_TYPES code and
+ insert comment suggesting easy shell script equivalents.
+
+ * values.c (unpack_long): Give better error messages for
+ unrecognized sizes of ints and floats.
+
+Fri Apr 6 00:32:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c, gdbcore.h (IS_OBJECT_FILE): Check for a_drsize
+ nonzero as well as a_trsize.
+
+ * More places: Use SWAP_TARGET_AND_HOST.
+
+ * valops.c (destructor_name_p): Only skip "struct " if present.
+
+ * main.c (gdb_readline): Return NULL on end of file.
+
+ * sparc-opcode.h: Add jmp 1+2, jmp 1+i, jmp i+1.
+
+ * Makefile.dist: Make expread.tab.c unambiguously be in srcdir.
+
+ * main.c: Split source_command into source_command and
+ read_command_file.
+ (main): Accept "-" as arg to +command for stdin.
+
+ * dbxread.c (psymtab_to_symtab): Don't read string table.
+ (symbol_file_command): Save string table size.
+
+ * Version 3.90.5
+
+ * symtab.c: Remove declaration of lookup_misc_func.
+
+ * mips-pinsn.c: Add use_hex_p stuff (re-worked from Forin stuff).
+
+ * mips-opcode.h: Add bdelay field.
+ mips-pinsn.c: Various changes from Forin, I think to make it look
+ like the MIPS assembler format.
+ mips-tdep.c, mips-xdep.c, mipsread.c: Various changes from Forin.
+
+ * gdbcore.h: Declare register_addr.
+
+ * gdbcore.h: Include <a.out.h>, before trying to redefine N_TXTADDR
+ and friends.
+ various: Don't include both a.out.h and gdbcore.h.
+
+ * Makefile.dist (HFILES): Add param.h
+
+ * utils.c (init_malloc): Moved here from mcheck.c and modified
+ to use the standard mcheck.c
+ Makefile.dist: Modify to reflect new mcheck.
+
+Thu Apr 5 16:38:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * valprint.c (val_print, print_hex_chars): Print integers
+ larger than LONGEST.
+
+ * valarith.c (value_sub): Give error message if attempt to
+ subtract something of the wrong type from a pointer.
+
+ * breakpoint.c (bpstat_stop_status): Initialize retval to NULL.
+
+ * i386-tdep.c (i386_pop_frame): Change addr to adr.
+
+Wed Apr 4 05:21:50 1990 Jim Kingdon (kingdon at teenage-mutant)
+
+ * main.c (command_line_input): return NULL on end of file.
+ (execute_command): If p is NULL, return almost right away.
+ (read_command_lines): Treat end of file like "end".
+
+ * printcmd.c (print_frame_args): Change it so num is number
+ of ints of args, not number of args.
+
+ * xm-*.h: Make sure BYTE_ORDER is defined.
+ Also fix various #includes of old names of things.
+
+ * main.c (command_line_input): Fix comment code of 2 Apr.
+
+ * values.c (value_from_long, unpack_long): SWAP_TARGET_AND_HOST.
+ various: Replace {BYTES,WORDS}_BIG_ENDIAN with TARGET_BYTE_ORDER.
+ valarith.c various: SWAP_TARGET_AND_HOST.
+ dbxread.c (READ_FILE_HEADERS): SWAP_TARGET_AND_HOST.
+ (SWAP_SYMBOL): New macro. Use it wherever symbuf_idx is incremented.
+ exec.c (exec_file_command): SWAP_TARGET_AND_HOST.
+
+ * valarith.c (value_subscripted_rvalue): Just bcopy() the
+ appropriate bytes rather than playing strange games with
+ value_from_long.
+
+ * param.h (SWAP_TARGET_AND_HOST): New macro.
+
+ * tm-np1.h (V7_REGNUM): Change from 27 to 26.
+ (REGISTER_VIRTUAL_TYPE): Return correct result for vector regs.
+ gould-tdep.c: New file.
+
+ * Move reading of register before store from
+ findvar.c (write_register) to
+ infptrace.c, *-xdep.c (store_inferior_register).
+
+ * findvar.c (fetch_registers, store_registers): New functions.
+ write_register{,_bytes}: Use store_registers regardless of
+ have_inferior_p.
+ registers_valid: New variable.
+ (supply_register, read_register, etc.): Use it.
+ (read_register_gen): New variable.
+ various: Use read_register_gen rather than read_register_bytes
+ where appropriate.
+ *-xdep.c (fetch_inferior_registers): Remove remote_debugging check.
+ infrun.c (wait_for_inferior, start_inferior): Call registers_changed
+ not fetch_inferior_registers.
+ *-xdep.c (fetch_inferior_registers): Call registers_fetched if
+ not setting registers via supply_register, and if fetching
+ all registers.
+ infptrace.c, *-xdep.c (fetch_inferior_registers): Add param,
+ # of register to fetch (-1 for all).
+ infptrace.c, hp300hpux-xdep.c (fetch_inferior_registers):
+ Actually fetch only those registers needed.
+ value.h: Declare all the extern register functions from findvar.c.
+
+ * coffread.c (read_coff_symtab): Test for specific kinds of GCC
+ labels (LI%.*, LPB%.*, etc), not just ??%.*.
+
+ * coffread.c (record_misc_function): Use mf_text not mf_unknown.
+
+ * utils.c,defs.h (lines_to_list): New function.
+ source.c (select_source_symtab, list_command, forward_search_command,
+ reverse_search_command), stack.c (print_frame_info):
+ Use it instead of 10.
+
+ * munch: If MUNCH_NM variable exists, use it.
+
+ * main.c (initialize_main): Set rl_readline_name.
+ main.c: #include readline.h and #undef savestring.
+ Remove declarations of things declared in readline.h.
+
+ * main.c (gdb_readline): If instream == 0, read from stdin.
+
+ * main.c (main): Only call clearerr if ISATTY. Exit loop if
+ feof (instream).
+
+ * infcmd.c (detach_command): Set inferior_pid to 0 after
+ calling remote_close.
+
+ * main.c (main): If exec and sym files are the same, and there
+ is an error reading execfile, don't try to read sym file.
+
+ * infcmd.c (detach_command) [ATTACH_DETACH]: Don't try to detach
+ from inferior when remote debugging.
+
+ * source.c (reverse_search_command): Change while test from 1 to
+ line > 1.
+
+Tue Apr 3 18:14:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.4.
+
+ * Makefile.dist (gdb.tar.Z): Use -z option to tar rather than
+ creating gdb.tar and calling compress separately.
+
+ * breakpoint.c (read_memory_nobpt): Do not treat bcopy as if it
+ returned an "errno" value.
+
+ * various: Make sure gdbcore.h is not included before a.out.h.
+
+ * Makefile.dist (OPCODES): Add mips-opcode.h.
+
+ * config.gdb: Print lists of {hosts,targets} after finding srcdir.
+ When parsing +{host,target}=, strip off +{host,target}=, not +{x,t}m=.
+
+ * Makefile.dist (gdb.tar): Do {t,x}config not just config.
+
+Mon Apr 2 02:42:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * sparc-opcode.h (inc): Fix incorrect lose field.
+
+ * valarith.c (value_subscripted_rvalue): Use TARGET_BYTE_ORDER,
+ rather than checking endianness at runtime.
+
+ * main.c (comand_line_input): Accept comments anywhere, not
+ just at starts of lines.
+
+Sat Mar 31 21:59:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symtab.c (check_stub_type): Call lookup_symbol with 5 args.
+
+Fri Mar 30 15:23:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * frame.h: #include param.h.
+ param.h: Protect against multiple inclusion.
+
+ * i386-tdep.c (i386_get_frame_setup): Fix comment about what
+ opcode 0x55 is.
+ If 0x81 or 0x83 is followed by something besides 0xec,
+ put codestream back where it was and return 0.
+ [USE_MACHINE_REG_H]: Include <machine/reg.h> not <sys/reg.h>
+ Move include of a.out.h above <sys/user.h>.
+ (i386_frame_find_saved_regs): Make locals signed.
+ (i386_frame_find_saved_regs, i386_push_dummy_frame, i386_pop_frame):
+ Use REGISTER_BYTES, REGISTER_RAW_SIZE, etc. to deal with floating
+ point registers.
+
+Wed Mar 28 18:33:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * Makefile.dist (OTHERS): Add gdb.dvi.
+ (gdb.dvi): New rule.
+
+ * breakpoint.c (_initialize_breakpoint): Clean up docstrings so
+ as not to mention subcommands (e.g. auto-display).
+ Call add_cmd not add_abbrev_cmd for "disable breakpoint" and
+ put it in class_alias.
+
+ * breakpoint.c (set_breakpoint_count): New function.
+ (set_breakpoint, break_command_1): Use it.
+
+ * breakpoint.c (get_number): New function.
+ (*_command, map_breakpoint_numbers): Use it.
+
+ * infptrace.c (write_inferior_memory): Remove remote_debugging
+ stuff (is handled in core.c).
+ (read_inferior_memory): Remove #if 0'd out remote_debugging code.
+
+Tue Mar 27 16:51:27 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * inferior.h: Include frame.h.
+
+ * findvar.c (write_register): Replace sun4 #ifdef with
+ check of CANNOT_STORE_REGISTER.
+ xm-sparc.h: Define CANNOT_STORE_REGISTER.
+
+ * sparc-tdep.c: Remove superfluous declaration of
+ get_breakpoint_commands.
+
+ * breakpoint.{c,h}: Add bpstat stuff.
+ bpstat_do_action: Re-work do_breakpoint_commands into this.
+ main.c (command_loop): Call bpstat_do_action not
+ do_breakpoint_commands.
+ inferior.h, infrun.c, breakpoint.c, infcmd.c:
+ Rework breakpoint_commands and stop_breakpoint
+ stuff to use bpstat instead.
+
+ * infcmd.c (program_info): "info reg"->"info registers".
+
+ * np1-opcode.h: Renamed from npl-opcode.h.
+ gould-pinsn.c: Include np1-opcode.h.
+ Makefile.dist (OPCODES): Change npl-opcode.h to np1-opcode.h
+
+ * coffread.c (read_enum_type): Stop reading when we hit .eos.
+
+Mon Mar 26 15:52:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Version 3.90.3.
+
+ * breakpoint.c (read_memory_nobpt): New function.
+ gdbcore.h: Declare read_memory_{nobpt,check}.
+ mips-tdep.c: Use read_memory_nobpt not breakpoint_shadow_val.
+
+Fri Mar 23 14:26:38 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * inflow.c (terminal_inferior): Reenable commented out
+ inferior_thisrun_terminal check.
+ (terminal_ours_1): If inferior_thisrun_terminal is nonzero,
+ return immediately.
+
+ * Makefile.dist: Rewrite DEPFILES, M_FILE, etc. stuff to deal
+ with host & target separation.
+
+ * config/*: Split into xconfig/* and tconfig/*.
+ *-dep.c: Split into *-xdep.c and *-tdep.c.
+
+ * main.c (main): Always pass two args to xrealloc.
+
+Thu Mar 22 20:29:25 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * Makefile.dist ({,dist}clean): rm {x,t}m.h not param.h
+ xgdb.o: Remove obsolete dependency (now in depend).
+
+ * arm-pinsn.c: Include arm-opcode.h not opcode.h.
+
+ * mips-pinsn.c, mips-opcode.h: New files from Bothner (from
+ release of 24 Jan 90 with mips-opcode.h patch from 1 Feb 90).
+
+ * utils.c (xmalloc): Return NULL on request for 0 bytes.
+
+Wed Mar 21 13:30:08 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * config.gdb: Re-write machine stuff to deal with host & target.
+
+ * xm-altos.h: Don't define HAVE_WAIT_STRUCT.
+
+ * m-*.h: Split into xm-*.h and tm-*.h.
+
+ * infrun.c (wait_for_inferior): Put #ifdef sony_news code
+ in regardless of machine.
+
+ * symtab.c (decode_line_1): Add quotes and capitalize error
+ message "no class, struct, or union named".
+
+ * Makefile.dist (cplus-dem.o): Compile with -Dnounderscore.
+
+ * stack.c (print_frame_info): Use print_symbol to print function name.
+
+ * symtab.c (output_source_filename): Don't print a comma if
+ we are skipping a filename already printed.
+
+Tue Mar 20 10:48:54 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * symtab.c (output_source_filename): Don't print a filename
+ more than once.
+
+ * utils.c (fprint_symbol): New function.
+ defs.h: Decalare it.
+ various: Use fprint_symbol to print symbol names.
+ Makefile.dist (SFILES, OBS): Add cplus-dem.{c,o}.
+
+Mon Mar 19 17:11:03 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * coffread.c (read_file_hdr): Add MC68K??MAGIC.
+
+ * coffread.c (read_coff_symtab): Ignore swbeg and string label
+ symbols.
+
+ * coffread.c (read_coff_symtab): Increment num_object_files
+ in case C_STAT not C_FILE.
+ New variable in_source_file. Set it in case C_FILE.
+ Check it in case C_STAT.
+
+ * coffread.c [FUNCTION_EPILOGUE_SIZE]: New code.
+ m-umax.h (FUNCTION_EPILOGUE_SIZE): Define.
+
+ * config/3b1: New file.
+
+ * config/sun*: Print message warning people to use GAS with GCC.
+
+Sun Mar 18 02:56:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * infcmd.c (run_stack_dummy): Change error message.
+
+ * m-68k.h (REGISTER_VIRTUAL_TYPE): Make pc, fp, sp char *.
+
+ * m-mips.h (LONGEST, BUILTIN_TYPE_LONGEST): Remove.
+
+Sat Mar 17 21:27:49 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * mips-dep.c: Remove infptrace.c stuff.
+
+ * m-bigmips.h: New file.
+ m-mips.h [MIPSEB]: Remove *_BIG_ENDIAN stuff.
+
+ * m-sparc.h (FIX_CALL_DUMMY): Do not insert unimp instruction
+ if function was compiled with gcc.
+
+ * m-mips.h: Remove FIX_CALL_DUMMY_ALIGNED and make FIX_CALL_DUMMY
+ use new args.
+
+ * valops.c (call_function): New args to FIX_CALL_DUMMY.
+ m-*.h (FIX_CALL_DUMMY): Take new args.
+
+ * values.c (using_struct_return): New parameter gcc_p.
+ valops.c (call_function): New variable using_gcc.
+ valops.c (call_function) [REG_STRUCT_HAS_ADDR]: New code.
+
+ * m-mips.h, mips-dep.c: New files from Forin.
+ m-mips.h: Replace RETURN_STRUCT_BY_REF with USE_STRUCT_CONVENTION.
+
+Fri Mar 16 13:17:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist: Add some dependencies of m-*.h files.
+ (HFILES): Add m-68k.h.
+
+ * dbxread.c (read_struct_type): Put "operator+" not "operator +"
+ in symtab.
+
+ * core.c: Split read_memory into read_memory_check and read_memory.
+ breakpoint.c (insert_breakpoints): If can't read memory,
+ tell user that error was due to seting breakpoints.
+
+Thu Mar 15 11:47:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * infrun.c [COFF_ENCAPSULATE]: Include a.out.encap.h.
+
+ * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): Make it a function.
+ various m-*.h: Call function not macro.
+ frame.h: Declare the function.
+
+Wed Mar 14 02:44:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * sparc-dep.c: Include signame.h.
+
+ * sparc-pinsn.c (print_insn): When looking for sethi before
+ delayed branch, call read_memory_noerr not read_memory.
+
+ * m-isi.h, m-sun3.h, m-news.h, m-hp300bsd.h, m-altos.h,
+ m-hp300hpux.h, m-sun2.h: Merge machine stuff except inferior
+ function call stuff into new file m-68k.h. Create m-3b1.h.
+
+Tue Mar 13 21:34:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * inflow.c (new_tty): If can't open tty, print error message
+ before exiting.
+
+ * blockframe.c: Remove declaration of psymtab_to_symtab.
+ symtab.h: Declare psymtab_to_symtab.
+ blockframe.c: Remove declarations of block_for_pc and
+ find_pc_function_start.
+ frame.h: Add declarations of block_for_pc and find_pc_function_start.
+ Remove declaration of nonexistent function find_pc_function.
+ values.c: include frame.h instead of declaring block_for_pc.
+
+ * Version 3.90.2.
+
+Mon Mar 12 14:20:06 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * main.c (main): Delete superfluous "e" from long_options.
+
+Sat Mar 10 15:47:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * valprint.c (val_print): Print <%d bit integer> not just
+ <large integer>.
+
+ * dbxread.c (error_type): Fix loop that finds '\0' so that on
+ exit, *pp points to the '\0', not the character after.
+ (read_type): Make sure that places which call read_type and then
+ try to read more input stop immediately with another error
+ upon encountering '\0'.
+
+ * dbxread.c (read_range_type): Fix check for large signed
+ integral type to match comment and reality. Set TYPE_LENGTH based
+ on n2bits for signed, n3bits for unsigned.
+
+ * infcmd.c (cont_command): Print warning message if we
+ decide to ignore the argument.
+
+ * gdb.texinfo (attach): @xref{Attach} -> @xref{Remote}.
+
+Fri Mar 9 16:26:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symtab.h (address_class): Reinstate LOC_EXTERNAL with rewritten
+ comment.
+
+ * expread.y (yyerror, parse_c_1): Make yyerror take a char * arg.
+
+ * main.c (symbol_completion_function): Don't call error() on
+ "info jkldskf".
+
+ * m-npl.h (USE_STRUCT_CONVENTION): Change >= to >.
+
+Thu Mar 8 00:19:01 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symseg.h: Nuke more symseg references including LOC_EXTERNAL.
+ Put contents of symseg.h into symtab.h and remove symseg.h.
+
+Wed Mar 7 18:02:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symtab.h (SYMBOL_LINE): New macro.
+ symtab.c (decode_line_1): Accept variable as well as function.
+ Lookup variable/function in selected block if no file specified.
+ printcmd.c: #if 0 out whereis_command.
+
+ * command.c (do_setshow_command): Call function with additional
+ argument C.
+ main.c (set_history_size_command): Take argument C.
+ (set_verbose): New function to set docstring.
+ (initialize_main): Put set_verbose in command list.
+ command.c (lookup_cmd_1): Accept result_list NULL.
+
+ * valprint.c (_initialize_valprint): Change docstring for
+ "set unionprint" to normal set/show form.
+
+ * command.c (add_show_from_set): Check that docstring starts with
+ "Set " before assuming it does.
+
+ * main.c (show_history): Call cmd_show_list.
+ command.{c,h} (cmd_show_list): New function.
+ command.h: Declare do_setshow_command.
+
+ * command.h (cmd_list_element): New field completer.
+ main.c (symbol_completion_function): Use it.
+ symtab.h: Declare make_symbol_completion_list.
+ command.c (add_cmd): Set completer.
+ main.c, gdbcmd.h (noop_completer): New function.
+ infcmd.c: Set completer for environment functions.
+
+ * symtab.c (types_info, _initialize_symtab): #if 0 out.
+ various: Use fputs_filtered, not fprintf_filtered(%s).
+
+ * valprint.c (type_print_base): Check for integers larger than
+ LONGEST.
+
+ * sun3-dep.c: Include "signame.h" instead of directly declaring
+ sys_siglist.
+
+Tue Mar 6 14:59:34 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * infrun.c (signals_info): Allow argument to be a signal name
+ as well as an expression.
+ (handle_command): Check for error from sig_number.
+
+ * main.c (float_handler): Change error message.
+
+ * inflow.c (create_inferior): If getenv ("SHELL") exists, use it
+ instead of /bin/sh.
+
+ * dbxread.c (read_dbx_symtab, case N_SO): New variable first_symnum.
+ Pass it to {start,end}_psymtab.
+
+ * dbxread.c (read_ofile_symtab): Increment symbuf_idx and symnum
+ when calling process_symbol_pair.
+
+ * symtab.c (sources_info, output_source_filename):
+ Re-write so output_source_filename takes a first parameter
+ instead of a next one.
+
+ * dbxread.c (read_dbx_symtab, case N_SO): When incrementing
+ symbuf_idx, increment symnum also.
+
+ * values.c (set_internalvar_component): Use VALUE_CONTENTS,
+ not VALUE_CONTENTS_RAW.
+
+ * symmisc.c (free_symtab): Don't free filename (now in symbol_obstack).
+
+ * environ.c (init_environ): Copy entire string, including
+ terminating '\0'.
+
+ * value.h, values.c: Rename value_lazy to value_fetch_lazy.
+ values.c (value_of_internalvar): Call value_fetch_lazy.
+
+ * dbxread.c (read_huge_number): Return an error on encountering
+ a large decimal number.
+
+ * dbxread.c (read_huge_number): Reverse sense of overflow test.
+
+ * valprint.c (val_print, case TYPE_CODE_INT): Check for integers
+ larger than LONGEST.
+
+ * dbxread.c (read_ofile_symtab): When calling process_one_symbol,
+ call it with desc and value rather than with bufp->n_{desc,value}.
+
+ * defs.h (LONG_MAX): Define.
+
+ * sun3-dep.c: Declare sys_siglist.
+
+ * infptrace.c: Move include of gdbcore.h after a.out.h
+
+ * Makefile.dist (expread.o, mcheck.o): Remove leading "./" not
+ leading ".".
+
+ * m-hp300hpux.h [!HPUX_VERSION_5]: Define KERNEL_U_ADDR_HPUX.
+ infptrace.c [KERNEL_U_ADDR_HPUX] [KERNEL_U_ADDR_BSD]:
+ Set kernel_u_addr using nlist().
+ m-hp300bsd.h: Define KERNEL_U_ADDR_BSD.
+
+Mon Mar 5 16:52:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): If value of .o symbol is crazy,
+ don't end psymtab.
+
+ * dbxread.c (read_dbx_symtab): Ignore first of a pair of N_SO
+ when both appear.
+ (start_subfile, start_symtab): Extra parameter dirname.
+ (start_subfile): Use obsavestring, not savestring, for name.
+ various: Call start_{subfile,symtab} with extra argument.
+ (end_symtab): Set dirname field in symtab.
+ (read_ofile_symtab): Call process_symbol_pair on pair of N_SO.
+ (process_symbol_pair): New function.
+ symtab.h (symtab): New field dirname.
+ source.c (open_source_file): New function.
+ source.c: Use open_source_file instead of openp where appropriate.
+
+ * defs.h (TARGET_CHAR_BIT): Define.
+
+Sun Mar 4 13:11:48 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (fill_symbuf): Print error messages nicely.
+
+ * Makefile.dist (SFILES): Put standalone.c at end.
+
+ * Makefile.dist (alldeps.mak): Put out backslash after arm-convert.s.
+
+ * symtab.{c,h} (builtin_type_error): New type.
+ symseg.h (type_code): Add TYPE_CODE_ERROR.
+ valprint.c (val_print, type_print_base),
+ values.c (using_struct_return, set_return_value):
+ Check for and deal with TYPE_CODE_ERROR.
+ dbxread.c (error_type): New function
+ (read_type and subroutines): Call error_type instead of error.
+
+ * dbxread.c (read_huge_number): New function.
+ (read_range_type): Use read_huge_number and check results
+ to see if it is a large integral type.
+
+ * symmisc.c: Remove symseg stuff.
+
+ * Gould NP1 changes from (or inspired by) chpmjd@gdr.bath.ac.uk
+ dbxread.c (read_dbx_symtab) [N_NBSTS]:
+ Treat this and N_NBLCS like N_LCSYM, etc.
+ (process_one_symbol) [BLOCK_ADDRESS_ABSOLUTE]: New code.
+ m-npl.h (USE_STRUCT_CONVENTION): Add.
+ (IGNORE_SYMBOL): Add 0xa4.
+ (END_OF_TEXT_DEFAULT): Remove.
+ (STRING_TABLE_OFFSET): don't add sizeof(int).
+ [!HAVE_VPRINTF]: Define vprintf to be doprnt, not printf.
+ (BLOCK_ADDRESS_ABSOLUTE): Define.
+ (BREAKPOINT): Pad to size of machine word.
+ (SAVED_PC_AFTER_CALL): Remove ` at start of line (!).
+ (R2_REGNUM): Define.
+ (SP_REGNUM, FP_REGNUM): Switch definitions.
+ (REGISTER_U_ADDR): Use FP_REGNUM in place of SP_REGNUM.
+ (STORE_STRUCT_RETURN, EXTACT_RETURN_VALUE, STORE_RETURN_VALUE,
+ call function stuff):
+ Replace bogus definitions with correct ones for NP1.
+ (CANNOT_EXECUTE_STACK): Define.
+ (FRAME_LOCALS_ADDRESS): Don't add 80.
+ (FRAME_FIND_SAVED_REGS): Also get SP.
+ gould-pinsn.c (findframe): Move framechain declaration outside #if 0.
+ infptrace.c (write_inferior_memory): Check addr against text_end
+ and use PT_WRITE_I or PT_WRITE_D as appropriate.
+ (store_inferior_registers): Don't try to write registers in
+ CANNOT_STORE_REGISTER.
+ m-npl.h (CANNOT_STORE_REGISTER): Define.
+ npl-opcode.h (lil): 0xf8080000 -> 0xf80b0000.
+
+ * munch: Distinguish between BSD and System V nm by actually
+ seeing what output from nm looks like.
+
+Fri Mar 2 13:43:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Change highest_offset to point
+ to next unprinted arg.
+
+ * main.c (main): Print "type help for list of commands" along
+ with the version. Follow it with a blank line.
+
+Thu Mar 1 14:49:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * valprint.c: Move print_address for function from value_print
+ to val_print.
+
+Wed Feb 28 15:06:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist (m-sun4os4.h): Depend on m-sparc.h
+
+ * Makefile.dist (version.c): Depend on Makefile.dist, not Makefile.
+
+ * Makefile.dist: Change MAKEFILES to Makefiles.
+
+ * symtab.h: Declare get_sym_file.
+ core.c: Include symtab.h.
+
+ * Move signal name stuff from utils.c to signame.c
+ Move signal name stuff from defs.h to signame.h.
+ Makefile.dist (SFILES, HFILES, OBS): Add signame.{c,h,o}.
+
+Mon Feb 26 12:03:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * command.c (add_cmd): Don't call savestring on name.
+
+Sun Feb 25 15:52:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Make highest_offset an int.
+ New variable args_printed.
+ (print_frame_nameless_args): Remove parameter end and add num
+ and first.
+ (print_frame_args): Change call to print_frame_nameless_args.
+
+Fri Feb 23 21:40:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * stack.c (up_command, down_command):
+ Only print stack frame if from_tty.
+
+Thu Feb 22 12:01:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * expread.y: Inlcude value.h and don't cast return value from
+ lookup_internalvar.
+
+ * infrun.c: Remove code in #ifdef UMAX_PTRACE.
+
+ * values.c (convenience_info): Print in form "$foo = 5".
+ Don't print "Debugger convenience variables:" before first one.
+
+ * Makefile.dist: Remove ADD_FILES from CLIBS.
+ (gdb, kdb, xgdb): Put in ADD_FILES as well as CLIBS.
+
+ * m-pyr.h: #if 0 out call dummy stuff.
+ Put in POP_FRAME which just calls error().
+ valops.c: If CALL_DUMMY is not defined, put in dummy call_function
+ which just prints an error message.
+
+Tue Feb 20 22:11:40 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * breakpoint.c (commands_command): Add arg from_tty.
+
+ * main.c (main): Put if (!setjmp (to_top_level)) around calls
+ to *_command made in response to command line arguments.
+
+Mon Feb 19 13:58:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * main.c (main): Use getopt_long_only. Move one-character options
+ to long_options. Remove entries which are just unambiguous
+ abbreviations of other options.
+
+ * command.h: Add types cmd_types and var_types.
+ Add fields type, var_type, and var to struct cmd_list_element.
+ command.c (add_set_cmd, add_set_from_show): New functions.
+ (add_cmd): Set c->var_type.
+ (add_abbrev_cmd): Call add_cmd instead of duplicating code.
+ main.c: Add showlist.
+ Move parse_binary_operation from main.c to command.c.
+ command.c (do_setshow_command): New function.
+ gdbcmd.h: New file.
+ Makefile.dist: Add gdbcmd.h.
+ many files: Include gdbcmd.h, use add_set_cmd and add_show_from_set.
+ Replace info * with show * where appropriate.
+ utils.c (fputs_filtered): Use UINT_MAX in lines_per_page to mean
+ no paging.
+ defs.h: Define UINT_MAX.
+ infcmd.c (run_command): Use execute_command, not set_args_command.
+ main.c (execute_command): Call do_setshow_command if necessary.
+ main.c (show_command, show_history): New functions.
+ main.c (initialize_main): Call add_prefix_cmd
+ for show and show history.
+
+ * coffread.c (enter_linenos): Print error if
+ file_offset < linetab_offset.
+
+Sun Feb 18 15:37:05 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * convex-dep.c (comm_registers_info): Fix typo. ("argc"->"arg").
+
+Wed Feb 14 20:45:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * config.gdb: Create Makefile with make.
+
+ * Makefile.dist, config.gdb: Move "srcdir=" line from Makefile.dist
+ to new file Makefile.srcdir.
+
+ * valprint.c: Include <errno.h>.
+
+ * value.h: Declare value_coerce_function.
+
+ * findvar.c: Add missing " after #include "gdbcore.h
+
+ * main.c (main): Re-write command parsing to use getopt.
+ On "gdb +help" print options with '+' not '-'.
+ Makefile.dist: Add getopt.
+
+Tue Feb 13 00:08:27 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist: Add "srcdir=."
+ config.gdb: Edit srcdir= rather than adding it to the beginning.
+
+ * pyr-dep.c: Make global_reg_offset, last_frame_offset not static.
+ Move definition of reg_stack_offset to core.c [REG_STACK_SEGMENT].
+
+ * config/pyramid: Print message about alloca.
+
+ * breakpoint.c (clear_command): When printing "no breakpoint"
+ error, only use arg if non-NULL.
+
+ * core.c (read_memory): Rename to read_memory_noerr.
+ (read_memory): New function which calls read_memory and checks for err.
+ gdbcore.h: Declare all extern core.c functions.
+ move myread from core.c to utils.c.
+ declare it in defs.h.
+ (read_memory_integer): move from infcmd.c to core.c.
+ gdbcore.h: Declare it.
+ Many places: Remove error checking on read_memory, or call
+ read_memory_noerr instead. Include "gdbcore.h" if calling either.
+
+ * value.h (COERCE_ARRAY): Coerce functions to function pointers.
+ valops.c (value_coerce_function): New function.
+
+ * core.c, convex-dep.c, arm-dep.c (xfer_core_file): Return EIO
+ if address out of bounds.
+
+ * m-arm.h, arm-dep.c arm-pinsn.c arm-opcode.h: New files.
+ dbxread.c, m-convex.h (VARIABLES_INSIDE_BLOCK): Add gcc_p parameter.
+ Makefile.dist (alldeps.mak): Special case for arm-convert.s.
+ dbxread.c (define_symbol): Check for local based on it not
+ being any one of the known deftypes.
+ values.c (using_struct_return): Use new macro USE_STRUCT_CONVENTION.
+
+ * Makefile.dist, config.gdb: Put in srcdir stuff.
+
+Mon Feb 12 22:46:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * breakpoint.c: Add addr_string and cond_string fields to
+ struct breakpoint.
+ (break_command_1): Set them. Use mention ().
+ (mention): Create with code from break_command_1.
+ (breakpoint_re_set): New function.
+ (breakpoint_clear): Remove.
+ (condition_command): Set cond_string.
+ (breakpoint_delete): Free cond_string and addr_string.
+ Declare parse_c_1's type and remove casts to struct expression *.
+ symmisc.c (free_all_symtabs): Don't call breakpoint_clear.
+ dbxread.c, coffread.c (reread_symbols): Call breakpoint_re_set,
+ Include breakpoint.h.
+ breakpoint.h: New file.
+ dbxread.c: Move declaration of symmisc.c functions to symtab.h.
+
+Sun Feb 11 17:29:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symtab.c: Make lookup_block_symtab extern.
+ symtab.h: Declare it.
+ valops.c (value_of_this): Use it.
+
+Fri Feb 9 08:59:37 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * config/hp300hpux: Print message telling people to use gcc.
+
+ * value.h: Declare print_floating.
+ printcmd.c (print_scalar_formatted, case 'f'): Use print_floating.
+ valprint.c (val_print, case TYPE_CODE_FLT): Use print_floating.
+ valprint.c (print_floating): Make this function out of is_nan
+ and the code which was in val_print.
+ Put parentheses around high & 0xfffff.
+ Print sign and fraction for NaN's.
+ Print 17 digits not 16 for doubles.
+ (is_nan): Remove.
+ m-news.h, m-sun3.h: Define IEEE_FLOAT.
+
+ * Rename gld-pinsn.c to gould-pinsn.c.
+ config/{pn,npl}: Change name of gld-pinsn.c
+
+Tue Feb 6 00:25:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * infptrace.c: Define PT_ATTACH if not defined.
+ m-hp300hpux.h: Define ATTACH_DETACH.
+
+ * main.c (initialize_main): Change alias class to aliases.
+
+ * dbxread.c: Search and destroy references to symsegs.
+ Also remove some #if 0'd code.
+
+ * core.c: Remove reread_exec.
+ dbxread.c (reread_symbols): New function.
+ dbxread.c (symbol_file_command): Set symfile_mtime.
+ coffread.c: Same.
+ infcmd.c (run_command): Call reread_symbols not reread_exec.
+
+ * valprint.c (val_print): When printing string after char *, print
+ it for "" just like any other string.
+
+ * core.c (reread_exec): New procedure.
+ infcmd.c (run_command): Call reread_exec.
+
+ * coffread.c (symbol_file_command): Add from_tty.
+
+ * dbxread.c (symbol_file_command): Only ask about loading new
+ symbol table if from_tty.
+
+Mon Feb 5 02:25:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * inflow.c (inferior_died): Call breakpoint_clear_ignore_counts.
+
+ * Makefile.dist (OBS): Remove dbxread.o and coffread.o.
+
+ * config.gdb: Ignore files ending in '#' in config.
+
+ * stack.c (backtrace_command): Add QUIT to get_prev_frame loops.
+
+Sat Feb 3 22:25:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile.dist (YACC): Don't use -v.
+
+Fri Feb 2 19:26:50 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * createtags: Only change .o to .c at end of name.
+
+ * Makefile.dist (alldeps.mak): new target.
+ (Makefile): add alldeps.mak.
+ (SOURCES): remove PINSNS.
+ (TAGFILES: use ALLPARAM.
+ (gdb.tar): add config/.
+
+ * config.gdb: Check for M_FILE= not #param.h
+ config/*: Make sure M_FILE= exists with space after M_FILE=.
+ Makefile.dist (TAGS): Pass M_FILE and DEPFILES.
+ createtags: Change .o to .c. Remove special tests for dep.c etc.
+
+ * dbxread.c, coffread.c: Don't check COFF_FORMAT and READ_DBX_FORMAT.
+ Makefile.dist: Move {dbx,coff}read.c from SFILES to ALLDEPFILES.
+ config/*: add dbxread.o or coffread.o to depfiles.
+
+ * Makefile.dist (depend): Depend on $(SOURCES), not force.
+
+Thu Feb 1 17:43:54 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * symmisc.c (print_symbol): Print newline after label.
+
+Wed Jan 31 22:35:38 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (read_addl_syms): Remove code that checks for
+ _etext.
+ Move end_of_text_addr into read_dbx_symtab.
+ (read_dbx_symtab): #if 0 out code which checks for _etext.
+
+Tue Jan 30 15:40:19 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
+
+ * Makefile.dist (gdb.tar): Use readline's "make readline.tar"
+ instead of having a list of readline files.
+
+ * infrun.c (normal_stop): #if 0 out "you have found a bug in sh".
+
+ * munch (-DSYSV): Check for .text at end of name.
+ Optionally allow extra underscore before initialize.
+ Remove space between #! and /bin/sh.
+
+ * m-merlin.h: Put in clarifying comments about SHELL_FILE.
+ Makefile.dist (install): Execute M_INSTALL.
+ config/merlin: Define M_INSTALL.
+
+Mon Jan 29 04:32:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * inflow.c: Change all references to signal handlers from
+ int (*)() to void (*)().
+
+ * main.c: Declare init_signals before use & make it void.
+ Declare initialize_all_files.
+
+ * Makefile.dist (config.status): New target.
+
+Sat Jan 27 00:19:50 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * defs.h (enum command_class): Remove comma after last element.
+
+ * Makefile.dist (gdb.tar.Z): Use compress <foo >bar rather
+ than deleting gdb.tar.Z before starting.
+
+ * dbxread.c (process_one_symbol): Compare context_stack_depth
+ with !VARIABLES_INSIDE_BLOCK, not VARIABLES_INSIDE_BLOCK.
+
+ * mcheck.c: Put whole file in #if defined MALLOC_RANGE_CHECK.
+
+ * mcheck.c (checkhdr): Call fatal_dump_core not abort.
+
+ * mcheck.c: Copy from malloc distribution.
+
+ * main.c (main): Call init_malloc ().
+
+ * main.c (initialize_signals): Rename to init_signals.
+
+Fri Jan 26 00:53:23 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * *dep.c: Make core_file_command return void.
+
+ * gdbcore.h [!KERNEL_U_ADDR]: Declare kernel_u_addr.
+ infptrace.c [!KERNEL_U_ADDR]: Make it extern.
+
+ * altos-dep.c (NBPG, UPAGES): Wrap #define in #if !defined.
+
+ * m-pn.h (GOULD_PN): Define.
+ *-pinsn.c: Include actual opcode table not just opcode.h
+
+ * main.c [ALIGN_STACK_ON_STARTUP]: New code.
+ m-i386.h: Define ALIGN_STACK_ON_STARTUP.
+
+ * m-merlin.h (NO_SIGINTERRUPT, SHELL_FILE): Define.
+
+ * Move code from infptrace [USE_PTRACE_GETREGS] to sun3-dep.c.
+ m-sun{2,3}.h, m-sparc.h: Define FETCH_INFERIOR_REGISTERS.
+
+ * Makefile.dist, config.gdb, config/*:
+ Re-write to use machine-dependent makefiles instead of cpp.
+
+ * m-hp300hpux.h: Define FETCH_INFERIOR_REGISTERS.
+ infptrace.c: Put {fetch,store}_inferior_registers inside
+ #if !defined FETCH_INFERIOR_REGISTERS.
+
+ * Split execcore.c into exec.c and coredep.c.
+ Move a bunch of stuff from coredep.c and *dep.c to gdbcore.h.
+
+ * infptrace.c ({fetch,store}_inferior_registers):
+ Use U_REGS_OFFSET to set offset.
+ m-umax.h: Define U_REGS_OFFSET.
+
+ * m-umax.h: Define PTRACE_{ATTACH,DETACH}.
+
+ * m-i386.h (N_SET_MAGIC): Define.
+ m-i386gas.h: add #undef N_SET_MAGIC.
+
+Thu Jan 25 18:39:45 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * m-hp300bsd.h: Remove KERNEL_U_ADDR.
+
+ * infptrace.c [!KERNEL_U_ADDR]: Get address of kernel u area
+ at runtime.
+
+ * infptrace.c: Replace numbers with PT_KILL, etc.
+ (store_inferior_registers): Loop for as many words are in the register.
+
+ * infptrace.c [NO_SINGLE_STEP]: Call single_step().
+
+ * kill_inferior{,_fast}: Declare as returning void.
+
+ * m-sun3.h (USE_PTRACE_GETREGS): Define.
+
+ * execcore.c: Add IS_OBJECT_FILE & related stuff.
+
+ * infptrace.c: Include <sys/ptrace.h>.
+ [ATTACH_DETACH] [USE_PTRACE_GETREGS]: New code.
+
+ * Split default-dep.c into infptrace.c and execcore.c.
+
+ * valprint.c [IEEE_FLOAT]: Change void * to char *.
+
+ * breakpoint.c: Change printf_filtered(%s) to fputs_filtered.
+
+Wed Jan 24 00:35:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (symbol_file_command): When freeing everything, free
+ the string table too.
+
+ * Makefile.dist (gdb1): add "rm -f gdb1".
+
+ * printcmd.c (print_scalar_formatted): If size is 0, use 'b'
+ 'h', 'w', or 'g' depending on the type.
+
+ * stack.c (backtrace_command): Read in symbols for frames we'll
+ print before printing them.
+
+ * valops.c (value_at): Don't print "I/O error" on EIO from
+ ptrace. Don't print "out of bounds" for any ptrace error
+ except EIO.
+
+ * valprint.c (type_print_base, case TYPE_CODE_ENUM):
+ Print "FOO = 5" not "FOO : 5".
+
+ * symtab.{c,h}: Make lookup_misc_func extern.
+
+ * Makefile.dist: Define VERSION in makefile, and generate
+ version.c automatically.
+ (gdb.tar): Use gdb-$(VERSION), not dist-gdb.
+
+ * expread.y (yylex): Use lookup_primitive_typename to
+ cut down on calls to lookup_symbol.
+ symtab.{c,h} (lookup_primitive_typename): New function.
+ (lookup_typename): Use it.
+
+ * symtab.{c,h} (check_stub_type): New function.
+ valprint.c (type_print_base, val_print, type_print_derivation_info),
+ values.c (allocate_value): Call it.
+
+ * printcmd.c (whereis_command): New function.
+ symtab.c (lookup_symbol): Add symtab parameter.
+ various: Pass additional argument to lookup_symbol.
+ symseg.h (struct symbol): Add line field.
+ dbxread.c (define_symbol): Set sym->line.
+
+ * dbxread.c (symbol_file_command): Read string table into
+ malloc'd memory (symfile_string_table) and leave it there.
+ (psymtab_to_symtab): Use symfile_string_table.
+
+ * utils.c (sig_abbrev): Return NULL if not found.
+ infrun.c (sig_print_{header,info}): Consolidate duplicated
+ code from handle_command, signals_info.
+ (sig_print_info): Just print number if no name from sig_abbrev.
+
+ * Makefile.dist (OTHERS): Add ChangeLog-3.x
+
+ * infrun.c (restore_inferior_status): #if 0 out
+ "Unable to restore previously selected frame" error message.
+
+ * infrun.c (signals_info, handle_command): Print signal
+ abbrevs along with numbers.
+
+ * infrun.c (handle_command): Accept symbol signal names.
+
+ * utils.c (sig_{number,abbrev}, init_sig): New functions.
+ _initialize_utils: Call init_sig for each signal.
+ defs.h: Declare them.
+
+ * default-dep.c (read_inferior_memory): Check quit_flag in
+ fetch loop.
+
+ * Changes for lazy fetching (speeds things up for big objects):
+ value.h (struct value): New field lazy.
+ VALUE_CONTENTS_RAW, VALUE_LAZY, value_at_lazy: New.
+ findvar.c (read_var_value): Set lazy instead of fetching.
+ various: Copy into VALUE_CONTENTS_RAW, not VALUE_CONTENTS.
+ valops.c: Add value_at_lazy, value_lazy.
+ various: Call value_at_lazy instead of value_at.
+
+ * symtab.h (LONGEST): Define.
+
+ * m-*.h (LONGEST, BUILTIN_TYPE_LONGEST): Delete (in symtab.h).
+
+ * infrun.c (wait_for_inferior): #if 0 out stop if ABOUT_TO_RETURN
+
+ * version.c: Change version number to 4.0development
+
+For older changes see ChangeLog-3.x
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1991 b/contrib/gdb/gdb/ChangeLog-1991
new file mode 100644
index 0000000..199b73f
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1991
@@ -0,0 +1,5175 @@
+Mon Dec 30 10:57:02 1991 Per Bothner (bothner at cygnus.com)
+
+ Mainly stuff to improve handling of TYPE_CODE_REF values.
+ * valops.c (value_addr): If taking the addres of a
+ TYPE_CODE_REF, just cast the object to the corresponding
+ TYPE_CODE_PTR. This yields correct C++ semantics, and
+ preserves the location information, which has the nice effect
+ that &(&R) given the location containing R.
+ * values.c (value_copy): Make non-static (used by value_addr).
+ * eval.c (evaluate_subexp_for_address): Use the default
+ scheme (with value_addr) for a variable if it has TYPE_CODE_REF.
+ * valops.c (value_addr), eval.c (evaluate_subexp_for_address,
+ evaluate_subexp_with_coercion): Factor out some common
+ expressions into variables, for easier reading.
+ * findvar.c (locate_var_value): Remove code to handle
+ TYPE_CODE_REF - it should no longer be needed.
+ * valops.c (value_assign): Do a COERCE_REF on the
+ destination operand, for correct C++ semantics.
+ * valarith.c (value_x_binop): Ditto: De-reference C++
+ references in the arguments.
+ * valops.c: ANSI-fy: bcopy->memcpy, bzero->memset.
+
+Sat Dec 28 11:30:26 1991 Per Bothner (bothner at cygnus.com)
+
+ * dwarfread.c, coffread.c: Use INIT_CPLUS_SPECIFIC.
+ * symtab.c (gdb_mangle_name): Recognize and handle
+ constructors specially.
+ * symtab.c (check_stub_method): Test for failure from
+ cplus-demangle by calling error() instead of seg-faulting ...
+
+Fri Dec 27 22:21:30 1991 Fred Fish (fnf at cygnus.com)
+
+ * defs.h: Add definition of null_cleanup()
+
+ * procfs.c: Many small changes to add base support for a new
+ "info proc" command (currently only printing of the address
+ space mapping is implemented) and allow iteration over the
+ address space mapping, calling an arbitrary function for each
+ mapping (used for shared library support).
+
+ * solib.c: Change all ifdefs that checked for "sun" to check
+ for "!SVR4_SHARED_LIBS" instead. Rewrite lookup_base() to
+ handle locating the debug base address even when not currently
+ stopped at the dynamic linker entry point.
+
+ * utils.c: Add null_cleanup() as a known function that does
+ nothing to serve as a base for possibly long cleanup chains
+ with no specific "first cleanup" to serve as an anchor.
+
+ * xm-sysv4.h: Add define of SVR4_SHARED_LIBS
+
+Fri Dec 27 10:11:33 1991 Per Bothner (bothner at cygnus.com)
+
+ * arm-opcode.h, m88k-opcode.h, pn-opcode.h, np1-opcode.h,
+ pyr-opcode.h, tahoe-opcode, vax-opcode.h: Removed -
+ these are all essentially the same as the versions
+ in ../include/opcode. The remaining *-opcode.h here
+ are not quite so obviously the same, and need study.
+ * arm-pinsn.c, gould-pinsn.c, m88k-pinsn.c, pyr-pinsn.c,
+ tahoe-pinsn.c, vax-pinsn.c: Change so these include
+ opcode/FOO.h (actually ../include/opcode/FOO.h)
+ instead of the recenntly departed opcode-FOO.h files.
+ * sparc-pinsn.c: Now that we're using the much tighter
+ opcode table in ../include/opcode/sparc.h, we shouldn't
+ need to sort the opcodes before dis-assembly.
+
+ * symtab.h, symmisc.c: Make cplus_struct_default be const.
+ * symtab.h, buildsym.c: Add and use INIT_CPLUS_SPECIFIC macro.
+ * symmisc.c: Remove unused 'nfields' variable.
+ * buildsym.h: Add extern decl of unknown_symtype_complaint,
+ since it used used by partial-stab.h (included two places).
+ * partial-stab.h: Re-arrange DBXREAD_ONLY #ifdefs so that
+ we should never hit the default case (until new stab codes
+ are added). Hence, we can leave the complaint in the
+ default case in even when DBXREAD_ONLY is off.
+ * partial_stab.h: Recognize a pair of N_SO stabs (one for the
+ directory, one for the filename proper) without peeking ahead.
+ * dbxread.c, mipsread.c: Because of previous change, don't need
+ ugly CHECK_SECOND_N_SO macro.
+ * buildsym.h, dbxread.c, mipsread.c: Make next_symbol_text a
+ macro that invokes a function pointer in next_symbol_text_func.
+ * mipsread.c: Added comments various places to
+ explain what is going on.
+ * mipsread.c (parse_symbol): Support the new (SGI-specific?)
+ symbol types stStruct, stUnion, and stEnum.
+ Also, some fixes in the code for dealing with tags.
+ * mipsread.c: Change handling of startup_file_start and _end
+ - now just use the textlow and texhigh of a psymtab
+ to check if we've found the startup-file.
+ * mipsread.c: Replace s_idx by global cur_sdx in many places.
+ This is so mips_next_symbol_text can get at it.
+
+Thu Dec 26 19:52:01 1991 Fred Fish (fnf at cygnus.com)
+
+ * dbxread.c, symmisc.c: Move add_psymbol_to_plist() from
+ dbxread.c to symmisc and change name to add_psymbol_to_list.
+ Ditto for add_psymbol_addr_to_plist(). Also expand their
+ body to not use ADD_PSYMBOL_VT_TO_LIST.
+
+ * dwarfread.c: Remove add_psymbol_to_list() and convert usages
+ to the ADD_PSYMBOL_TO_LIST macro.
+
+ * ieee-float.c: Change "#ifdef DEBUG" to "#ifdef IEEE_DEBUG"
+ to avoid collision with the DEBUG for ADD_PSYMBOL_VT_TO_LIST.
+
+ * partial-stab.h, symfile.h: Move definitions of the macros
+ ADD_PSYMBOL_TO_LIST and ADD_PSYMBOL_ADDR_TO_LIST from
+ partial-stab.h to symfile.h. They aren't stab specific.
+ Change ADD_PSYMBOL_VT_TO_LIST to use memcpy rather than strncpy.
+
+Tue Dec 24 11:38:08 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll VERSION to 4.3.2.
+
+Mon Dec 23 13:54:35 1991 Per Bothner (bothner at cygnus.com)
+
+ * m68k-opcode.h, mips-opcode.h, sparc-opcode.h: Deleted.
+ * m68k-pinsn.c, mips-pinsn.c, sparc-pinsn.c:
+ Include <opcode/FOO.h> instead of <FOO-opcode.h>.
+
+ * symtab.h, symtab.c, coffread.c, dwarfread.c, symmisc.c,
+ dbxread.c: The TYPE_CPLUS_SPECIFIC structure is now only
+ allocated when it is needed. Until it is needed, it points
+ to a shared statically allocated structure.
+
+ * buildsym.h, buildsym.c, dbxread.c: Remove the kludgy code
+ in read_ofile_symtab to recognize two initial N_SO stabs,
+ and let process_on_symbol handle it. This is cleaner, more
+ efficient, and lets mipsread.c share the same code.
+
+ * symfile.h, partial-stab.h: Move ADD_PSYMBOL_VT_TO_LIST
+ and related macros to here ...
+ * dbxread.c: ... from here.
+ * symmisc.c: Move the "overflow" handling from
+ ADD_PSYMBOL_VT_TO_LIST macro into new function extend_psymbol_list.
+ * dwarfread.c: Re-write add_psymbol_to_list to use
+ ADD_PSYMBOL_VT_TO_LIST macro.
+
+ * mipsread.c: Extend mipsread.c to handle stabs-style symbols
+ encapsulated in ecoff symbols. This enable full g++ debugging.
+ * partial-stab.h: Move the code for pre-scanning symbols
+ and building psymtabs to an include file, out from dbxread.c.
+ This way, the same code can also be used by mipsread.c.
+ * dbxread.c, buildsym.h: Various changes to allow some functions
+ to be used by mipsread.c (also some arguable stylistic changes).
+
+ * tm-mips.h: Define BLOCK_ADDRESS_ABSOLUTE, at least for now,
+ since mips-tfile puts relocatable addresses into LBRAC/RBRAC
+ stabs.
+
+ * mipsread.c: Replace code to handle ambiguous tag blocks.
+ Instead of allocating a TYPE_CODE_UNDEF, guess (by looking
+ at types and offsets) if a tag is a struct, union, or enum.
+ Still patch it later if we find out for sure.
+ * mipsread.c: In various ways, replace Forin's
+ ideo-syncratic code by code that fits better with the
+ rest of gdb, for both stabs-based and ecoff-based symtabs.
+ E.g. use end_psymtab; don't do extra passes over FDR table to
+ pre-partition global data; don't use external symbols to
+ create static/global symbols (just put them in the
+ misc_vector); use ADD_PSYMBOL_TO_LIST macro; don't
+ sort psymtabs or symtabs; use obstacks more.
+
+ * symtab.c, mipsread.c, dbxread.c, buildsym.c:
+ ANSIfy: Replace bcopy by memcpy, bzero by memset.
+
+Sun Dec 22 19:31:04 1991 Fred Fish (fnf at cygnus.com)
+
+ * solib.c (locate_base): Fix uninitialized variable that was
+ causing return of random value to callee.
+
+ * config/mh-amix, config/mh-i386v4: Change to find alloca by
+ compiling and linking alloca.c, even when it is not strictly
+ required. Also arrange to link with -ltermlib rather than
+ -ltermcap.
+
+ * Makefile.in: Move TERMCAP definition to prior to inclusion
+ of host makefile fragments so it can be overridden.
+
+Fri Dec 20 16:33:39 1991 John Gilmore (gnu at cygnus.com)
+
+ * xcoffread.c (read_symbol_lineno): Logic error in incrementing
+ symbol table entry number. (From Metin Ozisik.)
+
+Fri Dec 20 11:36:38 1991 Fred Fish (fnf at cygnus.com)
+
+ * config/mh-i386v4: Change XM_CLIBS to "-lc /usr/ucblib/libucb.a"
+ so compiles with native compilers (without builtin alloca) can
+ pick up the version from the bsd emulation library. However, we
+ search the standard C library first so we don't pick up lots of
+ other broken stuff from libucb.a, that we *don't* want.
+
+ * configure.in, tm-amix.h, tm-i386v4.h, xm-amix.h, xm-i386v4.h:
+ Change svr4 references to sysv4.
+
+ * source.c: Move declaration of external function index to
+ front of file so it is in scope for all references.
+
+ * utils.c (error, fatal): Make definitions consistent with
+ defs.h declarations (declared as "volatile void").
+
+Fri Dec 20 10:55:36 1991 John Gilmore (gnu at cygnus.com)
+
+ * rs6k-opcode.h: Bugfix sfe and stbrx. By Al Kossow.
+
+Wed Dec 18 17:09:06 1991 Stu Grossman (grossman at cygnus.com)
+
+ * command.h, defs.h, eval.h, expression.h, remote-sa.sparc.c,
+ sparc-tdep.c, symtab.h, target.h, value.h, vx-share/ptrace.h,
+ vx-share/xdr_ptrace.h, vx-share/xdr_rdb.h: ANSIfy enums.
+
+Mon Dec 16 12:31:46 1991 Fred Fish (fnf at cygnus.com)
+
+ * config/mt-amix, config/mt-i386v4: Add solib.o to TDEPFILES
+ for these SVR4 systems.
+
+ * symfile.c (symbol_file_add): When verbose is set, print
+ the names of files from which symbols are being loaded, as
+ when from_tty is true.
+
+ * solib.c: Completely reorganized (rewritten) to support
+ SVR4 shared libraries in a manner very close to the original
+ SunOS implementation. This support is expected to change and
+ become more general at some future time. The SVR4 version
+ does not yet work for attached processes, for example.
+
+ * dwarfread.c: Arrange in dwarf_build_psymtabs() for the
+ relocation address to be valid whether or not symbols are
+ being read from a shared library or an executable. Use the
+ relocation address recorded in the psymtab when reading
+ full symbol tables (in read_ofile_symtab). Ensure that the
+ relocated address ranges are recorded in partial symtabs.
+
+ * elfread.c: Add new function elf_interpreter() to return the
+ string from the ELF ".interp" section. This is the interpreter
+ that the kernel tries to run and feed the executable to.
+ Expand arguments to record_misc_function to include a type arg.
+ Modify elf_symtab_read() to supply the type arg, and to do symbol
+ relocations for symbols read in from shared libraries.
+
+ * procfs.c: Add new functions proc_base_address() and
+ proc_address_to_fd(), used by shared library support.
+
+ * tm-svr4.h: Add macros to support SVR4 shared libraries.
+ Definitions for SOLIB_ADD, SOLIB_CREATE_INFERIOR_HOOK,
+ CLEAR_SOLIB, and DISABLE_UNSETTABLE_BREAK.
+
+Fri Dec 13 20:11:26 1991 John Gilmore (gnu at cygnus.com)
+
+ * infrun.c, remote-eb.c, remote-nindy.c, remote-vx.c: Remove
+ unused START_INFERIOR_HOOK.
+
+ * remote-eb.c: Change timeout to 24 seconds (*10 fits in byte)
+ to account for slow loading from floppies.
+ (eb_create_inferior): New fn, from eb_start and
+ nindy_create_inferior.
+ (eb_close): Only use log_file if nonzero.
+ (eb_xfer_inferior_memory): If not writing, then read!
+ (eb_read_inferior_memory, eb_write_inferior_memory): Return length.
+ (eb_kill): A new no-op.
+ (eb_mourn_inferior): Remove breakpoints, then generically weep.
+
+Fri Dec 13 16:09:23 1991 Fred Fish (fnf at cygnus.com)
+
+ * breakpoint.c, findvar.c, infrun.c, putenv.c, stack.c: Fix
+ miscellaneous comparisons of integer with NULL that elicit
+ compiler warnings about comparison of integer with pointer, when
+ NULL is ((void *) 0) rather than just a bare 0.
+
+Wed Dec 11 13:02:58 1991 John Gilmore (gnu at cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Disable each breakpoint
+ while we reset it, in case of problems. Print breakpoint number
+ in error messages.
+
+ * buildsym.c (read_struct_type): Avoid sun3 compiler bug with
+ foo[--n].
+
+ * source.c (find_source_lines): If getting file mod time fails,
+ don't warn.
+
+ * target.c (target_xfer_memory): If errno is set, return it,
+ rather than EIO.
+
+Tue Dec 10 04:07:22 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: infodir belongs in datadir.
+
+Sun Dec 8 21:13:33 1991 Michael Tiemann (tiemann at sphagnum.cygnus.com)
+
+ * symtab.h (struct fn_field): Add new fields `is_private',
+ `is_protected', `is_stub', making room by reducing the size of
+ `voffset'.
+ (struct fn_fieldlist): Delete the fields `private_fn_field_bits'
+ and `protected_fn_field_bits'.
+ (TYPE_FN_{PRIVATE,PROTECTED}_BITS): Deleted.
+ (SET_TYPE_FN_{PRIVATE,PROTECTED}): Deleted.
+ (TYPE_FN_{PRIVATE,PROTECTED}): Deleted.
+ (TYPE_FN_FIELD_{STUB,PRIVATE,PROTECTED}): New macros.
+ * valops.c, valprint.c, symtab.c: All callers updated.
+
+ * buildsym.c (read_struct_type): Delete the `visibility' field
+ from `struct next_fnfield', and rework code so that visibility
+ info is stored into the fn_field directly. Also, hacked to set
+ TYPE_FN_FIELD_STUB for both static and normal member functions.
+
+Sat Dec 7 18:13:11 1991 Fred Fish (fnf at cygnus.com)
+
+ * i386-tdep.c: Fix a problem on i386 systems where buffered code
+ stream access was failing to take into account the minimum size
+ granularity of the code section. For now, the buffering is simply
+ disabled. There is a similar problem in the i386 disassember code
+ that has not yet been fixed (FIXME).
+
+ * gmalloc.c: Use macros to hide some of the ugly casting required
+ in the previously applied fix for pointers with high bits set.
+
+Sat Dec 7 16:49:35 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll VERSION to 4.3.1.
+
+Sat Dec 7 04:12:35 1991 John Gilmore (gnu at cygnus.com)
+
+ GDB-4.3 release!
+
+ * Makefile.in: Roll VERSION to 4.3
+ * README, TODO, WHATS.NEW, depend: Update.
+
+ * inflow.c (terminal_inferior): Avoid error msg if attached.
+
+ * gmalloc.c: Fix bug that causes malloc & free to
+ fail on systems where pointers have the high bit set (0x800efcf0
+ for example). The problem is that the difference between two
+ pointers is a signed integer, so the computation
+
+ (char *) 0x800efcf0 - (char *) 0
+
+ yields a negative value. The sign of the result of the modulus
+ operator is machine dependent for negative operands, thus it is
+ possible for it to end up negative. From Fred Fish.
+
+Sat Dec 7 00:00:15 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: install using INSTALL_PROGRAM and INSTALL_DATA.
+ added clean-info. added some standards.text support and made it
+ look like our other Makefiles.
+
+ * configure.in: mark this directory target dependent. configure
+ now runs entirely in objdir so make existence tests and
+ references against ${srcdir}.
+
+Fri Dec 6 08:30:36 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (enum_type, struct_type): Fixes for opaque and
+ anonymous enumerations, structures, and unions. Now passes all
+ the current gdb test suite tests.
+
+Thu Dec 5 22:46:13 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: idestdir and ddestdir go away. Added copyrights
+ and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
+ and mandir now keyed off datadir by default.
+
+Thu Dec 5 21:53:21 1991 John Gilmore (gnu at cygnus.com)
+
+ * symtab.c (decode_line_1): If SKIP_PROLOGUE leaves us in
+ mid-line, be more careful about possibly advancing to the next line.
+
+Thu Dec 5 18:59:51 1991 Michael Tiemann (tiemann at cygnus.com)
+
+ * cplus-dem.c (cplus_demangle): Call `string_need' when
+ null-terminating a partially-computed string.
+
+Thu Dec 5 18:19:43 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (enum_type): Build a correct TYPE_NAME, add a
+ symbol to the symbol table for each member of the enum.
+
+ * dwarfread.c (struct_type): Build a correct TYPE_NAME.
+
+ * dwarfread.c (add_enum_psymbol): New function to extract enum
+ member names and add them to the partial symbol table while
+ building partial symbol tables.
+
+Thu Dec 5 17:31:05 1991 John Gilmore (gnu at cygnus.com)
+
+ * symtab.c (check_stub_method): Must allocate two extra argument
+ slots (one for `this', one for arglist terminator).
+
+Thu Dec 5 10:51:05 1991 Fred Fish (fnf at cygnus.com)
+
+ * inflow.c (child_terminal_info): Supply missing '"' character.
+
+ * buildsym.c (define_symbol): Supply missing parenthesis.
+
+Thu Dec 5 03:34:21 1991 John Gilmore (gnu at cygnus.com)
+
+ * coredep.c (fetch_core_registers): Fencepost error. Fixed by
+ Jay Lepreau <lepreau@cs.utah.edu>.
+
+ * inflow.c: Remember whether GDB has a terminal. Avoid switching
+ terminals back and forth if we don't have one.
+
+ * c-exp.y (parse_number): Zero is not an unsigned int constant!
+ * dbxread.c (read_dbx_symtab): Enum type numbers can be in (1,2) form.
+
+ Improve type parsing.
+ * buildsym.c (define_symbol, read_range_type): Add
+ long_kludge_name that passes the names of range types being
+ defined, down to where we must choose between 'int' and 'long'
+ variants. This fails on Sun C anyway since the compiler itself is
+ confused between int and long.
+ (read_array_type, cleanup_undefined_types): Correct the size of
+ array type whose element-type size isn't immediately known.
+
+ Early preparation to blow away many builtin types, building them
+ on the fly as needed. Don't compare types to builtin types with
+ ==; examine the relevant fields instead.
+ * coffread.c (process_coff_symbol: C_ARG, C_REGPARM): Avoid ==.
+ * buildsym.c (define_symbol, case 'p'): Avoid ==.
+ * valops.c (value_arg_coerce): Avoid ==. Don't assume host and
+ target types are the same.
+ * valprint.c (val_print): I finally understand arrays, remove FIXME.
+
+ * symmisc.c (printpsyms_command): Reduce redundancy, and put all
+ addresses in GDB itself into parens for easy cleanup and diffing.
+
+Wed Dec 4 21:05:30 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread (enum_type): Arrange for the order of enumeration
+ members to match the source code order; not the order in the
+ Dwarf information, which is explicitly reverse order.
+
+Wed Dec 4 18:24:39 1991 John Gilmore (gnu at cygnus.com)
+
+ * main.c (input_from_terminal_p): Check whether GDB has a
+ terminal at all.
+ (initialize_main): Revise doc for `set editing'.
+
+Wed Dec 4 15:36:39 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (struct_type): Handle structures and unions which
+ contain DIE's other than just member dies.
+
+Wed Dec 4 01:59:05 1991 John Gilmore (gnu at cygnus.com)
+
+ * symfile.c (reread_symbols): Avoid kludging mtime_set, now that
+ BFD is fixed.
+
+Tue Dec 3 17:24:57 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: VERSION 4.2.96.
+
+ * main.c (initialize_main): Revise command descriptions.
+ * command.c (show_user): `info user' -> `show user'.
+ * symtab.c (_initialize_symtab): Typo in `info types' desc.
+
+ * coffread.c (coff_symfile_read): Avoid select_source_symtab,
+ since it is not needed and can cause errors when examining ".o"s.
+ (read_coff_symtab, decode_base_type): Use complain, not printf.
+ Print symbol name, not its number.
+ Remove "#if defined(clipper) #define BELIEVE_PCC_PROMOTION", which
+ someday should go in a clipper target config file.
+
+ * symfile.c (compact_misc_function_vector): Handle empty vector.
+ (complain, clear_complaints, syms_from_objfile): Fix complaint
+ formatting.
+ * xcoffexec.c: Change syms_from_objfile caller.
+
+ * sparc-xdep.c: Force tm-file as tm-sparc.h, to make it compile
+ when configured for cross debugging. FIXME, this needs a more
+ general solution.
+
+Mon Dec 2 11:04:05 1991 Per Bothner (bothner at cygnus.com)
+
+ * mips-tdep.c (init_extra_frame_info): Float register
+ 'i' has gdb-internal number 'FP0+i', not '32+i'.
+ * mipsread.c (new_symbol): Translate g++ special
+ symbol "$t" to "this".
+
+Sat Nov 30 21:29:55 1991 Steve Chamberlain (sac at cygnus.com)
+ Changes due to include file renaming:
+
+ * xcoffread.c: internalcoff.h ->coff/internal.c,
+ coff-rs6000.h ->coff/rs6000.h
+ * mipsread.c: coff-mips.h ->coff/mips.h
+ * elfread.c: elf-common.h ->elf/common.h
+ elf-external.h ->elf/external.h,
+ elf-internal.h ->elf/internal.h
+ * dwarfread.c dwarf.h ->elf/dwarf.h
+ * dbxread.c: aout64.h ->aout/aout64.h
+ stab.gnu.h ->aout/stab_gnu.h
+
+ * coffread.c: internalcoff.h ->coff/internal.h
+ * buildsym.c: stab.gnu.h ->aout/stab_gnu.h
+ * depend Updated to take the above into account.
+
+Fri Nov 29 16:59:25 1991 Fred Fish (fnf at cygnus.com)
+
+ * configure.in: Add SVR4 i386 configurations.
+
+ * config/mh-i386v4, config/mt-i386v4, tm-i386v4.h, xm-i386v4.h:
+ New files for i386/SVR4.
+
+ * tm-i386v.h: Allow START_INFERIOR_TRAPS_EXPECTED and
+ DECR_PC_AFTER_BREAK to be predefined by files including
+ tm-i386v.h.
+
+ * i386-tdep.c: Add supply_gregset(), fill_gregset(),
+ supply_fpregset(), and fill_fpregset() functions, which are
+ target dependent support functions for the SVR4 /proc register
+ interface.
+
+ * dwarfread.c (enum_type, struct_type): Expand recognized
+ compiler generated tags to include symbols beginning with '.' as
+ well as '~'.
+
+ * symtab.c (sources_info): Change simple printf of error message
+ to call to error().
+
+Fri Nov 29 16:04:21 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/gdb.texinfo: remove leading comments that survived M4 but
+ described its role in the doc; add one more font to colophon;
+ strengthen disclaimer about unsupported configs.
+
+Wed Nov 27 01:23:41 1991 John Gilmore (gnu at cygnus.com)
+
+ Fix bugs in C++ debugging.
+
+ * symtab.h: target_type is not used in record types.
+ Eliminate TYPE_MAIN_VARIANT and TYPE_NEXT_VARIANT. Eliminate
+ lookup_method_type. Add TYPE_TYPE_SPECIFIC macro.
+
+ * symtab.c (lookup_member_type): Don't chain them up, just
+ allocate one in symbol_obstack when we need one.
+ (allocate_stub_method): Build stub in symbol_obstack.
+ (check_stub_method): Move here from values.c. Don't deallocate
+ stub; overwrite it.
+ (lookup_method_type): Gone now.
+
+ * buildsym.c: Handle g++ v1 stabs a little bit better.
+ Change some C++ parsing error()s to complain()ts.
+ * buildsym.c, findvar.c, printcmd.c, symtab.c: Make unions and
+ structs have the same representation and work the same as far as
+ C++ is concerned.
+ * buildsym.c, symtab.c, values.c: Remove all references to
+ TYPE_MAIN_VARIANT and TYPE_NEXT_VARIANT.
+
+ * valops.c: Improve comments and indentation. Only call
+ check_stub_method when the stub flag is on.
+ * valprint.c: Fix or mark minor bugs and unportabilities.
+
+ * coffread.c (anonymous unions): Allocate a cplus structure.
+
+ * mipsread.c: Eliminate "template" types. Build new, real
+ types whenever we need them. Allocate cplus structures as needed.
+ Bulletproof the type parsing a bit more. Mark storage leaks.
+ (parse_type): Copy TYPE_TYPE_SPECIFIC when copying a real type
+ on top of a partial type.
+
+Fri Nov 22 16:39:57 1991 John Gilmore (gnu at cygnus.com)
+
+ * inflow.c (terminal_inferior): Check the results of ioctl's, and
+ print a message if any of them fail.
+ (terminal_ours_1): Store result of ioctl's for debugging, but
+ don't print (the terminal isn't ours...).
+
+ * tm-tahoe.h (FRAME_ARGS_ADDRESS): No need to offset from frame
+ pointer.
+
+ * m2-exp.y (MAX, MIN): Rename to MAX_FUNC, MIN_FUNC to avoid
+ conflicts with system header files.
+
+Fri Nov 22 08:27:40 1991 John Gilmore (gnu at cygnus.com)
+
+ * Roll VERSION to 4.2.95.
+
+ * buildsym.c, coredep.c, mem-break.c, xcoffread.c: Put <stdio.h>
+ first, before defs.h.
+ * config/mh-i386sco: Override compiler to gcc, print warning.
+ * configure.in: Handle i386-none-aout rather than i386-aout-none.
+ * infptrace.c, language.h, utils.c: Lint.
+ * m2-exp.y: #undef MAX and MIN in case system includes set them.
+ * xm-tahoe.h: Set HOST_BYTE_ORDER. Include system versions of
+ {BIG,LITTLE}_ENDIAN and the INT_MAX family first, to avoid
+ redefinition warnings.
+ * defs.h: Reorder things so that the xm-file gets first crack
+ at #define's, followed by defs.h and then the tm-file.
+ * Makefile.in: Remove spaces after 'ignore exit code' - flags.
+ Late-model BSD 'make's don't cope with them.
+
+Thu Nov 21 23:48:56 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll new files into various lists.
+
+Thu Nov 21 18:26:11 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (struct_type): Must initialize the c++ specific
+ portion of union types as well as struct types, since gdb attempts
+ to reference the c++ specific info for both types.
+
+Thu Nov 21 10:23:52 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll VERSION to 4.2.90.
+
+ * defs.h: Incorporate param.h into defs.h. All users changed.
+ * param-no-tm.h: Change users to define TM_FILE_OVERRIDE instead.
+ * param.h, param-no-tm.h: Removed.
+ * Update copyrights in all changed files.
+ * dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c,
+ solib.c, symtab.h, tm-umax.h, valprint.c: Lint.
+ * tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h,
+ xm-merlin.h: Avoid host include files in target descriptions.
+ * getpagesize.h: Removed, libiberty copes now.
+ * Makefile.in: Remove getpagesize.h, param.h, param-no-tm.h.
+
+ * exec.c (exec_files_info): If `verbose' is set, show file offset
+ as well.
+
+ * main.c: Use getcwd rather than getwd.
+ * standalone.c: Fake getcwd rather than getwd.
+ * xm-*.h: Remove fake values of MAXPATHLEN.
+
+ * xcoffexec.c: Add /* */ to #if 0'd thing to help ANSI.
+
+Wed Nov 20 18:35:56 1991 John Gilmore (gnu at cygnus.com)
+
+ * Remove gdb/hp-include. Support for HP a.out oddities should be
+ in BFD, not in GDB. Move gdb/hp-include/a.out.h to include/a.out.hp.h.
+
+ * infptrace.c, tm-sun386.h: Cashier <a.out.gnu.h>, remove refs.
+
+ * configure.in, xconfig, tconfig, Makefile.in, doc/gdbint.texinfo:
+ Makefile fragments for various hosts and targets now come from
+ gdb/config/mh-* and gdb/config/mt-*. This is for consistency with
+ other config setups.
+
+ * rs6000-pinsn.c, rs6k-opcode.h: Clean up.
+ * rs6k-opcode.def: Delete.
+
+Wed Nov 20 05:04:40 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c: Recognize obsolete form of AT_element_list
+ attribute still used by at least one AT&T compiler, and possibly
+ more.
+
+Tue Nov 19 07:53:55 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (enum_type, struct_type): Ignore names invented by
+ helpful compilers for anonymous structs, unions, and enums.
+
+ * c-exp.y, m2-exp.y: Add defines for yymaxdepth, yy_yys, and
+ yy_yyv, so multiple parsers produced by SVR4 versions of yacc
+ can coexist in the same executable without collision.
+
+ * symtab.h: Add declaration for lookup_template_type() to kill
+ compiler warnings about conversions from int to pointer.
+
+Mon Nov 18 17:45:18 1991 Fred Fish (fnf at cygnus.com)
+
+ * procfs.c: Move inclusion of defs.h to before param.h, as in
+ all the other source files that include both. This is required
+ to supply some typedefs that are used in files included by param.h.
+
+ * m68k-tdep.c (m68k_skip_prologue): Add generic m68k support for
+ skipping function prologues, ala the other cpu families (i386,
+ mips, m88k, etc). Add the ability to skip movm and fmovm
+ instructions in the prologues. Still needs support for profile
+ (-p compiled) prologue sequences (FIXME).
+
+ * tm-68k.h: Change SKIP_PROLOGUE macro to use the new generic
+ m68k prologue skipping function by default.
+
+ * tm-altos.h, tm-isi.h: Continue to use the old definition of
+ SKIP_PROLOGUE.
+
+Mon Nov 18 15:12:45 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Remove tdesc stuff, and extra blanks before colons.
+ * blockframe.c: Remove tdesc-related code. Default
+ FRAME_CHAIN_COMBINE.
+ * infrun.c: Remove tdesc-related code.
+ * m88k-tdep.c (frame_chain_combine, init_frame_pc): Remove copies
+ of defaultable things.
+ * tm-m88k.h: New file, common to all Moto 88k target configs.
+ Derived from tm-delta88.h.
+ * tm-delta88.h: Use it.
+ * xm-m88k.h: Common file for 88K hosts. Remove obsolete stuff.
+ * xm-delta88.h: Use it.
+ * tm-*.h: Remove FRAME_CHAIN_COMBINE macros, since all are
+ default.
+ * coffread.c: Remove tdesc stuff.
+ * tconfig/delta88, tconfig/m88k: Remove tdesc stuff.
+ * xconfig/m88k: Rename tm-88k.h to tm-m88k.h.
+
+Mon Nov 18 13:51:37 1991 Per Bothner (bothner at cygnus.com)
+
+ * source.c (open_source_file): If openp fails, try again
+ using just the base (non-directory) part of the filename.
+ This solves various annoying problems, such as when the
+ source was compiled with an absolute pathname - and the
+ source files have moved. Or if the source was compiled
+ using a relative pathname, it can be more convenient
+ to just specific the source directory to the dir command.
+
+Mon Nov 18 00:04:41 1991 Fred Fish (fnf at cygnus.com)
+
+ * cplus-dem.c (munge_function_name): Add missing third arg to
+ instance of call to do_type().
+
+ * dwarfread.c: Changes to match new dwarf.h. Remove
+ AT_deriv_list, AT_loclist, AT_incomplete, AT_const_data,
+ and AT_is_external.
+
+Sun Nov 17 16:20:53 1991 Michael Tiemann (tiemann at rtl.cygnus.com)
+
+ * symtab.h (struct type): Moved C++-specific fields into new type
+ `struct cplus_struct_type'. Now takes 10% less memory. Many
+ macros changed.
+ * symtab.c (init_type): Don't set fields belonging to
+ TYPE_CPLUS_SPECIFIC unless TYPE is TYPE_CODE_STRUCT.
+ * buildsym.c (read_type): Allocate TYPE_CPLUS_SPECIFIC for
+ TYPE_CODE_STRUCT.
+ (read_struct_type): Ditto. Also, add comments about how we can
+ deduce TYPE_VPTR_FIELDNO from inheritance info and fieldname info.
+ * coffread.c (decode_base_type): Allocate TYPE_CPLUS_SPECIFIC for
+ TYPE_CODE_STRUCT.
+ (read_struct_type): Ditto.
+ * dwarfread.c (struct_type): Ditto.
+
+ * symtab.c (read_range_type): Don't set TYPE_MAIN_VARIANT.
+ (lookup_pointer_type): Don't use or set TYPE_MAIN_VARIANT.
+ (lookup_reference_type): Ditto.
+
+ * cplus-dem.c: Many changes made to handle decoding of
+ ANSI-mangled names.
+ * symtab.c (gdb_mangle_name): Mangle/demangle ANSI-mangled names
+ as well.
+
+Fri Nov 15 17:57:59 1991 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c (parse_partial_symbols): patch to keep DEC C
+ compiler from making gdb bomb out. Thanks to Ed Santiago!
+
+Thu Nov 14 19:27:30 1991 Fred Fish (fnf at cygnus.com)
+
+ * symfile.c: Add function compact_misc_function_vector() to
+ remove duplicate misc function vector entries. See comments
+ in source for why this is necessary/desirable.
+
+ * dwarfread.c: Add misc function type parameter to internal
+ record_misc_function(). Remove calls to init_misc_bunches()
+ and condense_misc_bunches(), these are now done in elfread.c.
+
+ * elfread.c: Add support for reading bfd canonical symbol tables
+ and generating misc function vector entries for global and
+ absolute symbols. Do calls to init_misc_bunches() and
+ condense_misc_bunches() where they will enclose all calls to
+ record_misc_function(), including those in dwarfread.c.
+
+Thu Nov 14 17:02:11 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/Makefile.in: new targets gdb.me, gdb.ms, gdb.mm
+ (roffable documentation).
+ * doc/gdb.texinfo: embedded hints (as comments) for better
+ texi2roff conversion.
+
+Thu Nov 14 13:18:25 1991 John Gilmore (gnu at cygnus.com)
+
+ * m88k-tdep.c (examine_prologue): Deal with OR instructions
+ that shuffle parameters into other regs.
+ * symtab.c (decode_line_1): Fix bug introduced in Per's change
+ of Nov 12th.
+
+Wed Nov 13 19:51:11 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * Makefile.in, xconfig/delta88 made it install a sysV manual page;
+ gdb.z into the right place.
+
+Wed Nov 13 16:45:13 1991 John Gilmore (gnu at cygnus.com)
+
+ Motorola 88000 port without tears, I mean without tdescs.
+
+ * m88k-tdep.c: Blow away all tdesc stuff.
+ Provide functions for all the frame-related macros in
+ tm-delta88.h. Adopt i960-style EXTRA_FRAME_INFO.
+ (examine_prologue, frame_find_saved_regs, skip_prologue): borrow
+ from i960-tdep.c and adapt to the function prologues on the 88k.
+ (read_next_frame_reg): Borrow from mips-tdep.c.
+ FIXME: frame_locals_address should go away.
+
+ * tm-delta88.h: Dump all the tdesc stuff.
+ Macros for all frame-related stuff call fns of same name.
+ Remove duplicated definitions. FP_REGNUM becomes same as
+ SP_REGNUM.
+
+ * xm-88k.h: Eliminate lots of library dependencies, now handled
+ in libiberty. Eliminate KDB nonsupport.
+
+ * doc/gdbint.texinfo: Add rudiments on frames. FIXME, add more.
+
+
+ * stack.c (frame_info): Mark frameless functions.
+ Print locals address (FIXME, remove if same).
+ * blockframe.c: Comment changes, FIXME after.
+ * coffread.c: Even without TDESC, need to zap "@" symbols.
+ Don't register for wierd format names; change the names in BFD.
+
+ * alloca.c, language.c, tdesc.c: Lint.
+ * tdesc.c, tdesc-lib: FIXME: remove these.
+
+Tue Nov 12 19:30:22 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Add tdesc library support. Fixups to lint,
+ copying.c rules.
+
+Tue Nov 12 13:43:26 1991 Per Bothner (bothner at cygnus.com)
+
+ * symtab.c (decode_line_1): Remove spurious call to operator_chars.
+
+ Allow setting breakpoints on C++ destructors.
+ * valops.c (destructor_name_p): Don't check TYPE_HAS_DESTRUCTOR,
+ since it lies. Rely on callers to catch missing destructors.
+ * symtab.c (decode_line_1): For example (see above), here.
+ * buildsym.c, symtab.h: Remove TYPE_FLAGS_HAS{CON,DE}STRUCTOR
+ flags since they are no longer used.
+
+ Fixes to support C++ methods with functional parameters.
+ * c-exp.y (func_mod rule): Allow (and ignore) list of parameter
+ types in a function type.
+ * eval.c (parse_and_eval_type), value.h: New function,
+ parse_and_eval_type, is based on old code from check_stub_method.
+ But don't actually evaluate the cast, since that calls
+ value_cast(), whcih may fail. Just extract the type
+ from the parsed expression.
+ * values.c (check_stub_method): While looping through the
+ arguments, adjust depth *after* parameter has been handled.
+ Replace call and setup of parse_and_eval with new function
+ parse_and_eval_type.
+
+Tue Nov 12 09:40:07 1991 Fred Fish (fnf at cygnus.com)
+
+ * utils.c, rem-multi.shar: Remove fixed arg count version of
+ concat().
+
+ * altos-xdep.c, arm-xdep.c, coffread.c, command.c, convex-xdep.c,
+ core.c, dwarfread.c, gould-xdep.c, infcmd.c, language.c,
+ m88k-xdep.c, main.c, printcmd.c, pyr-xdep.c, source.c,
+ sun386-xdep.c, symm-xdep.c, umax-xdep.c, values.c, xcoffread.c:
+ Change all instances of use of fixed args concat() to variable
+ args concat() now located in libiberty.
+
+Tue Nov 12 07:23:46 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Add xcoffread.c, xcoffexec.c.
+ * xcoffread.c: New file for handling AIX mangled-coff files.
+ * xconfig/rs6000, tconfig/rs6000: New files.
+ * buildsym.c: Add hooks for xcoffread.c.
+ * rs6000-pinsn.c, rs6000-tdep.c, rs6000-xdep.c, tm-rs6000.h,
+ xm-rs6000.h, rs6k-opcode.def, rs6k-opcode.h: New files.
+ * xcoffexec.c: New file for handling AIX shared libraries.
+
+Mon Nov 11 19:14:31 1991 Fred Fish (fnf at cygnus.com)
+
+ * core.c: Minor rewording of message to user containing name of
+ (and possibly arguments to) the program that generated a core
+ file.
+
+ * elfread.c: Remove the register_addr() stub now that it is no
+ longer needed.
+
+ * procfs.c: Move misplaced #endif for ATTACH_DETACH. Add new
+ fetch_core_registers() function for core file support.
+
+Sat Nov 9 13:37:57 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (dwarf_psymtab_to_symtab): Remove leftover call
+ to do_cleanups() which resulted from a previous change.
+
+ * elfread.c: Re-enable compilation of register_addr() stub
+ whenever it is not supplied by coredep.c
+
+Sat Nov 9 00:40:32 1991 John Gilmore (gnu at cygnus.com)
+
+ Add tracking of object files (that contain symbols) to gdb.
+ This includes a "struct objfile" that owns symtabs and psymtabs
+ that were read in from that binary file.
+
+ * symfile.h: Add struct objfile. Add pointer to the objfile
+ into the struct sym_fns.
+ Replace global `symfile' and `symfile_mtime' with
+ `symfile_objfile'. Add global object_files chain.
+
+ * symfile.c: Move param.h above symtab.h.
+ (sort_misc_function_vector): Add.
+ (syms_from_objfile): Was syms_from_bfd.
+ (symfile_open): Now returns objfile.
+ (allocate_objfile): New.
+ (free_objfile): New, replacing free_all_.*symtabs.
+ (symfile_init): Takes objfile arg, puts it in sym_fns result.
+ (reread_symbols): Searches whole chain of objfiles.
+ (allocate_symtab): Takes objfile as new parameter, chains them.
+ Handle INIT_EXTRA_SYMTAB_INFO.
+ (free_all_psymtabs, free_all_symtabs): Move here from symmisc.c.
+
+ * dbxread.c: Make more errors into complaints.
+ (push_subfile, pop_subfile): Move to buildsym.c.
+ (dbx_symfile_read, dbx_symfile_init, fill_symbuf, read_dbx_symtab,
+ start_psymtab, psymtab_to_symtab_1, read_ofile_symtab,
+ dbx_psymtab_to_symtab, ): Use bfd ops, don't use file descriptor.
+ Pass objfile. Change callers.
+ (fill_symbuf, SWAP_SYMBOL): Take bfd as arg.
+ (read_dbx_symtab): Just wipe out new symbols, not all, on error.
+ (end_psymtab): Blow away psymtab if empty.
+ (process_symbol_pair): Swallow into read_ofile_symtab.
+ (process_one_symbol): Use push_context and pop_context.
+ (virtual_context): Delete #if 0'd obsolete stuff.
+
+ * buildsym.c (end_symtab): Pass objfile.
+ (dbx_lookup_type): Handle null typevector.
+ (dbx_alloc_type): Check file number, not sym number, for -1.
+ (find_symbol_in_list): Add for xcoffread.
+ (start_symtab): Default typevector is empty. Keep reusing same
+ context_stack.
+ (end_symtab): Take objfile argument and pass it to
+ allocate_symtab. Don't make a symtab if no blocks or symbols.
+ Handle empty typevector.
+ (push_context): New function for context stack nesting.
+ (read_type): Mark FIXME where we need to reintroduce type smashing.
+
+ * buildsym.h (pop_context): Macro, paired with push_context.
+ (subfile_stack): Move here from dbxread.c.
+
+ * coffread.c (end_symtab, read_coff_symtab): Take and use objfile arg.
+ (read_coff_symtab): Cleanup by freeing objfile, not all symtabs.
+
+ * mipsread.c (read_mips_symtab, parse_partial_symbols, parse_fdr,
+ new_psymtab, new_symtab): Take and use objfile arg.
+
+ * dwarfread.c (scan_compilation_units, start_psymtab,
+ process_dies, end_symtab, dwarf_build_psymtabs,
+ read_lexical_block_scope, read_func_scope, read_file_scope): Take
+ and use objfile argument.
+ (psymtab_to_symtab_1, read_ofile_symtab): Don't take or use file
+ descriptor. Use BFD internal functions instead.
+ (end_symtab): Call global allocate_symtab.
+
+ * elfread.c, target.c: Minor changes to accommodate objfiles.
+ * symtab.h: partial_symbol_table has no symfile_name member now.
+ (fn_fieldlists voffset): avoid non-int bitfield.
+ (struct symtab): Add objfile * and objfile_chain * of symtabs.
+ (struct partial_symtab): Add objfile * and objfile_chain * of
+ psymtabs. Remove symfile_name.
+
+ * symmisc.c: Lose free_all_symtabs, free_all_psymtabs.
+ (printsyms_command): Rename from print_symtabs. Add selective
+ listing if 2nd argument given. Print objfile info.
+ (printpsyms_command): Rename from print_partial_symtabs. Ditto all.
+ (printobjfiles_command): New; prints objfiles lists, and checks
+ for consistency of symtab, psymtab, and objfile lists.
+
+ * symfile.h, symfile.c, symtab.h: Lint
+
+Fri Nov 8 23:38:48 1991 John Gilmore (gnu at cygnus.com)
+
+ * command.c: Include param.h.
+ * defs.h (warning_setup, warning): Declare.
+ * expprint.c (print_subexp, UNOP_MEMVAL case): Lint.
+ * inflow.c (new_tty): Use USE_O_NOCTTY #define.
+ * language.c, printcmd.c (print_scalar_formatted), signame.c,
+ stack.c: lint.
+
+Thu Nov 7 18:26:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * Makefile.in: link with libiberty after libreadline, since
+ readline might want something in libiberty.
+ * m88k-xdep.c: Fixed the register offsets in the ptrace_user
+ struct for BCS 88k machines.
+ * xm-m88k.h: don't define USIZE if already defined.
+ * configure.in: Added delta88 target.
+
+Thu Nov 7 04:51:19 1991 John Gilmore (gnu at cygnus.com)
+
+ * am29k-pinsn.c, am29k-opcode.h: Fix decoding of mtacc, dmac, fmac.
+
+ * tm-*.h: Remove READ_DBX_FORMAT, COFF_FORMAT, and
+ READ_MIPS_FORMAT, which have been unused since BFD. Still
+ remaining is COFF_NO_LONG_FILE_NAMES.
+ * tm-sun3.h, tm-altos.h: Remove detritus accidentally left from
+ function calling code moved to m68k-tdep.c.
+
+Wed Nov 6 17:21:59 1991 John Gilmore (gnu at cygnus.com)
+
+ * coffread.c: Eliminate c_nsyms in favor of c_naux.
+ Complain if no auxents on .bf and .ef FCN symbols, and assume
+ lots of line numbers.
+ (init_linenos, enter_linenos): Use a sentinel at the end of the
+ read-in linenos, to make for a fast, safe loop-end test.
+
+Wed Nov 6 02:54:08 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * coffread.c (read_coff_symtab): coffread used to rely on the
+ x_sym.x_misc.x_lnsz.x_lnno field giving the # of linnos in a
+ function. Two of the formats I'm using (29k and 88k) don't seem to
+ set it. Ths patch to fcn_last_line and (enter_linenos) is an
+ attempt to use the actual size of the linno table in the file to set
+ the number of linenos to process.
+
+Tue Nov 5 22:47:46 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * Makefile.in: put a - infront of the mv y.tab.c c-exp.tab.c and
+ mv y.tab.c m2-exp.tab.c, so that if bison is used, and the files
+ are created in place, so the mv fails, then the make continues.
+
+Tue Nov 5 16:47:47 1991 Per Bothner (bothner at cygnus.com)
+
+ Add C++ as a separate language.
+ * defs.h (enum language): Add language_cplus.
+ * dwarfread.c (end_symtab): Support language_cplus.
+ * c-exp.y: Add new struct language_defn cplus_language_defn.
+ Don't set c to be the default language (see main.c).
+ * c-exp.y (yylex): Only look for field of this if
+ language is C++. (First difference from C!)
+ * language.c: Add case branches for C++ (currently, all
+ the same as C). Also, add c++ to "usage" note for "set lang".
+ * valprint.c (typedef_print). Add case branches for C++.
+ * main.c (main): New way to set initial language: Look at
+ file extension of psymtab containing main(). (Same as we
+ do for symtabs, but avoid loading the symtab yet.)
+ * symtab.c: New routine find_main_psymtab(), used by main()
+ to set initial language.
+ * symfile.c (allocate_symtab): Move code for mapping file
+ extensions-> languages to new deduce_language_from_filename().
+
+ Fix a C++ problem when looking for methods in super-classes.
+ There was confusion between base and derived types.
+ * valops.c (value_fn_field): Change function interface.
+ * values.c: Use new value_fn_field interface.
+
+Mon Nov 4 10:49:33 1991 Per Bothner (bothner at cygnus.com)
+
+ * infrun.c: Fixed typo in comment.
+ * utils.c: All the v*fprintf emulation is now in libiberty,
+ so we can get rid of some junk.
+ * xm-sun3os4.h, xm-sun4os4.h, xconfig/decstation, xconfig/i386sco,
+ xconfig/sun3os4, xconfig/sun4os4: Don`t need HAVE_STRSTR any more.
+ * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL
+ type operands, as used by branch instructions.
+ * gmalloc.c: Fix prototype of memcpy.
+ * elfread.c: Comment out register_addr, since it conflicts
+ with the one in coredep.c.
+ * buildsym.h: Remove extern declarations of two functions
+ that are really static in buildsym.c.
+ * tm-mips.h: Add symbolic names for more registers.
+ * mips-xdep.c (store_inferior_registers): Use new register names.
+ * xm-mips.h: Simplify REGISTER_U_ADDR, since it is now
+ only used for core files, not ptrace. Therefore,
+ the KERNEL_U_ADDR hack is no longer needed.
+ The mapping to ptrace number is now in in mips-xdep.c.
+ * mips-xdep.c: Define REGISTER_PTRACE_ADDR (using the
+ mapping from the old REGISTER_U_ADDR), and use it
+ in {fetch,store}_inferior_registers.
+ * mipsread.c: Rename #include ecoff.h to new name coff-mips.h.
+ * mips-tdep.c (mips_push_dummy_frame, mips_pop_frame):
+ Save/restore FP regs correctly (?).
+ * dbxread.c: Remove duplicate define_symbol and type_synonym_name
+ (these had been previously moved to buildsym.c).
+ Hence, define_symbol becomes extern instead of static.
+ * buildsym.c (read_struct_type): Comment out bogus handling
+ of C++ operator methods. Minor hacking of reading of class
+ contexts. Make define_symbol non-static, so dbxread.c can call it.
+
+Fri Nov 1 11:05:47 1991 John Gilmore (gnu at cygnus.com)
+
+ * mipsread.c (read_mips_symtab, read_the_mips_symtab): Use real
+ filename with error messages.
+ * stack.c (frame_select_command): Rename to select_frame_command
+ to avoid "fr" and "fra" having nonunique completions.
+ * symfile.c (sort_symtab_syms): Ignore sort of zero symtab *.
+ (symfile_init): Print file format name when unable to handle it.
+ (free_named_symtabs): Use BLOCKVECTOR rather than obsolete BLOCKLIST.
+ * symmisc.c (free_symtab): Only free linetable if nonzero.
+ * symtab.h: Remove obsolete BLOCKLIST macros.
+
+Thu Oct 31 18:12:43 1991 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): another stepi/nexti fix. Ensure
+ that stop_step is 1 at bottom of main loop. I don't know why this
+ needs to be done, but it helps me sleep better at night.
+
+Sun Oct 27 18:18:39 1991 Stu Grossman (grossman at cygnus.com)
+
+ * main.c (initialize_history): Read history after reading all
+ init files.
+
+Sun Oct 27 14:09:25 1991 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c: Break out initial malloc sizes.
+ (record_line): Record directly in a subfile. Alloc on demand.
+ (compare_line_numbers): Add from xcoffread.c.
+ (end_symtab): New params say whether to sort pendings and
+ linetable. Patch block stabs if defined. Shrink linetable before
+ allocating the symtab.
+ * buildsym.h: Delete line_vector* and prev_line_number. Add
+ global_stabs and file_stabs for xcoffread.
+ * dbxread.c (start_subfile): Move to buildsym. Change above calls.
+ * symtab.h: LINETABLE(symtab) can now be null. Zap LINELIST.
+ * symmisc.c, symtab.c: Cope with null LINETABLEs.
+
+ * blockframe.c: Pass fromleaf to INIT_EXTRA_FRAME_INFO.
+ * tm-29k.h, tm-88k.h, tm-i960.h, tm-irix3.h, tm-mips.h, tm-pyr.h,
+ tm-sparc.h: Accept fromleaf parameter.
+ * c-exp.y (yyerror): Pass error message if given.
+ * configure.in: Add rs6000 host and target.
+ * inflow.c (new_tty): O_NOCTTY kludge for RS/6000.
+ * symfile.h (entry_point): Add.
+
+Sat Oct 26 00:16:32 1991 John Gilmore (gnu at cygus.com)
+
+ * buildsym.c: New file. Breaks out symbol-table-building routines
+ from dbxread.c, so they can be shared with xcoffread.c.
+ * buildsym.h: New file. Declarations for buildsym.c users.
+ * dbxread.c: Remove large chunks into buildsym.c.
+ * Makefile.in: Add buildsym.c and buildsym.h.
+
+ * symfile.c (syms_from_bfd): New routine.
+ (add_symbol_file): Call it to do the real work.
+ (syms_from_bfd): Initialize entry_point before calling symfile_init.
+ * symtab.h, symfile.c, coffread.c, mipsread.c, dwarfread.c:
+ Avoid declaring or setting entry_point (symfile.h & symfile.c cope).
+
+Fri Oct 25 10:58:16 1991 Mark Eichin (eichin at cygnus.com)
+
+ * cplus-dem.c (cplus-demangle): added support for templates, static
+ data, and the new (correct) mangling for destructors.
+
+ * dwarfread.c: (dwarfwarn): created a varargs version of
+ dwarfwarn, for non __STDC__ compilers.
+
+ * c-exp.y: (yylex): added match for "template" token.
+ (typebase): added TEMPLATE name '<' type '>' clause, for explicit
+ specification of template types.
+
+ * symtab.c: (lookup_template_type): new function for finding
+ templates in symbol table.
+ (type_name_no_tag): changed to explicitly check for s/u/e at the
+ beginning of the symbol - if it is a template, none of these will
+ be there (but the name will still contain spaces.)
+
+Fri Oct 25 18:59:32 1991 Per Bothner (bothner at cygnus.com)
+
+ Various fixes to improve g++ debugging.
+ * symtab.h: Add is_const and is_volatile flags for each method.
+ These are bit fields - take their space from voffset,
+ which shrinks to 30 bits. Since voffset is now a bitfield,
+ make it unsigned for portability. This changes its interpretation
+ slightly: Static methods now have voffset 1 instead of -1,
+ and virtual offsets start at 2, not 1.
+ * symtab.c: Renamed gdb_mangle_typename to gdb_mangle_name,
+ since it now returns an entire magled method name, not just
+ the type part. This avoids some duplication.
+ It also allows us to correctly mangle const and volatile
+ methods (using the new is_const and is_volatile bit fields
+ mentioned above).
+ * valprint.c (type_print_base), values.c (check_stub_method):
+ Simplify by using new gdb_mangle_name.
+ * values.c (value_headof): Fix to correctly handle single
+ inheritance (actually two fixes, either of which suffices).
+ * dbxread.c (read_struct_type): Handle const and volatile
+ method specifiers.
+ * dbxread.c (read_struct_type): Yet one more place where
+ we must handle '\\' continuations.
+ * valprint.c (vtbl_ptr_name): Add final '\0'.
+
+Fri Oct 25 16:06:38 1991 Stu Grossman (grossman at cygnus.com)
+
+ * tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE): fix output of
+ short return values for sparc and 68k. Patch from Paul Eggert.
+
+ * coffread.c, coredep.c, i386-xdep.c: install patches for
+ SysV/386 3.2 from Mauro DePalma.
+
+Fri Oct 25 02:02:13 1991 John Gilmore (gnu at cygnus.com)
+
+ * core.c (core_file_info), exec.c (exec_file_info): Print file
+ type. Use printf_filtered.
+
+ * valops.c (value_fetch_lazy): Avoid 0-length fetches.
+
+Thu Oct 24 23:06:40 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c: Add casts to remove compiler warnings.
+
+ * tm-3b1.h, tm-68k.h, tm-altos.h, tm-amix.h, tm-hp300bsd.h,
+ tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-pn.h, tm-sun2.h,
+ tm-sun3.h: Remove locally duplicated code for calling functions
+ in the inferior. The only differences were in the specific trap
+ vectors used and whether or not an fpu was present. These are
+ now handled by appropriate definitions of BPT_VECTOR and
+ HAVE_68881 respectively. Other minor obvious cleanups.
+
+ * valops.c: Correct a minor misspelling.
+
+ * utils.c: Remove local BSD/USG hacks that are now in libiberty.
+
+ * dwarfread.c: Remove prototype for dwarfwarn. Does not work
+ with <varargs.h>.
+
+Thu Oct 24 09:33:44 1991 John Gilmore (gnu at cygnus.com)
+
+ * stack.c (frame_command): Always print. Use new
+ frame_select_command to select a frame without printing.
+
+ * dwarfread.c: Use <varargs.h>, since <stdarg.h> is not portable.
+
+Thu Oct 24 01:32:51 1991 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c: New file for DWARF debugging format support.
+
+ * elfread.c: New file for ELF object file format support.
+
+ * procfs.c: New file for SVR4 /proc (process file system) support.
+
+ * tm-amix.h, xm-amix.h, tconfig/amix, xconfig/amix: New files for
+ Amiga UNIX support.
+
+ * xm-svr4.h, tm-svr4.h: New files for SVR4 support.
+
+ * xm-m68k.h: New file for host machines with m68k cpu.
+
+ * Makefile.in: Add elfread.c and dwarfread.c to SFILES_MAINDIR.
+ Add elfread.o and dwarfread.o to OBS.
+
+ * symfile.h: Add "elf" to list of supported formats in comment.
+
+ * c-exp.y, defs.h, symtab.h, valprint.c: Add three new builtin
+ types to gdb, builtin_type_long_double, builtin_type_complex, and
+ builtin_type_double_complex. Add and use new TARGET_SHORT_BIT,
+ TARGET_INT_BIT, TARGET_LONG_BIT, TARGET_FLOAT_BIT,
+ TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_COMPLEX_BIT, and
+ TARGET_DOUBLE_COMPLEX_BIT, as the sizes in bits of the indicated
+ types on the target machine (ala the existing TARGET_LONG_LONG_BIT).
+
+ * infrun.c: When using SVR4 /proc interface instead of ptrace(),
+ call proc_set_exec_trap() to setup child to stop at first instruction.
+
+ * inftarg.c: When using SVR4 /proc interface, call proc_wait()
+ rather than wait().
+
+ * m68k-tdep.c: Add new routines supply_gregset(), fill_gregset(),
+ supply_fpregset(), and fill_fpregset(), which are machine
+ dependent support routines for SVR4 /proc interface.
+
+ * utils.c: Add warning_setup() and warning(). Warning() behaves
+ the same as error() except that it returns normally rather than
+ jumping back to command level. Modules that don't want to call
+ warning() for some reason, but want to produce their own warnings,
+ can call warning_setup() to ensure compatibility with the way
+ warning() and error() deal with the terminal.
+
+ * symtab.c: Make internal errors produce more useful messages.
+
+ * tm-68k.h: Move code that is duplicated in almost every single
+ m68k based machine's configuration files to this common file.
+ Duplications in the configuration files still need to be removed
+ (FIXME).
+
+ * infrun.c (child_create_inferior): System V versions must call
+ setpgrp() with no arguments, to comply with prototyping typically
+ in <unistd.h>.
+
+ * munch: Add support for SVR4 style nm output.
+
+ * dbxread.c, mipsread.c symmisc.c, symtab.c: Remove the object
+ file specific fields from the partial symbol table structure and
+ replace them with a pointer to private data for each different
+ flavor of object file reader to initialize appropriately.
+
+Wed Oct 23 09:38:20 1991 John Gilmore (gnu at cygnus.com)
+
+ * xconfig/sun[34]os4: Add note about strstr botch on sunos4.0.3c
+ and previous.
+
+ * mipsread.c (fixup_undef_type): New function. If a struct /
+ union / enum is defined in a header file but nowhere else used,
+ (by typedefing, pointer referencing or declaration) the mipsread code
+ builds the complete tree for the structure but leaves its code as
+ TYPE_CODE_UNDEF as it doesn't know what kind of aggregate it is.
+ Guess its type based on the details of the members.
+
+Tue Oct 22 18:04:32 1991 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): Check return value from
+ find_pc_line.
+
+Mon Oct 21 17:47:03 1991 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): fix stepi/nexti that was broken
+ by my last edit to this routine.
+
+Mon Oct 21 14:27:43 1991 John Gilmore (gnu at cygnus.com)
+
+ * tm-sun3.h (FIX_CALL_DUMMY): problem with cross debugging.
+ FIX_CALL_DUMMY does unaligned accesses and/or forgets to byte swap
+ the values before putting them into the dummy code. (From Peter
+ Schauer)
+
+Mon Oct 21 10:04:39 1991 Steve Chamberlain (steve at rtl.cygnus.com)
+
+ * configure.in: added ebmon target.
+
+Wed Oct 16 22:49:58 1991 John Gilmore (gnu at cygnus.com)
+
+ GDB-4.2 release!
+
+ * Makefile.in: Roll VERSION to 4.2.
+ * README, TODO, WHATS.NEW: Update.
+
+ * core.c (core_open): Improve error message for bad file.
+ Pass .reg virtual memory address to fetch_core_registers to help
+ it find the registers in the core-file header.
+ * coredep.c (fetch_core_registers): Take new argument, use it,
+ and pass it to register_addr to locate the block of registers.
+ * xm-mips.h: Update KERNEL_U_ADDR for new scheme. Cleanup a bit.
+
+ * dbxread.c (read_dbx_symtab, process_one_symbol): Handle
+ Sequent N_FN_SEQ like everybody else's N_FN.
+
+ * main.c: Circumvent SCO cc bug with #if !!defined(USG).
+ * tm-i386v.h: #endif guck.
+ * xconfig/i386*: Remove -Dgetpagesize()=4096 kludge.
+ * xconfig/i386sco: Add HAVE_STRSTR to avoid ANSI bdeath.
+ * xconfig/tahoe: Add REGEX, which seems to be missing.
+
+ * coredep.c: Add <sys/types.h> for SCOnix.
+ * dbxread.c (read_dbx_symntab): Avoid coredump on malformed file.
+ * printcmd.c (print_formatted): Flush output before disassembly.
+
+Tue Oct 15 20:12:32 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * doc/refcard.tex (sec "Working Files"): consistent metavars and
+ other improvements, due to comments by François Pinard
+ (pinard@iro.umontreal.ca)
+
+ * doc/gdb.texinfo (appendix "Installing GDB"): changes in
+ configure, and improvenets related to Pinard's refcard comments
+
+Tue Oct 15 08:45:12 1991 John Gilmore (gnu at cygnus.com)
+
+ Changes from Fred Fish:
+ * tm-68k.h (FPI_REGNUM): Add.
+ * infrun.c (child_create_inferior): flush stdout and stderr
+ before forking.
+ * configure.in: Handle amigados, amix hosts and targets.
+ * inflow.c: Handle TIOCGLTC_BROKEN for Amiga.
+
+ From Andreas Schwab:
+ * values.c (show_convenience): Use printf_filtered.
+ * main.c (define_command): Check result of lookup_command for
+ exact match.
+ (echo_command): Use printf_filtered, and force output out.
+
+ * dbxread.c (read_enum_type): Avoid Modula-2 kludge that breaks C
+ programs.
+ * i387-tdep.c (double_to_i387): Fix typo for double_to_ieee_extended.
+ * utils.c (_initialize_utils): If !ISATTY, don't paginate.
+ * configure.in, tconfig/decstation, xconfig/decstation: Rename
+ dec3100 to decstation.
+
+Mon Oct 14 13:37:50 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/gdb.texinfo: Catch up to changes recorded here in ChangeLog
+ (nodes Continuing and Stepping; Memory; Targets) clarifications
+ due to Larry Breed
+
+Fri Oct 11 23:27:06 1991 John Gilmore (gnu at cygnus.com)
+
+ * tm-{irix3,mips,nindy960,pn,symmetry,vx960}.h: Move
+ REGISTER_U_ADDR to corresponding xm- file. Sugg. by Peter Schauer.
+
+ * symmisc.c (print_partial_symtabs): Add printpsyms debug cmd.
+
+ * m68k-tdep.c (m68k_push_dummy_frame, m68k_pop_frame): Add
+ generic routines for calling inferior functions.
+
+ * blockframe.c (inside_main_scope, inside_entry_scope): New.
+
+ * copying.awk: Filter formfeeds out of copying & warrantee.
+ Make them available as `show copying' and `show warrantee' also.
+ * main.c (print_gnu_advertisement): Advt `show' commands.
+
+Thu Oct 10 17:25:47 1991 John Gilmore (gnu at cygnus.com)
+
+ * mach386-xdep.c: Even when cross-compiling, leave in the
+ core-file reading code.
+ * core.c (get_core_registers): Avoid coredump if no .reg section.
+
+Wed Oct 9 17:03:34 1991 John Gilmore (gnu at cygnus.com)
+
+ * mipsread.c, coffread.c: initialise TYPE_VPTR_FIELDNO to -1.
+ This avoids coredumps under `set print object on' in value_headof
+ (called erroneously by value_from_vtable_info) for `p &struct'
+ or `p *struct'. From Peter Schauer.
+
+Mon Oct 7 00:06:52 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll version to 4.1.2.
+ * dbxread.c: Use aout64.h, not a.out.gnu.h. Get external symbol entry
+ size from BFD (but, FIXME, we don't yet read external nlists's and
+ convert them to internal nlists's before handling them -- we still
+ assume they have the same size and alignment.) Use SET_NAMESTRING
+ everywhere useful.
+ * exec.c (exec_file_command): Move dead coff-encapsulation code
+ to BFD.
+ * m88k-tdep.c, m88k-xdep.c: Remove encap test and #inc <a.out.h>.
+
+Fri Oct 4 22:30:06 1991 John Gilmore (gnu at cygnus.com)
+
+ * configure.in, tm-i386v.h, xm-i386v.h: Intel 386 Mach host port.
+ * xm-i386mach.h, mach386-xdep.c, xconfig/i386mach: New files.
+
+Fri Oct 4 17:04:31 1991 Per Bothner (bothner at cygnus.com)
+
+ More patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * mips-xdep.c (store_inferior_registers): Don't try to
+ write the (pseudo) FP.
+ * mipsread.c (parse_partial_symbols): Improved algorithm for
+ setting pst->texthigh.
+
+Fri Oct 4 16:47:32 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/Makefile: make TEXINPUTS include . everywhere
+
+Fri Oct 4 00:35:56 1991 John Gilmore (gnu at cygnus.com)
+
+ * coffread.c, dbxread.c, symfile.c, symmisc.c, symtab.h: Remove
+ vestiges of typevectors, which were for symsegs and are no longer
+ used. (From a question by Eliot Dresselhaus
+ <dresselh@RFT30.nas.nasa.gov>).
+
+Thu Oct 3 09:33:26 1991 John Gilmore (gnu at cygnus.com)
+
+ * dbxread.c, coffread.c: static-ize functions that were
+ gratuitiously external. (From Fred Fish.)
+
+ * c-exp.y: sym->class to SYMBOL_CLASS (sym).
+
+ * dbxread.c (dbx_lookup_type): Keep doubling size of typevector
+ until it is large enough.
+
+ * dbxread.c (read_type): Handle error case slightly better.
+ Make complaint message not C++-specific.
+
+Wed Oct 2 17:21:07 1991 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): Fix step/next so that you only
+ stop at the beginning of a new line. This fixes various problems
+ with for loops, nested if-else's and switch statements.
+
+Tue Oct 1 06:33:55 1991 John Gilmore (gnu at cygnus.com)
+
+ * symtab.c (lookup_symtab_1, lookup_symbol): "fatal" errors
+ between symtabs and psymtabs become ordinary error()s.
+
+ * dbxread.c (read_dbx_symtab): Relocate end_of_text_addr
+ properly, making "end pc" correct in shared lib psymtabs.
+ (From Guy Harris <guy@auspex.com>.)
+
+Mon Sep 30 13:15:31 1991 John Gilmore (gnu at cygnus.com)
+
+ * dbxread.c: Enable, but soften, const_vol_complaint.
+ (read_dbx_symtab): N_STSYM and N_LCSYM define static vars.
+ Ditto Gould N_NBSTS and N_NBLCS. Also, all types in the psymtab
+ should be file-scope, not global.
+ (read_struct_type): Remove ancient multiple-inheritance warning.
+ (read_range_type): Check base type, complain & patch if undefined.
+ * stack.c (frame_info): Demangle the function name in `info stack'.
+ (From Peter Schauer)
+
+Sat Sep 28 10:02:33 1991 John Gilmore (gnu at cygnus.com)
+
+ * eval.c (evaluate_subexp_for_address): Don't use
+ TYPE_POINTER_TYPE directly (it might be zero if this type has
+ never had a pointer created before); use lookup_pointer_type.
+ * symtab.c (lookup_method_type): Arguments were swapped in all
+ callers, so fix it here. I'm amazed this worked at all!
+
+Fri Sep 27 18:09:31 1991 John Gilmore (gnu at cygnus.com)
+
+ * c-exp.y, m2-exp.y: Define more yysymbols that happen to be
+ "bss" rather than "data" symbols, but which still conflict.
+ * m2-exp.y: Lint.
+
+ * coffread.c (coff_symfile_read): Use xmalloc, not malloc.
+ * core.c (core_files_info): Shorten output.
+ * exec.c (exec_files_info): Ditto.
+ (build_section_table): Ignore zero-length sections.
+ * language.c, printcmd.c: Lint.
+ * language.h (get_frame_language): Declare.
+ * saber.suppress: update.
+ * stack.c (find_relative_frame): Remove complex code that was
+ #if 0'd, stick with simple code. Lint.
+ * saber.suppress: Update a bit.
+ * symfile.c (add_symbol_file_command): Add "?" to question.
+ * utils.c (parse_escape): Avoid \a due to bdead compilers.
+ * value.h: Declare typedef_print.
+
+ * valprint.c (val_print, type_print_base): TYPE_CODE_RANGE less
+ kludgey.
+
+ * nindy-tdep.c (nindy_frame_chain_valid): Use lookup_misc_func.
+ (Reported by Mark Peek <mark@imagen.com>.)
+
+ * solib.c (solib_map_sections): Relocate all sections, even
+ though only the text section's size is tracked. Mark ld_text
+ for eventual elimination as we generalize to N sections.
+
+ * infrun.c (wait_for_inferior): Don't check if the PC is in a
+ call_dummy if we were stopped by a random signal that is being
+ passed to the program. This produced wierd results when calling
+ functions in the inferior and signals (e.g. SIGALRM) were in use.
+
+Tue Sep 24 18:05:30 1991 John Gilmore (gnu at cygnus.com)
+
+ * infrun.c (IN_SIGTRAMP): Not parenthesized properly.
+ Bugfix from Paul Eggert <eggert@twinsun.com>.
+ * tm-ultra3.h (IN_SIGTRAMP): Ditto.
+ * valprint.c (print_floating): Print 9 digits for IEEE floats.
+ From Paul Eggert.
+
+Mon Sep 23 15:50:07 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll VERSION to 4.1.1.
+ * source.c (line_info): Peter Schauer fixes a bug I introduced in
+ hex conversion.
+
+Fri Sep 20 16:10:52 1991 John Gilmore (gnu at cygnus.com)
+
+ GDB-4.1 release!
+
+ * Makefile.in (VERSION): Set to 4.1.
+ * language.c (set_language_command): Print useful help message,
+ and restore the language string after giving help.
+ * valprint.c (typedef_print): Print typedef in C or M2.
+ * symtab.c (list_symbols): Use it.
+ * main.c (main): Avoid any output before (gdb) prompt when -q.
+ * language.c (set_language_command): Handle errors by restoring
+ the language string to its current state (fix from A. Beers).
+ * doc/gdbint.texinfo: Roll in information from README. Rearrange
+ "how to install" and "how to print the doc" stuff so it drops
+ easier into README.
+ * configure.in: Rename rtpc CPU to romp to match config.sub.
+ * README, WHATS.NEW, TODO: Update for gdb-4.1.
+
+Fri Sep 20 17:39:14 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/gdb.texinfo: Updates from ChangeLog. set/show write,
+ autoloading shared libs, copyright etc on GDB startup, clean up $_
+ and $__ index refs, set/show listsize and related updates to list
+ cmd. New host/target configs.
+
+Fri Sep 20 15:46:00 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/Makefile: generate aux version-no file doc/gdbVN.m4
+ from main Makefile.in version definition
+ doc/gdb.texinfo: use version recorded in doc/gdbVN.m4 for current
+ GDB version no refs
+ Makefile.in (setup-to-dist): generate doc/gdbVN.m4
+
+ * doc/gdb.texinfo: merge new language-switching and lang-specific
+ doc by Andrew Beers
+
+Fri Sep 20 15:00:57 1991 Per Bothner (bothner at cygnus.com)
+
+ * mcheck.c: Add __ONEFILE kludge to allow compilation by non-ANSI
+ compilers (which may lack stddef.h).
+
+Fri Sep 20 13:29:42 1991 John Gilmore (gnu at cygnus.com)
+
+ * dbxread.c (read_dbx_symtab, process_one_symbol): N_FN and
+ N_WARNING are the same except for the N_EXT bit, so just use their
+ values alone, rather than OR-ing them with N_EXT.
+
+Fri Sep 20 12:27:55 1991 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c (parse_lines): Deal with negative extended line
+ offsets correctly.
+
+ * c-exp.y, m2-exp.y: #define yyerrflag and yynerrs to avoid
+ global symbol conflicts.
+
+Fri Sep 20 02:28:15 1991 John Gilmore (gnu at cygnus.com)
+
+ * .gdbinit: Move 'set complaints' to top, so it runs even in
+ case we aren't debugging GDB.
+ * language.c (_initialize_language): Fix type check and range
+ check documentation strings.
+ * utils.c (!HAVE_VPRINTF): Define vfprintf as a function, so
+ language.c can use it. (Though language.c should really not be
+ handling warnings/errors the way it does, FIXME.)
+ * symtab.c (lookup_primitive_type): const lint.
+
+ Bugfix from Peter Schauer:
+ * source.c (lines_to_list): Make signed, to avoid comparison
+ going unsigned and complaining that -3 is too high for 21 lines.
+ * stack.c (lines_to_list): Ditto.
+
+Thu Sep 19 23:33:41 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in (HFILES): Add minimon.h.
+ (VERSION): Roll version number to 4.0.95.
+ (gdb.tar.Z, make-proto-gdb.dir, setup-to-dist, gdb-XXX.tar.Z):
+ New rules for building distributions. Normal distribution
+ is built by doing `make -f Makefile.in gdb.tar.Z' in the directory
+ one level up from here; it calls make-proto-gdb.dir to build a
+ directory `proto-gdb' which is an image of the release. The old
+ `gdb.tar.Z' rule still works too.
+ * config.sub, configure: Roll in latest from ..
+
+Thu Sep 19 17:41:24 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * doc/gdbint.texinfo: Reorder contents; reorganize new-host,
+ new-target, and new-config chapters; fix minor typos; come closer
+ to usual GNU markup conventions for @file @samp @code @var.
+
+Thu Sep 19 17:04:12 1991 Per Bothner (bothner at cygnus.com)
+
+ Patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * mipsread.c (parse_partial_symbols): Enter the name of all
+ structs/unions... into the psymtab so we can access them if the
+ symtab is not read in.
+ * mips-tdep.c: Remove some unneeded #includes.
+ * xconfig/dec3100: Add HAVE_STRSTR.
+
+Thu Sep 19 15:14:23 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Circumvent Sun Make bug on *-exp.tab.o.
+ * c-exp.y, m2-exp.y: Lint.
+ * m2-exp.y: Avoid using yytname[] which is a Bison-ism.
+ * valprint.c (val_print_fields): Check for stub type.
+ * mipsread.c (_initialize_mipsread): Avoid using
+ builtin_type_void at initialize time.
+ (mipscoff_symfile_read): use it now.
+
+Wed Sep 18 15:55:51 1991 John Gilmore (gnu at cygnus.com)
+
+ Merge multiple-language support, and partial Modula-2 support,
+ from Andrew Beers <beers@cs.buffalo.edu>.
+
+ * i387-tdep.c: New file, consolidates most 80387 support,
+ and eliminates host dependency on double<->extended conversions.
+ * i386-xdep.c, symm-xdep.c: Remove most 387 support.
+ * xconfig/i386{sco,v,v-g,v32,v32-g}: Now need i387-tdep.o.
+
+ * symfile.c (allocate_symtab): New fn, consolidates the work
+ of allocating and initializing a new struct symtab. Set the
+ language of the symtab based on its filename extension.
+ * symfile.h: Declare it.
+ * mipsread.c (new_symtab): Use it. Minor formatting changes.
+ * dbxread.c (end_symtab): Use it.
+
+ * mipsread.c (parse_symbol, case stParam and stProc): Add #if 0'd
+ code for saving types of parameters with each function definition.
+ * dbxread.c (define_symbol, function and parameter cases): Ditto.
+ (read_dbx_symtab, case N_DEFD): Ignore.
+ (read_enum_type): Recognize FALSE/TRUE enum as Modula-2 BOOLEAN.
+ (read_range_type): Rename MAX_OF_TYPE to MAX_OF_C_TYPE, etc.
+ #if 0 out its uses, though, since they set a dead value.
+ * coffread.c (end_symtab): Use allocate_symtab.
+ (process_coff_symbol): #if 0'd for functions and params as above.
+ (read_enum_type): Recognize Modula-2 BOOLEAN.
+ * symtab.c (add_param_to_type): #if 0'd function to add a
+ parameter type to a function type's field list.
+
+ * defs.h (local_hex_format, local_hex_string, *_custom): Add.
+ * i386-xdep.c, pyr-tdep.c, pyr-xdep.c, remote-vx.c, solib.c,
+ source.c, symfile.c, dbxread.c, breakpoint.c, core.c, exec.c,
+ i387-tdep.c, infcmd.c, mips-tdep.c, stack.c, printcmd.c: Output
+ hex with local_hex_string for Modula-2 support.
+
+ * breakpoint.c (breakpoint_cond_eval): Use new value_true to test
+ breakpoint condition language-independently.
+
+ * parse.c: New file with the common code remains of expread.y.
+ * parser-defs.h: New file with common declarations from expread.y.
+ * c-exp.y: New file with the C parser from expread.y, and other
+ language-specific information.
+ * m2-exp.y: New file with the Modula-2 parser and etc.
+ * expread.y, expread.tab.c: Remove.
+ * breakpoint.c, eval.c, printcmd.c, expression.h: Use
+ parse_expression and parse_exp_1 rather than parse_c_expression
+ and parse_c_1.
+
+ * symtab.h (enum languages): Move to defs.h.
+ (enum type_code): Add TYPE_CODE_CHAR and TYPE_CODE_BOOL.
+ Declare Modula-2 builtin types.
+ Add MAX_OF_TYPE and MIN_OF_TYPE macros.
+
+ * symtab.c (_initialize_symtab): Remove builtin type
+ definition and initialization to *-exp.y.
+ (lookup_primitive_typename): Use language-dependent vector.
+ (lookup_typename): Fix bug, make it work if primitive typename.
+ (lookup_unsigned_typename): Call above.
+ (create_array_type): Set up range type for array index.
+ (list_symbols): Call typedef_print to print typedefs.
+
+ * values.c (unpack_long, value_from_longest): Handle
+ TYPE_CODE_BOOL and TYPE_CODE_CHAR.
+
+ * expression.h (enum exp_opcode): Add Modula-2 specific opcodes.
+ * expprint.c: Look up expression opcodes in language-specific
+ table, based on expression's language. Handle some Modula-2
+ specific opcodes.
+
+ * stack.c (frame_info): Print language of stack frame.
+ (select_frame): Also select language, if in auto-mode.
+ (get_frame_language): New subroutine.
+ * main.c (execute_command): Warn as language changes automatically.
+
+ * printcmd.c (ptype_command): Parse types using the language
+ parser, both for language-independence, and so that scopes can
+ be specified.
+
+ * language.h, language.c: New files for language-specific macros,
+ declarations, and definitions.
+
+ Misc fixes:
+
+ * main.c (main): If error() is called during early
+ initialization, print its message and then exit(1) from GDB.
+
+ * valprint.c (type_print_base): Avoid printing garbage for ints
+ of unusual sizes.
+ (_initialize_valprint): Warn about host/target size assumption;
+ improve long long support slightly.
+
+ * convex-tdep.c (comm_registers_info): Avoid parsing decimal and
+ hex -- let parse_and_eval_address do it.
+
+ * doc/gdbint.texinfo (Languages): Doc how to add a language.
+
+ * Makefile.in: Cope with new files and removed files.
+
+Tue Sep 17 08:37:41 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Add Andrew Beers' changes for Modula-2 support. His ChangeLog
+ entries are enclosed herein. Not all of these changes
+ have been merged into the master GDB sources -- check the
+ ChangeLog above here for the merge log.
+
+Mon Jun 3 17:05:45 EDT 1991
+
+ m2-exp.y Created. Tested outside of GDB for a few days. Proper
+ operators were added, C specific operators and tokens
+ removed. yylex() revamped to some extent. Still things
+ missing from the grammar, such as sets.
+ Tested for two weeks in GDB v3.5.
+
+Tue Jun 11 17:23:48 EDT 1991
+
+ m2-exp.y Added boolean constants TRUE and FALSE to the grammar
+ so they are built-in. Sort of a hack.
+
+Fri Jun 14 12:53:51 EDT 1991
+
+ m2-exp.y Added range checking for numeric constants. Any numeric
+ constant is assumed to be of builtin type INTEGER unless:
+ (1) it is octal or hexadecimal, in which case it is a
+ CARDINAL; (2) it is too big to fit into an INTEGER, in
+ which case it is a CARDINAL.
+ eval.c Added simple range checking for +, -, and * on integers.
+ Doesn't work very well for *, since 6 * 1,000,000,000 =
+ 1,705,032,704, which fails the simple test of result >=
+ first_operand, no matter in what order the operands are.
+
+Tue Jun 18 14:11:30 EDT 1991
+
+ Broke the parser into parts, one containing the C grammar and the other
+ containing code to be shared by all of the grammars.
+
+ The following files no longer exist:
+
+ expread.y
+ expread.tab.c
+
+ The following files were added:
+
+ c-exp.y (The C grammar)
+ m2-exp.y (The Modula-2 grammar)
+ parser-code.c (Code that is shared by the above grammar)
+ parser-code.h
+ parser-defs.h
+
+ Makefile.dist Changed to reflect the above dependencies. NOTE: It is
+ now necessary to use the Bison compiler compiler, since it
+ will generate function/variable prefixes other than yy.
+
+Tue Jun 18 16:47:49 EDT 1991
+
+ symtab.[ch] Added the external variable working_lang, than holds the
+ value of the current working language.
+ Added the ennumerated type language_mode, with the values
+ language_auto and language_manual, the former meaning that
+ GDB sets working_lang as needed, and the latter meaning
+ that the value of working_lang is totally under user
+ control.
+ symtab.[ch] Added the Modula-2 pervasive types INTEGER, CARDINAL,
+ REAL, BOOLEAN and CHAR. Also added the type codes
+ TYPE_CODE_BOOL and TYPE_CODE_CHAR.
+ utils.c Added set_language_command and show_language_command to
+ implement the GDB support commands "set language" and
+ "show language".
+ expression.h A number of identifiers were added to the type exp_opcode
+ to facilitate Modula-2 builtin functions, integer
+ division, and array indexing.
+
+Wed Jun 19 13:25:58 EDT 1991
+
+ language.h Added the macro STRICT_TYPE, which evaluates to non-zero
+ if the language specified by working_lang requires the use
+ of strict typing of expressions. Eventually, even this
+ will be able to be changed by the user.
+ Added the macro RANGE_CHECK, which evaluates to non-zero
+ if the language specified by working_lang requires the
+ checking of a value against the domain of its type.
+ Eventually, even this will be able to be changed by the
+ user.
+ language.[ch] Predicates involving types (simple_type, ordered_type,
+ same_type, integral_type, numeric_type, character_type,
+ boolean_type, float_type) are added. These predicates are
+ based on the current value of working_lang, and are handy
+ in type-checking.
+
+Wed Jun 19 15:39:34 EDT 1991
+
+ eval.c Added the function type_array_rank which computes the rank
+ of an array type.
+ valarith.c Added the funtion value_bool, which when given a integer
+ value.h value (ie. struct value *) as an argument, it returns a
+ boolean value (ie. struct value *) true if that integer
+ is non-zero, and a boolean value false otherwise.
+ valprint.c Added cases for TYPE_CODE_BOOL, so Modula-2 BOOLEAN values
+ will print out properly.
+
+Wed Jun 19 16:36:34 EDT 1991
+
+ valops.c Added the function value_capitalize, which returns it
+ value.h argument capitalized if its argument is a lowercase
+ letter, or the argument unchanged if its argument is not a
+ letter.
+ valarith.c Added the function range_check_p, which returns non-zero
+ value.h if its value argument is between the integral bounds upper
+ and lower.
+ Added the function range_check_enum_p, which makes sure
+ that its value argument is a valid member of the domain of
+ its type argument.
+ Added the function range_check_range_p, which makes sure
+ its value argument lies between the upper and lower bounds
+ of its type argument, which must be a ranged type.
+ Added the function check_array_index, which range and type
+ checks an index of an array.
+ Added the function value_multi_subscript, which computes
+ array[idx1,idx2...idxN], given a value array and an array
+ of values representing indicies.
+ values.c Changed value_from_long to work with TYPE_CODE_CHAR and
+ unpack_long to work with TYPE_CODE_BOOL and
+ TYPE_CODE_CHAR.
+
+Wed Jun 19 18:04:08 EDT 1991
+
+ symtab.c Stored pervasive types in a structure and make
+ lookup_pervasive_type() a lookup function that was based
+ on working_lang. If lookup_pervasive_type() returned
+ non-zero, then that value was returned (a fix, since
+ before it simply wouldn't return the pervasive type.)
+ language.h Added the macro CAST_IS_CONVERSION, which evaluates to
+ non-zero if the language specified by working_lang means
+ "conversion" when it says "cast".
+ valops.c Added the function value_real_cast(), which performs a
+ value.h *cast*, not a *conversion*, which is what value_cast()
+ does when it can. In particular,
+ value_cast(<float_type>,4) = 4.0, while
+ value_real_cast(<float_type>,4) = some mess.
+ eval.c Modula-2 builtin functions implemented: ABS, CAP, CHR,
+ parser-code.c FLOAT, HIGH, MAX, MIN, ODD, ORD, TRUNC, and VAL.
+ expression.h Added macros MAX_OF_TYPE and MIN_OF_TYPE to work with MAX
+ and MIN on integral types. *NOTE*: These are currently
+ hardcoded to work only if there are 8 bits per storage
+ unit. FIXME.
+ eval.c Made logical functions call value_bool to return a
+ properly typed boolean value, based on working_lang.
+
+Thu Jun 20 11:55:27 EDT 1991
+
+ valprint.c Types now print out in a Modula-2 fashion. This works for
+ the cases when the type is printed out step-by-step, that
+ is, it doesn't work when the name of a structured type
+ (which includes the keyword "struct", etc.) is simply
+ displayed.
+ FIXME: Perhaps this is bad. Parts of it seem to kludgey,
+ since type specifications in C and Modula-2 are very
+ different. The C printing of a type is very recursive,
+ whereas in Modula-2 it is generally very simple. C has
+ type prefixes and suffixes, which have no real analogue in
+ Modula-2. Maybe type_print() should call a language
+ specific type printer. This is also advantageous if we
+ compile GDB to exclude some of the languages. We'll just
+ leave those functions out.
+
+Thu Jun 20 16:57:10 EDT 1991
+
+ dbxread.c When reading the complete symbol table in (via
+ psymtab_to_symtab()), the number and types of function
+ arguments are added to a function type. define_symbol()
+ calls add_param_to_type() to accomplish this.
+ Assumption: when we come across a function definition
+ (N_FUN symbol with an 'f' or 'F' in the name), its
+ arguments will appear before another function definition.
+ When a function is found, a pointer to its type is placed
+ in the global in_function_type. Changes that
+ add_param_to_type() makes are to this global.
+ valprint.c The type of a function now includes (for Modula-2) the
+ types of its parameters.
+ eval.c Type checking and a check for the proper number of
+ arguments is now done for function calls. Not sure of the
+ impact this has on C++ member function yet.
+
+Thu Jun 20 19:58:48 EDT 1991
+
+ valprint.c Rewrote the type printer. Broke it into two language
+ specific parts, adding the functions type_print_m2() and
+ type_print_m2_1().
+ An unfortunate consequence is this: if you debugging a C
+ program in Modula-2 mode (why?), info types does not work
+ well with regular expressions, since the types are printed
+ out in Modula-2 terminology, but stored in C terminology.
+ language.[ch] Added the functions new_type_last(), type_keyword(), and
+ type_sep() to aid in the printing of typedefs.
+ symtab.c Made the printing of typedefs as language independent as
+ possible through calls to new_type_last(), type_keyword(),
+ and type_sep().
+
+Fri Jun 21 11:50:26 EDT 1991
+
+ dbxread.c Check all incoming ennumerated types. If it looks like
+ Modula-2's BOOLEAN type, then change the type_code of the
+ type to TYPE_CODE_BOOL so we can process it as a boolean
+ variable.
+ valprint.c Replaced some of the 0x%x with calls to sprintf and
+ hexformat() in val_print().
+ language.[ch] Added the function hex_to_string(), which converts its
+ integral argument to a hexadecimal number (format is
+ language based) and returns the result as a string.
+
+Mon Jun 24 12:25:07 EDT 1991
+
+ valprint.c Some functions call type_print_1() directly, instead of
+ value.h using type_print(), so they can specify where (column) to
+ print things. Since type_print() takes care of language
+ dependence, that needs to be called first. Added a
+ parameter depth to type_print() (so it is now like
+ type_print_1). Changed type_print to type_print_at, and
+ made type_print a macro that passes a depth argument of
+ zero.
+ symmisc.c Changed all calls to type_print_1 to calls to
+ type_print_at.
+ Makefile.dist Made it possible to build GDB for a specific set of
+ depend languages. Do this by passing a definition for the macro
+ LANGS to make. LANGS should be a string containing a
+ space-separated list of language names (ie. LANGS="c m2").
+ The default is to build all languages. Note that grammar
+ files must follow the naming convention of <lang>-exp.y.
+ gdb.lang This holds the current value of the LANGS macro. It is
+ examined every time make is called, and is updated if
+ necessary.
+ eval.c Added #ifdef _LANG_<lang> to these files.
+ expread.c Still need to add them to dbxread.c and coffread.c.
+ main.c
+ source.c
+ symtab.c
+ utils.c
+ valarith.c
+ valprint.c
+
+Mon Jun 24 16:33:11 EDT 1991
+
+ language.[ch] Added the functions hexformat_pre() and
+ hex_to_string_pre(), which take a prefix argument to
+ include in the format string. Thus, hexformat_pre("08") will
+ return "0x08x" (if the working language is language_c).
+ Made hexformat() and hex_to_string() calls to the above
+ with "" as the prefix argument.
+
+ am29k-pinsn.c, arm-pinsn.c, breakpoint.c, convex-tdep.c, exec.c, core.c,
+ dbxread.c, i386-pinsn.c, i386-stub.c, i386-xdep.c, i960-pinsn.c,
+ infcmd.c, inflow.c, m68k-pinsn.c, m68k-stub.c, m88k-pinsn.c,
+ mips-pinsn.c, mips-tdep.c, ns32k-pinsn.c, printcmd.c, pyr-pinsn.c,
+ pyr-tdep.c, pyr-xdep.c, remote-vx.c, remote.c, solib.c, source.c,
+ stack.c, sun386-xdep.c, symfile.c, symm-xdep.c, symmisc.c, tahoe-pinsn.c,
+ valprint.c, vax-pinsn.c
+
+ Changed all occurences of 0x%[0-9]*l*x in printf format strings to
+ calls to hexformat() and hex_to_string(). Format strings without
+ the leading "0x" were ignored.
+
+ depend Updated to take the above into account.
+
+
+Tue Jun 25 15:27:18 EDT 1991
+
+ symtab.h Added the types range_mode_t, range_check_t, type_mode_t,
+ and type_check_t to keep track of the current state of
+ range and type checking.
+ main.c Added the variables range_mode, range_check, type_mode,
+ and type_check to record the current state of range and
+ type checking. Added initialization code to main().
+ language.h Changed the macros STRICT_TYPE and RANGE_CHECK to examine
+ the above variables.
+
+
+Tue Jun 25 17:57:08 EDT 1991
+
+ dbxread.c process_one_symbol() updates the variable (enum language)
+ source_lang based on the extension of the filename
+ contained in the N_SO sybmol that started this symtab.
+ When end_symtab() is called, the value of source_lang is
+ put into the language field.
+ stack.c select_frame() sets working_lang (and possibly type_check
+ and range_check) to the language field of the symtab
+ associated with the frame that is selected if working_mode
+ is language_auto. If working_mode is language_manual, a
+ warning is printed and working_lang is not set.
+ language.c Added the function set_type_range(), which sets the value of
+ type_check and range_check (if their modes call for
+ automatic setting) based on the current value of
+ working_lang. A non-zero argument will cause the current
+ settings to be output.
+
+
+Wed Jun 26 14:51:40 EDT 1991
+
+ eval.c Added range checks on assignment.
+ m2-exp.y Added the grammar for sets to the language. Currently,
+ these do not do anything except print an error message.
+
+Wed Jun 26 17:01:04 EDT 1991
+
+ m2-exp.y Added the ability for parse_number() to parse negative
+ numbers. A global flag is set upon encountering a unary
+ minus. This was done to make, for example, 1 parse as a
+ CARDINAL, and not as an integer, per Wirth's examples in
+ Programming in Modula-2 ed.4.
+ valprint.c Added support for "set radix 2" by then setting
+ output_format to 't'.
+ eval.c Implemented range checking on subrange types. Added calls
+ to range_check_range_p for BINOP_ASSIGN and BINOP_VAL.
+ Implemented MIN and MAX for ennumerated types. The
+ minimum value of an ennumerated type is defined by Wirth
+ as the first identifier, and the maximum as the last.
+ m2-exp.y Made octal numbers ending with "B" be characters and those
+ ending with "C" be numbers, per Wirth's book. (p. 34)
+
+Thu Jun 27 14:11:52 EDT 1991
+
+ stack.c select_frame() now only sets working_lang, it does not
+ notify the user. If working_mode is language_manual, then
+ a warning is issued once.
+ main.c At the end of each call to execute_command(), working_lang
+ is checked against the local static (enum language)
+ current. If they differ and working_mode is
+ language_auto, the new settings of language, type and
+ range checking are printed out.
+ stack.c Modified frame_info() to include the language of the
+ current frame in the output of "info frame".
+ language.[ch] Added the function language_str() which returns the name
+ of the current language.
+
+Fri Jun 28 15:33:14 EDT 1991
+
+ m2-exp.y Added the built-in procedures INC, INCL, DEC, and DECL to
+ the language. INCL and DECL currently cause an error,
+ since sets are not implemented yet. INC and DEC are
+ implemented as PREINCREMENT/PREDECREMENT with one
+ argument, and as ASSIGN_MODIFY with two arguments.
+ eval.c Added type checking to the above cases.
+ value.h Added not_lval_constant to the lval_type ennumerated type.
+ not_lval_constant means that the value is a constant
+ value; that is 3 or 'a' or TRUE, not as in a constant
+ identifier. This is used to help coerce numbers such as 3
+ to either signed or unsigned numbers.
+ valops.c Added the function value_coerce_constants() which coerces
+ constant integers as following: if one is a constant and
+ the other is not, the constant's type is set to the type
+ of the other argument. If both are constants and one is
+ signed, the other is converted to a signed constant.
+
+Sat Jun 29 17:26:29 EDT 1991
+
+ valarith.c Added a better range checker. It now checks range
+ (successfully) on integral operations [+-] (signed and
+ unsigned) for any C sized type. Still does not work well
+ for multiplication.)
+ int_in_size() returns an integer that is coerced to fit into
+ specified number of bytes.
+
+Mon Jul 1 13:04:14 EDT 1991
+
+ language.[ch] Added the function binop_result_type(), which returns the
+ builtin (struct type *) type that would be the result of a
+ binop on the two values V1 and V2.
+
+Wed Jul 3 19:22:53 EDT 1991
+
+ source.c Extended source_info() to include the source language in
+ the output from "info source".
+
+Fri Jul 5 13:48:52 EDT 1991
+
+ utils.c Moved the support functions for the GDB set/show commands
+ dealing with language into language.c.
+ language.c Added the function language_info(), which displays info
+ about the current working language, type and range check
+ settings. Called via the GDB command "info language".
+ Added an initialization routine _initialize_language(),
+ that sets defaults for the language, type and range
+ variables and sets up the new GDB commands.
+ main.c Language setup moved to language.c.
+ depend Rebuilt.
+
+Mon Jul 8 10:10:22 EDT 1991
+
+ valarith.c Debugged the range checker for arithmetic. Still does not
+ work for multiplication very well.
+
+Mon Jul 8 12:40:37 EDT 1991
+
+ language.[ch] Added the function value_true() which returns non-zero if
+ its argument represents a boolean true value.
+ breakpoint.c Changed breakpoint_cond_eval() to call value_true() to
+ check the truth of an expression.
+
+Thu Jul 11 12:51:34 EDT 1991
+
+ language.[ch] Added the predicate structured_type(), which returns
+ non-zero if the argument is a structured type.
+ Added the predicate pointer_type(), which returns non-zero
+ if the argument is a pointer type.
+ eval.c Added the ability to do addition and substraction on
+ pointers and integers. This case simply bypasses the
+ type checker.
+
+Thu Jul 11 14:41:42 EDT 1991
+
+ include/stab.def
+ Added the symbol N_DEFD (0x4a) which is a definition
+ module dependency that is used by the GNU Modula-2
+ compiler and the linker. It is not important to GDB,
+ except that [dbx|coff|mips]read.c should ignore these
+ symbols.
+
+Fri Jul 12 16:07:00 EDT 1991
+
+ valprint.c Changed the TYPE_LENGTH(type) >= 0 to TYPE_LENGTH(type) >
+ 0 in val_print(). Also added statements to the else part
+ to coerce type (argument to val_print) to a pointer type
+ if it is an "array of unspecified length".
+ valops.c Added the function value_m2_string(), which returns a
+ (value) value which is a constant string, whose type is
+ (ARRAY [0..n] OF CHAR). The length field of the type
+ structure is set to zero, so it will be interpreted as an
+ "array of unspecified length".
+ stack.c Moved the language/frame mismatch check to
+ main.c:execute_command().
+ main.c The working language is recorded each time
+ execute_command() is executed. If working lang has
+ changed during its execution, then the new
+ language/type/range info is printed out for the user. If
+ the working language does not match the language of the
+ frame, a warning is issued.
+
+Sat Jul 13 16:16:39 EDT 1991
+
+ eval.c Moved all the type-checking stuff for operators to
+ language.[ch] language.c. This is so we can keep language-specific
+ stuff (like for what type operators are defined) in
+ language.c.
+ language.[ch] Added the function binop_type_check(), which checks to see
+ if its two (value) arguments are type-compatible with its
+ opcode argument. The opcode should represent an operation
+ involving an operator. Also added the macro function
+ unop_type_check, which calls binop_type_check with a
+ NULL second argument.
+ expprint.c Added Modula-2 operators to the op_print_tab, so info
+ expression.h break works correctly. Also added "op_string", which
+ returns the string corresponding to the (enum exp_opcode)
+ opcode that is its argument.
+
+
+Sat Jul 13 18:26:18 EDT 1991
+
+ coffread.c Added code to record the type of function arguments with
+ each paricular function. Code is very similar to that
+ added to dbxread.c.
+ dbxread.c Moved add_param_to_type() to symtab.c
+ symtab.[ch] Added function add_param_to_type() from dbxread.c
+
+ *** NOTE: The above additions have not been tested.
+
+Mon Jul 15 12:50:47 EDT 1991
+
+ langauge.[ch] Added the functions type_error and range_error, which work
+ like error() except if the type/range mode is set to
+ *_mode_warn, then they do not do a return_to_top_level(),
+ but merely print a warning.
+ Also changed [set|show]_[type|range]_command() to support
+ the new "warn" feature.
+
+Thu Jul 18 17:50:54 EDT 1991
+
+ mipsread.c Added code to record the type of function arguments with
+ each particular function. Code is very similar to that
+ added to dbxread.c.
+
+ *** NOTE: The above additions have not been tested.
+
+Fri Jul 19 11:19:10 EDT 1991
+
+ defs.h Added macros MAX_OF_SIZE, MIN_OF_SIZE, UMAX_OF_SIZE, and
+ UMIN_OF_SIZE, which when given a size of a numeric type,
+ return the maximum and minimum value it can hold. UMAX...
+ and UMIN... return the result for unsigned types.
+ symtab.h Added the macros MAX_OF_TYPE and MIN_OF_TYPE to operate on
+ struct types. They call above macros.
+ dbxread.c Renamed the MAX and MIN_OF_TYPE macros to ..._OF_CTYPE to
+ avoid a name conlict with the above.
+ c-exp.y Added range checking on numeric constants in
+ parse_number() for completeness.
+ valarith.c Made binop_user_defined_p() and unop_user_defined_p()
+ return 0 if working_lang is not language_c.
+
+Thu Aug 8 14:17:22 EDT 1991
+
+ main.c
+ printcmd.c
+ breakpoint.c Documentation strings of some commands changed to
+ eliminate the references to the C language where
+ appropriate.
+
+Tue Aug 13 15:48:03 EDT 1991
+
+ m2-exp.y Added qualified identifiers to the grammar. The semantics
+ are slightly different from those of the GDB operator ::
+ c-exp.y
+ m2-exp.y Added a rule to each grammar of the form: start ::= exp |
+ type_exp, where type_exp is any valid type expression.
+ expression.h
+ eval.c Added the opcode OP_TYPE, and an error case in eval.c.
+ printcmd.c Modified ptype_command() so it actually parses the input
+ (necessary for type expressions with scope qualifiers).
+ Added the function ptype_eval() which expects an
+ expression composed of one OP_TYPE element.
+ *.[ch] Replaced all occurences of parse_c_expression with
+ parse_expression
+ *.[ch] Replaced all occurences of parse_c_1 with parse_exp_1
+
+[End of ChangeLog entries from Andrew Beers for Modula-2 support.]
+
+Mon Sep 16 17:19:46 1991 John Gilmore (gnu at cygnus.com)
+
+ Small fixes from Peter Schauer:
+
+ * infrun.c (child_attach): Lint.
+ * solib.c (find_solib): Handle shared libs version 2.
+
+ Small fixes from David Wood:
+
+ * xm-ultra3.h (SYS_SIGLIST_MISSING): Typo.
+
+ Small fixes:
+
+ * remote-vx.c: Move <stdio.h> to top, for FILE. Fix from
+ John S <basrai%kanga.dnet@c3po.sm-alc.af.mil>.
+
+ * utils.c (wrap_here): Avoid wrap action of fputs_filtered if
+ chars_per_line is at maximum (user typed `set width 0'). Fix
+ from Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>.
+
+Tue Sep 17 17:31:04 1991 Stu Grossman (grossman at cygnus.com)
+
+ * coredep.c: include ptrace.h where necessary.
+ * mipsread.c(parse_lines): fix unsigned char problem that was
+ messing up line numbers on SGI's and possibly other MIPS based
+ platforms.
+ * infrun.c (child_create_inferior): use better test to check
+ return val from setpgrp().
+ * tm-irix3.h, xm-irix3.h, tconfig/irix3, xconfig/irix3: add these
+ for sgi/irix support.
+
+Wed Sep 18 04:33:31 1991 Per Bothner (bothner at cygnus.com)
+
+ * mipsread.c (parse_symbol): Put non-static procedures
+ in the global block.
+
+Fri Sep 13 00:14:52 1991 John Gilmore (gnu at cygnus.com)
+
+ Patch together `text_start' and `text_end' for 29K port.
+
+ * exec.c (exec_command): If NEED_TEXT_START_END, define the
+ variables and set them based on the exec file.
+ * am29k-tdep.c: declare text_start.
+ * valops.c (call_function_by_hand): declare text_end.
+
+ * inferior.h: Eliminate CANNOT_EXECUTE_STACK in favor of
+ defining CALL_DUMMY_LOCATION as BEFORE_TEXT_END. This is
+ because machines that do this will also have to know to
+ set NEED_TEXT_START_END. Besides, it was a redundant way to
+ say the same thing.
+ * tm-29k.h, tm-convex.h, tm-np1.h: Eliminate
+ CANNOT_EXECUTE_STACK, define CALL_DUMMY_LOCATION and
+ NEED_TEXT_START_END.
+
+Thu Sep 12 00:22:24 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ AMD 29000 changes from David Wood <wood@david.ultra.nyu.edu>:
+
+ * Makefile.in (CLIBS): Put XM_CLIBS and TM_CLIBS at end.
+ Pass MUNCH_DEFINE to munch whenever we run it.
+ * am29k-pinsn.c (print_insn): Handle NOP specially. Avoid %#x
+ format string; use 0x%x instead.
+ * am29k-tdep.c: Use DUMMY_SAVE_GREGS and RETURN_REGNUM.
+ * ultra-xdep.c, xm-ultra.h: New files for Ultracomputer host system.
+ * xm-rtbsd.h: New host support for RT/PC running BSD Unix.
+ * inflow.c: Handle `short' process group IDs.
+ * infptrace.c (fetch_register): Support CANNOT_FETCH_REGISTER,
+ and check for ptrace errors.
+ * coffread.c (SDB_REG_TO_REGNUM): Define if not already.
+ (coff_symfile_init): Initialize text_bfd_scnum.
+ (read_coff_symtab): Use it to find the text [and absolute?] sections.
+ * ../config.sub: Add vendor nyu and os "sym[1-9]*".
+ * configure.in: Add hosts rtpc-*-* and a29k-*-*.
+ Merge target arm case with other "easy" cases. Add target
+ cases a29k-*-none (rehack of am29k), a29k-*-kern (remote to
+ Ultracomputer kernel), and a29k-*-sym1 (ultracomputer OS's user
+ process).
+ * minimon.h, remote-adapt.c, remote-mm.c: Add.
+ * munch: Cope with RT/PC putting fns in data segment.
+ Restore ability to override `nm' by specifying MUNCH_NM.
+ * xconfig/rtbsd, xconfig/ultra3: New host systems.
+ * tconfig/a29k: Rename from tconfig/am29k. Add remote-mm
+ and remote-adapt. Remove encapsulated coff #define's (the
+ support should go in BFD, and gdb shouldn't know or care).
+ * tconfig/a29k-kern: Same, but for remote kernel debugging.
+ * tconfig/ultra3: For debugging user processes on Ultra3/Sym1.
+ * tm-29k.h: Update BADMAG (though it should go away).
+ Allow the register definitions to be overridden in another
+ tm-file. Fix SR_REGNUM. Add a mess of _REGNUM's. Separate
+ RETURN_REGNUM from GR96_REGNUM and DUMMY_SAVE_GREGS from
+ DUMMY_SAVE_GR96, for handling kernel calling conventions
+ that use GR64+ rather than GR96+.
+ * tm-ultra3.h: New file, for use on Ultra3 Unix as well as for
+ remote debugging of Ultra3 kernel. Includes tm-29k.h and
+ overrides various things.
+
+ * remote-mm.c (mm_attach, mm_wait): Handle attach like
+ child_attach does, making a clean stop in the newly attached
+ program.
+ * remote-eb.c: Lint.
+
+ * coffread.c: Make coffread independent of any particular
+ variant of COFF. Avoid #include-ing any particular one except
+ internalcoff.h. BFD now passes key values for symbol reading
+ as part of its coff_data structure (LINESZ, SYMESZ, AUXESZ,
+ and the symbol masks and shifts); use them.
+ Remove obsolete end_of_text_addr.
+
+ * exec.c: Remove unused include files.
+
+Wed Sep 11 19:38:44 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Makefile.in (documentation targets): Pass $(M4).
+ Bugfix from eggert@twinsun.com (Paul Eggert).
+
+ * stack.c (down_silently_command): Check for stack existence.
+
+Tue Sep 10 23:08:29 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Makefile.in (VERSION): Update to 4.0.3.
+
+Tue Sep 10 09:19:29 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * core.c (core_file_command): Print frame at coredump with
+ its level number, by calling print_stack_frame.
+ * frame.h: Add selected_frame_level, print_stack_frame.
+ * frame.h, stack.c: Remove print_sel_frame, print_selected_frame.
+ * convex-tdep.c, convex-xdep.c, infcmd.c, inflow.c, infrun.c:
+ Change print_sel_frame and print_selected_frame callers to
+ print_stack_frame.
+
+ * dbxread.c (read_ofile_symtab): Avoid empty else clause.
+ * symfile.c (free_named_symtabs): Ditto.
+ * main.c (main): wrap_here needs an arg.
+ * solib.c (find_solib): Avoid memory access if _DYNAMIC is zero.
+ (solib_add): Avoid noise.
+ (solib_create_inferior_hook): Lint.
+ (sharedlibrary_command): Move dont_repeat to here.
+ * utils.c (error): Call wrap_here to force buffered output.
+
+ Small patches from Peter Schauer:
+
+ * coffread.c (start_symtab): Free any existing line_vector before
+ malloc-ing new one.
+ (read_coff_symtab): Ditto for type_vector.
+
+ * source.c (lines_to_list): New variable, replacing function.
+ (all uses): Use as variable.
+ (_initialize_source): Add 'set listsize' and 'show listsize'.
+ * utils.c (lines_to_list): Remove function.
+ * stack.c (print_frame_info): Use as variable.
+ * defs.h (lines_to_list): Remove declaration.
+
+Mon Sep 9 13:45:57 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * breakpoint.c (insert_breakpoints): Restore warning about
+ the program might be running in another process, but only for
+ systems with this brain death (#ifdef ONE_PROCESS_WRITETEXT).
+ * xm-hp300bsd.h, xm-mips.h, xm-vax.h: Define it.
+
+ * utils.c (error): if error_pre_print is set, print the string
+ first.
+ * main.c (main, print_gnu_advertisement, print_gdb_version):
+ Reformat legalese so it always prints, but acts as an "I'm here"
+ message while symbols are being read. If any errors occur,
+ print a few newlines to set off the message and start it at the
+ left margin. Remove mention of "help" command, and don't yak
+ about symbol reading.
+ (catch_errors): Error string is now printed first in case of
+ error, not last.
+ * command.c (undef_cmd_error, lookup_cmd): On undefined command,
+ suggest the "help" command.
+
+ * Makefile.in (VERSION): Set to 4.0.2.
+
+Thu Sep 5 23:49:48 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * .gdbinit: Remove useless "rr" command. Set complaints
+ to 1 for people debugging gdb.
+
+ * breakpoint.c, remote-vx.c: Reword strings printed by
+ catch_errors callers.
+
+Wed Sep 4 11:07:50 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * WHATS.NEW: "history write -> history save". Doc "write on/off".
+ (Fix from kenc@viewlogic.com.)
+
+ Fix some infrastructure to be able to cope with host and target
+ machines with different sized basic types (ints, ptrs, etc).
+ (Idea from pierre@la.tce.com (Pierre Willard).)
+
+ * values.c (value_from_longest): Rename from value_from_long.
+ Handle pointer types as well as integers, so that targets with
+ different pointer sizes from the host can be accomodated.
+ * breakpoint.c, convex-tdep.c, eval.c, expprint.c, printcmd.c,
+ valarith.c, valops.c, valprint.c, value.h, values.c: Rename
+ uses of value_from_long to value_from_longest.
+ * eval.c, findvar.c, printcmd.c, valarith.c, valops.c: Pass
+ the correct pointer type to value_from_long{est}.
+
+ * doc/gdb.texinfo ($_, $__): Describe types of these variables.
+
+ * remote-vx.c: Remove obsolete code for calling functions via
+ vxworks kludge interface (it referenced value_from_long).
+
+ * valops.c (value_string): Find malloc with lookup_misc_func, not
+ raw search.
+
+Tue Sep 3 18:37:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Make writing to files work properly. (Fixes to BFD are also needed.)
+
+ * core.c (core_open): Open file ourselves, read or r/w, depending on
+ write_files. Use bfd_fdopenr.
+ * gdbcore.h (write_files): New variable.
+ * exec.c (write_files): Define variable, add set&show for it.
+ (exec_file_command): Use write_files to open for read or r/write.
+
+ Make shared library reading happen automatically. These changes
+ are mostly from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
+
+ * inferior.h (stop_soon_quietly): Add to exported variables.
+ * infrun.c (child_create_inferior): call solib hook, if defined.
+ (child_attach): call solib hook, if defined.
+ * solib.c: Include inferior.h. Add from_tty to so_list as kludge.
+ (find_solib): Use lookup_misc_func rather than hand-rolled.
+ (symbol_add_stub): New stub for catch_errors.
+ (solib_add): Avoid output if !from_tty. Catch errors rather
+ than just calling symbol_file_add and bombing.
+ (solib_create_inferior_hook): Interface with the target process
+ to let it read and alloc shared libs, then figure out what it did.
+
+ * core.c (validate_files): Fix typo, soften warning.
+ (Fix from Hiroto Kagotani <kagotani@cs.titech.ac.jp>.)
+
+ * utils.c (fputs_demangled): Avoid duplicate printing if
+ demangling is off. (Fix from J.T. Conklin <jtc@cayenne.com>.)
+
+ * infrun.c (proceed): Cast -1 to (CORE_ADDR) before comparing.
+ (Fix from pierre@la.tce.com (Pierre Willard).)
+
+ * main.c (catch_errors): Change argument to a char * from an int,
+ since a char * can point to a struct full of glop, but an int
+ is not guaranteed to be able to hold a pointer.
+ * breakpoint.c (breakpoint_cond_eval, bpstat_stop_status,
+ breakpoint_re_set_one, breakpoint_re_set): Adapt.
+ * core.c (core_open, solib_add_stub): Adapt.
+ * remote-vx.c (symbol_stub, add_symbol_stub, callers): Adapt.
+
+Wed Aug 28 18:18:05 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Makefile.in: Update VERSION to 4.0.1. Evade GNU Make bug
+ by adding .NOEXPORT target.
+
+Fri Aug 23 17:14:25 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * GDB-4.0 release!
+ * Update README.
+ * Makefile.in (VERSION): Roll to 4.0.
+ (gdb.tar.Z): Make refcard.ps as well, for shipment.
+
+Fri Aug 23 14:07:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/gdb.texinfo: minor rewordings, crossref to ptype from print,
+ more on printsyms.
+
+ * doc/Makefile, Makefile.in: generate "gdb-all.texi" rather than
+ "gdb-all.texinfo"
+
+ * doc/rdl-apps.texi: renamed from rdl-apps.texinfo
+
+ * Makefile.in, doc/Makefile, doc/gdb.texinfo:
+ reflect above name change
+
+ * WHATS.NEW: correct pointer to refcard.
+
+ * doc/gdb.texinfo: update New Features, Installing
+
+ * doc/gdbint.texinfo: add short description of configure +template
+
+Fri Aug 23 11:46:08 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/gdb.texinfo: update, fix bugs in "Installing" appendix
+
+Fri Aug 23 01:02:00 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Makefile.in: Add config.sub, make doc/rdl-apps.texinfo for
+ tar file, add dependencies for referenced doc files.
+
+Thu Aug 22 22:17:06 1991 Stu Grossman (grossman at cygint.cygnus.com)
+
+ * coffread.c, symfile.c, stack.c: saberized.
+
+Thu Aug 22 16:20:27 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/refcard.tex: permuted Essential Commands sec
+
+ * doc/gdb.texinfo: new C++ chapter; revised installation appendix;
+ new doc for
+ set/show symbol-reloading
+ default set complaints 0
+ info all-registers
+ RET-repeat disabled after prompted long displays
+ processID (attach) interpretation of 2nd GDB cmdline arg
+
+Thu Aug 22 14:05:47 1991 Stu Grossman (grossman at cygint.cygnus.com)
+
+ * expread.y, coffread.c, dbxread.c, target.c, mem-break.c,
+ cplus-dem.c, values.c, valprint.c, symfile.c, remote.c,
+ breakpoint.c, main.c: lint.
+
+Thu Aug 22 02:02:26 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Install new configuration scheme for GDB and friends.
+
+ * config.sub: Translate ordinary names to three-part names.
+ * configure: Use three-part names internally.
+ * configure.in: Translate three-part names to filenames.
+
+ * README, WHATS.NEW: Update for gdb-4.0.
+ * Makefile.in: Roll VERSION to 3.99.
+
+Wed Aug 21 18:21:09 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * infptrace.c (KERNEL_U_ADDR_BSD): Include a.out.gnu.h.
+ * i960-tdep.c, m68k-tdep.c, sparc-tdep.c, tm-i960.h,
+ tm-m68k.h, remote-nindy.c: Change ext_format_XXX structs
+ to single structures rather than arrays; when passing
+ their address, use &. This avoids trouble with bdead compilers.
+ * mcheck.c: Don't include <stdlib.h>; just declare "void abort();"
+ instead. This avoids portability headaches.
+ * mips-tdep.c (mips_do_registers_info): Only print FP regs if
+ asked to.
+ * source.c (open_source_file): Avoid ANSI const bdeath by
+ skipping declaration and then casting result value.
+ * tm-hp300bsd.h: Clarify comment.
+ * utils.c (strstr): Result is const char *; ANSI bdeath.
+ * xm-hp300bsd.h: Define HOST_BYTE_ORDER. Redefine INT_MIN,
+ since system include file defines it differently from "defs.h",
+ though the two are equivalent for our purposes.
+ * tconfig/hp300bsd: Add m68k-tdep.o.
+
+Tue Aug 20 16:01:11 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * tconfig/sun*4: Remove warnings about system assembler.
+
+Mon Aug 19 13:44:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * mcheck.c: Avoid warning about undeclared abort fn.
+ * tm-sparc.h (PC_ADJUST): Avoid calling error() from this;
+ it causes recursive calls to error() when used in cleanups.
+ To do so requires that we make it a function, so we do.
+ * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST.
+ * utils.c (do_cleanups): Remove the current cleanup from the
+ chain *before* calling it, in case error() is called from it.
+ The result won't be pretty, but won't be an infinite loop either.
+
+Mon Aug 19 00:41:04 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
+
+ * dbxread.c (read_struct_type): Grok anon structs for C++.
+ (vb_name, vptr_name): Null terminate these strings.
+
+Fri Aug 16 08:31:03 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Minor bug fixes from BSD Net2 gdb:
+
+ * blockframe.c (get_prev_frame_info): If FRAME_CHAIN_COMBINE
+ returns 0, there is no previous frame.
+ * breakpoint.c (commands_command): If !from_tty, don't call
+ input_from_terminal_p().
+ * dbxread.c (record_misc_function): Speed up slightly.
+ (compare_psymbols): Ditto.
+ * infcmd.c (do_registers_info): Take a second argument to
+ determine whether to print float registers. "info registers"
+ does not do so anymore. "info all-registers" does, now.
+ * mips-tdep.c, pyr-tdep.c (xxx_do_registers_info): Take second
+ arg and ignore it.
+ * tm-mips.h, tm-pyr.h (DO_REGISTERS_INFO): Pass second arg.
+ * inflow.c (initialize_inflow): Set tflags_ours correctly.
+
+ Other fixes:
+
+ * breakpoint.c (bpstat_do_actions): Use a cleanup to restore
+ executing_breakpoint_commands if we are interrupted by error.
+ * coffread.c (init_lineno): Avoid problem with zero-sized linetab
+ versus malloc/free. From: john@labtam.labtam.oz.au (John Carey).
+ * core.c (solib_add_stub, core_open): Call SOLIB_ADD inside a
+ catch_errors() so we can setup the frame regardless of whether
+ the shared libs work.
+ * ieee-float.c (double_to_ieee_extended): Get exponent from
+ right place in little-endian systems. From John Carey.
+
+Thu Aug 15 18:43:57 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * main.c: Remove unused terminating_signals and catch_termination().
+ (long_options): Terminate with a zero element.
+ [Bugfix from Atsuo Kawaguchi <atsuo@hark86.harl.hitachi.co.jp>.]
+ (gdb_readline): Make call-compatible with readline.
+ (init_signals): Improve comments re vfork vs. signal.
+
+ * utils.c (prompt_for_continue): Use new gdb_readline().
+ If we prompt for continuation, we don't let CR repeat the previous
+ command, once we get back to a prompt. It's too easy to keep
+ hitting CR, expecting "--more--" prompts, and have some long
+ command start repeating on you.
+
+Tue Aug 13 16:17:56 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * blockframe.c (frameless_look_for_prologue): Speed up by
+ calling SKIP_PROLOGUE_FRAMELESS_P if it's defined.
+ * tm-sparc.h (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
+ Define two variants, one faster.
+ * sparc-tdep.c (sparc_frame_chain): Use target_read_memory
+ and return zero, rather than giving an error.
+ (setup_arbitrary_frame): Initialize the PC in the new frame.
+ (skip_prologue): Add a second arg saying whether we're just
+ checking for a frameless function or not.
+
+ * core.c (core_open, core_close, core_xfer_memory): Move
+ section table pointers and bfd* into the target_ops.
+ (core_open): Allow errors in shared lib reading, etc.
+ (core_files_info): Describe shared library sections.
+
+ * exec.c (exec_open, exec_close, exec_xfer_memory, xfer_memory,
+ exec_files_info, set_section_command): Move section table
+ pointers and bfd* into the target_ops.
+ (add_to_section_table): Add BFD to section table.
+
+ * target.c (target_xfer_memory, target_info): Pass target to
+ xfer_memory and target_info functions.
+ * target.h: ''
+
+ * gdbcore.h: Move struct section_table.
+ * target.h: New home of struct section_table.
+
+ * solib.c (solib_add): New argument is the target_ops whose
+ section list is to be added to, if any. Reallocate the
+ sections in that target to add any that come from shared libs.
+ (throughout) so_sections renamed to sections.
+ (solib_xfer_memory): Deleted.
+ * tm-sunos.h (SOLIB_ADD): Add target argument.
+ (SOLIB_XFER_MEMORY): Delete.
+
+ * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c,
+ remote-vx.c, remote.c, target.c, target.h: Remove add_syms vector
+ from target_ops. It's the same on all targets. Add two section
+ pointers to target_ops.
+
+ * stack.c (find_relative_frame): Dump ancient algorithm for
+ "down", just use handy "next" pointers.
+ (frame_command): Don't error if there is no stack; let user
+ set one.
+
+ * inflow.c (new_tty_prefork, new_tty): New prefork routine
+ modifies static state in the parent process; new_tty itself
+ runs in the child and modifies the child's file descriptors
+ to match the saved static state.
+ * infrun.c (child_create_inferior): Call new_tty_prefork,
+ fork, then new_tty.
+
+ * infptrace.c (child_xfer_memory): Add ignored target arg.
+ * remote-eb.c (eb_xfer_inferior_memory): ''
+ * remote-nindy.c (nindy_xfer_inferior_memory): ''
+ * remote-vx.c (vx_xfer_memory): ''
+ * remote.c (remote_xfer_memory): ''. Rename from
+ remote_xfer_inferior_memory.
+
+ * main.c (main): Only try to attach "corefile" argument if
+ it starts with a digit.
+
+ * symfile.c (symbol_reloading): New "set/show" variable.
+ (symbol_file_add): Shorten message about symbol reading.
+ (add_symbol_file_command): Merge with add_syms_addr_command,
+ since this should work on all targets now.
+ (stop_whining): Default to zero, to shut up complaints
+ about bad symbol tables on many systems.
+ (free_named_symtabs): Just exit unless symbol_reloading.
+
+ * xm-sun3os4.h, xm-sun4os4.h: Define BROKEN_LARGE_ALLOCA,
+ and add comment explaining shared library screw.
+
+ * source.c: #if defined => #ifdef.
+
+Thu Aug 8 12:23:19 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * doc/gdbint.texinfo: Improve doc on porting to new OS's.
+
+Tue Aug 6 17:16:15 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/rdl-apps.texinfo: provide default readline-appendix finder
+ (doc/Makefile knows how to make one for local config)
+
+ * Makefile.in: use doc/Makefile for doc targets
+
+ * doc/Makefile: GDB documentation now has its own Makefile
+ doc/refcard.tex: renamed from "gdbrc.tex"
+ doc/gdbint.texinfo: add markup in "Cleanups" chapter
+
+
+Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * values.c (baseclass_addr): When reading target memory, use the
+ length of the basetype, not the upper type. We've only malloc'd
+ enough space for the basetype, leading to errors in free().
+
+ * expprint.c (print_subexp): Print UNOP_MEMVAL of an OP_LONG that
+ ends up as a function specially, since we know the actual type of
+ the pointed-to address. This (somewhat) fixes display of
+ expressions that include misc_function_vector names. Try `cond 1
+ !strcmp("a","b")' then `i b'.
+
+ * infrun.c: Move DO_DEFERRED_STORES from proceed() to resume().
+ The child can be proceeded from inside wait_for_inferior in
+ evaluating breakpoint conditions, and DO_DEFERRED_STORES was
+ getting skipped in that case.
+
+ * expprint.c (print_subexp): Use filtered output, since the
+ subroutines we call use it, otherwise the output is horribly
+ mangled, since output of wrappable stuff comes out late.
+
+ * Makefile.in: Bump VERSION to 3.98.1
+
+ * infrun.c (child_create_process): Use execlp to find the
+ shell to exec our target program. This requires some fiddling
+ with `environ' since there is no execlpe().
+
+Thu Aug 1 15:35:17 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * Makefile.in, doc/gdbrc.tex, doc/rc-* (new files):
+ Minor rearrangement of refcard permits two new make targets--
+ gdbrc.dvi DVI output for refcard, using CM fonts
+ gdbrc.ps PostScript refcard, using PS fonts
+
+Wed Jul 31 16:46:21 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * GDB-3.98 release.
+
+ * TODO, Projects, WHATS.NEW, README: Update for gdb-3.98.
+ * Makefile.in (gdb-all.texinfo): Avoid touching file if M4 dies.
+
+Wed Jul 31 16:35:58 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/gdb.texinfo: last changes for release.
+ Minor typo and formatting fixes; incorporated most fixes remaining from
+ filed mail commenting on earlier drafts.
+
+ Added warnings: pipes don't work in run command;
+ conditions are converse of assertions;
+ step over fn without debug info goes to next fn;
+ vars may have "wrong" values near fn entrance, exit
+
+ Added example from Kingston on printing repeated nonadjacent values
+
+ Added explicit mention that in Emacs gdb mode C-c and C-z are like
+ shell mode for signals
+
+ Renamed "Stepping and Continuing" to "Continuing and Stepping" so it
+ doesn't sound so much like its parent "Stopping and Continuing"; also
+ moved entries on continue to top of section, so they don't get lost.
+
+ Improved installation directions in appendix, added manual formatting
+ instructions
+
+Tue Jul 30 17:26:39 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * configure.in: Remove xm.h and tm.h even if we aren't linking
+ new ones, so "./configure sun4; ./configure none" does the right
+ thing. Assume that alldeps.mak and depend are already built in
+ srcdir, and avoid running "make" (particularly "make depend",
+ which involves "gcc") from inside configure. Build Makefile
+ directly rather than building Makefile.conf first.
+ * configure: Regenerate with above changes.
+ * Makefile.in: Use $(BISON) to find bison. Roll VERSION
+ to 3.98. Revise gdb.tar.Z procedure to produce a file
+ called gdb-$(VERSION).tar.Z but which unpacks into a
+ directory called "gdb". Move non-source files out of
+ $(SFILES_SUBDIR). Pretty up alldeps.mak with comments.
+ (depend): Don't try to do "gcc expread.y".
+ (expread.o): Update dependencies by hand.
+
+Mon Jul 29 15:21:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/gdb.texinfo:
+ Fixed a variety of small typos that prevented info from formatting
+ cleanly; altered too-long heading for GPL Appendix, as discussed
+ w/RMS; Changed date on cover to July 91.
+
+Fri Jul 26 13:20:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * doc/gdb.texinfo:
+ (1) Applied some fixes due to comments from Larry Breed (easier ones
+ through chapsec 5.2)
+ (2) Eliminated use of @footnote---had my doubts about it anyways, and
+ it's broken in latest texinfo
+ (3) Introduced *some* use of [] for optional arguments, where
+ explanation is not simpler by listing cmd w arg and cmd w/out arg
+ separately. Still not using @deffn.
+ (4) Dropped in GPL-2. NOTE: one of GPL-2 or texinfo is broken; a
+ couple of headings are too long. Need patches to texinfo or revision
+ to GPL-2.
+
+ * Partial update to README (which still needs work for this
+ release!): (1) use of configure corrected for new script,
+ (2) "make gdb.dvi" and "make gdb.info" mentioned.
+
+Wed Jul 24 06:44:02 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * symtab.c (lookup_symbol): Don't complain right off about
+ no debug symbols; use the misc function vector first.
+ (list_symbols): Use misc function vector to find symbols
+ that don't have debug info, and print them.
+ (find_pc_symtab): Temporarily avoid fatal() when psymtab
+ PC range doesn't match symtab PC range, as it does on the
+ MIPS because our symtab reading isn't perfect.
+
+ * dbxread.c (dbx_symfile_read): Make warning about
+ "no debug symbols" slightly nicer.
+
+ * source.c (select_source_symtab): If "main" symbol exists,
+ but decode_line_spec can't find line info, don't just return
+ a zero; try other source symtabs or give an error.
+
+ * mipsread.c (parse_partial_symbols): Sort the psymtabs by
+ their low addresses first, then rip through fixing high addrs.
+
+ * ns32k-opcode.h (sfsr): Bugfix from Rune Nerg}rd,
+ <runene@ifi.uio.no>.
+ (NS32K_SVC_IMMED_OPERANDS): Reverse the #ifndef.
+
+Tue Jul 23 18:52:43 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * Minor, mostly mechanical, cleanup of doc subdir for clean
+ makeinfo'ing and TeXing; also ensured gdb-all.texinfo (post-m4)
+ and gdb.info (post- texinfo2 makeinfo) generated for distribution.
+
+Sun Jul 21 03:54:52 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Mostly MIPS and general symbol-reading fixups.
+
+ * doc/gdbint.texinfo: Add documentation on symbol-reading
+ interface.
+
+ * mipsread.c: Remove kludges around #include "ecoff.h".
+ Remove redefinitions of a_magic, etc, no longer used.
+ (parse_symbol, ): Convert "Internal:" printfs to complain()ts.
+ Fix global overview comments to match symfile.c protocol.
+ (mipscoff_new_init): Eliminate cur_hdr if we have one.
+ (mipscoff_symfile_read): Eliminate unused code. Avoid
+ sorting all the symtabs, when all we have read here is psymtabs.
+ The symtabs are sorted as they are created anyway. Tell
+ condense_misc_bunches whether we're mainline.
+ (psymtab_to_symtab_1): Pass filename when recursing, to make
+ stack trace more informative.
+ (parse_partial_symbols): Assume cur_hdr as argument.
+ (read_mips_symtab): Don't clobber cur_hdr, so it can be freed.
+ Pass cur_hdr implicitly to parse_partial_symbols. Avoid checking
+ the TYPE_NAME of char *, since that's done in symfile.c.
+ (free_numargs, parse_symbol, add_symbol, add_block,
+ shrink_linetable): Declare these fns void.
+ (upgrade_type): Convert tree of if's to switch. Clean up
+ bogus "off == 0" handling with a complaint. Avoid setting
+ field bitpos and bitsize of array with lower and upper bounds.
+ Check specified bitsize of elements against their actual type's
+ bitsize, and complain if different. Complain about unknown
+ type qualifiers.
+ (parse_fdr): Don't assume sizeof(char *) == sizeof (struct *).
+ (psymtab_to_symtab_1): Print names of subsidiary files that
+ are being read in. FIXME, we read far too many files. This code
+ is not the problem, the problem is in parse_fdr where the psymtabs
+ are set up.
+ (cross_ref): Result should indicate that we used one aux entry
+ normally, or two if we encountered a "next" entry. This used
+ to leave the caller pointing at the wrong aux entry.
+ (add_symbol): If overflowed cur_block, reallocate it larger,
+ chase all pointers to it, and complain(), rather than clobber memory.
+ (shrink_block): Use xrealloc rather than xmalloc-and-copy.
+ (new_field): Only allocate one field initially, not two.
+ Pull ++ out of macro argument. Simplify.
+ (_initialize_mipsread): Avoid initialization of importd
+ global_psymbols and static_psymbols.
+
+ * symfile.c (psymtab_to_symtab): Depend on XXX_psymtab_to_symtab
+ to properly set pst->symtab; avoid searching for it.
+ (symfile_fns): Improve comments, add a FIXME.
+ * dbxread.c: Update comments to reflect symfile protocol.
+ (read_ofile_symtab, end_symtab): Return the symtab.
+ (psymtab_to_symtab_1): Set pst->symtab.
+
+ * coffread.c (coff_symfile_read): tell condense_misc_bunches
+ whether we're mainline.
+
+ * symfile.h (sym_fns): Remove unused sym_discard member.
+ * coffread.c, mipsread.c, dbxread.c: Remove XXX_symfile_discard.
+
+ * mtrace.c (mtrace): Take effect if mallwatch is set, even if
+ the environment variable is not.
+ * infcmd.c (finish_command): Use filtered printfs.
+ * cplus-dem.c: Add struct tags to a few unnamed structs.
+ * valops.c (value_coerce_array): Improve comments.
+ * valprint.c (type_print_varspec_suffix): Print array size only
+ if greater than zero.
+ * m88k-tdep.c: Shift some lines left by one space, that had
+ apparently been trashed at some point.
+ * TODO: More things to do, a few got done.
+
+Thu Jul 18 22:46:05 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * symtab.h (LOC_EXTERNAL): Eliminate in favor of LOC_STATIC.
+ (ldsymoff, ldsymlen, globals_offset, statics_offset): Improve
+ comments.
+ * dbxread.c (read_dbx_symtab): LOC_EXTERNAL -> LOC_STATIC.
+ * expread.y, findvar.c, symmisc.c: Ditto.
+ * printcmd.c (address_info): Update printed forms of LOC_
+ symbols. Elim LOC_EXTERNAL.
+ (print_frame_args): Keep track of param stack offsets before
+ re-looking up to find the local register param is kept in.
+
+ * mipsread.c: Use <symconst.h> and <sym.h> rather than <syms.h>.
+ Further integration of mipsread into gdb. Eliminate unused
+ routines, duplicate declarations. Handle static symbols in
+ psymtabs as well as external symbols. When reading symtabs,
+ insert symbols into the correct block (global, static, or a local
+ block).
+ (read_mips_symtab, parse_partial_symbols): Don't pass useless
+ "incremental" arg.
+ (mipscoff_symfile_read): Don't call select_source_symtab.
+ (parse_symbol): Use SYMBOL_VALUE_ADDRESS where appropriate,
+ rather than SYMBOL_VALUE.
+ (parse_external): Comment clobbering of top_stack.
+ (parse_partial_symbols): Update comments. Allocate and parse
+ static symbols as well as external symbols. FIXME, enum values
+ are not handled in this pass, but should be. Inline new_psymbol.
+ Use SYMBOL_VALUE_ADDRESS.
+ (psymtab_to_symtab_1): Read symbols into global static block
+ by default (until enter some function's local block context).
+ (sort_blocks): Clean up STATIC_BLOCK as well as GLOBAL_BLOCK.
+ (destroy_all_symtabs, new_psymbol): Eliminate, unused.
+
+ * source.c (select_source_symtab): Select a source symtab
+ from either the symtabs or, failing that, the psymtabs.
+ (list_command): Update error message.
+ (forward_search_command, reverse_search_command): Use getc, not
+ fgetc, for speed. FIXME, add comment about buffers that die if
+ overrun by long line.
+
+ * values.c (unpack_field_as_long, modify_field): Avoid shifting
+ by an entire word, which is not portable, if we have a 32-bit
+ field. (Code in dbxread.c already turns such bitfields, if
+ aligned, into ordinary ints, but fixing this will help for other
+ symbol formats and for future changes.)
+ * core.c (core_open): Handle ANSI const brain death.
+ * utils.c (vprintf): Fix varargs typo.
+
+Sun Jul 14 00:42:53 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * findvar.c (find_var_value): Handle &function better.
+ * TODO: Document work needed on &fn and &array.
+ * printcmd.c (print_address_symbolic): New arg is the prefix
+ to print if a name is printed.
+ (print_address_demangle): Honor "set print address" now.
+ Use new arg above to improve spacing of output.
+ * valprint.c (val_print): When printing function pointers,
+ print symbolic form too.
+ * breakpoint.c (breakpoint_1): Use new print_address_symbolic.
+
+Mon Jul 8 19:02:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * core.c (memory_error): Reword error msg to mislead less.
+
+ * mips-pinsn.c (print_insn_arg 'd'): Print $ with reg name.
+
+ * mipsread.c (read_mips_symtab, read_the_mips_symtab,
+ parse_partial_symbols): Use newer BFD internals (external_filehdr
+ and external_aouthdr), byte-swap the fields that we care about
+ before using them, and make the file header data local to
+ read_the_mips_symtab rather than global.
+
+Sat Jul 6 01:34:15 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * ns32k-opcode.h (movmw, movmd): Fix opcodes. Bug fix
+ from Rune Nerg}rd <runene@ifi.uio.no> on 5 Jul 1991.
+
+ * main.c (command_line_input): Flush stdout and stderr
+ before every call to readline. This reportedly fixes a bug
+ that comes up in Sys V running emacs-gdb and/or xxgdb,
+ when stdin/out are pipes or sockets.
+
+Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * configure.in, Makefile.in: Avoid rebuilding "depend" as much.
+ Avoid declaring Makefile dependencies, because GNU Make stupidly
+ tries to update it if we do.
+
+ * coffread.c: Revise for minor changes to bfd internal coff
+ indexes.
+
+ * configure: If -template= is given a relative path, make it
+ absolute before recurring in subdirectories.
+
+ * configure, configure.in, Makefile.in: Install "configure" script
+ as replacement for config.gdb.
+ * config.gdb, Makefile.dist, Makefile.sdir: Remove
+ * README: Update for configure, mostly. FIXME.
+
+ * Add dec3100 as equivalent to littlemips. Indicate in all host &
+ target config files that they are for the host. When the lines
+ get copied into the Makefile, this makes it more obvious what's
+ up.
+
+Mon Jun 24 23:49:07 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * sparc-opcode.h (trap opcodes): Avoid leading spaces or
+ tabs, which end up in the disassembler output inadvertently.
+
+Wed May 29 23:01:03 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Make it compile cleanly in an ANSI GCC2 environment.
+
+ * blockframe.c: <stdio.h>
+ * cplus-dem.c: free takes a void *, ifdef __STDC__
+ * dbxread.c (read_huge_number): avoid gcc2 bug hoisting calc of
+ LONG_MAX/radix.
+ * defs.h (alloca): Avoid doing anything if alloca already def'd.
+ * stddef.h, stdlib.h: Remove these files.
+ * symtab.c: Avoid declaring qsort, close.
+ * symfile.c: Avoid declaring close.
+ * utils.c (vprintf): Declare "ap" arg as proper va_alist.
+ * sparc-tdep.c: Avoid including lots of Sun-host-specific files.
+
+ Assorted other changes.
+ * dbxread.c: include "libaout.h", not "liba.out.h".
+ * printcmd.c (print_frame_args): Set recurse properly for
+ indentation of struct and array parameters.
+ * valops.c (value_cast): Allow cast to void.
+ * infrun.c (resume): If NO_SINGLE_STEP, call machine dependent
+ single_step() in a target-independent fashion.
+ * sparc-tdep.c (single_step): Don't call ptrace ourselves, just
+ set up to be ready to continue. This makes us target independent.
+ * infptrace.c (child_resume): Remove call to single_step; now
+ can single step a SPARC target of any kind.
+
+Wed May 22 18:18:24 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * Makefile.dist, doc/gdb.texinfo, doc/*-m4.texinfo: split up GDB
+ docn into separate sections---basically chapters, plus two loose
+ pieces that can be configured to go in different places. This
+ allows GNU m4 to preprocess the manual without coredumping.
+
+ * Makefile.dist: tell TeX where to find texinfo.
+
+Mon May 20 12:15:04 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * Makefile.dist, doc/gdb.texinfo: respectively create, and use,
+ the new target "rdl-apps.texinfo" which captures the Makefile
+ variable that records where to find the Readline libraries.
+
+Sun May 19 05:36:59 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * tahoe-pinsn.c: #include "tahoe-opcode.h", not "opcode.h".
+ * tm-tahoe.h (FIX_CALL_DUMMY): Ignore more parameters.
+ * defs.h (const, volatile): Only define if not already defined.
+ * Makefile.dist (gdb.tar.Z): Create doc subdir w/out CVS/RCS crud.
+
+ * README: Update for release 3.95.
+ * config.gdb: Don't create readline dir in subdir builds.
+ * main.c: Include with "..." form for non-system include files,
+ so "gcc -MM" for "make depend" works.
+ Include readline files with "...h" rather than <readline/...h>.
+ * mipsread.c: Include "ecoff.h" rather than "intel-coff.h".
+
+ * coffread.c: Undo minor damage done by Rich Pixley. Use
+ different internal and external representations of COFF
+ data structures. Use new BFD routines for swapping them in and
+ out.
+ * symfile.c (free_named_symtabs): Avoid freeing file names that
+ are null or empty. Old i960 tools seem to produce files that
+ claim to have empty names, causing each successive file read
+ to blow away the previous one.
+ * sparc-xdep.c (deferred_stores): Repair minor damage by Rich.
+ Move deferred_stores to top of file, but don't separate its
+ #define's from its variable. Add commentary.
+ * Makefile.dist: Fix Rich damage; undo "configure" changes in
+ favor of keeping the (working) config.gdb. Move readline
+ library up a notch.
+
+Fri May 17 12:49:56 1991 Per Bothner (via gnu at cygint.cygnus.com)
+
+ * dbxread.c (read_struct_type): Try to handle g++ version 1 MI
+ debug info.
+ * infptrace.c (fetch_registers): no result, since now void.
+ * tconfig/news: target depends on m68k-tdep too.
+
+Fri May 17 14:40:14 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * Makefile.dist: added readline/inc-*.texinfo to dependencies for
+ gdb.dvi target
+
+ * readline/inc-history.texinfo, readline/inc-readline.texinfo:
+ applied various small fixes due to or inspired by RMS comments
+
+ * doc/gdb.texinfo: finished using all RMS comments, save those for
+ appendices on readline and cmd history (which are in other source
+ files)
+
+Thu May 16 18:06:05 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * doc/gdb.texinfo: (1) Updated w/ref to RMS comments through
+ chapter 9; (2) documented 'break' command's menu mode for
+ overloaded names, in response to hgs problem report C++ p-31
+
+Wed May 15 11:02:48 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
+
+ * doc/gdb.texinfo: (1) better introductory example; (2) more
+ consistent use of @code, @samp, @file, @kbd throughout; small
+ cleanups to first three nodes; (3) new "Contributors" node;
+ (4) Appendix, Renamed Commands; (5) divert specialized startup
+ instructions to "Targets" chapter for generic manuals, while
+ leaving them up front for manuals specific to specialized
+ environments; (6) apply fixes from RMS comments through chapter 4.
+
+ * pretex.m4: modify explanatory text slightly (and redefine
+ "regexp") to keep GNU m4 from complaining. (It still crashes
+ later, but one step at a time...)
+
+Wed May 15 10:32:12 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * readline/readline.c (update_line): Avoid dereferencing a pointer
+ before comparing it to its bounds. Saber caught this.
+ (init_terminal_io): Don't set BC from the "pc=" termcap variable,
+ and only set PC if tgetstr returned non-null. Saber caught this.
+
+Tue May 14 16:29:53 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
+
+ * Makefile.dist: put gdb.dvi stuff (updated to use M4 preprocessor
+ stuff for config manual) here where it counts; updated
+ to use new subdir structure (gdb/doc/).
+
+ * Makefile: generated from above via
+ config.gdb none
+ before checkin
+
+ * gdbint.texinfo: added instructions on generating gdb.info* files
+ locally for release. These are ordinary info
+ files, formatted from gdb.texinfo (via gdb-all.texinfo, see
+ Makefile)---but due to use of texinfo 2, can't count on makeinfo
+ to generate these, so we distribute them already formatted.
+
+ * gdb.texinfo: included full Info node and menu crud (as generated
+ by C-u M-x texinfo-master-menu using the texinfo-2 elisp code).
+
+ * Makefile: updated "gdb.dvi" target to use M4 preprocessor;
+ put in comments-for-future gdb.info target (one day makeinfo will
+ work again).
+
+Tue May 14 13:51:36 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
+
+ * gdb.texinfo: Updated to include new or old undocumented
+ commands, at least the following (perhaps some others I forgot to
+ record): info f, info float, info path, info program, info s, info
+ set, info source, info terminal, info types, info user, set/show
+ print object.
+ Also covered all recent GDB command renames for v4.
+
+Mon May 13 14:57:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * mipsread.c: Rather than keeping count of how many symtabs
+ and psymtabs we have, for sorting purposes, count them when
+ we need to sort. This fixes bug in rereading of symbol tables.
+
+Fri May 10 15:43:33 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
+
+ * infcmd.c: renamed "info path" to "show paths"
+ * gdbrc.tex: documented above.
+
+Wed May 8 04:51:11 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * remote.c: Fix comments.
+ * utils.c (error): Force out any pending wrap output.
+
+Sat May 4 11:11:07 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Makefile.dist: Roll VERSION to 3.95.
+ Fix up "saber_gdb" to work again.
+ * saber.suppress: Update.
+
+ * coffread.c, exec.c, infptrace.c, inftarg.c, remote.c, solib.c,
+ symtab.h, target.c, target.h: Lint.
+ * core.c: setup and select frame after reading shared libs,
+ else reading shared libs will clobber them. Lint.
+ * utils.c (error): Force out any buffered wrap text.
+
+Fri May 3 22:01:56 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * remote.c: Remove decls of memory_insert_breakpoint
+ and memory_remove_breakpoint, no longer used. (Suggestion of
+ Jan Norden).
+
+ * Makefile.dist: use ${subdir} in paths of BFD and LIBIBERTY,
+ to make it easier to interface to "configure"'d libraries.
+
+Fri May 3 13:10:01 PDT 1991 Roland Pesch (pesch at fowanton.cygnus.com)
+
+ * valprint.c: introduce "set p", "set pr", "show p" and "show pr" as
+ aliases for set/show print.
+
+Thu May 2 11:22:02 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * coffread.c (coff_sym_fns) [TDESC]: Make the type be m88kbcs.
+
+ * m88k-tdep.c (IEEE_isNAN): New function.
+
+ * infrun.c, m88k-tdep.c, m88k-xdep.c: Change
+ initialize_{tdesc,dcontext} to init_{tdesc,dcontext}.
+
+ * infrun.c [TDESC]: Add a bunch of crud.
+
+ * xm-88k.h [__GNUC__]: Don't define memset.
+
+ * m88k-xdep.c: #if 0 out push_breakpoint.
+
+ * tm-88k.h: Define GET_SAVED_REGISTER.
+
+ * tm-88k.h: Define DGUX.
+
+ * m88k-opcode.h (UEXT, SEXT, MAKE): Put parentheses around arguments.
+
+ * m88k-pinsn.c (sprint_address): Declare at top of file.
+
+ * m88k-xdep.c: #if 0 out core_file_command.
+
+ * values.c ({unpack_,value_as_}pointer): Just call
+ {unpack_,value_as_}long (for now anyway).
+
+ * m88k-tdep.c (get_saved_register): Make get_reg a dc_word_t (*)().
+ (psr_register): Change return type to dc_word_t.
+
+ * m88k-tdep.c (tdesc_read_function): Comment out call to ptrace.
+
+ * m88k-tdep.c (get_saved_register): Add lvalp parameter.
+
+ * gdbcore.h (write_memory): Don't prototype it.
+
+ * tm-88k.h, m88k-tdep.c: Make stack_error, stack_jmp global.
+ m88k-xdep.c: Don't mention stack_error.
+
+ * {x,t}config/m88k ({X,T}DEPFILES): Add missing files.
+
+ * mtrace.c: Don't typedef things like size_t, just #define them.
+
+ * coffread.c [TDESC]: #if 0 out references to coffsyn.
+
+ * symtab.h (struct symtab): Include EXTRA_SYMTAB_INFO.
+ tm-88k.h: Define EXTRA_SYMTAB_INFO.
+
+ * coffread.c [TDESC]: Include "tdesc.h" and make tdesc_handle
+ dc_dcontext_t not int.
+
+ * coffread.c [TDESC]: Use system include files not <intel-coff.h>.
+
+ * coffread.c [TDESC]: Move setting of debug_info from
+ coff_symfile_read to find_linenos and make it work with BFD.
+
+ * cplus-dem.c [__STDC__]: Make x{m,re}alloc return void*.
+
+ * signame.c: Cast const char* to char* when assigning to sys_siglist.
+
+ * utils.c (strsave): Make arg const char* not char*.
+
+ * infrun.c (wait_for_inferior) [SHIFT_INSN_REGS]: Use
+ bpstat_explains_signal (stop_bpstat) not stop_breakpoint.
+
+ * tm-88k.h (START_INFERIOR_HOOK): Make tdesc_handle a dc_handle_t.
+
+ * tm-88k.h (EXTRACT_RETURN_VALUE): Use char * not void *.
+
+ * findvar.c (read_var_value, case LOC_CONST_BYTES): Put the address
+ in a char *, not a CORE_ADDR. Use SYMBOL_VALUE_BYTES.
+
+ * tm-88k.h (INIT_EXTRA_FRAME_INFO): Use fci not prev (fci is
+ prev except from create_new_frame). Make next_frame a
+ local variable.
+ Declare get_prev_context.
+ {x,t}m-88k.h: Enclose USG and BCS defines in #if !defined.
+ m88k-{opcode.h,pinsn.c,xdep.c,tdep.c}: New files (same contents as
+ before; they had just been left out of the distribution for a long
+ time).
+
+Thu May 2 17:53:56 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Mips bringup and general cleanup
+
+ * cplus-dem.c: Move CPLUS_MARKER define to after defs.h.
+ * infptrace.c (PT_WRITE_D, PT_READ_D): Use correct values.
+ (This still doesn't seem to make MIPS bkpts work.)
+ * mipsread.c: Remove dup "Reading symbol data..." msg.
+ (symbol_file_command, add_file_command): Remove, obsol.
+ * printcmd.c (ptype_command): Say "an enum" rather than "a enum".
+ Wrap output appropriately.
+ * stack.c (locals_info, catch_info, args_info): Check
+ selected_frame rather than target_has_stack or coredumping.
+ * valprint.c (type_print_varspec_suffix): Wrap "ptype" output of
+ enums appropriately.
+
+Wed May 1 14:10:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * signame.c: Include defs.h and param.h.
+
+ * cplus-dem.c: Include defs.h and param.h.
+ Makefile.dist: Don't hack in the "param.h".
+ param.h: Don't include defs.h.
+
+ * expread.y: Use a union to deal with the fact that type_stack
+ can have both ints and enum type_pieces in it.
+ ({push,pop}_type_int): New functions.
+
+Tue Apr 30 13:18:58 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * cplus-dem.c (cplus_mangle_opname): Don't call error.
+ values.c (check_stub_method): Call error if NULL return from
+ cplus_mangle_opname.
+
+ * blockframe.c, breakpoint.c, core.c, command.c, findvar.c,
+ eval.c, expprint.c, infcmd.c, infrun.c, main.c, printcmd.c,
+ remote.c, source.c, stack.c, dbxread.c, coffread.c, symfile.h,
+ symfile.c, utils.c, valarith.c, values.c, valops.c, tm-68k.h,
+ target.c, inftarg.c, ieee-float.c, environ.c, defs.h,
+ command.h, inferior.h, gdbcore.h, symtab.h, expression.h,
+ symtab.c, cplus-dem.c, value.h, expread.y, valprint.c,
+ copying.awk, solib.c, inflow.c, symmisc.c
+ : Lint. Use read_memory not read_memory_integer on CORE_ADDR's.
+ Use {value_as,unpack}_pointer (added to values.c)
+ not {value_as,unpack}_long on CORE_ADDR's.
+ Use longest_to_int (added to defs.h) instead of cast to int.
+ Remove from_tty arg to mod_path.
+ Put symfile_bfd in {coff,dbx}read.c not symfile.h.
+ Use OP_NULL instead of 0 where dummy enum exp_opcode needed.
+
+ * tm-sparc.h: Remove GET_RWINDOW_REG.
+ (FRAME_CHAIN): Call sparc_frame_chain.
+ sparc-tdep.c (sparc_frame_chain): New function.
+ tm-sparc.h (EXTRACT_STRUCT_VALUE_ADDRESS): call
+ sparc_extract_struct_value_address (added to sparc-tdep.c).
+
+ * xm-sun386.h: Don't define SET_STACK_LIMIT_HUGE.
+
+Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
+
+ * valprint.c (type_print_base): If the type being printed is a
+ struct containing undefined types, print "<undefine type>"
+ as the type instead of crashing.
+ * values.c (value_headof): Get the vtable pointer taking
+ TYPE_VPTR_BASETYPE into account.
+ * symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches.
+
+Mon Apr 29 13:22:51 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * Move BROKEN_LARGE_ALLOCA from tm-sun386.h to xm-sun386.h.
+
+ * sun386-xdep.c [!GDB_TARGET_IS_SUN386]: Just provide empty
+ functions which don't do anything.
+ tm-sun386.h: Define GDB_TARGET_IS_SUN386.
+
+ * Makefile.dist: Add comment about tm-sun3os4.h: tm-sun3.h, etc.
+
+ * sun3-xdep.c, tm-sun3.h, tm-68k.h: Change TARGET_SUN3 to
+ GDB_TARGET_IS_SUN3.
+
+ * infrun.c: Don't include sys/user.h and friends (wrong for
+ cross-debugging and not necessary anymore (see IN_SIGTRAMP in
+ xm-vax.h)).
+ [SET_STACK_LIMIT_HUGE]: Include <sys/{resource,time}.h>.
+ xm-tahoe.h: Don't define _DIRENT_.
+
+ * xm-tahoe.h: Remove USE_OLD_TTY (not needed now that terminal.h
+ includes sgtty.h before sys/ioctl.h).
+
+Sun Apr 28 22:04:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined
+ or not defined. Don't define it based on TARGET_BYTE_ORDER if
+ it's already defined (in the tm.h file).
+ mips-opcode.h (BIT_FIELDS_*),
+ values.c (modify_field, unpack_field_as_long):
+ Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN.
+ {x,t}m-tahoe.h, tahoe-pinsn.c, tahoe-opcode.h: New files.
+
+Fri Apr 26 12:02:06 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * tm-sparc.h: Add comments about gcc version 2 and structure passing.
+
+ * xconfig/i386v{,32}{,-g}: Add XM_CFLAGS=-Dgetpagesize()=4096.
+ gmalloc.c: #if 0 out !HAVE_GETPAGESIZE code.
+
+ * expread.y (abs_decl): Accept '&' and '&' abs_decl.
+
+ * symtab.c, symtab.h: Have a builtin_type_{,unsigned_}long_long
+ regardless of LONG_LONG.
+ defs.h (TARGET_LONG_LONG_BIT): New macro.
+ expread.y (typebase): Add {unsigned,} long long {,int}.
+
+Thu Apr 25 12:31:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * valops.c (typecmp): If t2 == 0, return 1.
+
+Wed Apr 24 09:45:17 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+ Changes from Tiemann:
+ * cplus-dem.c (optable): Add "nw", "dl", "compound".
+ (cplus_mangle_opname): New function.
+ (do_type): Add case 'Q'.
+ * values.c (check_stub_method): Do lookup_method_type and stuff
+ rather than smash_to_method_type.
+ symtab.c, symtab.h (allocate_stub_method): New function.
+ dbxread.c (read_type): If we get "##", don't lookup_function_type
+ and start clobbering it; allocate_stub_method instead.
+ * printcmd.c (x_command): Dereference references.
+ * valprint.c (type_print_varspec_prefix, case TYPE_CODE_METHOD):
+ Don't print " " type_print_base (...) "::" if !passed_a_ptr.
+ * dbxread.c (read_struct_type): Put "op$" instead of "operator"
+ in the symbol table.
+ * values.c (check_stub_method): Deal with operator names.
+ * valprint.c (cplus_val_print): Check for error in baseclass_addr.
+ * values.c: Move declaration of cplus_demangle to top of file.
+ * values.c (baseclass_addr): If can't read memory, set *ERRP
+ rather than calling error().
+ * value.h: Remove redundant declaration of value_static_field.
+ * values.c (value_static_field): Recursively check all baseclasses.
+ Return NULL if not found.
+ * values.c, value.h: New functions value_{headof,from_vtable_info}.
+ * valprint.c (val_print): Print out first element of vtbl
+ specially.
+ * valprint.c: Move print controls to top and add objectprint.
+ Add command "set print object on/off".
+ * valprint.c (value_print, is_vtbl_member): Put things in local
+ variables rather than continually doing VALUE_TYPE (val), etc.
+ * valops.c (value_struct_elt_for_address): Call check_stub_method.
+ * valops.c (value_struct_elt): Remove found, arg1_as_ptr.
+ * valops.c (search_struct_method): Give error if j > 0 && args == 0.
+ * valops.c (search_struct_field): New argument looking_for_baseclass.
+ Give error if value_static_field or value_primitive_field
+ return NULL.
+ valops.c (various): Call search_struct_field with extra parameter.
+ * symtab.c (decode_line_1): Deal with operators specified as
+ "operator" <optional whitespace> <symbols for operator>.
+ (operator_chars): Help do it.
+ * symtab.c (lookup_struct_elt_type): Call check_stub_type.
+ Take additional argument noerr.
+ Don't dump core if TYPE_FIELD_NAME is NULL.
+ Check the baseclasses recursively.
+ * symfile.c (fill_in_vptr_fieldno): Don't call check_stub_type.
+ Return void not int. (also declarations in symfile.h and value.h).
+ Deal with multiple inheritance.
+ * printcmd.c (print_command_1): Add if (objectprint) code.
+ * expread.y (variable): Allow for destructor with foo::~name.
+ * eval.c (evaluate_subexp, case UNOP_LOGNOT): If following opcode
+ is OP_SCOPE, give an error.
+ * eval.c (evaluate_subexp): Pass third arg to lookup_struct_elt_type.
+ * eval.c (evaluate_subexp), values.c (value_virtual_fn_field):
+ Don't bother to do anything with
+ return value from fill_in_vptr_fieldno.
+ * eval.c (evaluate_subexp): If value_static_field returns NULL,
+ give an error.
+ * dbxread.c (read_struct_type): Set fcontext to 0 for normal member
+ function.
+ * dbxread.c (read_struct_type): Initialize name to 0.
+ * dbxread.c (read_ofile_symtab, N_CATCH): Add offset to bufp->n_value.
+ * dbxread.c (dbx_create_type): Zero TYPE_VPTR_BASETYPE.
+ (read_struct_type): Don't bother to set TYPE_VTPR_{BASETYPE,FIELDNO}
+ if it's just going to be {0,1}.
+
+ * dbxread.c (virtual_context): Use TYPE_BASECLASS starting at 0
+ (yes, it's #if 0, but just in case...).
+
+ * vax-opcode.h, expread.y, expprint.c, cplus-dem.c: Declare some
+ things "const".
+
+ * i386-stub.c: New file.
+
+ * WHATS.NEW: Remove mention of readline and more paging (in 3.5).
+ Try to keep command names up to date with renaming.
+
+ * gmalloc.c [!HAVE_GETPAGESIZE]: Try to figure out the pagesize.
+
+ * infun.c (resume, resume_cleanups): New functions.
+ (wait_for_inferior, proceed, child_create_inferior): Use resume
+ not target_resume.
+
+ * remote.c (getpkt): Don't set immediate_quit.
+
+ * blockframe.c, frame.h (reinit_frame_cache): New function.
+ solib.c (solib_add), symfile.c ({,add_}symbol_file_command):
+ Use it.
+
+Tue Apr 23 10:38:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * symtab.c (lookup_symbol): Add 3 more of those loops through
+ the symtabs which we all know and love: (1) Look in the
+ STATIC_BLOCK for mangled symbols right after we check the blocks,
+ (2, 3) Look in the STATIC_BLOCK for all the symtabs and psymtabs
+ at the end.
+
+ * main.c (cd_command): Call dont_repeat.
+
+ * dbxread.c (read_struct_type): If const/volatile character is
+ missing, don't complain, just continue.
+
+ * dbxread.c (read_struct_type): Only try to read the fcontext if
+ it is there. Also change "error_type " to "return error_type ".
+ values.c (value_virtual_fn_field): If there is no fcontext,
+ then do things the way GDB 3.x did.
+ valops.c (search_struct_method): Add type to value_virtual_fn_field
+ arguments.
+
+ * dbxread.c (read_struct_type): Fix typo: *pp != '\0' -> **pp != '\0'.
+
+Mon Apr 22 00:02:43 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * printcmd.c (print_scalar_formatted): Add 't' for binary.
+
+ * dbxread.c (end_psymtab): Initialize pst->symtab.
+
+ * core.c (core_open): Call ADD_SOLIB.
+
+ * tm-sparc.h: Include <sun4/reg.h> not <machine/reg.h>.
+ sparc-tdep.c: Don't include <machine/reg.h>.
+
+ * sun3-xdep.c [!TARGET_SUN3]: Just provide empty functions which
+ don't do anything.
+
+ * core.c (core_open): Add make_cleanup (unpush_target, &core_ops).
+
+ * Shared library/corefile changes from Peter Schauer:
+ core.c (core_close): Call CLEAR_SOLIB.
+ (core_open): Remove comment about "should deal with shared lib".
+ (core_xfer_memory): If we can't xfer the usual way, try the
+ shared libraries.
+ solib.c (so_list): New fields so_bfd and so_sections{,_end}.
+ (find_solib): Use solib_map_sections to get ld_text.
+ (solib_map_sections, solib_xfer_memory): New functions.
+ (clear_solib): Free so_sections and close so_bfd.
+ tm-sunos.h: Add solib_xfer_memory, solib_add.
+
+ * sparc-tdep.c (skip_prologue): Don't skip anything unless there
+ is a "save" instruction in there somewhere.
+
+ * symfile.c (symbol_file_add): Add comment.
+ solib.c (solib_add): Don't malloc name passed to symbol_file_add.
+
+ * exec.c (build_section_table): If *start isn't NULL, free it.
+
+ * stack.c (parse_frame_specification): Error if NULL selected_frame.
+ infcmd.c (finish_command): Error if NULL selected_frame.
+ inflow.c (kill_command): Deal with NULL selected_frame.
+ stack.c (record_selected_frame): Set *FRAMEP to NULL if there
+ is no selected frame.
+ infrun.c (restore_inferior_status): Add comment.
+ findvar.c (read_var_value): Check for NULL frame where we need
+ a frame.
+ breakpoint.c (get_catch_sals): Check for NULL selected_frame.
+
+ * breakpoint.c (bpstat_print): Try all elements on the bpstat
+ chain before giving up with an internal error.
+
+Sun Apr 21 21:43:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * value.h, values.c (value_{,free_to_}mark): New functions.
+ breakpoint.c (bpstat_stop_status): Use them.
+
+ * tm-i386v{,-g}.h: Remove N_SET_MAGIC define.
+
+Sat Apr 20 21:42:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * i386-tdep.c: Remove unnecessary #includes.
+
+ * symtab.c (various): Change error return of find_line_common to -1.
+
+ * coffread.c (find_linenos): Use LINESZ not sizeof (struct lineno).
+
+ * coffread.c (end_symtab): Initialize language, dirname, and
+ fullname fields.
+
+Fri Apr 19 18:18:31 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * mips-tdep.c (mips_frame_chain): Don't chain if saved_pc == 0.
+
+ * stddef.h (size_t): Let either _SIZE_T or _SIZE_T_ guard it.
+
+ * mipsread.c (parse_symbol): Set startup_file_{start,end} if
+ entry_point is in current file.
+
+ * findvar.c (read_register_gen): Add "target byte-order" comment.
+
+Wed Apr 17 17:09:48 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * i386-tdep.c (i386_get_frame_setup): Use SWAP_TARGET_AND_HOST
+ before returning locals or slocals.
+
+ * i386-tdep.c (i386_follow_jump): Do not add data16 to pos in
+ call to codestream_seek; add one to pos if (and only if)
+ we are dealing with a jump with data16 == 1 (i.e. 0x66, 0xe9).
+
+Mon Apr 15 12:04:32 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * valops.c (call_function_by_hand): Put dummy1 in target order
+ before FIX_CALL_DUMMY.
+
+ * tm-i386v.h (FIX_CALL_DUMMY): Don't depend on host byte order.
+
+Sun Apr 14 11:55:19 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * valops.c (push_word): Add SWAP_TARGET_AND_HOST.
+
+ * remote.c (remote_open): Send '+' before calling putpkt().
+
+ * tm-i386v.h (REGISTER_VIRTUAL_TYPE): Return pointer to void,
+ not int, for pc, fp, and sp.
+
+ * remote.c (remote_open): Call start_remote after putpkt("?");
+ infrun.c (start_remote): Also call wait_for_inferior & normal_stop.
+
+Sat Apr 13 22:11:42 1991 Jim Kingdon (kingdon at spiff.cygnus.com)
+
+ * exec.c: Include <ctype.h>.
+
+ * sun3-xdep.c (fetch_core_registers): Add #ifdef FP0_REGNUM.
+
+Fri Apr 19 09:36:50 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * tm-68k.h (NUM_REGS): Conditionalize on TARGET_SUN3 not sun.
+ tm-sun3.h: Define TARGET_SUN3.
+
+ * utils.c: Use CPLUS_MARKER not '$'.
+
+ * cplus-dem.c: Use CPLUS_MARKER not '$'. If CPLUS_MARKER isn't
+ defined, define it to '$'.
+
+ * arm-opcode.h: New file (same contents as before; it had
+ just been left out of the distribution for a long time).
+
+ * tm-68k.h: Put declaration of ext_format_68881 outside the macros.
+
+ * main.c: New HAVE_SIGSETMASK #ifdefs.
+
+ * coffread.c (read_coff_symtab): Check for "LF%" with all the
+ other L*% things.
+
+ * coffread.c (SDB_TYPE): New macro.
+ various: Use it instead of checking against T_NULL.
+
+ * Makefile.dist (cplus-dem.o): Hack in an #include "param.h"
+ before we compile it.
+ defs.h: Protect against multiple inclusion.
+ param.h: Include defs.h.
+ signame.c: Change #ifdef SYS_SIGLIST_MISSING to #if.
+ param-no-tm.h: Define SYS_SIGLIST_MISSING from USG.
+
+Thu Apr 18 19:49:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * i386-pinsn.c (OP_E): Change %d to 0x%x for consistency.
+
+ * putenv.c: New file
+ Makefile.dist: Add it to $(OBS).
+
+ * mipsread.c [!CMUCS]: #include <syms.h>.
+
+ * mips-xdep.c (fetch_core_registers): #if 0 out the whole function.
+
+ * Move read_memory_nobpt from mem-break.c to breakpoint.c.
+
+Mon Apr 15 21:45:35 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * utils.c (_initialize_utils): Rename "set demangle" to
+ "set print demangle", "set asm-demangle" to "set print
+ asm-demangle" and "set sevenbit-strings" to "set print
+ sevenbit-strings".
+
+ * main.c (initialize_main): Rename "set history write" to
+ "set history save".
+
+ * main.c (initialize_main): Rename "set caution" to
+ "set confirm".
+
+ * values.c (_initialize_values): Remove "info history" alias
+ for (what is now) "show values".
+
+ * infcmd.c, gdbcmd.h: Add unsetlist.
+ infcmd.c: Add unset_command.
+ (_initialize_infcmd): Add "unset" and use it for "unset env".
+
+ * breakpoint.c (_initialize_breakpoint): Remove "unset".
+
+ * valprint.c: Add "set/show print", {set,show}_print.
+ Rename "set addressprint" to "set print address".
+ Rename "set arrayprint" to "set print array".
+ Rename "set array-max" to "set print elements".
+ Rename "set prettyprint" to "set print pretty".
+ Rename "set unionprint" to "set print union".
+ Rename "set vtblprint" to "set print vtbl".
+
+ * main.c: Rename version_info to show_version.
+ (_initialize_main): Rename "info version" to "show version".
+
+ * values.c: Rename value_history_info to show_values.
+ (_initialize_values): Rename "info values" to "show values".
+
+Sun Apr 14 23:08:34 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * inftarg.c (child_open), remote-vx{,.68}.c (vx_proc_open):
+ New function to give correct error message.
+
+Thu Apr 11 17:19:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
+
+ * target.h: Add to_doc and target_preopen.
+ target.c: Add target_preopen and target_command.
+ Remove target_info.
+ (add_target): Call add_cmd and mess with targetlist->doc.
+ core.c, exec.c, remote-eb.c, remote-nindy.c, remote-vx.c,
+ remote-vx.68.c, inftarg.c, remote.c: Add doc field to target struct.
+ Call target_preopen from open routine.
+
+ * main.c: Rename editing_info to show_commands.
+ (_initialize_main): Rename "info editing" to "show commands".
+
+ * source.c: Rename directories_info to show_directories.
+ (_initialize_values): Rename "info directories" to "show directories".
+
+ * values.c: Rename convenience_info to show_convenience.
+ (_initialize_values): Rename "info convenience" to "show convenience".
+
+ * copying.awk (_initialize_copying): Rename "info copying" to
+ "show copying" and "info warranty" to "show warranty".
+ Rename {copying,warranty}_info to show_{copying,warranty}.
+
+ * symfile.c: Rename add_syms_command to add_symbol_file_command.
+ (_initialize_symfile, add_syms_addr_command):
+ Rename add-syms to add-symbol-file.
+
+Thu Apr 18 18:08:30 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * symfile.h (free_named_symtabs): Rename from free_named_symtab.
+ * symfile.c (clear_symtab_users_once, cashier_psymtab,
+ free_named_symtabs): Move these routines from symmisc.c.
+ * symmisc.c (same): same.
+ (free_symtab): Make non-static.
+ * symtab.h (free_symtab): Declare as exported void fn now.
+ * dbxread.c (end_symtab, end_psymtab): Change comments.
+ (initialize_dbxread): Call dbx_new_init() in case the first
+ command is add-symbols.
+ * target.c (dummy_target): Permit add_syms_addr_command.
+
+Sat Apr 13 14:46:07 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Permit symbols to be superseded when new symbol files have
+ been read in, particularly for VxWorks.
+
+ * dbxread.c (read_dbx_symtab): Allow N_SOL to cleanly take us back
+ to the main file, as well as to include files. Also, put global
+ functions into the global psymtab, to make "i fun" work.
+ (end_psymtab): Free named symtabs and psymtabs for a file, once a
+ new psymtab for it has been read.
+ * coffread.c (end_psymtab): Free named symtabs and psymtabs for
+ a file, once a new symtab has been read for it.
+ * mipsread.c: FIXME. We need to do the same for MIPS, but it
+ looks harder to determine the top-level block before it's been
+ queued to the psymtab list.
+
+ * symfile.c (symbol_file_add): Use filtered printing and wrap it.
+ If we have wiped out any old symbol tables, clean up at end of
+ symbol reading.
+ (symbol_file_command): Don't reference symfile_fns if it's zero.
+
+ * symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New
+ defines for the blocks of a blockvector that contain global and
+ file-static symbols and the first of the smaller scope contours.
+ * symtab.c (lookup_symbol, find_pc_symtab, find_pc_line,
+ decode_line_1, make_symbol_completion_list): Use the above.
+ * coffread.c (end_symtab, patch_opaque_types): Ditto.
+ * dbxread.c (end_symtab): Ditto.
+ * expread.y (block): Ditto.
+ * mipsread.c (throughout): Ditto.
+ * symmisc.c (free_named_symtabs): Ditto.
+
+ * symtab.c (list_symbols): Process the first symbol of the
+ static psymbols list.
+ (types_info): Restore this function from its untimely #if 0.
+ It's not perfect, but it is better than nothing.
+ (_initialize_symtab): Restore "info types".
+
+Thu Apr 11 05:23:19 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * m68k-stub.c: Remote stub for 680x0's, created from
+ rem-m68k.shar (which is removed).
+ * nindy-share/{Makefile,Onindy.c,blout.h,env.h,nindy.c,ttyflush.c}:
+ Remove RCS log stuff now that we use CVS and it blows our diffs.
+
+Wed Apr 10 14:18:06 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * symmisc.c (free_named_symtab): Make it work, in its current
+ kludgy fashion. Change result to indicate if we blew away bkpts.
+ * dbxread.c (end_symtab): Accumulate result from
+ free_named_symtab and print warning if we blew user's state.
+ * symfile.h: free_named_symtab now returns an int.
+
+Mon Apr 8 23:57:43 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * dbxread.c (dbx_symfile_read): Initialize psymbol list if this
+ is the first symbol read, even if not mainline.
+ (dbx_psymtab_to_symtab): symfile might be zero, cope.
+ * exec.c (exec_ops): Add_syms_addr is valid in our tvec.
+ (set_section_command): New command ("section xxx yyy" -- should
+ be renamed to "set section xxx yyy" FIXME) which sets the
+ base address of a section of the exec file, overriding the
+ virtual address that BFD reports.
+
+Fri Apr 5 17:14:39 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * exec.c: Add add_syms_addr_command to exec_ops, so you can
+ load symbols at any address while examining an exec file.
+
+Thu Apr 4 10:09:35 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * tm-i386v.h (FLOAT_INFO): Don't define it, since the code
+ for printing the float info is host-dependent, not
+ target-dependent. FIXME.
+ * i386-pinsn.c: Move #includes to top, remove useless ones.
+ * i386-tdep.c: Don't bother including <.../reg.h> since we
+ don't use it (and it doesn't exist on host systems).
+
+ * ieee-float.c (ieee_extended_to_double): Convert NaN to Inf.
+ Convert negative numbers properly.
+ (ieee_test): Make numbers really random; fix format arg.
+
+ * infcmd.c (attach_command, detach_command): Don't repeat on CR.
+ * core.c (core_detach): Unpush core_ops, which might not be on
+ top. We used to just pop the top, which broke things. Don't
+ need dont_repeat() any more.
+ (core_file_command): Psst! Don't repeat it.
+ * remote-nindy.c (nindy_detach): Don't need dont_repeat() now.
+ * expprint.c (print_subexp): Avoid switch fallthru on
+ BINOP_ASSIGN_MODIFY, so we can print += and such.
+ * frame.h: Fix typo.
+ * inflow.c (kill_command): After killing inferior, print our
+ current frame in the core file, if we have one.
+ (generic_mourn_inferior): When inferior dies, either select
+ the current frame (in the new target, e.g. core file), or
+ set both the current and selected frames to NULL.
+
+ Changes from Peter Schauer.
+
+ * infptrace.c: Avoid <sys/ptrace.h> on USG.
+
+ * Make all file names fit in 14 characters (sigh and damn!):
+ mv hp300hpux-xdep.c hp300ux-xdep.c
+ mv symmetry-xdep.c symm-xdep.c
+ mv symmetry-tdep.c symm-tdep.c
+ mv convex-opcode.h convx-opcode.h
+ mv tm-vxworks960.h tm-vx960.h
+ mv tm-vxworks68.h tm-vx68.h
+ mv Makefile.srcdir Makefile.sdir
+ mv gdb-int.texinfo gdbint.texinfo
+ mv remote-sa.m68k.shar rem-m68k.shar
+ mv remote-multi.shar rem-multi.shar
+ * Makefile.dist, README, config.gdb, convex-pinsn.c,
+ tconfig/symmetry, tconfig/vxworks960, tconfig/vxworks68,
+ xconfig/hp300hpux, xconfig/symmetry: Change names to shorter
+ names.
+
+ * command.c (user_info_1, user_info): New command for listing
+ the user-defined commands.
+
+Wed Apr 3 15:00:26 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * dbxread.c (really_free_pendings): Clear file_symbols
+ and global_symbols after freeing them; otherwise, running
+ this function twice (if it appears twice on the cleanup
+ chain), we try to free things twice.
+
+ * dbxread.c (read_dbx_symtab): Calculate end_of_text_addr
+ based on text_addr (the address of text in core), not on addr (the
+ offset between text in the .o file and in core). This change
+ is from Peter Schauer.
+
+ * main.c: Define ALL_CLEANUPS as a cast of zero.
+ (return_to_top_level): Use it.
+ (main): Do all cleanups after each command run as part
+ of the gdb startup sequence. Also do all cleanups before
+ entering the command loop, and every time we exit the command
+ loop and reenter. Before, the cleanups from the startup sequence
+ were being left undone until the first error!
+ (command_loop): Rename do_nothing cleanup to command_loop_marker
+ so we can see it easily when examining the cleanup chain.
+ (init_signals): Add another do_nothing for signal handling.
+ (quit_command): Only try to kill target if it has execution.
+ Problems in the target stack got us into a state where
+ inferior_pid was nonzero but none of the targets had execution.
+ In this state you couldn't exit gdb.
+
+ * dbxread.c: Two changes from Peter Schauer.
+ (echo_command): Fflush output after an echo command.
+ (show_history): Pass all args to cmd_show_list.
+
+ * utils.c (init_malloc): Call mtrace to turn on tracing
+ if the environment variable MALLOC_TRACE is set to a file name.
+ * mtrace.c: Add source file which provides a log of every malloc,
+ free, and realloc to a trace file.
+ * mtrace.awk: Add source file which analyzes the trace file.
+ * Makefile.dist (GNU_MALLOC, MALLOCSRC): Add mtrace.{c,o,awk}.
+ (VERSION): Roll to 3.94.3.
+
+ * breakpoint.c (breakpoint_1): Add a space to "i watch" output.
+ (check_duplicates): Don't bother with watchpoints.
+ (set_raw_breakpoint): Comment about danger of this routine.
+ (watch_command): Parse and eval all args before calling
+ set_raw_breakpoint.
+
+ * solib.c (find_solib): Avoid error in referencing memory to
+ see if any more shared libraries have been added. This is
+ particularly useful if the target has terminated. Bug reported
+ by Peter Schauer.
+
+ Changes from Peter Schauer <pesrem@regent.e-technik.tu-muenchen.de>
+ in bringing up 3.94.2 on the Sun-3.
+
+ * Makefile.dist: Include CFLAGS in rule for cplus-dem.o.
+ * breakpoint.c (enable_breakpoint): Check for valid watchpoint
+ expression (in scope) before reenabling watchpoint.
+ * signame.c (init_sigs): Add missing declaration of i, fix
+ sys_siglist declaration.
+ * source.c (list_command): Fixed range computation to use
+ lines_to_list ().
+ * stack.c (backtrace_command): Do not allow command if target has
+ no stack, print informative error message.
+ * target.c (target_command): Do not write into command line
+ because this fails if the target command is used in a user defined
+ command. [This change was enhanced by gnu to support any-
+ unique-prefix matching on target names.]
+ * valops.c (value_struct_elt): Avoid infinite loop on an
+ erroneous attempt to print the member of function (try p main.p).
+
+Mon Apr 1 17:05:45 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * expread.y (name_no_typename): Avoid reduce/reduce errors
+ caused by ambiguity in handling NAME_OR_INT and NAME_OR_UINT.
+ Since the GDB parser really doesn't use name_no_typename in a
+ name-only context, the parser can't tell the diff between
+ names and numbers here. Avoid allowing a name_no_typename
+ to be a NAME_OR_*INT to resolve the conflict.
+
+Sun Mar 31 20:12:07 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Bugfixes from Mark Fox (markf@wrs.com) (test=testField.c):
+
+ * valprint.c (val_print_fields): bitfield printing didn't handle
+ byte order. Indirect through a few more fns to cope.
+
+ * values.c (modify_field): also cope with byte order.
+
+Sat Mar 23 10:02:21 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Cleanup for release 3.94.2:
+
+ * Makefile.dist: Pull REMOTE_OBS. Fix saber includes for BFD
+ include files. Roll version to 3.94.2.
+
+ * coffread.c (init_stringtab): Read length into unsigned char
+ array before swapping; don't assume 32-bit longs.
+
+ * target.c (target_info): Don't bother with get_sym_file, just use
+ the symfile global variable.
+ * symtab.h, symfile.c (get_sym_file): Delete it.
+
+ * dbxread.c (dbx_symfile_init): Don't depend on long == 4 bytes.
+ (define_symbol): Set symbol line number to 0 if not gcc-compiled.
+ (read_type): Replace one more error() with complain().
+
+ * mipsread.c (parse_partial_symbols): Replace printf with complain.
+
+ * i960-tdep.c: Fix copyright attribution.
+
+ * config.gdb: Quote all backquotes in doublequotes. You can
+ quote me on that. BSD 4.4 shell found this one.
+
+ * infptrace.c (throughout): The third argument to ptrace is an
+ int *, not an int.
+
+ * infrun.c (wait_for_inferior): When program has terminated, we
+ have to call target_terminal_ours before we pop that target off
+ the stack (e.g. before a call to target_kill or
+ target_mourn_inferior). This fixes problem where a program
+ terminates, then GDB stops for (tty output) and you have to type
+ "fg" to the shell to resume it. FIXME: This code for what to
+ do after termination really should be in normal_stop instead.
+
+ * gdbcore.h (read_memory_check): Change declaration; it changed
+ names months ago.
+
+ * terminal.h: Include <sgtty.h> before <sys/ioctl.h>, since in BSD
+ 4.4 prereleases, this avoids a bug in their sgtty compatability
+ support.
+ * remote.c: Use terminal.h rather than hand-rolling the same.
+
+ * signame.c, signame.h (psignal): Arg is unsigned, not int.
+ * utils.c (strsave, strstr): Fix arg types.
+ * valprint.c (val_print): lint
+
+ MIPS symbol table support from Per Bothner:
+
+ * symfile.c (symtab_fns): Remove initializer table that needs to
+ be hacked for each new symbol file format supported.
+ (add_symtab_fns): New function, chains symbol table
+ handlers into the global list.
+ (symfile_init): Search this list.
+ * symfile.h: Add next pointer, declare add_symtab_fns.
+ * coffread.c (_initialize_coffread): Call add_symtab_fns.
+ * dbxread.c (_initialize_dbxread): Call add_symtab_fns.
+
+ * mipsread.c (psymtab_to_symtab_1): return void instead of (struct
+ symbol *). Thus, we no longer need the hack to trash
+ pst->filename. Good, since that hack confused code in symfile.c!
+
+ (reorder_symtabs, destroy_all_symtabs): Removed static
+ all_symtabs, which was used to qsort symtabs in reorder_symtabs.
+ Instead, the latter now uses a temporary array (stack-allocated
+ from an obstack, and then freed).
+
+ (parse_symbol): Added a hack to fix up BLOCK_{START,END} if they
+ haven't been set in the outermost stBlock of a procedure. This was
+ a problem with f77 binaries on Ultrix 4.?.
+
+ (new_symtab, new_symbol, new_type): Continue changing code to use
+ obstacks more and otherwise conform to dbxread internal style.
+ Made the free_code of symtabs be free_linetable (as in dbxread)
+ instead of free_contents. This implies memory leaks when reading
+ a new symbol table, until the conversion is finished. Did change
+ (struct symbol) and (struct type) to be allocated on the
+ symbol_obstack. Blocks and blockvectors are among the things
+ still "leaking."
+
+ * mipsread.c (parse_partial_symbols, parse_fdr): It hasn't been
+ tested much, but it solved one problem (reported by Meissner), and
+ cleans up some other things. The problem happened when an
+ included file contains actual code (functions) and not just
+ definitions. The mips coff is a little inconvenient there, since
+ it may cause a procedure to be mapped to the wrong psymtab.
+
+ * mips-tdep.c (heuristic_proc_desc): Minor cleanup.
+ * mips-xdep.c (fetch_core_registers): Minor cleanup. FIXME,
+ this will need work for the new core paradigm.
+
+ Opcode patches from the net:
+
+ * mips-opcode.h: fix incorrect disassembly of the mfc1, cfc1, and
+ ctc1 instructions. Also, the cvt.d.w and cvt.s.w instructions were
+ missing altogether - they are added here. From Bruce Bauman.
+ * mips-opcode.h: The low mask for C0 instructions was too small.
+ From Garrett Lau. I modified the fix to check the entire 32-bit
+ opcode.
+
+ * ns32k-opcode.h: Fix opcodes for deiw and deid. From Bruce
+ Bauman.
+
+Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Roll in changes from Per Bothner (Tue, 25 Sep 90 11:11:04):
+
+ * dbxread.c (read_type): Pointer subtraction (value_sub in
+ valarith.c) sometimes failed because the types of the
+ pointers being subtracted were not identical.
+ These differed because dbxread.c was allocating pointer types
+ using dbx_alloc_type+smash_to_pointer_type instead of
+ lookup_pointer_type. I failed to find a justification for the
+ former, so I changed it to use the latter. Similarly, I
+ replaced smash_to_function_type by lookup_function_type,
+ and smash_to_reference_type by lookup_reference_type.
+
+ * mipsread.c (parse_symbol, upgrade_type, parse_procedure,
+ _initialize_mipsread): corresponding changes.
+
+ * symtab.c (smash_to_{pointer,reference,function}_type): eliminate.
+
+ * source.c (mod_path): Do tilde_expand on each component of the path,
+ rather than on the (list of) paths as a whole.
+ (print_source_lines): Set first_line_listed in addition to
+ current_source_symtab and current_source_line. If the source was
+ not findable, after a "dir" command to fix the problem,
+ a "list" would get the wrong lines.
+
+ While I was there... (gnu):
+
+ * dbxread.c (read_type): Change error to complaint.
+
+Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ First attempt at detailed understanding of symbol table memory alloc.
+
+ * dbxread.c (dbx_symfile_read): Free our string table if we
+ aren't the mainline. Free the "info" struct since we're done with
+ it.
+ (init_psymbol_list): Free any previously allocated psymbol lists.
+ (): FIXME: Should realloc-down the psymbol lists when done reading
+ the main symbol file?
+
+ * symmisc.c (free_symtab): Free fullname field too.
+
+ * xm-hp300hpux.h (USG): #undef then #define so Makefile can -D.
+ (REGISTER_ADDR): Make result type unsigned int.
+
+ * xconfig/{i386*,hp300hpux,altosgas,altos}: All config files that
+ define REGEX must also define REGEX1 (its dependency).
+
+Tue Mar 19 21:28:57 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * tconfig/i960: No longer works, points you at vxworks960 or
+ nindy960.
+
+ * xgdb.c, XGDB-README: Remove file. Users can get the much
+ better xxgdb.
+ * Makefile.dist: Remove all trace of xgdb.
+
+ * breakpoint.c (breakpoint_1): Pass demangle arg to
+ print_address_symbolic.
+ (clear_breakpoints): Remove unused function.
+ (breakpoint_re_set_one): Guts of breakpoint_re_set.
+ (breakpoint_re_set): Use catch_errors to do them all anyway.
+
+ * gdb-int.texinfo (Host versus Target): Add section on what is
+ a "host" feature versus what is a "target" feature.
+
+ * infcmd.c (path_command, path_info): Handle the PATH variable
+ (object search path) as conveniently as the source search path.
+ * environ.c (set_in_environ): Set some vars in GDB's environment,
+ in addition to the child's. PATH, G960BASE, G960BIN for starters.
+ * source.c (mod_path): New function, from guts of
+ directory_command, modifies a path. Used by path_command.
+ (directory_command): Call it.
+ * defs.h (strsave): Declare.
+
+ * utils.c (sevenbit_strings): Add new printing option.
+ (printchar): Use it.
+ (strsave): Provide this handy helper routine.
+ (set_width_command): Rename set_screen_width_command.
+ (_initialize_utils): "set screen-width" => "set width";
+ "set screen-height" => "set height"; add sevenbit-strings.
+
+ * infcmd.c (do_registers_info): Print floating point registers
+ in raw hex as well as float format, regardless of whether it is
+ a "virtual" convertible register.
+ * tm-sparc.h (PRINT_REGISTER_HOOK): Print every pair of float
+ regs as a double, just in case it's being used that way.
+ * values.c (unpack_long): Comment on array/function coercion.
+ (unpack_double): Argument is in target byte order now. For
+ integer arguments, just call unpack_long and float the result.
+ * m68k-tdep.c: include defs.h for "const" handling.
+ * remote-nindy.c: Use ieee-float stuff.
+ (nindy_fetch_registers): Unpack double regs to host double, then
+ to extended.
+ (nindy_store_registers): Pack extendeds to host double, flip
+ around by misusing unpack_double, send as target double.
+
+ * tm-vxworks68.h (FRAME_CHAIN): Handle current frame pointer of
+ zero, as when stopped at the first instruction of a process.
+
+ * blockframe.c: Fix filename in comment (param.h => tm.h).
+ * sparc-tdep.c (skip_prologue): More explicit nudging comments.
+ * tm-68k.h: Fix typos.
+
+Fri Mar 15 01:09:34 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Changes from a bringup on the DEC Vax under Ultrix 4.0.
+
+ * coredep.c (fetch_core_registers): Pass end-address of register
+ section to register_addr as expected. Don't call supply_register
+ if we'd just pass it garbage.
+
+ * dbxread.c (read_dbx_symtab): Skip N_NSYMS on Ultrix.
+
+ * exec.c (xfer_memory): Use boolean xfer_fn result, not int.
+
+ * target.c (push_target, target_info): Cast enums to int for < or
+ > comparison.
+
+ * stack.c (print_frame_info): Identify source file & line
+ even if we can't print it.
+
+ * xm-vax.h (MISSING_VPRINTF): No longer missing in Ultrix V4.0.
+
+Sat Mar 9 10:08:20 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Clean up IEEE floating point support.
+
+ * ieee-float.h: New file.
+ * ieee-float.c: Write real routines to convert between host
+ doubles and various target IEEE extendeds.
+ * m68k-xdep.c: Eliminate assembler code for extended floats.
+ * xconfig/{3b1,altos,altosgas,hp300bsd,isi,news,news1000,sun2os3,
+ sun2os4,sun3,sun3os3,sun3os4}: Eliminate use of m68k-xdep.o.
+ * tm-i960.h, tm-68k.h (REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Use ieee_extended_to_double and
+ double_to_ieee_extended.
+ * i960-tdep.c: Define ext_format_i960.
+ * m68k-tdep.c: Define ext_format_68881.
+ * sparc-tdep.c: Define ext_format_sparc, though unused.
+ * Makefile.dist (HFILES): Add ieee-float.h.
+ * inftarg.c: #include "ieee-float.h" for the REGISTER_CONVERT
+ macros.
+
+ Obsolete the "coffstrip" program in favor of using BFD's strip.
+
+ * nindy-share/coffstrip.c: Remove file.
+ * nindy-share/nindy.c (coffstrip): Routine to run bfd_strip.
+ * Makefile.dist: Remove references to nindy-share/coffstrip.c.
+ * tconfig/nindy960: Remove reference to coffstrip.o.
+
+ * Makefile.dist: Roll version number to 3.94.1 (not yet final).
+
+Wed Mar 6 09:56:45 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * symfile.h: Add symfile_bfd, common between dbxread and coffread.
+ * dbxread.c: Remove static symfile_bfd.
+ * infcmd.c (do_registers_info): Add PRINT_REGISTER_HOOK, though
+ it is not used yet.
+ * inftarg.c (child_detach): Pop the child_ops vector if the
+ detach is successful.
+ * remote-nindy.c (nindy_create_inferior): Don't push a new
+ nindy_ops since nindy uses the same one for execution and memory
+ examination anyway.
+ * core.c (core_ops): Use child_attach and child_create_inferior
+ rather than default attach and create_inferior functions.
+
+ Handle floating point registers in core files.
+
+ * sparc-xdep.c (fetch_core_registers): Rewrite for float support.
+ * sun3-xdep.c (fetch_core_registers): Rewrite for float support.
+ This version untested since BFD doesn't yet support sun3 core
+ files.
+ * hp300hpux-xdep.c: Rewrite fetch_core_registers to new calling
+ conventions. Fix comments and style. This version has not
+ been compiled yet, since we have no HP inhouse.
+ * core.c (get_core_registers): Look for two sections, ".reg"
+ and ".reg2", and pass both to fetch_core_registers sequentially.
+
+ Revise directory path yet again.
+
+ * source.c (forget_cached_source_info): Not static any more.
+ (init_source_path): New default source path is "$cdir:$cwd".
+ (dir_command): Handle variable arguments ($cdir, $cwd).
+ (source_info): Print "Compilation directory" rather than
+ "Originally compiled in" to remind people of $cdir.
+ (openp): If the path contains $cwd, use current directory.
+ (open_source_file): If compilation directory is known, replace
+ first $cdir in path with the compilation directory.
+ (print_source_lines): Even if we can't print the lines, set the
+ current symtab and line for future commands like "info source" or
+ "breakpoint". Also, error message now contains the file name,
+ line number, and file access error message.
+ (_initialize_source): Fix help text to describe changes.
+ * main.c (cd_command): Forget cached source info when we chdir.
+ * utils.c (strstr): Add simple implementation.
+
+Tue Mar 5 01:41:40 1991 John Gilmore (gnu at fowanton.cygnus.com)
+
+ * coffread.c (read_one_sym, init_linetable, init_stringtab):
+ Byte-swap COFF symbol tables if necessary when reading them in.
+ Use complain() to replace error message in one spot. Needs
+ corresponding change in bfd/coff-code.h to make some symbol
+ swapping routines non-static.
+
+Mon Mar 4 00:53:40 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Merge changes from Eirik Fuller, for UTek.
+
+ * defs.h (errno): Add declaration.
+ * altos-xdep.c, arm-xdep.c, convex-xdep.c, gould-xdep.c,
+ hp300hpux-xdep.c, infrun.c, inflow.c, infptrace.c, i386-tdep.c,
+ i386-xdep.c, pyr-xdep.c, mips-xdep.c, remote-eb.c, remote-nindy.c,
+ remote-vx.c, source.c, standalone.c, stuff.c, sun386-xdep.c,
+ symmetry-tdep.c, symmetry-xdep.c, umax-xdep.c, utils.c: Eliminate
+ declarations of errno.
+
+ * remote-eb.c: Define B19200 and B38400 as EXTA and EXTB.
+
+ * remote-vx.c: Include <sys/time.h> for UTek; Sun gets it via
+ <rpc/rpc.h> and <rpc/types.h>.
+
+Sat Mar 2 15:47:55 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * i960-tdep.c (examine_prologue): Add new argument limit,
+ which stops the scan at the end of the prologue, or at the PC.
+ This fixes a problem where it walks down into the code for the
+ user's statements if that code looks like function prologues.
+ Mark Fox and I have been bouncing this code back and forth, making
+ small changes to it. Callers changed to match.
+
+Tue Feb 26 01:47:07 1991 Cygnus John Gilmore (cygnus at yuba)
+
+ Cleanup for gdb-3.94 release final:
+
+ * Makefile.dist: Remove remote-vx.c, remote-nindy.c, and all
+ the .c files from vx-share and nindy-share, from the various
+ macros, since they are not found via ALLDEPFILES.
+ (SFILES): Add tm-i960.h.
+ (alldeps.mak rule): Break out ALLDEPFILES_MAINDIR and
+ ALLDEPFILES_SUBDIR. List all the nindy and vxworks subdir files
+ in the SUBDIR list.
+ (TAGFILES_MAINDIR): Change ALLDEPFILES to ALLDEPFILES_MAINDIR.
+ (gdb.tar.Z): Use ALLDEPFILES_SUBDIR as well as SFILES_SUBDIR.
+
+Mon Feb 25 16:02:35 1991 Cygnus John Gilmore (cygnus at oldman)
+
+ * am29k-tdep.c: Add contribution line.
+ (examine_prologue): Cache information about function prologues in
+ the misc-function-vector to avoid lots of references over the
+ serial line while examining instructions.
+
+ * core.c (core_close): New function made from cleanup_core.
+
+ * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c,
+ remote-vx.c, remote.c, target.c, target.h,
+ Update target_ops vector to add attach, close, and load entries.
+ Use add_syms_addr_command, not add_file_addr_command, for
+ add_file. Break out close routine from existing code.
+
+ * dbxread.c (really_free_pendings): Don't free pending_blocks;
+ they are in an obstack.
+ (read_dbx_symtab): Relocate end_of_text_addr in the psymtab.
+ Lint.
+ (define_symbol): Add symbol type parameter; change callers;
+ pass type parameter to DBX_PARM_SYMBOL_CLASS macro to allow
+ it to influence the symbol class on the i960.
+ (define_symbol): Swap LOC_CONST's into target byte order.
+
+ * exec.c (exec_close): New function.
+ (exec_file_command): Call it.
+
+ * findvar.c (read_relative_register_raw_bytes): Doc byte order,
+ Fix byte order of frame pointer.
+ (read_var_value): Result of 0 if var's value can't be found,
+ e.g. missing FRAME_ARGS_ADDRESS. Byte-swap LOC_CONST and
+ LOC_LABEL values to target order. Add LOC_LOCAL_ARG.
+ (locate_var_value): Use read_var_value and use its lazy address
+ as the location of the var's value. Lint.
+
+ * i960-pinsn.c (next_insn): Add routine from vxgdb for scanning
+ instructions.
+
+ * i960-tdep.c (arg_address, i960_frame_find_saved_regs): Remove
+ obsolete Intel versions in favor of vxgdb versions.
+ (check_host, byteswap, byteswap_val, reorder_val): Eliminate
+ code dealing with byte order of values, which Intel did in host byte
+ order rather than gdb-4's target byte order.
+ (i960_frame_chain_valid): Move to nindy-tdep.c.
+ (examine_prologue, skip_prologue, frame_find_saved_regs,
+ frame_args_address, leafproc_return, saved_pc_after_call,
+ pop_frame): Add vxgdb versions from Mark Fox.
+ (examine_prologue, frame_struct_result_address): Add code
+ to deal with the saved value of G13 (struct return address
+ pointer).
+ (frame_args_address): Modify Mark's version to prefer the
+ saved value over the current value in the topmost frame.
+ Cache result in the frame info to avoid performance hair in
+ callers.
+ (print_fault): Add gdb960 code for printing faults.
+ (_initialize_i960): Actually call check_host.
+
+ * ieee-float.c (ieee_extended_to_double, ieee_double_to_extended):
+ add stub routines. FIXME, these currently just return zero!
+
+ * infcmd.c (program_info): Use PRINT_RANDOM_SIGNAL.
+ (attach_command): Call target_attach, not target_open, now.
+
+ * infrun.c (normal_stop): Make global, not static, for vx_attach.
+ (child_attach): Rename from child_open.
+ (wait_for_inferior): Use PRINT_RANDOM_SIGNAL. If stop_pc is zero,
+ don't confuse it with a zero step_resume_break_address.
+
+ * inftarg.c (child_detach): Eliminate inferior_pid test.
+ (child_files_info): Clean up message a bit.
+ (child_ops): Use child_attach, not child_open, to attach.
+
+ * mem-break.c: #ifdef out the whole file if BREAKPOINT is not
+ set (e.g. on VxWorks or NINDY). Move read_memory_nobpt from
+ findvar.c to here, since it depends on the contents of the
+ shadow_contents of breakpoints, but keep if #if 0 since it is
+ never called.
+
+ * nindy-tdep.c: New file, contains nindy_frame_chain_valid, moved
+ from i960-tdep.c.
+
+ * printcmd.c (address_info): Handle LOC_LOCAL_ARG. Lint.
+ (ptype_command, display_command): Eliminate have_inferior_p and
+ have_core_file_p in favor of target_has_stack or
+ target_has_execution.
+ (print_frame_args): Handle LOC_LOCAL_ARG. Eliminate duplicate
+ code for actually finding the values of arguments, though we still
+ keep track of the maximum stack offset for use in printing unnamed
+ arguments. Handle missing FRAME_ARGS_ADDRESS.
+
+ * remote-nindy.c (i960_print_fault): Move to i960-tdep.c.
+ (struct nindy_regs): Define registers passed to/from nindy.
+ (nindy_fetch_registers, nindy_store-registers): Translate between
+ nindy and GDB formats for the registers.
+ (dcache_init): Statically allocate the cache, since it was being
+ allocated by a malloc that was never freed anyway.
+ (nindy_create_inferior): Error, not core dump, if no exec file.
+ (nindy_before_main_loop): Use target_load, not target_add_file.
+
+ * remote-vx.c (net_load): Specify large timeout for load
+ requests. Allow user to break out with INTERRUPT.
+ (net_break): Remove useless code, clean up. Change callers.
+ (parse-args, skip_white_space, find_white_space): Clean up arg
+ parsing to cope with quoted strings.
+ (net_wait, net_quit): Never call error, just return status.
+ (vx_read_register, vx_write_register): Cleanup status checking.
+ #ifdef the code based on which CPU we are using (960 or 68k),
+ FIXME, this should be completely general but it isn't yet.
+ (vx_xfer_memory, vx_resume): Cleanup status checking.
+ (vx_run_files_info): Improve message.
+ (vx_load_command): Renamed from vx_add_file_command. Allow load
+ to be interrupted.
+ (net_ptrace): Remove unused routine.
+ (vx_wait): Adopt code from vxgdb960 to cope with broken
+ connections to target machine and prompt to disconnect. Remove
+ debug printouts. Map some EVENT_'s to SIGnals.
+ (add_symbol_stub, vx_open): Print names of object files we found,
+ and "ok" if we read their symbols OK. Clarify output in general.
+ (vx_attach, vx_detach, vx_kill): Add these commands.
+ (vx_convert_from_virtual, vx_convert_to_virtual): Simplify.
+ (vx_run_ops): Turn off all_mem, to avoid spurious msg in the
+ "info files" output, and create_inferior, since we already have
+ an inferior.
+
+ * stack.c (frame_info): Replace Frame_unknown with 0.
+ (print_frame_arg_vars): Handle LOC_LOCAL_ARG.
+ (return_command): Pop until the PC matches as well as the FP,
+ so it works even if the FP is shared with another function,
+ as in "frameless" or "leaf" procedures.
+
+ * symfile.c (load_command): renamed from add_file_target_command.
+ (add_syms_addr_command): renamed from add_file_addr_command.
+ (add_syms_command): Stub to call target_add_syms.
+ (_initialize_symfile): Change command names and descriptions,
+ add-file => add-syms, and load from alias to its own command.
+
+ * target.c (kill_or_be_killed, maybe_kill_then_attach,
+ maybe_kill_then_create_inferior): Default for attempts to start
+ a process, if one is already running, is to ask about killing
+ it and retry if yes.
+ (upstack_create_inferior): #if-0 it, strata obsolete it.
+ (push_target, unpush_target, pop_target): to_close() a target
+ before unstacking it.
+ (target_info): Renamed from target_files_info.
+ (_initialize_targets): Rename "i files" as "i target", accessible
+ under both names.
+
+ * target.h: Improve comments about the target_ vectored routines.
+
+ * tm-i960.h: Remove NINDY-specific stuff to tm-nindy960.h.
+ Convert commenting style to standard GNU style.
+ (DBX_PARM_SYMBOL_CLASS): allow LOC_LOCAL_ARG's to be recognized.
+ (SKIP_PROLOGUE): No longer a no-op.
+ (SAVED_PC_AFTER_CALL): Now handles leaf procedures.
+ (*_REGNUM): Sort register numbers.
+ (REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE,
+ MAX_REGISTER_RAW_SIZE, REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Float regs
+ are now 10 byte extendeds, not 8 byte doubles.
+ (FRAME_CHAIN_VALID): Make this config-dependent, since it differs
+ for nindy versus vxworks targets. FIXME, this should possibly go
+ in the target vector.
+ (EXTRA_FRAME_INFO, INIT_EXTRA_FRAME_INFO): Cache both
+ frame_saved_regs and arg pointer with each frame.
+ (FRAMELESS_FUNCTION_INVOCATION): New leafproc support.
+ (FRAME_ARGS_ADDRESS): Use cached result.
+ (FRAME_ARGS_ADDRESS_CORRECT): New, avoids g14 guessing.
+ (FRAME_FIND_SAVED_REGS): Change arg to subsidiary fn.
+ (PRINT_RAMDON_SIGNAL): Call print_fault.
+ (POP_FRAME): Now works.
+
+ * tm-nindy960.h: Break this off tm-i960.h. NINDY-specific
+ option parsing and startup; STACK_END_ADDR, FRAME_CHAIN_VALID,
+ BREAKPOINT, and DECR_PC_AFTER_BREAK are here.
+ (ADDITIONAL_OPTION_HANDLER): use target_load, not
+ target_add_file.
+
+ * tm-vxworks960.h: Break this off tm-i960.h. VxGDB specific
+ startup; DECR_PC_AFTER_BREAK, and FRAME_CHAIN_VALID are here.
+
+ * valarith.c (value_subscripted_rvalue): Avoid handling
+ floats and doubles specially; it gave alignment errors. Lint.
+
+ * valops.c (value_of_variable, value_of_this): Error if unknown
+ value.
+
+ * valprint.c (print_floating): Bcopy rather than pointer-deref,
+ to avoid alignment problems.
+ (value_print): Handle unknown value address.
+ (cplus_val_print): Two args are ignored; remove them. Change caller.
+ (val_print): Use unpack_long rather than pointer-deref.
+
+ * values.c: Lint.
+ (unpack_long, unpack_double): Use bcopy rather than pointer-deref
+ to avoid alignment problems.
+ (value_being_returned): Error if return value unknown.
+ (set_return_value): Add bogosity warning, FIXME. *
+
+ * TODO: A woman's work is never done.
+
+ * Makefile.dist: Distribute REMOTE_OBS into tconfig files.
+ Separate INCLUDE_CFLAGS for use with lint. Add LINTFILES.
+ Add ieee-float.o to OBS.
+ * tconfig/{nindy960,vxworks68,vxworks960}: Include the desired
+ REMOTE_OBS remote-interface files in the TDEPFILES and TM_FILE.
+ * tconfig/i960: FIXME. Half-merge, produce warning if config'd.
+
+ Changes to generalize the VxWorks RPC protocol slightly, to handle
+ i960 as well as 68000.
+
+ * vx-share/dbgRpcLib.h (VX_SOURCE_STEP): Add.
+ * vx-share/reg.h: Produce i960 regs #ifdef I80960
+ * vx-share/xdr_ptrace.c: Skip FPA registers if 960.
+ * vx-share/xdr_rdb.h: Add SOURCE_STEP struct and xdr decl.
+ * vx-share/xdr_rdb.c: Add xdr_SOURCE_STEP routine.
+ * vx-share/xdr_regs.c: Add xdr_regs, xdr_fp_status, xdr_ext_fp
+ for i960. Change xdr_vectors to xdr_opaques for 68k registers,
+ so they will move in target byte order rather than network
+ byte order (happens to be the same).
+
+Mon Feb 25 03:41:44 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * tm-convex.h (END_OF_TEXT_DEFAULT): Remove #if 0'd block.
+
+Sun Feb 24 00:55:53 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * am29k-pinsn.c,
+ Add contribution lines to various files, showing where they
+ came from.
+
+ * breakpoint.c (break_insn, check_break_insn_size,
+ read_memory_nobpt): Remove to mem-break.c.
+
+ * xm-*.h, param-no-tm.h, tm-29k.h, valprint.c: Change BYTE_ORDER to
+ HOST_BYTE_ORDER.
+
+ * tm-29k.h (STAB_REG_TO_REGNUM): Warn user if symbol table
+ entry has bad register number. This change is not
+ tested in this release, FIXME.
+
+ * frame.h: Eliminate Frame_unknown in favor of a simple zero.
+ tm-vax.h: Ditto.
+
+ * value.h: Force value's contents field to be aligned to hold
+ at least a double or a long long (if supported). This avoids
+ doing bcopy's in and out of the contents field.
+
+ (step_1): Avoid coredump under obscure circumstances when we
+ have no frame.
+
+ * symtab.h (misc_info): Add field to misc function vector for
+ any kind of cached information the target code desires. AMD
+ 29000 uses this to avoid repeating examine_function_prologue's.
+
+ * coffread.c: Lint. Remove static symfile, read_section_header.
+ core.c (have_core_file_p): Lint: remove.
+ expprint.c (print_subexp): Lint.
+ infptrace.c, valops.c, valprint.c: lint.
+
+ Roll in changes from vxgdb-5.0.1:
+
+ * symtab.h: Comment byte order of each address class. Add
+ LOC_LOCAL_ARG for frame-relative args (960).
+ expread.y: Use LOC_LOCAL_ARG where LOC_ARG is used.
+ symtab.c, symmisc.c: ditto.
+
+ * infrun.c (init_wait_for_inferior): Clear stop_signal.
+
+ * remote.c (remote_resume): Error if resume with a signal.
+
+ * symfile.c (prim_record_misc_function): Clear misc_info.
+ (fill_in_vptr_fieldno): Check stub type of arg.
+
+ * valops.c (value_cast): Avoid looking up names of types whose
+ name we don't know, to prevent coredump. Sun CC produces typedef
+ rtx and the name of *rtx is zero...
+
+Mon Feb 18 21:16:25 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Roll in changes from final AMD 29000 port (Tiemann).
+
+ tconfig/am29k: Add COFF_ENCAPSULATE and TARGET=TARGET_AM29K
+ for ../include/a.out.encap.h. This might not work now that BFD
+ is separately compiled. Instead, BFD support for encap will have
+ to translate machine type 29k into the right COFF_MAGIC.
+
+ * infcmd.c: Remove references to inferior_pid that aren't used
+ in actual ptrace calls; use target_has_execution, etc.
+ (have_inferior_p): Remove function.
+ (program_info): Print target info rather than "process number";
+ avoid gratuitous messages unless from_tty.
+ (run_stack_dummy, finish_command): Set proceed_to_finish.
+ infrun.c: Remove inferior_pid refs. Decl & init proceed_to_finish.
+ main.c: Lint. Lose have_inferior_p().
+ inferior.h (have_inferior_p): Remove, lint.
+ (proceed_to_finish): Add flag to ask that all regs be saved
+ by normal_stop, for the few commands that need it, speeding up
+ serial I/O. Add comments to stop_registers.
+
+ * remote-eb.c: Remove newline from breakpoint message we grep
+ for. Never time out when running the user program.
+
+
+
+Wed Feb 13 15:34:40 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Roll in changes from vxgdb-5.0.1:
+
+ * dbxread.c (read_dbx_symtab): If we encounter a "FORTRAN COMMON"
+ symbol in its raw form, we are processing an unlinked ".o" file.
+ See if the target environment has assigned it an address, using
+ target_lookup_symbol (VxWorks does), and enter it into the symtab
+ that way.
+
+ * tm-vxworks.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Override usual
+ 68k versions for a simpler version that assumes zero FP at bottom.
+ Fixes bug of truncated stack reports.
+
+ * target.h (target_lookup_symbol): Define this routine's args
+ and result, finally.
+
+ * target.c (nosymbol): Default routine for target_lookup_symbol.
+ (target_default): Default lookup_symbol and call_function too.
+ (files_info): Only print has_all_memory warning if a non-dummy
+ target follows.
+
+ * remote-vx.c (vx_read_register, vx_convert_to_virtual,
+ vx_convert_from_virtual): If target does not have floating point,
+ zero register "values", and avoid doing cross-net conversions.
+ (vx_lookup_symbol): Rename net_lookup_symbol, add to vectors.
+ (vx_open): Rearrange code that attaches to target and reads
+ symbols for all loaded modules, to work if some of the modules
+ are not accessible. Add symbol_stub() and add_symbol_stub()
+ as callbacks from catch_errors(). Allow connect attempt to be
+ interrupted painlessly with ^C (FIXME, there are still some bugs
+ if the interrupt happens during symbol reading.). Print
+ final message with puts_filtered, since symbol messages are
+ now filtered too.
+
+ Misc cleanup:
+
+ * main.c (catch_errors): Only print errstring if non-null.
+ (command_loop): Avoid an ioctl per command to test ISATTY.
+
+ * remote-vx.c (net_load): make static; avoid sophomoric msg.
+ (vx_xfer_memory): Return correct result!
+ (vx_files_info): Indicate whether target has float or not.
+ (vx_lookup_symbol): Complain, not error, if target gone.
+ (vx_open): Print "Connected" msg before disabling immediate-quit.
+ [FIXME: lookup_symbol and vx_open changes need testing.]
+
+ target.c, remote-eb.c, inftarg.c, am29k-opcode.h, target.h,
+ tm-29k.h, tmm-vxworks68.h, symfile.c, gdb-int.texinfo: Add
+ contributor lines and update copyrights to 1991.
+
+ Changes from an attempted H-PUX host port:
+
+ * infptrace.c (PT_ATTACH, PT_DETACH): Handle HP/UX, which
+ defines PT_ATTACH and PT_DETACH but not PT_KILL.
+ * remote-eb.c (eb_open): Misplaced endif kills sysv H/PUX.
+ * remote-vx.c: include <sys/time.h> for HPUX.
+ * hp300hpux-xdep.c (fetch_core_registers): Rewrite old
+ "core_file_command" routine to BFD regime. May not work yet.
+
+ Attempted port of "gdb-3.4 Van Jacobson xgdb" to modern gdb.
+
+ * xgdb.c: Replace X10 version with some VJ version.
+ (FIXME: Its copyright assignment is not on record.)
+ * xgdb.c: Update include files to X11R4 (Xaw crud).
+ (xgdb_display_source, create_text_widget): fix call to
+ get_filename_and_charpos. Rewack source window stuff for X11R4
+ (gleaned from include files, and "nm's" of binary libraries, since
+ I had no doc available).
+ (append_selection, append_selection_word): Disable with FIXME
+ since R4 changed interface here.
+ (create_buttons): Add back the old set of buttons.
+ (xgdb_create_window): Fix call to XtInitialize (&argc not argc).
+
+ * Makefile.dist (xgdb, xgdb-init.c): Update for X11R4 on Suns.
+ Roll VERSION to 3.94 (not yet final though).
+
+Sat Feb 9 09:46:25 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * obstack.h (obstack_ptr_grow, obstack_ptr_grow_fast,
+ obstack_int_grow, obstack_int_grow_fast): Eliminate
+ cast on left of assignment, which gives MIPS cc fits and is
+ not Standard C.
+
+ * sparc-pinsn.c (print_insn): Eliminate 'set' test, subsumed by
+ F_ALIAS. Use printf, not fprintf, when not passing a file
+ pointer...
+ (compare_opcodes): Check that identical instructions have
+ identical opcodes, complain otherwise.
+
+ * sparc-opcode.h (st %fsr): Fix opcode "lose" mask. This
+ was reported by Roland McGrath.
+ (unimp): Only match if exactly zero instruction. (Roland)
+ (branches and traps): Generate all variations of these
+ instructions with macros, based on a single call that defines
+ each condition name and its binary representation.
+ (set): Turn on alias bit, to avoid test in sparc-pinsn.c.
+
+ * valprint.c (val_print_fields): Take, and use, format parameter.
+ This means that "p/x struct" again prints the elements in the
+ desired format. Changed callers.
+
+ * stack.c (frame_info): Use filtered output, and indicate wrap
+ points. Remove kludgy formatting designed to avoid line wrap.
+
+ * utils.c (wrap_here): If the line is already full (because
+ we had printed a long indent or long wrapped string), do an
+ immediate newline-and-indent.
+
+ * m68k-pinsn.c (print_insn_arg): Bugfix from
+ ntmtv!thompson@ames.arc.nasa.gov (Mike Thompson): 'bkpt #0'
+ instruction is incorrectly disassembled as bkpt #8.
+
+ * dbxread.c (end_psymtab): Bugfix from Peter Schauer
+ <pesrem@regent.e-technik.tu-muenchen.de>: If you want to set a
+ breakpoint in a *.y file gdb will say Reading in symbols for *.y...
+ and then will dump core (sometimes). I traced it back to an
+ uninitialized symfile_name in psymtab_to_symtab.
+ (const_vol_complaint): Add quotes to message.
+ (define_symbol): Only believe line number if gcc_compiled.
+ Avoid allocating symbol if we will not return it.
+
+ Add target strata support so that newly established targets go
+ into their right place in the target stack (e.g. a new exec file
+ doesn't wipe out the ability to access the running process).
+
+ * target.h, core.c, exec.c, inftarg.c, remote-eb.c,
+ remote-nindy.c, remote-vx.c, remote.c, target.c: Add to_stratum
+ and initialize it properly in all the targets.
+
+ * target.h: Document strata. Change return type of push_target.
+
+ * target.c (nomemory): new function for dummy memory access.
+ (tcomplain): Rename complain, now also used in symfile.c.
+ (push_target): Push targets within strata. New return value shows
+ whether new target is on top of stack or not. Always keep dummy
+ target on stack.
+ (target_files_info): Ignore dummy target.
+
+ * core.c (core_open): Warn user, and skip accessing file, if the
+ core target is not the topmost target in the stack.
+ * remote-nindy.c (nindy_create_inferior): Avoid unpush_target, now
+ already handled.
+
+ * remote-vx.c: Remove vx_prepare_to_store from vxworks memory
+ target_ops, it doesn't belong there since we have no regs there.
+ Change name of target from machine => memory to clarify.
+
+Thu Feb 7 16:32:09 1991 John Gilmore (gnu at spiff.cygnus.com)
+
+ * Freeze version 3.93 for release.
+
+ * Makefile.dist: Handle vx-share and nindy-share subdirs
+ properly when building gdb.tar.Z.
+
+ * symtab.c: lint; add no_symtab_msg to consolidate the messages
+ printed in various places, so I could change just one copy.
+
+ * dbxread.c, coffread.c: Change references to bfd->iostream
+ to cast to FILE *, now that BFD avoids needing types defined
+ in other header files.
+
+Tue Feb 5 21:39:35 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * command.c, dbxread.c, expprint.c, infcmd.c, infptrace.c,
+ infrun.c, printcmd.c, remote-nindy.c, source.c, sparc-tdep.c,
+ sparc-xdep.c, symfile.h, symmisc.c, utils.c, valprint.c: Lint
+ (actually gcc -Wall).
+
+ * dbxread.c: Remove first_global_sym, last_global_sym, since
+ they are never referenced.
+
+ * defs.h (baud_rate): Declare.
+ main.c: Define it, and add the -b option to set it.
+
+ * gdb-int.texinfo: Add text on how to define a new host or target
+ architecture, prompted by Per Bothner's questions about MIPS
+ support.
+
+ * gdb.texinfo: Document "complaints". Change doc of -q since
+ gdb no longer prints the copyright and blurb if you specify a file
+ name to be debugged (just like Emacs). Add doc for Nindy-specific
+ command line flags for specifying target serial port and such.
+ Update copyright to 1991.
+
+ * gdbcore.h: Remove a large mass of now-useless crud, since BFD
+ has taken over for us the job of ripping up executable files. The
+ crud caused Per Bothner's port to not compile.
+
+ * infrun.c (normal_stop): Avoid printing "Program exited
+ normally" if we are in batch mode. This allows a GDB which
+ executes a program on a target system, to behave like a Unix
+ command (input from stdin, output to stdout, no extraneous
+ output).
+
+ * main.c (main): Allow additional machine-dependent command line
+ options to be specified with the ADDITIONAL_OPTIONS,
+ ADDITIONAL_OPTION_CASES, ADDITIONAL_OPTION_HELP, and
+ ADDITIONAL_OPTION_HANDLER macros. Also allow machine-dependent
+ processing to occur just before the main loop with
+ BEFORE_MAIN_LOOP_HOOK.
+ (main): If a "core file" argument is specified, and it is not a
+ core file, try it as a process ID to attach.
+ (symbol_completion_function): Attempt to cope with
+ "show screen-" TAB, not very successfully. This needs more work,
+ FIXME.
+ (batch_file): New function, returns whether we are reading
+ commands from an interactive tty on stdin, or from somewhere else.
+ Called by normal_stop since it doesn't get from_tty passed down
+ to it like many commands do.
+
+ * remote-nindy.c: Handle command line options for nindy
+ connection.
+ (nindy_before_main_loop): Prompt user for tty name if they
+ don't specify it before getting to the interactive command loop.
+
+ * tm-i960.c: Add ADDITIONAL_OPTIONS, etc, to handle -O, -brk,
+ and -r command line options. Also add hook before main loop
+ to make it easy to specify a tty.
+
+ * TODO: More things to do, one done.
+
+Mon Feb 4 23:57:39 1991 John Gilmore and Mike Tiemann (at cygint.cygnus.com)
+
+ * dbxread.c: Make complaint() calls pass pointer, not struct.
+ Add complaints about badly formatted C++ type information
+ (const/volatile indicator, and parse errors resulting in
+ error_type). Fix C++ virtual member fn comment.
+ (read_struct_type): Avoid bumping pointer if we got a parse
+ error; this prevents our walking beyond the end of a string.
+ Terminate loop on null char as well as semicolon.
+ (process_one_symbol): Fix the LBRAC fix so that it uses the
+ last previous SLINE, FUN, or SO record's PC address. C++ debug
+ symbols did not have SLINE records in a useful order compared
+ to the LBRAC records.
+ (define_symbol): Handle "catch" records.
+
+ * symtab.c (check_stub_type): Added new complain
+ `stub_noname_complain' and added a consistency check to
+ keep the debugger from crashing when finishing from an
+ exception frame. A real fix will be needed later.
+
+Sat Feb 2 10:43:05 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * infcmd.c (attach_command): Make global.
+
+ * Makefile.dist (REMOTE_OBS): Make these compile by default,
+ but make them easy to comment out. Perhaps later they should
+ be enabled by what CPU you configure for? FIXME.
+ (VERSION): Roll to 3.93.
+ (pinsn.o): Remove rule for obsolete file.
+ (dbxread.o,coffread.o,mipsread.o): Use ${srcdir} explicitly.
+
+ Run down a problem that manifested by printing the wrong function
+ name in stack traces of read_ofile_symtab. Turned out that the
+ problem was the SunOS 4.1.1 (and previous) C compiler outputs
+ the LBRAC symbol with an address in the *data* segment, which
+ blew our binary search through the blocks.
+
+ * dbxread.c: Use the complain() facility consistently to bitch
+ about problems in the symbol file we are reading.
+ (finish_block): Add code to check the nesting of the blocks;
+ complain and Procrust them to fit if wrong.
+ (make_blockvector): Check the order of the blocks, complain
+ [but don't cope] if wrong.
+ (process_one_symbol): ifndef SUN_FIXED_LBRAC_BUG, check LBRAC
+ symbols to be sure their PC value is greater than the last SLINE
+ (line number) symbol we've seen, complaining and adopting the
+ SLINE PC value if wrong.
+
+ * symfile.h (struct complaint, complaint_root, complain,
+ clear_complaints): Add.
+ * symfile.c (complain, complaint_root, clear_complaints): Add
+ facility to deal with non-fatal complaints and to regularize their
+ suppression.
+ (symbol_file_add): Clear complaint counters to allow new complaints.
+ (initialize_symfile): Add 'set complaints' and 'show complaints'.
+
+ * dbxread.c (dbx_symfile_read): Remember the address and size
+ of the string table for the main symbol file, so we won't read it
+ more than once.
+ (dbx_psymtab_to_symtab): Fix the check for main symbol file,
+ to avoid reading the string table yet again. Lint.
+ (throughout): Improve filtered output, including word wrap.
+ (read_range_type): Improve Bothner's fix to handle other types too.
+
+ * utils.c: Improve line wrap implementation. Handle unlimited
+ width by making chars_per_line unsigned.
+ (puts_filtered): New, easy, function.
+
+ * defs.h (puts_filtered): add.
+
+ * mipsread.c (compare_symbols, sort_symtab): Remove these fns,
+ call the identical sort_symtab_syms() in symfile.c instead.
+
+ * expread.y: Suggest the `file' command rather than `symbol-file'.
+
+ * command.h (enum var_types): Add zinteger for seroable
+ unsigned integer.
+ * command.c (do_setshow_command): Handle var_zinteger. Restructure
+ nested if's into a switch.
+
+ * breakpoint.c (bpstat_print): If bpstat "print" flag is not set,
+ we did not stop because of a breakpoint (it must have been for
+ some other reason, like a "stepi"), so don't print anything.
+
+ * symtab.c: Include <sys/types.h> all the time. Now that BFD
+ doesn't include <sys/types.h>, old SunOS's require it for
+ <sys/stat.h>.
+
+Sat Feb 2 10:39:15 1991 Per Bothner (bothner@cs.wisc.edu)
+
+ A test port of gdb-3.92.6 to the Sony NEWS.
+
+ * Makefile.dist
+ Don't normally link in remote- or vx stuff.
+ Some of it doesn't compile, and it wastes space for 99% of the users.
+ Remove reference to no-longer-used HAVE_VPRINTF.
+ Fixed BFD_DEP typo to BFD_DIR.
+ * dbxread.c
+ Fix cast in arg to bfd_h_getlong.
+ Make char *prefix be const.
+ Fix how certain range types are mapped into builtin unsigned int types.
+ * infrun.c
+ Remove 2 #includes. They cause errors (on Sony, at least),
+ and aren't needed (they wern't in earlier versions).
+ * printcmd.c
+ print_address_symbolic should never demangle labels
+ (since it prints *assembler-level* labels).
+
+ [This was superseded by the change to printcmd below.]
+
+ * utils.c
+ Add some "volatile" return types to avoid warnings.
+ If MISSING_VPRINTF add vprintf function and not just macro
+ (since vprintf is used in printcmd.c).
+ * valprint.c
+ Unless __GNUC__, use obstack_grow instead of obstack_ptr_grow.
+ (The latter isn't grokked by some PCC-based compilers.)
+
+ [This change is in abeyance, we prefer to fix obstack_ptr_grow.]
+
+ Make chunk size of dont_print_obstack 32*4 instead of default 4096.
+ * nindy-share/coffstrip.c
+ Added some forward declarations (otherwise, gcc complains
+ about implicit extern redefined as static).
+
+Sun Jan 20 02:38:19 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Changes inspired by Per Bothner:
+ * printcmd.c (print_address_symbolic): Take additional parameter
+ specifying whether to demangle.
+ (print_address): Pass in asm_demangle to control demangling.
+ (print_address_demangle): New fn, takes explicit arg to control
+ demangling.
+ * utils.c: Add new vars demangle and asm_demangle, and let them
+ be set and shown.
+ (fputs_demangled): If !demangle, just print the argument.
+ (fprint_symbol): If !demangle, just print raw symbol.
+ * valprint.c (val_print): Call print_address_demangle rather than
+ print_address, to cause demangling to depend on the global
+ rather than assembler-level demangling setting.
+ * WHATS.NEW, gdb.texinfo: Document.
+
+ * main.c (show_command): Show all settings if no arg.
+ (initialize_main): Make "info set" the same as naked "show".
+ * command.c (cmd_show_list): Handle prefix commands in the
+ list, and print the name of the setting as well as its English
+ description and value.
+
+ Allow gdb functions to specify where a line should wrap if it
+ exceeds the size of a terminal line. Use it to make the output
+ prettier.
+ * utils.c (set_screen_width_command): New fn, mallocs a buffer
+ of the right size when screen width changes.
+ (set_screensize_command, screensize_info): Remove #if 0'd fns.
+ (wrap_here): New fn, indicates a point in the output where we
+ should wrap the line rather than just letting it overflow at a
+ random place.
+ (fputs_filtered): Implement wrapping.
+ (n_spaces): New fn, returns a pointer to N spaces.
+ (print_spaces_filtered): Use n_spaces.
+ * defs.h (n_spaces): Declare.
+ * stack.c (print_frame_info): Wrap with 4-space indent after
+ fn name and before filename and line number.
+ * printcmd.c (print_frame_args): Wrap with 4-space indent
+ before each argument name is printed.
+ * valprint.c (value_print): Wrap with no indentation before
+ each repetition.
+ (val_print_fields): Wrap with indentation relative to nesting
+ level before each field name.
+ (val_print): Wrap with nesting indentation before array elements.
+ * command.c (do_setshow_command): Avoid extra newlines,
+ wrap with 4-space indent around values printed, end with period.
+ * WHATS.NEW, gdb.texinfo, gdb-int.texinfo: Document.
+
+ * breakpoint.c (breakpoint_1): Implement addressprint for
+ "info breakpoints" display. Change file name and line number
+ format to " at file:nnn" rather than " (file line nnn)".
+ * gdb.texinfo: Document.
+
+
+Fri Jan 18 07:21:25 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Frozen for gdb-3.92.6 release.
+
+ README, WHATS.NEW: Update for 3.92.6 release.
+
+ tconfig/{altos, i386v, i386v32, m88k, umax}: Eliminate
+ coffread.o from configs since it is now built by default.
+ tconfig/{3b1, altosgas, arm, convex, hp300bsd, hp300hpux,
+ i386v-g, i386v32-g, isi, merlin, news, news1000, np1, pn,
+ pyramid, symmetry, vax, vxworks68}: Eliminate dbxread.o
+ from configs since it is now built by default.
+
+ Makefile.dist: Update for release 3.92.6. Handle files that
+ have been moved to ../include, ../getopt, or ../bfd. Add
+ saber.suppress and tests directory. Add config.status to
+ the release (it will say "none").
+
+ coredep.c: Minor formatting fixes.
+
+ These changes were made in early December but only checked in now:
+ * nindy-share/Onindy.c, nindy-share/coffstrip.c,
+ nindy-share/nindy.c: lint
+ * nindy-share/nindy.c (ninStopWhy): Don't byteswap the
+ register values coming back from the target; we store values
+ in target byte order everywhere.
+
+Wed Jan 16 19:01:37 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * am29k-opcode.h, am29k-pinsn.c: Add 29050 opcodes.
+
+ * valprint.c (cplus_val_print, val_print_fields): New functions,
+ which print C++ objects. They conspire to avoid printing a
+ virtual base class more than once, following all the twists and
+ turns of C++ virtual base rules.
+ (val_print): Call the above rather than do it by hand.
+
+ * symfile.c (symbol_file_add): Only reset symfile_mtime for main
+ symbol file, not for added files like shared libs. This really
+ needs to be generalized to a timestamp per file.
+
+ * core.c (cleanup_core): Avoid coredump if no core file.
+
+ * config.gdb: Accept -host or -target in place of +host or
+ +target.
+
+ * coffread.c (find_linenos): Avoid desupported BFD interface
+ to line numbers. We still read them manually rather than using
+ BFD's "generic" features.
+
+ * gdbrc.tex, threecol.tex: Add GDB reference card and its
+ formatting code.
+ Makefile.dist: Add refcard to OTHERS list for creating tar files.
+
+ * Makefile.dist: Eliminate use of $< in explicit targets.
+
+ * readline/Makefile: Use $< rather than $*.c, which does not
+ include the VPATH in GNU Make.
+
+ * tconfig/i960-bout, tconfig/i960-coff: These are identical
+ copies of tconfig/i960, added for global configuration
+ compatability. All i960 versions can read both coff and b.out.
+
+ * tm-88k.h: Fix multiline macro that lacked \'s. Remove
+ COFF_FORMAT and COFF_CHECK_X_ZEROES since these are now handled
+ automaticaly.
+
+ * TODO: Think of more things to do.
+
+Wed Jan 2 19:09:29 1991 John Gilmore (gnu at spiff.cygnus.com)
+
+ tconfig/{am29k,i960,sun2*,sun3*,sun4*}: Eliminate config
+ of sdb versus dbx debug symbols. Add kludge for 68881 80-bit to
+ 64-bit float conversion.
+
+ tconfig/sun4, tconfig/sun3, xconfig/sun4, xconfig/sun3: Make
+ equivalent to sun?os4 so global config works.
+
+Wed Jan 2 18:20:51 1991 John Gilmore (gnu at spiff.cygnus.com)
+
+ Fix from Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
+
+ * main.c: Only declare linesize once; declare pagesize not at
+ all, since it is never used.
+ (main): Clear newly allocated line before it is used.
+
+For older changes see ChangeLog-1990
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1992 b/contrib/gdb/gdb/ChangeLog-1992
new file mode 100644
index 0000000..8e89824
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1992
@@ -0,0 +1,6285 @@
+Thu Dec 31 11:06:38 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (BISON): Add comment that when bison is used, it
+ must include the "-y" option.
+ * c-exp.y, m2-exp.y (yyrule, yyname, yyss, yyssp, yyvs, yyvsp):
+ Remove defines to remap non-yacc symbols, thus backing out of
+ previous recent changes. Standard policy is that non-yacc parser
+ generators get fixed, rather than adding bug workarounds in gdb
+ for each new one that pops up. Expand comment to note this.
+ * c-exp.y, m2-exp.y (YYDEBUG): Revert back to disabled by default.
+
+Thu Dec 31 09:03:02 1992 Stu Grossman (grossman at cygnus.com)
+
+ * partial-stab.h (near N_BINCL): Remove redundant code in N_BINCL
+ case. Use code in N_SOL.
+
+ * paread.c: New file that contains all HPPA/HPUX symbol reading
+ code.
+ * dbxread.c: Remove almost all HPPA/HPUX symbol reading code.
+ * (dbx_symfile_init): Use sizeof(long) instead of 4.
+ * (dbx_symfile_offsets): Make static.
+ * (pastab_build_psymtabs): New interface routine for paread to
+ send stabs into dbxread.
+ * gdb-stabs.h: Remove gobs of HPPA cruft.
+
+Wed Dec 30 19:47:13 1992 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y, m2-exp.y (yyrule, yyname): Remap like other yy* names
+ for byacc.
+ * ch-exp.y (yyrule, yyname): Remap like other yy* names for byacc.
+
+ * c-exp.y, m2-exp.y (yyreds, yytoks): Remap like other yy* names.
+ * c-exp.y, m2-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined
+ and YYDEBUG is not already defined.
+ * c-exp.y (strncmp): Replace throughout with STREQN, missed
+ them during the previous replacements.
+ * printcmd.c (_initialize_printcmd): Update internal documentation
+ for "set" command to note that the assignment syntax is language
+ dependent.
+ * ch-exp.y (yyreds, yytoks): Remap like other yy* names.
+ * ch-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined
+ and YYDEBUG is not already defined.
+ * ch-exp.y (GDB_REGNAME, GDB_LAST, GDB_VARIABLE, GDB_ASSIGNMENT,
+ single_assignment_action): New terminals and nonterminal for gdb
+ extensions to chill expression grammer.
+ * ch-exp.y (match_dollar_tokens): Lexer routine to match all
+ tokens that start with '$' (register names, convenience vars, etc).
+ * ch-exp.y (tokentab2): Add GDB_ASSIGNMENT.
+ * ch-exp.y (yylex): Call match_dollar_tokens.
+
+Mon Dec 28 15:00:01 1992 Stu Grossman (grossman at cygnus.com)
+
+ * hppah-tdep.c (skip_trampoline_code): Use new macros for
+ accessing minimal symbol data.
+ * infcmd.c (read_pc): Use #ifdef, not #if.
+ * symfile.c (syms_from_objfile): Add CONST to decl for targets.
+ * tm-hppa.h (FIX_CALL_DUMMY): Use new macros for accessing
+ minimal symbol data.
+
+ * hppah-tdep.c (frame_saved_pc): Use better test for outermost
+ frame. Use find_return_regnum to find the caller.
+ * (find_unwind_entry): New routine to locate stack frame info
+ associated with a procedure. This looks in the $UNWIND_START$
+ section in the SOM file.
+ * (find_return_regnum): New routine. Uses find_unwind_entry() to
+ figure out where the caller's return address is stored.
+ * (find_proc_framesize): New routine. Uses find_unwind_entry()
+ to figure out the frame size for a procedure.
+ * (saved_pc_after_call): New routine, moved from tm-hppa.h.
+ * (init_extra_frame_info): New routine. Corrects PC and FP for
+ outermost frame if necessary.
+ * (frame_chain): New routine, moved from tm-hppa.h.
+ * (skip_trampoline_code): Handle computed function calls (ie:
+ calls from $$dyncall).
+ * (unwind_command): Temporary support function to allow user
+ to control/observe aspects of the unwind (stack frame) info.
+ * infcmd.c (read_pc): (Temporary), put a hack in to see if the PC
+ was in a system call, if so, then read the PC from r31.
+ * tm-hppah.h (SKIP_TRAMPOLINE_CODE, IN_SOLIB_TRAMPOLINE): Deal
+ with extra arg for skip_trampoline_code().
+ * (INIT_EXTRA_FRAME_INFO): Define to point at subr (see above).
+ * (FRAME_CHAIN, FRAME_CHAIN_VALID): Turn into real subroutines.
+ * tm-hppa.h (SAVED_PC_AFTER_CALL): Turn into real subroutine.
+
+Sun Dec 27 17:34:15 1992 Fred Fish (fnf@cygnus.com)
+
+ * dbxread.c (dbx_symfile_init, elfstab_build_psymtabs):
+ Call new bfd_get_size() and verify that string table is no larger
+ than the file that is supposed to contain it.
+ * symfile.c (syms_from_objfile): Only complain about configured
+ NAMES_HAVE_UNDERSCORE differences between gdb and bfd if the
+ current target is the default BFD target.
+
+Sat Dec 26 20:51:41 1992 Fred Fish (fnf@cygnus.com)
+
+ * solib.c (BKPT_AT_MAIN): Change to BKPT_AT_SYMBOL.
+ * solib.c (bkpt_names): New array of symbol names to try to
+ use for the "mapping complete" breakpoint. Configurable
+ define SOLIB_BKPT_NAME is first one to try.
+ * solib.c (find_solib): Test debug_base for nonzero rather
+ than just greater than zero.
+ * solib.c (enable_break): Use bkpt_names to look up address
+ at which to set "mapping complete" breakpoint.
+
+Tue Dec 22 20:33:38 1992 Fred Fish (fnf@cygnus.com)
+
+ * defs.h (STRCMP, STREQ, STREQN): New macros.
+ * defs.h (demangle_and_match): Remove prototype.
+ * dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
+ and STREQN defined in defs.h.
+ * dwarfread.c (set_cu_language): For completely unknown languages,
+ try to deduce the language from the filename. Retain behavior
+ that for known languages we don't know how to handle, we use
+ language_unknown.
+ * dwarfread.c (enum_type, symthesize_typedef): Initialize language
+ and demangled name fields in symbol.
+ * dwarfread.c, mipsread.c, partial-stab.h: For all usages of
+ ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
+ * dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
+ and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
+ * elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
+ Replace usages throughout.
+ * elfread.c (demangle.h): Include.
+ * elfread.c (record_minimal_symbol): Remove prototype and function.
+ * gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
+ B_CLRALL): Moved from symtab.h to gdbtypes.h.
+ * infcmd.c (jump_command): Remove code to demangle name and add
+ it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
+ * minsyms.c (demangle.h): Include.
+ * minsyms.c (lookup_minimal_symbol): Indent comment to match code.
+ * minsyms.c (install_minimal_symbols): Attempt to demangle symbol
+ names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
+ * mipsread.c (psymtab_language): Add static variable.
+ * stabsread.c (demangle.h): Include.
+ * stabsread.c (define_symbol): Attempt to demangle C++ symbol
+ names and cache them in the SYMBOL_DEMANGLED_NAME field.
+ * stack.c (return_command): Remove explicit demangling of name
+ and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
+ * symfile.c (demangle.h): Include.
+ * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
+ to match macros in symfile.h and allow them to be compiled
+ if INLINE_ADD_PSYMBOL is not true.
+ * symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
+ * symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
+ Add code to demangle and cache C++ symbol names. Use macro form
+ if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
+ * symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
+ Remove, also defined in symfile.c, which we already fixed.
+ * symtab.c (expensive_mangler): Remove prototype and function.
+ * symtab.c (find_methods): Remove physnames parameter and fix
+ prototype to match.
+ * symtab.c (completion_list_add_symbol): Name changed to
+ completion_list_add_name.
+ * symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
+ the normal symbol name and the cached C++ demangled name.
+ * symtab.c (lookup_demangled_partial_symbol,
+ lookup_demangled_block_symbol): Remove prototypes and functions.
+ * symtab.c (lookup_symbol): Remove use of expensive_mangler,
+ use lookup_block_symbol instead of lookup_demangled_block_symbol.
+ Remove code to try demangling names and matching them.
+ * symtab.c (lookup_partial_symbol, lookup_block_symbol):
+ Fix to try matching the cached demangled name if no match is
+ found using the regular symbol name.
+ * symtab.c (find_methods): Remove unused physnames array.
+ * symtab.c (name_match, NAME_MATCH): Remove function and macro,
+ replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
+ * symtab.c (completion_list_add_symbol): Rewrite to use cached
+ C++ demangled symbol names.
+ * symtab.h: Much reformatting of structures and such to add
+ whitespace to make them more readable, and make them more
+ consistent with other gdb structure definitions.
+ * symtab.h (general_symbol_info): New struct containing fields
+ common to all symbols.
+ * symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
+ SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
+ SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
+ * symtab. (struct minimal_symbol, struct partial_symbol, struct
+ symbol): Use general_symbol_info struct.
+ * utils.c (demangle_and_match): Remove, no longer used.
+ * valops.c (demangle.h): Include.
+ * xcoffexec.c (eq): Remove macro, replace usages with STREQ.
+ * blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
+ infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
+ symmisc.c, symtab.c, valops.c: Replace references to minimal
+ symbol fields with appropriate macros.
+ * breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
+ coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
+ demangle.c, elfread.c, energize.c, environ.c, exec.c,
+ gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
+ main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
+ remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
+ sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
+ symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
+ tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
+ and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
+ * breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
+ mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
+ symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
+ references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
+ appropriate.
+ * buildsym.c (start_subfile, patch_subfile_names): Default the
+ source language to what can be deduced from the filename.
+ * buildsym.c (end_symtab): Update the source language in the
+ allocated symtab to match what we have been using.
+ * buildsym.h (struct subfile): Add a language field.
+ * c-typeprint.c (c_print_type): Remove code to do explicit
+ demangling.
+ * dbxread.c (psymtab_language): Add static variable.
+ * dbxread.c (start_psymtab): Initialize psymtab_language using
+ deduce_language_from_filename.
+
+Mon Dec 21 22:24:33 1992 Fred Fish (fnf@cygnus.com)
+
+ * valprint.c (val_print): Reorganize comment and add note
+ about dependency on target byte ordering.
+ * ch-exp.y (value_array_slice): Fix typo.
+ * ch-valprint.c (chill_val_print): Remove C'ism that arrays of
+ byte sized ints are assumed to be char strings and printed with
+ string syntax. In chill, arrays of chars and arrays of
+ bytes/ubytes are distinquishable, and printed appropriately.
+
+Mon Dec 21 18:02:35 1992 Stu Grossman (grossman at cygnus.com)
+
+ * tm-hppah.h: #define NEED_TEXT_START_END for target memory
+ read/write routines for HPUX.
+
+ * hppa-pinsn.c (print_insn): Improve handling of be and ble
+ branch targets to compute target address using const from previous
+ instruction if necessary.
+ * Add `Q' operator to print out bit position field various
+ instructions.
+ * hppah-nat.c: #include sys/param.h, and sys/user.h. General
+ cleanups, use new code from Utah.
+ * (store_inferior_registers): Update to new code from Utah.
+ * (initialize_kernel_u_addr): Re-enable decl of struct user u.
+ * (fetch_register): Clear out priv level when reading PCs.
+ * hppah-tdep.c: Get rid of gobs of KERNELDEBUG stuff.
+ * Remove decl of errno, #include wait.h and target.h.
+ * (frame_saved_pc): Check `flags' pseudo-register to see if we
+ were inside of a kernel call. If so, then PC is in a different
+ register. Also, mask out bottom two bits of all PCs so as not to
+ confuse higher level code.
+ * (push_dummy_frame): Create from #define in tm-hppa.h.
+ * (find_dummy_frame_regs): Update from Utah.
+ * (hp_pop_frame): Create from #define in tm-hppa.h.
+ * (hp_restore_pc_queue): New, from Utah.
+ * (hp_push_arguments): Big fixes from Utah.
+ * (pa_do_registers_info, pa_print_registers): Only print out fp
+ regs upon request.
+ * (skip_trampoline_code): New routine to deal with stubs that
+ live in nowhereland between callers and callees.
+ * i860-tdep.c: Remove decl of attach_flag.
+ * infrun.c (wait_for_inferior): Add new macro
+ INSTRUCTION_NULLIFIED, which can tell if the instruction pointed
+ at by PC will be nullified. If so, then step the target once more
+ so as to avoid confusing the user.
+ * (just before step_over_function:): Use stop_func_start, not
+ stop_pc when checking for the existance of line number info.
+ stop_func_start will reflect the proper address of the target
+ routine, not of the stub that we may be traversing to get there.
+ * tm-hppa.h: define SKIP_TRAMPOLINE_CODE and IN_SOLIB_TRAMPOLINE
+ to deal with the stubs that PA compilers sometimes stick between
+ callers and callees. Also, define FLAGS_REGNUM for access to the
+ `flags' pseudo-reg.
+ * (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use
+ memcpy, not bcopy.
+ * (CANNOT_STORE_REGISTER): New from Utah. Says that we can't
+ write gr0, PC regs, and PSW!
+ * (FRAME_FIND_SAVED_REGS): Bug fixes from Utah.
+ * (PUSH_DUMMY_FRAME, POP_FRAME): Make into real routines in
+ hppah-nat.c.
+ * (CALL_DUMMY, FIX_CALL_DUMMY): Fixes from Utah.
+ * Define struct unwind_table_entry.
+ * valops.c (call_function_by_hand): Add another arg to
+ FIX_CALL_DUMMY (under #ifdef GDB_TARGET_IS_HPPA). Why is this
+ necessary?
+
+Mon Dec 21 02:17:57 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * remote-vx.c: remove include of "symfile.h", replace it with "complaints.h"
+
+Fri Dec 18 10:32:25 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.7.4.
+ * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c,
+ m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c.
+ * Makefile.in (HFILES): Add valprint.h.
+ * Makefile.in (OBS): Add typeprint.o, c-typeprint.o,
+ m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o.
+ * typeprint.c, typeprint.h: New files for language independent
+ type printing functions.
+ * c-typeprint.c, m2-typeprint.c: New files for language dependent
+ type printing functions and definitions.
+ * valprint.h: New include file for language independent value
+ printing definitions.
+ * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language
+ dependent value printing functions.
+ * c-exp.y (production ptype): Add range_type variable and use new
+ create_range_type function.
+ * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab),
+ infcmd.c (path_var_name), language.c (unk_op_print_tab),
+ m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent
+ "const static" to ANSI-conformant "static const".
+ * c-exp.y (c_create_fundamental_type): Remove unused nbytes.
+ * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type,
+ and c_val_print.
+ * c-lang.h (c_print_type, c_val_print): Add prototypes.
+ * coffread.c (decode_type): Add range_type variable and call to
+ new create_range_type function.
+ * complaints.c (complain): Remove unused val variable.
+ * complaints.c (_initialize_complaints): Make it void.
+ * convex-tdep.c (value_of_trapped_internalvar): Add range_type
+ variable and call new create_range_type function.
+ * defs.h (enum val_prettyprint): Move enum from value.h to here
+ so we can avoid having to include value.h just for prototypes that
+ need the enum (thanks ANSI).
+ * dwarfread.c (struct_type): Local anonymous_size variable is
+ only used if !BITS_BIG_ENDIAN.
+ * dwarfread.c (decode_subscript_data_item): Add rangetype
+ variable and call new create_range_type function.
+ * elfread.c (elf_symfile_read): Remove unused dbx and text_sect
+ variables.
+ * eval.c (evaluate_subexp): Remove unused local variable name
+ and the statement with no side effects that initializes it.
+ * expprint.c (print_subexp): Change local_printstr to
+ LA_PRINT_STRING.
+ * gdbtypes.c (create_range_type): New function that creates
+ a range type using code fragments from object file readers as
+ an example of what has to be initialized.
+ * gdbtypes.c (create_array_type): Removed index_type, low_bound,
+ and high_bound parameters, replaced with a single range_type
+ parameter. Change function body to use passed in range_type
+ rather than handcrafting one.
+ * gdbtypes.h (create_range_type): Add prototype.
+ * gdbtypes.h (create_array_type): Change prototype parameters.
+ * infrun.c (normal_stop): Remove unused local variables tem and c.
+ * infrun.c (hook_stop_stub): Return 0 rather than random value.
+ * language.c (unk_lang_print_type, unk_lang_val_print): Add
+ stub functions that call error if called.
+ * language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn): Add initializers unk_lang_print_type and
+ unk_lang_val_print.
+ * language.h (struct language_defn): Reformat for larger
+ comments, add la_print_type and la_val_print members. Add
+ LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar
+ to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING.
+ * m2-lang.c (m2_create_fundamental_type): Remove unused local
+ variable nbytes.
+ * m2-lang.c (m2_language_defn): Add initializers m2_print_type
+ and m2_val_print.
+ * m2-lang.h (m2_print_type, m2_val_print): Add prototypes.
+ * main.c (execute_command): Remove unused local variable cmdlines.
+ * main.c (echo_command), stabsread.c (read_type), printcmd.c
+ (clear_displays), symmisc.c (block_depth), values.c
+ (clear_value_history):
+ Make testing of truth value of assignment result explicit.
+ * mipsread.c (upgrade_type): Update FIXME to include future use
+ of create_range_type.
+ * printcmd.c (ptype_command, ptype_eval, whatis_command,
+ whatis_exp, maintenance_print_type): Move prototypes and functions
+ to new typeprint.c.
+ * printcmd.c (_initialize_printcmd): Move add_com calls for
+ ptype_command and whatis_command to new typeprint.c.
+ * ser-bsd.c (serial_open): Remove unused variable sgttyb.
+ * source.c (find_source_lines): Local variable c only used
+ when LSEEK_NOT_LINEAR is defined.
+ * stabsread.c (read_array_type): Use new create_range_type
+ function.
+ * stabsread.c (read_range_type): Add new index_type variable and
+ call new create_range_type function rather than handcrafting
+ range types.
+ * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE.
+ * symtab.c (typedef_print usages): Use c_typedef_print, renamed.
+ * symtab.c (type_print_base usages): Use c_type_print_base.
+ * symtab.c (type_print_varspec_prefix usages): Use
+ c_type_print_varspec_prefix.
+ * symtab.c (type_print_method_args usages): Use
+ cp_type_print_method_args.
+ * valprint.c: Completely ripped apart and the fragments used
+ to create c-valprint.c, cp-valprint.c, m2-valprint.c, and
+ valprint.h. Remaining stuff is language independent.
+ * value.h (struct fn_field): Forward declare for prototypes.
+ * value.h (type_print_1): Remove prototype.
+ * value.h (enum val_prettyprint): Moved to defs.h.
+ * value.h (typedef_print): Prototype renamed to c_typedef_print.
+ * value.h (baseclass_offset): Add prototype.
+ * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c.
+ * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o.
+ * ch-typeprint.c: New file for language dependent type printing.
+ * ch-valprint.c: New file for language dependent value printing.
+ * ch-exp.y (parse_number): Remove prototype and stub function.
+ * ch-exp.y (decode_integer_literal): Removed unused digits and
+ temp variables.
+ * ch-exp.y (convert_float): Completely ifdef out for now.
+ * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5),
+ ch-lang.c (chill_op_print_tab):
+ Change from ANSI-obsolescent "const static" to ANSI-conformant
+ "static const".
+ * ch-exp.y (yylex): Add unhandled storage class enumeration
+ literals to switch statement for completeness.
+ * ch-lang.c (chill_create_fundamental_types): Remove unused
+ nbytes variable. Change dummy type to 2 bytes to match int.
+ Handle FT_VOID types gratuituously added to chill DWARF by
+ compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR
+ type rather than a one byte TYPE_CODE_INT type.
+ * ch-lang.c (chill_language_defn): Add chill_print_type and
+ chill_val_print.
+ * ch-lang.h (chill_print_type, chill_val_print): Add prototypes.
+
+Thu Dec 17 00:44:57 1992 John Gilmore (gnu@cygnus.com)
+
+ Eliminate uses of NAMES_HAVE_UNDERSCORE, using
+ bfd_get_symbol_leading_char instead.
+
+ * coffread.c (EXTERNAL_NAME): New macro for removing possible
+ leading character from names.
+ (read_coff_symtab): Use BFD's FILE *, don't open a second one.
+ (process_coff_symbol, coff_read_struct_type, coff_read_enum_type):
+ Replace NAMES_HAVE_UNDERSCORE with EXTERNAL_NAME.
+
+ * kdb-start.c (main): Remove NAMES_HAVE_UNDERSCORE.
+ * minsyms.c (install_minimal_symbols): Replace NAMES_HAVE_UNDERSCORE.
+ Remove SOME_NAMES_HAVE_DOT support (apparently unused).
+ * partial-stab.h: Replace NAMES_HAVE_UNDERSCORE.
+ * solib.c: Replace NAMES_HAVE_UNDERSCORE.
+ * stabsread.h: Remove NAMES_HAVE_UNDERSCORE and HASH_OFFSET.
+ * symfile.c (syms_from_objfile): Insert debugging check to test
+ NAMES_HAVE_UNDERSCORE setting against the BFD support.
+
+ * doc/gdbint.texinfo (Host Conditionals): Remove
+ NAMES_HAVE_UNDERSCORE, SOME_NAMES_HAVE_DOT, document
+ MEM_FNS_DECLARED.
+ (Target Conditionals): Remove all of the above.
+
+ * xm-rs6000.h (MEM_FNS_DECLARED): Update comments.
+
+ * coffread.c (read_coff_symtab, C_BLOCK): Use complain() rather
+ than error() for .bb/.eb. Bug found by Eddie Fung, <efung@cs.uq.oz.au>.
+
+Tue Dec 15 10:05:56 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffread.c (decode_type): catch negative tagndx fields generated
+ by SCO 3.2v4 cc.
+ * exec.c: comment out string following #endif.
+ * configure.in (i[34]86-*-sco3.2v4*): use host i386sco4.
+ * xm-i386sco.h: include <sys/types.h> and <sys/dir.h>, required by
+ <sys/user.h>.
+ * config/i386sco4.mh: new file; like i386sco.mh, but don't require
+ gcc, and define const to empty to avoid SCO 3.2v4 cc bug.
+
+Tue Dec 15 04:14:24 1992 Fred Fish (fnf@cygnus.com)
+
+ * complaints.c: New file, code moved from utils.c.
+ * complaints.c (complain): Made into a varargs function.
+ * complaints.h: New file, code moved from symfile.h.
+ * Makefile.in (SFILES_MAINDIR): Add complaints.c.
+ * Makefile.in (HFILES): Add complaints.h.
+ * Makefile.in (OBS): Add complaints.o.
+ * symfile.c (complaint_root, stop_whining, complaint_series,
+ complain, clear_complaints, add_show_from_set for stop_whining):
+ Moved to complaints.c.
+ * symfile.h (struct complaint, complaint_root decl, complain
+ prototype, clear_complaints prototype): Moved to complaints.h.
+ * buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
+ gdbtypes.c, mipsread.c, stbsread.c, symfile.c: Include
+ complaints.h. Remove casts from arguments to complain(),
+ which is now a varargs function, and remove unnecessary
+ placeholder zero args.
+ * defs.h (begin_line): Add prototype.
+ * defs.h (vprintf_filtered): Add prototype.
+ * dwarfread.c (varargs.h): Remove, no longer needed.
+ * dwarfread.c (dwarfwarn): Remove prototype and function.
+ * dwarfread.c (complaints): Define a bunch of complaints.
+ * dwarfread.c (SQUAWK): Remove macro defs, convert all
+ usages to standard complain() calls.
+ * utils.c (begin_line): New function that ensures that
+ whatever gets filter-printed next starts on its own line.
+ * utils.c (vprintf_filtered): New func, like vfprintf_filtered,
+ but to stdout (calls vfprintf_filtered internally).
+
+Tue Dec 15 02:01:00 1992 John Gilmore (gnu@cygnus.com)
+
+ * remote.c: Avoid printf_filtered line limit. Suggested by
+ Robert R. Henry, <rrh@tera.com>.
+ * infcmd.c (environment_info): Ditto, for Don Allen <allen@think.com>.
+
+ * main.c (main): Accept --silent as well as --quiet. Change +help
+ to --help. Suggested by Karl Berry, <karl@cs.umb.edu>.
+
+ * doc/gdbint.texinfo: SWAP_HOST_AND_TARGET => SWAP_TARGET_AND_HOST.
+ Noticed by Andy Jackson, <arj@cam-orl.co.uk>.
+
+Mon Dec 14 23:28:15 1992 John Gilmore (gnu@cygnus.com)
+
+ * tm-nindy960.h, remote-nindy.c: Lint.
+
+Mon Dec 14 18:48:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * gdbtypes.c (create_array_type): Complete rewrite. Now requires
+ a optional type to decorate as an array type, the type of the
+ index, and the bounds of the array. Records this additional info
+ in the array type for use with languages with nonzero array
+ bounds.
+ * gdbtypes.h (enum type_code): Update comment for TYPE_CODE_ARRAY
+ to note that arrays may have bounds.
+ * gdbtypes.h (create_array_type): Update prototype.
+ * c-exp.y (ptype production): Adjust for new create_array_type
+ calling conventions.
+ * coffread.c (decode_type): Call create_array_type rather than
+ handcrafting array types.
+ * convex-tdep.c (value_type): Remove, now use create_array_type.
+ * convex-tdep.c (value_of_trapped_internalvar): Convert calls to
+ vector_type into calls to create_array_type.
+ * dwarfread.c (decode_subscr_data): Name changed to
+ decode_subscript_data_item throughout.
+ * dwarfread.c (decode_subscript_data_item): Rewrite to use
+ create_array_type. Now records index type and range as well.
+ * dwarfread.c (dwarf_read_array_type): Rewrite as part of
+ change to use create_array_type.
+ * dwarfread.c (read_subroutine_type): Test existing user defined
+ types before decorating them, to ensure they are blank, and
+ complain about it if they are not.
+ * dwarfread.c (decode_fund_type): For unrecognized types, always
+ return some valid type (type integer). If the unrecognized type
+ cannot be an implementation defined type, complain as well.
+ * m88k-tdep.c (pushed_size): Update comment for TYPE_CODE_ARRAY.
+ * m88k-tdep.c (store_param): Update comment for TYPE_CODE_ARRAY.
+ * mipsread.c (upgrade_type): Add FIXME comment that code to
+ handcraft arrays should be replaced with call to create_array_type.
+ * stabsread.c (read_array_type): Replace code to handcraft
+ array types with call to create_array_type.
+ * valprint.c (type_print_varspec_prefix): Minor formatting
+ change, join lines that don't need to be split.
+
+Mon Dec 14 17:18:42 1992 Stu Grossman (grossman at cygnus.com)
+
+ * convex-xdep.c, hppab-nat.c, infptrace.c: Remove
+ decl for attach_flag, it now lives in inferior.h.
+ * hppa-pinsn.c: Reformat opcode tables. Add function prototypes.
+ Make most functions static.
+ * hppah-nat.c: General cleanups, remove BSD specific code (since
+ that all lives in hppab-nat.c).
+ * hppah-tdep.c (frame_chain_valid), tm-hppa.h (FRAME_CHAIN):
+ Change sense of test against inside_entry_file(). This fix is
+ from U. of Utah.
+ * tm-hppa.h (PUSH_DUMMY_FRAME, POP_FRAME): Use char * for 2nd arg
+ to read/write_register_bytes().
+ * gdbtypes.h: Remove const from decl for cplus_struct_default to
+ work around PA-GAS assembler bug. Also, add trailing */ to some
+ comments.
+ * gdbtypes.c: Remove const from decl for cplus_struct_default.
+ Same reason as above.
+
+Wed Dec 9 19:53:25 1992 John Gilmore (gnu@cygnus.com)
+
+ * mipsread.c (parse_symbol): When checking whether a structured
+ type is an enum, check qualifiers of its first member, as well as
+ the base type of the member. Bug found and fixed by John M.
+ Farrell, <farrell@fjord.reo.dec.com>.
+
+ * vx-share/{reg.h,xdr_regs.h,xdr_regs.c}: Remove, unused.
+ * remote-vx.c: Don't include vx-share/reg.h.
+ * vx-share/ptrace.h: Reproduce from scratch.
+ * config/{vxworks68,vxworks960}: Don't include xdr_regs.o.
+ * Makefile.in: Remove references to removed files, and to removed
+ 29k-share directories.
+
+Tue Dec 8 13:30:58 1992 Fred Fish (fnf@cygnus.com)
+
+ * c-lang.c (_initialize_c_language): Name changed from
+ _initialize_c_exp.
+ * m2-lang.c (_initialize_m2_language): Name changed from
+ _initialize_m2_exp.
+ * m2-lang.c (_initialize_m2_language): Change malloc to xmalloc since
+ it is no longer inside m2-exp.y, where it was remapped by Makefile.
+ * c-exp.y, m2-exp.y: Migrate code that has nothing to do with
+ expression parsing into c-lang.c and m2-lang.c respectively.
+ * c-lang.c, m2-lang.c: New files, code migrated from c-exp.y and
+ m2-exp.y respectively.
+ * c-lang.h, m2-lang.h: New files, internal interfaces between c-*
+ and m2-* files respectively.
+ * Makefile.in (SFILES_MAINDIR): Add c-lang.c, m2-lang.c.
+ * Makefile.in (HFILES): Add c-lang.h, m2-lang.h.
+ * Makefile.in (OBS): Add c-lang.o, m2-lang.o.
+ * expression.h (struct block): Forward declaration for prototypes.
+ * language.h (struct objfile): Forward declaration for prototypes.
+ * Makefile.in (SFILES_MAINDIR): Add ch-lang.c.
+ * Makefile.in (HFILES): Add ch-lang.h.
+ * Makefile.in (OBS): Add ch-lang.o.
+ * ch-exp.y: Migrate code that has nothing to do with expression
+ parsing into ch-lang.c.
+ * ch-lang.c: New file, code migrated from c-exp.y.
+ * ch-lang.h: New file, internal interface between ch-* files.
+ * ch-lang.c (_initialize_chill_language): Name changed from
+ _initialize_chill_exp.
+
+ Changes for Amiga Unix from rhealey@ub.d.umn.edu.
+ * config/amix.mh (NAT_FILE): Add, set to nm-sysv4.h.
+ * config/amix.mh (NATDEPFILES): Add.
+ * config/amix.mh (XDEPFILES): Move procfs.o and fork-child.o
+ to NATDEPFILES.
+
+ * dwarfread.c (decode_subscr_data): Remove spurious test that
+ accepted only integer subscript types. We don't do anything
+ with the type at the moment anyway.
+
+Fri Dec 4 06:56:56 1992 Fred Fish (fnf@cygnus.com)
+
+ * ch-exp.y (match_character_literal): Fix case where no
+ match at all is found.
+ * ch-exp.y (chill_create_fundamental_type): Chill uses fixed
+ width types. For example, "INT" is always 2 bytes regardless
+ of the values of any TARGET_*_BIT macros. So use explicit
+ numeric sizes for the types.
+
+Thu Dec 3 12:00:06 1992 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (c_create_fundamental_type): New function to create
+ language specific fundamental types for C.
+ * m2-exp.y (m2_create_fundamental_type): New function to create
+ language specific fundamental types for Modula 2.
+ * c-exp.y (c_language_defn, cplus_language_defn): Add
+ c_create_fundamental_type to language struct initializers.
+ * m2-exp.y (m2_language_defn): Add m2_create_fundamental_type
+ to language struct initializers.
+ * dwarfread.c (expression.h, language.h): Include.
+ * dwarfread.c (ftypes): New array to hold fundamental types
+ for current compilation unit.
+ * dwarfread.c (cu_language_defn): New pointer to language
+ struct for language of current compilation unit.
+ * dwarfread.c (dwarf_fundamental_type): New function to
+ create/lookup fundamental types.
+ * dwarfread.c (set_cu_language): Initialize cu_language_defn.
+ * dwarfread.c (throughout): Replace lookup_fundamental_type
+ with dwarf_fundamental_type.
+ * dwarfread.c (read_file_scope): Zero out ftypes for each new
+ compilation unit (may be different language or different objfile).
+ * gdbtypes.c (lookup_fundamental_type): Move actual type
+ creations into language specific fundamental type creation
+ functions and call via create_fundamental_type. Add comment
+ about this function being obsolescent.
+ * gdbtypes.h (FT_BYTE, FT_UNSIGNED_BYTE): New types, true byte
+ sized signed and unsigned integers.
+ * gdbtypes.h (FT_NUM_MEMBERS): Increment, new types added.
+ * language.c (language_def): New function to lookup a language
+ struct given it's enumeration.
+ * language.h (struct language_defn): Add la_fund_type, a pointer
+ to a function that creates fundamental types for this language.
+ * language.h (create_fundamental_type): New macro to create
+ fundamental types based on the current language.
+ * language.h (language_def): Add prototype.
+ * language.c (unk_lang_create_fundamental_type): New function
+ for initializing language structs, calls error if called.
+ * language.c (unk_language_defn, auto_language_defn,
+ local_language_defn): Use unk_lang_create_fundamental_type.
+ ch-exp.y (chill_create_fundamental_type): New function.
+ ch-exp.y (chill_language_defn): Add chill_create_fundamental_type.
+ ch-exp.y (_initialize_chill_exp): BOOL types are only one byte.
+
+Tue Dec 1 17:07:31 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (CHILL_PRODUCER): Add producer string for
+ GNU chill.
+ * dwarfread.c (handle_producer): Test CHILL_PRODUCER as well
+ as GCC_PRODUCER and GPLUS_PRODUCER.
+
+Mon Nov 30 18:46:58 1992 Stu Grossman (grossman at cygnus.com)
+
+ * remote-udi.c (udi_wait): Don't stop if TIP says that remote is
+ still running.
+
+Mon Nov 30 12:00:25 1992 Fred Fish (fnf@cygnus.com)
+
+ * tm-sun4sol2.h: Add CPLUS_MARKER. Solaris 2.0 requires '.'
+ rather than '$'. This particular piece of braindamage is
+ spreading like ooze. It's now infected libiberty, deja-gnu,
+ gdb, and gcc.
+ * values.c (baseclass_addr): Use CPLUS_MARKER rather than
+ hardwired '$' character.
+
+Sun Nov 29 15:22:42 1992 Fred Fish (fnf@cygnus.com)
+
+ (Changes to break incredibly ugly, unmaintainable 750 line
+ read_struct_type function up into managable pieces.)
+ * Makefile.in (VERSION): Bump to 4.7.3.
+ * stabsread.c (struct field_info): Local struct definition.
+ * stabsread.c (read_member_functions, read_struct_fields,
+ read_baseclasses, read_tilde_fields, attach_fn_fields_to_type,
+ attach_fields_to_type, read_cpp_abbrev): Prototypes and new
+ functions from fragmented read_struct_type.
+ * stabsread.c (stabs_general_complaint): Catchall complaint.
+ * stabsread.c (STABS_CONTINUE): Macro'ize cretinous stabs
+ symbol name continuation code. Use macro throughout.
+ * stabsread.c (various places): Replace add-one-to-pointer
+ with pointer increment.
+ * stabsread.c (read_type): Retain function local copy of type
+ descriptor. Rearrange code calling read_struct_type() to match
+ new conventions.
+ * stabsread.c (define_symbol): For the sake of dbx, gcc emits
+ a single blank as the name of nameless enumerations. Recognize
+ this special case and set nameless flag.
+ * ch-exp.y (GENERAL_PROCEDURE_NAME, LOCATION_NAME): New
+ terminal tokens.
+ * ch-exp.y (access_name): New non-terminal token and
+ production.
+ * ch-exp.y (general_procedure_name): Now a terminal token.
+ * ch-exp.y (location): Expand production.
+ * ch-exp.y (match_simple_name_string): New function.
+ * ch-exp.y (yylex): Call match_simple_name_string and return
+ GENERAL_PROCEDURE_NAME or LOCATION_NAME as appropriate.
+
+Wed Nov 25 07:17:13 1992 Fred Fish (fnf@cygnus.com)
+
+ * munch: Backslash escape vertical bar characters inside
+ grep patterns since they have special meaning for some greps.
+ * parse.c (write_exp_string): Complete rewrite to store string
+ contants as a leading explicit length, followed by the string data,
+ followed by a trailing explicit length.
+ * eval.c (evaluate_subexp), expprint.c (print_subexp),
+ parse.c (length_of_subexp), parse.c (prefixify_subexp):
+ Use recorded explicit length of strings in expression elements,
+ rather than strlen. Adjust code to skip over strings stored in
+ expression elements, and code to access strings, to account for
+ new leading explicit size expression element.
+ * parse.c (length_of_subexp): Test for minimum endpos of 1, not
+ 0, to avoid negative expression element indices.
+ * valops.c (search_struct_method): Minor whitespace change.
+
+Mon Nov 23 11:14:15 1992 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (yylex): Add tempbuf, tempbufindex, and tempbufsize,
+ which together maintain a dynamically expandable static buffer
+ for the lexer to use when translating C strings to their internal
+ form (other future uses possible). Fix parsing of C style strings
+ to do the normal C style input conversions of escaped character
+ sequences.
+ * valops.c (value_string): Remove translation of escaped
+ character sequences, now done in C expression parser.
+ * language.h (PRINT_LITERAL_FORM): New macro that takes character
+ and decides if it should be printed in literal form or some other
+ form, based on it's ASCII value and setting of sevenbit_strings.
+ * {c-exp.y, m2-exp.y} (emit_char): Use new PRINT_LITERAL_FORM
+ macro, change indentation style.
+ * ch-exp.y (chill_printchar): Use new PRINT_LITERAL_FORM macro.
+ * ch-exp.y (chill_printstr): First cut at real function instead
+ of error stub.
+
+Sun Nov 22 16:21:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * nindy-share/stop.h: fixed bogus comment-end in copyright message
+
+ * i960-pinsn.c: fixed two calls of fputs_filtered that had 3 arguments
+
+Fri Nov 20 21:35:57 1992 Fred Fish (fnf@cygnus.com)
+
+ * defs.h (sevenbit_strings): Add declaration.
+ * defs.h (printchar): Replace with gdb_printchar.
+ * language.h (language_defn): Add new function pointers
+ la_printchar and la_printstr, to do language dependent
+ printing of characters and strings.
+ * language.h (local_printchar, local_printstr): New macros
+ to call language dependent functions pointed to by la_printchar
+ and la_printstr respectively.
+ * c-exp.y (emit_char, c_printchar, c_printstr): New language
+ dependent functions for printing characters and strings.
+ * c-exp.y (c_language_defn, cplus_language_defn): Add
+ c_printchar and c_printstr.
+ * command.c (do_setshow_command): Rename printchar use to
+ gdb_printchar.
+ * expprint.c (print_subexp): Replace C style string output
+ with call to local_printstr.
+ * language.c (unk_lang_printchar, unk_lang_printstr):
+ New stubs, currently errors.
+ * language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn): Add unk_lang_printchar and
+ unk_lang_printstr.
+ * m2-exp.y (emit_char, m2_printchar, m2_printstr): New
+ language dependent functions to print characters and strings.
+ * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr.
+ * utils.c (printchar): Renamed to gdb_printchar.
+ * valprint.c (print_string): Remove prototype, function moved
+ to c-exp.y, where it becomes c_printstr.
+ * valprint.c (print_max): Made global for reference from the
+ language dependent printing routines in *-exp.y.
+ * valprint.c (repeat_count_threshold): New variable with function
+ of old REPEAT_COUNT_THREHOLD define, but now settable by user.
+ Change all references to old macro to references to new variable.
+ * valprint.c (value_print, val_print): Replace calls to
+ print_string with calls to local_printstr.
+ * valprint.c (val_print): Replace C style character printing
+ with call to local_printchar.
+ * valprint.c (val_print): Add case for TYPE_CODE_CHAR.
+ * valprint.c (_initialize_valprint): Add add_show_from_set
+ call for setting up repeat_count_threshold as print variable.
+ * ch-exp.y (decode_integer_value): New function.
+ * ch-exp.y (decode_integer_literal): Use decode_integer_value.
+ * ch-exp.y (chill_printchar, chill_printstr): New language
+ dependent functions for printing characters and strings.
+ * ch-exp.y (chill_language_defn): Add chill_printchar and
+ chill_printstr.
+
+Thu Nov 19 21:22:21 1992 John Gilmore (gnu@cygnus.com)
+
+ * main.c (main): Print GDB version number in gdb -help; doc pid arg.
+ Suggested by Marty Leisner, <leisner@eso.mc.xerox.com>.
+ (print_gdb_version): New arg is stdout or stderr. Callers changed.
+
+Wed Nov 18 15:05:45 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-vx.c (vx_kill): just warn if we can't contact the board,
+ and assume the process has been killed.
+
+Wed Nov 18 14:39:57 1992 Stu Grossman (grossman at cygnus.com)
+
+ * remote-udi.c (udi_open): Reset vars so that user can re-run
+ programs without leaving GDB.
+ * (many routines): Slightly improve error handling.
+ * (download): Zero out BSS by longs instead of bytes to avoid
+ timeouts in real hardware.
+ * 29k-share/udi/udip2soc.c (UDIDisconnect, UDIKill): Indicate
+ that connection is no longer in use after shutdown() of socket.
+ This keeps GDB from dying of a SIGPIPE when you issue multiple
+ `target udi' commands.
+
+Wed Nov 18 14:27:47 1992 Fred Fish (fnf@cygnus.com)
+
+ * language.h (language_format_info): New structure to bundle
+ local formatting information.
+ * language.h (language_defn): Replace individual format info
+ with language_format_info structs.
+ * language.h (local_*_format, local_*_format_prefix,
+ local_*_format_specifier, local_*_format_suffix): New macros
+ for binary/octal/decimal/hex formats to access info elements.
+ * c-exp.y (c_language_defn): Update for new format handling.
+ * m2-exp.y (m2_language_defn): Update for new format handling.
+ * dbxread.c (language.h): Include for partial-stab.h use.
+ * mipsread.c (expression.h, language.h): Include for
+ partial-stab.h use.
+ * defs.h (local_hex_format, local_hex_format_custom,
+ local_hex_string, local_hex_string_custom): Move to language.h.
+ * language.c (local_hex_format_custom, local_hex_string,
+ local_hex_string_custom, local_octal_format_custom): Use new
+ format handling.
+ * language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn): Update for new format handling.
+ * printcmd.c (print_scalar_formatted): Use new macros
+ to access decimal and binary format info for printing.
+ * c-exp.y (chill_language_defn): Update for new format handling.
+ * ch-exp.y (CHARACTER_LITERAL): Add support to yylex.
+ * ch-exp.y (decode_integer_literal): Add function
+ * ch-exp.y (match_integer_literal): Use decode_integer_literal.
+ * ch-exp.y (builtin_type_chill_char): Add definition.
+ * gdbtypes.h (builtin_type_chill_char): Add declaration.
+
+Tue Nov 17 11:17:06 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * tm-rs6000.h (BELIEVE_PCC_PROMOTION): Define, since AIX cc gets
+ it right.
+ (aix_framedata): added nosavedpc field.
+ (SAVED_PC_AFTER_CALL): Don't try to optimize; just call
+ read_register.
+ (FRAMELESS_FUNCTION_INVOCATION): Pass second argument of 0.
+ (FRAME_SAVED_PC): If PC not saved, use SAVED_PC_AFTER_CALL.
+ * rs6000-tdep.c (skip_prologue): Handle gcc generated stfd
+ instructions as function_frame_info does. Expand special case of
+ st r31,-4(r1) to be st r31,NUM(r1), since gcc can generate offsets
+ other than -4.
+ (pop_frame): Add 4 rather than sizeof (int) to avoid host
+ dependence.
+ (function_frame_info): Set frameless if the function has no frame,
+ and set nosavedpc if the PC was not saved. Handle gcc generated
+ stfd 31,-4(31); st 31, -12(31) correctly.
+ (frameless_function_invocation): New second argument pcsaved; if 0
+ return whether the function has a frame, if 1 return whether the
+ function saved PC.
+ (frame_initial_stack_address): Correct typo: cache registers for
+ callee_fi, not for fi, (avoids reading garbage memory locations).
+
+Mon Nov 16 15:58:07 1992 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior (just before step_over_function
+ label)): Change test for stepping into subroutine to check for the
+ presence of line number info. This makes stuff compiled with -g1
+ cause GDB to not lose control when stepping.
+
+ * symtab.c (find_pc_line): Improve code per gnu's suggestions.
+ Improve comments as well.
+
+Sun Nov 15 09:22:09 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.7.2
+ * symtab.c (find_pc_symtab): Fix return of random value
+ to caller.
+ * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on
+ Makefile since it contains sed patterns used in generation.
+ Add sed pattern to also delete #include of any malloc.h.
+ * c-exp.y, expr.c, expression.h, language.c, m2-exp.y,
+ parser-defs.h, valarith.c, valops.c, value.h: Remap macros and
+ function names to conform to K&R terminology with respect to
+ logical and bitwise operators:
+ UNOP_ZEROP => UNOP_LOGICAL_NOT
+ UNOP_LOGNOT => UNOP_COMPLEMENT
+ BINOP_LOGAND => BINOP_BITWISE_AND
+ BINOP_LOGXOR => BINOP_BITWISE_XOR
+ BINOP_LOGIOR => BINOP_BITWISE_IOR
+ BINOP_AND => BINOP_LOGICAL_AND
+ BINOP_OR => BINOP_LOGICAL_OR
+ PREC_OR => PREC_LOGICAL_OR
+ PREC_AND => PREC_LOGICAL_AND
+ PREC_LOGIOR => PREC_BITWISE_IOR
+ PREC_LOGXOR => PREC_BITWISE_XOR
+ PREC_LOGAND => PREC_BITWISE_AND
+ value_zerop() => value_logical_not()
+ value_lognot() => value_complement()
+ * c-exp.y (c_op_print_tab): Add explicit empty terminator.
+ * m2-exp.y (m2_op_print_tab): Add explicit empty terminator.
+ * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary
+ and is nonexistant in some SVR4 based systems.
+ * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4.
+ * m2-exp.y (number_sign, modblock): Make static, #ifdef out
+ unused modblock.
+ * m2-exp.y (ANDAND): Rename to LOGICAL_AND.
+ * source.c (source_info): Fix minor nits, print "1 line" rather
+ than "1 lines", and "language is <lang>".
+ * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well
+ as TYPE_CODE_INT and TYPE_CODE_FLOAT.
+ * valprint.c (val_print): Print TYPE_CODE_BOOL type values as
+ "TRUE" or "FALSE".
+ * values.c (value_from_longest): Handle TYPE_CODE_BOOL.
+ * ch-exp.y: New expression parser, for GNU-Chill.
+ * defs.h (enum language): Add language_chill.
+ * dwarfread.c (set_cu_language): Add LANG_CHILL case and make
+ LANG_MODULA2 a recognized language.
+ * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for
+ Chill as well as Modula-2.
+ * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long,
+ builtin_type_chill_ulong, builtin_type_chill_real): Add.
+ * language.c (set_language_command): Add chill.
+ * language.c (binop_result_type, integral_type, character_type,
+ boolean_type, structured_type, value_true, binop_type_check):
+ Add language_chill cases.
+ * language.h (_LANG_chill): Define.
+ * symfile.c (deduce_language_from_filename): Recognize the
+ filename extensions ".chill", ".c186", and ".c286" for Chill.
+ * valprint.c (typedef_print): Add case for language_chill.
+ * Makefile.in (SFILES_MAINDIR): Add ch-exp.y.
+ * Makefile.in (YYFILES): Add ch-exp.tab.c.
+ * Makefile.in (YYOBJ): Add ch-exp.tab.o.
+ * Makefile.in (saber_gdb): Add unload of ch-exp.y and load
+ of ch-exp.tab.c.
+ * Makefile.in (distclean): Add target ch-exp.tab.c.
+ * Makefile.in (realclean): Add rm of ch-exp.tab.c.
+ * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets.
+ * eval.c (evaluate_subexp): Add OP_BOOL case.
+ * expprint.c (print_subexp): Add OP_BOOL case.
+
+Fri Nov 13 20:36:28 1992 John Gilmore (gnu@cygnus.com)
+
+ * infcmd.c (set_environment_command): Avoid skipping first
+ char of env value if an '=' appears in it. Bug report and fix
+ by Mark Jungerman, <maj@lucid.com>.
+
+Fri Nov 13 20:24:10 1992 Stu Grossman (grossman at cygnus.com)
+
+ * infcmd.c (step_over_calls): Improve comments.
+ * symtab.c (find_pc_psymtab): Clean up a bit.
+ * (find_pc_symtab): Fix comments, clean up code.
+ * (find_pc_line): General cleanups, efficiency improvements.
+ Also, don't return garbage when some line info exists, but there
+ was no good match.
+
+Thu Nov 5 23:04:38 1992 Rob Ryan (rr2b@andrew.cmu.edu)
+
+ * xcoffexec.c (vmap_symtab): fixed a bug where if a object has no
+ member, and the stat pointer passed to vmap_symtab was NULL, the
+ wrong vmap entries would be modified. Fixes behavior where
+ attempting to load symbols for a module with no member would mess
+ up already read in symbols.
+
+Wed Nov 11 17:09:17 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Remove dependancies for 29k-share/dfe/yank.o and
+ 29k-share/dfe/mini2udi.o.
+ * config/a29k-udi.mt: Remove yank.o and mini2udi.o.
+ * alldeps.mak, depend: Update to deal with removal of
+ aforementioned files.
+ * remote-udi.c: Major cleanups. Clean up udi_open and drop
+ requirement for useless 'program' argument. Clean up
+ udi_create_inferior, and udi_load to call common download()
+ routine. Create download routine to load remote hosts directly
+ (with the help of BFD) so that we don't need yank.c and
+ mini2udi.c.
+ Fix udi_detach to call UDIDisconnect with
+ the right arguments. Clean up udi_resume, don't assign tip_error
+ twice. Clean up udi_wait, straighten out status codes. Make
+ udi_kill really work.
+
+Fri Nov 6 10:26:01 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * c-exp.y: separated host/target idea of integer type size,
+ removed redundant parse rules. (YYSTYPE): added typed_val, removed
+ UINT and CHAR rules. (parse_number): work out the targetwise type
+ of a number based upon it's size and qualifiers. (yylex): chars
+ are now treated the same way as ints.
+
+ * source.c (indentify_source_line): don't core dump if wanted
+ line is larger than number of lines in source. (can happen when
+ coff gets confused about #included source).
+
+Fri Nov 6 03:00:39 1992 John Gilmore (gnu@cygnus.com)
+
+ Fix problems noticed by Allan Steel, <allan@maths.su.oz.au>,
+ when debugging a program with 100 shared libraries.
+
+ * solib.c (solib_map_sections): Always close the BFD we open.
+ Free all malloc'd storage we allocate, too, including error cases.
+ (struct so_list): Remove unused so_bfd member.
+ (clear_solib): Don't bother closing so_bfd.
+
+ * symfile.c (symfile_bfd_open): Mark newly opened BFD as
+ cacheable. `So many symbol files, so little file descriptors.'
+
+Fri Nov 6 00:14:38 1992 John Gilmore (gnu@cygnus.com)
+
+ * m68k-stub.c: Remove ansidecl.h and the few uses of it.
+ Stubs should stand alone as much as possible.
+
+ * source.c (show_directories): Avoid printf_filtered length prob
+ pointed out by Jonathan Stone.
+
+ * i960-pinsn.c (MEM_MAX, MEM_SIZ): Set upper limit properly to
+ avoid accesses beyond end of table. Fix by Lee W. Cooprider,
+ <Lee_Cooprider@vos.stratus.com>.
+
+Thu Nov 5 17:33:08 1992 Fred Fish (fnf@cygnus.com)
+
+ * {ser-bsd.c, ser-termios.c} (serial_close): Pass address of
+ struct, not struct itself.
+ * serial.h (serial_restore): Fix prototype, takes pointer not
+ struct.
+
+Thu Nov 5 17:12:42 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (depend): Add nm.h to the list of things to fixup.
+ * depend: Redo, to fixup nm.h problems with *-tab.c files.
+
+Thu Nov 5 00:19:51 1992 John Gilmore (gnu@cygnus.com)
+
+ * i386-stub.c: Remove ansidecl.h and the few uses of it.
+ Stubs should stand alone as much as possible.
+
+ * README: Add remote-es1800.c and remote-st2000.c to table.
+ * go32-nat.c: Remove, there is no native go32 support.
+ * go32-xdep.c: Remove unused fork, fvork, wait, execlp, kill_inferior.
+
+Wed Nov 4 15:27:31 1992 Stu Grossman (grossman at cygnus.com)
+
+ * inflow.c (pass_signal, set_sigint_trap, clear_sigint_trap): Add
+ new routines to deal with sending SIGINTs to attached processes
+ when the user interrupts the controlling GDB.
+ * inftarg.c (child_wait), procfs.c (procfs_wait): Add calls to
+ the aforementioned routines when waiting for the attached process.
+
+ * elfread.c, mipsread.c: Include <string.h>.
+ * i386-stub.c: Include "ansidecl.h" to deal with prototypes.
+ * serial.h: Add prototype for serial_restore().
+
+Wed Nov 4 11:13:25 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * minsyms.c (lookup_minimal_symbol_by_pc): subtract 1, not 2, from
+ minimal_symbol_count, because the NULL symbol is not included in
+ the count. This prevented this function from finding the last
+ symbol in the table.
+
+Tue Nov 3 11:29:17 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * dbxread.c (process_one_symbol): if not defined
+ (BLOCK_ADDRESS_FUNCTION_RELATIVE), set function_start_offset at
+ the start of the function, not just after N_FUN.
+
+Fri Oct 30 16:33:02 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add sed patterns to
+ remap all malloc's to xmalloc's and all realloc's to xrealloc's.
+ * c-exp.y, m2-exp.y: Add comment about how malloc/realloc are
+ remapped to xmalloc/xrealloc, use only malloc/realloc in grammer
+ file. Remove preprocessor defines that previously did remapping.
+
+Fri Oct 30 00:58:18 1992 John Gilmore (gnu@cygnus.com)
+
+ * infcmd.c (run_command): Avoid long calls to printf_filtered.
+ Bug fix courtesy of Alexander Klaiber.
+
+Tue Oct 27 17:08:45 1992 K. Richard Pixley (rich@cygnus.com)
+
+ hp300 native support (hp300hpux untested).
+
+ * hp300ux-xdep.c: removed.
+ * xm-hp300bsd.h (REGISTER_U_ADDR): removed.
+ * xm-hp300hpux.h: updated copyright.
+ (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed.
+ * nm-hp300bsd.h, nm-hp300hpux.h, hp300ux-nat.c: new files.
+ * Makefile.in (HFILES): added nm-hp300bsd.h and nm-hp300hpux.h.
+ * config/hp300bsd.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o corelow.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/hp300bsd.mt (TDEPFILES): removed exec.o.
+ * config/hp300hpux.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/hp300hpux.mt (TDEPFILES): removed exec.o.
+
+ Vax ultrix native support.
+
+ * nm-vax.h: new file.
+ * Makefile.in (HFILES): added nm-vax.h.
+ * config/vaxult.mh (XDEPFILES): infptrace.o inftarg.o fork-child.o
+ coredep.o corelow.o removed.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * xm-vax.h: updated copyright.
+ (REGISTER_U_ADDR): removed.
+
+ Apollo native support (untested).
+
+ * Makefile.in (HFILES): added nm-apollo68[bv].h.
+ * a68v-nat.c, nm-apollo68[bv].h: new files.
+ * xm-apollo68[bv].h (FETCH_INFERIOR_REGISTERS): removed.
+ * xm-apollo68b.h (PTRACE_IN_WRONG_PLACE): removed.
+ * a68v-xdep.c: removed.
+ * config/apollo68[bv].mh (XDEPFILES): removed infptrace.o
+ inftarg.o fork-child.o a68v-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+
+ * defs.h: include nm.h.
+ * coredep.c, infptrace.c, procfs.c, rs6000-nat.c, sparc-nat.c,
+ sparc-tdep.c, : do not include nm.h.
+ * doc/gdbint.texinfo: nm.h now included in defs.h.
+
+Fri Oct 23 04:47:17 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (VERSION): 4.7.1 post release!
+
+ * config/hppahpux.mh (NATDEPFILES): Add hppah-nat.o.
+
+Fri Oct 23 00:48:08 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): gdb-4.7 release.
+ * README: Update for gdb-4.7.
+
+Thu Oct 22 11:24:18 1992 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-tdep.c: include nm.h (for now) so that we get USE_PROC_FS
+ when necessary.
+
+ * alldeps.mak, depend: Update.
+
+Thu Oct 22 03:14:36 1992 John Gilmore (gnu@cygnus.com)
+
+ * partial-stab.h ('f', 'F'): Don't reference pst->textlow if pst
+ is null.
+ * tm-sun4sol2.h (PROLOGUE_FIRSTLINE_OVERLAP): Remove -- it
+ causes problems in setting breakpoint in the right place in
+ functions with `float' args which are passed as doubles.
+ * xm-vaxbsd.h (MEM_FNS_DECLARED): Avoid erroneous redecl's.
+ * config/rs6000.mh (NATDEPFILES): Add corelow.o.
+
+Thu Oct 22 01:01:24 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (HFILES): Add nm-i386sco.h.
+ * dwarfread.c: include <sys/types.h> for SCO.
+ * infptrace.c: Don't include ptrace.h under SCO.
+ * config/i386sco.mh: Use -D_POSIX_SOURCE instead of -posix for
+ gcc.
+ * config/i386v.mt: Add exec.o to TDEPFILES.
+
+Wed Oct 21 19:08:20 1992 Stu Grossman (grossman at cygnus.com)
+
+ * i386v-nat.c: Remove space from front of #endif.
+ * irix4-nat.c: Remove externs of registers[], include inferior.h
+ instead.
+ * mips-nat.c: Explicitly initialize zerobuf to 0!
+ * mips-tdep.c (init_extra_frame_info): Undo John's last change.
+ Always setup fci->frame, even if it's non-zero. Too many places
+ depend upon this behavior (and I have to get a release out the
+ door)!
+ * mipsread.c (parse_partial_symbols, psymtab_to_symtab_1): Set
+ processing_gcc_compilation if we find the embedded stabs marker.
+ This fixes several bugs with finding the location of short or char
+ function parameters passed on the stack.
+
+Wed Oct 21 17:46:07 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Native support for sun4sol2.
+
+ * xm-sysv4.h (USE_PROC_FS, ATTACH_DETACH): removed to nm-sysv4.h.
+ * nm-sysv4.h: new file.
+ * Makefile.in (HFILES): added nm-sysv4.h.
+ * config/sun4sol2.mh (XDEPFILES): removed procfs.o fork-child.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/sun4sol2.mt (TDEPFILES): removed exec.o and solib.o.
+
+Wed Oct 21 03:51:01 1992 John Gilmore (gnu@cygnus.com)
+
+ * coredep.c: Include "nm.h" to get REGISTER_U_ADDR.
+ * doc/gdbint.texinfo: Improve REGISTER_U_ADDR and USE_PROC_FS doc.
+
+ * Makefile.in (VERSION): Tick to 4.6.9.
+
+Tue Oct 20 23:27:56 1992 John Gilmore (gnu@cygnus.com)
+
+ * mipsread.c (UNSAFE_DATA_ADDR): Remove MIPS-host-specific
+ definition, replace with portable one.
+ * remote-nindy.c: Lint.
+ (nindy_wait): Return type is int, result is inferior_pid.
+ * symmisc.c (dump_psymtab): Only print section_offsets if set.
+ (initialize_symmisc): Remove empty function.
+ * tm-spc-noun.h, tm-sun4os4.h, tm-sun4sol2.h (STACK_END_ADDRESS):
+ Remove obsolete, misspelled macro.
+ * doc/gdbint.texinfo: Document obsolete STACK_END_ADDR.
+ (all @node commands): Use new form to avoid nitpicking errors.
+ * doc/gdbint.texinfo: Document host/native/target split.
+
+Wed Oct 21 00:14:34 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mips-nat.c (zerobuf): Get rid of const to avoid gcc warnings.
+
+ * xm-mips.h (offsetof): Don't define this if __STDC__.
+
+Tue Oct 20 21:32:18 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ umax native support (untested).
+
+ * config/umax.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/umax.mt (TDEPFILES): removed exec.o.
+ * xm-umax.h (U_REGS_OFFSET, ATTACH_DETACH, REGISTER_U_ADDR):
+ removed to nm-umax.h.
+ * nm-umax.h: new file.
+ * Makefile.in (HFILES): added nm-umax.h.
+
+ hppa native support (untested).
+
+ * config/hppahpux.mh, config/hppabsd.mh (XDEPFILES): now empty.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/hppabsd.mt (TDEPFILES): removed exec.o and hppab-core.o.
+ * config/hppahpux.mt (TDEPFILES): removed exec.o.
+ * xm-hppa[bh].h (REGISTER_U_ADDR, U_REGS_OFFSET): removed.
+ * nm-hppa[bh].h, hppa[bh]-nat.c: new files.
+ * hppa[bh]-xdep.c: removed.
+ * hppa[bh]h-tdep.c: do not include ptrace.h.
+ * Makefile.in (HFILES): added nm-hppa[bh].h.
+
+ * doc/gdbint.texinfo: add PUSH_DUMMY_FRAME, POP_FRAME.
+
+Tue Oct 20 00:01:46 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mips-nat.c: Straighten out include files. Work around
+ conflicting defs of JB_xxx syms in <setjmp.h> and <machine/pcb.h>
+ for Ultrix-4.2.
+
+Mon Oct 19 15:09:57 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mips-nat.c (fetch_core_registers, register_addr): Copy from
+ coredep.c, but zero out FP_REGNUM & ZERO_REGNUM so that stack
+ backtraces from core files work.
+ * config/decstation.mh, config/irix3.mh: Remove coredep.o.
+ Functions are now defined in mips-nat.c.
+
+ * tm-irix3.h: Put MIPS_EFI_SYMBOL_NAME in here too.
+
+ * remote-hms.c: Disable all uses of serial_nextbaudrate and
+ serial_default_name().
+
+ * remote-hms.c, ser-go32.c, serial.h: Change from
+ serial_timedreadchar() to new serial_readchar().
+
+ * Makefile.in (HFILES): Fixup list of nm-*.h files. Add missing ones.
+
+Mon Oct 19 12:45:23 1992 Per Bothner (bothner@cygnus.com)
+
+ * c-exp.y: Moved handling of 'const' and 'volatile' from
+ <type> to <typebase>. This removes 2 conflicts.
+
+Sun Oct 18 00:36:30 1992 Fred Fish (fnf@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Don't delete watchpoints
+ from breakpoint table when reseting breakpoints.
+
+Sat Oct 17 00:59:23 1992 Fred Fish (fnf@cygnus.com)
+
+ Native support cleanup and corefile fixes for i386 SVR4 systems.
+
+ * i386-tdep.c (supply_gregset, fill_gregset, supply_fpregset,
+ fill_fpregset): Moved to i386v4-nat.c
+ * i386v4-nat.c, nm-i386v4.h, : New files.
+ * i386sol2.mh, i386v4.mh, ncr3000.mh (NAT_FILE): Use nm-i386v4.h.
+ * i386sol2.mh, i386v4.mh, ncr3000.mh (NATDEPFILES): Add corelow.o,
+ change i386v-nat.o to i386v4-nat.o.
+
+Fri Oct 16 13:06:08 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Miscellaneous 386 configs updated.
+
+ * config/i386aout.mt (TDEPFILES): removed exec.o.
+ * config/i386sol2.mh, config/ncr3000.mh, config/i386v4.mh
+ (XDEPFILES): removed procfs.o fork-child.o i386-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/i386aout.mt, config/i386sol2.mt, config/ncr3000.mt,
+ config/i386v4.mt (TDEPFILES): removed exec.o.
+ * config/i386v32.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o corelow.o i386-xdep.o i387-tdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/i386sco.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o corelow.o i386-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+
+ Native support cleanup for i386bsd (untested).
+
+ * config/i386bsd.mt (NATDEPFILES): exec.o removed.
+ * config/i386bsd.mh (NATDEPFILES): added exec.o
+ * tm-i386bsd.h (FLOAT_INFO): removed.
+ * nm-i386bsd.h (FLOAT_INFO): added.
+
+ Native support for i386v (untested).
+
+ * config/i386v.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o corelow.o i386-xdep.o i387-tdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/i386v.mt (TDEPFILES): removed exec.o, added i387-tdep.o.
+ * i386-xdep.c: removed.
+ * Makefile.in (HFILES): added nm-i386v.h
+ * i386v-nat.c, nm-i386v.h: new file.
+ * xm-i386v.h: (REGISTER_U_ADDR, i386_register_u_addr): removed to
+ nm-i386v.h.
+ * tm-i386v.h (FLOAT_INFO): removed.
+
+ Native support for linux (untested).
+
+ * config/linux.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o corelow.o i387-tdep.o i386-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/linux.mt (TDEPFILES): removed exec.o, added i387-tdep.o.
+ * Makefile.in (HFILES): added nm-linux.h.
+ * nm-linux.h: new file.
+ * xm-linux.h: updated copyright. cleaned up formatting.
+ (ATTACH_DETACH, U_REGS_OFFSET): removed to nm-linux.h.
+
+ Native support for sun386 (untested).
+
+ * config/sun386.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o sun386-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/sun386.mt (TDEPFILES): removed exec.o.
+ * Makefile.in (HFILES): added nm-sun386.h.
+ * sun386-nat.c, nm-sun386.h: new file.
+ * sun386-xdep.c: removed.
+ * xm-sun386.h: updated comment and copyright.
+ (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed to
+ nm-sun386.h.
+
+ Native support for i386mach (untested).
+
+ * config/i386mach.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o mach386-xdep.o.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * Makefile.in (HFILES): added nm-i386mach.h.
+ * nm-i386mach.h, i386mach-nat.c: new files.
+ * mach386-xdep.c: removed.
+ * xm-i386mach.h: updated copyright.
+ (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed to
+ nm-i386mach.h.
+
+ Native separation for go32 (untested).
+
+ * config/go32.mh (NAT_FILE, NATDEPFILES): new macros.
+ * go32-nat.c: new file.
+ * go32-xdep.c (call_ptrace, child_resume,
+ fetch_inferior_registers, store_inferior_registers,
+ child_xfer_memory, fetch_core_registers): removed to go32-nat.c.
+
+ Native support for m88k (untested).
+
+ * Makefile.in (HFILES): added nm-m88k.h
+ * xm-delta88.h, xm-m88k.h (REGISTER_U_ADDR,
+ FETCH_INFERIOR_REGISTERS): removed.
+ * config/m88k.mh, config/delta88.mh (XDEPFILES): infptrace.o
+ inftarg.o fork-child.o m88k-xdep.o removed to NATDEPFILES.
+ (NAT_FILE, NATDEPFILES): new macros.
+ * config/m88k.mt, config/delta88.mt (TDEPFILES): removed exec.o.
+ * m88k-nat.c, nm-m88k.h, nm-delta88.h: new files.o.
+ * m88k-xdep.c: removed.
+
+Fri Oct 16 04:16:30 1992 John Gilmore (gnu@cygnus.com)
+
+ * i386b-nat.c: Comment changes.
+ * nm-i386bsd.h, xm-i386bsd.h: Split native dependent pieces out
+ into new nm-file.
+ * config/i386bsd.mh (NAT_FILE): Point to new nm-file.
+
+Fri Oct 16 03:34:01 1992 John Gilmore (gnu@cygnus.com)
+
+ Avoid longjmp()-catching compilation errors in cross-ports.
+
+ * doc/gdbint.texinfo: Update GET_LONGJMP_TARGET, L_SET doc.
+ * irix4-nat.c, mips-nat.c (JB_ELEMENT_SIZE, get_longjmp_target):
+ Move from mips-tdep.c and tm-{irix3,mips}.h.
+ * mips-nat.c: Remove a bunch of code that was ifdef'd out of
+ native MIPS ports.
+ * nm-irix3.h, nm-mips.h (GET_LONGJMP_TARGET): Move from tm-irix3.h
+ and tm-mips.h.
+
+ * ultra3-nat.c (register_addr): Move from ultra3-xdep.c.
+ (fetch_core_registers): Fix bfd_seek arguments.
+
+Fri Oct 16 03:02:28 1992 John Gilmore (gnu@cygnus.com)
+
+ Make core files work again (add back the `core' target).
+
+ * config/decstation.mh, news.mh, sun2os3.mh, sun2os4.mh
+ (NATDEPFILES): Add corelow.o.
+ * config/delta88.mt, m88k.mt (TDEPFILES): Remove coredep.o, it's
+ native dependent.
+
+ * config/3b1.mh, bigmips.mh, hp300bsd.mh, hppabsd.mh, hppahpux.mh,
+ i386sco.mh, i386v.mh, i386v32.mh, irix3.mh, isi.mh, linux.mh,
+ littlemips.mh, merlin.mh, news1000.mh, pn.mh, rtbsd.mh, tahoe.mh,
+ vaxbsd.mh, vaxult.mh (XDEPFILES): Add corelow.o whenever coredep.o
+ appears. FIXME, these should be moved to NATDEPFILES for native
+ use only.
+
+Thu Oct 15 21:53:53 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Ultra3 host/target/native split. (untested).
+
+ * ultra3-xdep.c: updated copyright. Do not include sys/ptrace.h.
+ (fetch_register, fetch_inferior_registers,
+ store_inferior_registers, fetch_core_registers): removed to
+ ultra3-nat.c.
+ * xm-ultra3.h (FETCH_INFERIOR_REGISTERS, U_REGS_OFFSET): removed
+ to nm-ultra3.h.
+ * Makefile.in (HFILES): added nm-ultra3.h.
+ * nm-ultra3.h, ultra3-nat.c: new files for native support.
+ * config/ultra3.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o.
+ (NAT_FILE, NATDEPFILES): new macros for native support.
+ * config/ultra3.mt (TDEPFILES): exec.o removed.
+
+ * xm-vaxult.h: add MEM_FNS_DECLARED.
+
+Thu Oct 15 02:59:30 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): Roll to 4.6.8.
+ (OBS): Put version.o first, so Makefile rebuild happens early.
+
+ * command.h: Publicize prototype for not_just_help_class_command.
+ * command.c: Remove proto.
+ * maint.c: Mark "mt" as an abbrev, to avoid duplicated help
+ output. Move "maint info" from class info to class maintenance,
+ and improve text.
+ * infrun.c: Move "stop" to class_obscure, and give it a
+ function so it will not be seen as a global help topic. FIXME,
+ it should be possible to set these attributes independently.
+
+ * core.c (core_command): Make nicer error message for no core support.
+
+ Lint around file_ptr's (bfd's off_t's) and bfd_seek.
+
+ * dbxread.c (read_dbx_symtab): Use L_SET as bfd_seek arg.
+ (elfstab_build_psymtabs): staboffset and stabstroffset args are
+ file_ptr's.
+ * dwarfread.c (struct dwfinfo): Convert dbfoff, lnfoff to file_ptr.
+ (scan_compilation_units): Punt unused filename arg. dbfoff,
+ lnoffset, and curlnoffset are file_ptr's now.
+ (dwarf_build_psymtabs): Drop desc and filename args; use
+ objfile. dbfoff and lnoffset are file_ptr's now.
+ (read_ofile_symtab): foffset is now file_ptr. Use L_SET in bfd_seek.
+ * elfread.c (struct elfinfo): dboffset and lnoffset are file_ptr's.
+ (elf_symfile_read): Skip desc and filename args to
+ dwarf_build_psymtabs. Pass file_ptr's to elfstab_build_psymtabs.
+ * gdb-stabs.h: Use file_ptr rather than off_t.
+ * mipsread.c (fixup_symtab): f_ptr is a file_ptr. Re-enable
+ compile-time debug check that someone turned off as "unused".
+ (read_the_mips_symtab): st_filptr is a file_ptr. Fix bfd_seek call.
+ * symfile.h: Update dwarf_build_psymtabs and
+ elfstab_build_psymtabs prototypes.
+ * xcoffread.c (init_stringtab, init_lineno, xcoff_symfile_read):
+ Use file_ptr offsets. bfd_seeks use L_SET.
+
+Thu Oct 15 01:27:32 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mips-tdep.c, mipsread.c, tm-mips.h: Get rid of ".gdbinfo."
+ symbol. #define MIPS_EFI_SYMBOL_NAME instead. Use different
+ value so that demangler won't be invoked. This greatly speeds up
+ stepping.
+ * mips-tdep.c (mips_pop_frame): Rewrite handling of
+ linked_proc_info so that it properly deallocates the appropriate
+ item after it is done with it instead of before.
+ * Don't pass bogus frame pointer to create_new_frame(). Just
+ leave it as zero so that lower level code will figure out the
+ correct value.
+
+Wed Oct 14 18:56:28 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Sony News native support.
+
+ * Makefile.in (HFILES): added nm-news.h.
+ * nm-news.h: new file.
+ * config/news.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o to NATDEPFILES.
+ (NAT_FILE, NATDEPFILES): new macros for native support.
+ * config/news.mt (TDEPFILES): removed exec.o.
+
+ * remote-vx.c: remove redundant include of sys/time.h.
+
+ * infrun.c: include ctype.h. Otherwise some machines result in
+ undefined for isdigit.
+
+Tue Oct 13 01:27:14 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in: Convert m68k entries to m68* entries to handle
+ all the various m68xxx hosts and targets.
+ * config/news1000.mt: No longer needed, same as news.mt.
+
+Fri Oct 9 18:54:37 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/sun3os[34].mh (NATDEPFILES): remove duplicate inftarg.o.
+
+Fri Oct 9 14:20:08 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (HFILES): Add all nm-irix3.h, nm-irix4.h,
+ nm-sun2.h, nm-mips.h.
+
+ * config/irix3.mh (NATDEPFILES): nat-mips.o => mips-nat.o.
+
+ * Makefile.in (alldeps.mak): Add = sign after NATDEPFILES.
+
+ * config/bigmips.mh config/littlemips.mh: Remove mips-xdep.o.
+
+Fri Oct 9 08:41:11 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * xm-hppah.h: if __STDC__ is not defined, define
+ HPPA_COMPILER_BUG.
+ symtab.c (decode_line_1): avoid a bug in the HP9000/700 native
+ compiler; see the comment in the file.
+
+Fri Oct 9 04:43:43 1992 John Gilmore (gnu@cygnus.com)
+
+ First cut at support for all BSD variants on 386.
+
+ * tm-i386bsd.h, xm-i386bsd.h: New config files.
+ * i386b-nat.c: New native support file.
+ * configure.in: Add host and target for i[34]86-*-bsd*.
+ * config/i386bsd.mh, config/i386bsd.mt: New config files.
+
+Fri Oct 9 00:31:33 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Sun2 native support (untested).
+
+ * xm-sun2.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS,
+ REGISTER_U_ADDR): removed to nm-sun2.h.
+ * nm-sun2.h: new file.
+ * config/sun2os[34].mh (XDEPFILES): infptrace.o inftarg.o
+ fork-child.o sun3-xdep.o removed.
+ (NAT_FILE, NATDEPFILES): new macros.
+
+ Mips native support. Decstation and iris4 have been tested.
+ Iris3 has not.
+
+ * mips-tdep.c (supply_gregset, fill_gregset, supply_fpregset,
+ fill_fpregset): removed to irix4-nat.c
+ * mips-xdep.c: removed.
+ * irix4-nat.c, mips-nat.c, nm-irix3.h, nm-irix4.h, nm-mips.h: new
+ files.
+ * procfs.c: include nm.h.
+ * xm-irix3.h (U_REGS_OFFSET, FETCH_INFERIOR_REGISTERS): removed.
+ * xm-irix4.h: bump copyright.
+ (U_REGS_OFFSET, FETCH_INFERIOR_REGISTERS, USE_PROC_FS,
+ PROC_NAME_FMT): removed.
+ * xm-mips.h (FETCH_INFERIOR_REGISTERS): removed.
+ * config/irix4.mh (XDEPFILES): removed procfs.o fork-child.o.
+ (NAT_FILE, NATDEPFILES): new macros for native support.
+ (CC): supply default compiler switches.
+ * config/irix3.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o coredep.o.
+ (NAT_FILE, NATDEPFILES): new macros for native support. Note that
+ irix3 is untested.
+ * config/decstation.mh (XDEPFILES): removed infptrace.o inftarg.o
+ fork-child.o mips-xdep.o coredep.o.
+ (NAT_FILE, NATDEPFILES): new macros for native support.
+
+Thu Oct 8 23:50:51 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/rs6000.mh (XDEPFILES): removed fork-child.o.
+ (NATDEPFILES): added fork-child.o
+ * config/sun3os3.mh (XDEPFILES): removed fork-child.o.
+ (NATDEPFILES): added fork-child.o
+ * config/sun3os4.mh (XDEPFILES): removed fork-child.o.
+ (NATDEPFILES): added fork-child.o
+
+Thu Oct 8 23:19:25 1992 John Gilmore (gnu@cygnus.com)
+
+ * infcmd.c (path_info): Avoid 250-char limit on printf_filtered,
+ by using puts_filtered instead.
+
+Fri Oct 9 00:28:25 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * remote-nindy.c (nindy_load): Replacement version from Steve
+ Chamberlain, doesn't require forking to run "strip" or "sx".
+
+Thu Oct 8 18:27:35 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (HFILES): Add nm-*.h files.
+
+Thu Oct 8 16:27:45 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/sun4os4.mh (XDEPFILES): fork-child.o removed.
+ (NATDEPFILES): added fork-child.o.
+
+ * doc/gdbint.texinfo: document a few more macros, create new
+ section for native macros.
+
+Thu Oct 8 13:52:46 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in alldeps.mak depend: Rip out 29k/udi pending
+ resolution of copyright issues.
+
+Wed Oct 7 20:08:53 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (setup-to-dist): Remove -norecursion so that doc
+ subdir gets configured.
+
+Wed Oct 7 12:24:01 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * Makefile.in (nindy.o): Define "STRIP" as pathname of strip
+ program.
+ * nindy-share/nindy.c (coffstrip): Use that pathname, instead of
+ searching for a "bfd_strip" program. Also, fixed up arguments
+ passed to that program.
+
+ * tm-nindy960.h (ADDITIONAL_OPTIONS): Use "-ser" rather than "-r",
+ which is now used for something else. Rewrite description of
+ associated parameters to match how gdb does it now.
+ (ADDITIONAL_OPTION_HELP): Fix message accordingly.
+
+ * m68k-pinsn.c (print_insn_arg): Handle new "`" operand type.
+
+Tue Oct 6 14:47:11 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ NOTICE_SIGNAL_HANDLING_CHANGE macro added to the target vector as
+ to_notice_signals.
+
+ * inferior.h (proc_signal_handling_change): prototype removed.
+ * infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): default removed.
+ (handle_command): now calls target_notice_signals.
+ * procfs.c (proc_signal_handling_change): renamed to
+ procfs_notice_signals. Now static. Add prototype. All callers
+ changed.
+ * target.h (struct target_ops): new field, to_notice_signals.
+ (target_notice_signals): new macro to cover new field.
+ * target.c (cleanup_target): default to_notice_signals to ignore.
+ * corelow.c (core_ops),
+ exec.c (exec_ops),
+ inftarg.c (child_ops),
+ procfs.c (procfs_ops),
+ remote-adapt.c (adapt-ops),
+ remote-eb.c (eb_ops),
+ remote-es1800.c (es1800_ops, es1800_child_ops),
+ remote-hms.c (hms_ops),
+ remote-mm.c (mm_ops),
+ remote-nindy.c (nindy_ops),
+ remote-st2000.c (st2000_ops),
+ remote-udi.c (udi_ops),
+ remote-vx.c (vx_ops, vx_run_ops),
+ remote.c (remote_ops),
+ target.c (dummy_target),
+ xcoffexec.c (exec_ops): added static initializer for
+ to_notice_signals.
+ * xm-irix4.h, xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): removed.
+
+Tue Oct 6 12:13:08 1992 John Gilmore (gnu@cygnus.com)
+
+ * main.c (define_command): Add forgotten initializer.
+
+Tue Oct 6 02:23:17 1992 John Gilmore (gnu@cygnus.com)
+
+ * language.c, language.h: Move saved_language out to global
+ expected_language. Set expected_language when user expectation
+ changes.
+ * language.c (language_info): Don't print type/range checking gub.
+ * main.c (main): Set expected language.
+ (execute_command): Check against expected language.
+ * symfile.c (set_initial_language): Set expected language.
+
+ * configure.in, config/i386sol2.{mh,mt}: Preliminary Solaris-x86 conf.
+
+Fri Sep 4 00:34:30 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ A bunch of changes mostly to improve debugging of C++ programs.
+ Specifically, the calling of inferiors methods is improved.
+
+ * value.h: New macros METHOD_PTR_IS_VIRTUAL,
+ METHOD_PTR_FROM_VOFFSET, METHOD_PTR_TO_VOFFSET to partially
+ hide the implementation details of pointer-to-method objects.
+ How to tell if the pointer points to a virtual method is
+ still very dependent on the particular compiler, but this
+ should make it easier to find the places to change.
+ * eval.c (evaluate_subexp [case OP_FUNCALL]), valprint.c
+ (val_print [case TYPE_CODE_PTR]): Use the new METHOD_PTR_*
+ macros, instead of a hard-wired-in code that incorrectly
+ assumed a no-longerused representation of pointer-to-method
+ values. And otherwise fix the relevant bit-rotted code.
+
+ * valprint.c (type_print_base [case TYPE_CODE_STRUCT]):
+ If there are both fields and methods, put a space between.
+
+ * stabsread.c (read_struct_type): Fix bug in handling of
+ GNU C++ anonymous type (indicated by CPLUS_MARKER followed
+ by '_'). (It used to prematurely exit the loop reading in
+ the fields, so it would think it should start reading
+ methods while still in the fields. This could crash gdb
+ given a gcc that can emit nested type information.)
+
+ * valops.c (search_struct_method): Pass 'this' value by
+ reference instead of by value. This provides a more
+ consistent interface through a recursive search where the
+ "bottom" functions may need to adjust offsets (due to multiple
+ inheritance).
+ * valops.c, value.h, values.c: Pass extra parameters to
+ value_fn_field and value_virtual_fn_field so we can
+ correctly adjust offset for multiple inheritance.
+ * eval.c (evaluate_subexp [case OP_FUNCALL]): Simplify
+ virtual function calls by using value_virtual_fn_field().
+ * values.c: New function baseclass_offset, derived from
+ baseclass_addr (which perhaps can be made obsolete?).
+ It returns an offset rather than an address. This is a
+ cleaner interface since it doesn't mess around allocating
+ new values.
+ * valops.c (search_struct_method): Use baseclass_offset
+ rather than baseclass_addr.
+
+Mon Oct 5 16:02:04 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Re-install 29K/UDI stuff.
+ * remote-udi.c (udi_resume): Clean up.
+ * (udi_wait): Rewrite, leave out bugs.
+ * Add debugging code to print out all register fetches and stores.
+ * Straighten out target_ops.
+ * tm-29k.h (DUMMY_FRAME_RSIZE): Pad out to doubleword.
+
+Mon Oct 5 09:46:44 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-udi.c (udi_create_inferior): run with no arguments should
+ not pass the program name as an argument, since the UDI code
+ already handles that.
+ (udi_load): get the symbols from prog_name, not arg_string (the
+ load command should really use arg_string as the program name, not
+ prog_name, but at least the run command works now).
+
+ * munch: HP9000/300 nm puts an extra space between T and symbol
+ name.
+
+ * config/irix4.mh: added -lsun to XM_CLIBS to get RPC functions
+ needed for vxworks targets.
+
+Fri Oct 2 22:04:42 1992 John Gilmore (gnu@cygnus.com)
+
+ * am29k-tdep.c (_initialize_29k): Make it possible for the
+ user to set and query the address where function calls into the
+ inferior write a small scratch routine. `set call_scratch_address'
+ * inferior.h (PC_IN_CALL_DUMMY): Fix fencepost error.
+ * remote.c (remote_prepare_to_store): Only fetch regs if they are
+ not already cached validly.
+
+Thu Oct 1 14:36:42 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Rs6000 native support.
+
+ * infptrace.c: remove #ifdef USG from around include ptrace.h.
+ machines without this header should not be compiling this file.
+ * nm-rs6000.h, rs6000-nat.c: new files for native support.
+ * rs6000-tdep.c: do not include sys/ptrace.h or sys/reg.h.
+ * rs6000-xdep.c: removed. all code now in rs6000-nat.c.
+ * xm-rs6000.h: do not include ptrace.h.
+ (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to nm-rs6000.h.
+ * config/rs6000.mh (XDEPFILES): removed rs6000-xdep.o.
+ infptrace.o and inftarg.o move to NATDEPFIES.
+ (NAT_FILE, NATDEPFILES): new macro for native support.
+
+ Sun3 native support.
+
+ * config/sun3os3.mh, config/sun3os4.mh (NAT_FILE, NATDEPFILES):
+ new macros for native support.
+ (XDEPFILES): moved infptrace.o and inftarg.o to NATDEPFILES,
+ removed sun3-xdep.o.
+ * xm-sun3.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to
+ nm-sun3.h.
+ * sun3-xdep.c: removed. All code is now in sun3-nat.c.
+ * sun3-nat.c, nm-sun3.h: new files for native support.
+
+Thu Oct 1 10:30:54 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (dbsize): New variable to hold size of dwarf info.
+ * dwarfread.c (dwarf_build_psymtabs): Rename dbsize parameter to
+ dbfsize and use it to initialize new local file scope dbsize.
+ * dwarfread.c (read_ofile_symtab): Initialize dbsize and use it.
+ * dwarfread.c (basicdieinfo): Use dbsize to check for oversize
+ DIEs as well as the current check for undersize DIEs. This helps
+ to gracefully detect and reject corrupted DIE information.
+
+Thu Oct 1 01:57:56 1992 John Gilmore (gnu@cygnus.com)
+
+ Add `command hooks' and a hook for inferior program stopping.
+
+ * command.h (struct cmd_list_element): Remove unused `aux'
+ field. Add new `hook', `hookee', and `cmd_pointer' fields.
+ * command.c (add_cmd): Initialize new fields, elim old.
+ (add_alias_cmd): Clone new fields.
+ (delete_cmd): Un-hook hookee if we're deleting hook.
+ (help_cmd): Tell user the command is hooked, if it is.
+ (lookup_cmd_1): Abbreviations return the original command
+ instead of themselves, so that hooks on the original cmd will be
+ run.
+ * defs.h (enum command_class): Add class_pseudo and comments.
+ * gdbcmd.h (execute_user_command): Add prototype.
+ * infrun.c (normal_stop): If the stop command is hooked,
+ run the hook whenever we stop.
+ (hook_stop_stub): Stub for catch_errors.
+ (_initialize_infrun): Set up pseudo "stop" command.
+ * main.c (execute_user_command): Code extracted from execute_command.
+ (execute_command): If hooked, run the hook before the command.
+ (define_command): If defining a new hook, check the command it
+ is hooking, and warn if none. Install the hook.
+ * source.c (_initialize_source): "l" is an abbrev for "list".
+ * doc/gdb.texinfo: Document command hooks.
+
+ * Makefile.in (VERSION): Roll to 4.6.7.
+ * config/sun4os4.mh: Remove dup inftarg.o from NATDEPFILES.
+ * infrun.c (breakpoints_inserted): Make it static again.
+ * tm-symmetry.h (FLOAT_INFO): #if 0 it for cross-ptrace abuse.
+
+Wed Sep 30 15:33:22 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Native file renaming.
+
+ * nat-sparc.c -> sparc-nat.c
+ * nat-sun4os4.h -> nm-sun4os4.h
+ * nat-trash.h -> nm-trash.h
+ * config/sun4os4.mh: track file renaming.
+ * configure.in: link to nm.h rather than nat.h.
+ * infptrace.c: include nm.h rather than nat.h.
+
+Tue Sep 29 14:35:00 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Host/target/native split for sun4.
+
+ * Makefile.in (TSOBS): removed corelow.o.
+ * infptrace.c: included nat.h.
+ * nat-trash.h: temporary header file. This should be removed once
+ all hosts have the native/host/target split.
+ * configure.in: add a symlink from nat-trash.h to nat.h if no
+ other nat file exists for this configuration.
+ * sparc-tdep.c: no longer include sys/ptrace.h.
+ * sparc-xdep.c: removed. contents have been moved to nat-sparc.c.
+ * xm-sparc.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to
+ nat-sun4os4.h.
+ * nat-sparc.c, nat-sun4os4.h: new files for sun4 native support.
+ * config/sun4os4.mh (XDEPFILES): moved infptrace.o and inftarg.o
+ to NATDEPFILES. removed sparc-xdep.o.
+ (NATDEPFILES, NAT_FILE): new macros for native support.
+
+ Break the direct connection from core_file_command to any
+ particular type of core file support.
+
+ * target.h (find_core_target): new prototype.
+ * target.c (find_core_target): new function. Walks the target
+ list looking for the core target.
+ * core.c (core_file_command): replace calls to core_detach and
+ core_open with find_core_target and direct calls.
+
+Tue Sep 29 10:19:00 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * xm-hp300hpux.h: define MEM_FNS_DECLARED; include <sys/ptrace.h>
+ for infptrace.c.
+ config/hp300hpux.mh: ALLOCA1 was not defined.
+
+Mon Sep 28 22:03:41 1992 Stu Grossman (grossman at cygnus.com)
+
+ * breakpoint.c, exec.c, language.c, main.c, printcmd.c, symfile.c,
+ target.c, valprint.c: Use unfiltered forms of f/printf, et. al.
+ until we can figure out a better way to do paging.
+
+Sat Sep 26 02:07:31 1992 John Gilmore (gnu@cygnus.com)
+
+ * findvar.c (supply_register): Add CLEAN_UP_REGISTER_VALUE hook.
+ * tm-hppa.h (CLEAN_UP_REGISTER_VALUE): Use it.
+ * hppa-coredep.c: Remove, now that we use the hook.
+ * config/hppab.mh, config/hppah.mh: Use standard coredep.o.
+ * hppab-xdep.c, hppah-xdep.c: Remove custom code, use hook.
+
+ * dbxread.c, partial-stab.h: Replace all #ifdef hp9000s800's with
+ GDB_TARGET_IS_HPPA's. This is a SERIOUS KLUDGE. The code needs to all
+ be ripped out and reimplemented right (see elfread.c).
+ * tm-hppa.h (GDB_TARGET_IS_HPPA): Define.
+
+ Rename all HPPA files to fit into unique DOS filenames:
+ * *hppabsd* => *hppab*
+ * *hppahpux* => *hppah*
+
+Sat Sep 26 00:25:15 1992 John Gilmore (gnu@cygnus.com)
+
+ Make the /proc support a target-struct in its own right.
+
+ * Makefile.in: Remove inftarg.[co], since it is now included via
+ config/*.mh files.
+ * config/*.mh: Add inftarg.o and fork-child.o to all *.mh that
+ reference infptrace.o. Add fork-child.o to all *.mh that
+ reference procfs.o.
+
+ * inferior.h (proc_wait, inferior_proc_init, proc_set_exec_trap):
+ No longer global functions.
+ (fork_inferior): New global function from fork-child.c.
+ * inftarg.c (child_wait): Remove USE_PROC_FS conditional.
+ (ptrace_me, ptrace_him): New stub functions for fork_inferior().
+ (child_create_inferior): Moved to fork-child.c as fork_inferior.
+ (child_create_inferior): New tiny function that calls fork_inferior.
+ * fork-child.c: New file, containing fork_inferior, which is
+ built from slight mods to inftarg.c's child_create_inferior.
+
+ * procfs.c (procfs_ops): Add target vector.
+ (attach): Rename as static do_attach.
+ (procfs_create_inferior): New tiny function that calls fork_inferior.
+ (child_xfer_memory): Rename to static procfs_xfer_memory.
+ (store_inferior_registers): Rename to static procfs_store_registers.
+ (inferior_proc_init): Rename to static procfs_init_inferior.
+ (procfs_attach, procfs_detach, procfs_prepare_to_store,
+ procfs_files_info, procfs_open, procfs_mourn_inferior,
+ procfs_can_run): Slightly mangled copies of the corresponding
+ child_XXX routines from inftarg.c.
+ (proc_wait): Renamed to static procfs_wait.
+ (child_resume): Rename to static procfs_resume.
+ (fetch_inferior_registers): Rename to static procfs_fetch_registers.
+ (initialize_proc_fs): Rename to initialize_procfs. Set up
+ procfs_ops, too.
+
+ * putenv.c: index -> strchr.
+ * regex.c: Always rename bcopy to memcpy, etc.
+ FIXME: Eventually do the renames rather than use #define's.
+ * sparc-tdep.c (deferred_stores): Moved from sparc-xdep.c.
+ Fix bcopy->memcpy.
+ * sparc-xdep.c: Move deferred_stores to target dependent.
+ * xm-irix4.h, xm-sysv4.h (CREATE_INFERIOR_HOOK): No longer needed.
+
+Fri Sep 25 21:59:27 1992 John Gilmore (gnu@cygnus.com)
+
+ Split non-target-dependent code out of target_attach routines.
+
+ * target.h: Comments on target_attach args and results.
+ * infcmd.c (attach_command): Check for existing execution, call
+ target_attach, set up terminal status and wait_for_inferior, wait
+ for the attach status, and do normal_stop.
+ * inftarg.c (child_attach): Remove target independent stuff.
+ * remote-adapt.c (adapt_attach): Ditto.
+ * remote-mm.c (mm_attach): Ditto.
+ * remote-udi.c (udi_attach): Ditto.
+ * remote-vx.c (vx_attach): Ditto.
+
+ Cleanup.
+
+ * remote-hms.c (hms_attach): Remove completely, it was useless.
+ * remote-mm.c, remote-hms.c, remote-udi.c, remote-adapt.c: Remove
+ commented-out start_remote calls.
+ * remote-hms.c, remote-adapt.c, remote-mm.c, remote-udi.c: Remove
+ DENTER and DEXIT macros and their calls. Use a real debugger --
+ like gdb -- to see what functions are being called when.
+ * utils.c (strcmp_iw): Make nonstatic, for lint.
+
+Fri Sep 25 18:48:20 1992 John Gilmore (gnu@cygnus.com)
+
+ * infrun.c, inftarg.c, inferior.h: Comment and lint cleanups.
+
+Fri Sep 25 15:13:44 1992 Stu Grossman (grossman at cygnus.com)
+
+ * tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's
+ fix to differentiate between gcc1 & gcc2 compiled files so that we
+ can debug calls that pass structs as args correctly.
+ * symmisc.c (dump_symtab): If block was compiled with gcc, say
+ so, and what version.
+
+ * remote.c (remote_wait): Make regs be char to avoid picayune
+ ANSI compiler warnings.
+
+ * energize.h: Move all external struct decls to inside of
+ __STDC__, add prototype for energize_shell_wait().
+ * energize.c (getpty): Clean up, make us really get a controlling
+ terminal.
+ * (energize_initialize): Disable SIGIO prior to setting up for
+ I/O interrupts. Move setsid(), et. al. to getpty().
+ * (energize_shell_wait): New routine to wait for things started
+ via the shell command, uses wait() instead of /dev/proc.
+ * Also, add prototype for execute_command_1().
+
+Fri Sep 25 12:09:33 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * inftarg.c (child_create_inferior, child_attach,
+ child_mourn_inferior): collect unix child process stratum
+ functions which live below the target vector into this file to
+ facilitate host/target/native split. Also, make them static.
+ * inflow.c (child_mourn_inferior): removed.
+ * infrun.c (child_create_inferior, child_attach): removed.
+ (resume): becomes global so that functions below the
+ target vector can find it.
+ * inferior.h (resume): add prototype.
+ (child_mourn_inferior, child_create_inferior, child_attach):
+ remove prototypes.
+
+ * xcoffexec.c (exec_ops): child_attach and child_create_inferior
+ replaced with find_default_attach and
+ find_default_create_inferior.
+
+Fri Sep 25 10:21:04 1992 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * i960-pinsn.c: Use _filtered routines for printing, so symbolic
+ addresses don't get displayed in the wrong positions.
+
+Fri Sep 25 09:52:47 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Separate core functions along target vector in preparation for
+ native support. Functions above vector now live in core.c. Those
+ below in corelow.c.
+
+ * core.c (solib_add_stub, core_close, core_open, core_detach,
+ get_core_registers, core_files_info, core_ops): moved to corelow.c
+ (_initialize_core): removed addition of core_ops target.
+ * corelow.c: new file.
+ (solib_add_stub, core_close, core_open, core_detach,
+ get_core_registers, core_files_info, core_ops): moved from core.c
+ (_initialize_corelow): new function.
+ * gdbcore.h (core_open, core_detach): added prototypes.
+ (core_ops): add forward declaration.
+ * Makefile.in (SFILES_MAINDIR): add core.c
+ (OBS): add core.o
+ (TSOBS): change core.o to corelow.o
+
+Wed Sep 23 11:14:53 1992 Stu Grossman (grossman at cygnus.com)
+
+ * m68k-tdep.c (m68k_saved_pc_after_call): Use 'GDB_TARGET_IS_SUN3'
+ instead of 'sun' predefined symbol so that trap analysis code is
+ enabled only when the TARGET is a sun3.
+
+Tue Sep 22 17:13:19 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * tm-i960.h (ext_format_i960): Add top-level declaration.
+ (REGISTER_CONVERT_TO_{VIRTUAL,RAW}): Don't declare it in nested
+ blocks, else Sun4 compiler complains.
+
+Tue Sep 22 00:43:51 1992 John Gilmore (gnu@cygnus.com)
+
+ * mips-pinsn.c (print_insn_arg, case 'B'): Disassemble `break'
+ instruction's argument. Patch from jonathan@cs.stanford.edu
+ (Jonathan Stone).
+
+Mon Sep 21 18:16:30 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Break the thread of control that implies that a unix child
+ process will be the default target.
+
+ * target.c (find_default_run_target, find_default_attach,
+ find_default_create_inferior, return_zero): new functions.
+ (cleanup_target): Make return_zero the default for to_can_run.
+
+ * exec.c (exec_ops), core.c (core_ops): Replace child_attach and
+ child_create_inferior references with find_default_XXX instead.
+
+ * target.h (struct target_ops): new field, to_can_run.
+ (find_default_attach, find_default_create_inferior): new prototypes.
+ (target_can_run): new macro.
+
+ * Also added a zero (default) to_can_run element to all static
+ struct target_ops initializations throughout GDB, except:
+ * inftarg.c (child_ops): Use new child_can_run() to enable child runs.
+
+ * infrun.c (child_create_inferior): Clean up error handling when
+ no exec file is specified.
+ (child_attach): Don't require exec file.
+
+Mon Sep 21 19:43:13 1992 John Gilmore and K. Richard Pixley (gnu@cygnus.com)
+
+ Remove kill_inferior_fast, in favor of target_kill, which goes
+ through the target vector.
+
+ * inferior.h (kill_inferior_fast): remove declaration.
+
+ * main.c (disconnect): call quit_cover using catch_errors rather
+ than calling kill_inferior_fast directly. New way goes through
+ the target vector, handles attached processes, and writes
+ command history if appropriate.
+ (quit_cover): new function, wrapper for quit_command.
+
+ * convex-xdep.c, go32-xdep.c, hppabsd-xdep.c, hppahpux-xdep.c,
+ infptrace.c, procfs.c: Removed all instances of kill_inferior_fast,
+ inlining them into the local kill_inferior when needed.
+
+Mon Sep 21 19:23:05 1992 John Gilmore (gnu@cygnus.com)
+
+ * infrun.c (_initialize_infrun): Alias `i handle' == `i signals'.
+ * stabsread.c (read_struct_type): Simplify complicated expression
+ for dumb DECstation compiler.
+
+Mon Sep 21 14:54:35 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * m68k-pinsn (print_insn_arg, fetch_arg): added support for
+ operands to memory management instructions, from WRS.
+
+Sep 20 08:42:12 1992 Fred Fish (fnf@cygnus.com)
+
+ * main.c (main): Back out previous language setting changes.
+ Replace with simple default to C before processing any init
+ files. There MUST be a language set, even in the absence of
+ init files or executables, or expression parsing fails.
+
+Sat Sep 19 09:52:26 1992 Fred Fish (fnf@cygnus.com)
+
+ * main.c (main): Move code that sets initial language to
+ symfile.c. Fixup places where command files are processed to
+ be consistent in setting a default language if none has been
+ previously set.
+ * symfile.c (set_initial_language): Add code moved from
+ main() that sets an initial default language when a new
+ symbol file is read.
+ * symfile.c (symbol_file_command): Call set_initial_language.
+ * symtab.c (find_main_psymtab): Add FIXME comment.
+
+Wed Sep 16 22:31:55 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * breakpoint.c, sparc-tdep.c: comment changes.
+ * configure.in: removed target_dependent line.
+
+ * remote-mm.c (mm_attach): change printf to error to prevent
+ fallthrough bug.
+ * remote-udi.c (udi_attach): change printf to error to prevent
+ fallthrough bug.
+
+ * rs6000-tdep.c (push_dummy_frame, pop_dummy_frame): replace
+ calls to {fetch|store}_inferior_registers with calls to
+ target_{fetch|store}_registers, for remote-target independence.
+
+Sat Sep 19 04:23:54 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in: Fix bug I introduced in merging Rich's change.
+ * infrun.c (child_create_inferior): Use proceed() rather than
+ doing all the same stuff by hand.
+
+Thu Sep 17 17:35:37 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in, configure.in: add support for files used only when
+ configured native, that is, when host = target.
+
+Wed Sep 16 23:03:23 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * tm-sparc.h, xm-sparc.h: externs and macros relating to deferred
+ stores are target dependent and were moved from xm to tm.
+
+Sat Sep 19 03:14:37 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (gdb-all.texi): Build in objdir, not $srcdir.
+
+ * config/decstation.mh: Add MMALLOC_LIB and MMALLOC_DISABLE
+ overrides, to avoid problem in xdr_bytes with malloc(0) => 0.
+
+Wed Sep 16 20:04:54 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * target.h (struct target_ops): removed to_convert_to_virtual and
+ to_convert_from_virtual elements. Initializations removed from
+ all static initializations.
+ (target_convert_to_virtual, target_convert_from_virtual):
+ removed.
+ (host_convert_to_virtual, host_convert_from_virtual): Removed
+ forward declarations.
+ * target.c (cleanup_target): removed default assignments for
+ to_convert_to_virtual and to_convert_from_virtual.
+ * inftarg.c (host_convert_to_virtual, host_convert_from_virtual):
+ removed.
+ * findvar.c (value_of_register, value_from_register):
+ target_convert_to_virtual inlined.
+ * infcmd.c (do_registers_info): target_convert_to_virtual inlined.
+ * valops.c (value_assign): target_convert_from_virtual inlined.
+
+Fri Sep 18 02:07:39 1992 John Gilmore (gnu@cygnus.com)
+
+ * main.c (gdb_readline): Avoid printf_filtered, which sets char
+ position wrong if used for the prompt.
+ * utils.c (puts_filtered): Comment: NOT a puts() replacement!
+
+ Support for accessing arbitrary MIPS stack frames in memory.
+
+ * blockframe.c (get_prev_frame_info): If INIT_FRAME_PC_FIRST is
+ set, run it before INIT_EXTRA_FRAME_INFO.
+ * stack.c (frame_info): If PRINT_EXTRA_FRAME_INFO defined, call it.
+
+ * mips-tdep.c (init_extra_frame_info): Only clobber the `frame'
+ (FP) value in the frame_info struct if it is zero (as from top of
+ execution stack).
+ (setup_arbitrary_frame): Implement FRAME_SPECIFICATION_DYADIC.
+
+ * mips-xdep.c (fetch_inferior_registers): ZERO_REGNUM always
+ comes back as zero. So does FP_REGNUM, as a trigger for
+ init_extra_frame_info.
+
+ * tm-mips.h (INIT_FRAME_PC_FIRST): Kludge, FIXME, defined to get
+ the program counter set before INIT_EXTRA_FRAME_INFO is run.
+ (INIT_FRAME_PC): Defined to null.
+ (PRINT_EXTRA_FRAME_INFO): print frame pointer location via symtab.
+ (FRAME_SPECIFICATION_DYADIC): Ask for two args in frame command.
+ Briefly explain MIPS stacks in GDB.
+
+Thu Sep 17 03:49:59 1992 John Gilmore (gnu@cygnus.com)
+
+ * copying.awk, copying.c (show_copying_command,
+ show_warranty_command): Rename from copying_info, warranty_info,
+ to match command function conventions.
+
+ * utils.c (prompt_for_continue): Reinitialize more-counts
+ before printing anything, and again afterward. Fix comments.
+ (vfprintf_filtered): Eliminate static buffer; use auto buffer,
+ or alloca() if needed.
+
+ * rs6000-xdep.c: Use correct conditional (IBM6000_TARGET) to
+ detect native versus cross-host.
+
+Wed Sep 16 21:57:14 1992 Stu Grossman (grossman at cygnus.com)
+
+ * m68k-tdep.c (sun3_saved_pc_after_call): Only do trap check for
+ Suns. Rename to m68k_saved_pc_after_call.
+ * tm-68k-noun.h, tm-sun3.h (SAVED_PC_AFTER_CALL): Use
+ m68k_saved... instead of sun3_saved...
+
+Wed Sep 16 17:00:07 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (update-depend, update-alldeps): Split out of
+ setup-to-dist, for convenience in rebuilding the depend and
+ alldeps.mak files.
+ (assorted): Update to catch straggler files when building gdb.tar.Z.
+
+Tue Sep 15 01:18:50 1992 John Gilmore (gnu@cygnus.com)
+
+ Preliminary cleanup for splitting host/native/target.
+
+ * infptrace.c (child_resume): Don't deal with NO_SINGLE_STEP
+ here; it is dealt with at a gdb-target-independent level.
+ * rs6000-tdep.c (single_step): Don't call ptrace, we are a
+ high toned routine. Fix return type to void.
+ * tm-rs6000.h (AIX_BUGGY_PTRACE_CALL): Zap, we think we fixed it.
+ Rich and I believe the "real problem" was that both single_step
+ and target_resume were issuing PT_CONTINUE calls. This would
+ cause the second PT_CONTINUE to sometimes fail because the process
+ was already running.
+ * infptrace.c (child_resume): Remove AIX_BUGGY_PTRACE_CALL kludge.
+
+Mon Sep 14 19:20:43 1992 Stu Grossman (grossman at cygnus.com)
+
+ * energize.c (pty_to_kernel): Must check for EAGAIN as
+ termination condition.
+ (full_filename): Don't prepend dirname if filename begins with /.
+ (breakpoint_notify, kernel_dispatch): Deal with DynamicLoad
+ messages properly!!
+ (getpty (NCR)): Lotsa bug fixes...
+ (kernel_dispatch (case StopRType)): Use kill() instead of
+ killpg() so we can deal with losing systems...
+ (wait_for_events): Work around NCR select() lossage. It doesn't
+ zero out readfds when select() returns zero.
+ (energize_initialize): Use I_SETSIG to get SIGIO interrupts. Use
+ getcwd() instead of getwd() (NCR getwd() seg faults).
+ (energize_wait): Use sigaction() for NCR. Their version of signal()
+ is unreliable by default.
+
+ * procfs.c (proc_wait): Call print_sys_errmsg() if we get an
+ error from PIOCSWSTOP.
+
+ * breakpoint.c, core.c, exec.c, language.c, main.c, printcmd.c,
+ symfile.c, target.c, valprint.c: Use _filtered form of *printf.
+ defs.h, utils.c: Make vfprintf_filtered global.
+
+ * energize.c (send_location): New routine to consolidate all
+ places where we must notify kernel of where the given pc is.
+ (cplus_demangle): Put single-quotes around demangled names.
+ (energize_call_command): Call send_location() after doing up,
+ down, and frame commands.
+
+Fri Sep 11 18:28:28 1992 Roland H. Pesch (pesch@fowanton.cygnus.com)
+
+ * doc/gdb.texinfo, doc/gdbinv-m.m4.in, doc/gdbinv-s.m4.in: first
+ pass at doc for two new remote targets---29K using UDI, and Tandem
+ ST2000 using STDBUG.
+
+ * doc/all.m4, doc/none.m4: new m4 switch, _ST2000__
+
+ * doc/all.m4: turn on H8/300 stuff for generic manual
+
+ * doc/gdbinv-s.m4.in: remove text on special procedures to continue
+ after explicit call to breakpoint() in serial stubs.
+
+Fri Sep 11 01:34:25 1992 John Gilmore (gnu@sphagnum.cygnus.com)
+
+ * mipsread.c: Clean up some white space.
+ (parse_symbol): Handle stEnd of stFile.
+ (parse_partial_symbols): Remove old #if 0'd code. Handle stLocal.
+
+ * mips-xdep.c (REGISTER_PTRACE_ADDR, fetch_inferior_registers,
+ store_inferior_registers): Replace unexplained numbers
+ with manifest constants from a DECstation header file.
+ * xm-mips.h (KERNEL_U_ADDR): Get from <machine/param.h>.
+ (REGISTER_U_ADDR): Fix up for Ultrix 4.2.
+
+ * tm-tahoe.h, xm-tahoe.h (KERNEL_U_ADDR): Move macro to xm-tahoe.h.
+
+ * stack.c (_initialize_stack): "dow" should be a valid abbreviation
+ for "down". Suggested by Richard Stallman.
+
+Thu Sep 10 15:26:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * remote-vx.c: Rename realloc for inclusion of rpc/rpc.h, to avoid
+ redeclaration bug on SunOS 4.
+
+Wed Sep 9 17:36:53 1992 John Gilmore (gnu@cygnus.com)
+
+ * i386-stub.c, sparc-stub.c (getpacket): Actually check checksums.
+ * m68k-stub.c: Remove a few extraneous ANSI-isms.
+ * remote-nindy.c (nindy_prepare_to_store): Only fetch regs if
+ they aren't already there.
+ * remote-vx.c (vx_prepare_to_store): Ditto.
+ * xcoffread.c: Surround forward struct defns with #ifdef __STDC__.
+
+Wed Sep 9 16:50:22 1992 John Gilmore (gnu@cygnus.com)
+
+ Removed a large number of changes inserted by Per Bothner
+ for C++ support. These will go back in when they've been
+ examined.
+
+Tue Sep 8 21:05:18 1992 Stu Grossman (grossman at cygnus.com)
+
+ * serial.h: Fix prototye for serial_raw().
+ * ser-bsd.c, ser-termios.c: Fix args for serial_open() &
+ serial_write() to match prototypes.
+ * remote-st2000.c (get_reg_name): Make *p be const.
+
+Tue Sep 8 17:24:52 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * remote-nindy.c (nindy_fetch_registers): Make return type void,
+ to agree with target structure field type.
+ (nindy_store_registers): Ditto.
+
+ * Makefile (OPCODES): New var, pointing to opcodes library.
+ (CLIBS, CDEPS): Include it.
+ (saber_gdb): Load opcodes library.
+
+Tue Sep 8 15:22:06 1992 Stu Grossman (grossman at cygnus.com)
+
+ * a68v-xdep.c (store_inferior_registers): declare as void.
+ * infptrace.c: HP/Apollos have ptrace.h in the wrong place.
+ * remote-st2000.c: Massive changes to use new serial package.
+ Also added 'connect' command to transparantly connect to serial
+ port.
+ * ser-termios.c: Big cleanup, use nicer coding conventions.
+ * ser-bsd.c: New module, serial stuff for BSD systems.
+ * serial.h: Define struct ttystate properly using HAVE_TERMIO.
+ * xm-apollo68b.h: #define PTRACE_IN_WRONG_PLACE...
+
+Fri Sep 4 18:53:57 1992 Roland H. Pesch (pesch@fowanton.cygnus.com)
+
+ * doc/gdb.texinfo: fix shameful error of agreement reported by
+ jimb@occs.cs.oberlin.edu (Jim Blandy)
+ * doc/gdb.texinfo: remove old partial discussion of remote serial
+ protocol (via serial debug stubs)
+ * doc/gdbinv-m.m4.in, doc/gdbinv-s.m4.in: new section discussing
+ use of serial debug stubs
+
+Fri Sep 4 00:34:30 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * symfile.h: Declaration of set_demangling_style() moved
+ here from demangle.h (which is now in ../include).
+ * i386-xdep.c: Update comment.
+
+Thu Sep 3 13:44:46 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * symtab.c (completion_list_add_symbol): restructured to optimize
+ for time. First clip names that cannot match. Then clip any
+ names we've already considered. Drop a redundant strncpy. Drop
+ a redundant malloc and associated free for demangled names.
+
+Thu Sep 3 09:17:05 1992 Stu Grossman (grossman at cygnus.com)
+
+ * a68v-xdep.c (store_inferior_registers): Define as type void.
+ * configure.in: Add host m68k-apollo*-bsd*.
+ * demangle.c (struct demanglers): Use enum instead of constant
+ value to keep braindamaged HP/Apollo compiler happy.
+
+Wed Sep 2 20:45:31 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * utils.c (strcmp_iw): Add a hack to allow "FOO(ARGS)" to
+ match "FOO". This allows 'break Foo' to work when Foo is
+ a mangled C++ function. (See comment before function.)
+
+Wed Sep 2 13:45:27 1992 John Gilmore (gnu@cygnus.com)
+
+ * config/rs6000.mh (MH_CFLAGS): Circumvent IBM <rpc/rpc.h> bug,
+ for files in vx-share/*.c.
+ * xm-rs6000.h (fd_set): Circumvent the rs6000.mh circumvention,
+ for normal GDB source files.
+
+ * Makefile.in (VERSION): Roll to 4.6.6.
+
+ * tm-vx68.h, tm-es1800.h: Use tm-68k.h rather than tm-sun3.h.
+ * tm-sun3.h: Remove STACK_END_ADDR, no longer used.
+ * tm-sun3os4.h: Update comments.
+ * xm-delta88.h: Remove STACK_END_ADDR.
+
+Wed Sep 2 01:18:31 1992 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): Roll to 4.6.5.
+
+ * infrun.c: Lint for recent `handle' changes.
+
+ * ser-termios.c, ser-go32.c: Remove DEFUN crap, clean up.
+ * serial.h (EXFUN): Remove all uses, convert to PARAMS.
+ * config/sun4os4.mh: Include ser-termios.o. FIXME, all .mh files
+ should include a ser-XXX.o module.
+
+ * dbxread.c (elfstab_build_psymtabs): Remove DEFUN crap.
+ * defs.h, i960-pinsn.c, remote-hms.c: Replace CONST with simple const.
+
+ * configure.in: Map unrecognized sun 68k's, sun sparcs, into
+ known suns in configure.in, rather than mapping them to unique
+ config files that happen to duplicate other config files.
+ * config/sun3.{mh,mt}: Remove (use identical sun3os4.*).
+ * config/sun4.{mh,mt}: Remove (use identical sun4os4.*).
+
+Wed Sep 2 00:10:43 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in (*-*-sunos*): Use trailing * to match all
+ sub-variants of SunOS, e.g. sunos4* to match sunos4.1.1.
+ (sparc-*-sunos3): Remove host & target. Sunos3 never shipped
+ in production on Sun-4.
+ ({a29k,i[34]86,i960}-*-elf): Add targets, equivalent to coff.
+ (m68k-*-{aout,coff,elf}): Add targets, w/new config and tm files.
+ (sparc-*-{aout,coff,elf}): Add targets, w/new config and tm files.
+
+ * config/m68k-un.mt, config/m68k-noun.mt, config/sparc-un.mt,
+ config/sparc-noun.mt: New target configs for embedded.
+ * config/sun4os3.{mh,mt}: Remove, never existed in production.
+
+ * tm-68k-un.h, tm-68k-noun.h, tm-spc-un.h, tm-spc-noun.h: New
+ target definitions for embedded with and without underlines on
+ identifiers.
+
+ * tm-sparc.h, tm-sun2.h, tm-sun3.h: Delete NAMES_HAVE_UNDERSCORE:
+ not a parameter of the CPU, but of the development environment.
+ * tm-es1800.h, tm-sunos.h, tm-vx68.h: Add NAMES_HAVE_UNDERSCORE.
+
+Tue Sep 1 17:31:45 1992 John Gilmore (gnu@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set): Avoid setting source symtab
+ (which involves reading in main's symtab) if we have no breakpoints.
+
+Mon Aug 31 13:47:45 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (cu_language): New local variable to record
+ language for current compilation unit being processed.
+ * dwarfread.c (set_cu_language): New local function to decode
+ and record language for current compilation unit being processed.
+ * dwarfread.c (synthesize_typedef): Add local function to
+ synthesize a typedef for C++ classes, structs, unions, and
+ enumerations.
+ * dwarfread.c (read_structure_scope): Synthesize typedefs
+ for C++ classes, structs and unions.
+ * dwarfread.c (read_enumeration): Synthesize typedefs for
+ C++ enumerations.
+ * dwarfread.c (read_file_scope): Call set_cu_language to
+ record language for current compilation unit. After symtab
+ is built, save this recorded language.
+ * dwarfread.c (process_dies, add_partial_symbol, struct_type,
+ scan_partial_symbols, new_symbol): Recognize TAG_class_type.
+ * dwarfread.c (add_partial_symbol): Synthesize partial symbol
+ typedefs for C++ classes, structs, unions, and enumerations.
+ * dwarfread.c (scan_compilation_units): Call set_cu_language
+ to record language for current compilation unit.
+ * dwarfread.c (scan_partial_symbols): Call add_enum_psymbol here
+ for TAG_enumeration_types, rather than in add_partial_symbol.
+ * dwarfread.c (add_partial_symbol): Combine TAG_enumeration_type
+ case with class, struct, and union type cases, now that they are
+ the same. Remove tests for non-NULL name attributes, now done
+ by callers.
+ * gdbtypes.h (TYPE_CODE_CLASS): Add type for C++ classes, but
+ treat as alias for TYPE_CODE_STRUCT for now.
+
+Sun Aug 30 21:32:17 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: map "gdb" through program_transform_name when
+ installing.
+
+Sun Aug 30 21:18:51 1992 Fred Fish (fnf@cygnus.com)
+
+ * {i386-tdep.c, m68k-tdep.c, mips-tdep.c, sparc-tdep.c}
+ (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset):
+ Use "regi" for local indexing through register numbers, reserving
+ "regno" for the name of a specific register passed as an input
+ parameter. Fix bug propagated through all versions that sometimes
+ used regno as an index when it should have been regi, thus using
+ -1 as an index in some cases.
+
+Sun Aug 30 18:15:17 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * cplus-dem.c, demangle.h: Moved to ../libiberty and ../include,
+ respectively, so same demangler can be used by other programs.
+ * Makefile.in: Remove demangler stuff.
+ * Makefile.in (depend): Pass -I../readline (needed for main.c).
+ * demangle.c (_initialize_demangler): Tell demangler which
+ CPLUS_MARKER to assume.
+
+Fri Aug 28 13:13:33 1992 John Gilmore (gnu@cygnus.com)
+
+ RS/6000 portability changes (for hosting cross-debuggers).
+
+ * breakpoint.c (fixup_breakpoints): Re-kludge to IBM6000_TARGET.
+ * buildsym.c, rs6000-xdep.c, rs6000-tdep.c, tm-rs6000.h,
+ xcoffexec.c, xcoffread.c: Rename aixcoff to xcoff everywhere.
+ * printcmd.c (print_frame_args): Remove an RS/6000 dependency.
+ * stabsread.c (define_symbol): Remove RS/6000 dependencies.
+ * tm-rs6000.h (ATTACH_DETACH): Remove: host-dependent.
+ (PTRACE_ATTACH, PTRACE_DETACH): Remove: host-dep.
+ (NO_SINGLE_STEP): Add, target-dependent.
+ (loadinfotextindex): Lowercase, remove "aix_".
+ * xm-rs6000.h: Add <sys/ptrace.h> for infptrace.c.
+ (NO_SINGLE_STEP): Remove, target-dependent.
+ * xcoffexec.c (vmap_symtab): Cleanup #if 0'd code.
+ * xcoffread.c: Only build file if RS/6000 native GDB.
+ (build_function_symbol): Remove #if 0'd code.
+ * rs6000-tdep.c: Cleanup. Add static fn protos.
+ Use CORE_ADDR for addresses throughout. Make void fns void.
+ (pop_dummy_frame): Add FIXME about bogosity of design here.
+ (rs6000_struct_return_address): Ditto.
+ (frameless_function_invocation, frame_get_cache_fsr,
+ frame_initial_stack_address, xcoff_relocate_symtab,
+ xcoff_init_loadinfo, free_loadinfo, xcoff_add_toc_to_loadinfo,
+ add_text_to_loadinfo, find_toc_address): Move from xdep file.
+ Use CORE_ADDRs. Change identifiers to lowercase.
+
+ * rs6000-xdep.c: Make whole file conditional on native RS/6000,
+ supplying dummy routines if non-native. Add prototype for
+ static exec_one_dummy_insn. Move a mess of functions to
+ rs6000-tdep.c (as above). Remove #if 0'd code.
+
+ * config/rs6000.mh (XDEPFILES): Move xcoffexec.o to target side.
+ (XM_CLIBS): Add -lm to circumvent AIX 3.2 libc ldexp bug.
+ * config/rs6000.mt (TDEPFILES): Adopt xcoffexec.o.
+
+ * gdbtypes.h (TYPE_ALLOC): Parenthesize result to avoid problems
+ for callers.
+
+ * vx-share/README, nindy-share/README: New files describing
+ how these directories' code is shared, and with whom.
+
+Thu Aug 27 20:04:56 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in (target configurations): Reformat into table.
+ Remove unsupp. Amigados host and target. Ditto Mach 386 target.
+
+ * tm-altosgas.h, tm-i386v-g.h: Remove ancient coff encap configs.
+ * config/{altosgas.mt, i386v-g.mt, i386v32-g.mt}: Ditto.
+ * config/{i386sco.mt,i386v32.mt}: Remove; identical to i386v.mt.
+ * config/{go32.mt,i960.mt}: Remove; they only printed error msgs.
+ * config/nindy960.mt: Remove useless MT_CFLAGS setting.
+ * config/i386aout.mt: Use tm-i386v.h, not tm-i386v-g.h.
+
+ * Makefile.in (config-check): Add command to check whether
+ configure.in is consistent with config/*.
+
+Wed Aug 26 21:10:52 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in (host configurations): Reformat nested cases into
+ easy-to-maintain table.
+ (m68k-altos-*, i386v*): We don't care whether coff encap is used.
+ config/{altosgas.mh, i386v-g.mh, i386v32-g.mh}: Remove.
+
+Wed Aug 26 16:02:01 1992 Fred Fish (fnf@cygnus.com)
+
+ * cplus-dem.c: Reorder args to most local functions to make them
+ follow the consistent pattern of struct work_stuff pointer first,
+ followed by pointer into string being demangled, followed by
+ pointer to the string where the result is being stored, followed
+ by other args. Also generally replace most variables of name
+ "type" with "mangled" for consistency. They all pointed to the
+ same string but half were one name and half the other.
+ * cplus-dem.c (LONGERNAMES): Remove #ifndef's.
+ * cplus-dem.c (demangle_qualified): Rewrite to clean up and allow
+ use whenever a qualified name is being demangled.
+ * cplus-dem.c (do_type): Qualified names are treated similarly
+ to fundamental types, not as modifiers of fundamental types.
+
+Mon Aug 24 20:44:38 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Add sparclite as a target.
+
+ * sparc-stub.c (handle_exception): Flush instruction cache just
+ before returning to the user. (hexToInt): Fix overzealous cleanup.
+
+Mon Aug 24 11:57:13 1992 Fred Fish (fnf@cygnus.com)
+
+ * infrun.c (handle_command): Rewrite to allow multiple signal
+ numbers, signal number ranges, and to recognize "all" to mean all
+ signals except those used by the debugger.
+ * infrun.c (SET_SIGS, UNSET_SIGS): Macros used in handle_command
+ to set or reset actions for specific signals.
+
+Sun Aug 23 17:10:07 1992 Fred Fish (fnf@cygnus.com)
+
+ * coffread.c (decode_type): Call alloc_type to alloc new
+ types.
+ * stabsread.c (read_array_type, read_range_type, define_symbol):
+ Call alloc_type to alloc new types.
+ * stabsread.c (define_symbol): Move dbl_valu symbol field data
+ from type_obstack to symbol_obstack.
+ * stabsread.c (define_symbol): Move typedef_sym from type_obstack
+ to symbol_obstack.
+ * gdbtypes.h (TYPE_ALLOC): New macro to allocate space for data
+ associated with a type, using the same mechanism as was used to
+ allocate space for the type structure itself.
+ * coffread.c (patch_type, coff_read_struct_type,
+ coff_read_enum_type): Use TYPE_ALLOC.
+ * dwarfread.c (struct_type): Use TYPE_ALLOC.
+ * gdbtypes.c (create_array_type, check_stub_method,
+ allocate_cplus_struct_type): Use TYPE_ALLOC.
+ * mipsread.c (parse_symbol, parse_type): Use TYPE_ALLOC.
+ * stabsread.c (read_struct_type, read_array_type, read_enum_type,
+ read_range_type): Use TYPE_ALLOC.
+
+Sun Aug 23 11:04:08 1992 Fred Fish (fnf@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set): Select a default source
+ symtab if one is not currently selected.
+ * utils.c (query): Call wrap_here before building the output
+ query string, to turn off wrapping and flush any buffered output.
+ Otherwise our query may end up in the wrap buffer and never be
+ seen by the user.
+ * eval.c (evaluate_subexp): Report error when attempting to
+ evaluate subscript for types without a target type, rather
+ than dumping core by using the NULL pointer.
+ * symfile.c (symbol_file_command): Forget current_source_symtab
+ and current_source_line when discarding symbol table.
+
+Sat Aug 22 22:33:20 1992 John Gilmore (gnu@cygnus.com)
+
+ Bug fixes from Andrew Heybey <ath@lcs.mit.edu>.
+
+ * tm-mips.h (REGISTER_VIRTUAL_TYPE): Float regs are float type.
+ * mips-tdep.c (mips_print_register): Alloc enough space for two regs.
+
+Fri Aug 21 15:17:03 1992 Stu Grossman (grossman at cygnus.com)
+
+ * remote.c (remote_open): Fix baud rate setting to make -b flag
+ work. (remote_wait): Change 'T' message parser to deal with new
+ improved format which allows stub to send an arbitrary bunch of
+ registers.
+ * sparc-stub.c: General cleanups. (trap_low, handle_exception):
+ make all this re-entrant by storing all state on the stack. Clean
+ up memory error trapping. (computeSignal, set_debug_traps):
+ make it all table driven. Make a start at a baud rate setting command.
+
+Wed Aug 19 10:23:27 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * m68k-pinsn.c: handle new operand type 'r', introduced for cas2.
+
+ * remote-vx.c: redefine malloc to avoid buggy declaration on
+ RS/6000 <rpc/types.h>.
+ xm-rs6000.h: include <sys/select.h> to define fd_set for
+ <rpc/svc.h> on RS/6000.
+
+Tue Aug 18 14:48:24 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added FLAGS_TO_PASS variable, and passed it to
+ recursive invocations of make. Always create installation
+ directories.
+
+Mon Aug 17 18:29:58 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * m68k-pinsn.c: Minor fix in style of output (don't use
+ range to indicate floating point control registers).
+
+Sat Aug 15 02:58:03 1992 John Gilmore (gnu@cygnus.com)
+
+ * m68k-pinsn.c: Surround extended support with #ifdef HAVE_68881.
+
+ * infcmd.c (registers_info): Handle multiple register names.
+ Changes inspired by Roland McGrath.
+
+Sat Aug 15 02:28:52 1992 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-stub.c: New file. Mix it with your SPARClite
+ application, and it will speak GDB remote protocol!
+ * remote.c (remote_wait): Change 'T' (expedited reply) message to
+ deal with arbitrary registers. Needed for sparc-stub.
+
+Fri Aug 14 12:11:25 1992 Fred Fish (fnf@cygnus.com)
+
+ * cplus-dem.c (cplus_markers): Add table for gnu style and
+ use throughout, in place of compile time constant CPLUS_MARKER.
+ * cplus-dem.c (ARM_VTABLE_STRING, ARM_VTABLE_STRLEN): Add.
+ * cplus-dem.c (cfront_special): New function, as suggested
+ by pfieland@stratus.com.
+ * cplus-dem.c (forget_types): New function.
+ * cplus-dem.c (cplus_demangle): Call gnu_special, moved from
+ demangle_prefix().
+ * cplus-dem.c (mop_up): Call forget_types().
+ * cplus-dem.c (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING):
+ Use throughout, instead of checking current_demangling_style.
+ * cplus-dem.c (demangle_signature): When finding an explicit
+ start of function args, forget all remembered types for
+ lucid/cfront style demangling.
+ * cplus-dem.c (demangle_prefix): In a sequence of two or more
+ underbar characters, use last pair as the delimiter. Hoist
+ gnu_special() call up to cplus_demangle(). Call cfront_special()
+ when appropriate.
+ * cplus-dem.c (cplus_special): Fix virtual table name demangling
+ for inherited classes.
+ * cplus-dem.c (demangle_args): Document quirks of numbered
+ references to previously seen types.
+ * dbxread.c (read_ofile_symtab, process_one_symbol):
+ Use AUTO_DEMANGLING rather than explicitly checking
+ current_demangling_style.
+ * demangle.h: Add some comments.
+ * demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING,
+ CFRONT_DEMANGLING): New macros.
+ * dwarfread.c (LCC_PRODUCER): Remove trailing space, which is
+ not found in the actual producer string produced by lcc.
+ * dwarfread.c (handle_producer): Use AUTO_DEMANGLING rather
+ than explicitly checking current_demangling_style.
+
+Thu Aug 13 11:54:46 1992 John Gilmore (gnu at cygnus.com)
+
+ * breakpoint.c (enable_longjmp_breakpoint,
+ disable_longjmp_breakpoint, set_longjmp_resume_breakpoint):
+ Check for duplicate breakpoints at the same address. Bug report
+ and preliminary fix from Dave Morrison, <drmorris@us.oracle.com>.
+
+Wed Aug 12 11:14:58 1992 Fred Fish (fnf@cygnus.com)
+
+ * buildsym.c (end_symtab): Document that end_symtab can return
+ NULL under non-error conditions.
+ * dwarfread.c (read_file_scope): Guard against dereferencing NULL
+ returned from end_symtab for empty compilation units.
+
+Tue Aug 11 02:49:39 1992 John Gilmore (gnu at cygnus.com)
+
+ * am29k-tdep.c: Lint from DECstation compiler.
+ * mem-break.c: Restore test of BREAKPOINT size that Fred removed.
+ As the man page says, "Sometimes you just can't get lint to shut
+ up". That doesn't mean you should blow away the code it won't
+ shut up about.
+ * mips-xdep.c: Revise stubbing-out of code until Rich cleans
+ it up over the next few weeks. Make mips x 29k build.
+ * tm-29k.h (CALL_DUMMY): Make it work on cross-endian hosts.
+ (FIX_CALL_DUMMY): Comment in the patching of the breakpoint,
+ but leave it as a comment because the breakpoint instruction
+ is not easily accessible at this moment (it's static, and if
+ we define one here, it goes into every file compiled).
+
+Mon Aug 10 22:27:19 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.6.3.
+ * dwarfread.c (scan_partial_symbols): Skip over DIE's within
+ function scopes when building partial symbol tables.
+ * objfiles.c (open_existing_mapped_file): Make it clear in
+ warning message that out of date mapped files are ignored.
+ * symtab.c (lookup_symtab_1, lookup_symbol): Print compilation
+ unit source file name in error message.
+
+Sat Aug 8 23:12:22 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (struct dieinfo): Add has_at_byte_size.
+ * dwarfread.c (struct_type): In absence of AT_byte_size for
+ bitfield, use size of object of member's type for the size of
+ the anonymous object containing the bit field.
+ * dwarfread.c (completedieinfo): Set has_at_byte_size when
+ an AT_byte_size attribute is seen.
+ * mipsread.c (psymtab_to_symtab_1): Fix misspelled cast to
+ union aux_ext (was aux_ent).
+ * i386-pinsn.c (print_insn): Cast 2'nd arg to read_memory from
+ unsigned char* to char*, for Lucid compiler.
+ * i386-tdep.c (codestream_fill): Fix cast of 2'nd arg to read_memory
+ to be correct type (from unsigned char* to char*).
+ * valprint.c (type_print_derivation_info): Minor tweak to placement
+ of commas in derived class printing.
+ * xcoffread.c (builtin_type): Fix misspelling in fatal message.
+
+Fri Aug 7 11:18:23 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * xm-go32.h: Define LSEEK_NOT_LINEAR
+ * source.c (find_source_lines): if LSEEK_NOT_LINEAR is defined
+ then work out the lseek positions of newlines by running through
+ the file and `tell'ing. This makes source file listing work on
+ OS's where the relationship between physical position in file and
+ canonical position is indeterminate, eg VMS and DOS.
+
+Thu Aug 6 10:56:01 1992 Fred Fish (fnf@cygnus.com)
+
+ * stabsread.c: Ensure that all members of all allocated structures
+ are initialized to known state to avoid hard to find bugs with gdb
+ using fields containing random data.
+ * buildsym.c (start_subfile): Compact dirname initialization.
+ * buildsym.c (patch_subfile_names): New function.
+ * buildsym.c (end_symtab): Make copy of dirname on symbol obstack.
+ * buildsym.c (end_symtab): Free all malloc'd subfile fields.
+ * buildsym.h (patch_subfile_names): Add prototype.
+ * dbxread.c (process_one_symbol): Call patch_subfile_names.
+
+Wed Aug 5 01:42:40 1992 John Gilmore (gnu at cygnus.com)
+
+ * remote-udi.c: Update comments.
+
+ * remote.c (getpkt): Only force retransmission ten times;
+ after that, assume bug in target code, and handle pkt anyway.
+
+Mon Aug 3 17:06:20 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Add support for apollo 68k under BSD environment.
+ * xm-apollo68b.h: New file to support above.
+
+Mon Aug 3 00:25:56 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Recognize i486 host cpu.
+ * valprint.c (type_print_derivation_info): Print derivation info
+ in same form as class declarations in source.
+ * valprint.c (type_print_varspec_suffix): Split arg printing
+ code out to type_print_args function.
+
+Sat Aug 1 13:32:58 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (struct dieinfo): Remove obsolete at_visibility,
+ at_import, at_frame_base.
+ * dwarfread.c (completedieinfo): Remove cases for obsolete
+ AT_visibility, AT_import, and AT_frame_base attributes.
+ * breakpoint.h (BREAKPOINT_MAX): Increase from 10 to 16 for
+ i860, which can keep up to 4 shadow breakpoints.
+ * tm-stratus.h (USG): Define.
+ * tm-stratus.h (TARGET_BYTE_ORDER): Define to BIG_ENDIAN.
+ * xm-stratus.h (HOST_BYTE_ORDER): Define to BIG_ENDIAN.
+ * xm-stratus.h (xm-sysv4.h): Include, name changed from xm-svr4.h.
+ * xm-stratus.h (NO_JOB_CONTROL): Remove define.
+ * config/stratus.mt (TDEPFILES): Include files available from
+ stratus that are not yet in release pending receipt of paperwork
+ at FSF.
+ * buildsym.c (finish_block): Minor code format change.
+ * gdbtypes.h (struct field): Add to comments.
+ * gdbtypes.h (virtual_field_bits): Add to comments.
+ * objfiles.c (allocate_objfile): Change obstack interface to
+ match FSF merging efforts.
+
+Mon Jul 27 21:14:44 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.6.2.
+ * Makefile.in (SFILES_MAINDIR): Add stabsread.c
+ * Makefile.in (OBS): Add stabsread.o
+ * Makefile.in (stabsread.o): Add build rule.
+ * stabsread.c, stabsread.h: New files.
+ * buildsym.c: Split out stabs specific support to stabsread.c.
+ * buildsym.h: Split out stabs specific support to stabsread.h.
+ * dbxread.c (stabsread.h): Include
+ * dbxread.c (dbx_new_init): Call stabsread_new_init.
+ * dbxread.c (dbx_psymtab_to_symtab_1): Call stabsread_init.
+ * dbxread.c (read_ofile_symtab): Call end_stabs.
+ * dbxread.c (process_one_symbol): Call end_stabs and start_stabs.
+ * dbxread.c (elfstab_build_psymtabs): Call stabsread_new_init.
+ * dwarfread.c (psymtab_to_symtab_1): Call buildsym_init, add
+ really_free_pendings to cleanups.
+ * elfread.c (elf_new_init): Call stabsread_new_init.
+ * gdbtypes.c: Small changes to maintenance commands.
+ * mipsread.c (stabsread.h): Include.
+ * mipsread.c (psymtab_to_symtab_1): Call end_stabs.
+ * xcoffread.c (stabsread.h): Include.
+ * xcoffread.c (global_stabs): Remove redundant def.
+ * xcoffread.c (read_xcoff_symtab): Call start_stabs and end_stabs.
+
+Wed Jul 22 21:39:33 1992 Fred Fish (fnf@cygnus.com)
+
+ * lmode_inferior_valid, lmode_ours_valid: New static vars.
+ * inflow.c (terminal_init_inferior, terminal_inferior,
+ terminal_ours_1, initialize_inflow): Record and use state
+ of lmode_inferior_valid and lmode_ours_valid.
+
+Wed Jul 22 04:23:03 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * es1800.c: use FREAD|FWRITE rather than _FREAD|_FWRITE.
+ include <sgtty.h> on USG. (from sef).
+
+ * depend: es1800 dependency needed here.
+
+Mon Jul 20 21:09:53 1992 Fred Fish (fnf@cygnus.com)
+
+ * buildsym.c (read_struct_type): Initialize structs allocated
+ with alloca, to avoid using random values from stack later on.
+ * defs.h (fprintf_filtered): Add prototype.
+ * gdbtypes.c (check_stub_method): Fix misleading comments.
+ * gdbtypes.c (print_arg_types, dump_fn_fieldlists): New maint
+ support functions.
+ * gdbtypes.c (print_cplus_stuff, recursive_dump_type): Many
+ small changes to maint support functions.
+ * gdbtypes.h (cplus_struct_type): Reorganize member ordering
+ for some fields and expand comments.
+ * objfiles.c (allocate_objfile): Use new obstack_alloc_arg
+ macro and track change to obstack_full_begin macro.
+ * utils.c (fprintfi_filtered): New function.
+ * valprint.c (type_print_base): Fixup field printing to not
+ print extraneous lines and not print bogus "no data fields"
+ messages for C++ classes with no data members. Also use new
+ fprintfi_filtered function.
+
+Mon Jul 20 11:25:18 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * configure.in: es1800 ok for 68000 too.
+
+Sat Jul 18 15:48:58 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: echo error messages to stderr, not stdout
+
+Fri Jul 17 17:07:24 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: recognize hppa* instead of hppa
+
+Fri Jul 17 16:52:04 1992 Stu Grossman (grossman at cygnus.com)
+
+ * energize.c: Second cut at DynamicLoad message handling.
+
+ * energize.c: Relativize pathnames in #include statements.
+ * (kernel_dispatch): Better error messages for unknown protocol
+ messages.
+ * (kernel_dispatch): First cut at DynamicLoad message handling.
+
+ * Makefile.in: Remove -I../readline from all compilations,
+ include a special case for main.o instead.
+
+Fri Jul 17 10:14:56 1992 Fred Fish (fnf@cygnus.com)
+
+ * eval.c (evaluate_subexp): Ask lookup_struct_elt_type to call
+ error if it fails to find a member type, rather than return NULL
+ and trigger a coredump.
+ * symtab.c (lookup_symbol, lookup_demangled_block_symbol,
+ lookup_demangled_partial_symbol,): Ask demangle_and_match to
+ match on complete demanglings, including argument lists for member
+ functions, rather than just accepting the first demangling that
+ matches the class and function name.
+ * dwarfread.c (read_file_scope): Pass contents of AT_comp_dir
+ to start_symtab as the directory name.
+ * dwarfread.c (completedieinfo): Strip off any leading hostname
+ portion of the AT_comp_dir attribute string. Gdb doesn't know
+ what to do with them (FIXME).
+
+Thu Jul 16 13:37:09 1992 Stu Grossman (grossman at cygnus.com)
+
+ * breakpoint.c (commands_command): Simplify code a bit, remove
+ unnecessary fflush().
+
+ * Makefile.in (OTHERS): Add gcc.patch.
+ * partial-stab.h (N_SO): Fix handling of redundant SOs (again...)
+
+Thu Jul 16 12:07:40 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (LCC_PRODUCER): Change to match current NCR
+ lcc producer string.
+
+Thu Jul 16 11:40:55 1992 Stu Grossman (grossman at cygnus.com)
+
+ * WHATS.NEW renamed to NEWS.
+
+Wed Jul 15 11:37:31 1992 Fred Fish (fnf@cygnus.com)
+
+ * dbxread.c, dwarfread.c: Re-enable experimental code to
+ automatically select demangling style.
+ * demangle.c (DEFAULT_DEMANGLING_STYLE): Rename from simply
+ DEMANGLING_STYLE, to make more descriptive. Revert back to
+ "auto" as default. Comment use.
+ * Makefile.in (DEMANGLING_STYLE, DEMANGLE_OPTS): Remove.
+ * Makefile.in (${DEMANGLER}.o) Remove target and special
+ compilation rule.
+
+Tue Jul 14 23:05:14 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.6.1 (post-release versions).
+
+Tue Jul 14 19:26:54 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in, demangle.c: Change default demangling style to
+ gnu.
+ * Makefile.in: Update version to 4.6 !!!
+ * README, WHATS.NEW: Update for 4.6.
+
+Tue Jul 14 16:59:46 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * i960-tdep.c (frame_args_address): If arg pointer can't be found,
+ use frame address.
+
+ * buildsym.c (read_struct_type): Don't die on TYPE_CODE_UNDEF
+ nodes as base classes.
+
+Tue Jul 14 00:12:30 1992 Stu Grossman (grossman at cygnus.com)
+
+ * alldeps.mak, depend: Update.
+
+ * xcoffread.c: Add decl for section_offset to keep prototype happy.
+
+ * Makefile.in (VERSION): 4.5.9.
+
+ * xm-hp300bsd.h: Add decl for strdup().
+ * mips-tdep.c (heuristic_proc_desc): Fill in proc start addr in
+ PDR. Cleanup a few things, fix compilation warnings.
+
+Mon Jul 13 19:06:54 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (DEMANGLING_STYLE): New define to set default
+ demangling style for C++. Defaults to "auto".
+ * Makefile.in (DEMANGLE_OPTS): Use DEMANGLING_STYLE.
+ * Makefile.in (SFILES_MAINDIR): Add demangle.c
+ * Makefile.in (OBS): Add demangle.o
+ * cplus-dem.c (GNU_DEMANGLING, ARM_DEMANGLING, LUCID_DEMANGLING):
+ Remove compile time decisions about demangling style and replace
+ with runtime decisions using current_demangling_style.
+ * cplus-dem.c (main): Expand code included during building of
+ standalone demangler to recognize demangling style options.
+ * dbxread.c (demangle.h): Include.
+ * dbxread.c (read_ofile_symtab, process_one_symbol): Set GNU C++
+ demangling style if processing g++ code and current demangling style
+ is auto (Note: this feature currently disabled.)
+ * demangle.c: New file, generic demangling control.
+ * demangle.h (demangling_styles): New enumeration to select one
+ of several demangling styles. Also define string names for each
+ style.
+ * demangle.h (set_demangling_style): Add prototype.
+ * dwarfread.c (demangle.h): Include.
+ * dwarfread.c (GPLUS_PRODUCER, LCC_PRODUCER, CFRONT_PRODUCER):
+ New producer string prefixes to recognize.
+ * dwarfread.c (handle_producer): Consolidate actions for specific
+ producers. Set demangling style based on producer string if
+ current style is auto. (Note: this feature currently disabled.)
+ * config/ncr3000.mt (DEMANGLE_OPTS): Remove.
+
+Sat Jul 11 18:23:58 1992 John Gilmore (gnu at cygnus.com)
+
+ * config/sun4sol2.mh: Remove -xs flag, default INSTALL to cp.
+
+Fri Jul 10 13:58:34 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * gdbtypes.c, gdbtypes.h: New function lookup_signed_typename.
+ * c-exp.y: Call lookup_signed_typename() after seeing
+ "signed". This handles "signed char" correctly.
+ * c-exp.y: Recognize (but ignore) 'const' and 'volatile'
+ keywords before a type specifier.
+
+Fri Jul 10 10:19:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * command.c (lookup_cmd_1): Clarify descriptive comments.
+ * gdbcmd.h (maintenanceprintlist): Add declaration.
+ * main.c (maintenanceprintlist): Add definition.
+ * main.c (gdb_completer_command_word_break_characters): Add.
+ * main.c (symbol_completion_function): Switch completer word
+ break character sets dynamically, based on whether completion is
+ being done on commands or on something else.
+ * main.c (initialize_cmd_lists): Init maintenanceprintlist.
+ * maint.c: Include demangle.h.
+ * maint.c (maintenance_demangle): New function.
+ * maint.c (maintenance_print_command): New function.
+ * maint.c (_initialize_maint_cmds): Reorganize some commands
+ under new maintenance print subcommand.
+
+Thu Jul 9 19:05:27 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * gdbtypes.c (lookup_struct_elt_type): If the input type is
+ TYPE_CODE_PTR or TYPE_CODE_REF, dereference it to get the
+ target type. Otherwise, 'whatis this.field' wouldn't work,
+ which would be inconsistent, since 'print this.field' works.
+ * buildsym.c (read_struct_type, read_enum_type): Clear
+ TYPE_FLAG_STUB flag.
+ * buildsym.c (cleanup_undefined_types): Don't rely on a
+ flawed "Reasonable test to see if" a type has been defined
+ since it was referred to; now we can just see if the
+ TYPE_FLAG_STUB flag has been cleared.
+ * valprint.c (print_type_base): Emit public/protected/private
+ labels for methods as well as fields. Also, indent these labels
+ 2 spaces instead of 4, for a more conventional "look".
+ * symtab.c (gdb_mangle_name): Undo Fred's change, unless
+ GCC_MANGLE_BUG is defined. Also, handle destructors specially.
+ * gcc.patch: New file. Contains patch for gcc (so people
+ with gdb-2.2.x won't have to wait for a new gcc release).
+
+Thu Jul 9 18:44:26 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * i960-pinsn.c (mem): Variables reg[123] should point to CONST.
+ (print_addr): Call print_address to show symbolic version as well.
+
+ * remote-vx.c (vx_kill): Don't look for arguments; they aren't
+ being passed.
+ (vx_read_register): Declare inferior_fp_regs. Delete code for
+ copying "inferior_registers" around; the values are already in var
+ "registers". Use correct size for register set.
+
+ * remote-vx.c (vx_write_register): Don't try writing FP regs; the
+ target doesn't support it.
+ (vx_read_register): Don't try reading them either.
+
+ * tm-i960.h (IP_REGNUM): Move to end of non-FP list, since the
+ VxWorks back end reads them in one contiguous set except for this
+ one.
+ (register_names): Change "pc" to "pcw" to avoid confusion printing
+ "$pc".
+ * tm-vx960.h (PC_REGNUM): Use RIP_REGNUM, since that's where we
+ find the PC under VxWorks.
+
+Wed Jul 8 21:34:30 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (alloc_utype, decode_subscr_data): Call alloc_type
+ to create new blank types, instead of handcrafting them.
+ * defs.h (printfi_filtered): Add prototype.
+ * utils.c (printfi_filtered): New function.
+ * gdbtypes.c (recursive_dump_type): Use printfi_filtered to
+ to simplify the code. Other cleanups.
+ * gdbtypes.c (check_stub_method): Demangle using DMGL_ANSI.
+ * gdbtypes.h (struct cplus_struct_type): Add comments describing
+ use of various fields.
+ * gdbtypes.c (print_bit_vector, print_cplus_stuff): New functions.
+ * c-exp.y (%token): Add CLASS as a token for C++, add grammar
+ production that currently treats it exactly the same as STRUCT.
+ * c-exp.y (yylex): Recognize "class" as token CLASS.
+ * symtab.c (gdb_mangle_name): Rewrite to match current g++ stabs.
+ * symtab.c (decode_line_1): Fix to pass quoted args on down to
+ general symbol handling code. Call cplus_mangle_opname with
+ DMGL_ANSI.
+ * symtab.c (decode_line_2): Print demangled function names in
+ breakpoint menus, instead of just file and line number.
+ * symtab.c (name_match): Call cplus_demangle with DMGL_ANSI.
+ * valprint.c (type_print_base): Print "class" for C++ classes,
+ rather than "struct". Print section labels for public, protected
+ and private members of C++ classes.
+ * values.c: Include demangle.h.
+ * values.c (value_headof): Call cplus_demangle with DMGL_ANSI.
+
+Wed Jul 8 17:23:07 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (VERSION): Update to 4.5.8.
+
+ Wed Jul 8 00:11:02 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (dbx_symfile_init): Init stab_section_info to NULL to
+ prevent crashes when examining cross-targets.
+ * dbxread.c (process_one_symbol): Include directory name when
+ calling start_subfile for SOL & BINCL symbols. This allows gdb to
+ find include files, and yacc/lex sources when the cwd doesn't match
+ that in which the object was compiled.
+ * objfiles.h (ALL_MSYMBOLS): Don't seg fault when there are no
+ msymbols.
+ * symtab.c (lookup_symtab_1): Rewrite. It now handles include
+ files.
+
+Tue Jul 7 09:00:42 1992 Fred Fish (fnf@cygnus.com)
+
+ * maint.c (maintenance_command, maintenance_info_command):
+ Install with allow_unknown as 0 and call help_list to show
+ list of possibilities when no subcommand is specified.
+
+Tue Jul 7 00:20:29 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Add m68k-ericsson-*.
+ * remote-es1800.c, tm-es1800.h, config/es1800.mt: New files.
+
+Sun Jul 5 17:17:16 1992 Fred Fish (fnf@cygnus.com)
+
+ * maint.c: New file.
+ * Makefile.in (SFILES_MAINDIR): Add new file maint.c.
+ * Makefile.in (OBS): Add new file maint.o.
+ * defs.h (command_class): Add class_maintenance.
+ * defs.h (MAINTENANCE_CMDS): Default to including maintenance
+ commands. Allow for them (and other nonessential parts of gdb)
+ to be selectively left out under special circumstances.
+ * gdbtypes.c (recursive_dump_type): New function; supports
+ maintenance print-type command.
+ * gdbtypes.h (recursive_dump_type, maintenance_print_type):
+ Add prototypes.
+ * main.c (maintenancelist, maintenanceinfolist): Add maintenance
+ command lists.
+ * main.c (initialize_cmd_lists): Eliminate unnecessary casts on
+ initializers. Add initializations for setprintlist, showprintlist,
+ setchecklist, showchecklist, maintenancelist, and maintenanceinfolist.
+ * printcmd.c (maintenance_print_type): New maintenance cmd.
+ * valprint.c (setprintlist, showprintlist): Move to main.c, as
+ implied by comment that all cmd lists are owned by main.c.
+ * infcmd.c (unsetlist): Move to main.c, as implied by comment
+ that all cmd lists are owned by main.c.
+ * language.c (setchecklist, showchecklist): Move to main.c, as
+ implied by comment that all cmd lists are owned by main.c
+ * breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist,
+ deletelist): Remove redundant declarations (also in gdbcmd.h).
+ * symmisc.c (printsyms_command): Now maintenance_print_symbols.
+ * symmisc.c (printmsyms_command): Now maintenance_print_msymbols.
+ * symmisc.c (printpsyms_command): Now maintenance_print_psymbols.
+ * symmisc.c (printobjfiles_command): Now maintenance_print_objfiles.
+ * symtab.h (maintenance_print_symbols, maintenance_print_psymbols,
+ maintenance_print_msymbols, maintenance_print_objfiles):
+ Add prototypes.
+ * symmisc.c (printsyms_command, printpsyms_command,
+ printmsyms_command, printobjfiles_command): Removed from
+ _initialize_symmisc.
+ * main.c (dump_me_command): Moved to maint.c and renamed to
+ maintenance_dump_me.
+ * breakpoint.c (all_breakpoints_info): Rename to
+ maintenance_info_breakpoints.
+ * breakpoint.c (_initialize_breakpoint): Convert add_info of
+ all_breakpoints_info to add maintenance_info_breakpoints to the
+ maintenanceinfolist instead.
+ main.c (initialize_main): Set up maintenance class commands.
+
+Sun Jul 5 11:03:53 1992 Stu Grossman (grossman at cygnus.com)
+
+ * energize-patches: Fix minor problems with building energize lib.
+
+ * energize-patches: Change names of all cadillac procedure calls
+ to be energize procedure calls. Simplify many hooks by moving
+ tests energize.c. Configure energize, and build it automatically now.
+
+Sun Jul 5 09:43:28 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.5.7.
+ * cplus-dem.c (demangle_args): Validate index for previously
+ seen type to guard against bogus values from malformed manglings.
+ * valops.c (value_struct_elt_for_reference): Guard against
+ blindly using NULL return value from lookup_symbol.
+
+Sun Jul 5 09:46:43 1992 Stu Grossman (grossman at cygnus.com)
+
+ * cadillac.c, cadillac-patches: Rename to energize.c and
+ energize-patches. Change all routines and variables named
+ 'cadillac*' to 'energize*'. Create new file called energize.h to
+ hold all interface declarations.
+
+ * deblib/connection/*: Move all of this stuff into energize/, but
+ delete unneeded files.
+
+Sun Jul 5 03:06:39 1992 John Gilmore (gnu at cygnus.com)
+
+ * tm-sysv4.h (NAMES_HAVE_UNDERSCORE): SVR4 systems don't.
+
+ * buildsym.c (finish_block): Fix thinko `inner block' complaints.
+ * dbxread.c (process_one_symbol): Parse N_OPT "gcc2_compiled.".
+ * procfs.c (proc_set_exec_trap): Set run-on-last-close flag on
+ child processes, to avoid dead ones "hanging around" after GDB exits.
+ (attach): Always stop the process if it needs it. Set RLC flag
+ when attaching running processes, so it will continue if we detach
+ it, quit, or are killed.
+ (detach): Clear faults and set RLC flag to make process run
+ when we close it.
+ (open_proc_file): New `mode' argument for O_RDONLY or O_RDWR.
+ Callers changed.
+ (info_proc): Open process O_RDONLY, so we can see any process,
+ even those controlled by debuggers.
+ * tm-sun4sol2.h (SUN_FIXED_LBRAC_BUG): They did (in Sol 2).
+
+Sat Jul 4 03:43:38 1992 John Gilmore (gnu at cygnus.com)
+
+ Relocate symbols using an array of section_offsets, rather than a
+ single `addr' or `offset'. This makes Solaris-2 support work, and
+ permits better VxWorks (and maybe xcoff) support later.
+
+ * symtab.h (struct section_offsets): New structure for keeping
+ a set of offsets, rather than a single one.
+ (struct objfile): Replace addr with section_offsets member.
+ * symfile.h: Add sym_offsets to struct sym_fns. Conforming changes.
+ * gdb-stabs.h: New include file with `symbol type specific'
+ parameters for psymtabs and objfiles.
+ * Makefile.in (HFILES): Add gdb-stabs.h.
+ * buildsym.h (start_psymtab, process_one_symbol): Fix prototypes.
+ * coffread.c: Conforming changes. Fake offset array always 0.
+ * dbxread.c: Conforming changes.
+ (struct dbx_symfile_info): Move to gdb-stabs.h.
+ (start_psymtab): Call elfstab_offset_sections to calculate good
+ offsets for this source file, based on the ELF symbol table info.
+ (read_ofile_symtab): Yank N_CATCH, which is dead.
+ (process_one_symbol, N_CATCH): Yank.
+ (", N_FUN, N_FNAME, N_FN, N_FN_SEQ, N_SO, N_SOL, N_ENTRY):
+ Relocate with SECT_OFF_TEXT.
+ (", N_STSYM, N_LCSYM, N_ROSYM): Grope around in the stab string
+ to distinguish relocatable from absolute symbols. Then, if not
+ absolute, do:
+ (", N_STSYM, N_DSLINE): SECT_OFF_DATA.
+ (", N_LCSYM, N_BSLINE): SECT_OFF_BSS.
+ (", N_ROSYM): SECT_OFF_RODATA.
+ (elfstab_build_psymtabs): Caller has allocated dbx_symfile_info.
+ (dbx_symfile_offsets): Add to translate addr to offset.
+ * dwarfread.c: Conforming changes. Single offset currently used.
+ * elfread.c: Add various complaints about elf/stab stuff.
+ #include gdb-stabs.h. Conforming changes, using a single offset.
+ (elf_symtab_read): Record info from BSF_FILE symbols, and local
+ variables called "Bbss.bss", "Ddata.data", and "Drodata.rodata",
+ for later use in building psymtabs.
+ (elf_symfile_read): Allocate dbx_symfile_info here, to keep
+ the info collected in elf_symtab_read. Cleanup calls free_elfinfo.
+ (free_elfinfo): New fn, frees all chained stab_section_infos
+ in an objfile, and zaps the start-of-chain pointer.
+ (elfstab_offset_sections): New fn, looks in stab_section_info
+ chain to determine section bases to relocate a psymtab's worth
+ of symbols, as they are being read.
+ * mipsread.c: Conforming changes. Stabs-reading will relocate
+ using one offset. MIPS-reading will not relocate at all.
+ * partial-stab.h: Relocate different symbol types using different
+ offsets from section_offsets.
+ * symfile.c: Conforming changes.
+ (find_lowest_section): Unused function to use later
+ to free us from the Tyranny of the Text Section.
+ (syms_from_objfile): Translate absolute arg ADDR to offsets used
+ in all lower layers of symbol reading. Call format-specific
+ sym_offsets function to initialize offsets for high speed symbol
+ reading.
+ (symbol_file_add): Call reinit_frame_cache so callers don't have to.
+ (symbol_file_command, add_symbol_file_command): Callers changed.
+ * symmisc.c (dump_psymtab): Print new relocation parameters.
+ * xcoffread.c: Corresponding changes.
+
+ * buildsym.c: Tidy innerblock_complaint and blockvector_complaint.
+ * main.c (main): Read the $HOME/.gdbinit file before processing
+ the argv arguments (e.g. reading symbol files or core
+ files). This allows global parameters to be set, which will apply
+ during the symbol reading. The ./.gdbinit is still read after
+ argv processing.
+ * symtab.c (list_symbols): `i variables' shouldn't show enum values.
+ * xcoffexec.c: Clean up quote inside comment.
+
+Fri Jul 3 20:18:26 1992 Fred Fish (fnf@cygnus.com)
+
+ * breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
+ core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
+ eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
+ i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
+ infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
+ putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
+ sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
+ tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
+ values.c, xcoffread.c:
+ Remove "(void)" casts from function calls where the return value
+ is ignored, in accordance with GNU coding standards.
+
+Fri Jul 3 00:00:49 1992 John Gilmore (gnu at cygnus.com)
+
+ * dbxread.c (process_one_symbol): Ignore N_MAIN, N_ENDM for Solaris.
+ * partial-stab.h: Ignore N_ENDM.
+ * elfread.c (elf_symtab_read): Ignore symbols that don't have a
+ CODE or DATA section attachment. This eliminates a lot of random
+ values from shared libraries, which screw up the ordinary symbols
+ in the address ranges they happen to overlap.
+ * buildsym.c (define_symbol): Eliminate special tests
+ for function types; move into "function" cases in switch statement.
+ (define_symbol: 'f', 'F', 'P'): Process all parameter types
+ in case they define new type numbers. But ignore them (FIXME).
+ ('k', 'B'): Ignore const and volatile if we see them (FIXME).
+ (read_sun_builtin_type): Add commentary.
+
+Wed Jul 1 00:47:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * xm-rs6000.h: define MEM_FNS_DECLARED
+
+Tue Jun 30 02:25:10 1992 John Gilmore (gnu at cygnus.com)
+
+ * tm-mips.h (GDB_TARGET_IS_MIPS): Define for mips-xdep.c.
+ (READ_MIPS_FORMAT, COFF_FORMAT): Remove, unused now.
+ * mips-xdep.c: Remove most include files (unused, caused errs).
+ (fetch_core_registers): Use right parameters in dummy fn.
+
+Mon Jun 29 18:30:57 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (scan_file_globals): Beware the null file.
+ Fix from Jim Williams.
+
+ * stack.c (return_command): Evaluate expression *before* popping
+ off the stack frames! Fix inspired by Jim Williams.
+ (up_silently_command, down_silently_command): No sel frame is error.
+
+ * defs.h (memcpy, memset): Conditionalize decls on
+ #ifndef MEM_FNS_DECLARED, since DECstation differs.
+ (alloca): Break out the STDC and non-STDC alloca cases, to make
+ it work on old preprocessors as well as "picky ANSI" ones.
+ * xm-mips.h (memcpy, memset): Declare, and set MEM_FNS_DECLARED.
+
+ * mips-tdep.c (heuristic_proc_start): Zero arg produces zero.
+ * utils.c (fputs_demangled): Rename SLOP since DECstation system
+ header files define it!
+
+ * tm-29k.h (BREAKPOINT): Allow it to be overridden with -D.
+
+Mon Jun 29 16:30:25 1992 Fred Fish (fnf@cygnus.com)
+
+ * dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c,
+ symtab.h, tm-i386v4.h, valprint.c, values.c: Lint.
+ * breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c,
+ findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c,
+ putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h,
+ utils.c, valarith.c, valops.c, valprint.c, values.c:
+ Replace bcopy() use with memcpy(), which is more standard and can
+ take advantage of gcc's builtin functions for increased performance.
+ * breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c,
+ ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h,
+ target.c, values.c:
+ Replace bzero() use with memset(), which is more standard and can
+ take advantage of gcc's builtin functions for increased performance.
+ * i386-tdep.c, main.c, valprint.c:
+ Replace bcmp() use with memcmp(), which is more standard and can
+ take advantage of gcc's builtin functions for increased performance.
+
+Sun Jun 28 13:30:22 1992 Fred Fish (fnf@cygnus.com)
+
+ * remote.c (remote_wait): Fix cast on signal() call.
+ * defs.h (alloca): More diddling with alloca. Have to ensure
+ that it has a prototype, so that if alloca is defined as a macro
+ that takes an arg, the definition is seen as a use of a macro
+ that takes an arg, to satisfy picky ANSI preprocessors.
+
+Sat Jun 27 12:12:20 1992 Fred Fish (fnf@cygnus.com)
+
+ * sparc-pinsn.c: Use <string.h> rather than "string.h", for
+ consistency with all other gdb files.
+ * cadillac.c: Use <string.h> rather than <strings.h>.
+ * cadillac.c (kernel_dispatch): Convert rindex usage to strrchr.
+ * Makefile.in (MAKE): Remove definition for consistency with
+ other Makefile.in files and to fix problem with recursive makes.
+
+Fri Jun 26 19:03:23 1992 John Gilmore (gnu at cygnus.com)
+
+ * hppahpux-xdep.c (child_xfer_memory): Avoid PT_WDUSER because it
+ crashes H-PUX.
+
+Fri Jun 26 11:09:10 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * source.c (print_source_lines): for DOS interoperability; don't
+ print CR (013) as ^M.
+
+Thu Jun 25 15:18:42 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (dbx_symfile_init): Move more code under hp9000s800
+ conditional.
+ * hppabsd-core.c: Don't include "param.h", include <sys/param.h>
+ instead.
+ * remote.c (remote_wait): Cast signal to void * to avoid warning
+ from busted HP compiler.
+
+ * partial-stab.h (N_SO): Rearrange code a little so that all SO
+ stabs cause end_psymtab to be called.
+
+ * buildsym.c (read_sun_builtin_type): Handle new FCS Sun CC
+ compiler feature of putting 'c' into basic type descriptors for
+ all forms of char.
+
+ * procfs.c (child_resume): Work around Solaris (on Sparc) lossage
+ where there is no place for nPC in prrun struct.
+
+Thu Jun 25 12:06:00 1992 Fred Fish (fnf@cygnus.com)
+
+ * mipsread.c: Pass NULL name pointer to init_type, not 0.
+ * gdbtypes.c (init_type): Use copy of typename on type_obstack.
+ * dwarfread.c (enum_type): Save enum names on type_obstack.
+ * dwarfread.c (struct_type): Save member name on type_obstack.
+ * symtab.c (_initialize_symtab): Fix misspelling.
+ * regex.c (store_jump, insert_jump): Return void.
+
+Thu Jun 25 04:00:10 1992 John Gilmore (gnu at cygnus.com)
+
+ * defs.h (PARAMS): Move to ../include/ansidecl.h.
+ (alloca): Declare return type on SPARC, since Sun doesn't.
+ (*_BYTE_ORDER): Improve comment: *must* be defined.
+
+ * tm-hppa.h: New file, architectural definition of HP PA.
+ * tm-hppabsd.h, tm-hppahpux.h: Shrink to deltas from tm-hppa.h.
+
+ * am29k-pinsn.c, am29k-tdep.c, copying.awk, copying.c,
+ hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c,
+ hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, remote-udi.c,
+ ser-go32.c, xcoffsolib.c: Remove <stdio.h> which is already in
+ "defs.h".
+
+ * hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c,
+ hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, xcoffsolib.c,
+ xcoffsolib.h, xm-go32.h, xm-hppabsd.h, xm-hppahpux.h: Copyrights.
+
+Wed Jun 24 12:53:20 1992 John Gilmore (gnu at cygnus.com)
+
+ * printcmd.c (output_command): Thinko.
+ (x_command): Only set remembered size/format if cmd succeeds.
+
+ * dbxread.c (read_ofile_symtab): Remove N_CATCH special case,
+ since it is no longer used and burns time for every symbol read.
+ (process_one_symbol): Treat N_CATCH like default (complain).
+
+Wed Jun 24 00:26:56 1992 Stu Grossman (grossman at cygnus.com)
+
+ * partial-stab.h (case N_TEXT): Fix fencepost error when
+ detecting start of new symbol info after reading symtab for a
+ module with a zero length TEXT segment.
+
+Tue Jun 23 21:46:26 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.5.6.
+ * coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
+ correct type.
+ * defs.h (NORETURN): Define away for Lucid compiler.
+ * remote.c (remote_timer, remote_interrupt): Signal handlers
+ take one int arg.
+ * ser-termios.c (serial_write, serial_close): Return whatever
+ value the write/close call returns, rather than falling off end.
+ * inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
+ more systems than it is "char *". Define PTRACE_ARG3_TYPE to
+ default to int.
+ * infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
+ inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
+ of third arg.
+ * a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
+ m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
+ pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
+ symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
+ argument 3.
+ * sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
+ store_inferior_registers): Supply missing fourth argument to
+ ptrace().
+ * cadillac.c (kernel_dispatch): Make return type void.
+ * cadillac.c (iosig): Signal handlers take one int arg.
+ * valprint.c (val_print_fields): Call fprint_symbol to get
+ automatic C++ demangling for mangled field names.
+
+Mon Jun 22 20:18:06 1992 Fred Fish (fnf@cygnus.com)
+
+ * command.c (add_abbrev_prefix_cmd): Fix misspelling in comment.
+ * dwarfread.c (enum_type): Fix misspelling in comment.
+ * valprint.c (val_print_fields, cplus_val_print): Minor
+ adjustment to printing of C++ class structures to more closely
+ match format for printing C structures, with and without setting
+ pretty print.
+
+Mon Jun 22 17:19:02 1992 Per Bothner (bothner@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Don't test for SIGEMT
+ (which is not a Posix signal) if it isn't defined.
+ * tm-linux.h, xm-linux.h, config/linux.m[ht], configure.in:
+ New port to Linux (a free Unix clone for 386 machines).
+
+Sat Jun 20 19:19:52 1992 John Gilmore (gnu at cygnus.com)
+
+ COFF changes for dealing better with EPI 29K C compiler output.
+
+ * coffread.c (record_minimal_symbol): Pass the minsym type to it.
+ Callers changed.
+ (coff_end_symtab): Sort blocks if needed. Complain if misordered.
+ (read_coff_symtab): Move patch_opaque_types call from
+ coff_symfile_read. Restrict it to symtabs from this objfile.
+ (process_coff_symbol: C_TPDEF): Don't put ordinary foward
+ references on opaque type chain; just let coff_lookup_type handle 'em.
+ (decode_type): Complain about tagndx values on
+ non-struct/union/enum types, which the EPI compiler tends to produce.
+
+ * symtab.c (list_symbols): Make minimal symbol variable-finding work.
+
+ * tm-68k.h (FIX_CALL_DUMMY): Avoid alignment and byte order
+ dependency.
+
+ * elfread.c (elf_symfile_read): Update bfd_elf_find_section
+ usage to match new prototype. Include libbfd.h to get prototype.
+
+ * source.c (find_source_lines): Handle large st_size fields.
+
+Sat Jun 20 16:28:39 1992 Fred Fish (fnf@cygnus.com)
+
+ * infcmd.c (jump_command): Use cleanups to avoid memory leaks.
+ * stack.c (return_command): Use cleanups to avoid memory leaks.
+
+Fri Jun 19 19:06:41 1992 John Gilmore (gnu at cygnus.com)
+
+ * remote-adapt.c, remote-eb.c, remote-mm.c: Lint. Fix
+ INT_REGNUM to INTE_REGNUM.
+
+ * tm-29k.h (SDB_REG_TO_REGNUM): Add for EPI 29K C compiler.
+
+Fri Jun 19 15:30:15 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in, dbxread.c, hppa-coredep.c, hppa-pinsn.c,
+ hppabsd-core.c, hppabsd-tdep.c, hppabsd-xdep.c, hppahpux-tdep.c,
+ hppahpux-xdep.c, munch, partial-stab.h, tm-hppabsd.h,
+ tm-hppahpux.h, xm-hppabsd.h, xm-hppahpux.h: HPPA merge.
+
+ * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Filter out bogus extern
+ declarations of malloc/realloc/free that are inserted by some
+ versions of yacc.
+ * m2-exp.y: Prevent conflicts with TRUE and FALSE tokens by
+ #undeffing them.
+ * xm-rs6000.h: Declare malloc/realloc/free appropriately. Yet
+ another decl of strdup (this really ought to come from libiberty.h!).
+
+Fri Jun 19 10:28:05 1992 John Gilmore (gnu at cygnus.com)
+
+ * remote.c (getpkt): Error if input exceeds buffer size.
+ (_initialize_remote): `set remotedebug' enables packet trace.
+
+ * dbxread.c (process_one_symbol:N_FUN): GCC now produces relative
+ N_SLINE's, etc, just like Sun cc on Solaris2.
+
+ * am29k-tdep.c (read_register_stack, write_register_stack):
+ Change RSTACK_HIGH_ADDR to rstack_high_address, a user-settable
+ variable. Add `set' and `show' commands for it.
+ * doc/gdb.texinfo: Document it.
+
+Thu Jun 18 19:35:22 1992 Fred Fish (fnf@cygnus.com)
+
+ * valprint.c (type_print_1): Plug memory leak. Print all
+ C++ syms as demangled, not just functions.
+ * buildsym.c (read_range_type): When we find a signed char
+ type, do a lookup of signed char, not plain char. Plain char's
+ still get looked up as plain char's elsewhere.
+
+Thu Jun 18 18:59:04 1992 John Gilmore (gnu at cygnus.com)
+
+ * eval.c: Avoid residue-by-zero when evaluating without side effects.
+ (Bug and fix found by Pierre Willard.)
+
+Wed Jun 17 13:08:33 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xm-rs6000.h: Fix decls for malloc, realloc, and free.
+
+ * xm-rs6000.h: Add decl for strdup().
+
+ * tm-rs6000.h: Remove #include of inferior.h. Fixes many
+ compilation errors.
+
+ * breakpoint.c (enable_command, disable_command): Without args,
+ should only affect normal breakpoints and watchpoints.
+
+ * m68k-pinsn.c (print_insn_arg): Make register be const.
+ * xcoffexec.c: Remove ' from comment.
+ * xm-sun3os4.h: Define MALLOC_INCOMPATIBLE to avoid conflicts
+ with decls of malloc in c-exp.tab.c (as produced by yacc).
+ There's got to be a better way to do this...
+
+Wed Jun 17 11:10:40 1992 Fred Fish (fnf@cygnus.com)
+
+ * partial-stab.h: Convert single rindex use to strrchr.
+ * mipsread.c, dbxread.c: Remove troublesome inclusion of non-
+ standard <strings.h> file, now that the only single use of
+ rindex in the gdb source files is gone.
+
+Tue Jun 16 22:17:49 1992 Fred Fish (fnf@cygnus.com)
+
+ * mipsread.c: Undo ill effects from including <strings.h>,
+ which #defines index to be strchr. Unfortunately, index is
+ a member of a symbol table structure that can't be changed.
+ * mipsread.c: tm-mips.h includes coff/symconst.h and coff/sym.h,
+ remove redundant #include's.
+
+Tue Jun 16 14:15:51 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c: #include <strings.h> for rindex().
+
+Tue Jun 16 09:01:49 1992 Fred Fish (fnf@cygnus.com)
+
+ * xcoffexec.c (map_vmap): Turn comment into a real C comment.
+
+Mon Jun 15 18:41:23 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (process_one_symbol), partial-stab.h: Ignore
+ extraneous SO stabs from busted C++ compilers.
+
+Mon Jun 15 12:21:45 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.5.5.
+ * symtab.c (decode_line_1): Until C++ support stabilizes, when
+ C++ lookups fail, print possibly helpful hint about completion.
+ * cplus-dem.c (demangle_signature): Fix ARM style demangling
+ for static data members.
+ * dbxread.c (dbx_psymtab_to_symtab_1): Fix prototype.
+ * config/ncr3000.mh (INSTALL): Don't use /usr/ucb/install,
+ it's broken on ncr3000's.
+
+Mon Jun 15 07:21:00 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (decode_modified_type): Change type of first arg.
+ Change 'modifier' to char from unsigned char. Cast single use
+ that needs to be unsigned char.
+ * symtab.h (SYMBOL_BASEREG_VALID): Explain disabling.
+ * utils.c (strdup_demangled): Add function.
+ * defs.h (strdup_demangled): Add prototype.
+ * stack.c (return_command): Demangle C++ function names for query.
+ * infcmd.c (jump_command): Demangle C++ function names for query.
+ * cplus-dem.c (consume_count): New function and prototype.
+ * cplus-dem.c (demangle_class, gnu_special, demangle_func_type,
+ do_type): Replace conversion code with consume_count().
+ * cplus-dem.c (gnu_special): Fix demangled of static members.
+ * source.c (list_command): Print demangled function names
+ when appropriate. Fix supplied by Peter Schauer.
+
+Mon Jun 15 01:45:48 1992 John Gilmore (gnu at cygnus.com)
+
+ * sparc-tdep.c: Clean up slightly for Solaris2.
+
+ * buildsym.c (define_symbol): Nameless types are now on several
+ platforms; generalize them and un-ifdef them to make Solaris 2
+ work.
+
+Sun Jun 14 10:55:51 1992 John Gilmore (gnu at cygnus.com)
+
+ * infcmd.c: Fix typo (reported by Rob Savoye).
+ * xm-sun4sol2.h (gregset_t): Thinko in register set definition.
+ * symtab.h: Disable SYMBOL_BASEREG_VALID until it works.
+ * dbxread.c (dbx_psymtab_to_symtab_1): Renamed from
+ psymtab_to_symtab_1. Use current psymtab's sym_offset and symbol_size,
+ rather than the one for the first file in the dependency chain.
+
+ * dbxread.c (end_psymtab): Only reset texthigh if it's not already
+ set. Don't reset our own texthigh, or dependency-only pst's, in
+ scanning all the rest of the psymtabs.
+ (process_one_symbol): Fix comments around N_OBJ, N_OPT, N_UNDF.
+
+ * buildsym.h (N_UNDF): Improve comments.
+ (N_LSYM, etc): Skip types without names (":T(0,3)=sfoob...").
+
+Sat Jun 13 11:16:45 1992 Fred Fish (fnf at cygnus.com)
+
+ * symtab.h (struct symbol): Add aux_value union for preserving
+ an additional per-symbol value.
+ * symtab.h (SYMBOL_BASEREG, SYMBOL_BASEREG_VALID): Add defines.
+ * frame.h (FRAME_GET_BASEREG_VALUE): Provide default definition.
+ * findvar.c (read_var_value): Use SYMBOL_BASEREG if valid.
+ * printcmd.c (address_info): Use SYMBOL_BASEREG if valid.
+ * symmisc.c (print_symbol): Use SYMBOL_BASEREG if valid.
+
+Sat Jun 13 09:18:46 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * symfile.c (clear_symtab_users_once): Now non-static (for
+ objfiles.c).
+
+Fri Jun 12 18:54:40 1992 John Gilmore (gnu at cygnus.com)
+
+ * arm-pinsn.c, i960-pinsn.c, m68k-pinsn.c, mips-pinsn.c,
+ ns32k-pinsn.c, pyr-pinsn.c, sparc-pinsn.c, tahoe-pinsn.c,
+ vax-pinsn.c: Remove reg_names decl (now in defs.h).
+
+ Solaris-2 support on SPARC:
+
+ * dbxread.c: Add symbol_size to struct dbx_symfile_info.
+ Add symbol_size and file offsets to struct symloc.
+ Add static symbol_table_offset, string_table_offset,
+ file_string_table_offset, next_file_string_table_offset,
+ last_function_name.
+ (add_old_header_file): Convert error() to complain()t.
+ (dbx_symfile_read): Get symbol size via the objfile.
+ Also get symbol_table_offset.
+ (dbx_symfile_init): Record symbol size and count via the objfile.
+ (dbx_next_symbol_text): Always add file_string_table_offset when
+ accessing string table.
+ (read_dbx_symtab): Initialize file_string_table_offset to 0.
+ (SET_NAMESTRING): Use the offset.
+ (end_psymtab): Large kludge to determine addresses where source
+ files start and end (for the psymtab header).
+ (psymtab_to_symtab_1): Set file_string_table_offset before reading.
+ Get this, symbol size, and symbol offset, from psymtab.
+ (read_ofile_symtab): Don't back up one symbol for Solaris2.
+ Patch up last_source_start_addr if zero in N_SO.
+ (process_one_symbol): Add variable function_start_offset.
+ ( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
+ BLOCK_ADDRESS_FUNCTION_RELATIVE.
+ ( "", N_OBJ, N_OPT): Ignore.
+ (elfstab_build_psymtabs): New function to read stabs out of
+ an ELF file.
+
+ * Makefile.in: Accept $(BISON) even though we really want $(YACC).
+ (gdb): use GLOBAL_CFLAGS when linking, too.
+ * partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
+ (N_OBJ, N_OPT): Ignore.
+ ('f', 'F'): Save last function name.
+
+ * elfread.c (record_minimal_symbol_and_info): Kludged to put
+ extra info in the minimal symbol.
+ (elf_symtab_read): The extra info is the size of an ELF object,
+ which was kludged to us in the `udata' field of the BFD symbol.
+ Gag me with a crowbar...
+ (elf_symfile_read): Keep track of both the absolute load address,
+ and the offset between load addr and symbols. Handle STABS as
+ well as DWARF sections, passing the absolute load address to
+ elfstab_build_psymtabs.
+
+ * symfile.h: Prototype elfstab_build_psymtabs.
+ * symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
+
+ * xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
+
+ * buildsym.h: Add processing_acc_compilation flag.
+ * buildsym.c (read_sun_builtin_type, read_sun_floating_type): New.
+ (define_symbol): Skip arg types in function entries. Resolve
+ overloaded 'P' which acc uses for prototypes of functions called
+ by this file.
+ (read_type: 'b', 'r'): Handle Solaris2 builtin types.
+
+ * minsyms.c (prim_record_minimal_symbol_and_info): Hack to
+ save size of ELF symbols. FIXME.
+ * tm-sun4os5.h: Rename to tm-sun4sol2.h. Update defines for Sol2.
+ * xm-sun4os5.h: Rename to xm-sun4sol2.h. Hack more defines.
+
+ * configure.in: Solaris config is sparc-sun-solaris2.
+ * config/sun4os5.m[ht]: Rename to config/sun4sol2.m[ht]; new xm, tm.
+
+ * objfiles.c (free_objfile): Eliminate storage leaks. Contributed
+ by <Peter.Schauer@regent.e-technik.tu-muenchen.dbp.de>.
+ * symfile.c (symfile_bfd_open): Comment where name is freed.
+ * symmisc.c (extend_psymbol_list): Comment where list is freed.
+
+Fri Jun 12 08:24:36 1992 Fred Fish (fnf at cygnus.com)
+
+ * expprint.c (print_subexp): Add missing ']'.
+ * defs.h (reg_names): Fix declaration to match that in infcmd.c
+ * stack.c (reg_names): Delete redundant (and inconsistent) decl.
+ * WHATS.NEW: Point out improved C++ function name handling.
+ * gdbtypes.c (lookup_fundamental_type): For now, use the same
+ type names for both implicitly and explicitly signed integral
+ types. See comment in the source code.
+
+Thu Jun 11 12:31:50 1992 John Gilmore (gnu at cygnus.com)
+
+ Two `long long' fixes from Robert R. Henry (rrh@dino.tera.com):
+ * defs.h (longest_to_int): Avoid void arm of ?: in error case.
+ * expprint.c (print_subexp): Fix printing of register names.
+
+Thu Jun 11 01:33:40 1992 John Gilmore (gnu at cygnus.com)
+
+ * inferior.h (register_valid): Declare.
+ * remote-udi.c, rs6000-xdep.c, sparc-xdep.c, tm-rs6000.h: Remove decl.
+ * objfiles.h (ALL_OBJFILE_{SYMTABS,PSYMTABS,MSYMBOLS}): Add
+ macros for traversing the data structures in a single objfile.
+ * tm-m88k.h, tm-sparc.h (REGISTER_NAMES): Remove extra semicolon.
+ * tm-i960.h (REGISTER_NAMES): Cosmetic change.
+ * infcmd.c: Lint.
+
+Tue Jun 9 17:19:45 1992 Fred Fish (fnf at cygnus.com)
+
+ * c-exp.y, m2-exp.y: Move remapping defines for malloc and
+ realloc. Add remapping defines for {yyss, yyssp, yyvs, yyvsp}.
+ * config/{amix.mh, i386v4.mh, ncr3000.mh, stratus.mh,
+ sun4os5.mh}: Add definition for INSTALL using /usr/ucb/install.
+
+Tue Jun 9 16:29:19 1992 Stu Grossman (grossman at cygnus.com)
+
+ * depend: rebuild to account for remote-st2000.c.
+ * remote-st2000.c: Almost works now.
+ * tm-st2000.h: Need to turn on HAVE_68881, else things won't compile.
+
+Mon Jun 8 23:05:51 1992 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (yylex): Recognize single-quoted strings that specify
+ tokens with embedded whitespace, such as C++ demangled names.
+ * defs.h (demangle_and_match, strcmp_iw, skip_quoted): Prototypes.
+ * main.c (gdb_completer_quote_characters): Add global variable.
+ * main.c (symbol_completion_function): Total rewrite for C++
+ demangled name handling.
+ * main.c (skip_quoted): New function.
+ * main.c (main): Set rl_completer_quote_characters.
+ * symmisc.c (dump_symtab): Print source language for symtab.
+ * symtab.c (expensive_mangler): Add prototype and function.
+ * symtab.c (completion_list_add_symbol): Total rewrite for new
+ C++ demangled name handling.
+ * symtab.c (lookup_symbol): Check for demangled C++ symbol first,
+ other changes for demangled C++ symbol handling.
+ * symtab.c (lookup_demangled_block_symbol): Use demangle_and_match.
+ * symtab.c (lookup_demangled_partial_symbol): Use demangle_and_match.
+ * symtab.c (decode_line_1): Recognize C++ demangled names on input.
+ * symtab.c (completion_list_add_symbol): Total rewrite for new
+ C++ demangled name handling.
+ * symtab.c (expensive_mangler): New function.
+ * utils.c (strcmp_iw, demangle_and_match): New functions.
+ * xcoffread.c (aixcoff_symfile_read): Fix prototype.
+
+Mon Jun 8 21:59:08 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Roll VERSION to 4.5.4.
+ * Makefile.in, config/*.mh, config/*.mt: Rename TM_CFLAGS
+ to MT_CFLAGS, XM_CFLAGS to MH_CFLAGS to match file names.
+ * config/sun4os5.mh: Add MH_CFLAGS=-xs to save debug info.
+
+Mon Jun 8 14:17:42 1992 Stu Grossman (grossman at cygnus.com)
+
+ * alldeps.mak: Rebuild to account for new files.
+ * config/st2000.mt: Use tm-st2000.h, not tm-68k.h.
+ * tm-st2000.h: New file.
+ * configure.in: Tandem debug monitor (st2000) support.
+ * remote-st2000.c, config/st2000.mt: ditto.
+
+Fri Jun 5 11:51:01 1992 John Gilmore (gnu at cygnus.com)
+
+ * blockframe.c (inside_entry_file, inside_main_func,
+ inside_entry_func): Return 0 if no symbols; avoid crashing.
+
+Wed Jun 3 17:48:04 1992 John Gilmore (gnu@cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): Set c_sclass from n_sclass
+ without masking, since it is signed and will later be compared
+ against signed quantities. The right fix is probably to make
+ it all unsigned, but this is a small, safe fix for this release.
+ FIXME -- make the real change sometime soon.
+
+Mon Jun 1 16:16:12 1992 Michael Tiemann (tiemann@cygnus.com)
+
+ * remote-vx.c (vx_load_command,add_symbol_stub): Default READNOW
+ parameter in call to `symbol_file_add' to 0.
+
+ * xm-sun4os4.h (MALLOC_INCOMPATIBLE): Define it.
+
+Sun May 31 06:38:27 1992 Michael Tiemann (tiemann@cygnus.com)
+
+ * configure.in: Handle -m680[01234]0-wrs.
+
+Fri May 29 22:16:02 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * m68k-pinsn.c (print_insn_arg): Pass &EXT_FORMAT_68881 to
+ `ieee_extended_to_double'.
+
+Wed May 27 09:27:57 1992 John Gilmore (gnu at cygnus.com)
+
+ * valops.c (value_assign): Lint, by Pierre Willard.
+
+Tue May 19 19:38:10 1992 John Gilmore (gnu at cygnus.com)
+
+ * coredep.c (fetch_core_registers): Remove premature warning,
+ which triggers on DECstation even though all regs are accessible.
+
+ * m68k-pinsn.c (print_insn_arg): Use new macros to get
+ sign-extension of instruction fields even on unsigned-char hosts.
+ Bug found by Fred J Roeber, fjr@sgfb.ssd.ray.com.
+
+ 88K changes inspired by Ted Lemon (uunet!lupine!mellon):
+ * tm-m88k.h, tm-umax.h: Avoid sizeof() in REGISTER_xxx macros,
+ since they define the target, not the host.
+ * m88k-pinsn.c: Fix typo.
+
+Thu May 14 01:16:48 1992 John Gilmore (gnu at cygnus.com)
+
+ * valarith.c (value_zerop): -0.0 is still zero.
+ * eval.c (evaluate_subexp): Avoid NaN anomalies in float compares.
+ Patches by Paul Eggert <eggert@twinsun.com>.
+
+Mon May 18 13:53:51 1992 Stu Grossman (grossman at cygnus.com)
+
+ * alldeps.mak, depend: re-make to account for ser-*.c.
+
+Sun May 17 16:51:20 1992 Fred Fish (fnf@cygnus.com)
+
+ * inflow.c (new_tty): Temporarily ignore SIGTTOU when
+ disconnecting from controlling terminal, to avoid gdb hanging
+ on SVR4. Fixes bug reported by Oliver Okrongli.
+ * procfs.c (PROC_NAME_FMT): Change format to match default used
+ by system, as suggested by Oliver Okrongli.
+ * tm-68k.h (FRAME_FIND_SAVED_REGS): Apply missing parentheses
+ bug fix from Brent Townshend (bst%tt@cam.ORG).
+ * c-exp.y (nonempty_typelist): Fix memory overrun bug reported
+ by turlais@rechser.total.fr.
+ * dwarfread.c (decode_subscr_data): Fix bug in calculation of
+ length of non-zero lowerbound arrays. Bug fix from Peggy Fieland.
+ * objfiles.h (unlink_objfile): Add prototype.
+ * objfiles.c (unlink_objfile): Add function.
+ * objfiles.c (free_objfile): Call unlink_objfile.
+ * objfiles.c (allocate_objfile): Call unlink_objfile on newly
+ remapped objfiles. Bug reported by hahn@sunshine.labs.tek.com.
+ Also, discard old possibly bogus sf struct.
+ * symfile.c (symbol_file_add): Call init_entry_point_info() and
+ find_sym_fns() for remapped symbol files, in case of any changes
+ since the last mapping.
+
+Wed May 13 18:28:20 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * findvar.c (read_relative_register_raw_bytes): use the raw size
+ of a register to bcopy, rather than the host's sizeof(CORE_ADDR).
+
+Tue May 12 17:44:39 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ Changes to support GDB running on DOS using GO32 and H8 support
+
+ * defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
+ allowing hosts with different text and binary file formats to
+ work.
+ * coffread.c (read_coff_symtab): changed calling convention and
+ operation - now it opens its own file with FOPEN_RB rather than
+ duping and fdopening the provided handle.
+ * dbxread.c, cplus-dem.c: #include mangling.
+ * exec.c: If O_BINARY isn't defined, set it to 0, call openp for
+ binary files oring in the right bit.
+ * utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
+ * remote-hms.c: cleanup to use the new remote serial stuff
+ * serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
+ independent remote terminal I/O.
+ * remote.c: if DONT_USE_REMOTE not defined, then don't use it.
+ * source.c (openp): fix off by one problem removing / - can now
+ open a source file in the root directory with DOS.
+ * values.c (value_as_pointer): remove bogus address bits from
+ long. (unpack_long): unpack into unsigned long/short if pointer.
+
+Tue May 12 14:15:48 1992 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (child_attach): Don't allow gdb to attach to itself.
+ It gets permanently stuck in many OSes.
+ * breakpoint.c, infcmd.c, infrun.c, utils.c: Change many printfs
+ to printf_filtered.
+ * breakpoint.c: Improve help text for info breakpoints.
+
+Mon May 11 14:17:18 1992 John Gilmore (gnu at cygnus.com)
+
+ * README: Add pointer to internals doc, and describe reading
+ info files.
+ * utils.c (print_sys_errmsg): Use stderr. Reported by Pierre Willard.
+ * symtab.c (output_source_filename): Remove old glop for wrapping
+ lines, use wrap_here. Reported by Pierre Willard (pierre@la.tce.com).
+
+Thu May 7 11:45:03 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: version.c should depend on Makefile, not Makefile.in.
+ * munch: Add sort -u to avoid duplications.
+ * symtab.c (lookup_symbol): Improve Stu's fix of 22 April.
+ Improved fix by hahn@sunshine.labs.tek.com (Doug Hahn).
+
+Mon May 11 13:27:46 1992 Fred Fish (fnf@cygnus.com)
+
+ * cplus-dem.c (demangle_signature): Recognize misplaced '_' to
+ avoid infinite loops while demangling bogus mangled names.
+ * valprint.c (type_print_base): Minor fix for GNU style guide
+ conformance.
+
+Sat May 9 18:02:17 1992 Fred Fish (fnf at fishpond)
+
+ * Makefile.in (VERSION): Bump to 4.5.3
+ * Makefile.in (DEMANGLE_OPTS): Remove obsolete -Dnounderscore
+ * Makefile.in (demangle): New target to create standalone
+ demangler with same code and options as internal demangler.
+ * cplus-dem.c: Massive restructuring, rewriting, cleanups, etc
+ to support ARM style and Lucid style demangling, improve
+ maintainability, fix several demangling bugs. More changes
+ to follow.
+ * defs.h (strstr): Add ANSI compatible prototype.
+ * valprint.c (type_print_1): Demangle using ansi option.
+ * config/ncr3000.mt (DEMANGLE_OPTS): Remove -Dnounderscore.
+
+Sat May 9 14:47:28 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xcoffexec.c (vmap_exec): Don't assume .text and .data are the
+ first two sections.
+
+Fri May 8 11:42:15 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * mipsread.c (parse_procedure): Return rather than using
+ uninitialized variable 'b'.
+
+Fri May 8 07:48:27 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in, remote-udi.c, remote-vx.c, 29k-share/dfe/mini2udi.c,
+ 29k-share/dfe/yank.c, vx-share/xdr_ptrace.c, vx-share/xdr_regs.c:
+ Remove -I29k-share, -Ivx-share from Makefile.in. Make #includes
+ relative to each source file.
+
+Fri May 8 07:48:27 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: propogate INSTALL, INSTALL_DATA, INSTALL_PROGRAM on
+ recursions.
+
+Thu May 7 10:00:52 1992 Stu Grossman (grossman at cygnus.com)
+
+ * am29k-pinsn.c: Use new opcode table in "opcode/a29k.h".
+ * am29k-tdep.c: Update to latest code from AMD.
+ (get_saved_register) don't crap out if no frame.
+ * remote-udi.c: Set/clear inferior_pid as appropriate.
+ (udi_open) call target_preopen, don't close fd 0!!!, clean up
+ error handling. Fixup end-of-debugging messages.
+ (udi_fetch_registers) clean up big time, mainly don't multiply
+ register_valid indices by 4, and use proper Offset when reading
+ gr96-gr127. (udi_store_registers) general cleanup.
+ (fetch_register) cleanup, simplify. (regnum_to_srnum)
+ INT_REGNUM->INTE_REGNUM.
+ * tm-29k.h: Upgrade to latest code from AMD.
+ * 29k-share/udi/udip2soc.c: Get rid of useless errmsg_m macro.
+ (UDIConnect) Clean up error processing (like, don't do exit() if
+ execlp fails), make code restartable, make more attractive.
+ (UDIStop) Use SIGINT instead of SIGUSR1, as isstip won't stop
+ otherwise.
+
+Wed May 6 14:34:18 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * tm-irix3.h: Re-define CPLUS_MARKER to '.'.
+ * xm-rs6000.h, tm-rs6000.h: Move re-definition of CPLUS_MARKER
+ from former to latter.
+
+Wed May 6 14:12:35 1992 Fred Fish (fnf@cygnus.com)
+
+ * cplus-dem.c (do_args): Handle void args the same as others.
+ * objfiles.c (free_objfile): Only try to unmap files when
+ reusable objfiles are supported.
+ * valprint.c (type_print_varspec_suffix): Add parameter that
+ specifies if C++ demangling included function arguments. Use
+ it to suppress printing extra pair of ()'s.
+ * valprint.c (type_print_1): Fix problem with printing demangled
+ C++ function types where demangled type includes the function
+ args.
+
+Tue May 5 11:10:27 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (DEMANGLER): Define and default to cplus-dem.
+ Allows selection of C++ demangler to be a configuration option
+ until multiple demanglers are supported.
+ * demangle.h: New include file for extended demangler support.
+ * breakpoint.c, gdbtypes.c, printcmd.c, stack.c, symtab.c,
+ utils.c, valprint.c: Include "demangle.h" and change all calls
+ to cplus_demangle() or fputs_demangled() to use individual
+ demangling options.
+ * valprint.c (type_print_1): Change options to cplus_demangle
+ to print demangled function args. Still broken, but now less so.
+ * cplus-dem.c: Include demangle.h, reorganize and update some
+ comments to reflect reality.
+ * cplus-dem.c (cplus_demangle, cplus_mangle_opname): Change
+ second arg from fixed integer to bit based multiple options.
+ * cplus-dem.c (optable): Reformat and replace ansi members with
+ bit based options.
+ * cplus-dem.c (do_type): Fix bug with parsing missing return type.
+
+Mon May 4 22:26:59 1992 John Gilmore (gnu at cygnus.com)
+
+ * values.c (set_internalvar): Force evaluation of lazy values.
+ Bug reported by RMS.
+
+Sun May 3 15:47:45 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.5.2.
+ * Makefile.in (DEMANGLE_OPTS): Add, default to -Dnounderscore.
+ * configure.in: Simplify ncr3000 gdb_host logic, add gdb_target.
+ * dwarfread.c (struct_type): Apply fix from Peggy Fieland for
+ proper handling of bit fields.
+ * gdbtypes.h (struct type): Clarify use of field.bitpos.
+ * symtab.h: Fix couple of misspellings in comments.
+ * value.h (struct value): Clarify use of bitpos.
+ * value.h (unpack_field_as_long): Change prototype, returns
+ LONGEST.
+ * values.c (unpack_field_as_long): Change return type to LONGEST,
+ sign extend unpacked fields that are signed, other rewriting.
+ * config/ncr3000.mt: New target config file.
+
+Fri May 1 01:53:26 1992 John Gilmore (gnu at cygnus.com)
+
+ * utils.c (printchar): Print 0x7F and 0x80-0x9F in \nnn notation
+ even when printing 8-bit characters.
+
+ * gdbtypes.c (make_{reference,pointer,function}_type): New
+ functions which handle overwriting of forward-referenced types
+ for stabs file reading.
+ (lookup_{reference,pointer,function}_type): These just call
+ the make_*_type functions with a null storage alloc parameter.
+ * gdbtypes.h (make_{reference,pointer,function}_type): Declare.
+ * xcoffread.c (smash_to_pointer_type): Remove, no longer used.
+
+ * buildsym.c (dbx_lookup_type): Zero result for (-1,-1) arg.
+ (dbx_alloc_type): Make it easier to understand. No funct change.
+ (define_symbol: 't'): Don't put the typedef name into the name of
+ the struct, union, or enum. Bugfix.
+ (read_type: '*', '&', 'f'): Add comments. Use make_XXX_type
+ routines to properly handle overwriting preallocated types so that
+ forward references will work.
+ (read_enum_type): Force enum values to file scope, due to bug in
+ Sun compiler output. FIXME, fix later.
+
+ Remove unused header_file_prev_index mechanism. It was already
+ obsolete in gdb-3.5. These comments appeared in 3.5:
+ /* This code was used before I knew about the instance codes.
+ My first hypothesis is that it is not necessary now
+ that instance codes are handled. */
+ * dbxread.c (add_new_header_file): Remove header_file_prev_index.
+ * buildsym.h: Remove it and prev_index that saves it.
+ * buildsym.c (push_subfile, pop_subfile, start_symtab): Remove it.
+
+ * solib.c (special_symbol_handling): When called from core files,
+ must set up debug_addr. Don't print error messages, just return.
+ * symmisc.c (print_symbol): Less ascii diarrhea for enums, please.
+
+Wed Apr 29 15:26:51 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * cplus-dem.c: Allow nested class names (as in
+ Foo::Bar::method()).
+ Allow the cleaner cfront style of nested class names
+ (Q2_3Foo3Bar as well as Q23Foo3Bar).
+ Make cplus_demangle re-entrant by removing use of global
+ variables. Instead, place all shared variables in a
+ stack-allocated structure, and pass around its address.
+
+Fri Apr 24 07:41:19 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (make-proto-gdb-1): 1st cut at packaging
+ 29k-share/* subdirs...
+
+ * remote-udi.c (udi_insert/remove_breakpoint): Completely
+ rewrite, only leave out the bugs.
+
+ * Makefile.in: Add 29k/UDI support. Improve depend.
+ * alldeps.mak, configure.in, depend: Add 29k/UDI support.
+
+ * am29k-tdep.c: Update to use new calling conventions, and misc
+ symbol elements.
+
+ * m68k-pinsn.c (print_insn_arg): Make branch offsets be signed.
+
+Thu Apr 23 18:43:17 1992 Fred Fish (fnf@cygnus.com)
+
+ * tm-29k.h: Set DECR_PC_AFTER_BREAK to 0, as 29ks have nice
+ breakpoint instructions that leave PC pointing at the right place.
+
+ * core.c (core_open): Call warning() to print warnings.
+
+Wed Apr 22 09:55:42 1992 Stu Grossman (grossman at cygnus.com)
+
+ * symtab.c (lookup_symbol): Need to check if msymbol->name is
+ NULL, as ALL_MSYMBOLS will never return a NULL msymbol pointer.
+ This prevents a crash when trying to lookup the value of a
+ non-existent symbol.
+
+Wed Apr 22 09:42:15 1992 Fred Fish (fnf@cygnus.com)
+
+ * signame.c, signame.h: Remove, replaced by strsignal.c in
+ libiberty.
+ * i960-tdep.c, infrun.c, mach386-xdep.c, procfs.c, sparc-tdep.c,
+ sun386-xdep.c: Remove include of signame.h
+ * Makefile.in (SFILES_MAINDIR): Remove signame.c
+ * Makefile.in (HFILES): Remove signame.h
+ * Makefile.in (OBS): Remove signame.o
+ * defs.h (safe_strerror, safe_strsignal, strerrno, strsigno,
+ errno_max, signo_max, strtoerrno, strtosigno, strsignal,
+ psignal, perror): Add prototypes.
+ * defs.h, xm-apollo68v.h, xm-ultra3.h (SYS_SIGLIST_MISSING):
+ Remove define.
+ * depend: Manually remove signame.[cho] references.
+ * convex-tdep.c (subsig_name): Replace use of sys_siglist with
+ strsignal.
+ * convex-xdep.c (core_file_command): Replace use of sys_siglist
+ with safe_strsignal.
+ * core.c (core_open): Replace use of sys_siglist with
+ safe_strsignal.
+ * core.c (memory_error): Replace use of sys_errlist with
+ safe_strerror.
+ * i960-tdep.c (print_fault): Replace use of sys_siglist with
+ safe_strsignal.
+ * infcmd.c (program_info): Replace use of sys_siglist with
+ safe_strsignal.
+ * infrun.c (signal_stop, signal_print, signal_program):
+ Allocate dynamically based on dynamic determination of number
+ of signals to support.
+ * infrun.c (child_create_inferior): Replace use of sys_errlist
+ with safe_strerror.
+ * infrun.c (wait_for_inferior): Replace use of sys_siglist with
+ safe_strsignal.
+ * infrun.c (sig_print_info): Replace use of sig_abbrev with
+ strsigno and sys_siglist with safe_strsignal.
+ * infrun.c (handle_command): Call signo_max to find number of
+ signals. Replace sig_number with strtosigno and sig_abbrev with
+ strsigno.
+ * infrun.c (signals_info): Replace sig_number with strtosigno.
+ * infrun.c (_initialize_infrun): Call signo_max to find number of
+ signals. Dynamically allocate signal_{stop,print,program}.
+ * procfs.c (errno_table): Remove, now in libiberty/strerror.c.
+ * procfs.c (errnoname): Add function and prototype.
+ * procfs.c (info_proc_siginfo): Call errnoname, replace use
+ of sys_siglist with safe_strsignal.
+ * procfs.c (info_proc_stop, info_proc_signals): Replace use of
+ sys_siglist with safe_strsignal.
+ * procfs.c (info_proc_stop): Call errnoname.
+ * procfs.c (signalname): Replace sig_abbrev with strsigno.
+ * stuff.c (main, get_offset): Replace use of sys_errlist with
+ strerror.
+ * sun386-xdep.c (core_file_command): Replace use of sys_siglist
+ with safe_strsignal.
+ * umax-xdep.c (core_file_command): Replace use of sys_siglist
+ with safe_strsignal.
+ * utils.c (safe_strerror, safe_strsignal): Add functions that
+ call strerror and strsignal respectively, and deal with NULL
+ returns.
+ * utils.c (perror_with_name, print_sys_errmsg): Replace use of
+ sys_errlist with safe_strerror.
+ * valprint.c (val_print): Replace use of sys_errlist with
+ safe_strerror.
+
+Tue Apr 21 12:00:47 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: rework CFLAGS so that they can be set from the
+ command line to make. CFLAGS -> INTERNAL_CFLAGS.
+ USER_CFLAGS -> CFLAGS. Remove MINUS_G. Default CFLAGS to -g.
+ Pass CFLAGS on recusions.
+
+Fri Apr 17 19:25:57 1992 Fred Fish (fnf@cygnus.com)
+
+ * gdbtypes.h, c-exp.y, m2-exp.y, mipsread.c, gdbtypes.c: Back
+ out of change on 4/14/92 and remove TYPE_FLAG_FUND_TYPE. It was
+ overkill for the problem it solved.
+ * valprint.c (type_print_base): Remove TYPE_FLAG_FUND_TYPE test
+ and default to simply printing type names as appropriate.
+ * main.c (main): Remove one of the leading newlines from
+ warning_pre_print initialization.
+ * objfiles.c (open_existing_mapped_file): Add function and
+ prototype.
+ * objfiles.c (open_mapped_file): Rewrite to use new function
+ open_existing_mapped_file.
+
+Thu Apr 16 23:50:12 1992 John Gilmore (gnu at cygnus.com)
+
+ * sun3-xdep.c (fetch_core_registers): Lint.
+ * tm-sun3.h: Prototype lint.
+ * value.h: Typo.
+
+Thu Apr 16 19:56:50 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (TARGET_FT_POINTER_SIZE, TARGET_FT_LONG_SIZE):
+ Define using TARGET_PTR_BIT and TARGET_LONG_BIT for now.
+ * objfiles.c: Cast calls to close() with unused returns to void.
+ * objfiles.c (allocate_objfile): Initialize objfile's mmfd, free
+ old objfile's name before updating it.
+ * objfiles.c (free_objfile): Major rewrite for mapped objfiles.
+ * objfiles.h (objfile struct): Add mmfd member.
+ * symfile.c (syms_from_objfile): Move some code to
+ new_symfile_objfile.
+ * symfile.c (new_symfile_objfile): Add new function, common code
+ from syms_from_objfile.
+ * symfile.c (symbol_file_add): Call new_symfile_objfile for both
+ mapped and unmapped symbol files.
+ * symfile.c (symbol_file_command): Print "No symbol file now"
+ message, ala exec_file_command for the exec file.
+ * symfile.h (new_symfile_objfile): Add prototype.
+ * xcoffexec.c (map_vmap): Add call to new_symfile_objfile.
+ * xcoffsolib.c (solib_add): Add call to new_symfile_objfile.
+
+Thu Apr 16 18:26:34 1992 Per Bothner (bothner@cygnus.com)
+
+ * rs6000-pinsn.c: New version from IBM (Metin).
+ * m2-exp.y: Re-write string initializers ("<>" => {'<', '>'})
+ to avoid warnings from some compilers.
+
+Tue Apr 14 22:33:55 1992 Fred Fish (fnf@cygnus.com)
+
+ * gdbtypes.h (FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL): Add defines.
+ * gdbtypes.h (TYPE_FLAG_FUND_TYPE): Add define for bit in a
+ type's flag word that marks it as a fundamental type.
+ * c-exp.y (_initialize_c_exp): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type().
+ * m2-exp.y (_initialize_m2_exp): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type(). Also remove
+ dependency on host sizes for ints, floats, etc.
+ * mipsread.c (_initialize_mipsread): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type(). Also remove
+ dependency on host sizes for ints, floats, etc.
+ * gdbtypes.c (lookup_fundamental_type): Add TYPE_FLAG_FUND_TYPE
+ bit to flags argument for all calls to init_type(). Add types
+ FT_FIXED_DECIMAL and FT_FLOAT_DECIMAL.
+ * valprint.c (unsigned_type_table, signed_type_table,
+ float_type_table): Remove.
+ * valprint.c (type_print_base): Test new TYPE_FLAG_FUND_TYPE
+ bit when printing fundamental types, and print the actual name
+ for such types, rather than inventing one. Remove code that
+ invented fundamental type names.
+ * valprint.c (_initialize_valprint): Remove initializations
+ for now removed unsigned_type_table, signed_type_table, and
+ float_type_table.
+
+Tue Apr 14 14:30:46 1992 Stu Grossman (grossman at cygnus.com)
+
+ * remote-vx.c, vx-share/xdr_ptrace.c, vx-share/xdr_ptrace.h,
+ vx-share/xdr_rdb.h: Update for new remote protocol under VxWorks
+ 5.0.2.
+
+Mon Apr 13 20:59:21 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (target_to_host): New function similar to previous
+ swapin function.
+ * dwarfread.c (SWAPIN, swapin): Remove macro and support function.
+ Extensive changes to convert all previous usages to use new
+ target_to_host() function.
+ * dwarfread.c (struct dieinfo): Change types of most integral
+ members to be unsigned.
+
+Mon Apr 13 15:59:10 1992 John Gilmore (gnu at cygnus.com)
+
+ * WHATS.NEW: Revise -mapped doc.
+
+Sat Apr 11 23:14:36 1992 John Gilmore (gnu at cygnus.com)
+
+ * mipsread.c (parse_partial_symbols): Complain when sh->index is
+ too high or when skipping `forwards' moves us backwards.
+ (parse_type): Print mis-guessed tag name in complaint.
+ (parse_external): Eliminate cur_stab and obscure top_stack clobbers.
+ (parse_procedure): Do not attempt to create symbols; just fill in
+ the SYMBOL_VALUE field of a .gdbinfo. symbol if we can find one.
+ (psymtab_to_symtab_1): Split up `stabs' from `native ecoff' code
+ for clarity. Set top_stack before calling parse_external. In
+ stabs, sort symbols before calling parse_procedure.
+ * mipsread.c: Lint.
+ * symmisc.c (std_in, std_out, std_err): Add vars to access std
+ FILE *'s when debugging GDB (e.g. as args to dump_symtab).
+ * Makefile.in: Remove stage* targets. Avoid echo on recursive
+ makes. Eliminate doc/Makefile from tar.Z file if doc/Makefile.in
+ exists.
+
+Fri Apr 10 23:47:37 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in (VERSION): Set to 4.5.1.
+ * xcoffread.c (NO_TYPEDEFS): Fix typo in commented-out #define.
+ * sparc-tdep.c (supply_gregset, fill_gregset, supply_fpregset,
+ fill_gregset): New functions for SVR4 /proc support.
+ * mipsread.c: Cleanup. Add more complaints for unhandled cases.
+ Remove new symbol types and such to ../include/coff/symconst.h.
+ (parse_symbol): Simplify code for parsing struct/enum/unions.
+ (parse_type): Handle `long long' types.
+ (upgrade_type): Handle `const' qualifier.
+ (parse_partial_symbols): fix indentation, clean a bit.
+
+Fri Apr 10 22:41:03 1992 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (SWAPIN,swapin): New macro and function to call to
+ copy in data from raw read buffers, calling bfd byteswapping
+ routines as appropriate. Use to replace most existing memcpy
+ calls.
+ * dwarfread.c (basicdieinfo, completedieinfo): Add objfile arg.
+ * configure.in: Recognize new ncr3000 config.
+ * config/ncr3000.mh: New config file.
+
+Fri Apr 10 08:30:58 1992 Stu Grossman (grossman at cygnus.com)
+
+ GDB-4.5 release!
+
+ * README: Update for release.
+ * Makefile.in: Update version to 4.5.
+ * WHATS.NEW: The obvious.
+
+ * depend: Generate new depend file for this release.
+
+ * Makefile.in (depend): Fix dependancy generation so that it does
+ not include gcc 'fixincluded' files, which are usually in a system
+ specific location.
+
+Thu Apr 9 13:35:00 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik).
+ * buildsym.c (#ifdef RS6000_TARGET): Don't create unnecessary
+ symbols for nameless types. And, handle `R' (register parameter
+ type) for AIX. (an extension to existing stabstring grammar).
+ * rs6000-xdep.c: Fix typo (= should have been ==).
+
+Thu Apr 9 12:10:06 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: version=4.4.88, add xm-vax.h to HFILES.
+
+Thu Apr 9 02:29:03 1992 John Gilmore (gnu at cygnus.com)
+
+ * xm-sun4os5.h (DO_DEFERRED_STORES, CLEAR_DEFERRED_STORES): Zap.
+ * signame.c (SIGWAITING, SIGLWP): Add.
+
+Tue Apr 7 16:34:07 1992 Per Bothner (bothner@cygnus.com)
+
+ * xm-i386mach.h: add decls for errno and strdup().
+
+ * breakpoint.c (breakpoint_1): Add (int) casts for enums
+ used in array index context (otherwise, some compilers barf).
+
+Tue Apr 7 08:45:46 1992 Stu Grossman (grossman at cygnus.com)
+
+ * m68k-tdep.c, tm-sun3.h: #ifdef around get_longjmp_target().
+ Change def of SAVED_PC_AFTER_CALL to call routine to see if we are
+ in a system call, and provide better backtrace if so.
+
+ * Makefile.in (HFILES): Add xcoffsolib.h.
+ * rs6k-opcode.h: Move to ../include/opcode/rs6k.h.
+ * rs6000-pinsn.c: #include "opcode/rs6k.h"
+
+ * mipsread.c (read_mips_symtab, read_the_mips_symtab,
+ mipscoff_symfile_read): Convert to BFD to do file I/O.
+
+ * symfile.c: #include <ctype.h> to get proper def if isspace().
+
+ * i386-tdep.c (get_longjmp_target): #ifdef GET_LONGJMP_TARGET.
+
+Mon Apr 6 17:25:45 1992 Per Bothner (bothner@cygnus.com)
+
+ * mipsread.c: Create a .gdbinfo pseudo-symbol for each
+ function also when parsing embedded stabs.
+
+Mon Apr 6 15:25:03 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c: Fix more declarations.
+
+ * mipsread.c: Fix many invocations of complain. Use enum
+ type_code where appropriate.
+
+ * xm-vaxult.h: Add decl for strdup().
+
+ * Makefile.in: Add dependancies for xm-vaxbsd.h and xm-vaxult.h
+ for xm-vax.h.
+
+Fri Apr 3 17:41:29 1992 Stu Grossman (grossman at cygnus.com)
+
+ * buildsym.h, dbxread.c, mipsread.c: Add objfile arg to
+ process_one_symbol.
+
+Fri Apr 3 12:17:14 1992 Per Bothner (bothner@cygnus.com)
+
+ * munch: Must pre-pend "_" to "initialize" for SYSV style nm.
+ * tm-rs6000.h, xcoffexec.c, xcoffread.c, xm-rs6000.h:
+ Merge in more patches for rs6000 from Metin Ozisik.
+ * utils.c: Fix typo in comment.
+
+Fri Apr 3 11:23:03 1992 Fred Fish (fnf@cygnus.com)
+
+ * procfs.c (procinfo struct): Add nopass_next_sigstop member.
+ * procfs.c (attach): Set nopass_next_sigstop if attached
+ process is forcibly stopped.
+ * procfs.c (child_resume): Use nopass_next_sigstop to suppress
+ resending SIGSTOP to attached process on first resume.
+
+Fri Apr 3 01:37:26 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (SFILES_MAINDIR): add mipsread.c
+
+Thu Apr 2 20:20:54 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in (OBS): Compile mipsread.c for all targets now.
+ (VERSION): Bump to 4.4.85.
+ * mipsread.c: Update for new include files. Lint.
+ * tm-irix3.h, tm-mips.h: Use new include files for ECOFF symtab.
+ * config/{bigmips.mt, littlemips.mt, irix3.mt, decstation.mt}:
+ Don't need to bring in mipsread.o specially any more.
+
+Thu Apr 2 19:38:31 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c (fixup_sigtramp): Also look for _sigtramp as a real
+ routine (for Irix-4.x). Make many funcs static and void.
+ * mips-tdep.c (mips-frame-chain): Clean up, simplify.
+ * (init_extra_frame_info): Don't trash cached value of frame
+ pointer register. This fixes backtracing through routines that use
+ alloca(). Generally clean up declarations of functions, and use
+ typedefs and macros to reference data structures as appropriate.
+ * tm-irix3.h, tm-mips.h (EXTRA_FRAME_INFO): use proper type for
+ proc_desc element.
+
+Thu Apr 2 09:47:11 1992 Fred Fish (fnf@cygnus.com)
+
+ * values.c (unpack_long): Fix unpacking error for signed chars
+ on hosts where the default character type is unsigned.
+ * procfs.c (pr_flag_table, pr_why_table): Add some entries
+ for newer SVR4 variants.
+ * procfs.c (proc_set_exec_trap): Reorder tests for ioctl's that
+ turn off trace inherit-on-fork flag to favor latest SVR4 method.
+ * procfs.c (mappingflags): Add support for MA_PHYS
+
+Thu Apr 2 00:55:56 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (read_struct_type): Avoid coredump when C++
+ abbreviated type name is messed up. Reported by Joe Buck.
+ FIXME, we need to determine whether GDB or GCC needs to be
+ smarter to correctly locate this type name.
+
+ * c-exp.y, coffread.c, command.c, command.h, copying.awk,
+ dbxread.c, gdbtypes.c, infcmd.c, inferior.h, infrun.c,
+ m2-exp.y, printcmd.c, remote.c, solib.c, source.c, stack.c,
+ symtab.c, tm-sun4os4.h, tm-sun4os5.h, values.c: Lint.
+ * symfile.c (add_symbol_file_command): Initialize mapped/readnow.
+
+Wed Apr 1 11:39:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * breakpoint.h (bpdisp, bptype): Remove trailing comma.
+ * symtab.h (current_source_symtab): Make extern
+ * symtab.h (current_source_line): Make extern
+ * inferior.h: Move all procfs.c prototypes to one place, add
+ prototype for proc_signal_handling_change. Add prototypes for
+ signal_stop_state, signal_print_state, and signal_pass_state.
+ * inferior.h (stop_soon_quietly): Make extern
+ * inferior.h (attach_flag): Make extern
+ * infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): Default is null.
+ * infrun.c (signal_stop_state, signal_print_state,
+ signal_pass_state): New functions to query specific signal
+ handling flags.
+ * infrun.c (handle_command): Minor error message change, add
+ NOTICE_SIGNAL_HANDLING_CHANGE.
+ * procfs.c (open_proc_file): Remove iris specific reset of
+ inherit-on-fork flag, moved to proc_set_exec_trap().
+ * procfs.c (proc_set_exec_trap): Add SVR4 and iris code
+ to reset inherit-on-fork flag, bash comment to GNU form.
+ * procfs.c (proc_base_address, set_proc_siginfo,
+ fetch_core_registers): Conform to code style.
+ * procfs.c (signame.h): Include.
+ * procfs.c (MAX_SYSCALLS, syscall_table[], init_syscalltable(),
+ syscallname(), info_proc_syscalls()): New macros, tables, and
+ functions to organize and report system call information.
+ * procfs.c (saved_fltset, saved_trace, saved_sighold,
+ saved_exitset, saved_entryset): Add to procinfo struct.
+ * procfs.c (struct trans): Add.
+ * procfs.c (pr_flag_table, pr_why_table, faults_table,
+ siginfo_table, errno_table): Tables to translate numeric values
+ to symbolic names and short descriptions.
+ * procfs.c (signalname, info_proc_signals): Add function and
+ prototype.
+ * procfs.c (proc_info): Now info_proc.
+ * procfs.c (proc_info_address_map): Now info_proc_mappings.
+ * procfs.c (info_proc_flags, info_proc_stop, info_proc_siginfo,
+ info_proc_faults, lookupname, lookupdesc, sigcodename,
+ sigcodedesc): New functions.
+ * procfs.c (proc_signal_handling_change): New function to set
+ the trace flags based on the state of gdb's signal handling flags.
+ * procfs.c (inferior_proc_init): Call proc_signal_handling_change
+ and remove code to do PIOCSTRACE ioctl.
+ * procfs.c (attach, detach): Preserve and restore process flags
+ using saved_* fields in procinfo struct.
+ * procfs.c (attach): Call proc_signal_handling_change.
+ * procfs.c (info_proc): Major rework to expand "info proc" cmd.
+ * procfs.c (proc_desc): Update for latest changes.
+ * xm-irix4.h (CREATE_INFERIOR_HOOK): Protect by USE_PROC_FS.
+ * xm-irix4.h (NOTICE_SIGNAL_HANDLING_CHANGE): Add definition.
+ * xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): Add definition.
+
+Tue Mar 31 18:38:28 1992 Fred Fish (fnf@cygnus.com)
+
+ * procfs.c (set_proc_siginfo): Add prototype and new function.
+ * procfs.c (detach, child_resume): Call set_proc_siginfo to set
+ up inferior siginfo struct.
+ * elfread.c (elf_symfile_read): Compute the relocation amount
+ by subtracting off the address of the ".text" section.
+ * solib.c: Add pointer to ".text" section to so_list struct.
+ * solib.c (solib_map_sections): Initialize pointer to ".text"
+ section in so_list struct.
+ * solib.c (symbol_add_stub): Pass base address of ".text"
+ section to symbol_file_add, rather than the load address of
+ the shared library. On SunOS they are the same. On SVR4 they
+ are not.
+
+Tue Mar 31 17:48:15 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mipsread.c (parse_procedure): PDR.isym should get pointer to
+ function name, not .gdbinfo. symbol.
+
+Tue Mar 31 17:05:04 1992 John Gilmore (gnu at cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Fix prototype, this time for sure!
+
+Tue Mar 31 11:01:06 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (VERSION): 4.4.8
+
+ * procfs.c (open_proc_file): Disable inherit-on-fork flag so that
+ commands in .cshrc/.profile won't get traced.
+
+Tue Mar 31 08:11:58 1992 John Gilmore (gnu at cygnus.com)
+
+ * elfread.c (elf_symtab_read): Use xmalloc, not bfd_xmalloc.
+ * exec.c (build_section_table): Don't abort if no sections.
+ * sparc-tdep.c (single_step): Lint.
+ * utils.c (mrealloc): Handle realloc (0, size) case here.
+
+Mon Mar 30 16:50:43 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (alldeps.mak): Config files are now *.m[ht] as
+ opposed to m[ht]-*!
+
+ * config/irix4.mh: Don't use coredep.o. It doesn't work with procfs.
+
+ * mipsread.c (parse_symbol, parse_procedure): Re-do the way that
+ .gdbinfo. symbols are created. Move creation from parse_procedure
+ to parse_symbol, where it is fairly easy to grow the symtab. This
+ also fixes a symtab trashing bug on all mips-based systems.
+ * (got_numargs, lookup_numargs, free_numargs): Delete. Not
+ needed anymore.
+ * tm-mips.h, tm-iris3.h, mips-tdep.c, mipsread.c: Re-do struct
+ mips_extra_func_info, and all the PROC_xxx macros that look at it.
+
+Mon Mar 30 14:17:53 1992 Per Bothner (bothner@cygnus.com)
+
+ * c-exp.y: Add missing return type to yyparse() prototype.
+
+Sat Mar 28 22:22:06 1992 John Gilmore (gnu at cygnus.com)
+
+ Create and use macros for iterating on symtabs, psymtabs, msymbols.
+
+ * minsyms.c (iterate_over_msymbols): Remove; clunky and slow.
+ * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype
+ * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS.
+ (patch_opaque_types): Avoid dummy args and result.
+ * objfiles.c (have_partial_symbols, have_full_symbols,
+ have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify.
+ (iterate_over_objfiles, iterate_over_symtabs,
+ iterate_over_psymtabs): Remove, clunky and slow.
+ * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS,
+ ALL_PSYMTABS, and ALL_MSYMBOLS macros.
+ * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols,
+ dump_objfile): Remove dummy args and results. Move filename
+ comparisons to callers.
+ (printsyms_command, printpsyms_command, printmsyms_command,
+ printobjfiles_command): iterate_over_* => ALL_*. Compare filenames.
+ * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab,
+ lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info,
+ list_symbols, make_symbol_completion_list): Replace explicit
+ iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS.
+ Eliminate Dijkstra flag crap, break out of loops with gotos.
+ (lookup_symtab_1): Protect '/' tests from short filenames.
+ (cplus_mangled_symbol): Move inline into lookup_symbol.
+ * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack.
+ (relocate_minimal_symbol): Move inline to vmap_symtab.
+ (vmap_symtab): Replace iteration with ALL_OBJFILES,
+ iterate_over_msymbols with ALL_MSYMBOLS.
+
+ Misc cleanup prior to release.
+
+ * Makefile.in (VERSION): Roll to 4.4.7.
+ (HFILES): Add call-cmds.h.
+ * call-cmds.h: New header for command fns called by other files.
+ * breakpoint.c (watchpoints_info): Remove, same as breakpoints_info.
+ (breakpoint_1): Remove unused type arg. Change callers.
+
+ * dwarfread.c (dwarf_build_psymtabs): Remove mainline test.
+ * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused.
+ * mipsread.c: Add prototypes for all static functions.
+
+ * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab,
+ dump_blockvector, dump_block, dump_addrchass, dump_namespace,
+ dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused.
+ * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab,
+ dump_blockvector, dump_block, dump_addrchass, dump_namespace,
+ dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd
+ unused copy!
+
+ * buildsym.c (define_symbol): Handle global register variables
+ (from Pierre Willard). Complain if register numbers are too large.
+ * target.c (nomemory): Now that higher levels examine errno, give EIO.
+ * tm-sparc.h: Don't #include <sun4/reg.h>.
+ * sparc-tdep.c (sparc_frame_chain, frame_saved_pc): Remove
+ dependency on <sun4/reg.h>. Start to handle cross-byte-order.
+
+ * language.h: Avoid forward enum declaration.
+ * configure.in, tm-sun4os5.h, xm-sun4os5.h, config/sun4os5.mh,
+ config/sun4os5.mt: New host and target.
+ * defs.h (errno): #include <errno.h> rather than assuming int.
+ From Pierre Willard.
+
+ * breakpoint.c, breakpoint.h, buildsym.c, coffread.c, cplus-dem.c,
+ dbxread.c, dwarfread.c, elfread.c, infcmd.c, infrun.c, inftarg.c,
+ language.c, main.c, mem-break.c, mips-tdep.c, mipsread.c,
+ partial-stab.h, remote.c, saber.suppress, symfile.c, symtab.c,
+ valops.c, valprint.c, xcoffread.c, c-exp.y, m2-exp.y, blockframe.c,
+ command.c, core.c, exec.c, gdbtypes.h, parse.c, printcmd.c, solib.c,
+ sparc-xdep.c, utils.c, value.h, values.c: Lint.
+
+Sat Mar 28 02:43:26 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (read_range_type): Avoid int overflow by using unsigned.
+ * dbxread.c (dbx_symfile_init): Remove bogus `lvalue cast'.
+ * language.h (enum exp_opcode): Avoid forward enum def.
+ * main.c (define_command, user_defined_command): Lint.
+ * mem-break.c, xcoffread.c: Lint.
+ * solib.c: Only #include <a.out.h> on SunOS, not SVR4.
+
+Sun Mar 29 14:16:22 1992 Per Bothner (bothner@cygnus.com)
+
+ * Merged in latest RS6000 diffs from Metin G. Ozisik.
+ * xcoffsolib.c, xcoffsolib.h: New files, from Metin.
+ * Various files: Changed #ifdef IBM6000 to IBM6000_HOST
+ or IBM6000_TARGET as (approximately) appropriate.
+
+Sat Mar 28 13:00:10 1992 Fred Fish (fnf@cygnus.com)
+
+ * objfiles.h (OBJF_SYMS): Define flag bit for objfile flags.
+ * symfile.c (symbol_file_add): Use OBJF_SYMS to decide whether
+ or not to try reading symbols from a mapped objfile. Plugs memory
+ leak due to shared libraries generating no psymtabs or symtabs.
+
+Fri Mar 27 15:44:55 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (MAX_OF_C_TYPE, MIN_OF_C_TYPE): Unused, remove.
+ * copying.awk: Lint. Make stronger warning at top of copying.c.
+ * elfread.c (elf_symtab_read): Eliminate check of mainline.
+ * gdbtypes.c (smash_to_*): Remove FIXME comments.
+ (lookup_pointer_type): Add FIXME comment.
+ * main.c (set_history_size_command): Disallow negative size.
+ * partial-stab.h: Update copyright.
+ * rs6000-tdep.c (skip_trampoline_code): Better comments.
+
+Wed Mar 25 10:45:38 1992 John Gilmore (gnu at cygnus.com)
+
+ * main.c (set_history_size_command): Negative size is error.
+ (Reported by Peggy Fieland.)
+
+Thu Mar 26 17:01:18 1992 Fred Fish (fnf@cygnus.com)
+
+ * coffread.c (coff_symfile_init): Update comment.
+ * dbxread.c (DBX_SYMFILE_INFO, DBX_TEXT_SECT, DBX_SYMCOUNT,
+ DBX_STRINGTAB, DBX_STRINGTAB_SIZE, DBX_SYMTAB_OFFSET): Define
+ macros to access the dbx specific objfile information.
+ * dbxread.c (symfile_string_table, symfile_string_table_size):
+ Remove these local variables.
+ * dbxread.c (read_ofile_symtab, psymtab_to_symtab_1,
+ read_dbx_symtab): Remove the stringtab and stringtab_size params
+ from the function prototypes, the function definition, and the
+ function calls. These are now available via DBX_STRINGTAB and
+ DBX_STRINGTAB_SIZE using the objfile pointer.
+ * dbxread.c (dbx_symfile_read): Relocate addr before using as
+ an arg to read_dbx_symtab.
+ * dbxread.c (dbx_symfile_read): Remove code that free'd the
+ stringtab and the dbx specific per-objfile private info.
+ * dbxread.c (init_psymbol_list): Remove symbol count from passed
+ args in prototype, function definition, and function calls. It is
+ now available via the DBX_SYMCOUNT macro using the objfile
+ pointer.
+ * dbxread.c (dbx_symfile_read, dbx_symfile_init): Remove the
+ local instance of struct dbx_symfile_info and replace with DBX_*
+ macros.
+ * dbxread.c (dbx_symfile_read): Remove init's of now deleted
+ symfile_string_table and symfile_string_table_size.
+ * dbxread.c (dbx_symfile_finish): Remove now obsolete free of
+ symfile_string_table.
+ * dbxread.c (init_psymbol_list): Use DBX_SYMCOUNT.
+ * dbxread.c (dbx_psymtab_to_symtab): Remove local stringtab and
+ stringtab size variables. Remove all code that used to reread
+ the stringtab.
+ * objfiles.c (allocate_objfile): Move calls to init_malloc()
+ to prior to any calls to mmalloc for the objfile specific heap.
+ * utils.c (init_malloc): Document the requirement that for each
+ heap for which corruption checking is desired, that init_mmalloc
+ must be called prior to any mmalloc calls on the heap.
+
+Thu Mar 26 13:20:06 1992 Per Bothner (bothner@cygnus.com)
+
+ * rs6000-pinsn.c: Make dis-assembly output more like
+ other targets: Don't print instruction in hex before
+ the assembly; use print_address to print out jump
+ destinations.
+
+Wed Mar 25 16:52:35 1992 Per Bothner (bothner@cygnus.com)
+
+ * c-exp.y, gdbtypes.h: Add builtin_type_signed_char.
+ * cplus-dem.c: Support "Sc" meaning "signed char".
+
+Wed Mar 25 15:21:44 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: fix iris/iris3.
+
+Wed Mar 25 14:55:48 1992 Per Bothner (bothner@cygnus.com)
+
+ * command.c, main.c (various places): Use ctype.h macros
+ (such as isupper(x)), instead of hard-wiring in ASCII-isms
+ (such as (x >= 'A' && x <= 'Z')).
+ (There are still more of these in other files.)
+ * main.c (defined_command): Lower-case the user's
+ new command before entering it. Needed because
+ command lookup is case-insensitive (and also lower-cases).
+ (Based on Metin's earlier patch.)
+
+Tue Mar 24 23:27:01 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * config/irix4.mh: new file.
+
+Tue Mar 24 14:17:48 1992 Stu Grossman (grossman@cygnus.com)
+
+ * infcmd.c (step_1): Call disable_longjmp_breakpoint at the right
+ time.
+
+ * xm-mips.h: Declare strdup for ultrix.
+
+ * mipsread.c (fixup_sigtramp): Make sure that current_objfile is setup
+ when calling new_symbol.
+ * mips-tdep.c (mips_frame_chain): Use symfile_objfile instead of
+ current_objfile.
+
+Tue Mar 24 13:26:25 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * config/rs6000.mh: Update (for Fred's new mmalloc)
+ flags to disable use of GNU malloc/mmalloc.
+ * munch: Change SYSV rule to allow .text before the label,
+ as well as after, to work for AIX.
+ * gdbtypes.h: Minor clarifiction.
+
+Tue Mar 24 07:26:19 1992 Michael Tiemann (tiemann@cygnus.com)
+
+ * buildsym.c (read_struct_type): Handle cretinous dbx symbol name
+ continuation in yet another place (between method declarations).
+
+Mon Mar 23 23:01:41 1992 Stu Grossman (grossman at cygnus.com)
+
+ * mips-tdep.c: include symfile.h and objfiles.h to fix
+ compilation errors.
+
+Mon Mar 23 15:49:14 1992 Per Bothner (bothner@cygnus.com)
+
+ * valops.c (value_struct_elt_for_reference): Added 'offset'
+ parameter to handle multiple inheritance.
+ * eval.c, value.h: Update accordingly.
+
+Fri Mar 20 17:43:27 1992 Fred Fish (fnf@cygnus.com)
+
+ * objfiles.h: New file
+ * Makefile.in (HFILES): Add objfiles.h
+ * blockframe.c: Remove entry_scope_lowpc, entry_scope_highpc,
+ main_scope_lowpc, main_scope_highpc.
+ * blockframe.c, buildsym.c, coffread.c, dbxread.c, dwarfread.c,
+ elfread.c, gdbtypes.h, minsyms.c, mipsread.c, objfiles.c, solib.c,
+ source.c, symfile.c, symmisc.c, symtab.c, target.c, xcoffexec.c,
+ xcoffread.c, : Include objfiles.h.
+ * tm-29k.h, tm-i386v.h, tm-merlin.h, tm-rs6000.h, tm-sun386.h,
+ tm-symmetry.h, tm-tahoe.h, tm-umax.h, tm-vax.h, m88k-tdep.c,
+ mips-tdep.c (FRAME_CHAIN): Renamed outside_startup_file to
+ inside_entry_file() and logic changed appropriately.
+ * blockframe.c (outside_startup_file): Renamed to
+ inside_entry_file() and logic changed appropriately.
+ * blockframe.c (inside_main_scope): Renamed to inside_main_func()
+ and logic changed to use per-objfile specific fields.
+ * blockframe.c (inside_entry_scope): Renamed to
+ inside_entry_func() and logic changed to use per-objfile specific
+ fields.
+ * blockframe.c, buildsym.h, coffread.c, dwarfread.c, mipsread.c,
+ symfile.c, mips-tdep.c (startup_file_start, startup_file_end):
+ Remove extern decls.
+ * symfile.c, symfile.h (entry_point): Remove extern decl.
+ * coffread.c (coff_symfile_init): Common entry point init code
+ moved to symfiles.c, call init_entry_point_info().
+ * coffread.c (complete_symtab): Use new per-objfile entry info.
+ * mip-tdep.c (mips_frame_chain): Use new per-objfile entry info.
+ * mipsread.c (parse_partial_symbols): Use new per-objfile entry
+ info.
+ * dbxread.c (read_dbx_symtab): Use new per-objfile entry info.
+ * defs.h (inside_entry_scope, outside_startup_file,
+ inside_main_scope): Prototypes changed for renames to
+ inside_entry_func, inside_entry_file, inside_main_func,
+ respectively.
+ * symfile.c (syms_from_objfile): Common entry point init code
+ moved to init_entry_point_info() and call init_entry_point_info().
+ * symfile.h (init_entry_point_info): Include prototype.
+ * xcoffread.c (aixcoff_symfile_init): Common entry point init code
+ moved to symfiles.c and call init_entry_point_info().
+ * dwarfread.c (entry_scope_lowpc, entry_scope_highpc,
+ main_scope_lowpc, main_scope_highpc): Remove extern decls.
+ * dwarfread.c (read_func_scope, read_file_scope): Use new per-
+ objfile entry info.
+ * frame.h (FRAME_CHAIN_VALID): Provide default definition that
+ works for the majority of targets.
+ * tm-68k.h, tm-convex.h, tm-h8300.h, tm-i386v.h, tm-irix3.h,
+ tm-merlin.h, tm-mips.h, tm-pyr.h, tm-rs6000.h, tm-sparc.h,
+ tm-sun386.h, tm-tahoe.h, tm-umax.h, tm-vax.h (FRAME_CHAIN_VALID):
+ Use default definition in frame.h.
+ * frame.h (selected_frame_level): Make decl extern.
+ * objfiles.c, symfile.c (current_objfile): Moved to objfiles.c
+ * objfiles.c, symfile.c (symfile_objfile): Moved to objfiles.c
+ * partial-stab.h: Use new per-objfile entry info.
+ * symfile.h (struct objfile): Removed, moved to objfiles.h.
+ * symfile.h, objfiles.h (allocate_objfile, free_objfile,
+ free_all_objfiles, iterate_over_objfiles, iterate_over_symtabs,
+ iterate_over_psymtabs, have_partial_symbols, have_full_symbols,
+ have_minimal_symbols): Prototypes moved to objfiles.h.
+ * symfile.h, objfiles.h (ALL_OBJFILES, ALL_OBJFILES_SAFE):
+ Macros moved to objfiles.h.
+ * tm-h8300.h, tm-i386v4.h (FRAME_CHAIN_VALID_ALTERNATE): Define.
+
+Thu Mar 19 18:49:45 1992 Per Bothner (bothner@cygnus.com)
+
+ More C++ improvements (pointers to members, qualified names).
+ * c-exp.y: Support exp.type::name and exp->type::name
+ syntaxes. (Unfortunately, doesn't work for static members.)
+ * c-exp.y, eval.c: Make type::~type work better.
+ * eval.c (evaluate_subexp: OP_SCOPE): Replace use of
+ value_static_field by value_struct_elt_for_reference.
+ * eval.c (evaluate_subexp): Merge code for STRUCTOP_MEMBER
+ and STRUCTOP_MPTR; cast arg1 to domain-type of arg2.
+ * eval.c (evaluate_subexp): Remove special case for UNOP_ADDR
+ for OP_SCOPE operand; no point in it now that we use lazy
+ reading of values, and use "reference to member" objects.
+ * gdbtypes.h: Clarify comment.
+ * valops.c: Change value_struct_elt_for_address to return
+ a reference (or variable), rather than a pointer. Change
+ the name to value_struct_elt_for_reference to reflect this.
+ Returning a reference instead of a address provides a
+ generalization, since we can use the routine for both
+ class::name as well as &class::name.
+ Also, recurse to handle multiple inheritance properly.
+ * valprint.c: Moved code to print pointer-to-members
+ to new function point_class_member. This allows a
+ "reference-to-member" to be printed using the same code.
+ * valprint.c (type_print_varspec_prefix): Avoid printing
+ "struct " for domains of class-member types.
+ * valops.c (search_struct_field): Inline code for simplified
+ version of value_static_field (which can then be deleted).
+ * value.h: Rename value_struct_elt_for_address to
+ value_struct_elt_for_reference. Delete value_static_field.
+ * values.c: Remove no longer used function value_static_field.
+
+Thu Mar 19 13:54:11 1992 Fred Fish (fnf@cygnus.com)
+
+ * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c,
+ elfread.c (coff_symfile_finish): Add function, prototype, and
+ add to the xxxx_sym_fns struct for each file type. Also reformat
+ the xxxx_sym_fns vector to a standard format and add comments.
+ * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c,
+ elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read):
+ Pass pointer to struct objfile rather than pointer to sym_fns.
+ Change references inside each function accordingly. Allocate any
+ symbol file specific info in the per-objfile memory region.
+ * dbxread.c (free_and_init_header_files): Break function into
+ free_header_files(), called from dbx_symfile_finish(), and
+ init_header_files(), called from dbx_new_init().
+ * dbxread.c (dbx_new_init): Move deallocation things to new
+ dbx_symfile_finish function.
+ * elfread.c (elf_new_init): Call buildsym_new_init().
+ * objfiles.c (free_objfile): Call the appropriate symfile_finish()
+ routine for the objfile before deallocating other stuff.
+ * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg.
+ * symfile.h: Move struct sym_fns to before struct objfile def.
+ Add sym_finish function pointer and change prototypes of other
+ function pointers to reflect passing struct objfile pointer rather
+ than struct sym_fns pointer.
+ * symfile.c: Remove now obsolete symtab_fns pointer.
+ * symfile.c (symfile_init): Renamed to find_sym_fns, and now only
+ locates the correct sym_fns struct for the given objfile.
+ * symfile.c (syms_from_objfile, symbol_file_add): Restructured
+ for better support of mapped symbol tables.
+ * symfile.c (symbol_file_command): Remove obsolete code using
+ symfile_fns.
+ * symfile.h: Remove duplicate declarations for symfile_objfile,
+ entry_point, and object_files.
+ * target.c (target_info): Compare symfile_objfile to NULL.
+ * xcoffread.c (aixcoff_new_init): Move deallocation stuff to
+ aixcoff_symfile_finish().
+
+Wed Mar 18 18:22:46 1992 Fred Fish (fnf@cygnus.com)
+
+ * infrun.c (IN_SOLIB_TRAMPOLINE): Add default definition.
+ * infrun.c (wait_for_inferior): Use IN_SOLIB_TRAMPOLINE.
+ * tm-sysv4.h (IN_SOLIB_TRAMPOLINE): Add SVR4 definition.
+
+Wed Mar 18 15:51:15 1992 Per Bothner (bothner@cygnus.com)
+
+ Some improvements to g++ debugging.
+ * symtab.c (list_symbols): demangle before pattern matching.
+ * symtab.c: Other fixes to improve handing of operators.
+ * valprint.c (type_print_base): Fix test for constructor.
+ * values.c (value_static_field): Allow evaluation of
+ CLASS::METHOD, returning a function pointer.
+
+Wed Mar 18 08:39:52 1992 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Roll 4.4.6.
+ * exec.c (exec_file_command): Add code to ignore optional args
+ passed in by file_command() for use in symbol_file_command().
+ * main.c (main): Document -mapped and -readnow in help summary.
+ * objfiles.c (open_mapped_file): Cosmetic change, arg renamed.
+ * objfiles.c (allocate_objfile): Filename arg removed. Changes
+ to get filename from bfd with bfd_get_filename(). Test mapto
+ against 0, not NULL. Use mstrsave() to make copy of filename.
+ * remote-mm.c (mm_load): Symbol_file_add() takes an additional
+ arg.
+ * remote-vx.c (vx_load_command, add_symbol_stub):
+ Symbol_file_add() takes an additional arg.
+ * solib.c (symbol_add_stub): Symbol_file_add() takes an
+ additional arg.
+ * symfile.c (symfile_open): Renamed to symfile_bfd_open and
+ changed to return a bfd not an objfile pointer.
+ * symfile.c (syms_from_objfile): Eliminate local copy of bfd.
+ * symfile.c (symbol_file_add): Takes an additional arg (readnow).
+ Change to eliminate local bfd and use symfile_bfd_open() plus
+ allocate_objfile(). Add code to implement readnow option.
+ * symfile.c (symbol_file_command): Changes to option handling,
+ readnow functionality moved to symbol_file_add().
+ * symfile.c (symfile_init): Eliminate local copy of bfd.
+ * symfile.c (add_symbol_file_command): Changes to parse mapped
+ and readnow options.
+ * symfile.h (allocate_objfile): Arg removed from prototype.
+ * symtab.h (symbol_file_add): Arg added to prototype.
+ * xcoffexec.c (map_vmap): Allocate_objfile() takes an additional
+ arg.
+
+Sat Mar 14 16:38:47 1992 Fred Fish (fnf@cygnus.com)
+
+ * gmalloc.c, gmalloc.h mcheck.c mmap-alloc.c mmap-sbrk.c mtrace.c,
+ mtrace.awk, state.c, state.h: Removed.
+ * .gdbinit: Add ../malloc, ../libiberty, and ../bfd to list of
+ directories searched for source files.
+ * Makefile.in (GNU_MALLOC, MALLOC_CFLAGS, MALLOCSRC): Removed
+ * Makefile.in (MMALLOC_DIR, MMALLOC_DEP, MMALLOC_LIB,
+ MMALLOC_DISABLE, MMALLOC_CHECK, MMALLOC_CFLAGS): Add
+ * Makefile.in (CFLAGS): Replace MALLOC_CFLAGS with MMALLOC_CFLAGS.
+ * Makefile.in (CLIBS, CDEPS): Add MMALLOC_LIB
+ * Makefile.in (ADD_FILES, ADD_DEPS): Remove GNU_MALLOC.
+ * Makefile.in (SFILES_MAINDIR): Remove stat.c mmap-alloc.c, mmap-
+ sbrk.c
+ * Makefile.in (HFILES): Remove state.h
+ * Makefile.in (POSSLIBS_MAINDIR): Remove MALLOCSRC.
+ * Makefile.in (OBS): Remove state.o mmap-alloc.o mmap-sbrk.o
+ * Makefile.in (saber_gdb): Remove mcheck, mtrace. Add MMALLOC_DIR.
+ * Makefile.in (clean): Remove all object files.
+ * c-exp.y: Define malloc to xmalloc and realloc to xrealloc.
+ * cplus-dem.c: Remove prototypes definitions that are now done in
+ def.h.
+ * dbxread.c (throughout): Change from using per-objfile
+ xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree.
+ * defs.h: Remove prototypes for mmap_* functions. Add prototypes
+ for xmmalloc, xmrealloc, mfree, mmcheck, mmtrace, mmalloc_attach,
+ mmalloc_detach, mmalloc_setkey, msavestring, and mstrsave, nomem.
+ * depend: Remove dependencies for state.o, state.h.
+ * dwarfread.c: Add declaration for warning_pre_print.
+ * dwarfread.c (dwarfwarn): Use warning_pre_print.
+ * dwarfread.c (throughout): Change from using per-objfile
+ xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree.
+ * gdbtypes.c (lookup_fundamental_type): Fix init_type calls to
+ use supplied objfile.
+ * i386-xdep.c (print_387_status): Change to use warning() rather
+ than printfs.
+ * i387-tdep.c (print_387_control_word): Change to use warning()
+ rather than printfs.
+ * infrun.c (wait_for_inferior): Remove unreachable abort() call
+ that some compilers grumble about.
+ * language.c (throughout): Add declaration for warning_pre_print
+ and using warning() instead of printfs.
+ * m2-exp.y: Define malloc to xmalloc and realloc to xrealloc.
+ * main.c (main): Add declaration for warning_pre_print and set it
+ similarly to error_pre_print. Add declarations for
+ mapped_symbol_files and readnow_symbol_files. Add appropriate
+ definitions to long_options[].
+ * minsyms.c: Trivial fix to comment.
+ * objfiles.c (allocate_objfile): Substantially rewritten for
+ using mapped symbol files.
+ * objfiles.c (throughout): Change from using per-objfile
+ xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree.
+ * objfiles.c (open_mapped_file, mapped_to_address): Add functions.
+ * source.c (throughout): Change from using per-objfile
+ xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree.
+ * source.c (open_source_file): Use mstrsave to save file name in
+ mapped symbol region for objfile.
+ * symfile.c: Remove include for state.h.
+ include to local form.
+ * symfile.c (symbol_file_add_digested): Remove.
+ * symfile.c (symbol_file_add): Substantially rewritten for mapped
+ symbol files.
+ * symfile.h: Remove malloc/xrealloc/xmalloc/xrealloc/free members
+ from objfile structure. Add malloc descriptor pointer (md).
+ * symfile.h (OBJF_DUMPABLE): Changed name to OBJF_MAPPED.
+ * symm-xdep.c (print_fpu_status): Use warning() rather than
+ printfs.
+ * symmisc.c (free_symtab_block): Now takes and uses current
+ objfile pointer.
+ * symmisc.c (throughout): Change from using per-objfile
+ xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree.
+ * symtab.c (cplus_mangled_symbol): Cast return value to avoid
+ Sun compiler grumblings when PTR is char *.
+ * symtab.c (lookup_symbol): Cast return value of iterate_over_
+ msymbols() to correct pointer type.
+ * utils.c (warning_pre_print): Initialize to "\nwarning: ".
+ * utils.c (fatal, fatal_dump_core): Ensure that the fatal
+ error always starts on a line of it's own.
+ * utils.c (init_malloc, malloc_botch, xmalloc, xrealloc):
+ Rewrite for new mapped malloc package use.
+ * utils.c (mmalloc, mrealloc, mfree): Stubs for configurations
+ that don't want to use the mapped malloc package; pass arguments
+ on to traditional malloc package functions.
+ * utils.c (nomem): Add for fatal virtual memory exhausted aborts.
+ * utils.c (xmmalloc, xmrealloc, xmalloc, xrealloc): Like mmalloc,
+ mrealloc, malloc, and realloc but get fatal error if runs out
+ of memory.
+ * utils.c (msavestring, mstrsave): Save a string in a specific
+ mapped malloc region.
+ * utils.c (print_spaces): Use xmalloc to get the buffer.
+ * xm-amix.h, xm-i386v4.h, xm-sun3os4.h, xm-sun4os4.h: Add defines
+ for MMAP_BASE_ADDRESS and MMAP_INCREMENT.
+ * config/i386v4.mh: Insignificant reorganization.
+
+Sat Mar 14 11:44:47 1992 Fred Fish (fnf@cygnus.com)
+
+ * xcoffread.c: Only enable compilation of debugging functions
+ if IBM6000 is defined. Fails to compile otherwise.
+
+Fri Mar 13 15:51:11 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: pass MAKEINFO down on info.
+
+Fri Mar 13 12:56:36 1992 John Gilmore (gnu at cygnus.com)
+
+ * mipsread.c (mipscoff_symfile_read): Eliminate a lot of
+ useless code, including an lseek to an uninitialized variable.
+ Reported by Jim Williams <jimbo@wrs.com>.
+
+Thu Mar 12 11:56:46 1992 Per Bothner (bothner@cygnus.com)
+
+ Merged in patches from metin@ibmpa.awdpa.ibm.com (Metin G.
+ Ozisik) (dated Fri, 6 Mar 92 17:51) for the rs6000.
+ * minsyms.c, symfile.c: Changes that may be generally
+ applicable, but are #ifdef IBM6000 for now.
+ * rs6000-xdep.c: Fixed typo in comment.
+ * rs6000-tdep.c: Non-substatial changes.
+ * xoffread.c: The main change here is addition of some
+ debugging functions.
+ * xoffexec.c: More changes.
+
+ * xcoffread.c: Fixed two too-few-parameters bugs.
+
+ * solib.h, infrun.c, tm-rs6000.h: Add a PID parameter
+ to SOLIB_CREATE_INFERIOR_HOOK macro.
+
+Sun Mar 8 21:17:48 1992 Fred Fish (fnf@cygnus.com)
+
+ * symfile.h: Add prototype for iterate_over_msymbols().
+ * symtab.c (cplus_mangled_symbol): Add function.
+ * symtab.c (lookup_symbol): Call cplus_mangled_symbol via
+ iterate_over_msymbols to find demangled C++ symbol.
+ * xcoffexec.c (relocate_minimal_symbol): Return meaningful
+ value to iterate_over_msymbols().
+ * xcoffexec.c (vmap_symtab): Ignore return from iterate_over_
+ msymbols().
+
+Fri Mar 6 21:59:34 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: added check target.
+
+Thu Mar 5 23:56:01 1992 John Gilmore (gnu at cygnus.com)
+
+ * ecoff.c: Move to ../bfd/coff-msym.c.
+ * config/mt-*mips: Remove ecoff.o from the configuration.
+ * remote.c (): Add newline to initial +.
+ (remote_resume): Mention how to cope with signals.
+ (remote_interrupt): Add debug msg.
+ (remote-wait): Implement new 'T' reply, which includes
+ status, PC, and FP all in a single short message.
+ (putpkt): Add further debugging of packet acks.
+ * mipsread.c (fixup_symtab): Also swap RFD's.
+ (parse_partial_symbols): Avoid bug on unknown symbol types.
+ * Makefile.in (VERSION): Roll to 4.4.5.
+ * mips-tdep.c (heuristic_proc_start): Avoid long delays
+ for remote MIPS by limiting heuristic to 200 byte search.
+ (heuristic_proc_desc): Byte-swapping.
+ (mips_print_register): Cope with failure of
+ read_relative_register_raw_bytes. Byte-swap integers for
+ printing.
+ * mips-pinsn.c (print_insn): Byte-swap instruction.
+
+Thu Mar 5 12:32:09 1992 Stu Grossman (grossman at cygnus.com)
+
+ * config.sub configure.in config/mh-irix4
+ gdb/configure.in gdb/mips-tdep.c gdb/mipsread.c
+ gdb/procfs.c gdb/signame.h gdb/tm-irix3.h gdb/tm-mips.h
+ gdb/xm-irix4.h gdb/config/mt-irix3
+ gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x.
+
+Wed Mar 4 11:56:42 1992 Fred Fish (fnf@cygnus.com)
+
+ * defs.h, utils.c: xrealloc takes PTR as first arg.
+ * defs.h: Reword confusing comment about ANSI prototypes.
+ * defs.h: Some minor whitespace changes.
+ * infrun.c (wait_for_inferior): Compare int tmp to int 0,
+ not NULL, which can be (void *).
+ * tm-amix.h, tm-i386v4.h: Add defines for setjmp/longjmp handling.
+ * tm-i386v.h (SP_ARG0): Define
+ * xm-sysv4.h: Back out of change for missing prototypes.
+ * i386-tdep.c (get_longjmp_target): Add function.
+
+Wed Mar 4 05:46:11 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: install man page too.
+
+Tue Mar 3 15:11:52 1992 Michael Tiemann (tiemann@cygnus.com)
+
+ * All GDB files that #include defs.h: Removed stdio.h.
+ (defs.h): #include stdio.h.
+
+Mon Mar 2 23:00:12 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * gdbtypes.c (lookup_pointer_type): initialize the TYPE_LENGTH of
+ a ptype to reflect the setting of TARGET_PTR_BIT. Set the
+ TYPE_FLAGS of a ptype to TYPE_FLAG_UNSIGNED.
+ * tm-h8300.h, h8300-tdep.c, remote-hms.c: personal checkpoint
+ * printcmd.c (print_address): if ADDR_BITS_REMOVE is defined, use
+ it before printing out the hex shape of an address.
+
+Sun Mar 1 17:41:09 1992 Per Bothner (bothner@cygnus.com)
+
+ * rs6000-xdep.c (frame_initial_stack_address): Move
+ code to set frame->cache_fsr into new separate function
+ frame_get_cacahe_fsr. This allows fixing a fatal error.
+ * xcoffexec.c: Turn previously suppressed error
+ message back on, after cleaning up BFD.
+
+ * breakpoint.c (breakpoint_re_set): Removed (at least for now)
+ printing of blank line, since it cases printing of an
+ extra blank line. Is this intended? It does mess up
+ gdb test suite.
+ * defs.h: Put back declarations of malloc and realloc,
+ but protected by #ifndef MALLOC_INCOMPATIBLE.
+ * objfiles.c: Undo previous change: Use malloc/realloc
+ for objfile malloc/realloc fields (but add a cast).
+ * xcoffexec.c: Suppress an error message (for now).
+
+Sat Feb 29 14:43:02 1992 Per Bothner (bothner@cygnus.com)
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Fri, 21 Feb 92 13:14:54 -0800]
+ * buildsym.c: Use smash_to_pointer_type() to handle forward type
+ references.
+ * xcoffread.c: Modifications to C_DECL storage class handling, and
+ introduction of an old smash_to_pointer_type() routine.
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Thu, 20 Feb 92 13:57:16 -0800]
+ * rs6000-xdep.c, rs6000-tdep.c, tm-rs6000.h: function_frame_info()
+ parameters have been modified.
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Thu, 20 Feb 92 10:10:05 -0800]
+ * rs6000-tdep.c: Before Feb 5 92, register_valid[] array was not used,
+ and fetch_inferior_registers() always fetched all the registers
+ resulting valid register values at hand all the time. Pushing a dummy
+ frame did not require validating all register values first. After
+ putting the above mechanism into action, we didn't have valid registers
+ values always ready. Thus, all registers need to be fetched before
+ pushing a dummy frame now.
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Thu, 13 Feb 92 16:22:44 -0800]
+ * rs6000-xdep.c: frame_initial_stack_address() function to calculate
+ the starting address (actual frame address) of a frame.
+ * rs6000-tdep.c: modifications to function_frame_info() to see if
+ function reserves a frame pointer register (alloca register)
+ * tm-rs6000.h: EXTRA_FRAME_INFO, FRAME_ARGS_ADDRESS and
+ FRAME_LOCALS_ADDRESS has been updated to support debugging of
+ functions with alloca() calls.
+
+Sun Mar 1 13:13:39 1992 Fred Fish (fnf@cygnus.com)
+
+ * xm-sysv4.h: Provide definitions/prototypes for host environment
+ functions for which no definitions or prototypes are provided in
+ any currently included gdb or host environment header files.
+ For SVR4, this currently includes malloc and realloc, which cannot
+ be portably prototyped in any gdb include file.
+
+Sat Feb 29 14:43:02 1992 Per Bothner (bothner@cygnus.com)
+
+ * buildsym.h: Remove obsolete variable file_stabs.
+
+ * Makefile.in: Move place where configure merges in host-
+ and target-dependent fragments later, so the latter
+ can override (say) GNU_MALLOC.
+ * config/mh-rs6000: Use system malloc. Otherwise, I
+ ended up with *two* incompatible versions of malloc
+ (functions in libc would call the malloc in libc).
+ I assume this is a shared library problem.
+
+ * remote.c: Fix (presumed) typo.
+ * objfiles.c: Use xmalloc/xrealloc instead of
+ malloc/realloc (since the latter are no longer declared).
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Thu, 6 Feb 1992 10:22:02 -0800]
+ * rs6000-xdep.c: Improvements to fetch_inferior_registers() to
+ handle individual registers.
+ * tm-rs6000.h: Fix SAVED_PC_AFTER_CALL macro to handle pc value
+ correctly in case it wasn't cached yet. (A problem showed up
+ after fetching individual registers.)
+ * buildsym.c: Disable type_synonym_name's type name overwriting
+ in cases it is unnecesary. rs6000 portation doesn't use
+ type_synonym_name, and it used to nullify type names
+ * xcoffread.c: to handle g++'s typename abbreviation, fill in a
+ type's name as soon as space for that type is allocated.
+ * xcoffread.c: ignore a section's lineno information if it is
+ not `.text'. (In rs6000 bfd portation integration, skipping over
+ `.pad' sections are ignored since it was in machine independent
+ part of the code. Thus, a problem of fake sections with invalid
+ lineno information arised.)
+
+ Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik)
+ [Mail dated Thu, 6 Feb 1992 13:26:22 -0800]
+ * rs6000-tdep.c: make function_frame_info() work whether or not
+ reading from a core file.
+ * tm-rs6000.h: Implementation of FRAME_FIND_SAVED_REGS macro.
+
+ * infrun.c. main.c, printcmd.c. symtab.c:
+ More changes from IBM for rs6000.
+
+
+Thu Feb 27 22:57:19 1992 Per Bothner (bothner@cygnus.com)
+
+ * rs6k-opcode.h, tm-rs6000.h, xm-rs6000.h, rs6000-tdep.c,
+ rs6000-xdep.c, xcoffexec.c, xcoffread.c:
+ Merge in changes (mostly from IBM) for RS6000.
+ * breakpoint.c, buildsym.c, infptrace.c, stack.c, symtab.c:
+ More changes from IBM for RS6000. These are in machine-
+ independent code, and probably could do with some cleaning
+ up. The most questionable of these are #ifdef IBM6000.
+ * infrun.c, sparc-tdep.c: Pass a parameter (signal number)
+ to single_step() (for consistency with rs6000 and i860).
+ * utils.c: Allow the 1st arg to xrealloc to be NULL
+ (in which case do malloc). This removes the need for
+ some tests in xcoff code (and perhaps other places?).
+ * coffread.c: Removed variables last_source_file,
+ type_vector, and type_vector_length as these are now
+ defined by buildsym.[ch].
+ * defs.h: Remove prototypes for malloc and realloc, since
+ these should only be used to implement xmalloc and xrealloc,
+ and they conflict with <stdlib.h> in AIX - where they
+ return void* even when __STDC__ isn't defined. Sigh.
+ * munch: Recognize *initialize* in data as well as text
+ (AIX uses data). Also, incorporate a patch from Garrett
+ Wollman <wollman@uvm-gen.uvm.edu> to make the sed script
+ much more sensible, by only trying to match the name of
+ the initialize_foo function, and not the junk before it.
+
+Thu Feb 27 20:07:43 1992 Stu Grossman (grossman at cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Don't reset breakpoint
+ unless symbol table indicates that something has changed.
+
+Thu Feb 27 11:48:47 1992 John Gilmore (gnu at cygnus.com)
+
+ * remote.c: Make it work for embedded MIPS. Increase buffer
+ size, and use throughout. Round buffer size up if too many regs.
+ Support baud rate setting and try for an 8-bit path. If
+ interrupted while waiting for target, send a ^C down the wire.
+ Avoid single-byte reads.
+ * tm-mips.h: Add more embedded-system registers to REGISTER_NAMES
+ and NUM_REGS.
+ * mips-xdep.h: Avoid the embedded regs when on Unix.
+
+ * mipsread.c: Byte-swap the symbol table structures, using
+ routines from ecoff.c, to read a symbol table written in any
+ of the four possible byte orders.
+ * configure.in (mips-big-* target): Same as Sony News.
+ * config/mt-bigmips, config/mt-littlemips: Add ecoff.o.
+ * ecoff.c: New file for symbol swapping routines.
+
+Thu Feb 27 09:26:38 1992 Stu Grossman (grossman at cygnus.com)
+
+ * breakpoint.c (all_breakpoints_info, breakpoint_1): Add 'info
+ all-breakpoints' command.
+ * (get_number): Allow users to enter negative breakpoint numbers.
+ * (breakpoint_1): Reformat display of 'info break' to show new
+ fields.
+ * (create_longjmp_breakpoint, breakpoint_re_set,
+ breakpoint_re_set_one, enable/disable_longjmp_breakpoint),
+ symfile.c (syms_from_objfile): Re-do
+ insertion of longjmp breakpoints. Move all code into
+ breakpoint_re_set, and call that instead of
+ create_longjmp_breakpoint in symfile.c.
+
+Thu Feb 27 06:11:05 1992 John Gilmore (gnu at cygnus.com)
+
+ * breakpoint.h (ALL_BREAKPOINTS_SAFE): Add.
+ * breakpoint.c (breakpoint_re_set): Use ALL_BREAKPOINTS_SAFE.
+ * symtab.c (find_pc_symtab): Handle having no objfiles.
+ * infcmd.c: Fix comment.
+ * objfiles.c (free_all_objfiles): Add.
+ * symfile.h (ALL_OBJFILES, ALL_OBJFILES_SAFE): Add.
+ * symfile.c (symbol_file_command): free all objfiles when
+ specifying a new symbol file.
+ (reread_symbols): Stat the file name, don't fstat the descriptor.
+
+Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed traces of namesubdir,
+ -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
+ copyrights to '92, changed some from Cygnus to FSF.
+
+Tue Feb 25 19:31:19 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (end_psymtab): Delete empty psymtabs.
+ * symfile.c (allocate_psymtab): Recycle empty psymtabs.
+ * symfile.h (struct objfile): Add free_psymtabs.
+
+Sat Feb 22 02:00:32 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in (VERSION): Roll to gdb-4.4.4.
+
+ * symfile.c (symbol_file_command): strcmp => !strcmp.
+ * breakpoint.h: Move prototypes to follow enum definition they need.
+ * breakpoint.c, infrun.c: Lint.
+ * printcmd.c: Use `enum enable' rather than `enum
+ display_status'.
+ * mipsread.c: First pass at making it compile with the new
+ objfile changes. Probably seriously broken still, but it
+ compiles. FIXME.
+
+Sat Feb 22 00:56:39 1992 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c, infcmd.c, breakpoint.c, main.c, symfile.c,
+ breakpoint.h, tm-sun4os4.h, tm-sparc.h, sparc-tdep.c, tm-mips.h,
+ mips-tdep.h, tm-sun3.h, tm-68k.h, m68k-tdep.h: Add support for
+ stepping (and nexting) through longjmp(). Also, cleanup
+ breakpoint handling quite a bit by creating explicit breakpoint
+ types instead of using magic breakpoint numbers.
+ Makefile.in: Update version to 4.4.3
+
+Sat Feb 22 00:08:50 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c, dwarfread.c, gdbtypes.c, inflow.c, main.c,
+ minsyms.c, printcmd.c, remote.c, saber.suppress: Saberlint.
+ * symmisc.c, xcoffread.c: Move debug functions to symmisc.c.
+
+ * xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP.
+
+ * minsyms.c (install_minimal_symbols): Add bunches to any
+ existing minsyms in the objfile. Avoid extra mallocation
+ by working directly in the obstack. Remove ignored `mainline' parm.
+ * coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h,
+ xcoffread.c: Change all callers.
+ * FIXME: We should be able to eliminate MAINLINE from all the
+ symbol readers now, with a small bit of work.
+
+ * valops.c, value.h: Lint.
+ * remote-vx.c: Add missing break; statement. Bugfix by
+ Michael Sclafani, <sclafani@src.dec.com>.
+
+Fri Feb 21 17:29:54 1992 Fred Fish (fnf at cygnus.com)
+
+ * Makefile.in (VERSION): Update version to 4.4.2
+ * Makefile.in (SFILES_MAINDIR): Add gdbtypes.c, state.c, objfiles.c,
+ minsyms.c, mmap-alloc.c, mmap-sbrk.c
+ * Makefile.in (HFILES): Add gdbtypes.h, state.h, solib.h
+ * Makefile.in (OBS): Add gdbtypes.o, state.o, objfiles.o, minsyms.o,
+ mmap-alloc.o, mmap-sbrk.o
+
+ * altos-xdep.c: Minor whitespace change.
+ * am29k-tdep.c (examine_prologue): Convert from misc function vector
+ use to new minimal symbol table use.
+ * arm-xdep.c (fetch_inferior_registers): Document unused argument.
+ * arm-xdep.c (store_inferior_registers): Returns void.
+ * blockframe.c (get_pc_function_start, find_pc_partial_function):
+ Convert from misc function vector use to new minimal symbol table use.
+ Remove find_pc_misc_function(). Ifdef out block_innermost_frame().
+ * breakpoint.c: Add prototypes for local functions.
+ * breakpoint.c (catch_command_1): Change to static and remove unused
+ local "pc".
+ * breakpoint.c (map_breakpoint_numbers): Prototype arg "function".
+ * breakpoint.h: Change function decls to prototype form.
+ * buildsym.c: Add prototypes for local functions.
+ * buildsym.c: Moved hashname() function here from dbxread.c.
+ * buildsym.c (dbx_lookup_type): Cast args to xrealloc().
+ * buildsym.c: Remove dbx_create_type(), uses changed to alloc_type().
+ * buildsym.c (dbx_alloc_type): Change to static.
+ * buildsym.c (finish_block): Add objfile parameter.
+ * buildsym.c (misc): Change symbol_obstack to objfile version.
+ * buildsym.c (make_blockvector): Change to static.
+ * buildsym.c (start_subfile): Use strdup instead of obsavestring.
+ * buildsym.c (compare_line_numbers): Change to static, args are const,
+ cast args when used.
+ * buildsym.c (start_symtab): Inline new_object_header_files() call.
+ * buildsym.c (patch_block_stabs): Moved to this file from xcoffread
+ and made static. Add objfile parameter.
+ * buildsym.c (end_symtab): Simplify code using line table size.
+ Realloc the linetable on the objfile symbol_obstack and copy there.
+ * buildsym.c (scan_file_globals): Convert from misc function vector
+ use to new minimal symbol use.
+ * buildsym.c (define_symbol): Add objfile parameter. Make sure
+ strings get allocated in objfile's symbol_obstack. Convert references
+ to builtin types to lookup_fundamental_type().
+ * buildsym.c (read_type): Make static, add objfile parameter, convert
+ references to buildin types to lookup_fundamental_type().
+ * buildsym.c (read_struct_type): Add objfile parameter.
+ * buildsym.c (read_array_type): Make static, add objfile parameter.
+ * buildsym.c (read_enum_type): Make static, add objfile parameter.
+ * buildsym.c (read_huge_number): Make static.
+ * buildsym.c (read_range_type): Make static, add objfile parameter,
+ convert references to buildin types to lookup_fundamental_type ().
+ * buildsym.c (read_args): Make static, add objfile parameter.
+ * buildsym.h: Convert function decl's to prototype form.
+ * c-exp.y: Add prototypes for local functions, convert uses of misc
+ function vector to minimal symbol table. Reformat all builtin type
+ initializations and pass a NULL objfile to init_type() for them.
+ * coffread.c: Change context_stack ref's to coff_context_stack,
+ add local function prototypes. Cast uses of xrealloc arg 1.
+ * coffread.c (coff_alloc_type): Call alloc_type instead of hand-
+ crafting a new type.
+ * coffread.c (add_symbol_to_list): Change to coff_add_symbol_to_list.
+ * coffread.c (finish_block): Change name to coff_finish_block.
+ * coffread.c (make_blockvector): Add and use objfile parameter.
+ * coffread.c (record_line): Change name to coff_record_line.
+ * coffread.c (start_symtab): Change name to coff_start_symtab.
+ * coffread.c (end_symtab): Change name to coff_end_symtab.
+ * coffread.c (record_misc_function): Change name to record_minimal_
+ symbol and change to minimal symbol table use from misc func tbl.
+ * coffread.c (coff_symfile_read): Convert from misc function vector
+ use to minimal symbol table use.
+ * coffread.c (hashname): Remove; use common version in buildsym.c.
+ * coffread.c (decode_base_type): Change references to builtin types
+ to calls to lookup_fundamental_type().
+ * coffread.c (read_struct_type): Change name to coff_read_struct_type.
+ * coffread.c (read_enum_type): Change name to coff_read_enum_type.
+ * command.c: Add prototypes for local functions.
+ * command.c (add_cmd): Prototype the 'fun' parameter and use the
+ appropriate member of the function union for that type.
+ * command.c (add_abbrev_cmd): Prototype the 'fun' parameter and
+ ifdef out the function since it isn't currently used.
+ * command.c (add_alias_cmd): Pass correct function type to add_cmd.
+ * command.c (add_prefix_cmd): Prototype the 'fun' parameter.
+ * command.c (add_abbrev_prefix_cmd): Prototype the 'fun' parameter.
+ * command.c (help_cmd): Compare function pointer to NULL.
+ * command.c (help_cmd_list): Compare function pointer to NULL.
+ * command.c (lookup_cmd_1): Use correct member of function union.
+ * command.c (undef_cmd_error): Make static.
+ * command.c (complete_on_cmdlist): Use correct member of func union.
+ * command.c (do_setshow_command): Use correct member of func union.
+ * command.c (shell_escape): Convert rindex use to strrchr.
+ * command.h (COMMAND_H): Define if already included.
+ * command.h (cmd_list_element struct): Change 'function' to a union
+ and prototype args. Prototype completer function.
+ * command.h: Convert decl's to prototype form.
+ * convex-xdep.c (store_inferior_registers): Returns void.
+ * copying.c: Prototype local functions.
+ * coredep.c: Minor whitespace change.
+ * cplus-dem.c: Remove hack to use BSD equivalents of mem* and str*.
+ * cplus-dem.c: Prototype local functions.
+ * dbxread.c (hashname): Remove; moved to buildsym.c.
+ * dbxread.c (free_and_init_header_files): Make static.
+ * dbxread.c: Add prototypes for local functions.
+ * dbxread.c (new_object_header_files): Remove; inlined usages.
+ * dbxread.c (xrealloc usages): Cast args.
+ * dbxread.c (record_misc_function): Change to record_minimal_symbol
+ and change usages accordingly.
+ * dbxread.c (static_psymbols usages): Change to use per-objfile copy.
+ * dbxread.c (xmalloc usages): Use per-objfile copy when appropriate.
+ * dbxread.c (dbx_next_symbol_text): Make static.
+ * dbxread.c (init_psymbol_list): Convert to use per-objfile data.
+ * dbxread.c (init_bincl_list): Add and use objfile parameter.
+ * dbxread.c (free_bincl_list): Add and use objfile parameter.
+ * dbxread.c (compare_psymbols): Remove; use common symfile.c version.
+ * dbxread.c (end_psymtab): Convert to use per-objfile data.
+ * dwarfread.c (DEFUN/EXFUN): Remove all usages. Use PARAMS for
+ prototypes.
+ * dwarfread.c (record_misc_function): Change name to record_minimal_
+ symbol and use minimal symbol table throughout.
+ * dwarfread.c (compare_psymbols): Remove; use common symtab.c version.
+ * dwarfread.c: Convert all references to builtin types to use the new
+ lookup_fundamental_type function.
+ * dwarfread.c (read_enumeration): Add and use objfile parameter.
+ * elfread.c (DEFUN/EXFUN): Remove all usages. Use PARAMS for proto-
+ types.
+ * elfread.c (record_misc_function): Convert to use record_minimal_
+ symbol.
+ * elfread.c (elf_symtab_read): Add objfile parameter.
+ * eval.c: Add prototypes for local functions and move some decls
+ around to accomodate prototypes.
+ * expprint.c: Add prototypes for local functions. Change references
+ to misc function vector to minimal symbol table.
+ * findvar.c (read_memory usages): Cast args.
+ * gdbtypes.h: New file, type info from symfile.h and symtab.h.
+ * gmalloc.c: Use NOARGS where prototypes used hardwired void.
+ * gmalloc.c (BLOCKSIZE): Constant to be shifted is unsigned.
+ * gmalloc.h: Use NOARGS where prototypes used hardwired void.
+ * gould-xdep.c: Minor whitespace change.
+ * hp300ux-xdep.c (fetch_inferior_registers): Remove unused regno var.
+ * hp300ux-xdep.c (store_inferior_registers): Returns void.
+ * hp300ux-xdep.c (fetch_core_registers): Takes unused arg reg_addr.
+ * i386-stub.c: Add prototypes, change "volatile" to NORETURN.
+ * i386-tdep.c: Add prototypes for local functions.
+ * i386-tdep.c (codestream_fill, codestream_seek, codestream_read,
+ i386_get_frame_setup, i386_skip_prologue): Explicitly declare params
+ that defaulted to int.
+ * i386-tdep.c (i386_follow_jump, i386_frame_find_saved_regs,
+ i386_push_dummy_frame): Returns void.
+ * i386-xdep.c (i386_register_u_addr): Declare params that default to
+ int and explicitly declare return type as int.
+ * i387-tdep.c: Minor formatting changes.
+ * i960-tdep.c (leafproc_return): Convert from misc function vector
+ use to minimal symbol table use.
+ * infcmd.c: Add prototypes for local functions.
+ * infcmd.c (continue_command, until_next_command, until_command,
+ path_info, path_command): Make static.
+ * infcmd.c (step_1, until_next_command): Convert from misc func
+ vector to minimal symbol table use.
+ * inflow.c: Add prototypes for local functions.
+ * infptrace.c (store_inferior_registers): Returns void, not int.
+ * language.c (_initialize_language): Use proper member of function
+ union.
+ * m2-exp.y: Add prototypes for local functions, convert misc function
+ vector uses to minimal symbol table uses.
+ * m2-exp.y (make_qualname, yyerror): Make static.
+ * m2-exp.y (_initialize_m2_exp): Call init_types with NULL objfile.
+ * m68k-pinsn.c: Add prototypes for local functions.
+ * m68k-pinsn.c (print_insn): Cast args to read_memory.
+ * m68k-pinsn.c (fetch_arg): Make parameter 'code' and int.
+ * m68k-stub.c: Add prototypes.
+ * m88k-pinsn.c (sprint_address): Convert from misc function vector
+ use to minimal symbol table use.
+ * m88k-xdep.c (fetch_inferior_registers): Takes an unused parameter.
+ * m88k-xdep.c (store_inferior_registers): Returns void.
+ * mach386-xdep.c (fetch_inferior_registers): Takes an unused param.
+ * mach386-xdep.c (store_inferior_registers): Returns void.
+ * mach386-xdep.c (fetch_core_registers): Takes an unused parameter.
+ * main.c: Add prototypes for local functions.
+ * main.c (return_to_top_level): Is type NORETURN (volatile). Cast
+ longjmp() result to (NORETURN void).
+ * main.c (catch_errors): Prototype the 'func' parameter.
+ * main.c (disconnect, stop_sig, do_nothin, float_handler):
+ Takes an unused arg.
+ * main.c (execute_command): Call the right member of the func union.
+ * main.c (command_loop_marker, symbol_completion_function,
+ command_loop): Make static.
+ * main.c (command_line_input): Make linelength unsigned, cast arg
+ to command_line_input().
+ * main.c (add_info, add_com): Prototype the 'fun' parameter.
+ * main.c (initialize_main): Call right member of function union.
+ * mcheck.c (NOARGS): Change hardwired void in prototypes to NOARGS.
+ * mem-break.c: Include symtab.h
+ * mips-xdep.c (fetch_inferior_registers): Takes unused param.
+ * mips-xdep.c (store_inferior_registers): Returns void.
+ * mipsread.c (mipscoff_symfile_read): Change from misc function vector
+ use to minimal symbol table use.
+ * mipsread.c (symbol_obstack usages): Convert all to use per-objfile
+ version.
+ * mipsread.c (make_type): Remove, convert usages to init_type.
+ * mipsread.c (_initialize_mipsread): Call init_type with NULL objfile.
+ * nindy-tdep.c (nindy_frame_chain_valid): Convert from misc function
+ vector use to minimal symbol table use.
+ * parse.c: Add prototypes for local functions.
+ * parse.c (xrealloc usages): Cast args.
+ * parse.c (prefixify_expression, length_of_subexp): Make static.
+ * parser-defs.h (PARSER_DEFS_H): Define when first included.
+ * parser-defs.h: Convert function decls to prototype form.
+ * partial-stab.h: Convert from misc function vector use to new minimal
+ symbol table use.
+ * partial-stab.h (global_psymbols, static_psymbols usages): Reference
+ the per-objfile copies.
+ * printcmd.c: Add prototypes for local functions. Move some struct
+ definitions around to accomodate prototypes.
+ * printcmd.c (decode_format): Make static, change args oformat and
+ osize to int from char.
+ * printcmd.c (print_formatted): Change 'format' and 'size' to int.
+ * printcmd.c (print_scalar_formatted): Change arg 'format' to int.
+ * printcmd.c (print_address_symbolic): Convert from misc function
+ vector use to minimal symbol table use.
+ * printcmd.c (address_info): Convert from misc function vector use
+ to minimal symbol table use.
+ * printcmd.c (delete_display, enable_display, disable_display_command):
+ Make static.
+ * procfs.c (EXFUN/DEFUN): Remove all usages, convert to PARAMS.
+ * procfs.c (fetch_core_registers): Add unused param reg_addr.
+ * pyr-xdep.c (fetch_inferior_registers): Add unused param regno.
+ * pyr-xdep.c (store_inferior_registers): Returns void.
+ * remote-mm.c (mm_load): symbol_file_add return value unused.
+ * remote-nindy.c: Minor format change.
+ * remote-vx.c (vx_load_command): symbol_file_add result unused.
+ * rs6000-xdep.c (fetch_inferior_registers): Add unused param regno.
+ * rs6000-xdep.c (store_inferior_registers): Returns void.
+ * rs6000-xdep.c (fetch_core_registers): add unused param reg_addr
+ * rs6000-xdep.c (aixcoff_relocate_symtab): Convert from misc function
+ vector use to minimal symbol table use.
+ * solib.c: Add prototypes for local functions.
+ * solib.c (solib_add_common_symbols, locate_base): Convert from misc
+ function vector use to minimal symbol table use.
+ * solib.c (EXFUN/DEFUN): Remove all usages, convert to PARAMS.
+ * solib.c (find_solib, shared_library_command): Make static
+ * solib.c (read_memory, write_memory usages): Cast args.
+ * solib.c (special_symbol_handling): Add function
+ * source.c: Add prototypes for local functions.
+ * source.c (select_source_symtab): Convert to scan objfiles.
+ * source.c (open_source_file): Make static.
+ * source.c (xrealloc usages): Cast args.
+ * source.c (source_line_charpos): ifdef out, unused.
+ * source.c (get_filename_and_charpos): Make static.
+ * stack.c: Add prototypes for local functions.
+ * stack.c (print_frame_info, frame_info): Convert from misc function
+ vector use to minimal symbol table use.
+ * symfile.c: Add prototypes for local functions.
+ * symfile.c (compare_symbols): Make args const PTR's.
+ * symfile.c (compare_psymbols, sort_pst_symbols) add.
+ * symfile.c (sort_all_symtab_syms): Scan objfile list.
+ * symfile.c (obsavestring): Add objfile parameter.
+ * symfile.c (init_misc_bunches, prim_record_misc_function,
+ compare_misc_functions, discard_misc_bunches, condense_misc_bunches,
+ sort_misc_function_vector, compact_misc_function_vector): Remove
+ * symfile.c (symbol_file_add_digested): Add function.
+ * symfile.c (symbol_file_add): Returns struct objfile *.
+ * symfile.c (symbol_file_command): Modify for state file use.
+ * symfile.c (symfile_open): Add parameter "dumpable".
+ * symfile.c (allocate_objfile, free_objfile): Moved to objfiles.c
+ * symfile.c (load_command, add_symbol_file_command): Make static.
+ * symfile.c (fill_in_vptr_fieldno): Moved to gdbtypes.c
+ * symfile.c (rindex usages): Converted to strrchr.
+ * symfile.c (allocate_psymtab): New
+ * symfile.c (free_named_symtabs): Ifdef out code that needs to be
+ converted to minimal symbol table usage, but no obvious conversion.
+ * symfile.c (free_all_symtabs): Remove.
+ * symfile.c (_initialize_symfile): Use per-objfile info.
+ * symfile.h: Rework the objfile structure to add per-objfile data
+ objects (psymbol_obstack, symbol_obstack, type_obstack,
+ global_psymbols, static_psymbols, msymbols, minimal_symbol_count,
+ fundamental_types, malloc, realloc, free, xmalloc, xrealloc, etc).
+ Add prototypes to function declarations.
+ * symm-tdep.c (symmetry_extract_return_value): Convert from misc
+ function vector usage to minimal symbol table usage.
+ * symmisc.c (DEV_TTY): Define if not defined.
+ * symmisc.c: Add local function prototypes.
+ * symmisc.c (dump_objfile, dump_msymbols, dump-symtab, print_syms,
+ printpsyms_command, print_objfiles, print_objfiles_command):
+ Rework to use iterate_over_*
+ * symtab.c: Add prototypes for local functions.
+ * symtab.c (lookup_symtab_1): Convert to look through objfiles.
+ * symtab.c (lookup_partial_symtab): Scan through objfiles.
+ * symtab.c (lookup_primitive_typename, lookup_typename, lookup_
+ unsigned_typename, lookup_struct, lookup_union, lookup_enum,
+ lookup_template_type, lookup_struct_elt_type, lookup_pointer_type,
+ lookup_reference_type, lookup_member_type, allocate_stub_method,
+ check_stub_method, create_array_type, smash_to_member_type,):
+ Moved to gdbtypes.c
+ * symtab.c (lookup_symbol): Some args are const.
+ * symtab.h: All type related defs and structs moved to gdbtypes.h
+ * symtab.h: Convert decls to prototypes.
+ * target.c (noprocess): Make static.
+ * target.h: Change decl's to prototypes.
+ * tm-sunos.h: (CLEAR_SOLIB, SOLIB_ADD, SOLIB_CREATE_INFERIOR_HOOK,
+ DISABLE_UNSETTABLE_BREAK) Moved to solib.h.
+ * utils.c (_initialize_utils): Use correct member of function union.
+ * valarith.c: include gdbtypes.h
+ * valops.c: include gdbtypes.h, add prototypes for local functions.
+ * valops.c (value_push, value_arg_push, find_function_addr):
+ Make static.
+ * valops.c (value_string): Convert from misc function vector use
+ to minimal symbol table use.
+ * valops.c (check_field_in): Make arg const.
+ * valprint.c: Add prototypes for local functions.
+ * valprint.c (print_string): Make static
+ * valprint.c (value_print, val_print_fields, val_print): Make arg int.
+ * values.c: Add prototypes for local functions.
+ * values.c (value_headof): Convert from misc function vector to
+ minimal symbol table.
+ * xcoffexec.c: Add prototypes for local functions.
+ * xcoffexec.c (exec_close, file_command, add_to_section_table):
+ Make static.
+ * xcoffexec.c (relocate_minimal_symbol): Add.
+ * xcoffread.c (patch_block_stabs): Moved to buildsyms.c.
+ * xcoffread.c: Add prototypes for local functions.
+ * xcoffread.c (sort_syms): Convert to scan objfiles.
+ * xcoffread.c (read_xcoff_symtab): Make static.
+ * xcoffread.c (various): Replace references to builtin types with
+ calls to lookup_fundamental_type. Replace references to symbol_obstack
+ and psymbol_obstack with pointers to the per-objfile copies.
+ * xcoffread.c (dump_linetable, dump_type, dump_symbol, dump_namespace,
+ dump_block, dump_blockvector, dump_last_symtab, dump_symtabs):
+ Make static.
+ * xcoffread.c (init_stringtab): Add objfile parameter.
+ * gdbtypes.c: New file
+ * minsyms.c: New file
+ * mmap-alloc.c: New file
+ * mmap-sbrk.c: New file
+ * objfiles.c: New file
+ * state.c: New file
+ * state.h: New file
+
+Fri Feb 21 17:29:54 1992 John Gilmore (gnu at cygnus.com)
+
+ * Check in Fred Fish's changes in these modules. Fred
+ will make ChangeLog entries for all of them. Update VERSION
+ to 4.4.2.
+
+Thu Feb 20 18:10:17 1992 Fred Fish (fnf at cygnus.com)
+
+ * tm-sparc.h, tm-sysv4.h, solib.h: Move shared lib definitions
+ into solib.h.
+ * sparc-pinsn.c, sparc-tdep.c, standalone.c, sun3-xdep.c,
+ sun386-xdep.c, symm-xdep.c, target.c, ultra3-xdep.c, utils.c,
+ value.h: Prototypes for static functions; lint.
+ * gdbtypes.h: Empty file to ease transition.
+
+Thu Feb 20 16:43:13 1992 Fred Fish (fnf at cygnus.com)
+
+ * environ.h, expression.h, frame.h, gdbcmd.h, gdbcore.h,
+ inferior.h, language.h, signame.h, target.h, terminal.h,
+ tm-68k.h, tm-i386v.h, tm-sparc.h, tm-sun386.h, tm-symmetry.h,
+ xm-i386v.h, xm-sparc.h: Prototypes for all external functions.
+ Lint.
+ * core.c, exec.c, infrun.c, inftarg.c, language.c, remote.c,
+ signame.c, sparc-xdep.c: Prototypes for all static functions.
+ Lint.
+ * core.c, eval.c, exec.c, inftarg.c, remote-adapt.c, remote-eb.c,
+ remote-hms.c, remote-mm.c, remote-nindy.c, remote-vx.c, remote.c,
+ target.c, target.h, valarith.c, valops.c, value.h, xcoffexec.c:
+ Remove to_call_function and target_call_function, since it
+ always calls the same thing (call_function_by_hand).
+ * core.c, exec.c, solib.c: Rename target_ops sections =>
+ to_sections, etc.
+ * infcmd.c, inflow.c, infptrace.c, infrun.c, main.c, target.c,
+ target.h: target_kill takes no args.
+ * language.c (language_info): Scaffolding to allow briefer
+ messages when the current language changes. FIXME.
+ * xm-amix.h, xm-i386v4.h, xm-stratus.h: Define NORETURN to avoid
+ complaints about volatile functions.
+ * xm-sysv4.h (HAVE_MMAP): Define.
+
+Thu Feb 20 09:04:18 1992 Fred Fish (fnf at cygnus.com)
+
+ * defs.h: Include ansidecl.h and PARAMS macro. Use PARAMS
+ to make prototypes for all functions declared here.
+ * cplus-dem.c: Avoid declaring xmalloc and xrealloc.
+ * c-exp.y: Rename SIGNED, OR, and AND to avoid conflict.
+ * environ.c: Include <stdio.h> before defs.h. Minor cleanup.
+ * ieee-float.h: Use PARAMS for prototypes; make some params const.
+ * ieee-float.c, valarith.c: Include <stdio.h>. Lint. b*=>mem*.
+ * m2-exp.y: Remove unused CONST; Rename OR and AND.
+ * utils.c: Avoid declaring malloc and realloc. Lint.
+ (request_quit): Accept signal-number parameter.
+
+Mon Feb 17 07:13:27 1992 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (process_dies): Add case to handle TAG_pointer_type
+ DIE's. Add new function read_tag_pointer_type() to read them.
+
+ * dwarfread.c (dwarf_read_array_type, read_subroutine_type):
+ When creating a new user defined type, check to see if a partial
+ type already exists, and if so, bash it to fit.
+
+Fri Feb 14 19:00:17 1992 John Gilmore (gnu at cygnus.com)
+
+ * coffread.c (decode_base_type): Pass long, not union.
+ Fix by Eric Valette, ev@chorus.fr.
+
+Thu Feb 13 17:14:28 1992 Fred Fish (fnf at cygnus.com)
+
+ * elfread.c (elf_symtab_read): Fix code to correctly track
+ changes in bfd for absolute symbols.
+
+Thu Feb 13 12:43:29 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xm-vaxbsd.h: Close off comment.
+
+Thu Feb 13 07:45:19 1992 Fred Fish (fnf at cygnus.com)
+
+ * xm-sysv4.h: Define NEED_POSIX_SETPGID.
+
+Fri Feb 7 11:51:12 1992 Per Bothner (bothner at cygnus.com)
+
+ * mips-tdep.c (mips_print_registers): Print correct register
+ number for double pseudo-registers.
+
+Fri Feb 7 07:56:05 1992 John Gilmore (gnu at cygnus.com)
+
+ * buildsym.c (read_struct_type): Avoid double-bump of parse ptr
+ in the op$::OPERATOR. case. From Steven McCanne,
+ <mccanne@horse.ee.lbl.gov>.
+
+ * exec.c (set_section_name): Pass arg to exec_files_info;
+ only call it if interactive. From Francis Kauth <fk@tv.tv.tek.com>.
+
+Thu Feb 6 17:41:32 1992 John Gilmore (gnu at cygnus.com)
+
+ * main.c (print_gdb_version): Copyright msg: only this year.
+ (cd_command): Avoid changing current_directory on error.
+
+Thu Feb 6 15:14:01 1992 Per Bothner (bothner at cygnus.com)
+
+ * mipsread.c (parse_partial_symbols): Handle dependencies
+ between partial symbol tables (when not doing stabs-in-ecoff).
+ (This used to be handled by parse_fdr, but parse_fdr was
+ incompatible with handling stabs-in-ecoff, so the code
+ was re-written to not use parse_fdr. Unfortunately,
+ the logic to handle dependencies was overlooked.)
+
+Thu Feb 6 11:51:39 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffread.c (read_enum_type): Use the size of a target int when
+ describing enum.
+ * defs.h: added new #define for TARGET_PTR_BIT, defaults to size
+ of target int.
+ * h8300-tdep.c, remote-hms.c, tm-h8300.h: too many changes to count
+ * symtab.c (lookup_reference_type, lookup_ptr_type): use
+ TARGET_PTR_BIT to determine size of a pointer
+ * values.c (unpack_long): when unpacking a REF or a PTR don't
+ assume the size of the type.
+
+Wed Feb 5 22:29:59 1992 John Gilmore (gnu at cygnus.com)
+
+ * mipsread.c (parse_symbol): Avoid clobbering enum pointer when
+ looking at its members. Improve guess between struct and union,
+ only assuming union if multiple members have offsets of zero.
+
+Tue Feb 4 18:05:44 1992 Per Bothner (bothner at cygnus.com)
+
+ * mipsread.c: Use (FP0_REGNUM-32) instead of magic number 6.
+ (This is just for clarity - and one day permitting us to
+ change FP0_REGNUM from 38 to 32, which would make more sense.)
+ * tm-mips.h: Added STAB_REG_TO_REGNUM macro, so that
+ register numbers in stabs-in-ecoff get handled correctly.
+
+Sat Feb 1 04:45:10 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xm-vax.h, xm-vaxult.h, xm-vaxbsd.h, config/mh-vaxult,
+ config/mh-vaxbsd, configure.in: Split up config stuff for Vaxen
+ into BSD and Ultrix.
+
+Sat Feb 1 04:39:41 1992 John Gilmore (gnu at cygnus.com)
+
+ * dbxread.c (dbx_symfile_init): Call malloc, not xmalloc.
+
+Sat Feb 1 04:15:41 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Increment version to 4.4.1.
+ * main.c (print_gdb_version): Update copyright notice.
+
+Sat Feb 1 01:43:11 1992 Per Bothner (bothner at cygnus.com)
+
+ * mipsread.c: Prepend "struct " to the names of structure
+ types, and similarly for enums and unions. (This used
+ to be done, but got lost in the re-write to "guess" the
+ difference between enum/struct/union.)
+ Also, guess that a tag is an enum if the first member
+ has type btNil.
+
+Fri Jan 31 21:45:51 1992 Stu Grossman (grossman at cygnus.com)
+
+ * xm-vax.h: #ifndef ultrix around #include of endian.h and
+ limits.h (sigh).
+
+Fri Jan 31 00:05:01 1992 John Gilmore (gnu at cygnus.com)
+
+ * Projects: Patching executables is done.
+ * Makefile.in (VERSION): Roll to gdb-4.4.
+ * README, WHATS.NEW: Update for gdb-4.4.
+
+ * symfile.c (reread_symbols): Whenever we reread one object
+ file's symbols, we must restart the scan, because the object_files
+ chain has been permuted.
+
+ * exec.c (exec_files_info): Split out into print_section_info.
+ Print BFD filename of each section if it's not the default one.
+ * core.c (core_files_info): Call print_section_info.
+
+ * xm-vax.h: Include a few system header files whose definitions
+ must precede defs.h.
+ * language.c, language.h: Make some things const.
+ * expression.h, main.c: const spreads like ooze.
+
+ * mem-break.c (break_insn, break_insn_size): Use unsigned chars,
+ since BREAKPOINT values can be >0x80.
+
+Thu Jan 30 17:21:14 1992 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c, xm-i386sco.h: SCO needs to use setpgid().
+
+Thu Jan 30 01:04:23 1992 John Gilmore (gnu at cygnus.com)
+
+ * sparc-pinsn.c: Remove kludge for preferring architectures.
+ Remove #ifdef's for SORT_NEEDED. We need to sort the table, now
+ and forever. Add `add' instruction to the set that get checked
+ for a preceding `sethi' in order to print an absolute address.
+ Corresponding changes in ../include/opcode/sparc.h needed
+ to eliminate garbage instructions.
+
+Wed Jan 29 19:24:34 1992 Per Bothner (bothner at cygnus.com)
+
+ * mipsread.c (parse_partial_symbols): Make sure partial
+ symbols are created for external symbols (as used to be
+ the case). This is a bit of a pain with the mips-coff.
+ It uses a table which points to all of the external
+ symbols belonging to a particular FDR or psymtab.
+ Once we've generated this table, we might as well save
+ it, and then use it in psymtab_to_symtab_1 to find
+ the symbols to pass to parse_external().
+ * symfile.c, symfile.c: New function start_psymtab_common
+ to share the common parts of allocating a new psymtab
+ for dbxread, mipsread (and later dwarfread). Its code
+ was pulled out from start_psymtab in dbxread.c.
+ * dbxread.c (start_psymtab): Use start_psymtab_common().
+
+ * valprint.c (val_print): If there is an error when trying
+ to print a string, check to see if there really is a problem
+ by reading just one character. If that works, assume
+ things are ok.
+
+Wed Jan 29 18:58:43 1992 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-pinsn.c (compare_opcodes): Make it prefer v6, v7,
+ cypress, v8 mnemonics in that order.
+
+Tue Jan 28 17:32:13 1992 Per Bothner (bothner at cygnus.com)
+
+ * sparc-pinsn.c: Put the qsort() back in.
+
+Mon Jan 27 18:51:03 1992 John Gilmore (gnu at cygnus.com)
+
+ * findvar.c (read_register, write_register): Handle machines
+ where REGISTER_TYPE is not the same size as "int".
+
+ Handle debug symbols in dynamically loaded (relocated) code:
+
+ * dbxread.c (read_ofile_symtab): Fix up N_CATCH better. Pass
+ offset to process_one_symbol.
+ (process_one_symbol): Take new offset parameter. Add it into
+ appropriate symbol types to relocate symbols to loaded addresses.
+ Handle all possible symbol types, and complain() about types that
+ we don't expect to see.
+ * mipsread.c (psymtab_to_symtab_1): Pass offset of zero to
+ process_one_symbol (FIXME, should pass real offset).
+
+ Misc bugfixes:
+
+ * breakpoint.c (resolve_sal_pc): Split out code to resolve a
+ sal's PC value.
+ (set_breakpoint, break_command_1, until_break_command,
+ catch_command_1, breakpoint_re_set_one): Use it.
+ * symtab.h (resolve_sal_pc): Declare.
+ * infcmd.c (jump_command): Use resolve_sal_pc.
+
+ * source.c (list_command): Shorten "FILE, line N" to "FILE:N".
+
+ * putenv.c (putenv): Avoid unportably casting pointers to unsigneds.
+
+ * c-exp.y (yylex): `this' and `template' are only tokens in C++.
+
+ * xm-convex.h, xm-hp300bsd.h, xm-isi.h, xm-merlin.h, xm-news.h,
+ xm-np1.h, xm-pn.h, xm-pyr.h, xm-rtbsd.h, xm-symmetry.h, xm-umax.h:
+ Remove MISSING_VPRINTF declaration, and superfluous "kgdb" defines.
+
+Mon Jan 27 15:46:21 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (process_one_symbol): Make a first cut at handling
+ symbol tables generated by Sun's acc. (#ifdef'd out, FIXME.)
+
+ * symtab.c (find_pc_line): Fix stepping into and out of #included
+ files.
+
+Mon Jan 27 13:00:55 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (OPCODES): Remove OPCODES defs and refs. There is
+ no longer any need to copy ../include/opcode/* into gdb.
+
+Mon Jan 27 12:30:38 1992 John Gilmore (gnu at cygnus.com)
+
+ * ChangeLog, ChangeLog-9091: Split ChangeLog at 1992.
+
+Sun Jan 26 19:05:40 1992 Per Bothner (bothner at cygnus.com)
+
+ * valprint.c (type_print_base, type_print_method_args):
+ Print C++ constructor methods without bogus "return type."
+
+Sat Jan 25 15:57:59 1992 Fred Fish (fnf at cygnus.com)
+
+ * infptrace.c (child_xfer_memory): Parameter "target" should
+ be a pointer to a structure, not the entire structure.
+
+Fri Jan 24 01:30:27 1992 Fred Fish (fnf at cygnus.com)
+
+ * depend: Convert the couple of references to ansidecl.h that
+ used the local gdb version to use the ../include version.
+
+Thu Jan 23 22:24:43 1992 Fred Fish (fnf at cygnus.com)
+
+ * procfs.c
+ (child_xfer_memory): Takes pointer to a struct, not entire struct.
+ (inferior_proc_init): Fix non-ANSI version of args.
+ (attach): Call print_sys_errmsg with correct number of args.
+ (mappingflags): Make static, does not need to be global.
+
+ * i386-tdep.c (i386_frame_num_args): Takes a pointer to a struct
+ not the entire struct itself.
+
+ * valops.c (value_assign): Cast some args to modify_field() and
+ {read,write}_register_bytes() correctly.
+
+ * ansidecl.h: Removed, is duplicate of ../include/ansidecl.h
+
+ * Makefile.in (MALLOCSRC): Removed reference to removed local
+ copy of ansidecl.h.
+
+ * dwarfread.c (list_in_scope): Needs an initial value, use file
+ scope.
+
+Mon Jan 20 19:06:28 1992 Stu Grossman (grossman at cygnus.com)
+
+ * main.c (main): Make option_index local to keep new getopt happy.
+ main.c, solib.c, Makefile.in: Update copyright notices.
+
+Mon Jan 20 08:54:00 1992 Michael Tiemann (tiemann at cygnus.com)
+
+ * cplus-dem.c (cplus_demangle): Correctly demangle destructors.
+
+Sat Jan 18 17:17:45 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (HFILES): Add partial-stab.h.
+
+Sat Jan 18 16:45:01 1992 Fred Fish (fnf at cygnus.com)
+
+ * config/mh-stratus, config/mt-stratus, tm-stratus.h, xm-stratus.h:
+ New files for stratus. Not complete enough to actually build
+ on the Stratus machine; that awaits copyright assignment for
+ i860 changes.
+
+ * Makefile.in (USER_CFLAGS): Add macro specifically reserved
+ for getting custom flags into CFLAGS when doing makes.
+
+ * configure.in: Add config information for stratus.
+
+Thu Jan 16 00:51:46 1992 Fred Fish (fnf at cygnus.com)
+
+ * dbxread.c (process_one_symbol): Pass address of structure
+ to complain(), rather than the whole structure.
+
+Wed Jan 15 09:56:16 1992 Fred Fish (fnf at cygnus.com)
+
+ * solib.c (solib_add_common_symbols): Only compile in when not
+ using SVR4 style shared libraries.
+
+Tue Jan 14 22:34:00 1992 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (locval): Add offreg flag to indicate location
+ values that are computed off a base register.
+
+ * dwarfread.c (new_symbol): Rework TAG_global_variable and
+ TAG_local_variable cases to account for static variables
+ within function scopes.
+
+Tue Jan 14 12:28:52 1992 Stu Grossman (grossman at cygnus.com)
+
+ * inflow.c: remove #include <sys/dir.h>. Not necessary, and
+ doesn't exist on some systems.
+
+ * infrun.c (wait_for_inferior!!!!): Prevent gdb from hanging when
+ nexting over recursive function calls.
+
+ * target.c (target_read_string): Create this routine to read null
+ terminated strings from the target. It deals with running off the
+ end of memory elegantly as well. solib.c (find_solib): Use
+ target_read_string() to avoid problems with running off the end of
+ memory.
+
+ * inflow.c (child_terminal_info): #ifdef TIOCPGRP around lines
+ that reference pgrp_inferior.
+
+Mon Jan 13 14:57:11 1992 Per Bothner (bothner at cygnus.com)
+
+ * tm-mips.h: Removed BLOCK_ADDRESS_ABSOLUTE, now that
+ mips-tfile has been hacked to act more "traditionally."
+ * dbxread.c: Fixed typo in comment.
+
+Sun Jan 12 13:08:36 1992 Per Bothner (bothner at cygnus.com)
+
+ * mips-tdep.c (mips_skip_prologue): Add some number of
+ 'sw' instructions before 'addiu' adjusts the stack.
+
+Fri Jan 10 13:47:06 1992 Fred Fish (fnf at cygnus.com)
+
+ * dwarfread.c (start_symtab, end_symtab, scopecount, openscope,
+ freescope, buildblock closescope, record_line, add_symbol_to_list,
+ gatherblocks, make_blockvector): Extensive changes to switch
+ to generic symbol table building code in buildsym.c. Remove
+ scope tree structures and functions, symbol table building
+ functions, and lots of other small changes.
+
+ * dwarfread.c: Add new macros GCC_PRODUCER and STREQN. Remove
+ GCC_COMPILED_FLAG_SYMBOL and GCC2_COMPILED_FLAG_SYMBOL.
+
+Tue Jan 7 13:09:57 1992 Stu Grossman (grossman at cygnus.com)
+
+ * buildsym.c (cleanup_undefined_types): Add support for enums.
+ This fixes the 'GDB internal error. cleanup_undefined_types with
+ bad type' problem.
+
+Sun Jan 5 09:47:50 1992 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c: detect gcc2 compilations.
+
+Thu Jan 2 15:07:41 1992 John Gilmore (gnu at cygnus.com)
+
+ * sparc-pinsn.c: Rename bitfields that overlap with macro names
+ in ../include/opcode/sparc.h.
+
+Wed Jan 1 04:29:00 1992 Fred Fish (fnf at cygnus.com)
+
+ * Makefile.in: Change tm-svr4.h to tm-sysv4.h. Change xm-svr4.h
+ to xm-sysv4.h. Split OPCODE_DIR into OPCODE_DIR1 and OPCODE_DIR2
+ to reflect actual locations of opcode files, so TAGS target will
+ be buildable.
+
+ * i386-tdep.c: Change an erroneous 'm68k' reference to 'i386'.
+
+ * i386-tdep.c (supply_fpregset, fill_fpregset): Remove m68k
+ code.
+
+ * m68k-tdep.c (supply_fpregset, fill_fpregset): Fix array
+ dereferencing to access the correct elements.
+
+ * valops.c (value_addr): Declare return type of external func
+ value_copy().
+
+ * xcoffread.c: Undefine next_symbol_text before redefining it.
+
+For older changes see ChangeLog-1991
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1993 b/contrib/gdb/gdb/ChangeLog-1993
new file mode 100644
index 0000000..4aba2d3
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1993
@@ -0,0 +1,7597 @@
+Fri Dec 31 14:33:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * nindy-share/nindy.c: Fix order of arguments to store_unsigned_integer
+ (second and third arguments were reversed).
+ (say): Use varargs.
+
+Fri Dec 31 12:13:47 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote-mips.c: Add timeout parameter to mips_request and
+ mips_receive_packet.
+ (callers): pass in mips_receive_wait except mips_initialize (where
+ we use it to clean up the kludge where we had been changing
+ mips_receive_wait temporarily) and mips_wait (where we pass in
+ -1 for no timeout).
+
+Fri Dec 31 14:33:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stack.c (print_block_frame_locals): Also print LOC_BASEREG variables.
+
+Fri Dec 31 06:55:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.c (find_methods): Call fprintf_symbol_filtered with DMGL_ANSI.
+
+Thu Dec 30 10:16:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * values.c (unpack_long): Fix garbled error message.
+
+ * remote-mips.c (mips_error): New function.
+ * remote-mips.c: Use it instead of error() most places.
+ * remote-mips.c (mips_receive_packet): New arg throw_error.
+ (mips_initialize): Use it not catch_errors.
+ * defs.h: Declare error_pre_print and warning_pre_print here...
+ * main.c: ...not here.
+
+ * breakpoint.c (breakpoint_chain): Make static.
+ * breakpoint.c, breakpoint.h (frame_in_dummy): New function.
+ * stack.c (print_frame_info): Use it.
+
+Thu Dec 30 07:41:36 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * exec.c (add_to_section_table): Check for SEC_ALLOC instead of
+ SEC_LOAD to handle .bss segments properly.
+
+Thu Dec 30 10:16:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Enable code which assumes that if
+ we jump into the prologue from another function, then it was a
+ subroutine call. #if 0 AT_FUNCTION_START; the above code should
+ take care of this case.
+
+Wed Dec 29 12:32:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valprint.c (val_print_string): Change chunksize from 200
+ to 8.
+
+ * symfile.c (generic_load): If no arguments, get file name
+ from get_exec_file.
+
+ * c-exp.y: Revert Kung's change. "..." is not a type, and the
+ change caused "p (...)0" to dump core.
+ * gdbtypes.c (check_stub_method): Don't pass "..." to
+ parse_and_eval_type. This should fix the bug which Kung was
+ trying to fix.
+
+ * stabsread.c (define_symbol): If we choose not to combine
+ two symbols, don't just ignore the second (LOC_REGISTER) one.
+ * printcmd.c (print_frame_args): If we have a LOC_ARG and a
+ LOC_REGISTER, use the LOC_ARG not the LOC_REGISTER.
+
+Tue Dec 28 15:08:00 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * solib.c (DEBUG_BASE): Remove macro and all references.
+ * solib.c (debug_base_symbols): Add array of symbols to lookup.
+ * solib.c (IGNORE_FIRST_LINK_MAP_ENTRY): Add macro.
+ * solib.c (look_for_base, locate_base): Use debug_base_symbols.
+ * solib.c (find_solib): Use IGNORE_FIRST_LINK_MAP_ENTRY.
+
+Tue Dec 28 12:06:57 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * c-exp.y : fix grammar to parse ellipsis (...)
+
+Mon Dec 27 18:42:14 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * stabsread.c (read_type): fix problem when reading static member
+ of a class. caused by change to allow :: inside template
+ instantiated name.
+
+Mon Dec 27 11:07:05 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbtypes.h: Expand on comments for TYPE_CODE_BITSTRING and
+ TYPE_CODE_STRING a bit.
+
+ * m68k-tdep.c (m68k_skip_prologue, m68k_find_saved_regs):
+ Allow pea %fp; move.l %sp, %fp instead of link instruction to
+ set up the new frame.
+
+ * main.c (init_main): Change "set remotedebug" back to var_zinteger
+ from var_boolean.
+
+ * c-exp.y (yylex): Don't try to deal with nested types.
+
+ * cp-valprint.c (cplus_print_value): Call check_stub_type on
+ TYPE_BASECLASS (type, i) before we look at its name.
+
+ * dbxread.c: Move default definition of GCC_COMPILED_FLAG_SYMBOL
+ from here . . .
+ * symtab.h: . . . to here.
+ * dbxread.c (record_minimal_symbol): Move check for gcc{,2}_compiled.
+ and __gnu_compiled* from here . . .
+ * minsyms.c (prim_record_minimal_symbol_and_info): . . . to here.
+ * minsyms.c (prim_record_minimal_symbol): Call
+ prim_record_minimal_symbol_and_info rather than duplicating code.
+ * minsyms.c, symtab.h (prim_record_minimal_symbol{,_and_info}),
+ coffread.c (record_minimal_symbol),
+ xcoffread.c (RECORD_MINIMAL_SYMBOL), callers: Add objfile parameter.
+
+Sun Dec 26 20:44:02 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * dbxread.c (process_one_symbol): Handle stabs-in-som just like
+ stabs-in-elf.
+ (pastab_build_psymtabs): Likewise.
+
+ * hppa-tdep.c: Change all comments to reference %r3 or frame
+ pointer rather than %r4.
+ (frame_chain, skip_prologue, dig_rp_from_stack): Handle %r3 as the
+ frame pointer.
+
+ * config/pa/tm-hppa.h (FP_REGNUM): Define as %r3.
+ (FIND_FRAME_SAVED_REGS): Handle %r3 as frame pointer.
+ (CALL_DUMMY): Likewise.
+
+Sun Dec 26 16:59:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * exec.c (exec_file_command): If error occurs after we have opened
+ exec_bfd but before we call push_target, make sure to close exec_bfd.
+
+ * infrun.c (wait_for_inferior): Remove confusing and inaccurate
+ stuff about subroutine calls, return, etc., from comment which
+ says "We've wandered out of the step range.".
+
+Sun Dec 26 09:18:10 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): When checking whether the line has
+ changed, check the symtab as well.
+
+Sun Dec 26 09:18:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbtypes.c (force_to_range_type): Use switch statement.
+ complain() not warning() if the TYPE_CODE isn't one we know how to
+ deal with gracefully. Use builtin_type_int not
+ lookup_fundamental_type (the objfile we passed to
+ lookup_fundamental_type was sometimes NULL).
+
+ * valops.c (call_function_by_hand, push_word), defs.h (push_word),
+ convex-xdep.c, m88k-nat.c, i386m3-nat.c, mips-tdep.c, mipsm3-nat.c,
+ ns32km3-nat.c, remote-bug.c, m88k-tdep.c, remote-hms.c, remote-mips.c,
+ config/gould/tm-np1.h, hppa-tdep.c (hppa_fix_call_dummy), remote-vx.c:
+ Use REGISTER_SIZE, unsigned LONGEST, and
+ {store,extract}_unsigned_integer, instead of sizeof
+ (REGISTER_TYPE) and REGISTER_TYPE.
+ * All tm.h files: Change REGISTER_TYPE to REGISTER_SIZE.
+ * hppa-tdep.c (pa_print_fp_reg): Remove unused variable val.
+
+ * Makefile.in (ALLDEPFILES): Remove i386ly-nat.c and m68kly-nat.c.
+ Add lynx-nat.c.
+
+Sat Dec 25 20:05:41 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (init_extra_frame_info): Correctly adjust the base
+ of the current frame when "fromleaf" is true. Do not adjust the
+ frame base of the innermost frame if it is a leaf function.
+
+Sat Dec 25 13:39:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (define_symbol): Only combine a p/r pair into a
+ LOC_REGPARM if REG_STRUCT_HAS_ADDR.
+
+Sat Dec 25 09:50:29 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valops.c (value_struct_elt): Check for (value)-1 return from
+ search_struct_method.
+
+Sat Dec 25 09:50:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * defs.h: Move definitions of TARGET_*_BIT after include of tm.h.
+ The old way (using #undef in tm.h) was ugly and asking for
+ trouble, because it makes it possible for some file to use the
+ wrong definition. Move definition of HOST_CHAR_BIT after definition
+ of TARGET_CHAR_BIT.
+ * config/alpha/tm-alpha.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/z8k/tm-z8k.h: Don't undef TARGET_*_BIT
+ before defining them.
+
+ * mdebugread.c: Change the builtin_type_* in this file to
+ mdebug_type_* and make them static. Use TYPE_CODE_ERROR for
+ complex and float decimal.
+
+ * printcmd.c (disassemble_command): Call wrap_here between printing
+ address and printing instruction.
+
+Fri Dec 24 14:23:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (read_type): Don't fall through 'S' case (the case it
+ was falling though happened to do the right thing ("break;") but that
+ is hardly a good thing to assume).
+
+Tue Dec 21 13:32:02 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-exp.y (match_dollar_tokens): Fix off-by-one bug.
+ * ch-lang.c (chill_is_varying_struct), ch-lang.h: New function.
+ * ch-lang.c (chill_printstr): Use double quotes, not single quotes.
+ * ch-typeprint.c (chill_type_print_base): Handle TYPE_CODE_BITSTRING.
+ Improve printing of TYPE_CODE_STRING, TYPE_CODE_SET, and
+ TYPE_CODE_STRUCT (including checking chill_is_varying_struct).
+ Print TYPE_DUMMY_RANGE by printing its TYPE_TARGET_TYPE.
+ Handle TYPE_CODE_ENUM.
+ * ch-valprint.c (chill_val_print): Handle TYPE_CODE_BITSTRING.
+ For TYPE_CODE_STRING, never print address. Handle VARYING strings.
+ * gdbtypes.c (force_to_range_type): New.
+ * gdbtypes.c (create_set_type): Make work, following Chill layout.
+ * gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND, TYPE_DUMMY_RANGE): New.
+ * stabsread.c (read_type): Distinguish string and bitstring from
+ char-array and set.
+ * valarith.c (value_subscript), valops.c (value_coerce_array):
+ Handle STRINGs as well as ARRAYs.
+ * valarith.c (value_bit_index): Fix think. Use new macros.
+
+
+Fri Dec 17 10:45:32 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * symtab (decode_line_1): fix a bug when position char is not
+ set correctly.
+ * c-valprint (c_val_print): handle vtbl printing when vtbl is not
+ set up yet.
+
+Thu Dec 16 16:46:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * mips-tdep.c (read_next_frame_reg): If SIGFRAME_REG_SIZE is not
+ defined, define it as 4.
+
+Thu Dec 16 13:08:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config/m68k/nm-hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD.
+
+ * config/m68k/tm-hp300bsd.h (REMOTE_BPT_VECTOR): Define.
+
+ * config/m68k/tm-m68k.h (REMOTE_BPT_VECTOR): Allow targets to
+ override.
+ (REMOTE_BREAKPOINT): Likewise.
+
+Thu Dec 16 09:14:58 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hp_function_type): Correctly handle
+ pass-by-value structures > 64bits in size.
+ (process_one_debug_symbol): Likewise.
+
+Mon Dec 13 20:17:39 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ Implement support for Chill POWERSETs.
+ * ch-exp.y (operand_2): Implement 'Element IN PowerSet'.
+ * ch-typeprint.c (chill_type_print_base): Handle POWERSETs.
+ * ch-valprint.c (chill_val_print): Handle TYPE_CODE_SET.
+ * eval.c (evaluate_subexp): Implement BINOP_IN.
+ * expression.h (enum exp_opcode): Added BINOP_IN.
+ * gdbtypes.c (create_set_type), gdbtypes.h: New function.
+ * stabsread.c (read_type): If 'S', create a set type.
+ * valarith.c (value_bit_index, value_in), value.h: New functions,
+ for indexing in SETs.
+
+Mon Dec 13 06:42:37 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (pa_symfile_init): Check for the existance of stabs
+ after DBX_TEXT_SECT has been initialized.
+
+Tue Nov 23 17:29:28 1993 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * config/h8300/tm-h8300.h (BREAKPOINT): Insn changed to sleep.
+ (DECP_PC_AFTER_BREAK): Now is 0.
+ * config/h8500/tm-h8500.h (REGISTER_BYTES, REGISTER_BYTE,
+ REGISTER_NAMES): update to new view. (INIT_EXTRA_FRAME_INFO): No
+ extra frame info now.
+ * config/sh/sh.h (NOP): Define NOP insn.
+ * config/z8k/tm-z8k.h (BIG): is now sim_z8001_mode.
+ * config/z8k/z8ksim.mt (TDEPFILES): Add remote-sim.o to list.
+ * ser-go32.c: Lint. (strncasecmp): Removed, now in libiberty.
+ (go32_readchar): Special handling for faster polling. (async
+ structure): Volatile.
+ * h8300-tdep.c (print_register_hook): Allocate and use the right
+ number bytes for the raw register.
+ * h8500-tdep.c (regoff, frame_find_saved_reg, examine_prologue):
+ deleted. (h8500_register_size, h8500_register_virtual_type, ):
+ Use new way of counting registers.
+ * remote-e7000.c (echo_index): deleted. (expect): Better handling
+ of user interrupts. (expect_prompt): Remove never used log file
+ support. (want, want_nopc): Add support for H8/300H.
+ (fetch_regs_from_dump): Treat \r and \n as whitespace.
+ (e7000_drain): Send an "end" command before waiting for output to
+ stop. (e7000_wait): Cope with H8/300H, better handling of user
+ interrupts. (why_stop, expect_n, sub2_from_pc): New function.
+ * remote-utils.c (gr_load_image): call fflush and QUIT more regularly.
+ * utils.c (notice_quit): New function for polling for user interrupts.
+
+Fri Dec 10 15:53:56 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * stabsread.c (read_array_type): Allow negative array bounds,
+ without interpreting that to mean "adjustable."
+ * ch-valprint.c (chill_val_print): Handle RANGE types.
+ * ch-typeprint.c (chill_type_print_base): Handle BOOL.
+ Handle variant records. Handle RANGE types.
+
+Tue Dec 7 15:41:32 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/mips/idt.mt: Use tm-idt.h instead of tm-bigmips.h.
+ * config/mips/idtl.mt: Use tm-idtl.h instead of tm-mips.h.
+ * config/mips/tm-idt.h, config/mips/tm-idtl.h: New files; use
+ different BREAKPOINT value for IDT.
+
+ * mipsread.c: Include bfd.h and coff/sym.h.
+
+Mon Dec 6 16:34:10 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * ser-unix.c (set_tty_state): set the rest of the terminal state
+ pieces.
+
+Mon Dec 6 12:01:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * configure.in: Recognize mips* for all mips targets.
+ (mips*el-*-elf*, mips*-*-elf*): New targets; use idt and idtl.
+
+ Added Irix 5 support.
+ * configure.in (mips-sgi-irix5*): New host and target. Use irix5
+ for both.
+ * config/mips/irix5.mh, config/mips/irix5.mt,
+ config/mips/xm-irix5.h, config/mips/nm-irix5.h,
+ config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support.
+ * mdebugread.c: New file, split out of mipsread.c. Added
+ elfmdebug_build_psymtabs routine. Added some checks on external
+ symbols. Changed code to keep ecoff_debug_info and
+ ecoff_debug_swap structs in the psymtab and in global pointers
+ rather than retrieving them from the bfd. Also changed to keep
+ the pending list with the psymtab rather than the objfile (each
+ psymtab for a single objfile points to the same pending list).
+ * mipsread.c: Bulk of file moved into mdebugread.c, leaving just
+ the sym_fns.
+ * Makefile.in (SFILES): Added mdebugread.c.
+ (OBS): Added mdebugread.o.
+ (mdebugread.o): New target.
+ * symfile.h: Declare mdebug_build_psymtabs and
+ elfmdebug_build_psymtabs.
+ * elfread.c (struct elfinfo): Added mdebugsect field.
+ (elf_locate_sections): Remember location of .mdebug section.
+ (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug
+ section.
+ * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined.
+ (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see
+ if PC is at the start of a function.
+ * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and
+ give it a default definition.
+ (mips_skip_prologue): Skip instructions which initialize $gp
+ register.
+ (in_sigtramp): New procedure, moved in from mipsread.c.
+ * config/mips/tm-mips.h: Declare in_sigtramp.
+
+ * serial.h (serial_fdopen): Make parameter const to match
+ function definition.
+
+Fri Dec 3 14:20:43 1993 Stu Grossman (grossman at cygnus.com)
+
+ * config/mips/irix4.mh: Enable ser-tcp.o.
+
+Tue Nov 30 15:24:24 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * Makefile.in (check): Do not use subdir_do, so that
+ TARGET_FLAGS_TO_PASS is used correctly.
+
+Mon Nov 29 16:10:38 1993 Stu Grossman (grossman at cygnus.com)
+
+ * i386-nlmstub.c: Undo I/O redirection changes by Tom Lord.
+ These definitely won't work under Netware.
+
+Mon Nov 29 15:34:58 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * stabsread.c(read_struct_field): Fix the check when getting to
+ member functions.
+
+Mon Nov 29 16:48:16 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ gcc -Wall -O lint:
+ * mips-tdep.c (heuristic_proc_desc): Initialize reg30 to avoid
+ warning. Unnest comment.
+ (init_extra_frame_info): Remove unused variable mask.
+ (MASK): Fully parenthesize.
+ (mips_push_dummy_frame): Remove unused variable val.
+ (mips_skip_prologue): Remove unused variables f and b.
+
+Mon Nov 29 12:23:25 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_symbol, parse_partial_symbols): Do not create
+ (partial) symbols for opaque struct definitions.
+
+Mon Nov 29 11:36:57 1993 Stu Grossman (grossman at cygnus.com)
+
+ * i386ly-tdep.c (i386lynx_saved_pc_after_call): Change call_inst
+ to unsigned char to avoid domain warning for some values.
+
+Mon Nov 22 23:42:59 1993 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote-e7000.c (e7000_wait): Cope with H8/300 register dump.
+ * config/h8300/h8300hms.mt: Add remote-e7000.
+
+Mon Nov 22 11:03:45 1993 Fred Fish (fnf@cygnus.com)
+
+ Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
+ * gdb/config/m88k/delta88.mh (NATDEPFILES): Added corelow.o and
+ coredep.o to this list.
+ * gdb/m88k-nat.c (m88k_register_u_addr): Avoid error when passed
+ the number for an M88110 extended register by just returning the
+ address of r0.
+
+Sat Nov 20 09:20:51 1993 Fred Fish (fnf@rtl.cygnus.com)
+
+ * go32-xdep.c (re_comp, re_exec): Remove stubs now that gdb
+ always uses it's own version of regex.
+
+Fri Nov 19 18:23:19 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * valops.c(value_struct_elt_for_reference): enhance search operator in
+ c++.
+ * symtab.c(decode_line_1): same as above.
+
+Fri Nov 19 15:08:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (decode_line_1): Add comment about use of
+ return_to_top_level directly instead of error. Add comment saying
+ that the '' should not be needed--that the completer should be fixed.
+
+Fri Nov 19 11:00:33 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * symtab.c(decode_line_1): fix the inconsistency of setting
+ breakpoint with '' or without them. The '' is needed when you
+ want name completion.
+
+Thu Nov 18 08:25:50 1993 Fred Fish (fnf@cygnus.com)
+
+ * valprint.c (val_print_string): When looking for a null
+ terminator compare current bufsize to fetchlimit to determine
+ when to stop, instead of computing buffer+fetchlimit which
+ may overflow for very large limits (like "unlimited").
+
+Wed Nov 17 18:23:09 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * eval.c(evaluate_subexp): to use unified search so type conversion
+ operator works in calling method.
+ * valarith.c(value_x_binop, value_x_unop): same as above.
+ * valops.c(search_struct_method): same as above.
+
+Wed Nov 17 18:47:34 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * mipsread.c: Change use of ECOFF information to correspond to
+ changes in bfd/libecoff.h.
+ (mipscoff_symfile_offsets): Made static.
+
+Wed Nov 17 09:43:31 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * valops.c (typecmp): improve prototype matching when calling
+ a method. Make 'p (*(ostream *) &cout) << "lll" ' to work.
+ * eval.c(evalute_subexp): fix operator search problem when call
+ like p x.'operator+'(i).
+
+Tue Nov 16 17:15:03 1993 Stu Grossman (grossman at cygnus.com)
+
+ * i386ly-nat.c, i386lynx-nat.c, m68kly-nat.c: Remove. Move
+ common code into lynx-nat.c.
+ * lynx-nat.c: New module. Contains portable code for Lynx native
+ stuff (mostly ptrace related).
+ * config/i386/i386lynx.mh (NATDEPFILES): i386ly-nat.o -> lynx-nat.o
+ * config/m68k/m68klynx.mh (NATDEPFILES): i386ly-nat.o -> lynx-nat.o
+
+ * config/nm-lynx.h, config/tm-lynx.h: New files to contain
+ non-architecture specific native and target defs.
+ * config/i386/nm-i386lynx.h, config/i386/tm-i386lynx.h,
+ config/m68k/nm-m68klynx.h, config/m68k/tm-m68klynx.h: Move all
+ (arch) portable stuff into ../{tm nm}-lynx.h.
+
+Tue Nov 16 13:33:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (gdb_mangle_name): Only assume that the physname is
+ the entire mangled name if it looks like the mangled name of a
+ constructor. Needed for testsuite to work with GCC 2.4.5.
+
+ * a68v-nat.c: Replace with new version from Troy Rollo. The
+ version I am replacing appears to be an old copy of sun3-nat.c.
+ * dstread.c (dst_symfile_read): Replace sort_all_symtab_syms call
+ with loop.
+
+ * Makefile.in (TAGS): Depend on TAGFILES_{NO,WITH}_SRCDIR.
+
+ * Makefile.in: (HFILES,TAGFILES): Split into _WITH_SRCDIR and
+ _NO_SRCDIR versions.
+ (TAGS): Only add srcdir to TAGFILES_NO_SRCDIR.
+ (This is part of a long saga involving me putting srcdir on
+ everything (perhaps for now-obsolete reasons, I forget), Rich
+ removing the srcdir from everything, Stu putting it back some
+ places for Sun make, and me just now getting around to fixing
+ `make TAGS' again).
+
+Mon Nov 15 12:29:10 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * stack.c(print_frame_info): print demangled function name
+ ansi style.
+
+Mon Nov 15 14:32:29 1993 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote-e7000.c: New file to cope with the Hitachi E7000 ICE.
+ * remote-utils.c, remote-utils.h (gr_load_image): New function to
+ download to target.
+ * h8300-tdep.c, h8500-tdep.c, remote-z8k.c, sh-tdep.c z8k-tdep.c
+ (sim_load): delete.
+ * remote-sim.c (gdbsim_load): Use gr_load_image, rather than
+ sim_load.
+ * config/sh/sh.mt: Add remote-e7000
+
+Mon Nov 15 11:38:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/linux.mh: Remove XM_CLIBS, TERMLIB, SYSV_DEFINE, and
+ REGEX.
+ * config/i386/xm-linux.h: Don't include xm-i386v.h. Define
+ HOST_BYTE_ORDER ourselves. Define HAVE_TERMIOS not HAVE_TERMIO.
+ Define NEED_POSIX_SETPGID. Include unistd.h.
+
+Mon Nov 15 12:29:10 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * symtab.c(gdb_mangle_name): fix the problem with constructor
+ name mangling.
+
+Mon Nov 15 11:38:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
+ * gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
+ what cleanup_undefined_types does for arrays, except we clear
+ TYPE_FLAG_TARGET_STUB if we fix up the type.
+ * stabsread.c (cleanup_undefined_types): Add comments about how
+ doing arrays here is no longer the clean way to do it.
+ (read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
+ add_undefined_type.
+ * c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
+ outside switch so it happens for all type codes.
+ * cp-valprint.c (cp_print_value_fields): Recurse to val_print,
+ instead of c_val_print, so that check_stub_type gets called.
+
+ * gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
+ TYPE_FLAG_SIGNED. It was inconsistently set, never checked
+ (except in recursive_dump_type), and is pointless.
+
+Mon Nov 15 00:40:38 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (pa_symfile_init): Look for the $TEXT$ section rather
+ than the .text section.
+
+Sun Nov 14 00:28:13 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c: Remove #if 0'd dbx_class_complaint. We now handle
+ this (more or less) gracefully, and complain() was never a good
+ way of dealing with this.
+
+ * stabsread.c (read_type): Skip the colon when reading a
+ cross-reference. Only complain, not error_type, on unrecognized
+ cross-reference types. error_type, not dump core, if the colon is
+ missing.
+
+Fri Nov 12 16:23:08 1993 Stu Grossman (grossman at cygnus.com)
+
+ * config/m68k/tm-sun3.h: Disable use of alternate breakpoint insn
+ when doing remote stuff.
+
+Fri Nov 12 16:22:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-exp.y (yylex): Call lookup_symtab not lookup_partial_symtab.
+
+ * partial-stab.h: Ignore ':' symbol descriptors. Same case as
+ Kung's stabsread.c change.
+
+Fri Nov 12 11:18:02 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * stabsread.c (patch_block_stabs, define_symbol, read_type): in
+ g++ template instantiation, nested class can be part of the
+ params, and '::' can gets into symbol or type names. This is
+ to fix the problem.
+
+ * gdbtypes.c (lookup_struct_elt_type): Handle type ref or pointer
+ to struct/union case.
+
+Fri Nov 12 10:39:31 1993 Stu Grossman (grossman at cygnus.com)
+
+ * coff-solib.c (coff_solib_add): Cast result of alloca().
+ * m68k-tdep.c (m68k_saved_pc_after_call): Get rid of
+ GDB_TARGET_IS_SUN3. Use more general SYSCALL_TRAP macro.
+ * config/m68k/m68klynx.mh (NATDEPFILES): Remove exec.o (it's
+ already in TDEPFILES).
+ * config/m68k/tm-m68k.h (SAVED_PC_AFTER_CALL): Use
+ m68k_saved_pc_after_call.
+ * Remove all Sun3 specific stuff.
+ * (FIX_CALL_DUMMY): Cast arg to bfd_putb32 to unsigned char *.
+ * config/m68k/tm-m68klynx.h: Define SYSCALL_TRAP as trap #10.
+ Disable REMOTE_BREAKPOINT mechanism.
+ * config/m68k/tm-sun3.h: Get rid of GDB_TARGET_IS_SUN3.
+ * Protect from multiple includion.
+ * Move Sun3 specific stuff from tm-m68k.h to here.
+ * Define SYSCALL_TRAP as trap #0.
+ * Remove def of SAVED_PC_AFTER_CALL (now in tm-m68k.h).
+ * gdbserver/low-lynx.c: Redo all register store/fetch stuff to
+ make it portable for 386 and 68k.
+
+Fri Nov 12 09:53:26 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mips-tdep.c (init_extra_frame_info): Check to see whether the
+ registers mentioned in the proc_desc have been saved. This
+ generalizes mips_in_lenient_prologue in the sense that we keep
+ searching until we've found saves for all the registers, not just
+ look for a "lenient prologue" pattern.
+ * mips-tdep.c: #if 0 lenient prologue code.
+
+ * mips-tdep.c (heuristic_proc_desc): Don't assume a host short
+ is 16 bits.
+
+Thu Nov 11 19:58:05 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/i386sol2.mh: Comment out corelow.o.
+
+ * printcmd.c (address_info): Use filtered, not unfiltered functions.
+ We should be able to deal with a QUIT here.
+
+Thu Nov 11 15:22:20 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * printcmd.c (address_info): Use fprintf_symbol_filtered
+ to print the symbol name.
+
+ * stabsread.c (define_symbol): Handle cfront lossage for
+ struct/union/enums and typedefs.
+
+ * partial-stab.h (case N_BINCL): Update psymtab_language
+ as appropriate when changing subfiles.
+ (case N_SOL): Update psymtab_language as appropriate when
+ changing subfiles. Add typedef for structs, unions, and enums
+ when processing C++ files.
+
+Thu Nov 11 13:18:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * README: Remove information on languages and just cite the (newly
+ updated) information in doc/gdb.texinfo instead.
+
+ * delta68-nat.c: Fix typos (add missing ");" and stuct -> struct).
+
+Wed Nov 10 09:31:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c (process_one_symbol, N_RBRAC): Don't clear
+ within_function just because local_symbols is NULL. It appears
+ that this bug has existed since the 10 Apr 89 change which started
+ clearing within_function here.
+
+ * config/m68k/tm-m68k.h: Clean up CALL_DUMMY comment.
+ * config/m68k/{tm-hp300bsd.h,tm-hp300hpux.h,tm-m68k-em.h,
+ tm-monitor.h,tm-sun3.h,tm-vx68.h}, config/sparc/tm-sparc.h:
+ Define BELIEVE_PCC_PROMOTION.
+ * dbxread.c: Remove BELIEVE_PCC_PROMOTION define. The code which
+ used this was moved to stabsread.c a long time ago.
+
+ * dstread.c (dst_sym_fns): Update for flavours.
+ * symfile.c (find_sym_fns): Add kludge for apollo like for rs/6000.
+ * dstread.c (dst_symfile_offsets): Set objfile->num_sections.
+
+ gcc -Wall lint:
+ * thread.c: Include "gdbcmd.h" and <ctype.h>.
+ * Makefile.in: Update dependency.
+ * thread.c (thread_command): Remove unused variable p.
+ * values.c (unpack_double): Use len instead of TYPE_LENGTH (type).
+ * valprint.c (print_floating): Correctly check sign bit now that
+ we are using unsigned arithmetic.
+ * symtab.c (find_pc_line_range): Remove unused variables exact_match,
+ ind, and l.
+
+Tue Nov 9 17:42:25 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * valarith.c (value_x_binop): fix search operator in class bug
+ * valarith.c (value_x_unop): fix search operator in class bug
+
+Tue Nov 9 19:20:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (init.c): Add udi2go32.o to list of files that we
+ should not try to search for _initialize_* functions.
+
+ * remote-udi.c (udi_wait): Change UDIGdb_StdoutReady back to
+ UDIStdoutReady. It accidentally got changed on 24 Oct 93 when
+ stdout was changed to gdb_stdout. Likewise for UDIGetStdout,
+ UDIStderrReady, and UDIGetStderr.
+
+Tue Nov 9 12:48:06 1993 Tom Lord (lord@cygnus.com)
+
+ * remote-hms.c (hms_wait): fixed too many arguments to putc_unfiltered.
+
+Tue Nov 9 12:20:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (quit): Also call gdb_flush on standard output and error.
+
+ * .gdbinit: Remove "source /.gdbinit". It causes a spurious error
+ if /.gdbinit doesn't exist (and I know of no convention of putting
+ something in /.gdbinit).
+
+Mon Nov 8 18:17:11 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * cp-valprint.c (cp_print_value_fields): change output from <no
+ value> to <optimized out or zero length>
+
+Mon Nov 08 17:05:30 1993 Jeffrey Wheat (cassidy@cygnus.com)
+
+ * Makefile.in: Change RUNTEST_FLAGS back to RUNTESTFLAGS
+ Change RUNTEST = runtest to test for existance of
+ a runtest in the source tree first.
+
+Mon Nov 8 10:42:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Remove unused variable GCC. Remove "#CC=cc" line
+ which doesn't really relate to anything.
+
+ * Makefile.in (CC_FOR_TARGET): Test for existence of gcc/xgcc, not
+ for existence of gcc/Makefile.
+
+ * inflow.c (terminal_init_inferior), infptrace.c (child_resume):
+ Add comments about use of Lynx PIDGET and how we will want to
+ clean it up.
+
+ * stabsread.c: Remove long_kludge_name code (it was already #if 0).
+ * stabsread.c (read_one_struct_field): Clean up comments to reflect
+ Kung's change of 5 Nov 93.
+ * stabsread.c (read_one_struct_field): Don't give up on unknown
+ visibility character, just shove it in fip->list->visibility.
+ (read_baseclasses): Don't give up on unknown virtual or visibility
+ characters, just assume a reasonable default, complain, and keep
+ going.
+ (attach_fields_to_type): Complain on unrecognized visibility.
+ One result of all this is that '9' (VISIBILITY_IGNORE) can be used
+ in a stab as well as being something which GDB uses internally.
+
+Mon Nov 8 07:57:30 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * configure.in: Remove h8300h, we have multilib now.
+
+Mon Nov 8 06:11:24 1993 D. V. Henkel-Wallace (gumby@cirdan.cygnus.com)
+
+ * configure.in: Add unixware as a configuration alias for x86
+ sysv4
+
+ * config/i386/i386nw.mt: add i387-tdep.o, exec.o to TDEPFILES
+
+Sun Nov 7 23:49:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.c (decode_line_1, decode_line_2): Do not adjust pc by
+ FUNCTION_START_OFFSET if funfirstline is not set.
+
+Fri Nov 5 17:19:30 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * gdbtypes.h : add a field 'ignore_field_bits in cplus_specific,
+ and macros to handle the bits.
+ * stabsread.c (read_one_struct_field): add VISIBILITY_IGNORE, and
+ for field of length 0, set this bit on.
+ * cp-valprint.c (cp_print_value_fields): for VISIBILITY_IGNORE
+ field, print <no value>.
+
+Fri Nov 5 14:43:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Version 4.11.2.
+
+Fri Nov 5 09:49:22 1993 Stu Grossman (grossman at cygnus.com)
+
+ * inflow.c (terminal_init_inferior): Temporarily use Lynx PIDGET
+ macro to set process groups.
+ * infptrace.c (child_resume): Temporarily use Lynx PIDGET to
+ specify resumption of all threads.
+ * infrun.c (wait_for_inferior): Fix handling of thread-specific
+ breakpoints for systems where DECR_PC_AFTER_BREAK > 0 (ie: backup
+ PC by the right amount when continuing the thread).
+ * thread.c (thread_apply_command): Add the `thread apply'
+ command to apply a given GDB command to a list of threads.
+
+Fri Nov 5 05:58:03 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in (init.c): Don't call sed if filename is empty.
+
+Thu Nov 4 08:27:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c (unknown_symchar_complaint): Make message refer to
+ "symbol descriptor" not "symbol type character" for consistency
+ with stabs.texinfo terminology.
+
+ * stabsread.c (read_struct_fields): Accept either '$' or '.' as
+ the character which introduces a cpp_abbrev or anonymous type.
+
+ * c-lang.c (c_printstr): Print "" to stream (like all the other
+ output from this function), not gdb_stdout.
+
+ * dbxread.c (process_one_symbol): Do relocate 'S' symbols by
+ the text offset (revert 12 Oct 93 change).
+
+ * configure.in: Make hppa*-*-hiux* use hppahpux,
+ not non-existent hppahiux.
+
+Wed Nov 3 16:24:09 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * values.c (value_fn_field): when physical name not found, do not
+ error, but return null.
+ * valops.c (value_struct_elt): when name and args match does not
+ mean it is the one, some times a typedef class can have the same
+ member method and args. This probably will not happen with new
+ version of g++, but it does happen in old g++ and cause gdb error.
+
+Wed Nov 3 09:20:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ Merge changes for dos x udi:
+ * Makefile.in (udi2go32.o): add rule to build this file
+ * 29k-share/udi/udi2go32.c: new file
+ * config/a29k/a29k-udi.mt: add udi2go32.o
+ * 29k-share/udi/{udr.c, udip2soc.c}: #ifdef out the entire file
+ if __GO32__ is defined. What a hack.
+
+Wed Nov 3 09:20:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c (putpkt, getpkt): Don't call interrupt_query.
+
+ * findvar.c (value_of_register): Rename val to reg_val to avoid
+ name conflict with some (e.g. tm-m68k.h) REGISTER_CONVERT_TO_VIRTUAL.
+
+ * main.c: Add variables source_line_number, source_file_name,
+ source_error, source_error_allocated, and source_pre_error.
+ (command_line_input): If source_file_name set, increment
+ source_line_number and set error_pre_print with them.
+ (source_command): Set source_* and make a cleanup so they get
+ set back.
+
+Tue Nov 2 16:28:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stack.c (down_silently_command): Add comment about PR 1913.
+
+ * breakpoint.c (insert_breakpoints, delete_breakpoint): Call
+ target_terminal_ours_for_output before attempting output.
+
+ * fork-child.c (fork_inferior): Fix comment so that it suggests
+ "set shell" rather than having "set env SHELL" affect GDB's
+ operation.
+
+Tue Nov 2 15:03:08 1993 Tom Lord (lord@rtl.cygnus.com)
+
+ * utils.c (vfprintf_unfiltered): don't use maybe_filtered
+ since it involves a fixed size buffer.
+
+Tue Nov 2 13:42:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * findvar.c (value_of_register, value_from_register),
+ hppa-tdep.c (pa_print_fp_reg), infcmd.c (do_registers_info),
+ valops.c (value_assign): Use REGISTER_CONVERT_TO_* only if
+ REGISTER_CONVERTIBLE is defined, otherwise just copy the content.
+ Pass desired type to REGISTER_CONVERT_TO_*.
+
+ * config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*):
+ Pass length of desired type to store/extract_floating.
+ * config/i386/tm-arm.h, config/i386/tm-i386aix.h,
+ config/i386/tm-sun386.h, config/i386/tm-symmetry.h,
+ config/m88k/tm-m88k.h config/rs6000/tm-rs6000.h (REGISTER_CONVERT_*):
+ Use extract_floating and store_floating with length of desired type.
+ * config/m68k/tm-news.h (STORE,EXTRACT_RETURN_VALUE): Add type
+ parameter to REGISTER_CONVERT_*.
+
+ * config/a29k/tm-a29k.h, config/convex/tm-convex.h,
+ config/gould/tm-np1.h, config/gould/tm-pn.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/i386/tm-i386v.h,
+ config/mips/tm-mips.h, config/ns32k/tm-merlin.h,
+ config/ns32k/tm-umax.h, config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
+ config/sh/tm-sh.h, config/sparc/tm-sparc.h, config/tahoe/tm-tahoe.h,
+ config/vax/tm-vax.h, config/z8k/tm-z8k.h (REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Remove
+ versions for which REGISTER_CONVERTIBLE is always false.
+ * z8k-tdep.c (register_convert_to_virtual, register_convert_to_raw):
+ Remove, no longer used.
+
+ * alpha-tdep.c (alpha_register_convert_to_raw,
+ alpha_register_convert_to_virtual): New routines to handle
+ the different raw formats in alpha floating point registers.
+ * config/alpha/tm-alpha.h (REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use them.
+
+Tue Nov 2 12:45:23 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * gdbserver/configure.in: Recognize *-*-lynxos* instead of
+ *-*-lynx*, recognize sparc-*-lynxos*.
+ * gdbserver/Makefile.in (install, install_only): Add.
+ * gdbserver/gdbserver.1: New file, man page for gdbserver.
+
+Tue Nov 2 03:01:01 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Include <time.h> and <sys/types.h>. Change include
+ of "libhppa.h" to "som.h".
+ (BYTES_IN_WORD): Define.
+ (hppa_sym_fns): "hppa" is 4 characters, not 5.
+
+Mon Nov 1 09:40:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c, symtab.h, source.c: Change find_line_pc_range to take
+ a struct symtab_and_line argument, rather than a symtab and a line.
+ Re-write it to be based on the address rather than bogusly adding
+ one to the line number and hoping that has something to do with the
+ end of the line.
+
+ * config/m88k/m88k.mh (NATDEPFILES): Remove exec.o.
+
+ * paread.c (pa_symtab_read): Change comments to say ignoring
+ labels really should be handled by the assembler/compiler.
+
+ * Makefile.in: Add -O to CXXFLAGS.
+
+ * TODO: Expand comments on fast watchpoints.
+
+Sun Oct 31 19:45:06 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (pa_symtab_read): Also filter out local symbols
+ starting with "L$".
+
+Sun Oct 31 09:28:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,
+ coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
+ Change from using bfd target name to using the flavour.
+
+ * objfiles.h, infcmd.c, symfile.c: Add comments about how various
+ objfiles get created and when we should blow them away.
+
+Sat Oct 30 08:32:53 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symfile.c (reread_symbols): When re-reading symbols, do all the
+ right operations ourself, rather than calling symbol_file_command.
+ If we re-read something, call clear_symtab_users not just
+ breakpoint_re_set.
+ * objfiles.h, objfiles.c (build_objfile_section_table): No longer
+ static.
+ * symfile.c (clear_symtab_users): Call clear_pc_function_cache.
+ * coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c
+ (*_symfile_offsets): Set objfile->num_sections.
+ * remote.c (remote_wait), symfile.c (syms_from_objfile):
+ Don't muck with objfile->num_sections now that all the symbol
+ readers set it.
+ * elfread.c: Clean up obsolete comment about handling only DWARF.
+ * paread.c: Remove comment about how we should use an "ordinary"
+ file format with an hppa suffix. There is nothing ordinary about SOM.
+
+ * config/i386/{i386m3.mh,i386mk.mh}, config/mips/mipsm3.mh,
+ config/ns32k/ns32km3.mh: Change MMALLOC_LIB to MMALLOC.
+ * TODO: Update Mach stuff.
+
+Fri Oct 29 16:30:36 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ LynxOS support:
+ * configure.in: Change *-*-lynx* to *-*-lynxos*, add
+ sparc-*-lynxos*.
+ * Makefile.in (ALLDEPFILES): Add m68kly-nat.c, sparcly-nat.c.
+ Rename i386lynx-nat.[co] to i386ly-nat.[co].
+ (ALLCONFIG): Add config/{m68k,sparc}/{m68k,sparc}lynx.m[ht].
+ (m68kly-nat.o, sparcly-nat.o): Add rules.
+ * i386ly-tdep.c: Cosmetics.
+ * i386lynx-nat.c: Removed.
+ * i386ly-nat.c: New file, was i386lynx-nat.c.
+ * m68kly-nat.c: New file.
+ * sparcly-nat.c: New file.
+ * config/xm-lynx.h: New file, cpu-independent host info.
+ * config/i386/i386lynx.mh: Changes for consistency.
+ * config/i386/i386lynx.mt: Ditto.
+ * config/i386/tm-i386lynx.h: Ditto.
+ * config/i386/nm-i386lynx.h: Ditto.
+ * config/i386/xm-i386lynx.h: Include config/xm-lynx.h.
+ * config/m68k/m68klynx.mh, config/m68k/m68klynx.mt,
+ config/m68k/tm-m68klynx.h, config/m68k/nm-m68klynx.h,
+ config/m68k/xm-m68klynx.h: New files, M68K LynxOS support.
+ * config/sparc/sparclynx.mh, config/sparc/sparclynx.mt,
+ config/sparc/tm-sparclynx.h, config/sparc/nm-sparclynx.h,
+ config/sparc/xm-sparclynx.h: New files, Sparc LynxOS support.
+
+Fri Oct 29 08:11:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * defs.h, findvar.c (extract_floating, store_floating): New functions.
+ * Move SWAP_TARGET_AND_HOST from defs.h to findvar.c because it is
+ now used only by extract_floating and store_floating.
+ * valprint.c (print_floating): Use unsigned arithmetic. Use
+ extract_unsigned_integer instead of SWAP_TARGET_AND_HOST.
+ Change sizeof (float) to 4 and sizeof (double) to 8 (those are always
+ the relevant sizes for this code, which is in #ifdef IEEE_FLOAT).
+ * values.c (unpack_long, unpack_double, value_from_double),
+ valarith.c (value_binop), stabsread.c (define_symbol):
+ Use extract_floating and store_floating instead of
+ SWAP_TARGET_AND_HOST.
+ * config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*):
+ Use extract_floating and store_floating.
+ * config/m88k/tm-m88k.h: Add comments (it should be doing the same).
+ * i386-tdep.c (i386_extract_return_value),
+ * remote-nindy.c (nindy_store_registers): Use store_floating.
+
+Fri Oct 29 09:31:38 1993 Steve Chamberlain (sac@rtl.cygnus.com)
+
+ * remote-sim.c (gdbsim_store_register): Change var name so
+ it compiles with non-ANSI compilers.
+
+Fri Oct 29 08:11:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add idea for "disassemble" with source.
+
+Fri Oct 29 00:41:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.11.1 after release and cvs
+ tagging.
+
+Thu Oct 28 09:14:42 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add section on Mach. Stop calling it a "bug list".
+ Remove John's name and email address. Remove item on "always"
+ ("hook-stop" takes care of this). Remove item on executables with
+ no symbols (this works on some machines, at least). Remove item
+ about calling error() during symbol reading (I think all the important
+ ones have been cleaned up). Revise items about signals and remote
+ systems. Remove section on ^Z requiring several continues to make
+ it go (this now works. Perhaps the item is based on confusion over
+ programs (like GDB itself) which catch SIGTSTP and then re-send
+ themselves the signal. PR 2575 might contain relevant info).
+
+Thu Oct 28 16:55:34 1993 Fred Fish (fnf@cygnus.com)
+
+ * NEWS: Note improvements in C++ support, preliminary thread
+ implementation, and LynxOS native and target support for 386.
+
+Thu Oct 28 16:55:34 1993 Fred Fish (fnf@cygnus.com)
+
+ * README: Add note from Peter Schauer about OSF/1 shared
+ libraries. Add note from Pace Willisson about configuring on BSDI
+ BSD/386 release 1.0. Update gdb references to gdb 4.11.
+
+Thu Oct 28 09:14:42 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * NEWS: Add notes about Alpha and "set remotedebug" for UDI.
+
+ * valops.c (value_assign): Change bitfield code to use a buffer of
+ the correct size, rather than an int.
+
+Wed Oct 27 13:43:07 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/{i386m3.mt,i386m3.mh},
+ config/mips/{mipsm3.mt,mipsm3.mh},
+ config/ns32k/{ns32km3.mt,ns32km3.mh}: Use correct names for TM_FILE
+ and XM_FILE. Replace host files *mach3-xdep.o with native
+ files *m3-nat.o. Replace host file os-mach3.o with native
+ file m3-nat.o.
+
+ * remote-udi.c: Remove LOG_FILE stuff; superceded by "set remotedebug".
+ * remote-mon.c: Remove commented out "set remotedebug" command.
+ * remote-nindy.c: Clean up comment about wanting alternative to
+ options specified on the GDB command line.
+
+ * fork-child.c (fork_inferior): Set inferior_pid before calling
+ init_trace_fun. Move the code which gets us through the shell
+ to new function startup_inferior.
+ * inferior.h: Declare startup_inferior.
+ * procfs.c (procfs_init_inferior), inftarg.c (ptrace_him):
+ Call startup_inferior.
+ * m3-nat.c (m3_trace_him): Call intercept_exec_calls.
+ * config/nm-m3.h: Don't define STARTUP_INFERIOR.
+ * config/i386/tm-i386m3.h, config/ns32k/tm-ns32k.h,
+ config/mips/tm-mipsm3.h: Don't define START_INFERIOR_TRAPS_EXPECTED.
+
+ * m68k-stub.c: Change vector 13 from SIGFPE to SIGBUS.
+
+Tue Oct 26 22:05:03 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * mips-tdep.c (mips_pop_frame): If proc_desc is NULL, don't dump core.
+
+Tue Oct 26 15:07:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ gcc -Wall lint:
+ * nlmread.c: Include stabsread.h.
+ * Makefile.in: Update dependencies.
+
+ * remote.c: Change PBUFSIZ back to 400. John's 28 Feb 1992 change
+ to increase it broke the ability to write large chunks of memory
+ with m68k-stub and i386-stub. Now we only use more than 400 on
+ machines where we need that much to write the registers.
+ * remote.c (remote_write_bytes): Eliminate possible abort(). The
+ check for when to abort was off by a few bytes and besides which,
+ it is handled by MAXBUFBYTES, which the caller uses.
+ * m68k-stub.c: Add comments about trap #1 and trap #8 instructions.
+
+Tue Oct 26 08:36:07 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * remote-sim.h (SIM_ADDR): New type (same as CORE_ADDR).
+ (sim_set_pc): Update prototype.
+ (sim_read, sim_write): Ditto, and use unsigned char *buf.
+ (sim_fetch_register, sim_store_register): Use unsigned char *buf.
+ (sim_info): Pass printf function as argument, add verbose argument.
+ (sim_stop_reason): Renamed from sim_stop_signal, fix prototype.
+ * remote-sim.c (gdbsim_wait): Update call to sim_stop_reason.
+ (gdbsim_files_info): Update call to sim_info.
+
+Tue Oct 26 10:41:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (value_assign): Call reinit_frame_cache when assigning
+ to a register.
+
+Mon Oct 25 11:08:59 1993 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): Fix PC out of objfile bounds
+ check to just use stop_func_name == 0.
+ * remote-udi.c (store_register): Invalidate NPC/PC_REGNUM after
+ changing PC.
+
+Mon Oct 25 14:57:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/{low-lynx.c,low-sparc.c,low-sun3.c}, standalone.c,
+ m3-nat.c, i386m3-nat.c, mipsm3-nat.c, ns32km3-nat.c: bcopy -> memcpy.
+
+ gcc -Wall lint:
+ * breakpoint.c: Include thread.h.
+ * coffread.c: Include stabsread.h.
+ * Makefile.in: Update dependencies.
+ * breakpoint.c (mention): Add bp_call_dummy to switch.
+ * symmisc.c (dump_symtab): Use %d not %ld for line number.
+
+Sun Oct 24 18:29:32 1993 Tom Lord (lord@rtl.cygnus.com)
+
+ * every non-obsolete file except utils.c:
+ Change the stream argument to _filtered to GDB_FILE *.
+ Change all references to stdout/stderr to gdb_stdout/gdb_stderr.
+ Replace all calls to stdio output functions with
+ calls to corresponding _unfiltered functions.
+ Replaced calls to fopen for output to gdb_fopen.
+ Added sufficient goo to utils.c and defs.h to make the above
+ work.
+
+ The net effect is that stdio output functions are only directly
+ used in utils.c. Elsewhere, the _unfiltered and _filtered
+ functions and GDB_FILE type are used.
+
+ In the near future, GDB_FILE will stop being equivalant to
+ FILE.
+
+ The semantics of some commands has changed in a very subtle way:
+ called in the right context, they may cause new occurences of
+ prompt_for_continue() behavior.
+
+ Please respect this change by not reintroducing stdio output
+ dependencies in the main body of gdb code. All output from
+ commands should go to a GDB_FILE.
+
+Sun Oct 24 20:16:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * parse.c, parser-defs.h (write_exp_msymbol): New function to write
+ the appropriate expression for a minimal symbol. Taken from c-exp.y
+ and m2-exp.y but handles mst_file_*.
+ * c-exp.y, m2-exp.y: Use it.
+
+Sun Oct 24 09:31:05 1993 Fred Fish (fnf@lisa.cygnus.com)
+
+ * elfread.c (elf_symtab_read): Use bfd convention that both
+ initialized and uninitialized data sections have the SEC_ALLOC
+ flag bit set, but only initialized sections have SEC_LOAD set.
+ SEC_DATA is ignored since it only gets set for initialized
+ data.
+
+Sat Oct 23 14:48:18 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * remote-sim.h (sim_stop): New enum.
+ (sim_stop_signal): Change prototype, result is enum sim_stop.
+ * remote-sim.c (gdbsim_wait): Update call to sim_stop_signal.
+
+Fri Oct 22 07:49:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (define_symbol): Skip the whole thing about "pcc
+ promotion" on little-endian machines.
+
+ * remote-vx.c (vx_wait): Rename pid parameter to pid_to_wait_for.
+ Some compilers (legitimately) don't like variables in the
+ function's outermost block whose name is the the same as the name of
+ a parameter.
+
+ Merge Apollo patches from Troy Rollo (troy@cbme.unsw.edu.au):
+ * dst.h, dstread.c, config/m68k/{apollo68b.mt,tm-apollo68b.h}:
+ New files.
+ * config/m68k/nm-apollo68b.h: Add more defines.
+ * configure.in: Recognize apollo target, not just host.
+
+ * configure.in: Add * to end of all OS names.
+
+Fri Oct 22 06:14:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (ALLPARAM): Add config/m88k/xm-delta88v4.h
+
+Thu Oct 21 12:23:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (init.c): Generate using the source, not munch. This
+ cleans up all kinds of hassles (which nm to use in munch, etc). The
+ new formatting conventions (mostly already followed) are that
+ the name of the _initialize_* routines must start in column zero,
+ and must not be inside #if.
+ * munch: Removed.
+ * Makefile.in: Remove references to munch.
+ * serial.c, remote.c, infptrace.c, maint.c, convex-tdep.c,
+ alpha-tdep.c, hp300ux-nat.c, hppab-nat.c, osfsolib.c, remote-es.c,
+ procfs.c, remote-udi.c, ser-go32.c, ultra3-xdep.c, sh-tdep.c,
+ i960-tdep.c, hppa-tdep.c, h8500-tdep.c, dpx2-nat.c, delta68-nat.c,
+ z8k-tdep.c: Make sure the above conventions are followed. Make
+ sure they are all declared as returning void. Clean up
+ miscellaneous comments and such.
+
+ * sh-tdep.c (sim_load): Add function.
+
+Thu Oct 21 15:58:48 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * remote-mips.c (mips_wait): add pid argument.
+
+Thu Oct 21 12:23:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (c-exp.tab.o): Remove notice about shift/reduce conflicts
+ which no longer occur.
+
+ gcc -Wall lint:
+ * findvar.c (symbol_read_needs_frame), corelow.c (ignore),
+ inflow.c (gdb_has_a_terminal): Make sure to return a value.
+ * regex.h: Declare re_set_syntax.
+ * printcmd.c: Include valprint.h.
+ * infcmd.c, exec.c, maint.c, core.c: Include language.h.
+ * maint.c: Include expression.h.
+ * infrun.c, fork-child.c, corelow.c, inflow.c: Include thread.h.
+ * inftarg.c: Include command.h.
+ * coredep.c: Include value.h.
+ * c-exp.y, m2-exp.y, ch-exp.y: Include bfd.h, symfile.h and objfiles.h.
+ * ch-typeprint.c: Include typeprint.h.
+ * ch-valprint.c: Include c-lang.h.
+ * nlmread.c: Include buildsym.h.
+ * environ.c: Include gdbcore.h. Only include defs.h once.
+ (set_in_environ): Cast const char * to char * when passing to
+ set_gnutarget.
+ * Makefile.in: Update dependencies to reflect all these new includes.
+ Remove unused variables:
+ * printcmd.c (printf_command): args_to_vprintf.
+ * coffread.c (coff_symfile_init): strsection.
+ Move variables to within the #ifdefs where they are used:
+ * symtab.c (gdb_mangle_name): opname.
+ * inftarg.c (child_attach): pid and exec_file.
+ * inftarg.c (child_detach): siggnal.
+ * objfiles.c (allocate_objfile): mapto, md, and fd.
+ * objfiles.c (free_objfile): mmfd.
+ * infrun.c (wait_for_inferior): Include BPSTAT_WHAT_LAST in switch.
+ * infrun.c (wait_for_inferior): Remove unused same_pid label.
+ * inferior.h: Declare set_sigint_trap and clear_sigint_trap.
+ * parser-defs.h: Declare write_exp_elt_block.
+ * stabsread.h: Declare elfstab_offset_sections and
+ coffstab_build_psymtabs.
+
+Thu Oct 21 12:05:08 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ Patch from Jeff Law:
+ * paread.c: Fix references to "hppa" that should now be "som".
+
+Thu Oct 21 12:23:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (decode_line_1): Don't use SYMBOL_LINE for functions.
+
+Thu Oct 21 02:59:07 1993 Stu Grossman (grossman at cygnus.com)
+
+ * remote-udi.c (udi_store_registers, store_register): Use
+ UDI29KPC address space when modifying PC. It seems that you can't
+ modify the PC directly (at least in the isstip simulator).
+
+Wed Oct 20 11:35:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.h: Put remote_debug declaration back here. Add baud_rate.
+ * remote.c, remote-udi.c, remote-utils.h: Let target.h take care of
+ declaring these. Those random externs all over are error prone.
+ * Move "set remotebaud" from remote-utils.c to main.c to it applies
+ to remote.c as well.
+
+ * xcoffread.c (xcoff_symfile_read), coffread.c (coff_symfile_read):
+ Sort symtabs for this objfile only, not for all objfiles.
+ * symfile.c, symfile.h (sort_all_symtab_syms): Remove; no longer used.
+
+ * mipsread.c (parse_symbol): In third-eye, a function has a block
+ within it which represents the whole function. Create only one
+ GDB block for both.
+
+Wed Oct 20 17:47:42 1993 Stu Grossman (grossman at cygnus.com)
+
+ * main.c: Make baud_rate and remote_debug be global variables,
+ remove #include "remote-utils.h". This makes it possible to build
+ GDB without remote-utils.c. Also, move setting of remote_debug
+ into main, so that all remote*.c files can use it (not just the
+ serial line ones). And, make baud_rate be an int.
+ * remote-udi.c: Change kiodebug to remote_debug.
+ * remote-utils.c: Move setting of baud rate and debug into main.c.
+ * remote-utils.h: Redefine sr_{get set}_debug and sr_{get set}_baud
+ to use baud_rate and remote_debug globals for compatibility.
+ * remote.c: Use remote_debug and baud_rate globals directly,
+ instead of sr_ functions, so that we don't need to load
+ remote-utils.c.
+ * config/a29k/a29k-udi.mt: Define REMOTE_O as null so that we don't
+ get the default remote* modules.
+
+Wed Oct 20 11:35:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (define_symbol): When combining a LOC_ARG and a
+ LOC_REGISTER, use the type from the LOC_REGISTER, not from the
+ LOC_ARG.
+
+Wed Oct 20 14:34:38 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/i386/xm-go32.h: define some signals if they aren't
+ already defined.
+
+Wed Oct 20 11:35:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (INTERNAL_LDFLAGS): New macro. The new part is
+ that we use CFLAGS and PROFILE_CFLAGS to link.
+ (gdb, rapp, kdb): Use INTERNAL_LDFLAGS instead of
+ LDFLAGS and/or GLOBAL_CFLAGS.
+
+Wed Oct 20 09:29:55 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Add $(srcdir) to all refs to 29k-share
+ directories.
+
+Tue Oct 19 17:23:34 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (ALLCONFIG): Add config/i386/{i386m3.mh, i386m3.mt,
+ i386/i386mk.mh i386/i386mk.mt}, config/mips/{mipsm3.mh,
+ mipsm3.mt}, config/ns32k/{ns32km3.mh, ns32m3.mt}
+ * Makefile.in (remote_utils_h): Add remote-sim.h
+ * Makefile.in (NONSRC): Add i386-nlmstub.c
+ * Makefile.in (HFILES): Add coff-solib.h
+
+Tue Oct 19 14:15:40 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * values.c (value_virtual_fn_field): Fix the offset calculation
+ when calling virtual functions. (gdb.t22/virtfunc.exp).
+ * eval.c (evaluate_subexp): same as above.
+
+Tue Oct 19 10:43:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/rs6000/rs6000.mh (TERMCAP): Define to -lcurses.
+
+ * Makefile.in: Define CXXFLAGS.
+
+Tue Oct 19 09:28:52 1993 Stu Grossman (grossman@cygnus.com)
+
+ * sparclite/Makefile.in: Fixup so that this works with Sun make
+ and VPATH.
+
+Tue Oct 19 10:43:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.h (struct bpstat_what): Don't use bitfields.
+
+ * typeprint.c: Add "class CLASS-NAME" to docstring for ptype.
+
+Tue Oct 19 06:17:10 1993 Fred Fish (fnf@cirdan.cygnus.com)
+
+ * Makefile.in (ALLPARAM): Add config/m88k/{nm-delta88v4.h,
+ tm-delta88v4.h, xm-dgux.h}.
+ * Makefile.in (ALLCONFIG): Add config/m88k/{delta88v4.mh,
+ delta88v4.mt}.
+
+ * README: Remove comment about SunOS 5.x programs leaving
+ coredumps. Info from Sun is that this was not in customer
+ releases.
+
+Mon Oct 18 10:28:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hppa-tdep.c (restore_pc_queue): Call target_terminal_ours after
+ done stepping the inferior.
+
+ * c-exp.y: Remove never-used (because of shift/reduce conflicts)
+ rules for pointers to members.
+ * Makefile.in: Remove notice about expected shift/reduce conflicts.
+
+ * buildsym.c (finish_block): If we pop the context stack and it is
+ not empty, complain () instead of abort ().
+
+Sun Oct 17 19:42:31 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * parse.c, parser-defs.h (follow_types): New function.
+ * c-exp.y (ptype : typebase abs_decl): Use it.
+ * c-exp.y (ptype): Add support for type qualifiers after the
+ typebase. The typebase rule already has support for them before
+ the typebase.
+ * Makefile.in: Change the expected number of shift/reduce
+ conflicts to 6. This is OK--the 2 new conflicts are basically the
+ same as one of the old ones.
+
+Sun Oct 17 13:04:49 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.10.3.
+
+Sun Oct 17 09:18:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Clean up comments which were at
+ the top of the file, making them more concise and moving them with
+ the code (Sorry, Randy, but these stream-of-consciousness comments
+ really have to go). Switch the order of the "&&", which makes
+ things clearer and turns out to be an improvement with respect to
+ side effects and speed.
+
+Sun Oct 17 02:06:01 1993 Stu Grossman (grossman at cygnus.com)
+
+ * procfs.c: Handle process exits more elegantly by trapping on
+ entry to _exit. Also, cleanup procinfo list when process dies of
+ it's own accord (as opposed to being killed).
+
+Sat Oct 16 20:47:30 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m88k/xm-dgux.h: Define NO_PTRACE_H.
+
+ * corelow.c (add_to_thread_list): Need a cast to go from PTR to
+ asection *.
+
+ * infrun.c: Add comment about signals.
+
+ * fork-child.c (fork_inferior): Remove CREATE_INFERIOR_HOOK again.
+ Stu reinstated it (accidently I assume).
+
+Sat Oct 16 15:27:10 1993 Stu Grossman (grossman at cygnus.com)
+
+ * procfs.c (procfs_wait): Losing Unixware can't do poll on /proc
+ files. Use PIOCWSTOP instead.
+ * corelow.c (add_to_thread_list): Fix arg to match prototype.
+
+ * procfs.c (procfs_set_sproc_trap): Don't use this if sproc
+ isn't available.
+ * (procfs_notice_signals): Fix prototype.
+
+Fri Oct 15 22:46:07 1993 Stu Grossman (grossman at cygnus.com)
+
+ * breakpoint.c (breakpoint_thread_match break_command_1):
+ Thread-specific breakpoint support.
+ * breakpoint.h (struct breakpoint): Add thread id field.
+ * fork-child.c (fork_inferior): Move call to init_thread_list()
+ back a bit so that init_trace_fun can do thread functions.
+ * hppa-tdep.c (restore_pc_queue): Add pid to call to target_wait.
+ * hppab-nat.c (child_resume): Handle default pid.
+ * hppah-nat.c (child_resume): Handle default pid.
+ * i386lynx-nat.c (child_wait): New arg pid.
+ * inflow.c (kill_command): Reset thread list.
+ * infptrace.c (child_resume): Handle default pid.
+ * infrun.c: Thread-specific breakpoint support.
+ * inftarg.c (child_wait): Add pid arg.
+ * osfsolib.c (solib_create_inferior_hook): Add pid to call to
+ target_resume.
+ * procfs.c: Multi-thread support.
+ * remote-bug.c (bug_wait): Add pid arg.
+ * remote-hms.c (hms_wait): Add pid arg.
+ * remote-mips.c (mips_wait): Add pid arg.
+ * remote-mon.c (monitor_wait): Add pid arg.
+ * remote-nindy.c (nindy_wait): Add pid arg.
+ * remote-sim.c (gdbsim_wait): Add pid arg.
+ * remote-udi.c (udi_wait): Add pid arg.
+ * remote-vx.c (vx_wait): Add pid arg.
+ * remote-z8k.c (sim_wait): Add pid arg.
+ * remote.c (remote_wait): Add pid arg.
+ * solib.c (solib_create_inferior_hook): Add pid to call to
+ target_resume.
+ * target.h (struct target_ops): Add pid arg to to_wait and
+ to_notice_signals.
+ * thread.c (valid_thread_id): New func to validate thread #s.
+ * (pid_to_thread_id): New func to do the obvious.
+ * thread.h: Prototypes for above.
+
+ * coff-solib.c (coff_solib_add): Use nameoffset field to locate
+ filename.
+
+Fri Oct 15 21:29:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * h8300-tdep.c, h8500-tdep.c: Define sim_load only, but not
+ sim_kill, sim_open, or sim_set_args.
+
+ * stack.c (print_stack_frame): Put catch_errors around
+ print_frame_info so (for example) error printing source doesn't
+ cause auto-displays to get skipped in normal_stop.
+
+ * findvar.c (value_from_register): When preparing to cast a value
+ from REGISTER_VIRTUAL_TYPE to type, copy the REGISTER_VIRTUAL_SIZE;
+ the old code didn't copy the whole thing.
+ * valops.c (value_assign): Add comment.
+
+Fri Oct 15 12:57:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (upgrade_type): Replace bitsize sanity checks and
+ complaint by a comment explaining why they were useless.
+
+Fri Oct 15 14:30:30 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Move comments on bypassing call dummy breakpoint from stack.c
+ to breakpoint.h.
+
+Fri Oct 15 11:52:56 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.c (lookup_partial_symtab): If filename is not found and
+ contains no slashes, try again and compare without leading path
+ components.
+ * symtab.c (lookup_symtab_1): Replace open coded version of
+ lookup_partial_symtab with a function call.
+
+Thu Oct 14 20:34:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * fork-child.c (fork_inferior), remote-eb.c (eb_create_inferior),
+ remote-mon.c (monitor_create_inferior), remote-nindy.c
+ (nindy_create_inferior), remote-st.c (st2000_create_inferior),
+ remote-vx.c (vx_create_inferior): Remove CREATE_INFERIOR_HOOK; it
+ is replaced by init_trace_fun.
+ * config/convex/xm-convex.h, convex-xdep.c: Add comments explaining
+ how to do without CREATE_INFERIOR_HOOK for whoever fixes the Convex
+ port.
+
+ * Makefile.in: Add Mach files to ALLDEPFILES, etc.
+ * m3-nat.c: Clean up more hair--message(), cprocs.
+ * configure.in: Recognize Mach targets and hosts.
+ * config/ns32k/tm-umax.h: Add some #ifndef's so tm-ns32km3.h can
+ include this file.
+ * Mach headers in config/*/tm-*.h: Fix includes to match correct
+ locations of files.
+
+Thu Oct 14 21:35:55 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * remote-mon.c (general_open): Set dev_name. Minor tweaking to get
+ it working again.
+ * config/m68k/tm-monitor.h: Remove floating point register names
+ as there aren't any on any of the monitors that use this code.
+
+Wed Oct 13 11:47:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * inflow.c: Pass pointer to process group, not process group itself,
+ to TIOCSPGRP ioctl.
+
+ * inflow.c (terminal_ours_1): Don't print warning on failure to
+ set process group.
+
+ * printcmd.c (printf_command): Instead of using makeva* and
+ calling vprintf, just make the appropriate calls to printf.
+ * printcmd.c, config/pa/xm-pa.h, config/mips/xm-makeva.h,
+ config/alpha/xm-alpha.h, config/m88k/xm-m88k.h: Remove all
+ traces of makeva*. My apologies to everyone (including me!)
+ who spent so much time getting it to work on various machines,
+ but look at the bright side, at least you won't have to do it
+ again in the future.
+
+ * printcmd.c (printf_command): Make a cleanup for val_args (fixes
+ a memory leak).
+
+Tue Oct 12 22:54:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/xm-mips.h: Remove comment about HAVE_SGTTY vs. usleep.
+
+Tue Oct 12 12:01:29 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: only configure gdbserver for native environments
+
+Tue Oct 12 08:59:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (read_type): Treat a negative type number at the start
+ of a type as a type reference, not as a definition of a type with
+ "50=" omitted. This makes things work on the RS/6000 again (the
+ 14 Sep 1993 change broke it).
+
+ * inflow.c: Use 0 (standard input) not scb->fd.
+ (terminal_ours_1): If printing warning, don't claim it happened in
+ terminal_inferior.
+
+ * blockframe.c (get_prev_frame_info): Don't error() if there are no
+ frames; just return NULL.
+
+ * xcoffsolib.h, xcoffexec.c: Undo the part of Fred's bfd->abfd
+ change which involved structure elements. It was unnecessary and
+ was not consistently done.
+
+ * stabsread.h, stabsread.c, dbxread.c (common_block*, copy_pending):
+ Move common block handling from dbxread.c to stabsread.c.
+ Use the name from the BCOMM instead of the ECOMM.
+ Allocate things on the symbol_obstack.
+ * xcoffread.c (process_xcoff_symbol): Process C_BCOMM, C_ECOMM,
+ and C_ECOML. On unrecognized storage classes, go ahead and call
+ define_symbol (after the complaint).
+
+ * dbxread.c (process_one_symbol): Don't relocate 'S' symbols by
+ the text offset.
+
+Tue Oct 12 12:33:09 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * osfsolib.c (solib_create_inferior_hook): Reset stop_soon_quietly
+ after shared library symbol reading to get rid of warning from
+ heuristic_proc_start.
+
+Tue Oct 12 12:01:29 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * remote-sim.c: fix unterminated character string
+
+Tue Oct 12 08:59:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c: Fix comment about gcc 2.3.3 stab for long long int.
+
+Mon Oct 11 14:27:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m3-nat.c, config/nm-m3.h: Add a target_ops struct and other
+ various things to try to get this to work.
+
+ * symtab.h: Fix comments re headers, sharing blockvectors, etc.
+
+Mon Oct 11 11:46:06 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config/i960/vxworks960.mt (REMOTE_O): add dcache.o and remote-utils.o
+
+Mon Oct 11 02:48:57 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_partial_symbols): Do not add undefined
+ symbols to the partial symbol table.
+ * alpha-tdep.c (init_extra_frame_info): Remove kludge for gcc,
+ gcc has to be compatible with the native tools.
+ * alpha-tdep.c (alpha_push_arguments): Rename NUM_ARG_REGS to
+ ALPHA_NUM_ARG_REGS and move its definition to tm-alpha.h.
+ * config/alpha/tm-alpha.h (FRAME_ARGS_ADDRESS): Change it to the
+ way the native tools define it, update comment.
+
+Fri Oct 8 15:54:06 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * osfsolib.c, remote-sim.c, remote.c, solib.c, xcoffexec.c,
+ xcoffsolib.h: Use 'abfd' for bfd variables instead of 'bfd'.
+ Sun cc doesn't like variable names that match their typedef'd type.
+
+Fri Oct 8 14:56:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * inflow.c: Remove unused includes of sys/param.h and sys/types.h.
+
+ * inflow.c, ser-unix.c, ser-go32.c, ser-tcp.c, serial.h,
+ terminal.h, fork-child.c, main.c, utils.c: Move all the process
+ group stuff back to inflow.c and terminal.h; that's a better place
+ for it and fixes problems with trying to get/set the process group
+ of a tty we're doing remote debugging on.
+ * terminal.h: Skip the redefines and includes if HAVE_TERMIOS.
+
+ * findvar.c, value.h (symbol_read_needs_frame): New function.
+ * c-exp.y, m2-exp.y: Call it instead of having our own switch on
+ the symbol's class.
+ * valops.c (value_of_variable): Use symbol_read_needs_frame to
+ decide whether we care about finding a frame.
+
+Fri Oct 8 02:34:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c (get_frame_block): Do not adjust pc if the frame
+ function was interrupted by a signal.
+
+Thu Oct 7 19:20:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/h8300/tm-h8300.h: Don't define sr_get_debug.
+ * remote-sim.c: Include remote-utils.h.
+ * target.h: Add comment about target_has_execution.
+
+Thu Oct 7 16:14:19 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * h8300-tdep.c (sim_load, sim_kill, sim_open, sim_set_args):
+ New functions.
+ * infrun.c (normal_stop): Don't try and set the pc in the current
+ frame coredump if there isn't one.
+ * remote-sim.c (gdbsim_store_register): Don't
+ SWAP_TARGET_AND_HOST, sim_store_register takes bytes in raw order.
+ (gdbsim_wait): Set status with WSETSTOP.
+ * config/h8300/tm-h8300.h (sr_get_debug): Define
+
+Thu Oct 7 12:56:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ New Mach stuff:
+ * config/i386/i386mach.c: Explain this is for the old (probably
+ non-functional and/or obsolete) Mach stuff.
+ * m3-nat.c, config/nm-m3.h,
+ i386m3-nat.c, mipsm3-nat.c, ns32km3-nat.c,
+ config/i386/{i386m3.mh,i386m3.mt,tm-i386m3.h,xm-i386m3.h},
+ config/i386/{i386mk.mh,i386mk.mt,tm-i386mk.h,xm-i386mk.h},
+ config/mips/{mipsm3.mh,mipsm3.mt,tm-mipsm3.h,xm-mipsm3.h},
+ config/ns32k/{ns32km3.mh,ns32km3.mt,tm-ns32km3.h,xm-ns32km3.h}:
+ New files.
+
+ * blockframe.c (find_pc_partial_function): If we call
+ PSYMTAB_TO_SYMTAB, call target_terminal_ours_for_output first.
+ This is needed now that wait_for_inferior passes in endaddr.
+ * infrun.c: Move call to target_terminal_inferior from proceed
+ to resume.
+
+Thu Oct 7 09:22:04 1993 Stu Grossman (grossman at cygnus.com)
+
+ * blockframe.c (find_pc_partial_function): Fix handling for PCs
+ beyond the end of the last function in an objfile.
+ * coff-solib.c (coff_solib_add): Use BFD to get fields from .lib
+ section.
+ * infrun.c (wait_for_inferior): Modify test for subroutine entry
+ to include pc out of bounds of the previous function.
+ * remote.c (remote_wait): Use strtoul for parsing 'N' message.
+ Add code to relocate symfile_objfile->sections.
+
+Thu Oct 7 06:22:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/sparc/sun4os4.mh: Add comment saying why we don't use
+ -lresolv.
+
+Thu Oct 7 09:29:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
+ that clears the `inserted' flag for all breakpoints and deletes
+ any breakpoints which should go away between runs of programs.
+ * inflow.c (generic_mourn_inferior), infrun.c (init_wait_for_inferior),
+ remote-es.c (es1800_load), comments in exec.c and corelow.c:
+ Use it instead of mark_breakpoints_out.
+ * breakpoint.c (mark_breakpoints_out): Update comment, tm-rs6000.h
+ uses it in a completely different context.
+ * breakpoint.c (breakpoint_re_set_one): Add bp_call_dummy case.
+
+Thu Oct 7 09:29:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * Makefile.in (REGEX, REGEX1): Always use our own version of
+ regex.c to be consistent across hosts.
+ * source.c (_initialize_source): Initialize regex to use grep
+ style syntax as an approximation to POSIX basic regex syntax.
+
+Wed Oct 6 12:43:47 1993 Jeffrey A Law (law@snake.cs.utah.edu)
+ Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hppa-tdep.c (frame_chain): Rework so that it correctly
+ handles boundaries where code with a frame pointer calls code
+ without a frame pointer.
+ (dig_fp_from_stack): New function.
+
+Wed Oct 6 12:43:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (delete_breakpoint): Don't insert a disabled breakpoint.
+
+ * README: Add Alpha notes from Schauer.
+
+Tue Oct 5 15:26:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (install, uninstall): Remove $$n.1 stuff; I don't
+ understand what it is trying to do, but I suspect it's not doing
+ it.
+
+ * config/ns32k/merlin.mh: Add comment about M_INSTALL.
+ * config/m88k/{delta88.mh,delta88v4.mh}: Remove M_INSTALL and
+ M_UNINSTALL; it tries to install a non-existent file gdb.z.
+ * Makefile.in: Remove M_INSTALL stuff; the above were the only uses.
+
+ * stabsread.c (read_range_type): Remove comment which recommends
+ distinguishing float from complex by the name.
+
+Tue Oct 5 12:17:40 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ Jim Kingdon (kingdon@cygnus.com)
+ Stu Grossman (grossman@cygnus.com)
+
+ Changes to support alpha OSF/1 in native mode.
+ * alpha-nat.c, alpha-tdep.c, config/alpha/alpha-osf1.mt,
+ config/alpha/nm-alpha.h, config/alpha/tm-alpha.h, osfsolib.c:
+ New files.
+ * Makefile.in: Add new files and dependencies.
+ * configure.in: Add alpha target.
+ * config/alpha/alpha-osf1.mh (NATDEPFILES): Add osfsolib.o
+ * config/alpha/alpha-osf1.mh (MH_CFLAGS): Remove, we can handle
+ shared libraries now.
+ * config/alpha/xm-alpha.h: Cleanup, get MAKEVA_* defines right.
+
+ * defs.h (CORE_ADDR): Make its type overridable via CORE_ADDR_TYPE,
+ provide `unsigned int' default.
+ * breakpoint.c (breakpoint_auto_delete): Delete only if we really
+ stopped for the breakpoint.
+ * stabsread.c, stabsread.h (define_symbol): Change valu parameter
+ to a CORE_ADDR.
+ * stabsread.c (read_range_type): Handle the case where the lower
+ bound overflows and the upper doesn't and the range is legal.
+ * infrun.c (resume): Do not step a breakpoint instruction if
+ CANNOT_STEP_BREAKPOINT is defined.
+
+ * inferior.h (CALL_DUMMY_LOCATION): New variant AT_ENTRY_POINT.
+ Now that we have the bp_call_dummy breakpoint the call dummy code
+ is no longer needed. PUSH_DUMMY_FRAME, PUSH_ARGUMENTS and
+ FIX_CALL_DUMMY can be used to set up everything for the dummy.
+ The breakpoint for the dummy is set at the entry point and thats it.
+ * blockframe.c (inside_entry_file, inside_entry_func): Do not stop
+ backtraces if pc is in the call dummy at the entry point.
+ * infcmd.c (run_stack_dummy): Handle AT_ENTRY_POINT case. Use
+ the expected breakpoint pc when setting up the frame for
+ set_momentary_breakpoint.
+ * symfile.c (entry_point_address): New function for AT_ENTRY_POINT
+ support.
+ * valops.c (call_function_by_hand): Handle AT_ENTRY_POINT case.
+
+Tue Oct 5 11:37:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Recognize hppa*-*-hiux* (currently synonym for hpux).
+ Change other hppa host entries to use -*- not -hp-.
+
+Mon Oct 4 19:16:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * i386-nlmstub.c: New file; debugging stub for i386 NetWare. Must
+ be compiled with NetWare header files and turned into an NLM with
+ nlmconv.
+
+Mon Oct 4 11:02:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * minsyms.c (lookup_minimal_symbol_by_pc): Don't use mst_abs symbols.
+
+ * dbxread.c (process_one_symbol): Make n_opt_found static.
+
+ * Rename i386lynx-tdep.c to i386ly-tdep.c for 14 character file names.
+ * Makefile.in, config/i386/i386lynx.mt: Change accordingly.
+
+ * values.c (record_latest_value): Fetch lazy values and set VALUE_LVAL
+ to not_lval.
+
+Sun Oct 3 15:54:51 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * objfiles.h (objfile): New slot sym_stab_info, use by most
+ stab-reading formats.
+ * gdb-stabs.h (DBX_SYMFILE_INFO): Access sym_stab_info instead of
+ sym_private.
+ * coffread.c (coff_symfile_init): Alloc struct for sym_stab_info.
+ * dbxread.c, elfread.c, paread.c: Change sym_private references to
+ sym_stab_info references.
+
+Sat Oct 2 19:28:35 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mipsread.c, objfiles.c, utils.c: Use PTR not void *. RISC/OS
+ 4.02 lacks void *.
+ * elfread.c: Use void * not PTR inside PARAMS.
+
+ * config/mips/news-mips.mh: Remove coredep.o; mips-nat.o does it.
+ * config/mips/news-mips.mh: Define NAT_FILE not NM_FILE.
+ * config/mips/nm-news-mips.h: Include mips/nm-mips.h not nm-mips.h.
+
+Sat Oct 2 16:05:22 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in, coff-solib.c, coff-solib.h, i386lynx.mt,
+ tm-i386lynx.h: Add support for SVR3 COFF shared libraries.
+
+Sat Oct 2 15:50:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m88k-nat.c (store_inferior_registers): When writing all registers,
+ don't try to write EXIP_REGNUM or ENIP_REGNUM (not needed for this
+ case, and they cause trouble).
+
+ * TODO: Don't suggest doing fast watchpoints by stepping a line
+ at a time. That would be really hairy and still not fast enough.
+ Do suggest debug registers and page table diddling.
+
+Fri Oct 1 14:54:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (do_examine): Make meaning of 'h', 'w', and 'g' not
+ depend on builtin_type_*. Instead, it is always 2, 4, and 8 bytes
+ like the documentation says.
+ * printcmd.c (decode_format) [CC_HAS_LONG_LONG]: Remove 'l' as
+ synonym for 'g'. This was never documented, it shouldn't depend on
+ CC_HAS_LONG_LONG, and I don't see what's wrong with 'g'.
+
+Fri Oct 1 10:06:35 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * symtab.c: fix a bug in testsuite (virtfunc.exp)
+
+Thu Sep 30 11:30:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m88k-nat.c (fill_gregset): Fix typo (R_SFIP -> R_FIP).
+
+ * c-typeprint.c (c_type_print_base, TYPE_FN_FIELD_STUB code):
+ If demangled name lacks a colon, don't dump core.
+
+ * blockframe.c (find_pc_partial_function): If pst->readin is
+ set, don't try to get symbols from pst.
+
+ * inflow.c (generic_mourn_inferior): Call reinit_frame_cache
+ instead of doing it ourself.
+ * blockframe.c (reinit_frame_cache): Use code which was in
+ generic_mourn_inferior so we can use this function even when
+ we have switched targets.
+ * corelow.c (core_detach): Call reinit_frame_cache.
+ * target.c (target_detach): Don't call generic_mourn_inferior
+ (revert yesterday's change, now handled by core_detach).
+ * objfiles.c (free_objfile): Detach any core file if we call
+ SOLIB_CLEAR. #include target.h.
+
+ * fork-child.c (fork_inferior): Don't call target_terminal_init
+ and target_terminal_inferior until we are sure that the inferior
+ has called gdb_setpgid. This fixes PR 2900 (Schauer tracked it
+ down and was able to reliably reproduce it by putting a sleep()
+ before the gdb_setpgid()).
+
+Thu Sep 30 12:00:49 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-exp.y, m2-exp.y: Change type of address for msymbol to
+ builtin_type_long.
+ * infptrace.c (fetch_register, store_inferior_register,
+ child_xfer_memory): Use PTRACE_XFER_TYPE for the type of ptrace
+ transfers. Provide an `int' default for PTRACE_XFER_TYPE.
+
+Thu Sep 30 11:30:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * defs.h (TARGET_*_BIT): Don't use host information (sizeof) in
+ picking defaults.
+
+ * cp-valprint.c (cp_is_vtbl_ptr_type): Continue to accept old form.
+
+Thu Sep 30 11:25:55 1993 Kung Hsu (kung@cygnus.com)
+
+ * cp-valprint.c (cp_is_vtbl_ptr_type):
+ change vtable field name to __vtbl (pr2695).
+
+ * symtab.c (gdb_mangle_name): fix a bug, to get mangled name right.
+
+Wed Sep 29 18:34:22 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Add deps for i386lynx-nat.o and i386lynx-tdep.o to
+ keep non-gnu makes happy.
+
+Wed Sep 29 17:20:54 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hpux_symtab): When a K_END is found for a
+ K_MODULE, clear the have_module and have_name flags.
+
+Wed Sep 29 10:52:19 1993 Kung Hsu (kung@cygnus.com)
+
+ * c-valprint.c: to fix virtual table print bug (pr2695).
+
+Wed Sep 29 10:52:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.c (target_detach): Call generic_mourn_inferior.
+ * inflow.c (generic_mourn_inferior): Call flush_cached_frames.
+
+Tue Sep 28 23:08:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c, coffread.c, elfread.c: A few changes to comments.
+
+Tue Sep 28 18:39:37 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * configure.in: Rename ...-lynx* to ...-lynxos*.
+ Add m68*-*-lynxos* configuration.
+ * dbxread.c (coffstab_build_psymtabs): New function,
+ interfaces coffread.c to dbxread functions.
+ * coffread.c (coff_symfile_info): Expand to include
+ dbx_symfile_info slots.
+ (coff_symfile_init): Init coff_symfile_info struct.
+ (coff_locate_sections): New functions, finds the stab and stabstr
+ sections.
+ (coff_symfile_read): Call coffstab_build_psymtabs if a stab
+ section is present.
+ (coff_section_offsets): Replace fake version with real offsets.
+
+Tue Sep 28 18:00:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infcmd.c (run_stack_dummy): Set the frame in the bp_call_dummy
+ breakpoint.
+
+Tue Sep 28 17:53:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/nm-sysv4.h: Include solib.h. Define SVR4_SHARED_LIBS.
+ * config/tm-sysv4.h: Don't include solib.h.
+ * config/xm-sysv4.h: Don't define SVR4_SHARED_LIBS.
+ * config/i386/i386v4.mt (TDEPFILES): Move solib.o from here...
+ * config/i386/i386v4.mh (NATDEPFILES): ...to here.
+ * config/i386/nm-i386v4.h: Include nm-sysv4.h.
+ * config/m68k/amix.mt (TDEPFILES): Move solib.o from here...
+ * config/m68k/amix.mh (NATDEPFILES): ...to here.
+
+Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES.
+
+ Clean up problems with targets and hosts that have 64 bit longs
+ and pointers and 32 bit ints.
+ * breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c,
+ ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c,
+ expprint.c, gdbtypes.c, infcmd.c, language.c, language.h,
+ m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h,
+ printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c,
+ symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
+ Change all printf formats from %x to %lx if outputting an address.
+ Change la_*_format to use long format.
+ local_hex_string, local_hex_string_custom now take an unsigned long
+ argument, change all callers.
+ * coffread.c (read_coff_symtab): Remove superfluous cast for
+ complaint output.
+ * dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int.
+ * findvar.c, value.h (write_register): Change val to LONGEST.
+ * gdbtypes.h (struct type): Change `bitsize' to long as
+ TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer.
+ * inferior.h (struct inferior_status): Change type of stop_pc to
+ CORE_ADDR.
+ * language.h (local_octal_string, local_octal_string_custom):
+ Remove prototype, the functions are neither defined nor used.
+ * mipsread.c (parse_symbol): Use temporary variable for bitsize as
+ f->bitsize is a long now.
+ * objfiles.c (add_to_objfile_sections, build_objfile_section_table):
+ Use unsigned long casts instead of int for abusing sections_end
+ pointer as integer.
+ * stack.c (parse_frame_specification): Change type of `args' to
+ CORE_ADDR for SETUP_ARBITRARY_FRAME.
+
+ * printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE.
+ * mipsread.c (parse_type): Alpha cc now supports the t->continued
+ bit, update algorithm to match the way the compiler uses it.
+
+Tue Sep 28 12:05:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (fprintfi_filtered): Fix comments.
+
+Mon Sep 27 18:10:08 1993 Stu Grossman (grossman at cygnus.com)
+
+ * coffread.c (read_coff_symtab): Don't call getfilename if there
+ are no auxents.
+
+Mon Sep 27 10:22:37 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (find_pc_line): Fix comments.
+
+ * remote-udi.c (udi_mourn): Don't pop target.
+
+Fri Sep 24 17:25:41 1993 Stu Grossman (grossman at cygnus.com)
+
+ * corelow.c: Add multi thread/process support for core files with
+ .reg/XXX pseudo-sections.
+ * i386lynx-nat.c thread.h thread.c: Remove unnecessary core file
+ support.
+
+Thu Sep 23 10:49:37 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c (download): Skip zero length sections.
+
+ * valops.c (search_struct_method, value_struct_elt):
+ Use (value)-1, not -1, for error.
+
+ * infcmd.c (step_1), infrun.c (wait_for_inferior): Add comments
+ about SHIFT_INST_REGS.
+
+ * exec.c (exec_file_command): Set text_end based on all code readonly
+ sections, not just ".text".
+
+ * defs.h, infcmd.c, config/z8k/tm-z8k.h, config/m88k/tm-m88k.h,
+ config/sh/tm-sh.h, config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ z8k-tdep.c: Remove all references to ADDR_BITS_SET.
+ * config/m88k/tm-m88k.h: Define TARGET_WRITE_PC.
+
+ * config/m88k/tm-m88k.h, m88k-tdep.c: Add call function stuff.
+
+Thu Sep 23 00:13:06 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-mips.h (STORE_STRUCT_RETURN): Define as noop as
+ the pushing of the struct return address is already handled in
+ mips_push_arguments.
+ * mips-tdep.c (reinit_frame_cache_sfunc): Fix typo in prototype
+ declaration.
+ * mipsread.c (parse_symbol, parse_type, upgrade_type): Add more
+ sanity checks for corrupt symbol entries to avoid core dumps
+ reported by benson@odi.com. Obviously Ultrix 4.3A cc now has
+ the same problems as the OSF/1 alpha cc.
+ * mipsread.c (parse_lines): Iterate over the range of the compressed
+ line number entries, the old iteration sometimes failed to stop
+ and wrote past the end of the LINETABLE. Add sanity check to avoid
+ the same problem in case the line number info is corrupt.
+ * mipsread.c (parse_procedure): Adjust pdr for alpha __sigtramp.
+ * mipsread.c (parse_external, parse_partial_symbols): Ignore stNil
+ symbols that are produced for statics in .o files and stLocal symbols
+ that are produced for every section in OSF/1 dynamically linked
+ executables.
+ * mipsread.c (psymtab_to_symtab_1): Put out `undefined symbols'
+ warning only under `verbose on' as there are many undefined symbols
+ in a dynamically linked executable.
+
+Wed Sep 22 10:28:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i960/nindy960.mt: Don't define REMOTE_O; REMOTE_O was
+ intended only for VxWorks. Remove dcache.o from TDEPFILES now
+ that we pick it up from the default REMOTE_O.
+
+ * breakpoint.c (bpstat_what): Initialize retval.call_dummy and
+ retval.step_resume.
+
+ * mips-tdep.c (mips_frame_chain): If frame size zero, return zero.
+ * rs6000-tdep.c: Add comment about framelessness.
+
+ * remote-nindy.c: Declare ninMemGet and ninMemPut.
+
+Wed Sep 22 08:02:57 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Add i386lynx-tdep to the right places.
+ (TARDIRS): Add gdbserver.
+
+ * exec.c (print_section_info): Print entry point.
+ * i386lynx-nat.c (i386lynx_saved_pc_after_call): Move into
+ i386lynx-tdep.c. Add core file support.
+ * i386lynx-tdep.c: New module for Lynx/386 target dependant code.
+ * maint.c: Add `maint info sections' command to print info about all
+ sections that BFD knows about for exec and core files.
+ * sparc-tdep.c (sparc_push_dummy_frame): Update stack pointer
+ before putting frame on the stack. Consolidate writes to reduce
+ traffic for remote debugging.
+ * config/i386/i386lynx.mh (NATDEPFILES): Remove exec.o.
+ * config/i386/i386lynx.mt (TDEPFILES): Add exec.o, i386lynx-tdep.o.
+ * config/i386/nm-i386lynx.h: Add target_pid_to_str().
+ * config/i386/tm-i386lynx.h: Remove target_pid_to_str().
+ * sparclite/Makefile.in: Add deps to keep Sun make happy.
+
+Tue Sep 21 17:48:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.h, breakpoint.c (bpstat_stop_status): Add new argument
+ not_a_breakpoint.
+ * infrun.c (wait_for_inferior): Pass it. Also consolidate the
+ test of whether we are stepping into a CURRENTLY_STEPPING macro.
+
+Tue Sep 21 17:22:34 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * breakpoint.c (bpstat_stop_status),
+ infcmd.c (step_1),
+ infrun.c (wait_for_inferior): collapse SHIFT_INST_REGS ifdef
+ and insert macro.
+
+ * m88k-tdep.c: include ieee-float.h. new global target_is_m88110.
+ new const struct ext_format_m88110 for float format.
+ (pic_prologue_code): add braces.
+ (next_insn): remove unused variable buf.
+ (frame_find_saved_regs): remove unused variables next_addr,
+ saved_regs, regnum.
+ (frame_locals_address): remove unused variables frame, ap.
+ (frame_args_address): remove unused variables frame, ap.
+ (push_parameters): add some breaks and a default case.
+
+ * remote-bug.c: remove redundant includes of value.h, target.h,
+ serial.h.
+ (bug_open): corrected typo, sr_multi_scan -> gr_multi_scan.
+ (bug_fetch_register): special case sfip register for m88110.
+ remove flag bit masking of pc registers. This should be handled
+ by the ADDR_BITS_* macros.
+ (bug_store_register): special case sfip register for m88110.
+ Corrected sprint format for extended registers.
+
+ * config/m88k/tm-m88k.h: white space and comment changes. include
+ ieee-float.h. expanded to cope with m88110 extended registers.
+ (R0_REGNUM, XFP_REGNUM, X0_REGNUM): new macros.
+ (SHIFT_INST_REGS): becomes a real macro.
+
+Tue Sep 21 17:48:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Support bp_call_dummy.
+
+Tue Sep 21 17:06:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfread.c (record_minimal_symbol_and_info): Guess the section to
+ use from the type.
+ * objfiles.c: Include gdb-stabs.h for SECT_* macros.
+ (objfile_relocate): Relocate textlow and texthigh in psymtabs.
+ Relocate partial symbols. Check that minimal SYMBOL_SECTION is
+ nonnegative before using it.
+ * symtab.h: Adjust section field comment.
+
+ * remote.c (interrupt_query): New function.
+ (remote_interrupt_twice): Call interrupt_query.
+ (putpkt, getpkt): If quit_flag is set, call interrupt_query.
+ (remote_wait): Don't bother with objfile_relocate if the addresses
+ haven't changed.
+ (remote_fetch_registers): If we see a packet that doesn't start
+ with a hex character, fetch a new one.
+
+Tue Sep 21 11:44:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c, remote-utils.c: Use SERIAL_FLUSH_INPUT after opening it.
+
+ * printcmd.c (print_scalar_formatted): When truncating value we are
+ going to print as unsigned, handle it generally for any length
+ less than sizeof (LONGEST), rather than special-casing sizeof (char),
+ sizeof (short), and sizeof (long). Clarify comment on what this
+ is for.
+
+ * symfile.c (deduce_language_from_filename): Accept .cxx for C++.
+ * buildsym.c (start_subfile): Use deduce_language_from_filename
+ rather than checking for .C or .cc ourself.
+
+Mon Sep 20 14:53:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * defs.h: Declare argument of re_comp as const char *.
+
+ * remote.c, remote-mips.c: Use sr_get_debug not remote_debug.
+
+ * README: Say using bfd from another release doesn't generally work.
+
+Sat Sep 18 10:13:18 1993 Jim Kingdon (kingdon@poseidon.cygnus.com)
+
+ * mipsread.c (parse_type): Don't complain() if we guessed struct
+ and it was a union, or vice versa.
+
+ * defs.h (make_cleanup): Change PTR to void * when inside PARAMS.
+
+ Some of the following is in #ifdef CALL_DUMMY_BREAKPOINT_OFFSET.
+ * breakpoint.h (enum bptype): Add bp_call_dummy.
+ (struct bpstat_what): Add call_dummy field.
+ * infrun.c (wait_for_inferior): Deal with it.
+ * breakpoint.c (bpstat_what): Deal with call dummy breakpoint.
+ * infcmd.c (run_stack_dummy): Set the call dummy breakpoint.
+ * config/sparc/tm-sparc.h: Define CALL_DUMMY_BREAKPOINT_OFFSET.
+
+ * remote-sim.h: New file.
+ * remote-sim.c: Add remote debug feature. Rename stuff to distinguish
+ interface to simulator from gdb-specific stuff. Other changes.
+ * remote-sp64sim.c: Renamed to remote-sim.c.
+ Use sr_get_debug instead of our own sim_verbose/simif_snoop.
+ Use gnutarget in call to bfd_openr.
+ Rename simif_* to gdbsim_*.
+ * config/sparc/sp64sim.mt: Change remote-sp64sim.c to remote-sim.c.
+
+Fri Sep 17 04:41:17 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * findvar.c (extract_signed_integer): Cast *p to LONGEST before doing
+ the xor and subtract. Otherwise it will not sign extend if the type
+ of LONGEST is larger than int.
+ * cp-valprint.c (cp_print_class_method): Inhibit core dump if
+ domain is an undefined cross reference.
+ * valops.c (call_function_by_hand): Set real_pc to correct
+ value if CALL_DUMMY_LOCATION != ON_STACK.
+
+Thu Sep 16 20:37:06 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * config/a29k/tm-a29k.h (FRAME_CHAIN): If rsize is zero, return zero.
+
+Thu Sep 16 13:16:22 1993 Stu Grossman (grossman at cygnus.com)
+
+ * infrun.c (wait_for_inferior): Allow user to single step within
+ a stack dummy.
+
+Thu Sep 16 12:34:01 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * dbxread.c (copy_pending): Deal with END NULL.
+ (process_one_symbol): Add comments about what common_block NULL means.
+
+Wed Sep 15 14:50:26 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * remote-udi.c, remote-adapt.c, remote-mm.c: Move processor_type
+ to tm-a29k.h and a29k-tdep.c and make it an enum.
+ * a29k-tdep.c (a29k_get_processor_type): New function. Fix many
+ aspects of how we detected the processor type.
+ * remote-udi.c, remote-adapt.c, remote-mm.c (*_open): Call it
+ rather than figuring out the type ourselves.
+
+Thu Sep 16 12:12:59 1993 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-stub.c (_trap_low): Do restore/save sequence after
+ setting sp to ensure that we load the previous window from the
+ right place on the stack.
+
+Thu Sep 16 00:36:32 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c: Many changes for alpha ecoff format:
+ Correct sizeof(int) == sizeof(long) assumptions.
+ Replace stParsed hack by putting the parsed types on the pending chain.
+ Replace mips specific ecoff mapping by ECOFF_REG_TO_REGNUM macro,
+ provide default for cross debugging.
+ Swapping the symbol back is no longer needed as the symbol is not
+ modified anymore.
+ Add new alpha basic types, handle btTypedef, handle stStaticProc
+ external symbols .
+ Update and clean up cross_ref for alpha cc cross ref variations.
+ Allocate types on the type_obstack to inhibit storage leaks.
+ * config/mips/tm-mips.h (ECOFF_REG_TO_REGNUM): Define.
+ * gdbtypes.c (recursive_dump_type): Dump TYPE_TAG_NAME if it is set.
+
+Tue Sep 14 09:12:17 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * stabsread.c (read_type): Process "s" (size) type attribute.
+ If type is defined to another type, copy the type.
+
+Tue Sep 14 18:37:17 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/i386/i386v4.mh (NATDEPFILES): Move exec.o from here...
+ * config/i386/i386v4.mt (TDEPFILES): ...to here.
+
+Tue Sep 14 12:21:49 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in (remote_utils_h): add serial.h and target.h.
+ (main.o, remote-es.o, remote-nindy.o, remote.o): remove target.h
+ (already in remote_utils_h).
+ (remote-utils.o): new rule.
+
+ * remote-utils.h: include serial.h.
+
+ * serial.h: ifdef protect from multiple inclusion.
+
+ * remote.c, remote-nindy.c, remote-mon.c, remote-es.c: include
+ remote-utils.h.
+
+ * remote.c (remote_open), remote-nindy.c (nindy_open,
+ nindy_files_info), remote-mon.c (general_open), remote-es.c
+ (es1800_open): use remote-utils facilities for baud rate.
+
+Tue Sep 14 09:12:17 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * paread.c, coffread.c, elfread.c, dwarfread.c:
+ Include <time.h> and <sys/types.h> before libbfd.h.
+
+ * paread.c: Define BYTES_IN_WORD before including aout/aout64.h.
+
+ * Makefile.in (a29k-tdep.o): Depend on $(defs_h).
+ * config/a29k/tm-a29k.h (SAVED_PC_AFTER_CALL): Use gr122 not lr0
+ if this is a transparent procedure.
+
+Mon Sep 13 16:06:43 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * remote.c: Define remote_debug to 0 and #if 0 baud_rate. Temporary
+ hack so this file compiles again.
+
+ * remote-utils.c (gr_multi_scan): Cast return value from alloca.
+ (gr_multi_scan): #if 0 never-reached return(-1).
+
+ * remote-udi.c (udi_wait): Return inferior_pid not 0.
+
+Mon Sep 13 14:14:35 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Collect some remote things into remote-utils.
+ * remote-utils.[ch]: new files of functions collected from several
+ different remote targets.
+ * Makefile.in (REMOTE_O): add remote-utils.o.
+ (dcache_h, remote_utils_h): new macros.
+ (HFILES): add $(remote_utils_h).
+ (ALLDEPFILES): add $(remote_utils_h).
+ (dcache.o): new rule.
+ (main.o, remote-bug.o): also depend on $(remote_utils_h).
+ * target.h (remote_debug): extern moved to remote-utils.h.
+ * target.c (find_default_run_target, find_core_target): initialize
+ runable.
+ (remote_debug): moved to remote-utils.c.
+ (_initialize_targets): move declaration of user variable
+ remotedebug to remote-utils.c.
+ * remote-bug.c: include remote-utils.h rather than dcache.h.
+ (bug_close, bug_write, bug_write_cr, desc, bug_dcache, timeout,
+ dev_name, check_open, is_open, readchar, readchar_nofail,
+ pollchar, expect, expect_prompt, get_hex_digit, get_hex_byte,
+ get_hex_word, bug_kill, bug_detach, bug_create_inferior,
+ multi-scan, bug_prepare_to_store, bug_fetch_word,
+ bug_store_word, bug_files_info, bug_mourn, bug_com, bug_device,
+ bug_speed): removed and replaced with facilities from
+ remote-utils.[ch].
+ (bug_read_inferior_memory): renamed to bug_read_memory.
+ (bug_write_inferior_memory): renamed to bug_write_memory.
+ (bug_xfer_inferior_memory): renamed to bug_xfer_memory.
+ (get_word): comment out this unused function for now.
+ (bug_settings, cpu_check_strings): new statics.
+ (bug_open): rewritten to use gr_open.
+ (_initialize_remote_bug): remove declarations of commands bug,
+ device, speed.
+ * main.c: include remote-utils.h.
+ (baud_rate): removed to remote-utils.c.
+ (main): handle baud rate settings using new facilities from
+ remote-utils.
+ * defs.h (baud_rate): removed extern.
+
+ m88110 support via bug-197 monitor.
+ * remote-bug.c (get_reg_name, bug_fetch_register,
+ bug_store_register): added m88110 extended register support.
+ (wait_strings): added bug-197 prompt.
+ (bug_wait): cope with bug-197 prompt.
+ (start_load): cope with either bug-197 or bug-187 prompt.
+
+Mon Sep 13 12:53:09 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * inferior.h, infrun.c, thread.c, infcmd.c: Remove all uses of
+ pc_changed. If it was ever set to a non-zero value, it was before
+ GDB 2.8. It doesn't seem to have any useful function.
+
+ * defs.h: Don't define NORETURN (see comment).
+
+Sat Sep 11 10:46:09 1993 Jim Kingdon (kingdon@poseidon.cygnus.com)
+
+ * m88k-nat.c (fill_gregset): Set r31 and sfip.
+
+Thu Sep 9 10:18:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c (udi_wait, case UDIStdinNeeded): Use a loop calling
+ getchar() (terminated only on '\n') instead of scanf. Send the
+ '\n' which terminates it to the remote system.
+
+ More gcc lint:
+ * exec.c (ignore): Return 0.
+ * stack.c (return_command): Fetch lazy value directly, not via
+ VALUE_CONTENTS, to avoid "value computed is not used".
+ * inflow.c (new_tty): Move osigttou inside #if.
+
+ * remote.c (remote_fetch_registers): If remote reply is short, just
+ note that fact and keep going (reading extra registers as all bits 0).
+ (remote_store_registers): Send number of registers that were found
+ by remote_fetch_registers.
+ * m68k-tdep.c, config/m68k/tm-m68k.h, config/m68k/tm-*.h: Remove
+ HAVE_68881. Define CANNOT_STORE_REGISTER if ptrace() can't write
+ floating registers.
+ * config/m68k/{tm-m68k-nofp.h,m68k-nofp.mt,tm-m68k-fp.h,m68k-fp.mt}:
+ Remove, replaced by {tm-m68k-em.h,m68k-em.mt}.
+ * Makefile.in, configure.in: Change accordingly.
+
+Thu Sep 9 04:59:03 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (cross_ref): Allow SGI extended symbol types as cross
+ reference targets.
+ * symmisc.c (print_symbol): Use TYPE_TAG_NAME not TYPE_NAME to avoid
+ printing of identities.
+
+Wed Sep 8 19:18:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Deal with step resume breakpoint.
+
+Wed Sep 8 13:01:10 1993 K. Richard Pixley (rich@cygnus.com)
+
+ Gcc lint.
+ * config/m88k/tm-m88k.h (frame_find_saved_regs): prototype.
+ * config/h8300/tm-h8300.h (NUM_REGS): rewrite to avoid nested comment.
+ * blockframe.c (get_prev_frame_info): initialize address.
+ * breakpoint.c (bpstat_copy): initialize retval.
+ (bpstat_stop_status): initialize value_is_zero.
+ (bpstat_what): initialize bs_class.
+ (breakpoint_1, mention): add do-nothing case for bp_step_resume.
+ (break_command_1): initialize cond_end, addr_end, &
+ canonical_strings_chain.
+ (enable_breakpoint): initialize save_selected_frame.
+ * buildsym.c (end_symtab): initialize symtab & linetablesize.
+ * c-exp.y (parse_number): initialize i.
+ * c-typeprint.c (c_type_print_varspec_prefix): include
+ TYPE_CODE_BITSTRING in switch statements and do nothing.
+ * c-valprint.c (c_val_print): removed unused variable c.
+ * ch-valprint.c (chill_val_print): removed unused variable eltlen.
+ * cp-valprint.c (cp_print_class_method): initialize f & j.
+ * eval.c (evaluate_subexp): initialize pc2, arg1, arg2.
+ * expprint.c (print_subexp): initialize myprec, assoc, & tempstr.
+ * findvar.c (value_from_register): initialize first_addr.
+ * gdbtypes.c (lookup_struct_elt_type): localize use of temporary
+ variable typename.
+ * infcmd.c (run_stack_dummy): return zero rather than simple
+ return.
+ * infrun.c (wait_for_inferior): initialize stop_sp, prologue_pc.
+ remove symtab, appears unused.
+ (restore_selected_frame): return 1.
+ * mipsread.c (psymtab_to_symtab_1): initialize first_off.
+ (fixup_sigtramp): initialize b0.
+ * printcmd.c (do_examine): initialize val_type.
+ (print_frame_args): initialize b.
+ * ser-tcp.c (tcp_restore): comment out declaration. Appears
+ unused.
+ * ser-unix.c (hardwire_restore): comment out declaration. Appears
+ unused.
+ (hardwire_send_break): moved variable status into ifdef
+ HAVE_SGTTY.
+ (wait_for): moved variable numfds into ifdef HAVE_SGTTY.
+ * serial.h: comment change only.
+ * stabsread.c (rs6000_builtin_type): initialize rettype.
+ (read_range_type): initialize nbits.
+ * stack.c (print_frame_info): remove unused variable numargs.
+ (parse_frame_specification): remove unused variables arg1, arg2,
+ arg3.
+ (return_command): initialize return_value.
+ * symfile.c (cashier_psymtab): initialize pprev.
+ * symtab.c (find_pc_psymbol): initialize best.
+ (lookup_symbol): initialize s.
+ (make_symbol_completion_list): initialize quote_pos.
+ * thread.c: include command.h.
+ (thread_info): static declaration removed; unused.
+ (info_threads_command): fix == vs = typo.
+ * typeprint.c (whatis_exp): initialize old_chain.
+ * valprint.c (val_print_string): remove unused variable
+ first_addr_err. Initialize old_chain.
+ (_initialize_valprint): white space comment change.
+ * values.c (show_values): rewrite if statement to avoid empty
+ body.
+ (vb_match): remove unused variable fieldtype_target_type.
+
+Wed Sep 8 10:21:33 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (mipsread.o): Depend on $(bfd_h).
+
+Tue Sep 7 13:06:44 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/Makefile.in (TAGS): config files are in
+ $(srcdir)/../config, not $(srcdir)/config.
+
+ * config/pa/tm-hppa.h: Declare target_read_pc and target_write_pc.
+ (STORE_RETURN_VALUE): Pass the correct offset of the return
+ register to write_register_bytes.
+ * hppa-tdep.c: Use target_write_pc if PCOQ_TAIL_REGNUM was not saved.
+
+Tue Sep 7 14:30:34 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * remote.c (remote_wait): Don't call error. Instead, call warning
+ inside a loop. User can ^C to get out.
+
+ * config/m68k/tm-m68k.h (FIX_CALL_DUMMY): Changed name of swapping
+ routine to match BFD name change.
+ * config/z8k/tm-z8k.h (FIX_CALL_DUMMY): Likewise.
+
+Mon Sep 6 15:01:57 1993 Jeffrey Wheat (cassidy@cygnus.com)
+
+ * elfread.c: change elf32_symbol_type to elf_symbol_type
+
+Mon Sep 6 15:43:25 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * remote.c (remote_wait): Added 'W' and 'N' responses.
+
+Fri Sep 3 08:57:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c, utils.c: Add comments about immediate_quit.
+
+ * elfread.c (elf_symtab_read): Don't add symbols starting with ".L"
+ to minimal symbols.
+
+ * target.c (pop_target): Don't try to deal with the stack becoming
+ empty. Shouldn't happen and the code that tried was broken.
+
+ * dcache.c: Cast return value from xmalloc.
+
+ * remote.c: Move setting of immediate_quit from remote_open to
+ remote_start_dummy and set it back to zero when done.
+
+Thu Sep 2 00:07:36 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m88k-tdep.c: Remove a bunch of unused #includes.
+
+ * language.h: Add comment about current_language.
+
+ * mips-tdep.c (_initialize_mips_tdep): Change heuristic-fence-post
+ from var_uinteger to var_zinteger.
+
+ * configure.in: Fix typo (delta88r4 -> delta88v4).
+
+ * config/m88k/xm-delta88.h: Don't include sys/siginfo.h. It was
+ to make this work on SVR4 before SVR4 had its own configuration,
+ and it breaks SVR3.
+
+ * config/m88k/tm-delta88v4.h: Define FRAME_CHAIN_VALID_ALTERNATE.
+
+ * config/m88k/delta88v4.h (NATDEPFILES): Remove infptrace.o inftarg.o.
+
+ * config/m88k/xm-dgux.h: Renamed from config/m88k/xm-m88k.h.
+ * config/m88k/m88k.mh: Use xm-dgux.h.
+ * config/m88k/xm-m88k.h: New file, with HOST_BYTE_ORDER,
+ MAKEVA_END and MAKEVA_ARG.
+ * config/m88k/xm-*.h: Include m88k/xm-m88k.h.
+ * printcmd.c: Remove __INT_VARARGS_H code; now in xm-m88k.h.
+
+Wed Sep 1 19:31:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c (udi_wait): Call `warning' not `error'.
+
+ * symtab.c (COMPLETION_LIST_ADD_SYMBOL): If the symbol has a
+ demangling, don't put the mangled form in the completion list.
+
+ * symtab.c, symfile.c, c-exp.y, ch-exp.y, m2-exp.y, buildsym.c,
+ symfile.h, stabsread.c, minsyms.c, solib.c, nlmread.c, dwarfread.c
+ partial-stab.h, symmisc.c, gdbtypes.c: Lint. Remove (or put
+ inside #if) unused variables and labels. Fix unclosed comment.
+ Deal with enumeration values unhandled in switch statements. Make
+ sure non-void functions return values. Include appropriate
+ headers.
+ * dbxread.c (elfstab_build_psymtabs): Don't check for unsigned
+ value < 0.
+
+Wed Sep 1 14:36:00 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * i960-tdep.c, ns32k-pinsn.c, remote-adapt.c, xcoffread.c:
+ index -> strchr.
+
+Wed Sep 1 11:35:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c: Add comment explaining why dcache is disabled.
+ (remote_fetch_word, remote_store_word): Make static and #if 0.
+ They are not called from anywhere.
+
+Wed Sep 1 14:41:28 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * arm-tdep.c, convex-tdep.c, convex-xdep.c, dbxread.c,
+ h8300-tdep.c, h8500-tdep.c, i960-pinsn.c, i960-tdep.c,
+ infptrace.c, m88k-tdep.c, mips-tdep.c, regex.c, remote-vx.c,
+ rs6000-tdep.c, xcoffexec.c, xcoffread.c, z8k-tdep.c,
+ config/arm/tm-arm.h, config/convex/tm-convex.h,
+ config/gould/tm-np1.h, config/gould/tm-pn.h,
+ config/m68k/tm-isi.h, config/ns32k/tm-umax.h,
+ config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
+ config/rs6000/tm-rs6000.h, config/tahoe/tm-tahoe.h,
+ config/vax/tm-vax.h: bzero -> memset.
+
+ * regex.c: bcmp -> memcmp.
+
+Wed Sep 1 11:35:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (find_pc_line, find_line_common),
+ symtab.h (struct linetable), xcoffread.c (arrange_linetable):
+ Revise comments re linetable sorting.
+ * buildsym.c (compare_line_numbers): Sort by pc, not by line.
+ * coffread.c: Tell end_symtab to sort the line table.
+
+ * coffread.c: Re-work a lot of the coff-specific stuff to use stuff
+ in buildsym.c. This includes coff_finish_block, coff_context_stack,
+ coff_local_symbols, coff_file_symbols, coff_global_symbols,
+ coff_end_symtab and coff_add_symbol_to_list.
+ (read_enum_type): Deal with it now that we have a "struct pending"
+ not a "struct coff_pending".
+
+ * buildsym.c (end_symtab): Don't realloc subfile->linetable.
+
+Wed Sep 1 13:12:43 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * a68v-nat.c, altos-xdep.c, convex-tdep.c, convex-xdep.c,
+ findvar.c, hppab-nat.c, hppah-nat.c, i386mach-nat.c,
+ irix4-nat.c, m68k-tdep.c, m88k-tdep.c, mipsread.c, regex.c,
+ remote-bug.c, remote-hms.c, rs6000-nat.c, rs6000-tdep.c,
+ sparc-nat.c, stabsread.c, sun3-nat.c, sun386-nat.c, symfile.c,
+ umax-xdep.c, xcoffread.c, 29k-share/udi/udip2soc.c,
+ 29k-share/udi/udr.c, config/a29k/tm-a29k.h, config/arm/tm-arm.h,
+ config/convex/tm-convex.h, config/gould/tm-np1.h,
+ config/gould/tm-pn.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/i386/tm-i386aix.h,
+ config/i386/tm-sun386.h, config/i386/tm-symmetry.h,
+ config/i960/tm-i960.h, config/m68k/tm-news.h,
+ config/m88k/tm-m88k.h, config/mips/tm-mips.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
+ config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
+ config/rs6000/tm-rs6000.h, config/sh/tm-sh.h,
+ config/tahoe/tm-tahoe.h, config/vax/tm-vax.h,
+ config/z8k/tm-z8k.h, nindy-share/nindy.c: bcopy -> memcpy.
+
+Wed Sep 1 05:05:53 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_partial_symbols): Use language from FDR if it
+ is unambigous. Patch from ptf@delcam.co.uk (Paul Flinders).
+ * mipsread.c (ecoff_symfile_info): New struct to hold the global
+ pending_list.
+ * mipsread.c (mipscoff_symfile_init, parse_partial_symbols):
+ Allocate the global pending list and link it to the objfile.
+ * mipsread.c (is_pending_symbol, add_pending): Use global pending
+ list from objfile. Allocate pending list entries from the
+ psymbol_obstack.
+ * mipsread.c (free_pending): Remove. The pending list is now
+ freed when the psymbol_obstack is freed.
+ * mipsread.c (psymtab_to_symtab1): Remove pending list allocation,
+ the global pending list is used now.
+ * mipsread.c (parse_partial_symbols): Skip only the first
+ file indirect entry when building the dependency list.
+
+Tue Aug 31 15:01:27 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Break dcache code out of remote.c.
+ * dcache.h: white space changes only.
+ * dcache.c: add user settable variable to set whether data caching
+ is in use.
+ * remote.c: include dcache.h. removed data caching code which is
+ now in dcache.c. Compile in data caching again. (data caching
+ is currently off by default.)
+ (remote_read_bytes, remote_write_bytes): change second arg to
+ unsigned char.
+ (remote_dcache): new static variable.
+ * Makefile.in (REMOTE_O): add dcache.o.
+ * config/m88k/m88k.mt (TDEPFILES): removed dcache.o.
+
+ Break dcache code out of remote-nindy.c.
+ * remote-nindy.c: removed dcache code. Changed callers to use new
+ conventions. include dcache.h.
+ (nindy_dcache): new static variable.
+ * config/i960/nindy960.mt (TDEPFILES): added dcache.o.
+
+ Break dcache code out of remote-bug.c into dcache.[hc].
+ * Makefile.in (dcache_h): new macro.
+ (HFILES): added $(dcache_h).
+ (ALLDEPFILES): added dcache.c.
+ (dcache.o): new rule.
+ (remote-bug.o): now depends on $(dcache_h).
+ * remote-bug.c: include dcache.h. remove externs for insque and
+ remque, add extern for bcopy. Prototype bug_close,
+ bug_clear_breakpoints, bug_write_cr. dcache code moved to
+ dcache.[hc]. Changed dcache calling convention to include an
+ initial DCACHE argument.
+ (bug_dcache): new static variable.
+ (bug_read_inferior_memory): change second arg to
+ unsigned char.
+ * dcache.[ch]: new files.
+ * config/m88k/m88k.mt (TDEPFILES): add dcache.o.
+
+Tue Aug 31 10:33:13 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-typeprint.c (c_print_type_base): Treat show = 0 just like
+ show < 0. The only case where we had been distinguishing is that
+ show = 0 used to print "struct " or "enum " instead of
+ "struct {...}" or "enum {...}" which seems clearly wrong.
+
+Mon Aug 30 17:51:32 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * configure.in: recognize m88110 as an m88k.
+
+Mon Aug 30 16:07:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (call_function_by_hand): If we discard cleanups, call
+ bpstat_clear (&inf_status.stop_bpstat).
+
+Mon Aug 30 12:47:46 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * stabsread.h, dbxread.c (end_psymtab): Return NULL if the psymtab
+ was empty and thrown away.
+ * mipsread.c (parse_partial_symbols): Do not add empty psymtabs to
+ dependency list, skip self dependencies.
+ * mipsread.c (parse_fdr): Removed, obsolete.
+ * mipsread.c (parse_lines): Check for cbLine being zero, not
+ cbLineOffset.
+ * mipsread.c (struct symloc): Add pst_language.
+ * mipsread.c (parse_partial_symbols): Set up proper language for
+ header files, save it in pst_language for psymtab_to_symtab_1.
+ * mipsread.c (psymtab_to_symtab_1): Use pst_language.
+
+Mon Aug 30 10:48:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Fix typo m88*-motorola-svr4* -> sysv4*.
+
+Fri Aug 27 17:09:19 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * paread.c: Include som.h instead of libhppa.h. (From Utah.)
+
+Fri Aug 27 09:30:40 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * symmisc.c (dump_symtab): Use catch_errors around print_symbol.
+ Change calling sequence of print_symbol to fit catch_errors.
+
+ * mips-tdep.c: Call reinit_frame_cache every time the user does
+ "set heuristic-fence-post".
+
+ * gdbserver/low-sun3.c: New file.
+ * gdbserver/Makefile.in, config/m68k/sun3.mh: Change accordingly.
+
+ * Rename files for 14-character limits:
+ gdbserver/remote-gutils.c -> gdbserver/utils.c
+ gdbserver/remote-inflow.c -> gdbserver/low-lynx.c
+ gdbserver/remote-inflow-sparc.c -> gdbserver/low-sparc.c
+ gdbserver/remote-server.c -> gdbserver/server.c
+ remote-monitor.c -> remote-mon.c
+ * Makefile.in, gdbserver/Makefile.in, gdbserver/configure.in,
+ config/m68k/monitor.mt, config/i386/i386lynx.mh,
+ config/sparc/sun4os4.mh: Change accordingly.
+ * gdbserver/Makefile.in: Remove more junk inherited from gdb Makefile.
+
+Thu Aug 26 14:32:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infcmd.c, inferior.h (run_stack_dummy): If we stop somewhere
+ besides the dummy, return 1 rather than calling error().
+ Let caller print the error message. Remove name argument.
+ * valops.c (call_function_by_hand): Deal with changes to calling
+ sequence of run_stack_dummy. Discard restore_inferior_status cleanup
+ if run_stack_dummy returns 1.
+
+ * Version 4.10.2.
+
+ * config/mips/tm-mips.h (EXTRACT_STRUCT_VALUE_ADDRESS):
+ Get struct return address from v0, not a0.
+
+ * infrun.c (restore_inferior_status): Use catch_errors when
+ restoring selected frame.
+
+Wed Aug 25 21:52:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (save_inferior_status, restore_inferior_status):
+ Save and restore the registers too.
+ * inferior.h (struct inferior_status): Add "registers".
+
+Tue Aug 24 00:36:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c (end_psymtab): Clean up comment.
+
+ * frame.h, symtab.h, findvar.c (read_var_value): Change basereg
+ support to use LOC_BASEREG rather than SYMBOL_BASEREG_VALID.
+ * dwarfread.c: Use LOC_BASEREG where appropriate.
+ * Various: Support LOC_BASEREG and LOC_BASEREG_ARG.
+
+ * coffread.c (init_lineno, init_stringtab): Don't check whether
+ xmalloc returned NULL.
+
+ * config/vax/xm-vaxult.h: Define NO_PTRACE_H.
+
+ * target.c, target.h: Add "set remotedebug" command.
+ * remote-bug.c, remote.c, remote-mips.c: Remove "set remotedebug" and
+ "set m88ksnoop" options and use generic "set remotedebug" instead.
+ * NEWS: Describe this change.
+
+Mon Aug 23 20:26:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * buildsym.h: Remove declaration of dbxread.c functions.
+ * stabsread.h: Group together dbxread.c functions.
+ Move elfstab_build_psymtabs here from symfile.h.
+ Declare pastab_build_psymtabs.
+ * elfread.c, paread.c: Include stabsread.h (for stabsread_new_init
+ declaration, etc).
+
+Mon Aug 23 17:16:23 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * remote-bug.c: rename quiet to bug88k_snoop.
+ (double_scan, multi_scan): generalize double_scan into a scan
+ for multiple patterns. Rename to multi_scan.
+ (bug_wait, bug_write_inferior_memory): adapt to use the new
+ multi_scan in order to catch and represent target bus errors.
+ (bug_scan): currently unused, so comment out.
+ (bug_quiet): removed. Replaced with a standard user settable boolean.
+
+ * m88k-tdep.c: remove include of sys/dir.h. Appears unnecessary
+ and isn't available on solaris.
+
+Mon Aug 23 14:56:42 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m88k/{delta88v4.mt,delta88v4.mh}: New files
+ * config/m88k/delta88.mh: Fix comment.
+ * config/m88k/tm-delta88.h: Remove unused BCS define.
+ * config/m88k/{tm-delta88v4.h,xm-delta88v4.h,nm-delta88v4.h}:
+ New files.
+ * configure.in: Recognize m88*-motorola-sysv4*.
+ * m88k-nat.c: Always include sys/types.h; don't depend on USG.
+
+Mon Aug 23 12:57:42 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_symbol, parse_type, cross_ref): Pass name of
+ symbol as an argument and use it in complaints.
+ * symmisc.c (dump_psymtab): Dump filenames of dependencies.
+
+Mon Aug 23 1993 Sean Fagan (sef@cygnus.com)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ Add NetBSD support:
+ * configure.in: Recognize netbsd.
+
+Sun Aug 22 22:50:32 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (get_textlow): Don't go past a K_END when looking for a
+ K_FUNCTION. Avoids losing on source files with no functions.
+
+Fri Aug 20 14:01:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-nindy.c: Remove unused include of sys/ioctl.h.
+
+ * frame.h, symtab.h: Revise comments regarding baseregs.
+
+Fri Aug 20 15:07:05 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_partial_symbols, psymtab_to_symtab_1):
+ Set language for psymtab and symtab.
+ * mipsread.c (new_symbol): Set language and initialize demangled
+ name for symbol.
+ * symmisc.c (print_symbol): Use SYMBOL_SOURCE_NAME when printing
+ the symbol type.
+ * symtab.c (decode_line_1): Inhibit coredumps with cfront executables.
+
+Fri Aug 20 14:01:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Move KERNEL_U_ADDR from xm-hp300bsd.h to nm-hp300bsd.h and make
+ it conditionalized on 4.3 vs. 4.4.
+ * config/m68k/nm-hp300bsd.h: Move REGISTER_U_ADDR out of 4.3 and
+ 4.4 sections; it was identical and now works for 4.4.
+
+ * mips-tdep.c (is_delayed): Use INSN*BRANCH* not ANY_DELAY.
+
+ * printcmd.c (MAKEVA_END): Update this version to use "aligner".
+
+Thu Aug 19 22:08:09 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/vax/tm-vax.h (BELIEVE_PCC_PROMOTION): Define.
+ * mipsread.c (parse_symbol, parse_type, cross_ref): Handle corrupt
+ file indirect entries with complaints instead of core dumps. Remove
+ complaint for stTypedef within aggregates.
+
+Thu Aug 19 17:58:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * coffread.c (process_coff_symbol): Ignore tagnames like .0fake.
+
+ * coffread.c (coff_read_enum_type): #if 0 out code which changes
+ enum {FALSE, TRUE} into boolean.
+
+ * config/m68k/delta68.m{t,h}: Use nm-delta68.h, etc. not
+ non-existent files nm-delta.h, etc.
+ * config/m68k/tm-delta68.h: Define CANNOT_STORE_REGISTER.
+ * delta68-nat.c: Add "[0]" in offsetof argument.
+ * delta68-nat.c (_initialize_kernel_u_addr): Don't try to set up
+ nl with initializer, just assign to it. Check n_scnum field on
+ return.
+
+Wed Aug 18 21:42:52 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hpux_symtab): Call SET_NAMESTRING for K_MODULE
+ debug symbols.
+
+Wed Aug 18 12:03:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_address), values.c (value_as_pointer): Don't
+ use ADDR_BITS_REMOVE.
+ * defs.h: Try to clarify comment about ADDR_BITS_REMOVE.
+
+ * blockframe.c (block_innermost_frame): Uncomment.
+ Return NULL if passed NULL.
+ * frame.h: Declare it.
+ * expression.h (union exp_element): Add field block.
+ * parse.c (write_exp_elt_block): New function.
+ * expression.h (OP_VAR_VALUE): Now takes additional struct block *.
+ * *-exp.y: Write block for OP_VAR_VALUE.
+ * eval.c, expprint.c, parse.c: Deal with block for OP_VAR_VALUE.
+ * valops.c, value.h (value_of_variable), callers:
+ Add second argument, for block.
+
+ * main.c (gdb_readline): If we read some characters followed by EOF,
+ return them rather than returning NULL.
+
+Tue Aug 17 11:14:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mips-tdep.c: Remove unused #ifndef NUMERIC_REG_NAMES and add comment.
+
+Tue Aug 17 15:10:04 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/m88k/tm-m88k.h: Fix typo in comment.
+ (FP_REGNUM): define in terms of SP_REGNUM
+ rather than by absolute number. Also clearly comment that this
+ is a convenient lie in order to decrease future confusion.
+ (ACTUAL_FP_REGNUM): new macro for FP.
+ (FRAME_CHAIN_VALID): removed. Standard default works fine.
+ * m88k-tdep.c (frame_chain_valid): redundant, so removed.
+ (NEXT_PROLOGUE_INSN): removed unused fourth arg, fixed all
+ callers.
+ (read_next_frame_reg): declare static.
+ (examine_prologue): removed unused variabel insn2, rename insn1
+ to insn, rewrote comment about finding fp, sp, etc. set frame_fp
+ based on ACTUAL_FP_REGNUM rather than FP_REGNUM which is
+ actually a scammed alias for SP_REGNUM on m88k.
+
+ * frame.h: fixed typo in comment.
+
+Tue Aug 17 11:14:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * 29k-share/udi/udiphcfg.h: Always include udiphunix.h not udiphdos.h.
+
+ * complaints.c (complain): fflush (stdout) after output.
+
+Tue Aug 17 01:43:55 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c, frame.h (sigtramp_saved_pc): New routine to fetch
+ the saved pc from sigcontext on the stack for BSD signal handling.
+ * config/i386/tm-i386bsd.h (SIGTRAMP_START, SIGTRAMP_END, FRAME_CHAIN,
+ FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, SIGCONTEXT_PC_OFFSET):
+ Define to make backtracing through sigtramp work.
+ * config/vax/tm-vax.h (SIGTRAMP_START, SIGTRAMP_END, TARGET_UPAGES,
+ FRAME_SAVED_PC, SIGCONTEXT_PC_OFFSET): Ditto.
+
+Mon Aug 16 13:52:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (cd_command): If current_directory on entry is "/", then
+ don't append an extra slash.
+ Don't assume that /../.. means /.
+
+ * target.c (target_xfer_memory): Clear errno before calling
+ to_xfer_memory.
+
+ * stack.c (frame_info, print_frame_info): Add comment about using
+ the starting source line number on a line boundary if backtracing
+ through sigtramp.
+
+Mon Aug 16 09:52:33 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Add U Utah contribution notice. Add TODO list.
+ (hp_type_lookup): Use TYPE_NAME and TYPE_TAG_NAME.
+ (process_one_debug_symbol): Likewise.
+
+Mon Aug 16 02:56:01 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c (create_new_frame, get_prev_frame_info):
+ Use the function name when calling IN_SIGTRAMP.
+ * config/m68k/tm-m68k.h (SIG_PC_FP_OFFSET, SIG_SP_FP_OFFSET):
+ Define for correct handling of bachtraces through _sigtramp.
+ * m68k-tdep.c (m68k_find_saved_regs): Adjust saved sp for fake
+ sigtramp frames.
+ * mipsread.c (parse_type): Handle corrupt TIR info with complaint
+ instead of core dump.
+ * mipsread.c (parse_partial_symbols): Put static symbols into the
+ mimimal symbol table, use proper mst_types for all minimal symbols.
+ * stack.c (frame_info, print_frame_info): Use the starting source
+ line number on a line boundary if backtracing through sigtramp.
+
+Fri Aug 13 14:37:05 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * remote-bug.c: include gdbcmd.h.
+ (sleep, remque, insque): forward decls added.
+ (bug_fetch_registers, bug_store_registers): forward decls
+ removed.
+ (bug_read_inferior_memory, bug_write_inferior_memory): forward
+ decls added.
+ (srec_frame, srec_max_retries, srec_bytes, srec_echo_pace,
+ srec_sleep, srec_noise): new static variables for user settable
+ options. Mostly these are for debugging and tuning. I don't
+ expect them to stay user settable options for long.
+ (timeout): change default to 4 seconds.
+ (check_open): declare funtion static, force return value.
+ (readchar_nofail): if timeout, then say so if not being quiet.
+ (pollchar, double_scan, bug_scan, bug_srec_write_cr,
+ start_load): new functions.
+ (bug_wait): rewritten to use double scan.
+ (expect): while (1) -> for (;;)
+ (get_hex_digit): rewrite if condition to avoid gcc complaints.
+ (bug_load, bug_create_inferior, bug_open, bug_store_register):
+ removed unused variables.
+ (bug_load): replaced DELTA macro with user settable srec_frame
+ variable. Other minor lint.
+ (find_end_of_word, is_baudrate_right, set_rate, not_bug_wait,
+ gethex, timed_read, translate_addr, bug_before_main_loop):
+ unsused and removed.
+ (bug_resume): add missing first arg, pid.
+ (get_reg_name): use ip rather than cr04.
+ (bug_write, bug_write_cr, but_clear_breakpoints, bug_quiet):
+ declare type, args, and explicitly return.
+ (bug_store_register): straighten out the ip vs cr04 confusion.
+ (bug_write_inferior_memory): rewrite to cope with errors while
+ downloading s-records.
+ (bug_read_inferior_memory): declare static.
+ (bug_clear_breakpoints): expect nobr before prompt.
+ (_initialize_remote_bug): add initializations for srec-bytes,
+ srec-max-retries, srec-frame, srec-noise, srec-sleep,
+ srec-echo-pace.
+
+ * Makefile.in (remote-bug.o): new rule.
+ (ALLDEPFILES): added remote-bug.c
+
+ * remote-hms.c (hms_wait): use -1 for timeout's which means block
+ forever rather than 99999.
+
+ * ser-unix.c (get_tty_state): if a descriptor is not a tty, then
+ simply save encode this fact as the process group and return
+ success rather than an error.
+ (set_tty_state): if process group is -1, do not reset the
+ process group.
+ (hardwire_reachar): comment change.
+
+ * serial.h: comment change.
+
+ * config/m88k/tm-m88k.h: comment change to remove embedded
+ comment.
+ (SKIP_PROLOGUE): skip_prologue returns a value which is expected
+ to reset the pc argument. So reset it.
+
+Fri Aug 13 10:15:24 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.10.1 after release and cvs
+ tagging.
+
+Thu Aug 12 20:40:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/Makefile.in: Use GDBSERVER_LIBS and
+ GDBSERVER_DEPFILES. Also remove much (but not all that could be
+ removed) crud inherited from gdb Makefile.in.
+ * config/i386/i386lynx.mh, config/sparc/sun4os4.mh: Define GDBSERVER_*.
+ * gdbserver/README: Say it works on Sun and change configuration
+ instructions slightly.
+
+Wed Aug 11 18:56:59 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config/i386/i386v4.mh: use -lsocket and -lnsl, for remote
+ targets that use BSD style network connections
+
+Wed Aug 11 17:54:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-{monitor,bug}.c: Make bug_ops not static (forward declaration
+ of statics doesn't work with SunOS4 /bin/cc).
+ Rename the occurrence in remote-monitor.c to monitor_bug_ops.
+
+Tue Aug 10 13:07:14 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * blockframe.c (find_pc_partial_function),
+ mips-tdep.c (find_proc_desc): Deal with "pathological" case.
+
+Tue Aug 10 14:50:30 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (wrap_here): Allow indent to be NULL.
+ (fputs_filtered): Don't check for null wrap_indent (wrap_here now
+ guarantees that it isn't, and anyway we were only checking one out
+ of the two places we dereferenced it).
+
+ * objfiles.h (struct objfile): Clean up comments for
+ {obj,sym}_private to clarify what they are private to.
+
+Mon Aug 9 16:45:00 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * stabsread.c, buildsym.c (hashname): Moved function to
+ buildsym.c, as suggested in the sources.
+
+Mon Aug 9 09:53:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c: Make udi_ops extern rather than trying forward
+ declaration of a static variable.
+
+ * hppab-nat.c: Define ptrace to call_ptrace and pass the 5th arg
+ there, rather than using an ANSI C specific macro.
+
+ * 29k-share/udi/udr.c: Include fcntl.h not sys/fcntl.h. Also put
+ sys/types.h near the top (just on general principles).
+
+ * environ.c (set_in_environ): Remove G960BASE and G960BIN; they are
+ no longer used.
+
+ * gdbcore.h: New variable gnutarget.
+ * core.c: Add commands to set and show it.
+ * Callers to bfd_*open*: Pass gnutarget instead of NULL as target.
+ * environ.c (set_in_environ): For GNUTARGET, use set_gnutarget not
+ putenv.
+
+ * symtab.c (decode_line_1): Give error on unmatched single quote.
+
+Sun Aug 8 13:59:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * ser-unix.c (hardwire_send_break) [HAVE_SGTTY]: Use select not usleep.
+
+ * remote.c: Add comments about 'd', 'r', and unrecognized requests.
+
+ * inflow.c (terminal_init_inferior): Don't muck with tty state if
+ gdb_has_a_terminal() is false.
+
+Sun Aug 8 10:07:47 1993 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (record_minimal_symbol): Remove prototype and
+ function.
+ * dwarfread.c (add_partial_symbol): Remove code to add minimal
+ symbols and remove comment about limitations. Experiments show
+ that now that gdb handles the ELF symtab better for creating
+ minimal symbols, that no additional information is added by
+ examining the DWARF information, and in fact, given the
+ limitations, the DWARF code was actually making things worse.
+
+Sat Aug 7 10:59:03 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * elfread.c (elf_symtab_read): Properly sort out the bss symbols
+ from the data symbols and give them the correct minimal_symbol_type.
+ Add file static symbols to the minimal symbol table, not just
+ global symbols. Add absolute symbols as well (like _edata, _end).
+ Redo stabs-in-elf special symbol handling now that file static
+ symbols are entered into the into the minimal symbol table.
+ * dwarfread.c (add_partial_symbol): Add comment about limitations
+ of DWARF symbols for distinquishing data from bss when adding
+ minimal symbols. Add file local symbols to minimal symbols.
+
+Thu Aug 5 08:58:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * ser-go32.c: Define job_control variable.
+
+Thu Aug 5 15:56:13 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.in: z8k-coff is the same as z8k-sim
+
+Thu Aug 5 08:58:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * 29k-share/udi/udip2soc.c: Include sys/types.h before sys/file.h.
+
+ * config/i386/tm-i386bsd.h (NUM_REGS): There are only 10, not 11.
+
+ * inflow.c: Put all uses of F_GETFL and F_SETFL in #ifdef F_GETFL.
+
+ * 29k-share/udi/udip2soc.c: Include fcntl.h not sys/fcntl.h.
+
+Wed Aug 4 18:32:12 1993 Fred Fish (fnf@cygnus.com)
+
+ * inflow.c (pass_signal): Signal handlers take one int arg;
+ supply an unused one to make it type compatible as an arg to
+ signal().
+
+Tue Aug 3 18:34:14 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/mips/tm-mips.h: Include bfd.h before coff/sym.h.
+
+Tue Aug 3 15:34:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (ALLCONFIG): Add config/i386/i386nw.mt,
+ config/m68k/delta68.mh, config/m68k/delta68.mt,
+ config/m68k/dpx2.mh, config/m68k/dpx2.mt, config/mips/riscos.mh,
+ config/mips/news-mips.mh.
+ * Makefile.in (ALLPARAM): Add config/i386/nm-symmetry.h,
+ config/i386/tm-i386nw.h, config/m68k/nm-delta68.h,
+ config/m68k/tm-delta68.h, config/m68k/xm-delta68.h,
+ config/m68k/nm-dpx2.h, config/m68k/tm-dpx2.h,
+ config/m68k/xm-dpx2.h, config/mips/xm-makeva.h.
+ * Makefile.in (ALLDEPFILES): Add dpx2-nat.c.
+
+Tue Aug 3 12:02:09 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c: Updated for BFD ECOFF changes. Now gets the
+ swapping routines and external structure sizes via the
+ ecoff_backend information. No longer includes coff/mips.h.
+
+Tue Aug 3 10:58:04 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (SFILES): Add thread.c
+
+Tue Aug 3 10:21:58 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * remote-sp64sim.c (simif_create_inferior): Add FIXME regarding
+ sim_set_args return code.
+
+Mon Aug 2 16:35:31 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in (VERSION): bumped to 4.9.4.
+
+ * remote-monitor.c: updated copyright.
+ (bug_ops, monitor_desc): now static.
+ (monitor_desc): in several places, check and/or set to NULL.
+
+ * remote-hms.c (hms_files_info): Add the appropriate items where
+ missing in the printf call.
+
+ * remote-bug.c: new file for m88k bug support.
+
+ * config/m88k/m88k.mt (TDEPFILES): added remote-bug.o.
+
+Mon Aug 2 14:22:09 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * h8300-tdep.c: Use new variable h8300hmode.
+
+Mon Aug 2 12:06:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (typecmp): If we are passing a non-reference to a function
+ which takes a reference, pass the address.
+ (value_arg_coerce): Don't use COERCE_ENUM; we don't want to dereference
+ references here.
+
+ * thread.c (thread_switch): Define as static.
+ (add_thread): Cast return value from xmalloc.
+
+ * gdbtypes.c (fill_in_vptr_fieldno): Call check_stub_type.
+ * gdbtypes.{c,h}: Improve comments on vptr_fieldno.
+
+Mon Aug 2 11:58:52 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * README: Elaborate on gdb C++ support and cfront support.
+
+Mon Aug 2 11:30:57 1993 Stu Grossman (grossman at cygnus.com)
+
+ * i386lynx-nat.c, thread.c, thread.h: Update copyrights.
+
+Mon Aug 2 12:06:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (ALLDEPFILES): Add i386lynx-nat.c.
+
+Mon Aug 2 08:42:50 1993 Stu Grossman (grossman at cygnus.com)
+
+ * gdbserver/remote-inflow.c (create_inferior): Fix comments, and
+ error msg. Setup seperate process group for child.
+ * (write_inferior_memory): Sleep for 1 second and retry on ptrace
+ failure.
+
+Sun Aug 1 22:58:18 1993 Stu Grossman (grossman at cygnus.com)
+
+ * config/i386/i386lynx.mh (NATDEPFILES): Drop coredep (for now).
+ * config/i386/nm-i386bsd.h: Protect from multiple inclusion.
+ * config/i386/nm-i386lynx.h: Lotsa new host porting stuff.
+ * config/i386/tm-i386lynx.h: Define SAVED_PC_AFTER_CALL and
+ target_pid_to_str.
+
+ * Makefile.in (CLIBS): Reorder to make Lynx ld happy.
+ * (HFILES): New file thread.h.
+ * (OBS): New file thread.c.
+ * configure.in: Host config for Lynx/386.
+ * fork-child.c (fork_inferior): Call init_thread_list().
+ * infrun.c (resume): Add pid to invocation of target_resume().
+ * (wait_for_inferior): Pay attention to pid from target_wait().
+ Multi-threading code now uses this to determine what to do.
+ * inftarg.c (child_wait): Conditionalize based on CHILD_WAIT macro.
+ Use target_pid_to_str() macro throughout when printing pid.
+ * inferior.h (child_resume): Add pid to prototype.
+ * hppab-nat.c hppah-nat.c infptrace.c (child_resume): Pass in pid as
+ argument, instead of using inferior_pid.
+ * procfs.c (procfs_resume): Pass in pid as argument. Ignored for
+ now. Use target_pid_to_str() macro throughout for printing process id.
+ * remote-adapt.c (adapt_resume): Pass in pid as argument.
+ * remote-eb.c (eb_resume): Pass in pid as argument.
+ * remote-es.c (es1800_resume): Pass in pid as argument.
+ * remote-hms.c (hms_resume): Pass in pid as argument.
+ * remote-mips.c (mips_resume): Pass in pid as argument.
+ * remote-mm.c (mm_resume): Pass in pid as argument.
+ * remote-monitor.c (monitor_resume): Pass in pid as argument.
+ * remote-nindy.c (nindy_resume): Pass in pid as argument.
+ * remote-sa.sparc.c (remote_resume): Pass in pid as argument.
+ * remote-sim.c (rem_resume): Pass in pid as argument.
+ * remote-sp64sim.c (simif_resume): Pass in pid as argument.
+ * remote-st.c (st2000_resume): Pass in pid as argument.
+ * remote-udi.c (udi_resume): Pass in pid as argument.
+ * remote-vx.c (vx_resume): Pass in pid as argument.
+ * remote-z8k.c (rem_resume): Pass in pid as argument.
+ * remote.c (remote_resume): Pass in pid as argument.
+ * solib.c (solid_create_inferior_hook): Pass inferior_pid to
+ target_resume().
+ * target.c (normal_pid_to_str): New routine to print out process
+ ID normally.
+ * target.h (struct target_ops): Add pid to prototype at
+ to_resume(). (target_resume): Add pid argument.
+ * (target_pid_to_str): Default definition for normal type pids.
+ * thread.h, thread.c: New modules for multi thread/process control.
+
+Sun Aug 1 13:02:42 1993 John Gilmore (gnu@cygnus.com)
+
+ * README: Say that bug-gdb is also the place to send requests
+ for help with GDB.
+
+Sun Aug 1 09:42:13 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (make-proto-gdb-1): Use -f opt on rm of Makefile.
+ * h8500-tdep.c: Add parens around a few macro args.
+
+Fri Jul 30 15:43:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove items about unix-to-unix/rapp debugging (now we
+ have gdbserver), moving xm files to subdirectory, ptype yylval,
+ and file-local symbols.
+
+ * gdbtypes.h: Improve comments about C++ methods.
+
+Fri Jul 30 14:16:32 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * c-exp.y: Add missing 5th arg for one call to lookup_symbol, cast
+ NULL in all other calls to correct pointer types.
+
+Fri Jul 30 15:43:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ From Jeffrey Law:
+ * tm-hppa.h (TARGET_WRITE_PC): Define.
+ * hppa-tdep.c (hppa_fix_call_dummy): If in a syscall,
+ then return the address of the dummy itself rather than
+ the address of $$dyncall.
+ (target_write_pc): New function to store a new PC.
+
+Fri Jul 30 12:51:27 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Always reparse breakpoint
+ conditions, they might contain symbol table references.
+
+Fri Jul 30 12:51:27 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_symbol): Handle opaque struct definitions and
+ type naming for stTypedef symbols.
+
+Fri Jul 30 14:44:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-exp.y (yylex): Detect C++ nested types.
+
+Fri Jul 30 11:07:37 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * sp64-tdep.c (sparc64_frame_chain, sparc64_frame_saved_pc): Deleted.
+ (dump_ccreg, sparc_print_register_hook): New fns.
+ * remote-sim.h: New file.
+ * remote-sp64sim.h (sim_*): External fns. (simif_*): Internal fns.
+
+ * config/sparc/sp64.mt: New file.
+ * config/sparc/tm-sp64.h (FRAME_CHAIN, FRAME_SAVED_PC): Deleted.
+ (PRINT_REGISTER_HOOK): Call new fn sparc_print_register_hook.
+
+Fri Jul 30 10:15:01 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (ALLCONFIG): Add config/i386/ptx.mh
+
+Fri Jul 30 08:58:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ From J. Law:
+ * infcmd.c (read_pc): Remove PA specific code.
+ * tm-hppa.h (TARGET_READ_PC): Define.
+ * hppa-tdep.c (target_read_pc): New function.
+
+ * symtab.c (gdb_mangle_name): Deal with it if type lacks a name.
+
+Fri Jul 30 07:36:53 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * NEWS: Add note that DEC alpha support is host only, not native.
+ * README: Emphasize that C++ support works best with GNU C++ and
+ stabs debugging format.
+ * delta68-nat.c: Add missing FSF copyright.
+
+Fri Jul 30 08:58:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * paread.c (pa_symtab_read): Put file-local symbols in minimal symbols.
+ * hppa-tdep.c (frame_chain_valid): Check that our function has the
+ same address as _start, not that it must be the same symbol.
+
+Fri Jul 30 00:18:40 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (ALLDEPFILES): Add delta68-nat.c
+ * Makefile.in (delta68-nat.o): Add dependency.
+
+Thu Jul 29 12:09:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * value.h (COERCE_ENUM): Use COERCE_REF to coerce refs; value_ind
+ was adequate in gdb 3.5 but not now.
+
+ * valops.c (typecmp): An array in t2 matches a pointer in t1.
+
+ * valops.c (typecmp): When comparing type1& to type2, compare
+ type1 and type2 as leniently as if we were comparing type1 to
+ type2.
+
+ * cp-valprint.c (cplus_print_value): Don't dump core if the
+ baseclass doesn't have a name.
+ * values.c (vb_match): New function, which finds the virtual
+ base class pointer even if the types are nameless.
+ (baseclass_{addr,offset}): Use it.
+
+ * hppa-tdep.c: Make "maintenance print unwind" command from old
+ "unwind" command.
+
+ * remote-udi.c: Remove udi_timer, call to siginterrupt, and associated
+ obsolete junk which apparently had been copied from the
+ pre-serial.h remote.c, but which is no longer used.
+
+Thu Jul 29 12:36:20 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (NONSRC): Need 29k-share/README, not
+ 29k-share/udi/README.
+
+Thu Jul 29 12:09:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * paread.c (pa_symfile_init): If error reading string table, don't
+ use errno in cases where it hasn't been set.
+
+ * ser-unix.c (gdb_setpgid): Pass our pid, not 0, to setpgid.
+
+ * remote-monitor.c (_initialize_monitor): Comment out use of
+ connect_command, since connect_command itself is commented out.
+
+ * remote-monitor.c (generic_open): Parse arguments the same way
+ as remote.c.
+
+ * hppa-tdep.c (pc_in_linker_stub): Fix unclosed comments.
+
+Wed Jul 28 13:19:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/xm-mips.h: Define HAVE_TERMIOS.
+
+ * dbxread.c (record_minimal_symbol): Don't put gcc_compiled or
+ __gnu_compiled* symbols into the minimal symbols.
+
+Wed Jul 28 08:26:58 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-mips.c (_initialize_remote_mips): Added "timeout" and
+ "retransmit-timeout" variables to set mips_receive_wait and
+ mips_retransmit_wait, respectively.
+
+Wed Jul 28 03:58:58 1993 (pes@regent.e-technik.tu-muenchen.de)
+
+ * symmisc.c (dump_msymbols): Handle new mst_file_* types.
+
+Tue Jul 27 12:07:38 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c: Remove old comment about download not implemented.
+
+ * serial.h, ser-{unix,go32,tcp}.c: Add flush_input and send_break.
+ * nindy-share/*, remote-nindy.c: Extensive hacking to make it
+ conform to GDB conventions like using memcpy not bcopy, serial.h,
+ etc. This is to make it host on Solaris, AIX, etc.
+ * Makefile.in: Reflect removed nindy-share files.
+ * config/i960/nindy960.mt (TDEPFILES): Remove ttybreak.o.
+
+ * stack.c (print_frame_info): Revise comment about `pathological'
+ case (there was a wrong FIXME about text labels; also asm() can
+ trigger this as well as versions of ar which truncate .o names).
+
+ * buildsym.c (start_subfile): If a .c file includes a .C file, set
+ the language of both of them to C++.
+
+ * config/sparc/xm-sun4os4.h: Define MEM_FNS_DECLARED and include
+ <memory.h>.
+ Include <malloc.h> rather than declaring malloc functions ourself.
+
+ * ser-unix.c (set_tty_state): Don't ignore errors setting process
+ group.
+ * inflow.c (terminal_inferior): If attach_flag set, ignore errors
+ from set_tty_state.
+
+ * fork-child.c (fork_inferior): Only quote exec file if needed.
+
+ * mipsread.c (parse_symbol): Remove 21 Jul 93 change with
+ stTypedef inside an stBlock.
+
+Tue Jul 27 12:36:49 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (breakpoint_1): Walk the breakpoint chain to decide if
+ we have breakpoints or watchpoints as we might have to ignore internal
+ breakpoints.
+
+ Fix gdb core dumps after `file newfile' commands.
+ * symtab.h, symfile.c (clear_symtab_users): New routine which
+ unconditionally clears symtab users. clear_symtab_users_once
+ commented out as it was a noop anyway.
+ * objfiles.c (free_objfile): Don't call clear_symtab_users_once.
+ * objfiles.c (free_all_objfiles), symfile.c (new_symfile_objfile),
+ xcoffexec.c (exec_close): Call clear_symtab_users if necessary.
+ * symfile.c (syms_from_objfile): Install cleanups for errors during
+ symbol reading.
+ * coffread.c, dbxread.c, mipsread.c, xcoffread.c (*_symfile_read):
+ Lint cleanup code, call do_cleanups explicitly.
+ * symfile.c (symbol_file_add): Call new_symfile_objfile and
+ reinit_frame_cache _after_ the new symbols are read in.
+
+Tue Jul 27 01:57:01 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_type): Do not set tag name for compiler
+ generated fake tag names.
+
+Mon Jul 26 17:31:49 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * config/m88k/m88k.mt (TDEPFILES): add exec.o.
+
+Mon Jul 26 13:17:36 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hppa-tdep.c: Remove all uses of use_unwind and `set use_unwind'
+ command. Now we use unwind info by default if we can find it.
+
+ * config/sparc: Move VARIABLES_INSIDE_BLOCK and SUN_FIXED_LBRAC_BUG
+ to tm-sparc.h so they are shared between Solaris and SunOS4.
+ * dbxread.c (process_one_symbol): Deal with SunOS4 acc N_STSYM and
+ N_GSYM functions.
+
+ * config/pa/tm-hppa.h (REGISTER_NAMES): Use "fr" rather than "fp"
+ for floating point registers.
+
+ * mipsread.c (parse_symbol): Put stStaticProc symbols in minimal
+ symbols as mst_file_text.
+
+ * hppa-tdep.c (pc_in_linker_stub): Return 0 if can't read memory.
+
+ * stabsread.c (rs6000_builtin_type): Make logical types be
+ TYPE_CODE_BOOL.
+
+Sun Jul 25 23:41:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.{c,h} (struct breakpoint): Replace symtab field with
+ source_file field.
+
+Fri Jul 23 09:57:25 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote.c: Don't error() on errors xferring memory.
+ * target.h: Clean up comments about *xfer_memory.
+
+ * exec.c, corelow.c (target_ops struct): Don't allow
+ {insert,remove}_breakpoints to be defaulted to
+ memory_{insert_remove}_breakpoint.
+
+ * demangle.c: Make it so `help set dem' tells you how to get the
+ list of demangling styles.
+
+Thu Jul 22 15:41:09 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * Makefile.in: Use REMOTE_O macro not remote.o.
+ * config/i960/{nindy960,vxworks960}: Don't use remote.o.
+
+Thu Jul 22 12:43:25 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coredep.c: If NEED_SYS_CORE_H defined, include <sys/core.h>
+ (can't include it in nm-*.h file because it causes conflicts with
+ a.out symbol definitions).
+ * hp300ux-nat.c (fetch_core_registers): Commented out; obsolete.
+ * config/m68k/hp300hpux.mh (NATDEPFILES): Added coredep.o and
+ corelow.o.
+ * config/m68k/nm-hp300hpux.h (NEED_SYS_CORE_H): Defined.
+ (REGISTER_U_ADDR): Defined.
+ * config/m68k/xm-hp300hpux.h (HAVE_TERMIOS): Define instead of
+ HAVE_TERMIO.
+ * config/pa/xm-hppah.h: Likewise.
+
+Wed Jul 21 11:37:30 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * mipsread.c (parse_symbol): when stTypedef and friends occur within
+ an stBlock, skip over the fields of the inner one.
+
+ * mips-tdep.c (init_extra_frame_info): If in lenient prologue, call
+ heuristic_proc_desc rather than just assuming registers not saved.
+
+ * Makefile.in (regex.o): Add dependency.
+
+ * hppa{b,h}-nat.c: Warning, not error, if can't access registers.
+
+ * config/pa/hppa{b,h}.h: Define ATTACH_DETACH.
+
+Wed Jul 21 03:07:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/xm-makeva.h: New file implements va_list alignment
+ restrictions for mips hosts.
+ * config/mips/{xm-irix3.h, xm-mips.h, xm-news-mips.h, xm-riscos.h}:
+ Use it.
+
+Wed Jul 21 00:11:05 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (init_extra_frame_info): Do not check for
+ mips_in_lenient_prologue if it is a dummy frame.
+ * mipsread.c (fixup_sigtramp): Initialize pdr.adr, it is used by
+ mips_in_lenient_prologue.
+
+Tue Jul 20 14:14:59 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hp_array_type): Handle "char foo[]".
+
+Tue Jul 20 12:53:47 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * mips-tdep.c (heuristic_proc_start): First time we print the
+ warning, elaborate.
+ (_initialize_mips_tdep): Improve docstring for `set heur'.
+
+ * config/rs6000/tm-rs6000.h: Remove call to insert_step_breakpoint.
+
+ * symtab.c (find_line_symtab): New function, to deal with multiple
+ symtabs with the same name.
+ (find_line_pc{,_range}): Use it.
+ (find_pc_symtab): Add comment about overlapping symtabs.
+
+Mon Jul 19 21:29:14 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (SFILES): Add nlmread.c.
+ * Makefile.in (OBS): Add nlmread.o.
+ * Makefile.in (nlmread.o): Add new target.
+ * configure.in (i[34]86-*-netware): New configuration.
+ * nlmread.c, config/i386/{i386nw.mt, tm-i386nw.h}: New files
+ for NLM/NetWare support.
+
+Mon Jul 19 11:48:57 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * symtab.h (enum minimal_symbol_type): Add mst_file_*.
+ * partial-stab.h [DBXREAD_ONLY]: Record statics in miminal symbols.
+ * dbxread.c (record_minimal_symbol): Deal with statics.
+ * minsyms.c (lookup_minimal_symbol): Prefer externals to statics.
+
+ * config/i386/xm-i386sco.h: Define HAVE_TERMIOS.
+
+ * printcmd.c, config/pa/xm-pa.h, config/alpha/xm-alpha.h: Make it so
+ arg_bytes field of makeva_list is always aligned.
+ * config/pa/xm-pa.h: Make arglist_address a char *.
+
+ * ser-unix.c: Don't try to use job control with termio.
+
+Sun Jul 18 23:11:28 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ Make breakpoint_re_set_one work with overloaded member functions,
+ `b 123' and `b foo' if foo is a static function.
+ * symtab.c (decode_line_1, decode_line_2): New argument `canonical'
+ to return canonical line specs if requested by the caller.
+ * breakpoint.c, source.c, symtab.c, symtab.h: Change prototypes and
+ callers accordingly.
+ * symtab.c (build_canonical_line_spec): New helper function which
+ constructs the canonical line spec.
+ * breakpoint.c (break_command_1): Use canonical line spec instead
+ of command string as addr_string if necessary.
+ * source.c (line_info): Fix storage leak.
+
+Sun Jul 18 15:22:45 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * infptrace.c: Split out define of PT_KILL; Sequent defines PT_KILL
+ but not the others.
+ * symm-tdep.c: Remove exec_file_command.
+ [_SEQUENT_] (ptx_coff_regno_to_gdb, register_addr): New functions.
+ A few miscellaneous cleanups.
+ * symm-nat.c: Renamed from symm-xdep.c.
+ * All symmetry dependent files: Many changes.
+
+ * mips-tdep.c (mips_skip_prologue): New argument lenient.
+ Use read_memory_nobpt.
+ (is_delayed, mips_in_lenient_prologue): New functions.
+ (init_extra_frame_info): If in the prologue, don't use saved registers.
+ * config/mips/tm-mips.h: Declare mips_skip_prologue.
+
+ * partial-stab.h (N_SO): Add the text offset to valu before, not after,
+ passing it to END_PSYMTAB.
+
+Fri Jul 16 18:48:52 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * symtab.c (find_pc_symtab): Call warning, not printf directly.
+
+ * solib.c (solib_add): Use x{re,m}alloc, not {re,m}alloc.
+
+Fri Jul 16 09:56:42 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c: No longer need to undefine ZMAGIC.
+
+Thu Jul 15 18:03:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * m88k-pinsn.c: Moved code into opcodes/m88k-dis.c.
+ (print_insn): Now just calls print_insn_m88k.
+
+Thu Jul 15 14:54:05 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * h8300-tdep.c (examine_prologue): Make prototype match definition.
+
+Thu Jul 15 08:34:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * NEWS: Mention that remote.c now has a `load' operation.
+
+ * hppa-tdep.c (pc_in_linker_stub): New function.
+ (find_proc_framesize): Return 0 for linker stubs.
+ (rp_saved): Tell the caller where rp is saved.
+ (frame_chain_valid): Return 1 for linker stubs.
+ (frame_saved_pc): Use return value from rp_saved.
+
+ * stack.c (print_frame_info): When checking PC_IN_CALL_DUMMY,
+ pass the sp relative to the frame in question, not the sp in the
+ innermost frame.
+
+Wed Jul 14 17:37:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mipsread.c (parse_procedure): Take as argument the symtab to look
+ the name up in. Look it up with mylookup_symbol, not lookup_symbol.
+ (psymtab_to_symtab_1): For stabs, pass the symtab to parse_procedure.
+
+ * mipsread.c (mylookup_symbol): Use strcmp, not STREQ, as we have
+ already checked the first characters.
+
+ Changes from Jeffrey Law:
+ * printcmd.c (makeva_list): Use MAKEVA_EXTRA_INFO to define
+ machine dependent fields in the makeva_list structure.
+ (makeva_size): Allocate extra space to handle gaps made by
+ alignment restrictions.
+ * config/pa/xm-pa.h (MAKEVA_EXTRA_INFO): Define.
+ (MAKEVA_START): Initialize arglist_address field.
+ (MAKEVA_ARG): Always store arguments on natural alignment
+ boundaries. Set arglist_address to the address right after
+ the args.
+ (MAKEVA_END): Simply return the value stored in arglist_address.
+
+Wed Jul 14 13:51:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * ch-valprint.c (chill_val_print, case TYPE_CODE_STRING): Print
+ address, not addr.
+
+ * hppah-nat.c (store_inferior_registers): Don't print i in cases
+ where we aren't using it.
+
+ * a29k-tdep.c (get_saved_register): Fix typo.
+
+Wed Jul 14 09:45:52 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * configure.in: Recognize h8300h (variant of h8300).
+
+Wed Jul 14 09:45:52 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * configure.in: Recognize sparc64-*-*.
+
+Tue Jul 13 14:03:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (define_symbol): Make the caddr_t hack apply to `function
+ returning foo' as well as `pointer to foo'.
+
+ * remote.c [REMOTE_BREAKPOINT]: Use for breakpoint insn if defined.
+ * config/m68k/tm-m68k.h: Define it.
+ * mem-break.c, breakpoint.c: Improve comments.
+
+Tue Jul 13 13:35:31 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
+
+ * config/m68k/tm-dpx2.h: Replace "tm-68k.h" with "m68k/tm-m68k.h".
+ * config/m68k/xm-dpx2.h: Define HAVE_TERMIOS not HAVE_TERMIO.
+
+Tue Jul 13 11:50:38 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * gdbcore.h (read_memory_integer, read_memory_unsigned_integer):
+ Make prototype match definition.
+
+Tue Jul 13 11:15:15 1993 Fred Fish (fnf@cygnus.com)
+
+ * elfread.c: Remove notice about file still being under
+ construction.
+ * Makefile.in (ultra3-xdep.o, umax-xdep.o): Add missing ')'.
+
+Mon Jul 12 17:46:35 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * a29k-tdep.c (read_register_stack): Make val static.
+
+Mon Jul 12 14:10:48 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config/h8300/tm-h8300.h (REGISTER_CONVERTIBLE): Change value to 0.
+ (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Move def'n to
+ usual spot.
+
+Mon Jul 12 11:29:44 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-valprint.c (c_val_print): Fix thinko with unspecified length
+ arrays.
+
+ * hppa-tdep.c (find_proc_framesize): If there is a frame pointer,
+ use it.
+
+Sun Jul 11 19:35:05 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (decode_line_1): Use end of block to figure out whether
+ val.end is in the same function, not minimal symbols.
+
+ * source.c (line_info): Add a few more wrap_here's.
+
+ * i386-tdep.c (i386_follow_jump): Do byteswapping where needed and
+ don't make assumptions about sizes of host data types.
+
+ * blockframe.c, symtab.h (find_pc_partial_function): New arg endaddr.
+ * infrun.c, breakpoint.c, printcmd.c: Change callers.
+ * printcmd.c (containing_function_bounds): Remove.
+ * printcmd.c (disassemble_command): Use find_pc_partial_function,
+ not containing_function_bounds.
+ * infcmd.c (step_1): Use find_pc_partial_function rather than
+ trying to roll our own. Move check for a pc between SIGTRAMP_START and
+ SIGTRAMP_END in find_pc_partial_function, not step_1.
+
+ * sparc-tdep.c (sparc_frame_chain, frame_saved_pc):
+ Keep unswapped value in array of char, not REGISTER_TYPE.
+ Use REGISTER_RAW_SIZE not sizeof (REGISTER_TYPE).
+ (sparc_extract_struct_value_address): Use TARGET_PTR_BIT not
+ sizeof (CORE_ADDR).
+
+Thu Jul 1 15:50:05 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
+
+ * configure.in (m68*-bull-sysv*): added support for Bull dpx2.
+ * config/m68k/{t,x,n}m-dpx2.h, dpx2-nat.c: New files.
+ * config/m68k/dpx2.m{h,t}: New files.
+
+Thu Jul 1 15:46:10 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Run through gnu-indent.
+
+Sun Jul 11 12:32:08 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config/sparc/tm-sparc.h (PRINT_REGISTER_HOOK): Fix typo, add
+ more parens around macro arg.
+
+Sat Jul 10 09:54:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c: Remove step_resume_{duplicate,shadow}. Replace
+ step_resume_break_address with step_resume_breakpoint (now local
+ to wait_for_inferior).
+ ({insert,remove}_step_breakpoint): Remove.
+ (wait_for_inferior): Set step resume break with
+ set_momentary_breakpoint. Test hitting it with bpstat_stop_status
+ and bpstat_what (stop_step_resume_break removed).
+ * breakpoint.{h,c}, infrun.c: Return value from bpstat_what now struct
+ which includes previous return value as main_action, and a step_resume
+ bit.
+ * breakpoint.c (delete_breakpoint): If breakpoint was inserted, and
+ there is another breakpoint there, insert it.
+ * infrun.c (wait_for_inferior): Rearrange the spaghetti a bit. Use
+ a few more gotos.
+ Various: Clean up and add comments.
+
+ * infrun.c [TDESC]: Remove remaining tdesc code (see ChangeLog
+ for Wed Nov 13 16:45:13 1991).
+
+Fri Jul 9 12:36:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * values.c, value.h (modify_field), callers: Make fieldval a LONGEST.
+
+ * h8300-tdep.c (NEXT_PROLOGUE_INSN): Make pword1 an INSN_WORD *
+ not short *.
+
+ * findvar.c, defs.h
+ ({extract,store}_{signed_integer,unsigned_integer,address}):
+ New routines to replace SWAP_TARGET_AND_HOST.
+ All over: All uses of SWAP_TARGET_AND_HOST on integers replaced.
+
+ * config/sparc/tm-sparc.h: Add comment suggesting that removing
+ ins and locals from the registers array might clean things up.
+
+ * utils.c: Clean up comments about wrap buffer and wrap_here.
+ * printcmd.c (printf_command): Call wrap_here before vprintf.
+
+ * mipsread.c (cross_ref): Set the name to unknown for "struct *" case.
+ Patch from ptf@delcam.co.uk (Paul Flinders).
+
+ * a29k-tdep.c, findvar.c (get_saved_register): Fix byteswapping sins.
+
+Fri Jul 9 09:47:02 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * defs.h, remote-eb.c (TM_FILE_OVERRIDE): Remove it.
+ * mips-tdep.c (init_extra_frame_info): Set proper fci->frame if pc
+ is at the start of the dummy code.
+
+Thu Jul 8 14:48:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * sparc-tdep.c (sparc_push_dummy_frame): Skip all the do_save_insn
+ stuff, just write the sp and fp.
+ (sparc_pop_frame): Skip the do_restore_insn; we already restore
+ the sp with the other out registers.
+
+ * hppa-tdep.c (hppa_push_arguments): Allocate enough space for
+ arguments.
+
+ * hppa-tdep.c: Change _initialize_hppab_tdep to _initialize_hppa_tdep.
+
+Thu Jul 8 14:47:00 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * sparc-tdep.c (sparc_frame_chain): Handle sizeof (CORE_ADDR)
+ != sizeof (REGISTER_TYPE).
+ (frame_saved_pc): Ditto.
+
+Thu Jul 8 08:22:05 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * config/h8300/tm-h8300.h: (REGISTER_TYPES): Adjust for h8/300h.
+ (REGISTER_RAW_SIZE): Ditto.
+ (REGISTER_VIRTUAL_TYPE): Use builtin_type_unsigned_long for regs
+ on the h8/300h (ints may still be 16 bits).
+ (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE,
+ EXTRACT_STRUCT_VALUE_ADDRESS): Add FIXME's for h8/300h. Some
+ thought needed here.
+
+ * h8300-tdep.c (print_insn): Call print_insn_h8300h if h8/300h.
+ (examine_prologue): reg_save_depth is 4 if h8/300h.
+
+ * findvar.c (read_register): Provide some support for 64 bit regs.
+ (write_register): Ditto.
+
+Wed Jul 7 14:30:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/nm-riscos.h: machine/machparam.h is always the right
+ place to look for BSD43_NBPG, not machine/vmparam.h
+
+ * infcmd.c (run_stack_dummy): New argument name.
+ Change error message in (another) attempt to make it comprehensible.
+ * valops.c (call_function_by_hand): Pass name to run_stack_dummy.
+ * symtab.h: Declare demangle and asm_demangle since macros use them.
+
+ * eval.c (evaluate_subexp): Add comment about calling a member
+ function of a variable in a register.
+
+ * expression.h: Clean up comment about string in STRUCT_STRUCT etc.
+
+ * config/{rs6000/tm-rs6000.h,sparc/tm-sparc.h,pyr/tm-pyr.h},
+ inferior.h (PC_IN_CALL_DUMMY) [ON_STACK]: Add comments about stack
+ frame tops and bottoms.
+
+ * frame.h, blockframe.c, stack.c, a29k-tdep.c,
+ config/gould/tmp-{pn,np1}.h,
+ config/{sparc/tm-sparc.h,pyr/tm-pyr.h,vax/tm-vax.h}: Remove field
+ next_frame from struct frame_info. It has no purpose beyond
+ ->next->frame and is an artifact from GDB 2.8.
+
+Tue Jul 6 11:51:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Remove gdb before creating a new one.
+ Update init.c atomically.
+
+ * Makefile.in (ALLPARAM): Add config/{alpha/xm-alpha.h,pa/xm-pa.h}.
+ (ALLCONFIG): Add config/alpha/alpha-osf1.mh.
+
+ * infcmd.c (_initialize_infcmd): In docstring for "continue",
+ describe argument as setting ignore count.
+
+Sun Jul 4 15:04:47 1993 Doug Evans (dje@cygnus.com)
+
+ * h8300-tdep.c (examine_prologue): Fix call to
+ read_memory_unsigned_integer.
+
+Fri Jul 2 18:22:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/{x,n}m-irix{3,4}.h: Make some definitions here
+ rather than including xm-bigmips.h.
+
+ * eval.c (evaluate_subexp): Improve error messages for OP_TYPE and
+ default cases.
+
+ * Makefile.in (distclean): Remove y.tab.h.
+
+Fri Jul 2 14:55:48 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * exec.c (exec_file_command): Remove Mar 28 hack as BFD handles
+ file updates properly now.
+ * mipsread.c (mips_coff_new_init): Force reevaluation of sigtramp
+ addresses if switching to a new symbol file.
+ * dbxread.c (process_one_symbol): Avoid dereferencing NULL
+ symbols that might be returned from define_symbol.
+
+Fri Jul 2 13:33:12 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ New target macros for getting at the pc, sp and fp.
+ * infcmd.c (read_pc, write_pc): Modify to use new macros.
+ (read_sp, write_sp, read_fp, write_fp): New functions.
+ * blockframe.c (reinit_frame_cache, get_prev_frame_info):
+ Use new functions.
+ * breakpoint.c (bpstat_alloc): ditto.
+ * infrun.c (wait_for_inferior): ditto.
+ * stack.c (print_frame_info): ditto.
+ * valops (call_function_by_hand): ditto.
+ * corelow.c (core_open): ditto.
+ * h8500-tdep.c: (target_read_sp, target_write_sp, target_read_pc,
+ target_write_pc, target_read_fp, target_write_fp): New functions.
+ * inferior.h (read_sp, write_sp, read_fp, write_fp): Prototypes.
+
+ * config/alpha/xm-alpha.h: Add MAKEVA_END.
+ * config/h8500/tm-h8500.h: Define new macros.
+
+Fri Jul 2 13:51:04 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (mipos-*-riscos*): New host and target; use riscos.
+ * config/mips/nm-riscos.h: If BSD43_NBPG is not defined by
+ vmparam.h, include machparam.h.
+ (KERNEL_U_ADDR): Define to be BSD43_UADDR.
+
+Fri Jul 2 13:39:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-exp.y (yylex): Give error if unmatched single quote.
+
+ * configure.in, config/m68k/*delta68*, delta68-nat.c: New port.
+
+ * Remove unused STACK_END_ADDR in the following files (in other
+ files it is used for something): tm-mips.h, tm-sun2.h, tm-news.h,
+ tm-a29k, tm-i386v.h, tm-hppa.h, tm-nindy960.h, tm-amix.h,
+ tm-hp300hpux.h, tm-isi.h.
+
+Thu Jul 1 09:51:27 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/mips/nm-riscos.h: Define NBPG and UPAGES.
+ config/mips/xm-riscos.h: Include <sys/types.h>.
+
+ * ser-unix.c (hardwire_noflush_set_tty_state): Use an assignment,
+ not an initializer, to copy the structure.
+
+ * gdbtypes.h (struct type): Add field tag_name.
+ * gdbtypes.c (type_name_no_tag), c-typeprint.c (c_type_print_base):
+ Use it.
+ * {coff,dwarf,mips,stabs}read.c: Set it.
+
+ * xm-sysv4.h: Undefine HAVE_TERMIO.
+
+ * config/mips/nm-riscos.h: Remove unmatched #endif.
+ Define FETCH_INFERIOR_REGISTERS.
+ * config/mips/riscos.mh: Don't include coredep.o; mips-nat.o is enough.
+ Fix misspelling of NAT_FILE.
+ * mips-nat.c (fetch_core_registers): If KERNEL_U_ADDR is not defined,
+ we can still process "modern" core files.
+
+ * ser-unix.c (hardwire_print_tty_state) [HAVE_TERMIOS]: Don't
+ print c_line.
+ (_initialize_ser_hardwire): Just check whether _POSIX_JOB_CONTROL
+ is defined; don't care what it is defined to.
+
+Wed Jun 30 20:06:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/vax/xm-vaxult2.h: Define FD_SET and FD_ZERO.
+
+Tue Jun 29 11:02:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * inftarg.c: Remove unused include of terminal.h.
+ * signals.h: Don't undefine signals anymore.
+ * main.c: Use job_control from serial.h.
+ * fork-child.c (fork_inferior): Use gdb_setpgid.
+ * serial.h, ser-unix.c, ser-go32.c: Provide gdb_setpgid.
+ * utils.c (quit): Use current_target->to_terminal_ours to figure
+ out whether we care about lack of job control, rather than __GO32__.
+ * utils.c: Include serial.h not terminal.h
+ (quit): Use job_control not TIOCGPGRP.
+ * terminal.h: Don't undefine TIOCGPGRP.
+ * serial.h, ser-unix.c, ser-go32.c, ser-tcp.c: Add SERIAL_FLUSH_OUTPUT.
+ * utils.c (quit): Use it.
+ * serial.h: Add SERIAL_UN_FDOPEN.
+ * utils.c (quit): Use it.
+ * ser-unix.c: Add process group to ttystate.
+ [HAVE_SGTTY]: Add tchars, ltchars, and lmode to ttystate.
+ * inflow.c: Include serial.h not terminal.h.
+ Use serial.h stuff to replace most of the maze of #ifdef's.
+ * inflow.c, main.c, inferior.h: make gdb_has_a_terminal a function.
+ * serial.h: Document SERIAL_SET_TTY_STATE as being immediate.
+ * ser-unix.c: Use TIOCSETN not TIOCSETP so it is true.
+ * serial.h, ser-unix.c, ser-go32.c, ser-tcp.c:
+ Add SERIAL_PRINT_TTY_STATE, SERIAL_NOFLUSH_SET_TTY_STATE, and
+ SERIAL_SET_PROCESS_GROUP.
+ * inflow.c: Use them.
+ * config/xm-svr4.h, config/rs6000/xm-rs6000.h, config/sparc/sun4os4.h:
+ Define HAVE_TERMIOS.
+ * Various: Remove all use of TIOC*_BROKEN.
+
+Wed Jun 30 12:20:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/m68k/tm-sun3.h (BELIEVE_PCC_PROMOTION_TYPE): Define.
+
+Tue Jun 29 13:44:41 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * target.h (target_detach): Turn macro into function.
+ * target.c (target_detach): Define it, do deferred register stores
+ before calling the real target function.
+
+Tue Jun 29 13:15:42 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ * symtab.h (BLOCK_SHOULD_SORT): Do not sort blocks corresponding to
+ a function to avoid printing of function arguments in wrong order
+ due to sorting.
+ * symfile.c (compare_symbols): Remove code for sorting arguments
+ as blocks containing arguments are no longer sorted.
+ * symtab.c (lookup_block_symbol): Update comment accordingly.
+
+Tue Jun 29 11:02:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/pa/tm-hppa.h: Remove unused ARGS_GROW_DOC.
+ (REG_STRUCT_HAS_ADDR): Add comment.
+
+ * infrun.c (wait_for_inferior): Use find_pc_line not find_pc_symtab
+ to check whether there is line number information.
+
+Tue Jun 29 08:29:17 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * remote-udi.c: Fix docstring so that it compiles.
+
+ * remote-mips.c, remote-nindy.c: move bfd.h before symfile.h
+ (for file_ptr).
+
+Tue Jun 29 09:11:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c (process_one_symbol): If we find a LOC_BLOCK where we
+ don't expect it, change it to LOC_STATIC so at least we don't coredump.
+
+ * c-typeprint.c (c_type_print_base): Don't error() on invalid type.
+
+ * symtab.h: Add comments about line numbers.
+ * source.c (identify_source_line): Fix off by one bug with line.
+
+Mon Jun 28 19:00:21 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Do not include libhppax. Instead include libhppa.h
+ and hpux-symtab.h. Misc indention fixes.
+ (find_unwind_entry): Add PARAM prototype.
+ (read_hpux_symtab): More fixes for names and sizes of structs,
+ unions, enums, typedefs, and tagdefs.
+ (read_hp_enum_type, read_hp_struct_type): Likewise.
+ (read_hp_set_type, read_hp_subrange_type): Likewise.
+ (hp_type_lookup, process_one_debug_symbol): Likewise.
+ (process_one_debug_symbol): Search forward from the K_FUNCTION for
+ the first K_BEGIN when setting the line number associated with a
+ function. Avoid unnecessary calls to savestring.
+ (hp_alloc_type): Initialize TYPE_CPLUS_SPECIFIC here. Remove
+ most cases where we set it elsewhere.
+ (hppa_sym_fns): Use "hppa" instead of hppax since hpread.c and
+ paread.c use the same BFD backend now. All references changed.
+ (hpux_symfile_init): Allocate space to hold the debugging section
+ contents on the symbol obstack.
+
+Mon Jun 28 10:09:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (makeva*): New interface, for making a va_list.
+ (printf_command): Use it.
+ * config/m88k/xm-delta88.h: Remove VPRINTF define, not needed.
+ * config/pa/xm-pa.h: New file.
+ * config/pa/xm-hppa{b,h}.h: Include it.
+
+ * xcoffread.c: Remove obsolete NO_TYPEDEFS comment.
+
+Sun Jun 27 08:54:55 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valprint.c (val_print_type_code_int): Fix off by one error with
+ eliminating leading zeroes for large little endian integers.
+
+Sun Jun 27 08:58:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/riscos.mh (CC): Use -systype sysv.
+
+ * ser-unix.c: Move #include of <sys/time.h> to HAVE_SGTTY section.
+
+ * Makefile.in (ALLPARAM): Add config/mips/{x,n}-{news-mips,riscos}.h.
+
+Fri Jun 25 11:22:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/tm-m68k.h: Remove obsolete comment about duplicating
+ CALL_DUMMY between different 68k machines.
+
+Fri Jun 25 17:02:45 1993 Stu Grossman (grossman at cygnus.com)
+
+ * gdbserver/Makefile.in: Add dependancies on server.h.
+ * gdbserver/remote-gutils.c: Remove lots of unused functions and
+ variables.
+ * gdbserver/remote-inflow.c: Remove lots of unused variables and
+ #includes. Also, use PTRACE_* symbols instead of constants.
+ (mywait): Surround calls to wait() with enable/disable_async_io()
+ so that we can be interrupted from GDB while waiting for the
+ child. Also, handle child exit more gracefully.
+ * gdbserver/remote-server.c: Remove lots of unused variables.
+ Move all extern defs into server.h. Redo main loop so that
+ failure from getpkt() causes communications to be re-established.
+ Fix 'k' command so that it restarts the child.
+ * gdbserver/remote-utils.c: Remove lots of unloved vars and
+ subrs. Move many extern decls into server.h. (remote_open): For
+ tcp, seperate usage of proto fd from connected fd. Close proto
+ fd after getting connection. (putpkt/getpkt): Pay attention to
+ errors when reading/writing. Report these to the caller. New
+ routines input_interrupt/enable_async_io/disable_async_io to make
+ it possible to get an I/O interrupt when data arrives from the
+ comm link.
+ * serial.h: New file to contain common defs for all remote files.
+
+Fri Jun 25 17:02:45 1993 Stu Grossman (grossman at cygnus.com)
+
+ * remote.c: Add arg names to prototypes, in a modest effort at
+ clarification. Also add prototypes for some new functions.
+ * (remote_wait): Better error reporting for 'T' responses.
+ * ser-go32.c (strncasecmp): Make str1 & str2 be const.
+ * (dos_async_init): Make usage message reflect requested port #.
+ * ser-tcp.c (tcp_open): Terminate hostname properly to prevent
+ random hostname lookup failures. Add nicer message for unknown
+ host error. (wait_for): Wake up in case of exceptions. Also,
+ restart select() if we got EINTR.
+ * ser-unix.c (wait_for): Restart select() if we got EINTR.
+ * serial.c: (serial_close): Clean up code.
+
+Fri Jun 25 11:22:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/tm-m68k.h: Remove obsolete comment about duplicating
+ CALL_DUMMY between different 68k machines.
+
+Fri Jun 25 11:22:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (*.tab.c): Use ./c-exp.tab.c not just c-exp.tab.c.
+ Make comment explaining this comprehensible.
+ (TAGFILES): Include ALLDEPFILES.
+ (ALLDEPFILES): udi2soc.c and udr.c are in 29k-share/udi, not
+ 29k-share/udi/udi.
+ (update-alldeps): Remove; obsolete.
+
+ * remote.c: Move comments regarding packets to top of file with the
+ rest of the protocol comments.
+ Fix incorrect description of 'T' response.
+
+ * README (Reporting Bugs): Refer people to the GDB manual.
+
+ * c-valprint.c (c_val_print): Handle TYPE_CODE_BOOLEAN.
+ * stabsread.c: Type -16 is 4 bytes.
+
+ * remote-udi.c: Improve docstring.
+
+Fri Jun 25 11:16:31 1993 Fred Fish (fnf@cygnus.com)
+
+ * elfread.c (elf_symfile_read): Call bfd_elf_find_section, not
+ bfd_elf32_find_section, to track bfd changes.
+
+Fri Jun 25 11:22:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/riscos.mh (REGEX{,1}, MUNCH_DEFINE, MH_CFLAGS): Define.
+ * config/mips/xm-riscos.h: Define USG.
+
+Thu Jun 24 14:52:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (filename_completer): Don't complete to files ending in ~.
+
+ * NEWS: Mention filename completion and "info line" enhancements.
+
+ * main.c (symbol_completion_function): On "info t foo", return NULL,
+ don't error().
+
+ * main.c (symbol_completion_function): Don't use readline word
+ breaking. Use new calling convention for c->completer and
+ complete_on_cmdlist.
+ * command.h (struct command): Change arguments; now the text passed
+ to completer does not have any word breaking done. New arg word.
+ * symtab.{c,h} (make_symbol_completion_list): Do word breaking. Take
+ word argument.
+ * {main.c,gdbcmd.h} ({filename,noop}_completer): Take word argument.
+ * command.{c,h} (complete_on_cmdlist): Take word argument.
+
+ * command.c (lookup_cmd_1): Doc fix.
+
+Thu Jun 24 13:26:04 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in (OP_INCLUDE): define.
+ (OPCODE_CFLAGS): use OP_INCLUDE.
+
+ * config/i386/ncr3000.mh, config/i386/i386v4.mh,
+ config/i386/i386sol2.mh, config/m68k/hp300hpux.mh,
+ config/m68k/amix.mh, config/mips/irix[34].mh,
+ config/m88k/delta88.mh, config/sparc/sun4sol2.mh (ALLOCA,
+ ALLOCA1): macros removed.
+
+ * config/mips/decstation.mh, config/rs6000/rs6000.mh
+ (MMALLOC_LIB): renamed to MMALLOC.
+
+Wed Jun 23 00:25:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * partial-stab.h: Consolidate case statements for N_LSYM and N_FUN.
+ * dbxread.c: Change comment regarding acc.
+
+Wed Jun 23 16:33:36 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Document a few functions, misc cleanups. Update
+ copyright to reflect the first "release" of this file.
+ (struct hpux_symfile_info): Delete unneeded fields. Keep pointers
+ to the contents of the debug sections rather than offsets within
+ the file itself. Corresponding changes to the accessor macros.
+ (sl_symbol_size, slt_symbuf): Delete unneeded global variables.
+ (slt_symbuf_start, slt_symbuf_end, lntt_symbuf): Likewise.
+ (lntt_symbuf_start, lntt_symbuf_end, gntt_symbuf): Likewise.
+ (gntt_symbuf_start, gntt_symbuf_end): Likewise.
+ (fill_slt_symbuf, fill_lntt_symbuf): Delete unneeded functions.
+ (fill_gntt_symbuf): Likewise.
+ (get_lntt, get_gntt, get_slt): Simplify.
+ (hpux_symfile_init): Read and store the contents of the debugging
+ sections. Do error checking on memory allocation and BFD calls.
+ (read_hpux_symtab): Delete KERNELDEBUG crud. Ignore debug symbols
+ which are not needed for building partial symbol tables. Handle
+ K_CONST, K_TYPEDEF, and K_TAGDEF just like K_SVAR and K_DVAR.
+ (read_ofile_symtab): Delete useless processing_gcc_compilation stuff.
+ (read_hp_struct_type): Initialize TYPE_CPLUS_SPECIFIC.
+ (read_hp_set_type, read_hp_array_type): Likewise.
+ (read_hp_subrange_type, hp_type_lookup): Likewise.
+
+Wed Jun 23 15:04:54 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ Makefile overhaul dropping autodepend features.
+ * Makefile.in: many comment changes. forced consistent use of $()
+ for makefile variables references. dropped leading ./ in file
+ references. Drop $(srcdir)/ prefix on all dependencies.
+ Inserted contents of alldeps.mak and depend.
+ (INCLUDE_CFLAGS): defined as new macro for getting libiberty's
+ include directory into the compilation line.
+ (GDB_CFLAGS): new macro to take up the semantic previously held
+ by INCLUDE_CFLAGS.
+ (LIBIBERTY): dropped ancient subdir macro. I last removed this
+ macro in feb of '92. How does it keep coming back?
+ (MMALLOC_LIB): renamed to MMALLOC.
+ (BFD_SRC_DIR): renamed to BFD_SRC.
+ (BFD_OBJ_DIR): renamed to BFD_DIR.
+ (BFD_LIB): renamed to BFD.
+ (BFD_INCLUDES): renamed to BFD_CFLAGS.
+ (READLINE_DIR): now represents object directory.
+ (RL_LIB): renamed to READLINE.
+ (READLINE_SRC, READLINE_CFLAGS, OPCODES, OPCODES_CFLAGS): new
+ macros.
+ (INTERNAL_CFLAGS): added GDB_CFLAGS, OPCODES_CFLAGS,
+ READLINE_CFLAGS, BFD_CFLAGS. Dropped USER_CFLAGS.
+ (LDFLAGS): removed default assignment.
+ (TEXIDIR, INCLUDE_DEP, MMALLOC_DIR, MMALLOC_DEP, BFD_DEP,
+ READLINE_DEP, LIBIBERTY_DIR, TESTS, depend, STAGESTUFF): unused, so removed.
+ (ALLOCA1, ALLOCA): removed all references. alloca is now in
+ libiberty.
+ (VERSION): unilaterally and arbitrarily bumped to 4.9.3.
+ (SFILES, NONSRC, HFILES, ALLDEPFILES, ALLPARAM, ALLCONFIG):
+ removed all $(srcdir) prefixes.
+ (getopt_h, ieee-float_h, bfd_h, wait_h, dis-asm_h): new macros
+ for potential dependencies. commented out by default.
+ (readline_headers, udiheaders): convenient abbreviations.
+ (gdbcore_h, frame_h, symtab_h, gdbtypes_h, expression_h,
+ value_h, breakpoint_h, command_h, gdbcmd_h, defs_h, inferior_h):
+ new macros used for header file dependencies.
+ (install-info, clean-info): collapse into the info rule.
+ (install): now depends on all.
+ (install-only): new target for installing without depending on
+ all.
+ (uninstall): new target.
+ (config-check, config-check-hosts, config-check-targets): added
+ fixme comments.
+ (ch-exp.tab.c, m2-exp.tab.c): added artificial dependencies in
+ order to force parallel makes into keeping these rules separate.
+ * configure.in: omit cat'ing depend file onto generated Makefile.
+ * alldeps.mak, depend: removed.
+
+ * inferior.h: remove redundant include of symtab.h which is
+ included in value.h via breakpoint.h.
+
+ * alloca.c: removed. alloca is now in libiberty.
+
+ * config/m88k/delta88.mh, config/ns32k/merlin.mh (M_UNINSTALL):
+ new macro to undo what M_INSTALL does.
+
+Wed Jun 23 00:25:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/ns32k/{merlin.mh,xm-merlin.h}: Be consistent about name
+ of gdb-sh.
+
+ * dbxread.c (copy_pending): Change name and function of begi argument
+ to endi, since that is what the caller needs.
+
+ * Makefile.in (TAGFILES): Don't include YYFILES.
+
+ * Makefile.in (HFILES): Include monitor.h.
+
+ * Makefile.in: Include text that used to be in alldeps.mak.
+ Remove config/mips/{bigmips.mh,xm-bigmips} from it.
+ * Makefile.in, configure.in: Remove all traces of alldeps.mak.
+
+ * main.c (main): Print help message on stdout not stderr
+ per standards.texi.
+ New option --version per standards.texi.
+ In help message, show long options with "--" not "-".
+ Don't try to print help message or version until after we have
+ called initialize_all_files.
+
+Tue Jun 22 11:03:13 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Delete useless #if 1 statements.
+ (hp_type_translate): Use T_LONG, T_UNS_LONG, and T_DOUBLE instead
+ of magic integers. Fix handling for T_UNS_INT. Abort if the type
+ passed in is not an "immediate" type.
+ (read_hp_enum_type): Properly compute the size of the type.
+ (read_hp_array_type): Likewise.
+ (hp_type_lookup): Prefix the names of structs, unions and enums
+ with "struct", "union", and "enum" as appropriate.
+
+Tue Jun 22 03:15:38 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * solib.c (solib_add_common_symbols): Don't call lookup_minimal_symbol.
+ (solib_add): Call special_symbol_handling once, not once per library.
+
+ * procfs.c (procfs_resume): Don't pass a SIGTSTP whose action
+ is SIG_DFL.
+
+ * procfs.c (procfs_resume): Skip the unnecessary PRSVADDR on all
+ systems, not just Solaris.
+
+ * stabsread.c: Include <ctype.h>.
+
+Mon Jun 21 16:09:46 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * fork-child.c (fork_inferior): Quote exec_file so it can contain
+ funky characters.
+
+Mon Jun 21 16:56:47 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (INCLUDE_CFLAGS): Add BFD_INCLUDES for now, since
+ bfd.h is included by target.h, which most of gdb includes.
+ * depend: Hand remove BFD_INCLUDES from ${CC} lines, now that
+ it's in INCLUDE_CFLAGS.
+
+Mon Jun 21 16:09:46 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/i386/*aix*, i386aix-nat.c: New files.
+ * configure.in: Use them.
+ * alldeps.mak: List them.
+ * coffread.c (decode_base_type): Deal with anonymous enum type.
+ * i387-tdep.c (print_387_status_word): Add comment re "top".
+ * i386-tdep.c [I386_AIX_TARGET] (i386_extract_return_value): New func.
+ * dbxread.c: Use SEEK_SET and SEEK_CUR, not L_*. Define them if and
+ only if not defined by a header file.
+ * mipsread.c: Don't define L_SET or L_INCR.
+
+Mon Jun 21 15:10:07 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (BFD_INCLUDES): Bfd.h is now back in bfd build dir.
+ * depend: Hand updated to match.
+
+Mon Jun 21 10:13:42 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Include "demangle.h".
+ (process_one_debug_symbol): Set the SYMBOL_LANGUAGE and
+ SYMBOL_INIT_DEMANGLED_NAME for the current symbol. Adjust
+ SYMBOL_VALUE for local variables in the stack by the size of the
+ current function's stack (found in unwind descriptor). Keep
+ better track of the current unwind descriptor.
+
+Sun Jun 20 13:11:11 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * stabsread.c (read_struct_fields): Don't call read_cpp_abbrev on $_.
+ (read_cpp_abbrev): Don't complain specially for $_. Also return 0 if
+ we don't recognize the abbrev.
+
+Sun Jun 20 00:24:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * solib.c (solib_add_common_symbols): Add comment about performance.
+
+Fri Jun 18 12:37:36 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/{{x,n}m-riscos.h,riscos.mh}: New files.
+ * configure.in (mips-*-sysv*): Use riscos for host, bigmips for target.
+
+ * config/mips/{{x,n}m-news-mips.h,news-mips.mh}: New files.
+ * config/mips/{bigmips.mh,xm-bigmips.h}: Remove.
+ * configure.in (mips-sony-*): Use news-mips for host.
+
+ * buildsym.h: Doc fix for processing_acc_compilation.
+
+Thu Jun 17 19:57:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_formatted): Don't use tab in wrap_here arg.
+
+Thu Jun 17 17:29:30 1993 Jim Kingdon (kingdon@lisa.cygnus.com)
+
+ * Makefile.in (INTERNAL_CFLAGS): Include ../include as well as
+ ${srcdir}/../include.
+
+ * config/m88k/xm-delta88.h: Comment out unused defines which conflict
+ with system headers.
+ * printcmd.c (printf_command): Cast second arg to vprintf to PTR.
+ Use VPRINTF macro if defined.
+ * config/m88k/xm-delta88.h: Define VPRINTF. Include <sys/siginfo.h>.
+ Define TIOC{GETC,GLTC}_BROKEN.
+ * m88k-nat.c: Uncomment include of <sys/ptrace.h>.
+ * main.c: Rename initialize_{main,cmd_lists,history} to init_* to
+ make things easier on munch (apparently this matters on
+ the delta88 with svr3).
+
+Thu Jun 17 16:53:56 1993 david d `zoo' zuhn (zoo@cygnus.com)
+
+ * Makefile.in: canonicalize install.sh; for use within
+ this directory (and subdirs)
+
+Tue Jun 15 17:01:23 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: remove parentdir support; use INSTALL_XFORM
+
+Thu Jun 17 15:08:35 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * configure.in (alpha-*-osf*), config/alpha/alpha-osf.mh: New
+ host.
+ * sh-tdep.c (frame_find_saved_regs): Use NUM_REGS rather than hard
+ wired (and wrong) constant.
+ * values.c (unpack_long): Add case to unpack when target object is
+ sizeof(int).
+ * config/sh/tm-sh.h (REGISTER_NAMES): Know about the news ones the
+ simulator defines.
+
+Wed Jun 16 16:08:18 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * NEWS: tracking user visible changes starting with
+ vxworks-timeout.
+
+ * remote-vx.c (_initialize_vx): rename user settable option from
+ rpcTimeout to vxworks-timeout.
+
+Wed Jun 16 14:34:10 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hp_type_translate): Fix promotion bugs from
+ char to short and short to int.
+
+Wed Jun 16 12:21:49 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (depend): More makefile diddling.
+ * alldeps.mak, depend: Update to latest automatically built
+ versions.
+
+ * Makefile.in (depend): Bfd.h keeps moving, keep up with it.
+ * alldeps.mak, depend: Update to latest automatically built
+ versions.
+
+Tue Jun 15 12:26:05 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * remote-vx.c: include gdbcmd.h for setlist.
+ (_initialize_vx): make rpcTimeout user settable.
+
+Mon Jun 14 09:23:51 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * main.c, gdbcmd.h: Add function filename_completer.
+ * main.c, symfile.c, source.c, exec.c, core.c: Use it for
+ "directory", "source", "cd", "symbol-file" "add-symbol-file",
+ "load", "file", "exec-file", "core-file" commands.
+ (But '/' is a word break, limiting usefulness; see comments).
+
+ * source.c (mod_path): Warning not error if can't find directory.
+
+ * isi-xdep.c: New file.
+ * config/m68k/isi.mh (XDEPFILES): Add isi-xdep.o
+
+Sun Jun 13 09:17:48 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/m68k/xm-news.h: Include <sys/param.h>.
+
+ * m88k-tdep.c (IEEE_isNAN): Remove.
+ config/m88k/tm-m88k.h (INVALID_FLOAT): Return 0. This was the same
+ broken isNAN as on the mips.
+
+ * valprint.c (_initialize_valprint): Use c->function.sfunc not just
+ c->function.
+
+ * dbxread.c (process_one_symbol): If SUN_FIXED_LBRAC_BUG is not
+ defined, don't worry about Sun's silly LBRAC bug.
+ * config/m68k/tm-sun3.h: Define SUN_FIXED_LBRAC_BUG to 0.
+
+ * dbxread.c (process_one_symbol): If there's a symbol before an
+ N_SO, don't error().
+ (case N_BCOMM): complain () not error ().
+
+ * defs.h, main.c (catch_errors): Add return_mask arg.
+ stack.c (print_frame_info): Pass RETURN_MASK_ERROR.
+ other callers: Pass RETURN_MASK_ALL.
+ (return_to_top_level), callers: Add return_reason arg.
+ * utils.c (quit):
+ Use return_to_top_level (RETURN_QUIT) instead of error ().
+ * main.c (main), tm-nindy960.h (ADDITIONAL_OPTION_HANDLER):
+ Use SET_TOP_LEVEL not setjmp (to_top_level).
+ * remote-nindy.c: Use catch_errors not setjmp (to_top_level).
+
+Sat Jun 12 14:40:54 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * solib.c (solib_create_inferior_hook) [SVR4_SHARED_LIBS]:
+ Don't try to get the debug base yet.
+
+ * dbxread.c (process_one_symbol): Set n_opt_found based on whether
+ a non-gcc N_OPT symbol is found. Make SUN_FIXED_LBRAC_BUG a macro
+ which returns 0 or 1 to say whether to do it.
+ * config/sparc/sun4{sol2,os4}.h
+ (SUN_FIXED_LBRAC_BUG,VARIABLES_INSIDE_BLOCK): Use n_opt_found so
+ the right thing happens for both acc and SunOS4 /bin/cc.
+
+ * valprint.c (print_hex_chars): Use local_hex_format_{pre,suf}fix.
+ * printcmd.c (print_scalar_formatted): Use val_print_type_code_int.
+
+ * mips-tdep.c: Remove isa_NAN; it assumed sizeof(host int) == 4 and
+ probably contained byte-order sins too.
+ config/mips/tm-mips.h (INVALID_FLOAT): Define to 0 like most machines.
+ The IEEE_FLOAT code in print_floating takes care of it.
+
+Sat Jun 12 14:47:04 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.9.2.
+ * c-valprint.c (c_val_print): For array of chars printed with
+ string syntax, don't print the address of the array. From
+ bothner@cygnus.com.
+ * c-exp.y (yylex): Recognize '.' as indicating a floating point
+ number regardless of the radix. From wilson@cygnus.com.
+ * valprint.c (set_input_radix_1, set_output_radix_1): New
+ prototypes and functions that do the actual radix setting work.
+ * valprint.c (set_radix, set_output_radix, set_input_radix):
+ Rewrite to use set_input_radix_1 and set_output_radix_1.
+ * valprint.c (initialize_valprint): Enable commands to
+ independently set and show input and output radices.
+ * valprint.c (show_radix): New prototype and function that
+ handles separate input and output radices.
+
+Fri Jun 11 18:39:38 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ Patches from Jeff Law, law@cs.utah.edu:
+ * hppa-pinsn.c: Now uses disassembler from opcode library,
+ this contains only the stub function print_insn.
+
+Fri Jun 11 15:19:59 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * main.c (main): back to two periods for elipse.
+ (print_gdb_version): revised format for configuration info.
+
+Fri Jun 11 10:24:35 1993 Fred Fish (fnf@cygnus.com)
+
+ * defs.h (INT_MAX): Cast unsigned shift result to int.
+
+Fri Jun 11 10:17:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * dbxread.c (process_one_symbol): Rather than having
+ BLOCK_ADDRESS_FUNCTION_RELATIVE a macro, make it a variable which
+ is true if we are doing stabs-in-elf, false otherwise.
+ config/sparc/tm-sun4sol2.h: Don't define it.
+
+Fri Jun 11 13:33:40 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-mips.c (mips_send_packet): Don't print garbage character
+ in debugging info.
+ (mips_request): Don't check that remote pid is 0, because
+ sometimes it isn't.
+ (mips_fetch_registers): Pass a pointer to SWAP_TARGET_AND_HOST,
+ not an integer.
+
+Fri Jun 11 10:17:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * stack.c (print_frame_info): Use catch_errors around print_frame_args.
+
+ * Makefile.in (install): Don't depend on gdb.
+
+ * Rename remote-es1800.c to remote-es.c
+ and remote-st2000.c to remote-st.c for 14-char filenames.
+ config/m68k/{es1800,st2000}: Use the new names.
+
+ * mips-tdep.c (isa_NAN): Don't return true on -0.
+
+Fri Jun 11 10:24:35 1993 Fred Fish (fnf@cygnus.com)
+
+ * defs.h (INT_MAX): Cast unsigned shift result to int.
+
+Thu Jun 10 13:26:41 1993 Fred Fish (fnf@cygnus.com)
+
+ * elfread.c (elf_symtab_read): Add bfd section address to bfd
+ symbols, now that they are section relative.
+ * solib.c (bfd_lookup_symbol): Ditto.
+
+Thu Jun 10 11:27:34 1993 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hp_function_type): Adjust SYMBOL_VALUE for
+ arguments in the stack by the size of the current function's stack
+ (found in the unwind descriptor).
+ (process_one_debug_symbol): Likewise. Keep track of the current
+ function's unwind descriptor.
+
+Thu Jun 10 10:56:56 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in (depend): Add bfd -I's for paread.c and xcoffexec.c
+ depend: Updated accordingly.
+
+Wed Jun 9 16:08:44 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in (*.tab.c): Use mv for atomic update.
+
+ * Makefile.in ({dist,real}clean): Also remove nm.h.
+ (realclean): Also remove ${TESTS}, y.output, yacc.{acts,tmp}.
+ (distclean): Don't rebuild *.tab.c or TAGS.
+
+Wed Jun 9 12:56:58 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in (version.c): add host and target names to version.c.
+ * main.c (main): print three periods for the elipse.
+ (print_gdb_version): also print configuration.
+
+ * udi/udiids.h, udi/udip2soc.c, udi/udiphcfg.h, udi/udiphunix.h,
+ udi/udiproc.h, udi/udipt29k.h, udi/udiptcfg.h, udi/udisoc.h,
+ udi/udr.c: Change AMD copyrights to FSF copyleft '93.
+
+ * remote-eb.c (get_hex_regs, eb_fetch_registers), remote-adapt.c
+ (get_hex_regs, adapt_fetch_registers): cast args to
+ supply_register to avoid gcc warning.
+
+ * config/a29k/a29k.mt (TDEPFILES): drop minimon support. It
+ doesn't compile on solaris and is now obsolete.
+
+ * config/sparc/sun4os4.mh (XM_CLIBS): remove -lresolv. This
+ breaks stock sunos installations.
+
+Wed Jun 9 06:14:33 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * m68k-stub.c: Add comment about frame cache.
+
+ * target.h (target_store_registers): Doc fix re error handling.
+
+ * findvar.c (write_register): Call SWAP_TARGET_AND_HOST regardless
+ of register_valid[regno].
+
+Tue Jun 8 14:42:10 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * symtab.h, dwarfread.c: Doc fix re dependencies.
+
+Tue Jun 8 17:54:09 1993 Rob Savoye (rob@rtl.cygnus.com)
+
+ * serial.c (serial_close): If scb is NULL, don't try to close
+ it.
+ * configure.in: Add support for rom68k and bug boot monitors.
+
+Tue Jun 8 17:39:12 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * coffread.c (init_stringtab): Fix bug where sizeof(long) != 4.
+ * gdbcore.h, core.c (read_memory_unsigned_integer): New function.
+ * findvar.c (read_register, write_register): Fix thinko where
+ sizeof(host long) != sizeof(target int).
+ * h8300-tdep.c: Use new read_memory_unsigned_integer call.
+ * sh-tdep.c (_initialize_sh_tdep): Add memory_size command.
+
+Tue Jun 8 14:42:10 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * Move config/m68k/tm-m68k.h (FRAME_FIND_SAVED_REGS) to
+ m68k-tdep.c (m68k_find_saved_regs). Don't duplicate code between
+ 68881 and non-68881 cases. Check for a pair of movel instructions.
+
+Tue Jun 8 14:52:55 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ First cut at sparc-vxworks targetting.
+ * config/sparc/tm-vxsparc.h, config/sparc/vxsparc.mt: new files.
+ * configure.in: sparc-vxworks gdb_target now vxsparc.
+
+ * remote-eb.c, remote.c: symfile.h requires bfd.h so include it.
+
+Tue Jun 8 14:42:10 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * config/m68k/xm-news.h: add "extern int errno".
+
+Tue Jun 8 13:45:07 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * remove-vx.c (vx_read_register, vx_write_register): collapse
+ ifdef I80960 else (assumes) m68k into parameterizable macros
+ VX_NUM_REGS and VX_SIZE_FPREGS.
+ * config/m68k/tm-vx68.h, config/i960/tm-vx960.h (VX_NUM_REGS,
+ VX_SIZE_FPREGS): new definitions.
+
+Tue Jun 8 11:08:29 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * symfile.{c,h} (generic_load): New function.
+ remote{,-nindy,-eb,-mips}.c: Use it.
+
+Mon Jun 7 20:07:30 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (depend): More sed gubbish to deal with
+ ../bfd/bfd.h being generated during the build.
+ * depend: Re-done with corrected makefile.
+
+Mon Jun 7 16:32:05 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (BFD_SRC_DIR): Renamed def and usages from BFD_DIR.
+ * Makefile.in (BFD_OBJ_DIR): New definition for the bfd build
+ directory to find automatically generated header files and library.
+ * Makefile.in (BFD_LIB): Use BFD_OBJ_DIR.
+ * Makefile.in (LINTFLAGS): Include BFD_OBJ_DIR.
+ * Makefile.in (saber_gdb): Include BFD_OBJ_DIR.
+ * Makefile.in (depend): Include BFD_OBJ_DIR in gcc args.
+ * Makefile.in (paread.o, xcoffexec.o): Remove, now in depend.
+ * depend, alldeps.mak: Rebuild after Makefile.in changes.
+
+Fri Jun 4 10:18:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: change lynx support to CPU-*-lynxos*
+
+ * Makefile.in (subdir_do): change test from existence of directory
+ to existence of Makefile (the directory may exist but not be configured)
+
+Thu Jun 3 01:18:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/sparc/xm-sun4sol2.h: define MEM_FNS_DECLARED
+
+Fri Jun 4 10:43:33 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (mips-idt-ecoffl*): New target; use idtl.
+ (mips-idt-ecoff*): Added trailing '*'.
+ * config/mips/idtl.mt: New file; like idt.mt, but little endian.
+
+Thu Jun 3 17:36:56 1993 Stu Grossman (grossman@cygnus.com)
+
+ * ser-go32.c: Clean up lots of compilation nits.
+
+Thu Jun 3 14:44:57 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Patches from Jeffrey Law <law@cs.utah.edu>.
+ * hppab-nat.c: Eliminate unnecessary ifdefs for
+ FETCH_INFERIOR_REGISTERS, CANNOT_FETCH_REGISTER, and
+ CANNOT_STORE_REGISTER.
+ (fetch_register): Delete code to handle CANNOT_FETCH_REGISTER.
+ * hppa-pinsn.c: Support 'I', 'J', and 'K' in output
+ templates for 1.1 FP computational instructions.
+
+Thu Jun 3 03:34:49 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in: Remove ser-tcp.[co]. (Use XDEPFILES instead.)
+ * alldeps.mak, depend: Rebuild to account for ser-tcp.
+ * config/sparc/sun4os4.mh: Add ser-tcp to XDEPFILES.
+ * gdbserver/Makefile.in (gdbserver): Use -lbsd.
+ * gdbserver/remote-inflow{-sparc}.c (create_inferior): Don't use a
+ shell when running the child, as args have been expanded by the
+ time we get here. Simplify calling convention.
+ * gdbserver/remote-server.c (main): Use new calling convention
+ for create_inferior, remove defunct code for coalescing argv.
+ Remove extra calls to mywait(), as we no longer have to wade
+ through a shell.
+
+ * target.c (target_read_memory_partial): Don't deref errnoptr
+ when checking for null pointer.
+
+Wed Jun 2 19:58:46 1993 John Gilmore (gnu@cygnus.com)
+
+ * remote-es1800.c: Fix typo.
+
+Tue Jun 1 21:22:39 1993 Fred Fish (fnf@cygnus.com)
+
+ * target.c (target_read_memory_partial): Like target_read_memory,
+ but does partial reads, such as reads that bump into the end of
+ the address space.
+ * target.h (target_read_memory_partial): Add prototype.
+ * valprint.c (PRINT_MAX_DEFAULT): New define, initial value 200.
+ * valprint.c (val_print_string): Complete rewrite to fix bug with
+ bumping into end of memory, avoiding unnecessarily long reads, and
+ fixing bug when print_max is set to 0 (unlimited print length).
+ * valprint.c (_initialize_valprint): Use PRINT_MAX_DEFAULT to
+ initialize print_max.
+
+Tue Jun 1 18:11:35 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * configure.in: Add support for rom68k and bug boot monitors.
+
+Mon May 31 10:37:04 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * printcmd.c (print_scalar_formatted): Print integers bigger than
+ LONGEST in hex no matter how big, and no matter what the format
+ and size.
+
+ * stabsread.c (read_type): Skip type attributes if present.
+
+ * stabsread.c (read_huge_number): Don't accept '0' + radix as part
+ of number, just through '0' + radix - 1.
+
+Sun May 30 15:35:21 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (SER_HARDWIRE): Temporarily comment out ser-tcp.o.
+
+ * {dbxread.c, dwarfread.c} (read_ofile_symtab): Rewrite to take
+ single parameter, the pointer to the partial symtab, rather than
+ a bunch of args that are derived from the partial symtab. Change
+ prototypes and callers to match.
+
+ * dbxread.c (read_ofile_symtab): Remove "#if 1" around code to
+ set demangling style automatically.
+ * defs.h (CPLUS_MARKER): Clarify comment that this is only for
+ GNU C++, not C++ in general.
+ * symtab.h (general_symbol_info): Simplify by eliminating one
+ structure level for the language dependent info.
+
+Sat May 29 15:59:29 1993 Fred Fish (fnf@cygnus.com)
+
+ * c-typeprint.c (c_type_print_base): Avoid dereferencing NULL
+ names for TYPE_CODE_STRUCT and TYPE_CODE_UNION types.
+ TYPE_CODE_ENUM was already testing for this.
+
+Fri May 28 17:18:05 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in: Add new file ser-tcp.c.
+ * defs.h (memcmp): Add decl for memcmp to #ifndef MEM_FNS_DECLARED.
+ * findvar.c (write_register): See if we are writing back the same
+ value that's already in the register. If so, don't bother.
+ * remote.c (putpkt, getpkt): Improve handling of communication
+ problems.
+ * ser-go32.c: Prototype it to death. Update serial_ops and add
+ dummy routines where appropriate.
+ * ser-tcp.c: New module to implement serial I/O via TCP
+ connections.
+ * ser-unix.c: Clean up getting/setting of tty state. Get rid of
+ SERIAL_RESTORE, add SERIAL_{GET|SET}_TTY_STATE interfaces.
+ * serial.c: Add start of support for connect command.
+ (serial_open): Distinguish between tcp and local devices.
+ * serial.h (struct serial_ops): Get rid of restore, add
+ get_tty_state and set_tty_state. Define protoypes and macros for
+ this mess.
+ * gdbserver/remote-utils.c: Add tcp support. (readchar): Do
+ some real buffering. Handle error conditions gracefully.
+ * gdbserver/remote-inflow-sparc.c: Update to remote-inflow.c
+ (Lynx), remove lots of cruft.
+
+Fri May 28 17:24:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * printcmd.c (print_address_symbolic): turn this into an assigment
+ instead of an initialization (many compilers don't accept
+ structure initialization).
+
+Thu May 27 16:56:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): If several program csects in one
+ source file, give them all the name of the source file, rather than
+ the 2nd and subsequent ones having NULL names.
+
+Thu May 27 06:16:56 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * printcmd.c (print_address_symbolic): Append source filename and
+ linenumber of the symbol if print symbol-filename is on.
+ (initialize_printcmd): `set print symbol-filename'.
+
+Wed May 26 13:46:16 1993 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Add config for Lynx target. Configure gdbserver
+ only for Lynx. Re-do selective configuration of sparclite.
+
+ * gdbserver/{remote-gutils.c remote-server.c Makefile.in
+ configure.in remote-inflow.c remote-utils.c}: New files to
+ support GDB remote server. Currently only works for Lynx.
+
+Wed May 26 10:28:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (define_symbol, case 't'): Only set the name if it
+ is not a pointer type.
+
+ * stabsread.c (define_symbol): Clean up logic; move the read_type
+ calls to inside the switch statement (this improves the error
+ handling).
+
+ * mipsread.c (parse_symbol, parse_partial_symbols): Deal with Fortran
+ common blocks.
+
+Tue May 25 20:44:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_formatted, case 'i'): Pass a tab to wrap_here.
+
+ * source.c (line_info): Change "pc" to "address" in messages and
+ use print_address for addresses.
+
+ * source.c (line_info): If we don't find a symtab, print more useful
+ output, including the symbolic address.
+
+ * source.c (line_info): If --fullname, display the source.
+ (identify_source_line), callers: Take pc as argument, rather than
+ assuming innermost frame (emacs doesn't use this, so no one ever
+ noticed).
+ * symtab.h: Declare frame_file_full_name.
+ * main.c: Don't.
+
+Tue May 25 15:30:43 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * breakpoint.c (catch_command_1): Fix typo in error msg.
+
+Tue May 25 16:05:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfread.c (elf_symfile_read): Update ELF structure and routine
+ names to specify 32-bit versions.
+ (elf_symtab_read): Retrieve size field directly from symbol,
+ instead of using old kludge.
+
+ * mips-pinsn.c (print_insn): Cast address to bfd_vma before
+ calling opcodes library.
+ * z8k-tdep.c (print_insn): Likewise.
+
+Tue May 25 13:06:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c: Remove all uses of error(). Make error_type and
+ read_type_number static.
+ (define_symbol): Don't try to deal with a missing symbol
+ descriptor which isn't followed by digit, '(', or '-'.
+ * stabsread.h: Don't declare read_type_number here.
+ * gdbtypes.h: Don't declare error_type here.
+ * xcoffread.c: Remove NO_TYPEDEFS code.
+
+Tue May 25 09:33:16 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mips-tdep.c: Removed #include of many header files, and #define
+ of MIPSMAGIC; no longer used.
+
+Tue May 25 09:36:13 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Many places: replace "the inferior" in messages with "the program"
+ or "the program being debugged".
+ * inflow.c (try_writing_regs): Remove; it's been #if 0'd forever
+ and I'm getting sick of maintaining it.
+
+ * config/i386/linux.mh: Don't use \ newline; the awk scripts don't
+ support it.
+
+ * config/i386/go32.mh: Define SER_HARDWIRE.
+ * Makefile.in: Define SER_HARDWIRE.
+ (DEPFILES): Use it.
+ (alldeps.mak): Add SER_HARDWIRE.
+ Remove all references to ser-hardwire.{c,o}.
+ * configure.in: Remove all ser_hardwire and gdb_serial_driver stuff.
+
+Mon May 24 23:50:05 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-nat.c (store_inferior_registers): Fill in all members of
+ inferior_fp_registers by reading them from the inferior before
+ modifying and writing them back.
+ Fixes unexplainable inferior FP exceptions after calls to the inferior
+ or setting of floating point registers.
+ * mips-tdep.c (mips_skip_prologue): Skip move of argument register
+ to register which is generated by gcc-2.4.
+
+Tue May 25 00:42:39 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * hppa-pinsn.c: Define OLD_TABLE before including opcode/hppa.h.
+
+Mon May 24 13:55:14 1993 Stu Grossman (grossman@cygnus.com)
+
+ * config/i386/{i386lynx.mh i386lynx.mt nm-i386lynx.h tm-i386lynx.h
+ xm-i386lynx.h}: New configuration for Lynx.
+
+Mon May 24 10:01:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mipsread.c (parse_symbol): Deal with scVar and scVarRegister.
+ * symtab.h: Comment that LOC_REGPARM_ADDR can be call by reference.
+
+ * c-typeprint.c (c_type_print_base): Don't print typedef'd names
+ as struct, union, or enum tags.
+
+Mon May 24 01:10:01 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symmisc.c (dump_msymbols): Avoid gdb coredump with stripped
+ executable.
+
+Sat May 22 10:03:09 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior),
+ infcmd.c (program_info, signal_command): Use symbolic signal names.
+
+ * inftarg.c (child_wait): Deal with EINTR and include message from
+ strerror if printing an error message.
+
+ * main.c (command_line_input): Use STOP_SIGNAL not SIGTSTP.
+
+ * stabsread.c: Remove most uses of lookup_fundamental_type.
+ (define_symbol): Use read_type for type of enum constant,
+ not just read_type_number. Also don't call error().
+ (define_symbol): For unrecognized constant type, one complaint (the
+ one from error_type) is enough. Don't make our own in addition.
+ (define_symbol): Don't treat an N_FUN 'R' as a prototype.
+ * gdbtypes.h: Doc fixes.
+
+Sat May 22 03:33:07 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Fix stack unwinding through _sigtramp on Irix. These patches are from
+ Paul Flinders <ptf@delcam.co.uk>.
+ * mipsread.c (fixup_sigtramp): Find _sigtramp on Irix even when the
+ executable uses sigvec.
+ * mips-tdep.c (read_next_frame_reg): Allow tm-file to override
+ sigcontext offsets.
+ * config/mips/tm-irix3.h: Add sigcontext offsets for Irix.
+
+Sat May 22 00:39:01 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Clear stop_signal if it should not
+ be passed to the inferior to make "handle <signal> nopass nostop" work.
+
+Sat May 22 00:21:41 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-irix3.h: Clean up, use tm-bigmips.h and redefine
+ the necessary bits.
+ * findvar.c (value_from_register): Fix uninitialized first_addr
+ which caused problems with assignment of doubles to register variables
+ on some targets.
+ * mipsread.c: Remove TM_FILE_OVERRIDE, include tm.h and provide the
+ missing mips definitions if necessary.
+
+ Fix handling of double register variables for mips targets and big
+ endian hosts. These patches are from Paul Flinders <ptf@delcam.co.uk>.
+ * config/mips/tm-mips.h: Increase MAX_REGISTER_{RAW,VIRTUAL}_SIZE to
+ 8 bytes for doubles.
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE): New macro for
+ conversion of type held in multiple registers to host format.
+ * config/mips/tm-mips.h (REGISTER_CONVERT_FROM_TYPE): New macro,
+ companion to REGISTER_CONVERT_TO_TYPE.
+ * config/mips/tm-mips.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE):
+ Convert to function calls.
+ * config/mips/tm-mips.h (FIX_CALL_DUMMY): New code for big endian
+ mips targets.
+ * mips-tdep.c (mips_print_register): Raw buffer now needs just
+ MAX_REGISTER_RAW_SIZE bytes.
+ * mips-tdep.c (mips_print_register): Use REGISTER_CONVERT_TO_TYPE
+ (if defined) for doubles.
+ * mips-tdep.c: (mips_extract_return_value, mips_store_return_value):
+ New functions, take care of REGISTER_CONVERT_TO/FROM_TYPE.
+ * valops.c (value_assign): Use REGISTER_CONVERT_TO_TYPE if
+ defined.
+ * findvar.c (value_from_register): Use REGISTER_CONVERT_TO_TYPE if
+ defined.
+
+Fri May 21 09:04:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Add i[34]86-*-isc*.
+
+ * stabsread.c: Make sure all complain() pass the address of the struct.
+
+ * xcoffread.c: Make sure all struct complaints are static not auto.
+
+ * Makefile.in: Add rule for xcoffexec.o like that for paread.o.
+
+ * xcoffread.c (process_xcoff_symbol, case C_LSYM): Use define_symbol.
+
+Wed May 19 12:33:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/linux.mh: Re-enable coredumps now that they should work.
+
+Wed May 19 15:44:20 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * config/m68k/tm-m68k.h (FRAME_CHAIN): add missing close paren.
+
+Wed May 19 15:33:57 1993 Stu Grossman (grossman@cygnus.com)
+
+ * config/pa/nm-hppab.h: Comment PTRACE_ARG3_TYPE.
+
+Wed May 19 12:33:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (INSTALLED_LIBS): New variable.
+
+Tue May 18 14:08:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (quit_command): In the "quit anyway?" message, tell the user
+ whether we are planning to detach or kill the program.
+
+ * config/vax/vaxbsd.mh: Add "NAT_FILE= nm-vax.h".
+ * config/vax/xm-vaxbsd.h: Use <sys/param.h> not <machine/limits.h>
+
+ * infcmd.c (read_pc): Doc fix.
+
+ * printcmd.c (print_address_symbolic): Use %u not %d for offset.
+
+ * blockframe.c (get_prev_frame_info): If pc in sigtramp, set
+ signal_handler_caller.
+ * tm-68k.h (FRAME_{CHAIN,SAVED_PC}): Deal with sigtramp.
+ * tm-hp300bsd.h: Define SIGTRAMP_{START,END} not IN_SIGTRAMP.
+ * inferior.h (IN_SIGTRAMP): Definition moved from infrun.c.
+ Use SIGTRAMP_START if defined.
+ * infcmd.c (step_1): Use SIGTRAMP_{START,END} if needed.
+ * infrun.c (wait_for_inferior): Check IN_SIGTRAMP before SKIP_PROLOGUE.
+
+ * infptrace.c: Remove unused KERNEL_U_ADDR_HPUX code.
+
+ * infcmd.c (step_1): Fix poorly worded error message.
+
+ * config/{i386/linux.mh,m68k/isi.mh} (NATDEPFILES):
+ Comment out corelow.c because core dumps are broken on these machines.
+
+ * Makefile.in (depend): Put "${srcdir}" in generated dependencies
+ if srcdir is not ".".
+ Also put in -I${BFD_DIR} or -I${READLINE_DIR} for files which need it.
+ (INCLUDE_CFLAGS): Remove BFD_DIR and READLINE_DIR.
+ * depend: Update to latest automatically built version.
+
+Tue May 18 08:10:45 1993 Fred Fish (fnf@cygnus.com)
+
+ * ChangeLog, ChangeLog-92: Split ChangeLog at 1993.
+ * Makefile.in (NONSRC): Add ChangeLog-92
+
+Tue May 18 08:03:37 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * findvar.c ({read,write}_register): Use REGISTER_RAW_SIZE
+ not typo RAW_REGISTER_SIZE.
+
+ * frame.h, inferior.h: Doc fixes.
+
+Mon May 17 15:43:03 1993 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (write_register): Add sanity check for register size.
+ (read_register): Fixup sanity check for register size to be
+ consistent with write_register().
+
+Mon May 17 07:36:20 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * sparclite/Makefile.in: Add dummy info, install and install-info
+ targets.
+
+Thu May 13 07:30:22 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-nindy.c: Removed declaration of coffstrip.
+ * nindy-share/nindy.c: #if 0 coffstrip routine; no longer used.
+
+Wed May 12 00:35:19 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.9.1 after release and cvs
+ tagging.
+
+ * Makefile.in (VERSION): GDB 4.9 release.
+
+Tue May 11 08:04:41 1993 Fred Fish (fnf@cygnus.com)
+
+ * README: Update known bugs to include the Solaris bug that
+ leaves core dumps in the current directory when restarting the
+ inferior with "run". Expand on the testsuite information.
+
+ * Makefile.in (VERSION): Bump to 4.8.96 for what should hopefully
+ be the last 4.9 prerelease test archive.
+
+Mon May 10 22:13:23 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/m68k/xm-hp300bsd.h: Include <sys/param.h> to avoid INT_MAX
+ redefined warnings.
+
+Mon May 10 20:00:43 1993 Fred Fish (fnf@cygnus.com)
+
+ * README, NEWS: Update for gdb 4.9 release.
+
+Mon May 10 19:38:34 1993 John Gilmore (gnu@cygnus.com)
+
+ * ch-exp.y (MAX, MIN): Rename to MAX_TOKEN, MIN_TOKEN.
+ * target.c (MIN): #undef before defining.
+
+Mon May 10 16:03:03 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ Patch from Jeffrey Law:
+ * gdb/config/pa/nm-hppab.h (PTRACE_ARG3_TYPE): Define as caddr_t.
+
+Mon May 10 15:28:27 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * hppa-tdep.c (hppa_push_arguments): Allocate correct amount of
+ memory.
+
+Mon May 10 13:14:46 1993 Fred Fish (fnf@cygnus.com)
+
+ * ch-exp.y (start): Apply work-around to avoid bison warning.
+
+Sun May 9 07:25:02 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (BISON): Remove double quotes around BISON
+ definition when bison is used.
+
+ * configure.in (hppa*-hp-bsd): Change to hppa*-hp-bsd*
+ * configure.in (hppa*-hp-hpux): Change to hppa*-hp-hpux*
+ * configure.in (m68*-hp-bsd): Change to m68*-hp-bsd*
+ * configure.in (m68*-hp-hpux): Change to m68*-hp-hpux*
+ * configure.in (hppa*-*-bsd): Change to hppa*-*-bsd*
+ * configure.in (hppa*-*-hpux): Change to hppa*-*-hpux*
+ * configure.in (m68*-hp-bsd): Change to m68*-hp-bsd*
+ * configure.in (m68*-hp-hpux): Change to m68*-hp-hpux*
+
+ * Makefile.in (VERSION): Bump to 4.8.6.
+
+Sat May 8 12:36:03 1993 Fred Fish (fnf@cygnus.com)
+
+ * config/pa/xm-hppah.h (MALLOC_INCOMPATIBLE): Define it, and
+ include declarations for malloc/realloc/free. Both malloc and
+ realloc return 'void *' for non-ANSI compilations.
+
+Sat May 8 01:39:30 1993 (pes@regent.e-technik.tu-muenchen.de)
+
+ * coffread.c (read_coff_symtab): Don't fclose stream as it is no
+ longer opened twice.
+
+Thu May 6 21:08:55 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * solib.c (clear_solib): Don't close bfd if it is NULL.
+
+Thu May 6 20:55:35 1993 Fred Fish (fnf@cygnus.com)
+
+ * core.c (dis_asm_read_memory): Cast second arg of
+ target_read_memory to "char *".
+ * breakpoint.c (watchpoint_check): Change arg type from PTR to
+ "char *", to match other functions called by catch_errors().
+
+Thu May 6 15:47:45 1993 Stu Grossman (grossman@cygnus.com)
+
+ * More patches from Jeffrey Law (law@cs.utah.edu).
+ * gdb/config/nm-hppab.h (PTRACE_ARG3_TYPE): Define as caddr_t.
+ * gdb/config/pa/tm-hppah.h (millicode_start, millicode_end):
+ Delete unnecessary declarations.
+
+Thu May 6 15:15:46 1993 Stu Grossman (grossman@cygnus.com)
+
+ * ser-unix.c (wait_for): Use VTIME to do timeouts instead of
+ poll() for termio{s}.
+
+Thu May 6 10:03:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * i386-tdep.c (i386_frame_num_args): Always return -1.
+
+Wed May 5 15:16:33 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Patches from Jeffrey Law <law@cs.utah.edu>.
+ * gdb/hppa-tdep.c: Declare frame_saved_pc.
+ (frameless_function_invocation): New function.
+ (frame_saved_pc, init_extra_frame_info): Use
+ frameless_function_invocation.
+ * gdb/config/pa/tm-hppa.h (SAVED_PC_AFTER_CALL): Use saved_pc_after
+ call instead of just grabbing the value currently in %r2.
+ (FRAMELESS_FUNCTION_INVOCATION): Use frameless_function_invocation.
+ * gdb/config/pa/tm-hppah.h (SAVED_PC_AFTER_CALL): Delete private
+ definition and use the common one in tm-hppa.h.
+ * gdb/hppa-tdep.c (frame_chain_valid): If "use_unwind" is true, then
+ use unwind descriptors to determine if the frame chain is valid.
+ * gdb/hppa-tdep.c (find_dummy_frame_regs): Rework so that
+ it does not assume %r4 is the frame pointer.
+ * gdb/hppa-pinsn.c (print_insn): Handle 'r' and 'R' for break, rsm,
+ and ssm instructions.
+ * gdb/hppa-tdep.c (extract_5r_store, extract_5R_store): New
+ helper functions for print_insn.
+ * gdb/hppa-tdep.c (gcc_p, hpux_cc_p): Delete unused functions.
+ * gdb/config/pa/tm-hppa.h (ABOUT_TO_RETURN): Handle a return
+ which nullifies the following instruction.
+
+Tue May 4 12:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * infptrace.c [FIVE_ARG_PTRACE]: Define ptrace to call_ptrace and
+ pass the 5th arg there, rather than using an ANSI C-specific macro.
+
+ * Makefile.in (depend): Don't include ${CC} command for *.tab.c.
+
+Tue May 4 19:33:12 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.8.5
+ * Makefile.in (INCLUDE_CFLAGS): Add BFD_DIR and READLINE_DIR
+ directories to include search path.
+ * Makefile.in (CLIBS, CDEPS, ADD_FILES, ADD_DEPS): Clean up
+ whitespace.
+ * Makefile.in (depend): For gcc -MM line, use INTERNAL_CFLAGS
+ * Makefile.in (main.o, dbxread.o, coffread.o, mipsread.o,
+ elfread.o, dwarfread.o, stabsread.o, xcoffread.o, xcoffexec.o,
+ xdr_ld.o, xdr_rdb.o, nindy.o, Onindy.o, ttybreak.o, ttyflush.o,
+ udr.o, udip2soc.o): Remove explicit rules, use the ones that
+ are automatically generated in "depend".
+ * Makefile.in (paread.o): Document why a dependency doesn't get
+ automatically generated in "depend" and leave this explicit rule
+ in for now (FIXME).
+ * depend: Update to latest automatically generated version.
+
+Tue May 4 12:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c: Doc fix.
+
+ * Makefile.in (depend): Include $(CC) command in generated output.
+
+Mon May 3 22:51:05 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (NONSRC): Remove ${srcdir}/putenv.c.
+ * Makefile.in (SFILES): Add ${srcdir}/putenv.c.
+ * depend: Update to latest automatically built version.
+
+Mon May 3 19:20:20 1993 Stu Grossman (grossman@cygnus.com)
+
+ * sparclite/Makefile.in: Create default target that does nothing
+ in order to force user to build by hand.
+
+ * sparclite/Makefile: Remove. It's not necessary anymore.
+
+ * ser-unix.c (wait_for): New routine to handle read timeouts,
+ etc. Uses poll() if HAVE_TERMIO[S] is defined, select() otherwise.
+
+Mon May 3 13:52:08 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mips-pinsn.c (print_insn): Return value.
+
+Sun May 2 11:43:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (SFILES): Remove ser-hardwire.c; it is a link made
+ at configuration time and doesn't belong in the distribution archive.
+
+ * Makefile.in (NONSRC): Add 29k-share/README.
+ * Makefile.in (HFILES): Add 29k-share/udi/udiids.h.
+
+ * defs.h (UINT_MAX, LONG_MAX, INT_MAX, INT_MIN): Replace hex
+ constants with slightly more portable definitions (still depends
+ on 2's complement arithmetic though).
+ * config/i386/nm-linux.h: Define NO_SYS_REG_H for no <sys/reg.h>.
+ * i386v-nat.c (sys/reg.h): Conditionalize include on
+ NO_SYS_REG_H. Linux doesn't have <sys/reg.h>.
+ * ser-unix.c (termio.h): Include <termio.h> like other files that
+ include termio.h, not <sys/termio.h> which may not exist (on
+ linux for example).
+
+Sat May 1 16:05:24 1993 Fred Fish (fnf@cygnus.com)
+
+ * valprint.c (print_longest): Change format parameter from a
+ 'char' to an 'int'. We can't have 'char' parameters with the
+ current coding style, where we mix prototypes with pre-ANSI
+ style declarations.
+ * value.h (print_longest): Change format parameter in prototype
+ from a 'char' to an 'int'.
+
+Sat May 1 02:47:20 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-mips.h (STAB_REG_TO_REGNUM): Match it with the gcc
+ definition.
+ * config/mips/tm-irix3.h (STAB_REG_TO_REGNUM): Add.
+ * irix4-nat.c (fill_fpregset): Fix bug with indexing into fpregsetp.
+
+Fri Apr 30 17:45:32 1993 Stu Grossman (grossman@cygnus.com)
+
+ * The following patches are from Jeffrey Law <law@cs.utah.edu>.
+ * config/pa/hppabsd.mh: Add more files to NATDEPFILES.
+ * config/pa/xm-hppa[bh].h: Define FIVE_ARG_PTRACE.
+ * hppab-nat.c: Delete WANT_NATIVE_TARGET ifdefs.
+ ptrace needs 5 arguments, #define ptrace to always
+ pass zero as the 5th argument.
+
+Fri Apr 30 15:54:13 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * configure.in: Match z8k-*-sim for z8000.
+ * config/h8500/tm-h8500.h, h8500-tdep.c: Lint.
+ * remote-hms.c: Update to use new serial protocol.
+
+Fri Apr 30 16:50:38 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * mips-tdep.c: remove include of sys/dir.h. Doesn't seem
+ necessary and Solaris doesn't have it.
+
+ * Makefile.in (clean-info, install, install-info, info, dvi,
+ check, all): do not echo recursion lines.
+
+ * 29k-share/udip2soc.c (UDIConnect): replace union wait with int.
+
+ * config/sparc/sun4sol2.mh (XM_CLIBS): add -lsocket which is
+ required target ports which use sockets (like a29k-udi).
+
+ * remote-udi.c (udi_wait): Use SIGURG, as Solaris doesn't have SIGLOST.
+
+Fri Apr 30 11:05:42 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * ser-unix.c [USE_{TERMIO,ALARM}_TIMEOUT]: New code to deal with
+ systems lacking select().
+
+ * Makefile.in (TAGS): Doc fix. Deal with empty DEPFILES.
+
+Fri Apr 30 10:06:46 1993 Fred Fish (fnf@cygnus.com)
+
+ * alldeps.mak, depend: Update with latest automatically built
+ versions.
+
+Thu Apr 29 12:03:23 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (SFILES): Add ser-unix.c and ser-go32.c.
+
+ * Makefile.in (make-proto-testsuite.dir): New target to make
+ prototype testsuite tree.
+
+ * Makefile.in (VERSION): Bump to 4.8.4.
+
+Thu Apr 29 08:46:22 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * stabsread.c (define_symbol): If unrecognized constant type,
+ complain() not error().
+
+Thu Apr 29 00:03:59 1993 Fred Fish (fnf@cygnus.com)
+
+ * infptrace.c: Add missing close paren to test for
+ FIVE_ARG_PTRACE defined.
+
+ * defs.h (CC_HAS_LONG_LONG): Set up to define CC_HAS_LONG_LONG
+ when compiling with gcc, but disable it for now. See comment.
+ * defs.h (LONGEST): Define as either "long" or "long long"
+ based on CC_HAS_LONG_LONG.
+ * defs.h (longest_to_int): Use CC_HAS_LONG_LONG to control
+ how longest_to_int is defined.
+ * c-valprint.c (c_val_print): Call print_longest.
+ * expprint.c (dump_expression): Use PRINTF_HAS_LONG_LONG
+ instead of LONG_LONG.
+ * {printcmd.c, gdbtypes.h} (LONG_LONG): Replace usages with
+ CC_HAS_LONG_LONG.
+ * printcmd.c (print_scalar_formatted): Call print_longest
+ and let it figure out what to do for PRINTF_HAS_LONG_LONG.
+ * typeprint.c (print_type_scalar): Call print_longest and let
+ it figure out what to do for PRINTF_HAS_LONG_LONG.
+ * valprint.c (val_print_type_code_int): Call print_longest
+ and let it figure out what to do for PRINTF_HAS_LONG_LONG.
+ * stabsread.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG.
+ * value.h (struct value): Replace usage of LONG_LONG with
+ CC_HAS_LONG_LONG.
+ * value.h (print_longest): Add prototype.
+ * values.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG.
+ * values.c (unpack_double): Collapse code that was unnecessarily
+ dependent on CC_HAS_LONG_LONG. Use LONGEST instead of direct types.
+ * values.c (value_from_longest): Remove dependency on
+ CC_HAS_LONG_LONG and just use LONGEST.
+ * solib.c (solib_map_sections): Use bfd_get_filename
+ to access filename field.
+ * solib.c (clear_solib): Save filename and free it later, after
+ bfd_close, since bfd_close may reference it. Use bfd_get_filename
+ to access the field.
+ * config/convex/xm-convex.h (LONG_LONG): Replace with
+ CC_HAS_LONG_LONG. Add define for PRINTF_HAS_LONG_LONG.
+ * doc/gdbint.texinfo (LONG_LONG): Replace with CC_HAS_LONG_LONG.
+ Add PRINTF_HAS_LONG_LONG references.
+
+Wed Apr 28 06:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * inflow.c (kill_command), infcmd.c (attach_command),
+ remote.c (remote_interrupt_twice): In messages for the user, call it
+ "the program" or "the program being debugged" not "the inferior".
+
+ * hp300ux-nat.c: Cast second arg to supply_register calls.
+ (_initialize_kernel_u_addr, getpagesize): New functions.
+ (store_inferior_register_1): Change arg name from value to val.
+ (fetch_core_registers): Make arg core_reg_size unsigned.
+ Pass 5 args to ptrace.
+ * config/m68k/xm-hp300hpux.h: Define FIVE_ARG_PTRACE.
+ Remove KERNEL_U_ADDR stuff.
+ * infptrace.c [FIVE_ARG_PTRACE]: Pass 5th arg to ptrace.
+ * config/m68k/hp300hpux.m{t,h}:
+ Move exec.o from NATDEPFILES to TDEPFILES
+ * config/m68k/hp300hpux.mt: Mention GAS requirement. Remove
+ hp-include stuff. Add m68k-tdep.o to TDEPFILES.
+
+Wed Apr 28 13:27:54 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * ch-exp.y (yylex): Don't STREQ with simplename if it is NULL.
+
+Wed Apr 28 06:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/sparc/xm-sun4os4.h [__STDC__]: Don't use MALLOC_INCOMPATIBLE.
+
+Wed Apr 28 11:39:18 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
+
+ * doc/gdb.texinfo: make node "Shell Commands" unconditional;
+ describe `set demangle-style arm' (not cfront);
+ mention can type `q' to discard output, when gdb pages
+
+Wed Apr 28 11:32:39 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valops.c (search_struct_field): Fix gdb core dump with incomplete
+ stabs info.
+
+Wed Apr 28 06:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * remote.c: Change timeout to 2.
+ (remote_open): Use unpush_target not remote_close.
+ (remote_resume): If siggnal != 0, give warning not error().
+ (remote_wait, remote_interrupt, remote_interrupt_twice):
+ If we get two interrupts, let the user get out if they want.
+ (remote_{kill,mourn}): New functions.
+ i386-stub.c (handle_exception, case 'k'): Don't BREAKPOINT.
+
+Wed Apr 28 09:20:55 1993 Ian Lance Taylor (ian@rtl.cygnus.com)
+
+ * config/sparc/sun4sol2.mh (XM_CLIBS): Define to be -lnsl.
+
+Wed Apr 28 06:11:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Remote targets (mourn): Call unpush_target.
+
+ * config/sparc/xm-sun4os4.h: Declare free() to return int.
+ Remove twisted use of PARAMS.
+
+ * config/rs6000/xm-rs6000.h: Don't define MALLOC_INCOMPATIBLE now
+ that ansidecl.h assumes ANSI on AIX.
+
+Tue Apr 27 10:01:33 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * README: Move most stuff about hacking GDB to doc/gdbint.texinfo.
+ (Known bugs): Remove AIX bugs, revise SPARC struct bug description.
+
+Tue Apr 27 13:44:19 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * expprint.c (print_subexp): Fix bug with OP_SCOPE operator output.
+
+Tue Apr 27 10:01:33 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * remote-vx.c (net_connect): Allow numeric IP address for host.
+
+Mon Apr 26 17:59:38 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * config/sh/sh.mt, config/sh/tm-sh.h, sh-tdep.c: New files.
+
+Mon Apr 26 07:13:32 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * rs6000-tdep.c (branch_dest): Deal with stepping through system call.
+
+ * symtab.h, xcoffread.c: Revise linetable sorting comments.
+
+Sun Apr 25 02:32:16 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valops.c (value_cast): A cast might also change the object
+ representation in C++.
+ * dbxread.c (end_psymtab): Copy subpst read_symtab function from pst
+ to get the proper read_symtab function when called from mipsread.c.
+ * mipsread.c (mipscoff_psymtab_to_symtab, psymtab_to_symtab_1):
+ Set cur_bfd in psymtab_to_symtab_1 as CURBFD(pst) is invalid
+ for dummy psymtabs, inhibit processing of dummy psymtabs.
+
+Sat Apr 24 19:59:54 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Changes from (or inspired by) AMD:
+ * remote-udi.c (udi_attach): Assignments to Space and Offset were
+ switched, fix it.
+ (udi_wait): Make error message (UDIGetStdout) match error.
+ (udi_wait): Handle UDIStdinNeeded.
+ * command.c [CANT_FORK]: Use system().
+ * utils.c (prompt_for_continue): Allow quit with 'q'.
+
+ * solib.c (solib_add): Don't call special_symbol_handling if there
+ were errors in symbol_add_stub. Also set so->from_tty before
+ calling symbol_add_stub.
+
+Fri Apr 23 16:17:00 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Merge in HPPA/BSD patches from Utah:
+ * defs.h: Add const to 2nd arg of psignal prototype.
+ * hppah-tdep.c: Renamed to hppa-tdep.c 'cuz it's common code with
+ BSD now.
+ * hppab-core.c: Deleted. No longer useful.
+ * hppab-nat.c: #include more files. Use PT_WUREGS, not
+ PT_WRITE_U.
+ * hppab-tdep.c: Deleted. Supplanted by hppa-tdep.c.
+ * config/pa/hppabsd.mh (NATDEPFILES): Remove hppab-core.o.
+ * config/pa/hppabsd.mt (TDEPFILES): hppab-tdep.o => hppa-tdep.o
+ * config/pa/hppahpux.mt (TDEPFILES): hppab-tdep.o => hppa-tdep.o
+ * config/pa/xm-hppab.h: #define SET_STACK_LIMIT_HUGE.
+
+Fri Apr 23 10:34:02 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Fix two bugs found by deja-gnu. One is the incorrect reporting
+ of the PC being in a stack dummy when looking at a core file
+ without symbols. The other is the incorrect passing of char
+ arguments during expression evaluation (ie: p foo('a','b') would
+ mess up the passing of it's args because it wasn't coercing the
+ char's to ints).
+ * hppah-tdep.c: Rename global functions to have consistent hppa_
+ prefix. Make more functions static. Drop hp_ prefix from static
+ functions. (hppa_push_arguments): Call value_arg_coerce to cast
+ char to int args if necessary. (hppa_fix_call_dummy): Create
+ this routine from FIX_CALL_DUMMY macro in tm-hppa.h.
+ * inferior.h (PC_IN_CALL_DUMMY): Check for frame_address being
+ valid (ie: != 0) before doing comparison against PC.
+ * valops.c (call_function_by_hand): Adjust call to FIX_CALL_DUMMY
+ to reflect new arguments.
+ * config/pa/tm-hppa.h (POP_FRAME, PUSH_ARGUMENTS): Use new hppa_
+ prefix for func name. (FIX_CALL_DUMMY): Move code into
+ hppah-tdep.c.
+
+ * testsuite/gdb.t16/gdbme.c, testsuite/gdb.t17/gdbme.c: Add calls
+ to malloc() so that we can test GDB eval of dynamically created
+ arrays (like char strings in `print "foo"').
+
+Fri Apr 23 01:28:14 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * printcmd.c (print_address_symbolic): Search symtabs as well as the
+ minimal symbols for a nearby symbol.
+
+Thu Apr 22 19:44:21 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * coffread.c: Comment changes around minimal symbol recording.
+
+Thu Apr 22 16:24:36 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * command.c: comment changes only.
+
+ * mips-tdep.c (heuristic_fence_post): new static variable.
+ (heuristic_proc_start): use heuristic_fence_post, print better
+ warnings, but only if not stop_soon_quietly.
+ (_initialize_mips_tdep): add_set_cmd for heuristic-fence-post.
+
+Thu Apr 22 14:50:05 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * symtab.h: Fix LOC_REF_ARG comment.
+
+Wed Apr 22 20:21:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ * stabsread.c (define_symbol): Combine a 'p', 'r' arg pair to a
+ LOC_REGPARM symbol.
+ * config/sparc/tm-sparc.h (REG_STRUCT_HAS_ADDR): Revise comments.
+ symfile.c (compare_symbols): Don't check first character; STRCMP
+ does that.
+
+ * stabsread.c (define_symbol): Generate a LOC_REGPARM_ADDR for
+ structures that are passed by address in a register.
+ * symtab.h (enum address_class): Add LOC_REGPARM_ADDR.
+ * findvar.c (read_var_value),
+ printcmd.c (address_info, print_frame_args),
+ stack.c (print_frame_arg_vars), symmisc.c (print_{,partial_}symbol),
+ * symtab.c (lookup_block_symbol): Deal with it.
+
+Thu Apr 22 09:07:24 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * objfiles.h (obj_section), objfiles.c (build_objfile_section_table):
+ Add objfile field.
+ * objfiles.c (find_pc_section): Return a struct obj_section *.
+ * sparc-tdep.c (in_solib_trampoline): Deal with find_pc_section return.
+ * symfile.c (syms_from_objfile) [IBM6000_TARGET]:
+ Don't use obj_section hack.
+ * xcoffexec (vmap_symtab): Relocate obj_sections.
+ * printcmd.c (containing_function_bounds): Use find_pc_section.
+
+ * symtab.h: Clean up SYMBOL_VALUE comments.
+
+Wed Apr 21 14:29:57 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * stack.c (print_frame_arg_vars), printcmd.c (print_frame_args):
+ Expand comments about LOC_ARG/LOC_LOCAL pairs.
+
+ * coffread.c (read_coff_symtab): Use rewind before fseek.
+
+Wed Apr 21 14:24:19 1993 Per Bothner (bothner@cygnus.com)
+
+ * ch-exp.y: Removed unused structure_primitive_value and FIXME_23.
+ * Makefile.in: Add $(YFLAGS) when using $(YACC).
+ * Makefile.in: Remove message to expect conflicts and unused
+ rules in ch-exp.y, since there no longer are any such.
+
+Wed Apr 21 13:27:50 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * stabs.texinfo: fixed bad xrefs (un-initialized statics)
+
+Tue Apr 20 08:55:11 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffexec.c (xcoff_relocate_core): If no exec file, error()
+ rather than dumping core.
+
+ * Makefile.in: Add ${srcdir}/ to all source files.
+ (alldeps.mak): Add "${srcdir}/" to files when generating alldeps.mak.
+ (TAGS): Deal with srcdir and new config directory scheme.
+ createtags: Remove.
+ Makefile.in (NONSRC): Remove createtags.
+ alldeps.mak: Updated.
+
+ * rs6000-tdep.c: Delete unused function print_frame.
+
+ * frame.h (struct frame_info): Doc fix for next_frame.
+ New field signal_handler_caller.
+ blockframe.c (create_new_frame, get_prev_frame_info),
+ config/rs6000/tm-rs6000.h (INIT_EXTRA_FRAME_INFO): Set it (needs
+ INIT_FRAME_PC_FIRST).
+ stack.c (print_frame_info), rs6000-tdep.c (rs6000_frame_chain):
+ Check it.
+
+Mon Apr 19 22:52:33 1993 Stu Grossman (grossman@cygnus.com)
+
+ * irix4-nat.c (fetch_core_registers): Special version of this for
+ Irix 4.x, which stores regs a bit differently from other /proc
+ based systems.
+ * procfs.c, core-svr4.c: Move fetch_core_registers from procfs.c
+ to new file core-svr4.c.
+ * config/i386/i386sol2.mh, config/i386/i386v4.mh, config/m68k/amix.mh,
+ config/i386/ncr3000.mh, config/sparc/sun4sol2.mh: Add core-svr4.o
+ to NATDEPFILES.
+ * config/mips/irix4.mh: Add corelow.o to NATDEPFILES.
+
+Mon Apr 19 11:13:34 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * i387-tdep.c: Remove unused #includes.
+
+ * configure.in: Match i[34]86-*-sysv3.2 not i[34]86-*-sysv32.
+
+ * config/i386/nm-i386v.h: Define NO_PTRACE_H.
+
+Sun Apr 18 10:39:35 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c: Nuke NO_DEFINE_SYMBOL code. There is no going back.
+
+ * stabsread.c (define_symbol): 'R' is synonym for 'P', not 'r'.
+ xcoffread.c (process_xcoff_symbol, case C_RPSYM):
+ Don't muck with SYMBOL_CLASS.
+
+Fri Apr 16 17:38:33 1993 Stu Grossman (grossman@cygnus.com)
+
+ * munch: Don't use head command. It doesn't exist everywhere.
+
+Fri Apr 16 15:07:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * inflow.c (new_tty): Remove spurious 'o' character at end
+ of #endif line.
+
+Fri Apr 16 12:27:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (mips_skip_prologue): Always skip the typical prologue
+ instructions and nothing more.
+ * mipsread.c (add_line): Add comment why we have to combine line number
+ entries for the same line number.
+
+Fri Apr 16 09:42:03 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * symtab.{c,h}: Doc fixes (remove symseg references, last relevant
+ in gdb 2.8!).
+
+Thu Apr 15 21:16:58 1993 Fred Fish (fnf@cygnus.com)
+
+ * depend, alldeps.mak: Update, now that gcc -MM bug is fixed.
+
+Thu Apr 15 12:38:39 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * source.c (select_source_symtab): Clean up comment. Also, if
+ we have a current_source_symtab, and s is NULL, return without
+ doing anything.
+ xcoffread.c (xcoff_symfile_read): Don't call select_source_symtab.
+ breakpoint.c (breakpoint_re_set): Don't call select_source_symtab.
+
+Thu Apr 15 02:37:48 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * dbxread.c (unknown_symchar_complaint): Add new complaint.
+ * stabsread.h: Declare it.
+ * partial-stab.h: Use it.
+
+ * utils.c (malloc_botch): Don't forward-declare if NO_MMALLOC.
+
+Wed Apr 14 17:12:51 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * stack.c (print_frame_info): Print specially if dummy frame.
+
+ * breakpoint.c: Add comments regarding within_scope future direction.
+
+ * Version 4.8.3.
+
+ * xcoffread.c (record_include_{begin,end}): Change fatal to complain.
+
+Wed Apr 14 14:03:18 1993 Per Bothner (bothner@cygnus.com)
+
+ * ch-exp.y: Fix thinko that broke parsing of FALSE.
+
+Wed Apr 14 12:49:29 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * stabsread.c (read_member_functions): Initialize domain for stubbed
+ member functions to avoid gdb core dumps when printing pointers
+ to member functions.
+ * cp-valprint.c (cp_print_class_method): Check for stubbed member
+ functions.
+
+Tue Apr 13 08:28:26 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * expprint.c (print_subexp): If opcode not found in op_print_tab,
+ stop with an error().
+ eval.c (evaluate_subexp): Change error message.
+
+ * objfiles.c (build_objfile_section_table): Cast return value
+ from obstack_finish.
+
+Mon Apr 12 10:53:50 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/rs6000/tm-rs6000.h, rs6000-tdep.c: Move FRAME_CHAIN
+ to rs6000_frame_chain and deal with it if we're in a signal handler.
+ (FRAME_SAVED_PC): Use rs6000_frame_chain.
+
+ * breakpoint.c (within_scope): New function.
+ (enable_breakpoint, watchpoint_check): Use it.
+
+ * source.c (openp): Handle "exec-file ./ls" correctly.
+
+ * breakpoint.c (breakpoint_1): Use wrap_here before "at".
+
+Sat Apr 10 01:32:43 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * ch-exp.y: Clean up lexing of identifiers and
+ reserved words. (E.g. don't recognize FALSEXXX as the
+ keyword FALSE followed by the identifier XXX.)
+ Also, convert identifiers to lower case.
+
+Fri Apr 9 15:53:19 1993 Stu Grossman (grossman@cygnus.com)
+
+ * remote-mips.c, remote-monitor.c, remote-st2000.c: Convert to
+ new serial interface.
+
+Fri Apr 9 15:01:12 1993 Stu Grossman (grossman@cygnus.com)
+
+ * remote.c (remote_open): Use SERIAL_OPEN instead of serial_open.
+ (putpkt, getpkt): Use new return codes for SERIAL_READCHAR.
+ * ser-go32.c: Return -1 on most failures, 0 on most successes,
+ and use new return codes for go32_readchar().
+ * ser-unix.c: Ditto. Also, move error handling up to caller for
+ SERIAL_SETBAUDRATE().
+ * serial.c (serial_open): Internal call, not SERIAL_OPEN to get
+ to specific routine.
+ (serial_close): New routine to wrap around device close routine.
+ serial.h: Clean & document return values more clearly.
+
+Fri Apr 9 10:20:55 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * rs6000-pinsn.c (print_operand): Deal with no operand instructions.
+
+ * rs6000-pinsn.c (print_operand, case LI): Print condition register
+ operand in decimal rather than wrong textual versions.
+
+ * printcmd.c (_initialize_printcmd): Clean up docstring for "x"
+ (mention 't', remove false thing about 'g' only good with 'f').
+
+ * breakpoint.h: move "struct breakpoint" and friends to top of
+ file so that bpstat_find_breakpoint prototype works.
+
+ * solib.c (struct so_list): Add bfd field.
+ (solib_map_sections): Leave bfd open and scratch_pathname allocated.
+ Put the bfd in bfd field of the so_list.
+ (clear_solib): Free bfd name and close_bfd on the bfd.
+
+Fri Apr 9 00:45:41 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * valarith.c (value_subscript): Add COERCE_REF.
+ * ch-exp.y (operand_5): We can generalize the 2nd operand
+ of a string repetition ot 'literal' without ambiguity.
+
+Thu Apr 8 10:15:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.h (struct bpstat): Remove momentary field.
+ Remove bpstat_momentary_breakpoint. This was always kludgy
+ and is no longer used.
+
+ * breakpoint.h: Add enum bpstat_what.
+ breakpoint.h (struct bpstat), breakpoint.c (bpstat_stop_status):
+ stop and print fields of bpstat now per-breakpoint, not just
+ one for the whole chain.
+ breakpoint.{c,h} (bpstat_what): New function.
+ breakpoint.h: Remove bpstat_stop and bpstat_should_print.
+ infrun.c: Replace switch (stop_bpstat->breakpoint_at->type)
+ with call to bpstat_what.
+ README: Remove watchpoint/breakpoint bug from known bugs.
+
+ * breakpoint.h: Prototype bpstat_find_breakpoint.
+
+Thu Apr 8 16:01:21 1993 Fred Fish (fnf@cygnus.com)
+
+ * symtab.c (find_methods, gdb_mangle_name): Note that functions
+ are g++ specific.
+ * symtab.h (VTBL_FNADDR_OFFSET, OPNAME_PREFIX_P, VTBL_PREFIX_P,
+ DESTRUCTOR_PREFIX_P): Note that macros are g++ specific.
+
+Thu Apr 8 12:45:32 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * i960-pinsn.c (tabent): Copied struct definition from
+ opcodes/i960-dis.c.
+
+Thu Apr 8 10:34:37 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.h (DESTRUCTOR_PREFIX_P): New macro to check if physname
+ is a C++ destructor.
+ * symtab.c (gdb_mangle_name): Use it.
+ * symtab.c (find_methods): Do not add destructors to choice list
+ for constructors.
+ * symtab.c (decode_line_1): Make breakpoints on destructors work
+ for gcc-2.x again.
+
+Wed Apr 7 18:43:09 1993 Stu Grossman (grossman@cygnus.com)
+
+ * ser-go32.c: Make it use serial port name.
+ * go32-xdep.c: Put in def for strlwr, needed by dir.o in go32 libc.
+
+ * infcmd.c (read_pc): Make sure that we read PC_REGNUM when not
+ in a system call!
+
+Wed Apr 7 15:52:11 1993 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Only configure sparclite subdir when target_cpu
+ is sparclite.
+
+Wed Apr 7 10:11:22 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (struct coff_symbol): Change c_sclass to unsigned char.
+ Remove FIXME comment regarding this.
+
+ * symfile.h: Change NULL->'\0' in comment (that wasn't a typo).
+
+ * xcoffread.c (read_xcoff_symtab): Use E_SYMNMLEN.
+
+Tue Apr 6 22:30:58 1993 K. Richard Pixley (rich@cygnus.com)
+
+ Add section table to objfile struct. Use it for find_pc_section.
+ * objfiles.c (add_to_objfile_sections,
+ build_objfile_section_table, find_pc_section): new functions.
+ (allocate_objfile): build section table.
+ * objfiles.h (struct obj_section): new structure.
+ (struct objfile): add section table.
+ (find_pc_section): new prototype.
+ * solib.[ch] (find_pc_section_from_so_list): removed.
+ * sparc-tdep.c: include objfiles.h for find_pc_section. include
+ symfile.h for objfiles.h.
+ (in_solib_trampoline): adjusted for new find_pc_section
+ prototype. Removed BAD_RICH_HACK ifdefs.
+ * symfile.c (syms_from_objfile): offset objfile sections.
+ (find_pc_section): removed. Also removed BAD_RICH_HACK ifdefs.
+ * symfile.h (find_pc_section): prototype removed. Also fixed
+ comment typo NUL -> NULL.
+ * target.[ch] (find_pc_section_from_targets): removed.
+ * config/sparc/tm-sun4sol2.h (BAD_RICHH_HACK): removed.
+
+Tue Apr 6 21:41:13 1993 Stu Grossman (grossman@cygnus.com)
+
+ * ser-go32.c: Format. (go32_open): Use proper return value.
+
+ * configure.in: Undo conditional configdirs hack for sparclite.
+
+Tue Apr 6 17:07:37 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * symtab.c (list_symbols): When call break_command, pass both
+ filename and function name not just function name.
+
+Tue Apr 6 15:00:09 1993 Fred Fish (fnf@cygnus.com)
+
+ (Changes and new files to make "none" a full fledged configuration)
+ * config/none/{nm-none.h, tm-none.h, xm-none.h}: New files.
+ Currently only tm-none.h has any meaningful contents.
+ * config/none/none.mh (NAT_FILE): Use nm-none.h
+ * config/none/none.mh (XM_FILE): Use xm-none.h
+ * config/none/none.mt (TM_FILE): Use tm-none.h
+ * Makefile.in (depend): Remove comment about parse errors in
+ valops.c, it now parses correctly and generates a correct depend
+ line. Remove line that touches xm.h, tm.h, and nm.h; they are
+ now linked to config/none/{xm-none.h, tm-none.h, nm-none.h}.
+
+Tue Apr 6 09:54:29 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * values.c (USE_STRUCT_RETURN): Only use gcc wierdness for gcc1.
+
+ * xcoffread.c (read_xcoff_symtab): Deal correctly with symbols of
+ exactly 8 characters.
+
+Tue Apr 6 10:31:26 1993 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Sparclite uses sparc config dir. Also has it's
+ own tm- & .mt files now. Also add sparclite to configdirs.
+ * go32-xdep.c: Dummy routines for sigsetmask & strlwr.
+ * config/i386/go32.mh: Nullify def of TERMCAP.
+ * config/i386/xm-go32.h: Get rid of redef of EIO.
+ * config/sparc/{sparclite.mh tm-sparclite.h}: New sparclite
+ specific configs. Very similar to sun4os4, but without solib.
+ * sparclite/{Makefile.in configure.in}: First cut at making this
+ dir configgable.
+
+Tue Apr 6 03:10:44 1993 Stu Grossman (grossman@cygnus.com)
+
+ * ser-go32.c: First cut at adapting to new serial interface.
+
+Mon Apr 5 22:29:43 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (SFILES OBS): Add serial.[co] & ser-hardwire.[co].
+ These implement a new serial line interface for talking to remote
+ targets.
+ * configure.in: Link ser-hardwire.c to ser-unix.c for all hosts,
+ EXCEPT go32, which gets ser-go32.c.
+ * remote.c: Use new serial interface. More remote-xxx's to be
+ converted later.
+ * ser-bsd.c, ser-termios.c: Removed.
+ * serial.c: New. Implements common operations for all serial
+ types.
+ * ser-unix.c: New. Unix specific serial operations for various
+ flavors of Unix (Posix, SysV, BSD).
+ * serial.h: Generic serial interface defs.
+ * config/i386/go32.mh, config/i386/i386bsd.h,
+ config/m68k/apollo68b.mh, config/sparc/sun4os4.mh: Remove
+ ser-bsd.o from XDEPFILES. All the magic is now handled in
+ configure.in.
+
+Mon Apr 5 20:48:54 1993 Stu Grossman (grossman@cygnus.com)
+
+ * config/h8500/tm-h8500.h: Clean up brain damage found by GCC.
+
+Fri Apr 2 08:23:14 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (xcoff_symfile_offsets): Use 0 not addr for offsets.
+
+ * rs6000-tdep.c (frameless_function_invocation): Don't even think
+ about framelessness except on the innermost frame.
+
+ * xcoffexec.c: Call fatal() not abort().
+
+ * stabsread.c (patch_block_stabs): If stab & no symbol, make
+ a LOC_OPTIMIZED_OUT symbol.
+ symtab.h (enum address_class): Add LOC_OPTIMIZED_OUT.
+ findvar.c (read_var_value), printcmd.c (address_info),
+ symmisc.c (print_{,partial_}symbol), c-exp.y (variable),
+ m2-exp.y (yylex): Deal with it.
+ ch-exp.y (yylex): Deal with it.
+
+Thu Apr 1 18:43:02 1993 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (value_from_register): H8500 specific, check to see
+ if we are looking at short pointer. If so, skip crock.
+ * h8500-tdep.c (h8500_frame_chain): Mask down value from
+ read_memory_integer() to avoid getting messed up by sign extension.
+
+Thu Apr 1 16:44:41 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * sparc-tdep.c (in_solib_trampoline), symfile.c (find_pc_section):
+ ifdef protect using BAD_RICH_HACK. This should be removed soon.
+ * config/sparc/tm-sun4sol2.h (BAD_RICH_HACK): define.
+
+Thu Apr 1 09:01:38 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * i960-pinsn.c, a29k-pinsn.c: Much abridged, just use libopcodes.a.
+
+ * core.c (dis_asm_print_address): New function.
+
+ * core.c (dis_asm_read_memory): Reinstate 4th arg. The prototype
+ has been fixed.
+
+Thu Apr 1 09:34:43 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (bpstat_print, bpstat_stop_status): Change to walk the
+ entire breakpoint chain and print only the first entry that needs to
+ be printed and needs to be stopped for. Fixes problems with printing
+ of multiple breakpoints with different conditions.
+ * breakpoint.c (print_it_done): Renamed from print_it_noop as it
+ effectively stops printing of the breakpoint chain.
+ * breakpoint.c (print_it_noop): New routine to print nothing
+ for this breakpoint entry and dont stop printing.
+ * breakpoint.c (breakpoint_re_set_one): mention the reevaluated
+ watchpoint only if it is enabled.
+ * mipsread.c (parse_procedure): Correct incorrect setjmp procedure
+ descriptor from the library to make backtraces through setjmp work.
+ * mipsread.c (fixup_sigtramp): Correct pcreg and fregoffset for
+ sigtramp.
+ * mips-tdep.c (read_next_frame_reg): Provide correct values for
+ all registers saved within sigtramp, cleanup.
+
+Wed Mar 31 12:52:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * sparc-pinsn.c: Much abridged, just calls version in libopcodes.a.
+
+Wed Mar 31 21:23:41 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * core.c (dis_asm_read_memory): drop fourth arg which conflicts
+ with prototype in ../include/dis-asm.h.
+
+Wed Mar 31 12:52:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * core.c (dis_asm_{read_memory,memory_error}): New functions.
+ m68k-pinsn.c, h8500-tdep.c, i386-pinsn.c, mips-pinsn.c, z8k-tdep.c:
+ Use read_memory_func interface to disassembler.
+
+Tue Mar 30 15:46:14 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ Teach sparc solaris to next over shared library functions.
+ * solib.[hc] (find_pc_section_from_so_list): new function and
+ prototype.
+ * sparc-tdep.c (in_solib_trampoline): new function.
+ * symfile.[hc] (find_pc_section): new function and prototypes.
+ * target.[hc] (find_pc_section_from_targets): new function and
+ prototypes.
+ * config/sparc/tm-sun4sol2.h (IN_SOLIB_TRAMPOLINE): redefine to
+ in_solib_trampoline.
+
+Tue Mar 30 08:06:24 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Revise comment.
+
+ * command.c (do_setshow_command): Use %u with var_{u,z}integer.
+
+ * command.{c,h}: New var_type var_integer.
+ main.c: Use it for history_size.
+
+ * rs6000-tdep.c, xcoffexec.c, config/rs6000/xm-rs6000.h, breakpoint.c:
+ Lint and byte-order fixups.
+
+ * breakpoint.c (print_it_normal): Return 0 after hitting watchpoint.
+
+ * breakpoint.h (bpstat): New field print_it.
+ breakpoint.c (bpstat_print): Use it.
+ (print_it_normal): New function (from old bpstat_print code).
+ (bpstat_{alloc,stop_status}): Set print_it field.
+
+ * breakpoint.c (bpstat_stop_status): Use catch_errors when
+ evaluating watchpoint condition, via new function watchpoint_check.
+ Also stop if watchpoint disabled due to leaving its block.
+
+ * findvar.c [REG_STRUCT_HAS_ADDR]: Add comment.
+
+Tue Mar 30 00:14:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-pinsn.c: Add missing include of dis-asm.h.
+
+Mon Mar 29 15:03:25 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (clean, distclean, realclean): Recursively apply
+ to subdirs first, rather than last. This avoids, for example,
+ Makefile being removed in a parent directory before the recursive
+ make is run.
+
+ * alldeps.mak, depend: Update for below changes.
+
+ * config/m68k/tm-m68k.h: Renamed from config/m68k/tm-68k.h.
+ * m68k/{tm-3b1.h, tm-altos.h, tm-amix.h, tm-es1800.h,
+ tm-hp300bsd.h, tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-os68k.h,
+ tm-st2000.h, tm-sun2.h, tm-sun3.h, tm-vx68.h}: Include tm-m68k.h
+ instead of tm-68k.h.
+ * Makefile.in (HFILES): tm-68k.h renamed to tm-m68k.h.
+ * README, a29k-pinsn.c, m68k-pinsn.c, m68k-stub.c, remote-vx.c,
+ m68k/{altos.mh, altos.mt, apollo68b.mh, nm-apollo68b.h,
+ nm-hp300bsd.h, config/m68k/xm-apollo68b.h}: Map '68k' to 'm68k'.
+ * a29k/tm-a29k.h, doc/gdbint.texinfo: Account for renaming of
+ tm-68k.h to tm-m68k.h.
+ * m68k/m68k-fp.mt (TM_FILE): tm-68k-fp.h renamed to tm-m68k-fp.h.
+ * m68k/m68k-nofp.mt (TM_FILE): tm-68k-nofp.h renamed to
+ tm-m68k-nofp.h.
+
+ * config/a29k/tm-a29k.h: Renamed from config/a29k/tm-29k.h.
+ * a29k-pinsn.c: Renamed from am29k-pinsn.c.
+ * a29k-tdep.c: Renamed from am29k-tdep.c.
+ * remote-eb.c, config/a29k/tm-ultra3.h: Include renamed tm-a29k.h.
+ * remote-monitor.c, remote-st2000.c, config/a29k/{nm-ultra3.h,
+ tm-a29k.h, xm-ultra3.h}, config/romp/rtbsd.mh, doc/gdbinv-s.texi,
+ testsuite/gdb.t15/funcargs.exp, testsuite/gdb.t17/callfuncs.exp:
+ Map '29k' to 'a29k'.
+ * config/a29k/{a29k-kern.mt, a29k-udi.mt, a29k.mt, ultra3.mt}
+ (TDEPFILES): Use renamed a29k-pinsn.o and a29k-tdep.o.
+ * config/a29k/{a29k-udi.mt, a29k.mt} (TM_FILE): Use renamed
+ tm-a29k.h.
+ * config/a29k/a29k-udi.mt (MT_CFLAGS): Remove TARGET_AM29K
+ define that does not appear anywhere else in the gdb source tree.
+ * doc/gdbinit.texinfo: Document renaming of tm-29k.h to tm-a29k.h.
+
+Mon Mar 29 13:55:29 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * breakpoint.c: Add comments regarding breakpoint_re_set.
+
+ * xcoffread.c (sort_syms, compare_symbols): Remove.
+ (xcoff_symfile_read): Use sort_all_symtab_syms from symfile.c
+ not our own sort_syms (it is identical).
+
+ * xcoffread.c: Nuke NAMES_HAVE_DOT define (not used).
+
+Sun Mar 28 11:24:37 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (breakpoint_re_set_one): Fix storage leak.
+ * breakpoint.c (enable_breakpoint): Don't enable watchpoint if it
+ went out of scope.
+ * exec.c (exec_close): Fix storage leak.
+ * exec.c (exec_file_command): Make sure that bfd doesn't realign the
+ output sections when patching an executable.
+ * mips-nat.c (store_inferior_registers): Use REGISTER_PTRACE_ADDR
+ when writing all registers.
+ * mips-tdep.c (mips_push_dummy_frame): Save floating point registers
+ at the right offset in the dummy frame.
+ * mipsread.c (psymtab_to_symtab_1): Do not complain for stProc,
+ stStaticProc and stEnd symbols as they are generated by gcc-2.x.
+ * mipsread.c (mipscoff_new_init): Initialize stabsread and buildsym.
+
+Fri Mar 26 15:25:05 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (TARFILES): Avoid trailing backslash.
+
+Fri Mar 26 11:29:30 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * breakpoint.{c,h}: Add exp_string to struct breakpoint and use
+ it in breakpoint_re_set.
+ * breakpoint.c (watch_command, enable_breakpoint): Fetch lazy values.
+
+ * rs6000-tdep.c (single_step): Misc cleanups (CORE_ADDR not int,
+ don't use sizeof(int) for target stuff, etc).
+
+Thu Mar 25 15:03:53 1993 Fred Fish (fnf@cygnus.com)
+
+ * alldeps.mak, configure.in, i860-break.h, i860-opcode.h,
+ i860-pinsn.c, i860-tdep.c, config/i860/*: Remove incomplete i860
+ support that can't be integrated anyway due to lack of clear
+ authorship.
+
+Thu Mar 25 12:26:50 1993 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (read_register, write_register): Make these capable
+ of reading/writing registers that are shorter than REGISTER_TYPE.
+ * (value_from_register): Install H8500 specific code to return
+ proper value when register is being used as a pointer.
+ * h8500-tdep.c: Remove extra defines of NUM_REGS.
+ (h8500_skip_prologue): Use correct lengths for LINK instructions.
+ (FRAME_CHAIN): Change name to h8500_frame_chain. Rewrite code to
+ chain frames properly by combining frame pointer with T reg.
+ (init_extra_frame_info): Delete. It's now a macro.
+ (frame_args_address): Don't add PTR_SIZE. Stack args are already
+ offset by the correct amount off of the frame pointer.
+ (register_byte): Delete. It's now a macro.
+ (register_raw_size, register_virtual_size): Delete. Replaced by
+ common routine h8500_register_size, cuz there's no difference
+ between the raw & virtual sizes on this machine.
+ (register_convert_to_raw, register_convert_to_virtual): Delete,
+ cuz there's no difference between the raw & virtual forms.
+ Replaced by memcpy in tm file.
+ (register_virtual_type): Rename to h8500_register_virtual_type.
+ Get rid of pointer pseudo-regs, use _REGNUM with all reg names.
+ (_initialize_h8500_tdep): Get rid of crock to ensure that GDB &
+ emulator have same reg offsets. This is all handled in the
+ simulator code now.
+ (h8500_trapped_internalvar): New routine to detect references to
+ convenience vars acting as pointer pseudo-regs.
+ (h8500_value_trapped_internalvar): Conjure up value of pointer
+ pseudo-regs.
+ (h8500_set_trapped_internalvar): Convert set value in real
+ register references.
+ infcmd.c (read_pc, write_pc): Add h8500 specific code to handle
+ code segment register.
+ infrun.c (proceed): Simplify. Call write_pc instead of doing it
+ by hand.
+ (wait_for_inferior): Add h8500 specific code to add stack segment
+ when reading SP register.
+ remote-sim.c (fetch_register): Spacing.
+ tm-h8500.h: #define GDB_TARGET_IS_H8500 to make it easier to
+ detect cruft. Redo all register manipulation stuff. Get rid of
+ pointer pseudo-regs. (INIT_EXTRA_FRAME_INFO): Adds stack segment
+ to frame pointer. (IS_TRAPPED_INTERNALVAL,
+ VALUE_OF_TRAPPED_INTERNALVAR, SET_TRAPPED_INTERNALVAR): Use these
+ to create internal vars for pointer pseudo-regs.
+
+Thu Mar 25 10:10:28 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in: Numerous small changes to macro definitions
+ and rules for building gdb distribution tree. Many macros
+ eliminated or merged, and rules simplified.
+ * alldeps.mak: Update.
+ * depend: Update.
+
+Wed Mar 24 13:52:29 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+
+ * Makefile.in: recurse through SUBDIRS for dvi target too
+
+Wed Mar 24 08:48:30 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Clean up xcoff relocation.
+ objfiles.h (struct objfiles): Add section_offsets, num_sections.
+ symfile.c (syms_from_objfile), xcoffread.c (xcoff_symfile_offsets):
+ Set them.
+ symtab.h (struct general_symbol_info): Add section field.
+ minsyms.c (prim_record_minimal_symbol{,_and_info}): Set it.
+ xcoffread.c: Set section for symbols and msymbols.
+ (struct symtab): Add block_line_section field.
+ buildsym.c (end_symtab): Set it.
+ (end_symtab and callers): Add section parameter.
+ objfiles.c (objfile_relocate): New funciton.
+ xcoffexec.c (vmap_symtab): Use it.
+ xcoffsolib.h (struct vmap): Remove unused fields.
+ config/rs6000/tm-rs6000.h, stack.c, xcoffexec.c: Remove
+ CORE_NEEDS_RELOCATION, symtab_relocated.
+ config/rs6000/tm-rs6000.h: Remove use of loadinfotext.
+ rs6000-tdep.c: Make loadinfotext static.
+ breakpoint.c (fixup_breakpoints): Doc fix.
+ symtab.h (struct symtab), config/rs6000/tm-rs6000.h, buildsym.c
+ (end_symtab): primary field replaces nonreloc.
+
+Tue Mar 23 00:10:53 1993 John Gilmore (gnu@cygnus.com)
+
+ * symtab.h (struct linetable_entry): Remove confusing comment.
+
+Tue Mar 23 00:01:23 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: add installcheck target
+
+Mon Mar 22 16:17:58 1993 Fred Fish (fnf@cygnus.com)
+
+ * config/{a29k, arm, convex, gould, h8300, i386, i860, i960, m68k,
+ m88k, mips, none, ns32k, pa, pyr, romp, rs6000, sparc, tahoe, vax,
+ z8k}: New directories to hold cpu specific configuration files.
+ Naming follows gcc convention.
+ * config/{*.mt, *.mh}: All target and host makefile fragment
+ config files moved to an appropriate config/<cpu> subdirectory.
+ * nm-*, xm-*, tm-*: All native, host, and target files, which
+ get linked to nm.h, xm.h, and tm.h respectively by configure,
+ moved to appropriate config/<cpu> subdirectory.
+ * nm-sysv4.h, xm-sysv4.h, tm-sysv4.h, tm-sunos.h, nm-trash.h:
+ Native, host, and target files that are common across more than
+ one cpu architecture and included by one of the configured
+ native, host, or target files, get moved to config directory.
+ * Makefile.in (INCLUDE_CFLAGS): Add -I${srcdir}/config to
+ pick up native, host, or target include files moved to one of
+ the config subdirectories, and that are included by other files.
+ * Makefile.in (alldeps.mak): Modify to account for new config
+ directory structure.
+ * alldeps.mak, depend: Update for new config directory structure.
+ * config/*/[ntx]m-*.h: Modify all files that include other
+ [ntx]m-*.h files to use path relative to gdb/config. I.E.
+ "a29k/tm-ultra3.h" includes "a29k/tm-29k.h" rather than just
+ "tm-29k.h".
+ * remote-eb.c (tm-29k.h): Include a29k/tm-29k.h.
+ * mipsread.c (tm-mips.h): Include mips/tm-mips.h.
+ * i860-pinsn.c (tm-i860.h): Include i860/tm-i860.h.
+ * configure.in: Default gdb_host_cpu to host_cpu, and remap
+ the ones where the default is not unique or different than the
+ config subdirectory name. Similarly, handle gdb_target_cpu.
+ Modify configure.in as appropriate to make use of gdb_host_cpu
+ and gdb_target_cpu to find makefile fragments and make links.
+
+Mon Mar 22 12:36:24 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c (compare_blocks): Sort blocks with the same start
+ address by decreasing ending address.
+
+Mon Mar 22 20:36:04 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (parse_procedure): Save cur_fdr accross call to
+ lookup_symbol as it might get clobbered by the call.
+
+ * mipsread.c (parse_partial_symbols): Use ADD_PSYMBOL_ADDR_TO_LIST.
+ The previous code did not initialize the language field for the psymtab
+ entry.
+
+Sat Mar 20 00:33:39 1993 John Gilmore (gnu@cygnus.com)
+
+ * c-exp.y (parse_number): Avoid shift warning.
+ * serial.h (struct ttystate): Declare empty one on DOS.
+
+Fri Mar 19 12:59:50 1993 Stu Grossman (grossman@cygnus.com)
+
+ * xm-sun4os4.h: Return type of free() should be void, not int.
+
+ * vx-share/vxWorks.h: Remove #def of NULL.
+
+Fri Mar 19 11:28:18 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * tm-rs6000.h: Nuke no-op STAB_REG_TO_REGNUM.
+
+Fri Mar 19 07:40:09 1993 Steve Chamberlain (sac@cygnus.com)
+
+ * z8k-tdep.c (print_insn): Include the new dis-asm header file.
+
+Thu Mar 18 14:26:57 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * ieee-float.c: Moved to ../libiberty.
+ * ieee-float.h: Moved to ../include.
+ * Makefile.in: Update accordingly.
+ * i386-pinsn.c (print_insn), m68k-pinsn.c (print_insn):
+ Convert to stubs that call disassemblers in ../opcodes/*-dis.c.
+ * m68k-tdep.c: Removed definition of ext_format ext_format_68881;
+ it is now in ../opcodes/m68881-ext.c.
+ * mips-tdep.c (mips_skip_prologue): Try to skip more of the
+ prologue (some callers _do_ care).
+ * mips-pinsn.c (print_insn), z8k-tdep.c (print_insn): Convert to
+ new interface of ../opcodes/*-dis.c.
+ * ch-exp.y: Add #include <ctype.h>.
+
+Thu Mar 18 11:57:49 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffexec.c (exec_close): Don't close exec_bfd twice.
+
+ * xcoffread.c (enter_line_range): endaddr is exclusive, not inclusive.
+
+Wed Mar 17 09:46:31 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (arrange_linetable): Use x{m,re}alloc not {m,re}alloc.
+
+Wed Mar 17 11:28:11 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * z8k-tdep.c (extract_return_value, write_return_value,
+ store_struct_return): New functions from macros in tm-z8k.h.
+
+Wed Mar 17 11:23:06 1993 Fred Fish (fnf@cygnus.com)
+
+ * valops.c (value_arg_coerce): Apply temporary patch to
+ fix problem with coercion of array and function types when
+ passed as arguments to C functions, pending a more complete
+ review of when and how coercion should be done, depending
+ upon context and language.
+
+Wed Mar 17 09:46:31 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (MIN_TBTABSIZ): Change to 12.
+
+ * xcoffread.c (xcoff_symfile_read): Only read stringtab and
+ debugsec if there are a non-zero number of symbols.
+
+Tue Mar 16 18:08:45 1993 John Gilmore (gnu@cygnus.com)
+
+ * command.c (show_user): Avoid fprintf_filtered botch (AGAIN!).
+
+Tue Mar 16 15:18:17 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffexec.c (add_vmap): Wrap symbol read in catch_errors.
+
+ * xcoffread.c (read_symbol_lineno): Look to end of symbols for .bf,
+ not just 50 symbols.
+ (symtbl_num_syms): New variable.
+ (read_xcoff_symtab): Set it.
+ (read_symbol_nvalue): Check for bad symno.
+ (read_symbol_{lineno,nvalue}, callers): Don't pass symtable; it's
+ always symtbl.
+
+Tue Mar 16 10:09:05 1993 Stu Grossman (grossman@cygnus.com)
+
+ * config/rs6000.mh: Get rid of -Dfd_set=int crock.
+ This is defined in defs.h if necessary.
+ * vx-share/vxWorks.h: Remove #defs of min and max.
+ * vx-share/xdr_ld.c, vx-share/xdr_ptrace.c,
+ vx-share/xdr_rdb.c: include defs.h.
+
+Fri Mar 12 09:33:23 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (retrieve_tracebackinfo): Move assignment out
+ of while condition.
+
+ * xcoffread.c (enter_line_range): complain() on bad endoffset.
+ xcoffread.c: Doc fixes.
+
+Tue Mar 9 09:56:12 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * tm-rs6000.h (CORE_NEEDS_RELOCATION): Just call xcoff_relocate_core.
+ xcoffexec.c (xcoff_relocate_core): New function.
+ (text_adjustment): Removed.
+ (add_vmap): Return the vmap.
+ rs6000-tdep.c (add_text_to_loadinfo): No longer static.
+
+Fri Mar 5 05:22:46 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffsolib.h: Add objfile member to struct vmap.
+ xcoff{exec,solib}.c: Use it, not lookup_objfile_bfd.
+ xcoffexec.c (add_vmap): Allocate objfiles here.
+
+Sun Mar 14 02:54:15 1993 John Gilmore (gnu@cygnus.com)
+
+ Support 68000 series without floating point.
+
+ * configure.in (m68000-*-{aout,elf,coff}): New configs.
+ * tm-68k-nofp.h: New file, lacks 68881 support.
+ * config/m68k-nofp.mt: New file.
+
+Sun Mar 14 02:30:08 1993 John Gilmore (gnu@cygnus.com)
+
+ Remove a few remaining underscore/no-underscore remnants from
+ config files.
+
+ * config/{m68k-un.mt, sparc-un.mt}: Remove.
+ * config/m68k-noun.mt: Rename to m68k-fp.mt.
+ * config/sparc-noun.mt: Rename to sparc-em.mt.
+ * tm-68k-noun.h, tm-spc-noun.h: Remove.
+ * tm-68k-un.h: Rename to tm-68k-fp.h.
+ * tm-spc-un.h: Rename to tm-spc-em.h.
+ * tm-sun4sol2.h: Cleanup.
+ * configure.in (m68k-*, sparc-* targets): Corresponding changes.
+
+Sat Mar 13 14:58:22 1993 John Gilmore (gnu@cygnus.com)
+
+ * symmisc.c (std_in, std_out, std_err): Move initializations
+ to runtime code, in case they aren't constant.
+
+Fri Mar 12 16:23:54 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * symtab.c (find_pc_symtab): some object file formats, notably
+ mips, have holes in the address ranges of symtabs. Change
+ this algorithm from first hit to tightest fit.
+
+ * mips-tdep.c (heuristic_proc_start): if we walk the pc into the
+ fence post without finding the enclosing function, then print a
+ warning.
+
+Thu Mar 11 09:33:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * utils.c (fputs_demangled, fprint_symbol): Remove.
+ * utils.c (fprintf_symbol_filtered): New function which combines
+ the functionality of fputs_demangled and fprint_symbol. Uses a
+ caller provided language parameter to select the appropriate
+ demangler, and caller provided args to pass to the demangler.
+ * defs.h (enum language): Move further up in file so enum can
+ be used in prototypes.
+ * defs.h (fputs_demangled, fprint_symbol): Remove prototypes.
+ * defs.h (fprintf_symbol_filtered): Add prototype.
+ * c-typeprint.c (cp_type_print_method_args): Replace calls to
+ fputs_demangled with call to fprintf_symbol_filtered.
+ * cp-valprint.c (demangle.h): Include
+ * cp-valprint.c (cp_print_value_fields): Replace calls to
+ fprint_symbol with calls to fprintf_symbol_filtered.
+ * printcmd.c (print_frame_args): Replace call to fprint_symbol
+ with call to fprintf_symbol_filtered.
+ * stack.c (print_frame_info): Remove obsolete code so we don't
+ have to update fputs_demangled usage in it.
+ * stack.c (print_frame_info, frame_info): Add language variable
+ to pass to fprintf_symbol_demangled and initialize it from the
+ symbol's language. Replace calls to fputs_demangled with calls
+ to fprintf_symbol_filtered.
+ * symtab.c (find_methods): Replace call to fputs_demangled with
+ call to fprintf_symbol_filtered.
+ * ch-valprint.c (demangle.h): Include.
+ * ch-valprint.c (chill_print_value_fields): Replace call to
+ fprint_symbol with call to new fprintf_symbol_filtered.
+
+Wed Mar 10 17:37:11 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump version to 4.8.2.
+
+ * main.c (source_command): Require an explicit pathname of file
+ to source, since previous behavior of defaulting to gdb init file
+ was troublesome and undocumented.
+ * printcmd.c (disassemble_command): Add missing '{}' pair to
+ else with two statements. Bug reported by Stephane Tsacas
+ <slt@isoft.fr>.
+ * symtab.c (find_pc_line): Don't complain about zero length or
+ negative length line numbers for the moment, since we may not own
+ the terminal when called, such as when single stepping. (FIXME)
+ * language.h (CAST_IS_CONVERSION): True if current language is
+ C++ as well as C. Fix from Peter Schauer.
+ * environ.c (get_in_environ, set_in_environ, unset_in_environ):
+ Use STREQN macro rather than bare '!strncmp()'.
+ * environ.c (unset_in_environ): Avoid use of memcpy on
+ overlapping memory regions, as suggested by Paul Eggert
+ <eggert@twinsun.com>.
+ * c-exp.y (%union struct): Remove unused ulval as suggested
+ by Paul Eggert <eggert@twinsun.com>.
+
+Mon Mar 8 19:03:06 1993 Fred Fish (fnf@cygnus.com)
+
+ * main.c (gdbinit): Make static.
+ * main.c (inhibit_gdbinit): Move to file scope.
+ * main.c (main): Remove local inhibit_gdbinit.
+ * main.c (source_command): Don't source '.gdbinit' file by
+ default if gdb has been told to ignore it.
+
+Sun Mar 7 21:58:53 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (MAKEOVERRIDES): Define to be empty for GNU Make
+ 3.63.
+
+Fri Mar 5 17:39:45 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * printcmd.c (print_address_symbolic): Only print if offset
+ is shorter than max_symbolic_offset.
+ (initialize_printcmd): `set print max-symbolic-offset'.
+
+ * am29k-tdep.c (TAGWORD_ZERO_MASK): New #define.
+ (examine_tag): Use it.
+ (read_register_stack): Only look in the local registers for a
+ memory address if it's between rfb and rsp; go to memory otherwise.
+ (initialize_29k): Fix call_scratch_address doc. Remove reginv_com.
+ (reginv_com): Remove ancient kludge command.
+
+Fri Mar 5 17:16:26 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * tm-irix3.h (ZERO_REGNUM): copy this macro from tm-mips.h so that
+ irix4 will again compile.
+
+ * tm-mips.h (GDB_TARGET_IS_MIPS): no longer used, now removed.
+
+ * configure.in: accept mips-sgi-irix4* for irix4.
+
+Fri Mar 5 07:49:48 1993 Steve Chamberlain (sac@lisa.cygnus.com)
+
+ * z8k-tdep.c (print_register_hook): Lint.
+
+Thu Mar 4 17:42:03 1993 John Gilmore (gnu@cygnus.com)
+
+ Lint fixes from Paul Eggert (eggert@twinsun.com):
+
+ * command.c (do_setshow_command): var_uintegers are unsigned.
+ * sparc-tdep.c (save_insn_opcodes, restore_insn_opcodes):
+ unsigned, since they use hex values with the high bit set.
+
+Thu Mar 4 08:22:55 1993 Fred Fish (fnf@cygnus.com)
+
+ Fixes submitted by Karl Berry (karl@nermal.hq.ileaf.com):
+ * m88k-pinsn.c (sprint_address): Use SYMBOL_NAME macro to
+ access symbol name.
+ * m88k-nat-c (SXIP_OFFSET, SNIP_OFFSET, SFIP_OFFSET): Enclose
+ macro definitions in parenthesis.
+
+ * dbxread.c (dbx_symfile_init): Catch the case where there is
+ no string table, but the only way we find out is by reading zero
+ bytes from EOF.
+
+Wed Mar 3 15:51:28 1993 Fred Fish (fnf@cygnus.com)
+
+ * dbxread.c (dbx_symfile_init): Make size of the string table
+ size field a define (DBX_STRINGTAB_SIZE_SIZE). Ensure that the
+ offset to the string table is nonzero and handle the nonexistant
+ string table case, should it occur. Ensure that the string table
+ size read from the file is reasonable, with a minimum lower bound
+ of DBX_STRINGTAB_SIZE_SIZE instead of zero.
+
+Wed Mar 3 07:23:03 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: Changes to build testsuite correctly.
+ (FLAGS_TO_PASS): Added CXX and CXXFLAGS.
+ (CC_FOR_TARGET, CXX, CXX_FOR_TARGET): New variables.
+ (TARGET_FLAGS_TO_PASS): New variable.
+ (SUBDIRS): Added testsuite.
+ (all): Build testsuite using TARGET_FLAGS_TO_PASS, so that
+ testsuite is compiled with CC_FOR_TARGET rather than CC.
+
+Tue Mar 2 17:57:56 1993 Fred Fish (fnf@cygnus.com)
+
+ * dbxread.c (dbx_symfile_init): Fix for nonexistant string table,
+ reported by mycroft@gnu.ai.mit.edu.
+
+ (Ultrix 2.2 support from Michael Rendell <michael@mercury.cs.mun.ca>)
+ * configure.in (vax-*-ultrix2*): New triplet.
+ * config/vaxult2.mh: New file.
+ * xm-vaxult2.h: New file.
+
+ * c-exp.y (parse_number): Change high_bit to unsigned.
+ * demangle.c: Change all references to cfront to ARM, since the
+ actual algorithm is the one specified in the Annotated Reference
+ Manual. This was confusing users into thinking that full cfront
+ support was implemented.
+ * dwarfread.c (CFRONT_PRODUCER): Remove, was never really used.
+ * eval.c (evaluate_subexp): For STRUCTOP_PTR pass the arg type
+ directly to lookup_struct_elt_type, which will do the
+ dereferencing itself.
+ * gdbtypes.c (lookup_struct_elt_type): Expand comments. Fix
+ NULL dereferencing bug for unnamed structs, comment out
+ questionable code.
+
+Mon Mar 1 17:54:41 1993 John Gilmore (gnu@cygnus.com)
+
+ * coffread.c (process_coff_symbol): Change PCC argument correction
+ so that it only happens on big-endian targets; so that it only
+ happens if the short or char argument is aligned on an int
+ boundary; and so that it changes the location, rather than the
+ type, of the argument. These changes tend to parallel similar
+ (old) changes in stabsread.c.
+
+ * coffread.c (coff_read_enum_type): Use the specified size for
+ enums, don't assume that they are int-sized.
+
+ * c-valprint.c (c_val_print): Don't assume enums are the same as
+ ints.
+
+ * coredep.c: Handle NO_PTRACE_H in coredep.c. Fix by Michael
+ Rendell, <michael@mercury.cs.mun.ca>.
+
+Mon Mar 1 09:25:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * language.h (local_decimal_format_custom): Add prototype.
+ * language.c (local_decimal_format_custom): Add function, bug
+ reported by Robert R. Henry (rrh@tera.com).
+
+Fri Feb 26 18:33:18 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * xcoffexec.c (vmap_ldinfo): Fix "/" for '/' typo, reported
+ by Josef Leherbauer, joe@takeFive.co.at.
+
+Wed Feb 24 19:17:11 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * symfile.c (syms_from_objfile), tm-29k.h, tm-3b1.h, tm-68k-un.h,
+ tm-altos.h, tm-arm.h, tm-convex.h, tm-es1800.h, tm-h8300.h,
+ tm-hp300bsd.h, tm-hp300hpux.h, tm-hppa.h, tm-i386bsd.h,
+ tm-i386v.h, tm-i960.h, tm-irix3.h, tm-isi.h, tm-linux.h,
+ tm-m88k.h, tm-merlin.h, tm-mips.h, tm-news.h, tm-np1.h, tm-pn.h,
+ tm-pyr.h, tm-rs6000.h, tm-spc-un.h, tm-sun386.h, tm-sunos.h,
+ tm-symmetry.h, tm-sysv4.h, tm-tahoe.h, tm-umax.h, tm-vax.h,
+ tm-vx68.h, tm-z8k.h: Remove remnants of NAMES_HAVE_UNDERSCORE.
+
+Wed Feb 24 07:41:15 1993 Fred Fish (fnf@cygnus.com)
+
+ * symtab.h (SYMBOL_INIT_DEMANGLED_NAME): Initialize contents
+ of demangled name fields to NULL if no demangling exists for
+ a symbol. SYMBOL_INIT_LANGUAGE_SPECIFIC does this for new
+ symbols if their language is known at the time they are created,
+ but sometimes the language is not known until later.
+
+ * ch-typeprint.c (chill_print_type_base): Name changed to
+ chill_type_print_base to match pattern for C and C++ names.
+ * ch-typeprint.c (chill_print_type): Change "char" to "CHAR"
+ to be consistent with other usages.
+ * ch-typeprint.c (chill_type_print_base): Add support for
+ printing Chill STRUCT types.
+ * ch-valprint.c: Include values.h.
+ * ch-valprint.c (chill_print_value_fields): New function and
+ prototype for printing Chill STRUCT values.
+ * ch-valprint.c (chill_val_print): Fix call to val_print_string
+ that was being called with two args instead of three.
+ * ch-valprint.c (chill_val_print): Call chill_print_value_fields
+ to print Chill STRUCT values.
+
+Tue Feb 23 18:58:11 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * configure.in: added testsuite to configdirs.
+
+Tue Feb 23 11:46:11 1993 Mike Stump (mrs@cygnus.com)
+
+ * doc/stabs.texi: The `this' pointer is now known by the name
+ `this' instead of `$t'.
+
+Tue Feb 23 11:21:33 1993 Fred Fish (fnf@cygnus.com)
+
+ * dwarfread.c (read_tag_string_type): Rewrite to allow forward
+ references of TAG_string_type DIEs in user defined types.
+ * ch-lang.c (chill_create_fundamental_type): Track compiler
+ change that now emits debugging info with the type long for Chill
+ longs.
+
+Mon Feb 22 15:21:54 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * remote-mips.c: New file; implements MIPS remote debugging
+ protocol.
+ * config/idt.mt: New file; uses remote-mips.c
+ * configure.in (mips-idt-ecoff): New target; uses idt.mt.
+
+ * mips-tdep.c (mips_fpu): New variable; controls use of MIPS
+ floating point coprocessor.
+ (mips_push_dummy_frame): If not mips_fpu, don't save floating
+ point registers.
+ (mips_pop_frame): If not mips_fpu, don't restore floating point
+ registers.
+ (_initialize_mips_tdep): New function; let the user reset mips_fpu
+ variable.
+ * tm-mips.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): If not
+ mips_fpu, don't use fp0 as floating point return register.
+ (FIX_CALL_DUMMY): If not mips_fpu, don't save floating point
+ registers.
+
+Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * gdb/testsuite: made modifications to testcases, etc., to allow
+ them to work properly given the reorganization of deja-gnu and the
+ relocation of the testcases from deja-gnu to a "tool" subdirectory.
+
+Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * gdb/testsuite: Initial creation of gdb/testsuite.
+ Migrated dejagnu testcases and support files for testing nm to
+ gdb/testsuite from deja-gnu. These files were moved "as is"
+ with no modifications. This migration is part of a major overhaul
+ of dejagnu. The modifications to these testcases, etc., which
+ will allow them to work with the new version of dejagnu will be
+ made in a future update.
+
+Fri Feb 19 18:36:55 1993 John Gilmore (gnu@cygnus.com)
+
+ * NEWS: Add reminders for next release.
+
+Fri Feb 19 10:01:39 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c (parse_lines): Correct check for files compiled with
+ -g1.
+
+Fri Feb 19 05:56:15 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): 4.8.1 to distinguish local versions.
+
+Fri Feb 19 01:32:58 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): GDB-4.8 release!
+ * README, NEWS: Update for release.
+
+Thu Feb 18 22:44:40 1993 Stu Grossman (grossman@cygnus.com)
+
+ * am29k-pinsn.c (print_insn): Minor nits with const.
+ * am29k-tdep.c: More minor nits with arg types for
+ supply_register, NULL vs. 0, read_register_gen, & reginv_com.
+
+Thu Feb 18 22:38:03 1993 John Gilmore (gnu@cygnus.com)
+
+ * gcc.patch: Update for a different GCC (G++) bug.
+ * main.c (print_gdb_version): Update copyright year to 1993.
+ * nm-hp300bsd.h: Decide whether this is BSD 4.3 or 4.4,
+ conditionalize this file on it. FIXME, right way is to split
+ these into two config files.
+ (ATTACH_DETACH): Define for BSD 4.4
+ (PTRACE_ARG_TYPE): caddr_t for BSD 4.4, unset for 4.3.
+ (U_REGS_OFFSET): Revise for 4.4.
+ (REGISTER_U_ADDR): Separate for 4.4, but it doesn't work yet.
+ * xm-hp300bsd.h: Move definitions of UINT_MAX, INT_MAX, INT_MIN,
+ LONG_MAX into this file to avoid cpp "redefinition" warnings.
+
+Thu Feb 18 16:13:28 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * nm-hp300bsd.h (PTRACE_ARG3_TYPE): FSF's hp300's have int* not
+ caddr_t.
+
+Thu Feb 18 04:10:06 1993 John Gilmore (gnu@cygnus.com)
+
+ * c-lang.c (c_printstr): Bugfix for length==0 case.
+
+ * c-lang.c (c_printstr): If a C string ends in a null, don't
+ print the null.
+
+Thu Feb 18 02:39:21 1993 Stu Grossman (grossman at cygnus.com)
+
+ * defs.h (STRCMP): Make it work for unsigned chars.
+
+Thu Feb 18 01:56:06 1993 John Gilmore (gnu@cygnus.com)
+
+ * nm-hp300bsd.h (ATTACH_DETACH, PTRACE_ATTACH, PTRACE_DETACH): define.
+ * config/hp300bsd.mh (REGEX, REGEX1): Define.
+ * m68k-pinsn.c (BREAK_UP_BIG_DECL, AND_OTHER_PART): #if __GNUC__,
+ define to kludge the large opcode table into two smaller tables,
+ since GCC take exponential space to build the table. Lint.
+ (NOPCODES): Remove, use "numopcodes" from opcode/m68k.h instead.
+
+Wed Feb 17 19:24:40 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): Roll to 4.7.9.
+ * xm-hp300bsd.h: Define PSIGNAL_IN_SIGNAL_H and put a compatible
+ definition here, to handle both BSD 4.3 and 4.4 systems.
+ * mipsread.c (ZMAGIC): #undef to avoid duplicate define.
+ * remote.c (alarm): Move declaration to global level, before
+ first reference to it.
+ * tm-i386bsd.h (NUM_REGS): There are only eleven, not twelve.
+ * dbxread.c (process_one_symbol): Cast to unsigned char, not int.
+
+Wed Feb 17 13:40:29 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * remote.c (readchar): forward declare alarm which otherwise looks
+ like an undeclared variable to gcc.
+
+ * dbxread.c (process_one_symbol): cast enum value N_SO into int
+ when comparing against an int. Avoids superfluous warning from
+ vax ultrix 4.2 cc.
+
+ * inflow.c (set_sigint_trap): add cast to assignment from signal.
+ Avoids superfluous warnings from some systems and/or compilers
+ (like vax ultrix 4.2.)
+
+ * language.c (struct op_print unk_op_print_tab): use the enum
+ values rather naked zeros as initializers. Avoids warnings from
+ ultrix type compilers.
+
+Tue Feb 16 00:53:20 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): Roll to 4.7.6.
+ (SFILES_SUBDIR): Add 29k-share/udi_soc.
+ (SFILES_SUBSUBDIR): Move 29k-share/udi files to this macro.
+ (alldeps.mak): Make ALLDEPFILES_SUBSUBDIR for files in sub sub dirs.
+ (ALLDEPFILES_SUBSUBDIR): Depend on this for deeper dep files.
+ (HFILES): Remove all nm-* except nm-trash.h. Add ns32k-opcode.h.
+ (depend): Fix bug where nm-files in config files weren't noticed.
+ (make-proto-gdb-1): Avoid changing directories while building new
+ prototype. Build SFILES_SUBSUBDIR with longer symlinks.
+
+Mon Feb 15 20:48:09 1993 John Gilmore (gnu@cygnus.com)
+
+ * remote.c: Improve error recovery. Allow user to break out
+ of initial connection attempt with INTERRUPT. Treat a timeout
+ while waiting for remote packet like a retry, unless the remote
+ side is actively running user code. Fix a few long printf_filtered's.
+
+ * xcoffread.c (read_xcoff_symtab): Don't use null symbol name for
+ trampoline symbols.
+
+ * buildsym.c (start_subfile): Allow null file name.
+
+Fri Feb 12 15:46:49 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * xcoffread.c (process_xcoff_symbol, read_symbol_lineno): complain
+ expects a pointer to complaint rather than a complaint
+ structure.
+ (process_linenos): free the previously allocated subfile name,
+ then allocate the new one from the heap.
+
+Fri Feb 12 08:06:05 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * h8300-tdep.c, tm-h8300.h: turn off some experimental features
+
+Thu Feb 11 00:59:07 1993 John Gilmore (gnu@cygnus.com)
+
+ * stabsread.c (dbx_lookup_type): Handle negative type numbers.
+ Previously, would bogusly index off the bottom of type_vector.
+ (rs6000_builtin_type): Accept type number as argument.
+ (read_type, case '-'): Handle negatives like any other type number.
+
+ * symfile.c (deduce_language_from_filename): Handle null name.
+
+ * mips-tdep.c (isa_NAN): Fix byte order dependency.
+ Reported by Nobuyuki Hikichi <hikichi@sra.co.jp>,
+ fixed by sato@sm.sony.co.jp.
+
+ * xcoffread.c (parmsym): Don't use an initializer to set up
+ this struct symbol. Set it up in initialize_xcoffread.
+ (read_xcoff_symtab, xcoff_symfile_read): Surround code that only
+ works on real rs/6000 target with #ifndef FAKING_RS6000.
+
+Wed Feb 10 23:42:37 1993 John Gilmore (gnu@cygnus.com)
+
+ * stabsread.c (rs6000_builtin_type): Move function from
+ xcoffread.c:builtin_type.
+ * xcoffread.c (builtin_type): Move to stabsread. Remove
+ IBM6000_HOST dependency. Move misplaced comments.
+ (various): Change printf's to complaints.
+ (patch_block_stabs, process_xcoff_symbol case C_DECL): Add
+ objfile argument to read_type calls under #if 0.
+ (process_xcoff_symbol case C_RSYM): Fix typo in #ifdef.
+ * xcoffexec.c (map_vmap): Don't allocate an objfile for the exec_file.
+ * Makefile.in: xcoffread.o is not built by default.
+ * xm-rs6000.h (IBM6000_HOST): Remove.
+ * config/rs6000.mh (NATDEPFILES): xcoffread.o is native only.
+ * doc/gdbint.texinfo: Eliminate IBM6000_HOST, document
+ IBM6000_TARGET.
+
+Wed Feb 10 18:31:20 1993 Stu Grossman (grossman at cygnus.com)
+
+ * findvar.c (read_var_value): If REG_STRUCT_HAS_ADDR, then set
+ VALUE_LVAL to be lval_memory so that we don't try to modify wild
+ register numbers when user tries to modify elements in structs
+ passed as arguments.
+ * inflow.c (child_terminal_info): Move banner outside of system
+ specific #ifdefs.
+ * tm-hppa.h (REG_STRUCT_HAS_ADDR): Define this for HPPA, which
+ passes struct/union arguments by address.
+
+Wed Feb 10 15:34:46 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Based on patch from Kean Johnston <maw@netcom.com>:
+ * nm-i386sco4.h: New file. Like nm-i386sco.h, but define
+ ATTACH_DETACH, PTRACE_ATTACH and PTRACE_DETACH.
+ * config/i386sco4.mh (NAT_FILE): Use nm-i386sco4.h.
+
+Tue Feb 9 20:07:18 1993 John Gilmore (gnu@cygnus.com)
+
+ * remote-udi.c (FREEZE_MODE): Fix && for & typo. Found and
+ fixed by Lynn D. Shumaker, shumaker@saifr00.cfsat.honeywell.com.
+
+Tue Feb 9 08:18:07 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/i386sco4.mh (MUNCH_DEFINE): Pass -p to nm to avoid bug in
+ cc debugging output.
+
+Tue Feb 9 00:19:28 1993 John Gilmore (gnu@cygnus.com)
+
+ * stabsread.c (define_symbol): Complain about unrecognized names
+ that begin with CPLUS_MARKER (often '$'), but don't die. Fix
+ suggested by gb@cs.purdue.edu (Gerald Baumgartner).
+ (read_cpp_abbrev): Don't use the class name as part of the
+ vtable pointer member name (_vptr$) in $vf abbrevs or unrecognized
+ abbrevs. Inspired by Mike Tiemann.
+ (read_tilde_fields): Comment. Remove ancient dead code.
+ Remove erroneous but non-dead code. Simplify. Add complaints.
+ (in general): Remove extraneous (parentheses) in return
+ statements.
+
+Fri Feb 5 14:01:22 1993 John Gilmore (gnu@cygnus.com)
+
+ * coffread.c (coff_lookup_type): Fix fencepost error reported
+ by Art Berggreen, <arg@opal.acc.com>.
+
+ Fix long file name bug reported on SCO Open Desktop 2.0 by Ulf Lunde
+ <Ulf.Lunde@kvatro.no> and Dag H. Wanvik <Dag.H.Wanvik@kvatro.no>:
+
+ * coffread.c (getfilename): Eliminate COFF_NO_LONG_FILE_NAMES
+ test, which is apparently left over from when we used native
+ include files and couldn't depend on the member names being there.
+ * tm-3b1.h, tm-altos.h, tm-i386v.h: Don't set it.
+
+Thu Feb 4 12:23:15 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c: Major overhaul to use new BFD symbol table reading
+ routines. Now swaps information as it is needed, rather than
+ swapping everything when the file is read.
+
+Thu Feb 4 01:52:36 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (TARDIRS): Add sparclite demo dir.
+ (*.tab.c): Change dependency on Makefile to depend on
+ Makefile.in, otherwise it always rebuilds after configuring.
+ Force output *.tab.c file into current directory even in "make"
+ versions that rewrite dependent file names used in command lines.
+
+ * TODO: Remove some things we did.
+ * am29k-opcode.h, convx-opcode: Remove; now in ../include/opcode.
+ * os68k-xdep.c: Remove; useless file (os68k is a target only).
+ * convex-pinsn.c: Use ../include/opcode/convex.h. Add CONST.
+ * symtab.h: Eliminate unnamed unions and structs.
+
+Wed Feb 3 14:48:08 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in (VERSION): Roll to 4.7.5.
+
+Tue Feb 2 20:47:42 1993 John Gilmore (gnu@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Handle watchpoints when
+ re-evaluating symbol pointers.
+
+Tue Feb 2 16:10:31 1993 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (lcurly, rcurly): New nonterminals.
+ * c-exp.y (exp): Use lcurly and rcurly for arrays and UNOP_MEMVAL
+ constructs.
+ * parse.c (free_funcalls): Moved prototype from parser-defs.h,
+ made function static.
+ * parse.c (struct funcall): Moved struct def from parser-defs.h.
+ * parse.c (funcall_chain): Moved from parser-defs.h, made static.
+ * parse.c (start_arglist):
+ * parser-defs.h (free_funcalls): Moved prototype to parse.c.
+ * parser-defs.h (struct funcall): Moved struct def to parse.c.
+ * parser-defs.h (funcall_chain): Moved to parse.c.
+ * printcmd.c (print_frame_nameless_args): Fix prototype.
+ * tm-mips.h (setup_arbitrary_frame): Fix prototype.
+ * tm-sparc.h (setup_arbitrary_frame): Fix prototype.
+ * valops.c (typecmp): Moved prototype from values.h.
+ * value.h (typecmp): Moved prototype to valops.c, made static.
+ * ch-exp.y (yylex): Change way control sequences are disabled.
+
+Tue Feb 2 16:11:43 1993 John Gilmore (gnu@cygnus.com)
+
+ * tm-mips.h, tm-sparc.h: Fix thinko in SETUP_ARBITRARY_FRAME.
+
+Tue Feb 2 15:30:33 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c (upgrade_type): Build array types correctly, using
+ create_range_type and create_array_type.
+
+Tue Feb 2 00:19:08 1993 John Gilmore (gnu@cygnus.com)
+
+ * remote-nindy.c: Cleanup.
+
+ * infrun.c (wait_for_inferior): When rolling back the PC after
+ a breakpoint, call write_pc so that NPC gets rolled back as well
+ (for the 29K).
+
+ * blockframe.c (inside_entry_file, inside_main_func,
+ inside_entry_func): PC of zero is always "bottom of stack".
+
+ * printcmd.c (print_frame_args, print_frame_nameless_args):
+ Let print_frame_nameless_args decide whether there are any,
+ laying groundwork for possibly later printing 29K args for
+ functions where we have tag words but no symbols.
+
+Mon Feb 1 18:09:58 1993 Roland H. Pesch (pesch@fowanton.cygnus.com)
+
+ * Makefile.in: fix GDB doc targets for new doc subdir structure
+
+Mon Feb 1 17:56:47 1993 John Gilmore (gnu@cygnus.com)
+
+ * stack.c (parse_frame_specification): Parse as many arguments
+ as there are (up to MAXARGS). Pass all of them in argc, argv
+ format to SETUP_ARBITRARY_FRAME. Put the burden of checking how
+ many there were, onto SETUP_ARBITRARY_FRAME.
+ * tm-mips.h, tm-sparc.h: Corresponding changes.
+ * mips-tdep.c, sparc-tdep.c: Ditto.
+
+Mon Feb 1 17:19:37 1993 John Gilmore (gnu@cygnus.com)
+
+ * hp300ux-nat.c: Update copyrights.
+ * mipsread.c (parse_partial_symbols): Complain about block
+ indexes that go backwards. Fix from Peter Schauer.
+ * symfile.c (syms_from_objfile, symbol_file_add): Allow a
+ symbol-file that has no linkage symbols to be read.
+ * tm-rs6000.h, xm-rs6000.h: (SIGWINCH_HANDLER and friends): Move
+ from tm- file to xm-file, since they're host dependent.
+ * valarith.c (value_binop): Typo.
+
+Mon Feb 1 16:16:59 1993 Stu Grossman (grossman at cygnus.com)
+
+ * sparclite/aload.c: Add copyleft.
+ * sparclite/crt0.s: Add comment at beginning.
+
+Mon Feb 1 14:36:11 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * remote-z8k.c, z8k-tdep.c: support for the Z8001 and Z8002.
+ * parse.c (std_regs): Only declare if NO_STD_REGS is defined.
+
+Sun Jan 31 04:32:48 1993 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * values.c (value_headof): Fix typo in which VTBL and ARG were
+ being confused for one another.
+
+ * valops.c (typecmp): Now static.
+
+ * gdbtypes.c (fill_in_vptr_fieldno): Don't ignore the first
+ baseclass--we don't always inherit its virtual function table
+ pointer.
+
+ * eval.c (evaluate_subexp): In OP_FUNCALL case, adjust `this'
+ pointer correctly in case value_struct_elt moves it around.
+
+ * valops.c (typecmp): Now static. Also, now groks references
+ better.
+
+ * gdbtypes.c (lookup_struct_elt_type): Pass NOERR instead of
+ zero on recursive call. If NAME is the name of TYPE, return TYPE.
+
+Sat Jan 30 19:55:52 1993 John Gilmore (gnu@cygnus.com)
+
+ * hppah-nat.c: Eliminate <sys/user.h> and other unnecessary stuff,
+ to avoid "too much defining" error from native C compiler (!).
+
+ * Makefile.in (HFILES): Add typeprint.h.
+ * typeprint.[ch]: Update copyrights.
+
+Thu Jan 28 19:09:02 1993 John Gilmore (gnu@cygnus.com)
+
+ * Makefile.in: Update to match doc/ subdir changes.
+
+ * config/hp300hpux.mh: No cross-host file needed, just native.
+ * config/go32.mh: Remove nonexistent "native" support.
+
+ M88K fixes reported by Carl Greco, <cgreco@Creighton.Edu>:
+ * tm-m88k.h (REGISTER_CONVERT_TO_RAW): Fix typo.
+ * m88k-tdep.c (next_insn): Lint, cleanup.
+ (store_parm_word): Lint.
+
+ * README: Fix typo (reported by karl@hq.ileaf.com).
+
+Wed Jan 27 21:34:21 1993 Fred Fish (fnf@cygnus.com)
+
+ * expression.h (BINOP_CONCAT): Document use for self concatenation
+ an integral number of times.
+ * language.c (binop_type_check): Extend BINOP_CONCAT for self
+ concatenation case.
+ * valarith.c (value_concat): Rewrite to support self
+ concatenation an integral number of times.
+ * Makefile.in (ch-exp.tab.c): Change "expect" message.
+ * ch-exp.y (FIXME's): Make all FIXME tokens distinct, to
+ eliminate hundreds of spurious shift/reduce and reduce/reduce
+ conflicts that mask the 5 real ones.
+ * ch-exp.y (STRING, CONSTANT, SC): Remove unused tokens.
+ * ch-exp.y (integer_literal_expression): Remove production,
+ no longer used.
+
+Thu Jan 21 09:58:36 1993 Fred Fish (fnf@cygnus.com)
+
+ * eval.c (evaluate_subexp): Fix OP_ARRAY, remove code that
+ implied that "no side effects" was nonfunctional.
+ * eval.c (evaluate_subexp): Add BINOP_CONCAT case to deal with
+ character string and bitstring concatenation.
+ * expprint.c (dump_expression): Add case for BINOP_CONCAT.
+ * expression.h (exp_opcode): Add BINOP_CONCAT.
+ * gdbtypes.h (type_code): Add TYPE_CODE_BITSTRING.
+ * language.c (string_type): Add function to determine if a type
+ is a string type.
+ * language.c (binop_type_check): Add case for BINOP_CONCAT.
+ * valarith.c (value_concat): New function to concatenate two
+ values, such as character strings or bitstrings.
+ * valops.c (value_string): Remove error stub and implement
+ function body.
+ * value.h (value_concat): Add prototype.
+ * ch-exp.y (operand_3): Add actions for SLASH_SLASH (//).
+ * ch-exp.y (yylex): Recognize SLASH_SLASH.
+ * ch-lang.c (chill_op_print_tab): Add SLASH_SLASH (//) as
+ BINOP_CONCAT.
+
+Tue Jan 19 14:26:15 1993 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (exp): Add production to support direct creation
+ of array constants using the obvious syntax.
+ * c-valprint.c (c_val_print): Set printed string length.
+ * dwarfread.c (read_tag_string_type): New prototype and
+ function that handles TAG_string_type DIEs.
+ * dwarfread.c (process_dies): Add case for TAG_string_type
+ that calls new read_tag_string_type function.
+ * expprint.c (print_subexp): Add support for OP_ARRAY.
+ * gdbtypes.c (create_range_type, create_array_type): Inherit
+ objfile from the index type.
+ * ch-typeprint.c (chill_print_type): Add case for
+ TYPE_CODE_STRING.
+ * ch-valprint.c (chill_val_print): Fix case for
+ TYPE_CODE_STRING.
+
+Mon Jan 18 11:58:45 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mipsread.c (CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB,
+ MIPS_UNMARK_STAB, STABS_SYMBOLS): Removed; now in
+ include/coff/mips.h.
+
+Fri Jan 15 20:26:50 1993 Fred Fish (fnf@cygnus.com)
+
+ * c-exp.y (exp:STRING): Convert C strings into array-of-char
+ constants with an explicit null byte terminator. OP_STRING is
+ now used for real string types.
+ * c-lang.c (builtin_type_*): Move declarations to lang.c since
+ they are used by all languages.
+ * c-lang.c (_initialize_c_language): Move initializations of
+ builtin_type_* to lang.c.
+ * c-typeprint.c (c_type_print_varspec_prefix,
+ c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed
+ to TYPE_CODE_STRING.
+ * c-valprint.c (c_val_print): Change the way character arrays
+ are printed as strings to be consistent with the way strings
+ are printed when pointer-to-char types are dereferenced.
+ Remove test of print_max before calling val_print_string, which
+ now does it's own test.
+ * eval.c (evaluate_subexp): Add case for OP_ARRAY.
+ * expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY.
+ * expression.h (enum exp_opcode): Add OP_ARRAY and document.
+ * gdbtypes.c (builtin_type_*): Add declarations moved from
+ c-lang.c.
+ * gdbtypes.c (create_string_type): New function to create real
+ string types.
+ * gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY
+ renamed to TYPE_CODE_STRING.
+ * gdbtypes.c (_initialize_gdbtypes): Add initializations of
+ builtin_type_* types moved from c-lang.c.
+ * gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed
+ to TYPE_CODE_STRING.
+ * gdbtypes.h (builtin_type_string): Add extern declaration.
+ * gdbtypes.h (create_string_type): Add prototype.
+ * m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY
+ renamed to TYPE_CODE_STRING.
+ * m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to
+ TYPE_CODE_STRING.
+ * mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY
+ renamed to TYPE_CODE_STRING.
+ * parse.c (length_of_subexp, prefixify_subexp): Add case for
+ OP_ARRAY.
+ * printcmd.c (print_formatted): Recognize TYPE_CODE_STRING.
+ * typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed
+ to TYPE_CODE_STRING.
+ * valops.c (allocate_space_in_inferior): New function and
+ prototype, using code ripped out of value_string.
+ * valops.c (value_string): Rewritten to use new function
+ allocate_space_in_inferior, but temporarily disabled until some
+ other support is in place.
+ * valops.c (value_array): New function to create array constants.
+ * valprint.c (val_print_string): Add comment to document use,
+ complete rewrite to fix several small buglets.
+ * value.h (value_array): Add prototype.
+ * value.h (val_print_string): Change prototype to match rewrite.
+ * ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING.
+ * ch-exp.y (match_character_literal): Disable recognition of
+ control sequence form of character literals and document why.
+
+Thu Jan 14 15:48:12 1993 Stu Grossman (grossman at cygnus.com)
+
+ * nindy-share/nindy.c: Add comments to #endif's to clarify
+ grouping.
+
+ * hppa-pinsn.c (print_insn): Use read_memory_integer, instead of
+ read_memory to get byte order right.
+ * hppah-tdep.c (find_unwind_info): Don't read in unwind info
+ anymore. This is done in paread.c now. We expect unwind info
+ to hang off of objfiles, and search all of the objfiles when until
+ we find a match.
+ * (skip_trampoline_code): Cast arg to target_read_memory.
+ * objfiles.h (struct objfile): Add new field obj_private to hold
+ per object file private data (unwind info in this case).
+ * paread.c (read_unwind_info): New routine to read unwind info
+ for the objfile. This data is hung off of obj_private.
+ * tm-hppa.h: Define struct obj_unwind_info, to hold pointers to
+ the unwind info for this objfile. Also define OBJ_UNWIND_INFO to
+ make this easier to access.
+
+Wed Jan 13 20:49:59 1993 Fred Fish (fnf@cygnus.com)
+
+ * c-valprint.c (cp_print_class_member): Add extern decl.
+ * c-valprint.c (c_val_print): Extract code for printing methods
+ and move it to cp_print_class_method in cp-valprint.c.
+ * c-valprint.c (c_val_print): Extract code to print strings and
+ move it to val_print_string in valprint.c.
+ * cp-valprint.c (cp_print_class_method): New function using
+ code extracted from c_val_print.
+ * valprint.c (val_print_string): New function using code
+ extracted from c_val_print.
+ * value.h (val_print_string): Add prototype.
+ * ch-exp.y (CHARACTER_STRING_LITERAL): Set correct token type.
+ * ch-exp.y (literal): Add action for CHARACTER_STRING_LITERAL.
+ * ch-exp.y (tempbuf, tempbufsize, tempbufindex, GROWBY_MIN_SIZE,
+ CHECKBUF, growbuf_by_size): New variables, macros, and support
+ functions for implementing a dynamically expandable temp buffer.
+ * ch-exp.y (match_string_literal): New lexer function.
+ * ch-exp.y (match_bitstring_literal): Dynamic buffer code
+ removed and replaced with new CHECKBUF macro.
+ * ch-exp.y (yylex): Call match_string_literal when appropriate.
+ * ch-valprint.c (ch_val_print): Add code for TYPE_CODE_PTR.
+
+Sat Jan 9 19:59:33 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in: Add info for paread.o.
+ * config/hppahpux.mh: Add paread.o to NATDEPFILES.
+
+ * blockframe.c (frameless_look_for_prologue): Correct the
+ comment.
+ * gdbtypes.h, gdbtypes.c: Use const in decl of
+ cplus_struct_default, now that pa-gas assembler has been fixed.
+ * hppah-nat.c: Formatting.
+ * hppah-tdep.c: Remove lots of useless externs for variables we
+ don't use.
+ * (find_unwind_entry): Speed up by using binary search, and a one
+ entry cache.
+ * (rp_saved): New routine to see what unwind info says about RP
+ being saved on the stack frame.
+ * (frame_saved_pc): Look for prologue to see if we need to
+ examine the stack for the saved RP or not.
+ * (init_extra_frame_info): Check for prologue, instead of
+ framesize to determine if we are frameless or not.
+ * (frame_chain_valid): Stop backtraces when we run into _start.
+ * (push_dummy_frame): Reformat to make more readable.
+ * (find_dummy_frame_regs): ditto.
+ * (hp_pop_frame): ditto.
+ * (hp_restore_pc_queue): small cleanup.
+ * (hp_push_arguments): ditto.
+ * (pa_do_registers_info): ditto.
+ * (skip_prologue): New routine created from SKIP_PROLOGUE macro.
+ * tm-hppa.h: Move contents of SKIP_PROLOGUE into hppah-tdep.c.
+ * Define FRAME_CHAIN_VALID.
+ * Turn on BELIEVE_PCC_PROMOTION so that we can access char args
+ passed to functions.
+
+ * paread.c (pa_symtab_read): Use new bfd conventions for
+ accessing linker symbol table.
+ * (pa_symfile_init): Access embedded STAB info via BFD section
+ mechanism and related macros.
+
+
+Sat Jan 9 19:31:43 1993 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-stub.c: Use a seperate stack for our traps.
+ * Handle recursive traps.
+ * Remove all trap init code. This needs to be done by the
+ environment.
+ * (set_mem_fault_trap): Call exceptionHandler() to setup this
+ trap.
+ * (handle_exception): See if we are at breakinst, if so, then
+ advance PC sp that users can just step out of breakpoint().
+ * (case 'G'): Don't let GDB hack CWP. Also, copy saved regs to
+ new place if SP has changed.
+ * (case 's'): Get rid of this, we can't do it yet.
+ * (case 't'): New command to test any old random feature.
+ * (case 'r'): New command to reset the system.
+ * (breakpoint): Add label to breakpoint trap instruction so that
+ handle_exception() can detect where we are and get past the
+ breakpoint trivially.
+
+Thu Jan 7 13:33:06 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * mips-pinsn.c: Actual work now done by opcodes/mips-dis.c.
+
+Thu Jan 7 09:21:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: recognise all sparclite variants
+
+Wed Jan 6 10:14:51 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * symfile.c: If O_BINARY isn't defined, set it to 0, call openp for
+ binary files oring in the right bit.
+
+ * main.c, source.c, state.c, symmisc.c: use macros defined in
+ fopen-{bin|both} when fopening files.
+
+Wed Jan 6 08:19:11 1993 Fred Fish (fnf@cygnus.com)
+
+ * defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT
+ from a configuration file (typically including <limits.h>), or to
+ TARGET_CHAR_BIT if CHAR_BIT is not defined.
+ * eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro.
+ * eval.c (evaluate_subexp): Add case for OP_BITSTRING.
+ * expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro.
+ * exppritn.c (print_subexp, dump_expression): Add case for
+ OP_BITSTRING.
+ * expression.h (OP_BITSTRING): New expression element type for
+ packed bitstrings.
+ * expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New
+ macros to convert between number of expression elements and bytes
+ to store that many elements.
+ * i960-tdep.c (leafproc_return): Use new macros to access
+ minimal symbol name and address fields.
+ * m88k-pinsn.c (sprint_address): Use new macros to access
+ minimal symbol name and address fields.
+ * nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access
+ minimal symbol address field.
+ * parse.c (write_exp_elt, write_exp_string, prefixify_expression,
+ parse_exp_1): Use new EXP_ELEM_TO_BYTES macro.
+ * parse.c (write_exp_string, length_of_subexp, prefixify_expression):
+ Use new BYTES_TO_EXP_ELEM macro.
+ * parse.c (write_exp_bitstring): New function to write packed
+ bitstrings into the expression element vector.
+ * parse.c (length_of_subexp, prefixify_subexp): Add case for
+ OP_BITSTRING.
+ * parser-defs.h (struct stoken): Document that it is used for
+ OP_BITSTRING as well as OP_STRING.
+ * parser-defs.h (write_exp_bitstring): Add prototype.
+ * ch-exp.y (BIT_STRING_LITERAL): Change token type to sval.
+ * ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER,
+ LOWER, LENGTH): New tokens for keywords.
+ * ch-exp.y (chill_value_built_in_routine_call, mode_argument,
+ upper_lower_argument, length_argument, array_mode_name,
+ string_mode_name, variant_structure_mode_name): New non-terminals
+ and productions.
+ * ch-exp.y (literal): Useful production for BIT_STRING_LITERAL.
+ * ch-exp.y (match_bitstring_literal): New lexer support function
+ to recognize bitstring literals.
+ * ch-exp.y (tokentab6): New token table for 6 character keywords.
+ * ch-exp.y (tokentab5): Add LOWER, UPPER.
+ * ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE.
+ * ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX.
+ * ch-exp.y (yylex): Check tokentab6.
+ * ch-exp.y (yylex): Call match_bitstring_literal.
+
+Mon Jan 4 16:54:18 1993 Fred Fish (fnf@cygnus.com)
+
+ * xcoffexec.c (vmap_symtab): Use new macros to access minimal
+ symbol name and value fields.
+
+ * c-exp.y (yylex): Make static, to match prototype and other
+ <lang>-exp.y files.
+
+ * expression.h (exp_opcode): Add BINOP_MOD.
+ * eval.c (evaluate_subexp): Handle new BINOP_MOD.
+ * expprint.c (dump_expression): Handle new BINOP_MOD.
+ * language.c (binop_type_check): Handle new BINOP_MOD.
+ * main.c (float_handler): Re-enable float handler when hit.
+ * valarith.c (language.h): Include, need current_language.
+ * valarith.c (TRUNCATION_TOWARDS_ZERO): Define default macro
+ for integer divide truncates towards zero for negative results.
+ * valarith.c (value_x_binop): Handle BINOP_MOD if seen.
+ * valarith.c (value_binop): Allow arithmetic operations on
+ TYPE_CODE_CHAR variables. Add case to handle new BINOP_MOD.
+ * ch-exp.y (operand_4): Add useful actions for MOD and REM.
+ * ch-exp.y (tokentab3): Add MOD and REM.
+ * ch-exp.y (yylex): Set innermost_block for symbols found
+ in local scopes. Return LOCATION_NAME for local symbols.
+ * ch-lang.c (chill_op_print_tab): Fix MOD entry to use
+ BINOP_MOD instead of BINOP_REM. Add REM entry, using BINOP_REM.
+
+Mon Jan 4 07:35:31 1993 Steve Chamberlain (sac@wahini.cygnus.com)
+
+ * command.c (shell_escape, make_command, _initialize_command):
+ don't create or use fork if CANT_FORK is defined.
+ * serial.h, ser-go32.c: now compiles, but "the obvious problems of
+ code written for the IBM PC" remain.
+ * xm-go32.h: define CANT_FORK
+
+Sun Jan 3 14:24:56 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * remote-sim.c: first attempt at general simulator interface
+ * remote-hms.c: whitespace
+ * h8300-tdep.c: (h8300_skip_prologue, examine_prologue):
+ understand new stack layout. (print_register_hook): print ccr
+ register in a fancy way.
+
+Sun Jan 3 14:16:10 1993 Fred Fish (fnf@cygnus.com)
+
+ * eval.c (language.h): Include.
+ * eval.c (evaluate_subexp_with_coercion): Only coerce arrays
+ to pointer types when the current language is C. It loses for
+ other languages when the lower index bound is nonzero.
+ * valarith.c (value_subscript): Take array lower bounds into
+ account when performing subscripting operations.
+ * valops.c (value_coerce_array): Add comment describing why
+ arrays with nonzero lower bounds are dealt with in value_subscript,
+ rather than in value_coerce_array.
+
+Sat Jan 2 12:16:41 1993 Fred Fish (fnf@cygnus.com)
+
+ * ch-exp.y (FLOAT_LITERAL): Add token.
+ * ch-exp.y (literal): Add FLOAT_LITERAL.
+ * ch-exp.y (match_float_literal): New lexer routine.
+ * ch-exp.y (convert_float): Remove.
+ * ch-exp.y (yylex): Call match_float_literal.
+ * ch-exp.y (yylex): Match single '.' after trying
+ to match floating point literals.
+
+ * eval.c (evaluate_subexp): Add case MULTI_SUBSCRIPT.
+ * expprint.c (print_subexp): Rename BINOP_MULTI_SUBSCRIPT to
+ MULTI_SUBSCRIPT.
+ * expprint.c (dump_expression): New function for dumping
+ expression vectors during gdb debugging.
+ * expression.h (BINOP_MULTI_SUBSCRIPT): Name changed to
+ MULTI_SUBSCRIPT and moved out of BINOP range.
+ * expression.h (DUMP_EXPRESSION): New macro that calls
+ dump_expression if DEBUG_EXPRESSIONS is defined.
+ * m2-exp.y (BINOP_MULTI_SUBSCRIPT): Changed to MULTI_SUBSCRIPT.
+ * parse.c (length_of_subexp, prefixify_subexp): Change
+ BINOP_MULTI_SUBSCRIPT to MULTI_SUBSCRIPT.
+ * parse.c (parse_exp_1): Call DUMP_EXPRESSION before and after
+ prefixify'ing the expression.
+ * printcmd.c (print_command_1): Add comment.
+ * ch-exp.y (expression_list): Add useful actions.
+ * ch-exp.y (value_array_element): Add useful actions.
+ * ch-exp.y (array_primitive_value): Add production.
+ * ch-exp.y (yylex): Recognize ',' as a token.
+
+Fri Jan 1 18:22:02 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: pass prefix and exec_prefix via FLAGS_TO_PASS,
+ POSIXize the recursive makes (make [variable assignments] target{s})
+
+Fri Jan 1 11:56:23 1993 Fred Fish (fnf@cygnus.com)
+
+ * tm-sun4sol2.h (CPLUS_MARKER): Remove, now set in tm-sysv4.h.
+ * tm-sysv4.h (CPLUS_MARKER): By default, g++ uses '.' as the
+ CPLUS_MARKER for all SVR4 systems, so follow suit.
+ * defs.h (strdup_demangled): Remove prototype.
+ * dwarfread.c (enum_type, synthesize_typedef): Use new macro
+ SYMBOL_INIT_LANGUAGE_SPECIFIC.
+ * dwarfread.c (new_symbol): Use SYMBOL_INIT_DEMANGLED_NAME.
+ * minsyms.c (install_minimal_symbols, prim_record_minimal_symbol,
+ prim_record_minimal_symbol_and_info): Use new macro
+ SYMBOL_INIT_LANGUAGE_SPECIFIC.
+ * minsyms.c (install_minimal_symbols): Use new macro
+ SYMBOL_INIT_DEMANGLED_NAME.
+ * stabsread.c (define_symbol): Use new macro
+ SYMBOL_INIT_DEMANGLED_NAME.
+ * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
+ Use new macro SYMBOL_INIT_DEMANGLED_NAME.
+ * symfile.h (ADD_PSYMBOL_VT_TO_LIST): Use new macro
+ SYMBOL_INIT_DEMANGLED_NAME.
+ * symmisc.c (dump_msymbols, dump_symtab, print_partial_symbol):
+ SYMBOL_DEMANGLED_NAME now tests language itself.
+ * symtab.c (COMPLETION_LIST_ADD_SYMBOL): SYMBOL_DEMANGLED_NAME
+ now tests language itself.
+ * symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): New macro that does
+ what SYMBOL_DEMANGLED_NAME used to do, directly access the C++
+ mangled name member in the language dependent portion of a symbol.
+ * symtab.h (SYMBOL_DEMANGLED_NAME): New macro that returns the
+ mangled name member appropriate for a symbol's language.
+ * symtab.h (SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME,
+ SYMBOL_MATCHES_NAME, SYMBOL_MATCHES_REGEXP):
+ SYMBOL_DEMANGLED_NAME now tests language itself.
+ * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): New macro that
+ initializes language dependent portion of symbol.
+ * symtab.h (SYMBOL_INIT_DEMANGLED_NAME): New macro that
+ demangles and caches the demangled form of symbol names.
+ * utils.c (fputs_demangled, fprint_symbol): Use current language
+ to select an appropriate demangling algorithm.
+ * utils.c (strdup_demangled): Remove, no longer used.
+ * symtab.h (SYMBOL_CHILL_DEMANGLED_NAME): New macro that directly
+ access the Chill mangled name member in the language dependent
+ portion of a symbol.
+ * ch-lang.c (chill_demangle): New function, simple demangler.
+ * defs.h (chill_demangle): Add prototype.
+ * symtab.h (language_dependent_info): Add struct for Chill.
+
+For older changes see ChangeLog-1992
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1994 b/contrib/gdb/gdb/ChangeLog-1994
new file mode 100644
index 0000000..68dbcb6
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1994
@@ -0,0 +1,5705 @@
+Fri Dec 30 17:58:55 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * config/m68k/tm-est.h: Remove cruft.
+
+
+Thu Dec 29 22:40:00 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * Allow up to 10 whitespace separated arguments to user defined
+ commands.
+ * top.c (struct user_args): Structure for holding arguments to
+ user defined commands.
+ (print_command_line): Delete unused "tmp_chain" variable. Clean
+ up flow control by having cases exit in the same manner.
+ Before executing a command or evaluating an expression, substitute
+ the current $arg0..$arg9 values if the command/expression uses them.
+ (arg_cleanup): New function.
+ (setup_user_args, locate_arg, insert_args): Likewise.
+ (execute_user_command): Allow arguments to user defined commands.
+
+ * Allow if/while commands to be used within a breakpoint command
+ list.
+ * breakpoint.c (bpstat_do_actions): Call execute_control_command
+ rather than execute_command (passes entire command structure rather
+ than just the command line text).
+ (breakpoint_1): Use "print_command_line" to print a breakpoint
+ command line (including control structures).
+ * gdbcmd.h (execute_control_command): Provide extern decl.
+ (print_command_line): Likewise.
+ * top.c (execute_control_command): No longer static.
+ (print_command_line): New function to recursively print a command
+ line, including control structures.
+
+Thu Dec 29 18:18:31 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * hppa-tdep.c (pa_print_registers): Extract register values stored
+ in big endian format on big and little endian hosts.
+
+ * array-rom.c: Support for Array Tech LSI33k based RAID disk
+ controller board.
+ * configure.in: Recognize "mips*-*-ecoff*" rather than
+ "mips*-idt-ecoff*" so it'll work for the LSI33k.
+
+ * monitor.[ch], op50-rom.c, rom68k-rom.c, w89k-rom.c: Add support
+ to monitor config structure for supported baud rates for a target
+ and variable stop bits.
+ * monitor.c (monitor_fetch_register): Store register values in big
+ endian format on any host.
+
+Wed Dec 28 19:27:22 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Prefer import stubs over
+ export stubs and actual shared library functions so that lazy
+ binding works correctly. Try both __d_plt_call and __gcc_plt_call
+ trampolines for calling import stubs.
+
+Wed Dec 28 15:29:02 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * a29k-tdep.c (pop_frame): Fix a variable name.
+
+Wed Dec 28 12:21:39 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (push_dummy_frame): Refine code to determine what
+ space ID to place in the stack & inf_status structure.
+ (hppa_pop_frame): Don't walk through trampoline code if popping a
+ call dummy frame.
+ (hppa_fix_call_dummy): Call the stack dummy directly if the
+ current PC is in a shared library.
+
+ * hppa-tdep.c (push_dummy_frame): Return type is void. Clear
+ in_syscall bit in flags. Don't depend on the PC queue registers
+ when in_syscall is set, they're not valid.
+ * config/pa/tm-hppa.h (PUSH_DUMMY_FRAME): Pass inf_status down to
+ push_dummy_frame.
+ (SR4_REGNUM): Define.
+
+ * hppa-tdep.c: Misc. lint changes.
+
+Tue Dec 27 12:32:43 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * breakpoint.c (watchpoint_check): Don't bother restoring the
+ "selected" frame anymore, it's not necessary. Initialize the
+ frame cache before trying to find the current frame in the frame
+ chain.
+
+ * somsolib.c (som_solib_add): Return without loading any shared
+ libraries if symfile_objfile is NULL.
+ (som_solib_create_inferior_hook): Likewise.
+
+Fri Dec 23 17:03:13 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote-est.c: New file supports EST-300 CPU32 background
+ mode ICE.
+ * remote-utils.c (sr_com): Call registers_changed.
+ * configure.in (m68*-*-est*): New configuration.
+ * config/m68k/tm-est.h: New file.
+
+Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (CLIBS): Put LIBIBERTY last.
+
+Thu Dec 22 09:27:16 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * ser-tcp.c (tcp_open): Cast to struct sockaddr when passing to
+ function which expects that.
+
+Thu Dec 22 13:25:33 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * nlm/gdbserve.c, nlm/ppc.c, nlm/ppc.h: Don't try to use
+ ALTERNATE_MEM_FUNCS.
+
+Wed Dec 21 14:00:26 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.c: Now supports xmodem as a remoteloadprotocol.
+
+Tue Dec 20 23:01:17 1994 Stu Grossman (grossman@cygnus.com)
+
+ * config/mips/xm-irix4.h, config/mips/xm-irix5.h: #define
+ _BSD_COMPAT to get reliable signal handling.
+
+Tue Dec 20 11:44:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * sparc-tdep.c, a29k-tdep.c, findvar.c (get_saved_register):
+ if !target_has_registers, call error().
+
+ * value.h: Remove obsolete comments about FRAME vs struct
+ frame_info *.
+
+
+Sun Dec 18 11:52:58 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-tdep.c (sparc_pop_frame): Remove erroneous extra argument
+ to write_register.
+
+Sat Dec 17 13:23:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * tm-sparc.c (EXTRA_FRAME_INFO): New field sp_offset.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Set it.
+ (examine_prologue, sparc_init_extra_frame_info): Use ->frame plus
+ ->sp_offset to compute the address something is saved at, not
+ ->bottom.
+
+ * sparc-tdep.c (get_saved_register): New function.
+ * tm-sparc.h: Define GET_SAVED_REGISTER; don't define
+ FRAME_FIND_SAVED_REGS, HAVE_REGISTER_WINDOWS or REGISTER_IN_WINDOW_P.
+ * stack.c (frame_info): Add comment about what to do if
+ FRAME_FIND_SAVED_REGS is not defined.
+
+ * sparc-tdep.c (sparc_init_extra_frame_info): Set ->frame field
+ here. Get it right for flat frames.
+ * sparc-tdep.c (sparc_frame_chain): Instead of returning
+ meaningful value for ->frame field, just return dummy value.
+ This change is needed because the old code didn't deal with mixed
+ flat and non-flat frames.
+
+ * sparc-tdep.c (sparc_pop_frame): Write SP_REGNUM from
+ frame->frame, don't go through saved regs for this.
+
+ * sparc-tdep.c: Move guts of skip_prologue to new function
+ examine_prologue. Check for flat prologue and set is_flat.
+ Provide the caller with the information about what is saved where
+ if desired.
+ (skip_prologue, sparc_frame_find_saved_regs): Call examine_prologue.
+
+ * sparc-tdep.c: Replace union sparc_insn_layout and anonymous
+ union in isannulled, which won't work on a little-endian host,
+ with X_* macros.
+
+ * sparc-tdep.c (sparc_frame_saved_pc): If addr == 0, the saved PC
+ is still in %o7.
+
+ * config/sparc/tm-sparc.h: Define INIT_FRAME_PC and
+ INIT_FRAME_PC_FIRST.
+ * blockframe.c (get_prev_frame_info): Modify comments regarding
+ INIT_FRAME_PC_FIRST and the sparc.
+
+ * sparc-tdep.c (single_step): Use 4 not sizeof (long) for size of
+ instruction.
+
+Sat Dec 17 02:33:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-typeprint.c (c_type_print_base): Use `show' of -1 to print
+ the return type of methods to avoid infinite loops with anonymous
+ types.
+ * valops.c (search_struct_field): Handle anonymous unions.
+
+ * sparc-tdep.c (sunos4_skip_trampoline_code): New function
+ to correctly handle steps into -g compiled PIC objects in the
+ main executable.
+ * config/sparc/tm-sun4os4.h (SKIP_TRAMPOLINE_CODE):
+ Redefine to use sunos4_skip_trampoline_code.
+
+ * dwarfread.c (DWARF_REG_TO_REGNUM): Provide a default mapping
+ from DWARF to GDB register numbering.
+ * dwarfread.c (locval): Use DWARF_REG_TO_REGNUM to map the
+ register value.
+ * config/mips/tm-mipsv4.h (DWARF_REG_TO_REGNUM): Define.
+
+Fri Dec 16 10:56:29 1994 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (uninstall): transform file names.
+
+Thu Dec 15 16:55:35 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * defs.h: Include progress.h.
+ (QUIT): Call PROGRESS.
+ * main.c (main): Call START_PROGRESS and END_PROGRESS, break
+ usage message into shorter strings.
+ * source.c: Change long command help strings into concats of
+ shorter ones, for picky ANSI compilers.
+
+ * top.c (command_loop): For space usage display, show both
+ absolute size and the change from before command execution.
+
+Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h, main.c (gdb_fputs), top.c: Add stream arg to
+ fputs_unfiltered_hook.
+ * defs.h, top.c, utils.c (error): Add error_hook.
+
+Tue Dec 13 15:15:33 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * breakpoint.c, infrun.c, printcmd.c: Change long command help
+ strings into concats of shorter ones, for picky ANSI compilers.
+
+Mon Dec 12 17:08:02 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ Sparc flat register window support.
+ * sparc-tdep.c (sparc_insn_layout): New union, defines layout of
+ instructions symbolically (used to be local to skip_prologue).
+ (sparc_init_extra_frame_info): New function.
+ (sparc_frame_chain): Add flat cases throughout.
+ (skip_prologue): Add recognition of flat prologues.
+ (sparc_frame_find_saved_regs): Add flat cases.
+ (sparc_pop_frame): Ditto.
+ * config/sparc/tm-sparc.h (EXTRA_FRAME_INFO): New slots.
+ (INIT_EXTRA_FRAME_INFO): Call sparc_init_extra_frame_info.
+ (PRINT_EXTRA_FRAME_INFO): Define.
+
+
+Mon Dec 12 13:06:59 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * f-lang.c: Remove duplicate declaration of
+ builtin_type_f_integer, and only include it in the f_builtin_types
+ once.
+
+ * somread.c (som_symfile_read): Just assign to objfile->obj_private,
+ not OBJ_UNWIND_INFO. Assigning to a cast is a GCC-ism which
+ the HP compiler doesn't like.
+
+
+Fri Dec 9 15:50:05 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (remote_wait): Pass string instead of char to strcpy.
+
+Fri Dec 9 04:43:17 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/low-lynx.c (mywait): Remove debugging printf.
+
+Thu Dec 8 15:07:29 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * frame.h: Restore pre-Nov 3 comments about FRAME_FP with minor
+ changes. They are correct, unlike the post-Nov 3 comment
+ (FRAME_FP doesn't have any machine-independent relationship with
+ FP_REGNUM or any other such notion of a "frame pointer").
+
+Wed Dec 7 14:50:54 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * gdbserver/remote-utils.c (write_ok): Write "OK", not "Ok", to
+ match stubs and protocol spec.
+ * gdbserver/remote-utils.c (remote_open): Cast to struct sockaddr
+ when passing to function which expects that.
+
+ The following changes aren't quite enough to make things work with
+ LynxOS (apprently kernel problems).
+ * infrun.c (wait_for_inferior): When resuming new thread, pass pid
+ not -1 for remote case.
+ * thread.c (info_threads_command): Give error if !target_has_stack.
+ * infrun.c (start_remote): Call init_thread_list.
+ * thread.c (info_threads_command): Don't call kill for remote
+ debugging target.
+ * target.c (normal_pid_to_str): Print "thread" not "process" for
+ remote.
+ * remote.c, gdbserver/*: Add 'H', 'S', and 'C' requests, 'X'
+ response, and `thread' part of 'T' response.
+ * gdbserver/*: If program exits, send packet to GDB before
+ exiting. Handle termination with a signal the same as exiting
+ with an exitstatus.
+ * remote.c: Don't try to kill program after getting an 'X'
+ response.
+ * infrun.c (wait_for_inferior): Add comment about kill versus mourn.
+
+Thu Dec 8 12:37:38 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * config/pa/tm-pro.h tm-hppap.h, hppapro.mt: Rename tm-hppap.h to
+ tm-pro.h.
+
+Wed Dec 7 18:22:59 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * source.c: Various cosmetic changes.
+ (forward_search_command): Handle very long source lines correctly.
+
+Wed Dec 7 13:21:47 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * hppa-tdep.c: Use GDB_TARGET_IS_PA_ELF so SOM target support will
+ stop being linked in.
+
+ * config/pa/tm-hppap.h: New file. Set GDB_TARGET_IS_PA_ELF,
+ otherwise it looks like BSD-ELF.
+
+Mon Dec 5 21:43:52 1994 Stu Grossman (grossman@cygnus.com)
+
+ * inftarg.c: include <sys/types.h> to get def of pid_t.
+
+Fri Dec 2 15:03:07 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * solib.c (auto_solib_add_at_startup): New global.
+ (solib_create_inferior_hook): Call solib_add only if
+ auto_solib_add_at_startup is nonzero.
+ (_initialize_solib): New command "set auto-solib-add".
+
+Fri Dec 2 12:52:04 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * parse.c (msymbol_addr_type): Replaced by
+ lookup_pointer_type (builtin_type_void).
+
+ * printcmd.c (_initialize_printcmd): Give examine_*_type
+ a name for `ptype $_'.
+
+Fri Dec 2 12:52:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_formatted): Call val_print_string directly,
+ rather than via value_print.
+
+Wed Nov 30 22:27:27 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (som_solib_get_got_by_pc): New function.
+ * somsolib.h (som_solib_get_got_by_pc): Add extern decl.
+ * hppa-tdep.c (hppa_fix_call_dummy): Handle case where FUN is the
+ function's export stub or real address in a shared library.
+
+Tue Nov 29 13:40:25 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * config/i386/nbsd.mh (REGEX, REGEX1): No longer define.
+
+ * configure.in (i[345]86-*-freebsd*): New configuration.
+ * config/i386/{fbsd.mh,fbsd.mt,nm-fbsd.h}: New files.
+
+Tue Nov 29 12:23:25 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * top.c (read_next_line): Pass annotation suffix "commands"
+ instead of "command", matches documentation.
+
+Mon Nov 28 14:53:21 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/a29k/tm-a29k.h (setup_arbitrary_frame): Replace
+ FRAME_ADDR with CORE_ADDR in prototype.
+
+ * top.c (command_line_input): If annotation suffix is NULL,
+ replace it with an empty string.
+ (read_next_line): Pass "command" as annotation suffix to
+ command_line_input.
+
+Mon Nov 28 11:03:14 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * config/rs6000/tm-rs6000.h (setpgrp): move defn from here...
+ * config/rs6000/xm-rs6000.h: ...to here.
+
+
+Fri Nov 25 21:26:02 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * tm-hppa.h (skip_trampoline_code): Add extern decl.
+ * hppa-tdep.c (hppa_pop_frame): Silently restart the inferior and
+ allow it to execute any return path trampoline code. Stop the
+ inferior and give the user control when the trampoline has
+ finished executing.
+ (in_solib_call_trampoline): Handle export stubs which also perform
+ parameter relocations.
+ (in_solib_return_trampoline): Likewise.
+
+Fri Nov 25 13:37:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * coffread.c, symfile.h (coff_getfilename): Make it static again.
+ * xcoffread.c (coff_getfilename): Use a static copy from
+ coffread.c, modified for accessing the static xcoff strtbl.
+
+Fri Nov 25 00:51:05 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (in_solib_call_trampoline): Recognize calls through
+ _sr4export and $$dyncall as trampolines. Likewise for long-call
+ stubs and parameter relocation stubs.
+ (in_solib_return_trampoline): Recognize a return trampoline for
+ return value relocation stubs.
+
+ * hpread.c: Include hp-symtab.h instead of hpux-symtab.h.
+ Various name changes to match those used by hp-symtab.h.
+
+Thu Nov 24 00:39:27 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * blockframe.c (find_pc_partial_function): Inhibit mst_trampoline
+ symbol special handling when INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK
+ is defined.
+ * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Renamed from
+ IN_SOLIB_TRAMPOLINE. All callers changed.
+ (IN_SOLIB_RETURN_TRAMPOLINE): Provide default definition.
+ (wait_for_inferior): Handle single stepping through trampolines on
+ return paths from shared libraries.
+ * config/pa/tm-hppa.h (IN_SOLIB_CALL_TRAMPOLINE): Use
+ in_solib_call_trampoline.
+ (IN_SOLIB_RETURN_TRAMPOLINE): Use in_solib_return_trampoline.
+ (INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK): Define.
+ * hppa-tdep.c (in_solib_call_trampoline): New function.
+ (in_solib_return_trampoline): New function.
+
+Wed Nov 23 21:43:03 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * tm-h8300.h (REMOTE_BREAKPOINT): Define.
+ * h8300-tdep.c (h8300_pop_frame): Remove redundant call.
+
+ * remote-e7000.c (HARD_BREAKPOINTS): Reenable.
+ (BC_BREAKPOINTS): Disable.
+ * sh-tdep.c (print_insn): Cope with big and little endian machines.
+ * sh/sh.mt: Use libsim.a
+ * sh/tm-sh.h (TARGET_BYTE_ORDER_SELECTABLE): New
+ (BREAKPOINT): Changed to be byteorder independent.
+
+Tue Nov 22 19:13:39 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Maintenance commands to report time and space usage.
+ * main.c (display_time, display_space): New globals.
+ (main): Add argument --statistics to enable reporting, display
+ time and space after startup is done.
+ * maint.c (maintenance_time_display, maintenance_space_display):
+ New commands.
+ * top.c (command_loop): Display time and space after command
+ execution.
+
+ * top.c (pre_init_ui_hook): New global.
+ (gdb_init): If pre_init_ui_hook set, call before all other init.
+
+Tue Nov 22 10:25:59 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * a29k-tdep.c (examine_tag): Fix a bug in stack frame size.
+
+Sat Nov 19 03:10:51 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/i386/i386sol2.mh: Reenable core file support.
+
+ * symfile.c (deduce_language_from_filename): Treat .c++ as a
+ C++ extension.
+
+ * valops.c (destructor_name_p): Do not compare the template
+ part for template classes.
+
+Fri Nov 18 14:55:59 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * defs.h, infcmd.c (reg_names): Don't declare as constant.
+ * remote-mips.c (mips_open): Read and set the processor type.
+ * mips-tdep.c (mips_set_processor_type): Always return an int.
+
+Fri Nov 18 10:38:12 1994 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * nlm/alpha.c (strtol): Remove, it is provided by NetWare C library.
+ * nlm/gdbserve.def (strtol): Add to import list.
+ * nlm/fake_aio.c: Remove file, no longer used.
+
+ * Makefile.in (LD_FOR_TARGET, NLMCONV_FOR_TARGET): Remove.
+ * nlm/Makefile.in (gdbserve.O): Link with ${CC_FOR_TARGET}.
+ (LD_FOR_TARGET): Remove.
+
+Thu Nov 17 22:09:50 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.h, monitor.c, w89k-rom.c, op50n-rom.c, idp-rom.c: Add
+ support for two variables used to control the load protocol and
+ conversion type.
+
+Thu Nov 17 17:51:12 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Support for different MIPS IDT processor models.
+ * mips-tdep.c (mips_processor_type, tmp_mips_processor_type,
+ mips_generic_reg_names, mips_r3041_reg_names,
+ mips_r3051_reg_names, mips_r3081_reg_names,
+ mips_processor_type_table): New globals.
+ (mips_do_registers_info): Don't display register if name is empty.
+ (mips_set_processor_type_command): New command.
+ (mips_show_processor_type_command): New command.
+ (mips_set_processor_type): New function.
+ (mips_read_processor_type): New function.
+ * config/mips/tm-idt.h (DEFAULT_MIPS_TYPE): New macro.
+ * config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): New macro.
+ (NUM_REGS): Increase to account for all CP0 registers.
+ (REGISTER_NAMES): Add empty names for CP0 registers.
+ (FIRST_EMBED_REGNUM, LAST_EMBED_REGNUM): Adjust.
+ (PRID_REGNUM): New macro.
+
+Wed Nov 16 16:41:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * README: Add warning about termcap in Ultrix and OSF/1.
+
+Wed Nov 16 15:28:29 1994 Rob Savoye (rob@cygnus.com)
+
+
+ * hppa-tdep.c: Remove including sys/dir.h from a target file.
+
+Wed Nov 16 10:31:27 1994 J.T. Conklin (jtc@cygnus.com)
+
+ * config/powerpc/gdbserve.mt (TDEPFILES): Remove fake_aio.o.
+
+ * nlm/gdbserve.c: Include <nwtypes.h> before other NetWare headers.
+ * nlm/ppc.c: Likewise.
+
+ * nlm/ppc.c (strtol): Remove, it is provided by NetWare C Library.
+ (StopBell): New function (stubbed out).
+
+Wed Nov 16 00:12:21 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (skip_trampoline_code): Handle shared library import
+ trampolines.
+
+Tue Nov 15 16:18:52 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * c-exp.y (yylex): Fix a bug in template scanning.
+
+Tue Nov 15 14:25:47 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * i386-stub.c, m68k-stub.c, sparc-stub.c, sparcl-stub.c: Mask out
+ the top bit returned by getDebugChar.
+
+Tue Nov 15 01:03:56 1994 Rob Savoye (rob@slipknot.cygnus.com)
+
+ * op50-rom.c, w89k-rom.c, monitor.c: Modify to usr two variables
+ to set remote load type and protocol.
+ * rom68k-rom.c: Add to_stop in target_ops.
+
+
+Sat Nov 12 21:55:47 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c: Add TODO list.
+ (som_solib_add): Immediately return if $SHLIB_INFO$ sections does
+ not exist or has size zero. Slightly simplify error handling.
+ Keep an internal list of all the loaded shared libraries and
+ various tidbits of information about the loaded shared libraries.
+ Build section tables for each loaded shared library and add those
+ tables to the core target if necessary.
+ (som_solib_create_inferior_hook): Force re-reading of shared
+ libraries at exec time.
+ (som_sharedlibrary_info_command): New function for dumping
+ information about the currently loaded shared libraries.
+ (_initialize_som_solib): New function.
+
+Sat Nov 12 02:26:50 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * Makefile.in (copying.o, f-exp.tab.o, dpx2-nat.o, dstread.o,
+ i386aix-nat.o, i386m3-nat.o, irix5-nat.o, lynx-nat.o, m3-nat.o,
+ mipsm3-nat.o, ns32km3-nat.o, remote-e7000.o, remote-os9k.o):
+ Add dependencies.
+ (copying.o, os9kread.o, remote.o): Update dependencies.
+
+ * valarith.c (value_sub): When subtracting pointers, only
+ check for a match of the pointed to element lengths.
+ Cast element length to LONGEST to obtain a signed result for
+ pointer subtractions.
+
+Fri Nov 11 10:51:07 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * ch-exp.y (yylex): Fix off-by-one error when converting string to
+ lowercase. Null terminate new string.
+
+ * hppa-tdep.c (rp_saved): Handle IMPORT stubs too.
+
+ * somsolib.c (som_solib_add): Check the value of __dld_flags, if
+ it indicates __dld_list is not valid return an error. If it
+ indicates that libraries were not mapped privately, issue a
+ warning.
+
+Thu Nov 10 23:17:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symfile.c (syms_from_objfile): Only call find_lowest_section if
+ no ".text" section exists.
+
+Thu Nov 10 15:16:21 1994 Rob Savoye <rob@rtl.cygnus.com>
+
+ * rom68k-rom.c: New file. Replaces the old remote-mon.c and uses
+ the new generic ROM interface in monitor.c.
+ * config/m68k/monitor.mt: Use new ROM support.
+ * monitor.c: Add support for xmodem download protocol.
+
+Wed Nov 9 18:46:24 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * findvar.c (find_saved_register): Fix a frame variable name.
+ * infcmd.c (finish_command): Ditto.
+
+Tue Nov 8 13:20:14 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove "Watchpoints seem not entirely reliable, though
+ they haven't failed me recently." item--this old (4.6 at least)
+ item is too vague to be useful (some watchpoint bugs have been
+ fixed since then).
+ * TODO: Add explanation of "RPC interface" item.
+
+Mon Nov 7 22:25:21 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (read_unwind_info): Use "text_offset" for linker
+ stub unwind descriptors too.
+
+ * Enable backtracing from inside a SOM shared library back into
+ user code.
+ * hppa-tdep.c (internalize_unwinds): Accept and use new
+ "text_offset" argument for dynamic relocation of
+ region_{start,end} fields in the unwind descriptor.
+ (read_unwind_info): Pass text_offset to internalize unwinds.
+
+Mon Nov 7 14:34:42 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m3-nat.c: Remove comments about arbitrary limit in
+ printf_filtered; that limit is gone.
+
+Mon Nov 7 00:27:16 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * Beginnings of SOM shared library support. Breakpoints and
+ single frame backtracing within the library only. Only works when
+ using the HPUX 9 dynamic linker. More functionality to be added
+ soon.
+
+ * somsolib.c, somsolib.h: New files.
+ * Makefile.in (HFILES_NO_SRCDIR): Add somsolib.h
+ (ALLDEPFILES): Add somsolib.c.
+ (somsolib.o): Add some dependencies.
+ * somread.c (som_symtab_read): Accept multiple section offsets.
+ All callers changed. Adjust all text symbols with the first
+ section offset.
+ * symfile.c (find_lowest_section): Enable this function. Add some
+ tie-breaking logic when sections have the same vma.
+ (syms_from_objfile): Use find_lowest_section rather than looking
+ for ".text" by name. Relax warning to only warn if the lowest
+ section is not a code section.
+ * config/pa/{hppabsd.mh, hppahpux.mh} (NATDEPFILES): Add somsolib.o
+ * config/pa/{nm-hppab.h, nm-hppah.h}: Include somsolib.h.
+
+Sun Nov 6 12:54:54 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * partial-stab.h (N_TEXT): Put back GDB_TARGET_IS_HPPA kludge,
+ it is still needed for GCC-2.6 compiled code.
+ * TODO (GDB_TARGET_IS_HPPA): Note this kludge can be nuked
+ sometime after GCC-2.7 has been released.
+
+ * hppa-tdep.c (frame_saved_pc): Mask off low two bits when
+ retrieving the PC from a signal handler caller. Fix thinko
+ in Stan's last change ("frame", should have been "frame->next").
+ If the next frame is a signal handler caller and it's a system
+ call which has entered the kernel ((PSW & 0x2) != 0), then the
+ saved pc is in %r2 instead of %r31.
+
+Fri Nov 4 23:47:07 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (hppa_frame_find_saved_regs): Change "frame" to
+ "frame_info" throughout.
+
+Fri Nov 4 16:26:59 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * sparcl-stub.c: get rid of defs.h.
+
+Fri Nov 4 13:11:54 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * gdbserver/Makefile.in (MMALLOC_CFLAGS): Add -I${MMALLOC_DIR}.
+ Correct definition of MMALLOC_DIR to reflect fact this is
+ gdb/gdbserver/Makefile.in, not gdb/Makefile.in.
+
+ * gdbserver/server.c (main): After we kill the inferior in
+ response to a 'k' request, exit.
+
+ * remote.c (remote_kill): Use catch_errors when calling putpkt.
+ (putpkt): Return int, not void, to match catch_errors calling
+ convention.
+
+Fri Nov 4 10:52:38 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * rs6000-tdep.c (pop_frame): Correct a variable name.
+
+Fri Nov 4 05:43:35 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Re-write item about SIGINT handling to reflect the fact
+ that target_stop now exists.
+
+Thu Nov 3 15:19:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Replace useless FRAME, FRAME_ADDR types with struct frame_info *
+ and CORE_ADDR, respectively.
+ * frame.h (FRAME, FRAME_INFO_ID, FRAME_ADDR): Remove.
+ * blockframe.c (get_frame_info): Remove.
+ * a29k-tdep.c, alpha-tdep.c, blockframe.c, breakpoint.c,
+ breakpoint.h, energize.c, findvar.c, gould-pinsn.c,
+ h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, i386-tdep.c, i960-tdep.c,
+ infcmd.c, inferior.h, infrun.c, m68k-tdep.c, m88k-tdep.c,
+ mips-tdep.c, nindy-tdep.c, printcmd.c, pyr-tdep.c, rs6000-tdep.c,
+ sh-tdep.c, sparc-tdep.c, stack.c, valops.c, z8k-tdep.c,
+ config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
+ config/gould/tm-pn.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/mips/tm-mips.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
+ config/pyr/tm-pyr.h, config/sparc/tm-sparc.h): Replace FRAME with
+ struct frame_info * everywhere, replace FRAME_ADDR with CORE_ADDR,
+ rename variables consistently (using `frame' or `fi'), remove
+ calls to get_frame_info and FRAME_INFO_ID, remove comments about
+ FRAME and FRAME_ADDR cruftiness.
+
+Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com)
+
+ * corelow.c, exec.c, inftarg.c, m3-nat.c, op50-rom.c, procfs.c,
+ remote-adapt.c, remote-e7000.c, remote-eb.c, remote-es.c,
+ remote-hms.c, remote-mips.c, remote-mm.c, remote-mon.c,
+ remote-nindy.c, remote-os9k.c, remote-pa.c, remote-sim.c,
+ remote-st.c, remote-udi.c, remote-vx.c, remote-z8k.c, remote.c,
+ w89k-rom.c, target.c, target.h: Add support for target_stop().
+
+Thu Nov 3 01:23:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * osfsolib.c (solib_map_sections, first_link_map_member,
+ next_link_map_member, xfer_link_map_member): Retrieve and use
+ shared library relocation offset from runtime loader structures.
+ Use libxproc.a routines to get a working version if
+ USE_LDR_ROUTINES is defined.
+ * README: Remove item about shared library relocation for
+ Alpha OSF/1.
+
+Wed Nov 2 15:05:39 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * c-exp.y (yylex): scan template names, and scan nested class
+ names.
+
+Wed Nov 2 11:01:55 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * nlm/Makefile.in: install gdbserve.nlm.
+
+
+Tue Nov 1 13:00:46 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-valprint.c (c_value_print): Check for plain literal `char'
+ target type when suppressing `(char *)' output for strings.
+
+Mon Oct 31 19:19:51 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * coffread.c (coff_symfile_init): Remove unused local abfd.
+ * utils.c [NO_MMALLOC] (mmalloc, mrealloc): Define and use size_t
+ instead of long, for compatibility with mmalloc.h.
+
+Sat Oct 29 02:40:40 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * top.c (line_completion_function): Renamed from
+ symbol_completion_function, takes the line buffer and the
+ point in the line buffer as additional arguments.
+ (readline_line_completion_function): New function, interface
+ between readline and line_completion_function.
+ (init_main): Use it.
+ (complete_command): Use line_completion_function instead of
+ abusing rl_line_buffer. Free completion strings after printing
+ them.
+ * symtab.c (completion_list_add_name): Recheck for duplicates
+ if we intend to add a modified symbol.
+
+ * gdbtypes.h (cplus_struct_type): nfn_fields_total no longer
+ includes the number of methods from the baseclasses.
+ * stabsread.c (attach_fn_fields_to_type): No longer add the
+ number of methods from the baseclasses to TYPE_NFN_FIELDS_TOTAL,
+ the baseclass type might not have been completely filled in yet.
+ * symtab.c (total_number_of_methods): New function to compute
+ the total number of methods for a type, including the methods
+ from baseclasses.
+ (decode_line_1): Use it instead of TYPE_NFN_FIELDS_TOTAL to
+ allocate the symbol array for find_methods.
+
+ * stabsread.c (scan_file_globals): Add default case to minimal
+ symbol type switch, to avoid gcc -Wall warnings.
+
+ * config/rs6000/tm-rs6000.h (INIT_EXTRA_FRAME_INFO):
+ Don't test for zero backchain pointer to recognize a signal
+ handler frame, if read() gets interrupted by a signal, the
+ backchain will be non zero.
+ (SIG_FRAME_FP_OFFSET): Move to here from rs6000-tdep.c,
+ improve comment.
+ (SIG_FRAME_PC_OFFSET): New definition.
+ (FRAME_SAVED_PC): Return saved pc from sigcontext if this
+ is a signal handler frame.
+ * rs6000-tdep.c (function_frame_info): Do not error out
+ if we can't access the instructions.
+
+ * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR):
+ New definition to get the function address from a function pointer.
+ * valops.c (find_function_addr): Use it when calling a user
+ function through a function pointer.
+
+Fri Oct 28 16:16:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (MMALLOC_DIR): New definition.
+ (MMALLOC): Use MMALLOC_DIR.
+ (MMALLOC_CFLAGS): Look in MMALLOC_DIR for mmalloc.h.
+ (OPCODES): Remove gratuitous "./".
+ * defs.h (mmalloc.h): Include.
+ (mmalloc, mrealloc, etc): Remove decls.
+ (cplus_demangle, cplus_demangle_opname): Remove decls.
+
+Wed Oct 26 15:41:07 1994 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h, main.c, top.c: Change sense and name of
+ no_windows variable. Now called use_windows, and defaults to off
+ (for compatibility).
+
+Wed Oct 26 12:20:53 1994 Jim Kingdon <kingdon@cygnus.com>
+
+ * coffread.c (coff_symtab_read): If we get the address from
+ target_lookup_symbol, set the section to -2 not SECT_OFF_BSS.
+ (coff_symtab_read): Set value and section of symbol that
+ process_coff_symbol returns.
+
+Tue Oct 25 09:53:04 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * config/i386/tm-nbsd.h: Enable longjmp support.
+
+Sat Oct 22 03:41:13 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valarith.c (value_binop): Take care of ANSI `value preserving'
+ rule, which was not addressed by the previous change.
+
+ * rs6000-tdep.c (skip_prologue): Handle `mr r31,r1', which is
+ generated by gcc-2.6, as a synonym for `oril r31,r1,0'.
+
+ * TODO: Remove item about RS/6000 shared libraries.
+
+Thu Oct 20 17:35:45 1994 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h, infrun.c (wait_for_inferior), top.c: Call
+ target_wait_hook to allow GUI to handle blocking for inferior. Call
+ call_command_hook in execute_command to provide means for wrapping
+ commands with GUI state change updates.
+
+ * infrun.c (wait_for_inferior): Make sure
+ through_sigtramp_breakpoint is non-null before deleting.
+
+Thu Oct 20 10:26:43 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * config/powerpc/ppc-nw.mt (TDEPFILES): Removed exec.o.
+
+Thu Oct 20 06:56:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (coffread.o): Depend on target.h.
+ (remote-vx.o): Depend on gdb-stabs.h objfiles.h symfile.h $(bfd_h).
+
+Wed Oct 19 22:49:31 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Fix typo.
+
+Wed Oct 19 11:32:15 1994 Jim Kingdon <kingdon@cygnus.com>
+
+ * objfiles.c (objfile_relocate): When relocating ->sections, use
+ objfile not symfile_objfile.
+
+ * symtab.h, minsyms.c (minsyms_sort): New function.
+ * objfiles.c (objfile_relocate): Call it.
+
+ * remote-vx.c (vx_add_symbols): Call breakpoint_re_set.
+
+ * objfiles.c, objfiles.h (objfile_to_front): New function.
+ * remote-vx.c (vx_add_symbols): Call it.
+
+ * coffread.c (coff_symtab_read): Handle common symbols the same
+ way that partial-stab.h does.
+
+Wed Oct 19 21:06:12 1994 Rob Savoye (rob@cirdan.cygnus.com)
+
+ * hppa-tdep.c: Remove include files a.out.h, ioctl.h, and
+ machine/psl.h. These are host files.
+
+Wed Oct 19 15:13:51 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * objfiles.h (struct objfile): Fix comment--minimal_symbol_count
+ does *not* include the terminating NULL msymbol.
+
+Tue Oct 18 20:53:29 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.c (monitor_load_srec,monitor_make_srec): Add an asrecord
+ loader that reads files using BFD and converts it on the fly.
+
+Mon Oct 17 18:52:06 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.c (set_loadtype_command): Fixed so it doesn't core dump.
+ * monitor.c (monitor_load): check the load type and load the file
+ accordingly. Default to gr_load_image().
+ * monitor.c (monitor_load_ascii_srec): Load an ascii file in
+ srecord format by downloading to the monitor.
+ * w89k-rom.c, op50n-rom.c: set supported load types.
+
+Mon Oct 17 10:29:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (ALLDEPFILES): Remove xcoffexec.c.
+ * Makefile.in: Remove xcoffexec.o rule.
+
+ * exec.c (exec_file_command): Add comment.
+
+ Fix data and bss relocation for VxWorks 5.1:
+ * remote-vx.c (vx_add_symbols): New function.
+ (vx_load_command, add_symbol_stub): Call it instead of
+ symbol_file_add.
+ (vx_wait): Remove comment which was wrong to useless.
+ * remote-vx.c: Reindent much of file.
+ * coffread.c (cs_to_section, find_targ_sec): New functions.
+ (process_coff_symbol): Set SYMBOL_SECTION to result
+ from cs_to_section.
+ (coff_symtab_read): Call cs_to_section and deal with result
+ rather than assuming sections are in a certain order. Deal with
+ BSS.
+ * coffread.c: Remove text_bfd_scnum variable.
+
+Sat Oct 15 16:55:48 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * corelow.c: Format to standard.
+ (core_close): Use name instead of bfd_filename.
+
+Fri Oct 14 10:29:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * exec.c (map_vmap): Cast return from xmalloc to its proper type,
+ not to PTR.
+
+ * symfile.c (reread_symbols): Include bfd_errmsg string in error
+ message if bfd_close fails.
+ * exec.c (exec_close), solib.c (clear_solib), corelow.c
+ (core_close), objfiles.c (free_objfile), irix5-nat.c
+ (clear_solib), osfsolib.c (clear_solib), remote-utils.c
+ (gr_load_image): Check for errors from bfd_close.
+ * solib.c (look_for_base), remote-utils.c (gr_load_image),
+ remote-udi.c (download), corelow.c (core_open), symfile.c
+ (symfile_bfd_open), symfile.c (generic_load): Add comment
+ regarding error from bfd_close.
+ * remote-udi.c (download), remote-utils.c (gr_load_image): Add
+ comment about bogus handling of errors from bfd_openr.
+ * exec.c (exec_close): Add comment regarding memory leak and
+ dangling reference to vp->name.
+
+Sat Oct 15 03:43:00 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * eval.c (evaluate_subexp): Make fnptr a LONGEST instead
+ of using longest_to_int.
+
+ * infcmd.c (run_stack_dummy): Reinstate set_current_frame call,
+ mips and alpha targets need the real breakpoint pc for
+ creating the breakpoint frame.
+
+ * stack.c (return_command): Cast return value to the return
+ type of the function from which we return.
+ * values.c (set_return_value): Pass VALUE_CONTENTS unmodified
+ to STORE_RETURN_VALUE.
+
+ * symtab.c (lookup_symbol): Remove search for `static mangled
+ symbols', the search for `static symbols' already looks for
+ mangled and demangled symbols via lookup_block_symbol.
+
+ * valarith.c (value_binop): Use ANSI C arithmetic conversions
+ when performing integral evaluations, implement BINOP_EQUAL and
+ BINOP_LESS.
+ (value_equal, value_less): Use value_binop to perform the
+ comparison if both operands have TYPE_CODE_INT.
+
+ * rs6000-tdep.c (pop_frame): Make sure all registers are valid,
+ as they are written back later. Handle sp restore for frameless
+ functions. Use fdata.nosavedpc instead of fdata.frameless to
+ determine if the pc has been saved.
+ (function_frame_info): Handle `mr r31,r1', which is generated by
+ gcc-2.6, as a synonym for `oril r31,r1,0'.
+ (skip_trampoline_code): Handle shared library trampolines.
+ * xcoffread.c (read_xcoff_symtabs): Record XMC_GL symbols with
+ their real name. Enables setting of breakpoints in shared libraries
+ before the executable is run.
+
+Fri Oct 14 19:39:47 1994 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.h, remote-mon.c: Hack up to so the old ROM monitor
+ interface code still works with the new ROM monitor
+ structures. Fake out a couple of fields.
+
+Fri Oct 14 14:54:37 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * h8500-tdep.c (target_read_sp, target_write_sp, target_read_pc,
+ target_write_pc, target_read_fp, target_write_fp): Rename to
+ h8500_read_sp, etc.
+ (h8500_read_pc, h8500_write_pc): Add pid argument.
+ * config/h8500/tm-h8500.h (TARGET_READ_SP, TARGET_WRITE_SP,
+ TARGET_READ_PC, TARGET_WRITE_PC, TARGET_READ_FP, TARGET_WRITE_FP):
+ Change to match functions above.
+
+Thu Oct 13 13:24:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * NEWS: Add item about if and while.
+
+ * .gdbinit: Restore `end'; it was not excess. Reindent
+ list-objfiles to make this clear. Comment out all of
+ list-objfiles because old gdb's choke on it.
+
+Wed Oct 12 23:19:08 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * config/mips/tm-bigmips64.h: Just define TARGET_BYTE_ORDER and
+ include tm-mips64.h.
+
+Wed Oct 12 18:02:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (ANNOTATE_OBS): New definition.
+ (COMMON_OBS): Add exec.o.
+ (annotate.o): Remove extra compile rule.
+ * config/*/*.mh, config/*/*.mt: Remove exec.o from *DEPFILES lists
+ everywhere.
+
+ * .gdbinit: Remove excess `end'.
+
+ * exec.c: Merge in RS6000 support from xcoffexec.c.
+ (symfile.h, objfiles.h, xcoffsolib.h): Include.
+ (vmap): New global variable.
+ (exec_close): Close and free objects in vmap chain.
+ (exec_file_command) [IBM6000_TARGET]: Set up initial vmap.
+ (bfdsec_to_vmap, map_vmap): Moved here from xcoffexec.c.
+ (exec_files_info): Print vmap information.
+ * xcoffexec.c: Remove.
+ * config/rs6000/rs6000.mt, config/rs6000/rs6000lynx.mt
+ (TDEPFILES): Use exec.o instead of xcoffexec.o.
+ * TODO: Remove pertinent items.
+
+Wed Oct 12 10:08:19 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * partial-stab.h (N_TEXT): Delete GDB_TARGET_IS_HPPA kludge; they
+ are no longer needed as of gcc-2.6.0.
+
+Tue Oct 11 15:51:01 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * lynx-nat.c (child_wait): Correct handling of byte reversed SPARC
+ Lynx wait status.
+ (fetch_core_registers): Don't try to fetch a register if
+ regmap maps it to -1.
+ * sparc-tdep.c (sparc_frame_find_saved_regs): Use FRAME_SAVED_I0
+ and FRAME_SAVED_L0 when setting saved_regs_addr. SPARC Lynx
+ stores the registers in a weird order.
+
+Sat Oct 8 20:59:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * blockframe.c (reinit_frame_cache): Reinstate select_frame call
+ if inferior_pid is nonzero.
+
+Sat Oct 8 04:27:21 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Speed up GDB startup time by not demangling partial symbols.
+ * symfile.h (ADD_PSYMBOL_VT_TO_LIST),
+ symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
+ No longer demangle partial symbols.
+ * symtab.c (lookup_symbol, list_symbols): Handle mangled
+ variables, e.g. C++ static members, via the minimal symbols.
+
+ Handle reordered functions in an objfile, for Irix 5.2 shared
+ libraries.
+ * objfiles.h (OBJF_REORDERED): New bit in the objfile flags,
+ set if the functions in an objfile are reordered.
+ * mdebugread.c (parse_partial_symbols): Detect reordered
+ functions in an objfile.
+ * symtab.c (find_pc_psymtab, find_pc_symtab): Use expensive
+ lookup algorithm if the functions in the objfile are reordered.
+
+ * xcoffexec.c (exec_close): If the current target has a copy
+ of the exec_ops sections, reflect the freeing of the sections
+ in current_target.
+
+ * valops.c (call_function_by_hand): Use `sizeof dummy1', not
+ `sizeof dummy', for constructing the call dummy code.
+
+ * config/sparc/tm-sparc.h: Add PARAMS declarations to all
+ function declarations.
+ * sparc-tdep.c (sparc_pop_frame): Cast result of
+ read_memory_integer to CORE_ADDR when passing it to PC_ADJUST.
+
+ * irix5-nat.c (enable_break): Set breakpoint at the entry point
+ of the executable, to handle the case where main resides in a
+ shared library.
+ * irix5-nat.c (solib_create_inferior_hook): Reset stop_soon_quietly
+ after shared library symbol reading, to get rid of a warning from
+ heuristic_proc_start if the startup code has no symbolic debug info.
+
+ * breakpoint.h (struct breakpoint): Add new fields language
+ and input_radix, to enable breakpoint resetting with the
+ proper language and radix.
+ * breakpoint.c (set_raw_breakpoint): Initialize them.
+ (breakpoint_re_set_one): Use them when resetting the breakpoint.
+ (breakpoint_re_set): Preserve current language and input_radix
+ across breakpoint_re_set_one calls.
+
+ * symtab.c (decode_line_1): Do not build a canonical line
+ specification for `*expr' line specifications.
+
+ * breakpoint.h (bpstat_stop_status): Fix prototype declaration.
+
+Fri Oct 7 08:48:18 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ The point of these changes is to avoid reading the frame pointer
+ and stack pointer during stepping, to speed things up.
+ A. Changes to not select a frame until we need a selected frame:
+ * blockframe.c (flush_cached_frames): Call select_frame (NULL, -1).
+ * infrun.c (wait_for_inferior): Move call to select_frame back to
+ normal_stop. This reverts a change of 13 Apr 94 (it says Jeff
+ Law, but the change was my idea); the only reason for that change
+ was so we could save and restore the selected frame in
+ wait_for_inferior, and now that flush_cached frames clears the
+ selected frame, that should work OK now.
+ B. Changes to not create a current_frame until we need one:
+ * blockframe.c (get_current_frame): If current_frame is NULL, try
+ to create an innermost frame.
+ * sparc-tdep.c (sparc_pop_frame), infcmd.c (run-stack_dummy),
+ infrun.c (wait_for_inferior), thread.c (thread_switch),
+ convex-tdep.c (set_thread_command), a29k-tdep.c (pop_frame),
+ alpha-tdep.c (alpha_pop_frame), convex-xdep.c (core_file_command),
+ h8300-tdep.c (h8300_pop_frame), h8500-tdep.c (h8300_pop_frame),
+ hppa-tdep.c (hppa_pop_frame), i386-tdep.c (i386_pop_frame),
+ i960-tdep.c (pop_frame), m68k-tdep.c
+ (m68k_pop_frame), mips-tdep.c (mips_pop_frame), rs6000-tdep.c
+ (push_dummy_frame, pop_dummy_frame, pop_frame), sh-tdep.c
+ (pop_frame), config/arm/tm-arm.h (POP_FRAME),
+ config/convex/tm-convex.h (POP_FRAME), config/gould/tm-pn.h
+ (POP_FRAME), config/ns32k/tm-merlin.h (POP_FRAME),
+ config/ns32k/tm-umax.h (POP_FRAME), config/tahoe/tm-tahoe.h
+ (POP_FRAME), config/vax/tm-vax.h (POP_FRAME): Don't
+ call create_new_frame.
+ * corelow.c (core_open), altos-xdep.c (core_file_command),
+ arm-xdep.c (core_file_command), gould-xdep.c (core_file_command),
+ m3-nat.c (select_thread), sun386-nat.c (core_file_command),
+ umax-xdep.c (core_file_command): Don't call create_new_frame; do
+ call flush_cached_frames.
+ * blockframe.c (reinit_frame_cache): Don't call create_new_frame
+ or select_frame.
+ C. Changes to get rid of stop_frame_address and instead only
+ fetch the frame pointer when we need it.
+ * breakpoint.c (bpstat_stop_status): Remove argument
+ frame_address; use FRAME_FP (get_current_frame ()).
+ * infrun.c (wait_for_inferior): Don't pass frame pointer to
+ bpstat_stop_status.
+ * infrun.c (wait_for_inferior): Use FRAME_FP (get_current_frame
+ ()) instead of stop_frame_address.
+ * infrun.c (save_inferior_status, restore_inferior_status),
+ inferior.h (struct inferior_status): Don't save and restore
+ stop_frame_address.
+ * inferior.h, infcmd.c, thread.c (thread_switch), m3-nat.c
+ (select_thread): Remove stop_frame_address and uses thereof.
+ D. Same thing for the stack pointer.
+ * infrun.c (wait_for_inferior): Remove stop_sp and replace
+ uses thereof with read_sp ().
+ E. Change to eliminate one nasty little spot where we were
+ wanting to know the frame pointer from before the current step
+ (idea from GDB 3.5, which saved my ass, because my other ideas of
+ how to fix it were very baroque).
+ * infrun.c: Remove prev_frame_address.
+ * infrun.c (wait_for_inferior, step_over_function): Use
+ step_frame_address instead of prev_frame_address.
+ F. Same basic idea for the stack pointer.
+ * inferior.h, infcmd.c: New variable step_sp.
+ * infcmd.c (step_1, until_next_command): Set it.
+ * infrun.c: Remove prev_sp and replace uses by step_sp.
+ * infrun.c (wait_for_inferior): If we get out of the step
+ range, then set step_sp to the current stack pointer before we
+ start going again.
+
+Fri Oct 7 12:17:17 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * top.c (target_byte_order_auto): New static variable.
+ (set_endian): Mention that ``auto'' is permitted.
+ (set_endian_auto): New static function.
+ (show_endian): Change message based on target_byte_order_auto.
+ (set_endian_from_file): New function.
+ (init_main): Add command ``auto'' to endianlist.
+ * exec.c (exec_file_command): Call set_endian_from_file.
+ * defs.h (set_endian_from_file): Declare.
+
+Thu Oct 6 18:10:41 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * nlm/i386.c (flush_i_cache): New function, does nothing.
+ (frame_to_registers, registers_to_frame, set_step_traps,
+ clear_step_traps, do_status): Make non-static.
+
+Thu Oct 6 12:26:42 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * config/mips/tm-mips.h (GDB_TARGET_IS_MIPS64): If not already
+ defined, define as 0.
+ (FIX_CALL_DUMMY): Rewrite to remove presumption that host and
+ target are similar.
+ * config/mips/tm-idt.h (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ * config/mips/tm-idtl.h (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ * config/mips/tm-idt64.h (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ (BREAKPOINT): Remove definition.
+ * config/mips/tm-idtl64.h (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ (BREAKPOINT): Remove definition.
+ * config/mips/tm-mips64.h (GDB_TARGET_IS_MIPS64): Define with a
+ value of 1, rather than without a value.
+ * config/mips/tm-bigmips64.h (GDB_TARGET_IS_MIPS64): Likewise.
+ * mips-tdep.c: Rewrite uses of GDB_TARGET_IS_MIPS64 to switch at
+ run time rather than at compile time.
+
+ * remote-mips.c (break_insn): Remove.
+ (BREAK_INSN, BREAK_INSN_SIZE): Define.
+ (mips_insert_breakpoint): Use BREAK_INSN, not break_insn.
+ (mips_remove_breakpoint): Likewise.
+
+ * defs.h: If TARGET_BYTE_ORDER_SELECTABLE is defined by tm.h,
+ define TARGET_BYTE_ORDER as target_byte_order, and declare
+ target_byte_order as an extern int, and define BITS_BIG_ENDIAN as
+ a test of TARGET_BYTE_ORDER.
+ * top.c: Several additions if TARGET_BYTE_ORDER_SELECTABLE is
+ defined:
+ (endianlist, target_byte_order): New variables.
+ (set_endian, set_endian_big, set_endian_little): New functions.
+ (show_endian): New function.
+ (init_cmd_lists): Initialize endianlist.
+ (init_main): Add commands ``set endian big'', ``set endian
+ little'', and ``show endian''.
+ * a29k-pinsn.c: Rewrite uses of TARGET_BYTE_ORDER and
+ BITS_BIG_ENDIAN to switch at run time rather than at compile time.
+ * coffread.c, dwarfread.c, findvar.c, mips-tdep.c: Likewise.
+ * remote-os9k.c, stabsread.c, valarith.c, valprint.c: Likewise.
+ * values.c: Likewise.
+
+Wed Oct 5 11:41:24 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * nlm/configure.in: ${gdb_host_cpu} defaults to ${host_cpu}.
+
+ * nlm/Makefile.in: Get rid of NWINCLUDES.
+ * config/{alpha,powerpc}/gdbserve.mt: Remove NWINCLUDES.
+ User should now configure with --with-headers.
+
+Mon Oct 3 07:48:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/server.c (main): Silently accept all unrecognized
+ requests and send back a zero length acknowledge. That is what
+ *-stub.c do and is what remote.c expects.
+
+Mon Oct 3 05:11:47 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * corelow.c (core_open): Copy the modified to_sections_end
+ vector from current_target to core_ops too.
+
+ * gdbserver/server.c (main): Silently accept query requests
+ and send back a zero length acknowledge.
+
+Fri Sep 30 17:17:21 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * nlm/Makefile.in: Don't define NWINCLUDES.
+ * config/{alpha,powerpc}/gdbserve.mt: define NWINCLUDES.
+
+Fri Sep 30 15:59:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/low-lynx.c (create_inferior): Pass all 4 args to ptrace.
+
+Fri Sep 30 06:42:42 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * lynx-nat.c (child_wait): Use status.w_status, not status, in
+ arithmetic. status is a `union wait'.
+
+ * config/nm-lynx.h (PTRACE_ARG3_TYPE): Define to int, not char *.
+
+ * lynx-nat.c (child_wait): Pass fourth argument to ptrace.
+
+Thu Sep 29 08:22:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): Fix comment for yesterday's change.
+
+Wed Sep 28 17:48:18 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * coffread.c (complete_symtab): If last_source_file is set upon
+ entry, free it.
+
+Wed Sep 28 08:59:14 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab, case C_FILE):
+ Set main_aux before using it.
+
+ * xcoffexec.c (exec_close): If quitting, don't call clear_symtab_users.
+
+ * xcoffread.c (read_xcoff_symtab): Process XTY_LD symbols we were
+ ignoring before. But continue to ignore XMC_DS.
+
+Wed Sep 28 00:35:23 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hpread_read_array_type): Do not change the type code
+ to TYPE_CODE_PTR for "char foo[]". Just make it a zero length
+ array type.
+
+ * hpread.c (hpread_type_translate): Handle T_UNS_LONG types with
+ lengths other than 32bits (HP C 9.69 represents an "unsigned char"
+ as an T_UNS_LONG with length 8).
+
+ * hpread.c (struct hpread_symfile_info): Delete have_module field
+ and accessor macro. Minor indentation fix.
+ (hpread_build_psymtabs, case K_MODULE): Only start a new psymtab
+ and reset state variables have_name & texthigh if pst is NULL.
+ (hpread_build_psymtabs, case K_SRCFILE): Only reset the name of a
+ partial symbol table if pst is non-NULL. If pst is NULL, then
+ start a new psymtab.
+ (hpread_process_one_debug_symbol, case K_MODULE): Now empty.
+ (hpread_process_one_debug_symbol, case K_SRCFILE): Simplify and
+ correct handling of subfiles.
+
+Mon Sep 26 02:59:00 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * defs.h (misc_command_type): Remove trailing comma from
+ enumerator list.
+
+Sun Sep 25 23:19:58 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (frame_saved_pc): Fix thinko in code to dig saved pc
+ out of an interrupt frame.
+
+Sun Sep 25 12:50:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * infcmd.c (do_registers_info) [INVALID_FLOAT]: Only use if
+ defined.
+ * values.c (unpack_double) [INVALID_FLOAT]: Ditto.
+ * mips-tdep.c (mips_print_register): Don't test float validity.
+ * config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
+ config/arm/tm-arm.h, config/convex/tm-convex.h,
+ config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ config/i386/tm-i386v.h, config/i386/tm-sun386.h,
+ config/i960/tm-i960.h, config/m68k/tm-m68k.h,
+ config/m88k/tm-m88k.h, config/mips/tm-mips.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-nbsd.h,
+ config/ns32k/tm-ns32km3.h, config/ns32k/tm-umax.h,
+ config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
+ config/rs6000/tm-rs6000.h, config/sh/tm-sh.h,
+ config/sparc/tm-sparc.h, config/z8k/tm-z8k.h (INVALID_FLOAT):
+ Remove definition.
+
+Sun Sep 25 06:07:37 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove item about adding general multi-threaded stuff;
+ this is done.
+ Remove item about specifying arbitrary locations of stack frames
+ (this works on some machines).
+ Remove item about debugging functions without a frame pointer
+ (this works on some machines).
+ Remove item about re-writing macros which handle frame chaining and
+ frameless functions. They have been re-written at least once
+ since that item was written.
+ Remove item about gdb catching SIGINT when attached; this is done.
+ Remove item about having list_command not read symbols--why bother?
+
+Sat Sep 24 17:40:10 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * TODO: Append contents of Projects file.
+ * Projects: Remove.
+
+Sat Sep 24 01:47:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * corelow.c (add_solib_stub): Remove copying of to_sections,
+ pass current_target to SOLIB_ADD. The Sep 10 change failed
+ if SOLIB_ADD errored out, or if SOLIB_ADD was trying to access
+ target memory.
+ * corelow.c (core_open): After reading the shared libraries,
+ copy the modified to_sections vector from current_target to
+ core_ops, so that core_close can free it later.
+ * config/rs6000/nm-rs6000.h, rs6000-nat.c (xcoff_relocate_core):
+ Pass down target parameter from SOLIB_ADD and use it instead of
+ directly accessing core_ops.
+
+Fri Sep 23 14:58:49 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * solib.c: *BSD systems need <a.out.h> to be included before
+ <link.h>.
+
+ * i386b-nat.c: Add i386_float_info(), etc.
+ * config/i386/nm-nbsd.h: #define FLOAT_INFO.
+
+ * config/nm-nbsd.h: New file, for generic NetBSD native support.
+ * config/i386/nm-nbsd.h: Use it.
+ * config/sparc/nm-nbsd.h: Use it.
+ * config/ns32k/nm-nbsd.h: Use it.
+
+ * configure.in (i386-*-netbsd): Use config/i386/nbsd.m[ht].
+ (ns32k-*-netbsd): Use config/ns32k/nbsd.m[ht].
+ * config/i386/{nbsd.mh,nbsd.mt,nm-nbsd.h,tm-nbsd.h,xm-nbsd.h}:
+ New files, support for NetBSD/i386.
+ * config/ns32k/{nbsd.mh,nbsd.mh,nm-nbsd.h,tm-nbsd.h,xm-nbsd.h}:
+ New files, support for NetBSD/ns32k.
+
+Tue Sep 20 11:34:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * .gdbinit: Add list-objfiles command.
+
+ * TODO: Reword item regarding NO_STD_REGS.
+
+ * coffread.c (record_minimal_symbol, coff_read_enum_type,
+ coff_read_struct_type): Allocate on symbol_obstack, not directly
+ via malloc/savestring.
+
+Tue Sep 20 15:42:02 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * TODO: Add more items.
+ * tests: Remove the directory and all of its (obsolete) contents.
+
+Tue Sep 20 11:34:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * coffread.c (init_stringtab): When copying length to stringtab,
+ use target format, not host format, since that is what the rest of
+ the code assumes.
+
+Mon Sep 19 15:48:10 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * Makefile.in: Removed prelude.o, i386-nlmstub.o, nlmstub.o,
+ nlmstub.nlm, and nlmstub targets. Removed NWSOURCE and
+ NWINCLUDES definitions.
+ * i386-nlmstub.c: Removed.
+
+Mon Sep 19 07:48:36 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (read_dbx_dynamic_symtab): Cast bfd_asymbol_name to
+ char * (from const char *) before assigning. Don't save string we
+ pass to record_minimal_symbol (it already saves it).
+
+
+Sat Sep 17 02:26:58 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * cp-valprint.c (static_field_print): New variable, controls
+ printing of static members.
+ (_initialize_cp_valprint): New print set subcommand
+ "static-members". Turn on printing of static members by default.
+ (cp_print_value_fields): Print static members if necessary.
+
+ * solib.c: Remove inclusion of libelf.h and elf/mips.h.
+ (elf_locate_base): Use only standard BFD functions to collect
+ information about the .dynamic section. Check for DT_MIPS_RLD_MAP
+ tag only if it got defined via the inclusion of <link.h>.
+
+ * f-exp.y: Write block for OP_VAR_VALUE.
+ * f-valprint.c (info_common_command): Handle `info common'
+ without an argument correctly.
+
+ * c-typeprint.c (c_type_print_base): Handle template constructors.
+ * symtab.c (gdb_mangle_name): Handle template method mangling,
+ get rid of GCC_MANGLE_BUG code, which only applied to gcc-2.2.2.
+
+Fri Sep 16 16:06:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * gdbtypes.h (TYPE_INDEX_TYPE): New macro.
+ * ch-typeprint.c, ch-valprint.c: Use TYPE_INDEX_TYPE.
+ * ch-valprint.c (chill_val_print): Pass index type directly
+ (instead of its TYPE_TARGET_TYPE) to print_type_scalar.
+ * stabsread.c (read_type): Don't set TYPE_FLAG_TARGET_STUB
+ if the index type is a stub.
+
+Fri Sep 16 17:18:44 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/i386/{i386aix.mh, i386bsd.mh, i386lynx.mh, i386sco.mh,
+ i386sco4.mh, i386sol2.mh, i386v.mh, i386v32.mh, i386v4.mh,
+ ncr3000.mh, ptx.mh, ptx4.mh}, config/m68k/{altos.mh, apollo68v.mh,
+ delta68.mh, dpx2.mh, hp300bsd.mh, hp300hpux.mh, m68klynx.mh,
+ m68kv4.mh}, config/m88k/{delta88.mh, delta88v4.mh},
+ config/mips/riscos.mh, config/pa/hppahpux.mh,
+ config/rs6000/rs6000lynx.mh, config/sparc/{sparclynx.mh,
+ sun4sol2.mh}, config/tahoe/tahoe.mh, config/vax/{vaxbsd.mh,
+ vaxult.mh, vaxult2.mh} (REGEX, REGEX1, SYSV_DEFINE): No longer
+ define.
+ * config/i386/i386sco4.mh (MUNCH_DEFINE): No longer define.
+
+Fri Sep 16 15:40:34 1994 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h (QUIT): Call interactive_hook to allow GUI to interrupt.
+ Also, add decl for symtab_to_filename.
+ * source.c (symtab_to_filename): New. Returns the file
+ associated with a symtab.
+ * top.c: Define interactive_hook. Called during QUIT to animate
+ the GUI.
+
+Fri Sep 16 00:14:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * stabsread.c (read_type): Handle stub types for bitstrings.
+ * stabsread.c (read_array_type): Check for stub domain type
+ using TYPE_FLAG_STUB, not its length.
+ * gdbtypes.c (create_set_type): Handle a stub domain type.
+
+ * ch-exp.y: Get rid of some extra non-terminals, and move
+ their rules into primitive_value.
+ * parser-defs.h: Add comment about unary postfix operators.
+ * ch-lang.c (chill_op_print_tab): Add '->', postfix and prefix.
+ * expprint.c (print_subexp): Recognize unary postfix operator.
+
+Wed Sep 14 18:27:42 1994 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * remote-hms.c: use remote_debug instead of hms_silent toggle.
+ Add warnings about depreciation of `snoop' cmd.
+
+Wed Sep 14 18:18:58 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote-hms.c (hms_read_inferior_memory): Cope when
+ target sends both \r and \n.
+
+Wed Sep 14 17:14:57 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * remote-mips.c (mips_error): Place NORETURN macro correctly.
+ * TODO: Add item about START_INFERIOR_TRAPS_EXPECTED.
+
+Wed Sep 14 14:26:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): Fix obsolete comment about
+ mst_solib_trampoline.
+
+ * f-valprint.c (f_val_print): Change cast of valaddr from
+ CORE_ADDR * to char **, since that is how it is used.
+
+ * dbxread.c (read_dbx_dynamic_symtab): Save copy of symbol names
+ using obsavestring, and pass that to prim_record_minimal_symbol.
+ Having the objfile point to bfd_asymbol_name directly doesn't work
+ if we save and restore a mapped symbol file.
+
+
+Tue Sep 13 18:23:26 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * w89k-rom.c, op50-rom.c, monitor.c, config/pa/hppapro.mt: New files
+ to add a generic ROM monitor interface, and support file for the
+ WinBond W89K and the Oki OP50N PA based target boards.
+
+
+Sun Sep 11 22:34:57 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (REGISTER_NAMES): Use r26-r23 for arg0-arg3.
+
+Sun Sep 11 04:36:47 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * irix5-nat.c, osfsolib.c, solib.c (solib_add): Simplify last
+ change by replacing `symbols_added' with `so_last'.
+ * mdebugread.c (parse_external, parse_partial_symbols): Ignore
+ global common symbols, they will be resolved by the runtime loader.
+ * mdebugread.c (parse_symbol, parse_partial_symbols, cross_ref):
+ Handle scSCommon like scCommon symbols.
+
+Sat Sep 10 01:43:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * corelow.c (add_solib_stub): Copy to_sections changes from
+ core_ops to current_target after adding the shared libraries.
+ * partial-stab.h (N_EXCL), dbxread.c (add_old_header_file,
+ find_corresponding_bincl_psymtab): Change `repeated header not seen'
+ error to a complaint, simplify complaint.
+ * procfs.c (signalname, errnoname): Make `name' const.
+ * symfile.c (reread_symbols): Use filename from old BFD to
+ reopen the objfile.
+ * values.c (record_latest_value): Don't record value in the
+ history chain until we are sure there won't be an error.
+
+Fri Sep 9 15:52:09 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * nlm/Makefile.in: remove MMALLOC, READLINE, TERMCAP, and other
+ cruft.
+
+ * config/i386/gdbserve.mt: New file, defs for i386 nlm stub.
+
+Thu Sep 8 17:14:43 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote.c (fromhex): Make error more explicit.
+ (read_frame): Don't print bad checksum information unless
+ remote_debugging. Don't use repeat count unless it's > 0.
+ * remote-e7000.c (expect): When echoing, ignore multiple newlines.
+ (e7000_insert_breakpoint, e7000_remove_breakpoint, target_ops):
+ Optionally cope with BC style breakpoints.
+ (e7000_command): After command send directly to the E7000 mark
+ registers as changed.
+ (why_stop, e7000_wait: Understand BC style stop condition.
+ * sh-tdep.c (sh_skip_prologue): Understand more complicated
+ sequences. (frame_find_saved_regs): Likewise.
+ * config/h8500/tm-h8500.h (target_write_pc, TARGET_WRITE_PC):
+ Handle extra arg.
+ * config/i386/xm-go32.h (GDBINIT_FILENAME): Set to gdb.ini.
+ (more work here to come)
+ * config/sh/tm-sh.h (EXTRA_FRAME_INFO): Add f_offset and leaf_function
+ fields.
+
+Thu Sep 8 16:15:34 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * sparclite/Makefile.in: Assorted stuff needed for eload.
+
+ * sparclite/eload.c: Merge in command line argument parsing and
+ error message handling improvements orignally made to aload.c.
+
+Wed Sep 7 23:24:50 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * defs.h (enum misc_command_type, command_control_type): Enums
+ for describing the command and control types.
+ (struct command_line): Add new fields to keep track of the command
+ type and body associated with the command.
+ * top.c: Include value.h. Delete whitespace at the end of lines.
+ (build_command_line, get_command_line): New functions.
+ (execute_control_command, while_command, if_command): Likewise.
+ (realloc_body_list, read_next_line): Likewise.
+ (recurse_read_control_structure): Likewise.
+ (execute_user_command): Call execute_control_command.
+ (read_command_lines): Simplify by calling read_next_line, call
+ read_control_structure for "if" and "while" commands.
+ (free_command_lines): Free new fields in the command structure.
+ (define_command): Reset control_level to zero.
+ (init_main): Install command handlers for "if" and "while" commands.
+
+Tue Sep 6 16:24:07 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * c-typeprint.c (c_type_print_varspec_prefix,
+ c_type_print_varspec_suffix): Add cases for Fortran type codes.
+ * eval.c (evaluate_subexp): For OP_ARRAY expressions in Fortran,
+ call f77_value_literal_string instead.
+ * f_exp.y: Include <string.h>, move include of parser-defs.h.
+ (parse_number): Translate 'd' floats to 'e' so atof() works.
+ (yylex): Remove unused variables.
+ * f-lang.c: Include <string.h>.
+ (get_bf_for_fcn): Remove unused variable.
+ * f-typeprint.c (f_type_print_varspec_prefix,
+ f_type_print_varspec_suffix): Remove unused
+ variables, add cases to switch statements.
+ (f_type_print_base): Remove unused variables.
+ * f-valprint.c (gdbcore.h, command.h): Include.
+ (f77_get_dynamic_lowerbound, f77_get_dynamic_upperbound):
+ Call read_memory_integer with correct number of arguments.
+ (f77_get_dynamic_upperbound): Call f77_get_dynamic_lowerbound
+ with correct argument type.
+ (f77_print_array): Removed unused array array_size_array.
+ (f_val_print): Don't use a CORE_ADDR as a char *.
+ * valops.c (value_cast): Handle COMPLEX and BOOL types.
+ (value_assign): Handle Fortran literal string and complex values.
+ (f77_cast_into_complex, f77_assign_from_literal_string,
+ f77_assign_from_literal_complex): New functions.
+
+Mon Sep 5 14:46:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-typeprint.c (chill_type_print_base): Make TYPE_CODE_RANGE
+ case more robust.
+
+Sun Sep 4 16:06:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * i960-tdep.c (signal.h): Don't include.
+
+ * cxux-nat.c (target_is_m88110): Remove definition.
+
+ * configure.in (config/nm-empty.h): If cross only, use instead
+ of config/nm-trash.h.
+ * config/nm-trash.h: Remove.
+ * config/nm-empty.h: New file.
+ * config/i386/nm-m3.h: New file, includes config/nm-m3.h.
+ * config/mips/nm-m3.h: New file, includes config/nm-m3.h.
+ * config/m68k/nm-sysv4.h: New file, includes config/nm-sysv4.h.
+ * config/mips/nm-sysv4.h: New file, includes config/nm-sysv4.h.
+ * config/sparc/nm-sysv4.h: New file, includes config/nm-sysv4.h.
+
+
+Fri Sep 2 17:35:55 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * configure.in: No longer look for nm, tm, and xm headers in
+ config/<header>; they are always in config/<cpu>/<header>.
+
+Fri Sep 2 16:40:03 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * objfiles.c (allocate_objfile): Add the newly-created objfile to
+ the end of the list of objfiles, instead of at the beginning.
+
+ * xcoffread.c (allocate_include_entry): New function, abstracted
+ from code in record_include_begin.
+ (record_include_begin, record_include_end): Call it.
+
+ * blockframe.c (reinit_frame_cache): Test inferior_pid instead of
+ target_has_stack to decide whether to create a real stack frame
+ for the cache.
+
+ * coffread.c (process_coff_symbol) [CXUX_TARGET]: Ignore vendor
+ section.
+ * config/m88k/tm-cxux.h (CXUX_TARGET): Define.
+
+ * h8300-tdep.c: Include "dis-asm.h" instead of <dis-asm.h>.
+
+Fri Sep 2 09:51:46 1994 J.T. Conklin (jtc@cygnus.com)
+
+ * config/sparc/tm-nbsd.h: Add #defines to map NetBSD struct and
+ field names into what is expected by sparc-nat.c.
+
+Thu Sep 1 17:32:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * c-typeprint.c (c_typedef_print): Add missing Chill support.
+
+Thu Sep 1 15:41:21 1994 Stu Grossman (grossman@cygnus.com)
+
+ * rs6000-pinsn.c (print_insn): Use powerpc disassembler when
+ doing Power PC.
+ * config/powerpc/tm-ppc-nw.h: Define GDB_TARGET_POWERPC.
+
+ * config/i386/i386lynx.mh, config/m68k/m68klynx.mh,
+ config/rs6000/rs6000lynx.mh, config/sparc/sparclynx.mh: Enable
+ ser-tcp.
+
+ * nlm/Makefile.in: Get rid of NWSOURCE.
+ * nlm/alpha-io.S (inVti, outVti): Remove extraneous ldha's.
+ * nlm/gdbserve.o: Add dummy __main routine.
+ * nlm/gdbserve.def: Turn on debug.
+
+Thu Sep 1 12:36:39 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/xm-nbsd.h: Don't define SET_STACK_LIMIT_HUGE; it is obsolete.
+
+Thu Sep 1 11:01:40 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * config/tm-nbsd.h: New file, support for all NetBSD targets.
+ * config/xm-nbsd.h: fix typo.
+ * config/sparc/{nm,tm,xm}-nbsd.h: New files, renamed from
+ {nm,tm,xm}-sparcnbsd.h to conform to prefered file naming
+ conventions.
+ * configure.in: (sparc-*-netbsd): use config/sparc/nbsd.m[ht].
+
+Wed Aug 31 14:40:33 1994 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * remote-udi.c (udi_read_inferior_memory,udi_write_inferior_memory):
+ change typeo in error msg (`inferrior' -> `inferior').
+
+Wed Aug 31 09:17:02 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * inflow.c (set_sigint_trap, clear_sigint_trap): Check for
+ attach_flag (this check was performed by the callers). Also check
+ inferior_thisrun_terminal.
+ * inftarg.c (child_wait), lynx-nat.c (child_wait),
+ procfs.c (wait_fd), symm-nat.c (child_wait): Don't check
+ attach_flag in deciding whether to call set_sigint_trap and
+ clear_sigint_trap.
+
+ * value.h (struct value): Change literal_data from PTR to char *,
+ since that is the way it is used.
+
+Tue Aug 30 21:56:54 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * somread.c (som_symfile_read): Force unwinds to be re-read after
+ reading in a new partial symbol table.
+
+Tue Aug 30 13:14:16 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/h8500/tm-8500.h (DONT_USE_REMOTE): Remove definition,
+ an obsolete conditional.
+ * config/pa/tm-hppa.h (BREAKPOINT) [KERNELDEBUG]: Remove use,
+ an obsolete conditional.
+ * config/rs6000/rs6000.mh, config/rs6000/rs6000.mt: Clean up
+ comments.
+
+Mon Aug 29 14:39:42 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (ns32k-opcode.h): Remove reference.
+ (ns32k-pinsn.o): Update dependencies.
+ * ns32k-opcode.h: Remove file.
+ * ns32k-pinsn.c (print_insn): Call version in libopcodes, remove
+ all other code in this file.
+
+Mon Aug 29 12:04:07 1994 Stu Grossman (grossman@cygnus.com)
+
+ * nlm/configure.in: Stop using cpu.c. Put it in TDEPFILES instead.
+ * config/alpha/gdbserve.mt (TDEPFILES): Remove alpha-patch.o.
+
+ * nlm/Makefile.in: Add rule for .S.o.
+ * nlm/aio.h: Protect from multiple inclusions.
+ * nlm/alpha-io.S: Remove everything we don't need.
+ * nlm/{alpha-patch.c, alpha-patch.h, alpha-uart.c, alpha-uart.h}:
+ Remove, no longer needed.
+ * nlm/alpha.c: Merge in lots of stuff from previous files.
+ * nlm/alpha.h: Don't #include alpha-patch.h. Make
+ breakpoint_insn extern.
+ * Move stuff from alpha-patch.h into here.
+
+ * config/alpha/gdbserve.mt (TDEPFILES): Get rid of alpha-uart.o.
+
+Mon Aug 29 11:34:34 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * annotate.c (annotate_starting): Flush output.
+
+Sat Aug 27 23:32:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symfile.c (symbol_file_add): Move reinit_frame_cache call to
+ the callers of symbol_file_add. Gets rid of heuristic fence-post
+ warnings on mips and alpha targets when the PC resides in a shared
+ library which is not yet read in.
+ * coff-solib.c (coff_solib_add), cxux-nat.c (add_shared_symbol_files),
+ irix5-nat.c (solib_add), osfsolib.c (solib_add),
+ remote-vx.c (vx_open), solib.c (solib_add):
+ Add call to reinit_frame_cache after all shared libraries are read in.
+ * remote-udi.c (udi_load), remote-vx.c (vx_load_command),
+ symfile.c (symbol_file_command, add_symbol_file_command):
+ Add call to reinit_frame_cache after symbol_file_add.
+
+Wed Aug 24 17:45:14 1994 J.T. Conklin (jtc@cygnus.com)
+
+ * config/xm-nbsd.h: New file, support for all NetBSD ports.
+ * config/sparc/{nm-sparcnbsd.h,tm-sparcnbsd.h,xm-sparcnbsd.h,
+ sparcnbsd.mh,sparcnbsd.mt}: New files, support for NetBSD/sparc.
+ * configure.in: Add sparc-*-netbsd target.
+
+Wed Aug 24 13:17:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * remote-vx.c (vx_attach): Interpret the command argument as an
+ unsigned long.
+
+Wed Aug 24 13:08:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in: Change i[34]86 to i[345]86.
+ * nlm/configure.in: Likewise.
+ * gdbserver/configure.in: Likewise.
+
+Wed Aug 24 09:41:09 1994 J.T. Conklin (jtc@cygnus.com)
+
+ * configure.in (i386-*-netware): Automatically configure nlm
+ subdir.
+
+Tue Aug 23 17:51:13 1994 J.T. Conklin (jtc@cygnus.com)
+
+ * nlm/gdbserve.c: conditionalize header file inclusion for either
+ NetWare 4.0 or PIN targets.
+ * nlm/i386.c: include appropriate header files.
+ * nlm/prelude.c: define TERMINATE_BY_UNLOAD for NetWare 4.0
+ targets.
+
+Tue Aug 23 16:54:16 1994 Stu Grossman (grossman@cygnus.com)
+
+ * nlm/ppc.c (set_step_traps clear_step_traps): Cleanups.
+ * nlm/gdbserve.def: Autoload clib.
+
+Tue Aug 23 12:05:19 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * breakpoint.c (condition_command): Call breakpoints_changed.
+
+ * gdbtypes.h: Declare f77_create_literal_string_type and
+ f77_create_literal_complex_type.
+ * valops.c (f77_value_literal_string, f77_value_substring,
+ f77_value_literal_complex): Use xmalloc not malloc.
+ * valops.c (f77_value_literal_string, f77_value_substring):
+ Make addr char * not CORE_ADDR.
+ * value.h (struct value): Add new field literal_data of aligner union.
+ (VALUE_LITERAL_DATA): Use it.
+ * f-lang.h: Declare find_common_for_function.
+ * value.h, valops.c: Split VALUE_SUBSTRING_START into memaddr and
+ myaddr fields of a union. Don't overload it with the frame field
+ (not sure this is necessary; I'm not sure what lval_* codes
+ VALUE_SUBSTRING_* can be used with).
+
+Mon Aug 22 11:45:01 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/a29k/{a29k-kern.mt,a29k-udi.mt,a29k.mt,ultra3.mh,
+ ultra3.mt}: Clean up comments, remove no-longer-used definitions.
+
+ * rs6000-nat.c: Include libbfd.h again, needed until reference
+ to bfd_cache_lookup is cleaned out.
+
+ * config/i386/linux.mh (XM_CLIBS): Add -lm.
+
+Mon Aug 22 10:42:15 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ Work to reduce the interrupts-off duration when running in DOS.
+ * ser-go32.c: (dos_async_ready): See if anything is in the buffer.
+ (dos_async_rx): rewrite to unpack as many characters from the
+ asynctsr as possible into a local buffer.
+
+Fri Aug 19 14:55:45 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Initial Fortran language support, adapted from work by Farooq Butt
+ (fmbutt@engage.sps.mot.com).
+ * Makefile.in: Add Fortran-related files and dependencies.
+ * defs.h (language_fortran): New language enum.
+ * language.h (_LANG_fortran): Define.
+ (MAX_FORTRAN_DIMS): Define.
+ * expression.h: Reformat to standard.
+ (MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
+ OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
+ * gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
+ TYPE_CODE_LITERAL_STRING): New type codes.
+ (type): New fields upper_bound_type and lower_bound_type.
+ (TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
+ TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
+ macros.
+ (builtin_type_f_character, etc): Declare.
+ * value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
+ * f-exp.y: New file, Fortran expression grammar.
+ * f-lang.c: New file, Fortran language support functions.
+ * f-lang.h: New file, Fortran language support declarations.
+ * f-typeprint.c: New file, Fortran type printing.
+ * f-valprint.c: New file, Fortran value printing.
+ * eval.c (evaluate_subexp): Add code for new expression opcodes,
+ fix wording of error message.
+ * gdbtypes.c (f77_create_literal_complex_type,
+ f77_create_literal_string_type): New functions.
+ * language.c (set_language_command): Add Fortran info.
+ (calc_f77_array_dims): New function.
+ * parse.c (length_of_subexp, prefixify_subexp): Add cases for new
+ expression opcodes.
+ * symfile.c (deduce_language_from_filename): Recognize .f and .F
+ as Fortran source files.
+ * valops.c (f77_value_literal_string, f77_value_substring,
+ f77_value_literal_complex): New functions.
+
+Fri Aug 19 13:35:01 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-typeprint.c (c_print_type): Assume demangled arguments
+ if a '(' is found in varstring, looking for ')' at the end of
+ varstring did fail with demangled const member functions, which
+ have a trailing `const'.
+ * remote.c (get_offsets, putpkt): Change to `char' buffers,
+ to avoid errors when compiling with DEC c89.
+ (remote_wait): Cast to `char *' before passing buffer to
+ fputs_filtered, to avoid errors when compiling with DEC c89.
+ (remote_wait): Do not return inferior_pid by default, this
+ statement is never reached, which causes warnings from some
+ compilers.
+ * stabsread.c (scan_file_globals): Ignore static minimal symbols.
+ * symfile.c (load_command): If called with no argument, try
+ to get the filename from the executable file.
+ (generic_load): Remove check for NULL filename, it is done
+ in load_command now.
+
+Fri Aug 19 10:36:15 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * Makefile.in (ALLDEPFILES): Add hpread.c.
+ (hpread.o): Add dependencies.
+
+ * somread.c: Do not include "aout/aout64.h". SOM has nothing to
+ do with a.out.
+ (BYTES_IN_WORD): Delete.
+ (som_symfile_read): Call hpread_build_psymtabs to build any
+ minimal symbols based on the HP C native debug symbols.
+ (som_symfile_finish): Call hpread_symfile_finish.
+ (som_symfile_init): Call hpread_symfile_init.
+ * config/pa/tm-hppa.h (HPREAD_ADJUST_STACK_ADDRESS): Define.
+ * hppa-tdep.c (hpread_adjust_stack_address): New function.
+
+ * config/pa/hppabsd.mh (NATDEPFILES): Add hpread.o
+ * config/pa/hppahpux.mh (NATDEPFILES): Likewise.
+ * hpread.c: New file.
+
+Fri Aug 19 00:40:55 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (skip_trampoline_code): Revert incorrect change
+ from June 2, 1994 (what was I thinking?!?). Fix it right this
+ time.
+
+Thu Aug 18 17:01:35 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * nlm/i386.c, nlm/i386.h: New files that contain i386 specific code.
+
+Thu Aug 18 14:39:46 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * README: Grammar improvements, clarifications, updates.
+
+Wed Aug 17 23:08:53 1994 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (TARGET_FLAGS_TO_PASS): Pass down LD_FOR_TARGET and
+ NLMCONV_FOR_TARGET. (SUBDIRS): Add nlm target.
+ * configure.in (powerpc-*-netware*): Automatically configure nlm
+ subdir.
+ * nlm/Makefile.in: Add {CC NLMCONV LD}_FOR_TARGET. Remove alpha
+ specific stuff. Make things more configurable.
+ * nlm/configure.in: Add powerpc-*-netware* target. Use
+ gdbserve.mt/cpu.c/cpu.h for target stuff. Get rid of tm/xm/nm.h
+ files.
+ * nlm/gdbserve.c: Move Alpha specific stuff into other files.
+ Remove lots of architecture-specific stuff.
+ * nlm/gdbserve.def: Add new imports.
+ * nlm/ppc.c, nlm/ppc.h: New files that contain PowerPC specific code.
+ * nlm/prelude.c: Don't include libhooks.h, get rid of call to
+ register library.
+ * nlm/prelude.o: What was this doing here?
+ * config/alpha/gdbserve.mt: Defs for alpha nlm stub.
+ * config/powerpc/gdbserve.mt: Defs for PowerPC nlm stub.
+ * config/powerpc/ppc-nw.mt: Defs for PowerPC target for GDB.
+ * config/powerpc/tm-ppc-nw.h: Ditto.
+
+ * nlmstub.def: New file, contains imports for 386 nlm stub.
+
+Wed Aug 17 23:17:33 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * remote-pa.c: New file for HPPA embedded support. Currently it's
+ a copy of remote.c.
+ * config/pa/hppabsd.mt,hppahpux.mt,hppaosf.mt: User remote-pa.c.
+
+Wed Aug 17 13:19:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/m68k/tm-delta68.h (EXTRACT_RETURN_VALUE,
+ STORE_RETURN_VALUE): Define to use %a0 for pointers.
+
+Wed Aug 17 07:43:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-mips.c: Remove unused declaration of mips_load.
+
+Tue Aug 16 16:45:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * coffread.c: General cleanup, and support for section offsets.
+ (time.h, sys/types.h, libbfd.h): Don't include.
+ (cur_src_start_addr, cur_src_end_addr): Rename to
+ current_source_start_addr, current_source_end_addr.
+ (nlist_stream_global): Remove.
+ (nlist_bfd_global): New global variable.
+ (coff_symfile_read): Remove code that gets and uses fileno()
+ directly.
+ (read_coff_symtab, enter_linenos, process_coff_symbol): Add
+ section_offsets parameter, add text/data section offset to
+ appropriate symbols' values.
+ (read_one_sym): Use bfd_read instead of fread.
+ (init_stringtab, init_lineno): Change first parameter to a bfd,
+ use bfd routines instead of raw I/O.
+
+Tue Aug 16 15:24:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.c (decode_line_1): If funfirstline and we get a
+ non-LOC_BLOCK symbol (e.g. variable or type), then error().
+
+ * Makefile.in (TARFILES, NONSRC, SFILES_STAND, SFILES_KGDB):
+ Remove; unused.
+ (TAGFILES_NO_SRCDIR): Remove ALLPARAM.
+ (HFILES_NO_SRCDIR): Remove all files in config sub-directory.
+ (TAGS): Also pass result of find on config sub-directory to etags.
+ (ALLPARAM): Remove; now unused.
+
+Sun Aug 14 13:05:26 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.13.1
+ * NEWS, README: Update to match gdb 4.13 release version.
+
+Sat Aug 13 08:22:50 1994 Fred Fish (fnf@cygnus.com)
+
+ Harris CX/UX support, from Bob Rusk (rrusk@mail.csd.harris.com).
+ * cxux-nat.c: Remove dangling #else block.
+ (m88k_harris_core_register_addr): New function.
+
+ * environ.c (init_environ): If no environment, do nothing.
+
+Fri Aug 12 19:30:53 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Delete rest of TODO list. Do not include "libbfd.h",
+ <time.h>, <sys/types.h>, "demangle.h", <sys/file.h>,
+ "expression.h", "language.h", "gdbtypes.h", "demangleh".
+ Move all global variables into the private symbol table structure
+ and add accessor macros. Update some comments.
+ (hpread_build_psymtabs): Delete dbsubc_addr, we don't need it.
+ (hpread_end_psymtab): New function to end a partial symbol table,
+ all callers changed (no more bogus sharing with dbxread.c).
+
+Fri Aug 12 15:52:37 1994 Stu Grossman (grossman@cygnus.com)
+
+ * remote.c (remote_wait): Return inferior_pid instead of 0 for
+ `W` message.
+
+Fri Aug 12 11:47:10 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * sparclite/aload.c (sys_error, error): Use vfprintf for variable
+ argument lists.
+
+Thu Aug 11 04:06:42 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * defs.h (concat, basename, buildargv, freeargv, strerrno, strsigno,
+ errno_max, signo_max, strtoerrno, strtosigno): Delete.
+ Include "libiberty.h" instead.
+
+Wed Aug 10 13:23:47 1994 Rick Sladkey (jrs@world.std.com)
+
+ * i386v-nat.c (i386_insert_nonaligned_watchpoint):
+ add additional argument specifying raw address to permit
+ proper release of debug registers.
+ (i386_insert_watchpoint, i386_insert_aligned_watchpoint):
+ change all callers.
+
+Wed Aug 10 16:13:45 1994 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h, top.c: Use `extern' in declarations of GUI hooks, and
+ define them in top.c. Add comments to the hooks.
+
+Wed Aug 10 15:57:43 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * remote-sim.c (gdbsim_ops): Set `to_insert_breakpoint' and
+ `to_remove_breakpoint' fields.
+
+Wed Aug 10 15:46:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infcmd.c (run_command): Remove comment suggesting using
+ target_has_execution instead of inferior_pid.
+
+Wed Aug 10 10:33:20 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * remote-mips.c (mips_open): add code to handle baud rate.
+
+Tue Aug 9 09:44:42 1994 Stu Grossman (grossman@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Call target_resume() upon
+ detection of new processes.
+
+ * procfs.c (create_procinfo): Return pointer to new procinfo
+ structure.
+ * (do_detach): Spacing & formatting cleanup.
+ * (procfs_wait): Move wait_again label to ensure that we really
+ wait again. On exit from fork, release new child from gdbs'
+ clutches.
+ * (procfs_set_sproc_trap): Enable trapping of fork and vfork.
+
+Mon Aug 08 15:34:13 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hpread_process_one_debug_symbol): Fix block scoping
+ problem (losing localvars on the close-brace instead of after
+ the close brace).
+
+Mon Aug 8 15:09:32 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * i386-nlmstub.c (handle_exception): Wait until the thread has
+ been started before killing the NLM by pointing the PC at
+ _exit().
+
+Sat Aug 6 22:27:30 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-irix5.h (IN_SIGTRAMP): Redefine for Irix 5,
+ Irix 5 has a standard _sigtramp signal handler.
+ * irix5-nat.c (solib_add): Get rid of sigtramp_address handling,
+ it is not needed for a standard _sigtramp signal handler.
+ Add shared library sections to the section table of the target
+ before adding the symbols.
+ * mips-tdep.c (mips_skip_prologue): Do not skip load immediate
+ instructions that do not prepare a stack adjustment.
+ * regex.c (SIGN_EXTEND_CHAR): Update to emacs-19.25 definition,
+ which does the right thing on machines where `char' is unsigned.
+
+Fri Aug 5 17:50:59 1994 Stu Grossman (grossman@cygnus.com)
+
+ * remote.c (remote_open): Move setting of inferior_pid prior to
+ call to remote_start_remote. Also use unique value for pid to
+ avoid confusion with read_register_pid & friends.
+ * (remote_wait): Return inferior_pid instead of 0 in all cases.
+
+Fri Aug 5 12:23:02 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * dwarfread.c (bfd.h): Don't include.
+
+Fri Aug 5 09:08:34 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * i386-nlmstub.c (handle_exception): Point the PC at _exit() to
+ kill the program being debugged. KillMe(), the undocumented
+ call intended for this purpose, causes the server to hang.
+
+Thu Aug 4 16:26:06 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote.c (read_frame): Calculate run length encoded checksum
+ correctly.
+ * config/sh/stub.c: New file.
+
+Thu Aug 4 14:34:12 1994 Stu Grossman (grossman@cygnus.com)
+
+ * target.c (find_default_run_target): Make sure to_can_run is set
+ before calling it.
+
+Thu Aug 4 11:46:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove note about fast watchpoints and remove obsolete
+ Mach stuff.
+
+Thu Aug 4 11:08:03 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/i386/xm-i386v4.h, config/m68k/xm-m68kv4.h,
+ config/sparc/xm-sun4sol2.h (NORETURN): Don't define.
+ * config/m88k/tm-cxux.h (ARCH_NUM_REGS): Undefine before defining.
+
+Thu Aug 4 10:26:36 1994 Stu Grossman (grossman@rtl.cygnus.com)
+
+ * target.c (add_target): Don't call clean_target on target
+ vectors anymore.
+ * (unpush_target): Test for to_close being set before calling.
+ * (target_xfer_memory, target_info): Check for to_has_memory
+ before playing with memory.
+
+ * remote.c (remote_open): Set inferior_pid to make kill command
+ happy.
+ * inflow.c (kill_command): Revert change of Aug 2. Use
+ inferior_pid to determine whether to print out "The program is not
+ being run." message.
+
+Thu Aug 4 07:55:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/i386m3.mh (NAT_CLIBS): Add -lmachid and -lnetname.
+ * m3-nat.c, config/nm-m3.h: #if 0 REQUEST_QUIT stuff.
+ * m3-nat.c: Pass argument to return_to_top_level.
+ Declare m3_kill_inferior before use.
+ (port_chain_insert): In "can't happen" case, abort rather than
+ setting `mid' to large decimal constant (which gcc warns about).
+ (get_thread_name): Use cast to convert const char * to char *.
+ (add_mach_specific_commands): #if 0 "thread break" command.
+ (m3_trace_him): Call push_target.
+ (mach_really_wait): New argument pid; remove unused
+ variable pid.
+ (intercept_exec_calls): Call target_terminal_init and
+ target_terminal_inferior once the child execs.
+ * infrun.c (proceed): Pass argument to PREPARE_TO_PROCEED.
+
+Wed Aug 3 22:41:13 1994 Tom Lord (lord@x1.cygnus.com)
+
+ * procfs.c (procfs_mourn_inferior): don't dereference the
+ procinfo pointer after it has been freed.
+
+Wed Aug 3 12:05:13 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Improve pluralization in display
+ of breakpoint hit counts.
+
+ * language.h (struct language_defn): Remove unused field
+ la_longest_float.
+ (longest_float): Remove, no longer used.
+ * language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn): Remove init of la_longest_float field.
+ * c-lang.c (c_language_defn, cplus_language_defn,
+ asm_language_defn): Ditto.
+ * ch-lang.c (chill_language_defn): Ditto.
+ * m2-lang.c (m2_language_defn): Ditto.
+
+Tue Aug 2 10:58:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * defs.h (bfd_read, bfd_seek): Remove declarations.
+ * os9kread.c, rs6000-nat.c (libbfd.h): Don't include.
+
+Tue Aug 2 09:50:50 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * inflow.c (kill_command): Fix a bug which prevented target
+ programs to be killed.
+
+Mon Aug 1 18:48:47 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * defs.h: Change two-line declarations to one-line form.
+ (NORETURN): Define as "volatile" only for older GCCs.
+ (ATTR_NORETURN): Define for newer GCCs.
+ * procfs.c (proc_init_failed): Add ATTR_NORETURN to declaration.
+
+Mon Aug 1 16:43:24 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (mention), main.c (fputs_unfiltered): Add comments.
+ * breakpoint.c (delete_breakpoint, enable_breakpoint,
+ disable_breakpoint): Don't call breakpoints_changed; it is now
+ called via the *_breakpoint_hook functions.
+ * annotate.c (_initialize_annotate, breakpoint_changed): New functions.
+
+Mon Aug 1 13:38:04 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * stabsread.c (read_type): Fix a bug in enum size calculation.
+
+Mon Aug 1 01:36:13 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (compare_unwind_entries): Add "const" to both
+ argument types to shut up GCC.
+
+ * hppa-tdep.c (saved_pc_after_call): If the saved PC is in a
+ linker stub, then return the address the stub will return to.
+ (frame_saved_pc): Correctly restart the search for the saved
+ pc when a linker stub is encountered.
+
+ * hppa-tdep.c (inst_saves_gr): Handle 16 and 8 bit instruction
+ register stores emitted by the version 9 HP compilers.
+ (inst_saves_fr): Relax test for a specific base register (%r1);
+ this avoids losing with the version 9 HP compilers.
+ (skip_prologue): Try to skip argument stores emitted by the HP
+ compilers. It's not perfect, but it's better than before.
+
+Fri Jul 29 23:20:30 1994 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (write_pc write_pc_pid): Remove casts to long when
+ calling write_register_pid.
+ * (write_register_pid): Add prototype.
+
+Fri Jul 29 21:56:23 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * remote.c (read_frame): Split readchar/checksum calculation into
+ two parts since evaluation order is undefined.
+
+Fri Jul 29 13:46:08 1994 Fred Fish (fnf@cygnus.com)
+
+ From Kevin A. Buettner (kev@cujo.geg.mot.com).
+ * Makefile.in (coredep.o): Add inferior.h as dependency.
+ * inflow.c: Add F_SETOWN to list of defines to check
+ around code that uses F_SETOWN.
+
+Fri Jul 29 09:59:05 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): If using newlib,
+ set the -L and -B directory prefixes so we can link with it.
+
+Thu Jul 28 14:37:36 1994 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (INSTALLED_LIBS, CLIBS, DEPFILES): Add support for
+ --enable-xxx configure option by adding ENABLE_{CLIBS DEPFILES}
+ where appropriate.
+
+ * General hackery to support alternate user-interface.
+ * breakpoint.c (mention, delete_breakpoint, enable_breakpoint,
+ disable_breakpoint): Call hooks for alternate user-interface.
+ * defs.h: Add declarations for alternate user-interface hooks.
+ * main.c (main): Add --nw (and --nowindows) options to disable
+ the GUI.
+ * (near call to command_loop): Call command_loop_hook if set.
+ * (fputs_unfiltered): Call fputs_unfiltered_hook if set.
+ * stack.c: Call print_frame_info_listing_hook if set.
+ * top.c (gdb_init): Initialize targets.c and utils.c prior to
+ other files to make sure that calls to error and warning will
+ work. Call init_ui_hook after everything else.
+ * utils.c (query): Call query_hook if set.
+ * (gdb_flush): Call flush_hook if set.
+ * Change _initialize_utils to initialize_utils cuz we don't use
+ automatic initialization of utils.c anymore.
+
+
+ * remote.c: Get rid of #ifdef DONT_USE_REMOTE. It's no longer
+ necessary.
+
+Thu Jul 28 14:52:01 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Use newlib if it is
+ there and we are using the gcc from the tree.
+ (LD_FOR_TARGET): Look for ld in ../ld/ld.new.
+
+Thu Jul 28 10:43:36 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (annotate.o): Add dependencies.
+
+Wed Jul 27 14:34:42 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * sparclite/aload.c: Added new -q (quiet) option.
+ return 0 exit status if file was successfully downloaded.
+
+ * nlm/gdbserve.c: merge in command line argument parsing changes
+ and bug fixes made to i386-nlmstub.c.
+
+ * i386-nlmstub.c: The returnLength field must be initialized
+ before portConfig is passed to AIOGetPortConfiguration.
+ Compare command line arguments with strnicmp(); args are
+ case insensitive on netware.
+
+Wed Jul 27 09:24:19 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (DISTSTUFF): Add definition.
+ (diststuff): Add for new distribution support.
+ (gdb.tar.Z, make-proto-gdb.dir, setup-to-dist,
+ gdb-$(VERSION).tar.Z, make-proto-gdb-1, make-proto-testsuite.dir):
+ Remove old distribution building rules, now uses standard
+ distribution support in parent directory Makefile.in.
+
+Tue Jul 26 14:15:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.c (push_target): Cast result from xmalloc.
+
+Tue Jul 26 18:20:46 1994 Paul Flinders (ptf@smee)
+
+ * elfread.c (elf_symtab_read): Discard compiler labels generated
+ by the Solaris 2.1/Intel SunPro compiler.
+
+Mon Jul 25 18:19:24 1994 Stu Grossman (grossman@cygnus.com)
+
+ * target.c (nomemory): Fix prototype and routine to take correct
+ args.
+
+Mon Jul 25 15:38:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (clean): Remove libgdb-files.
+
+Mon Jul 25 11:50:57 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * coredep.c: Include inferior.h.
+
+Mon Jul 25 11:36:02 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * i386-nlmstub.c: Add support for NODE, PORT and BAUD command
+ line arguments.
+
+Sat Jul 23 14:36:09 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * symfile.c (deduce_language_from_filename): Recognize .S as asm,
+ .cp as C++, alphabetize better.
+
+ * breakpoint.c (ignore, condition): Move usage note into body of
+ help text, so first line can be one-line summary.
+
+Sat Jul 23 00:58:15 1994 Stu Grossman (grossman@cygnus.com)
+
+ * target.c (unpush_target): Fix handling of removal of top target.
+
+Fri Jul 22 17:30:39 1994 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in: Add stuff to build nlmstub.
+ * Add rule for annotate.o to keep Sun make happy.
+ * configure.in: Add config for powerpc/Netware.
+
+ * partial-stab.h (near N_SO): Don't call START_PSYMTAB with null
+ filename. This speeds up handling of trailing N_SO stabs (they
+ mark the end of a .o file).
+
+ * target.c, target.h: Change the way pushing and popping of
+ targets work to support target overlays and inheritance.
+ * corelow.c, hppa-tdep.c, inflow.c, remote-nindy.c, utils.c:
+ Fixup references to current_target, due to previous changes.
+
+ * config/i386/tm-i386nw.h: Enable longjmp support. More work is
+ needed to get the address of longjmp out of the target.
+
+Tue Jul 19 13:25:06 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * main.c: Include <ctype.h>.
+
+Mon Jul 18 15:32:17 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * remote-mips.c (mips_readchar): Fix a bug in checking <IDT>
+ prompt.
+
+Mon Jul 18 14:26:35 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * solib.c (look_for_base): Don't deref exec_bfd if NULL.
+
+Sun Jul 17 15:38:36 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.12.4.
+
+Sun Jul 17 12:20:35 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Harris CX/UX support, from Bob Rusk (rrusk@mail.csd.harris.com).
+ * configure.in (m88*-harris-cxux*): New configuration.
+ * cxux-nat.c, config/m88k/cxux.mh, config/m88k/cxux.mt,
+ config/m88k/xm-cxux.h, config/m88k/tm-cxux.h, config/m88k/nm-cxux.h:
+ New files.
+ * config/m88k/tm-m88k.h: Add comment about Harris OS.
+ (TARGET_WRITE_PC): Pass pid through to register writers.
+
+ * configure.in (m68*): Put vendor-only-specified host configs
+ after vendor-and-os-specified configs.
+ (m68*-atari-sysv4*, m68*-cbm-sysv4*): Replace with m68*-*-sysv4.
+
+ * config/m88k/delta88.mh (MUNCH_DEFINE): Remove.
+ * config/m88k/delta88.mt, config/m88k/delta88v4.mh: Format
+ consistently.
+
+Sat Jul 16 23:39:17 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfread.c (elf_symtab_read): Handle error return from
+ bfd_get_dynamic_symtab_upper_bound gracefully.
+
+Sat Jul 16 14:43:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * inferior.h (ARCH_NUM_REGS): New macro, actual number of
+ registers in use by the inferior.
+ * coredep.c (fetch_core_registers, register_addr): Use it.
+ * findvar.c (registers_changed, registers_fetched,
+ read_register_bytes): Ditto.
+ * infcmd.c (do_registers_info, registers_info): Ditto.
+ * infptrace.c (fetch_inferior_registers,
+ store_inferior_registers): Ditto.
+ * stack.c (frame_info): Ditto.
+
+ * coredep.c (CORE_REGISTER_ADDR): New macro.
+ (fetch_core_registers): Use it.
+
+ * breakpoint.c (ignore, condition): Add usage notes to help strings.
+ * symfile.c (add-symbol-file): Add usage note to help string.
+ (add_shared_symbol_files_command): New command.
+
+ gcc -Wall lint.
+ * inferior.h (read_pc_pid): Declare.
+ * breakpoint.c (watchpoint_check): Cache breakpoint in local
+ variable b, remove unused variable other_type_used.
+ * main.c (inferior.h, call-cmds.h): Include.
+ (gdb_init): Declare.
+ * remote.c (remote_wait): Return 0 by default.
+
+Fri Jul 15 16:43:33 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Stop printing at null char option, from Oliver Meyer
+ (omeyer@i3.informatik.rwth-aachen.de).
+ * valprint.h, valprint.c (stop_print_at_null): New global.
+ * valprint.c (_initialize_valprint): New print set subcommand
+ "null-stop".
+ * c-valprint.c (c_val_print): If stop_print_at_null is on, and
+ printing a char array, adjust the number of chars to print.
+
+Fri Jul 15 14:33:40 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ From Kevin A. Buettner (kev@cujo.geg.mot.com).
+ * m88k-tdep.c (examine_prologue): Modified to handle prologues for
+ pic code in addition to prologues where an instruction from the
+ prologue gets moved into the delay slot of a branch instruction
+ immediately following the prologue. A table of potential prologue
+ instructions (prologue_insn_tbl) is now used for picking apart a
+ function prologue.
+ (frame_find_saved_regs): Changed the way in which limit gets set
+ so that the delay slot of branch instructions immediately
+ following the prologue gets examined.
+ (pushed_size, store_parm_word, store_parm, push_parameters,
+ collect_returned_value): Deleted.
+
+Fri Jul 15 01:06:00 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Handle stepping into leaf
+ functions whose prologue consists of gp loading code only.
+
+Thu Jul 14 14:22:12 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * dbxread.c: Don't include libbfd.h.
+ * dwarfread.c, elfread.c somread.c: Don't include libbfd.h,
+ <time.h>, or <sys/types.h>.
+ * elfread.c (elf_symfile_read): Use only standard BFD functions to
+ collect information about the stab and stab string sections.
+
+Thu Jul 14 13:17:39 1994 Kung Hsu (kung@x1.cygnus.com)
+
+ * stabsread.c (read_huge_number): handle large unsigned number
+ for stabs generated by os9k C compiler.
+
+Wed Jul 13 18:58:15 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Breakpoint hit counts, from Bob Rusk (rrusk@mail.csd.harris.com).
+ * breakpoint.h (hit_count): New breakpoint field.
+ * breakpoint.c (show_breakpoint_hit_counts): New variable.
+ (clear_breakpoint_hit_counts): New function.
+ (bpstat_stop_status): Increment the hit count.
+ (breakpoint_1): Display the hit count.
+ * infcmd.c (run_command): Reset breakpoint hit counts.
+ * target.c (generic_mourn_inferior): Don't clear ignore counts if
+ displaying hit counts.
+
+Tue Jul 12 12:23:15 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfread.c (elf_symfile_read): Unconditionally add dynamic
+ symbols for all symbol files. Makes skipping over the
+ trampoline code work when stepping from a function in a shared
+ library into a function in a different shared library for Irix 5.
+ Other ELF targets do not have enough information in their
+ dynamic symbol tables to make this work.
+ (elf_symtab_read): Relocate mst_solib_trampoline address.
+
+Mon Jul 11 16:38:49 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Atari support, from Uwe Seimet (seimet@chemie.uni-kl.de).
+ * configure.in (m68*-atari-sysv4*): New configuration.
+ (m68*-cbm-sysv4*): Use m68kv4 instead of amix.
+ * m68k-tdep.c (R_PS): Define as R_SR if necessary.
+ * config/m68k/m68kv4.mh, config/m68k/m68kv4.mt,
+ config/m68k/tm-m68kv4.h, config/m68k/xm-m68kv4.h: New files.
+ * config/m68k/amix.mh, config/m68k/amix.mt,
+ config/m68k/tm-amix.h, config/m68k/xm-amix.h: Removed, superseded
+ by m68kv4 files.
+
+Sat Jul 9 16:28:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.c (find_function_start_sal): New function to find
+ the start of a function from a function symbol.
+ (decode_line_1, decode_line_2): Use it instead of open coded
+ partial copies of the code.
+ (list_symbols): Quote symbol name before passing it to
+ break_command to enable proper handling of mangled symbols.
+
+Wed Jul 6 20:22:07 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-exp.y (match_simple_name_string): Don't lower-case here.
+ * ch-exp.y (yylex): First try name lookup using exact name
+ typed by user; if that fails, try lower-cased name.
+
+Wed Jul 06 12:39:07 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: More cleanups. Delete lots of trailing whitespace.
+ Remove some items from the TODO list and notes throughout code
+ for things which need fixing. Add more comments.
+ Document bogus struct symloc sharing with dbxread.c. Delete more
+ useless variables. Add more PARAM prototypes. Fixup more
+ indention problems that have crept in.
+ (SET_NAMESTRING): Accept new namep and objfile arguments so that
+ it doesn't depend on the variable names on the procedures it's
+ used from.
+ (hpread_symfile_init): Delete incorrect checks for bogus sizes of
+ the debug sections.
+
+Wed Jul 6 00:48:57 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c, elfread.c, mipsread.c, nlmread.c, os9kread.c:
+ Move "no debugging symbols found" test to symfile.c.
+ * symfile.c (syms_from_objfile, reread_symbols): Add
+ "no debugging symbols found" test.
+ * coffread.c (init_stringtab): Handle stripped files with a
+ stringtab offset of zero gracefully.
+ * osfsolib.c (solib_create_inferior_hook): Use DYNAMIC flag from
+ BFD instead of stop_pc heuristic to determine if it is a dynamically
+ linked object file.
+ * procfs.c (wait_fd): Handle ENOENT error return from PIOCWSTOP
+ ioctl, it indicates that the process has exited.
+
+Mon Jul 04 19:48:03 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hpread_symfile_init): Make sure to initialize all the
+ private data to zero. Not having any HP C debug symbols is not an
+ error. Just return.
+
+Mon Jul 4 19:28:56 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (read_unwind_info): ELF unwind information is in the
+ .PARISC.unwind section now.
+
+Mon Jul 4 17:06:26 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * breakpoint.c (mention): Always show breakpoint address if no
+ source file.
+
+Sat Jul 2 01:51:33 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * solib.c (bfd_lookup_symbol, look_for_base): Reinstate to reenable
+ handling of shared libraries for non-ELF executables, but only if
+ HANDLE_SVR4_EXEC_EMULATORS is defined.
+ (locate_base): Try to find debug_base in the dynamic linker
+ for non-ELF executables if HANDLE_SVR4_EXEC_EMULATORS is defined.
+ * config/sparc/tm-sun4sol2.h (HANDLE_SVR4_EXEC_EMULATORS):
+ Define to enable handling of shared libraries for a.out executables,
+ run under Solaris BCP.
+
+Fri Jul 01 19:50:21 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c: Change contribution notice to the Cygnus/Utah agreed
+ upon notice. Delete some stuff from the TODO list. Rework
+ many comments to be clearer. Major cleanups. Consistently
+ use "hpread_" prefix. Delete unnecessary macros, structures
+ variables, fiels, functions and #if 0 code. Mark code which
+ still needs to be cleaned up. PARAMize and make most functions
+ static. Fix error checking when reading in the debug section
+ contents. No more minimal symbol table handling in this code!
+
+Thu Jun 30 13:59:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Print "Program exited normally"
+ regardless of batch_mode.
+ * defs.h, top.c (batch_mode): Removed.
+
+Wed Jun 29 18:53:36 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (dcache_h): Remove redundant definition.
+ (init.c): Add a comment.
+ (top.c): Remove explicit compile action.
+ * breakpoint.c (mention): Share code indicating location of
+ break/watchpoints, don't print address if addressprint is off.
+ * breakpoint.c, c-typeprint.c, c-valprint.c, energize.c, symtab.h
+ (demangle): Remove redundant declarations.
+ * eval.c: Remove redundant function declarations.
+ * objfiles.h: Cosmetic and grammatical improvements.
+ * TODO: Various updates.
+
+ * remote-mips.c: Replace all \r chars with \015.
+ (mips_receive_header): Display control characters readably.
+ (mips_xfer_memory): Add a simple progress display.
+
+Wed Jun 29 13:11:45 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
+
+ * remote-e7000.c (e7000_open): Don't try a tcp open if we're
+ using go32.
+ * remote-hms.c (flush): New function.
+ (expect): Get edge case right.
+ (hms_read_inferior_memory): Be more tolerant of line noise.
+
+Tue Jun 28 14:17:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Use i386m3.mh and i386m3.mt as names of host and
+ target files, not non-existent mach3.mh and mach3.mt.
+
+Wed Jun 29 00:26:17 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (dbx_symfile_read): Unconditionally add dynamic
+ symbols for all symbol files. Makes skipping over the
+ trampoline code work when stepping from a function in a shared
+ library into a function in a different shared library.
+ (read_dbx_dynamic_symtab): Relocate mst_solib_trampoline address.
+
+Tue Jun 28 15:28:01 1994 Stu Grossman (grossman@cygnus.com)
+
+ * dbxread.c, partial-stab.h (near N_SO): SO stabs with blank
+ names mean end of .o file.
+ * infrun.c (wait_for_inferior): Clean up multi-thread logic near
+ top of routine. Handle new thread notification cleanly.
+ * lynx-nat.c (child_wait): General cleanups, handle new LynxOS
+ thread notification scheme.
+ * (child_resume): General cleanups, handle resumption of all
+ threads properly.
+
+Mon Jun 27 09:57:23 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
+
+ * ser-go32.c: Rewrite to run under windows.
+ * ser-e7kpc.c: New file to support the E7000 with the PC ISA
+ bus interface.
+ * serial.c (serial_open): Notice device "pc".
+ * remote-e7000.c: Fix copyright date.
+ (expect): Compare \n and \r the same.
+ (e7000_open): Allow pc as a serial port
+ * sh/sh.mt: Add ser-e7kpc.
+ * h8300/h8300hms.mt: Add ser-e7kpc.
+ * main.c (proc_wait): Don't wait if using go32.
+
+Mon Jun 27 00:35:51 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * somread.c: Simplify by using stabsect_build_psymtabs.
+ * dbxread.c (stabsect_build_psymtabs): New argument "text_name"
+ corresponding to the name of the text section. All references
+ changed.
+ (somstab_build_psymtabs): Delete function, no longer needed.
+
+Sun Jun 26 23:54:08 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * somread.c: Renamed from paread.c. Changed function names and
+ comments to reflect that this file deals with SOM (an object file
+ format), rather than the PA (a cpu).
+ (Makefile.in): Chaned appropriately.
+ (config/pa/hppabsd.mh, config/pa/hppahpux.mh): Likewise.
+ * dbxread.c (somstab_build_psymtabs): Renamed from
+ pastab_build_psymtabs.
+
+Fri Jun 24 08:15:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * core-sol2.c: New file to handle ELF and BCP core file flavours.
+ * config/sparc/sun4sol2.mh (NATDEPFILES): Use it instead of
+ core-svr4.
+ * Makefile.in: Updated for core-sol2.c.
+ * README: Add notes about SPARCworks cc under Solaris 2.x,
+ from Casper H.S. Dik (casper@fwi.uva.nl).
+ * config/mips/xm-makeva.h: Removed, no longer necessary.
+ * Makefile.in, config/mips/xm-irix3.h, config/mips/xm-irix5.h,
+ config/mips/xm-mips.h, config/mips/xm-news-mips.h,
+ config/mips/xm-riscos.h: Remove references to xm-makeva.h
+
+Wed Jun 22 17:48:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdba.el: Put program input and output in a separate buffer.
+
+Wed Jun 22 16:54:15 1994 Fred Fish (fnf@cygnus.com)
+
+ * energize-patches, main.c (main), top.c (gdb_init, pwd_command),
+ top.h: Change all occurances of dirbuf to gdb_dirbuf. Collides
+ with global variable of same name in libnsl.so on UnixWare.
+
+Wed Jun 22 14:40:52 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * symtab.c (decode_line_1): fix a bug in dealing with '<>'
+ embedded in template name.
+
+Tue Jun 21 14:06:46 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * config/i386/nm-linux.h: change calling convention of
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT() and
+ target_insert_watchpoint() and
+ target_remove_watchpoint().
+
+ * config/mips/tm-mips64.h: define FORCE_LONG_LONG to force LONGEST
+ to be long long in gdb.
+ * config/mips/tm-bigmips.h: ditto.
+
+Mon Jun 20 23:54:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-lang.c (asm_language_defn): New definitions for language_asm,
+ mostly copied from c_language_defn, to avoid warnings when
+ switching between c and asm stack frames.
+
+Mon Jun 20 13:51:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * mdebugread.c (parse_symbol): Don't call ecoff_swap_tir_in or
+ ecoff_swap_rndx_in directly; use the debug_swap pointer instead.
+ (upgrade_type, handle_psymbol_enumerators): Likewise.
+ (has_opaque_xref, cross_ref): Likewise.
+ (elfmdebug_build_psymtabs): Call swap->read_debug_info to read
+ debugging information, rather than doing it here.
+ * mipsread.c (mipscoff_symfile_read): Call read_debug_info entry
+ point in ecoff_debug_swap backend structure, rather than calling
+ ecoff_slurp_symbolic_info directly.
+
+Fri Jun 17 20:58:58 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c: Include annotate.h. Call annotate_field rather
+ than printing annotation directly.
+
+ * main.c: Include string.h.
+
+Thu Jun 16 14:41:37 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * fork-child.c (startup_inferior) [STARTUP_INFERIOR]: If defined,
+ call it instead of doing normal loop.
+ * infcmd.c (attach_command): Don't call wait_for_inferior if
+ running Mach 3.
+ * infrun.c (proceed) [PREPARE_TO_PROCEED]: If defined, call
+ hook that can decide whether to step over the next breakpoint.
+ * utils.c (wrap_here): Abort if wrap_buffer not allocated.
+ (request_quit) [REQUEST_QUIT]: If defined, call it instead of
+ doing normal quit.
+
+ * configure.in: Improve sorting/formatting of hosts and targets.
+ (i[34]86-*-mach3*, i[34]86-*-osf1mk*, mips-*-mach3*,
+ m88*-*-mach3*, ns32k-*-mach3*): Recognize.
+ * Makefile.in (stop-gdb): New target.
+ * stop-gdb.c: New file, utility to get attention of waiting GDBs
+ in Mach 3.
+
+Wed Jun 15 00:41:03 1994 Tom Lord (lord@rtl.cygnus.com)
+
+ * top.c (gdb_init): Init current_directory in gdb_init. Probably
+ the identical initialization can be deleted from main.c, but i
+ haven't done so just in case.
+
+Tue Jun 14 17:24:41 1994 Tom Lord (lord@x1.cygnus.com)
+
+ * gdba.el: Added menu windows and slightly improved window
+ handling to gdba.el. Fixed numerous minor bugs that were causing
+ emacs and gdb to fall out of sync.
+
+Tue Jun 14 16:18:44 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * breakpoint.c: annotate changes lost at merge, put back in.
+
+Mon Jun 13 17:28:50 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/i386/i386sco.mh, i386sco4.mh (XDEPFILES): Remove
+ i387-tdep.o.
+
+Sun Jun 12 03:51:52 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/m68k/dpx2.mh (NATDEPFILES): Remove duplicate inclusion
+ of inftarg.o.
+ * config/m68k/tm-dpx2.h (CANNOT_STORE_REGISTER): Define to inhibit
+ writing of floating registers, the dpx2 kernel disallows it.
+ * irix5-nat.c (LM_ADDR): The loaded address of the shared library
+ is contained in o_praw.
+ * irix5-nat.c (solib_map_sections): Adjust sections by the
+ difference between the loaded address and the prelinked address.
+ * irix5-nat.c (solib_address): Use LM_ADDR for the loaded start
+ address.
+ * mdebugread.c (parse_symbol): Do not relocate stEnd/scText
+ symbols, their value is absolute.
+ * mdebugread.c (parse_partial_symbols): Handle Irix 5.2 shared
+ libraries fh->adr fields of zero. Relocate minimal symbol values
+ upon readin. Relocate non-stabs symbols upon readin.
+ * mdebugread.c (psymtab_to_symtab_1): Use pst->textlow for the
+ start address of the outermost block.
+ * mdebugread.c (parse_lines, parse_procedure): Pass in pst
+ instead of section_offsets and use relocated pst->textlow for
+ line number and procedure address relocations.
+
+ From gmo@MicroUnity.com (Guillermo A. Loyola):
+ * mdebugread.c (parse_symbol, parse_partial_symbols, cross_ref):
+ Handle SGI Irix5 stIndirect symbol type.
+
+Fri Jun 10 14:52:56 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * breakpoint.c: fix a syntax error native cc does not like.
+
+ * Makefile.in: change sparclite-tdep.c to sparcl-tdep.c.
+ * sparclite/Makefile.in: ditto.
+ * sparcl-tdpe.c: change file name because first 8 chars has to be
+ unique.
+ * sparcl-stub.c: ditto.
+
+ * sparclite/Makefile.in: fix INCLUDE_CFLAGS to have {srcdir}/../config.
+
+Fri Jun 10 10:38:15 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (target_read_pc, target_write_pc): Accept (and
+ ignore) a PID argument.
+ (hppa_pop_frame): Pass a PID to target_write_pc.
+ * config/pa/tm-hppa.h (TARGET_READ_PC, TARGET_WRITE_PC): Accept
+ and pass through a PID argument.
+ (target_read_pc, target_write_pc): Update prototypes.
+
+Thu Jun 9 18:10:44 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * Makefile.in: add new file sparclite-tdep.c.
+ * sparclite/Makefile.in: add new file sparclite-stub.c.
+ * sparclite/hw_breakpoint.note: note for SPARClite hardware breapoint
+ support.
+ * config/sparc/sparclite.mt: add sparclite-tdep.o.
+ * config/sparc/tm-sparclite.h: add hardware breakpoints support
+ defiines and code.
+ * sparclite-tdep.c: new file, contains hardware breakpoint support
+ code.
+ * sparclite-stub.c: new file, stub code that add support hardware
+ breakpoint support.
+ * breakpoint.c: add hardware breakpoint support.
+ * breakpoint.h: add new breakpoint type to support hardware
+ breakpoint.
+ * config/mips/nm-irix4.h: change interface for target dependent
+ code supporting watch point.
+ * config/pa/nm-hppab.h: change interface for target dependent
+ code supporting watch point.
+
+Thu Jun 9 14:59:58 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * remote-os9k.c (rombuf_command): fix a bug accepting rombug
+ output.
+ * stabsread.c (read_struct_fields): os9k nested structure does not
+ have terminating ';', instead it just get to ',' and bit position
+ and length.
+
+Wed Jun 8 23:20:45 1994 Stu Grossman (grossman@cygnus.com)
+
+ * nlmread.c (nlm_symtab_read): Clean up a bit.
+ * (nlm_symfile_read): Record bounds of main() so that backtrace
+ command will know where to stop.
+ * objfiles.c (objfile_relocate): Relocate entry point/func info
+ for backtrace as well.
+ * objfiles.h: Define values for invalid PCs for entry point info.
+ * symfile.c (init_entry_point_info): Initialize invalid values
+ with aforementioned macros.
+ * config/alpha/tm-alphanw.h: Turn on FRAME_CHAIN_VALID_ALTERNATE
+ to cause backtrace to stop when it gets back to main().
+ * config/i386/tm-i386nw.h: Ditto.
+
+Sat Jun 4 18:17:03 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ Fix value_print, which used to be ostensibly language-independent,
+ but would print pointers and arrays in C syntax. Instead, call
+ a language-specific function.
+ * language.h (struct language_defn): New functional field
+ la_value_print.
+ (LA_VALUE_PRINT): New macro.
+ * language.c (unk_lang_value_print): New stub/dummy function.
+ (unknown_language_defn, auto_language_defn, local_language_defn):
+ Use it.
+ * c-valprint.c (c_value_print): New function, with code moved from:
+ * valprint.c (value_print): ... here. Now just invoke
+ LA_VALUE_PRINT to do language-specific stuff.
+ * valprint.c (value_print_array_elements): Make non-static.
+ * c-lang.c (c_language_defn, cplus_language_defn): Add
+ c_value_print in the la_value_print field.
+ * m2-lang.c (m2_language_defn): Likewise.
+ * ch-lang.c (chill_language_defn): But here use chill_value_print.
+ * ch-valprint.c (chill_val_print): Print null pointer as NULL.
+ * ch-valprint.c (chill_value_print): New function, based on
+ c_value_print, but use Chill "look and feel."
+ * c-lang.h (c_value_print): New prototype.
+ * ch-lang.h (chill_value_print): New prototype.
+ * value.h (value_print_array_elements): New prototype.
+
+ * ch-valprint.c (chill_val_print, case TYPE_CODE_BITSTRING
+ and case TYPE_CODE_SET): Check that the element type isn't a stub.
+
+Fri Jun 3 09:15:00 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c: Move entire file except for #ifndef MAIN_OVERRIDE code
+ to new file top.c. Make things extern instead of static and
+ similar rearrangements to deal with this.
+ * top.h: New file.
+ * utils.c: Move fputs_unfiltered to main.c. Remove
+ FPUTS_UNFILTERED_OVERRIDE ifndef.
+ * Makefile.in: Change so that gdb uses main.c, utils.c, and top.c,
+ and libgdb uses utils.c and top.c.
+
+Thu Jun 2 23:19:10 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (skip_trampoline_code): Fix typo.
+
+Thu Jun 2 18:09:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-valprint.c (chill_val_print_array_elements): New function.
+ A Chill version of val_print_array_elements, it prints the
+ array index labels, in additions ot the array element values.
+ (chill_val_print): Use the new function.
+
+Thu Jun 2 08:50:00 1994 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Add nlm subdir to configdirs for alpha-*-netware
+ target.
+ * defs.h (enum language): Add language_asm.
+ * findvar.c (read_register_bytes read_register_gen
+ write_register_bytes read_register read_register_pid
+ write_register write_register_pid supply_register): Move multi-
+ thread handling down into these routines. Create XXX_pid routines
+ that allow register references to specify the pid.
+ * findvar.c infcmd.c (read_pc read_pc_pid write_pc write_pc_pid
+ read_sp write_sp read_fp write_fp): Move these routines from
+ infcmd to findvar to centralize the whole mess.
+ * i386-nlmstub.c: Portability fixes.
+ * infptrace.c (child_resume): Conditionalize to allow other natives
+ to override it. Remove PIDGET gubbish, it's no longer necessary.
+ * infrun.c (wait_for_inferior): Put registers_changed() before
+ target_wait() to speed up remote debugging.
+ * Replace code that reads registers from other threads with much
+ nicer looking new function calls (see changes to findvar.c).
+ * Don't skip prologues if debugging assembly source.
+ * lynx-nat.c (child_resume): Lynx now needs it's own version of
+ child_resume to handle multi-thread debugging properly.
+ * remote.c: Add O response to get console output from target.
+ * (readchar): Add timeout parameter. Handle SERIAL_EOF and
+ SERIAL_ERROR here to simplify callers.
+ * Change static var timeout to remote_timeout.
+ * (fromhex): Remove unnecessary return -1 at end of routine.
+ * (remote_wait): Turn this into a big switch statement. Add
+ support for O response.
+ * (putpkt): Remove unnecessary handling of SERIAL_EOF/ERROR.
+ * (getpkt): Split getpkt into two parts. read_frame deals with
+ all formatting issues, run-length encoding, and framing. getpkt
+ now handles error recovery, and frame detection.
+ * ser-tcp.c (tcp_readchar): Handle EINTR from read().
+ * ser-unix.c (hardwire_raw): Set CLOCAL so that we ignore modem
+ control. (hardwire_readchar): Handle EINTR from read().
+ * symfile.c (deduce_language_from_filename): Add support for .s
+ files.
+ * config/nm-lynx.h: Define CHILD_WAIT so that lynx-nat.c can
+ override infptrace's child_wait.
+ * config/rs6000/rs6000lynx.mh: Use xm-rs6000ly.h & nm-rs6000ly.h
+ instead of XXXlynx.h.
+ * config/rs6000/rs6000lynx.mt: Use tm-rs6000ly.h instead of
+ tm-rs6000lynx.h.
+ * nlm/gdbserve.c: Portability fixes.
+
+Tue May 31 20:35:44 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * inftarg.c (child_wait): Call proc_wait, not wait.
+ (child_mourn_inferior): Call proc_remove_foreign.
+ * main.c (gdb_init): Call init_proc.
+ * main.c: Provide dummy versions of init_proc, proc_wait, and
+ proc_remove_foreign for the gdb case (the libgdb case provides its
+ own versions of these functions).
+ * Makefile.in (libgdb-files): Add libproc.a.
+
+Wed Jun 1 11:08:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Hardware watchpoints for Linux, from Rick Sladkey
+ (jrs@world.std.com).
+ * infrun.c (wait_for_inferior) [HAVE_CONTINUABLE_WATCHPOINT]: Add
+ new hardware breakpoint recovery method.
+ * i386v-nat.c (i386_insert_watchpoint,
+ i386_insert_nonaligned_watchpoint, i386_remove_watchpoint,
+ i386_stopped_by_watchpoint) [TARGET_CAN_USE_HARWARE_WATCHPOINT]:
+ New functions to support the 386 hardware debugging registers.
+ * config/i386/nm-linux.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT,
+ HAVE_CONTINUABLE_WATCHPOINT, STOPPED_BY_WATCHPOINT,
+ target_insert_watchpoint, target_remove_watchpoint): Define these
+ macros to use the hardware debugging functions in i386v-nat.c.
+
+Wed May 25 17:06:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Replace libgdb.a with libgdb-files. Make "all"
+ build it.
+
+Thu May 19 09:56:20 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.c, target.h: New variables target_activity_function and
+ target_activity_fd.
+ * inflow.c, inferior.h: New functions set_sigio_trap and
+ clear_sigio_trap.
+ * inftarg.c (child_wait), procfs.c (wait_fd): Call them.
+
+Wed May 18 13:01:55 1994 Doug Evans (dje@canuck.cygnus.com)
+
+ * remote-sim.h (sim_verbose): Delete.
+ Document callbacks needed.
+ (sim_*): Change result to void where there isn't one.
+ (sim_open): Clarify argument and error response.
+ (sim_close): Declare.
+ (sim_load): Change bfd_handle argument to file name. Clarify result.
+ (sim_create_inferior): Renamed from sim_set_args.
+ (sim_set_pc): Delete.
+ (sim_info): Delete printf_fn argument.
+ * remote-sim.c (gdbsim_kill): Add comment describing purpose.
+ (gdbsim_load): Try sim_load first.
+ (gdbsim_create_inferior): Call sim_create_inferior.
+ (gdbsim_open): Handle args == NULL. Update call to sim_open.
+ (gdbsim_close): Call sim_close.
+ (gdbsim_files_info): Update call to sim_info.
+ (gdbsim_ops): Realign comments.
+
+ * printcmd.c (decode_format): Allow TARGET_PTR_BIT to be non-constant.
+
+Tue May 17 16:45:20 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): For C_FILE symbols, only use
+ the auxent if the symbol's name is ".file". From David Edelsohn
+ <c1dje@watson.ibm.com>.
+
+Tue May 17 11:08:22 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Fix typo.
+
+ * annotate.c (annotate_field_end): Fix typo.
+
+ * Makefile.in: Move annotate.o from COMMON_OBS to OBS.
+
+ * Makefile.in (TSSTART): Remove; no longer used.
+
+ * utils.c (vfprintf_maybe_filtered, vfprintf_unfiltered): Call
+ fputs_unfiltered and exit directly, rather than fatal. The latter
+ calls vfprintf_unfiltered!
+
+ * gdbtypes.h, gdbtypes.c (can_dereference): New function.
+ * value.h, printcmd.c (print_value_flags): Move from here...
+ * annotate.c: ...to here, and make it use can_dereference.
+
+Sat May 14 15:13:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * inflow.c (job_control, attach_flag, generic_mourn_inferior):
+ Remove, needed for both native and cross.
+ * target.c (attach_flag, generic_mourn_inferior): Put here.
+ * utils.c (job_control): Put here.
+ (terminal.h): Don't include anymore.
+
+Sat May 14 09:11:44 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * source.c (find_source_lines): Always use code that was #ifdef
+ BROKEN_LARGE_ALLOCA. Do the cleanup before returning, rather than
+ leaving it on the chain. Reindent much of this function.
+ * config/sparc/{xm-sun4sol2.h,xm-sun4os4.h},
+ config/i386/{xm-sun386.h,xm-i386m3.h,xm-i386mach.h},
+ config/m68k/{sun3os4.h,xm-news.h,xm-hp300hpux.h},
+ config/ns32k/xm-ns32km3.h: Remove all references to
+ BROKEN_LARGE_ALLOCA; with the above change it is no longer needed.
+ * main.c, fork-child.c, many config files: Remove all
+ SET_STACK_LIMIT_HUGE code; with the above changes it should no
+ longer be needed.
+
+ * symtab.c (lookup_partial_symbol): Use if and abort, not assert.
+ This avoids __eprintf troubles.
+
+Fri May 13 08:10:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (main): Surround in #ifndef MAIN_OVERRIDE. Move
+ initialization code which needs to be called even if we bypass the
+ command line stuff into gdb_init.
+ * utils.c (fputs_unfiltered): Surround in #ifndef
+ FPUTS_UNFILTERED_OVERRIDE.
+ * Makefile.in (libgdb.a): New target.
+
+ * utils.c: Rearrange I/O stuff a bit so that all output goes
+ through fputs_unfiltered. Use vasprintf; removes arbitrary limit
+ which made %s not work with arbitrarily large strings.
+ * printcmd.c (printf_command): Use printf_filtered, not
+ printf_unfiltered and printf, now that arbitrary limit is gone.
+
+ gcc -Wall lint:
+ * breakpoint.c (watchpoint_check): Remove unused variable b.
+ * stack.c (print_frame_info): Move sp and buf inside #if.
+ * eval.c (evaluate_subexp): Remove unused variables pp,
+ mangle_ptr, ptr, and mangle_tstr.
+ * valarith.c (value_x_binop): Remove unused variables mangle_tstr
+ and mangle_ptr.
+ * symtab.c (lookup_symtab): Put variable copy inside #if.
+ (decode_line_1): Put variable q1 inside #if 0.
+ * target.h: Declare target_link.
+ * infrun.c (wait_for_inferior): Remove unused variables signame.
+ * remote.c (remote_resume): Remove unused variable name.
+ * c-exp.y (parse_number): Parenthesize operand of shift.
+ * dbxread.c (record_minimal_symbol): Parenthesize operand of &&
+ (this is a semantic change, the warning seems to have detected a bug).
+ * dbxread.c (end_psymtab): Move variable p1 inside #if.
+ * coffread.c: Move variable temptype inside #if.
+ * ch-typeprint.c (chill_type_print_base): Remove unused variable
+ name.
+ * ch-valprint.c: #include typeprint.h and ch-lang.h.
+ (chill_val_print): Remove unused variable in_range.
+ (chill_val_print): Remove statement "length > TYPE_LENGTH (type);".
+ (chill_val_print): Add default case for switch.
+ * stabsread.h: Declare stabsect_build_psymtabs.
+ * os9kread.c (read_minimal_symbols): Make this return void.
+ (os9k_symfile_read): Remove unused variables stb_exist and val.
+ (os9k_symfile_init): Remove unused variable val.
+ (fill_sym): Remove unused variable id.
+ (read_os9k_psymtab): Put variable back_to inside #if 0. Remove
+ unused variable nsl.
+ Remove unused variable symfile_bfd.
+ #if 0 unused variables lbrac_unmatched_complaint and
+ lbrac_mismatch_complaint.
+ Remove declaration for non-existent function os9k_next_symbol_text.
+
+ * annotate.c, annotate.h: New files, containing a function for
+ each annotation which outputs it.
+ * Move breakpoints_changed from breakpoint.c to annotate.c.
+ * breakpoint.c, blockframe.c, infrun.c, cp-valprint.c, main.c,
+ printcmd.c, source.c, stack.c, utils.c, valprint.c:
+ Use annotate.c functions to output annotations.
+ * Makefile.in (OBS): Add annotate.o.
+
+Thu May 12 10:46:27 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (read_unwind_info): Make sure elf_unwind_size and
+ elf_unwind_entries are always initialized.
+
+ * hppa-tdep.c (skip_trampoline_code): Handle argument relocation
+ stubs which return directly to the caller rather than to the stub
+ itself.
+
+Wed May 11 20:11:51 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * c-exp.y (yyerror): Display a more informative error message.
+ * ch-exp.y (yyerror): Ditto, don't use global yychar.
+ * m2-exp.y (yyerror): Ditto.
+
+Tue May 10 11:57:53 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * inflow.c (job_control): Move definition to front of file.
+
+Tue May 10 14:42:37 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * maint.c (print_section_table): Rename SEC_SHARED_LIBRARY to
+ SEC_COFF_SHARED_LIBRARY to match corresponding change in bfd.
+
+Fri May 6 13:30:22 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (kdb): Remove old init.c creation commands.
+ * configure.in (sparclite): Match on sparclite*.
+ * sparclite/aload.c (main): Only change section addresses for
+ a.out format object files.
+
+Fri May 6 13:24:04 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * config/i386/go32.mh: Define CC.
+
+Fri May 6 11:56:54 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdbserver/Makefile.in: Remove irrelevant definitions and
+ comments inherited from the gdb Makefile.
+ (BFD_DIR, BFD, BFD_SRC, BFD_CFLAGS): Add from gdb Makefile.
+ (VERSION): Update to 4.12.3.
+ (gdbserver): Remove any existing executable first.
+ (distclean, realclean): Remove nm.h.
+ * gdbserver/low-lynx.c: Add Sparc Lynx support.
+ * gdbserver/low-sparc.c, gdbserver/low-sun3.c (sys/wait.h):
+ Don't use absolute pathname.
+
+Thu May 5 12:00:22 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * rs6000-nat.c (vmap_ldinfo): Don't fail if fstat returns an
+ error.
+
+Wed May 4 06:56:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (proceed, normal_stop, wait_for_inferior), breakpoint.c
+ (print_it_normal): Add annotations for the inferior starting and
+ stopping, and for all the various messages related to how it
+ stopped.
+
+ * printcmd.c (do_one_display): Annotate.
+ * stack.c (print_frame_info): Annotate printing of stack frames.
+
+Wed May 4 18:15:51 1994 Stu Grossman (grossman@cygnus.com)
+
+ * remote.c (get_offsets): Handle case where stub doesn't support
+ qOffsets message.
+
+Wed May 4 15:30:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ Add partial support for g++ code compiled with -fvtable-thunks.
+ * c-valprint.c (c_val_print): Add vtblprint support
+ when using thunks.
+ * cp-valprint.c (cp_is_vtbl_member): A vtable can be an array of
+ pointers (if using thunks) as well as array of structs (otherwise).
+ * cp-valprint.c (vtbl_ptr_name_old, vtbl_ptr_name): Move to global
+ level, and make the latter non-static (so define_symbol can use it).
+ * stabsread.c (define_symbol): If the type being defined is a
+ pointer type named "__vtbl_ptr_type", set the TYPE_NAME to that name.
+ * symtab.h (VTBL_PREFIX_P): Allow "_VT" as well as "_vt".
+ * values.c (value_virtual_fn_field): Handle thunks.
+ * values.c (value_headof): Minor efficiency hack.
+ * values.c (value_headof): Incomplete thunk support. FIXME.
+
+Wed May 4 06:56:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valprint.c (print_longest): Clarify comment about use_local.
+ * printcmd.c, defs.h (print_address_numeric), callers in
+ symmisc.c, symfile.c, stack.c, source.c, remote.c, infcmd.c,
+ cp-valprint.c, core.c, ch-valprint.c, c-valprint.c, breakpoint.c,
+ exec.c: New argument use_local.
+ * source.c (identify_source_line): Use filtered output. Use
+ print_address_numeric.
+
+ * core.c (memory_error), symtab.c (cplusplus_hint, decode_line_1),
+ language.c (type_error, range_error): Use filtered output.
+ * utils.c (error_begin): Update comment to tell people to use
+ filtered output.
+
+ * Makefile.in (HFILES_WITH_SRCDIR): List bfd.h.
+ (HFILES_NO_SRCDIR): List gdbcore.h not gdbcore_h, so as not to get
+ bfd.h.
+
+Tue May 3 07:41:33 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * procfs.c (procfs_wait): Reinstate code which deduces the signal
+ from the fault, #ifndef FAULTED_USE_SIGINFO.
+ * config/sparc/tm-sun4sol2.h: Define FAULTED_USE_SIGINFO.
+
+Fri Apr 29 18:15:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Annotate each field of the headers.
+ Explicitly annotate each record.
+
+Fri Apr 29 15:56:18 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * xcoffexec.c: Reformat to standards and lint.
+ (language.h): Include.
+ (exec_close): Declare arg "quitting".
+ (file_command): Declare arg "from_tty".
+ (map_vmap): Cast xmalloc result to PTR.
+ * rs6000-nat.c: Reformat to standards and lint.
+ (exec_one_dummy_insn): Use char array for saved instruction.
+ (fixup_breakpoints): Declare.
+ (vmap_ldinfo): Be more informative in fatal error messages.
+ (xcoff_relocate_symtab): Define to return void.
+ * xcoffsolib.h: Reformat to standards, improve comments.
+ * config/rs6000/nm-rs6000.h (xcoff_relocate_symtab): Declare.
+
+Thu Apr 28 08:40:56 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c, defs.h (error_begin): New function.
+ (quit): Print annotation before printing the error message.
+ * main.c (return_to_top_level): Print annotation before doing the
+ longjmp.
+ * symtab.c (decode_line_1): Call error not warning and then
+ return_to_top_level. Call error_begin and printf_unfiltered
+ rather calling warning (before calls to return_to_top_level).
+ * core.c (memory_error): Use error_begin, printf_unfiltered,
+ print_address_numeric and return_to_top_level instead of error.
+ Cleans up a FIXME-32x64.
+ * language.c (type_error, range_error): Call error_begin
+ not just target_terminal_ours.
+
+ * dbxread.c (stabsect_build_psymtabs): Assign to sym_stab_info
+ directly, rather than via DBX_SYMFILE_INFO. A cast on the left
+ side of an assignment is non-portable.
+
+ * utils.c (query): Change syntax of query annotations to be
+ consistent with other input annotations.
+ (prompt_for_continue): Likewise for prompt-for-continue annotation.
+
+Thu Apr 28 01:20:39 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (psymtab_to_symtab_1): Do not call sort_blocks
+ for stabs symtabs.
+ * mips-tdep.c (mips_skip_prologue): Handle prologues for functions
+ that have a stack frame size of 32k or larger (from Paul Flinders).
+ Remove #if 0'd code.
+
+Wed Apr 27 16:33:51 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * lynx-nat.c (CANNOT_STORE_REGISTER): Add a fallback definition
+ for Lynx platforms that need it.
+ * config/nm-lynx.h (__LYNXOS): Define if not already defined.
+
+Wed Apr 27 16:01:37 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * procfs.c (procfs_wait): Use the signal from the pr_info rather
+ than trying to deduce it from the fault.
+
+Wed Apr 27 12:22:46 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * printcmd.c (print_address_symbolic): Initialize name to empty
+ string to avoid core dump if lookup fails.
+ * remote-e7000.c (printf_e7000debug): Error if target not open.
+
+Tue Apr 26 22:45:24 1994 Stu Grossman (grossman at cygnus.com)
+
+ * i386-nlmstub.c: Update to be more in line with PIN stub.
+ * nlm/gdbserve.c (putDebugChar): Install bug fix from i386-nlmstub.
+ * (hex2mem): Init ptr.
+ * General cleanups to use ConsolePrintf, standard prologues, etc...
+
+Tue Apr 26 10:23:04 1994 Stu Grossman (grossman at cygnus.com)
+
+ * i386-nlmstub.c: More changes to be compatible with remote.c.
+
+ * dbxread.c: Move a bunch of strncmps out of process_one_symbol
+ into (the far less frequently called) dbx_symfile_read.
+
+ * i386-nlmstub.c: An interim version till we get PIN for the x86.
+
+Tue Apr 26 09:50:45 1994 Stu Grossman (grossman at cygnus.com)
+
+ * dbxread.c (record_minimal_symbol): Record the section
+ associated with the symbol to make dynmaic relocation work.
+ * (dbx_symfile_read, process_one_symbol): Fixes to work around
+ Solaris brain-damage which don't apply to relocatable object
+ files.
+ * (stabsect_build_psymtabs): New routine to read stabs out of an
+ arbitrarily named section.
+ * nlmread.c (nlm_symtab_read): Read ALL syms from the NLM, not just
+ globals.
+ * (nlm_symfile_read): Call stabsect_build_psymtabs to read the
+ stabs out of the nlm.
+ * partial-stabs.h (cases 'f' & 'F'): Fixes to work around Solaris
+ brain-damage which don't apply to relocatable object files.
+ * remote.c (putpkt): Improve error reporting and error handling.
+ * (get_offsets): Temporary kludge to force data & bss sections to
+ have the same relocation.
+ * stabsread.c (define_symbol, scan_file_globals): Record section
+ info in sym.
+
+Sat Apr 23 19:05:52 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (breakpoint_1): Annotate each field of output. Add
+ FIXME-32x64 comment.
+
+Fri Apr 22 16:43:54 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Move call to flush_cached_frames
+ to after call to target_wait. This means that flush_cached_frames
+ can call target_terminal_ours if it wants to.
+ * infrun.c (wait_for_inferior) [HAVE_NONSTEPPABLE_WATCHPOINT]: Add
+ comment about why the code is dubious.
+
+ * stabsread.c (read_type): Call read_type, not nonexistent
+ os9k_read_type.
+
+Fri Apr 22 14:25:36 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * remote-os9k.c (rombug_fetch_registers): set trace mode
+ correctly.
+ * remote-os9k.c (rombug_read_inferior_memory): cache data in
+ buffer.
+ * os9kread,c (read_os9k_psymtab): process file symbol to truncate
+ extra info.
+ * os9kread.c (os9k_read_ofile_symtab): proper casting of args
+ passed to process_one_symbol.
+ * stabsread.c (read_type): process os9k functio prototype.
+
+Fri Apr 22 11:27:39 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * solib.c (symbol_add_stub): If so->textsection is NULL, don't
+ dump core.
+
+Thu Apr 21 07:45:49 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (prompt_for_continue): Annotate prompt.
+ (query): Annotate query.
+ * printcmd.c (print_frame_args): Change syntax of argument
+ annotation to make name and value part of a single group of
+ annotations, not two separate groups.
+ * cp-valprint.c (cp_print_value_fields): Likewise for fields.
+ * valprint.c (val_print_array_elements): Change syntax of
+ annotation to be more concise.
+ * main.c, defs.h (command_line_input): New argument tells what
+ string to include in the annotations.
+ * symtab.c (decode_line_2), main.c (read_command_lines,
+ command_loop): Change callers.
+
+ * breakpoint.c (watch_command): Use (CORE_ADDR)0, not NULL, for
+ target null pointer.
+ * blockframe.c (find_frame_addr_in_frame_chain): Likewise.
+
+ * printcmd.c (output_command): Annotate things we print here too.
+ * printcmd.c (print_command_1): Add "value-history-value" annotation.
+ * Move declaration of print_value_flags from defs.h to value.h.
+ * main.c (command_line_input): Call wrap_here as well as gdb_flush.
+
+Thu Apr 21 09:29:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (read_dbx_dynamic_symtab): Reinstall support for sun3,
+ BFD handles sun3 dynamic relocations now.
+ * elfread.c (elf_symtab_read, elf_symfile_read): Handle dynamic
+ symbol table.
+
+Wed Apr 20 19:41:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_command_1): Annotate the top-level expressions
+ that we print.
+ (print_frame_args): Annotate each argument.
+ * printcmd.c, defs.h (print_value_flags): New function.
+ * cp-valprint.c (cp_print_value_fields): Annotate each field.
+ * valprint.c (val_print_array_elements): Annotate each array element.
+
+Wed Apr 20 13:18:41 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * findvar.c (read_var_value): Handle LOC_REPARM_ADDR case correctly,
+ the register contains a pointer to the type, not the type itself.
+
+Mon Apr 11 10:44:35 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * main.c (main): Accept --annotate=N option and make --fullname
+ the same as --annotate=1.
+ (command_line_input): Print annotatation before and after prompt.
+ * blockframe.c (flush_cached_frames): Print annotation.
+ * Rename frame_file_full_name to annotation_level and move it from
+ symtab.h to defs.h.
+ * source.c (identify_source_line): If annotation_level > 1,
+ change output format.
+ * breakpoint.c: Print annotation whenever a breakpoint changes.
+ * main.c: New variable server_command.
+ (command_line_input): Parse "server " and set server_command.
+ (dont_repeat): Check server_command.
+
+Wed Apr 20 08:37:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (xcoff_next_symbol_text): Don't return before
+ updating raw_symbol and symnum. Return a value in the case where
+ we complained.
+
+ * dstread.c, coffread.c: Don't define pending_blocks; buildsym.c
+ takes care of it.
+ * parse.c: Don't define block_found; it is defined in symtab.c.
+ * parser-defs.h: Add comment regarding block_found.
+
+Tue Apr 19 09:46:05 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (internalize_unwind_info): Delete unused indexp
+ argument.
+
+Mon Apr 18 13:18:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (read_dbx_dynamic_symtab): Relocate BFD symbols by
+ section vma. Do not read dynamic relocs for sun3 executables to
+ avoid BFD assertion message.
+
+Mon Apr 18 10:08:07 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * nm-hppab.h (KERNEL_U_ADDR): Define.
+ (FIVE_ARG_PTRACE): Likewise.
+ (CANNOT_STORE_REGISTER): Likewise.
+ * nm-hppah.h (KERNEL_U_ADDR): Define.
+ (FIVE_ARG_PTRACE): Likewise.
+ (CANNOT_STORE_REGISTER): Likewise.
+ (NEED_TEXT_START_END): Likewise.
+
+ * tm-hppah.h (NEED_TEXT_START_END): Delete definition.
+ * xm-hppah.h (KERNEL_U_ADDR): Delete definition.
+ (FIVE_ARG_PTRACE): Likewise.
+ * xm-hppab.h (KERNEL_U_ADDR): Delete definition.
+ (FIVE_ARG_PTRACE): Likewise.
+
+ * hppa-tdep.c (read_unwind_info): Make static.
+ (restore_pc_queue): Indirect through the target vector to
+ reload the register state.
+
+Sat Apr 16 22:20:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (compare_unwind_entries): Delete function. It's been
+ moved into hppa-tdep.c.
+ (read_unwind_info): Likewise.
+ (pa_symfile_read): No longer call read_unwind_info. The unwind
+ tables will be read in as they are needed.
+
+ * hppa-tdep.c (compare_unwind_entries): New function.
+ (read_unwind_info, internalize_unwinds): Likewise.
+ (find_unwind_entry): Read in unwind information on demand.
+
+Fri Apr 15 11:53:46 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * source.c (DIRNAME_SEPARATOR): New macro, replaces all references
+ to : in search path processing.
+ * defs.h (qsort): Rename argument in prototype.
+ * symtab.h (SAYMBOL_VALUE): Rename value field, avoids bugs in
+ some compilers.
+ * breakpoint.c, exec.c, mdebugread.c, mipsread.c, xcoffexec.c
+ (false): Eliminate usages.
+
+Fri Apr 15 11:35:19 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * h8500-tdep.c (initialize_h8500_tdep, large_command):
+ All references to value changed to value_ptrlage_command is now
+ called big_command.
+ All references to value changed to value_ptr.
+ * remote-e7000.c (e7000_wait): Use target_waitstatus and SETSTOP
+ * remote-hms.c (hms_wait): Timeout after five seconds.
+ * ser-go32.c (dosasync_read): Poll if timeout < 0.
+ * config/tm/tm-h8500.h (BEFORE_MAIN_LOOP_HOOK): Deleted.
+ * config/sh/tm-sh.h (BREAKPOINT): Is now sleep opcode.
+
+Thu Apr 14 07:01:56 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * procfs.c (procfs_wait): Protect watchpoint code with appropriate
+ #ifdefs.
+ (procfs_set_watchpoint, procfs_stopped_by_watchpoint): Likewise.
+
+Wed Apr 13 14:52:46 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * breakpoint.h (enum bptype): Add bp_hardware_watchpoint and
+ bp_watchpoint_scope breakpoints.
+ (struct breakpoint): Add val_chain and related_breakpoint fields
+ for use by watchpoints.
+
+ * breakpoint.c (within_scope): Delete. No longer used.
+ (TARGET_CAN_USE_HARDWARE_WATCHPOINT): Provide default definition.
+ (target_{remove,insert}_watchpoint): Likewise.
+ (can_use_hardware_watchpoint): New function.
+ (remove_breakpoint): New function to remove a single breakpoint
+ or hardware watchpoint.
+ (insert_breakpoints): Handle insertion of hardware watchpoints.
+ Store a copy of the value chain derived from the watchpoint
+ expression.
+ (remove_breakpoints): Simplify by using remove_breakpoint.
+ (delete_breakpoint): Likewise.
+ (watchpoint_check): Delete the watchpoint and watchpoint scope
+ breakpoints when the watchpoint goes out of scope. Save & restore
+ the current frame after checking watchpoints.
+ (breakpoint_init_inferior): Likewise (restarting the program
+ makes all local watchpoints go out of scope).
+ (bpstat_stop_status): Handle hardware watchpoints much like normal
+ watchpoints. Delete the watchpoint and watchpoint scope breakpoint
+ when the watchpoint goes out of scope. Remove and reinsert all
+ breakpoints before returning if we stopped when a hardware watchpoint
+ fired.
+ (watch_command): Use a hardware watchpoint when possible. If
+ watching a local expression, build a scope breakpoint too.
+ (map_breakpoint_numbers): Also call given function for any
+ related breakpoints.
+ (disable_breakpoint): Never disable a scope breakpoint.
+ (enable_breakpoint): Handle hardware breakpoints much like normal
+ breakpoints, but recompute the watchpoint_scope breakpoint's
+ frame and address (if we have an associated scope breakpoint).
+ (read_memory_nobpt): Handle hardware watchpoints like normal
+ watchpoints. When necessary handle watchpoint_scope breakpoints.
+ (print_it_normal, bpstat_what, breakpoint_1, mention): Likewise.
+ (clear_command, breakpoint_re_set_one, enable_command): Likewise.
+ (disable_command): Likewise.
+
+ * blockframe.c (find_frame_addr_in_frame_chain): New function.
+ Extern prototype added to frame.h
+
+ * infrun.c (wait_for_inferior): Set current_frame and select
+ a frame before checking if we stopped due to a hardare watchpoint
+ firing. Handle stepping over hardware watchpoints.
+ (normal_stop): Remove unnecessary call to select_frame.
+
+ * value.h (value_release_to_mark): Declare.
+ * values.c (value_release_to_mark): New function.
+
+ * procfs.c (procfs_wait): Add cases for hardware watchpoints.
+ (procfs_set_watchpoint, procfs_stopped_by_watchpoint): New functions.
+
+ * hppab-nat.c (hppa_set_watchpoint): New function.
+
+ * config/pa/nm-hppab.h (STOPPED_BY_WATCHPOINT): Define.
+ (HAVE_STEPPABLE_WATCHPOINT): Define.
+ (TARGET_CAN_USE_HARDWARE_WATCHPOINT): Define.
+ (target_{insert,delete}_watchpoint): Define.
+
+ * config/mips/nm-irix4.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT): Define.
+ (STOPPED_BY_WATCHPOINT, HAVE_NONSTEPPABLE_WATCHPOINT): Likewise.
+ (target_{insert,remove}_watchpoint): Likewise.
+
+Mon Apr 11 19:21:27 1994 Stu Grossman (grossman at cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): Ignore symbols of class C_EXT,
+ smtyp XTY_LD, sclass XMC_DS (external data segment label). They
+ often have the same names as debug symbols for functions, and
+ confuse lookup_symbol().
+
+Mon Apr 11 10:44:35 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote.c: Around redefinition of PBUFSIZE, adjust whitespace.
+ * config/pa/tm-hppa.h (REGISTER_BYTES): Use 4 rather than
+ REGISTER_RAW_SIZE (1).
+ Together these changes work around a bug in HP's compiler. Both
+ seem to be necessary.
+
+Mon Apr 11 09:18:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (pa_symtab_read): Handle ST_STUB symbols and symbols
+ with scope SS_EXTERNAL. ST_ENTRY symbols in dynamic executables
+ are type mst_solib_trampoline.
+
+Fri Apr 8 17:14:37 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * config/m68k/es1800.mt: Change comments.
+
+Fri Apr 8 17:14:37 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * config/m68k/monitor.mt (TDEPFILES): Don't include remote-es.o.
+
+Fri Apr 8 15:35:30 1994 Stu Grossman (grossman at cygnus.com)
+
+ * lynx-nat.c: Restore regmap structure for SPARC. It's needed
+ for core files.
+
+Fri Apr 8 14:53:35 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * values.c (unpack_long): Remove obsolete comment about using a
+ switch statement.
+
+ * symfile.c (symbol_file_command): Add comments about command syntax.
+
+Thu Apr 7 17:25:21 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ Jim Kingdon (kingdon@cygnus.com)
+
+ * infrun.c (IN_SOLIB_TRAMPOLINE): Correct comment, trampolines
+ are in the .plt section.
+ * minsyms.c (lookup_solib_trampoline_symbol_by_pc,
+ find_solib_trampoline_target): New functions for handling
+ stepping into -g compiled shared libraries.
+ * symtab.h (lookup_solib_trampoline_symbol_by_pc,
+ find_solib_trampoline_target): Add prototypes.
+ * config/tm-sunos.h (IN_SOLIB_TRAMPOLINE, SKIP_TRAMPOLINE_CODE):
+ Define to handle stepping into -g compiled shared libraries.
+ * config/tm-sysv4.h (SKIP_TRAMPOLINE_CODE): Define to handle
+ stepping into -g compiled shared libraries.
+
+Thu Apr 7 17:22:54 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Add mips-*-sysv4* support.
+ * config/mips/mipsv4.mh, config/mips/mipsv4.mt,
+ config/mips/tm-mipsv4.h, config/mips/xm-mipsv4.h, mipsv4-nat.c:
+ New files for MIPS SVR4 support.
+ * Makefile.in: Update for new mipsv4 files.
+ * alpha-tdep.c (heuristic_proc_desc, find_proc_desc): Use
+ read_next_frame_reg to obtain the frame relative stack pointer.
+ * mips-tdep.c (heuristic_proc_desc): Use read_next_frame_reg to
+ obtain the frame relative stack pointer.
+ * mdebugread.c (parse_partial_symbols, psymtab_to_symtab1):
+ Handle stStatic and stStaticProc symbols in stabs-in-ecoff output
+ by entering them into the minimal symbol table.
+ * printcmd.c (print_scalar_formatted): Do not try to unpack to
+ a long for float formats.
+ * solib.c: Include "elf/mips.h" only if DT_MIPS_RLD_MAP does not
+ get defined in <link.h>.
+ * solib.c (solib_add): Add shared library sections to the section
+ table of the target before adding the symbols.
+ * partial-stab.h: Relocate static and global functions.
+ * dbxread.c (read_dbx_symtab): Remove unused variable
+ end_of_text_address. Relocate text_addr when passing it
+ to end_psymtab.
+
+ For Alpha OSF/1 targets, enable gdb to set breakpoints in shared
+ library functions before the executable is run. Retrieve dynamic
+ symbols from stripped executables.
+ * mipsread.c (read_alphacoff_dynamic_symtab): New function.
+ * mipsread.c (mipscoff_symfile_read): Use it. Issue warning message
+ if no debugging symbols were found.
+ * alpha-tdep.c (alpha_skip_prologue): Silently return the unaltered
+ pc if memory at the pc is not accessible and GDB_TARGET_HAS_SHARED_LIBS
+ is defined.
+ * config/alpha/nm-alpha.h (GDB_TARGET_HAS_SHARED_LIBS): Define,
+ OSF/1 has shared libraries.
+
+Thu Apr 7 15:11:11 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * dbxread.c (read_dbx_dynamic_symtab): Adjust for recent changes
+ to BFD handling of dynamic symbols.
+
+Tue Apr 5 15:29:25 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): If FUN is a procedure label,
+ then gets its real address into FUN and its GOT/DP value into %r19.
+
+ * tm-hppa.h (CALL_DUMMY): Use %r20, not %r19 as a temporary.
+
+ * hppa-tdep.c (frameless_function_invocation): If no unwind
+ descriptor was found, then assume this was not a frameless
+ function invocation.
+ (frame_saved_pc): If the saved PC is in a linker stub, then
+ return the return address which the linker stub will return to.
+
+ * xm-hppab.h: Never define USG.
+ * xm-hppah.h: Always define USG.
+
+Tue Apr 5 12:58:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * values.c (unpack_long, value_from_longest),
+ valarith.c (value_binop): Allow TYPE_CODE_RANGE.
+
+Fri Apr 1 14:04:34 1994 Jason Merrill (jason@deneb.cygnus.com)
+
+ * symfile.c (deduce_language_from_filename): .cpp is a C++ extension.
+
+Fri Apr 1 00:44:00 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ For SVR4 targets, enable gdb to set breakpoints in shared
+ library functions before the executable is run.
+ * elfread.c (elf_symtab_read): Handle symbols for shared library
+ functions.
+ * sparc-tdep.c (in_solib_trampoline): Renamed to in_plt_section
+ and moved to objfiles.c.
+ * objfiles.c (in_plt_section): Moved to here from sparc-tdep.
+ * config/tm-sysv4.h (IN_SOLIB_TRAMPOLINE): Use new in_plt_section.
+ * config/sparc/tm-sun4sol2.h (IN_SOLIB_TRAMPOLINE): Removed,
+ the new generic definition from tm-sysv4.h works for Solaris.
+
+Wed Mar 30 16:14:27 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfread.c (elf_symtab_read): Change storage_needed,
+ number_of_symbols and i to long. Rename get_symtab_upper_bound to
+ bfd_get_symtab_upper_bound. Check for errors from
+ bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
+ * nlmread.c (nlm_symtab_read): Same changes.
+
+Wed Mar 30 11:43:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (xcoff_next_symbol_text): New function.
+ (read_xcoff_symtab): Set next_symbol_text_func to it.
+ Move raw_symbol outside of read_xcoff_symtab.
+
+ * remote.c (getpkt): Remove unused "out" label.
+
+Wed Mar 30 09:15:42 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * breakpoint.c (print_it_normal): Allow GDB to notify the user
+ about more than one watchpoint being triggered.
+
+Wed Mar 30 08:24:18 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/tm-dpx2.h: Include tm-m68k.h not nonexistent tm-68k.h.
+
+Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c (find_pc_partial_function): mst_file_text
+ symbols do not live in the shared library transfer table.
+ * ch-exp.y (decode_integer_value, match_character_literal,
+ match_bitstring_literal): Guard tolower calls with isupper,
+ tolower on old BSD systems blindly subtracts a constant.
+ * dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as
+ well when determining the producer of the object file.
+ * mdebugread.c (has_opaque_xref): New function to check for
+ cross reference to an opaque aggregate.
+ * mdebugread.c (parse_symbol, parse_partial_symbols): Do not
+ enter typedefs to opaque aggregates into the symbol tables.
+ * mdebugread.c (parse_external): Remove skip_procedures argument,
+ it has always been 1. Remove code that handled stProc symbols,
+ it was never executed and was wrong, as the index of a
+ stProc symbol points to the local symbol table and not to the
+ auxiliary symbol info. Update caller.
+ * mdebugread.c (parse_partial_symbols): Do not enter external
+ stProc symbols into the partial symbol table, they are already
+ entered into the minimal symbol table.
+ * config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix.
+ Remove all conditionals and definitions for ptx.
+ I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c.
+ Fix addresses of floating point registers in REGISTER_U_ADDR.
+ STORE_STRUCT_RETURN now handles cc and gcc conventions.
+ FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC,
+ IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through
+ signal trampoline code work.
+ * config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix.
+ Remove all conditionals and definitions for ptx.
+ Remove KDB definitions.
+ * symm-nat.c (store_inferior_registers): Fetch registers before
+ storing them to obtain valid floating point control registers.
+ Store fpu registers.
+ * symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines
+ FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value.
+ * symm-nat.c (fetch_inferior_registers, child_xfer_memory):
+ Fix typos.
+ * symm-nat.c (child_resume): Update type of `signal' parameter.
+ * symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
+
+Tue Mar 29 23:01:33 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Use an alternate method for
+ calling import stubs for functions in shared libraries.
+
+Tue Mar 29 21:14:04 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-exp.y: Implement SIZE(mode_name) and SIZE(expression).
+
+ * ch-lang.c (chill_is_varying_struct): Magic string is
+ was "<var_length>" is now "__var_length" (more portable).
+
+Tue Mar 29 19:41:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c (getpkt): If we get a timeout, actually retry rather
+ than just giving up the first time it happens.
+ * remote.c: Document sequence numbers.
+ (remote_store_registers): Change syntax of 'P' request so that it
+ never looks like a sequence number.
+
+Tue Mar 29 16:06:01 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * os9kread.c (record_minimal_symbol): add section_offset to
+ relocate minimal symbol table.
+ * os9kread.c (read_minimal_symbols): ditto.
+ * os9kread.c (os9k_symfile_init): increase size of dbg and stb
+ file names.
+ * os9kread.c (read_os9k_psymtab): if there's no dbg file, just
+ return. Also if file addr is 0 leave it 0, not to relocate.
+ * remote-os9k.c (_initialize_remote_os9k): add 'set remotexon',
+ 'set remotexoff' and 'set remotelog' commands.
+
+Tue Mar 29 12:38:45 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c (remote_store_registers): Add 'P' request to set an
+ individual register.
+ (remote_write_bytes, remote_read_bytes): Use %lx, not %x, to print
+ a target address.
+
+Sat Mar 26 07:05:18 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/sparc/tm-sparc.h: Define USE_REGISTER_NOT_ARG.
+ * stabsread (define_symbol): If USE_REGISTER_NOT_ARG, go back to
+ combining all 'p' and 'r' pairs into a LOC_REGPARM.
+
+ * command.c (do_setshow_command, case var_string): Never add a
+ space to the end of the string.
+ * NEWS: Document this change.
+ * .gdbinit: Add a space to the "set prompt" command.
+
+Fri Mar 25 12:40:41 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m3-nat.c, i386m3-nat.c, config/i386/i386m3.mh: Many minor
+ changes to make it compile (it doesn't link yet).
+
+ * buildsym.c (start_subfile, patch_subfile_names), demangle.c
+ (set_demangling_style, set_demangling_command): Use savestring not
+ strdup. We were not dealing properly with a NULL return from
+ strdup, and were not declaring strdup (the system header may or
+ may not have it).
+
+ * valprint.c (val_print): Remove inaccurate comment about what
+ types can be stub types.
+
+ * config/i386/ptx.mh (XDEPFILES): Add coredep.o. Delete infptrace.o.
+ * symm-nat.c (child_wait, _initialize_symm_nat, kill_inferior):
+ Supply alternate version if ATTACH_DETACH is not defined.
+ * ptx4-nat.c, config/i386/{nm-ptx4.h, ptx4.mh, ptx.mt, ptx4.mt,
+ tm-ptx.h, tm-ptx4.h, xm-ptx.h, xm-ptx4.h}: New files.
+ * configure.in: Recognize i[34]86-sequent-sysv4* host.
+
+Fri Mar 25 10:14:03 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (skip_prologue): Do nothing if not at the beginning
+ of a function.
+ (skip_trampoline_code): Rewrite and add support for argument
+ relocation stubs stubs, import/export stubs, calls through
+ "_sr4export" and cascaded trampolines.
+
+ * hppa-tdep.c (skip_prologue): Return "pc" not zero
+ if no unwind descriptor is found.
+
+ * tm-hppa.h (NUM_REGS): Bump to 128 registers.
+ (REGISTER_NAMES): Add entries for "right-half" of FP registers.
+ (REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE): Do not treat FP regs
+ differently. All registers are four bytes.
+ (REGISTER_BYTES, REGISTER_BYTE): Simplify now that all registers are
+ the same size.
+ (REGISTER_VIRTUAL_TYPE): Use builtin_type_float for all FP regs.
+
+ * hppa-tdep.c (pa_print_fp_reg): Update to print even numbered FP
+ registers as both single and double values (fetching 2nd 32bit half
+ as necessary). Annotate each register printed with its precision.
+
+ * paread.c (read_unwind_info): Fix off-by-one error.
+
+Fri Mar 25 08:33:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (complete_command): Deal with it if arg is NULL.
+
+Thu Mar 24 07:12:09 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/mips/tm-mips.h (SETUP_ARBITRARY_FRAME): Revise comment
+ regarding using the PC--using the PC is necessary and all the
+ FIXME comments in the world won't make it go away.
+
+ * valops.c (value_at, value_at_lazy): Give error if we dereference
+ a pointer to void.
+ * gdbtypes.h: Fix comments regarding TYPE_CODE_VOID.
+ * stabsread.c: Use 1, not 0, for TYPE_LENGTH of void types.
+
+ * stabsread.c (patch_block_stabs): Add comment about what happens
+ if the definition is in another compilation unit from the stab.
+
+ * dbxread.c (end_psymtab): Add comment about empty psymtabs.
+
+Wed Mar 23 07:50:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (complete_command): New command, from Rick Sladkey
+ <jrs@world.std.com>.
+ (symbol_completion_function): Don't declare rl_point and
+ rl_line_buffer; they are now declared in readline.h.
+ (show_commands): Don't declare history_base; it is declared in
+ history.h.
+ * command.c (lookup_cmd): Don't delete trailing whitespace.
+ Reverts change of 14 May 1989.
+
+Wed Mar 23 16:14:52 1994 Stu Grossman (grossman at cygnus.com)
+
+ * minsyms.c (prim_record_minimal_symbol): Move section deduction
+ code from prim_record_minimal_symbol_and_info() to here. Callers
+ of the latter can legitimately supply a section number of -1.
+
+Wed Mar 23 07:50:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbtypes.h, gdbtypes.c: Add comments regarding whether static
+ member functions have an element in args for a (nonexistent) this
+ pointer.
+
+Tue Mar 22 20:12:53 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppao.h (NO_PC_SPACE_QUEUE_RESTORE): Define.
+
+ * hppa-tdep.c (hppa_pop_frame): Do not restore the PC space
+ queue if NO_PC_SPACE_QUEUE_RESTORE is defined.
+
+ * stabsread.c (REG_STRUCT_HAS_ADDR): Accept additional argument
+ for the structure's type. All callers changed.
+
+ * valops.c (call_function_by_hand): Check REG_STRUCT_HAS_ADDR
+ for each structure argument rather than assuming it's either
+ true or false for all structure arguments.
+
+ * config/pa/tm-hppa.h (REG_STRUCT_HAS_ADDR): Depend only
+ on the length structure passed, not the compiler used.
+
+ * config/sparc/tm-sparc.h (REG_STRUCT_HAS_ADDR): Accept additional
+ argument for the structure's type.
+
+Tue Mar 22 15:28:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * values.c (set_internalvar): Don't set var->value until we are
+ sure there won't be an error().
+
+ * remote.c (get_offsets): Reinstate comment which was in
+ remote_wait about use of SECT_OFF_TEXT and so on.
+
+Mon Mar 21 13:11:30 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symmisc.c (maintenance_check_symtabs): New function to check
+ consistency of psymtabs and symtabs.
+ * symtab.h (maintenance_check_symtabs): Add prototype.
+ * maint.c: Add new `maint check-symtabs' command.
+ * config/i386/tm-i386aix.h, config/i386/tm-sun386.h,
+ config/i386/tm-symmetry.h (REGISTER_CONVERT_TO_RAW): Fix typo.
+ * config/i386/tm-symmetry.h: Make comment inside #if 0 a real
+ comment.
+ * config/i386/tm-symmetry.h (STORE_STRUCT_RETURN): Cast argument
+ to write_memory to avoid warnings from gcc.
+ * config/i386/xm-symmetry.h: Add missing #endif.
+ * config/i386/nm-symmetry.h (NO_PTRACE_H): Add for Dynix.
+ * config/i386/symmetry.mt (TDEPFILES): Add i386-tdep.o.
+ * config/i386/symmetry.mh (NAT_FILE, NATDEPFILES): Add.
+
+Mon Mar 21 11:50:28 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Use value_ptr.
+ (hppa_push_arguments): Likewise.
+
+Mon Mar 21 11:02:51 1994 Stu Grossman (grossman at cygnus.com)
+
+ * alpha-tdep.c: Gobs of changes (many imported from mips-tdep) to
+ improve remote debugging efficiency. Also fixed problems with
+ doing function calls for programs with no entry points.
+ * infcmd.c (run_stack_dummy): Use CALL_DUMMY_ADDRESS instead of
+ entry_point_address.
+ * inferior.h (PC_IN_CALL_DUMMY): ditto.
+ * mdebugread.c (parse_symbol, parse_procedure, parse_external,
+ parse_lines): Pass section_offsets info to these routines so that
+ we can relocate symbol table entries upon readin.
+ * (psymtab_to_symtab_1): Set symtab->primary to tell
+ objfile_relocate to do relocations for our symbols.
+ * (ecoff_relocate_efi): New routine to relocate adr field of PDRs
+ (which hang off of the symbol table).
+ * Use prim_record_minimal_symbols_and_info instead of
+ prim_record_minimal_symbols to supply section info to make minimal
+ symbol relocations work.
+ * minsyms.c (prim_record_minimal_symbols_and_info): If section is
+ -1, try to deduce it from ms_type.
+ * objfiles.c (objfile_relocate): Use ALL_OBJFILE_SYMTABS where
+ appropriate. Handle relocation of MIPS_EFI symbols special. Also,
+ add code to relocate objfile->sections data structure.
+ * remote.c (get_offsets): Use new protocol message to acquire
+ section offsets from the target.
+ * (remote_wait): Get rid of relocation stuff. That's all handled
+ by objfile_relocate now.
+ * config/alpha/alpha-nw.mt (TM_FILE): Use tm-alphanw.h.
+ * config/alpha/tm-alpha.h: Define CALL_DUMMY_ADDRESS, and
+ VM_MIN_ADDRESS.
+ * config/alpha/tm-alphanw.h: DECR_PC_AFTER_BREAK=0, VM_MIN_ADDRESS=0.
+
+Mon Mar 21 10:09:06 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (_initialize_hpuxread): Don't call add_symtab_fns if
+ HPREAD is not defined.
+
+Sun Mar 20 15:21:57 1994 Doug Evans (dje@cygnus.com)
+
+ * sparc-tdep.c (sparc_frame_find_save_regs): Use REGISTER_RAW_SIZE
+ instead of 4.
+ * sp64-tdep.c (target_ptr_bit, set_target_ptr_bit): Deleted,
+ can no longer set this at run time.
+ * config/sparc/sp64.mt (SIMFILES): Use remote-sim.o now.
+ (TM_CLIBS): Define to -lm, the simulator uses the sqrt() function.
+ * config/sparc/tm-sp64.h (FPS_REGNUM, CPS_REGNUM): Define (so
+ sparc-tdep.c compiles).
+ (TARGET_PTR_BIT): Must be a constant now, fix at 64.
+
+Sat Mar 19 08:51:12 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/{cisco.mt,tm-cisco.h}: New files.
+ * Makefile.in (ALLPARAM, ALLCONFIG): Add them.
+ * configure.in: Recognize m68*-cisco*-*.
+
+ * Makefile.in (TAGS): Use variables directly, rather than using
+ find, to locate TM_FILE, XM_FILE, and NAT_FILE. This is faster
+ and means that these filenames no longer need be unique across all
+ the config/* directories.
+ * configure.in: Put the config/*/ into TM_FILE, etc.
+
+ * m68k-stub.c (computeSignal): Return SIGFPE, not SIGURG, for chk
+ and trapv exceptions.
+
+ * target.h (struct section_table), objfiles.h (struct obj_section):
+ Change name of field sec_ptr to the_bfd_section. More mnemonic
+ and avoids the (sort of, for the ptx compiler) name clash with
+ the name of the typedef.
+ * exec.c, xcoffexec.c, sparc-tdep.c, rs6000-nat.c, osfsolib.c,
+ solib.c, irix5-nat.c, objfiles.c, remote.c: Change users.
+
+ * utils.c: Include readline.h.
+ * Makefile.in (utils.o): Add dependency.
+
+ * remote.c (getpkt): Add support for run-length encoding.
+
+Fri Mar 18 19:11:15 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * utils.c (prompt_for_continue): Call readline, not gdb_readline.
+
+Fri Mar 18 10:25:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dstread.c (record_minimal_symbol): New arg objfile. Pass it to
+ prim_record_minimal_symbol.
+ Callers: Pass it.
+
+ * regex.c (EXTEND_BUFFER): Adjust pointers within buffer by
+ computing their offset from the start of the old buffer and adding
+ to the new buffer, rather than by assuming we can add the
+ difference between the old buffer and the new buffer (it might not
+ fit in an int). Merge in cosmetic differences from emacs regex.c
+ version of this macro.
+
+Wed Mar 16 15:28:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * Makefile.in (install-only): Fix use of program_transform_name.
+
+Wed Mar 16 07:18:43 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c: Remove "set print fast-symbolic-addr off" command.
+ The bug which it worked around was fixed on 25 Feb 94 in coffread.c,
+ so I'm nuking the command.
+ * symtab.c (find_addr_symbol): Comment out, no longer used.
+
+ * main.c (main): Don't init_source_path for the -cd argument. Now
+ that source_path doesn't contain the current_directory from when
+ GDB started up, init_source_path is no longer useful (and is
+ harmful because it clobbers a source_path set in $HOME/.gdbinit).
+
+ * TODO: Remove item about line numbers being off. It is useless
+ and confusing without a reproducible test case (it mentions
+ proceed(), but I was able to step through proceed without trouble).
+
+Tue Mar 15 13:39:23 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ For Sunos 4.x targets, enable gdb to set breakpoints in shared
+ library functions before the executable is run. Retrieve dynamic
+ symbols from stripped executables.
+ * symtab.h (minimal_symbol_type): Add mst_solib_trampoline type.
+ * parse.c (write_exp_msymbol), symmisc.c (dump_msymbols),
+ symtab.c (list_symbols): Handle mst_solib_trampoline.
+ * minsyms.c (lookup_minimal_symbol): Handle mst_solib_trampoline
+ for all targets, remove IBM6000_TARGET dependencies.
+ * dbxread.c (read_dbx_dynamic_symtab): New function.
+ * dbxread.c (dbx_symfile_read): Use it.
+ * dbxread.c (SET_NAMESTRING): Set namestring to
+ "<bad string table index>" instead of "foo" if the string index is
+ corrupt.
+ * xcoffread.c (read_xcoff_symtab): Use mst_solib_trampoline instead
+ of mst_unknown.
+ * symtab.c (list_symbols): Take from_tty as parameter and pass it
+ to break_command. Handle mst_file_* minimal symbol types.
+ * config/i386/tm-i386bsd.h: Give just macro name, not args, to #undef.
+
+Tue Mar 15 11:40:43 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * c-exp.y(yylex): fix potential memory overflow.
+
+Tue Mar 15 10:33:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * environ.c (set_in_environ): Eliminate special handling of PATH and
+ GNUTARGET.
+ * putenv.c: Removed, conflicts with system declaration of
+ putenv on RS/6000 running AIX 3.2.5, and above change makes it
+ unnecessary.
+ * Makefile.in: Change accordingly.
+ * procfs.c (procfs_create_inferior): Change comment accordingly.
+
+Tue Mar 15 10:05:27 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * rs6000-tdep.c: Change value to value_ptr.
+
+Sun Mar 13 17:19:03 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (read_hpux_symtab: Correctly determine the namespace
+ and address class of SVAR, DVAR, TYPEDEF, TAGDEF, CONST, and
+ MEMENUM symbols. Do not include function-scoped variables in
+ the partial symbol table.
+
+Sun Mar 13 09:45:51 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i386m3-nat.c: Include floatformat.h.
+ (get_i387_state): Use memset not bzero.
+
+ * Version 4.12.3.
+
+ * Makefile.in: Enable commented out getopt_h, bfd_h, etc. Change
+ ieee-float.h to floatformat.h.
+
+ * valprint.c (val_print_string): Ignore error if the error
+ happened after a terminating '\0'.
+
+ * c-valprint.c (c_val_print): Never add 1 to return value from
+ val_print_string; just return what it returns.
+
+ * target.h (enum target_signal): Add TARGET_SIGNAL_FIRST, for
+ looping through all of the enums.
+ * infrun.c (signals_info): Use it.
+
+Fri Mar 11 08:08:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * main.c (main): When printing warning about bad baud rate, don't
+ use warning(); it relies on current_target which isn't set up yet.
+
+ * breakpoint.c (_initialize_breakpoint): Update docstring for
+ tbreak to match what the code actually does. Don't mention tbreak
+ in docstrings for "enable once" or "enable breakpoints once".
+
+Thu Mar 10 08:52:38 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symfile.h (ADD_PSYMBOL_VT_TO_LIST): Don't put a semicolon after
+ while (0). That defeats the whole purpose of using do . . . while (0).
+ * mdebugread.c (parse_partial_symbols): Don't use ?: expression as
+ list for ADD_PSYMBOL_TO_LIST; the macro takes its address and
+ using a ?: expression as an lvalue is not portable.
+
+ * stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR, also
+ convert a LOC_ARG to a LOC_REF_ARG. Update code which combines
+ 'p' and 'r' symbol descriptors into a single symbol to look for a
+ LOC_REF_ARG.
+ * README, config/sparc/tm-sparc.h: Update comments.
+
+Wed Mar 9 21:43:24 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_type): Do not complain for types with
+ an `indexNil' aux index, these are simply undefined types.
+ Remove indexNil check from caller of parse_type.
+ * mdebugread.c (parse_partial_symbols): Do not enter
+ stGlobal, scCommon symbols into the minimal symbol table, their
+ value is the size of the common, not its address.
+ Handle scInit, scFini, scPData and scXData sections.
+ Use minimal symbol type mst_file_* for stLabel symbols, instead of
+ mst_*.
+ Enter stProc symbols into the global_psymbols list once, not into
+ the static_psymbols_list.
+ Get rid of dummy psymtab if it is empty, to allow proper detection
+ of stripped executables.
+ * mdebugread.c (cross_ref): Allow cross references to Fortran
+ common blocks.
+
+Wed Mar 9 15:23:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (common_block_end, fix_common_block): Stash the
+ struct pending * in the SYMBOL_TYPE, not the SYMBOL_NAMESPACE, so
+ as to not assume that a pointer fits in an enum.
+
+Wed Mar 9 18:56:36 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * os9kread.c (fill_sym): check compiler verion number for pre-
+ UltraC compiler.
+ * os9kread.c (os9k_process_one_symbol): address of symbol is
+ relative to section not module.
+ * stabsread.c (define_symbol): add symbol type 's' as local
+ symbol for os9k.
+ * remote-os9k.c: add command 'set monitor_log' to turn on or off
+ monitor logging.
+ * remote-os9k.c: fix bug in delete breakpoint, single step trace.
+ * remote-os9k.c: fix bug in 'set remotebaud' function.
+ * remote-os9k.c (rombug_link): minimize checking so to improve
+ speed.
+ * symfile.c (symbol_file_command): check if failed to link, also make
+ the command be able to accept more than one filenames.
+ * target.c (target_link): check if failed to link with rombug.
+ * config/i386/tm-i386os9k.h : add #define DECR_PC_AFTER_BREAK 0.
+
+Wed Mar 9 15:23:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-es.c (es1800_child_ops): Don't declare it static.
+
+Tue Mar 8 11:42:39 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/i386/tm-i386v4.h: Give just macro name, not args, to #undef.
+
+Tue Mar 8 06:56:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c: New variable lowest_text_address.
+ (record_minimal_symbol, read_dbx_symtab): Set it.
+ (read_dbx_symtab): Use lowest_text_address + text_size instead of
+ end_of_text_address.
+ * config/gould/tm-pn.h: Add comment regarding END_OF_TEXT_DEFAULT.
+
+ * dbxread.c (end_psymtab): Remove old and commented out
+ capping_global and capping_static. Fix comments regarding
+ N_SO_ADDRESS_MAYBE_MISSING to match the real name of the macro.
+
+ * parser-defs.h: Add "extern" to start of variable declarations so
+ we don't end up with commons.
+ * parse.c: Define these variables.
+
+ * irix5-nat.c (find_solib): Cast o_path to CORE_ADDR when using it
+ as one.
+
+Mon Mar 7 13:00:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * alpha-tdep.c: Change value to value_ptr.
+
+Sun Mar 6 17:36:53 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * solib.c (elf_locate_base): New function to locate the address
+ of the dynamic linker's runtime structure in the dynamic info section.
+ * solib.c (locate_base): Use it instead of iterating over the list
+ of mapped address segments.
+ * solib.c (look_for_base, bfd_lookup_symbol): Removed, no longer
+ necessary.
+
+Fri Mar 4 09:50:47 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (pc_in_linker_stub): Move decl to beginning of file.
+ (pc_in_interrupt_handler): New function. Also add PARAM decl.
+ (find_proc_framesize): Deal with HPUX setting SAVE_SP bit for
+ signal trampoline and interrupt routines.
+ (frame_saved_pc): Handle signal trampolines and interrupt routines.
+ (frame_chain, frame_chain_valid): Likewise.
+ (hppa_frame_find_saved_regs): Likewise. Also deal with special
+ saved regs convention for SP.
+
+ * tm-hppa[bho].h: FRAME_FIND_SAVED_PC_IN_SIGTRAMP): Define.
+ (FRAME_BASE_BEFORE_SIGTRAMP): Define.
+ (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP): Define.
+
+ * tm-hppah.h (IN_SIGTRAMP): Define.
+
+Thu Mar 3 12:41:16 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * ch-exp.y (match_simple_name_string): Accept '_' as well as an
+ alphabetic character as the start of a name.
+
+ * sparclite/Makefile.in (all install): Build and install aload.
+
+ * configure.in: Accept i[34]86-*-*sysv32 because that is what
+ config.guess and config.sub produce.
+
+ * mips-tdep.c: Change value to value_ptr.
+
+Wed Mar 2 09:17:55 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * breakpoint.c, breakpoint.h, c-valprint.c, ch-valprint.c,
+ cp-valprint.c, eval.c, expprint.c, findvar.c, language.c,
+ objfiles.h, infcmd.c, printcmd.c, stack.c, typeprint.c,
+ valarith.c, valops.c, valprint.c, value.h, values.c: Replace
+ value with value_ptr. This is for the ptx compiler.
+ * objfiles.h, target.h: Don't declare a "sec_ptr" field using a
+ "sec_ptr" typedef.
+ * symm-nat.c: Add a bunch of stuff for symmetry's ptrace stuff.
+ #if 0 i386_float_info.
+ * symm-tdep.c (round): Remove. Also remove sgttyb.
+ * symm-tdep.c: Remove lots of stuff which duplicates stuff from
+ i386-tdep.c. Remove register_addr and ptx_coff_regno_to_gdb.
+ * i386-tdep.c (i386_frame_find_saved_regs): Put in
+ I386_REGNO_TO_SYMMETRY check in case it is needed for Dynix
+ someday.
+ * config/i386/nm-symmetry.h: Change KERNEL_U_ADDR. Move
+ stuff from PTRACE_READ_REGS, PTRACE_WRITE_REGS macros to
+ symm-nat.c. Define CHILD_WAIT and declare child_wait().
+ * config/i386/tm-symmetry.h: Remove call function stuff; stuff in
+ tm-i386v.h is apparently OK.
+ * config/i386/xm-symmetry.h [_SEQUENT_]: Define HAVE_TERMIOS not
+ HAVE_TERMIO. Define MEM_FNS_DECLARED, NEED_POSIX_SETPGID, and
+ USE_O_NOCTTY.
+
+Wed Mar 2 11:31:08 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * osfsolib.c (xfer_link_map_member): Update to use new
+ target_read_string interface.
+
+Wed Mar 2 09:17:55 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * infrun.c (wait_for_inferior): In checking
+ remove_breakpoints_on_following_step, check
+ through_sigtramp_breakpoint as well as step_resume_breakpoint.
+
+Tue Mar 1 16:22:56 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * os9kread.c (os9k_process_one_symbol): Rename
+ VARIABLES_INSIDE_BLOCK to OS9K_VARIABLES_INSIDE_BLOCK.
+ * symfile.c (symbol_file_command): Check for (CORE_ADDR)-1, not
+ (CORE_ADDR)0, from target_link, since that is what it uses.
+ Process name at end, not during parsing (like we did before Kung's
+ change), so that -readnow and -mapped can appear anywhere.
+ Make text_relocation a local variable.
+ * config/i386/i386os9k.mt: Fix comment.
+ * Makefile.in (ALLDEPFILES): Add remote-os9k.c.
+ * os9kread.c: Put "comments" after #endif inside /* */.
+ * stabsread.h: Add os9k_stabs variable.
+ * stabsread.c (start_stabs), os9kread.c (os9k_process_one_symbol):
+ Set it.
+ * stabsread.c (define_symbol): If os9k_stabs, put a 'V' symbol
+ descriptor in global_symbols not local_symbols.
+ (read_type): If os9k_stabs, accept 'c', 'i', and 'b' type
+ descriptors.
+ (read_type): If os9k_stabs, accept function parameters after 'f'
+ type descriptor.
+ (read_array_type): If os9k_stabs, don't expect index type and
+ expect lower and upper to be separated by ',' not ';'.
+ (read_enum_type): If os9k_stabs, read a number before the first
+ enumeration constant.
+ (os9k_init_type_vector): New function.
+ (dbx_lookup_type): Call it when starting new type vector.
+ * config/i386/tm-i386os9k.h: Define BELIEVE_PCC_PROMOTION.
+ * (os9k_process_one_symbol): Call define_symbol not os9k_define_symbol.
+ * os9kstab.c: Removed.
+ * Makefile.in: Update accordingly.
+ * objfiles.c (objfile_relocate_data): Removed.
+ * remote-os9k.c (rombug_wait): Call objfile_relocate
+ not objfile_relocate_data.
+ * objfiles.h, objfiles.c: Remove find_pc_objfile.
+ * remote-os9k.c (rombug_wait): Call find_pc_section not
+ find_pc_objfile.
+ * main.c (quit_command): Check inferior_pid; revert Kung change.
+ * remote-os9k.c (rombug_create_inferior): Set inferior_pid.
+
+Tue Mar 1 14:56:14 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * os9kread.c: New file to read os9000 style symbo table.
+ * os9kstab.c: new file to read os9000 style stabs.
+ * remote-os9k.c: remote protocol talking to os9000 rombug monitor.
+ * objfiles.c (find_pc_objfile): new function to search objfile
+ from pc.
+ * objfiles.c (objfile_relocate_data): new function to relocate
+ data symbols in symbol table.
+ * objfiles.h: Add two aux fields in struct objfile to handle
+ multiple symbol table files situation like in os9000.
+ * symfile.c: Change so 'symbol-file' command can handle multiple
+ files. Also call target_link() to get relocation infos.
+ * target.c (target_link): new function to get relocation info when
+ a symbol file is requested to load.
+ * main.c (quit_command): take out 'inferior_pid != 0' condition,
+ because in cross mode there's no inferior pid, bit they need to
+ be detached.
+ Makefile.in: add os9kread.c os9kstab.c and .o's.
+ configure.in: add i386os9k target.
+ config/i386/i386os9k.mt: new add.
+ config/i386/tm-i386os9k.h: new add.
+
+Tue Mar 1 13:16:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/sparc/tm-sun4sol2.h (IN_SIGTRAMP): Handle ucbsigvechandler.
+ * sparc-tdep.c (sparc_frame_saved_pc): Handle ucbsigvechandler.
+
+Tue Mar 1 11:54:11 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * target.c, target.h (target_read_string): Provide error detection to
+ caller. Put string in malloc'd space, so caller need not impose
+ arbitrary limits.
+ * solib.c (find_solib): Update to use new interface.
+ * irix5-nat.c (find_solib): Read o_path from inferior
+ (clear_solib): Free storage for o_path.
+ * valprint.c (val_print_string): Add comments.
+
+Mon Feb 28 23:54:39 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.c (decode_line_1): Handle the case when skip_quoted does not
+ advance `p'.
+
+Mon Feb 28 12:40:46 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * value.h (struct value): Add modifiable field.
+ * values.c (allocate_value, record_latest_value, value_copy): Set it.
+ (record_latest_value): Don't mess with VALUE_LVAL of value.
+ * valops.c (value_assign): Check it. Reword existing error
+ message on not_lval.
+
+ * mips-tdep.c (mips_step_skips_delay), config/mips/tm-mips.h
+ (STEP_SKIPS_DELAY): Added.
+ * infrun.c (proceed) [STEP_SKIPS_DELAY]: Check for a breakpoint in
+ the delay slot.
+
+ * valprint.c (val_print_string): If errcode is set, always print
+ an error, regardless of force_ellipsis. In the non-EIO case,
+ just print the error message rather than calling error(). Don't
+ access *(bufptr-1) if bufptr points to the start of the buffer.
+ When looking for '\0', don't increment bufptr and addr if bufptr
+ started out already at limit. If an error happens on fetching the
+ first character, don't print the string.
+
+Sun Feb 27 21:05:06 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * config/m68k/tm-apollo68b.h: Remove HAVE_68881 define; it is
+ obsolete.
+
+ * i387-tdep.c, i386-tdep.c i386v-nat.c, i386aix-nat.c,
+ i386m3-nat.c, config/m68k/tm-m68k.h, i960-tdep.c
+ config/i960/tm-i960.h, remote-nindy.c, config/m88k/tm-m88k.h,
+ m88k-tdep.c: Use floatformat.h instead of ieee-float.h.
+ * sparc-tdep.c: Remove now-obsolete ieee-float.h stuff
+ * findvar.c: Update comment regarding ieee-float.h.
+
+Sun Feb 27 21:39:48 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/i386/tm-i386v4.h (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP,
+ FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC):
+ Define to make backtracing through the various sigtramp handlers
+ work.
+ * i386-tdep.c (i386v4_sigtramp_saved_pc): New routine to fetch
+ the saved pc from ucontext on the stack for SVR4 signal handling.
+
+Fri Feb 25 09:41:11 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote.c, remote-mon.c, remote-utils.c, remote-utils.h,
+ target.h, remote-es.c, remote-nindy.c: Don't set baud rate if
+ baud_rate is -1. Remove sr_get_baud_rate and sr_set_baud_rate;
+ just use the global variable itself. When printing baud rate,
+ don't print a baud rate if baud_rate is -1.
+
+ * coffread.c (read_coff_symtab): Pass mst_file_* to
+ record_minimal_symbol for C_STAT symbols. Put C_EXT and C_STAT
+ symbols in the minimal symbols regardless of SDB_TYPE.
+
+Thu Feb 24 08:30:33 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * breakpoint.h (enum bptype): New type bp_through_sigtramp.
+ (bpstat_what_main_action): New code BPSTAT_WHAT_THROUGH_SIGTRAMP.
+ * breakpoint.c (bpstat_what): Return BPSTAT_WHAT_THROUGH_SIGTRAMP
+ if we hit a bp_through_sigtramp breakpoint. Remove kludge which
+ ignored bs->stop for a bp_step_resume breakpoint.
+ * infrun.c (wait_for_inferior): Make a through_sigtramp_breakpoint
+ which performs one (the check_sigtramp2 one) of the functions
+ which had been handled by the step_resume_breakpoint. For each
+ use of the step_resume_breakpoint, make it still use the
+ step_resume_breakpoint, use the through_sigtramp_breakpoint, or
+ operate on both.
+ Deal with BPSTAT_WHAT_THROUGH_SIGTRAMP return from bpstat_what.
+ When setting the frame address of the step resume breakpoint, set
+ it to the address for frame *before* the call instruction is
+ executed, not after.
+
+ * mips-tdep.c (mips_print_register): Print integers using
+ print_scalar_formatted rather than duplicating all the
+ CC_HAS_LONG_LONG and so on.
+ (mips_push_dummy_frame): Use read_register_gen rather than using
+ read_register and then putting it back in target format with
+ store_unsigned_integer. If registers are more than 4 bytes, give
+ an error rather than have some registers overwrite other
+ registers.
+ #if 0 unused include of opcode/mips.h.
+
+ * symfile.h: Don't declare arguments for coff_getfilename.
+
+ * defs.h: Revert Kung change regarding FORCE_LONG_LONG.
+
+Thu Feb 24 08:06:52 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * configure.in (hppa*-*-osf*): New configuration.
+ * config/pa/hppaosf.mt: New target makefile fragment.
+ * config/pa/tm-hppao.h: New target include file.
+
+Thu Feb 24 04:29:19 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * exec.c (print_section_info): Print entry point for exec_bfd only.
+ * ser-unix.c (wait_for): Fix typo in HAVE_TERMIO case.
+ * dwarfread.c: Remove second inclusion of <sys/types.h>, which
+ causes problems if <sys/types.h> has no multiple inclusion protection.
+
+Wed Feb 23 16:28:55 1994 Jeffrey A. Law (law@cygnus.com)
+
+ * tm-hppa.h (CALL_DUMMY): Add two NOP instructions to the end of
+ the call dummy to avoid kernel bugs in HPUX, BSD, and OSF1.
+ (CALL_DUMMY_LENGTH): Changed accordingly.
+
+Wed Feb 23 16:21:25 1994 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-stub.c (trap_low): Make trap handler work for arbitrary
+ numbers of register windows.
+
+ * sparclite/hello.c: Add factorial function for testing.
+ * salib.c: Use macros instead of constants for I/O addresses to
+ make 931 support easier.
+ * sparclite.h: Change constraint for LOC to "rJ" to force use of
+ register in sta/lda instructions.
+
+Wed Feb 23 10:39:18 1994 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * dbxread.c (process_one_symbol): Set
+ block_address_function_relative for COFF like we do for ELF and SOM.
+
+Sat Feb 19 03:17:32 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (new_psymtab): Pass in section_offsets and set
+ them in the pst.
+ * mdebugread.c (handle_psymbol_enumerators): New function to enter
+ the enumerators of an ecoff enum into the partial symbol table.
+ * mdebugread.c (parse_partial_symbols): Call it.
+ * symfile.c (reread_symbols): Initialize objfile->*_psymbols.next.
+ * symmisc.c (dump_psymtab): Fix typo, clean up output of section
+ offsets. Cast psymtab->read_symtab to PTR before passing it to
+ gdb_print_address.
+ * i386-tdep.c (i386_skip_prologue): Skip over instructions that
+ set up the global offset table pointer in pic compiled code.
+ * config/mips/tm-mips.h (FIX_CALL_DUMMY): For big endian targets,
+ error() on TYPE_CODE_FLT arguments whose size is greater than 8,
+ swap all other TYPE_CODE_FLT arguments as mips_push_arguments
+ ensures that floats are promoted to doubles before they are pushed
+ on the stack.
+
+Fri Feb 18 23:12:59 1994 Stu Grossman (grossman at cygnus.com)
+
+ * sparclite/Makefile.in, sparclite/salib.c, sparclite/sparclite.h:
+ Fixup cache_on and flush_i_cache so that they work for both the
+ 930 and 932 processors. Rewrite most low level funcs (uart
+ access & cache stuff) to use new ASI access macros in sparclite.h.
+ Also make it easy to access second serial port.
+
+Fri Feb 18 22:17:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * hp300ux-nat.c: Don't incloude <sys/dir.h>, <sys/ioctl.h>, or
+ <sys/stat.h>; not needed.
+
+Fri Feb 18 08:26:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stack.c (print_frame_info): In "pathological" case, don't
+ distrust the line number information.
+
+Fri Feb 18 16:51:14 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * mips-tdep.c (mips_print_register): handle 64 bits register.
+ * valprint.c (print_longest): fix a bug in printing 64 bits value.
+
+Fri Feb 18 08:26:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Version 4.12.2.
+
+ * Makefile.in (install): Do the sed for program_transform_name
+ ourselves instead of worrying about INSTALL_XFORM. This enables
+ users to override INSTALL_PROGRAM in the standard way.
+
+ * Makefile.in (c-exp.tab.o, ch-exp.tab.o, m2-exp.tab.o): Don't
+ depend on Makefile.in.
+
+ * defs.h, valprint.c: Make longest_to_int a function not a macro.
+ Only test against INT_MIN if a LONGEST is bigger than an int.
+
+ * README: Change GhostScript to Ghostscript.
+
+Fri Feb 18 07:30:55 1994 Jim Kingdon (kingdon@cygnus.com)
+
+ * config/rs6000/{tm-rs6000lynx.h,nm-rs6000lynx.h,xm-rs6000lynx.h}:
+ Rename to tm-rs6000ly.h, nm-rs6000ly.h, xm-rs6000ly.h for 14
+ character file names.
+ * Makefile.in (ALLPARAM): Add these files.
+
+ * config/mips/littlemips64.mt: Rename to mipsel64.mt for 14
+ character file names.
+ * Makefile.in: Add Kung's new mips64 files.
+
+Thu Feb 17 17:25:47 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * configure.in: add mips64-*-elf, mips64-*-ecoff, mips64el-*-elf,
+ mips64el-*-ecoff and mips64-big-*.
+ * defs.h: get rid of FORCE_LONG_LONG.
+ * mips-tdep.c (mips_find_saved_regs): add sd and sdc1 instruction
+ parsing. Change register size to be MIPS_REGSIZE.
+
+Thu Feb 17 09:30:22 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * corelow.c, exec.c, irix5-nat.c, mipsread.c, objfiles.c,
+ osfsolib.c, rs6000-nat.c, solib.c, symfile.c, utils.c,
+ xcoffexec.c: Use bfd_get_error and bfd_set_error and new error names.
+
+Fri Feb 11 21:47:24 1994 Steve Chamberlain (sac@sphagnum.cygnus.com)
+
+ * remote-hms.c (readchar, hms_open, hms_fetch_register): Made more robust.
+ (remove_commands, add_commands): Add/remove hms-drain when target
+ is connected.
+
+Fri Feb 11 16:11:38 1994 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Add Lynx/rs6000 support.
+ * lynx-nat.c: Clean up some Sparc stuff. Clean up ptrace error
+ messages. Add rs6000 support. Don't try to modify unwritable
+ registers.
+ * rs6000-nat.c: Move lots of native dependent stuff (like core
+ file support) from rs6000-tdep.c & xcoffexec.c to here.
+ * rs6000-tdep.c: Move native dependent stuff to nat.c.
+ * xcoffexec.c: Move native dependent stuff to nat.c.
+ * config/rs6000/nm-rs6000.h: Move defs of SOLIB_* macros to here
+ from tm file.
+ * config/rs6000/tm-rs6000.h: Remove defs of SOLIB_* funcs, cuz they're
+ really native.
+ * config/rs6000/tm-rs6000lynx.h, config/rs6000/xm-rs6000lynx.h:
+ New files to support Lynx/rs6000.
+
+Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * README: Remove note about gcc warnings on alpha, these should be
+ gone now.
+ * c-exp.y, ch-exp.y, core.c, corelow.c, eval.c, fork-child.c,
+ m2-exp.y, minsyms.c, nlmread.c, parse.c, putenv.c, regex.c
+ remote-utils.c, stabsread.c: Include <string.h>.
+ * regex.c: Include "defs.h", change re_comp argument to const char *.
+ * infptrace.c (fetch_register, store_inferior_registers): Change
+ regaddr to type CORE_ADDR.
+ * config/alpha/alpha-nw.mt, config/alpha/alpha-osf1.mt (MT_CFLAGS):
+ Remove, no longer necessary now that we use bfd_vma for a CORE_ADDR.
+
+Mon Feb 7 09:21:17 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * symtab.h: Always define BYTE_BITFIELD to nothing.
+
+Mon Feb 7 08:44:17 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * config/m68k/{m68k-em.mt,tm-m68k-em.h}: Remove; no longer used.
+ * configure.in: Remove comment about m68k-em.mt.
+ * Makefile.in: Remove references.
+
+Mon Feb 7 08:22:42 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * defs.h [BFD64]: Use BFD_HOST_64_BIT, not nonexistent
+ BFD_HOST_64_TYPE.
+
+Sun Feb 6 15:56:09 1994 Jeff Law (law@wild.cs.utah.edu)
+
+ * hpread.c (hpux_symfile_init): Use obj_som_* rather than obj_* to
+ access BFD private data. Search for the "$TEXT$" space rather
+ than ".text".
+ (hppa_sym_fns): Add bfd target flavour to initializer.
+
+Sun Feb 6 06:55:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.c (target_preopen): If target_kill doesn't remove the
+ target from the stack, use pop_target to do it.
+
+ * coffread.c (process_coff_symbol, case C_TPDEF): Don't set name
+ of TYPE_CODE_PTR or TYPE_CODE_FUNC types. This parallels similar
+ changes to stabsread.c from summer 1993.
+
+ * remote-udi.c (udi_files_info): If prog_name is NULL, just skip
+ printing the program, rather than passing NULL to printf.
+ (udi_detach): Set udi_session_id to -1 so that udi_close doesn't
+ try to call UDIDisconnect again. Print better message.
+ (udi_kill): Just call UDIDisconnect ourselves, rather than doing
+ it via udi_close.
+ (udi_create_inferior): If udi_session_id is negative, open a new
+ TIP rather than giving an error.
+
+ * config/mips/mipsm3.mh, config/i386/i386m3.mh,
+ config/ns32k/ns32km3.mh: Define NAT_FILE.
+ * config/nm-m3.h: Change guard from _OS_MACH3_H_ and _OS_MACH3_H
+ (it was inconsistent and namespace-wrong) to NM_M3_H.
+ * m3-nat.c (mach_really_wait): Change parameter name to ourstatus.
+ (m3_open): New function.
+ (m3_ops): Use it.
+ * TODO: Update Mach section.
+
+ * Makefile.in: Remove "rapp" stuff; it is superseded by gdbserver.
+
+Sun Feb 6 13:26:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * printcmd.c (printf_command): Add missing single-letter
+ backslash-escape sequences, and improve error message.
+
+Sun Feb 6 06:55:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * corelow.c (solib_add_stub, core_open): Pass address of from_tty
+ rather than trying to shove an int into a pointer and back out
+ again. This avoids compiler warnings.
+
+ * defs.h (alloca): Declare as void *, not char *, on hpux.
+ Don't prototype it, just declare the return type.
+
+Sun Feb 6 03:25:41 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/i386/tm-sun386.h, config/i386/tm-symmetry.h
+ (REGISTER_CONVERT_TO_RAW): Add missing backslash.
+
+Sat Feb 5 08:03:41 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-mips.c (mips_fetch_registers): If regno is FP_REGNUM or
+ ZERO_REGNUM, just read it as zero without talking to the board.
+
+ * config/i386/tm-i386aix.h (REGISTER_CONVERT_TO_RAW): Add missing
+ backslash.
+ * i386-tdep.c (i386_extract_return_value): Pass TYPE_LENGTH (type)
+ to store_floating, not nonexistent variable len.
+
+ * remote-mips.c (mips_insert_breakpoint, mips_remove_breakpoint):
+ New functions.
+ (mips_store_word): Change calling convention to return errors, and
+ to provide old contents if the caller wants it.
+ (mips_xfer_memory): Deal with errors from mips_store_word.
+ * config/mips/tm-idt.h, config/mips/tm-idtl.h: Remove BREAKPOINT
+ define now that remote-mips.c doesn't use BREAKPOINT.
+
+ * remote-mips.c (mips_create_inferior): Call warning if arguments
+ specified, and then execute "set args" command. Call error, not
+ mips_error, if executable file not specified.
+
+ * remote-e7000.c: Replace "snoop" command (e7000_noecho) with
+ remote_debug.
+
+ * config/rs6000/tm-rs6000.h (STORE_STRUCT_RETURN): Don't cast
+ to unsigned int.
+
+Sat Feb 5 05:27:05 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * value.h (print_longest): Rename "value" to "val" in prototype
+ declaration because some compilers don't like arguments whose
+ names are the same as types.
+ * remote.c (remote_xfer_memory): Cast "myaddr" to unsigned char *
+ before passing it to remote_*_bytes.
+
+Fri Feb 4 15:53:18 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * h8500-tdep.c (saved_pc_after_call): The size of the
+ pc is memory model dependent. (segmented_command,
+ unsegmented_command, _initialize_h8500_tdep): New commands to
+ change memory model.
+ * remote-e7000.c (_initialize_remote_e7000): Change name of snoop
+ command.
+ * remote-hms.c (hms_load): Remove breakpoints when loaded.
+ (hms_wait): Use new status structure
+ (hms_open): Push the target here. (hms_before_main_loop): Not
+ here. (supply_val, hms_fetch_register, hms_store_register): Cope
+ with H8/500 names too. (hms_fetch_register): Take out REGISTER_TYPE.
+ * sh-tdep.c (show_regs, initialize_sh_tdep): New command to print
+ all registers in a compact way.
+
+Fri Feb 4 07:41:13 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * config/rs6000/tm-rs6000.h: Declare rs6000_struct_return_address
+ as CORE_ADDR to match definition in rs6000-tdep.c.
+
+Fri Feb 4 01:14:20 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dwarfread.c (process_dies): Skip nested TAG_compile_unit DIEs.
+ * dwarfread.c (add_partial_symbol): Do not enter opaque aggregate
+ definitions into the psymtab.
+
+Thu Feb 3 12:38:58 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * m68k-stub.c: Treat mc68332 like mc68020 most places. Provide
+ a special exceptionSize for the 68332.
+
+ * remote-udi.c (udi_attach): If no arguments, print error.
+
+Thu Feb 3 17:34:05 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.12.1
+ * NEWS, README: Update to match 4.12 release.
+
+Thu Feb 3 12:38:58 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * command.c (empty_sfunc): New function.
+ (add_set_cmd): Use it instead of not_just_help_class_command.
+ (not_just_help_class_command): Change calling convention back to
+ what it was before yesterday's change.
+
+ * stabsread.c (read_sun_builtin_type): Skip the semicolon at the end
+ of the type if present.
+
+Wed Feb 2 11:16:45 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (decode_format): Don't blithely set the size for
+ an address to 'w'. Make it 'g' or 'h', depending on TARGET_PTR_BIT.
+
+ * defs.h: Just typedef CORE_ADDR to bfd_vma. Include bfd.h.
+ If BFD64, make a LONGEST a BFD_HOST_64_BIT.
+ * defs.h (longest_to_int): Don't depend on CC_HAS_LONG_LONG; instead
+ always just check against INT_MIN and INT_MAX (this also fixes things
+ if sizeof (long) > sizeof (int), e.g. Alpha).
+ * config/pa/tm-hppa.h, config/i386/sun386.h, config/rs6000/tm-rs6000.h:
+ Don't define LONGEST or BUILTIN_TYPE_LONGEST.
+ * gdbtypes.h: Remove BUILTIN_TYPE_LONGEST and
+ BUILTIN_TYPE_UNSIGNED_LONGEST.
+ * language.h, c-lang.c, ch-lang.c, m2-lang.c, language.c: Remove
+ longest_int and longest_unsigned_int.
+ * value.h (struct value): Just align to LONGEST, rather than worrying
+ about CC_HAS_LONG_LONG.
+ * valarith.c (value_binop): Figure out type ourself based on
+ sizeof (LONGEST) rather than relying on BUILTIN_TYPE_LONGEST. The
+ point is that we don't depend on CC_HAS_LONG_LONG anymore.
+ * valprint.c (val_print_type_code_int): Just call
+ extract_unsigned_integer directly, rather than going through
+ unpack_long.
+ * printcmd.c (decode_format): Remove code which would sometimes
+ change 'g' size to 'w' for integers. print_scalar_formatted handles
+ printing huge integers well enough, thank you.
+
+ * command.c (add_set_cmd, not_just_help_class_command): Change
+ to make this the sfunc, not cfunc, since that is how we call it.
+ * command.h: Comment difference between sfunc and cfunc.
+ * demangle.c (set_demangling_command): Add third arg since that
+ is how it is called.
+ (_initialize_demangler): Use sfunc, not cfunc, for
+ set_demangling_command, since that is how it is called.
+ Remove show_demangling_command; it has no effect.
+
+ * command.c (shell_escape): Report errors correctly (with error
+ message from strerror).
+
+Wed Feb 2 14:35:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): Change CSECT_LEN to use
+ x_scnlen.l rather than x_scnlen to match corresponding change in
+ coff/internal.h.
+
+Wed Feb 2 11:16:45 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbtypes.h, ch-typeprint.c, ch-valprint.c:
+ Change comments regarding TYPE_CODE_BOOL.
+ * language.c (boolean_type): Always return 1 for TYPE_CODE_BOOL,
+ regardless of the language.
+ (value_true): Just call value_logical_not regardless of language.
+ * coffread.c (coff_read_enum_type), stabsread.c (read_enum_type):
+ Remove #if 0'd code which makes some enums TYPE_CODE_BOOL.
+ * language.h: Improve comment for la_builtin_type_vector.
+ * m2-lang.c (_initialize_m2_language): Don't add any fields to
+ builtin_type_m2_bool.
+
+Tue Feb 1 17:13:32 1994 Kevin Buettner (kev@cujo.geg.mot.com)
+
+ * config/m88k/{tm-delta88.h,tm-delta88v4.h}, m88k-tdep.c:
+ Define IN_SIGTRAMP and backtrace correctly through signal handlers.
+
+Tue Feb 1 22:13:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * procfs.c (wait_fd): Handle EINTR error return from PIOCWSTOP ioctl
+ by restarting the ioctl.
+
+Tue Feb 1 16:16:25 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.h (target_wait): Add comment about calling
+ return_to_top_level.
+
+Tue Feb 1 12:21:00 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffread.c (read_one_sym): bfd_coff_swap_aux_in now takes
+ additional arguments.
+ * xcoffread.c (read_xcoff_symtab, read_symbol_lineno): Likewise.
+
+Mon Jan 31 16:10:41 1994 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-stub.c: Remove unnecessary #include of memory.h.
+
+Mon Jan 31 12:12:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mips-tdep.c: Remove code which sets saved_regs from
+ init_extra_frame_info and put it in new function mips_find_saved_regs.
+ (READ_FRAME_REG): Remove macro and replace uses with the expansion.
+ * mips-tdep.c, config/mips/tm-mips.h: When examining ->saved_regs,
+ check if it is NULL and call mips_find_saved_regs if so.
+
+ * remote-mips.c: Use unfiltered, not filtered, output most places.
+
+ * blockframe.c (get_prev_frame_info): Detect and stop an infinite
+ backtrace. Revise comments.
+
+Mon Jan 31 09:40:33 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_procedure): Remove _sigtramp kludges for
+ alpha and irix. The _sigtramp case has to be handled properly
+ in the tdep files if we have no ecoff debugging info.
+ * alpha-tdep.c (alpha_frame_saved_pc, alpha_frame_chain),
+ mips-tdep.c (mips_frame_saved_pc): Handle signal handler frames
+ without PC_REGNUM kludge.
+ * mdebugread.c (fixup_sigtramp), mips-tdep.c (read_next_frame_reg):
+ Clean up handling of mips sigtramp frames, improve comments.
+
+Sat Jan 29 23:25:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * paread.c (read_unwind_info): Fix typo.
+
+ * paread.c (pa_symtab_read): Update the "check_strange_names"
+ filter to match GCC's current output. Filter out section symbols
+ (which the HP linker sometimes puts in the wrong place).
+
+Sat Jan 29 07:44:59 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * serial.h (SERIAL_SET_TTY_STATE): Comment return value.
+
+ * Makefile.in (TAGS): Just echo one line, rather than the whole thing.
+
+ * Makefile.in: Remove all references to sparcly-nat.c.
+
+ * Makefile.in (HFILES_NO_SRCDIR): Include dcache.h remote-utils.h
+ remote-sim.h directly, rather than via $(remote_utils_h). This avoids
+ duplicating serial.h and target.h.
+
+ * Makefile.in: Don't set M_INSTALL and M_UNINSTALL. These variables
+ are not used anywhere (a 5 Oct 1993 change removed the uses).
+
+ * config/m68k/monitor.mt (TDEPFILE): Add remote-es.o.
+ * config/m68k/es1800.mt: Add comment.
+ * remote-es.c: Extensive changes to update to current conventions.
+
+ * ser-unix.c (wait_for, hardwire_readchar) [HAVE_TERMIO, HAVE_TERMIOS]:
+ If the timeout is too big to fit in c_cc[VTIME], then do multiple reads
+ to achieve the desired timeout.
+ * serial.h (serial_t): Add field timeout_remaining.
+
+Fri Jan 28 08:45:02 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * c-exp.y (yylex): Reenable nested type code.
+
+Fri Jan 28 15:40:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * a29k-tdep.c (examine_tag): Add comment regarding argcount.
+
+ * remote-mips.c (mips_ops): Fix docstring.
+
+ * remote-bug.c (bug_ops): Remove spurious newline from docstring.
+
+ * config/m68k/tm-monitor.h: Changes to bring this into accordance
+ with the old tm-m68k-em.h:
+ (GDBINIT_FILENAME, DEFAULT_PROMPT): Remove.
+ (HAVE_68881): Don't undefine; HAVE_68881 is obsolete.
+ (REGISTER_NAMES): Don't muck with it; what tm-m68k.h has is fine.
+ Add FIXME regarding GET_LONGJMP_TARGET.
+
+ * remote-udi.c (udi_close, udi_detach, udi_kill): Add comments.
+ * infptrace.c (kill_inferior): Add comments.
+ * main.c (quit_command): Call target_close after we kill or
+ detach.
+ * remote-udi.c (udi_close): Don't error() if QUITTING.
+
+Fri Jan 28 11:55:52 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * configure.in: Make m68k-coff and aout add monitor support in
+ addition to the standard serial support.
+
+Fri Jan 28 08:45:02 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * mdebugread.c (psymtab_to_symtab_1): Don't complain on stLabel with
+ index indexNil.
+
+Fri Jan 28 10:40:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
+ * elfread.c (record_minimal_symbol_and_info),
+ dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
+
+Thu Jan 27 15:12:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i386-stub.c: Add ".text" right before "mem_fault:".
+
+ * main.c (baud_rate): Add FIXME comment about printing -1 value.
+
+ * remote-utils.c (usage): Fix message to be accurate and conform
+ more closely to normal conventions.
+
+ * remote-utils.c (gr_files_info): Have the exec_bfd test control
+ whether to show information about exec_bfd, and not control whether
+ to show information about device and speed.
+
+ * remote-utils.c (gr_open): If sr_get_device returns NULL, give
+ usage message, don't dump core.
+
+ * remote-bug.c (bug_write_memory): Use alloca, not GCC extension
+ for variable size array.
+ (bug_fetch_register, bug_store_register): Rename "value" to
+ "fpreg_buf" because some compilers don't like variables whose
+ names are the same as types.
+ (bug_store_register): Use a cast when converting char * to
+ unsigned char *.
+
+ * symmisc.c (maintenance_print_symbols): Don't refer to the name
+ of the command in error message (the text was referring to the old
+ name of the command).
+
+ * symmisc.c (dump_symtab): Fix args to fprintf_filtered.
+
+ * c-typeprint.c (c_type_print_base): Have SHOW == 0 mean to print
+ full details on structure elements without names. This partially
+ reverts the changes of 1 Jul 1993 and 31 Aug 1993; I think this aspect
+ of those changes was accidental.
+
+ * stack.c (parse_frame_specification): If SETUP_ARBITRARY_FRAME is
+ defined, make it an error to specify a single argument which is not
+ a frame number.
+
+ * Makefile.in (version.c), main.c (print_gdb_version): Use
+ host_alias and target_alias, not host_canonical and
+ target_canonical, to print configuration.
+
+Wed Jan 26 10:57:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * parse.c (write_exp_msymbol): Use new type msymbol_addr_type instead
+ of builtin_type_long. It is necessary to get a type which is
+ TARGET_PTR_BIT bits in size; builtin_type_long might not be big enough.
+
+ Fix many sins which will come up in 32 bit x 64 bit GDB, and
+ various miscellaneous things discovered in the process:
+ * printcmd.c, defs.h (print_address_numeric): New function.
+ * c-valprint.c (c_val_print), ch-valprint.c (chill_val_print)
+ breakpoint.c (describe_other_breakpoints, breakpoint_1, mention),
+ cp-valprint.c (cplus_print_value), infcmd.c (jump_command),
+ printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c:
+ Use it.
+ * utils.c, defs.h (gdb_print_address): New function.
+ * expprint (dump_expression), gdbtypes.h: Use it.
+ * breakpoint.c (describe_other_breakpoints),
+ symmisc.c (dump_symtab, print_symbol):
+ Use filtered not unfiltered I/O.
+ (remove_breakpoints): Remove BREAKPOINT_DEBUG code. Might as well
+ just run gdb under a debugger for this (and it had problems with
+ printing addresses, how to print b->shadow, etc.).
+ * buildsym.c (make_blockvector), core.c (memory_error),
+ exec.c (print_section_info), maint.c (print_section_table),
+ mdebugread.c (parse_procedure), solib.c, source.c, symfile.c,
+ symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
+ Add comments saying code is broken. Marked with "FIXME-32x64".
+ * dbxread.c (process_one_symbol), partial-stab.h (default),
+ remote-vx.c (vx_run_files_info):
+ Don't cast int being passed to local_hex_string.
+ * symmisc.c (print_symbol): Don't cast long being passed to %lx.
+ * symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE
+ only being a long.
+ * symmisc.c (print_symbol): Print "offset" in message for LOC_ARG
+ and LOC_LOCAL.
+ * printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE.
+ * source.c: Include <sys/types.h> regardless of USG.
+
+Tue Jan 25 12:58:26 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * valops.c (value_assign): Set `type' after coercing toval.
+ * c-valprint.c (c_val_print), ch-valprint.c (chill_val_print):
+ Use extract_unsigned_integer to get the address of a reference.
+
+Tue Jan 25 11:31:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (STABS_CONTINUE, error_type), partial-stab.h:
+ AIX can use ? instead of \ for continuation. Deal with it.
+
+ * paread.c (read_unwind_info): Just assign to objfile->obj_private,
+ not OBJ_UNWIND_INFO. Assigning to a cast is a GCC-ism which
+ the HP compiler in ANSI mode doesn't like.
+
+ * main.c: When defaulting HAVE_SIGSETMASK based on USG, just do it
+ based on USG, rather than defining HAVE_SIGSETMASK to an
+ expression containing defined. Having a macro used in #if expand
+ to an expression containing "defined" is undefined according to
+ ANSI, and the HP compiler in ANSI mode doesn't do what we wanted
+ it to.
+
+Mon Jan 24 20:51:29 1994 John Gilmore (gnu@cygnus.com)
+
+ * sparc-nat.c (fetch_inferior_registers, store_inferior_registers):
+ Clean up the changes of 11 Jan, as recommended by Peter Schauer.
+
+Fri Jan 21 19:10:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * ch-exp.y (match_string_literal): Allow a zero-length string.
+ * ch-lang.c (chill_printstr): Don't print zero-length string funny.
+
+Sat Jan 22 17:08:48 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i386aix-nat.c (i386_float_info): Reverse order of registers before
+ passing them to print_387_status.
+ (print_387_status): Don't subtract top from 7 before using it.
+ * i387-tdep.c: Remove comment about AIX wanting "top" subtracted
+ from 7; the above explains it.
+
+Sat Jan 22 20:25:11 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (init_extra_frame_info): Use frame relative stack
+ pointer value when fixing up the frame at the start of a function.
+
+Sat Jan 22 12:29:13 1994 Stu Grossman (grossman at cygnus.com)
+
+ * lynx-nat.c (fetch_core_registers): Load the I & L regs for the
+ Sparc from the stack.
+
+Sat Jan 22 08:30:42 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote-mips.c (mips_initialize): Clear mips_initializing via
+ cleanup chain, not directly.
+
+ * ser-unix.c (wait_for) [HAVE_TERMIO, HAVE_TERMIOS]: Make a timeout
+ of -1 mean forever, like in the HAVE_SGTTY case. Warn if we are
+ munging the timeout due to the limited range of c_cc[VTIME].
+
+ * fork-child.c, inferior.h (fork_inferior): New argument shell_file.
+ * procfs.c (procfs_create_inferior), inftarg.c (child_create_inferior),
+ m3-nat.c (m3_create_inferior): Pass it.
+ * procfs.c: Remove ptrace function. It was declared in a way which
+ conflicted with the prototype in unistd.h on Solaris.
+
+Sat Jan 22 01:37:40 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-tdep.c (frame_saved_pc): Get the pc from the saved pc
+ in the sigcontext if it is a signal trampoline frame.
+ * config/sparc/tm-sun4sol2.h (IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET):
+ Define for Solaris2.
+
+Sat Jan 22 00:34:47 1994 Stu Grossman (grossman at cygnus.com)
+
+ * sparc-tdep.c, lynx-nat.c, config/sparc/tm-sparc.h,
+ config/sparc/tm-sparclynx.h: Move defs of FRAME_SAVED_I0/L0 to
+ tm-sparc.h so they can be overridden if necessary.
+
+Fri Jan 21 17:49:28 1994 Stu Grossman (grossman at cygnus.com)
+
+ * lynx-nat.c: Add Sparc support.
+ * sparcly-nat.c: Remove. It's useless.
+ * config/sparc/nm-sparclynx.h: Rewrite.
+ * config/sparc/sparclynx.mh (NATDEPFILES): Replace sparcly-nat.o
+ with lynx-nat.o
+ * config/sparc/tm-sparclynx.h: Rewrite.
+
+Fri Jan 21 19:08:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * rs6000-pinsn.c: Use the new disassembler in the opcodes
+ directory. Old code was discarded, since the new opcode table has
+ a different format.
+
+Fri Jan 21 14:28:30 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (realclean): Remove info files per make-stds.texi.
+
+Fri Jan 21 12:47:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c (end_psymtab): Only patch psymtab textlow and texthigh
+ if N_SO_ADDRESS_MAYBE_MISSING is defined.
+ * config/sparc/tm-sun4sol2.h: Define it.
+
+Thu Jan 20 15:04:24 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * printcmd.c (print_address_symbolic): Unconditionally use msymbol
+ if we did not find a symbol.
+
+Fri Jan 21 08:20:18 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * infptrace.c (child_xfer_memory): Only use if CHILD_XFER_MEMORY
+ is not defined.
+
+ * hppab-nat.c (call_ptrace): Delete redundant function.
+ (kill_inferior, attach, detach, child_resume): Likewise.
+ (child_xfer_memory): Likewise.
+
+ * hppah-nat.c (call_ptrace): Delete redundant function.
+ (kill_inferior, attach, detach, child_resume): Likewise.
+
+ * config/pa/hppabsd.mh (NATDEPFILES): Add infptrace.o.
+
+ * config/pa/hppahpux.mh (NATDEPFILES): Add infptrace.o.
+
+ * config/pa/nm-hppab.h (FETCH_INFERIOR_REGISTERS): Define.
+
+ * config/pa/nm-hppah.h (FETCH_INFERIOR_REGISTERS): define.
+ (CHILD_XFER_MEMORY): Define.
+ (PT_*): Define so that generic infptrace.c code can be used.
+
+Fri Jan 21 09:23:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (xcoff_symfile_read): Make second parameter a
+ struct section_offsets *, not a (nonexistent) struct section_offset *.
+
+ * xcoffread.c (read_xcoff_symtab): Make main_aux just a union
+ internal_xcoff_symtab, not an array of one of them. Change lots of
+ "main_aux" to "&main_aux" and so on.
+
+ * coffread.c, xcoffread.c: Include <coff/internal.h>
+ before "symfile.h".
+
+Thu Jan 20 17:30:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * coffread.c (coff_getfilename): Make it not static.
+
+ * xcoffread.c (read_xcoff_symtab): complain() not abort().
+
+ * xcoffread.c (struct coff_symbol): Rename c_nsyms to c_naux (removes
+ a completely gratuitous difference between xcoffread.c and coffread.c).
+
+Wed Jan 19 15:09:44 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Don't set frame for
+ step_resume_breakpoint for IN_SIGTRAMP cases.
+
+ * infrun.c (wait_for_inferior), breakpoint.h (struct bpstat_what),
+ breakpoint.c (bpstat_what): Move step_resume from its own field of
+ the struct bpstat_what into the main_action. Make it override
+ other breakpoints. This is a conservative change in the sense
+ that before the step resume breakpoint was a breakpoint.c
+ breakpoint, hitting the step resume breakpoint overrode even
+ calling bpstat_stop_status.
+
+Wed Jan 19 12:40:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (normal_stop): Set stop_pc after popping the dummy frame
+ in case execution was stopped in the called function.
+ * stack.c (print_frame_info, frame_info): If backtracing through
+ a call dummy, handle the starting source line number on a line
+ boundary like backtracing through sigtramp.
+ * sparc-tdep.c (sparc_frame_find_saved_regs): Get frame address
+ for call dummy frame right. Remove old test for dummy frame,
+ it has been unused at least since gdb-3.5.
+ * sparc-tdep.c (sparc_push_dummy_frame): Set return address register
+ of the dummy frame.
+
+Tue Jan 18 16:16:35 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infcmd.c (signal_command): Accept 0 as legitimate signal number.
+
+Tue Jan 18 14:09:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (signals_info), target.c (target_signal_from_name):
+ Use ugly casts to avoid enumvar < enumvar or enumvar++.
+
+Mon Jan 17 22:00:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * ser-unix.c (hardwire_noflush_set_tty_state): Don't muck with ICANON.
+ * inflow.c (terminal_ours_1): When discussing how to deal with the
+ tty state, make note of query() as well as readline.
+
+ * infrun.c (_initialize_infrun): Add TARGET_SIGNAL_POLL to list of
+ signals for which stop and print are cleared by default.
+
+Mon Jan 17 20:00:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (unwind_table_entry): Use one of the
+ reserved fields to hold a stub unwind entry type. Fix typo.
+ (stub_unwind_entry): New structure for raw stub unwind entries.
+ (stub_unwind_types): The types of stubs we may encounter.
+ (UNWIND_ENTRY_SIZE, STUB_UNWIND_ENTRY_SIZE): New defines.
+ * hppa-tdep.c (rp_saved): Use additional information provided
+ by linker stub unwind descriptors.
+ (frameless_function_invocation): Likewise.
+ (frame_chain_valid): Likewise.
+ * paread.c (compare_unwind_entries): New function for sorting
+ unwind table entries.
+ (read_unwind_info): Rewrite to remove dependency on host endianness.
+ Read in data from the $UNWIND_END$ subspace which contains linker
+ stub unwind descriptors. Merge that data into the basic unwind
+ table.
+
+ * hppab-nat.c (_initialize_kernel_u_addr): Delete unwanted functions.
+
+Mon Jan 17 22:00:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab, case C_FILE): Accept the name
+ from either the symbol name or the auxent.
+ * coffread.c, symfile.h (coff_getfilename): Renamed from getfilename,
+ no longer static.
+
+Mon Jan 17 13:35:01 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (ALLPARAM): Change irix5.h to nm-irix5.h.
+
+Mon Jan 17 12:35:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * README: Update notes for alpha port.
+
+Mon Jan 17 11:15:57 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i960-tdep.c (i960_fault_to_signal): Return TARGET_SIGNAL_ILL
+ for operation fault, constraint fault, and type fault.
+
+Sun Jan 16 12:46:01 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (init.c): Add comment explaining formatting conventions.
+
+ * c-exp.y (parse_number): Assign to temporary between the right
+ shifts, to work around a bug in the SCO compiler.
+
+ * Makefile.in (ALLCONFIG, ALLPARAM, ALLDEPFILES, HFILES_NO_SRCDIR):
+ Add various files which were added to GDB recently.
+
+ * xcoffread.c (process_xcoff_symbol): Only change 'V' to 'S' if not
+ within_function.
+
+ * Makefile.in: Add mostlyclean target.
+
+Sat Jan 15 10:20:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Version 4.11.4.
+
+Sat Jan 15 18:27:34 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * main.c (show_commands): Make return type of extern
+ history_get be HIST_ENTRY, rather than struct _hist_entry.
+ (The latter loses with the upcoming merged readline.)
+
+Sat Jan 15 10:20:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * minsyms.c (prim_record_minimal_symbol_and_info): Make tempstring
+ const char *, not char *.
+
+ * symtab.h (struct symbol): Make section short, not unsigned short.
+
+ * symtab.c (lookup_symbol): Add comment about QUIT here.
+
+ * utils.c (fputs_unfiltered): Call fputs, not fputs_maybe_filtered.
+
+ * c-exp.y (parse_number): Check for overflow regardless of range
+ checking. Fix overflow check to use unsigned LONGEST, not
+ unsigned int.
+
+ * c-exp.y (parse_number): Make it so that integer constants are
+ builtin_type_long_long if builtin_type_long isn't big enough or if
+ an "LL" suffix is used. Properly handle "UL" or "LU" suffixes.
+
+ * c-typeprint.c (c_type_print_varspec_suffix, case TYPE_CODE_FUNC):
+ Print our "()" first, then recurse for the target type.
+
+Fri Jan 14 21:55:39 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-udi.c (udi_create_inferior): Quote empty execfile argument.
+
+ * gdbserver/low-lynx.c: Include <sys/wait.h> not "/usr/include/wait.h".
+
+Fri Jan 14 14:17:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (request_quit): Re-establish signal handler regardless
+ of USG.
+
+ * config/mips/xm-irix4.h: Define HAVE_TERMIOS.
+
+Fri Jan 14 21:55:39 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i960-tdep.c: Include target.h.
+
+Fri Jan 14 17:12:28 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * lynx-nat.c (sys/wait.h): Don't use absolute pathname.
+
+Fri Jan 14 11:06:10 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * lynx-nat.c (child_wait): Fix thinkos in struct target_waitstatus
+ changes (status -> ourstatus; declare status, etc.).
+ * config/nm-lynx.h: Fix child_wait prototype and include target.h.
+
+Fri Jan 14 14:17:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (ALLPARAM): Add config/nm-lynx.h.
+
+Fri Jan 14 11:49:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * remote-mips.c (mips_request, mips_wait): Correct prototypes.
+
+Fri Jan 14 11:37:17 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/i386/xm-linux.h: Define HAVE_TERMIOS.
+
+Fri Jan 14 01:04:36 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/alpha/tm-alpha.h (CALL_DUMMY): Improve comment.
+
+Thu Jan 13 10:32:38 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote-vx.c (vx_wait): Only call i960_fault_to_signal if I80960
+ is defined. Otherwise just report TARGET_SIGNAL_UNKNOWN.
+
+ * mips-tdep.c (mips_push_arguments): Byteswap struct_addr before
+ writing it.
+
+ Add search to target vector (#if 0'd until after 4.12):
+ * target.h (to_search, target_search): Add.
+ * gdbcore.h, core.c (generic_search): Add.
+ * remote.c (remote_search): Add.
+ * a29k-tdep.c (init_frame_info): Use target_search to find traceback
+ tag.
+
+ * printcmd.c (print_address_symbolic): If set print fast-symbolic-addr
+ is on, call find_pc_function rather than relying just on the minimal
+ symbols (probably only matters for symbol readers which don't put
+ statics in the minimal symbols, but changing this strikes me as
+ not conservative enough).
+ Initialize name_location in all cases.
+ If no symbol and no msymbol, don't print anything symbolic.
+
+ * a29k-tdep.c (push_dummy_frame): Add comment about saving lr0.
+
+Wed Jan 12 20:53:16 1994 John Gilmore (gnu@cygnus.com)
+
+ * printcmd.c (print_address_symbolic): Make it search the
+ symtabs for variables as well as functions. Add `set print
+ fast-symbolic-addr' and default it to fast (the old way).
+ Print line numbers for data items as well as functions.
+
+ * symtab.c (find_addr_symbol): Return the symtab and the symbol
+ address, if a symbol is found (take two more args pointing to
+ where to store these results).
+
+ * symtab.h (find_addr_symbol): Add prototype.
+
+Wed Jan 12 19:32:11 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * objfiles.h: Fix comments to reflect the fact that the phrase
+ "top of stack" always refers to where the pushing and popping takes
+ place, regardless of whether it is at the highest or lowest address.
+
+Wed Jan 12 13:23:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol): Do not set TYPE_TAG_NAME for
+ compiler generated tag names.
+ * mdebugread.c (parse_type): Handle cross references to qualified
+ aggregate types.
+ * valops.c (value_struct_elt): Improve error message if the
+ address of a method is requested from an object instance.
+ * valops.c (search_struct_method): Make name_matched non-static
+ to get it initialized correctly.
+ * config/i386/nm-i386sco.h (CANNOT_STORE_REGISTER): Define to
+ exclude segment register which are not writable on newer SCO versions.
+
+Wed Jan 12 14:44:45 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * go32-xdep.c: Remove unused function uerror.
+ (sigsetmask): Declare return type. Declare argument (to match the
+ way it is called). Explicitly return 0.
+
+Wed Jan 12 01:44:25 1994 John Gilmore (gnu@cygnus.com)
+
+ * symtab.h (struct symbol, general_symbol_info, minimal_symbol,
+ partial_symbol): Shrink the storage sizes of symbols, by making
+ enums into 1-byte bitfields when compiled __GNUC__, moving all the
+ enums and small ints to the end of each struct to improve
+ alignment, and switching the section number from int to unsigned
+ short.
+
+Wed Jan 12 00:16:26 1994 John Gilmore (gnu@cygnus.com)
+
+ * symtab.c (find_addr_symbol): New routine that will find the nearest
+ symbol associated with an address. It does so by exhaustive
+ search of the symtabs, so it's slow but complete.
+
+Tue Jan 11 23:57:30 1994 John Gilmore (gnu@cygnus.com)
+
+ * coffread.c (read_coff_symtab): Set PC bounds of _globals_ symtab
+ to [0,0] rather than [0, end of first source file]. This avoids
+ problems with other parts of GDB looking for linetables in the
+ _globals_ symtab. Eliminate variables num_object_files and
+ first_object_file_end.
+
+Tue Jan 11 00:53:46 1994 John Gilmore (gnu@cygnus.com)
+
+ * a29k-tdep.c (init_frame_info): Cast null arg to examine_tag.
+ (pop_frame): Restore PC2 and LR0 from dummy frames.
+ (push_dummy_frame): Save PC2 and LR0 into dummy frames.
+ (setup_arbitrary_frame): Handle 3 args and set up real frames.
+ * config/a29k/tm-a29k.h (FRAME_NUM_ARGS): Update comments.
+ (DUMMY_FRAME_RSIZE): Add 2 longwords for PC2 and LR0.
+ (SETUP_ARBITRARY_FRAME): Define.
+
+Tue Jan 11 06:59:10 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * infrun.c, config/mips/tm-irix5.h: Remove #if 0'd AT_FUNCTION_START.
+
+Tue Jan 11 14:27:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * remote-udi.c (udi_resume): Correct prototype.
+
+Tue Jan 11 11:10:30 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (FRAME_FIND_SAVED_REGS): Call
+ hppa_frame_find_saved_regs.
+ * hppa-tdep.c (dig_fp_from_stack): Delete function.
+ (prologue_inst_adjust_sp): New function.
+ (is_branch, inst_saves_gr, inst_saves_fr): New functions.
+ (skip_prologue): Completely rewrite to use unwind information.
+ (hppa_frame_find_saved_regs): Likewise.
+
+Tue Jan 11 06:59:10 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * remote-mips.c (mips_wait): Use new function mips_signal_from_protocol
+ to convert a signal number with appropriate bounds checking.
+
+ * remote-mips.c (mips_wait): Fix typos (0x177 -> 0177, 0x377 -> 0377).
+
+Tue Jan 11 00:53:46 1994 John Gilmore (gnu@cygnus.com)
+
+ * stack.c (frame_info): If FRAME_FIND_SAVED_REGS isn't defined,
+ print a newline to end the display anyway.
+
+ * sparc-tdep.c (sparc_pop_frame): Pop the fsr and csr (float and
+ coprocessor status regs) when popping a frame. This fixes
+ float exceptions that occur after calling inferior functions.
+
+ * sparc-nat.c (fetch_inferior_registers, store_inferior_registers):
+ Read and write the fsr (float status register) to/from the child
+ process along with the float regs. Remove Peter Schauer's change
+ of May 24 '93, which has higher overhead and doesn't solve the
+ real problem (which was that FSR wasn't being set).
+
+Mon Jan 10 23:16:42 1994 John Gilmore (gnu@cygnus.com)
+
+ * a29k-tdep.c (examine_prologue): Don't worry if the ASGEQ
+ stack overflow check isn't right after the register stack
+ adjustment instruction. Metaware R2.3u compiler moves other
+ things in front of it. This fix isn't perfect but is what's
+ running.
+
+Mon Jan 10 20:08:23 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * c-valprint.c (c_val_print): Treat TYPE_CODE_RANGE like TYPE_CODE_INT.
+
+ * config/alpha/alpha-netware.mt: Rename to alpha-nw.mt for 14
+ character filenames.
+ * configure.in: Change accordingly.
+
+Mon Jan 10 15:48:36 1994 Tom Lord (lord@rtl.cygnus.com)
+
+ * m68k-stub.c, sparc-stub.c: removed spurious introduction of
+ _filtered io routines from these two files.
+
+Fri Jan 7 12:42:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/i386/tm-i386v.h, config/m68k/tm-m68k.h, config/mips/tm-mips.h,
+ config/vax/tm-vax.h (CALL_DUMMY_BREAKPOINT_OFFSET): Define.
+ * mdebugread.c (parse_symbol): Handle enum sh.type produced by
+ DEC c89.
+ * mdebugread.c (add_line): Handle zero linenos produced by DEC c89.
+
+Fri Jan 7 12:55:25 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (print_sys_errmsg): Call gdb_flush (gdb_stdout) before
+ printing to gdb_stderr.
+
+ * remote-udi.c (udi_kill): Don't close the connection, just set
+ inferior_pid to zero.
+ (udi_mourn): Call remove_breakpoints.
+
+ * remote-udi.c: Remove obsolete need_artificial_traps comment.
+
+ * i386b-nat.c (sregmap): If sEAX, etc., not defined, use tEAX, etc.
+
+Thu Jan 6 07:17:53 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * symtab.c (lookup_symbol): Don't try adding .c to the name.
+
+ * remote-bug.c: At the start of each section, reset srec_frame
+ back to 160.
+
+ * target.h: Add TARGET_WAITKIND_LOADED and TARGET_WAITKIND_SPURIOUS.
+ * target.c (store_waitstatus): Add CHILD_SPECIAL_WAITSTATUS hook.
+ * infrun.c (wait_for_inferior): Replace SIGTRAP_STOP_AFTER_LOAD with
+ code which looks for those two waitkinds. Use switch statement.
+ * config/rs6000/tm-rs6000.h: Replace SIGTRAP_STOP_AFTER_LOAD with
+ CHILD_SPECIAL_WAITSTATUS.
+
+ * procfs.c (procfs_wait): Fix argument name to match 4 Jan changes.
+ * Move target_signal_from_host, target_signal_to_host, and
+ store_waitstatus from inftarg.c to target.c. procfs needs them.
+ * target.c: Include "wait.h" and <signal.h>.
+ * target.h, infrun.c (proceed), proceed callers: Pass new code
+ TARGET_SIGNAL_DEFAULT instead of -1. This avoids problems with
+ enums being treated as unsigned and is cleaner.
+ * infrun.c (signals_info): Don't print TARGET_SIGNAL_DEFAULT or
+ TARGET_SIGNAL_0.
+ * infcmd.c (signal_command), infrun.c (signals_info):
+ Don't allow user to specify numeric equivalent of
+ TARGET_SIGNAL_DEFAULT.
+
+Tue Jan 4 15:34:36 1994 Stu Grossman (grossman@cygnus.com)
+
+ * config/alpha/alpha-netware.mt: New target support for Alpha
+ running Netware.
+ * configure.in: Add alpha-*-netware* target.
+
+Tue Jan 4 14:51:35 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * remote-mips.c (mips_wait): Fix ref to TARGET_WAITKIND_STOPPED.
+
+Tue Jan 4 09:47:14 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * target.h: Add enum target_waitkind, enum target_signal, and
+ struct target_waitstatus. Change status argument to target_wait to
+ be struct target_waitstatus * instead of int *.
+ * target.h, infrun.c, all targets: Change type of signal arguments
+ to resume(), proceed(), and target_resume() from int to enum
+ target_signal.
+ * All targets (*_wait, *_resume): Change accordingly.
+ * infcmd.c (program_info, signal_command), throughout infrun.c,
+ * fork-child.c, solib.c, hppa-tdep.c, osfsolib.c: Use this stuff.
+ * convex-xdep.c, convex-tdep.c: Add FIXME's (getting the Convex
+ signal code stuff right with the new signals would be non-trivial).
+ * inferior.h (stop_signal): Make it enum target_signal not int.
+ * target.c, target.h (target_signal_to_string, target_signal_to_name,
+ target_signal_from_name): New functions.
+ * inftarg.c, target.h (target_signal_to_host, target_signal_from_host,
+ store_waitstatus): New functions.
+ * procfs.c (procfs_notice_signals): Use them.
+ * i960-tdep.c (i960_fault_to_signal): New function, to replace
+ print_fault.
+ * config/i960/tm-i960.h: Don't define PRINT_RANDOM_SIGNAL.
+
+ * objfiles.c (build_objfile_section_table): Don't abort() if
+ objfile->sections is already set.
+
+ * objfiles.c (add_to_objfile_sections): Check SEC_ALLOC not SEC_LOAD
+ to match recent change to exec.c.
+
+ * Version 4.11.3.
+
+ * main.c (print_gdb_version): Change year to 1994.
+
+ * ChangeLog, ChangeLog-93: Split ChangeLog at 1994.
+ * Makefile.in (NONSRC): Add ChangeLog-93.
+
+Mon Jan 3 11:57:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * stabsread.c (read_type): Allow defining several type numbers
+ at once (e.g. "(1,2)=(3,4)="...).
+
+ * stabsread.c (read_enum_type): Use TARGET_INT_BIT not sizeof (int).
+
+ * breakpoint.c (frame_in_dummy): Check PC as well as frame.
+
+Mon Jan 3 02:47:03 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (psymtab_to_symtab_1): Only pass N_STAB symbols
+ to process_one_symbol.
+ * symtab.c (find_pc_psymbol): Search global_psymbols as well to
+ avoid caching a bad endaddr in find_pc_partial_function.
+
+Sun Jan 2 21:41:17 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/tm-sun3.h: Don't define BELIEVE_PCC_PROMOTION.
+
+Sat Jan 1 04:35:23 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Do not step or step resume past
+ the end of a one-line function we just stepped into.
+
+For older changes see ChangeLog-1993
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1995 b/contrib/gdb/gdb/ChangeLog-1995
new file mode 100644
index 0000000..9d4149e
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1995
@@ -0,0 +1,4915 @@
+Fri Dec 29 16:30:58 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * symfile.c (find_sym_fns): Add PowerMac to xcoff file recognition
+ kludge.
+
+Fri Dec 22 11:05:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (gdb_host): Add support for DG/UX running on x86 as
+ a host.
+ (all x86 targets and hosts): Add support for pentium-pro machines.
+
+ * configure: Rebuild.
+
+ * config/i386/i386dgux.mh: New file for DG/UX running on x86 host.
+
+Thu Dec 21 19:09:20 1995 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * remote-array.c (array_wait): Poll the keyboard along with the
+ serial port so users can tpye at the target while their
+ application is running.
+
+Thu Dec 21 11:58:52 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (ppcbug-rom.o, srec.o): Add dependencies.
+
+ * monitor.c (monitor_debug): Take prefix, and suffix arguments.
+ Print trailing newline after the suffix.
+ (monitor_printf{,_noecho}): Change monitor_debug calls.
+ (monitor_printf): Call monitor_expect instead of trying to do the
+ expect processing locally so that if there is extra junk, it
+ doesn't hang things up.
+ (readchar): If MO_HANDLE_NL is set, handle \r\n pairs and convert
+ them to a single \r. Use monitor_debug to print out byte read.
+
+ * monitor.h (MO_HANDLE_NL): Add new flag.
+
+ * ppcbug-rom.c (ppcbug_ops{1,2}): Split into two ops, one that
+ uses lo 0 to load, and the other that uses lo 1. Set flag
+ MO_HANDLE_NL.
+ (ppcbug_open{0,1}): Clone and split to handle ppcbug_ops{1,2}.
+ (_initialize_ppcbug_rom): Set up both ppcbug_open{0,1}.
+
+Wed Dec 20 10:54:41 1995 Fred Fish <fnf@cygnus.com>
+
+ * defs.h: Delete extraneous whitespace at end of file.
+ * symfile.h: Move #include of demangle.h outside conditional.
+ * objfiles.h (struct objstats, OBJSTAT, OBJSTATS): New struct and
+ macros to hold per-objfile statistics for internal
+ instrumentation.
+ (struct objfile): Add OBJSTATS member, which is optional.
+ * buildsym.h (next_symbol_text_func): Now takes objfile argument.
+ Also update copyright to 1995.
+ * dbxread.c (dbx_next_symbol_text): Now takes objfile argument.
+ (dbx_symfile_init, coffstab_build_psymtabs, elfstab_build_psymtabs,
+ stabsect_build_psymtabs): Accumulate string table size.
+ (dbx_next_symbol_text, read_dbx_symtab, read_ofile_symtab):
+ Accumulate number of stabs symbols read.
+ * dwarfread.c (new_symbol, symthesize_typedef):
+ Accumulate number of full symbols created.
+ * gdbtypes.c (alloc_type): Accumulate number of types.
+ * maint.c (maintenance_print_statistics): New function.
+ * mdebugread.c (mdebug_next_symbol_text): Now takes objfile
+ argument.
+ * minsyms.c (prim_record_minimal_symbol_and_info): Accumulate
+ number of minimal symbols read.
+ * os9kread.c (read_os9k_psymtab): next_symbol_text takes objfile
+ arg.
+ * partial-stab.h: next_symbol_text takes objfile arg.
+ * stabsread.c (error_type, STABS_CONTINUE): Now takes objfile arg
+ and uses it to call next_symbol_text.
+ * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
+ Accumulate number of partial symbols created.
+ * symfile.h (ADD_PSYMBOL_VT_TO_LIST): Accumulate number of partial
+ symbols created.
+ * symmisc.c (print_objfile_statistics): Print the per-objfile
+ internal instrumentation statistics gathered.
+ * xcoffread.c (xcoff_next_symbol_text): Now takes objfile argument.
+
+Fri Dec 15 16:15:55 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * top.c (set_endian_from_file): Use new bfd_big_endian macro.
+
+Fri Dec 15 12:21:10 1995 Raymond Jou <rjou@mexican.cygnus.com>
+
+ * mpw-make.sed: Add quotes to RIncludes reference.
+
+Fri Dec 15 13:18:55 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * remote-array.c: Remove bogus setting of baudrate to 4800. Their
+ hardware has real UARTS now.
+
+Mon Dec 11 18:19:16 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (powerpc-*-macos*): New target configuration.
+ * configure: Update.
+ * config/powerpc/macos.mh, config/powerpc/macos.mt,
+ config/powerpc/nm-macos.h, config/powerpc/tm-macos.h, mac-nat.c:
+ New files, native PowerMac debugging support.
+ * Makefile.in (mac-nat.o): Add build rule.
+ * mpw-config.in (enable_cflags): Add support.
+ (m68k-apple-macos, powerpc-apple-macos): Fix natdepfiles to
+ list object file instead of source file.
+ * mpw-make.sed (@ENABLE_CFLAGS@): Don't edit out, replace with
+ value of variable.
+ (install, install-only): Edit MPW-specific installation into
+ place of Unix shell code.
+ * mac-gdb.r: Fix version resources to use symbolic version strings.
+ (cfrg): New resource, code fragment for PowerMac.
+
+Mon Dec 11 14:13:03 1995 Fred Fish <fnf@amigalib.com>
+
+ * dbxread.c (process_one_symbol): When looking at the next
+ minimal symbol, check for end of the minimal symbol array
+ (symbol with NULL pointer for name) before dereferencing it.
+
+Mon Dec 11 15:56:55 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * eval.c (evaluate_struct_tuple): Fix thinko.
+
+Mon Dec 11 06:52:02 1995 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-typeprint.c (chill_type_print_base): Slightly change of printing
+ of variant structures.
+
+Mon Dec 11 00:36:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (value_cast): Handle casts to and from TYPE_CODE_CHAR.
+ * ch-exp.c (match_integer_literal): Fix long long support.
+ * gdbtypes.c (get_discrete_bounds): Make TYPE_LENGTH (type) ==
+ sizeof (LONGEST) case work OK.
+
+Fri Dec 8 21:02:24 1995 Fred Fish <fnf@cygnus.com>
+
+ * coffread.c, dbxread.c, dstread.c, objfiles.c, os9kread.c,
+ symfile.c, symtab.c: Use "obstack.h" rather than <obstack.h>.
+
+Wed Dec 6 16:16:18 1995 Stu Grossman (grossman@cirdan.cygnus.com)
+
+ * remote-mips.c (mips_receive_header): Allow mips_syn_garbage to be
+ user-settable (via set syn-garbage-limit). Setting it to -1 makes
+ it unlimited.
+
+Tue Dec 5 18:33:43 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * gdbtypes.c (check_stub_method): Make sure we get back a function
+ string in the demangled name before we try to use it.
+
+Tue Dec 5 18:08:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c (monitor_expect_regexp): Make static, add prototype.
+ * (monitor_read_memory_single): Call monitor_expect_regexp with
+ pointer to getmem_resp_delim_pattern, not entire struct.
+
+Tue Dec 5 15:51:25 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * c-lang.h (c_op_print_tab): Don't declare, some compilers
+ consider illegal if structure not defined, and only used
+ in c-lang.c anyway.
+
+Sun Dec 3 12:31:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard case): Fix typo.
+
+Sun Dec 3 11:59:21 1995 Jeffrey A. Law <law@cygnus.com>
+
+ * ch-exp.c (parse_named_record_element): Avoid aggregrate
+ initializations for automatic variables.
+
+ * hppa-tdep.c (hppa_alignof): Fix typo in last change.
+
+Sat Dec 2 19:32:57 1995 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (global_psymbols, static_psymbols): Remove, unused.
+
+Sat Dec 2 03:02:21 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-tdep.c (heuristic_proc_desc): Add heuristic to
+ determine the return address register, needed for OSF/1-3.2C.
+ * config/alpha/tm-alpha.h (T7_REGNUM, T9_REGNUM): Define.
+
+Fri Dec 1 07:23:57 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * ppcbug-rom.c (ppcbug_cmds): Turn on MO_GETMEM_READ_SINGLE
+ because PPCbug displays the memory as characters as well as hex.
+ Fix getmem/setmem commands.
+
+ * srec.c (load_srec): Fix off by one typo in last submission.
+
+ * rs6000-tdep.c (push_arguments): Fix typo.
+
+Thu Nov 30 23:54:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * language.c (lang_bool_type), language.h: New function.
+ * language.h (LA_BOOL_TYPE): New macro.
+ * eval.c (evaluate_subexp_standard) Use LA_BOOL_TYPE instead
+ of builtin_type_int where appropriate,
+ * valarith.c (value_subscript): Likewise.
+
+ * valops.c (value_slice): Implement (value) bitstring slices.
+ * valprint.c (val_print): If TYPE_LENGTH is zero, don't automatically
+ print "<incomplete type>" - Chill has zero-length (string) types.
+
+ * gdbtypes.c (check_stub_type): Removed; no longes needed.
+ * ch-exp.c (expect, parse_call): Tweak error messages.
+
+Wed Nov 29 13:35:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * scm-valprint.c (scm_isymnames): Remove "#@" prefix.
+ (scm_scmval_print): Do not print "#@" prefix.
+
+ * gdbtypes.h (enum type_code): Added TYPE_CODE_TYPEDEF.
+ (check_typedef): New prototype.
+ (CHECK_TYPEDEF): New macro.
+ (TYPE_DUMMY_RANGE): Removed.
+ * gdbtypes.c (get_discrete_bounds): Fix paren error; make more robust.
+ (create_array_type): Don't force_to_range_type; users of the
+ array are responsible for handling non-range index types.
+ (create_set_type): Likewise.
+ (force_to_range_type): Removed.
+ (check_typedef): New function handles stub types and typedefs.
+ (check_stub_type): Just call check_typedef. (To be removed.)
+ (recursive_dump_type): Handle TYPE_CODE_TYPEDEF.
+ * ch-lang.c (type_lower_upper): Use get_discrete_bounds.
+ (evaluate_subexp_chill): Handle string repetition.
+ Re-arrange to handle EVAL_AVOID_SIDE_EFFECTS better.
+ * ch-typeprint.c (chill_type_print_base): Handle TYPE_CODE_TYPEDEF.
+ Pass show=0 in recursive calls various places.
+ (case TYPE_CODE_ARRAY): Don't require index type to have
+ TYPE_CODE_RANGE.
+ (case TYPE_CODE_RANGE): Don't need to support TYPE_DUMMY_RANGE.
+ * gdbtypes.c, ch-lang.c, ch-typeprint.c (numerous places):
+ Add check_typedef/CHECK_TYPEDEF as needed.
+
+ * ch-exp.y: Replaced by ...
+ * ch-exp.c: New file. Use recursive-descent.
+ Recognize labelled array tuples and powerset ranges.
+ * Makefile.in: Update for no longer using yacc for ch-exp.
+
+ * c-lang.c: Make various functions non-static.
+ * c-lang.h: Add bunches of prototypes.
+ * cp-valprint.c (cp_print_value_fields): Also take address.
+ (cp_print_value): Likewise. Use baselcass_offset.
+ * stabsread.c (current_symbol): New static variable.
+ (type_synonym_name): Remove.
+ (read_type): If copying, make copy be a TYPE_CODE_TYPEDEF.
+ (read_array_type): Don't need to handle undefined element type here.
+ (cleanup_undefined_types): Ditto.
+ (read_range_type): Look for Chill ranges.
+ * valops.c (value_assign): Fix case lval_internalvar - don't try
+ to assign into old value (which might be too small!).
+ (value_coerce_array): No longer need special VALUE_REPEATED handling.
+ (value_arg_coerce): Cleaner array->pointer decay mechanism.
+ (search_struct_field): Use baseclass_offset rather than
+ baseclass_addr.
+ (value_slice): Use get_discrete_bounds.
+ * value.h (COERCE_VARYING_ARRAY): Take type argumnt as well.
+ * values.c (baseclass_offset): Change parameter interface.
+ (baseclass_addr): Removed.
+ * c-typeprint.c, c-valprint.c, ch-valprint.c, values.c, valops.c:
+ Add check_typedef/CHECK_TYPEDEF as needed.
+
+ * alpha-tdep.c, c-exp.y, h8500-tdep.c, f-exp.y, f-valprint.c,
+ findvar.c, hppa-tdep.c, infcmd.c, language.c, printcmd.c,
+ rs6000-tdep.c, symmisc.c, symtab.c, mdebugread.c:
+ Add check_typedef/CHECK_TYPEDEF as needed.
+
+ * f-typeprint.c, valarith.c, valprint.c, typeprint.c, eval.c:
+ Add check_typedef/CHECK_TYPEDEF as needed.
+ * f-typeprint.c: Various cleaning up.
+ * valarith.c (value_subscript): Also subscript bitstrings (for Chill).
+ * typeprint.c (print_type_scalar): Also support TYPE_CODE_RANGE.
+ * eval.c (evaluate_subexp_standard case OP_ARRAY): Implement
+ support for labelled array tuples and ranges in powerset tuples.
+ (init_array_element): New function.
+
+ * top.c (command_line_input): Only strip out an initial #-comment.
+ Looking for internal comments is language-specific (breaks Scheme).
+
+ * expression.h (enum exp_opcode): Add BINOP_RANGE.
+ * expprint.c (dump_expression): Support BINOP_RANGE.
+ * eval.c (evaluate_subexp_standard): Handle BINOP_RANGE (as error).
+ (case MULTI_SUBSCRIPT): Fix broken f77 value->int ad hoc conversion.
+ * ch-lang.c (chill_op_print_tab): Support BINOP_RANGE.
+ (evaluate_subexp_chill): Error on BINOP_COMMA.
+
+ * Makefile.in: Clean up so doc stuff stays in doc sub-dir.
+
+Wed Nov 29 16:39:50 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * monitor.c (monitor_debug): New function to print monitor debug
+ output in printable fashion.
+ (monitor_printf{,_noecho}): Call monitor_debug instead of
+ fputs_unfiltered.
+
+ * srec.c (load_srec): When printing srec debug information, do not
+ print the carriage return directly, instead print \\r followed by
+ a newline.
+
+Tue Nov 28 15:25:28 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (target_subdir): Define.
+ (CC_FOR_TARGET, CXX_FOR_TARGET): Use it to find target libraries.
+ * configure.in (X_CFLAGS): Fix typo.
+ (target_subdir): Set to "${target_alias}/" if cross.
+ * configure: Regenerated.
+
+ * dbxread.c (dbx_symfile_read): Set block_address_function_relative
+ for `pe' format files.
+
+Tue Nov 28 11:17:47 1995 Fred Fish <fnf@cygnus.com>
+
+ * magic.h: Renamed to gmagic.h to avoid <magic.h> conflict.
+ * magic.c: Renamed to gmagic.c in sympathy.
+ * eval.c, gmagic.c, config/tm-magic.h:
+ Include "gmagic.h" rather than "magic.h".
+
+Sat Nov 25 02:56:38 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (handle_psymbol_enumerators, parse_symbol):
+ Recognize enums from alpha cc -migrate.
+ (upgrade_type): Pass correct fd to parse_symbol when parsing
+ the index type of an array.
+ (parse_procedure, parse_lines, psymtab_to_symtab_1): Handle
+ unsorted procedure descriptors from Irix 5.x and Alpha OSF/1-3.x
+ shared libraries. Use CORE_ADDR instead of `unsigned long' in
+ procedure descriptor address computations.
+
+ * symtab.c (decode_line_1): Prevent accidental strchr match
+ of a null character with the terminating null character of
+ gdb_completer_quote_characters.
+ (cplusplus_hint): Make sure that only a single quote is printed
+ in the hint message.
+
+Fri Nov 24 16:17:01 1995 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (recurse_read_control_structure): Don't make cleanups
+ here. Callers handle that correctly.
+
+Tue Nov 21 15:16:34 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * config/m68k/xm-hp300hpux.h: Define MMAP_BASE_ADDRESS and MMAP_INCREMENT.
+ Also force HAVE_MMAP to be defined since autoconf is currently broken
+ for detecting a working mmap under hpux.
+ * config/pa/xm-hppah.h (MMAP_BASE_ADDRESS): Tweak MMAP_BASE_ADDRESS
+ to a better value suggested by Jeffrey A Law (law@cygnus.com).
+
+Tue Nov 21 08:48:58 1995 Fred Fish <fnf@cygnus.com>
+
+ * config/pa/xm-hppah.h: Define MMAP_BASE_ADDRESS and MMAP_INCREMENT.
+ Also force HAVE_MMAP to be defined since autoconf is currently broken
+ for detecting a working mmap under hpux.
+ * objfiles.c (map_to_address): Have gdb print a warning when it
+ is compiled with HAVE_MMAP but without both MMAP_BASE_ADDRESS and
+ MMAP_INCREMENT defined (thus making it appear mmap doesn't work).
+
+Mon Nov 20 14:13:53 1995 Stu Grossman (grossman@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Add support for dynamic function
+ trampolines. These are pieces of code between the caller and the
+ callee that figure out the address of the callee's code at run
+ time. Upon entry, we can't figure out the callee's address, so we
+ set a breakpoint within the trampoline where the address will be
+ known, and continue the target. Once we hit the breakpoint, we
+ break at the callee's address and proceed as usual.
+
+Mon Nov 20 11:12:34 1995 Fred Fish <fnf@cygnus.com>
+
+ * objfiles.c (allocate_objfile): Change warning message about mapped
+ symbol tables so that it is obvious that they are not supported on
+ this particular machine rather than implying they are not supported
+ at all in this version of gdb.
+
+Sun Nov 19 05:20:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * irix5-nat.c, osfsolib.c (solib_address): Return the name of the
+ containing solib.
+ * stack.c (print_frame_info): Use minimal symbol only if
+ fi->pc is in a known section.
+
+Sat Nov 18 11:19:35 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * solib.c (solib_address): Return the name of the containing solib.
+ * solib.h (PC_SOLIB): New macro; define using solib_address.
+ * stack.c (print_frame_info) [PC_SOLIB]: If no function name, try
+ PC_SOLIB on the PC value.
+
+Sat Nov 18 04:09:31 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * annotate.c (annotate_source, annotate_frame_begin): Issue
+ `0x' prefix for the pc value, to remain consistent with previous
+ GDB versions.
+
+ * blockframe.c (find_pc_partial_function), config/pa/tm-hppa.h:
+ Remove Sun shared library transfer hack and
+ INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK, it is obsoleted by the
+ mst_solib_trampoline minimal symbols.
+
+ * blockframe.c (inside_main_func): Check main_func_*pc against
+ INVALID_ENTRY_*PC, not zero.
+ * symfile.c (init_entry_point_info): Initialize ei.*pc with
+ INVALID_ENTRY_*PC.
+ * mipsread.c (mipscoff_symfile_read): If the entry_file bounds
+ are still unknown after processing the partial symbols, then try
+ to set them from the minimal symbols.
+
+ * infcmd.c (registers_info): Error out if selected_frame is NULL.
+ * stack.c (return_command): Select new current frame silently if
+ not interactive.
+
+ * mipsread.c (read_alphacoff_dynamic_symtab): Ignore additional
+ DT_MIPS_LOCAL_GOTNO and DT_MIPS_GOTSYM entries.
+
+ * irix5-nat.c (solib_create_inferior_hook): Call solib_add only
+ if auto_solib_add_at_startup is nonzero.
+ (_initialize_solib): Add "set auto-solib-add" command.
+ * osfsolib.c (solib_create_inferior_hook): Call solib_add only
+ if auto_solib_add_at_startup is nonzero.
+ (_initialize_solib): Add "set auto-solib-add" command.
+
+Wed Nov 15 17:12:04 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * utils.c: Don't include sys/ioctl.h etc if MPW is host.
+
+Tue Nov 14 17:16:46 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/arm/tm-arm.h (ADDITIONAL_REGISTER_NAMES): Fix r5.
+ (FRAME_SAVED_PC): Minor clean up.
+
+Tue Nov 14 14:51:05 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c (monitor_load_srec monitor_make_srec): Move all
+ S-record download code into srec.c.
+ * srec.c srec.h: New files. Contain S-record loading routines
+ formerly in monitor.c.
+ * serial.c serial.h: New routine just like fprintf, but uses
+ serial_t instead of FILE *.
+ * sh-tdep.c (frame_find_saved_regs init_extra_frame_info):
+ Don't add four to saved pc (makes things match manual). Also, fix
+ bug where we didn't get pc from stack frame correctly.
+ * config/sh/tm-sh.h (SAVED_PC_AFTER_CALL): Don't add four to
+ saved pc. Real hardware does this for you.
+ * sh3-rom.c (sh3_load): New routine. Sets up for download then
+ calls generic S-record loader.
+ * config/h8300/h8300.mt, config/h8500/h8500.mt,
+ config/m68k/monitor.mt, config/pa/hppapro.mt, config/sh/sh.mt:
+ Add srec.o to TDEPFILES.
+
+Tue Nov 14 15:57:36 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * ppcbug-rom.c: New file to support the Motorola PPCBUG monitor
+ for PowerPC's.
+
+ * config/powerpc/ppc{,le}-{eabi,sim}.mt (TDEPFILES): Include
+ ppcbug-rom.o, monitor.o, and srec.o
+
+ * config/i386/linux.mt (XDEPFILES): Include ser-tcp.o.
+
+Mon Nov 13 13:12:46 1995 Jeffrey A Law (law@cygnus.com)
+
+ * partial-stab.h: Remove GDB_TARGET_IS_HPPA kludge.
+
+Fri Nov 10 13:08:54 1995 Jeff Law (law@kahlua.cs.utah.edu)
+
+ * terminal.h (HAVE_SGTTY): Fix typo.
+
+Thu Nov 9 17:34:01 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (gdb_target): Build in the simulator for all
+ PowerPC eabi targets, not just eabisim, providing
+ --enable-sim-powerpc is used, or the host compiler is GCC.
+
+Thu Nov 9 14:04:05 1995 Raymond Jou (rjou@mexican.cygnus.com)
+
+ * mpw-config.in: Add variable with names of SIOW libraries.
+ * mpw-make.sed: Add an action to build SIOWgdb.
+
+Wed Nov 8 19:25:22 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Edit @ENABLE_CFLAGS@ out, mpw-configure can
+ add back in if necessary.
+
+Wed Nov 8 15:59:52 1995 James G. Smith <jsmith@pasanda.cygnus.co.uk>
+
+ * config/mips/vr4300.mt: Added simulator to default VR4300 build.
+
+Tue Nov 7 16:02:25 1995 Stu Grossman (grossman@cygnus.com)
+
+ * remote-mips.c (mips_initialize): Fix brain damage found by
+ Jamie. Basically had case statement in the wrong place...
+ * (mips_load): Remove unnecessary `db tty0' command. It's all
+ handled by mips_initialize now.
+
+Tue Nov 7 12:59:14 1995 Raymond Jou <rjou@mexican.cygnus.com>
+
+ * mac-gdb.r: Added #ifdef Macgdb.
+
+Tue Nov 7 14:59:51 1995 James G. Smith <jsmith@pasanda.cygnus.co.uk>
+
+ * remote-mips.c (mips_initialize): Updated to talk to VR4300 RISQ
+ monitor board.
+
+Mon Nov 6 11:44:11 1995 James G. Smith <jsmith@pasanda.cygnus.co.uk>
+
+ * config/mips/{tm-vr4300.h tm-vr4300el.h} (TARGET_MONITOR_PROMPT):
+ Change into real strings.
+
+ * remote-sim.c (gdbsim_open): Moved sim_open() call to after
+ callback initialisation.
+
+Sun Nov 5 00:07:52 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in (AC_CHECK_HEADERS): add stddef.h.
+
+Fri Nov 3 12:30:43 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (COMMON_OBS): Use corefile.o rather than core.o
+ * core.c: Rename to corefile.c.
+ * config/pyr/tm-pyr.h, umax-xdep.c, sun386-nat.c, pyr-xdep.c,
+ Makefile.in (SFILES), gould-xdep.c, coredep.c, armtdep.c,
+ arm-xdep.c, altos-xdep.c: Change core.c references to corefile.c.
+
+ From Graham Stoney <greyham@research.canon.oz.au>.
+ * Makefile.in (remote-array.o): Add rule to build.
+ (ALLDEPFILES): Add remote-array.c
+ * remote-array.c (baud_rate): Remove unnecessary declaration.
+ (baudrate): Remove.
+ (array_files_info): Print global baud_rate not baudrate.
+
+Sat Nov 4 10:21:58 1995 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (INTERNAL_CFLAGS): Add ENABLE_CFLAGS.
+ * fork-child.c (fork_inferior): Add call to
+ TARGET_CREATE_INFERIOR_HOOK to allow target specific code to get
+ control just before the new process executes it's first instruction.
+ * remote-mips.c (mips_initialize): Cleanup a bit. Don't try to
+ receive a packet at first. This speeds up initialization a lot.
+ Use TARGET_MONITOR_PROMPT instead of "<IDT>".
+ (common_breakpoint): Use rresponse instead of rerrflg to inspect
+ error code.
+ * symfile.c (syms_from_objfile reread_symbols): Call
+ TARGET_SYMFILE_POSTREAD to allow target specific code to get
+ control after reading new symbols.
+ * target.h: New macros TARGET_SYMFILE_POSTREAD, and
+ TARGET_CREATE_INFERIOR_HOOK. See above for descriptions.
+ * config/mips/{irix5.mh nm-irix5.h}: Delete nm-irix5.h. Make
+ NAT_FILE point directly at ../nm-sysv4.h.
+ * config/mips/{mipsm3.mh nm-m3.h}: Delete nm-m3.h. Make
+ NAT_FILE point directly at ../nm-m3.h.
+ * config/mips/{mipsv4.mh nm-sysv4.h}: Delete nm-sysv4.h. Make
+ NAT_FILE point directly at ../nm-sysv4.h.
+ * config/mips/nm-mips.h: Improve comment at top of file.
+ * config/mips/tm-mips.h (TARGET_MONITOR_PROMPT): Change
+ definition into a proper string.
+
+Wed Nov 1 20:18:08 1995 Fred Fish <fnf@cygnus.com>
+
+ * config/i386/tm-i386.h: New file containing generic i*86 target
+ definitions.
+ (TARGET_BYTE_ORDER): Moved here from tm-i386v.h.
+ (IEEE_FLOAT): Moved here from tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Define default as 2.
+ (FUNCTION_START_OFFSET): Moved here from tm-i386v.h.
+ (SKIP_PROLOGUE): Moved here from tm-i386v.h.
+ (SAVED_PC_AFTER_CALL): Moved here from tm-i386v.h.
+ (INNER_THAN): Moved here from tm-i386v.h.
+ (BREAKPOINT): Moved here from tm-i386v.h.
+ (DECR_PC_AFTER_BREAK): Moved here from tm-i386v.h.
+ (ABOUT_TO_RETURN): Moved here from tm-i386v.h.
+ (REGISTER_SIZE): Moved here from tm-i386v.h.
+ (NUM_REGS): Moved here from tm-i386v.h.
+ (REGISTER_NAMES): Moved here from tm-i386v.h.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Moved here from tm-i386v.h.
+ (FP_REGNUM): Moved here from tm-i386v.h.
+ (SP_REGNUM): Moved here from tm-i386v.h.
+ (PC_REGNUM): Moved here from tm-i386v.h.
+ (PS_REGNUM): Moved here from tm-i386v.h.
+ (FP0_REGNUM): Moved here from tm-i386aix.h.
+ (FPC_REGNUM): Moved here from tm-sun386.h.
+ (REGISTER_BYTES): Moved here from tm-i386aix.h.
+ (REGISTER_BYTE): Moved here from tm-i386aix.h.
+ (REGISTER_RAW_SIZE): Moved here from tm-i386aix.h.
+ (MAX_REGISTER_RAW_SIZE): Moved here from tm-i386aix.h.
+ (REGISTER_VIRTUAL_SIZE): Moved here from tm-i386aix.h.
+ (MAX_REGISTER_VIRTUAL_SIZE): Moved here from tm-i386aix.h.
+ (EXTRACT_RETURN_VALUE): Moved here from tm-i386aix.h.
+ (STORE_RETURN_VALUE): Moved here from tm-i386aix.h.
+ (REGISTER_VIRTUAL_TYPE): Moved here from tm-i386v.h.
+ (STORE_STRUCT_RETURN): Moved here from tm-i386v.h.
+ (FRAME_CHAIN): Moved here from tm-i386v4.h.
+ (FRAMELESS_FUNCTION_INVOCATION): Moved here from tm-i386v4.h.
+ (FRAME_SAVED_PC): Moved here from tm-i386os9k.h
+ (FRAME_ARGS_ADDRESS): Moved here from tm-i386v.h.
+ (FRAME_LOCALS_ADDRESS): Moved here from tm-i386v.h.
+ (FRAME_NUM_ARGS): Moved here from tm-i386sun.h.
+ (FRAME_ARGS_SKIP): Moved here from tm-i386v.h.
+ (FRAME_FIND_SAVED_REGS): Moved here from tm-i386v.h.
+ (PUSH_DUMMY_FRAME): Moved here from tm-i386v.h.
+ (POP_FRAME): Moved here from tm-i386v.h.
+ (CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET,
+ CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Moved here from
+ tm-i386v.h
+ (print_387_control_word, print_387_status_word): Declare prototypes.
+ (struct frame_info, struct frame_saved_regs): Forward decls for
+ prototypes.
+ (SP_ARG0): Moved here from tm-i386v.h.
+
+ * config/i386/tm-i386v.h:
+ (i386/tm-i386.h): Include.
+ (TARGET_BYTE_ORDER): Remove.
+ (IEEE_FLOAT): Remove.
+ (START_INFERIOR_TRAPS_EXPECTED): Undef before redefine to 4.
+ (FUNCTION_START_OFFSET): Remove.
+ (SKIP_PROLOGUE): Remove.
+ (i386_skip_prologue): Remove prototype.
+ (SAVED_PC_AFTER_CALL): Remove.
+ (INNER_THAN): Remove.
+ (BREAKPOINT): Remove.
+ (DECR_PC_AFTER_BREAK): Remove.
+ (ABOUT_TO_RETURN): Remove.
+ (REGISTER_SIZE): Remove.
+ (NUM_REGS): Undef before redefine to 16 (no FP support).
+ (REGISTER_NAMES): Undef before redefine.
+ (FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove.
+ (REGISTER_BYTES): Undef before redefine.
+ (REGISTER_BYTE): Undef before redefine.
+ (REGISTER_RAW_SIZE): Undef before redefine.
+ (REGISTER_VIRTUAL_SIZE): Undef before redefine.
+ (MAX_REGISTER_RAW_SIZE): Undef before redefine.
+ (MAX_REGISTER_VIRTUAL_SIZE): Undef before redefine.
+ (REGISTER_VIRTUAL_TYPE): Undef before redefine.
+ (STORE_STRUCT_RETURN): Undef before redefine.
+ (EXTRACT_RETURN_VALUE): Undef before redefine.
+ (STORE_RETURN_VALUE): Undef before redefine.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
+ (FRAME_CHAIN): Undef before redefine.
+ (FRAMELESS_FUNCTION_INVOCATION): Undef before redefine.
+ (FRAME_SAVED_PC): Undef before redefine.
+ (FRAME_ARGS_ADDRESS): Remove.
+ (FRAME_LOCALS_ADDRESS): Remove.
+ (FRAME_NUM_ARGS): Undef before redefine.
+ (FRAME_ARGS_SKIP): Remove.
+ (FRAME_FIND_SAVED_REGS): Remove.
+ (PUSH_DUMMY_FRAME): Remove.
+ (POP_FRAME): Remove.
+ (CALL_DUMMY): Remove.
+ (CALL_DUMMY_LENGTH): Remove.
+ (CALL_DUMMY_START_OFFSET): Remove.
+ (CALL_DUMMY_BREAKPOINT_OFFSET): Remove
+ (FIX_CALL_DUMMY): Remove.
+ (print_387_control_word): Remove.
+ (print_387_status_word): Remove.
+ (SP_ARG0): Remove.
+
+ * config/i386/tm-symmetry.h:
+ (TM_SYMMETRY_H): Enclose file in test for define & define if needed.
+ (START_INFERIOR_TRAPS_EXPECTED): Move to after inclusion of
+ tm-i386v4.h or tm-i386v.h, #undef, and #define back to 2.
+ (DECR_PC_AFTER_BREAK): Move to after inclusion of tm-i386v4.h
+ or tm-i386v.h, #undef, and #define to 0.
+ (MAX_REGISTER_RAW_SIZE): Remove.
+ (FRAME_CHAIN): Remove.
+ (FRAMELESS_FUNCTION_INVOCATION): Remove.
+ (FRAME_SAVED_PC): Remove.
+ (print_387_control_word, print_387_status_word): Remove prototypes.
+
+ * config/i386/tm-ptx.h:
+ (TM_PTX_H): Enclose file in test for define & define if needed.
+ (START_INFERIOR_TRAPS_EXPECTED): Move to after inclusion of
+ tm-i386v4.h or tm-i386v.h, #undef, and #define back to 2.
+ (DECR_PC_AFTER_BREAK): Move to after inclusion of tm-i386v4.h
+ or tm-i386v.h, #undef, and #define to 0.
+ (SDB_REG_TO_REGNUM): Remove obsolete commented out define.
+ (print_387_control_word, print_387_status_word): Remove prototypes.
+
+ * config/i386/tm-linux.h:
+ (TM_LINUX_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+
+ * config/i386/tm-i386v4.h:
+ (TM_I386V4_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+ (FRAME_CHAIN): Moved to tm-i386.h.
+ (FRAMELESS_FUNCTION_INVOCATION): Moved to tm-i386.h.
+ (FRAME_SAVED_PC): Remove.
+ (sigtramp_saved_pc): Define as i386v4_sigtramp_saved_pc.
+ (FRAME_NUM_ARGS): Remove.
+
+ * config/i386/tm-i386os9k.h:
+ (TM_I386OS9K_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+ (NUM_REGS): Undefine before redefining.
+ (FRAME_CHAIN): Remove.
+ (FRAMELESS_FUNCTION_INVOCATION): Remove.
+ (FRAME_SAVED_PC): Move to tm-i386.h.
+
+ * config/i386/tm-i386nw.h:
+ (TM_I386NW_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+
+ * config/i386/tm-i386bsd.h:
+ (TM_I386BSD_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+ (FRAMELESS_FUNCTION_INVOCATION): Remove.
+ (FRAME_SAVED_PC): Remove.
+
+ * config/i386/tm-i386aix.h:
+ (i386/tm-i386.h): Include instead of tm-i386v.h.
+ (START_INFERIOR_TRAPS_EXPECTED): Remove.
+ (FP_REGNUM): Remove.
+ (SP_REGNUM): Remove.
+ (PC_REGNUM): Remove.
+ (PS_REGNUM): Remove.
+ (FP0_REGNUM): Moved to tm-i386.h.
+ (NUM_REGS): Remove.
+ (REGISTER_NAMES): Remove.
+ (REGISTER_BYTES): Moved to tm-i386.h.
+ (REGISTER_BYTE): Moved to tm-i386.h.
+ (REGISTER_RAW_SIZE): Moved to tm-i386.h.
+ (MAX_REGISTER_RAW_SIZE): Moved to tm-i386.h.
+ (REGISTER_VIRTUAL_SIZE): Moved to tm-i386.h.
+ (REGISTER_VIRTUAL_TYPE): Removed.
+ (EXTRACT_RETURN_VALUE): Moved to tm-i386.h.
+ (STORE_RETURN_VALUE): Moved to tm-i386.h.
+
+ * config/i386/tm-sun386.h:
+ (TM_SUN386_H): Enclose file in test for define & define if needed.
+ (i386/tm-i386.h): Include.
+ (TARGET_BYTE_ORDER): Remove.
+ (FUNCTION_START_OFFSET): Remove.
+ (SKIP_PROLOGUE): Remove.
+ (SAVED_PC_AFTER_CALL): Remove.
+ (INNER_THAN): Remove.
+ (BREAKPOINT): Remove.
+ (DECR_PC_AFTER_BREAK): Remove.
+ (ABOUT_TO_RETURN): Remove.
+ (REGISTER_SIZE): Remove.
+ (NUM_REGS): Undefine before defining.
+ (REGISTER_NAMES): Undefine before redefining.
+ (REGISTER_BYTES): Undefine before redefining.
+ (REGISTER_BYTE): Undefine before defining.
+ (FP_REGNUM): Undefine before defining.
+ (PC_REGNUM): Undefine before defining.
+ (FPC_REGNUM): Undefine before defining.
+ (REGISTER_RAW_SIZE): Undefine before defining.
+ (FRAME_CHAIN): Undefine before defining.
+ (FRAMELESS_FUNCTION_INVOCATION): Undefine before defining.
+ (FRAME_SAVED_PC): Undefine before defining.
+ (FRAME_NUM_ARGS): Moved to tm-i386.h.
+ (MAX_REGISTER_RAW_SIZE): Remove.
+ (MAX_REGISTER_VIRTUAL_SIZE): Remove.
+ (STORE_STRUCT_RETURN): Remove.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
+ (FRAME_ARGS_ADDRESS): Remove.
+ (FRAME_LOCALS_ADDRESS): Remove.
+ (FRAME_NUM_ARGS): Undefine before defining.
+ (FRAME_ARGS_SKIP): Remove.
+ (FRAME_FIND_SAVED_REGS): Remove.
+ (PUSH_DUMMY_FRAME): Remove.
+ (POP_FRAME): Remove.
+ (CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET): Remove.
+ (struct frame_info, struct frame_saved_regs): Remove forward decls
+ for prototypes.
+
+ * config/i386/tm-i386lynx.h (i386/tm-i386.h): Include instead of
+ tm-i386v.h.
+ * config/i386/tm-i386m3.h (i386/tm-i386.h): Include instead of
+ tm-i386v.h.
+
+ * i386-tdep.c (i386_extract_return_value): Make function visible
+ for all i386 targets, but only assume floating point values returned
+ in floating point registers for I386_AIX_TARGET.
+
+ * i386v-nat.c (i386_register_u_addr): Enable code to locate
+ floating point regs in user struct.
+
+Wed Nov 1 15:32:57 1995 Fred Fish <fnf@cygnus.com>
+
+ * breakpoint.c (breakpoint_re_set): Fix typo in comment.
+ * symtab.c (in_prologue): Document func_start and when it is zero
+ don't call SKIP_PROLOGUE (which typically leads unconditionally to
+ an error when we try to access a prologue at address 0).
+
+Tue Oct 31 13:01:15 1995 Fred Fish <fnf@cygnus.com>
+
+ * elfread.c: Include elf-bfd.h rather than libelf.h.
+
+Tue Oct 31 10:42:42 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * win32-nat.c (xlate_exception): Treat a stack overflow like a SEGV.
+
+Sun Oct 29 11:22:05 1995 Fred Fish <fnf@cygnus.com>
+
+ * monitor.c: Include gnu-regex.h rather than system regex.h.
+
+Sat Oct 28 23:51:48 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * defs.h: Test on name __WIN32__ rather than WIN32.
+ * inflow.c (new_tty): Likewise
+ * terminal.h: Likewise.
+ * utils.c (initialize_utils): Likewise.
+ * win32-nat.c (child_create_inferiror): Print error code when failing.
+ * config/i386/win32.mh (XM_CLIBS): Need -lkernel32.
+
+Sat Oct 28 04:52:36 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * symtab.h (enum address_class): Add LOC_UNRESOLVED for
+ a location whose address has to be resolved via the minimal
+ symbol table.
+ * buildsym.c (finish_block), findvar.c (symbol_read_needs_frame,
+ read_var_value), printcmd.c (address_info),
+ symmisc.c (print_symbol, print_partial_symbol): Handle
+ LOC_UNRESOLVED.
+ * stabsread.c (scan_file_globals): Change unresolved LOC_STATIC
+ symbols to LOC_UNRESOLVED. Remove rt_common_objfile lookup
+ kludge, global common symbols are now handled by LOC_UNRESOLVED.
+ (scan_file_globals_1): Move code back to scan_file_globals,
+ delete.
+
+Fri Oct 27 09:54:07 1995 Stu Grossman (grossman@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set): #ifdef GET_LONGJMP_TARGET
+ around calls to create_longjmp_breakpoint. Why install the
+ breakpoints if we can't find the longjmp target?
+ * infrun.c (wait_for_inferior): Cleanup comments near call test.
+ * remote-mips.c: Fixed a bunch of prototypes to avoid char/int
+ complaint from picky compilers. Add comment to mips_expect.
+ Replace all instances of sr_get_debug with remote_debug.
+ * (mips_readchar): Don't jam init string to monitor.
+ mips_initialize() handles that.
+ * (mips_receive_header): Print better message when we get too
+ much garbage.
+ * (mips_request): Allow caller to pass in buff to allow them to
+ analyze the returned message.
+ * (mips_initialize): Re-do initialization to try sending a BREAK,
+ a ^C, and then a download escape sequence. Cleanup protocol
+ startup. Eliminate sleeps. Clear breakpoints (if using monitor
+ breakpoints). Re-init frame.
+ * (mips_detach): Close down target.
+ * (mips_wait): Handle return status with registers, or breakpoint
+ * stuff.
+ * (mips_kill): Add ^C handling.
+ * (mips_insert_breakpoint mips_remove_breakpoint): Call new
+ breakpoint stuff if enabled.
+ * (calculate_mask remote_mips_set_watchpoint
+ remote_mips_remove_watchpoint remote_mips_stopped_by_watchpoint):
+ Hardware watchpoint/breakpoint stuff.
+ * (common_breakpoint): Common code for new monitor breakpoint commands.
+ * (mips_load): Don't use `prompt'. It's a global variable.
+ * top.c (dont_repeat_command): New command for use in
+ user-defined commands to suppress auto-repeat (by hittin return key).
+ * valops.c: Add start of auto function-call abandonment capability.
+
+Thu Oct 26 22:02:27 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Add support for PowerMac host, add beginnings
+ of native support.
+ * mpw-make.sed: Disable subdir recursion, edit out useless rule.
+ * mac-xdep.c (Values.h): Don't include.
+ (GestaltEqu.h): Include Gestalt.h instead.
+ (do_mouse_down): Comment out control tracking, needs to be
+ updated to use UPP before will work on PowerMac.
+ * config/xm-mpw.h: New file, all-Mac host support.
+ * config/m68k/xm-mpw.h: Move most definitions into generic Mac
+ support.
+ * config/powerpc/xm-mpw.h: New file, PowerMac host support.
+
+Thu Oct 26 15:21:32 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * regex.h: Renamed to gnu-regex.h.
+ * regex.c: Renamed to gnu-regex.c.
+ * Makefile.in (POSSLIBS): Refer to gnu-regex.h and gnu-regex.c.
+ (REGEX, REGEX1): Change to gnu-regex.o instead of regex.o.
+ (regex.o): Renamed to gnu-regex.o; refer to gnu-regex.c.
+ (irix5-nat.o, osfsolib.o, gnu-regex.o, solib.o, source.o, symtab.o):
+ Likewise.
+ * irix5-nat.c, osfsolib.c, gnu-regex.c, solib.c, source.c, symtab.c):
+ Include "gnu-regex.h" instead of "regex.h".
+ * alpha-tdep.c (in_prologue): Rename to alpha_in_prologue, to
+ avoid conflicts with symtab.h.
+
+Tue Oct 24 18:30:18 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * config/pa/hppahpux.mh: Remove hardcoding of X locations.
+ * Makefile.in: Use X11_CFLAGS, X11_LDFLAGS and X11_LIBS.
+ * configure.in: Link X statically on Solaris, SunOS and HPUX.
+
+Tue Oct 24 12:26:14 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c (monitor_expect_regexp): Same as monitor_expect, but
+ with the obvious extension.
+ (monitor_read_memory_single): Use regexp for getmem.resp_delim
+ because of parsing ambiguities caused by certain monitors.
+ (monitor_read_memory): Use new regexp stuff to parse
+ getmem.resp_delim.
+ * monitor.h (struct memrw_cmd->resp_delim): Document this as a
+ regexp.
+ * sh3-rom.c: Finish off table. Use new regexp capability for
+ getmem commands.
+
+ * infrun.c (wait_for_inferior): Disable questionable code near
+ the step range test. Replace call detection test with much
+ simpler (and more efficient) test that doesn't require prologue
+ examination (as often).
+ * symtab.c symtab.h (in_prologue): New function that indicates
+ whether or not we are in a function prologue. This uses the
+ symbol table, and then falls back to prologue examination if that
+ fails. It's much more efficient for remote debugging because it
+ avoids examining memory, which is very slow. This is used in
+ wait_for_inferior to determine if we've made a function call that
+ needs to be skipped over (for next/nexti).
+ * mips-tdep.c (after_prologue): New function, returns the PC
+ after the prologue. Uses PDRs and the symbol table.
+ (mips_find_saved_regs): Use in_prologue() to avoid costly
+ prologue examination if possible.
+ (mips_skip_prologue): Use after_prologue() if possible to avoid
+ costly prologue examination.
+
+Mon Oct 23 16:03:33 1995 James G. Smith <jsmith@pasanda.cygnus.co.uk>
+
+ * configure.in (configdirs): Added support for the VR4300 default
+ builds (mips64*vr4300*el-*-elf*, mips64*vr4300*-*-elf*).
+
+ * configure: Regenerated.
+
+ * remote-mips.c (mips_load): Updated the prompt spotting code to
+ make use of the TARGET_MONITOR_PROMPT manifest.
+
+Sat Oct 21 06:11:49 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-tdep.c, mips-tdep.c (init_extra_frame_info):
+ Do not set saved registers from heuristics for a sigtramp frame.
+
+ * dwarfread.c (enum_type): Determine signedness of enum type
+ from enumerators.
+
+ * mips-tdep.c: Include gdb_string.h, gcc -Wall lint.
+
+ * rs6000-nat.c (xcoff_relocate_core): Fix typo.
+
+ * valops.c (value_repeat): Fix length of memory transfer to
+ match recent allocate_repeat_value change.
+
+Thu Oct 19 19:04:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdbtypes.c (get_discrete_bounds): Fix typo.
+
+Thu Oct 19 12:15:37 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * defs.h (SEEK_SET, SEEK_CUR): Add default definitions.
+ * dbxread.c, mdebugread.c, os9kread.c (SEEK_SET, SEEK_CUR):
+ Remove default definitions.
+
+ * Makefile.in (CC-LD): Rename to CC_LD, so MPW xform works.
+ (MMALLOC_SRC): Define.
+ (MMALLOC_CFLAGS): Use.
+ (ser-mac.o): Add rule.
+ * dwarfread.c, somread.c, ultra3-nat.c, xcoffread.c: Replace L_SET
+ with SEEK_SET in all calls to bfd_seek.
+ * scm-tags.h (scm_tags): Remove excess comma.
+
+ * mpw-config.in: Adapt to work with autoconf'ed configury;
+ build config.h, add empty definitions to mk.tmp.
+ (powerpc-apple-macos): Make it work.
+ * mpw-make.sed: New file, sed commands to translate Unix makefile
+ into MPW syntax.
+ * mpw-make.in: Remove.
+ * mac-gdb.r: New file, was macgdb.r, renamed for consistency
+ with other tools, now includes cfrg resource.
+ * macgdb.r: Remove.
+ * config/m68k/xm-mpw.h: Remove most of contents, replace with
+ include of include/mpw/mpw.h.
+
+Tue Oct 17 10:38:53 1995 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (frame_chain): Fix more obscure problems caused
+ by system calls that core dump processes without saving all
+ the register state.
+
+ * config/pa/hppahpux.mt (XDEPFILES): Remove bogus definition.
+ * config/pa/hppapro.mt (XDEPFILES): Likewise.
+
+Tue Oct 17 08:04:26 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * NEWS: Fix typo.
+
+Mon Oct 16 18:24:03 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * config/sh/tm-sh.h (REGISTER_VIRTUAL_TYPE): Return builtin_type_float
+ for FP registers.
+ (REGISTER_NAMES): Add FP register names. Remove ticks, stalls, cycles,
+ insts, plr, and tlr.
+ (NUM_REGS, NUM_REALREGS): Increase from 23 to 41.
+ (FPUL_REGNUM, FP0_REGNUM): New macros.
+
+Mon Oct 16 11:27:06 1995 Stu Grossman (grossman@cygnus.com)
+
+ * remote-mips.c: Add support for speedy (about 10x faster)
+ downloads.
+
+ * remote-array.c: Move baud_rate initialization from
+ _initialize_array to array_open. It was forcing the baud rate of
+ all targets to be 4800 baud! Seems like I've fixed this before...
+ * config/mips/idt.mt (TDEPFILES): Remove remote-array.o. This
+ has *nothing* to do with IDT!!!
+
+
+ * Makefile.in sh3-rom.c config/sh/sh.mt config/sh/tm-sh.h: Add
+ sh3 monitor support.
+ * monitor.c: Cleanup regexp compilation stuff to make it easier
+ to use several regexps.
+ * monitor.h: Get rid of struct rom_cmd_data. It's no longer used.
+ * config/m68k/tm-monitor.h: Don't redefine NUM_REGS here. It just
+ causes GDB to crash.
+
+ * sparcl-tdep.c: Cleanup serial error handling.
+
+Sun Oct 15 16:19:27 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * rs6000-tdep.c: Don't include a.out.h, improve some formatting.
+
+Fri Oct 13 15:27:49 1995 Stu Grossman (grossman@cygnus.com)
+
+ * dcache.c: Change default value of remotecache to off. It just
+ screws up too many targets.
+ * sparcl-stub.c: Add prototypes to many forward decls.
+ * Create private copies of strlen, strcpy, and memcpy to prevent
+ chaos when user steps into them.
+ * (trap_low handle_exception): Clean up DSU support code
+ (hardware breakpoints). Move lots of stuff from asm-land to
+ C-land (make it much easier to #ifdef if necessary). Also, use
+ trap 255 to get into break mode instead of doing a DSU register
+ write, which may trash the register.
+ * (putpacket): Don't check return value of putDebugChar. It
+ returns void...
+
+Fri Oct 13 14:16:17 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * remote-sim.h: Always include callback.h.
+ (sim_set_callbacks): New declaration.
+
+Fri Oct 13 10:57:40 1995 Jeffrey A Law (law@cygnus.com)
+
+ * somsolib.c (som_solib_add): Just give a warning if a file
+ mentioned in the dld_list can't be found.
+ * config/pa/tm-hppah.h (FRAME_SAVED_PC_IN_SIGTRAMP): Dig out
+ the PC from the PC queues rather than %r31.
+
+Thu Oct 12 13:36:15 1995 Jeffrey A Law (law@cygnus.com)
+
+ * corelow.c (core_open): Don't update the to_sections and
+ to_sections_end fields in core_ops here. It's too late.
+ * irix5-nat.c (solib_add): Update the to_sections and
+ to_sections_end fields in core_ops here if needed.
+ * osfsolib.c (solib_add): Likewise.
+ * rs6000-nat.c (xcoff_relocate_core): Likewise.
+ * solib.c (solib_add): Likewise.
+ * somsolib.c (solib_add): Likewise.
+
+Wed Oct 11 17:25:59 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * Makefile.in (VERSION): Bump version to 4.15.1
+
+Tue Oct 10 15:26:39 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VERSION): Version 4.15 released.
+ * README: Updated for version 4.15.
+ * NEWS: Updated for 4.15 release.
+
+Tue Oct 10 13:18:50 1995 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Add AC_PROG_YACC
+ * configure: Regenerate
+ * Makefile.in (BISON): Remove macro definition.
+ (YACC): Set from autoconfig.
+ (FLAGS_TO_PASS): Remove BISON.
+ (TARGET_FLAGS_TO_PASS): Remove BISON.
+
+Tue Oct 10 12:25:11 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * win32-nat.c (child_create_inferior): Pass argv correctly.
+ * Makefile.in (win32-nat.o): Add dependencies.
+
+Mon Oct 9 14:36:29 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * NEWS: Add information about win32 and arm code.
+ * win32-nat.c: Renamed from win32.c.
+ * config/i386/win32.mh: Renamed from config/i386/i386win32.mh.
+ * config/i386/win32.mt: Renamed from config/i386/i386win32.mt.
+ * config/i386/tm-win32.h: Renamed from config/i386/tm-i386win32.h.
+ * config/i386/xm-win32.h: Renamed from config/i386/xm-i386win32.h.
+ * configure.in (i[345]86-*-win32): Updated to cope with filename
+ changes.
+ * configure: Regenerated.
+
+Sun Oct 8 18:01:04 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.y (yylex): Also look for '$' following '$'.
+
+Sat Oct 7 22:52:42 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * ch-exp.y (yylex): Fix typo.
+
+Fri Oct 6 11:56:49 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Put callback initializations here.
+ (_initalize_remote_sim): Not here.
+
+Fri Oct 6 17:08:49 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.c (execute_control_command): Use 0/1 instead of BFD's
+ true/false.
+
+Fri Oct 6 14:43:19 1995 Stu Grossman (grossman@cygnus.com)
+
+ * sparcl-stub.c: Include sparclite.h to get access to register
+ fondling macros.
+ * (trap_low): Save and restore FP regs if necessary. Also, clean
+ up save and restore of debug unit regs.
+ * (hard_trap_info): Add more architecturally defined traps.
+ * (set_debug_traps): Only set FP disabled trap if FP is disabled.
+ * (get_in_break_mode): Clean up. Get rid of calls to
+ set_hw_breakpoint_trap(). Also, use write_asi macro.
+ * (handle_exception): Clean up `g' and `G' commands. Add `P'
+ command.
+ * (hw_breakpoint): Why was this here!? It's gone now...
+
+Fri Oct 6 11:56:49 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * callback.c (fdbad): Fix typo in comment.
+ (os_close, os_isatty, os_lseek, os_read, os_write): Use if
+ statements rather than || to get correct return value.
+ (os_write_stdout): Pass missing first argument to os_write.
+ * remote-sim.c: Include callback.h.
+ (_initialize_remote_sim): Call sim_set_callbacks and then
+ initialize the callbacks.
+
+Thu Oct 5 17:28:09 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * values.c (allocate_repeat_value): Allocate an array type, and
+ a value of that type; use that instead of setting VALUE_REPEATED.
+ * value.h (struct value): Remove fields repetitions and repeated.
+ (VALUE_REPEATED, VALUE_REPETITIONS): Removed, no longer used.
+ * c-valprint.c, ch-valprint.c, eval.c, printcmd.c, valops.c,
+ value.h, values.c: Simplify, since now VALUE_REPEATED is never
+ used.
+ * valprint.c (value_print_array_elemen): Removed never-used
+ function.
+
+Thu Oct 5 15:14:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * parse.c (write_dollar_variable): New function.
+
+ * c-exp.y (yylex): Replace code for recognizing '$'
+ pseudo-variables with a call to write_dollar_variable.
+ Simplify grammar correspondingly.
+ * f-exp.y: Likewise.
+ * m2-exp.y: Likewise.
+ * ch-exp.y: Likewise. (Remove function match_dollar_tokens.)
+ * scm-exp.c (scm_lreadr): Call write_dollar_variable to handle '$'.
+
+Thu Oct 5 13:27:30 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * win32.c: New file; support for debugging on windows NT.
+ * configure.in: (i[345]86-*-win32): New target.
+ * configure: Regnerated.
+ * eval.c (evaluate_subexp_standard): Remove unused name.
+ * serial.c (gdb_string.h): Include.
+ * source.c (value.h): Include.
+ * config/i386/i386win32.mh (XDEPFILES): Add win32.o
+ * config/i386/i386win32.mt: New.
+ * config/i386/tm-i386win32.h: New.
+
+Wed Oct 4 18:41:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * expression.h (enum exp_code): Added OP_NAME.
+ * expprint.c (print_subexp): Add OP_NAME support.
+ * parse.c (length_of_subexp, prefixify_subexp): Likewise.
+ * scm-lang.c (scm_unpack, in_eval_c, scm_lookup_name): new function.
+ * scm-lang.h: Declare builtin_type_scm; other minor tweaks.
+ * values.c (unpack_long): If type is SCM, call scm_unpack.
+ * scm-valprint.c (scm_val_print): Use extract_signed_integer,
+ instead unpack_long
+ * scm-lang.c: More Scheme expression parsing from here ...
+ * scm-exp.c: ... to here. New file.
+ Also, provide for gdb to evaluate simple constants and names..
+ * Makefile.in: Note new scm-exp.{c,o}.
+
+Wed Oct 4 17:23:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdbtypes.c (get_discrete_bounds): New function.
+ (force_to_range_type): Use get_discrete_bounds.
+ * gdbtypes.h (get_discrete_bounds): Add declaration.
+ * valarith.c (value_bit_index): Generalize to use get_discrete_bounds.
+ * ch-valprint.c (chill_val_print): Make (power)sets and bitstring
+ support use get_discrete_bounds and generally be more robust.
+
+Tue Oct 3 16:54:56 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-nrom.c (nrom_ops): Add value for to_thread_alive,
+ add comments naming slots.
+
+Mon Oct 2 21:45:44 1995 Jeff Law (law@hurl)
+
+ * top.c (build_command_line): Demand arguments for if/while
+ commands.
+
+Mon Oct 2 13:08:01 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * Makefile.in (X11_CFLAGS): Set only to @X_INCDIR@.
+
+Sat Sep 30 16:13:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * scm-lang.c: Moved Scheme value printing code to ...
+ * scm-valprint.c: ... this new file.
+ Also major improvements in support for printing SCM values.
+ * scm-lang.h: New file.
+ * scm-tags.h: New file.
+ * Makefile.in: Note new scm-valprint.{c,o}.
+
+Sat Sep 30 09:35:02 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in: X_INCDIR and X_LIBDIR added.
+ * Makefile.in: @X_INCDIR@ and @X_LIBDIR@ added.
+ * configure: Regnerated.
+
+Fri Sep 29 02:10:05 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * config/arm/tm-arm.h (FRAME_CHAIN, FRAME_CHAIN_VALID):
+ Any pc > LOWESTPC is ok.
+
+ * remote-rdp.c (rdp_init): Take out variable baud rate stuff.
+ (remote_rdp_detatch): Delete.
+ * breakpoint.c (ctype.h): Don't include twice.
+
+ * Makefile.in (remote-rdp.o): Doesn't need remote-rdp.h
+ * callback.c (os_printf_filtered): fix protos.
+ * defs.h (puts_filtered, puts_unfiltered
+ [v|f|]printf_[un]filtered): Make format arg const.
+ * remote-rdp.c (rdp_init): Attept to sync at different
+ baudrates.
+ * utils.c (puts_filtered, puts_unfiltered
+ [v|f|]printf_[un]filtered): Define prototypes with
+ const in the right place.
+
+Thu Sep 28 17:43:39 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * defs.h (enum language): Add language_scm.
+ * expression.h (enum exp_code): Added OP_EXPRSTRING.
+ * scm-lang.c: Preliminary support for Guile /SCM dialect of Scheme.
+ * expprint.c (print_subexp): Add OP_EXPRSTRING support.
+ * parse.c (length_of_subexp, prefixify_subexp): Likewise.
+ * valops.c (find_function_in_inferior): New function.
+ (value_allocate_space_in_inferior): New function.
+ (allocate_space_in_inferior): Redefine using previous function.
+ * Makefile.in (SFILES): Add scm-lang.c.
+ (COMMON_OBS): Add scm-lang.o
+
+Thu Sep 28 14:32:11 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * callback.[ch]: New files.
+ * remote-rdp.c: Support for the ARM RDP monitor.
+ * Makefile: Update.
+ * arm-tdep.c (arm_othernames): New.
+ (_initialize_arm_tdep): install 'othernames' command.
+ (arm_nullified_insn, shifted_reg_val, arm_get_next_pc): New.
+ * configure.in: Check for termios.h, termio.h and sgtty.h.
+ (i[345]86-*-win32*): New host.
+ * configure: Regenerated.
+ * inflow.c: Clean up inclusions.
+ * main.c (main): Check for WINGDB, not WIN32.
+ * printcmd.c (do_examine): Put QUIT test in loop.
+ * remote-hms.c (e7000_load): Delete.
+ (hms_ops): Point to generic_load instead.
+ * remote-hms.c (hms_ops): Point to generic_load.
+ * remote-sim.c (sim_callback_write_stdout): Becomes
+ gdbsim_write_stdout.
+ (gdbsim_load): Call generic_load.
+ * remote-utils.c (gr_load_image): Delete.
+ * ser-unix.c (terminal.h): Include instead of havig
+ own #if tree.
+ (hardwire_flush_input): Reset input buffer too.
+ * source.c (openp): If WIN32 then open file in binary mode.
+ * terminal.h: Configure IO mechanism using autoconf defines if
+ available and not overriden.
+ * utils.c (quit, pollquit, notice_quit): WIN32 check becomes
+ WINGDB check.
+
+ * config/arm/arm.mt (TDEPFILES): Add remote-rdp.o.
+ * config/arm/tm-arm.h (TARGET_BYTE_ORDER): becomes
+ TARGET_BYTE_ORDER_SELECTABLE.
+ (ADDR_BITS_REMOVE): New.
+ (ORIGINAL_REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES): New.
+ (INST_xx): New.
+ (FRAME_FIND_SAVED_REGS): Pass the right argument.
+ (arm_get_next_pc): Declare.
+
+Wed Sep 27 10:14:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (search_struct_field): Also allow "else" as a variant
+ name.
+ * eval.c (evaluate_struct_tuple): New function. Used to evaluate
+ structure tuples. Now also handles Chill variant records.
+ (get_label): New function, used by evaluate_struct_tuple.
+ (evaluate_subexp_standard case OP_ARRAY): Use evaluate_struct_tuple.
+ (evaluate_labeled_field_init): Removed.
+
+ * valops.c (search_struct_field): Generalize to work with Chill
+ variant records.
+
+Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_partial_symbols): Reset includes_used
+ and dependencies_used after finishing the partial symbol table.
+
+ * rs6000-tdep.c (push_dummy_frame): Handle lr_offset of zero
+ correctly.
+
+ * rs6000-nat.c (xcoff_relocate_core): Don't relocate data
+ addresses for the main objfile if DONT_RELOCATE_SYMFILE_OBJFILE
+ is defined.
+ * xcoffread.c: gcc -Wall lint. Remove traceback table reading
+ code. The existing code tried to add parameter information for
+ functions compiled without -g, which cannot be done properly
+ for optimized code and produced misleading parameter displays.
+ (ef_complaint, eb_complaint): Make a local static copy to avoid
+ dependency on coffread.c.
+ (read_xcoff_symtab, process_xcoff_symbol, scan_xcoff_symtab):
+ Enter C_EXT/C_HIDEXT symbols into the minimal symbol table only.
+ (read_xcoff_symtab): Ignore C_STAT section auxiliary entry
+ symbols. Complain about unmatched .ef and .eb symbols instead of
+ segfaulting.
+ (process_xcoff_symbol): Determine value of C_GSYM symbols via
+ the global_sym_chain mechanism in stabsread.c.
+ (xcoff_new_init): Call stabsread_new_init and buildsym_new_init.
+ (init_string_tab): Initialize length field bytes in the strtbl.
+ (scan_xcoff_symtab): Skip symbols that start with `$' or `.$'.
+ Set first_fun_line_offset for symbols with two auxents only.
+
+Wed Sep 20 21:06:35 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * op50-rom.c (op50n_cmds): Send ".\r" after the interrupt
+ character.
+
+Wed Sep 20 13:12:56 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (maintainer-clean): New target, synonym for
+ realclean. Add GNU standard maintainer-clean echos.
+ * gdbserver/Makefile.in (maintainer-clean): New target, synonym
+ for realclean.
+ * nlm/Makefile.in (maintainer-clean): Likewise.
+
+Wed Sep 20 08:16:03 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * defs.h (xmalloc, xrealloc): Delete, they're declared in libiberty.h.
+ (GETENV_PROVIDED, FCLOSE_PROVIDED): New.
+ * doc/gdbint.texinfo (GETENV_PROVIDED, FCLOSE_PROVIDED): Document.
+ * remote-sim.[ch] (sim_callback_write_stdout): New.
+
+Tue Sep 19 15:28:58 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdbtypes.c (create_set_type): Set TYPE_LENGTH in bytes, not bits.
+ * valops.c (value_bitstring): TYPE_LENGTH is bytes, not bits.
+
+ * gdbtypes.c (force_to_range_type): Calculate upper limit of
+ TYPE_CODE_CHAR depending on TYPE_LENGTH (instead of just using 255).
+
+Mon Sep 18 01:43:42 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (auto_solib_add_at_startup): Delete definition. No
+ longer needed.
+
+Sat Sep 16 13:23:36 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-mips.h (UNUSED_REGNUM): Define.
+ * mipsv4-nat.c (supply_gregset): Fill UNUSED_REGNUM register
+ with zero.
+
+Thu Sep 14 17:35:24 1995 Stu Grossman (grossman@cygnus.com)
+
+ * remote-sim.c (gdbsim_create_inferior): Back out change that
+ broke all simulator configurations except the rs6000.
+
+Thu Sep 14 14:44:59 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * monitor.c (monitor_expect): Discard NULL characters.
+
+Thu Sep 14 14:12:30 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * infcmd.c: Add extern declaration for auto_solib_add_at_startup.
+
+Wed Sep 13 13:33:58 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * symfile.c: Move global variable auto_solib_add_at_startup from
+ solib.c to symfile.c.
+ * solib.c: ditto.
+ * symfile.h: Add extern declaration of the above mentioned variable.
+ * infcmd.c: Take out extern declaration, since it's in symfile.h.
+
+Thu Sep 14 12:39:35 1995 Stu Grossman (grossman@cygnus.com)
+
+ * coffread.c (coff_symtab_read): Complain about unmatched .ef and
+ .eb symbols instead of segfaulting.
+
+Wed Sep 13 13:33:58 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * stabsread.c (read_one_struct_field): Use subfile language instead of
+ global language. Improve efficiency.
+
+Wed Sep 13 08:45:02 1995 Jeff Law (law@fast.cs.utah.edu)
+
+ * somsolib.c (auto_solib_add_at_startup): Define new global variable.
+ (som_solib_create_inferior_hook): Don't add libraries if
+ auto_solib_add_at_startup is zero.
+ (_initialize_som_solib): Add command to toggle
+ auto_solib_add_at_startup.
+
+Tue Sep 12 19:37:24 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * monitor.c (monitor_make_srec): Fix thinkos in computation
+ of addr_size.
+
+Tue Sep 12 15:46:18 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * stabsread.c (read_one_struct_field): Add a patch to handle cfront
+ generated stabs that each field is in full mangled name.
+
+ * stabsread.c: To include language.h and expression.h for the reason
+ above.
+
+ * infcmd.c (attach_command): Add solibs only when
+ auto_solib_add_at_startup is set.
+
+Mon Sep 11 17:22:35 1995 Fred Fish <fnf@cygnus.com>
+
+ * NEWS: Add information about remote target caching.
+
+Sun Sep 10 15:36:21 1995 Fred Fish <fnf@cygnus.com>
+
+ * defs.h: Only include mmalloc.h if NO_MMALLOC is not
+ defined.
+
+Sun Sep 10 10:24:48 1995 Michael Tiemann <tiemann@axon.cygnus.com>
+
+ * tm-ppc-eabi.h (PC_IN_CALL_DUMMY): Redefine this to work with the
+ simulator. FIXME.
+
+ * rs6000-tdep.c (push_dummy_frame): Calculate the correct link
+ register offset from the current frame (don't assume it is always 8).
+ (push_dummy_frame): Add comment about having only 4096 bytes of
+ stack space in the simulator (by default).
+
+ * remote-sim.c (gdbsim_create_inferior): Call
+ `add_text_to_loadinfo' so that gdb can find TOC entries when
+ calling functions in the inferior.
+
+Sun Sep 10 09:00:28 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-tdep.c (fill_fpregset): Fix incorrect FP_MAX_REGNUM
+ substitution.
+ (supply_fpregset): Use FP_MAX_REGNUM.
+
+Sat Sep 9 08:21:52 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * stabsread.c (read_enum_type): Exit loop for putting pending
+ enum symbols into the enum type correctly if we had no pending
+ symbols on entry to read_enum_type.
+
+Fri Sep 8 12:57:41 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * inferior.h: Add extern declaration of inferior_environ.
+ * solib.c (solib_map_sections): To get inferior's env instead of
+ gdb's for LD_LIBRARY_PATH, same for PATH.
+
+ * solib.c (solib_map_sections): Copy full path name into so_list
+ structure so that symbol_file_add can find it.
+
+Tue Sep 5 17:47:53 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/sparc/tm-sp64.h (REGISTER_RAW_SIZE): Lower 32 fp regs
+ have size 4.
+ (REGISTER_VIRTUAL_SIZE): Likewise.
+ (REGISTER_VIRTUAL_TYPE): Lower 32 fp regs have type float.
+ Upper 32 fp regs have type double.
+ * sparc-tdep.c (NUM_SPARC_FPREGS): Replace with
+ (FP_REGISTER_BYTES): this, and update all uses.
+ (FP_MAX_REGNUM): Define if not already.
+ (get_saved_register): Handle new sparc64 fp regs.
+ (sparc_frame_find_saved_regs): Likewise.
+ (sparc_print_register_hook): Only print fp regs < 32 as doubles.
+ Add code to handle long doubles when gdb does.
+ (_initialize_sparc_tdep): Use print_insn_sparc64 if sparc64.
+
+Sat Sep 2 06:41:26 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Explicitly `exit 0' for broken shells.
+ * configure: Rebuilt.
+
+ * symtab.c (list_symbols): Add missing blank after
+ `<function, no debug info>' output.
+
+ * valops.c (value_assign): Handle truncation when assigning
+ to bitfields. Use value_copy to construct the return value
+ from toval.
+ * values.c (value_copy): Copy VALUE_FRAME and VALUE_OPTIMIZED_OUT.
+
+Fri Sep 1 08:25:50 1995 James G. Smith <jsmith@beauty.cygnus.com>
+
+ * configure (mips64*vr4300*-*-elf): Support added.
+ * remote-mips.c (mips_readchar): Change to allow build-time prompt
+ string.
+ * config/mips/tm-mips.h: Added TARGET_MONITOR_PROMPT.
+ * config/mips/{vr4300.mt, vr4300el.mt, tm-vr4300.h,
+ tm-vr4300el.h}: Added.
+
+Thu Aug 31 12:48:04 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * config/sh/sh.mt (SIM): Add -lm.
+
+Wed Aug 30 18:10:57 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * rmote-nindy.c (non_dle, nidy_resume, nindy_wait): Changes to
+ conform to GNU coding standards.
+
+ * solib.c (match_main): Modify to follow GNU coding conventions.
+
+Mon Aug 28 17:07:26 1995 Kung Hsu <kung@lisa.cygnus.com>
+
+ * remote.c (remote_wait): Revert 19 July my change which should be
+ customer specific.
+
+Sat Aug 26 00:26:11 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol): Handle sh.value of zero for enums.
+ Determine signedness of enum type from enumerators.
+ (parse_type): Handle btIndirect types, handle fBitfield for
+ some non-member types.
+ (upgrade_type): Use TYPE_FLAG_TARGET_STUB for arrays with
+ unknown length.
+ (cross_ref): Handle stIndirect forward reference to btTypedef.
+
+ * stabsread.c (read_enum_type): Determine signedness of enum
+ type from enumerators.
+
+ * top.c (execute_command): Remove trailing whitespace from
+ command arguments, except for `set' and `complete' commands.
+ (validate_comname): Allow underscores in user defined command
+ names.
+
+ * values.c (modify_field): Change `Value does not fit in %d bits'
+ error to a warning. Exclude sign extension bits of negative field
+ values from fit check.
+
+Fri Aug 25 11:31:29 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (powerpc*-*-eabisim*): Only link in the simulator
+ if the target is powerpc{,le}-*-eabisim*, since the simulator
+ needs GCC to build.
+ * config/powerpc/ppc{,le}-sim.mt: Cloned from ppc{,le}-eabi.mt.
+ * config/powerpc/ppc{,le}-eabi.mt: Remove simulator support.
+ * config/powerpc/tm-ppc{,le}-sim.mt: Include tm-ppc{,le}-sim.h.
+
+Wed Aug 23 16:55:35 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/ppc{,le}-eabi.mt (SIM_OBJS, SIM): Link in the
+ PowerPC simulator.
+
+Tue Aug 22 02:00:47 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * tm-hppa.h (EXTRACT_RETURN_VALUE): Fix for FP values.
+
+ * tm-hppa.h (STORE_RETURN_VALUE): Fix to work with -msoft-float
+ calling conventions too. Use the TYPE of the return value, not
+ its length to determine if it should also be copied into the
+ floating point registers.
+
+ * tm-hppa.h (PROLOGUE_FIRSTLINE_OVERLAP): Delete. Causes more
+ problems than it fixes.
+ * hppa-tdep.c (skip_prologue): If we exit the main loop without
+ finding all the register saves, retry again without looking for
+ the registers we could not find the first time.
+
+Mon Aug 21 23:39:56 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (frame_chain_valid): Handle systems where "$START$"
+ calls "main" directly.
+ (skip_prologue): Always assume arguments were saved into the stack
+ since GCC will do so without setting the magic Args_Saved bit in
+ the unwind descriptor.
+
+Mon Aug 21 11:49:17 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-udi.c (udi_wait): Mask off high bits of stop reason.
+ * remote-udi.c (fetch_register): For unfetchable regs, pretend it's
+ done. Fix a bug.
+
+Mon Aug 21 00:45:17 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * Makefile.in (install): Remove "brokensed" hack, unnecessary now
+ that we're using autoconf.
+ (uninstall): Likewise.
+
+
+Sat Aug 19 01:19:34 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdbtypes.c (recursive_dump_type): Add dont_print_type_obstack
+ to inhibit infinite recursion when printing aggregate types.
+
+Fri Aug 18 17:48:55 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * dcache.c (dcache_write_line): Write dirty lines right.
+
+Fri Aug 18 06:26:56 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-tdep.c (isbranch): Fix typo which caused wrong
+ target addresses for annulled branches.
+
+Wed Aug 16 21:54:39 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (PROLOGUE_FIRSTLINE_OVERLAP): Define.
+
+Tue Aug 15 07:51:21 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * remote.c (remote_write_bytes): Chop up large transfers.
+
+Mon Aug 14 17:56:36 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gcc.patch: Remove, relevant only to long-ago versions of GCC.
+
+Mon Aug 14 13:43:01 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/sparc/tm-sparclite.h: Define FRAME_CHAIN_VALID_ALTERNATE.
+ * blockframe.c (inside_main_func): If main func addr range not set,
+ try to set it now.
+
+Sat Aug 12 15:34:54 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * config/powerpc/xm-aix.h (FIVE_ARG_PTRACE): Define.
+ * config/rs6000/xm-rs6000.h (FIVE_ARG_PTRACE): Likewise.
+
+ * configure.in: Recognize aix4 specially as some aspects
+ of aix4 need different handling than aix3.
+ * configure: Updated.
+ * config/powerpc/{aix4.mh,aix4.mt,tm-ppc-aix4.h}: New files
+ specific to aix4 support on the power pc.
+ * config/powerpc/tm-ppc-aix.h (DONT_RELOCATE_SYMFILE_OBJFILE): Do
+ not defined. The aix4 specific target files will do that.
+ * config/rs6000/{aix4,mh,aix4,mt,tm-rs6000-aix4.h}: New files
+ specific to aix4 support on the rs6000.
+
+ * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR): Don't
+ do the conversion if the pointer is not a magic aix function
+ pointer.
+ * rs6000-tdep.c: Include objfiles.h and symtab.h.
+ (is_magic_function_pointer): New function.
+
+ * rs6000-tdep.c (skip_prologue): Refine check for frameless
+ functions. Handle b .+4 emitted by aix4 compilers. Only
+ allow one load of a minimal toc pointer. Handle aix4 compiler's
+ code for alloca.
+
+ * rs6000-tdep.c (find_toc_address): Report an error if no toc was
+ found rather than possibly core dumping.
+
+ * partial-stab.h: Handle extra field generated by the aix4 compiler
+ for enumerations.
+ * stabsread.c (read_enum_type): Likewise.
+
+Sat Aug 12 03:18:04 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-tdep.c (extract_return_value): Fix returning of values
+ whose length is less than the register size for big endian targets.
+
+Fri Aug 11 13:04:32 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * symtab.c (list_symbols): if break command set breakpoint on
+ matched symbol.
+
+Wed Aug 9 18:59:05 1995 Fred Fish <fnf@cygnus.com>
+
+ * defs.h (strchr, strrchr, strstr, strtok, strerror): Enclose in
+ #ifndefs to protect against previous definitions as macros.
+
+Wed Aug 9 14:51:36 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * xcoffread.c (xcoff_symfile_offset): Revert an unwanted change
+ that got in accidentally with Aug 1 change.
+
+Sat Aug 5 09:07:28 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * remote-hms.c (hms_cmds): Get reg term right.
+ * monitor.c (monitor_fetch_register): If we see
+ a non-hex digit, just stop reading.
+ * remote.c (remote_wait): Change way $O is handled.
+
+Wed Aug 9 11:42:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * configure.in (powerpc-*-aix*): Recognize as a new gdb host
+ and target.
+ (powerpc-*-eabi*): Don't set configdirs.
+ (powerpcle-*-eabi*): Likewise.
+ * configure: Updated.
+ * rs6000-nat.c (vmap_ldinfo): Don't relocate data addresses
+ for the main objfile if DONT_RELOCATE_SYMFILE_OBJFILE is
+ defined.
+ * config/powerpc/{aix.mh,aix.mh}: Host and target makefile fragments
+ for powerpc running aix4.
+ * config/powerpc/{nm-aix.h, tm-ppc-aix.h, xm-aix.h}: Native, target
+ and host include files for powerpc running aix4.
+
+Wed Aug 9 08:11:45 1995 Stan Shebs <shebs@cygnus.com>
+
+ * top.c (target_output_hook): Really make it match defs.h (char *
+ is not the same as unsigned char *).
+
+Tue Aug 8 15:13:05 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (CXX_FOR_TARGET): Don't use ${rootme}/../gcc/xgcc
+ unless it is present.
+
+Tue Aug 8 10:50:15 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * top.c (target_output_hook): Make declaration match the one
+ in defs.h.
+
+ * symfile.c (add_psymbol_to_list): Initialize SYMBOL_SECTION.
+ (add_psymbol_addr_to_list): Likewise.
+ * symfile.h (ADD_PSYMBOL_VT_TO_LIST): Likewise.
+
+Mon Aug 7 15:34:29 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * top.c (target_output_hook): New definition.
+ * stack.c (gdb_string.h): Include after defs.h
+ * defs.h (target_output_hook): New declaration.
+ * source.c (mod_path): Fix Win32 \ handling.
+
+Sun Aug 6 22:14:25 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (frame_saved_pc): Don't try to dig a return pointer
+ out of a long branch stub.
+
+Fri Aug 4 13:37:31 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * xcoffread.c (process_linenos): Fix typo in last change.
+
+Thu Aug 3 22:01:26 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * ch-exp.y (write_lower_upper_value): Add prototype so bison
+ generated parser will insert prototype before first func usage.
+ Bison and byacc order the output sections differently. Also
+ make function static.
+
+Thu Aug 3 10:45:37 1995 Fred Fish <fnf@cygnus.com>
+
+ * Update all FSF addresses except those in COPYING* files.
+
+Thu Aug 3 01:38:45 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/alpha/tm-alpha.h (EXTRA_FRAME_INFO): Add pc_reg field.
+ (SKIP_TRAMPOLINE_CODE): Define.
+ * alpha-tdep.c (alpha_frame_saved_pc): Use pc_reg field from
+ frame to find the saved pc register.
+ (alpha_saved_pc_after_call): Skip over shared library trampoline
+ before trying to find the saved pc register.
+ (find_proc_desc): Copy PROC_PC_REG from found proc_desc
+ to heuristic proc_desc.
+ (init_extra_frame_info): Initialize pc_reg field in frame.
+
+Wed Aug 2 18:00:36 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (m68*-est-*): Use monitor target config.
+ * configure: Update.
+ * config/m68k/est.mt, config/m68k/tm-est.h: Delete.
+ * config/m68k/monitor.mt, config/m68k/tm-monitor.h: Fix comments.
+
+Tue Aug 1 22:52:53 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VERSION): Bump to 4.14.2
+
+Tue Aug 1 16:04:36 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * xcoffread.c (process_linenos): The value in include file symbol
+ should point to line number table. Currently this value is not
+ set correctly by AIX ld. A fix to get around this bug.
+
+Tue Aug 1 11:44:53 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in: Check for working mmap, ansi headers, string.h,
+ strings.h, and memory.h.
+ * configure: Regenerated.
+
+ * gdb_stat.h: New file, "portable" <sys/stat.h>.
+ * gdb_string.h: New file, "portable" <string.h>.
+
+ * altos-xdep.c, arm-tdep.c, arm-xdep.c, convex-tdep.c,
+ convex-xdep.c, coredep.c, cxux-nat.c, dbxread.c, exec.c,
+ gould-xdep.c, hppa-tdep.c, i386aix-nat.c, i386b-nat.c,
+ i386mach-nat.c, i386v-nat.c, infptrace.c, m88k-nat.c, main.c,
+ mdebugread.c, objfiles.c, os9kread.c, procfs.c, pyr-xdep.c,
+ rs6000-nat.c, source.c, standalone.c, stuff.c, sun386-nat.c,
+ symfile.c, symm-nat.c, symm-tdep.c, symtab.c, top.c, ultra3-nat.c,
+ ultra3-xdep.c, umax-xdep.c, xcoffread.c: Include "gdb_stat.h"
+ instead of <sys/stat.h>.
+
+ * alpha-tdep.c, breakpoint.c, buildsym.c, c-typeprint.c,
+ ch-typeprint.c, coffread.c, command.c, core-sol2.c, core-svr4.c,
+ core.c, corelow.c, cp-valprint.c, dbxread.c, dcache.c, demangle.c,
+ dpx2-nat.c, dstread.c, dwarfread.c, elfread.c, environ.c, eval.c,
+ exec.c, f-lang.c, f-typeprint.c, f-valprint.c, findvar.c,
+ fork-child.c, gdbtypes.c, hpread.c, i386-tdep.c, infcmd.c,
+ inflow.c, infptrace.c, infrun.c, irix5-nat.c, language.c,
+ m2-typeprint.c, main.c, mdebugread.c, minsyms.c, mipsread.c,
+ monitor.c, nlmread.c, objfiles.c, os9kread.c, osfsolib.c, parse.c,
+ printcmd.c, procfs.c, regex.c, remote-adapt.c,
+ remote-array.c, remote-bug.c, remote-e7000.c, remote-eb.c,
+ remote-es.c, remote-hms.c, remote-mm.c, remote-os9k.c,
+ remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c,
+ remote-utils.c, remote-vx.c, remote-vx29k.c, remote-vx68.c,
+ remote-vx960.c, remote-vxmips.c, remote-vxsparc.c, remote.c,
+ solib.c, somread.c, source.c, stabsread.c, stack.c, symfile.c,
+ symmisc.c, symtab.c, target.c, top.c, typeprint.c, utils.c,
+ valarith.c, valops.c, valprint.c, values.c, xcoffread.c: Include
+ "gdb_string.h" instead of <string.h>.
+
+ * config/xm-sysv4.h, i386/xm-ptx.h, m68k/xm-sun3os4.h,
+ sparc/xm-sun4os4.h (HAVE_MMAP): Removed.
+
+ * config/xm-lynx.h, config/i386/xm-ptx.h,
+ config/m68k/nm-apollo68b.h, config/m68k/xm-hp300hpux.h,
+ config/mips/xm-irix3.h, config/mips/xm-mips.h,
+ config/mips/xm-news-mips.h, config/mips/xm-riscos.h,
+ config/pa/hppah.h, config/rs6000/xm-rs6000.h,
+ config/sparc/xm-sun4os4.h, config/sparc/xm-sun4sol2.h,
+ config/vax/xm-vaxbsd.h, config/vax/xm-vaxult.h,
+ config/vax/xm-vaxult2.h (MEM_FNS_DECLARED): Removed.
+ * config/mips/xm-irix3.h, config/mips/xm-mips.h,
+ config/pa/xm-hppah.h (memcpy, memset): Removed declarations.
+
+Tue Aug 1 02:08:30 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (mips_extract_return_value): Fix returning of
+ values whose length is less than the register size for big endian
+ targets.
+ * alpha-tdep.c (alpha_extract_return_value,
+ alpha_store_return_value): Use alpha_convert_register_to_*
+ to handle functions returning "float" correctly.
+
+Mon Jul 31 19:12:48 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * h8500-tdep.c: General linting and cleanup.
+ (opcodes/h8500-opc.h): Don't include.
+ (code_size, data_size): Make static.
+ (frame_locals_address, frame_args_address): Remove.
+ (h8300_pop_frame): Rename to h8500_pop_frame.
+ (big_command, medium_command, compact_command, small_command):
+ Define as regular functions rather than with macro trickery.
+ (tm_print_insn): Set to correct disassembler function.
+ * config/h8500/tm-h8500.h: Minor cleanup, add prototypes.
+ (ABOUT_TO_RETURN): #if 0 out.
+ (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Use usual define.
+ (GDB_TARGET_IS_H8500): Remove duplicate definition.
+ (regoff): Remove, never used.
+ * config/h8500/h8500.mt (TDEPFILES): Add monitor.o.
+
+Mon Jul 31 14:32:30 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in: Check for unistd.h.
+ * configure: Regenerated.
+
+ * command.c, cp-valprint.c, fork-child.c, i386-tdep.c,
+ i386b-nat.c, inflow.c, main.c, maint.c, objfiles.c, solib.c,
+ source.c, stack.c, symfile.c, top.c, utils.c: Include strings.h
+ and/or unistd.h to bring prototypes into scope.
+
+Sun Jul 30 01:40:11 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-tdep.c (frame_saved_pc): Check for signal handler caller
+ before trying to determine the start of the function.
+ (skip_prologue): Skip subroutine call which might save the
+ floating point registers only if it is within the first three
+ instructions.
+ Reinstate setting of alloca_reg if setup of a gcc frame pointer
+ is found.
+ (frame_get_cache_fsr): Use new fields in rs6000_framedata.
+
+Sat Jul 29 14:43:35 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * sparclite: Removed subdirectory. aload and eload are now in
+ utils/sparclite, low-level library is in libgloss.
+ * configure.in (sparclite*): Don't configure sparclite subdir.
+ * configure: Update.
+ * Makefile.in (TARDIRS): Remove, no longer used.
+
+Sat Jul 29 01:45:56 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * procfs.c (unconditionally_kill_inferior): Clear current signal
+ if PROCFS_NEED_CLEAR_CURSIG_FOR_KILL is defined.
+ * config/alpha/nm-osf3.h (PROCFS_NEED_CLEAR_CURSIG_FOR_KILL): Define.
+
+ * alpha-tdep.c: Move sigtramp handling of saved registers from
+ read_next_frame_reg to alpha_find_saved_regs, handle saved
+ floating point registers.
+ * mips-tdep.c: Move sigtramp handling of saved registers from
+ read_next_frame_reg to mips_find_saved_regs, handle saved
+ floating point registers.
+ * config/mips/tm-irix3.h, config/mips/tm-irix5.h,
+ config/mips/tm-mipsv4.h (SIGFRAME_FPREGSAVE_OFF): Define.
+
+ * sparc-tdep.c (sparc_pc_adjust): Fix check for `unimp'
+ instruction to handle functions returning structures with
+ large sizes properly.
+
+Fri Jul 28 11:50:17 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * configure, configure.in (z8k-*-sim): deleted.
+
+Thu Jul 27 12:49:28 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * lynx-nat.c (child_wait): Handle threads exiting.
+
+Thu Jul 27 07:47:50 1995 Michael Meissner <meissner@cygnus.com>
+
+ * rs6000-tdep.c (skip_prologue): Don't assume the update stack
+ instruction is the last in the prologue, since xlc stores the lr
+ after the stack update. Make sure offset is correct sign for
+ large frames.
+ (frame_saved_pc): Move test for signal before frameless.
+
+ * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Define.
+ * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Redefine.
+
+Thu Jul 27 01:22:08 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Rewrite code for calling
+ into shared libraries.
+
+Wed Jul 26 23:33:34 1995 Michael Meissner <meissner@cygnus.com>
+
+ * config/rs6000/tm-rs6000.h (rs6000_framedata): Add offsets the
+ gprs, fprs, lr, and cr is stored at.
+ (FRAME_FIND_SAVED_REGS): Use new fields in rs6000_framedata.
+ (function_frame_info): Delete declaration.
+ (SKIP_PROLOGUE): Skip_prologue is now passed a rs6000_framedata
+ structure to fill in.
+ (FRAMELESS_FUNCTION_INVOCATION): Function now longer takes a
+ second argument.
+ (FRAME_SAVED_PC): Call frame_saved_pc.
+
+ * rs6000-tdep.c (skip_prologue): Recognize V.4 prologues as well
+ as AIX style. Fill in rs6000_framedata structure. Remember where
+ the gprs, fprs, cr, and lr are saved.
+ (pop_frame): Use skip_prologue, not function_frame_info, and use
+ new rs6000_framedata fields.
+ (function_frame_info): Function deleted.
+ (frameless_function_invocation): Separate frame_saved_pc support
+ to new function. Recognize V.4 frames.
+ (frame_saved_pc): New function.
+ (frame_get_cache_fsr): Use skip_prologue, not function_frame_info.
+ (frame_initial_stack_address): Ditto.
+
+Wed Jul 26 01:00:37 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * remote.c: Add documentation for extended protocol operations
+ and for thread_alive change from a couple weeks ago.
+ (extended_remote_ops): Declare and define a new target vector
+ for the extended remote protocol.
+ (extended_remote_restart): New function to restart the remote
+ server & process.
+ (remote_open): Just a stub routine.
+ (extended_remote_open): New function to start a remote session
+ using the extended gdb remote protocol.
+ (remote_open_1): New function containing code common to both
+ remote_open and extended_remote_open.
+ (remote_mourn, extended_remote_mourn, remote_mourn_1): Similarly.
+ (extended_remote_create_inferior): New function for the extended
+ remote target.
+ (initialize_remote): Add the extended_remote_ops target vector.
+ * gdbserver/server.c (main, case '!'): Set extended_protocol.
+ (main, case 'k'): If the extended protocol is in use, kill the
+ inferior then start a new one.
+ (main, case 'R'): New command to restart the remote server and
+ inferior process. Only supported when using the extended
+ protocol.
+ (main, server loop): If the inferior terminates while using the
+ extended protocol then start a new one. If getpkt fails when
+ using the extended protocol then exit.
+
+Tue Jul 25 11:43:44 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mdebugread.c (psymtab_to_symtab_1): Relocate encoded stab
+ line numbers using the psymtab's section offsets.
+
+Tue Jul 25 10:43:27 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/rs6000/tm-rs6000.h (rs6000_framedata): Rename from
+ aix_framedata. Change all uses.
+ * rs6000-tdep.c: Change all aix_framedata -> rs6000_framedata.
+
+Sat Jul 22 23:44:18 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * defs.h (ATTR_FORMAT): Disable if ANSI_PROTOTYPES is not defined.
+
+Fri Jul 21 16:50:28 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * lynx-nat.c (child_thread_alive): New function. Somehow I
+ forgot to check this in with all the other thread_alive changes.
+
+Thu Jul 20 22:22:34 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somread.c (som_symtab_read): Add unsatisfied common symbols to
+ the minimal symbol table. All common symbols are "unsatisfied"
+ when -E is passed to the linker.
+
+Thu Jul 20 15:04:57 1995 Fred Fish <fnf@cygnus.com>
+
+ * top.c (show_endian): Cast first arg of printf_unfiltered to
+ correct type of "char *".
+
+Thu Jul 20 14:18:51 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * lynx-nat.c (child_wait): A thread_id of zero from wait apparently
+ means the process is single threaded, so there's no need to add
+ it to the thread list. Handle case where multi-threaded process
+ reverts back to a single-threaded process.
+
+ * gdbserver/low-hppabsd.c: Remove error declaration.
+ * gdbserver/low-sparc.c: Likewise.
+ * gdbserver/low-sun3.c: Likewise.
+ * gdbserver/server.h: Remove error and fatal declaration.
+ * gdbserver/utils.c (error): Update to be compatable with recent
+ changes in defs.h.
+ (fatal): Likewise.
+
+Wed Jul 19 22:42:43 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/m68k/tm-m68kv4.h (DWARF_REG_TO_REGNUM): Define to
+ correctly map floating point registers numbers.
+
+ * dwarfread.c (locval, new_symbol): Handle variables that are
+ optimized out.
+
+ * mdebugread.c: Replace all uses of builtin_type_* with
+ mdebug_type_*. Define and initialize mdebug_type_*.
+
+ * serial.h (serial_close): Add additional argument `really_close'.
+ (SERIAL_CLOSE): Update serial_close call accordingly.
+ (SERIAL_UN_FDOPEN): Use serial_close to handle refcnt properly.
+ * serial.c (serial_close): Handle `really_close'.
+ * serial.h (scb_base): Moved to serial.c, made static.
+
+ * valops.c (value_addr): Don't coerce arrays.
+ (typecmp): Coerce arrays instead of calling value_addr if necessary.
+
+Wed Jul 19 18:19:28 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Richard Earnshaw (rearnsha@armltd.co.uk):
+ * infrun.c (wait_for_inferior): Set the convenience variable
+ $_exitcode to the termination code of the inferior.
+ * top.c (quit_command): Accept optional expression to use
+ as parameter to exit().
+
+Wed Jul 19 13:15:32 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote.c (remote_wait): When getting registers, check endianess and
+ do conversion if necessary.
+
+Tue Jul 18 00:41:31 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdbserver/low-hppabsd.c: New file.
+ * gdbserver/Makefile.in (SFILES): Add low-hppabsd.c.
+ * config/pa/hppabsd.mh (XDEPFILES): Add ser-tcp.o.
+ (GDBSERVER_DEPFILES): Add low-hppabsd.o.
+ * config/pa/hppaosf.mh: Likewise.
+
+Mon Jul 17 21:35:18 1995 Fred Fish <fnf@cygnus.com>
+
+ * dache.c (struct dcache_block): Change data member from unsigned
+ char to char, since everything passed in and out of dcache is char
+ or casted to appropriate type anyway.
+ (dcache_alloc): Move assignment of db out of test and combine
+ separate tests into if-else.
+ (dcache_peek_byte): Change ptr from unsigned char* to char*.
+ (dcache_peek_byte): Remove now unnecessary cast in read_memory call.
+ (dcache_peek): Change cast of incoming data arg.
+ (dcache_poke): Change cast of addr of incoming data arg.
+ (dcache_info): Mask data passed to printf_filtered to lsbyte only.
+ (dcache_info): Change printf_filtered arg from "% 2x" to " %2x".
+ * target.c (debug_to_thread_alive): Change return type to int and
+ return zero, for type compatibility with other *_thread_alive
+ funcs.
+ (cleanup_target): Change cast of ignore function to match type of the
+ to_thread_alive member.
+ * defs.h (error_hook): Add ATTR_NORETURN.
+ * defs.h (NORETURN, ATTR_NORETURN): Switch from volatile to
+ __attribute__ method with gcc 2.7, to avoid gcc 2.6.3 bug.
+ * remote.c (remote_wait): Cast first arg to strtol, strchr, and
+ strncmp to "const char *" from "unsigned char *".
+ (remote_wait): Cast arg to putpkt and strcpy from "unsigned char *"
+ to "char *".
+ (remote_wait): Change printf format for long arg from "%d" to "%ld".
+ (getpkt): Remove unused variable "bp".
+ (remote_fetch_word, remote_store_word): Ifdef out apparently unused
+ functions.
+ * breakpoint.c (watchpoint_check): Removed unused variables
+ "saved_level" and "saved_frame".
+ * valops.c (value_arg_coerce): Add other enum TYPE_CODE_* and
+ default cases to switch for completeness.
+ * infrun.c (wait_for_inferior): Enclose "have_waited" label
+ in #ifdef that matches the one in which it is referenced.
+ * ser-unix.c (hardwire_noflush_set_tty_state): Enclose otherwise
+ unused variable "state" in #ifdef that matches one in which it is
+ referenced.
+ * eval.c (evaluate_subexp_standard): Remove unused variable "var".
+ * eval.c (evaluate_subexp_standard): Remove unused variable
+ "tmp_symbol".
+ * valarith.c (value_subscript): Remove unused variable
+ "lowerbound", which is redeclared in a nested scope prior to use.
+ * printcmd.c (print_frame_nameless_args): Use "%ld" to print long
+ arg, not "%d".
+ * {mem-break.c, remote-pa.c, remote.c, saber.suppress}:
+ Remove unused static var "check_break_insn_size".
+ * buildsym.c (finish_block): Add other enum LOC_* and default
+ cases to switch for completeness.
+ ch-lang.c (type_lower_upper): Removed unused label "retry".
+ Add other enum TYPE_* and default cases to switch for completeness.
+ * f-typeprint.c (f_type_print_args): Ifdef out unused function
+ that may be used someday when Fortran support is complete.
+ * ch-valprint.c (chill_print_type_scalar): Add other enum
+ TYPE_* and default cases to switch for completeness.
+ (chill_val_print): Remove unused local var "high_bound" that
+ is redeclared in a nested scope prior to use.
+ (chill_var_print): Use "%ld" to print long arg, not "%d".
+ * regex.c (re_compile_fastmap, re_match_2): Add remaining enum
+ types and default to switches for completeness.
+ * minsyms.c (lookup_minimal_symbol_text): Delete unused variable
+ "trampoline_symbol".
+ (prim_record_minimal_symbol_and_info): Return NULL rather than
+ trash.
+ * elfread.c (elf_symtab_read): Don't dereference NULL returns from
+ record_minimal_symbol_and_info.
+ * f-lang.c (saved_function_list_end): Ifdef out unused variable
+ that may be used someday.
+ * f-valprint.c (f_val_print): Remove unused local "straddr".
+
+Mon Jul 17 13:08:00 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * stabsread.h (struct stab_section_list): Define.
+ (coffstab_build_psymtabs): Remove staboff and stabsize parameters.
+ Add textaddr, textsize, and stabs parameters.
+ * gdb-stabs.h (struct dbx_symfile_info): Remove text_sect field.
+ Add text_addr and text_size fields.
+ (DBX_TEXT_SECT): Don't define.
+ (DBX_TEXT_ADDR, DBX_TEXT_SIZE): Define.
+ * coffread.c: Include <ctype.h>.
+ (struct coff_symfile_info): Remove stabsect and stabindexsect
+ fields. Add textaddr, textsize, and stabsects fields.
+ (coff_locate_sections): Record the address of the .text section,
+ and total the sizes of all sections with names beginning with
+ ".text". Don't bother to record a .stab.index section (COFF
+ doesn't use them). Make a linked list of all sections with names
+ beginning with ".stab".
+ (coff_symfile_read): Adjust call to coffstab_build_psymtabs for
+ new parameters.
+ * dbxread.c (dbx_symfile_read): Use DBX_TEXT_ADDR and
+ DBX_TEXT_SIZE, rather than getting both from DBX_TEXT_SECT.
+ (dbx_symfile_init): Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not
+ DBX_TEXT_SECT.
+ (elfstab_build_psymtabs): Likewise.
+ (stabsect_build_psymtabs): Likewise.
+ (symbuf_sections, symbuf_left, symbuf_read): New static variables.
+ (fill_symbuf): If symbuf_sections is not NULL, read symbols from
+ multiple sections.
+ (coffstab_build_psymtabs): Remove staboffset and stabsize
+ parameters. Add textaddr, textsize, and stabsects parameters.
+ Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not DBX_TEXT_SECT. Handle
+ multiple stabs sections.
+ * os9kread.c (os9k_symfile_read): Use DBX_TEXT_ADDR and
+ DBX_TEXT_SIZE, rather than getting both from DBX_TEXT_SECT.
+ (os9k_symfile_init): Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not
+ DBX_TEXT_SECT.
+
+ * remote-vx.c (vx_ops, vx_run_ops): Initialize new to_thread_alive
+ field.
+
+Sat Jul 15 01:02:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/alpha/alpha-osf3.mh, config/alpha/nm-osf3.h: New files
+ for OSF/1-3.x procfs support.
+ * configure.in (alpha-dec-osf): Use them when configuring
+ for OSF/1-3.x.
+ * configure: Updated.
+ * target.c: Include <string.h>.
+
+Fri Jul 14 16:16:56 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in, configure.in: Use one variable, frags, to hold
+ pathnames of makefile fragments.
+ * configure: regenerated.
+
+Fri Jul 14 09:49:47 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * procfs.c (procfs_ops): Fix typo in last change.
+
+Thu Jul 13 13:42:38 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * inftarg.c (child_thread_alive): New function to see if a
+ particular thread is still running.
+ (child_ops): Add child_thread_alive entry.
+ * remote.c (remote_thread_alive): New function to see if a
+ particular thread is still alive.
+ (remote_ops): Add remote_thread_alive.
+ * target.c (dummy_target): Add dummy entry for thread_alive.
+ (cleanup_target): de_fault thread_alive too.
+ (update_current_target): INHERIT thread_alive too.
+ (debug_to_thread_alive): New function.
+ (setup_target_debug): Add debug_to_thread_alive.
+ * target.h (struct target_ops): Add to_thread_alive.
+ (target_thread_alive): Define.
+ * thread.c (info_threads_command): Don't call kill; use
+ target_thread_alive instead.
+ * config/nm-lynx.h (CHILD_THREAD_ALIVE): Define.
+ * gdbserver/low-lynx.c (mythread_alive): New function.
+ (mywait): Don't restart any threads after a new thread notification,
+ let the generic code handle it.
+ * gdbserver/low-sparc.c (mythread_alive): Dummy version.
+ * gdbserver/low-sun3.c (mythread_alive): Likewise.
+ * gdbserver/server.c (main): Handle thread_alive requests.
+ * gdbserver/server.h (mythread_alive): Declare.
+ * corelow.c (core_ops): Add dummy entry for thread_alive.
+ * exec.c (exec_ops): Likewise.
+ * m3-nat.c (m3_ops): Likewise.
+ * monitor.c (monitor_ops): Likewise.
+ * procfs.c (procfs_ops): Likewise.
+ * remote-array.c (array_ops): Likewise.
+ * remote-e7000.c (e7000_ops): Likewise.
+ * remote-es.c (es1800_ops, es1800_child_ops): Likewise.
+ * remote-mips.c (mips_ops): Likewise.
+ * remote-pa.c (remote_hppro_ops): Likewise.
+ * remote-sim.c (gdbsim_ops): Likewise.
+ * sparcl-tdep.c (sparclite_ops): Likewise.
+
+Tue Jul 11 11:15:55 1995 Kung Hsu <kung@rtl.cygnus.com>
+
+ * solib.c: Add _DYNAMIC__MGC base symbol for Mentor Graphics Inc.
+ * solib.c (match_main): New function for checking name of main.
+ * solib.c (solib_add): Not to add if solib match main.
+
+Fri Jul 7 14:41:56 1995 Kung Hsu <kung@rtl.cygnus.com>
+
+ * elfread.c (elf_symtab_read): Fix a bug ignoring compiler
+ generated internal labels ($LM...).
+
+Wed Jul 5 11:38:36 1995 Kung Hsu <kung@rtl.cygnus.com>
+
+ * defs.h: if __GO32__ or WIN32 the directory separating symbol should
+ be '\' not '/'.
+
+ * remote-nindy (nindy_wait): Use infinite timeout reading after
+ esacpe character.
+
+Tue Jul 4 10:30:22 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * infrun.c (wait_for_inferior): When switching from one thread to
+ another, save infrun's state for the old thread and load infrun's
+ previous state for the new thread.
+ * thread.c (struct thread_info): Add new fields for thread specific
+ state saved/restored in infrun.c.
+ (add_thread): Initialize new fields.
+ (load_infrun_state): New function.
+ (save_infrun_state): New function.
+ * thread.h (load_infrun_state): Provide external decl.
+ (save_infrun_state): Likewise.
+
+ * infrun.c (wait_for_inferior): When we hit a breakpoint for the
+ wrong thread, make sure to write the fixed PC value into the thread
+ that stopped. Restart all threads after single stepping over a
+ breakpoint for a different thread.
+ * breakpoint.c (set_momentary_breakpoint): Make momentary
+ breakpoints thread specific in a multi-threaded program.
+ * lynx-nat.c (child_resume): Add some comments. Correctly
+ choose between the single and multi-threaded step and continue
+ ptrace calls.
+
+Fri Jun 30 16:15:36 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/h8300/h8300.mt: Renamed from h8300hms.mt.
+ * config/h8500/h8500.mt: Renamed from h8500hms.mt.
+ * config/z8k/z8k.mt: Renamed from z8ksim.mt.
+ * configure, configure.in: Update to reflect renamings.
+
+ * remote-sim.c (sim): New command, passes commands to simulator.
+ (simulator_command): New function.
+ (gdbsim_ops): Clean up.
+ * remote-sim.h (sim_do_command): Declare.
+ * sh-tdep.c (memory_size): Remove command.
+
+ * Makefile.in (SIM, SIM_OBS): New variables.
+ (CLIBS, CDEPS): Add value of SIM.
+ (DEPFILES): Add value of SIM_OBS
+
+ * config/arm/arm.mt, config/h8300/h8300.mt, config/h8500/h8500.mt,
+ config/sh/sh.mt, config/sparc/sp64sim.mt, config/w65/w65.mt,
+ config/z8k/z8k.mt: Remove simulator files from TDEPFILES,
+ define in SIM_OBS and SIM.
+ config/sparc/sp64sim.mt (SIMFILES): Remove.
+
+ * remote-z8k.c: Remove, was superseded by remote-sim.c
+ * Makefile.in, mpw-make.in: Remove references to remote-z8k.c.
+
+Sun Jun 25 15:30:43 1995 Stan Shebs <shebs@cygnus.com>
+
+ * remote.c (remote_read_bytes, remote_write_bytes): Second arg
+ should be char *, not unsigned char *.
+ * dcache.h (memxferfunc): Ditto.
+ * monitor.c (monitor_write_memory, monitor_read_memory_single):
+ Ditto.
+ (monitor_make_srec): Let compiler figure size of hextab.
+
+Sat Jun 24 19:27:37 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * lynx-nat.c (child_wait): Don't restart new threads and loop
+ to the top of child_wait; let the machine independent code in
+ wait_for_inferior deal with new thread notifications.
+
+Fri Jun 23 11:51:58 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-nindy (nindy_load): Put in target specific load, it's
+ 20 times faster.
+
+Thu Jun 22 20:21:59 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * utils.c (error): Move local `args' outside conditional,
+ move local `string1' inside, declare function as void if
+ non-ANSI compiler, dereference error_hook when calling.
+
+ * mac-xdep.c (stdarg.h): Don't include.
+
+Thu Jun 22 13:12:33 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-nindy.c (nindy_wait): Change timeout in SERIAL_READCHAR.
+
+Wed Jun 21 13:24:41 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppam3-nat.c: Change HP800_THREAD_STATE to TRACE_FLAVOR and
+ HP800_THREAD_STATE_COUNT to TRACE_FLAVOR_SIZE.
+
+Wed Jun 21 05:57:56 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * monitor.c: Turn on caching.
+ (monitor_printf): If a ^C was sent, don't expect to see its
+ echo.
+ (monitor_open): Enable caching.
+ (monitor_resume, monitor_load): Flush cache.
+ (monitor_xfer_memory): Call cache routine.
+ (monitor_dump_regs): New.
+ (monitor_fetch_registers): If monitor_dump_regs available
+ then use it.
+ (monitor_load): Don't ref exec_bfd if it's NULL.
+ (monitor_load_srec): Use new monitor_make_srec calling convention.
+ (monitor_make_srec): Rewrite to cope with two, three and four byte
+ addresses.
+ * remote-hms.c (hms_cmds): Initialze end-of-command delim.
+ * dcache.h, dcache.h: Rewritten.
+ * remote.c: Reenable caching.
+ (getpkt): Reduce MAX_TRIES to 3.
+ (remote_xfer_memory): Use dcache_xfer_memory.
+ * defs.h (error_hook): New.
+ * top.c (error_hook): New definition.
+ * utils.c (error): Use error_hook if initialized.
+ * sparcl-tdep.c (HAVE_SOCKETS): Don't define if GO32 or WIN32. Use
+ HAVE_SOCKETS in place of #ifndef GO32.
+
+Tue Jun 20 22:17:44 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (PSW_*): Define processor status word masks.
+ (INSTRUCTION_NULLIFIED): Allow specific targets to override.
+ * config/pa/tm-hppao.h (INSTRUCTION_NULLIFIED): Define to work
+ around losing mach kernel behavior.
+
+Tue Jun 20 12:03:36 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c (monitor_wait): Don't use the watchdog timeout
+ if its value is 0.
+ * w89k-rom.c (w89k_open): Define to be static.
+
+
+Sat Jun 17 10:17:16 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (som_solib_add): Validate regexp argument.
+ Don't assume the first entry on dld's library list is the main
+ program. Don't load the same library more than once and don't
+ consider the main program a shared library.
+ (som_solib_sharedlibrary_command): New function
+ (_initialize_som_solib): Add "sharedlibrary" command.
+
+Thu Jun 15 14:54:58 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * array-rom.c: Remove, no longer used.
+
+ * remote-hms.c (hms_open): Make static.
+
+ * mpw-config.in (MacSerial.h): Copy from version in {CIncludes},
+ not {MPW}Interfaces:CIncludes.
+ * ser-mac.c (mac_baud_rate_table): Fix value for 38400 baud.
+
+Wed Jun 14 14:27:07 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.y: Remove lots of unsupported productions and names.
+ Add support for IF-expressions, ORIF, ANDIF, NUM, and ADDR.
+
+Tue Jun 13 21:40:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * parser-defs.h (enum precedence): Added PREC_BUILTIN_FUNCTION.
+ * expression.h (enum exp_opcode): Added UNOP_LOWER, UNOP_UPPER,
+ UNUP_LENGTH.
+ * expprint.c (dump_expression): Handle the new exp_opcodes.
+ (print_subexp): Handle PREC_BUILTIN_FUNCTION.
+ (print_simple_m2_func): Removed.
+ (print_subexp): Remove support for Modula2 builtin functions.
+ * m2-lang.c (m2_op_print_tab): Add support for builtin functions.
+ * ch-exp.y: Parse LOWER, UPPER, and LENGTH builtins.
+ (write_lower_upper_value): Convenience function for LOWER and UPPER.
+ (upper_lower_argument, length_argument): Removed non-terminals.
+ * ch-lang.c (chill_op_print_tab): Entries for UPPER, LOWER, LENGTH.
+ (type_lower_upper): New function. Calculate LOWER/UPPER of type.
+ (value_chill_length): New function. Calcalate LENGTH of ARRAY/STRING.
+ (evaluate_subexp_chill): Handle UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH.
+
+Mon Jun 12 12:48:13 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ Windows support bits from Steve Chamberlain <sac@slash.cygnus.com>.
+ * defs.h: Don't declare strchr and friends if WIN32.
+ (DIRNAME_SEPARATOR): Move here from source.c.
+ (SLASH_P, SLASH_CHAR, SLASH_STRING, ROOTED_P): New macros,
+ symbolic definitions for filename bits.
+ * top.c (cd_command): Use these.
+ * source.c (mod_path, openp): Ditto.
+ * terminal.h: Disable termio/sgtty definitions if WIN32.
+ * findvar.c (registers_changed): Call registers_changed_hook
+ if it is defined.
+
+Mon Jun 12 12:22:05 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (distclean, realclean): Remove config.cache and
+ config.log.
+
+Mon Jun 12 00:21:59 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c: Include gdb-stabs.h.
+ (som_solib_section_offsets): Use SECT_OFF_XXX rather than 0, 1,
+ etc. Initialize offsets for RODATA & BSS too.
+
+Sat Jun 10 17:59:11 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppa-tdep.c (frame_chain): Try to compensate for incomplete
+ register information in core files when backtracing.
+
+Fri Jun 9 14:51:38 1995 Stu Grossman (grossman@cygnus.com)
+
+ * remote-nrom.c: Remove everything but download code. More
+ cleanups.
+
+Thu Jun 8 15:06:00 1995 Stu Grossman (grossman@cygnus.com)
+
+ * defs.h maint.c monitor.c remote-mips.c remote.c: Add support
+ for `watchdog' variable. This allows the user to put an upper
+ limit on the amount of time that GDB will wait for the target to
+ return from a step or continue operation. This will primarily be
+ used for the testsuite, where it is difficult to come up with a
+ reasonable timeout for things like function calls, which can take
+ as long as three minutes under some circumstances. If the
+ watchdog timer expires, GDB will generate an error that looks like
+ `Watchdog has expired.', and will detach from the target.
+
+ * remote-mips.c (mips_open): Setup initial frame from target.
+ Print it out so that user is told where the program is stopped
+ when they attach.
+
+ * remote-nrom.c: Loads of cleanups. Use serial code to open
+ network connections. Use expect() to wait for response to
+ download command.
+
+ * ser-tcp.c (tcp_open): Retry connection if we get ECONNREFUSED.
+
+ * serial.c serial.h (serial_open serial_fdopen serial_close):
+ Allow users to open the same device multiple times. They all get
+ to share the same serial_t. This is about the only way to have
+ multiple active targets use the same device (for download and
+ debug).
+
+ * sparcl-tdep.c: Keep #include <unistd.h> away from GO32.
+
+ * target.c: Add `targetdebug' variable. If this is non-zero,
+ then a special target is put at the top of the target stack which
+ will cause all calls through the target vector to have their args
+ and results printed out.
+
+Wed Jun 7 17:40:37 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.y: Handle <primitive_value> "->" <modename>.
+
+Wed Jun 7 17:46:33 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * mem-break.c (LITTLE_BREAKPOINT): If BREAKPOINT and
+ {LITTLE,BIG}_BREAKPOINT are all defined, don't redefine.
+ (BIG_BREAKPOINT): Ditto.
+
+ * config/rs6000/tm-rs6000.h (BREAKPOINT): Define as either
+ BIG_BREAKPOINT or LITTLE_BREAKPOINT depending on the target byte
+ order.
+
+Wed Jun 7 12:41:42 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (som_solib_section_offsets): Handle relative pathnames.
+
+ * hppa-tdep.c (frame_saved_pc): Handle backtracing through signal
+ handler in dynamically linked executables.
+
+Tue Jun 6 10:44:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ From Andrew Cagney <cagney@highland.com.au>
+ * rs6000-tdep.c (single_step): Handle both little and big endian
+ breakpoints.
+ (gdb_print_insn_powerpc): Deal with disassembling both little and
+ big endian PowerPC systems.
+ (_initialize_rs6000_tdep): Use gdb_print_insn_powerpc to handle
+ disassembly, rather that assuming big endian order.
+
+ * config/rs6000/tm-rs6000.h (BREAKPOINT): Delete.
+ (BIG_BREAKPOINT): Define, big endian breakpoint instruction.
+ (LITTLE_BREAKPOINT): Define, little endian breakpoint instruction.
+
+Sat Jun 3 01:54:56 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * README: Add note about Unixware 2.x.
+
+ * dbxread.c (process_one_symbol): Check for exact symbol name
+ match when fixing up N_GSYM and N_STSYM symbols from Sun acc.
+
+ * valprint.c (value_print_array_elements): Use
+ fprintf_filtered to put out `<repeats %u times>',
+ from schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
+
+ * value.h (struct value): Change `repetitions' field from
+ `short' to `int' type.
+
+Fri Jun 2 11:17:23 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * arc-tdep.c (arc_bfd_mach_type): New static global.
+ (codestream_fill): Handle byte order differences.
+ (setup_prologue_scan): Don't read stdarg function's "sub sp,sp,N".
+ (arc_get_frame_setup): Read it here.
+ (arc_frame_saved_pc): And here.
+ (arc_print_insn): New function.
+ (arc_set_cpu_type): Set arc_bfd_mach_type. Don't set tm_print_insn.
+ (_initialize_arc_tdep): Set tm_print_insn to arc_print_insn.
+
+Wed May 31 12:04:01 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * nlm/{configure.in, Makefile.in}: Converted to use autoconf.
+ * nlm/configure: New file, generated with autoconf 2.3.
+
+ * nlm/configure.in: Use sed instead of awk to get the value of
+ cpufile. Awk is not a utility required by the GNU coding
+ standards. This change also fixes the rigid whitespace
+ requirements that were required for awk.
+
+ * sparclite/aload.c: Use a file descriptor instead of a stdio
+ stream for i/o with target board.
+ Use #error if HAVE_TERMIOS is not defined.
+
+ * sparclite/{Makefile.in, configure.in}: Converted to use
+ autoconf.
+ * sparclite/configure: New file, generated with autoconf 2.3.
+
+Sun May 28 23:10:07 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * defs.h: Include either varargs.h or stdarg.h (for va_list).
+ Fix stupid thinko in last change ("..." -> "va_list").
+
+ * defs.h (vprintf_filtered declaration): Add PARAMS prototype;
+ gcc-2.5 chokes on format attributes for unprototyped functions.
+ (vfprintf_filtered declaration): Likewise.
+ (vprintf_unfiltered declaration): Likewise.
+ (vfprintf_unfiltered). Likewise.
+
+Sat May 27 23:54:17 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in: Use sed instead of awk to get the values of
+ hostfile, targetfile and nativefile. Awk is not a utility
+ required by the GNU coding standards. This change also
+ fixes the rigid whitespace requirements that were required
+ for awk.
+ * configure: regenerated.
+
+Sat May 27 16:24:04 1995 Angela Marie Thomas <angela@cirdan.cygnus.com>
+
+ * sparclite/{Makefile,configure}.in: Add hooks for building with
+ -lsocket & -lnsl for solaris2. Don't build aload/eload for DOS.
+
+Thu May 25 12:46:37 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdbserver/remote-utils.c (prepare_resume_reply): Add FIXME
+ comment regarding signal numbering.
+
+Wed May 24 15:49:47 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * arm-tdep.c (_initialize_arm_tdep): Use print_insn_little_arm
+ now.
+
+ * arm-tdep.c (convert_from_extended, convert_to_extended):
+ New.
+ * coffread.c (enter_linenos): Return if linetab 0.
+ * config/arm/arm.mt (TDEPFILES): Add simulator support.
+ * config/arm/tm-arm.h (FRAME_FIND_SAVED_REGS): Fix prototypes.
+
+Mon May 22 19:37:21 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * config/idt.mt: replace monitor and array-rom with the new
+ remote-array.
+
+Mon May 22 15:38:25 1995 Stu Grossman (grossman@cygnus.com)
+
+ * remote-nindy.c: Install Kung patch for PR 6820. I have no idea
+ what this does...
+
+ * breakpoint.c: Move defaults of watchpoint related macros into
+ target.h.
+ * target.h: Macros from breakpoint.c. Conditionalize based on
+ TARGET_HAS_HARDWARE_WATCHPOINTS.
+ * i386v-nat.c procfs.c: Use TARGET_HAS_HARDWARE_WATCHPOINTS
+ instead of TARGET_CAN_USE_HARDWARE_WATCHPOINT to enable watchpoint
+ code.
+ * config/i386/nm-linux.h, config/mips/nm-irix4.h,
+ config/pa/nm-hppab.h, config/sparc/tm-sparclite.h: #define
+ TARGET_HAS_HARDWARE_WATCHPOINTS to enable watchpoint code.
+
+Mon May 22 06:47:30 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c, target.h: Move defaults of watchpoint related
+ macros back to breakpoint.c. Required to get GDB compiling
+ on Solaris again.
+
+Fri May 19 14:49:37 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * defs.h (ATTR_FORMAT): New macro, expands to gcc's format
+ attribute when compiled by gcc.
+ * defs.h, language.h, monitor.h: Changed many function
+ declarations to use ATTR_FORMAT.
+
+ * breakpoint.c (delete_command); source.c (directory_command);
+ top.c (define_command): Changed call to query() that had too
+ many arguments.
+ * printcmd.c (address_info): Changed call to printf_filtered()
+ that had too many arguments.
+
+Fri May 19 09:52:07 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (wait_for_inferior): Move assignments to stop_signal
+ and stop_pc, and STOPPED_BY_WATCHPOINT code, back where they
+ were--after the switch statement on w.kind. You can't read the
+ registers of an inferior which has exited. Use a goto in the
+ STOPPED_BY_WATCHPOINT code.
+ * infrun.c (wait_for_inferior): Reinstate
+ HAVE_STEPPABLE_WATCHPOINT and HAVE_CONTINUABLE_WATCHPOINT code.
+
+Fri May 19 06:15:40 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * utils.c, complaints.c, language.c, monitor.c, remote-array.c,
+ remote-mips.c, remote-os9k.c, remote-st.c: Conditionalize use of
+ stdarg rather than varargs on ANSI_PROTOTYPES not __STDC__; it
+ must match the definition of PARAMS.
+
+Thu May 18 15:58:46 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * utils.c (fprintf_filtered, fprintf_unfiltered, fprintfi_filtered,
+ printf_filtered, printf_unfiltered, printfi_filtered, query, warning,
+ error, fatal, fatal_dump_core): Use stdarg.h macros when compiling
+ with an ANSI compiler.
+ * complaints.c (complain): Likewise.
+ * language.c (type_error, range_error): Likewise.
+ * monitor.c (monitor_printf, monitor_printf_noecho): Likewise.
+ * remote-array.c (printf_monitor, debuglogs): Likewise.
+ * remote-mips.c (mips_error): Likewise.
+ * remote-os9k.c (printf_monitor): Likewise.
+ * remote-st.c (printf_stdebug): Likewise.
+
+ * defs.h, complaints.h, language.h, monitor.h: Add prototypes to
+ match above changes.
+
+ * printcmd.c: Remove uneeded #include <varargs.h>.
+ * remote-e7000.c: Likewise.
+
+ * f-typeprint.c (f_type_print_base): Fix typo found by above
+ changes.
+
+Wed May 17 11:21:32 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * Makefile.in (xcoffread.o): Depend on partial-stab.h.
+
+ * xcoffsolib.c (sharedlibrary_command): New command.
+ * xcoffsolib.c (solib_info): Call xcoff_relocate_symtab.
+ * xcoffsolib.c: Miscellaneous cleanups.
+
+ * partial-stab.h: Ignore symbol descriptor '-' (for local
+ variables with negative type numbers) without complaint.
+
+ * rs6000-nat.c (vmap_ldinfo): Use bfd_stat rather than our own
+ local emulation thereof. Remove unused variable ostart.
+
+Wed May 17 15:55:53 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (config.status): changed target so that
+ config.status --recheck is executed if configure script changes.
+
+ * monitor.c (monitor_printf): Changed format specification in
+ error message to work with pre-ansi compilers.
+ (monitor_load_srec): reduced length of s-records from 128 to 32
+ bytes so download is more reliable with the rom68k monitor.
+
+ * rom68k-rom.c: Added trailing space to prompt string.
+
+ * config/i386/xm-i386sco.h (HAVE_STRSTR): Removed.
+ * config/i386/xm-go32.h, mswin/xm.h (SYS_SIGLIST_MISSING):
+ Removed.
+ * defs.h, config/{xm-lynx.h, xm-nbsd.h},
+ config/i386/{xm-i386bsd.h, xm-linux.h},
+ config/m68k/xm-hp300bsd.h, config/mips/xm-irix4.h,
+ config/ns32k/xm-ns32km3.h, doc/gdbint.texinfo
+ (PSIGNAL_IN_SIGNAL_H): Removed.
+
+Tue May 16 13:16:06 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * Makefile.in (Makefile): Added config.status to dependency list.
+
+ * configure.in: Added INIT-CMDS argument to AC_OUTPUT which sets
+ gdb_host_cpu, gdb_target_cpu and nativefile.
+ * configure: regenerated.
+
+Mon May 15 23:50:51 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol): Do not relocate stBlock/scText
+ symbols, their value is the displacement from the procedure address.
+ * top.c (init_main): Add missing newlines to help strings for
+ `if' and `while' commands, fix help string for `show commands'.
+
+Mon May 15 18:37:56 1995 Stu Grossman (grossman@cygnus.com)
+
+ * breakpoint.c: Move defaults of watchpoint related macros into
+ target.h. Use BP_TEMPFLAG and BP_HARDWAREFLAG instead of
+ constants.
+ * infrun.c (wait_for_inferior): Enhance comment near
+ STOPPED_BY_WATCHPOINT.
+ * target.h: Macros from breakpoint.c.
+
+Mon May 15 17:11:38 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/i386/{i386sol2.mh, i386v4.mh, ncr3000.mh},
+ config/m68k/m68kv4.mh, config/mips/{irix4.mh, irix5.mh,
+ mipsv4.mh}, config/sparc/sun4so2.mh (INSTALL): Removed, figured
+ out by autoconf.
+ * config/apollo68v.mh (RANLIB): Removed, figured out by autoconf.
+
+ * Makefile.in, configure.in: Converted to use autoconf
+ * aclocal.m4: New file, local autoconf macro definitions.
+ * configure: New file, generated with autoconf 2.3.
+
+Mon May 15 14:46:41 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (remote_kill): Add prototype.
+ * cpu32bug-rom.c (cpu32bug_open): Properly define as static.
+ * config/h8300/h8300hms.mt (TDEPFILES): Add monitor.o.
+
+Mon May 15 12:12:34 1995 Stu Grossman (grossman@cygnus.com)
+
+ * sparclite/salib.c (win_ovf win_unf): Make window size constant
+ into a variable (__WINSIZE) so that it can be controlled via the
+ .h file.
+ * sparclite/sparclite.h: Add SL933 #ifdef to set __WINSIZE to 6
+ for the 933 board.
+
+ * infrun.c: Add #ifdef HP_OS_BUG to all references to
+ trap_expected_after_continue.
+ * (wait_for_inferior): Fix for remote watchpoints. Don't try to
+ insert breakpoints while target is running (this only works on
+ *some* native targets). This may also speed up native watchpoints
+ considerably.
+
+Sat May 13 13:55:04 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc),
+ mdebugread.c (struct symloc), hpread.c (struct symloc),
+ xcoffread.c (struct symloc): Fix inaccurate comment introduced
+ 20 Apr 1995.
+
+Sat May 13 13:34:18 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * rs6000-tdep.c (find_toc_address): Revise comment.
+ * symfile.c, symfile.h (init_psymbol_list): New function;
+ consolidate duplicated copies from os9kread.c, dbxread.c
+ and dwarfread.c.
+ * defs.h: Declare info_verbose.
+ * xcoffread.c: Extensive changes to support psymtabs.
+
+Fri May 12 13:48:41 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * cpu32bug-rom.c remote-est.c rom68k-rom.c: Update line_term element.
+
+Fri May 12 06:39:30 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * partial-stab.h: Expand comments.
+
+Thu May 11 19:01:37 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * Support debugging using native MACH primitives on hppa*-*-osf*.
+ * configure.in: hppa*-*-osf* != hppa*-*-bsd* anymore.
+ * config/pa/hppaosf.mh: New file.
+ * config/pa/nm-hppao.h: Likewise.
+ * hppam3-nat.c: Likewise.
+ * config/pa/tm-hppao.h (PSW_SS): Define for single-stepping.
+ (MACHINE_CPROC_*_OFFSET): Define.
+ (TRACE_*): Define.
+ (START_INFERIOR_TRAPS_EXPECTED): Delete definition.
+
+Wed May 10 18:59:26 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * hppa-tdep.c (read_unwind_info): Cosmetic cleanup.
+ * (unwind_command): Clean it up and make it print things out
+ nicer.
+ * monitor.c: Add ^C handling capability (mostly ripped off from
+ remote.c).
+ * (monitor_printf): Make it check the command echo.
+ * (monitor_printf_noecho): Similar to above, but doesn't check
+ for echo.
+ * (monitor_stop): No longer waits for prompt. That is the job of
+ the caller. This makes things work much better for monitor_wait,
+ which waits for the prompt itself.
+ * (monitor_open): Deal with new monitor_stop semantics. Also,
+ flush input after sending init strings to get rid of junk that may
+ be output. Also, don't always send \r to remote. Use
+ monitor_ops->line_term cuz proper character isn't always \r.
+ * (monitor_fetch_register): Switch to completely different
+ algorithm to deal with lame-ass monitors which put spaces in the
+ middle of numbers, and prompt with a space!!!!!
+ * (monitor_read_memory_single): New routine to be used with
+ monitors that can only return one byte/short/long at a time. This
+ is selected via MO_GETMEM_READ_SINGLE.
+ * (monitor_load_srec): Use monitor_printf_noecho for sending S
+ records. Most targets don't echo them.
+ * (monitor.h): Get rid of cmd_delim. Add line_delim.
+ * op50n-rom.c (op50n_cmds): Fill it up. Make it work.
+ * w89k-rom.c: Change all eols from \r to \n. Change load_resp to
+ ^Q to prevent error message.
+ * config/pa/tm-hppa.h (CALL_DUMMY (for hppro)): Add special
+ instruction sequence at end to make restore_pc_queue happy.
+
+Wed May 10 15:59:00 1995 Torbjorn Granlund <tege@adder.cygnus.com>
+
+ * remote-est.c (est_open): Make static to match prototype.
+
+Tue May 9 16:58:50 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in: Add little endian PowerPC support.
+ * config/powerpc/ppcle-eabi.mt: New file for little endian PowerPC
+ support.
+ * config/powerpc/tm-ppcle-eabi.h: ditto.
+
+Mon May 8 12:11:38 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * nlm/configure.in (gdb_host, gdb_host_cpu, gdb_target): Removed.
+ These variables not used.
+
+ * config/m68k/monitor.mt (TDEPFILES): Added cpu32bug-rom.o.
+
+Wed May 3 17:54:47 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c (monitor_command): Don't use PROMPT until monitor
+ target is known to be open.
+ (monitor_make_srec): Don't define size of hextab.
+
+Tue May 2 18:32:24 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (--enable-netrom): New configuration option.
+ * Makefile.in (REMOTE_OBS): Rename from REMOTE_O, append
+ value of NETROM_OBS.
+ (NETROM_OBS): New variable.
+ * remote-nrom.c: New file, NetROM target support.
+ * config/a29k/a29k-udi.mt, config/i960/vxworks960.mt: Use
+ REMOTE_OBS instead of REMOTE_O.
+ * config/arc/arc.mt: Ditto.
+
+Fri Apr 28 23:30:00 1995 Stu Grossman (grossman@cygnus.com)
+
+ * array-rom.c (_initialize_array array_open): Move baud_rate
+ initialization from _initxxx to array_open to fix bug with
+ overriding -b command line option.
+
+Thu Apr 27 20:29:34 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (RUNTEST): Fix reference of `srcdir'.
+
+Wed Apr 26 19:01:08 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * remote-hms.c: Rewrite to use new monitor conventions.
+
+Tue Apr 25 11:27:14 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dbxread.c: Add comment explaining lowest_text_address.
+ Add comment regarding stringtab_global and psymtabs.
+
+Sat Apr 22 01:26:29 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/pa/tm-hppa.h (EXTRACT_STRUCT_VALUE_ADDRESS): Fix.
+
+ * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Rewrite to correctly
+ handle "short", "int" and small structures returned in registers.
+
+Fri Apr 21 12:57:53 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * minsyms.c: add new function lookup_minimal_symbol_text, to look
+ for text symbol only.
+ * breakpoint.c (create_longjmp_breakpoint): call
+ lookup_minimal_symbol_text instead of lookup_minimal_symbol.
+ * symtab.h: add lookup_minimal_symbol_text prototype.
+
+Fri Apr 21 12:03:44 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * sh-tdep.c (sh-opc.h): Don't include.
+ (gdbcore.h): Include.
+ (frame_find_saved_regs): Remove unused local.
+
+Thu Apr 20 10:12:21 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc),
+ mdebugread.c (struct symloc), hpread.c (struct symloc): Clean
+ up comments.
+
+Wed Apr 19 16:58:11 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * hppa-tdep.c (deposit_17): New routine to deposit 17 bit
+ constants into PA instructions.
+ * Put #ifdefs around all signal handling code. Not generally
+ needed for embedded boards.
+ * (hppa_fix_call_dummy): Parameterize offsets into call dummy to
+ allow different dummys to be used by this code. Use
+ INSTRUCTION_SIZE instead of REGISTER_SIZE for things.
+ Conditionalize setup of _sr4export fixup. Improve comments.
+ * config/pa/tm-hppa.h: Define INSTRUCTION_SIZE. Use a different
+ call dummy if PA_LEVEL_0 is defined. Better comments for call
+ dummys. Define offsets for LDIL/LDO instructions which load
+ function addresses.
+ * config/pa/tm-pro.h: Get rid of signal handling stuff. Define
+ PA_LEVEL_0 to disable mucking with space regs and such.
+
+Mon Apr 17 15:37:08 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * cpu32bug-rom.c monitor.h op50-rom.c remote-est.c rom68k-rom.c
+ w89k-rom.c: Remove loadtypes, loadprotos and baudrates.
+ * op50-rom.c: Fix copyrights and add load routine to op50n_cmds.
+ * rom68k-rom.c (_initialize_rom68k): Don't set baud rate.
+ * w89k-rom.c: Fix copyrights.
+
+Sun Apr 16 14:00:55 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * monitor.c: Move all xmodem stuff into xmodem.[ch]. Remove
+ unnecessary remoteloadprotocol and remoteloadtype support.
+ * (expect expect_prompt): Change names to monitor_expect and
+ monitor_expect_prompt. Make them global.
+ * (printf_monitor): Change name to monitor_printf. Make global.
+ * (monitor_read_memory): Flush command echo to avoid parsing
+ ambiguity with CPU32Bug monitor.
+ * (monitor_load): Remove remoteloadprotocol and remoteloadtype
+ support. Call target_ops->load_routine, default to
+ monitor_load_srec.
+ * (monitor_load_srec): Remove everything but S-record support.
+ * monitor.h (monitor_ops): Add load_routine to provide monitor
+ specific download capability.
+ * remote-est.c: Clean up copyrights and comments.
+ * w89k-rom.c: Use new xmodem support.
+ * xmodem.c xmodem.h: New files to support xmodem downloads.
+ * rom68k-rom.c remote-est.c: Fix copyrights, add load_routine
+ entry to monitor_ops.
+ * cpu32bug-rom.c: New file to support Moto BCC debuggers.
+ * config/m68k/est.mt (TDEPFILES): Add cpu32bug.o.
+ * config/pa/hppapro.mt (TDEPFILES): Add xmodem.o.
+
+Sat Apr 15 18:00:15 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * rem-multi.shar: Removed; superceded by gdbserver.
+
+Fri Apr 14 12:10:24 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * xcoffread.c (xcoff_sym_fns): Revise comment about merging this
+ with coffread.c.
+
+ * breakpoint.c (fixup_breakpoints): Removed.
+ * rs6000-nat.c (vmap_symtab): Don't call fixup_breakpoints.
+ (vmap_ldinfo, xcoff_relocate_core): Call breakpoint_re_set.
+
+ * coffread.c (coff_symfile_offsets): Allocate SECT_OFF_MAX
+ sections, not just SECT_OFF_MAX-1.
+
+ * rs6000-nat.c (vmap_symtab), xcoffread.c: Re-do section offsets
+ to be indexed by SECT_OFF_* instead of xcoff section numbers.
+ * objfiles.c, remote.c: Remove comments regarding SECT_OFF_*.
+ * symtab.h: Revise comment about block_line_section.
+ * rs6000-nat.c (vmap_symtab): Don't relocate objfile->sections.
+
+Sat Apr 15 14:15:14 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.in (init.c): Don't try to do symbolic {o} in sed
+ command, not allowed by some version of MPW Make.
+ * ser-mac.c (mac-setbaudrate): Make it actually set baud rates.
+
+Sat Apr 15 14:05:09 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * alpha-tdep.c (alpha_push_arguments): Fix typo (TYPE_VALUE ->
+ VALUE_TYPE). Do the cast for TYPE_CODE_BOOL, TYPE_CODE_CHAR,
+ TYPE_CODE_ENUM, and TYPE_CODE_RANGE as well as TYPE_CODE_INT.
+
+Sat Apr 15 14:04:32 1995 Per Bothner <bothner@cygnus.com>
+
+ * alpha-tdep.c (alpha_push_arguments): Only cast to long for
+ TYPE_CODE_INT.
+
+
+Thu Apr 13 16:17:04 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * remote-array.c: New file for Array Tech LSI33k based controller
+ board.
+
+Thu Apr 13 12:23:31 1995 Kung Hsu <kung@rtl.cygnus.com>
+
+ * a29k-tdep.c (get_longjmp_target): Replace SWAP_TARGET_AND_HOST with
+ extract_address.
+ * remote-vxsparc.c: New file, preliminary check in, this configuration
+ not supported yet.
+ * remote-vxmips.c: ditto.
+
+Thu Apr 13 12:10:14 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * rs6000-tdep.c (xcoff_add_toc_to_loadinfo): Don't use a prototype
+ to declare the function.
+
+Wed Apr 12 16:40:20 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.h (init_monitor_ops): Declare.
+ * rom68k-rom.c: Clarify some comments.
+ (rom68k_open): Define as static, to match decl.
+
+Wed Apr 12 16:36:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.gdb: New file.
+ * .gdbinit: Move list-objfiles to gdb.gdb.
+
+ * values.c (set_internalvar): Set modifiable flag of newval.
+
+Wed Apr 12 14:34:31 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * xcoffread.c: Call complain() rather than error() or printing a
+ warning.
+
+Wed Apr 12 08:15:27 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * arc-tdep.c: #include "gdbcmd.h".
+ (codestream_seek): Pass CORE_ADDR.
+ (arc_cpu_type, tmp_arc_cpu_type, arc_cpu_type_table): New globals.
+ (debug_pipeline_p): Likewise.
+ (X_...): Instruction field access macros.
+ (BUILD_INSN): Define.
+ (codestream_tell): Allow for stream elements > 1 byte.
+ (codestream_fill): Likewise.
+ (setup_prologue_scan): New function.
+ (arc_get_frame_setup): Call it. Update to current spec
+ regarding prologues. Use BUILD_INSN.
+ (skip_prologue): New argument `frameless_p'. Use BUILD_INSN.
+ (arc_frame_saved_pc): New function.
+ (frame_find_saved_regs): Use BUILD_INSN.
+ (get_insn_type, single_step): New functions.
+ (one_stepped): New global.
+ (arc_set_cpu_type_command, arc_show_cpu_type_command): New functions.
+ (arc_set_cpu_type): New function.
+ (_initialize_arc_tdep): Define new `set' commands `cpu',
+ `displaypipeline', and `debugpipeline'.
+ * arc/tm-arc.h (TARGET_BYTE_ORDER): Delete.
+ (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ (DEFAULT_ARC_CPU_TYPE): Define.
+ (SKIP_PROLOGUE_FRAMELESS_P): Define.
+ (BREAKPOINT): Delete.
+ (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Define.
+ (DECR_PC_AFTER_BREAK): Change to 8.
+ (NO_SINGLE_STEP): Define.
+ (ARC_PC_TO_REAL_ADDRESS): Define.
+ (SAVED_PC_AFTER_CALL): Use it.
+ (NUM_REGS, REGISTER_BYTES): Fix.
+ (FRAME_SAVED_PC): Call arc_frame_saved_pc.
+ (FRAME_LOCALS_ADDRESS): Fix.
+
+Tue Apr 11 16:42:37 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * top.c, utils.c, defs.h: Remove error_hook. It is currently
+ unused and would need to hook into error_begin()/return_to_top_level(),
+ instead of error(), if it were to be used.
+
+Tue Apr 11 13:46:25 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * utils.c, defs.h (warning_begin): Renamed from warning_setup, for
+ consistency with error_begin. Also print warning_pre_print.
+ Document it better.
+ * utils.c (warning): Use it.
+ * utils.c (error_begin): Doc fix.
+ * rs6000-nat.c (vmap_ldinfo): If we don't find ldinfo for the
+ symfile_objfile, nuke it.
+
+Tue Apr 11 09:35:20 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * printcmd.c (print_address_numeric): Pass use_local to
+ print_longest, rather than always passing 1.
+
+ * nlm/Makefile.in: Remove comments discussing munch.
+
+
+Mon Apr 10 18:31:57 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ Merge in support for Mac MPW as a host.
+ (Old change descriptions retained for informational value.)
+
+ * mpw-config.in (i386-unknown-go32): Change from aout.
+ (sh-hitachi-hms): New target.
+ * mpw-make.in (BISON): Use byacc instead of bison.
+ (VERSION): Bump to 4.14.1.
+ (*-pinsn.*): Remove mentions everywhere.
+ (all): Don't build MacGDB.
+ (gdb, SiowGDB): Depend on Version.r.
+ (Version.r): Generate from version info.
+ * main.c (main): Pass program name to START_PROGRESS, END_PROGRESS.
+ (main) [MPW]: Remove debugging hook.
+ * mac-xdep.c (debug_openp): New flag.
+ (mac_init): Set flag if env variable defined.
+ * ser-mac.c (mac_open): Clarify error message.
+ (mac_readchar): Call PROGRESS while looping.
+ (mac_write): Call sleep instead of sec_sleep.
+ (sec_sleep): Remove.
+ * source.c (openp) [MPW]: Only print debugging info if debugging.
+ * utils.c (query) [MPW]: Clarify that behavior is a bug.
+
+ * mpw-make.in (init.c): Use open-brace instead of mpw-open-brace.
+
+ * main.c, source.c: Remove hacks that replace long strings
+ with shorter ones, now solved portably.
+
+ * config/m68k/xm-mpw.h (spin.h): Include.
+ (ALMOST_STDC): Only define if MPW_C.
+ * config/m68k/tm-mac.h: New file, Mac target definitions.
+
+ * mpw-config.in (m68k-apple-macos, ppc-apple-macos,
+ i386-unknown-aout): New targets.
+ (mk.tmp): Add *DEPFILES definitions.
+ * mpw-make.in: Remove gC rules, clean up definitions for other
+ include files, bump version, fix bogus \ that should be \Option-d.
+ (init.c): Build correctly.
+
+ * mpw-make.in (HFILES_NO_SRCDIR): Add somsolib.h
+ (ALLDEPFILES): Add somsolib.c.
+ (somsolib.o): Add some dependencies.
+
+ * mpw-config.in: Use nm-empty.h if host is not target.
+ (xdepfiles): Add mac-xdep.c.o.
+ (xm_file): Remove.
+ * mpw-make.in: Add Fortran files.
+ (XDEPFILES): Remove.
+
+ * mpw-config.in (MacSerial.h): Duplicate from standard Serial.h.
+ * ser-mac.c (MacSerial.h): Include instead of Serial.h.
+
+ * mpw-make.in: Use {s} instead of {srcdir} everywhere.
+ (bindir, libdir): Remove extra colon.
+ (source.c): Compile with C instead of gC.
+ (c-exp.tab.c, ch-exp.tab.c, m2-exp.tab.c): Add {o}.
+ (install-only): Don't install MacGDB.
+ * source.c (openp) [MPW]: Add a debugging display.
+ (open_source_file) [MPW]: Use MPW basename finders.
+ [MPW_C]: Briefer versions of help for line and list commands.
+
+ * mpw-make.in: Change references from paread.c to somread.c
+
+ * mpw-make.in (VERSION): Update to 4.12.3.
+ (SiowGDB): New target, GDB using SIOW library.
+ (init-new.c): New target, attempt to generate init.c from sources.
+ (main.c.o, top.c.o): Put each in its own segment.
+ * main.c (main) [MPW]: Always call mac_init.
+ * utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
+ an extra newline otherwise.
+ * mac-xdep.c: More comments in various places, remove junk.
+ (mac_init): Add tests for MPW and SIOW.
+ (use_wne, has_color_qd): Renamed.
+ (use_color_qd): New variable.
+ (grow_window): Only do console resizing to console window,
+ call resize_console_window.
+ (zoom_window): Call resize_console_window.
+ (resize_console_window, scroll_text): New functions.
+ (adjust_console_sizes): Always align viewrect to even multiples of
+ text lines.
+ (adjust_console_text): Always scroll by whole lines.
+ (hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
+ recalculation of scroll positions if a newline was output.
+ (hacked_fflush): Similarly, for flushing.
+ (hacked_fgetc): New function, aborts if called in MacGDB.
+ * ser-mac.c (mac_readchar): Rename starttime to start_time,
+ remove debugging printf.
+ (mac_write): Sleep on first 4 writes.
+ (sec_sleep): New function, works like standard sleep.
+ * macgdb.r: Adjust positioning and contents of About box.
+ Set minimum size to 2000K, preferred size to 5000K.
+ * config/m68k/xm-mpw.h (fgetc): Define as a macro.
+
+ * mpw-make.in (.c.o, .gc.o): Prefix segment names with gdb_.
+ (top.c.o, annotate.c.o): Add build rules.
+ * macgdb.r (SysTypes.r): Include.
+ ('vers'): New resource, version info.
+ (mFile, mEdit, mDebug): Enable all menu items.
+ (mDebug): Add key equivalents for continue, step, next.
+ (wConsole): Add zoom and close boxes to window.
+ * mac-xdep.c (new_console_window): New function, code taken from
+ mac_init.
+ (mac_command_loop): Use GetCaretTime for wait interval, call
+ do_idle on null events.
+ (do_idle): New function.
+ (zoom_window): Implement zooming.
+ (v_scroll_proc): New function, handles vertical scrolling.
+ (activate_window): Do activation of console window.
+ (do_menu_command): Implement items of file, edit, and debug menus.
+ (do_keyboard_command): Fix command extraction.
+ (adjust_console_sizes, adjust_console_text): New functions.
+ (hacked_fprintf, hacked_vfprintf, hacked_fputs, hacked_fputc,
+ hacked_putc): Don't call draw_console.
+ * ser-mac.c (mac_open): Add an error message for invalid ports.
+ (first_mac_write): New global.
+ (mac_write): Use first_mac_write to sleep on first several writes.
+
+ * mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
+ (READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
+ (TSOBS): Don't compile inflow.c.
+ (all, install): Add MacGDB.
+ * main.c (main): Do Mac-specific init and command loop if a
+ standalone app, skip full option help message if compiling
+ with MPW C.
+ (gdb_readline): If MPW, add a newline after the (gdb) prompt.
+ * utils.c (_initialize_utils): If MPW, don't try to use termcap to
+ compute the window size.
+ * config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
+ fflush): Define as macros that expand into hacked_... versions.
+ (StandAlone, mac_app): Declare.
+ * macgdb.r (SIZE): Set the default partition to 4000K.
+ * mac-xdep.c (readline.h, history.h): Include.
+ (terminal.h): Don't include.
+ (mac_app): Define.
+ (gdb_has_a_terminal): Define Mac-specific version.
+ (do_keyboard_command): Simplify search for command string.
+ (readline): Define as gdb_readline.
+ Add other history/readline stubs to make main gdb link.
+ (hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
+ hacked_fputc, hacked_fflush): New functions, intercept output to
+ stdout and stderr, send to console window.
+
+ * mpw-make.in (MacGDB): New target, standalone Mac-hosted gdb.
+ (XDEPFILES): Define.
+ (main.c.o): Compile with gC instead of C.
+ * mac-defs.h: New file, menu etc definitions shared between
+ C and Rez files.
+ * macgdb.r: New file, Rez (resource compiler) resource
+ definitions.
+ * mac-xdep.c: New file, Mac host interface code.
+ * config/m68k/xm-mpw.h (PATHNAME_SEPARATOR): Rename to
+ DIRNAME_SEPARATOR.
+ (PATHNAME_SEPARATOR_STRING): Remove.
+ (SIGQUIT, SIGHUP): Define.
+ (fileno, R_OK): Define.
+
+ * mpw-config.in: New file, MPW configuration fragment.
+ * mpw-make.in: New file, MPW makefile fragment.
+ * config/m68k/xm-mpw.h: New file, MPW host definitions.
+ * ser-mac.c: New file, Mac serial interface.
+
+Mon Apr 10 16:47:57 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * valprint.c (print_longest): Fix a syntax error in #ifdef
+ PRINTF_HAS_LONG_LONG.
+
+ * config/mips/xm-irix5.h: turn on CC_HAS_LONG_LONG and
+ PRINTF_HAS_LONG_LONG.
+ * config/mips/tm-irix5.h: turn on FORCE_LONG_LONG.
+
+Sat Apr 8 02:47:45 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol): Use new variable
+ nodebug_var_symbol_type as type of variables which don't have any
+ ecoff debug info associated with them.
+ (parse_symbol, parse_procedure): Use heuristics to determine if
+ functions were compiled without debugging info and change their
+ type to nodebug_function_symbol_type.
+ (_initialize_mdebugread): Initialize nodebug_*_symbol_type.
+
+ * source.c (line_info): Clear sal.pc for `info line' without
+ arguments.
+
+Fri Apr 7 17:43:01 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * monitor.c: make_xmodem_packet and print_xmodem_packet go away.
+ send_xmodem_packet shows up to do the obvious. Lots of fixes to
+ xmodem downloads including resetting of block number at start of
+ new transfers, fix for buffer overrun problem, addition of CRC
+ generation code.
+ * (monitor_open): loadtype_str and loadproto_str now default to
+ first entry in monitor_ops->loadtypes.
+ * (monitor_wait): Lengthen register dump buf, because of verbose
+ Winbond monitor.
+ * (monitor_fetch_register): Report unimplemented registers as 0.
+ * (monitor_read_memory): Only do 16 byte aligned transfers
+ because of formatting weirdness with the Winbond monitor. Also,
+ ignore non-hex, non-whitespace formatting between bytes (same
+ monitor).
+ * (monitor_load): Clean up logic.
+ * (monitor_load_srec): Re-do xmodem support. Move lots of it
+ into send_xmodem_packet.
+ * (getacknak): Get rid of polls and timeouts. Handle CRC
+ requests from receiver.
+ * (monitor_make_srec): Efficiency improvements. Don't call
+ sprintf to output two digit hex numbers.
+ * (crcinit, docrc): New, CRC-16 support routines.
+ * (send_xmodem_packet): New routine to generate either CRC-16 or
+ checksummed xmodem packets.
+
+ * remote-est.c (est_loadtypes), rom68k-rom.c (rom68k_loadtypes):
+ Reduce tables down to only the load types supported by each
+ monitor.
+
+ * w89k-rom.c (w89k_supply_register): Parses output of Winbond
+ register dumps.
+ * (w89k_loadtypes, w89k_loadprotos): Reduce to just srec/xmodem.
+ * (w89k_cmds): Add clear all breakpoints, memory fill, and dump
+ registers commands.
+
+ * config/pa/tm-hppa.h: Define lots register offsets needed by
+ w89k-rom.c.
+
+
+Thu Apr 6 17:00:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * Makefile.in (X11_INCLUDES): Define as empty.
+ (X11_CFLAGS): Define as including $(X11_INCLUDES).
+ (X11_LIB_SWITCHES): Define as empty.
+ (X11_LIBS): Define as -lX11.
+
+
+Wed Apr 5 19:57:38 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * mips-tdep.c (mips_print_register): Remove unused variable
+ our_type and call to init_type. Fixes memory leak. Reindent function.
+
+ * mips-tdep.c (mips_print_register), findvar.c
+ (write_register_bytes): Make buffer char[] instead of unsigned
+ char[].
+
+Mon Apr 3 19:28:14 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * top.c, utils.c, main.c, defs.h: Replace error_pre_print with two
+ variables: error_pre_print (for RETURN_ERROR) and quit_pre_print
+ (for RETURN_QUIT). Fixes a bug whereby typing ^C (e.g. in "maint
+ print sym") could output extraneous stuff.
+ * objfiles.c: Don't declare error_pre_print; defs.h does it.
+
+Mon Apr 3 13:48:28 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * monitor.h: Add MO_GETMEM_NEEDS_RANGE flag.
+ * monitor.c (monitor_read_memory): Use previously mentioned flag
+ to send proper format memory examine commands to the w89k monitor.
+ Also, try to handle bizarre format of memory dump...
+
+ * op50-rom.c w89k-rom.c: Update to new monitor.[ch] conventions.
+
+Sat Apr 1 03:22:20 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
+ Handle relocated symbol address.
+ * partial-stab.h, case N_SO, SOFUN_ADDRESS_MAYBE_MISSING:
+ Do not relocate a zero address.
+
+Thu Mar 30 19:46:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/a29k/tm-a29k.h: Nuke obsolete define CONTROL_END_ADDR; it
+ is nowhere used.
+
+ * stabsread.c (read_range_type): Remove FIXME comment about
+ type-id (I presume this meant a number followed by = followed by a
+ type) versus type number; Per fixed it.
+
+Wed Mar 29 09:56:04 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * configure.in: sparc-*-sunos5* is same as sparc-*-solaris2*.
+
+Wed Mar 29 18:30:03 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-e7000.c (why_stop): Add new kinds of strings to expect
+ from the emulator.
+ (e7000_wait): Add interpretations for more stop reasons,
+ including warnings for write protect and cycle address errors.
+
+Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c monitor.h remote-est.c rom68k-rom.c: Add start of
+ support for interrupting target.
+ * monitor.c (monitor_open): Send stop command before doing
+ anything else.
+ * (monitor_load_srec): Fix record size calculation to prevent end
+ of segment from getting trashed.
+ * rom68k-rom.c: Update to latest version of struct monitor_ops.
+ * config/sparc/tm-sparc.h (FIX_CALL_DUMMY): Fix byte-order
+ problems. Makes DOS hosted function calling work.
+ * sparclite/crt0.s: Define _start to make COFF happy.
+
+Wed Mar 29 09:11:51 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * defs.h (atof): Don't provide an external declaration if atof is
+ a macro.
+
+Wed Mar 29 00:01:07 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-tdep.c (skip_prologue): Skip saving of LR and CR in
+ the stack frame, fix typos in `st rx,NUM(r1)' and `stu r1,NUM(r1)'
+ tests.
+
+Tue Mar 28 17:04:04 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdbtypes.c (create_range_type): If indextype has TYPE_FLAG_STUB
+ set, set TYPE_FLAG_TARGET_STUB.
+ (check_stub_type): Recalculate TYPE_LENGTH for range type.
+ * stabsread.c (read_range_type): If index type number is followed
+ by '=', back up, call read_type. and assume we have a true range.
+ * gdbtypes.h (TYPE_FLAG_TARGET_STUB): Update comment.
+
+Mon Mar 27 22:51:54 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-nat.c, irix4-nat.c, irix5-nat.c, mipsv4-nat.c,
+ sparc-tdep.c (supply_gregset, supply_fpregset): Fill inaccessible
+ registers with zero to handle recent read_register_bytes change.
+ * irix4-nat.c, irix5-nat.c, mipsv4-nat.c (supply_gregset,
+ fill_gregset): Fix handling of CAUSE_REGNUM.
+ * mips-nat.c (store_inferior_registers): Handle unwritable
+ registers when storing a single register.
+ * config/mips/tm-irix3.h (CAUSE_REGNUM, BADVADDR_REGNUM):
+ Fix definitions.
+
+ * mdebugread.c (parse_symbol, psymtab_to_symtab_1): Clear
+ allocated mips_extra_func_info, if the debug info is corrupt,
+ the PDR to fill it in might be missing.
+
+Mon Mar 27 14:43:00 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * vx-share/regPacket.h: a new file interfacing with vxworks.
+
+Sun Mar 26 13:22:47 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (bpstat_do_actions): Once we've executed the
+ commands, set bs->commands to NULL.
+
+Sat Mar 25 01:16:10 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * buildsym.c (patch_subfile_name): Update last_source_file
+ with the real source file name.
+ * dbxread.c (end_psymtab): Handle static functions in the
+ SOFUN_ADDRESS_MAYBE_MISSING case by passing pst->filename
+ to lookup_minimal_symbol.
+ (process_one_symbol): Ignore extra outermost context from
+ SunPRO cc and acc.
+ * stabsread.c (define_symbol): Do not complain for SunPRO
+ static variable encoding if STATIC_TRANSFORM_NAME is defined.
+ * sparc-tdep.c, config/sparc/tm-sun4sol2.h
+ (sunpro_static_transform_name): Renamed from
+ solaris_static_transform_name.
+ * config/sparc/tm-sun4os4.h (STATIC_TRANSFORM_NAME):
+ Define to sunpro_static_transform_name for acc 3.0 compiled
+ executables.
+ * procfs.c, config/alpha/nm-osf2.h (PROCFS_DONT_TRACE_FAULTS):
+ Renamed from PROCFS_DONT_TRACE_IFAULT, don't trace any faults
+ if defined.
+ * procfs.c (info_proc_siginfo): Cast sip->si_addr to
+ `unsigned long' and use `lx' format for printing it.
+
+Fri Mar 24 15:45:42 1995 Stu Grossman (grossman@cygnus.com)
+
+ * configure.in: Move test for m68*-est-* before m68*-*-coff*.
+ * findvar.c: Move default def of CANNOT_STORE_REGISTER closer to
+ the beginning of the code.
+ * (write_register_gen): New routine. Analogous to
+ read_register_gen.
+ * (write_register_bytes): Another rewrite! Make it smarter about
+ not updating regs with the same value.
+ * monitor.c (printf_monitor readchar): Use stderr instead of
+ stdout to output debug info. Also cleanup readchar a little.
+ * (expect): Make sure that excessive responses are null
+ terminated.
+ * (monitor_open): Check for magic number in monitor_ops struct.
+ Allow multiple commands as init strings. Also, clear all
+ breakpoints.
+ * (monitor_resume monitor_wait): Send a command to dump all the
+ regs for those targets which don't do so when waking up after a
+ continue command.
+ * (monitor_wait): Handle excessive response output better.
+ * (monitor_write_memory): Use block fill, word, and long word
+ commands (if they exist) to write memory more efficiently.
+ * General cleanups to use flag bits instead of individual flag
+ words in monitor_ops struct.
+ * (monitor_command): Return output from command.
+ * (monitor_load_srec): Allocate buffer only once. Use alloca.
+ Wait for load response string instead of using a timeout to start
+ sending S-records. Fix bug where value of srec_frame shrinks. If
+ hashmark is set, print `-' for retransmissions. General cleanups.
+ * (monitor_make_srec): Get rid of S-record default type kludge.
+ * monitor.h: Use seperate struct for memory and register
+ read/write commands. Memory commands can come in byte, word,
+ long, and longlong forms.
+ * (monitor_ops): Change lots of fields. Generalize some stuff.
+ Put all flags into flags word. Allow init to be a list of commands.
+ Add command for clearing all breakpoints, block fill, dumping all
+ registers.
+ * remote-est.c: Rewrite to use new monitor conventions.
+ * config/m68k/est.mt (TDEPFILES): Add monitor.o.
+ * config/m68k/tm-est.h: Set NUM_REGS to 18.
+ * testsuite/gdb.base/break.exp: Lots of cleanups. Use gdb_test
+ more thoroughly.
+
+Thu Mar 23 23:20:00 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (som_solib_add): Handle case where a shared library
+ referenced by a core file has sections without the SEC_ALLOC bit
+ set (eg stabs sections).
+
+Thu Mar 23 15:07:08 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * breakpoint.c (bpstat_do_actions): For each element in the bpstat
+ chain, do all the commands regardless of whether they run the
+ inferior.
+
+Wed Mar 22 19:17:06 1995 Doug Evans <dje@cygnus.com>
+
+ * mem-break.c (LITTLE_BREAKPOINT, BIG_BREAKPOINT): Define as
+ BREAKPOINT if mono-endian.
+ (break_insn): Deleted.
+ (big_break_insn, little_break_insn): Define.
+ (memory_insert_breakpoint): Handle bi-endian cpus.
+ (BREAKPOINT_LEN): Define.
+ (memory_remove_breakpoint): Use it.
+ (memory_breakpoint_size): Likewise.
+
+Tue Mar 21 17:03:17 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * sparc-stub.c: add nop after 'bg good_wim'.
+ * sparcl-stub.c: ditto.
+
+Tue Mar 21 13:34:12 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (handle_command): Don't print TARGET_SIGNAL_0,
+ TARGET_SIGNAL_UNKNOWN, or TARGET_SIGNAL_DEFAULT.
+
+Mon Mar 20 10:09:59 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppab-nat.c (store_inferior_registers): Sync with HPUX version.
+
+Mon Mar 20 07:34:48 1995 Stu Grossman (grossman@cygnus.com)
+
+ * hppah-nat.c (store_inferior_registers): Move check for
+ CANNOT_STORE_REGISTER to a better place. Fixes ptrace I/O errors
+ found by test suite during function calls, which attempts to write
+ unwritable registers.
+
+Sat Mar 18 02:02:24 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol): If finishing a function without
+ known parameter type info, set that from parameter symbols.
+ Remove commented-out add_param_to_type support.
+
+Thu Mar 16 16:38:03 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (process_linenos): Make sure filename we pass to
+ start_subfile will cause deduce_language_from_filename to return
+ the correct thing. Reindent function to GNU standards.
+
+Thu Mar 16 15:54:00 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * nlm/gdbserve.c (handle_exception): #if out call to StopBell,
+ as it is not available on NetWare 3 or PIN.
+ * nlm/ppc.c (StopBell): Removed.
+
+Thu Mar 16 12:14:41 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (read_xcoff_symtab): When creating a dummy parameter
+ inferred from the traceback tags, give its type the name
+ "<non-float parameter>".
+
+ * stabsread.c (rs6000_builtin_type): Recognize types -31 to -34.
+
+Wed Mar 15 15:09:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * findvar.c (read_register_bytes write_register_bytes): Make
+ these routines much smarter about updating registers from the
+ target, only doing so when absolutely necessary. This really
+ speeds up register modification on some remote targets.
+
+ * monitor.c: More cleanups. Get rid of monitor_load_ascii_srec.
+ BFD makes this unnecessary. Lots of debugging speedups.
+ * (expect): NULL terminate return string.
+ * (monitor_open monitor_supply_register parse_register_dump
+ monitor_wait monitor_fetch_register): Switch to using GNU regexp
+ library to parse multi-register displays.
+ * (monitor_read_memory): Read multiple bytes (up to 16) at once.
+ * (monitor_create_inferior): Call clear_proceed_status to make run
+ command notice first breakpoint.
+ * (monitor_load): Clean up. Reset inferior_pid, set pc to start
+ address and reset symbol table stuff to make loads put things into
+ a fresh state.
+ * (monitor_load_srec): Lower sleep time to 1 second.
+
+ * monitor.h (struct monitor_ops): Add register_pattern and
+ supply_register to monitor_ops.
+
+ * rom68k-rom.c: Add new support for handling register dumps.
+ * config/m68k/tm-m68k.h: Define D0_REGNUM and A0_REGNUM for register
+ dump handling.
+
+Wed Mar 15 15:18:27 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c, defs.h (putchar_unfiltered, fputc_unfiltered): Make
+ argument be an int, not a char. Using a prototype followed by an
+ old-style function definition in a case where an argument is
+ widened is a GCC-ism not supported by the native AIX compiler.
+
+Wed Mar 15 12:22:35 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * nlmstub.def: Removed, this was moved to nlm/gdbserve.def
+ long ago.
+
+ * configure.in (alpha-*-netware*): Removed configuration.
+ * config/alpha/{alpha-nw.mt, gdbserve.mt, tm-alphanw.h}: Removed.
+ * nlm/{README-ALPHA-NETWARE, aio.h, alpha-io.S, alpha-regdef.h,
+ alpha.c, alpha.h, altdebug.h}: Removed.
+
+ * nlm/gdbserve.c (main): Add support for processing BOARD=
+ argument, deprecate NODE=.
+
+Wed Mar 15 10:58:26 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * c-exp.y (yylex): Make an empty character constant an error.
+
+Tue Mar 14 15:00:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (value_arg_coerce): Do possible value_coerce_array
+ before determining type argument to value_cast.
+
+Tue Mar 14 10:41:41 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-es.c: Replace ignore with 0.
+
+Tue Mar 14 05:52:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (value_repeat), eval.c (evaluate_subexp_standard):
+ If VALUE_REPEATED is already set, just error out.
+
+ * valops.c (value_cast, value_slice), parse.c (follow_types): Add
+ FIXME-type-allocation comments.
+
+ * gdbtypes.h (struct type): Fix comment about what units the
+ TYPE_LENGTH is in.
+
+Mon Mar 13 18:27:25 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * ch-valprint.c (annotate.h): Include.
+ * eval.c (evaluate_subexp_standard): Remove unused variable.
+ (calc_f77_array_dims): Add parens to expression.
+ * f-exp.y (yylex): Add parens to expression, remove unused label.
+ * f-lang.h (calc_f77_array_dims): Declare.
+ * f-valprint.c (f_val_print): Remove unused variables.
+
+Mon Mar 13 15:25:47 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * alpha-tdep.c (find_proc_desc): If pdr.framereg field is -1, don't
+ use the PDR, just examine prologues instead.
+
+Fri Mar 10 16:13:18 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/arc/tm-arc.h: Change arc register names.
+
+Fri Mar 10 02:49:40 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Fix problems with infinite recursion when printing a class
+ that contains a static instance of the class.
+ * cp-valprint.c (dont_print_vb_obstack): Renamed from
+ dont_print_obstack, made static.
+ (dont_print_statmem_obstack): New obstack, controls printing
+ of static member classes.
+ (_initialize_cp_valprint): Initialize it.
+ (cp_print_static_field): New function, handles printing of
+ static members.
+ (cp_print_value_fields): New parameter dont_print_statmem to
+ handle recursive printing of static member classes, use
+ cp_print_static_field to handle printing of static members.
+ * c-valprint.c (cp_print_value_fields): Update prototype and
+ call to include additional dont_print_statmem parameter.
+ * c-valprint.c, f-valprint.c (dont_print_obstack): Remove unused
+ extern declaration.
+
+ * alpha-tdep.c, findvar.c, infptrace.c: Include <string.h>.
+
+ * config/alpha/tm-alpha.h (FRAME_FIND_SAVED_REGS): Call
+ alpha_find_saved_regs if fi->saved_regs is still NULL.
+
+ * elfread.c (elf_symtab_read): Ensure that the filename field
+ of a minsym is nonempty. Ignore solib trampoline symbols from
+ the main symbol table, they might have a bogus value.
+
+ * procfs.c (set_proc_siginfo), config/alpha/alpha-osf2.mh:
+ Fix typos in comments.
+
+Thu Mar 9 17:19:47 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * mdebugread.c (parse_symbol, psymtab_to_symtab_1): Initialize
+ pdr.framereg field of MIPS_EFI_SYMBOL_NAME symbol to -1. That way
+ we know whether the PDR ever got set.
+ * mips-tdep.c (find_proc_desc): If pdr.framereg field is -1, don't
+ use the PDR, just examine prologues instead.
+
+Wed Mar 8 23:35:10 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somsolib.c (som_solib_section_offsets): Get offset of text
+ section right.
+
+Wed Mar 8 16:12:21 1995 Stu Grossman (grossman@cygnus.com)
+
+
+ * source.c (forward_search_command reverse_search_command): Set
+ convenience variable $_ to be the line # of the match.
+ * symtab.c (decode_line_1): Allow convenience variables to be
+ used in line specs (for breakpoints and such).
+
+Wed Mar 8 12:51:00 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (VERSION): Bump to 4.14.1.
+ * NEWS, README: Update for 4.14.
+ * i386v-nat.c (i386_insert_aligned_watchpoint): Fix declaration.
+ (i386_insert_nonaligned_watchpoint): Call aligned instead of
+ generic watchpoint insertion.
+
+Tue Mar 7 19:26:10 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (value_slice): Do COERCE_VARYING_ARRAY.
+
+Tue Mar 7 00:23:47 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c, array-rom.c, monitor.h, rom68k-rom.c: Move target_ops
+ into monitor.c.
+ * monitor.c (monitor_create_inferior): Allow run command to start
+ program.
+
+ * monitor.c (monitor_load): Set PC to start address when done
+ loading.
+
+ * array-rom.c, monitor.h, rom68k-rom.c: Clean up target_ops.
+ Remove ref to monitor_create_inferior.
+
+ * monitor.c: More general cleanups. Add prototypes, remove
+ unused routines. Fix bug with wrong number of args to error().
+
+ * main.c (main): Don't start up GUI when running under gdb mode
+ in emacs.
+
+ * Makefile.in: Add rules for monitor.o and rom68k-rom.o to make
+ Sun make (with VPATH) work...
+
+ * monitor.c, monitor.h, rom68k-rom.c: Serious cleanup to make IDP
+ (rom68k) target work right.
+ * array-rom.c, op50-rom.c, w89k-rom.c: Partial updates to new
+ monitor.c interface. More work needs to be done here.
+ * config/m68k/tm-monitor.h: Change DECR_PC_AFTER_BREAK to 0 to
+ match the IDP monitor. Also, set NUM_REGS to 18 cuz there's no
+ floating-point for this card.
+
+ * serial.h, ser-go32.c, ser-mac.c, ser-tcp.c, ser-unix.c: Add
+ SERIAL_SETSTOPBITS to set the number of stopbits (needed for IDP
+ board?!?!?).
+
+ * defs.h, utils.c, remote-hms.c, remote-pa.c, remote.c: Fix defs
+ and usage of fputc_unfiltered and putchar_unfiltered. Eliminate
+ putc_unfiltered (it's superfluous).
+
+ * command.h, command.c, top.c: Add var_enum command type. It's
+ like var_string but allows only only one of the specified strings.
+
+Mon Mar 6 15:03:59 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (value_cast): Don't use backslash newline--pre-ANSI
+ compilers (such as SunOS4 /bin/cc) don't generally support it
+ except in some contexts.
+
+Fri Mar 3 17:42:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (value_cast): Check for cast to array type *before*
+ we coerce array to pointer (in case arg2 is already array).
+
+ * valops.c (call_function_by_hand): Set using_gcc to 2 if using
+ gcc2. Needed for REG_STRUCT_HAS_ADDR to work on sparc.
+ Also check REG_STRUCT_HAS_ADDR for union, array and string types.
+
+ * valops.c (call_function_by_hand): Re-arrange code for pushing
+ paramaters on the stack so we can do better STACK_ALIGN.
+
+ * valops.c (call_function_by_hand): Call error if the number
+ of arguments is fewer than parameter types in function type.
+
+Fri Mar 3 17:13:05 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-tdep.c (sparc_extract_struct_value_address): Move
+ sparc64 support to here.
+ (sparc64_extract_struct_value_address): Deleted.
+ (dump_ccreg): Add a prototype so long long arg -> int.
+ * sparc/tm-sp64.h (USE_STRUCT_CONVENTION): Define.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Delete.
+
+Fri Mar 3 15:12:12 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hpread_record_lines): New argument "offset". All
+ callers changed. Use it to handle dynamic address relocation.
+ (hpread_build_psymtabs): Adjust texthigh as we read each function
+ debug symbol. Fix computation of texthigh.
+ (hpread_read_subrange_type): Work around macro bugs in HP's
+ compilers.
+ (hpread_process_one_debug_symbol): Correctly map source lines.
+
+ * somread.c (check_strange_names): Filter names emitted by the HP
+ compiler when generating PIC code.
+
+ * valops.c (value_struct_elt_for_reference): Work around macro
+ bugs in HP's compilers.
+ * c-exp.y (block): Likewise.
+
+Fri Mar 3 12:27:28 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * rs6000-tdep.c (push_dummy_frame): Fix order of arguments to
+ store_address.
+
+ * utils.c [_AIX]: Include stddef.h instead of #defining size_t.
+
+Fri Mar 3 12:33:24 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * rs6000-tdep.c (skip_prologue): Skip multiple stores of the saved
+ registers that GCC emits on the PowerPC by default in addition to
+ the store multiple instruction used on the Power series.
+
+Fri Mar 3 00:54:58 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-tdep.c (decode_asi): New function.
+ (sparc_print_register_hook): Pretty print more v9 registers.
+ * sparc/tm-sp64.h (REGISTER_NAMES): Fix some typos.
+
+Thu Mar 2 22:20:22 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * dwarfread.c (struct dieinfo): Use CORE_ADDR for at_{low,high}_pc.
+ (target_to_host): Change result type to CORE_ADDR.
+
+Thu Mar 2 15:13:04 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * rs6000-tdep.c: Fix byte-swapping sins.
+
+Thu Mar 2 16:48:45 1995 Michael Meissner <meissner@cygnus.com>
+
+ * rs6000-tdep.c (branch_dest): Minor code cleanup, don't share
+ code between branch unconditional and branch conditional cases.
+
+Wed Mar 1 09:41:26 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ Various changes for sparc64.
+ * sparc-tdep.c (NUM_SPARC_FPREGS): Define.
+ (SPARC_INTREG_SIZE): Define.
+ (*): Use SPARC_INTREG_SIZE instead of REGISTER_RAW_SIZE (intreg)
+ where appropriate.
+ (enum branch_type): New value `done_retry'.
+ (isbranch): Renamed from isannulled. All callers changed.
+ Support new sparc64 branch insns.
+ (single_step): Handle done_retry.
+ (sparc_extract_struct_value_address): Don't assume 4 byte regs.
+ (get_saved_register): Likewise.
+ (sparc_push_dummy_frame): Likewise.
+ (sparc_frame_find_saved_regs): Likewise.
+ (sparc_pop_frame): Likewise. Don't refer to FPS_REGNUM, CPS_REGNUM,
+ or PS_REGNUM if not sparc64. sparc64 has 64 fp regs.
+ (sparc64_extract_struct_value_address): New function.
+ (dump_ccreg, sparc_print_register_hook): Likewise.
+ * sp64-tdep.c: Deleted.
+ * sparc/tm-sp64.h (GDB_TARGET_IS_SPARC64): Define.
+ (NUM_REGS): Reduce by 2, cle/tle are in the pstate reg.
+ (CC_HAS_LONG_LONG): Define.
+ (REGISTER_NAMES): Delete cle/tle and reorganize.
+ (PS_REGNUM, FPS_REGNUM, CPS_REGNUM): Delete, they're ifdef'd out of
+ sparc-tdep.c now.
+ (REGISTER_BYTES): Update.
+ (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Delete.
+ (EXTRACT_RETURN_VALUE): Delete. Use definition in tm-sparc.h.
+ (NO_SINGLE_STEP): Likewise.
+ * sparc/tm-sparc.h (EXTRACT_VALUE_RETURN): Don't assume 4 byte regs.
+ * sparc/sp64.mt: Move simulator support ...
+ * sparc/sp64sim.mt: ... to here.
+
+Wed Mar 1 13:14:42 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-vx960.c: new file for target specific register packaging.
+ * remote-vx68.c: ditto.
+ * config/i960/vxworks960.mt: add remote-vx960.o.
+ * config/m68k/vxworks68.mt: add remote-vx68.o.
+
+Wed Mar 1 13:42:49 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * remote.c (remote_wait): Make calls to strtol be type correct by
+ passing the address of a char * pointer instead of an unsigned
+ char *.
+
+ * rs6000-tdep.c (push_dummy_frame): Cast sp to char * when calling
+ write_memory to make things type correct.
+
+Wed Mar 1 12:17:31 1995 Michael Meissner <meissner@cygnus.com>
+
+ * ch-exp.y, c-exp.y, f-exp.y, m2-exp.y (yy defines): Support the
+ standard Linux yacc by adding more names to be redefined with a
+ prefix.
+
+Tue Feb 28 22:55:47 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hppa-tdep.c (pa_print_registers), monitor.c: Use
+ extract_unsigned_integer and friends, not SWAP_TARGET_AND_HOST.
+ * defs.h, findvar.c: Move SWAP_TARGET_AND_HOST back to findvar.c.
+ Rename it to SWAP_FLOATING to make it clear it is no longer for
+ integers.
+
+Tue Feb 28 14:38:39 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not
+ compile time.
+ * arc-tdep.c (_initialize_arc_tdep): set tm_print_insn according to
+ processor.
+
+ * vx-share/ptrace.h: merge in WRS new ptrace requests.
+
+ * defs.h: fix a syntax error.
+
+ * a29k-tdep.c (get_longjmp_target): add this function, from WRS.
+ * remote-vx.c: move read_register and write_register out to
+ target specific files.
+ * remote-vx29k.c (get_fp_contnets): add this function, from WRS.
+
+ * defs.h: define SWAP_TARGET_AND_HOST macro.
+ * findvar.c, monitor.c, hppa-tdep.c: remove definition of
+ SWAP_TARGET_AND_HOST.
+
+Tue Feb 28 08:31:40 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * alpha-tdep.c (find_proc_desc): Only attempt to set
+ PROC_LOCALOFF (found_heuristic) if found_heuristic is non-NULL.
+
+Mon Feb 27 11:56:32 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c: General gcc -Wall lint cleanup and reformat.
+ (monitor_command): If no args, send an empty command.
+
+Thu Feb 23 21:07:25 1995 Stu Grossman (grossman@cygnus.com)
+
+ * monitor.c (monitor_load_ascii_srec): Add a one second sleep
+ after send LOAD_CMD to prevent loss of first S-record.
+
+Tue Feb 21 20:48:42 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valops.c (call_function_by_hand): Set using_gcc to 2 if gcc-2.
+ Call error if too few arguments.
+ If REG_STRUCT_HAS_ADDR (structs passed by invisible reference),
+ copy and convert to reference *before* we calculate alignment.
+ Also, make sure structs allocated for return values and invisible
+ reference don't violate STACK_ALIGN.
+
+Tue Feb 21 23:29:59 1995 Per Bothner <bothner@rtl.cygnus.com>
+
+ * ch-exp.y (expression_conversion): Recognize 'ARRAY () TYPE (EXPR)'
+ (same as C's '(TYPE[])EXPR')
+
+Tue Feb 21 11:47:26 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.c (print_gdb_version): Update the year.
+
+Sun Feb 19 14:31:57 1995 Jim Kingdon <kingdon@rtl.cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Look for newlib in
+ `..' not in `../..'.
+
+Sun Feb 19 11:05:28 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * procfs.c (unconditionally_kill_inferior): Don't issue a PIOCKILL
+ in addition to a PIOCSSIG to kill the inferior.
+
+Thu Feb 16 15:06:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * parse.c (follow_types): Given (TYPE[]) (i.e. with no length),
+ create a 0-length array type, and set BOUND_CANNOT_BE_DETERMINED.
+ * valops.c (value_cast): If a cast like (TYPE[])VALUE (i.e. array
+ of unknown length) use sizeof(VALUE)/sizeof(TYPE) as the length.
+ * c-typeprint.c (c_type_print_varspec_suffix): If array length
+ is 0, print it, but not if upper_bound is BOUND_CANNOT_BE_DETERMINED.
+
+Thu Feb 16 16:06:50 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * dcache.c (insque, remque): Rewrite Linux support.
+
+Wed Feb 15 12:33:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/tm-ppc-eabi.h (TEXT_SEGMENT_BASE): Define as 1.
+
+ * dcache.c (insque, remque): If compiling in standard C on Linux,
+ protect insque and remque with macros to cast the pointer
+ arguments to the proper type.
+
+Tue Feb 14 17:16:41 1995 Stu Grossman (grossman@cygnus.com)
+
+ * annotate.c, breakpoint.c, defs.h, top.c: Replace
+ enable/disable_breakpoint_hook with modify_breakpoint_hook.
+
+Tue Feb 14 16:58:07 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * expression.h: Move declaration of evaluate_subexp_with_coercion
+ from here...
+ * value.h: ...to here.
+ * expression.h: Don't include value.h
+
+Tue Feb 14 11:46:07 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * expression.h: Move include of value.h until after declaration of
+ enum exp_opcode.
+
+Sun Feb 12 13:47:30 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-e7000.c: Comprehensive cleanup; removal of dead code,
+ simplify code, declare things, format to standards.
+ (inferior.h, value.h, command.h, remote-utils.h): Include.
+ (e7000_login): Rename to e7000_login_command.
+ (e7000_ftp): Rename to e7000_ftp_command.
+ (e7000_drain): Rename to e7000_drain_command.
+
+ * irix5-nat.c (string.h): Include near beginning of file.
+
+Sun Feb 12 12:36:38 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * valops.c (value_arg_coerce): Use VALUE_TYPE not SYMBOL_TYPE on
+ arg, it is a value not a symbol.
+
+ gcc -Wall lint:
+ * eval.c: Move declaration of evaluate_subexp_with_coercion from here..
+ * expression.h: ..to here.
+ * expression.h: Include value.h.
+ * ch-lang.c (evaluate_subexp_chill): Add default case in switch.
+
+Sun Feb 12 11:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * language.h (struct language_defn): New field evaluate_exp.
+ * c-lang.c (c_language_defn, cplus_language_defn, asm_langauge_defn),
+ f-lang.c (f_language_defn), language.c (unknown_language_defn,
+ auto_language_defn, local_language_defn), m2-lang.c (m2_language_defn):
+ Set evaluate_exp to evaluate_subexp_standard.
+ * ch-lang.c (evaluate_subexp_chill): New function. Chill-specific
+ support for MULTI_SUBSCRIPT.
+ (chill_language_defn): Set evaluate_exp to evaluate_subexp_chill.
+ * eval.c (enum noside): Move from here ....
+ * expression.h (enum noside): ... to here.
+ (evaluate_subexp_standard): New prototype.
+ * eval.c (evaluate_subexp): Renamed to evaluate_subexp_standard.
+ Removed lo-longer-needed test for chill_varying_type.
+ (evaluate_subexp): New. Calls exp->language_defn->evaluate_exp.
+
+ * ch-exp.y (maybe_expression_list): New non-terminal.
+ (primitive_value): Allow empty parameter list.
+
+Sun Feb 12 10:02:16 1995 Per Bothner <bothner@cygnus.com>
+
+ * buildsym.c (finish_block): If finishing a function without known
+ parameter type info, set that from parameter symbols.
+ * c-typeprint.c (c_type_print_varspec_suffix): For TYPE_CODE_FUNC,
+ print parameter types, if available.
+ * ch-typeprint.c (chill_type_print_base): Likewise.
+
+ * gdbtypes.h (struct type): Remove function type field.
+ (TYPE_FUNCTION_TYPE): Remove macro. We can't as simply re-use
+ function types now that we're also storing parameter types.
+ And the payoff is much less.
+ * gdbtypes.c (make_function_type): Don't use/set TYPE_FUNCTION_TYPE.
+ (recursive_dump_type): Don't print TYPE_FUNCTION_TYPE.
+ * dwarfread.c (read_subroutine_type): Don't set TYPE_FUNCTION_TYPE.
+
+ * valops.c (value_arg_coerce): Now takes param_type argument.
+ (call_function_by_hand): Convert arguments with value_arg_coerce
+ early, and overwrite original args with converted args.
+ No longer need multiple calls to value_arg_coerce.
+ (value_arg_push): Removed.
+ * hppa-tdep.c (hppa_push_arguments): No longer call value_arg_coerce.
+ * mips-tdep.c (mips_push_arguments): Likewise.
+ * alpha-tdep.c (alpha_push_arguments): Likewise.
+ * rs6000-tdep.c (push_arguments, ran_out_of_registers_for_arguments):
+ Likewise.
+ * value.h (value_arg_coerce): Remove declaration. (It's now static.)
+
+ * valops.c (value_cast): Do COERCE_VARYING_ARRAY after COERCE_REF.
+
+ * symtab.c (add_param_to_type): Remove (commented-out) function,
+ since that functionality has been re-written.
+ * coffread.c: Remove commented-out add_param_to_type support.
+ * mdebugread.c (parse_symbol): Likewise.
+ * stabsread.c (define_symbol): Likewise.
+
+Sun Feb 12 09:03:47 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * buildsym.c (start_subfile): Set language for f2c like for cfront.
+
+Thu Feb 9 20:20:11 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * op50n-rom.c: Add the control registers.
+
+Thu Feb 9 15:46:39 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (CLIBS): Add $(LIBIBERTY) before, in addition to
+ after, any host/target/native libraries.
+ * dcache.c (insque, remque): Remove declarations.
+ * gdbtypes.h (type_code): Remove trailing comma.
+
+ From Peter Schauer:
+ * xcoffread.c (read_xcoff_symtab) [C_HIDEXT]: Move #ifdef
+ STATIC_NODEBUG_VARS inside case.
+
+Thu Feb 9 07:43:41 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * config/sparc/tm-sun4sol2.h: Define STATIC_TRANSFORM_NAME.
+ * partial-stab.h: Call it.
+ * stabsread.c (define_symbol) [STATIC_TRANSFORM_NAME]: Call
+ STATIC_TRANSFORM_NAME to get the name and use minimal symbols to
+ get the address.
+ * sparc-tdep.c (solaris_static_transform_name): New function.
+
+Thu Feb 9 12:09:09 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * somread.c (som_symtab_read): Handle dynamic relocation for both
+ text and data symbols.
+ (som_symfile_offsets): If objfile is a shared library, then get
+ text and data offsets from the shared library structures.
+ * somsolib.c (som_solib_add): Copy the bfd pointer from the
+ objfile rather than reopening the file again.
+ (som_solib_section_offsets): New function.
+ * somsolib.h (som_solib_section_offsets): Declare.
+
+Wed Feb 8 20:32:18 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * config/sparc/tm-sun4sol2.h, dbxread.c: Rename
+ N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
+ * symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
+ filename field.
+ * elfread.c (record_minimal_symbol_and_info),
+ minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
+ newly created symbol.
+ * elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
+ Set filename field of minimal symbol.
+ * symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
+ Print filename field.
+ * minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
+ * symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
+ m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
+ os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
+ printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
+ * dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
+ Find address of function from minimal symbols.
+ * partial-stab.h, case 'f', 'F': Call find_stab_function_addr
+ instead of getting pst->textlow from the stab.
+ * minsyms.c (find_stab_function_addr): New function.
+
+Wed Feb 8 19:19:56 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * monitor.c: Fix so all the output shows up in the GUI command
+ window.
+
+Mon Feb 6 18:50:59 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * i386-tdep.c (_initialize_i386_tdep): Put void decl on separate
+ line, so init.c generation works correctly.
+ * arc-tdep.c (_initialize_arc_tdep): Ditto.
+
+Mon Feb 6 14:44:36 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * config/mips/idt.mt: Add support for the lsi33k target.
+ * config/sparc/sun4sol2.mh: Add support for ser-tcp.
+ * array-rom.c: Finish the rest of the support commands needed by
+ GDB.
+ * mips-tdep.c: Add LSI33k register names and processor type.
+
+Sat Feb 4 13:29:52 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/m68k/est.mt (TDEPFILES): Remove m68k-pinsn.o.
+
+Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com)
+
+ * core.c (dis_asm_read_memory), defs.h, top.c: Get rid of
+ dis_asm_read_memory_hook. We can now call the disassemblers
+ directly and have no need for this hook anymore.
+ * defs.h, printcmd.c: Make print_insn be static.
+
+ * ser-go32.c (dos_comisr): Make this 8 bit clean.
+ * (dos_open dos_close): Allow multiple opens to the same device.
+ Use a ref count to prevent unwanted deallocations.
+ * sparcl-tdep.c: Put #ifdefs around all socket stuff to make GO32
+ happy.
+ * (sparclite_ops): Switch to download_stratum.
+ * target.h (enum strata): Move download_stratum before
+ process_stratum so that executable targets get pushed on top of
+ download targets.
+
+Thu Feb 2 19:02:45 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * array-rom.c: Remove the non GDB remote protocol config stuff.
+
+ * monitor.c: All reading/writing functions for memory and
+ registers work.
+
+Thu Feb 2 16:11:04 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/arc/arc.mt: new target makefile for arc processor.
+ * config/arc/tm-arc.h: new target header for arc processor.
+ * config/arc/go32.mh: new go32 host makefile for arc processor.
+ * config/arc/xm-go32.h: new go32 host header for arc processor.
+ * arc-tdep.c: new target dependent codes for arc processor.
+
+Thu Feb 2 13:58:40 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (VERSION): Bump to 4.13.2.
+
+Thu Feb 2 07:27:56 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ Fix compiler warnings:
+ * remote-e7000.c (printf_e7000debug): Rename to puts_e7000debug
+ and have the caller do the sprintf. Saves us from varargs hell.
+ (normal): Define before use.
+ * remote-e7000.c: Reindent a few things.
+
+Wed Feb 1 21:16:42 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * f-typeprint.c (f_type_print_varspec_suffix): Print array index
+ ranges in reverse order.
+ * f-valprint.c (f77_create_arrayprint_offset_tbl): Fix calculation.
+
+ * eval.c (evaluate_subscript): Don't call value_subscript, since
+ it adjusts for lower bound and enforces ranges.
+
+ * expression.h (exp_code): Remove MULTI_F77_SUBSCRIPT, OP_F77_SUBSTR.
+ * eval.c, parse.c: Removed uses of removed opcodes.
+ * eval.c (evaluate_subexp): Clean up handling of
+ OP_UNDETERMINED_ARGLIST (no backtracking, more general).
+
+ * f-valprint.c (f_val_print): Print TYPE_CODE_STRING using
+ LA_PRINT_STRING, and not val_print_string (which reads from inferior).
+
+ * ch-lang.c (chill_is_varying_struct), ch-lang.h: Remve function
+ duplicate function made redundant by chill_varying_type.
+
+ Re-write of f77 string and complex number support:
+
+ * language.h (struct language_defn): New fields string_lower_bound
+ and string_char_type.
+ * c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn),
+ language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn), m2-lang.c (m2_language_defn), f-lang.c
+ (f_language_defn), ch-lang.c (chill_language_defn): Set new fields.
+ * gdbtypes.c (create_string_type): Use new string_char_type field.
+ * valops.c (value_string): Use new string_lower_bound field.
+
+ * defs.h (TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT): Removed.
+ * f-lang.c (f_create_fundamental_type, _initialize_f_language),
+ m2-lang.c (m2_create_fundamental_type),
+ gdbtypes.c (_initialize_gdbtypes): Set TYPE_TARGET_TYPE of complex
+ types. Set their TYPE_CODEs to TYPE_CODE_COMPLEX.
+ * mdebugread.c (mdebug_type_complex, mdebug_type_double_complex):
+ Removed. Use builtin_type_complex and builtin_type_double_complex.
+
+ * gdbtypes.h (enum type_code): Removed TYPE_CODE_LITERAL_STRING
+ and TYPE_CODE_LITERAL_COMPLEX.
+ * c-typeprint.c, f-typeprint.c, f-valprint.c, eval.c: Removed uses of
+ TYPE_CODE_LITERAL_STRING and TYPE_CODE_LITERAL_COMPLEX.
+ * gdbtypes.c, gdbtypes.h (f77_create_literal_complex_type,
+ f77_create_literal_string_type): Removed.
+ * value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_MEMADDR,
+ VALUE_SUBSTRING_MYADDR): Removed.
+
+ * expression.h (enum exp_opcode): Rename OP_F77_LITERAL_COMPLEX to
+ OP_COMPLEX.
+ * parse.c: Update accordingly.
+
+ * f-valprint.c (f77_print_cmplx): Removed.
+ (f_val_print case TYPE_CODE_COMPLEX): Re-write to use print_floating.
+
+ * f-exp.y (STRING_LITERAL): Use OP_STRING instead of OP_ARRAY.
+ * eval.c (evaluate_subexp): For case OP_ARRAY, don't call
+ f77_value_literal_string.
+ * valops.c, value.h (f77_value_literal_string, f77_value_substring,
+ f77_assign_from_literal_string, f77_assign_from_literal_complex):
+ Removed.
+ (value_assign): No longer need to handle literal types.
+ * valops.c (f77_value_literal_complex), value.h: Re-written and
+ renamed to value_literal_complex. Last arg is now a (complex) type.
+ * valops.c (f77_cast_into_complex): Re-written and renamed to
+ cast_into_complex.
+ * eval.c (evaluate_subexp): Update accordingly.
+
+ * ch-valprint.c (chill_val_print): On TYPE_CODE_STRING, don't
+ print address for non-'s'-formats.
+ * ch-typeprint.c, ch-valprint.c: Use chill_varying_type instead
+ of chill_is_varying_struct.
+
+Wed Feb 1 13:27:33 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ gcc -Wall lint.
+ * alpha-tdep.c (alpha_in_lenient_prologue): Comment out.
+ (after_prologue): Remove unused local b.
+ * procfs.c (thread.h): Include.
+ (pr_flag_table, pr_why_table, faults_table, siginfo_table): Use
+ nested braces in initializer.
+ * top.c (initialize_targets, initialize_utils): Declare.
+ (locate_arg, insert_args): Add parens around tested assignments.
+ * remote-utils.c (sr_scan_args): Remove decl of strtol.
+ * remote.c (thread.h): Include.
+ (remote_wait): Remove unused local p2.
+ * sparc-tdep.c (fill_gregset, fill_fpregset): Remove decls of
+ registers array.
+
+ defs.h (stdlib.h): Include.
+ (exit, perror, atoi, qsort, memcpy, memcmp): Don't declare.
+ (fclose, atof, malloc, realloc, free, strchr, strrchr, strstr,
+ strtok, strerror): Don't specify parameter types in declaration.
+
+Wed Feb 1 12:23:57 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.y (value_string_element, string_primitive_value,
+ start_element, left_element, right_element, slice_size,
+ lower_element, upper_element, first_element): Removed.
+ (value_string_slice, value_array_slice): Replaced by ...
+ (slice): New non-terminal, with working slice support.
+ (primitive_value_lparen, rparen): New non-terminals.
+ (maybe_tuple_elements): New non-terminal, to allow empty tuples.
+ (idtokentab): Added "up".
+
+ * value.h (COERCE_VARYING_ARRAY): New macro.
+ * valarith.c (value_subscript): Use it.
+ * valops.c (value_cast): Likewise. Also, do nothing if already
+ correct type, and allow converting from/to range to/from scalar.
+
+ * valops.c, value.h (varying_to_slice, value_slice): New functions.
+ * eval.c (OP_ARRAY): Add cast for array element.
+ * expression.h (TERNOP_SLICE, TERNOP_SLICE_COUNT): New exp_opcodes.
+ * valops.c (chill_varying_type): Moved function frp, here ...
+ * gdbtypes.c (chill_varying_type), gdbtypes.h: ... to here.
+ * parse.c (length_of_subexp, prefixify_subexp): Add support
+ for TERNOP_SLICE, TERNOP_SLICE_COUNT.
+ * expprint.c (print_subexp, dump_expression): Likewise.
+ * eval.c (evaluate_subexp): Likewise.
+
+ * eval.c (evaluate_subexp case MULTI_SUBSCRIPT): Don't call
+ value_x_binop on a Chill varying string.
+
+Tue Jan 31 13:51:53 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m68k/monitor.mt,
+ config/pa/{hppabsd.mt,hppahpux.mt,hppaosf.mt,hppapro.mt}: Put
+ depfiles in TDEPFILES not REMOTE_O.
+
+Tue Jan 31 11:14:44 1995 Steve Chamberlain <sac@splat>
+
+ From nigel@algor.co.uk.
+ * ser-go32.c (dos_close): Don't crash if scb null.
+ (dos_sendbreak): New function.
+ (dos_ops): Point to dos_sendbreak.
+ (dos_info): Calculate COM number correctly.
+
+Tue Jan 31 09:40:11 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * xcoffread.c (process_xcoff_symbol): Use new variables
+ func_symbol_type and var_symbol_type as type of functions and
+ variables which don't have any stabs associated with them.
+ Reindent most of function.
+ (_initialize_xcoffread): Initialize *_symbol_type.
+
+ * xcoffread.c (read_xcoff_symtab): Reindent most of function.
+ Put C_HIDEXT symbols in the minimal symbols, rather than ignoring
+ them (this part commented out as I didn't quite get it to work).
+ (cs_to_section, find_targ_sec): New functions, to support above code.
+ * xcoffread.c (RECORD_MINIMAL_SYMBOL): Only skip '.' if it is
+ actually present.
+
+Mon Jan 30 17:34:24 1995 Stu Grossman (grossman@cygnus.com)
+ * sparcl-tdep.c: Add `sparclite' target for doing serial and udp
+ downloads to SPARClite demo boards.
+
+Sun Jan 29 09:43:22 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * remote.c, remote-pa.c: Remove #if 0'd icache code. It has had
+ no hope of working as is for a long time (in particular, shebs' 27
+ Jan 95 change confuses the issue further--target_read_memory and
+ xfer_core_file do *not* do the same thing in this context).
+ Revise comment.
+
+Sat Jan 28 13:40:46 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfread.c (elf_symtab_read): Do not test BSF_GLOBAL for
+ procedure linkage table symbols, it is no longer set due to the
+ Jan 6 BFD change in bfd/elfcode.h.
+
+Fri Jan 27 17:08:06 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.c (use_windows): Clarify comments.
+
+ * convex-tdep.c (xfer_core_file): Comment out.
+ * config/convex/tm-convex.h (XFER_CORE_FILE): Remove.
+ * remote.c, remote-pa.c (remote_fetch_word): Change xfer_core_file
+ references to target_read_memory.
+ * gdbcore.h (xfer_core_file, core_open, core_detach): Remove
+ declarations.
+ * corelow.c (core_open, core_detach): Make static.
+
+ * arm-tdep.c: Make it compile.
+ (exec_file_command, xfer_core_file): Comment out.
+ (arm_print_insn): Remove, now in libopcodes.
+ (skip_prologue): Comment out most of body.
+ (arm_frame_find_saved_regs): Move here from tm-arm.h.
+ (_initialize_arm_tdep): Set tm_print_insn.
+ * config/arm/tm-arm.h: Remove old refs to first_object_file_end.
+ (XFER_CORE_FILE): Remove.
+ (FRAME_FIND_SAVED_REGS): Call arm_frame_find_saved_regs.
+
+Fri Jan 27 08:48:28 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (CHILL_LIB): Define as in testsuite/Makefile.in.
+
+Thu Jan 26 18:24:41 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * symtab.c (find_pc_line): When subtracting one to get a line
+ number, make sure not to end up with zero.
+
+ * remote-vx.c: Revert all of Kung's changes of 16 Jan. The
+ problems with those changes were (a) the file didn't compile, (b)
+ they changed memset to bzero--memset is correct, (c) they took out
+ code to deal with boards lacking floating point, (d) who knows
+ what I didn't discover in a quick read.
+
+Thu Jan 26 17:32:54 1995 Stu Grossman (grossman@cygnus.com)
+
+ * sparcl-tdep.c: Clean up formatting and indentation.
+
+Thu Jan 26 10:49:59 1995 Steve Chamberlain <sac@splat>
+
+ * remote-hms.c (hms_ops): Change ref of hr_load_image
+ to gr_load_image.
+ (dcache_flush, dcache_hit, dcache_value, dcache_fetch,
+ dcache_poke, dcache_init): Deleted.
+ (hms_open, hms_resume, hms_fetch_word, hms_store_word):
+ Use dcache routines provided by remote-util.h
+
+Thu Jan 26 12:08:31 1995 Michael Meissner <meissner@cygnus.com>
+
+ * configure.in: Add support for powerpc-*-eabi.
+
+ * powerpc/tm-ppc-eabi.h, powerpc/pcc-eabi.mt: New files for
+ PowerPC support.
+
+Wed Jan 25 18:13:14 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * language.h (struct language_defn): New field c_style_arrays.
+ * language.c (unknown_language_defn, auto_language_defn,
+ local_language_defn), c-lang.c (c_language_defn, cplus_language_defn,
+ asm_language_defn): Set c_style_arrays to true.
+ * m2-lang.c (m2_language_defn), ch-lang.c (chill_language_defn),
+ f-lang.c (f_language_defn): Set c_style_arrays to false.
+ * valops.c (value_string): If c_style_array is not set,
+ allocate string in gdb (not inferior) using allocate_value.
+
+ * value.h (COERCE_ARRAY), valops.c (value_addr, value_arg_coerce):
+ Only call value_coerce_array if current_language->c_style_arrays.
+ * values.c: Add #include "language.h". (Needed for COERCE_ARRAY.)
+
+ * valops.c (chill_varying_type): New predicate.
+ * valops.c (value_cast): Support assigning a fixed string or array
+ to a variable string/array structure.
+
+ * valarith.c (value_subscripted_rvalue): Extra parameter lowerbound.
+ Check index>=lowerbound, and then add lowerbound to index here,
+ instead of in caller. Generalize to arbitrary lval_types.
+ (value_subscript): Use enhanced value_subscripted_rvalue if
+ c_style_arrays is false (and index is in range).
+
+
+Wed Jan 25 18:13:14 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * eval.c (evaluate_subexp case OP_ARRAY): Fix calls to memset:
+ TYPE_LENGTH is length in bytes, not bits.
+
+Wed Jan 25 08:19:35 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * infrun.c (proceed): Flush stdout before resuming inferior.
+ * infcmd.c (step_1), annotate.c (annotate_starting):
+ Don't bother to flush here.
+
+Wed Jan 25 01:11:21 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpread.c (hpread_process_one_debug_symbol): Fix lines garbled
+ by an ill-advised global search and replace.
+
+Mon Jan 23 13:11:46 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ Add support for Chill bitstring literals (e.h. H'FF00').
+ * ch-exp.y (match_bitstring_literal): Fix for proper endianness.
+ * expprint.c (print_subexp): Don't call error on OP_BITSTRING,
+ just print B'<unimlemented>'.
+ * gdbtypes.c (create_set_type): Fix bug in length calculation.
+ * valops.c, value.h (value_bitstring): New function.
+ * eval.c (evaluate_subexp): Implement support for OP_BITSTRING.
+
+ * ch-typeprint.c (chill_type_print_base): For TYPE_CODE_FUNC,
+ check that return type is non-void, and print in proper Chill syntax.
+
+Mon Jan 23 12:20:34 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * Makefile.in: Remove references to remote-mon.c.
+ * remote-mon.c: remove. Replaced by rom68k-rom.c.
+ * rom68k-rom.c: Support for Rom68k monitor.
+
+Mon Jan 23 10:50:57 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (CHILL_FOR_TARGET): Update -L argument to point to
+ gcc/ch/runtime not chillrt, since that is where the chill runtime
+ lives now.
+
+Mon Jan 23 00:06:57 1995 Steve Chamberlain <sac@splat>
+
+ * remote-hms.c (hms_load): Delete.
+ (target_ops): Use hr_load_image.
+
+ * remote-e7000.c, remote-z8k.c, remote-nindy.c (target_ops):
+ Define memory_insert/remove_breakpoint.
+ * xm-go32.h: Remove redundant SIGs.
+
+Thu Jan 19 20:26:58 1995 Steve Chamberlain <sac@splat>
+
+ * ser-go32.c: Rewritten by nigel@algor.co.uk.
+
+Fri Jan 20 15:23:55 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * expression.h (OP_LABELED): New operator, for Chill
+ labeled structre tuples.
+ * ch-exp.y (tuple_element, named_record_element, tuple_elements):
+ New non-terminals, to handle labeled structure tuples.
+ (tuple): Re-define using tuple_elements.
+ * eval.c (evaluate_labeled_field_init): New function, to handle
+ initialization of structure fields, possibly using OP_LABELED.
+ (evaluate_subexp): Use it.
+ * expprint.c (print_subexp case): For OP_ARRAY, use Chill syntax
+ for Chill. Handled OP_LABELED.
+ * parse.c (length_of_subexp, prefixify_subexp): Handle OP_LABELED.
+
+ * eval.c (evaluate_subexp): Handle Chill Powerset tuples.
+ * valarith.c (value_bit_index): Just treat bitstring as represented
+ by an array of bytes. Alignment is handled by compiler.
+
+Wed Jan 18 19:00:29 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * h8300-tdep.c (gdb_print_insn_h8300): Fix typo (&info -> info).
+ * sh-tdep.c (gdb_print_insn_sh): Ditto.
+
+Wed Jan 18 11:25:43 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * remote-os9k.c (rombug_open): Fix a bug in exception handling
+ command.
+ * remote-os9k.c (rombug_write_inferior_memory): reset buffer after
+ write.
+
+Tue Jan 17 09:48:38 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * parse.c (_initialize_parse): Improve wording of names of
+ msym_*_symbol_type.
+
+Tue Jan 17 14:00:58 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * config/mips/tm-mips.h (enum mips_fpu_type): New enum.
+ (mips_fpu): Change type to enum mips_fpu_type.
+ (FIX_CALL_DUMMY): Handle mips_fpu == MIPS_FPU_SINGLE.
+ * mips-tdep.c (mips_fpu): Change type to enum mips_fpu_type.
+ Don't initialize.
+ (mips_fpu_string): New static variable.
+ (mips_push_dummy_frame): Handle mips_fpu == MIPS_FPU_SINGLE.
+ (mips_pop_frame): Likewise.
+ (mips_extract_return_value): Likewise.
+ (mips_store_return_value): Likewise.
+ (mips_set_fpu_command): New static function.
+ (mips_show_fpu_command): New static function.
+ (_initialize_mips_tdep): Change handling of set/show mipsfpu.
+
+Tue Jan 17 09:48:38 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * a29k-tdep.c (gdb_print_insn_a29k): Fix typo (&info -> info).
+
+ * parse.c (write_exp_msymbol): Use new variables
+ msym_*_symbol_type as type of msymbol expression.
+ (_initialize_parse): Initialize them.
+
+Mon Jan 16 18:11:03 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ General cleanup and simplication of disassembler interface.
+ * a29k-pinsn.c, arm-pinsn.c, convex-pinsn.c, gould-pinsn.c,
+ hppa-pinsn.c, i386-pinsn.c, i960-pinsn.c, m68k-pinsn.c,
+ m88k-pinsn.c, mips-pinsn.c, ns32k-pinsn.c, pyr-pinsn.c,
+ rs6000-pinsn.c, sparc-pinsn.c, tahoe-pinsn.c, vax-pinsn.c: Remove.
+ * gould-tdep.c, ns32k-tdep.c, tahoe-tdep.c, vax-tdep.c: New files,
+ had been -pinsn.c files.
+ * Makefile.in (ALLDEPFILES): Remove removed files.
+ (a29k-pinsn.o, arm-pinsn.o, convex-pinsn.o, gould-pinsn.o,
+ hppa-pinsn.o, i386-pinsn.o, i960-pinsn.o, m68k-pinsn.o,
+ m88k-pinsn.o, mips-pinsn.o, ns32k-pinsn.o, pyr-pinsn.o,
+ rs6000-pinsn.o, sparc-pinsn.o, tahoe-pinsn.o, vax-pinsn.o):
+ Remove compile actions.
+ * arm-tdep.o, gould-tdep.o, ns32k-tdep.o, tahoe-tdep.o,
+ vax-tdep.o: Add compile actions.
+ * defs.h (tm_print_insn): New global.
+ * a29k-tdep.c (gdb_print_insn_a29k): New function.
+ (_initialize_a29k_tdep): Rename from _initialize_29k,
+ set tm_print_insn.
+ * alpha-tdep.c (print_insn): Remove.
+ (_initialize_alpha_tdep): Set tm_print_insn.
+ * arm-tdep.c (arm_print_insn): New function, was print_insn
+ in arm-pinsn.c.
+ * convex-tdep.c (convex_print_insn): New function, was print_insn
+ in convex-pinsn.c.
+ * h8300-tdep.c (print_insn): Remove.
+ (gdb_print_insn_h8300): New function.
+ (_initialize_h8300_tdep): New function.
+ * h8500-tdep.c (print_insn): Remove.
+ (_initialize_h8500_tdep): New function.
+ * hppa-tdep.c (_initialize_hppa_tdep): Set tm_print_insn.
+ * i386-tdep.c (_initialize_i386_tdep): New function.
+ * i960-tdep.c (mem, next_insn): New functions, were in
+ i960-pinsn.c.
+ (_initialize_i960_tdep): Set tm_print_insn.
+ * m68k-tdep.c (_initialize_m68k_tdep): New function.
+ * m88k-tdep.c (_initialize_m88k_tdep): New function.
+ * mips-tdep.c (gdb_print_insn_mips): New function.
+ (_initialize_mips_tdep): Set tm_print_insn.
+ * pyr-tdep.c (pyr_print_insn): New function, was print_insn
+ in pyr-pinsn.c.
+ * rs6000-tdep.c (_initialize_rs6000_tdep): New function.
+ * sh-tdep.c (print_insn): Remove.
+ (gdb_print_insn_sh): New function.
+ (_initialize_sh_tdep): Set tm_print_insn.
+ * sparc-tdep.c (_initialize_sparc_tdep): New function.
+ * w65-tdep.c (print_insn): Remove.
+ (_initialize_w65_tdep): New function.
+ * z8k-tdep.c (print_insn): Remove.
+ (gdb_print_insn_z8k): New function.
+ (_initialize_z8k_tdep): Set tm_print_insn.
+ * printcmd.c (print_insn): New function, generic disassembler.
+ * config/*/*.mt (TDEPFILES): Remove refs to *-pinsn.o.
+
+Mon Jan 16 15:43:29 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * Makefile.in: add new files remote-vx29k.c, config/a29k/tm-vx29k.h,
+ and config/a29k/vx29k.mt.
+ * configure.in: add new configuration a29k-*-vxworks.
+ * remote-vx29k.c: new file merged from WRS.
+ * remote-vx.c: merge changes from WRS.
+ * config/a29k/vx29k.mt: new file for new configuration.
+ * config/a29k/tm-vx29k.h: new header file for newconfiguration.
+
+Sun Jan 15 14:36:19 1995 Steve Chamberlain <sac@splat>
+
+ * breakpoint.h (disable_breakpoint, enable_breakpoint):
+ New declarations.
+ (enum bpdisp): Change name of 'delete' member to 'del'.
+ (struct bpstat): Changed name to 'bpstats'.
+ * breakpoint.c (disable_breakpoint, enable_breakpoint,
+ breakpoint_chain): Made globally visible.
+ (bpstat_stop_status): Use new name for bpstat.
+ (break_command_1, watch_command_1, catch_command_1,
+ breakpoint_auto_delete, denable_delete_breakpoint): Use 'del'
+ instead of 'delete'.
+ (set_breakpoint_sal): New function.
+ * defs.h (registers_changed_hook): New declaration.
+ * infcmd.c (run_stack_dummy): 'delete' is now 'del'.
+ * inflow.c (new_tty): Treat WIN32 in same way as __GO32__
+ * main.c (main): Don't scan options when in WIN32 and exit
+ without entering main loop.
+ * m2-exp.y (m2_elx): Member 'class' is now 'aclass'.
+ * symtab.h (struct symbol, struct partial_symbol): Changed name of
+ member 'class' to 'aclass'.
+ (SYMBOL_CLASS, PSYMBOL_CLASS): Reflect change.
+ * top.c (registers_changed_hook): New definition.
+ * utils.c (quit, notice_quit, initialize_utils): Treate WIN32
+ in same way as __GO32__.
+ * value.h (c_typedef_print): Rename 'new' argument.
+
+ * w65-tdep.c, config/tm-w65.h, config/w65.mt: New files.
+ * configure.in: Suppprt for w65,
+
+
+Sat Jan 14 11:18:11 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * infcmd.c (signal_command): For "signal 0", pass (CORE_ADDR)-1,
+ not stop_pc, to proceed.
+
+ * eval.c (evaluate_subexp): Clear expect_type except for C++ and CHILL.
+
+Fri Jan 13 17:52:57 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * infcmd.c (signal_command): Accept "signal 0"; the change to not
+ accept it was accidental. "handle 0" and "info signal 0" remain
+ illegal, though.
+
+Fri Jan 13 15:19:01 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (all): Don't make libgdb-files.
+ (libgdb): New action, makes libgdb-files.
+
+Thu Jan 12 21:23:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * stabsread.c (read_enum_type): When pending enum symbols are
+ put into the enum type, they must be inserted in "backwards
+ order, in case we've overflowed a struct pending buffer.
+
+
+Thu Jan 12 09:33:24 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * README: Add note about SPARCworks cc release 3.0 and higher.
+
+ Add procfs support for Alpha OSF/1-2.x.
+ * config/alpha/nm-osf.h: Renamed from nm-alpha.h, generic
+ OSF/1 native support.
+ * config/alpha/alpha-osf1.mh (NAT_FILE): Changed accordingly.
+ (MUNCH_DEFINE): Removed.
+ * config/alpha/alpha-osf2.mh, config/alpha/nm-osf2.h: New files
+ for procfs support.
+ * configure.in (alpha-dec-osf*): Use alpha-osf2.mh for OSF/1
+ release 2.x and higher, else alpha-osf1.mh, as the procfs support
+ in release 1.x is incomplete.
+ * Makefile.in (ALLCONFIG): Add config/alpha/alpha-osf2.mh.
+ * alpha-nat.c (supply_gregset, fill_gregset, supply_fpgregset,
+ fill_fpgregset): New routines for procfs support.
+ * inftarg.c (_initialize_inftarg): Don't add ptrace support
+ if we have an optional procfs and /proc is accessible.
+ * procfs.c: Include sys/fault.h and sys/syscall.h before
+ including sys/procfs.h.
+ (unconditionally_kill_inferior): If PROCFS_NEED_PIOCSSIG_FOR_KILL
+ is defined, additionally perform a PIOCSSIG to really terminate
+ the inferior.
+ (create_procinfo): Always return a result.
+ (create_procinfo, do_attach): Don't trace T_IFAULT faults if
+ PROCFS_DONT_TRACE_IFAULT is defined.
+ (procfs_init_inferior): Use START_INFERIOR_TRAPS_EXPECTED as
+ argument to startup_inferior if it is defined.
+ (proc_set_exec_trap): If PIOCSSPCACT is defined, use it instead
+ of tracing exits from exec system calls. Needed for the user level
+ loader under Alpha OSF/1.
+ (do_detach): Clear any pending signal if we want to detach from
+ a process without a signal.
+ (set_proc_siginfo): If PROCFS_DONT_PIOCSSIG_CURSIG is defined,
+ don't issue a PIOCSSIG if pr_cursig already contains the signal we
+ intend to set.
+ (info_proc_signals): If PROCFS_SIGPEND_OFFSET is defined, the
+ pending signals are numbered from 1 instead of 0.
+ (info_proc_mappings): Increase size of output format for addresses
+ if BFD_HOST_64_BIT is defined.
+ (procfs_stop): Renamed from child_stop.
+ (_initialize_procfs): Don't add procfs support if we have an
+ optional procfs and /proc is not accessible.
+
+
+Wed Jan 11 17:53:26 1995 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * array-rom.c: Add support for most commands.
+
+ * monitor.c: Add GDB remote protocol for the hybrid environment on
+ the Array board.
+
+Wed Jan 11 00:44:01 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * command.c (show_user_1): Use print_command_line to show a user
+ defined command (including control structures).
+
+ * top.c (init_main): Change documentation for user defined
+ commands to indicate they may accept up to ten arguments.
+
+Tue Jan 10 16:22:41 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * mips-tdep.c (mips_skip_prologue): Accept or as well as addu for
+ `move $s8, $sp' instruction.
+
+Sun Jan 8 12:45:34 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * target.c, target.h (target_signal_from_command): New function.
+ * infrun.c (handle_command, signals_info), infcmd.c
+ (signal_command): Use it.
+ * infrun.c, infcmd.c: Update docstrings for these commands.
+
+ * target.h (enum target_signal), target.c (signals), target.c
+ (target_signal_from_host, target_signal_to_host): Add
+ TARGET_SIGNAL_REALTIME_* and TARGET_SIGNAL_PRIO for lynx.
+ * config/tm-lynx.h: Define signal numbers for realtime events.
+
+Sat Jan 7 07:23:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dbxread.c (process_one_symbol): Handle N_FUN symbols
+ for Sun acc 3.0 under SunOS4.
+
+ Changes to improve handling of runtime common symbols
+ under SunOS4.
+ * minsyms.c (get_symbol_leading_char): New routine to determine
+ the leading symbol character for an objfile.
+ (prim_record_minimal_symbol_and_info, install_minimal_symbols):
+ Use it.
+ * objfiles.h (rt_common_objfile): New global, points to objfile
+ containing the runtime common minimal symbols.
+ * objfiles.c (free_objfile): Mark rt_common_objfile as
+ unallocated before freeing it.
+ * solib.c (allocate_rt_common_objfile): New routine to allocate
+ an objfile for the runtime common minimal symbols.
+ (solib_add_common_symbols): Allocate an objfile for the runtime
+ common symbols if necessary and put common symbols into it.
+ Clean up code and comments.
+ (solib_add, special_symbol_handling): Cleanup comments regarding
+ runtime common symbols.
+ * stabsread.c (scan_file_globals_1): New routine, contains
+ old scan_file_globals code. Checks if there are any unresolved
+ global symbols before starting the expensive minimal symbol table
+ search.
+ (scan_file_globals): Now calls scan_file_globals_1 for the passed
+ objfile and eventually for the runtime common objfile. Complains
+ about any unresolved global symbols and removes them from the
+ global symbol chain to avoid dangling pointers into the symbol
+ table if the symbol table is reread.
+
+Thu Jan 5 17:38:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (install_only uninstall): Indent for clarity.
+
+ * core.c (dis_asm_read_memory): Add call to
+ dis_asm_read_memory_hook to provide alternate way for disassembler
+ to read memory.
+
+ * defs.h: Protect from multiple inclusion. Add decl for
+ dis_asm_read_memory_hook.
+
+ * top.c: Make window startup be the default.
+ * Add dis_asm_read_memory_hook.
+
+
+Thu Jan 5 01:16:40 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * stabsread.c (define_symbol): Handle `a' symbol type used for
+ reference parameter passed in a register.
+
+
+Wed Jan 4 12:27:29 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * defs.h: move include tm.h up, so that the type LONGEST can
+ also based on the target requirement to determine. In this case
+ target mips64.
+
+ * remote-os9k.c (rombug_open): catch exception e in rombug.
+ * remote-os9k.c (rombug_wait): print message before register display
+ from rombug.
+
+Wed Jan 4 09:18:27 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * top.c (locate_arg): Call strchr not index.
+
+Tue Jan 3 16:52:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.y (literal): Recognize NULL.
+ (tuple): Parse simple unlabelled tuples.
+ * eval.c (evaluate_subexp case OP_ARRAY): Use expect_type to
+ evaluate brace-initializer-expressions depending on context.
+ (evaluate_subexp case UNOP_CAST): Pass the target type as
+ expected type when evaluating the expression.
+
+ * ch-typeprint.c (chill_type_print_base): Get names of PTR and
+ BOOL from TYPE_NAME.
+ * ch-valprint.c (chill_print_type_scalar): New function, to handle
+ TYPE_CODE_RANGE better than print_type_scalar does.
+ (chill_val_print_array_elements): Use above new function.
+
+Mon Jan 2 15:02:51 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-udi.c (udi_load): Tell symbol_file_add that the
+ program being loaded is the main program.
+
+For older changes see ChangeLog-1994
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1996 b/contrib/gdb/gdb/ChangeLog-1996
new file mode 100644
index 0000000..442386f
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1996
@@ -0,0 +1,5116 @@
+Tue Dec 31 15:19:32 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mn10300/tm-mn10300.h: more small register fixes
+
+Tue Dec 31 06:51:43 1996 Mark Alexander <marka@cygnus.com>
+
+ * config/i386/xm-windows.h: Undo previous change to SIGTRAP
+ and SIGQUIT values; it messed up non-MIPS targets.
+ * config/mips/tm-mips.h: Undefine BREAKPOINT, replace
+ with separate LITTLE_BREAKPOINT and BIG_BREAKPOINT definitions;
+ this fixes problem with setting breakpoints in little-endian
+ programs in the simulator.
+
+Mon Dec 30 00:14:06 1996 Doug Evans <dje@seba.cygnus.com>
+
+ * remote-sim.c (gdbsim_open_p): New static local.
+ (gdbsim_open): Call unpush_target if sim open. Set gdbsim_open_p.
+ (gdbsim_close): Only call sim_close if sim open. Reset gdbsim_open_p.
+
+Sun Dec 29 09:15:03 1996 Mark Alexander <marka@cygnus.com>
+
+ * config/i386/xm-windows.h: Make SIGTRAP and SIGQUIT consistent
+ with sim/mips/support.h.
+
+Fri Dec 27 14:53:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850-tdep.c (struct pifsr): Add cur_frameoffset field.
+ (v850_scan_prologue): Add debug code #ifdef'ed DEBUG. Support new
+ compiler prologues using register save functions and short store
+ instructions. Add support for functions with large stack frames.
+
+ * config/v850/tm-vm850.h ({R0,R1,R12,EP}_REGNUMS): New register
+ number defintiions for r0, r1, r12, ep.
+ (SAVE{1,2,3}_{START,END}_REGNUM): Register number definitions for
+ the 3 sets of saved registers.
+
+Thu Dec 26 19:56:55 1996 Mark Alexander <marka@cygnus.com>
+
+ * valprint.c (print_longest): Don't lose upper bits
+ of 64-bit values on Windows.
+ * config/i386/xm-windows.h: Leave CC_HAS_LONG_LONG defined,
+ undefine PRINTF_HAS_LONG_LONG, so that 64-bit values will
+ be printed without loss of upper bits.
+
+Thu Dec 26 15:15:21 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/sparc/tm-sparclet.h: make registers ASR15, ASR19 invisible
+ (they're not useful, you can't change, write or even read them)
+
+Thu Dec 26 15:20:48 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/pa/hppahpux.mh (TERMCAP): Always link to libc before
+ libcurses, to avoid picking up broken select() from libcurses
+ on some versions of HPUX.
+
+Thu Dec 26 15:14:41 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sparclet-rom.c: Remove includes of Unix system files.
+ Add function "sparclet_supply_register" so that parse_register_dump
+ will not seg-fault by calling a null function pointer.
+ Remove XMODEM support (unfinished work?).
+ Remove flag "MO_HANDLE_NL", so monitor's output can be read by humans.
+ Add fill command.
+ Remove colon from getreg.resp_delim so PSR register will work.
+ Remove pointer to sparclet_load (downloading SREC's doesn't work).
+ Null out local register names for %g0, all %cc and all %asr regs,
+ since the monitor can't report them. Will return zero instead.
+ * sparclet-stub.c: New -- remote protocol support for sparclet CPU.
+ * config/sparc/tm-sparclet.h: Re-arrange REGISTER_NAMES:
+ Add back %g0 and %psr, add %cc coprocessor regs, add %asr regs.
+ Adjust NUM_REGS and REGISTER_BYTES accordingly
+
+Tue Dec 24 10:27:37 1996 Jeffrey A Law (law@cygnus.com)
+
+ * remote-e7000.c (want_h8300h, want_nopc_h8300h): Renamed
+ from want and want_nopc.
+ (want_h8300s, want_nopc_h8300s): New variables for H8/S register
+ lists.
+ (e7000_fetch_registers): Use H8/300H or H8/S register list string
+ as needed.
+ (e7000_wait): Likewise.
+
+Mon Dec 23 02:25:58 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (mips_find_saved_regs): If a frame has been
+ interrupted by a signal, figure out whether the registers that
+ the proc_desc claims are saved have been saved yet.
+ (mips_push_dummy_frame): Write dummy frame register after all
+ registers have been saved in the dummy frame. Update comments
+ to reflect the fact that we are now using an AT_ENTRY_POINT
+ call dummy.
+
+Sun Dec 22 15:52:25 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c (d10v_skip_prologue): PR11287. Fix problem where
+ some breakpoints weren't being set.
+
+Sat Dec 21 12:57:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/tm-mips.h (PC_IN_CALL_DUMMY): Removed, the default
+ definition in inferior.h is sufficient.
+ * mips-tdep.c (mips_pc_in_call_dummy): Ditto.
+ (mips_push_arguments): Make sure that the stack is aligned to a
+ multiple of 8 after the arguments are pushed.
+ Structures are always passed by value in the old ABI.
+ Adjust argument register value on big endian targets when passing
+ a value whose length is less than the register size.
+ Write stack arguments with a single write_memory call.
+ (mips_pop_frame): Use frame_saved_regs instead of proc_desc to
+ decide which registers have to be restored.
+
+ * irix5-nat.c (fill_gregset): Sign extend registers before
+ filling in the gregset structure.
+
+Fri Dec 20 11:06:03 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * mswin/genmakes: Don't define _DEBUG. This breaks wingdb.
+
+Thu Dec 19 19:42:44 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850-tdep.c (v850_scan_prologue): Deal with -mep shorting
+ register saves by using the ep register.
+
+Thu Dec 19 15:57:16 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-tdep.c (m32r_frame_find_saved_regs): Fix thinko in arg def.
+
+Thu Dec 19 09:38:56 1996 Mark Alexander <marka@cygnus.com>
+
+ * values.c (unpack_double): Make it compile with MSVC++ 2.x.
+ * remote-mips.c (S_IROTH): Define if not defined by stat.h, e.g.
+ when using MSVC++.
+ (common_open): Fix help string.
+
+Wed Dec 18 23:01:32 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Use NewFolderRecursive for installation.
+
+Sat Dec 14 20:50:01 1996 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Handle floating point args.
+ * config/mips/tm-mips.h (FIX_CALL_DUMMY): Define to set up $25
+ correctly for PIC on Irix 5.
+
+Sat Dec 14 09:52:30 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * i386-tdep.c (i386_frame_find_saved_regs): Handle zero return
+ from get_pc_function_start gracefully.
+
+Sat Dec 14 00:43:57 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-exp.y (qualified_name): Replace explicit check for valid
+ destructor name with call to destructor_name_p.
+
+ * c-lang.h, c-typeprint.c (cp_type_print_method_args): Removed,
+ no longer needed.
+
+ * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_base):
+ Replace remaining fprintf_unfiltered calls with their filtered variant.
+ (c_type_print_base): Do not print return type for destructors from
+ template classes.
+ Replace cp_type_print_method_args with cplus_demangle call to get
+ consistent type output for stubbed and unstubbed methods.
+
+ * cp-valprint.c (cp_print_class_method): Replace
+ cp_type_print_method_args with cplus_demangle call to get consistent
+ type output for stubbed and unstubbed methods.
+
+ * gdbtypes.c, gdbtypes.h (get_destructor_fn_field): New function
+ to find the destructor field indices for a type.
+
+ * gdbtypes.h (struct type): Clarify comments for vptr_basetype
+ and arg_types fields.
+ (struct fn_field): Remove args field, no longer used.
+
+ * symtab.c (decode_line_1), valops.c (value_struct_elt,
+ check_field_in): Use get_destructor_fn_field to find the destructor
+ field indices instead of assuming that the compiler passes the member
+ function fields in a specific order.
+
+ * symtab.c (find_methods): Pass NULL instead of SYMBOL_BLOCK_VALUE
+ to lookup_symbol.
+ (list_symbol): Replace cp_type_print_method_args with cplus_demangle
+ call in zapped out code and explain why this code is zapped out.
+
+Thu Dec 12 13:29:14 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/ppc{,le}-sim.mt (SIM): Add the simulator common
+ library ../sim/common/libcommon.a.
+
+Wed Dec 11 11:15:08 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * monitor.c (monitor_load): Add support for load address argument.
+ * dsrec.c: #include <time.h>.
+ (load_srec): New argument load_offset. Print download stats.
+ * srec.h (load_srec): Update prototype.
+ * sh3-rom.c (sh3_load): Update call to load_srec.
+
+Mon Dec 9 17:34:05 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mn10300/tm-mn10300.h: more small register fixes
+ * mn10300-tdep.c: filled in from another target
+
+Mon Dec 9 17:12:19 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * monitor.c (monitor_insert_breakpoint): Handle bi-endian machines.
+
+Mon Dec 9 15:58:51 1996 Mark Alexander <marka@cygnus.com>
+
+ * config/mips/tm-mips.h: Get rid of call-dummy code.
+ Minor changes to make pre-ANSI compilers happy.
+ * mips-tdep.c: Minor changes to make pre-ANSI compilers happy.
+ (mips_push_arguments): Rewrite to partially support EABI.
+ (mips_pc_in_call_dummy): New function.
+ * infcmd.c: Include symfile.h to get prototype of entry_point_address,
+ which fixes 64-bit sign extension bug on MIPS.
+
+Mon Dec 9 00:14:49 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mn10300/tm-mn10300.h: fix register names
+ * mn10300-tdep.c: new skeleton tdep for mn10300
+
+Sun Dec 8 18:02:57 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.h: Update some comments.
+ * remote-sim.c (gdb_os_error): New function.
+ (init_callbacks): Fix initializing of gdb_callback. Add gdb_os_error.
+ (gdb_os_printf_filtered): Use gdb_stdout, not stdout.
+
+Sun Dec 8 00:36:31 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * irix5-nat.c (supply_gregset, fill_gregset): Handle gregsets
+ from O32 and N32 ABI.
+ (xfer_link_map_member): Work around problem with alignments
+ in struct obj when compiling GDB under N32 ABI.
+
+Thu Dec 5 23:30:44 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * d10v-tdep.c: Add support for examination and interpretation
+ of instruction trace buffer.
+ (trace, untrace, info trace, tdisassemble): New commands.
+
+Thu Dec 5 14:06:23 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER): Undef.
+ (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ (BREAKPOINT): Undef.
+ ({BIG,LITTLE}_BREAKPOINT): Define.
+ (TM_PRINT_INSN_MACH): Redefine for sparclet.
+
+Wed Dec 4 16:34:05 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mn10300/mn10300.mt, config/mn10300/tm-mn10300.h: New.
+
+Tue Dec 3 13:02:08 1996 Fred Fish <fnf@ninemoons.com>
+
+ * infptrace.c (store_inferior_registers): Move some common code out
+ to store_register, like fetch_inferior_registers & fetch_register.
+ (store_register): New function, from store_inferior_registers.
+ (fetch_inferior_registers, fetch_register): Minor code tweaks to
+ make {fetch,store}_inferior_registers and {fetch,store}_register
+ routines as similar in structure as possible.
+ (fetch_inferior_registers, store_inferior_registers): Eliminate
+ local variable numregs and just use ARCH_NUM_REGS directly.
+
+Tue Dec 3 11:38:14 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c: add macro USE_GENERIC_DUMMY_FRAMES to enable/disable
+ code for generic call_dummy frames.
+ * config/h8300/tm-h8300.h: turn on USE_GENERIC_DUMMY_FRAMES
+ * config/m32r/tm-m32r.h: Ditto.
+ * config/sh/tm-sh.h: Ditto.
+ * config/v850/tm-v850.h: Ditto.
+
+Sun Dec 1 00:41:47 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * vax-tdep.c (vax_print_insn, print_insn_arg): Use info functions
+ for printing. From Valeriy Ushakov <uwe@ptc.spbu.ru>.
+
+Sun Dec 1 00:40:46 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.tgt: Add new mn10300 entry.
+
+Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Add support for Irix 6.2 native O32 and N32 ABI.
+
+ * config.in, configure.in, configure: Check for <objlist.h>.
+ * configure.tgt: Handle mips*-sgi-irix6* like irix5 for now.
+
+ * cp-valprint.c (cp_print_value_fields): Use SYMBOL_VALUE_ADDRESS
+ instead of SYMBOL_BLOCK_VALUE to get the address of a static member.
+
+ * dwarf2read.c: Turn warnings and recoverable errors into complaints,
+ add new complaints where appropriate.
+ gcc -Wall cleanup.
+ (struct line_head): Change line_base from char to int to avoid
+ problems with compilers whose plain char is represented by an
+ unsigned char.
+ (struct partial_die_info): Add is_declaration field.
+ (dwarf2_tmp_obstack): New obstack for allocating temporary storage
+ used during symbol reading.
+ (cu_header_offset): New variable for resolving relative reference
+ dies.
+ (optimized_out, basereg, islocal, frame_base_reg, frame_base_offset):
+ New interface variables for decode_locdesc.
+ (struct dwarf2_pinfo): New structure for communication between
+ psymtab and symtab reading, passed via pst->read_symtab_private.
+ (dwarf2_has_info, dwarf2_build_psymtabs): Accept objects files
+ without line number sections.
+ (dwarf2_build_psymtabs_hard): Initialize temporary obstack
+ for symbol reading.
+ Allocate and initialize pst->read_symtab_private.
+ Relocate pst->textlow and pst->texthigh with baseaddr.
+ (scan_partial_symbols): Do not add DW_AT_declaration symbols
+ to the partial symbol table.
+ Add file scope enumerator symbols to the partial symbol table.
+ Fix typo in highpc computation.
+ If we didn't find a lowpc, set it to highpc to avoid complaints
+ from `maint check.
+ (add_partial_symbol): Relocate symbol values with baseaddr.
+ Add static DW_TAG_subprogram and DW_TAG_variable symbols to the
+ minimal symbol table.
+ Obtain symbol values for DW_TAG_variable symbols from the location
+ descriptor, skip symbols with missing location desciptors.
+ Skip symbols for aggregate types without children.
+ Handle enumerator symbols.
+ (dwarf2_psymtab_to_symtab): Issue symbol reading message if verbose.
+ (psymtab_to_symtab_1): Set local variables from
+ pst->read_symtab_private, set cu_header_offset and baseaddr.
+ Initialize temporary obstack for symbol reading, initialize
+ buildsym and add a cleanup to really_free_pendings.
+ Relocate highpc with baseaddr when calling end_symtab.
+ If the compilation is from a C file generated by language
+ preprocessors, do not set the symtab language if it was already
+ deduced by start_subfile.
+ Removed verbose sorting symbol table message.
+ (process_die): Handle DW_TAG_ptr_to_member_type and
+ DW_TAG_reference_type.
+ Use read_subroutine_type to get the function type for
+ DW_TAG_subprogram before calling read_func_scope.
+ (read_file_scope): Initialize file name to <unknown>, start_subfile
+ expects a non-NULL name.
+ If we didn't find a lowpc, set it to highpc to avoid complaints
+ from finish_symbol.
+ Relocate lowpc and highpc with baseaddr.
+ Get rid of Irix6.2 native cc compile machine prefix in comp_dir.
+ Zero out ftypes for each new compilation unit (may be different
+ language or different objfile).
+ Accept compilation units without line number information, pass
+ comp_dir to decode_lines.
+ (read_func_scope): Initialize function name to <unknown> to avoid
+ core dumps when DW_AT_name is missing.
+ Relocate lowpc and highpc with baseaddr.
+ Handle DW_AT_frame_base, keep result for DW_OP_fbreg operations.
+ Pass function type to new_symbol.
+ (read_lexical_block_scope): Relocate lowpc and highpc with baseaddr.
+ (read_structure_scope): Set TYPE_TAG_NAME, not TYPE_NAME.
+ Handle DW_TAG_class_type.
+ Copy fields to type_obstack, release temporary storage for fields.
+ Don't add symbol if die is a stub die and has no children.
+ Handle C++ static member fields.
+ (read_enumeration): Set TYPE_TAG_NAME, not TYPE_NAME.
+ Copy fields to type_obstack, release temporary storage for fields.
+ Let new_symbol handle the symbol creation for enumerators
+ instead of handcrafting a symbol.
+ Determine signedness of enum type from enumerators.
+ (dwarf_read_array_type): Handle variable length arrays.
+ Use lookup_pointer_type instead of handcrafting a type.
+ Create array type only if a DW_TAG_subrange_type was found.
+ (read_tag_pointer_type, read_tag_reference_type):
+ Use lookup_pointer_type and lookup_reference_type instead
+ of handcrafting a type.
+ (read_tag_ptr_to_member_type): New function to handle
+ DW_TAG_ptr_to_member_type.
+ (read_subroutine_type): Handle parameter dies.
+ Use lookup_function_type instead of handcrafting a type.
+ (read_typedef): Allocate a TYPE_CODE_TYPEDEF type for the typedef.
+ (read_base_type): If the type has a name, use init_type to create
+ a new type instead of second guessing a fundamental type.
+ (read_comp_unit): Reset die reference table before building
+ a new one.
+ (dwarf2_read_section): Read section contents into psymbol_obstack.
+ (dwarf2_read_abbrevs): Handle unterminated abbreviations
+ for a compile unit gracefully.
+ (read_partial_die): Zero partial die before reading its info.
+ Handle DW_AT_declaration.
+ Fix typo in handling of DW_FORM_block4.
+ (read_full_die): Fix typo in handling of DW_FORM_block4.
+ (read_1_signed_byte, read_2_signed_bytes, read_4_signed_bytes):
+ New routines to get signed values from a buffer.
+ (read_n_bytes, read_string): Allocate storage from the temporary
+ obstack. If the host char size permits it, return pointer
+ to buffer instead of allocating storage.
+ (set_cu_language): Handle DW_LANG_Mips_Assembler.
+ (dwarf_attr): Return NULL if reference die for DW_AT_specification
+ or DW_AT_abstract_origin die is not found.
+ (record_minimal_symbol): Removed, replaced with a direct call to
+ prim_record_minimal_symbol, it now handles saving the string itself.
+ (convert_locdesc): Removed, partial symtab reading now uses
+ decode_locdesc.
+ (dwarf_attr): Use dwarf2_get_ref_die_offset to get the absolute
+ offset for the die reference.
+ (dwarf_decode_lines): Complain if the line section info is missing.
+ Use read_1_signed_byte to extract lh.line_base to avoid
+ problems with compilers whose plain char is represented by an
+ unsigned char.
+ Add cleanups for allocated temporary storage.
+ Start a subfile for the first file in the state machine.
+ Fix off by one problem with dirs.dirs access.
+ Use comp_dir when directory index is 0.
+ Support multiple sequences (from Jason Merrill <jason@cygnus.com>).
+ (dwarf2_start_subfile): Try to keep line numbers from identical
+ absolute and relative file names in a common subfile.
+ (new_symbol): Allocate symbol and symbol name on the symbol_obstack.
+ Set SYMBOL_LINE from DW_AT_decl_line if present.
+ Set SYMBOL_TYPE from passed type if not NULL.
+ Change DW_TAG_variable symbol types with missing type entries
+ to a sensible type.
+ Handle optimized_out, offreg and islocal storage classes.
+ Add external symbols with type information whose address isn't
+ known as LOC_UNRESOLVED symbols.
+ Synthesize typedefs for C++ classes, structs, unions and enumerations.
+ Handle DW_TAG_enumerator symbols, complain for unrecognized
+ symbol tags.
+ (die_type): A missing DW_AT_type represents a void type.
+ Use dwarf2_get_ref_die_offset to get the absolute offset for
+ the die reference.
+ (die_containing_type): New function to build type from
+ DW_AT_containing_type attribut.
+ (read_type_die): Handle DW_TAG_ptr_to_member_type.
+ Treat DW_TAG_subprogram like DW_TAG_subroutine_type.
+ (dwarf_base_type): Fix typo with creation of FT_UNSIGNED_SHORT
+ fundamental type.
+ (create_name): Removed, symbol name allocation is now done
+ in new_symbol.
+ (dump_die): Use print_address_numeric to print a CORE_ADDR.
+ (dwarf2_empty_die_ref_table): New function to clear the die
+ reference table.
+ (dwarf2_get_ref_die_offset): New function to get the absolute
+ die offset from a die reference attribute.
+ (decode_locdesc): Complete rewrite using a stack, code mostly
+ borrowed from dwarfread.c:locval.
+ (dwarf_alloc_type): Removed, replaced by direct calls to alloc_type.
+ (dwarf_alloc_block): Allocate block on temporary obstack.
+
+ * elfread.c (elf_symtab_read): When handling Irix dynamic symbols,
+ skip section name symbols and relocate all others.
+ (elf_symfile_read): Build dwarf2 psymtab even if offset is non-zero.
+
+ * irix5-nat.c (fetch_core_registers): Handle core_reg_sect
+ from N32 executables. Call registers_fetched after extracting
+ the registers.
+ (obj_list_variant, struct link_map, LM_OFFSET, LM_ADDR): New
+ definitions to enable support of O32 and N32 format objlists.
+ (struct so_list): New members offset, so_name and lmstart to
+ eliminate dependencies from the objlist format used.
+ (solib_map_sections, symbol_add_stub, solib_add,
+ info_sharedlibrary_command, solib_address, clear_solib): Use
+ so_name and LM_OFFSET.
+ (first_link_map_member): Rewrite to enable support of O32 and N32
+ format objlists.
+ (next_link_map_member, xfer_link_map_member): New functions to
+ support O32 and N32 format objlists.
+ (find_solib): Use first_link_map_member, next_link_map_member and
+ xfer_link_map_member.
+ (solib_create_inferior_hook): Use TARGET_SIGNAL_* instead of
+ host signal numbers.
+
+ * mdebugread.c (parse_partial_symbols, handle_psymbol_enumerators):
+ Pass CORE_ADDR variant to add_psymbol_to_list.
+
+ * mips-tdep.c (heuristic_proc_desc): Stop examining the prologue
+ if we encounter a positive stack adjustment. Handle `move $30,$sp'.
+ Handle `sd reg,offset($sp)' for 32 bit ABIs.
+
+ * symmisc.c (dump_msymbols, print_partial_symbols): Use
+ print_address_numeric to print a SYMBOL_VALUE_ADDRESS.
+ (dump_symtab): Print compilation directory if it is not NULL.
+
+ * valops.c (search_struct_field, value_struct_elt_for_reference):
+ Use SYMBOL_VALUE_ADDRESS instead of SYMBOL_BLOCK_VALUE to get the
+ address of a static member.
+
+Thu Nov 28 00:46:24 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * vax-tdep.c (vax_print_insn): Made static, modified to take
+ disassemble_info as parameter.
+ (_initialize_vax_tdep): New function to initialize tm_print_insn
+ to vax_print_insn.
+
+Wed Nov 27 11:29:06 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c: Remove old-style CALL_DUMMY code.
+ * h8300-tdep.c, config/h8300/tm-h8300.h: Ditto.
+ * m32r-tdep.c, config/m32r/tm-m32r.h: Ditto.
+ * sh-tdep.c, config/sh/tm-sh.h: Ditto.
+ * v850-tdep.c, config/v850/tm-v850.h: Ditto.
+
+Wed Nov 27 10:32:14 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.c: DELETE command will not delete CALL_DUMMY breakpoint.
+ * blockframe.c: Add target-independant support for managing
+ CALL_DUMMY frames on the host side.
+ * frame.h: Declarations for generic CALL_DUMMY frame support.
+ * h8300-tdep.c: Add target function calls using generic frame support.
+ * config/h8300/tm-h8300.h: config for generic target function calls.
+ * m32r-tdep.c: Add target function calls using generic frame support.
+ * config/m32r/tm-m32r.h: config for generic target function calls.
+ * sh-tdep.c: Add target function calls using generic frame support.
+ * config/sh/tm-sh.h: config for generic target function calls.
+ * v850-tdep.c: Add target function calls using generic frame support.
+ * config/v850/tm-v850.h: config for generic target function calls.
+ * valops.c: ADD PUSH_RETURN_ADDRESS so that it doesn't have to be
+ done by PUSH_ARGUMENTS when there's no CALL_DUMMY.
+
+Tue Nov 26 19:21:35 1996 Mark Alexander <marka@cygnus.com>
+
+ * config/mips/tm-mips.h (ADDR_BITS_REMOVE, TARGET_READ_SP): Define.
+ (mips_addr_bits_remove): Declare.
+ * mips-tdep.c (mips_push_dummy_frame): Fix heuristic-fence-post
+ errors when hitting breakpoints during inferior function calls
+ in 64-bit programs.
+ (fix_sign_extension): Make public, rename to mips_addr_bits_remove.
+ * utils.c (paddr_nz, preg_nz): New functions, similar to
+ paddr and preg but don't print leading zeroes.
+ * defs.h (paddr_nz, preg_nz): Declare.
+ * remote-mips.c: Use paddr_nz instead of paddr throughout
+ to reduce packet size.
+ (pmon_end_download): Improve timeout error handling.
+
+Tue Nov 26 17:21:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.12.
+
+Mon Nov 25 13:17:16 1996 Fred Fish <fnf@ninemoons.com>
+
+ From: Paul Eggert <eggert@twinsun.com>
+ * remote-bug.c (wait_strings): Avoid creating a trigraph.
+
+Fri Nov 22 15:55:22 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * valops.c (value_at, value_fetch_lazy): Put in D10V call
+ to fix up address pointers.
+ * values.c (value_from_longest): Removed previous d10v changes.
+ * config/d10v/tm-d10v.h (TARGET_PTR_BIT): Change to 4 bytes.
+
+Fri Nov 22 10:06:19 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/i386/nm-i386v4.h (LOSING_POLL): Define, needed for
+ Unixware 1.1.2.
+
+Thu Nov 21 19:13:58 1996 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c: Replace hard-coded constants with MIPS_INSTLEN.
+ (common_breakpoint): Use paddr instead of %x to print 64-bit values.
+ (heuristic_proc_desc): Add tests for 64-bit instructions.
+ (init_extra_frame_info, mips_push_arguments): Recognize additional
+ registers for EABI.
+ * remote-mips.c: Extend DDB target to allow TFTP downloads.
+ * config/mips/tm-mips.h (MIPS_LAST_ARG_REGNUM, MIPS_NUM_ARG_REGS):
+ Define.
+
+Wed Nov 20 19:09:16 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * infcmd.c (do_registers_info): Call val_print with the
+ virtual buf instead of the raw buf. Needed for REGISTER_CONVERT
+ to work with non-floating point regs.
+
+ * d10v-tdep.c (d10v_skip_prologue): If we have line debugging
+ information, then the end of the prologue should the first
+ assembly instruction of the first source line.
+
+ * values.c (value_from_longest): Put in D10V call to
+ fix up address pointers.
+
+ * config/d10v/tm-d10v.h (REGISTER_VIRTUAL_SIZE): Modified.
+ (REGISTER_VIRTUAL_TYPE): Modified for PC_REGNUM and SP_REGNUM.
+ (REGISTER_CONVERTIBLE): Make PC and SP convertible.
+ (REGISTER_CONVERT_TO_VIRTUAL): Define.
+ (REGISTER_CONVERT_TO_RAW): Define.
+ (D10V_MAKE_DADDR): Define.
+ (D10V_MAKE_IADDR): Define.
+
+Wed Nov 20 16:15:15 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/i386/cygwin32.mh: add MMALLOC_CFLAGS = -I$(MMALLOC_SRC)
+ -DMMCHECK_FORCE=1 so memory checks are loaded for cygwin32 gdb
+
+Wed Nov 20 00:43:09 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * callback.h: Delete, moved to ../include.
+ * callback.c: Delete, moved to ../sim/common.
+ * Makefile.in (SFILES,COMMON_OBJS): Delete callback.[co].
+ (callback.o): Delete rule.
+ * remote-sim.h: No longer include callback.h.
+ (sim_callback_write_stdout): Delete prototype.
+ * remote-sim.c (init_callbacks,end_callbacks): New functions.
+ (gdb_os_write_stdout, gdb_os_printf_filtered): New functions.
+ (gdb_callback, callbacks_initialized): New static globals.
+ (gdbsim_open): Call init_callbacks.
+ (gdbsim_close): Call end_callbacks.
+ (simulator_command): Call init_callbacks.
+
+ * config/h8300/h8300.mt (SIM): Change to ../sim/h8300/libsim.a.
+ * config/h8500/h8500.mt (SIM): Change to ../sim/h8500/libsim.a.
+
+Mon Nov 18 15:58:05 1996 Jim Wilson <wilson@cygnus.com>
+
+ * config/mips/tm-mips.h (FIX_CALL_DUMMY): Change unsigned LONGEST
+ to ULONGEST.
+
+Fri Nov 15 15:34:18 1996 Fred Fish <fnf@cygnus.com>
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+ * procfs.c (wait_fd): Handle EINTR error return from poll
+ by restarting the poll.
+ * defs.h (PIDGET): Define a default version that just
+ returns its argument unchanged.
+ * inflow.c (terminal_init_inferior): Eliminate #ifdef
+ of PIDGET and fold both alternatives into common code.
+ (pass_signal): Use PIDGET for pid passed to kill().
+
+Thu Nov 14 15:54:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * utils.c (paddr,preg): Use a static variable initialized to 32
+ instead of doing addr>>32 to eliminate a warning produced by GCC
+ on 32-bit systems.
+
+ * config/d10v/tm-d10v.h (ULONGEST): Define.
+
+Tue Nov 12 12:25:27 1996 Jim Wilson <wilson@cygnus.com>
+
+ * c-typeprint.c (cp_type_print_method_args): Pass -1 for show in
+ recursive call to type_print.
+
+Tue Nov 12 12:18:29 1996 Jim Wilson <wilson@cygnus.com>
+
+ * defs.h (ULONGEST): New macro.
+ * alpha-tdep.c, breakpoint.c, c-exp.y, ch-exp.c, convex-xdep.c,
+ corefile.c, defs.h, f-exp.y, findvar.c, gdbcore.h, m2-exp.y,
+ m88k-tdep.c, printcmd.c, remote-hms.c, remote-mips.c, sparc-tdep.c,
+ valarith.c, valops.c, values.c, config/gould/tm-np1.h,
+ config/mips/tm-mips.h, mswin/prebuilt/gdb/cexptab.c,
+ mswin/prebuilt/gdb/fexptab.c, mswin/prebuilt/gdb/m2exptab.c:
+ Change all occurances of unsigned LONGEST to ULONGEST.
+
+ * configure.host (mips-sgi-irix6): Add.
+
+Tue Nov 12 12:16:40 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sh-tdep.c: Add functionality for target function calls.
+ * config/sh/tm-sh.h: Add support for target function calls.
+
+Tue Nov 12 12:06:58 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-tdep.c: Add functionality for target function calls.
+ * valops.c: Small change to support target function calls.
+ * config/m32r/tm-m32r.h: Add support for target function calls.
+
+Mon Nov 11 17:15:59 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * defs.h: Modify Nov 11 12:59:00 change so _MSC_VER is checked
+ instead of _WIN32.
+ * win32-nat.c: Fix Nov 11 12:59:00 change (windows.h should
+ be included instead of windefs.h for compilers other than
+ VC++).
+ * mswin/windefs.h: Remove ^Ms and change C++ style comments
+ to C style comments.
+
+Mon Nov 11 14:32:38 1996 Mark Alexander <marka@cygnus.com>
+
+ * utils.c (get_cell): Fix off-by-one bug.
+ * mips-tdep.c (get_frame_pointer, fix_sign_extension):
+ New functions to consolidate common code.
+ (mips_frame_chain, init_extra_frame_info): Use new functions
+ to fix problems with backtrace and finish commands on ddb board.
+
+Mon Nov 11 12:59:00 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * mips-tdep.c, remote-mips.c, values.c, mdebugread.c,
+ config/mips/tm-mips.h: Add/fix bugs for 64-bit mips support.
+ * defs.h: Cleanup; add prototypes.
+ * corefile.c: Change FIXME #ifdef
+ * win32-nat.c: Include windefs instead of windows.h.
+ * utils.c: Add routines for printing addresses and registers
+ based on type size.
+
+Sat Nov 9 01:05:10 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-tdep.c (heuristic_proc_desc): Stop examining the prologue
+ if we encounter a positive stack adjustment.
+ (find_proc_desc): If heuristic_fence_post is non-zero, use
+ heuristic_proc_start to determine the start of a function before
+ calling heuristic_proc_desc.
+
+ * coffread.c (coff_symtab_read): Change minimal symbol types
+ for C_LABEL symbols from mst_* to mst_file_*.
+
+ * config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1.
+
+ * configure.in: Handle error message from sun3 native ld when
+ configuring HLDFLAGS.
+ * configure: Regenerated with autoconf.
+
+ * c-valprint.c (c_value_print): Adjust value address by VALUE_OFFSET.
+ * cp-valprint.c (cp_print_value): Prevent gdb crashes by making sure
+ that the virtual base pointer from an user object still points to
+ accessible memory.
+
+ * dbxread.c (dbx_symfile_init): Initialize sym_stab_info to
+ clear the recently added header_files fields.
+ (dbx_symfile_finish): Free hfiles[i].vector to avoid storage leak.
+
+Fri Nov 8 14:30:23 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/tm-sh.h: Added a missing comma in middle of
+ REGISTER_NAMES list.
+
+Fri Nov 8 12:29:51 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c: Fix some formatting and comments.
+
+ * remote-sim.c (simulator_command): Set up callbacks before
+ entering the simulator.
+
+Thu Nov 7 15:19:08 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c: Fix some problems with inferior function calls.
+ * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Change dummy to be
+ a pointer to the dummy's stack instead of just a flag.
+
+Tue Nov 5 10:21:02 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-tdep.c: Improved frame_chain and fn prologue analysis.
+ * config/tm-m32r.h: Add framesize and register to extra_frame_info.
+
+Tue Nov 5 10:08:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * mswin/gdbwin.h: Remove bogus definition of CORE_ADDR.
+ * mswin/srcwin.cpp (CSrcScroll1::CSrcScroll1): Initialize depth
+ to fix divide-by-zero problem with clicking on source window.
+
+Mon Nov 4 00:48:37 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * mswin/recordit: Fix problem with absolute paths.
+ * mswin/recordit: Fix problem with relative paths.
+
+Sun Nov 3 18:06:42 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * mswin/{Makefile.in configure configure.in}: New files for
+ configuring wingdb under Unix.
+
+Sat Nov 2 03:54:13 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * irix5-nat.c, osfsolib.c, solib.c (symbol_add_stub): Handle
+ missing or zero-sized .text sections properly.
+ * mdebugread.c: Handle scRConst and scSUndefined storage classes.
+ * stabsread.c (scan_file_globals): Try to resolve symbols
+ for shared libraries from the minimal symbol table of the main
+ executable first.
+
+Fri Nov 1 13:59:28 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Major fixes to support
+ inferior function calls and proper stack backtracing on D10V-EVA
+ board.
+
+Fri Nov 1 10:50:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/linux.mh (NATDEPFILES): Fix up things so that it
+ links.
+ (GDBSERVER_DEPFILES,TERMCAP): Ditto.
+
+ * monitor.c (dev_name,targ_ops): Move static variables before
+ first use, to avoid compiler warnings.
+
+Thu Oct 31 16:37:17 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-tdep.c: Improved frame_chain and fn prologue analysis.
+ * configure.tgt: Add entry for m32r target.
+ * monitor.h: Add a flag to tell monitor_store_register to use
+ (val, regno) instead of (regno, val).
+ * monitor.c: Make monitor_store_register honor the above flag.
+ Make monitor_exp ignore DC1/DC3 for m32r.
+ Increase buf size in monitor_dump_regs.
+
+Wed Oct 30 18:14:14 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-tdep.c, m32r-rom.c: New files.
+ * config/m32r/m32r.mt: New file.
+ * config/m32r/tm-m32r.h: New file.
+
+Tue Oct 29 16:56:01 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/i386/xm-cygwin32.h:
+ * config/powerpc/xm-cygwin32.h:
+ add #define LSEEK_NOT_LINEAR so source lines aren't unexpectedly
+ truncated.
+
+Tue Oct 29 18:36:43 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE):
+ Define.
+
+Tue Oct 29 14:59:20 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * TODO: Add item suggesting an "info bfd" command.
+
+Tue Oct 29 12:48:04 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c: Snapshot that supports D10V-EVA board.
+
+ * config/d10v/tm-d10v.h (REGISTER_NAMES): Add imap0,imap1,dmap.
+ (TARGET_READ_FP,TARGET_WRITE_FP): Define.
+
+Mon Oct 28 17:34:24 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * mswin/genmakes mswin/recordit: New scripts to generate make
+ files for MSVC.
+
+Sun Oct 27 20:18:04 1996 Mark Alexander <marka@cygnus.com>
+
+ * config/mips/{tm-vr5000.h,tm-vr5000el.h,vr5000.mt,vr5000el.mt}:
+ New files.
+ * configure.tgt: Modify cases for vr5000 to use new files.
+
+Sat Oct 26 07:15:14 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/alpha/alpha-osf3.mh (XM_CLIBS): Add -lm for OSF/1-4.0.
+
+ * procfs.c (proc_set_exec_trap): Under Alpha OSF/1-4.0, tracing
+ the entry to the exit system call to detect termination of the
+ inferior stopped working. Trace termination of the inferior via
+ PRFS_STOPTERM instead.
+ (procfs_init_inferior): Do not trace entry to exit system call
+ if PIOCSSPCACT is defined.
+ (procfs_wait): Handle PR_DEAD event, which signals the termination
+ of the inferior if PRFS_STOPTERM is set.
+
+ * mdebugread.c (parse_partial_symbols): Ignore stNil section
+ start address symbols.
+
+ * sparc-tdep.c (get_saved_register): Get saved PC from the
+ frame info if not in innermost frame.
+
+Thu Oct 24 10:51:45 1996 Mark Alexander <marka@cygnus.com>
+
+ * dbxread.c (process_one_symbol): Interpret end-of-function
+ markers correctly; this fixes problem on Vr5000 where all
+ functions in a module had the same address.
+ * configure.in, configure.tgt, configure.host, gdbserver/configure.in:
+ Correct for pc-linux-gnu problem in config.guess.
+ * configure: Regenerate.
+
+Thu Oct 24 10:06:58 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dbxread.c: Don't swap symbols in place, since internal and
+ external forms may have different sizes. Don't assume that an
+ internal_nlist has the same layout as an external_nlist. Create
+ symbol for n_strx element so to hide specifics of nlist from
+ partial-stab.h.
+ * partial-stab.h: Don't reference dbxread symbols directly. Use
+ CUR_SYMBOL_STRX instead.
+ * config/i386/xm-windows.h: Define SIGQUIT and SIGTRAP.
+
+ * config/v850/tm-v850.h: Define PS_REGNUM and TARGET_V850 for
+ MSVC builds.
+ * mswin/gdbwin.c (reg_order): Define register order for V850.
+ * mswin/gui.cpp (CGuiApp::InitInstance): Define target name for
+ V850.
+ * mswin/regdoc.h: Define MAXREGS for V850.
+
+Tue Oct 22 16:28:20 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850-tdep.c (scan_prologue): Changes to deal with scheduled
+ prologues correctly. First, prologue end is now defined by
+ presence of a branch, jump or call insn. Second, can no longer
+ fix frame offsets because we may not know the offset until after a
+ register has been saved.
+ * (v850_init_extra_frame_info): Fixup frame offsets here because
+ we have all the info at this time.
+ * (v850_frame_chain): Use new calling convention for scan_prologue.
+
+Tue Oct 22 10:25:29 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Changes to allow stack
+ backtraces and inferior function calls.
+
+Tue Oct 22 10:32:46 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Update init.c editing to work with Oct 8 change.
+ (@HLDFLAGS@): Always edit out.
+
+Mon Oct 21 18:17:08 1996 Mark Alexander <marka@cygnus.com>
+
+ * mdebugread.c (parse_partial_symbols): Fix 64-bit
+ sign-extension problems in calculating psymtab addresses.
+ * buildsym.c (end_symtab): Use macro to pop context.
+
+Mon Oct 21 14:40:50 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850-tdep.c: Cleanup lots of things. Add many comments.
+
+ * v850-tdep.c (v850_init_extra_frame_info v850_frame_chain): Fix
+ sign bugs with scanning prologues. Get a little smarter about
+ calculating the length of uninteresting instructions.
+
+Mon Oct 21 14:01:38 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * top.c: Add new commands "set annotate" and "show annotate".
+
+Sun Oct 20 04:38:39 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * corelow.c (core_close): Clear inferior_pid only if there is
+ an open core_bfd.
+
+ * cp-valprint.c (cp_print_value_fields): Pass correct address
+ to val_print, not 0.
+
+ From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de):
+ * eval.c (evaluate_subexp_standard) [case BINOP_REPEAT]: Chase
+ typedefs before checking for integral type of right operand.
+
+Fri Oct 18 17:26:22 1996 Mark Alexander <marka@cygnus.com>
+
+ * mdebugread.c (parse_symbol): Fix crash when malloc has
+ no type info and void type has no associated pointer type.
+
+Thu Oct 17 18:18:20 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.host: New file, host configuration mapping.
+ * configure.tgt: New file, target configuration mapping.
+ * configure.in: Remove host and target mapping.
+ * configure: Rebuild.
+
+Wed Oct 16 17:46:03 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * breakpoint.c (must_shift_inst_regs): New global.
+ (bpstat_stop_status): Change #if uses of DECR_PC_AFTER_BREAK into
+ equivalent expression uses.
+ * infrun.c (wait_for_inferior): Ditto.
+
+Wed Oct 16 01:53:43 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850-tdep.c (v850_push_arguments): Use symbolic names for arg
+ registers.
+ * config/v850/tm-v850.h: Change FP to 29. Define arg regs.
+
+Tue Oct 15 16:30:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (init.c): Don't use -s option with grep. It means
+ something different under Digital Unix.
+
+ * buildsym.c (finish_block): Treat LOC_BASEREG_ARG and
+ LOC_LOCAL_ARG as arguments so that GDB will know about function
+ args declared this way. Mostly affects dwarf.
+ * dwarfread.c (decode_die_type): Change default type from int to
+ void. This allows GDB to recognize void functions.
+ * (new_symbol): If AT_PROTOTYPED is present, set a flag in the
+ type structure.
+ * findvar.c (extract_floating store_floating): Clean up comments
+ to reflect reality.
+ * gdbtypes.h: Add TYPE_FLAG_PROTOTYPED so that we can tell if a
+ function has a prototype. Currently, only dwarf supports this.
+ * utils.c (floatformat_from_doublest): Fix logic error with
+ converting from double to float. (It wasn't shifting mant_long if
+ it had a hidden bit.)
+ * v850-tdep.c: Add support for function calling. Fix some
+ problems with debugging code w/o debug symbols.
+ * config/v850/tm-v850.h: Ditto.
+
+Tue Oct 15 18:19:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * utils.c: Always ensure that size_t is defined. Check
+ HAVE_STDDEF_H rather than __STDC__
+ (xmalloc, xrealloc): Use size_t rather than long.
+
+Tue Oct 15 14:24:19 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * config/powerpc/tm-ppc-eabi.h: Undefine NO_SINGLE_STEP so targets
+ can use single-step commands.
+
+Sun Oct 13 11:38:25 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR is non-zero,
+ follow typedefs before checking TYPE_CODE for structures and unions.
+
+Fri Oct 11 15:43:54 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * frame.h: Move definition of struct frame_saved_regs to before
+ struct frame to make it possible to use frame_saved_regs in
+ EXTRA_FRAME_INFO macro.
+
+ * v850-tdep.c config/v850/tm-v850.h: Lotsa new functions and
+ macros to make frame operations (such as backtrace) work.
+
+Fri Oct 11 14:23:50 1996 Fred Fish <fnf@cygnus.com>
+
+ * dbxread.c (process_one_symbol): Check for null string directly
+ rather than using strcmp against "".
+ * partial-stab.h: Ditto.
+
+Fri Oct 11 12:18:32 1996 Mark Alexander <marka@cygnus.com>
+
+ * gdbserver/{gdbreplay.c,low-linux.c,remote-utils.c,utils.c}:
+ Make it compile on Linux and eliminate some warnings.
+
+Thu Oct 10 16:32:08 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (init.c): Fixup final sed script to work around
+ Linux bug with `p' operator.
+
+Wed Oct 9 18:02:48 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-mips.c: Use the correct name everywhere (DDB) for NEC's
+ VR4300 target.
+ (ddb_ops, pmon_ops): Fix the documentation strings.
+
+Wed Oct 9 07:42:44 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (init.c): Retro HPUX grep lacks -h option. Strip
+ filenames with sed instead.
+
+Tue Oct 8 15:59:44 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * defs.h: Remove decls of xmalloc and xrealloc. There is a
+ conflicting definition in libiberty.h.
+
+Tue Oct 8 11:47:13 1996 Fred Fish <fnf@cygnus.com>
+
+ * dbxread.c (dbx_symfile_read): Call free_pending_blocks rather
+ than poking global variable (which is now static).
+ * hpread.c (hpread_build_psymtabs): Ditto.
+ * os9kread.c (os9k_symfile_read): Ditto.
+ * xcoffread.c (xcoff_initial_scan): Ditto.
+
+ * buildsym.h (free_pending_blocks): Declare here.
+ (pending_blocks): Remove declaration of global symbol.
+ (free_pendings): Remove declaration of global symbol.
+ (make_blockvector): Declare here.
+ (record_pending_block): Declare here.
+
+ * dstread.c (make_blockvector): Remove static copy that was old
+ clone of version in buildsym.c.
+ (process_dst_block): Call record_pending_block rather than doing
+ it by hand.
+ (read_dst_symtab): Ditto.
+
+ * buildsym.c (make_blockvector): Make global rather than static,
+ (record_pending_block): New function, code moved from finish_block.
+ (finish_block): Use record_pending_block.
+ (free_pending_blocks): New function.
+ (really_free_pendings): Call free_pending_blocks.
+ (pending_blocks): Make static instead of global.
+ (free_pendings): Make static instead of global.
+
+Tue Oct 8 09:03:22 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/i386/windows.mh config/i386/xm-windows.h:: New config
+ files to support building Wingdb (built under Microsoft build
+ environment).
+
+ * Makefile.in: Add rule for hpux-thread.o (needs special header
+ files).
+ * (SUBDIRS): Remove mswin.
+ * Change procedure for creating init.c. Speeds things up quite a
+ bit.
+ * config.in configure configure.in: Check for select, poll.
+ * Check for OSF header files before including hpux-thread.o.
+ * Don't configure doc or testsuite when building under MSVC.
+ * findvar.c value.h (read_register_pid write_register_pid): Make
+ global. Needed for hppa-tdep.c.
+ * (supply_register): Don't set pid to inferior_pid when supplying
+ registers.
+ * hppa-tdep.c (saved_pc_after_call): frame_saved_pc ->
+ FRAME_SAVED_PC.
+ * (frame_saved_pc): Change name to hppa_frame_saved_pc.
+ * (hppa_pop_frame): Don't use a pid of 0 with target_write_pc.
+ Use write_pc instead, which uses the correct pid.
+ * (target_read_pc target_write_pc): Use read/write_register_pid
+ instead of read/write_register to preserve the pid passed in.
+ * inftarg.c (child_can_run): Add flag child_suppress_run to allow
+ hpux-threads.c to override this as a runnable target.
+ * config/pa/nm-hppah.h: Define target_new_objfile and
+ target_pid_to_str.
+ * config/pa/tm-hppa.h (FRAME_SAVED_PC): Use hppa_frame_saved_pc
+ instead of frame_saved_pc.
+ * config/m68k/tm-m68k.h: Define TARGET_M68K for Wingdb.
+ * config/m68k/tm-monitor.h: Use FRAME_CHAIN_VALID_ALTERNATE, since
+ we can't easily determine the start file bounds with ELF.
+ * config/mips/tm-mips.h: Define TARGET_MIPS for Wingdb.
+ * hpux-thread.c: New file for HPUX/OSF thread support.
+ * osf-share/{README AT386/cma_thread_io.h HP800/cma_thread_io.h
+ RIOS/cma_thread_io.h cma_attr.h cma_deb_core.h cma_debug_client.h
+ cma_errors.h cma_handle.h cma_init.h cma_list.h cma_mutex.h
+ cma_sched.h cma_semaphore_defs.h cma_sequence.h cma_stack.h
+ cma_stack_int.h cma_tcb_defs.h cma_util.h}: New files for OSF
+ thread support.
+
+Sun Oct 6 15:48:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * buildsym.c (finish_block): Change innerblock_anon_complaint to
+ print the addresses as part of the complaint. Add a complaint for
+ cases where the block end address is smaller than the block start
+ address, in case any such conditions slip through our fixup mechanism.
+ * symmisc.c (dump_symtab): Only print blockvector for primary
+ symtabs, to avoid massive duplication of output due to secondary
+ symtabs that point to same blockvector. Also do some minor
+ formatting tweaks.
+
+Mon Oct 7 10:42:32 1996 Per Bothner <bothner@deneb.cygnus.com>
+
+ Replace header_files global by per-objfile field.
+ * gdb-stabs.h (struct dbx_symfile_info): Add fields header_files,
+ n_header_files, n_allocated_header_files.
+ * stabsread.h (header_files, n_header_files, n_allocated_header_files):
+ Replace externs by macros HEADER_FILES, N_HEADER_FILES, and
+ N_ALLOCATED_HEADER_FILES.
+ * dbxread.c (dbx_symfile_finish): Free HEADER_FILES.
+ (free_header_files, init_header-files): Don't free/init headerfiles.
+ (various functions): Use macros instead of header_files globals.
+ * stabsread.c (various functions): Likewise.
+
+Sun Oct 6 22:43:06 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * dwarf2read.c (read_tag_reference_type): New fn.
+ (read_type_die): Call it.
+ (dwarf_attr): Also look in the DIEs referred to by specification
+ or abstract_origin attributes.
+
+Wed Oct 2 22:07:16 1996 Fred Fish <fnf@cygnus.com>
+
+ * inferior.h (IN_SIGTRAMP): Pass pc to SIGTRAMP_START and
+ SIGTRAMP_END.
+ * config/i386/tm-i386os9k.h (SIGTRAMP_START, SIGTRAMP_END):
+ Define with dummy pc arg.
+ * config/m68k/tm-nbsd.h: Ditto.
+ * doc/gdbint.texinfo: Document that SIGTRAMP_START and
+ SIGTRAMP_END are macros that take an single argument.
+
+Mon Sep 30 20:02:45 1996 Fred Fish <fnf@cygnus.com>
+
+ * defs.h: Remove define of PRIVATE_XMALLOC.
+
+Mon Sep 30 15:39:28 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/v850/tm-v850.h: Use distinct register for PC, not EIPC.
+
+Mon Sep 30 11:16:34 1996 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (execute_control_command): Free values from while_control
+ and if_control conditions after evaluation to avoid storage leaks.
+ From Peter Schauer.
+
+Fri Sep 27 17:43:06 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure configure.in: Recognize v850 target.
+ * v850-tdep.c: New file, NEC V850 target support.
+ * config/v850/{v850.mt tm-v850.h}: New files for NEC V850 support.
+
+Fri Sep 27 14:48:15 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Update current_line and
+ current_symtab when stepping continues in the middle of a new line.
+
+Fri Sep 27 10:25:30 1996 Fred Fish <fnf@cygnus.com>
+
+ * top.c (print_gdb_version): Rewrote to comply with new GNU coding
+ standards for the --version option.
+ (print_gnu_advertisement): Remove, now part of print_gdb_version.
+ (show_version): Remove call to print_gnu_advertisement.
+ * top.h (print_gnu_advertisement): Remove prototype.
+ * main.c (print_gdb_help): Move help to static function and
+ add prototype.
+ (main): Call print_gdb_help rather than inlining it.
+ (main): Remove call to print_gnu_advertisement.
+
+Fri Sep 27 13:32:53 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/d10v/tm-d10v.h (TARGET_{INT,PTR}_BIT): Define.
+ (TARGET_{,LONG_}DOUBLE_BIT): Ditto.
+
+Thu Sep 26 23:10:26 1996 Mark Alexander <marka@cygnus.com>
+
+ * configure.in, config/i386/tm-linux.h: Fix configure
+ problem on older Linux systems that prevented core files
+ from being recognized.
+
+Wed Sep 25 18:31:33 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dbug-rom.c: New file, support for Motorola's dBUG monitor.
+ * config/m68k/monitor.mt (TDEPFILES): Add it.
+ * NEWS: Mention it.
+
+Mon Sep 23 16:13:50 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * config/d10v/tm-d10v.h (SAVED_PC_AFTER_CALL): Fixed.
+ Now single-steps correctly.
+ * d10v-tdep.c (d10v_pop_frame): Fixed.
+
+Fri Sep 20 16:10:58 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/sh/tm-sh.h (REGISTER_NAMES): Move fp registers to
+ be consistent with GCC.
+ (FPUL_REGNUM, etc): Renumber to match list changes.
+ (ADDR_BITS_REMOVE): Delete.
+ * sh-tdep.c (sh_reg_names, sh3_reg_names, sh3e_reg_names):
+ Rearrange to match REGISTER_NAMES.
+ * sh3-rom.c (sh3_regnames, sh3e_regnames): Ditto.
+
+Thu Sep 19 16:19:01 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c: Stack chain should work now.
+
+Tue Sep 17 18:46:57 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Snapshot.
+
+Tue Sep 17 12:20:50 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add cases for MIPS 5000 like MIPS 4300.
+ * configure: Rebuild.
+
+Tue Sep 17 12:09:00 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * ser-e7kpc.c: Added wingdb support for target e7000pc.
+
+Tue Sep 17 10:56:52 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * remote-mips.c (pmon_wait): DDB PMON does not require forced
+ re-entry back into debug mode.
+
+Mon Sep 16 14:32:58 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * remote-mips.c (mips_load): Ensure that the PC is explicitly
+ loaded after a load to a DDB PMON system.
+
+Fri Sep 13 12:02:39 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (INTERNAL_LDFLAGS): Add @HLDFLAGS@ to list.
+ (HLDENV): Set to @HLDENV@.
+ (gdb): Prefix link command line with $(HLDENV).
+ * configure.in: Add support to test for --enable-shared and
+ generate appropriate values for HLDFLAGS and HLDENV.
+ * configure: Regenerated with autoconf.
+
+Sun Sep 8 15:26:27 1996 Fred Fish <fnf@cygnus.com>
+
+ * alpha-nat.c (fetch_core_registers): Match Sep 4 gdbcore.h prototype
+ change for core_read_registers in struct core_fns.
+ * core-regset.c (fetch_core_registers): Ditto & add prototype.
+ * core-sol2.c (fetch_core_registers): Ditto & add prototype.
+ * i386aix-nat.c (fetch_core_registers): Ditto & add prototype.
+ * i386b-nat.c (fetch_core_registers): Ditto.
+ * i386mach-nat.c (fetch_core_registers): Ditto & add prototype.
+ * irix4-nat.c (fetch_core_registers): Ditto.
+ * irix5-nat.c (fetch_core_registers): Ditto.
+ * lynx-nat.c (fetch_core_registers): Ditto & add prototype.
+ * m68knbsd-nat.c (fetch_core_registers): Ditto.
+ * mips-nat.c (fetch_core_registers): Ditto & add prototype.
+ * rs6000-nat.c (fetch_core_registers): Ditto.
+ * sparc-nat.c (fetch_core_registers): Ditto.
+ * sun3-nat.c (fetch_core_registers): Ditto & add prototype.
+ * ultra3-nat.c (fetch_core_registers): Ditto & add prototype.
+
+ * alpha-nat.c (register_addr): Match Sep 4 gdbcore.h prototype change.
+ * delta68-nat.c (register_addr): Ditto.
+ * gdbserver/low-linux.c (register_addr): Ditto.
+ * gdbserver/low-hppabsd.c (register_addr): Ditto.
+ * i386m3-nat.c (register_addr): Ditto.
+ * mips-nat.c (register_addr): Ditto.
+ * ultra3-nat.c (register_addr): Ditto.
+
+Sun Sep 8 15:14:00 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * blockframe.c (inside_main_func): Cleanup slightly. Move
+ mainsym def into the block it's used in.
+ * configure.in configure: Allow NATDEPFILES to be recognized in
+ .mh files regardless of whitespace.
+
+ * cpu32bug-rom.c (cpu32bug_cmds): Change load_response string to
+ keep downloads from hanging.
+
+ * remote-wiggler.c: Add support for flash upgrades.
+ * (wiggler_error): Fix message format. Add new error code.
+ * (wiggler_write_byets): Error code is hex. Report errors with
+ proper routine name.
+ * (wiggler_read_byets): Report errors with proper routine name.
+ * (get_packet): Add support for new flash commands.
+ * (wiggler_load): Call clear_symtab_users() to reset things
+ properly after download.
+ * (flash_xfer_memory bdm_update_flash_command): New funxtions to
+ support flash upgrades for Wiggler.
+ * (_initialize_remote_wiggler): Add `bdm update-flash' command.
+
+Fri Sep 6 13:14:13 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * ser-tcp.c: don't include netinet/tcp.h if __CYGWIN32__
+
+Thu Sep 5 17:05:13 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * config/i386/cygwin32.mh:
+ * config/powerpc/cygwin32.mh: build ser-tcp.o for both hosts
+
+Thu Sep 5 12:09:13 1996 Per Bothner <bothner@deneb.cygnus.com>
+
+ * value.h (COERCE_REF): Fix previous change.
+ (COERCE_ENUM): Add a check_typedef (this is the real fix).
+
+Thu Sep 5 03:28:30 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): In case of OP_ARRAY: make a
+ better check of array boundaries.
+
+Thu Sep 5 01:29:42 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure: Update aclocal.m4 and re-run autoconf to get correct
+ defs for BFD stuff.
+ * remote-wiggler.c (wiggler_error): Error codes are hex. Also,
+ fix default message generation.
+
+Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in: Add mswin to SUBDIRS. Add rules for
+ mswin/libwingdb.a and remote-wiggler.o.
+ * breakpoint.c (breakpoint_here_p): Clean up bp enabled test.
+ * (breakpoint_inserted_here_p): New func, just like
+ breakpoint_here_p, except it's honest. Honestly.
+ * breakpoint.h: Proto for above.
+ * configure configure.in: Add mswin to configdirs if host is
+ i[3456]86-*-windows.
+ * core-aout.c (fetch_core_registers register_addr) gdbcore.h:
+ Change all vars that can contain addresses to type CORE_ADDR.
+ * findvar.c (supply_register): Allow val to be NULL. This means
+ that regno is unsupported.
+ * (read_pc read_pc_pid write_pc write_pc_pid): Make non-pid forms
+ just call pid forms with inferior_pid so that there's only once
+ place to hack PC's and such.
+ * infrun.c (proceed): Don't skip breakpoints if user changed PC.
+ * remote-wiggler.c: New file. Support for BDM interface from
+ Macraigor Systems.
+ * serial.c: Enhance serial logging capability. Add hex and octal
+ output modes (set remotelogbase {hex|octal|ascii}. Also log
+ breaks, timeouts, errors, and eofs.
+ * serial.h: Redefine SERIAL_SEND_BREAK to go through a wrapper
+ function so that we can log breaks. Don't export serial_logfile
+ or serial_logfp.
+ * top.c (execute_command): Don't test for serial_logfp here.
+ Just call serial_log_comand, and let serial.c sort it out.
+ * valops.c (value_of_variable): Don't attempt to establish frames
+ for static and global variables. This makes things work a bit
+ better if the stack or frame pointer is trashed.
+ * config/m68k/monitor.mt (TDEPFILES): Add remote-wiggler.o.
+ * config/m68k/tm-m68k.h: Define STACK_ALIGN. CPU32 can't hack
+ misaligned stacks during function calls.
+
+Wed Sep 4 13:06:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * terminal.h: Don't use #elif.
+
+Wed Sep 4 06:49:35 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-exp.c (parse_tuple_element): Allow (*): for array tuples
+ if we have a type.
+
+ * eval.c (evaluate_subexp_standard): In case of OP_ARRAY:
+ check number of args against bounds of array to avoid
+ memory corruption.
+
+ * value.h (COERCE_REF): Do a CHECK_TYPEDEF in case we get
+ a TYPE_CODE_TYPEDEF.
+
+Fri Aug 30 15:07:14 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * remote-mips.c: Provide support for DDBVR4300 target board.
+ (ddb_open, ddb_ops): Added.
+ (mips_monitor_type): MON_DDB Added.
+ (mips_enter_debug, mips_exit_debug, mips_initialize,
+ mips_fetch_registers, common_breakpoint, mips_load,
+ _initialize_remote_mips): Updated.
+
+Thu Aug 29 17:00:18 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * nlm/configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
+ * nlm/configure: Regenerate.
+
+ * gdbserver/configure.in (i[345]86-*-*): Recognize i686 for
+ pentium pro.
+
+Wed Aug 28 13:11:15 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: If CY_AC_PATH_TCLCONFIG can't find TCL, don't run
+ CY_AC_LOAD_TCLCONFIG.
+ * configure: Rebuild.
+
+Tue Aug 27 12:40:40 1996 Fred Fish <fnf@cygnus.com>
+
+ * infrun.c (wait_for_inferior): Initialize stop_func_end before calling
+ find_pc_partial_function.
+
+Tue Aug 27 10:17:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure: Regenerate again.
+
+Tue Aug 27 04:25:08 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: work around host_alias configure bug.
+ AC_CANONICAL_HOST is called twice (first by AC_CHECK_TOOL
+ and second by AC_CANONICAL_SYSTEM). The second clobbers the
+ previous setting. Circumventing by moving the second check
+ to before the first.
+ * configure: regenerated
+
+Mon Aug 26 18:36:54 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * config/d10v/d10v.mt: New file.
+ * config/d10v/tm-d10v.h: New file.
+ * configure.in: New target D10V.
+ * d10v-tdep.c: New file.
+
+Sun Aug 25 00:09:47 1996 Fred Fish <fnf@rtl.cygnus.com>
+
+ * rs6000-tdep.c: Fix typo in comment.
+ * valops.c (call_function_by_hand): Set using_gcc to 2
+ for code compiled without -g, per comment in code.
+ * config/a29k/tm-a29k.h (STACK_ALIGN): Add comment.
+ * config/sparc/tm-sparc.h (STACK_ALIGN): Add comment.
+ * config/sparc/tm-sp64.h (STACK_ALIGN): Add comment.
+ * config/pyr/tm-pyr.h (STACK_ALIGN): Add comment.
+ * config/m88k/tm-m88k.h (STACK_ALIGN): Add comment.
+ * config/pa/tm-hppa.h (PUSH_ARGUMENTS): Enclose args in ()'s.
+ (STACK_ALIGN): Add comment, move to be with other associated
+ macros, and document.
+ * config/mips/tm-mips.h (PUSH_ARGUMENTS): Enclose args in ()'s.
+ (STACK_ALIGN): Remove completely, handled by PUSH_ARGUMENTS.
+ * config/alpha/tm-alpha.h (PUSH_ARGUMENTS): Enclose args in ()'s.
+ * config/rs6000/tm-rs6000.h (STACK_ALIGN): Remove completely,
+ handled by PUSH_ARGUMENTS.
+ (PUSH_ARGUMENTS): Enclose args in ()'s.
+
+Fri Aug 23 13:55:05 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Try to reenable shared library
+ breakpoints even if auto_solib_load is not set.
+
+Wed Aug 21 16:31:27 1996 Fred Fish <fnf@cygnus.com>
+
+ * valprint.c (print_longest): Test for CC_HAS_LONG_LONG as well as
+ PRINTF_HAS_LONG_LONG.
+ * expprint.c (dump_expression): Ditto.
+ * configure.in: Fix check for long long support in compiler to
+ use a function body, not a nested function.
+ * configure: Rebuild with autoconf.
+
+Tue Aug 20 17:59:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4: Include ../bfd/aclocal.m4.
+ * configure.in: Add stdlib.h to AC_CHECK_HEADERS. Call
+ BFD_NEED_DECLARATION on malloc, realloc, and free.
+ * acconfig.h: Add NEED_DECLARATION_MALLOC,
+ NEED_DECLARATION_REALLOC, and NEED_DECLARATION_FREE.
+ * configure, config.in: Rebuild.
+ * defs.h: Include <stddef.h> and <stdlib.h> based on HAVE_*_H
+ rather than __STDC__. Only declare malloc, realloc, and free if
+ NEED_DECLARATION_* is defined.
+
+Tue Aug 20 15:37:03 1996 Fred Fish <fnf@cygnus.com>
+
+ * solib.c (_initialize_solib): Add missing '\' chars at ends of
+ strings that continue on next line.
+ (enable_break): Replace "return 0" with setting success to zero
+ and letting normal return handle the return.
+
+Sat Aug 17 14:16:23 1996 Fred Fish <fnf@cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Make sure sp and struct_addr
+ are properly aligned.
+
+Fri Aug 16 17:54:26 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * rs6000-tdep.c (rs6000_fix_call_dummy): Add full set of arguments.
+ * config/rs6000/tm-rs6000.h (FIX_CALL_DUMMY): Pass all arguments
+ to function, declare function correctly.
+
+Fri Aug 16 17:24:35 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * symtab.h: changed namespace to _namespace for compiling under
+ MFC v4.0.
+
+Fri Aug 16 13:52:21 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Update for various recent changes, add some
+ comments.
+
+Fri Aug 16 15:47:36 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/rs6000/tm-rs6000.h (FIX_CALL_DUMMY): Cast args to be an
+ integer for type correctness.
+
+Fri Aug 16 15:15:37 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * config/mips/{vr4300.mt, vr4300el.mt} (SIM): Add -lm when
+ simulator is included.
+
+Thu Aug 15 13:44:13 1996 Fred Fish <fnf@cygnus.com>
+
+ * findvar.c (write_register_pid): Only needed when TARGET_WRITE_PC
+ is not defined.
+ (read_register_pid): Only needed when TARGET_READ_PC is not
+ defined.
+ * hppa-tdep.c (frame_saved_pc): Remove prototype.
+ * infptrace.c (udot_info): Prototype when CHILD_XFER_MEMORY is
+ not defined.
+ * config/xm-aix4.h (aix_resizewindow): Convert old style decl
+ to prototype.
+ * xcoffsolib.c (command.h): Include for needed prototypes.
+
+Wed Aug 14 17:54:19 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/i386/cygwin32.mh: Set NAT_FILE to nm-empty.h to make
+ native work.
+
+Wed Aug 14 02:03:42 1996 Fred Fish <fnf@cygnus.com>
+
+ From Blair MacIntyre <bm@cs.columbia.edu>:
+ * hppa-tdep.c (hppa_fix_call_dummy): Use MSYMBOL_TYPE rather
+ than SYMBOL_TYPE on msymbols.
+ * somsolib.c (som_solib_create_inferior_hook): Ditto.
+
+ * Makefile.in (init.c): Generate with prototypes.
+
+ * config/pa/tm-hppa.h (frame_saved_pc): Add prototype.
+ * config/rs6000/xm-rs6000.h (aix_resizewindow): Ditto.
+ * config/rs6000/tm-rs6000.h (frame_initial_stack_address): Ditto.
+ (pc_load_segment_name): Ditto.
+ (pop_frame): Ditto.
+ (extract_return_value): Ditto.
+ (is_magic_function_pointer): Ditto.
+ (push_dummy_frame): Ditto.
+ (fix_call_dummy): Ditto.
+ (push_arguments): Ditto.
+ (skip_trampoline_code): Ditto.
+ (aix_process_linenos): Ditto.
+
+ * config/m68k/tm-cisco.h (get_longjmp_target): Add prototype.
+ * config/m68k/tm-es1800.h: Ditto.
+ * config/m68k/tm-vx68.h: Ditto.
+ * config/m68k/tm-sun3.h: Ditto.
+ * config/m68k/tm-m68kv4.h: Ditto.
+
+Tue Aug 13 23:04:36 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/mips/nm-mips.h (get_longjmp_target): Add prototype.
+ * config/mips/nm-irix3.h (get_longjmp_target): Add prototype.
+ * remote-mips.c (mips_read_processor_type): Remove prototype.
+ * mips-tdep.c (gdb_print_insn_mips): Add prototype and make static.
+ * irix5-nat.c (fetch_core_registers): Add prototype.
+
+Mon Aug 12 21:23:44 1996 Fred Fish <fnf@cygnus.com>
+
+ * remote-pa.c (boot_board): Add dummy params to make type compatible
+ for passing to add_com.
+ * scm-exp.c (scm_lreadr): Ensure svalue is not used uninitialized.
+ * buildsym.c (compare_line_numbers): Change function to match
+ prototype and also what qsort expects.
+
+Mon Aug 12 19:19:00 1996 Mark Alexander <marka@cygnus.com>
+
+ * remote.c: Make remote_write_size public.
+ * sh-tdep.c (_initialize_sh_tdep): Set remote_write_size to 300
+ to prevent packet errors with some versions of CMON.
+
+Mon Aug 12 16:20:58 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * defs.h: Define CONST_PTR as blank if compiling with Microsoft
+ C, else it's `const'.
+ * c-lang.c c-lang.h ch-lang.c f-lang.c language.c m2-lang.c
+ scm-lang.c: Microsoft C can't hack const pointers. Use CONST_PTR
+ macro instead.
+ * configure configure.in defs.h: Use AC_C_CONST to figure out if
+ the compiler supports const. Gets rid of some cruft in defs.h.
+ * dwarf2read.c: <string.h> -> "gdb_string.h"
+ * remote-sim.c: Add prototypes. Fix call to gdbsim_kill.
+ * sparcl-tdep.c (download): Add prototypes to write_routine and
+ start_routine args.
+
+ * mswin/gdbwin.c: Don't include both varargs.h AND stdarg.h. Get
+ rid of varargs.h Include string.h.
+ * (gdbwin_update gdbwin_fputs regs_changed_f bpt_changed_f
+ update): Fix prototypes, fix calls.
+ * (update): Return value for catch_errors.
+ * (run_execute_command togdb_command_from_tty togdb_command):
+ Cleanup catching of errors from calls to execute_command. Also,
+ dup command string to avoid modifying const strings.
+ * (togdb_breakinfo_i_init togdb_breakinfo_i_next): Use 0 instead
+ of NULL when see if b->address isn't set.
+ * (bi_disable_bpt bi_enable_bpt bi_delete_all
+ bi_delete_breakpoint): Add arg to calls to update.
+ * (gui_command): Add prototype.
+ * (mswin_query): Fix prototype.
+ * (_initialize_gdbwin): Dup string to avoid modifying const.
+ * (info_path togdb_get_info_path): Remove const from decls cuz
+ this can't be const (it points at malloc'ed memory).
+ * (togdb_searchpath): Remove const from path. Dup string to
+ avoid modifying const strings.
+ * rindex -> strrchr.
+ * (gdbwin_list_symbols): Regexp param is const.
+ * Fix lots of refs to psymtabs to deref correct pointers.
+ * (togdb_set_breakpoint_sal): Call set_breakpoint_sal with sal,
+ not &sal.
+ * mswin/gdbwin.h (togdb_searchpath togdb_get_info_path
+ toget_set_info_path): Fix prototypes to match reality.
+ * mswin/gui.cpp: Define _beginthreadex and _endthreadex routines
+ with proper prototypes.
+ * mswin/iface.cpp (gdbwin_fputs): Define with correct number of args.
+ * mswin/ser-win32s.c: Fix defs of min and max.
+ * mswin/serdll32.c (OpenComm16): Make cbInQueue and cbOutQueue be
+ USHORT.
+ * (WriteComm16): Change lpBug from LPVOID to LPCSTR.
+ * mswin/serdll32.h: Fix prototypes for OpenComm16 and WriteComm16.
+
+Sun Aug 11 20:54:16 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * main.c (main): Make sure command loop is used with cygwin32.
+ * terminal.h: Allow cygwin32 to use termios.h.
+
+Fri Aug 9 12:42:49 1996 Jeffrey A Law (law@cygnus.com)
+
+ * somread.c (som_symtab_read): Handle secondary definition
+ symbols (aka weak symbols).
+
+ * config/tm-hppa.h (EXTRACT_RETURN_VALUE): Fix thinko in
+ last change.
+
+Thu Aug 8 10:12:36 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * symfile.c (symfile_bfd_open): Change ifdef from __WIN32__ to
+ _WIN32.
+
+ * somread.c: Rearrange order of includes to fix warnings under
+ hpux-10.10. Also don't include sys/file.h.
+
+Wed Aug 7 21:45:52 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dbxread.c: Don't include param.h or sys/file.h.
+ * (dbx_symfile_read): Determine symfile_relocatable from bfd
+ flags instead of file extension. Also clean up a little bit.
+
+Wed Aug 7 17:18:37 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dwarf2read.c dwarfread.c exec.c infcmd.c infrun.c main.c
+ mdebugread.c os9kread.c source.c top.c utils.c: Don't
+ include param.h or sys/file.h (or unistd.h in some cases).
+ * defs.h exec.c inflow.c remote-array.c remote-e7000.c
+ sparcl-tdep.c terminal.h utils.c: Replace all occurances of
+ __WIN32__, WINGDB, WIN32, etc... with _WIN32.
+ * main.c: Remove #ifndef WINGDB around option processing. Fix
+ bug with passing argc==0 and argv==NULL to getopt.
+ * (main) Remove calls to access() before source_command. Let
+ soure_command handle access errors.
+ * maint.c (maintenance_dump_me): #ifdef out for _WIN32.
+ * symtab.c (operator_chars): Make this global for wingdb.
+ * top.c (disconnect): #ifdef out for _WIN32.
+ * (source_command): If got an error and from_tty, then call print
+ error, else just return quietly.
+ * utils.c (fatal_dump_core): Can't kill ourselves under windows.
+ Just exit.
+ * (pollquit notice_quit): #ifdef out stuff that doesn't exist
+ under windows.
+
+Wed Aug 7 09:59:19 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Tweak for
+ structures > 4 bytes in size.
+
+ * valops.c (call_function_by_hand): Handle aligning stacks that
+ grow up correctly.
+ * config/pa/tm-hppa.h (USE_STRUCT_CONVENTION): Define.
+ (STACK_ALIGN): Define.
+ * hppa-tdep.c (hppa_alignof): Don't demand a minumim two byte
+ alignment on structs/unions.
+
+Sun Aug 4 16:22:42 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/powerpc/nm-aix.h (PTRACE_ARG3_TYPE): Define to "int *",
+ which is the documented type under at least AIX 3 and AIX 4.
+
+Sat Aug 3 04:02:46 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/alpha/alpha-osf3.mh (XM_FILE): Change from xm-alpha.h to
+ xm-alphaosf.h.
+ (MMALLOC_CFLAGS): Define NO_MMCHECK to not install consistency
+ checks.
+
+Thu Aug 1 10:11:34 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/mips/tm-mips.h (TM_MIPS_H): Enclose file contents in
+ this, define when contents are included.
+ (mips_read_processor_type): Add prototype.
+ * config/mips/xm-mips.h: Remove strdup decl, now in gdb_string.h
+ * mdebugread.c (ecoff_relocate_efi): Add prototype.
+ (fixup_sigtramp): Only needed when TM_MIPS_H is defined.
+
+Wed Jul 31 20:21:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * rs6000-nat.c (add_vmap): Return 0 to caller rather than random value.
+ (vmap_ldinfo): Ensure got_exec_file is not used uninitialized.
+ (fetch_core_registers): Add prototype.
+ (vmap_symtab): Ditto.
+ (objfile_symbol_add): Ditto.
+ (add_vmap): Ditto.
+ (vmap_ldinfo): Ditto.
+ (vmap_exec): Ditto.
+
+Tue Jul 30 17:57:46 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * stabsread.c (get_substring): Declare second arg as int.
+
+ * remote-es.c: Include gdb_string.h after defs.h.
+
+Mon Jul 29 21:13:20 1996 Fred Fish <fnf@cygnus.com>
+
+ * rs6000-tdep.c (push_arguments): Remove unused variable "pc".
+ (branch_dest): Remove unused variable "offset".
+ (pop_dummy_frame): Add prototype and make static.
+ (push_arguments): Guard against using len uninitialized.
+ (push_arguments): Guard against using arg uninitialized.
+ (frame_saved_pc): Remove unused variable "frameless".
+ (free_loadinfo): Ifdef out unused function.
+
+ * xcoffread.c (compare_lte): Change prototype and function to
+ be correct type for passing to qsort.
+ (add_stab_to_list): Ifdef out unused function and prototype.
+ (compare_lte): Add prototype
+ (arrange_linetable): Ditto.
+ (record_include_begin): Ditto.
+ (record_include_end): Ditto.
+ (process_linenos): Ditto.
+ (xcoff_next_symbol_text): Ditto.
+ (scan_xcoff_symtab): Ditto.
+ (xcoff_initial_scan): Ditto.
+
+ * mips-tdep.c (mips_read_processor_type): Add parens around
+ bitwise-and operands in comparison; previous expression always
+ evaluated to 0 because of equality comparison of two constants.
+
+ * rs6000-tdep.c (skip_prologue): Add missing parens around
+ operands of logical-or so that first operand does not bind
+ to previous logical-and.
+
+ * configure.in: Expand "long long" test to include code that triggers
+ known problem on HPUX with native compiler.
+ (configure): Regenerated.
+
+Mon Jul 29 18:12:27 1996 Jeffrey A Law (law@cygnus.com)
+
+ * somsolib.c (som_solib_create_inferior_hook): Don't
+ warn if __d_pid can't be found.
+
+Sun Jul 28 10:46:39 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/mips/tm-mips.h (struct frame_info): Forward decl.
+ (struct type): Ditto.
+ (struct value): Ditto.
+
+ * config/mips/tm-mips.h (sigtramp_address): Move extern decl
+ from mips-tdep.c to here.
+ (sigtramp_end): Ditto.
+ (fixup_sigtramp): Ditto.
+
+ * config/mips/tm-mips.h (init_extra_frame_info): Add prototype.
+ (mips_frame_chain): Ditto.
+ (mips_step_skips_delay): Ditto.
+ (mips_frame_saved_pc): Ditto.
+ (mips_find_saved_regs): Ditto.
+ (mips_frame_num_args): Ditto.
+ (mips_pop_frame): Ditto.
+ (mips_extract_return_value): Ditto.
+ (mips_store_return_value): Ditto.
+ (mips_push_dummy_frame): Ditto.
+ (mips_push_arguments): Ditto.
+ (mips_do_registers_info): Ditto.
+ (ecoff_relocate_efi): Ditto.
+ (ecoff_relocate_efi): Ditto.
+ * irix4-nat.c (fetch_core_registers): Add prototype.
+ * mips-tdep.c (read_next_frame_reg): Add prototype
+ (heuristic_proc_start): Ditto.
+ (heuristic_proc_desc): Ditto.
+ (mips_print_register): Ditto.
+ * config/mips/nm-irix5.h (procfs_set_watchpoint): Add prototype.
+ (procfs_stopped_by_watchpoint): Ditto.
+ * config/mips/nm-irix4.h (procfs_set_watchpoint): Add prototype.
+ (procfs_stopped_by_watchpoint): Ditto.
+ * config/alpha/tm-alpha.h (ecoff_relocate_efi): Add prototype.
+ (struct symbol): Add forward decl for prototype.
+
+ * breakpoint.c (internal_breakpoint_number): Only needed if
+ GET_LONGJMP_TARGET or SOLIB_ADD is defined.
+
+ * objfiles.c (ecoff_relocate_efi): Remove prototype.
+
+Sat Jul 27 17:47:35 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Add test for "long long" support.
+ * configure: Regenerate with autoconf.
+ * acconfig.h: Add CC_HAS_LONG_LONG
+ * config.in: Regenerate with autoheader.
+ * config/mips/tm-mips64.h (FORCE_LONG_LONG): Remove
+ * config/sparc/tm-sp64.h (CC_HAS_LONG_LONG): Remove.
+ * config/mips/tm-vr4300el.h (CC_HAS_LONG_LONG): Remove.
+ * config/mips/tm-vr4300.h (CC_HAS_LONG_LONG): Remove.
+ * config/mips/xm-irix5.h (CC_HAS_LONG_LONG): Remove
+ (PRINTF_HAS_LONG_LONG): Remove.
+ (FORCE_LONG_LONG): Remove.
+ * config/powerpc/xm-aix.h (UINT_MAX): Undef and use gdb's version.
+ * config/convex/xm-convex.h (CC_HAS_LONG_LONG): Remove
+ (PRINTF_HAS_LONG_LONG): Remove.
+ * config/xm-nbsd.h (CC_HAS_LONG_LONG): Remove.
+ (PRINTF_HAS_LONG_LONG): Remove.
+ * config/pa/tm-hppa.h (GET_FIELD): Put parens around
+ subtraction inside shift. Put parens around subtraction
+ in operand of bitwise and.
+ (struct frame_info): Forward declare
+ if __STDC__ defined.
+ (frame_saved_regs): Ditto.
+ (struct value): Ditto.
+ (struct type): Ditto.
+ (struct inferior_status): Ditto.
+ (init_extra_frame_info): Add prototype.
+ (skip_prologue): Ditto.
+ (frameless_function_invocation): Ditto.
+ (frame_chain): Ditto.
+ (frame_chain_valid): Ditto.
+ (saved_pc_after_call): Ditto.
+ (hppa_fix_call_dummy): Ditto.
+ (hppa_push_arguments): Ditto.
+ (pa_do_registers_info): Ditto.
+ (in_solib_call_trampoline): Ditto.
+ (in_solib_return_trampoline): Ditto.
+ (push_dummy_frame): Ditto.
+ * convex-tdep.c (decout): Use print_longest rather than
+ fprintf_filtered.
+ * defs.h: Remove use of FORCE_LONG_LONG and __GNUC__ to set
+ CC_HAS_LONG_LONG.
+ (INT_MIN): Fix so it works correctly when assigned to a long long.
+ * valprint.c (longest_to_int): Rewrite to remove dependence
+ on INT_MIN and INT_MAX.
+ (print_longest): Rewrite the code that falls back to synthesized
+ hex output when LONGEST value is not representable as in a long and
+ printf doesn't support printing long longs.
+ * ch-valprint.c (chill_val_print): Cast 2nd arg of
+ chill_print_type_scalar to LONGEST.
+ chill_print_type_scalar): Make static and add prototype.
+ * hppa-tdep.c (get_field): Ifdef out unused function.
+ (set_field): Ditto.
+ (extract_3): Ditto.
+ (extract_5_store): Ditto.
+ (extract_11): Ditto.
+ (extract_12): Ditto.
+ (deposit_17): Ditto.
+ (extract_14): Convert to static and add prototype.
+ (deposit_14): Ditto.
+ (extract_21): Ditto.
+ (deposit_21): Ditto.
+ (extract_17): Ditto.
+ (extract_5r_store): Ditto.
+ (extract_5R_store): Ditto.
+ (extract_5_load): Ditto.
+ (find_proc_framesize): Ditto.
+ (find_dummy_frame_regs): Ditto.
+ (sign_extend): Ditto.
+ (find_unwind_entry): Add prototype.
+ (find_return_regnum): Ditto.
+ (unwind_command): Ditto.
+ (find_dummy_frame_regs): Add parens around subtraction in operand
+ of bitwise-and.
+ (skip_prologue): Add parens around operands of logical-and inside
+ operand of logical-or.
+ (sign_extend): Add parens around operands of subtraction inside
+ operand of shift.
+ (low_sign_extend): Ditto.
+ * top.c (filename_completer): Convert old style decl of
+ filename_completion_function into prototype.
+ * f-lang.c (patch_common_entries): Ifdef out unused function.
+ * stabsread.c (read_cfront_baseclasses): Remove unused local
+ variable "msg_noterm".
+ (resolve_cfront_continuation): Remove unused local variable "fip".
+ (read_type): Remove unused variable xtypenums.
+ (read_cfront_static_fields): Remove unused variable "i".
+ (read_cfront_static_fields): Remove unused variable "nfields".
+ (read_cfront_member_functions): Add missing comment terminator.
+ (read_cfront_static_fields): Return 1 rather than random value.
+ (read_cfront_baseclasses): Ditto.
+ (read_cfront_baseclasses): Ditto.
+ (read_cfront_baseclasses): Ditto.
+ * somsolib.c (som_solib_create_inferior_hook): Remove unused
+ variable "u".
+ (som_solib_create_inferior_hook): Remove unused variable
+ shadow_contents.
+ (language.h): Add for needed prototypes.
+ (som_solib_sharedlibrary_command): Add prototype.
+ * hpread.c: (hpread_read_array_type): Add prototype.
+ * somread.c (hpread_build_pysmtabs): Add prototype.
+ (hpread_symfile_finish): Ditto.
+ (hpread_symfile_init): Ditto.
+ * hppah-nat.c (fetch_register): Convert old style decl
+ to prototype.
+ (gdbcore.h): Include for needed prototypes.
+ (fetch_register): Remove unused variable "mess".
+ * remote-pa.c (get_offsets): Ifdef out unused function.
+ (remote_start_remote): Remove unused variable "timeout".
+ (boot_board): Add prototype.
+ (reaad_frame): Add prototype.
+ (getpkt): Remove unused variable "bp".
+ (remote_kill): Add prototype.
+ (remote_mourn): Add prototype.
+ (remote_insert_breakpoint): Add prototype.
+ (remote_remove_breakpoint): Add prototype.
+ * valops.c (value_push): Only use if PUSH_ARGUMENTS is not defined.
+ * infcmd.c (do_registers_info): Only need prototype if
+ DO_REGISTERS_INFO is not defined.
+ (breakpoint_auto_delete_contents): Only need if
+ CALL_DUMMY_BREAKPOINT_OFFSET is defined.
+
+Sat Jul 27 08:49:49 1996 Fred Fish <fnf@cygnus.com>
+
+ * xcoffread.c (xcoff_end_psymtab): Add textlow_not_set parameter.
+ (END_PSYMTAB): Ditto.
+ (scan_xcoff_symtab): Call xcoff_end_psymtab with textlow_not_set.
+
+Fri Jul 26 14:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * printcmd.c (_initialize_printcmd): Initialize
+ tm_print_insn_info.flavour.
+
+Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (scm-valprint.o): Depends upon gdbcore_h.
+ (arm-tdep.o): Ditto.
+ (dcache.o): Ditto.
+ (i386ly-tdep.o): Ditto.
+ (i960-tdep.o): Ditto.
+ (m68k-tdep.o): Ditto.
+ (nindy-tdep.o): Ditto.
+ (scm-lang.o): Ditto.
+ (w65-tdep.o): Ditto.
+ (z8k-tdep.o): Ditto.
+ (m68k-tdep.o): Depends upon value_h and gdb_string.h
+ (m2-valprint.o): Depends upon m2-lang.h.
+ (sparc-tdep.o): Depends upon gdb_string.h
+ (valprint.o): Depends upon valprint.h
+
+ * remote-e7000.c (notice_quit): Remove prototype.
+ * top.c (initialize_targets): Remove prototype, now in target.h.
+ * stabsread.c (resolve_cfront_continuation): Remove prototype.
+ * dbxread.c (resolve_cfront_continuation): Remove prototype.
+ * symfile.h (set_demangling_style): Remove prototype.
+ * config/tm-sysv4.h (in_plt_section): Remove prototype, in objfiles.h.
+ * config/sparc/tm-sparc.h (single_step): Remove extern decl, now in
+ target.h.
+ * config/arc/tm-arc.h (one_stepped, single_step): Remove extern decls,
+ now in target.h.
+ * ser-unix.c (hardwire_restore): Remove obsolete prototype.
+ * sparc-tdep.c (single_step): Remove forward decl of isbranch.
+ * scm-lang.c (find_function_in_inferior): Remove prototype.
+ (value_allocate_space_in_inferior): Ditto.
+ * infrun.c (write_pc_pid): Remove prototype, now in inferior.h.
+ * defs.h (strchr): Remove declarations, they are declared in
+ gdb_string.h also.
+ (strrchr): Ditto.
+ (strstr): Ditto.
+ (strtok): Ditto.
+ (strerror): Ditto.
+ * f-valprint.c (f77_print_array_1): Remove extra arg that was being
+ passed to f77_print_array_1.
+ * gdbtypes.c (add_name): Remove unused variables lenstrlen and lenstr.
+ * scm-exp.c (scm_istr2int): Remove unused variable "j".
+ (scm_parse): Remove unused variable "str".
+ * hp300ux-nat.c (store_inferior_register): Remove unused variable
+ "buf".
+ (store_inferior_registers): Remove unnecessary decl "registers".
+ * m68k-tdep.c (m68k_pop_frame): Remove unused variable "fi".
+ * scm-lang.c (scm_get_field): Remove unused variable "val".
+ (scm_lookup_name): Remove unused variable "symval".
+ * objfiles.c (map_to_file): Remove unused local variable "tempfd".
+ * procfs.c (do_attach, do_detach): Remove unused variable "result".
+ (last_resume_pid): Remove unused static variable.
+ * alpha-tdep.c (alpha_linux_sigtramp_offset): Remove unused variable
+ "res".
+ * objfiles.c (map_to_address): Remove unused function.
+ * f-valprint.c (print_max): Remove extraneous extern decl,
+ in valprint.h.
+ (calc_f77_array_dims): Remove extraneous prototype, in f-lang.h.
+ * ch-exp.c (write_lower_upper_value): Remove prototype for
+ type_lower_upper.
+
+ * gdbtypes.c (cfront_mangle_name): #ifdef out unused function.
+ * ch-exp.c (parse_mode_call): Ditto.
+ * f-valprint.c (there_is_a_visible_common_named): Ditto.
+ * f-lang.c (clear_function_list): Ditto.
+ (get_bf_for_fcn): Ditto.
+ (clear_bf_list): Ditto.
+ (add_common_block): Ditto.
+ (patch_all_commons_by_name): Ditto.
+ (find_first_common_named): Ditto.
+ (add_common_entry): Ditto.
+ (allocate_saved_function_node): Ditto.
+ (allocate_saved_bf_node): Ditto.
+ (allocate_common_entry_node): Ditto.
+ (allocate_saved_f77_common_node): Ditto.
+
+ * arm-tdep.c (gdbcore.h): Include for necessary prototypes.
+ * dcache.c (gdbcore.h): Ditto.
+ * i386ly-tdep.c (gdbcore.h): Ditto.
+ * i960-tdep.c (gdbcore.h): Ditto.
+ * m2-valprint.c (m2-lang.h): Ditto.
+ * m68k-tdep.c (gdbcore.h): Ditto.
+ (value.h): Ditto.
+ (gdb_string.h): Ditto.
+ * nindy-tdep.c (gdbcore.h): Ditto.
+ * scm-lang.c (gdbcore.h): Ditto.
+ * scm-valprint.c (gdbcore.h): Ditto.
+ * w65-tdep.c (gdbcore.h): Ditto.
+ * z8k-tdep.c (gdbcore.h): Ditto.
+ * sparc-tdep.c (gdb_string.h): Include.
+ * valprint.c (valprint.h): Include.
+
+ * config/xm-lynx.h: Remove part of comment about INT_MIN
+ redefined warnings from defs.h, since INT_MIN define in
+ defs.h is now protected by #ifndef INT_MIN.
+ * config/i386/xm-i386bsd.h: Ditto.
+ * config/m68k/xm-hp300bsd.h: Ditto.
+ * config/m68k/xm-news.h: Ditto.
+
+ * config/pa/xm-hppah.h (INT_MIN): Remove bogus INT_MIN
+ definition as 0x80000000. The macro in defs.h is better.
+ * config/i386/xm-i386m3.h (INT_MIN): Ditto.
+ * config/i386/xm-i386mach.h (INT_MIN): Ditto.
+ * config/ns32k/xm-ns32km3.h (INT_MIN): Ditto.
+ * config/pa/xm-hppab.h: Ditto.
+
+ * core-aout.c (fetch_core_registers): Add prototype.
+ * hp300ux-nat.c (fetch_inferior_register): Ditto.
+ (store_inferior_register_1): Ditto.
+ (store_inferior_register): Ditto.
+ * config/m68k/tm-m68k.h (find_saved_regs): Ditto.
+ *scm-valprint.c (c_val_print): Ditto.
+ * procfs.c (add_fd): Ditto.
+ (remove_fd): Ditto.
+ (wait_fd): Ditto.
+ (sigcodename): Ditto.
+ (sigcodedesc): Ditto.
+ (procfs_kill_inferior): Ditto.
+ (procfs_xfer_memory): Ditto.
+ (procfs_store_registers): Ditto.
+ (create_procinfo): Ditto.
+ (procfs_init_inferior): Ditto.
+ (proc_set_exec_trap): Ditto.
+ (procfs_attach): Ditto.
+ (procfs_detach): Ditto.
+ (procfs_prepare_to_store): Ditto.
+ (procfs_files_info): Ditto.
+ (procfs_open): Ditto.
+ (procfs_wait): Ditto.
+ (procfs_fetch_registers): Ditto.
+ (procfs_mourn_inferior): Ditto.
+ (procfs_can_run): Ditto.
+ (procfs_thread_alive): Ditto.
+ (procfs_stop): Ditto.
+ * alpha-nat.c (fetch_core_registers): Ditto.
+ * config/alpha/tm-alpha.h (alpha_osf_skip_sigtramp_frame): Ditto.
+ * objfiles.c (ecoff_relocate_efi): Ditto.
+ * inflow.c (pass_signal): Ditto.
+ (handle_sigio): Ditto.
+ * annotate.c (breakpoint_changed): Ditto.
+ * callback.c (wrap): Ditto.
+ (fdbad): Ditto.
+ (fdmap): Ditto.
+ * utils.c (malloc_botch): Ditto.
+ (fputs_maybe_filtered): Ditto.
+ (vfprintf_maybe_filtered): Ditto.
+ * defs.h (notice_quit): Ditto.
+ * defs.h (xmalloc, xrealloc): Ditto.
+ * top.c (stop_sig): Ditto.
+ (init_signals): Ditto.
+ (user_defined_command): Ditto.
+ (source_cleanup_lines): Ditto.
+ (dont_repeat_command): Ditto.
+ (serial_log_command): Ditto.
+ (disconnect): Ditto.
+ * target.h (initialize_targets): Ditto.
+ * os9kread.c (read_minimal_symbols): Ditto.
+ * mdebugread.c (mdebug_psymtab_to_symtab): Ditto.
+ (fdr_name): Ditto.
+ (push_parse_stack): Ditto.
+ (pop_parse_stack): Ditto.
+ (is_pending_symbol): Ditto.
+ (add_pending): Ditto.
+ * serial.c (serial_logchar): Ditto.
+ (serial_interface_lookup): Ditto.
+ * serial.h (serial_log_command): Ditto.
+ * f-valprint.c (info_common_command): Ditto.
+ * gdbtypes.h (print_type_scalar): Ditto.
+ * scm-valprint.c (scm_scmlist_print): Ditto.
+ (scm_ipruk): Ditto.
+ * scm-lang.c (scm_printstr): Ditto.
+ (in_eval_c): Ditto.
+ (evaluate_subexp_scm): Ditto.
+ * scm-exp.c (scm_read_token): Ditto.
+ (scm_skip_ws): Ditto.
+ (scm_lreadparen): Ditto.
+ * m2-lang.c (emit_char): Ditto.
+ (m2_printchar): Ditto.
+ (m2_printstr): Ditto.
+ (m2_create_fundamental_type): Ditto.
+ * f-lang.c (emit_char): Ditto.
+ (f_printchar): Ditto.
+ (f_printstr): Ditto.
+ (f_create_fundamental_type): Ditto.
+ * ch-lang.c (chill_printchar): Ditto.
+ (chill_printstr): Ditto.
+ (chill_create_fundamental_type): Ditto.
+ (value_chill_length): Ditto.
+ (value_chill_card): Ditto.
+ (value_chill_max_min): Ditto.
+ (evaluate_subexp_chill): Ditto.
+ * ch-exp.c (PEEK_TOKEN): Ditto.
+ (peek_token_): Ditto.
+ (forward_token_): Ditto.
+ (parse_case_label): Ditto.
+ (parse_opt_untyped_expr): Ditto.
+ (parse_unary_call): Ditto.
+ (parse_call): Ditto.
+ (parse_named_record_element): Ditto.
+ (parse_tuple_element): Ditto.
+ (parse_opt_element_list): Ditto.
+ (parse_tuple): Ditto.
+ (parse_primval): Ditto.
+ (parse_operand6): Ditto.
+ (parse_operand5): Ditto.
+ (parse_operand4): Ditto.
+ (parse_operand3): Ditto.
+ (parse_operand2): Ditto.
+ (parse_operand1): Ditto.
+ (parse_operand0): Ditto.
+ (parse_expr): Ditto.
+ (parse_then_alternative): Ditto.
+ (parse_else_alternative): Ditto.
+ (parse_if_expression): Ditto.
+ (parse_untyped_expr): Ditto.
+ (growbuf_by_size): Ditto.
+ (match_simple_name_string): Ditto.
+ (decode_integer_value): Ditto.
+ (decode_integer_literal): Ditto.
+ (match_float_literal): Ditto.
+ (match_float_literal): Ditto.
+ (match_string_literal): Ditto.
+ (match_character_literal): Ditto.
+ (match_integer_literal): Ditto.
+ (match_bitstring_literal): Ditto.
+ (write_lower_upper_value): Ditto.
+ * ch-lang.h (type_lower_upper): Ditto.
+ * c-lang.c (emit_char): Ditto.
+ * dwarfread.c (free_utypes): Ditto.
+ * stabsread.h (resolve_cfront_continuation): Ditto.
+ * stabsread.c (get_substring): Ditto.
+ (read_one_struct_field): Ditto.
+ * stabsread.h (process_later): Ditto.
+ * demangle.c (set_demangling_command): Ditto.
+ * defs.h (set_demangling_style): Ditto.
+ * maint.c (maintenance_info_command): Ditto.
+ (print_section_table): Ditto.
+ (maintenance_info_sections): Ditto.
+ (maintenance_print_command): Ditto.
+ * symtab.h (maintenance_print_statistics): Ditto.
+ * objfiles.h (in_plt_section): Ditto.
+ * objfiles.c (add_to_objfile_sections): Ditto.
+ * bcache.c (hash): Ditto.
+ (lookup_cache): Ditto.
+ * exec.c (bfdsec_to_vmap): Ditto.
+ (ignore): Ditto.
+ * f-exp.y (growbuf_by_size, match_string_literal): Ditto.
+ * language.c (unk_lang_printchar): Ditto.
+ (unk_lang_printstr): Ditto.
+ (unk_lang_create_fundamental_type): Ditto.
+ (unk_lang_print_type): Ditto.
+ (unk_lang_val_print): Ditto.
+ (unk_lang_value_print): Ditto.
+ * target.c (update_current_target): Ditto.
+ (debug_to_open): Ditto.
+ (debug_to_close): Ditto.
+ (debug_to_attach): Ditto.
+ (debug_to_detach): Ditto.
+ (debug_to_resume): Ditto.
+ (debug_to_wait): Ditto.
+ (debug_to_fetch_registers): Ditto.
+ (debug_to_store_registers): Ditto.
+ (debug_to_prepare_to_store): Ditto.
+ (debug_to_xfer_memory): Ditto.
+ (debug_to_files_info): Ditto.
+ (debug_to_insert_breakpoint): Ditto.
+ (debug_to_remove_breakpoint): Ditto.
+ (debug_to_terminal_init): Ditto.
+ (debug_to_terminal_inferior): Ditto.
+ (debug_to_terminal_ours_for_output): Ditto.
+ (debug_to_terminal_ours): Ditto.
+ (debug_to_terminal_info): Ditto.
+ (debug_to_kill): Ditto.
+ (debug_to_load): Ditto.
+ (debug_to_lookup_symbol): Ditto.
+ (debug_to_create_inferior): Ditto.
+ (debug_to_mourn_inferior): Ditto.
+ (debug_to_can_run): Ditto.
+ (debug_to_notice_signals): Ditto.
+ (debug_to_thread_alive): Ditto.
+ (debug_to_stop): Ditto.
+ * breakpoint.h (set_breakpoint_sal): Ditto.
+ * remote-utils.c (usage): Ditto.
+ * remote.c (set_thread): Ditto.
+ (remote_thread_alive): Ditto.
+ (get_offsets): Ditto.
+ (read_frame): Ditto.
+ (remote_insert_breakpoint): Ditto.
+ (remote_remove_breakpoint): Ditto.
+ * sparc-nat.c (fetch_core_registers): Ditto.
+ * corelow.c (add_to_thread_list): Ditto.
+ (ignore): Ditto.
+ * inftarg.c (proc_wait): Ditto.
+ * infptrace.c (udot_info): Ditto.
+ (fetch_register): Ditto.
+ * ser-unix.c (hardwire_noflush_set_tty_state): Ditto.
+ (hardwire_print_tty_state): Ditto.
+ (hardwire_flush_output): Ditto.
+ (hardwire_flush_input): Ditto.
+ (hardwire_send_break): Ditto.
+ (hardwire_setstopbits): Ditto.
+ * ser-tcp.c (tcp_return_0): Ditto.
+ (tcp_noflush_set_tty_state): Ditto.
+ (tcp_print_tty_state): Ditto.
+ * solib.c (match_main): Ditto.
+ * gdbtypes.c (print_bit_vector): Ditto.
+ (print_arg_types): Ditto.
+ (dump_fn_fieldlists): Ditto.
+ (print_cplus_stuff): Ditto.
+ * symfile.h (entry_point_address): Ditto.
+ * symfile.c (decrement_reading_symtab): Ditto.
+ * valops.c (value_arg_coerce): Ditto.
+ * value.h (find_function_in_inferior): Ditto.
+ (value_allocate_space_in_inferior): Ditto.
+ * values.c (vb_match): Ditto.
+ * thread.c (info_thread_command): Ditto.
+ (restore_current_thread): Ditto.
+ (thread_apply_all_command): Ditto.
+ (thread_apply_command): Ditto.
+ * inferior.h (write_pc_pid): Ditto.
+ * infrun.c (delete_breakpoint_current_contents): Ditto.
+ * breakpoint.c (print_it_normal): Ditto.
+ (watchpoint_check): Ditto.
+ (print_it_done): Ditto.
+ (print_it_noop): Ditto.
+ (maintenance_info_breakpoints): Ditto.
+ (create_longjmp_breakpoint): Ditto.
+ (hbreak_command): Ditto.
+ (thbreak_command): Ditto.
+ (watch_commnd_1): Ditto.
+ (rwatch_command): Ditto.
+ (awatch_command): Ditto.
+ (do_enable_breakpoint): Ditto.
+ * ch-valprint.c (chill_val_print_array_elements): Ditto.
+ * eval.c (evaluate_subexp): Ditto.
+ (get_label): Ditto.
+ (evaluate_struct_tuple): Ditto.
+ * eval.c (init_array_element): Ditto.
+
+ * alpha-tdep.c (push_sigtramp_desc): Add prototype and make static.
+ * breakpoint.c (hw_breakpoint_used_count): Ditto.
+ (hw_watchpoint_used_count): Ditto.
+ * findvar.c (write_register_gen): Ditto.
+ (read_register_pid): Ditto.
+ * symtab.c (cplusplus_hint): Ditto.
+ * infcmd.c (breakpoint_auto_delete_contents): Ditto.
+ * ch-valprint.c (chill_print_type_scalar): Ditto.
+ * gdbtypes.c (add_name): Ditto.
+ (add_mangled_type): Ditto.
+ (cfront_mangle_name): Ditto.
+ * sparc-tdep.c (isbranch): Ditto.
+ * inftarg.c (child_stop): Ditto.
+ * win32-nat.c (child_stop): Ditto.
+ * mac-nat.c (child_stop): Ditto.
+ * remote-utils.c (sr_com): Ditto.
+ * dbxread.c (process_now): Ditto.
+ * ch-exp.c (require): Ditto.
+ (check_token): Ditto.
+ (expect): Ditto.
+ (parse_mode_call): Ditto.
+ (parse_mode_or_normal_call): Ditto.
+ * scm-lang.c (scm_lookup_name): Ditto
+ * f-lang.c (allocate_saved_bf_node): Ditto.
+ (allocate_saved_function_node): Ditto.
+ (allocate_saved_f77_common_node): Ditto.
+ (allocate_common_entry_node): Ditto.
+ (add_common_block): Ditto.
+ (add_common_entry): Ditto.
+ (find_first_common_named): Ditto.
+ (patch_common_entries): Ditto.
+ (patch_all_commons_by_name): Ditto.
+ (clear_bf_list): Ditto.
+ (get_bf_for_fcn): Ditto.
+ (clear_function_list): Ditto.
+ * scm-exp.c (scm_istr2int): Ditto.
+ (scm_istring2number): Ditto.
+ * scm-valprint.c (scm_inferior_print): Ditto.
+ * f-typeprint.c (print_equivalent_f77_float_type): Ditto.
+ * f-valprint.c (f77_get_dynamic_length_of_aggregate): Ditto.
+ (f77_create_arrayprint_offset_tbl): Ditto.
+ (f77_print_array_1): Ditto.
+ (f77_print_array): Ditto.
+ (list_all_visible_commons): Ditto.
+ (there_is_a_visible_common_named): Ditto.
+ * mdebugread.c (ecoff_relocate_efi): Ditto.
+ * callback.c (os_close): Ditto.
+ (os_get_errno): Ditto.
+ (os_isatty): Ditto.
+ (os_lseek): Ditto.
+ (os_open): Ditto.
+ (os_read): Ditto.
+ (os_read_stdin): Ditto.
+ (os_write): Ditto.
+ (os_write_stdout): Ditto.
+ (os_rename): Ditto.
+ (os_system): Ditto.
+ (os_time): Ditto.
+ (os_unlink): Ditto.
+ (os_shutdown): Ditto.
+ (os_init): Ditto.
+ (os_printf_filtered): Ditto.
+
+ * scm-lang.h (scm_parse): Change old style decl to prototype.
+ * config/alpha/tm-alphalinux.h (alpha_linux_sigtramp_offset): Ditto.
+ * top.c (init_proc): Ditto.
+ (query_hook): Ditto.
+ (error_hook): Ditto.
+ * f-lang.c (c_value_print): Ditto.
+ * ch-exp.c (parse_expression): Ditto.
+ (parse_primval): Ditto.
+ (parse_untyped_expr): Ditto.
+ (parse_opt_untyped_expr): Ditto.
+ (ch_lex): Ditto.
+ * config/sparc/tm-sparc.h (sparc_init_extra_frame_info): Ditto.
+ (sparc_frame_saved_pc): Ditto.
+ (sparc_push_dummy_frame): Ditto.
+ (sparc_pop_frame): Ditto.
+ * defs.h (fclose): Ditto.
+ (atof): Ditto.
+ (error_hook): Ditto.
+
+ * arc-tdep.c (single_step): Change arg to type "enum target_signal".
+ * rs6000-tdep.c (single_step): Ditto.
+ * sparc-tdep.c (single_step): Ditto.
+
+ * breakpoint.c (cleanup_executing_breakpoints): Change unused arg type
+ to PTR which is what make_cleanup expects.
+ * utils.c (null_cleanup): Change arg type to PTR.
+ * defs.h (null_cleanup): Change prototype to match actual function.
+ * config/sparc/tm-sparc.h (struct frame_info): Move forward decl.
+ * ch-valprint.c (chill_val_print): Cast 2nd arg of
+ chill_print_type_scalar to LONGEST.
+ * infrun.c (wait_for_inferior): Have empty switch case for
+ BPSTAT_WHAT_CHECK_SHLIBS when SOLIB_ADD is not defined.
+ (stop_on_solib_events): Only needed if SOLIB_ADD is defined.
+ * infcmd.c (attach_command): Only need auto_solib_add if SOLIB_ADD
+ is defined.
+ * symfile.c (generic_load): Scan long int using a long int spec,
+ not an int spec.
+ * infptrace.c (udot_info): Only need local variables if KERNEL_U_SIZE
+ is defined.
+ (fetch_register): Only need function if FETCH_INFERIOR_REGISTERS is
+ not defined.
+ * inflow.c (handle_sigio): Only need prototype when the actual
+ function is compiled in.
+ * valprint.c (longest_to_int): Expand error message to be
+ separate messages for args larger than largest signed int
+ and args smaller than smallest signed int.
+ * valprint.c (print_longest): Fix problems with support for case
+ where compiler supports type "long long" but the runtime doesn't
+ support printing them with "%ll".
+ * scm-valprint.c (scm_scmlist_print, scm_scmval_print): Change
+ return types to void since we don't actually return anything
+ meaningful and callees ignore the values anyway.
+ * procfs.c (modify_inherit_on_fork_flag): Enclose pr_flags in PIOCSET
+ ifdef.
+ (modify_run_on_last_close_flag): Ditto.
+ (wait_fd): Enclose local variables "num_fds" and "i" LOSING_POLL
+ ifdef
+ * alpha-tdep.c (push_sigtramp_desc): Return proc_desc rather than
+ random value.
+ * infrun.c (wait_for_inferior): Ensure random_signal is not used
+ uninitialized.
+ * valops.c (call_function_by_hand): Ensure struct_addr is not used
+ uninitialized.
+ * breakpoint.c (watch_command_1): Ensure prev_frame is not used
+ uninitialized.
+ * utils.c (vfprintf_maybe_filtered): Change second arg from "char *"
+ to "const char *".
+ * infptrace.c (udot_info): Add two dummy args so that the type is
+ correct for passing to add_info.
+ * f-lang.c (saved_fcn): Move decl to head of file so it can be used
+ in prototypes.
+ (saved_bf_symnum): Ditto.
+ (SAVED_FUNCTION): Ditto.
+ (SAVED_FUNCTION_PTR): Ditto.
+ (SAVED_BF): Ditto.
+ (SAVED_BF_PTR): Ditto.
+ * ch-exp.c (parse_named_record_element): Build error message in
+ temporary buffer before passing it to expect, rather than passing
+ wrong number of args to expect.
+ * demangle.c (set_demangling_style): Call set_demangling_command with
+ correct number of arguments.
+ * inferior.h (terminal_init_inferior_with_pgrp): Change arg type to
+ int to match actual function.
+ (os_isatty): Call fdmap with right number of arguments, was missing
+ the host_callback* arg.
+ * target.c (cleanup_target): Prototype all functions casts.
+ * target.h (one_stepped, single_step): Declare here and convert
+ single_step to prototype.
+ * infrun.c (one_stepped, single_step): Don't declare externs
+ here, they have moved to target.h.
+ * eval.c (init_array_element): Declare previously undeclared
+ last two args as LONGEST.
+ * dcache.c (dcache_xfer_memory): Change xfunc decls to prototype form.
+
+Thu Jul 25 16:11:54 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * dsrec.c (load_srec): Protect ANSI style function parms with PARAMS.
+
+Mon Jul 22 18:13:27 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (os9kread.o): Remove dependency on partial-stab.h.
+ * dbxread.c (read_dbx_symtab end_psymtab), partial-stab.h: Don't
+ use partial_symtab->textlow==0 as a flag, as 0 is a legitimate
+ text address. Use a seperate flag (textlow_not_set) instead.
+ This makes stabs in ELF .o files work a lot better.
+ * mdebugread.c xcoffread.c: Define textlow_not_set for
+ partial-stab.h.
+ * stabsread.h (end_psymtab): Add textlow_not_set arg to prototype.
+
+Sat Jul 20 10:41:06 1996 Fred Fish <fnf@cygnus.com>
+
+ * dwarf2read.c (struct filenames): Change internal "struct file"
+ to "struct fileinfo" to avoid conflict with "struct file" in
+ <sys/file.h> on HPUX and Solaris.
+
+Fri Jul 19 14:05:57 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dwarf2read.c: New file, DWARF 2 reader originally contributed by
+ Brent Benson, with additions by Gary Funck and Jerry Kreuscher.
+ * Makefile.in (COMMON_OBS): Add dwarf2read.o.
+ (SFILES): Add dwarf2read.c.
+ (dwarf2read.o): Add build rule.
+ * symfile.h (dwarf2_has_info, dwarf2_build_psymtabs): Declare
+ exported functions.
+ * elfread.c (elf_symfile_read): Call them.
+ (elf_symtab_read) [HARRIS_TARGET]: Skip some special symbols.
+
+Thu Jul 18 01:22:01 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * symfile.c (symfile_bfd_open):
+ * exec.c (exec_file_command): for __GO32__ and __WIN32__ systems,
+ free the user from having to type the .exe extension.
+
+Wed Jul 17 06:54:50 1996 Mark Alexander <marka@cygnus.com>
+
+ * mon960-rom.c: Shorten the mon960_inits string to a single
+ carriage return; this prevents a hang on connecting immediately
+ after powerup, when MON960 is attempting autobaud detection.
+
+Tue Jul 16 23:47:04 1996 Mark Alexander <marka@cygnus.com>
+
+ * a29k-tdep.c (get_saved_register): Allow PC to be modified
+ when innermost frame is selected, but not in outer frames.
+
+Tue Jul 16 23:37:25 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * command.c (do_setshow_command): Don't segfault when showing
+ var_string and var_string_noescape vars that are NULL.
+
+Mon Jul 15 16:55:48 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * win32-nat.c (handle_load_dll): dos_path_to_unix_path renamed to
+ cygwin32_conv_to_posix_path.
+ (child_create_inferior): unix_path_to_dos_path renamed to
+ cygwin32_conv_to_win32_path. Rewrite code to translate PATH.
+
+Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * defs.h printcmd.c: Create global disassemble_info structure
+ tm_print_insn_info.
+ * i386-tdep.c (set_assembly_language_command): set
+ tm_print_insn_info.mach to the appropriate value for 386 or 8086
+ disassembly.
+ * printcmd.c (print_insn): Move init of disassembler_info to
+ _initialize_printcmd. Set endian for disassembler here.
+ * sparc-tdep.c: Set tm_print_insn_info.mach as appropriate to
+ select sparc/sparclite.
+ * config/sparc/{tm-sparc.h tm-sparclite.h}: Get rid of
+ TM_PRINT_INSN. Set TM_PRINT_INSN_MACH to
+ bfd_mach_sparc/bfd_mach_sparc_sparclite.
+
+Fri Jul 12 19:04:32 1996 Fred Fish <fnf@cygnus.com>
+
+ * hpread.c (hpread_lookup_type): Use xmmalloc/xmrealloc rather
+ than xmalloc/xrealloc.
+
+Fri Jul 12 17:59:47 1996 Fred Fish <fnf@cygnus.com>
+
+ * objfiles.c (map_to_file): Error return from mmalloc_findbase is
+ a NULL pointer, not a -1.
+
+Fri Jul 12 10:16:24 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * i386-tdep.c (set_assembly_language_command): New routine to
+ select between i386 and i8086 instruction sets for disassembly.
+ New command `set assembly-language {i386 i8086}'.
+
+Thu Jul 11 21:13:21 1996 Mark Alexander <marka@cygnus.com>
+
+ * monitor.c (monitor_write_memory, monitor_read_memory_single):
+ Disable use of "long long" memory read/write commands; can't
+ use them because we hold the values to read/write in an int
+ variable, and because strtoul fails on values that exceed the
+ size of a long. This fixes breakpoint problems on MON960.
+
+Thu Jul 11 11:39:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/m68k/xm-hp300hpux.h (HAVE_MMAP): Remove definition.
+ * config/pa/xm-hppah.h (HAVE_MMAP): Ditto.
+
+Wed Jul 10 16:54:41 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (MMALLOC_CFLAGS): Eliminate intermediate MMALLOC_DISABLE
+ and MMALLOC_CHECK macros, and add comment indicating how host dependent
+ makefile fragment should modify MMALLOC_CFLAGS to not use mmalloc, or
+ to use it but to not do heap corruption checking.
+ * gdbserver/Makefile.in: Ditto.
+ * utils.c (init_malloc): Replace warning() use with direct call of
+ fprintf_unfiltered, since current_target has not yet been set and thus
+ we cannot use warning(). If we try to use mmcheck and it fails,
+ suggest that this configuration needs NO_MMCHECK or MMCHECK_FORCE
+ defined. Other small mmalloc related cleanups.
+ * config/sparc/sun4os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1.
+ * config/alpha/alpha-osf2.mh (MMALLOC_CFLAGS): Set to -DNO_MMCHECK.
+
+ * config/sparc/xm-sun4os4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/i386/xm-i386v4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/i386/xm-linux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/m68k/xm-hp300hpux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/m68k/xm-m68kv4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT);
+ * config/m68k/xm-sun3os4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/pa/xm-hppah.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ * config/sparc/xm-sun4sol2.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ Remove obsolete defines.
+
+ * config/alpha/alpha-linux.mh (MMALLOC_DISABLE):
+ * config/alpha/alpha-osf1.mh (MMALLOC_DISABLE):
+ * config/rs6000/rs6000.mh (MMALLOC_DISABLE):
+ * config/rs6000/aix4.mh (MMALLOC_DISABLE):
+ * config/powerpc/aix4.mh (MMALLOC_DISABLE):
+ * config/powerpc/aix.mh (MMALLOC_DISABLE):
+ * config/ns32k/ns32km3.mh (MMALLOC_DISABLE):
+ * config/mips/mipsm3.mh (MMALLOC_DISABLE):
+ * config/mips/decstation.mh (MMALLOC_DISABLE):
+ * config/m88k/cxux.mh (MMALLOC_DISABLE):
+ * config/i386/i386mk.mh (MMALLOC_DISABLE):
+ * config/i386/i386m3.mh (MMALLOC_DISABLE):
+ * config/i386/i386gnu.mh (MMALLOC_DISABLE):
+ Use MMALLOC_CFLAGS instead.
+
+Tue Jul 9 22:41:12 1996 Jeffrey A Law (law@cygnus.com)
+
+ * h8300-tdep.c: Remove some outdated comments.
+ (h8300_skip_prologue): Rework to be more correct for the H8/300H.
+ Handle stm.l insns for the H8/S.
+ (examine_prologue): Likewise.
+
+Tue Jul 9 16:48:55 1996 Raymond Jou <rjou@mexican.cygnus.com>
+
+ * ser-mac.c (mac_close): Change a typo SetSetBuf to SerSetBuf.
+
+Mon Jul 08 08:50:39 1996 Mark Alexander <marka@cygnus.com>
+
+ * mon960-rom.c (mon960_open): Add floating point detection to
+ prevent hang on non-FPU processors (PR 9775).
+ (mon960_cmds): Swap setmem.cmdw and setmem.cmdl to fix problem
+ setting breakpoints and improve loading speed.
+
+Sun Jul 7 14:57:34 1996 Fred Fish <fnf@cygnus.com>
+
+ * coffread.c (record_minimal_symbol): Don't presave name string
+ on symbol_obstack before passing to prim_record_minimal_symbol.
+ It now handles saving the string itself.
+ * dbxread.c (read_dbx_dynamic_symtab): Ditto.
+ * mipsread.c (read_alphacoff_dynamic_symtab): Ditto.
+ * os9kread.c (record_minimal_symbol): Ditto.
+ * solib.c (solib_add_common_symbols): Ditto.
+
+ * coffread.c (coff_symtab_read): Don't presave name string on
+ symbol_obstack before passing to prim_record_minimal_symbol_and_info.
+ It now handles saving the string itself.
+ * dbxread.c (record_minimal_symbol): Ditto.
+ * elfread.c (record_minimal_symbol_and_info): Ditto.
+
+ * dstread.c (record_minimal_symbol): Remove static function that just
+ called prim_record_minimal_symbol with the same args (after change to
+ prim_record_minimal_symbol to do it's own name string saves).
+ * nlmread.c (record_minimal_symbol): Ditto.
+ * somread.c (record_minimal_symbol): Ditto.
+
+ * hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack.
+ (hpread_read_function_type): Ditto.
+ (hpread_process_one_debug_symbol): Ditto.
+ * mdebugread.c (parse_symbol): Ditto.
+ (new_symbol): Ditto.
+ * minsyms.c (prim_record_minimal_symbol_and_info): Ditto.
+
+ * coffread.c (process_coff_symbol): Use obsavestring to save
+ SYMBOL_NAME, rather than obstack_copy0.
+ * dstread.c (create_new_symbol): Ditto
+ * symfile.c (obconcat): Ditto.
+ * stabsread.c (patch_block_stabs): Ditto.
+ * xcoffread.c (SYMNAME_ALLOC): Ditto.
+
+ * symfile.c (obsavestring): Update comments
+ * solib.c (solib_add_common_symbols): Remove local var origname.
+
+Wed Jul 3 15:56:08 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure: Re-build with autoconf-2.10.
+
+ * sparcl-tdep.c (_initialize_sparc_tdep) config/sparc/tm-sparc.h,
+ config/sparc/tm-sparclite.h: Initialize tm_print_insn from
+ TM_PRINT_INSN, which comes from the tm file.
+
+Tue Jul 02 21:41:20 1996 Mark Alexander <marka@cygnus.com>
+
+ * coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c,
+ os9kread.c: Replace identical sym_offsets functions with
+ default_symfile_offsets.
+ * somread.c (som_symfile_offsets): Use new SIZEOF_SECTION_OFFSETS
+ macro to allocate section_offsets.
+ * symfile.c (default_symfile_offsets): New function.
+ * symfile.h: Declare default_symfile_offsets.
+ * symtab.h: Define SIZEOF_SECTION_OFFSETS macro to
+ simplify allocation of section_offsets.
+
+Tue Jun 11 12:02:55 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure.
+ * configure configure.in: Only make sol-thread.o for native.
+ Also, switch to dlopened libthread_db.so.1.
+ * sol-thread.c: Switch to using dlopen to get the thread_db
+ library.
+
+Thu Jun 13 16:53:25 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure, configure.in: Change test for libthread_db to only
+ work for configs where build/host/target are the same.
+
+Tue Jul 2 15:04:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/{linux.mh,xm-linux.h}: New files, for Linux on
+ PowerPC.
+
+ * configure.in (powerpc-*-linux): Add Linux, System V, and ELF
+ support.
+ * configure: Regenerate.
+
+Mon Jul 1 13:00:43 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Raymond Jou <rjou@mexican.cygnus.com>:
+ * mpw-make.sed: Add lines to whack out autoconf hook
+ @CONFIG_LDFLAGS@.
+
+Mon Jul 01 11:07:15 1996 Mark Alexander <marka@cygnus.com>
+
+ * remote-e7000.c (e7000_stop): New function.
+
+Fri Jun 28 06:34:19 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * configure, configure.in: Add target sparclet.
+ * monitor.h, monitor.c: Added monitor flags MO_NO_ECHO_ON_SETMEM
+ (don't expect echo on setmem command), MO_RUN_FIRST_TIME (if
+ command to start process running on target is different from one
+ to continue execution), MO_HEX_PREFIX (if addresses from monitor
+ have a "0x" prefix).
+ * monitor.c, parse.c, sparc-tdep.c: Don't require strings in the
+ registers array. This is to allow NULLs to be place holders in
+ the tm-*.h file so that only minor changes are needed when a new
+ processor is introduced (eg, one without floating point).
+ * sparc-tdep.c: Conditionally remove dependancies on floating
+ point.
+ * sparclet-rom.c, config/sparc/sparclet.mt,
+ config/sparc/tm-sparclet.h: New files for target sparclet.
+ * symfile.c (load_command): Add option for 2nd parameter; a load
+ offset added to the vma of each section.
+
+Fri Jun 28 05:39:19 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * main.c (main): Add option "l" for setting remote_timeout.
+
+Fri Jun 28 05:25:18 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * remote-e7000.c, remote.c, target.h, top.c: Add set option
+ "remote_timeout" for setting remote_timeout. Add set option
+ "use_hard_breakpoints" for setting hardware .vs. memory
+ breakpoints.
+
+Fri Jun 28 04:32:18 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * remote-e7000.c (e7000_parse_device): New function.
+ Add option "tcp_remote" to target command if using
+ tcp to connect to a remote host which is then connected
+ via serial port to the e7000 (for exampole, a port master).
+ (e7000_open): Change to call e7000_parse_device.
+
+Fri Jun 28 03:47:17 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * monitor.c (monitor_debug): Fix remotedebug buffering.
+
+Thu Jun 27 18:24:17 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/i386/cygwin32.mh, config/powerpc/cygwin32.mh
+ (NATDEPFILES): Add a space.
+
+Wed Jun 26 06:05:39 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * gdbtypes.c (create_array_type): If TYPE_LENGTH (result_type)
+ is zero, set TYPE_FLAG_TARGET_STUB to force reevaluation of the type.
+
+ * ch-exp.c (calculate_array_length): Function removed.
+
+Tue Jun 25 17:41:06 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * remote-e7000.c (e7000_read_inferior_memory_large): New function.
+ (e7000_xfer_inferior_memory): Call it.
+
+Tue Jun 25 23:14:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * gdb/gdbserver/Makefile.in (docdir): Removed.
+
+Tue Jun 25 22:05:38 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir):
+ Use autoconf set values.
+ (docdir): Removed.
+ * configure.in (AC_PREREQ): autoconf 2.5 or higher.
+ * nlm/Makefile.in (bindir, libdir, datadir, mandir, infodir,
+ includedir): Use autoconf set values.
+ (docdir): Removed.
+ * nlm/configure.in (AC_PREREQ): autoconf 2.5 or higher.
+ * nlm/configure: Rebuilt.
+ * gdb/gdbserver/Makefile.in (datadir): Set to $(prefix)/share.
+
+Mon Jun 24 09:56:14 1996 Angela Marie Thomas (angela@cygnus.com)
+
+ * stabsread.c (read_cfront_member_functions): add type
+
+Sun Jun 23 23:40:48 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * win32-nat.c: #include <unistd.h>.
+ (unix_paths_to_dos_paths, dos_paths_to_unix_paths): Delete.
+ (child_create_inferior): Convert only env var PATH to win32 style.
+ (set_pathstyle_dos): Delete.
+ (_initialize_inftarg): Delete dos-path-style command.
+
+Thu Jun 20 13:42:23 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in: Revise sol-thread.o test.
+ * configure: Regenerated.
+
+ * source.c (find_source_lines): Reassign size to result of read.
+
+Tue Jun 18 16:25:54 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * h8300-dep.c (gdb_print_insn_h8300): Handle the H8/S.
+ (h8300_command): Likewise.
+ (set_machine): Likewise.
+ (set_machine_hook): Likewise.
+ (_initialize_h8300m): Likewise.
+
+ * config/h8300/tm-h8300.h (h8300smode): Declare.
+
+Sun Jun 16 15:21:51 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * somsolib.c (som_solib_create_inferior_hook): Handle tracking
+ of shl_load calls for hpux10.
+
+Thu Jun 13 11:16:10 1996 Tom Tromey <tromey@thepub.cygnus.com>
+
+ * config.in: Regenerated.
+ * acconfig.h (HAVE_THREAD_DB_LIB): Added entry.
+
+ * configure: Regenerated.
+ * aclocal.m4 (CY_AC_PATH_TCLH, CY_AC_PATH_TKH): Use odd names to
+ avoid name clashes with SunOS headers.
+
+Tue Jun 11 19:52:50 1996 Fred Fish <fnf@cygnus.com>
+
+ From Michael Snyder <Michael_Snyder@next.com>:
+ * bcache.c (print_bcache_statistics): Avoid divide-by-zero
+ exception if one or more objfile has no symbols, such as when
+ a dynamic library has been stripped.
+
+Tue Jun 11 12:02:55 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure.
+ * configure configure.in: Only make sol-thread.o for native.
+ Also, switch to dlopened libthread_db.so.1.
+ * sol-thread.c: Switch to using dlopen to get the thread_db
+ library.
+
+Mon Jun 10 14:17:19 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/sparc/{xm-sun4sol2.h,xm-sun4os4.h} (MMAP_BASE_ADDRESS):
+ Change from 0xE0000000 to 0xC0000000.
+
+Thu Jun 6 17:10:32 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/xm-solaris.h: Initial version of support for
+ Solaris on PowerPC.
+
+Wed Jun 5 01:52:57 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * configure.in (configdirs): Force 4100 builds to use 4300 GDB
+ target.
+ * configure: Rebuild.
+
+ * config/mips/vr4300el.mt (SIM_OBS): Include simulator in
+ little-endian builds.
+
+Mon Jun 3 11:48:29 1996 Jeffrey A Law (law@cygnus.com)
+
+ * inftarg.c (child_thread_alive): Protect declaration with
+ #ifndef CHILD_THREAD_ALIVE.
+
+ * source.c (find_source_lines): Check the time on the symtab's bfd if
+ it exists, else check the time on the exec_bfd.
+
+Thu May 30 09:43:17 1996 Mark Alexander <marka@cygnus.com>
+
+ * dsrec.c (make_srec): Fix calculation of address size
+ to allow addresses less than 0x100.
+
+Thu May 30 04:24:09 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-exp.c (ch_lex): In case of LOC_TYPEDEF call calculate_array_length.
+
+Tue May 28 16:15:47 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * remote-mips.c: cannot use EINVAL for breakpoint test since
+ its value varies for different hosts (e.g. go32's is 19, while
+ sunos is 22). Changed to hardcoded 22 since that is what the
+ mips boards return.
+
+Tue May 28 11:14:58 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * configure: Regenerated.
+ * aclocal.m4 (CY_AC_PATH_TCLH): Don't use AC_TRY_RUN.
+ (CY_AC_PATH_TKH): Don't use AC_TRY_RUN.
+
+Sun May 26 16:56:35 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * solib.c (solib_absolute_prefix, solib_search_path): New variables.
+ (_initialize_solib): Add set/show commands for those variables.
+ (solib_map_sections): Implement searching using them.
+
+Sun May 26 14:14:49 1996 Fred Fish <fnf@cygnus.com>
+
+ Changes from: David Mosberger-Tang <davidm@azstarnet.com>
+
+ * NEWS: Add Alpha Linux as a new native configuration.
+
+ * mdebugread.c (parse_symbol): When we find a malloc() symbol with
+ return type VOID, assume no debugging info is available for that
+ object file and patch the return value into VOID *. Otherwise,
+ operations requiring an implicit call to malloc() will fail.
+
+ * infrun.c (wait_for_inferior): The criterion to detect entering a
+ sigtramp handler is now: (a) the current pc is inside a sigtramp
+ handler, (b) the previous pc is not in a sigtramp handler, and (c)
+ the current stack pointer is "inner" than the old one. Condition
+ (c) is new to avoid mistaking a return from a signal handler into
+ sigtramp as a new sigtramp invocation.
+
+ * dcache.c (struct dcache_block): Declare addr as CORE_ADDR. An
+ int may not be big enough to hold an address.
+ (dcache_hit): Ditto.
+ (dcache_peek_byte): Fix indentation.
+
+ * configure.in (alpha-*-linux*): Add target.
+ * configure: Rebuild
+
+ * config/alpha/tm-alpha.h (PROC_DESC_IS_DYN_SIGTRAMP): New macro.
+ (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (DYNAMIC_SIGTRAMP_OFFSET): Ditto.
+ (SIGCONTEXT_ADDR): Ditto.
+ (FRAME_PAST_SIGTRAMP_FRAME): Ditto.
+
+ * config/alpha/alpha-linux.mh: New file.
+ * config/alpha/alpha-linux.mt: Ditto.
+ * config/alpha/nm-linux.h: Ditto.
+ * config/alpha/tm-alphalinux.h: Ditto.
+ * config/alpha/xm-alphalinux.h: Ditto.
+ * config/alpha/xm-alphaosf.h: Renamed from xm-alpha.h.
+ * config/alpha/alpha-osf1.mh (XM_FILE): Change from xm-alpha.h to
+ xm-alphaosf.h.
+ * config/alpha/alpha-osf2.mh: Ditto.
+
+ * blockframe.c (find_pc_partial_function): Pass PC to
+ SIGTRAMP_START and SIGTRAMP_END macros for the benefit of systems
+ that detect sigtramp code via designated code sequences (as is the
+ case for Linux/Alpha, for example).
+
+ * config/i386/tm-i386bsd.h: Change SIGTRAMP_START and SIGTRAMP_END
+ to ignore new PC argument.
+ * config/m68k/tm-hp300bsd.h: Ditto.
+ * config/vax/tm-vax.h: Ditto.
+
+ * alpha-tdep.c (alpha_linux_sigtramp_offset): New function.
+ (alpha_osf_skip_sigtramp_frame): Ditto.
+ (push_sigtramp_desc): Ditto.
+ (alpha_find_saved_regs): Use SIGCONTEXT_ADDR macro to extract
+ sigcontext address from frame.
+ (alpha_saved_pc_after_call): When in sigtramp, use
+ alpha_frame_saved_pc() instead of read-register().
+ (after_prologue): When inside a dynamically generated sigtramp
+ function, there is no prologue, so return address of first
+ instruction.
+ (alpha_in_prologue): Fix typo in comment.
+ (find_proc_desc): Use macro DYNAMIC_SIGTRAMP_OFFSET to determine
+ whether we're inside a dynamicaly generated sigtramp function. If
+ so, create and push and appropriate procedure descriptor.
+ (alpha_frame_chain): Use macro FRAME_PAST_SIGTRAMP_FRAME to obtain
+ the frame past a sigtramp frame (if the current frame is indeed a
+ sigtramp function).
+ (init_extra_frame_info): Don't read next frame register off of
+ stack-pointer when inside a dynamiccaly generated sigtramp.
+ (alpha_pop_frame): Also unlink and destroy procedure descriptors
+ created for dynamically generated sigtramp functions.
+
+ * alpha-nat.c: When compiling under Linux, include <asm/reg.h> and
+ <alpha/ptrace.h> instead of <machine/reg.h>
+
+Tue Jul 2 13:58:10 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_validate_task_sc):
+ Give terminal to gdb while asking question.
+ (inf_resume): Don't validate the task suspend-count while execing.
+
+Thu Jun 13 11:04:52 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_validate_task_sc): Query user before clearing any
+ additional suspend count.
+ (S_proc_wait_reply, gnu_attach): Don't call inf_validate_task_sc.
+ (inf_resume): Call inf_validate_task_sc here.
+ (gnu_resume): Call inf_update_procs to ensure noticing new threads.
+
+Fri Jun 7 17:00:43 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (gnu_create_inferior: attach_to_child): Return PID.
+
+Thu May 23 15:13:56 1996 Jeffrey A Law (law@cygnus.com)
+
+ * h8300-tdep.c (IS_PUSH): Refine.
+ (IS_MOVE_FP, IS_MOV_SP_FP): Accept H8/300H varaints.
+ (IS_SUB4_SP, IS_SUBL_SP): New macros.
+ (h8300_skip_prologue): Handle H8/300H prologue code sequences.
+ (examine_prologue): Handle addresses from 0x010000 to 0xffffff
+ when in H8/300H mode. Get the return pointer's address correctly
+ for the H8/300H. Handle H8/300H prolouge code sequences.
+
+ * symfile.c (generic_load): Print the starting address
+ of the file just loaded.
+
+Thu May 23 12:09:52 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Edit @THREAD_DB_OBS@ out of makefile.
+
+Tue May 21 11:53:56 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (bpstat_do_actions): Avoid endless recursion
+ if a `source' command is contained in bs->commands.
+
+ * infrun.c (wait_for_inferior): Update step_frame_address when
+ stepping into a new line.
+
+ From schwab@issan.informatik.uni-dortmund.de (Andreas Schwab):
+ * breakpoint.c (breakpoint_1): Add shlib_disabled case to
+ bpenables array.
+
+Mon May 20 22:52:00 1996 Mark Alexander <marka@cygnus.com>
+
+ * dsrec.c (load_srec): Add WAITACK parameter, for machines
+ like EST visionICE that send back an ACK after each S-record.
+ * monitor.c (monitor_wait_srec_ack): New function.
+ (monitor_load): Pass monitor_wait_srec_ack to load_srec
+ if the monitor's MO_SREC_ACK flag is set.
+ * monitor.h: Define MO_SREC_ACK flag.
+ * remote-est.c (est_cmds): Add MO_SREC_ACK flag.
+ * sh3-rom.c (sh3_load): Accomodate change in load_srec prototype.
+ * srec.h: Add WAITACK parameter to load_srec prototype.
+
+Sun May 19 21:22:00 1996 Rob Savoye <rob@chinadoll>
+
+ * config/sparc/sparclite.mt: Add the sparc simulator.
+
+Sun May 19 16:49:37 1996 Fred Fish <fnf@cygnus.com>
+
+ * defs.h (read_command_lines, query_hook): Update prototypes.
+ (readline_begin_hook, readline_hook, readline_end_hook): Declare.
+ * breakpoint.c (commands_command): Build message in temporary buffer
+ and pass that, as well as tty control flag, to read_command_lines.
+ * top.c (readline_begin_hook, readline_hook, readline_end_hook):
+ Define here.
+ (command_loop): Check for non-NULL instream before looping.
+ (command_line_input): Use readline_hook when appropriate, to get
+ user input from a GUI window.
+ (read_next_line): Also build prompt if getting user input from a GUI.
+ (recurse_read_control_structure): Fix typo in comment.
+ (read_command_lines): Use passed in prompt and tty flag to decide how
+ to build message. Use readline_begin_hook when appropriate, to set
+ up a GUI interaction window. Just return head, whether NULL or not,
+ after using readline_end_hook to complete GUI interaction.
+ (define_command, document_command): Build message in a temporary
+ buffer and pass it to read_command_lines, along with tty flag.
+
+
+Sat May 18 02:43:58 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c (frameless_look_for_prologue):
+ Add FUNCTION_START_OFFSET only if func_start is non-zero.
+ * minsyms.c (lookup_minimal_symbol_by_pc): Return NULL if
+ pc is not in a known section.
+ * stack.c (print_frame_info): Remove check for fi->pc in known
+ section, now handled by lookup_minimal_symbol_by_pc.
+
+
+Fri May 17 13:31:04 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * sh-stub.c: New file, was config/sh/stub.c.
+
+
+Wed May 15 08:25:12 1996 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (read_next_line): Fix thinkos. From Donn Seeley.
+
+ * coffread.c (coff_symtab_read): Handle C_LABEL symbols like
+ C_STAT symbols.
+ * h8300-tdep.c (h8300_pop_frame): Reset $sp and $pc correctly.
+ Flush cached frames just before exiting.
+ * remote-sim.c (gdbsim_resume): Complain if the program isn't
+ being run.
+ * config/h8300/tm-h8300.h (BELIEVE_PCC_PROMOTION): Define.
+
+Tue May 14 18:05:16 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * procfs.c (procfs_thread_alive procfs_stop): Make static.
+ (procfs_pid_to_str): New routine to print out thread id's in an
+ intelligible manner.
+ * sol-thread.c (sol_thread_fetch_registers): Re-order manner in
+ which supply_register is called to fix bug with writing
+ individual regs.
+ * config/sparc/tm-sun4sol2.h: Define default for
+ target_pid_to_str in case host lacks libthread_db.
+
+Mon May 13 23:53:30 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in config.in configure configure.in
+ config/sparc/nm-sun4sol2.h config/sparc/sun4sol2.mh
+ config/sparc/tm-sun4sol2.h: Use autoconf to config Solaris thread
+ and pthread support, since pre-2.5 systems don't come with
+ libthread_db.so.1.
+
+ * procfs.c (info_proc): Use int instead of id_t. Old versions of
+ Irix don't seem to define this.
+
+Mon May 13 17:40:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (execute_control_command, case while_control): Allow
+ a while command to be interrupted.
+
+Mon May 13 16:17:36 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * sol-thread.c: More cleanup, add comments.
+ (sol_thread_resume): Prevent people from trying to step
+ inactive threads.
+ (sol_thread_wait sol_thread_fetch_registers
+ sol_thread_store_registers): Remove unnecessary check for
+ sol_thread_active. These routines won't get called unless threads
+ are active.
+
+Mon May 13 11:29:37 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ SH3-E support from Allan Tajii <atajii@hmsi.com>:
+ * sh-tdep.c (sh_reg_names, sh3_reg_names): Add empty names for
+ float registers.
+ (sh3e_reg_names): New register name array.
+ (sh_processor_type_table): Add sh3e processor type.
+ * config/sh/tm-sh.h (REGISTER_VIRTUAL_TYPE): Fix test.
+ (REGISTER_NAMES, NUM_REGS, NUM_REALREGS, etc): Adjust for
+ full set of registers.
+ * remote-e7000.c (want_sh3, want_sh3_nopc): New globals.
+ (e7000_fetch_registers, e7000_wait): Use them.
+ * sh3-rom.c (sh3_regnames): Add float registers.
+ (sh3e_cmds, sh3e_ops): New globals.
+ (sh3e_open): New function.
+ (_initialize_sh3_rom): Rename from _initialize_sh3, set up
+ sh3e target vector.
+
+Fri May 10 15:53:38 1996 Stu Grossman (grossman@lisa.cygnus.com)
+
+ * sol-thread.c: Cleanup. gcc -Wall fixes. Add prototypes.
+ Print out messages instead of codes for thread_db errors. Make
+ access macros for thread and lwp manipulation. Make cleanups to
+ fixup inferior_pid in case of errors.
+
+Thu May 9 19:06:02 1996 Fred Fish <fnf@cygnus.com>
+
+ * aclocal.m4: Remove unused definition of AC_C_CROSS.
+ * configure.in: Add powerpcle-*-solaris* host and target config
+ so April 30th change does not get lost next time configure is
+ rebuilt.
+
+Thu May 9 14:13:08 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in, breakpoint.c, corelow.c, fork-child.c, inflow.c,
+ infrun.c, mac-nat.c, procfs.c, remote.c, sol-thread.c, thread.c,
+ win32-nat.c, config/nm-lynx.h: Rename thread.h to gdbthread.h to
+ avoid conflict with Solaris /usr/include/thread.h.
+
+Thu May 9 12:33:32 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * abug-rom.c: Config file for the older style ABug monitor that
+ runs on the mvme13x boards.
+ * config/m68k/monitor.mt: Add abug support for m68k cross
+ debugging.
+
+Wed May 8 20:33:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * infcmd.c (do_registers_info): Always print the raw floating
+ point value's bytes in big endian order, so the the leftmost bit
+ is the most significant.
+ * breakpoint.c (clear_momentary_breakpoints): Remove dead code
+ that is referenced nowhere else.
+ (set_breakpoint): Ditto.
+ (do_enable_breakpoint): Created from enable_once_breakpoint
+ with a couple of changes.
+ (enable_breakpoint): Call do_enable_breakpoint with an appropriate
+ bpdisp enum value to set disposition of breakpoint.
+ (enable_once_breakpoint): Ditto.
+ (enable_delete_breakpoint): Ditto.
+ * breakpoint.h (clear_momentary_breakpoints): Remove prototype.
+ * symtab.c (find_pc_line): Improve comments.
+ * xcoffread.c: Ditto.
+
+Tue May 7 18:37:06 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * target.c (debug_to_xfer_memory): Insert line breaks when
+ dumping the memory block.
+
+Mon May 6 13:52:52 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * fork-child.c (fork_inferior), inferior.h: init_trace_fun now
+ returns a possibly modified pid.
+ * inftarg.c (ptrace_him): Now returns pid;
+ * m3-nat.c (m3_trace_him): Now returns pid;
+ * infcmd.c (run_command): Minor cleanup.
+ * infrun.c (wait_for_inferior): Add another check for one_stepped
+ near where we read the pc to avoid erroneously setting
+ random_signal for multi-threaded support.
+ * procfs.c: Add support for Solaris LWPs. Remove def of
+ LOSING_POLL. Many cleanups... Several workarounds for Solaris
+ lossage. System call entry and exit are now handled by
+ dynamically registered handlers.
+ * (syscallname): Don't barf when handed an unknown syscall
+ number.
+ * (info_proc_syscalls): Ditto.
+ * sol-thread.c: New file. Implements Solaris thread support.
+ * symfile.c (symbol_file_add): Add call to target_new_objfile to
+ notify target-dependent code about new symbol tables.
+ * (clear_symtab_users): Call target_new_objfile to notify it of
+ the removal of all symbol tables.
+ * target.c (push_target): Make sure that to_close is non-zero
+ before calling it.
+ * target.h (target_new_objfile): Provide default.
+ * config/alpha/nm-osf2.h: Define LOSING_POLL because this version
+ of OSF can't hack using poll with /proc.
+ * config/sparc/nm-sun4sol2.h (target_new_objfile): Define to be
+ sol-thread-new-objfile.
+ * config/sparc/sun4sol2.mh: Add sol-thread.o to NATDEFFILES, and
+ add libthread_db.so.1 to NAT_CLIBS.
+ * config/sparc/tm-sun4sol2.h: Define PIDGET, TIDGET, and
+ target_pid_to_str.
+
+Sat May 4 02:13:34 1996 N Srin Kumar <nsrin@wipinfo.soft.net>
+
+ * procfs.c (remove_fd): Fix copy of fds to fill hole left after
+ removal of the requested fd.
+
+Mon May 6 07:52:48 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * rs6000-tdep.c (_initialize_rs6000_tdep): Don't do XCOFF specific
+ hooks under ELF.
+
+ * config/powerpc/tm-ppc-eabi.h: Define ELF_OBJECT_FORMAT.
+
+Thu May 2 12:46:14 1996 Jeffrey A Law (law@cygnus.com)
+
+ From Peter Schauer:
+ * breakpoint.h (enum bpdisp): Add del_at_next_stop.
+ * breakpoint.c (insert_breakpoints, watchpoint_check,
+ bpstat_stop_status): Avoid bad references to memory freed via
+ delete_breakpoint on watchpoints going out of scope.
+ Do not delete these watchpoints, disable them and change their
+ disposition to del_at_next_stop instead.
+ (breakpoint_auto_delete): Delete all breakpoints whose disposition
+ is del_at_next_stop.
+ (breakpoint_init_inferior): Use switch to avoid reference to
+ already deleted breakpoint.
+
+Wed May 1 17:29:18 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (rs6000-nat.o): Depend on xcoffsolib.h.
+ * config/rs6000/rs6000.mh (NATDEPFILES): Move xcoffread.o ...
+ * config/rs6000/rs6000.mt (TDEPFILES): ... to here.
+ * xcoffsolib.c (xcoff_relocate_symtab_hook): Define and initialize.
+ (solib_info): Call xcoff_relocate_symtab via the hook.
+ (sharedlibrary_command): Ditto.
+ * xcoffread.c: Remove all FAKING_RS6000 comments and defines.
+ (xcoff_add_toc_to_loadinfo_hook): Define and initialize here.
+ (xcoff_init_loadinfo_hook): Define and initialize here.
+ (scan_xcoff_symtab): Call xcoff_add_toc_to_loadinfo via the hook.
+ (xcoff_initial_scan): Call xcoff_init_loadinfo via the hook.
+ * xcoffsolib.h (xcoff_relocate_symtab_hook): Declare extern func.
+ * rs6000-tdep.c (_initialize_rs6000_tdep): Add initializations
+ of xcoff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook.
+ * rs6000-nat.c (_initialize_core_rs6000): Add initialization
+ of xcoff_relocate_symtab_hook.
+
+Tue Apr 30 13:22:02 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure (powerpcle-*-solaris*): Add Solaris support.
+
+ * config/powerpc/{solaris.m[ht],tm-solaris.h}: New files for
+ Solaris support.
+
+Mon Apr 29 16:17:31 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * c-valprint.c (c_val_print): Fix printing for arrays defined
+ with 0 length.
+
+Sun Apr 28 15:08:05 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ Support for bi-endian remote breakpoints.
+ * remote.c (big_break_insn, little_break_insn): New globals.
+ (break_insn): Remove.
+ (remote_insert_breakpoint, remote_remove_breakpoint): Use own
+ code if REMOTE_BREAKPOINT defined, otherwise call memory
+ breakpoint functions.
+ * config/sh/tm-sh.h (REMOTE_BREAKPOINT): Remove.
+ (BIG_REMOTE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT): Define.
+
+ * mon960-rom.c (mon960_cmds): Remove forward decl.
+ (mon960_load): Use current_monitor instead of mon960_cmds.
+ (mon960_regnames): Remove backslashes from line ends.
+ (_initialize_mon960): Fix documentation string.
+
+Sun Apr 28 12:10:35 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.h (psymbol_allocation_list): Expand comments which
+ describe the psymbol allocation list and how each field is
+ used.
+
+Sun Apr 28 03:44:30 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (delete_breakpoint): Fix bpt->val, bpt->exp
+ storage leaks.
+ (breakpoint_re_set_one): Fix b->exp, b->val, b->cond storage leaks.
+
+ * infcmd.c (run_command), solib.c (locate_base): Check for
+ target_has_execution in addition to inferior_pid, a core file
+ from a threaded program is yielding a non-zero inferior_pid.
+
+ * sparc-tdep.c (get_saved_register): Handle window registers
+ in a dummy frame correctly.
+
+Sat Apr 27 20:38:32 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (CLIBS): Move $(MMALLOC) past all other libs,
+ so that anything that wants an allocation function not yet pulled
+ in, will get it from mmalloc rather than a system library.
+ * Makefile.in (INSTALLED_LIBS): Reorder to match order of CLIBS,
+ to avoid surprising results when used.
+
+Sat Apr 27 00:12:05 1996 Dawn Perchik (dawn@cygnus.com)
+
+ * stabsread.c: Changes and bug fixes for cfront support.
+ Fix bug for class data members.
+ Fix parsing bug when no base classes exist.
+ Fix memory bug - allocate space for cplusplus specific info.
+ Add support for static data.
+ Add prototypes for static functions.
+ Enhance comments to show what each function expects to parse.
+ Cleanup code.
+ * stabsread.c(resolve_cont),dbxread.c(resolve_cont): Rename
+ function to resolve_cfront_continuation.
+
+Fri Apr 26 23:58:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Call registers_changed when
+ restarting the inferior to get over a nullified instruction.
+
+Tue Apr 24 12:12:55 1996 Dawn Perchik (dawn@cygnus.com)
+
+ * dbxread.c,stabsread.c,gdbtypes.c,partial-stab.h,valops.c:
+ Add new support for parsing cfront stabs.
+
+Wed Apr 24 00:32:55 1996 Jeffrey A Law (law@cygnus.com)
+
+ * infrun.c (wait_for_inferior): Move "have_waited" label
+ outside of #ifdef conditionals. Don't trash the wait status
+ if we get a signal and the current instruction is nullified.
+
+Mon Apr 22 20:17:01 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VERSION): Bump version number to 4.16.1.
+ * NEWS: Update for 4.16 release.
+
+Mon Apr 22 16:32:29 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.h: Clean up comment formatting.
+ (current_monitor): Remove decl.
+ (LOADTYPES, LOADPROTOS, INIT_CMD, etc): Remove definitions.
+ (push_monitor, SREC_SIZE): Remove.
+ * monitor.c: Expand old macro into current_monitor derefs
+ everywhere.
+ * remote-os9k.c (current_monitor): Remove definition.
+
+Mon Apr 22 14:54:45 1996 Mark Alexander <marka@superball.cygnus.com>
+
+ * corefile.c (specify_exec_file_hook): Allow arbitrary number of
+ hooks.
+ (call_extra_exec_file_hooks): New function.
+ * h8300-tdep.c: Lint; add .h files to provide missing declarations,
+ remove unused variables.
+ (set_machine_hook): New function.
+ (_initialize_h8300m): Initialize it.
+
+Fri Apr 19 15:03:49 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * remote-mips.c (encoding): Don't specify size, to avoid bug in
+ SunOS native compiler.
+
+Thu Apr 18 18:46:57 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c: Use int rather than LONGEST for values, since
+ the formatting strings are not prepared to accept long longs.
+
+Wed Apr 17 20:17:27 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * arm-tdep.c (initialize_arm_tdep): Make apcs32 a `zinteger'.
+
+Tue Apr 16 17:38:23 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * corelow.c (add_to_thread_list): Make sure reg_sect is non-null
+ before de-referencing it. Prevents deref of NULL pointer if core
+ file lacks .reg section.
+ * defs.h: Rename floatformat_{to from}_long_double to
+ floatformat_{to from}_doublest. Get rid of FLOATFORMAT_{TO
+ FROM}... macros.
+ * findvar.c (extract_floating store_floating): Change all refs to
+ FLOATFORMAT_{FROM TO}... to floatformat_{from to}_doublest.
+ * utils.c: Change floatformat_{to from}_long_double to
+ floatformat_{to from}_doublest cuz the new routines will use
+ whatever size (double or long double) is appropriate.
+ * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL
+ REGISTER_CONVERT_TO_RAW): Change FLOATFORMAT... macros to
+ floatformat... routine calls.
+
+Mon Apr 15 16:34:11 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * stabsread.c (read_type): Move handling of '@' from type
+ number handling to handling of types proper (as emitted by gcc!).
+ For typedefs, allocate the typedef type before reading its
+ definition, to properly handling recursive types.
+
+Mon Apr 15 11:19:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * ch-exp.c (calculate_array_length): Fix prototype.
+
+Sat Apr 13 14:21:16 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote-nindy.c (nindy_open): Acquire more target state so that
+ user can attach to a previously running program.
+ * (nindy_fetch_registers nindy_store_registers): Get rid of fp
+ conversion code. That's all handled in {extract store}_floating
+ now.
+ * utils.c (floatformat_to_double): Don't bias exponent when
+ handling zero's, denorms or NaNs.
+ * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL
+ REGISTER_CONVERT_TO_RAW): Change to using DOUBLST and
+ FLOATFORMAT_TO/FROM_DOUBLEST macros.
+ * config/i960/tm-nindy960.h: Undefine
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, and
+ REGISTER_CONVERTIBLE. These are no longer necessary now that all
+ the magic happens in extract/store_floating.
+
+Sat Apr 13 02:58:02 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * eval.c (evaluate_subexp_standard): Report error when attempting to
+ evaluate subscripts for types which cannot be subscripted.
+
+ * valarith.c (value_x_binop, value_x_unop): Add noside parameter.
+ Return a zero value with the return type of the member function
+ if noside is EVAL_AVOID_SIDE_EFFECTS instead of calling the member
+ function.
+ * values.h (value_x_binop, value_x_unop): Update prototypes
+ accordingly.
+ * eval.c (evaluate_subexp_standard): Update all callers of
+ value_x_binop, value_x_unop accordingly.
+
+ * valarith.c (value_neg, value_complement): Perform ANSI C/C++
+ integral promotion on operands.
+
+Fri Apr 12 13:19:27 1996 Fred Fish <fnf@cygnus.com>
+
+ * README: Update for 4.16 release.
+ * configure.in (AC_CHECK_FUNCS): Also check for sbrk.
+ * configure: Regenerate with autoconf.
+ * config.in: Regenerate with autoheader.
+ * main.c (main): Only use sbrk() when HAVE_SBRK is defined.
+ * top.c (command_loop): Ditto.
+
+Fri Apr 12 09:45:29 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * defs.h: Define TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT
+ defaults for bi-endian targets. Replace function pointers for
+ floatformat routines with macros. No need for these to be runtime
+ selectable.
+ * findvar.c: Get rid of floatformat function pointers. Use
+ macros in extract_floating and store_floating.
+ * remote-nindy.c (nindy_fetch_registers nindy_store_registers):
+ Use floatformat macros.
+
+Thu Apr 11 21:28:02 1996 Fred Fish <fnf@cygnus.com>
+
+ From: Miles Bader <miles@gnu.ai.mit.edu>
+ * configure.in (AC_CHECK_HEADERS): check for endian.h.
+ Use AC_CHECK_TOOL to find AR & RANLIB. Add AC_PROG_AWK.
+ Add host & target cases for i[345]86-*-gnu*.
+ * config.in: Regenerate with autoheader.
+ * configure: Regenerate with autoconf.
+ * Makefile.in (AR, AWK): Set from corresponding autoconf substs.
+ (init.c): Don't scan mig-generated files.
+ * defs.h (endian.h): Include if HAVE_ENDIAN_H defined.
+ * config/nm-m3.h (ATTACH_NO_WAIT): Define.
+ * infcmd.c (attach_command): Use "#ifndef ATTACH_NO_WAIT"
+ rather than "#ifndef MACH".
+
+Thu Apr 11 18:49:42 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (remotewritesize): New GDB variable, controls size
+ of memory packets sent to the target.
+
+Thu Apr 11 13:47:52 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dcache.c: Add prototypes. Make many functions static.
+ * (dcache_peek dcache_fetch dcache_poke): Make dcache_fetch and
+ dcache_poke call dcache_xfer_memory directly in order to fix
+ problems with turning off dcache. dcache_peek is now unnecessary,
+ so it goes away.
+
+ * defs.h: Define new macros HOST_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT
+ and TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT to specify a pointer
+ to a struct floatformat. This allows for better handling of
+ targets whose floating point formats differ from the host by more
+ than just byte order.
+ * (floatformat_to_long_double floatformat_from_long_double):
+ Prototypes for new functions in utils.c.
+ * (floatformat_to_doublest floatformat_from_doublest): Prototypes
+ for pointers to floating point conversion functions. The actual
+ function uses either double or long double if the host supports it.
+ * findvar.c (floatformat_to_doublest floatformat_from_doublest):
+ Initialize to point at correct function depending on HAVE_LONG_DOUBLE.
+ * (extract_floating store_floating): Rewrite. Now, if host fp
+ format is the same as the target, we just do a copy. Otherwise,
+ we call floatformat_{to from}_doublest.
+ * remote-nindy.c (nindy_xfer_inferior_memory): Change param
+ `write' to `should_write'.
+ * utils.c (floatformat_to_long_double
+ floatformat_from_long_double): New routines that implement long
+ double versions of functions in libiberty/floatformat.c.
+ * config/i960/tm-i960.h (TARGET_LONG_DOUBLE_FORMAT): Define this for
+ i960 extended real (80 bit) numbers.
+ * nindy-share/nindy.c (ninMemGet ninMemPut): Return number of bytes
+ actually read or written.
+
+Wed Apr 10 02:56:06 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-valprint.c (chill_val_print): Remove call to calculate_array_length.
+ (calculate_array_length): Move function from here ...
+
+ * ch-exp.c (calculate_array_length): ... to here.
+ (parse_primval): If we have a symbol with an array type
+ and the length is 0, call calculate_array_length.
+
+Tue Apr 9 01:23:05 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): In case of TYPE_CODE_SET:
+ Add some checks for powerset compatibility.
+
+ * valops.c (value_slice): Use lowbound instead of lowerbound for
+ call to slice_range_type to get correct bounds.
+
+Mon Apr 8 12:53:56 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (scm-exp.o, scm-lang.o, scm-valprint.o): Add targets and
+ dependencies.
+ * scm-lang.c (gdb_string.h): Include.
+ * objfiles.c (add_to_objfile_sections): Cast second arg of obstack_grow
+ call to correct type (char *).
+ * cp-valprint.c (cp_print_static_field): Ditto.
+ * somsolib.c (som_solib_create_inferior_hook): Add a declaration
+ for external find_unwind_entry function (from hppa-tdep.c).
+ * remote-pa.c (remote_write_bytes, remote_read_bytes): Change
+ type of second arg to "char *" to be type compatible with
+ dcache.
+ (remote_wait): Cast second arg to strtol to correct type.
+ * hppa-tdep.c (compare_unwind_entries): Change argument types to
+ "const void *" to be type compatible with qsort, and then
+ assign to local args prior to use.
+
+Mon Apr 8 15:35:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * infptrace.c (kill_inferior): Remove call to "kill"; update
+ comments.
+
+Mon Apr 8 14:05:07 1996 Geoffrey Noer <noer@cygnus.com>
+
+ * remote-e7000.c: don't append :23 to target port if __WIN32__
+ is defined (it's WinGDB).
+
+Sun Apr 7 22:34:29 1996 Fred Fish <fnf@cygnus.com>
+
+ From: Miles Bader <miles@gnu.ai.mit.edu>
+ * gnu-nat.c, gnu-nat.h, msg.defs, exc_request.defs, i386gnu-nat.c,
+ msg_reply.defs, notify.defs, process_reply.defs, reply_mig_hack.awk,
+ config/nm-gnu.h, config/i386/{i386gnu.mh, i386gnu.mt, nm-gnu.h,
+ m-i386gnu.h, xm-i386gnu.h}: New files for GNU hurd.
+
+Sun Apr 7 13:32:41 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (case host): Add i386sco5 host.
+ * configure: Regenerate.
+
+ From: Robert Lipe <robertl@dgii.com>
+ Add support for SCO OpenServer 5 (a.k.a. 3.2v5*) This
+ target is an SVR3.2 with COFF, ELF, and shared libes, but
+ no /proc.
+ * config/i386/i386sco5.mh: New file.
+ * config/i386/nm-i386sco5.h: New file.
+
+Sat Apr 6 08:55:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * bcache.c (bcache): When size of chunk to cache is exactly equal to
+ BCACHE_MAXLENGTH, stash chunk as unique copy.
+
+Sat Apr 6 00:46:26 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (INLINE_ADD_PSYMBOL): Remove ifdef.
+ (add_psymbol_to_list): Add an arg for passing CORE_ADDR values and
+ use it, rather than calling add_psymbol_addr_to_list.
+ (add_psymbol_addr_to_list): Delete.
+ (add_psymbol_to_list): Make psymbol static to avoid random data in
+ gaps due to alignment of structure members.
+ * symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST,
+ ADD_PSYMBOL_ADDR_TO_LIST): Remove. Real world tests show no
+ performance improvements by inlining via complicated macros and
+ they just make gdb larger and harder to maintain.
+ * dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST
+ and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to
+ add_psymbol_to_list with appropriate long or CORE_ADDR args.
+ (add_partial_symbol): Ditto.
+ * partial-stab.h: Ditto.
+ * os9kread.c (read_os9k_psymtab): Ditto
+ * mdebugread.c (parse_partial_symbols): Ditto.
+ (handle_psymbol_enumerators): Ditto.
+ (demangle.h): Include.
+ * hpread.c (hpread_build_psymtabs): Ditto.
+ (hpread_build_psymtabs): Ditto.
+ (demangle.h): Include
+
+Thu Apr 4 20:16:55 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Check for setpgid function.
+ * config.in: Regenerate with autoheader.
+ * configure: Regenerate with autoconf.
+ * inflow.c (_initialize_inflow): Only try to use _SC_JOB_CONTROL
+ if it is actually defined.
+ (gdb_setpgid): Use HAVE_SETPGID.
+ * ch-exp.c: Change include of <string.h> to "gdb_string.h".
+ * c-exp.y, f-exp.y, m2-exp.y: Ditto.
+ * c-exp.y, serial.c: Include <ctype.h>.
+ * config/m68k/nm-news.h: Add typedef for pid_t which is
+ apparently missing from <sys/types.h>. Enclose entire
+ file in NM_NEWS_H ifndef and define when included.
+ * config/mips/nm-news-mips.h: Ditto.
+ * config/m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Change name of temporary variable.
+
+Thu Apr 4 19:04:18 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * arm-xdep.c: Move native-specific code to here from arm-tdep.c.
+ * arm-tdep.c (arm_apcs_32): New global.
+ (arm_addr_bits_remove, arm_saved_pc_after_call,
+ arm_push_dummy_frame, arm_pop_frame): New functions.
+ (arm_skip_prologue): Updated version from Richard Earnshaw.
+ (_initialize_arm_tdep): Add set/show "apcs32".
+ * config/arm/tm-arm.h (ADDR_BITS_REMOVE): Call
+ arm_addr_bits_remove.
+ (SAVED_PC_AFTER_CALL): Call arm_saved_pc_after_call.
+ (frame_find_saved_regs): Declare properly.
+ (PUSH_DUMMY_FRAME): Call arm_push_dummy_frame.
+ (POP_FRAME): Call arm_pop_frame, use ADDR_BITS_REMOVE instead of
+ explicit mask.
+ * config/arm/nm-arm.h: New file.
+ * config/arm/xm-arm.h (KERNEL_U_ADDR, FETCH_INFERIOR_REGISTERS):
+ Move definitions to nm-arm.h.
+ * config/arm/arm.mh (NAT_FILE): Define.
+
+ * symfile.c (generic_load): Initialize data_count properly.
+
+Thu Apr 4 17:17:53 1996 Fred Fish <fnf@cygnus.com>
+
+ * symmisc.c (print_objfile_statistics): Print memory used by
+ psymbol cache obstack.
+
+Thu Apr 4 15:43:07 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * symfile.c (report_transfer_performance): New function.
+ (generic_load): Call it to report transfer rate.
+ * remote-e7000.c (e7000_load): Ditto.
+
+Mon Apr 1 16:31:00 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Change references to config.h to be in objdir,
+ edit out rules to rebuild config.h.
+
+Mon Apr 1 08:32:23 1996 Fred Fish <fnf@cygnus.com>
+
+ * hppa-tdep.c (hppa_pop_frame): Call clear_proceed_status before
+ proceeding.
+
+Sun Mar 31 16:15:43 1996 Fred Fish <fnf@cygnus.com>
+
+ * hppah-nat.c (store_inferior_registers, store_inferior_registers,
+ fetch_register, child_xfer_memory): Use call_ptrace function supplied
+ by infptrace.c rather than calling ptrace directly.
+
+Sun Mar 31 15:39:00 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mon960-rom.c: Cleanups and elimination of unused code,
+ clarify documentation string.
+ (mon960_serial, mon960_ttyname): Remove.
+ * config/i960/tm-mon960.h (ADDITIONAL_OPTIONS,
+ ADDITIONAL_OPTION_CASES, ADDITIONAL_OPTION_HELP): Remove.
+
+Sat Mar 30 11:00:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Check whether printf family supports printing
+ long doubles or not and define PRINTF_HAS_LONG_DOUBLE if so.
+ * acconfig.h: Provide default undef for PRINTF_HAS_LONG_DOUBLE.
+ * configure: Regenerate.
+ * valprint.c (print_floating): Use PRINTF_HAS_LONG_DOUBLE.
+ * c-exp.y (parse_number): Use PRINTF_HAS_LONG_DOUBLE.
+ * configure.in: Fix have_gregset and have_fpregset autoconf
+ variable names so that they match the pattern required to
+ cache them.
+
+Fri Mar 29 21:39:56 1996 Fred Fish <fnf@cygnus.com>
+
+ * core-aout.c (fetch_core_registers): Cast core_reg_size to int
+ before testing against reg_ptr.
+ * eval.c (evaluate_subexp_standard): Cast type of
+ TYPE_FN_FIELD_VOFFSET to int.
+ * findvar.c (extract_signed_integer, extract_unsigned_integer,
+ extract_long_unsigned_integer): Cast type of sizeof to int.
+ * values.c (unpack_field_as_long, modify_field): Ditto.
+ * valops.c (value_assign, call_function_by_hand): Ditto.
+ * infcmd.c (do_registers_info): Ditto.
+ * ser-tcp.c (tcp_open): Ditto.
+ * remote.c (putpkt): Ditto.
+ * dcache.c (dcache_peek): Ditto.
+ * dcache.c (dcache_poke): Ditto.
+ * m2-exp.y (yylex): Ditto.
+ * gnu-regex.c (re_match_2): Ditto.
+ * f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef
+ out unused macro definition and variables.
+ * inftarg.c (proc_wait): Move from main.c to here, and make static.
+ * valprint.c (val_print_string): Change bufsize from int to unsigned.
+ * main.c (wait.h): Include.
+ * top.c (command_line_input): Remove unused variable "c".
+ * f-typeprint.c (f_type_print_varspec_prefix): Add missing enum
+ value TYPE_CODE_TYPEDEF to switch statement.
+ (f_type_print_varspec_suffix): Add missing enum value
+ TYPE_CODE_TYPEDEF to switch statement.
+ * ch-exp.c (parse_primval): Add remaining enumeration values to
+ switch statement, with no specific action.
+ (ch_lex): Add LOC_UNRESOLVED in switch statement.
+ (pushback_token): Ifdef out, since code using it is ifdef'd out.
+ * stabsread.c (cleanup_undefined_types): Remove unused label
+ "badtype".
+ * objfiles.h (print_symbol_bcache_statistics): Add prototype.
+ * maint.c (objfiles.h): Include.
+ (maintenance_print_statistics): Remove unused variable "temp".
+ * minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove
+ unused variable "found_file_symbol".
+ * m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch.
+ * language.c (lang_bool_type): Use existing function local type
+ variable rather than create block local variables.
+ * solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS.
+ * infptrace.c (wait.h, command.h): Include.
+ * ser-tcp.c (gdb_string.h): Include
+ * i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR.
+ (i386_get_frame_setup): Change "pc" from int to CORE_ADDR.
+ * command.c (complete_on_enum): Make assignment used as truth value
+ explictly check against NULL.
+ (wait.h): Include.
+ * infrun.c (wait_for_inferior): Ifdef out prologue_pc since code
+ that uses it is ifdef'd out.
+ * parser-defs.h: Add prototype for write_dollar_variable.
+ * infrun.c: Add prototype for write_pc_pid.
+ * breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs.
+ * symmisc.c (bcache.h): Include.
+ * bcache.h: Add prototype for print_bcache_statistics.
+ * symfile.c: Include <time.h>.
+ * printcmd.c (print_scalar_formatted): Change len to unsigned int.
+ * valarith.c (value_equal): Cast result of TYPE_LENGTH to int.
+ * valarith.c (value_binop): Change result_len, promoted_len1,
+ and promoted_len2 to unsigned int.
+ * valarith.c (value_subscripted_rvalue): Change elt_offs and
+ elt_size to unsigned int.
+ * valops.c (value_array): Change typelength to unsigned int.
+ (destructor_name_p): Change len to unsigned int.
+ * scm-lang.h (scm_parse): Add prototype for scm_unpack.
+ * symfile.c (decrement_reading_symtab): Change return type to void.
+ * valarith.c (value_subscript): Remove unused variable "word".
+ (value_subscript): Remove unused variable "tint".
+ * valops.c (auto_abandon): Ifdef out, since code using it is also
+ ifdef'd out.
+ * eval.c (init_array_element): Remove unused variable "val".
+ * Makefile.in (values.o): Depends on scm-lang.h.
+ (command.o): Depends upon wait_h.
+ (ser-tcp.o): Depends upon gdb_string.h.
+ (infptrace.o): Depends upon wait_h and command_h.
+ (maint.o): Depends on objfiles.h and symfile.h.
+ * values.c (allocate_repeat_value): Remove unused variable
+ "element_type".
+ (scm-lang.h): Include.
+ * breakpoint.c (create_longjmp_breakpoint): Enclose in
+ GET_LONGJMP_TARGET define, unused otherwise.
+ * config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint,
+ i386_remove_watchpoint and i386_stopped_by_watchpoint.
+
+Thu Mar 28 12:53:19 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (sparc64-*-solaris2*): Delete.
+ Stick with sparc-*-solaris2*.
+ * configure: Regenerated.
+
+Thu Mar 28 06:51:26 1996 Fred Fish <fnf@cygnus.com>
+
+ * valops.c (value_assign): Make copy of internal variable value
+ before returning it as a new value, since it is owned by the
+ internal variable and will be freed along with it.
+
+Wed Mar 27 08:36:17 1996 Jeffrey A Law (law@cygnus.com)
+
+ * From Peter Schauer.
+ * breakpoint.c (breakpoint_re_set_one): Keep temporary
+ breakpoints bp_until, bp_finish, bp_watchpoint_cope, bp_call_dummy
+ and bp_step_resume in case breakpoint_re_set_one is called due
+ to a step over a dlopen call.
+ * infrun.c (wait_for_inferior): Always remove breakpoints from
+ inferior in BPSTAT_WHAT_CHECK_SHLIBS case.
+
+Tue Mar 26 13:15:32 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/mips/tm-mips.h (COERCE_FLOAT_TO_DOUBLE): Only prefer
+ non-prototyped case over prototyped case for C.
+ * config/pa/tm-hppa.h (COERCE_FLOAT_TO_DOUBLE): Ditto.
+
+Sat Mar 23 17:24:28 1996 Fred Fish <fnf@cygnus.com>
+
+ * os9kread.c (os9k_process_one_symbol): Note nonportable
+ assumption that an int can hold a char *.
+
+ * bcache.h (struct hashlink): Wrap data[] inside union with
+ double to force longest alignment.
+ (BCACHE_DATA): New macro to access data[].
+ (BCACHE_ALIGNMENT): New macro to get offset to data[].
+ * bcache.c (lookup_cache, bcache): Use BCACHE_DATA to get
+ address of cached data. Use BCACHE_ALIGNMENT to compute
+ amount of space to allocate for each hashlink struct.
+
+Sat Mar 23 12:14:02 1996 Fred Fish <fnf@cygnus.com>
+
+ * ch-lang.c (evaluate_subexp_chill): Fix typo.
+
+Thu Mar 21 08:27:19 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VERSION): Bump version to 4.15.3
+
+Thu Mar 21 10:56:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.in: Rename from config.h.in.
+ * configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
+ Change CONFIG_HEADERS test in AC_OUTPUT accordingly.
+ * configure: Rebuild.
+ * Makefile.in (stamp-h): Depend upon config.in, not config.h.in.
+ Set CONFIG_HEADERS to config.h:config.in.
+
+Tue Mar 19 12:47:51 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * partial-stab.h (case N_ENDM): Finish current partial symbol
+ table for Solaris 2 cc.
+
+Tue Mar 19 10:39:15 1996 Jeffrey A Law (law@cygnus.com)
+
+ * rs6000-nat.c (exec_one_dummy_insn): Don't clobber the
+ PC in the registers array. From Peter Schauer.
+
+Mon Mar 18 13:47:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (reread_symbols): Reinitialize bcache struct
+ members to zero using memset. Also use memset to reinit
+ global_psymbols and static_psymbols, rather than explicitly
+ resetting each structure member.
+
+Sat Mar 16 19:47:36 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Add fragment to create stamp-h.
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+ * configure.in (AC_CHECK_HEADERS): Check for link.h.
+ * configure: Regenerate with autoconf.
+ * config.h.in: Regenerate with autoheader.
+ * config/i386/nm-linux.h: Include solib.h only if HAVE_LINK_H
+ is defined.
+ * solib.c: Exclude most of the code if HAVE_LINK_H is not defined.
+ * config/i386/linux.mh: Reinstate XM_CLIBS, it is needed for
+ older a.out based systems.
+
+Sat Mar 16 16:45:43 1996 Fred Fish <fnf@cygnus.com>
+
+ * config.h.in: New file.
+ * acconfig.h: New file, for autoheader.
+ * configure.in (AC_CONFIG_HEADER): Add, generate config.h.
+ * configure: Regenerate.
+ * Makefile.in (defs_h): Add config.h
+ (distclean): Remove config.h and stamp-h during distclean.
+ (config.h, stamp-h): New targets to remake config.h when necessary.
+ * defs.h (config.h): Include before any other includes or defines.
+ * i386-tdep.c (gdb_string.h): Move include after include of defs.h.
+ * i386v4-nat.c (defs.h): Include before testing HAVE_SYS_PROCFS_H.
+
+Sat Mar 16 14:55:27 1996 Fred Fish <fnf@cygnus.com>
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+ * Makefile.in (INSTALLED_LIBS): Make sure that @LIBS@ will not
+ result in an empty line, to work around a bug in native Ultrix 4.4
+ and OSF/1-3.2C make.
+
+Sat Mar 16 13:33:17 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in: Add gdbserver to configdirs under linux.
+ * configure: Regenerate.
+
+Fri Mar 15 12:06:58 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/i386/nm-nbsd.h (FLOAT_INFO): Comment out.
+ * config/i386/tm-nbsd.h (NUM_REGS): Define.
+
+Thu Mar 14 10:31:18 1996 Jeffrey A Law (law@cygnus.com)
+
+ * solib.c (solib_break_names): Add _r_debug_state for
+ vanilla SVR4 implementations. From Peter Schauer.
+
+Mon Mar 11 14:24:57 1996 Dawn Perchik <dawn@critters.cygnus.com>
+
+ * mon960-rom.c: New file; support mon960 rom monitor on i960.
+ * monitor.c (monitor_debug): Change remotedebug to buffer strings.
+ * monitor.c (monitor_open): Add test for flag MO_NO_ECHO_ON_OPEN before
+ epecting prompt and echo during open.
+ * monitor.c (monitor_stop): Add test for flag MO_SEND_BREAK_ON_OPEN to
+ determine if break should be sent as stop command.
+ * monitor.h: Add flags MO_NO_ECHO_ON_OPEN and MO_SEND_BREAK_ON_OPEN.
+ * i960-tdep.c (mon960_frame_chain_valid): New function for getting
+ stack frame on mon960.
+ * Makefile.in: Add mon960 files.
+ * configure.in: Changed i960-*-coff* and i960-*-elf* to target mon960;
+ added i960-nindy-coff* and i960-nindy-elf* for target nindy.
+ * configure: Regenerated.
+ * config/i960/mon960.mt, config/i960/tm-mon960.h: New files;
+ support mon960 rom monitor on i960.
+
+Mon Mar 11 11:02:47 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ With Michael Snyder:
+ * i386-tdep.c (skip_trampoline_code): Fix strncmp length.
+ * win32-nat.c (CHECK, DEBUG*, debug_*): New.
+ (handle_load_dll): Don't reload symbols.
+ (handle_exception): Use the DEBUG_* names.
+ (child_wait): Add DEBUG_* code.
+ (_initialize_inftarg): Add new commands to set debug_ names.
+
+Mon Mar 11 09:19:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * From Peter Schauer:
+ * breakpoint.c (insert_breakpoints): Use ALL_BREAKPOINTS_SAFE.
+ (bpstat_stop_status): Likewise.
+ (remove_solib_event_breakpoints): Likewise.
+ (clear_momentary_breakpoints): Likewise.
+ (re_enable_breakpoints_in_shlibs): Don't reenable a breakpoint
+ if we still can't read the memory for that breakpoint.
+ (mention): Add bp_shlib_event case to keep gcc quiet.
+
+Fri Mar 8 12:08:12 1996 Jeffrey A Law (law@cygnus.com)
+
+ * breakpoint.h (enum enable): New enum shlib_disabled for
+ shared library breakpoints that have been temporarily disabled.
+ * breakpoint.c: Handle temporarily disabled shared library
+ breakpoints like disabled breakpoints in most places.
+ (insert_breakpoints): Use shlib_disabled to indicate
+ that an unsettable breakpoint is only temporarily disabled.
+ (re_enable_breakpoints_in_shlibs): New function.
+ * corelow.c (solib_add_stub): After adding shared libraries,
+ try to reenable any temporarily disabled breakpoints.
+ * infcmd.c (attach_command): Likewise.
+ * infrun.c (wait_for_inferior): Likewise.
+
+Fri Mar 8 11:41:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * defs.h (extract_long_unsigned_integer): Declare.
+ * findvar.c (extract_long_unsigned_integer): New function.
+ * printcmd.c (print_scalar_formatted): Use it.
+ * valprint.c (val_print_type_code_int): Likewise.
+
+Thu Mar 7 17:40:50 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infcmd.c (do_registers_info): Ignore anonymous registers.
+ * sh-tdep.c (set processor): New command to set specific
+ processor type.
+ (sh_reg_names, sh3_reg_names): Arrays of register names for
+ SH and SH3 processors.
+ (sh_set_processor_type): New function.
+ * sh3-rom.c (sh3_open): Call it.
+ (sh3_regname): Add names of all the bank registers.
+ (sh3_supply_register): Clean up formatting.
+ * config/sh/tm-sh.h (NUM_REGS, NUM_REALREGS): Increase to include
+ bank registers.
+ (REGISTER_NAMES): Add names of bank registers.
+ (FP15_REGNUM): Define.
+ (REGISTER_VIRTUAL_TYPE): Use it.
+ * monitor.c: Clean up some comments.
+
+Thu Mar 7 12:09:51 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * i386b-nat.c: Revert part of Mar 5 change. FreeBSD collapsed the
+ s* and t* symbols too.
+
+Thu Mar 7 15:18:51 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * symfile.c (generic_load): Avoid division by zero.
+
+Wed Mar 6 17:57:59 1996 Jeffrey A Law (law@cygnus.com)
+
+ * breakpoint.c (bfd_lookup_symbol): Provide for all SVR4 systems,
+ not just those with HANDLE_SVR4_EXEC_EMULATORS.
+
+ From Peter Schauer:
+ * breakpoint.c (internal_breakpoint_number): Move to file scope.
+ (create_solib_event_breakpoint): Use an internal breakpoint number.
+
+Wed Mar 6 00:32:44 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * valarith.c (value_in): Change builtin_type_chill_bool to
+ LA_BOOL_TYPE.
+
+Tue Mar 5 23:48:36 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-exp.c (parse_primval): Handle CARD, MAX, MIN.
+ (match_string_literal): Handle control sequence.
+ (match_character_literal): Deto.
+
+ * ch-lang.c (chill_printchar): Change formating of nonprintable
+ characters from C'xx' to ^(num).
+ (chill_printstr): Deto.
+ (value_chill_card, value_chill_max_min): New functions to process
+ Chill's CARD, MAX, MIN.
+ (evaluate_subexp_chill): Process UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN.
+
+ * expression.h (exp_opcode): Add UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN
+ for Chill's CARD, MAX, MIN.
+
+ * valarith.c (value_in): Add processing of TYPE_CODE_RANGE
+ and change return type from builtin_type_int to
+ builtin_type_chill_bool.
+
+Tue Mar 5 18:54:04 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/nm-nbsd.h (link_object, lo_name, etc): Move to here
+ from config/nm-nbsd.h.
+ * config/sparc/nm-nbsd.h (regs, fp_status, etc): Move to here
+ from config/sparc/tm-nbsd.h.
+
+ * config/m68k/nm-hp300hpux.h (FIVE_ARG_PTRACE): Define here
+ instead of in config/m68k/xm-hp300hpux.h.
+
+Tue Mar 5 12:05:35 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * i386b-nat.c, m68knbsd-nat.c (fetch_core_registers): Provide
+ implementation for NetBSD systems.
+
+Mon Mar 4 23:44:16 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * valarith.c (binop_user_defined_p): Return 0 for BINOP_CONCAT.
+ (value_concat): Handle varying strings (add COERCE_VARYING_ARRAY).
+
+ * ch-lang.c (evaluate_subexp_chill case MULTI_SUBSCRIPT): Error
+ if "function" is pointer to non-function.
+
+Mon Mar 4 17:47:03 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.c (print_gdb_version): Update copyright year.
+
+Mon Mar 4 14:44:54 1996 Jeffrey A Law (law@cygnus.com)
+
+ From Peter Schauer:
+ * infrun.c (wait_for_inferior): Remove breakpoints and
+ switch terminal settings before calling SOLIB_ADD.
+ * solib.c (enable_break, SVR4 variant): Don't map in symbols
+ for the dynamic linker, the namespace pollution causes real
+ problems.
+
+Sun Mar 3 17:18:57 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * remote-mips.c (common_breakpoint): Explicitly terminate the
+ returned buffer.
+
+Wed Feb 28 22:32:18 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Wilfried Moser <wilfried.moser@aut.alcatel.at>:
+ * remote.c (remote_detach): Send a command 'D' to the target
+ when detaching, update the function's comments.
+
+Thu Jun 6 16:11:38 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (thread_cmd_list): New declaration.
+ (parse_int_arg): New function.
+
+Wed Jun 5 17:28:04 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.h (struct proc): Add DETACH_SC field.
+ * gnu-nat.c (make_proc): Set DETACH_SC.
+ (struct inf): Add DETACH_SC & DEFAULT_THREAD_DETACH_SC fields.
+ (make_inf): Set DETACH_SC & DEFAULT_THREAD_DETACH_SC fields.
+ (add_thread_commands): Add set/show for detach-suspend-count.
+ Add takeover-suspend-count cmd.
+ (inf_detach): Set suspend counts to the detach SC, not 0.
+ (set_thread_detach_sc_cmd, show_thread_detach_sc_cmd,
+ set_task_detach_sc_cmd, show_task_detach_sc_cmd,
+ set_thread_default_thread_detach_sc_cmd,
+ show_thread_default_thread_detach_sc_cmd): New functions.
+ (show_task_cmd): Also show detach-suspend-count values.
+ (thread_takeover_sc_cmd): New function.
+
+Fri May 31 16:49:24 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (show_thread_run_cmd): Actually print state.
+
+Thu May 30 10:47:56 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_signal): Make unforwardable exceptions an error.
+
+Tue May 28 17:06:36 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_validate_stopped): proc_getprocinfo takes a
+ pointer to the flags now, not the flags themselves.
+
+Mon May 27 13:31:17 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (gnu_wait): Print debugging msgs for pending execs.
+ (gnu_create_inferior): Check return from ptrace.
+
+Sun May 26 16:56:35 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.h (struct proc): Add DEAD field.
+ * gnu-nat.c (make_proc): Initialize DEAD.
+ (inf_set_traced, inf_validate_task_sc, inf_validate_procs: Frob it.
+ (gnu_wait): Only abort for 0 threads if the task isn't dead.
+
+Sat May 25 17:06:05 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_signal): Pass SIGCODE when posting a signal.
+
+Wed May 22 18:44:28 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (S_proc_wait_reply): Add SIGCODE argument.
+ (inf_set_traced): Only give no-signal-thread error message if
+ turning *on* tracing.
+
+Wed May 15 13:03:16 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_validate_procs): If INF has no threads, always
+ set inf->threads_up_to_date to 0.
+ (inf_signal): Pass in new SIGCODE argument to msg_sig_post_untraced.
+ (gnu_wait): Pass in new TIMEOUT arg to interrupt_operation.
+ (proc_update_sc): Cast thread state arg to thread_set_state.
+ (proc_get_state): Cast thread state arg to thread_get_state.
+ (inf_validate_task_sc): Cast task_basic_info arg to task_info.
+ * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Call
+ inf_update_procs before we lookup the thread.
+ * config/i386/i386gnu.mh (MH_CFLAGS): New variable.
+
+Tue May 7 17:52:33 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (gnu_kill_inferior): Use inf_set_task to clear the task.
+
+Mon May 6 19:06:49 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_set_traced): Use msg_set_init_int with
+ INIT_TRACEMASK instead of setting the exec flags.
+
+Fri May 3 19:10:57 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (inf_validate_procs): Don't clear INF->task if we find
+ the task's died, so others have a chance at it.
+ (gnu_resume): When single-stepping a single thread, given an error
+ if there is no such thread. When single-stepping one but running
+ the others, just given a warning and still run all the threads.
+ (gnu_wait): If there seem to be no threads, look harder, and
+ signal an error if there really aren't any.
+ (gnu_attach): Reset thread numbering to 0.
+
+ * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Give
+ thread name in warning messages.
+
+ * gnu-nat.c (active_inf): New function.
+ (show_sig_thread_cmd, show_stopped_cmd): Use it.
+ (info_port_rights, info_send_rights_cmd, info_port_sets_cmd,
+ info_recv_rights_cmd, info_port_rights_cmd, info_port_rights_cmd):
+ New functions.
+ (add_task_commands): Add new port-right info commands.
+
+Fri Apr 26 20:42:16 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (gnu_wait): Instead of _hurd_intr_rpc_mach_msg, just
+ use mach_msg with MACH_RCV_INTERRUPT.
+ (set_noninvasive_cmd): New function.
+ (add_task_commands): Add command entry for `set noninvasive'.
+
+Mon Mar 4 14:12:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (gnu_read_inferior): Use hurd_safe_memmove, not safe_bcopy.
+ (safe_bcopy): Function removed.
+
+Mon Dec 4 14:18:26 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c (proc_update_sc): Assert only threads can have state.
+ (make_proc): Initialize state_valid & state_changed fields.
+
+Tue Nov 28 17:51:21 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * reply_mig_hack.awk: New file.
+
+Tue Nov 14 14:31:03 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * breakpoint.c (breakpoint_1): Print breakpoint thread field.
+
+ * lynx-nat.c (child_wait): Return TARGET_WAITKIND_SPURIOUS for new
+ threads.
+
+Mon Nov 13 18:30:53 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * target.c (debug_to_check_threads): New function.
+
+ * inflow.c (terminal_init_inferior_with_pgrp): New function.
+ (terminal_init_inferior): Call terminal_init_inferior_with_pgrp.
+ * inferior.h (terminal_init_inferior_with_pgrp): New declaration,
+ but only if PROCESS_GROUP_TYPE is defined.
+
+Mon Nov 6 16:42:09 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * target.c (debug_to_thread_alive): Pass through the return value.
+
+Thu Nov 2 18:05:00 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * target.c (signals, target_signal_from_host, target_signal_to_host):
+ Add mach exceptions.
+ * target.h (enum target_signal): Add mach exceptions.
+
+Mon Oct 30 16:41:04 1995 Miles Bader <miles@gnu.ai.mit.edu>
+
+ * gnu-nat.c: New file: gnu native backend.
+ * i386gnu-nat.c: New file: i386-specific part of gnu native backend.
+ * gnu-nat.h: New file.
+ * config/nm-gnu.h: New file.
+ * config/tm-i386gnu.h: New file.
+ * config/xm-i386gnu.h: New file.
+ * config/i386/i386gnu.mh: New file.
+ * config/i386/i386gnu.mt: New file.
+
+Wed Feb 28 15:50:12 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VERSION): Bump version to 4.15.2 to establish
+ baseline for gdb 4.16 rerelease testing.
+
+Wed Feb 28 13:32:05 1996 Jeffrey A Law (law@cygnus.com)
+
+ * somsolib.c (som_solib_create_inferior_hook): Before returning
+ call clear_symtab_users.
+
+Tue Feb 27 00:04:46 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote-e7000.c (e7000_open): Delete all breakpoints when
+ connecting to e7000. Change connect message to allow use of
+ monitor.exp in test suite.
+ * (e7000_load): Print transfer rate of download.
+ * symfile.c (generic_load): Print transfer rate of download.
+
+Sun Feb 25 13:58:33 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in (mips*-*-vxworks*): New config.
+ * configure: Regenerated.
+
+ * config/mips/vxmips.mt, config/mips/tm-vxmips.h: New files.
+ * remote-vxmips.c (vx_convert_to_virtual, vx_convert_from_virtual):
+ Remove, never used.
+
+Sat Feb 24 12:30:28 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * partial-stab.h (case N_FUN): Function symbols generated
+ by SPARCworks cc have a meaningless zero value, do not update
+ pst->textlow if the function symbol value is zero.
+
+ * stabsread.c (define_symbol): Initialize SYMBOL_TYPE field
+ for function prototype declaration symbols.
+
+Fri Feb 23 22:33:04 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote-e7000.c (e7000_load): New routine to download via the
+ network.
+ * (e7000_wait): Don't backup PC when we hit a breakpoint.
+ Apparantly new sh2 pods get this right...
+ * (e7000_ops): Add call to e7000_load.
+
+Thu Feb 22 00:52:42 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/m68k/{nbsd.mh,nbsd.mt,nm-nbsd.h,tm-nbsd.h,xm-nbsd.h},
+ m68knbsd-nat.c: New files, support for NetBSD/m68k.
+
+ * configure.in (m68k-*-netbsd*): New config.
+ * configure: Regenerated.
+
+Wed Feb 21 19:00:21 1996 Fred Fish <fnf@cygnus.com>
+
+ * standalone.c (open, _initialize_standalone): Fix obvious typos
+ reported by Martin Pool <martin@citr.uq.oz.au>.
+
+Wed Feb 21 14:24:04 1996 Jeffrey A Law (law@cygnus.com)
+
+ * solib.c (solib_create_inferior_hook): Fix thinko.
+
+Tue Feb 20 23:59:19 1996 Jeffrey A Law (law@cygnus.com)
+
+ * solib.c (solib_break_names): Define for Solaris and Linux.
+ (enable_break): For SVR4 systems, first try to use the debugger
+ interfaces in the dynamic linker to track shared library events
+ as they happen, then fall back to BKPT_AT_SYMBOL code. Convert
+ BKPT_AT_SYMBOL code to use shared library event breakpoints.
+ (solib_create_inferior_hook): Simplify BKPT_AT_SYMBOL code,
+ it no longer needs to restart/wait on the inferior.
+ * symfile.c (find_lowest_section): No longer static.
+ * symfile.h (find_lowest_section): Corresponding changes.
+
+Tue Feb 20 18:54:08 1996 Fred Fish <fnf@cygnus.com>
+
+ * valops.c (COERCE_FLOAT_TO_DOUBLE): Define default value.
+ (value_arg_coerce): Use COERCE_FLOAT_TO_DOUBLE.
+ * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Define to 1.
+ * config/mips/tm-mips.h: Ditto.
+ * config/pa/tm-hppa.h: Ditto.
+ * config/rs6000/tm-rs6000.h: Ditto.
+ * config/sparc/tm-sparc.h: Ditto.
+
+Tue Feb 20 17:32:05 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/{i386,ns32k}/nbsd.mh (NATDEPFILES): Remove core-aout.o.
+
+ * config/nm-nbsd.h (FETCH_INFERIOR_REGISTERS): Defined.
+ * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG):
+ #ifdef'd out definitions --- Causes serious gdb failures on
+ the i386. Need to investigate further before enabling.
+
+ * i386b-nat.c (fetch_inferior_registers, store_inferior_registers,
+ fetch_core_registers): New functions. These functions are defined
+ if FETCH_INFERIOR_REGISTERS is set. Registers are fetched/stored
+ with ptrace PT_GETREGS/PT_SETREGS.
+
+Tue Feb 20 16:55:06 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * findvar.c (extract_floating store_floating): Replace `long
+ double' with `DOUBLEST'.
+
+Mon Feb 19 15:25:51 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG):
+ Define.
+
+Mon Feb 19 10:32:05 1996 Jeffrey A Law (law@cygnus.com)
+
+ * symtab.h (looup_minimal_symbol_solib_trampoline): Declare.
+
+ * breakpoint.h (remove_solib_event_breakpoints): Declare.
+ * breakpoint.c (remove_solib_event_breakpoints): New function.
+ * somsolib.c (solib_create_inferior_hook): Remove all solib event
+ breakpoints before inserting any new ones. Use a solib event
+ breakpoint for the breakpoint at "_start".
+ Remove extraneous "\n" from calls to warning.
+
+ * breakpoint.c (breakpoint_1): Add missing "sigtramp" to bptypes
+ name array.
+
+Mon Feb 19 01:09:32 1996 Doug Evans <dje@cygnus.com>
+
+ * dwarfread.c (add_partial_symbol): Use ADD_PSYMBOL_ADDR_TO_LIST
+ for CORE_ADDR values.
+ (new_symbol): Use SYMBOL_VALUE_ADDRESS for CORE_ADDR values.
+ * symfile.h (add_psymbol_{,addr}to_list): Add prototypes.
+
+Sun Feb 18 14:37:13 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mipsread.c (mipscoff_symfile_read): Unconditionally add
+ alpha coff dynamic symbols for all symbol files. Makes skipping
+ over the trampoline code work when stepping from a function in a
+ shared library into a function in a different shared library.
+
+Sun Feb 18 09:27:10 1996 Stu Grossman (grossman@cygnus.com)
+
+ * config/sparc/tm-sparc.h: Define PS_FLAG_CARRY. Define
+ RETURN_VALUE_ON_STACK to return long doubles on the stack.
+
+Sat Feb 17 16:33:11 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (ch-exp.o): Add dependencies.
+ (various): Add gdb_string.h to dependencies that need it.
+
+Sat Feb 17 08:57:50 1996 Fred Fish <fnf@cygnus.com>
+
+ * symmisc.c (print_symbol_bcache_statistics): Update description for
+ printing byte cache statistics.
+
+Thu Feb 16 16:02:03 1996 Stu Grossman (grossman@cygnus.com)
+
+ * Add native support for long double data type.
+ * c-exp.y (%union): Change dval to typed_val_float. Use DOUBLEST
+ to store actual data. Change types of INT and FLOAT tokens to
+ typed_val_int and typed_val_float respectively. Create new token
+ DOUBLE_KEYWORD to specify the string `double'. Make production
+ for FLOAT use type determined by parse_number. Add production for
+ "long double" data type.
+ * (parse_number): Use sscanf to parse numbers as float, double or
+ long double depending upon the type of typed_val_float.dval. Also
+ allow user to specify `f' or `l' suffix to explicitly specify
+ float or long double constants. Change typed_val to
+ typed_val_int.
+ * (yylex): Change typed_val to typed_val_int. Also, scan for
+ "double" keyword.
+ * coffread.c (decode_base_type): Add support for T_LNGDBL basic
+ type.
+ * configure, configure.in: Add check for long double support in
+ the host compiler.
+ * defs.h: Define DOUBLEST appropriatly depending on whether
+ HAVE_LONG_DOUBLE (from autoconf) is defined. Also, fix prototypes
+ for functions that handle this type.
+ * expression.h (union exp_element): doubleconst is now type
+ DOUBLEST.
+ * m2-exp.y f-exp.y (%union): dval becomes type DOUBLEST.
+ * findvar.c (extract_floating): Make return value be DOUBLEST.
+ Also, add support for numbers with size of long double.
+ * (store_floating): Arg `val' is now type DOUBLEST. Handle all
+ floating types.
+ * parser-defs.h parse.c (write_exp_elt_dblcst): Arg expelt is now
+ DOUBLEST.
+ * valarith.c (value_binop): Change temp variables v1, v2 and v to
+ type DOUBLEST. Coerce type of result to long double if either op
+ was of that type.
+ * valops.c (value_arg_coerce): If argument type is bigger than
+ double, coerce to long double.
+ * (call_function_by_hand): If REG_STRUCT_HAS_ADDR is defined, and
+ arg type is float and > 8 bytes, then use pointer-to-object
+ calling conventions.
+ * valprint.c (print_floating): Arg doub is now type DOUBLEST.
+ Use appropriate format and precision to print out floating point
+ values.
+ * value.h: Fixup prototypes for value_as_double,
+ value_from_double, and unpack_double to use DOUBLEST.
+ * values.c (record_latest_value): Remove check for invalid
+ floats. Allow history to store them so that people may examine
+ them in hex if they want.
+ * (value_as_double unpack_double): Change return value to DOUBLEST.
+ * (value_from_double): Arg `num' is now DOUBLEST.
+ * (using_struct_return): Use RETURN_VALUE_ON_STACK macro (target
+ specific) to expect certain types to always be returned on the stack.
+
+Fri Feb 16 14:00:54 1996 Fred Fish <fnf@cygnus.com>
+
+ * bcache.c, bcache.h: New files to implement a byte cache.
+ * Makefile.in (SFILES): Add bcache.c.
+ (symtab_h): Add bcache.h.
+ (HFILES_NO_SRCDIR): add bcache.h
+ (COMMON_OBJS): Add bcache.o
+ (bcache.o): New target.
+ * dbxread.c (start_psymtab): Make global_syms & static_syms
+ type "partial_symbol **".
+ * hpread.c (hpread_start_symtab): Ditto.
+ * os9kread.c (os9k_start_psymtab): Ditto.
+ * stabsread.h (start_psymtab): Ditto.
+ * {symfile.c, symfile.h} (start_psymtab_common): Ditto.
+ * maint.c (maintenance_print_statistics): Call
+ print_symbol_bcache_statistics.
+ * objfiles.c (allocate_objfile): Initialize psymbol bcache malloc
+ and free pointers.
+ * solib.c (allocate_rt_common_objfile): Ditto.
+ * symfile.c (reread_symbols): Ditto.
+ (free_objfile): Free psymbol bcache when objfile is freed.
+ (objfile_relocate): Use new indirect psymbol pointers.
+ * objfiles.h (struct objfile): Add psymbol cache.
+ * symfile.c (compare_psymbols): Now passed pointers to pointers to
+ psymbols.
+ (reread_symbols): Free psymbol bcache when freeing other objfile
+ resources.
+ (add_psymbol_to_list, add_psymbol_addr_to_list): Initialize new
+ psymbol using the psymbol bcache.
+ (init_psymbol_list): Psymbol lists now contain pointers rather than
+ the actual psymbols.
+ * symfile.h (psymbol_allocation_list): Psymbol lists now dynamically
+ grown arrays of pointers.
+ (ADD_PSYMBOL_VT_TO_LIST): Initialize new symbol using the psymbol
+ bcache.
+ * symmisc.c (print_partial_symbols): Now takes pointer to pointer
+ to partial symbol.
+ (print_symbol_bcache_statistics): New function to print per objfile
+ bcache statistics.
+ (print_partial_symbol, print_partial_symbols,
+ maintenance_check_symtabs, extend_psymbol_list):
+ Account for change to pointer to pointer to partial symbol.
+ * symtab.c (find_pc_psymbol, lookup_partial_symbol, decode_line_2,
+ make_symbol_completion_list):
+ Account for change to pointer to pointer to partial symbol.
+ * symtab.h (bcache.h): Include.
+ * xcoffread.c (xcoff_start_psymtab): Make global_syms & static_syms
+ type "partial_symbol **".
+
+Fri Feb 16 10:02:34 1996 Fred Fish <fnf@cygnus.com>
+
+ * dwarfread.c (free_utypes): New function.
+ (read_file_scope): Call free_utypes as cleanup, rather than just
+ freeing the utypes pointer.
+
+Thu Feb 15 21:40:52 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * demangle.c (is_cplus_marker): New function, checks if a
+ character is one of the commonly used C++ marker characters.
+ * defs.h (is_cplus_marker): Add prototype.
+ * c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle),
+ cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol),
+ stabsread.c (define_symbol, read_member_functions, read_struct_fields),
+ symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P),
+ values.c (vb_match): Use is_cplus_marker instead of comparison
+ with CPLUS_MARKER.
+
+Thu Feb 15 18:08:13 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.h (INLINE_ADD_PSYMBOL): Default this to 0 and possibly
+ delete entirely someday.
+
+Thu Feb 15 15:25:34 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Edit out makefile rebuild rule.
+ (host_alias, target_alias): Comment out instead of deleting.
+ (@LIBS@): Edit out references.
+
+Tue Feb 13 22:56:46 1996 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
+ Use n_psyms in OBJSTAT, not psyms.
+
+Mon Feb 12 15:59:31 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * configure.in (sparclet-*-aout*): New config.
+ * configure: Regenerated.
+
+Mon Feb 12 14:17:52 1996 Fred Fish <fnf@cygnus.com>
+
+ * somsolib.c (som_solib_add): Use xmalloc rather than bare
+ unchecked call to malloc.
+ * remote-mips.c (pmon_load_fast): ditto.
+ * remote-mm.c (mm_open): ditto.
+ * hpread.c (hpread_lookup_type): ditto.
+ * remote-adapt.c (adapt_open): ditto.
+
+Mon Feb 12 13:11:32 1996 Fred Fish <fnf@cygnus.com>
+
+ * f-lang.c (allocate_saved_bf_node, allocate_saved_function_node,
+ allocate_saved_f77_common_node, allocate_common_entry_node,
+ add_common_block): Use xmalloc rather than malloc, some of which
+ were unchecked.
+ * gnu-regex.c: At same point as other gdb specific changes
+ #undef malloc and then #define it to xmalloc.
+ * ch-exp.c (growbuf_by_size): Use xmalloc/xrealloc rather than
+ bare unchecked calls to malloc/realloc.
+ * stabsread.c (dbx_lookup_type): Use xmalloc rather than bare
+ unchecked call to malloc.
+
+Wed Feb 7 11:31:26 1996 Stu Grossman (grossman@cygnus.com)
+
+ * symtab.c (gdb_mangle_name): Change opname var to be const to
+ match return val of cplus_mangle_name.
+ * i960-tdep.c: Change arg types of next_insn to match callers.
+
+Wed Feb 7 07:34:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/i386/linux.mh (XM_CLIBS, GDBSERVER_LIBS): Remove. These
+ apparently aren't needed in any reasonably recent version of
+ linux.
+
+Tue Feb 6 21:37:03 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * stabsread.c (read_range_type): If !self-subrange and language
+ is Chill, assume a true range. If a true_range is a sub_subrange,
+ use builtin_type_int for index_type.
+
+Tue Feb 6 18:38:51 1996 J.T. Conklin <jtc@slave.cygnus.com>
+
+ * nindy-share/nindy.c (say): Use stdarg.h macros when compiling
+ with an ANSI compiler.
+
+Mon Feb 5 18:24:28 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ From Michael_Snyder@NeXT.COM (Michael Snyder):
+ * valops.c (value_arg_coerce): Coerce float to double, unless the
+ function prototype specifies float.
+
+Mon Feb 5 09:51:55 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * language.c (set_language_command): Use languages table when
+ printing available languages.
+
+Sat Feb 3 12:22:05 1996 Fred Fish <fnf@cygnus.com>
+
+ Fix problems reported by Hans Verkuil (hans@wyst.hobby.nl):
+ * command.c (add_cmd): Add missing initialization for enums member.
+ Reorder members to match structure declaration to make it easier to
+ tell when one is missing.
+ * exec.c (exec_file_command): Fix problem where filename in malloc'd
+ memory is referenced after being freed.
+
+Sat Feb 3 03:26:21 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dwarfread.c (read_func_scope): Avoid GDB core dumps if
+ AT_name tag is missing.
+
+ * procfs.c (procfs_stopped_by_watchpoint): Fix logic when
+ FLTWATCH and FLTKWATCH are defined.
+
+ * remote.c (remote_read_bytes): Advance memaddr for transfers,
+ return number of bytes transferred for partial reads.
+
+ * top.c (init_signals): Reset SIGTRAP to SIG_DFL.
+
+Fri Feb 2 13:40:50 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * win32-nat.c (mappings): Add ppc registers.
+ (child_resume): Turn off step for ppc.
+
+Thu Feb 1 10:29:31 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * config/powerpc/(cygwin32.mh, cygwin32.mt, tm-cygwin32.h,
+ xm-cygwin32.h): New.
+ * config/i386/(*win32*): Becomes *cygwin32*.
+ * configure.in (i[3456]86-*-win32*): Becomes i[3456]86-*-cygwin32.
+ (powerpcle-*-cygwin32): New.
+ * configure: Regenerate.
+ * win32-nat.c (child_create_inferior): Call CreateProcess
+ with the right program arg.
+
+Thu Feb 1 11:01:10 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (SOFT_FLOAT): Provide a default definition.
+
+Wed Jan 31 19:01:28 1996 Fred Fish <fnf@cygnus.com>
+
+ * serial.c: Change fputc/fputs/fprintf to _unfiltered forms.
+
+Wed Jan 31 18:36:27 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/sparc/xm-sun4os4.h (HAVE_TERMIOS): Remove.
+
+ * config/sparc/xm-sparc.h (HAVE_WAIT_STRUCT): Remove, never used.
+
+ * config/i386/nm-i386mach.h (CHILD_PREPARE_TO_STORE): Move to
+ here from config/i386/xm-i386mach.h, fix name.
+ * config/i386/nm-sun386.h: Ditto, from config/i386/xm-sun386.h.
+ * config/i386/nm-ptx4.h (CHILD_PREPARE_TO_STORE): Move to
+ here from config/i386/xm-ptx4.h.
+ * config/i386/nm-ptx4.h: Ditto, from config/i386/xm-ptx.h.
+ * config/i386/nm-symmetry.h: Ditto, from config/i386/xm-symmetry.h.
+ * config/m68k/nm-sun3.h: Ditto, from config/m68k/xm-sun3.h.
+ * config/sparc/nm-nbsd.h: Ditto, from config/sparc/xm-nbsd.h.
+ * config/sparc/nm-sun4os4: Ditto, from config/sparc/xm-sparc.h.
+
+ * config/sparc/nm-sun4sol2.h: New file, renamed from nm-sysv4.h.
+ (PRSVADDR_BROKEN): Move here from xm-sun4sol2.h.
+ * config/sparc/sun4sol2.mh (NAT_FILE): Update.
+
+Wed Jan 31 17:20:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Handle software
+ floating point correctly.
+ (STORE_RETURN_VALUE): Likewise.
+ * config/pa/tm-pro.h (SOFT_FLOAT): define.
+
+Wed Jan 31 13:34:52 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/i386/xm-linux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT):
+ Define to what should be reasonable values. However, apparently
+ a bug in linux mmap prevents mapped symbol tables from working.
+
+Tue Jan 30 18:26:19 1996 Fred Fish <fnf@cygnus.com>
+
+ * defs.h (errno.h>: Move #include closer to head of file to solve
+ obscure problem with systems that declare perror with const arg, in
+ both errno.h and stdio.h, and const is defined away by intervening
+ local include.
+
+Tue Jan 30 15:41:10 1996 Fred Fish <fnf@cygnus.com>
+
+ From Jon Reeves <reeves@zk3.dec.com>:
+ * i386-stub.c (getpacket): Change fprintf stream from "gdb" to stderr.
+ (mem_fault_routine): Fix misplaced volatile type qualifier in decl.
+
+Mon Jan 29 19:05:58 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (diststuff): Make all-doc; diststuff target does not
+ exist in doc/Makefile.in.
+
+Mon Jan 29 18:44:57 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/m88k/xm-cxux.h (BP_HIT_COUNT): Remove, never used.
+
+Mon Jan 29 00:10:35 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-valprint.c (calculate_array_length): New function to
+ determine the length of an array type.
+ (chill_val_print (case TYPE_CODE_ARRAY)): If the length of an
+ array type is zero, call calculate_array_length.
+
+ * gdbtypes.c (get_discrete_bounds (case TYPE_CODE_ENUM)): The
+ values may not be sorted. Scan all entries and set the real lower
+ and upper bound.
+
+Sun Jan 28 15:50:42 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/xm-linux.h: Move include of solib.h and #define of
+ SVR4_SHARED_LIBS from here ...
+ * config/nm-linux.h: ...to here.
+
+Sat Jan 27 10:34:05 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for sys/procfs.h.
+ Also check for gregset_t and fpregset_t types.
+ * configure: Regenerate.
+ * core-regset.c (sys/procfs.h): Only include if HAVE_SYS_PROCFS_H
+ is defined.
+ (fetch_core_registers): Turn into stub unless both HAVE_GREGSET_T
+ and HAVE_FPREGSET_T are defined. These changes allow systems
+ like linux that are migrating to /proc support to use a single
+ configuration for both new and old versions.
+
+ * config/i386/linux.mt: Note that this is now for both a.out and
+ ELF systems.
+ * config/i386/linux.mh (NATDEPFILES): Add solib.o, core-regset.o,
+ i386v4-nat.o
+ * config/i386/tm-linux.h (tm-sysv4.h): Include.
+ * config/i386/xm-linux.h (solib.h): Include
+ (SVR4_SHARED_LIBS): Define.
+ * i386v4-nat.c: Only compile if HAVE_SYS_PROCFS_H is defined.
+ (supply_gregset, fill_gregset): Compile if HAVE_GREGSET_T defined.
+ (supply_fpregset, fill_fpregset): Compile if HAVE_FPREGSET_T
+ defined.
+
+Fri Jan 26 13:48:14 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/sparc/xm-sparc.h (NEW_SUN_CORE): Remove, never used.
+ * config/i386/xm-sun386.h: Ditto.
+ * config/m68k/xm-sun2.h, config/m68k/xm-sun3.h: Ditto.
+
+Thu Jan 25 16:05:53 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (INSTALLED_LIBS, CLIBS): Include @LIBS@.
+
+Thu Jan 25 09:22:15 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ From Greg McGary <gkm@gnu.ai.mit.edu>:
+ * dcache.c (dcache_peek, dcache_poke): Advance addr for
+ multi-byte I/O.
+
+Thu Jan 25 13:08:51 1996 Doug Evans (dje@cygnus.com)
+
+ * infrun.c (normal_stop): Fix test for shared library event.
+
+Thu Jan 25 03:26:38 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * configure.in (sparc64-*-*): Add default host configuration.
+ (sparc64-*-solaris2*): Add target configuration.
+ (sparc64-*-solaris2* host): Link statically if GCC used.
+ * configure: Regenerated.
+ * sparc/sp64sol2.mt: New file.
+
+Wed Jan 24 22:31:37 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * Makefile.in (RUNTEST): srcdir renamed to rootsrc.
+
+Wed Jan 24 15:42:24 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * Makefile.in (lint): Close backquotes.
+
+Wed Jan 24 13:19:10 1996 Fred Fish <fnf@cygnus.com>
+
+ * NEWS: Make note of new record and replay feature for
+ remote debug sessions.
+ * serial.c (gdbcmd.h): Include.
+ (serial_logfile, serial_logfp, serial_reading, serial_writing):
+ Define here, for remote debug session logging.
+ (serial_log_command, serial_logchar, serial_write, serial_readchar):
+ New functions for remote debug session logging.
+ (serial_open): Open remote debug session log file when needed.
+ (serial_close): Close remote debug session log file when needed.
+ (_initialize_serial): Add set/show commands for name of remote
+ debug session log file.
+ * serial.h (serial_readchar): Declare
+ (SERIAL_READCHAR): Call serial_readchar().
+ (SERIAL_WRITE): Call serial_write().
+ (serial_close): Declare as extern.
+ (serial_logfile, serial_logfp): Declare.
+ * top.c (execute_command): Declare serial_logfp. Log user command
+ in remote debug session log if log file is open.
+ * remote-array.c (array_wait): #ifdef out echo to gdb_stdout.
+ (array_read_inferior_memory): Rewrite to fix memory overwrite bug.
+ * remote-array.c (SREC_SIZE): Remove, duplicates define in
+ monitor.h.
+ * remote-array.c (hexchars, hex2mem): Remove, unused.
+ * gdbserver/low-linux.c (store_inferior_registers): Remove
+ unnecessary extern declaration of registers[].
+ * gdbserver/Makefile.in (all): Add gdbreplay.
+ * gdbserver/gdbreplay.c: New file.
+ * gdbserver/README: Give example of recording a remote
+ debug session with gdb and then replaying it with gdbreplay.
+
+Tue Jan 23 18:02:35 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * stabsread.c (rs6000_builtin_type): Make bool type unsigned.
+ (read_one_struct_field): Support boolean bitfields.
+ * c-valprint.c (c_val_print): Print booleans properly.
+
+Tue Jan 23 18:54:09 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-vxsparc.c (vx_convert_to_virtual, vx_convert_from_virtual):
+ Remove, never used.
+ * config/sparc/vxsparc.mt (TDEPFILES): Add remote-vxsparc.o.
+
+Tue Jan 23 14:36:05 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * ch-exp.c (parse_tuple): Error if invalid mode.
+
+ * value.h (COERCE_ARRAY): Don't coerce enums.
+ (COERCE_ENUM): Don't COERCE_REF.
+ (COERCE_NUMBER): New macro (same as COERCE_ARRAY then COERCE_ENUM).
+ * valops.c (value_assign): Only do COERCE_ARRAY if internalvar (let
+ value_cast handle it otherwise); do *not* COERCE_ENUM either way.
+ * valarith.c: Use COERCE_NUMBER instead od COEREC_ARRAY.
+ Add COERCE_REF before COERCE_ENUM.
+ * values.c (value_as_long): Simplify.
+
+ * valops.c (value_array): Create internalvar if !c_style_arrays.
+
+ * language.c (lang_bool_type): Add Fortran support.
+ * eval.c (OP_BOOL): Use LA_BOOL_TYPE.
+
+Tue Jan 23 13:08:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * symfile.c (auto_solib_add): Renamed from auto_solib_add_at_startup.
+ All references changed.
+ * breakpoint.c (bpstat_what): Add shlib_event to the class types.
+ Update state table. Reformat so that it's still readable.
+ When we hit the shlib_event breakpoint, set the calss of shlib_event.
+ (breakpoint_1): Add "shlib events" as a breakpoint type.
+ Print the shlib_event breakpoint like other breakpoints.
+ (create_solib_event_breakpoint): New function.
+ (breakpoint_re_set_one): Handle solib_event breakpoints.
+ * breakpoint.h (enum bytype): Add bp_shlib_event breakpoint type.
+ (enum bpstat_what_main_action): Add BPSTAT_WHAT_CHECK_SHLIBS
+ action.
+ (create_solib_event_breakpoint): Declare.
+ * infrun.c (wait_for_inferior): Handle CHECK_SHLIBS bpstat.
+ (normal_stop): Inform the user when the inferior stoped due
+ to a shared library event.
+ (_initialize_infrun): Add new set/show variable "stop-on-solib-events"
+ to control whether or not gdb continues the inferior or stops it when
+ a shared library event occurs.
+ * minsyms.c (lookup_minimal_symbol_solib_trampoline): New function.
+ * somsolib.c (TODO list): Update.
+ (som_solib_create_inferior_hook): Arrange for gdb to be notified
+ when significant shared library events occur.
+ * hppa-tdep.c (find_unwind_entry): No longer static.
+
+Tue Jan 23 09:00:48 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * printcmd.c (print_insn): Pass fprintf_unfiltered to
+ INIT_DISASSEMBLE_INFO.
+
+Mon Jan 22 16:59:40 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (remotebreak): New GDB variable.
+ (remote_break): New global.
+ (remote_interrupt): Send a break instead of ^C if remote_break.
+ * NEWS: Describe the new variable.
+
+Mon Jan 22 16:24:11 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * sparc-tdep.c (_initialize_sparc_tdep): Always use print_insn_sparc.
+
+Fri Jan 19 07:19:38 1996 Fred Fish <fnf@cygnus.com>
+
+ * hp300ux-nat.c (getpagesize): Remove unused function
+ fetch_core_registers.
+ (hp300ux_core_fns): Remove, is unused.
+ (_initialize_core_hp300ux): Remove, is unused.
+ (gdbcore.h): Remove #include, no longer needed.
+
+Fri Jan 19 00:59:53 1996 Jeffrey A Law (law@cygnus.com)
+
+ * rs6000-nat.c (exec_one_dummy_insn): Rework to avoid
+ ptrace bug in aix4.1.3 on the rs6000.
+
+Wed Jan 17 13:22:27 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-hms.c (hms_ops): Add value for to_thread_alive.
+ * remote-nindy.c (nindy_ops): Ditto.
+ * remote-udi.c (udi_ops): Ditto.
+
+Tue Jan 16 18:00:35 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * remote-mips.c (pmon_opn, pmon_wait, pmon_makeb64, pmon_zeroset,
+ pmon_checkset, pmon_make_fastrec, pmon_check_ack,
+ pmon_load_fast): New functions. Support for the PMON monitor world.
+ (common_open): New function to merge support for different monitors.
+ (mips_open): Use common_open().
+ (mips_send_command): New function.
+ (mips_send_packet): Scan out-of-sequence packets.
+ (mips_enter_debug, mips_exit_debug): New functions.
+ (pmon_ops): New target definition structure.
+
+Tue Jan 16 11:22:58 1996 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (CLIBS): Add LIBS to allow libraries to be
+ specified on the make command line (via make LIBS=xxx).
+
+
+Fri Jan 12 21:41:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * symtab.c (find_pc_symtab): Don't lose if OBJF_REORDERED
+ is set but there are no psymtabs.
+
+Fri Jan 12 15:56:12 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * dsrec.c (load_srec): Remove unused variable.
+ * monitor.c (monitor_expect): Don't expect a ^C to echo.
+ * serial.c (serial_open): Add parallel interface.
+ * sh3-rom.c (parallel, parallel_in_use): New.
+ (sh3_load): If parallel_in_use, download though the
+ parallel port.
+ (sh3_open): Open parallel port if specified.
+ (sh3_close): New function.
+ (_inititalize_sh3): Add sh3_close hook and documentation.
+ * monitor.c (monitor_close): Export.
+ * monitor.h (monitor_close): Add prototype.
+
+Fri Jan 12 13:11:42 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Wilfried Moser <wilfried.moser@aut.alcatel.at>:
+ * remote.c (remotetimeout): New GDB variable, use to set the
+ remote timeout for reading.
+
+Fri Jan 12 07:14:27 1996 Fred Fish <fnf@cygnus.com>
+
+ * lynx-nat.c, irix4-nat.c, sparc-nat.c: Include gdbcore.h
+ to get "struct core_fns" defined.
+ * Makefile.in (lynx-nat.o, irix4-nat.o, sparc-nat.o):
+ Are dependent upon gdbcore_h.
+
+Thu Jan 11 23:13:24 1996 Per Bothner <bothner@cygnus.com>
+
+ * symfile.c (decrement_reading_symtab): New function.
+ * symfile.c, symtab.h (currently_reading_symtab): New variable.
+ * symfile.c (psymtab_to_symtab): Adjust currently_reading_symtab.
+ * gdbtypes.c (check_typedef): Don't call lookup_symbol if
+ currently_reading_symtab (since that could infinitely recurse).
+
+Thu Jan 11 17:21:25 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * stabsread.c (read_struct_type): Trivial simplification.
+
+ * stabsread.c (define-symbol): Use invisible references
+ for TYPE_CODE_SET and TYPE_CODE_BITSTRING too.
+ * valops.c (call_function_by_hand): Likewise.
+ * eval.c (evaluate_subexp_standard): When known, use the formal
+ parameter type as the expected type when evaluating arg expressions.
+ * ch-lang.c (evaluate_subexp_chill): Likewise (for MULTI_SUBSCRIPT).
+
+Thu Jan 11 10:08:14 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * main.c (main): Disable window interface if --help or --version
+ specified.
+
+Wed Jan 10 16:08:49 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in, configure: Recognize rs6000-*-aix4*.
+ * config/powerpc/xm-aix.h: Reduce to include "xm-aix4.h".
+ * config/rs6000/aix4.mh (XM_FILE): Point to xm-aix4.h.
+ * config/rs6000/xm-aix4.h: New file.
+ * config/xm-aix4.h: New file.
+
+Wed Jan 10 11:25:37 1996 Fred Fish <fnf@cygnus.com>
+
+ From Wilfried Moser <wilfried.moser@aut.alcatel.at>:
+ * gdbserver/low-linux.c: New file.
+ * remote.c (remote_read_bytes): Fix aborts on larger packets.
+
+ * config/i386/linux.mh (GDBSERVER_DEPFILES, GDBSERVER_LIBS):
+ Define.
+ * stabsread.c (define_symbol): If register value is too large,
+ tell what it is and what max is.
+
+Tue Jan 9 09:33:53 1996 Jeffrey A Law (law@cygnus.com)
+
+ * hpread.c (hpread_build_psymtabs): Finish Jan 4th
+ enum namespace -> enum_namespace change.
+
+Tue Jan 9 04:44:47 1996 Wilfried Moser <moser@rtl.cygnus.com>
+
+ * ch-exp.c (parse_primval): In case ARRAY, add missing
+ FORWARD_TOKEN ().
+
+Mon Jan 8 13:29:34 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-mips.c (mips_receive_header): Recognize \012 instead
+ of \n, but write \n when program sends a \012.
+ * ser-mac.c (mac_input_buffer): Increase size of buffer.
+
+Mon Jan 8 12:00:40 1996 Jeffrey A Law (law@cygnus.com)
+
+ * infptrace.c (initialize_infptrace): Move function out of
+ #ifdef conditional; put code within the function inside an
+ #ifdef conditional.
+
+ * buildsym.c (end_symtab): Remove sort_pending and sort_linevec
+ arguments. Sorting is now dependent on OBJF_REORDERED. All
+ callers/references changed.
+ * dbxread.c (read_ofile_symtab): Correctly determine value for
+ last_source_start_addr for reordered executables.
+ (process_one_symbol): Handle N_FUN with no name as an end of
+ function marker.
+ * partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE
+ is the high text address for a psymtab.
+ (case N_SO): Likewise.
+ (case N_FUN): Handle N_FUN with no name as an end of function
+ marker.
+ * minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols
+ at the same address rather than a random subset of them.
+ * coffread.c (coff_symfile_init): Set OBJF_REORDERED.
+ * elfread.c (elf_symfile_init): Similarly.
+ * somread.c (som_symfile_init): Similarly.
+ * xcoffread.c (xcoff_symfile_init): Similarly.
+
+Fri Jan 5 17:46:01 1996 Stu Grossman (grossman@cygnus.com)
+
+ * stack.c (print_stack_frame print_frame_info) symmisc.c
+ (dump_symtab): Change RETURN_MASK_ERROR to RETURN_MASK_ALL so
+ that catch_errors doesn't get blindsided by QUIT and lose the
+ cleanup chain. This fixes a problem where ^C while in a
+ user-defined command sometimes leaves instream NULL and causes a
+ segfault in command_loop.
+
+Fri Jan 5 13:59:16 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure.in, configure: Add `-ldl -lw' for Solaris linking.
+
+Fri Jan 5 12:02:00 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * config/sh/sh.mt, config/powerpc/*.mt, config/pa/hppapro.mt,
+ config/m68k/monitor.mt, config/h8500/h8500.mt, config/h8300/h8300.mt:
+ srec.o renamed to dsrec.o.
+
+Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com)
+
+ * breakpoint.c (remove_breakpoint): Change error to warning so
+ that hardware watchpoint removal problems won't leave breakpoint
+ traps in the target.
+ * remote-e7000.c (e7000_insert_breakpoint,
+ e7000_remove_breakpoint): Use e7000 based breakpoints, not memory
+ breakpoints.
+ * (e7000_wait): Adjust PC back by two when we see a breakpoint to
+ compensate for e7000 maladjustment.
+ * sparcl-tdep.c (sparclite_check_watch_resources): Fix logic bug
+ which prevented hardware watchpoints from working.
+
+Thu Jan 4 10:44:17 1996 Fred Fish <fnf@cygnus.com>
+
+ * infptrace.c (udot_info): New function.
+ (PT_*): Define each individually if that one is not defined.
+ * rs6000-nat.c (kernel_u_size): New function
+ Include <sys/user.h> for "struct user"
+ * alpha-nat.c (kernel_u_size): New function.
+ Include <sys/user.h> for "struct user"
+ * sparc-nat.c (kernel_u_size): New function.
+ Include <sys/user.h> for "struct user"
+ * i386b-nat.c (kernel_u_size): New function.
+ * i386v-nat.c (kernel_u_size): New function.
+ * config/i386/nm-fbsd.h (KERNEL_U_SIZE): Define.
+ (kernel_u_size): Declare.
+ * config/i386/nm-linux.h (KERNEL_U_SIZE): Define.
+ (kernel_u_size): Declare.
+ * config/sparc/nm-sun4os4.h (KERNEL_U_SIZE): Define.
+ (kernel_u_size): Declare.
+ * config/alpha/nm-osf2.h (KERNEL_U_SIZE): Define.
+ (kernel_u_size): Declare.
+ * config/rs6000/nm-rs6000.h (KERNEL_U_SIZE): Define.
+ (kernel_u_size): Declare.
+
+Thu Jan 4 11:00:01 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * mdebugread.c (mylookup_symbol): enum namespace becomes
+ enum_namespace type.
+ * symfile.c (add_psymbol_to_list)
+ (add_psymbol_addr_to_list): Ditto.
+ * symtab.c (lookup_partial_symbol): Ditto.
+ (lookup_symbol): Ditto.
+ (lookup_block_symbol): Ditto.
+ * win32-nat.c (handle_load_dll): Use incoming dll base.
+ (child_wait): Catch DLL load errors.
+ (create_child_inferior): Translated between paths correctly.
+
+Wed Jan 3 23:13:53 1996 Fred Fish <fnf@cygnus.com>
+
+ * i386v4-nat.c (supply_gregset, fill_gregset): Subtract NUM_FREGS
+ from NUM_REGS to get number of general registers that we care about.
+ * config/i386/tm-i386.h (REGISTER_BYTES): Define in terms
+ of number of general regs and number of floating point regs.
+
+Wed Jan 3 19:49:54 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * config/i386/tm-win32.h (IN_SOLIB_CALL_TRAMPOLINE): New.
+ (SKIP_TRAMPOLINE_CODE): New.
+ * config/i386/xm-win32.h (CANT_FORK): Deleted.
+ (SLASH*) Changed to use unix style slash.
+ * symtab.h (namespace enum): becomes typedef to avoid namespace
+ collision in C++.
+ * infcmd.c (path_command): Use empty string if PATH name not set.
+ * i386-tdep.c (skip_trampoline_code): New function.
+ * srec.c: Renamed dsrec.c to avoid filename collision.
+ * Makefile.in: Cope with renaming.
+
+Wed Jan 3 13:09:04 1996 Fred Fish <fnf@cygnus.com>
+
+ * symmisc.c (print_objfile_statistics): Print memory use statistics
+ for objfile psymbol, symbol, and type obstacks.
+
+Tue Jan 2 13:41:14 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/mips/nm-irix5.h: Restore.
+ (TARGET_HAS_HARDWARE_WATCHPOINTS, etc): Define as for Irix 4;
+ from Lee Iverson <leei@ai.sri.com>.
+ * config/mips/irix5.mh (NAT_FILE): Use nm-irix5.h.
+ * config/mips/irix[345].mh (MUNCH_DEFINE): Remove.
+
+For older changes see ChangeLog-1995
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1997 b/contrib/gdb/gdb/ChangeLog-1997
new file mode 100644
index 0000000..4f66a90
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1997
@@ -0,0 +1,2909 @@
+Wed Dec 31 11:43:53 1997 Mark Alexander <marka@cygnus.com>
+
+ * dsrec.c (load_srec): Check remotedebug flag when printing
+ debug info.
+
+Wed Dec 31 10:33:15 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * breakpoint.c (breakpoint_re_set): add _siglongjmp to list of
+ longjmp breakpoints.
+
+Mon Dec 29 21:25:34 1997 Mark Alexander <marka@cygnus.com>
+
+ * dve3900-rom.c: New file to support Densan DVE-R3900/20 board.
+ * monitor.c (monitor_debug): Move to utils.c, rename to puts_debug.
+ (monitor_write_memory, monitor_read_memory, monitor_insert_breakpoint,
+ monitor_remove_breakpoint): Remove useless address bits if current
+ monitor has MO_ADDR_BITS_REMOVE flag.
+ * monitor.h (MO_ADDR_BITS_REMOVE): Define.
+ * utils.c (puts_debug): Formerly monitor_debug from monitor.c;
+ move here and make public. Add better support for carriage returns.
+ * defs.h (puts_debug): Declare.
+ * dsrec.c (load_srec): Use puts_debug to print remotedebug information.
+ Output header record correctly.
+ (make_srec): Output a header record instead of a termination record
+ if sect is non-NULL (value is ignored), but abfd is NULL.
+ * config/mips/tm-tx39.h (DEFAULT_MIPS_TYPE): Remove definition.
+ (REGISTER_NAMES): Define to add R3900-specific registers.
+ * config/mips/tm-tx39l.h: Ditto.
+ * config/mips/tx39.mt (TDEPFILES): Add dve3900-rom.o and support files.
+ * config/mips/tx39l.mt: Ditto.
+
+Wed Dec 24 12:48:48 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dsrec.c: Cosmetic improvements.
+ (make-srec): Change indexing of format and code tables to
+ remove confusing empty entries.
+
+Mon Dec 22 21:51:53 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c (_initialize_remote_mips): Fix DDB doc string.
+
+Sun Dec 21 17:00:06 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * d30v-tdep.c (d30v_frame_find_saved_regs): split most of
+ function off into d30v_frame_find_saved_regs_offsets;
+ (d30v_frame_find_saved_regs_offsets): new function. Got
+ backtrace working when calling from framefull (unoptimized)
+ routines (.e.g, main) into frameless (optimized) routines
+ (e.g., printf).
+
+Fri Dec 19 09:49:49 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * d30v-tdep.c (d30v_frame_chain): test end_of_stack
+ (d30v_frame_find_saved_regs): set it.
+ * config/d30v/tm-d30v.h: improved FRAME_CHAIN_VALID
+
+Thu Dec 18 12:34:28 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Gavin Koch <gavin@cygnus.com>: mips-tdep.c
+ * (mips_push_arguments): For big-endian shorts and char's store at
+ * the correct location.
+
+Thu Dec 18 00:26:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mdebugread.c (parse_partial_symbols): Delete check that symbols
+ for file not already loaded. Did not work when an include file
+ was involved.
+
+Wed Dec 17 10:43:04 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * elfread.c (elf_symfile_read): Since the partial symbol table is
+ searched last in first, insert mdebug or XCOFF info into the
+ partial symbol table before any DWARF2 info.
+
+Thu Dec 18 00:00:48 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symfile.c (init_psymbol_list): Handle init with zero elements.
+
+ * elfread.c (elf_symfile_read): If `mainline', clear psymbol table
+ using init_psymbol_list 0. For build_psymtabs functions, pass
+ mainline==0 so that psymbol_list isn't re-initialized.
+
+ * symfile.c (discard_psymtab): New function, correctly unlink an
+ empty psymtab from an object file.
+ * dbxread.c (end_psymtab): Call discard_psymtab.
+ * xcoffread.c (xcoff_end_psymtab): Ditto.
+ * hpread.c (hpread_end_psymtab): Ditto.
+ * os9kread.c (os9k_end_psymtab): Ditto.
+
+Wed Dec 17 10:47:05 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (set_raw_tracepoint): initialize addr_string
+ to NULL; (trace_actions_command): call readline_begin_hook only
+ if from_tty is true.
+
+Tue Dec 16 20:05:48 1997 Mark Alexander <marka@cygnus.com>
+
+ * configure.tgt: Change little-endian tx39 target name to tx39l.
+
+Tue Dec 16 11:24:30 1997 Jeffrey A Law (law@cygnus.com)
+
+ * remote-sim.c (gdbsim_open): Use "--architecture" instead of
+ ambigious short form.
+
+Tue Dec 16 10:29:16 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * d30v-tdep.c (d30v_frame_chain): don't or in DMEM_START to
+ FP_REGNUM value before return; (prologue_find_regs): two sets
+ of offsets -- frame pointer and stack pointer, not just one that
+ tries to do double duty; (d30v_frame_find_saved_regs): stop once
+ we hit pc (in case we're stopped in the middle of the prologue)
+ and improve handling of frameless prologues; (d30v_push_arguments):
+ *ALL* arguments go on the stack until we run out of args registers,
+ force sp to be 8 byte aligned.
+
+ * config/tm-d30v.h (EXTRACT_STRUCT_VALUE_ADDRESS): fix, it's r2,
+ not r0; (FRAME_CHAIN_VALID): handle use of external memory;
+ (STACK_ALIGN): define.
+
+Mon Dec 15 15:13:57 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_wait): When HAVE_SIGACTION and SA_RESTART
+ intall cntrl-c handler with SA_RESTART clear. On BSD systems this
+ stops read syscalls's being restarted.
+
+ * configure.in (configdirs): Check for sigaction.
+ * configure: Re-generate.
+
+Mon Dec 15 11:38:52 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c: From change proposed by Gavin Koch.
+ (address_significant_size): New static variable.
+ (dwarf2_build_psymtabs_hard): Check consistency between
+ `address_size' and `address_significant_size'.
+ (read_address): MASK out all but the significant bits, as
+ determined by `address_significant_size', of any addresses.
+ (elf-bfd.h): Include.
+ (dwarf2_build_psymtabs_hard): Set `address_significant_size'
+ according to the arch_size of the elf object file.
+
+Thu Dec 11 13:40:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Change type of address to
+ CORE_ADDR.
+
+Thu Dec 11 22:39:02 1997 Mark Alexander <marka@cygnus.com>
+
+ From change made to branch by Bob Manson <manson@cygnus.com>:
+ * tic80-tdep.c (tic80_push_arguments): The compiler always
+ passes structs by reference.
+
+Thu Dec 11 14:28:01 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (trace_find_command): don't error if going
+ backwards thru the trace buffer in a loop.
+ * (struct tracepoint): delete unused field.
+
+Wed Dec 10 17:57:00 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * d30v-tdep.c : don't bury lots of magic numbers in the code
+ instead use defines for the opcodes and opcode masks; update
+ to use actual d30v patterns; fix register sizes to be 4 bytes
+ not 2 bytes; improve prologue testing now that we have a C
+ compiler; fix stack frame handling enough to get backtraces
+ working; initial changes to push and pop frames (so that gdb
+ can call functions in the inferior).
+
+ * config/d30v/tm-d30v.h: update DMEM_START, IMEM_START, and
+ STACK_START; change FR_REGNUM to 61 (was 11). Reformat comment
+ about DUMMY FRAMES so that it is readable. Fix SAVED_PC_AFTER_FRAME
+ macro.
+
+Wed Dec 10 17:41:07 1997 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ch-valprint.c (chill_val_print): To avoid segfaults, don't print
+ a string whose dynamic length is longer than its static length.
+
+Wed Dec 10 15:54:00 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Check
+ cu_header.length is within dwarf_info_buffer not
+ dwarf_abbrev_buffer.
+
+Mon Dec 8 14:28:49 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (memrange_sortmerge): allow for memranges
+ that overlap. (collect_pseudocommand etc.) cleanup decls.
+
+Fri Dec 5 09:22:35 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/v850/tm-v850.h (BREAKPOINT): Reverted back to old value...
+
+Thu Dec 4 09:30:22 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/v850/tm-v850.h (BREAKPOINT): Changed to match new value.
+
+Wed Dec 3 12:44:15 1997 Keith Seitz <keiths@onions.cygnus.com>
+
+ * tracepoint.c: Add declaration for x_command.
+
+ * printcmd.c (x_command): Remove static declaration.
+
+Wed Dec 3 12:00:42 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (finish_tfind_command): call do_display so that
+ auto-displays are updated by tfind. Also, keep track of frame
+ and current-function so that tfind behaves like stepping (only
+ show the stack frame if we step into a new function or return).
+
+Wed Dec 3 14:14:58 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * sol-thread.c: additional support for debugging threaded core
+ files on solaris; previously only kernel threads were found --
+ user threads generated errors.
+ * corelow.c: don't register core_ops as a target if
+ coreops_suppress_target is true (set by sol-thread.c).
+
+Tue Dec 2 14:53:09 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c: make "tdump" command handle literal memranges.
+
+Tue Dec 2 11:34:48 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c: use "lookup_cmd" to parse actions commands
+ (thus allowing unambiguous prefixes and aliases).
+
+Tue Dec 2 10:15:57 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.tgt: Add support for Thumb target.
+
+Tue Dec 2 10:14:15 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c: move prototype of validate_actionline(), and
+ make it consistent with the function declaration.
+
+Thu Nov 27 09:07:18 1997 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.in (tracepoint_h): New macro for tracepoint.h
+ includes.
+ (tracepoint.o): Add rule to build.
+
+Wed Nov 26 22:59:04 1997 Jeffrey A Law (law@cygnus.com)
+
+ * remote-sim.c (gdbsim_cntrl_c): Lose ANSI prototype.
+
+ * tracepoint.c (set_raw_tracepoint): fix typo
+
+Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com>
+
+ * tracepoint.c (set_raw_tracepoint): Make sure there's a trailing
+ slash on the directory name.
+
+ * top.c (get_prompt): New function.
+ * top.h: Declare it.
+
+Wed Nov 26 09:59:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c (struct comp_unit_head): Change length and
+ abbrev_offset fields to unsigned int.
+ (dwarf2_build_psymtabs_hard): Verify length and offset read from
+ .debug_info section.
+
+Mon Nov 24 19:36:34 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c, tracepoint.h: new module, implements tracing,
+ which is a new functionality somewhat like breakpoints except
+ that a tracepoint stops the inferior only long enough to collect
+ and cache selected buffers and memory locations, then allows
+ the inferior to continue; the cached trace data can then be
+ examined later.
+
+Mon Nov 24 14:17:02 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * infcmd.c: export registers_info, for use by other modules.
+ * printcmd.c: export output_command, for use by other modules.
+ * stack.c: export locals_info and args_info, for use by other modules.
+ * remote.c: export getpkt, putpkt, and fromhex for external use.
+ Make fromhex case-insensative. New function "remote_console_output"
+ abstracts the acceptance of "O" packets from target.
+ Make all "remotedebug" output go to stdout, not stderr.
+
+Mon Nov 24 08:59:28 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valprint.c (print_longest): When CC has long long but printf
+ doesn't, print decimal value as three parts.
+
+ * config/i386/tm-fbsd.h: New file.
+ * config/i386/fbsd.mt (TM_FILE): Change to tm-fbsd.h.
+
+ * config/i386/nm-fbsd.h (FLOAT_INFO): Move definition from here.
+ * config/i386/tm-fbsd.h (FLOAT_INFO): To here.
+
+ * configure.in (PRINTF_HAS_LONG_LONG): Check full functionality of
+ %ll format specifier.
+ (SCANF_HAS_LONG_DOUBLE): Check the scanf family for support of
+ long double using %Lg.
+ * acconfig.h: Provide default undef for SCANF_HAS_LONG_DOUBLE.
+ * configure: Re-generate.
+
+ * c-exp.y (parse_number): Use sscanf %Lg when host has
+ SCANF_HAS_LONG_DOUBLE not PRINTF_HAS_LONG_DOUBLE
+
+Sun Nov 23 17:12:58 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * printcmd.c (print_insn): Set the machine type if known.
+
+ * i386-tdep.c (_initialize_i386_tdep): Delete "set
+ assembly-language" command. Replaced by generic "set
+ architecture". Set initial machine using bfd_lookup_arch.
+
+Fri Nov 21 19:43:23 1997 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * valops.c (call_function_by_hand): If the function has a
+ prototype, convert its arguments as if by assignment. Otherwise,
+ do the usual promotions.
+ * stabsread.c (define_symbol): Set the TYPE_FLAG_PROTOTYPED flag
+ on functions' types when we can; all C++ functions should get it,
+ and if the Sun-style prototype notation is in the stabs, we can
+ notice that.
+
+Fri Nov 21 12:20:16 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4 (AM_CYGWIN32, AM_EXEEXT): Remove. They are already
+ defined by the inclusion of ../bfd/aclocal.m4.
+ * configure: Rebuild.
+
+Fri Nov 21 10:52:39 1997 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.in (SHELL): Really do the change.
+
+Fri Nov 21 02:19:57 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: also revert SHELL change until configury
+ changes work
+
+Thu Nov 20 16:35:13 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * sparc-tdep.c (sparc_pc_adjust): Don't assume sizeof (long) == 4.
+
+Thu Nov 20 04:11:27 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * aclocal.m4: add EXEEXT setting rule
+ * configure.in: call it
+ * configure: regenerate
+ * Makefile.in: pepper with EXEEXTs in appropriate places,
+ set SHELL = @SHELL@ for those lame hosts that don't have a /bin/sh
+ For some reason, EXEEXT isn't getting substututed in correctly
+ so for now, set EXEEXT to empty string
+
+Mon Nov 17 15:35:06 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * Makefile.in (remote-sim.o): Depend on $(INCLUDE_DIR)/callback.h.
+
+Fri Nov 14 13:04:34 1997 Jeffrey A Law (law@cygnus.com)
+
+ * jv-exp.y (copy_exp, insert_exp): Avoid ANSI prototypes.
+
+Thu Nov 13 09:47:35 1997 Michael Meissner <meissner@cygnus.com>
+
+ * d30v-tdep.c (d30v_print_flags): Function to print the d30v flags
+ in a human readable format.
+ (print_flags_command): Command wrapper to call d30v_print_flags.
+ (d30v_do_registers_info): When printing out all of the registers,
+ print out the flag values in a human readable fashion.
+ (_initialize_d30v_tdep): Add info flags command to print the
+ flags.
+
+ * config/d30v/tm-d30v.h (PSW_*): Add macros for each of the PSW
+ bits that are defined.
+
+Wed Nov 12 14:58:39 1997 Jeff Holcomb <jeffh@cygnus.com>
+
+ * symfile.c (generic_load): Handle cancel from the
+ ui_load_progress_hook routine.
+ * dsrec.c (load_srec): Handle cancel from the
+ ui_load_progress_hook routine.
+
+Mon Nov 10 15:13:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * valprint.c (print_longest): The b, h, w, and g format specifiers
+ print unsigned values.
+
+Mon Nov 10 02:02:49 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * top.c (quit_confirm): Change exit message.
+
+Tue Nov 4 16:52:50 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/i386/cygwin32.mh: because cygwin.dll calls malloc/realloc
+ to allocate memory for environ space, gdb cannot use memory
+ checks -- set -DNO_MMCHECK
+
+Tue Nov 4 13:50:59 1997 Jim Blandy <jimb@sendai.cygnus.com>
+
+ * jv-exp.y (ArrayAccess): Implement Name [ Expression ]; check the
+ code to see why this is not trivial.
+ (copy_exp, insert_exp): New functions.
+
+Fri Oct 24 17:24:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Handle the case
+ where a compilation unit die has no children (DW_TAG_compile_unit
+ has DW_children_no).
+ (scan_partial_symbols): Add comment for nesting_level.
+
+Wed Oct 29 15:53:24 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * solib.c (solib_break_names): add entry for Solaris 2.6 run
+ time linker. From Casper Dik via Peter Schauer.
+
+Tue Oct 28 17:31:47 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * configure.in (configdir): Add -lcomdlg32 and -ladvapi32
+ to WIN32LIBS.
+
+ * configure: Rebuild
+
+Fri Oct 24 16:48:21 1997 David Taylor <taylor@texas.cygnus.com>
+
+ * sol-thread.c (sol_find_new_threads_callback,
+ sol_find_new_threads): New functions.
+ * config/sparc/nm-sun4sol2.h (FIND_NEW_THREADS): New macro, invoke
+ sol_find_new_threads.
+ * thread.c (info_threads_command): invoke FIND_NEW_THREADS if it
+ is defined.
+
+Thu Oct 23 16:16:04 1997 Jeff Law (law@fast.cs.utah.edu)
+
+ * dbxread.c (process_one_symbol): Put back initialization
+ of a variable lost during last change. Don't perform
+ assignment inside conditionals.
+ * stabsread.c (symbol_reference_defined): Return -1 for error/not
+ found. All callers changed appropriately.
+ (define_symbol): Don't perform assignment inside conditionals.
+
+Wed Oct 22 13:04:52 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mdebugread.c (psymtab_to_symtab_1): Handle new live range stabs
+ entries.
+
+ * dbxread.c: More comment cleanups.
+ * stabsread.c: Fix various violations of the GNU coding and
+ formatting standards. Update/add comments to make code clearer.
+ (resolve_reference): Delete unused function.
+ (ref_search_val): Remove function. It didn't belong in stabsread.c
+ (resolve_live_range): No longer returns a value. Do not add it
+ to the live range list until the entire range stab has been parsed.
+ (get_substring): Remove duplicate declaration.
+ (resolve_symbol_reference): Now static. Remove unnecessary code
+ to deal with cleanups.
+ (ref_add): Use xrealloc instea of realloc.
+ (process_reference): Reorganize slightly to make clearer.
+ * stabsread.h (resolve_symbol_reference): Remove declaration.
+ (resolve_reference): Likewise.
+ * symtab.c (find_active_alias): New function.
+ (lookup_block_symbol): Use find_active_alias.
+ * symtab.h (struct range_list): Fix dangling struct live_range
+ reference.
+ (ref_search_val): Remove decl.
+
+ * symtab.h (struct range_list): Renamed from struct live_range.
+ (struct symbol): Remove struct live_range_info substruct.
+ Bring the alias list and range list fields up to the toplevel
+ as "aliases" and "ranges".
+ (SYMBOL_ALIASES, SYMBOL_RANGES): Corresponding changes.
+ (SYMBOL_RANGE_START, SYMBOL_RANGE_END, SYMBOL_RANGE_NEXT): Delete.
+ * stabsread.c: Corresponding changes.
+
+ * dbxread.c: Fix various violations of the GNU coding and
+ formatting standards. Update/add comments to make code
+ clearer.
+ (process_later): Use xrealloc instead of realloc.
+
+ * symtab.c: Include inferior.h.
+
+Tue Oct 21 14:15:26 1997 Per Bothner <bothner@cygnus.com>
+
+ * ch-exp.c: Rename FIELD_NAME to DOT_FIELD_NAME (to avoid conflict).
+
+Fri Oct 17 13:22:02 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infcmd.c: Improve grammar of "set args" help.
+
+Thu Oct 16 15:03:58 1997 Michael Meissner <meissner@cygnus.com>
+
+ * remote-sds.c (sds_load): Properly declare as static.
+
+Wed Oct 15 10:27:14 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/sparc/tm-sparc.h (FIX_CALL_DUMMY): Mask off displacement
+ to 30 bits in call insn to handle --enable-64-bit-bfd.
+ (STORE_STRUCT_RETURN): Change to handle --enable-64-bit-bfd.
+
+Tue Oct 14 22:13:27 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * stabsread.c: Make ref_map entries dynamically allocated.
+
+Thu Oct 9 12:37:57 1997 Frank Ch. Eigler <fche@cygnus.com>
+
+ * printcmd.c (print_address_symbolic, address_info): Mask
+ target-specific flag bits from PC, for more aesthetic disassembly.
+ * config/mips/tm-mips.h: Added PC masking for MIPS family
+ (especially the MIPS16).
+
+Sat Oct 4 18:45:44 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c (mips-initialize): Work around flakiness in
+ some versions of PMON after loading a program.
+
+Fri Oct 3 15:49:18 1997 Per Bothner <bothner@cygnus.com>
+
+ * c-lang.h, cp-valprint.c (static_field_print): Make non-static.
+ * parse.c, parser-defs.h (length_of_subexp): Make non-static.
+ * jv-exp.y (FieldAccess): Handle dollar-VARIABLE as primary.
+ (ArrayAccess): Likewise. Also remove warnings.
+ (CastExpression): Implement (typename) UnaryExpression.
+ (push_qualified_expression_name): Fix small bug.
+ * jv-lang.c: Use TYPE_TAG_NAME, not TYPE_NAME for class names.
+ (_initialize_jave_language): Fix typo (jave -> java).
+ (java_language): Java does *not* have C-style arrays.
+ (java_class_from_object): Make more general (and complicated).
+ (java_link_class_type): Fix typo "super" -> "class". Handle arrays.
+ (java_emit_char, java_printchar): New function.
+ (evaluate_subexp_java case BINOP_SUBSCRIPT): Handle Java arrays.
+ * jv-valprint.c (java_value_print): Implement printing of Java arrays.
+ (java_print_value_fields): New function.
+ (java_val_print): Better printing of TYPE_CODE_CHAR, TYPE_CODE_STRUCT.
+
+Fri Oct 3 09:52:26 1997 Mark Alexander <marka@cygnus.com>
+
+ * config/mips/tm-mips.h (MAKE_MSYMBOL_SPECIAL): Force MIPS16
+ addresses to be odd.
+ (MIPS_FPU_SINGLE_REGSIZE, MIPS_FPU_DOUBLE_REGSIZE): Define.
+ * mips-tdep.c (mips_extract_return_value): Doubles aren't
+ returned in FP0 if FP registers are single-precision only.
+
+Mon Sep 29 23:03:03 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (set_reg_offset): New function.
+ (mips16_heuristic_proc_desc): Calculate offsets of registers
+ saved by entry pseudo-op after rest of prologue has been read.
+ Use set_reg_offset to ignore all but the first save of a given
+ register.
+ (mips32_heuristic_proc_desc): Initialize frame adjustment value.
+ * remote-sim.c (gdbsim_store_register): Don't update registers
+ that have a null or empty name.
+ * findvar.c (read_register_bytes): Don't fetch registers
+ that have a null or empty name.
+
+Tue Sep 30 13:35:54 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mips.h (NUM_REGS): Define conditionally.
+ (REGISTER_NAMES): Ditto.
+
+Fri Sep 26 21:08:22 1997 Keith Seitz <keiths@pizza.cygnus.com>
+
+ * dsrec.c (load_srec): add ui_load_progress_hook to
+ display some feedback to user
+
+ * symfile.c (generic_load): add ui_load_progress_hook to
+ display some feedback to user
+
+Fri Sep 26 17:32:22 1997 Jason Molenda (crash@pern.cygnus.com)
+
+ * command.c (add_cmd, add_show_from_set): Insert new commands in
+ alphabetical order.
+
+Fri Sep 26 12:22:00 1997 Mark Alexander <marka@cygnus.com>
+
+ * config/mips-tm-mips.h (mips_extra_func_info): New frame_adjust
+ member for storing offset of MIPS16 frame pointer from SP.
+ * mips-tdep.c: Use RA_REGNUM instead of hardcoded 31 throughout.
+ (PROC_FRAME_ADJUST): Define.
+ (mips16_heuristic_proc_desc): Store frame pointer adjustment value.
+ (get_frame_pointer): Use frame pointer adjustment value when
+ calculating frame address.
+ * remote-sim.c (gdbsim_fetch_register): Don't fetch registers
+ that have a null or empty name.
+
+Fri Sep 26 12:40:51 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mips-tdep.c (_initialize_mips_tdep): Allow target files to
+ override default FPU type.
+
+Fri Sep 26 10:33:54 1997 Felix Lee <flee@cygnus.com>
+
+ * configure.tgt (v850-*-*): necmsg.lib instead of v850.lib.
+
+Wed Sep 24 14:02:09 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/v850/tm-v850.h (BREAKPOINT): Use 1 word DIVH insn with
+ RRRRR=0 for simulator breakpoint. Previous breakpoint insn was two
+ words.
+
+Thu Sep 18 15:07:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-e7kpc.c (get_ds_base): Only use under Windows.
+ (windows.h): Include when any _WIN32 host.
+
+Wed Sep 24 18:12:47 1997 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * The following block of changes add support for debugging assembly
+ source files.
+ * breakpoint.c (resolve_sal_pc): Prevent crash when pc isn't
+ associated with a function.
+ * buildsym.c (record_line start_symtab end_symtab): Don't delete
+ symtabs which only have line numbers (but no other debug symbols).
+ * dbxread.c (read_dbx_symtab end_psymtab): Ditto.
+
+ * remote-sim.c: New functions gdbsim_insert/remove_breakpoint. Use
+ intrinsic simulator breakpoints if available, otherwise do it the
+ hard way.
+
+ * configure.tgt: Add d30v.
+ * d30v-tdep.c: New file.
+ * config/d30v/d30v.mt, config/d30v/tm-d30v.h: New files.
+
+Tue Sep 23 11:24:13 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (ALLCONFIG): Remove, inaccurate and never used.
+
+Tue Sep 23 00:08:18 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mips-tdep.c (mips_push_arguments): Tweak alignment of register
+ value if the remaining length of a non-integral argument is smaller
+ than the register size for big-endian non-EABI mode.
+
+ * rs6000-tdep.c (branch_dest): Handle return from signal
+ handler function via sigreturn kernel call.
+
+Mon Sep 22 15:32:06 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * stabsread.h, symtab.h, dbxread.c, symtab.c, stabsread.c:
+ Fix prototypes. Remove function scoped function declarations.
+
+Fri Sep 19 18:51:26 1997 Felix Lee <flee@cygnus.com>
+
+ * config/i386/windows.mh (XDEPFILES): need to list some files
+ explicitly, for odd reasons.
+
+Tue Sep 16 20:00:05 1997 Per Bothner <bothner@cygnus.com>
+
+ * jv-exp.y (push_fieldnames): New, to handle EXP.FIELD1....FIELDN.
+ (push_expression_name): New, to handle expression names.
+ (push_qualified_expression_name): New, for qualified expression names.
+ (parse_number): Fix bugs in parsing of non-decimal integers.
+ * jv-lang.h, jv-lang.c (java_demangle_type_signature): New.
+ * jv-lang.c (type_from_class): Just use name with java_lookup_class.
+ (java_link_class_type): Add dummy "class" field.
+ (java_lookup_type): New.
+ (evaluate_subexp_java case STRUCTOP_STRUCT): Force to address.
+ * jv-typeprint.c (java_type_print_base): Don't print "class" field.
+ Use java_demangle_type_signature to print array class types.
+ * jv-valprint.c (java_value_print): Preliminary array support.
+ Print pointer as TYPE@HEXADDR, instead of (TYPE)0xHEXADDR.
+ (java_val_print): Move check for object type to java_value_print.
+ Check for null. Print pointer as @HEXADDR, not 0xHEXADDR.
+
+ * valops.c (search_struct_field): Search basesclasses in
+ ascending, not descending order. Hack to avoid virtual baseclass
+ botch for Java interfaces.
+
+Tue Sep 16 19:56:23 1997 Per Bothner <bothner@cygnus.com>
+
+ * util.c (run_cleanup_chain, make_run_cleanup, do_run_cleanups):
+ New cleanup clean for cleanups to be run when at each 'run' command.
+ * infcmd.c (run_command): Call do_run_cleanups.
+
+ * solib.c (find_solib): Register cleanup to call clear_solib
+ on a new 'run' command.
+ (symbol_add_stub): First look for existing objfile with same name.
+
+Tue Sep 16 16:00:01 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-sds.c (sds_load): New function.
+ (sds_ops): Use it.
+ (sds_open): Don't set inferior_pid yet.
+ (sds_kill): Remove contents.
+ (sds_create_inferior): Rewrite to work more like monitor
+ interfaces.
+ (sds_restart): Remove, no longer used.
+
+ * monitor.h (MO_SREC_ACK_PLUS, MO_SREC_ACK_ROTATE): New flags.
+ * monitor.c (monitor_wait_srec_ack): Add DINK32-specific ack code.
+ * dsrec.c (load_srec): Always write a header S-record.
+ * dink32-rom.c (dink32_regnames): Fix the names of float registers.
+ (dink32_cmds): Set to use S-record downloading with acks.
+ * remote-est.c (est_cmds): Add MO_SREC_ACK_PLUS flag.
+
+Tue Sep 16 10:08:27 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/v850/tm-v850.h (BREAKPOINT): Set to a truely illegal
+ instruction.
+
+ * exec.c (exec_file_command): Call set_architecture_from_file.
+
+Mon Sep 15 13:01:22 1997 Mark Alexander <marka@cygnus.com>
+
+ * dbxread.c (MSYMBOL_SIZE): New macro.
+ (end_psymtab): Use MSYMBOL_SIZE to extract size from minimal symbol.
+ * elfread.c (elf_symtab_read): If ELF symbol is "special",
+ such as a MIPS16 function, mark minimal symbol as special too.
+ * mips-tdep.c (pc_is_mips16): New function to check whether
+ a function is MIPS16 by looking at the minimal symbol. Use
+ pc_is_mips16 throughout instead of IS_MIPS16_ADDR macro.
+ * config/mips/tm-mips.h (SYMBOL_IS_SPECIAL, MAKE_MSYMBOL_SPECIAL,
+ MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): New functions for setting/testing
+ "special" MIPS16 bit in ELF and minimal symbols.
+ * mdebugread.c (parse_partial_symbols): Don't construct a partial
+ symbol table for a file that already has one.
+
+Sat Sep 13 08:32:13 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * mdebugread.c (parse_symbol, handle_psymbol_enumerators): Handle
+ yet another variant of enumerator debugging info, used by DU 4.0
+ native cc.
+
+Tue Sep 9 20:47:23 1997 Felix Lee <flee@cygnus.com>
+
+ * config/i386/windows.mh (XDEPFILES): reduce to libwingdb.a.
+ otherwise link command line is too long.
+
+Tue Sep 9 17:41:41 1997 Jeffrey A Law (law@cygnus.com)
+
+ * symtab.c, dbxread.c, stabsread.c: Fix up ANSI-C isms. Fix
+ some formatting problems.
+
+Mon Sep 8 16:45:51 1997 Stu Grossman <grossman@cygnus.com>
+
+ * ser-e7kpc.c: Don't include w32sut.h. We no longer use the UT
+ mechanism. Remove prototypes for dos_async_* functions. They don't
+ exist anymore.
+
+Mon Sep 8 12:48:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * top.c (quit_confirm, quit_force): New functions, broken out of
+ quit_command.
+ (quit_command): Just call quit_confirm and quit_force.
+ * top.h (quit_confirm, quit_force): Declare.
+
+Sun Sep 7 17:26:30 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * dbxread.c, buildsym.c, symtab.c, stabsread.c: Add support for
+ reading stabs extensions for live range information.
+ * stabsread.h, partial-stab.h: Add prototypes for new functions.
+ * symtab.h: Add structure for storing live range information.
+
+Wed Sep 3 16:39:39 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (set_arch): New function, update target_architecture.
+
+ * defs.h, top.c (set_architecture_from_arch_mach): Replace
+ set_architecture, takes the arch and machine as arguments.
+
+ * sh3-rom.c (sh3e_open): Update.
+ (sh3_open): Ditto.
+
+Tue Sep 2 12:00:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-e7000.c (e7000_fetch_registers): Fix typo, stray paren.
+ (e7000_wait): Ditto.
+
+Mon Sep 1 11:21:03 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (init_main): Add ``set processor'' as an alias for ``set
+ architecture''.
+
+Sat Aug 30 13:44:48 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/sparc/sparclite.mt: Removed simulator references (erc32
+ has been disabled).
+
+Thu Aug 28 10:20:04 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-e7000.c (e7000_fetch_registers): Check
+ target_architecture instead of sh_processor_type.
+ (e7000_wait): Ditto.
+
+ * config/sh/tm-sh.h (sh_set_processor_type): Delete prototype.
+
+ * sh3-rom.c (sh3_open): Call set_architecture not
+ sh_set_processor_type.
+ (sh3e_open): Ditto.
+
+ * sh-tdep.c (sh_show_processor_type_command): Delete.
+ (sh_set_processor_type_command): Delete.
+ (sh_target_architecture_hook): Rename from sh_set_processor_type,
+ use AP to determine architecture.
+ (sh_show_regs): Use bfd_mach_sh* types.
+
+ * remote-sim.c (gdbsim_open): Pass --arch=XXX to simulator when
+ architecture was specified explicitly.
+
+ * defs.h (target_architecture, target_architecture_auto,
+ set_architecture, set_architecture_from_file): Declare.
+ (target_architecture_hook): Allow targets to be notified of set
+ arch commands.
+
+ * top.c (init_main): Add set/show/info architecture commands.
+ (set_architecture, show_architecture, info_architecture): New
+ functions, parse same.
+ (set_architecture_from_file): New function, determine arch from
+ BFD.
+
+Tue Aug 26 17:13:43 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Only pass endianness to sim_open
+ when set explicitly. Prepend endianness arg so that it can be
+ overridden.
+
+ * defs.h, top.c (target_byte_order_auto): Make global when
+ byteorder is selectable.
+
+Tue Aug 26 15:19:56 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_create_inferior): Pass exec_bfd into
+ sim_create_inferior.
+ (gdbsim_create_inferior): Pass -1 to proceed, sim_create_inferior
+ has already set the PC.
+ (gdbsim_create_inferior): Allow exec_file to be NULL, make "No
+ exec file" a warning. Ditto for "No program loaded".
+
+Mon Aug 25 17:08:01 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.c: revert Sun change -- enable log file handling
+
+Mon Aug 25 12:21:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Pass exec_bfd to sim_open call.
+
+Sun Aug 24 21:16:59 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.c: comment out sections that create and flush wigglers.log
+ log file when using the wiggler.
+
+Thu Aug 21 16:18:08 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/powerpc/ppc-eabi.mt:
+ * config/powerpc/ppc-sim.mt:
+ * config/powerpc/ppcle-eabi.mt:
+ * config/powerpc/ppcle-sim.mt: ser-ocd.c needs to be before
+ other ocd-related files in TDEPFILES
+
+Thu Aug 21 14:56:04 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ppc-bdm.c (bdm_ppc_wait): stop printfing ecr, der
+ * ocd.c: initialize remote_timeout
+ (ocd_wait): while looping, call ocd_do_command with OCD_AYT
+ (ocd_get_packet): remove find_packet goto. If there isn't
+ an 0x55 at the start, something is quite wrong so error out
+ instead of advancing in the packet and trying again. If checksum
+ is invalid, print error message instead of trying again.
+ * ser-ocd.c (ocd_readchar): error if we attempt to read past
+ the end of the from_wiggler_buffer.
+
+
+Wed Aug 20 14:08:39 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dink32-rom.c: Don't use "mf" command to fill, is too picky
+ about alignment.
+
+
+Tue Aug 19 08:41:36 1997 Fred Fish <fnf@cygnus.com>
+
+ * objfiles.c (objfile_relocate): Add call to breakpoint_re_set
+ after relocations are complete.
+ * remote-vx.c (vx_add_symbols): Remove call to breakpoint_re_set,
+ this is now done in objfile_relocate.
+
+Mon Aug 18 17:29:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * win32-nat.c (handle_exception): Return a value indicating
+ whether the exception was handled. Don't handle random exceptions
+ the first time around, so that structured exception handling
+ works.
+ (child_wait): Check the return value of handle_exception. Set the
+ continue_status argument to ContinueDebugEvent accordingly.
+
+Mon Aug 18 11:14:15 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.tgt: Add support for v850ea target.
+
+Sun Aug 17 20:31:57 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * m32r-stub.c: fix typo
+
+Sun Aug 17 17:33:34 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-sds.c: Remove unused remnants of remote.c.
+ (tob64): Return the result length.
+ (sds_interrupt): Send a stop message.
+ (sds_wait): Add debug output for signal interpretation, flag
+ that signal was due to a trap.
+ (sds_fetch_registers): Fill the registers array correctly for
+ PowerPC.
+ (sds_store_registers): Get the right values from registers array.
+ (putmessage): Tweak length handling so checksum comes out right.
+ (sds_insert_breakpoint, sds_remove_breakpoint): Do correctly.
+
+Fri Aug 15 20:53:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (init.c): Don't use xargs.
+
+Fri Aug 15 13:59:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Add the symbols for any
+ newly loaded objects upon a TARGET_WAITKIND_LOADED event.
+
+ Rewrite code which determines the TOC address for calling functions
+ in the inferior under AIX.
+ * rs6000-nat.c (find_toc_address): New function to determine
+ the required TOC address from a function address.
+ (_initialize_core_rs6000): Set up find_toc_address_hook to point
+ to find_toc_address.
+ (xcoff_relocate_symtab, xcoff_relocate_core): Remove
+ add_text_to_loadinfo calls.
+ (exec_one_dummy_insn): Change pid and status to int to get rid of
+ compiler warnings.
+ (xcoff_relocate_symtab): Cast ldi to `int *' when passing it to
+ ptrace to get rid of compiler warnings.
+ * rs6000-tdep.c: Add definition for find_toc_address_hook.
+ (rs6000_fix_call_dummy): If find_toc_address_hook is non zero,
+ patch TOC address load code in the call dummy with the value
+ returned from find_toc_address_hook.
+ (struct loadinfo, loadinfo, loadinfolen,
+ loadinfotextindex, xcoff_init_loadinfo, free_loadinfo,
+ xcoff_add_toc_to_loadinfo, add_text_to_loadinfo, find_toc_address):
+ Remove.
+ (_initialize_rs6000_tdep): Remove initialization of
+ coff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook.
+ * xcoffread.c (coff_add_toc_to_loadinfo_hook,
+ xcoff_init_loadinfo_hook): Remove.
+ (struct coff_symfile_info): Add toc_offset field.
+ (scan_xcoff_symtab): Record toc_offset value in toc_offset field
+ instead of calling xcoff_add_toc_to_loadinfo_hook.
+ (get_toc_offset): New function to return the value of the
+ toc_offset field for an object file.
+ (xcoff_initial_scan): Remove call of xcoff_init_loadinfo_hook.
+ * xcoffsolib.h (add_text_to_loadinfo): Remove declaration.
+ * config/rs6000/tm-rs6000.h: Add declarations for
+ find_toc_address_hook and get_toc_offset.
+
+Wed Aug 13 19:31:28 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-sds.c: New file, interface to SDS-compatible monitors.
+ * Makefile.in (remote-sds.o): Add build rule.
+ * config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt
+ (TDEPFILES): Add remote-sds.o.
+
+Tue Aug 12 14:37:18 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.c (ocd_wait): loop until we're in BDM mode instead of
+ assuming control has returned to GDB.
+
+Mon Aug 11 19:16:04 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dink32-rom.c: New file, support for DINK32 monitor.
+ * Makefile.in (dink32-rom.o): Add build rule.
+ * config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt
+ (TDEPFILES): Add dink32-rom.o.
+ * monitor.h (MO_32_REGS_PAIRED, MO_SETREG_INTERACTIVE,
+ MO_SETMEM_INTERACTIVE, MO_GETMEM_16_BOUNDARY,
+ MO_CLR_BREAK_1_BASED): New monitor interface flags.
+ * monitor.c: Use them.
+ (monitor_store_register): Use setreg.term if defined.
+ (monitor_insert_breakpoint, monitor_remove_breakpoint): Notice
+ if set_break and clr_break fields are empty.
+
+Mon Aug 11 16:22:36 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.c (ocd_insert_breakpoint, ocd_remove_breakpoint): Macro
+ BDM_BREAKPOINT already has braces around it, remove erroneous ones.
+ * ser-ocd.c (ocd_write): Conditionalize on _WIN32 instead of
+ __CYGWIN32__.
+ * config/powerpc/tm-ppc-eabi.h: Remove BDM_NUM_REGS, BDM_REGMAP
+ * ppc-bdm.c: move BDM_NUM_REGS, BDM_REGMAP here from tm.h file,
+ fill in doc fields of bdm_ppc_ops.
+ (bdm_ppc_fetch_registers): Don't ask for invalid registers such
+ as the MQ or floating point regs not present on ppc 8xx boards.
+ (bdm_ppc_store_registers): Don't write those same invalid registers.
+ * config/i386/cygwin32.mh: Stop including ocd.o ser-ocd.o.
+ * config/powerpc/ppc-eabi.mt:
+ * config/powerpc/ppcle-eabi.mt:
+ * config/powerpc/ppc-sim.mt:
+ * config/powerpc/ppcle-sim.mt: Include ser-ocd.o.
+
+Mon Aug 11 16:08:52 1997 Fred Fish <fnf@cygnus.com>
+
+ * frame.h (enum lval_type): Conditionalize on __GNUC__
+ instead of __STDC__.
+
+Sun Aug 10 19:08:26 1997 Jeffrey A Law (law@cygnus.com)
+
+ * utils.c (error): Fix return type for !ANSI_PROTOTYPES.
+
+Sun Aug 10 16:49:09 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.c: move ocd_write_bytes proto to ocd.h since it is used
+ by ppc-bdm.c, use OCD_LOG_FILE to help debugging, define
+ BDM_BREAKPOINT if not defined in tm.h
+ (ocd_error): add new error cases
+ (ocd_start_remote): send the OCD_INIT command before
+ OCD_AYT and OCD_GET_VERSION calls, 80 was correct speed after all
+ (ocd_write_bytes): no longer static
+ (ocd_insert_breakpoint): no longer static
+ (ocd_remove_breakpoint): new
+ * ocd.h: add protos for ocd_write_bytes, ocd_insert_breakpoint,
+ and ocd_remove_breakpoint
+ * ppc-bdm.c: change bdm_ppc_ops so we call ocd_insert_breakpoint
+ and ocd_remove_breakpoint instead of memory_insert_breakpoint
+ and memory_remove_breakpoint.
+ (bdm_ppc_open): after calling ocd_open, modify DER
+ register so interrupts will drop us into debugging mode, finally
+ disable the watchdog timer on the board so we don't leave BDM
+ mode unexpectedly.
+
+Sat Aug 9 01:50:14 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * values.c (value_primitive_field): Account for offset when
+ extracting the value of a bitfield.
+ From Paul Hilfinger <hilfingr@CS.Berkeley.EDU>.
+
+Fri Aug 8 21:35:44 1997 Mark Alexander <marka@cygnus.com>
+
+ * config/tic80/tic80.mt:
+ (GDBSERVER-DEPFILES, GDBSERVER_LIBS): Define for gdbserver.
+ (SIM): Remove -lm to prevent make errors.
+ * configure.tgt: add gdbserver to configdirs for tic80.
+ * gdbserver/utils.c (error): Change prototype to match defs.h.
+ * gdbserver/low-sim.c: Change simulator calls to use new interface.
+ * remote.c (remote_write_bytes): Include '$' at start of packet
+ and checksum at end of packet in overhead calculation.
+
+Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ser-ocd.c: If _WIN32, include <windows.h>.
+ (dll_do_command): New static variable if _WIN32.
+ (ocd_open): Set dll_do_command if _WIN32.
+ (ocd_write): Use dll_do_command rather than do_command.
+ * config/i386/cygwin32.mh (XDEPFILES): Remove libwigglers.a.
+ (BDM_DLLNAME, BDM_LIBNAME, BDM_DEFFILE): Don't define.
+ ($(BDM_LIBNAME)): Remove target.
+ * wigglers.def: Remove.
+
+ * config/i386/cygwin32.mh ($(BDM_LIBNAME)): Rename target from
+ libwigglers.def.
+ (libwigglers.a): Remove target.
+
+Fri Aug 8 13:11:01 1997 Mike Meissner <meissner@cygnus.com>
+
+ * config/powerpc/ppc{,le}-{eabi,sim}.mt (TDEPFILES): Make sure
+ ppc-bdm.o and ocd.o are used for all powerpc-eabi targets.
+
+Thu Aug 7 19:40:52 1997 Geoffrey Noer <noer@cygnus.com>
+
+ Changes to OCD support to support wiggler box as well as
+ target boxes:
+ * ocd.c: change speed in init command to 0 from 80,
+ add (temporary) logging commands to help debugging,
+ (ocd_open): if "target ocd wiggler lpt" then use special
+ ser-ocd.c serial interface which communicates with Wigglers.dll,
+ otherwise ("target ocd <foo>") do as we did before
+ (ocd_get_packet): add OCD_LOG_FILE and OCD_SET_CONNECTION to
+ switch of known commands of len 0
+ * ocd.h: add OCD_LOG_FILE
+ * serial.c (serial_open): do serial_interface_lookup on ocd
+ in the case of ocd
+ * ser-ocd.c: add buffer to contain responses from sending a
+ command to the Wigglers.dll.
+ (ocd_readchar): return curr char from buffer and increment ptr
+ (ocd_write): send buffer to Wigglers.dll, storing response in
+ return buffer and initializing curr location ptr to start of
+ buffer.
+
+Thu Aug 7 13:39:31 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * ocd.h: add OCD_SET_CONNECTION
+ * ocd.c: rename "do_command" to "ocd_do_command"
+
+Thu Aug 7 13:09:17 1997 Geoffrey Noer <noer@cygnus.com>
+
+ Nomenclature change. BDM is a specific type of OCD
+ (On Chip Debugging). Wiggler is the parallel port box controlled
+ by Wigglers.dll. The faster target box from Macraigor Systems
+ is not a wiggler.
+ * ocd.c:
+ * ocd.h:
+ * ppc-bdm.c:
+ * ser-ocd.c:
+ Replace all instances of "wiggler_" with "ocd_" and change most other
+ instances of "wiggler" to "ocd" or "ocd device" depending on context.
+ * config/m68k/monitor.mt: remove remote-wiggler.o from TDEPFILES
+ until OCD with that target is supported again.
+
+Wed Aug 6 16:15:31 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: add DLLTOOL = @DLLTOOL@, pass on DLLTOOL to
+ sub makes, change clean rule to also remove *.a to remove
+ libwigglers.a, in dependencies: add ppc-bdm.o ocd.o ser-ocd.o and
+ remove remote-wiggler.o
+ * configure.in: add DLLTOOL support
+ * configure: regenerate
+ * wigglers.def: new file for imports for wigglers.dll
+ * ser-ocd.c: new file which is layer between ocd.c and either the
+ wigglers.dll or the target box, only stub so far
+ * config/powerpc/ppc-eabi.mt: add ppc-bdm.o to TDEPFILES
+ * config/powerpc/ppc-sim.mt: add ppc-bdm.o to TDEPFILES
+ * config/i386/cygwin32.mh: add ocd.o ser-ocd.o libwigglers.a
+ to XDEPFILES, add rules to build libwigglers.a
+
+ checking in changes of Stu Grossman <grossman@cygnus.com>:
+ * remote-wiggler.c: delete
+ * ocd.c: new, was remote-wiggler.c
+ always include sys/types.h, include ocd.h, move WIGGLER
+ commands and many wiggler prototypes to ocd.h, make wiggler_desc
+ static, stop making local wiggler functions static,
+ define write_mem_command for wiggler_write_bytes
+ (wiggler_start_remote): stop hardcoding the target type,
+ instead set and use a target_type variable.
+ (wiggler_open): add new target_type and ops args
+ (wiggler_wait): now no longer takes pid and target_status as args,
+ stop trying to set target_status struct, remove BGND insn
+ checks
+ (read_bdm_registers): renamed to wiggler_read_bdm_registers
+ (wiggler_read_bdm_registers): numregs arg changed to reglen arg,
+ remove pktlen check, set reglen instead of numregs
+ (dump_all_bdm_regs): delete
+ (wiggler_fetch_registers): delete
+ (wiggler_prepare_to_store): now just an empty function
+ (wiggler_store_registers): delete
+ (wiggler_read_bdm_register): new
+ (wiggler_write_bdm_registers): new
+ (wiggler_write_bdm_register): new
+ (wiggler_write_bytes): use write_mem_command variable instead of
+ WIGGLER_WRITE_MEM
+ (get_packet): renamed to wiggler_get_packet, change refs throughout
+ (put_packet): renamed to wiggler_put_packet, change refs throughout
+ (wiggler_get_packet): add break to default case of switch,
+ change length of WIGGLER_GET_VERSION len to 10 from 4 to match
+ specs
+ (wiggler_mourn): unpush_target with current_ops, not &wiggler_ops
+ (flash_xfer_memory): delete
+ (noop_store_registers): new placeholder replacement for
+ target_store_registers() which prevents generic_load from trying to
+ set up the PC.
+ (bdm_update_flash_command): add store_registers_tmp variable,
+ make handling of wiggler_ops more generic -- define wiggler_ops
+ in a target-specific file instead (such as ppc-bdm.c in the case
+ of the ppc), use current_target to deal with registers again
+ making this file less target-specific.
+ (bdm_read_register_command): new
+ (_initialize_remote_wiggler): stop doing add_target (&wiggler_ops),
+ comment out add_cmd ("read-register", ...)
+ * ocd.h: new, contains common wiggler prototypes, command definitions
+ * ppc-bdm.c: file for ppc-specific OCD code, including target_ops
+ structure for ppc bdm
+ (bdm_ppc_open): new
+ (bdm_ppc_wait): new
+ (bdm_ppc_fetch_registers): new
+ (bdm_ppc_store_registers_: new
+ (_initialize_bdm_ppc): new
+ * config/powerpc/tm-ppc-eabi.h: add necessary CPU32 BDM defines
+
+Tue Aug 5 23:56:14 1997 Mark Alexander <marka@cygnus.com>
+
+ * tic80-tdep.c (tic80_init_extra_frame_info): Allow zero
+ as a valid SP-relative offset of a saved register.
+
+Wed Aug 6 00:24:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * hpread.c (hpread_read_struct_type): Use accessor macros rather
+ than directly mucking around with data structures.
+
+Tue Aug 5 13:37:14 1997 Per Bothner <bothner@cygnus.com>
+
+ * gdbtypes.h: Re-interpret struct field. Suppport address of static.
+ Add a bunch of macros.
+ * coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c:
+ Update to use new macros.
+ * coffread.c, hpread.c, stabsread.c: Remove bugus TYPE_FIELD_VALUE.
+ * value.h, values.c (value_static_field): New function.
+ * cp-valprint.c, valops.c: Modify to use value_static_field.
+
+ * jv-lang.c (get_java_utf8_name): Re-write so it works with
+ implied (missing) data field, as defined by cc1java.
+ (java_link_class_type): Type length and field offset (in interior)
+ now includes object header. Get static fields working.
+ * jv-lang.h (JAVA_OBJECT_SIZE): Update for change in Kaffe.
+ * jv-typeprint.c (java_type_print_derivation_info,
+ java_type_print_base): New functions, for better Java output.
+ * jv-valprint.c: Start to support Java-specific output.
+
+Sun Aug 3 08:18:09 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-valprint.c (c_val_print): Use extract_address to retrieve
+ the address of the virtual function.
+ From Peter Bloecher (Peter.Bloecher@eedn.ericsson.se).
+
+ * eval.c (evaluate_subexp_standard), valarith.c (value_x_unop):
+ Handle C++ operator *.
+
+Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Check for cygwin32 environment. Define and
+ substitute WIN32LIBS and WIN32LDAPP. Always set configdir to
+ unix; setting it to win was for an old Tcl/Tk configuration
+ scheme.
+ * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@.
+ (WIN32LDAPP, WIN32LIBS): Define.
+ (CLIBS): Add $(WIN32LIBS).
+ (gdb): Use $(WIN32LDAPP).
+ * configure: Rebuild.
+
+Thu Jul 31 15:40:19 1997 Per Bothner <bothner@cygnus.com>
+
+ * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME,
+ SYMBOL_DEMANGLED_NAME): Add demangling support for Java.
+ * utils.c (fprintf_symbol_filtered): Handle language_java.
+
+ * symtab.c (decode_line_1): Handle Java-style package.class.method.
+
+Wed Jul 30 14:04:18 1997 Per Bothner <bothner@cygnus.com>
+
+ * java-*: Renamed to jv-*, to make fit within 14 characters.
+ * jv-lang.h (java_type_print): Added declaration.
+ * jv-typeprint.c: New file. Provides java_print_type.
+ * jv-lang.c (java_link_class_type): New function.
+ (java_language_defn): Replace c_print_type by java_print_type.
+ * Makefile.in: Update accordingly.
+
+Tue Jul 29 10:12:44 1997 Felix Lee <flee@cygnus.com>
+
+ * Makefile.in (init.c): except some mswin files do need to be
+ scanned. oh well.
+
+Mon Jul 28 14:04:39 1997 Felix Lee <flee@cygnus.com>
+
+ * Makefile.in (init.c): don't try to scan mswin for _initialize
+ funcs. (generates misleading error message because files have
+ .cpp suffix, not .c suffix)
+
+Mon Jul 28 13:27:21 1997 Felix Lee <flee@cygnus.com>
+
+ * ser-e7kpc.c: <w32sut.h> -> "mswin/w32sut.h"
+
+Mon Jul 28 02:54:31 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * xcoffread.c (coff_getfilename): Do not strip directory component
+ of filename.
+
+Fri Jul 25 15:16:15 1997 Felix Lee <flee@cygnus.com>
+
+ * mon960-rom.c: removed unused #includes; no ioctl.h in Windows.
+ * nindy-share/ttyflush.c: find sleep() for _MSC_VER.
+ * remote-array.c: #include <ctype.h> for isascii().
+ * utils.c (notice_quit,pollquit): cleanup. _WIN32 -> _MSC_VER.
+
+Fri Jul 25 16:48:18 1997 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (execute_command): Force cleanup of alloca areas.
+ * findvar.c (registers_changed): Likewise.
+
+Fri Jul 25 15:37:15 1997 Stu Grossman <grossman@cygnus.com>
+
+ * v850ice.c: Include <windows.h>. Support new v850 DLL interface.
+ * Add defs for target status.
+
+Tue Jul 22 12:11:48 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * config/mips/tm-mips64.h: longs, long longs, and pointers
+ are all 64 bits on EABI mips targets.
+
+Thu Jul 17 11:38:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * partial-stab.h (case N_BINCL): detect missing partial symtab.
+ * dbxread.c: Add a complaint for N_BINCL without a corresponding
+ partial symtab. Remove earlier change of 5/27/97.
+
+Wed Jul 16 10:38:03 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * sol-thread.c (sol_thread_[store, fetch]_registers): if
+ inferior_pid is an LWP rather than a Solaris thread, let
+ procfs handle the request.
+ (rw_common, sol_thread_xfer_memory): procfs_xfer_memory will
+ only work if inferior_pid points to an LWP (rather than a
+ Solaris thread). Use procfs_first_available to find a good LWP.
+ (info_solthreads): added a maintenance command to list all
+ known Solaris threads and their attributes.
+ * mips-tdep.c (mips_do_registers_info): Completely changed the
+ output format to be neat and columnar. Added the helper funcs
+ do_fp_register_row and do_gp_register_row. Also small mods to
+ mips_print_register, which is still used to print a single reg.
+
+Mon Jul 14 18:02:53 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * procfs.c (wait_fd): Handle an fd that has "hung up" or
+ otherwise terminated (Solaris threads).
+
+Thu Jul 10 00:02:41 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * defs.h (init_ui_hook): Change prototype to accept one arg.
+ * main.c (gdb_init): Change prototype to accept one arg.
+ * top.c (gdb_init): Accepts one argument which it uses to
+ call (*init_ui_hook).
+
+Fri Jul 4 14:49:33 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * source.c (OPEN_MODE, FDOPEN_MODE): Define; value depends upon
+ whether CRLF_SOURCE_FILES is defined.
+ (open_source_file): Use OPEN_MODE with open and openp.
+ (print_source_lines): Use FDOPEN_MODE with fdopen. If
+ CRLF_SOURCE_FILES is defined, ignore \r characters.
+ (forward_search_command): Use FDOPEN_MODE with fdopen.
+ (reverse_search_command): Likewise.
+ * config/i386/xm-cygwin32.h (CRLF_SOURCE_FILES): Define.
+ (LSEEK_NOT_LINEAR): Don't define.
+
+Thu Jul 3 17:41:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * mips-tdep.c (mips_extract_return_value): align 4-byte float
+ return values within the 8-byte FP register.
+
+Thu Jul 3 13:48:11 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * mips-tdep.c (mips_push_arguments): don't left-adjust 32-bit
+ integers in 64-bit register parameters before function calls.
+
+Mon Jun 30 17:54:51 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * mips-tdep.c (mips_push_arguments): special-case handling for
+ odd-sized struct parameters passed in registers / on stack.
+
+Mon Jun 30 15:30:38 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * mips-tdep.c (mips_push_arguments): tweak alignment of small
+ structs passed in registers for little-endian non-EABI mode.
+
+Mon Jun 30 13:05:39 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * breakpoint.c (frame_in_dummy): use generic dummy if available.
+ (check_duplicates, clear_command): compare sections only if
+ doing overlay debugging.
+
+Fri Jun 27 23:03:53 1997 Fred Fish <fnf@ninemoons.com>
+
+ * buildsym.h (struct subfile): Add debugformat member.
+ (record_debugformat): Declare global function.
+ * buildsym.c (start_subfile): Initialize debugformat member
+ to NULL.
+ (record_debugformat): New function to record the format.
+ (end_symtab): Copy format into symtab debugformat member.
+ (end_symtab): Free subfile debugformat member.
+ * symmisc.c (free_symtab): Free debugformat when freeing
+ symtab.
+ * symfile.c (allocate_symtab): Initialize the new debugformat
+ member for new symtabs.
+ * symtab.h (struct symtab): Add debugformat member.
+ * source.c (source_info): Print the debug format.
+
+ * os9kread.c (os9k_process_one_symbol): Call record_debugformat
+ with "OS9".
+ * hpread.c (hpread_expand_symtab): Call record_debugformat
+ with "HP".
+ (hpread_process_one_debug_symbol): Ditto.
+ * dbxread.c (process_one_symbol): Call record_debugformat
+ with "stabs".
+ * coffread.c (coff_start_symtab): Call record_debugformat
+ with "COFF".
+ * xcoffread.c (read_xcoff_symtab): Call record_debugformat
+ with "XCOFF".
+ * dwarfread.c (read_file_scope): Call record_debugformat
+ with "DWARF 1".
+ * dwarf2read.c (read_file_scope): Call record_debugformat
+ with "DWARF 2".
+ * dstread.c (dst_end_symtab): Set debugformat to be
+ "Apollo DST".
+ * mdebugread.c (new_symtab): Set debugformat to be "ECOFF".
+
+Fri Jun 27 21:05:45 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * mips-tdep.c (mips_push_arguments): handle alignment of
+ integer and struct args on stack for mips64 big-endian.
+
+Fri Jun 27 19:19:12 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * config/mips/tm-mips.h (USE_STRUCT_CONVENTION): MIPS_EABI returns
+ structs in a register wherever possible.
+ * mips-tdep.c (mips_extract_return_value): handle structs.
+ (mips_store_return_value): handle values smaller than MIPS_REGSIZE
+ (including structs, if gdb ever allows it).
+
+Fri Jun 20 17:58:34 1997 Fred Fish <fnf@cygnus.com>
+
+ * sh-tdep.c (sh_skip_prologue): Also recognize fmov insns.
+ (sh_frame_find_saved_regs): Recognize fmov insns and adjust
+ stack push count accordingly.
+ * sh-tdep.c (IS_FMOV, FPSCR_SZ): New defines
+
+Thu Jun 19 08:18:48 1997 Mark Alexander <marka@cygnus.com>
+
+ * utils.c (floatformat_from_doublest): Improve test for infinity.
+
+Wed Jun 18 13:47:52 1997 Fred Fish <fnf@cygnus.com>
+
+ * dwarfread.c (isreg, optimized_out, offreg, basereg): Move
+ global variables into the struct dieinfo structure.
+ (locval): Pass pointer to a dieinfo struct rather than a
+ pointer to the raw location information. Change prototype.
+ Set isreg, optimized_out, offreg and basereg as appropriate.
+ (struct_type): Call locval with dieinfo struct pointer.
+ (new_symbol): Ditto.
+ (new_symbol): Call locval and save location before testing
+ the values of the new dieinfo struct flags, set by locval.
+
+Tue Jun 17 13:30:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * procfs.c (proc_set_exec_trap, procfs_init_inferior, procfs_wait,
+ unconditionally_kill_inferior): Undo Oct 26 1996 and Apr 26 1997
+ changes to trace PRFS_STOPTERM and handle PR_DEAD.
+ These changes tried to work around a problem with an early DU 4.0
+ release, but they trigger subtle timing dependent kernel bugs
+ in older OSF/1 releases.
+
+Tue Jun 17 06:52:47 1997 Fred Fish <fnf@cygnus.com>
+
+ * dwarfread.c (new_symbol): Use SYMBOL_VALUE_ADDRESS, instead of
+ SYMBOL_VALUE, to set the value of LOC_STATIC symbols.
+
+Mon Jun 16 18:38:28 1997 Mark Alexander <marka@cygnus.com>
+
+ * infrun.c (wait_for_inferior): Mark registers as invalid when
+ stepping over an instruction that triggered a watchpoint.
+ * remote-mips.c: Numerous changes to support hardware breakpoints
+ and watchpoints on LSI MiniRISC and TinyRISC boards.
+ * mips-tdep.c: Move MIPS16-related macros to config/mips/tm-mips.h.
+ (mips_breakpoint_from_pc): Account for different breakpoint
+ instructions used by PMON and IDT monitor.
+ * config/mips/tm-embed.h: Enable hardware breakpoints on embedded
+ MIPS targets.
+ * config/mips/tm-mips.h: Define breakpoint instructions for
+ PMON and IDT monitor. Move MIPS16-related macros here from
+ mips-tdep.c.
+
+Fri Jun 13 13:44:47 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * config/mips/tm-tx39[l].h, tx39[l].mt: change r3900 target to tx39.
+
+Fri Jun 13 14:14:10 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): Fix some comments.
+ Add missing return statements after finding an "add imm{16,32},sp"
+ instruction.
+ (mn10300_frame_chain): Add in size of our register save area to find
+ our caller's frame if our caller does not have a frame pointer.
+
+Fri Jun 13 12:55:49 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * symfile.c (generic_load): Check return code of target_write_memory.
+
+Fri Jun 13 10:28:09 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/i386/nm-linux.h: Enable prototypes that were #ifdef out.
+ * config/tm-sysv4.h (in_plt_section): Add prototype.
+
+ * maint.c (maintenance_translate_address): Avoid assignment
+ inside if, per GNU coding standards.
+ * symfile.c (simple_read_overlay_table): Avoid assignments inside if,
+ per GNU coding standards.
+
+ * monitor.c (parse_register_dump): Is really a void function.
+ Add prototype.
+ (monitor_read_memory): Remove unused variable "name".
+ (monitor_read_memory): Remove unused variable "regbuf".
+ (monitor_open): Remove unused variable "i".
+ (get_hex_word): Apparently unused, #if away for now.
+ (from_hex): Ditto.
+
+ * i386v4-nat.c (supply_fpregset): Remove unused variable "regi".
+ (fill_fpregset): Remove unused variables "regi", "to", "from" and
+ "registers".
+
+ * remote-e7000.c (ctype.h): Include.
+ (e7000_insert_breakpoint): #if away unused arg used by unused expr.
+ * frame.h (generic_get_saved_register): Add prototype.
+ (enum lval_type): Add partial forward decl.
+ * dsrec.c (make_srec): Remove unused variable "type_code".
+ * remote-sim.c (gdbsim_wait): Handle sim_running and sim_polling
+ cases by just ignoring them.
+ (command.h): Include.
+
+ * java-exp.y (parse_number): Remove unused variable "unsigned_p".
+ * java-lang.c (gdbcore.h): Include for prototypes.
+ (type_from_class): Remove unused variable "ftype".
+ (type_from_class): Remove unused variable "name_length".
+ (evaluate_subexp_java): Add default case to handle remaining
+ enumerations.
+ * java-valprint.c (c-lang.h): Include for prototypes.
+
+ * symfile.c (simple_read_overlay_region_table): #if away
+ unused function.
+ (simple_free_overlay_region_table): Ditto.
+ (overlay_is_mapped): Add default case to switch.
+ (simple_read_overlay_region_table): Ditto.
+ (simple_read_overlay_region_table): Add prototype.
+
+ * symtab.c (fixup_symbol_section): Remove unused msym variable.
+ (fixup_psymbol_section): Ditto.
+ (find_pc_sect_symtab): Make distance a CORE_ADDR.
+
+ * utils.c: Add comment about t_addr being either unsigned long or
+ unsigned long long.
+ (paddr): Change formats to match actual types args are cast to.
+ (preg): Ditto.
+ (paddr_nz): Ditto.
+ (preg_nz): Ditto.
+
+ * defs.h (perror_with_name): Is a NORETURN function.
+ * utils.c (perror_with_name): Is a NORETURN function.
+ (error): Is NORETURN independently of ANSI_PROTOTYPES.
+
+ * symtab.c (fixup_symbol_section): Remove prototype.
+ * symtab.h: (fixup_symbol_section): Add prototype.
+ * m32r-rom.c (report_transfer_performance): Add prototype.
+ * sparclet-rom.c: Ditto.
+ * dsrec.c: Ditto.
+
+ * c-exp.y (parse_number): Cast args to float* or double* as
+ appropriate for conversion format.
+ * java-exp.y (parse_number): Ditto.
+
+ * Makefile.in (c-exp.tab.c): Remove #line lines that refer
+ to nonexistant y.tab.c file.
+ (java-exp.tab.c): Ditto.
+ (f-exp.tab.c): Ditto.
+ (m2-exp.tab.c): Ditto.
+
+ * sh-tdep.c (symfile.h): Include.
+ (gdb_string.h): Include.
+ (sh_fix_call_dummy): Ifdef away, currently unused.
+ * config/sh/tm-sh.h (pop_frame): Add prototype.
+ * config/sh/tm-sh.h (sh_set_processor_type): Add prototype.
+
+Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * eval.c (evaluate_subexp_for_sizeof): Handle dereferencing
+ of non-pointer values.
+
+ * symtab.c (gdb_mangle_name): Improve mangling of nested types,
+ their physical names already include the class name.
+
+ * valops.c (value_cast): Handle upcast of a class pointer.
+
+ From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de):
+ * corelow.c (get_core_registers): Make secname big enough.
+
+Fri Jun 6 14:43:23 1997 Keith Seitz <keiths@pizza.cygnus.com>
+
+ * config/sh/tm-sh.h: add define for FPSCR_REGNUM
+ * sh-tdep.c (sh_show_regs): print out all registers for
+ the current processor
+
+Fri Jun 6 13:01:55 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_kill): Remove call to depreciated function
+ sim_kill.
+
+Thu Jun 5 11:39:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Fixes for recent correction to PE format:
+ * coffread.c (pe_file): New static variable.
+ (struct find_targ_sec_arg): Change resultp from pointer to int to
+ pointer to pointer to asection.
+ (find_targ_sec): Just store the section in args->resultp, not the
+ section offset value.
+ (cs_to_section): Compute the section offset value from the
+ section.
+ (cs_section_address): New static function.
+ (coff_symfile_read): Set pe_file.
+ (read_one_sym): When reading a PE file, adjust the symbol value to
+ include the section address if the symbol has an appropriate
+ storage class.
+
+Tue Jun 3 16:24:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * configure.tgt: add mipsr3900-elf target
+ * config/mips/r3900.mt r3900l.mt tm-r3900.h tm-r3900l.h: ditto
+
+Tue May 27 10:34:11 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * dbxread.c: Check malloc's return for null, prevent segv.
+
+Fri May 23 14:45:02 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * infcmd.c (jump_command): Don't try to dereference sfn if it's
+ NULL.
+
+Fri May 23 13:51:57 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (init_cmd_lists): Always initialize endianlist.
+ (init_main): Always define endian commands.
+ (set_endian_big): Issue warning if endian not selectable.
+ (set_endian_little): Ditto.
+ (set_endian_auto): Ditto.
+
+Thu May 22 11:53:21 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (simulator_command): Restrict access to the
+ simulator to periods when the simulator is open.
+
+Wed May 21 16:03:25 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * procfs.c (init_procinfo): new function, abstracts some code
+ shared by create_procinfo and do_attach;
+ (procfs_set_inferior_syscall_traps): new function, abstracts
+ some code needed by procfs_init_inferior, do_attach, and
+ procfs_lwp_creation_handler; (procfs_first_available): new
+ function, find any LWP that's runnable; (procfs_thread_alive):
+ replace stub function with real implementation;
+ (procfs_lwp_creation_handler): fix bug starting new child
+ threads; (info_proc): bug fixes and enhancements for the
+ "INFO PROCESSES" command; (close_procinfo_file): call new
+ function "delete_thread" to cleanup GDB's thread database;
+ (proc_init_failed): add new argument "kill", to control whether
+ process is killed (so this function can be shared by
+ create_procinfo and do_attach); (procfs_exit_handler): handle
+ exit from an attached process, and cleanup procinfo handles
+ when the process exits; (procfs_resume, procfs_wait): cleanup
+ after a thread when it exits; (do_attach, do_detach): handle
+ attached processes with multiple threads; plus some general
+ improvements in the diagnostic output.
+ * sol-thread.c (sol_thread_alive): replace stub with real
+ implementation; (thread_to_lwp, lwp_to_thread): enhance to
+ handle threads that may have exited; (sol_thread_attach): add
+ startup setup stuff; (sol_thread_detach): add unpush_target
+ call; (sol_thread_mourn_inferior): add unpush_target call;
+ (sol_thread_wait, sol_thread_resume): enhance to deal with
+ thread exit cleanly; (sol_thread_new_objfile,
+ sol_thread_pid_to_str): detect unsuccessful startup and
+ don't crash; plus some general cleanup.
+ * thread.c (delete_thread): new function, allows targets to
+ notify gdb when a thread is no longer valid.
+ * infrun.c (wait_for_inferior): don't try to detect a new
+ thread on receiving a TARGET_EXITED event.
+
+Tue May 20 09:32:02 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Pass callback struct.
+ (init_callbacks): Remove call to sim_set_callbacks.
+
+Thu May 15 07:56:50 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/rs6000/tm-rs6000.h (SIG_FRAME_LR_OFFSET): Define.
+ * rs6000-tdep.c (frameless_function_invocation): Mark frames
+ with a zero PC as frameless to improve backtraces from core dumps
+ caused by dereferencing a NULL function pointer.
+ (frameless_function_invocation, frame_saved_pc, rs6000_frame_chain):
+ Handle frameless functions interrupted by a signal.
+
+ * sparc-tdep.c (sparc_init_extra_frame_info, sparc_frame_saved_pc):
+ Handle frameless functions interrupted by a signal.
+
+Wed May 14 08:58:55 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-tdep.c (mn10200_analyze_prologue): Update prologue comments
+ to reflect current reality. Gross attempt at handling out of
+ line prologues.
+
+ * mn10200-tdep.c (mn10200_skip_prologue): Don't look at the debug
+ symbols to find the end of the prologue.
+ * mn10300-tdep.c (mn10300_skip_prologue): Likewise.
+
+Wed May 14 12:04:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tic80/tm-tic80.h (NUM_REGS): 38 not 37.
+
+Mon May 12 11:35:04 1997 Mark Alexander <marka@cygnus.com>
+
+ * tic80-tdep.c, config/tic80/tm-tic80.h: First cut at getting
+ basic C80 features working.
+
+Thu May 8 08:42:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_TYPE_SIGNAL): Add
+ * configure: Re-generate.
+ * remote-sim.c: Signal returns RETSIGTYPE.
+
+Wed May 7 20:05:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.h (target_stop): Drop argument so it can be tested for
+ NULL.
+
+Sat May 3 20:51:48 1997 Mark Alexander <marka@cygnus.com>
+
+ * utils.c (floatformat_from_doublest): Handle infinity properly.
+
+Thu May 1 11:44:46 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * Finalize merge from Hurd folk.
+ Mon Oct 30 16:41:04 1995 Miles Bader <miles@gnu.ai.mit.edu>
+ * thread.c (thread_apply_command, thread_apply_all_command,
+ thread_command): Make sure TP is alive.
+ (thread_alive): New function.
+ Tue Nov 14 14:31:03 1995 Miles Bader <miles@gnu.ai.mit.edu>
+ * infrun.c (sig_print_info): Deal better with long signal names.
+ Wed Nov 22 15:23:35 1995 Miles Bader <miles@gnu.ai.mit.edu>
+ * thread.c (thread_id_to_pid): New function.
+ Fri Dec 1 13:25:25 1995 Miles Bader <miles@gnu.ai.mit.edu>
+ * gnu-nat.c: (set_thread_cmd_list, show_thread_cmd_list,
+ set_thread_default_cmd_list, show_thread_default_cmd_list):
+ New variables. (set_thread_cmd, show_thread_cmd,
+ set_thread_default_cmd, show_thread_default_cmd): New functions.
+ Fri Apr 18 15:20:16 1997 Miles Bader <miles@gnu.ai.mit.edu>
+ * gnu-nat.c (inf_startup): remove TASK parameter.
+ (inf_set_task): replace with new function (inf_set_pid).
+ * gdbthread.h: Add extern decl for thread_cmd_list.
+
+Thu May 1 02:28:21 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * printcmd.c (disassemble_command): Adjust low function bound
+ by FUNCTION_START_OFFSET.
+
+Wed Apr 30 15:23:02 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tic80/tm-tic80.h (BREAKPOINT): Set it to trap 73.
+
+Mon Apr 28 21:25:32 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * Makefile.in: Add rule for gnu-nat.o and i386gnu-nat.o (Gnu Hurd)
+ * config/i386/i386gnu.mh: remove rules for [i386]gnu-nat.o, now
+ in Makefile.in (as for other targets); add NATDEPFILE corelow.o to
+ satisfy symbol dependancy in solib.c (core_ops).
+ * target.[ch] conditionalize Mach-specific signals so that they
+ won't show up in non-Mach gdb's!
+ * thread.c: change name of static function "thread_switch" to
+ "switch_to_thread", to avoid conflict with Mach global symbol;
+ move thread_cmd_list to global scope so targets can add their
+ own thread commands.
+ * infrun.c: sig_print_info: allow for long signal names.
+ * gnu-nat.[ch]: tidying up comments.
+ * gnu-nat.c: remove calls to prune_threads and renumber_threads;
+ gnu_wait must not return -1 when inferior exits;
+ attach_to_child will modify inferior_pid in a way that allows
+ fork_inferior to remain unchanged; remove extra arg from
+ startup_inferior; move Mach thread commands here from thread.c.
+
+Mon Apr 28 18:21:20 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * symtab.c: decode_line_1, replace the assignment to
+ values.sals[0].pc which I accidentally left out on 4/3/97.
+
+Mon Apr 28 17:27:40 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * c-exp.y: make parse_number reject "123DEADBEEF".
+ (fix by Bob Manson).
+ * java-exp.y: Ditto.
+ * top.c: change "to enable to enable" to "to enable" in a couple
+ of help strings.
+
+Mon Apr 28 09:01:59 1997 Mark Alexander <marka@cygnus.com>
+
+ * breakpoint.c (remove_breakpoint): Pass correct type to
+ target_remove_watchpoint.
+ * target.h: Improve comment for target_{remove,insert}_breakpoint.
+
+Sat Apr 26 03:38:02 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-tdep.c (heuristic_proc_desc): Increase search limit
+ for return address register, handle `ret' instruction.
+
+ * corelow.c (get_core_registers): Initialize cf.
+
+ * procfs.c: Minor changes to make pre-ANSI compilers happy.
+ (procfs_notice_signals): Copy traced signal set back to
+ pi->prrun.pr_trace.
+ (unconditionally_kill_inferior): If PR_DEAD is defined,
+ rerun inferior after killing it.
+
+Fri Apr 25 00:10:18 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/mn10300/tm-mn10300.h (EXTRACT_STRUCT_VALUE_ADDRESS): The
+ structure value address is found in $a0 now.
+ * config/mn10200/tm-mn10200.h (EXTRACT_STRUCT_VALUE_ADDRESS): Likewise.
+
+Thu Apr 24 13:31:10 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/mn10300/tm-mn10300.h (STORE_RETURN_VALUE): Pointers are
+ returned in $a0.
+ (EXTRACT_RETURN_VALUE): Likewise.
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): Check for a return
+ insn at "pc", not "fi->pc".
+
+Thu Apr 24 16:11:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tic80/tm-tic80.h (NUM_REGS): Four 64bit accumulators.
+ (REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_SIZE,
+ MAX_REGISTER_RAW_SIZE, REGISTER_VIRTUAL_TYPE): Adjust.
+ (NPC_REGNUM): Tic80 has a delay slot.
+ (R0_REGNUM, Rn_REGNUM, An_REGNUM): For sim, provide base/bound for
+ register blocks.
+
+Wed Apr 23 11:18:45 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/mn10200/tm-mn10200.h (STORE_RETURN_VALUE): Pointers are
+ returned in $a0.
+ (EXTRACT_RETURN_VALUE): Likewise.
+
+Tue Apr 22 11:58:15 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Define to use
+ floatformat_ieee_double_littlebyte_bigword for little endian
+ target byte order.
+ * utils.c (floatformat_to_doublest): Create local preswapped
+ copy of input for floatformat_littlebyte_bigword formats.
+ (get_field, put_field): Treat floatformat_littlebyte_bigword
+ the same as floatformat_little.
+ (floatformat_from_doublest): Postswap output words for
+ the floatformat_littlebyte_bigwords format.
+
+Mon Apr 21 22:44:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tic80/tic80.mt (SIM): Link in simulator.
+
+Tue Apr 22 09:02:10 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/alpha/alpha-osf3.mh config/i386/{i386gnu linux}.mh
+ config/mips/{embed embed64 embedl embedl64 vr4300 vr4300el vr5000
+ vr5000el}.mt config/powerpc/{aix aix4}.mh config/rs6000/{aix
+ aix4}.mh config/sh/sh.mt config/sparc/sp64sim.mt:
+ config/v850/v850.mt:
+ Remove -lm. That's now handled by configure.
+
+ * Makefile.in (maintainer-clean): Add distclean to dependencies.
+ Remove duplicate rm's of files.
+
+Mon Apr 21 09:49:25 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote-pa.c: Remove. It's broken and no longer necessary.
+
+ Sat Apr 19 11:56:10 1997 Per Bothner <bothner@deneb.cygnus.com>
+
+ * java-exp.y: Combine TRUE and FALSE into BOOLEAN_LITERAL.
+ (Avoids name clash with broken AIX header files.)
+
+Sat Apr 19 01:49:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * serial.c (serial_log_command): Fix fputs_unfiltered calls.
+
+ * config/powerpc/tm-ppc-aix4.h, config/rs6000/tm-rs6000-aix4.h
+ (DONT_RELOCATE_SYMFILE_OBJFILE): Removed.
+ * xcoffsolib.h (struct vmap): Add new members tvma, toffs and dvma,
+ remove tadj.
+ * exec.c (bfdsec_to_vmap): Initialize new vmap members, initialize
+ tstart and dstart with section VMA.
+ * rs6000-nat.c (vmap_symtab): Relocate relative to the VMA in the
+ object file.
+ (vmap_ldinfo, xcoff_relocate_core): Adjust tstart by section offset
+ of the text section, remove DONT_RELOCATE_SYMFILE_OBJFILE hack.
+ (vmap_exec): Relocate relative to the VMA in the object file,
+ relocate .bss section as well.
+ (xcoff_relocate_core): No longer adjust section addresses by VMA.
+ * rs6000-tdep.c (find_toc_address): Change type of tocbase
+ to CORE_ADDR.
+ * xcoffread.c (secnum_to_bfd_section): New routine to get
+ BFD section from CS section number.
+ (scan_xcoff_symtab): Make toc_offset section relative.
+
+ * symtab.c (total_number_of_methods): Avoid core dump if
+ baseclass type is still undefined.
+
+Fri Apr 18 17:25:10 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (SUBDIRS): Add mswin so that make cleanup cleans up
+ that directory.
+ * defs.h utils.c (error warning): Make message be const.
+ * main.c (fputs_unfiltered): Only send gdb_stdout and gdb_stderr
+ to hook. Otherwise send it to fputs.
+ * monitor.c monitor.h (monitor_get_dev_name): New function. Does
+ the obvious.
+ * remote-e7000.c: Remove debugify stuff. Change printf, fprintf
+ to _filtered forms to make output appear in GUIs. Replace all
+ uses of SERIAL_READCHAR with readchar, which has better error
+ checking.
+ * (e7000_parse_device): Add prototype.
+ (readchar): Improve doc. Handle random serial errors.
+ (expect): Disable notice_quit code. It's busted. Remove
+ serial error handling (it's now handled in readchar). Remove
+ remote_debug echoing. That's handled in readchar as well.
+ (e7000_parse_device): Remove serial_flag arg. It's not
+ necessary.
+ (e7000_open): Split into two pieces. Second part is
+ e7000_start_remote, and is error protected. Now, when we connect
+ to the target, we setup the initial frame and registers so that
+ the user gets an immediate indication of where the target is.
+ (gch): Remove debug output. That's handled by readchar.
+ (e7000_read_inferior_memory): Handle errors better.
+ (_initialize_remote_e7000): Get rid of `<xxx>' things from
+ command names. They show up when doing completion and confuse
+ things horribly.
+ * ser-e7kpc.c: Get rid of the DLL's since we can access the device
+ directly from Win32s and Win95. Get rid of debugify crud.
+ * serial.c: Remove debugify cruft.
+ * (serial_logchar serial_log_command serial_write serial_readchar
+ serial_send_break serial_close): Merge common functionality into
+ serial_logchar. Clean up rest of routines.
+ * sparclet-rom.c: Disembowel. Leave only download routine.
+ Download routine now switches to remote target automatically.
+ * top.c (disconnect): Only define if SIGHUP is defined. Cleans
+ up MSVC/Win32 problem.
+ * utils.c (gdb_flush): Don't call hook unless it's for gdb_stdout
+ or gdb_stderr.
+ * config/sh/tm-sh.h: Define TARGET_SH for WinGDB.
+ * config/sparc/tm-sparclet.h: Remove override for prompt.
+
+Fri Apr 18 13:38:19 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Only pass -E to sim_open if
+ TARGET_BYTE ORDER_SELECTABLE.
+
+Fri Apr 18 16:52:41 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (init_callbacks): Initialize poll_quit and magic
+ fields of gdb_callback.
+ (gdbsim_stop): Add gdbsim_stop to list of supported client
+ operations.
+ (gdbsim_wait, gdbsim_resume): Move call to sim_resume into
+ sim_wait where gdb is in a position to handle a long running
+ function.
+ (gdbsim_cntrl_c): New function. Wrap the sim_resume call in a
+ SIGINT handler.
+ (gdb_os_poll_quit): New function. Check for a quit pending on the
+ console.
+
+Thu Apr 17 14:30:04 1997 Per Bothner <bothner@deneb.cygnus.com>
+
+ * objfiles.c (allocate_objfile): Allow NULL bfd argument.
+ * defs.h (enum language): Add language_java.
+ * java-exp.y, java-lang.c, java-lang.h, java-valprint.c: New files.
+ * Makefile.in: Update for new files.
+ * symfile.c (deduce_language_from_filename): Recognize .java.
+
+Thu Apr 17 02:20:23 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-stub.c (stash_registers): Rewrite.
+ (restore_registers): Renamed to restore_and_return.
+ (cleanup_stash): New function.
+ (process_exception): New function.
+ (_catchException*): Rewrite.
+
+ * remote-sim.c (gdbsim_load): Update call to sim_load.
+ (gdbsim_create_inferior): No longer pass start_address to
+ sim_create_inferior.
+ (gdbsim_open): Pass endian indicator as arg.
+
+Tue Apr 15 15:31:09 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (get_offsets): Don't use scanf for interpreting
+ response to qOffsets.
+
+Tue Apr 15 14:51:04 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * gdbserver/Makefile.in (INSTALL_XFORM): Remove.
+ (INSTALL_XFORM1): Remove.
+ (install-only): Use $(program_transform_name) directly, rather
+ than using $(INSTALL_XFORM) and $(INSTALL_XFORM1).
+ (uninstall): Transform name.
+
+Mon Apr 14 17:06:27 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c (mips_load): Ensure that PC gets updated
+ after a load on LSI target.
+
+Mon Apr 14 15:54:51 1997 Geoffrey Noer <noer@pizza.cygnus.com>
+
+ * procfs.c (notice_signals): fix typo
+
+Mon Apr 14 16:25:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * gdbserver/Makefile.in (INSTALL): Change install.sh to
+ install-sh.
+
+Mon Apr 14 11:55:27 1997 Geoffrey Noer <noer@pizza.cygnus.com>
+
+ * config/i386/cygwin32.mh: remove -lkernel32 from XM_CLIBS
+ since gcc automatically includes it
+
+Thu Apr 10 13:20:53 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * procfs.c: Substantial (but incomplete) changes to support
+ sysv4.2mp procfs as implemented in UnixWare 2.1. The procinfo
+ struct now has substructs like struct flt_ctl instead of
+ just a fltset_t and has a ctl_fd, status_fd, as_fd, and
+ map_fd instead of a single fd. Non-sysv4.2mp procfs models
+ still have the structs and multiple fds, but don't use the
+ entire struct and the four fds all point to the same thing.
+ We use PROCFS_USE_READ_WRITE to decide whether to talk to
+ procfs with reads/writes or use ioctl instead. We use
+ HAVE_MULTIPLE_PROC_FDS to determine whether procfs really has
+ multiple fds or not. PROC_NAME_FMT is split out into
+ CTL_PROC_NAME_FMT, AS_PROC_NAME_FMT, MAP_PROC_NAME_FMT,
+ STATUS_PROC_NAME_FMT.
+
+ (procfs_notice_signals): now a necessary wrapper around
+ (notice_signals): which are the new guts for noticing signals
+ (open_proc_file): gets a new flag arg used in sysv4.2mp to
+ determine whether or not to attempt to open the ctl_fd.
+ (procfs_read_status): new local function, reads procfs status
+ (procfs_write_pcwstop): new local function, writes a PCWSTOP
+ (procfs_write_pckill): new local function, writes a PCKILL
+ (unconditionally_kill_inferior): remove signo since we now
+ just call procfs_write_pckill().
+ (procfs_xfer_memory): call lseek with SEEK_SET rather than 0
+ (proc_iterate_over_mappings): the whole function is ifdefed
+ on UNIXWARE to keep things readable.
+
+ Expanded the syscall_table to include new potential sysv4.2mp
+ members. Note that all ifdefs of UNIXWARE should be eliminated
+ if possible or renamed to describe what's being selected for a
+ bit better. Sysv4.2mp and IRIX both have SYS_sproc so the
+ IRIX specific code now also checks it's not UNIXWARE.
+
+ * config/i386/tm-i386v42mp.h: also define HAVE_PSTATUS_T,
+ HAVE_NO_PRRUN_T, PROCFS_USE_READ_WRITE, and UNIXWARE
+ * config/mips/nm-irix4.h: set CTL_PROC_NAME_FMT et al to
+ "/debug/%d" as PROC_NAME_FMT used to be
+
+Wed Apr 9 11:36:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c: Almost completely rewritten based on mn10200
+ port.
+ * config/mn10300/tm-mn10300.h: Likewise.
+
+Tue Apr 8 10:45:24 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/pa/{hppabsd.mt hppahpux.mt hppaosf.mt}: Remove
+ remote-pa.o from TDEPFILES. Nobody uses it, and besides, it's a
+ lousy out-of-date clone of remote.c.
+
+Fri Apr 4 08:21:21 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote.c: Fix problems realized while showering.
+ * (hexnumlen): Add prototype. Use max, not min.
+ * (remote_write_bytes remote_read_bytes): Fix max packet size
+ calculations to properly account for packet overhead. Also handle
+ (probably rare) case where remote_register_buf_size isn't set.
+
+ * remote.c: Fix doc for `C' and `S' commands to indicate full
+ address.
+ * (remote_ops extended_remote_ops remote_desc remote_write_size):
+ Make static.
+ * (remote_fetch_registers remote_write_bytes remote_read_bytes):
+ Record size of response to fetch registers command, use this to
+ limit size of memory read and write commands.
+ * (push_remote_target): New function to make it possible to have
+ another target switch to the remote target.
+ * target.h: Add prototype for push_remote_target.
+ * sh-tdep.c (sh_frame_find_saved_regs): Fix sign extension bugs
+ for hosts which default to unsigned chars (such as SGI's).
+ * (_initialize_sh_tdep): Don't set remote_write_size. It's now
+ handled automatically in remote.c.
+
+Thu Apr 3 15:10:30 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c: blockvector_for_pc_sect(), block_for_pc_sect(),
+ find_pc_sect_function(), find_pc_sect_partial_function(): new
+ functions for debugging overlays; pc without section is ambiguous.
+ * breakpoint.[ch]: add section pointer to breakpoint struct;
+ add section argument to check_duplicates(); check section as well
+ as pc in [breakpoint_here_p(), breakpoint_inserted_here_p(),
+ breakpoint_thread_match(), bpstat_stop_status()];
+ add section argument to describe_other_breakpoints();
+ use INIT_SAL() macro to zero-out new sal structures;
+ make resolve_sal_pc() fix up the sal's section as well as its pc;
+ match on section + pc in clear_command() and delete_breakpoint();
+ account for overlay sections in insert_breakpoints(),
+ remove_breakpoint() and breakpoint_re_set_one();
+ all this to support overlays where a PC is not unique.
+ * exec.c: change xfer_memory() to handle overlay sections.
+ * findvar.c: change read_var_value() to handle overlay sections.
+ * frame.h: declaration for block_for_pc_sect() [blockframe.c].
+ * infcmd.c: jump_command() warns against jumping into an overlay
+ that's not in memory. Also use INIT_SAL() to initialize sals.
+ * infrun.c: wait_for_inferior() sets a flag to invalidate cached
+ overlay state information; Also use INIT_SAL() to init sals.
+ * m32r-rom.c: modify load routines to use LMA instead of VMA.
+ * m32r-stub.c: mask exit value down to 8 bits; screen out any
+ memory read/writes in the range 600000 to a00000, and ff680000
+ to ff800000 (hangs because nothing is mapped there); fix strcpy().
+ * maint.c: maintenance command "translate-address" supports overlays.
+ * minsyms.c: lookup_minimal_symbol_by_pc_sect() supports overlays.
+ * objfiles.[ch]: add ovly_mapped field to the obj_section struct;
+ this constitutes gdb's internal overlay mapping table. Add macro
+ ALL_OBJSECTIONS() to loop thru the obj_structs and look at overlays.
+ Add function find_pc_sect_section().
+ * printcmd.c: modify print_address_symbolic() with overlay smarts;
+ modify address_info() with overlay smarts; add function sym_info()
+ to support the INFO SYMBOL command (translate address to symbol(s));
+ modify disassemble_command() to work on unmapped overlays.
+ * source.c: use INIT_SAL() to initialize sals.
+ * symfile.[ch]: change generic_load() to use section's LMA address
+ instead of VMA address, for overlay sections.
+ Add numerous functions for finding a PC's section / overlay,
+ translating between VMA and LMA address ranges, determining if an
+ overlay section is mapped, etc. Add several user commands for
+ overlay debugging. Add support for a "generic" form of automatically
+ reading overlay mapping info from the inferior (based on the default
+ (simple) overlay manager which Cygnus provides as an example).
+ * symtab.[ch]: add functions find_pc_sect_symtab(),
+ find_pc_sect_psymtab(), find_pc_sect_psymbol(), find_pc_sect_line()
+ for lookup; modify lookup_symbol and decode_line_1() to use them;
+ modify find_function_start_sal() to account for overlay sections;
+ add macro INIT_SAL() for initializing struct symtab_and_line.
+ * target.c: fix a comment in the declaration of target_ops.
+
+Thu Apr 3 10:31:12 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips_in_call_stub, mips_in_return_stub,
+ mips_skip_stub, mips_ignore_helper): New functions for dealing
+ with MIPS16 call/return thunks.
+ (mips_init_frame_pc_first): New function to implement
+ INIT_FRAME_PC_FIRST macro; includes code from old macro plus
+ new code to skip over MIPS16 thunks.
+ (mips_frame_chain): Skip over MIPS16 thunks.
+ * config/mips/tm-mips.h (mips_in_call_stub, mips_in_return_stub,
+ mips_skip_stub, mips_ignore_helper): Declare.
+ (IN_SOLIB_CALL_TRAMPOLINE, IN_SOLIB_RETURN_TRAMPOLINE,
+ SKIP_TRAMPOLINE_CODE, IGNORE_HELPER_CALL): New macros that invoke
+ the above functions.
+ (INIT_FRAME_PC_FIRST): Change to invoke mips_init_frame_pc.
+ (mips_init_frame_pc): Declare.
+ * infrun.c (wait_for_inferior): Use new IGNORE_HELPER_CALL macro
+ to decide if certain library function calls should be ignored.
+
+Wed Apr 2 14:16:51 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.c (gdbsim_open): Check return code from sim_open.
+ Update call to sim_open (new arg SIM_OPEN_DEBUG).
+
+Mon Mar 31 14:55:53 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * gdbinit.in: New file.
+ * .gdbinit: Remove.
+ * configure.in: Generate .gdbinit from gdbinit.in.
+ * configure: Rebuild.
+
+Sun Mar 30 12:28:24 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/tic80/tic80.mt: Disable using the simulator
+ until it is ready.
+
+Sat Mar 29 13:57:20 1997 Fred Fish <fnf@cygnus.com>
+
+ * COPYING: Install new version of file from FSF.
+ * copying.c (show_copying_command): Update FSF address.
+
+Fri Mar 28 18:33:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (distclean): Remove .gdbinit.
+
+Fri Mar 28 15:37:30 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/tic80/tm-tic80.h (NAMES_HAVE_UNDERSCORE): Define.
+
+Fri Mar 28 15:38:04 1997 Mike Meissner <meissner@cygnus.com>
+
+ * remote-sim.c (gdb_os_{,e}vprintf_filtered): Change stdarg type
+ to va_list from void *, since va_list might not be a pointer
+ type.
+
+Thu Mar 27 14:21:46 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c: Clean up comment and extraneous semicolon
+ for mips_monitor_prompt variable.
+
+Thu Mar 27 12:46:58 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c: Add `set monitor-prompt' command.
+
+Wed Mar 26 06:47:44 1997 Mark Alexander <marka@cygnus.com>
+
+ Fix from Peter Schauer:
+ * mdebugread.c (parse_procedure): Set address of procedure to
+ block start; this fixes problems with shared libraries introduced
+ by change of Mar 21.
+
+Mon Mar 24 19:43:16 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * symtab.c (find_pc_symtab): change to support the case
+ where the objfile is reordered and contains both coff and
+ stabs debugging info (continue on if a psymtab isn't found).
+
+Sun Mar 23 16:19:20 1997 Mark Alexander <marka@cygnus.com>
+
+ Fixes from Peter Schauer:
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE,
+ REGISTER_CONVERT_FROM_TYPE): Swap words if target, not host,
+ is big-endian and if registers are 32 bits.
+ * mips-tdep.c (mips_print_register, mips_extract_return_value,
+ mips_store_return_value): Fix floating-point word-order problems on
+ little-endian targets introduced by changes of Mar 21.
+
+Sun Mar 23 15:43:27 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (target_resume_hook, target_wait_loop_hook): New
+ globals.
+ (remote_resume, remote_wait): Use them.
+ * d10v-tdep.c: Set the above hooks.
+ (tracesource): New GDB variable, controls source display in
+ traces.
+ (display_trace): Find and display source line if requested.
+ (trace_info): Mention empty trace buffer if appropriate.
+ (tdisassemble_command): Robustify argument handling.
+
+ * configure.host: Remove extra bogus Linux case.
+
+Sat Mar 22 16:41:35 1997 Fred Fish <fnf@cygnus.com>
+
+ * remote-sim.c (simulator_command): Add comment about dealing with
+ NULL or empty args.
+ * Makefile.in (tic80-tdep.o): Add target.
+ * configure.tgt: Add tic80 case.
+ * tic80-tdep.c: New file.
+ * config/tic80/{tic80.mt, tm-tic80.h}: New files.
+
+Sat Mar 22 02:48:11 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * c-exp.y (yylex): Handle nested template parameter lists.
+ * symtab.c (decode_line_2): Fix test for valid choice number.
+
+Fri Mar 21 19:10:05 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): On non-EABI architectures,
+ copy first two floating point arguments to general registers, so that
+ MIPS16 functions will receive the arguments correctly.
+ (mips_print_register): Print double registers correctly on
+ little-endian hosts.
+ (mips_extract_return_value): Return double values correctly
+ on little-endian hosts.
+
+ * mdebugread.c (parse_procedure): Adjust address of procedure relative
+ to address in file descriptor record; this accounts for constant
+ strings that may precede functions in the text section. Remove
+ now-useless lowest_pdr_addr from argument list and all calls.
+
+Fri Mar 21 15:36:25 1997 Michael Meissner <meissner@cygnus.com>
+
+ * configure.tgt (powerpc*-{eabi,linux,sysv,elf}*): Determine
+ whether the simulator will be built by whether the Makefile in the
+ simulator directory was built.
+
+ * configure.in (--enable-sim-powerpc): Delete switch.
+ * configure: Regenerate.
+
+Thu Mar 20 20:52:04 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-tdep.c (mn10200_analyze_prologue): Look for save of "a1"
+ in the prologue too.
+
+ * remote-sim.c (gdb_os_vprintf_filtered): Fix to work with non-ANSI
+ compilers.
+ (gdb_os_evprintf_filtered): Similarly.
+
+Wed Mar 19 16:13:22 1997 Geoffrey Noer <noer@pizza.cygnus.com>
+
+ New UnixWare 2.1 configuration
+ * config/i386/i386v42mp.mt: new
+ * config/i386/i386v42mp.mh: new
+ * config/i386/tm-i386v42mp.h: new
+ * config/i386/nm-i386v42mp.h: new
+ * configure.tgt: added new entries
+ * configure.host: added new entries
+
+Mon Mar 17 17:52:00 1997 J.T. Conklin <jtc@cygnus.com>
+
+ * dsrec.c (load_srec): Print leading zeroes when printing section
+ addresses.
+
+Mon Mar 17 15:00:16 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * remote-sim.h: Delete - moved to ../include/remote-sim.h.
+
+ * Makefile.in (remote_utils_h): Update path to remote-sim.h.
+
+Fri Mar 7 20:55:28 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * remote-sim.c (flush_stdout, write_stderr, flush_stderr,
+ vprintf_filtered, evprintf_filtered): Callbacks that accept
+ varargs.
+
+Sat Mar 15 00:50:46 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (insert_breakpoints, watchpoint_check,
+ bpstat_stop_status): Do not disable watchpoints going out of scope.
+ (insert_breakpoints): Make sure that the current frame is valid
+ before calling find_frame_addr_in_frame_chain.
+
+ * top.c (setup_user_args): Handle quotes and backslashes.
+ (print_gdb_version): Update copyright year.
+
+Fri Mar 14 15:44:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (elfread.o): Depend upon elf-bfd.h and elf/mips.h.
+
+Thu Mar 13 22:51:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * utils.c (pollquit, notice_quit): If _WIN32, limit test for
+ cntl-C to wingdb.
+ (initialize_utils): If _WIN32, don't call ScreenRows and ScreenCols
+ except under wingdb. (Contributed by Martin Hunt).
+
+Thu Mar 13 12:40:49 1997 Tom Tromey <tromey@cygnus.com>
+
+ * configure: Regenerated.
+ * configure.in: Run AC_CONFIG_AUX_DIR before AC_CANONICAL_SYSTEM.
+
+Thu Mar 13 11:00:22 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.h (sim_state, SIM_DESC): New types.
+ (sim_open): Return a `descriptor' as result.
+ (*): New argument of descriptor result from sim_open.
+ * remote-sim.c (gdbsim_desc): Renamed from gdbsim_open_p.
+ (gdbsim_open): Record result of sim_open in gdbsim_desc.
+ Pass argv list to sim_open, argv[0] = pseudo program name.
+ (*): Pass gdbsim_desc to sim_foo fns.
+
+Wed Mar 12 14:40:06 1997 Tom Tromey <tromey@cygnus.com>
+
+ * config.in: Regenerated.
+
+ * acconfig.h (START_INFERIOR_TRAPS_EXPECTED, sys_quotactl,
+ HAVE_HPUX_THREAD_SUPPORT): Define.
+
+Tue Mar 11 07:25:27 1997 Mark Alexander <marka@cygnus.com>
+
+ First cut at supporting simulators in gdbserver:
+
+ * configure, configure.in: Allow gdbserver to be configured
+ for cross-target environments.
+ * gdbserver/Makefile.in: Add simulator support.
+ * gdbserver/configure.in: Eliminate assumption that host == target.
+ Simplify using gdb/configure.tgt and gdb/configure.host.
+ Fix other minor configuration errors.
+ * gdbserver/low-sparc.c: Fix compile error.
+ * gdbserver/remote-utils.c: Eliminate assumption that registers
+ and addresses are four bytes. Fix minor compile errors and warnings.
+ * gdbserver/server.c: Rewrite numerous instances of identical code
+ for starting inferior processes to call new function start_inferior.
+ Eliminate assumption that registers and addresses are four bytes.
+ * gdbserver/server.h: Add missing prototypes to eliminate compiler
+ warnings.
+ * gdbserver/low-sim.c: New file to mate gdbserver with simulators.
+ * config/mips/vr5000.mt: Add Vr5000 simulator support to gdbserver.
+ * config/i386/linux.mh: Eliminate gdbserver support as a first step
+ in moving such support from host to target makefile fragments.
+ * config/i386/linux.mt: Move gdbserver support here from linux.mh.
+
+Mon Mar 10 12:27:47 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * symtab.h (INIT_SAL): New macro to initialize symtab_and_line,
+ to insure consistant initialization of unused fields to zero.
+ * symtab.c: replace initializations of sals with new macro INIT_SAL.
+ * breakpoint.c: ditto.
+ * infrun.c: ditto.
+ * infcmd.c: ditto.
+ * source.c: add call to INIT_SAL macro.
+
+Sat Mar 8 00:16:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sparc-tdep.c (isbranch): Always handle v9 branch instructions,
+ they might get used on 32 bit targets as well.
+
+Wed Mar 5 19:34:09 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * remote-mips.c (mips_exit_debug): Some IDT boards don't
+ send the full exit string.
+
+Wed Mar 5 12:59:27 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-tdep.c (mn10200_push_arguments): Handle new calling
+ conventions.
+ (mn10200_store_struct_return): Likewise.
+
+Tue Mar 4 10:31:02 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips_fetch_instruction): New function; replace
+ common code throughout with calls to it.
+ (mips_find_saved_regs): Examine MIPS16 entry instruction to determine
+ correct saved addresses of $s0 and $s1.
+ (mips_find_saved_regs, mips16_heuristic_proc_desc): Use MIPS_REGSIZE
+ instead of hardcoded 4.
+ (mips16_skip_prologue): Handle extended instructions correctly.
+
+Mon Mar 3 12:29:20 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * defs.h (LONGEST): Move #ifndef LONGEST to outside.
+ Try BFD_HOST_64_BIT if ! CC_HAS_LONG_LONG.
+
+Thu Feb 27 18:54:11 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (IS_MIPS16_ADDR, MAKE_MIPS16_ADDR, UNMAKE_MIPS16_ADDR):
+ New macros for testing, setting, and clearing bit 0 of addresses.
+ Change numerous bits of code where bit 0 was being manipulated
+ to use these macros.
+
+Thu Feb 27 14:12:41 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c: Put back the form feeds.
+
+Thu Feb 27 12:04:24 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c: Remove form feeds (^L) from source.
+ (mips_initialize): LSI PMON doesn't support 'set regsize' command.
+ (pmon_wait): Don't need to exit and re-enter debug mode on LSI
+ PMON after a continue; it causes target program misbehavior.
+ (mips_fetch_register): Don't fetch unsupported registers; this
+ cuts down on wasted serial traffic.
+
+Thu Feb 27 09:38:16 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.in configure (HPUX/OSF thread support): Enable this
+ only when running GCC, since HP's thread header files use ANSI C
+ which is not supported by their default compiler.
+
+ * configure.host (i[3456]86-*-windows): Disable long long
+ support for WinGDB. Add mswin to configdirs.
+ * configure.in configure: Move calls to configure.host and
+ configure.tgt to the top of configure.in to allow them to set
+ config variables before they are referenced.
+
+Tue Feb 25 20:21:52 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (mips*-*-lnews*): New target.
+
+Mon Feb 24 16:35:00 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-tdep.c (mn10200_analyze_prologue): Don't fix fi->frame
+ if we're not the innermost frame. Fix minor typos.
+
+Sat Feb 22 03:39:50 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * stabsread.c (read_type): Fix handling of template names
+ with template parameters containing `::'.
+
+ * valops.c (search_struct_field, search_struct_method):
+ Pass correct valaddr parameter to baseclass_offset.
+ Prevent gdb crashes by making sure that the virtual base pointer
+ from an user object still points to accessible memory.
+
+Tue Feb 18 13:36:34 1997 Mark Alexander <marka@cygnus.com>
+
+ * maint.c: Eliminate -Wall warnings by including some header files.
+
+Tue Feb 18 13:06:30 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-sim.c (init_callbacks): Undo previous change.
+
+Tue Feb 18 11:13:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * maint.c: Fix dereference of pointer.
+ * remote-sim.c: Fix reference of structure member "last_error".
+ * debugify.c: Include config.h to get ANSI definitions.
+
+Sat Feb 15 17:43:46 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * remote-vx.c (vx_attach): Remove code added by kung. It made no
+ sense.
+
+Fri Feb 14 13:00:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * main.c (print_gdb_help): Make static to match declaration.
+
+Thu Feb 13 18:18:18 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * remote-e7000.c, ser-e7kpc.c, serial.c: Remove // comments.
+
+Wed Feb 12 15:58:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * debugify.c, debugify.h: Make safe for non-ansi compilers.
+
+Wed Feb 12 15:30:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * defs.h: Fix prototypes for new cleanup functions.
+
+Wed Feb 12 15:08:47 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * debugify.c, debugify.h: Fix for general gnu use. Remove C++
+ comment, add PARAMS, add license info and fix indentation.
+
+Wed Feb 12 14:42:47 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * debugify.c, debugify.h: New files. Provide common macros
+ for writing debug info to a log file or stdio.
+
+Wed Feb 12 02:44:39 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * c-valprint.c (c_val_print): Fix printing for arrays defined
+ with 0 length.
+
+Tue Feb 11 22:24:39 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * defs.h: Fix cntl-C to read from the Windows message queue.
+ Add prototypes for make_final_cleanup (and the other cleanup
+ routines.
+ * remote-e7000.c: Fix sync code to timeout if unable to sync.
+ Change sync code to report status while trying to sync-up
+ with hardware. Add debugging output and document.
+ * ser-e7kpc.c: Swap order of len & offset to match implementation.
+ Add debugging output and document.
+ * serial.c: Add debugging output.
+ * top.c: Add call to do_final_cleanups.
+ Remove conditionals preventing Win32 from getting SIGQUIT.
+ * utils.c: (*_cleanup): Modify cleanup routines to accept a cleanup
+ chain as a parameter. Extract this generic code from the cleanup
+ routines into separate funtions (*_my_cleanup). Keep old
+ functionality by passing "cleanup_chain" to the new funtions.
+ Define the cleanup chain "final_cleanup_chain" to be a cleanup
+ chain which will be executed only when gdb exits. Add functions
+ (*_final_cleanup) to match the original (*_cleanup) functions.
+ (pollquit, quit, notice_quit): Fix to read cntl-C from the
+ Windows message queue.
+
+Tue Feb 11 15:36:31 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-rom.c: #include <sys/types.h>.
+ #ifdef out new load support if wingdb.
+ * m32r/tm-m32r.h (TARGET_M32R): Define, for wingdb.
+
+Tue Feb 11 12:28:09 1997 Jeffrey A Law (law@cygnus.com)
+
+
+ * config/mn10200/tm-mn10200.h (STORE_STRUCT_RETURN): Fix.
+ * mn10200-tdep.c (mn10200_store_struct_return): New function.
+
+ * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE): Fix case when
+ extracting a return value from a register pair.
+
+ * mn10200-tdep.c (mn10200_push_arguments): Stack only needs to
+ be two byte aligned. Round argument sizes up to two byte boundary.
+ Write out args in two byte hunks.
+ (mn10200_push_return_address): Implement.
+ * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE): Abort for
+ structures > 8 bytes (temporary).
+ (STORE_RETURN_VALUE): Likewise.
+ (CALL_DUMMY): No longer undefine.
+ (USE_STRUCT_CONVENTION): Use for args > 8 bytes.
+ (REG_STRUCT_HAS_ADDR): Define.
+
+Mon Feb 10 18:35:55 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (non_heuristic_proc_desc): New function.
+ (find_proc_desc): Move non-heuristic proc search code into separate
+ function.
+ (gdb_print_insn_mips): Use non-heuristic method to find procedure
+ descriptor, to avoid prologue examination when disassembling.
+ * remote-mips.c: Add support for new "lsi" target (LSI MiniRISC
+ aka MicroMeteor board).
+ (mips_exit_debug): Prevent protocol reinitialization if an error
+ occurs while exiting debug mode.
+
+Mon Feb 10 16:11:57 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-tdep.c: Remove lots of debugging printfs, update/improve
+ comments, formatting, etc. Plus other minor fixes for problems
+ I found during my first pass over the mn10200 port.
+ (mn10200_analyze_prologue): New function.
+ (mn10200_frame_chain, mn10200_init_extra_frame_info): Use it.
+ * config/mn10200/tm-mn10200.h: Lots of updates/improvements to
+ comments, formatting, etc. Minor fixes for problems I found during
+ my first pass over the mn10200 port.
+ (TARGET_*_BIT): Define appropriately for ints, long longs, doubles and
+ pointers.
+ (REGISTER_VIRTUAL_TYPE): Define as a long.
+ (EXTRACT_RETURN_VALUE): Rework to deal with long ints living
+ in register pairs.
+ (STORE_RETURN_VALUE): Similarly.
+
+ * blockframe.c (generic_get_saved_regs): Remove unused variable
+ "addr".
+ * breakpoint.c (frame_in_dummy): Move struct breakpoint *b decl
+ inside #ifdef CALL_DUMMY.
+ (watch_command_1): Initialize target_resources_ok.
+ * command.c (do_setshow_command): Provide dummy initialization
+ for "match".
+ * valops.c (find_function_addr): Move function & prototype inside
+ #ifdef CALL_DUMMY.
+ (value_arg_coerce): Similarly.
+ (value_of_variable): Provide dummy initialization of "frame".
+
+Mon Feb 10 07:54:26 1997 Fred Fish <fnf@cygnus.com>
+
+ * xcoffread.c (RECORD_MINIMAL_SYMBOL): Add NULL asection* parameter
+ to prim_record_minimal_symbol_and_info call that was missed in Jan 3
+ change.
+ (scan_xcoff_symtab): Ditto.
+
+Sun Feb 09 09:23:26 1997 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c (common_breakpoint): Prevent 64-bit addresses
+ from being sent to 32-bit targets by masking off upper bits.
+ * mips-tdep.c (heuristic_proc_start): Mask off upper 32 bits
+ of PC on 32-bit targets.
+ (mips16_heuristic_proc_desc): Recognize 'addiu s1,sp,n' as a
+ frame setup instruction.
+ (mips32_heuristic_proc_desc): Fix warning found by gcc -Wall.
+ (mips16_skip_prologue): Recognize 'addiu s1,sp,n' as a valid
+ prologue instruction. Fix warnings and bugs found by gcc -Wall.
+ * buildsym.c (finish_block): Improve handling of overlapping blocks;
+ fixes problem on MIPS16 printing function arguments.
+
+Sat Feb 8 01:14:43 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dwarf2read.c (dwarf2_linkage_name): New function to get
+ the linkage name of a die from DW_AT_MIPS_linkage_name or
+ DW_AT_name.
+ (read_func_scope, dwarf2_add_field, dwarf2_add_member_fn,
+ new_symbol): Use it instead of accessing DW_AT_name.
+ (read_partial_die): Use DW_AT_MIPS_linkage name as name of the
+ partial die if present.
+ (dwarf2_add_member_fn): Make a copy of physname on the type obstack.
+
+Fri Feb 7 10:06:22 1997 Jeffrey A Law (law@cygnus.com)
+
+ * blockframe.c (generic_frame_chain_valid): If the new frame
+ is not INNER_THAN the old frame, then it's not valid.
+
+Tue Feb 04 09:04:37 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips16_get_imm): Fix calculation of extended immediate.
+ (mips16_heuristic_proc_desc): Recognize jal(x) instruction.
+
+Mon Feb 03 17:57:58 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mips16_decode_reg_save): Distinguish between
+ sd and sw instructions correctly.
+ (heuristic_proc_start): Add support for MIPS16.
+ (mips16_get_imm, mips16_heuristic_proc_desc,
+ mips32_heuristic_proc_desc): New helper functions for
+ heuristic_proc_desc.
+ (heuristic_proc_desc): Rewrite and reorganize to support MIPS16.
+ (mips_push_arguments): Don't align small arguments in EABI.
+ (mips32_skip_prologue): Attempt to shrink code size a little.
+
+Mon Feb 3 11:06:05 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-stub.c: New -- remote protocol support for M32R cpu.
+ * m32r-rom.c: Several experiments with improved download time.
+
+Fri Jan 31 08:26:39 1997 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (MIPS16_INSTLEN): Define.
+ (mips_find_saved_regs): Replace hardcoded 2's with MIPS16_INSTLEN.
+ (heuristic_proc_start): Recognize 'entry' pseudo-op as a start
+ of function on MIPS16.
+ (mips32_skip_prologue, mips16_skip_prologue): New helper functions
+ for mips_skip_prologue.
+ (mips_skip_prologue): Recognize both 16- and 32-bit prologues.
+
+Wed Jan 29 12:45:54 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/powerpc/ppc{,le}-sim.mt (SIM): Remove the library
+ ../sim/common/libcommon.a.
+
+Tue Jan 28 15:54:13 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c: fix a null pointer ref in generic_get_saved_register
+
+Tue Jan 28 15:39:50 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * mn10200-tdep.c (mn10200_frame_chain): Get basic backtracing
+ working.
+
+Mon Jan 27 14:31:52 1997 Mark Alexander <marka@cygnus.com>
+
+First set of changes for mips16:
+ * config/mips/tm-mips.h (MIPS16_BIG_BREAKPOINT,
+ MIPS16_LITTLE_BREAKPOINT, BREAKPOINT_FROM_PC): Define.
+ (ABOUT_TO_RETURN): Call new function mips_about_to_return.
+ (mips_breakpoint_from_pc, mips_about_to_return): Declare.
+ * mem-break.c (memory_breakpoint_from_pc): New function.
+ (memory_insert_breakpoint, memory_remove_breakpoint): Use
+ memory_breakpoint_from_pc to determine breakpoint contents and size.
+ * target.h (memory_breakpoint_from_pc): Declare.
+ * monitor.c (monitor_insert_breakpoint): Use memory_breakpoint_from_pc
+ to determine size of breakpoint instruction.
+ * mips-tdep.c (mips32_decode_reg_save, mips16_decode_reg_save):
+ New helper functions for mips_find_saved_regs.
+ (mips_find_saved_regs): Recognize mips16 prologues.
+ (mips_addr_bits_remove): Strip off upper 32 bits of address
+ when target CPU is 32 bits but CORE_ADDR is 64 bits.
+ (mips_step_skips_delay): No branch delay slot on mips16.
+ (gdb_print_insn_mips): Disassemble mips16 code.
+ (mips_breakpoint_from_pc, mips_about_to_return): New functions.
+
+Mon Jan 27 10:34:03 1997 Jeffrey A Law (law@cygnus.com)
+
+ * tm-mn10200.h (NUM_REGS): Decrease to 12.
+ (REGISTER_NAMES): Elimination registers not found on the mn10200.
+ (PC_REGNUM, MDR_REGNUM, PSW_REGNUM): Corresponding changes.
+ (LIR_REGNUM, LAR_REGNUM): Delete. They don't exist on the mn10200.
+
+Sat Jan 25 00:07:59 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * dwarf2read.c: Replace integral tag, name and form fields in
+ internal structure definitions with the corresponding enumeration
+ types from dwarf2.h. Add default cases to switches on enumerations
+ where appropriate.
+ Make quoting of string arguments in complaint messages consistent.
+ Check for NULL returns from DW_STRING.
+ (struct partial_die_info): Add sibling and has_type fields, remove
+ unused value field.
+ (DW_*): Move access macro definitions near the definition of the
+ attribute structure.
+ (struct field_info): New structure to pass information about fields
+ and member functions between die processing routines.
+ (dwarf2_build_psymtabs_hard): Set cu_header_offset.
+ (scan_partial_symbols): Do not enter DW_TAG_subprogram dies into
+ the partial symbol table if the DW_AT_*_pc attributes are missing.
+ Add file scope base type definitions to the partial symbol table.
+ Skip over child dies if the die has a sibling attribute.
+ (add_partial_symbol): Enter global variables with type attributes
+ and without location descriptors into the partial symbol table.
+ Store value of DW_TAG_variable dies in the partial symbol table.
+ Do not enter global variables into the minimal symbol table.
+ Add base type definitions to the partial symbol table.
+ (psymtab_to_symtab_1): Use dwarf2_get_pc_bounds to determine highpc.
+ (process_die): Move check for DW_AT_low_pc to read_func_scope.
+ Add a typedef symbol for base type definitions to the symbol table.
+ Ignore DW_TAG_inlined_subroutine tags for now.
+ (read_file_scope): Use dwarf2_get_pc_bounds to determine pc bounds.
+ (read_func_scope, read_lexical_block_scope): Use dwarf2_get_pc_bounds
+ to determine pc bounds, ignore dies with invalid bounds.
+ (dwarf2_get_pc_bounds): New routine to extract and validate the
+ DW_AT_*_pc attributes of a die.
+ (dwarf2_add_field, dwarf2_attach_fields_to_type, skip_member_fn_name,
+ dwarf2_add_member_fn, dwarf2_attach_fn_fields_to_type):
+ New functions to handle fields and member functions.
+ (read_structure_scope): Rewritten to use them.
+ (read_array_type): Renamed from dwarf_read_array_type.
+ Default upper array bound to describe an array with unspecified
+ length.
+ Create array types in backwards order, as dwarf2 puts out the array
+ dimensions from left to right.
+ (read_subroutine_type): Handle DW_TAG_unspecified_parameters,
+ DW_AT_artificial and DW_AT_prototyped.
+ (read_base_type): Make an unsigned type for DW_ATE_boolean.
+ Pass objfile to dwarf_base_type.
+ (read_partial_die): Use read_attribute to read in the attributes.
+ Handle DW_AT_sibling and DW_AT_type.
+ Follow references when determining DW_AT_name and DW_AT_external
+ attributes of the die.
+ Validate DW_AT_*_pc attributes.
+ (read_full_die): Use read_attribute to read in the attributes.
+ (read_attribute): New function to read an attribute described
+ by an abbreviated attribute.
+ (new_symbol): Relocate symbol value for DW_TAG_label with baseaddr.
+ Do not set SYMBOL_VALUE_ADDRESS for DW_TAG_subprogram,
+ SYMBOL_BLOCK_VALUE for the symbol will be set later by finish_block.
+ Change symbol class for global variables with a zero valued location
+ descriptor to LOC_UNRESOLVED.
+ Handle DW_AT_const_value attributes for DW_TAG_variable,
+ DW_TAG_formal_parameter and DW_TAG_enumerator.
+ Build a typedef symbol for DW_TAG_base_type.
+ (dwarf2_const_value): New routine to copy a constant value from an
+ attribute to a symbol.
+ (dwarf_base_type): Use passed in objfile, not current_objfile
+ when calling dwarf2_fundamental_type.
+ (dump_die): Use DW_* accessor macros to access values of attributes.
+ (decode_locdesc): Handle DW_OP_plus_uconst.
+
+Wed Jan 22 01:31:16 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * mn10200-tdep.c: New file.
+ * config/mn10200/tm-mn10200.h: New, REGISTER_SIZE is 24 bits not 32,
+ SP_REGNUM and FP_REGNUM are different, also no lar or lir.
+ * config/mn10200/mn10200.mt: New file.
+ * configure.tgt: add mn10200 entry.
+
+Tue Jan 21 18:32:23 1997 Stu Grossman (grossman@lisa.cygnus.com)
+
+ * configure.in configure: Check if host has libdl if doing
+ Solaris threads.
+
+Tue Jan 21 17:03:26 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * mn10300-tdep.c: Wrote/fixed implementations of
+ mn10300_frame_chain, mn10300_init_extra_frame_info,
+ mn10300_frame_saved_pc
+ * config/mn10300/tm-mn10300.h: Redefine INIT_EXTRA_FRAME_INFO
+ and INIT_FRAME_PC macros.
+
+Tue Jan 21 17:01:20 1997 Stu Grossman (grossman@lisa.cygnus.com)
+
+ * configure.in configure: Check if host has libm. Make sure we
+ are using gcc when using the -export-dynamic option. Fixes a
+ problem with building under Solaris/SunPro cc.
+
+Mon Jan 20 13:52:13 1997 Mark Alexander <marka@cygnus.com>
+
+ * config/mips/{embed,embed64,embedl,embedl64}.mt:
+ Link in simulator on MIPS embedded targets.
+
+Sat Jan 18 02:31:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * blockframe.c (frameless_look_for_prologue): Mark frames
+ with a zero PC as frameless to improve backtraces from core dumps
+ caused by dereferencing a NULL function pointer.
+
+Thu Jan 16 14:10:41 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mn10300/tm-mn10300.h: fix BREAKPOINT definition.
+
+Tue Jan 14 16:01:06 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * mn10300-tdep.c: made a lot more generic, ripping out code
+ from copied target (no more mn10300_scan_prologue,
+ init_extra_frame_info, and mn10300_fix_call_dummy calls)
+ * config/mn10300/tm-mn10300.h: undefine INIT_EXTRA_FRAME_INFO
+ and INIT_FRAME_PC macros
+
+Thu Jan 9 11:44:40 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sparc-tdep.c (sparc_frame_find_saved_regs): Don't use
+ FP_REGISTER_BYTES to compute offsets into the saved frame,
+ since it fails for SPARC targets configured without any
+ FP regs. Instead, use DUMMY_STACK_REG_BUF_SIZE.
+
+Mon Jan 6 11:15:14 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * symtab.c (fixup_symbol_section): Handle NULL symbols without
+ crashing.
+
+Fri Jan 3 12:08:16 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in configure configure.in: Remove ENABLE_CLIBS,
+ ENABLE_OBS, and THREAD_DB_OBS. These are consolidated into LIBS
+ and CONFIG_OBS.
+ * configure configure.in: Clean up test cases around thread support.
+ * configure.tgt (v850-*-*): Include v850ice.o and v850.lib if
+ host is Windows.
+ * c-valprint.c ch-valprint.c cp-valprint.c eval.c expprint.c
+ printcmd.c valops.c value.h values.c: Add bfd_section arg to
+ value_at and value_at_lazy.
+ * coffread.c dbxread.c elfread.c mdebugread.c minsyms.c symtab.h:
+ Add bfd_section arg to prim_record_minimal_symbol_and_info.
+ * corefile.c gdbcore.h printcmd.c valops.c: Use read_memory_section
+ instead of read_memory. It takes a bfd_section arg.
+ * coffread.c dbxread.c elfread.c gdb-stabs.h objfiles.h: Remove
+ unnecessary cast for assignment of struct dbx_symfile_info.
+ Struct objfile now uses a real pointer instead of PTR for this
+ element.
+ * dbxread.c (dbx_symfile_init): Stash bfd section pointers for
+ text, data and bss into dbx_symfile_info.
+ * exec.c (xfer_memory): Handle transfers for user-specified
+ sections.
+ * findvar.c (read_var_value locate_var_value): Copy bfd section
+ from the symbol to the value.
+ * gdb-stabs.h: Add section pointers for text, data and bss
+ sections.
+ * maint.c (translate address command): Add test code for overlay
+ address translation.
+ * printcmd.c (do_examine do_one_display): Now takes a bfd section
+ arg.
+ * (print_formatted x_command): Record current section along with
+ current address for repeated commands.
+ * sparc-nat.c (fetch_inferior_registers): Change
+ target_xfer_memory to target_{read write}_memory to allow changes
+ to target_xfer_memory interface for section info.
+ * symmisc.c (dump_msymbols print_symbol): Print section
+ assocaited with symbol.
+ * symtab.c (fixup_symbol_section): New routine to
+ add section info to symbols returned by lookup_symbol.
+ * symtab.h (struct general_symbol_info): Add bfd section to
+ symbols.
+ * target.c target.h (target_xfer_memory): Add bfd section to
+ args.
+ * (target_read_memory_section): New routine to read data from a
+ specific section.
+ * (target_memory_bfd_section): New global variable to pass bfd
+ section in to targets.
+ * valarith.c (value_add value_addr value_array): Preserve bfd
+ section when computing new value.
+ * value.h (struct value): Add bfd section to values.
+ * values.c (allocate_value value_copy): Initialize/preserve bfd
+ section.
+ * (unpack_double): Clean up _MSC_VER conditionals to remove
+ duplicate code.
+ * v850ice.c: New module to support communication with NEC's
+ PC-based ICE.
+ * config/v850/tm-v850.h (REGISTER_NAMES): Replace sp, gp, fp, and
+ ep names with rxx names. sp and fp are renamed via a different
+ mechanism.
+
+Fri Jan 3 14:20:05 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * mn10300-tdep.c (mn10300_push_arguments): rewrote,
+ also removed code elsewhere that made use of RP_REGNUM.
+ * config/mn10300/tm-mn10300.h: ripped out RP_REGNUM, V0_REGNUM,
+ ARG0_REGNUM, ARGLAST_REGNUM (all not appropriate for mn10300
+ arch.), redefined SAVED_PC_AFTER_CALL, EXTRACT_RETURN_VALUE,
+ EXTRACT_STRUCT_VALUE_ADDRESS, STORE_RETURN_VALUE.
+
+For older changes see ChangeLog-1996
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1998 b/contrib/gdb/gdb/ChangeLog-1998
new file mode 100644
index 0000000..a9038f8
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1998
@@ -0,0 +1,7220 @@
+Thu Dec 31 15:26:13 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * corelow.c (core_ops): Don't initialize statically.
+ (init_core_ops): New function, fills in core_ops.
+ (_initialize_corelow): Use it.
+
+Thu Dec 31 16:54:30 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by
+ Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ Edith Epstein <eepstein@sophia.cygnus.com>
+ David Taylor <taylor@texas.cygnus.com>
+
+ * config/pa/tm-hppa.h (INSTRUCTION_NULLIFIED): Change to read
+ nullify instruction bit from IPSW only when we are not in a system
+ call.
+ (STRCAT_REGISTER, pa_do_strcat_registers_info): Additional
+ parameter -- precision.
+
+ * Makefile.in (BUILD_TUI): To build the tui, only when configured
+ with --enable-tui.
+ (YLWRAP): Use ylwrap to avoid problems on systems w/o bison.
+ (gdb$(EXEEXT)): Make it dependent on BUILD_TUI.
+ (all-tui): Remove dependency from phony target.
+ (c-exp.tab.c): Use ylwrap instead of bison.
+ (jv-exp.tab.c): Ditto.
+ (f-exp.tab.c): Ditto.
+ (m2-exp.tab.c): Ditto.
+
+ * configure.in (ENABLE_CFLAGS): Define and export BUILD_TUI.
+
+ * configure: Regenerated.
+
+ * c-typeprint.c (c_type_print_base): Get to the method name by
+ skipping over all the namespaces, classes and '::'.
+
+ * infcmd.c (run_command): Only call SOLIB_RESTART if it's
+ defined.
+ (detach_command): Ditto.
+
+ * infptrace.c (call_ptrace): Add some debugging code.
+
+ * infrun.c (follow_inferior_fork): Only define on HP.
+ (wait_for_inferior): Only call SOLIB_IN_DYNAMIC_LINKER if we have
+ shared libraries; restore test of IN_SOLIB_DYNSYM_RESOLVE_CODE
+ removed by HP.
+
+ * Makefile.in (ALLDEPFILES): Add somread.c, hp-psymtab-read.c,
+ hp-symtab-read.c.
+ (SFILES): Remove the above files
+ (COMMON_OBS): Remove somread.o
+ (SFILES): Add the tui files to this, so they get
+ included in etags tables.
+ (all-tui): New rule, which does a recursive make in the tui
+ subdir.
+ (gdb$(EXEEXT)): Add tui-all to the list of
+ dependencies, and add tui/libtui.a to the link list.
+ (tui/libtui.a): When recursing, pass down
+ ${FLAGS_TO_PASS}. And don't echo the make command. This is
+ closer to what the other recursions do.
+ (HFILES_NO_SRCDIR) add hpread.h.
+ (COMMON_OBS): Add hp-psymtab-read.o, hp-symtab-read.o
+ Allow the TUI code to be conditionally enabled.
+ (TUI_TARGET, TUI_LIBRARY): New variables, whose values are set by
+ the configuration script. They're set to the empty string when
+ the TUI isn't enabled.
+ (gdb$(GDBEXT)): Use those, instead of referring to tui-all and
+ tui/libtui.a directly.
+
+ * Makefile.in: Avoid spurious relinking.
+ (gdb$(EXEEXT)): Depend on the actual tui library, not on a
+ fictitious target. Since the fictitious target never existed, make
+ would always relink.
+ (tui/libtui.a): Renamed from all-tui. Always recurse to make sure
+ the library is up to date.
+ (TUI_TARGET): Variable removed; there's no need for it any more.
+
+ * Makefile.in: Look for tui include files in the tui source dir.
+
+ * Use automake's `aclocal' program to generate aclocal.m4, to allow
+ us to use automake macros in configure.in with impunity.
+
+ * acconfig.h: Add an entry for the `TUI' symbol.
+
+ * acinclude.m4: New file, containing the code from the old
+ aclocal.m4. Incorporate (by reference) ../bfd/acinclude.m4, not
+ ../bfd/aclocal.m4, since we only want bfd's local macros.
+
+ * aclocal.m4: Now automagically generated. Just run aclocal!
+
+ * annotate.c (annotate_catchpoint): New function.
+
+ * annotate.h: Taking the new includes (symtab.h and gdbtypes.h).
+ not taking the ansic C build fix.
+ (annotate_catchpoint): Declare.
+
+ * blockframe.c (blockvector_for_pc_sect): Check that the end of
+ the block is >= to the pc, not just >.
+
+ * breakpoint.c (create_temp_exception_breakpoint): #If it out --
+ nothing calls it.
+ (bpstat_stop_status): Don't call SOLIB_HAVE_LOAD_EVENT if it's not
+ defined; don't call SOLIB_HAVE_UNLOAD_EVENT if it's not defined.
+ (bpstat_get_triggered_catchpoints): If we don't have shared
+ library support, then don't call SOLIB_LOADED_LIBRARY_PATHNAME nor
+ SOLIB_UNLOADED_LIBRARY_PATHNAME.
+ (watch_command_1): Don't require a run before a watch command
+ unless we're on HP [it's an HP OS bug, not a generic limitation]
+ (catch_load_command_1): Don't define if no shared libraries.
+ (catch_command_1): Don't claim to support fork catchpoints unless
+ CHILD_INSERT_FORK_CATCHPOINT is defined, don't claim to support
+ vfork catchpoints unless CHILD_INSERT_VFORK_CATCHPOINT is defined,
+ don't clain to support shared library load catchpoints if shared
+ libraries aren't supported, and don't claim to support exec
+ catchpoints unless CHILD_INSERT_EXEC_CATCHPOINT is defined
+
+ (bpstat_do_actions): If we just set cmd to NULL, don't then try to
+ set it to cmd->next as we'll SEGV.
+ (bpstat_do_actions): Simplify significantly. It's
+ now almost as simple as before the merge and it no longer has the
+ HP bug that breakpoint commands are executed repeatedly.
+
+ (break_at_finish_command_1): Rewrite and make sure
+ selected_frame points to a frame before using it. Fix string
+ termination error.
+ (break_at_finish_at_depth_command_1): Ditto.
+
+ (can_use_hw_watchpoints): New static variable.
+ (read_memory_nobpt): Test for breakpoint type bp_none.
+ (insert_breakpoints): Test for breakpoint type bp_catch_exec;
+ insure have a current frame before getting the frame address.
+ (remove_breakpoints): Check for breakpoints of types bp_none,
+ bp_catch_fork, bp_catch_vfork, and bp_catch_exec.
+ (bpstat_stop_status): Fix updates of b->hit_count.
+ (bpstat_have_active_hw_watchpoints): New function.
+ (create_exec_event_watchpoint): New function.
+ (watch_command_1): Use can_use_hw_watchpoints.
+ (catch_fork_command_1): Change name of function to call from
+ target_create_catch_(v)fork_hook to create_(v)fork_even_catchpoint.
+ (delete_breakpoint): Test for already deleted breakpoints; add
+ support for bp_catch_fork, bp_catch_vfork, and bp_catch_exec
+ breakpoints.
+ (_initialize_breakpoint): Add can-use-hw-watchpoints to list of
+ user settable debugger variables.
+
+ (clear_command): When there is no argument
+ to the clear command, delete all breakpoints that are hit at
+ default line. This will include a breakpoint whose line number
+ does not correspond to the default line, but has been set at
+ the default address.
+
+ (delete_breakpoint): Don't call bpstat_clear_actions, instead
+ clear things explicitly; if clearing breakpoint_at, then also
+ clear any associated actions so that bpstat_do_actions won't try
+ to execute them.
+ (_initialize_breakpoint): Fix function name for bx command.
+
+ (tbreak_command): Remove static from declaration.
+ (maintenance_info_breakpoints): Ditto.
+
+ (reattach_breakpoints): New funct definition, used with with
+ hardware watchpoints
+ (breakpoint_1): Change format and add entries to bptypes[]
+ (maintenance_info_breakpoints): Function is no longer static
+
+ (_initialize_breakpoint): Removed a comment.
+ (exception_catchpoints_are_fragile,
+ exception_support_initialized): Define.
+ (breakpoint_here_p): Fixed syntax error in conditional
+ (disable_watchpoints_before_interactive_call_start): Fixed call to
+ check_duplicates. Need a section parameter.
+ (enable_watchpoints_after_interactive_call_stop): Fixed call to
+ check_duplicates. Need a section parameter.
+ (breakpoint_re_set_one): Fixed call to check_duplicates. Need a
+ section parameter.
+ (delete_command): Fixed syntax error in conditional
+ (breakpoint_re_set): Fixed some typos.
+
+ (args_for_catchpoint_enable): New type for handling exceptions.
+ (current_exception_event): New variable for handling exceptions.
+ (insert_breakpoints): Check for additional breakpoint types --
+ bp_catch_throw, bp_catch_catch, call_disabled. Also, do some
+ additional work to handle an exception catchpoint.
+ (remove_breakpoint): There are additional breakpoint types to
+ check for: Bp_catch_throw, bp_catch_catch, call_disabled. Also do
+ some additional work to remove the exception catchpoints
+ (breakpoint_init_inferior): New input parameter. If there are
+ exception catchpoints delete them.
+ (breakpoint_here_p): There are additional breakpoint enable
+ settings to check for: Shlib_disabled, call_disabled
+ (breakpoint_thread_match): There are additional breakpoint enable
+ settings to check for: Call_disabled
+ (ep_is_catchpoint): There are additional breakpoint types to check
+ for: Bp_catch_throw, bp_catch_catch
+ (ep_is_exception_catchpoint): New function
+ (bpstat_find_step_resume_breakpoint): New function
+ (bpstat_do_actions): Introduce a local copy of the bpstat
+ structure.
+ (print_it_normal): There are additional breakpoint types to check
+ for: Bp_catch_throw, bp_catch_catch Changeing the control
+ structure a bit (adding else ifs) Add code to print out info about
+ exceptions.
+ (bpstat_stop_status): There are additional breakpoint enable
+ settings to check for: Call_disabled. there are additional
+ breakpoint types to chack for: Bp_catch_catch and bp_catch_throw.
+ Check to see if stopped due to an exception. Minor fixes to the
+ catch_errors calls. Make sure to count all encountered
+ breakpoints. There was something funky going on previously with
+ the counting.
+ (bpstat_what): Add cases for new breakpoint types:
+ bp_catch_catch, bp_catch_throw.
+ (bpstat_get_triggered_catchpoints): Check for new breakpoint types
+ : Bp_catch_catch, bp _catch_throw.
+ (breakpoint_1): Account for new breakpoint types.
+ (describe_other_breakpoints): Account for new breakpoint enable
+ setting (call_disabled)
+ (check_duplicates): Account for new breakpoint enable setting
+ (call_disabled)
+ (disable_breakpoints_in_shlibs): New function
+ (disable_watchpoints_before_interactive_call_start): New function
+ (mention): Account for new breakpoint types.
+ (break_command_1): Some additional checking for a valid PC.
+ (watch_command_1): Some dditional checking to prevent a watch
+ before a run command.
+ (ep_parse_optional_filename): Simplified for loop.
+ (create_exception_catchpoint): New function
+ (cover_target_enable_exception_callback): New function
+ (handle_gnu_4_16_catch_command): This used to be thcatch_command_1
+ function.e
+ (create_temp_exception_breakpoint): New function
+ (catch_command_1): Differs from gdb 4.16 and gdb 4.17. Is now
+ calling catch_exception_command_1 using the EX_EVENT_CATCH and
+ EX_EVENT_THROW values as parameters.
+ (clear_command): Additional comments
+ (delete_breakpoint): Handle exceptions. Check for additional
+ breakpoint enable settings: Shlib_disabled, call_disabled.
+ (delete_command): Hp folks are claiming that we should not delete
+ shlib_event breakpoints
+ (breakpoint_re_set_one): Moved call to check_duplicates. Add new
+ breakpoint types to switch statement.
+ (breakpoint_re_set_thread): New function
+ (enable_command): Account for new breakpoint types.
+
+ (insertion_state_t): New enumerated type.
+ (remove_breakpoint): New param in funct prototype.
+ (insert_breakpoints): Check for bp_catch_fork and bp_catch_vfork.
+ (remove_breakpoints): Changed call to remove_breakpoint.
+ (detach_breakpoints): New function.
+ (remove_breakpoint): New parameter, is. Also changed the
+ way b->inserted is set.
+ (ep_is_catchpoint): New function.
+ (ep_is_shlib_catchpoint): New function.
+ (print_it_normal): Check for bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, bp_catch_exec. Also new code
+ to print out catchpoints properly.
+ (bpstat_stop_status): Check for bp_catch_fork, bp_catch_vfork,
+ and bp_catch_exec. Also, some code to check for catching a
+ shared library load/unload.
+ (bpstat_what): Added catch_shlib_event to class enumeration.
+ Defined new macro, shlr. Expanded the bpstat_what_main_action
+ table. Add cases for bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, and bp_catch_exec.
+ (bpstat_get_triggered_catchpoints): New function.
+ (breakpoint_1): Changes to bptypes definition. Also check for
+ bp_catch_load, bp_catch_unload, bp_catch_fork, bp_catch_vfork,
+ bp_catch_exec. Similar changes to the switch statement.
+ (set_raw_breakpoint): Initialize new breakpoint structure fields.
+ dll_pathname, triggered_dll_pathname, forked_inferior_pid,
+ exec_pathname.
+ (create_solib_load_unload_event_breakpoint): New function.
+ (create_solib_load_event_breakpoint): New function.
+ (create_solib_unload_event_breakpoint): New function.
+ (create_fork_vfork_event_catchpoint): New function.
+ (create_fork_event_catchpoint): New function.
+ (create_vfork_event_catchpoint): New function.
+ (mention): New cases for bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, bp_catch_exec.
+ (ep_skip_leading_whitespace): New function.
+ (ep_find_event_name_end): New function.
+ (ep_parse_optional_if_clause): New function.
+ (ep_parse_optional_filename): New function.
+ (catch_fork_kind): New enumerated type.
+ (catch_fork_command_1): New function.
+ (catch_exec_command_1): New function.
+ (catch_load_command_1): New function.
+ (catch_unload_command_1): New function.
+ (catch_throw_command_1): New function.
+ (catch_command_1): Now calls catch_throw_command_1.
+ (tcatch_command): New function.
+ (delete_breakpoint): Changed call to remove_breakpoint.
+ Also free the new fields in the breakpoint structure.
+ (breakpoint_re_set_one): Handle bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, bp_catch_exec.
+ (disable_command): Handle bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, bp_catch_exec.
+ (enable_command): Handle bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork, bp_catch_exec.
+ (_initialize_breakpoint): Alter add_com call for catchpoints,
+ add add_com call for watchpoints.
+
+ * breakpoint.h (enum bptype): New entries bp_catch_catch,
+ bp_catch_throw, and bp_none, bp_catch_load, bp_catch_unload,
+ bp_catch_fork, bp_catch_vfork,bp_catch_exec. Add declarations for
+ new functions bpstat_have_active_hw_watchpoints and
+ create_exec_event_catchpoint.
+ (tbreak_command): Add prototype.
+ (update_breakpoints_after_exec): Add prototype; update comments.
+ (reattach_breakpoints): New funct prototype declaration.
+ (enable): New enumerated value call_disabled.
+ (bpstat_find_step_resume_breakpoint): New funct decl.
+ (inf_context): New enumerated type.
+ (breakpoint_re_set_thread): New funct decl.
+ (breakpoint_init_inferior): New parameter.
+ (disable_watchpoints_before_interactive_call_start): New funct decl.
+ (enable_watchpoints_after_interactive_call_stop): New funct decl.
+ (disable_breakpoints_in_shlibs): New funct decl.
+ (struct breakpoint): New fields, dll_pathname,triggered_dll_pathname,
+ forked_inferior_pid,exec_pathname BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK.
+ (bpstat_get_triggered_catchpoints): New function.
+ (detach_breakpoints): New function.
+ (create_solib_load_event_breakpoint): New function.
+ (create_solib_unload_event_breakpoint) New function.
+ (create_fork_event_catchpoint): New function.
+ (create_vfork_event_catchpoint): New function.
+ (ep_is_catchpoint): New function.
+ (ep_is_shlib_catchpoint) New function.
+ (enum bpstat_what_main_action): New entry.
+
+ * buildsym.c (finish_block): Get rid of processing_hp_compilation;
+ handle LOC_INDIRECT case. Set the BLOCK_GCC_COMPILED to the right
+ compiler.
+ (push_context): Add symbols for parameters to the context_stack.
+ (merge_symbol_lists): New function. Merges two symbol lists.
+ (struct context_stack): Add new field param.
+
+ (processing_hp_compilation): New external var.
+
+ * c-exp.y: Use external flag hp_som_som_object_present to decide
+ whether code was compiled by HP's compilers. Add two new C++
+ tokens for true and false.
+ (yylex): Check for template name is done differently for the
+ HP/aCC compiler case; change some of the template processing code
+ for handling HP aCC templates.
+
+ * c-lang.c (c_create_fundamental_type): Added case to handle
+ template args. Handle FT_BOOLEAN type. Set no sign flag for
+ FT_CHAR.
+ (cplus_builtin_types): New structure for c++ builtin types.
+ (cplus_language_defn): Use cplus_builtin_types instead of
+ c_builtin_types.
+
+ * c-typeprint.c (c_type_print_base): Don't print 'privete' label
+ for a class if all members are private, similarly don't print
+ 'public' for a struct. Add support for sized enums (HP/aCC). get
+ rid of the 'static' keyword printed by the demangler for member
+ function, when printing the type of a class. 'static' will be
+ added by this function. If the demangled name is null, and the
+ method is not stubbed, get the signature by looking at the
+ information stored in the symbol structure. Remove printing of
+ 'const' and 'volatile' keywords for methods. This is now taken
+ care as part of the demangled member names.
+ (cp_type_print_method_args): New function. To print a C++ method
+ arguments and name to the output stream.
+
+ (c_type_print_cv_qualifier): New function. Print out "const" and
+ "volatile" attributes.
+ (c_type_print_varspec_prefix): Print const or volatile qualifiers.
+ (c_type_print_args): Print 'void' for c++.
+ (c_type_print_varspec_suffix): Print 'void' for a no argument
+ function.
+ (c_type_print_base): Print const or volatile qualifiers. Do not
+ print 'unnamed union' if HP aCC compiler used. Distinguish
+ between struct and class based on the DECLARED_TYPE. Handle
+ HP/aCC compiler case for not printing vtable. Add Template
+ support.
+
+ (cp_type_print_derivation_info): Print out 'protected' when
+ appropriate. This applies only to HP's compilers, not gcc.
+
+ (c_val_print): Added parameter embedded_offset. Add
+ embedded_offset to valaddr in function calls; fix calls to
+ val_print and cp_print_value_fields. process TYPE_CODE_METHOD as
+ well. moved call to check_typedef out of conditional. added
+ embedded offset param to val_print call.
+
+ (c_value_print): Add new parameter to call to val_print.
+ handle pointer to class case. Attempt to
+ determine the real type of the object to be printed.
+ ensure that const char *, const unsigned char *
+ come out without the type but the volatile variants
+ and the signed variants don't.
+
+ * coff-solib.c (coff_solib_add): Add parameters to call
+ to symbol_file_add.
+
+ * coff-solib.h: (Solib_REMOVE_INFERIOR_HOOK): New macro. defined
+ to 0. functionality not implemented for coff.
+ (SOLIB_CREATE_CATCH_LOAD_HOOK): New macro, generate error message
+ for coff.
+ (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Ditto.
+ (SOLIB_HAVE_LOAD_EVENT): Ditto.
+ (SOLIB_LOADED_LIBRARY_PATHNAME): Ditto.
+ (SOLIB_HAVE_UNLOAD_EVENT): Ditto.
+ (SOLIB_UNLOADED_LIBRARY_PATHNAME): Ditto.
+ (SOLIB_IN_DYNAMIC_LINKER): Ditto.
+ (SOLIB_RESTART): Ditto.
+
+ * command.c (find_cmd): New function. (lookup_cmd_1): Call it,
+ change parsing if tui_version or xdb_commands is set.
+ (_initialize_command): Install new alias if xdb_commands is set.
+
+ * complaints.h: Add ifdef...endif pair at beginning and end of file.
+
+ * config.in, configure: Regenerated.
+
+ * config/pa/hppabsd.mh (NATDEPFILES): Added new files
+ hp-psymtab-read.o and hp-symtab-read.o.
+ * config/pa/hppahpux.mh (NATDEPFILES): Ditto.
+
+ * config/pa/hppahpux.mh (TERMCAP): Use -lHcurses.
+ * config/pa/hppaosf.mh (NATDEPFILES): Ditto.
+
+ * config/pa/hpux1020.mh (TERMCAP): Use -lHcurses.
+ (MH_CFLAGS): New flag, -D__HP_CURSES, this define
+ is used by HP's linker to find the correct curses library.
+
+ * config/pa/hpux1020.mh: New file.
+
+ * config/pa/hpux1020.mt: New file.
+
+ * config/pa/hpux1100.mh (TERMCAP): Link against -lcurses, not
+ -lHcurses. The latter does not contain mvwaddstr, wscrl, or
+ wstbwlmkfzz.
+
+ * config/pa/hpux1100.mh (TERMCAP): Use -lHcurses.
+ (MH_CFLAGS): New flag, -D__HP_CURSES, this define
+ is used by HP's linker to find the correct curses library.
+
+ * config/pa/hpux1100.mh (TERMCAP): When hosting on hpux 11.00, use
+ -lHcurses rather than -lcurses.
+
+ * config/pa/hpux1100.mh: New file.
+
+ * config/pa/hpux1100.mt: New file.
+
+ * config/pa/nm-hppah.h (CHILD_HAS_SYSCALL_EVENT): New macro
+ (CHILD_THREAD_ALIVE): New macro
+ (STOPPED_BY_WATCHPOINT): Add a condition to the macro,
+ ! stepped_after_stopped_by_watchpoint
+ (TARGET_ENABLE_HW_WATCHPOINTS): New macro
+ (hppa_enable_hw_watchpoints): New funct decl
+ (TARGET_DISABLE_HW_WATCHPOINTS): New macro
+ ( hppa_disable_hw_watchpoints): New funct decl
+ these are for HP's implementation of fast
+ watchpoints (via page protection).
+ (target_pid_to_str): New macro, calls hppa_pid_to_str
+ (target_tid_to_str): New macro, calls hppa_tid_to_str
+
+ * config/pa/nm-hppah.h (CHILD_POST_WAIT): Delete;
+ (CHILD_CREATE_CATCH_FORK_HOOK): Replace with
+ CHILD_INSERT_FORK_CATCHPOINT and CHILD_REMOVE_FORK_CATCHPOINT.
+ (CHILD_CREATE_CATCH_VFORK_HOOK): Replace with
+ CHILD_INSERT_VFORK_CATCHPOINT and CHILD_REMOVE_VFORK_CATCHPOINT.
+ (CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC,
+ CHILD_INSERT_EXEC_CATCHPOINT, CHILD_REMOVE_EXEC_CATCHPOINT,
+ CHILD_HAS_EXECD, CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL,
+ CHILD_POST_ATTACH, TARGET_HAS_HARDWARE_WATCHPOINTS,
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT,
+ TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT,
+ TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT, STOPPED_BY_WATCHPOINT,
+ HAVE_NONSTEPPABLE_WATCHPOINT, target_insert_watchpoint,
+ target_remote_watchpoint): New macros.
+
+ * config/pa/nm-hppah.h (CHILD_XFER_MEMORY): Reinsert accidentally
+ deleted define.
+
+ * config/pa/nm-hppah.h:
+ (PREPARE_TO_PROCEED): Defined macro to use
+ hppa_prepare_to_proceed.
+ (hppa_pid_to_str): Extern decl.
+ (hppa_tid_to_str): Extern decl.
+ (target_pid_or_tid_to_str): New macro definition.
+ (hppa_pid_or_tid_to_str): Extern decl.
+ (ENSURE_VFORKING_PARENT_REMAINS_STOPPED): New macro - for
+ handling events caused by a call to vfork.
+ (hppa_ensure_vforking_parent_remains_stopped): Extern decl.
+ (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK): New macro -
+ for handling events caused by a call to vfork.
+ (hppa_resume_execd_vforking_child_to_get_parent_vfork): Extern decl.
+
+ * config/pa/nm-hppah.h: Fix PREPARE_TO_PROCEED macro.
+
+ * config/pa/nm-hppah.h: Fix for gcc compile on HPUX, change
+ PT_RDUAREA to PT_RUAREA.
+
+ * config/pa/nm-hppah.h: Introduced an HPUXHPPA define.
+ A bit of a hack so that I can ifdef some code that
+ only works for the HP wildebeest debugger.
+
+ * config/pa/nm-hppah.h: Lots of new CHILD_ defines;
+ process_event_kind enum.
+
+ * config/pa/tm-hppa.h (BREAKPOINT32): New define.
+ (CALL_DUMMY_HAS_COMPLETED): New define.
+
+ * config/pa/tm-hppa.h (STACK_ALIGN): New macro.
+ (NO_EXTRA_ALIGNMENT_NEEDED): New macro.
+ (PC_REQUIRES_RUN_BEFORE_USE): New macro.
+ (REGISTER_NAMES): Formatting in file changed.
+ (CR27_REGNUM): Base register for thread local storage.
+ (USE_STRUCT_CONVENTION): New macro used to decide whether
+ a function returning a value of type type will
+ put it on the stack or into registers (based on the
+ PA risc calling conventions).
+ (EXTRACT_RETURN_VALUE): Fixed calculation for extracting return value.
+ (VALUE_RETURNED_FROM_STACK): New macro.
+ (TARGET_READ_PC): Declared the function used in the definition.
+ (SKIP_TRAMPOLINE_CODE): Declared the function used in the definition.
+ (TARGET_WRITE_PC): Declared the function used in the definition.
+ (TARGET_READ_FP): Declared the function used in the definition.
+
+ * config/pa/tm-hppa.h (STRCAT_REGISTER): Define macro for
+ future use.
+ (pa_do_strcat_registers_info): Moved function decl from
+ defs.h to this HPUX specific .h file.
+
+ * config/pa/tm-hppa.h (USE_STRUCT_CONVENTION): Type_LENGTH returns
+ bytes, not bits; fix off by 8 error.
+
+ * config/pa/tm-hppa.h:
+ New comment for obj_unwind_info definition
+ New typedef, obj_private_struct
+
+ * config/pa/tm-hppa.h: Delete most target_ macros -- use default
+ versions instead; remove extraneous comma from proc_wait macro.
+
+ * config/pa/tm-hppa.h: Get rid of macro HP_COMPILED_TARGET.
+
+ * config/pa/tm-hppa.h: Removed redefinitions of
+ USE_STRUCT_CONVENTION and STACK_ALIGN macros.
+
+ * config/pa/tm-hppa.h: Some new definitions
+ New macros: Arg0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM.
+ target_pid_to_exec_file, target_acknowledge_forked_child,
+ target_create_catch_fork_hook, target_create_catch_vfork_hook,
+ target_has_forked, target_has_vforked, require_attach,
+ require_detach, proc_wait
+ New funct decls: Hppa_pid_to_exec_file,
+ hppa_acknowledge_forked_child, hppa_create_catch_fork_hook,
+ hppa_create_catch_vfork_hook, hppa_target_has_forked,
+ hppa_target_has_vforked, hppa_require_attach,
+ hppa_require_detach, process_wait
+ (unwind_table_entry): Added comments to describe struct fields.
+
+ * config/pa/tm-hppah.h (somsolib.h): Include it.
+
+ * config/pa/tm-hppah.h:
+ (CHILD_ENABLE_EXCEPTION_CALLBACK): New define
+ (CHILD_GET_CURRENT_EXCEPTION_EVENT): New define
+
+ * configure.host (hppa-*-hpux10.20, hppa-*-hpux11.0*): New configs.
+
+ * configure.in (AC_CHECK_HEADERS): Add check for term.h.
+
+ * configure.in: Add an --enable-tui argument.
+
+ * configure.in: Construct tui/Makefile from tui/Makefile.in.
+
+ * configure.in: Use AM_PROG_CC_STDC. If we have the GUI, then we
+ need this to process libgui.h.
+
+ * convex-tdep.c (decout): Change FILE to GDB_FILE.
+
+ * corefile.c: Include objfiles.h, symfile.h.
+ (core_file_command): Attempt to determine the name of the symbol
+ file from the core file.
+ (read_memory_string): New function.
+
+ * corefile.c (core_file_command): Temporary hack to make non-hpux
+ work. For, non-hpux, t->to_core_file_to_sym_file does not have a
+ reasonable value. No target_ops vector on the stack gives it a
+ non-zero value. fix later.
+
+ * corelow.c (core_file_to_sym_file): Added new local variable,
+ failing command, and do some explicit type castings.
+ (core_ops): Add three new fields: to_has_syscall_event,
+ to_enable_exception_callback, to_get_current_exception_event.
+ Necessary since we still have oldstyle initialization in
+ this file
+
+ * corelow.c: Include unistd.h
+ (core_file_to_sym_file): New function
+ (core_file_thread_alive): New function
+ (core_ops): Added new target ops vector fields. see below. And
+ yes we definitiely need to initialize them here, as long as
+ we're using static initialization.
+
+ * cxux-nat.c (add_shared_symbol_files): Additonal params for calls
+ to symbol_file_add.
+
+ * defs.h (gdb_file_isatty): New function decl.
+
+ * defs.h (GDB_FILE): If TUI is defined, define a structure rather
+ than making this an alias for FILE.
+ (gdb_stdout, gdb_stderr): If TUI is defined, then define these
+ as pointers to variables of type GDB_FILE rather than making them
+ be aliases for stdout and stderr.
+
+ * defs.h (TUIDO): Add definition conditionalized on definition
+ (or lack thereof) of TUI.
+
+ * defs.h (command_class): Add two additional values.
+ (precision_type): New enum.
+
+ * defs.h (gdb_fclose): Add declaration.
+
+ * defs.h (store_address): Change prototype to match function.
+
+ * defs.h (tui_version, xdb_commands, dbx_commands): Add decl's.
+
+ * defs.h (gdb_file_deallocate): New function declaration
+
+ * defs.h:
+ (streamtype): New enumerated type to distinguish between
+ output to a FILE and output to a buffer.
+ (tui_stream): New struct type, named GDB_FILE. Contains,
+ streamtype, FILE, buffer, and bufferlength fields.
+ (gdb_stdout): Of type GDB_FILE, will pass this around gdb
+ rather than stdout.
+ (gdb_stderr): Of type GDB_FILE, will pass this around gdb
+ rather than stderr.
+ (fputs_unfiltered_hook): Change stream parameter from FILE to
+ GDB_FILE
+ (flush_hook): Change stream parameter from FILE to GDB_FILE
+ (gdb_fclose): Fix declaration for gdb_fclose; parameter is now of
+ type GDB_FILE **
+ (gdb_file_adjust_strbuf): New function declaration. function lives in
+ utils.c.
+ (gdb_file_init_astring): New function declaration. function lives
+ in utils.c
+ (gdb_file_get_strbuf): New function declaration. function lives
+ in utils.c
+
+ * defs.h: Additional include files included when TUI is defined.
+
+ * defs.h: Funct decl source_full_path_of.
+
+ * demangle.c: Add HP_DEMANGLING_STYLE_STRING.
+
+ * demangle.c: Added new demangling style, EDG_DEMANGLING_STYLE_STRING,
+ to the demanglers structure. This is for support of
+ Kuck & Assoc.'s changes for demangling.
+
+ * eval.c (evaluate_subexp_standard): C++ member function changes.
+
+ * eval.c (evaluate_subexp_standard): Verify TYPE_TARGET_TYPE is
+ non NULL before dereferencing it.
+
+ * eval.c (evaluate_subexp_standard): With HP/aCC compiler it is not possible
+ to perform inferior calls via function pointers.
+ Resolve calls to overloaded functions using find_overload_match.
+ We cannot handle HP/aCC pointers to member functions.
+ Deal with HP/aCC pointers to members in various kind of expressions.
+
+ * f-lang.c (f_printchar): Change FILE to GDB_FILE.
+ (f_printstr): Ditto.
+ (emit_char): Ditto.
+
+ * f-lang.c (f_printstr): Change stdout to gdb_stdout.
+
+ * f-typeprint.c (f_print_type): Change FILE to GDB_FILE.
+ (f_type_print_varspec_prefix): Ditto.
+ (f_type_print_args): Ditto.
+ (f_type_print_varspec_suffix): Ditto.
+ (print_equivalent_f77_float_type): Ditto.
+ (f_type_print_base): Ditto.
+
+ * findvar.c (): Hp snapshot 3 changes. (extract_address): Coerce
+ return value from extract_unsigned_integer to CORE_ADDR.
+ (store_address): Change val from CORE_ADDR to LONGEST; changes to
+ support machines where CORE_ADDR and LONGEST are different sizes.
+ (get_saved_register): Coerce arg to store_address to LONGEST.
+ (read_relative_register_raw_bytes): Cast last arg to
+ store_address to LONGEST. (read_register): Cast return from
+ extract_address to a CORE_ADDR. (write_register_pid): Change val
+ from LONGEST to CORE_ADDR. (read_pc_pid): Save and restore
+ inferior_pid if necessary. (write_pc_pid): Ditto.
+ (read_var_value): Cast arg to store_address.
+
+ * findvar.c (read_relative_register_raw_bytes_for_frame): New
+ function.
+ (read_relative_register_raw_bytes): Call it.
+
+ * findvar.c (symbol_read_needs_frame): Handle LOC_THREAD_LOCAL_STATIC and
+ LOC_INDIRECT.
+
+ * fork-child.c (fork_inferior): Chenge fifth parameter to be a
+ function returning void.
+
+ * fork-child.c (fork_inferior): Delete unused variable f.
+
+ * fork-child.c:
+ (Startup_WITH_SHELL): New macro -- interim fix for a bug
+ (breakup_args): New function -- breaks up an argument string into
+ an argument suitable for passing into execvp().
+ (fork_inferior): Handling problems with starting up gdb with a shell.
+ -- again, this appears to be an interim fix.
+
+ * fork-child.c:
+ (fork_inferior): Added a comment
+ (clone_and_follow_inferior): New function.
+ (startup_inferior): Minor formatting changes.
+
+ * fork-child.c:
+ (fork_inferior): Hp change is problematic. The -f option has
+ different meanings for different shells. It is particularly
+ inappropriate for bourne shells.
+
+ * fork-child.c:
+ (fork_inferior): Added new parameter, pre_trace_fun.
+ pre_trace_fun is a function pointer. For some targets,
+ like HPUX, this function gets called to prepare for forking
+ a child.
+
+ * fork-child.c:
+ (fork_inferior): Fixed call to init_trace_fun
+
+ * fork-child.c:
+ Moved definition of STARTUP_WITH_SHELL to inferior.h
+ Added a DEBUGGING macro. Currently set to 0. May remove
+ later.
+ breakup_args: Add DEBUGGING ifdefs. more sophisticated
+ parsing to break up args.
+ (fork_inferior): Rename kshell variable to shell. new local
+ variable, tryname. Make use of STARTUP_WITH_SHELL macro.
+ More error processing if starting up with a shell.
+ (startup_inferior): Distinguish between starting up with a shell
+ and not doing so.
+
+ * gdbthread.h:
+ Declarations for load_infrun_state and save_infrun_state take
+ an additional parameter.
+
+ * gdbthread.h: Note that sometime between gdb 4.16 and 4.17,
+ thread.h was renamed gdbthread.h
+ (load_infrun_state): Additional parameters
+ (store_infrun_state): Additional parameters
+
+ * gdbthread.h: Include breakpoint.h
+
+ * hp-psymtab-read.c (QUICK_LOOK_UP): Redefine to be 0.
+ (hpread_build_psymtabs): Deal with enums.
+ (hpread_start_psymtab): Include section offset.
+ (hpread_end_psymtab): Take care of offset.
+
+ * hp-psymtab-read.c (TRUE): Define.
+ (FALSE): Define.
+ (file_exists): New function. Checks for existance of file.
+ (hpread_pxdb_needed): Rewrite.
+ (hpread_quick_traverse): Use correct demangling style.
+ Handle F77 case.
+ (hpread_get_header): Rewrite.
+ (hpread_get_textlow): Add support for DOC_FUNCTION.
+ (hpread_build_psymtabs): Make sure we do the right thing
+ for pxdb and F77.
+
+ * hp-psymtab-read.c (hpread_pxdb_check): Change parenthesis positions.
+
+ * hp-psymtab-read.c (hpread_quick_traverse): Compare CORE_ADDR
+ variable end_addr to 0 instaed of NULL to get rif of gcc warning.
+
+ * hp-psymtab-read.c:
+ (Hpread_get_textlow): Added param to function
+ Defined convennience macros and some datatypes and variables for
+ processing the quick lookup-tables. Looks like the code existed
+ before, but has been munged.
+ (hpread_pxdb_needed): Major rearrangements of code. Additional local
+ variables. Also, more extensive checking for various scenarios:
+ debug info for optimized code vs. unoptimized code, pxdb has been
+ run vs. pxdb has not been run.
+ (VALID_FILE): New macro
+ (VALID_MODULE): New macro
+ (VALID_PROC): New macro
+ (VALID_CLASS): New macro
+ (FILE_START): New macro
+ (MODULE_START): New macro
+ (PROC_START): New macro
+ (FILE_END): New macro
+ (MODULE_END): New macro
+ (PROC_END): New macro
+ (FILE_ISYM): New macro
+ (MODULE_ISYM): New macro
+ (PROC_ISYM): New macro
+ (VALID_CURR_FILE): New macro
+ (VALID_CURR_MODULE): New macro
+ (VALID_CURR_PROC): New macro
+ (VALID_CURR_CLASS): New macro
+ (CURR_FILE_START): New macro
+ (CURR_MODULE_START): New macro
+ (CURR_PROC_END): New macro
+ (CURR_FILE_ISYM): New macro
+ (CURR_MODULE_ISYM): New macro
+ (CURR_PROC_ISYM): New macro
+ (TELL_OBJFILE): New macro
+ (pst_syms_struct): New typedef to keep track of the start/end symbol
+ table (LNTT) indices of psymtabs created so far.
+ (pst_syms_count): New variable
+ (pst_syms_size): New variable
+ (told_objfile): New variable
+ (init_pst_syms): New function. sets up psymtab symbol index stuff.
+ (clear_pst_syms): New function. clean up psymtab symbol index stuff.
+ (record_pst_syms): New function. add info about newest psymtab to symbol
+ index table.
+ (find_next_pst_start): New function. Find a suitable symbol table index.
+ (find_next_file_isym): New function
+ (find_next_proc_isym): New function
+ (find_next_module_isym): New function
+ (scan_procs): New function. Scan and record partial symbols for all
+ functions starting from specified index and in a specified code range.
+ (hpread_quick_traverse: Major rearrangement of code. The function
+ now uses all the nifty macros. There are some new local variables.
+ Check for EDG_DEMANGLING style. ifdef out some code for handling F77.
+ Previously, the function looped over all the modules in the table.
+ Now, the function loops over all the files, modules, and procedures.
+ With HP aCC and CTTI, it is possible for a compiled object to have a
+ file and no module.
+ (hpread_build_psymtabs): Added a section of code ifdefed by
+ QUICK_LOOK_UP. It check to see whether or not there are any globals
+ in the executable. Fix number of params to hpread_start_psymtab call.
+ Some changes to the way DNTT_TYPE_MODULE is handled.
+ (hpread_get_textlow): Change in signature, minor code changes. The
+ function finds the low address associated with a specified symbol.
+ In looking for the address for the symbol avoid going of the end of
+ the LNTT file.
+
+ * hp-psymtab-read.c: Change TRUE to 1 and FALSE to 0. Do some
+ reformatting.
+
+ * hp-psymtab-read.c: Include demangle.h
+ (trans_lang): New function to let gdb know the correct language.
+ (hpread_quick_traverse): Use ARM style demangling.
+ Demangle procedures names.
+ Use gdb language names instead of hp language names.
+ Add symbol to list using its demangled name.
+
+ * hp-psymtab-read.c: New file.
+ (hpread_call_pxdb): New function. Call PXDB to process our file.
+ (hpread_pxdb_check): New function. Return TRUE if the file needs
+ pre-processing by PXDB and we have thus called PXDB to do this
+ processing and the file needs to be re-loaded.
+ (hpread_quick_traverse): New function. Traverse the quick look-up
+ tables, building a set of psymtabs.
+ (hpread_get_header): New function. Get appropriate header from obj
+ file, based on pxdb type
+ (hpread_symfile_init): No change from hpread.c
+ (hpread_build_psymtabs): If there are quick lookup tables, read those,
+ then scan the global section LNTT. Otherwise, just scan the whole LNTT.
+ Changed: Add a global function entry to the global partial symbol list.
+ Handle end of symbols, for QLT case.
+ In case of TAGDEF, if it is a class or a template, add the name to the
+ var_namespace, so that it is known as a type by gdb.
+ In case of CONSTANT, and it is global, add it to the globals.
+ (hpread_symfile_finish): No change from hpread.c
+ (hpread_get_lntt): Make it not static
+ (hpread_get_gntt): No change from hpread.c
+ (hpread_get_slt): Make it not static
+ (hpread_get_textlow): No change from hpread.c
+ (hpread_start_psymtab): No change from hpread.c
+ (hpread_end_psymtab): No change from hpread.c
+
+ * hp-symtab-read.c (hpread_get_scope_start): Renamed. It was
+ hpread_get_depth.
+ (hpread_type_translate): Distinguish between signed and unsigned char
+ types.
+ (hpread_psymtab_to_symtab): Set flag for hp compilation.
+ (hpread_read_function_type): Append symbols for parameters to local
+ list as well as to the global list. Get the parameters types from the
+ local list instead of the global list.
+ (hpread_read_struct_type): Add new field num_fn_fields to next_fn_field
+ structure. Rewrite handling of templates
+ (hpread_type_lookup): Change handling of dntt_type_modifier.
+ (hpread_process_one_debug_symbol): Call hpread_get_scope_start instea
+ of hpread_get_depth. Handle enum as well.
+ (hpread_get_scope_depth): New function. Get nesting depth for a
+ DNTT entry.
+
+ * hp-symtab-read.c (hpread_psymtab_to_symtab): Set
+ processing_gcc_compilation to 0.
+
+ * hp-symtab-read.c (hpread_psymtab_to_symtab_1): Change stdout to
+ gdb_stdout; change fflush to gdb_flush.
+ (hpread_psymtab_to_symtab): Change fflush to gdb_flush.
+
+ * hp-symtab-read.c (hpread_read_enum_type): Declare variable.
+ (hpread_read_struct_type): Eliminate references
+ to 'args' member of fn_field.
+
+ * hp-symtab-read.c (hpread_read_struct_type): A static member
+ is now indicated by the bitsize field, not the bitpos.
+ Initialize physname to empty.
+ (fix_static_member_physnames): Use new macros to deal with
+ physnames.
+
+ * hp-symtab-read.c (hpread_read_struct_type): Change references
+ to bitpos member of struct field to use the FIELD_BITPOS macro.
+
+ * hp-symtab-read.c (hpread_read_struct_type): Comment out reference to
+ obsolete field fn_field.args.
+ Add struct complaint definitions for complaints.
+ (hpread_read_struct_type): Change call to complain.
+ (hpread_read_array_type): Change call to complain.
+ (hpread_type_lookup): Change call to complain.
+ (hpread_process_one_debug_symbol): Change calls to complain.
+ (hpread_type_translate): Change calls to complain.
+
+ * hp-symtab-read.c (hpread_read_struct_type): Make sure bitvector
+ has been allocated before calling has_vtable.
+
+ * hp-symtab-read.c (hpread_read_struct_type): Revert change,
+ just check for vtable without checking for bitvectors too.
+
+ * hp-symtab-read.c:
+ (Hpread_expand_symtab): Change name of local variable from
+ at_end_of_module to at_module_boundary.
+ Also, if demangling style is already EDG, do not reset it
+ to the HP demangling style.
+ Change at_end_of_module param to hpread_process_one_debug_symbol
+ call to at_module_boundary.
+ No longer break out of loop when reach end of module. With CTTI,
+ the compiler can generate function symbols which are not in
+ any module. Typically they show up after the end of one
+ module and before the start of the next module.
+ (hpread_read_struct_type): Check that the debug info for
+ a TEMPLATE_ARG is correct.
+ (hpread_process_one_debug_symbol): Change name of at_end_of_module_p
+ param to at_module_boundary_p.
+ Also set *at_module_boundary_p = -1 if missing a module end and set
+ it to 1 when finished expanding the debug info.
+ Handle TLS variable.
+
+ * hp-symtab-read.c: Include defs.h, symtab.h, gdbtypes.h, complaints.h.
+ (fixup_class): New static variable.
+ (fixup_method): New static variable.
+ (hpread_get_location): Rewrite.
+ (hpread_has_name): Add cases for DNTT_TYPE_DOC_FUNCTION and
+ DNTT_TYPE_DOC_MEMFUNC
+ (hpread_expand_symtab): Use HP demangling style.
+ Set hp_som_som_object_present to 1.
+ (hpread_type_translate): Error out if not immediate. Issue warning
+ if there is an unhandled type code.
+ (error_in_hpread_type_translate_complaint): Remove this structure.
+ (hpread_read_enum_type): Don't assume size of enum is always 4 bytes.
+ (hpread_read_function_type): Add new parameter to indicate a new block.
+ Do not add the parameters to the symbol list.
+ If the type was read in earlier, do not modify the type structure.
+ If we are creating a new block, set the local symbol list to be the
+ param list.
+ Need to mark this type as preprocessed.
+ (hpread_read_doc_function_type): New function. Read and internalize
+ a native DOC function debug symbol.
+ (hpread_read_struct_type): A method can be of type doc_function and
+ doc_memfunc too.
+ Handle case in which a method is read before its class. Deal with
+ incomplete method types.
+ Handle cases in which HP/aCC compiler creates operator names w/o
+ the 'operator' keyword. Rewrite the loop over the fileds.
+ (fix_static_member_physnames): New function. Adjust the physnames for
+ each static member.
+ (fixup_class_method_type): New function. Fix-up the type structure for a
+ class.
+ (hpread_read_array_type): Change complaint to warning.
+ (hpread_type_lookup): Add case for DNTT_TYPE_DOC_FUNCTION.
+ For structures/classes set static member to point to strings with full
+ names.
+ Change calls to hpread_read_function_type to pass extra parameter.
+ (hpread_record_lines): Handle case for SLT_NORMAL_OFFSET.
+ (class_of): New function. Given a function "f" which is a member of a class,
+ find the classname that it is a member of.
+ (hpread_process_one_debug_symbol): Deal with possible alias field from the
+ som record for the Function or Entry type.
+ Do the demangling ourselves if the gdb demangler failed.
+ Add support for DOC functions.
+ For function types, add parameters to local list.
+ (hpread_get_scope_depth): Make this function a no-op.
+ (hpread_adjust_bitoffsets): New function. Adjust the bitoffsets for all
+ fields of an anonymous union.
+ (hpread_get_next_skip_over_anon_unions): New function. Skip over anonymous
+ unions.
+
+ * hp-symtab-read.c: Include demangle.h
+ (hpread_expand_symtab): Ensure we are using ARM-style demangling.
+ (hpread_process_one_debug_symbol): Set the mangled and demangled
+ names for functions.
+ Record the class name to generate the demangled names of member
+ functions.
+
+ * hp-symtab-read.c: New file.
+ (hpread_get_depth): No change from hpread.c
+ (hpread_get_line): No change from hpread.c
+ (hpread_get_location): No change from hpread.c
+ (hpread_has_name): Make it not static. Return 1 for DNTT_TYPE_BLOCKDATA
+ and DNTT_TYPE_MEMFUNC. Return 0 for CLASS_SCOPE, REFERENCE,PTRMEM,
+ PTRMEMFUNC, CLASS, GENFIELD, VFUNC, MEMACCESS, INHERITANCE,
+ FRIEND_CLASS, FRIEND_FUNC, MODIFIER, OBJECT_ID, TEMPLATE, TEMPLATE_ARG,
+ FUNC_TEMPLATE, LINK.
+ (hpread_psymtab_to_symtab_1): No changes from hpread.c
+ (hpread_psymtab_to_symtab): Make it a static function
+ (hpread_expand_symtab): Modified
+ (hpread_type_translate): If not typep.dntti.immediate do not abort,
+ but complain and return. Same for default action. Handle more HP_TYPEs.
+ (hpread_lookup_type): Initially allocate a correct-size type-vector.
+ (hpread_alloc_type): Reset type_addr only if a type was allocated.
+ (hpread_read_enum_type): If this has already a type associated, return.
+ (hpread_read_function_type): Do different things depending on whether
+ function is a MEMFUNC, a TEMPLATE, a FUNCTION som record.
+ Do not use the LOC_REGPARM_ADDR symbol class.
+ (hpread_read_struct_type): Handle classes and templates too. Major
+ rewrite.
+ (hpread_get_nth_template_arg): New function.
+ (hpread_read_templ_arg_type): New function.
+ (hpread_read_set_type): No change from hpread.c
+ (hpread_read_array_type): Modified
+ (hpread_read_subrange_type): Add handling of more DNTT entries.
+ added support for templates, classes, references, virtual functions.
+ (hpread_type_lookup): Handle DNNT_TYPE_MODULE.
+ (hpread_record_lines): No changes from hpread.c
+ (hpread_process_one_debug_symbol): Handle WITH, COMMON,
+ CLASS_SCOPE. Expand TAGDEF case to handle classes and templates.
+
+ * hppa-tdep.c (pa_do_strcat_registers_info): Has a new parameter,
+ precision, which is passed into the call to pa_strcat_fp_reg to
+ indicate whether to display the floating point registers using
+ single or double preceision.
+ (pa_strcat_registers): Introduce local variable, precision, and
+ pass it into call to pa_strcat_fp_reg.
+ (pa_strcat_fp_reg): Modified function. New parameter, precision,
+ used by function to decide whether to use single or double
+ precision. Also added the code to put a double precision value
+ into a buffer.
+
+ * hppa-tdep.c: Add'l includes <machine/save_state.h>,
+ <unistd.h>, declare pa_register_look_aside, define is_pa_2.
+ (rp_saved): Check for where to read the return pointer from.
+ (pa_do_registers_info): Handle is_pa_2. (pa_register_look_aside):
+ new function. (pa_print_registers): Handle is_pa_2.
+ (in_solib_call_trampoline): Handle a compiler/linker error.
+ (skip_trampoline_code): Changes to some masks used in examining
+ instructions. (inst_saves_fr): Test for FSTWS instruction.
+ (skip_prologue): Renamed to skip_prologue_hard_way.
+ (after_prologue): New function. (skip_prologue): New function.
+
+ * hppa-tdep.c (after_prologue): If f is NULL, don't dereference
+ it.
+
+ * hppa-tdep.c (after_prologue): If no debug info, return zero
+ telling caller that we need to find the end of the prologue via
+ the hard way (instruction examination).
+
+ * hppa-tdep.c (find_unwind_entry): Avoid dereferencing a null
+ pointer.
+
+ * hppa-tdep.c (hppa_pid_to_exec_file): Deleted -- no longer used.
+
+ * hppa-tdep.c (hppa_prepare_to_proceeed): Add prototype.
+ (read_unwind_info): Purecov comments, bug fixes.
+ (find_unwind_entry): Purecov comments, bug fixes.
+ (find_stub_with_shl_get): Purecov comments.
+ (frame_chain): Additional parens.
+ (hppa_push_arguments): Changes to commented out version of routine.
+ (hppa_fix_call_dummy): Purecov comments, fix location of end.o.
+ (in_solib_call_trampoline): Purecov comments.
+ (in_solib_return_trampoline): Purecov comments.
+ (setup_d_pid_in_inferior): Fix location of end.o.
+ (initialize_hp_cxx_exception_support): Fix location of end.o.
+ (child_enable_exception_callback): Purecov comments.
+
+ * hppa-tdep.c:
+ (Pa_do_strcat_registers_info): New routine. called by
+ tui/tuiRegs.c:_tuiRegisterFormat to place a register name
+ and value into a string buffer. Interface may change in
+ future. Checking this in so that we have something
+ functional for HP.
+ (pa_strcat_registers): New routine, called by
+ pa_do_strcat_registers_info. Does same thing as
+ pa_print_registers except it takes a stream parameter.
+ This routine should disappear in future. Checking in
+ so that we have something functional to give HP
+ (pa_strcat_fp_reg): New routine, called by
+ pa_do_strcat_registers_info and pa_strvat_registers
+ to place a floating point register name and value into
+ a buffer. This interface may change in future.
+ Checking in so that we have something functional to give HP.
+
+ * hppa-tdep.c: (Pa_print_fp_reg): Change prototype to match def'n.
+ (pa_register_look_aside): Fix comment immediately before function.
+
+ * hppa-tdep.c: Changes to better support stack unwinding,
+ reading and writing registers for HPUX. The HP folks had
+ an advantage ... access to a runtime architecture spec ;-}.
+ New includes: Ptrace.h
+ (internalize_unwinds): Initialize new fields in table.
+ (read_unwind_info): Entries in the table are now more complex
+ structures. References of the form ...->table[index].stub_type
+ are now ...->table[index].stub_unwind.stub_type.
+ (find_proc_framesize): Added a check for pc == 0.
+ (rp_saved): Entries in the table are now more complex
+ structures. References of the form ...->table[index].stub_type
+ are now ...->table[index].stub_unwind.stub_type.
+ (frameless_function_invocation): Stub_type becomes
+ stub_unwind.stub_type
+ (saved_pc_after_call): Stub_type becomes stub_unwind.stub_type
+ (hppa_frame_saved_pc): Stub_type becomes stub_unwind.stub_type
+ (frame_chain_valid): Stub_type becomes stub_unwind.stub_type
+ (hppa_call_dummy): Stub_type becomes stub_unwind.stub_type
+ (pa_print_fp_reg): Additional params to call val_print
+ (in_solib_call_trampoline): Stub_type becomes stub_unwind.stub_type
+ (in_solib_return_trampoline): Stub_type becomes stub_unwind.stub_typ
+ (skip_trampoline_code): Additional code to handle external
+ dyncalls. Also stub_type becomes stub_unwind.stub_type
+ (hppa_pid_to_exec_file): New funct. FOr HPUX 10.0 and beyond there
+ is an explicit ptrace request for getting the pathname associated
+ with a process id (pid).
+
+ * hppa-tdep.c: Fix for gcc compile on HPUX
+ (hppa_pid_to_exec_file): Remove unwanted param from
+ call to call_ptrace. Note, hppa_pid_to_exec_file goes
+ away in subsequent hp snapshots.
+
+ * hppa-tdep.c: Include bfd.h.
+ include dl.h
+ (args_for_find_stub): New structure.
+ (find_unwind_entry): Deal with null input pc value.
+ (rp_saved): Ditto.
+ For the import stub, return -24 always.
+ (hppa_frame_saved_pc): Save old pc value, to detect we are in a loop.
+ (init_extra_frame_info): Use TARGET_READ_FP.
+ (frame_chain): Include thread support.
+ If the caller's pc is zero, we loose and return, just like stack bottom.
+ Disable warning about being unable to find unwind info.
+ (hppa_push_arguments): Rewrite.
+ (hppa_value_returned_from_stack): New function. Handles returning a value
+ larger that 64 bits, stored on the stack.
+ (find_stub_with_shl_get): New function. To look up symbols in shlibs.
+ (cover_find_stub_with_shl_get): New function. Cover routine for
+ find_stub_with_shl_get to pass to catch_errors.
+ (hppa_fix_call_dummy): Comment out old stub mechanism. Rewrite using dyncall.
+ (target_read_fp): New function.
+ (pa_do_registers_info): Floating point registers start at FP4.
+ (pa_print_registers): Use FP4_REGNUM instead of 72.
+ (skip_trampoline_code): Do machine instruction matching for PA2.0.
+ (setup_d_pid_in_inferior): New function. Exception handling support.
+ (initialize_hp_cxx_exception_support): Ditto.
+ (child_enable_exception_callback): Ditto.
+ (child_get_current_exception_event): Ditto.
+
+ * hppah-nat.c (child_post_wait, child_post_follow_vfork,
+ child_post_follow_inferior_by_clone): New functions.
+
+ * hppah-nat.c (child_xfer_memory): Make sure the call to ptrace really
+ fails before we give up.
+ (hppa_pid_to_str): New function. Format a process id.
+ (hppa_tid_to_str): New function. Format a thread id.
+
+ * hppah-nat.c (child_xfer_memory): Use xmalloc, not alloca.
+ (child_post_wait): Delete.
+ (child_post_follow_vfork): Delete decl of child_ops; delete
+ large chunks of function -- let it be handled by the normal
+ mechanism that notices and handles exec events, in resume().
+
+ * hppah-nat.c (require_notification_of_exec_events): New function;
+ just notify of exec events, not all events, and just the specified
+ pid, don't include it's children (10.20 version).
+ (child_acknowledge_created_inferior): Call new function
+ require_notification_of_exec_events instead of
+ require_notification_of_events.
+
+ * hppah-nat.c [!GDB_NATIVE_HPUX_11]: Move HPUX 10.x-specific
+ support code here from infptrace.c.
+
+ * hppah-nat.c: Removed #define ptrace call_ptrace
+ replaced all calls to ptrace with calls to call_ptrace
+ (parent_attach_all): Removed call to ptrace
+
+ * hpread.c (hpread_psymtab_to_symtab_1): Change fflush to
+ gdb_flush; change stdout to gdb_stdout.
+ (hpread_psymtab_to_symtab): Change fflush to gdb_flush.
+
+ * hpread.h: New file. Includes all includes, struct defs, defines
+ from hpread.c.
+
+ * infcmd.c
+ (attach_command): New local variable, exec_file, added code to
+ determine exec_file from pid if exec_file is not already known,
+ call new target operation, target_post_attach -- a no-op unless
+ on HPUXHPPA
+ (detach_command): After detaching, do a SOLIB_RESTART
+
+ * infcmd.c (objfiles.h): Fix typo on include line.
+
+ * infcmd.c (run_command): Only call SOLIB_RESTART if it's
+ defined.
+ (detach_command): Ditto.
+
+ * infcmd.c:
+ (run_stack_dummy): Add calls to
+ disable_watchpoints_before_interactive_call_start and
+ enable_watchpoints_after_interactive_call_stops
+ (finish_command): Alter code handling the evaluation and printing
+ of the target function's return value.
+ (attach_command): When given a pid, but no exec file, try to determine
+ the exec file from the process. If the process does not record a
+ full path name, try to qualify the filename against the source path.
+ (_initialize_infcmd): Add some verbiage about how to use the attach command
+
+ * infcmd.c:
+ Include objfiles.h
+ (run_command): If program has already been started, and decide
+ to restart it, then kill the target, flush the caches,
+ call init_wait_for_inferior. Also purge old solib objfiles.
+
+ * infcmd.c: Changed calls to val_print, using a new macro,
+ SOLIB_RESTART
+ (run_command): Calls SOLIB_RESTART
+ (do_registers_info): Changed calls to val_print
+
+ * infcmd.c: Made the symfile.h include preceed the
+ objfiles.h include. The other ordering caused a
+ compile problem (incompletely defined types).
+
+ * inferior.h (REQUIRE_DETACH): Fix default definition.
+ * inftarg.c (child_post_attach): Fix declaration, make static.
+ (proc_wait): Make globally visible.
+ (child_insert_fork_catchpoint, etc): Fix return type.
+
+ * inferior.h (STARTUP_WITH_SHELL): New define.
+ (START_INFERIOR_TRAPS_EXPECTED): New define
+
+ * inferior.h (fork_inferior): Change fifth parameter to be a function
+ returning void.
+
+ * inferior.h (proc_wait): Declare.
+
+ * inferior.h:
+ (Require_ATTACH): New macro
+ (REQUIRE_DETACH): New macro
+ (detach): Definition is now an extern
+ (clone_and_follow_inferior): New definition, it's also an extern
+
+ * inferior.h:
+ (Require_attach): Default definition for require_attach funct
+ (require_detach): Default definition for require_detach funct
+ (pre_fork_inferior): New funct decl for function defined in
+ infptrace.c
+ (fork_inferior): New parameter in funct decl.
+
+ * inferior.h:
+ New variable decls: Inferior_ignoring_startup_exec_events,
+ inferior_ignoring_leading_exec_events -- these variables
+ are used when processing an exec call.
+ (CALL_DUMMY_HAS_COMPLETED): New default macro -- for targets
+ where PC in call dummy implies that call dummy has
+ completed. Note, that on HPUX this inference does not hold.
+
+ * infptrace.c
+ (require_notification_of_events): New function
+ (child_acknowledge_created_inferior): Previously named
+ hppa_acknowledge_forked_child. Also calling
+ require_notification_of_events and clearing some semaphore
+ variables
+ (child_post_startup_inferior): New function
+ (child_create_catch_fork_hook): Previously named
+ hppa_create_catch_fork_hook
+ (child_create_catch_vfork_hook): Previously named
+ hppa_create_catch_vfork_hook
+ (child_has_forked): Previously named hppa_target_has_forked
+ (child_has_vforked): Previously named hppa_target_has_vforked
+ (process_wait): Changed to call target_post_wait
+ (attach): Add call to require_notification_of_events
+ (child_pid_to_exec_file): New function
+ (hppa_require_attach): New local variable, pt_status
+ (hppa_get_process_events): New function
+
+ * infptrace.c (call_ptrace): Simplify control flow.
+ (proc_wait): Move here from inftarg.c, add target_post_wait call.
+
+ * infptrace.c (call_ptrace): Add some debugging code.
+
+ * infptrace.c (child_pid_to_exec_file): Declare variable.
+
+ * infptrace.c (kill_inferior): Clean up call to proc_wait.
+
+ * infptrace.c:
+ (Call_ptrace): When the ptrace request is PT_SETTRC,
+ call ptrace and then call parent_attach_all.
+
+ * infptrace.c:
+ (Child_has_syscall_event): New function. only applicable
+ (for now) on HPUX 10.30 and beyond via the ttrace call.
+ In infptrace.c there is a default operation.
+ With ttrace, it is possible to tell the kernel to
+ notify the debugger that the target program is about to make
+ or return from a syscall.
+ (child_thread_alive): New function. a default function.
+ ptrace doesn't support kernel threads.
+ (hppa_enable_page_protection_events): Defualt function
+ (hppa_disable_page_protection_events): Default function
+
+ * infptrace.c (child_pid_to_exec_file): Fix number of params to
+ cal_ptrace call.
+
+ * infptrace.c (hppa_pid_or_tid_to_str): New function.
+ (hppa_switched_threads): New function.
+ (hppa_ensure_vforking_parent_remains_stopped): New function.
+ (hppa_resume_execd_vforking_child_to_get_parent_vfork): New function.
+
+ * infptrace.c: Most of the changes found in infptrace.c should
+ be moved to hppah-nat.c
+ (PT_VERSION): A new define
+ (startup_semaphore_t): A new struct type. it is used to
+ coordinate the parent and child processes after a fork and
+ before an exec on HPUX.
+ (call_ptrace): Changes to determine whether the ptrace
+ request is for starting the tracing of the target process.
+ (parent_attach_all): New funct. used on HPUX for coordinating
+ the parent and child processes after a fork and before and exec.
+ (hppa_acknowledge_forked_child): New funct. prabably belongs
+ in hppah-nat.c
+ (hppa_enable_catch_fork): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_disable_catch_fork): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_create_catch_fork_hook): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_enable_catch_vfork): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_disable_catch_vfork): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_create_catch_vfork_hook): New funct. probably belongs to
+ hppah-nat.c
+ (hppa_target_has_forked): New funct. probably belongs in
+ hppah-nat.c
+ (hppa_target_has_vforked): New funct. probably belongs in
+ hppah-nat.c
+ (process_wait): New funct. also ifdefed for proc_wait.
+ (kill_inferior): Call proc_wait rather than wait. this is
+ pretty hacky.
+ (pre_fork_inferior): New function. used only by HPUX.
+ probably should be defined elsewhere.
+
+ * infrun.c (follow_inferior_fork): Only define on HP.
+ (wait_for_inferior): Only call SOLIB_IN_DYNAMIC_LINKER if we have
+ shared libraries; restore test of IN_SOLIB_DYNSYM_RESOLVE_CODE
+ removed by HP.
+
+ * infrun.c (normal_stop): Add a call to the TUIDO
+ macro just before the annotate_stopped label. This
+ updates the windows after each program stop.
+
+ * infrun.c (normal_stop): Verify stop_command is non-zero before
+ dereferencing it (it won't be set if dbx_commands is set).
+
+ * infrun.c (resume): Add #ifdef HPPAHPUX around HPUX-specific
+ code.
+
+ * infrun.c (resume): Add missing semicolon.
+
+ * infrun.c (wait_for_inferior): Fix syntax error.
+
+ * infrun.c (follow_fork_mode_kind_names): Removed "both" option.
+ (follow_fork): Added parameters. additional code for handling
+ following of parent, following of child
+ (resume): Added code for deciding how to resume in presence of
+ fork. Additional params to follow_fork call.
+
+ * infrun.c (follow_exec): Ifdef for HPUXHPPA for the moment, the
+ code in here assumes the existance of the child_ops target
+ vector. This is incorrect for Solaris.
+
+ * infrun.c (resume): Fixed ifdefs, HPPAHPUX -> HPUXHPPA.
+
+ * infrun.c (wait_for_inferior): Fixed a matching parens problem --
+ matching curly brace inside ifdefed code which is not being
+ compiled. Change local validFlag to be an 'int' rather than a
+ 'bool' and fixed the corresponding assignment statements.
+
+ * infrun.c:
+ Two new global variables: Inferior_ignoring_startup_exec_events and
+ inferior_ignoring_leading_exec_events.
+ New static variables: Parent_of_vfork_trap_expected_and_ignorable,
+ step_resume_breakpoint, through_sigtramp_breakpoint, pending_follow,
+ follow_vfork_when_exec
+ (follow_inferior_fork): Does what follow_fork did!
+ (follow_fork): Is now a wrapper function for follow_inferior_fork
+ (follow_vfork): Is now a wrapper function for follow_inferior_fork
+ (follow_exec): New function, handles an exec event.
+ (resume): Remove 3 local variables: Child_pid, has_forked, has_vforked.
+ move and expand code that tries to follow a fork (i.e. also check
+ for vfork and exec
+ (init_wait_for_inferior): Initialize the new structure, pending_follow
+ (delete_breakpoint_current_contents): When deleting all the breakpoints also
+ set the breakpoint struct pointer to NULL.
+ (wait_for_inferior): A number of changes.
+ The step_resume_breakpoint and through_sigtramp_breakpoint local
+ variables are now visible in entire module.
+ Changed name of variable from child_inferior_pid to saved_inferior_pid.
+ Added several cases to the event processing switch statement:
+ Target_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED, TARGET_WAITKIND_EXECD.
+ Also, for TARGET_WAITKIND_STOPPED, check to see if expecting a trap
+ from the parent of a vfork (ignorable) otherwise break as usual.
+ When determining the value of 'random_signal' (0 or 1), no longer check for
+ catchpoints.
+ When determining how to handle unexpected signals, must now take into
+ account fork, vfork, and exec.
+ Change call to PC_IN_CALL_DUMMY to a call to CALL_DUMMY_HAS_COMPLETED
+ At stop_stepping label, check to see if stopped for fork or
+ vfork event.
+
+ * infrun.c: New code is related to threads and fork/vfork/exec.
+ New static variable: Thread_step_needed
+ Deleted static variable: Parent_of_vfork_trap_expected_and_ignorable
+ Altered the pending_follow and fork_event structs
+ (follow_inferior_fork): Before detaching from child and removing
+ all breakpoints form it -- but only if forking or following
+ vforks as soon as they happen. Also reset the solib inferior hook.
+ The same kind of logic applies to hitting step_resume_breakpoints
+ (calling breakpoint_re_set_thread) and to resetting and inserting
+ breakpoints.
+ (follow_exec): Forward decl
+ (follow_vfork): Check to see if gdb followed the child. If
+ the child exec'd before gdb saw the parent's vfork event
+ then call follow_exec.
+ (follow_exec): If the exec occured after a vfork, then follow
+ the vfork as well. Do it before following the exec.
+ Make sure to update breakpoints after and exec
+ (resume): New local variable, should_resume.
+ Change parameters in calls to follow_fork, follow_vfork, and
+ follow_exec. Some changes to the way various pending_follow.kind
+ situations are handled (there's TARGET_WAITKIND_FORKED,
+ TARGET_WAITKIND_VFORKED, ARGET_WAITKIND_EXECD. Some additional
+ conditions to check before deciding to resume the target (i.e.
+ should_resume=1, stepping?, thread_step_needed?i, regular
+ resume?)
+ (proceed): When proceeded at location that does not have a breakpoint
+ set thread_step_needed=0 to indicate that it is not necessary to
+ single step thread over breakpoint. SOme additional checks to see
+ if it is necessary to step thread over breakpoint.
+ (start_remote): Remove call to clear_proceed_status.
+ (init_wait_for_inferior): Initialize new fields in fork_event
+ structure and add a call to clear_proceed_status.
+ (wait_for_inferior): New local variable: New_thread_event.
+ Initialize thread_step_needed = 0.
+ Minor massaging of conditions for adding a new thread to the thread list.
+ No longer resuming execution after adding a new thread. Let user play with thread first.
+ Some changes in the way TARGET_WAITKIND_FORKED, ARGET_WAITKIND_VFORKED,
+ TARGET_WAITKIND_EXECD are handled -- this is all HPUX related.
+ Simplified TARGET_WAITKIND_STOPPED -- HP previously had some
+ more complicated code in here.
+ Moved the code to resume threads to after the large case statement that processes the events.
+ Additional processing for stop_signal=TARGET_SIGNAL_TRAP.
+ Cleanup code at process_event_stop_test label.
+ Set thread_step_needed when processing a BPSTAT_WHAT_SINGLE.
+ Minor massaging of fork/vfork/exec part of stop_stepping code.
+ (normal_stop): Minor changes. calling show_and_print_stack_frame.
+ (xdb_handle_command): New function
+ (_initialize_infrun): Handle xdb_commands. also handle dbx commands
+
+ * infrun.c: Changes to support following forks, and handling
+ catchpoints.
+ (follow_fork_mode_kind_names): New array
+ (follow_fork): New function. implements the follow parent,
+ or child functionality.
+ (resume): Additions to check whether the target process
+ just forked and decide which process to follow.
+ (wait_for_inferior): Additional variables (child_inferior_pid,
+ stepping_through_solib_after_catch,
+ - stepping_through_solib_catchpoints.
+ - Altered CURRENTLY_STEPPING macro to check for stepping through
+ a shared library after hitting a catchpoint.
+ - Add parameters to save_infrun_state call
+ - Check for fork and vfork when deciding if event is a random
+ signal
+ - When considering stops due to breakpoints, check for
+ BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK
+ - Check for stop due to an explicit catchpoint
+ - When checking for single stepping event, also check for
+ stepping to get out of dynamic linker's hook after catching
+ a shlib event
+ (is_internal_shlib_eventpoint): New funct. check to see if
+ event type is bp_shlib_event.
+ (stopped_for_internal_shlib_event): New funct. check for shlib
+ events
+ (stopped_for_shlib_catchpoint): New funct. check for catchpoints.
+ (normal_stop): Additions to check for shlib event
+ (set_follow_fork_mode_command): New funct. handles the new follow
+ fork command.
+ (_initialize_infrun): Additions for follow-fork-mode command.
+
+ * infrun.c: Ifdefing references to
+ switched_from_inferior_pid for HPUXHPPA. They don't seem
+ useful for Solaris (i.e. non-HPUX)
+
+ * infrun.c: Included tuiData.h and tuiDataWin.h, ifdefed for TUI.
+ Included top.h. New static variables: Switched_from_inferior_pid,
+ number_of_threads_in_syscalls.
+ (follow_inferior_fork): If there is a step_resume breakpoint
+ explicitly reset the thread number.
+ (resume): For TARGET_WAITKIND_VFORKED, removed a check for getting
+ the vfork event to soon.
+ (init_wait_for_inferior): Added parameter to call to
+ breakpoint_init_inferior. Initialize number_of_threads_in_syscalls.
+ (wait_for_inferior): New local variables: Prev_sal,
+ enable_hw_watchpoints_after_wait, stepping_through_sigtramp,
+ stepped_after_stopped_by_watchpoint. Enable watchpoints after a wait.
+ Added cases for TARGET_WAITKIND_SYSCALL_ENTRY and
+ TARGET_WAITKIND_SYSCALL_RETURN.
+ Do additional processing if stop due to breakpoint, but breakpoint is
+ only valid for a thread other than the one currently running. Additional
+ parameters to save_infrun_state and load_infrun_state. Some additional
+ processing for BPSTAT_WHAT_STEP_RESUME. Some additional processing to
+ handle stepping over a function.
+ (normal_stop): Added notification of switching threads. ifdefing some
+ TUI changes and leaving out non-essential TUI changes.
+ (restore_selected_frame): Ifdefing some TUI changes
+ (restore_inferior_status): Ifdefing some TUI changes
+
+ * infrun.c: Removed the TUI ifdefs and TUI code. Also removed
+ include for top.h. HP introduced this. I'm taking it out.
+
+ * inftarg.c (child_detach_from_process): Declare.
+ (child_attach_to_process): Declare.
+ (child_stop): Make static to match declaration.
+
+ * inftarg.c (ptrace_him): Change prototype back to return int.
+
+ * inftarg.c (ptrace_me): Remove debug output, pass NULL to
+ fork_inferior if not HPUX.
+
+ * inftarg.c:
+ (child_require_attach): New funct prototype and definition
+ (child_require_detach): New funct prototype and definition
+ (proc_wait): Funct prototype and definition are enclosed by
+ proc_wait ifndef
+ (child_attach_to_process): New function, does most of the
+ work that child_attach used to do and some additional
+ work to determine whether gdb is already attached to the
+ target how to react.
+ (child_attach): Altered. It's now a wrapper for
+ child_attach_to_process.
+ (child_require_attach): New function, called if should attach
+ even when gdb is already attached to target.
+ (child_detach_from_process): New function, does most of the
+ work that child_detach used to do and some additional work
+ to determine whether gdb is currently attached to the target.
+ (child_detach): Altered. It's now a wrapper for
+ child_detach_from_process.
+ (child_require_detach): New function, called if should try to
+ detach even when gdb is not attached to target.
+ (ptrace_him): Calls a new function, target_acknowledge_forked_child.
+ Currently, target_acknowledge_forked_child, is only defined to
+ do something for HPUX.
+ (child_create_inferior): Changed call to fork_inferior.
+ (child_ops): Added to_require_attach and to_require_detach fields
+ to the child_ops target ops vector.
+
+ * inftarg.c:
+ Some hacks for ttrace work
+ (child_wait): Additional local variables, additional code in
+ while loop to check for: Process exited, process forked,
+ process vforked, process execd
+ (child_thread_alive): John B. seems to think that the kill
+ call is inapproapriate for HPUX.
+ (child_attach_to_process): Using strtol rather than atoi.
+ no longer check for case where there is no known exec file.
+ (child_post_attach): New function, a default, a no-op
+ (child_insert_fork_catchpoint): New function, a default, a no-op
+ (child_remove_fork_catchpoint): New function, a default, a no-op
+ (child_create_catch_fork_hook): Deleted
+ (child_create_catch_vfork_hook): Deleted
+ (child_insert_vfork_catchpoint): New function, a default, a no-op
+ (child_remove_vfork_catchpoint): New function, a default, a no-op
+ (child_can_follow_vfork_prior_to_exec ):new function, a default,
+ a no-op
+ (child_insert_exec_catchpoint): New function, a default, a no-op
+ (child_remove_exec_catchpoint): New function, a default, a no-op
+ (child_has_execd): New function, a default, returns 0
+ (child_reported_exec_events_per_exec_call): New function, a
+ default, returns 1
+ (child_has_exited): New function, a default.
+ (child_core_file_to_sym_file): New function, a default, returns NULL.
+ (child_ops): Initialize new target_ops vector fields to the
+ child* functions.
+ * infptrace.c:
+ (Call_ptrace): For HPUX, handle additional requests: Pt_CONTIN1,
+ PT_STEP1.
+ (require_notification_of_events): Add several signals to the
+ set of events requiring notification: Ptrace_SIGNAL,
+ PTRACE_EXEC, PTRACE_FORK, PTRACE_VFORK
+ (child_acknowledge_created_inferior): This function is only
+ defined if CHILD_ACKNOWLEDGE_CREATED_INFERIOR is defined.
+ (child_post_startup_inferior): Function is only defined if
+ CHILD_POST_STARTUP_INFERIOR is defiend. Also, now call
+ require_notification_of_events.
+ (child_create_catch_fork_hook): Deleted
+ (child_create_catch_vfork_hook): Deleted
+ (child_insert_fork_catchpoint): New function
+ (child_remove_fork_catchpoint): New function
+ (child_insert_vfork_catchpoint): New function
+ (child_remove_vfork_catchpoint): New function
+ (child_has_forked): Now enclosed by a CHILD_HAS_FORKED ifdef
+ (child_has_vforked): Now enclosed by CHILD_HAS_VFORKED ifdef
+ (child_can_follow_vfork_prior_to_exec): New function
+ (child_insert_exec_catchpoint): New function
+ (attach): Removed call to require_notification_of_events
+ (child_post_attach): New function, call to
+ require_notification_of_events moved here.
+ (child_pid_to_exec_file): New enclosed by CHILD_PID_TO_EXEC_FILE ifdef
+ introduced the concept of a saved_inferior_pid
+ (hppa_require_attach): Add some code to decide if gdb is already
+ attached to process. Can not figure this out via a ptrace call.
+ (hppa_insert_hw_watchpoint): New function
+ (hppa_remove_hw_watchpoint): New function
+
+ * inftarg.c:
+ (child_attach_to_process): Change position in file
+ (child_detach_from_process): Change position in file
+
+ * inftarg.c:
+ (child_attach_to_process): Changed parameter to child_wait call
+
+ * inftarg.c:
+ (child_post_wait): New function declaration and definition
+ (ptrace_him):
+ - change return value to a void.
+ - change target_acknowledge_forked_child call to
+ target_acknowledge_created_inferior
+ - call target_post_startup_inferior rather than returning pid.
+ (child_attach_to_process): Change param name, fail_if_already_attached
+ -> after_fork.
+ Invert a couple of if-then-else statments.
+ Use REQUIRE_ATTACH macro
+ (child_attach): Change params in child_attach_to_process call
+ (child_require_attach): Change params in child_attach_to_process call
+ (child_detach_to_process): Change param name,
+ fail_if_already_attached -> after_fork.
+ Invert a couple of if-then-else statments.
+ Use REQUIRE_DETACH macro
+ (child_detach): Change params in child_detach_from_process call
+ (child_require_detach): Change params in child_detach_from_process
+ call
+ (child_post_startup_inferior): New function
+ (child_acknowledge_created_inferior): New function
+ (child_clone_and_follow_inferior): New function
+ (child_post_follow_inferior_by_clone): New function
+ (child_create_catch_fork_hook): New function
+ (child_create_catch_vfork_hook): New function
+ (child_has_forked): New function
+ (child_has_vforked): New function
+ (child_post_follow_vfork): New function
+ (child_stop): No longer a static function
+ (child_pid_to_exec_file): New function
+
+ * inftarg.c:
+ (child_wait): Child_pid becomes related pid. return pid
+ rather than inferior_pid. Changes are in code handling fork
+ and vfork
+
+ * inftarg.c:
+ Include gdb_stat.h and sys/unistd.h
+ (child_wait): New local variables. Check for live threads.
+ Check for syscall events
+ (child_thread_alive): No longer a static funct.
+ (ptrace_him): Remove some code inserted in snap3
+ (child_create_inferior): Added a bunch of code to handle a
+ bad interaction between start-up-with-shell and the HP
+ catch-fork/catch-exec logic. I am ifdefing this for
+ HPUXHPPA for now.
+ (child_has_syscall_event): New default target_ops function
+ (child_enable_exception_callback): New default target_ops function
+ (child_get_current_exception_event): New default target_ops function
+ (child_ops): 3 new fields
+
+ * inftarg.c: Remove HPUX_SNAP1 and HPUX_SNAP2 ifdefs
+
+ * inftarg.c: Reverted previous change.
+
+ * infttrace.c (hppa_remove_hw_watchpoint): Fix check for write
+ access hardware watchpoint.
+
+ * infttrace.c (proc_wait): Rename from proc_wait.
+
+ * infttrace.c (require_notification_of_exec_events): New function;
+ just notify of exec events, not all events, and just the specified
+ pid, don't include it's children.
+ (child_acknowledge_created_inferior): Call new function
+ require_notification_of_exec_events instead of
+ require_notification_of_events.
+ (child_post_startup_inferior): Call require_notification_of_events
+
+ * infttrace.c: Changed all references to boolean to int.
+ Changed all references to TRUE and FALSE to 1 and 0.
+
+ * irix5-nat.c (symbol_add_stub): Add params to call to
+ symbol_file_add.
+
+ * jv-lang.c (get_dynamics_objfile): Add 2 more parameters to call
+ to allocate_objfile.
+
+ * main.c (fputs_unfiltered): Changes to prevent cursor form
+ jumping around in the TUI. Altered where tuiTermUnsetup and
+ tuiTermSetup are called
+
+ * main.c (fputs_unfiltered): Changed function so that it
+ checks to see if output is to a string buffer or to a
+ FILE stream and does the correct action (i.e. strcat or
+ fputs). Fixed params for fputs call.
+
+ * main.c (fputs_unfiltered): Don't try to call the TUI's
+ CommandCharCount functions when the TUI isn't enabled.
+
+ * main.c (fputs_unfiltered): Change FILE to GDB_FILE.
+
+ * main.c (main): If the user gives the --version or --help flags,
+ disable the TUI.
+
+ * main.c (tui_version, xdb_commands, dbx_commands): New variables.
+ (main): New command line arguments --tui, --xdb, --dbx; add call
+ to tyiCleanUp via tuiDo to main loop.
+ (fputs_unfiltered): Tui related changes.
+
+ * main.c: Define 2 new global variables, gdb_stdout and gdb_stderr
+ of type GDB_FILE.
+ (main): Allocate space for and initialize gdb_stdout and gdb_stdin.
+
+ * objfiles.c (find_pc_sect_section): Make end condition be less
+ than s->endaddr, not less than or equal to s->endaddr.
+
+ * objfiles.c:
+ (allocate_objfile): 2 new parameters: User_loaded and is_solib.
+ When appropriate, record in the object file that it is user loaded.
+ The run command can use this information to purge object file
+ entries associated with the old inferior and keep user loaded
+ object files loaded via the add-symbol-file command.
+ (objfile_purge_solibs): New function. deletes all objectfile entries
+ that are not explicitly loaded by the user.
+
+ * objfiles.c:
+ (objfile_relocate): Check for LOC_INDIRECT
+ (find_pc_sect_section): Change condition from
+ pc < s->endaddr to pc <= s->endaddr
+
+ * objfiles.h:
+ New variables: User_loaded and is_solib
+ (OBJF_SHARED): New macro. used to distinguish objfile for
+ shared library from "vanilla" objfile.
+ (allocate_objfile): Add new parameters to function decl.
+ (objfile_purge_solibs): New function decl.
+
+ * objfiles.h: Add some typedefs: Importentry, ExportEntry.
+ Add some new variables: Import_list, import_list_size,
+ export_list, export_list_size
+
+ * osfsolib.c:
+ (symbol_add_stub): Added params to call to symbol_file_add
+
+ * pa/hpux1020.mh (NATDEPFILES): Add corelow.o, symbol table and
+ solib files.
+
+ * pa/hpux1100.mh (NAT_FILE): Use nm-hppah11.h.
+ (NATDEPFILES): Add symbol table and solib files.
+
+ * pa/nm-hppah11.h: New file, HPUX11-only definitions.
+
+ * pa/tm-hppa.h (proc_wait): Remove decl and macro.
+
+ * parse.c (write_dollar_variable): Handle cases in which variables
+ besides the debugger ones start with $ and $$.
+ (parse_nested_classes_for_hpacc): New function. Parse a string that
+ is possibly a namespace / nested class specification.
+ (find_template_name_end): New function.
+
+ * procfs.c:
+ (procfs_init_inferior): Return value is now a void.
+
+ * procfs.c (procfs_ops): Initializing new target ops vector fields. see list below.
+
+ * procfs.c:
+ (procfs_ops): Adding new target_ops vector fields and
+ removing a few. see list below
+
+ * procfs.c: Added new fields to procfs_ops.
+ Necessary since we still have oldstyle initialization in
+ this file
+
+ * pyr-tdep.c (pyr_do_registers_info): Change stdout to gdb_stdout.
+ (frame_locals_address): Change stderr to gdb_stderr.
+ (frame_args_addr): Ditto.
+
+ * pyr-xdep.c (fetch_inferior_registers): Change stderr to
+ gdb_stderr.
+
+ * serial.c (serial_close): Call gdb_fclose, not fclose on a
+ GDB_FILE.
+
+ * serial.c (serial_logchar): Change chtype to ch_type. sigh.
+
+ * solib.c (look_for_base): The parameter to file must be
+ of type FILE *. So cast exec_bfd -> iostream in the call
+ to fileno as a FILE *, not a GDB_FILE *. This will work because
+ exec_bfd -> iostream is declared and given a value in bdf and
+ bfd will continue to use FILE rather than GDB_FILE.
+
+ * solib.c:
+ (solib_add): Remove references to exec_ops.
+
+ * solib.c:
+ (solib_add): Update exec_ops.to_sections
+
+ * solib.c:
+ (symbol_add_stub): Added params to call to symbol_file_add
+
+ * solib.h:
+ (SOLIB_REMOVE_INFERIOR_HOOK): New macro. defined to 0.
+ functionality not implemented for this target.
+
+ * solib.h: Added macro definitions. These macros generate
+ error messages for solaris??
+ (SOLIB_CREATE_CATCH_LOAD_HOOK)
+ (SOLIB_CREATE_CATCH_UNLOAD_HOOK)
+ (SOLIB_HAVE_LOAD_EVENT)
+ (SOLIB_LOADED_LIBRARY_PATHNAME)
+ (SOLIB_HAVE_UNLOAD_EVENT)
+ (SOLIB_UNLOADED_LIBRARY_PATHNAME)
+ (SOLIB_IN_DYNAMIC_LINKER)
+ (SOLIB_RESTART)
+
+ * somread.c (is_in_import_list): Ditto.
+
+ * somread.c (som_symfile_read): Added some comments
+
+ * somread.c (som_symfile_read): Read in import and export lists.
+ (som_symtab_read): Change test for dynamic executable.
+ (is_in_import_list): New function. Check if a given symbol name
+ is in the import list.
+ (init_import_symbols): New function. Read in and initialize the
+ som import list.
+ (init_export_symbols): New function. Read in and initialize the
+ som export list.
+
+ * somread.c:
+ (som_symfile_read): Fix missing comment delimiters
+
+ * somsolib.c (DLD_FLAGS_MAPPRIVATE): New macro.
+ Define bit of __dld_flags in HP-UX a.out files.
+ (DLD_FLAGS_HOOKVALID): Ditto.
+ (DLD_FLAGS_LISTVALID): Ditto.
+ (DLD_FLAGS_BOR_ENABLE): Ditto.
+ (som_solib_total_st_size): Cumulative size in bytes of the
+ symbol tables of all shared objects on the so_list_head list.
+ (som_solib_st_size_threshhold_exceeded): Threshold for adding symbols
+ for shlibs.
+ (som_solib_sizeof_symbol_table): New function. Computes size of
+ symbol table for a shlib.
+ (som_solib_load_symbols): New function. Load symbols from shlib.
+ (som_solib_add): Detect if __dld_list is not valid.
+ Record main program's symbol table size.
+ Load symbols if called from command line.
+ Keep threshold into account when loading shlib symbols.
+ (som_solib_create_inferior_hook): Use dld_flags macros.
+ (som_sharedlibrary_info_command): Let user know if symbols were
+ not loaded.
+ (som_solib_restart): Discard all the shlibs descriptors.
+ (_initialize_som_solib): Chenge help message for auto-solib-add
+ command.
+ Set threshold for symbol table to 50 megabytes.
+
+ * somsolib.c (_initialize_som_solib): Added call to som_solib_restart.
+ (som_solib_restart): New function
+ (som_solib_in_dynamic_linker): New function
+ (som_solib_desire_dynamic_linker_symbols): New function
+ (som_solib_unloaded_library_pathname): New function
+ (som_solib_loaded_library_pathname): New function
+ (som_solib_library_pathname): New function
+ (som_solib_have_unload_event): New function
+ (som_solib_have_load_event): New function
+ (som_solib_create_catch_unload_hook): New function
+ (som_solib_create_catch_load_hook): New function
+ (som_solib_create_inferior_hook): Rewritten
+ dld_cache: New struct
+ addr_and_unwind_t: New struct
+ (find_unwind_entry) added prototype
+
+ * somsolib.c (som_solib_create_inferior_hook): Introduce new local
+ msymbol2 and change some msymbol's to msymbol2's -- was clobbering
+ msymbol, passing a NULL to lookup_minimal_symbol_solib_trampoline,
+ and ultimately core dumping with a SEGV.
+
+ * somsolib.c:
+ Include assert.h
+ (som_solib_mapped_entry): Additional comments for text_addr,
+ text_link_addr, text_end, and tsd_start_addr fields. Commenting
+ out 2 tsd fields, __data_start and __data_end.
+ (som_solib_add_solib_objfile): Add params to calls to symbol_file_add.
+ Add some code for distinguishing between a shared library and other
+ objfiles. This appears to be a prelude to thread local storage.
+ (som_solib_load_symbols): Changes to printf statement
+ enclosed by SOLIB_DEBUG ifdef.
+ (som_solib_add): Change comment to correctly specify path
+ to end.o -- /opt/langtools/lib/end.o. changes to printf statement
+ enclosed by SOLIB_DEBUG ifdef.
+ Removed several SOLIB_DEBUG ifdefs and the associated printfs.
+ Add code to find the start address for the object file's thread
+ local storage
+ (som_solib_create_inferior_hook): Fix warning messages use correct
+ path to end.o -- /opt/langtools/lib/end.o. Change control flow.
+ No longer user early returns from function is cases of error.
+ (reset_inferior_pid): New function
+ (som_solib_remove_inferior_hook): New function
+ (so_lib_thread_start_addr): New function. used for tsd.
+
+ * somsolib.c: Removed references to ASSERT macro.
+
+ * somsolib.c: Add debugging macro.
+ (struct som_solib_mapped_entry): Add new field tsd_start_addr.
+ (struct so_list): Added new field solib_addr.
+ (som_solib_add_solib_objfile): New function.
+ (som_solib_load_symbols): Rewritten.
+ (som_solib_add): Make sure we don't load the symbols in if the
+ threshold was exceeded.
+ (som_solib_get_solib_by_pc): New function. Return the address of
+ handle of the shared library.
+ (som_solib_restart): Disable breakpoints at restart.
+ (_initialize_som_solib): Set threshold to 100 megabytes.
+
+ * somsolib.c: Add include of fcntl.h so that O_RDONLY is defined.
+
+ * somsolib.h (DISABLE_UNSETTABLE_BREAK): New macro.
+ (PC_SOLIB): New macro.
+
+ * somsolib.h:
+ (SOLIB_CREATE_CATCH_LOAD_HOOK): Define
+ (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Define
+ (SOLIB_HAVE_LOAD_EVENT): Define
+ (SOLIB_LOADED_LIBRARY_PATHNAME): Define
+ (SOLIB_HAVE_UNLOAD_EVENT): Define
+ (SOLIB_UNLOADED_LIBRARY_PATHNAME): Define
+ (SOLIB_IN_DYNAMIC_LINKER): Define
+ (SOLIB_RESTART): Define
+
+ * somsolib.h:
+ (SOLIB_REMOVE_INFERIOR_HOOK): New macro. defined to use
+ som_solib_remove_inferior_hook.
+
+ * somsolib.h:
+ (som_solib_create_catch_load_hook)
+ (som_solib_create_catch_unload_hook)
+ (som_solib_have_load_event)
+ (som_solib_loaded_library_pathname)
+ (som_solib_have_unload_event)
+ (som_solib_unloaded_library_pathname)
+ (som_solib_in_dynamic_linker)
+ Fix prototypes to use type names, not parameter names.
+
+ * source.c (find_source_lines): Make non static.
+ (open_source_file): Ditto.
+ (source_full_path_of): New function.
+ (print_source_lines): Rename to print_source_lines_base and make
+ static; formatting.
+ (print_source_lines): New function.
+ (forward_search_command): Tui changes.
+ (reverse_search_command): Tui changes.
+ (_initialize_source): Add xdb and dbx compatibility commands.
+
+ * source.c (list_command): Handle case of odd number of source
+ lines to display.
+
+ * source.c:
+ (source_full_path_of): New function. file was overlooked
+ in merge ;-/.
+
+ * stack.c (func_command): Make high bound be <, not <=.
+
+ * stack.c (_initialize_stack): For the backtrace command, delete
+ the help line about usage, since this has to be a valid help
+ message for the 'where' command too.
+
+ * stack.c (current_frame_command): Add a check for the
+ existance of a stack. If there is no stack produce an
+ error message and exit.
+
+ * stack.c (down_silently_base, up_silently_base,
+ args_plus_locals_info, print_frame_info_base,
+ print_stack_frame_base, print_stack_frame_base_stub): Declare.
+ (print_frame_local_vars): Add'l parameter.
+ (print_stack_frame_stub): New version created, old version renamed
+ to show_and_print_stack_frame_base_stub.
+ (print_stack_frame_base_stub, print_only_stack_frame_stub,
+ show_and_print_stack_frame, print_only_stack_frame,
+ stack_publish_stopped_with_no_frame, print_frame_info,
+ show_stack_frame, backtrace_full_command, args_plus_locals_info,
+ select_and_print_frame, select_and_maybe_print_frame,
+ current_frame_command, func_command): New functions.
+ (backtrace_command): New function, old renamed to
+ backtrace_command_1.
+ (print_block_frame_locals, print_frame_local_vars): Additional
+ parameter, number of tabs.
+ (up_silently_command): New function, old renamed to
+ up_silently_command_base.
+ (down_silently_command): New function, old renamed to
+ down_silently_base.
+ (_initialize_stack): Register new commands based on values of
+ xdb_commands and dbx_commands variables.
+
+ * stack.c (func_command): Make high bound be <, not <=.
+
+ * stack.c (parse_frame_specification): Fix prototype to match
+ function definition.
+ (show_and_print_stack_frame_stub): Fix name.
+ (select_and_print_frame): Change uncaught tuiDO call.
+
+ * stack.c (up_silent_base): Rename from up_silently_command_base.
+
+ * symfile.c (symbol_file_command): Only call SOLIB_RESTART if it's
+ defined.
+
+ * symfile.c (add_psymbol_with_dem_name_to_list): New function.
+ Adds a symbol with a long value to a psymtab. Differs from
+ add_psymbol_to_list in taking both a mangled and a demangled name.
+
+ * symfile.c (compare_psymbols): Call strcmp directly, instead of
+ using macro.
+
+ * symfile.c (symbol_file_add): Reindent portions.
+ (symbol_file_command): Add call to tuiDo.
+
+ * symfile.c (symbol_file_command): Only call SOLIB_RESTART if it's
+ defined.
+
+ * symfile.c (symfile_bfd_open): Add code to call PXDB on hpux, if
+ the file has not already been processed by pxdb.
+ Added define USE_PXDB.
+
+ * symfile.c (symfile_bfd_open): Change parenthesis positioning
+ around call to hpread_pxdb_check.
+
+ * symfile.c (symfile_bfd_open): Make not static.
+ (RESET_HP_UX_GLOBALS): New macro. Resets globals when new symbol
+ file loaded.
+ (USE_PXDB): Not needed. Removed.
+ (symbol_file_add): Add HP specific code to deal with pxdb.
+ (symbol_file_command): Reset HP specific globals if new symbol file
+ loaded.
+ (symfile_bfd_open): Comment out checking for pxdb.
+ (reread_symbols): Reset HP specific globals.
+
+ * symfile.c (symfile_bfd_open): Uncomment hpus specific code.
+
+ * symfile.c:
+ (symbol_file_add): Add user_loaded and is_solib parameters.
+ fixed number of parameters in call to allocate_objfile
+ (symbol_file_command): Added call to SOLIB_RESTART macro.
+ fixed number of parameters in calls to symbol_file_add.
+ (add_symbol_file_command): Fixed number of parameters in calls to
+ symbol_file_add.
+
+ * symfile.c: Added prototype for hpread_pxdb_check.
+
+ * symfile.c: Changed HPUX_SNAP1 ifdef to HPUXHPPA. enclosed calls to
+ RESET_HP_UX_GLOBALS with an HPUXHPPA ifdef
+
+ * symfile.h (symfile_bfd_open): Add protptype.
+
+ * symfile.h: Add prototype for add_psymbol_with_dem_name_to_list.
+
+ * symfile.h: Clarify purpose of auto_solib_add.
+
+ * symmisc.c (maintenance_print_symbols): Call gdb_fclose, not
+ fclose on a GDB_FILE* during cleanup.
+ (maintenance_print_psymbols): Call gdb_fclose, not fclose on a
+ GDB_FILE* during cleanup.
+ (maintenance_print_msymbols): Call gdb_fclose, not fclose on a
+ GDB_FILE* during cleanup.
+
+ * symmisc.c (maintenance_print_symbols): Gdb_fclose now takes a
+ GDB_FILE ** parameter. Fix the local GDB_FILE variables and the
+ call to make_cleanup.
+ (maintenance_print_psymbols): Ditto
+ (maintenance_print_msymbols): Ditto
+
+ * symmisc.c (print_objfile_statistics): Close quotes in
+ output strings.
+
+ * symmisc.c:
+ (Print_symbol): Add LOC_INDIRECT to switch statement
+ (print_partial_symbols): Add LOC_INDIRECT to switch statement
+
+ * symtab.c (find_pc_sect_psymtab): High bounds should be <, not <=.
+ (find_pc_sect_symtab): Ditto.
+
+ * symtab.c (hp_som_som_object_present): New flag to indicate HP
+ compiled code.
+ (find_pc_sect_psymtab): Change tests to make sure we are checking
+ the texthigh adress as well.
+ (lookup_transparent_type): New function. Look up a type name
+ in the struct_namespace. The type returned must not be opaque.
+ (find_pc_sect_symtab): Make sure we check the address 'pc' itself,
+ too.
+ (find_addr_symbol): Prepare to handle LOC_INDIRECT address class, but
+ leave it commented out.
+ (find_pc_sect_line): Return correct information if pc is in import
+ or export stub (trampoline).
+ (decode_line_1): Skip two chars, if they are '$$'. Like for HP's
+ $$dyncall. Handle cases in which varaible and function names can start
+ with $.
+ (overload_list_add_symbol): If cannot demangle name, use it as is.
+ Free string after use.
+ (make_symbol_overload_list): Initialize oload_name to NULL and
+ oload_name_len to 0. If demangle not successful, use name as it is.
+ Free string after use.
+
+ * symtab.c (lookup_symbol): Changed call to find_pc_sect_symtab,
+ to the original find_pc_symtab, in HP added fragment.
+
+ * symtab.c (lookup_symbol): Change HPUX_SNAP1 ifdef to a HPUXHPPA ifdef
+
+ * symtab.c (lookup_symbol): Ifdef the searching of symbol in the
+ minimal symbol tables, for hpux we move this check at the end
+ of the function.
+ Before we error out if symbol is not found in the symtab, look
+ in the statics.
+ Before erroring out if static symbol not found look in the globals.
+
+ * symtab.c (lookup_symbol): Return symbol as soon as found.
+ (decode_line_1): Check whether we have a conditional break. Temporarily
+ remove it from the line, to not confure perenthesis checking.
+ Handle namespaces.
+ (overload_list_add_symbol): New function. Overload
+ resolution support.
+ (make_symbol_overload_list): Ditto.
+
+ * symtab.c:
+ (find_template_name_end): New prototype decl.
+ (lookup_symbol): When a global or static symbol shows up in the
+ psymtab table, but not the symtab table, tell the user that
+ the symbol may be an inlined function or a template function and
+ provide some guidance to the user about how to more fully
+ specify the symbol.
+ (lookup_transparent_type): When a global or static symbol shows up
+ in the psymtab table, but not the symtab table, tell the user that
+ the symbol may be an inlined function or a template function and
+ provide some guidance to the user about how to more fully
+ specify the symbol.
+ (decode_line_1): Handle template function specification when decoding a
+ line. May need to be ifdefed for HP's aCC?
+ (_initialize_symtab): Handle dbx commands.
+
+ * symtab.h (address_class): Add new address calss for
+ LOC_THREAD_LOCAL_STATIC and LOC_INDIRECT.
+ (lookup_transparent_type): Add prototype.
+ (exception_event_kind): New enum for exception catchpoints.
+ (exception_event_record): New structure for exception catchpoints.
+ (CURRENT_EXCEPTION_KIND): New macro.
+ (CURRENT_EXCEPTION_CATCH_SAL): New macro.
+ (CURRENT_EXCEPTION_CATCH_LINE): New macro.
+ (CURRENT_EXCEPTION_CATCH_FILE): New macro.
+ (CURRENT_EXCEPTION_CATCH_PC): New macro.
+ (CURRENT_EXCEPTION_THROW_SAL): New macro.
+ (CURRENT_EXCEPTION_THROW_LINE): New macro.
+ (CURRENT_EXCEPTION_THROW_FILE) new macro.:
+ (Current_EXCEPTION_THROW_PC): New macro.
+
+ * symtab.h(make_symbol_overload_list): Add prototype.
+
+ * symtab.h:
+ (symbol_file_add): Add new params to function decl.
+
+ * target.c (cleanup_target): Changed casting of default functions for
+ to_has_forked, to_has_vforked, to_pid_to_exec_file to get rid of
+ warnings.
+
+ * target.c (cleanup_target): Changed the default functions for
+ to_pid_to_exec_file and to_core_file_to_sym_file
+
+ * target.c (cleanup_target): Fixed PARAMS for to_has_syscall_event
+
+ * target.c (cleanup_target): Syntax error, mismatched paranthesis.
+
+ * target.c:
+ (Default_clone_and_follow_inferior): New funct prototype declaration
+ and function definition
+ (dummy_target): More target_ops vector changes for HPUX
+ new fields. ifdefed for HPUX_SNAP2. New fields are
+ to_post_wait, to_post_startup_inferior
+ to_acknowledge_created_inferior, to_clone_and_follow_inferior,
+ to_post_follow_inferior_by_clone, to_create_catch_fork_hook,
+ to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
+ to_post_follow_vfork, to_pid_to_exec_file
+ (de_fault): Add new HPUX specific target_ops operations to
+ the de_fault macro
+ (INHERIT): Add new HPUX specific target_ops operations to the
+ INHERIT macro
+ (find_default_clone_and_follow_inferior): New funct definition
+ (debug_to_post_wait): New funct
+ (debug_to_post_startup_inferior): New funct
+ (debug_to_acknowledge_created_inferior): New funct
+ (debug_to_clone_and_follow_inferior): New funct
+ (debug_to_post_follow_inferior_by_clone): New funct
+ (debug_to_create_catch_fork_hook): New funct
+ (debug_to_create_catch_vfork_hook): New funct
+ (debug_to_has_forked): New funct
+ (debug_to_has_vforked): New funct
+ (debug_to_post_follow_vfork): New funct
+ (setup_target_debug): Initialize new target_ops vector fields.
+
+ * target.c:
+ (Cleanup_target): Fixed the return type on a few of the
+ default function values.
+
+ * target.c:
+ (Dummy_target): Add 3 new fields
+ (nosupport_runtime): New function, used in cleanup_target
+ (cleanup_target): Changes in the de_fault macro, both to
+ accomodate the new target_ops vector fields and to use
+ more accurate default functions.
+ (update_current_target): Add new target_ops vector fields to the
+ INHERIT macro
+ (generic_mourn_inferior): The call to breakpoint_init_inferior now takes a
+ parameter
+ (normal_pid_to_str): Adding a \0 to the end of buf.
+ (debug_to_has_syscall_event): New func
+ (debug_to_enable_exception_callback): New func
+ (debug_to_get_current_exception_event): New func
+ (setup_target_debug): Initialize the 3 new target_ops vector fields
+
+ * target.c:
+ (Struct signals): Fix message associated with SIGRETRACT.
+
+ * target.c:
+ (Dummy_target): Fix syntax error
+ (cleanup_target): Changed the default values for the new
+ target_ops vector fields. HP folks inappropriately set
+ most of them to noprocess(). They should be a mixture
+ of ignore() and return_zero().
+
+ * target.c:
+ (Dummy_target): Add new target_ops vector fields and their initializations
+ (cleanup_target): Added new new target_ops vector fields to the de_fault
+ macro definition.
+ (update_current_target): Added new new target_ops vector fields to the INHERIT
+ macro definition
+ (return_one): New function, used by the de_fault macro
+ (debug_to_post_attach): New function
+ (debug_to_wait): Added new cases: Target_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED,
+ TARGET_WAITKIND_EXECD
+ (debug_to_insert_fork_catchpoint): New function
+ (debug_to_remove_fork_catchpoint): New function
+ (debug_to_insert_vfork_catchpoint): New function
+ (debug_to_remove_vfork_catchpoint): New function
+ (debug_to_can_follow_vfork_prior_to_exec): New function
+ (debug_to_insert_exec_catchpoint): New function
+ (debug_to_remove_exec_catchpoint): New function
+ (debug_to_core_file_to_sym_file): New function
+ (setup_target_debug): Give new fields in current_target target_ops vector values.
+
+ * target.c: Hp merge, 4/15/98 snapshot
+ There are new target_ops fields that pertain only
+ to HPUX. All the changes relate to this. First,
+ new fields are added to the dummy_target target_ops
+ vector: To_require_attach, to_require_detach.
+
+ * target.c: Remove HPUX_SNAP1 and HPUX_SNAP2 ifdefs
+
+ * thread.c (info_threads_command): Call print_only_stack_frame
+ instead of print_stack_frame.
+ (_initialize_thread): Make t an alias for thread only if
+ xdb_commands is not set.
+
+ * thread.c (thread_command): If no arguments, don't generate an
+ error, instead tell the user which thread is current.
+ (info_threads_commands): Don't lose the users position within the
+ current thread -- remember it and then restore it.
+
+ * thread.c:
+ (struct thread_info): Add stepping_through_sigtramp field
+ (add_thread): Initialize stepping_through_sigtramp field
+ (load_infrun_state): Add stepping_through_sigtramp param and
+ make sure it gets assigned a value.
+ (save_infrun_state): Add stepping_through_sigtramp param and
+ make sure that the value gets saved.
+ (info_threads_command): Ifdefing some local variables and
+ code for HPUXHPPA. HP folks want print the tid rather than pid?
+ Also, looks like the HP folks solved the same thread switching
+ problem that 4.17 solves. Taking 4.17.
+ (restore_current_thread): Print out the current frame after
+ switching threads.
+ (thread_apply_all_command): Ifdefing a print statement for
+ HPUXHPPA. The HP folks want to print out a tid rather than pid?
+ (thread_apply_command): Ifdefing a print statement for
+ HPUXHPPA. The HP folks want to print out a tid rather than pid?
+ (thread_command): Decided not to take HP change.
+
+ * thread.c: Fixing gdb core dump problem causing many testsuite
+ failures.
+ (add_thread): Remove call to bpstat_clear, initialize
+ tp->stepping_through_solib_catchpoints = NULL;
+
+ * thread.c: Changes for catchpoints, shared libaries,
+ (thread_info): Additional fields in the thread_info struct
+ for stepping_through_solib_after_catch and
+ stepping_through_solib_catchpoints.
+ (add_thread): Initialize the new thread_info fields.
+ (load_infrun_state): Additional parameters for handling
+ catchpoints and shared libraries.
+ (save_infrun_state): Additional parameters for handling
+ catchpoints and shared libraries.
+
+ * top.c (command_loop): Initialize space_at_cmd_start to 0.
+ (set_prompt): New function.
+ (togglelist, stoplist): New command lists.
+ (command_loop): Tui changes -- paranoia to make sure
+ insert mode is off when not editing.
+ (quit_force): Clean up tui on exit.
+ (init_main): Make definition of info status command dependent upon
+ dbx mode not being set.
+ (fputs_unfiltered_hook): Changed stream parameter from FILE
+ to GDB_FILE
+ (flush_hook): Changed stream parameter from FILE to GDB_FILE
+
+ * top.h (set_prompt): Declare.
+
+ * typeprint.c (whatis_exp): Decide real runtime type. For the vtable
+ case.
+
+ * utils.c (query): Changes to prevent cursor from jumping around in the
+ TUI. Call tuiBufferGetc explicitly, rather than passing it
+ into tuiDo. The tuiDo function does some additional work
+ that is inappropriate when handling queries.
+ (GDB_FILE_ISATTY): New macro that takes a GDB_FILE param and
+ determines whether or not it's using a tty.
+ (gdb_file_isatty); called by the GDB_FILE_ISATTY macro. Does
+ the actual work
+ (init_page_info): Call GDB_FILE_ISATTY rather than ISATTY
+ (print_spaces): Fix parameter to fputc. fix call to
+ gdb_file_adjust_strbuf.
+ (gdb_file_init_astring): Fix parameter to xmalloc
+ (gdb_file_deallocate): New function to deallocate
+ a GDB_FILE object and possibly a string buffer
+ (gdb_file_init_astring): Initialize buffer as the empty
+ string. Indent GNU style.
+ (gdb_fopen): Gdb_fopen is called if the GDB_FILE object is
+ actually afile rather than astring. The routine now allocates space
+ for a GDB_FILE object and initializes its fields in addition to
+ performing an fopen.
+ (gdb_flush): Fix the parameter passed into fflush. It's now
+ stream->ts_filestream.
+ (gdb_fclose): Pass in an object of type GDB_FILE **. Fix parameter
+ to fclose. It's now tmpstream->ts_filestream. Make sure to free
+ the GDB_FILE object and set the GDB_FILE * object to NULL.
+ (gdb_adjust_strbuf): New function. Determine if the current
+ ts_strbuf field contains sufficient space to concatenate a string
+ of length n on the end. If not, then reallocate the ts_strbuf.
+ (print_spaces): Check to see if the GDB_FILE is afile or
+ astring. If it is astring, then adjust the size of the ts_strbuf
+ field and concatenate the correct number of spaces onto the end of
+ the buffer. Otherwise continue to use fputc.
+ (gdb_file_get_strbuf): New function. return a ptr to the ts_strbuf
+ field in a GDB_FILE object.
+ (gdb_file_init_astring): New function to allocate space for and
+ initialize a GDB_FILE object when it is an astring.
+ (set_width): Declare it.
+ (pagination_enabled): Define it.
+ (query): Tui changes.
+ (init_page_info, set_width): New functions.
+ (set_width_command): Call set_width.
+ (_initialize_utils): Replace termcap stuff with call to
+ init_page_info; if xdb_commands set, define am and sm commands;
+ define pagination as a set/show command.
+ (vfprintf_maybe_filtered): Change FILE to GDB_FILE.
+ (fputs_maybe_filtered): Ditto.
+ (print_spaces): Ditto.
+ (gdb_printchar): Ditto.
+ (gdb_flush): Ditto.
+ (fputs_filtered): Ditto.
+ (vfprintf_filtered): Ditto.
+ (vfprintf_unfiltered): Ditto.
+ (fprintf_filtered): Ditto.
+ (fprintf_unfiltered): Ditto.
+ (fprintfi_filtered): Ditto.
+ (print_spaces_filtered): Ditto.
+ (fprintf_symbol_filtered): Ditto.
+ (gdb_fclose): New function.
+
+ * valops.c (call_function_by_hand): Assign to param_type only
+ if function has parameters.
+
+ * valops.c (call_function_by_hand): Ifdef the
+ HP_COMPILED_TARGET stuff.
+ (value_arg_coerce): Ditto.
+
+ * valops.c (call_function_by_hand): Make sure param_type is
+ initialized to NULL.
+
+ * valops.c (find_rt_vbase_offset): Add parameter to value_at.
+ (value_rtti_type): Ditto.
+ (value_full_object): Ditto.
+
+ * valops.c (search_struct_field_aux): Fixed mismatching parenths
+
+ * valops.c (search_struct_field_aux): Make sure TYPE_TAG_NAME
+ is not null before copying it.
+
+
+ * valops.c (search_struct_field_aux): Set found_class_name to null
+ if class has no name (anon unions case). Adjust base_addr
+ computation.
+
+ * valops.c (value_arg_coerce): Change final arg to int.
+
+ * valops.c (value_arg_coerce): Remove the conditional on HP
+ compiled target, for doing coercion of float to double. Removed
+ third parameter, using_gcc.
+ (call_function_by_hand): Do not use HP_COMPILED_TARGET, just
+ use the gcc_compiled variable.
+
+ * valops.c (value_cast): Take case of the enclosing_type and
+ pointer_to_offset fields.
+ (value_at): Use VALUE_CONTENTS_ALL_RAW
+ (value_fetch_lazy): Ditto
+ (value_assign): Handle enclosing_type, embedded_offset and
+ pointed_to_offset fields.
+ (value_repeat): Use VALUE_CONTENTS_ALL_RAW and VALUE_ENCLOSING_TYPE.
+ (value_ind): Set enclosing_type and embedded_offset correctly,
+ for a pointer value being dereferenced. Target memory bytes
+ corresponding to the size of the enclosing type are retreived.
+ (value_addr): Handle enclosing_type and pointed_to_offset.
+ (value_push): Use VALUE_CONTENTS_ALL and VALUE_ENCLOSING_TYPE.
+ (value_arg_coerce): Coerce floats to doubles only if gcc was not
+ used to compile the target.
+ (call_function_by_hand): Handle pointers to functions as paramters.
+ (value_array): Use VALUE_CONTENTS_ALL and VALUE_ENCLOSING_TYPE.
+ (search_struct_method): Produce more informative error message.
+ (find_rt_vbase_offset): Deal with negative offsets.
+ (value_find_oload_method_list): New function. Return the list of
+ overloaded methods of a specified name.
+ (find_method_list): New function. Search through the methods of an
+ object (and its bases) to find a specified method.
+ (value_full_object): New function. Given a value, check its real
+ run-time type.
+ (value_rtti_target_type): New function. Given a pointer value V, find
+ the real (RTTI) type of the object it points to.
+ (value_rtti_type): New function. Find the real run-time type of a
+ value using RTTI.
+
+ * valops.c: Include gdbcmd.h
+ Set global overload_resolution to 0.
+ (find_function_in_inferior): Modify error message.
+ (value_allocate_space_in_inferior): Modify error message.
+ (value_cast): Deal with HP/aCC peculiarities.
+ (value_of_variable): Use SYMBOL_SOURCE_NAME instead of SYMBOL_NAME.
+ (value_addr): Modify address value by adding the embedded offset.
+ (value_ind): Modify the address of the object by the pointed_to_offset.
+ (call_function_by_hand): Do not do any extra alignment if not needed.
+ Fetch the return value from the stack rather then from the register,
+ for the hppa architecture.
+ (search_struct_field): Rewritten. Now this function uses
+ search_struct_field_aux to do all the work.
+ (search_struct_field_aux): New function. This is the old
+ search_struct_field rewritten.
+ (find_rt_vbase_offset): Give error if virtual table pointer is not good.
+ (find_overload_match): New function. Find the best function that
+ matches on the argument types according to the overload resolution
+ rules.
+ (_initialize_valops): Add new set/show command for overload-resolution.
+
+ * value.h (VALUE_POINTED_TO_OFFSET): New macro.
+ Add field pointed_to_offset to value structure.
+ Add prototypes for new functions in valops.c.
+
+ * value.h (write_register_pid): Change prototype to match
+ function.
+
+ * value.h: Hp merge, 4/15/98 snapshot
+ Added parameter to val_print func decl.
+ Added new macro, VALUE_EMBEDDED_OFFSET, and
+ new func decl, find_rt_vbase_offset, for C++
+ support.
+
+ * values.c (allocate_value): Allocate also for value_embedded_offset
+ and value_enclosing_type.
+ (value_copy): Copy value_embedded_offset and value_enclosing_type too.
+ Use all_raw in copying the value itself.
+ (value_primitive_field): Add handling of base subobjects.
+
+ * values.c (value_copy): Copy the pointed_to_offset as well.
+ (allocate_value): Allocate the pointed_to_offset as well.
+ (value_virtual_fn_field): Rewrite.
+
+ * values.c (value_primitive_field): Adjust embedded offset and
+ offset calculation.
+
+ * values.c (value_static_field): Take into consideration that static
+ data members can be minimal symbols too.
+
+ * values.c (value_virtual_fn_field): Fix call to value_at.
+
+ * win32-nat.c (handle_load_dll): Added params to call to symbol_file_add.
+
+ Other changes have to do with XDB compatability. Leave oout
+ for now.
+
+ defs.h (vfprintf_filtered): Change FILE to GDB_FILE in decl.
+ (fprintf_filtered): Ditto.
+ (fprintfi_filtered): Ditto.
+ (vfprintf_unfiltered): Ditto.
+ (fprintf_unfiltered): Ditto.
+
+ infcmd.c (_initialize_infcmd): If xdb_commands is set, make S an
+ alias for next and define R, lr, g. Define go.
+
+ pyr-tdep.c (pyr_print_insn): Change FILE to GDB_FILE.
+
+
+ * breakpoint.c (create_temp_exception_breakpoint): #If it out --
+ nothing calls it.
+ (bpstat_stop_status): Don't call SOLIB_HAVE_LOAD_EVENT if it's not
+ defined; don't call SOLIB_HAVE_UNLOAD_EVENT if it's not defined.
+ (bpstat_get_triggered_catchpoints): If we don't have shared
+ library support, then don't call SOLIB_LOADED_LIBRARY_PATHNAME nor
+ SOLIB_UNLOADED_LIBRARY_PATHNAME.
+ (watch_command_1): Don't require a run before a watch command
+ unless we're on HP [it's an HP OS bug, not a generic limitation]
+ (catch_load_command_1): Don't define if no shared libraries.
+ (catch_command_1): Don't claim to support fork catchpoints unless
+ CHILD_INSERT_FORK_CATCHPOINT is defined, don't claim to support
+ vfork catchpoints unless CHILD_INSERT_VFORK_CATCHPOINT is defined,
+ don't clain to support shared library load catchpoints if shared
+ libraries aren't supported, and don't claim to support exec
+ catchpoints unless CHILD_INSERT_EXEC_CATCHPOINT is defined
+
+ There are new target_ops vector fields that pertain
+ only to HPUX. Added the to_require_attach and
+ to_require_detach fields to exec_ops. These new
+ fields are ifdef'ed for HPUX_SNAP1.
+
+ * breakpoint.h:
+ Fix compile error in enum bptype.
+
+ * coff-solib.h:
+ Fixed a number of macro definitions. SOLIB_LOADED_LIBRARY_PATHNAME,
+ SOLIB_HAVE_LOAD_EVENT, SOLIB_HAVE_UNLOAD_EVENT,
+ SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_IN_DYNAMIC_LINKER. These
+ macros are only meaningful (for now) for SOM. So, all
+ the macros were defined as error(...), but were used in
+ conditions. This caused the compile to crap out. I redefined
+ these (for now) to be 0.
+
+ * procfs.c:
+ (procfs_create_inferior): Fix call to fork_inferior -- need another
+ parameter.
+
+ * solib.h:
+ Fixed a number of macro definitions. SOLIB_LOADED_LIBRARY_PATHNAME,
+ SOLIB_HAVE_LOAD_EVENT, SOLIB_HAVE_UNLOAD_EVENT,
+ SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_IN_DYNAMIC_LINKER. These
+ macros are only meaningful (for now) for SOM. So, all
+ the macros were defined as error(...), but were used in
+ conditions. This caused the compile to crap out. I redefined
+ these (for now) to be 0.
+
+ * valops.c:
+ (search_struct_field): Undeclared local variable, "assigned".
+ (find_rt_vbase_offset): Fixed call to value_at
+
+ * value.h: Fix signature for find_rt_vbase_offset funct decl
+ (missing a param)
+
+Wed Dec 30 17:48:12 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ From J.T. Conklin <jtc@redbacknetworks.com>:
+ * i386-stub.c: Fix error string in last change.
+
+1998-12-30 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * utils.c: <Readline/readline.h> instead of "readline/readline.h".
+
+ * configure.in (TERM_LIB): Search for the appropriate term library
+ on the host system.
+ * configure: Regenerated.
+ * Makefile.in (TERMCAP): Set based on autoconf check.
+ * config/*/*.mh: Don't override TERMCAP setting.
+
+Wed Dec 30 17:23:14 1998 Mark Alexander <marka@cygnus.com>
+
+ * value.c (value_virtual_fn_field): Handle the situation where
+ vtbl is a pointer to a structure instead of a pointer to an array.
+
+Mon Dec 28 17:43:36 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by Jim Blandy <jimb@cygnus.com>,
+ Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
+ <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
+ Taylor <taylor@cygnus.com>, as part of the project to merge in
+ changes originally made by HP; HP did not create ChangeLog
+ entries.
+
+ * c-lang.h (cp_print_value_fields): Update prototype; fixed
+ prototype decl for c_val_print function -- it needed an
+ embedded_offset param; fixed prototype of cp_print_value_fields.
+ Include value.h.
+ (C_LANG_H): Define.
+
+ * c-valprint.c (c_val_print): Add new parameter embedded_offset.
+ Add embedded_offset to valaddr in function calls. fix calls to
+ val_print, and cp_print_value_fields. Attempt to determine the
+ real type of the object to be printed. fixed call to
+ cp_print_value_fields. process TYPE_CODE_METHOD as well. moved
+ call to check_typedef out of conditional. add embedded offset
+ param to val_print call.
+
+ (c_value_print): Add new parameter to call to val_print. Handle
+ pointer to class case. Ensure that const char *, const unsigned
+ char * come out without the type but the volatile variants and the
+ signed variants don't.
+
+ * ch-lang.h (chill_val_print): Add parameter to decl.
+
+ * ch-valprint.c: The various print routines have an additional
+ parameter. Currently, the new parameter is only used when printing
+ C++ expressions. So, in ch-valprint.c, the new parameter is always
+ 0. Changes in calls to val_print, chill_val_print, c_val_print
+ Affected functions are chill_val_print_array_elements,
+ chill_val_print, chill_print_value_fields, chill_value_print.
+
+ * cp-valprint.c add vtable pointers names for aCC (HP) compiler.
+ (cp_print_class_method): Print message for HP/aCC case.
+ (cp_print_class_member): Add comments.
+ (cp_print_value): Adjust address computations for virtual base
+ classes. add new parameter 'offset'. Find correct offset for
+ base class in HP/aCC case. Change call to cp_print_value_fields
+ to have extra par.
+ (cp_print_value_fields): Do not print also if the only field is
+ the vtable pointer. Print out vtable ptr, for HP/aCC compiled
+ case. do not print leading '=' in case of anonymous union, or
+ struct. add new parameter 'offset'. Do not print the vtable
+ pointer as a member, in the HP aCC case. Changed calls to
+ val_print to have extra parameter.
+ (cp_print_hpacc_virtual_table_entries): New function. Print vtable
+ entries, in HP/aCC compiled case.
+ (cp_print_static_field): Change call to cp_print_value_fields, and
+ val_print.
+
+ * d30v-tdep.c (d30v_print_register): Add embedded_offset param
+ to val_print call.
+
+ * defs.h: Additional include files included when TUI is defined.
+ (gdb_file_isatty): New function decl.
+ (GDB_FILE): If TUI is defined, define a structure rather
+ than making this an alias for FILE.
+ (gdb_stdout, gdb_stderr): If TUI is defined, then define these
+ as pointers to variables of type GDB_FILE rather than making them
+ be aliases for stdout and stderr.
+ (TUIDO): Add definition conditionalized on definition
+ (or lack thereof) of TUI.
+ (command_class): Add two additional values.
+ (precision_type): New enum.
+ (gdb_fclose): Add decl.
+ (store_address): Change prototype to match function.
+ (tui_version, xdb_commands, dbx_commands): Add decls.
+ (gdb_file_deallocate): New function decl
+ (pa_do_strcat_registers_info): New function decl.
+ (streamtype): New enumerated type to distinguish between output to
+ a FILE and output to a buffer.
+ (tui_stream): New struct type, named GDB_FILE.
+ (gdb_stdout): Of type GDB_FILE, will pass this around gdb rather
+ than stdout.
+ (gdb_stderr): Of type GDB_FILE, will pass this around gdb rather
+ than stderr.
+ (fputs_unfiltered_hook): Change stream parameter from FILE to
+ GDB_FILE.
+ (flush_hook): Change stream parameter from FILE to GDB_FILE.
+ (gdb_fclose): Fix decl for gdb_fclose; parameter is now of
+ type GDB_FILE **.
+ (gdb_file_adjust_strbuf): New function decl. function lives
+ in utils.c.
+ (gdb_file_init_astring): New function decl. function lives
+ in utils.c.
+ (gdb_file_get_strbuf): New function decl. function lives in
+ utils.c.
+ (source_full_path_of): Declare.
+
+ * exec.c (_initialize_exec): Make definition of file command be
+ dependent upon dbx_commands not being set.
+ (exec_file_attach): New function.
+ (exec_file_command): Call it.
+ (exec_ops): Add new target vector fields.
+
+ * f-lang.h (f_print_type): Change FILE to GDB_FILE in decl.
+ (f_val_print): Ditto.
+ (f_val_print): Add parameter to the function decl.
+
+ * f-valprint.c (_initialize_f_valprint): If xdb_commands is set,
+ define lc command.
+ (f77_create_arrayprint_offset_tbl): Change FILE to GDB_FILE.
+ (f77_print_array): Ditto.
+ (f77_print_array_1): Ditto.
+ (f_val_print): Ditto.
+ (f_val_print): Add a parameter; this new parameter is currently
+ only non-zero when handling C++ expressions. In this file its
+ value is always 0. changed fflush to gdb_flush.
+
+ * gnu-nat.c: (init_gnu_ops): Add new target vector fields.
+ (gnu_create_inferior): Add param to fork_inferior call.
+
+ * hppa-tdep.c (after_prologue): If f is NULL, don't dereference
+ it. if no debug info, return zero telling caller that we need to
+ find the end of the prologue via the hard way (instruction
+ examination).
+ (find_unwind_entry): Avoid dereferencing a null
+ pointer.
+ (hppa_pid_to_exec_file): Deleted -- no longer used.
+ (hppa_prepare_to_proceeed): Add prototype.
+ (read_unwind_info): Purecov comments, bug fixes.
+ (find_unwind_entry): Purecov comments, bug fixes.
+ (find_stub_with_shl_get): Purecov comments.
+ (frame_chain): Additional parens.
+ (hppa_push_arguments): Changes to commented out version of routine.
+ (hppa_fix_call_dummy): Purecov comments, fix location of end.o.
+ (in_solib_call_trampoline): Purecov comments.
+ (in_solib_return_trampoline): Purecov comments.
+ (setup_d_pid_in_inferior): Fix location of end.o.
+ (initialize_hp_cxx_exception_support): Fix location of end.o.
+ (child_enable_exception_callback): Purecov comments.
+ (pa_do_strcat_registers_info): Has a new parameter, precision,
+ which is passed into the call to pa_strcat_fp_reg to indicate
+ whether to display the floating point registers using
+ single or double preceision.
+ (pa_strcat_registers): Introduce local variable, precision, and
+ pass it into call to pa_strcat_fp_reg.
+ (pa_strcat_fp_reg): Modified function. New parameter, precision,
+ used by function to decide whether to use single or double
+ precision. Also add the code to put a double precision value
+ into a buffer.
+ (pa_do_strcat_registers_info): New routine. called by
+ tui/tuiRegs.c:_tuiRegisterFormat to place a register name
+ and value into a string buffer. Interface may change in
+ future. Checking this in so that we have something
+ functional for HP.
+ (pa_strcat_registers): New routine, called by
+ pa_do_strcat_registers_info. Does same thing as
+ pa_print_registers except it takes a stream parameter.
+ This routine should disappear in future. Checking in
+ so that we have something functional to give HP
+ (pa_strcat_fp_reg): New routine, called by
+ pa_do_strcat_registers_info and pa_strvat_registers
+ to place a floating point register name and value into
+ a buffer. This interface may change in future.
+ Checking in so that we have something functional to give HP.
+ (pa_print_fp_reg): Change prototype to match def'n.
+ (pa_register_look_aside): Fix comment immediately before function.
+ Changes to better support stack unwinding, reading and writing
+ registers for HPUX. New includes ptrace.h, bfd.h, dl.h.
+ (internalize_unwinds): Initialize new fields in table.
+ (read_unwind_info): Entries in the table are now more complex
+ structures. References of the form ...->table[index].stub_type are
+ now ...->table[index].stub_unwind.stub_type.
+ (find_proc_framesize): Add a check for pc == 0.
+ (rp_saved): Entries in the table are now more complex
+ structures. References of the form ...->table[index].stub_type are
+ now ...->table[index].stub_unwind.stub_type.
+ (frameless_function_invocation): Stub_type becomes
+ stub_unwind.stub_type
+ (saved_pc_after_call): Stub_type becomes stub_unwind.stub_type
+ (hppa_frame_saved_pc): Stub_type becomes stub_unwind.stub_type
+ (frame_chain_valid): Stub_type becomes stub_unwind.stub_type
+ (hppa_call_dummy): Stub_type becomes stub_unwind.stub_type
+ (pa_print_fp_reg): Additional params to call val_print
+ (in_solib_call_trampoline): Stub_type becomes
+ stub_unwind.stub_type
+ (in_solib_return_trampoline): Stub_type becomes
+ stub_unwind.stub_typ
+ (skip_trampoline_code): Additional code to handle external
+ dyncalls. Also stub_type becomes stub_unwind.stub_type
+ (hppa_pid_to_exec_file): New funct. FOr HPUX 10.0 and beyond there
+ is an explicit ptrace request for getting the pathname associated
+ with a process id (pid).
+ (hppa_pid_to_exec_file): Remove unwanted param from call to
+ call_ptrace.
+ (args_for_find_stub): New structure.
+ (find_unwind_entry): Deal with null input pc value.
+ (rp_saved): Ditto.
+ For the import stub, return -24 always.
+ (hppa_frame_saved_pc): Save old pc value, to detect we are in a loop.
+ (init_extra_frame_info): Use TARGET_READ_FP.
+ (frame_chain): Include thread support.
+ If the caller's pc is zero, we lose and return, just like stack
+ bottom.
+ Disable warning about being unable to find unwind info.
+ (hppa_push_arguments): Rewrite.
+ (hppa_value_returned_from_stack): New function. Handles returning
+ a value larger than 64 bits, stored on the stack.
+ (find_stub_with_shl_get): New function. To look up symbols in shlibs.
+ (cover_find_stub_with_shl_get): New function. Cover routine for
+ find_stub_with_shl_get to pass to catch_errors.
+ (hppa_fix_call_dummy): Comment out old stub mechanism.
+ Rewrite using dyncall.
+ (target_read_fp): New function.
+ (pa_do_registers_info): Floating point registers start at FP4.
+ (pa_print_registers): Use FP4_REGNUM instead of 72.
+ (skip_trampoline_code): Do machine instruction matching for PA2.0.
+ (setup_d_pid_in_inferior): New function. Exception handling support.
+ (initialize_hp_cxx_exception_support): Ditto.
+ (child_enable_exception_callback): Ditto.
+ (child_get_current_exception_event): Ditto.
+
+ * hpux-thread.c (hpux_thread_ops): Add new target vector fields.
+
+ * infcmd.c: Include objfiles.h.
+ (attach_command): New local variable, exec_file, add code to
+ determine exec_file from pid if exec_file is not already known,
+ call new target operation, target_post_attach -- a no-op unless
+ on HPUXHPPA.
+ (detach_command): After detaching, do a SOLIB_RESTART.
+ (objfiles.h): Fix typo on include line.
+ (run_command): Only call SOLIB_RESTART if it's defined.
+ (detach_command): Ditto.
+ (run_command): If program has already been started, and decide
+ to restart it, the kill the target, flush the caches,
+ call init_wait_for_inferior. Also purge old solib objfiles.
+ (run_stack_dummy): Add calls to
+ disable_watchpoints_before_interactive_call_start and
+ enable_watchpoints_after_interactive_call_stops.
+ (finish_command): Alter code handling the evaluation and printing
+ of the target function's return value.
+ (attach_command): When given a pid, but no exec file, try to
+ determine the exec file from the process. If the process does not
+ record a full path name, try to qualify the filename against the
+ source path.
+ (_initialize_infcmd): Add some verbiage about how to use the
+ attach command.
+ (do_registers_info): Changed calls to val_print
+ made the symfile.h include preceed the
+ objfiles.h include. The other ordering caused a
+ compile problem (incompletely defined types).
+
+ * inftarg.c (child_post_attach): Fix decl, make static.
+ (proc_wait): Make globally visible.
+ (child_insert_fork_catchpoint, etc): Fix return type.
+ (child_detach_from_process): Declare.
+ (child_attach_to_process): Declare.
+ (child_stop): Make static to match decl.
+ (ptrace_him): Change prototype back to return int.
+ (ptrace_me): Remove debug output, pass NULL to fork_inferior if
+ not HPUX.
+ (proc_wait): function prototype and definition are enclosed by
+ proc_wait ifndef
+ (child_attach_to_process): New function, does most of the work
+ that child_attach used to do and some additional work to determine
+ whether gdb is already attached to the target how to react.
+ (child_attach): Altered. It's now a wrapper for
+ child_attach_to_process.
+ (child_require_attach): New function, called if should attach even
+ when gdb is already attached to target.
+ (child_detach_from_process): New function, does most of the work
+ that child_detach used to do and some additional work to determine
+ whether gdb is currently attached to the target.
+ (child_detach): Altered. It's now a wrapper for
+ child_detach_from_process.
+ (child_require_detach): New function, called if should try to
+ detach even when gdb is not attached to target.
+ (ptrace_him): Calls a new function,
+ target_acknowledge_forked_child. Currently,
+ target_acknowledge_forked_child, is only defined to do something
+ for HPUX.
+ (child_create_inferior): Changed call to fork_inferior.
+ (child_ops): Add to_require_attach and to_require_detach fields
+ to the child_ops target ops vector.
+ Some hacks for ttrace work:
+ (child_wait): Additional local variables, additional code in
+ while loop to check for process exited, process forked,
+ process vforked, process execd.
+ (child_thread_alive): John B. seems to think that the kill
+ call is inapproapriate for HPUX.
+ (child_attach_to_process): Using strtol rather than atoi.
+ no longer check for case where there is no known exec file.
+ (child_post_attach): New function, a default, a no-op.
+ (child_insert_fork_catchpoint): New function, a default, a no-op.
+ (child_remove_fork_catchpoint): New function, a default, a no-op.
+ (child_insert_vfork_catchpoint): New function, a default, a no-op.
+ (child_remove_vfork_catchpoint): New function, a default, a no-op.
+ (child_can_follow_vfork_prior_to_exec ):new function, a default,
+ a no-op.
+ (child_insert_exec_catchpoint): New function, a default, a no-op.
+ (child_remove_exec_catchpoint): New function, a default, a no-op.
+ (child_has_execd): New function, a default, returns 0.
+ (child_reported_exec_events_per_exec_call): New function, a
+ default, returns 1.
+ (child_has_exited): New function, a default.
+ (child_core_file_to_sym_file): New function, a default, returns NULL.
+ (child_ops): Initialize new target vector fields.
+
+ * jv-lang.h: (Java_val_print): Add embedded_offset param to func
+ decl.
+
+ * jv-valprint.c: Changing calls to val_print to accomodate new param.
+ (java_value_print): Add embedded_offset param to val_print call
+ (java_print_value_fields): Add embedded_offset param to val_print
+ call.
+ (java_val_print): Add embedded_offset param. alter call to
+ c_val_print to accomodate embedded_offset param.
+
+ * language.c (lang_bool_type): Return builtin_type_bool in c++
+ case.
+ (unk_lang_val_print): Add embedded_offset param to
+ prototype decl and definition.
+
+ * language.h (LA_VAL_PRINT macro, la_val_print function decl):
+ altered to accomodate the new parameter to the various print
+ functions.
+
+ * m2-lang.h (m2_val_print): Add a parameter to the function decl.
+
+ * m2-valprint.c (m2_val_print): Add a parameter.
+ This parameter is currently only used when evaluating C++
+ expressions. So, it is always 0 in this file.
+
+ * m3-nat.c (m3_create_inferior): Add param to fork_inferior call
+ (m3_pid_to_exec_file): New function
+ (m3_ops): Add new target vector fields.
+
+ * mac-nat.c (init_child_ops): Add new target vector fields.
+
+ * mips-tdep.c: Chnages to accomodate additional parameter
+ to val_print.
+ (mips_print_register): Alter calls to val_print
+
+ * monitor.c (monitor_write): Change stderr to gdb_stderr.
+ (monitor_remove_breakpoint): Ditto.
+ (init_base_monitor_ops): Add new target vector fields.
+
+ * ppc-bdm.c (init_bdm_ppc_ops): Add new target vector fields.
+
+ * printcmd.c (do_examine): When saving a value_ptr, remove it from
+ the list of value_ptr's to be freed automatically; when discarding
+ a previously saved value_ptr, free it.
+ (print_formatted): Update comments; add new comments.
+ (printf_command, print_insn): Purecov comments.
+ (_initialize_printcmd): Add assign as a command if dbx_commands is
+ set; create va as an alias for disassemble if xdb_commands is set.
+ (address_info): New cases LOC_INDIRECT and
+ LOC_THREAD_LOCAL_STATIC.
+ (display_command): If tui_version and exp starts with a '$', then
+ don't display it unless tui_vSetLayoutTo fails.
+ (disassemble_command): Add tuiDo calls.
+ (print_scalar_formatted): For integers that are long long, check
+ the print format and print out in binary octal, decimal, or
+ hex. Call the new print_*_chars functions in valprint.c
+ (print_frame_args): Altered calls to val_print, to reflect
+ additional parameter to val_print (case LOC_BASEREG_ARG).
+
+ * procfs.c: (Procfs_init_inferior): Return value is now a void.
+ (procfs_ops): Add new target vector fields.
+ (procfs_create_inferior): Fix call to fork_inferior -- need another
+ parameter.
+
+ * remote-adapt.c (adapt_open): Change stderr to gdb_stderr.
+ (adpat_insert_breakpoint): Ditto.
+ (init_adapt_ops): Add new target vector fields.
+
+ * remote-array.c (array_wait): Change fflush to gdb_flush and
+ stdout to gdb_stdout.
+ (init_array_ops): Add new target vector fields.
+
+ * remote-bug.c (bug_load): Change fflush to gdb_flush; stdout to
+ gdb_stdout.
+ (bug_wait): Change stderr to gdb_stderr.
+ (bug_insert_breakpoint): Ditto.
+ (init_bug_ops): Add new target vector fields.
+
+ * remote-e7000.c
+ (init_e7000_ops): Add new target vector fields.
+ * remote-eb.c (init_eb_ops): Ditto.
+ * remote-es.c (init_es1800_ops): Ditto.
+ (init_es1800_child_ops): Ditto.
+ * remote-es.c (init_es1800_ops): Ditto.
+ (init_es1800_child_ops): Ditto.
+ * remote-hms.c (init_hms_ops): Ditto.
+ * remote-hms.c (init_hms_ops): Ditto.
+ * remote-nindy.c (init_nindy_ops): Ditto.
+ * remote-nrom.c (init_nrom_ops): Ditto.
+ * remote-os9k.c (init_rombug_ops): Ditto.
+ * remote-rdp.c (init_remote_rdp_ops): Ditto.
+ * remote-sds.c (init_sds_ops): Ditto.
+ * remote-sim.c (init_gdbsim_ops): Ditto.
+ * remote-st.c (init_st2000_ops): Ditto.
+ * remote-udi.c (init_udi_ops): Ditto.
+ * remote-vx.c (init_vx_ops): Ditto.
+ (init_vx_run_ops): Ditto.
+ * remote-vx.c: (Init_vx_ops): Ditto.
+ (init_vx_run_ops): Ditto.
+
+ * remote-mips.c (mips_getstring): Change stderr to gdb_stderr.
+ (pmon_insert_breakpoint): Ditto.
+ (pmon_remove_breakpoint): Ditto.
+ (check_lsi_error): Ditto.
+ (common_breakpoint): Ditto.
+ (pmon_makeb64): Ditto.
+
+ * remote-mips.c (mips_xfer_memory): Change fflush to gdb_flush;
+ change stdout to gdb_stdout.
+
+ * remote-mm.c (mm_open): Change stderr to gdb_stderr.
+ (init_mm_ops): Add new target vector fields.
+ (mm_load): Fixed params in commented out call to symbol_file_add.
+
+ * remote-nindy.c (instream): Change decl to FILE.
+
+ * remote-udi.c (udi_load): Fixed params in call to symbol_file_add.
+
+ * remote-vx.c (vx_add_symbols): Fixed params in call to
+ symbol_file_add.
+
+ * remote.c (init_remote_ops): Cosmetic change to match expected
+ test output.
+
+ * rs6000-nat.c (add_vmap): Add params to call to allocate_objfile.
+
+ * scm-lang.h: Add parameter to scm_val_print function decl.
+
+ * scm-valprint.c (scm_scmval_print): Cast svalue to (int); new
+ parameter. This parameter is currently only used when evaluating
+ C++ expressions. So, it is always 0 in this file.
+ (c_val_print): Fixed prototype decl; it needed an embedded_offset
+ param.
+
+ * sol-thread.c (sol_core_ops): Add new target vector fields.
+ (sol_thread_ops): Ditto.
+
+ * somsolib.c (DLD_FLAGS_MAPPRIVATE): New macro.
+ Define bit of __dld_flags in HP-UX a.out files.
+ (DLD_FLAGS_HOOKVALID): Ditto.
+ (DLD_FLAGS_LISTVALID): Ditto.
+ (DLD_FLAGS_BOR_ENABLE): Ditto.
+ (som_solib_total_st_size): Cumulative size in bytes of the
+ symbol tables of all shared objects on the so_list_head list.
+ (som_solib_st_size_threshhold_exceeded): Threshold for adding symbols
+ for shlibs.
+ (som_solib_sizeof_symbol_table): New function. Computes size of
+ symbol table for a shlib.
+ (som_solib_load_symbols): New function. Load symbols from shlib.
+ (som_solib_add): Detect if __dld_list is not valid.
+ Record main program's symbol table size.
+ Load symbols if called from command line.
+ Keep threshold into account when loading shlib symbols.
+ (som_solib_create_inferior_hook): Use dld_flags macros.
+ (som_sharedlibrary_info_command): Let user know if symbols were
+ not loaded.
+ (som_solib_restart): Discard all the shlibs descriptors.
+ (_initialize_som_solib): Chenge help message for auto-solib-add
+ command.
+ Set threshold for symbol table to 50 megabytes.
+ (_initialize_som_solib): Add call to som_solib_restart.
+ (som_solib_restart): New function
+ (som_solib_in_dynamic_linker): New function
+ (som_solib_desire_dynamic_linker_symbols): New function
+ (som_solib_unloaded_library_pathname): New function
+ (som_solib_loaded_library_pathname): New function
+ (som_solib_library_pathname): New function
+ (som_solib_have_unload_event): New function
+ (som_solib_have_load_event): New function
+ (som_solib_create_catch_unload_hook): New function
+ (som_solib_create_catch_load_hook): New function
+ (som_solib_create_inferior_hook): Rewritten
+ dld_cache: New struct
+ addr_and_unwind_t: New struct
+ (find_unwind_entry) add prototype
+ Include assert.h, remove references to ASSERT macro,
+ add include of fcntl.h so that O_RDONLY is defined.
+ (som_solib_create_inferior_hook): Introduce new local
+ msymbol2 and change some msymbol's to msymbol2's -- was clobbering
+ msymbol, passing a NULL to lookup_minimal_symbol_solib_trampoline,
+ and ultimately core dumping with a SEGV.
+ (som_solib_mapped_entry): Additional comments for text_addr,
+ text_link_addr, text_end, and tsd_start_addr fields. Commenting
+ out 2 tsd fields, __data_start and __data_end.
+ (som_solib_add_solib_objfile): Add params to calls to symbol_file_add.
+ Add some code for distinguishing between a shared library and other
+ objfiles. This appears to be a prelude to thread local storage.
+ (som_solib_load_symbols): Changes to printf statement
+ enclosed by SOLIB_DEBUG ifdef.
+ (som_solib_add): Change comment to correctly specify path
+ to end.o -- /opt/langtools/lib/end.o. changes to printf statement
+ enclosed by SOLIB_DEBUG ifdef.
+ Removed several SOLIB_DEBUG ifdefs and the associated printfs.
+ Add code to find the start address for the object file's thread
+ local storage
+ (som_solib_create_inferior_hook): Fix warning messages use correct
+ path to end.o -- /opt/langtools/lib/end.o. Change control flow.
+ No longer user early returns from function is cases of error.
+ (reset_inferior_pid): New function
+ (som_solib_remove_inferior_hook): New function
+ (so_lib_thread_start_addr): New function. used for tsd.
+ (struct som_solib_mapped_entry): Add new field tsd_start_addr.
+ (struct so_list): Add new field solib_addr.
+ (som_solib_add_solib_objfile): New function.
+ (som_solib_load_symbols): Rewritten.
+ (som_solib_add): Make sure we don't load the symbols in if the
+ threshold was exceeded.
+ (som_solib_get_solib_by_pc): New function. Return the address of
+ handle of the shared library.
+ (som_solib_restart): Disable breakpoints at restart.
+
+ * sparcl-tdep.c (init_sparclite_ops): Add new target vector fields.
+
+ * target.c (cleanup_target): Changed casting of default functions
+ for to_has_forked, to_has_vforked, to_pid_to_exec_file to get rid
+ of warnings. Fixed PARAMS for to_has_syscall_event. Fixed the
+ return type on a few of the default function values.
+ (cleanup_target): Changes in the de_fault macro, both to
+ accomodate the new target_ops vector fields and to use
+ more accurate default functions.
+ (debug_to_open): Change stderr to gdb_stderr.
+ (debug_to_close): Ditto.
+ (debug_to_attach): Ditto.
+ (debug_to_post_attach): Ditto.
+ (debug_to_require_attach): Ditto.
+ (debug_to_detach): Ditto.
+ (debug_to_require_detach): Ditto.
+ (debug_to_resume): Ditto.
+ (debug_to_wait): Ditto.
+ (debug_to_post_wait): Ditto.
+ (debug_to_fetch_registers): Ditto.
+ (debug_to_store_registers): Ditto.
+ (debug_to_prepare_to_store): Ditto.
+ (debug_to_xfer_memory): Ditto.
+ (debug_to_files_info): Ditto.
+ (debug_to_insert_breakpoint): Ditto.
+ (debug_to_remove_breakpoint): Ditto.
+ (debug_to_terminal_init): Ditto.
+ (debug_to_terminal_inferior): Ditto.
+ (debug_to_terminal_ours_for_output): Ditto.
+ (debug_to_terminal_ours): Ditto.
+ (debug_to_terminal_info): Ditto.
+ (debug_to_kill): Ditto.
+ (debug_to_load): Ditto.
+ (debug_to_lookup_symbol): Ditto.
+ (debug_to_create_inferior): Ditto.
+ (debug_to_post_startup_inferior): Ditto.
+ (debug_to_acknowledge_created_inferior): Ditto.
+ (debug_to_clone_and_follow_inferior): Ditto.
+ (debug_to_post_follow_inferior_by_clone): Ditto.
+ (debug_to_insert_fork_catchpoint): Ditto.
+ (debug_to_remove_fork_catchpoint): Ditto.
+ (debug_to_insert_vfork_catchpoint): Ditto.
+ (debug_to_remove_vfork_catchpoint): Ditto.
+ (debug_to_has_forked): Ditto.
+ (debug_to_has_vforked): Ditto.
+ (debug_to_can_follow_vfork_prior_to_exec): Ditto.
+ (debug_to_post_follow_vfork): Ditto.
+ (debug_to_insert_exec_catchpoint): Ditto.
+ (debug_to_remove_exec_catchpoint): Ditto.
+ (debug_to_has_execd): Ditto.
+ (debug_to_reported_exec_events_per_exec_call): Ditto.
+ (debug_to_has_syscall_event): Ditto.
+ (debug_to_has_exited): Ditto.
+ (debug_to_mourn_inferior): Ditto.
+ (debug_to_can_run): Ditto.
+ (debug_to_notice_signals): Ditto.
+ (debug_to_thread_alive): Ditto.
+ (debug_to_stop): Ditto.
+ (debug_to_enable_exception_callback): Ditto.
+ (debug_to_get_current_exception_event): Ditto.
+ (debug_to_pid_to_exec_file): Ditto.
+ (debug_to_core_file_to_sym_file): Ditto.
+ (default_clone_and_follow_inferior): New function prototype
+ decl and function definition.
+ (dummy_target): Add new target_ops vector fields and their
+ initializations. More target_ops vector changes for HPUX new
+ fields.
+ (de_fault): Add new HPUX specific target_ops operations to the
+ de_fault macro
+ (INHERIT): Add new HPUX specific target_ops operations.
+ (debug_to_post_wait): New function.
+ (debug_to_post_startup_inferior): Ditto.
+ (debug_to_acknowledge_created_inferior): Ditto.
+ (debug_to_clone_and_follow_inferior): Ditto.
+ (debug_to_post_follow_inferior_by_clone): Ditto.
+ (debug_to_create_catch_fork_hook): Ditto.
+ (debug_to_create_catch_vfork_hook): Ditto.
+ (debug_to_has_forked): Ditto.
+ (debug_to_has_vforked): Ditto.
+ (debug_to_post_follow_vfork): Ditto.
+ (setup_target_debug): Initialize new target_ops vector fields.
+ (nosupport_runtime): New function, used in cleanup_target
+ (update_current_target): Add new new target_ops vector fields to
+ the INHERIT macro definition.
+ (generic_mourn_inferior): The call to breakpoint_init_inferior now
+ takes a parameter.
+ (normal_pid_to_str): Add a \0 to the end of buf.
+ (debug_to_has_syscall_event): New function.
+ (debug_to_enable_exception_callback): New function.
+ (debug_to_get_current_exception_event): New function.
+ (setup_target_debug): Initialize the 3 new target_ops vector fields
+ (struct signals): Fix message associated with SIGRETRACT.
+ (return_one): New function, used by the de_fault macro
+ (debug_to_post_attach): New function.
+ (debug_to_wait): Add new cases TARGET_WAITKIND_FORKED,
+ TARGET_WAITKIND_VFORKED, TARGET_WAITKIND_EXECD.
+ (debug_to_insert_fork_catchpoint): New function.
+ (debug_to_remove_fork_catchpoint): Ditto.
+ (debug_to_insert_vfork_catchpoint): Ditto.
+ (debug_to_remove_vfork_catchpoint): Ditto.
+ (debug_to_can_follow_vfork_prior_to_exec): Ditto.
+ (debug_to_insert_exec_catchpoint): Ditto.
+ (debug_to_remove_exec_catchpoint): Ditto.
+ (debug_to_core_file_to_sym_file): Ditto.
+ (setup_target_debug): Give new fields in current_target target_ops
+ vector values.
+
+ * target.h: Include symtab.h.
+ (target_waitkind): New enumerated values
+ TARGET_WAITKIND_SYSCALL_ENTRY, TARGET_WAITKIND_SYSCALL_RETURN,
+ TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED,
+ TARGET_WAITKIND_EXECD.
+ (target_waitstatus): Add a syscall_id field to structure.
+ (child_has_syscall_event): New decl.
+ (child_thread_alive): New decl.
+ (target_ops): Add 3 new fields: To_has_syscall_event,
+ to_enable_exception_callback, to_get_current_exception_event
+ (target_enable_exception_callback): New macro.
+ (target_has_syscall_event): New macro.
+ (target_get_current_exception_event): New macro.
+ (TARGET_DISABLE_HW_WATCHPOINTS): New macro.
+ (TARGET_ENABLE_HW_WATCHPOINTS): New macro.
+ (PC_REQUIRES_RUN_BEFORE_USE): New macro.
+ (target_tid_to_str): New macro.
+ (target_waitstatus): Additional fields in struct to keep track
+ of child pid and pathname to execd file.
+ (target_ops): Add in the new target_ops function pointer fields.
+ New macros to go along with new target_ops fields.
+ In target_waitstatus.value, change name of child_pid field to
+ related_pid.
+ (target_pid_or_tid_to_str): Define default macro.
+ Add missing #endif after PC_REQUIRES_RUN_BEFORE_USE definition
+ (ENSURE_VFORKING_PARENT_REMAINS_STOPPED): Define default macro.
+ (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK): Define default
+ macro.
+ There are new function decls for to_require_attach
+ and to_require_detach. There are also new macros,
+ target_require_attach and target_require_detach. There are
+ also new function decls for find_default_require_detach
+ and find_default_require_attach.
+ (target_ops): New fields to_post_wait, to_post_startup_inferior
+ to_acknowledge_created_inferior, to_clone_and_follow_inferior,
+ to_post_follow_inferior_by_clone, to_create_catch_fork_hook,
+ to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
+ to_post_follow_vfork, to_pid_to_exec_file.
+ New function definitions child_pid_to_exec_file, child_post_wait,
+ child_post_startup_inferior, child_acknowledge_created_inferior,
+ child_clone_and_follow_inferior,
+ child_post_follow_inferior_by_clone, child_create_catch_fork_hook,
+ child_create_catch_vfork_hook, child_has_forked,
+ child_has_vforked, child_acknowledge_created_inferior,
+ child_post_follow_vfork.
+ New macros target_post_startup_inferior,
+ target_acknowledge_created_inferior,
+ target_clone_and_follow_inferior,
+ target_post_follow_inferior_by_clone,
+ target_create_catch_fork_hook, target_create_catch_vfork_hook,
+ target_pid_to_exec_file.
+ (find_default_clone_and_follow_inferior): New function prototype.
+
+
+ * v850ice.c (init_850ice_ops): Init new target vector fields.
+
+ * valprint.c (print_binary_chars): Print out long long as
+ a binary number.
+ (print_octal_chars): Print out long long as an octal number
+ (print_decimal_chars): Print out long long as a decimal number
+ (strcat_longest): Define it.
+ * valprint.c: Hp merge, 4/15/98 snapshot
+ Add parameter to val_print. This is used for
+ evaluating C++ expressions.
+
+ * value.h (VALUE_POINTED_TO_OFFSET): New macro.
+ Add field pointed_to_offset to value structure.
+ Add prototypes for new functions in valops.c.
+ (write_register_pid): Change prototype to match
+ function.
+ (val_print function decl): Additional parameter.
+ (VALUE_EMBEDDED_OFFSET): New macro.
+ (find_rt_vbase_offset): New function decl -- for C++ support.
+
+Wed Dec 23 15:03:42 1998 Per Bothner <bothner@cygnus.com>
+
+ * Makefile.in (READLINE_CFLAGS): Search $(READLINE_SRC)/.. rather
+ than $(READLINE_SRC) so #include <readline/readline.h> will work.
+ * top.c: #include <readline/history.h> instead of "history.h".
+ * tracepoint.c: Likewise.
+ * mac-xdep.c: Likewise.
+
+Wed Dec 23 12:32:00 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * defs.h (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT): Define using
+ TARGET_BYTE_ORDER and not target_byte_order.
+
+Tue Dec 22 10:51:33 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/i386/cygwin.mh (TERMCAP): define.
+ (from Chris Faylor, cgf@cygnus.com)
+
+ * top.c: specify directory name for including readline.h
+
+ * tracepoint.c: ditto.
+
+ * utils.c: ditto.
+
+Mon Dec 21 13:30:34 1998 Mark Alexander <marka@cygnus.com>
+
+ * value.c (value_virtual_fn_field): Handle the situation where
+ vtbl is a pointer to a structure instead of a pointer to an array.
+
+Mon Dec 21 10:38:11 1998 Andrew Cagney <cagney@chook>
+
+ * mips-tdep.c: (MIPS_DEFAULT_FPU_TYPE): Default to
+ MIPS_FPU_DOUBLE.
+
+1998-12-17 J.T. Conklin <jtc@redbacknetworks.com>
+
+ * blockframe.c (get_frame_saved_regs): If the saved_regs_addr ptr
+ is null, ensure that saved registers are copied from the local
+ variable that was used to obtain them.
+
+Sat Dec 19 09:55:09 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * mips-tdep.c (mips32_heuristic_proc_desc): Clear temp_saved_regs
+ on restart. Fixes problem with backtracing through functions that
+ use virtual frame pointers.
+
+Fri Dec 18 14:23:34 1998 Andrew Cagney <cagney@chook>
+
+ * mips-tdep.c (mips_push_arguments): Don't left-shift small
+ structs being passed in a register when an O64 target.
+
+ * config/mips/tm-mips.h (enum mips_fpu_type, mips_fpu): Move to
+ mips-tdep.c.
+
+ * mips-tdep.c (mips_fpu_string): Delete variable.
+ (mips_fpu_type_auto): New variable.
+ (mips_fpu_type): Rename mips_fpu.
+ (_initialize_mips_tdep): Delete initialization of mips_fpu et.al.
+ Rewrite ``set mipsfpu'' command set.
+ (set_mipsfpu_command, show_mipsfpu_command,
+ set_mipsfpu_single_command, set_mipsfpu_double_command,
+ set_mipsfpu_none_command, set_mipsfpu_auto_command): New
+ functions, handle commands.
+ (mips_push_arguments, mips_push_dummy_frame, mips_pop_frame,
+ mips_extract_return_value): Update.
+ (_initialize_mips_tdep): Set mips_fpu_type according to current
+ processor.
+ (_initialize_mips_tdep): Only define ``set processor'' command
+ when not multi-sim.
+
+Fri Dec 18 12:56:56 1998 Andrew Cagney <cagney@chook>
+
+ * gdbarch.h (gdbarch_init_ftype): Pass struct gdbarch_info
+ by-value.
+ (struct gdbarch_info): Add struct gdbarch_tdep_info *tdep_info.
+ * gdbarch.c (gdbarch_update): Update.
+ * mips-tdep.c: (mips_gdbarch_init): Update
+
+ * gdbarch.c (gdbarch_update): Add more tracing.
+
+Thu Dec 17 02:15:40 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * configure.tgt (gdb_target): Identify mips64*vr4100*-*-elf* as
+ vr4100.
+ * config/mips/vr4100.mt, config/mips/tm-vr4100.h: Replace
+ vr4xxx.mt and tm-vr4xxx.h.
+
+Thu Dec 17 02:06:17 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): New function. Initialize a MIPS
+ architecture vector.
+ (_initialize_mips_tdep): Register MIPS with GDBARCH.
+ (struct gdbarch_tdep): Define.
+ (MIPS_EABI, MIPS_LAST_FP_ARG_REGNUM, MIPS_LAST_ARG_REGNUM): When
+ multi-arch, get value from gdbarch->tdep.
+
+Thu Dec 17 02:01:58 1998 Andrew Cagney <cagney@chook>
+
+ * gdbtypes.c (_initialize_gdbtypes): Register all builtin types
+ with gdbarch so that they are updated whenever the architecture is
+ changed.
+
+Thu Dec 17 01:58:16 1998 Andrew Cagney <cagney@chook>
+
+ * gdbarch.h (GDB_MULTI_ARCH): New macro, default to zero.
+ (current_gdbarch): Current architecture pointer.
+ * gdbarch.c (struct gdbarch): Define.
+
+ * gdbarch.h (TARGET_ARCHITECTURE, TARGET_BYTE_ORDER,
+ TARGET_LONG_BIT, TARGET_LONG_LONG_BIT, TARGET_PTR_BIT): When
+ multi-arch force definition.
+ * gdbarch.h, gdbarch.c (gdbarch_tdep, gdbarch_bfd_arch_info,
+ gdbarch_byte_order, {set,}gdbarch_long_bit,
+ {set,}gdbarch_long_long_bit, {set,}gdbarch_ptr_bit): Corresponding
+ functions.
+
+ * gdbarch.h (struct gdbarch_list, struct gdbarch_info,
+ gdbarch_init_ftype), gdbarch.c (register_gdbarch_init): Mechanism
+ for registering an architecture with GDB.
+ (gdbarch_list_lookup_by_info, gdbarch_alloc, gdbarch_update,
+ verify_gdbarch): Support functions.
+
+ * gdbarch.h (gdbarch_data_ftype), gdbarch.c
+ (register_gdbarch_data, gdbarch_data): Mechanism for maintaining
+ per-architecture pointers.
+ (init_gdbarch_data): Support functions.
+
+ * gdbarch.h (gdbarch_swap_ftype), gdbarch.c
+ (register_gdbarch_swap): Ditto for swapped memory regions.
+ (init_gdbarch_swap, swapout_gdbarch_swap, swapin_gdbarch_swap):
+ Support functions.
+
+ * gdbarch.c (set_endian_big, set_endian_little, set_architecture,
+ info_architecture, set_gdbarch_from_file): Hook in multi-arch
+ code by calling gdbarch_update.
+ (default_gdbarch): Default multi-arch vector. Use host's type
+ system for values.
+
+Thu Dec 17 01:34:36 1998 Andrew Cagney <cagney@chook>
+
+ * gdbtypes.c (build_gdbtypes): New function.
+ (_initialize_gdbtypes): Call.
+
+Wed Dec 16 11:47:00 1998 Andrew Cagney <cagney@chook>
+
+ * gdbarch.c (show_architecture): Use TARGET_ARCHITECTURE.
+ * gdbarch.h, gdbarch.c: Fix typo's. Use struct's in preference to
+ types.
+ * gdbarch.h, gdbarch.c (gdbarch_debug): Add ``set archdebug'' to
+ command set.
+
+Tue Dec 15 23:46:40 1998 Andrew Cagney <cagney@chook>
+
+ * config/mips/tm-*.h: (TARGET_BYTE_ORDER_DEFAULT,
+ TARGET_BYTE_ORDER_SELECTABLE_P): Replace TARGET_BYTE_ORDER and
+ TARGET_BYTE_ORDER_SELECTABLE.
+
+1998-12-14 Anthony Thompson (athompso@cambridge.arm.com)
+
+ * remote-rdp.c (rdp_init): Don't discard first character on reset.
+ (translate_open_mode): Define table.
+ (exec_swi): Handle SWI_Clock. SWI_Open now handles stdin/stdout.
+ SWI_Write returns number of bytes not written. SWI_Read does the
+ same. SWI_Seek should return success/failure flag. Fix SWI_Flen.
+
+1998-12-14 J.T. Conklin <jtc@redbacknetworks.com>
+
+ * config/i386/nbsd.mh, config/m68k/nbsd.mh, config/ns32k/nbsd.mh
+ (XDEPFILES): Add ser-tcp.o.
+
+Mon Dec 14 14:46:13 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * monitor.c (monitor_expect, monitor_printf_noecho,
+ monitor_printf): Always compile EXTRA_RDEBUG code.
+ (RDEBUG): Ditto.
+
+ From Michael Meissner <meissner@cygnus.com>:
+ * ppcbug-rom.c (init_ppc_cmds): Cleanup formatting.
+
+1998-12-08 Michael Meissner <meissner@cygnus.com>
+
+ * monitor.c (monitor_printable_string): New function to convert a
+ string into a printable representation.
+ (monitor_error): Call error after converting string into printable
+ format.
+ (monitor_printf{,_noecho}): If EXTRA_RDEBUG is defined, convert
+ string into printable form before printing.
+ (monitor_expect): Ditto.
+ (monitor_read_memory{,_single}): Call monitor_error, not error.
+ (monitor_read_memory): Return immediately if length is 0.
+
+ * ppcbug-rom.c (init_ppc_cmds): Fill in dump_registers field,
+ which is now required.
+
+Mon Dec 14 11:01:39 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Consolidate the semi-dynamic target system
+ dependant GDB parameters.
+ (set_gdbarch_from_file): Combine set_architecture_from_file and
+ set_byte_order_from_file.
+ * top.c, defs.h, printcmd.c: Delete them from here.
+ * Makefile.in: Add gdbarch.[ch].
+ * exec.c (exec_file_command): Call set_gdbarch_from_file.
+
+Sun Dec 13 09:52:51 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN): Define.
+ (TARGET_ARCHITECTURE, TARGET_ARCHITECTURE_AUTO): Define.
+ (TARGET_BYTE_ORDER_AUTO): Define.
+ (TARGET_BYTE_ORDER_SELECTABLE_P): Provide default. Replaces
+ TARGET_BYTE_ORDER_SELECTABLE. Handle compat issues.
+ (BITS_BIG_ENDIAN): Simplify.
+ (TARGET_FLOAT_FORMAT): Ditto.
+ (TARGET_DOUBLE_FORMAT):
+
+ * remote-e7000.c, sh-tdep.c, printcmd.c, remote-sim.c,
+ remote-rdi.c, sparc-tdep.c: Update.
+
+ * config/powerpc/tm-ppcle-eabi.h, config/rs6000/tm-rs6000.h,
+ config/powerpc/tm-ppc-eabi.h, config/mn10300/tm-mn10300.h:
+ Convert.
+
+Sat Dec 12 09:28:13 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * frame.h (struct frame_info): Add CORE_ADDR *saved_regs and
+ struct frame_extra_info *extra_info.
+ (frame_obstack_alloc, frame_saved_regs_zalloc): Prototype.
+ (SIZEOF_FRAME_SAVED_REGS): Provide default.
+ (FRAME_INIT_SAVED_REGS): Provide default.
+ (struct frame_saved_regs): Deprecate.
+ (EXTRA_FRAME_INFO): Deprecate.
+
+ * blockframe.c (frame_obstack_alloc, frame_saved_regs_zalloc): New
+ function.
+ (generic_get_saved_register): Use FRAME_INIT_SAVED_REGS and
+ frame->saved_regs.
+ (frame_cache_obstack): Make static.
+ (get_frame_saved_regs): Deprecate. Copy the saved regs into the
+ frame buffer.
+
+ * stack.c (frame_info): Rewrite using frame->saved_regs and
+ FRAME_INIT_SAVED_REGS.
+ * findvar.c (find_saved_register): Ditto.
+
+ * config/mn10300/tm-mn10300.h (EXTRA_FRAME_INFO): Delete.
+ (FRAME_FIND_SAVED_REGS): Replace with FRAME_INIT_SAVED_REGS. No-op.
+ * mn10300-tdep.c: Update.
+ (analyze_dummy_frame): New function.
+ (struct frame_extra_info): Define.
+ (mn10300_init_extra_frame_info): Update.
+
+ * config/rs6000/tm-rs6000.h: (EXTRA_FRAME_INFO): Delete.
+ (FRAME_FIND_SAVED_REGS): Replace with FRAME_INIT_SAVED_REGS.
+ (FRAME_ARGS_ADDRESS): Replace with function.
+
+ * rs6000-tdep.c (frame_get_saved_regs): Rename from
+ frame_get_cache_fsr.
+ (rs6000_init_extra_frame_info): New function.
+ (rs6000_frame_init_saved_regs): Call frame_get_saved_regs.
+ (FUNCTION_START_OFFSET): Delete references, was ZERO.
+ (rs6000_frame_args_address): New function.
+ (frame_initial_stack_address): Update
+
+ * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Remove saved_regs.
+ (FRAME_INIT_SAVED_REGS): Rename FRAME_FIND_SAVED_REGS, update.
+ * mips-tdep.c (mips_find_saved_regs, read_next_frame_reg,
+ init_extra_frame_info, mips_pop_frame): Update.
+ * config/alpha/tm-alpha.h (FRAME_INIT_SAVED_REGS,
+ EXTRA_FRAME_INFO), alpha-tdep.c (alpha_find_saved_regs,
+ alpha_pop_frame, init_extra_frame_info): Ditto.
+
+ * i960-tdep.c, m88k-tdep.c, h8300-tdep.c: Update.
+ * config/sparc/tm-sparc.h, config/a29k/tm-a29k.h: Define
+ FRAME_INIT_SAVED_REGS as no-op.
+
+ * z8k-tdep.c (z8k_init_frame_saved_regs): Rename
+ get_frame_saved_regs.
+ (examine_frame, z8k_skip_prologue): Update.
+ * config/z8k/tm-z8k.h (FRAME_INIT_SAVED_REGS): Define.
+
+1998-12-11 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From J.T. Conklin <jtc@redbacknetworks.com>:
+ * i386-stub.c (handle_exception): Add support for 'P' command.
+ (NUMREGS): New macro.
+
+Fri Dec 11 09:07:05 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * i386b-nat.c: Include "expression.h".
+
+ * symtab.h: Don't include "gnu-regex.h".
+
+ * solib.c (solib_add_common_symbols): Cast parameters passed to
+ make_cleanup to use the new make_cleanup_func typedef.
+
+ * inftarg.c: Include "wait.h" after, rather than before, <wait.h>.
+ "wait.h" was defining all WIF* macro's instead of filling in those
+ that <wait.h> missed.
+
+Fri Dec 11 09:52:04 1998 Andrew Cagney <cagney@chook>
+
+ * mipsm3-nat.c, hppah-nat.c, infptrace.c, i386gnu-nat.c,
+ hppab-nat.c, core-aout.c, arm-xdep.c, alpha-nat.c, altos-xdep.c,
+ pyr-xdep.c, remote-st.c, remote-os9k.c, tahoe-tdep.c, pyr-tdep.c,
+ vax-tdep.c: Replace reg_name with REGISTER_NAME.
+
+Thu Dec 10 15:19:40 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by Jim Blandy <jimb@cygnus.com>,
+ Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
+ <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
+ Taylor <taylor@cygnus.com>, as part of the project to merge in
+ changes originally made by HP; HP did not create ChangeLog
+ entries.
+
+ * annotate.c (annotate_catchpoint): New function.
+
+ * annotate.h (annotate_catchpoint): declare it; add new includes
+ (symtab.h and gdbtypes.h).
+
+ * buildsym.h: add external var processing_hp_compilation.
+
+ * coff-solib.h:
+ (SOLIB_REMOVE_INFERIOR_HOOK): new macro. defined to 0.
+ functionality not implemented for coff.
+ (SOLIB_CREATE_CATCH_LOAD_HOOK): New macro; generate error msg for coff.
+ (SOLIB_CREATE_CATCH_UNLOAD_HOOK): ditto.
+ (SOLIB_HAVE_LOAD_EVENT): ditto.
+ (SOLIB_LOADED_LIBRARY_PATHNAME): ditto.
+ (SOLIB_HAVE_UNLOAD_EVENT): ditto.
+ (SOLIB_UNLOADED_LIBRARY_PATHNAME): ditto.
+ (SOLIB_IN_DYNAMIC_LINKER): ditto.
+ (SOLIB_RESTART): ditto.
+
+ * complaints.h: add ifdef...endif pair at beginning and end of file.
+
+ * dstread.c (dst_symfile_read): the parameter to fileno
+ must be of type FILE *. So cast abfd->iostream in the
+ call to fileno must be cast as a FILE *, not a GDB_FILE *.
+ This will work because abfd->iostream is declared and
+ given a value in bdf and bfd will continue to use FILE
+ rather than GDB_FILE.
+
+ * dwarf2read.c (dwarf_bool_name): change parameter from bool
+ to mybool. sigh.
+
+ * expression.h: include symtab.h
+
+ * frame.h (print_only_stack_frame, show_stack_frame,
+ show_frame_info): add prototypes.
+
+ * gdbcmd.h (togglelist, stoplist): declare.
+
+ * gdbcore.h (read_memory_string): declare it.
+ (exec_file_attach): add prototype.
+
+ * inflow.c (terminal_is_ours): make non static.
+
+ * minsyms.c: minor spacing change.
+
+ * parser-defs.h (parse_nested_classes_for_hpacc): add prototype.
+ (find_template_name_end): add prototype.
+
+ * scm-lang.c (scm_unpack): cast svalue to (int).
+
+ * top.h: declare it.
+
+ * valprint.h (print_binary_chars): new prototype definition.
+ (print_octal_chars): new prototype definition.
+ (print_decimal_chars): new prototype definition.
+
+Thu Dec 10 07:14:56 1998 Andrew Cagney <cagney@chook>
+
+ * config/arm/tm-arm.h, arm-tdep.c: Replace REGISTER_NAMES with
+ REGISTER_NAME.
+ * mn10300-tdep.c, config/mn10300/tm-mn10300.h: Ditto.
+ * sh-tdep.c, config/sh/tm-sh.h: Ditto.
+
+ * defs.h (REGISTER_NAME): Provide default for old targets.
+ * defs.h, infcmd.c: Rename reg_names to gdb_register_names.
+
+ * tracepoint.c, target.c, parse.c, infcmd.c, remote-udi.c,
+ expprint.c, infcmd.c, printcmd.c, eval.c, stack.c, findvar.c,
+ remote-udi.c, config/alpha/tm-alpha.h, remote-sim.c, d30v-tdep.c,
+ config/mips/tm-mips.h, hppa-tdep.c: Use REGISTER_NAME.
+
+1998-12-08 James E Wilson <wilson@wilson-pc.cygnus.com>
+
+ * config/i960/mon960.mt (SIM_OBJS, SIM): Define.
+
+Tue Dec 8 16:49:24 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Add mentions of newly-added configurations.
+
+1998-12-08 Philippe De Muyter <phdm@macqel.be>
+
+ * config/xm-aix4.h (SIGWINCH_HANDLER): Function `aix_resize_window'
+ must accept a signal number as parameter.
+ * config/rs6000/xm-rs6000.h (SIGWINCH_HANDLER): Ditto.
+ * utils.c (initialize_utils): Give a parameter to `SIGWINCH_HANDLER'.
+
+ * inferior.h (register_valid): Variable's type is `SIGNED char', not
+ `char'.
+ * findvar.c (register_valid): Ditto.
+
+ * defs.h (make_cleanup_func): Protect parameter list by `PARAMS'.
+ * gdbthread.h (unbind_target_thread_vector): Likewise.
+
+Tue Dec 8 15:09:44 1998 Edith Epstein <eepstein@sophia.cygnus.com>
+
+ Merged in m68k-linux patch from Andreas Schwab
+
+ 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * Makefile.in, configure.host, configure.tgt: Add support for
+ m68k-linux.
+ * config/m68k/linux.mh: New file.
+ * config/m68k/linux.mt: New file.
+ * config/m68k/nm-linux.h: New file.
+ * config/m68k/tm-linux.h: New file.
+ * config/m68k/xm-linux.h: New file.
+ * gdb/m68klinux-nat.c: New file.
+ * gdbserver/low-linux.c: Add support for m68k-linux.
+ * gdb/config/m68k/tm-m68k.h (NUM_FREGS): New macro.
+
+1998-12-07 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/i386/xm-cygwin.h: Remove REQUEST_QUIT definition.
+ * config/powerpc/xm-cygwin.h: Ditto.
+
+1998-12-07 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * rs6000-tdep.c (pop_frame): Correctly find the registers saved in
+ the stack frame. Their offset from the previous stack frame is in
+ fdata.gpr_offset and fdata.fpr_offset, not fdata.offset.
+ (gdb.base/return.exp)
+ * config/rs6000/tm-rs6000.h: Doc fixes.
+
+1998-12-03 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * monitor.c (monitor_read_memory): Zero out pattern buffers
+ before calling re_search.
+ (parse_register_dump): Ditto.
+
+Thu Dec 3 10:37:22 EST 1998 Zdenek Radouch (radouch@cygnus.com)
+
+ FR30 updates - still very preliminary.
+ * configure.tgt
+ * fr30-tdep.c
+ * config/fr30/tm-fr30.h
+
+Thu Dec 3 16:30:35 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ax-gdb.c: Include target.h.
+
+Tue Dec 3 10:59:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ax-gdb.c (_initialize_ax_gdb), i960-tdep.c (pop_frame),
+ monitor.c (flush_monitor_dcache, longlongendswap), remote-array.c
+ (hexword2ascii), w89k-rom.c (init_w89k_cmds), z8k-tdep.c
+ (init_frame_pc, extract_return_value): Make return type void.
+ * monitor.c (monitor_write_even_block): Make return type explicit.
+ (monotor_read_memory_block): Delete function.
+ * monitor.h: Update.
+ * remote.c (remote_get_threadlist, remote_update_threads),
+ remote-array.c (array_get_packet), remote-rdi.c (Fail): Always
+ return a value.
+ * m32r-tdep.c (m32r_fix_call_dummy): From Michael Snyder, void
+ function.
+ * jv-valprint.c (java_val_print): From Stu Grossman. Return 0 by
+ default.
+
+Wed Dec 2 15:11:38 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c: Move default definition of
+ TARGET_VIRTUAL_FRAME_POINTER from here to target.h.
+ * target.h: Add default definition of TARGET_VIRTUAL_FRAME_POINTER.
+ * ax-gdb.c (gen_frame_args_address, gen_frame_locals_address):
+ use TARGET_VIRTUAL_FRAME_POINTER to determine frame pointer.
+ (gen_trace_for_expr): new argument, address of tracepoint,
+ gets passed to new_agent_expr and added to struct agent_expr.
+ (is_nontrivial_conversion): call to new_agent_expr now requires
+ a dummy argument. (agent_command): use get_current_frame() to
+ get current PC scope; pass it to gen_trace_for_expr.
+ * ax-general.c (new_agent_expr): new argument, address of
+ tracepoint; store it in new field of struct agent_expr.
+ * ax.h (struct agent_expr): add new field for tracepoint address.
+ * ax-gdb.h: change prototypes to match above changes.
+
+ * m32r-tdep.c (decode_prologue): If no branch or push fp is found,
+ but there's a stack adjust, then use that as the end of prologue.
+ (m32r_skip_prologue): don't skip past the first line if there is
+ line info. (m32r_virtual_frame_pointer): new function.
+ (m32r_fix_call_dummy): no return value needed.
+
+Tue Dec 1 10:59:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ocd.c (remote_timeout), (BDM_BREAKPOINT), monitor.c (readchar),
+ remote.c: Cleanup closing of open comments.
+
+Mon Nov 30 16:04:03 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * config/fr30/tm-fr30.h (INNER_THAN): Add parameters.
+
+Mon Nov 30 11:18:48 1998 Andrew Cagney <cagney@chook>
+
+ * frame.h (FRAME_CHAIN_VALID): Default to
+ default_frame_chain_valid.
+ * blockframe.c (default_frame_chain_valid): New function.
+
+ * frame.h (FRAME_CHAIN_VALID_ALTERNATIVE): Delete references
+ * blockframe.c (alternate_frame_chain_valid): New function.
+ * config/mips/tm-mipsv4.h, config/m88k/tm-delta88v4.h,
+ config/m68k/tm-monitor.h, config/m68k/tm-m68kv4.h,
+ config/i386/tm-i386v4.h, config/i386/tm-i386nw.h,
+ config/h8300/tm-h8300.h: Update.
+
+ * blockframe.c (nonnull_frame_chain_valid): New function.
+ * config/m68k/tm-os68k.h, config/m68k/tm-vx68.h,
+ config/m68k/tm-apollo68b.h, config/i960/tm-vx960.h,
+ config/arc/tm-arc.h: Update FRAME_CHAIN_VALID.
+
+ * hppa-tdep.c (frame_chain_valid, hppa_frame_chain_valid),
+ remote-vx29k.c (get_fp_contents, vx29k_frame_chain_valid),
+ arm-tdep.c (frame_chain_valid, arm_frame_chain_valid): Rename
+ functions so that they are name space clean.
+ * config/pa/tm-hppa.h, config/a29k/tm-vx29k.h,
+ config/arm/tm-arm.h: Update FRAME_CHAIN_VALID.
+
+ * gould-tdep.c (gould_frame_chain_valid), d30v-tdep.c
+ (d30v_frame_chain_valid), d10v-tdep.c (d10v_frame_chain_valid):
+ New functions.
+ * config/gould/tm-np1.h, config/gould/tm-pn.h,
+ config/d30v/tm-d30v.h, config/d10v/tm-d10v.h: Update
+ FRAME_CHAIN_VALID.
+
+Sun Nov 29 11:18:37 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * z8k-tdep.c (z8k_addr_bits_remove), w65-tdep.c
+ (w65_addr_bits_remove), h8500-tdep.c (h8500_addr_bits_remove),
+ m88k-tdep.c (m88k_addr_bits_remove): Function to clean up an
+ address.
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/m88k/tm-m88k.h,
+ config/h8500/tm-h8500.h: Define ADDR_BITS_REMOVE to call targets
+ corresponding function.
+ * z8k-tdep.c (saved_pc_after_call): Update.
+
+Sat Nov 28 12:24:31 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h,
+ config/v850/tm-v850.h, config/tahoe/tm-tahoe.h,
+ config/sparc/tm-sparc.h, config/sh/tm-sh.h,
+ config/rs6000/tm-rs6000.h, config/pyr/tm-pyr.h,
+ config/pa/tm-hppa.h, config/ns32k/tm-umax.h,
+ config/ns32k/tm-merlin.h, config/none/tm-none.h,
+ config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
+ config/mips/tm-mips.h, config/m88k/tm-m88k.h,
+ config/m68k/tm-m68k.h, config/m32r/tm-m32r.h,
+ config/i960/tm-i960.h, config/i386/tm-i386.h,
+ config/h8500/tm-h8500.h, config/h8300/tm-h8300.h,
+ config/gould/tm-pn.h, config/gould/tm-np1.h, config/arm/tm-arm.h,
+ config/convex/tm-convex.h, config/d10v/tm-d10v.h,
+ config/alpha/tm-alpha.h, config/a29k/tm-a29k.h: Add parameters to
+ macro INNER_THAN.
+
+ * valops.c (push_word, value_push, call_function_by_hand),
+ breakpoint.c (bpstat_stop_status), blockframe.c
+ (generic_push_dummy_frame, generic_frame_chain_valid), inferior.h
+ (PC_IN_CALL_DUMMY), infrun.c (wait_for_inferior): Update use of
+ INNER_THAN.
+
+Fri Nov 27 11:00:25 1998 Andrew Cagney <cagney@chook>
+
+ * target.h (one_stepped): Move global from here.
+ * infrun.c (singlestep_breakpoints_inserted_p): To here. Rename.
+ Make static.
+ (wait_for_inferior): Update.
+ (resume): Update. Set variable after call to SOFTWARE_SINGLE_STEP.
+
+ * target.h (NO_SINGLE_STEP): Replace with SOFTWARE_SINGLE_STEP_P
+ and SOFTWARE_SINGLE_STEP.
+ * config/sparc/tm-sparc.h, config/rs6000/tm-rs6000.h,
+ config/arc/tm-arc.h: Update.
+ * rs6000-tdep.c (rs6000_software_single_step), sparc-tdep.c
+ (sparc_software_single_step), arc-tdep.c (arc_single_step): New
+ functions. Replace function single_step.
+
+ * config/mips/tm-mips.h (STEP_SKIPS_DELAY_P): Define.
+ * infrun.c (proceed): Cleanup.
+
+Thu Nov 26 11:19:15 1998 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/alpha/tm-alpha.h (ABOUT_TO_RETURN): Replace macro.
+ * alpha-tdep.c (alpha_about_to_return): With new function.
+ (heuristic_proc_start): Update.
+ * config/mips/tm-mips.h (ABOUT_TO_RETURN), mips-tdep.c
+ (heuristic_proc_start, mips_about_to_return): Ditto.
+ * config/ns32k/tm-merlin.h (ABOUT_TO_RETURN),
+ config/ns32k/tm-umax.h (ABOUT_TO_RETURN), ns32k-tdep.c
+ (ns32k_about_to_return, ns32k_get_enter_addr): Ditto.
+
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h,
+ config/tahoe/tm-tahoe.h, config/sparc/tm-sparc.h,
+ config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pyr/tm-pyr.h,
+ config/pa/tm-hppa.h, config/m88k/tm-m88k.h, config/m68k/tm-m68k.h,
+ config/i960/tm-i960.h, config/i386/tm-i386.h,
+ config/h8500/tm-h8500.h, config/h8300/tm-h8300.h,
+ config/gould/tm-pn.h, config/gould/tm-np1.h,
+ config/convex/tm-convex.h, config/arm/tm-arm.h,
+ config/arc/tm-arc.h, config/a29k/tm-a29k.h: Delete macro
+ ABOUT_TO_RETURN.
+ * config/w65/tm-w65.h (RTL, RTS): Delete macros.
+ * h8500-tdep.c (about_to_return): Delete function.
+
+Thu Nov 26 11:19:15 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * rs6000-tdep.c (rs6000_breakpoint_from_pc): Change big_breakpoint
+ and little_breakpoint to char[] from char*.
+ * remote-array.c (array_insert_breakpoint): Change bp_addr to
+ CORE_ADDR type.
+
+Wed Nov 25 00:13:06 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * vx-share/xdr_ld.c (xdr_ldtabl): Cast second arg to char**
+ instead of char*.
+
+ * configure.tgt (v850): Only build v850ice when cygwin and gui.
+ * configure.in: Add parameter to --enable-build-warnings.
+ * configure: Re-build.
+
+ * c-exp.y (parse_number): Rewrite shift to pacify GCC.
+
+ * config/i960/tm-i960.h (BREAKPOINT): Delete definition - simply
+ wrong.
+
+ * monitor.c (compile_pattern): Make val const char*.
+ (monitor_wait_cleanup): Make old_timeout void*, pointing at
+ old_timeout.
+ (monitor_wait): Update.
+
+ * remote-udi.c, remote-sim.c, remote-e7000.c, hppa-tdep.c,
+ remote-mips.c, sparcl-tdep.c, xcoffread.c: Cast parameters passed
+ to make_cleanup to use the new make_cleanup_func typedef.
+
+ * alpha-tdep.c (MASK): Use LONGEST to avoid arithmetic overflow.
+
+ * config/a29k/tm-a29k.h (TRANSPARENT): Rename macro to
+ TRANSPARENT_FRAME. Avoid name-space clash.
+ * a29k-tdep.c (init_frame_info): Update.
+
+Wed Nov 25 20:37:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * rs6000-tdep.c (rs6000_breakpoint_from_pc): Change big_breakpoint
+ and little_breakpoint to char[] from char*.
+ * mem-break.c (memory_insert_breakpoint,
+ memory_remove_breakpoint): Pass address of bplen.
+ * remote-array.c (array_insert_breakpoint): Change bp_addr to
+ CORE_ADDR type.
+
+Tue Nov 24 15:46:33 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/mn10300/tm-mn10300.h (TARGET_VIRTUAL_FRAME_POINTER):
+ new target macro.
+ * mn10300-tdep.c (mn10300_virtual_frame_pointer): new function.
+ * tracepoint.c (encode_actions): Use the new target macro to
+ determine the virtual frame pointer, for collecting locals/args.
+ (add_local_symbols, collect_symbol): add a register/offset pair of
+ arguments so that the virtual frame pointer can be passed in.
+
+1998-11-24 Felix Lee <flee@cygnus.com>
+
+ * procfs.c (procfs_wait): handle syscall events first.
+
+ * procfs.c (GDB_GREGSET_TYPE, GDB_FPREGSET_TYPE): new macros.
+ * config/sparc/xm-sun4sol2.h: use them.
+ * core-sol2.c: don't #undef gregset_t and fpregset_t.
+ * sol-thread.c: ditto.
+ * sparc-tdep.c: ditto.
+
+Tue Nov 24 14:13:10 1998 Andrew Cagney <cagney@chook>
+
+ * breakpoint.c (memory_breakpoint_size): Delete global.
+ (read_memory_nobpt): Determine real breakpoint address and size
+ using BREAKPOINT_FROM_PC.
+
+ * defs.h (breakpoint_from_pc_fn): BREAKPOINT_FROM_PC function
+ template.
+ * target.h, mem-break.c (memory_breakpoint_from_pc):
+ Rewrite. Always define. Return NULL when memory breakpoints are
+ not supported.
+ (memory_insert_breakpoint, memory_remove_breakpoint): Call
+ BREAKPOINT_FROM_PC.
+ * target.h (BREAKPOINT_FROM_PC): Provide default.
+ * gdbint.texinfo (BREAKPOINT_FROM_PC): Document.
+
+ * config/rs6000/tm-rs6000.h (BREAKPOINT): Delete macro.
+ (BREAKPOINT_FROM_PC): Define.
+ ({BIG,LITTLE}_BREAKPOINT): Move macros from here.
+ * rs6000-tdep.c: To here.
+ (rs6000_breakpoint_from_pc): New function.
+
+ * config/mn10300/tm-mn10300.h (BREAKPOINT): Delete macro.
+ (BREAKPOINT_FROM_PC): Define, call.
+ * mn10300-tdep.c (mn10300_breakpoint_from_pc): New function.
+
+ * config/mips/tm-mips.h ({BIG,LITTLE}_BREAKPOINT,
+ IDT_{BIG,LITTLE}_BREAKPOINT, PMON_{BIG,LITTLE}_BREAKPOINT,
+ MIPS16_{BIG,LITTLE}_BREAKPOINT): Move macros from here.
+ * mips-tdep.c: To here.
+
+ * config/arm/tm-arm.h ({BIG,LITTLE}_BREAKPOINT): Delete macros.
+ ({ARM,THUMB}_{BE,LE}_BREAKPOINT): Move macros from here.
+ * arm-tdep.c: To here.
+
+ * remote-array.c (memory_breakpoint_size): Delete variable.
+ (array_insert_breakpoint): Obtain breakpoint size using
+ BREAKPOINT_FROM_PC.
+ * remote-st.c (memory_breakpoint_size, st2000_insert_breakpoint):
+ Ditto.
+ * remote-os9k.c (memory_breakpoint_size,
+ rombug_insert_breakpoint): Ditto.
+ * remote-e7000.c (memory_breakpoint_size): Ditto.
+
+Mon Nov 23 11:38:40 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * symfile.c (deduce_language_from_filename): rewrite so as to
+ work from a table of filename extensions, modifiable by the user.
+ (filename_language_table): new data structure.
+ (set_ext_lang_command): new function for new command, "set
+ extension-language". (info_extension_language_command): new
+ function for new command "info extension-languages".
+ (add_filename_language, init_filename_language_table): new
+ support functions for the above.
+ * language.c (language_enum): new function. Support for above.
+
+Mon Nov 23 10:47:54 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * config/sh/tm-sh.h, config/mn10200/tm-mn10200.h,
+ config/m32r/tm-m32r.h, config/arm/tm-arm.h, config/i960/tm-i960.h,
+ config/gould/tm-np1.h, config/d10v/tm-d10v.h,
+ config/v850/tm-v850.h, config/pa/tm-hppa.h, config/a29k/tm-a29k.h,
+ config/mn10300/tm-mn10300.h, config/mips/tm-mips.h
+ (USE_STRUCT_CONVENTION): Cleanup, define macro as function.
+
+ * sh-tdep.c (sh_use_struct_convention), mn10200-tdep.c
+ (mn10200_use_struct_convention), i960-tdep.c
+ (i960_use_struct_convention), gould-tdep.c
+ (gould_use_struct_convention), d10v-tdep.c
+ (d10v_use_struct_convention), v850-tdep.c
+ (v850_use_struct_convention), hppa-tdep.c
+ (hpha_use_struct_convention), m32r-tdep.c
+ (m32r_use_struct_convention), arm-tdep.c
+ (arm_use_struct_convention), mn10300-tdep.c
+ (mn10300_use_struct_convention), a29k-tdep.c
+ (a29k_use_struct_convention), mips-tdep.c
+ (mips_use_struct_convention): New functions
+
+ * value.h, values.c (generic_use_struct_convention): New function,
+ replace macro.
+ * values.c (USE_STRUCT_CONVENTION): Macro defaults to function
+ generic_use_struct_convention.
+
+Sat Nov 21 17:15:40 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * breakpoint.c (bpstat_stop_status): Do not increment hit_count
+ of breakpoint if condition is not true.
+
+ * coffread.c (coff_symtab_read): Discard C_LABEL's that are not
+ function entry points, to avoid getting them in the stack dump
+ instead of the actual function.
+
+ * config/m68k/delta68.mh (NAT_FILE): Undo 1998-08-18 change;
+ without NAT_FILE definition, configure will assume that GDB cannot
+ run native.
+ * config/m68k/nm-delta68.h (KERNEL_U_SIZE): New macro.
+ * delta68-nat.c (kernel_u_size): New function.
+
+Fri Nov 20 10:13:03 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * buildsym.c (end_symtab): Cleanup PROCESS_LINENUMBER_HOOK.
+
+Thu Nov 19 15:21:04 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * rdi-share/host.h: if compiling under Cygwin, make sure new
+ preprocessor define is defined. Define it if not.
+ * rdi-share/hostchan.h: ditto
+ * rdi-share/aclocal.m4: regenerate
+ * rdi-share/configure: regenerate
+
+Thu Nov 19 14:43:44 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: switch back to checking __CYGWIN32__
+ * configure: regenerate
+
+Thu Nov 19 09:53:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * exec.c (exec_file_command): Cleanup. Replace #if
+ NEED_TEXT_START_END with if().
+ * config/pa/nm-hppah.h (NEED_TEXT_START_END): Redefine to be 1.
+ * config/convex/tm-convex.h (NEED_TEXT_START_END): Ditto.
+ * config/gould/tm-np1.h (NEED_TEXT_START_END): Ditto.
+ * config/a29k/tm-a29k.h (NEED_TEXT_START_END): Ditto.
+
+Thu Nov 19 13:06:22 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * main.c: Wait until more time has passed before calling
+ new cygwin_ funcs, revert back to the cygwin32_ ones for now.
+ * win32-nat.c: Ditto.
+
+Wed Nov 18 15:03:17 1998 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * 29k-share/udi/udip2soc.c (UDIConnect): Replace sys_errlist with
+ strerror.
+
+Mon Nov 16 14:17:05 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * defs.h: if compiling under Cygwin, define __CYGWIN__ if
+ __CYGWIN32__ is defined and __CYGWIN__ isn't for backwards
+ compatibility.
+
+Fri Nov 13 00:15:08 1998 Geoffrey Noer <noer@cygnus.com>
+
+ Changes to account for name change from cygwin32 to cygwin and
+ clean up Win32-related ifdefs.
+
+ * configure.tgt: check for cygwin* instead of cygwin32.
+ New cygwin gdb_target variable loses the "32".
+ * configure.host: check for cygwin* instead of cygwin32.
+ New cygwin gdb_host variable loses the "32".
+ * configure.in: test __CYGWIN__ instead of __CYGWIN32__,
+ rename gdb_cv_os_cygwin32 variable to drop the "32". Call
+ AM_EXEEXT instead of AC_EXEEXT since that isn't in a released
+ autoconf yet.
+ * configure: regenerate.
+
+ * main.c: drop "32" from cygwin_ funcs, include sys/cygwin.h where
+ cygwin path conv protos live, instead of adding a proto here for
+ them here.
+ * {main.c, ser-tcp.c, ser-unix.c, top.c}: check __CYGWIN__
+ instead of __CYGWIN32__.
+ * source.c: thoughout, check _WIN32 instead of WIN32.
+
+ * config/i386/cygwin32.mh: delete.
+ * config/i386/cygwin.mh: new file, was cygwin32.mh.
+ * config/i386/cygwin32.mt: delete.
+ * config/i386/cygwin.mt: new file, was cygwin32.mt.
+ * config/i386/tm-cygwin32.h: delete.
+ * config/i386/tm-cygwin.h: new file, was tm-cygwin32.h.
+ * config/i386/xm-cygwin32.h: delete.
+ * config/i386/xm-cygwin.h: new file, was xm-cygwin32.h.
+ * config/i386/xm-windows.h: #include xm-cygwin.h now.
+ * config/powerpc/cygwin32.mh: delete.
+ * config/powerpc/cygwin.mh: new file, was cygwin32.mh.
+ * config/powerpc/cygwin32.mt: delete.
+ * config/powerpc/cygwin.mt: new file, was cygwin32.mt.
+ * config/powerpc/tm-cygwin32.h: delete.
+ * config/powerpc/tm-cygwin.h: new file, was tm-cygwin32.h.
+ * config/powerpc/xm-cygwin32.h: delete.
+ * config/powerpc/xm-cygwin.h: new file, was xm-cygwin32.h.
+
+ * rdi-share/aclocal.m4: regenerate with aclocal.
+ * rdi-share/configure: regenerate with autoconf.
+ * rdi-share/{host.h, hostchan.c, hostchan.h, serdrv.c, serpardr.c,
+ unixcomm.c}: check __CYGWIN__ instead of __CYGWIN32__.
+
+Thu Nov 12 17:19:43 1998 John Metzler <jmetzler@cygnus.com>
+
+ * remote.c (remote_get_threadinfo): Support for remote
+ multithread debugging.
+ (remote_get_threadlist): get a partial list of threads
+ (remote_threadlist_iterator): Step through all the threads
+ (init_remote_threadtests): Optional builtin unit test commands.
+
+ * thread.c (bind_target_thread_vector): Implementa a more dynamic
+ way of accessing target specific thread info functions than
+ FIND_NEW_THREADS.
+ (target_thread_info): Function to get extended thread information.
+
+ * gdbthread.h: Export internal data structures corresponding to
+ external detailed thread info response. This is more like a 'ps'
+ command than what might be expected of host based threads. This
+ is for embedded systems.
+
+Wed Nov 11 15:47:00 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * procfs.c (proc_set_exec_trap): don't set PR_ASYNC or PR_FORK
+ in the child process for UnixWare (causes processes forked by
+ the debuggee to hang).
+
+Mon Nov 9 12:00:36 1998 Dave Brolley <brolley@cygnus.com>
+
+ * config/fr30/fr30.mt: New file.
+ * config/fr30/tm-fr30.h: New file.
+
+1998-11-05 Jim Wilson <wilson@cygnus.com>
+
+ * remote-vx.c (net_read_registers, net_write_registers,
+ vx_xver_memory, vx_resume, vx_attach, vx_detach, vx_kill):
+ Change errno to errno_num.
+ * vx-share/xdr_ptrace.c (xdr_ptrace_return): Likewise.
+ * vx-share/xdr_ptrace.h (struct ptrace_return): Likewise.
+
+Thu Nov 5 08:41:33 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * top.c (gdb_readline): Allow CRLF line termination on systems
+ which define CRLF_SOURCE_FILES.
+ * win32-nat.c: 1) Add thread support, 2) fix ability to attach to
+ a running process, and 3) implement limited support for cygwin
+ signals.
+ (thread_rec): New function.
+ (child_add_thread): Ditto.
+ (child_init_thread_list): Ditto.
+ (child_delete_thread): Ditto.
+ (do_child_fetch_inferior_registers): Ditto.
+ (do_child_store_inferior_registers): Ditto.
+ (handle_output_debug_string): Ditto.
+ (child_fetch_inferior_registers): Use do_* function to perform
+ operation.
+ (child_store_inferior_registers): Ditto.
+ (child_continue): Ditto.
+ (child_thread_alive): Ditto.
+ (cygwin_pid_to_str): Ditto.
+ (handle_load_dll): Reorganize, add first attempt at reading
+ dll names from attached processes. Change info messages to provide
+ more information when dll is already loaded.
+ (handle_exception): Changes mandated by new thread-aware structures.
+ (child_wait): Track thread creation/destruction. Handle cygwin
+ signals.
+ (child_create_inferior): Ditto.
+ (child_resume): Ditto.
+ (child_kill_inferior): Ditto. Close child process handle to avoid a
+ handle leak.
+ (child_ops): Fill out child_ops fields that deal with threads.
+ * config/i386/tm-cygwin32.h: Declare function and macro needed
+ for converting a cygwin "pid" to a string.
+ * config/i386/xm-cygwin32.h: define HAVE_SIGSETMASK as 0 since
+ sigsetmask is not defined in cygwin.
+
+Thu Nov 5 08:38:18 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Remove obsolete PPC conditionals.
+
+Wed Nov 4 18:44:31 1998 Dave Brolley <brolley@cygnus.com>
+
+ * configure.tgt: Add fr30-*-elf*.
+
+1998-11-03 Jim Wilson <wilson@cygnus.com>
+
+ * c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting
+ high_bit to avoid undefined negative shift.
+
+Mon Nov 2 15:26:33 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * configure.in: Check cygwin* instead of cygwin32*.
+ * configure: regenerate
+
+Thu Oct 29 10:04:20 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ [Support for trace debugging: registers that were not collected.]
+ * remote.c (remote_fetch_registers): accept 'xxxx' in the register
+ packet, with the meaning "register value is not available".
+ Set register_valid to -1, which will connote "no value available".
+ * findvar.c (read_relative_register_raw_bytes): return failure if
+ register_valid == -1. (value_of_register): return failure if
+ register_valid == -1. (read_var_value): return error if
+ value_of_register fails for a register variable.
+ (value_from_register): return failure if register_valid == -1.
+ * eval.c (evaluate_subexp_standard): return error if
+ value_of_register fails for a register used in an expression.
+ * infcmd.c (do_registers_info): display "value not available"
+ for registers for which register_valid == -1.
+
+ * tracepoint.c (set_raw_tracepoint): just save the filename as is
+ from the symbol table, rather than trying to prepend the dir name.
+ Also save the bfd section. (tracepoints_info): use the section
+ when looking up the function name.
+ * tracepoint.h: add section field to tracepoint struct.
+
+Wed Oct 28 08:01:38 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparcl-tdep.c (send_resp, sparclite_serial_start,
+ sparclite_serial_write): Use remote_timeout instead of hardcoded
+ two second timeout.
+ (download): Fix adjustment of a.out load addresses.
+
+Wed Oct 28 12:32:58 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (--enable-build-warnings): Finish rename from
+ --enable-warnings.
+ (enable-build-warnings): Add -Wpointer-arth, allow =* for
+ sim/common compatibility.
+ * configure: Re-generate.
+
+Wed Oct 21 08:44:30 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * 29k-share/udi/udip2soc.c: Replace sys_errlist with strerror().
+
+Thu Oct 22 09:56:55 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/rs6000/aix4.mh (NATDEPFILES): Move xcoffread.o from here.
+ * config/rs6000/aix4.mt (TDEPFILES): To here.
+
+Wed Oct 21 10:02:31 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * rdi-share/unixcomm.c: Provide definitions of SERPORT and PARPORT
+ on BSD hosts.
+
+1998-10-19 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (AM_EXEEXT): Use AC_EXEEXT instead.
+ * configure: Regenerated.
+
+Sat Oct 17 17:39:23 1998 Felix Lee <flee@cygnus.com>
+
+ * core-sol2.c: #include <sys/types.h>, for sol2.7 weirdness.
+
+Fri Oct 16 15:31:38 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-tdep.c (decode_prologue): Return failure if we reach
+ the end of the function without finding the end of the prologue.
+
+1998-10-16 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * command.c copying.c copying.awk core-aout.c core-regset.c
+ corelow.c dcache.c i386-tdep.c i386v4-nat.c i387-tdep.c
+ infcmd.c infptrace.c infrun.c remote.c solib.c symfile.c
+ symmisc.c valarith.c: Add prototypes.
+
+ * defs.h: Add prototype for utils.c::do_run_cleanups.
+
+ * gdbtypes.c: Add prototypes.
+ (make_pointer_type): Add braces to remove nested if-else ambiguity.
+ (make_reference_type): Ditto.
+
+ * printcmd.c (printf_command): Initialize 'f' and 'string' at
+ function startup to suppress possibly-used-before-initialized warning.
+
+ * remote-utils.c: Add prototypes.
+ (sr_pollchar): Add braces to remove nested if-else ambiguity.
+
+ * ser-tcp.c: Add prototypes.
+ (wait_for): Add braces to remove nested if-else ambiguity.
+ (tcp_readchar): Ditto.
+
+ * ser-unix.c: Add prototypes.
+ (get_tty_state): Don't define errno here.
+ (hardwire_readchar): Only define 't' if we are compiling in a Cygwin
+ environment.
+
+ * symtab.c: Add prototypes.
+ (find_methods): Add braces to remove nested if-else ambiguity.
+ (search_symbols): Set 'i' to an initial value to suppress a
+ possibly-used-before-initialized warning.
+
+ * valops.c: Add prototypes.
+ (value_cast): Set 'eltype2' to an initial value to suppress a
+ possibly-used-before-initialized warning.
+ (value_of_variable): Add braces to remove nested if-else ambiguity.
+ (value_of_this): Ditto.
+
+ * valprint.c: Add prototypes.
+ (print_floating): Add braces to remove nested if-else ambiguity.
+
+Thu Oct 15 19:50:48 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * tm-sp64.h (SETUP_ARBITRARY_FRAME, FRAME_SPECIFICATION_DYADIC):
+ Remove, nevermore used.
+
+Thu Oct 15 16:55:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.c: Include "wait.h" after, rather than before, <wait.h>.
+ "wait.h" was defining all WIF* macro's instead of filling in those
+ that <wait.h> missed.
+
+1998-10-14 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * defs.h: Move _initialize_printcmd, _initialize_stack,
+ _initialize_blockframe out of here and in to their respective .c
+ files.
+ * blockframe.c: Move _initialize_blockframe prototype to here.
+ * printcmd.c: Move _initialize_printcmd prototype to here.
+ * stack.c: Move _initialize_stack prototype to here.
+
+ * source.c, symtab.h: Move _initialize_source prototype to the .c
+ file.
+ * values.c, value.h: Move _initialize_values prototype to the .c file.
+ * gdbthread.h, thread.c: Move _initialize_thread prototype to the .c
+ file.
+ * breakpoint.c, breakpoint.h: Move _initialize_breakpoint prototype
+ to the .c file.
+
+ * abug-rom.c alpha-nat.c alpha-tdep.c annotate.c ax-gdb.c bcache.c:
+ Standardize comments for the prototype section of these files.
+
+ * configure.in: Look in libc for wctype before looking for it in libc.
+
+Tue Oct 13 18:56:51 1998 Felix Lee <flee@cygnus.com>
+
+ * sol-thread.c (ps_pstop, etc): simple test for proc_service.h
+ version didn't work for sol2.6; pushed it to autoconf.
+ * configure.in (gdb_cv_proc_service_is_old): new test.
+ * acconfig.h (PROC_SERVICE_IS_OLD): new define.
+ * configure, config.in: regenerate.
+
+1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * blockframe.c (find_pc_sect_partial_function): Add braces to avoid
+ possible nested-if confusion.
+ * breakpoint.c (breakpoint_here_p): Ditto.
+ (breakpoint_inserted_here_p): Ditto.
+ (breakpoint_thread_match): Ditto.
+
+ * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
+ * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
+ prototypes.
+
+ * symtab.h: Add prototype for _initialize_source.
+ * value.h: Add prototype for _initialize_value.
+
+ * defs.h: Include sys/types.h or stddef.h to get size_t.
+ (make_cleanup): Add make_cleanup_func typedef and switch to using
+ a prototype for this function.
+ (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
+ using mmalloc.
+
+ * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c
+ dwarf2read.c dwarfread.c elfread.c eval.c exec.c infcmd.c infrun.c
+ mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
+ symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c
+ valops.c: Cast parameters passed to make_cleanup to use the new
+ make_cleanup_func typedef.
+
+Tue Oct 13 00:51:48 1998 Felix Lee <flee@cygnus.com>
+
+ * sol-thread.c (ps_pstop, etc): different solaris versions have
+ slightly different prototypes in proc_service.h; compensate.
+
+1998-10-12 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in (AWK): Unused; remove.
+ * configure.in: Remove unused autoconf checks for MINIX, memcpy,
+ poll, select, strings.h.
+ * config.in: Regenerated.
+ * configure: Regenerated.
+
+1998-10-12 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Check for sys/debugreg.h, asm/debugreg.h.
+ * i386v-nat.c: Include asm/debugreg.h, sys/debugreg.h if it is not
+ present.
+
+Sun Oct 11 12:08:07 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Do not adjust the
+ address range of a compilation unit without children.
+
+ * mdebugread.c (parse_partial_symbols): Fix handling of stabs
+ continuations, use xmalloc and xrealloc.
+
+Fri Oct 9 18:14:43 1998 Mark Alexander <marka@cygnus.com>
+
+ * rs6000-tdep.c: Don't include tm.h twice.
+
+1998-10-08 Keith Seitz <keiths@cygnus.com>
+
+ * main.c (main): Remove calls to {pre,post}_add_symbol_hooks.
+ There should be sufficient information/hooks now to eliminate
+ this hack.
+
+ * exec.c (file_command): Add a new hook here to inform ui's
+ when the exec file has changed. Adding it here allows the
+ ui to be informed after symbol reading.
+
+ * gdbcore.h: Add declaration of file_changed_hook.
+
+Thu Oct 8 08:40:42 1998 Mark Alexander <marka@cygnus.com>
+
+ * rs6000-tdep.c (get_saved_register): Define only if
+ USE_GENERIC_DUMMY_FRAMES is defined.
+
+Tue Oct 6 21:35:10 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (DEPFILES): Add TARGET_OBS.
+ (TARGET_OBS): Defined by configure.
+
+1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ Eliminate a few warnings from the compiler.
+ * breakpoint.h: Add prototype.
+ * breakpoint.c (do_enable_breakpoint): cast mem_cnt, i to (void).
+ * configure.in: Check if strdup declaration is necessary.
+ * configure: Regenerated.
+ * defs.h: Add prototypes.
+ * gdb_string.h: Only define strdup if necessary.
+ * gdbthread.h: Add prototypes.
+ * printcmd.c: Add prototyptes.
+ (disassemble_command): Remove unused variable 'section'.
+ * symtab.c: Add prototypes.
+ * symtab.h: Include gnu-regex.h, add prototype.
+ * thread.c: Add prototype.
+
+Mon Oct 5 19:44:39 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ From David Purves <purves@apogee.com>:
+ * stabsread.c (rs6000_builtin_type): Create a complex float instead
+ of an error.
+ (read_sun_floating_type): Similarly.
+ (read_range_type): Create a complex float if self_subrange is
+ true.
+
+Fri Oct 2 19:42:31 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr)
+ ch-lang.c (chill_printstr chill_printchar) c-valprint.c (c_val_print)
+ ch-valprint.c (chill_val_print) expprint.c (print_subexp) f-lang.c
+ (f_printstr f_printchar emit_char) f-valprint.c (f_val_print)
+ jv-lang.c (java_printchar java_emit_char) jv-valprint.c
+ (java_value_print java_val_print) language.c (unk_lang_printchar
+ unk_lang_printstr unk_lang_emit_char) language.h (struct
+ language_defn LA_PRINT_STRING LA_EMIT_CHAR) m2-lang.c (m2_printstr
+ m2_printchar emit_char) printcmd.c (print_formatted) scm-lang.c
+ (scm_printstr) valprint.c (val_print_string) value.h
+ (val_print_string): Add emit_char routines to language_desc struct
+ to allow finer control over language specific character output issues.
+ Add character width arg to printstr routines to allow handling of
+ wchar_t/Unicode strings. Fix c_printstr to handle wide characters.
+ Supply width argument to LA_PRINT_STRING and val_print_string.
+
+ * jv-lang.c (java_object_type dynamics_objfile java_link_class_type
+ get_dynamics_objfile get_java_object_type) jv-lang.h
+ (get_java_object_type): Make lots of things static.
+
+ * expprint.c (dump_prefix_expression dump_subexp): Move opcode name
+ printing to common routine (op_name).
+ * (dump_subexp): Add support for OP_SCOPE.
+
+Fri Oct 2 16:25:54 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.host (i[3456]86-*-windows): Remove, no longer used.
+ * mswin: Remove directory, no longer used.
+
+Fri Oct 2 18:52:20 1998 Fernando Nasser <fnasser@cygnus.com>
+
+ * sol-thread.c: Fixed prototypes and calls to supply_fpregset and
+ fill_fpregset
+
+1998-10-02 Keith Seitz <keiths@cygnus.com>
+
+ * remote.c (remote_interrupt): Rewrite to use remote_stop.
+ (remote_interrupt_twice): Remove. remote_stop now handles it.
+ (remote_stop): New function which handles interrupting the
+ remote target so that CLUI and GUI use the same core functions
+ to achieve the same goal.
+ (remote_wait): Change to handle remote_stop properly.
+ [interrupted_already]: New static global to help remote_stop.
+ [remote_ops, extended_remote_ops]: Add remote_stop for to_stop member.
+
+ * target.c: Rename static function "ignore" to "target_ignore" and
+ export it so that gdb can determin if some target vector member is
+ actually not defined. Replace all occurances of ignore.
+
+ * target.h: Export target_ignore.
+
+Fri Oct 2 03:51:48 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * target.c (target_xfer_memory): Handle requests with zero
+ transfer length right away.
+
+ * values.c (unpack_double): Set up code, length and signedness of
+ type _after_ checking for typedef.
+
+Thu Oct 1 15:39:27 EDT 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * breakpoint.c (bpstat_stop_status): Do not consider an
+ untripped watchpoint as a "hit".
+
+Thu Oct 1 20:52:39 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * exec.c (exec_file_command), convex-tdep.c (exec_file_command),
+ arm-xdep.c (exec_file_command), remote-rdp.c
+ (remote_rdp_create_inferior), remote-os9k.c
+ (rombug_create_inferior), remote-mm.c (mm_create_inferior),
+ remote-eb.c (eb_create_inferior), remote-es.c
+ (es1800_create_inferior), remote-rdi.c (arm_rdi_create_inferior),
+ remote-sim.c (gdbsim_create_inferior), remote-utils.c
+ (gr_create_inferior), remote-st.c (st2000_create_inferior),
+ remote-nindy.c (nindy_create_inferior), remote-hms.c
+ (hms_create_inferior), remote-e7000.c (e7000_create_inferior),
+ remote-array.c (array_create_inferior), remote-adapt.c
+ (adapt_create_inferior): Replace "exec" with "executable" in
+ messages.
+
+1998-09-25 Keith Seitz <keiths@cygnus.com>
+
+ * rdi-share/unixcomm.c: If using cygwin32, also use the SERPORT and
+ PARPORT defines for win32.
+ (Unix_MatchValidSerialDevice): For cygwin32, valid serial port names
+ start with "com", not "/dev/tty".
+ (Unix_OpenSerial): Do not use O_NONBLOCK on cygwin32.
+
+ * rdi-share/devsw.c (DevSW_Close): Free the device's state
+ (SwitcherState) so that the device may be reopened.
+
+ * remote-rdi.c (mywritec): Send all output through gdb's *_unfiltered
+ functions, ignoring non-ASCII chars, so that non-tty UI's can snarf
+ the output from fputs_hook.
+ (mywrite): Ditto.
+ (arm_rdi_open): Set inferior_pid.
+ (arm_rdi_detach): Pop the target off the target stack so that
+ users can attach and detach multiple times.
+ (arm_rdi_close): Close the opened device and reset inferior_pid, too.
+
+1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Change --enable-warnings to --enable-build-warnings.
+ * configure: Updated.
+
+1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (WARN_CFLAGS): Add -Wmissing-prototypes.
+ * configure: Regenerated.
+
+1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Add --enable-warnings.
+ Adjust whitespace of other --with and --enable options so that
+ configure --help lines up correctly.
+ * aclocal.m4: Ditto.
+ * Makefile.in (WARN_CFLAGS): Add. Set by configure.
+ * configure: Regenerated.
+
+Thu Sep 24 15:44:34 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-rdi.c: Fix formatting, remove some commented-out code.
+ (init_rdi_ops): Omit needless initializations.
+
+Wed Sep 23 18:21:03 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_address_masked): New function - mask address
+ according to REMOTE_ADDRESS_SIZE.
+ (remote_address_size): New global.
+ (hexnumstr): New function - convert arbitrary unsigned to hex.
+ (remote_write_bytes, remote_read_bytes): Use hexnumstr to
+ construct packet address. Mask address when necessary.
+ (_initialize_remote): Add "set remoteaddresssize" command, set
+ REMOTE_ADDRESS_SIZE variable.
+
+ * NEWS: Update.
+
+Wed Sep 23 18:08:52 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (_initialize_remote, packet_command, print_packet):
+ Pretty print code.
+
+Wed Sep 23 12:32:54 1998 <cagney@amy.cygnus.com>
+
+ * remote.c (packet_command): Test REMOTE_DESC to determine if
+ remote connection is open.
+
+Tue Sep 22 22:27:24 1998 Mark Alexander <marka@cygnus.com>
+
+ Patch from Dawn Perchik <dawn@cygnus.com>:
+ * rs6000-tdep.c (pop_frame): Handle generic dummy frames.
+ (push_arguments): Likewise.
+ (frame_saved_pc): Likewise.
+ (rs6000_frame_chain): Likewise.
+ (ppc_push_return_address): New function.
+ (get_saved_register): New function.
+ * config/powerpc/tm-ppc-eabi.h: Add generic dummy frame macros.
+
+Mon Sep 21 19:29:32 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * defs.h utils.c (fputc_filtered): New function. Does the obvious...
+ * jv-lang.c (java_printchar): Fix output of chars > 0xff. Fold
+ java_emit_char into java_printchar.
+ * language.h (PRINT_LITERAL_FORM): Reformat for readability.
+
+Mon Sep 21 14:38:03 1998 Catherine Moore <clm@cygnus.com>
+
+ * config/arm/tm-arm.h (*_BREAKPOINT): Define both little endian
+ and big endian breakpoint patterns.
+
+ * arm-tdep.c (arm_break_point_from_pc): Insert either big endian
+ or little endian breakpoints depending upon target byte order.
+
+Fri Sep 18 07:53:08 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * sol-thread.c (sol_thread_notice_signals): Use PIDGET when
+ passing pid down to procfs_notice_signals.
+
+Wed Sep 16 14:57:14 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * stabsread.c (resolve_symbol_reference): Return 1 on success, 0 on
+ failure.
+ * (define_symbol): Check return value from resolve_symbol_reference,
+ and drop symbol if it fails.
+
+Tue Sep 15 15:24:16 1998 Stu Grossman <grossman@fencer.cygnus.com>
+
+ * stabsread.c: Make all complaints static.
+ * Fix formatting of live range splitting code.
+ * (resolve_symbol_reference define_symbol resolve_live_range): Change
+ errors to complaints so that bad live range symbols won't abort the
+ entire symbol table. Handle errors by aborting just the current
+ symbol.
+ * (ref_init): Goes away. Folded into ref_add().
+ * (REF_MAP_SIZE): Put parens around parameter so that args like
+ `1 + 2' get handled correctly (yes, this was a real bug).
+ * (ref_add): Remove check for allocation failures. Not necessary
+ when using xrealloc(). Fix pointer arithmetic problem when clearing
+ memory. This and the previous patch prevent random SEGV's when there
+ are lots of live range symbols.
+
+Tue Sep 15 14:02:01 1998 Nick Clifton <nickc@cygnus.com>
+
+ * remote-rdi.c: Prevent multiple attempts to close the remote
+ connection.
+
+Tue Sep 15 10:24:17 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * printcmd.c (examine_i_type): New static - type for instructions.
+ (do_examine): For "i" format, specify examine_i_type.
+ (do_examine): Call value_at_lazy instead of value_at so that
+ examine data is only fetched if it is used.
+ (x_command): If examine data was not fetched, set convenience
+ variable "__" to void.
+ (_initialize_printcmd): Initialize examine_i_type.
+
+Sun Sep 13 01:34:59 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c (find_pc_sect_partial_function): use bfd section
+ of msymbol for end of section comparison.
+
+Fri Sep 11 14:02:49 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c: clean up several unused variables and such.
+
+Fri Sep 11 12:38:34 EDT 1998 Zdenek Radouch (radouch@cygnus.com)
+
+ * arm-tdep.c (arm_push_arguments): fixed frame construction
+
+Thu Sep 10 20:51:23 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): guard against NULL.
+
+Wed Sep 9 19:37:36 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * dbxread.c (IGNORE_SYMBOL): Remove definition, is never used.
+ * os9kread.c: Remove comment mentioning IGNORE_SYMBOL.
+
+Wed Sep 9 11:39:05 1998 Ron Unrau <runrau@cygnus.com>
+
+ * blockframe.c(find_pc_sect_partial_function): look for min syms in
+ the same section when trying to guess the end of a function.
+ * symfile.c(list_overlays_command): use print_address_numeric
+ * remote-sim.c: export simulator_command
+
+1998-09-08 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * breakpoint.c (bpstat_stop_status): Declare a bp match if the
+ current fp matches the bp->fp OR if the current fp is less than
+ the bp->fp if we're looking at a bp_step_resume breakpoint.
+
+Tue Sep 8 19:42:58 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * symtab.h (struct symtab): Remove EXTRA_SYMTAB_INFO hook,
+ not currently used.
+ * symfile.c (allocate_symtab): Deprecate use of
+ INIT_EXTRA_SYMTAB_INFO here.
+
+Fri Sep 4 15:33:25 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * README: Update remote debugging and testsuite info.
+
+Thu Sep 3 13:50:20 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/mn10300/tm-mn10300.h (FP_REGNUM): Redefine to be a
+ pseudo-register, not the same as a3.
+ (D2_REGNUM, D3_REGNUM, A2_REGNUM, A3_REGNUM): Define.
+ * mn10300-tdep.c (fix_frame_pointer): New function.
+ (set_movm_offsets): Use register number macros instead of
+ hard-coded constants.
+ (mn10300_analyze_prologue): Fix to handle redefinition of FP_REGNUM.
+ (mn10300_frame_chain): Fix to handle redefinition of FP_REGNUM;
+ use register number macros instead of hard-coded constants;
+ add missing parameter to call of mn10300_analyze_prologue.
+ (mn10300_frame_saved_pc): Use register number macros instead of
+ hard-coded constants.
+
+Tue Sep 1 12:04:57 EDT 1998 Zdenek Radouch (radouch@cygnus.com)
+
+ Changes to support/fix ARM/ELF port. Use MAKE_MSYMBOL_SPECIAL for
+ both ELF and COFF;
+ * elfread.c (elf_symtab_read): use ELF specific macro
+ * coffread.c (coff_symtab_read): use COFF_MAKE_MSYMBOL_SPECIAL()
+ * arm-tdep.c: separate COFF and ELF thumb processing
+ disable --mapcs-float processing
+ * dwarf2read.c: Disabled building of minimal symbols
+ * config/arm/tm-arm.h: new macros for distinguishing arm/thumb
+ * config/mips/tm-mips.h: use ELF specific macro
+
+Mon Aug 31 15:42:10 1998 Tom Tromey <tromey@cygnus.com>
+
+ * top.c (context_hook): Define.
+
+Tue Aug 25 13:21:58 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * ax-gdb.c (gen_var_ref): Allow for typedef types.
+ (gen_cast, gen_bitfield_ref, gen_expr, gen_deref): ditto.
+
+Mon Aug 24 18:29:03 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (collect_symbol): Handle register doubles that
+ are stored in two registers.
+
+Mon Aug 24 14:39:08 1998 Mark Alexander <marka@cygnus.com>
+
+ * sh-stub.c (undoSStep): Improve comment.
+ * sparc-tdep.c (sparc_extract_struct_value_address): Simplify to use
+ same method on both 32-bit and 64-bit machines.
+ * sparcl-tdep.c (sparclite_check_watch_resources): Simulator doesn't
+ support hardware breakpoints.
+ * config/sparc/tm-sparc.h (CALL_DUMMY): Improve comments.
+
+1998-08-20 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * rdi-share/Makefile.am (INCLUDES): Fix typeo.
+ * rdi-share/Makefile.in: Regenerated.
+
+1998-08-19 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * rdi-share/Makefile.am: Use just `INCLUDES' not `libname_INCLUDES'.
+ * rdi-share/Makefile.in: Regenerated.
+
+1998-08-19 Keith Seitz <keiths@cygnus.com>
+
+ * v850ice.c (v850ice_stop): New function to stop the ICE.
+ (v850ice_load) Pass filename to ICE DLL.
+ (ice_stepi, ice_nexti, ice_cont): Do not directly call the gdb
+ commands -- let the GUI do it so that it can retain control
+ of the display.
+
+Wed Aug 19 15:53:52 1998 Anthony Green <green@hoser.cygnus.com>
+
+ * i386v4-nat.c: Include sys/reg.h if present.
+
+Wed Aug 19 03:07:53 1998 Richard Henderson <rth@cygnus.com>
+
+ * config/alpha/alpha-linux (XDEPFILES): Build ser-tcp.
+
+1998-08-18 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * symtab.c (decode_line_1): For minimal symbol, SKIP_PROLOG to
+ make sure we stop after the frame pointer is locaded and backtrace
+ prints an accurate stack. Complements changes made on Mon Jul 27
+ 10:45:56 1998
+ (decode_line_2): Replaced the whitespace after ">" in a prompt
+ which has been taken away by changes made on Sun Jul 19 02:11:45
+ 1998
+
+1998-08-18 Keith Seitz <keiths@cygnus.com>
+
+ * stack.c: Define new hook, selected_frame_level_changed_hook, which
+ will be called whenever the selected stack level changes.
+ (select_frame): Call the selected_frame_level_changed_hook.
+
+Tue Aug 18 18:03:42 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): Pass serial device name to
+ Adp_OpenDevice, and include it in error reports.
+
+1998-08-18 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Add more header files to AC_CHECK_HEADERS.
+ * configure: Regenerated.
+
+ * command.c: Include wait.h or sys/wait.h if present.
+ * inftarg.c: Ditto.
+ * core-aout.c: Include ptrace.h or sys/ptrace.h if present, based
+ on autoconf test.
+ * infptrace.c: Ditto.
+
+ * expprint.c: Include ctype.h for isprint prototype.
+ * i386aix-nat.c: Include sys/reg.h if autoconf says it is present.
+ * i386v-nat.c: Include ptrace.h, sys/ptrace.h, and sys/reg.h if
+ present, based on autoconf test.
+
+ * utils.c: Include curses.h and term.h if present.
+ (puts_debug): Change 'carriage_return' local variable to return_p
+ to avoid name clash.
+
+ * config/m68k/nm-apollo68b.h: Don't define PTRACE_IN_WRONG_PLACE,
+ determine it with autoconf.
+ * config/i386/nm-linux.h: Don't define NO_SYS_REG_H, determine it
+ with autoconf.
+ * config/i386/nm-i386sco.h: Don't define NO_PTRACE_H, determine it
+ with autoconf.
+ * config/i386/nm-i386v.h: Ditto.
+ * config/i386/nm-symmetry.h: Ditto.
+ * config/m88k/xm-cxux.h: Ditto.
+ * config/m88k/xm-dgux.h: Ditto.
+
+ * config/m68k/delta68.mh (NAT_FILE): nm-delta68.h no longer necessary.
+ * config/m68k/nm-delta68.h: Removed.
+
+Fri Aug 14 11:14:03 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c (set_movm_offsets): Change second argument to
+ be the actual args to movm itself. All callers changed. Only set
+ fi->fsr.regs[x] if reg X is saved by the movm instruction.
+
+Fri Aug 14 04:18:23 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * sol-thread.c (lwp_to_thread): Fix error message for failing
+ td_ta_map_lwp2thr call.
+ (ps_lgetLDT): Mask off upper bits in GS register when comparing
+ with selector.
+
+Wed Aug 12 16:30:01 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * remote-sim.c (simulator_command): Reset register cache after
+ simulator command.
+
+Wed Aug 12 09:00:26 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * expprint.c (dump_prefix/postfix_expression): Don't try to print
+ type expressions.
+
+Tue Aug 11 11:33:25 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * c-typeprint.c (c_print_type): Don't crash if varstring is null.
+ * expprint.c expression.h (dump_expression): Rename to
+ dump_prefix_expression.
+ * Print out the expression in normal form. Call print_longest
+ instead of trying to do it ourselves.
+ * (dump_postfix_expression): New function, prints out the expression
+ with indentation and better formatting and interpretation.
+ * parse.c (parse_exp_1): Put calls to dump expressions under ifdef
+ MAINTENANCE_CMDS and expressiondebug variable.
+
+Thu Aug 6 13:20:02 1998 Ron Unrau <runrau@cygnus.com>
+
+ * infrun.c (wait_for_inferior): use stop_func_name instead of
+ stop_func_start to decide that no debug info exists.
+
+Thu Jul 30 13:53:50 1998 Mark Alexander <marka@cygnus.com>
+
+ * mips-tdep.c (mask_address_p): New variable.
+ (mips_addr_bits_remove): Test mask_address_p to decide whether
+ to mask off the upper 32 bits of addresses.
+ (_initialize_mips_tdep): Add command to set mask_address_p.
+ (mips_call_dummy_address): New function.
+ * config/mips/tm-mips.h (CALL_DUMMY_ADDRESS): Redefine to
+ call mips_call_dummy_address.
+
+1998-07-29 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * symfile.c (add_symbol_file_command): Test for the from_tty
+ parameter and avoid query when not interactive.
+
+Wed Jul 29 10:39:29 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c (set_movm_offsets): Do nothing for the am33
+ registers if we are not in am33 mode.
+ (mn10300_frame_chain, mn10300_frame_saved_pc): Similarly.
+ (set_machine_hook): Keep track of whether or not we're in am33 mode.
+
+Mon Jul 27 16:11:42 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (remote_set_transparent_ranges): new function.
+ Send the start and end addresses of all loadable read-only
+ sections down to the trace target, so that it can treat them
+ as "transparent" (ie. don't care if they were collected or not).
+
+Mon Jul 27 15:38:07 1998 Mark Alexander <marka@cygnus.com>
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): Undo previous fix
+ for setting frame address in optimized code; made unnecessary
+ by compiler fixes.
+
+Mon Jul 27 10:45:56 1998 Martin M. Hunt <hunt@cygnus.com>
+
+ * symtab.c (decode_line_1): For minimal symbol, call
+ find_pc_sect_line() to make sure the line number gets set
+ properly.
+ (print_symbol_info): Redeclare function void.
+
+1998-07-27 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/d10v/tm-d10v.h (REGISTER_NAMES): sp -> r15. The
+ stack pointer et al are synthesized from the SP_REGNUM (etc)
+ defines and should not be mentioned in REGISTER_NAMES.
+
+Mon Jul 27 08:54:41 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c (mn10300_frame_chain): Account for space saved
+ by am33 register saves.
+ (mn10300_frame_saved_pc): Similarly.
+
+Fri Jul 24 14:41:19 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (encode_actions): Treat register names and simple
+ variable names as special cases and don't convert them to byte-
+ codes: these things can be collected far more efficiently
+ without invoking the bytecode interpreter.
+
+Fri Jul 24 13:32:46 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/i386/tm-i386.h (STORE_STRUCT_RETURN): Make it
+ work on hosts of any endianness.
+ * config/i386/tm-i386v.h: Ditto.
+
+Fri Jul 24 07:41:12 1998 Mark Alexander <marka@cygnus.com>
+
+ * mn10300-tdep.c (set_movm_offsets): New helper function
+ for mn10300_analyze_prologue.
+ (mn10300_analyze_prologue): Simplify by factoring out common code.
+ Fix bugs in setting frame address for optimized code.
+ Use read_memory_nobpt instead of target_read_memory.
+
+Thu Jul 23 17:01:17 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (collect_symbol): handle LOC_ARG case.
+
+Thu Jul 23 15:07:40 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * sparc-tdep.c (sparc_init_extra_frame_info): Recognize when we're
+ in a function prologue before the SAVE instruction.
+ (sparc_frame_saved_pc): Ditto.
+ * config/sparc/tm-sparc.h (EXTRA_FRAME_INFO): Add in_prologue flag.
+
+Thu Jul 23 14:58:09 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * i386-tdep.c (i386_get_frame_setup): Recognize function
+ prologues in code compiled with -fcheck-stack.
+
+Thu Jul 23 14:49:27 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * remote-mips.c (remote_mips_insert_hw_breakpoint,
+ remote_mips_remove_hw_breakpoint): New functions for hardware
+ breakpoints on LSI targets.
+ * config/mips/tm-embed.h (target_remove_hw_breakpoint,
+ target_insert_hw_breakpoint): Define to call
+ remote_mips_insert_hw_breakpoint and remote_mips_remove_hw_breakpoint,
+ respectively.
+
+1998-07-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * source.c (print_source_lines): Print "No such file or directory"
+ just once.
+ (directory_command): same as above; resets if user issues dir.
+
+Sun Jul 19 02:11:45 1998 Martin M. Hunt <hunt@cygnus.com>
+
+ * symtab.c (decode_line_2): Instead of printing a prompt
+ and calling command_line_input() without a prompt, just
+ call it with the proper args. This makes the GUI work too.
+
+Fri Jul 17 9:26:50 1998 Ron Unrau <runrau@cygnus.com>
+
+ * blockframe.c (find_pc_sect_partial_function): allow for the possi-
+ bility of multiple symbols at the same address when finding high.
+ * breakpoint.c (resolve_sal_pc): if the function based section lookup
+ fails, try getting the section from the minimal symbol table.
+ * parse.c (write_exp_msymbol): use symbol_overlayed_address to get
+ the LMA of a minimal symbol if unmapped.
+ * symtab.c (find_line_symtab): change interface to return symtab
+ containing the best linetable found.
+ (decode_line_1): use find_line_symtab to set val.symtab. This should
+ improve support for source files with multiple symtabs.
+
+Wed Jul 15 11:51:33 1998 Keith Seitz <keiths@cygnus.com>
+
+ * main.c (main): Fix violations of GNU coding standard.
+
+ * breakpoint.c: Export delete_command.
+
+ * infcmd.c: Export continue_command, stepi_command, and nexti_command.
+
+ * Makefile.in: Add target for v850ice.o.
+
+ * configure.tgt: Add cygwin32 dependencies for v850 ice.
+
+Wed Jul 15 10:58:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * tracepoint.c (set_raw_tracepoint): Cope with symbols that do not
+ have an associated directory.
+
+Mon Jul 13 15:21:04 1998 Mark Alexander <marka@cygnus.com>
+
+ * utils.c (puts_debug): Display non-printable characters in hex
+ instead of octal.
+
+Thu Jul 9 16:16:47 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-tdep.c (mn10300_generic_register_names): New variable.
+ (set_machine_hook): New function. Copy the appropriate register
+ names into reg_names.
+ (_initialize_mn10300_tdep): Set up to call set_machine_hook.
+ * tm-mn10300 (NUM_REGS): Bump to 32.
+ (REGISTER_NAMES): Updated accordingly.
+
+ * mn10300-tdep.c (am33_register_names): New variable.
+ (mn10300_analyze_prologue): Handle regs saved by am33 prologues.
+ * tm-mn10300.h (E0_REGNUM): Define.
+
+Tue Jul 7 7:40:13 1998 Ron Unrau <runrau@cygnus.com>
+
+ * symtab.c (find_pc_sect_psymbol): allow case where textlow is 0
+
+Thu Jul 2 15:57:58 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * breakpoint.c (resolve_sal_pc): Accept absence of innermost
+ Lexical block for breakpoint resolution.
+
+Thu Jul 2 10:22:00 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * mdebugread.c (parse_partial_symbols): Go ahead and read the .mdebug
+ section, but just don't add a 2nd minimal symbol if this is an .mdebug
+ section in an ELF file.
+
+1998-07-01 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * Makefile.in (ax-general.o): Depend on $(defs_h) too.
+ (ax_h): Bother to define this.
+
+Mon Jun 29 19:01:18 1998 Jim Wilson <wilson@cygnus.com>
+
+ * gnu-regex.c (re_comp): Add cast to char * before gettext calls.
+
+Sun Jun 28 11:35:48 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ Improve support for SunPro F77.
+ * dbxread.c (end_psymtab, process_one_symbol): Handle minimal
+ symbols with trailing underscore names.
+ * minsyms.c (find_stab_function_addr): Ditto.
+ * dbxread.c (process_one_symbol): Ignore N_ALIAS for now.
+ * partial-stab.h (case N_ALIAS): Ditto.
+ * stabsread.c (read_sun_builtin_type): Handle boolean types.
+
+Fri Jun 26 14:03:01 1998 Keith Seitz <keiths@cygnus.com>
+
+ * symtab.h (enum namespace): Add new namespaces FUNCTIONS_NAMESPACE,
+ TYPES_NAMESPACE, METHODS_NAMESPACE, and VARIABLES_NAMESPACE used by
+ new search_symbols.
+ Add prototype for search_symbols and free_search_symbols.
+
+ * symtab.c (list_symbols): Rewrite to use new search_symbols.
+ (file_matches): New helper function for search_symbols.
+ (free_search_symbols): New function which frees data returned from
+ search_symbols.
+ (print_symbol_info): New helper function which prints info about a
+ matched symbol to stdout. Extracted from old list_symbols.
+ (print_msymbol_info): New helper function which prints info about
+ a matched msymbol to stdout. Extracted from old list_symbols.
+ (symtab_symbol_info): Extracted from old list_symbols.
+ (variables_info): Use symtab_symbol_info.
+ (functions_info): Use symtab_symbol_info.
+ (types_info): Use symtab_symbol_info.
+ (rbreak_command): Rewrite to use new search_symbols.
+
+Thu Jun 25 22:38:32 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Use 128-bit stack frame
+ alignment for inferior calls.
+
+Wed Jun 24 23:17:12 1998 Mark Alexander <marka@cygnus.com>
+
+ * mn10200-tdep.c (mn10200_analyze_prologue): Fix calculation
+ of jsr target address.
+
+Tue Jun 23 19:37:46 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/mn10200/tm-mn10200.h (SAVED_PC_AFTER_CALL): Don't
+ zero upper byte of address.
+
+Tue Jun 23 17:32:26 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * rs6000-tdep.c (pop_dummy_frame): use memcpy.
+ (push_arguments): use memset.
+ (various other places): fix up indentation and long lines.
+
+Tue Jun 23 11:58:35 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in: s/lXext/-lXext/ for Jillian's change.
+
+Tue Jun 23 11:14:04 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * source.c (find_source_lines): fix indentation.
+
+ * config/mips/tm-irix5.h: Modify to work better on irix 6, by
+ making FP registers 8 bytes instead of 4.
+ REGISTER_BYTES: redefine. REGISTER_BYTE(): redefine.
+ REGISTER_VIRTUAL_TYPE: redefine. MIPS_LAST_ARG_REGNUM: redefine.
+ * irix5-nat.c (fetch_core_registers): read 8 bytes per FP register.
+ * mips-tdep.c (FP_REGISTER_DOUBLE): new macro to distinguish
+ targets with 8-byte FP registers (don't use TARGET_MIPS64).
+ (STACK_ARGSIZE): new macro, how much space is taken up on the
+ stack for each function argument (don't use TARGET_MIPS64).
+ (mips_push_arguments): modify logic to work better on Irix 6
+ (n32 ABI).
+
+Tue Jun 23 12:29:53 1998 Jillian Ye <jillian@cygnus.com>
+
+ * configure.in: Add -lXext to mips_extra_libs
+ * configure: Regenerated.
+
+Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com)
+
+ * symtab.c (find_line_pc): assumed that a PC of 0 is illegal.
+ Changed to pass PC as arg and return 1 if valid (0 otherwise).
+ * symtab.h: Change prototype to match.
+ * symtab.c (find_line_pc_range): Use new interface.
+ * breakpoint.c (resolve_sal_pc): Ditto.
+
+Wed Jun 17 15:50:00 1998 Ron Unrau (runrau@cygnus.com)
+
+ * parse.c (target_map_name_to_register): Check target specific
+ aliases *first* so that it can over-ride architectural names
+
+Wed Jun 17 17:13:38 1998 Said Ziouani (saidz@park-street.cygnus.com)
+
+ * remote-sds.c (sds_start_remote): Fix printf call.
+
+Tue Jun 16 16:32:08 1998 Mark Alexander <marka@cygnus.com>
+
+ * mn10200-tdep.c (mn10200_analyze_prologue): Fix null pointer
+ crash when in "start".
+
+Tue Jun 16 14:38:40 1998 Ron Unrau (runrau@cygnus.com)
+
+ * dbxread.c: reset function_start_offset after a finishing N_FUN
+ is seen.
+ * remote-sim.c: allow TARGET_REDEFINE_DEFAULT_OPS to override
+ target vectors as needed.
+
+Sun Jun 14 08:46:25 1998 Ron Unrau (runrau@cygnus.com)
+
+ * partial-stab.h: 'F' and 'f' type N_FUN psymbols should pass
+ CUR_SYMBOL_VALUE as CORE_ADDR instead of long
+ * buildsym.[ch]: export pending_blocks list
+
+Sat Jun 13 13:02:32 1998 Dawn Perchik (dawn@cygnus.com)
+
+ * remote.c: Fix remote help string to match that of help.exp.
+
+Fri Jun 12 14:22:55 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in (LIBS): Add -lw to the list of libraries if needed.
+
+Thu Jun 11 15:05:10 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * btowc.c: Removed.
+ * configure.in: Don't see if we need to replace btowc().
+ * Makefile.in: Don't include LIBOBJS.
+ * configure: Regenerated.
+ * gnu-regex.c (regex_compile): Only support i18n [:foo:] if
+ we have btowc().
+
+Wed Jun 10 15:39:14 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * c-exp.y: Fix problems with parsing "'foo.bar'::func".
+ Some languages allow symbols with dots.
+
+ * gdbtypes.c (check_stub_method): Cosmetic. Use more descriptive
+ names for parameters.
+
+ * jv-exp.y: Parser now accepts primitive types.
+ * (parse_number): Use correct ifdef for scanf long double support.
+ * jv-lang.c (java_array_type): Initial cut at array support.
+
+ * language.c language.h (set_language): Now returns previous language.
+
+ * symtab.c (find_methods): Make static. Cosmetic changes, including
+ indentation, and adding descriptive comments. Move local variable
+ defs into the block they are used in.
+ * Don't call check_stub_method any more. Use gdb_mangle_name to
+ generate the full method name. find_method doesn't need all the other
+ goobldegook that check_stub_method does.
+ * (gdb_mangle_name): Use more descriptive names for parameters. Fix
+ comment.
+ * (lookup_partial_symbol lookup_block_symbol): Check for java to
+ ensure we can find mangled names.
+ * (decode_line_1): Move local variable defs into the block they are
+ used in. (Improves code readability.)
+
+Wed Jun 10 18:04:35 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * gdbtypes.c (get_discrete_bounds): Assign unsigned type flag for
+ all-positive enum.
+ (create_set_type): Ditto for all-positive set values.
+ * values.c (unpack_field_as_long): Check for typedef in struct
+ field unpacking.
+
+Wed Jun 10 14:06:05 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in: Add some tests for gnu-regex.c's benefit.
+ See if btowc() function is provided in C library.
+ * configure, config.in: Regenerated.
+ * Makefile.in (CLIBS, CDEPS): Add @LIBOBJS@ to build btowc.c
+ if necessary.
+ * btowc.c: New file.
+
+ * gnu-regex.c: Reorder wchar.h and wctype.h includes for Solaris'
+ benefit.
+ Drop namespace preserving defines for now.
+
+Wed Jun 10 11:53:42 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * gnu-regex.c: Include "gnu-regex.h", not "regex.h".
+
+Wed Jun 10 11:34:07 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * gnu-regex.c, gnu-regex.h: Change LGPL license to GPL license
+ to stay consistent with the rest of GDB.
+
+Wed Jun 10 11:27:39 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * gnu-regex.c, gnu-regex.h: Update to current FSF (glibc) versions.
+
+Wed Jun 10 10:58:18 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * printcmd.c (disassemble_command): move overlay mapping code
+ "up" into find_pc_partial_function.
+ * blockframe.c (find_pc_partial_function): adjust start address
+ and end address for overlays (mapped vs. unmapped addresses),
+ so that all callers of this function may benefit.
+ * m32r-tdep.c (m32r_skip_prologue): adjust indentation.
+
+Mon Jun 8 16:08:10 1998 Ron Unrau <runrau@cygnus.com>
+
+ * objfiles.c (add_to_objfile_sections): All targets to define
+ TARGET_KEEP_SECTION to permit them to retain bfd sections that
+ GDB would otherwise have discarded.
+
+Fri Jun 5 13:56:19 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * dbxread.c (read_dbx_symtab): Don't lower texthigh for last psymtab.
+
+Thu Jun 4 18:35:04 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c (init_extended_remote_ops): Make extended_remote_ops
+ by copying from remote_ops, move it and init_remote_ops to
+ usual place at end of file, remove "void" from arg lists.
+
+Thu Jun 4 17:51:06 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (sparc_fix_call_dummy): Byte-swap the call dummy
+ on bi-endian machines.
+ (sparc_extract_return_value): Handle values smaller than int on
+ machines with little-endian data.
+ (sparc_target_architecture_hook): Set bi_endian flag.
+
+Thu Jun 4 12:14:48 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * printcmd.c (disassemble_command): Fix off-by-one error for
+ disassembling functions in unmapped overlay sections.
+
+Thu Jun 4 10:15:03 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c: merged.
+
+ - Jim Blandy <jimb@zwingli.cygnus.com>
+ (print_packet, remote_packet_command): New functions.
+ (_initialize_remote): Register the remote-packet command.
+ - David Taylor <taylor@texas.cygnus.com>
+ (_initialize_remote): remote-compare is now
+ compare-sections.
+ - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ (remote_compare_command): added warning, issued in case
+ of mismatch only.
+
+Thu Jun 4 08:25:38 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (remote_compare_command): New function, new command.
+ Compare object file binary image with corresponding memory on
+ remote target. Report differences.
+
+Tue Jun 2 19:05:04 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (sparc_target_architecture_hook): Set target
+ byte order only when it's selectable.
+
+Tue Jun 2 02:01:56 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (sparc_target_architecture_hook): New function to
+ set endianness based on machine type.
+ (_initialize_sparc_tdep): Initialize target_architecture_hook.
+ (sparc_print_register_hook): Print PSR and FPSR in fancy format
+ on 32-bit machines.
+ * config/sparc/tm-sparc.h (PRINT_REGISTER_HOOK): Redefine to
+ call sparc_print_register_hook instead of using inline code.
+ * config/sparc/tm-sp64.h (PRINT_REGISTER_HOOK): Remove.
+
+Thu May 28 17:19:14 1998 Keith Seitz <keiths@cygnus.com>
+
+ * main.c (main): Check for NULL from getenv on CYGWIN32.
+
+Thu May 28 09:41:44 1998 Nick Clifton <nickc@cygnus.com>
+
+ * monitor.c (monitor_vsprintf): Handle %%. Patch courtesy of
+ Felix Lee (flee@cygnus.com)
+
+Thu May 28 00:27:35 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * mips-tdep.c (mips_push_dummy_frame): Fix calculation of
+ PROC_REG_OFFSET and PROC_FREG_OFFSET.
+
+Mon Apr 27 14:37:49 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/v850/tm-v850.h (REGISTER_BYTE): FP_REGNUM and
+ FP_RAW_REGNUM use the same register location.
+
+ * v850-tdep.c (v850_scan_prologue): Use FP_RAW_REGNUM instead of
+ FP_REGNUM.
+ (v850_frame_chain): Ditto.
+
+ * config/v850/tm-v850.h (REGISTER_NAMES): Add "fp".
+ (NUM_REGS): Update.
+ (FP_REGNUM): Update.
+ (FP_RAW_REGNUM): Define.
+
+Wed May 27 14:22:31 1998 Keith Seitz <keiths@cygnus.com>
+
+ * main.c (main): Convert the path returned from getenv to a posix
+ path on cygwin32 hosts.
+
+Mon May 25 13:31:27 1998 Keith Seitz <keiths@cygnus.com>
+
+ * remote.c (remote_open_1): If an error occurs starting the remote,
+ pop the target AND return.
+
+Sat May 23 02:23:09 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * dwarf2read.c (read_subroutine_type): Set TYPE_FLAG_PROTOTYPED
+ on C++ functions.
+ * valops.c (value_arg_coerce): Add new argument to indicate whether
+ the function has a prototype, handle integer and float promotions
+ accordingly.
+ (call_function_by_hand): Always call value_arg_coerce, pass down
+ prototype information.
+
+Fri May 22 10:56:36 1998 John Metzler <jmetzler@cygnus.com>
+
+ * remote.c (_initialize_remote): Typo extended__remote
+
+Thu May 21 13:14:25 1998 John Metzler <jmetzler@cygnus.com>
+
+ * gnu-nat.c (init_gnu_ops): Initialization of target ops by assignment.
+ (_initialize_gnu_nat): Call new init
+ * mac-nat.c (init_child_ops): Ditto.
+ (_initialize_mac_nat): Ditto.
+ * monitor.c (init_base_monitor_ops): Ditto.
+ (_initialize_remote_monitors): Ditto.
+ * ppc-bdm.c (init_bdm_ppc_ops): Ditto.
+ (_initialize_bdm_ppc): Ditto.
+ * remote-adapt.c (init_adapt_ops): Ditto.
+ (_initialize_remote_adapt): Ditto.
+ * remote-array.c (init_array_ops): Ditto.
+ (_initialize_array): Ditto.
+ * remote-bug (init_bug_ops): Ditto.
+ (_initialize_remote_bug): Ditto.
+ * remote-e7000.c (init_e7000_ops): Ditto.
+ (_initialize_remote_e7000): Ditto.
+ * remote-eb.c (init_eb_ops): Ditto.
+ (_initialize_remote_eb): Ditto.
+ * remote-es.c (init_es1800_ops): Ditto.
+ (init_es1800_child_ops): Ditto.
+ (_initialize_es1800): Ditto.
+ * remote-hms.c (init_hms_ops): Ditto.
+ (_initialize_remote_hms): Ditto.
+ * remote-mm.c (init_mm_ops): Ditto.
+ (_initialize_remote_mm): Ditto.
+ * remote-nindy.c (init_nindy_ops): Ditto.
+ (_initialize_nindy): Ditto.
+ * remote_nrom.c (init_nrom_ops): Ditto.
+ (_initialize_remote_nrom): Ditto.
+ * remote-os9k (init_rombug_ops): Ditto.
+ (_initialize_remote_os9k): Ditto.
+ * remote-rdi.c (init_rdi_ops): Ditto.
+ (_initialize_remote_rdi): Ditto.
+ * remote-rdp.c (init_remote_rdp_ops): Ditto.
+ (_initialize_remote_rdp): Ditto.
+ * remote-sds.c (init_sds_ops): Ditto.
+ (_initialize_remote_sds): Ditto.
+ * remote-sim.c (init_gdbsim_ops): Ditto.
+ (_initialize_remote_sim): Ditto.
+ * remote-st.c (init_st2000_ops): Ditto.
+ (_initialize_remote_st2000): Ditto.
+ * remote-udi.c (init_udi_ops): Ditto.
+ (_initialize_remote_udi): Ditto.
+ * remote-vx.c (init_vx_ops): Ditto.
+ (init_vx_run_ops): Ditto.
+ (_initialize_vx): Ditto.
+ * remote.c (init_remote_ops): Ditto.
+ (init_extended_remote_ops): Ditto.
+ (_initialize_remote): Ditto.
+ * sparcl-tdep.c (init_sparclite_ops): Ditto.
+ (_initialize_sparcl_tdep): Ditto.
+ * v850ice.c (init_850ice_ops): Ditto.
+ (_initialize_v850ice): Ditto.
+ * win32-nat.c (init_child_ops): Ditto.
+ (_initialize_inftarg): Ditto.
+
+1998-05-21 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (const_var_ref): Don't handle function names. I don't
+ want to implement all the "usual unary conversion" rules for
+ constants.
+ (gen_usual_unary): Turn "function" values into "pointer to
+ function" values, in accordance with ANSI.
+ (gen_deref): Don't do the usual unary conversions here. Let the
+ caller do it. Note that dereferencing a function pointer yields
+ a function designator, which we call an rvalue, not an lvalue.
+ (gen_address_of): Handle functions specially.
+ (gen_struct_ref): Perform the usual unary conversions before
+ calling gen_deref.
+ (gen_expr): In case for the prefix '*' operator, call
+ gen_usual_unary manually.
+
+Wed May 20 15:29:41 1998 Gavin Koch <gavin@cygnus.com>
+
+ * mips/tm-tx39.h (MIPS_DEFAULT_FPU_TYPE): Defined as MIPS_FPU_NONE.
+ * mips/tm-tx39l.h: Same.
+
+Wed May 20 10:12:11 1998 John Metzler <jmetzler@cygnus.com>
+
+ * m32r-tdep.c (decode_prologue): Handle frames compiled with -Os.
+ Split out as separate function called by skip prologue and scan
+ prologue. new formula handles optimization in which the prologue
+ is interleaved with the body of the function. Also recognizes new
+ variations of prologue encoding. Use of frame pointer is
+ essential to debugging, -fno-omit-frame-pointer
+ (m32r_skip_prologue): Call decode prologue, ignore line info
+ (m32r_scan_prologue): Call decode prologue, ignore line info.
+
+Tue May 19 17:23:54 1998 John Metzler <jmetzler@cygnus.com>
+
+ * w89k-rom.c (_initialize_w89k): Call new init function
+ (init_w89k_cmds): Convert to dynamic initialization of monitor_ops
+ data structure for forward compatability with additions to the
+ data structure.
+ * dbug-rom.c (_initialize_dbug_rom): ditto
+ (init_dbug_cmds): ditto
+ * m32r-rom.c (_initialize_m32r_rom): ditto
+ (init_m32r_cmds): ditto
+
+Tue May 19 14:54:11 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (memrange_cmp): use const void * args to avoid
+ ANSI compiler warnings.
+
+1998-05-19 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (gen_fetch, gen_var_ref, gen_deref, find_field,
+ gen_bitfield_ref, gen_expr): Call error, not abort.
+ * ax-general.c (read_const, generic_ext, ax_trace_quick,
+ ax_label, ax_const_d, ax_reg, ax_print): Same.
+
+ * tracepoint.c: Remove the $(...) syntax for memranges.
+ (validate_actionline, encode_actions, trace_dump_command): Remove
+ clauses for the $(...) syntax.
+ (parse_and_eval_memrange): Function deleted.
+ (_initialize_tracepoint): Update function description.
+
+ * ax-gdb.c (_initialize_ax_gdb): Make the "agent" command a
+ subcommand of "maintenance", as it should have been from the
+ beginning. #include "gdbcmd.h", to get the declaration for
+ maintenancelist.
+ * Makefile.in: Document that dependency.
+
+Tue May 19 12:00:58 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * tracepoint.c (get_tracepoint_by_number): new function, to access
+ traceframe_number for use of the GUI.
+
+ * tracepoint.h: added prototype for get_traceframe_number.
+
+Mon May 18 13:34:27 1998 Keith Seitz <keiths@cygnus.com>
+
+ * dbxread.c (process_one_symbol): If block addresses are relative to
+ function start addresses, reset function_start_address whenever a new
+ source file is seen.
+
+Mon May 18 13:04:27 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (get_tracepoint_by_number): make sure to advance
+ arg pointer even if we fail to parse a useful number. Otherwise,
+ since this function is called in a loop, it may loop forever!
+ Also change strtol call to allow arbitrary radix.
+ (map_args_over_tracepoints (and other places)): add QUIT; call
+ to loop, to allow breakout using control-C. Not all loops were
+ analyzed to make sure they could terminate cleanly, but even
+ terminating with a messed-up tracepoint list would be better
+ than not terminating at all!
+ (tdump_command): check to see if we're connected to a trace-
+ capable target (currently only "remote") before doing anything
+ else.
+
+Sat May 16 22:21:48 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * config/d30v/tm-d30v.h (INIT_FRAME_PC_FIRST): Fill in PC into
+ frame struct before extracting saved register offsets.
+
+Fri May 15 22:47:45 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (encode_actions): fix typo in printf format string.
+
+1998-05-15 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Implement a few more tracing operators: ^ | & ~ !
+ * ax-gdb.c (gen_integral_promotions, gen_logical_not,
+ gen_complement): New functions.
+ (gen_binop): New argument MAY_CARRY, indicating whether we need to
+ correct the upper bits of the value after performing the
+ operation. Callers changed.
+ (gen_expr): Handle BINOP_BITWISE_AND, BINOP_BITWISE_IOR, and
+ BINOP_BITWISE_XOR here as well, by calling gen_binop. Handle
+ UNOP_LOGICAL_NOT, UNOP_COMPLEMENT.
+
+ * ax-gdb.c (gen_conversion): Reworked to avoid some unnecessary
+ sign extension.
+
+ * ax-gdb.c (gen_usual_arithmetic): Renamed from gen_usual_binary,
+ to match the ANSI C standard better. Callers changed.
+
+ * ax-gdb.c (gen_traced_pop): Add prototyped declaration.
+
+Fri May 15 18:18:38 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * tracepoint.c (stringify_collections_list): return a collection
+ of strings rather than a single string.
+ (free_actions_list): new function.
+ (encode_actions): process collection of strings returned by
+ stringify_collections_list.
+
+1998-05-15 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (gen_traced_pop): New function.
+ (gen_expr): Call it for comma operator.
+ (gen_trace_for_expr): Call it, instead of writing it out.
+
+ Add facilities for sending arbitrary packets to the remote agent.
+ There are a bunch of improvements to make (make it generic; handle
+ 'O' replies properly), but I just want to get this onto the branch.
+ * remote.c (print_packet, remote_packet_command): New functions.
+ (_initialize_remote): Register the remote-packet command.
+
+Thu May 14 17:52:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * tracepoint.c: move actionline_type definition to tracepoint.h.
+ (validate_actionline): make non static.
+
+ * tracepoint.h: move actioline_type definition from tracepoint.c.
+ (validate_actionline) moved prototype from tracepoint.c.
+
+Thu May 14 11:49:18 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * tracepoint.c (validate_actionline): add additional error
+ checking, remove some dead code.
+ (encode_actions): additional cleanups.
+ (trace_find_command): remove some dead code.
+ (trace_find_pc_command): ditto.
+ (trace_find_tracepoint_command): ditto.
+ (trace_find_line_command): ditto.
+ (trace_find_range_command): ditto.
+ (trace_find_outside_command): ditto.
+
+Thu May 14 5:51:00 1998 Ron Unrau <runrau@cygnus.com>
+
+ * symtab.c (decode_line_1): set section for "break *<addr>"
+
+Wed May 13 20:58:02 1998 Mark Alexander <marka@cygnus.com>
+
+ * corefile.c (reopen_exec_file): Reopen the exec file if
+ it has changed.
+
+Wed May 13 15:22:02 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (fetch_instruction): New function.
+ (single_step, sparc_init_extra_frame_info, examine_prologue):
+ Use fetch_instruction instead of read_memory_integer
+ to ensure that instructions are always read as big-endian.
+
+Wed May 13 14:42:21 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add AC_FUNC_ALLOCA.
+ * defs.h: Check HAVE_ALLOCA_H rather than sparc. Add _AIX pragma
+ alloca.
+ * configure: Rebuild.
+ * Makefile.in (jv-lang.o, jv-typeprint.o, jv-valprint.o): New
+ targets.
+
+Wed May 13 11:19:08 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (trace_command): Remove old diagnostic code that was
+ preventing tracepoints from being defined with a full-path filename.
+
+Tue May 12 13:17:35 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * stabsread.c (read_one_struct_field): Check for typedef in type
+ tree before clearing bitfield information.
+
+1998-05-11 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (gen_binop): New function, based on gen_mul, to replace
+ gen_mul and gen_div, and handle `%' op as well. Correctly tests
+ type of arguments.
+ (gen_expr): Factor out common code in binary arithmetic operators.
+ Add support for `%'.
+ (gen_mul, gen_div): Removed.
+
+Thu May 7 14:49:38 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/sparc/tm-sp64.h (CALL_DUMMY): Store and retrieve
+ %o0-%o5 as 64-bit values; compensate for stack bias.
+ (USE_STRUCT_CONVENTION): We only pass pointers to structs
+ if they're larger than 32 bytes.
+ (REG_STRUCT_HAS_ADDR): Ditto.
+
+ * sparc-tdep.c (sparc_init_extra_frame_info): Use read_sp()
+ instead of read_register. If the target is a sparc64 and the frame
+ pointer is odd, compensate for the stack bias.
+ (get_saved_register): Use read_sp().
+ (DUMMY_STACK_REG_BUF_SIZE): Use FP_REGISTER_BYTES.
+ (sparc_push_dummy_frame): Use read_sp()/write_sp(). On sparc64,
+ save the PC, NPC, CCR, FSR, FPRS, Y and ASI registers.
+ (sparc_frame_find_saved_regs): Use read_sp(). Read the PC, NPC,
+ CCR, FSR, FPRS, Y and ASI registers from the frame, if it's a
+ dummy frame.
+ (sparc_pop_frame): Use write_sp(). If the target is a sparc64 and
+ the FP is odd, compensate for stack bias.
+ (sparc_store_return_value): Right-justify the return value before
+ writing it to %o0.
+ (sparc_fix_call_dummy): Don't NOP out part of the call dummy on
+ sparc64.
+ (sparc64_read_sp, sparc64_read_fp, sparc64_write_sp,
+ sparc64_write_fp, sp64_push_arguments,
+ sparc64_extract_return_value): New functions to support the
+ sparc64 ABI.
+
+ * dwarfread.c (handle_producer): Set processing_gcc_compilation to
+ the right version number.
+
+ * dwarf2read.c (read_file_scope): Assume we're processing
+ GCC2 output.
+
+Wed May 6 16:34:03 1998 Jeffrey A Law (law@cygnus.com)
+
+ * somsolib.c: Include gdb_stat.h.
+
+Mon May 4 18:34:01 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * ax-gdb.c (gen_mul): new function; (gen_div): new function;
+ (gen_expr): add support for * and / operators, call gen_mul and
+ gen_div as appropriate.
+
+Mon May 4 16:24:22 1998 Mark Alexander <marka@cygnus.com>
+
+ * defs.h (make_run_cleanup): Declare.
+ * solib.c (find_solib): Pass correct number of arguments to
+ make_run_cleanup.
+
+Mon May 4 07:08:25 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (trace_actions_command): actions command must set
+ step_count to zero (in case previous actions have set it but the
+ new set does not).
+
+Sat May 2 09:35:07 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * ocd.h: Add new flags, function codes, and processor types to
+ support new Wiggler capabilities.
+ * (ocd_write_bytes_size): New function to allow atomic writes of
+ memory in sizes larger than a byte.
+
+ * ser-unix.c (baudtab): Add 57600, 115200, 230400, and 460800 baud.
+
+Fri May 1 19:51:32 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * stabsread.c (read_one_struct_field): Do not override supplied
+ bitfield size for a range type value.
+
+ * gdbtypes.c (create_range_type): For a range with positive
+ lower limit, declare range type as unsigned.
+
+Fri May 1 10:58:34 1998 John Metzler <jmetzler@cygnus.com>
+
+ * monitor.c: Turn off debug
+
+Fri May 1 09:29:56 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * breakpoint.c (delete_command): Skip internal breakpoints when
+ all breakpoints are requested.
+
+ * stabsread.c (define_symbol): Record parameter types from Sunpro
+ function stabs in the TYPE_FIELDS of the function type.
+
+Thu Apr 30 15:59:54 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (config-check-targets, config-check-hosts): Removed.
+
+1998-04-30 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.in (maintainer-clean):
+ Don't get ahead of yourself and delete Makefile
+ before running `make'.
+ (local-maintainer-clean, do-maintainer-clean): New rules.
+
+Wed Apr 29 14:02:59 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * ax-gdb.c (gen_add): when adding a pointer and an int, use
+ the size of the pointer, not the int (typo) to decide how
+ to extend the result.
+
+Wed Apr 29 10:20:40 1998 John Metzler <jmetzler@cygnus.com>
+
+ * nec4102rom.c: New file implements ROM monitor adapter for
+ nec-vr4102 board. This board hosts the vr4111 chip. This file
+ required extensions to the monitor_ops structure, hooks for wait
+ filter, new flags. This version does not support more than one
+ breakpoint and resuming after a breakpoint in 16 bit mode is
+ completely disfunctional.
+
+ * monitor.h: Defined additional hooks for dmpregs, configure_hooks
+ and wait_filter. These additions require that all ROM monitor
+ interfaces be recoded to initialize monitor ops using assignments
+ rather than static structure initialization. Added new bits to
+ flags MO_EXACT_DUMPADDR, MO_HAS_BLOCKWRITES.
+
+ * monitor.c (RDEBUG): Conditional tracing throughout the file.
+ (fromhex): Now recognized upper cse hex digits
+ (monitor_printf_noecho):
+ (monitor_readchar): Tracing interferes with input timing.
+ (monitor_open): Register different memory write functions with
+ dcache_init if MO_HAS_BLOCKWRITES.
+ (flush_monior_dcache): Added as an additional utilty.
+ (monitor-resume): Call continue hook if one has been supplied.
+ (monitor_wait_filter): New function Factored out of monitor wait
+ and used if alternate wait-filter has not been provided.
+ (monitor_wait): call alternate wait filter if provided. Call
+ monitor_dump_regs, a new function factored out from inline code.
+ (monitor_dump_block): A new function used as a utility when
+ monitors must dump several blocks of registers using different
+ commands.
+ (monitor_dump_regs): Call alternate function if provided. Uses new
+ hook in monitor.h.
+ (monitor_write_memory): Engage previouly added hook
+ MO_FILL_USES_ADDR.
+ (monitor_write_even_block): new function supports writing long
+ blocks of 4byte words.
+ (longlongendswap): new internal function
+ (monitor_write_memory_longlongs): new function writes large blocks
+ using command to enter a long long.
+ (monitor_write-memory_block): new Function figures out which block
+ mod to use.
+ (monitor_read_memory): Can now handle dump formats in which the bytes
+ preceeding the requested data is not printed.
+
+Tue Apr 28 19:41:33 1998 Tom Tromey <tromey@cygnus.com>
+
+ * tracepoint.c (memrange_cmp): Another typo fix; `memrbnge' ->
+ `memrange'.
+
+ * tracepoint.c (memrange_cmp): Fixed typo in function intro.
+
+Tue Apr 28 17:41:20 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * symfile.c (overlay_auto_command): Add forgotten parameter
+ definitions.
+ (overlay_manual_command, overlay_off_command): Likewise.
+ (overlay_load_command): Likewise.
+ * tracepoint.c (memrange_cmp): Parameters have type void *, not
+ struct memrange *.
+
+Tue Apr 28 11:08:25 1998 John Metzler <jmetzler@cygnus.com>
+
+ * rom68k-rom.c (_initialize_rom68k): Fix unresolved init_rom_68kcmds.
+
+Mon Apr 27 14:32:21 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/sparc/tm-sparc.h (CALL_DUMMY): Shorten it drastically,
+ make it work on the simulator.
+ (FIX_CALL_DUMMY): Convert to function call instead of inline code.
+ (sparc_fix_call_dummy): Declare.
+ * sparc-tdep.c (sparc_fix_call_dummy): New function, taken from
+ old FIX_CALL_DUMMY macro, with additional fixes for simulator.
+ (sparc_push_dummy_frame): Set registers differently on simulator
+ to prevent corrupted register window save areas.
+
+Mon Apr 27 13:46:40 1998 John Metzler <jmetzler@cygnus.com>
+
+ * rom68k-rom.c (_initialize_rom68k, init_rom68k_cmds):
+ Convert all static initializations of monitor ops structures to
+ executable initializations in order that additions to the data
+ structure definition can me made without repeating this editing
+ exercise.
+ * abug-rom.c (_initialize_abug_rom, init_abug-cmds): Ditto.
+ * cpu32bug-rom.c (_initialize_cpu32bug_rom, init_cpu32bug_cmds): Ditto.
+ * mon960-rom.c (initialize_mon960, init_mon960_cmds): Ditto.
+ * op50-rom.c (initialize_op50n, init_op50n_cmds): Ditto.
+ * ppcbug-rom.c (_initialize_ppcbug_rom, init_ppc_cmds): Ditto.
+ * sh3-rom.c (_initialize_sh3_rom, init_sh3_cmds): Ditto.
+ * sparclet-rom.c (_initialize_sparclet, init_sparclet_cmds): Ditto.
+ * remote-est.c (_initialize_est, init_est_cmds): Ditto.
+ * remote-hms.c ( _initialize_remote_hms, init_hms_cmds): Ditto.
+
+Mon Apr 27 10:43:04 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * gdb_string.h (strdup): Don't specify arguments in prototype.
+
+Sun Apr 26 07:57:21 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * rs6000-nat.c (vmap_ldinfo): Issue warning instead of error if
+ fstat on ldinfo_fd fails. Use objfile->obfd instead of vp->bfd
+ to check for reference to the same file.
+
+ * target.c (target_read_string): Handle string transfers at the
+ end of a memory section gracefully.
+
+Fri Apr 24 17:18:56 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * Makefile.in: enable EXEEXT setting
+
+Fri Apr 24 11:53:49 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * tracepoint.c (add_local_symbols): change type of type from
+ char to int so that type shows up as 'A' or 'L' not 0.
+
+Thu Apr 23 16:37:20 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * README: Minor changes for 4.17 release.
+
+Thu Apr 23 15:44:39 1998 Per Bothner <bothner@cygnus.com>
+
+ * symfile.c (deduce_language_from_filename): .class implies java.
+
+Thu Apr 23 12:52:21 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * configure.in (strerror): Check if function must be declared.
+ * acconfig.h (NEED_DECLARATION_STRERROR): New define slot.
+ * gdb_string.h (strerror): Function declaration issued if
+ NEED_DECLARATION_STRERROR.
+ * configure, config.in: Files regenerated.
+
+Thu Apr 23 12:27:43 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * symfile.c (simple_overlay_update_1): Do not prefix array address
+ by `&'.
+ * bcache.h (BCACHE_DATA_ALIGNMENT): Ditto.
+ * tracepoint.c (encode_actions): Ditto.
+ * language.c, complaints.c, utils.c (varargs.h): Do not include that
+ file here, it is already included indirectly by defs.h.
+ * dbxread.c (dbx_symfile_init, process_one_symbol): Cast xmalloc return
+ value to the appropriate pointer type.
+ * utils.c (floatformat_from_doublest): Ditto.
+ * tracepoint.c (read_actions, _initialize_tracepoint): Ditto.
+ (add_memrange): Likewise with xrealloc return value.
+ * stabsread.c (ref_add): Ditto.
+ * coffread.c (coff_symfile_init): Likewise for xmmalloc return value.
+ * elfread.c (elf_symfile_read): Ditto.
+ * os9kread.c (os9k_symfile_init): Ditto.
+
+Thu Apr 23 00:32:08 1998 Tom Tromey <tromey@cygnus.com>
+
+ * config.in: Rebuilt.
+ * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_STPCPY, HAVE_GETTEXT,
+ HAVE_LC_MESSAGES): Define.
+
+Wed Apr 22 15:38:56 1998 Tom Tromey <tromey@cygnus.com>
+
+ * configure: Rebuilt.
+ * configure.in: Call CY_GNU_GETTEXT.
+ * Makefile.in (top_builddir): New macro.
+ (INTL): Define to @INTLLIBS@.
+ (INTL_DEPS): New macro.
+ (CDEPS): Reference INTL_DEPS, not INTL.
+
+Wed Apr 22 12:58:23 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Handle missing shared libraries during the examination of a core
+ dump gracefully.
+ * solib.c (find_solib): Use catch_errors around call to
+ solib_map_sections. Use warning instead of error if reading of
+ the shared library name fails.
+ (solib_map_sections): Change return and argument types to make
+ it callable from catch_errors.
+ (symbol_add_stub): Avoid GDB core dump if solib->abfd is NULL.
+ * irix5-nat.c, osfsolib.c (xfer_link_map_member, solib_map_sections,
+ symbol_add_stub): Ditto.
+
+Wed Apr 22 14:34:49 1998 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.in (INTL*): Add support to link in the intl library,
+ and to add -I options to its source and object directories.
+ (INTERNAL_CFLAGS): Ditto.
+ (C{LIBS,DEPS}): Ditto.
+
+Tue Apr 21 11:20:54 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * mips-tdep.c (gdb_print_insn_mips): Disassemble MIPS instructions
+ with subtarget-specific `mach', rather than fixed default.
+ * config/mips/tm-mips.h (TM_PRINT_INSN_MACH): New macro, default
+ disassembly `mach'.
+
+Mon Apr 20 15:35:03 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * coffread.c (decode_base_type): Treat a long field with size greater
+ than TARGET_LONG_BIT as long long.
+ * values.c (value_from_longest): Print code value in error message.
+
+Mon Apr 20 15:32:21 1998 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * gdb/gdb_string.h (strdup): Declare only if not defined as a
+ macro.
+
+Mon Apr 20 14:18:45 1998 J. Kean Johnston <jkj@sco.com>
+
+ * procfs.c: Added replacement macros for LWP stuff. Fixed support
+ for UnixWare / SVR4.2MP targets and any targets which use
+ multi-file /proc entries. Fixed support for hardware watchpoints.
+ * solib.c: SCO needs some of the same code as SunOS. Change
+ preprocessor conditionals.
+
+ * config/i386/i386sco5.mt: New file.
+ * config/i386/tm-i386sco5.h: New file.
+ * config/i386/i386sco5.mh (NATDEPFILES): add i386v-nat.o.
+ * config/i386/nm-i386v42mp.h
+ (TARGET_HAS_HARDWARE_WATCHPOINTS): define.
+ Add other macros for hardware assisted watchpoints.
+ * config/i386/nm-i386sco5.h: Correct attributions.
+ (TARGET_HAS_HARDWARE_WATCHPOINTS): define.
+ * config/i386/nm-linux.h (target_remote_watchpoint): Pass
+ 'type' through to i386_insert_watchpoint.
+
+Mon Apr 20 14:12:30 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * infrun.c (wait_for_inferior): Don't add signalled processes
+ as new threads.
+ * procfs.c (wait_fd): Note if LWP has exited.
+ (procfs_wait): use GETPID to get process ID.
+
+Sat Apr 18 15:21:04 1998 Stan Cox <scox@cygnus.com>
+
+ * configure.tgt: Added sparc86x support.
+
+Thu Apr 16 13:13:24 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * rdi-share/etherdrv.c (EthernetWrite): Use strerror to get
+ error string if in an ANSI C-ish environment.
+
+Wed Apr 15 18:59:48 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (SPARC_HAS_FPU): Define.
+ (sparc_extract_return_value): New function, required to handle
+ machines without floating point.
+ (sparc_store_return_value): Ditto.
+ * config/sparc/tm-sparc.h (EXTRACT_RETURN_VALUE): Call
+ sparc_extract_return_value instead of using inline code.
+ (sparc_extract_return_value): Declare.
+ (STORE_RETURN_VALUE): Call sparc_store_return_value instead
+ of using inline code.
+ (sparc_store_return_value): Declare.
+
+Wed Apr 15 12:19:42 1998 Martin M. Hunt <hunt@cygnus.com>
+
+ * solib.c (enable_break): Only call warning once
+ instead of three times.
+
+Tue Apr 14 16:52:59 1998 Mark Alexander <marka@cygnus.com>
+
+ * sparc-tdep.c (sparc_extract_struct_value_address): Make it
+ work correctly on little-endian hosts.
+ (sparc_push_arguments): New function.
+ (gdb_print_insn_sparc): New function.
+ (_initialize_sparc_tdep): Make gdb_print_insn_sparc the default
+ disassembler, so that SPARClite-specific instructions will
+ be recognized.
+ * sparcl-tdep.c (readchar): Print debugging information.
+ (debug_serial_write): New function, a replacement for SERIAL_WRITE
+ that prints debugging information.
+ * config/sparc/tm-sparc.h (PUSH_ARGUMENTS): Define.
+ (sparc_push_arguments): Declare.
+
+Tue Apr 14 15:43:49 1998 John Metzler <jmetzler@cygnus.com>
+
+ * gdbcfgxref (xref_menu): Call new regex and wild card searches
+ Now you can type in a specific triple like mips64-vr4300-elf or
+ somthing like mips*.h
+ (triple_search, wildcardsearch): The new functions
+
+Mon Apr 13 16:28:07 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * utils.c (warning): added call to warning_hook
+
+ * source.c (find_source_lines): modified to call warning in case
+ of source vs. executable time stamp mismatch. Simplified object
+ file check. Initialized mtime to 0.
+
+ * defs.h: added warning_hook prototype
+
+ * top.c: added warning_hook prototype.
+
+Mon Apr 13 09:54:08 1998 Keith Seitz <keiths@andros.cygnus.com>
+
+ * config/sparc/tm-sun4os4.h (IS_STATIC_TRANSFORM_NAME): Add missing
+ definition.
+
+Fri Apr 10 22:36:28 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Update support for x86 Solaris 2.
+ * config/i386/tm-i386sol2.h, nm-i386sol2.h: New configuration
+ files for x86 Solaris 2.
+ * config/i386/i386sol2.mt, i386sol2.mh: Use them.
+ * config/sparc/tm-sun4sol2.h (PROCFS_GET_CARRY): New macro, extract
+ carry flag from a given regset.
+ (IS_STATIC_TRANSFORM_NAME): New macro, check if a symbol name
+ is a SunPro transformed name.
+ * i386-tdep.c (sunpro_static_transform_name): New function to
+ extract the source name from a SunPro transformed name.
+ * inferior.h (procfs_first_available, procfs_get_pid_fd):
+ Add prototypes.
+ * infrun.c (wait_for_inferior): Handle breakpoint hit in
+ signal handler without intervening stop in sigtramp.
+ * procfs.c (procfs_lwp_creation_handler): Use PROCFS_GET_CARRY
+ instead of direct access to the status register.
+ (procfs_get_pid_fd): New function, returns procfs fd for a given pid.
+ * sol-thread.c (ps_lgetLDT): New function, returns LDT for a given
+ lwpid.
+ (sol_find_new_threads): Handle failed libthread_db initialization
+ gracefully.
+ * stabsread.c (define_symbol): Use IS_STATIC_TRANSFORM_NAME
+ to check for a SunPro transformed symbol name.
+
+Fri Apr 10 10:35:35 1998 John Metzler <jmetzler@cygnus.com>
+
+ * utils.c (fmthex): A formatting function for hexdumps
+
+ * mips-tdep.c (unpack_mips16): Fixed instruction decoding, lots of
+ bit pattern interpretations. mips_fetch_instruction does not work
+ for 16 bit instructions. Some confusion remains about sign
+ extension in backward branches.
+ (mips32_relative_offset): Sign extension
+ (mips32_next_pc): Major debugging, bit pattern interpretation
+ (print_unpack): debugging printf
+ (fetch_mips_16): new funtion, key on PC low bit, not symbol table
+ (mips16_next_16): Initial major debugging of this function. Lots
+ of bit pattern mistakes.
+ (mips_next_pc): key on low bit of PC, not symbol table.
+ * symfile.c (generic_load): Added a download verification which
+ reads back the loaded code. Download chunk size is now a defined
+ macro. Fixed a bug in which downloading slips into loading one
+ byte at a time. Lower level functions in monitor.c can load long
+ sequences of bytes and make use of these fixups. Referencing
+ bfd-start_address directly was incorrectly getting zero for start.
+
+Thu Apr 9 19:20:32 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * mips-tdep.c (do_fp_register_row): Use alloca rather than arrays
+ with dynamic size.
+
+Wed Apr 8 19:21:42 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * top.c (print_gdb_version): Print 1998 now.
+
+Wed Apr 8 16:57:22 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * source.c: Remove obsolete decl of strstr().
+
+Wed Apr 8 16:47:33 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * solib.c (solib_create_inferior_hook): Remove Ulrich Drepper's
+ patch of March 23 1998.
+ * breakpoint.c (breakpoint_re_set_one): Remove Ulrich Drepper's
+ patch of March 23 1998.
+
+Sat Apr 4 10:05:00 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * mdebugread.c (parse_partial_symbols): If this is an .mdebug
+ section in an ELF file, override a symbol's ECOFF section with its
+ ELF section. Also, fix stabs continuation where a stabs string
+ continues for more than one continuation.
+
+Mon Apr 6 09:17:48 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Specify dimention of valbuf
+ using MAX_REGISTER_RAW_SIZE.
+
+Sat Apr 4 10:05:00 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * infrun.c: Fix prototype of signals_info to match static funtion.
+
+Thu Apr 2 12:47:41 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * sol-thread.c (sol_thread_store_registers): Save & restore new
+ value of single updated register to prevent accidental clobbering.
+
+Wed Apr 1 22:01:09 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE): Define.
+ * config/sparc/sparclite.mt: Link in the erc32 simulator.
+
+Wed Apr 1 16:30:49 1998 Ian Dall <Ian.Dall@dsto.defence.gov.au>
+
+ * ns32k-tdep.c (flip_bytes, ns32k_localcount,
+ ns32k_get_enter_addr, sign_extend): Restore functions mysteriously
+ deleted.
+
+ * ns32knbsd-nat.c: New (?) file to support fetching and storing
+ registers on NetBSD hosts.
+
+ * nbsd.mh (NATDEPFILES): put ns32knbsd-nat.o instead of
+ ns32k-nat.o
+
+ * ns32km3-nat.c (reg_offset): Get order of floating point
+ registers correct. Add extra 32382 register offsets.
+ (REG_ADDRESS): define to point at correct part of thread
+ state. Use calls to "warning" instead of "message".
+
+ * tm-nbsd.h, tm-ns32km3.h (REGISTER_NAMES, NUM_REGS,
+ REGISTER_BYTES, REGISTER_BYTE): redefine allowing for 32382
+ fpu registers.
+
+Wed Apr 1 13:43:07 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * NEWS: m68k-motorola-sysv host support added.
+ * coffread.c (coff_start_symtab): Accept the filename as an argument,
+ set it here. Callers updated.
+
+Wed Apr 1 23:13:23 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mips.h (REGISTER_VIRTUAL_TYPE): Handle 32 bit SR,
+ FSR and FIR registers.
+ (REGISTER_VIRTUAL_SIZE): Compute using REGISTER_VIRTUAL_TYPE.
+ (REGISTER_RAW_SIZE): Define using REGISTER_VIRTUAL_SIZE.
+
+ * config/mips/tm-mips64.h: Ditto.
+
+Tue Mar 31 21:30:39 1998 Nick Clifton <nickc@cygnus.com>
+
+ * arm-tdep.c (gdb_print_insn_arm): Attach a fake Thumb symbol
+ vector to the info structure when disassembling thumb
+ instructions.
+
+ * coffread.c (coff_symtab_read, read_one_sym,
+ process_coff_symbol): Support Thumb symbol types.
+
+ * dbxread.c (process_one_symbol): Call SMASH_TEXT_ADDRESS (if it
+ is defined) for function symbols.
+
+Tue Mar 31 16:39:28 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c (get_tracepoint_by_number): change warning to note.
+ (delete_trace_command): suppress y/n query if no tracepoints, or
+ if not from_tty. (trace_pass_command): reject junk at end of args.
+ (read_actions): an action list consisting only of "end" is discarded.
+ (validate_actionline (for collect command)): an argument beginning
+ with a dollar_sign but not recognized as a special argument is
+ parsed like any other expression -- if it isn't a register name,
+ it's rejected. Also reject an empty argument to while-stepping.
+ (trace_find_command): reject a negative frame number argument.
+ (_initialize_tracepoint): set $traceframe initially to -1.
+
+Mon Mar 30 16:42:12 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * rdi-share/Makefile.am, rdi-share/aclocal.m4,
+ rdi-share/configure: New files.
+ * rdi-share/configure.in: Rewritten to be an autoconf input file.
+ * rdi-share/Makefile.in, rdi-share/configure: Generated by
+ automake/autoconf.
+ * rdi-share/dbg_hif.h, etherdrv.c, hostchan.c: Use autoconf tests
+ to check environment.
+
+Sun Mar 29 15:17:16 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * tracepoint.c (trace_start_command): Set trace_running_p.
+ (trace_stop_command): Clear trace_running_p.
+
+Sat Mar 28 15:19:48 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Update for 4.17 release.
+
+Fri Mar 27 10:15:50 1998 David Taylor <taylor@tito.cygnus.com>
+
+ * tracepoint.c (parse_and_eval_memrange): Fix memory leaks.
+ (encode_actions): Use the new gen_trace_for_expr function
+ instead of expr_to_address_and_size; collect registers when
+ using expressions. (clear_collection_list): Fix memory leak.
+
+1998-03-26 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.h (gen_trace_for_expr): Add prototype.
+
+Thu Mar 26 17:24:23 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * tracepoint.c (validate_actionline): Fix memory leak.
+ (encode_actions): Fix memory leak.
+
+Thu Mar 26 16:16:55 1998 David Taylor <taylor@tito.cygnus.com>
+
+ * tracepoint.c (trace_mention): New function.
+ (trace_command): Call it.
+
+1998-03-26 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-general.c (ax_reqs): New function.
+ * ax.h (enum agent_flaws, struct agent_reqs): New types.
+ (agent_reqs): New extern prototype. Well, actually, this was
+ there before, due to a premature checkin.
+ (struct aop_map): Add new `data_size' member.
+ * ax-general.c (aop_map): Supply its value.
+ * ax-gdb.c (agent_command): Call ax_reqs, for testing.
+
+ * ax-general.c (ax_print): If we encounter an invalid or
+ incomplete opcode, don't abort; just print an error message.
+
+ * ax-gdb.c: Generate trace bytecodes, as appropriate.
+ (trace_kludge): New variable.
+ (gen_fetch, gen_bitfield_ref): Emit trace bytecodes, if asked
+ nicely.
+ (expr_to_agent): Ask for no trace bytecodes.
+ (gen_trace_for_expr): New function.
+ (agent_command): Call it, and display the result appropriately ---
+ no struct axs_value, so no type or kind information.
+
+ * ax-gdb.c: Use TARGET_CHAR_BIT throughout, not HOST_CHAR_BIT.
+
+Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * tracepoint.c (trace_status_command): Recognize a boolean return
+ value from the stub to indicate whether trace experiment is
+ running. Export this value as a global state variable.
+ (trace_running_p) for use by the GUI. (from Michael Snyder)
+ (trace_pass_command) added call to modify_tracepoint_hook.
+
+ * tracepoint.h export trace_running_p.
+
+Thu Mar 26 13:08:01 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * tracepoint.c (validate_actionline): do not error out if
+ exp->elts[0].opcode is not on short line -- let
+ expr_to_address_and_size handle it.
+
+1998-03-26 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * tracepoint.c: Include "ax.h", not "agentexpr.h".
+
+ * tracepoint.c (encode_actions): Call expr_to_address_and_size,
+ not simply expr_to_agent.
+
+ * ax-general.c: Comment out code in progress, so everyone else can
+ at least compile.
+
+ * gdbtypes.c: Doc fix.
+
+ * ax.h, ax-gdb.h, ax-general.c, ax-gdb.c: New files.
+ * Makefile.in (REMOTE_OBJS): Add ax-general.o and ax-gdb.o.
+ (SFILES): Add ax-general.c, ax-gdb.c.
+ (ax_h): New variable.
+ (ax-general.o, ax-gdb.o): New rules.
+
+
+Tue Mar 24 16:22:40 1998 Stu Grossman <grossman@bhuna.cygnus.co.uk>
+
+ * Makefile.in: Derive SHELL from configure.
+ * config/d10v/d10v.mt config/m32r/m32r.mt
+ config/mn10200/mn10200.mt config/mn10300/mn10300.mt
+ config/d30v/d30v.mt: Remove -lm from SIM. This prevents
+ dependency checking of -lm (under NT native builds). (It is
+ automatically added by configure if it exists.)
+ * doc/configure mswin/configure nlm/configure
+ testsuite/gdb.base/configure testsuite/gdb.c++/configure
+ testsuite/gdb.chill/configure testsuite/gdb.disasm/configure
+ testsuite/gdb.stabs/configure testsuite/gdb.threads/configure:
+ Regenerate with autoconf 2.12.1 to fix shell issues for NT native
+ builds.
+
+Mon Mar 23 18:10:57 1998 Ulrich Drepper (drepper@cygnus.com)
+
+ * solib.c (solib_create_inferior_hook): Rewrite previous
+ change to check the type of file via BFD.
+
+Mon Mar 23 13:52:28 1998 Ulrich Drepper (drepper@cygnus.com)
+
+ * breakpoint.c (breakpoint_re_set_one): Treat bp_shlib_events
+ like bp_breakpoints.
+ * solib.c (solib_create_inferior_hook): Relocate section addresses
+ if the alleged start address doesn't agree with the PC.
+
+Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ merged changes from Foundry (list follows by file/author):
+
+ - Tom Tromey <tromey@cygnus.com>
+ * Makefile.in (gdbres.o): New target.
+ (WINDRES): New define.
+ * configure: Rebuilt.
+ * configure.in (WINDRES): Define.
+ (CONFIG_OBS): Include gdbres.o on Windows.
+ * gdbtool.ico: New file.
+ * gdb.rc: New file.
+
+ * ser-unix.c
+ - Keith Seitz <keiths@onions.cygnus.com>
+ (wait_for): Don't reset the timeout_remaining for CYGWIN32,
+ since we now effectively poll the serial port.
+ Don't reset the current_timeout, either, since this member is used
+ by hardwire_readchar to track the timeout and call the ui_loop_hook.
+ (hardwire_readchar): Poll the serial port for Cygwin32. We timeout
+ every second, update the UI, and loop around doing this until we
+ have hit the real timeout or we get data or an error. This will
+ allow the UI to stay active while gdb is "blocked" talking to the
+ target.
+ - Martin M. Hunt <hunt@cygnus.com>
+ (wait_for): Do reset current_timeout because it is only used to
+ keep track of what the current timeout for the scb is.
+
+ * top.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ (quit_confirm): Change exit message again
+ for GUI.
+ (pc_changed_hook): Add prototype.
+ - Tom Tromey <tromey@cygnus.com>
+ (quit_confirm): Added missing `else'.
+ (quit_confirm): Special-case message if init_ui_hook is
+ set.
+
+ * symtab.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ (find_pc_sect_line): If no symbol information
+ is found, return correct pc anyway.
+ (find_methods): Comment out an apparently
+ bogus error message because it messes up Foundry.
+
+ * serial.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ (_initialize_serial): Add a description of
+ "set remotelogbase".
+
+ * findvar.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ (write_register_gen): Add call to
+ pc_changed_hook if the PC is being changed.
+
+ * defs.h
+ - Martin M. Hunt <hunt@cygnus.com>
+ (pc_changed_hook): Define.
+
+ * command.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ (do_setshow_command): If no arguments are supplied,
+ don't dump core, instead print out an error message.
+
+ * breakpoint.c
+ - Martin M. Hunt <hunt@cygnus.com>
+ Make set_raw_breakpoint, set_breakpoint_count,
+ and breakpoint_count non-static so they are accessible from
+ elsewhere.
+ (enable_breakpoint): Enable breakpoint
+ with same disposition instead of changing all breakpoints
+ to donttouch.
+
+ * annotate.h
+ - Keith Seitz <keiths@onions.cygnus.com>
+ Add declarations for annotation hooks.
+
+ * annotate.c
+ - Keith Seitz <keiths@onions.cygnus.com>
+ Add hooks: annotate_starting_hook, annotate_stopped_hook,
+ annotate_signalled_hook, annotate_exited_hook.
+ (annotate_starting): If hook exists, call it instead.
+ (annotate_stopped): If hook exists, call it instead.
+ (annotate_exited): If hook exists, call it instead.
+ (annotate_signalled): If hook exists, call it instead.
+
+Fri Mar 20 14:45:36 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * gdbserver/Makefile.in: add dependency on XM_CLIBS.
+ * gdbserver/low-sim.c (registers) force into alignment.
+ (create_inferior): Fix typo on new_argv; add abfd arg to
+ sim_open, sim_create_inferior. Add reg_size arg to
+ sim_fetch_register, sim_store_register. Make simulator
+ take a single-step to get into a known running state.
+ * gdbserver/gdbreplay.c: include fcntl.h for def'n of F_SETFL.
+ * gdbserver/server.c: Add remote_debug variable to control
+ debug output.
+ * gdbserver/server.h: Add prototypes for enable/disable_async_io.
+ * gdbserver/remote-utils.c: add verbose debugging output controlled
+ by "remote_debug" variable. Add call to "disable_async_io()"
+ to avoid being killed by async SIGIO signals.
+ * config/m32r/m32r.mt: define GDBSERVER_(LIBS and DEPFILES),
+ so that gdbserver can be built with the m32r simulator.
+
+Fri Mar 20 09:04:06 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbtypes.h (builtin_type_{,u}int{8,16,32,64}): New gdb builtin
+ types.
+
+ * gdbtypes.c (_initialize_gdbtypes): Initialize new types.
+
+ * mips-tdep.c (do_gp_register_row): Pad register value when GP
+ register is smaller than MIPS_REGSIZE.
+
+ * findvar.c (value_of_register): When raw and virtual register
+ values identical, check that sizes are consistent.
+
+Thu Mar 19 11:32:15 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * minsyms.c (compare_minimal_symbols): If addresses are identical,
+ then compare on names. Sorted list should have symbols with
+ identical addresses AND names adjacent, so dups can be discarded.
+
+Wed Mar 18 12:50:17 1998 Jeff Law (law@cygnus.com)
+
+ * stabsread.c (define_symbol): Don't look for ',' as a LRS
+ indicator.
+
+Wed Mar 18 10:34:51 1998 Nick Clifton <nickc@cygnus.com>
+
+ * rdi-share/etherdrv.c: Set sys_errlist[] as char * not const char *.
+
+Fri Mar 13 15:43:53 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/mips/xm-mips.h (CC_HAS_LONG_LONG): Undefine for Ultrix
+ when compiling with native cc, the compiler has broken long long
+ support.
+
+Fri Mar 13 15:37:02 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/m68k/xm-sun3os4.h: Remove malloc declarations, they
+ are handled via autoconf now.
+ * remote.c (remote_ops, extended_remote_ops): Replace static
+ forward declaration by moving the static definition to the top of
+ the file, for old K&R compilers.
+ * tracepoint.c (collect_symbol, trace_start_command):
+ Replace ANSI string concatenation with K&R compatible simple string.
+
+1998-03-11 Fred Fish <fnf@ninemoons.com>
+
+ * source.c (select_source_symtab): Don't reach error if we have
+ a current_source_symtab from reading in partial symbol table.
+
+Fri Mar 6 13:10:27 1998 Fred Fish <fnf@cygnus.com>
+
+ * utils.c (quit): Call SERIAL_DRAIN_OUTPUT rather than
+ SERIAL_FLUSH_OUTPUT.
+ * serial.h (struct serial_ops): Add drain_output, pointer to
+ function that waits for output to drain.
+ (SERIAL_DRAIN_OUTPUT): Macro to wait for output to drain.
+ * ser-unix.c (hardwire_drain_output): New function and prototype.
+
+ * ser-unix.c (hardwire_ops): Add entry for drain_output function.
+ * ser-tcp.c (tcp_ops): Ditto.
+ * ser-ocd.c (ocd_ops): Ditto.
+ * ser-mac.c (mac_ops): Ditto.
+ * ser-go32.c (dos_ops): Ditto.
+ * ser-e7kpc.c (e7000pc_ops): Ditto.
+
+Thu Mar 5 16:07:41 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * sparcl-tdep.c: fix #endif comments
+
+Thu Mar 5 15:10:35 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (BISON): Configure substitutes in @YACC@, not @BISON@.
+
+Thu Mar 5 14:42:41 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * ocd.c (ocd_open): If we fail ocd_start_remote, make sure we
+ error () so that we abort out of bdm_ppc_open.
+
+Wed Mar 4 16:53:52 1998 Martin M. Hunt <hunt@cygnus.com>
+
+ * serial.c (_initialize_serial): Add a description of
+ "set remotelogbase".
+
+ * command.c (do_setshow_command): If no arguments are supplied,
+ don't dump core, instead print out an error message.
+
+Wed Mar 4 01:39:08 1998 Ron Unrau <runrau@cygnus.com>
+
+ * elfread.c (elf_symtab_read): merge SYMBOL_IS_SPECIAL into
+ MAKE_MSYMBOL_SPECIAL
+ * config/mips/tm-mips.h: ditto
+
+Tue Mar 3 17:19:08 1998 John Metzler <jmetzler@cygnus.com>
+
+ * config/mips/tm-vr4xxx.h: implements vr4111 as separate from 4300
+ * config/mips/vr4xxx.tm: implements vr4111 as separate from 4300
+ * configure.tgt: Recognise mips64vr4111-*-elf as vr4xxx
+ * dwarfread.c (read_tag_pointer_type): Pointer sizes now come from
+ TARGET_PTR_BIT rather from sizeof(char *) on host.
+
+Tue Mar 3 14:37:02 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-nat.c (fetch_osf_core_registers): Renamed from
+ fetch_aout_core_registers.
+ (alpha_osf_core_fns): Renamed from alpha_aout_core_fns, change
+ flavour to bfd_target_unknown_flavour for OSF core files.
+
+Mon Mar 2 17:44:13 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * breakpoint.c (_initialize_breakpoint): Make "en" an alias
+ for "enable" (so that it doesn't conflict with "end").
+
+Mon Mar 2 17:04:25 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile (VERSION): Bump to 4.17.1.
+
+Mon Mar 2 16:59:15 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * rdi-share/etherdrv.c (sys_errlist): Add correct decl for Linux.
+
+Mon Mar 2 16:51:44 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (YYFILES): Remove in maintainer-clean, not distclean.
+
+Mon Mar 2 16:47:11 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * Makefile.in (distclean): Add `rm $(YYFILES)'.
+
+Mon Mar 2 16:45:48 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * coffread.c (coff_read_enum_type): Set TYPE_FLAG_UNSIGNED if enum
+ is unsigned.
+
+Sun Mar 2 15:16:13 1998 Richard Henderson <rth@cygnus.com>
+
+ * configure.host, configure.tgt: Add sparc-linux.
+ * sparc-nat.c: Include <asm/reg.h> not <machine/reg.h> for Linux.
+ * config/sparc/*linux*: New files.
+
+Mon Mar 2 12:12:41 1998 Anthony Thompson (athompso@cambridge.arm.com)
+
+ * arm-tdep.c (gdb_print_insn_arm): Call print_insn_big_arm
+ if we're big endian; else call print_insn_little_arm.
+
+Mon Feb 24 11:24:57 1998 Richard Henderson <rth@cygnus.com>
+
+ * Makefile.in (BISON): Don't even pretend to use yacc.
+ (c-exp.tab.o): Use bison -o to use a unique intermediate file.
+ (f-exp.tab.o, m2-exp.tab.o): Likewise.
+ (jv-exp.tab.o): Likewise.
+
+Tue Feb 24 03:32:59 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_fetch_register): Don't abort when the
+ register size is wrong.
+
+Thu Feb 19 16:49:48 1998 John Metzler <jmetzler@cygnus.com>
+
+ * target.c (debug_to_fetch_registers,debug_to_store_registers,
+ debug-to_insert_breakpoint,debug_to_remove_breakpoint): tracing
+ 64 bit targets crashed long long printfs.
+
+Tue Feb 17 16:36:22 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * symfile.c (read_target_int_array): rename read_target_long_array
+ and force the sizeof an ovly_table element to sizeof(long),
+ instead of sizeof(int).
+
+Tue Feb 17 18:05:05 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * remote-mips.c (mips_request): Use unsigned long during parsing
+ returned value from monitor, to prevent accidental sign extension.
+
+Tue Feb 17 14:28:33 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * acconfig.h: FORCE_MMCHECK changed to MMCHECK_FORCE.
+ * configure.in: Ditto.
+ * configure: Regenerated.
+
+Tue Feb 17 14:07:34 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * gdbtypes.c (check_typedef): Do not try to resolve the length of
+ a type which has TYPE_FLAG_TARGET_STUB set, if the target type has
+ set TYPE_FLAG_TARGET_STUB as well.
+
+Tue Feb 17 14:32:18 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
+ Pass register size to sim_{fetch,store}_register. Check nr of
+ register bytes transfered is correct.
+
+Mon Feb 16 14:05:54 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-d10v.c (remote_d10v_open): Call push_remote_target
+ instead of open_remote_target.
+
+ * remote.c (remote_xfer_memory): Use REMOTE_TRANSLATE_XFER_ADDRESS
+ to translate addr/size when defined.
+ (open_remote_target): Delete.
+
+ * target.h (open_remote_target): Delete.
+
+ * config/d10v/tm-d10v.h (REMOTE_TRANSLATE_XFER_ADDRESS): Define.
+
+Mon Feb 16 14:05:54 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_extract_return_value): Wierd. GCC wants to
+ return odd sized register quantities with only half of the first
+ register used!
+
+ * config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Use stack when
+ size > 8.
+
+Mon Feb 16 14:05:54 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Define. True when
+ sizeof type > 1.
+
+Sun Feb 15 16:10:50 1998 Ron Unrau <runrau@cygnus.com>
+
+ * parse.c (write_dollar_variable): call new function
+ target_map_name_to_register to allow targets to define their own
+ register name aliases.
+ * infcmd.c (registers_info): use target_map_name_to_register so that
+ "print $reg" and "info reg $reg" use the same register name aliases.
+
+Fri Feb 13 16:40:30 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/i386/i386mk.mt (OBJFORMATS): Delete, no longer used.
+ * config/i386/xm-i386mk.h: Fix an include.
+ * config/pyr/tm-pyr.h (PC_INNER_THAN): Remove, never used.
+
+Thu Feb 12 16:12:07 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * remote-mips.c (mips_enter_debug): Sleep before sending CR to
+ monitor.
+ (mips_exit_debug): Accept any whitespace / verbiage before monitor
+ prompt reappears.
+
+Thu Feb 12 18:25:42 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (show_regs): Avoid use of %llx when printing 8 byte
+ accumulators.
+
+Thu Feb 12 17:10:22 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (value_at): For d10v, make read pointers with
+ read_target_unsigned_integer, keep addresses unsigned.
+ (value_fetch_lazy): Ditto.
+
+Thu Feb 12 12:14:02 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-d10v.c: New file. Layer the d10v GDB->remote memory map
+ on top of the remote serial memory transfer functions.
+
+ * config/d10v/d10v.mt (TDEPFILES): Add remote-d10v.o
+
+ * Makefile.in (remote-d10v.o): Add dependencies.
+
+ * remote.c (remote_open_1): Add arg extended_p, engage extended
+ protocol when extended_p.
+ (remote_open, extended_remote_open): Pass !extended_p /
+ extended_p to remote_open_1.
+
+ * remote.c (open_remote_target), target.h: New function.
+
+Wed Feb 11 08:41:15 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/i386/fbsd.mh (XDEPFILES): Add ser-tcp.o.
+
+Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * tracepoint.c (tracepoint_operation): Call the modify_tracepoint_hook
+ if it exists.
+ Remove static declaration of free_actions.
+
+ * tracepoint.h: Add declaration of free_actions.
+
+Tue Feb 10 12:17:13 1998 Fred Fish <fnf@cygnus.com>
+
+ * symtab.c (decode_line_1): Revert change that mistakenly
+ removed assignment of sals[0].pc field.
+
+Mon Feb 10 12:37:47 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * m68k/tm-delta68.h (EXTRACT_RETURN_VALUE): Type argument for
+ `REGISTER_CONVERT_TO_VIRTUAL is `TYPE', not
+ `REGISTER_VIRTUAL_TYPE (FP0_REGNUM)';
+ (STORE_RETURN_VALUE): Ditto, and offset for `write_register_bytes'
+ is `REGISTER_BYTE (FP0_REGNUM)', not `FP0_REGNUM'.
+ (FRAME_NUM_ARGS): New macro.
+ * m68k/tm-news.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Ditto.
+ * delta68-nat.c (clear_insn_cache): New function, forgotten in previous
+ patch.
+
+Mon Feb 9 11:10:06 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c: Replace references to IMEM_ADDR and DMEM_ADDR with
+ D10V_MAKE_[DI]ADDR and D10V_CONVERT_[ID]ADDR_TO_RAW macros.
+
+ * config/d10v/tm-d10v.h (IMEM_START): Move to 0x01......
+ (DMEM_START): Move to 0x00......
+ (STACK_START): Move to 0x00..7ffe.
+ (D10V_MAKE_IADDR, D10V_MAKE_DADDR): Translate unconditionally.
+
+ * d10v-tdep.c (d10v_xlate_addr): Delete function.
+
+Mon Feb 9 15:10:21 1998 Fred Fish <fnf@cygnus.com>
+
+ * symtab.c (fixup_psymbol_section): Move forward declaration to
+ top of file with other such decls. Make it a static function.
+ * symtab.h: Minor formatting tweaks.
+
+Mon Feb 9 13:14:12 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/a29k-udi.mt, config/i960/vxworks960.mt (REMOTE_OBS):
+ Remove redefinition.
+ * config/i960/tm-i960.h (BREAKPOINT): Define.
+
+Mon Feb 9 15:35:38 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (init.c): Ignore errors when making init.c. Seems
+ necessary to work around bug in Solaris make.
+
+Sun Feb 6 02:44:28 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined.
+ (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Macros modified
+ because floating-point values return via %fp0.
+ (CLEAR_INSN_CACHE): New macro.
+ * m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL): Macro fixed
+ to use DOUBLEST.
+ (REGISTER_CONVERT_TO_RAW): Ditto.
+ * infptrace.c (child_xfer_memory): If CLEAR_INSN_CACHE is defined,
+ call it after having written in child process's memory.
+ * inflow.c (PROCESS_GROUP_TYPE): Macro defined if HAVE_TERMIO.
+ (gdb_has_a_terminal, terminal_ours_1): Functions fixed for HAVE_TERMIO.
+
+Fri Feb 6 16:17:30 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/mips/tm-mips64.h (TARGET_LONG_BIT): Allow final target to
+ override.
+ (TARGET_LONG_LONG_BIT): Likewise.
+ (TARGET_PTR_BIT): Likewise.
+
+Fri Feb 6 17:42:22 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (D10V_CONVERT_IADDR_TO_RAW,
+ D10V_CONVERT_DADDR_TO_RAW): Define.
+
+ * d10v-tdep.c (d10v_push_arguments): Re-write. Pass arguments in
+ registers, regardless of their size, when they fit.
+
+Thu Feb 5 13:16:36 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_extract_return_value): For function pointers
+ translate address to IMAP area.
+
+ * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Delete dummy from
+ struct.
+ (POP_FRAME): Point at generic_pop_current_frame.
+
+ * d10v-tdep.c (d10v_pop_frame): Delete code handling dummy frames,
+ handled earlier.
+ (d10v_push_return_address): New function.
+ (d10v_pop_dummy_frame): Delete.
+ (d10v_fix_call_dummy): Delete.
+ (d10v_call_dummy_address): Delete.
+
+ * d10v-tdep.c (d10v_init_extra_frame_info): Clear dummy and
+ frameless.
+
+ * d10v-tdep.c (d10v_push_arguments): Keep stack word aligned.
+
+ * config/d10v/tm-d10v.h (EXTRACT_STRUCT_VALUE_ADDRESS): Extract
+ address of structure from first ARG1_REGNUM.
+
+ * d10v-tdep.c (d10v_push_arguments): Force 4 byte args into
+ even-odd register pair. Store 1 and 2 byte args in registers.
+
+ * valops.c (value_fetch_lazy): Ensure that a D10V function pointer
+ is fetched in the correct byte order.
+ (value_at): Ditto. Also ensure data pointers are mapped to data
+ segment.
+
+ * config/d10v/tm-d10v.h (D10V_DADDR_P, D10V_IADDR_P):
+
+ * d10v-tdep.c: Replace 2 with REGISTER_RAW_SIZE.
+ (d10v_pop_frame): Replace R13 with LR_REGNUM.
+ (d10v_push_arguments): Replace R2 with ARG1_REGNUM.
+ (d10v_push_arguments): Replace 6 with ARGN_REGNUM.
+ (d10v_extract_return_value): Access return value with RET1_REGNUM.
+
+ * config/d10v/tm-d10v.h (ARG1_REGNUM, ARGN_REGNUM, RET1_REGNUM):
+ Define.
+ (STORE_RETURN_VALUE): Specify return register using RET1_REGNUM.
+ (STORE_STRUCT_RETURN): Specify ARG1_REGNUM as the struct ptr
+ location.
+
+Thu Feb 5 13:16:36 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (generic_pop_dummy_frame): Flush the frame, no
+ longer valid.
+
+ * blockframe.c (generic_pop_current_frame), frames.h: New
+ function.
+
+Thu Feb 5 17:18:16 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdbsim_create_inferior): clear_proceed_status
+ before /re/starting the simulator.
+
+Thu Feb 5 15:55:31 1998 C. M. Heard (heard@vvnet.com)
+
+ * top.c (do_nothing): Remove signal handler after signal is caught.
+
+Thu Feb 5 11:57:06 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (tracepoint_operation): call free_actions instead
+ of free. (free_actions): eliminate some memory leaks for actions.
+ (validate_actionline): pass string arg by reference, so we can
+ change the pointer. Change all memrange collection arguments to
+ canonical form (literal address and size), to enforce early
+ evaluation. Accept UNOP_MEMVAL (assembly variables) for
+ trace collection. (parse_and_eval_memrange): accept expressions
+ for the address and size fields of a memrange (and evaluate
+ them immediately). (several places): use -1 instead of zero
+ to distinguish an absolute memrange from a register-relative one.
+ (encode_actions): add handling for UNOP_MEMVAL (assembly variable).
+
+Wed Feb 4 17:40:21 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (SFILES): add tracepoint.c.
+ (LINTFILES): add @CONFIG_SRCS@.
+ (SOURCES): Ditto.
+ * configure.in (CONFIG_SRCS): Mirror use of CONFIG_OBS.
+ * configure: Regenerated.
+
+Tue Feb 3 16:12:32 1998 Gordon W. Ross (gwr@mc.com)
+
+ * infptrace.c (child_resume): Don't try to step if
+ NO_SINGLE_STEP is defined.
+
+Mon Feb 2 19:06:13 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * Makefile.in (VERSION): Bump to 4.16.2.
+
+Mon Feb 2 17:18:25 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha-nat.c (fetch_aout_core_registers): Rename from
+ fetch_core_registers.
+ (fetch_elf_core_registers): New function.
+ (supply_gregset): Use ALPHA_REGSET_BASE.
+ (supply_fpregset): Likewise.
+ (fill_fpregset): Likewise.
+ (alpha_aout_core_fns): Rename from alpha_core_fns.
+ (alpha_elf_core_fns): New.
+ * config/alpha/alpha-linux.mh (NATDEPFILES): solib.o not osfsolib.o.
+ Disable MMALLOC.
+ * config/alpha/nm-linux.h (SVR4_SHARED_LIBS): Define if ELF.
+ (TARGET_ELF64): Likewise.
+ (ALPHA_REGSET_BASE): New.
+ * config/alpha/nm-osf.h (ALPHA_REGSET_BASE): New.
+ * config/alpha/tm-alphalinux.h: Include tm-sysv4.h.
+
+ * solib.c (elf_locate_base): Add TARGET_ELF64 support.
+ (info_sharedlibary_command): Likewise.
+
+ * configure.host: Match alpha*.
+ * configure.tgt: Likewise.
+
+Fri Jan 30 15:11:38 1998 David Taylor <taylor@texas.cygnus.com>
+
+ Changes by <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+ * infrun.c (IN_SOLIB_DYNSYM_RESOLVE_CODE): new macro for detecting
+ whether we are in the dynamic symbol resolution code
+ (wait_for_inferior): invoke it.
+ * solib.c (in_svr4_dynsym_resolve_code): new function
+ (enable_break): record start and end of the dynamic linker
+ text and plt sections for use in in_svr4_dynsym_resolve_code.
+ * solib.h (IN_SOLIB_DYNSYM_RESOLVE_CODE): add svr4 definition;
+ (in_svr4_dynsym_resolve_code): declare it.
+ * config/nm-gnu.h (solib.h): move inclusion to after definition
+ of SVR4_SHARED_LIBS.
+ * config/nm-sysv4.h (solib.h): ditto.
+ * config/i386/nm-i386sco5.h (solib.h): ditto.
+ * config/i386/nm-linux.h (solib.h): ditto.
+ * config/mips/nm-irix5.h (IN_SOLIB_DYNSYM_RESOLVE_CODE): undefine.
+
+Thu Jan 29 19:39:31 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * coffread.c (coff_symtab_read) [SEM]: Remove code, macro can
+ never be defined.
+ * dbxread.c (process_one_symbol) [BLOCK_ADDRESS_ABSOLUTE]:
+ Remove, no longer needed.
+ * hppa-tdep.c (N_SET_MAGIC): Remove, no longer used.
+ * config/pa/xm-hppab.h (SEEK_SET, SEEK_CUR, SEEK_END): Ditto.
+ * config/mips/tm-mipsm3.h (NUMERIC_REG_NAMES): Ditto.
+ * config/mips/mipsm3.mt (TDEPFILES): Remove mipsread.o.
+
+Wed Jan 28 14:46:52 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ Suggested by Chris Walter <walter@budoe.bu.edu>:
+ * dwarfread.c (set_cu_language): Recognize Fortran.
+ * dwarf2read.c (set_cu_language): Ditto.
+ (read_array_type): Fix language test.
+
+Wed Jan 28 12:51:08 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * blockframe.c (generic_frame_chain_valid): A frame pointer may
+ be valid if it is equal to the frame pointer of its caller (ie.
+ not necessarily strictly INNER_THAN). Allows frameless functions.
+
+Wed Jan 28 11:23:25 1998 Mark Alexander <marka@cygnus.com>
+
+ * monitor.c (monitor_vsprintf): New function to handle
+ printing of large addresses using %A format specifier.
+ (monitor_printf_noecho, monitor_printf): Use monitor_vsprintf
+ instead of vsprintf.
+ * dve3900-rom.c (_initialize_r3900_rom): Use %A instead of %Lx
+ to print addresses.
+
+Tue Jan 27 16:14:23 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in (CONFIG_LDFLAGS): Only add -export-dynamic
+ when using GNU ld.
+
+Mon Jan 26 19:07:46 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * config/alpha/tm-alphalinux.h (alpha_linux_sigtramp_offset):
+ Add closing parenthesis. From HJ Lu.
+
+Mon Jan 26 17:54:45 1998 Mark Alexander <marka@cygnus.com>
+
+ * dve3900-rom.c: Improve performance by using memory commands
+ that print less fluff. Minor cosmetic changes.
+ Eliminate compiler warnings.
+
+Sat Jan 24 23:44:43 1998 Martin M. Hunt <hunt@cygnus.com>
+
+ * breakpoint.c (enable_breakpoint): Preserve breakpoint
+ disposition when enabling a breakpoint.
+
+ * symtab.c (find_pc_sect_line): If no symbol information
+ is found, return correct pc anyway.
+
+Fri Jan 23 17:26:22 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.host (i[3456]86-*-osf1mk*, mips-*-mach3*,
+ ns32k-*-mach3*): Fix file names.
+ (i[3456]86-*-os9k, m88*-*-mach3*, w65-*-*): Remove config
+ recognition, no source files for these.
+ * configure.tgt (powerpc-*-aix4*): Remove config, now identical
+ to powerpc-*-aix*.
+ * config/powerpc/{aix4.mh,aix4.mt,tm-ppc-aix4.h}: Remove files,
+ no longer needed.
+
+Fri Jan 23 16:49:41 1998 Mark Alexander <marka@cygnus.com>
+
+ * monitor.c (monitor_write, monitor_readchar): New functions.
+ * monitor.h (monitor_write, monitor_readchar): Declare.
+ * dve3900-rom.c: Add support for fast loading on ethernet connections.
+
+Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com>
+
+ * config/d10v/tm-d10v.h (CALL_DUMMY): Define as "{ 0 }".
+ (TARGET_READ_FP): Define to d10v_read_fp rather than d10v_read_sp.
+ (TARGET_WRITE_FP): Define to d10v_write_fp rather than d10v_write_sp.
+ (d10v_write_fp, d10v_read_fp): Add prototypes.
+ * symtab.c (decode_line_1): Remove assignment of sals[0].pc field.
+ * symfile.c (simple_overlay_update, simple_overlay_update_1):
+ Ignore the size of overlay sections. This check is redundant anyway.
+ * printcmd.c (print_frame_args): Ditto.
+ * valops.c (value_fetch_lazy): Ditto.
+ * values.c (unpack_long): Ditto.
+ * d10v-tdep.c (d10v_frame_chain, d10v_frame_find_saved_regs,
+ d10v_init_extra_frame_info): Fix some minor bugs so the finish command
+ works properly.
+ (show_regs): Change num1 and num2 types from "long long" to "LONGEST".
+ (d10v_read_fp, d10v_write_fp): New functions.
+ (d10v_push_arguments): Remove unneeded assigns to "val" and "contents".
+ (d10v_push_arguments): Fix for pointers and structs.
+ (d10v_extract_return_value): Fix for pointers and chars.
+
+Tue Jan 20 18:53:18 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (i386-*-mach*, m88*-*-mach3*): Remove config
+ recognition, no source files for these (note that the i386 Mach
+ config is for pre-Mach 3).
+ (mips*-*-mach3*, ns32k-*-mach3*): Fix file names.
+ * config/mips/mipsel64.mt: Remove, never referenced.
+
+Mon Jan 19 14:01:28 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.c (print_gdb_version): Restore to original message.
+
+Mon Jan 19 13:34:40 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ From cgf@bbc.com (Chris Faylor):
+ * win32-nat.c (child_mourn_inferior): Call ContinueDebugEvent to
+ let the child exit.
+ (child_kill_inferior): Respond to all debug events as the child is
+ terminating.
+
+ * Makefile.in (all): Change gdb dependency to gdb$(EXEEXT).
+ (uninstall): Add $(EXEEXT) to file name to remove.
+ (gdb$(EXEEXT)): Rename target from plain gdb.
+ (gdb1$(EXEEXT)): Rename target from plain gdb1.
+ (clean, mostlyclean): Add $(EXEEXT) to binary names to remove.
+
+1998-01-16 Felix Lee <flee@cygnus.com>
+
+ * top.c (print_gdb_version): delete stutter.
+
+Thu Jan 15 12:29:13 1998 Nick Clifton <nickc@cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): Patch from Tony.Thompson@arm.com
+ to prevent spurous error messages on non-ICE targets.
+
+Wed Jan 14 19:27:02 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/mips/{r3900.mt,r3900l.mt,tm-r3900.h,tm-r3900l.h}:
+ Remove, no longer used.
+
+Wed Jan 14 18:11:26 1998 Michael Meissner <meissner@cygnus.com>
+
+ Patch from Jim Wilson.
+ * d30v-tdep.c (d30v_frame_find_saved_regs_offsets): Properly
+ declare void function before use.
+
+ * config/d30v/tm-d30v.h (CALL_DUMMY): Initialize as { 0 }, not {}.
+
+Tue Jan 13 16:38:48 1998 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (--with-mmalloc): Add new configure arg to use the
+ mmalloc package. Default is to not use it.
+ (START_INFERIOR_TRAPS_EXPECTED): Define to the integer 2, not
+ the string "2".
+ * acconfig.h (USE_MMALLOC, FORCE_MMCHECK): Add #undef.
+ * configure: Regenerated.
+ * config.in: Regenerated.
+ * Makefile.in (MMALLOC_DIR, MMALLOC_SRC): Remove.
+ (MMALLOC): Set using configure.
+ (MMALLOC_CFLAGS): Set using configure.
+
+ * config/i386/tm-linux.h (sys_quotactl): Define to 1 rather
+ than just defining it.
+ * mpw-make.sed: Undefine USE_MMALLOC rather than defining NO_MMALLOC.
+ * utils.c (NO_MMALLOC): Use USE_MMALLOC instead.
+ * objfiles.c: ditto.
+ * defs.h: ditto.
+
+ * config/sparc/sun4os4.mh (MMALLOC_CFLAGS): Remove.
+ * config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Remove.
+ * config/i386/cygwin32.mh (MMALLOC_CFLAGS): Remove.
+ * config/alpha/alpha-osf3.mh (MMALLOC_CFLAGS): Remove.
+ * config/alpha/alpha-osf2.mh (MMALLOC_CFLAGS): Remove.
+ * gdbserver/Makefile.in (MMALLOC_*): Remove.
+ * config/rs6000/rs6000.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/rs6000/aix4.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/powerpc/aix4.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/powerpc/aix.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/ns32k/ns32km3.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/mips/mipsm3.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/mips/decstation.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/m88k/cxux.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/i386/xm-windows.h (NO_MMALLOC, NO_MMCHECK): Remove.
+ * config/i386/i386mk.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/i386/i386m3.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/i386/i386gnu.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/alpha/alpha-osf1.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+ * config/alpha/alpha-linux.mh (MMALLOC, MMALLOC_CFLAGS): Remove.
+
+Mon Jan 12 11:46:51 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * config/m68k/tm-m68k.h (REGISTER_VIRTUAL_TYPE): make A0 thru A7
+ default to void pointer type (so that their default radix is hex).
+
+ * symtab.c: move rbreak_command from no_class to class_breakpoint
+ so it will be listed under "help breakpoints".
+
+Sat Jan 10 14:58:04 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * rdi-share/hostchan.c: Remove gettimeofday declaration.
+
+Thu Jan 8 11:03:59 1998 Nick Clifton <nickc@cygnus.com>
+
+ * remote-rdp.c: Applied patches submitted by Tony.Thompson@arm.com
+ to implement the Angel remote debugging interface.
+
+ * Makefile.in: Add build rules for remote-rdi.c and
+ rdi-share/libangsd.a.
+
+ * configure.tgt: Updated from source on branch.
+ * config/arm/tm-arm.h: Updated from source on branch.
+ * arm-tdep.c: Updated from source on branch.
+
+ * rdi-share: New directory, RDI library contributed by ARM.
+
+Mon Jan 5 20:21:59 1998 Mark Alexander <marka@cygnus.com>
+
+ * monitor.h (MO_PRINT_PROGRAM_OUTPUT): Define.
+ * monitor.c (monitor_wait): Echo program output.
+ * dve3900-rom.c (_initialize_r3900_rom): Remove MO_HANDLE_NL flag,
+ add MO_PRINT_PROGRAM_OUTPUT flag.
+
+Mon Jan 5 18:21:11 1998 David Taylor <taylor@texas.cygnus.com>
+
+ * top.h (HAVE_SIGSETJMP): define SIGJMP_BUF, SIGSETJMP, and
+ SIGLONGJMP appropriately based on whether HAVE_SIGSETJMP is
+ defined.
+ * top.c (return_to_top_level, catch_errors): use the new macros
+ * main.c (SET_TOP_LEVEL): ditto.
+ * config/xm-sysv4.h (HAVE_SIGSETJMP): Define.
+
+Fri Jan 2 18:48:58 1998 Mark Alexander <marka@cygnus.com>
+
+ * configure.in: Double up brackets in shell case pattern.
+
+Fri Jan 2 17:06:05 1998 Michael Snyder (msnyder@cleaver.cygnus.com)
+
+ * tracepoint.c (finish_tfind_command): improved algorithm for
+ deciding when we've "stepped" into a new stack frame.
+ (map_args_over_tracepoints): loop over tracepoint list "safely",
+ since list elements may be deleted during loop.
+ (read_actions): add actions to history list.
+
+For older changes see ChangeLog-1997
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-1999 b/contrib/gdb/gdb/ChangeLog-1999
new file mode 100644
index 0000000..8ed0612
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-1999
@@ -0,0 +1,9296 @@
+Sun Dec 19 18:56:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (mention): Delete ui-out breakpoint code. Mention
+ calls breakpoint_create_event and that, eventually, calls
+ gdb_breakpoint_query which displays the breakpoint details.
+ (hbreak_command_wrapper, thbreak_command_wrapper): Delete.
+
+Wed Dec 29 17:41:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (create_breakpoints, parse_breapoint_sals,
+ breakpoint_sals_to_pc): New functions.
+ (break_command_1): Rewrite. Use create_breakpoints,
+ parse_breapoint_sals, breakpoint_sals_to_pcto create the list of
+ breakpoints specified in ``sals''. Delete unused variables.
+ Pre-allocate addr_strings for all breakpoints. Allocate a
+ separate cond and cond_string for each breakpoint.
+ (gdb_breakpoint, do_captured_breakpoint, struct
+ captured_breakpoint_args): Provide a library interface into
+ create_breakpoints.
+
+ * defs.h (gdb_breakpoint): Add declaration.
+
+1999-12-22 Michael Chastain <chastain@cygnus.com>
+
+ * dbxread.c (process_one_symbol): check for nested LBRAC
+ symbols before calling finish_block rather than after. Do not
+ call define_symbol for these symbols.
+
+1999-12-21 Stan Shebs <shebs@andros.cygnus.com>
+
+ * blockframe.c (generic_pop_current_frame): Cosmetic changes to
+ clarify.
+
+1999-12-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * procfs.c: Completely rewritten. All functions replaced, to make
+ maintainence easier in the presence of two very different versions
+ of /proc (ioctl vs. read/write).
+ * proc_api.c: New file, pretty-print /proc diagnostic trace info.
+ * proc_events.c: New file, pretty-print /proc signals, exceptions.
+ * proc_flags.c: New file, pretty-print /proc flags.
+ * proc_why.c: New file, pretty-print /proc reasons for stopping.
+ * Makefile.in: Add rules for above new files.
+ * config/i386/i386sol2.mh: Add above new files to NATDEPFILES.
+ * config/sparc/sun4sol2.mh: ditto.
+ * config/i386/i386dgux.mh: ditto.
+ * config/i386/i386v4.mh: ditto.
+ * config/i386/i386v42mp.mh: ditto.
+ * config/i386/ncr3000.mh: ditto.
+ * config/m68k/m68kv4.mh: ditto.
+ * config/m88k/delta88v4.mh: ditto.
+ * config/mips/irix4.mh: ditto.
+ * config/mips/irix5.mh: ditto.
+ * config/mips/mipsv4.mh: ditto.
+ * config/powerpc/solaris.mh: ditto.
+ * config/alpha/alpha-osf2.mh: ditto.
+ * config/alpha/alpha-osf3.mh: ditto.
+ * testsuite/gdb.base/callfuncs.exp: make "next" test match the
+ next source line, in case the "next" runs away.
+ * acconfig.h: remove obsolete def HAVE_MULTIPLE_PROC_FDS,
+ add new def NEW_PROC_API
+ * config.in; ditto.
+ * configure.in: Detect sparc solaris 7 and all versions of
+ UnixWare, and define NEW_PROC_API.
+ * configure: auto-generate.
+ * infrun.c (MAY_SWITCH_FROM_INFERIOR_PID): remove define, make it
+ the default behavior. (switched_from_inferior_pid): rename to
+ previous_inferior_pid. (handle_inferior_event): remove the
+ [Switching to thread...] message. (normal_stop): move the
+ [Switching to thread...] message to here.
+ * sol-thread.c (sol_find_new_threads): add a call to
+ procfs_find_new_threads, so that new LWPs are found too.
+ * config/mips/nm-irix5.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT):
+ define to always use. (target_insert_watchpoint) define to use
+ new procfs call (one additional parameter).
+ (target_remove_watchpoint): ditto.
+ (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) define always true.
+ * config/mips/nm-irix4.h: ditto.
+
+1999-12-21 Jim Blandy <jimb@cygnus.com>
+
+ * Makefile.in (elf_bfd_h): Look for elf-bfd.h in BFD_SRC, not
+ BFD_DIR. Unlike bfd.h, it is not a generated file.
+
+Fri Dec 17 18:24:58 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * language.c (_initialize_language): move settings of language,
+ range, and type and corresponding function calls
+ set_language_command, set_type_command, and set_range_command
+ closer together to match the model of having the user set the
+ variable via the 'set {language | range | type}' commands.
+ This eliminates startup noise introduced by Jimmy Guo's change
+ of Dec 13th.
+
+1999-12-17 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * configure.in: test for <stdint.h>, which is not available
+ on earlier versions of Linux.
+ * config.in: define HAVE_STDINT_H if it's present.
+ * configure: autoconfiscate.
+ * lin-thread.c: if not HAVE_STDINT_H, stub out the entire module.
+
+Fri Dec 17 20:45:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.c (find_target_beneath): Change ``='' in if to ``==''.
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * defs.h (TIDGET): add default definition.
+ * lin-thread.c (check_for_thread_event): for now, just provide
+ an empty definition (to be filled in later).
+
+1999-12-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_list): Improve the test and the text of the
+ assertion that guards against wrong tally of root varobjs.
+ (uninstall_variable): Fix for a bug in which the number of root
+ varobjs was not decremented if the first one in the list was deleted.
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * linux-thread.c: Remove printf-debugging code.
+ * lin-thread.c: ditto.
+ * config/alpha/nm-linux.h: protect with NM_LINUX_H.
+ * testsuite/gdb.threads/linux-dp.exp: Make test for "New Thread"
+ message more forgiving. Ditto test for "info threads".
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * lin-thread.c: new file. Implements multi-thread debugging on
+ Linux using the thread_db API first implemented on Solaris. This
+ frees GDB from any dependency on the internal implementation of
+ the thread library. Future versions of the thread library will
+ implement a libthread_db API for debuggers, which GDB will use.
+ * config/i386/linux.mh: add lin-thread.o to the link, and add
+ -ldl and -rdynamic since libthread_db is a dynamic library.
+ * config/alpha/alpha-linux.mh: ditto.
+ * configure.in: test for thread_db.h, proc_service.h
+ * configure: autoconf.
+ * config.in: conditionally define HAVE_THREAD_DB_H
+ and HAVE_PROC_SERVICE_H
+ * gdb_thread_db.h: new file, used when the system doesn't have it.
+ * gdb_proc_service.h: ditto.
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * linux-thread.c: changes to accomodate the new lin-thread.c
+ module based on the thread_db API. These changes make parts of
+ linux-thread.c shareable with lin-thread.c.
+ (linuxthreads_wait_mask): replace with linuxthreads_block_mask.
+ (using_thread_db): new variable. Allows linux-thread module to
+ detect when lin-thread (thread_db API) module is in use.
+ (save_inferior_pid, restore_inferior_pid): make 32/64 bit safe.
+ (check_all_signal_numbers) make extern, shared with lin-thead.c.
+ (linuxthreads_new_objfile): use target_new_objfile_chain to share
+ this hook with the lin-thread module. Call the other module FIRST.
+ If using_thread_db is turned on by the other thread module, do not
+ set linuxthreads_debug and do not call update_stop_threads. Do call
+ check_all_signal_numbers, to be sure it gets set before target_wait.
+ (linux_child_wait): new function. Abstracts out the "child_wait"
+ functionality, so that it can be shared with the lin-thread module.
+ (linuxthreads_wait): call linux_child_wait, instead of doing the
+ waiting inline. If using_thread_db, do not call update_stop_threads
+ and do not turn on linuxthreads_debug.
+ (linuxthreads_mourn_inferior): abstract out the clearing of global
+ state, so that it can be shared with the lin-thread.c module.
+ (_initialize_linuxthreads): use linuxthreads_wait_mask to block
+ SIGCHLD exactly ONCE, and leave it blocked! Then linux_child_wait
+ will call sigsuspend when it wants to wait for this signal.
+ (thread_attach): abstract out ptrace attach to share with lin-thread.c
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ Make target_pid_to_str a target_ops vector.
+ * target.h (target_pid_to_str): redefine to use a target_ops vector.
+ (target_tid_to_str): default to using target_pid_to_str.
+ (target_pid_or_tid_to_str): ditto.
+ * target.c (update_current_target): inherit to_pid_to_str method.
+ (find_target_beneath): new function. Find target stratum below
+ the given one.
+ * config/nm-gnu.h: don't define target_pid_to_str.
+ * config/i386/tm-i386sol2.h: ditto.
+ * config/sparc/tm-sun4sol2.h: ditto.
+ * gnu-nat.c (init_gnu_ops): initialize to_pid_to_str vector.
+ * linux-thread.c (init_linuxthreads_ops): ditto.
+ * sol-thread.c (init_sol_thread_ops: ditto.
+ * procfs.c (init_procfs_ops): ditto.
+ * win32-nat.c (init_child_ops): ditto.
+ * config/i386/tm-cygwin.h: don't define target_pid_to_str.
+ * inftarg.c (child_pid_to_str): new function, used to initialize
+ to_pid_to_str vector. May be suppressed by defining CHILD_PID_TO_STR.
+ (init_child_ops): initialize to_pid_to_str using child_pid_to_str.
+ Derivative modules may substitute their own child_pid_to_str func
+ by defining CHILD_PID_TO_STR.
+ * lynx-nat.c (lynx_pid_to_str): rename to child_pid_to_str.
+ * config/nm-lynx.h: define CHILD_PID_TO_STR.
+ Don't define target_pid_to_str.
+ * hppah-nat.c (hppa_pid_to_str): rename to child_pid_to_str.
+ * infttrace.c (hppa_pid_or_tid_to_str): call child_pid_to str
+ instead of hppa_pid_to_str.
+ * config/pa/nm-hppah.h: define CHILD_PID_TO_STR.
+ Don't define target_pid_to_str.
+
+1999-12-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * i386-linux-nat.c: introduce PIDGET/TIDGET macros as on Solaris,
+ preparatory to using the thread_db debugging API for Linux.
+ (fill_gregset): guard against invalid input.
+ (fetch_regs): add a pid/thread_id argument, so we can fetch regs
+ from multiple processes/clones/threads. (store_regs): ditto.
+ (fetch_fpregs): ditto. (store_fpregs): ditto.
+ (fetch_xfpregs): ditto. (store_xfpregs): ditto.
+ (fetch_inferior_registers): use TIDGET to extract an appropriate
+ thread/clone/process id from inferior_pid, if there's one there,
+ and pass it to fetch_regs etc. (store_inferior_registers): ditto.
+
+ * infptrace.c: include every available version of wait.h.
+ introduce PIDGET/TIDGET macros for use with thread_db API on Linux.
+ (call_ptrace): rearrange lines that were split by an ifdef.
+ (fetch_register): use TIDGET to extract an appropriate process ID
+ from inferior_pid, in case we are debugging more than one process.
+ (store_register): ditto. This is for Linux.
+ (child_xfer_memory): use PIDGET to extract the main process id from
+ inferior_pid, in case we are debugging multiple processes that share
+ the same address space (as on Linux).
+
+1999-12-16 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Add a missing register to mappings array.
+ (child_fetch_inferior_registers): Use precalculated index into mappings
+ array as supply_registers argument.
+ (handle_output_debug_string): Avoid considering every debug string as a
+ cygwin signal.
+ (handle_exception): Trap first chance exceptions.
+ (child_create_inferior): Initialize Microsoft thread walking API.
+ (sgmb): New function. Used by Microsoft API for stack walking.
+ (child_frame_chain): New function. Uses Microsoft API for stack
+ walking.
+ (child_frame_chain_saved_pc): Ditto.
+ * config/i386/tm-cygwin.h: Define frame handling stuff.
+
+1999-12-15 Stan Shebs <shebs@andros.cygnus.com>
+
+ ARM GNU/Linux support and general ARM target fixes/cleanup from
+ Scott Bambrough <scottb@netwinder.org>, plus obsoletion of the old
+ RISCix support.
+ * NEWS: Mention addition and obsoletion.
+ * configure.host: Recognize arm* instead of just arm.
+ (arm*-*-linux*): Recognize.
+ * configure.tgt: Ditto, plus assume arm*-*-* is embedded.
+ * config/arm/arm.mh, config/arm/arm.mt, config/arm/nm-arm.h,
+ config/arm/xm-arm.h: Mark as OBSOLETE.
+ * config/arm/embed.mt, config/arm/tm-embed.h: New files.
+ * config/arm/linux.mh, config/arm/linux.mt, config/arm/nm-linux.h,
+ config/arm/tm-linux.h, config/arm/xm-linux.h: Ditto.
+ * config/arm/tm-arm.h: Add more comments, eliminate PARAMS.
+ (STACK_END_ADDR): Remove.
+ (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT, THUMB_LE_BREAKPOINT,
+ THUMB_BE_BREAKPOINT): Move to here from arm-tdep.c.
+ (NUM_REGS): Define as sum.
+ (NUM_FREGS, NUM_SREGS, NUM_GREGS): New definitions.
+ (FP_REGISTER_RAW_SIZE, FP_REGISTER_VIRTUAL_SIZE,
+ STATUS_REGISTER_SIZE): Define.
+ (REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE): Rewrite to use symbolic values.
+ (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW, USE_STRUCT_CONVENTION,
+ EXTRACT_RETURN_VALUE): Rewrite to use new functions.
+ (IN_SIGTRAMP): Remove definition.
+ * arm-convert.s: Mark as OBSOLETE.
+ * arm-linux-nat.c: New file.
+ * Makefile.in: Add build rule for it.
+ * arm-tdep.c (struct frame_extra_info): New struct.
+ (arm_use_struct_convention): Rewrite.
+ (arm_push_arguments): Rewrite to handle more cases.
+ (arm_register_convertible, arm_register_convert_to_virtual,
+ arm_register_convert_to_raw, arm_extract_return_value): New
+ functions.
+ (LITTLE_BREAKPOINT, BIG_BREAKPOINT): Remove.
+ * arm-xdep.c: Mark as OBSOLETE.
+
+1999-12-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (run_stack_dummy): Temporarily lie about the target
+ ability to support asynchronous execution.
+
+ * remote.c (remote_can_async_p, remote_is_async_p): Return true
+ iff to_async_mask_value is true too.
+ (remote_async): Error out if called when to_async_mask_value is 0.
+ (init_remote_async_ops): Initialize to_async_mask_value to 1.
+ (remote_async_detach, remote_async_resume, remote_async_wait,
+ remote_async_kill): Change SERIAL_IS_ASYNC_P call to
+ target_is_async_p call.
+ (remote_async_resume): Change SERIAL_CAN_ASYNC_P call to
+ target_can_async_p call.
+
+ * target.c (update_current_target): Inherit to_async_mask_value.
+ (target_async_mask): New function. To temporarily turn the target
+ into a synchronous one for inferior function calls, and back to
+ asynchronous.
+
+ * target.h (to_async_mask_value): New entry in the target
+ vector.
+ (target_async_mask): Export.
+ (target_async_mask_value): Define.
+
+Wed Dec 15 11:24:32 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hp-psymtab-read.c (trans_lang): Use HP_LANGUAGE_FORTRAN instead
+ of HP_LANGUAGE_F77.
+
+Wed Dec 15 13:37:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb-events.h, gdb-events.c (set_gdb_event_hooks): Return the old
+ event hooks vector.
+
+1999-08-13 Jim Kingdon <http://developer.redhat.com/>
+
+ * breakpoint.c (bpstat_stop_status): Revert 1998-09-08 change
+ to ->frame matching. The change did not match the ChangeLog
+ entry, looked fishy, and caused infinite stepping when running
+ "next" from main on sparc w/ RH Linux. Thanks to Jakub for the
+ report.
+
+1999-12-14 Stan Shebs <shebs@andros.cygnus.com>
+
+ * arm-tdep.c (arm_get_next_pc): Add argument to shifted_reg_val
+ call.
+
+1999-12-14 Mark Salter <msalter@cygnus.com>
+
+ * mips-tdep.c (mips_print_register): Fix printing of individual
+ registers when REGISTER_VIRTUAL_SIZE != REGISTER_RAW_SIZE.
+
+Tue Dec 14 23:29:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (mcalloc): Delcare.
+ * utils.c (xcalloc, mcalloc): New functions.
+
+1999-12-13 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/arm/tm-arm.h: Reformat comments, in preparation for
+ real changes.
+ * arm-tdep.c: Similarly, plus change function definitions to
+ modern form.
+
+1999-12-13 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.h (enum bptype): add new BP type bp_thread_event.
+ This will be used when a target needs to set an invisible
+ breakpoint to detect events such as thread creation.
+ * breakpoint.c (interlan_breakpoint_number): remove ifdefs.
+ (create_thread_event_breakpoint): new function.
+ (remove_thread_event_breakpoints): new function.
+ (bpstat_what): don't stop at invisible thread_event breakpoints.
+ (update_breakpoints_after_exec): if bp_thread_event breakpoins
+ still exist after an exec, delete them. They'll need to be
+ found and installed anew anyway.
+ (print_it_typical): don't announce bp_thread_event breakpoints.
+ (print_one_breakpoint): account for new breakpoint type.
+ (mention): don't mention invisible bp_thread_event breakpoints.
+ (delete_command): don't delete invisible bp_thread_event bp's.
+ (breakpoint_re_set_one): don't touch bp_thread_event bp's.
+
+Mon Dec 13 11:10:59 1999 Jimmy Guo <guo@cup.hp.com>
+
+ * language.h (longest_raw_hex_string, longest_local_hex_string,
+ longest_local_hex_string_custom): Declare.
+ * language.c: New functions, and misc. fixes.
+ (longest_raw_hex_string, longest_local_hex_string,
+ longest_local_hex_string_custom): New functions.
+
+ * c-typeprint.c
+ (c_type_print_varspec_prefix,c_type_print_varpsec_suffix): Add
+ TYPE_CODE_TEMPLATE case and default case.
+ (c_type_print_base): Revise how demangled_no_class is found;
+ print '}' before printing local file:line info.
+ * c-valprint.c (c_value_print): print reference type to class.
+
+ * valarith.c (value_binop): Add support for exponentiation,
+ equal, not equal.
+ (value_strcmp): New function.
+ (value_equal,value_less): Add string equality comparison support.
+
+ * m2-exp.y (lex): add default case statement to capture
+ unhandled token and call error().
+
+1999-12-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * main.c (main): Remove unused variable.
+
+ From Hubert VERSTRAETE (hubertV@bigfoot.com):
+ * main.c (captured_main): Disambiguate command line option '-d' by
+ preferring --directory over --dbx.
+
+ * top.c (return_to_top_level): Do not do exec cleanups if the
+ target is executing. Those cleanups are supposed to be done when
+ the target has stopped.
+
+Mon Dec 13 20:52:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (do_captured_breakpoint_query,
+ gdb_breakpoint_query): New functions. Implement a breakpoint
+ query.
+
+ * defs.h (enum gdb_rc): Declare.
+ (gdb_breakpoint_query): Declare.
+
+Mon Dec 13 14:18:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb-events.h: Fix typo in description of breakpoint events.
+ * gdb-events.sh: Update.
+
+Mon Dec 13 13:57:26 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (ep_type_description_t): Delete.
+ (print_one_breakpoint): Add local declaration of struct
+ ep_type_description.
+
+Mon Dec 13 12:38:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.h: Delete #include <setjmp.h>. Moved to top.c.
+ (SIGJMP_BUF, SIGSETJMP, SIGLONGJMP, SIGJMP_BUF, SIGSETJMP,
+ SIGLONGJMP): Delete. Moved to top.c
+ (error_return, quit_return): Delete extern declarations.
+
+ * top.c: #include <setjmp.h>.
+ (error_return, quit_return): Make static.
+ (SIGJMP_BUF, SIGSETJMP, SIGLONGJMP, SIGJMP_BUF, SIGSETJMP,
+ SIGLONGJMP): Define.
+
+Mon Dec 13 11:54:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * tracepoint.c (trace_start_command, tracepoints_info): Print
+ step_count using %ld.
+ * Makefile.in (tracepoint.o): Compile tracepoint.o with -Werror.
+
+1999-12-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * target.h (enum target_waitkind): Add new enumeration value
+ TARGET_WAITKIND_IGNORE. For inferior events that we should do
+ nothing about.
+
+ * remote.c (remote_async_wait): After each character of console
+ output from the inferior, return to the event loop with an event
+ kind of TARGET_WAITKIND_IGNORE instead of looping here.
+
+ * infrun.c (handle_inferior_event): In case of
+ TARGET_WAITKIND_IGNORE, return immediately, and set things up so
+ that we are still waiting for the inferior.
+
+1999-12-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (handle_timer_event): When calling the timer
+ procedure, use the saved_timer data, not the timer_ptr data,
+ because the latter has been already freed.
+
+Fri Dec 10 12:01:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * eval.c (evaluate_subexp): Only inline when GNUC and not STDC.
+
+Sat Dec 11 17:52:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (print_one_breakpoint): New function. Move
+ breakpoint print code to here.
+ (breakpoint_1): From here.
+ (print_one_breakpoint): Merge in ui-out code.
+ (print_one_breakpoint): Add local variabls ``stb'' and
+ ``old_chain''.
+ (breakpoint_1): Use print_one_breakpoint when UI.
+ (print_one_breakpoint): Print breakpoint type when UI.
+ (breakpoint_1): Merge UI out code into non UI function.
+
+ * ui-out.c (make_cleanup_ui_out_stream_delete): New function. Wrap
+ make_cleanup.
+ (do_stream_delete): New function. Wrap ui_out_stream_delete.
+ * ui-out.h (make_cleanup_ui_out_stream_delete): Declare.
+
+Sat Dec 11 00:12:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Clone breakpoint_1 creating UI
+ and non-UI versions.
+
+Mon Dec 6 20:31:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Replace field init_p with invalid_p.
+ (TARGET_BFD_VMA_BIT): New architecture vector method. Defaults to
+ architecture bits_per_address.
+ * gdbarch.h, gdbarch.c: Update.
+ * defs.h (TARGET_BFD_VMA_BIT): Provide default of TARGET_PTR_BIT
+ for non- multi-arch case.
+
+ * gdbtypes.h (builtin_type_bfd_vma, builtin_type_ptr,
+ builtin_type_CORE_ADDR): New GDB specific address types.
+ * gdbtypes.c (_initialize_gdbtypes, build_gdbtypes): Initialize
+ new builtin types.
+
+Wed Dec 8 17:48:56 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/sparc/nm-nbsd.h (FETCH_INFERIOR_REGISTERS): Delete
+ definition. Already defined in config/nm-nbsd.h. Include the
+ more explicit config/nm-nbsd.h.
+
+ * config/sparc/nbsd.mt (TDEPFILES): Move solib.o from here.
+ * config/sparc/nbsd.mh (NATDEPFILES): To here.
+ * config/xm-nbsd.h: #include <sys/param.h> to get definition of
+ NGROUPS needed by <limits.h> and missing on some systems.
+ * config/nm-nbsd.h: Only macro's that match NetBSD definitions
+ with what is expected by solib.c when not SVR4_SHARED_LIBS.
+
+ * configure.host: Add patterns for sparc-*-netbsdaout* and
+ sparc-*-netbsdelf*.
+ * config/sparc/nm-nbsdelf.h: New file.
+ * config/sparc/nbsdelf.mh: New file.
+
+Wed Dec 8 19:56:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * frame.h, blockframe.c: Rename default_frame_chain_valid to
+ file_frame_chain_valid. Rename alternate_frame_chain_valid to
+ func_frame_chain_valid.
+
+ * config/sparc/tm-sparclite.h, config/mips/tm-mipsv4.h,
+ config/m88k/tm-delta88v4.h, config/m68k/tm-m68kv4.h,
+ config/m68k/tm-monitor.h, config/i386/tm-i386nw.h,
+ config/i386/tm-i386v4.h, config/h8300/tm-h8300.h: Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+
+Wed Dec 8 19:12:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (generic_file_frame_chain_valid): Rename
+ generic_file_frame_chain_valid.
+ * frame.h: Update.
+ * config/fr30/tm-fr30.h, config/m32r/tm-m32r.h,
+ config/mn10200/tm-mn10200.h, config/mn10300/tm-mn10300.h,
+ config/sh/tm-sh.h, config/v850/tm-v850.h, config/mcore/tm-mcore.h:
+ Update.
+
+ * blockframe.c (generic_func_frame_chain_valid): New function.
+ Implement dummy-frame equivalent of function based frame chain
+ valid.
+ * frame.h (generic_func_frame_chain_valid): Declare.
+
+Wed Dec 8 16:26:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (alternate_frame_chain_valid,
+ default_frame_chain_valid): Swap implementations. The change Mon
+ Nov 30 11:18:48 1998 Andrew Cagney <cagney@chook> which converted
+ several macros to functions was backwards.
+
+ * mips-tdep.c (mips_gdbarch_init): Update. Call
+ alternate_frame_chain_valid and not default_frame_chain_valid.
+
+Wed Dec 8 15:29:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * infptrace.c: Simplify handling of <sys/wait.h>. Always include
+ "wait.h" from the ../include/wait.h directory. #include
+ <sys/wait.h> was added as part of Mon Nov 29 12:14:10 1999 Andrew
+ Cagney <cagney@b1.cygnus.com> but the ChangeLog was omitted.
+
+1999-12-07 Jim Blandy <jimb@cygnus.com>
+
+ Add support for SSE registers in core files.
+ * corelow.c (get_core_register_section): New function.
+ (get_core_registers): Fetch the new ".reg-xfp" sections,
+ in addition to the traditional ".reg" and ".reg2" sections.
+ Check for per-thread variants of all three. Use
+ get_core_register_section, instead of writing it out over and over
+ again.
+ * i386-linux-nat.c (i386_linux_fetch_core_registers): New function.
+ (i386_linux_nat_core_fns): New core_fns structure. We do our own
+ core handling now, instead of using the generic code in core-regset.c.
+ (_initialize_i386_linux_nat): New function, needed to register
+ i386_linux_nat_core_fns.
+ * config/i386/linux.mh (NATDEPFILES): Remove core-regset.o;
+ i386-linux-nat.c has its own sniffer now.
+ * gdbcore.h: (struct core_fns): Doc fix.
+
+ * i386v-nat.c (i386_float_info): Definition is #if 0'd; delete it
+ altogether. This should use the function i387-tdep.c.
+
+ Patch from Mark Kettenis <kettenis@gnu.org>:
+
+ * config/i386/tm-i386.h (FLOAT_INFO): New define.
+ * i387-tdep.c (print_i387_value, print_i387_ext,
+ print_i387_status_word, print_i387_control_word, i387_float_info):
+ New functions, used to implement generic `info float' command.
+
+1999-12-06 Christopher Faylor <cgf@cygnus.com>
+
+ * dcache.c (set_dcache_state): New function.
+ * dcache.h: Declare set_dcache_state().
+
+Sat Dec 4 15:17:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (build_remote_packet_sizes): Reduce the default packet
+ size of 400 bytes by one to 399. Stops GDB trashing stubs that
+ append a trailing NUL to an already full buffer.
+
+Sat Dec 4 01:16:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * tracepoint.c (remote_get_noisy_reply): Add parameter sizeof_buf.
+ (finish_tfind_command): Add parameter sizeof_msg.
+
+ * remote.c (remote_threads_info): Move assignment operator to
+ outside of function call.
+ (remote_send): Add parameter sizeof_buf.
+ (getpkt): Add parameter sizeof_buf. Call read_frame passing in
+ sizeof_buf.
+
+ * remote.h (getpkt): Update.
+
+ * tracepoint.c (remote_set_transparent_ranges,
+ remote_get_noisy_reply, trace_start_command, trace_stop_command,
+ trace_status_command, finish_tfind_command, trace_find_pc_command,
+ trace_find_tracepoint_command, trace_find_line_command,
+ trace_find_range_command, trace_find_outside_command): Update.
+
+ * remote.c (set_thread, remote_thread_alive,
+ remote_get_threadinfo, remote_get_threadlist,
+ remote_current_thread, remote_threads_info,
+ extended_remote_restart, get_offsets, remote_open_1,
+ remote_async_open_1, remote_wait, remote_async_wait,
+ remote_fetch_registers, check_binary_download, remote_write_bytes,
+ remote_read_bytes, remote_send, remote_detach,
+ remote_async_detach, remote_fetch_registers,
+ store_register_using_P, store_register_using_P,
+ remote_fetch_registers, remote_store_registers, putpkt_binary,
+ remote_insert_breakpoint, remote_remove_breakpoint,
+ compare_sections_command, remote_rcmd, packet_command,
+ remote_info_process, remote_query, remote_insert_watchpoint,
+ remote_search, remote_remove_watchpoint,
+ remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Update.
+
+Fri Dec 3 17:38:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * (read_frame): Add sizeof_buf parameter. Don't allow repeat when
+ first character. Always leave space at the end of the buffer.
+ Return size of packet or -1.
+ (getpkt): Update. Pass in PBUFSIZ.
+
+1999-12-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (print_it_typical): Print reason for stopping in
+ case of bp_until.
+
+Thu Dec 2 17:14:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c: Include <string.h> for memset().
+
+1999-12-01 Jim Blandy <jimb@cygnus.com>
+
+ * gdbtypes.c (builtin_type_v4si, builtin_type_v8qi,
+ builtin_type_v4hi, builtin_type_v2si): New SIMD types.
+ (build_gdbtypes): Initialize them.
+ (_initialize_gdbtypes): Gdbarch_swap them.
+ * gdbtypes.h (builtin_type_v4si, builtin_type_v8qi,
+ builtin_type_v4hi, builtin_type_v2si): Declare them.
+
+ * findvar.c (read_register_bytes, write_register_bytes): Correctly
+ determine how the region the caller is writing overlaps with each
+ register's bytes.
+
+ * value.h (struct value): Doc fixes.
+
+ * valops.c (value_assign): Clarify error message.
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (return_command_wrapper): New function, to export
+ return_command().
+
+1999-12-01 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/tm-cygwin.h: Change tm-i386.h include back to tm-i386v.h.
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * inf-loop.c (inferior_event_handler): In case of
+ INF_EXEC_CONTINUE, don't do all the regular continuations, but
+ just the intermediate ones.
+
+ * infcmd.c (step_once): Add the continuation to the
+ intermediate_continuation list instead of the regular continuation
+ list.
+
+ * utils.c (add_intermediate_continuation): New function, to add
+ continuations to the intermedite_continuation list.
+ (do_all_intermediate_continuations): New function, do all the
+ continuations in the intermediate list.
+ (discard_all_intermediate_continuations): New function, discard
+ all the continuations in the intermediate list.
+ (intermediate_continuation): New global list for use by step_1().
+
+ * defs.h: Export intermediate_continuation,
+ add_intermediate_continuation, do_all_intermediate_continuations,
+ discard_all_intermediate_continuations.
+
+1999-11-30 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (mappings): Reorganize slightly for new uniform i386
+ register configuration.
+ (do_child_fetch_inferior_registers): Handle special case floating point
+ registers.
+ (handle_output_debug_string): Handle cygwin-specific signals broadcast
+ from the cygwin DLL.
+ (handle_exceptions): Add code to properly allow continuation after a
+ CTRL-C.
+ (child_continue): Accept propagated "continue_status" which controls
+ how the inferior should be continued.
+ (get_child_debug_event): New function.
+ (child_wait): Use above function to handle debug events.
+ (child_create_inferior): Add more intelligent method for running the
+ inferior to the appropriate point before handing it off to the rest of
+ gdb.
+ (child_stop): Specifically send a CTRL-C to the debugged process.
+ (child_kill_inferior): Set global continue status here to cause
+ inferior to run to completion.
+ (child_resume): Eliminate code which attempts to decide how to continue
+ the inferior. This is now handled by child_continue.
+ * config/i386/tm-cygwin.h: Gut and reorganize for consistency with new
+ tm-i386.h.
+
+ Patch from Egor Duda (deo@logos-m.ru)
+ * win32-nat.c (psapi_get_dll_name): New function.
+ (handle_load_dll): Correctly load DLL symbol tables after attaching to
+ a running pid.
+
+1999-11-30 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infrun.c (handle_inferior_pid): revert 11-29 change: resuming
+ a thread other than the current thread with a signal. Apparently
+ target_resume with a specific pid, a specific signal, and no step
+ means to continue ALL threads but to only send the signal to one
+ (and not, as I had assumed, to continue only the specified thread).
+ * i386-linux-nat.c (fill_gregset): guard against invalid input.
+
+1999-11-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (step_once): New function. Used to do just one step
+ operation.
+ (step_1_continuation): New function. Figure out if we need to step
+ again before returning control to the user.
+ (step_1): If we are in asynchronous mode, don't do the for loop,
+ but rather delegate to continuations the task of repeating the
+ step operation.
+
+ * utils.c (do_all_continuations): Copy the continuation list aside
+ before working on it.
+
+ * target.h (enum inferior_event_type): Add new enum
+ INF_EXEC_CONTINUE.
+
+ * inf-loop.c (inferior_event_handler): Handle new case
+ INF_EXEC_CONTINUE.
+
+ * infrun.c (fetch_inferior_event): If we are in the middle of a
+ 'step n' type command, don't say that the execution is complete,
+ but that it will have to continue.
+
+1999-11-30 Kevin Buettner <kevinb@cygnus.com>
+
+ * utils.c (verror): Don't traverse va_list argument twice. Also,
+ removed extraneous va_end() call.
+
+1999-11-29 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infrun.c (handle_inferior_pid): If a child thread stops on a
+ signal that we are ignoring, and GDB silently resumes the child,
+ resume ALL threads (not just the one that got the signal). All
+ threads are stopped, so all must be resumed.
+ (handle_inferior_event): on detecting a thread context switch,
+ swap infrun_state ONLY if both the old thread and the new one
+ are in the thread list. Otherwise state information will be lost!
+ Problem may arise with flaky back-ends.
+
+1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (print_stop_reason): Don't print end of stepping reason
+ if we are in the middle of a multistep command (same condition as
+ in normal_stop).
+
+ * breakpoint.c (bpstat_stop_status): Don't decrease hit_count
+ in case of a wp that has not changed.
+
+Mon Nov 29 12:14:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbtypes.c (init_simd_type): Make static.
+
+ * configure.in (AC_CHECK_HEADERS): Check for <sys/ioctl.h>.
+ * configure, config.h: Re-generate.
+ * inflow.c: Include <sys/ioctl.h>
+
+ * i386b-nat.c: Include "gdbcore.h".
+ * fork-child.c: Include "command.h".
+
+ * remote.c (remote_cisco_section_offsets,
+ remote_start_remote_dummy, store_register_using_P,
+ remote_info_process, remote_cisco_open, remote_cisco_close,
+ readsocket, readtty, minitelnet, remote_cisco_wait,
+ init_remote_async_ops, init_extended_async_remote_ops,
+ set_remote_cmd), infrun.c (default_skip_permanent_breakpoint): Use
+ ISO-C syntax for function definition.
+
+Mon Nov 29 11:28:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * stabsread.c: Revert 1999-11-09 Jim Blandy
+ <jimb@zwingli.cygnus.com> and 1999-11-08 Jim Blandy
+ <jimb@cygnus.com>. Broken on non-Linux targets.
+
+1999-11-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * symfile.c (show_load_progress): Add total sent so far to the
+ information passsed to the hook users.
+ (generic_load): Collect total sent so far and pass that to the
+ progress hook.
+
+ * defs.h (show_load_progress): Update.
+
+1999-11-25 Nick Clifton <nickc@cygnus.com>
+
+ * coffread.c (coff_symfile_read): Treat "epoc-pe" targets as "pe"
+ targets.
+ * dbxread.c (dbx_read_symfile): Treat "epoc-pe" targets as "pe"
+ targets.
+
+Wed Nov 24 17:07:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (init.c): Add SUBDIR_INIT_FILES so that sub
+ directories can hook in extra init files.
+
+Wed Nov 24 11:41:01 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (field_string_ftype, ui_out_field_string): Make string
+ parameter const.
+ * cli-out.c (cli_field_string): Update.
+ * ui-out.c (uo_field_string, ui_out_field_string,
+ default_field_string): Update.
+
+1999-11-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * defs.h (show_load_progress): Export.
+
+ * symfile.c (show_load_progress): New hook for download.
+ (generic_load): Collect total size of executable to load.
+ Call progress hook when downloading.
+ Add output for ui case.
+ (print_transfer_performance): Add output for ui case.
+
+Thu Nov 18 11:54:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arc-tdep.c (codestream_fill): Rewrite byte swap code using
+ function extract_unsigned_integer.
+
+Wed Nov 17 17:01:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arm-xdep.c: #include "arm-opcode.h" -> "opcode/arm.h".
+
+1999-11-22 Jim Blandy <jimb@cygnus.com>
+
+ * Makefile.in (i386-tdep.o): Update list of dependencies.
+
+1999-11-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Adjust output for stepi/nexti case.
+
+1999-11-22 Jim Blandy <jimb@cygnus.com>
+
+ * config/i386/tm-i386v.h (NUM_REGS, REGISTER_NAMES,
+ REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE): Deleted. All
+ of these should inherit identical or compatible values from
+ tm-i386.h, as long as you don't define HAVE_SSE_REGS or
+ HAVE_I387_REGS, which are new anyway.
+
+Mon Nov 22 21:39:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.c (do_target_signal_to_host): New function. Indicate of
+ the conversion was successful to the caller via an additional
+ parameter.
+ (target_signal_to_host_p): New function. Return non-zero if the
+ GDB signal exists on the host system.
+ (target_signal_to_host): Rewrite. Use do_target_signal_to_host.
+ * target.h (target_signal_to_host_p): Add declaration. Document
+ target_singal vs host signal vs target OS signal confusion.
+
+ From 1999-11-08 Jimmy Guo <guo@cup.hp.com>:
+ * hppah-nat.c (require_notification_of_events): Start by ignoring
+ all signals and then adding back in ones we're interested in.
+
+Thu Nov 18 18:12:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * jv-typeprint.c (java_type_print_base), kod-cisco.c
+ (cisco_kod_open), kod.c (kod_set_os), xcoffread.c
+ (process_linenos), symfile.c (add_symbol_file_command),
+ remote-rdi.c (arm_rdi_open, rdilogfile_command), main.c
+ (captured_main), go32-nat.c (go32_create_inferior), exec.c
+ (exec_file_attach), corefile.c (core_file_command,
+ reopen_exec_file): Replace strdup with xstrdup.
+
+ * varobj.c (varobj_gen_name, c_name_of_child, c_value_of_variable,
+ cplus_value_of_variable): Replace strdup with xstrdup.
+ * ui-out.c (ui_out_table_begin): Ditto.
+
+Mon Nov 22 12:02:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * bcache.c (print_bcache_statistics): Fix printf_filtered
+ arguments.
+ (print_percentage): Make function void.
+
+1999-11-21 Jim Blandy <jimb@cygnus.com>
+
+ Make the bcache hash table grow.
+ * bcache.h (BCACHE_NUM_BUCKETS): Delete definition.
+ (struct bcache): Add new element: num_buckets. Make bucket be a
+ pointer to an array, not an array.
+ (free_bcache): New extern declaration.
+ * bcache.c (CHAIN_LENGTH_THRESHOLD): New constant.
+ (expand_hash_table): New function.
+ (bcache): Grow the hash table if the average chain length reaches
+ CHAIN_LENGTH_THRESHOLD.
+ (free_bcache): New function.
+ (print_bcache_statistics): Don't assume that the number of buckets
+ is constant any more.
+ (BSTRING_SIZE): Moved down to just above 'bcache' function, where
+ it's used.
+ * objfiles.c (free_objfile): Call free_bcache, instead of just
+ freeing the bcache's obstack directly.
+ * symfile.c (reread_symbols): Same.
+
+1999-11-20 Jim Blandy <jimb@cygnus.com>
+
+ * bcache.c, bcache.h: Rewritten. New version imposes less memory
+ overhead, and has a more effective hash function, so it's probably
+ faster, too.
+
+ * config/nm-linux.h: No need to check whether __STDC__ is
+ #defined --- GDB requires ANSI C now.
+
+ * config/i386/nm-linux.h (linuxthreads_pid_to_str,
+ linuxthreads_prepare_to_proceed): Delete declarations --- they're
+ provided by config/nm-linux.h now.
+
+1999-11-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (print_command_lines): Remove unused var.
+
+1999-11-19 Jim Kingdon <kingdon@redhat.com>
+
+ Patch applied by Jim Blandy <jimb@cygnus.com>:
+
+ Enable threads for all linux architectures:
+ * config/nm-linux.h: New file.
+ config/alpha/nm-linux.h, config/i386/nm-linux.h,
+ config/m68k/nm-linux.h, config/sparc/nm-linux.h: Use it.
+ * config/tm-linux.h: New file.
+ * config/i386/tm-linux.h, config/m68k/tm-linux.h,
+ config/sparc/tm-linux.h, config/alpha/tm-alphalinux.h: Use it.
+ * config/m68k/linux.mh, config/sparc/linux.mh,
+ config/alpha/alpha-linux.mh: Add linux-thread.o.
+
+1999-11-18 Tom Tromey <tromey@cygnus.com>
+
+ * tracepoint.h (get_tracepoint_by_number): Updated declaration.
+ * tracepoint.c (trace_pass_command): Better error message. Fixed
+ logic when `all' not specified.
+ (get_tracepoint_by_number): Added `optional_p' argument. Fixed
+ all callers.
+
+Wed Nov 17 17:40:30 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * findvar.c (SWAP_FLOATING): Delete macro. Unused.
+
+1999-11-16 Mark Salter <msalter@cygnus.com>
+
+ * monitor.c (monitor_supply_register): Initialize value to zero.
+
+1999-11-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ (Patches applied by Jim Blandy <jimb@zwingli.cygnus.com>)
+
+ Change DJGPP target use the common register layout in
+ config/i386/tm-i386.h.
+ * config/i386/tm-go32.h: #include "i386/tm-i386.h", not
+ "i386/tm-i386v.h".
+ (HAVE_I387_REGS): Define.
+ (HAVE_SSE_REGS): Undefine.
+ (NUM_FREGS, NUM_REGS, REGISTER_NAMES, FP_REGNUM, SP_REGNUM,
+ PS_REGNUM, PC_REGNUM, FP0_REGNUM, FPC_REGNUM, FPCWD_REGNUM,
+ FPSWD_REGNUM, FPTWD_REGNUM, FPIPO_REGNUM, FPIPS_REGNUM,
+ FPOOS_REGNUM, FPOPS_REGNUM, REGISTER_BYTES, REGISTER_BYTE,
+ REGBYTE_0, REGBYTE_10 REGBYTE_16, REGBYTE_24, REGBYTE_29,
+ REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, REGISTER_CONVERTIBLE): Definitions
+ deleted.
+ (i387_to_double, double_to_i387): Declarations deleted.
+ (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW,
+ REGISTER_VIRTUAL_TYPE): Use definitions from
+ config/i386/tm-i386.h, unless LD_I387 is #defined.
+
+ * go32-nat.c (go32_fetch_registers, store_register)
+ (go32_create_inferior, init_go32_ops): Replace fatal with
+ internal_error.
+ (sig_map): Map exception 7 to TARGET_SIGNAL_EMT.
+
+ * utils.c (notice_quit): Doc fixes.
+
+1999-11-15 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdbserver/server.h (initialize_low): Declare this target
+ specific function.
+ * gdbserver/server.c (main): Call initialize_low.
+ * gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
+ gdbserver/low-sim.c, gdbserver/low-sparc.c, gdbserver/low-sun3.c
+ (initialize_low): Renamed from initialize. Also removed
+ initialization of inferior_pid.
+ (have_inferior_p): Removed.
+ * gdbserver/low-lynx.c (initialize_low): New function.
+
+1999-11-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote-rdi.c: Fix indentation accordingly to GNU standards.
+
+1999-11-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.h: Export {watch, awatch, rwatch}_command_wrapper().
+
+ * breakpoint.c (print_it_typical): Add output for bp_watchpoint,
+ bp_hardware_watchpoint, read_watchpoint, access_watchpoint cases.
+ (watchpoint_check): Add output for when the watchpoint goes out of
+ scope.
+ (mention): Add output for bp_watchpoint, bp_hardware_watchpoint,
+ read_watchpoint, access_watchpointcases. Move end of list to end
+ of function.
+ ({watch, awatch, rwatch}_command_wrapper): New functions, to
+ export {watch, awatch, rwatch}_command().
+
+Thu Oct 28 00:28:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_gdbarch_init): Make the d10v:ts3 the default.
+
+Tue Oct 26 09:57:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Re-sync with Cagney's earlier const change.
+
+Sun Oct 24 20:07:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (struct gdbarch_tdep): Replace nr_a_regs,
+ imap0_regnum, nr_imap_regs, dmap0_regnum, with dmap_register and
+ imap_register.
+ (R0_REGNUM, LR_REGNUM, PSW_REGNUM, NR_IMAP_REGS, NR_A_REGS):
+ Convert to enums.
+ (TS2_NR_A_REGS, TS2_NR_IMAP_REGS, TS3_NR_IMAP_REGS,
+ TS3_NR_A_REGS): Delete.
+ (d10v_ts2_dmap_register, d10v_ts3_dmap_register,
+ d10v_ts2_imap_register, d10v_ts3_imap_register): New functions.
+ (d10v_dmap_register, d10v_imap_register,
+ d10v_ts2_register_sim_regno, d10v_ts3_register_sim_regno,
+ show_regs): Update.
+ (remote_d10v_translate_xfer_address): Rewrite. Use
+ sim_d10v_translate_addr to translate addresses.
+ (d10v_gdbarch_init): Initialize tdep members dmap_register and
+ imap_register.
+
+Sun Oct 24 00:12:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (struct gdbarch_tdep): Declare.
+ (NR_IMAP_REGS, NR_DMAP_REGS, A0_REGNUM, NR_A_REGS): Redefine using
+ value in gdbarch_tdep.
+ (d10v_dmap_register, d10v_imap_register): Ditto.
+ (d10v_ts2_register_name, d10v_ts2_register_sim_regno): Rename
+ d10v_register_name and d10v_register_sim_regno
+ (enum ts3_regnums, d10v_ts3_register_name,
+ d10v_ts3_register_sim_regno, d10v_register_sim_regno): New.
+ (d10v_gdbarch_init): Configure registers and G packet according to
+ d10v/ts2 and d10v/ts3.
+
+Sat Oct 23 21:28:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (IMAP0_REGNUM, IMAP1_REGNUM, DMAP_REGNUM):
+ Delete macro.
+ (R0_REGNUM, LR_REGNUM, PSW_REGNUM, A0_REGNUM): Move from here.
+ * d10v-tdep.c: To here.
+
+ * d10v-tdep.c: (NR_DMAP_REGS, NR_IMAP_REGS, NR_A_REGS): Define.
+ (d10v_dmap_register, d10v_imap_register): New functions.
+ (remote_d10v_translate_xfer_address): Make static.
+ (d10v_register_virtual_size): Use TYPE_LENGTH of
+ REGISTER_VIRTUAL_TYPE.
+ (d10v_register_byte, do_d10v_pop_frame,
+ remote_d10v_translate_xfer_address, show_regs,
+ d10v_register_raw_size): Ditto.
+ (d10v_register_virtual_type): Ditto. Use explicitly sized builtin
+ types.
+
+Sat Oct 23 19:08:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c: Include "sim-d10v.h".
+ (enum ts2_regnums): Declare.
+ (d10v_register_sim_regno): New function.
+
+ * config/d10v/tm-d10v.h: Delete pre multi-arch code.
+ (REGISTER_SIM_REGNO): Define.
+ (d10v_register_sim_regno): Declare.
+
+Sat Oct 23 16:39:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (initialize_current_architecture): Make ``choice''
+ const.
+
+Wed Nov 10 16:10:22 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Fix typo in error message.
+
+Wed Nov 10 16:47:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (error_last_message): Use gdb_file_xstrdup.
+
+ * defs.h (verror, internal_verror): Declare.
+
+ * utils.c (verror, internal_error): New functions.
+ (error, internal_error): Use verror / internal_verror.
+ (error_stream): Use gdb_file_xstrdup. Correctly handle %s in
+ error message body.
+ (error_init): Use mem_fileopen.
+
+ * corefile.c (memory_error): Use mem_fileopen instead of
+ tui_sfileopen. Don't call error_begin.
+ * varobj.c (c_value_of_variable): Use mem_fileopen () and
+ gdb_file_xstrdup() instead of strdup and tui_sfileopen.
+ * remote-sim.c (gdb_os_error): Rewrite using verror. Don't call
+ error_begin.
+
+Wed Nov 10 14:21:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (gdb_file_xstrdup): New function.
+ * utils.c (gdb_file_xstrdup, do_gdb_file_xstrdup): Implement.
+ * ui-out.c (ui_out_stream_new): Simplify, XMALLOC doesn't return
+ if malloc failed. Use mem_fileopen and gdb_file_xstrdup.
+
+1999-11-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ * exec.c (exec_file_attach), irix5-nat.c, osfsolib.c, solib.c
+ (info_sharedlibrary_command), pa64solib.c
+ (pa64_sharedlibrary_info_command), somsolib.c
+ (som_sharedlibrary_info_command): Replace "exec file" with
+ "executable file" in messages.
+
+1999-11-09 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Finish the job attempted by the previous change.
+ * stabsread.c (read_range_type): Make n2 and n3 LONGEST. Adjust
+ the various tests that check for maximum values, bit counts, etc.
+ In the long run, it might have been simpler just to give GDB bignums.
+
+Tue Nov 9 18:34:13 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * defs.h (gdb_file_put): Add parameter write.
+ (gdb_file_put_method_ftype): New typedef.
+ * utils.c (gdb_file_put, mem_file_put, tui_file_put,
+ null_file_put): Update.
+
+ * utils.c (struct gdb_file): Add field magic.
+ (gdb_file_new): Initialize.
+ (gdb_file_data): Verify.
+
+ * utils.c (mem_file_fputs): Delete. Replaced by.
+ (mem_file_write): New function. Rewrite mem_file.
+ (mem_file_new): Update.
+
+Tue Nov 9 17:51:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.c (gdb_os_write_stdout): Use gdb_file_write.
+ (gdb_os_flush_stdout): Flush gdb_stdtarg instead of gdb_stdout.
+
+Tue Nov 9 15:33:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (procfs.o): Don't compile with -Werror for moment.
+ * sol-thread.c (info_cb): Move assignments to outside of if
+ statement.
+ (info_cb): Use paddr when printing addresses.
+
+1999-11-08 Jim Blandy <jimb@cygnus.com>
+
+ * defs.h (ULONGEST_MAX, LONGEST_MAX): New definitions.
+ * stabsread.c (read_huge_number): Parse and return LONGEST values.
+
+1999-11-08 Mark Salter <msalter@cygnus.com>
+
+ * utils.c (floatformat_to_doublest): Fix conversion of denormals.
+
+1999-11-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (hbreak_command_wrapper): New function, to export
+ hbreak_command.
+ (thbreak_command_wrapper): New function, to export thbreak_command.
+
+ * symtab.c (rbreak_command_wrapper): New function, to export
+ rbreak_command.
+
+ * breakpoint.h (hbreak_command_wrapper, thbreak_command_wrapper,
+ rbreak_command_wrapper): Export.
+
+Mon Nov 8 20:14:13 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * remote.c (get_memory_read_packet_size): For moment limit read
+ size to PBUFSIZ.
+ (putpkt_binary): Remove check on packet size. Allocate ``cnt +
+ 6'' characters for output buffer.
+ (get_memory_packet_size): When packet size is ``fixed'' and the
+ size is zero, return MAX_REMOTE_PACKET_SIZE. Check that packets
+ are at least MIN_REMOTE_PACKET_SIZE.
+ (set_memory_packet_size): Print usage when ``args'' is NULL.
+
+Mon Nov 8 18:18:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h, utils.c (gdb_file_deallocate): Delete.
+ * varobj.c (varobj_get_type, c_value_of_variable): Use
+ make_cleanup_gdb_file_delete.
+ * ui-out.c (ui_out_stream_delete): Use gdb_file_delete.
+ * corefile.c (memory_error): Use make_cleanup_gdb_file_delete.
+
+ * defs.h, utils.c (gdb_file_init_astring): Delete.
+
+ * defs.h, utils.c (tui_file_get_strbuf): Rename
+ gdb_file_get_strbuf.
+ (tui_file_adjust_strbuf): Rename gdb_file_adjust_strbuf.
+ * utils.c (error_stream, error_last_message): Update.
+ * varobj.c (varobj_get_type, c_value_of_variable): Update.
+ * ui-out.c (ui_out_field_stream): Update.
+
+Mon Nov 8 16:28:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h, utils.c (gdb_fclose): Delete.
+ * defs.h (make_cleanup_gdb_file): Declare.
+ * utils.c (make_cleanup_gdb_file_delete, do_gdb_file_delete): New
+ functions.
+
+ * symmisc.c (maintenance_print_symbols,
+ maintenance_print_psymbols, maintenance_print_msymbols): Use
+ make_cleanup_gdb_file_delete.
+ * serial.c (do_serial_close): Use gdb_file_delete.
+
+Mon Nov 8 14:16:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (gdb_file_write_ftype, set_gdb_file_write,
+ gdb_file_write): Declare.
+
+ * utils.c (struct gdb_file): Add to_write member.
+ (gdb_file_write, set_gdb_file_write): New functions.
+ (gdb_file_new): Initialize the write method.
+ (null_file_write): New function.
+ (null_file_fputs, null_file_write): ``write'' calls ``fputs'' and
+ ``fputs'' calls ``write'' when the other is implemented.
+ (stdio_file_new): Initialize write method.
+ (stdio_file_write): New function.
+
+ * utils.c (putchar_unfiltered, fputc_unfiltered): Use
+ gdb_file_write.
+
+Thu Nov 4 11:59:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (get_memory_packet_size, set_memory_packet_size,
+ build_memory_packet_size): New functions. Set / compute / update
+ the size of a memory read / write packet.
+ (set_memory_read_packet_size, set_memory_write_packet_size): New
+ functions. Verify changes to the memory read / write packet size.
+ (prefered_memory_write_packet_size,
+ current_memory_write_packet_size, prefered_memory_read_packet_size,
+ current_memory_read_packet_size): New variables.
+ (get_memory_read_packet_size, get_memory_write_packet_size): New
+ functions. Determine the current memory read/write packet size. A
+ function is needed as ``current_register_packet_size'', a variable
+ is used in the calculation.
+ (register_remote_packet_sizes, build_remote_packet_sizes):
+ Initialize packet sizes according the current architecture.
+ (remote_fetch_registers, remote_write_bytes, remote_read_bytes,
+ build_remote_gdbarch_data): Update.
+ (_initialize_remote): Add the commands ``set remote
+ memory-read-packet-size'' and ``set remote
+ memory-write-packet-size''. Deprecate ``set remotepacketsize''.
+
+Sun Nov 7 18:09:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.h, target.c (target_load): Replace macro with a function.
+
+ * config/i960/tm-nindy960.h (ADDITIONAL_OPTION_HANDLER): Rewrite
+ replacing SET_TOP_LEVEL with catch_command_errors.
+ (nindy_open): Add extern declaration.
+
+ * top.h (top_level_val, SET_TOP_LEVEL): Delete.
+ * defs.h (catch_command_errors_ftype, catch_command_errors): Add
+ declarations.
+ * top.c (struct captured_command_args): Declare.
+ (do_captured_command, catch_command_errors): New functions. Call
+ the command function via catch_errors.
+ (catch_errors): Add more comments.
+
+ * main.c (struct captured_main_args): Define.
+ (captured_main): New. Rewrite main. Replace SET_TOP_LEVEL with
+ calls to catch_command_errors. Delete calls to do_cleanups which
+ are now handled by catch_errors. Call the command loop via
+ captured_command_loop and catch_errors.
+ (main): Move code body to captured_main. Call captured_main via
+ catch_errors.
+ (captured_command_loop): New function. Wrap call to command_loop.
+
+1999-11-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * procfs.c (unconditionally_kill_inferior) (init_procinfo)
+ (create_procinfo) (procfs_exit_handler) (proc_set_exec_trap)
+ (do_attach) (do_detach) (procfs_wait) (set_proc_siginfo)
+ (procfs_resume) (info_proc_mappings)
+ (modify_run_on_last_close_flag) (procfs_lwp_creation_handler)
+ (procfs_thread_alive): Remove unused variables, conditionalize
+ vars declarations to eliminate compiler warnings.
+
+1999-11-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (print_return_value): Add output for UI.
+
+Fri Nov 5 16:32:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inferior.h (CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET,
+ CALL_DUMMY_BREAKPOINT_OFFSET, CALL_DUMMY_LENGTH,
+ CALL_DUMMY_STACK_ADJUST, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS, PUSH_DUMMY_FRAME, FIX_CALL_DUMMY,
+ STORE_STRUCT_RETURN), d10v-tdep.c (print_insn), d30v-tdep.c
+ (print_insn), target.h (SOFTWARE_SINGLE_STEP): Call internal_error
+ instead of abort.
+
+ * utils.c (stdio_file_delete, stdio_file_flush, stdio_file_fputs,
+ stdio_file_isatty, tui_file_delete, tui_file_isatty,
+ tui_file_rewind, tui_file_put, gdb_file_init_astring,
+ gdb_file_get_strbuf, gdb_file_adjust_strbuf): Call internal_error
+ instead of error.
+
+1999-11-04 Kevin Buettner <kevinb@cygnus.com>
+
+ * remote.c (build_remote_gdbarch_data): Set remote_address_size...
+ (_initialize_remote) ...but don't set it here. Also, tie
+ remote_address_size to the target architecture via call to
+ register_gdbarch_swap().
+
+1999-11-04 Jeff Holcomb <jeffh@cygnus.com>
+
+ * remote-rdp.c (send_rdp): Fix typo.
+
+1999-11-04 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.c (commands_command): remove unprotected ref to
+ args pointer (which may be null).
+
+1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (print_return_value): New function. Print return value
+ from finish command.
+ (finish_command_continuation): Call print_return_value().
+ (finish_command): Ditto.
+
+1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (print_it_typical): Print reason for stopping in
+ case of bp_finish.
+
+1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (handle_inferior_event): Add calls to print_stop_reason()
+ for end of stepping range cases.
+ (print_stop_reason): Add output for END_STEPPING_RANGE, EXITED,
+ SIGNAL_EXITED, SIGNAL_RECEIVED cases.
+
+ * breakpoint.c (print_it_typical): Add printing of stop reason for
+ bp_breakpoint case.
+
+Thu Nov 4 17:46:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * event-loop.c (gdb_do_one_event): Delete SET_TOP_LEVEL call.
+ Move error code to start_event_loop.
+ (start_event_loop): Call gdb_do_one_event via catch_errors.
+ Handle caught errors.
+
+Thu Nov 4 17:36:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (get_number): Delete static declaration.
+
+1999-11-03 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.c (map_breakpoint_numbers): use a match count
+ instead of a goto.
+
+1999-11-03 Nick Clifton <nickc@cygnus.com>
+
+ * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_DEFAULT): Change to
+ little endian.
+
+1999-11-02 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * target.h (target_new_objfile) replace macro with function pointer
+ hook. Any module needing notification of new objfiles may claim
+ this hook. Multiple notification clients must cooperate by saving
+ the previous pointer (if any) and calling it.
+ * sol-thread.c (_initialize_sol_thread): point new_objfile hook at
+ sol_thread_new_objfile. Save old pointer if any.
+ (sol_thread_new_objfile): call old owner of event hook if any.
+ * hpux-thread.c (_initialize_hpux_thread, hpux_thread_new_objfile):
+ ditto.
+ * linux-thread.c (_initialize_linux_thread, linux_thread_new_objfile):
+ ditto.
+ symfile.c (symbol_file_add, clear_symtab_users) call the new
+ function pointer hook, instead of the macro.
+ * config/sparc/nm-sun4sol2.h: remove define of target_new_objfile.
+ * config/pa/nm-hppah.h: ditto.
+ * config/i386/nm-i386sol2.h: ditto.
+ * config/i386/nm-linux.h: ditto.
+
+1999-11-02 Tom Tromey <tromey@cygnus.com>
+
+ * NEWS: Mention breakpoint ranges.
+
+1999-11-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/devsw.c (openLogFile): Change a call to setlinebuf()
+ to an equivalent call to setvbuf() to prevent an unresolved
+ reference when building on cygwin.
+
+1999-11-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (inferior_stop_reason): New enum, explicitly name the
+ resons for which the inferior stops.
+ (handle_inferior_event): Case TARGET_WAITKIND_EXITED: replace
+ printf's with call to print_stop_reason(). Case
+ TARGET_WAITKIND_SIGNALLED: Same. When stopped by random signal:
+ Same.
+ (print_stop_reason): New static function. Print relevant messages
+ when stopping.
+
+1999-11-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/Makefile.in: Rename dependency from bytesex.o to
+ angel_bytesex.o.
+
+1999-11-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * kod.c: Remove prototype for show_kod() which is no longer used.
+
+1999-11-01 Michael Snyder <msnyder@cygnus.com>
+ Tom Tromey <tromey@cygnus.com>
+
+ * tracepoint.h (get_tracepoint_by_number): Updated declaration.
+ * tracepoint.c (get_tracepoint_by_number): Added `multi_p'
+ argument. Now uses get_number_or_range and get_number.
+ (trace_pass_command): Allow a tracepoint range.
+ * breakpoint.h (get_number, get_number_or_range): Declare.
+ * breakpoint.c (get_number_trailer): New function.
+ (get_number): Rewrote to use get_number_trailer.
+ (get_number_or_range): New function.
+ (condition_command): Check `get_number' return value.
+ (commands_command): Likewise.
+ (ignore_command): Likewise.
+ (map_breakpoint_numbers): Use get_number_or_range.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote-rdi.c (_initialize_remote_rdi): Make log commands
+ subcommands of maintenance. Remove improper identation from
+ command documentation.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * rdi-share/etherdrv.c (fetch_ports): Print out additional TCP/IP
+ port information in ethernet driver if the DEBUG flag is set.
+ * rdi-share/hostchan.c (Adp_addToQueue): Changed #if statement in
+ hostchan.c to avoid compiler complaint when DEBUG macro was
+ undefined.
+ * rdi-share/unixcomm.c (Unix_ReadSerial): Print system error code
+ if read() system call fails.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/bytesex.h: Deleted. Conflicts with a system header file
+ on some systems like Linux Red Hat 5.2.
+ * rdi-share/angel_bytesex.h: New file. Replaces the above.
+ * rdi-share/bytesex.c: Deleted. Name changed to match the header
+ mentioned above (this is the implementation file).
+ * rdi-share/angel_bytesex.c: New file. Replaces the above.
+ * rdi-share/Makefile.am: Reflect above changes.
+ * rdi-share/Makefile.in: Reflect above changes.
+
+1999-11-01 Jimmy Guo <guo@cup.hp.com>
+
+ * annotate.c (breakpoints_changed, annotate_ignore_count_change,
+ annotate_stopped): Provide annotation for breakpoint ignore_count
+ changes but only provide once at annotate_stopped time for
+ sucessive ignore_count triggered breakpoint changes, to make GUIs
+ happy yet lazy.
+ * annotate.h (annotate_ignore_count_change): Declare.
+ * breakpoint.c (bpstat_stop_status): Call
+ annotate_ignore_count_change when ignore_count changes.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * rdi-share/ardi.c (HandleStoppedMessage): Changed code that
+ handles the "stop" message so that unrecognized errors are
+ returned as "Error" rather than "NoError". The old code resulted
+ in some error conditions not being reported to the user.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * remote-rdi.c (arm_rdi_open): Added a call to Adp_CloseDevice()
+ before attempting to open a connection. This allows the user to
+ issue the "target rdi" command multiple times (in case the user
+ needs to change options or re-initialize the link).
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * rdi-share/endian.h: Deleted. Name clash with
+ /usr/include/endian.h. This was causing the wrong byte order to
+ be used by htons() in the RDI Ethernet driver.
+ * rdi-share/angel_endian.h: New file. Replaces the above.
+ * rdi-share/ardi.c: Replace include to reflect the above change.
+ * rdi-share/etherdrv.c: Ditto.
+ * rdi-share/hsys.c: Ditto.
+ * rdi-share/msgbuild.c: Ditto.
+ * rdi-share/params.c: Ditto.
+ * rdi-share/rx.c: Ditto.
+ * rdi-share/tx.c: Ditto.
+ * rdi-share/Makefile.am: Reflect above changes.
+ * rdi-share/Makefile.in: Reflect above changes.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * remote-rdi.c (_initialize_remote_rdi): Added command
+ rdilogenable. Allows the user to log ADP packets that are
+ exchanged between gdb and the target. Both the raw packets are
+ shown and some minimal decoding is attempted. Default state is
+ disabled.
+ (_initialize_remote_rdi): Added command rdilogfile. Allows the
+ user to specify the filename to which the ADP packet log is to be
+ written. Default state is "rdi.log".
+ (rdilogenable_command): New function. Related to rdilogenable.
+ (rdilogfile_command): New function. Related to rdilogfile.
+ * rdi-share/devsw.c (openLogFile, closeLogFile,
+ DevSW_SetLogEnable, DevSW_SetLogfile, dumpPacket): New
+ functions. Implement logging.
+ (DevSW_Read): Log if requested.
+ (DevSW_Write): Log if requested.
+ * rdi-share/devsw.h: Add prototypes for DevSW_SetLogfile and
+ DevSW_SetLogEnable.
+ * rdi-share/hostchan.c (Adp_SetLogEnable, Adp_SetLogfile): New
+ functions. Related to rdilogenable and rdilogfile.
+ * rdi-share/hostchan.h: Add prototypes for the above functions.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * remote-rdi.c (arm_rdi_open): Added code to split the arguments
+ to the 'target rdi' command at the first space. The first word is
+ passed to Adp_OpenDevice as the device name, the tail is passed as
+ the "arguments" parameter. This allows user specified baud rates
+ -- among other things that still need to be documented [e.g. (gdb)
+ target rdi /dev/ttyS1 19200]. NB: With very limited testing, the
+ ARM Embedded-ICE seems to run at 19.2K (though it is reported to
+ be unreliable above 9600), and the EPI Jeeni seems to run at
+ 38.4K.
+
+1999-11-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Do not change printing of stack
+ frame info if not running with our interpreter.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * remote-rdi.c (_initialize_remote_rdi): Added the boolean
+ set/show variable rdiromatzero. Should be set to true if the
+ target has ROM at address 0. If true, then gdb will not tell the
+ target to trap fetches to interrupt vectors (which are located at
+ address 0). Using the Angel monitor, attempting to set
+ breakpoints in ROM is an error. Using JTAG debugging of the
+ ARM7TDMI, attempting to set more than two breakpoints in ROM is an
+ error. Default state is false (vectors will be trapped) -- used to
+ be hardwired false.
+
+1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>:
+ * remote-rdi.c (_initialize_remote_rdi): Added the boolean
+ set/show variable rdiheartbeat. This enables or disables ADP
+ link-check "heartbeat" packets sent by the host to the target.
+ Heartbeat packets can cause both the ARM Embedded-ICE and the EPI
+ Jeeni to malfunction: If a heartbeat packet is received by the
+ target while it is sending a packet, that packet will be aborted,
+ and the ADP protocol engine then gets very confused. Default state
+ is off -- used to hardwired on.
+
+1999-10-29 Kevin Buettner <kevinb@cygnus.com>
+
+ * i386-linux-nat.c (dummy_sse_values): Also define for systems
+ without PTRACE_GETXFPREGS.
+
+1999-10-29 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Hardware watchpoint fix from Eli Zaretskii <eliz@gnu.org>:
+
+ * breakpoint.c (insert_breakpoints): Fetch the value of the
+ expression we need to watch. If it's a lazy memory lvalue, then
+ we need to fetch it now, before we start the inferior again.
+ (insert_breakpoints, remove_breakpoint, bpstat_stop_status,
+ can_use_hardware_watchpoint): Only those values representing
+ memory we actually fetched need to be watched.
+
+1999-10-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.h (bpstat_print): Return 'enum print_stop_action',
+ not 'int'.
+
+1999-10-29 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * acconfig.h: Fix entries for HAVE_STRUCT_SAVE_STATE_T,
+ HAVE_STRUCT_MEMBER_SS_WIDE, and HAVE_PTRACE_GETXFPREGS.
+ * config.h.in: Regenerated.
+
+1999-10-28 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Fixes for warnings from Andreas Jaeger <aj@suse.de>.
+ * linux-thread.c (linuxthreads_sig_restart,
+ linuxthreads_sig_cancel, linuxthreads_sig_debug): Add missing
+ initializers to avoid gcc warnings.
+ (resume_thread): Add braces as recommended by gcc -Wparentheses.
+ (stop_thread): Likewise.
+ (linuxthreads_wait): Likewise.
+ (linuxthreads_find_trap): Likewise.
+
+1999-10-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c: Fix typo.
+
+1999-10-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (select_frame_command_wrapper): Fix typo.
+
+ * infcmd.c (interrupt_target_command_wrapper): Wrapper to allow use of
+ static interrupt_target_command outside of file.
+
+ * stack.c (select_frame_command_wrapper): Wrapper to allow use of
+ static select_frame_command outside of file.
+
+1999-10-28 Jim Blandy <jimb@cygnus.com>
+
+ * gdbtypes.c (init_simd_type): The upper bound to
+ create_range_type is inclusive, not exclusive.
+
+ Add preliminary support for the Pentium-III's Streaming SIMD
+ Extensions --- specifically, the ability to read the XMM
+ registers.
+ * Configure.in: Check for PTRACE_GETXFPREGS, and #define
+ HAVE_PTRACE_GETXFPREGS if we have it.
+ * acconfig.h: Add entry for HAVE_PTRACE_GETXFPREGS.
+ * configure, config.in: Regenerated.
+ * config/i386/tm-linux.h (HAVE_SSE_REGS): #define, iff the
+ configure script #defined HAVE_PTRACE_GETXFPREGS.
+ (REGISTER_VIRTUAL_TYPE): Provide the proper types for the pointer
+ registers and the SSE registers.
+ * i386-linux-nat.c (GETREGS_SUPPLIES, GETFPREGS_SUPPLIES,
+ GETXFPREGS_SUPPLIES): New macros.
+ (have_ptrace_getxfpregs): New variable.
+ (FPREGSET_T_FPREG_ADDR): Renamed from FPREGSET_T_FPREG_OFFSET.
+ (supply_fpregset, convert_to_fpregset): Callers changed.
+ (supply_xfpregset, convert_to_xfpregset, fetch_xfpregs,
+ store_xfpregs, dummy_sse_values): New functions.
+ (fetch_inferior_registers, store_inferior_registers): Use the
+ *_SUPPLIES macros to decide how to fetch a given register. Use
+ {fetch,store}_xfpregs and dummy_sse_values to provide access to
+ the SSE registers, on systems where they are present.
+
+1999-10-28 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdbserver/gdbreplay.c (config.h, errno.h): Include.
+ (perror_with_name): Don't declare sys_nerr, sys_errlist, or errno
+ when STDC_HEADERS is defined.
+ * gdbserver/utils.c (STDC_HEADERS): Likewise.
+
+ * gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
+ gdbserver/low-lynx.c, gdbserver/low-sim.c, gdbserver/low-sparc.c,
+ gdbserver/low-sun3.c (my_registers): Declare.
+ (registers): Changed from array type to pointer type in order
+ to match declaration in inferior.h in main gdb sources.
+ * gdbserver/server.h (registers): Likewise.
+ * gdbserver/remote-utils.c (outreg): Removed declaration of
+ registers[].
+
+ * gdbserver/low-linux.c (fetch_register): Changed PTRACE_PEEKUSR to
+ PTRACE_PEEKUSER. [Note the missing 'E'.]
+ (store_inferior_registers): Likewise for PTRACE_POKEUSER.
+
+ * gdbserver/low-linux.c (sys/ptrace.h): Move include to
+ avoid conflict with #defines coming from <sys/user.h>.
+ (sys/reg.h): Only include when HAVE_SYS_REG_H is defined.
+ (PTRACE_XFER_TYPE): Provide a default type in case
+ the target doesn't define it.
+ (fetch_register, read_inferior_memory, write_inferior_memory):
+ Use PTRACE_XFER_TYPE instead of int for ptrace() transfers.
+ (I386_GNULINUX_TARGET): Use #ifdef with this symbol instead
+ of assuming it's an x86 target when it's not a m68k target.
+ (i386_register_raw_size, i386_register_byte): Define these arrays
+ to match other changes that've been occuring to the x86 target
+ in the main gdb sources.
+ (initialize_arch): New (static) function for doing target arch
+ specific initializations.
+
+ * gdbserver/server.h (MAXBUFBYTES, PBUFSIZ): New defines
+ [actually stolen from remote.c].
+ * gdbserver/remote-utils.c (putpkt): Use PBUFSIZ to make
+ sure that buffer is big enough.
+ * gdbserver/server.c (main): Ditto.
+
+ * gdbserver/remote-utils.c (outreg): Allow register numbers
+ bigger than 255.
+ (prepare_resume_reply): Provide alternate mechanism,
+ GDBSERVER_RESUME_REGS, for defining list of registers to send
+ to gdb.
+ * gdbserver/Makefile.in (INTERNAL_CFLAGS): Swapped order of
+ INCLUDE_CFLAGS and BFD_CFLAGS to ensure that gdb's config.h
+ gets found before bfd's config.h. Also added -DGDBSERVER
+ switch.
+ (INCLUDE_CFLAGS): Added -I.. .
+
+1999-10-27 Nick Clifton <nickc@cygnus.com>
+
+ * arm-tdep.c (THUMB_BE_BREAKPOINT): Change to 0xbebe.
+ (THUMB_LE_BREAKPOINT): Change to 0xbebe.
+
+1999-10-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Don't print the arguments
+ during a backtrace.
+ * stack.c (print_frame_info_base): When setting source to 0, save
+ and restore old value. Do this only if source is greater than
+ zero.
+
+Mon Oct 25 18:22:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c: Document future of compare_sections_command.
+ (remote_insert_breakpoint, remote_remove_breakpoint,
+ remote_insert_watchpoint, remote_insert_watchpoint,
+ remote_remove_watchpoint, remote_insert_hw_breakpoint,
+ remote_remove_hw_breakpoint): Use alloca instead of GCC's dynamic
+ array feature.
+
+Mon Oct 25 18:08:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (REGISTER_GDBARCH_SWAP): Define.
+ * gdbarch.sh: Update.
+
+Sat Oct 23 16:39:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (initialize_current_architecture): Make ``choice''
+ const.
+
+1999-10-22 Tom Tromey <tromey@cygnus.com>
+
+ * gdbarch.sh: Updated for gdbarch.[ch] changes.
+ * top.c (gdb_init): Call initialize_current_architecture.
+ * gdbarch.h (initialize_current_architecture): Declare.
+ * gdbarch.c (initialize_current_architecture): New function.
+
+1999-10-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Check for value of source
+ parameter equal to 2, and print address anyway. Set source to 0
+ later, to avoid printing file & line info again.
+
+1999-10-21 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * utils.c (chars_per_line): fix typo in comment.
+
+1999-10-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.h (bp_print_how): New enum, used for deciding how to
+ print bpstat information when we stop, instead of having 3
+ different functions.
+ (struct bpstat): Change print_it field to be an enum instead of a
+ function pointer.
+
+ * breakpoint.c (print_it_typical): New name for print_it_normal().
+ (print_bp_stop_message): New function. High level routine for
+ printing of why we stopped.
+ (bpstat_print): Call print_bp_stop_message instead of using the
+ print_it function pointer.
+ (print_it_done, print_it_noop): Delete these functions.
+
+1999-10-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (print_it_normal): Reorganize into a switch
+ statement.
+
+1999-10-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Makefile.in (event-top.o): Add dependency on target.h.
+ * event-top.c: Make dependency on target.h explicit.
+
+ * breakpoint.c (bpstat_print): Clean up logic. Remove recursion.
+ (catch_exec_command_1): Surround with appropriate ifdef's,
+ to avoid compiler warnings.
+ (catch_fork_command_1): Ditto.
+
+1999-10-20 Jim Blandy <jimb@cygnus.com>
+
+ * Makefile.in (dwarf2read.o): Note that this depends on bfd/elf-bfd.h.
+ (elf_bfd_h): New variable.
+
+1999-10-19 Jim Blandy <jimb@cygnus.com>
+
+ * config/i386/tm-i386.h (REGISTER_NAMES): Change names of FPU
+ instruction and operand pointer registers to improve consistency,
+ following J. T. Conklin's suggestions.
+
+1999-10-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Add printing of list
+ begin and end.
+
+ * breakpoint.h: Change return type of field print_it of struct
+ bpstats to enumeration print_stop_action.
+ Define new enumeration print_stop_action.
+
+ * breakpoint.c (print_it_normal): Change return type to
+ enumeration type print_stop_action. Handle bp_shlib_event here
+ instead of in normal_stop().
+ (bpstat_print): Change return type to enumeration type
+ print_stop_action.
+ (print_it_done): Ditto.
+ (print_it_noop): Ditto.
+
+ * infrun.c (is_internal_shlib_eventpoint): Delete this function.
+ (stopped_for_internal_shlib_event): Delete.
+ (normal_stop): Move logic to handle bp_shlib_event from here to
+ print_it_normal(). Use switch to handle return value from
+ bpstat_print().
+
+Mon Oct 18 17:32:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symfile.c (generic_load): Rewrite. Make the size of each
+ chunk/block write a run-time option. Check for quit_flag.
+ Use target_write_memory_partial for downloads.
+
+1999-10-18 Jim Blandy <jimb@cygnus.com>
+
+ Change Linux x86 register support to use the new tm-i386.h layout.
+ * config/i386/tm-linux.h (HAVE_I387_REGS): #define this, so we get
+ the full set of FP register definitions from tm-i386.h.
+ (REGISTER_RAW_SIZE, REGISTER_NAMES, REGISTER_BYTES, REGISTER_BYTE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, NUM_REGS,
+ NUM_FREGS): Remove #undefs and subsequent redefinitions: we're
+ using the values from tm-i386.h now.
+ (FPSTART_REGNUM, FPCONTROL_REGNUM, FPSTATUS_REGNUM, FPTAG_REGNUM,
+ FPDATA_REGNUM, FPEND_REGNUM, FPENV_BYTES, FPREG_RAW_SIZE,
+ FPREG_BYTES): Deleted.
+ (TARGET_LONG_DOUBLE_BIT): Deleted.
+ (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Redefine these only if LD_I387 is #defined.
+ * i386-linux-nat.c (convert_to_gregset, convert_to_fpregset,
+ FPREGSET_T_FPREG_OFFSET): New functions and macros.
+ (supply_gregset, fill_gregset, supply_fpregset,
+ fill_fpregset, fetch_fpregs, store_fpregs, fetch_regs,
+ store_regs, fetch_inferior_registers, store_inferior_registers):
+ Adjusted to use new macros from tm-i386.h.
+
+ * config/i386/tm-i386.h: Provide a decent x86 FPU description here,
+ so that the various i386 targets can share more FPU handling code.
+ (NUM_GREGS): New macro.
+ (NUM_SSE_REGS): New macro, dependent on HAVE_SSE_REGS
+ (NUM_FREGS): Depend on HAVE_I387_REGS.
+ (NUM_REGS, REGISTER_BYTES): Define in terms of NUM_GREGS,
+ NUM_FREGS, and NUM_SSE_REGS.
+ (MAX_NUM_REGS): New macro.
+ (REGISTER_NAMES): Expand name list with FPU control registers and
+ SSE registers.
+ (FP7_REGNUM, FCTRL_REGNUM, FSTAT_REGNUM, FTAG_REGNUM, FCS_REGNUM,
+ FCOFF_REGNUM, FDS_REGNUM, FDOFF_REGNUM, FOP_REGNUM,
+ FIRST_FPU_CTRL_REGNUM, LAST_FPU_CTRL_REGNUM): New macros, more
+ fully describing the FPU register set.
+ (XMM0_REGNUM, XMM7_REGNUM, MXCSR_REGNUM): New macros, describing
+ the SSE register set.
+ (IS_FP_REGNUM, IS_SSE_REGNUM, FPU_REG_RAW_SIZE, SIZEOF_GREGS,
+ SIZEOF_FPU_REGS, SIZEOF_FPU_CTRL_REGS, SIZEOF_SSE_REGS): New
+ convenience macros.
+ (REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE): Turn
+ these into tables, since the register sizes are pretty irregular.
+ (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New extern declarations.
+ (TARGET_LONG_DOUBLE_BIT): Define.
+ (MAX_REGISTER_RAW_SIZE): Bump to 16, for the SSE registers.
+ (REGISTER_VIRTUAL_TYPE, REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): New macros
+ for handling floating-point registers.
+ (i387_to_double, double_to_i387): New extern declarations.
+ * i386-tdep.c (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New arrays.
+ (_initialize_i386_tdep): Initialize i386_register_byte and
+ i386_register_virtual_size.
+
+ * i386-tdep.c (_initialize_i386_tdep): Move new_cmd to a block
+ created specially for its use.
+
+Mon Oct 18 23:36:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symfile.c (generic_load): Cleanup the validate code - remove
+ #ifdef, use paddr to print address.
+ (validate_download): Static, replace VALIDATE_DOWNLOAD
+
+ * symfile.c (generic_load): Use strtoul to scan the optional load
+ offset. Allocate a filename of the correct size.
+
+Mon Oct 18 17:32:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symfile.c (generic_load): Don't filter output. Use
+ print_transfer_performance for summary. Use paddr for addresses.
+ (print_transfer_performance): New function. Includes write count.
+ (report_transfer_performance): Call
+ print_transfer_performance. Deprecate.
+
+ * defs.h (print_transfer_performance): Add declaration.
+ (generic_load): Move declaration to here.
+ * symfile.h (generic_load): From here.
+
+Mon Oct 18 16:29:52 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * remote.c (remote_write_bytes): Re-write. Transfer a single
+ packet and then return the that packets byte size.
+
+Sun Oct 17 15:09:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_console_output): Flush gdb_stdtarg after
+ processing an ``O'' packet.
+ * remote.h (remote_console_output): Strip PARAMS.
+
+Sun Oct 17 15:12:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.c (target_xfer_memory_partial): New function. Simple
+ implementation of partial memory reads.
+ (target_read_memory_partial): New function. Replaces old
+ target_read_memory_partial.
+ (target_write_memory_partial): New function.
+ * target.h: Update.
+
+ * valprint.c (partial_memory_read): New function, based on old
+ memory_read_partial. Implement partial memory reads the way that
+ val_print_string likes.
+ (val_print_string): Use partial_memory_read.
+
+Sun Oct 17 13:58:56 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (ui_load_progress_hook): Add declaration.
+ * dsrec.c (ui_load_progress_hook): Delete extern declaration.
+
+ * symfile.c (ui_load_progress_hook): Make first argument const.
+ (generic_load): Don't cast the result of bfd_get_section_name.
+ Replace ``sect'' with ``sect_name'', use consistently.
+
+1999-10-15 Jim Blandy <jimb@cygnus.com>
+
+ Add beginnings of support for SIMD register types.
+ * gdbtypes.c (init_simd_type): New function for building
+ types for registers consisting of arrays of objects.
+ (builtin_type_v4sf): New built-in type.
+ (build_gdbtypes): Initialize it.
+ (_initialize_gdbtypes): Arrange for gdbarch swapping.
+ * gdbtypes.h (builtin_type_v4sf): Add external decl.
+
+Fri Oct 15 18:20:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-hms.c: Commented out H8 code.
+
+Fri Oct 15 17:46:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dcache.c (dcache_p): Rename variable remote_dcache. Make
+ static.
+ (_initialize_dcache): Fix description of ``set remotecache''.
+ Cache is OFF by default.
+
+1999-10-13 Jim Blandy <jimb@cygnus.com>
+
+ * valops.c (value_push): Don't forget to initialize container_len.
+
+Wed Oct 13 17:58:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (tui_file_flush): Don't call flush_hook. Don't try to
+ flush ``astring''.
+ * gdb-events.sh: Update
+ * top.c (flush_hook): Delete.
+
+1999-10-13 Kevin Buettner <kevinb@cygnus.com>
+
+ * mem-break.c (memory_insert_breakpoint,
+ memory_remove_breakpoint): Added missing return statements.
+
+Wed Oct 13 20:53:42 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (mem_fileopen, mem_file_delete, mem_file_new,
+ mem_file_rewind, mem_file_put, mem_file_fputs): New functions.
+ * defs.h (mem_fileopen): Declare.
+
+1999-10-13 Kevin Buettner <kevinb@cygnus.com>
+
+ * mem-break.c (default_memory_insert_breakpoint): Renamed from
+ memory_insert_breakpoint.
+ (default_memory_remove_breakpoint): Renamed from
+ memory_remove_breakpoint.
+ (memory_insert_breakpoint, memory_remove_breakpoint,
+ MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT): New
+ wrappers.
+ * target.h (default_memory_remove_breakpoint,
+ default_memory_insert_breakpoint): Added declarations.
+ * gdbarch.sh (MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT):
+ New methods.
+ * gdbarch.h, gdbarch.c (MEMORY_INSERT_BREAKPOINT,
+ MEMORY_REMOVE_BREAKPOINT, gdbarch_memory_insert_breakpoint,
+ gdbarch_memory_remove_breakpoint, set_gdbarch_memory_insert_breakpoint,
+ set_gdbarch_memory_remove_breakpoint) : Generated from gdbarch.sh.
+
+Wed Oct 13 19:15:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h: Remove PARAMS from all declarations. Re-indent. Clean
+ up the gdb_file declarations.
+
+Tue Oct 12 12:19:07 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * i386-linux-nat.c (supply_fpregset, fill_fpregset): copy
+ from/to start of fpregsetp not start of st_space as the first
+ stuff we copy is the FP control registers not the actual FP values.
+
+1999-10-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): Fix gdb invocation of
+ inferior C functions when debugging C++ code.
+ * valops.c (find_overload_match): Ditto.
+ * symtab.c (make_symbol_overload_list): Ditto.
+
+1999-10-11 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * config/pa/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): It's not
+ enough to #define this; you have to give it a non-zero value.
+
+1999-10-11 Jim Blandy <jimb@cygnus.com>
+
+ Fix from Jim Kingdon <kingdon@redhat.com>, with tweaks to make it
+ gdbarch- and bigendian-friendly:
+ * valops.c (PARM_BOUNDARY): If not #defined, default to zero.
+ (value_push): If PARM_BOUNDARY is not zero, align arguments to
+ that boundary.
+ * config/i386/tm-i386.h: Define PARM_BOUNDARY.
+
+Mon Oct 11 14:23:55 1999 Fred Fish <fnf@cygnus.com>
+
+ * config/mips/tm-irix3.h (PS_REGNUM): Don't undef if we aren't
+ going to redefine it to something else.
+
+1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
+
+ * dwarfread.c (read_func_scope): Don't try to set main_func_*;
+ we handle that in blockframe.c:inside_main_func.
+ * dwarf2read.c (read_func_scope): Likewise.
+ (dwarf2_add_field, dwarf2_add_member_fn): Get member function name
+ directly, not from mangled name.
+ (skip_member_fn_name): Lose.
+
+Mon Oct 11 12:24:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (enum serial_rc): Clarify SERIAL_TIMEOUT and
+ restrictions on TIMEOUT in ASYNC mode.
+
+ * serial.c (serial_readchar): Check for invalid timeout when in
+ async mode. Disable test.
+
+Thu Oct 7 17:20:01 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * monitor.c (monitor_printable_string): Add length argument. Don't
+ return final string length.
+ (monitor_printf_noecho, monitor_printf, monitor_expect): Update.
+ (monitor_error): Pass real_len to monitor_printable_string.
+ (monitor_error): Rewrite. Replace printf fmt string parameter with
+ function name and message parameters.
+ (monitor_read_memory_single, monitor_read_memory): Update.
+
+1999-10-07 Stan Shebs <shebs@andros.cygnus.com>
+
+ * main.c (print_gdb_help): Fix bug reporting address.
+ * gnu-regex.h, gnu-regex.c: Ditto.
+
+1999-10-07 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * parse.c (SYMBOLS_CAN_START_WITH_DOLLAR): New macro,
+ whose value can be overridden by target files.
+ (write_dollar_variable): Don't check the symbol table for
+ identifiers beginning with `$' unless
+ SYMBOLS_CAN_START_WITH_DOLLAR is non-zero.
+ * config/pa/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Define.
+ * doc/gdbint.texinfo (SYMBOLS_CAN_START_WITH_DOLLAR): Document.
+
+ Remove all traces of the BINOP_SCOPE operator. It's never
+ generated, and not implemented.
+ * expression.h (enum exp_opcode): Delete BINOP_SCOPE.
+ * c-lang.c (c_op_print_tab): Delete entry for BINOP_SCOPE.
+ * eval.c (evaluate_subexp_standard): Doc fix.
+ * expprint.c (op_name): Remove case for BINOP_SCOPE.
+ (dump_subexp): Same.
+
+ * dwarf2read.c (dwarf2_const_value): Treat DW_FORM_data1,
+ DW_FORM_data2, DW_FORM_data4, and DW_FORM_data8 as signed values,
+ since that's what read_var_value will do anyway.
+
+1999-10-07 Fred Fish <fnf@cygnus.com>
+
+ * objfiles.h (struct objfile): Delete is_solib member, now handled
+ by OBJF_SHARED bit in struct objfile's flags.
+ * objfiles.c (objfile_purge_solibs): Check OBJF_SHARED bit in flags
+ instead of old is_solib int member in objfile struct.
+
+ * objfiles.c (allocate_objfile): Remove is_solib arg. Now passed
+ as a bit in combined flags arg.
+ * symfile.c (symbol_file_add): Ditto.
+ * objfiles.h (allocate_objfile): Adjust prototype after removal
+ of is_solib arg.
+ * symtab.h (symbol_file_add): Ditto.
+
+ * cxux-nat.c (add_shared_symbol_files): Remove zero passed to
+ symbol_file_add in old is_solib arg, defaults to zero now in
+ flags.
+ * irix5-nat.c (symbol_add_stub): Ditto.
+ * remote-mm.c (mm_load): Ditto.
+ * remote-udi.c (udi_load): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * symfile.c (symbol_file_command): Ditto.
+ (add_symbol_file_command): Ditto.
+
+ * coff-solib.c (coff_solib_add): Call symbol_file_add with
+ OBJF_SHARED in flags bit, rather than 1 in old is_solib
+ arg.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * win32-nat.c (handle_load_dll): Ditto.
+
+ * objfiles.c (allocate_objfile): Remove old args "mapped" and
+ "user_loaded". Replaced with new arg "flags" containing specific
+ If global var mapped_symbol_files is nonzero
+ then set OBJF_MAPPED in flags arg. Check for OBJF_MAPPED bit in
+ flags where we used to check mapped arg.
+ Pass flags to open_mapped_file instead of mapped arg.
+ Ensure that OBJF_MAPPED bit is reset in flags when the objfile
+ is not mapped. Add passed flags bits to objfile's flags bits.
+ (open_mapped_file): Replace "mapped" arg with new "flags" arg.
+ Adjust prototype. Pass flags to open_existing_mapped_file.
+ (open_existing_mapped_file): Replace "mapped" arg with new "flags".
+ Check flags for OBJF_MAPPED.
+ * objfiles.h (allocate_objfile): Adjust prototype.
+ * rs6000-nat.c (add_vmap): Pass zero for combined flags, rather
+ than separate zero ints for old "mapped" and "user_loaded" flags.
+ * symfile.c (symbol_file_add): Pass allocate_objfile combined flags
+ rather than individual mapped and user loaded bits.
+
+ * symfile.c (symbol_file_add): Delete user_loaded arg.
+ * symtab.h (symbol_file_add): Adjust prototype for deleted
+ user_loaded arg.
+ * objfiles.h (struct objfile): Delete user_loaded member.
+ (OBJF_USERLOADED): New flag bit to replace user_loaded.
+
+ * symfile.c (symbol_file_command): Add OBJF_USER_LOADED to flags
+ passed to symbol_file_add. Delete previous passing of explicit 1
+ for user_loaded.
+ (add_symbol_file_command): Ditto.
+
+ * coff-solib.c (coff_solib_add): No longer pass zero for user loaded,
+ now defaults to zero in flags.
+ * cxux-nat.c (add_shared_symbol_files): Ditto.
+ * irix5-nat.c (symbol_add_stub): Ditto.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * remote-mm.c (mm_load): Ditto.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * remote-udi.c (udi_load): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * win32-nat.c (handle_load_dll): Ditto.
+
+Thu Oct 7 19:24:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (monitor.o): Allow monitor.o to be compiled with
+ -Werror.
+
+ * monitor.c (monitor_debug_p): New variable. Replaces macro.
+ (EXTRA_RDEBUG): Delete. Update all uses.
+ (monitor_debug): New function. Replaces macro.
+ (RDEBUG): Delete macro. Update all uses.
+ debug output to gdb_stdlog and not the console.
+
+ * monitor.c: Fix printf formating. Replace printf calls with
+ fprintf_unfiltered.
+
+1999-10-06 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: Switch ARM target maintenance from Elena
+ Zannoni to Jim Ingham.
+
+1999-10-06 Frank Ch. Eigler <fche@cygnus.com>
+
+ * remote.c (hexnumnstr): New function. Allow setting of width.
+ (hexnumstr): Call the above.
+ (remote_write_bytes): Fill in X-protocol address field more
+ reliably.
+
+1999-10-06 Fred Fish <fnf@cygnus.com>
+
+ * xcoffread.c (xcoff_symfile_offsets): Fix typo, addr->addrs.
+
+1999-10-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (handle_remote_sigint_twice): Make this signal be
+ handled by inferior_event_handler, via the wrapper function.
+ (async_remote_interrupt_twice): Make not static. Add debug print.
+ * remote.h (async_remote_interrupt_twice): Export for use in
+ inf-loop.c.
+
+ * inf-loop.c (inferior_event_handler_wrapper): New function.
+ (inferior_event_handler): Handle a request to quit and kill the
+ target.
+ Include remote.h.
+ * inf-loop.h (inferior_event_handler_wrapper): Export.
+
+1999-10-04 James Ingham <jingham@leda.cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): If the angel_RDI_Open fails, close
+ the serial port and raise an error. If you try to go on, you will
+ stall forever down in the rdi-share code.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * printcmd.c (output_command): Makes sure result from the output
+ command is printed before the next prompt.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * printcmd.c (print_formatted): Add missing stream parameter.
+ (do_examine, print_command_1, output_command, do_one_display):
+ Adjust call to print_formatted().
+
+1999-10-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c: Remove include of event-loop.h.
+ * utils.c: Ditto.
+ * top.c: Ditto.
+
+ * infrun.c (fetch_inferior_event): Call inferior_event_handler
+ when inferior stops, instead of doing work ourselves.
+ (fetch_inferior_event): Use void* instead of gdb_client_data.
+ Remove includes of event-top.h and event-loop.h. Add include of
+ inf-loop.h.
+ (complete_execution): Move from here.
+
+ * inf-loop.c (complete_execution): To here.
+ (inferior_event_handler): Handle inferior's execution completion
+ case as well.
+ * inf-loop.h: Add def of INF_LOOP_H.
+
+ * event-top.h: Don't use gdb_client_data, use void*, to avoid
+ dependency on event-loop.h.
+
+ * remote.c (remote_async_resume): Set target_executing only after we
+ actually register the inferior with the event loop.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * corefile.c (memory_error): Use error_stream() and eliminate call
+ to return_to_top_level().
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * utils.c (error): Save error message text (w/o new line).
+ (error_last_message): New function. Returns the last message
+ issued by gdb.
+ (error_init): New function. Initializes error handling machinery.
+ (error_stream): New function. Allows the error message to be
+ passed on a stream buffer.
+ * defs.h: Add prototypes for error_stream() and
+ error_last_message().
+ * main.c (main): Add call to error_init().
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_get_type): Call tui_sfileopen() instead of
+ deprecated gdb_file_init_astream().
+ (c_value_of_variable): Ditto.
+ * ui-out.c (ui_out_stream_new): Ditto.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * utils.c (tui_sfileopen): New function. Replaces
+ gdb_file_init_astring().
+ * defs.h: Add prototype for the above.
+
+Mon Oct 4 19:25:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symfile.c (add_symbol_file_command): Fix -Wformat on query call.
+
+1999-10-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * target.c (cleanup_target): Type of to_async param is now
+ function with enum inferior_event_type param.
+
+ * target.h (target_ops): Adjust to_async accordingly. Move enum
+ inferior_event_type to this file. Don't have a typedef for
+ inferior_event_type. Add more enumeration constants INF_QUIT_REQ,
+ INF_EXEC_COMPLETE. Remove INF_SIGINT_FIRST, INF_SIGINT_SECOND.
+
+ * inf-loop.c (inferior_event_handler): Change first param to tell
+ the type of event we are dealing with. Deal with INF_ERROR and
+ INF_REG_EVENT, for the moment.
+ Include target.h.
+
+ * inf-loop.h (inferior_event_handler): Adjust prototype. Remove
+ enum inferior_event_type from here.
+
+ * remote.c (remote_async_serial_handler): Pass INF_REG_EVENT to
+ the client callback.
+ (remote_async): Change callback's param type to inferior_event_type.
+ (async_client_callback): Change type as above.
+
+1999-10-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (stdin_event_handler): Delete fd parameter, use
+ input_fd instead.
+ * event-top.h (stdin_event_handler): Delete fd parameter.
+
+ * inf-loop.c (inferior_event_handler): Delete fd parameter. Use
+ target_async() to unregister the inferior fd in case of errors.
+ * inf-loop.h(inferior_event_handler): Delete fd parameter.
+
+ * ser-unix.c (fd_event): Delete fd parameter. Use scb->fd,
+ instead.
+
+ * remote.c (async_client_callback): Delete fd parameter.
+ (remote_async_serial_handler): Ditto.
+ (remote_async): Adjust to new type of callback function.
+
+ * target.c (cleanup_target): Adjust parameters for to_async
+ default case.
+ * target.h (*to_async): Delete fd parameter from cb function.
+
+ * event-loop.h (handler_func): Delete fd parameter.
+ * event-loop.c (handle_file_event): Delete fd param from call to
+ proc. Do not include inferior.h.
+
+1999-10-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (inferior_event_handler,
+ inferior_event_handler_wrapper): Move from here.
+ * inf-loop.c: To here. New file.
+
+ * event-loop.h (inferior_event_handler): Move from here.
+ * inf-loop.h: To here. New file.
+
+ * remote.c: Include inf-loop.h.
+ (set_extende_protocol): Remove unused prototpye.
+
+ * Makefile.in (SFILES): Add inf-loop.c.
+ (inf_loop_h): Define.
+ (COMMON_OBS): Add inf-loop.o.
+ (inf-loop.o): Add rule.
+ (remote.o): Add dependency on inf-loop.h.
+
+Fri Oct 1 19:59:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-unix.c: Add some notes on how the async code works.
+
+Fri Oct 1 01:45:32 1999 Jeffrey A Law (law@cygnus.com)
+
+ * somread.c (som_symfile_offsets): Fix typo in last change.
+
+1999-09-30 Fred Fish <fnf@cygnus.com>
+
+ * coff-solib.c (coff_solib_add): Adjust call to symbol_file_add.
+ * cxux-nat.c (add_shared_symbol_files): Ditto.
+ * irix5-nat.c (symbol_add_stub): Ditto.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * remote-mm.c (mm_load): Ditto.
+ * remote-udi.c (udi_load): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * win32-nat.c (handle_load_dll): Ditto.
+
+ * irix5-nat.c (symbol_add_stub): Add section_addrs, zero it.
+ * cxux-nat.c (add_shared_symbol_files): Ditto.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * symfile.c (symbol_file_command): Ditto.
+ * win32-nat.c (handle_load_dll): Ditto.
+
+ * irix5-nat.c (symbol_add_stub): Use section_addrs to pass text addr.
+ * cxux-nat.c (add_shared_symbol_files): Ditto.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+ * symfile.c (symbol_file_command): Ditto.
+ * win32-nat.c (handle_load_dll): Ditto.
+
+ * coff-solib.c (coff_solib_add): Call symbol_file_add with NULL ptr.
+ * cxux-nat.c (add_shared_symbol_files): Ditto.
+ * remote-udi.c (udi_load): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * symfile.c (symbol_file_command): Ditto.
+
+ * dstread.c (dst_symfile_offsets): Take "section_addr_info *"
+ instead of CORE_ADDR.
+ * somread.c (som_symfile_offsets): Ditto.
+ * symfile.c (default_symfile_offsets): Ditto.
+ * xcoffread.c (xcoff_symfile_offsets): Ditto.
+
+ * symfile.h (default_symfile_offsets): Adjust prototype.
+ (syms_from_objfile): Ditto.
+ * symtab.h (symbol_file_add): Ditto.
+
+ * rs6000-nat.c (objfile_symbol_add): Call syms_from_objfile with NULL.
+ * xcoffsolib.c (solib_add): Ditto.
+ * gdb-stabs.h (SECT_OFF_MAX): Increase from 4 to 16.
+ * symtab.h (MAX_SECTIONS): Define.
+ (struct section_addr_info): New struct for better control over
+ changing load addresses of sections.
+ * objfiles.h (OBJF_READNOW): Add new flag bit.
+ * symfile.h (sym_offsets): Change second param from CORE_ADDR to
+ "section_addr_info *".
+
+ * symfile.c (symbol_file_add): Replace scalar arg "CORE_ADDR addr"
+ with "struct section_addr_info *addrs".
+ (syms_from_objfile): Ditto.
+ (add_symbol_file_command): Remove local variables "readnow" and
+ "mapped". Replaced with general "flags" variable.
+ (symbol_file_command): Ditto.
+ (add_symbol_file_command): Add local variables i, sec_num, argcnt,
+ expecting_option, option_index, and opt. Rework option parsing code
+ to handle additional options.
+ (_initialize_symfile): Adjust add-symbol-file usage to match new
+ option handling.
+ (symbol_file_add): Remove parameters "mapped" and "readnow",
+ replace with general "flags".
+ (symbol_file_add): In call to allocate_objfile, replace "mapped"
+ with extracted OBJF_MAPPED bit from flags.
+ (symbol_file_add): Use OBJF_READNOW bit from flags, instead of
+ "readnow" variable.
+ (symbol_file_command): Set OBJF_MAPPED and OBJF_READNOW bits
+ from parsed options. Pass flags to symbol_file_add.
+ (add_symbol_file_command): Ditto.
+ (syms_from_objfile): Add local variables i, sect, lower_sect,
+ lower_offset, and local_addr. Substitute local_addr for addrs
+ when addrs is NULL. Find lowest loadable section to be used as
+ starting point for contiguous sections. Adjust offsets if segments
+ are not contiguous. Call sym_offsets with section_addr_info
+ instead of single addr.
+ (default_symfile_offsets): Initialize objfile's section_offsets
+ with user specified offsets.
+ (symbol_file_add): Call syms_from_objfile with offsets.
+ (unknown_option_complaint): Add.
+ (add_symbol_file_command): Add "section_addrs", zero it with memset.
+
+1999-09-30 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Call config.sub explicitly instead of misusing the
+ autoconf internal variable $ac_config_sub.
+ * configure: Regenerated.
+
+Thu Sep 30 15:53:59 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (readchar): When EOF mourn the inferior.
+ (getpkt): Try QUIT. Might not be a watchdog timer timeout.
+ (remote_async_serial_handler): Pass ``-1'' as the dummy FD. Safer
+ than ZERO == STDIN.
+
+ * serial.h (enum serial_rc): Replace #define SERIAL_ERROR,
+ SERIAL_TIMEOUT and SERIAL_EOF.
+ (struct _serial_t): Add more notes on termios specific fields.
+
+ * ser-unix.c (generic_readchar): Make SERIAL_ERROR sticky.
+ (do_hardwire_readchar, do_unix_readchar): Don't use bufcnt as a
+ tempoary for the return-value from read.
+
+ * serial.c (serial_logchar): Add a stream parameter.
+ (serial_readchar, serial_write, serial_send_break): Update.
+ (serial_readchar): Add serial debug trace.
+
+Thu Sep 30 12:07:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (struct _serial_t): Add field async_state. Better
+ document field bufcnt.
+ (SERIAL_ERROR): Delete comment about errno.
+ * serial.c (serial_open, serial_fdopen): Initialize async_state.
+
+ * ser-unix.c (push_event, fd_event, reschedule): New functions.
+ Handle ASYNC serial input.
+ (ser_unix_async): Update.
+ (generic_readchar): New function. Handle event scheduling. Make
+ EOF condition sticky.
+ (do_unix_readchar): Rename ser_unix_readchar.
+ (ser_unix_readchar): New function, call do_unix_readchar via
+ generic_readchar.
+ (do_hardwire_readchar, hardwire_readchar): Ditto.
+
+ * ser-unix.c (ser_unix_readchar): Delete code working around ASYNC
+ fifo bugs.
+ (hardwire_readchar): Delete code working around ASYNC fifo bugs.
+
+Wed Sep 29 21:27:16 1999 Jeffrey A Law (law@cygnus.com)
+
+ * breakpoint.c (insert_breakpoints): Addresses are CORE_ADDRs,
+ not "int"s.
+ (remove_breakpoint): Likewise.
+
+1999-09-29 Fred Fish <fnf@cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Replace cast "(CORE_ADDR) - 1"
+ with the more obviously intended expression "(CORE_ADDR) -1".
+ * dwarf2read.c (scan_partial_symbols, read_file_scope): Ditto.
+ * gnu-nat.c (gnu_create_inferior): Ditto.
+ * go32-nat.c (go32_create_inferior): Ditto.
+ * hppa-tdep.c (hppa_pop_frame): Ditto.
+ * infcmd.c (continue_command, step_1, signal_command): Ditto.
+ (until_next_command, finish_command): Ditto.
+ * infrun.c (proceed): Ditto.
+ * inftarg.c (child_create_inferior): Ditto.
+ * m3-nat.c (m3_create_inferior): Ditto.
+ * mac-nat.c (child_create_inferior): Ditto.
+ * procfs.c (procfs_create_inferior): Ditto.
+ * remote-sim.c (gdbsim_create_inferior): Ditto.
+ * target.c (target_link): Ditto.
+ * win32-nat.c (child_create_inferior): Ditto.
+ * varobj.c (varobj_create, new_root_variable): Ditto.
+
+Thu Sep 30 10:36:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-unix.c (ser_unix_flush_input): New function. Discard input
+ buffer.
+ (hardwire_flush_input): Use ser_unix_flush_input.
+ (ser_unix_nop_flush_input): Delete.
+ * ser-unix.h (ser_unix_flush_input): Update.
+ ser-tcp.c (_initialize_ser_tcp), ser-pipe.c
+ (_initialize_ser_pipe): Update.
+
+ * ser-unix.c (hardwire_write): Delete.
+ (_initialize_ser_hardwire): Update, use ser_unix_write.
+
+Thu Sep 30 10:16:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c (pipe_open): Don't make the FD non-blocking. Already
+ being handled in ser_unix_wait_for by a select.
+
+Thu Sep 30 10:00:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (struct _serial_t): Add field debug_p.
+ (SERIAL_DEBUG, SERIAL_DEBUG_P): Define.
+
+ * serial.c (serial_open, serial_fdopen): Initialize debug_p.
+ (serial_debug, serial_debug_p): New functions.
+ (global_serial_debug_p): New variable.
+ (_initialize_serial): Add ``set serialdebug'' command.
+
+Thu Sep 30 09:09:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (serial_event_ftype): Replace FD and ERROR args with
+ SERRIAL_T arg.
+ * ser-unix.c (ser_unix_event): Update.
+
+ * remote.c (remote_async_serial_handler): New function. Handle
+ serial events.
+ (remote_async): Pass remote_async_serial_handler to SERIAL.
+ (async_client_callback, async_client_context): New variables.
+
+ * remote.c (extended_remote_async_create_inferior): Use
+ target_async to register the inferior event handler.
+
+Thu Sep 30 00:02:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_CHECK_FUNCS): Test for sigprocmask.
+ * configure, config.in: Re-generate.
+ * event-top.c (async_stop_sig): Use sigprocmask when available.
+
+1999-09-29 Doug Evans <devans@casey.cygnus.com>
+
+ * sh-stub.c (handle_exception): Fix typo in patch of 1999-08-26.
+ * m68k-stub.c (handle_exception): Ditto.
+
+1999-09-28 Fred Fish <fnf@cygnus.com>
+
+ * alpha-nat.c (alpha_osf_core_fns, alpha_elf_core_fns):
+ Add default entries for check_format and core_sniffer.
+ * core-aout.c (aout_core_fns): Ditto.
+ * core-regset.c (regset_core_fns): Ditto.
+ * core-sol2.c (solaris_core_fns): Ditto.
+ * i386aix-nat.c (i386aix_core_fns): Ditto.
+ * i386mach-nat.c (i386mach_core_fns): Ditto.
+ * irix4-nat.c (irix4_core_fns): Ditto.
+ * irix5-nat.c (irix5_core_fns): Ditto.
+ * lynx-nat.c (lynx_core_fns): Ditto.
+ * mips-nat.c (mips_core_fns): Ditto.
+ * ns32knbsd-nat.c (nat_core_fns): Ditto.
+ * rs6000-nat.c (rs6000_core_fns): Ditto.
+ * sparc-nat.c (sparc_core_fns): Ditto.
+ * sun-nat.c (sun3_core_fns): Ditto.
+ * ultra3-nat.c (ultra3_core_fns): Ditto.
+
+ * corelow.c (core_vec): New, for selected core file handler.
+ (sniff_core_bfd): New function.
+ (gdb_check_format): New function.
+ (default_check_format): New function.
+ (default_core_sniffer): New function.
+ (sniff_core_bfd): New function.
+ (core_close): Reset core_vec to NULL.
+ (core_open): Fall back to gdb_check_format if bfd_check_format
+ does not identify the file format. Call sniff_core_bfd to pick
+ a core file handler.
+ (get_core_registers): Remove code that is now in sniff_core_bfd.
+ Use current core_vec.
+
+ * gdbcore.h (check_format): New core_fns function, points to function
+ to try and identify a core file format.
+ (core_sniffer): New core_fns function, points to function to select
+ a specific handler for the selected core file format.
+ (default_core_sniffer): Add prototype.
+ (default_check_format): Add prototype.
+
+ * i960-tdep.c (inferior.h): Include.
+ * mips-tdep.c (read_next_frame_reg): Use ADDR_BITS_REMOVE
+ on addresses pulled from stack.
+
+1999-09-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (poll_timers): Check whether the timer list has any
+ element on it by looking at the first element pointer, instead of
+ num_timers.
+
+Wed Sep 29 18:02:31 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * command.c: Attempt to include POSIX <sys/wait.h> before
+ <wait.h>.
+
+ * ser-unix.c (hardwire_print_tty_state): Ditto.
+ * inflow.c (child_terminal_info): Fix printf args.
+
+1999-09-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (remote_async_resume): Register the inferior with the
+ event loop.
+ (remote_async_open_1): Don't put the target in async mode here,
+ just do it when executing.
+
+ * infrun.c (complete_execution): Unregister the inferior from the
+ event loop.
+
+ * event-top.c (async_disable_stdin): Don't add
+ async_enable_stdin() to the exec_cleanups chain.
+
+Tue Sep 28 11:08:34 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Ignore IMPORT_SHLIB stubs
+ except for hpux11 native. Break out of the loop to find a
+ stub as soon as we find an IMPORT stub.
+ (skip_prologue_hard_way): Also recognize copy %ret1,target and
+ all PA64 argument stores as prologue instructions.
+
+1999-09-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c, defs.h, event-top.c, infcmd.c, infrun.c, main.c,
+ remote.c, top.c, tracepoint.c, utils.c (async_p): Change var name
+ to event_loop_p.
+
+1999-09-28 Jim Blandy <jimb@cygnus.com>
+
+ * hppa-tdep.c (skip_prologue_hard_way): Recognize ldo insns
+ which generate pointers into the argument list.
+
+Tue Sep 28 13:56:49 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.h (cleanup_sigint_signal_handler,
+ initialize_sigint_signal_handler): Delete extern declarations.
+ * event-top.c, infrun.c: No longer need to include "remote.h".
+ * remote.c (cleanup_sigint_signal_handler,
+ initialize_sigint_signal_handler): Make static.
+ * Makefile.in (event-top.o): Delete dependency on "remote.h".
+
+ * remote.c (remote_async_terminal_ours_p): New static global. Keep
+ track of who currently owns the terminal.
+ (remote_async_open_1): Initialize.
+ (remote_async_terminal_inferior): Test
+ remote_async_terminal_ours_p. Claim CNTRL-C handler as part of
+ transfering the terminal to the target.
+ (remote_async_terminal_ours): Similar.
+
+Mon Sep 27 12:33:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (async_interrupt_query): Delete function. Merged into
+ interrupt_query. Async cases handled by target_terminal_ours,
+ target_terminal_inferior and SERIAL_CLOSE.
+ (async_remote_interrupt_twice): Update.
+ (remote_async_terminal_ours, remote_async_terminal_inferior): New
+ functions. Steal STDIN from GDB's CLI.
+ (init_remote_async_ops): Initialize to_terminal_ours and
+ to_terminal_inferior.
+
+ * event-top.c (async_disable_stdin, async_disable_stdin): Use
+ target_terminal_ours / target_terminal_inferior to transfer
+ ownership of the terminal between GDB and the target.
+
+1999-09-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (run_command): Call async_disable_stdin() only if
+ dealing with an asynchronous target.
+
+Mon Sep 27 11:48:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.h (struct target_ops): Add to_can_async_p, to_is_async_p,
+ to_async. Delete to_has_async. These correspond well with
+ SERIAL* async methods.
+ (target_can_async_p, target_is_async_p, target_async): Define.
+ * target.c (update_current_target, cleanup_target): Update.
+
+ * remote.c (remote_async_open_1): Change target to async using
+ target_async.
+ (remote_can_async_p, remote_is_async_p, remote_async): New
+ functions.
+ (remote_async_wait, remote_async_open_1): Add FIXME about how
+ wait_forever_enabled_p can almost be deleted once the client can
+ enable/disable target_async.
+
+ * breakpoint.c (until_break_command), infrun.c (proceed), infcmd.c
+ (run_command, continue_command, step_1, jump_command,
+ until_command, finish_command, interrupt_target_command), top.c
+ (return_to_top_level, execute_command), event-top.c
+ (command_handler): Replace target_has_async with
+ target_can_async_p.
+
+Sun Sep 26 02:10:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_async_open_1): If we go into async mode, never
+ wait for ever.
+
+ * infcmd.c: Include "event-top.h".
+ (run_command, continue_command, jump_command, until_command,
+ finish_command): Use async_disable_stdin to disable the console
+ for synchronous commands.
+
+ * remote.c (async_interrupt_query): Only disconnect the console
+ from the terminal when sync_execution.
+
+ * remote.c (initialize_sigint_signal_handler): Move declaration
+ from here.
+ * remote.h: To here. Make non-static.
+
+ * remote.c (remote_async_resume, async_interrupt_query): Move
+ prompt code from here.
+ * event-top.c (async_disable_stdin, async_enable_stdin): To
+ here. New function.
+
+ * infrun.c (start_remote): Delete commented out code.
+
+Fri Sep 24 12:38:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_async_open_1): Perform the initial async_open
+ using only synchronous calls. Only after the target is fully
+ connected, switch to async mode. Include FIXME about now it
+ currently works VS how it should be working.
+ (remote_async_open_1, set_extended_protocol): Delete function
+ set_extended_protocol. All open communication is now done
+ synchronously.
+ (forever_enabled_p): New variable. Determine if remote_async_wait
+ should block FOREVER when fetching target information.
+ (remote_cisco_open, remote_open_1): Set forever_enabled_p.
+
+ * infrun.c (start_remote): During the initial connect, always use
+ a synchronous wait.
+
+Sat Sep 25 18:13:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (event-top.o): Add dependency.
+ * event-top.c: Include "remote.h".
+ * remote.c (async_interrupt_query), event-top.c:
+ (async_enable_stdin): Pass dummy parameter to
+ cleanup_sigint_signal_handler.
+ * remote.c (cleanup_sigint_signal_handler), remote.h
+ (cleanup_sigint_signal_handler), event-top.c (async_enable_stdin),
+ event-top.h (async_enable_stdin): Change signature to match
+ make_exec_error_cleanup handler pararameter.
+
+Thu Sep 23 20:48:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (enum command_class): Move from here.
+ * command.h (command_class): To here.
+
+1999-09-24 Kevin Buettner <kevinb@cygnus.com>
+ * breakpoint.c (bpstat_stop_status): Use not_a_breakpoint to
+ help properly set bp_addr.
+ * infrun.c (handle_inferior_event): Simplify calls to
+ bp_stop_status.
+
+1999-09-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (return_to_top_level): Do exec_error cleanups if are
+ interrupting a simulated synchronous execution command.
+
+ * infrun.c (start_remote): Create a cleanup to enable stdin in
+ case of error from this command.
+ (complete_execution): Do the enabling of stdin via the exec_error
+ cleanups, when needed.
+
+ * remote.c (remote_async_resume): Make sure we re-enable stdin in
+ case of error from the target.
+ (handle_remote_sigint_twice): The handler to be set is
+ async_remote_interrupt_twice, not async_remote_interrupt.
+ (async_remote_interrupt_twice): Don't do anything if the target
+ has been killed already. Call async_interrupt_query, instead of
+ interrupt_query.
+ (async_interrupt_query): New function. Async case of
+ interrupt_query().
+
+ * event-top.c (async_enable_stdin): New function. Reinstate stdin
+ with the event loop.
+ * event-top.h (async_enable_stdin): Export.
+
+ * utils.c (exec_error_cleanup_chain): New cleanup chain.
+ (make_exec_error_cleanup, do_exec_error_cleanups,
+ discard_exec_error_cleanups): New functions.
+ * defs.h (make_exec_error_cleanup, do_exec_error_cleanups,
+ discard_exec_error_cleanups): Export.
+
+1999-09-24 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (expr_to_agent): Don't forget to pass argument to
+ new_agent_expr.
+
+1999-09-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (fetch_inferior_event_wrapper): New
+ function. Wrapper to pass to catch_errors.
+ (inferior_event_handler): Pop the target if things go bad with it.
+ Call fetch_inferior_event() from within catch_errors().
+
+1999-09-24 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c: Use internal_error instead of error, where
+ appropriate.
+
+1999-09-23 James Ingham <jingham@leda.cygnus.com>
+
+ * target.c (target_resize_to_sections): New function. Gather the
+ resizing code for the to_sections field into one place, and make
+ sure you update the other targets that are sharing the to_sections
+ structure.
+ * target.h: Declare the target_resize_to_sections function.
+ * solib.c (solib_add): use target_resize_to_sections.
+ * somsolib.c (som_solib_load_symbols): ditto
+ * rs6000-nat.c (xcoff_relocate_core): ditto
+ * pa64solib.c (pa64_solib_load_symbols): ditto
+ * irix5-nat.c (solib_add):ditto
+
+ * top.c: Define the attach & detach hooks
+ * defs.h: Declare the attach & detach hooks.
+ * infcmd.c (attach_command): call the attach hook if it exists.
+ (detach_command): call the detach hook if it exists.
+
+ * complaints.c (complain): Send the complaints to stderr rather
+ than stdout, so they don't get mixed into the result stream from
+ commands.
+
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_set_value): Fix handling of baseclasses and
+ correct the behavior when it is not a baseclass (both cases were
+ dumping core).
+
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Fix setting of child error field.
+
+1999-09-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (poll_timers): Use correct timeval field names,
+ when setting the notifier timeouts, in case of select() used.
+ (gdb_wait_for_event): Pass a pointer to the timeout structure to
+ select(), not the structure.
+
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_gen_name): Dynamically allocate variable object
+ name string.
+ (varobj_update): Fix creation of result list.
+
+Wed Sep 22 10:35:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (init.c): Change generated file to include "defs.h"
+ and "call-cmds.h". Use initialize_file_ftype when declaring
+ each initialize functions.
+ (call_cmds_h): Add definition.
+ (init.o): Add target and dependencies.
+ (init.c): Don't grep for _initialize* in init.c.
+
+ * defs.h (initialize_file_ftype): Add function typedef.
+
+1999-09-22 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * procfs.c (init_procinfo): move fltset initialization to caller.
+ (do_attach, create_procinfo): initialize fltset.
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (_initialize_varobj): Rename varobjdebug to debugvarobj
+ to avoid conflict with "set var".
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_get_type, c_value_of_variable): Remove
+ dependency on ui_out.[ch].
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Fix order in which changed variables
+ are reported to match that of the old code.
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (type_changeable): Fix for testsuite case 2.12. Do not
+ report as changed a structure when one of it's children has changed.
+ (get_type, get_type_deref): Remove uneeded initialization.
+
+1999-09-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c, event-top.c, event-loop.h: Rerun indent.
+
+1999-09-21 Doug Evans <devans@casey.cygnus.com>
+
+ * m32r-stub.c (handle_exception): Fix typo in patch of 1999-08-26.
+
+1999-09-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (_initialize_varobj): Add set/show for varobjdebug.
+ (uninstall_variable): Test for varobjdebug before printing trace
+ and send it to gdb_stdlog.
+
+1999-09-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_type_of_child): Fix missing break, improve comment
+ and add warning.
+ (c_number_of_children): Add comment.
+
+Tue Sep 21 14:55:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 1999-08-20 J.T. Conklin <jtc@redback.com>:
+ * remote.c (read_frame): expand cisco run-length encoding variant
+ inline as is done for the standard encoding.
+ (remote_cisco_expand): Removed.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Test for illegal invocation for
+ non-root variable object.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (my_value_equal): Style. Eliminate side-effects.
+ (varobj_update): Adjust calls to reflect the above change.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_value_of_variable): Fix return value for struct
+ members when parent is a invalid pointer.
+
+1999-09-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c: Include <sys/time.h>.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (cplus_number_of_children): Coding style improvement.
+ (cplus_value_of_child): Ditto.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_name_of_child): Add missing default clause in switch
+ statement.
+ (c_type_of_child): Ditto.
+ (varobj_set_value): Test for NULL type.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_set_value): Wrap call to evaluate_expression.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (format_string[]): Remove unused variable(s).
+ (varobj_set_value): Ditto.
+ (c_value_of_root): Ditto.
+ (cplus_value_of_child): Ditto.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c: Add missing header file include.
+ (new_variable, new_root_variable): Fix prototype and header.
+ (_initialize_varobj): Add prototype.
+
+1999-09-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * ser-ocd.c: (ser_ocd_open, ser_ocd_raw, ser_ocd_readchar,
+ ser_ocd_setbaudrate, ser_ocd_write, ser_ocd_close,
+ ser_ocd_get_tty_state, ser_ocd_set_tty_state): Remove unused
+ prototypes.
+ (ocd_readremote): Remove.
+ (ocd_write): Remove unused var 'c'.
+
+1999-09-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (change_line_handler): Cleanup dead code. Add comments.
+ * event-loop.c: Cleanup #if 0 code.
+
+ * event-loop.h (timer_handler_func): New function type.
+ (create_timer): Export function.
+ (delete_timer): Export function.
+
+ * event-loop.c: Add timeout and timeout_valid fields to
+ gdb_notifier. New structures gdb_timer and timer_list.
+ (gdb_do_one_event): Check whether there are any timers tht are
+ ready, before going to wait.
+ (gdb_wait_for_event): If the timeout structure is meaningful, pass
+ that to select()/poll().
+ (create_timer): New function. Creates a timer.
+ (delete_timer): New function. Deletes a timer.
+ (handle_timer_event): New function. Deals with timers that are ready.
+ (poll_timers): New Function. Chack whether timers have expired.
+
+Mon Sep 20 17:00:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (getpkt, putpkt, remote_console_output): Move
+ declaration from here.
+ * remote.h: To here. New file.
+ * tracepoint.c(putpkt, getpkt, remote_console_output): Delete
+ declarations. Moved to "remote.h".
+ * Makefile.in (remote_h): Define.
+ * remote.c, tracepoint.c: Include "remote.h".
+ * Makefile.in (tracepoint.o, remote.o): Add dependency on
+ "remote.h".
+
+ * remote.h (remote_cisco_objfile_relocate,
+ cleanup_sigint_signal_handler): Add declaration. Include FIXME.
+ * infrun.c: Include "remote.h".
+ (complete_execution): Delete local extern declaration
+ of ``cleanup_sigint_signal_handler''.
+ * Makefile.in (infrun.o): Add dependency on remote.h.
+
+Mon Sep 20 16:15:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (ui_out_test_flags): Add missing declaration.
+
+Mon Sep 20 13:41:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * kod.c (ecos_kod_open, ecos_kod_request, ecos_kod_close,
+ cisco_kod_open, cisco_kod_request, cisco_kod_close): Move
+ declarations from here.
+ * kod.h: To here. New file.
+ * kod-cisco.c, kod.c: Include "kod.h".
+ * Makefile.in (kod-cisco.o, kod.o): Add dependency on "kod.h".
+
+ * kod.h (kod_display_callback_ftype, kod_query_callback_ftype):
+ New function types.
+ * kod.h (kod_cisco_open): Use in declaration.
+ * kod.c (gdb_kod_open): Update definition.
+ * kod-cisco.c (cisco_kod_open): Update definition.
+
+Mon Sep 20 12:13:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration.
+
+ * breakpoint.c (until_break_command_continuation): Add
+ declaration. Make static.
+ * event-top.c (rl_callback_read_char_wrapper): Ditto.
+
+Mon Sep 20 10:54:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (varobj.o): Disable warnings. Currently
+ work-in-progress.
+
+Fri Sep 17 19:28:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * source.c: Include "source.h".
+ (open_source_file, find_source_lines): Move declaration from here.
+ * source.h: New file. To here.
+ * Makefile.in (source.o): Add dependency on source.h.
+
+ * breakpoints.c (delete_command): Move declaration from here.
+ * breakpoints.h (delete_command): To here.
+
+1999-09-18 Jim Blandy <jimb@cygnus.com>
+
+ * hppa-tdep.c (in_solib_call_trampoline): If we can't recognize
+ the instruction we're at, we're not in a stub.
+
+Sat Sep 18 07:13:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * dwarf2read.c (dwarf_decode_lines): Correctly handle
+ DW_LNS_const_add_pc.
+
+1999-09-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (remote_async_open_1): Use inferior_event_handler to
+ handle inferior events.
+ (extended_remote_async_create_inferior): Ditto.
+
+ * serial.h (serial_event_ftype): Add two pars.
+
+ * ser-unix.c (ser_unix_event): Add two parameters, error and fd.
+ Pass those into the call to the actual inferior event handler.
+
+ * infrun.c (complete_execution): Stdin handler is stdin_event_handler.
+
+ * event-top.h (stdin_event_handler): Export new function.
+
+ * event-top.c (stdin_event_handler): New function. Smarter handler
+ for events on stdin.
+ (change_line_handler): Don't need to update the handler for stdin
+ here anymore.
+ (_initialize_event_loop): Stdin handler is now stdin_event_handler.
+
+ * event-loop.h: (handler_func): Change signature, adding two new
+ args.
+ (sig_handler_func): New function type. It is the old handler_func.
+ (create_async_signal_handler): Update to use sig_handler_func.
+ (delete_async_signal_handler): Prototype for new function.
+
+ * event-loop.c: Include "inferior.h".
+ (struct file_handler): Add field error, to indicate error
+ condition on fd.
+ (struct async_signal_handler): Rename type of proc field.
+ (add_file_handler): Add exception condition as something select()
+ should report.
+ (handle_file_event): In case of error on the fd, record this in
+ the file_handler structure. Update call to (*proc)() to match new
+ signature.
+ (gdb_wait_for_event): If select() or poll() return error, report
+ this to user.
+ (create_async_signal_handler): Change first param type to
+ sig_handler_func*.
+ (inferior_event_handler): New function. Smarter inferior event
+ handling.
+
+1999-09-18 Jim Blandy <jimb@cygnus.com>
+
+ * pa64solib.c (pa64_solib_create_inferior_hook): Remove code which
+ tries to set __d_pid; it's not relevant to PA64 shared libraries.
+
+ A psymtab's texthigh element, and a block's endaddr element, are
+ the address past the end of the address range, never the address
+ of the last byte. These data structures mean the same thing on
+ forty different architectures; there's no reason they should be
+ different on HP/UX.
+ * symtab.c (find_pc_sect_psymtab): Remove special case for HP/UX.
+ (find_pc_sect_symtab): Same.
+ * objfiles.c (find_pc_sect_section): Same.
+
+Sat Sep 18 07:13:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (internalize_unwinds): Handle PA64 shared libraries
+ correctly
+
+ * hppa-tdep.c (in_solib_call_trampoline): Handle PA64 shared library
+ trampolines.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * wrapper.h: Add missing define brackets.
+
+1999-09-17 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * breakpoint.c (permanent_breakpoint_here_p): Delete.
+ Accidentally left over from previous changes.
+
+1999-09-17 Jim Blandy <jimb@cygnus.com>
+
+ * config/pa/tm-hppa64.h (ARGS_GROW_DOWNWARD): Deleted. There are
+ many more differences between the 32- and 64-bit ABI's than the
+ direction the arguments grow, so this name is misleading.
+ (PA20W_CALLING_CONVENTIONS): Define this instead.
+ * config/pa/tm-hppa.h (ARGS_GROW_DOWNWARD): Delete.
+ * hppa-tdep.c (hppa_push_arguments): Split into two separate
+ functions, depending on whether PA20W_CALLING_CONVENTIONS is
+ #defined. These implement completely separate specifications,
+ they don't really share that much code anyway, and this is much
+ more readable. Specifically: leave a 16-byte, not 32-byte, frame
+ marker; correctly align objects larger than eight bytes; promote
+ all integral scalar arguments smaller than eight bytes to a full
+ register width; pad aggregates smaller than eight bytes on the
+ right.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * Makefile.in: Add entries for varobj.[cho] and wrapper.[cho].
+ gdbtk-varobj.[co]. gdbtk-varobj.o is not yet on the COMMON_OBS
+ list because it conflicts with the older gdbtk-variable.o which
+ is still the default.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.h: New file. GDB variable objects API.
+ * varobj.c: New file. Implementation of the GDB variable objects
+ API.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * wrapper.h: New file. Longjump free calls to gdb internal
+ routines.
+ * wrapper.c (gdb_evaluate_expression, wrap_evaluate_expression,
+ gdb_value_fetch_lazy, wrap_value_fetch_lazy, gdb_value_equal,
+ wrap_value_equal, gdb_value_ind, wrap_value_ind): New functions.
+
+Thu Sep 16 17:33:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_async_open_1): Use SERIAL_ASYNC to
+ enable/disable async event callback on serial port. Use
+ SERIAL_CAN_ASYNC_P / SERIAL_IS_ASYNC_P to determine if / when
+ async mode.
+ (remote_async_resume, remote_async_detach, remote_async_kill,
+ extended_remote_async_create_inferior, remote_async_wait): Ditto.
+
+ * ser-unix.c (hardwire_readchar): When ASYNC, only read a single
+ character.
+ (ser_unix_readchar): Ditto. Problems occure with back-to-back
+ data from a target. The ASYNC code can loose the second data
+ chunk.
+
+ * serial.c (serial_fdopen): Initialize async_handler and
+ async_context.
+
+1999-09-16 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * utils.c (discard_all_continuations): New function.
+ * defs.h: (discard_all_continuations): Add prototype.
+
+1999-09-16 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * valops.c: Remove prototype for search_struct_field_aux(). THe
+ function was nowhere in the file.
+ (value_ind): Remove unused var real_val.
+ (value_find_oload_method_list): Remove unused var v.
+ (find_overload_match): Remove extra declaration of var jj.
+
+ * Makefile.in (event_top_h): Define. Add dependency on this for
+ every file that includes event-top.h.
+
+Thu Sep 16 17:33:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.c (serial_open): Delete ``&'' device.
+ * ser-unix.c (_initialize_ser_hardwire): Make the "hardwire"
+ device async. Delete temporary "async-hardwire" device.
+
+Thu Sep 16 16:27:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (SERIAL_IS_ASYNC_P): Define. Non-zero when serial
+ device is in async mode.
+ (SERIAL_CAN_ASYNC_P): Rename SERIAL_ASYNC_P.
+ * serial.c (serial_is_async_p): Implement.
+ (serial_can_async_p): Rename serial_async_p.
+ (serial_open): Initialize ASYNC_HANDLER and ASYNC_CONTEXT. Save
+ the original name in SCB instead of the stripped name.
+
+Thu Sep 16 12:20:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (struct serial_ops): Add field ASYNC.
+ (SERIAL_ASYNC, SERIAL_ASYNC_P): New macros.
+ (struct _serial_t): Add fields async_context and async_handler.
+ * serial.c (serial_async, serial_async_p): Implement.
+
+ * ser-unix.c: Include "event-loop.h".
+ (ser_unix_async), ser-unix.c: New function. Implement async mode.
+ (async_event): Handle async events.
+ * ser-unix.c (_initialize_ser_hardwire), ser-tcp.c
+ (_initialize_ser_tcp), ser-pipe.c (_initialize_ser_pipe): Enable
+ ASYNC.
+
+ * serial.c (serial_open): Discard leading ``|'' before opening a
+ pipe device.
+ * ser-pipe.c (pipe_open): Adjust.
+ * serial.c (serial_open): Add ``&'' prefix so that
+ "async-hardwire" device can be explicitly selected. Work in
+ progress.
+ * ser-unix.c: Register "async-hardwire" device.
+
+Thu Sep 16 09:04:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-unix.h: New file. Declare generic ser_unix functions.
+ * ser-unix.c (ser_unix_nop_get_tty_state,
+ ser_unix_nop_set_tty_state, ser_unix_nop_raw, ser_unix_wait_for,
+ ser_unix_readchar, ser_unix_nop_noflush_set_tty_state,
+ ser_unix_nop_print_tty_state, ser_unix_nop_setbaudrate,
+ ser_unix_nop_setstopbits, ser_unix_write,
+ ser_unix_nop_flush_output, ser_unix_nop_flush_input,
+ ser_unix_nop_send_break, ser_unix_nop_drain_output): New
+ functions.
+ * ser-unix.c: Include <sys/wait.h>, <sys/socket.h>,
+ "gdb_string.h".
+
+ * ser-tcp.c (_initialize_ser_tcp), ser-unix.c
+ (_initialize_ser_hardwire), ser-pipe.c (_initialize_ser_tcp):
+ Initialize ops vector using assignment.
+
+ * ser-pipe.c, ser-tcp.c, ser-unix.c: Include ser-unix.h.
+
+ * ser-pipe.c (pipe_get_tty_state, pipe_set_tty_state,
+ pipe_return_0, pipe_raw, wait_for, pipe_readchar,
+ pipe_noflush_set_tty_state, pipe_print_tty_state,
+ pipe_setbaudrate, pipe_setstopbits, pipe_write), ser-tcp.c
+ (tcp_get_tty_state, tcp_set_tty_state, tcp_return_0, tcp_raw,
+ wait_for, tcp_readchar, tcp_noflush_set_tty_state,
+ tcp_print_tty_state, tcp_setbaudrate, tcp_setstopbits, tcp_write):
+ Delete functions.
+
+1999-09-15 Stan Shebs <shebs@andros.cygnus.com>
+
+ * d10v-tdep.c (remote_d10v_translate_xfer_address): Move to here
+ from remote-d10v.c, also change the memory translation to its
+ previous version.
+ * remote-d10v.c: Remove.
+ * config/d10v/d10v.mt (TDEPFILES): Remove remote-d10v.o.
+
+1999-09-15 Jim Blandy <jimb@cygnus.com>
+
+ * breakpoint.c (remove_breakpoint): Return zero, not nothing.
+
+1999-09-14 Jim Blandy <jimb@cygnus.com>
+
+ * hppa-tdep.c (frame_chain): If the unwind info says we've saved
+ r3, don't trust it. Call get_frame_saved_regs and see if we can
+ actually find an address for r3 there.
+
+ * pa64solib.c (pa64_sharedlibrary_info_command): Text fix.
+
+Tue Sep 14 14:34:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (DEPRECATED_SERIAL_FD): Define.
+ * serial.c (deprecated_serial_fd): New function.
+
+ * remote.c (remote_async_open_1, remote_async_open_1,
+ remote_async_detach, remote_async_kill,
+ extended_remote_async_create_inferior, minitelnet): Update.
+ * remote-es.c (es1800_open, es1800_close, es1800_transparent): Update.
+
+ * remote-st.c (connect_command), remote-os9k.c (connect_command):
+ Fix. Call FD_SET et.al. with FD instead of serial_t.
+
+1999-09-14 Jim Blandy <jimb@cygnus.com>
+
+ * hppa-tdep.c (hppa_frame_find_saved_regs): The two possible
+ instructions for saving the return pointer (32- and 64-bit) save
+ it at different offsets.
+
+ * config/pa/tm-hppa64.h: Doc fix.
+
+ * defs.h (continuation): Make this a typedef.
+
+ * Makefile.in (gdbtk.o, gdbtk-cmds.o): Depend on $(top_h).
+
+ * Makefile.in (i386-linux-nat.o): Depend on symfile.h, not
+ $(symfile_h); the latter has no definition.
+
+ * breakpoint.c (breakpoint_here_p): Remove meaningless code,
+ testing b->enable against shlib_disabled and call_disabled after
+ we know it is enabled.
+
+ Implement "permanent breakpoints" --- breakpoints that are
+ hardwired into the inferior's code. GDB knows they're there, but
+ doesn't try to insert or remove them, etc.
+ * breakpoint.h (enum enable): Add `permanent' enablement state.
+ * breakpoint.c (make_breakpoint_permanent): New function.
+ * breakpoint.h (make_breakpoint_permanent): Add declaration.
+ * breakpoint.c (insert_breakpoints): Don't bother to insert
+ permanent breakpoints...
+ (remove_breakpoint): ... or remove them.
+ (breakpoint_here_p): Handle `permanent' like `enabled'. Change
+ return value to indicate whether it's a permanent breakpoint here,
+ or an ordinary breakpoint.
+ * breakpoint.h (enum breakpoint_here): New enum.
+ (breakpoint_here_p): Change declaration.
+ * breakpoint.h (breakpoint_1): Extend bpenables to cover all the
+ enablement states.
+ (describe_other_breakpoints): Describe permanent breakpoints.
+ (check_duplicates): If one of the breakpoints at ADDRESS is a
+ permanent breakpoint, treat all the others as the duplicates, so
+ we don't try to insert or remove any of them. Verify that only
+ the permanent breakpoint is actually inserted.
+ (delete_breakpoint): Complain if we discover that another
+ breakpoint was inserted at the same place as a permanent
+ breakpoint.
+ (disable_breakpoint): Fail silently if asked to disable a
+ permanent breakpoint.
+ (do_enable_breakpoint): Don't change a permanent breakpoint's
+ enablement to ordinary `enabled'. Leave it alone.
+ (create_solib_event_breakpoint): Return the
+ breakpoint object created.
+ * breakpoint.h (create_solib_event_breakpoint): Fix declaration.
+ * pa64solib.c (pa64_solib_create_inferior_hook): Do turn on the
+ DT_HP_DEBUG_CALLBACK flag in the dynamic linker, so it will call
+ __dld_break, which contains the permanent breakpoint, when interesting
+ things happen. Tell GDB that the breakpoint in __dld_break is
+ permanent.
+ * gdbtk-cmds.c (gdb_get_breakpoint_info): Report a permanent
+ breakpoint as enabled.
+ * infrun.c (SKIP_PERMANENT_BREAKPOINT): Provide default definition.
+ (default_skip_permanent_breakpoint): New function.
+ (resume): If we're trying to resume at a permanent breakpoint, use
+ SKIP_PERMANENT_BREAKPOINT to step over it.
+ * hppa-tdep.c (hppa_skip_permanent_breakpoint): New function.
+ * config/pa/tm-hppa.h (hppa_skip_permanent_breakpoint): Declare.
+ (SKIP_PERMANENT_BREAKPOINT): Define.
+
+1999-09-14 Kevin Buettner <kevinb@cygnus.com>
+
+ * symtab.h, minsyms.c (find_stab_function_addr): Changed
+ type of second parameter from partial_symtab * to char *.
+ Fixed all callers.
+ * minsyms.c (find_stab_function_addr): Look for minimal
+ symbol without filename if filename based search fails.
+ * dbxread.c (process_one_symbol): Call find_stab_function_addr()
+ in place of inline code with identical functionality.
+ * partial-stab.h (case N_FUN, descriptors 'F' and 'f'): Look
+ up symbol's address from minimal symbol table when N_FUN
+ address is missing. Also, make sure this value is used for
+ calculating the value of the texthigh field.
+
+1999-09-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (create_file_handler): Increment the total number
+ of file descriptors for the poll case, only if this is a new file
+ desc.
+
+1999-09-14 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c: misc minor cleanups and fixes missed in last patch.
+
+Tue Sep 14 12:37:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.h (SERIAL_PRINT_TTY_STATE): Add STREAM parameter.
+ (union serial_ops): Update.
+
+ * ser-unix.c (hardwire_print_tty_state, ser-tcp.c
+ (tcp_print_tty_state), ser-pipe.c (pipe_print_tty_state,
+ ser-go32.c (dos_print_tty_state, ser-mac.c (mac_print_tty_state,
+ ser-ocd.c (ocd_print_tty_state, ser-e7kpc.c
+ (e7000pc_print_tty_state): Update.
+ * inflow.c (child_terminal_info): Update.
+ * serial.c (serial_print_tty_state): Update.
+
+Tue Sep 14 11:41:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.c, serial.h, ser-tcp.c, ser-unix.c, ser-pipe.c: Convert
+ all functions to ISO-C.
+ * serial.h, serial.c: Move all indirect macro function calls from
+ serial.h into serial.c.
+ (serial_drain_output, serial_flush_output, serial_flush_input,
+ serial_raw, serial_get_tty_state, serial_set_tty_state,
+ serial_print_tty_state, serial_noflush_set_tty_state,
+ serial_setbaudrate, serial_setstopbits): New functions.
+ (do_serial_close): Rename serial_close.
+ (serial_close, serial_un_fdopen): New functions. Call
+ do_serial_close.
+
+1999-09-13 James Ingham <jingham@leda.cygnus.com>
+
+ * symtab.c (decode_line_1): Find the rightmost parenthesis in the
+ expression, not the leftmost. This allows us to parse function
+ declarations with embedded function prototypes.
+
+Mon Sep 13 18:39:31 1999 Jeffrey A Law (law@cygnus.com)
+
+ * pa64solib.c (pa64_sharedlibrary_info_command): Fix typos.
+
+1999-09-13 Kevin Buettner <kevinb@cygnus.com>
+
+ * i386-tdep.c (i386_extract_return_value): ifdef'd so that
+ non-linux targets will work again.
+ (i386_do_registers_info, i386_print_register): Revert changes
+ of 1999-09-03; these functions have been removed because they
+ are Linux specific and break non-Linux builds. This functionality
+ will be restored after FP support unification has been achieved.
+ * i387-tdep.c (i387_print_register, void i387_float_info):
+ Likewise.
+ * config/i386/tm-linux.h (i387_float_info, FLOAT_INFO,
+ DO_REGISTERS_INFO, i386_do_registers_info,
+ i387_print_register): Likewise.
+
+1999-09-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (call_readline): Change to accept gdb_client_data as
+ param.
+ (rl_callback_read_char_wrapper): New function to match what the
+ event loop expects and what readline expects.
+ (change_line_handler): Make call_readline point to
+ rl_callback_read_char_wrapper, instead of rl_callback_read_char.
+ (_initialize_event_loop): Ditto.
+ (gdb_readline2): Change parameter to gdb_client_data.
+ * event-top.h (call_readline, gdb_readline2): Change accordingly.
+
+ * event-loop.c (add_file_handler): Change 2nd par to
+ handler_func*. No more need for casting.
+ * event-loop.h (create_async_signal_handler): Change accordingly.
+
+ * inferior.h (fetch_inferior_event): Change parameter to void*.
+ * infrun.c (fetch_inferior_event): Ditto.
+
+1999-09-13 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (step_into_function): New function, broken out from the
+ step_into_function label in handle_inferior_event.
+ (handle_inferior_event): Change a goto into a function call.
+
+1999-09-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.h: New file. All the exported vars and functions from
+ event-top.c.
+
+ * event-loop.h (struct gdb_event, event_handler_func,
+ file_handler, async_signal_handler, SELECT_MASK, fd_mask, NBBY,
+ FD_SETSIZE, howmany, NFDBITS, MASK_SIZE): Move to event-loop.c.
+ (struct prompts, PROMPT, PREFIX, SUFFIX, display_gdb_prompt,
+ async_init_signals, set_async_editing_command,
+ set_async_annotation_level, set_async_prompt, handle_stop_sig,
+ handle_sigint, pop_prompt, push_prompt, gdb_readline2,
+ mark_async_signal_handler_wrapper, async_request_quit,
+ async_command_editing_p, exec_done_display_p,
+ async_annotation_suffix, new_async_prompt, the_prompts,
+ call_readline, input_handler, input_fd): Move to event-top.h.
+ (All function prototypes): Don't use PARAMS anymore.
+
+ * event-loop.c: (struct gdb_event, event_handler_func,
+ file_handler, async_signal_handler, SELECT_MASK, fd_mask, NBBY,
+ FD_SETSIZE, howmany, NFDBITS, MASK_SIZE): Move to here from
+ event-loop.h.
+ Include event-top.h. Remove use of PARAMS. ANSIfy functions headers.
+
+ * event-top.c: Include event-top.h. Include "signals.h", not
+ <signals.h>.
+ Remove use of PARAMS. ANSIfy functions headers.
+ (handle_stop_sig): move prototype to event-top.h.
+
+ * remote.c: Include event-top.h. Make it understand
+ async_signal_handler type.
+ * infrun.c: Include event-top.h.
+ * mi-main.c: Ditto.
+ * top.c Ditto.
+ * utils.c: Ditto.
+
+Mon Sep 13 18:54:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Describe each of the fields.
+
+Mon Sep 13 17:51:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 1999-09-12 Jim Blandy <jimb@cygnus.com>:
+ * gdbarch.sh (generating setters): Use sed to generate the proper
+ indentation, not tr; tr's behavior is notoriously unportable.
+
+1999-09-10 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * i387-tdep.c (print_387_control_bits): Don't print newline; the
+ callers take care of that. (Thanks to H.J. Lu.)
+
+1999-09-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ * d10v-tdep.c (DMEM_START): Set to 0x2000000.
+ (itrace, iuntrace, info itrace, itdisassemble, itracedisplay,
+ itracesource): Add 'i' prefix to commands, so as not to conflict
+ with generic trace commands.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote.c (_initialize_remote): Fix the specification of the
+ "remote" prefix to set and show commands.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * command.c (print_doc_line): Update to use ui_out.
+ (do_setshow_command): Ditto.
+ (cmd_show_list): Ditto.
+
+1999-09-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (create_file_event): New function. Creates a gdb
+ event for a given fd.
+ (gdb_wait_for_event): Use create_file_event().
+ * event-loop.h: export create_file_event().
+
+ * event-loop.c (delete_file_handler): Move the clearing of the
+ mask to later on in the function, because we need it in order to
+ deactivate the correct fd when using select().
+
+ * m32r-tdep.c (decode_prologue): Fix typo. Instructions starting
+ with 0xf are branch instructions.
+ (m32r_scan_prologue): Initialize framesize to 0.
+
+1999-09-07 J.T. Conklin <jtc@redback.com>
+
+ * i386-stub.c (exceptionHook, oldExceptionHook): Removed.
+ (handle_exception): Removed #if'd out exception hook code.
+
+ * i386-stub.c, m68k-stub.c (error): Removed unused variable.
+
+ * i386-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
+ sparcl-stub.c, sparclet-stub.c (remcomInBuffer, remcomOutBuffer):
+ Make static.
+
+Tue Sep 7 14:06:22 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ * config/i386/tm-linux.h (SOFUN_ADDRESS_MAYBE_MISSING):
+ Define.
+
+Tue Sep 7 08:18:01 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ From Jim Blandy <jimb@cygnus.com>:
+
+ Step into calls to functions in shared libraries properly. See
+ the comments for SKIP_SOLIB_RESOLVER atop infrun.c for details.
+ * infrun.c (SKIP_SOLIB_RESOLVER): New macro.
+
+1999-09-05 Fred Fish <fnf@cygnus.com>
+
+ * elfread.c (elf_symtab_read): Remove separately passed bfd
+ pointer and offset. Pick up bfd pointer from objfile, and
+ get offset from objfile's section_offsets.
+
+Fri Sep 3 22:29:39 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ * config/i386/tm-linux.h (REGISTER_NAMES): Changed register
+ named "foo" to "fopo" which more accurately describes the FPU
+ Operand Pointer Offset. The real reason for this change, of
+ course, is that many programmers use $foo as a convenience
+ variable and are likely to be unpleasantly surprised to find
+ that they're unwittingly changing the state of their ia32 FPU.
+
+1999-09-03 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * monitor.c (monitor_supply_register): Stop scanning val string
+ if a newline is encountered.
+
+1999-09-03 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ monitor.c (TARGET_BUF_SIZE): New macro, defined to 2048.
+ (monitor_expect_regexp, monitor_wait, monitor_dump_reg_block,
+ monitor_dump_reg_block): Dump hard-coded constants in favor
+ of TARGET_BUF_SIZE.
+
+ (readchar): Re-enable output of characters read from monitor when
+ remotedebug is set.
+
+ (monitor_supply_register): Use ULONGEST to hold value.
+ Replace strtoul() call with hand-coded loop to handle values
+ larger than 'long'.
+
+ (monitor_store_register): Use ULONGEST to hold value.
+
+Fri Sep 3 00:47:44 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ [Merged linux/x86 floating point code from Bill Metzenthen,
+ Jim Blandy, Anthony Green, H. J. Lu, and possibly others. The
+ following remarks are Jim Blandy's.]
+
+ * findvar.c (extract_floating): Call TARGET_EXTRACT_FLOATING, if
+ #defined.
+ (store_floating): Call TARGET_STORE_FLOATING, if #defined.
+
+ * i386-tdep.c (i386_print_register, i386_do_registers_info): New
+ functions.
+ (i386_extract_return_value): GNU/Linux returns floating point
+ values in a floating point register too.
+ (set_disassembly_flavor): Add prototype.
+ (i386_extract_return_value): Use FPDATA_REGNUM, not FP0_REGNUM (
+ which wasn't the first FP data register).
+ (i386_do_registers_info): Use FPSTART_REGNUM and FPEND_REGNUM as
+ the limits of the FPU-related registers.
+ (i386_extract_return_value): Tell GDB how to find return values
+ larger than four bytes. (Thanks to Paul N. Hilfinger for the bug
+ report.)
+
+ * i387-tdep.c (print_387_control_word): Break out bit-splitting into...
+ (print_387_control_bits): New function.
+ (print_387_status_word): Break out bit-splitting into...
+ (print_387_status_bits): New function.
+ (i387_print_register, i387_float_info, i387_hex_float_input): New
+ functions.
+ (i387_extract_floating, i387_store_floating): New functions.
+
+ * valprint.c (print_floating): Use macro TARGET_ANALYZE_FLOATING,
+ if it's #defined. Tolerate values of `nonnegative' other than
+ zero and one.
+
+ * i386-linux-nat.c: New file.
+ * Makefile.in (ALLDEPFILES): Mention i386-linux-nat.c.
+ (i386-linux-nat.o): New rule, listing dependencies.
+ * config/i386/linux.mh (NATDEPFILES): Use i386-linux-nat.o, not
+ the plain i386v4-nat.o.
+ * config/i386/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
+ * config/i386/xm-linux.h: Define HOST_I386.
+
+ * config/i386/tm-linux.h (FP0_REGNUM): Replaced by...
+ (FPSTART_REGNUM, FPCONTROL_REGNUM, FPSTATUS_REGNUM, FPTAG_REGNUM,
+ FPDATA_REGNUM, FPEND_REGNUM): New definitions.
+ (REGISTER_BYTES): Changed accordingly.
+ (SKIP_SOLIB_RESOLVER): #define this.
+ (i386_linux_skip_solib_resolver): New declaration.
+ (i387_float_info): Added extern decl for this function.
+ (TARGET_EXTRACT_FLOATING, TARGET_STORE_FLOATING,
+ TARGET_ANALYZE_FLOATING): Define.
+ (i387_extract_floating, i387_store_floating): New extern decls.
+ (I386_GNULINUX_TARGET): Define.
+ (NUM_REGS, NUM_FREGS, REGISTER_NAMES, FP0_REGNUM, FPDATA_REGNUM,
+ FPENV_BYTES, FPREG_RAW_SIZE, FPREG_BYTES, REGISTER_BYTES,
+ REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE,
+ MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE,
+ TARGET_LONG_DOUBLE_BIT, FLOAT_INFO, DO_REGISTERS_INFO): New
+ definitions, perhaps overriding those inherited from
+ config/i386/tm-i386.h.
+ (i386_do_registers_info, i387_print_register, double_to_i387,
+ i387_to_double): New declarations.
+ (LD_I387): Define iff both the host and target are using i387
+ FPU's.
+ (HEX_FLOAT_INPUT, REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW,
+ REGISTER_VIRTUAL_TYPE): Define these if LD_I387 is defined.
+
+ * source.c (list_command): List the right number of source lines,
+ even if we're at the top of the file.
+
+1999-09-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (step_over_function): New function, broken out from the
+ step_over_function label in handle_inferior_event.
+ (handle_inferior_event): Change a goto into a function call.
+
+Thu Sep 2 18:26:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (GDB_WERROR_CFLAGS, GBB_WARN_CFLAGS): Define.
+ (INTERNAL_CFLAGS): Update
+ * configure.in (WERROR_CFLAGS, WARN_CFLAGS): Sync with
+ ../sim/common/aclocal.m4.
+ * configure: Re-generate.
+
+Thu Sep 2 00:27:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (z8k-tdep.o): For moment, don't try to compile with
+ -Werror. See Makefile.in.
+ * z8k-tdep.c (z8k_set_pointer_size): Document problem.
+
+ * config/z8k/tm-z8k.h (z8k_print_register_hook, z8k_frame_chain,
+ z8k_saved_pc_after_call, z8k_frame_saved_pc,
+ z8k_set_pointer_size): Declare.
+ (z8k_skip_prologue): Fix typo. Was mz8k_skip_prologue.
+ (FRAME_CHAIN, PRINT_REGISTER_HOOK, FRAME_SAVED_PC,
+ SAVED_PC_AFTER_CALL): Update.
+ * z8k-tdep.c (z8k_print_register_hook): Rename
+ z8k_print_register_hook.
+ (z8k_frame_chain): Rename frame_chain.
+ (z8k_saved_pc_after_call): Rename saved_pc_after_call.
+ (z8k_frame_saved_pc): Rename frame_saved_pc.
+ (z8k_print_register_hook): Fix printf.
+ (read_memory_pointer): Add declaration.
+ ("value.h"): Include.
+ * Makefile.in (z8k-tdep.o): Add dependency on value.h.
+
+ * config/sparc/tm-sparc.h (PRINT_EXTRA_FRAME_INFO): Fix
+ printf. calls
+ * Makefile.in (remote-e7000.o): For moment, don't try to compile
+ with -Werror. See Makefile.in.
+ * sh-tdep.c (sh_show_regs): Fix printf calls.
+ * xcoffsolib.c (solib_info): Fix Printf calls.
+ * dink32-rom.c: #include "symfile.h" for generic_load and
+ "inferior.h" for write_pc.
+ * Makefile.in (dink32-rom.o): Update.
+
+ * config/mn10300/tm-mn10300.h (mn10300_store_struct_return),
+ config/mn10200/tm-mn10200.h (mn10200_store_struct_return): Add
+ declarations.
+
+Tue Aug 31 00:48:27 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-tx49el.h (REGISTER_SIM_REGNO): Define.
+
+ * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
+ Pass REGISTER_SIM_REGNO converted register number to the
+ simulator.
+
+1999-09-01 Tom Tromey <tromey@cygnus.com>
+
+ * config/i386/nm-linux.h (PREPARE_TO_PROCEED): Added argument.
+
+1999-09-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * values.c (value_virtual_fn_field): Remove unused var(s).
+ * thread.c (prune_threads): Ditto.
+ * symtab.c (lookup_transparent_type): Ditto.
+ (decode_line_1): Ditto.
+ (make_symbol_overload_list): Ditto.
+ * rs6000-tdep.c (frame_get_saved_regs): Ditto.
+ (set_processor): Ditto.
+ * remote.c (remote_remove_breakpoint): Ditto.
+ (remote_query): Ditto.
+ (readtty): Ditto.
+ * remote-sds.c (sds_fetch_registers): Ditto.
+ (putmessage): Ditto.
+ * ppcbug-rom.c (ppcbug_supply_register): Ditto.
+ (ppcbug_open): Remove unused prototype.
+ * parse.c (parse_nested_classes_for_hpacc): Remove unused var(s).
+ * ocd.c (ocd_open): Ditto.
+ (ocd_get_packet): Ditto.
+ * monitor.c (monitor_error): Ditto.
+ (monitor_wait_srec_ack): Ditto.
+ * main.c (main): Ditto.
+ * gdbtypes.c (count_virtual_fns): Ditto.
+ * exec.c (exec_file_command): Ditto.
+
+ * event-top.c: Include handle_sigwinch() function prototype within
+ appropriate #ifdef.
+
+ * eval.c (evaluate_subexp_standard): Remove unused variable.
+ (evaluate_subexp_standard): Remove unused variables.
+ * dink32-rom.c (dink32_supply_register): Remove unused variable.
+ * dbxread.c (elfstab_build_psymtabs): Ditto.
+ * command.c (do_setshow_command): Ditto.
+ * breakpoint.c (solib_load_unload_1): Remove unused variables 'i'
+ and 'sal'.
+ (until_break_command): Remove unused variables 'arg1' and 'arg2'.
+ (create_exception_catchpoint): Remove unused variable 'i'.
+ * ax-gdb.c (gen_sub): Remove unused variable.
+ (_initialize_ax_gdb): Ditto.
+
+ * ser-pipe.c (pipe_readchar): If timeout is expired return
+ SERIAL_TIMEOUT.
+ * ser-tcp.c (tcp_readchar): If timeout is expired return
+ SERIAL_TIMEOUT.
+
+Wed Sep 1 15:07:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * version.h: New file.
+ * Makefile.in (version_h): Define.
+ (version.o): Add target.
+
+ * remote-array.c: #include "version.h".
+ (version): Delete extern declarations.
+ * Makefile.in (remote-array.o): Add dependency on version.h.
+
+ * top.c: #include "version.h".
+ (version, host_name, target_name): Delete extern declarations.
+ * Makefile.in (top.o): Add dependency on version.h.
+
+ * remote.c (remote_remove_watchpoint, remote_insert_watchpoint),
+ remote-array.c (array_open), remote-mips.c (send_srec),
+ dve3900-rom.c (store_bitmapped_register): Fix Printfs.
+
+ * mips-tdep.c (mips_print_extra_frame_info, print_unpack),
+ m32r-rom.c (m32r_load_section), m32r-tdep.c (m32r_frame_chain),
+ dsrec.c (load_srec): Fix printf problems.
+
+Wed Sep 1 13:16:49 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (monitor.o): For moment, don't try to compile with
+ -Werror. monitor.c has -Wformat problems. See Makefile.in for
+ more info.
+
+Tue Aug 31 21:23:38 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (prologue_inst_adjust_sp): Correct offset computation
+ for doubleword store instructions.
+ (hppa_frame_find_saved_regs): Similarly.
+
+Wed Sep 1 09:22:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d30v-tdep.c (d30v_print_register):
+ (tdisassemble_command):
+
+ * d10v-tdep.c (show_regs, trace_info, tdisassemble_command): Fix
+ printf problems.
+
+ * remote-sim.c (dump_mem), remote-rdi.c (arm_rdi_create_inferior):
+ Fix printf arguments.
+
+ * remote-mips.c, mips-tdep.c: Move declaration of
+ ``mips_set_processor_type_command'' from here.
+ * config/mips/tm-mips.h: To here.
+ * remote-array.c: #include "inferior.h".
+ * config/mips/tm-embed.h (remote_mips_stopped_by_watchpoint): Add
+ declaration.
+ * remote-mips.c (remote_mips_stopped_by_watchpoint): Define using
+ ISO-C prototype.
+ (monitor_supports_breakpoints): Integer variable.
+
+ * m32r-rom.c: #include "inferior.h" and <ctype.h>
+ * config/m32r/tm-m32r.h (m32r_write_sp): Add declaration.
+
+ * config/i960/tm-i960.h (leafproc_return, i960_pop_frame): Add
+ declaration.
+ (POP_FRAME): Call i960_pop_frame.
+ * i960-tdep.c (i960_pop_frame): Rename pop_frame.
+ * mon960-rom.c: #include "inferior.h" for declaration of write_pc.
+
+1999-08-15 Fred Fish <fnf@cygnus.com>
+
+ * objfiles.c (objfile_relocate): Use SIZEOF_SECTION_OFFSETS when
+ allocating section_offsets array.
+ * remote-os9k.c (rombug_wait): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * remote.c (get_offsets): Ditto.
+ (remote_cisco_objfile_relocate): Ditto.
+ * rs6000-nat.c (vmap_symtab): Ditto.
+
+ * dstread.c (dst_symfile_offsets): Set section_offsets directly instead
+ of returning a pointer to section offsets.
+ * somread.c (som_symfile_offsets): Ditto.
+ * xcoffread.c (xcoff_symfile_offsets): Ditto.
+ * symfile.c (default_symfile_offsets): Ditto.
+ (syms_from_objfile): The sym_offsets function has already set section
+ offsets and no longer returns a value.
+
+ * xcoffread.c (scan_xcoff_symtab): Eliminate section_offsets passed
+ separate from objfile.
+ (xcoff_start_psymtab): Ditto.
+ (START_PSYMTAB): Ditto.
+ * os9kread.c (read_minimal_symbols): Ditto.
+ (read_os9k_psymtab): Ditto.
+ (os9k_start_psymtab): Ditto.
+ (record_minimal_symbol): Ditto.
+ * dbxread.c (START_PSYMTAB): Ditto.
+ (start_psymtab): Ditto.
+ * mdebugread.c (START_PSYMTAB): Ditto.
+ (elfmdebug_build_psymtabs): Ditto.
+ (mdebug_build_psymtabs): Ditto.
+ (parse_partial_symbols): Ditto.
+ (new_psymtab): Ditto.
+ * dwarfread.c (dwarf_build_psymtabs): Ditto.
+ * partial-stab.h (START_PSYMTAB): Ditto.
+ * stabsread.h (start_psymtab): Ditto.
+ * dwarf2read.c (dwarf2_build_psymtabs): Ditto.
+ (dwarf2_build_psymtabs_easy): Ditto.
+ (dwarf2_build_psymtabs_hard): Ditto.
+ * hp-psymtab-read.c (hpread_build_psymtabs): Ditto.
+ (hpread_quick_traverse): Ditto.
+ (hpread_start_psymtab): Ditto.
+ (scan_procs): Ditto.
+ * hpread.c (hpread_build_psymtabs): Ditto.
+ * symfile.h (dwarf2_build_psymtabs): Ditto.
+
+ * dbxread.c (read_dbx_symtab): Use ANOFFSET to access section
+ offsets.
+ * coffread.c (enter_linenos): Pass objfile instead of section
+ offsets.
+
+ * dbxread.c (dbx_symfile_read): No need to explicitly pass
+ text addr and size. Let read_dbx_symtab find them.
+ (read_dbx_symtab): Get text addr and size from objfile.
+ (dbx_symfile_read): Remove dead code (call to strlen);
+
+1999-08-31 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * Makefile.in: add rule for sol-thread.o.
+ Add rule for linux-thread.o.
+
+1999-08-13 Jim Kingdon <kingdon@redhat.com>
+
+ Threads code from gdb 4.18-codefusion-990706
+ [Thanks to Eric Paire, H. J. Lu, Jim Blandy and others]
+ * infrun.c (signal_stop_update, signal_print_update,
+ signal_pass_update): new functions.
+ * inferior.h: new prototypes for above functions.
+ * target.h (enum strata): add thread stratum.
+ * linux-thread.c: new file. Support for debugging linux threads.
+ * config/i386/nm-linux.h: several new prototypes for above.
+ * config/i386/linux.mh: add linux-thread.o to NATDEPFILES.
+
+ More threads code from the same place:
+ * config/i386/tm-linux.h (REALTIME_LO, REALTIME_HI): Add
+ definitions.
+ * target.h (enum target_signal): Add TARGET_SIGNAL_REALTIME_32.
+ * target.c (signals, target_signal_from_host,
+ target_signal_to_host): Add clauses for
+ TARGET_SIGNAL_REALTIME_32.
+
+1999-08-31 Neil Schellenberger <neil.schellenberger@crosskeys.com>
+
+ * sol-thread.c (sol_thread_detach): strip thread-id out of
+ inferior_pid, so that procfs_detach can't choke on it.
+
+1999-08-31 J.T. Conklin <jtc@redback.com>
+
+ * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
+ sparcl-stub.c, sparclet-stub.c (getpacket): Remove 'buffer' arg,
+ define it as a pointer to &remcomInBuffer[0].
+ (handle_exception): Update.
+
+ * sparc-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
+ Removed #ifdef'd out code which implements the non-standard 'b'
+ (set baud rate) command.
+
+1999-08-31 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (keep_going): New function, broken out from the
+ keep_going label in handle_inferior_event.
+ (handle_inferior_event): Change more gotos into function calls.
+
+Tue Aug 31 02:29:27 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (read_unwind_info): Handle multiple unwind sections.
+
+Tue Aug 31 15:28:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/alpha/tm-alpha.h (PRINT_EXTRA_FRAME_INFO): Fix printf
+ format argument.
+ * alpha-tdep.c (heuristic_proc_start): Ditto.
+
+ From Stan Shebs <shebs@andros.cygnus.com>:
+ * defs.h (strlen_paddr): Fix prototype - add void argument list.
+
+Tue Aug 31 14:02:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (gdb_print_host_address), utils.c
+ (gdb_print_host_address): Rename gdb_print_address.
+
+ * expprint.c, gdbtypes.c, symmisc.c: Update.
+
+ *expprint.c: Use gdb_print_host_address when displaying native
+ pointers.
+
+Sat Aug 28 14:23:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * scm-valprint.c (scm_ipruk), jv-valprint.c (java_value_print),
+ cp-valprint.c (cp_print_class_member), exec.c (exec_files_info),
+ remote.c (putpkt_binary, compare_sections_command,
+ remote_cisco_section_offsets), dcache.c (dcache_info),
+ breakpoint.c (break_at_finish_at_depth_command_1,
+ break_at_finish_command_1), symfile.c (generic_load),
+ (report_transfer_performance), top.c (get_prompt_1), f-valprint.c
+ (f_val_print), maint.c (maintenance_translate_address): Fix printf
+ -Wformat warnings. Use paddr, paddr_nz, sizeof_paddr, paddr_u and
+ paddr_d to print addresses. Change ``d'' to ``ld''.
+
+ * utils.c (strlen_paddr): New function.
+
+Tue Aug 31 01:36:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d30v/tm-d30v.h (d30v_frame_chain,
+ d30v_init_frame_pc): Add declaration.
+
+ * arc-tdep.c (arc_pop_frame): Rename pop_frame.
+ (arc_push_dummy_frame): Rename push_dummy_frame.
+ (arc_set_cpu_type_command): Add declaration.
+
+ * config/arc/tm-arc.h (arc_pop_frame, arc_push_dummy_frame): Add
+ declaration.
+
+1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (prepare_to_wait): New function, broken out from the
+ wfi_continue label in handle_inferior_event.
+ (handle_inferior_event): Change more gotos into function calls.
+
+1999-08-30 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * tracepoint.c: -Wall warning cleanup.
+ (parse_and_eval_memrange): remove (unused).
+ (output_command, args_info, locals_info, registers_info): add decls.
+ (getpkt, putpkt, remote_console_output): add decls.
+ (isalnum, isspace): cast arg to avoid warning.
+ (printf, fprintf, sprintf): use [fs]printf_vma for printing addrs.
+
+Mon Aug 30 21:47:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c: #include "language.h".
+
+Mon Aug 30 20:38:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for <time.h>.
+ * configure, acconfig.in: Re-generate.
+
+ * remote-rdp.c: #include <time.h>
+
+ * config/arm/tm-arm.h (arm_float_info): Add declaration.
+
+ * arm-tdep.c (convert_from_extended, convert_to_extended): Change
+ double ptr arg to void ptr arg.
+
+ * config/arm/tm-arm.h (arm_frameless_function_invocation): Add
+ declaration.
+ (arm_frame_find_saved_regs): Rename frame_find_saved_regs.
+ (convert_from_extended, convert_to_extended): Add declaration.
+
+Mon Aug 30 19:05:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (WERR_CFLAGS): Separate the -Werror flag.
+ * configure: Re-generate.
+
+ * Makefile.in (INTERNAL_CFLAGS): Re-define using
+ INTERNAL_WARN_CFLAGS.
+ (INTERNAL_WARN_CFLAGS): Define. Leave off WERR_CFLAGS.
+ (tracepoint.o): Add explicit rule.
+ (WERR_CFLAGS): Add definition.
+
+Mon Aug 30 17:52:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c: #include "event-loop.h" for declaration of
+ async_request_quit.
+ * Makefile.in (utils.o): Add dependency on event-loop.h.
+
+ * event-top.c (mark_async_signal_handler_wrapper,
+ async_request_quit): Move declaration from here.
+ * event-loop.h: To here.
+
+ * defs.h: Add declaration of exec.c:exec_set_section_offsets.
+
+ * event-top.c: #include "gdbcmd.h" which includes "command.h" and
+ hence expose declaration of function dont_repeat.
+
+ * top.c (ISATTY), tracepoint.c (ISATTY), utils.c (ISATTY),
+ event-top.c (ISATTY): Move definitions from here.
+ * defs.h (ISATTY): To here. #include <unistd.h>.
+
+ * sol-thread.c, solib.c, source.c, sparcl-tdep.c, tracepoint.c,
+ utils.c, win32-nat.c, wince.c, top.c, symfile.c, ser-unix.c,
+ ser-tcp.c, procfs.c, maint.c, infttrace.c, hppa-tdep.c,
+ ser-pipe.c, remote-rdp.c, main.c, inftarg.c, inflow.c,
+ hpux-thread.c, hp-psymtab-read.c, go32-nat.c, fork-child.c,
+ corelow.c, command.c: Do not #include <unistd.h>, moved to defs.h.
+
+Mon Aug 30 15:14:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (struct tui_stream, enum streamtype): Move from here.
+ * utils.c: To here.
+
+ * main.c (tui_file_fputs): Move from here.
+ * utils.c: To here.
+
+Sun Aug 29 10:03:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb-events.h, gdb-events.c, gdb-events.sh: New files.
+
+1999-08-27 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * solib.c (open_symbol_file_object): new function.
+ Called when attaching to a new process, if there is no loaded
+ symbol file. Attempts to locate the executable file for the
+ attached process and load symbols from it.
+ (solib_add): Call open_symbol_file_object if attaching to a
+ new process and no open symbol file.
+
+1999-08-27 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/i386/tm-sun386.h (GDB_TARGET_IS_SUN386): Definition
+ removed--no longer checked anywhere in gdb.
+
+1999-08-27 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (stop_stepping): New function, broken out from
+ stop_stepping label in handle_inferior_event.
+ (handle_inferior_event): Change gotos into function calls.
+
+Fri Aug 27 20:13:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (LONGEST): Move definition to earlier in file - to just
+ after BFD.
+ (paddr_u, paddr_d): Declare.
+ * utils.c (decimal2str): New function.
+ (paddr_u, paddr_d): Define.
+
+ * remote.c (remote_cisco_section_offsets,
+ compare_sections_command): Fix XprintfX arguments. Use paddr...
+ (putpkt_binary): Fix XprintfX arguments.
+
+Tue Aug 24 21:30:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arm-tdep.c (arm_init_extra_frame_info): Add braces. Recommended
+ by gcc -Wparentheses.
+
+1999-08-26 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (check_sigtramp2): New function, broken out from
+ check_sigtramp2 label in handle_inferior_event.
+ (handle_inferior_event): Change gotos into function calls.
+
+ Declare Tahoe configuration obsolete.
+ * configure.host, configure.tgt: Comment out Tahoe configs.
+ * Makefile.in: Comment out Tahoe-related action.
+ * tahoe-tdep.c, config/tahoe/*: Comment out.
+ * NEWS: Mention obsolete status.
+
+1999-08-26 J.T. Conklin <jtc@redback.com>
+
+ * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sh-stub.c,
+ sparc-stub, sparcl-stub.c sparclet-stub.c (getpacket): If '$',
+ the packet start character is received in the 'middle' of a
+ packet, assume that packet end character has been lost and
+ start a new packet.
+
+ * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
+ sparcl-stub.c sparclet-stub.c (getpacket): Changed to return ptr
+ to first character of input buffer. Removed & 0x7f masks.
+ (handle_exception): Don't access remcomInBuffer directly.
+
+1999-08-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ * breakpoint.c (disable_breakpoints_in_shlibs): Only disable
+ enabled breakpoints.
+
+Tue Aug 24 14:59:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * tracepoint.c, remote.c, pa64solib.h, value.h, somsolib.h,
+ solib.h, scm-lang.h, language.h, inferior.h, defs.h, coff-solib.h,
+ ch-lang.h, breakpoint.h, annotate.h: Remove #if __STDC__ wrapping
+ struct declarations.
+
+ * config/sparc/nm-sun4sol2.h, config/mn10300/tm-mn10300.h,
+ config/mn10200/tm-mn10200.h, config/i386/tm-i386.h,
+ config/i386/tm-i386v.h, config/i386/nm-i386sol2.h,
+ config/pa/nm-hppah.h, config/rs6000/nm-rs6000.h,
+ config/sparc/tm-sp64.h, config/v850/tm-v850.h,
+ config/tic80/tm-tic80.h, config/sparc/tm-sparc.h,
+ config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
+ config/mips/tm-mips.h, config/m68k/tm-m68k.h,
+ config/m32r/tm-m32r.h, config/i960/tm-mon960.h,
+ config/fr30/tm-fr30.h, config/h8300/tm-h8300.h,
+ config/arm/tm-arm.h, config/alpha/tm-alpha.h,
+ config/a29k/tm-a29k.h: Ditto.
+
+Wed Aug 25 10:45:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (gdb$(EXEEXT)): Add dependency on TDEPLIBS.
+
+ * config/arm/arm.mt (TDEPLIBS): Define. Move libangsd.a to here.
+ (TDEPFILES): From here.
+
+1999-08-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (init_main): Add new set/show command exec-done-display,
+ default value is off.
+ * event-loop.h: Export exec_done_display_p.
+ * event-top.c: New variable exec_done_display_p.
+ * infrun.c (complete_execution): Print completion message if
+ corresponding flag is set.
+
+ * top.c (DEFAULT_PROMPT): Add space after "(gdb)" at end of prompt.
+
+ From: J.T. Conklin <jtc@redback.com>
+ * top.c (DEFAULT_PROMPT): Set to "(gdb)" if not already defined.
+ (init_main): Always use DEFAULT_PROMPT.
+
+Tue Aug 24 03:23:31 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c: Remove useless "purecov: deadcode" comments.
+ (hppa_use_struct_convention): Update for PA64.
+ (hppa_frame_saved_pc): Properly extract the saved PC in a call
+ dummy frame.
+ (in_solib_call_trampoline): Return nonzero if we are in a function
+ called ".stub".
+ (prologue_inst_adjust_sp): Handle std,ma.
+ (skip_prologue_hard_way): Handle more PA2.0/PA64 insns.
+ (hppa_frame_find_saved_regs): Similarly. Handle indirect save of
+ %r3 into the stack.
+
+ * config/pa/tm-hppa64.h (CALL_DUMMY_BREAKPOINT_OFFSET_P): Define.
+ (CALL_DUMMY_BREAKPOINT_OFFSET): Define.
+
+Tue Aug 24 14:59:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (gdb$(EXEEXT)): Add dependency on main.o that was
+ lost when libgdb.a was added.
+
+Tue Aug 24 14:26:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c, gdbarch.h: Convert to pure ISO-C.
+
+ * gdbarch.sh: New file.
+ * gdbarch.c, gdbarch.h: Add note describing gdbarch.sh
+
+Mon Aug 23 19:36:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (libgdb.a): New target.
+ (gdb$(EXEEXT)): Add dependency on libgdb.a.
+ (libgdb-files, LIBGDB_OBS, libgdb, LIBGDBDEPS, LIBGDBFILES): Delete.
+
+Mon Aug 23 10:16:32 1999 Jeffrey A Law (law@cygnus.com)
+
+ * infttrate.c (child_pid_to_exec_file): Find the correct base
+ of the stack for PA64.
+
+ * pa64solib.c: Fix some minor whitespace problems.
+ (bfd_lookup_symbol): New function.
+ (pa64_solib_create_inferior_hook): Find the address __dld_break
+ in the dynamic linker. Try to set a shlib event breakpoint in
+ that function.
+ (add_to_solist): Do not add the same shared library to the shlib
+ list more than once.
+
+Sun Aug 22 14:49:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * value.h (enum lval_type): Move declaration from here.
+ * defs.h (enum lval_type): To here.
+ * frame.h, gdbarch.h: Delete incomplete declaration of ``enum
+ lval_type''.
+
+1999-08-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.c (can_use_hardware_watchpoint): reject expressions
+ that refer to registers or register variables.
+
+Fri Aug 20 10:53:38 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Provide PA2.0W aware code.
+
+ * pa64solib.c pa64solib.h: New files.
+
+ * config/pa/hppa64.mt: Delete commented out code that is and
+ never will be appropriate for this target.
+ * config/pa/hpux11w.mt (TDEPFILES): Remove SOM references. Also
+ remove pa64solib.o.
+ * config/pa/hpux11w.mh (NATDEPFILES): Remove SOM references.
+
+ * configure.host; Use "hpux11w" and "hpux11" instead of
+ "hpux1100w" and "hpux1100" respectively
+ * config/pa/hpux11w.mh: Renamed from hpux1100w.mh.
+ * config/pa/hpux11w.mt, config/pa/hpux11.mh: Likewise.
+ * config/pa/hpux11.mt: Likewise.
+
+1999-08-19 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * breakpoint.h (target_hw_bp_type): new enum.
+ * breakpoint.c (insert_breakpoints): use enum instead of consts.
+ (remove_breakpoint): use enum instead of consts.
+ (throughout): use "warning" instead of "fprintf(stderr, ..."
+ [Also clean up a bunch of excessively long lines.]
+
+1999-08-19 J.T. Conklin <jtc@redback.com>
+
+ * i386-stub.c (waitabit): Removed.
+ (breakpoint): Update.
+
+ * i386-stub.c, m32r-stub.c, sparc-stub.c, sparcl-stub.c,
+ sparclet-stub.c (set_debug_traps): Don't send gratuitous ACK.
+
+ * m68k-stub.c (putpacket): Restore code so that packets are sent
+ until an ACK is received.
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * breakpoint.c (bpstat_stop_status): Accept triggered addresses
+ anywhere inside the region occupied by a watched variable as a
+ sign that the watchpoint fired. Don't stop if some watchpoint
+ was triggered, but its address doesn't match the address of this
+ watchpoint.
+ (TARGET_REGION_OK_FOR_HW_WATCHPOINT): New macro.
+ Default definition is to call TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT.
+ (can_use_hardware_watchpoint): Call TARGET_REGION_OK_FOR_HW_WATCHPOINT;
+ if it returns zero, return zero immediately.
+ (insert_breakpoints): Try to insert watchpoints for all the values
+ on the value chain, even if some of them fail to insert. Remove
+ the breakpoint if parts of its value chain couldn't be inserted.
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_stopped_by_watchpoint): Remove unused code.
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (tcgetpgrp, tcsetpgrp): New functions.
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_wait): If we are in a single-step mode, and the
+ next instruction is INT nn or INTO, use a temporary breakpoint to
+ simulate single-step mode, and reset the trace flag.
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (wp_op): New typedef.
+ (SHOW_DR): Print the length of watched region as well.
+ (go32_insert_aligned_watchpoint): Remove unused argument PID. All
+ callers and the prototype changed.
+ (go32_handle_nonaligned_watchpoint): Renamed from
+ go32_insert_nonaligned_watchpoint. Now handles all operations on
+ non-aligned watchpoints: insertion, deletion, and counting. If
+ called with wp_count as the first argument, return the count of
+ debug registers needed to watch the region. Don't break out of
+ the loop before all the addresses in the region are processed.
+ (go32_remove_watchpoint): Call go32_remove_aligned_watchpoint to
+ do the actual work.
+ (go32_remove_aligned_watchpoint): New function, modeled after
+ go32_insert_aligned_watchpoint. Removes watchpoints that watch
+ regions of arbitrary length by calling
+ go32_handle_nonaligned_watchpoint as needed.
+ (go32_region_ok_for_watchpoint): New function, called from
+ can_use_hardware_watchpoint via the new macro
+ TARGET_REGION_OK_FOR_HW_WATCHPOINT.
+
+ * config/i386/nm-go32.h (TARGET_REGION_OK_FOR_HW_WATCHPOINT):
+ Define to call go32_region_ok_for_watchpoint.
+ (DECR_PC_AFTER_HW_BREAK): Define back to zero (previous redefinition
+ to 1 was due to a bug in go32-nat.c).
+
+1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (cleanup_dregs): New function.
+ (go32_mourn_inferior): Call it.
+ (IS_REG_FREE, LOCAL_ENABLE_REG, GLOBAL_ENABLE_REG, DISABLE_REG,
+ SET_BREAK, SET_WATCH, IS_WATCH, WATCH_HIT): Protect arguments with
+ parentheses.
+ (SET_BREAK): Increment the debug register's reference count.
+ (DR_DEF): New macro, returns the access and length bits of the
+ breakpoint.
+ (SHOW_DR): Print the reference count of each register. Disable or
+ enable print-out depending on an environment variable GDB_SHOW_DR.
+ (go32_insert_aligned_watchpoint): Look for an occupied debug
+ register with the same address and access/length bits, and reuse
+ it by incrementing reference the count, before occupying another
+ register. Return zero upon success.
+ (go32_insert_nonaligned_watchpoint): Pass the read/write bits to
+ go32_remove_watchpoint.
+ (go32_remove_watchpoint): Accept an additional parameter: the
+ read/write bits of the watchpoint to remove, and only remove a
+ watchpoint if it's occupied and its address and read/write bits
+ match. Only disable the register if its reference count is zero;
+ otherwise just decrease the reference count.
+ (go32_remove_hw_breakpoint): Only decrease reference count and
+ disable the debug register if it is occupied and its access bits
+ match those of an instruction breakpoint.
+ (go32_insert_hw_breakpoint): Before occupying another debug
+ register, look for an already occupied register that defines an
+ instruction breakpoint with the same address. If found, increment
+ its reference count. Call SHOW_DR even if failed to insert a
+ breakpoint.
+
+ * config/i386/nm-go32.h (target_remove_watchpoint): Accept the
+ TYPE argument as well.
+
+Wed Aug 18 17:47:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c: Add more comments.
+
+1999-08-17 Stan Shebs <shebs@andros.cygnus.com>
+
+ * blockframe.c: Don't use PARAMS anymore, remove obsolete comment
+ about frameless functions.
+
+1999-08-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * thread.c (delete_thread): delete any step_resume breakpoint
+ held by the thread. (prune_threads): call delete_thread.
+ * breakpoint.c (breakpoint_init_inferior): if startup, then
+ delete any remaining step_resume breakpoints.
+ * infrun.c (handle_inferior_event): add cautionary comment.
+
+1999-08-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote.c (remote_async_mourn): New function. Async version of
+ remote_mourn().
+
+1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * terminal.h [__GO32__]: Remove conditional; DJGPP now supports
+ termios.
+
+1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * command.c (CANT_FORK) [__MSDOS__]: Define.
+ (shell_escape) [CANT_FORK]: If ARG is NULL, pass an empty string
+ to `system'.
+ [__DJGPP__]: Return to the original directory after the shell
+ exits.
+
+1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/i386/xm-go32.h (ROOTED_P): Don't reference X[1] if X[0]
+ is a null character.
+
+ * config/i386/nm-go32.h (DECR_PC_AFTER_HW_BREAK): Define to 1.
+
+1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (redir_cmdline_parse, redir_cmdline_delete,
+ redir_to_child, redir_to_debugger, redir_debug_init)
+ [__DJGPP_MINOR__ < 3]: Dummy stubs for redirecting debuggee's
+ standard handles.
+ (print_387_status): Print "last FP instruction", not "last
+ exception". Restore the upper 5 bits of the opcode that aren't
+ stored in the FPU state. Print the FPU stack in its physical
+ order, not relative to ST(0). Print "special", not "trap" for
+ unnormals and infinities. Print all 10 bytes of each FP register,
+ and print them with 19 significant digits.
+ (regno_mapping): Make the mapping consistent with tm-go32.h.
+ (sig_map): Add mappings for SIGQUIT, SIGFPE, SIGALRM. Map NMI to
+ SIGBUS.
+ (excep_map): New variable, maps GDB signals to DJGPP exceptions.
+ (go32_attach): Signal an error: we cannot attach to other
+ processes.
+ (go32_resume): Record the signal with which the inferior should be
+ resumed, mapped to the DJGPP exception number.
+ (go32_wait): Pass the signal recorded in go32_resume to the
+ debuggee. Save and restore debugger's and debuggee's current
+ working directory.
+ [__DJGPP_MINOR__ < 3]: Save and restore inferior's FPU state.
+ (store_register): FPU regsiters have numbers less than 31.
+ (go32_kill_inferior): Delete the parsed command-line storage.
+ (go32_create_inferior): Initialize the parsed command-line
+ storage. Parse the command line and create the redirections for
+ inferior's standard handles.
+ [__DJGPP_MINOR__ < 3]: Init the inferior's FPU state.
+ (ignore2): Function deleted.
+ (device_mode): New function, switches a character device between
+ raw and cooked mode.
+ (go32_terminal_init): Invalidate the raw/cooked mode information.
+ (go32_terminal_info): Print whether the inferior's terminal is in
+ raw or cooked mode.
+ [__DJGPP_MINOR__ > 2]: Say if standard handles are redirected or
+ closed by the inferior.
+ (go32_terminal_inferior): Switch standard handles to the
+ inferior's files/devices. Put the inferior's input device to
+ raw/cooked mode, exactly like we found it last time.
+ (go32_terminal_ours): Restore debugger's standard handles and put
+ the terminal into cooked mode. Save the mode of inferior's input
+ device.
+ (init_go32_ops): Assign go32_ops.to_attach,
+ go32_ops.to_terminal_info, go32_ops.to_terminal_ours_for_output.
+ Initialize inferior's cwd and the command-line storage.
+
+Mon Aug 16 14:29:30 1999 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (ARGS_GROW_DOWNWARD): Define.
+ * config/pa/tm-hppa64.h (ARGS_GROW_DOWNWARD): Undefine.
+ * hppa-tdep.c (hppa_push_arguments): Handle arguments growing in
+ both directions depending ARGS_GROW_DOWNWARD.
+ (hppa_find_saved_regs): Update for 64bit wide registers & pointers
+ and PA64 ABI.
+
+ * hppa-tdep.c (hppa_pop_frame): Various fixes for 64bit wide
+ registers and pointers.
+ (hppa_fix_call_dummy, skip_trampoline_code): Likewise.
+ (restore_pc_queue): Update tests for width of memory loads.
+ (hppa_push_arguments): Delete version that was #if 0'd out.
+
+ * hppa-tdep.c (push_dummy_frame): Handle the new 64it ABI.
+ (find_dummy_frame_regs): Corresponding changes.
+
+ * hppa-tdep.c (read_unwind_info): Initialize obj_private->dp.
+ (internalize_unwinds): Improve test for when to use segment
+ relative code for unwinder bounds.
+ (rp_saved): Fix offset of saved return pointer for the 64bit ABI.
+ (hppa_frame_saved_pc): Various updates to handle 64bit registers
+ and pointers.
+ (frame_chain, restore_pc_queue): Likewise.
+
+ * hppa-tdep.c (rp_saved): RP is saved at frame-16 when
+ pointers are 64bits wide.
+
+ * hppa-tdep.c (record_text_segment_lowaddr): New function.
+ (internalize_unwinds): Use it if addressess are 8 bytes wide.
+
+ * symfile.c (syms_from_objfile): No longer warn if the lowest
+ section does not have SEC_CODE set.
+
+ * Makefile.in (pa64solib.o): Add dependencies.
+
+ * hppah-nat.c (store_inferior_registers): Do not try to write a
+ nonzero value to the high part of IPSW. Fix typo in unable to store
+ warning.
+
+ * config/pa/tm-hppa.h (opd_data structure): Delete. Not actually
+ needed.
+ (struct obj_private_struct): Add new entry for the objfile's DP
+ value.
+ * config/pa/tm-hppa64.h (CALL_DUMMY): Add a nop to make it an even
+ number of instructions. Pack the dummy into word sized hunks.
+ (CALL_DUMMY_LENGTH): Update appropriately.
+ (PC_IN_CALL_DUMMY, CALL_DUMMY_LOCATION_AFTER_TEXT_END): Delete.
+
+Mon Aug 16 19:08:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in: Try -lsocket when looking for socketpair.
+ * configure, config.h: Re-generate.
+
+1999-08-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Christopher Faylor <cgf@cygnus.com>:
+
+ * event-loop.c (gdb_wait_for_event): Before going to wait for
+ another event with select or poll, flush the error and the output
+ streams.
+
+ * event-top.c (gdb_readline2): Do not buffer the input, because
+ doing so can interfere with select/poll in bad ways.
+
+Fri Aug 13 17:36:56 1999 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * maint.c (maintenance_dump_me) [__DJGPP__]: Simulate a core dump
+ with SIGABRT.
+ * utils.c (quit) [__MSDOS__]: Don't mention SIGINT, since it's not
+ gonna happen.
+ (notice_quit): No need to define this function for the DJGPP port.
+
+1999-08-13 James Ingham <jingham@leda.cygnus.com>
+
+ * arm-tdep.c (arm_frameless_function_invocation): SKIP_PROLOGUE
+ macro no longer modifies its argument. Update uses to accord.
+
+ * config/arm/arm.mt (TDEPFILES): Add the remote-rdi.o to the
+ TDEPFILES.
+ * configure.tgt: Add rdi-share to configdir for the Arm targets.
+
+Fri Aug 13 11:16:32 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppah-nat.c (store_inferior_registers): Revamp to be PA2.0W
+ aware.
+
+ * infttrace.c (ttrace_write_reg_64): New function.
+
+ * hp-symtab-read.c (is_in_import_list): Delete extern declaration.
+ * somread.c (is_in_import_list): Delete function.
+ * objfiles.c (is_in_import_list): New function.
+ * objfiles.h (is_in_import_list): Declare.
+
+ * config/pa/tm-hppa64.h (GDB_TARGET_IS_HPPA20W): Define before
+ including tm-hppah.h.
+ (PC_IN_CALL_DUMMY): Define.
+ (HPUX_1100): Similarly.
+ * config/pa/tm-hppa.h (somsolib.h, pa64solib.h): Conditionalize
+ includes on GDB_TARGET_IS_HPPA20W.
+
+ * configure.host: Distinguish between wide and narrow modes
+ for hpux11.
+ * config/pa/hpux1100w.mh, config/pa/hpux1100w.mt: New files.
+
+ * config/pa/tm-hppa64.h (STACK_ALIGN): Redefine.
+ (REG_PARM_STACK_SPACE): Likewise.
+
+ * config/pa/tm-hppa.h (CLEAN_UP_REGISTER_VALUE): Handle 64bit
+ PA target correctly.
+ (REG_PARM_STACK_SPACE): Define.
+ (struct unwind_table_entry): region_start and region_end are
+ CORE_ADDRs.
+ (typedef opd_data): New.
+ (obj_private_data_t): Include pointer to opd_data structure.
+
+1999-08-13 Keith Seitz <keiths@cygnus.com>
+
+ * stabsread.c (stabsread_clear_cache): New funciton which clears
+ an optimization cache of the reader.
+
+ * coffread.c (coff_symfile_finish): Give stabs reader a chance to
+ clean up.
+
+ * win32-nat.c (handle_load_dll): Don't suppress re-reading symbols
+ from a DLL if an objfile for it already exists. (Not that this should
+ happen anymore anyway...)
+
+1999-08-13 Keith Seitz <keiths@cygnus.com>
+
+ * config/mcore/tm-mcore.h (SAVE_DUMMY_FRAME_TOS): Define for MCore,
+ which also requires that the stack pointer be saved for call
+ dummies BEFORE arguments get pushed onto it.
+
+1999-08-12 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * source.c (mod_path) [_WIN32 || __DJGPP__]: Don't remove trailing
+ slash from "d:/". Don't overstep the beginning of name.
+ [_WIN32 || __MSDOS__]: Convert "d:" to "d:.", otherwise appending
+ a slash changes its meaning.
+ (openp): Use SLASH_P, not equality with SLASH_CHAR.
+ (print_source_lines_base) [CRLF_SOURCE_FILES]: Skip \r only before
+ a \n.
+ (forward_search_command) [CRLF_SOURCE_FILES]: Remove \r at the end
+ of all lines.
+ (reverse_search_command) [CRLF_SOURCE_FILES]: Likewise.
+
+ * gnu-regex.c (CHAR_CLASS_MAX_LENGTH): Don't use wide characters
+ unless HAVE_BTOWC is defined.
+
+Fri Aug 13 10:20:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From J.T. Conklin <jtc@redback.com>:
+ * gdbinit.in: Change the template .gdbinit to match the recent
+ fatal error handling change.
+
+1999-08-11 Keith Seitz <keiths@cygnus.com>
+
+ * maint.c (maintenance_internal_error): Fix typo in prototype.
+
+Wed Aug 11 15:38:05 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * remote.c (remote_rcmd): Pass an empty command across to the
+ target. Check for and handle an ``Enn'' return status.
+
+Tue Aug 10 13:59:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * maint.c (_initialize_maint_cmds): Add ``maintenance
+ internal-error'' command.
+ (maintenance_internal_error): New function.
+
+1999-08-10 James Ingham <jingham@leda.cygnus.com>
+
+ * top.c: Remove the disassembly_flavor_hook, use the new set_hook
+ instead.
+ * defs.h: Ditto.
+ * arm-tdep.c (set_disassembly_flavor_sfunc): Ditto.
+
+1999-08-10 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/i386/nm-i386sol2.h (FIND_NEW_THREADS): remove, obsolete.
+ * config/sparc/nm-sun4sol2.h (FIND_NEW_THREADS): remove, obsolete.
+
+1999-08-10 J.T. Conklin <jtc@redback.com>
+
+ * configure.tgt (i[3456]86-*-aout*, i[3456]86-*-coff*,
+ i[3456]86-*-elf*): Use embed.mt.
+ * config/i386/embed.mt: New file.
+
+1999-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (remote_async_open_1): Remove casting in call to
+ add_file_handler.
+ (extended_remote_async_create_inferior): Ditto.
+
+ * event-top.c (change_line_handler): Ditto.
+ (_initialize_event_loop): Ditto.
+
+ * infrun.c (complete_execution): Ditto.
+
+ * event-loop.c (add_file_handler): Change proc parameter to be ptr
+ to func with void parameter, rather than void*. Coerce second
+ paramter in calls to create_file_handler. Replace
+ async_handler_func and file_handler_func with handler_func.
+
+ * event-loop.h: Get rid of typedefs for file_handler_func and
+ async_handler_func, just have one, and call it handler_func.
+ Replace async_handler_func and file_handler_func occurrences with
+ handler_func.
+
+Tue Aug 10 03:13:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c: Delete random #if 0 code.
+ (is_branch): Handle new branching opcodes from PA2.0
+ (inst_saves_gr, inst_saves_fr): Handle additional instructions
+ used to save general and floating point registers in the stack.
+ (skip_prologue_hard_way): Handle additional instructions to
+ save the return pointer in the stack.
+ (after_prologue): Fix mis-guided and incorrect code to find
+ the end of the prologue using debug symbols.
+ (hppa_skip_prologue): Generally clean up comments, lose code
+ which does not apply to the PA, etc.
+
+Sun Aug 8 17:53:41 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * MAINTAINERS: Make Andrew Cagney the mn10300 maintainer.
+ Transfer responsibility for the PowerPC from Andrew Cagney to
+ Elena Zannoni.
+
+Tue Aug 10 13:59:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ Based on code from J.T. Conklin <jtc@redback.com>:
+ * utils.c (internal_error): Make quit? and coredump? separate
+ questions so that the user can dump-core and not quit.
+ (internal_error): Cleanup error message.
+
+1999-08-09 Tom Tromey <tromey@cygnus.com>
+
+ * kod-cisco.c (cisco_kod_open): Removed incorrect `arg' argument.
+
+Sun Aug 8 12:06:47 1999 Fred Fish <fnf@cygnus.com>
+
+ * coffread.c (process_coff_symbol): Remove section_offsets from
+ prototype and function definition. Get section_offsets from the
+ passed objfile and pass it on to callees the same way.
+ (coff_symtab_read): Ditto.
+ (coff_symfile_read): Ditto.
+ * dbxread.c (read_dbx_dynamic_symtab): Ditto.
+ (read_dbx_symtab): Ditto.
+ (dbx_symfile_read): Ditto.
+ (coffstab_build_psymtabs): Ditto.
+ (elfstab_build_psymtabs): Ditto.
+ (stabsect_build_psymtabs): Ditto.
+ * dstread.c (dst_symfile_read): Ditto.
+ * elfread.c (elf_symfile_read): Ditto.
+ * jv-class.c (jv_class_symfile_read): Ditto.
+ * mipsread.c (mipscoff_symfile_read): Ditto.
+ * nlmread.c (nlm_symfile_read): Ditto.
+ * os9kread.c (os9k_symfile_read): Ditto.
+ * somread.c (som_symfile_read): Ditto.
+ * stabsread.h (elfstab_build_psymtabs): Ditto.
+ * xcoffread.c (xcoff_initial_scan): Ditto.
+
+ * symfile.h (sym_read): Remove section_offsets from prototype.
+ * symfile.c (syms_from_objfile): Call sym_read without
+ section_offsets.
+ (reread_symbols): Ditto.
+
+ * elfread.c (elfstab_offset_sections): Use SIZEOF_SECTION_OFFSETS
+ to allocate sections offsets array.
+ * xcoffread.c (xcoff_symfile_offsets): Ditto.
+
+ * partial-stab.h (section_offsets): Get from objfile.
+ * dbxread.c (read_dbx_symtab): Fix typo that made -1 casted
+ to a CORE_ADDR look like an subtraction expression.
+ * objfiles.h: Add some comments.
+ * symfile.c: Add some comments.
+ * objfiles.c: Add some comments.
+ (objfile_relocated): Use ALL_OBJFILE_OSECTIONS to iterate over
+ sections.
+ (find_pc_sect_sections): Use ALL_OBJSECTIONS to iterate over all
+ sections in all objfiles.
+ * symfile.c (syms_from_objfile): Use ALL_OBJFILE_OSECTIONS.
+
+ * irix5-nat.c (symbol_add_stub): Fix typo that made taking the
+ address of lowest_sect with '&' look like a bitwise and op.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * solib.c (symbol_add_stub): Ditto.
+ * symfile.c (syms_from_objfile): Ditto.
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Minor format tweak.
+ * symfile.c (syms_from_objfile): Ditto, and fix typo.
+ * top.c (init_main): Fix typo in comment (DEFULAT_PROMPT).
+ * doc/gdbint.texinfo (find_sym_fns): This replaces symfile_init.
+
+1999-08-08 James Ingham <jingham@leda.cygnus.com>
+
+ * remote.c (remote_insert_breakpoint): Fix typo in Z packet support.
+ Also move Z packet support OUTSIDE of REMOTE_BREAKPOINT ifdef,
+ since this is not set for all targets that support the Z packet.
+
+Sun Aug 8 17:24:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.c (ui_out_table_begin, ui_out_table_body,
+ ui_out_table_end, ui_out_table_header, ui_out_list_begin,
+ ui_out_list_end, ui_out_stream_new, verify_field_proper_position,
+ verify_field_alignment): Replace incorrect calls to error with
+ calls to internal_error.
+
+Fri Aug 6 17:17:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (fatal): Delete declaration.
+ (internal_error): Declare.
+ * utils.c (nomem): Call internal_error instead of fatal.
+ (fatal_dump_core): Delete.
+ (malloc_botch): Print message direct to stderr.
+ (fatal): Delete definition.
+ * utils.c (internal_error): Define.
+
+ * gdbarch.h, gdbarch.c, hppah-nat.c, ch-exp.c, dsrec.c, sh-tdep.c,
+ infptrace.c, f-lang.c, symm-nat.c, top.c, m3-nat.c, v850-tdep.c,
+ remote-vx.c, remote-sim.c, remote-mips.c, source.c, infcmd.c,
+ findvar.c, remote.c: Replace fatal with call to internal_error.
+
+Sun Aug 8 15:28:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Move
+ definition from here.
+ * defs.h: To here.
+
+Sat Aug 7 21:44:59 1999 Fred Fish <fnf@cygnus.com>
+
+ * remote.c (remote_insert_breakpoint): Fix typo, missing ';'.
+
+Sun Aug 8 11:26:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Add break; to the default case.
+
+Fri Aug 6 19:26:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h: Delete #if ANSI_PROTOTYPES code, GDB assumes ISO-C.
+ * remote-rdp.c (send_rdp), remote-os9k.c (printf_monitor),
+ remote-mips.c: (mips_error), remote-array.c: (printf_monitor,
+ debuglogs), complaints.c (complain), monitor.c:
+ (monitor_printf_noecho, monitor_printf), language.c (type_error,
+ range_error), remote-st.c: (printf_stdebug), remote-sim.c
+ (gdb_os_printf_filtered, gdb_os_vprintf_filtered,
+ gdb_os_evprintf_filtered, gdb_os_error), serial.c (serial_printf),
+ utils.c (warning, error, fatal, fatal_dump_core, (query,
+ fprintf_filtered, fprintf_unfiltered, fprintfi_filtered,
+ printf_filtered, printf_unfiltered, printfi_filtered): Delete
+ legacy #ifndef ANSI_PROTOTYPES varargs code.
+
+ * defs.h: Don't #include <varargs.h>.
+ * remote-rdp.c, remote-os9k.c, remote-mips.c, remote-array.c,
+ monitor.c, remote-st.c: Don't include <varargs.h> or <stdarg.h>.
+
+1999-08-06 James Ingham <jingham@leda.cygnus.com>
+
+ * configure.in, configure: add the --enable-multi-ice to determine
+ whether to configure and build the multi-ice-gdb-server. Note,
+ for now this only builds on cygwin, so don't enable it for other
+ platforms...
+
+1999-08-06 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.in (SFILES): Added kod.c and kod-cisco.c.
+ (COMMON_OBS): Added kod.o and kod-cisco.o.
+ (kod-cisco.o): New target.
+ (kod.o): New target.
+ * kod-cisco.c: New file.
+ * kod.c: New file.
+
+1999-08-06 James Ingham <jingham@leda.cygnus.com>
+
+ These are some fixups for the Arm, and support for the
+ disassembly-flavor for the ARM.
+
+ * defs.h: Declare the disassembly_flavor_hook
+ * top.c: Define the disassembly_flavor_hook
+ * i386-tdep.c: Remove unnecessary declaration of the
+ disassembly_flavor_hook.
+
+ * config/arm/tm-arm.h: Change definition of
+ arm_init_extra_frame_info.
+ Add a few more comments.
+ * arm-tdep.c (arm_init_extra_frame_info): Listen to and use the
+ fromleaf parameter passed into init_extra_frame_info.
+ (set_disassembly_flavor_sfunc): New Function.
+ (set_disassembly_flavor): New Function.
+ (arm_othernames): Use the set_disassembly_flavor.
+ (_initialize_arm_tdep): Setup the disassembly flavor commands, and
+ initialize the flavor.
+ (arm_frameless_function_invocation): Adjust for
+ frameless functions that have 1 or 2 instructions that mimic the
+ standard APCS form.
+ (arm_scan_prologue): Be more careful about scanning the function
+ prologue. Don't match things that just have a few of the prologue
+ instructions out of order, and don't get thrown by the scheduler
+ migrating instructions into the prologue.
+
+ Add support for the "Z" and "z" packets to request the stub
+ to set a breakpoint.
+
+ * remote.c (set_remote_protocol_Z_packet_cmd): New function.
+ (show_remote_protocol_Z_packet_cmd): New Function.
+ (remote_open_1): Init the Z packet config.
+ (remote_async_open_1): Init the Z packet config.
+ (remote_insert_breakpoint): Use the "Z" packet if supported.
+ (remote_remove_breakpoint): Use the "z" packet if supported.
+ (remote_insert_watchpoint): New Function - currently wired to
+ nothing.
+ (remote_remove_watchpoint): Ditto.
+ (remote_insert_hw_breakpoint): Ditto.
+ (remote_remove_hw_breakpoint): Ditto.
+
+1999-08-06 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infcmd.c: Include parser-defs.h.
+ (interrupt_target_command): Declare.
+ (stack_dummy_testing): Remove old funky flag.
+ (run_stack_dummy): Remove unused reference to old funky flag.
+
+1999-08-06 Tom Tromey <tromey@cygnus.com>
+
+ * command.c (do_setshow_command): Call set_hook if not NULL.
+ * top.c (set_hook): New hook definition.
+ * defs.h (set_hook): Declare.
+
+1999-08-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c: Convert code to pure standard C, elim some warnings.
+ (stopped_for_shlib_catchpoint): Remove, never used.
+
+1999-08-05 Keith Seitz <keiths@cygnus.com>
+
+ * NEWS: Mention new Motorola MCore target.
+
+ * sparc-tdep.c (gdb_print_insn_sparc): Print insns of the current
+ architecture.
+
+Thu Aug 5 20:41:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (configdirs): Add check for socketpair.
+ * configure, config.in: Re-generate.
+
+ From Mon Jul 19 10:46:18 1999 Philippe De Muyter <phdm@macqel.be>:
+ * ser-pipe.c (sys/wait.h): Include this file only #if HAVE_SYS_WAIT_H.
+ (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Macros defined if needed.
+
+Thu Aug 5 20:04:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.c (debug_to_open, debug_to_attach, debug_to_post_attach,
+ debug_to_require_attach, debug_to_detach, debug_to_require_detach,
+ debug_to_wait, debug_to_post_wait, debug_to_fetch_registers,
+ debug_to_store_registers, debug_to_prepare_to_store,
+ debug_to_xfer_memory, debug_to_files_info,
+ debug_to_insert_breakpoint, debug_to_remove_breakpoint,
+ debug_to_terminal_init, debug_to_terminal_inferior,
+ debug_to_terminal_ours_for_output, debug_to_terminal_ours,
+ debug_to_terminal_info, debug_to_kill, debug_to_load,
+ debug_to_lookup_symbol, debug_to_create_inferior,
+ debug_to_post_startup_inferior,
+ debug_to_acknowledge_created_inferior,
+ debug_to_clone_and_follow_inferior,
+ debug_to_post_follow_inferior_by_clone,
+ debug_to_insert_fork_catchpoint, debug_to_remove_fork_catchpoint,
+ debug_to_insert_vfork_catchpoint,
+ debug_to_remove_vfork_catchpoint, debug_to_has_forked,
+ debug_to_has_vforked, debug_to_can_follow_vfork_prior_to_exec,
+ debug_to_post_follow_vfork, debug_to_insert_exec_catchpoint,
+ debug_to_remove_exec_catchpoint, debug_to_has_execd,
+ debug_to_reported_exec_events_per_exec_call,
+ debug_to_has_syscall_event, debug_to_has_exited,
+ debug_to_mourn_inferior, debug_to_can_run,
+ debug_to_notice_signals, debug_to_thread_alive, debug_to_stop,
+ debug_to_query, debug_to_rcmd, debug_to_enable_exception_callback,
+ debug_to_get_current_exception_event, debug_to_pid_to_exec_file,
+ debug_to_core_file_to_sym_file, debug_to_close): Send trace output
+ to ``gdb_stdlog'' instead of ``gdb_stderr''.
+
+Thu Aug 5 16:22:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (init_remote_ops): Initialize remote_ops.to_rcmd.
+ (init_remote_async_ops): Initialize remote_async_ops.to_query.
+ (remote_rcmd): New function.
+
+ * monitor.c (monitor_rcmd): Rename monitor_command.
+ (init_base_monitor_ops): Initialize monitor_ops.to_rcmd.
+ (_initialize_remote_monitors): Move "monitor" command from here.
+ * target.c (initialize_targets): To here.
+ (monitor_command): New function. Implement "monitor" command.
+
+ * target.c (cleanup_target): de_fault to_rcmd.
+ (update_current_target): INHERIT to_rcmd.
+ (debug_to_rcmd): New function.
+ (setup_target_debug): Initialize current_target.to_rcmd.
+
+ * target.h (struct target_ops): Add field to_rcmd.
+ (target_rcmd): Define.
+
+Thu Aug 5 14:24:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c: Replace comment describing remote protocol with
+ pointer to official document.
+
+Thu Aug 5 11:59:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_protocol_binary_download): New variable.
+ Replace ``remote_binary_download'' and ``remote_binary_checked''.
+ (set_remote_protocol_binary_download_cmd,
+ show_remote_protocol_binary_download_cmd): New functions.
+ (remote_open_1, remote_async_open_1, remote_cisco_open):
+ Initialize ``remote_protocol_binary_download'' instead of
+ ``remote_binary_download''.
+ (check_binary_download): Re-write.
+ (remote_write_bytes): Ditto.
+ (_initialize_remote): Add ``set remote X-packet'' and ``show
+ remote X-packet'' commands. Disable old ``set
+ remotebinarydownload'' command.
+
+1999-08-04 Keith Seitz <keiths@cygnus.com>
+
+ * remote-rdi.c (arm_rdi_close): Close the transport device, too.
+
+Wed Aug 4 10:42:58 1999 Fred Fish <fnf@cygnus.com>
+
+ * xcoffread.c (scan_xcoff_symtab): Change main_aux into
+ an array of 5 internal_auxent to leave room for bfd to
+ write n_numaux entries. Change code to use the first one.
+
+Wed Aug 4 19:58:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (cli_out_new): Move declaration from here.
+ * cli-out.h: To here. New file.
+ * Makefile.in (ui-out.o): Add missing dependencies.
+ (cli-out.o): Ditto.
+ * top.c, cli-out.c: #include "cli-out.h".
+
+1999-08-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * c-valprint.c (c_val_print): When printing decimal equivalent
+ of a char, cast appropriately.
+
+1999-08-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Jonathan Larmour <jlarmour@cygnus.co.uk>:
+ * main.c (print_gdb_help): Use gdbinit variable to determine file
+ name used for --nx help
+
+1999-08-01 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/mips/tm-mips.h (BIG_ENDIAN): Don't define here.
+
+1999-08-01 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * stabsread.c (read_range_type): Handle an unsigned range type
+ whose length in bytes is any power of two, not just a few
+ common ones.
+
+ * monitor.c (monitor_expect): When we receive a character that
+ isn't part of the string we were expecting, don't just start
+ matching again at the beginning of the string --- some shorter
+ suffix of the input might be a prefix of the string too.
+
+1999-07-31 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (symbol_file_command): Fix typo that made -1 casted
+ to a CORE_ADDR look like an subtraction expression.
+ (add_symbol_file_command): Ditto.
+
+1999-07-30 Jim Blandy <jimb@cygnus.com>
+
+ * hppa-tdep.c (pa_print_registers): Frob register output some more.
+
+1999-07-29 Jim Blandy <jimb@cygnus.com>
+
+ * config/pa/nm-hppah.h (PTRACE_ARG3_TYPE): After more
+ consideration, make this a CORE_ADDR, like WDB did.
+
+ Rather than casting every single use of really_free_pendings to
+ make_cleanup_func, why not actually make it have that type? Golly!
+ * buildsym.c (really_free_pendings): Change argument type to PTR.
+ buildsym.h (really_free_pendings): Fix declaration.
+ * dbxread.c (dbx_symfile_read, dbx_psymtab_to_symtab_1),
+ dwarf2read.c (psymtab_to_symtab_1), dwarfread
+ (psymtab_to_symtab_1), hp-psymtab-read.c (hpread_build_psymtabs),
+ os9kread.c (os9k_symfile_read, os9k_psymtab_to_symtab_1),
+ xcoffread.c (xcoff_psymtab_to_symtab_1, xcoff_initial_scan):
+ Remove casts.
+
+ Pass a CORE_ADDR safely through catch_errors.
+ * hppa-tdep.c (args_for_find_stub): New member, return_val.
+ (cover_find_stub_with_shl_get): Change argument and return type to
+ match catch_errors. Save return value of find_stub_with_shl_get
+ in *args.
+ (initialize_hp_cxx_exception_support): Collect value of
+ eh_notify_callback_addr from args.
+
+ Get rid of some noise. It would be nice to get helpful warnings
+ from the compiler about lossy conversions.
+ * hppa-tdep.c (eh_notify_hook_addr, eh_notify_callback_addr,
+ eh_break_addr, eh_catch_catch_addr, eh_catch_throw_addr,
+ break_callback_sal): Initialize these to zero, not NULL, to shush
+ warnings.
+ * infttrace.c (thread_fake_step): Compare signal to
+ TARGET_SIGNAL_0, not NULL, to avoid warnings.
+ (_initialize_infttrace): Add sanity check.
+
+ * config/pa/nm-hppah.h (PTRACE_ARG3_TYPE): Define this to be
+ long, so we can pass arguments properly to ptrace.
+
+ * hppah-nat.c (child_xfer_memory): Correctly compute mask to round
+ address to an int boundary.
+
+1999-07-29 Jim Blandy <jimb@cygnus.com>
+
+ Change from Ian Lance Taylor <ian@zembu.com>. The
+ i386_linux_sigtramp* functions should be moved to
+ i386-linux-tdep.c, when that file is introduced.
+
+ * config/i386/tm-linux.h (LINUX_SIGCONTEXT_SIZE): Define.
+ (LINUX_SIGCONTEXT_PC_OFFSET): Define.
+ (LINUX_SIGCONTEXT_SP_OFFSET): Define.
+ (SIGCONTEXT_PC_OFFSET): Don't define.
+ (I386_LINUX_SIGTRAMP): Define.
+ (IN_SIGTRAMP): Define.
+ (i386_linux_sigtramp): Declare.
+ (sigtramp_saved_pc): Define.
+ (i386_linux_sigtramp_saved_pc): Declare.
+ (FRAMELESS_SIGNAL): Define.
+ (FRAME_CHAIN, FRAME_SAVED_PC): Define after #undef.
+ * i386-tdep.c (i386_linux_sigtramp_start): New static function if
+ I386_LINUX_SIGTRAMP.
+ (i386_linux_sigtramp): New function if I386_LINUX_SIGTRAMP.
+ (i386_linux_sigtramp_saved_pc): Likewise.
+ (i386_linux_sigtramp_saved_sp): Likewise.
+
+1999-07-28 Jim Blandy <jimb@cygnus.com>
+
+ * infrun.c (handle_inferior_event): Don't try to use the code for
+ stepping over a function call to also handle stepping out of a
+ sigtramp on HP-UX. That ends up trashing step-resume breakpoints.
+ This change reverts some of David Taylor's change of 31 Dec 1998.
+ The HP-UX maintainer needs to submit a new change for whatever
+ problem the original change was trying to fix.
+
+1999-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (command_line_handler): Don't treat an empty line
+ from readline the same way as a multiline command. This avoids
+ missing detecting when the user presses just 'enter'.
+
+1999-07-28 Jim Blandy <jimb@cygnus.com>
+
+ Provide more sanity checking:
+ * infrun.c (handle_inferior_event): Before assigning a new
+ breakpoint to step_resume_breakpoint, make sure it's not already
+ pointing at one; if it is, that's a bug.
+ (check_for_old_step_resume_breakpoint): New function.
+
+1999-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * top.c (gdb_init) [__MSDOS__]: Arrange for GDB to return to the
+ original directory before exiting.
+ (cd_command) [_WIN32 || __MSDOS__]: Canonicalize the new directory
+ name explicitly. Handle "d:/" names correctly.
+ (init_history) [__MSDOS__]: Use _gdb_history as the default GDB
+ history file name.
+
+Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (enum packet_support, enum packet_detect, struct
+ packet_config): Define.
+ (set_packet_config_cmd, show_packet_config_cmd,
+ add_packet_config_cmd, init_packet_config): New functions.
+ Generic support for optional packets.
+ (remote_protocol_P): Replace stub_supports_P.
+ (set_remote_protocol_P_packet_cmd, show_remote_protocol_P_packet_cmd):
+ New functions.
+ (_initialize_remote): Add ``set remote-protocol-P-packet'' command.
+ (remote_open_1, remote_async_open_1, remote_cisco_open):
+ Initialize ``remote_protocol_P''.
+ (remote_store_registers): Re-write ``P'' probe logic.
+ (store_register_using_P): New function.
+
+ From Ian Lance Taylor <ian@airs.com>:
+ (remote_prepare_to_store): Only read registers when ``P'' packet
+ is in state unsupported or support-unknown.
+
+1999-07-24 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (default_symfile_offsets): Clear section_offsets
+ before filling it in.
+
+1999-07-16 Keith Seitz <keiths@cygnus.com>
+
+ * remote.c (_initialize_remote): "remotebreak" should be a var_boolean.
+
+1999-07-15 Jim Blandy <jimb@cygnus.com>
+
+ Make the output from "info registers" fit withinin 80 columns.
+ * hppa-tdep.c (pa_print_registers): Make it easy to change row and
+ column counts. Switch to three columns, instead of four, and
+ adjust spacing.
+
+ First cut at supporting HPPA2.0 in "wide" (64-bit) mode.
+ * configure.tgt: Add hppa2.0w target.
+ * config/pa/hppa64.mt, config/pa/tm-hppa64.h: New files.
+ * hppa-tdep.c (hppa_fix_call_dummy): Dyke out code to tweak the
+ call dummy, if target is PA2.0w. This is temporary, until I get
+ function calls working.
+ * hppah-nat.c (fetch_register): Rewritten to handle both narrow
+ and wide register requests.
+ (HPPAH_OFFSETOF): New macro.
+
+ * gdbtypes.c (is_integral_type): New function.
+ * gdbtypes.h: Prototype for above.
+
+1999-07-15 J.T. Conklin <jtc@redback.com>
+
+ * configure.tgt (i[3456]86-*-vxworks*): New target.
+ * config/i386/vxworks.mt: New file, x86 VxWorks target
+ * config/i386/tm-vxworks.h: New file.
+
+ * configure.tgt (powerpc-*-vxworks*): New target.
+ * config/powerpc/vxworks.mt: New file, PowerPC VxWorks target
+ * config/powerpc/tm-vxworks.h: New file.
+
+ * NEWS: Mention the new configs.
+
+1999-07-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.c (struct ui_out): Remove deprecated fields.
+
+1999-07-15 Fernando Nasser <fnasser@cygnus.com>
+
+ * target.c (target_preopen): Prevent query when not from_tty.
+ * infcmd.c (run_command): Prevent query when not from_tty.
+
+1999-07-15 Fernando Nasser <fnasser@cygnus.com>
+
+ * event-loop.c: Fix typo in comment.
+
+1999-07-15 Fernando Nasser <fnasser@cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Fix output when no breakpoins are
+ found.
+
+1999-07-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (display_gdb_prompt): Don't do anything if we are
+ running under the interpreter.
+
+Wed Jul 14 17:29:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c (struct pipe_state): Define.
+ (pipe_close): Retain the PID of the sub-process using ``struct
+ pipe_state''. Delete #ifdef code that used popen().
+ (pipe_close): Kill of the sub-process as part of the cleanup.
+
+ * serial.h (struct _serial_t): Add field ``state''.
+
+1999-07-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (display_gdb_prompt): Don't display the prompt if we
+ are in the middle of an execution command. Also trick readline so
+ it doesn't try to display the prompt.
+ (command_line_handler): Get rid of change_prompt, unused variable.
+ Use {push, pop}_prompt mechanism in case of multiline commands.
+
+ * infrun.c (complete_execution): Set target_executing to 0 as
+ first thing, so that display_gdb_prompt does the right thing.
+
+Tue Jul 13 20:29:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * parse.c (build_parse): Fix conditional increment of num_std_regs
+ for SP_REGNUM. Was conditional on FP_REGNUM.
+
+Tue Jul 13 16:44:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Revert 1999-07-07 Stan Shebs
+ <shebs@andros.cygnus.com> indentation change. Don't let indent
+ mess with these files.
+
+Mon Jul 12 11:15:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_RAW,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERTIBLE): Define.
+ (REGISTER_RAW_SIZE): Re-define as mips_register_convert_to_raw.
+ * mips-tdep.c (mips_register_convert_to_raw,
+ mips_register_convert_to_virtual, ): New functions.
+ (mips_register_raw_size, mips_register_convertible): New
+ functions. Handle bug introduced by ``Wed Apr 1 23:13:23 1998
+ Andrew Cagney <cagney@b1.cygnus.com>'' where remote mips64 target
+ transfers SR as 64 bits yet GDB expected only 32 bits.
+ (mips64_transfers_32bit_regs): New static variable.
+ (_initialize_mips_tdep): Add obscure command ``set
+ remote-mips64-transfers-32bit-regs'' that provides backward
+ compatibility.
+ (do_gp_register_row): Extract register values from raw buffer.
+
+ * NEWS: Document protocol change.
+
+1999-07-12 Keith Seitz <keiths@cygnus.com>
+
+ * rdi-share/unixcomm.c (Unix_ResetSerial): Remove CYGWIN32
+ conditional. It's no longer needed.
+ (SERPORT1, SERPORT2): Linux serial ports are "/dev/ttyX", not
+ "/dev/cuaX" (X=0,1,2,3,...).
+
+Mon Jul 12 02:02:00 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * defs.h, utils.c (fputstrn_filtered, fputstrn_unfiltered,
+ fputstrnn_unfiltered): New functions.
+ (gdb_printchar): Delete.
+
+ * remote.c (print_packet): Replace gdb_printchar with
+ fputstrn_filtered.
+ (getpkt): Use fputstrn_unfiltered to dump packet received.
+ (putpkt_binary): Use fputstrnn_unfiltered to dump packet sent.
+
+1999-07-09 Keith Seitz <keiths@cygnus.com>
+
+ * blockframe.c (blockvector_for_pc_sect): When looking for a block,
+ we want the one whose end is greater than our PC, not greater or equal.
+
+1999-07-08 Stan Shebs <shebs@andros.cygnus.com>
+
+ * sparcl-tdep.c (init_sparclite_ops): Fix doc strings, remove
+ useless inits.
+ (sparclite_ops): Remove redundant decl.
+
+Thu Jul 8 16:48:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c (pipe_open): Bi-directional popen found on both
+ NetBSD and OpenBSD.
+ * ser-pipe.c: New file. Implement popen() style serial interface.
+ * NEWS: Mention.
+ * Makefile.in (ALLDEPFILES): Add ser-pipe.c.
+ (ser-pipe.o): Add new target. Specify dependencies.
+ (SER_HARDWIRE): Add ser-pipe.o.
+ * serial.c (serial_open): Recognize a serial pipe ``|''.
+
+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>
+
+ * remote-mips.c (fputs_readable): Rename puts_readable, add struct
+ gdb_file argument.
+ (fputc_readable): Rename putc_readable, add struct gdb_file
+ argument.
+
+ * remote-mips.c (mips_expect_timeout, mips_receive_header,
+ mips_send_packet, mips_receive_packet), remote-rdp.c (put_byte,
+ get_byte, put_word, rdp_init, rdp_init), remote-sds.c
+ (sds_interrupt, sds_wait, readchar, putmessage, read_frame,
+ getmessage), remote-udi.c (udi_store_registers, fetch_register):
+ (store_register), xmodem.c (readchar), utils.c (puts_debug),
+ gnu-nat.h (debug), parse.c (parse_exp_1): Cleanup - send debug/log
+ messages to gdb_stdlog.
+
+1999-07-06 Stan Shebs <shebs@andros.cygnus.com>
+
+ * exec.c: Remove long-#ifed-out section of code that confuses
+ indent.
+ * gdbtypes.c (add_mangled_type): Add some braces to indicate
+ grouping better.
+ * gnu-nat.c: Remove literal newlines embedded in strings,
+ causes indent to weird out.
+ * language.c (binop_result_type): Remove extra paren.
+ * lynx-nat.c: Add a missing paren to fetch_core_registers decl.
+ * nec4102rom.c (vr4102_insert_step): Fix typos.
+ (_initialize_vr4102_rom): Remove literal newline in string.
+ * config/a29k/tm-a29k.h: Suppress formatting of pictures.
+ * config/m68k/xm-3b1.h: Remove excess #endif.
+
+ Declare Pyramid configuration obsolete.
+ * configure.host, configure.tgt: Comment out Pyramid configs.
+ * Makefile.in: Comment out Pyramid-related actions.
+ * pyr-xdep.c, pyr-tdep.c, config/pyr/*: Comment out.
+ * NEWS: Mention obsolete status.
+
+1999-07-06 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * remote.c: Include <sys/time.h> to pick up FD_SET et al defns on
+ some old Linux distributions.
+ * remote-os9k.c, remote-st.c, ser-tcp.c, ser-unix.c,
+ sparcl-tdep.c, remote.c: Back out inclusion of <sys/select.h>.
+ It isn't necessary after all.
+
+1999-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (strip_bg_char): Remove assignment from 'if' condition.
+
+1999-07-05 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * remote.c: Include <sys/select.h> if it exists in order to pick up
+ FD_SET et al defns.
+ * remote-os9k.c: Same.
+ * remote-st.c: Same.
+ * ser-tcp.c: Same.
+ * ser-unix.c: Same.
+ * sparcl-tdep.c: Same.
+
+Fri Jul 2 19:38:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (target_output_hook): Delete definition.
+ * defs.h (target_output_hook): Delete declaration.
+
+ * remote.c (remote_console_output): Delete call to
+ target_output_hook(). Send target output to gdb_stdtarg using an
+ unfiltered write. Make more robust.
+
+ * remote-sim.c (gdb_os_write_stdout, gdb_os_write_stderr):
+ Ditto. For moment, do not try to separate target stdout and stderr
+ streams.
+
+ * defs.h (gdb_stdtarg): New global. Output from target and
+ simulators.
+
+1999-07-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (return_to_top_level): Do all the exec_cleanups too.
+
+ * event-top.c (command_handler): Set up for a continuation, if we
+ are in the middle of running an execution command which will
+ finish later on. Do cleanups, an display of time/space only if not
+ running with an async target or not running an execution command.
+ (command_line_handler_continuation): New function. Continuation
+ for command_line_handler.
+
+ * utils.c (exec_cleanup_chain): New cleanup chain to be used in
+ async mode for the execution commands.
+ (make_exec_cleanup): New function. Add a cleanup to the
+ exec_cleanup_chain.
+ (do_exec_cleanups): New Function. Do cleanups on the
+ exec_cleanup_chain.
+ (add_continuation): New function. Add a new continuation to the
+ cmd_continuation list.
+ (do_all_continuations): New function. Do all the continuations on
+ the cmd_continuation list.
+
+ * top.h (ALL_CLEANUPS): Move from here to defs.h.
+
+ * defs.h (struct continuation_arg): New structure. Arg to pass to
+ the call to a command continuation.
+ (struct continuation): New structure. Continuation for an
+ execution command.
+ (ALL_CLEANUPS): Move here from top.h.
+
+ * remote.c (remote_async_open_1): Set things up for telling the
+ target we are running the extended protocol, only after the target
+ has stopped.
+ (set_extended_protocol): New function. Tell the target we are
+ using the extended protocol.
+ (remote_async_resume): Set things up for sync execution only if
+ this is the first time we are called.
+
+ * breakpoint.c (until_break_command_continuation): New function.
+ Stuff to be done after the target stops during the 'until'
+ command.
+ (until_break_command): Set things up for completing the 'until'
+ command later on. Do the final cleanups only if not running
+ asynchronously or async execution is not supported by the target.
+
+ * infcmd.c (until_command): Recognize '&' at end of command and
+ handle it properly.
+ (finish_command_continuation): New function. Do whatever is needed
+ after the target has stopped.
+ (finish_command): Recognize '&' at end of command and handle it
+ properly. Don't do stuff needed after target has stopped if
+ running asynchronously and target has async. Use exec_cleanup_chain
+ if running asynchronously and target is asynchronous.
+
+ * infrun.c (cmd_continuation): New gloabl variable. Used to
+ coplete execution commands in async mode, after the target has
+ stoped.
+ (fetch_inferior_event): Use exec_cleanup_chain, instead of
+ cleanup_chain. Do all the exec cleanups at the end. Do all the
+ continuations at the end. Call complete_execution from here,
+ instead of normal_stop.
+ (complete_execution): Cleanup the signals handlers for SIGINT
+ before displaying the prompt.
+ (start_remote): Set target_executing to 1.
+ (normal_stop): Don't call complete_execution from here.
+
+Thu Jul 1 19:14:30 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (struct dummy_frame): Add member ``top''.
+ (generic_push_dummy_frame): Initialize top to sp.
+ (generic_save_dummy_frame_tos): New function. Initialize top.
+ (generic_find_dummy_frame): Check for the top of the frame.
+
+ * blockframe.c (generic_push_dummy_frame): Free the dummy_frame
+ registers.
+
+ * config/mn10300/tm-mn10300.h (SAVE_DUMMY_FRAME_TOS): Define.
+ (TARGET_READ_FP): Return the SP as a best guess.
+
+Wed Jun 30 15:45:48 1999 Jeffrey A Law (law@cygnus.com)
+
+ * configure.host (hppa*-*-hpux11*): Accept any version of hpux11
+ instead of hpux11.0*.
+
+1999-06-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * source.c (directory_command): Add missing test for from_tty.
+
+1999-06-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c: Include event-loop.h.
+ (remote_async_ops, extended_async_remote_ops): Define new target
+ vector structures for asynchronous debugging.
+ (remote_async_open): New function. Asynchronous version of
+ remote_open.
+ (extended_remote_async_open): New function. Asynchronous version
+ of extended_remote_open.
+ (remote_async_open_1): New function. Async version of
+ remote_open_1.
+ (remote_async_detach): New function. Async version of
+ remote_detach.
+ (remote_async_resume): New function. Async version of
+ remote_resume.
+ (initialize_sigint_signal_handler, handle_remote_sigint,
+ handle_remote_sigint_twice, async_remote_interrupt,
+ async_remote_interrupt_twice, cleanup_sigint_signal_handler): New
+ functions. Used for handling ^C while target is running.
+ (remote_async_wait): New function. Async version of remote_wait.
+ (remote_async_kill): New function. Async version of remote_kill.
+ (extended_remote_async_create_inferior): New function. Async
+ version of extended_remote_create_inferior.
+ (init_remote_async_ops): New function. Initialize target vector
+ for target async.
+ (init_extended_async_remote_ops): New function. Initialize target
+ vector for target extended-async.
+ (_initialize_remote): Initialize remote_async_ops and
+ extended_async_remote_ops.
+
+ * infrun.c: Include "event-loop.h".
+ (sync_execution): new global variable.
+ (proceed): Invoke wait_for_inferior and normal_stop only if not
+ running in async mode or if target doesn't support async
+ execution.
+ (start_remote): Don't call wait_for_inferior and normal_stop if
+ not running in async mode or if target not async. If running async
+ and target is async, start the target in simulated synchronous
+ mode.
+ (async_ecss, async_ecs): New global vars, for inferior state.
+ (fetch_inferior_event): New function. Async version of
+ wait_for_inferior.
+ (complete_execution): New function. Reset of gdb prompt and stdin,
+ after inferior execution has completed.
+ (normal_stop): Call complete_execution at end of asynchronous
+ execution.
+
+ * infcmd.c (strip_bg_char): New function to detect the background
+ execution char '&'.
+ (run_command): Modify to support background and foreground
+ execution in async mode.
+ (continue_command): Ditto.
+ (step_1): Ditto.
+ (jump_command): Ditto.
+ (interrupt_target_command): New function. Interrupt the
+ target execution.
+ (_initialize_infcmd): Add new command 'interrupt'.
+
+ * top.c (target_executing): New global variable.
+ (execute_command): Reject commands that cannot be executed while
+ the target is running asynchronously.
+
+ * event-top.c (push_prompt): Make non static.
+ (pop_prompt): Make non static. If the current prompt is empty,
+ don't try to copy it over the previous one.
+ (handle_sigint): Make non static.
+ (command_handler): Do the cleanups only when not executing with an
+ asynchronous target.
+
+ * event-loop.c (delete_async_signal_handler): Pass a pointer to a
+ pointer to a signal handler, so that is can be freed at the end.
+
+ * target.c (update_current_target): Inherit to_has_async_exec.
+
+ * inferior.h: Add global variables target_executing, and
+ sync_execution. Export function fetch_inferior_event.
+
+ * event-loop.h: Add push_prompt, pop_prompt, handle_sigint to the
+ exported functions. Update prototype for delete_signal_handler.
+
+ * target.h (struct target_ops): New target op: to_has_async_exec.
+ (target_has_async): New macro.
+
+ * Makefile.in (infrun.o): Add dependency on event-loop.h.
+ (remote.o): Ditto.
+
+1999-06-28 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * solib.c (clear_solib): Don't disable breakpoints if we're
+ running an a.out executable (Solaris's SunOS emulation).
+
+1999-06-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * main.c (main): Remove intialization of command_loop_hook, it
+ is now done in _initialize_event_loop().
+ * event-loop.c (gdb_do_one_event): Make static.
+ (start_event_loop): New function. Just start the event loop.
+ * event-top.c (cli_command_loop): New name for start_event_loop().
+ (gdb_readline2): Make non static.
+ (_initialize_event_loop): Set command_loop_hook to cli_command_loop.
+ * event-loop.h: Adjust exported functions accordingly.
+
+ * top.c (init_main): Move setting of async_command_editing_p from
+ here.
+ * event-top.c (_initialize_event_loop): To here.
+ (change_line_handler): Revert previous change. Add comment.
+ (_initialize_event_loop): Revert previous change.
+ (cli_command_loop): New name for start_event_loop().
+ (start_event_loop): New function. This just starts up the event loop.
+ (gdb_readline2): Make non static.
+ (_initialize_event_loop): Set command_loop_hook to cli_command_loop.
+
+1999-06-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (change_line_handler): Get rid of the global
+ variable input_fd, use `fileno (instream)' instead.
+ (_initialize_event_loop): Ditto
+
+ * event-loop.c (add_file_handler): New function. Wrapper for
+ create_file_handler.
+ (create_file_handler): Make static.
+ * event-top.c (_initialize_event_loop): Call add_file_handler,
+ instead of create_file_handler.
+ (change_line_handler): Ditto.
+ Remove poll.h include.
+ * event-loop.h: Export add_file_handler instead of
+ create_file_handler.
+
+1999-06-24 Stan Shebs <shebs@andros.cygnus.com>
+
+ Declare Altos configuration obsolete.
+ * configure.host, configure.tgt: Comment out Altos config.
+ * Makefile.in: Comment out Altos-related actions.
+ * altos-xdep.c, config/m68k/altos.mh, altos.mt, tm-altos.h,
+ xm-altos.h: Comment out.
+ * NEWS: Mention obsolete status.
+
+1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in: Add MAKEHTML and MAKEHTMLFLAGS; pass them down;
+ recognize html and install-html targets.
+ * gdbserver/Makefile.in: Add empty html and install-html targets.
+ * nlm/Makefile.in: Ditto.
+ * rdi-share/Makefile.in: Ditto.
+
+1999-06-24 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c (agent_command): Remove vestigial call to ax_reqs.
+
+1999-06-24 James Ingham <jingham@leda.cygnus.com>
+
+ * arm-tdep.c (arm_othernames): Change both gdb's register display
+ AND the opcode disassembly register naming if the othernames
+ command. Fixes the gdb part of CR 101177.
+
+1999-06-23 Stan Shebs <shebs@andros.cygnus.com>
+
+ Declare Convex configuration obsolete.
+ * configure.host, configure.tgt: Comment out Convex configs.
+ * Makefile.in: Comment out Convex-related actions.
+ * convex-xdep.c, convex-tdep.c, config/convex/*: Comment out.
+ * NEWS: Mention obsolete status.
+
+1999-06-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * main.c: Turn on async by default by setting async_p to 1.
+
+Wed Jun 23 20:39:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * main.c (main): Recognize --ui. Will eventually replace
+ --interpreter.
+
+Wed Jun 23 15:44:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com>:
+ * frame.h (enum lval_type): Delcare when an __STDC__ compiler.
+ Reverts Mon Aug 11 16:08:52 1997 Fred Fish <fnf@cygnus.com>
+ change.
+ * utils.c (gdb_file_rewind, gdb_file_put): Fix. A void function
+ does not return a result.
+
+Wed Jun 23 15:30:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (set_thread, remote_get_threadinfo,
+ remote_threads_info, remote_current_thread, remote_get_threadlist,
+ extended_remote_restart, get_offsets, remote_open_1,
+ remote_detach, remote_resume, remote_wait, remote_fetch_registers,
+ remote_store_registers, check_binary_download, remote_write_bytes,
+ remote_read_bytes, remote_search, putpkt_binary, putpkt_binary,
+ read_frame, compare_sections_command, remote_query,
+ packet_command, remote_info_process): Use alloca to create space
+ for arrays of size PBUFSIZ.
+
+1999-06-22 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * top.c: Update copyright years to include 1999.
+
+1999-06-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c: Move include of event-loop.h, to avoid redefinition of
+ NFDBITS.
+
+ * event-loop.c (create_file_handler): Do not do a realloc of the
+ pollfd structure of the notifier, unless there is already one.
+ Include <sys/types.h> for platforms that have no poll.
+
+ * event-top.c: Fix prototype for _initialize_event_loop.
+ (_initialize_event_loop): Do something only if running in async
+ mode.
+
+1999-06-17 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Make the '/c' print format use a true character type. This is
+ more appropriate than builtin_type_char for languages other than
+ C, and C tolerates it.
+ * gdbtypes.c (builtin_type_true_char): New variable.
+ (build_gdbtypes): Initialize it.
+ * gdbtypes.h (builtin_type_true_char): New declaration.
+ * printcmd.c (print_scalar_formatted): When the format is 'c',
+ extract the value as a builtin_type_true_char.
+
+ * jv-exp.y (yylex): Say character literals are java_char_type, not
+ builtin_type_char. Java treats the latter like `byte'.
+
+1999-06-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Makefile.in (top_h): Define.
+ (event-loop.o): Add dependencies on top.h and defs.h.
+ (event-top.o): Add dependency on terminal.h.
+
+ * event-loop.c: Get rid of #include <readline.h>.
+
+ * event-loop.h: Get rid of nested #include's.
+ * event-loop.c: Rearrange includes to accomodate change in
+ event-loop.h. Include poll.h, not sys/poll.h.
+ * event-top.c: Ditto.
+ * main.c: Ditto.
+
+1999-06-16 David Taylor <taylor@louisiana.cygnus.com>
+
+ * alpha-tdep.c (alpha_pop_frame): if frame->proc_desc
+ is NULL, call find_proc_desc so we know how to restore
+ the registers.
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * cli-out.c (cli_out_new): Add flags argument to ui-out-new call.
+ * source.c (print_source_lines_base): Test for ui_source_list flag
+ and use ui_out for file and line output.
+ * ui-out.c (struct ui_out): Add flags field to struct and to default
+ initialization.
+ (ui_out_set_flags): New function. Handle flags.
+ (ui_out_clear_flags): New function. Ditto.
+ (ui_out_test_flags): New function. Ditto.
+ (ui_out_new): Add flags parameter.
+ * ui-out.h: Add flags argument to ui_out_new declaration.
+ Add declarations for ui_out_*_flags functions.
+ (enum ui_flags): New enum. Defines ui_out flags.
+ * top.c (gdb_init): Fix misspelling typo.
+
+1999-06-15 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * event-top.c (start_event_loop): call get_prompt.
+ (display_gdb_prompt): call get_prompt.
+ (async_stop_sig): call get_prompt.
+
+1999-06-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (delete_file_handler): When positioning prev_ptr,
+ keep looping while the one after is not equal to file_ptr, instead
+ of equal.
+
+1999-06-14 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: Add Jimmy Guo and Jim Blandy as HP testsuite and
+ SVR4 solib maintainers, respectively.
+
+1999-06-14 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ Add parameters to the gdb prompt.
+ * top.c (prompt): Rename to gdb_prompt_string for clarity.
+ (command_line_input): rename "prrompt" to prompt_arg for clarity.
+ (gdb_readline): rename "prrompt" to prompt_arg for clarity.
+ (read_command_lines): rename "prompt" to prompt_arg for clarity.
+ (stop_sig): call get_prompt instead of reading prompt string directly.
+ (command_loop): ditto.
+ (simplified_command_loop): ditto.
+ (gdb_prompt_escape): New variable. Esc char for prompt parameters.
+ (get_prompt_1): New function, workhorse for get_prompt.
+ (get_prompt): Completely rewrite. Add functionality for a
+ parameterized prompt, ie. the displayed prompt can change according
+ to the value of one or more expressions given as parameters in the
+ prompt string.
+ (init_main): use renamed variable gdb_prompt_string. Add new
+ command "set prompt-escape-char" to set gdb_prompt_escape.
+
+Sun Jun 13 10:44:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (gdb_stdlog), main.c: Declare.
+ * main.c (main): Initialize.
+ * gdbarch.c: Write trace messages to the log file.
+ * remote.c: Update any debug/log prints.
+
+1999-06-11 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (remote_wait): Clean up new thread handling.
+ (record_currthread): Announce new threads.
+
+1999-06-11 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * partial-stab.h (case N_LSYM, 'T' descriptor): Don't create
+ partial symbol table entries for nameless enums, even if the type
+ name is " ". (We still pick up the enum elements, though.)
+
+ * partial-stab.h: Remove #if 0'd sections, dating back to 1992,
+ which set a variable which exists nowhere else in the source.
+ Please examine your test suite output carefully, and report any
+ problems to me.
+
+1999-06-11 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (gdb_init): Add pre-processor test for UI_OUT.
+
+1999-06-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (setup_event_loop): Change name to start_event_loop.
+ Move the intialization of event-loop variables to
+ _initialize_event_loop.
+ (_initialize_event_loop): New function. Called at init time, to
+ set up important event-loop variables.
+
+ * event-loop.h: setup_event_loop is now start_event_loop.
+ * main.c (main): Ditto.
+
+Fri Jun 11 18:34:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (gdb_file_rewind_ftype, gdb_file_rewind,
+ set_gdb_file_rewind, gdb_file_put_ftype, gdb_file_put,
+ set_gdb_file_put): Declare.
+
+ * utils.c (gdb_file_new): Initialize ``rewind'' and ``put''.
+ (struct gdb_file): Add to_rewind and to_put.
+ (null_file_put, null_file_rewind, gdb_file_put, gdb_file_rewind,
+ set_gdb_file_put, set_gdb_file_rewind): New functions.
+ (tui_file_rewind, tui_file_put): New functions.
+ (tui_file_new): Add rewind and put.
+
+ * cli-out.c (cli_spaces): Replace gdb_stdout with data->stream.
+ (cli_text, cli_message, cli_flush, out_field_fmt,
+ field_separator): Ditto.
+
+Fri Jun 11 16:08:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * cli-out.c (cli_out_new): Replace init_cli_out,
+ * top.c (gdb_init): Call cli_out_new.
+ * main.c (main): Delete call to set_ui_out_impl.
+
+ * ui-out.h (set_ui_out_impl, cli_ui_out_impl), ui-out.c: Delete.
+ (cli_out_new): Add declaration. Will move later.
+
+ * ui-out.c (ui_out_new, ui_out_data), ui-out.h: New functions.
+ (struct ui_out): Add field data.
+ (ui_out_new): Replace init_ui_out_state.
+
+ * ui-out.c (XMALLOC): Define.
+ (ui_out_stream_new, append_header_to_list): Use XMALLOC instead of
+ xmalloc.
+ * cli-out.c (XMALLOC): Define.
+
+Fri Jun 11 10:31:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.c (ui_out_field_int, ui_out_field_skip,
+ ui_out_field_fmt): Rewrite statements to remove infix operators.
+
+ * ui-out.c (get_curr_header, verify_field_proper_position,
+ verify_field_alignment, init_ui_out_state, set_ui_out_impl,
+ append_header_to_list): Add explicit ui_out parameter.
+ (struct ui_out): Move the local variables ``table_flag'',
+ ``body_flag'', ``table_columns'', ``table_id'', ``list_flat'',
+ ``field_count'', ``headerfirst'', ``headerlast'', ``headercurr''
+ into this struct.
+ (typedef ui_out_hdr): Delete.
+ (struct ui_out_hdr): Rename struct _ui_out_hdr.
+ (ui_out_table_begin, ui_out_table_end, ui_out_table_body,
+ ui_out_table_header, ui_out_field_int, ui_out_list_begin,
+ ui_out_table_end, ui_out_list_end, ui_out_field_skip,
+ ui_out_table_body, ui_out_list_begin, ui_out_list_end,
+ ui_out_field_string, ui_out_field_fmt, init_ui_out_state,
+ verify_field_proper_position, verify_field_alignment,
+ clear_header_list, append_header_to_list, _initialize_ui_out):
+ Update.
+
+ * ui-out.h (typedef streambuf): Delete.
+ (struct _streambuf): Rename to struct ui_stream.
+ * breakpoint.c (breakpoint_1), stack.c (print_frame_info_base),
+ printcmd.c (print_frame_args): Rename streambuf to struct
+ ui_stream.
+
+Fri Jun 11 15:10:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_push_arguments): Fix order of arguments passed
+ to store_address.
+
+Fri Jun 11 10:31:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (tty_input): Change array to pointer.
+ (_initialize_remote): Call build_remote_gdbarch_data.
+ (build_remote_gdbarch_data): New function. Allocate space for
+ tty_input.
+ (readsocket, readtty): Delete extern declaration of tty_input.
+
+1999-06-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (gdb_readline2): Call the command handling function
+ via the input_handler pointer.
+ (change_line_handler): When turning off editing, set input_handler
+ as well.
+
+ * utils.c (prompt_for_continue): If running asynchronously, call
+ async_request_quit, instead of request_quit.
+
+ * tracepoint.c (read_actions): If running asynchronously, set the
+ signal handler for STOP_SIGNAL to handle_stop_sig.
+
+ * top.h: (source_line_number, source_file_name, source_error,
+ source_pre_error, history_expansion_p, server_command): export for
+ use of event-top.c.
+
+ * event-top.c: Include top.h and terminal.h.
+ (instream): Remove extern declaration.
+ (handle_sigint, handle_sigquit, handle_sighup, handle_sigfpe,
+ handle_sigwinch, async_do_nothing, async_disconnect,
+ async_float_handler, async_stop_sig): Make static.
+ (async_request_quit, async_do_nothing, async_disconnect,
+ async_float_handler, async_stop_sig): Add gdb_glient_data
+ argument.
+ (handle_stop_sig): New function.
+ (sigtstp_token): New variable.
+ (sigint_token, sigquit_token, sigfpe_token, sigwinch_token):
+ Change their type tp PTR.
+ (mark_async_signal_handler_wrapper): New function.
+ (setup_event_loop): Initialize all the variables used by readline
+ only if not already done while reading the .gdbinit file. Display
+ the initial gdb prompt, if .gdbinit took care of setting things up
+ for readline.
+ (change_line_handler): When turning on the use of readline,
+ initialize input_handler as well.
+ (command_line_handler): Set up the signal handler for STOP_SIGNAL
+ to be handle_stop_sig.
+ (async_init_signals): Remove coercion of signal handlers in calls
+ to create_async_signal_handler. Initialize token for stop signal.
+ (handle_sigint): Call async_request_quit using one argument.
+ (handle_sigint, handle_sigquit, handle_sighup, handle_sigfpe,
+ handle_sigwinch): Call mark_async_signal_handler_wrapper instead
+ of mark_async_signal_handler.
+
+ * event-loop.h: Add extern declarations for handle_stop_sig,
+ async_command_editing_p, async_annotation_suffix,
+ new_async_prompt, the_prompts.
+
+ * top.c (command_line_input): Set the signal handler to be
+ handle_stop_sig, in case gdb is running asynchronously.
+ (get_prompt): Return the top of the prompt stack if running
+ asynchronously.
+ (set_prompt): Set the top of the prompt stack if running
+ asynchronously.
+ (init_main): Move ``extern'' vars from here to event-loop.h.
+
+1999-06-10 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * values.c (value_from_string): new function. Make a value_ptr
+ from a string, with storage in local GDB memory (not in inferior).
+ * value.h (value_from_string): add prototype.
+ * remote.c (remote_cisco_ops): New remote target, "target cisco".
+ (init_remote_cisco_ops): New function, initialize new target.
+ (remote_cisco_mourn, remote_cisco_wait, remote_cisco_open,
+ remote_cisco_close): New functions, implement new target cisco.
+ (minitelnet, readtty, readsocket) New functions, implement the
+ I/O pass-through mode for target cisco.
+ (remote_wait): Detect special enhanced version of the 'S' packet
+ for target cisco.
+ (remote_cisco_expand): Perform Cisco variant of RLL decoding.
+
+1999-06-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (gdb_wait_for_event): Initialize num_found to 0.
+
+ * top.c (print_prompt): Delete this function.
+
+ From: Andrew Cagney <cagney@b1.cygnus.com>
+
+ * event-top.c (async_hook): Delete extern declaration.
+
+ * defs.h: Replace ``async_hook'' with ``async_p''.
+ * top.c (gdb_init, init_main, init_main, init_main, init_main):
+ Replace ``async_hook'' with ``async_p''.
+
+ * main.c: Rename ``async'' to ``async_p''.
+ (main): Add --noasync option.
+ (main): Hook in the asynchronous event-loop based CLI using
+ command_loop_hook instead of async_hook. Delete call to
+ async_hook().
+
+Thu Jun 10 21:14:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mn10300-tdep.c (mn10300_store_return_value,
+ mn10300_extract_struct_value_address,
+ mn10300_extract_return_value), config/mn10300/tm-mn10300.h: New
+ functions.
+ * config/mn10300/tm-mn10300.h (EXTRACT_STRUCT_VALUE_ADDRESS,
+ STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE): Update.
+ (TARGET_MN10300): Delete macro. Not used.
+
+Thu Jun 10 20:04:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mn10300-tdep.c (mn10300_register_names): Make static.
+ (STORE_STRUCT_RETURN): Do not modify SP.
+
+ * config/mn10300/tm-mn10300.h(mn10300_register_name),
+ mn10300-tdep.c : New function.
+ * config/mn10300/tm-mn10300.h (REGISTER_NAME): Update.
+ * config/mn10300/tm-mn10300.h (mn10300_saved_pc_after_call),
+ mn10300-tdep.c: New function.
+ * config/mn10300/tm-mn10300.h (SAVED_PC_AFTER_CALL): Update.
+
+Wed Jun 9 16:42:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.h, top.c (simplified_command_loop): Make global.
+
+ * main.c (main): Delete call to call_interp_loop. Interpreters
+ hook in using command_loop_hook.
+ * top.c (call_interp_loop): Delete function.
+
+1999-06-10 Keith Seitz <keiths@cygnus.com>
+
+ * mcore-rom.c (picobug_dumpregs): Return a value. Any value, it
+ doesn't matter.
+ * mcore-tdep.c (mcore_analyze_prologue): Set NO_MORE_FRAMES
+ if the start of the function is the entry point.
+ (mcore_analyze_prologue): rotli takes an immediate, not an
+ offset immediate.
+ (mcore_push_arguments): Fix compiler warning.
+
+1999-06-09 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-tdep.c (skip_prologue): Don't mistake a branch for a
+ subroutine call.
+
+1999-06-08 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (remote_wait): Add 'N' response packet, which is a
+ stop with signal number plus section offsets for .text, .data and
+ .bss. This is used by Cisco to indicate relocation offsets.
+ (remote_cisco_section_offsets, remote_cisco_objfile_relocate):
+ new files to support 'N' packet.
+ (remote_info_process): New function. Implements the
+ "info remote-process" command, by means of which the remote target
+ can report anything it wants to about the remote process/app being
+ debugged.
+ (_initialize_remote): add info remote-proc command.
+ (remote_threads_info): New function for "info threads" command.
+ Attempts to use new query "qfThreadInfo" instead of the old
+ undocumented query.
+ * exec.c (exec_set_section_offsets) new files to support 'N' packet.
+
+Tue Jun 8 13:33:42 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * inferior.h (generic_target_read_pc, generic_target_write_pc,
+ generic_target_read_fp, generic_target_write_fp,
+ generic_target_read_sp, generic_target_write_sp): Declare new
+ functions.
+ * findvar.c (generic_target_read_pc, generic_target_write_pc,
+ generic_target_read_fp, generic_target_write_fp,
+ generic_target_read_sp, generic_target_write_sp): New functions.
+ (TARGET_READ_PC, TARGET_WRITE_PC, TARGET_READ_FP, TARGET_WRITE_FP,
+ TARGET_READ_SP, TARGET_WRITE_SP): Default to corresponding generic
+ function.
+ (write_pc_pid, write_pc_pid, read_sp, write_sp, read_fp,
+ write_fp): Simplify.
+
+ * gdbarch.c (verify_gdbarch): Always verify TARGET_PTR_BIT,
+ TARGET_SHORT_BIT, TARGET_INT_BIT, TARGET_LONG_BIT,
+ TARGET_LONG_LONG_BIT, TARGET_FLOAT_BIT, TARGET_DOUBLE_BIT,
+ TARGET_LONG_DOUBLE_BIT, TARGET_READ_PC, TARGET_WRITE_PC,
+ TARGET_READ_FP, TARGET_WRITE_FP, TARGET_READ_SP, TARGET_WRITE_SP,
+ USE_GENERIC_DUMMY_FRAMES, CALL_DUMMY_BREAKPOINT_OFFSET_P,
+ CALL_DUMMY_P, CALL_DUMMY_STACK_ADJUST_P, GET_SAVED_REGISTER,
+ REGISTER_CONVERTIBLE, PUSH_ARGUMENTS, PUSH_RETURN_ADDRESS,
+ FRAME_CHAIN_VALID.
+ (GET_GDBARCH, SET_GDBARCH): Delete macros. Implement functions
+ directly.
+ * gdbarch.h, gdbarch.c: Call fatal() instead of abort(). Identify
+ the function / macro with a problem. Always verify a architecture
+ attribute before returning it.
+ * gdbarch.h, gdbarch.c (generic_register_convertible_not): New
+ function.
+
+ * mips-tdep.c (mips_push_return_address): New function.
+ * config/mips/tm-mips.h (PUSH_RETURN_ADDRESS): Define.
+
+ * mips-tdep.c (mips_gdbarch_init): Initialize short_bit,
+ double_bit, long_double_bit, read_pc, write_pc, read_fp, write_fp,
+ read_sp, write_sp, frame_chain_valid, get_saved_register,
+ push_arguments, push_return_address, register_convertible,
+ call_dummy_p, use_generic_dummy_frames,
+ call_dummy_breakpoint_offset_p, call_dummy_stack_adjust_p,
+ call_dummy_words and sizeof_call_dummy_words.
+ * config/mips/tm-mips.h: Don't define CALL_DUMMY when multi-arch.
+
+1999-06-07 Keith Seitz <keiths@cygnus.com>
+
+ * v850ice.c (init_hidden_window): Do not rely on the existence of
+ a gui for window creation. Return boolean status.
+ (v850ice_open): Use boolean status of init_hidden_window.
+ Allow any ICE execution command to run under CLI. Maybe one
+ day gdb will use a real event loop and allow this code to run.
+ * configure.tgt: Configure the v850 ice for all cygwin-hosted
+ toolchains.
+
+Mon Jun 7 23:37:26 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Delete.
+ * mips-tdep.c (mips_init_extra_frame_info): Allocate saved_regs.
+ (temp_saved_regs): Replace struct with a simple pointer.
+ (set_reg_offset, mips32_heuristic_proc_desc, heuristic_proc_desc,
+ mips_init_extra_frame_info): Update.
+
+Mon Jun 7 21:40:12 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Move elements from here.
+ * mips-tdep.c (struct frame_extra_info): To here.
+
+ * mips-tdep.c (mips_print_extra_frame_info, mips_find_saved_regs,
+ mips_init_extra_frame_info, mips_pop_frame): Update
+ (mips_init_extra_frame_info): Allocate space for the extra info.
+
+Mon Jun 7 21:08:50 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (mips_init_extra_frame_info), mips-tdep.c:
+ Rename init_extra_frame_info. Add argument ``fromleaf''.
+ mips-tdep.c (mips_gdbarch_init): Add mips_init_extra_frame_info.
+
+ * config/mips/tm-mips.h (mips_print_extra_frame_info),
+ mips-tdep.c: New function.
+ (PRINT_EXTRA_FRAME_INFO): Update definition.
+
+Mon Jun 7 20:11:07 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h, config/mips/tm-irix3.h,
+ config/mips/tm-tx19.h, config/mips/tm-tx19l.h,
+ config/mips/tm-tx39.h, config/mips/tm-tx39l.h: Rename macro
+ REGISTER_NAMES to MIPS_REGISTER_NAMES.
+
+ * config/mips/tm-mips.h (REGISTER_NAME): Define.
+ * mips-tdep.c (mips_processor_reg_names): New static variable.
+ (mips_register_name): New function.
+ (mips_set_processor_type): Update mips_processor_reg_names.
+ (mips_generic_reg_names): Initialize using MIPS_REGISTER_NAMES.
+ (mips_gdbarch_init): Add mips_register_name.
+
+Sun Jun 6 11:09:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (PBUFSIZ): Re-define so that value is computed at
+ run-time.
+ (MAXBUFBYTES): Re-define as a macro function.
+ * gdbarch.h, gdbarch.c: Add multi-arch support for REGISTER_BYTES.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+
+1999-06-05 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * symtab.c (decode_line_1): Accept filenames with spaces in
+ 'linespecs' when enclosed in double quotation marks and handle
+ drive specification is DOS format (D:).
+
+1999-06-04 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * parse.c: Don't include <ctype.h> twice.
+
+1999-06-04 David Taylor <taylor@louisiana.cygnus.com>
+
+ Sat May 15 12:16:09 1999 Per Bothner <bothner@deneb.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): Remove Gilmore rant.
+ (Of course C has "expected types", at least if you allow
+ brace-initializer expressions - as in Gcc.)
+ Remove NULLing out expect_type. Do pass NULL_TYPE in place
+ the incoming expect_type where appropriate.
+
+Fri Jun 4 10:56:23 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Make it work for GCC compiled
+ executables without end.o. Clean up lots of mis-guided comments.
+
+Fri Jun 4 17:10:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * parser-defs.h (std_regs): Replace array with pointer.
+ * parse.c (build_parse): Build the std_regs table according to the
+ standard registers available.
+ (_initialize_parse): Register std_regs and num_std_regs as
+ architecture specific.
+ * gdbarch.h, gdbarch.c: Add multi-arch support for SP_REGNUM,
+ FP_REGNUM, PC_REGNUM, NUM_REGS, REGISTER_NAME.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+
+1999-06-03 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * printcmd.c (print_frame_args): Convert some of the output to use
+ ui_out.
+ * stack.c (print_frame_info_base): Adjust the call to the above
+ function.
+
+1999-06-03 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * thread.c: eliminate the target_thread_vector (functionality
+ moved into the standard target vector).
+ * gdbthread.h: eliminate target_thread_vector. Move all related
+ defines into remote.c, since they are no longer shared with thread.c.
+ * remote.c: eliminate the target_thread_vector.
+ (remote_find_new_threads): change return type to void, consistent
+ with the target vector table. (cont_thread): rename continue_thread.
+ (record_currthread): remove dead code. (remote_thread_alive):
+ clean up and simplify. (threadref etc.): move definitions to here
+ from gdbthread.h.
+
+1999-06-02 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * inftarg.c (child_create_inferior): Remove dead HPUX specific code
+ which tries to find csh.
+ * fork-child.c: Remove DEBUGGING predefine and conditionalized
+ printfs.
+ (fork_inferior): Remove dead HPUX specific code which assumes shell
+ is csh.
+
+ * hppa-tdep.c: Remove DEBUGGING and #if 0 debugging printfs.
+ * parse.c: Ditto.
+ * somread.c: Ditto.
+
+ * gdbarch.h: Forward decl of struct value.
+
+Thu Jun 3 10:12:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (do_d10v_pop_frame): Rename d10v_pop_frame. Make
+ static.
+ * d10v-tdep.c (d10v_pop_frame), config/d10v/tm-d10v.h: New
+ function. Call generic_pop_current_frame.
+ * config/d10v/tm-d10v.h (POP_FRAME): Update.
+ * gdbarch.h, gdbarch.c (frame_num_args_unknown): New function.
+ * gdbarch.h, gdbarch.c: Add multi-arch support for POP_FRAME,
+ SKIP_PROLOGUE, INNER_THAN, DECR_PC_AFTER_BREAK,
+ FUNCTION_START_OFFSET, REMOTE_TRANSLATE_XFER_ADDRESS, FRAME_CHAIN,
+ FRAME_CHAIN_VALID, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS,
+ FRAME_LOCALS_ADDRESS, FRAME_ARGS_SKIP,
+ FRAMELESS_FUNCTION_INVOCATION, REGISTER_BYTE, REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, SAVED_PC_AFTER_CALL,
+ FRAME_NUM_ARGS, MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE,
+ REGISTER_SIZE.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+ * config/d10v/tm-d10v.h (DMEM_START, IMEM_START, STACK_START,
+ ARG1_REGNUM, ARGN_REGNUM, RET1_REGNUM): Move definitions from
+ here.
+ * d10v-tdep.c: To here.
+ * config/d10v/tm-d10v.h (struct type): Move declaration from here.
+ * gdbarch.h: To here.
+ * config/d10v/tm-d10v.h (struct frame_info, struct
+ frame_saved_regs, struct type): Delete declarations.
+
+1999-06-02 Robert Hoehne <robert.hoehne@gmx.net>
+
+ * go32-nat.c: go32_terminal_init, go32_terminal_inferior and
+ go32_terminal_ours are new functions to save/restore the inferior`s
+ stdin/stdout filemodes
+
+1999-06-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: Add Mark Kettenis, Jeff Law, and Philippe De Muyter
+ as maintainers for Hurd, HP/UX, and COFF, respectively.
+
+1999-06-02 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c (inf_continue): New function.
+ (struct inf): Use `unsigned int' instead of `int' for bit-fields.
+ Add new bit-field named `nomsg'.
+ (inf_validate_procinfo): Renamed from inf_validate_stopped, all
+ callers changed. Also update the `nomsg' and `traced' fields of
+ INF.
+ (make_inf): Initialize INF->nomsg.
+ (inf_cleanup): Reset INF->nomsg.
+ (inf_detach): Call `inf_validate_procinfo'. Call `inf_continue'
+ instead of `inf_signal' if the inferior does not have a message
+ port.
+ (gnu_resume): Likewise.
+ (gnu_create_inferior): Reset INF->nomsg in `attach_to_child'.
+ Call `inf_validate_procinfo' after returning from `fork_inferior'.
+ (gnu_attach): Update signal thread and tracing state.
+
+ * config/i386/tm-i386gnu.h: Include "i386/tm-i386.h" instead of
+ "i386/tm-i386v.h".
+ (STACK_END_ADDR): Remove.
+ (SIGCONTEXT_PC_OFFSET): New define.
+ Include "tm-sysv4.h".
+
+1999-06-02 J.T. Conklin <jtc@redback.com>
+
+ * config/tm-vxworks.h: New file, header for definitions common to
+ all vxWorks targets.
+ * config/a29k/tm-vx29k.h, config/i960/tm-vx960.h,
+ config/m68k/tm-vx68.h, config/mips/tm-vxmips.h,
+ config/sparc/tm-vxsparc.h: Include tm-vxworks.h.
+
+Wed Jun 2 17:37:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (IMPORT_SHLIB): New unwind stub type.
+
+1999-06-02 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.tgt: Alphabetically reorder some targets.
+
+1999-06-02 Keith Seitz <keiths@cygnus.com>
+
+ * v850ice.c (v850ice_xfer_memory): Insert lost "break".
+
+1999-06-02 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * rs6000-tdep.c (variants): Fix description of 750 register set.
+ (Thanks to J. T. Conklin.)
+
+Wed Jun 2 16:10:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for
+ STORE_STRUCT_RETURN, STORE_RETURN_VALUE,
+ EXTRACT_STRUCT_VALUE_ADDRESS, USE_STRUCT_CONVENTION,
+ FRAME_INIT_SAVED_REGS and INIT_EXTRA_FRAME_INFO.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+
+ * config/d10v/tm-d10v.h (FRAME_INIT_SAVED_REGS): Replace
+ FRAME_FIND_SAVED_REGS.
+ (d10v_frame_init_saved_regs): Replace d10v_frame_find_saved_regs.
+ * d10v-tdep.c (d10v_pop_frame, d10v_frame_chain,
+ d10v_frame_init_saved_regs): Update.
+ * gdbarch.h: Disallow FRAME_FIND_SAVED_REGS when multi-arch.
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for
+ D10V_MAKE_DADDR, D10V_MAKE_IADDR, D10V_DADDR_P, D10V_IADDR_P,
+ D10V_CONVERT_DADDR_TO_RAW and D10V_CONVERT_IADDR_TO_RAW.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+
+ * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Delete.
+ * d10v-tdep.c (struct frame_extra_info): Define.
+ (d10v_init_extra_frame_info, d10v_pop_frame, d10v_frame_chain,
+ d10v_frame_find_saved_regs): Update.
+ * gdbarch.h: Disallow EXTRA_FRAME_INFO when multi-arch.
+
+Tue Jun 1 13:36:31 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * config/m68k/tm-delta68.h (FRAME_NUM_ARGS): Macro prototype fixed.
+ * config/m68k/tm-news.h, config/ns32k/tm-merlin.h: Ditto.
+ * config/ns32k/tm-umax.h (FRAME_NUM_ARGS): Old macro definition
+ removed; new macro prototype fixed.
+
+Wed Jun 2 11:18:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for
+ EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS, PUSH_DUMMY_FRAME,
+ PUSH_RETURN_ADDRESS, POP_FRAME, FRAME_FIND_SAVED_REGS.
+ * d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for
+ REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW.
+ * config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
+
+ * defs.h (REGISTER_NAME): Move compatibility definition from here.
+ * gdbarch.h: To here.
+
+ * frame.h, blockframe.c (generic_fix_call_dummy): New
+ stub function.
+ * gdbarch.h, gdbarch.c: Add multi-arch support for FIX_CALL_DUMMY.
+ * config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
+
+Tue Jun 1 20:06:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_gdbarch_init): Set get_saved_register.
+ * config/d10v/tm-d10v.h: Update.
+
+Tue Jun 1 19:50:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for TARGET_READ_PC,
+ TARGET_WRITE_PC, TARGET_READ_FP, TARGET_WRITE_FP, TARGET_READ_SP
+ and TARGET_WRITE_SP.
+ * config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
+
+Tue Jun 1 19:19:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (default_gdbarch): Set field GET_SAVED_REGISTER to
+ generic_get_saved_register.
+ * gdbarch.c: Change update dispatch functions so that they check
+ for a NULL function pointer.
+
+Tue Jun 1 19:19:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Add multi-arch support for TARGET_INT_BIT,
+ TARGET_CHAR_BIT, TARGET_SHORT_BIT, TARGET_FLOAT_BIT,
+ TARGET_DOUBLE_BIT and TARGET_LONG_DOUBLE_BIT.
+ * config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
+
+Tue Jun 1 18:47:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * parse.c (build_parse): New function. Initialize
+ msym_text_symbol_type, msym_data_symbol_type and
+ msym_unknown_symbol_type.
+ (_initialize_parse): Call build_parse.
+ (_initialize_parse): Register variables msym_text_symbol_type,
+ msym_data_symbol_type as msym_unknown_symbol_type as
+ per-architecture.
+
+Tue Jun 1 11:30:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (_initialize_d10v_tdep): Register d10v as an
+ architecture.
+ (d10v_gdbarch_init): New function.
+ * confg/d10v/tm-d10v.h (GDB_MULTI_ARCH): Define.
+
+Tue Jun 1 10:45:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Convert
+ macros into functions.
+ * config/d10v/tm-d10v.h, d10v-tdep.c (d10v_register_convertable,
+ d10v_register_convert_to_virtual, d10v_register_convert_to_raw):
+ The new functions.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * breakpoint.c (print_it_normal): Convertion of part of the output
+ to use ui-out.
+ (mention): Same as above.
+ * infcmd.c (run_command): Same.
+ * source.c (print_source_lines_base): Same.
+ * stack.c (print_frame_info_base): Same.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Fix names of fields on ui_out
+ produced output.
+ * ui-out.h: Cosmetic change.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * stack.c (print_args_stub): Add missing stream parameter.
+
+Mon May 31 15:50:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ Fri May 28 16:51:00 1999 Martin Dorey <martin.dorey@madge.com>:
+ * valops.c, value.h (default_push_arguments): Fix order of
+ parameters to match PUSH_ARGUMENTS arguments.
+
+1999-05-28 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): Simplified script format for
+ non-console output.
+
+1999-05-28 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): Fixed printing of if clauses.
+ * breakpoint.c (breakpoint_1): Adjust call to the above.
+ * top.c (show_user_1): Same as above.
+
+1999-05-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (call_interp_loop): Correct build problem with UI_OUT defined.
+
+Thu May 27 11:42:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (EXTRACT_STRUCT_VALUE_ADDRESS): Return 0.
+
+ * valops.c (value_assign): Delete redundant test of
+ REGISTER_CONVERTIBLE.
+
+Thu May 27 11:33:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/w65/tm-w65.h, config/tic80/tm-tic80.h, config/sh/tm-sh.h,
+ config/i386/tm-i386m3.h, config/i386/tm-go32.h,
+ config/i386/tm-cygwin.h, config/h8500/tm-h8500.h,
+ config/d30v/tm-d30v.h, config/d10v/tm-d10v.h: Delete definition of
+ macro NAMES_HAVE_UNDERSCORE.
+
+Thu May 27 09:31:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (EXTRACT_STRUCT_VALUE_ADDRESS,
+ EXTRACT_STRUCT_VALUE_ADDRESS_P): Provide default definitions.
+ * values.c (value_being_returned): Use
+ EXTRACT_STRUCT_VALUE_ADDRESS when EXTRACT_STRUCT_VALUE_ADDRESS_P.
+
+Wed May 26 13:51:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (tui_file_new, tui_file_delete, tui_fileopen): New
+ functions.
+ (tui_file_isatty): Rename gdb_file_isatty.
+ (gdb_file_init_astring): Use tui_file_new to create stream.
+ (gdb_file_get_strbuf, gdb_file_adjust_strbuf): Call gdb_file_data
+ to access the tui_stream.
+ (tui_file_flush): Rename gdb_flush. Call gdb_file_data to access
+ the tui_stream. Pass FILE and not STREAM down.
+
+ * utils.c (struct stdio_file, stdio_file_flush, stdio_file_fputs,
+ stdio_file_isatty, stdio_file_delete, stdio_file_new,
+ stdio_fileopen): Define type and functions. Implement a simple
+ STDIO based gdb_file.
+ (struct gdb_file, gdb_file_new, gdb_file_delete, null_file_isatty,
+ null_file_flush, null_file_fputs, null_file_delete, gdb_file_data,
+ set_gdb_file_flush, set_gdb_file_isatty, set_gdb_file_fputs,
+ set_gdb_file_data, fputs_unfiltered, gdb_flush, gdb_file_isatty):
+ Define type and functions. Implement virtual functions for
+ gdb_file.
+
+ * defs.h (struct gdb_file): Declare.
+ (GDB_FILE): Change type to struct gdb_file. Deprecate.
+ (gdb_file_flush_ftype, gdb_file_fputs_ftype,
+ gdb_file_isatty_ftype, gdb_file_delete_ftype): Add function type
+ declarations.
+
+ * defs.h (set_gdb_file_flush, set_gdb_file_fputs,
+ set_gdb_file_isatty, set_gdb_file_data, gdb_file_new,
+ gdb_file_delete, gdb_file_data, stdio_fileopen, tui_fileopen): Add
+ function declarations.
+ (gdb_fopen): Re-implement. Call stdio_file_new.
+ (gdb_fclose): Re-implement. Call gdb_file_delete.
+
+ * main.c (tui_file_fputs): Rename fputs_unfiltered. Use
+ gdb_file_data to gain access to the tui_stream data. Use FILE
+ instead of STREAM where applicable.
+ (main): Create gdb_stdout and gdb_stderr using tui_fileopen.
+
+ * defs.h (struct tui_stream): Add field ts_magic.
+ * utils.c (tui_file_magic): Local variable.
+ (tui_file_new): Set field ts_magic.
+ (tui_file_delete, tui_file_isatty, gdb_file_init_astring,
+ gdb_file_get_strbuf, gdb_file_adjust_strbuf, tui_file_flush):
+ Verify ts_magic.
+
+1999-05-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): New function, fix bug in printing
+ while commands and uses ui_out.
+ * gdbcmd.c: Add prototype for the above.
+ * breakpoint.c (breakpoint_1): Fix breakpoint script printing.
+ * command.c (show_user_1): Fix user command script printing.
+
+1999-05-25 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * breakpoint.c (insert_breakpoints, remove_breakpoint,
+ breakpoint_1): Add a 'default' case, which prints a warning
+ message, to remove EGCS warnings.
+
+1999-05-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * utils.c (gdb_file_adjust_strbuf): Take into account the
+ possibility that the buffer has not been allocated yet.
+
+Tue May 25 16:05:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Provide default definition.
+
+ * valops.c (value_assign), infcmd.c (do_registers_info), findvar.c
+ (value_from_register, value_of_register): Remove #ifdef
+ REGISTER_CONVERTIBLE. Assume REGISTER_CONVERTIBLE etc defined.
+
+1999-05-25 Keith Seitz <keiths@cygnus.com>
+
+ * config/mcore/tm-mcore.h (FRAME_NUM_ARGS): Re-write definition of
+ FRAME_NUM_ARGS so that it returns NUM_ARGS as a result instead of
+ setting a variable as a side effect.
+
+Tue May 25 16:18:25 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * remote-d10v.c (d10v_eva_prepare_to_trace,
+ d10v_eva_get_trace_data), remote-sim.c (_initialize_remote_sim):
+ Add declaraton. Make static.
+
+ * remote-d10v.c (_initialize_remote_d10v), d10v-tdep.c
+ (_initialize_d10v_tdep): Add declaration.
+ * config/d10v/tm-d10v.h (d10v_frame_chain): Add declaration.
+
+Tue May 25 15:20:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * main.c (init_proc, proc_remove_foreign): Delete function.
+ * inftarg.c (child_mourn_inferior): Update. Delete call to
+ proc_remove_foreign().
+ * top.c (gdb_init): Update. Delete call to init_proc().
+
+ * utils.c (pollquit, fmthex, hexlate): Delete function.
+
+Tue May 25 13:01:43 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * main.c (gdb_init): Move declaration from here.
+ * top.h: To here.
+
+ * main.c (call_interp_loop): Move declaration from here.
+ * top.h: To here.
+
+ * defs.h (init_page_info): Add declaration.
+
+ * top.c (initialize_utils): Move declaration from here.
+ * defs.h: To here.
+
+ * infcmd.c (target_map_name_to_register): Move declaration from
+ here.
+ * parser-defs.h: To here.
+
+ * c-typeprint.c (cp_type_print_method_args), target.c
+ (nosupport_runtime, normal_target_post_startup_inferior): Add
+ declaration. Make static.
+
+Tue May 25 13:53:23 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * main.c: Include "event-loop.h".
+ * Makefile.in (main.o): Add dependency.
+
+ * top.h (setup_event_loop, async_init_signals), top.c
+ (set_async_editing_command, set_async_annotation_level,
+ set_async_prompt), event-loop.c (display_gdb_prompt): Move
+ declarations from here.
+ * event-loop.h: To here.
+
+ * event-loop.h (delete_async_signal_handler): Add function
+ declaration.
+
+ * event-top.c (change_annotation_level, command_handler): Add
+ declaration. Make static.
+
+Tue May 25 12:44:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * tracepoint.c (free_actions_list, add_register): Add declaration.
+ Make static.
+ (free_actions_list_cleanup_wrapper): New function. Wraps
+ free_actions_list for make_cleanup.
+ (trace_start_command): Pass free_actions_list_cleanup_wrapper
+ instead of free_actions_list to make_cleanup.
+ (_initialize_tracepoint): Add extern declaration.
+
+Tue May 25 12:23:39 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * jv-typeprint.c (java_type_print_base, jv-valprint.c
+ (java_print_value_fields): Add static declaration.
+
+ * jv-lang.c (java_lookup_type, get_java_utf8_name,
+ java_lookup_type): Add static declaration.
+ (get_java_class_symtab, java_class_is_primitive,
+ java_value_string): Add declaration. Make static.
+ (java_rerun_cleanup): Add extern declaration for this stub
+ function.
+
+Tue May 25 12:06:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h: When multi-arch, check that REGISTER_NAMES was not
+ defined.
+
+Mon May 24 16:16:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * inflow.c (_initialize_inflow), annotate.c
+ (_initialize_annotate), os9kread.c (_initialize_os9kread),
+ serial.c (_initialize_serial), nlmread.c (_initialize_nlmread),
+ f-valprint.c (_initialize_f_valprint), cp-valprint.c
+ (_initialize_cp_valprint), typeprint.c (_initialize_typeprint),
+ complaints.c (_initialize_complaints), scm-lang.c
+ (_initialize_scheme_language), m2-lang.c
+ (_initialize_m2_language), dbxread.c (_initialize_dbxread),
+ f-lang.c (_initialize_f_language), ch-lang.c
+ (_initialize_chill_language), c-lang.c (_initialize_c_language),
+ corefile.c (_initialize_core), stabsread.c
+ (_initialize_stabsread), mipsread.c (_initialize_mipsread),
+ elfread.c (_initialize_elfread), coffread.c
+ (_initialize_coffread), maint.c (_initialize_maint_cmds),
+ demangle.c (_initialize_demangler), maint.c
+ (_initialize_maint_cmds), language.c (_initialize_language): Add
+ external declaration.
+ * ui-out.c (_initialize_ui_out), cli-out.c (_initialize_cli_out):
+ Ditto.
+
+Mon May 24 10:04:56 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/v850/tm-v850.h,
+ config/tic80/tm-tic80.h, config/tahoe/tm-tahoe.h,
+ config/rs6000/tm-rs6000.h, config/sparc/tm-sparc.h,
+ config/sh/tm-sh.h, config/pyr/tm-pyr.h, config/pa/tm-hppa.h,
+ config/ns32k/tm-merlin.h, config/mn10300/tm-mn10300.h,
+ config/mn10200/tm-mn10200.h, config/mips/tm-mips.h,
+ config/m88k/tm-m88k.h, config/m68k/tm-news.h,
+ config/m68k/tm-delta68.h, config/m68k/tm-isi.h,
+ config/m68k/tm-m68k.h, config/m32r/tm-m32r.h,
+ config/i960/tm-i960.h, config/i386/tm-i386v.h,
+ config/i386/tm-i386.h, config/h8500/tm-h8500.h,
+ config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
+ config/d30v/tm-d30v.h, config/d10v/tm-d10v.h,
+ config/convex/tm-convex.h, config/arc/tm-arc.h,
+ config/arm/tm-arm.h, config/alpha/tm-alpha.h,
+ config/a29k/tm-a29k.h: Re-write definition of FRAME_NUM_ARGS so
+ that it returns NUM_ARGS as a result instead of setting a variable
+ as a side effect.
+
+ * ns32k-tdep.c (merlin_frame_num_args), tahoe-tdep.c
+ (tahoe_frame_num_args), vax-tdep.c (vax_frame_num_args),
+ m68k-tdep.c (news_frame_num_args, delta68_frame_num_args,
+ isi_frame_num_args), convex-tdep.c (convex_frame_num_args): New
+ functions.
+
+ * stack.c (print_args_stub): Update use of FRAME_NUM_ARGS.
+
+Mon May 24 11:57:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_xfer_memory): Re-write with assumption that
+ REMOTE_TRANSLATE_XFER_ADDRESS is defined. Pass targ_addr and
+ targ_len by reference.
+ (REMOTE_TRANSLATE_XFER_ADDRESS): Provide default definition.
+
+ * remote-d10v.c (remote_d10v_translate_xfer_address): Update.
+ * config/d10v/tm-d10v.h (REMOTE_TRANSLATE_XFER_ADDRESS): Update.
+
+Mon May 24 12:10:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * value.h (default_push_arguments): Add function declaration.
+
+ * alpha-tdep.c (alpha_about_to_return), gdbarch.c (verify_gdbarch,
+ arch_ok, set_arch), command.c (find_cmd), infrun.c
+ (follow_inferior_fork, follow_fork, follow_vfork,
+ set_schedlock_func, is_internal_shlib_eventpoint,
+ stopped_for_internal_shlib_event, stopped_for_shlib_catchpoint,
+ xdb_handle_command), infcmd.c (run_no_args_command, go_command),
+ symfile.c (add_filename_language, set_ext_lang_command,
+ info_ext_lang_command, init_filename_language_table), symtab.c
+ (overload_list_add_symbol), defs.h (default_get_saved_register),
+ ax-general.c (grow_expr, append_const, read_const, generic_ext):
+ Ditto.
+
+ * infrun.c (currently_stepping): Ditto. Make static.
+
+ * valops.c (hand_function_call): Explictly type static variable
+ ``checked''.
+
+Mon May 24 08:36:18 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_breakpoint_from_pc, d10v_register_name,
+ d10v_register_byte, d10v_register_raw_size,
+ d10v_register_virtual_size, d10v_register_virtual_type,
+ d10v_make_daddr, d10v_make_iaddr, d10v_daddr_p, d10v_iaddr_p,
+ d10v_convert_iaddr_to_raw, d10v_convert_daddr_to_raw,
+ d10v_store_struct_return, d10v_store_return_value,
+ d10v_extract_struct_value_address, d10v_frame_saved_pc,
+ d10v_frame_args_address, d10v_frame_locals_address,
+ d10v_saved_pc_after_call): New functions.
+
+ * config/d10v/tm-d10v.h (REGISTER_BYTE, REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN,
+ D10V_MAKE_DADDR, D10V_MAKE_IADDR, D10V_DADDR_P, D10V_IADDR_P,
+ D10V_CONVERT_DADDR_TO_RAW, D10V_CONVERT_IADDR_TO_RAW,
+ STORE_STRUCT_RETURN, STORE_RETURN_VALUE,
+ EXTRACT_STRUCT_VALUE_ADDRESS, SAVED_PC_AFTER_CALL, FRAME_SAVED_PC,
+ FRAME_ARGS_ADDRESS): Re-define using new functions.
+
+ * config/d10v/tm-d10v.h (BREAKPOINT_FROM_PC): Replace BREAKPOINT.
+ (REGISTER_NAME): Replace REGISTER_NAMES.
+
+ * utils.c (core_addr_lessthan, core_addr_greaterthan): New
+ functions.
+ * defs.h (core_addr_lessthan, core_addr_greaterthan): Declare.
+
+Sat May 22 16:44:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (n_spaces): Handle case where first call has N equal to
+ zero.
+ (print_spaces): Use n_spaces.
+
+Fri May 21 11:23:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (value_push): Remove conditional definition based on
+ absense of macro PUSH_ARGUMENTS. Pass SP and STRUCT_ADDR by
+ reference.
+ (default_push_arguments): New function.
+
+ * config/v850/tm-v850.h, config/tic80/tm-tic80.h,
+ config/sparc/tm-sparc.h, config/sparc/tm-sp64.h,
+ config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
+ config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
+ config/mips/tm-mips.h, config/m32r/tm-m32r.h,
+ config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
+ config/d30v/tm-d30v.h, config/d10v/tm-d10v.h, config/arm/tm-arm.h,
+ config/alpha/tm-alpha.h: Update definition of PUSH_ARGUMENTS.
+ Return updated SP.
+
+ * rs6000-tdep.c (rs6000_push_arguments): Rename push_arguments.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Added ui_out output code but still
+ uses old code by default.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * Makefile.in: Added ui-ou files.
+ * main.c (main): Install cli_out by default.
+ * ui-out.c (ui_out_table_begin): Use saved table id.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.h: Export implementation vectors so they can be
+ installed in main.c and top.c.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.h: New file. Defines the ui_out API.
+ * ui-out.c: New file. Implements the ui_out API abstraction only.
+ * cli-out.c: New file. Implements low-level ui-out primitives for
+ CLI-based interaction.
+
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (simplified_command_loop): Reformat using GNU style.
+ (call_interp_loop): Ditto.
+
+Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (get_prev_frame): Remove #ifdef around test for
+ FRAMELESS_FUNCTION_INVOCATION.
+ (get_prev_frame): Change FRAMELESS_FUNCTION_INVOCATION call to a
+ function invocation.
+ * i386-tdep.c (i386_frame_num_args), stack.c (frame_info): Ditto.
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h,
+ config/sparc/tm-sparc.h, config/sh/tm-sh.h,
+ config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
+ config/mips/tm-mips.h, config/m88k/tm-m88k.h,
+ config/m68k/tm-m68k.h, config/i960/tm-i960.h,
+ config/i386/tm-sun386.h, config/i386/tm-i386v.h,
+ config/i386/tm-i386.h, config/h8500/tm-h8500.h,
+ config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
+ config/d30v/tm-d30v.h, config/d10v/tm-d10v.h,
+ config/convex/tm-convex.h, config/arm/tm-arm.h,
+ config/arc/tm-arc.h, config/alpha/tm-alpha.h,
+ config/a29k/tm-a29k.h: Update FRAMELESS_FUNCTION_INVOCATION.
+ * fr30-tdep.c (fr30_frameless_function_invocation), convex-tdep.c
+ (convex_frameless_function_invocation), arm-tdep.c
+ (arm_frameless_function_invocation): New functions.
+
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c: Change dates in comments to ISO format.
+
+ * event-top.c: Ditto.
+ * event-loop.c: Ditto.
+ * main.c: Ditto.
+
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (simplified_command_loop): New function. It is just a
+ bare minimal command_loop.
+ (call_interp_loop): New function. Call the correct version of the
+ command loop, with the appropriate input reading function,
+ depending on which interpreter gdb was invoked with.
+
+ * main.c (main): Recognize and handle the new command line option
+ --interpreter. If an interpreter is specified, call the appropriate
+ command handling function.
+
+1999-05-19 Keith Seitz <keiths@cygnus.com>
+
+ * config/mcore/tm-mcore.h (BELIEVE_PCC_PROMOTION): Define. We
+ really do want to believe what gcc tells us about types...
+
+1999-05-19 Keith Seitz <keiths@cygnus.com>
+
+ * config/mcore/tm-mcore.h (FRAME_ARGS_ADDRESS): Define to a function.
+ (FRAME_LOCALS_ADDRESS): Ditto.
+ * mcore-tdep.c (mcore_frame_args_addcress): New function.
+ (mcore_frame_locals_address): New function.
+
+ * monitor.c (monitor_open): Only assume we have eight
+ breakpoints if the monitor implementation does not tell
+ us how many there really are. Alloc memory for these
+ dynamically.
+ (monitor_close): Free memory associated with breakpoint
+ storage.
+ (monitor_insert_breakpoint): Don't rely on a hardcoded
+ number of breakpoints.
+ (monitor_remove_breakpoint): Ditto.
+ (NUM_MONITOR_BREAKPOINTS): Removed and replaced with monitor_ops
+ specification.
+ * monitor.h (struct monitor_ops): Add new member so that the
+ individual monitor implementations can tell us how many
+ breakpoints the monitor supports.
+
+ * mcore-rom.c (init_picobug_cmds): Add number of breakpoints supported
+ by picobug monitor.
+
+1999-05-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Philippe De Muyter <phdm@macqel.be>:
+ * event-loop.h: Include sys/wait.h only if HAVE_SYS_WAIT_H.
+
+1999-05-17 Keith Seitz <keiths@cygnus.com>
+
+ * configure.tgt: Add MCore target.
+ * Makefile.in: Add mcore-tdep.c and mcore-rom.c
+ * config/mcore/tm-mcore.h: New file.
+ * config/mcore/mcore.mt: New file.
+ * mcore-rom.c: New file.
+ * mcore-tdep.c: New file.
+
+1999-05-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_line): Added the missing stream argument.
+ * gdbcmd.h: Added argument to prototype.
+ * command.c: Fixed call to include extra argument.
+ * breakpoint.c: Same.
+
+1999-05-14 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Targets are #defining PREPARE_TO_PROCEED with inconsistent numbers
+ of arguments. Since the Mach 3 target needs an argument, we'll
+ make things consistent by adding an argument everywhere.
+ * infrun.c (proceed): Pass an argument to PREPARE_TO_PROCEED.
+ * config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Add ignored argument
+ to definition.
+
+1999-05-11 Stan Shebs <shebs@andros.cygnus.com>
+
+ Fri Apr 23 13:27:34 PDT 1999 Toshiyasu Morita (tm@netcom.com)
+ * sh-stub.c: Mostly localize processor dependencies.
+
+1999-05-10 Martin Hunt <hunt@cygnus.com>
+
+ * debugify.c, debugify.h: Removed because they are no
+ longer used.
+
+1999-05-08 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * infrun.c (_initialize_infrun): Handle TARGET_SIGNAL_LWP,
+ TARGET_SIGNAL_WAITING, and TARGET_SIGNAL_CANCEL like SIGALRM or
+ SIGIO --- pass them through to the inferior silently.
+ * target.h (enum target_signals): Add TARGET_SIGNAL_CANCEL, for
+ Solaris's SIGCANCEL.
+ * target.c (target_signal_from_host, target_signal_to_host): Add
+ mapping between SIGCANCEL and TARGET_SIGNAL_CANCEL.
+ (signals): Add entry for SIGCANCEL.
+
+1999-05-07 Stan Shebs <shebs@andros.cygnus.com>
+
+ After years of talking about it, finally break up the
+ wait_for_inferior loop.
+ * infrun.c (struct execution_control_state): New struct,
+ holds what used to be local vars governing wfi behavior.
+ (init_execution_control_state): New function, was code in
+ wfi that set up execution control state.
+ (handle_inferior_event): New function, was body of main
+ wfi loop. Rewrite all local var references to go through
+ the ecs structure passed into this function.
+ (wait_for_inferior): Rewrite to set up and use execution control
+ state, and to call the new functions.
+ (currently_stepping): New function, was the macro
+ CURRENTLY_STEPPING.
+ (enum infwait_states): Rename from wfi_states.
+ (infwait_normal_state, etc): Similarly.
+
+Thu May 6 15:25:32 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * coffread.c (coff_symtab_read): Call `record_line' with the line
+ number of the ".bf" symbol only for one-line functions.
+
+1999-05-06 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * Makefile.in: thread.o depends on target.h.
+
+1999-05-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (change_line_handler): Use POLLIN instead of
+ POLLRDNORM, for compatibility with Linux.
+ (setup_event_loop): Ditto.
+
+1999-05-06 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * mips-tdep.c (heuristic_proc_start): Rewrite cryptic error
+ message about hitting the "heuristic fence post" with something
+ that actually gives the user a fighting chance of figuring out
+ why GDB is unhappy.
+
+1999-05-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c: Include event-loop.h.
+ (init_main): Add async version of 'set prompt' command.
+ If in async mode define the editing and annotate set
+ commands in a different way.
+ Initialize new variable asyn_command_editing_p to 1.
+ Initialize the gdb prompt for async mode.
+ (quit_cover): Make not static, for use by the event loop.
+ (gdb_init): Call async_init_signals for the asynchronous case.
+ (source_line_number, source_file_name, source_error,
+ source_pre_error, history_expansion_p): Make non-static, so
+ event-top.c can use them.
+ (command_loop_marker): Make non-static, for use in event-top.c.
+ Include event-loop.h.
+
+ * top.h: Add prototype for async_init_signals.
+ (SET_TOP_LEVEL): Move here from main.c.
+ Add setup_event_loop to exported functions.
+
+ * defs.h: Add async_hook to exported variables.
+
+ * main.c (SET_TOP_LEVEL): Move to top.h, so that it is visible in
+ event-loop.c. Add new global variable async to determine whether
+ we are running in async mode or not.
+ (main): Add support for --async switch. Use async_hook to call
+ setup_event_loop, when running in async mode.
+
+ * event-top.c: New file. Gdb input line handler and command line
+ handler for the event loop. Initialization of signal handlers.
+ All the handled signals have handlers called handle_<signalname>.
+ Set up all the appropriate tokens for asynchronous signal
+ handling.
+
+ * event-loop.h: New file. Data structures and definitions for the
+ event loop.
+
+ * event-loop.c: New file. Functions for the event loop
+ implementation.
+
+ * config.in: Regenerate with autoheader.
+
+ * configure.in (AC_CHECK_FUNCS): Add poll to list of functions
+ to be checked for.
+
+ * configure: Regenerate.
+
+ * Makefile.in (SFILES): Add new source files.
+ (eventloop_h): Define.
+ (COMMON_OBS): Add new object files.
+ (event-loop.o): Add rule for target object.
+ (event-top.o): Ditto.
+
+1999-05-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (wait_for_inferior): Transform breaks and continues
+ into gotos, move the target_wait to the very top of the loop.
+
+1999-05-05 Jonathan Larmour <jlarmour@cygnus.co.uk>
+
+ * configure.in: Ensure that GDB links with libuser32.a under
+ cygwin because libreadline requires it.
+ * Makefile.in (WIN32LIBS): Substitute in result from configure
+ * configure: regenerate
+
+1999-05-04 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Fix from John Rigby. Richard Henderson says it seems okay.
+ * alpha-tdep.c (PROC_DUMMY_FRAME): As long as we're abusing fields
+ of (proc)->pdr, we ought to at least abuse one large enough to
+ hold the value we're trying to store in it. iopt is only 32 bits
+ wide; cbLineOffset is a bfd_vma.
+
+1999-05-04 DJ Delorie <dj@cygnus.com>
+
+ DJGPP changes from Robert Hoehne <robert.hoehne@gmx.net>
+
+ * ser-go32.c: correct includes
+ * source.c (openp): use ROOTED_P instead of SLASH_P
+ * go32-nat.c: enhance exception and NPX handling
+ (go32_kill_inferior): fix small bug killing inferior
+ * configure.in: don't look for termcap with djgpp
+ * configure: rebuild
+
+1999-05-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * main.c (main): Comment out unused and undocumented command line
+ option '-'.
+
+1999-04-30 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Cleanup from Philippe De Muyter:
+ * configure.in (BFD_NEED_DECLARATION): Check also for strstr.
+ * acconfig.h (NEED_DECLARATION_MALLOC, NEED_DECLARATION_REALLOC,
+ NEED_DECLARATION_FREE, NEED_DECLARATION_STRERROR): Define slots
+ removed; they are now generated automatically.
+ * gdb_string.h (strstr): Provide function prototype if
+ NEED_DECLARATION_STRSTR.
+ * configure, config.in: Regenerated.
+
+Fri Apr 30 11:16:09 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * target.h (to_find_new_threads): new target ops vector.
+ (target_find_new_threads): define.
+ * target.c (update_current_target): inherit new target ops vector.
+ * remote.c: Setup to_find_new_threads vector.
+ * sol-thread.c: ditto.
+ * thread.c (target_find_new_threads): rename: local_find_new_threads.
+ (info_threads_command): call target_find_new_threads by new method,
+ as a target ops vector, rather than previous macro definition method.
+ * infcmd.c (go_command): define only if in xdb mode.
+ * procfs.c: fix typo in comment.
+
+Fri Apr 30 01:02:05 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppah-nat.c: Fix various coding convention violations introduced
+ by HP.
+ (child_acknowledge_created_inferior): Do nothing if PT_SET_EVENT_MASK
+ is not defined.
+
+1999-04-28 Stan Shebs <shebs@andros.cygnus.com>
+
+ * TODO: Add some items inspired by review of the manual.
+
+Tue Apr 27 17:38:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/z8k/tm-z8k.h, config/v850/tm-v850.h,
+ config/tic80/tm-tic80.h, config/sparc/tm-sparc.h,
+ config/sh/tm-sh.h, config/pyr/tm-pyr.h, config/pa/tm-hppa.h,
+ config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
+ config/mips/tm-mips.h, config/m88k/tm-m88k.h,
+ config/m68k/tm-m68k.h, config/m32r/tm-m32r.h,
+ config/i960/tm-i960.h, config/i386/tm-i386.h,
+ config/h8500/tm-h8500.h, config/h8300/tm-h8300.h,
+ config/fr30/tm-fr30.h, config/d30v/tm-d30v.h,
+ config/d10v/tm-d10v.h, config/alpha/tm-alpha.h,
+ config/arm/tm-arm.h, config/a29k/tm-a29k.h, config/arc/tm-arc.h:
+ Change SKIP_PROLOGUE and SKIP_PROLOGUE_FRAMELESS_P macros so that
+ they return the new address.
+
+ * sparc-tdep.c (sparc_skip_prologue), hppa-tdep.c
+ (hppa_skip_prologue), m88k-tdep.c
+ (m88k_skip_prologue), i960-tdep.c
+ (i960_skip_prologue), arc-tdep.c
+ (arc_skip_prologue), a29k-tdep.c (a29k_skip_prologue): Rename
+ skip_prologue function.
+
+ * config/m68k/tm-isi.h: Convert macro SKIP_PROLOGUE into a new
+ function.
+ * m68k-tdep.c (isi_skip_prologue): That new function.
+ * vax-tdep.c (vax_skip_prologue), config/vax/tm-vax.h: Ditto.
+ * tahoe-tdep.c (tahoe_skip_prologue), config/tahoe/tm-tahoe.h: Ditto.
+ * rs6000-tdep.c (rs6000_skip_prologue), config/rs6000/tm-rs6000.h:
+ Ditto.
+ * ns32k-tdep.c (umax_skip_prologue), config/ns32k/tm-umax.h: Ditto.
+ * config/ns32k/tm-merlin.h, ns32k-tdep.c (merlin_skip_prologue):
+ Ditto.
+ * config/m68k/tm-altos.h, m68k-tdep.c (altos_skip_prologue): Ditto.
+ * config/convex/tm-convex.h, convex-tdep.c (convex_skip_prologue):
+ Ditto.
+
+ * symtab.c (in_prologue, find_function_start_sal, decode_line_1),
+ infrun.c (wait_for_inferior), blockframe.c
+ (frameless_look_for_prologue): Update.
+ * config/fr30/tm-fr30.h (FRAMELESS_FUNCTION_INVOCATION): Update.
+
+1999-04-27 Stan Shebs <shebs@andros.cygnus.com>
+
+ * TODO: Remove item about DEBUG_EXPRESSIONS, no longer meaningful.
+
+ * infrun.c (enum wfi_state): New enum.
+ (wait_for_inferior): Merge all but one of the target_wait calls
+ into a single call, add a wfi_state variable to encode which of
+ the calls is being made.
+
+1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Fix from Dave Holcomb.
+ * hpux-thread.c (init_hpux_thread_ops): Use the right function
+ name when initializing hpux_thread_ops.to_thread_alive.
+
+ * coffread.c (coff_symfile_read): If we have a `.stab' section,
+ but no `.stabstr' section, then print an error message; don't
+ crash.
+
+1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ 1999-04-25 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c (gnu_attach): Call target_terminal_init before calling
+ inf_set_traced, since that function calls code that might try to
+ restore the terminal settings.
+
+Mon Apr 26 08:55:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: More format cleanups.
+
+Sun Apr 25 18:54:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (CALL_DUMMY_STACK_ADJUST_P): Replace
+ SIZEOF_CALL_DUMMY_STACK_ADJUST_P.
+ (CALL_DUMMY_STACK_ADJUST): Replace
+ SIZEOF_CALL_DUMMY_STACK_ADJUST_P.
+ * gdbarch.c (gdbarch_call_dummy_stack_adjust,
+ set_gdbarch_call_dummy_stack_adjust): Define.
+
+Fri Apr 23 15:00:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (arch_ok): New function. Fix logic test for a valid
+ architecture.
+ (set_arch): Use.
+
+1999-04-22 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * README: Note that readline is not installed as a part of
+ make install.
+
+Thu Apr 22 21:02:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c (GET_SAVED_REGISTER, get_saved_register):
+ Add.
+ (struct gdbarch, verify_gdbarch, gdbarch_alloc, gdbarch_dump,
+ default_gdbarch): Update.
+
+ * value.h (get_saved_register): Cleanup prototype.
+ * findvar.c (default_get_saved_register): Rename function
+ get_saved_register.
+ (GET_SAVED_REGISTER): Define as default_get_saved_register when
+ undefined.
+ (get_saved_register): Always declare. Call GET_SAVED_REGISTER.
+
+ * sparc-tdep.c (sparc_get_saved_register): Rename function
+ get_saved_register.
+ * config/sparc/tm-sparc.h (GET_SAVED_REGISTER): Update.
+ * a29k-tdep.c (a29k_get_saved_register): Rename function
+ get_saved_register.
+ * config/a29k/tm-a29k.h (GET_SAVED_REGISTER): Update.
+
+ * config/d10v/tm-d10v.h, config/powerpc/tm-ppc-eabi.h,
+ config/h8300/tm-h8300.h, config/m32r/tm-m32r.h,
+ config/mn10200/tm-mn10200.h, config/mn10300/tm-mn10300.h,
+ config/sh/tm-sh.h, config/tic80/tm-tic80.h, config/v850/tm-v850.h:
+ Update macro GET_SAVED_REGISTER so that it calls
+ generic_get_saved_register.
+ * v850-tdep.c, tic80-tdep.c, sh-tdep.c, mn10300-tdep.c,
+ mn10200-tdep.c, m32r-tdep.c, h8300-tdep.c, rs6000-tdep.c: Delete
+ function get_saved_register.
+
+Thu Apr 22 13:32:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c: Cleanup. Re-order the definition of the ``struct
+ gdbarch'' initialization functions so that maintenance is more
+ straightforward.
+
+Thu Apr 22 11:07:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c (use_generic_dummy_frames,
+ USE_GENERIC_DUMMY_FRAMES): Add.
+ (struct gdbarch, verify_gdbarch, gdbarch_alloc, gdbarch_dump,
+ default_gdbarch): Update.
+
+ * config/v850/tm-v850.h, config/tic80/tm-tic80.h,
+ config/sh/tm-sh.h, config/powerpc/tm-ppc-eabi.h,
+ config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
+ config/m32r/tm-m32r.h, config/h8300/tm-h8300.h,
+ config/fr30/tm-fr30.h, config/d10v/tm-d10v.h: Give the
+ USE_GENERIC_DUMMY_FRAMES macro the value one.
+ * inferior.h (USE_GENERIC_DUMMY_FRAMES): Default to a value of
+ zero.
+
+ * blockframe.c (generic_find_dummy_frame,
+ generic_pc_in_call_dummy, generic_read_register_dummy,
+ generic_push_dummy_frame, generic_pop_current_frame,
+ generic_pop_dummy_frame, generic_frame_chain_valid,
+ generic_get_saved_register): Always define.
+
+ * breakpoint.c (frame_in_dummy): Convert #ifdef
+ USE_GENERIC_DUMMY_FRAMES to runtime test.
+
+ * rs6000-tdep.c (pop_frame, push_arguments, push_arguments,
+ push_arguments, frame_saved_pc, rs6000_frame_chain,
+ rs6000_frame_chain): Convert #ifdef USE_GENERIC_DUMMY_FRAMES to
+ runtime test.
+ (get_saved_register): Always define.
+
+Wed Apr 21 17:15:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (gdbarch_dump): Fix robustness check on
+ BELIEVE_PCC_PROMOTION_TYPE.
+
+Wed Apr 21 15:39:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (TARGET_BYTE_ORDER_SELECTABLE_P): When multi-arch,
+ force selectable byte order.
+ (CALL_DUMMY): Check for CALL_DUMMY definition when multi-arch. Are
+ incompatible.
+ * gdbarch.c (verify_gdbarch): Check call_dummy_stack_adjust.
+
+Wed Apr 21 14:45:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (gdbarch_update): Move dump-arch code from here.
+ (gdbarch_dump): To here. Make more robust.
+ * gdbarch.h (gdbarch_dump): Add prototype.
+
+ * gdbarch.c (enum set_arch): Declare.
+ (set_arch): Add type parameter. Only disable
+ ``target_architecture_auto'' when set_arch_manual.
+ (set_architecture, set_architecture_from_arch_mach,
+ set_architecture_from_file): Update.
+ (set_arch): When ``gdbarch_debug'', gdbarch_dump() the current
+ architecture.
+
+Wed Apr 21 10:48:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * frame.h (generic_pc_in_call_dummy): Make signature consistent
+ with other pc_in_call_dummy functions by adding SP parameter.
+ * blockframe.c (generic_pc_in_call_dummy): Update. Pass SP and
+ not FP to generic_find_dummy_frame().
+ * breakpoint.c (frame_in_dummy): Update.
+ * config/v850/tm-v850.h, config/tic80/tm-tic80.h,
+ config/sh/tm-sh.h, config/mn10300/tm-mn10300.h,
+ config/mn10200/tm-mn10200.h, config/m32r/tm-m32r.h,
+ config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
+ config/d10v/tm-d10v.h: Update PC_IN_CALL_DUMMY definition.
+
+Tue Apr 20 12:15:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (GDB_TARGET_IS_D10V): Move from here.
+ * gdbarch.h (GDB_TARGET_IS_D10V): To here. Implement using
+ TARGET_ARCHITECTURE.
+ (D10V_MAKE_DADDR, D10V_MAKE_IADDR): Provide fatal default
+ definitions.
+
+ * valops.c (value_at): Replace #ifdef GDB_TARGET_IS_D10V code with
+ runtime test.
+ (value_fetch_lazy): Ditto.
+ * values.c (unpack_long): Ditto.
+ * printcmd.c (print_frame_args): Ditto.
+
+Sat Apr 17 15:39:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h: Cleanup multi-arch comments.
+
+Fri Apr 16 15:39:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h: Provide definition if GDB_MULTI_ARCH > 1 or
+ GDB_MULTI_ARCH > 0 and no previous definition.
+ * gdbarch.c (verify_gdbarch): Only verify a full multi-arch
+ target.
+
+1999-04-15 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (wait_for_inferior) [HAVE_STEPPABLE_WATCHPOINT,
+ HAVE_NONSTEPPABLE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT]: Test
+ at runtime instead of compile time.
+
+Thu Apr 15 15:15:07 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * mips-tdep.c (struct gdbarch_tdep): Rename elf_abi to
+ elf_flags. Check ABFD is elf_flavour before extracting elf_flags.
+ Match ARCH against entire elf_flags instead of just the
+ EF_MIPS_ABI field.
+ (mips_gdbarch_init): Extract/print ef_mips_arch and
+ ef_mips_bitptrs and ef_mips_abi fields from elf_flags.
+
+1999-04-14 Philippe De Muyter <phdm@macqel.be>
+
+ * breakpoint.c (maintenance_info_breakpoints): Function made
+ static to match previous prototype.
+
+ * coffread.c (coff_record_line): Static function removed.
+ (enter_linenos): Call `record_line' instead of `coff_record_line'.
+ (FILE-LEVEL, coff_start_symtab, coff_end_symtab): `coff_record_line'
+ -related stuff removed.
+ (coff_symfile_read): Redundant statement removed.
+ (coff_symtab_read): `record_line' is now called with the first line
+ number of each function, given by the ".bf" symbol. This solves
+ the line-number bug for one-line functions.
+
+Wed Apr 14 11:09:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h (BELIEVE_PCC_PROMOTION_TYPE, BELIEVE_PCC_PROMOTION):
+ Add multi-arch definitions.
+ * gdbarch.c (gdbarch_believe_pcc_promotion,
+ gdbarch_believe_pcc_promotion_type): New functions.
+ (gdbarch_update): Update
+ (struct gdbarch default_gdbarch): Update.
+
+ * stabsread.c (BELIEVE_PCC_PROMOTION_TYPE): Provide default.
+ (define_symbol): Change #if BELIEVE_PCC_PROMOTION_TYPE and #if
+ BELIEVE_PCC_PROMOTION to if().
+
+1999-04-13 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (HAVE_MULTIPLE_PROC_FDS): Don't define if we're
+ on a Solaris host (of any architecture).
+ * configure: Regenerated.
+
+Wed Apr 14 08:23:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c (SET_GDBARCH, GET_GDBARCH, FSET_GDBARCH): New macros.
+ (gdbarch_byte_order, gdbarch_long_bit, gdbarch_long_long_bit,
+ gdbarch_ptr_bit, gdbarch_call_dummy_location,
+ gdbarch_call_dummy_address, gdbarch_call_dummy_address,
+ gdbarch_call_dummy_breakpoint_offset,
+ gdbarch_call_dummy_breakpoint_offset, gdbarch_call_dummy_length,
+ gdbarch_pc_in_call_dummy, dbarch_call_dummy_breakpoint_offset_p,
+ dbarch_call_dummy_p, dbarch_call_dummy_words,
+ dbarch_sizeof_call_dummy_words, dbarch_call_dummy_stack_adjust,
+ dbarch_call_dummy_stack_adjust_p): Define using new macros.
+
+1999-04-13 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * rom68k-rom.c (init_rom68k_cmds): Fix an accidental substitution
+ in monitor command strings, fix some formatting mistakes.
+
+1999-04-13 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (arm-*-*): Whack another vestige of wingdb.
+
+1999-04-12 James Ingham <jingham@cygnus.com>
+
+ * arm-tdep.c (arm_pop_frame): don't clobber the previous frame's
+ stack pointer (stored in frame->framereg's register) BEFORE
+ reading it. This was causing "return" to behave very oddly.
+
+1999-04-12 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Mention tic80.
+
+1999-04-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * a68v-nat.c: Remove reference to 'extern char registers[]' throughout.
+ * altos-xdep.c: Ditto.
+ * arm-xdep.c: Ditto.
+ * convex-xdep.c: Ditto.
+ * cxux-nat.c: Ditto.
+ * hp300ux-nat.c: Ditto.
+ * hppab-nat.c: Ditto.
+ * i386aix-nat.c: Ditto.
+ * i386mach-nat.c: Ditto.
+ * m88k-nat.c: Ditto.
+ * ptx4-nat.c: Ditto.
+ * pyr-xdep.c: Ditto.
+ * rs6000-nat.c: Ditto.
+ * sun3-nat.c: Ditto.
+ * sun386-nat.c: Ditto.
+ * symm-nat.c: Ditto.
+ * umax-xdep.c: Ditto.
+ * i386v4-nat.c: Ditto. Also include inferior.h.
+ * m68k-tdep.c: Ditto. Also include inferior.h.
+
+Mon Apr 12 15:57:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inferior.h (CALL_DUMMY_STACK_ADJUST, CALL_DUMMY_STACK_ADJUST_P):
+ Provide default definitions.
+ * valops.c (hand_function_call): Replace #ifdef
+ CALL_DUMMY_STACK_ADJUST with if (CALL_DUMMY_STACK_ADJUST_P).
+
+ * gdbarch.h (SIZEOF_CALL_DUMMY_STACK_ADJUST,
+ (SIZEOF_CALL_DUMMY_STACK_ADJUST_P): Define
+ * gdbarch.c (struct gdbarch): Add call_dummy_stack_adjust,
+ call_dummy_stack_adjust_p.
+ (gdbarch_call_dummy_stack_adjust,
+ set_gdbarch_call_dummy_stack_adjust,
+ gdbarch_call_dummy_stack_adjust_p,
+ set_gdbarch_call_dummy_stack_adjust_p): New functions.
+ (default_gdbarch): Update.
+
+1999-04-09 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * ax-gdb.c, ax-gdb.h, ax-general.c, ax.h: Remove RCS Id strings.
+ They're a pain.
+
+ * GDB 4.18 released.
+ * Makefile.in (VERSION): Bump to 4.18.1.
+
+Thu Apr 8 16:04:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inferior.h (CALL_DUMMY_P, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS): Define macros.
+ (PUSH_DUMMY_FRAME, FIX_CALL_DUMMY, STORE_STRUCT_RETURN): Provide
+ fatal default.
+
+ * inferior.h, gdbarch.c (call_dummy_words,
+ sizeof_call_dummy_words): Declare/Define variables.
+ * valops.c (value_arg_coerce, find_function_addr,
+ call_function_by_hand): Always define.
+ (hand_function_call): Rename CALL_DUMMY version of
+ call_function_by_hand. Make static. Add prototype.
+ (hand_function_call): Update. Allocate space for *dummy and
+ *dummy1 using alloca.
+ * breakpoint.c (frame_in_dummy): Update.
+
+ * gdbarch.h (CALL_DUMMY_P, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS): Define.
+ * gdbarch.c (gdbarch_call_dummy_p, set_gdbarch_call_dummy_p,
+ gdbarch_call_dummy_words, set_gdbarch_call_dummy_words,
+ gdbarch_sizeof_call_dummy_words,
+ set_gdbarch_sizeof_call_dummy_words): New functions.
+ (gdbarch_alloc, verify_gdbarch, gdbarch_update, struct
+ default_gdbarch): Update.
+
+1999-04-08 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * monitor.c (monitor_read_memory): If a MO_GETMEM_NEEDS_RANGE
+ monitor, increase the end address by one byte.
+
+1999-04-08 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * dbug-rom.c (init_dbug_cmds): Fix strings in
+ dbug_cmds.{step,clr_break,clr_all_break,fill} to send correct
+ commands to the monitor.
+
+1999-04-08 Keith Seitz <keiths@cygnus.com>
+
+ * m32r-stub.c (branchDestination): Undo overly ambitious
+ sed script's conversion of cast from "char" to "unsigned char".
+ Return offset should now be properly computed.
+
+Thu Apr 8 14:13:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inferior.h (CALL_DUMMY_BREAKPOINT_OFFSET_P): New macro.
+ Non-zero when CALL_DUMMY_BREAKPOINT_OFFSET is valid.
+
+ * infcmd.c (breakpoint_auto_delete_contents): Always define.
+ (run_stack_dummy): Update.
+ * infrun.c (wait_for_inferior): Update
+
+ * gdbarch.h (CALL_DUMMY_BREAKPOINT_OFFSET_P): New macro.
+ * gdbarch.c (set_gdbarch_call_dummy_breakpoint_offset_p,
+ gdbarch_call_dummy_breakpoint_offset_p): New functions.
+ (struct gdbarch, gdbarch_alloc, default_gdbarch, gdbarch_update):
+ Update.
+
+1999-04-07 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: Mark Alexander can no longer maintain
+ h8300 and other embedded targets, sniff.
+
+1999-04-06 Stan Shebs <shebs@andros.cygnus.com>
+
+ * inftarg.c (child_wait): Initialize execd_pathname.
+ * target.c (debug_to_has_execd): Handle NULL execd_pathname.
+
+ * solib.c (clear_solib): Don't call disable_breakpoints_in_shlibs,
+ this breaks rerunning on sun4 native.
+
+1999-04-06 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * config/sparc/nm-linux.h: Don't redefine PT_ATTACH to use the
+ deprecated PTRACE_SUNATTACH compatibility commands. The
+ definitions from <sys/ptrace.h> are fine.
+
+1999-04-06 Martin Hunt <hunt@cygnus.com>
+
+ * annotate.h: Declare annotate_signal_hook.
+
+ * annotate.c (annotate_signal): Add a call to
+ annotate_signal_hook().
+
+1999-04-06 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Don't call record_line when
+ we hit a DW_LNE_end_sequence instruction.
+
+ * README: Note that GDB requires an ANSI C compiler, and explain
+ how to get GCC.
+
+ * README: Update.
+
+1999-04-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Add more notes about user-visible changes.
+
+Mon Apr 5 14:56:59 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * target.c (target_signal_to_string): check for signal
+ number in range; otherwise if the target board returns
+ a bogus signal number we might core dump (per David Taylor).
+
+1999-04-05 David Taylor <taylor@ryobi.cygnus.com>
+
+ * utils.c (fputs_maybe_filtered): test value of
+ pagination_enabled before paginating.
+
+1999-04-02 James Ingham <jingham@cygnus.com>
+
+ * blockframe.c (get_prev_frame): Remove the redundant
+ get_prev_frame_info. It is now exactly the same as
+ get_prev_frame, so there is no reason to have both functions.
+
+ * rs6000-tdep.c (rs6000_init_extra_frame_info):
+ frame.h:
+ a29k-tdep.c (init_extra_frame_info):
+ config/a29k/tm-a29k.h:
+ i386-tdep.c:
+ Change all references to get_prev_frame_info to get_prev_frame.
+
+1999-04-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * bcache.c, bcache.h, breakpoint.c, defs.h, expprint.c,
+ expression.h, gdbarch.c, gdbtypes.c, gdbtypes.h, gnu-nat.c,
+ gnu-nat.h, hppa-tdep.c, maint.c, monitor.c, objfiles.h, parse.c,
+ remote-mips.c, remote-sds.c, remote.c, sol-thread.c, symmisc.c,
+ symtab.h, target.c, top.c, typeprint.c, config/nm-gnu.h: Evaporate
+ the unused MAINTENANCE_CMDS conditional.
+
+1999-04-02 James Ingham <jingham@cygnus.com>
+
+ * config/arm/tm-arm.h: (EXTRACT_STRUCT_VALUE_ADDRESS): This needs
+ to call extract_address, not just cast the first 4 bytes, since
+ the result will be passed to value_at which expects host-byte
+ order.
+
+ * arm-tdep.c (arm_scan_prologue): The prologue_start address was
+ directly &'ed with 0x03fffffc, rather than using
+ ADDR_BITS_REMOVE. This would cause inferior function calls to
+ report the stack incorrectly on return.
+
+
+1999-04-02 Keith Seitz <keiths@cygnus.com>
+
+ * top.c (ui_loop_hook): Change declaration. Now returns an int.
+ * win32-nat.c (child_wait): Timeout WaitForDebugEvent and call
+ the ui_loop_hook if there was no debug event.
+ * top.c (ui_loop_hook): Change to return an int and include
+ on all non-Cygwin builds.
+ * v850ice.c: Change prototype of ui_loop_hook.
+ (v850ice_wait): Update call to ui_loop_hook.
+ * ser-unix.c (hardwire_readchar): Enable ui_loop_hook callbacks
+ for non-Cygwin builds. Check return status of ui_loop_hook and
+ return a timeout if told to detach. Add more documentation.
+ * ser-tcp.c (tcp_readchar): Break up timeouts into one second
+ intervals and call ui_loop_hook so that other UIs can
+ keep up to date. If ui_loop_hook returns non-zero, then
+ return SERIAL_TIMEOUT to facilitate detaching from the
+ target.
+ * remote.c (remote_interrupted_already): Remove.
+ (remote_interrupt_twice): Revive.
+ (remote_interrupt): Call remote_stop to interrupt the target
+ and install remote_interrupt_twice to take more severe
+ actions if this fails.
+ (remote_stop): Only attempt to stop the target. This separates
+ the command line from other UIs.
+ * remote-sim.c (gdb_os_poll_quit): Add a call to ui_loop_hook,
+ if it is defined.
+
+1999-04-01 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Fix for cross-debugging on an AIX host from Johanna Svenningsson:
+ * ax-gdb.h (enum axs_lvalue_kind): Remove trailing comma from enum.
+ * ax.h (enum agent_op): Same.
+ * tracepoint.h (enum actionline_type): Same.
+ * config/xm-aix4.h: Add declaration for termdef.
+
+1999-03-31 Stan Shebs <shebs@andros.cygnus.com>
+
+ * jv-lang.h (dynamics_objfile): Remove decl, conflicts with static
+ decl in jv-lang.c.
+
+ * infrun.c (follow_inferior_fork): Add ifdefs around
+ SOLIB_REMOVE_INFERIOR_HOOK.
+
+Wed Mar 31 11:39:49 1999 David Taylor <taylor@ryobi.cygnus.com>
+
+ * valops.c (search_struct_field): revert HP merge change
+ to this function -- it causes messages to be printed about
+ member class ambiguity when the compiler is happy.
+ (search_struct_field_aux): delete -- added as part of HP merge
+ change; with aforementioned change it is no longer called.
+
+1999-03-30 Stan Shebs <shebs@andros.cygnus.com>
+
+ Make more HPUX-specific code generic.
+ * infrun.c: Include top.h.
+ (MAY_SWITCH_FROM_INFERIOR_PID, MAY_FOLLOW_EXEC,
+ USE_THREAD_STEP_NEEDED): New native macros.
+ (may_switch_from_inferior_pid, may_follow_exec,
+ use_thread_step_needed): New globals.
+ (follow_inferior_fork): Remove HPUXHPPA ifdef.
+ (follow_exec): Ditto, also save run target and re-push instead of
+ always pushing child_ops, add ifdefs around SOLIB_RESTART and
+ SOLIB_CREATE_INFERIOR_HOOK.
+ (wait_for_inferior): Use new globals instead of ifdefing HPUXHPPA,
+ always use printf_filtered to report new threads.
+ (normal_stop): Ditto.
+ * target.h, target.c (find_run_target): New function.
+ * config/pa/nm-hppah.h: Define new macros.
+
+1999-03-29 Stan Shebs <shebs@andros.cygnus.com>
+
+ * top.h: Include setjmp.h here.
+ * main.c, top.c: Don't include it here.
+
+1999-03-29 Keith Seitz <keiths@cygnus.com>
+
+ * symtab.c (decode_line_1): Take out change which breaks symbols
+ which include class names and methods, e.g., "Foo::bar".
+
+1999-03-26 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (i[3456]86-*-sysv4.2MP, i[3456]86-*-sysv4.2uw2*):
+ Recognize both, as i[3456]86-*-sysv4.2*.
+ (i[3456]86-*-sysv5*): Recognize.
+
+ * infrun.c (wait_for_inferior): Remove most #if 0 segments.
+
+Fri Mar 26 17:27:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (pc_in_call_dummy_on_stack): Fix. Had copied code
+ from at_entry_point.
+
+Thu Mar 25 19:30:02 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * gdbarch.c: Include all headers.
+ (struct gdbarch), gdbarch.h (CALL_DUMMY_LOCATION,
+ CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET,
+ CALL_DUMMY_BREAKPOINT_OFFSET, CALL_DUMMY_LENGTH,
+ PC_IN_CALL_DUMMY): Add ``call_dummy_location'',
+ ``call_dummy_length'', ``pc_in_call_dummy'',
+ ``call_dummy_start_offset'', ``call_dummy_breakpoint_offset'' to
+ multi-arch framework.
+
+ * inferior.h, blockframe.c (pc_in_call_dummy_before_text_end,
+ pc_in_call_dummy_after_text_end, pc_in_call_dummy_on_stack,
+ pc_in_call_dummy_at_entry_point): Convert PC_IN_CALL_DUMMY macro's
+ into functions.
+
+ * mips-tdep.c (mips_gdbarch_init): Initialize above
+
+Tue Mar 23 17:22:57 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * remote.c, parse.c: Include ctype.h.
+
+1999-03-24 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.host (mips-dec-mach3*): Use mipsm3 not mach3.
+
+ Attempt to sort out SCO-related configs.
+ * configure.host (i[3456]86-*-sysv4.2*): Use instead of
+ i[3456]86-*-sysv4.2MP and i[3456]86-*-sysv4.2uw2*.
+ (i[3456]86-*-sysv5*): Recognize.
+ * configure.tgt (i[3456]86-*-sco3.2v5*, i[3456]86-*-sco3.2v4*):
+ Recognize.
+
+Wed Mar 24 16:19:01 1999 Christopher Faylor <cgf@cygnus.com>
+
+ * MAINTAINERS: Add DJ Delorie (dj@cygnus.com) as the djgpp
+ maintainer.
+
+Wed Mar 24 21:19:57 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * target.h (enum target_signal): Do not hardwire values of MACH
+ signals.
+
+1999-03-14 Ken Raeburn <raeburn@raeburn.org>
+
+ * target.h (enum target_signal): Add TARGET_SIGNAL_INFO.
+ * target.c (signals): Add SIGINFO description.
+ (target_signal_from_host, target_signal_to_host): Translate
+ SIGINFO to/from TARGET_SIGNAL_INFO.
+
+Wed Mar 24 01:01:27 1999 Andrew Cagney <cagney@sludge.cygnus.com>
+
+ * rs6000-tdep.c (rs6000_software_single_step): Change SIGNAL to
+ unsigned int.
+
+ From Rodney Brown <rodneybrown@pmsc.com>
+ * target.h (enum thread_control_capabilities), breakpoint.h (enum
+ bptype), breakpoint.c (enum insertion_state_t): Strict ISO-C
+ doesn't allow trailing comma in enum definition.
+
+Mon Mar 22 15:56:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (inside_entry_file, inside_entry_func): Convert #if
+ CALL_DUMMY_LOCATION to if.
+ * valops.c (call_function_by_hand): Ditto.
+ * infcmd.c (run_stack_dummy): Ditto.
+ * inferior.h (CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET,
+ CALL_DUMMY_BREAKPOINT_OFFSET): Provide default.
+
+1999-03-23 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * hppa-tdep.c (pa_register_look_aside): Remove CPU_HPPA_RISC_20
+ check, test for presence of struct save_state_t and the ss_wide
+ member directly.
+ * configure.in: Remove CPU_HPPA_RISC_20 test. Add tests for
+ HAVE_STRUCT_SAVE_STATE_T and HAVE_STRUCT_MEMBER_SS_WIDE.
+ * acconfig.h: Add HAVE_STRUCT_SAVE_STATE_T HAVE_STRUCT_MEMBER_SS_WIDE.
+ * configure, config.in: Regenerated.
+
+Mon Mar 22 13:25:13 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infttrace.c (proc_wait): rename to ptrace_wait.
+
+1999-03-18 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * dwarf2read.c: Correctly recognize location expressions that
+ designate LOC_REF_ARG arguments. Doc fixes.
+ (isderef): New global. (Yuck.)
+ (dwarf2_complex_location_expr): New complaint.
+ (read_func_scope): Reject frame_base attributes that use the
+ `deref' opcode as too complex.
+ (new_symbol): If both regoff and isderef are set, and the base
+ register is the frame pointer, then it's a LOC_REF_ARG argument.
+ (decode_locdesc): Recognize the `deref' opcode in location
+ expressions. Complain if it's not the last op in the expression.
+
+ * config/fr30/tm-fr30.h (COERCE_FLOAT_TO_DOUBLE): #define this to
+ be true, or else value_arg_coere won't respect the (accurate)
+ information we have about whether a function is prototyped.
+
+1999-03-17 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * config/fr30/tm-fr30.h (STACK_ALIGN): Define this here, so
+ calling functions by hand with odd-sized arguments doesn't munge
+ the stack.
+
+1999-03-17 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (HAVE_MULTIPLE_PROC_FDS): Don't define for Solaris
+ hosts--gdb doesn't support this yet.
+ * configure: Regenerated.
+
+1999-03-16 Keith Seitz <keiths@cygnus.com>
+
+ * remote.c (remote_binary_checked): New file global.
+ (check_binary_download): New function to check if
+ stub supports binary downloading that works with
+ stubs that are not eight bit clean.
+ (remote_write_bytes): Check for binary download capability
+ and use it if available.
+ Remove references to global remote_binary_length. What a hack.
+ (putpkt_binary): New function.
+ (putpkt): Call putpkt_binary.
+ Use xor to escape trouble characters.
+ * m32r-stub.c (bin2mem): Follow escape char convention change.
+
+Tue Mar 16 01:11:33 1999 Andrew Cagney <cagney@rhino.cygnus.com>
+
+ * target.h (struct target_ops), target.c (debug_to_query),
+ remote.c (pack_hex_byte, remote_query): Promote char parameters to
+ int. Stops compile problems with pedantic ISO-C compilers.
+
+Tue Mar 16 15:29:04 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * go32-xdep.c: Remove, no longer used by anything.
+ * Makefile.in: Remove references.
+
+ * jv-lang.c, jv-lang.h (java_primitive_type): Declare argument
+ as int instead of char.
+
+Mon Mar 15 11:42:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (push_stack_item, pop_stack_item): New function.
+ (d10v_push_arguments): Use.
+
+ From Martin M. Hunt <hunt@cygnus.com>:
+ * d10v-tdep.c (d10v_push_arguments): When arguments
+ must be pushed onto the stack, they go on in
+ reverse order.
+
+1999-03-16 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * symtab.c (make_symbol_overload_list): Don't try to stuff minimal
+ or partial symbols into the overload list; we don't know their
+ types. (Thanks to Rajiv Mirani.)
+
+1999-03-15 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * acinclude.m4 (--with-itclconfig, --with-itkconfig, --with-tixconfig):
+ Fix whitespace so --help messages line up.
+ * configure.in (--with-cpu): Fix capitalization for --help messages.
+ * configure, aclocal.m4: Regenerated.
+
+Mon Mar 15 11:39:03 1999 Ian Carmichael <iancarm@cygnus.com>
+
+ Support building gdb w/o simulator:
+ * configure.in: Support --disable-sim. Check for sim directory.
+ * Makefile.in (IGNORE_SIM, IGNORE_SIM_OBS): New.
+ * acconfig.h (WITH_SIM): Define.
+ * configure, config.in: Regenerate.
+
+Mon Mar 15 08:01:33 1999 Elena Zannoni <ezannoni@cygnus.com>
+
+ Patch from Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * top.c (read_command_lines): Reset control_level to 0.
+ (define_command): Don't do it here.
+
+Sun Mar 14 16:12:15 1999 Andrew Cagney <cagney@rhino.cygnus.com>
+
+ * hppah-nat.c (store_inferior_registers): Delete extern
+ registers[] declaration.
+
+Sun Mar 14 19:17:30 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * infrun.c (write_inferior_status_register): New function. Provide
+ update access to an inf_status register buffer. Only used by HP.
+ * inferior.h (write_inferior_status_register): Add prototype.
+
+ * hppa-tdep.c (push_dummy_frame): Use
+ write_inferior_status_register when hacking around a sleeping
+ inferior. Accidently fix byte-order problem.
+
+Sun Mar 14 16:40:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/pa/tm-hppa.h (PUSH_DUMMY_FRAME): Fix parameter. Address
+ not needed.
+
+Fri Mar 12 13:11:48 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (remote_write_bytes): fix 'X' packet protocol so that it
+ can't overwrite the end of its buffer with escaped characters.
+
+1999-03-12 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Alpha patches from Richard Henderson:
+
+ * alpha-tdep.c (alpha_skip_prologue): Recognize subq.
+
+ * config/alpha/tm-alpha.h (REGISTER_NAMES): No f31, but fpcr.
+ (FPCR_REGNUM): New.
+ (REGISTER_CONVERTIBLE): Don't convert fpcr.
+ (REGISTER_VIRTUAL_TYPE): Don't make fpcr a double.
+
+ * stabsread.c (define_symbol): Only consider live range extension
+ if we have an open parenthesis.
+
+1999-03-11 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * monitor.c (monitor_fetch_register): Print RDEBUG info correctly
+ when the register name is null.
+
+Thu Mar 11 19:33:07 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * infrun.c (wait_for_inferior): Change #if DECR_PC_AFTER_BREAK
+ uses to expressions, remove redundant extern decls.
+
+Thu Mar 11 18:05:11 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infptrace.c (proc_wait): Rename to ptrace_wait.
+ * inftarg.c (child_wait): call ptrace_wait instead of proc_wait.
+ * inferior.h: Declare ptrace_wait instead of proc_wait.
+
+Thu Mar 11 11:46:25 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * breakpoint.c (create_solib_load_unload_event_breakpoint,
+ create_fork_vfork_event_catchpoint, tcatch_command,
+ create_exception_catchpoint, break_at_finish_at_depth_command_1,
+ catch_fork_command_1, ep_skip_leading_whitespace,
+ break_at_finish_command_1, catch_exec_command_1,
+ catch_exception_command_1, stop_command, stopin_command,
+ stopat_command, ep_parse_optional_filename,
+ ep_find_event_name_end, ep_parse_optional_if_clause,
+ catch_fork_command_1), stack.c (show_and_print_stack_frame_stub,
+ print_stack_frame_stub, print_only_stack_frame_stub,
+ backtrace_command_1, backtrace_full_command, func_command),
+ valprint.c (print_decimal), source.c (print_source_lines_base):
+ Add prototype.
+
+ * stack.c (print_stack_frame_stub, show_and_print_stack_frame_stub,
+ print_only_stack_frame_stub): Make param void*.
+
+Wed Mar 10 19:33:28 1999 Geoffrey Noer <noer@cygnus.com>
+
+ * win32-nat.c: If old Cygwin Win32 API headers aren't being used,
+ define some gdb-specific defines that shouldn't have been in the
+ global headers.
+
+Wed Mar 10 21:20:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * findvar.c (registers, register_valid): Replace array with pointer.
+ (build_findvar): New function. Allocate space for REGISTERS and
+ REGISTER_VALID.
+ (_initialize_findvar): Call build_findvar.
+ (_initialize_findvar): Register REGISTERS and REGISTER_VALID as
+ arch dependant.
+
+ * inferior.h (registers, register_valid): Replace array with
+ pointer.
+
+ * inferior.h (struct inferior_status): Move definition from here.
+
+ * infrun.c (struct inferior_status): To here.
+ (struct inferior_status): Change ``stop_registers'' and
+ ``registers'' to pointers.
+ (xmalloc_inferior_status, free_inferior_status): New functions.
+ (restore_inferior_status): Call free_inferior_status.
+ (save_inferior_status): Call xmalloc_inferior_status.
+ (discard_inferior_status): New function, discard inf_status
+ buffer. Call free_inferior_status.
+
+ * inferior.h (stop_registers): Replace array with pointer.
+ * infrun.c (stop_registers): Update.
+ (build_infrun): Initialize stop_registers.
+ (_initialize_infrun): Call build_infrun.
+ (_initialize_infrun): Register ``stop_registers'' as arch dependant.
+
+Wed Mar 10 14:50:42 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * alpha-tdep.c (alpha_linux_sigtramp_offset): Only compile when
+ LINUXALPHA target. Hack.
+
+ * infrun.c (set_follow_fork_mode_command): Make static. Add
+ prototype.
+ * tracepoint.c (add_register): Ditto.
+ * valprint.c (strcat_longest): Comment out. Does not appear to be
+ used.
+ * valops.c (find_method_list): Make static. Add prototype.
+ * thread.c (target_find_new_threads): Make static. Add prototype.
+ * stack.c (stack_publish_stopped_with_no_frame,
+ select_and_maybe_print_frame): Comment out. Does not appear to be
+ used.
+ (current_frame_command): Add prototype.
+ * breakpoint.c (break_at_finish_command,
+ break_at_finish_at_depth_command, tbreak_at_finish_command): Make
+ static. Add prototype.
+ * findvar.c (read_relative_register_raw_bytes_for_frame): Ditto.
+
+Wed Mar 10 23:38:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * corefile.c (registers): Delete redundant variable declaration.
+ * inferior.h (run_stack_dummy): Change array argument to pointer.
+ * infcmd.c (run_stack_dummy): Update.
+ * value.h (value_being_returned): Change RETBUF to a pointer.
+ * values.c (value_being_returned): Update.
+
+Wed Mar 10 11:08:16 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * source.c (list_command): GCC suggested explicit braces to avoid
+ ambiguous `else'.
+
+ * jv-typeprint.c: Include "c-lang.h".
+ * Makefile.in (jv-typeprint.o): Add dependency.
+ * jv-valprint.c: Include "gdbcore.h", "annotate.h".
+ * Makefile.in (jv-valprint.o): Add dependencies.
+ * objfiles.c: Include "breakpoint.h".
+ * Makefile.in (objfiles.o): Add dependency.
+ * main.c: Include <unistd.h>.
+ * parse.c: Include <ctype.h>.
+ * remote.c: Include <ctype.h>.
+ * ser-tcp.c: Include <unistd.h>.
+ * ax-general.c: Include "value.h".
+ * Makefile.in (ax-general.o): Add dependency.
+
+ * alpha-tdep.c (alpha_push_arguments): Make ``i'' an int instead
+ of a register.
+ * frame.h (show_and_print_stack_frame): Add function prototype.
+ * language.h (language_enum): Add function prototype.
+ * value.h (find_overload_match): Add function prototype.
+
+ * defs.h, utils.c (subset_compare): Rename subsetCompare. Add
+ prototype.
+ * stack.c (backtrace_command): Update.
+
+Wed Mar 10 13:58:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for <sys/select.h>
+ * configure, config.in: Re-generate.
+ * inflow.c: Conditionally include <sys/select.h>.
+
+Wed Mar 10 13:44:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * frame.h (struct dummy_frame): Move from here.
+ * blockframe.c (struct dummy_frame): To here.
+
+ * blockframe.c (struct dummy_frame): Replace ``regs'' with pointer
+ ``registers''.
+ (generic_pop_dummy_frame): Free it.
+ (generic_push_dummy_frame): Allocate dummy frame register buffer.
+
+Wed Mar 10 11:08:16 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * thread.c (_initialize_thread): Delete redundant ``extern struct
+ cmd_list_element *cmdlist''.
+ * printcmd.c (print_command_1): Ditto for ``objectprint'';
+
+1999-03-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: New file, list of maintainers and areas they
+ maintain.
+
+1999-03-09 Rodney Brown <RodneyBrown@pmsc.com>
+
+ Get working on UnixWare 2.1.1.
+ * acconfig.h: Update for defines for procfs.c.
+ * configure.in: Identify defines for procfs.c.
+ * configure.host: i386-*-sysv4.2uw2* => i386v42mp
+ * configure.tgt: i386-*-sysv4.2uw2* => i386v42mp
+ * configure, config.in: Regenerate.
+ * procfs.c: Rename HAVE_NO_PRRUN_T to HAVE_PRRUN_T (autoconf
+ standard), wrap UNIXWARE difference in THE_PR_LWP macro for
+ legibility.
+ * config/i386/tm-i386v42mp.h: Remove HAVE_PSTATUS_T,
+ HAVE_NO_PRRUN_T; now set by configure.
+
+Tue Mar 9 16:29:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * i386-tdep.c (gdb_print_insn_i386): Abort when disassembly_flavor
+ undefined..
+
+ * fr30-tdep.c (_initialize_fr30_tdep): Add prototype. Fix
+ coding style.
+
+ * target.c (debug_to_enable_exception_callback,
+ debug_to_get_current_exception_event): Return result of call to
+ debug_target().
+
+1999-03-09 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Another HURD fix from Mark Kettenis:
+ * gnu-nat.c: Include <string.h>. Remove declaration of strerror.
+ Include <bits/waitflags.h> instead of <waitflags.h> and define
+ _SYS_WAIT_H to prevent the warning that we should not include it.
+ (gnu_create_inferior): Change return type of attach_to_child to
+ void. Do not return INFERIOR_PID.
+ (gnu_pid_to_exec_file): Change return type to char *.
+ Return NULL.
+
+ Fix for the HURD from Mark Kettenis:
+ * configure.in: Add AC_PROG_AWK. Needed by the machine-dependent
+ makefile fragments for the Hurd.
+ * Makefile.in (AWK): Add. Set by configure.
+ * configure: Regenerated.
+
+1999-03-08 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * infttrace.c (hppa_get_process_events): Removed. Function only
+ usable on HPUX 10 and above. It is not called by any other part
+ of GDB.
+ * hppah-nat.c (hppa_get_process_events): Ditto.
+ (child_pid_to_exec_file): Only call ptrace with
+ PT_GET_PROCESS_PATHNAME if that symbol has been defined.
+ * config/pa/nm-hppah.h: Don't set up prototypes et al for
+ hppa_get_process_events.
+
+ * config/pa/hppahpux.mh (TERM_LIB): Do not initialize, let autoconf
+ determine best library automatically.
+ * config/pa/hpux1020.mh: Ditto.
+ * config/pa/hpux1100.mh: Ditto.
+ * configure.in (TERM_LIB): Also check for libHcurses.
+ * configure: Regenerated.
+
+Thu Mar 4 17:16:04 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * m32r-stub.c: add support for crc "Compare" command.
+
+1999-03-04 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * fr30-tdep.c (fr30_store_return_value): Allocate zeroes
+ dynamically, to save BSS space, and to remove assumptions about
+ the size of the largest value we'll return.
+
+ * config/fr30/tm-fr30.h (fr30_store_return_value): Use PARAMS in
+ prototype.
+
+Thu Mar 4 08:37:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sh3-rom.c (sh3_supply_register, sh3_supply_register),
+ mips-tdep.c (mips_push_arguments), m32r-rom.c
+ (m32r_upload_command), m32r-tdep.c (decode_prologue), monitor.c
+ (longlong_hexchars), tracepoint.c (validate_actionline,
+ read_actions), mdebugread.c
+ (parse_symbol), jv-typeprint.c
+ (java_type_print_base, java_type_print_base), mdebugread.c
+ (parse_symbol), top.c (source_command), utils.c
+ (floatformat_to_doublest): GCC suggest explicit braces to avoid
+ ambiguous `else'.
+
+ * tracepoint.c (map_args_over_tracepoints, trace_actions_command),
+ m32r-rom.c (m32r_supply_register), win32-nat.c
+ (handle_output_debug_string, child_continue), i960-tdep.c
+ (pop_frame), m32r-rom.c (m32r_upload_command): GCC suggested
+ parentheses around assignment used as truth value.
+
+ * remote-sds.c (sds_wait), monitor.c (monitor_fetch_register),
+ ser-e7kpc.c, (dosasync_write), arc-tdep.c (arc_get_frame_setup):
+ GCC suggested parentheses around operands.
+
+ * c-typeprint.c (c_type_print_base): GCC suggested enclosing
+ "while" expression in paren.
+
+Wed Mar 3 18:14:33 1999 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * sol-thread.c (save_inferior_pid): Cast the saved pid to void*.
+ (restore_inferior_pid): Takes void* as required by make_cleanup.
+ Casts pid back to an int.
+
+ * procfs.c (make_cleanup_close_proc_file,
+ close_proc_file_cleanup): Create a proc_file cleanup.
+ (info_proc): Use.
+
+ * defs.h (make_cleanup_freeargv): Helper function. Establish
+ cleanup using freeargv. Can not just typecast/pass freeargv as it
+ violates ISO-C.
+ * utils.c (do_freeargv): Helper.
+ (make_cleanup_freeargv): New function.
+
+ * symmisc.c (maintenance_print_symbols,
+ maintenance_print_psymbols, maintenance_print_msymbols), symfile.c
+ (symbol_file_command), stack.c (backtrace_command), remote-sim.c
+ (gdbsim_create_inferior, gdbsim_open), remote-mips.c
+ (common_open), procfs.c (info_proc), infrun.c (handle_command,
+ xdb_handle_command), exec.c (exec_file_attach): Call
+ make_cleanup_freeargv.
+
+1999-03-03 James Ingham <jingham@cygnus.com>
+
+ * i386-tdep.c (_initialize_i386_tdep): Set the inital value for
+ disassembly flavor at startup, rather than hardcoding it.
+
+1999-03-03 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Put return values in the right place.
+ * fr30-tdep.c (fr30_store_return_value): New function.
+ * config/fr30/tm-fr30.h (STORE_RETURN_VALUE): Call
+ fr30_store_return_value.
+
+Wed Mar 3 18:10:55 1999 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * gdbtypes.c (virtual_base_list_aux): Return void. Add prototype.
+
+ * breakpoint.c (map_catch_names): Comment out unused function.
+
+1999-03-02 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * hppa-tdep.c (pa_register_look_aside): Only refer to save_state_t
+ structure on PA 2.0 systems.
+
+1999-03-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Gary Thomas <gthomas@cygnus.co.uk>:
+ * arm-tdep.c (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT,
+ THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Use illegal instruction
+ instead of SWI 24.
+ * config/arm/tm-arm.h (CALL_DUMMY): Ditto.
+ (IN_SIGTRAMP): Define.
+
+1999-03-02 Nick Clifton <nickc@cygnus.com>
+
+ * findvar.c (store_address): Delete incorrect big endian
+ code.
+
+Tue Mar 2 18:02:42 1999 Andrew Cagney <cagney@chook>
+
+ * configure.in (gdb_cv_os_cygwin): Compat. Continue to reconize
+ __CYGWIN32__.
+
+1999-03-01 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Move setting of gdb_cv_os_cygwin to before
+ setting of TERM_LIB. Check for __CYGWIN__ instead of __CYGWIN32__.
+ * configure: Regenerated.
+
+1999-03-01 DJ Delorie <dj@cygnus.com>
+
+ * configure.in: Change -cygwin32* to -cygwin*.
+ * configure: Ditto.
+
+1999-02-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ * breakpoint.c (SOLIB_LOADED_LIBRARY_PATHNAME,
+ SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_CREATE_CATCH_LOAD_HOOK,
+ SOLIB_CREATE_CATCH_UNLOAD_HOOK): Supply default definitions.
+ * infrun.c (SOLIB_IN_DYNAMIC_LINKER): Ditto.
+
+1999-02-25 Keith Seitz <keiths@cygnus.com>
+
+ * corelow.c (core_close): Clear out solib state before
+ closing the bfd associated with the core file.
+ * solib.c (clear_solib): Mention that clear_solib requires
+ an open BFD in order for disable_breakpoints_in_shlibs to
+ determine whether breakpoints live in shared libraries.
+
+1999-02-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Set CPU_HPPA_RISC_20 if the host CPU is a PA 2.0
+ processor.
+ * acconfig.h: Add CPU_HPPA_RISC_20
+ * config.in, configure: Regenerated.
+ * hppa-tdep.c (pa_register_look_aside): Only refer to new
+ structure elements if we are on a PA2.0 system.
+ * defs.h: Include limits.h.
+
+Tue Feb 23 14:37:08 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infrun.c (wait_for_inferior): Check scheduler_locking state
+ before resuming after a thread-specific breakpoint.
+
+1999-02-23 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * aclocal.m4, config.in, configure: Regenerated with latest
+ autotools.
+
+Mon Feb 22 12:32:19 1999 Per Bothner <bothner@cygnus.com>
+
+ * jv-valprint.c (java_val_print): Restore line that somehow got lost.
+
+ * jv-valprint.c (java_print_value_fields): Check for NULL type.
+
+1999-02-21 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * tm-h8500.h, i386lynx-nat.c: Removed. These files are long
+ dead; it seems that they only appeared due to some CVS weirdness.
+ If they appear again, we may need to distribute garlic and holy
+ water.
+
+1999-02-19 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (TERM_LIB): Move checking for TERM_LIB, substituting.
+ * configure: Regenerated.
+
+1999-02-19 Robert Hoehne (robert.hoehne@gmx.net)
+
+ * configure.host (i[3456]86-*-msdosdjgpp*): New host.
+ * configure.tgt (i[3456]86-*-msdosdjgpp*): New target.
+ * go32-nat.c: New file, native DJGPP support.
+ * config/i386/go32.mh: Rewrite for DJGPP (go32) host.
+ * config/i386/go32.mt: New file, DJGPP (go32) target.
+ * config/i386/nm-go32.h: New file.
+ * config/i386/tm-go32.h: New file.
+ * config/i386/xm-go32.h: Rewritten for current DJGPP.
+
+1999-02-18 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * reply_mig_hack.awk, config/nm-gnu.h, config/alpha/nm-linux.h
+ config/alpha/xm-alphalinux.h, config/alpha/xm-alphaosf.h
+ config/i386/nm-i386sco5.h, config/i386/tm-fbsd.h, config/i386/tm-i386.h
+ config/powerpc/nm-aix.h, config/powerpc/tm-macos.h
+ config/powerpc/tm-ppc-aix.h, config/powerpc/xm-aix.h
+ config/rs6000/tm-rs6000-aix4.h, testsuite/gdb.chill/tests1.ch
+ testsuite/gdb.chill/tests2.ch, testsuite/gdb.chill/tests2.exp:
+ Update FSF address in copyright notices.
+
+1999-02-18 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Quote "$GCC" correctly.
+ * configure: Regenerated.
+
+1999-02-18 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * dbxread.c (elfstab_build_psymtabs): Don't assume that there's a
+ section named ".text", which has all the code in it. Instead, look
+ at all the sections in the file with the `code' flag set.
+ (find_text_range): New function, that does all the work.
+
+Thu Feb 18 17:50:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (FP_REGISTER_DOUBLE): Conditionally define.
+
+Fri Jan 29 16:51:11 1999 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * mips-tdep.c (return_value_location): New function. Merge/rewrite
+ of return-value code in mips_extract_return_value,
+ mips_store_return_value. Stop buffer overflow when 64 bit value
+ in 32 bit registers. Extract 64bit float from 32 bit register
+ pair of correct order.
+ (mips_extract_return_value, mips_store_return_value): Call
+ return_value_location. For store, ensure that remainder of
+ register is zero.
+
+Thu Jan 28 18:58:02 1999 Andrew Cagney <cagney@chook.cygnus.com>
+
+ From John Metzler <jmetzler@cygnus.com>:
+ * mips-tdep.c (struct gdbarch_tdep): Add mips_saved_regsize.
+ (MIPS_SAVED_REGSIZE): Define.
+ (mips_find_saved_regs, read_next_frame_reg, mips_pop_frame):
+ Read/write MIPS_SAVED_REGSIZE bytes of register on stack instead
+ of MIPS_REGSIZE.
+ (mips_gdbarch_init): Initialize mips_saved_regsize.
+
+ * mips-tdep.c (mips_frame_saved_pc, mips16_heuristic_proc_desc,
+ mips_push_arguments, mips_push_dummy_frame,
+ mips_use_struct_convention): Ditto. For MIPS_SAVED_REGSIZE <
+ REGISTER_RAW_SIZE, handle little/big endian issues from only using
+ half the register.
+ (STACK_ARGSIZE): Default to MIPS_SAVED_REGSIZE instead of
+ MIPS_REGSIZE.
+
+ * mips-tdep.c (struct gdbarch_tdep, FP_REGISTER_DOUBLE,
+ mips_gdbarch_init): Apply similar changes. Add
+ mips_fp_register_double to struct.
+
+Wed Feb 17 10:10:27 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * gdbtypes.h (get_discrete_bounds): Remove duplicate decl.
+
+ * jv-typeprint.c (java_type_print_base): Change fputs => fputs_filtered.
+
+Mon Jan 25 18:30:57 1999 Per Bothner <bothner@cygnus.com>
+
+ * jv-lang.h (JAVA_OBJECT_SIZE): Change from hard-wired constant.
+ (java_primitive_type_from_name, get_java_object_header_size): Declare.
+ * jv-lang.c (java_class_from_object): Use get_java_object_type.
+ * jv-lang.c: Update Class field names: dtable->vtable,
+ msize->method_count, nfields->field_count, bfsize->size_in_bytes,
+ nmethods->method_count.
+ (type_from_class): Demangle array type names.
+ (java_link_class_type): Array type names are now demangled.
+ (get_java_object_type): If not defined yet, try looking it up.
+ (get_java_object_header_size): New function.
+ (java_primitive_type_from_name): New function.
+ (java_demangled_signature_length, java_demangled_signature_copy): New.
+ (java_demangle_type_signature): Re-implement using above functions.
+ (evaluate_subexp_java): For UNOP_IND, call evaluate_subexp_java
+ to evaluate subexp (not evaluate_subexp_standard).
+ For BINOP_SUBSCRIPT update for new array type naming scheme.
+ * jv-valprint.c (java_value_print): Use java_class_from_object.
+ Update array printing to new array type naming convention.
+ (java_val_print): Doing check_typedef when printing a pointer is
+ is a waste of effort. Also, handle TYPE_CODE_INT, to make sure
+ Java bytes as not printed as C chars.
+
+Fri Jan 8 16:58:22 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * blockframe.c (find_pc_sect_partial_function): Search full symtabs as
+ a last ditch effort (after the partial & minimal symtabs).
+ * defs.h utils.c: Fixup prototypes for vprintf_filtered,
+ vfprintf_filtered, vfprintf_unfiltered and vprintf_unfiltered to return
+ ints to match their standard equivalents.
+ * defs.h symtab.c top.c: Create skip_prologue_hook to allow Java to
+ control the prologue skipping process.
+ * jv-typeprint.c (java_type_print_base): Remove extern for
+ jv_class_demangle, add new arg for objfile (NULL).
+ * symtab.h: Remove struct sourcevector and struct source. Definately
+ not needed.
+ * values.c (value_virtual_fn_field): Fixes code to handle new vtable
+ debug info format. Patch from marka.
+
+Wed Dec 16 23:11:25 1998 Stu Grossman <grossman@fencer.cygnus.com>
+
+ * jv-lang.c (java_class_from_object java_class_is_primitive
+ is_object_type): Change dtable to vtable.
+ * (java_primitive_type): Change arg to type char.
+ * (_initialize_java_language): Make java_char_type be unsigned.
+ * jv-lang.h: Fixup prototypes.
+
+Mon Dec 7 19:02:15 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * jv-valprint.c (java_value_print): Fix printing of values where
+ run time type != compile time type.
+
+Fri Dec 4 15:23:38 1998 Stu Grossman <grossman@fencer.cygnus.com>
+
+ * Makefile.in: Whack out m2-typeprint.c.
+ * c-typeprint.c (c_type_print_varspec_suffix) typeprint.h: Make this
+ global. It's needed by Java.
+ * (c_type_print_base): Whack prefix off of qualified method names
+ (names with name spaces).
+ * gdbtypes.h (struct cplus_struct_type): Add bits for Java attributes.
+ Shrink voffset
+ to 16 bits to compensate for added bits above (hopefully this is still
+ enough).
+ * Add new accessor macros (TYPE_FND_FIELD_PUBLIC, ...) for all new
+ attribute bits.
+ * jv-typeprint.c (java_type_print_base): Fix printing of method
+ attributes. Handle JVM style manglings.
+ * (java_print_type): Enable code type print varspec_suffix to allow
+ array indices to print out.
+ * jv-valprint.c (java_val_print): Minor formatting.
+ * m2-lang.c (m2_language_d): Change m2_print_type to c_print_type.
+ * stabsread.c (read_member_functions): Save public and static attributes.
+
+Wed Feb 17 15:32:57 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (watch_command_1): Reformat comment.
+
+ * c-typeprint.c (c_type_print_base): Reformat comments.
+
+1999-02-17 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * Makefile.in (VERSION): Bump version to 4.17.2.
+
+Tue Feb 16 15:48:20 1999 Edith Epstein <eepstein@sophia.cygnus.com>
+
+ * config/pa/nm-hppah.h: Added prototype declarations for
+ hppa_enable_page_protection_events and
+ hppa_disable_page_protection_events.
+
+ * inftarg.c (child_wait): Fixed code that checks whether
+ or not the target program has done a fork/vfork.
+ related_pid does not have a value unless the target
+ program has forked/vforked.
+
+ * infttrace.c (hppa_insert_hw_watchpoint): Make sure that
+ function always returns a value.
+ (hppa_remove_hw_watchpoint): Make sure that function always
+ returns a value.
+
+Tue Feb 16 06:31:58 1999 Keith Seitz <keiths@cygnus.com>
+
+ * config/powerpc/tm-ppc-eabi.h: Do not define PC_IN_CALL_DUMMY,
+ let the generic call dummy infrastructure do it.
+
+Sun Feb 14 18:21:08 1999 Mark Alexander <marka@cygnus.com>
+
+ * config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
+ coffread.c will correctly handle char or short function parameters.
+
+1999-02-11 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure, aclocal.m4: Regenerate with correct version of aclocal.
+
+1999-02-10 Syd Polk <spolk@cygnus.com>
+
+ * acinclude.m4: Fix for new location of itclConfig.sh and itkConfig.sh.
+ * aclocal.m4: Regnerate.
+ * configure: Regenerate.
+
+1999-02-10 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * demangle.c: Fix comments to mention "set demangle-style"
+ instead of "set demangle".
+ Run through indent to fix minor indenting problems.
+
+Wed Feb 10 17:53:09 1999 Bob Manson <manson@charmed.cygnus.com>
+
+ * i386-tdep.c (gdb_print_insn_i386): Add missing returns.
+
+Wed Feb 10 13:17:21 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ Declare Gould configuration obsolete:
+ * configure.host, configure.tgt: Comment out Gould configs.
+ * Makefile.in: Comment out Gould-related actions.
+ * gould-xdep.c, gould-tdep.c, config/gould/*: Comment out.
+ * NEWS: Mention obsolete status.
+
+1999-02-09 DJ Delorie <dj@cygnus.com>
+
+ * sparcl-tdep.c: UDP download works in cygwin
+
+1999-02-08 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gnu-regex.c: Check ENABLE_NLS instead of HAVE_LIBINTL_H.
+ * configure.in: Don't check for libintl.h.
+ * configure, config.in: Regenerated.
+
+Mon Feb 8 18:10:50 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Mention new X packet and PowerPC variant support.
+
+1999-02-08 Nick Clifton <nickc@cygnus.com>
+
+ * configure.host: Add support for StrongARM host.
+ * configure.tgt: Add support for StrongARM target.
+
+Mon Feb 8 12:05:05 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * dsrec.c (make_srec): Cast targ_addr to int in call to sprintf
+ otherwise on big endian machine with a bfd_vma of 64 bits,
+ *everything* gets loaded at location 0.
+
+Mon Feb 7 10:05:43 1999 Frank Ch. Eigler <fche@cygnus.com>
+
+ * infrun.c (wait_for_inferior): Allow SIGTRAP to be "pass"ed
+ to target program.
+
+Fri Feb 5 16:46:14 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * NEWS: Add mentions of various new things.
+
+Thu Feb 4 00:19:14 1999 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Move termcap determination later in the
+ file to catch setting of cygwin flag.
+ * configure: Regenerate.
+
+Wed Feb 3 14:16:38 1999 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.mh: Move TERMCAP test code to configure.in.
+ * configure.in: Treat libtermcap.a detection as a special case
+ when hosting on cygwin.
+ * configure: Regenerate.
+
+1999-02-03 Keith Seitz <keiths@cygnus.com>
+
+ * remote.c (remote_binary_download, remote_binary_length): New
+ static globals for dealing with binary transmissions.
+ (remote_write_bytes): Add support for binary downloads
+ by shadowing the "M" packet with a new "X" packet. This
+ defaults to ON; if the stub does not understand this, it
+ will fall back to using "M".
+ (putpkt): Add support for binary downloading.
+ * monitor.c (monitor_expect): The mon2000 monitor
+ on the MSA2000 will also emit random DC1/DC3 chars.
+ * m32r-stub.c: Change all char's to unsigned char's
+ to support binary downloading.
+ (handle_exception): Add support for binary downloading
+ via a new "X" packet.
+ (getpacket): Do NOT strip eighth bit of incoming chars.
+ Watch out for escaped characters in the incoming stream.
+ (putpacket): Do NOT strip eighth bit of incoming chars.
+ (bin2mem): New function to write binary data directly to
+ memory.
+ * m32r-rom.c: Add new "mon2000" target.
+
+Tue Feb 2 18:40:29 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hp-psymtab-read.c (hpread_build_psymtabs): Coerce first arg
+ passed to make_cleanup to the correct type.
+ (hpread_quick_traverse): Change fifth arg to call to
+ hpread_end_psymtab to be 0.
+ Compare CURR_MODULE_END to 0 rather than NULL.
+ Get rid of ifdef'ed out code.
+ (scan_procs): Get rid of ifdef'ed out code.
+
+ * somread.c (som_symfile_read): Coerce first argument passed to
+ make_cleanup to the correct type.
+
+Tue Feb 2 17:36:29 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hp-psymtab-read.c (do_pxdb): New function. Check whether the
+ file needs to be processed by pxdb (an HP debug info massaging
+ tool), if so call it.
+ (hpread_build_psymtabs): Initialize scan_start to 0 and
+ simplify flow of control.
+
+ * somread.c (som_symfile_read): Add call to do_pxdb (),
+ in hp-psymtab-read.c.
+
+ * symfile.c (symbol_file_add): Remove ifdef'ed out HPUX specific
+ code.
+ (symfile_bfd_open): Remove HPUXHPPA ifdef'ed code. Code is now
+ in hp-psymtab-read.c.
+
+1999-02-02 Martin Hunt <hunt@cygnus.com>
+
+ * printcmd.c (print_scalar_formatted): Use strcat to concat all
+ the output together before calling fprintf_filtered().
+
+1999-02-01 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Require autoconf 2.13.
+ (AM_EXEEXT): Replace with new AC_EXEEXT.
+ * acinclude.m4: Move itcl header macros from aclocal.m4 to here.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+1999-02-01 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Allow PPC users to select which PPC/RS6000 variant they're
+ debugging at run-time. At the moment, the only thing this affects
+ is the set of registers visible.
+ * config/rs6000/tm-rs6000.h (REGISTER_NAME): Define this as a call
+ to the function rs6000_register_name.
+ (rs6000_register_name): Include extern decl.
+ (NUM_REGS): Bump to 183. What's the right way to do this?
+ (FIRST_UISA_SP_REGNUM, LAST_UISA_SP_REGNUM): Renamed from
+ FIRST_SP_REGNUM, LAST_SP_REGNUM.
+ (REGISTER_BYTES): Recompute this.
+ * rs6000-tdep.c: Renamed all uses of FIRST_SP_REGNUM and
+ LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
+ some concomitant formatting changes.
+ #include "gdbcmd.h", so we can define commands here.
+ (struct variant): New structure.
+ (COMMON_UISA_REG_NAMES, PPC_UISA_SPR_NAMES, PPC_SEGMENT_REG_NAMES,
+ PPC_32_OEA_SPR_NAMES, num_registers): New macros.
+ (register_names_rs6000, register_names_uisa, register_names_403,
+ register_names_403GC, register_names_505, register_names_860,
+ register_names_601, register_names_602, register_names_603,
+ register_names_604, register_names_750, variants): New variables.
+ (rs6000_register_name, install_variant, find_variant_by_name,
+ install_variant_by_name, list_variants, show_current_variant,
+ set_processor, show_processor): New functions.
+ (_initialize_rs6000_tdep): Define new commands `set processor' and
+ `show processor', and call install_variant_by_name to set the
+ default variant.
+ * rs6000-nat.c: Renamed all uses of FIRST_SP_REGNUM and
+ LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
+ some concomitant formatting changes.
+ * configure.in: Accept the `--with-cpu' flag, to specify a default
+ processor variant.
+ * acconfig.h: Provide a blurb for TARGET_CPU_DEFAULT, which is set
+ by configure's `--with-cpu' flag.
+ * config.in, configure: Regenerated.
+
+Sun Jan 31 15:24:24 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * buildsym.h, buildsym.c: Convert to ANSI-only.
+
+ * buildsym.h, buildsym.c: Reformat to standard.
+
+ * buildsym.c (merge_symbol_lists): Remove unused variable.
+ (_initialize_buildsym): Remove, does nothing.
+
+1999-01-31 J.T. Conklin <jtc@redbacknetworks.com>
+
+ * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
+ sparcl-stub, sparclet-stub.c: Change declaration of putDebugChar
+ to include explicit void return type as per documentation. Fix up
+ occasions where stubs erroneously checked return type.
+
+Sun Jan 31 13:18:33 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ From J.T. Conklin <jtc@redbacknetworks.com>:
+ * remote.c (remote_query): Fix tipo.
+
+Fri Jan 29 15:25:09 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (v850): Add wildcard to match.
+
+Fri Jan 29 16:44:01 1999 Edith Epstein <eepstein@sophia.cygnus.com>
+
+ * inferior.h: Ran indent.
+
+ * fork-child.c: Ran indent.
+
+ * infrun.c : Ran indent.
+
+Fri Jan 29 12:57:34 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (_initialize_infrun): Do not stop or print anything
+ when a SIGWINCH is received.
+
+ * Makefile.in (m2-exp.tab.c): Use YACC not BISON.
+ (f-exp.tab.c): Ditto.
+ (jv-exp.tab.c): Ditto.
+ (c-exp.tab.c): Ditto.
+ (YACC): Define as @YACC@.
+
+1999-01-29 Martin Hunt <hunt@cygnus.com>
+
+ Changes from Keith Seitz <keiths@cygnus.com>
+ * valops.c (value_assign): Add calls to register_changed_hook and
+ memory_changed_hook to inform UIs that the user has changed
+ the target's registers/memory.
+ * findvar.c (write_register_gen): Remove call to pc_changed_hook.
+ * defs.h: Remove declaration for pc_changed_hook and
+ add declarations for register_changed_hook and
+ memory_changed_hook.
+ * top.c: Ditto.
+
+1999-01-29 Mark Alexander <marka@cygnus.com>
+
+ * procfs.c (wait_fd): Handle deleted threads correctly.
+
+1999-01-28 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * utils.c (init_page_info): Force window size if running under emacs.
+
+1999-01-27 James Ingham <jingham@cygnus.com>
+
+ * typeprint.c (whatis_exp): Remove static declaration.
+
+Wed Jan 27 16:50:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hp-psymtab-read.c: Reformat using indent.
+
+Wed Jan 27 13:20:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * hp-psymtab-read.c: Reformat comments, update copyright.
+
+Wed Jan 27 15:09:22 1999 Andrew Cagney <cagney@chook.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Trace e_flags from BFD
+ elf_info.
+
+Tue Jan 26 16:02:47 1999 Mark Alexander <marka@cygnus.com>
+
+ * v850-tdep.c (v850_generic_reg_names, v850e_reg_names,
+ v850_register_names, v850_processor_type_table): Declare tables
+ and structures for handling differences in register names for
+ v850 and v850e.
+ (struct reg_list): Define new structure for creating tables
+ of register bit masks in v850e instrutions.
+ (handle_prepare, handle_pushm): New helpers for v850_scan_prologue.
+ (v850_scan_prologue): Recognize v850e instructions: callt, prepare,
+ and pushm.
+ (v850_target_architecture_hook): New function to set register
+ names based on current machine.
+ (_initialize_v850_tdep): Set up target_architecture_hook.
+ * config/v850/tm-v850.h (v850_register_names): Declare.
+ (REGISTER_NAME): Define to refer to v850_register_names.
+ (SR0_REGNUM, CTBP_REGNUM): Define.
+ (PS_REGNUM): Redefine in terms of SR0_REGNUM.
+
+Tue Jan 26 18:27:26 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Makefile.in (c-exp.tab.c): Use BISON instead of YACC, to pick
+ the correct value from configure output.
+ (jv-exp.tab.c): Ditto.
+ (f-exp.tab.c): Ditto.
+ (m2-exp.tab.c): Ditto.
+
+1999-01-26 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * breakpoint.h (ep_is_exception_catchpoint): Add prototype.
+ * frame.h (select_and_print_frame): Add prototype.
+ * stack.c (func_command): Call select_and_print_frame with correct
+ number of arguments. Reformat whitespace.
+
+Tue Jan 26 16:53:54 1999 Fernando Nasser <fnasser@cygnus.com>
+
+ * remote.c (remote_query): fix maximum packet size to account for
+ remote_debug use.
+ (putpkt): add comment to alert about extra byte need.
+
+Mon Jan 25 19:55:30 1999 Mark Alexander <marka@cygnus.com>
+
+ * sh-tdep.c (sh_target_architecture_hook): Return immediately
+ when a matching machine is found.
+
+Fri Jan 22 09:10:35 1999 Mark Alexander <marka@cygnus.com>
+
+ * remote-mips.c (mips_initialize): Fix parameters to clear_breakpoint.
+ (common_breakpoint): Restore support for instruction breakpoints
+ on non-LSI targets.
+
+Thu Jan 21 17:16:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * stack.c: Close open comment.
+ * symtab.c (find_pc_sect_line): Ditto.
+
+Thu Jan 21 17:51:51 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * procfs.c (init_procfs_ops): New function, fills in procfs_ops,
+ init only nonzero fields, leave to_require_attach and
+ to_require_detach empty, not needed for /proc systems yet.
+ (_initialize_procfs): Call init_procfs_ops.
+
+ From J.T. Conklin <jtc@redbacknetworks.com>:
+ * top.c (init_main): Fix tipo in description of the remotetimeout
+ variable.
+ * breakpoint.c (bpstat_stop_status): Handle systems where
+ DECR_PC_AFTER_BREAK != DECR_PC_AFTER_HW_BREAK.
+
+Thu Jan 21 17:25:46 1999 Mark Alexander <marka@cygnus.com>
+
+ * mon960-rom.c (_initialize_mon960): Call init_mon960_cmds
+ to fill in mon960_cmds structure properly.
+
+Wed Jan 20 17:53:22 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-sds.c (sds_ops): Define only once.
+ (init_sds_ops, sds_command, _initialize_remote_sds): Declare.
+ (init_sds_ops): Init only non-zero fields.
+
+Wed Jan 20 15:45:15 1999 Mark Alexander <marka@cygnus.com>
+
+ * h8300-tdep.c (original_register_names, h8300h_register_names,
+ h8300_register_names): Define new variables.
+ (set_register_names): New function to set register names based on
+ current CPU type.
+ (h8300_command, h8300h_command, h8300s_command): Call
+ set_register_names.
+ * config/h8300/tm-h8300.h (h8300_register_names): Declare.
+ (REGISTER_NAME): Define to refer to h8300_register_names.
+
+1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * sol-thread.c abug-rom.c cpu32bug-rom.c dbug-rom.c m32r-rom.c
+ mac-nat.c mon960-rom.c op50-rom.c ppc-bdm.c remote-adapt.c
+ remote-array.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c
+ remote-est.c remote-hms.c remote-mm.c remote-nindy.c remote-nrom.c
+ remote-os9k.c remote-rdp.c remote-sds.c remote-sim.c remote-st.c
+ remote-udi.c rom68k-rom.c sh3-rom.c sparcl-tdep.c sparclet-rom.c
+ v850ice.c win32-nat.c: cosmetic changes to conform to coding
+ standards.
+
+1999-01-19 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ Use aclocal to generate GDB's aclocal.m4 script.
+ * acinclude.m4: New file, containing the hand-written local macro
+ definitions that used to be in aclocal.m4. Don't sinclude
+ ../bfd/aclocal.m4 any more; running aclocal in this directory will
+ get us the definitions we need. HOWEVER: Do sinclude
+ ../bfd/acinclude.m4, because we need the definition of
+ BFD_NEED_DECLARATION.
+ * aclocal.m4: Regenerated by aclocal.
+ * configure: Regenerated by autoconf.
+
+Tue Jan 19 10:27:23 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * breakpoint.c (disable_breakpoints_in_shlibs): new parameter,
+ silent, controls whether to print message about removal of shared
+ library breakpoints.
+ * breakpoint.h (disable_breakpoints_in_shlibs): decl updated.
+ * irix5-nat.c (clear_solib): call disable_breakpoints_in_shlibs.
+ * osfsolib.c (clear_solib): ditto.
+ * solib.c (clear_solib): ditto.
+ * somsolib.c (som_solib_restart): update call to
+ disable_breakpoints_in_shlibs.
+
+ * target.h (child_post_attach): only declare if CHILD_POST_ATTACH
+ is define.
+
+Tue Jan 19 18:07:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * corelow.c (solib_add_stub): Ditto.
+ (core_file_to_sym_file): Cast make_cleanup parameter.
+
+ * solib.c (symbol_add_stub, solib_map_sections): Change argument
+ to PTR insted of a char*. Matches catch_errors interface.
+
+Mon Jan 18 14:01:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-array.c (array_open): Don't use fprintf_filtered to send
+ data to the log file.
+
+ * remote-array.c (handle_load_dll): Change argument type to PTR so
+ that it is compatible with catch_errors.
+ * ocd.c (ocd_start_remote): Ditto.
+ * remote-sds.c (sds_start_remote): Ditto.
+
+ * win32-nat.c (win32_child_thread_alive): Namespace proof
+ child_thread_alive.
+ (init_child_ops): Update.
+
+Mon Jan 18 12:03:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): Set gdb_hostif.hostosarg and
+ gdb_hostif.dbgarg to NULL instead of stdout.
+ (voiddummy, myprint, mywritec): Use gdb_stdout instead of stdout.
+
+Mon Jan 18 16:40:50 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * ser-ocd.c (ocd_open): Handle Unix case gracefully.
+
+ * target.c (dummy_target): Don't initialize statically.
+ (init_dummy_target): New function, fills in dummy_target.
+ (initialize_targets): Use it.
+ * hpux-thread.c (hpux_thread_ops): Don't initialize statically.
+ (init_hpux_thread_ops): New function, fills in hpux_thread_ops.
+ (_initialize_hpux_thread): Use it.
+ * m3-nat.c (m3_ops): Don't initialize statically.
+ (init_m3_ops): New function, fills in m3_ops.
+ (_initialize_m3): Use it.
+
+1999-01-18 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * sol-thread.c: delete compile time initialization of target_ops
+ (_initialize_sol_thread): initialize target_ops at run time.
+ * hpux-thread.c: added target_ops entry.
+ * m3-nat.c: ditto.
+
+Mon Jan 18 15:19:13 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * procfs.c (procfs_ops): delete compile time initialization.
+ (_initialize_procfs): initialize procfs_ops at run time.
+
+Mon Jan 18 12:51:44 1999 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Ensure that -luser32 is always linked in
+ for cygwin build.
+ * configure: Regenerated.
+
+Mon Jan 18 08:38:05 1999 Mark Alexander <marka@cygnus.com>
+
+ * values.c (value_virtual_fn_field): Clear the pointed-to
+ offset when casting to the base class.
+
+Mon Jan 18 10:30:51 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * remote-udi.c (init_udi_ops): change non-existant udi_run_ops to
+ udi_ops; delete NULL initializers.
+
+Mon Jan 18 12:03:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.c (serial_close): gdb_fclose tages gdb_file** arg, not
+ gdb_file*.
+
+ * f-valprint.c, target.c, gdbarch.c: Pass gdb_stderr not stderr.
+
+Mon Jan 18 10:46:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * stack.c (print_frame_info_base): Don't cast call to
+ catch_errors.
+ (print_args_stub): Change char* arg to PTR.
+ * symmisc.c (print_symbol): Ditto.
+ * top.c (quit_cover): Ditto.
+ * remote.c (remote_open_1, remote_start_remote): Ditto.
+ * infrun.c (normal_stop, hook_stop_stub, restore_selected_frame):
+ Ditto.
+
+ * stack.c (backtrace_command): Cast first arg of make_cleanup to
+ make_cleanup_func.
+ * remote.c (remote_kill): Cast putpkt arg to catch_errors_ftype.
+
+Mon Jan 18 08:47:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (catch_errors_ftype): Define.
+ (catch_errors): Replace char* arg with PTR arg.
+ * top.c (catch_errors): Update
+
+ * breakpoint.c (bpstat_stop_status, bpstat_stop_status,
+ delete_breakpoint, breakpoint_re_set): Delete all casts in call to
+ catch_errors.
+ (breakpoint_cond_eval, watchpoint_check,
+ cover_target_enable_exception_callback, breakpoint_re_set_one):
+ Arg is PTR not char*.
+
+ * breakpoint.c (cover_target_enable_exception_callback): Change
+ type to int. Check for cast values of 0 and -1. Return a result!
+ (insert_breakpoints): Move declaration of SAL and ARGS to where
+ they are used.
+
+1999-01-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote.c (remote_query): new function - creates proper interface
+ to the remote protocol "q" command.
+
+Fri Jan 15 17:11:48 EST 1999 Zdenek Radouch (radouch@cygnus.com)
+
+ * config/fr30/tm-fr30.h: Changed ABI to match GCC change
+ (always use pointer for structs passed by value).
+
+1999-01-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * target.h: added entry for target queries (to_query)
+ target.c: ditto.
+
+Thu Jan 14 18:29:17 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): fix stream arg in
+ fprintf_unfiltered calls.
+ * remote-mm.c (mm_wait): fix stream arg to gdb_flush.
+ * remote-udi.c (udi_wait): fix stream arg to fwrite.
+ * symmisc.c (maintenance_check_symtabs): fix stream argument to
+ print_address_numeric.
+
+Wed Jan 13 19:33:16 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * breakpoint.c (insert_breakpoints): insert cast to eliminate
+ warning.
+
+Wed Jan 13 14:59:02 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * infrun.c (set/show scheduler-locking) New command. Set a
+ mode bit that will control how GDB attempts to control thread
+ scheduling for step, continue, etc. (resume): make use of
+ the schedule-locking mode.
+ * target.h (struct target_ops): new field to_has_thread_control.
+ * sol-thread.c: initialize target_ops to_has_thread_control.
+ * procfs.c: ditto.
+ * target.c: ditto.
+ * m3-nat.c: ditto.
+ * remote.c: ditto.
+ * hpux-thread.c: ditto.
+ * thread.c: cull duplicate prototypes. Move prototypes to top.
+ * serial.c: indentation cleanup.
+ * breakpoint.c: add casts to eliminate compiler warnings.
+
+Tue Jan 12 17:00:00 1999 Edith Epstein <eepstein@sophia.cygnus.com>
+
+ * inftarg.c (child_create_inferior): fixed HPUXHPPA specific
+ call to fork_inferior. The shell param is now NULL.
+
+1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * monitor.c (init_base_monitor_ops): Whitespace cleanup.
+ (_initialize_remote_monitors): Same.
+
+1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * monitor.c (init_monitor_ops): Initialize the monitor_ops
+ structure if it hasn't already been done.
+
+Tue Jan 12 14:50:10 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * inftarg.c (child_ops): Don't initialize statically.
+ (init_child_ops): New function, fills in child_ops.
+ (_initialize_inftarg): Use it.
+ (child_post_attach): Declare extern.
+ (child_wait): Fix ambiguous parens.
+ (child_attach_to_process): Remove unused local wstatus.
+ (child_insert_fork_catchpoint, child_remove_fork_catchpoint,
+ child_insert_vfork_catchpoint, child_remove_vfork_catchpoint,
+ child_has_forked, child_insert_exec_catchpoint,
+ child_remove_exec_catchpoint): Return a value.
+
+Mon Jan 11 16:43:44 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (remote_wait): Add inferior_pid to thread list only
+ if it is not already there.
+
+1999-01-11 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * scm-tags.h: Update FSF's address on copyright notice.
+ * ser-e7kpc.c: Same.
+ * gnu-nat.h: Same.
+
+Mon Jan 11 13:45:57 1999 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * dwarf2read.c (dump_die): Change stderr to gdb_stderr.
+ * expprint.c (print_subexp): fprintf => fprintf_unfiltered.
+ * jv-typeprint.c (java_type_print_base): fputs => fputs_filtered.
+ * stack.c (struct function_bounds): Remove superfluous `typedef'.
+ * symfile.c (list_overlays_command): stdout => gdb_stdout.
+ * symmisc.c (maintenance_check_symtabs): stdout => gdb_stdout.
+ * utils.c (print_spaces): Make more efficient.
+
+Mon Jan 11 13:55:51 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * utils (print_spaces): fix arg to strcat; fix formatting.
+
+Fri Jan 8 11:57:24 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * exec.c (exec_ops): Don't initialize statically.
+ (init_exec_ops): New function, fills in exec_ops.
+ (_initialize_exec): Use it.
+
+Thu Jan 7 17:50:15 EST 1999 Zdenek Radouch (radouch@cygnus.com)
+
+ Beta FR30 port.
+ * fr30-tdep.c
+ * config/fr30/tm-fr30.h
+
+Wed Jan 6 12:28:35 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * configure.in: Add an --enable-tui argument. Construct
+ tui/Makefile from tui/Makefile.in. Use AM_PROG_CC_STDC. If we
+ have the GUI, then we need this to process libgui.h.
+ (ENABLE_CFLAGS): define and export BUILD_TUI.
+ (AC_CHECK_HEADERS): Add check for term.h.
+
+ * configure.host (hppa-*-hpux10.20, hppa-*-hpux11.0*): New configs.
+
+ * config.in, configure : regenerated.
+
+ * Makefile.in: Allow the TUI code to be conditionally enabled.
+ (TUI_LIBRARY): New variable, value are set by the configuration
+ script. Set to the empty string when the TUI isn't enabled.
+ (gdb$(GDBEXT)): Use those, instead of referring to all-tui and
+ tui/libtui.a directly.
+ (BUILD_TUI): build the tui -- only when configured with
+ --enable-tui.
+ (YLWRAP): use ylwrap to avoid problems on systems w/o bison.
+ (gdb$(EXEEXT)): make it dependent on BUILD_TUI.
+ (all-tui): remove dependency from phony target.
+ (c-exp.tab.c): use ylwrap instead of bison.
+ (jv-exp.tab.c): ditto.
+ (f-exp.tab.c): ditto.
+ (m2-exp.tab.c): ditto.
+ (ALLDEPFILES): add somread.c, hp-psymtab-read.c, hp-symtab-read.c.
+ (SFILES): remove the above files
+ (COMMON_OBS): remove somread.o
+ (SFILES): Add the tui files to this, so they get included in etags
+ tables.
+ (gdb$(EXEEXT)): Add all-tui to the list of dependencies, and add
+ tui/libtui.a to the link list.
+ (all-tui): New rule, which does a recursive make in the tui
+ subdir.
+ (tui/libtui.a): When recursing, pass down ${FLAGS_TO_PASS}. And
+ don't echo the make command. This is closer to what the other
+ recursions do.
+ (HFILES_NO_SRCDIR): add hpread.h
+ (COMMON_OBS): add hp-psymtab-read.o, hp-symtab-read.o
+ (SFILES): add hp-psymtab-read.c, hp-symtab-read.c add rules for
+ the new files. Remove hpread.c, hpread.o
+ (gdb$(EXEEXT)): Depend on the actual tui library, not on a
+ fictitious target. Since the fictitious target never existed,
+ make would always relink.
+ (tui/libtui.a): Always recurse to make sure the library is up to
+ date.
+
+Wed Jan 6 12:05:12 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote.c: Pacify --enable-build-warnings, reformat code
+ to conform to standards, fix spelling errors.
+ (ishex, stubhex, record_currthread, etc): Declare.
+ (ishex, stubhex): Declare char arg as int.
+ (pack_string): Comment out, never used but possibly useful.
+ (threadref_to_int, remote_get_threadinfo, etc): Make static.
+
+Wed Jan 6 11:43:32 1999 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by Elena Zannoni
+ <ezannoni@cygnus.com> and Edith Epstein <eepstein@cygnus.com> as
+ part of a project to merge in changes made by HP.
+
+ * c-exp.y: use external flag hp_som_som_object_present to decide
+ whether code was compiled by HP's compilers. Add two new C++
+ tokens for true and false.
+ (yylex): check for template name is done differently for the
+ HP/aCC compiler case. Change some of the template processing code
+ for handling HP aCC templates. Handle true and false tokens.
+
+Tue Jan 5 11:13:36 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * remote.c (record_curthread): Must not modify inferior_pid when
+ called from wait_for_inferior. Instead, if a new thread-id is
+ detected, call add_thread.
+ (MAGIC_NULL_PID): new macro, use instead of the magic number
+ "42000".
+ (remote_find_new_threads): if inferior_pid is unknown, get and use
+ the current thread id.
+ (remote_start_remote): on connecting, attempt to get the current
+ thread id for inferior_pid.
+ (remote_resume): If pid == -1, then resume any-thread (not the
+ current thread specifically). Also some cosmetic fixups.
+
+ * thread.c (info_threads_command): don't initialize current_pid
+ until after call to FIND_NEW_THREADS (which may change inferior_pid).
+ Also some cosmetic fixups.
+ * infrun.c: cosmetic fixups and casts to avoid warnings.
+ * infcmd.c: cosmetic fixups, mainly long lines.
+
+Tue Jan 5 11:55:57 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * target.c (noprocess): terminate sentence with a period.
+ * breakpoint.c (catch_command_1): ditto.
+
+ * c-valprint.c (c_value_print): remove hack^2 from HP; it causes
+ testsuite losses with no real gain.
+
+ * inferior.h (START_INFERIOR_TRAPS_EXPECTED): restore, but only
+ if tm-*.h hasn't overridden default value.
+
+1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Fix whitespace indentation for --help.
+ * configure: Regenerated.
+
+1999-01-04 Manuel Bouyer <bouyer@antioche.lip6.fr>
+
+ * main.c: Add --write command line option, document -w.
+ * gdb.1: Document --write.
+
+1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in: Require autoconf 2.12.1 or higher.
+ * doc/configure.in: Ditto.
+ * nlm/configure.in: Ditto.
+ * rdi-share/configure.in: Ditto.
+ * testsuite/configure.in: Ditto.
+ * doc/Makefile.in: Don't hardcode $(SHELL).
+ * nlm/Makefile.in: Ditto.
+ * rdi-share/Makefile.in: Ditto.
+ * testsuite/Makefile.in: Ditto.
+
+Mon Jan 4 12:53:03 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * remote-vx.c (init_vx_ops, init_vx_run_ops): Remove unneeded
+ inits of new fields, including ref to bogus field.
+ (vx_ops, vx_run_ops): Make static.
+
+Mon Jan 4 15:05:29 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * inferior.h (START_INFERIOR_TRAPS_EXPECTED): delete,
+ already defined in tm.h.
+
+ * inftarg.c: change <sys/unistd.h> to <unistd.h> and
+ conditionalize its inclusion.
+ * infttrace.c: ditto.
+
+For older changes see ChangeLog-1998
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-2000 b/contrib/gdb/gdb/ChangeLog-2000
new file mode 100644
index 0000000..25ced55
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-2000
@@ -0,0 +1,8204 @@
+2000-12-20 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * arch-utils.c (default_frame_address): New function. Default
+ implementation of frame_args_address and frame_locals_address.
+ * arch-utils.h (default_frame_address): Export.
+ * d10v-tdep.c (d10v_gdbarch_init): Use default_frame_address.
+ (d10v_frame_args_address, d10v_frame_locals_address): Delete.
+ * sh-tdep.c (sh_gdbarch_init): Use default_frame_address.
+ (sh_frame_args_address, sh_frame_locals_address): Delete.
+ * sparc-tdep.c (sparc_gdbarch_init): Use default_frame_address.
+ (sparc_frame_address): Delete.
+
+2000-12-27 Mark Kettenis <kettenis@gnu.org>
+
+ Fix debugging programs statically linked against the thread library.
+ * thread-db.c: Various comment fixes and additions.
+ Include "bfd.h", "symfile.h" and "objfiles.h".
+ (keep_thread_db): New variable.
+ (find_new_threads_callback): Remove prototype.
+ (thread_db_find_new_threads): New prototype.
+ (thread_db_push_target, thread_db_unpush_target): Remove
+ functions.
+ (deactivate_target): New function.
+ (thread_db_new_objfile): If OBJFILE == NULL, force deactivation of
+ target vector. Activate target vector directly instead of calling
+ thread_db_push_target. Set keep_thread_db if thread library is
+ detected in the main symbol file. Only enable thread event
+ reporting if there actually is a child process. Likewise for
+ detecting new threads, done by calling thread_db_find_new_threads
+ instead of iterating over the threads ourselves.
+ (thread_db_detach): Call deactivate_target instead of
+ thread_db_unpush_target.
+ (thread_db_wait): Bail out early if we're not debugging the
+ multi-threaded child process yet.
+ (thread_db_post_startup_inferior): New function.
+ (thread_db_mourn_inferior): Call deactivate_target instead of
+ thread_db_unpush_target.
+ (init_thread_db_ops): Add thread_db_post_startup_inferior to
+ thread_db_ops.
+
+2000-12-22 Mark Kettenis <kettenis@gnu.org>
+
+ * solib.c (solib_open): If path is relative, look for it
+ literally. This matches the behaviour of the GNU dynamic linker
+ more closely.
+
+2000-12-22 Fernando Nasser <fnasser@redhat.com>
+
+ * README: Suggest building in an empty directory.
+
+2000-12-21 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c: Add missing ')' in comment.
+ (i386_extract_return_value): Return directly after issuing the
+ warning and filling *VALBUF with zeroes if we cannot get at the
+ floating-point registers.
+ (i386_store_return_value): New function.
+ * config/i386/tm-i386.h (STORE_RETURN_VALUE): Simply call
+ i386_store_return_value.
+ Add prototype for i386_store_return_value.
+
+ * i386-linux-nat.c (store_fpxregs): Add code to detect support for
+ the PTRACE_GETFPXREGS request, and return zero if it's not.
+
+2000-12-21 Fernando Nasser <fnasser@redhat.com>
+
+ * TODO: Add pre-uiout code removal to 5.2 cleanups.
+
+2000-12-20 Fernando Nasser <fnasser@redhat.com>
+
+ * configure.in: Rename CONFIG_LOBS to CONFIG_LIB_OBS.
+ * Makefile.in: Ditto.
+ * configure: Regenerate.
+
+2000-12-20 Fernando Nasser <fnasser@redhat.com>
+
+ * command.h: Register date when it was deprecated.
+ * call-cmds.h: Ditto.
+
+2000-12-20 Fernando Nasser <fnasser@redhat.com>
+
+ * Makefile.in (UIOUT_CFLAGS): New macro. CFLAGS needed for uiout code
+ to be compiled. Defines UI_OUT.
+ (SUBDIR_MI_CFLAGS): Defines MI_OUT, not UI_OUT.
+ (INTERNAL_WARN_CFLAGS): Also include UIOUT_CFLAGS.
+ * configure.in (UIOUT_CFLAGS): New configuration variable.
+ (--with-uiout): New configuration option. Causes uiout code to
+ be compiled, instead of the old *printf one.
+ * configure: Regenerate.
+ * top.c (print_gdb_version): Test for and print MI_OUT, not UI_OUT.
+
+2000-12-20 Fernando Nasser <fnasser@redhat.com>
+
+ * complaints.c (complain): Call warning_hook if defined, instead of
+ writting to gdb_stderr.
+ (clear_complaints): Do not write anything to gdb_stderr if warning_hook
+ is defined.
+
+2000-12-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_print_register): Don't leave regnum 0 out of the
+ non-pseudo-regs group.
+
+2000-12-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_gdbarch_init): Move setting of breakpoint_from_pc
+ to before switch statement.
+
+2000-12-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_gdbarch_init): Initialize do_registers_info.
+
+ * config/sh/tm-sh.h: Don't remove SR_REGNUM from enum.
+ (DO_REGISTERS_INFO): Remove macro. Use multiarch version instead.
+
+Fri Dec 15 23:12:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * i386gnu-nat.c: Include "gdb_assert.h" instead of <assert.h>.
+ (gnu_store_registers): Replace assert with gdb_assert.
+
+2000-12-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
+ sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): SR_REGNUM is
+ now part of gdbarch_tdep structure.
+ (sh_gdbarch_init): Initialize SR_REGNUM.
+
+ * config/sh/tm-sh.h (struct gdbarch_tdep): Add field SR_REGNUM.
+
+ * sh-tdep.c (sh_do_pseudo_register): Indent properly. Call
+ do_dr_register_info() only for DR registers.
+ (sh_sh4_register_name): Add comments with numbers.
+ (_initialize_sh_tdep): Move assignment to disassemble printing
+ function from here...
+ (sh_gdbarch_init):...to here. Move some more general settings to
+ before the architecture is recognized.
+
+Fri Dec 15 23:27:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_fetch_registers): Replace #ifdef
+ REGISTER_BYTES_OK with REGISTER_BYTES_OK_P.
+
+ * gdbarch.sh (REGISTER_BYTES_OK): Multi-arch.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+Fri Dec 15 22:58:59 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * serial.c (serial_printf): Call xvasprintf instead of vasprintf.
+
+2000-12-14 Matthew Green <mrg@eterna.com.au>
+
+ * solib-svr4.c (solib_break_names): Add NetBSD's `_rtld_debug_state'.
+
+2000-12-14 Kevin Buettner <kevinb@redhat.com>
+
+ * defs.h, utils.c (xfree): New function.
+ * alpha-tdep.c, altos-xdep.c, arch-utils.c, arm-xdep.c,
+ ax-general.c, bcache.c, blockframe.c, breakpoint.c,
+ buildsym.c, c-typeprint.c, coffread.c, completer.c,
+ convex-tdep.c, convex-xdep.c, corefile.c, corelow.c,
+ cp-valprint.c, cxux-nat.c, d10v-tdep.c, d30v-tdep.c,
+ dbxread.c, dcache.c, defs.h, demangle.c, dstread.c,
+ dve3900-rom.c, dwarf2read.c, dwarfread.c, elfread.c,
+ environ.c, event-loop.c, event-top.c, exec.c, f-lang.c,
+ gdb-events.c, gdbarch.c, gdbtypes.c, gnu-nat.c, h8500-tdep.c,
+ hp-psymtab-read.c, hppah-nat.c, infcmd.c, inflow.c, infrun.c,
+ infttrace.c, irix5-nat.c, jv-typeprint.c, kod-cisco.c, kod.c,
+ language.c, lin-lwp.c, lin-thread.c, linespec.c,
+ linux-thread.c, main.c, maint.c, mdebugread.c, minsyms.c,
+ mips-tdep.c, monitor.c, nlmread.c, objfiles.c, osfsolib.c,
+ p-valprint.c, pa64solib.c, parse.c, printcmd.c,
+ proc-service.c, procfs.c, pyr-xdep.c, remote-adapt.c,
+ remote-bug.c, remote-eb.c, remote-es.c, remote-mips.c,
+ remote-mm.c, remote-nindy.c, remote-rdi.c, remote-rdp.c,
+ remote-udi.c, remote-vx.c, remote.c, rs6000-nat.c, ser-pipe.c,
+ serial.c, solib-svr4.c, solib.c, somread.c, somsolib.c,
+ source.c, sparcl-tdep.c, stabsread.c, stack.c, sun386-nat.c,
+ symfile.c, symmisc.c, symtab.c, target.c, thread-db.c,
+ thread.c, top.c, tracepoint.c, ui-file.c, ui-out.c,
+ umax-xdep.c, utils.c, valops.c, valprint.c, values.c,
+ varobj.c, win32-nat.c, wince.c, xcoffread.c, cli/cli-cmds.c,
+ cli/cli-decode.c, cli/cli-script.c, cli/cli-setshow.c:
+ Replace occurrences of free() with xfree().
+
+2000-12-14 J.T. Conklin <jtc@redback.com>
+
+ * configure.tgt (hppa*-*-bsd*, hppa*-*-osf*, m68*-*-sunos4*,
+ rs6000-*-lynxos*, sparc-*-sunos4*): Add gdbserver to configdirs.
+
+2000-12-13 Michael Chastain <chastain@redhat.com>
+
+ * MAINTAINERS: Add Michael Chastain to Write After Approval list.
+
+2000-12-11 Fernando Nasser <fnasser@redhat.com>
+
+ * Makefile.in (CONFIG_LOBS): New macro. Configured to the files
+ that must be added to the gdblib itself.
+ (DEPFILES): Use CONFIG_LOBS, not CONFIG_OBS.
+ (INIT_FILES): Include CONFIG_OBS.
+ (gdb$(EXEEXT)): Depend on CONFIG_OBS and link with it.
+ (kdb): Ditto.
+ * configure.in (CONFIG_LOBS): New variable. Object files that must
+ be added to gdblib for the specific configuration.
+ * configure: Regenerate.
+
+2000-12-11 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sh-tdep.c (sh_extract_struct_value_address): Protoize.
+
+2000-12-11 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * blockframe.c (get_prev_frame): Add missing paren omitted in
+ last check-in.
+
+2000-12-11 Fernando Nasser <fnasser@redhat.com>
+
+ * Makefile.in (SUBDIR_GDBTK_OBS, SUBDIR_GDBTK_SRCS,
+ SUBDIR_GDBTK_DEPS, SUBDIR_GDBTK_INITS, SUBDIR_GDBTK_LDFLAGS,
+ SUBDIR_GDBTK_CFLAGS): New macros. For gdbtk subdir.
+ * configure.in: Fix typo. It is CONFIG_OBS not CONFIG_OJS.
+ Use the SUBDIR_GDBTK_* macros instead of hard coded file names.
+ * configure: Regenerate.
+
+2000-12-11 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * blockframe.c (get_prev_frame): Zero all fields of prev by
+ default using memset (instead of one at a time).
+
+2000-12-11 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sh-tdep.c (sh_extract_struct_value_address): For consistancy,
+ change decl from "CORE_ADDR static" to "static CORE_ADDR".
+
+2000-12-11 Fernando Nasser <fnasser@redhat.com>
+
+ * configure.in: Fix typos. It is CONFIG_SRCS not CONFIG_SRS.
+ * configure: Regenerate.
+
+2000-12-11 Fernando Nasser <fnasser@redhat.com>
+
+ * configure.in: Fix a couple of typos in the handling of the
+ enable_gdbcli option. Make it check enableval for the result
+ of AC_ARG_ENABLE.
+ * configure: Regenerate.
+
+2000-12-08 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * dwarf2read.c (DWARF2_REG_TO_REGNUM): New macro. Provide default
+ definition. Will be used to translate between the compiler's
+ register numbering and GDB's (for register variables etc).
+ (new_symbol): Use DWARF2_REG_TO_REGNUM to translate register ids.
+ * alpha-tdep.c: Fix typo in comment.
+ * dbxread.c: Fix typo in comment.
+ * fr30-tdep.c: Fix typo: newline missing after comment.
+ * mcore-tdep.c: Fix typo in comment.
+
+2000-12-07 J.T. Conklin <jtc@redback.com>
+
+ * gdbserver/low-hppabsd.c (buf2, environ, quit, quit_flag):
+ Removed unused variables and declarations.
+ * gdbserver/low-linux.c (buf2, environ, query, quit, quit_flag):
+ Likewise.
+ * gdbserver/low-nbsd.c (buf2, environ, quit, quit_flag):
+ Likewise.
+ * gdbserver/low-sparc.c (buf2, environ, query, quit, quit_flag):
+ Likewise.
+ * gdbserver/low-sun.c (buf2, environ, query, quit, quit_flag):
+ Likewise.
+
+ * gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
+ gdbserver/low-nbsd.c, gdbserver/low-sparc.c, gdbserver/low-sun3.c
+ (create_inferior): Update comment.
+
+ * gdbserver/low-nbsd.c (initialize_arch, fetch_inferior_registers,
+ store_inferior_registers): Provide implementations for the m68k
+ and ns32k.
+ * config/m68k/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o
+ * config/ns32k/nbsd.mt (GDBSERVER_DEPFILES): Likewise.
+ * configure.tgt (m68*-*-netbsd*, ns32k-*-netbsd*): Add gdbserver
+ to configdirs.
+
+2000-12-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/sh/tm-sh.h (struct gdbarch_tdep): Rename fields
+ {FP15,DR14,FV12}_REGNUM to {FP,DR,FV}_LAST_REGNUM.
+ * sh-tdep.c (sh_sh3e_register_virtual_type,
+ sh_sh4_register_virtual_type, sh_do_registers_info,
+ sh_gdbarch_init, sh_sh4_register_byte, sh_sh4_register_raw_size,
+ sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual,
+ sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register,
+ sh_store_pseudo_register, sh_do_pseudo_register): Ditto.
+
+ * sh-tdep.c (sh_gdbarch_init): Use a function pointer to set the
+ disassembly print function.
+ (_initialize_sh_tdep): Initialize tm_print_insn using the function
+ pointer.
+
+2000-12-07 Mark Kettenis <kettenis@gnu.org>
+
+ From Richard Henderson <rth@twiddle.net>:
+ * alpha-nat.c (supply_gregset, fill_gregset): Use gdb_gregset_t.
+ (supply_fpregset, fill_fpregset): Use gdb_fpregset_t.
+
+2000-12-06 Fernando Nasser <fnasser@redhat.com>
+
+ * cli/cli-decode.c (add_abbrev_cmd): Reinstate. Add comment saying
+ that is not currently used.
+
+2000-12-06 Fernando Nasser <fnasser@redhat.com>
+
+ * cli/cli-decode.c (lookup_cmd): Change disabled code into comment.
+
+2000-12-06 Fernando Nasser <fnasser@redhat.com>
+
+ * cli/cli-decode.c (lookup_cmd): Remove old stale copy of this routine
+ which was not being used for quite some time.
+
+2000-12-05 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb-stabs.h (SECT_OFF_MAX): Increase to 64.
+ * symfile.h (MAX_SECTIONS): Increase to 64.
+
+2000-12-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/sh/tm-sh.h (struct gdbarch_tdep): Get rid of
+ DR{2,4,6,8,10,12}_REGNUM, FV{4,8}_REGNUM, they are not used
+ anywhere.
+ * sh-tdep.c (sh_gdbarch_init): Don't initialize
+ DR{2,4,6,8,10,12}_REGNUM, FV{4,8}_REGNUM.
+
+2000-12-04 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * utils.c (internal_verror): Fix typo in error msg.
+
+2000-12-03 Mark Kettenis <kettenis@gnu.org>
+
+ * Makefile.in (symfile.o): Add gdb-stabs.h to dependencies list.
+
+2000-12-04 Kevin Buettner <kevinb@redhat.com>
+
+ * elfread.c (record_minimal_symbol_and_info): Don't guess
+ at the section index; instead just always use the bfd index.
+ (elf_symtab_read): Handle weak symbols appearing in data
+ sections.
+
+Mon Dec 4 14:36:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (STAB_REG_TO_REGNUM, ECOFF_REG_TO_REGNUM,
+ DWARF_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM):
+ Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * arch-utils.c (no_op_reg_to_regnum): New function.
+ * arch-utils.h (no_op_reg_to_regnum): Declare.
+
+ * dwarfread.c (DWARF_REG_TO_REGNUM), coffread.c
+ (SDB_REG_TO_REGNUM), stabsread.h (STAB_REG_TO_REGNUM),
+ mdebugread.c (ECOFF_REG_TO_REGNUM): Delete macro.
+
+ * config/mips/tm-mips.h (ECOFF_REG_TO_REGNUM, STAB_REG_TO_REGNUM):
+ Delete. Moved to mips-tdep.c.
+ * mips-tdep.c (mips_ecoff_reg_to_regnum, mips_stab_reg_to_regnum):
+ New functions.
+ (mips_gdbarch_init): Add ``mips_ecoff_reg_to_regnum'' and
+ ``mips_stab_reg_to_regnum'' to multi-arch vector.
+
+2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Remove elf_flags, cleanup.
+ (gdbarch_tdep): Likewise.
+
+2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (SOFT_D1_REGNUM): Soft registers start at 14.
+ (m68hc11_register_names): Add null for register 13.
+
+2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_frame_args_address): Fix args address
+ computation.
+ (m68hc11_frame_init_saved_regs): Frame pointer is saved only if
+ the symbol exist.
+ (m68hc11_analyze_instruction): New function.
+ (m6811_prologue, m6812_prologue): New prologue description tables.
+ (m68hc11_guess_from_prologue): Use the above.
+ (m68hc11_gdbarch_init): Setup gdbarch_tdep for the prologue
+ descriptions.
+
+Sun Dec 3 02:28:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-pipe.c (pipe_open): Only use vfork when available.
+ * fork-child.c (fork_inferior): Fix #ifdef HAVE_VFORK test.
+ (clone_and_follow_inferior): Ditto.
+
+ * configure.in (AC_CHECK_FUNCS): Check for vfork.
+ * configure, config.in: Regenerate.
+
+Sun Dec 3 01:54:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-unix.c (wait_for): Initialize the FD_SET before every select
+ call.
+ (ser_unix_wait_for): Ditto.
+
+Sun Dec 3 01:01:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (varobj.o): Delete special .c.o rule supressing
+ -Werror flag.
+
+Sun Dec 3 00:29:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * m32r-rom.c (m32r_load_section): Update to match
+ bfd_map_over_sections's ``func'' arg.
+
+Thu Nov 30 01:24:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (struct upk_mips16): Delete fields ``inst'' and
+ ``fmt''. Make ``offset'' a CORE_ADDR.
+ (print_unpack): Delete.
+ (extended_offset): Construct and return a CORE_ADDR.
+ (fetch_mips_16): Return an int. Don't assume short is 16 bits.
+ (unpack_mips16): Rewrite. Add ``extension'' parameter instead of
+ incorrectly guessing if the instruction had an extension.
+ (map16): Delete array.
+ (mips16_op): Delete macro.
+ (extended_mips16_next_pc): Rewrite of old mips16_next_pc function.
+ When an extended instruction do a recursive call.
+ (mips16_next_pc): Call extended_mips16_next_pc.
+ (mips_next_pc): Cleanup.
+
+Sat Dec 2 10:40:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-e7kpc.c (e7000pc_setstopbits): New function.
+ (e7000pc_ops): Add e7000pc_setstopbits.
+
+ * remote-e7000.c (e7000_detach, e7000_resume,
+ e7000_xfer_inferior_memory, e7000_files_info, e7000_files_info,
+ e7000_insert_breakpoint, e7000_remove_breakpoint, e7000_kill):
+ Update function signature to match target vector.
+
+ * h8300-tdep.c (h8300_command, h8300h_command, h8300s_command):
+ h8500-tdep.c (small_command, big_command, medium_command,
+ compact_command): Update function signature to match add_cmd.
+
+2000-12-01 Fernando Nasser <fnasser@redhat.com>
+
+ * p-exp.y: Define strncasecmp as strnicmp for MSVC.
+ (yylex): Use strncasecmp, not strnicmp.
+
+2000-12-01 Fernando Nasser <fnasser@redhat.com>
+
+ * cli/cli-decode.c: New file. Handle lists of commands, their decoding
+ and documentation.
+ (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd,
+ add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc,
+ add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd,
+ add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list,
+ help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1,
+ undef_cmd_error, lookup_cmd, deprecated_cmd_warning,
+ lookup_cmd_composition, complete_on_cmdlist, complete_on_enum):
+ Moved here from command.c.
+ (add_info, add_info_alias, add_com, add_com_alias): Moved here from
+ top.c.
+ * cli/cli-decode.h: Definitions/declarations for the above.
+ * cli/cli-cmds.c: New file. GDB CLI commands.
+ (error_no_arg, info_command, show_command, help_command, show_version,
+ quit_command, pwd_command, cd_command, echo_command, shell_escape,
+ make_command, show_user, set_debug, show_debug, init_cmd_lists):
+ Moved here from top.c.
+ (apropos_command): Moved here from command.c.
+ (complete_command, source_command): Moved here (part) from top.c.
+ (is_complete_command): New function. Checks if a command is the
+ "complete" command.
+ (init_cli_cmds): New function. Add commands to the CLI (from code
+ previously in top.c.
+ * cli/cli-cmds.h: Definitions/declarations for the above.
+ * cli/cli-script.c: New file. GDB CLI command scripting.
+ (build_command_line, get_command_line, print_command_lines,
+ print_command_line, execute_user_command, execute_control_command,
+ while_command, if_command, arg_cleanup, setup_user_args, locate_arg,
+ insert_args, realloc_body_list, read_next_line,
+ recurse_read_control_structure, read_command_lines, free_command_lines,
+ do_free_command_lines_cleanup, make_cleanup_free_command_lines,
+ validate_comname, user_defined_command, define_command,
+ document_command, source_cleanup_lines, do_fclose_cleanup,
+ show_user_1): Moved here from top.c.
+ (script_from_file): New function. Implements execution of a script
+ contained in a file (part of code for the source_command() that used
+ to exist in top.c).
+ * cli/cli-script.h: Definitions/declarations for the above.
+ * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands.
+ (parse_auto_binary_operation, parse_binary_operation,
+ do_setshow_command, cmd_show_list): Moved here from command.c.
+ * cli/cli-setshow.h: Definitions/declarations for the above.
+ * top.c: Remove all CLI code, except the command loop.
+ (gdb_init): Call init_cli_cmds().
+ * command.c: Remove obsolete file.
+ * command.h: Mark as DEPRECATED.
+ * gdbcmd.h: Ditto.
+ * call-cmds.h: Ditto.
+ * Makefile.in (SFILES): Remove command.c.
+ (COMMON_OBS): Remove command.o.
+ (command.o): Remove obsolete target.
+ (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros.
+ Refer to CLI header files.
+ (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets.
+ (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS,
+ SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN,
+ SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli
+ subdirectory.
+ * configure.in (enable_gdbcli): New option. Include the CLI in the
+ executable (cannot be disabled yet).
+ (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS,
+ CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add
+ the corresponding SUBDIR_CLI_* macros if CLI requested.
+ * configure: Regenerate.
+
+2000-10-27 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y (yylex): avoid problem with symbol name
+ starting as a operator name.
+
+2000-11-30 Fernando Nasser <fnasser@redhat.com>
+
+ * linespec.h: New file. Declarations for linespec.c.
+ * linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c,
+ symtab.c, tracepoint.c: Include the above.
+ * completer.c: New file. Line completion stuff for GDB.
+ (get_gdb_completer_word_break_characters,
+ get_gdb_completer_quote_characters): New functions. Accessors for
+ useful completer internal data.
+ (filename_completer, line_completion_function, skip_quoted): Moved
+ here from top.c.
+ * completer.h: New file. Declarations for the above.
+ * linespec.c (decode_line_1): Use
+ get_gdb_completer_word_break_characters and
+ get_gdb_completer_quote_characters.
+ * top.c: Include completer.h.
+ (filename_completer, line_completion_function, skip_quoted):
+ Moved to completer.c.
+ * corefile.c, exec.c, source.c, symfile.c, linespec.c: Include
+ completer.h.
+ * Makefile.in (SFILES): Add completer.c.
+ (COMMON_OBS): Add completer.o.
+ (completer.o): New target.
+ (linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o,
+ symtab.o, tracepoint.o): Add linespec.h to dependencies list.
+ (corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h
+ to dependencies list.
+
+Thu Nov 30 13:19:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.c: Regenerate.
+
+Thu Nov 30 01:14:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * varobj.c (varobj_create): Initialize ``old_fi''.
+ (varobj_update): Initialize ``templist''.
+
+ * kod-cisco.c (cisco_kod_request): Simplify allocation of
+ ``sync_ids'' eliminating uninitialized variable.
+
+2000-11-28 Mark Salter <msalter@redhat.com>
+
+ * MAINTAINERS: Add Mark Salter to Write After Approval list.
+
+Tue Nov 28 12:24:43 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (dll_code_sections_add): strdup -> xstrdup.
+
+Mon Nov 27 11:45:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_write_bytes): Add default case to switch
+ initializing ``todo''. Ditto for ``nr_bytes''.
+ * top.c (catch_errors): Always initialize ``val''.
+ * solib.c (info_sharedlibrary_command): Handle bfd_get_arch_size
+ returning an unknown size.
+ * gdbtypes.c (count_virtual_fns): Always initialize ``vfuncs''.
+ * breakpoint.c (break_at_finish_at_depth_command_1): Initialise
+ extra_args to NULL.
+ (break_at_finish_command_1): Ditto.
+
+Mon Nov 27 11:27:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Add GFDL updates to 5.1 release criteria.
+
+2000-11-26 Nick Clifton <nickc@redhat.com>
+
+ * configure.tgt (xscale-*): Add.
+ * configure.host (xscale-*): Add.
+
+2000-11-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (gdb_print_insn_m68hc11): New function.
+ (_initialize_m68hc11_tdep): Install it. Register bfd_arch_m68hc12.
+
+2000-11-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (gdbarch_tdep): Move stack_correction global to here.
+ (STACK_CORRECTION): Get stack correction using gdbarch_tdep.
+ (m68hc11_saved_pc_after_call): Use STACK_CORRECTION.
+ (m68hc11_frame_chain): Likewise.
+ (m68hc11_frame_init_saved_regs): Likewise.
+ (m68hc11_init_extra_frame_info): Likewise.
+ (m68hc11_push_arguments): Likewise.
+ (m68hc11_push_arguments): Likewise.
+ (m68hc11_store_struct_return): Likewise.
+ (m68hc11_push_return_address): Likewise.
+ (m68hc11_gdbarch_init): Setup stack_correction according to arch.
+
+Mon Nov 20 13:59:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in: Add support for configure option
+ --enable-gdb-build-warnings. Mention need to update doco.
+ * configure: Regenerate.
+
+2000-11-21 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * target.h (TARGET_SIGNAL_REALTIME_64): Added for IRIX 6.
+ * target.c (target_signal_from_host, do_target_signal_to_host):
+ Handle TARGET_SIGNAL_REALTIME_64.
+
+2000-11-21 Kevin Buettner <kevinb@redhat.com>
+
+ * solib.c (solib_open): Handle the case where
+ solib_absolute_prefix is NULL.
+
+2000-11-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * solist.h: Declare new function solib_open.
+ * solib.c (solib_open): New function. Abstracts some of the
+ code from solib_map_sections, for finding the binary solib file.
+ (solib_map_sections): Call solib_open.
+ * solib-svr4.c (enable_break): Call solib_open.
+
+2000-11-20 J.T. Conklin <jtc@redback.com>
+
+ * gdbserver/low-nbsd.c (fetch_inferior_registers,
+ store_inferior_registers): Support older NetBSD/powerpc systems
+ from before fp reg support was added. Adapt to register number
+ changes caused when powerpc target was multi-arched.
+
+2000-11-20 H.J. Lu <hjl@gnu.org>
+
+ * ia64-tdep.c (gdbarch_tdep): Change reference from
+ ELFOSABI_MONTEREY to ELFOSABI_AIX.
+
+2000-11-20 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * c-valprint.c (print_function_pointer_address): New function
+ to automatically dereference a function pointer for printing
+ if necessary.
+ (c_val_print): Use print_function_pointer_address when printing
+ function pointer addresses.
+
+2000-11-20 J.T. Conklin <jtc@redback.com>
+
+ * gdbserver/low-nbsd.c: Fix typos.
+
+2000-11-20 Jeffrey A Law (law@cygnus.com)
+
+ * pa64solib.c (add_to_solib): Pass TARGET to pa64_solib_load_symbols.
+
+Mon Nov 20 23:21:53 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Peter Schauer and Kevin Buettner maintain AIX. Jim
+ Blandy, Kevin Buettner and Peter Schauer share shared libs.
+
+ From Nick Duffek:
+ * MAINTAINERS: Share responsibility for
+ Solaris/x86 between co-maintainers.
+
+ * MAINTAINERS: Add linespec as a separate component.
+
+Mon Nov 20 14:29:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.h (error_no_arg): Add noreturn attribute to declaration.
+
+Fri Nov 17 16:07:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (xvasprintf, xasprintf): New functions.
+ * defs.h (xvasprintf, xasprintf): Add declarations.
+
+ * remote.c (add_packet_config_cmd): Use function xasprintf instead
+ of asprintf.
+ * utils.c (vfprintf_maybe_filtered, vfprintf_unfiltered): Use
+ function xvasprintf instead of vasprintf.
+
+ * TODO (xasprintf): Update.
+
+Mon Nov 20 12:22:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Mention ``extern'' and ``STREQ'' cleanups.
+
+2000-11-19 Jim Blandy <jimb@redhat.com>
+
+ * symtab.c (no_symtab_msg): Remove definition.
+ (sources_info): Replace use of no_symtab_msg with the string
+ itself.
+ * linespec.c (no_symtab_msg): Remove declaration.
+ (decode_line_1): Replace uses of no_symtab_msg with the string
+ itself.
+
+2000-11-17 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (refine_prologue_limit): New function.
+ (skip_prologue): When zero, attempt to obtain value for
+ lim_pc by calling refine_prologue_limit(). Also, fix
+ fencepost error regarding the limit in the loop.
+
+ From Peter Schauer:
+ * rs6000-tdep.c (skip_prologue): Handle optimizer code motions into
+ the prologue by continuing the prologue search, if we have no valid
+ frame yet or if the return address is not yet saved in the frame.
+
+2000-11-17 Kevin Buettner <kevinb@redhat.com>
+
+ * wrapper.c (gdb_value_assign, wrap_value_assign): Protoize.
+
+2000-11-16 Christopher Faylor <cgf@redhat.com>
+
+ * thread.c (thread_apply_all_command): Save the command before
+ executing it because it may be modified. Restore the saved command so
+ that the same command is executed on next thread.
+ (thread_apply_command): Same correction.
+
+2000-11-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * regcache.c (read_register_bytes): Failing to set register_valid
+ is not necessarily an error, if the register is a pseudo-register.
+ Some pseudo-registers are never marked as valid, so that they will
+ be read anew every time. Determining if a pseudo-register is valid
+ (or should be marked invalid) may be difficult, whereas just
+ recomputing it may be cheap.
+
+Thu Nov 16 09:47:57 2000 David Taylor <taylor@redhat.com>
+
+ * tracepoint.c (trace_find_tracepoint_command): Replace call to
+ parse_and_eval_address with a call to parse_and_eval_long as
+ we are evaluating an integer, not an address.
+ * top.c (show_commands): Ditto.
+
+2000-11-15 Kevin Buettner <kevinb@redhat.com>
+
+ * xcoffread.c (arrange_linetable, xcoff_initial_scan): Protoize.
+
+Wed Nov 15 09:31:39 2000 David Taylor <taylor@redhat.com>
+
+ * utils.c (strlen_paddr, paddr, paddr_nz): Use TARGET_ADDR_BIT,
+ not TARGET_PTR_BIT, since we are dealing with addresses, not
+ pointers.
+
+2000-11-14 Daniel Berlin <dberlin@redhat.com>
+
+ From Kenneth Block <kenneth.block@compaq.com>
+
+ * demangle.c : Use libibery list of demanglers instead of out of
+ date local copy.
+
+Wed Nov 15 00:29:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Klaus Espenlaub <espenlaub@informatik.uni-ulm.de>
+ * remote.c (_initialize_remote): Call
+ show_memory_write_packet_size when ``show remotewritesize''
+ command.
+
+2000-11-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/config.sed: Fix tweaking "VPATH=.:foo", and handle
+ the gettext's posrcprefix correctly with drive letters.
+
+2000-11-10 Jim Blandy <jimb@redhat.com>
+
+ * stabsread.c (read_range_type): Properly construct complex
+ type nodes.
+
+2000-11-10 Fernando Nasser <fnasser@totem.toronto.redhat.com>
+
+ * symtab.c (decode_line_1, total_number_of_methods, find_methods,
+ build_command_line_spec, find_toplevel_char, decode_line_2):
+ Move to linespec.c.
+ * linespec.c: New file. Routines that handle linespecs, formerly
+ in symtab.c.
+ * symtab.h: Export find_line_symtab and find_function_start_sal.
+ * Makefile.in (SFILES): Add linespec.c.
+ (COMMON_OBS): Add linespec.o.
+ (linespec.o): New target.
+
+2000-11-10 Christopher Faylor <cgf@cygnus.com>
+
+ * inferior.h (step_over_calls_kind): New enum to clarify values in
+ step_over_calls.
+ * infcmd.c (step_over_calls): Change definition.
+ (step_1): Use new enum values in relation to step_over_calls.
+ (step_once): Ditto.
+ (until_next_command): Ditto.
+ * infrun.c (clear_proceed_status): Ditto.
+ (handle_inferior_event): Ditto.
+
+2000-11-10 Stephane Carrez <Stephane.Carrez@sun.com>
+
+ * inferior.h (step_stop_if_no_debug): New variable.
+ * infrun.c (step_stop_if_no_debug): Declare.
+ (handle_inferior_event): Stop the step command if we entered a function
+ without line info.
+ (_initialize_infrun): New command 'set step-mode' to control the step
+ command.
+ * infcmd.c (step_once): Switch to stepi mode if there is no line info
+ (and switching is enabled).
+
+2000-11-10 J.T. Conklin <jtc@redback.com>
+
+ * target.c (do_xfer_memory): Only perform a single memory transfer
+ instead of iterating to tranfer the entire region. Higher layers
+ are expected to call this function multiple times for partial
+ transfers.
+ (target_xfer_memory_partial): Remove unused local variables.
+
+2000-11-10 Nick Duffek <nsd@redhat.com>
+
+ * target.c (target_xfer_memory_partial): Return bytes transferred
+ instead of 0.
+
+2000-11-09 Kevin Buettner <kevinb@redhat.com>
+
+ * values.c (value_being_returned, using_struct_return): Protoize.
+ * varobj.c (child_exists, cplus_class_num_children): Protoize.
+
+2000-11-09 Kevin Buettner <kevinb@redhat.com>
+
+ Changes based on a patch from Ulrich Drepper:
+ * solib-svr4.c (svr4_relocate_main_executable): New function.
+ (svr4_solib_create_inferior_hook): Call
+ svr4_relocate_main_executable.
+
+2000-11-09 J.T. Conklin <jtc@redback.com>
+
+ * config/i386/nbsd.mh: Remove solib.o, solib-svr4.o from NATDEPFILES.
+ * config/i386/nbsdelf.mh: Likewise.
+ * config/m68k/nbsd.mh: Likewise.
+ * config/ns32k/nbsd.mh: Likewise.
+ * config/powerpc/nbsd.mh: Likewise.
+ * config/sparc/nbsd.mh: Likewise.
+ * config/sparc/nbsdelf.mh: Likewise.
+ * config/i386/nbsd.mt: Add solib.o, solib-svr4.o to TDEPFILES.
+ * config/i386/nbsdelf.mt: Likewise.
+ * config/m68k/nbsd.mt: Likewise.
+ * config/ns32k/nbsd.mt: Likewise.
+ * config/powerpc/nbsd.mt: Likewise.
+ * config/sparc/nbsd.mt: Likewise.
+
+2000-11-09 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ Add auto-solib-add support for AIX, remove obsolete and unused
+ SOLIB_SYMBOLS_MANUAL code, cleanup of AIX shared library handling code.
+ * rs6000-nat.c (vmap_symtab): Do not try to modify offsets
+ if symbols are not yet loaded.
+ (vmap_add_symbols): New function to add symbols for a vmap entry.
+ (add_vmap): Turn errors into warnings, return NULL vmap upon
+ failure. Add symbols via vmap_add_symbols only if requested.
+ (xcoff_relocate_core): Allow debugging of core files without an
+ executable file. Handle NULL returns from add_vmap gracefully.
+ * xcoffsolib.c (solib_add): Remove, no longer needed.
+ (solib_info): Do not check for new shared libraries if there is no
+ inferior process.
+ (sharedlibrary_command): Made static.
+ Do not check for new shared libraries if there is no inferior process.
+ Add symbols for requested shared libraries via vmap_add_symbols.
+ (_initialize_solib): Add `set auto-solib-add' command.
+ * xcoffsolib.h (vmap_add_symbols): Add prototype declaration.
+
+ * config/rs6000/tm-rs6000.h (PC_LOAD_SEGMENT): Move from here ...
+ * config/rs6000/nm-rs6000.h: ... to here, this is an AIX native
+ feature.
+ * config/powerpc/tm-macos.h, config/powerpc/tm-ppc-eabi.h,
+ config/powerpc/tm-ppc-nw.h, config/rs6000/tm-rs6000ly.h:
+ Remove #undef PC_LOAD_SEGMENT.
+ * config/powerpc/aix.mt, config/rs6000/aix4.mt, config/rs6000/rs6000.mt
+ (TDEPFILES): Move xcoffsolib.o from here ...
+ * config/powerpc/aix.mh, config/rs6000/aix4.mh, config/rs6000/rs6000.mh
+ (NATDEPFILES): ... to here, xcoffsolib.o contains AIX native code
+ only.
+ * rs6000-tdep.c: Remove #include xcoffsolib.h, no longer needed.
+ * xcoffsolib.h (xcoff_relocate_symtab_hook): Remove declaration.
+ * rs6000-nat.c (_initialize_core_rs6000): Remove setting of
+ xcoff_relocate_symtab_hook, no longer needed.
+ * xcoffsolib.c (solib_info, sharedlibrary_command): Remove
+ xcoff_relocate_symtab_hook indirection, call xcoff_relocate_symtab
+ directly, as xcoffsolib.c is now compiled in native AIX configurations
+ only.
+ * Makefile.in: Update dependencies for rs6000-tdep.o, rs6000-nat.o
+ and xcoffsolib.o.
+
+Thu Nov 9 17:16:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Specify the vax-dec-vms5.5 target tupple.
+ * vax-tdep.c: Include "gdbcore.h", "frame.h" and "value.h".
+ (vax_print_insn): Change ``d'' to a const char pointer.
+
+2000-11-08 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * gdbarch.sh: Spelling correction: registrary -> registry.
+ * gdbarch.c: Ditto.
+
+Wed Nov 8 23:08:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * m68k-tdep.c (m68k_get_longjmp_target): Work around targets that
+ don't define JB_PC or JB_ELEMENT_SIZE.
+
+Wed Nov 8 22:46:43 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * m68k-tdep.c (m68k_get_longjmp_target): Rename function
+ get_longjmp_target. Remove wrapping #ifdef GET_LONGJMP_TARGET.
+ * config/m68k/tm-m68k.h (m68k_get_longjmp_target): Add function
+ declaration.
+
+ * config/m68k/tm-vx68.h, config/m68k/tm-sun3.h,
+ config/m68k/tm-m68kv4.h, config/m68k/tm-linux.h,
+ config/m68k/tm-es1800.h, config/m68k/tm-cisco.h: Update definition
+ of GET_LONGJMP_TARGET. Delete get_longjmp_target function
+ declaratation.
+
+Wed Nov 8 15:32:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbserver/configure.in (files): Don't link nm-empty.h when a
+ non-native target.
+ * gdbserver/configure: Regenerate.
+
+2000-11-07 Kevin Buettner <kevinb@redhat.com>
+
+ * valops.c (typecmp): Protoize.
+ * valprint.c (strcat_longest): Protoize.
+
+2000-11-07 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (native_find_global_pointer): New global variable.
+ (struct gdbarch_tdep): Add member find_global_pointer.
+ (ia64_gdbarch_init): Initialize find_global_pointer member. Also,
+ tell the gdbarch machinery that we have floating point registers.
+ (FIND_GLOBAL_POINTER): New macro.
+ (generic_elf_find_global_pointer): Renamed from find_global_pointer.
+ (find_func_descr, ia64_push_return_address): Call
+ FIND_GLOBAL_POINTER instead of find_global_pointer.
+ (process_note_abi_tag_sections): Enable code previously disabled
+ by #if 0.
+
+2000-11-07 Daniel Berlin <dberlin@redhat.com>
+
+ * dwarf2read.c: Revert June 5th change for caching of types,
+ as per Jim Blandy's request.
+
+2000-11-06 Fernando Nasser <fnasser@totem.toronto.redhat.com>
+
+ * wrapper.c (gdb_value_assign): New function. Longjump-free
+ version of value_assign.
+ (wrap_value_assign): New function. Wrapper for value_assign.
+ * wrapper.h: Add declaration for the above.
+ * varobj.c (varobj_set_value): Use gdb_value_assign, not
+ value_assign which can longjump. Do not change varobj value if
+ assign fails.
+
+2000-11-06 Fernando Nasser <fnasser@cygnus.com>
+
+ From Steven Johnson <sbjohnson@ozemail.com.au>:
+
+ This set of changes add "hookpost-" as an expansion on the original
+ hooking of commands to GDB. A Hook may now be run "AFTER" execution of
+ a command as well as before.
+
+ * command.h (struct cmd_list_element): Changed elements hook and hookee
+ to hook_pre and hookee_pre respectively. Added hook_post and hookee_post
+ for the post hook command operation. Added hook_in so that an executing
+ hook can be flagged to prevent recursion.
+ * command.c (add_cmd): Changed initilization of cmd_list_element to
+ reflect above changes.
+ (delete_cmd): Remove both pre and post hooks.
+ (help_cmd): Notify that the command has pre and/or post hooks.
+ * infrun.c (normal_stop): Change references to hook_pre from hook.
+ * top.c (execute_command): Run both pre and post hooks.
+ (define_command): Allow definition of both pre and post hooks.
+ The definition of pre-hooks is done as before, with the "hook-"
+ prefix for backward compatibility.
+
+2000-11-06 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * stack.c (return_command): Pop dummy frame if we just returned from
+ a stop in a call dummy.
+
+2000-11-05 Kevin Buettner <kevinb@redhat.com>
+
+ * v850-tdep.c (handle_prepare, handle_pushm): Remove extraneous
+ blank line after function declarator.
+ * v850ice.c (v850ice_xfer_memory, do_gdb): Protoize.
+
+2000-11-03 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (add_continuation, add_intermediate_continuation,
+ printchar): Protoize.
+
+2000-11-03 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (new_symbol): Relocate address of symbol by the
+ base address of the section it is in rather than always using
+ the base address of the .text section.
+
+2000-11-01 J.T. Conklin <jtc@redback.com>
+
+ * TODO: Note abstraction layer violation where "ocd reset" command
+ must invalidate the dcache, and how this might be fixed.
+
+ * monitor.c (#include "dcache.h"): Removed.
+ (remote_dcache): Removed.
+ (monitor_open): Removed code that created local dcache.
+ (flush_monitor_dcache): Removed (unused function).
+ (monitor_resume): Removed call to dcache_invd().
+ (monitor_load): Likewise.
+ (monitor_xfer_memory): Changed to call monitor_write_memory(),
+ monitor_write_memory_block(), and monitor_read_memory() instead
+ of dcache_xfer_memory().
+ * monitor.h (flush_monitor_dcache): Removed (unused function).
+ * ocd.c (#include "dcache.h"): Removed.
+ (ocd_dcache): Removed.
+ (ocd_open): Removed code that created local dcache.
+ (ocd_resume): Removed call to dcache_invd().
+ (ocd_xfer_memory): Changed to call ocd_write_bytes() and
+ ocd_read_bytes() instead of dcache_xfer_memory().
+ (bdm_reset_command): Invalidate target dcache.
+ * remote-bug.c (bug_load): Remove call to dcache_invd().
+ (bug_resume): Likewise.
+ (bug_settings): Remove dcache, readfunc, and writefunc fields
+ from initializer.
+ (bug_xfer_memory): Changed to call bug_read_memory() and
+ bug_write_memory() instead of dcache_xfer_memory().
+ * remote-nindy.c (#include "dcache.h"): Removed.
+ (nindy_dcache): Removed.
+ (nindy_open): Removed code that created local dcache.
+ (nindy_resume): Removed call to dcache_invd().
+ (nindy_load): Likewise.
+ (nindy_xfer_inferior_memory): Changed to call ninMemPut() and
+ ninMemGet() instead of dcache_xfer_memory().
+ * remote-sds.c (#include "dcache.h"): Removed.
+ (sds_dcache): Removed.
+ (sds_open): Removed code that created local dcache.
+ (sds_resume): Removed call to dcache_invd().
+ (sds_xfer_memory): Changed to call sds_write_bytes() and
+ sds_read_bytes() instead of dcache_xfer_memory().
+ * remote-utils.c (gr_open): Removed code that created local dcache.
+ * remote-utils.h (#include "dcache.h"): Removed.
+ (struct gr_settings): Removed dcache, readfunc, and writefunc fields.
+ (gr_get_dcache, gr_set_dcache): Removed macro definitions.
+ * remote.c (#include "dcache.h"): Removed.
+ (remote_dcache): Removed.
+ (remote_open_1): Removed code that created local dcache.
+ (remote_async_open_1): Likewise.
+ (remote_resume): Removed call to dcache_invd().
+ (remote_async_resume): Likewise.
+ (remote_xfer_memory): Changed to call remote_write_bytes() and
+ remote_read_bytes() instead of dcache_xfer_memory().
+ * wince.c (#include "dcache.h"): Removed.
+ (remote_dcache): Removed.
+ (child_create_inferior): Removed code that created local dcache.
+ (child_xfer_memory): Changed to call remote_write_bytes() and
+ remote_read_bytes() instead of dcache_xfer_memory().
+ (child_resume): Removed call to dcache_invd().
+
+ * target.c (target_dcache): Added.
+ (target_load): Invalidate target_dcache.
+ (do_xfer_memory): New function.
+ (target_xfer_memory): Reimplement in terms of dcache_xfer_memory().
+ (target_xfer_memory_partial): Likewise.
+ (initialize_targets): Create target_dcache.
+ * target.h (#include "dcache.h"): Added.
+ (target_open): Invalidate target_dcache.
+ (target_resume): Likewise.
+ (do_xfer_memory): New declaration.
+
+ * dcache.c (dcache_init): Removed reading and writing arguments.
+ (dcache_struct): Removed read_memory and write_memory fields.
+ (dcache_write_line): Call do_xfer_memory.
+ (dcache_read_line): Likewise.
+ (dcache_xfer_memory): Likewise.
+ (dcache_invalidate): Renamed from dcache_invd.
+ (dcache_init): Updated.
+ (dcache_xfer_memory): Updated.
+ * dcache.h (memxferfunc): Removed definition.
+ (dcache_init): Removed reading and writing arguments.
+
+2000-11-03 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * objfiles.c (objfile_relocate): Relocate ei.entry_point with
+ its section offset, use SECT_OFF_TEXT only as a fallback.
+
+2000-11-01 Kevin Buettner <kevinb@redhat.com>
+
+ * symm-nat.c (print_1167_regs): Remove extraneous blank line
+ after function declarator.
+ * symtab.c (search_symbols): Likewise.
+ * ultra3-nat.c (fetch_core_registers): Protoize.
+
+2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/sh/tm-linux.h: New file. Include generic tm-linux.h,
+ plus tm-sh.h, then define SVR4_FETCH_LINK_MAP_OFFSETS to use
+ the sh target function instead of the default link map offsets.
+ * config/sh/sh.mt: Add solib.o and solib-svr4.o to TDEPFILES.
+ Use sh/tm-linux.h instead of sh/tm-sh.h.
+ * sh-tdep.c (sh_linux_svr4_fetch_link_map_offsets):
+ New function. Construct target-specific link map offsets.
+ * i386-linux-tdep.c (i386_linux_svr4_fetch_link_map_offsets:
+ New function. Construct target-specific link map offsets.
+ * config/i386/tm-linux.h: Use above function instead of default.
+
+2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/i386/tm-linux.h: Remove definition of SVR4_SHARED_LIBS,
+ and inclusion of solib.h. Move up into ../tm-linux.h.
+ config/tm-linux.h: Define SVR4_SHARED_LIBS, include solib.h.
+
+2000-10-30 Kevin Buettner <kevinb@redhat.com>
+
+ * top.c (simplified_command_loop, add_info, add_com,
+ help_command): Protoize.
+ * ui-out.c (gdb_query): Protoize.
+
+2000-10-30 Kevin Buettner <kevinb@redhat.com>
+
+ Changes based on analysis from Peter Schauer:
+ * solist.h (struct so_list): Remove field lmend.
+ (struct target_so_ops): Remove field lm_addr. Add field
+ relocate_section_addresses. Add comments for all fields
+ in this structure
+ (TARGET_SO_LM_ADDR): Remove.
+ (TARGET_SO_RELOCATE_SECTION_ADDRESSES): New macro.
+ * solib-svr4.c (svr4_relocate_section_addresses): New function.
+ (_initialize_svr4_solib): Remove lm_addr initialization. Add
+ initialization for relocate_section_addresses.
+ * solib.c (solib_map_sections): Invoke
+ TARGET_SO_RELOCATE_SECTION_ADDRESSES instead of using now
+ defunct TARGET_SO_LM_ADDR to relocate the section addresses.
+ Also, eliminate assignment to the lmend field since this
+ field no longer exists.
+ (symbol_add_stub): Remove machinery for determining the lowest
+ section.
+ (info_sharedlibrary_command): Print the text section starting
+ and ending addresses.
+ (solib_address): Don't use TARGET_SO_LM_ADDR, nor so->lmend to
+ determine if an address is in a shared object. Instead, scan
+ the section table and test against the starting and ending
+ addresses for each section.
+
+2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * config/m68k/linux.mh: Remove solib.c, solib-svr4.c from NATDEPFILES.
+ * config/powerpc/linux.mh: ditto.
+ * config/ia64/linux.mh: ditto.
+ * config/i386/linux.mh: ditto.
+ * config/alpha/alpha-linux.mh: ditto.
+ * config/arm/linux.mh: ditto.
+ * config/m68k/linux.mt: Add solib.c, solib-svr4.c to TDEPFILES.
+ * config/powerpc/linux.mt: ditto.
+ * config/ia64/linux.mt: ditto.
+ * config/i386/linux.mt: ditto.
+ * config/alpha/alpha-linux.mt: ditto.
+ * config/arm/linux.mt: ditto.
+
+2000-10-30 J.T. Conklin <jtc@redback.com>
+
+ * gdbarch.sh, hp-psymtab-read.c, hpread.c, m3-nat.c, mcore-tdep.c,
+ mips-tdep.c, monitor.c, regcache.c, remote-es.c, ser-unix.c,
+ somread.c, tracepoint.c: Fix spelling errors in comments.
+ * gdbarch.c: Regenerate.
+
+ * gnu-nat.c (S_exception_raise_request): Fix typos and spelling
+ errors in strings.
+ * m3-nat.c (intercept_exec_calls, mach_thread_parse_id): Likewise.
+ * mcore-tdep.c (mcore_analyze_prologue): Likewise.
+ * mips-tdep.c (mips16_next_pc, _initialize_mips_tdep): Likewise.
+ * remote-e7000.c (e7000_start_remote): Likewise.
+ * remote-rdp.c (handle_swi): Likewise.
+ * remote-vx.c (vx_load_command): Likewise.
+ * sh-tdep.c (sh_do_pseudo_register): Likewise.
+ * sol-thread.c (td_err_string): Likewise.
+ * symtab.c (decode_line_2): Likewise.
+
+Mon Oct 30 10:19:01 2000 David Taylor <taylor@redhat.com>
+
+ * eval.c (parse_and_eval_long): New function.
+ * value.h: Declare it.
+
+ * breakpoint.c (breakpoints_info, maintenance_info_breakpoints):
+ Call parse_and_eval_long, not parse_and_eval_address.
+ * command.c (do_setshow_command): Ditto.
+ * infcmd.c (step_1, signal_command, continue_command): Ditto.
+ * infrun.c (signals_info): Ditto.
+ * stack.c (set_backtrace_limit_command, backtrace_command_1,
+ up_silently_base, down_silently_base): Ditto.
+ * tracepoints.c (tracepoints_info, trace_find_command,
+ trace_find_tracepoint_command): Ditto.
+ * valprint.c (set_radix): Ditto.
+ * values.c (show_values): Ditto.
+
+2000-10-28 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.c (decode_line_2, file_matches, search_symbols): Protoize.
+ * thread.c (iterate_over_threads): Protoize.
+
+2000-10-27 J.T. Conklin <jtc@redback.com>
+
+ * arch-utils.c (set_architecture, set_architecture_from_arch_mach,
+ set_gdbarch_from_file): Fix spelling error in string.
+ * v850-tdep.c (v850_target_architecture_hook): Likewise.
+ * gdbarch.sh: Fix spelling errors in comments.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+ * ppcnbsd-nat.c (fetch_core_registers, fetch_inferior_registers,
+ store_inferior_registers): Support older NetBSD/powerpc systems
+ from before fp reg support was added. Adapt to register number
+ changes caused when powerpc target was multi-arched.
+
+2000-10-26 David B. Anderson <davea@sgi.com>
+
+ * breakpoint.c breakpoint.h hppab-nat.c infrun.c
+ language.h mcore-tdep.c mips-tdep.c symfile.c symtab.c
+ symtab.h target.c tm-mips.h xm-sun4sol2.h: Corrected
+ spelling errors in comments.
+ * gdbarch.c gdbarch.sh: Removed word from comment.
+
+2000-10-26 Kevin Buettner <kevinb@redhat.com>
+
+ * sun3-nat.c (fetch_core_registers): Protoize.
+ * symm-nat.c (print_1167_regs, child_xfer_memory): Protoize.
+
+2000-10-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stabsread.c (define_symbol): Update comment.
+
+2000-10-26 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * stabsread.c (define_symbol): Set the type_name of the type
+ of the new symbol to the symbol name for type symbol, if the
+ language is Pascal.
+
+2000-10-26 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * arch-utils.c, arch-utils.h (default_convert_from_func_ptr_addr):
+ New function.
+ * gdbarch.sh (CONVERT_FROM_FUNC_PTR_ADDR): Add.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * valops.c (find_function_addr): Use CONVERT_FROM_FUNC_PTR_ADDR
+ unconditionally.
+
+ * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR): Delete
+ definition.
+ * config/powerpc/tm-linux.h (CONVERT_FROM_FUNC_PTR_ADDR): Remove
+ undef.
+ * rs6000-tdep.c (rs6000_convert_from_func_ptr_addr): Fix comment.
+ (rs6000_gdbarch_init): Register rs6000_convert_from_func_ptr_addr
+ if not ELFOSABI_LINUX.
+
+2000-10-25 Kevin Buettner <kevinb@redhat.com>
+
+ * config/rs6000/rs6000lynx.mt (TDEPFILES): Revert 2000-10-24
+ change in which solib-svr4.o was inadvertently added to this
+ list.
+
+2000-10-25 Fred Fish <fnf@cygnus.com>
+
+ * mips-tdep.c (MIPS_DEFAULT_MASK_ADDRESS_P): Define using either
+ the current arch or use zero.
+
+2000-10-25 Fernando Nasser <fnasser@cygnus.com>
+
+ * ser-unix.c (do_unix_readchar): Coding style improvement only.
+
+2000-10-25 Fernando Nasser <fnasser@cygnus.com>
+
+ * target.c (generic_mourn_inferior): Notify GUI that inferior is gone
+ by calling detach_hook, if defined.
+
+2000-10-24 Kevin Buettner <kevinb@redhat.com>
+
+ * coffread.c (coff_end_symtab): When calling end_symtab(),
+ use SECT_OFF_TEXT() instead of 0 to represent the .text
+ section.
+ * hp-symtab-read.c (hpread_expand_symtab): Likewise.
+ * hpread.c (hpread_expand_symtab, hpread_process_one_debug_symbol):
+ Likewise.
+
+2000-10-24 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-svr4.c: New file created out of much of solib.c...
+ * solib.c (_SYSCALL32, BKPT_AT_SYMBOL): Move these defines to
+ solib-svr4.c.
+ (sys/types.h, signal.h, sys/param.h, fcntl.h, a.out.h,
+ elf/external.h, link.h): Move these includes to solib-svr4.c.
+ (bkpt_names, debug_base_symbols, main_name_list,
+ solib_extract_address, SOLIB_EXTRACT_ADDRESS, dynamic_copy,
+ ld_2_copy, debug_addr, flag_addr, LM_ADDR, LM_NEXT, LM_NAME,
+ IGNORE_FIRST_LINK_MAP_ENTRY, breakpoint_addr,
+ allocate_rt_common_objfile, solib_add_common_symbols,
+ bfd_lookup_symbol, look_for_base, elf_locate_base, locate_base,
+ first_link_map_member, open_symbol_file_object, match_main,
+ current_sos, interp_text_sect_low, interp_text_sect_high,
+ interp_plt_sect_low, interp_plt_sect_high,
+ in_svr4_dynsym_resolve_code, disable_break, enable_break,
+ special_symbol_handling): Moved to solib-svr4.c.
+ (debug32_copy, shadow_contents, fdmatch)
+ Removed entirely.
+ (struct so_list): Moved to solist.h
+ (MAX_PATH_SIZE): Moved to solist.h and renamed to
+ SO_NAME_MAX_PATH_SIZE.
+
+ * solist.h: New file created from struct so_list in solib.c.
+ (struct lm_info): Add forward declaration.
+ (struct so_list): Remove fields lm, lm32, lmaddr. Replace with a
+ single field, lm_info, which will be a pointer to target specific
+ data.
+ (struct target_so_ops): New struct.
+ (free_so): Add extern declaration.
+ (current_target_so_ops): Declare new global variable.
+ (solib_map_sections):
+ (TARGET_SO_LM_ADDR, TARGET_SO_FREE_SO, TARGET_SO_CLEAR_SOLIB,
+ TARGET_SO_SOLIB_CREATE_INFERIOR_HOOK,
+ TARGET_SO_SPECIAL_SYMBOL_HANDLING, TARGET_SO_CURRENT_SOS,
+ TARGET_SO_OPEN_SYMBOL_FILE_OBJECT): New macros.
+ * solib.c (solib_map_sections, free_so, symbol_add_stub,
+ update_solib_list, solib_add, info_shared_library_command,
+ solib_address, clear_solib, solib_create_inferior_hook): Use
+ new TARGET_SO_* macros to call function on target specific
+ side indirectly.
+ (current_target_so_ops): Define new global variable.
+ (_initialize_solib): Eliminate HAVE_LINK_H ifdef.
+ * solib-svr4.h: New file; defines struct link_map_offsets and
+ SVR4_FETCH_LINK_MAP_OFFSETS.
+ * solib-svr4.c (_initialize_svr4_solib, svr4_clear_solib,
+ svr4_free_so): New functions.
+ (special_symbol_handling, solib_create_inferior_function_hook,
+ current_sos): Rename by adding a svr4_ prefix.
+ (default_svr4_fetch_link_map_offsets): New function.
+ (LM_ADDR, LM_NEXT, LM_NAME, IGNORE_FIRST_LINK_MAP_ENTRY,
+ first_link_map_member, open_symbol_file_object, svr4_current_sos):
+ Remove dependence on existence of link.h by calling
+ SVR4_FETCH_LINK_MAP_OFFSETS to obtain the offsets of shared library
+ data. As a result, SVR4 and non-SVR4 versions of many of these
+ functions coalesce into a single function and HAVE_STRUCT_LINK_MAP32
+ ugliness is moved into default_svr4_fetch_link_map_offsets where it
+ is relatively contained.
+ (SOLIB_EXTRACT_ADDRESS): Revert 2000-08-29 change in which
+ solib_extract_address() is called instead of extract_address().
+ (solib_extract_address): Removed.
+
+ * Makefile.in (solib.o): Add solist.h as a dependency.
+ (solib-svr4.o): Add dependencies.
+ * config/alpha/alpha-linux.mh, config/alpha/fbsd.mh,
+ config/arm/linux.mh, config/i386/fbsd.mh,
+ config/i386/i386dgux.mh, config/i386/i386gnu.mh,
+ config/i386/i386sco5.mh, config/i386/i386sol2.mt,
+ config/i386/i386v4.mh, config/i386/i386v42mp.mh,
+ config/i386/linux.mh, config/i386/nbsd.mh,
+ config/i386/nbsdelf.mh, config/i386/ncr3000.mt,
+ config/i386/ptx4.mh, config/i386/sun386.mt,
+ config/ia64/linux.mh, config/m68k/linux.mh,
+ config/m68k/m68kv4.mh, config/m68k/nbsd.mh,
+ config/m68k/sun2os4.mt, config/m68k/sun3os4.mt,
+ config/m88k/delta88v4.mh, config/mips/mipsv4.mh,
+ config/ns32k/nbsd.mh, config/powerpc/linux.mh,
+ config/powerpc/nbsd.mh, config/powerpc/solaris.mh,
+ config/rs6000/rs6000lynx.mt, config/sparc/linux.mt,
+ config/sparc/nbsd.mh, config/sparc/nbsdelf.mh,
+ config/sparc/sun4os4.mt, config/sparc/sun4sol2.mh
+ (NATDEPFILES): Add solib-svr4.o to list.
+
+ * sparc-tdep.c (gregset.h): Don't include unless USE_PROC_FS is
+ defined.
+
+2000-10-24 Kevin Buettner <kevinb@redhat.com>
+
+ * stabsread.c (dbx_lookup_type, dbx_alloc_type,
+ read_sun_builtin_type, read_sun_floating_type,
+ read_range_type): Protoize.
+
+Wed Oct 25 01:19:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * solib.c (open_symbol_file_object): Update function signature to
+ match catch_errors function argument.
+
+Wed Oct 25 00:08:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-09-06 Angela Marie Thomas <angela@cygnus.com>:
+ * infttrace.c (get_dictionary_entry_of_page): Function
+ require_memory_page_dictionary takes no args.
+
+Tue Oct 24 16:12:00 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdba.el: Delete file.
+ * NEWS: Mention.
+
+2000-10-23 David B Anderson <davea@sgi.com>
+
+ * TODO: Correct spelling errors
+ * command.c (_initialize_command) corelow.c (core_open)
+ main.c (captured_command_loop) mips-tdep.c (mips32_next_pc)
+ remote.c serial.h top.c utils.c config/nm-lynx.h:
+ Correct spelling errors in comments
+
+2000-10-22 Kevin Buettner <kevinb@redhat.com>
+
+ * sparc-nat.c (fetch_core_registers): Protoize.
+ * sparcl-tdep.c (download): Protoize.
+
+Fri Oct 20 19:08:47 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Fred Fish to Blanket Write Privs list.
+
+2000-10-19 Josef Ezra <jezra@emc.com>
+
+ * ax-gdb.c (gen_struct_ref): while generating data code, cases of
+ "collect p1->p2->data" where not covered if p2 is a 'typedefed'
+ type. this simple fix should forward the type pointer to the real
+ type.
+
+2000-10-19 Kevin Buettner <kevinb@redhat.com>
+
+ * solib.c (LM_ADDR, LM_NEXT, LM_NAME, IGNORE_FIRST_LINK_MAP_ENTRY,
+ open_symbol_file_object): Protoize.
+
+2000-10-17 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-vx29k.c (vx29k_frame_chain_valid): Protoize.
+ * remote.c (remote_xfer_memory, remote_search): Protoize.
+ * sol-thread.c (sol_thread_xfer_memory): Protoize.
+
+2000-10-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * sparc-tdep.c (sparc_fix_call_dummy): Improve comments.
+ Adjust call_dummy_breakpoint_offset, so that `finish' after a stop
+ in a call dummy works.
+ (sparc_gdbarch_init): Fix setting of pc_in_call_dummy, it depends
+ on SPARC32/64_CALL_DUMMY_ON_STACK, not DO_CALL_DUMMY_ON_STACK.
+
+2000-10-15 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-st.c (st2000_xfer_inferior_memory): Protoize.
+ * remote-utils.c (gr_multi_scan): Protoize.
+ * remote-vx.c (vx_xfer_memory, net_get_symbols): Protoize.
+
+2000-10-13 Fernando Nasser <fnasser@cygnus.com>
+
+ * remote.c (putpkt_binary): Call read_frame, not getpkt. Log message.
+ (read_frame): Do not call error() on communication error when
+ reading checksum, but return failure instead and log message.
+
+2000-10-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (type_changeable): Arrays are not changeable.
+ Trying to check for updates was causing an error if the array lived
+ in a register as gdb value_equal() cannot handle that case yet.
+
+2000-10-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Prevent uninitialized error code to be
+ returned on type_changed. Also, prevent value_equal() to be called
+ for the types we do not want to test for updates.
+
+2000-10-11 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com>
+ This keeps the GUI alive while running an RDI target and lets the
+ STOP button be used to stop the target.
+ * remote-rdi.c (arm_rdi_stop): New function. Implements target_stop.
+ (init_rdi_ops): Set to_stop target vector entry to the above.
+ * rdi-share/ardi.c (stop_request): New variable. Tells when a stop
+ has been requested.
+ (angel_RDI_stop_request): New function. Registers that a stop has
+ been requested.
+ (angel_RDI_ExecuteOrStep): Add call to ui_loop_hook() in loop that
+ waits while target is executing. Initialize and reset stop_request.
+ * rdi-share/ardi.h: Add declaration of angel_RDI_stop_request().
+
+2000-10-12 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-rdp.c (remote_rdp_xfer_inferior_memory): Protoize.
+ * remote-sds.c (sds_xfer_memory): Protoize.
+ * remote-sim.c (gdbsim_xfer_inferior_memory): Protoize.
+
+2000-10-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Daniel Berlin <dberlin@redhat.com> :
+
+ * symtab.h (SYMBOL_INIT_DEMANGLED_NAME): Initialize the symbol
+ language to auto instead of unknown, so it will try to demangle
+ the symbol.
+ * symtab.h (OPNAME_PREFIX_P): Change operator prefix to correct value.
+ * symtab.c (gdb_mangle_name): Properly handle C++ operators.
+
+2000-10-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Daniel Berlin <dberlin@redhat.com> :
+
+ * symtab.c (lookup_symbol_aux): New function. Renamed from
+ lookup_symbol. Move code to do demangling/case sensitivity to
+ lookup_symbol().
+ (lookup_symbol): Now wrapper for lookup_symbol_aux, so we can
+ perform case sensitivity/demangling without leaking memory. Move
+ code to do demangling/case sensitivity from old_lookup_symbol to
+ here.
+ (lookup_partial_symbol): Use SYMBOL_SOURCE_NAME instead of
+ SYMBOL_NAME.
+ (lookup_block_symbol): Use SYMBOL_SOURCE_NAME instead of
+ SYMBOL_NAME. Don't do linear search in case of C++.
+
+ * symfile.c (compare_symbols): Use SYMBOL_SOURCE_NAME instead of
+ SYMBOL_NAME.
+ (compare_psymbols): Same here.
+
+2000-10-09 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-nindy.c (non_dle, nindy_xfer_inferior_memory): Protoize.
+ * remote-os9k.c (rombug_xfer_inferior_memory): Protoize.
+ * remote-rdi.c (arm_rdi_xfer_memory): Protoize.
+
+2000-10-09 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * config/i386/i386sol2.mh: Add XM_CLIBS definition to resolve
+ reference to gethostbyname.
+
+2000-10-06 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-eb.c (eb_xfer_inferior_memory): Protoize.
+ * remote-es.c (es1800_xfer_inferior_memory, es1800_files_info):
+ Protoize.
+ * remote-mm.c (expect_msg): Protoize.
+
+2000-10-04 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (skip_prologue): Add new parameter lim_pc.
+ Update all callers.
+
+2000-10-03 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-bug.c (bug_xfer_memory, bug_insert_breakpoint,
+ bug_remove_breakpoint): Protoize.
+ * remote-e7000.c (fetch_regs_from_dump, e7000_xfer_inferior_memory):
+ Protoize.
+
+2000-10-01 Kevin Buettner <kevinb@redhat.com>
+
+ * remote-adapt.c (adapt_insert_breakpoint, adapt_remove_breakpoint):
+ Protoize.
+ * remote-array.c (write_monitor, array_xfer_memory): Protoize.
+
+2000-09-29 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-nat.c (supply_gregset, fill_gregset): Change type
+ of first argument from gregset_t to gdb_gregset_t in order
+ to match declarations in gregset.h.
+ (supply_fpregset, fill_fpregset): Change type of first argument
+ from fpregset_t to gdb_fpregset_t in order to match declarations
+ in gregset.h.
+
+2000-09-29 Kevin Buettner <kevinb@redhat.com>
+
+ * procfs.c (proc_iterate_over_mappings, proc_iterate_over_threads,
+ procfs_xfer_memory): Protoize.
+ * ptx4-nat.c (proc_iterate_over_mappings): Protoize.
+
+2000-09-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * sol-thread.c (ps_pdmodel): Return PR_MODEL_UNKNOWN instead of
+ PS_ERR if exec_bfd is not yet open.
+
+2000-09-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * target.c (target_signal_from_host, do_target_signal_to_host):
+ Add support for Solaris realtime signals.
+
+2000-09-27 Kevin Buettner <kevinb@redhat.com>
+
+ * os9kread.c (os9k_symfile_read, os9k_end_psymtab): Protoize.
+ * osfsolib.c (find_solib): Protoize.
+
+2000-09-25 Kevin Buettner <kevinb@redhat.com>
+
+ * ns32knbsd-nat.c (fetch_core_registers): Protoize.
+ * ocd.c (ocd_xfer_memory): Protoize.
+
+2000-09-25 Andrew Cagney <ac131313@cygnus.com>
+
+ * MAINTAINERS: Add Mark Kettenis to ``Blanket Write Privs'' list.
+
+2000-09-24 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * rs6000-tdep.c (rs6000_pop_frame): Use PC_IN_CALL_DUMMY to test
+ for call dummy instead of accessing stop_stack_dummy, which does
+ not work if we `return' from a stop in a call dummy.
+ (rs6000_gdbarch_init): Use generic_save_dummy_frame_tos for
+ dummy_frame_tos function to make PC_IN_CALL_DUMMY work.
+
+2000-09-23 Kevin Buettner <kevinb@redhat.com>
+
+ * mdebugread.c (mdebug_next_symbol_text): Protoize.
+ * monitor.c (monitor_xfer_memory): Protoize.
+
+2000-09-22 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER,
+ OLD_CANNOT_FETCH_REGISTER): New definitions for accessible registers
+ when accessing the registers via the U area.
+ (fetch_register, store_register): Use them.
+ (cannot_fetch_register, cannot_store_register): New functions,
+ all registers should be accessible if we have GETREGS support.
+ * config/i386/nm-linux.h: Use cannot_fetch/store_register for
+ CANNOT_FETCH/STORE_REGISTER definitions.
+
+2000-09-06 Fred Fish <fnf@cygnus.com>
+
+ * infttrace.c (update_thread_state_after_attach): Pass address
+ of ttstate_t object, not the object itself.
+
+2000-09-18 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (stop_wait_callback): Remove bogus assertions in the
+ code that deals with exiting/signalled threads. Replace with
+ code similar to what's done in lin_lwp_wait.
+
+2000-09-17 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-nat.c (fill_gregset, fill_fpregset): New functions.
+ * config/powerpc/linux.mh (NATDEPFILES): Remove linux-thread.o.
+ Add proc-service.o, thread-db.o, and lin-lwp.o.
+ (LOADLIBES): Define.
+ * config/powerpc/nm-linux.h (ATTACH_DETACH, SVR4_SHARED_LIBS):
+ Remove defines which are already present in ../nm-linux.h.
+ (solib.h): Don't include this file; it's already included by
+ ../nm-linux.h.
+ (PREPARE_TO_PROCEED, GET_THREAD_SIGNALS, ATTACH_LWP): Define
+ to use the following lin-lwp.c functions...
+ (lin_lwp_prepare_to_proceed, lin_thread_get_thread_signals,
+ lin_lwp_attach_lwp): Declare.
+
+2000-09-17 Kevin Buettner <kevinb@redhat.com>
+
+ * m88k-nat.c (fetch_inferior_registers): Protoize.
+ * m88k-tdep.c (m88k_skip_prologue): Protoize.
+
+2000-09-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_set_value): Call wrapped version of
+ parse_exp_1() to avoid longjumps.
+
+2000-09-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote.c (putpkt_binary): Call read_frame, not getpkt. Log message.
+ (read_frame): Do not call error() on communication error when
+ reading checksum, but return failure instead and log message.
+
+2000-09-15 Fernando Nasser <fnasser@cygnus.com>
+
+ * ser-unix.c (do_unix_readchar): Prevent infinite read wait to be
+ interrupted after 32K seconds.
+
+2000-09-15 Kevin Buettner <kevinb@redhat.com>
+
+ * language.c (show_case_command, set_case_command): Protoize.
+ * m3-nat.c (m3_xfer_memory, fetch_thread_info): Protoize.
+
+2000-09-12 Kevin Buettner <kevinb@redhat.com>
+
+ * lin-thread.c (threadlist_iter, get_lwp_from_thread_id,
+ thread_db_xfer_memory): Protoize.
+ * linux-thread.c (iterate_active_threads): Protoize.
+
+2000-09-12 Kevin Buettner <kevinb@redhat.com>
+
+ * objfiles.c (objfile_relocate): Don't assume that offsets
+ associated with one of SECT_OFF_TEXT, SECT_OFF_DATA, or
+ SECT_OFF_BSS will be adequate for relocating all of the
+ sections in an objfile.
+
+2000-09-12 Fernando Nasser <fnasser@cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): Fix typo in error message.
+
+Wed Sep 13 03:08:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-mips.c (mips_expect, mips_getstring, mips_send_packet,
+ mips_send_packet, pmon_insert_breakpoint, send_srec,
+ pmon_check_ack, pmon_check_entry_address,
+ _initialize_remote_mips): Replace the magic two seconds with
+ ``remote_timeout''.
+ (pmon_check_entry_address, pmon_check_total): New functions. Use
+ ``remote_timeout'' instead of magic two seconds.
+ (pmon_end_download): Rewrite. Use pmon_check_entry_address and
+ pmon_check_total.
+
+2000-09-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * MAINTAINERS: Added myself.
+
+2000-09-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4 (CY_GNU_GETTEXT): Add dummy definition, so that the
+ one brought in by ../bfd/acinclude.m4 prevails.
+ * aclocal.m4, configure: Rebuilt.
+
+2000-09-11 Kevin Buettner <kevinb@redhat.com>
+
+ * configure.in (HAVE_STRUCT_LINK_MAP32): Change test to use
+ AC_TRY_COMPILE instead of AC_TRY_RUN.
+ * configure: Regenerate.
+
+2000-09-11 Kevin Buettner <kevinb@redhat.com>
+
+ * irix4-nat.c (fetch_core_registers): Protoize.
+ * irix5-nat.c (fetch_core_registers, find_solib): Protoize.
+
+2000-09-06 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (normal_mask, blocked_mask): New variables.
+ (lin_lwp_wait): Block SIGCHLD here if it isn't already blocked.
+ (lin_lwp_mourn_inferior): Restore the origional signal mask, and
+ reset the mask of blocked signals.
+ (_initialize_lin_lwp): Don't block SIGCHLD here, but do initialize
+ suspend_mask and blocked_mask. This makes us pass
+ gdb.base/sigall.exp for Linux/x86 now.
+ (lin_thread_get_thread_signals): Treat the LinuxThreads "cancel"
+ signal similarly to SIGCHLD in the generic code. Avoids GDB being
+ terminated by a Real-time signal.
+
+2000-09-08 Kevin Buettner <kevinb@redhat.com>
+
+ * infptrace.c, infttrace.c (child_xfer_memory): Protoize.
+
+2000-09-07 J.T. Conklin <jtc@redback.com>
+
+ * config/i386/nbsd.mt (TDEPFILES): Add i386nbsd-tdep.o.
+ * i386nbsd-nat.c (i386nbsd_use_struct_convention): Moved from here.
+ * i386nbsd-tdep.c (i386nbsd_use_struct_convention): To here.
+ * i386nbsd-tdep.c: New file.
+
+2000-09-07 Kevin Buettner <kevinb@redhat.com>
+
+ * i386mach-nat.c (fetch_inferior_registers, fetch_core_registers):
+ Protoize.
+ * i960-tdep.c (i960_skip_prologue, leafproc_return, mem): Protoize.
+
+Thu Sep 7 21:59:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * aclocal.m4: Regenerate.
+ * config.in, configure: Regenerate.
+
+Wed Sep 6 23:15:43 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-rdi.c (voiddummy): Update function signature to match
+ struct Dbg_HostosInterface's reset method.
+ * remote-rdp.c (rdp_step): Fix handle parameter to
+ remote_rdp_insert_breakpoint and remote_rdp_remove_breakpoint.
+
+ * arm-tdep.c (SIGCONTEXT_REGISTER_ADDRESS_P): Provide default
+ definition.
+ (arm_init_extra_frame_info): Use.
+
+2000-09-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_store_return_value): Store the value
+ in D and X if it's larger than 16-bits.
+ (m68hc11_extract_return_value): Fix extractions for 1 and 3 bytes
+ return.
+ (m68hc11_push_return_address): Use CALL_DUMMY_ADDRESS for the
+ return address.
+ (m68hc11_use_struct_convention): Check for struct and union.
+ (m68hc11_return_value_on_stack): Use the struct convention.
+ (m68hc11_call_dummy_address): Use the entry point address.
+ (m68hc11_push_arguments): Fix alignment and padding.
+ (m68hc11_stack_align): New function.
+ (m68hc11_gdbarch_init): Register it.
+
+2000-09-06 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-tdep.c (arm_linux_skip_solib_resolver):
+ Removed debug print statement. Removed arm_pc_is_thumb prototype.
+ * config/arm/tm-arm.h (arm_pc_is_thumb, arm_pc_is_thumb_dummy):
+ Move prototypes here from tm-embed.h.
+ * config/arm/tm-embed.h (arm_pc_is_thumb, arm_pc_is_thumb_dummy):
+ Remove prototypes. Moved to tm-arm.h.
+
+2000-09-06 H.J. Lu <hjl@gnu.org>
+
+ * TODO: Add hardware watchpoint problems on x86 OSes for 5.1.
+
+2000-09-06 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (examine_prologue): Add rotating register rename
+ support for the general registers.
+ (ia64_get_saved_register): Add rotating register rename support
+ for the predicate registers and the floating-point registers.
+
+2000-09-05 Kevin Buettner <kevinb@redhat.com>
+
+ * config/arm/tm-linux.h (arm_linux_sigcontext_register_address,
+ arm_linux_in_sigtramp): Declare.
+ (IN_SIGTRAMP, SIGCONTEXT_REGISTER_ADDRESS): Define.
+ * arm-tdep.c (SIGCONTEXT_REGISTER_ADDRESS): Define to be 0
+ if not already defined by tm.h.
+ (arm_scan_prologue): Don't assume that the prologue instructions
+ will be in a contiguous clump.
+ (arm_init_extra_frame_info): Add support for sigtramp frames.
+ (arm_pc_is_thumb, arm_pc_is_thumb_dummy): Change type of
+ `memaddr' from bfd_vma to CORE_ADDR.
+ * arm-linux-tdep.c (gdbcore.h, frame.h): Include.
+ (arm_pc_is_thumb): Declare.
+ (arm_linux_skip_solib_resolver): Fix printf() statement. [Which
+ shouldn't be there anyway.]
+ (ARM_LINUX_SIGRETURN_INSTR, ARM_LINUX_RT_SIGRETURN_INSTR): New
+ defines.
+ (arm_linux_in_sigtramp, arm_linux_sigcontext_register_address):
+ New functions.
+
+2000-09-05 Kevin Buettner <kevinb@redhat.com>
+
+ * i386aix-nat.c (fetch_core_registers): Protoize.
+ * hpux-thread.c (hpux_thread_xfer_memory): Protoize.
+
+2000-09-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_frame_chain): Check for pc in call dummy.
+ (m68hc11_guess_from_prologue): 'des' instruction to allocate 1 byte
+ on the stack can appear in the prologue.
+
+2000-09-05 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sol-thread.c (ps_pdmodel): Protect with an ifdef.
+
+Mon Sep 4 16:21:31 2000 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * gdbarch.sh: Use printf instead of echo.
+ (do_read): During read, pad ``::'' with spaces and then strip out
+ those spaces. Avoid problems with IFS=:.
+
+2000-09-04 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-linux.h: Include <signal.h>.
+
+2000-09-04 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * c-typeprint.c (c_typedef_print): remove (replaced by
+ typedef_print in typeprint.c).
+ * typeprint.c (typedef_print): new function. (old c_typedef_print
+ function with pascal language support added).
+ * value.h (c_printdef_print): removed.
+ (typedef_print): declare.
+ * symtab.c (print_symbol_info): call to c_typedef_print replaced
+ by call to typedef_print.
+
+2000-09-03 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-linux.h (PREPARE_TO_PROCEED, ATTCH_LWP,
+ GET_THREAD_SIGNALS): New defines.
+ * config/i386/linux.mh (NATDEPFILES): Remove lin-thread.o and
+ linux-threads.o. Add proc-service.o, thread-db.o and lin-lwp.o.
+ * proc-service.c: New file.
+ * thread-db.c: New file.
+ * lin-lwp.c: New file.
+
+ * gdb_assert.h: New file.
+
+ * gdb_thread_db.h [HAVE_THREAD_DB_H]: Include <thread_db.h>.
+ [!HAVE_THREAD_DB_H]: Update from current glibc thread_db.h. Deal
+ with absence of <stdint.h> here.
+
+ * gdb_proc_service.h: Add copyright notice.
+ Protect against multiple inclusion.
+ Add fix for broken prfpregset_t here.
+ (struct ps_prochandle): Declare here.
+ [HAVE_PROC_SERVICE_H]: Include <proc_service.h>.
+ [!HAVE_PROC_SERVICE_H]: Include "gregset.h", define prgregset_t
+ and prfpregset_t in terms of gdb_gregset_t and gdb_fpregset_t if
+ necessary.
+ * lin-thread.c: Unconditionally include "gdb_proc_service.h".
+ Remove fix for broken prfpregset_t here.
+ (struct ps_prochandle): Don't declare here.
+
+ * MAINTAINERS: Add myself as threads co-maintainer.
+
+2000-09-01 David Anderson <davea@sgi.com>
+
+ * arch-utils.c arch-utils.h blockframe.c fork-child.c:
+ Corrected comment spelling dependant->dependent.
+ * corelow.c (default_core_sniffer): Corrected comment
+ spelling.
+ * cp-valprint.c (cp_print_value_fields): Corrected
+ comment spelling.
+ * d10v-tdep.c dbxread.c: Corrected comment spelling
+ dependan->dependen.
+ * defs.h: Corrected spelling, meant 64, not 32, in comment.
+ * dst.h eval.c event-loop.c: Corrected comment spelling.
+ * event-top.c gdb-events.sh: Corrected comment spelling.
+ * gdbarch.c: Corrected comment spelling.
+ * gdbarch.h gdbarch.sh: Corrected comment spelling,
+ dependant->dependent.
+ * gdbtypes.c gdbtypes.h: Corrected comment spelling.
+ * infcmd.c infrun.c: Corrected comment spelling.
+ * symfile.c symfile.h target.h: Corrected comment spelling,
+ dependant->dependent.
+ * tracepoint.h: Corrected comment spelling.
+
+2000-09-01 Kevin Buettner <kevinb@redhat.com>
+
+ * hppa-tdep.c (record_text_segment_lowaddr): Protoize.
+ * hppah-nat.c (child_xfer_memory): Protoize.
+
+2000-09-01 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.c (decode_line_1): Make sure leading character is
+ actually a colon before skipping over leading colons in global
+ namespace specification.
+
+2000-09-01 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * regcache.c (reg_flush_command): New function. Maintainer-mode
+ command, flushes GDB's register cache, for testing purposes.
+
+2000-08-31 J.T. Conklin <jtc@redback.com>
+
+ * dcache.c (dcache_info): Output a cache line's state vector so it
+ lines up under the data vector.
+
+ * dcache.c (dcache_read_line): New function.
+ (dcache_peek_byte): Use it.
+ (dcache_alloc): Return NULL if write of reclaimed cache line fails.
+ (dcache_peek_byte, dcache_poke_byte): Return failure if
+ dcache_alloc() returns a NULL data block pointer.
+ (dcache_xfer_memory): Don't force writeback unless we were writing.
+
+ * monitor.c (monitor_expect): Change places where immediate_quit
+ is set to 1 or 0 to increments and decrements respectively. This
+ allows such changes to nest properly.
+ * ocd.c (ocd_start_remote): Likewise.
+ * remote-adapt.c (expect): Likewise.
+ * remote-array.c (expect): Likewise.
+ * remote-eb.c (expect): Likewise.
+ * remote-e7000.c (e7000_start_remote): Likewise.
+ * remote-mips.c (mips_expect_timeout, mips_getstring): Likewise.
+ * remote-nrom.c (expect): Likewise.
+ * remote-os9k.c (expect): Likewise.
+ * remote-sds.c (sds_start_remote): Likewise.
+ * remote-st.c (expect): Likewise.
+ * remote-utils.c (sr_expect): Likewise.
+ * remote.c (remote_start_remote): Likewise.
+ * tracepoint.c (read_actions): Likewise.
+
+ * remote-mips.c (mips_getstring): Balance changes to immediate_quit.
+
+2000-08-31 David Anderson <davea@sgi.com>
+
+ * MAINTAINERS: Add myself to write-after-approval list.
+
+2000-08-30 Kevin Buettner <kevinb@redhat.com>
+
+ * gnu-nat.c (gnu_xfer_memory): Protoize.
+ * hp-psymtab-read.c (scan_procs, hp_quick_traverse): Protoize.
+
+2000-08-30 Kevin Buettner <kevinb@redhat.com>
+
+ * solib.c (solib_extract_address, LM_ADDR, LM_NEXT, LM_NAME,
+ LM_ADDR, IGNORE_FIRST_LINK_MAP_ENTRY, first_link_map_member,
+ open_symbol_file_object, current_sos): Rename
+ bfd_elf_get_arch_size to bfd_get_arch_size().
+ * sol-thread.c (rw_common, ps_pdmodel): Likewise.
+
+2000-08-30 David Edelsohn <dje@watson.ibm.com>
+
+ Patch applied by Kevin Buettner <kevinb@redhat.com>:
+
+ * rs6000-nat.c (xcoff_relocate_symtab): Pass correct size
+ to xrealloc().
+
+2000-08-29 Michael Snyder <msnyder@seadog.cygnus.com>
+
+ * valops.c (value_cast): Indentation fix-up.
+ * acconfig.h (HAVE_PRGREGSET32_T, HAVE_PRFPREGSET32_T,
+ HAVE_STRUCT_LINK_MAP32): New configure macros.
+ * config.in: Ditto.
+ * configure.in: Test for the above new macros.
+ * breakpoint.c: Update copyright date.
+ * core-sol2.c: Include v9/sys/privregs.h directly to
+ work around a bug in Sun's Solaris 8 header files.
+ (fetch_core_registers): Use the above new configure macros to
+ handle cross-debugging of 32-bit core files on a 64-bit host.
+ * sol-thread.c (ps_pdmodel) New function.
+ (rw_common): For debugging of 32-bit apps on a 64-bit host,
+ truncate addresses to 32 bits.
+ * solib.c (solib_extract_address): Functionize. Make 32/64 aware.
+ (LM_ADDR, LM_NEXT, LM_NAME): Ditto.
+ (IGNORE_FIRST_LINK_MAP): Ditto.
+ (first_link_map_member): Make 32/64 aware.
+ (open_symbol_file_object): Ditto.
+ (current_sos): Ditto.
+
+2000-08-29 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * i386-linux-nat.c (i386_linux_skip_solib_resolver,
+ skip_hurd_resolver, find_minsym_and_objfile): Move these
+ solib functions into i386-linux-tdep.c for cross debugging.
+ * i386-linux-tdep.c: Receive the above functions.
+
+2000-08-29 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (stack_correction): New variable for stack offset
+ correction (1 for 68hc11, 0 for 68hc12).
+ (m68hc11_saved_pc_after_call): Use it.
+ (m68hc11_frame_chain): Likewise.
+ (m68hc11_frame_init_saved_regs): Likewise.
+ (m68hc11_init_extra_frame_info): Likewise.
+ (m68hc11_push_return_address): Likewise.
+ (m68hc11_push_arguments): Struct address must be corrected by
+ applying the stack_correction offset.
+ (m68hc11_store_struct_return): Likewise.
+
+2000-08-28 Kevin Buettner <kevinb@redhat.com>
+
+ * gdbserver/utils.c (error, fatal): Protoize.
+
+2000-08-27 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (fetch_inferior_registers): Move call to
+ dummy_sse_values ...
+ (supply_fpregset): ... here.
+
+2000-08-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * pa64solib.c (pa64_solib_load_symbols): Don't use ANOFFSET as an
+ lvalue.
+ * xcoffread.c (xcoff_symfile_offsets): Ditto
+ * somsolib.c (som_solib_section_offsets): Ditto.
+ * somread.c (som_symfile_offsets): Ditto.
+ * rs6000-nat.c (vmap_symtab): Ditto.
+ * remote-vx.c (vx_add_symbols): Ditto.
+ * remote-os9k.c (rombug_wait): Ditto.
+
+2000-08-27 Mark Kettenis <kettenis@gnu.org>
+
+ * gregset.h: Protect against multiple inclusion. Remove some
+ redundant spaces.
+
+Sun Aug 27 00:00:04 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (dll_symbol_command): Tack a .dll on the end of a
+ supplied argument if it is missing an extension.
+
+2000-08-24 Egor Duda <deo@logos-m.ru>
+
+ * corelow.c: Define O_BINARY if it isn't defined.
+ (core_open): Open core file in binary mode.
+ * config/i386/tm-cygwin.h (child_clear_solibs): Rename from
+ child_clear_solib.
+ * config/i386/cygwin.mh: Add dependency from corelow.o.
+ * win32-nat.c (register_loaded_dll): New function. Add dll to the list
+ of currently loaded dlls.
+ (handle_load_dll): Use register_loaded_dll.
+ (child_solib_add): Distinguish between active process and core targets.
+ (solib_symbols_add): Load symbols from loaded dll.
+ (core_dll_symbols_add): New function. Load symbols from dll referenced
+ in core.
+ (core_section_load_dll_symbols): New function.
+ (dll_code_sections_add): New function.
+ (map_single_dll_code_section): New function.
+ (fetch_elf_core_registers): New function.
+ (_initialize_core_win32): New function.
+
+2000-08-26 Kevin Buettner <kevinb@redhat.com>
+
+ * gdbserver/gdbreplay.c (main): Protoize.
+ * gdbserver/server.c (start_inferior, main): Protoize.
+
+2000-08-26 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_register_names): Update name of registers.
+ (m68hc11_get_register_info): New function.
+ (m68hc11_initialize_register_info): New function to get addresses
+ of soft registers.
+ (m68hc11_which_soft_register): New function.
+ (m68hc11_fetch_pseudo_register, m68hc11_store_pseudo_register):
+ New functions to translate read/write of soft registers into a
+ memory read/write.
+ (m68hc11_guess_from_prologue): Initialize soft register addresses.
+ Use the soft register addresses to guess the prologue.
+ (m68hc11_gdbarch_init): Install the pseudo registers.
+
+ * m68hc11-tdep.c (m68hc11_register_name, m68hc11_breakpoint_from_pc,
+ m68hc11_saved_pc_after_call, m68hc11_frame_saved_pc,
+ m68hc11_frame_args_address, m68hc11_frame_locals_address,
+ m68hc11_guess_from_prologue, m68hc11_push_arguments,
+ m68hc11_call_dummy_address, m68hc11_call_dymmy_address,
+ m68hc11_register_virtual_type, m68hc11_store_struct_return,
+ m68hc11_store_return_value, m68hc11_extract_return_value,
+ m68hc11_use_struct_convention, m68hc11_return_value_on_stack,
+ m68hc11_extract_struct_value_address, m68hc11_push_return_address,
+ m68hc11_register_byte, m68hc11_register_raw_size,
+ m68hc11_gdbarch_init): New functions for multi-arch support.
+ (m68hc11_not_yet): Remove.
+
+Fri Aug 25 16:57:05 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * regcache.c (register_changed): New function.
+ * value.h: Declare it.
+
+Fri Aug 25 12:11:21 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * symtab.c (search_symbols): Fix off by one error in index for
+ initializing variables ourtype, ourtype2, ourtype3, and ourtype4.
+ (symtab_symbol_info): fix similar off by one error.
+
+Fri Aug 25 12:03:15 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * gdbarch.sh (TARGET_ADDR_BIT): New macro for the number
+ of bits in gdb's representation of a target address.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * gdbtypes.c (build_gdbtypes): Use TARGET_ADDR_BIT instead of
+ TARGET_PTR_BIT when initializing builtin_type_CORE_ADDR.
+ * printcmd.c (print_address_numeric): Use TARGET_ADDR_BIT instead
+ of TARGET_PTR_BIT, because we're printing an address, not a pointer.
+
+2000-08-25 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * Makefile.in: add rules to compile and link pascal specific files.
+ * config/djgpp/fnchange.lst: add substitution for p-exp.tab.c.
+
+2000-08-20 Michael Chastain <chastain@redhat.com>
+
+ * remote.c (read_frame): Handle SERIAL_TIMEOUT while reading
+ checksum.
+
+2000-08-23 Kevin Buettner <kevinb@redhat.com>
+
+ * dstread.c (dst_symfile_offsets): Protoize.
+ * fork-child.c (fork_inferior): Protoize.
+
+2000-08-21 Kevin Buettner <kevinb@redhat.com>
+
+ * dbxread (dbx_symfile_read, process_later): Protoize.
+ * dsrec.c (load_srec): Protoize.
+
+2000-08-18 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Check arches->gdbarch and not
+ current_gdbarch for a match.
+
+2000-08-18 J.T. Conklin <jtc@redback.com>
+
+ * MAINTAINERS: Add myself as dcache.c maintainer.
+
+ * remote-nindy.c (nindy_load): Invalidate dcache.
+
+ * dcache.c (dcache_invd): Renamed from dcache_flush. The term
+ flush with respect to caches usually implies that data will be
+ written to memory.
+ (dcache_init, dcache_xfer_memory): Updated.
+ * monitor.c (flush_monitor_dcache, monitor_resume, monitor_load):
+ Updated.
+ * ocd.c (ocd_open, ocd_resume, bdm_reset_command): Updated.
+ * remote-bug.c (bug_load, bug_resume): Updated.
+ * remote-nindy.c (nindy_open, nindy_resume): Updated.
+ * remote-sds.c (sds_open, sds_resume): Updated.
+ * remote-utils.c (gr_open): Updated.
+ * remote.c (remote_open_1, remote_resume, remote_async_resume,
+ remote_cisco_open): Updated.
+ * wince.c (child_create_inferior, child_resume): Updated.
+
+ * monitor.c (monitor_open): Free dcache before creating a new one.
+ * dcache.c (dcache_free): New function.
+ * dcache.h (dcache_free): New prototype.
+
+2000-08-18 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * remote-array.c (array_fetch_register): Pass dummy parameter to
+ array_fetch_registers.
+ (array_store_register): Ditto.
+
+2000-08-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * value.h (struct value) <lazy>: Add a comment about its use for
+ watchpoints.
+
+2000-08-12 Kevin Buettner <kevinb@redhat.com>
+
+ * cxux-nat.c (fetch_inferior_registers): Protoize.
+ * d10v-tdep.c (d10v_frame_chain_valid, d10v_extract_return_value):
+ Protoize.
+ * d30v-tdep.c (d30v_frame_chain_valid, d30v_extract_return_value):
+ Protoize.
+
+Fri Aug 11 19:00:51 2000 Andrew Cagney <cagney@makita.cygnus.com>
+
+ * config/mn10300/tm-mn10300.h (REGISTER_SIZE,
+ MAX_REGISTER_RAW_SIZE, REGISTER_VIRTUAL_TYPE, REGISTER_BYTE,
+ REGISTER_VIRTUAL_SIZE, REGISTER_RAW_SIZE): Disable.
+ * mn10300-tdep.c (mn10300_do_registers_info,
+ mn10300_print_register): New functions. Pretty print registers.
+ (mn10300_register_virtual_type, mn10300_register_byte,
+ mn10300_register_virtual_size, mn10300_register_raw_size): New
+ functions.
+ (mn10300_gdbarch_init): Update.
+
+ * mn10300-tdep.c (mn10300_gdbarch_init): Check for mn10300 variant
+ and not mips variant in the info struct.
+
+2000-08-11 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c [! HAVE_PTRACE_GETFPXREGS] (fetch_fpxregs,
+ store_fpxregs): Return 0.
+
+2000-08-11 Andrew Cagney <cagney@lulu.cygnus.com>
+
+ * regcache.c (GET_SAVED_REGISTER): Restore definition. Was lost
+ as part of 2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>.
+
+2000-08-11 J.T. Conklin <jtc@redback.com>
+
+ * dcache.c (dcache_info): Don't print cache state if last_cache
+ is NULL.
+
+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * config/mn10300/tm-mn10300.h, mn10300-tdep.c
+ (mn10300_push_arguments): Fix function signature to match gdbarch
+ vector.
+ * config/mn10300/tm-mn10300.h (REGISTER_NAME): Delete.
+ * mn10300-tdep.c (struct gdbarch_tdep): Define.
+ (mn10300_generic_register_names, am33_register_names): Convert to
+ functions.
+ (set_machine_hook): Delete.
+ (register_name): New function.
+ (mn10300_register_name): Delete.
+ (mn10300_dump_tdep, mn10300_gdbarch_init): New functions.
+ (_initialize_mn10300_tdep): Call register_gdbarch_init instead of
+ specify_exec_file_hook.
+ (AM33_MODE): Define.
+ (set_movm_offsets): Update.
+
+2000-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ Adapt support for SSE registers in Linux/x86 for Linux 2.4.
+ * i386-linux-nat.c: Various doc fixes. Include "i387-nat.h".
+ (GETFPXREGS_SUPPLIES): Renamed from GETXFPREGS_SUPPLIES.
+ (have_ptrace_getfpxregs): Renamed from have_ptrace_getxfpregs.
+ (convert_to_gregset): Removed. Moved logic to ...
+ (fill_gregset): ... here. Simplified function.
+ (fetch_regs): Use perror_with_name for error reporting.
+ (store_regs): Add `regno' parameter. Use perror_with_name for
+ error reporting. Call fill_gregset instead of convert_to_gregset.
+ (FPREG_ADDR): Remove.
+ (supply_fpregset): Implement by calling i387_supply_fsave.
+ (convert_to_fpregset): Remove.
+ (fill_fpregset): Implement by calling i387_fill_fsave.
+ (fetch_fpregs): Use perror_with_name fro error reporting.
+ (store_fpregs) Add `regno' parameter. Use perror_with_name fro
+ error reporting. Call fill_fpregset instead of
+ convert_to_fpregset.
+ (supply_xfpregset, convert_to_xfpregset): Removed.
+ (supply_fpxregset, fill_fpxregset): New functions.
+ (fetch_fpxregs): Renamed from fetch_xfpregs. Use perror_with_name
+ for error reporting. Call supply_fpxregset instead of
+ supply_xfpregset.
+ (store_xfpregs): Removed.
+ (store_fpxregs): New function.
+ (fetch_inferior_registers): Adjust for xfp -> fpx change. Tweak
+ message in call to internal_error.
+ (store_inferior_registers): Adjust for xfp ->fpx change. Pass
+ REGNO to store_regs, store_fpregs and store_fpxregs.
+ (fetch_core_registers): Adjust for xfp -> fpx change.
+ * acconfig.h (HAVE_PTRACE_GETFPXREGS): Renamed from
+ HAVE_PTRACE_GETXFPREGS.
+ * config.in: Regenerated.
+ * configure.in: Replace check for PTRACE_GETXFPREGS with check for
+ PTRACE_GETFPXREGS. Remove comment about Cygnus SSE extensions.
+ * configure: Regenerated.
+ * config/i386/linux.mh (NATDEPFILES): Add i387-nat.o.
+ * config/i386/tm-linux.h: Base definition of HAVE_SSE_REGS on
+ HAVE_PTRACE_GETFPXREGS instead of HAVE_PTRACE_GETXFPREGS.
+
+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * regcache.c (TARGET_WRITE_PC, TARGET_READ_PC, TARGET_READ_FP,
+ TARGET_WRITE_FP, TARGET_READ_SP, TARGET_WRITE_SP): Move
+ initialization from here.
+ * gdbarch.sh: To here.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+Thu Aug 10 18:58:04 2000 Andrew Cagney <cagney@makita.cygnus.com>
+
+ * defs.h (TARGET_BFD_VMA_BIT, TARGET_SHORT_BIT, TARGET_INT_BIT,
+ TARGET_LONG_BIT, TARGET_LONG_LONG_BIT, TARGET_FLOAT_BIT,
+ TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_PTR_BIT): Move
+ non- multi-arch handling from here.
+ * gdbarch.sh: To here. Update printf gdbarch_update_p. Make more
+ portable.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * partial-stab.h (DBX_READ): Eliminate redundant check for null
+ ``pst''. Also fixes GCC warning.
+
+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * rs6000-nat.c (set_host_arch): Check value returned by
+ gdbarch_update_p.
+ * gdbarch.sh (gdbarch_update_p): Rename gdbarch_update.
+ * gdbarch.h, gdbarch.c: Regenerate
+ * arch-utils.c (set_gdbarch_from_file,
+ initialize_current_architecture, set_endian): Update.
+
+2000-08-10 Jimmy Guo <guo@cup.hp.com>
+
+ * c-lang.c: Set case sensitivity on for c_language_defn,
+ cplus_language_defn, and asm_language_defn.
+ * ch-lang.c: Set case sensitivity on for chill_language_defn.
+ * f-lang.c: Set case sensivitity off for f_language_defn.
+ * jv-lang.c: Set case sensitivity on for java_language_defn.
+ * language.h: Add enum case_mode, case_sensitivity.
+ * language.c: Define case_mode, case_sensitivity. Set case
+ sensitivity on for unknown_language_defn, auto_language_defn,
+ and local_language_defn.
+ (show_case_command,set_case_command,set_case_str): New static func.
+ (set_type_range_case): New static func, replaces set_type_range ().
+ (set_language_command,set_type_command,set_range_command,set_language):
+ Call set_type_range_case ().
+ (language_info): Print case sensitivity setting.
+ (_initialize_language): Add set/show commands for 'case-sensitive'.
+ Set default case mode 'auto'. Set default language 'auto'.
+ * m2-lang.c: Set case sensitivity on for m2_language_defn.
+ * p-lang.c: Set case sensitivity on for pascal_language_defn.
+ * scm-lang.c: Set case sensitivity off for scm_language_defn.
+ * symtab.c (lookup_symbol): Downcase symbol name if case sensivitity
+ is off.
+
+2000-08-10 Jimmy Guo <guo@cup.hp.com>
+
+ * MAINTAINERS: Change my contact email for hp tests maintainership.
+
+Thu Aug 10 15:28:17 2000 Andrew Cagney <cagney@ryobi.cygnus.com>
+
+ * sparc-tdep.c (sparc_init_extra_frame_info): Fix number of
+ arguments to fetch_instruction.
+
+2000-08-10 Kazu Hirata <kazu@hxi.com>
+
+ * hppa_tdep.c: Fix a comment typo.
+ * gdba.el: Likewise.
+
+2000-08-10 Tom Tromey <tromey@cygnus.com>
+
+ * MAINTAINERS: Added myself with write-after-approval access.
+
+2000-08-10 J.T. Conklin <jtc@redback.com>
+
+ * monitor.c (monitor_open): If a dcache has already been created,
+ invalidate it rather than creating another.
+ * ocd.c (ocd_open): Likewise.
+ * remote-nindy.c (nindy_open): Likewise.
+ * remote-sds.c (sds_open): Likewise.
+ * remote-utils.c (gr_open): Likewise.
+ * remote.c (remote_open_1, remote_cisco_open): Likewise.
+
+ * dcache.c (dcache_alloc): Changed to take address of line as an
+ argument, and to invalidate cache line before returning.
+ (dcache_peek_byte): Updated.
+ (dcache_poke_byte): Updated.
+
+2000-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Greg McGary <greg@mcgary.org>:
+ * partial-stab.h: Don't crash if pst is null.
+
+2000-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-nat.h (i387_supply_fsave, i387_fill_fsave): Make extern.
+ (i387_supply_fxsave, i387_fill_fxsave): New prototypes.
+ * i387-nat.c (i387_supply_fsave): Declare `val' as `unsigned int'.
+ (fxsave_offset): New variable.
+ (FXSAVE_ADDR): New macro.
+ (i387_supply_fxsave, i387_fill_fxsave, i387_tag): New functions.
+
+2000-08-08 Tom Tromey <tromey@cygnus.com>
+
+ * jv-valprint.c (java_value_print): Only print non-null Strings.
+
+2000-08-09 Kevin Buettner <kevinb@redhat.com>
+
+ * core-sol2.c (fetch_core_registers): Protoize; add prefatory
+ comment.
+ * corefile.c (specify_exec_file_hook, generic_search): Protoize.
+
+2000-08-09 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * blockframe.c (sigtramp_saved_pc): Use dynamic allocation,
+ since TARGET_PTR_BIT is no longer a constant (MULTI_ARCH).
+ * irix4-nat.c (get_longjmp_target): Ditto.
+ * irix5-nat.c (get_longjmp_target): Ditto.
+ * jv-valprint.c (java_value_print): Ditto.
+ * m3-nat.c (get_cprocs): Ditto.
+ * m68k-tdep.c (get_longjmp_target): Ditto.
+ * mips-nat.c (get_longjmp_target): Ditto.
+ * mipsv4-nat.c(get_longjmp_target): Ditto.
+ * pa64solib.c (read_dynamic_info): Ditto.
+ * solib.c (elf_locate_base): Ditto.
+
+Mon Aug 7 23:21:22 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * TODO: remove build_parse entry.
+
+2000-08-07 Kevin Buettner <kevinb@redhat.com>
+
+ * command.c (add_cmd, add_abbrev_cmd, add_prefix_cmd,
+ add_abbrev_prefix_cmd): Protoize.
+
+2000-08-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * objfiles.h (SECT_OFF_BSS): Don't detect invalid sect_index_bss
+ here, let the users of the macro do it.
+ * symtab.h (ANOFFSET): Detect here if the section index is not
+ initialized.
+ * xcoffread.c (find_targ_sec): Don't treat .bss as special,
+ because some objfiles may not have that section at all.
+ * coffread.c (cs_to_section): Ditto.
+ * elfread.c (elf_symtab_read): Detect an uninitialized index
+ value.
+ (elfstab_offset_sections): The macro ANOFFSET cannot be used as an
+ lvalue anymore.
+ * remote.c (get_offsets, remote_cisco_objfile_relocate): Don't use
+ ANOFFSET as an lvalue.
+ * objfiles.c (objfile_relocate, objfile_relocate): Don't use
+ ANOFFSET as an lvalue.
+ * symfile.c (default_symfile_offsets): Don't use ANOFFSET as an
+ lvalue.
+
+Mon Aug 7 10:24:30 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * parse.c (build_parse): don't write off the end of the std_regs
+ array.
+
+2000-05-21 Mark Kettenis <kettenis@gnu.org>
+
+ * solib.c (bfd_lookup_symbol): Fall back on the dynamic symbol
+ table if the symbol couldn't be found in the normal symbol table
+ (i.e. if the shared object in question was stripped).
+
+2000-08-06 Kevin Buettner <kevinb@redhat.com>
+
+ * ch-exp.c (parse_opt_name_string): Protoize. [Thanks to Eli
+ Zaretskii for the prefatory comment.]
+ * core-regset.c (fetch_core_registers): Protoize; revise
+ comment.
+
+2000-08-06 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Perform various gcc warning cleanups.
+ (safe_symbol_file_add_cleanup): Reset stdout to saved stdout, not
+ stderr.
+ (dll_symbol_command): Pass OBJF_USERLOADED to safe_symbol_file_add.
+ (get_child_debug_event): Always reset last_sig. Always reset inferior
+ pid appropriately.
+ (do_initial_child_stuff): New function. Called when attaching or
+ starting a new inferior process.
+ (child_attach): Use do_initial_child_stuff.
+ (child_create_inferior): Ditto.
+ * config/i386/cygwin.mh (NAT_FILE): Set to modern location.
+ * config/i386/tm-cygwin.h: Define ATTACH_NO_WAIT.
+
+2000-08-05 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c: (go32_wait): If child_cwd[] is empty, initialize
+ it to GDB's current directory.
+ (go32_create_inferior, init_go32_ops): Initialize child_cwd[] to
+ an empty string, to signal an uninitialized value.
+ From Robert Hoehne <robert.hoehne@gmx.net>.
+
+2000-08-04 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.h (fixup_psymbol_section): Declare.
+ * symtab.c (fixup_psymbol_section): Make extern.
+ (fixup_section): Fix up section as well as bfd_section.
+ * objfiles.c (objfile_relocate): Call fixup_symbol_section
+ or fixup_psymbol_section before attempting to access
+ the SYMBOL_SECTION component of a symbol or partial symbol.
+
+2000-08-04 Kevin Buettner <kevinb@redhat.com>
+
+ * minsyms.c (build_minimal_symbol_hash_tables): New function.
+ (compact_minimal_symbols): Don't construct hash tables here.
+ (install_minimal_symbols): Instead, construct them here.
+ (msymbols_sort): And rebuild them here too.
+
+ * dwarf2read.c (struct comp_unit_head): Add fields offset_size
+ and initial_length_size. Change type of ``length'' field to long.
+ (read_initial_length, read_offset): New functions.
+ (dwarf2_build_psymtabs_easy): Call read_initial_length() instead
+ of just reading 4 bytes.
+ (read_comp_unit_head): Likewise; also, call read_offset() to
+ fetch the offset instead of just reading 4 bytes.
+ (dwarf_decode_lines): Likewise.
+ (read_comp_unit_head): Fix internal error message so it
+ accurately reflects the function in which the error occurred.
+ (dwarf2_build_psymtabs_hard): Properly account for size of the
+ initial length field in the section.
+ (read_attribute, dwarf2_get_ref_die_offset): Add a case for
+ DW_ORM_ref8.
+ (dwarf2_build_psymtabs_hard, psymtabs_to_symtab_1): Don't
+ assume that the .text section will have index 0 in the
+ section_offsets table.
+
+Fri Aug 4 18:00:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (enum Z_packet_type): Define.
+ (remote_protocol_Z): Change to an array of size NR_Z_PACKET_TYPES.
+ (remote_insert_watchpoint): Check watchpoint type.
+ (watchpoint_to_Z_packet): New function.
+ (enum packet_result): Define.
+ (packet_ok): New function. Return enum packet_result.
+ (init_all_packet_configs): New function.
+ (remote_open_1, remote_async_open_1, remote_cisco_open): Use
+ init_all_packet_configs instead of initializing remote_protocol_P,
+ remote_protocol_Z, remote_protocol_binary_download separatly.
+ (remote_remove_hw_breakpoint, remote_insert_hw_breakpoint,
+ remote_remove_watchpoint, remote_insert_watchpoint): Use
+ watchpoint_to_Z_packet and packet_ok. Remove #ifdef
+ TARGET_HAS_HARDWARE_WATCHPOINTS.
+ (set_remote_protocol_Z_software_bp_packet_cmd,
+ show_remote_protocol_Z_software_bp_packet_cmd,
+ set_remote_protocol_Z_hardware_bp_packet_cmd,
+ show_remote_protocol_Z_hardware_bp_packet_cmd,
+ set_remote_protocol_Z_write_wp_packet_cmd,
+ show_remote_protocol_Z_write_wp_packet_cmd,
+ set_remote_protocol_Z_read_wp_packet_cmd,
+ show_remote_protocol_Z_read_wp_packet_cmd,
+ set_remote_protocol_Z_access_wp_packet_cmd,
+ show_remote_protocol_Z_access_wp_packet_cmd): New functions.
+ (remote_Z_packet_packet_detect): New variable.
+ (show_remote_protocol_Z_packet_cmd,
+ set_remote_protocol_Z_packet_cmd): Iterate over all ``Z'' packet
+ variants.
+ (add_packet_config_cmd): Add argument legacy. Change syntax to
+ ``set/show remote FULL_NAME-packet ...'' command. Add ``set/show
+ remote XXX-packet ...'' command using add_alias_cmd when legacy.
+ (set_packet_config_cmd): Delete.
+ (show_remote_cmd): New function.
+
+ * TODO: Update.
+
+Fri Aug 4 14:05:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (infodir, SER_HARDWIRE): Fix merge problems from
+ 2000-07-07 Michael Snyder <msnyder@cleaver.cygnus.com>.
+
+Wed Aug 2 21:15:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * valops.c (hand_function_call): Replace #ifndef
+ NO_EXTRA_ALIGNMENT_NEEDED with if EXTRA_STACK_ALIGNMENT_NEEDED.
+
+ * d10v-tdep.c (d10v_gdbarch_init): Set
+ extra_stack_alignment_needed to 0.
+ * config/d10v/tm-d10v.h (NO_EXTRA_ALIGNMENT_NEEDED): Delete.
+ * config/pa/tm-hppa.h (EXTRA_STACK_ALIGNMENT_NEEDED): Replace
+ NO_EXTRA_ALIGNMENT_NEEDED.
+
+2000-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * MAINTAINERS (m68hc11): Stephane Carrez is maintainer.
+
+2000-08-03 Kevin Buettner <kevinb@redhat.com>
+
+ * breakpoint.c (bpstat_alloc, map_catch_names,
+ map_breakpoint_numbers): Protoize.
+
+Thu Aug 3 15:02:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-mips.c (mips_expect, mips_expect_timeout, common_open,
+ fputs_readable): Make string pointer arguments constant.
+
+Thu Aug 3 18:39:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS, TODO: Tweeks.
+
+Thu Aug 3 15:46:43 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO (5.1): Update.
+
+2000-08-02 Kevin Buettner <kevinb@redhat.com>
+
+ * alpha-tdep.c (alpha_extract_return_value): Protoize.
+
+2000-08-02 Jimmy Guo <guo@hpcleara.cup.hp.com>
+
+ * gdbarch.sh: Add print_p field for CALL_DUMMY_BREAKPINT_OFFSET
+ to be printed only if CALL_DUMMY_BREAKPOINT_OFFSET_P.
+
+ * gdbarch.c: Regenerated.
+
+2000-08-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote-vx.c (vx_add_symbols): Fix typos.
+
+Wed Aug 2 19:15:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arch-utils.h, gdbarch.c (default_register_sim_regno): New
+ function.
+ * gdbarch.sh (REGISTER_SIM_REGNO): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * remote-sim.c (REGISTER_SIM_REGNO): Delete definition.
+
+ * config/d10v/tm-d10v.h (REGISTER_SIM_REGNO): Delete.
+ * d10v-tdep.c (d10v_gdbarch_init): Update.
+ (struct gdbarch_tdep): Delete member register_sim_regno.
+ (d10v_register_sim_regno): Delete function.
+
+Wed Aug 2 14:46:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (enum packet_detect, packet_support_enums,
+ packet_support_auto, packet_enable, packet_disable): Delete.
+ (show_packet_config_cmd, set_packet_config_cmd,
+ init_packet_config): Use add_set_auto_boolean_cmd.
+ * TODO: Update.
+
+Wed Aug 2 13:06:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-udi.c (udi_xfer_inferior_memory, udi_files_info,
+ udi_kill): Update function signatures so that match target vector.
+ * MAINTAINERS: Update.
+
+Wed Aug 2 11:04:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Updates.
+
+2000-08-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbarch.sh: Multiarch DO_REGISTERS_INFO macro.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * infcmd.c (do_registers_info): Make not static and
+ unconditionalize.
+ * inferior.h (do_registers_info): Export.
+
+2000-08-01 Kazu Hirata <kazu@hxi.com>
+
+ * MAINTAINERS: Add myself to "Write After Approval" list.
+
+Tue Aug 1 21:02:42 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Update list of target maintainers. List all
+ targets explicitly.
+ (sh): Elena Zannoni is maintainer.
+ (powerpc): Nick Duffek is a maintainer.
+
+Tue Aug 1 17:45:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Parse and save comments in the function_list. Print
+ them out as part of the header. Convert all function definitions
+ to ISO-C form.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+Tue Aug 1 14:50:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (get_prompt_1), tracepoint.c (replace_comma): Update
+ function signatures so that they match catch_errors and
+ make_cleanup callbacks.
+
+ * tracepoint.c (encode_actions): Fix arguments passed to
+ stringify_collection_list.
+
+2000-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-tdep.h: New file.
+ * Makefile.in (ppc-linux-tdep.o, rs6000-tdep.o): Add ppc-tdep.h
+ as a dependency.
+ * ppc-linux-tdep.c, rs6000-tdep.c (ppc-tdep.h): Include.
+
+ * ppc-linux-tdep.c (ppc_linux_at_sigtramp_return_path): Made static.
+
+ * rs6000-tdep.c (elf-bfd.h): Include.
+ (gdbarch_tdep): Add field osabi to this struct.
+ (rs6000_init_extra_frame_info, rs6000_frame_init_saved_regs,
+ rs6000_frameless_function_invocation, rs6000_frame_saved_pc,
+ rs6000_frame_chain): No longer static.
+ (process_note_abi_tag_sections, get_elfosabi): New static
+ functions.
+ (rs6000_gdbarch_init): Revised to accomodate ELF executables;
+ also use Linux specific methods when the target is Linux.
+
+ * config/powerpc/aix.mt, config/powerpc/cygwin.mt,
+ config/powerpc/macos.mt, config/powerpc/nbsd.mt,
+ config/powerpc/ppc-eabi.mt, config/powerpc/ppc-nw.mt,
+ config/powerpc/ppc-sim.mt, config/powerpc/ppcle-eabi.mt,
+ config/powerpc/ppcle-sim.mt, config/powerpc/solaris.mt,
+ config/powerpc/vxworks.mt, config/rs6000/aix4.mt,
+ config/rs6000/rs6000.mt, config/rs6000/rs6000lynx.mt
+ (TDEPFILES): Add ppc-linux-tdep.o.
+
+ * config/tm-linux.h (SIGCONTEXT_PC_OFFSET, FRAME_SAVED_PC,
+ INIT_EXTRA_FRAME_INFO, FRAMELESS_FUNCTION_INVOCATION,
+ FRAME_INIT_SAVED_REGS, FRAME_CHAIN, PUSH_ARGUMENTS,
+ MEMORY_REMOVE_BREAKPOINT: Removed defines.
+ (ppc_linux_frame_saved_pc, ppc_linux_init_extra_frame_info,
+ ppc_linux_frameless_function_invocation,
+ ppc_linux_frame_init_saved_regs, ppc_linux_frame_chain,
+ ppc_sysv_abi_push_arguments, ppc_linux_memory_remove_breakpoint):
+ Removed declarations.
+ (CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Disabled.
+
+ * dink32-rom.c (dink32_regnames): Make array size implicit.
+
+ * ppc-bdm.h (ppc-tdep.h): Include.
+
+ * rs6000-tdep.c, ppc-linux-tdep.c, ppc-bdm.h, ppc-tdep.h
+ (GP0_REGNUM, TOC_REGNUM, PS_REGNUM, CR_REGNUM, LR_REGNUM,
+ CTR_REGNUM, XER_REGNUM, MQ_REGNUM): Add PPC_ prefix.
+
+ From Nick Duffek:
+ * ppc-tdep.h (ppc_linux_frame_saved_pc, rs6000_frame_saved_pc):
+ Change return type to CORE_ADDR.
+ * ppc-linux-tdep.c (ppc_linux_frame_saved_pc): Likewise.
+
+2000-07-31 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_push_arguments): Make header match prototype.
+
+ * remote-e7000.c (e7000_start_remote): Use void *, not char * as
+ parameter to avoid compiler warning.
+ (fetch_regs_from_dump): Call get_hex() with the correct number of
+ parameters.
+
+2000-07-31 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Add file mappings as per last weekly
+ snapshot.
+
+2000-07-29 Kevin Buettner <kevinb@redhat.com>
+
+ * a29k-tdep.c, a68v-nat.c, abug-rom.c, alpha-nat.c,
+ alpha-tdep.c, annotate.c, arc-tdep.c, arch-utils.c, ax-gdb.c,
+ ax-general.c, blockframe.c, breakpoint.c, buildsym.c,
+ c-lang.c, c-typeprint.c, c-valprint.c, ch-exp.c, ch-lang.c,
+ ch-typeprint.c, ch-valprint.c, cli-out.c, coff-solib.c,
+ coffread.c, command.c, complaints.c, copying.c, core-aout.c,
+ core-regset.c, core-sol2.c, corefile.c, corelow.c,
+ cp-valprint.c, cpu32bug-rom.c, cxux-nat.c, d10v-tdep.c,
+ d30v-tdep.c, dbug-rom.c, dbxread.c, dcache.c, delta68-nat.c,
+ demangle.c, dink32-rom.c, dpx2-nat.c, dsrec.c, dstread.c,
+ dve3900-rom.c, dwarf2read.c, dwarfread.c, elfread.c,
+ environ.c, eval.c, event-top.c, exec.c, expprint.c, f-lang.c,
+ f-typeprint.c, f-valprint.c, findvar.c, fork-child.c,
+ fr30-tdep.c, gdbarch.c, gdbserver/gdbreplay.c,
+ gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
+ gdbserver/low-lynx.c, gdbserver/low-nbsd.c,
+ gdbserver/low-sim.c, gdbserver/low-sparc.c,
+ gdbserver/low-sun3.c, gdbserver/remote-utils.c,
+ gdbserver/utils.c, gdbtypes.c, gnu-nat.c, h8300-tdep.c,
+ h8500-tdep.c, hp-psymtab-read.c, hp-symtab-read.c,
+ hp300ux-nat.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c,
+ hppam3-nat.c, hpread.c, hpux-thread.c, i386-linux-nat.c,
+ i386-stub.c, i386-tdep.c, i386aix-nat.c, i386b-nat.c,
+ i386ly-tdep.c, i386m3-nat.c, i386mach-nat.c, i386nbsd-nat.c,
+ i386v-nat.c, i386v4-nat.c, i387-tdep.c, i960-tdep.c,
+ ia64-linux-nat.c, ia64-tdep.c, infcmd.c, inflow.c,
+ infptrace.c, infrun.c, inftarg.c, infttrace.c, irix4-nat.c,
+ irix5-nat.c, jv-lang.c, jv-typeprint.c, jv-valprint.c,
+ kdb-start.c, kod-cisco.c, kod.c, language.c, lin-thread.c,
+ linux-thread.c, lynx-nat.c, m2-lang.c, m2-typeprint.c,
+ m2-valprint.c, m3-nat.c, m32r-rom.c, m32r-stub.c, m32r-tdep.c,
+ m68hc11-tdep.c, m68k-stub.c, m68k-tdep.c, m68klinux-nat.c,
+ m68knbsd-nat.c, m88k-nat.c, m88k-tdep.c, mac-nat.c,
+ mac-xdep.c, maint.c, mcore-rom.c, mcore-tdep.c, mdebugread.c,
+ mem-break.c, mi/mi-cmds.c, mi/mi-main.c, mi/mi-out.c,
+ mi/mi-parse.c, minsyms.c, mips-nat.c, mips-tdep.c,
+ mipsm3-nat.c, mipsread.c, mipsv4-nat.c, mn10200-tdep.c,
+ mn10300-tdep.c, mon960-rom.c, monitor.c, news-xdep.c,
+ nindy-tdep.c, nlm/gdbserve.c, nlm/i386.c, nlm/ppc.c,
+ nlmread.c, ns32k-tdep.c, ns32km3-nat.c, ns32knbsd-nat.c,
+ objfiles.c, ocd.c, op50-rom.c, os9kread.c, osfsolib.c,
+ p-lang.c, p-typeprint.c, p-valprint.c, pa64solib.c, parse.c,
+ ppc-bdm.c, ppc-linux-nat.c, ppc-linux-tdep.c, ppcbug-rom.c,
+ ppcnbsd-nat.c, printcmd.c, proc-api.c, proc-events.c,
+ proc-flags.c, proc-why.c, procfs.c, ptx4-nat.c,
+ remote-adapt.c, remote-array.c, remote-bug.c, remote-e7000.c,
+ remote-eb.c, remote-es.c, remote-est.c, remote-hms.c,
+ remote-mips.c, remote-mm.c, remote-nindy.c, remote-nrom.c,
+ remote-os9k.c, remote-rdi.c, remote-rdp.c, remote-sds.c,
+ remote-sim.c, remote-st.c, remote-udi.c, remote-utils.c,
+ remote-vx.c, remote-vx29k.c, remote-vx68.c, remote-vx960.c,
+ remote-vxmips.c, remote-vxsparc.c, remote.c, rom68k-rom.c,
+ rs6000-tdep.c, scm-exp.c, scm-lang.c, scm-valprint.c,
+ ser-e7kpc.c, ser-go32.c, ser-mac.c, ser-ocd.c, ser-unix.c,
+ sh-stub.c, sh-tdep.c, sh3-rom.c, sol-thread.c, solib.c,
+ somread.c, somsolib.c, source.c, sparc-nat.c, sparc-stub.c,
+ sparc-tdep.c, sparcl-stub.c, sparcl-tdep.c, sparclet-rom.c,
+ sparclet-stub.c, stabsread.c, stack.c, standalone.c,
+ stop-gdb.c, stuff.c, sun3-nat.c, sun386-nat.c, symfile.c,
+ symm-nat.c, symm-tdep.c, symmisc.c, symtab.c, target.c,
+ thread.c, tic80-tdep.c, top.c, tracepoint.c, tui/tui-file.c,
+ tui/tui.c, tui/tuiLayout.c, tui/tuiRegs.c, tui/tuiStack.c,
+ tui/tuiWin.c, typeprint.c, ui-file.c, ui-out.c, ultra3-nat.c,
+ ultra3-xdep.c, umax-xdep.c, utils.c, v850-tdep.c, v850ice.c,
+ valarith.c, valops.c, valprint.c, values.c, varobj.c,
+ vax-tdep.c, w65-tdep.c, w89k-rom.c, win32-nat.c, wince.c,
+ wrapper.c, xcoffread.c, xcoffsolib.c, xmodem.c, z8k-tdep.c:
+ Convert old-style, pre-ISO function definitions to prototyped
+ form.
+
+2000-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_gdbarch_init): For sh4 initialize
+ register_convert_to_raw, register_convert_to_virtual,
+ register_convertible.
+ (sh_sh4_register_convertible): New function.
+ (sh_sh4_register_convert_to_virtual): New function.
+ (sh_sh4_register_convert_to_raw): New function.
+ Include floatformat.h.
+
+Thu Jul 27 14:06:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
+ * configure.tgt: Recognize the 68hc11.
+ * m68hc11-tdep.c: New file for 68hc11 target.
+ * config/m68hc11/m68hc11.mt: New file for 68hc11 port.
+
+ * configure.tgt: When 68hc11, set gdb_multi_arch.
+
+Wed Jul 26 17:22:53 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (GDB_MULTI_ARCH): Define from configure.tgt
+ or makefile fragment.
+ * acconfig.h (GDB_MULTI_ARCH): Add.
+ * config.in, configure: Regenerate.
+
+ * gdbarch.sh (GDB_MULTI_ARCH): Delete definition, moved to
+ configure.in and defs.h. Use GDB_MULTI_ARCH_TM,
+ GDB_MULTI_ARCH_PARTIAL and GDB_MULTI_ARCH_PURE in tests.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * defs.h (GDB_MULTI_ARCH_PARTIAL, GDB_MULTI_ARCH_TM, ,
+ GDB_MULTI_ARCH_PURE): Define. Only include "tm.h" when the target
+ is less than pure multi-arch.
+
+2000-07-26 Jimmy Guo <guo@cup.hp.com>
+
+ * config/convex/tm-convex.h: Remove stray control characters.
+ * config/m68k/tm-altos.h: Ditto.
+ * config/tahoe/tm-tahoe.h: Ditto.
+
+2000-07-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_sh4_register_name, sh_sh4_register_byte,
+ sh_sh4_register_raw_size, sh_sh4_register_virtual_type,
+ sh_fetch_pseudo_register, sh_store_pseudo_register,
+ sh_do_pseudo_register, sh_gdbarch_init): Fix names for pseudoregs,
+ they should be numbered as drx fvy where x and y are multiples of
+ 2 and 4 respectively.
+
+ * config/sh/tm-sh.h: Fix names of pseudo regs.
+
+2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/sh/tm-sh.h (struct gdbarch_tdep): Add sh4 specific
+ pseudo registers.
+ (DO_REGISTERS_INFO): Define.
+
+ * sh-tdep.c (sh_sh4_register_name): New function.
+ (sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
+ sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): Update
+ signature.
+ (sh_show_regs_command): New function. Actual function called by
+ the 'regs' command.
+ (sh_register_byte): Rename to...
+ (sh_default_register_byte): ...New function.
+ (sh_sh4_register_byte): New function.
+ (sh_register_raw_size): Rename to...
+ (sh_default_register_raw_size): ...New function.
+ (sh_sh4_register_raw_size): New function.
+ (sh_sh4_register_virtual_type): New function.
+ (sh_sh4_build_float_register_type): New function.
+ (sh_fetch_pseudo_register, sh_store_pseudo_register): New
+ functions.
+ (fv_reg_base_num, dr_reg_base_num): New functions.
+ (do_fv_register_info, do_dr_register_info, sh_do_pseudo_register,
+ sh_do_fp_register, sh_do_register, sh_print_register,
+ sh_do_registers_info): New functions.
+ (sh_gdbarch_init): Initialize sh4 pseudo registers to -1. Update
+ architecture specific parts.
+ (_initialize_sh_tdep): Use sh_show_regs_command for 'regs' command.
+
+2000-07-24 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (read_structure_scope): Correct overzealous
+ addition of cu_header argument.
+
+Mon Jul 24 07:47:46 2000 Anthony Green <green@redhat.com>
+
+ * TODO: Update. Two of my java patches are in.
+
+2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbarch.sh: Add FETCH_PSEUDO_REGISTER and STORE_PSEUDO_REGISTER
+ to the gdbarch structure.
+ * gdbarch.c: Regenerate.
+ * gdbarch.h: Regenerate.
+ * inferior.h (FETCH_PSEUDO_REGISTER, STORE_PSEUDO_REGISTER):
+ Delete macros.
+ * regcache.c (write_register, read_register, write_register_bytes,
+ write_register_gen, read_register_bytes, read_register_gen):
+ Rename ARCH_FECTH_PSEUDO_REGISTERS to FETCH_PSEUDO_REGISTERS and
+ ARCH_STORE_PSEUDO_REGISTER to STORE_PSEUDO_REGISTER.
+
+2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbarch.sh: Add NUM_PSEUDO_REGS to the gdbarch structure.
+ * gdbarch.c: Regenerate.
+ * gdbarch.h: Regenerate.
+ * inferior.h (NUM_PSEUDO_REGS): Delete macro.
+
+Sun Jul 23 21:40:55 2000 Anthony Green <green@redhat.com>
+
+ * language.c: Include jv-lang.h.
+ (lang_bool_type): Add case for java booleans.
+
+Mon Jul 24 11:23:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c (address_size): Delete file wide global.
+ (struct comp_unit_head): Add signed_addr_p;
+ (read_comp_unit_head): New function.
+ (psymtab_to_symtab_1, dwarf2_build_psymtabs_hard): Use
+ read_comp_unit_head to parse the debug_info header.
+ (read_address): Add parameters cu_header and bytes_read. When
+ specified, sign extend the address.
+
+ * dwarf2read.c (add_partial_symbol, decode_locdesc,
+ die_containing_type, die_type, dwarf_decode_lines,
+ dwarf2_add_field, dwarf2_add_member_fn,
+ dwarf2_build_psymtabs_hard, dwarf2_const_value, new_symbol,
+ process_die, psymtab_to_symtab_1, read_array_type,
+ read_enumeration, read_attribute, read_common_block,
+ read_comp_unit, read_file_scope, read_full_die, read_func_scope,
+ read_lexical_block_scope, read_partial_die, scan_partial_symbols,
+ read_structure_scope, read_subroutine_type, read_tag_const_type,
+ read_tag_pointer_type, read_tag_ptr_to_member_type,
+ read_tag_reference_type, read_type_die, read_typedef,
+ tag_type_to_type): Pass cu_header parameter.
+
+2000-07-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * regcache.c (read_register, read_register_bytes): Fix typos.
+
+2000-07-21 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * thread.c (thread_apply_all_command): Update thread list first.
+ * printcmd.c (printf_command): Guard against 0-length string.
+ * config/i386/tm-i386.h: treat PC and FP as unsigned.
+ (SAVED_PC_AFTER_CALL): Use read_memory_unsigned_integer.
+ (FRAME_SAVED_PC): Ditto.
+ (FRAME_CHAIN): Ditto.
+
+2000-07-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * valarith.c (value_sub): Call check_typedef.
+
+2000-07-19 Nicholas Duffek <nsd@redhat.com>
+
+ * thread.c (free_thread): New function.
+ (init_thread_list): Always zero highest_thread_num. Call
+ free_thread() instead of free().
+ (delete_thread): Move thread cleanup code to free_thread().
+
+2000-07-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ Multiarch the sh target.
+ * sh-tdep.c:
+ (sh_generic_reg_names, sh_reg_names,sh3_reg_names, sh3e_reg_names,
+ sh_dsp_reg_names, sh3_dsp_reg_names, sh_processor_type_table):
+ Remove.
+ (XMALLOC): Define.
+ (struct frame_extra_info): Define.
+ (sh_register_raw_size, sh_register_virtual_size,
+ sh_register_virtual_type, sh_register_byte, sh_breakpoint_from_pc,
+ sh_frame_saved_pc, sh_skip_prologue,
+ sh_nofp_frame_init_saved_regs, sh_fp_frame_init_saved_regs,
+ sh_extract_struct_value_address, sh_use_struct_convention,
+ sh_store_struct_return, sh_push_arguments, sh_push_return_address,
+ sh_saved_pc_after_call, sh_generic_register_name,
+ sh_sh_register_name, sh_sh3_register_name, sh_sh3e_register_name,
+ sh_sh_dsp_register_name, sh_sh3_dsp_register_name,
+ sh_frame_args_address, sh_frame_locals_address,
+ sh_coerce_float_to_double, sh_default_store_return_value,
+ sh3e_sh4_store_return_value, sh_generic_show_regs,
+ sh3_show_regs,sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs,
+ sh_dsp_show_regs, sh_register_byte, sh_register_raw_size,
+ sh_register_virtual_size, sh_sh3e_register_virtual_type,
+ sh_default_register_virtual_type, sh_gdbarch_init): New functions.
+ (sh_target_architecture_hook, sh_frame_find_saved_regs,
+ sh_show_regs): Delete functions.
+ (sh_frame_chain, sh_find_callers_reg, sh_init_extra_frame_info,
+ sh_pop_frame, sh_extract_return_value): Update
+
+ * config/sh/tm-sh.h (GDB_MULTI_ARCH): Define to 1.
+ (struct gdbarch_tdep): Define.
+ Remove all unnecessary defines.
+
+ * remote-e7000.c ({PR,GBR,SR,MACL,VBR,MACH}_REGNUM): Define to -1,
+ for h8300 case.
+ (want_sh,want_nopc_sh,want_nopc_sh3): Make nomenclature
+ consistent.
+ (e7000_fetch_registers): Remove ifdef GDB_TARGET_IS_SH, use
+ runtime check instead.
+ (e7000_wait): Ditto.
+
+ * sh3-rom.c (sh3_supply_register): Use gdbarch_tdep to get the SSR
+ and SPC register numbers.
+ (sh3_regnames, sh3e_regnames): Don't specify a size.
+
+ * config/h8300/tm-h8300.h: Add comment.
+
+Wed Jul 19 12:50:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * solib.c (elf_locate_base, info_sharedlibrary_command): Rename
+ bfd_elf_get_arch_size to bfd_get_arch_size.
+
+Tue Jul 18 17:13:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Richard Henderson <rth@cygnus.com>:
+ * dwarf2read.c (dwarf2_empty_hash_tables): Renamed from
+ dwarf2_empty_die_ref_table; zero dwarf2_cached_types as well.
+ Update all callers.
+
+2000-07-17 Daniel Berlin <dberlin@redhat.com>
+
+ * valops.c (value_struct_elt): Change error message
+
+2000-07-17 matthew green <mrg@redhat.com>
+
+ * config/sparc/nm-nbsd.h (GDB_GREGSET_T, GDB_FPREGSET_T): Define.
+
+Mon Jul 17 13:08:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * values.c (value_as_pointer): When VAL is an integer, explictly
+ cast to a pointer before converting to a CORE_ADDR.
+ * gdbtypes.c (build_gdbtypes): For builtin_type_ptr, construct a
+ real void pointer instead of an integer.
+
+2000-07-15 Daniel Berlin <dberlin@redhat.com>
+
+ * valops.c (typecmp): Seperate loop into two, add support for
+ references. This way, we can say a reference to a pointer to a
+ char is compatible with a pointer to a char. Before, this would
+ not be true.
+
+2000-07-14 Nicholas Duffek <nsd@redhat.com>
+
+ * ppcbug-rom.c (ppcbug_regnames[]): Make array size implicit.
+ * rs6000-tdep.c (DEFAULT_LR_SAVE): Move to config/*/tm-*.h.
+ (rs6000_gdbarch_init): Use generic_pc_in_call_dummy instead of
+ rs6000_pc_in_call_dummy.
+ * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Move here from
+ rs6000-tdep.c.
+ * config/powerpc/tm-ppc-eabi.h: Remove various definitions
+ handled by multi-arched rs6000-tdep.c.
+
+2000-07-14 Nick Clifton <nickc@cygnus.com>
+
+ * config/mcore/tm-mcore.h (SKIP_PROLOGUE): Fix defintion to avoid
+ assignment.
+
+2000-07-13 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * parse.c: Include inferior.h.
+
+2000-07-12 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * regcache.c (registers_changed, registers_fetched): Use
+ ARCH_NUM_REGS directly, eliminating an unnecessary variable.
+
+ This change adds pseudo-register capability to GDB.
+ Pseudo-registers are handled like registers, but they
+ don't come from or live on the target. They may be
+ aliases for an existing register, or they may be computed.
+ * inferior.h (NUM_PSEUDO_REGISTERS): Define default of zero.
+ (ARCH_FETCH_PSEUDO_REGISTERS): Define default of no-op.
+ (ARCH_STORE_PSEUDO_REGISTERS): Define default of no-op.
+ # regcache.c (registers_changed): Mark pseudo-registers
+ invalid, as well as real registers.
+ (registers_fetched): Do not mark pseudo-registers as fetched
+ at the same time as other (real) registers.
+ (read_register_bytes): Fetch pseudo-registers (if any) from
+ the target architecture module instead of from the target.
+ (read_register_gen): Ditto.
+ (read_register): Ditto.
+ (write_register_bytes): Store pseudo-registers (if any) to
+ the target architecture module instead of to the target.
+ (write_register_gen): Ditto.
+ (write_register): Ditto.
+ (build_regcache): Allocate enough register_valid space for
+ pseudo-registers as well as normal (real) ones.
+ * parse.c (target_map_name_to_register): Include pseudo-regs.
+
+Tue Jul 11 19:45:42 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (value_cast): Allow cast from INT, ENUM or RANGE to
+ POINTER.
+
+2000-07-11 Scott Bambrough <scottb@netwinder.org>
+
+ * command.c (do_setshow_command): Fix typo in var_auto_boolean
+ case.
+
+Tue Jul 11 20:38:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c: General cleanup. Delete all #if 0 code. Convert
+ all old style K&R function definitions to ISO-C.
+ (struct gdbarch_tdep): Add mips_abi_string.
+ (mips_gdbarch_init): Initialize.
+ (mips_dump_tdep): Print mips_abi_string and other values.
+ (mips_push_arguments): Add more detailed tracing.
+
+Tue Jul 11 20:16:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips32_next_pc, mips16_next_pc,
+ read_next_frame_reg, mips_push_dummy_frame, mips_skip_stub,
+ mips_saved_pc_after_call): Use read_signed_register when
+ extracting register value. Ensures all addresses are sign
+ extended.
+ (mips_read_pc): New function. Return sign extended address.
+ (mips_gdbarch_init): Set gdbarch_read_pc.
+
+Tue Jul 11 19:06:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-mips.c (mips_request): Change all arguments to ULONGEST.
+ (mips_exit_debug, mips_resume, mips_initialize, mips_wait,
+ mips_fetch_registers, mips_store_registers, mips_fetch_word):
+ Update.
+ (mips_xfer_memory): When mask_address_p, mask MEMADDR down to just
+ 32 bits.
+ (_initialize_remote_mips): Add ``set mask-address'' command.
+
+ * mips-tdep.c (_initialize_mips_tdep): Replace "set mask-address"
+ with "set mips mask-address". Implement using
+ add_set_auto_boolean_cmd.
+ (struct gdbarch_tdep): Add default_mask_address_p.
+ (mips_mask_address_p, show_mask_address): New functions.
+ (mips_addr_bits_remove): Use mips_mask_address_p() to determine if
+ masking is needed.
+ (mips_gdbarch_init): Set default_mask_address_p to zero.
+ (mips_dump_tdep): Print value of mask_address_p.
+
+Tue Jul 11 18:32:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * printcmd.c (print_scalar_formatted): Move masking of 'a' address
+ from here.
+ (print_address_numeric): To here.
+ * TODO: Update.
+
+Tue Jul 11 17:50:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symtab.c: Use paddr_nz() to print addresses.
+
+Tue Jul 11 12:52:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * value.h (read_register, read_signed_register): Change return
+ type to ULONGEST.
+ (read_signed_register, read_signed_register_pid): Declare.
+
+ * regcache.c (read_register, read_register_pid): Update.
+ (read_signed_register_pid, read_signed_register): New functions.
+
+Mon Jul 10 18:06:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Always align struct_addr on a
+ 16 byte boundary. Align allocated argument space using
+ MIPS_STACK_ARGSIZE. Reserve space on stack for the struct return
+ and floating-point registers. Use fp_register_arg_p to determine
+ if float_argreg should be aligned.
+
+2000-07-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/sh/tm-sh.h (STORE_RETURN_VALUE): Redefine as
+ sh_store_return_value().
+ * sh-tdep.c (sh_store_return_value): New function. Store the
+ value returned by a function into the appropriate register.
+
+2000-07-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c (sh_skip_prologue): Before looking at the actual
+ instructions, try to see if the symbol table can be of help, by
+ calling after_prologue(). If this doesn't work, call
+ skip_prologue_hard_way().
+ (skip_prologue_hard_way): Renamed from sh_skip_prologue. Add some
+ more instruction pattern matching for pushing of arguments, and
+ manipulation of r14.
+ (after_prologue): New function. Use symbol table info to determine
+ the end of the prologue, if possible.
+
+2000-07-07 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * findvar.c (_initialize_findvar, build_findvar, write_fp, read_fp,
+ generic_target_write_fp, generic_target_read_fp, write_sp, read_sp,
+ generic_target_write_sp, generic_target_read_sp, write_pc, read_pc,
+ generic_target_write_pc, generic_target_read_pc, write_pc_pid,
+ read_pc_pid, supply_register, write_register_pid, write_register,
+ read_register_pid, read_register, write_register_bytes,
+ read_register_bytes, write_register_gen, read_register_gen,
+ registers_fetched, registers_changed, find_saved_register,
+ read_relative_register_raw_bytes, default_get_saved_register,
+ read_relative_register_raw_bytes_for_frame, get_saved_register):
+ Move from this file into new file regcache.c.
+ (register_valid, registers_pid, registers): Ditto.
+ * regcache.c: New file to hold the register cache.
+ (register_cached): New function to read register_valid array.
+ * value.h (register_cached): Declare.
+ * defs.h (default_get_saved_register): Delete decl of static function.
+ * Makefile.in: Add regcache module.
+
+Mon Jul 10 15:02:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-07-05 Pierre Muller <muller@ics.u-strasbg.fr>:
+ * p-typeprint.c (pascal_type_print_method_args): Add braces around
+ isdigit after while keyword.
+
+2000-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * TODO: Remove readline 4.1 import item.
+
+2000-07-09 Nick Duffek <nsd@redhat.com>
+
+ * gdbtypes.c (is_ancestor): Infer type equivalence from name
+ equivalence.
+ (rank_one_type): Use strcmp instead of == to compare type names.
+ Don't swap parm with arg when checking TYPE_CODE_REF types.
+ * valops.c (find_overload_match): Fix indentation. Compare
+ parameter rankings to 0..9, 10..99, and 100+ instead of 0, 10,
+ and 100.
+
+2000-07-07 David Edelsohn <edelsohn@gnu.org>
+
+ * xcoffread.c (read_symbol_nvalue): Return CORE_ADDR.
+ * rs6000-tdep.c (rs6000_pop_frame): Make addr CORE_ADDR type.
+
+Fri Jul 7 18:29:51 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mips.h (IEEE_FLOAT, SKIP_PROLOGUE,
+ SAVED_PC_AFTER_CALL, DECR_PC_AFTER_BREAK, BREAKPOINT_FROM_PC,
+ INNER_THAN): Macros.
+
+ * mips-tdep.c (mips_in_lenient_prologue): Delete function.
+ (mips32_skip_prologue, mips16_skip_prologue, mips_skip_prologue):
+ Remove ``lenient'' argument.
+ (mips_saved_pc_after_call): New function.
+ (mips_gdbarch_init): Initialize gdbarch members inner_than,
+ breakpoint_from_pc, decr_pc_after_break, ieee_float,
+ skip_prologue, saved_pc_after_call.
+
+2000-07-07 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-linux.h: Add longjmp support.
+ (JB_ELEMENT_SIZE, JB_PC): New defines.
+ (GET_LONGJMP_TARGET): Define.
+ (get_longjmp_target): Add prototype.
+
+ * breakpoint.c (bpstat_what): Keep returning
+ BPSTAT_WHAT_SET_LONGJMP_RESUME when hitting multiple longjmp()
+ breakpoints instead of signalling an error by returning
+ BPSTAT_WHAT_STOP_NOISY.
+
+2000-07-06 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * mips-tdep.c: Replace '16' with bfd_mach_mips16 where appropriate.
+
+2000-07-06 Christopher Faylor <cgf@cygnus.com>
+
+ * infcmd.c (attach_command): Move "stop_soon_quietly" setting
+ inside ATTACH_NO_WAIT conditional since we are not about to
+ stop soon if we're not calling wait_for_inferior.
+
+Wed Jul 5 21:06:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/i386/fbsd.mh (NATDEPFILES): Keep NATDEPFILES to a single
+ line. configure.in assumes this.
+
+Wed Jul 5 20:48:22 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (SER_HARDWIRE): When go32 or DJGPP, set to
+ ser-go32.c.
+ * configure: Re-generate.
+
+Wed Jul 5 20:28:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.h (command_loop_marker), top.c (command_loop_marker):
+ Delete.
+ * event-top.c (command_handler), top.c (simplified_command_loop,
+ command_loop): Use null_cleanup instead of command_loop_marker.
+
+Wed Jul 5 20:09:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * event-loop.c: Include either <poll.h> or <sys/poll.h>.
+
+ * configure.in (targ_archs): Check for <poll.h> and <sys/poll.h>.
+ * configure, config.in: Re-generate.
+
+Wed Jul 5 18:10:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-06-12 Bill Nottingham <notting@redhat.com>:
+ * Makefile.in: add $(infodir) to FLAGS_TO_PASS
+
+Wed Jul 5 18:03:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Updates.
+
+2000-07-05 Mark Kettenis <kettenis@gnu.org>
+
+ * TODO: Update.
+
+2000-07-03 Chris Faylor <cfg@cygnus.com>
+
+ Committed by Elena Zannoni <ezannoni@cygnus.com>
+ * sh-tdep.c (sh_skip_prologue): Change prologue matching for modern
+ compilers.
+ (sh_frame_find_saved_regs): Ditto.
+ (sh_find_callers_reg): Stop if pc is zero.
+
+Sat Jul 1 17:47:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ser-unix.c (do_unix_readchar): Revert Tue Mar 28 18:19:50 2000
+ Andrew Cagney <cagney@b1.cygnus.com>. Locks up when no data is
+ pending.
+
+Sat Jul 1 15:40:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (SER_HARDWIRE): Restore code to set it by configure.
+
+2000-06-26 Kevin Buettner <kevinb@redhat.com>
+
+ * copying.awk: Eliminate use of PARAMS from this file.
+
+Fri Jun 23 20:47:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): Use the variable stack_used_p
+ to determine if any arguments were written to the stack. Do not
+ rely on NUMARG>=8.
+
+Mon Jun 19 11:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.h (add_set_auto_boolean_cmd): Add declaration.
+ (enum var_types): Add var_auto_boolean.
+
+ * command.c (add_set_auto_boolean_cmd): New function.
+ (do_setshow_command): Recognize auto_boolean.
+ (parse_binary_operation): Recognize enable and disable.
+ (parse_auto_binary_operation): Parse auto binary variables.
+
+ * TODO: Update
+
+Fri Jun 23 16:20:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (fp_register_arg_p): New function.
+ (mips_push_arguments): Use. Do not pass floating point arguments
+ on in an integer register.
+
+2000-06-21 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * symfile.c (init_filename_language_table): add ".pas", ".p" and ".pp"
+ as pascal source file extensions.
+
+2000-06-19 J.T. Conklin <jtc@redback.com>
+
+ * remote-nindy.c (nindy_fetch_word, nindy_store_word): Removed
+ (nindy_xfer_inferior_memory): Use dcache_xfer_memory() instead of
+ breaking transfer into chunks and using nindy_fetch_word() and
+ nindy_store_word().
+
+ * remote-bug.c (bug_xfer_memory): Use dcache_xfer_memory() instead
+ of breaking transfer into chunks and using gr_fetch_word() and
+ gr_store_word().
+
+ * remote.c (remote_fetch_word, remote_store_word): Removed.
+
+ * remote-utils.h (gr_fetch_word, gr_store_word): Removed.
+ * remote-utils.c (gr_fetch_word, gr_store_word): Removed.
+
+ * dcache.h (dcache_fetch, dcache_poke, dcache_poke_block): Removed.
+ * dcache.c (dcache_fetch, dcache_poke): Removed.
+
+2000-06-16 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * defs.h: define language_pascal in language enumeration.
+ * language.h: define _LANG_pascal macro.
+ * language.c: add language_pascal support in all language dependant
+ functions.
+
+Sun Jun 18 01:01:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_debug): New variable.
+ (_initialize_mips_tdep): Add command "set debug mips".
+ (mips_push_arguments): Add code to dump the argument list as it is
+ created.
+
+Sun Jun 18 00:27:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_push_arguments): For MIPS_EABI, squeeze a
+ strut containing a floating-point into an FP register.
+
+Sat Jun 17 16:00:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-mips.c: Include <ctype.h>
+ (mips_receive_header): Write printable characters to gdb_stdtarg
+ instead of gdb_stdlog. Only count non-printables as invalid.
+ (mips_syn_garbage): Reduce to 10.
+
+Sat Jun 17 15:39:28 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_gdbarch_init): When the object file header
+ specifies EABI64, select EABI64 and not EABI32.
+
+2000-06-16 Nicholas Duffek <nsd@redhat.com>
+
+ * rs6000-tdep.c: Changes throughout for multi-arch 64-bit
+ support. Incorporate most of tm-rs6000.h.
+ (find_toc_address_hook): Rename to rs6000_find_toc_address_hook.
+ (rs6000_set_host_arch_hook): Declare.
+ (read_memory_addr): Define.
+ (pop_frame): Rename to rs6000_pop_frame.
+ (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments,
+ rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic
+ dummy frame handling.
+ (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code,
+ rs6000_frame_saved_pc, frame_get_saved_regs,
+ frame_initial_stack_address, rs6000_frame_chain,
+ rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead
+ of read_memory_integer.
+ (branch_dest, rs6000_pop_frame, rs6000_push_arguments,
+ rs6000_skip_trampoline_code, rs6000_frame_saved_pc,
+ frame_get_saved_regs, frame_initial_stack_address,
+ rs6000_frame_chain): Replace 4 with TDEP->wordsize.
+ (skip_prologue): Recognize some 64-bit stack adjustments.
+ (push_dummy_frame, pop_dummy_frame, set_processor,
+ show_processor): Delete.
+ (frame_get_saved_regs): Manipulate saved register addresses using
+ CORE_ADDR instead of int.
+ (rs6000_create_inferior): New function.
+ (register_names_*[]): Change to struct reg registers_*[].
+ (variants[]): Assimilate into multi-arch approach.
+ (register_names_*[], variants[]): Refer to pre-PowerPC
+ architectures as POWER instead of RS6000.
+ * rs6000-nat.c: Ubiquitous changes for 64-bit support.
+ (vmap_secs, xcoff_relocate_symtab): Cast addresses
+ to unsigned long to avoid sign-extension errors.
+ (set_host_arch): New function.
+ (xcoff_relocate_symtab): Try disabling usleep(36000) workaround.
+ (rs6000_core_fns): Use new bfd_target_xcoff_flavour.
+ (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook.
+ * symfile.c (find_sym_fns): Remove special xcoff kludge.
+ * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile.
+ (process_linenos): Query line struct size from coff
+ backend instead of using compile-time constant.
+ (enter_line_range): Likewise.
+ (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to
+ record_debugformat() if appropriate.
+ (process_xcoff_symbol): Access symbol addresses using
+ SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE.
+ (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl.
+ (scan_xcoff_symtab): Likewise. Query syment struct size from
+ coff backend instead of using compile-time constant.
+ (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour.
+ * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags
+ that this Makefile variable get set to. (From Kevin Buettner.)
+ * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that
+ the TOC doesn't overflow. (From Kevin Buettner.)
+ * config/powerpc/tm-ppc-aix.h: Move config decisions to
+ multi-arched rs6000-tdep.c.
+ * config/rs6000/tm-rs6000.h: Likewise.
+ (GDB_MULTI_ARCH): Define.
+ (skip_trampoline_code): Rename to rs6000_skip_trampoline_code.
+ (is_magic_function_pointer): Replace with
+ rs6000_convert_from_func_ptr_addr.
+ (TARGET_CREATE_INFERIOR_HOOK): Define.
+ (find_toc_address_hook): Rename to rs6000_find_toc_address_hook.
+ (rs6000_set_host_arch_hook): Declare.
+ * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
+
+2000-06-15 Kevin Buettner <kevinb@redhat.com>
+
+ * v850ice.c: Eliminate use of PARAMS from this file.
+
+2000-06-15 Michael Snyder <msnyder@cygnus.com>
+
+ * valops.c (value_cast): Break up long lines.
+ * utils.c: Fix comment typo.
+
+2000-06-14 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (dump_die): Use the proper printf format for
+ printing DW_UNSND values; they're longs now.
+
+ * dwarf2read.c (dump_die): We can read DW_FORM_data8 now, on
+ at least some platforms, so print it out too.
+
+2000-06-14 James E. Wilson <wilson@bletchleypark.cygnus.com>
+
+ * dwarf2read.c (struct attribute): Change unsnd and snd field types
+ to long.
+ (read_8_bytes): Change return type to long.
+ (read_unsigned_leb128): Change return type to long. Change type of
+ local result to long. Cast argument of left shift to long.
+ (read_signed_leb128): Likewise.
+
+2000-06-14 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ Add support for Pascal language. Part 1: new files.
+ * p-exp.y, p-lang.c, p-lang.h, p-typeprint.c, p-valprint.c: New files.
+
+2000-06-13 Kevin Buettner <kevinb@redhat.com>
+
+ * ser-ocd.c, symtab.c: Eliminate use of PARAMS from these files.
+
+Tue Jun 13 09:21:23 2000 Jeffrey A Law (law@cygnus.com)
+
+ * configure.host (hppa*64*): Renamed from hppa2.0w per
+ gcc/binutils changes.
+ * configure.tgt: Similarly.
+
+2000-06-12 Bill Nottingham <notting@redhat.com>
+
+ Patch applied by Kevin Buettner <kevinb@redhat.com>:
+
+ * ia64-linux-nat.c, gdbserver/low-linux.c (u_offsets): PT_CR_IFS
+ is deprecated. Use PT_CFM instead.
+
+2000-06-12 Michael Snyder <msnyder@cygnus.com>
+
+ * breakpoint.c (breakpoint_thread_match): Fix comment.
+
+2000-06-12 Fernando Nasser <fnasser@cygnus.com>
+
+ * valops.c (value_assign): Adjust the length to take into
+ consideration that we are not starting from the beginning.
+
+2000-06-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * symfile.c (add_symbol_file_command): Properly reformat "else if"
+ code.
+ * coffread.c (coff_symtab_read): Ditto.
+
+Mon Jun 12 15:24:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (SER_HARDWIRE): Set using autoconf.
+ * configure.in (SER_HARDWIRE): Define, add ser-tcp.o.
+ * configure: Re-generate.
+
+ * config/i386/go32.mh (SER_HARDWIRE): Delete. Handled by
+ configure.in.
+ * config/sparc/sun4sol2.mh, config/sparc/sun4os4.mh,
+ config/sparc/sparclynx.mh, config/sparc/nbsdelf.mh,
+ config/sparc/nbsd.mh, config/sparc/linux.mh,
+ config/rs6000/rs6000lynx.mh, config/powerpc/solaris.mh,
+ config/powerpc/nbsd.mh, config/powerpc/linux.mh,
+ config/powerpc/cygwin.mh, config/pa/hpux11w.mh,
+ config/pa/hpux11.mh, config/pa/hpux1020.mh, config/pa/hppaosf.mh,
+ config/pa/hppahpux.mh, config/pa/hppabsd.mh, config/ns32k/nbsd.mh,
+ config/mips/irix5.mh, config/mips/irix4.mh, config/m68k/nbsd.mh,
+ config/m68k/m68klynx.mh, config/m68k/linux.mh,
+ config/i386/nbsdelf.mh, config/i386/nbsd.mh, config/i386/linux.mh,
+ config/i386/i386sco5.mh, config/i386/i386lynx.mh,
+ config/i386/i386dgux.mh, config/i386/fbsd.mh,
+ config/i386/cygwin.mh, config/arm/linux.mh, config/alpha/fbsd.mh,
+ config/alpha/alpha-osf3.mh, config/alpha/alpha-linux.mh: Remove
+ ser-tcp.o from XDEPFILES.
+ * config/ia64/linux.mh: Ditto.
+
+ * TODO: Update.
+
+Mon Jun 12 14:26:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (GDB_TARGET_IS_MIPS64): Define.
+ (struct gdbarch_tdep): Add gdb_target_is_mips64.
+ (mips_addr_bits_remove): Update.
+ (mips_gdbarch_init): Initialize.
+
+ * config/mips/tm-mips64.h (GDB_TARGET_IS_MIPS64,
+ GDB_TARGET_IS_MIPS64): Delete.
+
+Mon Jun 12 12:17:20 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c: Include "symcat.h".
+ (mips_dump_tdep): Print all known but not yet multi-arched values.
+
+2000-06-12 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h: Add forward declaration of `struct value'.
+ (FIX_CALL_DUMMY): Redefined to call i386_fix_call_dummy.
+ (i386_fix_call_dummy): Add prototype.
+ * i386-tdep.c (i386_fix_call_dummy): New function based on the
+ code from the old FIX_CALL_DUMMY macro.
+
+2000-06-12 Kevin Buettner <kevinb@redhat.com>
+
+ * procfs.c, remote.c: Eliminate use of PARAMS from these files.
+
+Mon Jun 12 10:21:24 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (gdbarch_dump): When non multi-arch skip macros that
+ return void.
+
+Sun Jun 11 12:06:21 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * exec.c (exec_file_attach): Add .exe extension when __CYGWIN__.
+
+Sat Jun 10 22:31:46 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (safe_symbol_file_add_args): Store old gdb_stderr and
+ gdb_stdout here.
+ (safe_symbol_file_add_stub): Redirect gdb_stdout as well as stderr.
+ (safe_symbol_file_add_cleanup): Restore gdb_stdout.
+ (info_dll_command): Use the pager for displaying DLLs since there are
+ often quite a few.
+
+Sun Jun 11 11:34:05 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Sat Jun 10 17:54:04 2000 Hans-Peter Nilsson <hp@axis.com>:
+ * configure.in (targ_archs): Clear out secondary components.
+ * configure: Regenerate.
+
+Fri Jun 9 15:06:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (struct gdbarch): Add member dump_tdep.
+ (struct gdbarch_registration): Ditto.
+ (gdbarch_dump): Add ui_file and gdbarch arguments. Add support
+ for external dump functions. Dump the macro value. Call target
+ dump routine.
+ (gdbarch_register): New function.
+ (gdbarch_registrary): Replace gdbarch_init_registrary.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * arch-utils.c (set_arch): Update.
+
+ * mips-tdep.c (mips_dump_tdep): New function. Move dump code here.
+ (mips_gdbarch_init): From here.
+
+ * maint.c (maintenance_print_architecture): New function.
+ (_initialize_maint_cmds): Add command ``maintenance print
+ architecture''.
+
+2000-06-08 Kevin Buettner <kevinb@redhat.com>
+
+ * command.h, monitor.h: Eliminate use of PARAMS from these
+ files.
+
+2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+
+ * config/i386/tm-embed.h: New file. Specific for embedded targets
+ like i386-elf, i386-coff and i386-aout.
+ * config/i386/embed.mt (): Specify tm-embed.h instead of the System V
+ header file.
+
+2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+
+ * MAINTAINERS: Add myself to gdbtk list.
+
+2000-06-08 Kevin Buettner <kevinb@redhat.com>
+
+ * config/ia64/nm-linux.h (U_REGS_OFFSET): Define.
+
+2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+
+ * configure.in: Replace misplaced CONFIG_ADD by the correct
+ CONFIG_CLEAN.
+ * configure, config.in: Regenerate.
+
+2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+
+ * values.c (value_primitive_field): Copy VALUE_REGNO as well.
+ With typed registers we may have the location information in this field,
+ in addition to VALUE_ADDRESS (which was already being copied).
+
+Thu Jun 8 15:26:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mips.h (GDB_MULTI_ARCH): Define as 1.
+ (CALL_DUMMY, TARGET_BYTE_ORDER_SELECTABLE_P,
+ COERCE_FLOAT_TO_DOUBLE): Delete.
+ * config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
+ config/mips/tm-vr4xxxel.h, config/mips/tm-vr4xxx.h,
+ config/mips/tm-vr4100.h, config/mips/tm-tx39l.h
+ config/mips/tm-tx39.h, config/mips/tm-irix5.h: Delete
+ GDB_MULTI_ARCH.
+
+ * config/mips/tm-mips64.h (TARGET_LONG_BIT, TARGET_LONG_LONG_BIT,
+ TARGET_PTR_BIT): Delete definitions.
+ * config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
+ config/mips/tm-tx39l.h, config/mips/tm-vr4100.h,
+ config/mips/tm-tx39.h: Delete definition of MIPS_EABI.
+ * mips-tdep.c (mips_gdbarch_init): Use the ISA to determine the
+ ABI. If all else fails, assume O32.
+
+ * TODO, NEWS: Update. Mention MIPS is multi-arch.
+
+Thu Jun 8 14:23:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-vr4xxxel.h, config/mips/tm-vr4xxx.h,
+ config/mips/tm-vr4100.h, config/mips/tm-tx39l.h,
+ config/mips/tm-tx39.h: Delete definition of
+ MIPS_DEFAULT_FPU_TYPE. Enable multi-arch.
+ * mips-tdep.c: (mips_gdbarch_init): The bfd_mach_mips3900 has no
+ FPU. bfd_mach_mips4650 FPU is single precision.
+
+ * config/mips/tm-mips.h (MIPS_FPU_SINGLE_REGSIZE):
+ (MIPS_FPU_DOUBLE_REGSIZE): Move from here.
+ * mips-tdep.c: To here. Change to an enum.
+
+Wed Jun 7 18:27:51 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (DEFAULT_BFD_ARCH, DEFAULT_BFD_VEC): Use config.bfd
+ to determine the default architecture / target.
+ * acconfig (DEFAULT_BFD_ARCH, DEFAULT_BFD_VEC): Add.
+ * configure, config.in: Regenerate.
+
+ * arch-utils.c (set_endian): Better separate multi-arch and non-
+ multi-arch cases.
+ (set_endian_from_file): Call internal_error when multi-arch.
+ (initialize_current_architecture): Rewrite logic selecting a byte
+ order. Use DEFAULT_BFD_ARCH DEFAULT_BFD_VEC.
+ (version.h): Include.
+
+ * config/mips/tm-mips.h, config/mips/tm-bigmips64.h,
+ config/mips/tm-bigmips.h: Delete definition of
+ TARGET_BYTE_ORDER_DEFAULT.
+
+Thu Jun 8 11:41:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * infrun.c (follow_inferior_fork): Bad merge from below. Compare
+ strings using follow_fork_mode_ask and not "ask".
+
+Wed Jun 7 15:13:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.h (add_set_enum_cmd): Make ``enumlist'' and ``var''
+ constant char pointers.
+ (complete_on_enum): Change ``enumlist'' to a constant char
+ pointer.
+ (struct cmd_list_element): Ditto for member ``enums''.
+ * command.c (complete_on_enum, add_set_enum_cmd,
+ do_setshow_command): Update.
+
+ * infrun.c (follow_fork_mode_ask, follow_fork_mode_parent,
+ follow_fork_mode_both, follow_fork_mode_child): New. Use to
+ construct the follow_fork_mode_kind_names.
+ (set_follow_fork_mode_command): Delete function.
+ (_initialize_infrun): Update.
+ (follow_inferior_fork): Do not strdup follow_fork_mode_string.
+ Use follow_fork_mode_* variables directly instead. Call
+ internal_error instead of error when unimplemented "ask" mode.
+
+ * infrun.c (scheduler_enums, scheduler_mode, schedlock_off,
+ schedlock_on, schedlock_step): Update.
+ * serial.c (serial_logbase, logbase_hex, logbase_octal,
+ logbase_ascii, logbase_enums): Update.
+ * remote.c (packet_support_enums, packet_support_auto,
+ packet_enable, packet_disable, struct packet_config): Update.
+ * arch-utils.c (initialize_current_architecture,
+ set_architecture_string): Update.
+ (endian_big, endian_little, endian_auto, endian_enum,
+ set_endian_string): Update.
+ * i386-tdep.c (valid_flavors, att_flavor, intel_flavor,
+ disassembly_flavor): Update.
+ * mips-tdep.c (size_enums, size_64, size_32, size_auto,
+ mips_stack_argsize_string, mips_saved_regsize_string): Update.
+ * arm-tdep.c (disassembly_flavor, valid_flavors): Update.
+ (_initialize_arm_tdep): Ditto.
+
+ * TODO: Update.
+
+Mon Jun 5 18:44:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * thread.c (make_cleanup_restore_current_thread,
+ do_restore_current_thread_cleanup): New functions.
+ (thread_apply_all_command, thread_apply_command): Use. Call
+ do_cleanups when finished.
+
+ * defs.h (make_cleanup_func): Delete typedef.
+ * TODO: Update.
+
+Wed Jun 7 11:34:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arch-utils.c (target_byte_order, target_byte_order_auto,
+ show_endian, set_endian, set_endian_big, set_endian_little,
+ set_endian_auto, set_endian_from_file, enum set_arch,
+ target_architecture_auto, set_architecture_string,
+ target_architecture_hook, target_architecture, arch_ok, set_arch,
+ set_architecture_from_arch_mach, set_architecture_from_file,
+ show_architecture, set_architecture, info_architecture,
+ set_gdbarch_from_file, initialize_current_architecture): Copy from
+ gdbarch.c. Rewrite ``set architecture'' and ``set endian''
+ commands to use enums.
+ (_initialize_gdbarch_utils): Fix name.
+ * arch-utils.h (set_architecture_from_arch_mach,
+ target_architecture_hook): Copy from gdbarch.h.
+ * gdbarch.sh: Update.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * TODO: Update.
+
+ * v850-tdep.c, sh3-rom.c, sh-tdep.c, i386-tdep.c: Include
+ "arch-utils.h".
+ * Makefile.in (v850-tdep.o): Specify dependencies.
+ (i386-tdep.o, sh3-rom.o, sh-tdep.o): Add arch-utils.h to
+ dependency list.
+
+2000-06-06 Michael Snyder <msnyder@cygnus.com>
+
+ * configure.in: Enable autoconf to find curses.h on Solaris 2.8.
+ * configure: Regenerate.
+
+Tue Jun 6 21:14:47 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.c (do_setshow_command): Accept an enum option immediatly
+ when it is an exact match.
+
+Tue Jun 6 16:46:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
+ config/mips/tm-vr4xxxel.h, config/mips/tm-vr4xxx.h,
+ config/mips/tm-vr4300el.h, config/mips/tm-vr4100.h,
+ config/mips/tm-vr4300.h, config/mips/tm-tx39l.h,
+ config/mips/tm-tx39.h, config/mips/tm-embedl64.h,
+ config/mips/tm-embedl.h, config/mips/tm-embed64.h,
+ config/mips/tm-embed.h: Delete TARGET_BYTE_ORDER_SELECTABLE_P.
+
+ * tm-mips.h (TARGET_BYTE_ORDER_SELECTABLE_P): Define as 1.
+
+Tue Jun 6 16:21:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (generic_register_convertible_not,
+ frame_num_args_unknown): Move from here.
+ * arch-utils.c (generic_register_convertible_not,
+ frame_num_args_unknown): To here.
+ * arch-utils.h (frame_num_args_unknown): Add declaration.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+Tue Jun 6 15:07:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-mips.c (mips_open): Select the default monitor prompt
+ based on the target ISA.
+
+ * config/mips/tm-vr4100.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr4300el.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr4300.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr4xxx.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr4xxxel.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr5000el.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-vr5000.h (TARGET_MONITOR_PROMPT),
+ config/mips/tm-mips.h (TARGET_MONITOR_PROMPT): Delete macro.
+
+2000-06-05 Daniel Berlin <dan@cgsoftware.com>
+
+ * c-exp.y (yylex): template handling fixes.
+
+2000-06-03 Daniel Berlin <dan@cgsoftware.com>
+
+ * symtab.h (VTBL_PREFIX_P): Add newer g++ vtbl prefix to prefix
+ list.
+
+ * symtab.c (lookup_partial_symbol): Change to stop forcing linear
+ searches on C++ when we fail the binary search, by doing the
+ binary search right.
+
+2000-05-30 Daniel Berlin <dan@cgsoftware.com>
+
+ * buildsym.c (hashname): Change to use hash function from bcache.c/.h
+
+ * bcache.c (hash): Change to newer hash function.
+
+ * bcache.h (hash): Prototype for hash function
+
+ * dwarf2read.c (TYPE_HASH_SIZE): New define for controlling size
+ of type hash.
+ (dwarf2_cached_types): New variable that is the cached types.
+ (tag_type_to_type): Do the actual caching of types here.
+
+2000-06-05 Mark Kettenis <kettenis@gnu.org>
+
+ * acconfig.h, configure.in, i386bsd.c (HAVE_STRUCT_REG_R_FS):
+ Renamed from HAVE_R_FS.
+ (HAVE_STRUCT_REG_GS): Renamed from HAVE_R_GS.
+ * configure, config.in: Regenerated.
+
+Sun Jun 4 14:00:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Update. Mention GNU/Linux/SPARC problems.
+
+Wed May 31 21:41:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Change buf
+ to a void pointer. Update initial values.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * findvar.c (address_to_signed_pointer,
+ signed_pointer_to_address): New functions.
+ * inferior.h (signed_pointer_to_address,
+ signed_address_to_pointer): Declare.
+
+ * inferior.h, findvar.c (unsigned_pointer_to_address,
+ address_to_unsigned_pointer): Rename generic_address_to_pointer
+ and generic_pointer_to_address. Update signatures to match
+ gdbarch changes.
+
+ * config/mips/tm-mips.h (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER):
+ Define. MIPS has signed pointers.
+
+ * defs.h, utils.c (host_pointer_to_address,
+ address_to_host_pointer): New functions.
+ * irix5-nat.c (next_link_map_member, first_link_map_member),
+ procfs.c (proc_set_watchpoint, proc_iterate_over_mappings): Use.
+
+ * irix5-nat.c (solib_map_sections, symbol_add_stub): Change
+ function signature to match catch_errors_ftype.
+
+ * TODO: Update. GDB builds using the IRIX native compiler.
+
+Sat Jun 3 20:43:59 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (strsignal, safe_strsignal): Delete declarations.
+ * utils.c (safe_strsignal): Delete.
+ * corelow.c (core_open): Replace save_strsignal with
+ target_signal_to_string + target_signal_from_host.
+ * TODO: Document problems with target_signal_from_host.
+
+2000-06-03 Kevin Buettner <kevinb@redhat.com>
+
+ * annotate.c, annotate.h, breakpoint.c, command.c, command.h,
+ config/rs6000/tm-rs6000.h, corefile.c, d10v-tdep.c,
+ d30v-tdep.c, dbxread.c, dcache.c, dcache.h, dsrec.c,
+ dve3900-rom.c, exec.c, fork-child.c, gdbcore.h, hpux-thread.c,
+ language.h, linux-thread.c, mdebugread.c, monitor.h, ocd.c,
+ procfs.c, ptx4-nat.c, remote-sim.c, remote-utils.h, remote.c,
+ rs6000-tdep.c, ser-ocd.c, sol-thread.c, sparcl-tdep.c,
+ stabsread.h, stack.c, symfile.c, symfile.h, symtab.h,
+ target.c, target.h, top.c, tracepoint.c, tracepoint.h,
+ tui/tui.h, tui/tuiIO.c, utils.c, v850ice.c, varobj.c,
+ win32-nat.c, wince.c, xcoffsolib.c, xcoffsolib.h: Eliminate
+ PARAMS from function pointer declarations.
+
+2000-06-03 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (safe_symbol_file_add_cleanup): Ensure that gdb_stderr is
+ flushed before deleting and restoring it.
+ (safe_symbol_file_add): Ensure that gdb_stderr is flushed before
+ reassigning it.
+ (handle_load_dll): Split into two functions so that WFI can handle
+ shared library events.
+ (child_solib_loaded_library_pathname): New function.
+ (child_clear_solibs): New function. Clears shared library list.
+ (child_solib_add): New function. Adds shared library symbols.
+ (dll_symbol_command): New function. Handles "dll-symbol" command.
+ (info_dll_command): New function. Handles info
+ "sharedlibrary" command.
+ (handle_exceptions): Eliminate 'ignore_trap' argument.
+ (get_child_debug_event): Eliminate two arguments. Return "pid" when
+ appropriate. Break out on most events to allow WFI to handle stuff.
+ (child_wait): Accomodate get_child_debug_event changes.
+ (child_attach): Clear thread list and list of loaded dlls.
+ (child_create_inferior): Clear list of loaded dlls. Use
+ wait_for_inferior in a loop to look for first "trap".
+ (child_resume): Avoid accessing a possibly-freed thread pointer.
+ (_initialize_inftarg): Add "dll-symbols", "sharedlibrary", and "info
+ sharedlibrary" commands.
+ * config/i386/tm-cygwin.h: Add some shared library (aka DLL) hooks.
+
+2000-06-02 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Fix up gcc warnings throughout.
+ (handle_load_dll): Change DLL name to lower case.
+ (handle_exception): Add a second argument indicating whether a
+ breakpoint should be ignored. Return a 0 if the breakpoint was
+ ignored.
+ (get_child_debug_event): Pass argument to handle_exception to control
+ whether a breakpoint should be ignored.
+ (child_create_inferior): Use modern cygwin API. Explicitly clear
+ last_sig. Pass FIRST_EXCEPTION to get_child_debug_event for detection
+ of first breakpoint.
+
+2000-06-02 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Detect correct versions of dlltool and windres when
+ cross-compiling.
+ * configure: Regenerate.
+
+2000-06-02 J.T. Conklin <jtc@redback.com>
+
+ * configure.tgt: Add pattern for i[3456]86-*-netbsdelf*.
+ * config/i386/nbsdelf.mt: New file.
+ * config/i386/tm-nbsdelf.h: New file.
+
+ * config/i386/tm-nbsd.h: change include of tm-nbsd.h to
+ the more explicit config/tm-nbsd.h.
+
+2000-06-02 Mark Kettenis <kettenis@gnu.org>
+
+ * alphabsd-nat.c (supply_fpregset): Substract FP0_REGNUM from
+ register number when used as index into fpr_regs array.
+
+Tue May 30 13:31:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT,
+ TARGET_LONG_DOUBLE_FORMAT): Delete.
+
+ * gdbarch.sh: Add support for parameterized expressions.
+ (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT,
+ TARGET_LONG_DOUBLE_FORMAT): Add. Include "floatformat.h".
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * arch-utils.c (default_single_format, default_double_format,
+ default_long_double_format): New functions. Include
+ "floatformat.h"
+ * arch-utils.h: Declare.
+
+ * d10v-tdep.c (d10v_gdbarch_init): Set floating point format.
+ Note that long double is 64 bit, the rest are 32 bit. Include
+ "floatformat.h".
+
+2000-06-02 Mark Kettenis <kettenis@gnu.org>
+
+ * config/alpha/nm-fbsd.h (CANNOT_STEP_BREAKPOINT): Define.
+
+2000-06-01 Michael Snyder <msnyder@cygnus.com>
+
+ * sol-thread.c (rw_common): Circumstances (eg. a bug in Sun's
+ thread_db library) may cause this function to be called with an
+ illegal address, in which case procfs_to_xfer_memory will
+ return zero. Return an error code instead of looping forever.
+
+Thu Jun 1 20:05:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: More suggestions added.
+
+2000-06-01 Klee Dienes <kdienes@apple.com>
+
+ * MAINTAINERS: Add Klee Dienes and Jim Ingham as maintainers for
+ Mac OS X and Objective C components (to be contributed).
+
+2000-05-31 J.T. Conklin <jtc@redback.com>
+
+ * configure.host: Add patterns for i[3456]86-*-netbsdaout*
+ and i[3456]86-*-netbsdelf*.
+ * config/i386/nm-nbsdelf.h: New file.
+ * config/i386/nbsdelf.mh: New file.
+
+ * config/i386/nm-nbsd.h: change include of nm-nbsd.h to
+ the more explicit config/nm-nbsd.h.
+ * config/i386/tm-nbsd.h: change include of tm-i386bsd.h to
+ tm-i386.h.
+ (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Define.
+
+2000-06-01 Mark Kettenis <kettenis@gnu.org>
+
+ * NEWS: Mention FreeBSD/Alpha and FreeBSD/i386 3.x and up as new
+ native configurations.
+
+ * i386bsd-nat.c: Include "gregset.h".
+ (CANNOT_STORE_REGISTER): Define to cannot_fetch_register instead
+ of CANNOT_FETCH_REGISTER, if not already defined.
+ (supply_gregset): Call supply_register with NULL as its second
+ argument instead of supplying our own zeroed out buffer.
+ (fill_gregset): Copy contents of correct registers instead of the
+ contents of register REGNO.
+
+2000-05-31 Kevin Buettner <kevinb@redhat.com>
+
+ * gnu-regex.c (re_match_2_internal): Revert 2000-05-27
+ patch which removed use of PARAMS from declaration. This
+ file should not have been touched as it is supposed to track
+ the version in glibc.
+
+2000-05-31 Mark Kettenis <kettenis@gnu.org>
+
+ Add support for FreeBSD/Alpha.
+ * configure.host, configure.tgt (alpha*-*-freebsd*): New entry.
+ * alphabsd-nat.c, config/alpha/fbsd.mh, config/alpha/fbsd.mt,
+ config/alpha/nm-fbsd.h, config/alpha/tm-fbsd.h,
+ config/alpha/xm-fbsd.h: New files.
+
+2000-05-31 Pierre Muller <muller@sourceware.cygnus.com>
+
+ * MAINTAINERS: Add myself to "Write After Approval" list.
+
+Tue May 30 18:48:33 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Re-organize.
+
+Tue May 30 11:22:28 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Add field ``postdefault''. Rename fields
+ ``startup'' and ``default'' to ``staticdefault'' and
+ ``predefault''. Fix initialization of valid_p. Create/compare
+ gdbarch.log.
+
+Mon May 29 22:47:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/sparc/nm-sun4sol2.h (GDB_GREGSET_T, GDB_FPREGSET_T):
+ Define.
+ * config/sparc/xm-sun4sol2.h: (GDB_GREGSET_TYPE,
+ GDB_FPREGSET_TYPE): Delete.
+
+Mon May 29 15:41:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symtab.h (make_cleanup_free_search_symbols): Add declaration.
+ * symtab.c (make_cleanup_free_search_symbols,
+ do_free_search_symbols_cleanup): New functions.
+ (search_symbols, symtab_symbol_info, rbreak_command): Update.
+ (search_symbols): Pass ``sr'', and not its address, to
+ make_cleanup_free_search_symbols.
+
+2000-05-28 Kevin Buettner <kevinb@redhat.com>
+
+ * config/nm-linux.h (GDB_GREGSET_T, GDB_FPREGSET_T): Fix typos.
+
+2000-05-27 Kevin Buettner <kevinb@redhat.com>
+
+ * abug-rom.c, alpha-nat.c, alpha-tdep.c, annotate.c,
+ annotate.h, arc-tdep.c, ax-gdb.c, ax-gdb.h, ax-general.c,
+ ax.h, breakpoint.c, breakpoint.h, c-exp.y, c-lang.c, c-lang.h,
+ call-cmds.h, ch-exp.c, ch-lang.c, ch-lang.h, cli-out.c,
+ coff-solib.h, coffread.c, command.c, command.h, complaints.c,
+ complaints.h, config/a29k/tm-a29k.h, config/a29k/tm-vx29k.h,
+ config/alpha/nm-linux.h, config/alpha/nm-osf.h,
+ config/alpha/nm-osf2.h, config/alpha/tm-alpha.h,
+ config/alpha/tm-alphalinux.h, config/arc/tm-arc.h,
+ config/arm/tm-embed.h, config/d30v/tm-d30v.h,
+ config/fr30/tm-fr30.h, config/h8300/tm-h8300.h,
+ config/h8500/tm-h8500.h, config/i386/nm-i386bsd.h,
+ config/i386/nm-i386sco.h, config/i386/nm-i386sol2.h,
+ config/i386/nm-i386v.h, config/i386/nm-linux.h,
+ config/i386/nm-nbsd.h, config/i386/nm-ptx4.h,
+ config/i386/nm-symmetry.h, config/i386/tm-cygwin.h,
+ config/i386/tm-i386.h, config/i386/tm-i386nw.h,
+ config/i386/tm-i386sol2.h, config/i386/tm-i386v.h,
+ config/i386/tm-i386v4.h, config/i386/tm-nbsd.h,
+ config/i386/tm-ptx.h, config/i386/tm-sun386.h,
+ config/i960/tm-mon960.h, config/i960/tm-nindy960.h,
+ config/m32r/tm-m32r.h, config/m68k/nm-dpx2.h,
+ config/m68k/nm-linux.h, config/m68k/tm-cisco.h,
+ config/m68k/tm-delta68.h, config/m68k/tm-es1800.h,
+ config/m68k/tm-isi.h, config/m68k/tm-linux.h,
+ config/m68k/tm-m68k.h, config/m68k/tm-m68kv4.h,
+ config/m68k/tm-news.h, config/m68k/tm-sun3.h,
+ config/m68k/tm-vx68.h, config/m68k/xm-hp300bsd.h,
+ config/m88k/tm-m88k.h, config/mcore/tm-mcore.h,
+ config/mips/nm-irix3.h, config/mips/nm-irix4.h,
+ config/mips/nm-irix5.h, config/mips/nm-mips.h,
+ config/mips/tm-embed.h, config/mips/tm-mips.h,
+ config/mn10200/tm-mn10200.h, config/mn10300/tm-mn10300.h,
+ config/nm-linux.h, config/nm-lynx.h, config/ns32k/nm-nbsd.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
+ config/pa/nm-hppah.h, config/pa/tm-hppa.h,
+ config/pa/tm-hppa64.h, config/pa/xm-hppah.h,
+ config/powerpc/nm-linux.h, config/powerpc/tm-linux.h,
+ config/powerpc/tm-ppc-eabi.h, config/powerpc/tm-solaris.h,
+ config/powerpc/xm-aix.h, config/rs6000/nm-rs6000.h,
+ config/rs6000/tm-rs6000.h, config/rs6000/xm-rs6000.h,
+ config/sh/tm-sh.h, config/sparc/nm-linux.h,
+ config/sparc/nm-sun4os4.h, config/sparc/nm-sun4sol2.h,
+ config/sparc/tm-sp64.h, config/sparc/tm-sp64sim.h,
+ config/sparc/tm-sparc.h, config/sparc/tm-sparclet.h,
+ config/sparc/tm-spc-em.h, config/sparc/tm-sun4os4.h,
+ config/sparc/tm-sun4sol2.h, config/tic80/tm-tic80.h,
+ config/tm-sysv4.h, config/v850/tm-v850.h, config/vax/tm-vax.h,
+ config/w65/tm-w65.h, config/xm-aix4.h, config/z8k/tm-z8k.h,
+ copying.c, core-aout.c, core-regset.c, core-sol2.c,
+ corefile.c, corelow.c, cp-valprint.c, cpu32bug-rom.c,
+ d10v-tdep.c, d30v-tdep.c, dbug-rom.c, dbxread.c, dcache.c,
+ dcache.h, demangle.c, dink32-rom.c, dsrec.c, dstread.c,
+ dve3900-rom.c, dwarf2read.c, dwarfread.c, elfread.c,
+ environ.h, eval.c, exec.c, expprint.c, expression.h, f-exp.y,
+ f-lang.c, f-lang.h, f-valprint.c, findvar.c, fr30-tdep.c,
+ frame.h, gdb_string.h, gdbcmd.h, gdbcore.h,
+ gdbserver/server.h, gdbtypes.c, gdbtypes.h, gnu-regex.c,
+ h8300-tdep.c, hp-psymtab-read.c, hp-symtab-read.c,
+ hp300ux-nat.c, hppa-tdep.c, hppah-nat.c, hpread.c, hpread.h,
+ hpux-thread.c, i386-tdep.c, i386aix-nat.c, i386mach-nat.c,
+ i386v-nat.c, i386v4-nat.c, i387-tdep.c, i960-tdep.c, infcmd.c,
+ inferior.h, inflow.c, infptrace.c, inftarg.c, irix4-nat.c,
+ irix5-nat.c, jv-exp.y, jv-lang.c, jv-lang.h, language.c,
+ language.h, lynx-nat.c, m2-exp.y, m2-lang.c, m2-lang.h,
+ m32r-rom.c, mac-nat.c, main.c, maint.c, mdebugread.c,
+ mi/mi-out.c, minsyms.c, mips-nat.c, mips-tdep.c, mipsread.c,
+ mn10300-tdep.c, mon960-rom.c, monitor.c, monitor.h, nlmread.c,
+ objfiles.c, objfiles.h, ocd.c, ocd.h, op50-rom.c, os9kread.c,
+ osfsolib.c, pa64solib.c, pa64solib.h, parse.c, parser-defs.h,
+ ppc-bdm.c, printcmd.c, procfs.c, remote-array.c, remote-bug.c,
+ remote-e7000.c, remote-es.c, remote-est.c, remote-hms.c,
+ remote-mips.c, remote-nindy.c, remote-nrom.c, remote-rdi.c,
+ remote-rdp.c, remote-sds.c, remote-sim.c, remote-udi.c,
+ remote-utils.c, remote-utils.h, remote-vx.c, remote.c,
+ rom68k-rom.c, rs6000-nat.c, rs6000-tdep.c, scm-exp.c,
+ scm-lang.c, scm-lang.h, ser-e7kpc.c, ser-mac.c, sh3-rom.c,
+ sol-thread.c, solib.c, solib.h, somread.c, somsolib.c,
+ somsolib.h, source.c, sparc-nat.c, sparcl-tdep.c,
+ sparclet-rom.c, srec.h, stabsread.c, stabsread.h, stack.c,
+ sun3-nat.c, symfile.c, symfile.h, symmisc.c, symtab.c,
+ symtab.h, target.c, target.h, terminal.h, thread.c, top.c,
+ top.h, tracepoint.c, tracepoint.h, tui/tui-file.c, tui/tui.c,
+ tui/tui.h, tui/tuiCommand.h, tui/tuiData.c, tui/tuiData.h,
+ tui/tuiDataWin.h, tui/tuiDisassem.c, tui/tuiDisassem.h,
+ tui/tuiGeneralWin.c, tui/tuiGeneralWin.h, tui/tuiIO.c,
+ tui/tuiIO.h, tui/tuiLayout.c, tui/tuiLayout.h, tui/tuiRegs.c,
+ tui/tuiRegs.h, tui/tuiSource.c, tui/tuiSource.h,
+ tui/tuiSourceWin.h, tui/tuiStack.c, tui/tuiStack.h,
+ tui/tuiWin.c, tui/tuiWin.h, typeprint.c, ui-file.c, ui-out.h,
+ ultra3-nat.c, utils.c, v850-tdep.c, v850ice.c, valarith.c,
+ valops.c, valprint.c, value.h, values.c, varobj.c, w89k-rom.c,
+ win32-nat.c, wince.c, wrapper.c, wrapper.h, xcoffread.c,
+ xcoffsolib.c, xmodem.h, z8k-tdep.c: Remove PARAMS from function
+ declarations.
+
+2000-05-26 Michael Snyder <msnyder@cygnus.com>
+
+ * gregset.h: New file. Typedefs for gdb_gregset_t and
+ gdb_fpregset_t, prototypes for supply_gregset and friends.
+ * procfs.c: Include gregset.h. Delete local prototypes for
+ supply_gregset etc., and local typedef gdb_gregset_t etc.
+ * sol-thread.c: Include gregset.h, delete local prototypes,
+ add appropriate casts to gdb_gregset_t.
+ * uw-thread.c, lin-thread.c, core-sol2.c, core-regset.c,
+ sparc-tdep.c, ptx4-nat.c, ppc-linux-nat.c, mipsv4-nat.c,
+ m88k-nat.c, m68klinux-nat.c, m68k-tdep.c, irix5-nat.c,
+ irix4-nat.c, ia64-linux-nat.c, i386v4-nat.c, cxux-nat.c,
+ arm-linux-nat.c, alpha-nat.c: Include gregset.h.
+ * config/nm-linux.h: Define GDB_GREGSET_T, GDB_FPREGET_T.
+ * config/sparc/nm-sun4sol2.h: Ditto.
+ * config/sparc/xm-sun4sol2.h: (GDB_GREGSET_TYPE,
+ GDB_FPREGSET_TYPE): Delete (replaced by GDB_GREGSET_T etc.)
+
+Thu May 25 16:56:05 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for ncurses.h.
+ * config.in, configure: Re-generate.
+
+2000-05-25 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-tdep.c (find_minsym_and_objfile): New.
+ (skip_hurd_resolver): New.
+ (arm_linux_skip_solib_resolver): New.
+ (arm_skip_solib_resolver): Removed.
+
+ * config/arm/tm-linux.h (SKIP_SOLIB_RESOLVER): Changed to use
+ arm_linux_skip_solib_resolver.
+
+2000-05-25 Mark Kettenis <kettenis@gnu.org>
+
+ * acconfig.h (HAVE_R_FS, HAVE_R_GS): Add.
+ * configure.in: Add checks for r_fs and r_gs members of
+ `struct reg'.
+ * config.in, configure: Regenerated.
+
+2000-05-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ser-go32.c: Remove PARAMS.
+
+Thu May 25 15:22:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for <dirent.h>,
+ <sys/ndir.h>, <sys/dir.h> and <ndir.h>.
+ * config.in, configure: Re-generate.
+ * gdb_dirent.h: New file
+
+ * infptrace.c: Include "gdb_dirent.h" instead of <sys/dir.h>.
+ * core-aout.c: Ditto.
+ * procfs.c: Include "gdb_dirent.h" instead of <dirent.h>.
+
+Thu May 25 14:43:30 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config.in: Regenerate.
+
+Thu May 25 13:49:17 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Fri 19 May 2000 Eli Zaretskii <eliz@is.elta.co.il>: *
+ config/djgpp/fnchange.lst: Fix bfd/coff-tic54x.c, bfd/coff-tc54x.c
+ and gdb/testsuite/gdb.mi/mi-var-cmd.exp.
+
+Thu May 25 11:09:50 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (AC_OUTPUT): Do not generate tui/Makefile.
+ (enable-tui): Convert Makefile configury to use the same mechanism
+ as MI.
+
+ * Makefile.in (BUILD_TUI, TUI_LIBRARY, TUI_DIR, TUI_SRC,
+ TUI_CFLAGS): Delete
+ (all-tui): Delete target.
+ (tuiWin.o, tuiStack.o, tuiSourceWin.o, tuiSource.o, tuiRegs.o,
+ tuiLayout.o, tuiIO.o, tuiGeneralWin.o, tuiDisassem.o,
+ tuiDataWin.o, tuiData.o, tuiCommand.o, tui.o): New targets.
+ (SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_TUI_DEPS,
+ SUBDIR_TUI_INITS, SUBDIR_TUI_LDFLAGS, SUBDIR_TUI_CFLAGS,
+ SUBDIR_TUI_ALL, SUBDIR_TUI_CLEAN, SUBDIR_TUI_INSTALL,
+ SUBDIR_TUI_UNINSTALL): Define.
+
+ * TODO: Update.
+
+Thu May 25 11:02:24 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Update. Mark Kettenis fixed FreeBSD >2.2 support.
+ * MAINTAINERS: Update Jim Ingham's address.
+
+2000-05-25 Mark Kettenis <kettenis@gnu.org>
+
+ Add support for FreeBSD/i386 ELF.
+ * i386bsd-nat.c: New file.
+ * config/i386/tm-fbsd.h (HAVE_I387_REGS): Define.
+ Include "i386/tm-i386.h" instead of "i386/tm-i386b.h".
+ (NUM_REGS): Remove redefinition.
+ (USE_STRUCT_CONVENTION): Define.
+ (i386_float_info): Remove prototype.
+ (FLOAT_INFO): Remove define.
+ (JB_ELEMENT_SIZE): Define to 4.
+ (JB_PC): Define to 0.
+ (GET_LONGJMP_TARGET): Define.
+ (SIGTRAMP_START, SIGTRAMP_END): Define.
+ (SIGCONTEXT_PC_OFFSET): Define.
+ (IN_SOLIB_CALL_TRAMPOLINE): Only define if !SVR4_SHARED_LIBS
+ * config/i386/nm-fbsd.h (PTRACE_ARG3_TYPE): Define to caddr_t.
+ (FETCH_INFERIOR_REGISTERS): Define.
+ (ATTACH_DETACH): Define.
+ (kernel_u_size): Remove PARAMS.
+ (register_u_addr): Use CORE_ADDR in prototype where appropriate.
+ Remove PARAMS.
+ (SVR4_SHARED_LIBS) [FREEBSD_ELF || __ELF__ && !FREEBSD_AOUT]:
+ Define.
+ [SVR4_SHARED_LIBS]: Include "elf/common.h".
+ Only define aliases for struct members from <link.h> if
+ !SVR4_SHARED_LIBS.
+ * config/i386/xm-fbsd.h: New file.
+ * config/i386/fbsd.mt (TDEPFILES): Remove solib.o.
+ * config/i386/fbsd.mh (NATDEPFILES): Remove i386b-nat.o. Add
+ core-regset.o i387-nat.o i386bsd-nat.o.
+
+2000-05-24 Michael Snyder <msnyder@cygnus.com>
+
+ * findvar.c (value_from_register): Factor code, simplify logic.
+
+2000-05-23 J.T. Conklin <jtc@redback.com>
+
+ * config/i386/nbsd.mt (TDEPFILES): Move solib.o from here...
+ * config/i386/nbsd.mh (NATDEPFILES): ...to here.
+ * config/m68k/nbsd.mt (TDEPFILES): Move solib.o from here...
+ * config/m68k/nbsd.mh (NATDEPFILES): ...to here.
+ * config/ns32k/nbsd.mt (TDEPFILES): Move solib.o from here...
+ * config/ns32k/nbsd.mh (NATDEPFILES): ...to here.
+
+ * config/powerpc/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o.
+ * configure.tgt (powerpc-*-netbsd*): add gdbserver to configdirs.
+ * gdbserver/low-nbsd.c (initialize_arch): Define for PPC.
+ (fetch_inferior_registers): Likewise.
+ (store_inferior_registers): Likewise.
+
+ * gdbserver/low-nbsd.c (fetch_inferior_registers): Handle X86
+ floating point registers.
+ (store_inferior_registers): Likewise.
+
+2000-05-24 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-nat.h, i387-nat.c: New files.
+
+Tue May 23 17:21:24 2000 Alexandre Oliva <aoliva@cygnus.com>
+
+ * config/sparc/nm-linux.h: Include config/nm-linux.h.
+ * config/powerpc/nm-linux.h: Likewise.
+
+Tue May 23 13:20:00 1999 Gregory Lielens <info@fft.be>
+
+ * f-valprint.c : Corrected f_val_print function for TYPE_CODE
+ (type) = TYPE_CODE_COMPLEX
+
+Wed May 24 00:38:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (make_cleanup_close, do_close_cleanup): New functions.
+ * defs.h (make_cleanup_close): Add declaration.
+
+Tue May 23 20:47:50 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (build_warnings): Add -Wuninitialized.
+ * configure: Regenerate.
+
+Tue May 23 17:44:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Mon May 8 14:49:51 2000 Andrew Cagney <cagney@b1.cygnus.com>
+ (gdb 5.0): From Michael Paddon <mmpp@esec.com.au>:
+ * configure.in (AC_CHECK_HEADERS): Check for <sys/user.h>.
+
+ * configure: Re-generate.
+ * proc-api.c: Only include <sys/user.h> when available.
+ (ioctl_table): Check that PIOCGETPR and PIOCGETU are defined.
+
+ * TODO: Update.
+
+2000-05-17 Michael Snyder <msnyder@cygnus.com>
+
+ * config/sparc/tm-sun4sol2.h: Turn on multi-arch.
+ * sparc-tdep.c (gdb_print_insn_sparc): Remove temp. multi-arch hack.
+
+2000-05-17 Andrew Cagney <cagney@sourceware.cygnus.com>
+
+ * GDB 5.0 released.
+ * Makefile.in (VERSION): Set to 5.0.
+
+Mon May 22 16:20:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * inferior.h (make_cleanup_restore_inferior_status):
+ * infrun.c (make_cleanup_restore_inferior_status,
+ do_restore_inferior_status_cleanup): New functions.
+ * valops.c (hand_function_call): Use.
+ * infcmd.c (disable_longjmp_breakpoint_cleanup): New function.
+ (step_1): Use.
+ * symfile.c (clear_symtab_users_cleanup): New function.
+ (syms_from_objfile, reread_symbols): Use.
+ * objfiles.c (make_cleanup_free_objfile, do_free_objfile_cleanup):
+ New functions.
+ * objfiles.h (make_cleanup_free_objfile): Add declaration.
+ * symfile.c (syms_from_objfile, reread_symbols), hpread.c
+ (hpread_build_psymtabs), hp-psymtab-read.c
+ (hpread_build_psymtabs): Use.
+ * dwarf2read.c (make_cleanup_free_die_list,
+ do_free_die_list_cleanup): New functions.
+ (psymtab_to_symtab_1): Use.
+ * tracepoint.c (make_cleanup_free_actions,
+ do_free_actions_cleanup): New functions.
+ (read_actions): Use.
+ * corelow.c (core_close_cleanup): New function.
+ (core_open): Use.
+ * dbxread.c (make_cleanup_free_bincl_list,
+ do_free_bincl_list_cleanup): New function.
+ (read_dbx_symtab): Use.
+ * coffread.c (free_linetab_cleanup, free_stringtab_cleanup): New
+ functions.
+ (coff_symfile_read): Use.
+ * varobj.c (make_cleanup_free_variable, do_free_variable_cleanup):
+ New function.
+ (varobj_create): Use.
+ * sparcl-tdep.c (close_tty), infrun.c (resume_cleanups), parse.c
+ (free_funcalls): Change signature to match make_cleanup_ftype.
+ * infrun.c (resume), tracepoint.c (encode_actions), remote-udi.c
+ (download), solib.c (open_symbol_file_object), sparcl-tdep.c
+ (sparclite_open), parse.c (parse_exp_1): Remove cast using
+ make_cleanup_func.
+
+Mon May 22 15:49:13 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * procfs.c (info_proc_cmd): Use make_cleanup_freeargv.
+ (proc_iterate_over_mappings): Use make_cleanup_close.
+ (proc_get_LDT_entry): Ditto.
+ (do_closedir_cleanup): New function.
+ (proc_update_threads): Use.
+ (do_destroy_procinfo_cleanup): New function.
+ (info_proc_cmd): Use.
+
+Mon May 22 15:21:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.h (command_loop_marker): Change signature to match
+ make_cleanup_ftype.
+ * top.c (command_loop_marker): Update.
+ (command_loop, simplified_command_loop), event-top.c
+ (command_handler): Remove cast using make_cleanup_func.
+ * event-top.c (command_handler): Ditto.
+
+ * top.c (do_chdir_cleanup): New function.
+ (gdb_init): Use. Use xstrdup instead of strsave.
+ * top.c (do_fclose_cleanup): New function.
+ (source_command): Use.
+ * top.c (do_restore_instream_cleanup): Rename
+ source_cleanup. Change signature to match make_cleanup.
+ (read_command_filem execute_user_command): Update. Remove cast
+ using make_cleanup_func.
+ * top.c (do_free_command_lines_cleanup,
+ make_cleanup_free_command_lines): New funtions.
+ (get_command_line, read_command_lines): Use.
+ * top.c (arg_cleanup): Change signature to match make_cleanup.
+ (setup_user_args): Remove cast using make_cleanup_func.
+
+Mon May 22 12:05:13 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (t_reg): Delete typedef.
+ (preg, preg_nz): Delete function. Replaced by phex and phex_nz.
+ * utils.c (phex, phex_nz): New functions.
+ (paddr, paddr_nz): Use.
+
+ * monitor.c (monitor_store_register): Replace preg with phex.
+
+Mon May 22 11:46:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Add note on typecast using catch_errors_ftype.
+
+2000-05-21 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (print_i387_value): Cast &value to (char *) in
+ pointer arithmetic. Fixes a bug which manifested itself on
+ FreeBSD.
+
+2000-05-20 J.T. Conklin <jtc@redback.com>
+
+ * target.h (target_memory_bfd_section): Removed declaration.
+ * target.c (target_memory_bfd_section): Removed.
+ * exec.c (xfer_memory): Removed #if'ed-out code which referenced
+ target_memory_bfd_section.
+
+ * target.h (target_read_memory_section): Removed declaration.
+ * target.c (target_read_memory_section): Removed.
+ (target_xfer_memory): Update, removed bfd_section argument.
+ (target_read_string, target_read_memory, target_write_memory):
+ Update for above change.
+
+ * gdbcore.h (read_memory_section): Removed declaration.
+ * corefile.c (read_memory_section): Removed.
+ * jv-lang.c (get_java_utf8_name): Changed calls to
+ read_memory_section to read_memory.
+ * printcmd.c (printf_command): Likewise.
+ * valops.c (value_at, value_fetch_lazy): Likewise.
+
+2000-05-18 J.T. Conklin <jtc@redback.com>
+
+ * configure.host, configure.tgt (powerpc-*-netbsd*): New entry.
+ * config/powerpc/nbsd.mh, config/powerpc/nbsd.mt,
+ config/powerpc/tm-nbsd.h, config/powerpc/nm-nbsd.h,
+ config/powerpc/xm-nbsd.h: New files.
+
+2000-05-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb/config/djgpp/README: Fine-tune installation instructions
+ based on user reports.
+
+Wed May 17 18:27:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (build_warnings): List possible warnings.
+ * configure: Regenerate.
+ * TODO: More updates.
+ * MAINTAINERS: Add Gary Thomas and Joern Renneck to Write After
+ Approval.
+
+Wed May 17 16:48:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-14 Gary Thomas <gthomas@redhat.com>:
+ * config/v850/tm-v850.h: Change breakpoint sequence to be
+ 'br *' since there is no 16bit "illegal" instruction on this
+ processor.
+
+Tue May 16 18:57:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Review. Delete anything that is no longer applicable.
+
+Tue May 16 14:17:20 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (free_current_contents): Make more robust.
+
+Tue May 16 13:30:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symtab.h (make_cleanup_discard_minimal_symbols): Replace
+ discard_minimal_symbols.
+ * minsyms.c (make_cleanup_discard_minimal_symbols):
+ (do_discard_minimal_symbols_cleanup): New functions.
+
+ * xcoffread.c (xcoff_initial_scan), somread.c (som_symfile_read),
+ solib.c (solib_add_common_symbols), os9kread.c
+ (os9k_symfile_read), nlmread.c (nlm_symfile_read), mipsread.c
+ (mipscoff_symfile_read), elfread.c (elf_symfile_read), dstread.c
+ (dst_symfile_read), dbxread.c (dbx_symfile_read), coffread.c
+ (coff_symfile_read): Replace make_cleanup.
+
+Mon May 15 09:32:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.h (add_set_cmd): Change VAR parameter to void pointer.
+ (add_set_enum_cmd): Change VAR parameter to char pointer pointer.
+ (struct command): Change member VAR to void pointer.
+ * command.c (add_set_cmd, add_set_enum_cmd): Update.
+
+ * remote.c (add_packet_config_cmd), mips-tdep.c
+ (_initialize_mips_tdep), infrun.c (_initialize_infrun),
+ i386-tdep.c (_initialize_i386_tdep), arm-tdep.c
+ (_initialize_arm_tdep): Update VAR parameter to add_set_enum_cmd.
+
+Tue May 16 12:46:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * wrapper.h (wrap_value_subscript): Delete declaration.
+
+Tue May 16 10:54:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (make_cleanup_bfd_close): Add declaration.
+ * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_close): New
+ functions.
+
+ * symfile.c (generic_load), sparcl-tdep.c (download), remote-udi.c
+ (download), remote-e7000.c (e7000_load), corelow.c (core_open,
+ core_file_to_sym_file): Replace calls to make_cleanup.
+
+Mon May 15 16:50:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Add notes on register cache.
+
+Mon May 15 21:27:27 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * sh-tdep.c (sh_dsp_reg_names, sh3_dsp_reg_names): New arrays.
+ (sh_processor_type_table): Add entries for bfd_mach_sh_dsp and
+ bfd_mach_sh3_dsp.
+ (sh_show_regs): Floating point registers are called fr0-fr15.
+ For sh4, display fpul, fpscr and fr0-fr15 / dr0-dr14 as appropriate.
+ Handle sh-dsp and sh3-dsp.
+ config/sh/tm-sh.h (REGISTER_VIRTUAL_TYPE): sh-dsp / sh3-dsp
+ don't have floating point registers.
+ (DSR_REGNUM, A0G_REGNUM, A0_REGNUM, A1G_REGNUM, A1_REGNUM): Define.
+ (M0_REGNUM, M1_REGNUM, X0_REGNUM, X1_REGNUM, Y0_REGNUM): Likewise.
+ (Y1_REGNUM, MOD_REGNUM, RS_REGNUM, RE_REGNUM, R0B_REGNUM): Likewise.
+
+2000-05-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (gdbtypes.o, varobj.o): Depend on wrapper.h.
+
+ * wrapper.h (gdb_value_subscript, wrap_value_subscript): Add
+ prototypes.
+
+Mon May 15 15:31:30 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (hand_function_call): Replace #ifdef
+ SAVE_DUMMY_FRAME_TOS with if SAVE_DUMMY_FRAME_TOS_P.
+
+ * gdbarch.sh (SAVE_DUMMY_FRAME_TOS): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+Mon May 15 16:05:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ax.h (make_cleanup_free_agent_expr): Add declaration.
+ * ax-general.c (do_free_agent_expr_cleanup):
+ (make_cleanup_free_agent_expr): New functions.
+
+ * tracepoint.c (validate_actionline, encode_actions), ax-gdb.c
+ (expr_to_agent, gen_trace_for_expr, agent_command): Replace calls
+ to make_cleanup.
+
+Mon May 15 14:06:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.h (make_cleanup_delete_breakpoint,
+ make_exec_cleanup_delete_breakpoint): Declare.
+ * breakpoint.c (make_cleanup_delete_breakpoint,
+ make_exec_cleanup_delete_breakpoint,
+ do_delete_breakpoint_cleanup): New fuctions.
+
+ * infcmd.c (finish_command), hppa-tdep.c (hppa_pop_frame),
+ breakpoint.c (until_break_command, until_break_command): Replace
+ call to make_cleanup / make_exec_cleanup.
+
+Mon May 15 13:25:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (core_addr_greaterthan, core_addr_lessthan), utils.c
+ (core_addr_greaterthan, core_addr_lessthan): Move from here.
+ * arch-utils.h (core_addr_greaterthan, core_addr_lessthan),
+ arch-utils.c (core_addr_greaterthan, core_addr_lessthan): To here.
+
+Mon May 15 12:07:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * printcmd.c (print_frame_args), stack.c (print_frame), command.c
+ (do_setshow_command), breakpoint.c (print_it_typical, mention):
+ Use make_cleanup_ui_out_stream_delete.
+
+Mon May 15 11:23:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * proc-events.c (init_syscall_table): Delete stray ``;''.
+ * ui-out.c (ui_out_set_flags, ui_out_clear_flags): Return old
+ value.
+ * mdebugread.c (START_PSYMTAB): Add paren to avoid x=x=x.
+
+2000-05-12 Michael Snyder <msnyder@cygnus.com>
+
+ * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Define.
+
+2000-05-12 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (dwarf2_const_value_data): Fix typo in sign
+ extension code.
+
+Fri May 12 20:38:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Mention weak symbol problem. Mention UnixWare thread
+ problem.
+
+Fri May 12 14:12:17 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * README: Update section on kernel debugging.
+
+Fri May 12 19:13:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (mips_get_saved_register): New function. Handle
+ case of 32 ABI saving 32 bit registers on stack when target has 64
+ bit ISA.
+ (mips_gdbarch_init): Update.
+
+Fri May 12 14:46:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (MIPS_EABI): Fix typo. Test for MIPS_ABI_EABI64.
+
+Thu May 11 21:52:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (WERROR_CFLAGS): Check that GCC accepts a -W
+ options before using them. Report result.
+ * configure: Regenerate.
+
+2000-05-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * coffread.c (coff_symtab_read): In the case of C_THUMBEXT |
+ C_THUMBEXTFUNC | C_EXT, sec will never ever be the index for
+ .rodata, because cs_to_section doesn't deal with .rodata. Fix test
+ accordingly.
+
+Thu May 11 21:33:59 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (gdbarch_dump): Print the value of GDB_MULTI_ARCH.
+ Always check that a macro is defined before printing it.
+ * gdbarch.c: Re-generate.
+
+Thu May 11 17:22:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * README: Update for GDB 5.0.
+
+Thu May 11 13:24:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (MIPS_DEFAULT_STACK_ARGSIZE): Fix typo.
+
+ * config/mips/tm-irix5.h (GDB_MULTI_ARCH): Add
+ definition. Disable. Document known problems.
+ (MIPS_DEFAULT_ABI): Define.
+
+ * mips-tdep.c (enum mips_abi): Define.
+ (struct gdbarch_tdep): Replace mips_eabi with mips_abi.
+ (MIPS_EABI): Update.
+ (mips_gdbarch_init): Add preliminary support for IRIX N32 ABI.
+ Determine ABI from either ELF_FLAGS or MIPS_DEFAULT_ABI. When
+ looking for a matching architecture require a matching MIPS_ABI.
+ (mips_gdbarch_init): Cleanup arch_debug information.
+
+2000-05-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * solib.c (symbol_add_stub): Remember the index and the name of
+ the section with the lowest address. Use this data (instead of
+ data from .text) to pass info into symbol_file_add.
+
+ * elfread.c (record_minimal_symbol_and_info): Use the section
+ where the symbol lives to get the index, instead of guessing.
+
+2000-05-10 Michael Snyder <msnyder@cygnus.com>
+
+ Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI).
+ * sparc-tdep.c: include arch-utils.h.
+ (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE,
+ DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions.
+ (GDB_TARGET_IS_SPARC64): make into a runtime test.
+ (struct frame_extra_info): Define, use instead of the macro.
+ (Many places): Use alloca instead of statically allocated buffers
+ that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE.
+ (sparc_extract_struct_value_address): Accept a pointer arg instead
+ of an array sized by REGISTER_BYTES.
+ (examine_prologue): Accept a pointer to an array of CORE_ADDR,
+ instead of the defunct struct frame_saved_regs. Recognize new
+ Sparc64 store instructions as part of the prologue. Ignore the
+ destination of a frame store when parsing the prologue (so long
+ as it's on the stack).
+ (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE.
+ (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR
+ instead of the defunct struct frame_saved_regs.
+ (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to
+ supply_register. Provide 4-byte offset to compensate for diff
+ between size of the prgreg_t elements on a 64-bit host and size
+ of the registers for a 32-bit target. Fill all inaccessible regs
+ with zero so they won't keep being requested again and again.
+ (fill_gregset): Handle 32/64 size difference between registers
+ and prgreg_t. Handle as many new 64-bit regs as possible.
+ (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world.
+ (sparc_push_arguments): Rename to sparc32_push_arguments.
+ Copy arguments into registers as well as onto stack, so that the
+ CALL_DUMMY (code pushed onto the target stack) is not required.
+ (sparc_extract_return_value): Rename to sparc32_extract_return_value.
+ (sparc_store_return_value): Use memset instead of bzero.
+ Use write_register_gen instead of write_register_bytes.
+ (sparclet_store_return_value): New function.
+ (_initialize_sparc_tdep): Call register_gdbarch_init to activate
+ the gdbarch multi-architecture system.
+ (sp64_push_arguments): Rename to sparc64_push_arguments.
+ Extend to store arguments in general registers as well as on stack.
+ (sparc64_extract_return_value): Rename to sp64_extract_return_value.
+ Use as a private function, to be called by the new external function
+ sparc64_extract_return_value.
+ (sparclet_extract_return_value): New function.
+ (sparc32_stack_align, sparc64_stack_align, sparc32_register_name,
+ sparc64_register_name, sparc_print_extra_frame_info,
+ sparclite_register_name, sparclet_register_name,
+ sparc_push_return_address, sparc64_use_struct_convention,
+ sparc32_store_struct_return, sparc64_store_struct_return,
+ sparc32_register_virtual_type, sparc64_register_virtual_type,
+ sparc32_register_size, sparc64_register_size,
+ sparc32_register_byte, sparc64_register_byte,
+ sparc_gdbarch_skip_prologue, sparc_convert_to_virtual,
+ sparc_convert_to_raw, sparc_frame_init_saved_regs,
+ sparc_frame_address, sparc_gdbarch_fix_call_dummy,
+ sparc_coerce_float_to_double, sparc_call_dummy_address,
+ sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size,
+ sparc_return_value_on_stack): New functions supporting multi-arch.
+ (sparc_gdbarch_init): New function; initialize multi-arch.
+ (struct gdbarch_tdep): Define, use for private multi-arch data.
+ * config/sparc/tm-sparc.h: Move definitions around, enclose with
+ #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate
+ definitions. Add enums for register names, to help debugging gdb.
+ This header file must work for non-multi-arch and for multi-arch.
+ * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add
+ AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case.
+ Define GDB_MULTI_ARCH.
+ * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration.
+ Do not define GDB_MULTI_ARCH (bfd does not correctly identify target).
+ * config/sparc/tm-sparclite.h: Ditto.
+ * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH.
+ * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to
+ avoid using deprecated REGISTER_NAMES macro.
+ * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
+
+2000-05-08 Michael Snyder <msnyder@cygnus.com>
+
+ * gdbarch.sh: Add FP0_REGNUM to list of multi-arched register numbers.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * core-regset.c: Change FP0_REGNUM to a runtime test.
+ * procfs.c: Ditto.
+ * sun3-nat.c: Ditto.
+ * sparc-tdep.c: Ditto.
+
+ * i386mach-nat.c: Remove unnecessary ifdef for FP0_REGNUM.
+ * ptx4-nat.c: Ditto.
+
+ * sol-thread.c (sol_thread_create_inferior): only add the thread
+ to the thread list if it is not already in there.
+ (prototypes for thread_db func ptrs): pretty up formatting.
+
+2000-05-08 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/djconfig.sh: Use more warning switches.
+
+ * config/djgpp/fnchange.lst: Replace the leading gdb-0222 with the
+ @V@ placebo. djunpack.bat changed accordingly.
+
+Mon May 8 11:19:47 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c (size_auto, size_32, size_64, size_enums): Rename
+ saved_gpreg_size_auto, saved_gpreg_size_32, saved_gpreg_size_64
+ and saved_gpreg_size_enums.
+ (mips_stack_argsize): Update. Cleanup.
+
+ * mips-tdep.c (STACK_ARGSIZE): Delete macro. Replaced by
+ MIPS_STACK_ARGSIZE.
+ (MIPS_NABI32): Delete macro. Replaced by
+ MIPS_REGS_HAVE_STACK_HOME_P.
+ (mips_push_arguments): Update.
+ (mips_push_arguments): Replace check for MIPS_EABI or MIPS_NABI32
+ with test for MIPS_REGS_HAVE_STACK_HOME_P.
+ (MIPS_REGS_HAVE_STACK_HOME_P): Define. Provide non- multi-arch
+ default.
+ (struct gdbarch_tdep): Add mips_regs_have_stack_home_p and
+ mips_default_stack_argsize.
+ (MIPS_STACK_ARGSIZE): Define as mips_stack_argsize.
+ (mips_stack_argsize_string): New static variable.
+ (mips_stack_argsize): New function, handle default case.
+ (__initialize_mips_tdep): Add command ``set mips stack-arg-size''
+ implemented as an enum using size_auto et.al.
+ (mips_gdbarch_init): Initialize mips_default_stack_argsize and
+ mips_regs_have_stack_home_p.
+
+ * config/mips/tm-irix5.h (MIPS_DEFAULT_SAVED_REGSIZE): Define as 8
+ for n32.
+ (MIPS_REGS_HAVE_STACK_HOME_P): Define as 0 for n32.
+
+Mon May 8 00:49:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * procfs.c (PROCFS_TRACE): Delete definition.
+ * proc-utils.h (PROCFS_NOTE, PROC_PRETTYFPRINT_STATUS): Always
+ define.
+
+2000-05-05 Michael Snyder <msnyder@cygnus.com>
+
+ * procfs.c: Cleanup of procfs tracing. Move defines and
+ prototypes to proc-utils.h
+ * proc-utils.h: Define tracing macros. Declare trace functions.
+ * proc-api.c: Make procfs tracing a runtime option.
+ (prepare_to_trace): New function, abstracted out of several
+ places. Open a trace file if one is required.
+ (ioctl_with_trace, write_with_trace, open_with_trace,
+ close_with_trace, wait_with_trace, lseek_with_trace):
+ Report errno if an error occurs in a system call.
+ (write_with_trace): Make 2nd arg void *, to agree with write.
+
+2000-05-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * elfread.c (elf_symtab_read): The calculation of 'offset'
+ must be done for each symbol, not just once. The index
+ used must be the index of the section where 'sym' resides,
+ not .text.
+
+2000-05-05 Michael Snyder <msnyder@cygnus.com>
+
+ * procfs.c (many functions): change int cmd; to long cmd;
+ Solaris /proc API calls this parameter a long, and requires it
+ for 64-bit hosts (where sizeof(long) != sizeof(int)). UnixWare
+ calls it an int, but on existing UnixWare hosts, int and long
+ are the same size. So long it must be. If a future UnixWare
+ version has problems with this, we'll have to use autoconf.
+ * proc-api.c (write_with_trace): use long instead of int.
+
+2000-05-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c: Define PT_READ_U and PT_WRITE_U if they're not
+ already defined.
+
+2000-05-01 Mark Kettenis <kettenis@gnu.org>
+
+ * infrun.c (handle_inferior_event): Add missing call to keep_going
+ and missing return when handling an ordinary signal from the
+ inferior.
+
+2000-05-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
+ SECT_OFF_RODATA): Define as functions of OBJFILE. Add
+ sect_index_text, sect_index_data, sect_index_rodata,
+ sect_index_bss to objfile structure.
+ * gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
+ SECT_OFF_RODATA): Remove.
+ * objfiles.c (allocate_objfile): Initialize
+ sect_index_{text,data,bss,rodata} to -1, for error detection.
+
+ * symfile.c (default_symfile_offsets): Initialize
+ sect_index_{text,data,bss,rodata} from bfd information.
+ * xcoffread.c (xcoff_symfile_offsets): Ditto.
+ * somread.c (som_symfile_offsets): Initialize
+ sect_index_{text,data,bss,rodata}.
+
+ * coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
+ hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
+ mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
+ remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
+ stabsread.c, symfile.c, xcoffread.c:
+ Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
+ current objfile.
+
+ * xcoffread.c: Add new field objfile to find_targ_sec_arg.
+
+Thu May 4 20:54:00 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/mips/tm-mipsv4.h (Dest_Reg), config/mips/tm-irix5.h
+ (MIPS_NUM_ARG_REGS, Dest_Reg), config/mips/tm-mips.h
+ (MIPS_NUM_ARG_REGS), config/mips/tm-mips.h (MIPS_NUM_FP_ARG_REGS):
+ Delete unused macros.
+
+2000-05-03 Michael Snyder <msnyder@cygnus.com>
+
+ * solib.c (elf_locate_base, info_sharedlibrary_command):
+ Look at the bfd to determine if it is elf32 or elf64, rather
+ than using an ifdef. This makes it runtime teststable and
+ multi-arch.
+
+2000-05-01 Mark Kettenis <kettenis@gnu.org>
+
+ * infrun.c (handle_inferior_event): When doing a "next", and
+ stepping out of a signal handler into its calling trampoline
+ ignore the value of step_frame_address.
+ (step_over_function): Only modify step_resume_breakpoint->frame if
+ the value of step_frame_address is non-zero.
+
+2000-05-03 Michael Snyder <msnyder@cygnus.com>
+
+ * monitor.c (monitor_fetch_register): MAX_REGISTER_RAW_SIZE
+ is not static in the MULTI_ARCH world, so don't use it in a
+ static array declaration.
+
+2000-05-03 Elena Zannoni <ezannoni@makita.cygnus.com>
+
+ * symtab.c (in_prologue): From Jim Blandy. Rewrite, more
+ intelligently, making sure we use the information from the
+ symbol tables fully.
+
+2000-05-02 H.J. Lu <hjl@gnu.org>
+
+ * ia64-tdep.c (ia64_gdbarch_init): Reference to ELFOSABI_NONE
+ instead of ELFOSABI_SYSV.
+
+Tue May 2 19:07:20 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (NPC_REGNUM, NNPC_REGNUM): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * gdbserver/remote-utils.c (prepare_resume_reply): Change #ifdef
+ NPC_REGNUM to run-time test.
+ * findvar.c (generic_target_write_pc): Change #ifdef NPC_REGNUM
+ and NNPC_REGNUM to run-time test.
+ * procfs.c (procfs_fetch_registers): Change #ifdef NPC_REGNUM to
+ run-time test.
+ (procfs_store_registers): Ditto.
+
+Tue May 2 18:48:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Provide non- multi-arch defaults by direct
+ definition in "gdbarch.h" instead of going through "gdbarch.c".
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * defs.h: When non- multi-arch, include "arch-utils.h" so that
+ legacy definitions are globally visible.
+
+Tue May 2 16:32:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Syd Polk to gdbtk maintainers.
+ (symtabs): Add Elena to symtabs maintainers list.
+ (Blanket Write Privs): Add Jim Blandy.
+
+2000-05-01 Stan Shebs <shebs@apple.com>
+
+ Remove obsolete Gould configuration:
+ * configure.host, configure.tgt: Remove Gould configs.
+ * Makefile.in: Remove Gould-related actions.
+ * gould-xdep.c, gould-tdep.c, config/gould/*: Remove files.
+ * NEWS: Mention removal.
+
+Mon May 1 15:37:58 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-28 Andreas Jaeger <aj@suse.de>:
+ * defs.h: Properly check for GCC version number.
+
+2000-04-30 Mark Kettenis <kettenis@gnu.org>
+
+ Fix single-stepping out of signal trampolines.
+ * config/i386/nm-linux.h (CHILD_RESUME): Define.
+ * i386-linux-nat.c (child_resume): New function.
+
+Fri Apr 28 16:22:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * blockframe.c (frameless_look_for_prologue): Use
+ PROLOG_FRAMELESS_P instead of SKIP_PROLOGUE_FRAMELESS_P.
+ * gdbarch.sh (PROLOG_FRAMELESS_P): Define.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * arch-utils.h, arch-utils.c (generic_prologue_frameless_p): New
+ function.
+
+Fri Apr 28 15:31:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From "Serge Nikulin" <nikulin@actsw.amat.com>:
+ * m68k-tdep.c (delta68_in_sigtramp): Return 0 when the function
+ name is unknow.
+
+2000-04-27 Michael Snyder <msnyder@cygnus.com>
+
+ * gdbarch.sh (d10v_daddr_p, d10v_iaddr_p, d10v_convert_daddr_to_raw,
+ d10v_convert_iaddr_to_raw): make these multi-arch functions optional.
+ * gdbarch.c, gdbarch.h: regenerate
+
+Fri Apr 28 12:21:28 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu>:
+ * target.c (do_monitor_command): Cast tcomplain to correct
+ function type in comparison.
+
+Fri Apr 28 11:43:05 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-25 Guy Harris <guy@netapp.com>:
+ * config/alpha/alpha-osf3.mh (XDEPFILES): Add ser-tcp.o and
+ ser-pipe.o
+
+2000-04-27 Michael Snyder <msnyder@cygnus.com>
+
+ * jv-valprint.c (java_val_print): Add arg declaration,
+ fix compiler warning.
+ * corelow.c (core_open): Call set_gdbarch_from_file so that
+ gdbarch becomes aware of the architecture encoded in the
+ corefile.
+ * findvar.c (write_register_gen): Export this useful interface.
+ * value.h (write_register_gen): Declare.
+
+2000-04-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * cxux-nat.c (add_shared_symbol_files): Don't treat .text section
+ as special in the section_addr_info structure.
+ * pa64solib.c (pa64_solib_add_solib_objfile): Ditto.
+ * osfsolib.c (symbol_add_stub): Ditto.
+ * irix5-nat.c (symbol_add_stub): Ditto.
+
+Thu Apr 27 14:07:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mips-tdep.c, d10v-tdep.c: Include "arch-utils.h".
+
+Thu Apr 27 10:06:42 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Document IRIX X ARM cross compile problems.
+
+2000-04-26 Michael Snyder <msnyder@cygnus.com>
+
+ * utils.c (internal_verror): Call target_terminal_ours.
+ * wrapper.h: Fix minor comment typo.
+ * proc-api.c (write_with_trace): Change 'arg' from long to int.
+ Treat 'off_t' and 'size_t' as unsigned long in printfs.
+ (lseek_with_trace): Treat 'off_t' as unsigned long in printf.
+ * procfs.c (comments): Eliminate "???" in comments, which GCC
+ wants to interpret as a trigraph. (fill_gregset, supply_gregset,
+ fill_fpregset, supply_fpregset): Declare.
+ (procfs_wait): Sysargs is a long, change printf format to match.
+ (test-mapping, mapping_test, test_mapping_cmd) Remove (test only).
+
+2000-04-26 Kevin Buettner <kevinb@redhat.com>
+
+ * config/djgpp/fnchange.lst (ia64-linux-nat.c): Map to
+ ia64linux-nat.c.
+
+Wed Apr 26 13:50:35 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * ax-gdb.c (agent_command): Remove now useless cast of
+ `free_current_contents' when passed to `make_cleanup'.
+ * coffread.c (coff_symfile_read): Ditto.
+ * dwarf2read.c (dwarf2_add_member_fn, read_array_type): Ditto.
+ (dwarf_decode_lines): Ditto.
+ * eval.c (parse_and_eval_address, parse_and_eval_address_1): Ditto.
+ (parse_and_eval, parse_to_comma_and_eval): Ditto.
+ * parse.c (parse_exp_1): Ditto.
+ * printcmd.c (print_command_1, output_command, set_command): Ditto.
+ (x_command, print_frame_args, printf_command): Ditto.
+ * top.c (execute_control_command): Ditto.
+ * tracepoint.c (validate_actionline): Ditto.
+ * typeprint.c (whatis_exp, ptype_command): Ditto.
+ (maintenance_print_type): Ditto.
+
+2000-04-26 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (ALLDEPFILES): Add ia64-linux-tdep.c.
+ (ia64-linux-tdep.o): Add dependencies.
+ (ia64-tdep.o): Add dependency for arch-utils.h.
+ * ia64-linux-tdep.c, ia64-tdep.c (arch-utils.h): Include.
+
+2000-04-25 Michael Snyder <msnyder@cygnus.com>
+
+ * blockframe.c: Fix a minor typo in a comment.
+
+2000-04-25 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (examine_prologue): Recognize store instructions;
+ those whose source operands are input registers which haven't
+ been seen before are considered to be part of the prologue.
+
+Tue Apr 25 13:51:58 2000 glen mccready <gkm@pobox.com>
+
+ * rs6000-nat.c (xcoff_relocate_symtam): Recover from the wrong
+ patch being applied `Fri Apr 7 13:44:38 2000'.
+
+2000-04-24 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-tdep.c: New file.
+ * ia64-tdep.c (elf-bfd.h): Include.
+ (ia64_linux_sigcontext_register_address): New extern declaration.
+ (struct gdbarch_tdep): New struct.
+ (SIGCONTEXT_REGISTER_ADDRESS): New define.
+ (read_sigcontext_register): New static function.
+ (extract_bit_field, replace_bit_field, slotN_contents,
+ replace_slotN_contents): Made static.
+ (ia64_frame_chain, ia64_frame_saved_pc, ia64_init_extra_frame_info):
+ Added new code for signal handler frames and call dummy frames.
+ (ia64_frame_init_saved_regs): Handle signal handler frames.
+ (ia64_find_saved_register): Removed.
+ (ia64_get_saved_register): Handle call dummy frames; reorganized
+ to call generic_get_saved_register() to find registers saved
+ in previous frames.
+ (process_note_abi_tag_sections): New static function.
+ (ia64_gdbarch_init): Attempt to determine the ABI/OS of the
+ executable. Based upon this information, set target dependent
+ field sigcontext_register_address appropriately. Also set
+ FRAME_CHAIN_VALID to be generic_func_frame_chain_valid.
+ * config/ia64/linux.mt (TDEPFILES): Add ia64-linux-tdep.o.
+ * config/ia64/tm-linux.h (IN_SIGTRAMP): Define.
+ (ia64_linux_in_sigtramp): New declaration.
+
+2000-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * TODO, NEWS: Update due to inclusion of gdbmi.texinfo in the GDB
+ manual.
+
+2000-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/README: Explain how to unpack using djunpack.bat.
+
+Fri Apr 21 15:23:13 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * stabsread.c (REG_STRUCT_HAS_ADDR): Delete default.
+ (define_symbol): Check REG_STRUCT_HAS_ADDR_P before using
+ REG_STRUCT_HAS_ADDR.
+ (define_symbol): Ditto.
+
+ * valops.c (hand_function_call): Replace #ifdef
+ REG_STRUCT_HAS_ADDR with if REG_STRUCT_HAS_ADDR_P. Re-indent
+ affected code.
+
+ * gdbarch.sh (REG_STRUCT_HAS_ADDR): Add along with the predicate
+ function REG_STRUCT_HAS_ADDR_P.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2000-04-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb-stabs.h (SECT_OFF_MAX): Increase to 40.
+
+2000-04-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * win32-nat.c (handle_load_dll): Don't treat .text as a special
+ section anymore.
+ * somread.c (som_symfile_offsets): Ditto.
+ * somsolib.c (som_solib_add_solib_objfile): Ditto.
+
+Fri Apr 21 16:14:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Make Jimmy Guo TUI maintainer.
+
+Fri Apr 21 14:37:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.h (help_all): Delete declaration.
+ * command.c (help_all): Add declaration. Convert function
+ argument list to ISO-C.
+
+Thu Apr 20 18:15:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (d10v_gdbarch_init): Initialize stack_align.
+ (d10v_stack_align): Make static.
+ * config/d10v/tm-d10v.h (STACK_ALIGN): Delete.
+
+Thu Apr 20 14:35:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (hand_function_call): Replace #ifdef STACK_ALIGN with
+ run-time test for STACK_ALIGN_P.
+ * gdbarch.sh: Add support for function and variable predicates.
+ (STACK_ALIGN): Add. Implement with predicate - STACK_ALIGN_P.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+Thu Apr 20 17:39:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h, utils.c (free_current_contents): Change parameter to
+ void*.
+
+ From Philippe De Muyter <phdm@macqel.be>:
+ * printcmd.c (print_address_symbolic): Call `make_cleanup' with
+ `(free_current_contents, &x)', not `(free, x)'.
+ * utils.c (free_current_contents): Do not `free (NULL)'.
+
+ * printcmd.c (print_address_symbolic): Cleanup after a failed
+ call to build_address_symbolic.
+
+2000-04-20 Christopher Faylor <cgf@cygnus.com>
+
+ * wince-stub.c (FREE): New macro.
+ (mempool): Just free any buffer prior to reuse. Don't bother with
+ realloc.
+ (flag_single_step): New function.
+ (skip_message): Detect "helpful" Windows CE messages and skip sending
+ them to the host.
+ (wait_for_debug_event): Use skip_message to avoid sending debug
+ messages to the host.
+ (dispatch): Prelimary implementation of single step detection.
+ * wince.c: Rework SH single stepping code to be more consistent with
+ other wince targets.
+ (handle_output_debug_string): Allow first chance exceptions to come
+ through since they seem to be all that we get on some versions of
+ Windows CE.
+ (check_for_step): New function, conditionally compiled based on target.
+ (regptr): Delete obsolete function.
+ (handle_exception): Detect illegal instructions.
+ (get_child_debug_event): Return success only if event code matches
+ target.
+ (child_create_inferior): Reflect change to get_child_debug_event
+ arguments.
+
+2000-04-20 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (thread_rec): Be more defensive about suspending already
+ suspended threads.
+ (safe_symbol_file_add_stub): New function.
+ (safe_symbole_file_add_cleanup): New function.
+ (safe_symbol_file_add): New function.
+ (handle_load_dll): Use wrapper to add DLL symbol information to avoid
+ bogus errors from non-stabs DLLs.
+ (handle_exception): Add work around for detection of first exception
+ breakpoint which does not seem to occur on W2K. Detect more "signals"
+ that can be effectively passed to the debuggee. Reorganize to eliminate
+ continue_status global.
+ (child_continue): Reorganize to eliminate continue_status global.
+ (child_wait): Ditto.
+ (child_resume): Ditto.
+ (get_child_debug_event): Ditto. Recognize when an a breakpoint
+ exception should be ignored. Change method for signalling when an
+ important event has occured to the caller.
+ (child_create_inferior): Use new method for noticing when
+ get_child_debug_event has found something interesting.
+
+Fri Apr 7 13:44:38 2000 glen mccready <gkm@pobox.com>
+
+ * rs6000-nat.c (xcoff_relocate_symtab): Grow buffer if ptrace()
+ fails due to lack of space.
+
+Fri Mar 24 12:10:38 2000 glen mccready <gkm@pobox.com>
+
+ * command.c, command.h (help_all): Add functionality to display
+ a complete listing of available commands.
+
+2000-04-20 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-nat.c (PIDGET, TIDGET): New.
+ (get_thread_id, GET_THREAD_ID): New.
+ (fetch_nwfpe_register, store_nwfpe_register): New.
+ (fetch_register, store_register): New.
+ (fetch_fpregister, store_fpregister): New.
+ (fill_gregset, supply_gregset): New.
+ (fill_fpregset, supply_fpregset): New.
+ (fetch_fpregs): Modified to use thread id's.
+ (store_fpregs): Modified to use thread id's and
+ fetch_nwfpe_register.
+ (fetch_regs): Modified to use thread id's.
+ (store_regs): Modified to use thread id's.
+ (fetch_inferior_registers): Modified to handle single register
+ fetches.
+ (store_inferior_registers): Modified to handle single register
+ stores.
+ (arm_linux_register_u_addr): Removed.
+
+ * configure.tgt: Added gdbserver to configdirs for arm*-*-linux*.
+
+ * config/arm/linux.mh
+ (NATDEPFILES): Removed core-aout.o. Added core-regset.o.
+ (LOADLIBES): Define.
+
+ * config/arm/nm-linux.h: Include config/nm-linux.h.
+ (ATTACH_DETACH): Removed. Defined in config/nm-linux.h.
+ (REGISTER_U_ADDR): Removed.
+ (SVR4_SHARED_LIBS): Removed. Defined in config/nm-linux.h.
+ (#include "solib.h"): Removed. Included via config/nm-linux.h.
+
+Thu Apr 20 18:54:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Daniel Berlin <dan@cgsoftware.com> and Tim Mooney
+ <mooney@dogbert.cc.ndsu.nodak.edu>:
+ * infrun.c (follow_fork_mode_kind_names): NULL terminate
+ array. Re-indent.
+ (scheduler_enums): Ditto.
+
+Mon Apr 17 13:37:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Make multi-arch variable defaults, defaults for non-
+ multi-arch targets.
+ (TARGET_BFD_VMA_BIT, IEEE_FLOAT, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS): Update.
+
+ * inferior.h (CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS): Default
+ provided by gdbarch.
+ (CALL_DUMMY_P): Add FIXME. gdbarch should provide default.
+
+ * valprint.c (IEEE_FLOAT): Default provided by gdbarch.
+
+2000-04-19 Jim Blandy <jimb@redhat.com>
+
+ Bring RETURN_VALUE_ON_STACK under gdbarch's control.
+ * gdbarch.sh (RETURN_VALUE_ON_STACK): New entry.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * arch-utils.c (default_return_value_on_stack): New function.
+ * arch-utils.h (default_return_value_on_stack): New declaration.
+ * values.c (RETURN_VALUE_ON_STACK): Delete default definition.
+
+ * i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
+ two-dimensional array, instead of faking it with explicit index
+ arithmetic.
+
+ * minsyms.c (prim_record_minimal_symbol_and_info): Doc fix.
+ (Thanks to Guy Harris.)
+
+2000-04-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * xcoffsolib.c (solib_add): Fix call to vmap_symtab().
+
+2000-04-19 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * TODO: Update.
+
+Wed Apr 19 19:10:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Document -Wreturn-type problem.
+
+2000-03-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * maint.c (_initialize_maint_cmds): Add `mt i' alias for `mt info'.
+
+2000-03-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * infcmd.c (_initialize_infcmd): Add `info r' alias for
+ `info registers'.
+
+Wed Apr 19 17:03:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Philippe De Muyter <phdm@macqel.be>:
+ * bcache.c (free_bcache): Do not free NULL.
+
+Wed Apr 19 16:37:47 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Cleanup.
+ * NEWS: Update GDB version. Duplicate paragraph explaining
+ obsolete.
+
+Wed Apr 19 13:06:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (distclean): Delete tui/Makefile.
+ * TODO: Add deletion of tui/Makefile.in to list.
+
+2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * symfile.h (struct section_addr_info ): Remove fields for special
+ treatment of .text, .data and .bss sections.
+
+ * solib.c (symbol_add_stub): The special field text_addr is not
+ available anymore. Search for the .text field the hard way.
+
+ * symfile.c (build_section_addr_info_from_section_table): Don't
+ fill in {text, data, bss}_addr any more.
+ (default_symfile_offsets): Don't use {text, data, bss}_addr fields
+ to fill in section_offsets for objfile.
+ (syms_from_objfile): Don't deal with {text, data, bss}_addr as a
+ special case anymore.
+ (add_symbol_file_command): Ditto.
+
+2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ symfile.c: (symbol_file_command): Remove support for rombug, to
+ simplify code.
+
+2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * symfile.c (add_symbol_file_command): Rewrite the arguments
+ processing part. Simplify syntax of command. Remove support for
+ rombug.
+ (_initialize_symfile): Update help message for add-symbol-file
+ command.
+
+Mon Apr 17 15:53:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (IEEE_FLOAT): Only dump when defined.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+Mon Apr 17 11:26:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (REMOTE_TRANSLATE_XFER_ADDRESS), mem-break.c
+ (MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT), target.h
+ (BREAKPOINT_FROM_PC), valops.c (COERCE_FLOAT_TO_DOUBLE),
+ gdbarch.sh (D10V_MAKE_DADDR, D10V_MAKE_IADDR,
+ FRAMELESS_FUNCTION_INVOCATION, REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW,
+ REGISTER_NAME), findvar.c (POINTER_TO_ADDRESS,
+ ADDRESS_TO_POINTER): Delete default definition. Handled by
+ gdbarch.
+
+ * gdbarch.sh: Make multi-arch defaults, defaults for non-
+ multi-arch targets.
+ (REGISTER_NAME, COERCE_FLOAT_TO_DOUBLE, REGISTER_CONVERTIBLE,
+ REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW,
+ D10V_MAKE_DADDR, D10V_MAKE_IADDR, BREAKPOINT_FROM_PC,
+ MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT,
+ REMOTE_TRANSLATE_XFER_ADDRESS, FRAMELESS_FUNCTION_INVOCATION):
+ Provide default/legacy implementation.
+ (REGISTER_NAMES, CALL_DUMMY): Allow legacy definition.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2000-04-16 Jim Blandy <jimb@redhat.com>
+
+ * findvar.c (store_typed_address, extract_typed_address): Fix
+ function names in error messages.
+
+2000-04-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/config.sed: Fix the lines which edit clean: and
+ uninstall-info: targets.
+
+2000-04-14 Jim Blandy <jimb@redhat.com>
+
+ Bring IEEE_FLOAT under gdbarch's control.
+ * gdbarch.sh (IEEE_FLOAT): New entry.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * valprint.c (IEEE_FLOAT): Provide a default #definition for this.
+ (print_floating): Use IEEE_FLOAT as if it were an expression; use
+ the code specific to IEEE-format numbers whenever the value of
+ IEEE_FLOAT is non-zero.
+ * config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
+ config/arc/tm-arc.h, config/arm/tm-arm.h, config/fr30/tm-fr30.h,
+ config/h8300/tm-h8300.h, config/i386/tm-i386.h,
+ config/i960/tm-i960.h, config/m88k/tm-m88k.h,
+ config/mips/tm-mips.h, config/pa/tm-hppa.h,
+ config/sparc/tm-sparc.h (IEEE_FLOAT): For all ports that #define
+ IEEE_FLOAT, make sure they give it the value (1).
+
+ Provide the hooks needed to support architectures on which
+ pointers are not always simple byte addresses.
+
+ * gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Two new
+ functions which architectures can redefine, defaulting to
+ generic_pointer_to_address and generic_address_to_pointer.
+ * findvar.c (extract_typed_address, store_typed_address,
+ generic_pointer_to_address, generic_address_to_pointer): New
+ functions.
+ (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
+ definitions.
+ (extract_address, store_address): Doc fixes.
+ * values.c (value_as_pointer): Doc fix.
+ (value_from_pointer): New function.
+ * defs.h (extract_typed_address, store_typed_address): New
+ declarations.
+ * inferior.h (generic_address_to_pointer,
+ generic_pointer_to_address): New declarations.
+ * value.h (value_from_pointer): New declaration.
+
+ The following changes are all of the general form "Use these
+ functions instead of these other functions." In each case, the
+ change is because the new calls provide enough information to do
+ the appropriate address / pointer conversions, where the old calls
+ did not, or because the new functions are more appropriately named
+ for the operation being performed.
+
+ * ax-gdb.c (const_var_ref): Use value_from_pointer, not
+ value_from_longest.
+ * blockframe.c (generic_push_dummy_frame): Use read_pc and
+ read_sp, not read_register.
+ * c-valprint.c (c_val_print): Use extract_typed_address instead of
+ extract_address to extract vtable entries and references.
+ * cp-valprint.c (cp_print_value_fields): Use value_from_pointer
+ instead of value_from_longest to extract the vtable's address.
+ * eval.c (evaluate_subexp_standard): Use value_from_pointer
+ instead of value_from_longest to compute `this', and for doing
+ pointer-to-member dereferencing.
+ * findvar.c (read_register): Use extract_unsigned_integer, not
+ extract_address.
+ (read_var_value): Use store_typed_address instead of store_address
+ for building label values.
+ (locate_var_value): Use value_from_pointer instead of
+ value_from_longest.
+ * hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
+ instead of value_from_longest, to build arguments to __d_shl_get.
+ * printcmd.c (set_next_address): Use value_from_pointer, not
+ value_from_longest.
+ (x_command): Use value_from_pointer, not value_from_longest.
+ * tracepoint.c (set_traceframe_context): Use value_from_pointer,
+ not value_from_longest.
+ * valarith.c (value_add, value_sub): Use value_from_pointer, not
+ value_from_longest.
+ * valops.c (find_function_in_inferior, value_coerce_array,
+ value_coerce_function, value_addr, hand_function_call): Same.
+ * value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
+ * values.c (unpack_long): Use extract_typed_address to produce
+ addresses from pointers and references, not extract_address.
+ (value_from_longest): Use store_typed_address instead of
+ store_address to produce pointer and reference values.
+
+2000-04-13 Mark Kettenis <kettenis@gnu.org>
+
+ * acconfig.h (HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, HAVE_LWPID_T,
+ HAVE_PSADDR_T): Add them here instead of in config.in.
+
+ * acconfig.h (PRFPREGSET_T_BROKEN): New define.
+ * configure.in: Add check for broken prfpregset_t type.
+ * lin-thread.c (gdb_prfpregset): New typedef, depends on
+ definition of PRFPREGSET_T_BROKEN.
+ (ps_lgetfpregs, ps_lsetfpregs, p_td_thr_getfpregs,
+ p_td_thr_setfpregs, thread_db_fetch_registers,
+ thread_db_store_registers): Use gdb_prfpregset_t instead of
+ prfpregset_t.
+ * config.in: Regenerated.
+ * configure: Regenerated.
+
+2000-04-13 DJ Delorie <dj@cygnus.com>
+
+ * mips-tdep.c (do_fp_register_row): copy the number of bytes
+ allocated, not the size of the pointer.
+
+2000-04-13 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * config/i386/nm-i386sol2.h (CANNOT_STEP_HW_WATCHPOINTS): Define.
+ * config/i386/tm-i386sol2.h (HAVE_I387_REGS): Define.
+ * i386v4-nat.c (supply_fpregset, fill_fpregset): Add code
+ to handle floating point registers if NUM_FREGS is not zero.
+
+2000-04-13 Nick Duffek <nsd@cygnus.com>
+
+ * sol-thread.c (init_sol_core_ops): Initialize to_thread_alive
+ and document to_find_new_threads bug.
+
+2000-04-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * infrun.c (proceed, normal_stop): Change the error message about
+ failure to insert breakpoints/watchpoints so that it makes sense
+ even if ptrace is not used or no other processes can be active.
+
+Thu Apr 13 13:24:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in: Add --enable-maintainer-mode.
+ * aclocal.m4, configure: Re-generate.
+
+ * Makefile.in ($(srcdir)/copying.c): Enable dependencies only when
+ on maintainer-mode. Update copying.c in source directory.
+ (copying.txt): Delete rule.
+ (copying.o): Add explict paths to $(srcdir) and explicit make
+ rule.
+
+2000-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-nat.c (IA64_PSR_DB, IA64_PSR_DD): Define.
+ (fetch_debug_register, fetch_debug_register_pair,
+ store_debug_register, store_debug_register_pair, is_power_of_2,
+ enable_watchpoints_in_psr, ia64_linux_insert_watchpoint,
+ ia64_linux_remove_watchpoint, ia64_linux_stopped_by_watchpoint):
+ New functions.
+ * config/ia64/nm-linux.h (TARGET_HAS_HARDWARE_WATCHPOINTS,
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_STEPPABLE_WATCHPOINT,
+ STOPPED_BY_WATCHPOINT, target_insert_watchpoint,
+ target_remove_watchpoint): Define.
+ (ia64_linux_stopped_by_watchpoint, ia64_linux_insert_watchpoint,
+ ia64_linux_remove_watchpoint): Declare.
+
+2000-04-12 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_insert_hw_breakpoint): When there are no more
+ hardware breakpoint resources, return EBUSY.
+ (go32_handle_nonaligned_watchpoint): If the argument WHAT is not
+ one of the enumerated values, return EINVAL.
+
+2000-04-12 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * README: Mention special build instructions for DJGPP.
+ * NEWS: Update with FP features on x87 platforms, and
+ DJGPP-related changes.
+
+2000-04-12 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * top.c (gdb_completer_file_name_break_characters): New variable.
+ (line_completion_function): When completing on file names, use
+ gdb_completer_file_name_break_characters as word break
+ characters for the readline library.
+
+2000-04-12 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (print_i387_value): Avoid call to
+ floatformat_to_doublest if long double type is the same on host
+ and target.
+
+2000-04-11 Fernando Nasser <fnasser@cygnus.com>
+
+ * wrapper.h: Remove definitions of internal functions.
+ * wrapper.c: Remove definitions of exported functions (which are
+ already in wrapper.h) and make static all internal wrap_* functions.
+
+Mon Apr 10 21:58:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * acconfig.h (USE_INCLUDED_REGEX): Add.
+ * Makefile.in (REGEX_CFLAGS): Delete
+ * configure.in (REGEX_CFLAGS): Delete. Use AC_DEFINE instead.
+ * configure, config.in: Re-generate.
+
+2000-04-10 Philip Blundell <philb@gnu.org>
+
+ * arm-linux-nat.c (arm_skip_solib_resolver): Remove and move to
+ arm-linux-tdep.c.
+ * arm-linux-tdep.c (arm_skip_solib_resolver): New.
+
+2000-04-10 Fernando Nasser <fnasser@cygnus.com>
+
+ From 2000-04-10 Rodney Brown <rdb@redhat.com>:
+ * command.h (enum command_class): Remove trailing "," to placate
+ AIX xlc.
+
+Mon Apr 10 20:17:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO, NEWS: Update. Mention MI.
+
+Mon Apr 10 00:21:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch-utils.h, gdbarch-utils.c: Delete.
+ * arch-utils.h, arch-utils.c: New files. Avoid 14 character file
+ name problems.
+ * Makefile.in: Update.
+ * gdbarch.c: Update.
+
+Sun Apr 9 23:42:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-07 Jonathan Larmour <jlarmour@redhat.co.uk>:
+ * mips-tdep.c (saved_gpreg_size_enums): Define enum command for
+ new "set mips saved-gpreg-size" command
+ (MIPS_SAVED_REGSIZE): Now a function mips_saved_regsize()
+ (MIPS_DEFAULT_SAVED_REGSIZE): Define for default MIPS_SAVED_REGSIZE,
+ either from target, or gdb multi-arch
+ (show_mips_command): New. For "show mips" prefix command
+ (set_mips_command): New. For "show mips" prefix command
+ (_initialize_mips_tdep): Add top-level mips prefix command
+ Add "set mips saved-gpreg-size" command
+
+ * mips-tdep.c (struct gdbarch_tdep): Rename mips_saved_regsize to
+ mips_default_saved_regsize.
+ (mips_gdbarch_init): Update.
+ (MIPS_DEFAULT_SAVED_REGSIZE): Update.
+ (mips_gdbarch_init): Use MIPS_REGSIZE as the default value for
+ mips_default_saved_regsize.
+
+Sun Apr 9 23:27:00 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-07 J.T. Conklin <jtc@redback.com>:
+ * lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
+ replace calls to target_xfer_memory() with target_read_memory()
+ and target_write_memory().
+
+Sun Apr 9 22:54:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * valops.c (value_rtti_type): Compare VALUE_ADDRESS with ``0'' not
+ NULL. Macro returns a CORE_ADDR.
+
+2000-04-08 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c: Revert Andrew Cagney's change of Dec 15, 1997.
+ Don't include "bfd-elf.h".
+ (address_significant_size): Delete variable.
+ (dwarf2_build_psymtabs_hard): Don't set it, or check for
+ consistency between it and the Dwarf 2 compilation unit header
+ address size.
+ (read_address): Don't mask off bits above
+ address_significant_size.
+ * Makefile.in (dwarf2read.o): Don't depend on $(elf_bfd_h).
+ (elf_bfd_h): Remove variable; it's no longer used.
+
+2000-04-08 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * configure.in (NEW_PROC_API): Escape square brackets when testing
+ for solaris2.[678].
+ * configure: Regenerate.
+
+2000-04-07 Scott Bambrough <scottb@netwinder.org>
+
+ * ChangeLog: Correct date on last entry.
+ * arm-linux-tdep.c (arm_linux_push_arguments): New function.
+ * config/arm/tm-linux: Redefined PUSH_ARGUMENTS for Linux.
+ * config/arm/tm-embed: Fix build warning from redefinition of
+ LOWEST_PC.
+ * config/arm/tm-arm.h: Remove TARGET_BYTE_ORDER_SELECTABLE.
+ * config/arm/tm-wince.h: Remove TARGET_BYTE_ORDER_SELECTABLE and
+ TARGET_BYTE_ORDER. Add TARGET_BYTE_ORDER_SELECTABLE_P to
+ override default in tm-arm.h. Use default target byte order
+ from tm-arm.h.
+
+2000-04-07 Scott Bambrough <scottb@netwinder.org>
+
+ * Makefile.in: Add dependency information for arm-linux-tdep.c.
+ * config/djgpp/fnchange.lst: Add arm-linux-tdep.c, arm-linux-nat.c.
+
+2000-04-07 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * sol-thread.c (gdb_ps_addr_t): New typedef, depends on definition
+ of PROC_SERVICE_IS_OLD.
+ (ps_pglobal_lookup, ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite,
+ rw_common): Change argument type from psaddr_t to gdb_ps_addr_t.
+
+Fri Apr 7 17:18:42 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (CFLAGS): Set using configure.
+
+ * configure.in (WARN_CFLAGS): Enable by default when GCC.
+ * configure: Re-generate.
+
+Fri Apr 7 13:33:43 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-03-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * procfs.c (init_procfs_ops): Set procfs_ops.to_has_memory and
+ procfs_ops.to_has_all_memory to 1.
+
+ * TODO: Update
+
+2000-04-06 Nick Duffek <nsd@cygnus.com>
+
+ * configure.in (_MSE_INT_H): Define on Solaris 7.
+ (NEW_PROC_API): Define on Solaris 7 and 8 as well as 6.
+ * acconfig.h (_MSE_INT_H): Define on Solaris 7.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+2000-04-06 Michael Snyder <msnyder@cygnus.com>
+
+ * sol-thread.c (GET_LWP, GET_THREAD, BUILD_LWP, BUILD_THREAD):
+ Change to rely on PIDGET etc.
+ * config/i386/nm-i386sol2.h (TARGET_HAS_WATCHPOINTS,
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT,
+ STOPPED_BY_WATCHPOINT, target_[insert/remove]_watchpoint):
+ define. Allow target to use procfs hardware watchpoints.
+ * config/sparc/nm-sun4sol2.h: ditto.
+ * config/i386/tm-i386sol2.h (PIDGET, TIDGET, MERGEPID): modify
+ definitions to use 16 bits for the pid, 15 bits for the tid, and
+ 1 bit for the flag.
+ * config/sparc/tm-sun4sol2.h: ditto.
+ (SOFTWARE_SINGLE_STEP, SOFTWARE_SINGLE_STEP_P): undefine.
+ * testsuite/gdb.threads/pthreads.exp (all_threads_running): Allow
+ for more than 15 thread increments.
+
+2000-04-06 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * top.c (filename_completer): Set subsequent_name to 1 early on,
+ to prevent an infinite loop if the first file in the directory is
+ a backup file (whose name ends in a `~').
+
+2000-04-05 Jim Blandy <jimb@redhat.com>
+
+ * solib.c (update_solib_list): New function.
+ (solib_add): Call update_solib_list, and then read symbols.
+ (info_sharedlibrary_command): Call update_solib_list, not
+ solib_add.
+
+2000-04-05 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-tdep.c: Resolve implicit function declarations by
+ including target.h and value.h. Inclusion of symtab.h is
+ no longer needed.
+
+2000-04-05 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-tdep.c: New file.
+ * arm-linux-nat.c (fetch_fpregs): Remove unused code.
+ (arm_get_longjmp_target): Moved it and all defines
+ it uses to arm-linux-tdep.c.
+ (arm_linux_extract_return_value): Moved to
+ arm-linux-tdep.c.
+ * config/arm/linux.mt: Add arm-linux-tdep.c to TDEPFILES.
+
+2000-04-04 Nick Duffek <nsd@cygnus.com>
+
+ * infrun.c (handle_inferior_event): Call target_mourn_inferior
+ instead of kill_target.
+
+2000-04-04 Daniel Berlin <dan@cgsoftware.com>
+
+ * TODO: Make note of various C++ things i have planned for 5.1.
+
+Tue Apr 4 12:13:19 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * printcmd.c (print_scalar_formatted): Use local variable ptr_bit
+ in shift. Stop GCC thinking it has a shift overflow.
+
+2000-04-03 H.J. Lu <hjl@gnu.org>
+
+ * TODO: Remove the regex entry.
+
+2000-04-03 H.J. Lu <hjl@gnu.org>
+
+ * gdb_regex.h: New. Include "regex.h" if USE_INCLUDED_REGEX
+ is defined and <regex.h> otherwise.
+
+ * irix5-nat.c: Include "gdb_regex.h" instead of "gnu-regex.h".
+ * monitor.c: Likewise.
+ * osfsolib.c: Likewise.
+ * solib.c: Likewise.
+ * source.c: Likewise.
+ * symtab.c: Likewise.
+
+ * Makefile.in (REGEX): Changed to @REGEX@.
+ (REGEX_CFLAGS): New.
+ (REGEX1): Removed.
+ (ADD_DEPS): Use $(REGEX) instead of $(REGEX1).
+ (INTERNAL_WARN_CFLAGS): Add $(REGEX_CFLAGS).
+
+ * configure.in (--with-included-regex): New switch.
+ (REGEX): New. Subsstitue @REGEX@ in Makefile.in.
+ (REGEX_CFLAGS): New. Subsstitue @REGEX_CFLAGS@ in Makefile.in.
+ * configure: Regenerated.
+
+2000-04-03 Kevin Buettner <kevinb@redhat.com>
+
+ * NEWS (powerpc-*-linux*): Mention.
+
+2000-04-03 J.T. Conklin <jtc@redback.com>
+
+ * config/i386/xm-nbsd.h (HOST_LONG_DOUBLE_FORMAT): Define.
+
+2000-04-03 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (ALLDEPFILES): Add ia64-linux-nat.c and ia64-tdep.c.
+ (ia64-linux-nat.o, ia64-tdep.o): Add dependencies.
+
+ * ia64-linux-nat.c (fill_gregset): Implement.
+ (supply_fpregset, fill_fpregset): New functions.
+
+ * ia64-tdep.c (ia64_init_extra_frame_info): Revise manner in
+ which the CFM is fetched for certain frames.
+ (find_global_pointer, find_extant_func_descr): Don't use
+ partial symtabs for locating sections.
+
+ * config/ia64/linux.mh (LOADLIBES): Define.
+ (NATDEPFILES): Add linux-thread.o and lin-thread.o.
+ * config/ia64/nm-linux.h (nm-linux.h): Include this upper-level
+ file containing generic linux declarations/definitions.
+ (SVR4_SHARED_LIBS, ATTACH_DETACH): Remove defines; already
+ defined in generic nm-linux.h.
+ (solib.h): Remove include; already included in generic nm-linux.h.
+
+2000-04-03 Jim Blandy <jimb@redhat.com>
+
+ * solib.c (solib_add): Move all the code for loading symbol tables
+ below the code to sort out additions and removals. That way, we
+ always catch all loaded shared libraries whose symbols we haven't
+ grabbed yet.
+
+ * solib.c (solib_add): Don't try to free a shared object's objfile
+ if it doesn't have one. Duh.
+
+ * solib.c (solib_add): If a pattern was given, but it doesn't
+ match any currently loaded shared libraries, print a message;
+ don't just be silent.
+
+2000-04-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_handle_nonaligned_watchpoint): Use a
+ two-dimensional array instead of faking it with index
+ arithmetics.
+
+2000-04-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/i386/xm-go32.h (HOST_LONG_DOUBLE_FORMAT): Define.
+
+ * config/i386/tm-go32.h (TARGET_LONG_DOUBLE_BIT): Remove
+ definition (and use the common one in tm-i386.h).
+ (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Likewise.
+ (I386_DJGPP_TARGET): Don't define, it's no longer required.
+ (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Remove definition,
+ i386-tdep.c defines it for all x86 targets.
+ (LD_I387, HEX_LONG_DOUBLE_INPUT): Remove.
+
+ * config/djgpp/fnchange.lst: Add i386-linux-tdep.c.
+
+ * config/djgpp/djcheck.sh: Edit the copyright year out of the test
+ results. Fix editing of `main' arguments for non-GNU Sed.
+
+2000-04-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * symfile.c (map_overlay_command, unmap_overlay_command): Fix
+ error message: there's no "overlay on" command.
+
+2000-04-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (copying.c): Depend on copying.txt, not COPYING.
+ (copying.txt): New target, a link to COPYING.
+
+Mon Apr 3 18:20:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Update.
+
+Mon Apr 3 14:56:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c: Re-indent.
+ (set_hook, error_hook): Remove PARAMS.
+
+Mon Apr 3 14:45:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * symtab.h (add_minsym_to_demangled_hash_table): Revert 2000-03-29
+ Daniel Berlin <dan@cgsoftware.com>. Function was static.
+ * minsyms.c (add_minsym_to_demangled_hash_table): Add prototype.
+
+Mon Apr 3 14:10:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb-events.h, gdb-events.c, gdb-events.sh: Re-indent.
+
+2000-04-02 Nick Duffek <nsd@cygnus.com>
+
+ * gdbtypes.c (safe_parse_type): New wrapper function to ignore
+ error() during parse_and_eval_type().
+ (check_stub_method): Call safe_parse_type instead of
+ parse_and_eval_type().
+ * wrapper.c (gdb_parse_and_eval_type): New wrapper function.
+ (wrap_parse_and_eval_type): New support function.
+ * wrapper.h (gdb_parse_and_eval_type): Prototype.
+ (wrap_parse_and_eval_type): Prototype.
+
+Sun Apr 2 10:32:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Eli Zaretskii is a doco maintainer.
+
+Fri Mar 31 08:59:58 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch-utils.h, gdbarch-utils.c: New files.
+ * Makefile.in (SFILES, COMMON_OBS): Update.
+ (gdbarch_utils_h) Define.
+ (gdbarch-utils.o): Add dependencies.
+
+ * gdbarch.c, gdbarch.sh: Include "gdbarch-utils.h". Fix code
+ handling default method values.
+ (startup_gdbarch): Rename default_gdbarch, name misleading.
+ (breakpoint_from_pc): Default to legacy_breakpoint_from_pc.
+ (register_name): Default to legacy_register_name.
+ (call_dummy_words): Default to legacy_call_dummy_words.
+ (sizeof_call_dummy_words): Default to
+ legacy_sizeof_call_dummy_words.
+ (register_convertible): Default to
+ generic_register_convertible_not.
+ (breakpoint_from_pc): Default to legacy_breakpoint_from_pc.
+ (remote_translate_xfer_address): Default to
+ generic_remote_translate_xfer_address.
+ (frameless_function_invocation): Default to
+ generic_frameless_function_invocation_not.
+
+2000-04-02 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c: Add copyright notice.
+
+ * config/i386/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define as
+ &floatformat_i387_ext.
+ * config/i386/xm-i386gnu.h (HOST_LONG_DOUBLE_FORMAT): Likewise.
+
+2000-03-29 Mark Kettenis <kettenis@gnu.org>
+
+ * findvar.c (extract_floating): Remove reference to
+ TARGET_EXTRACT_FLOATING.
+ (store_floating): Remove reference to TARGET_STORE_FLOATING.
+
+2000-03-30 Fernando Nasser <fnasser@cygnus.com>
+
+ * wrapper.c (gdb_value_subscript, wrap_value_subscript): New functions.
+ Safe version of value_subscript.
+ * varobj.c (): Use gdb_value_subscript() to get an array element value.
+
+2000-03-30 Michael Snyder <msnyder@cygnus.com>
+
+ * ui-file.c: Include "gdb_string.h"
+ * cli-out.c: Include gdb_string.h to avoid compiler warnings.
+ * wrapper.[ch] (struct gdb_wrapper_arguments): Change fields into
+ unions, since they are all used to hold both pointers and ints
+ at various times. Casting pointer to int and vice versa gives
+ warnings (and is not safe) if they are not the same size.
+
+2000-03-30 Michael Snyder <msnyder@cygnus.com>
+
+ * defs.h (struct continuation_arg): Make 'data' a union, to avoid
+ casting problems when int and pointer are not the same size.
+ * event-top.c (command_handler): Use data as a union.
+ (command_line_handler_continuation): Ditto.
+ * infcmd.c (step_1_continuation): Use data as a union. Re-indent.
+ (step_once): ditto. (finish_command_continuation): Ditto.
+ (finish_command): Ditto.
+ * breakpoint.c (until_break_command): Use data as a union.
+ (until_break_command_continuation): Ditto.
+ * utils.c (add_intermediate_continuation): Fix typo in comment.
+
+Thu Mar 30 12:09:50 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.h, gdbarch.c: Re-indent. Remove FIXMEs.
+ * gdbarch.sh: Re-sync with gdbarch.[hc].
+
+2000-03-29 Daniel Berlin <dan@cgsoftware.com>
+
+ * minsyms.c (add_minsym_to_demangled_hash_table): New function.
+ (install_minimal_symbols): Fix demangled symbol problems caused by
+ using add_minsym_to_hash_table for the demangled names, which is
+ wrong. Now we use add_minsym_to_demangled_hash_table.
+ (lookup_minimal_symbol): Fix problems with demangled symbol lookup
+ caused by weird control flow.
+ * symtab.h: Add add_minsym_to_demangled_hash_table prototype here.
+
+2000-03-29 Jason Merrill <jason@casey.cygnus.com>
+
+ * configure.in: -linux-gnu*, not -linux-gnu.
+
+Tue Mar 28 18:28:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (remote_threads_extra_info): Replace qfThreadExtraInfo
+ with qThreadExtraInfo.
+
+2000-03-29 J.T. Conklin <jtc@redback.com>
+
+ * i386nbsd-nat.c (fetch_core_registers): Make static.
+
+ * m68knbsd-nat.c (fetch_core_registers): Make static.
+ (m68knbsd_core_fns, _initialize_m68knbsd_nat): Added.
+
+Wed Mar 29 13:40:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Update GDB 5 status.
+
+Wed Mar 29 10:16:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.h (remove_hw_watchpoints): Add declaration.
+ * breakpoints.c (remove_hw_watchpoints): Update.
+ * maint.c (maintenance_do_deprecate): Avoid assignment within IF
+ condition.
+
+2000-03-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ breakpoint.c, breakpoint.h (remove_hw_watchpoints): New function.
+ infrun.c (resume): Remove hardware watchpoints before stepping
+ when CANNOT_STEP_HW_WATCHPOINTS is nonzero.
+
+2000-03-28 Michael Snyder <msnyder@cygnus.com>
+
+ * Makefile.in: Anchor tui-file.h dependency to $srcdir.
+
+2000-03-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * procfs.c (proc_set_watchpoint): Declare addr parameter as
+ CORE_ADDR, to match call from procfs_set_watchpoint.
+
+ * breakpoint.c (insert_breakpoints, do_enable_breakpoint):
+ Reselect the saved frame silently after frame selection for
+ watchpoint evaluation.
+ (insert_breakpoints): Add missing space in `Hardware watchpoint
+ deleted' message. Do not reinsert hardware watchpoint if it is
+ already marked for deletion at next stop.
+
+2000-03-28 Christopher Faylor <cgf@cygnus.com>
+
+ * partial-stab.h: Add one more check against corrupted or irregular
+ stabs entry.
+
+Tue Mar 28 12:23:37 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * gnu-regex.c (regerror): Function renamed from `__regerror'.
+ (Change also approved in the mainline glibc sources)
+
+Tue Mar 28 18:19:50 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-03-20 Jonathan Larmour <jlarmour@redhat.co.uk>:
+ * ser-unix.c (do_unix_readchar): Reorganise to be more robust,
+ particularly ensuring it can't return SERIAL_TIMEOUT when told
+ not to time out.
+
+2000-03-24 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdbtypes.c (_initialize_gdbtypes): Add "set debug overload",
+ which never existed before, and thus, has no deprecated old command.
+
+ * gdbarch.c (_initialize_gdbarch): Add "set debug arch", deprecate
+ "set archdebug" (same goes for the show commands).
+ * gdb-events.c (_initialize_gdb_events): Add "set debug event",
+ deprecate "set eventdebug" (same goes for the show commands).
+ * gdbcmd.h: Add the setdebuglist and showdebuglist externs.
+ * top.c (init_main): Deprecate remotedebug, use "set/show debug remote"
+ instead.
+ x(init_main): Add the "set debug" and "show debug" commands.
+ Add setdebuglist and showdebuglist.
+
+Fri Mar 24 13:00:10 2000 Daniel Berlin <dan@cgsoftware.com>
+
+ * maint.c (maintenance_do_deprecate): Fix crash if you call with no arguments, and fixed the warning.
+ Added prototype for the deprecate command so it doesn't complain.
+
+Tue Mar 28 11:52:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (print_gdb_version): Bump copyright year to 2000.
+
+Tue Mar 28 10:13:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Glen McCready to write after approval list.
+
+Tue Mar 28 09:59:00 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * acconfig.h: Fix typo in comment describing HAVE_PTRACE_GETREGS.
+ * config.h: Regenerate.
+
+Mon Mar 27 19:53:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * TODO: Update. Add criteria for next release of GDB.
+
+Mon Mar 27 17:20:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * acconfig.h: Provide default for HAVE_PTRACE_GETREGS.
+ * config.h: Regenerate.
+
+Mon Mar 27 16:43:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (install-only): Create $(bindir) and $(man1dir)
+ before installing GDB.
+
+Mon Mar 27 16:26:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (all-gdbtk): Check for an existing link/directory.
+ Re-format warning message. Document that post 5.0 this can be
+ deleted.
+
+Mon Mar 27 14:46:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ChangeLog: Revert whitespace changes.
+
+Mon Mar 27 10:20:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Update folks who need accounts.
+
+Mon Mar 27 09:29:14 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: J.T. Conklin is NetBSD maintainer.
+
+2000-03-27 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h: Fix typo. It is TARGET_LONG_DOUBLE_BIT
+ instead of TARGET_LONG_DOUBLE_BITS.
+ * config/i386/tm-i386mk.h: Likewise.
+
+2000-03-26 Mark Kettenis <kettenis@gnu.org>
+
+ Provide `long double' support for most i386 targets.
+ * config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT): Define as
+ &floatformat_i387_ext.
+ (TARGET_LONG_DOUBLE_BITS): Define as 96.
+ (REGISTER_VIRTUAL_TYPE): Change type for FPU registers to
+ `builtin_type_long_double'.
+ (REGISTER_CONVERT_TO_VIRTUAL): Call
+ i386_register_convert_to_virtual.
+ (REGISTER_CONVERT_TO_RAW): Call i386_register_convert_to_raw.
+ (i387_to_double, double_to_i387): Remove prototypes.
+ (i386_extract_return_value): Change prototype to match definition
+ in i386-tdep.c.
+ * config/i386/tm-i386mk.h (TARGET_LONG_DOUBLE_FORMAT): #undef.
+ (TARGET_LONG_DOUBLE_BITS): #undef.
+ * config/i386/tm-linux.h (TARGET_LONG_DOUBLE_BIT): Remove.
+ [HAVE_LONG_DOUBLE && HOST_I386] (LD_I387): Remove.
+ (i387_extract_floating, i387_store_floating): Remove prototypes.
+ (TARGET_EXTRACT_FLOATING, TARGET_STORE_FLOATING): Remove.
+ (REGISTER_CONVERT_TO_VIRTUAL, REGOISTER_CONVERT_TO_RAW): Remove.
+ (REGISTER_VIRTUAL_TYPE): Remove.
+ * i386-tdep.c (i386_register_convert_to_virtual): New function.
+ (i386_register_convert_to_raw): New function.
+ * i387-tdep.c [LD_I387] (i387_extract_floating): Remove.
+ (i387_store_floating): Remove.
+
+Sat Mar 25 18:55:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * maint.c: Re-indent.
+
+Sat Mar 25 18:51:50 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * maint.c (_initialize_maint_cmds): Remove quoted trailing space.
+
+2000-03-24 Christopher Faylor <cgf@cygnus.com>
+
+ * config/mips/tm-wince.h: Fix typo which caused include of tm-mips.h to
+ be inoperative.
+
+2000-03-24 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Back out special frame walking code. It was broken.
+ (handle_exception): Correctly identify an illegal instruction.
+ * config/tm-cygwin.h: Eliminate special frame handling. Just use
+ normal i386 handling.
+
+2000-03-24 J.T. Conklin <jtc@redback.com>
+
+ * i386/tm-nbsd.h (USE_STRUCT_CONVENTION): Define.
+ * i386nbsd-nat.c (i386nbsd_use_struct_convention): New function.
+ (fetch_core_registers): Read fp registers.
+ (i386nbsd_core_fns, _initialize_i386nbsd_nat): Added.
+
+2000-03-24 Jonathan Larmour <jlarmour@redhat.co.uk>
+
+ * arm-tdep.c (thumb_skip_prologue): Take function end addr argument
+ so that we can stop searching for the prologue past the function end
+ (arm_skip_prologue): Call thumb_skip_prologue with function end addr
+
+2000-03-24 Kevin Buettner <kevinb@redhat.com>
+
+ * linux-thread.c, lin-thread.c (save_inferior_pid,
+ restore_inferior_pid): Don't do compile time comparison
+ of TARGET_PTR_BIT and TARGET_INT_BIT.
+
+Thu Mar 23 13:18:26 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L
+ and P_LINK_W.
+ (P_PEA_FP, P_MOVL_SP_FP): New macros.
+ (P_MOVL, P_LEAL, P_MOVML): Macros renamed from P_MOV_L, P_LEA_L and
+ P_MOVM_L.
+ (altos_skip_prologue, isi_skip_prologue): Use P_* macros, not octal
+ constants.
+ (delta68_in_sigtramp): New function.
+ (delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
+ (m68k_skip_prologue): Use P_* macros, not hex constants.
+ (m68k_find_saved_regs): Do not expect a fixed sequence of register save
+ instructions, but accept them in any order; use P_* macros, not octal
+ or hex constants; recognize also `fmovemx to (fp + displacement)' and
+ `moveml to (fp + displacement)'.
+ * m68/tm-delta68.h (IN_SIGTRAMP): New macro.
+ (FRAME_SAVED_PC, FRAME_ARGS_ADDRESS): Ditto.
+
+Fri Mar 24 13:44:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Fernando Nasser to testsuite maintainers.
+
+2000-03-23 Michael Snyder <msnyder@cygnus.com>
+
+ * solib.c (open_symbol_file_object): To sneak an int argument
+ past catch_errors, instead of casting it to a pointer, simply
+ pass it by address.
+
+2000-03-23 Jimmy Guo <guo@cup.hp.com>
+
+ * gdbtypes.c (rank_function): Rank all N parameters and use correct
+ index into the prams[] and args[] arrays.
+
+2000-03-23 Fernando Nasser <fnasser@cygnus.com>
+
+ From David Whedon <dwhedon@gordian.com>
+
+ * top.c (execute_command): Checks all commands beore executing
+ to see if the user needs to be warned that the command is
+ deprecated, warns user if appropriate.
+ (add_info), (add_info_alias), (add_com) , (add_com_alias): Changed
+ return values from void to struct cmd_list_element *.
+ * command.c (lookup_cmd_1): Check aliases before following link
+ in case user needs to be warned about a deprecated alias.
+ (deprecate_cmd): new exported function for command deprecation,
+ sets flags and posibly a replacement string.
+ (deprecated_cmd_warning): New exported funciton to warn user about
+ a deprecated command.
+ (lookup_cmd_composition): New exported function that determines
+ alias, prefix_command, and cmd based on a string. This is useful
+ is we want to full name of a command.
+ * command.h : Added prototypes for deprecate_cmd,
+ deprecated_warn_user and lookup_cmd_composition, added flags to
+ the cmd_list_element structure, changed return values for
+ add_com_* and add_info_* from void to cmd_list_element.
+ * maint.c : (maintenance_deprecate): New function to deprecate a
+ command. This exists only so that the testsuite can deprecate
+ commands at runtime and check the warning behavior.
+ (maintenance_undeprecate) : New function, drops deprecated flags.
+ (maintenance_do_deprecate): Actually does the (un)deprecation.
+ (initialize_maint_cmds): Added the above new deprecate commands.
+
+2000-03-22 Daniel Berlin <dan@cgsoftware.com>
+ * command.c (apropos_cmd_helper): New function, meat of the
+ apropos command.
+ (apropos_command): New apropos command to search command
+ names/documentation for regular expressions.
+ (_initialize_command): Add the apropos command.
+
+2000-03-23 Michael Snyder <msnyder@cygnus.com>
+
+ * sol-thread.c (ps_pglobal_lookup): Change argument type from
+ paddr_t to psaddr_t. This mistake appears to date from an
+ erroneous man page in Solaris 2.5 -- the correct type from the
+ system headers has always been psaddr_t.
+ (ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite): Ditto.
+ (rw_common): Ditto.
+
+2000-03-22 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-nat.c: Fix copyright.
+ (fill_gregset): Minor formatting fix.
+ * ia64-tdep.c (template_encoding_table, fetch_instruction,
+ examine_prologue): Clean up some compiler warnings.
+ (is_float_or_hfa_type_recurse, is_float_or_hfa_type, find_func_descr,
+ find_global_pointer, find_extant_func_descr): New functions.
+ (ia64_use_struct_convention, ia64_extract_return_value,
+ ia64_push_arguments): Handle HFAs.
+ (ia64_push_arguments): Find (or build) a function descriptor
+ when given a function address.
+ (ia64_push_return_address): Moved code for finding the
+ global pointer into its own function, find_global_pointer ().
+
+2000-03-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.c (handle_file_event): Run through indent.
+
+2000-03-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Philippe De Muyter <phdm@macqel.be>
+
+ * event-loop.c (sys/types.h): File now included unconditionally.
+ (use_poll): New variable..
+ (gdb_notifier): poll- and select-versions merged.
+ (add_file_handler): If HAVE_POLL, check whether poll is usable,
+ and reset `use_poll' if not.
+ (create_file_handler): Select poll- or select-version according to
+ `use_poll'.
+ (delete_file_handler, handle_file_event): Likewise.
+ (gdb_wait_for_event, poll_timers): Likewise.
+
+2000-03-22 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * printcmd.c (print_scalar_formatted): Truncate addresses to the
+ size of a target pointer before passing them to print_address.
+
+2000-03-22 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386aix.h (I386_AIX_TARGET): Remove.
+ * config/i386/tm-linux.h (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM):
+ Remove
+ * i386-tdep.c (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): New defines.
+ (i386_extract_return_value): Rewritten. Correctly support all
+ floating-point types and large integer types on targets that use
+ the standard i386 GDB register layout and return floating-point
+ values in the FPU.
+
+Wed Mar 22 15:09:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (CONFIG_INITS): Do not append remote-nrom.c
+
+2000-03-21 J.T. Conklin <jtc@redback.com>
+
+ * i386/nbsd.mh (NATDEPFILES): Change i386b-nat.o to i386nbsd-nat.o.
+ * i386nbsd-nat.c: New file.
+
+ * i386/tm-nbsd.h (NUM_REGS): Removed.
+ (HAVE_I387_REGS): Defined.
+ * i386/nm-nbsd.h (FLOAT_INFO): Removed.
+
+ * tm-nbsd.h (IN_SOLIB_CALL_TRAMPOLINE): Define if not
+ SVR4_SHARED_LIBS.
+
+Wed Mar 22 11:18:59 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Jim Blandy to breakpoint maintainers. David
+ taylor is the Solaris/SPARC maintainer. Add Jonathan Larmour to
+ the write after approval list.
+
+2000-03-21 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.h (MAX_SECTIONS, struct section_addr_info,
+ symbol_file_add): Move declarations from here...
+ * symfile.h: ...to here.
+
+ * solib.c (symbol_add_stub): Make symbol_file_add () aware of
+ all section addresses, not just .text.
+ * symfile.h, symfile.c (free_section_addr_info,
+ build_section_addr_info_from_section_table): New functions.
+
+ * symfile.h (MAX_SECTIONS): Increase value to 40.
+ * symfile.c (syms_from_objfile): Add bounds check prior to
+ accessing ``other'' array in a section_addr_info_struct.
+ Remove unused variable section_offsets.
+ (add_symbol_file_command): Remove unused variable text_addr.
+
+2000-03-21 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * breakpoint.c (bpstat_stop_status): Don't stop if a read
+ watchpoint appears to break, but the watched value changed.
+
+2000-03-21 Jim Blandy <jimb@redhat.com>
+
+ * gdbarch.sh: Emit a definition and declaration for gdbarch_free,
+ a companion to gdbarch_alloc, which allows a gdbarch init function
+ to free partially-built gdbarch structures.
+ * gdbarch.c, gdbarch.h: Regenerated.
+
+2000-03-20 Kevin Buettner <kevinb@redhat.com>
+
+ * configure.host, configure.tgt (ia64-*-linux*): New entry.
+
+ * gdbserver/low-linux.c (u_offsets, ia64_register_u_addr,
+ initialize_arch): Define for IA-64.
+ (initialize_arch): Add declaration.
+
+2000-03-20 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * breakpoint.c (insert_breakpoints, remove_breakpoint)
+ (bpstat_stop_status, can_use_hardware_watchpoint): Don't insert,
+ remove, or check status of hardware watchpoints for entire structs
+ and arrays unless the user explicitly asked to watch that struct
+ or array.
+ (insert_breakpoints): Try to insert watchpoints for all the values
+ on the value chain, even if some of them fail to insert.
+
+ * values.c (value_primitive_field): Set the offset in struct value
+ we return when the field is a packed bitfield.
+
+2000-03-20 Michael Snyder <msnyder@cygnus.com>
+
+ * remote.c (remote_threads_extra_info): New function.
+ Implement the extra thread info query for "info threads".
+ (remote_threads_info): Clean up a bit.
+ (use_threadinfo_query, use_threadextra_query): New variables.
+ Control whether GDB will use the new or old protocol for
+ thread info queries.
+ (remote_open_1): Initialize new variables.
+ (remote_async_open_1): Ditto.
+ (remote_cisco_open): Ditto.
+
+2000-03-20 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-nat.c, ia64-tdep.c, config/ia64/linux.mh,
+ config/ia64/linux.mt, config/ia64/nm-linux.h, config/ia64/tm-ia64.h,
+ config/ia64/tm-linux.h, config/ia64/xm-linux.h: New files.
+
+2000-03-20 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (floatformat_from_doublest): Don't assume that a long
+ will be exactly 32 bits in length. Also... make sure space
+ that we're writing the float to is completely initialized to
+ zeroes, even when the number of bits in the float is not
+ evenly divisible by FLOATFORMAT_CHAR_BIT.
+
+2000-03-20 Jim Blandy <jimb@redhat.com>
+
+ * i386-linux-nat.c: No need to #include "frame.h" any more.
+ (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0,
+ LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1,
+ LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, linux_sigtramp_code,
+ LINUX_SIGTRAMP_LEN, i386_linux_sigtramp_start,
+ LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0,
+ LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1,
+ linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN,
+ i386_linux_rt_sigtramp_start, i386_linux_in_sigtramp,
+ i386_linux_sigcontext_addr, LINUX_SIGCONTEXT_PC_OFFSET,
+ i386_linux_sigtramp_saved_pc, LINUX_SIGCONTEXT_SP_OFFSET,
+ i386_linux_sigtramp_saved_sp): Deleted. Folks rightly pointed
+ out that these are target-dependent, and useful in non-native
+ configurations. Moved to...
+ * i386-linux-tdep.c: ... Here, a new file.
+ * Makefile.in (ALLDEPFILES): Add i386-linux-tdep.c.
+ (i386-linux-tdep.o): New rule.
+ (i386-linux-nat.o): We no longer depend on frame.h.
+ * config/i386/linux.mt (TDEPFILES): Add i386-linux-tdep.o.
+
+2000-03-04 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * event-loop.c (top-level) [NO_FD_SET]: Deprecate this branch.
+ Print an error at compile time if we are to use select, but FD_SET
+ is not available.
+ (SELECT_MASK, NBBY, FD_SETSIZE, NFDBITS, MASK_SIZE): Define only
+ if HAVE_POLL is not defined and NO_FD_SET *is* defined.
+ (create_file_handler) [!HAVE_POLL]: Use FD_SET and FD_CLR.
+ (delete_file_handler) [!HAVE_POLL]: Use FD_CLR and FD_ISSET.
+ (gdb_wait_for_event) [!HAVE_POLL]: Copy fd_set sets directly
+ instead of using memcpy and memset. Use FD_ISSET.
+
+ * config/i386/xm-go32.h (fd_mask): Remove typedef.
+
+Mon Mar 20 19:58:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * command.c (_initialize_command): Document requirements for ``!''
+ command.
+
+Mon Mar 20 18:12:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Fri 10 Mar 2000 Robert
+ <robert.melchers@drives.eurotherm.co.uk>:
+ * sh-tdep.c (sh_processor_type_table): Add entry for sh2.
+
+Mon Mar 20 17:33:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Thu Mar 16 16:49:27 EST 2000 John David Anglin
+ <dave@hiauly1.hia.nrc.ca>:
+ * configure.in (CONFIG_INITS): Don't include hpux-thread.c. Stops
+ _initialize_hpux_thread being called twice.
+ * configure: Regenerated.
+
+2000-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * event-top.c (_initialize_event_loop): If instream is not
+ connected to a terminal device, turn editing off.
+
+2000-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ Support for building GDB with DJGPP, and running the test suite on
+ it:
+ * config/djgpp/djconfig.sh: New file.
+ * config/djgpp/config.sed: New file.
+ * config/djgpp/README: New file.
+ * config/djgpp/fnchange.lst: New file.
+ * config/djgpp/djcheck.sh: New file.
+
+2000-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ser-go32.c (ports): Make the initializers complete, to pacify
+ GCC 2.9X.
+
+2000-03-17 Jim Blandy <jimb@redhat.com>
+
+ * i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
+ two-dimensional array, instead of faking it with explicit index
+ arithmetic.
+
+ * linux-thread.c (linuxthreads_attach, linuxthreads_detach,
+ linuxthreads_create_inferior): Fix typo in variable name: it's
+ linuxthreads_exit_status, not linux_exit_status.
+
+ * gdb_wait.h (WSETSTOP): Pass the appropriate number of arguments
+ to W_STOPCODE.
+
+ * solib.c (solib_add): Delete debugging code.
+
+2000-03-17 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb_wait.h: add definitions of WSETSTOP and WSETEXIT for Linux.
+ * linux-thread.c: Use WSETSTOP instead of W_STOPCODE.
+
+Fri Mar 17 11:06:59 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * language.c (set_lang_str): Do not call `free' for a null pointer.
+ (set_type_str, set_range_str): Ditto.
+
+2000-03-16 Jim Blandy <jimb@redhat.com>
+
+ * i386-linux-nat.c (i386_linux_saved_pc_after_call): Lost in the
+ merge; reinstated.
+
+ * solib.c (current_sos): Be more careful about freeing the new
+ so_list node if an error occurs.
+
+ * i386-tdep.c (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0,
+ LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1,
+ LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, linux_sigtramp_code,
+ LINUX_SIGTRAMP_LEN, i386_linux_sigtramp_start,
+ LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0,
+ LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1,
+ linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN,
+ i386_linux_rt_sigtramp_start, i386_linux_in_sigtramp,
+ i386_linux_sigcontext_addr, LINUX_SIGCONTEXT_PC_OFFSET,
+ i386_linux_sigtramp_saved_pc, LINUX_SIGCONTEXT_SP_OFFSET,
+ i386_linux_sigtramp_saved_sp): Deleted. These all implement
+ Linux-specific signal trampoline detection, and should be moved
+ to...
+ * i386-linux-nat.c: ... here.
+ * config/i386/tm-linux.h (I386_LINUX_SIGTRAMP): No need to define
+ this any more, since we're not enabling OS-specific code in a
+ OS-independent file.
+
+2000-03-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (go32-nat.o): Add prerequisites.
+ (ALLDEPFILES): Add go32-nat.c.
+
+2000-03-15 Michael Snyder <msnyder@cygnus.com>
+
+ From "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
+ * symfile.c (reread_symbols): Clear msymbol hash table.
+
+2000-03-15 Jim Blandy <jimb@redhat.com>
+
+ Deal with the inferior unloading shared objects.
+ * solib.c (current_sos): New function, replacing find_solib.
+ (find_solib): Deleted.
+ (free_so): New function.
+ (clear_solib): Call free_so, instead of writing it out.
+ (solib_add): Rewritten: compare the inferior's current list of
+ shared objects with GDB's list, and do the required loads and
+ unloads.
+ (info_sharedlibrary_command, solib_address): Don't use find_solib
+ to walk the list of shared libraries: call solib_add, and then
+ walk the list at so_list_head normally.
+ * objfiles.c (free_objfile): Don't call CLEAR_SOLIB, and don't
+ detach the core target. These tasks are taken care of elsewhere.
+ * target.c (remove_target_sections): New function.
+ * target.h (remove_target_sections): New declaration.
+
+ * solib.c (symbol_add_stub): Check whether we've already created
+ an objfile for this shared object first, before doing all that
+ work to compute section addresses, etc.
+
+ * objfiles.c (unlink_objfile): Report an internal error if objfile
+ doesn't occur in the object_files list.
+
+ * solib.c (special_symbol_handling): Delete argument; it's not
+ used.
+
+ Changes from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+
+ * solib.c (SOLIB_EXTRACT_ADDRESS): New macro to extract addresses
+ from solib structures. Use it throughout solib.c, get rid of all
+ CORE_ADDR casts.
+ (struct so_list): Change type of lmaddr to CORE_ADDR.
+ (first_link_map_member): Change return value type to CORE_ADDR,
+ update callers.
+ (solib_add_common_symbols): Change parameter type to CORE_ADDR,
+ update callers.
+ (open_symbol_file_object, find_solib): Change type of lm variable
+ to CORE_ADDR.
+
+2000-03-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ser-go32.c (dos_noop, dos_raw, dos_noflush_set_tty_state)
+ (dos_print_tty_state, dos_info, _initialize_ser_dos): Convert
+ to ISO C. Use ATTRIBUTE_UNUSED to avoid compiler warnings.
+ (dos_info): Avoid compiler warning when printing a ptrdiff_t.
+
+ * ser-go32.c (dos_get_tty_state): Fail if the (fake) handle was
+ not opened by dos_open, but let the 3 standard handles go through
+ unharmed.
+
+2000-03-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * eval.c (evaluate_subexp_with_coercion): Add call to
+ check_typedef, to handle typedeffed vars correctly.
+
+Mon Mar 13 21:21:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (STREQ, STRCMP, STREQN): Document that these macros are
+ somewhat redundant.
+ (QUIT): Note that this can probably be replaced by a function.
+
+2000-03-13 James Ingham <jingham@leda.cygnus.com>
+
+ Add support for a variable object that tries to evaluate itself in
+ the currently selected frame, rather than in a fixed frame.
+
+ * wrapper.c,h (gdb_parse_exp_1): Added a wrapper for
+ gdb_parse_exp_1.
+ * varobj.h: Added USE_CURRENT_FRAME to varobj_type & changed def'n
+ of varobj_create.
+ * varobj.c (varobj_list): Return type indicates whether the
+ variable's type has changed (for current frame variables).
+ (varobj_update): Handle the case where the variable's type has
+ changed.
+ (delete_variable_1): Allow for deletion of variables that have not
+ been installed yet.
+ (new_root_variable): Initialize use_selected_frame variable.
+ (value_of_root): This is where most of the work to handle "current
+ frame" variables was added. Most of the complexity involves
+ handling the case where the type of the variable has changed.
+ (varobj_create): Add a "type" argument, to tell if the
+ variable is one of these "current frame" variables. Also protect
+ call to parse_exp_1 from long jumping.
+
+2000-03-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (struct env387): Remove declaration.
+ (print_387_status, i386_go32_float_info): Remove redundant
+ functions.
+ (regno_mapping, sig_map, excepn_map): Add braces around inner
+ initializers.
+ (many functions): Use ATTRIBUTE_UNUSED to shut up the compiler;
+ fix code which mixed signed with unsigned.
+ (go32_resume): Use TARGET_SIGNAL_LAST instead of -1.
+ (go32_wait): Initialize INT3_addr.
+ (go32_fetch_registers): Extend all FP registers that are shorter
+ than 4 bytes to 32 bits. Support 32 standard FP registers defined
+ on config/i386/tm-i386.h.
+ (store_register): Support 32 FP registers.
+ (go32_create_inferior): Don't crash if handed a NULL pointer
+ instead of exec file name.
+ (ignore): Remove unused function.
+ (go32_insert_hw_breakpoint): Remove unused variables.
+ (init_go32_ops): Set value of processing_gcc_compilation to 2.
+
+Mon Mar 13 18:54:42 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-03-10 Daniel Berlin <dan@cgsoftware.com> Fix C++
+ overloading, add support for seeing through references:
+ * valops.c (find_overload_match): Handle STABS overloading for
+ C++.
+ (find_overload_match): Look in right place for function arguments
+ in the debug info.
+ (find_overload_match): Rather than giving up when we have >1
+ perfect match, just choose one, especially since the
+ recommendation GDB gives ("disambiguate it by specifying function
+ signature"), is basically impossible.
+ (check_field_in): STREQ->strcmp_iw
+ (search_struct_field): STREQ->strcmp_iw
+ (find_method_list): STREQ->strcmp_iw
+ * gdbtypes.c (rank_one_type): Add ability to see through
+ references.
+ (rank_one_type): strcmp->strcmp_iw, because the whitespace could
+ be different.
+ (rank_function): Rank function properly (was doing it wrong
+ before, comparing the wrong parts of the arrays)
+ (rank_one_type): Change #if 0 to #ifdef DEBUG_OLOAD.
+ * gdbtypes.h: Add REFERENCE_CONVERSION_BADNESS for "badness"
+ associated with converting a non-reference to a reference.
+ * eval.c (evaluate_subexp_standard): for OP_VAR_VALUE, always
+ return full value object; for STRUCTOP_PTR, use pointer to
+ rtti type to get member / method if objectprint is set and
+ target type of pointer is class.
+
+ * gdbtypes.c (rank_one_type): Add comment on how to eliminate the
+ #ifdef DEBUG_OLOAD.
+
+2000-03-11 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c: Fix the formatting where indent misinterpreted `&' as
+ a binary operator.
+ (gnu_attach): Change error message for missing
+ argument to be identical to the corresponding message in
+ `inftarg.c'. This makes the testsuite happy.
+
+2000-03-11 Mark Kettenis <kettenis@gnu.org>
+
+ * i386gnu-nat.c (gnu_store_registers): Make sure the T bit in the
+ %eflags isn't modified. This fixes a bug where every call to a
+ function in the program beyond the first call would fail.
+
+Fri Mar 10 11:44:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Devolve responsibility for domain maintenance.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * minsyms.c (prim_record_minimal_symbol_and_info): Add comment.
+
+2000-02-25 Scott Bambrough <scottb@netwinder.org>
+
+ * gdb.base/long_long.exp: Correct test suite failure when printing
+ a long long value as a double on ARM platforms.
+
+Thu Mar 9 14:21:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS (Core): Anthony Green is the Java - including
+ testsuite - maintainer. Reformat testsuite and language support
+ sections
+
+2000-03-08 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_linux_saved_pc_after_call): New function.
+ * config/i386/tm-linux.h (SAVED_PC_AFTER_CALL): Define to call
+ i386_linux_saved_pc_after_call.
+
+2000-03-06 Jim Blandy <jimb@redhat.com>
+
+ From Tom Tromey <tromey@cygnus.com> and Keith Seitz <?>:
+
+ * minsyms.c: #include <ctype.h>, for msymbol_hash_iw.
+ (compact_minimal_symbols): Added `objfile' argument.
+ Put symbols in the objfile's hash table.
+ (install_minimal_symbols): Put symbols in the objfile's demangled
+ hash table.
+ (lookup_minimal_symbol): Use hash table to find symbol in
+ objfile.
+ (msymbol_hash_iw, msymbol_hash, add_minsym_to_hash_table): New
+ functions.
+ (prim_record_minimal_symbol_and_info): Initialize the
+ hash link fields of the new minimal symbol.
+ * symtab.h (struct minimal_symbol): New fields `hash_next',
+ `demangled_hash_next'.
+ (msymbol_hash_iw, msymbol_hash, add_minsym_to_hash_table): Declare.
+ * objfiles.h (MINIMAL_SYMBOL_HASH_SIZE): New define.
+ (struct objfile): New fields `msymbol_hash',
+ `msymbol_demangled_hash'.
+
+2000-03-06 Jim Blandy <jimb@redhat.com>
+
+ * solib.c (first_link_map_member): Doc fix.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+
+ * event-loop.c (poll_timers): Don't compare delta.tv_sec with
+ zero, since time_t might be unsigned.
+
+2000-03-06 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (supply_fpregset): Mask off the reserved bits
+ in *FPREGSETP.
+ (convert_to_fpregset): Don't touch the reserved bits in *FPREGSETP.
+
+2000-03-05 Mark Kettenis <kettenis@gnu.org>
+
+ Allow GDB to run on Linux 2.0 again.
+ * config.in: Add HAVE_PTRACE_GETREGS.
+ * configure.in: Check if <sys/ptrace.h> defines PTRACE_GETREGS.
+ * configure: Regenerated.
+ * config/i386/nm-linux.h (CANNOT_FETCH_REGISTER,
+ CANNOT_STORE_REGISTER): New defines.
+ * i386-linux-nat.c (have_ptrace_getregs): New variable.
+ (PTRACE_XFER_TYPE, CANNOT_FETCH_REGISTER, fetch_register,
+ old_fetch_inferior_registers, CANNOT_STORE_REGISTER,
+ store_register, old_store_inferior_registers): Copied over from
+ `inptrace.c' as a temporary measure.
+ (fetch_regs, store_regs, fetch_fpregs, store_fpregs):
+ Conditionalize on HAVE_PTRACE_GETREGS. Define stubs if
+ HAVE_PTRACE_GETREGS isn't defined.
+ (fetch_regs): Reset `have_ptrace_getregs' if ptrace call fails
+ with EIO.
+ (fetch_inferior_registers, store_inferior_registers): Fall back on
+ the method use in `infptrace.c' (by calling
+ old_fetch_inferior_registers and old_store_inferior_registers) if
+ `have_ptrace_getregs' isn't set.
+
+2000-03-05 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c: Use elf_gregset_t and elf_fpregset_t instead
+ of gregset_t and fpregset_t. Those are the only names that are
+ guaranteed to specify the right types for all supported Linux
+ systems out there.
+ Various doc fixes and gratitious local variable renames, all in an
+ attempt to stress similarities between the code and unify the
+ terminology used. Use ISO-C all over.
+ (regmap): Remove trailing comma.
+ (FPREG_ADDR): Renamed from FPREGSET_T_FPREG_ADDR.
+ (convert_to_gregset): Make static. Remove GDB_REGS argument. It
+ is unnecessary and wasn't used anyway. All callers changed.
+ (convert_to_fpregset, convert_to_xfpregset): Likewise.
+ (fetch_regs, store_regs): Remove unused variable `regno'.
+ (fill_fpregs): If REGNO is not -1, only update the specified
+ register.
+ (fetch_core_registers): Renamed from
+ i386_linux_fetch_core_registers. There is no need for a unique
+ name since the function is static anyway.
+ (linux_elf_core_fns): Renamed from i386_linux_nat_core_functions
+ since it is more descriptive.
+
+Sun Mar 5 19:40:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS (readline/): Expand to include host maintainers.
+
+2000-03-04 Mark Kettenis <kettenis@gnu.org>
+
+ Fix support for Linux/i386 signal trampolines. The old approach
+ didn't work for Linux 2.2 and beyond, and didn't work with recent
+ versions of the GNU C library.
+ * i386-tdep.c (LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0,
+ LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): New defines.
+ (linux_rt_sigtramp_code): New variable.
+ (LINUX_RT_SIGTRAMP_LEN): New define.
+ (i386_linux_rt_sigtramp_start): New function. Detect start of
+ signal trampolines for RT signals.
+ (i386_linux_sigtramp): Removed.
+ (i386_linux_in_sigtramp): New function.
+ (i386_linux_sigcontext_addr): New function. Recognize the names
+ of the signal tranmpolines used by recent versions of the GNU C
+ library, and add support for RT signals.
+ (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET): New
+ defines. Moved here from config/i386/tm-linux.h.
+ (i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp):
+ Reimplement in terms of i386_linux_sigcontext_addr.
+ * config/i386/tm-linux.h (LINUX_SIGCONTEXT_SIZE): Removed.
+ (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET):
+ Moved to i386-tdep.c.
+ (IN_SIGTRAMP): Redefine to call i386_linux_in_sigtramp.
+
+Sat Mar 4 19:38:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ By: Sat Mar 4 04:08:58 2000 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+ * Makefile.in (all-gdbtk): Fix $srcdir to ${srcdir}.
+
+Sat Mar 4 17:23:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Frank Ch. Eigler and Andrew Cagney co-ordinate the
+ sim directory.
+
+Sat Mar 4 16:19:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Michael Snyder and Peter Schauer to list of
+ ``Blanket Write Privs'' maintainers.
+
+Sat Mar 4 15:58:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Sun 20 Feb 2000 Robert Lipe <robertl@sco.com>:
+ * language.c (longest_local_hex_string_custom): Don't compile
+ 'long long' section if host doesn't have 'long long'.
+
+Sat Mar 4 15:45:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * language.c (longest_raw_hex_string): Comment out. Appears
+ unused.
+
+Sat Mar 4 13:02:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (mcalloc), defs.h (mcalloc): Keep consistent with
+ "mmalloc.h" which means using PTRs.
+ (init_malloc, msavestring, mstrsave): Convert to PTR free ISO-C.
+
+Sat Mar 4 11:49:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (store_address, store_unsigned_integer, store_address):
+ Replace PTR with void* in delcaration.
+ * findvar.c (extract_signed_integer, extract_unsigned_integer,
+ extract_long_unsigned_integer, extract_address,
+ store_signed_integer, store_unsigned_integer, store_address):
+ Convert definition to ISO-C. Replace PTR with void*.
+
+Sat Mar 4 10:57:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (make_cleanup_func): Document as deprecated.
+ (make_cleanup_ftype): New typedef. Make signature consistent with
+ other function typedefs. Document as not be used out side of
+ make_cleanup code. Use in make_cleanup declarations.
+ (null_cleanup): Replace PTR with void*.
+
+ * utils.c (make_cleanup, make_final_cleanup, make_run_cleanup,
+ make_exec_cleanup, make_exec_error_cleanup, make_my_cleanup,
+ null_cleanup): Change K&R definition to ISO-C using void* and
+ make_cleanup_fytpe.
+ (discard_my_cleanups): Don't cast argument to free.
+
+2000-03-03 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * defs.h (struct continuation_arg): Change type of field 'data'
+ from PTR to void *.
+
+ * event-loop.h: Eliminate uses of PTR, use 'void *' instead.
+
+ * event-top.c: Ditto.
+
+Fri Mar 3 15:39:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (CONFIG_CLEAN, CONFIG_ALL, LN_S): Defined by
+ configure.
+ (SUBDIR_MI_CLEAN, SUBDIR_GDBTK_CLEAN, SUBDIR_MI_ALL,
+ SUBDIR_GDBTK_ALL): Define.
+ (all-gdbtk, clean-gdbtk): New targets.
+ (all): Add CONFIG_ALL as dependency.
+ (clean): Add CONFIG_CLEAN as dependency.
+
+ * configure.in (CONFIG_ALL, CONFIG_CLEAN): Define.
+ (LN_S): Define. Delete GDBtk's link code.
+
+Fri Mar 3 13:12:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (ENABLE_GDBTK): Delete variable.
+ (enable-gdbtk): Only enable gdbtk when there is a GDBTK directory.
+ * Makefile.in: Update.
+ * configure: Regenerate
+
+2000-03-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/alpha/alpha-linux.mh: Remove core-regset.o fron the
+ NATDEPFILES list.
+
+2000-03-02 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386aix.h (NUM_FPREGS, NUM_REGS, REGISTER_BYTES):
+ Override definitions to include the normal FPU registers.
+ (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Removed. The default definitions are
+ fine for AIX/i386.
+ (i387_to_double, double_to_i387): Remove prototypes.
+
+2000-03-02 Kevin Buettner <kevinb@redhat.com>
+
+ * findvar.c (extract_floating, store_floating): Use target
+ floating point type sizes rather host sizes to determine
+ which conversion needs to be done.
+
+2000-03-02 Nick Duffek <nsd@cygnus.com>
+
+ * uw-thread.c: Apply GNU conventions to comment formatting.
+ (deactivate_uw_thread): Call remove_thread_event_breakpoints().
+ (uw_thread_mourn_inferior): Move remove_thread_event_breakpoints()
+ call to deactivate_uw_thread().
+
+Thu Mar 2 09:04:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Daniel Berlin is C++ maintainer.
+
+Thu Mar 2 08:55:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Mark Kettenis is the x86 architcture maintainer and
+ a joint GNU/Linux/x86 maintainer. Nick Duffeck and Robert Lipe
+ share SCO/Unixware. Nick Duffek and Peter Schauer share
+ Solaris/x86.
+
+Wed Mar 1 22:12:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Wed 23 Feb 2000 Fernando Nasser <fnasser@redhat.com>:
+ * remote-sim.c (gdbsim_close): Call generic_mourn_inferior.
+ * remote-rdi.c (arm_rdi_close): Ditto.
+
+Wed Mar 1 19:31:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * CONTRIBUTE (configure.in): Note that patches to configure are
+ not needed.
+
+2000-03-01 Mark Kettenis <kettenis@gnu.org>
+
+ * MAINTAINERS: Correct my own mail address.
+
+Wed Mar 1 11:26:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Document people with paperwork pending.
+
+Wed Mar 1 00:49:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ Make NEW_PROC_ABI interface functional on Solaris x86.
+ * sol-thread.c (ps_lgetLDT): Rewrite to use new
+ procfs_find_LDT_entry function from procfs.c, mostly copied from
+ lin-thread.c.
+ * inferior.h, procfs.c (procfs_get_pid_fd): Removed, no longer
+ needed.
+
+Wed Mar 1 00:34:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-26 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * config/i386/tm-i386sol2.h (MERGEPID): Define.
+
+Wed Mar 1 00:06:19 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 1999-08-13 J.T. Conklin <jtc@redback.com>:
+ * config/i386/tm-i386.h (FRAME_INIT_SAVED_REGS): Replace
+ FRAME_FIND_SAVED_REGS.
+ (i386_frame_init_saved_regs): Replace i386_frame_find_saved_regs.
+ * i386-tdep.c (i386_frame_init_saved_regs, i386_pop_frame):
+ Update.
+
+Tue Feb 29 23:56:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-23 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
+ * objfiles.c (open_mapped_file): Fix obsolete references to `mapped'
+ parameter.
+
+Tue Feb 29 18:47:58 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-23 Eli Zaretskii <eliz@is.elta.co.il>:
+ * config/i386/nm-go32.h (FLOAT_INFO): Remove macro definition.
+ (top level): Add prototypes for go32_* functions.
+ * config/i386/tm-go32.h (I386_DJGPP_TARGET): Define.
+ (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC):
+ Override definitions from tm-i386.h.
+ (REGISTER_VIRTUAL_TYPE): Remove macro definition.
+ * i386-tdep.c (i386_extract_return_value)
+ [I386_AIX_TARGET || I386_GNULINUX_TARGET]: Add I386_DJGPP_TARGET
+ to the list of targets which return FP values in FP registers.
+
+ * i386-tdep.c (i386_extract_return_value): Add FIXME recommending
+ that this function be re-implemented using multi-arch.
+
+Tue Feb 29 18:40:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-23 Eli Zaretskii <eliz@is.elta.co.il>:
+ * utils.c [__GO32__]: Include pc.h, for prototypes of ScreenCols
+ and ScreenRows.
+ * ser-go32.c: Include string.h, for prototype of strncasecmp.
+ (dpmi_regs, dpmi_sregs): Remove unused variables.
+ (dos_flush_input): Return a value, to prevent compiler warning.
+ * expprint.c (dump_prefix_expression): Use %ld in format and cast
+ sizeof(union exp_element) to long, to prevent GCC from complaining
+ about format/argument mismatch.
+ (dump_postfix_expression): Likewise.
+
+Tue Feb 29 18:09:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * arm-tdep.c: Include <ctype.h>.
+
+Tue Feb 29 17:33:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Wed, 23 Feb 2000 Fernando Nasser <fnasser@redhat.com>:
+ * stack.c (backtrace_command_1), infrun.c (normal_stop): Check
+ that the target's stack was valid.
+
+Tue Feb 29 15:14:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-02-22 Stephane Carrez <stcarrez@worldnet.fr>:
+ * dwarf2read.c (read_address): Read 16-bits addresses.
+
+2000-02-28 Scott Bambrough <scottb@netwinder.org>
+
+ * arm-linux-nat.c (fetch_nw_fpe_*):
+ Renamed to fetch_nwfpe_* to use the same naming convention
+ as in the Linux kernel. Modified prototype to get rid of
+ unused parameters.
+ (store_nw_fpe_*): Renamed to store_nwfpe_* to use the same
+ naming convention as in the Linux kernel. Fixed calls to
+ fetch_nwfpe_*.
+ (store_fpregs): Fixed calls to store_nwfpe_*. Removed
+ unused variable.
+
+Mon Feb 28 18:24:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Transfer d30v maintainership to David Taylor.
+
+2000-02-28 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Remove unneeded header.
+ * wince.c: Ditto.
+
+Mon Feb 28 13:34:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * wince.c: Include "gdb_wait.h" and not "wait.h".
+
+Mon Feb 28 10:58:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Mention mmalloc. Expand Host/Native and
+ Target/Architecture maintainers descriptions.
+
+2000-02-26 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c: Include "gdbthread.h". Include <hurd.h>.
+ Reorder headers a bit. Overall cleanup and minor reformatting.
+ (MIG_SERVER_DIED): Remove define.
+ (proc_update_sc): Add braces to silence compiler warning.
+ (proc_steal_exc_port): Initialize err to zero.
+ (make_proc): Add braces to silence compiler warning.
+ (inf_validate_task_sc): Add cast to silence compiler warning.
+ (inf_set_traced): Reorganize a bit to silence compiler warning.
+ (inf_validate_procs): Use mach_msg_type_number_t for all thread
+ numbers and add braces to silence compiler warning.
+ (gnu_wait): Add prototypes for server functions and add braces to
+ silence compiler warnings.
+ (S_exception_raise_request): Pass subcode to inf_debug call.
+ (gnu_write_inferior): Remove unused variable `protection_changed'.
+ (gnu_xfer_memory): Remove unused variable `result'.
+ (set_sig_thread_cmd): Remove unused varible `tid'.
+ (set_signals_cmd): Remve unused variable `trace'.
+ (add_task_commands): Provide complete prototype. Reformat help
+ strings a bit to make sure the first line is a full sentence.
+ Call info_port_rights_cmd instead of info_send_rights_cmd for the
+ "info port-rights" command.
+ (add_thread_commands): Provide complete prototype. Make static.
+ Reformat help strings a bit to make sure the first line is a full
+ sentence.
+ (_initialize_gnu_nat): Provide complete prototype.
+
+2000-02-26 Mark Kettenis <kettenis@gnu.org>
+
+ Make cross-compilation for the Hurd more friendly.
+ From Jeff Bailey <jbailey@gnu.org>:
+ * configure.in: Use AC_CHECK_TOOL to find MiG.
+ * Makefile.in (MIG): New variable.
+ * config/i386/i386gnu.mh (MIG): Remove.
+ * configure: Regenerated.
+
+2000-02-26 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Add
+ comment explaining motivation behind this function and why
+ the generic facilities won't work for this platform.
+ * rs6000-tdep.c (skip_prologue): Always test to make sure
+ that an instruction is read successfully from the target's
+ memory. Introduce notion of instructions which may appear in
+ the prologue, but may not end the prologue. Added explicit
+ check for nop instruction. Use memset() to zero the frame
+ data instead of assignment from a statically allocated,
+ uninitialized structure.
+
+Sat Feb 26 17:15:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Chris Faylor is responsible for all MS Windows
+ systems. Note that Jim Blandy as maintainer for ``tracing
+ bytecode stuff''
+
+2000-02-25 Fernando Nasser <fnasser@cygnus.com>
+
+ From: Thomas Zenker <thz@Lennartz-electronic.DE>
+ * rdi-share/hsys.c: to compile under 4.4BSD derived systems (FreeBSD,
+ NetBSD...) sys_errlist should not be declared in hsys.c.
+ NEED_SYSERRLIST is set already by configure, so we can use it.
+ * rdi-share/unixcomm.c: 4.4BSD derived systems define BSD, but are
+ posix compliant and we should not work with the old compatibility
+ stuff. Because of that I undef BSD in case of FBSD etc and include
+ sys/ioctl to get the flags.
+ * rdi-share/unixcomm.c: If the TIOCEXCL flags exists set serial line
+ for exclusive use.
+
+2000-02-24 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-tdep.c (ppc_sysv_abi_push_arguments): Put address
+ of return structure in r3 if necessary.
+ (ppc_linux_memory_remove_breakpoints): New function.
+ * rs6000-tdep.c (skip_prologue): Make sure that the cases
+ for storing either cr or lr to the stack only handle those
+ cases. (I.e, don't let these cases match 0x00000000 which is
+ found found in the shared library trampoline prior to the
+ loading of the shared library.)
+ * config/powerpc/tm-linux.h (ppc_linux_memory_remove_breakpoint):
+ Declare.
+ (MEMORY_REMOVE_BREAKPOINT): Define.
+
+Wed Feb 23 23:27:48 2000 Andrew Cagney <cagney@behemoth.cygnus.com>
+
+ * hppah-nat.c: Include "gdb_wait.h" instead of <wait.h>.
+
+Thu Feb 24 18:42:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (CONFIG_INSTALL, CONFIG_UNINSTALL): Set to
+ $(SUBDIR_*_INSTALL) when so configured.
+ * configure: Regenerate.
+
+ * Makefile.in (CONFIG_INSTALL, CONFIG_UNINSTALL): Define using
+ configure.
+ (install-only): Add dependency on $(CONFIG_INSTALL). Delete code
+ installing GDBtk.
+ (uninstall): Add dependency on $(CONFIG_UNINSTALL).
+ (SUBDIR_MI_INSTALL, SUBDIR_MI_UNINSTALL, SUBDIR_GDBTK_UNINSTALL,
+ SUBDIR_GDBTK_INSTALL): Define.
+ (install-gdbtk): New target.
+
+Thu Feb 24 18:19:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (SUBDIR_MI_CFLAGS): Fix typo, wrong brace.
+ * configure: Regenerate.
+
+2000-02-24 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.tgt: Add arm, mips, sh wince targets.
+ * config/arm/tm-wince.h: New file.
+ * config/arm/wince.mt: New file.
+ * config/sh/tm-wince.h: New file.
+ * config/sh/wince.mt: New file.
+ * config/mips/tm-wince.h: New file.
+ * config/mips/wince.mt: New file.
+ * wince.c: New file.
+ * wince-stub.c: New file.
+ * wince-stub.h: New file.
+ * sh-tdep.c: Use correct register names for Windows CE.
+
+Wed Feb 23 19:01:45 EST 2000 Nicholas Duffek <nsd@cygnus.com>
+
+ * top.c (SIGJMP_BUF, SIGSETJMP, SIGLONGJMP): Update comments.
+ (error_return, quit_return): Merge into catch_return pointer.
+ (return_to_top_level): Update comment. Longjmp to *catch_errors,
+ and communicate reason to catch_errors via setjmp return value.
+ (catch_errors): Always catch both quit and error, and if a catch
+ wasn't requested by caller, throw it to the next catch_error.
+ Replace dual longjmp buffer memcpy with single pointer change.
+ Add FIXME for possibly adding new interface to tell caller what
+ event was caught. Add extensive comments.
+ * defs.h (enum return_reason): Reserve 0 for use as initial
+ setjmp() return value.
+ (RETURN_MASK): New public macro to generate RETURN_MASK_* from
+ enum return_reason.
+ (RETURN_MASK_QUIT, RETURN_MASK_ERROR): Define using RETURN_MASK.
+
+2000-02-23 Fernando Nasser <fnasser@cygnus.com>
+
+ * infcmd.c (run_stack_dummy): Do not pop frame on random signal.
+ * valops.c (_initialize_valops): Add command "set unwindonsignal".
+ (hand_function_call): Test for unwind_on_signal and act accordingly.
+
+Wed Feb 23 12:58:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (dis_asm_read_memory): Change LEN to unsigned long.
+ Match ../include/dis-asm.h change.
+ * gdbarch.h: Regenerate.
+ * corefile.c (dis_asm_read_memory): Update.
+
+Mon Feb 21 13:57:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (CONFIG_INITS): Fix typo, was CONFIG_INIT.
+ (ENABLE_CFLAGS): Move initialization to start of file.
+ (enable-gdbmi): Add new configure option --enable-gdbmi. When
+ selected and an ${srcdir}/mi directory is present enable MI
+ interface.
+
+ * configure: Regenerate.
+
+ * Makefile.in (SUBDIR_MI_OBS, SUBDIR_MI_SRCS, SUBDIR_MI_DEPS,
+ SUBDIR_MI_INITS, SUBDIR_MI_LDFLAGS, SUBDIR_MI_CFLAGS): New macros.
+ (CONFIG_OBS, CONFIG_SRCS, CONFIG_DEPS, CONFIG_INITS,
+ CONFIG_LDFLAGS): New macros. Initialized by autoconf via
+ @CONFIG...@.
+ (INTERNAL_LDFLAGS, CDEPS, LINTFILES, DEPFILES, SOURCES,
+ INIT_FILES): Use $(CONFIG_...) instead of @CONFIG...@.
+
+ * mi: New directory. MI interface to GDB.
+
+ * defs.h (interpreter_p): Declare when UI_OUT.
+ * top.c (gdb_init): When interpreter_p, check that the interpreter
+ was recognized by one of the linked in interpreters.
+ * main.c (interpreter_p): Define.
+ (captured_main): When UI_OUT, check for ``-i <interpreter>'' option.
+ * event-top.c (display_gdb_prompt): When interpreter_p, assume
+ interpreter displays prompt.
+
+ * breakpoint.c (print_it_typical, watchpoint_check,
+ print_one_breakpoint, mention): When MI include additional
+ target status information.
+ * infrun.c (print_stop_reason, normal_stop): Ditto.
+
+2000-02-22 Jim Blandy <jimb@redhat.com>
+
+ * gdbarch.sh: Make the `default' field really default to zero, as
+ documented.
+
+ Bring COERCE_FLOAT_TO_DOUBLE under gdbarch's control.
+ * valops.c (COERCE_FLOAT_TO_DOUBLE): Rework definition to be
+ more function-like.
+ (default_coerce_float_to_double, standard_coerce_float_to_double):
+ New functions.
+ (value_arg_coerce): Adjust for new definition.
+ * value.h (default_coerce_float_to_double,
+ standard_coerce_float_to_double): New declarations for the above.
+ * gdbarch.sh (coerce_float_to_double): New entry, replacing macro.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * tm-alpha.h, tm-fr30.h, tm-m32r.h, tm-mips.h, tm-hppa.h,
+ tm-rs6000.h, tm-sh.h, tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Change
+ definitions.
+ * mips-tdep.c (mips_coerce_float_to_double): Supply our own custom
+ function here.
+ (mips_gdbarch_init): Install that as our coerce_float_to_double
+ function.
+
+2000-02-22 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-nat.c (supply_gregset, supply_fpregset): Add return
+ type.
+ * ppc-linux-tdep.c (ppc_linux_at_sigtramp_return_path): Add
+ forward declaration.
+
+ * ppc-linux-tdep.c (ppc_linux_frame_saved_pc): Handle case
+ where the next frame is a signal handler caller.
+
+ * config/powerpc/tm-linux.h (PUSH_ARGUMENTS): Remove extraneous
+ undef.
+ (tm-linux.h): Include.
+ (tm-sysv4.h): Don't include (directly). config/tm-linux.h will
+ include this file for us.
+ (REALTIME_LO, REALTIME_HI): Don't define. These are defined by
+ config/tm-linux.h for us.
+ (SOFUN_ADDRESS_MAYBE_MISSING): Define.
+
+2000-02-21 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (ppc-linux-nat.c, ppc-linux-tdep.c): New files.
+ (ppc-linux-nat.o, ppc-linux-tdep.o): Add dependencies.
+ * configure.tgt (powerpc-*-linux*): Separate from powerpc-*-eabi
+ and like targets.
+
+ * ppc-linux-nat.c, ppc-linux-tdep.c, config/powerpc/linux.mt,
+ config/powerpc/nm-linux.h, config/powerpc/tm-linux.h: New files.
+ * config/powerpc/xm-linux.h: Substantially revised for native
+ port.
+ * config/powerpc/linux.mh (NAT_FILE): Redefine to be nm-linux.h.
+ (NATDEPFILES): Update list to reflect the fact that we can
+ now debug natively.
+
+ * rs6000-tdep.c, config/rs6000/tm-rs6000.h
+ (rs6000_frameless_function_invocation, rs6000_frame_saved_pc):
+ Renamed; The former names were lacking the rs6000_ prefix.
+ * rs6000-tdep.c (rs6000_frame_saved_pc): Call FRAME_CHAIN
+ instead of rs6000_frame_chain.
+ (rs6000_frame_chain): Call FRAMELESS_FUNCTION_INVOCATION instead
+ of rs6000_frameless_function_invocation.
+
+2000-02-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Philippe De Muyter <phdm@macqel.be>
+
+ * event-loop.c (handle_file_event): In case of poll, enable
+ printing of informational message if an error/exception is
+ detected on the file descriptor.
+
+2000-02-21 Jim Kingdon <kingdon@redhat.com>
+
+ * MAINTAINERS (Misc): Clarify that yes, anyone can edit web pages.
+
+Mon Feb 21 12:50:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * buildsym.c: Include "language.h" and "expression.h" for
+ longest_local_hex_string_custom.
+
+Mon Feb 21 11:17:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh: Include <gdb_wait.h> instead of <wait.h>.
+ * gdbarch.c: Already updated by Wed Feb 9 18:59:16 2000 Andrew
+ Cagney <cagney@b1.cygnus.com>.
+
+Mon Feb 21 11:03:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Update: IA-64 - Kevin Buettner; ARM - Fernando
+ nasser, Jim Ingham and Scott Bambrough; GNU/Linux ARM - Scott
+ Bambrough; event loop - Elena Zannoni; SDS and RDI/APD protocol -
+ to Fernando Nasser and Jim Ingham; KOD - Fernando Nasser; MI -
+ Andrew Cagney, Elena Zannoni and Fernando Nasser; Web pages - Jim
+ Kingdon.
+ * MAINTAINERS: Add Nick Clifton to write after approval list.
+
+Mon Feb 21 10:30:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add note on multiple maintainers.
+
+2000-02-19 Philippe De Muyter <phdm@macqel.be>
+
+ * cli-out.c (cli_table_header): Type of parameter `alignment' is
+ `enum ui_align', not `int'.
+ (cli_field_string, cli_field_skip): Likewise.
+
+2000-02-18 Jim Blandy <jimb@redhat.com>
+
+ From Jimmy Guo <guo@cup.hp.com>:
+ * buildsym.h (add_free_pendings): Declare.
+ * buildsym.c (add_free_pendings): New function.
+ (make_blockvector): 32x64 fix using longest_local_hex_string().
+ (start_subfile): initialize variable 'subfile'.
+
+2000-02-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (remote_async_detach): Use target_mourn_inferior(), to
+ make sure that all is cleaned up after we disconnect from the
+ target.
+ (remote_detach): Ditto.
+
+2000-02-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Rodney Brown <RodneyBrown@pmsc.com>
+ * ui-out.c (ui_out_set_flags): Fix typo, removing warning and
+ potentially harming mistake.
+
+2000-02-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c: Use header file instead of extern declarations for
+ the {get,set}_arm_regname* functions.
+
+2000-02-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * configure.in: Replaces obsolete gdbtk-variable.c with
+ gdbtk-varobj.c.
+ * configure: Regenerate.
+ * Makefile.in: Remove obsolete/extraneous references to
+ gdbtk-var* files.
+
+2000-02-16 Mark Kettenis <kettenis@gnu.org>
+
+ * target.c (do_target_signal_to_host): Do not use REALTIME_LO in
+ the conversion of the signal number. TARGET_SIGNAL_REALTIME_33 is
+ 33 by definition, whereas REALTIME_LO might be 32 on systems that
+ have SIG32 such as Linux. Make sure that the signal number
+ returned is within the range specified by REALTIME_LO and
+ REALTIME_HI.
+
+2000-02-16 Mark Kettenis <kettenis@gnu.org>
+
+ * configure: Regenerated.
+
+2000-02-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (set_disassembly_flavor, arm_othernames,
+ _initialize_arm_tdep): Allows the user to choose between any of
+ the flavors available for the disassembly to be used in the "info
+ reg" command and elsewhere in gdb. It prevents having to maintain
+ this information in two places by using the data kept in the
+ opcodes directory.
+
+2000-02-09 Mark Kettenis <kettenis@gnu.org>
+
+ * configure.in: Check for lwpid_t, psaddr_t, prgregset_t and
+ prfpregset_t in <sys/procfs.h>.
+ * config.in: Add HAVE_LWPID_T, HAVE_PSADDR_T, HAVE_PRGREGSET_T,
+ HAVE_PRFPREGSET_T.
+ * gdb_proc_service.h: Only provide typedefs for lwpid_t, psaddr_t,
+ prgregset_t and prfpregset_t if they are not already present.
+
+Wed Feb 16 19:00:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-01-26 Rodney Brown <RodneyBrown@pmsc.com>:
+ * procfs.c: Define MERGEPID if not defined. For osf4.0e.
+
+2000-02-15 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in (diststuff): Run 'diststuff' in doc/ subdir, not
+ 'do-doc'.
+
+2000-02-15 Kevin Buettner <kevinb@redhat.com>
+
+ Changes for AIX 4.3:
+ * rs6000-tdep.c (rs6000_fix_call_dummy): Set TOC register
+ to correct value for generic dummy frames. When using
+ generic dummy frames, don't attempt to write TOC value or
+ function to call into the call dummy.
+ (rs6000_push_arguments): Adapt USE_GENERIC_DUMMY_FRAMES
+ code to also handle the PowerOpen ABI.
+ (ppc_push_return_address): Enable for all ports.
+ * config/powerpc/tm-ppc-aix.h (USE_GENERIC_DUMMY_FRAMES,
+ PUSH_DUMMY_FRAME, PUSH_RETURN_ADDRESS, GET_SAVED_REGISTER,
+ CALL_DUMMY_BREAKPOINT_OFFSET, CALL_DUMMY_LOCATION,
+ CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET): Override defaults
+ provided by generic RS6000 definitions so that call dummies
+ are implemented using generic dummy frames instead.
+
+ * rs6000-nat.c (store_inferior_registers): Call exec_one_dummy_insn()
+ prior to changing the stack pointer via ptrace(). Also, ignore
+ attempts to store to undefined registers that are less than
+ NUM_REGS.
+
+ * rs6000-tdep.c (DUMMY_FRAME_SIZE): Change size of the dummy
+ frame from 436 to 448 to account for alignment padding.
+ (rs6000_push_arguments): Obtain actual register size instead
+ of assuming the register is 4 bytes long. [There's still
+ more work to be done to totally remove the 4 byte assumption,
+ however.] Make sure the stack is 16 byte aligned as required
+ by the PowerOpen ABI. Also, make sure that small structures
+ passed in registers are properly aligned within the register.
+
+2000-02-15 Jesper Skov <jskov@cygnus.co.uk>
+
+ Patch applied by Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (skip_prologue): skip copying of argument
+ registers to local variable registers.
+
+2000-02-14 Jim Kingdon <kingdon@redhat.com>
+
+ * elfread.c (elf_symtab_read): Revert changes by Amit S. Kale. A
+ sym->section->index number is not a SECT_OFF_* code.
+
+Tue Feb 15 12:07:30 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS (write after approval): Add H.J. Lu.
+
+2000-02-14 Nick Clifton <nickc@cygnus.com>
+
+ * sh-tdep.c: Remove extraneous code.
+
+2000-02-14 Amit S. Kale <akale@veritas.com>
+
+ * elfread.c (elf_symtab_read): Move the use of sym to after where
+ it is set.
+ Checked in by Jim Kingdon <kingdon@redhat.com>
+
+Mon Feb 14 15:39:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Make Nick Duffek the UnixWare threads maintainer.
+
+Mon Feb 14 15:20:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 1999-11-24 Jason Merrill <jason@casey.cygnus.com>:
+ * dwarf2read.c: (die_is_declaration): New fn.
+ (read_structure_scope): Use it.
+
+ * dwarf2read.c: (die_is_declaration): Convert to ISO-C.
+
+2000-02-10 J.T. Conklin <jtc@redback.com>
+
+ * config/i386/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o
+ * configure.tgt (i[3456]86-*-netbsd*): add gdbserver to
+ configdirs.
+ * gdbserver/low-nbsd.c: New file.
+
+ * gdbserver/Makefile.in: convert to autoconf.
+ * gdbserver/configure.in: likewise.
+ * gdbserver/configure: generate.
+
+Sun Feb 13 11:21:00 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * CONTRIBUTE: New file. How to contribute to GDB.
+
+Sun Feb 13 10:34:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add Eli Zaretskii to djgpp maintiners. Add Kevin
+ Buettner to powerpc maintainers. Make Kevin Buettner the
+ GNU/LINUX PPC native maintainer. Add J.T. Conklin, Jim Kingdon
+ and Jason Molenda to write after aproval list.
+
+Sun Feb 13 10:18:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Reformat. Separate into check-in categories.
+
+Sat Feb 12 01:08:21 EST 2000 Nicholas Duffek <nsd@cygnus.com>
+
+ * uw-thread.c: Remove __FUNCTION__ GNUism.
+
+2000-01-17 Amit S. Kale <akale@veritas.com>
+
+ * elfread.c (elf_symtab_read): Use offset for the section in which a
+ symbol resides, instead of .text section for calculating address of a
+ symbol.
+ Checked in by Jim Kingdon <kingdon@redhat.com>
+
+2000-02-10 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c: Remove hackery to include <bits/waitflags.h>. It is
+ no longer necessary now we have gdb_wait.h.
+
+2000-02-09 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c (proc_string): Make global.
+ (do_mach_notify_dead_name): Suppress dead name notifications if we
+ know that the task is dead.
+
+1999-12-13 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c (inf_validate_task_sc): Get task info via proc server
+ instead of directly from the kernel. Add some hackery to make
+ sure that the info isn't influenced by suspension of the task in
+ the proc server itself.
+
+2000-02-10 Jim Kingdon <kingdon@redhat.com>
+
+ * defs.h (MERGEPID): Added. Patch submitted by Andrew Hobson and
+ approved by Michael Snyder.
+
+2000-02-09 Mark Kettenis <kettenis@gnu.org>
+
+ * linux-thread.c: Include defs.h before gdb_wait.h.
+
+Wed Feb 9 18:59:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (wait_h): Delete macro. Update all dependencies
+ specifying gdb_wait.h instead.
+
+ * ser-unix.c, ser-pipe.c, remote.c, remote-udi.c, remote-sds.c,
+ remote-os9k.c, remote-es.c, remote-rdp.c, remote-vx960.c,
+ remote-vx.c, remote-st.c, remote-nindy.c, remote-mm.c,
+ convex-xdep.c, convex-tdep.c, target.c, win32-nat.c, standalone.c,
+ remote-vxmips.c, remote-vxsparc.c, remote-vx68.c, remote-vx29k.c,
+ remote-sim.c, remote-rdi.c, remote-mips.c, remote-eb.c,
+ remote-e7000.c, remote-bug.c, remote-array.c, remote-adapt.c,
+ ppc-bdm.c, ocd.c, monitor.c, m3-nat.c, linux-thread.c,
+ infttrace.c, lin-thread.c, infptrace.c, gnu-nat.c, gdbarch.c,
+ fork-child.c, command.c: Include "gdb_wait.h" instead of <wait.h>
+ or <sys/wait.h>.
+ * nindy-share/nindy.c, nindy-share/Onindy.c: Ditto.
+
+ * gdb_wait.h: New file. Based on ../include/wait.h. Include
+ <sys/wait.h> or <wait.h> and then define any missing WIF macros.
+
+Wed Feb 9 01:14:54 2000 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/d10v/tm-d10v.h (NO_EXTRA_ALIGNMENT_NEEDED): Define.
+ * config/d10v/tm-d10v.h (STACK_ALIGN): Define.
+ (d10v_stack_align): Declare.
+ * d10v-tdep.c (d10v_stack_align): Define.
+
+1999-08-23 J.T. Conklin <jtc@redback.com>
+
+ * top.c (remote_timeout): Change default to 2. Add comment
+ explaining history of changes to the default value.
+ * remote.c (_initialize_remote): Remove code that adds set/
+ show remotetimeout, as that's also done in top.c
+
+1999-10-18 J.T. Conklin <jtc@redback.com>
+
+ * m32r-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
+ Return E01 instead of P01 when 'P' command fails.
+
+2000-02-05 J.T. Conklin <jtc@redback.com>
+
+ * remote.c (putpkt_binary): Handle NAK from target stub.
+
+2000-02-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * configure.in: Remove the addition of sol-thread.c to the
+ CONFIG_INITS list. This caused problems with init.c, because
+ sol-thread.c would be grepped twice for _initialize_* functions.
+ * configure: Ditto.
+ * Makefile.in: Add FIXME for init.c.
+
+2000-02-07 Jim Kingdon <kingdon@redhat.com>
+
+ Clean up compiler warnings:
+ * bcache.h, bcache.c, c-valprint.c, coffread.c, stabsread.c,
+ stack.c, valprint.c: Change variables to unsigned.
+ * bcache.c: Rearrange to avoid warnings about variables not being set.
+ * c-lang.c, ch-lang.c, f-lang.c, m2-lang.c: Include valprint.h
+ rather than declaring print_max and repeat_count_threashold
+ ourselves (incorrectly).
+ * valprint.h: Do declare repeat_count_threashold.
+ * ch-exp.c: Use default case for internal error.
+ * findvar.c: Don't omit argument type.
+ * symtab.c: Remove unused variable.
+
+2000-02-04 Jim Blandy <jimb@redhat.com>
+
+ * c-typeprint.c (remove_qualifiers): New function.
+ (c_type_print_base): Use it to remove qualifiers from C++
+ qualified names, not strrchr.
+
+ * c-typeprint.c (c_type_print_base): Recognize type conversion
+ operators by calling is_type_conversion_operator.
+ (is_type_conversion_operator): New function.
+
+2000-02-04 Nick Clifton <nickc@cygnus.com>
+
+ * config/arm/tm-arm.h (LOWEST_PC): Define.
+
+2000-02-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (resume): Make just one call to target_resume(), instead
+ of four: set up correct parameters in all the cases ahead of time,
+ and do call at the end.
+
+2000-02-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * config/powerpc/tm-ppc-eabi.h: Define
+ SOFUN_ADDRESS_MAYBE_MISSING.
+
+2000-02-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_pc_is_thumb_dummy): Account for large dummy
+ frames (revisited).
+
+Fri Feb 4 22:42:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (INIT_FILES): Append CONFIG_INITS
+ * configure.in (CONFIG_INIT): Initialize.
+ (links): Link srcdir/gdbtk/library to gdbtcl2.
+ * gdbtcl2: Moved to gdbtk/library.
+ ChangeLog-gdbtk, gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c,
+ gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c,
+ gdbtk.h: Moved to gdbtk/generic.
+
+2000-02-03 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * printcmd.c (build_address_symbolic): New function. Returns all
+ the parts that are necessary to print an address in a symbolic
+ form.
+ (print_address_symbolic): Split into a printing part and an
+ information building part, build_address_symbolic().
+
+ * defs.h (build_address_symbolic): Export.
+
+2000-02-03 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (decode_locdesc): Add support for the DW_OP_bregx
+ opcode.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_push_arguments): Fix passing of floating point
+ arguments on dummy frames.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_pc_is_thumb_dummy): Account for large dummy frames.
+ (arm_pop_frame): Account fr dummy frames (as opposed to real ones).
+
+2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (getpkt_sane): New function. It is the old getpkt(),
+ which now returns a timeout indication.
+ (getpkt): New function. Wrapper for getpkt_sane(), so that return
+ value can still be ignored.
+
+Tue Feb 1 18:47:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (print_gdb_version): Print ``UI_OUT'' when configured with
+ UI_OUT.
+
+Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-file.c, ui-file.h: Rename gdb-file.h, gdb-file.c. Rename
+ ``struct gdb_file'' to ``struct ui_file''. Delete typedef
+ GDB_FILE.
+
+ * Makefile.in: Update.
+
+ * ax-gdb.c, ax-general.c, ax.h, buildsym.c, c-lang.c, c-lang.h,
+ c-typeprint.c, c-valprint.c, ch-lang.c, ch-lang.h, ch-typeprint.c,
+ ch-valprint.c, command.c, command.h, convex-tdep.c, corefile.c,
+ cp-valprint.c, d10v-tdep.c, d30v-tdep.c, defs.h, expprint.c,
+ expression.h, f-lang.c, f-lang.h, f-typeprint.c, f-valprint.c,
+ frame.h, gdb-events.sh, gdb-file.c, gdb-file.h, gdbcmd.h,
+ gdbtypes.h, hppa-tdep.c, jv-lang.c, jv-lang.h, jv-typeprint.c,
+ jv-valprint.c, language.c, language.h, m2-lang.c, m2-lang.h,
+ m2-typeprint.c, m2-valprint.c, m3-nat.c, main.c, monitor.c,
+ printcmd.c, pyr-tdep.c, remote-mips.c, remote-sim.c, remote-udi.c,
+ remote.c, scm-lang.c, scm-lang.h, scm-valprint.c, ser-e7kpc.c,
+ ser-go32.c, ser-mac.c, ser-ocd.c, ser-unix.c, ser-unix.h,
+ serial.c, serial.h, stack.c, symfile.c, symmisc.c, tahoe-tdep.c,
+ target.c, target.h, top.c, top.h, typeprint.c, typeprint.h,
+ utils.c, v850ice.c, valprint.c, valprint.h, value.h,
+ config/pa/tm-hppa.h: Update.
+ * cli-out.c, cli-out.h, ui-out.c, ui-out.h, varobj.c: Update.
+
+2000-01-31 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh,
+ config/i386/i386dgux.mh, config/i386/i386sol2.mh,
+ config/i386/i386v4.mh, config/i386/i386v42mp.mh,
+ config/i386/ncr3000.mh, config/m68k/m68kv4.mh,
+ config/m88k/delta88v4.mh, config/mips/irix4.mh,
+ config/mips/irix5.mh, config/mips/mipsv4.mh,
+ config/powerpc/solaris.mh (NATDEPFILES): Change references to
+ proc_api.o, proc_events.o, proc_flags.o, and proc_why.o to
+ proc-api.o, proc-events.o, proc-flags.o, and proc-why.o.
+
+Mon Jan 31 17:14:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (fputs_unfiltered_hook): Moved to tui/tui-file.c.
+
+ * main.c (captured_main): Only use the legacy tui_file code when
+ linking in older code such as the TUI.
+
+ * gdb-file.h, gdb-file.c: New files.
+ * utils.c, defs.h (struct gdb_file, gdb_file_new, gdb_file_delete,
+ null_file_isatty, null_file_rewind, null_file_put,
+ null_file_flush, null_file_write, null_file_fputs,
+ null_file_delete, gdb_file_data, gdb_flush, gdb_file_isatty,
+ gdb_file_rewind, gdb_file_put, gdb_file_write, fputs_unfiltered,
+ set_gdb_file_flush, set_gdb_file_isatty, set_gdb_file_rewind,
+ set_gdb_file_put, set_gdb_file_write, set_gdb_file_fputs,
+ set_gdb_file_data, struct accumulated_gdb_file,
+ do_gdb_file_xstrdup, gdb_file_xstrdup, struct mem_file):
+ mem_file_new, mem_file_delete, mem_fileopen, mem_file_rewind,
+ mem_file_put, mem_file_write, struct stdio_file): stdio_file_new,
+ stdio_file_delete, stdio_file_flush, stdio_file_write,
+ stdio_file_fputs, stdio_file_isatty, stdio_fileopen, gdb_fopen):
+ Moved to gdb-file.h and gdb-file.c.
+ * utils.c (enum streamtype, struct tui_stream, tui_file_new,
+ tui_file_delete, tui_fileopen, tui_sfileopen, tui_file_isatty,
+ tui_file_rewind, tui_file_put, tui_file_fputs,
+ tui_file_get_strbuf, tui_file_adjust_strbuf, tui_file_flush,
+ fputs_unfiltered_hook):
+ Moved to tui/tui-file.c and tui/tui-file.h.
+
+ * Makefile.in (COMMON_OBS): Add gdb-file.o, tui-file.o.
+ (tui-file.o, gdb-file.o): Add dependencies.
+ (corefile.o, main.o, utils.o, simmisc.o): Update dependencies.
+ * main.c: #include tui/tui-file.h.
+
+2000-01-28 Fred Fish <fnf@cygnus.com>
+
+ * findvar.c (value_from_register): Special case handling of D10V
+ pointer values fetched from registers.
+
+2000-01-28 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (thumb_skip_prologue, thumb_scan_prologue): Add
+ support for new style thumb prologues.
+
+2000-01-28 Nick Clifton <nickc@redhat.com>
+
+ * arm-tdep.c: Remove extraneous dash at start of strings
+ introduced in previous delta.
+
+2000-01-27 Nick Clifton <nickc@redhat.com>
+
+ * arm-tdep.c: Replace uses of arm_toggle_renames() with
+ parse_arm_disassembler_option().
+
+2000-01-27 Jim Blandy <jimb@cygnus.com>
+
+ * symtab.c (decode_line_1): Don't let commas that are within
+ quotes or parenthesis terminate the line spec. Don't use pp when
+ removing the final double quote of a double-quoted string. Don't
+ forget to skip the opening double quote. I have no clue whether
+ this change is correct; probably we've just moved this function
+ from one buggy place to another buggy place, and never came within
+ an outhouse whiff of correctness.
+ (find_toplevel_char): New function.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_push_arguments): Set the thumb mode bit when
+ passing the pointer to a thumb function as an argument.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote-rdi.c (arm_rdi_mourn_inferior): Make sure breakpoints
+ are reinserted for another run.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * cli-out.c (cli_filed_string): Test for NULL string.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * infcmd.c (run_stack_dummy): Account for a random signal stopping
+ the inferior as well as breakpoints being hit while performing an
+ inferior function call.
+ * valops.c (hand_function_call): Ditto.
+
+2000-01-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386gnu.h (THREAD_STATE_FLAVOR): Define to
+ i386_REGS_SEGS_STATE.
+ (HAVE_I387_REGS): Define.
+ (FLOAT_INFO): Remove.
+ * i386gnu-nat.c: Almost completely rewritten to use new i386
+ register layout and `float info' implementation.
+ * gnu-nat.c (inf_update_procs, proc_get_state, proc_string):
+ Move prototypes from here.
+ * gnu-nat.h: To here.
+
+2000-01-24 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (get_field, put_field): Fix buffer underruns and
+ overruns. Also, handle case where total_len is not evenly
+ divisible by 8.
+ (getfield): Make sure zeroing of unwanted bits occurs even
+ when bit field to extract does not straddle two or more
+ bytes.
+
+2000-01-23 Christopher Faylor <cgf@cygnus.com>
+
+ * defs.h: Add gdb_thread_select declaration.
+
+2000-01-23 Kevin Buettner <kevinb@redhat.com>
+
+ * linux-thread.c (_initialize_linuxthreads): Make sure that
+ linuxthreads_block_mask does not block SIGCHLD.
+
+2000-01-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/devsw.c (openLogFile): On cygwin, set the log mode to
+ text so that new lines work properly.
+
+2000-01-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * proc-utils.h: New file. Export functions from proc-*.c.
+
+ * proc_api.c: Rename to:
+ * proc-api.c: New file. Add include of proc-utils.h.
+
+ * proc_events.c: Rename to:
+ * proc-events.c: New file.
+
+ * proc_flags.c: Rename to:
+ * proc-flags.c: New file.
+
+ * proc_why.c: Rename to:
+ * proc-why.c: New file. Add include of proc-utils.h.
+
+ * procfs.c: Add includes of gdbthread.h, sys/wait.h, signal.h,
+ ctype.h, proc-utils.h.
+ (find_procinfo_or_die): Add braces to avoid ambiguous else clause.
+ (open_procinfo_files): Conditionalize local variable tmp, to avoid
+ compiler warnings.
+ (proc_iterate_over_mappings): Conditionalize local vars mapfd and
+ pathname.
+ (procfs_wait): Adjust format in some printf_filetered calls to
+ avoid compiler warnings.
+ (make_signal_thread_runnable): Ifdef 0. The calls to this function
+ are also ifdef'd 0 .
+ (procfs_resume): Add parentheses around '&&' operation.
+ (procfs_set_exec_trap): Remove unused variable.
+ (info_proc_cmd): Add braces to avoid ambiguous else clause.
+
+ * Makefile.in (procfs.o, proc-api.o, proc-events.o, proc-flags.o,
+ proc-why.o): Update dependencies.
+
+ * config/sparc/sun4sol2.mh (NATDEPFILES): Change proc_*.o files to
+ proc-*.o.
+
+2000-01-17 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * configure.in (NEW_PROC_API): Fix Unixware-matching regexp.
+ Fix from Robert Lipe <robertl@sco.com>.
+ * configure: Regenerated.
+
+2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Break up into the frame info
+ (location) printing part and the rest (source line printing).
+ (print_frame): New function. Take care of printing the location
+ information.
+ Update copyright.
+
+ * infrun.c (normal_stop): Use enum values rather than integers for the
+ source_flag to be passed to show_and_print_stack_frame().
+ Update copyright.
+
+ * frame.h (print_what): New enum for 'source' argument to
+ print_frame_info_base(). Use this instead of obscure numbers.
+ Update copyright.
+
+Sun Jan 16 17:58:00 2000 David Taylor <taylor@texas.cygnus.com>
+
+ * event-top.c (stdin_event_handler): call quit_command rather than
+ exit -- run cleanups, give target code a chance to say goodbye to
+ the target. Fixes bug where the inferior processes were left
+ around on Solaris (and probably elsewhere) by the testsuite.
+
+2000-01-14 Mark Salter <msalter@cygnus.com>
+
+ * v850-tdep.c (v850_target_architecture_hook): Setup correct
+ machine id for disassembly.
+
+2000-01-13 Jim Blandy <jimb@cygnus.com>
+
+ * i386-linux-nat.c (fill_gregset): Pass the correct arguments to
+ convert_to_regset, when regno indicates a specific register.
+
+Thu Jan 13 23:34:17 EST 2000 Nicholas Duffek <nsd@cygnus.com>
+
+ * uw-thread.c: Document libthread.so debugging interface. Minor
+ comment and formatting tweaks.
+ (DEBUG): #define as 0 instead of 1.
+ (CALL_BASE): Include function name in error msg.
+ (libthread_stub): Adjust inferior_pid after thread exit.
+ (uw_thread_create_inferior): Deactivate uw_thread_ops before
+ asking procfs_ops to create inferior.
+ (libthread_init): Don't return nonlocally on error.
+
+2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/ardi.c (negotiate_params): Fix initialization of static
+ variable.
+
+2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote-rdi.c (arm_rdi_open): Call arm-rdi-close() to make sure
+ both sides are on the same state.
+
+2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/serdrv.c (find_baud_rate): Fix entries for 57600 and
+ 115200 (minor syntax mistake).
+
+2000-01-12 Jim Blandy <jimb@cygnus.com>
+
+ * config/sparc/tm-sun4sol2.h (MERGEPID): Provide a definition for
+ this here, to go along with the definitions of PIDGET and TIDGET.
+
+2000-01-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * thread.c (do_captured_thread_select): New function. Switch
+ current thread, safely from within catch_errors().
+ (gdb_thread_select): New function. Switch threads safely.
+ (thread_command): Use gdb_thread_select().
+ Include ui-out.h.
+ (do_captured_list_thread_ids): New function.
+ (gdb_list_thread_ids): New function.
+
+ * defs.h (gdb_thread_select, gdb_list_thread_ids): Export.
+
+2000-01-11 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Avoid linking -limagehlp unless it's a native build.
+ * configure: Regenerate.
+ * thread.cc (add_thread): Clear private data pointer here or suffer
+ strange behavior when it is checked for NULL later.
+
+2000-01-09 Christopher Faylor <cgf@cygnus.com>
+
+ * win32nat.c (handle_exceptions): Handle various arithmetic exceptions.
+ * configure.in: Add an additional library to cygwin link.
+ * configure: Regenerate.
+
+ Patch from Egor Duda <deo@logos-m.ru>:
+ * coffread.c (coff_symfile_read): Reinstate ability to recognize "pe"
+ type.
+
+2000-01-07 Michael Snyder <msnyder@cygnus.com>
+
+ * uw-thread.c: New file to support UnixWare user-mode threads:
+ contributed by Nickolas Duffek <nsd@cygnus.com>.
+ * target.h (struct target_ops): New vector, to_extra_thread_info,
+ allows back-ends to give extra details in info thread display.
+ (target_extra_thread_info): define new macro.
+ (target_find_new_threads): simplify macro. Cleanup comments.
+ * target.c (to_extra_thread_info): default and inherit new vector.
+ (cleanup_target): eliminate PARAMS, break up long lines,
+ provide default definition for to_extra_thread_info, and
+ to_find_new_threads. Default to_thread_alive and to_query
+ to return_zero, not target_ignore (they each return int not void).
+ (debug_to_find_new_threads): new debug entry.
+ (setup_target_debug): add debug_to_find_new_threads.
+ * gdbthread.h: export struct thread_info, find_thread_pid, and
+ iterate_over_threads. Add comments. Eliminate PARAMS. Update
+ copyright. Add new private data pointer for use by target back-ends.
+ * thread.c (struct thread_info): move definition to gdbthread.h.
+ (find_thread_pid): new exported function for thread lookup.
+ (iterate_over_threads): new exported function for applying
+ arbitrary operations to threads. Update copyright to 2000.
+ (info_threads_command): use new target_extra_thread_info vector
+ to display extra information about each thread (if implemented).
+ * config/i386/tm-i386v42mp.h: remove obsolete #defines for procfs.
+ Add defines for PIDGET, etc.
+ * config/i386/tm-i386sol2.h: ditto.
+ * config/sparc/tm-sun4sol2.h: ditto.
+ * config/i386/i386v42mp.mh: add uw-thread.o to NATDEPFILES.
+ * testsuite/gdb.threads/pthreads.exp: Try to link with -lthread
+ if -lpthread and -lpthreads fail.
+
+ * procfs.c: (PIDGET, TIDGET, MERGEPID): change default to no-op.
+ (proc_flags): combine flags that UnixWare splits into two locations.
+ (proc_modify_flag): add support for PR_KLC (kill on last close).
+ (proc_[un]set_kill_on_last_close): new functions.
+
+2000-01-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (normal_stop): Print out thread id when we stop.
+
+2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * remote.c (remote_open_1): Fix message so it does not imply a
+ specific syntax for serial ports, as it is OS dependent.
+ (remote_async_open_1): Ibid.
+ (init_remote_ops): Ibid.
+
+2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/serdrv.c (SerialOpen): Use speed from "-b" argument or
+ "set remotebaud" command (if set) when no speed is specified on
+ the "target rdi" command.
+
+2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/serdrv.c (find_baud_rate): Add entries for 57600 and
+ 115200.
+ (baud_options[]): Ibid.
+
+2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/unixcomm.c: Fix SERIAL_PREFIX so it matches the prefix
+ used by each operating system.
+
+2000-01-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (until_break_command): Add an argument for the
+ continuation, the beginning of the cleanups set up by this
+ command.
+ (until_break_command_continuation): Do cleanups until the one
+ passed in as argument instead of doing all of them.
+
+ * infcmd.c (finish_command_continuation): Expect a new argument,
+ which indicates up to where to do cleanups. Update calls to
+ do_exec_cleanups to use this marker, instead of ALL_CLEANUPS.
+ (finish_command): Add another argument for the continuation: the
+ starting cleanup for this command.
+
+2000-01-05 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From Grant Edwards <grante@visi.com> (original patch from Thomas
+ Zenker ):
+ * rdi-share/ardi.c: Allow interruption of interruptible
+ targets with a <CNTL-C>.
+
+2000-01-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/etherdrv.c (fetch_ports): Send extra words on request
+ to control port to accommodate some versions of Angel.
+
+2000-01-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/devsw.c (dumpPacket): Fix source of channel information.
+ Add interpretation for C Support Library packets.
+
+2000-01-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * rdi-share/devsw.c (DevSW_Close): Remove const from argument that
+ is now being modified.
+ * rdi-share/devsw.h: Adjust declaration of the above funtion.
+
+For older changes see ChangeLog-1999
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-2001 b/contrib/gdb/gdb/ChangeLog-2001
new file mode 100644
index 0000000..ccd64de
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-2001
@@ -0,0 +1,9895 @@
+2001-12-30 Michael Snyder <msnyder@redhat.com>
+
+ * sparc-tdep.c (sparc-store-return-value): Whitespace fix-up.
+
+2001-12-29 Elena Zannoni <ezannoni@redhat.com>
+
+ * Makefile.in (rs6000-tdep.o): Add dependency on parser-defs.h.
+
+ * rs6000-tdep.c: Include parser-defs.h.
+ (rs6000_register_virtual_type): Rewrite, including handling of
+ AltiVec regs type.
+ (altivec_register_p): New function.
+ (rs6000_do_altivec_registers): New function.
+ (rs6000_altivec_registers_info): New function.
+ (rs6000_do_registers_info): New function.
+ (R16): Define.
+ (PPC_ALTIVEC_REGS): Define.
+ (registers_powerpc): Add AltiVec registers.
+ (registers_7400): Define.
+ (variants): Add 7400 machine.
+ (rs6000_gdbarch_init): Set the numbers of AltiVec registers.
+ Initialize gdbarch_do)_registers_info.
+ (rs6000_info_power_command): New function.
+ (info_power_cmdlist): New static variable.
+ (_initialize_rs6000_tdep): Add new 'info powerpc altivec' command.
+
+ * ppc-tdep.h (struct gdbarch_tdep): Add altivec regnum fields.
+ (altivec_register_p): Export.
+
+2001-12-29 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-nat.c (reg_offset): Fix typo.
+
+ * i386-tdep.c (i386_push_dummy_frame): Don't write back the
+ modified frame pointer until the old frame pointer has been saved.
+
+2001-12-30 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (initialize_current_architecture): Test byte_order
+ against BFD_ENDIAN_UNKNOWN.
+ (gdbarch_info_init): Initialize byte_order to BFD_ENDIAN_UNKNOWN.
+ * gdbarch.sh: Update comments on default value of byte_order.
+ (verify_gdbarch, gdbarch_update_p): Test byte_order against
+ BFD_ENDIAN_UNKNOWN.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2001-12-27 Michael Snyder <msnyder@redhat.com>
+
+ * i386-linux-nat.c: Include i386-tdep.h.
+
+ * maint.c (match_substring): GNU coding standards fixes.
+ (print_bfd_section_info): Ditto.
+ (print_objfile_section_info): Ditto.
+
+2001-12-27 Mark Kettenis <kettenis@gnu.org>
+
+ * maint.c (match_substring): Make parameters `string' and `substr'
+ const. Make local variable `tok' const.
+
+2001-12-27 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (FP7_REGNUM, FIRST_FPU_CTRL_REGNUM,
+ FCTRL_REGNUM, FPC_REGNUM, FSTAT_REGNUM, FTAG_REGNUM, FCS_REGNUM,
+ FCOFF_REGNUM, FDS_REGNUM, FDOFF_REGNUM, FOP_REGNUM,
+ LAST_FPU_CTRL_REGNUM, XMM0_REGNUM, XMM7_REGNUM, MXCSR_REGNUM,
+ IS_FP_REGNUM, IS_SSE_REGNUM): Removed.
+ (FP0_REGNUM): Define conditionally depending on HAVE_I387_REGS.
+ (SIZEOF_FPU_CTRL_REGS): Hardcode value.
+ * i386-tdep.h (struct gdbarch_tdep): Change such that it contains
+ a single member `num_xmm_regs'.
+ (FPC_REGNUM): New macro.
+ (FIRST_FPU_REGNUM, LAST_FPU_REGNUM, FISRT_XMM_REGNUM,
+ LAST_XMM_REGNUM, MXCSR_REGNUM, FIRST_FPU_CTRL_REGNUM,
+ LAST_FPU_CTRL_REGNUM): Removed.
+ (FCTRL_REGNUM, FSTAT_REGNUM, FTAG_REGNUM, FOP_REGNUM, XMM0_REGNUM,
+ MXCSR_REGNUM): Define unconditionally. Change macros to match the
+ comment describing the register layout.
+ (FISEG_REGNUM, FIOFF_REGNUM, FOSEG_REGNUM, FOOFF_REGNUM): New macros.
+ (FP_REGNUM_P, FPC_REGNUM_P, SSE_REGNUM_P): New macros.
+ (IS_FP_REGNUM, IS_FPU_CTRL_REGNUM, IS_SSE_REGNUM): Make obsolete,
+ unconditionally define in terms of FP_REGNUM_P, FPC_REGNUM_P and
+ SSE_REGNUM_P).
+ (FCS_REGNUM, FCOFF_REGNUM, FDS_REGNUM, FDOFF_REGNUM): Make
+ obsolete, unconditionally define in terms of FISEG_REGNUM,
+ FIOFF_REGNUM, FOSEG_REGNUM, FOOFF_REGNUM.
+ * i386-tdep.c (i386_gdbarch_init): Initialize `num_xmm_regs'
+ member of `struct gdbarch_tdep'.
+ * x86-64-tdep.c (i386_gdbarch_init): Change initialization of
+ `struct gdbarch_tdep'.
+ * i387-nat.c (FCS_REGNUM, FCOFF_REGNUM, FDS_REGNUM, FDOFF_REGNUM):
+ Replace with FISEG_REGNUM, FIOFF_REGNUM, FOSEG_REGNUM and
+ FOOFF_REGNUM. Use FPC_REGNUM instead of FIRST_FPU_CTRL_REGNUM.
+ Use XMM0_REGNUM instead of LAST_FPU_CTRL_REGNUM.
+
+2001-12-25 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-script.c (execute_control_command): Replace value_ptr
+ with a struct value pointer.
+ * ch-lang.c (evaluate_subexp_chill): Ditto.
+ * printcmd.c (printf_command): Ditto.
+ * tracepoint.c (set_traceframe_context): Ditto.
+ (encode_actions): Ditto.
+ * eval.c (evaluate_subexp_standard): Ditto.
+
+2001-12-25 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: When an int variable, print value using %d instead
+ of %ld.
+ * gdbarch.c: Re-generate.
+
+2001-12-24 Tom Rix <trix@redhat.com>
+
+ * config/powerpc/aix.mt (TDEPFILES): Add xcoffread.o to fix a build
+ failure.
+
+2001-12-21 Michael Snyder <msnyder@redhat.com>
+
+ * procfs.c (info_proc_cmd): Add the 'mappings' sub-command that
+ was dropped a few years ago, when procfs.c was rewritten.
+ (info_proc_mappings): New function, implement 'info proc mappings'.
+ (mappingflags): New function.
+ (_initialize_procfs): Document new option to 'info proc' command.
+
+2001-12-21 Tom Tromey <tromey@redhat.com>
+
+ * configure, config.in: Rebuilt.
+ * configure.in: Check for realpath.
+ * defs.h (gdb_realpath): Declare.
+ * symtab.h (partial_symtab): Added fullname field.
+ * source.c (openp): Use gdb_realpath.
+ (forget_cached_source_info): Clear full name of each partial
+ symtab.
+ * utils.c (gdb_realpath): New function.
+ * symtab.c (lookup_symtab): Removed.
+ (lookup_symtab_1): Renamed to lookup_symtab.
+ (lookup_symtab): Look for real path.
+ (lookup_partial_symtab): Likewise.
+
+2001-12-21 Michael Snyder <msnyder@redhat.com>
+
+ * maint.c (match_substring): New function. Tokenizer for
+ maint info sections command arguments.
+ (match_bfd_flag): Use match_substring.
+ (print_bfd_section_info): Use match_substring.
+ (print_objfile_section_info): Use match_substring.
+ (maintenance_info_sections): Use match_substring.
+
+2001-12-21 Orjan Friberg <orjanf@axis.com>
+
+ * configure.tgt: Delete CRIS from multi-arch targets.
+
+ * config/cris/tm-cris.h: New file.
+
+ * config/cris/cris.mt (TDEPFILES): Add corelow.o solib.o solib-svr4.o.
+ (TM_FILE): New macro.
+
+ * cris-tdep.c (cris_examine): Correct check for srp register.
+ (supply_gregset, fetch_core_registers,
+ cris_linux_svr4_fetch_link_map_offsets, cris_fpless_backtrace):
+ New functions.
+ (_initialize_cris_tdep): Add core functions and new command.
+ (cris_gdbarch_init): Define link map offsets.
+
+Thu Dec 20 16:42:30 2001 Jeffrey A Law (law@cygnus.com)
+
+ * somsolib.c (som_solib_add): Ignore the solib limit threshhold
+ if AUTO_SOLIB_LIMIT is not greater than zero.
+
+ * somsolib.c (som_solib_create_inferior_hook): No longer warn
+ about missing __d_pid symbol.
+
+2001-12-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-linux-nat.c (ppc_ptrace_cannot_fetch_store_register):
+ New function.
+ (fetch_register): New function.
+ (fetch_ppc_registers): New function.
+ (fetch_inferior_registers): New function.
+ (store_register): New function.
+ (store_ppc_registers): New function.
+ (store_inferior_registers): New function.
+ (ppc_register_u_addr): Eliminate ustart parameter and its
+ uses. Make static.
+ (PT_READ_U, PT_WRITE_U, PTRACE_XFER_TYPE): Define if needed.
+ Include sys/ptrace.h.
+
+ * config/powerpc/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
+ (U_REGS_OFFSET, REGISTER_U_ADDR): Delete.
+
+ * config/powerpc/linux.mh (NATDEPFILES): Delete core-aout.o.
+
+2001-12-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-nat.c (fetch_register): Don't error out unless the
+ register number is really bogus.
+
+2001-12-20 Michael Snyder <msnyder@redhat.com>
+
+ * maint.c (maintenance_info_sections): Accept new argument
+ 'ALLOBJ', iterate over all object files.
+ (print_section_table): Delete. Replaced by:
+ (print_section_info): New function.
+ (print_bfd_section_info): New function.
+ (print_objfile_section_info): New function.
+ (_initialize_maint_commands): Add help for new features.
+
+2001-12-20 Kevin Buettner <kevinb@redhat.com>
+
+ * arm-tdep.c (arm_init_extra_frame_info): Add special case for
+ call dummies.
+ (arm_frame_saved_pc): Likewise.
+ (arm_push_dummy_frame): Make sure all of the GPRs are saved.
+ (arm_pop_frame): Eliminate special case for call dummies. It
+ is no longer needed now that the frame info is being properly
+ initialized.
+
+ * arm-tdep.c (arm_scan_prologue): Don't require "mov ip, sp"
+ to be the first instruction in the prologue. Also, revise
+ the way the frame offset is computed for frameless functions.
+
+2001-12-20 Michael Snyder <msnyder@redhat.com>
+
+ * maint.c (maintenance_info_sections): Pass string argument to
+ print_section_table, so that it can be used to select sections.
+ (print_section_table): Change PTR to void *. Look at string arg
+ to select sections by name and by flag attributes.
+ (match_bfd_flags): New function.
+ (print_bfd_flags): New function.
+
+Thu Dec 20 11:37:50 2001 Jeffrey A Law (law@redhat.com)
+
+ * cli/cli-decode.c (add_cmd): Initialize pre_show_hook in
+ the new command.
+
+2001-12-20 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (struct packet_reg): Add field in_g_packet.
+ (struct remote_state): Rename field g_packet to regs;
+ (free_remote_state): Update.
+ (init_remote_state): Add pseudo-registers to table. Initialize
+ in_g_packet. Drop sentinal from table.
+ (packet_reg_from_regnum, packet_reg_from_pnum): Update.
+ (remote_fetch_registers): Handle registers not in the g-packet.
+ (remote_store_registers): Ditto.
+
+2001-12-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (TARGET_CHAR_SIGNED): Do not specify the print
+ format.
+
+2001-12-19 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_pop_frame_regular): Make sure the saved_regs
+ array is actually set before we try to use it.
+
+ * s390-tdep.c (s390_frame_saved_pc_nofix): If we get the saved PC
+ out of the return address register, cache that in the frame's
+ extra info, just as if we'd gotten it from the saved regs array;
+ that way, it's not a lie to set the saved_pc_valid flag.
+
+ * s390-tdep.c (s390_get_frame_info): Give orig_sp a reasonable
+ value, even when fextra_info->stack_bought can't be trusted,
+
+ * s390-tdep.c (s390_readinstruction): Don't call
+ info->read_memory_func to read zero bytes. Some targets'
+ xfer_memory functions can't cope with that.
+
+ * gdbarch.sh (TARGET_CHAR_SIGNED): New macro.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * gdbtypes.c (build_gdbtypes): If TARGET_CHAR_SIGNED is zero,
+ set the TYPE_FLAG_UNSIGNED bit on the type.
+ * s390-tdep.c (s390_gdbarch_init): On the S/390, characters
+ are unsigned by default.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Same for PowerPC and
+ RS6000.
+
+2001-12-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * corefile.c (do_captured_read_memory_integer,
+ safe_read_memory_integer): New functions.
+ * gdbcore.h (safe_read_memory_integer): Export.
+ * arm-tdep.c (arm_scan_prologue): Use safe_read_memory_integer,
+ to read the frame value, to capture calls to error().
+
+2001-12-19 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_register_name): S390_LAST_REGNUM is, in fact,
+ the last register number, not one greater than the last register
+ number.
+
+ * s390-tdep.c (s390_register_virtual_type): Replace clever but
+ incorrect range comparison with correct, legible equivalent.
+
+ * s390-tdep.c (s390_register_raw_size): Replace unnecessarily
+ obscure range comparison with legible equivalent.
+
+Wed Dec 19 12:18:57 2001 Jeffrey A Law (law@redhat.com)
+
+ * config/pa/tm-hppa.h (STORE_RETURN_VALUE): Use hppa_store_return_value.
+ (EXTRACT_RETURN_VALUE): Similarly.
+ * hppa-tdep.c (hppa_store_return_value): New function.
+ (hppa_extract_return_value): New function.
+
+ * infttrace.c (child_acknowledge_created_inferior): Pass
+ correct argument to add_thread.
+ (update_thread_state_after_attach): Likewise.
+
+2001-12-19 Fernando Nasser <fnasser@redhat.com>
+
+ * config/arm/tm-arm.h: Properly define SOFTWARE_SINGLE_STEP_P.
+ Always define SOFTWARE_SINGLE_STEP.
+ * config/arm/tm-embed.h: Properly define SOFTWARE_SINGLE_STEP_P.
+ * arm-tdep.c (arm_get_next_pc, thumb_get_next_pc, bitcount,
+ shifted_reg_val): Always compile these functions.
+ (arm_software_single_step): Fix second argument in function calls.
+
+2001-12-19 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.h (gdbarch_info_init): Declare.
+ * arch-utils.c: Include "arch-utils.h".
+ (gdbarch_info_init): Define.
+ (set_endian, set_architecture, set_gdbarch_from_file)
+ (initialize_current_architecture): Use gdbarch_info_init.
+ * rs6000-nat.c (set_host_arch): Ditto.
+ * cris-tdep.c (cris_version_update, cris_mode_update)
+ (cris_abi_update): Ditto.
+
+2001-12-19 Jim Blandy <jimb@redhat.com>
+
+ * c-lang.c (c_emit_char): Print ASCII 11 as '\v', to match
+ ISO C, and our parser. Print ASCII 0 as '\0', since that's what
+ people are used to seeing.
+
+2001-12-18 Jim Blandy <jimb@redhat.com>
+
+ * c-lang.c (c_printstr, c_builtin_types, cplus_builtin_types):
+ Fix indentation.
+
+ * Makefile.in (c-exp.tab.o): Delete duplicate build rule. Fix
+ dependency list on remaining build rule.
+
+2001-12-18 Martin M. Hunt <hunt@redhat.com>
+
+ * ser-tcp.c (tcp_open): Disable Nagle algorithm which
+ improves performance in some cases.
+
+2001-12-17 Ben Harris <bjh21@netbsd.org>
+
+ * armbsd-nat.c: Remove file, renamed to armnbsd-nat.c.
+ * armnbsd-nat.c: New file, renamed from armbsd-nat.c.
+ * Makefile.in: Rename armbsd-nat.c to armnbsd-nat.c.
+ * config/arm/nbsd.mh: Likewise.
+
+2001-12-17 Corinna Vinschen <vinschen@redhat.com>
+
+ * NEWS: Note new target XStormy16.
+ * MAINTAINERS: Add -Werror to XStormy16.
+
+2001-12-17 Fernando Nasser <fnasser@redhat.com>
+
+ From Richard Earnshaw <rearnsha@arm.com>:
+ * arm-tdep.c (arm_software_single_step): New function. Implements
+ software single-stepping for ARM targets.
+ (arm_get_next_pc, thumb_get_next_pc, bitcount, shifted_reg_val): Only
+ needed for software single-stepping.
+ * config/arm/tm-arm.h: Activate SOFTWARE_SINGLE_STEP_P.
+
+2001-12-17 Fernando Nasser <fnasser@redhat.com>
+
+ From Richard Earnshaw <rearnsha@arm.com>:
+ * config/arm/nbsd.mh, config/arm/nbsd.mt, config/arm/tm-nbsd.h,
+ config/arm/nm-nbsd.h, config/arm/xm-nbsd.h: New files.
+ * armbsd-nat.c: New file.
+ * Makefile.in: Build it.
+ * configure.host, configure.tgt: Support NetBSD/arm.
+
+2001-12-17 Corinna Vinschen <vinschen@redhat.com>
+
+ * MAINTAINERS: Add myself as XStormy16 maintainer.
+
+2001-12-15 Kevin Buettner <kevinb@redhat.com>
+
+ * config/rs6000/tm-rs6000.h (solib.h): Conditionally include.
+
+2001-12-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.c: Re-generate.
+
+2001-12-15 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Remove powerpcle-eabi and rs6000-ibm-aix3.2 from
+ target list.
+
+2001-12-15 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (LITTLE_ENDIAN): Delete definition.
+ * arch-utils.c, cris-tdep.c, d10v-tdep.c, defs.h, gdbarch.c,
+ gdbarch.sh, remote-rdp.c, remote-sim.c, sh-tdep.c, sparc-tdep.c,
+ config/alpha/tm-alpha.h, config/arm/tm-arm.h,
+ config/i386/tm-i386.h, config/i960/tm-i960.h,
+ config/ia64/tm-ia64.h, config/mcore/tm-mcore.h,
+ config/mips/tm-wince.h, config/mn10200/tm-mn10200.h,
+ config/ns32k/tm-umax.h, config/powerpc/tm-ppcle-eabi.h,
+ config/sh/tm-wince.h, config/v850/tm-v850.h, config/vax/tm-vax.h,
+ doc/gdbint.texinfo: Replace LITTLE_ENDIAN with BFD_ENDIAN_LITTLE.
+
+2001-12-15 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.c (struct ui_out_table): Add field entry_level.
+ (verify_field): New function.
+ (verify_field_proper_position): Delete function.
+ (verify_field_alignment): Delete function.
+ (ui_out_field_int): Update to use verify_field.
+ (ui_out_field_skip): Ditto.
+ (ui_out_field_string): Ditto.
+ (ui_out_field_fmt): Ditto.
+ (ui_out_table_begin): Initialize table.entry_level.
+ (ui_out_table_end): Clear table.entry_level.
+ (ui_out_begin): Call verify_field before pushing the new tuple or
+ list onto the stack. Use table.entry_level.
+
+2001-12-14 Corinna Vinschen <vinschen@redhat.com>
+
+ * config/djgpp/fnchange.lst: Add entries for opcodes/xstormy16-* files.
+
+2001-12-13 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (generic_register_virtual_size): Return TYPE_LENGTH
+ of register's type.
+
+2001-12-13 Jackie Smith Cashion <jsmith@redhat.com>
+
+ * cli/cli-script.c (print_command_lines): Remove extra
+ "if", "else", "while", and "end" from show user output.
+
+2001-12-13 Kevin Buettner <kevinb@redhat.com>
+
+ * i387-nat.c (i387_fill_fxsave): Change type of ``val'' from char
+ to short so that we don't memcpy() beyond the end of this buffer.
+ Also, change shift value used in computing val to account for the
+ fact that only eight bits are used.
+
+2001-12-13 Corinna Vinschen <vinschen@redhat.com>
+
+ * Makefile.in: Add support for xstormy16.
+ * configure.tgt: Ditto.
+ * xstormy16-tdep.c: New file.
+ * config/xstormy16/xstormy16.mt: New file.
+
+2001-12-13 Andreas Schwab <schwab@suse.de>
+
+ * MAINTAINERS (write-after-approval): Add myself.
+
+2001-12-12 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (c-exp.tab.o): Add missing dependencies.
+
+ * Makefile.in (c_lang_h): New variable. Use it in dependency
+ lists, instead of `c-lang.h' itself.
+
+2001-12-11 Fred Fish <fnf@redhat.com>
+
+ * c-typeprint.c (c_type_print_base): Use type flags access macros
+ to test bits.
+ * ch-typeprint.c (chill_type_print_base): Ditto.
+ * ch-valprint.c (chill_val_print): Ditto.
+ * d10v-tdep.c (d10v_pointer_to_address): Ditto.
+ * dwarf2read.c (dwarf2_add_member_fn): Ditto.
+ * dwarfread.c (read_structure_scope): Ditto.
+ * gdbtypes.c (create_range_type): Dittol
+ (create_set_type): Ditto.
+ (check_typedef): Ditto.
+ * jv-typeprint.c (java_type_print_base): Ditto.
+ * p-typeprint.c (pascal_type_print_base): Ditto
+ * p-valprint.c (pascal_val_print): Ditto.
+ * stabsread.c (read_cfront_member_functions): Ditto.
+ (read_member_functions): Ditto.
+ (cleanup_undefined_types): Ditto.
+ * valprint.c (val_print): Ditto.
+
+ * valops.c (hand_function_call): Remove is_prototyped
+ variable and just use type flag test macro directly.
+
+2001-12-11 Fred Fish <fnf@redhat.com>
+
+ * gdbtypes.c (print_bound_type): New function.
+ (recursive_dump_type): Print type struct code values
+ TYPE_CODE_BITSTRING, TYPE_CODE_COMPLEX, TYPE_CODE_TEMPLATE,
+ and TYPE_CODE_TEMPLATE_ARG.
+ (recursive_dump_type): Print type struct members
+ upper_bound_type, lower_bound_type, cv_type, and as_type.
+ Also always print the tagname member, even when it is NULL.
+
+2001-12-11 Michael Snyder <msnyder@redhat.com>
+
+ * d10v-tdep.c (d10v_register_virtual_size): Delete.
+ (d10v_gdbarch_init): Use generic_register_virtual_size.
+ * rs6000-tdep.c (rs6000_register_virtual_size): Delete.
+ (rs6000_gdbarch_init): Use generic_register_virtual_size.
+ * x86-64-tdep.c (x86_64_register_virtual_size): Delete.
+ (i386_gdbarch_init): Use generic_register_virtual_size.
+
+2001-12-11 Andrew Cagney <ac131313@redhat.com>
+
+ * values.c: Include "gdb_assert.h".
+ (value_fn_field): Rearange to avoid -Wuninitialized warning.
+
+2001-12-10 Fred Fish <fnf@redhat.com>
+
+ * values.c (value_fn_field): Add physname variable. Use a minimal
+ symbol if we don't find a full symbol. Remove setting of the new
+ value's type since that was already done by allocate_value().
+ Remove obsolete commented out error call since callees need to
+ handle a NULL return, which is possible result not an error.
+ * eval.c (evaluate_subexp_standard): Move check for inlined
+ functions to precede attempt to dereference a NULL argvec[0].
+
+2001-12-10 Fred Fish <fnf@redhat.com>
+
+ * arm-linux-tdep.c (skip_hurd_resolver): Use NULL rather than
+ zero in args to lookup_minimal_symbol.
+ * linespec.c (decode_line_1): Ditto.
+ * i386-linux-tdep.c (skip_hurd_resolver): Ditto.
+ * minsyms.c (find_stab_function_addr): Ditto.
+ * symfile.c (simple_read_overlay_table): Ditto.
+ (simple_read_overlay_region_table): Ditto.
+
+2001-12-10 Michael Snyder <msnyder@redhat.com>
+
+ * arch-utils.c (generic_register_virtual_size): New function.
+ * arch-utils.h: Export generic version of register_virtual_size.
+ * gdbarch.sh (REGISTER_VIRTUAL_SIZE): Use new function as default.
+ * gdbarch.c: Regenerate.
+
+2001-12-09 Fred Fish <fnf@redhat.com>
+
+ * gdbtypes.c (TYPE_FLAG_UNSIGNED, TYPE_FLAG_STUB): Use
+ TYPE_UNSIGNED and TYPE_NOSIGN to determine when to print these
+ rather than testing the bits directly.
+ (TYPE_FLAG_NOSIGN, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC,
+ TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_PROTOTYPED,
+ TYPE_FLAG_INCOMPLETE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE,
+ TYPE_FLAG_VARARGS): Test for and print these bits as well.
+
+2001-12-09 Fred Fish <fnf@redhat.com>
+
+ * gdbtypes.c (build_gdbtypes): For builtin_type_char, pass
+ TYPE_FLAG_NOSIGN to init_type() rather than setting it after the
+ type is created.
+
+2001-12-09 Fred Fish <fnf@redhat.com>
+
+ * gdbtypes.h (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_CONST,
+ TYPE_VOLATILE, TYPE_INCOMPLETE): Move macros that test the
+ bits to location in file where the bits are defined.
+ (TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED,
+ TYPE_CODE_SPACE, TYPE_DATA_SPACE): New test macros.
+
+2001-12-09 Fred Fish <fnf@redhat.com>
+
+ * gdbtypes.c (allocate_stub_method): Replace hand crafted type
+ initialization with call to the init_type() function.
+
+2001-12-09 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (generic_register_raw_size): New function.
+ * gdbarch.sh (REGISTER_RAW_SIZE): Use generic_register_raw_size as
+ the static default.
+ * gdbarch.c: Regenerate.
+ * arch-utils.h (generic_register_raw_size): Declare.
+
+ * config/mips/tm-mips.h (REGISTER_RAW_SIZE): Delete macro.
+ * mips-tdep.c (mips_register_raw_size): Make function static.
+ (mips_gdbarch_init): Initialize register_raw_size.
+
+2001-12-08 Fred Fish <fnf@redhat.com>
+
+ * dwarf2read.c (read_typedef): Replace hand crafted type
+ initialization with a call to the init_type() function, which
+ is how the rest of gdb creates types.
+
+2001-12-09 Fred Fish <fnf@redhat.com>
+
+ * mdebugread.c (cross_ref): Pass TYPE_FLAG_STUB to init_type()
+ rather than setting it after the type is created.
+
+2001-12-09 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/rs6000/tm-rs6000.h (STAB_REG_TO_REGNUM): Remove
+ definition, it is now multiarched.
+ * ppc-tdep.h (struct gdbarch_tdep): Move from rs6000-tdep.c. Add
+ fields for special register numbers.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Initialize new tdep special
+ regnum fields.
+ (rs6000_saved_pc_after_call): Use gdbarch_tdep registers fields
+ instead of hardcoded macros.
+ (branch_dest, rs6000_pop_frame, rs6000_fix_call_dummy,
+ ppc_push_return_address, rs6000_frame_saved_pc,
+ frame_get_saved_regs, rs6000_frame_chain,
+ rs6000_store_return_value): Ditto.
+ (rs6000_stab_reg_to_regnum): New function.
+ * ppcnbsd-nat.c (fetch_inferior_registers,
+ store_inferior_registers, fetch_core_registers): Ditto.
+ * ppc-linux-tdep.c (ppc_linux_in_sigtramp,
+ ppc_linux_frame_init_saved_regs): Ditto.
+ * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset,
+ fill_gregset): Ditto.
+ * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers):
+ Ditto.
+
+2001-12-08 Fred Fish <fnf@redhat.com>
+
+ * c-lang.c (c_create_fundamental_type): For FT_CHAR, pass
+ TYPE_FLAG_NOSIGN to init_type() rather than setting it after the
+ type is created.
+
+2001-12-08 Fred Fish <fnf@redhat.com>
+
+ * dwarf2read.c (TYPE_FLAG_VARARGS): Remove from here.
+ * gdbtypes.h (TYPE_FLAG_VARARGS): Add here and change value to
+ not collide with other flag bits.
+
+2001-12-08 Fred Fish <fnf@redhat.com>
+
+ * dwarf2read.c (read_base_type): Rename is_unsigned to type_flags.
+ For unsigned types set TYPE_FLAG_UNSIGNED and pass it to
+ init_type().
+
+2001-12-08 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (cp-valprint.o): Add dependency on $(cp_abi_h).
+
+2001-12-08 Jim Blandy <jimb@redhat.com>
+
+ * config/s390/s390.mh: Don't use the linux-thread.o module;
+ thread-db.o, lin-lwp.o, and proc-service.o should work just fine.
+
+2001-12-07 Andrew Cagney <ac131313@redhat.com>
+
+ * PROBLEMS: New file.
+ * README: Move known problems to PROBLEMS file.
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * stabsread.c (read_member_functions): Skip member functions which
+ are duplicates of the callable constructor/destructor.
+
+2001-12-07 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_store_return_value): Don't convert float
+ values to double format when returning them; just return them in
+ the first half of the FP register, as the ABI specifies.
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * valops.c (hand_function_call): Check for method arguments in
+ TYPE_ARG_TYPES(), not in TYPE_FIELD ().
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * cp-valprint.c (cp_print_value): Preserve offset if
+ the virtual base is outside of this object.
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.c (finish_cv_type): New function.
+ (check_typedef): Remove ``register'' keyword from argument.
+ Preserve const and volatile attributes across filling in
+ opaque types.
+ * gdbtypes.h (finish_cv_type): Add prototype.
+
+ * hp-symtab-read.c (hpread_read_struct_type): Call finish_cv_type.
+ * stabsread.c (read_struct_type): Likewise.
+ * dwarf2read.c (read_structure_scope): Likewise. Remove redundant
+ assignment to die->type.
+
+2001-12-07 Jim Blandy <jimb@redhat.com>
+
+ * printcmd.c (print_scalar_formatted): Compare the length of the
+ value against the lengths of the target's floating-point types,
+ not the host's. Add support for `long double'.
+
+2001-12-07 Martin M. Hunt <hunt@redhat.com>
+
+ * configure.in: Check for sys/filio.h
+ * configure: Rebuild.
+ * config.in: Add HAVE_SYS_FILIO_H
+ * ser-tcp.c: Conditionally include sys/filio.h.
+
+2001-12-07 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.c (ui_out_table_begin): Initialize body_flag.
+ (struct ui_out_table): New structure. Move table fields to here.
+ Rename headercurr to headernext.
+ (struct ui_out): Remove table specific fields. Add field table.
+ (ui_out_table_begin, ui_out_table_body, ui_out_table_end): Update.
+ (ui_out_table_header, ui_out_begin): Update.
+ (verify_field_proper_position, verify_field_alignment): Update.
+ (ui_out_new, clear_header_list, append_header_to_list): Update.
+ (get_next_header): Rename get_curr_header. Update comments and
+ code.
+
+2001-12-06 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (XCALLOC): Delete macro that should not have been
+ added.
+
+2001-12-07 Jiri Smid <smid@suse.cz>
+
+ * dwarf2cfi.c: New file.
+ * dwarf2cfi.h: New file.
+ * dwarf2read.c (dwarf_frame_offset, dwarf_frame_size): New variables.
+ (dwarf_eh_frame_offset, dwarf_eh_frame_size): New variables.
+ (dwarf2_read_section): Change to non static.
+ (dwarf2_locate_sections): Add .debug_frame and .eh_frame section
+ recognition.
+ (FRAME_SECTION, EH_FRAME_SECTION): New define.
+ * elfread.c (elf_symfile_read): Add call of frame informations build.
+ * frame.h (frame_info): Add pointer to unwind_context.
+ * symfile.h (dwarf2_build_frame_info): Add declaration.
+ * gdbarch.sh (DWARF2_BUILD_FRAME_INFO): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * Makefile.in: Add dwarf2cfi_h, dwarf2cfi.o
+ * x86-64-tdep.c (i386_gdbarch_init): Initialize target vector to
+ use debug frame info.
+
+2001-12-06 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h: Do not include "mmalloc.h".
+ (mcalloc, mmalloc, mrealloc, mfree): Delete declaration.
+ * objfiles.c: Include "mmalloc.h".
+ * utils.c: Include "mmalloc.h".
+ (mmalloc, mfree, mrealloc, mmalloc): Make static, change PTR to
+ void pointer.
+
+2001-12-06 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (store_register, fetch_register): Only use
+ fetch/store pseudo-register when function is present. Assume
+ target can handle all registers.
+ (registers_changed): Simplify invalidate loop.
+ (registers_fetched): Add comments.
+ (register_buffer): Add regnum range assertion. Remove code
+ handling -ve regnum.
+ (build_regcache): Make space for pseudo-registers when computing
+ sizeof_registers. Initialize register_offset.
+
+ * gdbarch.sh (FETCH_PSEUDO_REGISTER): Change to a function with
+ predicate.
+ (STORE_PSEUDO_REGISTER): Ditto.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2001-12-06 Jim Blandy <jimb@redhat.com>
+
+ * config/s390/nm-linux.h: Watchpoints are either continuable or
+ steppable, not both. The S/390 has continuable watchpoints, so
+ delete the #definition of HAVE_STEPPABLE_WATCHPOINT.
+
+2001-12-04 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * go32-nat.c (go32_fetch_registers): Remove call to register_buffer
+ (which is now a static function in regcache.c)
+ and use regcache_collect instead.
+
+2001-12-05 Andrew Cagney <cagney@redhat.com>
+
+ * target.c (cleanup_target): Do not initialize to_query to
+ return_zero.
+
+2001-12-05 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_get_frame_info): Recognize argument register
+ spills that use the `stm' instruction.
+ (is_arg_reg): New function.
+
+2001-12-03 Keith Walker <keith.walker@arm.com>
+
+ * gdbserver/low-linux.c (arm_register_u_addr): Added.
+ (initialize_arch): Added for ARM target.
+ * config/arm/nm-linux.h (U_REGS_OFFSET): Defined.
+ (REGISTER_U_ADDR): Defined.
+ * config/arm/tm-linux.h (ARM_GNULINUX_TARGET): Defined.
+
+2001-12-04 Corinna Vinschen <vinschen@redhat.com>
+
+ * arm-tdep.c (arm_skip_prologue): Always skip prologue by scanning
+ the prologue if source is assembler.
+
+2001-12-04 Jackie Smith Cashion <jsmith@redhat.com>
+
+ * MAINTAINERS (write-after-approval): Add self.
+
+ * d10v-tdep.c (d10v_gdbarch_init): Change size of long long to 8 bytes.
+
+ From Andrew Cagney <cagney@redhat.com>:
+ * d10v-tdep.c (d10v_frame_chain_valid): Check if the caller's PC
+ is in the entry function.
+ (d10v_use_struct_convention): Store multi-field struct and union
+ return values on the stack.
+
+2001-12-04 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_get_frame_info): Recognize spills of reg
+ arguments into their stack slots.
+
+ * s390-tdep.c (s390_get_frame_info): More doc fixes.
+
+ * s390-tdep.c (s390_get_frame_info): Doc fixes.
+
+2001-12-04 Orjan Friberg <orjanf@axis.com>
+
+ * cris-tdep.c (cris_regnums): Add DCCR_REGNUM for completeness.
+ (cris_examine): Add comment about solib prologue parsing.
+ (bdap_prefix): Read offset with correct signedness and size.
+ (move_to_preg_op): Don't rely on register numbering for register size.
+ (none_reg_mode_move_from_preg_op): Ditto.
+
+2001-12-04 Orjan Friberg <orjanf@axis.com>
+
+ * solib.c (solib_open): Make path relative if search for absolute path
+ failed. If search for relative path in solib_search_path failed, fall
+ back to search for basename only.
+
+2001-12-03 Martin M. Hunt <hunt@redhat.com>
+
+ * serial.h: Add a note to serial_open.
+
+ * ser-tcp.c (tcp_open): Rewrite to use a non-blocking connect.
+ Allow UI and CLI to abort connect. Instead of trying 15 times
+ with very long timeouts, just try one connect with a maximum timeout
+ of 15 seconds.
+
+2001-12-03 Kevin Buettner <kevinb@redhat.com>
+
+ * config/powerpc/tm-macos.h (solib.h): Include.
+ * config/powerpc/tm-ppc-eabi.h (solib.h): Include.
+
+2001-12-03 Michael Snyder <msnyder@redhat.com>
+
+ * symtab.c (search_symbols): Make sure alloca size is big enough.
+
+2001-12-03 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Prune m68k targets down to just m68k-elf.
+
+2001-12-03 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_get_frame_info): Don't used fextra_info to set
+ orig_sp if it's not initialized.
+
+2001-11-30 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * findvar.c (locate_var_value): Specify in which register a register
+ variable is stored.
+
+2001-11-30 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * win32-nat.c (mappings): Correct position of XMM registers,
+ based on FXSAVE instruction structure.
+
+2001-12-02 Andrew Cagney <ac131313@redhat.com>
+
+ * jv-lang.c (get_java_class_symtab): Use xmmalloc instead of
+ mmalloc.
+
+ * coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c, hpread.c,
+ nlmread.c, objfiles.c, os9kread.c, somread.c, source.c, symfile.c,
+ symmisc.c, xcoffread.c: Use xmfree instead of mfree.
+
+ * jv-lang.c (add_class_symtab_symbol): Use xmrealloc instead of
+ mrealloc.
+
+2001-12-02 Andrew Cagney <ac131313@redhat.com>
+
+ * i386-tdep.c (i386go32_frame_saved_pc): New function.
+ * config/i386/tm-go32.h (i386go32_frame_saved_pc): Declare.
+ (FRAME_SAVED_PC): Redefine to i386go32_frame_saved_pc.
+
+2001-12-01 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h: Update comment on HOST_BYTE_ORDER.
+ * config/xm-aix4.h: Delete definition of HOST_BYTE_ORDER.
+ * config/xm-nbsd.h, config/alpha/xm-alphalinux.h: Ditto.
+ * config/alpha/xm-alphaosf.h, config/alpha/xm-fbsd.h: Ditto.
+ * config/arm/xm-linux.h, config/i386/xm-cygwin.h: Ditto.
+ * config/i386/xm-i386bsd.h, config/i386/xm-i386gnu.h: Ditto.
+ * config/i386/xm-i386lynx.h, config/i386/xm-i386m3.h: Ditto.
+ * config/i386/xm-i386mach.h, config/i386/xm-i386v.h: Ditto.
+ * config/i386/xm-ptx.h, config/i386/xm-symmetry.h: Ditto.
+ * config/ia64/xm-aix.h, config/ia64/xm-linux.h: Ditto.
+ * config/m68k/xm-3b1.h, config/m68k/xm-apollo68b.h: Ditto.
+ * config/m68k/xm-apollo68v.h, config/m68k/xm-delta68.h: Ditto.
+ * config/m68k/xm-dpx2.h, config/m68k/xm-hp300bsd.h: Ditto.
+ * config/m68k/xm-hp300hpux.h, config/m68k/xm-m68k.h: Ditto.
+ * config/m68k/xm-m68klynx.h, config/m68k/xm-sun2.h: Ditto.
+ * config/m68k/xm-sun3.h, config/m88k/xm-dgux.h: Ditto.
+ * config/m88k/xm-m88k.h, config/mips/xm-irix3.h: Ditto.
+ * config/mips/xm-irix5.h, config/mips/xm-linux.h: Ditto.
+ * config/mips/xm-mips.h, config/mips/xm-mipsm3.h: Ditto.
+ * config/mips/xm-mipsv4.h, config/mips/xm-news-mips.h: Ditto.
+ * config/mips/xm-riscos.h, config/pa/xm-hppab.h: Ditto.
+ * config/pa/xm-hppah.h, config/powerpc/xm-linux.h: Ditto.
+ * config/romp/xm-rtbsd.h, config/rs6000/xm-rs6000.h: Ditto.
+ * config/rs6000/xm-rs6000ly.h, config/s390/xm-linux.h: Ditto.
+ * config/sparc/xm-sparc.h, config/sparc/xm-sparclynx.h: Ditto.
+ * config/vax/xm-vax.h: Ditto.
+
+ * config/a29k/tm-vx29k.h: Add #error as file depends on
+ HOST_BYTE_ORDER.
+ * config/a29k/tm-a29k.h: Ditto.
+ * MAINTAINERS (a29k-amd-udi): Document as broken.
+
+2001-12-01 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (tm-news.h, tm-isi.h, xm-news1000.h): Delete.
+ (ALLDEPFILES): Delete news-xdep.c.
+ (news-xdep.o): Delete.
+ (isi-xdep.o): Delete.
+ * configure.tgt: Delete m68*-isi-*, m68*-sony-*, m68*-rom68k-*,
+ m68*-*bug-*, m68*-monitor-* and m68*-est-* targets.
+ * configure.host: Delete m68030-sony-*, m68*-isi-* and m68*-sony-*
+ Hosts.
+ * m68k-tdep.c (isi_skip_prologue): Delete function.
+ * news-xdep.c: Delete file.
+ * isi-xdep.c: Delete file.
+ * config/m68k/isi.mh: Delete file.
+ * config/m68k/isi.mt: Delete file.
+ * config/m68k/news.mh: Delete file.
+ * config/m68k/news.mt: Delete file.
+ * config/m68k/news1000.mh: Delete file.
+ * config/m68k/nm-news.h: Delete file.
+ * config/m68k/tm-isi.h: Delete file.
+ * config/m68k/tm-news.h: Delete file.
+ * config/m68k/xm-isi.h: Delete file.
+ * config/m68k/xm-news.h: Delete file.
+ * config/m68k/xm-news1000.h: Delete file.
+
+ * kdb-start.c: Delete file.
+ * stuff.c: Delete file.
+
+ * NEWS: Note that a29k-nyu-sym1 and a29k-*-kern* were deleted.
+ * configure.host: Delete a29k-*-* host.
+ * configure.tgt: Delete a29k-*-kern* and a29k-*-sym1* targets.
+ * config/a29k/a29k-kern.mt: Delete file.
+ * config/a29k/nm-ultra3.h: Delete file.
+ * config/a29k/tm-ultra3.h: Delete file.
+ * config/a29k/ultra3.mh: Delete file.
+ * config/a29k/ultra3.mt: Delete file.
+ * config/a29k/xm-ultra3.h: Delete file.
+
+ * NEWS: Note that i[3456]86-*-sunos* was deleted.
+ * Makefile.in (sun386-nat.o): Delete.
+ * configure.tgt: Delete i[3456]86-*-sunos* target.
+ * configure.host: Delete i[3456]86-*-sunos* host.
+ * sun386-nat.c: Delete.file.
+ * config/i386/nm-sun386.h: Delete file.
+ * config/i386/sun386.mh: Delete file.
+ * config/i386/sun386.mt: Delete file.
+ * config/i386/tm-sun386.h: Delete file.
+ * config/i386/xm-sun386.h: Delete file.
+
+ * NEWS: Note that ns32k-*-mach3*, ns32k-umax-*, ns32k-utek-sysv*
+ and ns32k-utek-* were deleted.
+ * Makefile.in (ultra3-nat.o, ultra3-xdep.o): Delete.
+ (umax-xdep.o, ns32km3-nat.o): Delete.
+ * configure.tgt: Delete ns32k-*-mach3*, ns32k-utek-sysv* and
+ ns32k-utek-* targets.
+ * configure.host: Delete ns32k-*-mach3*, ns32k-umax-* and
+ ns32k-utek-sysv* hosts.
+ * ultra3-nat.c: Delete file.
+ * ultra3-xdep.c: Delete file.
+ * umax-xdep.o: Delete file.
+ * ns32km3-nat: Delete file.
+ * config/ns32k/merlin.mh: Delete file.
+ * config/ns32k/merlin.mt: Delete file.
+ * config/ns32k/nm-umax.h: Delete file.
+ * config/ns32k/ns32km3.mh: Delete file.
+ * config/ns32k/ns32km3.mt: Delete file.
+ * config/ns32k/tm-merlin.h: Delete file.
+ * config/ns32k/tm-ns32km3.h: Delete file.
+ * config/ns32k/umax.mh: Delete file.
+ * config/ns32k/umax.mt: Delete file.
+ * config/ns32k/xm-merlin.h: Delete file.
+ * config/ns32k/xm-ns32km3.h: Delete file.
+ * config/ns32k/xm-umax.h: Delete file.
+
+ * NEWS: Note that m88*-harris-cxux* was deleted.
+ * configure.host: Delete m88*-harris-cxux* host.
+ * configure.tgt: Delete m88*-harris-cxux* target.
+ * config/m88k/cxux.mh: Delete file.
+ * config/m88k/cxux.mt: Delete file.
+ * config/m88k/nm-cxux.h: Delete file.
+ * config/m88k/tm-cxux.h: Delete file.
+ * config/m88k/xm-cxux.h: Delete file.
+
+ * NEWS: Note that powerpc-*-netware*, powerpcle-*-cygwin* and
+ powerpcle-*-solaris* were deleted.
+ * configure.host: Delete powerpcle-*-cygwin* and
+ powerpcle-*-solaris* hosts.
+ * configure.tgt: Delete powerpc-*-netware*, powerpcle-*-cygwin*
+ and powerpcle-*-solaris* targets.
+ * config/powerpc/cygwin.mh: Delete file.
+ * config/powerpc/cygwin.mt: Delete file.
+ * config/powerpc/nm-solaris.h: Delete.file.
+ * config/powerpc/ppc-nw.mt: Delete file.
+ * config/powerpc/solaris.mh: Delete file.
+ * config/powerpc/solaris.mt: Delete file.
+ * config/powerpc/tm-cygwin.h: Delete file.
+ * config/powerpc/tm-ppc-nw.h: Delete file.
+ * config/powerpc/tm-solaris.h: Delete file.
+ * config/powerpc/xm-cygwin.h: Delete file.
+ * config/powerpc/xm-mpw.h: Delete file.
+ * config/powerpc/xm-solaris.h: Delete file.
+
+ * NEWS, MAINTAINERS: Note that w65-*-* was deleted.
+ * configure.tgt: Delete w65-*-*.
+ * Makefile.in (w65-tdep.o): Delete.
+ * config/w65/tm-w65.h: Delete file.
+ * config/w65/w65.mt: Delete file.
+ * w65-tdep.c: Delete file.
+
+ * NEWS: Mention deleted tic80-*-*.
+ * configure.tgt: Delete tic80-*-*.
+ * Makefile.in (tic80-tdep.o): Delete.
+ * config/tic80/tic80.mt: Delete.
+ * config/tic80/tm-tic80.h: Delete.
+ * tic80-tdep.c: Delete.
+ * MAINTAINERS: Note that tic80 was deleted.
+
+2001-11-30 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-tdep.c (solib-svr4.h): Include.
+ (ppc_linux_svr4_fetch_link_map_offsets): New function.
+ * ppc-tdep.h (ppc_linux_svr4_fetch_link_map_offsets): Declare.
+ * rs6000-tdep.c (solib-svr4.h): Include.
+ (rs6000_gdbarch_init): Set up ppc_linux_svr4_fetch_link_map_offsets()
+ as the link map offsets fetcher.
+
+ * config/powerpc/aix.mt (TDEPFILES): Add solib-svr4.o.
+ * config/powerpc/macos.mt (TDEPFILES): Likewise.
+ * config/powerpc/nbsd.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/vxworks.mt (TDEPFILES): Likewise.
+ * config/rs6000/aix4.mt (TDEPFILES): Likewise.
+ * config/rs6000/rs6000.mt (TDEPFILES): Likewise.
+ * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise.
+
+2001-11-30 Kevin Buettner <kevinb@redhat.com>
+
+ From Louis Hamilton <hamilton@redhat.com>:
+ * arm-tdep.c (solib-svr4.h): Include.
+ (arm_linux_svr4_fetch_link_map_offsets): New function.
+ * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
+ (arm_linux_svr4_fetch_link_map_offsets): Declare.
+
+2001-11-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * values.c (value_primitive_field): Add embedded_offset to the
+ address of structure members.
+ * gnu-v3-abi.c (gnuv3_rtti_type): Cast to base type before
+ attempting to access vtable pointer. Set using_enc_p if we cast.
+ (gnuv3_virtual_fn_field): Call value_cast with structure rather than
+ structure pointer. Cast to base type before attempting to access
+ vtable pointer.
+
+2001-11-29 Elena Zannoni <ezannoni@redhat.com>
+
+ * Makefile.in (ppc-linux-nat.o): Add dependency on ppc-tdep.h.
+
+ * ppc-tdep.h (PPC_GPLAST_REGNUM): Define.
+
+ * ppc-linux-nat.c: Include ppc-tdep.h.
+ (ppc_register_u_addr): Don't use the static array regmap[],
+ dynamically define the mapping instead.
+ (supply_gregset): Ditto.
+ (fill_gregset): Ditto.
+ (COPY_REG): Delete macro defintion.
+ (regmap): Delete array.
+
+2001-11-29 Jim Blandy <jimb@redhat.com>
+
+ Tighten up GDB's support for returning structs by value.
+ * s390-tdep.c (s390_use_struct_convention): New function.
+ (s390_gdbarch_init): Register it as the S/390's
+ USE_STRUCT_CONVENTION method. Register
+ generic_cannot_extract_struct_value_address as our
+ EXTRACT_STRUCT_VALUE_ADDRESS method.
+ * arch-utils.c (generic_cannot_extract_struct_value_address): New
+ function.
+ * arch-utils.h: Add corresponding prototype.
+
+ * values.c (value_being_returned): Make error message a proper
+ sentence.
+
+2001-11-27 Keith Walker <keith.walker@arm.com>
+
+ * dwarf2read.c (read_attribute_value): New function to handle
+ DW_FORM_indirect
+ (read_attribute): uses read_attribute_value
+
+2001-11-29 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_frame_saved_pc_nofix): If the prologue didn't
+ save the return address register, assume that the return address
+ is still in there.
+
+2001-11-27 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Clarify obvious fix a little (as suggested by Eli
+ Zaretskii).
+
+2001-11-25 Jim Blandy <jimb@redhat.com>
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): Doc fixes.
+
+2001-11-27 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c: Get frame chains and saved pc values properly from
+ dummy frames.
+ (s390_frame_saved_pc_nofix): if `*fi' is a dummy frame, get the
+ saved PC from the dummy frame's registers.
+ (s390_frame_chain): Same for the saved SP.
+ (s390_gdbarch_init): Register `generic_save_dummy_frame_tos' as
+ the `SAVE_DUMMY_FRAME_TOS' method, so the dummy frame's `top' gets
+ set correctly.
+
+ * s390-tdep.c (s390_frame_chain): Remember that the SP's element
+ of the frame's saved_regs array is special.
+
+ * s390-tdep.c (register_names): Call the general-purpose registers
+ `r0' -- `r15', and the floating-point registers `f0' -- `f15', to
+ match the assembly language.
+
+2001-11-26 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * config/i386/tm-cygwin.h: Define HAVE_SSE_REGS if
+ HAVE_CONTEXT_EXTENDED_REGISTERS is defined.
+ * win32-nat.c: Define CONTEXT_DEBUGGER_DR that will also include
+ extended registers if HAVE_SSE_REGS is defined.
+ (mappings array): Add offset of extended registers.
+ (thread_rec): Use new CONTEXT_DEBUGGER_DR macro.
+
+2001-11-26 Tom Tromey <tromey@redhat.com>
+
+ * NEWS: Updated.
+ * event-loop.c (start_event_loop): Call
+ after_char_processing_hook.
+ * event-top.h (after_char_processing_hook): Declare.
+ * event-top.c (rl_callback_read_char_wrapper): Call
+ after_char_processing_hook.
+ (after_char_processing_hook): New global.
+ * top.c (operate_saved_history): New global.
+ (gdb_rl_operate_and_get_next): New function.
+ (init_main): Add the operate-and-get-next defun.
+ (gdb_rl_operate_and_get_next_completion): New function.
+
+2001-11-26 Tom Tromey <tromey@redhat.com>
+
+ * NEWS: Update for --args.
+ * infcmd.c (construct_inferior_arguments): Moved from ...
+ * fork-child.c: ... here.
+
+2001-11-26 Jim Blandy <jimb@redhat.com>
+
+ * symtab.c (find_pc_sect_line): Revert change of 2001-11-13; add
+ comment explaining that hand-written assembly code can have line
+ number info but no debug info for an enclosing function.
+
+2001-11-26 Jakub Jelinek <jakub@redhat.com>
+
+ * sparc-nat.c (fetch_inferior_registers): Don't rely
+ on CORE_ADDR being 32-bit.
+ (store_inferior_registers): Likewise.
+
+2001-11-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/config.sed: Fix an error in etc/ at "make install"
+ time on non-LFN systems where standards*.inf* expands to nothing.
+
+ * go32-nat.c (save_npx): Avoid a warning from GCC 3.x.
+
+2001-11-24 Pierre Muller <muller@ics.u-strasbg.fr>
+ Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (struct so_stuff): Add objfile *objfile field needed to
+ be able to remove the DLL when unloaded. Remove unused last field.
+ (handle_unload_dll): New function to handle unloading of DLL.
+ (solib_symbols_add): Change return type to struct objfile *.
+ (get_child_debug_event): Call handle_unload_dll function.
+
+2001-11-24 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (_initialize_check_for_gdb_ini): New function.
+ * config/i386/xm-cygwin.h: Remove obsolete handling of __CYGWIN32__.
+ (GDBINIT_FILENAME): Remove.
+
+2001-11-23 Mark Kettenis <kettenis@gnu.org>
+
+ Add x86 OpenBSD native configuration.
+ * config/i386/obsd.mt, config/i386/tm-obsd.h, config/i386/obsd.mh,
+ config/i386/nm-obsd.h: New files.
+ * configure.host (i[3456]86-*-openbsd*): New host.
+ * configure.tgt (i[3456]86-*-openbsd*): New target.
+ * NEWS: Update.
+
+2001-11-21 GDB Administrator <gdbadmin@sourceware.cygnus.com>
+
+ * GDB 5.1 was released.
+
+2001-11-21 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR gdb/209, PR gdb/156:
+ * gdbarch.c, gdbarch.h: Rebuilt.
+ * gdbarch.sh: Added `construct_inferior_arguments'.
+ * cli/cli-decode.h (cmd_list_element): Added pre_show_hook.
+ Typo fix.
+ * cli/cli-setshow.c (do_setshow_command): Call the pre_show_hook.
+ * infcmd.c (_initialize_infcmd): Set sfunc on `set args' command.
+ (inferior_argc, inferior_argv): New globals.
+ (notice_args_set): New function.
+ (set_inferior_args): Clear inferior_argc and inferior_argv.
+ (set_inferior_args_vector): New function.
+ (get_inferior_args): Handle inferior argument vector.
+ (run_command): Use get_inferior_args().
+ (notice_args_read): New function.
+ (_initialize_infcmd): Don't call set_inferior_args.
+ * command.h: Typo fix.
+ (cmd_list_element): Added pre_show_hook.
+ * main.c (captured_main): Added --args option.
+ (print_gdb_help): Document --args.
+ * inferior.h (construct_inferior_arguments): Declare.
+ (set_inferior_args_vector): Likewise.
+ * fork-child.c (construct_inferior_arguments): New function.
+
+2001-11-21 Kevin Buettner <kevinb@redhat.com>
+
+ * lin-lwp.c (lin_lwp_attach_lwp): Make sure SIGCHLD is in set of
+ blocked signals.
+
+ * lin-lwp.c (lin_lwp_attach_lwp): Mark main thread as stopped.
+
+2001-11-20 Jim Blandy <jimb@redhat.com>
+
+ * target.h (TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT): Delete
+ default definition; this is never used.
+
+2001-11-20 Keith Seitz <keiths@redhat.com>
+
+ * varobj.c (c_value_of_child): Release memory for "name" when
+ finshed using it.
+ (c_type_of_child): Likewise.
+ (cplus_value_of_child): Isolate the use of name_of_child to
+ one case that needs it.
+ Release memory for "name" when finished using it.
+
+2001-11-20 Keith Seitz <keiths@redhat.com>
+
+ * top.c (gdb_init): Call init_ui_hook before initializing
+ the default UI.
+
+2001-11-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/powerpc/nm-linux.h (ppc_register_u_addr): Add extern
+ declaration.
+
+2001-11-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-linux-nat.c (COPY_REG): Use regcache_collect instead of
+ accessing registers[].
+ (fill_fpregset): Ditto.
+
+2001-11-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * infptrace.c (fetch_register): Dynamically allocate buffer for
+ register.
+ (store_register): Use regcache_collect, instead of accessing the
+ register buffer directly.
+
+2001-11-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (find_proc_desc): Add cur_frame argument. Pass
+ cur_frame to heuristic_proc_desc.
+ (heuristic_proc_desc): Add cur_frame argument. Do not read SP
+ if cur_frame == 0.
+ (after_prologue): Pass cur_frame == 0 to find_proc_desc.
+ (mips_frame_chain): Pass cur_frame == 1 to find_proc_desc.
+ (mips_init_extra_frame_info): Likewise.
+
+2001-11-19 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (return_to_top_level): Comment.
+
+Mon Nov 19 14:58:52 2001 Andrew Cagney <cagney@redhat.com>
+
+ * remote.c (remote_open_1, remote_async_open_1): Use ISO C string
+ concatenation for error parameter.
+ (remote_cisco_open): Ditto.
+
+2001-11-19 Keith Seitz <keiths@redhat.com>
+
+ * varobj.c (c_value_of_child): Use the wrapper function,
+ gdb_value_struct_elt.
+ (cplus_value_of_child): Likewise.
+
+2001-11-18 Andrew Cagney <ac131313@redhat.com>
+
+ * i386-tdep.c (i386_gdbarch_init): Initialize num_regs.
+ * config/i386/tm-i386.h (NUM_REGS): Delete.
+
+2001-11-18 Kevin Buettner <kevinb@redhat.com>
+
+ * i386-linux-nat.c (fill_gregset): Fix botched regcache_collect()
+ conversion for I386_LINUX_ORIG_EAX_REGNUM.
+
+2001-11-18 Andrew Cagney <ac131313@redhat.com>
+
+ * config/i386/embed.mt (TM_FILE): Set to tm-i386.h.
+ * config/i386/tm-embed.h: Delete.
+
+2001-11-17 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (distclean): Explicitly delete Makefile et.al. in
+ gdbserver sub directory.
+
+2001-11-17 Andrew Cagney <ac131313@redhat.com>
+
+ * README: Mention need for alloca(). Mention problems with
+ alpha-dec-osf4.0e. Clarify that comments refer to GDB 5.1.
+
+2001-11-17 Kevin Buettner <kevinb@redhat.com>
+
+ * i386-linux-nat.c (fill_gregset): Use regcache_collect() instead
+ of accessing registers[] directly.
+
+2001-11-17 Kevin Buettner <kevinb@redhat.com>
+
+ * i386-linux-nat.c (fill_gregset): Don't invoke read_register_gen()
+ when fetching ORIG_EAX.
+
+2001-11-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-linux-nat.c: Don't include <asm/ptrace.h>.
+ (fetch_register): Use elf_gregset_t instead of struct pt_regs.
+ (fetch_regs): Likewise.
+ (store_register): Likewise.
+ (store_regs): Likewise.
+
+2001-11-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * sparc-linux-nat.c (fill_gregset): Replace read_register_gen
+ with regcache_collect.
+ (fill_fpregset): Likewise.
+
+2001-11-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in: Add mips-linux-nat.c, mips-linux-tdep.c,
+ and sparc-linux-nat.c to ALLDEPFILES. Add dependencies.
+ * config/sparc/linux.mh: Add sparc-linux-nat.o to NATDEPFILES.
+ * sparc-linux-nat.c: New file, from Mark Kettenis.
+
+2001-11-16 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2read.c (dwarf_str_buffer): New.
+ (struct dwarf2_pinfo): Add dwarf_str_buffer and dwarf_str_size.
+ (DWARF_STR_BUFFER, DWARF_STR_SIZE): Define.
+ (dwarf2_has_info): Clear dwarf_str_offset.
+ (dwarf2_build_psymtabs): Read .debug_str section if present.
+ (dwarf2_build_psymtabs_hard): Save DWARF_STR_BUFFER and
+ DWARF_STR_SIZE.
+ (psymtab_to_symtab_1): Restore DWARF_STR_BUFFER and DWARF_STR_SIZE.
+ (read_attribute): Handle DW_FORM_strp.
+ (read_n_bytes, read_string): Remove HOST_CHAR_BIT != 8
+ handling code.
+ (read_indirect_string): New.
+ (dump_die): Handle DW_FORM_strp.
+
+2001-11-16 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c: Tweak argument-passing to match GCC bugs.
+ (is_float_singleton, is_struct_like, is_float_like): New
+ functions, that isolate the weirdness.
+ (is_double_or_float, is_simple_arg, pass_by_copy_ref,
+ is_double_arg): Use is_struct_like and is_float_like, rather than
+ testing the type codes ourselves.
+ (s390_push_arguments): When passing args on the stack, align each
+ on to a four-byte boundary, regardless of what the type itself
+ needs.
+
+2001-11-16 Ben Harris <bjh21@netbsd.org>
+
+ * Makefile.in (os9kread.o): Replace $< with autoconf-approved
+ $(srcdir)/....
+ (procfs.o): Ditto.
+ (z8k-tdep.o): Ditto.
+
+2001-11-16 Ben Harris <bjh21@netbsd.org>
+
+ * MAINTAINERS (write-after-approval): Add self.
+
+2001-11-15 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (is_simple_arg): Structs and unions exactly eight
+ bytes long should be handled as DOUBLE_ARGs; don't recognize them
+ as SIMPLE_ARGs.
+
+2001-11-12 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (struct packet_reg): Declare.
+ (struct remote_state): Add fields sizeof_g_packet and g_packet.
+ (init_remote_state): Initialize sizeof_g_packet and g_packet.
+ (free_remote_state): Free g_packet.
+ (packet_reg_from_pnum, packet_reg_by_regnum): New functions.
+ (remote_wait): Use above instead of gdbarch methods
+ REGISTER_RAW_SIZE and REGISTER_BYTES.
+ (remote_async_wait): Ditto.
+ (remote_fetch_registers, remote_store_registers): Ditto.
+ (store_register_using_P): Ditto.
+
+2001-11-15 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (_initialize_remote): Don't multi-arch swap tty_input.
+ Second attempt.
+
+2001-11-15 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (phex_nz): For default case, set str to phex_nz return
+ value.
+ (phex): Ditto.
+
+2001-11-15 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (register_buffer): Delete.
+ * regcache.c (register_buffer): Make static.
+ (regcache_collect): New function.
+ * regcache.h (register_buffer): Delete declaration.
+ (regcache_collect): Declare.
+ * remote.c (store_register_using_P): Rewrite using
+ regcache_collect.
+ (remote_store_registers): Ditto.
+ * go32-nat.c (store_register): Ditto.
+
+2001-11-14 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (struct remote_state): Declare.
+ (get_remote_state): New function.
+ (init_remote_state): New function.
+ (remote_gdbarch_data_handle): New global.
+ (build_remote_packet_sizes): Delete function, moved to
+ init_remote_state.
+ (register_remote_packet_sizes): Delete function.
+ (actual_register_packet_size, remote_packet_size): Moved to
+ ``struct remote_state''.
+ (PBUFSIZE): Delete. Replaced by rs->remote_packet_size.
+ (free_remote_state): New function.
+ (get_memory_packet_size, get_memory_read_packet_size)
+ (set_thread, remote_unpack_thread_info_response)
+ (remote_get_threadinfo, parse_threadlist_response)
+ (remote_get_threadlist, remote_current_thread)
+ (remote_threads_info, remote_threads_extra_info)
+ (extended_remote_restart, get_offsets)
+ (get_offsets, remote_check_symbols, remote_open_1)
+ (remote_async_open_1, remote_detach, remote_async_detach)
+ (remote_resume, remote_async_resume, remote_wait)
+ (remote_async_wait, remote_fetch_registers)
+ (store_register_using_P, remote_store_registers)
+ (check_binary_download, putpkt_binary)
+ (remote_insert_breakpoint, remote_remove_breakpoint)
+ (remote_insert_watchpoint, remote_remove_watchpoint)
+ (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint)
+ (compare_sections_command, remote_query)
+ (remote_rcmd, remote_rcmd, packet_command)
+ (remote_info_process): Update.
+
+2001-11-14 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c: Include "gdb_assert.h".
+ (tty_input): Wire buffer to 400 bytes.
+ (readsocket): Check tty_input doesn't overflow.
+ (build_remote_gdbarch_data, _initialize_remote): Don't multi-arch
+ tty_input.
+
+2001-11-14 Michael Snyder <msnyder@redhat.com>
+
+ * d10v-tdep.c (d10v_pointer_to_address): Use new type flag
+ TYPE_FLAG_CODE_SPACE to recognize a pointer that has been cast
+ into the instruction address space.
+ * Makefile.in (doublest.o): Add dependency on gdbtypes.h.
+
+2001-11-14 Michael Snyder <msnyder@redhat.com>
+ Add address space identifiers to expression language for types.
+ * c-exp.y (space_identifier, cv_with_space_id,
+ const_or_volatile_or_space_identifier_noopt,
+ const_or_volatile_or_space_identifier): New terminals.
+ (ptype): Accept const_or_volatile_or_space_identifier.
+ (typebase): Accept const_or_volatile_or_space_identifier.
+ * c-typeprint.c (c_type_print_cv_qualifier): Rename to
+ c_type_print_modifier. Handle address space modified types.
+ * gdbtypes.h (TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE):
+ New type flags.
+ (struct type): Add new field as_type for addr-space qualified types.
+ (TYPE_AS_TYPE): New macro, retrieves the chain of types that are
+ identical to this one except for address-space qualification.
+ * gdbtypes.c (alloc_type): Initialize new field 'as_type'.
+ (address_space_name_to_int): New function.
+ (address_space_int_to_name): New function.
+ (make_type_with_address_space): New function.
+ (make_cv_type): Handle as_type field of new struct type object.
+ * parse.c (check_type_stack_depth): New function.
+ (push_type_address_space): New function.
+ (follow_types): Handle types with address-space qualifier.
+ * parser-defs.h (enum type_pieces): Add enum tp_space_identifier.
+
+2001-11-14 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_pop_frame_regular): On the S/390, the frame
+ pointer and the SP are often the same, so we can't pop the frame
+ by setting the SP to the FP; we need to get the old SP from
+ saved_regs.
+
+ * s390-tdep.c (s390_extract_return_value): Returned `float' values
+ can simply be copied bitwise from the registers into the value
+ object's buffer.
+
+ * s390-tdep.c (s390_get_frame_info): Initialize SP's element of
+ the frame's saved_regs array correctly.
+
+ * symfile.c (simple_read_overlay_table): Make sure we can find
+ both `_novlys' and `_ovly_table' before we try anything else;
+ print a helpful error message.
+ (simple_overlay_update): No need to print error message here.
+
+2001-11-14 Michael Snyder <msnyder@redhat.com>
+
+ * Makefile.in (doublest.o): Add dependency on gdbtypes.h.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c (arm_register_type): New function.
+ (arm_register_convertible): Delete.
+ (arm_register_convert_to_virtual): Delete.
+ (arm_register_convert_to_raw): Delete.
+ * config/arm/tm-arm.h (REGISTER_CONVERTIBLE): Delete.
+ (REGISTER_CONVERT_TO_VIRTUAL): Delete.
+ (REGISTER_CONVERT_TO_RAW): Delete.
+ (REGISTER_VIRTUAL_TYPE): Redefine as call to arm_register_type.
+ (arm_register_type): Declare.
+
+2001-11-13 Elena Zannoni <ezannoni@redhat.com>
+
+ From Andrew Cagney <cagney@redhat.com>:
+ * gdbtypes.h (builtin_type_int128, builtin_type_uint128): Declare.
+ * gdbtypes.c (_initialize_gdbtypes, build_gdbtypes): Initialize
+ new builtin types.
+
+2001-11-13 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c: Rewrite inferior function call code. This may
+ break zSeries support; that should be fixed soon.
+ #include "gdb_assert.h".
+ (is_integer_like, is_pointer_like, is_simple_arg,
+ pass_by_copy_ref, extend_simple_arg, is_double_arg, round_up,
+ round_down, alignment_of): New functions.
+ (s390_push_arguments): Rewritten to handle passing large arguments
+ by value, and to make more readable.
+
+ * s390-tdep.c (s390_pop_frame): Call generic_pop_current_frame, to
+ interact correctly with generic dummy frames.
+ (s390_pop_frame_regular): Move the guts of the frame-popping code
+ to here, to be called by generic_pop_current_frame. Use the
+ frame's saved_regs array; this works for `return' as well as
+ inferior function calls.
+
+ * s390-tdep.c (s390_gdbarch_init): Register the function
+ `standard_coerce_float_to_double', since GCC for the S/390 follows
+ the standard rules for passing floats.
+
+ * valops.c (default_coerce_float_to_double,
+ standard_coerce_float_to_double): Doc fixes.
+
+ Patch from Peter Schauer:
+
+ * symtab.c (find_pc_sect_line): If we can't find the function
+ containing PC, we certainly won't have line number information for
+ that location, so return zero immediately.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * config/i960/tm-nindy960.h (REGISTER_CONVERTIBLE)
+ (REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Delete
+ undef.
+ * i960-tdep.c (i960_register_type): New function.
+ * config/i960/tm-i960.h (REGISTER_CONVERTIBLE): Delete.
+ (REGISTER_CONVERT_TO_VIRTUAL): Delete.
+ (REGISTER_CONVERT_TO_RAW): Delete.
+ (REGISTER_VIRTUAL_TYPE): Update. Call i960_register_type.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * m88k-tdep.c (m88k_register_type): New function.
+ * config/m88k/tm-m88k.h (REGISTER_CONVERTIBLE): Delete.
+ (REGISTER_CONVERT_TO_VIRTUAL): Delete.
+ (REGISTER_CONVERT_TO_RAW): Delete.
+ (m88k_register_type): Declare.
+ (REGISTER_VIRTUAL_TYPE): Update. Call m88k_register_type.
+
+2001-11-11 Mark Kettenis <kettenis@elgar.my.domain>
+
+ * i386-tdep.h (FPU_REG_RAW_SIZE): Define unconditionally.
+ * i387-nat.c, i387-tdep.c: Unconditionally include "i386-tdep.h".
+ * config/i386/tm-i386.h (FPU_REG_RAW_SIZE): Removed.
+ (SIZEOF_FPU_REGS): Don't use FPU_REG_RAW_SIZE here.
+
+2001-11-12 Jim Blandy <jimb@redhat.com>
+
+ Patch from Andreas Schwab <schwab@suse.de>:
+ * eval.c (evaluate_subexp_standard): Fix memory leak: use alloca
+ instead of xmalloc.
+
+2001-11-12 Jim Blandy <jimb@redhat.com>
+
+ * corefile.c (write_memory_unsigned_integer,
+ write_memory_signed_integer): New functions.
+ (write_memory): Move to be with other write_memory_* functions.
+ * gdbcore.h (write_memory_unsigned_integer,
+ write_memory_signed_integer): New declarations.
+
+2001-11-11 Geoffrey Keating <geoffk@redhat.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Properly deal with
+ unknown standard opcodes.
+
+2001-11-11 Andrew Cagney <ac131313@redhat.com>
+
+ * README (alpha-dec-osf5.1): Mention -DUSE_LDR_ROUTINES.
+ (sparcv9-sun-solars2.8): Mention problem with 64 bit GCC 3.0.x.
+ (i586-sco-sysv5uw7.1.1): Mention problem with threads.
+
+2001-11-11 Andrew Cagney <ac131313@redhat.com>
+
+ From Mark Kettenis <kettenis@gnu.org>:
+ * breakpoint.c (breakpoint_re_set_one): Don't discard SHLIB
+ breakpoints when they fail.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * printcmd.c, valprint.c, language.c, linespec.c, infcmd.c,
+ gnu-nat.c, findvar.c, expprint.c, typeprint.c, stack.c, top.c:
+ Replace value_ptr with struct value.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * c-valprint.c, ch-lang.c, ch-valprint.c, cp-valprint.c,
+ p-valprint.c, scm-exp.c, scm-lang.c, scm-valprint.c: Replace
+ value_ptr with struct value.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * eval.c: Replace most occurances of value_ptr with struct value.
+
+2001-11-09 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c: Don't use a call dummy.
+ (s390_fix_call_dummy, s390_pc_in_call_dummy): Delete.
+ (s390_push_return_address): Put the address of the inferior call
+ breakpoint in r14.
+ (s390_gdbarch_init):
+ - Provide trivial definition of s390_call_dummy_words; register it
+ with the gdbarch appropriately.
+ - Delete S390x_call_dummy_words.
+ - Gather inferior-call-related settings into a group.
+ - Use generic dummy frames.
+ - Put the inferior call breakpoint at the entry point.
+ - Use generic gdbarch methods: pc_in_call_dummy_at_entry_point,
+ generic_push_dummy_frame, generic_fix_call_dummy.
+ - There is a call dummy breakpoint offset; it's zero.
+
+ * s390-tdep.c: (s390_push_arguments): Write a back chain pointer
+ into the dummy frame, to help us get backtraces.
+
+ * values.c (value_as_address): If VAL is a function or method,
+ just return its address; don't let COERCE_ARRAY convert its
+ address to a pointer, and then have unpack_long convert it back to
+ an address.
+
+2001-11-06 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-lang.c (is_pascal_string_type): New function to determine if a
+ type is a string type.
+ * p-lang.h: Add prototype for is_pascal_string_type.
+ * p-valprint.c (pascal_val_print) : Use is_pascal_string_type function
+ to display strings nicely.
+
+2001-11-06 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y (yylex): Only change case of expression if symbol is found.
+ Also check for GPC standard name form.
+
+2001-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb_indent.sh: New file.
+
+2001-11-08 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_get_frame_info): Initialize got_load_addr and
+ got_load_len, to placate compiler.
+
+2001-11-08 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_gdbarch_init): Fix typo.
+
+2001-11-08 Jim Blandy <jimb@redhat.com>
+
+ * s390-tdep.c (s390_gdbarch_init): Use func_frame_chain_valid, not
+ file_frame_chain_valid.
+
+ * s390-tdep.c (s390_get_frame_info): If the prologue loads r12
+ from the constant pool, but doesn't add in the constant pool's
+ address to it, then this function probably isn't using r12 as a
+ GOT pointer, and that load probably wasn't part of the prologue.
+
+ * s390-tdep.c (s390_gdbarch_init): Use the default
+ prepare_to_proceed function established by config/nm-linux.h;
+ don't try to set it to linuxthreads_prepare_to_proceed.
+
+Wed Nov 7 20:38:14 2001 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c: Include "i386-tdep.h".
+ (XMALLOC): Define.
+ (i386_gdbarch_init): New function.
+ (_initialize_i386_tdep): Register bfd_arch_i386.
+ * config/i386/tm-i386.h (GDB_MULTI_ARCH): Define as
+ GDB_MULTI_ARCH_PARTIAL.
+ * i386-tdep.h: When partially multi-arch, conditionally define
+ all macros.
+
+Wed Nov 7 20:45:32 2001 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c (set_disassembly_flavor): Delete function.
+ (set_disassembly_flavor_sfunc): Delete function.
+
+2001-11-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * dbxread.c (set_namestring): New function, replacing the
+ SET_NAMESTRING macro.
+ (SET_NAMESTRING, CUR_SYMBOL_TYPE, CUR_SYMBOL_VALUE,
+ CUR_SYMBOL_STRX, DBXREAD_ONLY, START_PSYMTAB, END_PSYMTAB): Delete
+ definitions.
+ (read_dbx_symtab): Don't include partial-stab.h any more. Don't
+ reuse code in partial-stab.h, include the code directly, instead.
+
+ * Makefile.in (dbxread.o): Remove dependency on partial-stab.h.
+ (HFILES_NO_SRCDIR): Remove partial-stab.h.
+
+ * partial-stab.h: Remove file.
+
+2001-11-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: For multi-arch functions, check there is a
+ predefault and use it as the static default.
+ * gdbarch.c: Re-generate.
+
+2001-11-08 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Define in
+ terms of NUM_GREGS, NUM_FREGS and NUM_SSE_REGS instead of
+ hardcoding the register number.
+
+2001-11-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (USE_STRUCT_CONVENTION): Default to
+ generic_use_struct_convention.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * values.c (USE_STRUCT_CONVENTION): Delete definition, moved to
+ gdbarch.h.
+
+2001-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (PC_IN_CALL_DUMMY): Require a value.
+ * gdbarch.c: Regenerate.
+
+2001-11-06 Fred Fish <fnf@redhat.com>
+
+ * complaints.c (info_verbose): Remove unneeded decl, is in defs.h.
+ * dbxread.c: Ditto
+ * dwarf2read.c: Ditto.
+ * dwarfread.c: Ditto.
+ * exec.c: Ditto.
+ * hpread.c: Ditto.
+ * hpread.h: Ditto.
+ * mdebugread.c: Ditto.
+ * os9kread.c: Ditto.
+ * stack.c: Ditto.
+ * symfile.c: Ditto.
+ * tracepoint.c: Ditto.
+
+2001-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Update Andrew Cagney's responsibilities. Mention
+ David Taylor and Nick Duffek in past maintainers.
+
+2001-11-06 Elena Zannoni <ezannoni@redhat.com>
+
+ * mdebugread.c (CUR_SYMBOL_TYPE, CUR_SYMBOL_VALUE, START_PSYMTAB,
+ END_PSYMTAB, SET_NAMESTRING, HANDLE_RBRAC): Delete definitions.
+ (parse_partial_symbols): Don't include partial-stab.h any
+ more. Don't reuse code in partial-stab.h, include the code
+ directly, instead. Simplify code from partial-stab.h eliminating
+ ifdef DBXREAD_ONLY code.
+
+ * Makefile.in (mdebugread.o): Remove dependency on partial-stab.h.
+
+2001-11-06 Jim Blandy <jimb@redhat.com>
+
+ * s390-nat.c: #include "regcache.h", to get declaration for
+ `supply_register'. (The last change already added the dependency
+ of s390-nat.o on regcache.h. Oops.)
+
+ * Makefile.in (ALLDEPFILES): Add s390-tdep.c and s390-nat.c.
+ (s390-tdep.o, s390-nat.o): New rules.
+
+ * s390-nat.c (s390_register_u_addr): Pass proper arguments to
+ internal_error.
+
+2001-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (CALL_DUMMY_LOCATION): Require a value.
+ * gdbarch.c: Regenerate.
+
+2001-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * blockframe.c (get_prev_frame): Replace #ifdef
+ INIT_EXTRA_FRAME_INFO with run-time test.
+
+2001-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (push_return_address): Change to a function with
+ predicate.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * valops.c (hand_function_call): Replace #ifdef
+ PUSH_RETURN_ADDRESS with run-time test of PUSH_RETURN_ADDRESS_P.
+
+2001-11-06 Corinna Vinschen <vinschen@redhat.com>
+
+ * arch-utils.c (generic_in_function_epilogue_p): New function.
+ * arch-utils.h (generic_in_function_epilogue_p): Declare extern.
+ * breakpoint.c (watchpoint_check): Add test whether the pc is
+ currently in the epilogue of a function.
+ * gdbarch.c: Autogenerated from gdbarch.sh.
+ * gdbarch.h: Ditto.
+ * gdbarch.sh (function_list): Add `in_function_epilogue_p' definition.
+
+2001-11-05 Jim Blandy <jimb@redhat.com>
+
+ * config/s390/s390.mh (NATDEPFILES): Don't split this across
+ several lines with backslashes; the `sed' command in
+ configure.in's AC_OUTPUT clause that comments out the NATDEPFILES
+ assignment doesn't handle lines extended with backslashes.
+
+ * configure.in (AC_OUTPUT): Handle assignments to NATDEPFILES
+ using `+=' as well as `='.
+ * configure: Regenerated.
+
+2001-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (init_extra_frame_info): Change to a function with
+ predicate.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * blockframe.c (create_new_frame): Replace #ifdef
+ INIT_EXTRA_FRAME_INFO with run-time test of
+ INIT_EXTRA_FRAME_INFO_P.
+
+2001-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (verify_gdbarch): Use a mem_file to accumulate all
+ error messages. Print in a single batch.
+ * gdbarch.c: Re-generate.
+
+2001-11-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (GETREGS_SUPPLIES, supply_gregset,
+ fill_gregset): Add support for "orig_eax" register.
+
+ Add support for "orig_eax" pseudo register on Linux/x86.
+ * i386-linux-tdep.c: Include "inferior.h".
+ (i386_linux_register_name, i386_linux_register_byte,
+ i386_linux_register_raw_size): New functions.
+ (i386_linux_write_pc): New function.
+ * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): New define.
+ (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME,
+ REGISTER_BYTE, REGISTER_RAW_SIZE): Define to deal with additional
+ register.
+ (i386_linux_register_name, i386_linux_register_byte,
+ i386_linux_register_raw_size): New prototypes.
+ (TARGET_WRITE_PC): New define.
+ (i386_linux_write_pc): New prototype.
+
+ * i386-tdep.c (i386_register_offset): Renamed from
+ i386_register_byte. Made static.
+ (i386_register_size): Renamed from i386_register_raw_size. Made
+ static.
+ (i386_register_virtual_size): Removed.
+ (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New functions.
+ (_initialize_i386_tdep): Initialize i386_register_offset instead
+ of i386_register_byte. Remove code to initialize
+ i386_register_virtual_size.
+ * config/i386/tm-i386.h (REGISTER_BYTE): Redefine to use
+ i386_register_byte function.
+ (REGISTER_RAW_SIZE): Redefine to use i386_register_raw_size
+ function.
+ (REGISTER_VIRTUAL_SIZE): Redefine to use
+ i386_register_virtual_size function.
+ (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New functions.
+
+ * Makefile.in (ALLDEPFILES): Add i387-nat.c.
+ (i387-nat.o): Add dependencies.
+
+2001-11-02 Andrew Cagney <ac131313@redhat.com>
+
+ * README: Mention problem with alpha-dec-osf5.1.
+
+2001-11-02 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (internal_verror): Restore calls to abort().
+ Fix PR gdb/219.
+
+2001-11-02 Michael Chastain <mec@shout.net>
+
+ * MAINTAINERS: Update my entry.
+
+2001-11-01 Michael Snyder <msnyder@redhat.com>
+
+ * symtab.c (operator_chars): Allow '*' and '[' to be quoted in
+ operator names, to avoid regexp expansion.
+ (search_symbols): Alloca buffer is too small, may get clobbered.
+
+2001-11-01 Fred Fish <fnf@redhat.com>
+
+ * coff-solib.c (coff_solib_add): Add new readsyms arg.
+ * irix5-nat.c (solib_add): Ditto.
+ * osfsolib.c (solib_add): Ditto.
+ * pa64solib.c (pa64_solib_add): Ditto.
+ * pa64solib.c (add_to_solist): Ditto.
+ * pa64solib.c (read_dld_descriptor): Ditto.
+ * solib.c (solib_add): Ditto.
+ * somsolib.c (som_solib_add): Ditto.
+ * win32-nat.c (child_solib_add): Ditto.
+ * xcoffsolib.c (solib_add): Ditto.
+
+ * coff-solib.h (coff_solib_add): Add new readsyms arg to prototype.
+ * pa64solib.c (add_to_solist): Ditto.
+ * pa64solib.c (read_dld_descriptor): Ditto.
+ * pa64solib.h (pa64_solib_add): Ditto.
+ * solib.h (solib_add): Ditto.
+ * somsolib.h (som_solib_add): Ditto.
+ * config/i386/tm-cygwin.h (child_solib_add): Ditto.
+
+ * coff-solib.c (coff_solib_add): If readsyms is zero don't read
+ symbols but do any other needed work for shared libs.
+ * irix5-nat.c: Ditto.
+ * osfsolib.c (solib_add): Ditto.
+ * solib.c (solib_add): Ditto.
+ * win32-nat.c (child_solib_add): Ditto.
+ * xcoffsolib.c (solib_add): Ditto.
+
+ * irix5-nat.c (sharedlibrary_command): Pass 1 as readsyms to
+ solib_add to force reading of shared library symbols.
+ * osfsolib.c (sharedlibrary_command;): Ditto.
+ * pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
+ * solib.c (sharedlibrary_command): Ditto.
+ * somsolib.c (som_solib_sharedlibrary_command): Ditto.
+ * xcoffsolib.c (sharedlibrary_command): Ditto.
+
+ * coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
+ unconditionally with auto_solib_add.
+ * irix5-nat.c (solib_create_inferior_hook): Ditto.
+ * osfsolib.c (solib_create_inferior_hook): Ditto.
+ * solib.c (solib_create_inferior_hook): Ditto.
+ * solib-osf.c (osf_solib_create_inferior_hook): Ditto.
+ * solib-svr4.c (enable_break): Ditto.
+ * solib-sunos.c (sunos_solib_create_inferior_hook): Ditto.
+
+ * corelow.c (solib_add_stub): Add auto_solib_add to args passed
+ via SOLIB_ADD.
+ * sol-thread.c (sol_thread_attach): Ditto.
+ * config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.
+
+ * infcmd.c (attach_command): Remove auto_solib_add decl.
+ Call SOLIB_ADD directly with auto_solib_add.
+ * infrun.c (handle_inferior_event): Ditto.
+
+ * coff-solib.h (SOLIB_ADD): Add readsyms arg.
+ * pa64solib.h (SOLIB_ADD): Ditto.
+ * solib.h (SOLIB_ADD): Ditto.
+ * somsolib.h (SOLIB_ADD): Ditto.
+ * config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.
+
+ * fork-child.c (clone_and_follow_inferior): Remove unused
+ auto_solib_add decl.
+
+ * pa64solib.c (pa64_solib_add): Call add_to_solist with readsyms.
+ (read_dld_descriptor): Ditto.
+ (pa64_solib_add): Call read_dld_descriptor with readsyms.
+ (pa64_solib_in_dynamic_linker): Ditto.
+
+ * corelow.c (symfile.h): Need this for auto_solib_add declaration.
+ * sol-thread.c (symfile.h): Ditto.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ * s390-nat.c (s390_remove_watchpoint): Use xfree.
+ (s390_insert_watchpoint): Use xmalloc.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ * varobj.c: Replace value_ptr with ``struct value *''.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ * varobj.c: Re-indent.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ * x86-64-tdep.c (value_push, x86_64_push_arguments): Replace
+ ``value_ptr'' with ``struct value *''.
+ * s390-tdep.c (s390_push_arguments): Ditto.
+
+2001-10-30 Andrew Cagney <ac131313@redhat.com>
+
+ * ppc-tdep.h: Add #ifndef wrapper. Replace value_ptr with
+ ``struct value *''.
+ (struct frame_info, struct value): Add opaque declarations.
+
+2001-10-31 Corinna Vinschen <vinschen@redhat.com>
+
+ * arch-utils.c (generic_in_solib_call_trampoline): New function.
+ * arch-utils.h (generic_in_solib_call_trampoline): Extern declaration.
+ * gdbarch.c: Regenerated from gdbarch.sh.
+ * gdbarch.h: Ditto.
+ * gdbarch.sh (function_list): Add `IN_SOLIB_CALL_TRAMPOLINE' definition.
+ * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Remove macro.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ From DJ Barrow.
+ * s390-tdep.c: (s390_gdbarch_init): Don't initialize
+ find_solib_trampoline_target.
+
+2001-10-31 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-vx.c (net_wait): Fix typo from PIDGET change.
+
+2001-10-31 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): New define.
+ (i386_register_name): New prototype.
+ * i386-tdep.c (i386_register_names): New variable.
+ (i386_register_name): New function.
+ * config/i386/tm-i386os9k.h, config/i386/tm-ptx.h,
+ config/i386/tm-symmetry.h: Undefine REGISTER_NAME instead of
+ REGISTER_NAMES.
+
+2001-10-31 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (register_loaded_dll): Attempt to ensure that the case of
+ the loaded DLL matches the on-disk case since the debugging API does
+ not seem to ensure this. Calculate max name length here.
+ (handle_load_dll): Move max name length calculation to
+ register_loaded_dll.
+
+2001-10-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-linux-nat.c: Include <asm/ptrace.h> explicitly.
+
+2001-10-30 Keith Seitz <keiths@redhat.com>
+
+ * wrapper.h (gdb_value_struct_elt): New function.
+ * wrapper.c (gdb_value_struct_elt): Ditto.
+ (do_captured_value_struct_elt): Ditto.
+
+2001-10-30 Andrew Cagney <ac131313@redhat.com>
+
+ * README, NEWS: Update for 5.1.
+
+2001-10-30 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.in (WERROR_CFLAGS): Use AC_TRY_COMPILE to test the
+ -W... flags.
+ * configure: Re-generate.
+
+2001-10-30 Fred Fish <fnf@redhat.com>
+
+ * somsolib.c (som_solib_add): A megabyte is 1024*1024 bytes.
+ * pa64solib.c (add_to_solist): Ditto.
+ * win32-nat.c (_initialize_inftarg): Remove unnecessary
+ initialization of auto_solib_add, it defaults to 1.
+
+2001-10-27 Fred Fish <fnf@redhat.com>
+
+ * symfile.c (auto_solib_add): Update comment to note that
+ this variable is now just used as a boolean to control shlib
+ autoloading, and clarify when it is used.
+ * symfile.h (auto_solib_add): Ditto.
+
+ * symfile.c (auto_solib_limit): New variable that holds the
+ autoloading threshold instead of overloading auto_solib_add.
+ * symfile.h (auto_solib_limit): Ditto.
+
+ * irix5-nat.c (_initialize_solib): Change auto-solib-add
+ variable from var_zinteger to var_boolean and update help.
+ * osfsolib.c (_initialize_solib): Ditto.
+ * pa64solib.c (_initialize_pa64_solib): Ditto.
+ * solib.c (_initialize_solib): Ditto.
+ * somsolib.c (_initialize_som_solib): Ditto.
+ * xcoffsolib.c (_initialize_solib): Ditto.
+
+ * pa64solib.c (pa64_solib_total_st_size): Update comment to
+ note that the new auto_solib_limit variable is used instead
+ of overloading auto_solib_add variable.
+ (_initialize_pa64_solib): Ditto.
+ * somsolib.c (som_solib_total_st_size): Ditto.
+ (_initialize_som_solib): Ditto.
+
+ * pa64solib.c (_initialize_pa64_solib): Add new set/show
+ commands for auto-solib-limit variable.
+ * somsolib.c (_initialize_som_solib): Ditto
+
+ * pa64solib.c (add_to_solist): Check that auto_solib_add is
+ set and use auto_solib_limit as the threshold size instead
+ of auto_solib_add.
+ * somsolib.c (som_solib_add): Ditto, and also change warning
+ text about size threshold exceeded.
+
+2001-10-21 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386v.h: Don't include "regcache.h".
+ (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, FRAME_CHAIN,
+ FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, FRAME_NUM_ARGS):
+ Remove macros. The versions from "tm-i386.h" should work fine
+ (and in most cases even better).
+
+2001-10-30 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_extract_return_value): Use
+ convert_typed_floating to extract floating-point value from
+ register buffer.
+ (i386_store_return_value): Use convert_typed_floating to store
+ floating-point return balue in register buffer
+ (i386_register_virtual_type): Change type of floating-point
+ registers to builtin_type_i387_ext.
+ (i386_register_convert_to_virtual): Use convert_typed_floating to
+ do the conversion.
+ (i386_register_convert_to_raw): Likewise.
+
+2001-10-29 Mark Kettenis <kettenis@gnu.org>
+
+ * doublest.h (convert_typed_floating): New prototype.
+ * doublest.c (convert_typed_floating): New function.
+
+2001-10-28 Mark Kettenis <kettenis@gnu.org>
+
+ * doublest.c: Improve comments a bit.
+ (floatformat_from_length): New function.
+ (NAN): Define to 0.0 if not already defined.
+ (extract_floating): Rewrite to use floatformat_from_length. Warn
+ instead of error if LEN doesn't match a known floating-point type,
+ and return NaN (or 0.0 if NaN isn't available) in that case.
+ (store_floating): Likewise, but zero out the target byte-stream if
+ LEN doesn't match a known floating-point type.
+ (extract_typed_floating): Reformat a bit.
+ (store_typed_floating): Reformat a bit. Add comment about zeroing
+ out padding in the target buffer.
+ * doublest.h (extract_floating, store_floating): Fix comment about
+ deprecation of these functions. Add parameter names to prototypes.
+
+2001-10-28 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (print_i387_value): Use extract_typed_floating to
+ convert RAW to a DOUBLEST instead of extract_floating.
+
+ * gdbtypes.c (_initialize_gdbtypes): Set floating-point type for
+ builtin_type_i387_ext to floatformat_i387_ext.
+
+2001-10-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-linux-nat.c (fill_gregset): Do not check register_valid[].
+ (fill_fpregset): Likewise.
+
+2001-10-26 Orjan Friberg <orjanf@axis.com>
+
+ * cris-tdep.c (constraint): Loop through the whole cris_spec_regs
+ struct, not just the NUM_SPECREGS first entries.
+ (bdap_prefix): Read PC before autoincrement.
+
+2001-10-24 Corinna Vinschen <vinschen@redhat.com>
+
+ * win32-nat.c (DebugSetProcessKillOnExit): New static function
+ pointer to Windows' DebugSetProcessKillOnExit() function.
+ (DebugActiveProcessStop): Ditto for DebugActiveProcessStop().
+ (has_detach_ability): New function.
+ (child_attach): If system has detach ability, enable it.
+ (child_detach): If system has detach ability, actually
+ detach from process.
+ Change tty output to Linux format.
+
+2001-10-23 Jim Blandy <jimb@redhat.com>
+
+ Isolate STABS readers' use of the `textlow' and `texthigh' fields
+ of `struct partial_symtab' to only a few locations. This change
+ is not supposed to affect the way the values are computed, only
+ where they live.
+
+ * dbxread.c (struct symloc): Add `textlow' and `texthigh' fields
+ to the reader-specific structure.
+ * mdebugread.c (struct symloc): Same.
+ * dbxread.c (TEXTLOW, TEXTHIGH): New accessor macros.
+ * mdebugread.c (TEXTLOW, TEXTHIGH): Same.
+ * dbxread.c (dbx_symfile_read): After we've built all our partial
+ symbol tables, set each partial symtab's `textlow' and `texthigh'
+ fields from our reader-specific structure.
+ * mdebugread.c (mdebug_build_psymtabs): Same.
+ * dbxread.c (start_psymtab): Initialize the reader-specific
+ structure's `textlow' and `texthigh' from the new psymtab's.
+ * mdebugread.c (parse_partial_symbols, new_psymtab): Same.
+ * dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab): Use
+ the reader-specific `textlow' and `texthigh', not the generic
+ psymtab fields.
+ * mdebugread.c (parse_lines, parse_partial_symbols,
+ psymtab_to_symtab_1): Same.
+ * partial-stab.h: Same.
+
+Tue Oct 23 18:59:42 2001 Andrew Cagney <cagney@redhat.com>
+
+ * hp-psymtab-read.c, hppah-nat.c, hppa-tdep.c: Fix -Wformat
+ problems.
+
+Tue Oct 23 14:16:10 2001 Andrew Cagney <cagney@redhat.com>
+
+ * somsolib.c (som_solib_add): Use core_addr_to_host_pointer.
+ (som_solib_desire_dynamic_linker_symbols): Compare integers with
+ zero not NULL.
+ * hp-psymtab-read.c (hpread_call_pxdb): Make parameter constant.
+
+2001-10-21 Andrew Cagney <ac131313@redhat.com>
+
+ * top.c (print_gdb_version): Do not print ``(MI_OUT)''. MI
+ interface is always enabled.
+
+2001-10-21 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Replace top.h with $(top_h). Replace expression.h
+ with $(expression_h). Replace command.h with $(command_h).
+ (language_h): Define. Replace language.h with $(language_h).
+ Replace call-cmds.h with $(call_cmds_h). Replace varobj.h with
+ $(varobj_h).
+ (wrapper_h, valprint_h, objfiles_h, complaints_h): Ditto.
+ (serial_h, hpread_h, buildsym_h, stabsread_h): Ditto.
+ (xcoffsolib_h, gdb_stabs_h, linespec_h): Ditto.
+ (bcache_h, gdb_events_h, monitor_h): Ditto.
+ (ser_unix_h, source_h): Ditto.
+ (varobj_h): Update list.
+
+ * call-cmds.h: Add CALL_CMDS_H macro wrapper.
+ * solist.h: Add SOLIST_H macro wrapper.
+ * monitor.h: Add MONITOR_H macro wrapper.
+ * typeprint.h: Add TYPEPRINT_H macro wrapper.
+ * xcoffsolib.h: Add XCOFFSOLIB_H macro wrapper.
+ * valprint.h: Add VALPRINT_H macro wrapper.
+ * top.h: Add TOP_H macro wrapper.
+
+2001-10-21 Andrew Cagney <ac131313@redhat.com>
+
+ * config/a29k/tm-vx29k.h, i386-tdep.c: Include "value.h".
+ * arm-tdep.c, exec.c, ia64-tdep.c, infrun.c: Ditto.
+ * ppc-linux-tdep.c, remote-es.c, remote.c: Ditto.
+ * rs6000-tdep.c, s390-tdep.c, x86-64-tdep.c: Ditto.
+ * Makefile.in (arm-tdep.o, exec.o, i386-tdep.o, ia64-tdep.o)
+ (infrun.o, ppc-linux-tdep.o, remote.o, rs6000-tdep.o)
+ (x86-64-tdep.o): Update dependencies.
+ * gdbarch.sh [!GDB_MULTI_ARCH]: Include "value.h".
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2001-10-21 Mark Kettenis <kettenis@gnu.org>
+
+ * infptrace.c (child_xfer_memory): Fix a few coding standards
+ violations.
+
+2001-10-21 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/README: Fix a typo and tweak for GDB 5.1.
+
+2001-10-20 Andrew Cagney <ac131313@redhat.com>
+
+ * jv-lang.h: Add #ifndef JV_LANG_H wrapper.
+ (struct value): Add opaque declaration. Replace value_ptr with
+ ``struct value *''.
+ * jv-valprint.c, jv-lang.c: Replace value_ptr with equivalent
+ struct.
+
+ * wrapper.h (struct value): Add opaque declaration. Replace
+ value_ptr with ``struct value *''.
+ * wrapper.c: Replace value_ptr with ``struct value *''.
+ * breakpoint.h, breakpoint.c: Ditto.
+ * cp-abi.h, hpacc-abi.c, gnu-v2-abi.c, cp-abi.c: Ditto.
+
+2001-10-20 Andrew Cagney <ac131313@redhat.com>
+
+ * alpha-nat.c: Include <alpha/coreregs.h> instead of
+ <machine/reg.h>.
+ (fetch_osf_core_registers): Define core_reg_mapping in a way that
+ works on OSF5 as well as previous OSF versions.
+
+2001-10-20 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (handle_load_dll): Avoid strlwr'ing loaded DLLs or cygwin
+ may not be able to read them in certain situations.
+
+2001-10-18 Andrew Cagney <ac131313@redhat.com>
+
+ * config/powerpc/nbsd.mt (SIM_OBS, SIM): Define.
+ * config/powerpc/linux.mt (SIM, SIM_OBS): Ditto
+
+2001-10-18 Andrew Cagney <ac131313@redhat.com>
+
+ * README: Mention problems with HP/UX.
+
+2001-10-16 Andrew Cagney <ac131313@redhat.com>
+
+ Based on code by John Moore <jmore@redhat.com>:
+
+ * utils.c (core_addr_to_string): New function for conversion of
+ CORE_ADDR to string.
+ (string_to_core_addr): New function to convert from string to
+ CORE_ADDR.
+ * defs.h: Added extern statements for the above.
+
+2001-10-17 Jason Molenda (jason-cl@molenda.com)
+
+ * symtab.c (lookup_block_symbol): Break out of linear search
+ if we're past the range of possible matches.
+
+2001-10-16 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (safe_symbol_file_add_stub): Improve logic for avoiding
+ load of already loaded DLL.
+ (register_loaded_dll): Convert loaded DLL name to "posix" format or it
+ will confuse subsequent opening of the filename due to dos paths.
+ (dll_symbol_command): Pass from_tty parameter to safe_symbol_file_add.
+
+2001-10-15 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.c (lookup_block_symbol): Update comment.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * value.h (value_as_address): Rename value_as_pointer.
+ * eval.c, findvar.c, gnu-v2-abi.c, gnu-v3-abi.c, jv-lang.c,
+ jv-valprint.c, printcmd.c, stack.c, top.c, valarith.c, valops.c,
+ values.c: Update.
+
+202001-10-15 Jim Ingham <jingham@inghji.apple.com>
+
+ * valarith.c (value_sub): Don't pass a raw type to
+ value_from_pointer, it has to go through check_typedef first.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (fallbackdefault): Set to one when predefault is
+ empty.
+ * gdbarch.h: Regenerate.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * mips-tdep.c (mips_integer_to_address): New function.
+ (mips_gdbarch_init): Initialize pointer_to_address,
+ address_to_pointer and integer_to_address.
+
+ * config/mips/tm-mips.h (POINTER_TO_ADDRESS): Delete
+ (ADDRESS_TO_POINTER): Delete.
+
+ * d10v-tdep.c (d10v_integer_to_address): New function.
+ (d10v_gdbarch_init): Initialize integer_to_address.
+
+ * values.c (value_as_pointer): Use INTEGER_TO_ADDRESS when
+ available.
+
+ * gdbarch.sh (INTEGER_TO_ADDRESS): New predicate and function.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2001-10-14 Mark Kettenis <kettenis@gnu.org>
+
+ * config/s390/nm-linux.h: Don't include <signal.h>.
+ (lin_lwp_attach_lwp, ATTACH_LWP, lin_thread_get_thread_signals,
+ GET_THREAD_SIGNAL): Remove.
+
+ * config/nm-linux.h (struct objfile): Remove forward declaration.
+ (linuxthreads_new_objfile): Remove prototype.
+ (linuxthreads_pid_to_str): Remove prototype.
+ (PREPARE_TO_PROCEED): Redefine in terms of
+ lin_lwp_prepare_to_proceed.
+ (struct target_waitstatus): Forward declaration.
+ (child_wait): New prototype.
+ (CHILD_WAIT): Define.
+ (lin_lwp_attach_lwp, ATTACH_LWP, lin_thread_get_thread_signals,
+ GET_THREAD_SIGNAL): Moved here from arch-specific files.
+ * config/alpha/nm-linux.h, config/arm/nm-linux.h,
+ config/ia64/nm-linux.h, config/mips/nm-linux.h,
+ config/powerpc/nm-linux.h: Don't include <signal.h>.
+ (lin_lwp_attach_lwp, ATTACH_LWP, lin_thread_get_thread_signals,
+ GET_THREAD_SIGNAL): Remove.
+ * config/i386/nm-linux.h: Likewise.
+ (struct target_waitstatus, child_wait, CHILD_WAIT): Remove.
+ * config/m68k/linux.mh, config/sparc/linux.mh (NATDEPFILES):
+ Remove linux-thread.o. Add proc-service.o, thread-db.o and
+ lin-lwp.o.
+ (LOADLIBES): New variable.
+
+ * sparc-nat.c (fetch_core_registers): Remove redundant prototype.
+
+ * proc-service.c (BUILD_LWP): Redefine in terms of ptid_build.
+
+ Fix attaching to cloned processes. This fixes PR gdb/61.
+ * lin-lwp.c (struct lwp_info): Add new member `cloned'.
+ (is_cloned) Removed.
+ (lin_lwp_attach_lwp): Don't call stop_wait_callback. Instead call
+ waitpid explicitly. Mark the LWP as cloned if waitpid fails and
+ retry with __WCLONE flag.
+ (lin_lwp_attach): Likewise. Warn if attaching to a cloned process.
+ (detach_callback): Replace use of is_cloned with explicit check on
+ LWP id and process id.
+ (stop_wait_callback): Replace use of is_cloned with check if LWP
+ is marked as cloned.
+ [CHILD_WAIT] (child_wait): New function.
+ (lin_lwp_wait): Replace use of is_cloned with check if LWP is
+ marked as cloned. Mark newly detected LWPs as cloned if detected
+ by waitpid with __WCLONE flag.
+ (kill_wait_callback): Replace use of is_cloned with check if LWP
+ is marked as cloned.
+ * config/i386/nm-linux.h (struct target_waitstatus): Add forward
+ declaration.
+ (child_wait): Add prototype.
+ (CHILD_WAIT): Define.
+
+2001-10-13 Andrew Cagney <ac131313@redhat.com>
+
+ S/390 31 & 64 bit target and GNU/Linux native support.
+ Contributed by D.J. Barrow <djbarrow@de.ibm.com> of IBM.
+ * s390-nat.c, s390-tdep.c: New file.
+ * config/s390/nm-linux.h, config/s390/s390.mh: New file.
+ * config/s390/s390.mt, config/s390/s390x.mt: New file.
+ * config/s390/tm-linux.h, config/s390/tm-s390.h: New file.
+ * config/s390/xm-linux.h: New file.
+ * NEWS: Update.
+ * MAINTAINERS: Update.
+
+2001-10-13 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-07-09 D.J. Barrow <djbarrow@de.ibm.com>:
+ * gdbarch.sh: Fixed CALL_DUMMY_BREAKPOINT_OFFSET to check
+ CALL_DUMMY_BREAKPOINT_OFFSET_P.
+ * gdbarch.c: Regenerate.
+
+2001-10-13 Mark Kettenis <kettenis@gnu.org>
+
+ * thread-db.c: Fix a few formatting mistakes.
+
+2001-10-12 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (safe_symbol_file_add_stub): Properly initialize linked
+ list pointer to beginning rather than one beyond beginning.
+
+2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.h (struct block): (ALL_BLOCK_SYMBOLS): New macro.
+
+ * symtab.c (find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS.
+ (make_symbol_completion_list): Likewise.
+ (make_symbol_overload_list): Likewise.
+ * buildsym.c (finish_block): Likewise.
+ * breakpoint.c (get_catch_sals): Likewise.
+ * mdebugread.c (mylookup_symbol): Likewise.
+ * objfiles.c (objfile_relocate): Likewise.
+ * printcmd.c (print_frame_args): Likewise.
+ * stack.c (print_block_frame_locals): Likewise.
+ (print_block_frame_labels): Likewise.
+ (print_frame_arg_vars): Likewise.
+ * symmisc.c (dump_symtab): Likewise.
+ * tracepoint.c (add_local_symbols): Likewise.
+ (scope_info): Likewise.
+
+2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * minsyms.c (msymbol_hash): Use better hash function.
+ (msymbol_hash_iw): Likewise. Terminate loop at '(' properly.
+
+ * objfiles.h: Increase MINIMAL_SYMBOL_HASH_SIZE to match modern
+ binaries.
+
+2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * printcmd.c (print_frame_args): Move symbol iteration explicitly
+ inside the func != NULL block.
+
+2001-10-12 Fernando Nasser <fnasser@redhat.com>
+
+ * MAINTAINERS (Misc): Add Ian Roxborough as tcl/, tk/ and itcl/
+ maintainer.
+
+2001-10-12 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * config/i386/tm-cygwin.h: Include tm-i386.h instead of tm-i386v.h.
+ This fixes errors in "long long" handling for 'finish' and 'return'
+ commands.
+
+2001-10-12 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (safe_symbol_file_add_stub): Avoid adding a shared
+ library if it has already been loaded.
+ (safe_symbol_file_add_cleanup): Don't mess with stderr or we won't see
+ any error messages.
+ (safe_symbol_file_add): Ditto.
+ (solib_symbols_add): Make static. Accept 'from_tty' parameter. Pass
+ it to safe_symbol_file_add.
+ (core_dll_symbols_add): Accomodate extra solib_symbols_add parameter.
+ (child_solib_add): Ditto.
+
+ * win32-nat.c (handle_exception): Don't print "first chance"
+ exceptions.
+ (get_child_debug_event): Continue from exceptions if !handle_exception.
+
+2001-10-11 Tom Tromey <tromey@redhat.com>
+
+ * symtab.c (lookup_symtab): Removed.
+ (lookup_symtab_1): Renamed to lookup_symtab.
+
+2001-10-10 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (get_child_debug_event): Close file handles created after
+ process creation and DLL load.
+ (child_create_inferior): Close unneeded process/thread handle after
+ thread creation.
+
+2001-10-10 Jim Blandy <jimb@redhat.com>
+
+ * mn10300-tdep.c (mn10300_analyze_prologue): Doc fixes.
+
+2001-10-10 Keith Seitz <keiths@redhat.com>
+
+ * varobj.c (cplus_value_of_child): Deal with a failure
+ to dereference a pointer object.
+
+2001-10-08 J. Brobecker <brobecker@gnat.com>
+
+ * hpux-thread.c: rewrite find_active_thread() and find_tcb()
+ to use ptid_t, instead of overloading the thread and the pid
+ into the same 32-bit value. Make associated necessary adaptations.
+ Also remove unused variable cached_active_thread.
+
+2001-10-08 Nicholas Duffek <nsd@redhat.com>
+
+ * MAINTAINERS (powerpc, SCO/Unixware, Solaris/x86): Remove my
+ entries.
+
+2001-10-06 Mark Kettenis <kettenis@beast.freebsd.org>
+
+ * config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Define.
+
+2001-10-04 Tom Tromey <tromey@redhat.com>
+
+ * main.c (enable_external_editor): Don't declare.
+ (captured_main): Don't set enable_external_editor.
+
+2001-10-02 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (ALLDEPFILES): Add solib-svr4.c and solib-sunos.c
+ to this list.
+ (solib-sunos.o): Add dependencies.
+ (solib-svr4.o): Revise dependencies.
+ * solib-svr4.c: Remove SunOS shared library support.
+ * solib-sunos.c: New file, created from solib-svr4.c, which still
+ contains SunOS shared library support, but no SVR4 support.
+
+ * config/i386/nbsd.mh (NATDEPFILES): Remove solib-svr4.o and
+ solib-legacy.o from this list. Add solib-sunos.o.
+ * config/i386/sun386.mt (TDEPFILES): Likewise.
+ * config/m68k/nbsd.mh (NATDEPFILES): Likewise.
+ * config/m68k/sun2os4.mt (TDEPFILES): Likewise.
+ * config/m68k/sun3os4.mt (TDEPFILES): Likewise.
+ * config/ns32k/nbsd.mh (NATDEPFILES): Likewise.
+ * config/sparc/nbsd.mh (NATDEPFILES): Likewise.
+ * config/sparc/sun4os4.mt (TDEPFILES): Likewise.
+
+2001-10-01 Elena Zannoni <ezannoni@redhat.com>
+
+ * Makefile.in (mipsread.o): Remove old dependency on partial-stab.h.
+
+2001-10-01 Elena Zannoni <ezannoni@redhat.com>
+
+ * xcoffread.c (N_UNDF, N_ABS, N_TEXT, N_DATA, N_BSS, N_COMM, N_FN,
+ N_EXT, N_INDR, N_SETA, N_SETT, N_SETD, N_SETB, N_SETV,
+ CUR_SYMBOL_TYPE, CUR_SYMBOL_VALUE, START_PSYMTAB, END_PSYMTAB,
+ SET_NAMESTRING): Delete definitions.
+ Don't include language.h any more.
+ Don't include partial-stab.h any more.
+ (scan_xcoff_symtab): Don't jump through hoops to reuse code in
+ partial-stab.h, include the code directly, instead.
+
+ * Makefile.in (xcoffread.o): Remove dependency on partial-stab.h.
+
+2001-10-01 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (do_registers_info): Delete code dumping large
+ registers. Handled by val_print.
+
+2001-09-30 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (gdbarch_alloc): Name the new architecture
+ ``current_gdbarch'' so that it, and not the identically named
+ global is refered to by macros.
+ * gdbarch.c: Regenerate.
+
+2001-09-29 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c (add_set_boolean_cmd): Define.
+ * cli/cli-decode.h (add_set_boolean_cmd): Declare.
+ * command.h (add_set_boolean_cmd): Ditto.
+ * remote.c (_initialize_remote): Use add_set_boolean_cmd for "set
+ remotebreak"
+
+2001-09-29 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (gdbarch_dump): Sort output.
+ * gdbarch.c: Regenerate.
+
+2001-09-29 Andrew Cagney <ac131313@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Don't use the previous
+ architecture to infer the wordsize. Previous architecture may not
+ be a PowerPC.
+
+2001-09-27 J. Brobecker <brobecker@gnat.com>
+
+ * infttrace.c (kill_inferior): Issue a TT_PROC_EXIT request rather
+ than a TT_PROC_STOP request to kill the inferior and its child
+ processes. Otherwise, the inferior is not killed on HPUX 11.0.
+ Removed the code that detaches the child processes since we just
+ killed them.
+
+2001-09-26 Andrew Cagney <ac131313@redhat.com>
+
+ * serial.c (serial_set_cmdlist, serial_show_cmdlist): New
+ variables.
+ (serial_set_cmd, serial_show_cmd): New functions.
+ (_initialize_serial): Add "set/show serial" command.
+
+2001-09-26 Andrew Cagney <ac131313@redhat.com>
+
+ * CONTRIBUTE: Update.
+
+2001-09-26 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-svr4.h (set_solib_svr4_fetch_link_map_offsets): Add
+ argument ``gdbarch''.
+ * solib-svr4.c (SVR4_FETCH_LINK_MAP_OFFSETS): Change default value.
+ (default_svr4_fetch_link_map_offsets): Rename to
+ legacy_fetch_link_map_offsets().
+ (svr4_fetch_link_map_offsets): New function.
+ (fetch_link_map_offsets, fetch_link_map_offsets_init): Deleted.
+ (fetch_link_map_offsets_gdbarch_data): New static global.
+ (set_solib_svr4_fetch_link_map_offsets): Add argument ``gdbarch''.
+ Revise to invoke set_gdbarch_data().
+ (init_fetch_link_map_offsets): Change return type and add an
+ argument so that it may be used as a gdbarch_data initializer.
+ (_initialize_svr4_solib): Eliminate use of gdbarch swap mechanism.
+ Use gdbarch data mechanism instead.
+
+2001-09-25 Jiri Smid <smid@suse.cz>
+
+ * x86-64-linux-tdep.c (LINUX_SIGINFO_SIZE): Add.
+ (x86_64_linux_sigcontext_addr): Replace `sizeof (struct siginfo)'
+ by LINUX_SIGINFO_SIZE.
+
+2001-09-24 Andrew Cagney <ac131313@redhat.com>
+
+ * maint.c (maintenance_set_cmdlist, maintenance_show_cmdlist): New
+ variables.
+ (maintenance_set_profile_cmd): New function.
+ (maintenance_show_cmd, maintenance_set_cmd): New functions.
+ (_initialize_maint_cmds): Add "maintenance set" and "maintenance
+ show" and, commented out, "maintenance set/show profile" commands.
+
+2001-09-24 Andrew Cagney <ac131313@redhat.com>
+
+ * findvar.c (read_var_value): For LOC_INDIRECT and LOC_REF_ARG
+ convert the pointer into a CORE_ADDRs.
+
+2001-09-24 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.h (store_floating, extract_floating): Add comment
+ indicating these functions are deprecated.
+ (extract_typed_floating, store_typed_floating): Declare.
+ * doublest.c: Include "gdbtypes.h".
+ (extract_typed_floating, store_typed_floating): Define.
+
+ * stabsread.c (define_symbol): Use store_typed_floating.
+ * valarith.c (value_binop): Ditto.
+ * values.c (unpack_long): Use extract_typed_floating.
+ (unpack_double): Ditto.
+
+2001-09-24 Orjan Friberg <orjanf@axis.com>
+
+ * cris-tdep.c (reg_mode_add_sub_cmp_and_or_move_op): Fetch operand1
+ from correct register.
+
+2001-09-22 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-linux-tdep.c (STRUCT_OFFSET): Removed.
+
+2001-09-21 Jiri Smid <smid@suse.cz>
+
+ * config/i386/x86-64linux.mh: New file.
+ * config/i386/x86-64linux.mt: New file.
+ * config/i386/nm-x86_64.h: New file.
+ * x86-64-linux-tdep.c: New file.
+ * x86-64-linux-nat.c: New file.
+ * x86-64-tdep.c: New file.
+ * x86-64-tdep.h: New file.
+ * i386-tdep.h: New file.
+ * i387-nat.c: Include i386-tdep.h when multiarch.
+ * i387-tdep.c: Ditto.
+ * config/djgpp/fnchange.lst: Add entries for x86_64-linux-tdep.c
+ and x86_64-linux-nat.c
+ * Makefile.in: Add x86_64-linux-tdep.o, x86_64-tdep.o,
+ x86_64-linux-tdep.o, x86_64-nat.o, update dependencies.
+
+2001-09-21 Jiri Smid <smid@suse.cz>
+
+ * MAINTAINERS: Add myself to the write-after-approval list.
+ * i386-nat.c (TARGET_HAS_DR_LEN_8, DR_LEN_8): Declare.
+ (i386_length_and_rw_bits, i386_handle_nonaligned_watchpoint,
+ i386_insert_watchpoint, i386_remove_watchpoint): Add support for
+ 8-byte wide watchpoints.
+ (i386_show_dr): Debug message format string change.
+
+2001-09-21 Michael Snyder <msnyder@redhat.com>
+
+ * c-exp.y (typebase): Accept (signed long long) as a type expr.
+
+2001-09-20 Michael Snyder <msnyder@redhat.com>
+ Changes by Daniel Berlin <dan@cgsoftware.com>, to support
+ better parsing of const and volatile type expressions.
+ * c-exp.y (const_and_volatile, const_or_volatile_noopt,
+ const_or_volatile): New non-terminals.
+ (ptype): Use new rule for const_or_volatile.
+ (typebase): Use new rule for const_or_volatile_noopt.
+ * parser-defs.h (enum type_pieces): New values tp_const, tp_volatile.
+ * parse.c (follow_types): Handle tp_const and tp_volatile on the
+ type stack: call make_cv_type to create new const/volatile type.
+
+2001-09-20 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-svr4.c (fetch_link_map_offsets): Add comment.
+ (fetch_link_map_offsets_init): New static global.
+ (set_solib_svr4_fetch_link_map_offsets, init_fetch_link_map_offsets):
+ Revise implementation to use ``fetch_link_map_offsets_init''
+ instead of ``fetch_link_map_offsets''.
+
+2001-09-20 Alan Modra <amodra@bigpond.net.au>
+
+ * coffread.c: Replace all occurrences of bfd_read with bfd_bread.
+ * dbxread.c: Likewise.
+ * dwarf2read.c: Likewise.
+ * dwarfread.c: Likewise.
+ * somread.c: Likewise.
+ * ultra3-nat.c: Likewise.
+ * xcoffread.c: Likewise.
+
+2001-09-19 Andrew Cagney <ac131313@redhat.com>
+
+ * cris-tdep.c (cris_get_signed_offset): Change return type to an
+ explicitly signed char.
+
+ * config/mcore/tm-mcore.h (mcore_virtual_frame_pointer): Update
+ function signature to match recent tracepoint.c:encode_actions
+ changes.
+ * mcore-tdep.c (mcore_virtual_frame_pointer): Ditto.
+
+2001-09-18 Andrew Cagney <ac131313@redhat.com>
+
+ * thread.c (do_captured_thread_select): Add uiout parameter.
+ (do_captured_list_thread_ids): Ditto.
+ * breakpoint.c (do_captured_breakpoint_query): Ditto.
+
+ * breakpoint.c (gdb_breakpoint_query): Update. Use
+ catch_exceptions.
+ * thread.c (gdb_list_thread_ids): Ditto.
+ (gdb_thread_select): Ditto.
+ (thread_command): Pass uiout to gdb_thread_select.
+
+ * gdb.h (gdb_breakpoint_query): Add parameter ui_out.
+ (gdb_thread_select, gdb_list_thread_ids): Ditto.
+
+2001-09-13 Kevin Buettner <kevinb@redhat.com>
+
+ From Ilya Golubev <gin@mo.msk.ru>:
+ * solib.c (clear_solib): Call `remove_target_sections' to fix
+ stale pointers in `struct target_ops'.
+ * irix5-nat.c (clear_solib): Likewise.
+ * osfsolib.c (clear_solib): Likewise.
+
+2001-09-13 Jim Blandy <jimb@redhat.com>
+
+ * monitor.c (monitor_load): Don't delete symtab users, or reset
+ inferior_ptid.
+
+ * monitor.c (monitor_load): Fix indentation.
+
+2001-09-11 Jim Blandy <jimb@redhat.com>
+
+ * printcmd.c (print_scalar_formatted): Compare the length of the
+ value against the lengths of the target's floating-point types,
+ not the host's. Add support for `long double'.
+
+ * printcmd.c (print_scalar_formatted): Fix indentation.
+
+2001-09-10 Jim Blandy <jimb@redhat.com>
+
+ * rom68k-rom.c (init_rom68k_cmds): Set the flag indicating that
+ programs running on the board can produce output.
+
+2001-09-10 Jason Molenda (jmolenda@apple.com)
+
+ * NEWS: "ANS/ISO C" -> "ISO C".
+ * MAINTAINERS (write-after-approval): Update my entry.
+
+2001-09-08 Mark Kettenis <kettenis@gnu.org>
+
+ * config/xm-aix4.h (MEM_FNS_DECLARED): Removed.
+
+ * config/arm/xm-linux.h, config/ia64/xm-linux.h,
+ config/m68k/xm-linux.h, config/mips/xm-linux.h,
+ config/powerpc/xm-linux.h, config/sparc/xm-linux.h: Remove
+ redundant inclusion of <unistd.h>.
+
+ * gdbtypes.h (struct block): Add forward declaration.
+
+2001-09-07 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (enum return_reason): Renumber so that all values are
+ negative.
+ (RETURN_MASK): Negate reason.
+ (catch_exception_ftype): Declare.
+ (catch_exceptions): Declare.
+ * top.c (catcher): New function, based on catch_errors. Add in
+ parameter func_uiout and out parameters func_val, func_caught and
+ func_cleanup. Change type of func to catch_exceptions_ftype.
+ Save/restore uiout.
+ (struct catch_errors_args): Define.
+ (do_catch_errors): New function.
+ (catch_errors): Rewrite, use do_catch_errors and catcher.
+ (catch_exceptions): New function, use catcher.
+
+2001-09-07 Jim Blandy <jimb@redhat.com>
+
+ Correctly parse register values provided by the monitor.
+ * rom68k-rom.c: #include "value.h".
+ (is_hex_digit, hex_digit_value, is_whitespace,
+ rom68k_supply_one_register): New static functions.
+ (rom68k_supply_register): Call rom68k_supply_one_register, instead
+ of monitor_supply_register; the latter was incorrectly parsing
+ the values.
+ * Makefile.in (rom68k-rom.o): Note that this now #includes value.h.
+
+2001-09-07 Mark Kettenis <kettenis@gnu.org>
+
+ * config/rs6000/xm-rs6000.h (setpgrp): Remove macro. GDB defaults
+ to using setpgid if available now.
+
+2001-09-06 Keith Seitz <keiths@redhat.com>
+
+ From Ian Roxborough <irox@redhat.com>
+ * configure.in: Use ITCL_LIB_FULL_PATH and
+ ITK_LIB_FULL_PATH to set Itcl and Itk dependancies
+ for gdb.
+ * configure: Regenerated.
+
+2001-09-06 Kevin Buettner <kevinb@redhat.com>
+
+ * dbxread.c (process_one_symbol): Don't use error result from
+ find_stab_function_addr().
+ * partial-stab.h (case 'F'): Likewise.
+
+ * partial-stab.h (case 'f'): Make SOFUN_ADDRESS_MAYBE_MISSING
+ code match that used for case 'F'. This fixes the divergence
+ that was introduced by my 1999-09-14 changes to partial-stab.h.
+
+2001-09-05 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbarch.sh: Move include of dis-asm.h so it is generated earlier
+ in gdbarch.h.
+ (TARGET_PRINT_INSN): Multiarch.
+ * gdbarch.h: Regenerate.
+ * gdbarch.c: Regenerate.
+
+ * arch-utils.c (legacy_print_insn): New function.
+ * arch-utils.h (legacy_print_insn): Export.
+
+ * cris-tdep.c (cris_delayed_get_disassembler): Use
+ TARGET_PRINT_INSN, instead of tm_print_insn.
+ * d10v-tdep.c (print_insn): Ditto.
+ * d30v-tdep.c (print_insn): Ditto.
+ * m32r-tdep.c (dump_insn): Ditto.
+ * v850-tdep.c (v850_scan_prologue): Ditto.
+ * mcore-tdep.c (mcore_dump_insn): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Set print_insn gdbarch field.
+
+2001-09-05 Jim Blandy <jimb@redhat.com>
+
+ * gdbtypes.h (struct type): Doc fix.
+
+2001-09-04 Elena Zannoni <ezannoni@redhat.com>
+
+ From Daniel Jacobowitz <drow@mvista.com>
+ * dbxread.c (free_header_files): Make global.
+ (init_header_files): Likewise.
+ * stabsread.h (free_header_files): Add prototype.
+ (init_header_files): Likewise.
+ * mdebugread.c (mdebug_build_psymtabs): Initialize
+ properly before using the stabs debug reader.
+
+2001-09-04 Elena Zannoni <ezannoni@redhat.com>
+
+ From Daniel Jacobowitz <drow@mvista.com>
+ * dbxread.c (dbx_symfile_read): Only reinitialize
+ the psymbol list if mainline or if both static
+ and global lists are empty.
+ * dwarf2read.c (dwarf2_build_psymtabs): Likewise.
+ * dwarfread.c (dwarf_build_psymtabs): Likewise.
+ * xcoffread.c (xcoff_initial_scan): Likewise.
+ * os9kread.c (os9k_symfile_read): Likewise.
+
+2001-09-04 Elena Zannoni <ezannoni@redhat.com>
+
+ From Daniel Jacobowitz <drow@mvista.com>
+ * mdebugread.c (psymtab_to_symtab_1): Handle N_SO stabs without
+ a name specially.
+
+2001-09-01 Mark Kettenis <kettenis@gnu.org>
+
+ Make GDB use libiberty regex implementation.
+ * gdb_regex.h: Normalize protection against multiple inclusion.
+ Include "xregex.h" instead of "gnu-regex.h".
+ * cli/cli-cmds.c: Include "gdb_regex.h" instead of "gnu-regex.h".
+ * cli/cli-decode.c: Likewise.
+ * Makefile.in (REGEX): Remove.
+ (GDB_CFLAGS): Remove reference to gnu-regex.h in comment.
+ (ADD_FILES, ADD_DEPS): Remove $(REGEX).
+ (POSSLIBS): Remove.
+ (TAGFILES_NO_SRCDIR): Remove $(POSSLIBS).
+ (irix5-nat.o, solib.o, solib-svr4.o, source.o, symtab.o,
+ xcoffsolib.o, cli-decode.o, cli-cmd.o): Replace gnu-regex.h with
+ gdb_regex.h in list of dependencies.
+ (gnu-regex.o): Remove rule.
+ * gnu-regex.c, gnu-regex.h: Remove files.
+
+2001-08-31 Jason Molenda (jmolenda@apple.com)
+
+ * c-valprint.c (c_val_print): Second call to check_typedef ()
+ is no longer necessary.
+
+2001-08-31 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (examine_prologue): Don't let a branch unit nop
+ terminate the prologue scan.
+
+2001-08-30 Jim Blandy <jimb@redhat.com>
+
+ * symfile.c (sections_overlap): New function.
+ (map_overlay_command): Call sections_overlap, instead of using
+ incorrect logic to recognize overlapping sections.
+
+ * symfile.c (load_command): Invalidate the overlay cache.
+
+2001-08-30 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/xm-i386.h (HOST_BYTE_ORDER): Removed.
+
+2001-08-29 Kevin Buettner <kevinb@redhat.com>
+
+ From 2001-08-07 Daniel Jacobowitz <drow@mvista.com>:
+ * solib-svr4.c (enable_break): Check the inferior link map
+ before assuming the inferior PC is at the start of the dynamic
+ loader.
+
+2001-08-28 Andrew Cagney <cagney@toribio.toronto.redhat.com>
+
+ * frame.h (struct frame_info): Fix documentation on fields
+ saved_regs, next and prev.
+
+2001-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * event-top.c (async_stop_sig) [HAVE_SIGPROCMASK]: Some
+ gratuitious whitespace changes.
+ [!HAVE_SIGPROCMASK]: Call sigsetmask if HAVE_SIGSETMASK is defined.
+ * top.c: Remove redundant logic to define HAVE_SIGSETMASK.
+ (sigsetmask) Don't define macro.
+ (stop_sig) [HAVE_SIGPROCMASK]: Add bit of code snatched from
+ async_stop_sig from event-top.c.
+ [!HAVE_SIGPROCMASK]: Call sigsetmask if HAVE_SIGSETMASK is
+ defined.
+ * configure.in (AC_CHECK_FUNCS): Put functions in alphabetical
+ order. Add sigsetmask.
+ (AC_FUNC_VFORK, AC_FUNC_ALLOCA): Reorder such that they're in
+ alphabetical order.
+ * config/xm-aix4.h, config/alpha/xm-alphalinux.h,
+ config/i386/xm-cygwin.h, config/rs6000/xm-rs6000.h
+ (HAVE_SIGSETMASK): Remove.
+ * aclocal.m4, config.in, configure: Regenerated.
+
+2001-08-26 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-06-29 Andrew Cagney <ac131313@redhat.com>:
+ * config/powerpc/nbsd.mh (XM_FILE): Delete.
+
+2001-08-21 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.h (HOST_FLOAT_FORMAT): Delete macro.
+ (HOST_DOUBLE_FORMAT): Delete macro.
+
+2001-08-24 Mark Kettenis <kettenis@gnu.org>
+
+ * config/xm-lynx.h, config/xm-nbsd.h, config/xm-sysv4.h,
+ config/i386/xm-i386aix.h, config/m68k/xm-dpx2.h: Remove redundant
+ inclusion of <limits.h>.
+
+2001-08-24 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (read_register_bytes): When REGISTER_NAME indicates
+ that a register should be ignored, supply a value for the register
+ from the raw registers[] buffer.
+
+2001-08-24 Andrew Cagney <ac131313@redhat.com>
+
+ * go32-nat.c (go32_create_inferior): Use xfree instead of free.
+ * config/djgpp/fnchange.lst: Add entries for i386bsd-tdep.c and
+ i386bsd-nat.c.
+
+2001-08-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.h (builtin_type_ieee_single_big)
+ (builtin_type_ieee_single_little, builtin_type_ieee_double_big)
+ (builtin_type_ieee_double_little)
+ (builtin_type_ieee_double_littlebyte_bigword)
+ (builtin_type_i387_ext, builtin_type_m68881_ext)
+ (builtin_type_i960_ext, builtin_type_m88110_ext)
+ (builtin_type_m88110_harris_ext, builtin_type_arm_ext_big)
+ (builtin_type_arm_ext_littlebyte_bigword)
+ (builtin_type_ia64_spill_big, builtin_type_ia64_spill_little)
+ (builtin_type_ia64_quad_big)
+ (builtin_type_ia64_quad_little): Declare.
+ * gdbtypes.c (builtin_type_ieee_single_big)
+ (builtin_type_ieee_single_little, builtin_type_ieee_double_big)
+ (builtin_type_ieee_double_little)
+ (builtin_type_ieee_double_littlebyte_bigword)
+ (builtin_type_i387_ext, builtin_type_m68881_ext)
+ (builtin_type_i960_ext, builtin_type_m88110_ext)
+ (builtin_type_m88110_harris_ext, builtin_type_arm_ext_big)
+ (builtin_type_arm_ext_littlebyte_bigword)
+ (builtin_type_ia64_spill_big, builtin_type_ia64_spill_little)
+ (builtin_type_ia64_quad_big)
+ (builtin_type_ia64_quad_little): Define.
+ (_initialize_gdbtypes): Initialize builtin floatformat types.
+
+2001-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * tracepoint.c (read_actions): Add FIXME for code depending on
+ STOP_SIGNAL.
+
+2001-08-23 Martin M. Hunt <hunt@redhat.com>
+
+ * remote-mips.c (pmon_load_fast): Add ui_load_progress_hook
+ to download loop.
+ (mips_load_srec): Ditto.
+
+2001-08-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.c (build_gdbtypes): Initialize TYPE_FLOATFORMAT field
+ of builtin_type_float, builtin_type_double and
+ builtin_type_long_double.
+ (recursive_dump_type): Print the floatformat name.
+ * gdbtypes.h (struct type): Add type_specific field floatformat.
+ (TYPE_FLOATFORMAT): Define
+
+2001-08-21 Keith Seitz <keiths@redhat.com>
+
+ * printcmd.c (print_insn): Use the given stream for
+ output.
+
+2001-07-24 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c (convert_from_extended, convert_to_extended): Delete
+ assembler version of function.
+ (convert_from_extended, convert_to_extended): Rewrite. Use
+ floatformat_to_doublest, floatformat_from_doublest,
+ floatformat_arm_ext_big, floatformat_arm_ext_littlebyte_bigword.
+ (arm_push_arguments): Use extract_floating and store_floating to
+ perform floating point conversions.
+ (SWAP_TARGET_AND_HOST): Delete macro.
+ * arm-linux-tdep.c (arm_linux_push_arguments): Use
+ extract_floating and store_floating to perform floating point
+ conversions.
+
+2001-08-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.h (struct type): Clarify meaning of field ``length''.
+
+2001-08-17 Keith Seitz <keiths@redhat.com>
+
+ * varobj.c (varobj_update): Change first parameter to
+ pointer to struct varobj*. This function can delete
+ varobjs, so we need to give callers the new varobj
+ when this happens.
+ (value_of_root): Update "var", too, if "var_handle"
+ changes.
+ * varobj.h (varobj_update): Likewise.
+
+2001-08-17 Keith Seitz <keiths@redhat.com>
+
+ * Makefile.in (varobj_h): Define.
+ (mi-cmd-var.o): Depends on varobj_h.
+ (gdbtk-varobj.o): Change varobj.h to $(varobj_h).
+
+2001-08-16 Keith Seitz <keiths@redhat.com>
+
+ * configure.in (GDBTK_SRC_DIR): We must have autoconf
+ give us the absolute path to the source directory.
+ * configure: Regenerated.
+ * Makefile.in (GDBTK_SRC_DIR): Add variable so that
+ autoconf can substitue it in for us.
+ (gdbtk.o): Pass in GDBTK_SRC_DIR instead of srcdir. We
+ really do need an absolute pathname.
+
+2001-08-15 Keith Seitz <keiths@redhat.com>
+
+ * Makefile.in (GDBTK_VERSION): Set a version number.
+ (GDBTK_LIBRARY): New variable to point to location where
+ gdbtk will install its tcl library. Changed all refereneces
+ to $(datadir)/insight1.0 to $(GDBTK_LIBRARY).
+ (SUBDIR_GDBTK_ALL): Remove "all-gdbtk". No longer needed.
+ (SUBDIR_GDBTK_CLEAN): Remove "clean-gdbtk". No longer needed.
+ (all-gdbtk): Remove.
+ (install-gdbtk): Remove.
+ (gdbtk.o): Pass srcdir to file when compiling.
+
+2001-08-15 Ian Roxborough <irox@redhat.com>
+
+ * Makefile.in: Changed all references to the install directory
+ "gdbtcl" to read "insight1.0".
+
+2001-08-15 Corinna Vinschen <vinschen@redhat.com>
+
+ * arch-utils.c (generic_skip_trampoline_code): New function.
+ * arch-utils.h (generic_skip_trampoline_code): Declare external.
+ * gdbarch.c: Regeberated from gdbarch.sh.
+ * gdbarch.h: Ditto.
+ * gdbarch.sh (SKIP_TRAMPOLINE_CODE): Multi-arch.
+ * infrun.c: Remove default setting of SKIP_TRAMPOLINE_CODE macro.
+
+2001-08-14 Daniel Jacobowitz <drow@mvista.com>
+ H.J. Lu (hjl@gnu.org)
+
+ * partial-stab.h: valu should be a CORE_ADDR.
+
+2001-08-14 H.J. Lu (hjl@gnu.org)
+
+ * dbxread.c (SWAP_SYMBOL): Removed.
+ (INTERNALIZE_SYMBOL): Check sign extended vma.
+
+2001-08-13 Christopher Faylor <cgf@cygnus.com>
+
+ * top.c (SIGSETJMP): Protect env argument with parentheses.
+ (SIGLONGJMP): Protect env argument with parentheses.
+
+2001-08-11 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mn10300/mn10300.mt (TM_FILE): Delete.
+ * configure.tgt: Add mn10300 to list of mulit-arch targets.
+ * config/mn10300/tm-mn10300.h: Delete file. Move contents ...
+ * mn10300-tdep.c: To here.
+
+2001-08-11 Andrew Cagney <ac131313@redhat.com>
+
+ * config/i386/tm-symmetry.h (REGISTER_CONVERT_TO_VIRTUAL): Make
+ val a DOUBLEST. Use floatformat_to_doublest.
+ (REGISTER_CONVERT_TO_RAW): Ditto. Use foatformat_from_doublest.
+ * config/m88k/tm-m88k.h (REGISTER_CONVERT_TO_VIRTUAL): Ditto.
+ (REGISTER_CONVERT_TO_RAW): Ditto.
+
+2001-08-11 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mn10300/tm-mn10300.h (PC_REGNUM, SP_REGNUM): Delete.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Initialize pc_regnum and
+ sp_regnum.
+
+2001-08-11 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.c (convert_doublest_to_floatformat): Rename
+ floatformat_from_doublest. Make static.
+ (convert_floatformat_to_doublest): Rename floatformat_to_doublest.
+ Make static.
+ (floatformat_to_doublest): New function.
+ (floatformat_from_doublest): New function.
+ (host_float_format, host_double_format, host_long_double_format):
+ New static variables.
+ (store_floating, extract_floating): Always use
+ floatformat_to_doublest and floatformat_from_doublest.
+ * doublest.h (HOST_LONG_DOUBLE_FORMAT): Delete macro.
+
+2001-08-11 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mn10300/tm-mn10300.h (INIT_FRAME_PC): Delete.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Initialize init_frame_pc.
+
+2001-08-07 Andrew Cagney <ac131313@redhat.com>
+
+ * target.h (TARGET_VIRTUAL_FRAME_POINTER): Delete, multi-arched.
+ * gdbarch.sh (TARGET_VIRTUAL_FRAME_POINTER): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * arch-utils.h (legacy_virtual_frame_pointer): Declare.
+ * arch-utils.c: Include "gdb_assert.h".
+ (legacy_virtual_frame_pointer): Define.
+ * Makefile.in (arch-utils.o): Depends on gdb_assert.h.
+
+ * tracepoint.c (encode_actions): Make frame_reg an int. Make
+ frame_offset a LONGEST.
+ * ax-gdb.c (gen_frame_args_address): Ditto.
+ (gen_frame_locals_address): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Initialize
+ virtual_frame_pointer.
+ (mn10300_virtual_frame_pointer): Make static. Update parameter
+ list to match function signature.
+ * config/mn10300/tm-mn10300.h (TARGET_VIRTUAL_FRAME_POINTER): Delete.
+
+2001-08-10 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Add architecture_changed event.
+ * gdbarch.sh: Include gdb-event.h.
+ (gdbarch_update_p): Notify UIs when architecture changes.
+ * gdb-events.h: Regenerated.
+ * gdb-events.c: Regenerated.
+ * gdbarch.c: Regenerated.
+
+2001-08-10 Michael Snyder <msnyder@redhat.com>
+
+ * regcache.c (legacy_write_register_gen): Don't 'optimize out'
+ a write_register to a pseudo-reg. Target_store_pseudo_register
+ needs to get called, because these regs may be computed and may
+ have side-effects.
+
+2001-08-10 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Deal with event notifications with no
+ arguments.
+
+2001-08-10 Orjan Friberg <orjanf@axis.com>
+
+ * remote.c (read_frame): Correct off-by-one error in condition.
+
+2001-08-08 Don Howard <dhoward@redhat.com>
+
+ * stabsread.c (read_type): Add support for const and volatile
+ modifiers.
+
+2001-08-02 Daniel Jacobowitz <drow@mvista.com>
+
+ * core-regset.c (fetch_core_registers): Remove HAVE_GREGSET_T
+ and HAVE_FPREGSET_T checks. Use gdb_gregset_t and gdb_fpregset_t.
+
+2001-08-02 Keith Seitz <keiths@redhat.com>
+
+ * defs.h (SLASH_STRING): If not defined, set
+ to "/", regardless of _WIN32, __CYGWIN__, or
+ whatnot.
+
+2001-08-02 Mark Kettenis <kettenis@gnu.org>
+
+ * cli/cli-decode.h: Include "gdb_regex.h" instead of
+ "gnu-regex.h".
+
+ * NEWS: Update.
+
+2001-08-02 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/i386/xm-go32.h: Include xm-i386.h.
+ (HOST_BYTE_ORDER, HOST_LONG_DOUBLE_FORMAT): Remove definitions.
+
+2001-08-02 Eli Zaretskii <eliz@is.elta.co.il>
+
+ The following changes avoid polluting global namespace with the
+ `enable' and `disable' identifiers, because some platforms define
+ in their system headers symbols with global scope that go by those
+ names.
+
+ * breakpoint.h (enum enable_state): Rename from `enum enable'.
+ Also rename all the enum members to have the "bp_" prefix.
+ (struct breakpoint): Rename the `enable' member to `enable_state'.
+ (enum bpdisp): Rename all members to have the "disp_" prefix.
+
+ * breakpoint.c: All users of `enum enable' and `enum bpdisp'
+ changed.
+ (args_for_catchpoint_enable): Rename the `enable' member to
+ `enable_p'. All users changed.
+
+ * tracepoint.h (enum enable): Remove.
+ (struct tracepoint): The member `enabled' is now `int enabled_p'.
+
+ * tracepoint.c: All users of the `enabled' member changed.
+
+ * printcmd.c (struct display): The `status' member is now an int.
+
+ * memattr.h (struct mem_region): Rename the `status' member to
+ `enabled_p'.
+ (enum enable): Remove.
+
+ * memattr.c: Change all users of the `status' member of struct
+ mem_region to use `enabled_p' instead.
+
+ * infcmd.c (run_stack_dummy): Use disp_del instead of del.
+
+ * go32-nat.c: Remove the kludgey work-around for conflicts between
+ <dos.h> and "breakpoint.h".
+
+2001-08-02 Corinna Vinschen <vinschen@redhat.com>
+
+ * MAINTAINERS: Add myself to the write-after-approval list.
+ * ser-tcp.c (tcp_open): Use `localhost' as default host if no
+ hostname is given.
+
+2001-08-01 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.h (store_floating, floatformat_to_doublest): Make IN
+ paramter a const void pointer.
+ (floatformat_from_doublest): Make IN const, Make OUT a void
+ pointer.
+ * doublest.c (floatformat_to_doublest): Update.
+ (floatformat_from_doublest): Update.
+ (extract_floating): Update.
+
+2001-07-31 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+ (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+ (HOST_LONG_DOUBLE_FORMAT, DOUBLEST)
+ (floatformat_to_doublest, floatformat_from_doublest)
+ (floatformat_is_negative, floatformat_is_nan)
+ (floatformat_mantissa, store_floating)
+ (extract_floating): Move declaration from here.
+ * doublest.h: To here. New file.
+ * utils.c (get_field, floatformat_to_doublest, put_field)
+ (ldfrexp, floatformat_from_doublest, floatformat_is_negative)
+ (floatformat_is_nan, floatformat_mantissa)
+ (FLOATFORMAT_CHAR_BIT): Move from here.
+ * doublest.c: To here. New file.
+ * findvar.c (store_floating, extract_floating): Move from here.
+ * doublest.c: To here.
+ * Makefile.in (SFILES): Add doublest.c.
+ (COMMON_OBS): Add doublest.o.
+ (doublest.o): Specify dependencies.
+ (doublest_h): Define.
+
+ * config/m88k/tm-m88k.h: Include "doublest.h".
+ * config/i960/tm-i960.h: Ditto.
+ * config/i386/tm-symmetry.h: Ditto.
+ * rs6000-tdep.c, valarith.c: Ditto.
+ * valprint.c, stabsread.c, sh-tdep.c: Ditto.
+ * ia64-tdep.c, i387-tdep.c, i386-tdep.c: Ditto.
+ * values.c, arm-tdep.c, arm-linux-tdep.c: Ditto.
+ * alpha-tdep.c, ax.h, expression.h: Ditto.
+ * sh-tdep.c, parse.c, top.c, value.h: Ditto.
+
+ * Makefile.in (arm-tdep.o): Add $(doublest_h).
+ (i386-tdep.o, i387-tdep.o, ia64-tdep.o): Ditto.
+ (rs6000-tdep.o, stabsread.o, valarith.o): Ditto.
+ (values.o, valprint.o, arm-linux-tdep.o): Ditto.
+ (alpha-tdep.o, ax_h, parse.o, top.o, value_h): Ditto.
+ (parser_defs_h): Ditto.
+ (expression_h): Add $(doublest_h) and $(symtab_h).
+
+2001-08-01 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Sort header definitions.
+ (parser_defs_h, dis_asm_h, annotate_h, gdbthread_h): Define.
+ Replace parser-defs.h with $(parser_defs_h). Replace $(dis-asm_h)
+ and $(dis-asm.h) with $(dis_asm_h). Replace annotate.h with
+ $(annotate_h). Replace target.h with $(target_h). Replace
+ gdbthread.h with $(gdb_thread_h). Replace symfile.h with $(symfile_h).
+
+2001-07-31 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/xm-i386.h: New file.
+ * config/i386/xm-fbsd.h: Removed.
+ * config/i386/xm-linux.h: Removed.
+ * config/i386/fbsd.mh: Reorganize a bit.
+ (XM_FILE): Set to xm-i386.h instead of xm-fbsd.h.
+ * config/i386/linux.mh (XM_FILE): Set to xm-i386.h insread of
+ xm-linux.h.
+
+2001-07-30 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Doc fix.
+
+2001-07-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Only invoke AC_FUNC_SETPGRP if not cross-compiling.
+ Check for SETPGRP_VOID separately if cross-compiling and ISO C
+ headers are available.
+
+2001-07-30 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Redefine to call
+ i386_dwarf_reg_to_regnum.
+
+ * i386-tdep.c (i386_register_convert_to_virtual): Replace
+ assertion with a warning if we're asked to convert towards a
+ non-floating-point type. Zero out the the buffer where the data
+ is supposed to be stored in that case.
+
+2001-07-29 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/djconfig.sh: Unset CDPATH.
+
+ * go32-nat.c (get_cr3): Temporary disable support for page tables
+ in UMBs, as it is incomplete.
+
+ Support for stepping through longjmp in DJGPP programs:
+
+ * config/i386/tm-go32.h (JB_ELEMENT_SIZE, JB_PC): New macros.
+ (GET_LONGJMP_TARGET): Define to call get_longjmp_target.
+ (get_longjmp_target): Add prototype.
+
+2001-07-28 Andrew Cagney <ac131313@redhat.com>
+
+ Fix some PID/TPID fallout for HP/UX.
+ From 2001-07-22 Rodney Brown <rbrown64@csc.com.au>:
+ * infttrace.c (ptrace_wait): Match external declaration,
+ and match target_post_wait declaration.
+
+2001-07-28 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Orjan Friberg as cris target maintainer.
+ (cris): Set --enable-gdb-build-warnings flag to -w.
+
+2001-07-28 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-07-23 Andreas Schwab <schwab@suse.de>:
+ * config/m68k/tm-m68k.h (TARGET_LONG_DOUBLE_FORMAT): Define.
+ (TARGET_LONG_DOUBLE_BIT): Define.
+ (REGISTER_VIRTUAL_SIZE): Return 12 for floating point registers.
+ (MAX_REGISTER_VIRTUAL_SIZE): Increase to 12.
+ (REGISTER_VIRTUAL_TYPE): Return builtin_type_long_double for
+ floating point registers.
+ (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL)
+ (REGISTER_CONVERT_TO_RAW): Remove.
+ * config/m68k/xm-linux.h (HOST_LONG_DOUBLE_FORMAT): Define.
+
+2001-07-26 Andrew Cagney <ac131313@redhat.com>
+
+ * thread.c, breakpoint.c: Include "gdb.h".
+ * Makefile.in (gdb_h): Define.
+ (HFILES_NO_SRCDIR): Add gdb.h.
+ (mi-cmd-break.o, mi-main.o, thread.o)
+ (breakpoint.o): Add dependency on $(gdb_h).
+
+ * defs.h (enum gdb_rc, gdb_breakpoint_query)
+ (gdb_breakpoint, gdb_thread_select)
+ (gdb_list_thread_ids): Move declaration from here ...
+ * gdb.h: To here. New file.
+
+2001-07-28 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * Makefile.in (SUBDIR_TUI_OBS): Add tui-out.o, tui-hooks.o.
+ (SUBDIR_TUI_SRCS): Add tui-out.c tui-hooks.c
+ (SFILES): Likewise.
+ (tui-out.o): Define dependencies.
+ (tui-hooks.o): Likewise.
+
+2001-07-28 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Update e-mail address of active @cygnus.com
+ maintainers to @redhat.com.
+
+2001-07-28 Andrew Cagney <ac131313@redhat.com>
+
+ * README (Known bugs): Delete section.
+ (Kernel debugging): Delete section.
+ (Languages other than C): Delete section.
+ (Host/target specific installation notes) New section.
+
+2001-07-28 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM,
+ DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): New defines.
+ (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): New
+ prototypes.
+ * config/i386/tm-fbsd.h, config/i386/tm-i386gnu.h,
+ config/i386/tm-linux.h (STAB_REG_TO_REGNUM): Redefine to call
+ i386_dwarf_reg_to_regnum.
+ * i386-tdep.c (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum):
+ New functions.
+
+ * i386-tdep.c: Include "gdb_assert.h"
+ (i386_register_convert_to_virtual): Fix such that it can handle
+ conversion to any floating-point type. Assert that we are dealing
+ with a floating-point first.
+ (i386_register_convert_to_raw): Assert that TYPE is a
+ floating-point type with length 12.
+
+2001-07-27 John R. Moore <jmoore@redhat.com>
+
+ * configure.in: Added dependency of gdb on tcl/tk libraries.
+ * Makefile.in: Likewise.
+ * configure: Regenerated with the above using autoconf.
+
+2001-07-26 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_gdbarch_init): Use SH_DEFAULT_NUM_REGS instead of
+ NUM_REGS.
+ (SH_DEFAULT_NUM_REGS): Define.
+
+2001-07-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (read_memory_region): Make sure the segment limit was
+ indeed set, to work around a Windows 2000 bug.
+
+2001-07-25 Daniel Jacobowitz <drow@mvista.com>
+
+ * infptrace.c (child_xfer_memory): Add cast to CORE_ADDR.
+ * infttrace.c (child_xfer_memory): Likewise.
+ * symm-nat.c (child_xfer_memory): Likewise.
+ * gdbserver/low-hppabsd.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+ * gdbserver/low-linux.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+ * gdbserver/low-lynx.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+ * gdbserver/low-nbsd.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+ * gdbserver/low-sparc.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+ * gdbserver/low-sun3.c (read_inferior_memory): Likewise.
+ (write_inferior_memory): Likewise.
+
+2001-07-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * README: Mention how to make gdb.pdf.
+
+ * NEWS: Update.
+
+2001-07-24 Stephen P. Smith <ischis2@home.com>
+
+ * MAINTAINERS (Stephen P. Smith): Added to write after approval
+ list.
+
+2001-07-23 Andrew Cagney <ac131313@redhat.com>
+
+ * mips-tdep.c (mips_push_arguments): Add comment explaining
+ problem with LE o32 GCC.
+
+2001-07-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/powerpc/aix.mh (MH_LDFLAGS): Don't set these, the Gnu linker
+ doesn't understand them.
+
+2001-07-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * memattr.c (mem_info_command): Reformat output to look more like
+ 'info break' output.
+ (_initialize_mem): Improve help.
+
+2001-07-23 Mark Kettenis <kettenis@gnu.org>
+
+ * configure.in (AC_CHECK_FUNCS): Add setpggrp.
+ (AC_FUNC_SETPGRP): Add.
+ * aclocal.m4, configure, config.in: Regenerated.
+ * inflow.c (gdb_setpgid): Get rid of NEED_POSIX_SETPGID and
+ SETPGRP_ARGS. Always use setpgid if it is available, fall back on
+ setpgrp if it isn't. Use SETPGRP_VOID (defined by autoconf) to
+ distinguish between the two setpgrp flavours.
+ * config/xm-sysv4.h, config/arm/xm-linux.h,
+ config/i386/xm-i386aix.h, config/i386/xm-sco.h,
+ config/i386/xm-linux.h, config/i386/xm-ptx.h,
+ config/m68k/xm-linux.h, config/powerpc/xm-linux.h,
+ config/sparc/xm-linux.h, config/sparc/xm-sun4sol2.h,
+ config/ia64/xm-linux.h (NEED_POSIX_SETPGID): Remove.
+ * config/rs6000/xm-rs6000.h (SETPGRP_ARGS): Remove.
+
+2001-07-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (read_memory_region): Set the granularity bit of the
+ allocated segment according to its size, and adjust the limit to
+ be page-aligned if the segment is page-granular.
+
+ * (get_cr3, get_pde, get_pte, display_ptable_entry, go32_pde)
+ (display_page_table, go32_pte, go32_pte_for_address): New functions.
+ (_initialize_go32_nat): Initialize and document them.
+
+2001-07-22 Mark Kettenis <kettenis@gnu.org>
+
+ * i386gnu-nat.c: Include "i387-nat.h".
+ (struct env387): Removed.
+ (reg_offset): Fix comment.
+ (fetch_fpregs): Use FCTRL_REGNUM and FOP_REGNUM instead of
+ FIRST_FPU_CONTROL_REGNUM and LAST_FPU_CONTROL_REGNUM. Rewrite to
+ use i387_supply_fsave.
+ (gnu_fetch_registers): Remove spurious whitespace.
+ (convert_to_env387): Remove.
+ (store_fpregs): Add argument regno. Use i387_fill_fsave instead
+ of convert_to_env387.
+ (gnu_store_registers): Remove spurious whitespace. Pass REGNO to
+ store_fpregs.
+ * config/i386/i386gnu.mt (TDEPFILES): Add i387-tdep.o.
+ * config/i386/i386gnu.mh (XDEPFILES): Remove i387-tdep.o.
+ (NATDEPFILES): Add i387-nat.o.
+
+2001-07-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * Makefile.in (ALLDEPFILES): Add m68hc11-tdep.c.
+ (m68hc11-tdep.o): Define dependencies.
+
+2001-07-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Define int at 16-bits.
+
+2001-07-21 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * utils.c (init_page_info): Use tui_get_command_dimension.
+ * printcmd.c (disassemble_command): Simplify tui specific code,
+ use tui_is_window_visible, tui_show_assembly.
+
+2001-07-21 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-nat.c: Do not include <sys/sysctl.h>.
+ (_initialize_i386bsd_nat) [KERN_PS_STRINGS]: Move FreeBSD-specific
+ code to ...
+ * i386fbsd-nat.c: ... here. New file.
+ * config/i386/fbsd.mh (NATDEPFILES): Add i386-fbsd.o.
+ * config/i386/nm-fbsd.h (CHILD_RESUME): Define.
+ * Makefile.in (ALLDEPFILES): Add i386fbsd-nat.c.
+ (i386fbsd-nat.o): Add dependencies.
+
+2001-07-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals.c: New file.
+ * Makefile.in: Add signals.o.
+ * target.c (struct signals, target_signal_to_name)
+ (target_signal_from_name, target_signal_from_host)
+ (do_target_signal_to_host, target_signal_to_host_p)
+ (target_signal_to_host, target_signal_from_command): Move to
+ signals.c.
+ (initialize_targets): Move check of struct signals to...
+ * signals.c (_initialize_signals): Here.
+
+2001-07-19 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Michael Chastain as C++ testsuite maintainer.
+
+2001-07-19 Andrew Cagney <ac131313@redhat.com>
+
+ From Stephen Smith:
+ * configure.tgt (i*86-*-pe*): New target.
+
+2001-07-19 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-07-16 Rodney Brown <rbrown64@csc.com.au>:
+ * infttrace.c (child_thread_alive): Fix gdb_tid typo.
+ * somsolib.c (no_shared_libraries): Provide stub.
+ * xcoffsolib.c (no_shared_libraries): Provide stub.
+
+2001-07-18 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * Makefile.in (COMMON_OBS): Remove tui-file.o.
+ (SUBDIR_TUI_OBS): Add it here.
+ (SUBDIR_TUI_SRCS): Move tui-file.c and tui-file.h here.
+ (main.o): Remove dependency with tui-file.h.
+
+2001-07-17 Elena Zannoni <ezannoni@redhat.com>
+
+ * Makefile.in (tui-file.o): Update dependencies.
+
+2001-07-17 Elena Zannoni <ezannoni@redhat.com>
+
+ * top.c (catch_errors): Convert PTR to void * in parameters list.
+ (quit_cover): Ditto.
+
+2001-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * source.c (find_source_lines): Remove tui test, must be replaced
+ by appropriate warning hook.
+ (print_source_lines): Remove tui hacks, must be replaced by cli.
+ (forward_search_command): Remove tui hacks, can be replaced by
+ appropriate calls to identify_source_line when tui scrolls.
+ (reverse_search_command): Likewise.
+
+2001-07-16 Nick Duffek <nsd@redhat.com>
+
+ * remote.c (init_remote_ops, init_remote_cisco_ops,
+ init_remote_async_ops): Set to_pid_to_str and
+ to_extra_thread_info correctly and in the same order as declared
+ in target.h.
+
+2001-07-16 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c: Revert below. Included more than intended.
+
+2001-07-16 Nick Duffek <nsd@redhat.com>
+
+ * remote.c (init_remote_ops, init_remote_cisco_ops,
+ init_remote_async_ops): Set to_pid_to_str and
+ to_extra_thread_info correctly and in the same order as declared
+ in target.h.
+
+2001-07-16 Nick Duffek <nsd@redhat.com>
+
+ * findvar.c (read_var_value): Apply value_as_pointer() to
+ addresses retrieved from the target for LOC_BASEREG and
+ LOC_BASEREG_ARG variables.
+
+2001-07-16 Orjan Friberg <orjanf@axis.com>
+
+ * NEWS: New target CRIS.
+
+2001-07-16 Elena Zannoni <ezannoni@redhat.com>
+
+ * top.c (show_commands): Remove extern decl of history_get, it's
+ already in readline/history.h.
+
+2001-07-16 Elena Zannoni <ezannoni@redhat.com>
+
+ * top.c (is_complete_command, init_cmd_lists, init_cli_cmds,
+ execute_user_command, do_setshow_command, get_prompt, init_proc,
+ serial_log_command): Remove extern declarations. Include
+ cli/cli-cmds.h, cli/cli-script.h, cli/cli-setshow.h, serial.h.
+ * gdbcmd.h (execute_user_command): Remove declaration, it's already
+ in cli/cli-script.h.
+ * command.h (do_setshow_command): Remove declaration, it's already
+ in cli/cli-setshow.h.
+ * infrun.c: Include "cli/cli-script.h" for execute_user_command.
+ * Makefile.in (infrun.o): Update dependencies.
+ (top.o): Ditto.
+ * cli/cli-setshow.h: Add comment for do_setshow_command.
+
+2001-07-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the
+ call to chdir on this symbol rather than on __DJGPP__.
+ (CANT_FORK) [__MSDOS__]: Move from here...
+ * defs.h (CANT_FORK) [__MSDOS__]: ...to here.
+ (GLOBAL_CURDIR) [__MSDOS__]: Define.
+
+2001-07-16 Orjan Friberg <orjanf@axis.com>
+
+ * configure.tgt: Recognise the CRIS architecture.
+ * config/cris/cris.mt: New file for CRIS target.
+ * cris-tdep.c: New file for CRIS target.
+
+2001-07-15 Elena Zannoni <ezannoni@redhat.com>
+
+ * top.c (quit_cover, float_handler): Move definition up before use.
+ (gdb_init): Move to end of file, to avoid calls to not yet defined
+ functions.
+ Delete prototypes.
+
+2001-07-14 Andrew Cagney <ac131313@redhat.com>
+
+ * serial.h (SERIAL_ASYNC): Delete.
+ (DEPRECATED_SERIAL_FD): Delete.
+ (SERIAL_DEBUG): Delete.
+ (SERIAL_DEBUG_P): Delete.
+ (SERIAL_DRAIN_OUTPUT): Delete.
+ (SERIAL_FLUSH_OUTPUT): Delete.
+ (SERIAL_FLUSH_INPUT): Delete.
+ (SERIAL_SEND_BREAK): Delete.
+ (SERIAL_RAW): Delete.
+ (SERIAL_GET_TTY_STATE): Delete.
+ (SERIAL_SET_TTY_STATE): Delete.
+ (SERIAL_PRINT_TTY_STATE): Delete.
+ (SERIAL_NOFLUSH_SET_TTY_STATE): Delete.
+ (SERIAL_SETBAUDRATE): Delete.
+ (SERIAL_SETSTOPBITS): Delete.
+ (SERIAL_CAN_ASYNC_P): Delete.
+ (SERIAL_IS_ASYNC_P): Delete.
+ (SERIAL_UN_FDOPEN): Delete.
+ (SERIAL_READCHAR): Delete.
+ (SERIAL_CLOSE): Delete.
+ (SERIAL_FDOPEN): Delete.
+ (SERIAL_OPEN): Delete.
+ * ser-unix.c: Update.
+ * sparclet-rom.c: Update.
+ * remote-bug.c: Update.
+ * dsrec.c: Update.
+ * xmodem.c: Update.
+ * nindy-share/ttyflush.c: Update.
+ * nindy-share/Onindy.c: Update.
+ * utils.c: Update.
+ * serial.c: Update.
+ * remote-nindy.c: Update.
+ * inflow.c: Update.
+ * sparcl-tdep.c: Update.
+ * sh3-rom.c: Update.
+ * remote.c: Update.
+ * remote-utils.c: Update.
+ * remote-st.c: Update.
+ * remote-sds.c: Update.
+ * remote-rdp.c: Update.
+ * remote-os9k.c: Update.
+ * remote-nrom.c: Update.
+ * remote-mips.c: Update.
+ * remote-es.c: Update.
+ * remote-e7000.c: Update.
+ * remote-array.c: Update.
+ * ocd.c: Update.
+ * nindy-share/nindy.c: Update.
+ * monitor.c: Update.
+
+2001-07-14 Andrew Cagney <ac131313@redhat.com>
+
+ * mn10200-tdep.c: Replace value_ptr with ``struct value *''.
+ * mcore-tdep.c: Ditto.
+ * sparc-tdep.c: Ditto.
+ * sh-tdep.c: Ditto.
+ * rs6000-tdep.c: Ditto.
+ * ppc-linux-tdep.c: Ditto.
+ * m68hc11-tdep.c: Ditto.
+ * ia64-tdep.c: Ditto.
+ * i386-tdep.c: Ditto.
+ * arm-linux-tdep.c: Ditto.
+ * hppa-tdep.c: Ditto.
+ * h8500-tdep.c: Ditto.
+ * fr30-tdep.c: Ditto.
+ * arm-tdep.c: Ditto.
+ * alpha-tdep.c: Ditto.
+ * d30v-tdep.c: Ditto.
+ * d10v-tdep.c: Ditto.
+ * m32r-tdep.c: Ditto.
+ * mips-tdep.c: Ditto.
+ * v850-tdep.c: Ditto.
+
+2001-07-15 Elena Zannoni <ezannoni@redhat.com>
+
+ * top.c (readline_line_completion_function, noop_completer): Move
+ from here...
+ * completer.c (readline_line_completion_function, noop_completer):
+ ...to here.
+ * gdbcmd.h (readline_line_completion_function, noop_completer):
+ Move declarations from here...
+ * completer.h (readline_line_completion_function, noop_completer):
+ ...to here.
+ * corefile.c: Include completer.h.
+ * source.c: Ditto.
+ * symfile.c: Ditto.
+ * Makefile.in: Update dependencies.
+
+2001-07-15 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_create_inferior): Support command lines longer
+ than 126 characters.
+
+2001-07-14 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * NEWS: New target 68HC11/68HC12.
+
+2001-07-14 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * utils.c (query): Remove tui hacks; tui must use the query_hook.
+ * top.c (command_loop): Remove tui insert_mode hacks; don't call
+ tuiCleanUp because this must be made with atexit by tui.
+ * symfile.c (symbol_file_command): Remove call to TUIDO
+ * stack.c (show_and_print_stack_frame_stub): Remove tui check;
+ not necessary when using the selected frame hooks.
+ (print_stack_frame_stub): Likewise.
+ (print_frame_info_base): Likewise.
+ (print_frame_info): Likewise.
+ (up_silently_command): Likewise.
+ (down_silently_command): Likewise.
+ (show_stack_frame): Likewise for TUIDO.
+ (select_frame): Likewise.
+ (select_and_print_frame): Likewise.
+ (stack_publish_stopped_with_no_frame): Remove.
+ (select_and_maybe_print_frame): Remove.
+ * main.c (captured_main): Remove tui_fileopen and tuiInit; tui
+ must use the initialize ui hook.
+ * infrun.c (normal_stop): Remove call to TUIDO; tui must use the
+ selected frame hooks.
+ * event-top.c (command_handler): Remove tui insert_mode hack.
+ * defs.h: Remove TUIDO; Only include tui.h.
+ * breakpoint.c (mention): Remove calls to TUIDO.
+ (delete_breakpoint): Remove tui hacks; tui must install
+ the breakpoint hooks.
+
+2001-07-14 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/xm-linux.h (KERNEL_U_ADDR): Move from here...
+ * config/i386/nm-linux.h: ...to here. Change comments about user
+ area/struct a bit.
+
+ * config/i386/xm-linux.h (HAVE_TERMIOS): Really remove.
+
+ * Makefile.in (ALLDEPFILES): Add i386bsd-nat.c and i386bsd-tdep.c
+ (i386bsd-tdep.o, i386bsd-nat.o): New targets.
+
+2001-07-13 Elena Zannoni <ezannoni@redhat.com>
+
+ * remote-e7000.c (fetch_regs_from_dump): If register set is null,
+ generate an internal error.
+ (e7000_fetch_registers): Initialize variable 'wanted'.
+ (e7000_wait): Initialize variable 'wanted_nopc'.
+ (e7000_store_register): Fix sprintf compiler warnings.
+ (sub2_from_pc): Ditto.
+ (e7000_open): Close the descriptor, not the name.
+ (e7000_load): Fix compiler warnings.
+ (sub2_from_pc): Ditto.
+ * Makefile.in (remote-e7000.o): Can now compile with -Werror.
+
+2001-07-13 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-nat.c: Include <signal.h>, <stddef.h> and
+ <sys/sysctl.h>.
+ (store_inferior_registers): Wrap long line.
+ (i386bsd_dr_get_status): Fix typo in comment.
+ (_initialize_i386bsd_nat): New function. * i386bsd-tdep.c: New
+ file. * config/i386/tm-fbsd.h (IN_SIGTRAMP): New define.
+ (i386bsd_in_sigtramp): New prototype.
+ (SIGTRAMP_START, SIGTRAMP_END): Redefine in terms...
+ (i386bsd_sigtramp_start, i386bsd_sigtramp_end): ...these new
+ (external) variables.
+ (SIGCONTEXT_PC_OFFSET): Removed.
+ (FRAME_SAVED_PC): New define.
+ (i386bsd_frame_saved_pc): New function. * config/i386/fbsd.mt
+ (TDEPFILES): Add i386bsd-tdep.o.
+
+2001-07-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-linux-tdep.c (_initialize_mips_linux_tdep): Use ISO C
+ definition.
+
+2001-07-13 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (lin_lwp_wait): Avoid check for resumed LWPs if there
+ are no registered LWPs yet.
+
+2001-07-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/i386/nm-linux.h (CANNOT_FETCH_REGISTER): Call the right
+ function.
+ (CANNOT_STORE_REGISTER): Likewise.
+
+2001-07-12 Keith Seitz <keiths@redhat.com>
+
+ * remote-rdp.c: Include "serial.h"
+
+2001-07-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/remote-utils.c (remote_open): Set VMIN to 1
+ in HAVE_TERMIO/HAVE_TERMIOS cases.
+
+2001-07-12 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (stop_wait_callback): Add support for flushing
+ signals. Use that in favour of the old code to get rid of
+ superfluous SIGINTs.
+ (lin_lwp_wait): Use the new support in stop_wait_callback to
+ flush all but one SIGINT.
+
+ * i386-tdep.c (i386_extract_return_value): Undo 2001-07-11 changes
+ to comment.
+ (i386_store_return_value): Improve comments about storing
+ floating-point return values.
+
+ * config/arm/xm-linux.h, config/i386/xm-linux.h,
+ config/m68k/xm-linux.h, config/powerpc/xm-linux.h,
+ config/sparc/xm-linux.h, config/ia64/xm-linux.h (HAVE_TERMIOS):
+ Removed. Taken care of by autoconf and terminal.h.
+
+2001-07-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (mips_type_needs_double_align): New function.
+ (mips_push_arguments): Align o32 structs to even argument
+ registers if necessary.
+
+2001-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/djgpp/fnchange.lst: Add entries for
+ mips-linux-nat.c and mips-linux-tdep.c.
+
+2001-07-12 Mark Kettenis <kettenis@gnu.org>
+
+ * config/powerpc/xm-linux.h: Fix corrupted file.
+
+ * configure.in: Add check for sigsetjmp.
+ * config/m68k/xm-linux.h (HAVE_SIGSETJMP): Removed.
+ * config/xm-sysv4.h (HAVE_SIGSETJMP): Removed.
+ * configure, config.in: Regenerated.
+
+2001-07-11 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/sh/tm-sh.h (struct gdbarch_tdep): Add
+ FLOAT_ARGLAST_REGNUM, RETURN_REGNUM, ARG0_REGNUM, ARGLAST_REGNUM,
+ PR_REGNUM fields.
+
+ * sh-tdep.c (sh_skip_prologue_hard_way): Rename from
+ skip_prologue_hard_way().
+ (skip_prologue_hard_way): Make it a function pointer.
+ (sh_print_register): Use function pointer do_pseudo_register,
+ instead of sh_do_pseudo_register.
+ (sh_do_registers_info): Ditto.
+ (sh_gdbarch_init): Initialize do_pseudo_register.
+ (IS_MOV_TO_R14): Rename from IS_MOV_R14.
+ (skip_prologue_hard_way): Update.
+ (sh_gdbarch_init): Move setting of frame_chain,
+ get_saved_register, init_extra_frame_info, push_arguments,
+ extract_return_value, pop_frame, store_struct_return,
+ extract_struct_value_address, use_struct_convention,
+ init_extra_frame_info to before target specific settings.
+ (sh_gdbarch_init): Initialize new tdep fields
+ FLOAT_ARGLAST_REGNUM, RETURN_REGNUM, ARG0_REGNUM, ARGLAST_REGNUM,
+ PR_REGNUM.
+ (sh_push_arguments): Use new gdbarch_tdep fields
+ {ARG0,ARGLAST}_REGNUM.
+ (sh_saved_pc_after_call, sh_nofp_frame_init_saved_regs,
+ sh_init_extra_frame_info, sh_push_return_address,
+ sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
+ sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): Update to use
+ gdbarch_tdep->PR_REGNUM.
+ (dr_reg_base_num, fv_reg_base_num): Move to earlier in the file.
+
+2001-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/mips/tm-linux.h: Include "tm-linux.h" instead of copying
+ from it. Move definitions of REALTIME_LO and REALTIME_HI above
+ include.
+
+2001-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * MAINTAINERS: List myself for MIPS/Linux
+ port.
+
+2001-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/remote-utils.c (remote_open): Only
+ check for F_SETOWN if we had F_SETFL and FASYNC.
+
+2001-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ From Michael Fedrowitz <michael.fedrowitz@informatik.uni-ulm.de>:
+
+ * config/m68k/linux.mh: Remove core-regset.o.
+ * m68klinux-nat.c: Fix comment.
+ (supply_gregset): Change argument to elf_gregset_t *.
+ (supply_fpregset): Change argument to elf_fpregset_t *.
+ (fetch_core_registers): New function.
+ (linux_elf_core_fns): Define.
+ (_initialize_m68k_linux_nat): New function.
+
+2001-07-11 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.tgt: Mark d10v as pure multi-arch.
+ * config/d10v/tm-d10v.h: Delete file.
+ * config/d10v/d10v.mt (TM_FILE): Delete.
+
+2001-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * serial.h (typedef serial_t): Delete. Replace all references to
+ serial_t with `struct serial *'.
+ * serial.c: Update.
+ * nindy-share/ttyflush.c: Update.
+ * nindy-share/ttyflush.c: Update.
+ * nindy-share/Onindy.c: Update.
+ * nindy-share/nindy.c: Update.
+ * remote-rdp.c: Update.
+ * remote-sds.c: Update.
+ * remote-st.c: Update.
+ * remote-nindy.c: Update.
+ * remote-mips.c: Update.
+ * remote-e7000.c: Update.
+ * remote-os9k.c: Update.
+ * remote-nrom.c: Update.
+ * remote-es.c: Update.
+ * remote-array.c: Update.
+ * ocd.c: Update.
+ * mon960-rom.c: Update.
+ * dsrec.c: Update.
+ * inflow.c: Update.
+ * ser-e7kpc.c: Update.
+ * sparclet-rom.c: Update.
+ * srec.h: Update.
+ * ser-tcp.c: Update.
+ * ser-go32.c: Update.
+ * sparcl-tdep.c: Update.
+ * w89k-rom.c: Update.
+ * utils.c: Update.
+ * sh3-rom.c: Update.
+ * remote.c: Update.
+ * ser-pipe.c: Update.
+ * ser-unix.c: Update.
+ * ser-unix.h: Update.
+ * xmodem.c: Update.
+ * xmodem.h: Update.
+
+2001-07-11 J.T. Conklin <jtc@redback.com>
+
+ From Greg McGary <greg@mcgary.org>:
+ * gdbserver/remote-utils.c (remote_open): Set gdbserver as "owner"
+ of SIGIO.
+ (input_interrupt): Don't block on read, in case we got redundant
+ SIGIO. Don't gripe about redundant SIGIO.
+ * gdbserver/low-hppabsd.c (mywait): Use waitpid(). Enable SIGIO
+ handler while waiting.
+ * gdbserver/low-linux.c (mywait): Likewise.
+ * gdbserver/low-nbsd.c (mywait): Likewise.
+ * gdbserver/low-sparc.c (mywait): Likewise.
+
+2001-07-11 Keith Seitz <keiths@redhat.com>
+
+ * infrun.c (print_stop_reason): Add missing uiout field
+ "reason" for SIGNAL_RECEIVED case.
+
+2001-07-11 Mark Kettenis <kettenis@gnu.org>
+
+ * config/alpha/nm-linux.h (TARGET_ELF64, PSIGNAL_IN_SIGNAL_H):
+ Remove unused macro's.
+
+ * config/powerpc/nm-linux.h (NO_SYS_REG_H): Remove, it's no longer
+ used.
+
+2001-07-11 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (info_dos_cmdlist): New variable.
+ (go32_info_dos_command): New function.
+ (_initialize_go32_nat): Convert all DOS-specific commands into
+ subcommands of "info dos". Suggested by Andrew Cagney
+ <ac131313@redhat.com>.
+
+2001-07-11 Mark Kettenis <kettenis@gnu.org>
+
+ * config/nm-linux.h: Fix comments.
+
+ * thread-db.c (enable_thread_event_reporting): Correct warning
+ message about getting thread death breakpoint.
+ Reported by John S Kallal <jskallal@home.com>.
+
+ * i386-tdep.c (i386_extract_return_value): "Fix" comment.
+ (i386_store_return_value): Frob FPU status and tag word to make
+ sure the return value is the only value on the FPU stack.
+
+ * config/tm-linux.h: Do not include <signal.h>. Instead provide
+ reasonable defaults for REALTIME_LO and REALTIME_HI if they're not
+ already defined.
+ * config/nm-linux.h: Include <signal.h>.
+ [__SIGRTMIN] (REALTIME_LO, REALTIME_HI): Define to __SIGRTMIN and
+ (__SIGRTMAX + 1) respectively.
+
+2001-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * mcore-rom.c: Include "serial.h".
+ * Makefile.in (mcore-rom.o): Depends on "serial.h".
+
+2001-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (remote-bug.o): Depends on serial.h.
+ * remote-bug.c: Include "serial.h".
+ * MAINTAINERS: Mark m88k target as buildable.
+ * TODO: Update.
+
+2001-07-10 Jim Blandy <jimb@redhat.com>
+
+ Clean up the D10V port so that GDB and the target program no
+ longer disagree on how big pointers are.
+ * findvar.c (value_from_register): Remove special case code for D10V.
+ * printcmd.c (print_frame_args): Same.
+ * valops.c (value_at, value_fetch_lazy): Same.
+ * values.c (unpack_long): Same.
+ * gdbarch.sh: Changes to effect the following:
+ * gdbarch.h (GDB_TARGET_IS_D10V, D10V_MAKE_DADDR,
+ gdbarch_d10v_make_daddr_ftype, gdbarch_d10v_make_daddr,
+ set_gdbarch_d10v_make_daddr, D10V_MAKE_IADDR,
+ gdbarch_d10v_make_iaddr_ftype, gdbarch_d10v_make_iaddr,
+ set_gdbarch_d10v_make_iaddr, D10V_DADDR_P,
+ gdbarch_d10v_daddr_p_ftype, gdbarch_d10v_daddr_p,
+ set_gdbarch_d10v_daddr_p, D10V_IADDR_P,
+ gdbarch_d10v_iaddr_p_ftype, gdbarch_d10v_iaddr_p,
+ set_gdbarch_d10v_iaddr_p, D10V_CONVERT_DADDR_TO_RAW,
+ gdbarch_d10v_convert_daddr_to_raw_ftype,
+ gdbarch_d10v_convert_daddr_to_raw,
+ set_gdbarch_d10v_convert_daddr_to_raw, D10V_CONVERT_IADDR_TO_RAW,
+ gdbarch_d10v_convert_iaddr_to_raw_ftype,
+ gdbarch_d10v_convert_iaddr_to_raw,
+ set_gdbarch_d10v_convert_iaddr_to_raw): Delete declarations.
+ * gdbarch.c: Delete the corresponding definitions.
+ (struct gdbarch): Delete members d10v_make_daddr,
+ d10v_make_iaddr, d10v_daddr_p, d10v_iaddr_p,
+ d10v_convert_daddr_to_raw, and d10v_convert_iaddr_to_raw.
+ (startup_gdbarch): Remove initializers for the above.
+ (verify_gdbarch, gdbarch_dump): Don't verify or dump them any
+ more.
+ * d10v-tdep.c (d10v_register_virtual_type): Rather that
+ claiming the stack pointer and PC are 32 bits long (which they
+ aren't), say that the stack pointer is an int16_t, and the
+ program counter is a function pointer. This allows the rest
+ of GDB to make the appropriate conversions between the code
+ pointer format and real addresses.
+ (d10v_register_convertible, d10v_register_convert_to_virtual,
+ d10v_register_convert_to_raw): Delete function; no registers
+ are convertible now, so we use
+ generic_register_convertible_not instead.
+ (d10v_address_to_pointer, d10v_pointer_to_address): New gdbarch
+ methods.
+ (d10v_push_arguments, d10v_extract_return_value): Remove special
+ cases for code and data pointers.
+ (d10v_gdbarch_init): Set gdbarch_ptr_bit to 16, so that GDB and
+ the target agree on how large pointers are. Say that addresses
+ are 32 bits long. Register the address_to_pointer and
+ pointer_to_address conversion functions. Since no registers are
+ convertible now, register generic_register_convertible_not as the
+ gdbarch_register_convertible method instead of
+ d10v_register_convertible. Remove registrations for
+ d10v_register_convert_to_virtual,
+ d10v_register_convert_to_raw, gdbarch_d10v_make_daddr,
+ gdbarch_d10v_make_iaddr, gdbarch_d10v_daddr_p,
+ gdbarch_d10v_iaddr_p, gdbarch_d10v_convert_daddr_to_raw, and
+ gdbarch_d10v_convert_iaddr_to_raw.
+
+ * printcmd.c (print_scalar_formatted): If we are printing an
+ address, remember that TARGET_ADDR_BIT is not always equal to
+ TARGET_PTR_BIT.
+
+ * valops.c (value_cast): When casting a pointer to an integer,
+ don't convert it to an address.
+
+2001-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-utils.h (struct serial): Declare as opaque. Remove
+ include of "serial.h".
+ * Makefile.in (remote_utils_h): Update.
+
+ * monitor.h (struct serial): Declare as opaque. Remove include of
+ "serial.h".
+ (struct monitor_ops): Replace serial_t with `struct serial *'.
+ * monitor.c (monitor_desc): Ditto.
+
+2001-07-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-linux-tdep.c: New file.
+ * mips-linux-nat.c: New file.
+ * config/mips/linux.mh: New file.
+ * config/mips/linux.mt: New file.
+ * config/mips/xm-linux.h: New file.
+ * config/mips/nm-linux.h: New file.
+ * config/mips/tm-linux.h: New file.
+ * configure.host: Recognize mips*-*-linux*.
+ * configure.tgt: Likewise.
+ * NEWS: Mention mips*-*-linux* port.
+
+2001-07-09 Andrew Cagney <ac131313@redhat.com>
+
+ * serial.h (struct serial): Rename `struct _serial_t'.
+ * serial.c (XMALLOC): Define.
+ (serial_open): Update. Use XMALLOC.
+ (serial_fdopen): Ditto.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.h (builtin_type_void_data_ptr): Rename
+ builtin_type_ptr.
+ * gdbtypes.c (builtin_type_void_data_ptr): Update.
+ (build_gdbtypes): Update.
+ (_initialize_gdbtypes): Update.
+ * values.c (value_as_pointer): Update.
+ * utils.c (host_pointer_to_address): Update.
+ (address_to_host_pointer): Update.
+
+2001-07-08 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-udi.c (udi_wait): Make type, instead of name, of first
+ parameter a ptid_t.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * ser-mac.c: Make obsolete.
+ * Makefile.in (ser-mac.o): Ditto.
+
+2001-07-08 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c (go32_get_windows_version, print_mem, go32_sysinfo)
+ (read_memory_region, get_descriptor, display_descriptor)
+ (go32_sldt, go32_sgdt, go32_sidt): New functions.
+ (top-level): Include ctype.h, utsname.h, dos.h, and go32.h. Ifdef
+ away `disable' from dos.h, since breakpoint.h defines an enum
+ member of the same name, and GCC 2.7.2 barfs.
+ (_initialize_go32_nat): Provide new commands dos-sysinfo, dos-ldt,
+ dos-gdt, and dos-idt, all of them in the "info" class
+
+2001-07-07 Kevin Buettner <kevinb@redhat.com>
+
+ * procfs.c (create_procinfo): Allocate space for saved_entryset
+ and saved_exitset.
+ (destroy_one_procinfo): Free space allocated to saved_entryset
+ and saved_exitset.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (5.1): Update.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * symtab.c (main_name): New function.
+ (set_main_name): New function.
+ * symtab.h: Declare.
+ * TODO: Update
+
+ From 2000-03-05 Anthony Green <green@redhat.com>:
+ * dbxread.c (process_one_symbol): Handle the N_MAIN stab by
+ setting main_name.
+ * blockframe.c (inside_main_func): Use main_name instead of
+ "main".
+ * symtab.c (find_main_psymtab): Ditto.
+ * source.c (select_source_symtab): Ditto.
+ * nlmread.c (nlm_symfile_read): Ditto.
+ * rs6000-tdep.c (skip_prologue): Ditto.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO: Convert most items into PRs.
+
+2001-07-07 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (status_to_str): New function.
+ (lin_lwp_wait): Use it to print debug messages where appropriate.
+
+2001-07-06 Michael Chastain <chastain@redhat.com>
+
+ * i387-tdep.c (print_i387_value): Fix pointer glitch.
+
+2001-07-07 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (count_events_callback): Fix formatting. Turn check
+ commented with "paranoia" into gdb_assert.
+ (select_event_lwp_callback): Likewise.
+ (cancel_breakpoints_callback): Bail out early if LP is the event
+ LWP. Add comment about backup up breakpoints. Fix formatting and
+ debug message.
+ (select_event_lwp): Make solely repsonsible for switching event
+ LWP. Fix formatting and remove bogus "ERROR" debug message.
+ Don't backup breakpoints from here.
+ (lin_lwp_wait): Don't touch LP->status, let select_event_lwp
+ handle that. Only call select_event_lwp if we're not waiting for
+ a specific LWP, i.e. when PID == -1. Backup breakpoints from here.
+
+2001-07-06 Michael Snyder <msnyder@redhat.com>
+
+ * procfs.c (procfs_resume): Silence noisy warning.
+
+2001-06-12 Michael Snyder <msnyder@redhat.com>
+
+ * lin-lwp.c: Prevent thread starvation by using a monte carlo
+ method to choose which of several event threads to handle next.
+
+ (stop_wait_callback): Defer pushback of breakpoint events until
+ later; add SIGTRAP events to the queue of unhandled events.
+ Keep calling waitpid until SIGSTOP retrieved. If more than one
+ non-SIGSTOP event is retrieved, push them back onto the process
+ queue using kill.
+ (count_events_callback, select_singlestep_lwp_callback,
+ select_event_lwp_callback, cancel_breakpoints_callback,
+ select_event_lwp): New functions. Implement monte carlo method
+ for selecting which of several SIGTRAP threads to handle next.
+ Push back the breakpoint event for all threads other than the
+ selected one.
+ (lin_lwp_wait): Call select_event_lwp to decide which of several
+ sigtrapped lwps to handle next.
+ (resume_callback): Disable code that attempts to handle
+ step_resume breakpoints. Let core gdb handle this.
+
+2001-07-06 Jim Blandy <jimb@redhat.com>
+
+ * gdbtypes.h (builtin_type_void_func_ptr): New builtin type.
+ * gdbtypes.c (builtin_type_void_func_ptr): Define the variable.
+ (build_gdbtypes): Initialize it.
+ (_initialize_gdbtypes): Swap it.
+
+2001-07-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (mips32_op): Correct offset.
+ (itype_op): Likewise.
+ (itype_rs): Fix formatting.
+ (itype_immediate): Fix formatting.
+ (jtype_op): Correct offset.
+ (jtype_target): Fix formatting.
+ (rtype_op): Correct offset.
+ (rtype_rs): Fix formatting.
+ (rtype_rt): Likewise.
+ (rtype_rd): Likewise.
+ (rtype_shamt): Likewise.
+ (rtype_funct): Likewise.
+
+ (mips32_next_pc): Fix formatting and comments. Recognize
+ coprocessor 1 branches. Check the correct field for BLT family
+ branches. Use itype_rt instead of itype_rs for the second register
+ of a BNE or BNEL branch. Move (unreachable) default case.
+
+2001-07-04 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h (struct ui_out_impl): Add field is_mi_like_p.
+ (ui_out_is_mi_like_p): Declare.
+ * ui-out.c (ui_out_is_mi_like_p): Define.
+ (default_ui_out_impl): Initialize is_mi_like_p to zero.
+ * cli-out.c (cli_ui_out_impl): Ditto.
+ * breakpoint.c (print_it_typical): Use ui_out_is_mi_like_p.
+ (watchpoint_check, print_one_breakpoint, mention): Ditto.
+ * infrun.c (print_stop_reason, normal_stop): Ditto.
+
+2001-07-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (mips_software_single_step): New function.
+ * config/mips/tm-mips.h: Add prototype for
+ mips_software_single_step.
+
+2001-07-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * ppc-linux-nat.c (supply_gregset): Use elf_greg_t instead
+ of greg_t.
+ (fill_gregset): Likewise.
+
+2001-07-05 Andrew Cagney <ac131313@redhat.com>
+
+ * objfiles.c (open_mapped_file): Use lbasename instead of
+ basename.
+
+2001-07-05 Jim Blandy <jimb@redhat.com>
+
+ * d10v-tdep.c (d10v_frame_chain, d10v_frame_init_saved_regs,
+ show_regs, d10v_read_pc, d10v_write_pc, d10v_read_sp,
+ d10v_write_sp, d10v_write_fp, d10v_read_fp,
+ d10v_push_return_address): Call the functions d10v_make_daddr,
+ d10v_make_iaddr, d10v_convert_iaddr_to_raw, and
+ d10v_convert_daddr_to_raw, not the global macros D10V_MAKE_DADDR,
+ D10V_MAKE_IADDR, D10V_CONVERT_IADDR_TO_RAW, and
+ D10V_CONVERT_DADDR_TO_RAW.
+
+ * dwarf2read (dwarf2_build_psymtabs_hard): Doc fix.
+
+2001-07-05 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/xm-go32.h (HOST_I386): Removed.
+ * config/i386/xm-linux.h (HOST_I386): Removed.
+
+2001-07-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (print_i387_value): Add extra space after final full
+ stop in comment.
+
+2001-07-04 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (5.1): Update. Doco changes committed.
+
+2001-06-29 Andrew Cagney <ac131313@redhat.com>
+
+ * config/arm/tm-arm.h: Include "floatformat.h".
+
+2001-06-29 Andrew Cagney <ac131313@redhat.com>
+
+ * i387-tdep.c: Include "gdb_assert.h".
+ (print_i387_value): Use extract_floating to extract the FP value
+ from a zero padded local buffer.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO: Delete all thread items. The thread code was overhauled.
+
+2001-07-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * memattr.c (create_mem_region): Move n to next memory region,
+ to avoid infinite loop.
+
+ * memattr.h: Add copyright statement.
+ * memattr.c: Ditto.
+
+2001-07-04 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (struct partial_die_info): New member: has_pc_info.
+ (read_partial_die): Delete fourth argument; we return this info in
+ the struct partial_die_info object itself now.
+ (dwarf2_build_psymtabs_hard, scan_partial_symbols): Use the
+ has_pc_info field of the partial die struct, rather than passing a
+ variable by reference to read_partial_die.
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Remove extraneous
+ code in loop condition.
+
+2001-07-03 Michael Snyder <msnyder@redhat.com>
+
+ * thread_db (find_new_threads_callback, thread_db_thread_alive,
+ attach_thread): Update comments.
+
+2001-06-29 Ken Whaley <ken@believe.com>
+
+ * thread-db.c (attach_thread): Check for TD_THR_ZOMBIE in addition
+ to TD_THR_UNKNOWN when looking for defunct zombie threads.
+ (thread_db_thread_alive): Ditto.
+ (find_new_threads_callback): Ditto.
+
+2001-07-02 Daniel Jacobowitz <drow@mvista.com>
+
+ * MAINTAINERS: Add myself to the write-after-approval list.
+
+2001-07-02 Daniel Jacobowitz <drow@mvista.com>
+
+ * solib-svr4.c: Include "elf/mips.h".
+ (elf_locate_base): Make DT_MIPS_RLD_MAP block unconditional.
+
+2001-07-02 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (read_comp_unit, sibling_die, dump_die,
+ dump_die_list, store_in_ref_table, follow_die_ref): Make these
+ static; they're private functions.
+
+2001-07-01 Mark Elbrecht <snowball@bigfoot.com>
+
+ * coffread.c (coff_symfile_read): Parse DWARF2 info if present.
+
+2001-06-28 Elena Zannoni <ezannoni@redhat.com>
+
+ * TODO: Add import of readline 4.2 as a gdb 5.2 task.
+
+2001-06-29 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Sort.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Rename mi0-var-block.exp,
+ mi0-var-cmd.exp, mi0-var-child.exp and mi0-var-display.exp.
+
+2001-06-29 Andreas Jaeger <aj@suse.de>
+
+ * MAINTAINERS: Add myself to the write-after-approval list.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-array.c (SWAP_TARGET_AND_HOST): Delete macro.
+ (get_hex_word): Don't use HOST_BYTE_ORDER.
+ (array_fetch_registers): Add variable ``reg''. Use
+ store_unsigned_integer to byte-swap the register. Delete unused
+ local ``regs''.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Per Bothner to Java maintainers.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * rdi-share/unixcomm.c (SERIAL_PREFIX): Always provide a default.
+ * rdi-share/hostchan.h (__unix): Hack, provide a default value.
+ * rdi-share/host.h (__unix): Hack, define when __NetBSD__.
+ * TODO: Update.
+ * MAINTAINERS: Update. arm-elf builds.
+
+2001-06-28 Jim Blandy <jimb@redhat.com>
+
+ * d10v-tdep.c (d10v_ts2_dmap_register): Doc fix.
+
+ * d10v-tdep.c (d10v_frame_chain_valid, d10v_use_struct_convention,
+ d10v_breakpoint_from_pc, d10v_register_byte,
+ d10v_register_raw_size, d10v_register_virtual_size,
+ d10v_register_virtual_type, d10v_register_convertible,
+ d10v_register_convert_to_virtual, d10v_register_convert_to_raw,
+ d10v_make_daddr, d10v_make_iaddr, d10v_daddr_p, d10v_iaddr_p,
+ d10v_convert_iaddr_to_raw, d10v_convert_daddr_to_raw,
+ d10v_store_struct_return, d10v_store_return_value,
+ d10v_extract_struct_value_address, d10v_frame_saved_pc,
+ d10v_saved_pc_after_call, d10v_pop_frame, d10v_skip_prologue,
+ d10v_frame_chain, d10v_frame_init_saved_regs,
+ d10v_init_extra_frame_info, d10v_read_pc, d10v_write_pc,
+ d10v_read_sp, d10v_write_sp, d10v_write_fp, d10v_read_fp,
+ d10v_push_return_address, d10v_push_arguments,
+ d10v_extract_return_value): Make these functions static.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ From Fernando Nasser:
+ * infrun.c (handle_inferior_event): Handle "nexti" inside function
+ prologues.
+
+2001-06-28 Michael Snyder <msnyder@redhat.com>
+
+ * infrun.c (handle_inferior_event): Replace prev_pc test in all
+ calls to bpstat_stop_status (removed in 1999-09-24). This test
+ helps distinguish stepping over a breakpoint trap from stepping
+ thru a jump to the instruction after a breakpoint trap.
+ (handle_inferior_event): Don't bother writing the PC if
+ DECR_PC_AFTER_BREAK is zero (optimization).
+ * breakpoint.c (bpstat_stop_status): Add comment explaining the
+ purpose and usage of the "not_a_breakpoint" argument in computing
+ the breakpoint address.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ From 2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
+ * monitor.c (setmem_resp_delim_pattern): New regexp pattern.
+ (setreg_resp_delim_pattern): Likewise.
+ (setmem_resp_delim_fastmap): New buffer.
+ (setreg_resp_delim_fastmap): Likewise.
+ (monitor_open): Initialize above regexp if they are defined.
+ (monitor_write_memory): Use regexp to check the result of write.
+ (monitor_store_register): Likewise to check result of register set.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ From 2000-06-14 John Marshall <john_w_marshall@palm.com>:
+ * coff-solib.c: Include symfile.h and objfiles.h to make
+ OBJF_SHARED visible.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.in (--enable-gdbmi): Enable by default.
+ * configure: Regenerate.
+ * TODO: Update.
+ * NEWS: Update
+
+2001-06-28 Joel Brobecker <brobecker@act-europe.fr>
+
+ * solib-osf.c (osf_in_dynsym_resolve_code): Add a comment
+ explaining the consequences of always returning zero. No code
+ change.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-06-08 Daniel Jacobowitz <djacobowitz@mvista.com>:
+ * defs.h (enum target_signal): Add TARGET_SIGNAL_REALTIME_65
+ to TARGET_SIGNAL_REALTIME_127.
+ * target.c (struct signals): Add SIG63 to SIG127.
+ (target_signal_from_host): Handle up to 127 signals.
+ (do_target_signal_to_host): Likewise.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-sds.c (sds_start_remote): Change type of ``c'' to int
+ from possibly unsigned char.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * ser-ocd.c: Delete file.
+ * Makefile.in (ALLDEPFILES): Remove ser-ocd.c
+ (ser-ocd.o): Delete target.
+ * TODO: Update.
+ * NEWS: Update.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Write After Approval): Sort.
+ (Past Maintainers): Daniel Berlin stepped down as C++ maintainer.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.c (breakpoint_1): Always output the breakpoint
+ headings. Leave it to ui-out to decide which
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (print_frame): For ui_out, output a list of arguments.
+
+2001-06-25 Kevin Buettner <kevinb@redhat.com>
+
+ * MAINTAINERS (paper trail): Update.
+
+2001-06-25 Michael Snyder <msnyder@redhat.com>
+
+ * infrun.c: Eliminate the "thread_step_needed" state variable,
+ and replace it with a relatively simple test in resume.
+ (resume): Replace thread_step_needed logic with a test for
+ stepping, breakpoint_here_p and breakpoints_inserted.
+ Move CANNOT_STEP_BREAKPOINT logic to after thread_step logic.
+ (proceed): Discard thread_step_needed logic.
+ (wait_for_inferior, fetch_inferior_event, handle_inferior_event):
+ Discard thread_step_needed logic.
+
+2001-06-24 Fernando Nasser <fnasser@redhat.com>
+
+ * remote-rdi.c (arm_rdi_wait): Fix return type in prototype.
+ * rdi-share/host.h: Add missing parenthesis in conditional.
+
+2001-06-22 J.T. Conklin <jtc@redback.com>
+
+ * configure.in: include nlist.h when checking for member som_addr
+ in struct so_map.
+ * configure: regenerate.
+
+2001-06-21 Keith Seitz <keiths@redhat.com>
+
+ * cli-out.c (cli_out_new): Initialize new structure member
+ "suppress_output".
+
+2001-06-20 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h (ui_out_table_header): Add parameter ``col_name''.
+ (table_header_ftype): Ditto.
+ * cli-out.c (cli_table_header): Update.
+ * ui-out.c (ui_out_table_header): Update.
+ (uo_table_header): Update.
+ (default_table_header): Update.
+ (append_header_to_list): Update.
+ (struct ui_out_header): Add field ``col_name''.
+ (append_header_to_list): Use xstrdup. Initialize col_name.
+ * breakpoint.c (breakpoint_1): Pass COL_NAME to
+ ui_out_table_header.
+
+2001-06-19 Andrew Cagney <ac131313@redhat.com>
+
+ * cli-out.c: Include "gdb_assert.h'.
+ (struct ui_out_data): Add field ``suppress_output.
+ (cli_table_begin): When NR_ROWS is zero, suppress_output.
+ (cli_table_end): Clear suppress_output.
+ (cli_table_body): Check suppress_output.
+ (cli_table_header, cli_begin): Ditto.
+ (cli_end, cli_field_int, cli_field_skip): Ditto.
+ (cli_field_string, cli_field_fmt, cli_spaces): Ditto.
+ (cli_text, cli_message, cli_wrap_hint): Ditto.
+ * breakpoint.c (breakpoint_1): Close the ui_out table before
+ printing the breakpoint not found message.
+
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.c (ui_out_table_begin): Add parameter ``nr_rows''.
+ (default_table_begin): Ditto.
+ (uo_table_begin): Ditto.
+ * cli-out.c (cli_table_begin): Ditto.
+ * ui-out.h (ui_out_table_begin): Update
+ (table_begin_ftype): Update.
+ * breakpoint.c (breakpoint_1): Pass nr_printable_breakpoints to
+ ui_out_table_begin.
+
+2001-06-16 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.c (breakpoint_1): Restructure. Compute the
+ nr_printable_breakpoints. Move the header output to before the
+ main print breakpoints loop.
+ (user_settable_breakpoint): New function.
+
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c, breakpoint.c: Use strncmp as the "mi" test. Allow,
+ "mi", "mi0" and "mi1".
+
+2001-06-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Generate an error when conflicting macro
+ definitions. Generate an error when both pure multi-arch and
+ "tm.h".
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * defs.h (GDB_MULTI_ARCH_TM): Rewrite definition.
+
+2001-06-17 Andrew Cagney <ac131313@redhat.com>
+
+ * config/sparc/tm-sun4sol2.h (GDB_MULTI_ARCH): Down grade to
+ GDB_MULTI_ARCH_PARTIAL from two.
+
+2001-06-17 Fernando Nasser <fnasser@redhat.com>
+
+ From 2001-06-15 Eirik Fuller <eirik@hackrat.com>
+ * cli/cli-script.c (free_command_lines): Reset list pointer.
+
+2001-06-16 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (init_frame_pc_default): New function
+ * arch-utils.h (init_frame_pc_default): Declare.
+ * gdbarch.sh (INIT_FRAME_PC): Default to init_frame_pc_default and
+ not init_frame_pc_noop.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * blockframe.c (INIT_FRAME_PC): Delete macro definition.
+ * mips-tdep.c (mips_gdbarch_init): Set init_frame_pc to
+ init_frame_pc_noop.
+
+2001-06-16 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.c: Regenerate. Out-of-sync with gdbarch.sh.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (CANNOT_FETCH_REGISTER): Multi-arch.
+ (CANNOT_STORE_REGISTER): Ditto.
+ * infptrace.c (CANNOT_FETCH_REGISTER): Delete definition.
+ (CANNOT_STORE_REGISTER): Ditto.
+ * regcache.c (CANNOT_STORE_REGISTER): Ditto.
+ * lynx-nat.c (CANNOT_STORE_REGISTER): Ditto.
+ * arch-utils.h (cannot_register_not): Define.
+ * arch-utils.c (cannot_register_not): Declare.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Clarify pre/post default
+ (INIT_FRAME_PC_FIRST, INIT_FRAME_PC): Multiarch.
+ * blockframe.c (get_prev_frame): Remove #ifdef from around
+ INIT_FRAME_PC_FIRST call.
+ * arch-utils.c (init_frame_pc_noop): Define.
+ * arch-utils.h (init_frame_pc_noop): Declare.
+ * config/mips/tm-mips.h (INIT_FRAME_PC_FIRST): Delete.
+ (INIT_FRAME_PC, mips_init_frame_pc_first): Ditto.
+ * mips-tdep.c (mips_init_frame_pc_first): Make static.
+ (mips_gdbarch_init): Initialize init_frame_pc_first.
+ (mips_dump_tdep): Update.
+
+2001-06-15 Michael Snyder <msnyder@redhat.com>
+
+ * infrun.c (context_switch): New function. Abstract the operation
+ of saving and restoring infrun's state when switching threads.
+ (handle_inferior_event): Normalize the handling of the 'thread hop'
+ event (when the wrong thread hits a thread-specific breakpoint,
+ and we need to solo-step that thread past the breakpoint).
+ Call keep_going, instead of target_resume. Handle the subsequent
+ singlestep-trap as a normal event instead of just resuming.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (core_addr_identity): New function. Rename
+ default_convert_from_func_ptr_addr.
+ * gdbarch.sh (CONVERT_FROM_FUNC_PTR_ADDR): Update.
+ (ADDR_BITS_REMOVE): Define. Default to core_addr_identity.
+ * defs.h (ADDR_BITS_REMOVE): Delete macro definition.
+ * config/mips/tm-mips.h (ADDR_BITS_REMOVE): Delete definition.
+ * mips-tdep.c (mips_addr_bits_remove): Make static.
+ (mips_gdbarch_init): Initialize addr_bits_remove.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-02-26 D.J. Barrow <djbarrow@de.ibm.com>:
+ * configure.tgt: Add S/390 31 & 64 bit target configuration.
+ * configure.host: Ditto for host.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Change to a function with
+ predicate.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * values.c (value_being_returned): Change the reference to
+ EXTRACT_STRUCT_VALUE_ADDRESS_P to a function call.
+
+2001-06-15 Joel Brobecker <brobecker@act-europe.fr>
+
+ * MAINTAINERS: Add Paul Hilfinger and Joel Brobecker to the
+ Write After Approval list.
+
+2001-06-14 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (show_remote_protocol_qSymbol_packet_cmd,
+ set_remote_protocol_qSymbol_packet_cmd): New functions.
+ (init_all_packet_configs, show_remote_cmd): Add qSymbol packet.
+ (remote_check_symbols): New function. Implement qSymbol packet,
+ allowing target to request symbol lookup service from gdb.
+ (remote_open_1, remote_async_open_1): Call remote_check_symbols,
+ allowing symbol lookup from exec_bfd on connection to target.
+ (remote_new_objfile): New function. Catch new objfile notifications
+ from shared library module, and call remote_check_symbols.
+ (_initialize_remote): Hook remote_new_objfile into the shared
+ library notification chain. Add "set remote symbol-lookup" command.
+
+2001-06-14 Keith Seitz <keiths@redhat.com>
+
+ * tracepoint.c (trace_command): We now have tracepoint
+ events. Get rid of those ugly hooks.
+ (tracepoint_operation): Likewise.
+ (trace_pass_command): Likewise.
+
+2001-06-13 Michael Snyder <msnyder@redhat.com>
+
+ * gdbthread.h (struct thread_info): Add new fields:
+ current_line, current_symtab, step_sp, for saved infrun state.
+ * thread.c (save_infrun_state, load_infrun_state): Save and
+ restore current_line, current_symtab, and step_sp.
+ (add_thread): Rather than adding assignments to initialize
+ the new fields, just use memset (tp, 0, sizeof (*tp).
+ This way future new fields will not be overlooked.
+ * infrun.c (handle_inferior_event): Save and restore save_sp,
+ current_line, and current_symtab when switching threads.
+
+2001-06-13 Elena Zannoni <ezannoni@redhat.com>
+
+ * MAINTAINERS: Add Andrew Cagney as co-maintainer of
+ testsuite/gdb.mi.
+
+2001-06-11 Andrew Cagney <ac131313@redhat.com>
+
+ * symtab.c (lookup_symtab_1): Replace basename with lbasename.
+ (lookup_partial_symtab, file_matches): Ditto.
+ (make_source_files_completion_list): Ditto.
+ (make_file_symbol_completion_list): Ditto. Make local char*
+ variable ``tail'' constant.
+ (make_source_files_completion_list): Ditto with ``base_name''.
+ * source.c (open_source_file): Use lbasename. Make ``p'' const
+ char *.
+
+2001-06-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/i386/xm-go32.h (SLASH_P, ROOTED_P, SLASH_CHAR)
+ (SLASH_STRING): Remove unused definitions.
+ * config/i386/xm-cygwin.h: Likewise.
+
+2001-06-12 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.c (ui_out_list_begin): Add parameter ``id''.
+ (make_cleanup_ui_out_list_begin_end): Ditto. Open the list.
+ * ui-out.h: Update declarations.
+
+Mon Jun 11 17:26:43 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * source.c (openp): Make parameters ``path'' and ``string''
+ constant.
+ (openp): Use alloca to safely duplicate ``string''. Make local
+ variables ``p'' and ``p1'' constant. Delete char* casts.
+ * defs.h: Update.
+
+ * symtab.c (lookup_symtab_1): Make parameter ``name'' constant.
+ (lookup_symtab, lookup_partial_symtab): Ditto.
+ * symtab.h (lookup_symtab, lookup_partial_symtab): Update.
+
+2001-06-11 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h (ui_out_table_begin): Make char* parameters constant.
+ (ui_out_table_header, ui_out_field_int): Ditto.
+ (ui_out_field_core_addr, ui_out_field_string): Ditto.
+ (ui_out_field_stream, ui_out_field_fmt): Ditto.
+ (ui_out_field_skip, ui_out_text, ui_out_message): Ditto.
+ * ui-out.c (ui_out_table_begin, ui_out_table_header): Update.
+ (ui_out_field_core_addr, ui_out_field_stream): Update.
+ (ui_out_field_string, ui_out_field_fmt): Update.
+ (ui_out_text, ui_out_message): Update.
+ (append_header_to_list): Make char* parameters constant.
+ (uo_table_header, uo_table_begin): Ditto.
+ (uo_field_int, uo_field_skip): Ditto.
+ (uo_field_string, uo_field_fmt): Ditto.
+ (uo_text, uo_message): Ditto.
+
+2001-06-11 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * completer.c (gdb_completer_loc_break_characters): New variable.
+ (line_completion_function): If we are completing on locations,
+ back up the start of word pointer past all characters which can
+ appear in a location spec.
+ (location_completer): New function.
+
+ * completer.h: Add prototype for location_completer.
+
+ * symtab.c (make_source_files_completion_list)
+ (add_filename_to_list, not_interesting_fname): New functions.
+ (filename_seen): New function, body extracted from
+ output_source_filename.
+ (output_source_filename): Call filename_seen to check if the file
+ was already printed.
+ (make_symbol_completion_list): If TEXT includes a
+ double-quoted string, return an empty list, not NULL.
+ (make_file_symbol_completion_list): New function, similar to
+ make_symbol_completion_list but with an additional argument
+ SRCFILE.
+
+ * symtab.h (make_file_symbol_completion_list)
+ (make_source_files_completion_list): Add prototypes.
+
+ * breakpoint.c (_initialize_breakpoint): Make location_completer
+ be the completion function for all commands which set breakpoints
+ and watchpoints.
+ (top-level): #include "completer.h".
+
+ * tracepoint.c (_initialize_tracepoint): Make location_completer
+ be the completion function for the "trace" command.
+ (top-level): #include "completer.h".
+
+ * printcmd.c (_initialize_printcmd): Make location_completer be
+ the completion function for the "print", "inspect", "call", and
+ "disassemble" commands.
+ (top-level): #include "completer.h".
+
+ * infcmd.c (_initialize_infcmd): Make location_completer be the
+ completion function for the "go", "jump", and "until" commands.
+ (top-level): #include "completer.h".
+
+2001-06-10 Christopher Faylor <cgf@redhat.com>
+
+ * gnu-regex.c: Eliminate obsolete check for _MSC_VER.
+ * utils.c (notice_quit): Remove dummy function only used for _MSC_VER.
+ * values.c (unpack_double): Remove obsolete check for _MSC_VER.
+ * defs.h: Ditto.
+ * m32r-rom.c: Ditto.
+ * p-exp.y: Ditto.
+ * ser-e7kpc.c: Ditto. Define WIN32_LEAN_AND_MEAN under _WIN32, for
+ faster compilation.
+ (get_ds_base): Remove _MSC_VER version of this function.
+ * nindy-share/ttyflush.c: Ditto.
+ * rdi-share/host.h: Ditto.
+ * ser-go32.c (dos_readchar): Remove call to obsolete function.
+ * remote-sim.c (gdb_os_poll_quit): Ditto.
+ * remote-e7000.c (expect): Remove obsolete #if 0'ed code.
+
+ * main.c (captured_main): Eliminate special Cygwin checks.
+ * ser-tcp.c: Remove unneeded __CYGWIN__ guard against system include.
+
+2001-06-09 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdbcmd_h): Add ui_out_h.
+ (breakpoint.o, infcmd.o, main.o, printcmd.o, stack.o): Ditto.
+ (thread.o, top.o): Ditto.
+
+ * ui-out.h (table_begin_ftype): Make string parameters constant.
+ (table_header_ftype): Ditto.
+ (field_int_ftype): Ditto.
+ (field_skip_ftype): Ditto.
+ (field_string_ftype): Ditto.
+ (field_fmt_ftype): Ditto.
+ (text_ftype): Ditto.
+ (message_ftype): Ditto.
+ * cli-out.c (cli_table_begin): Ditto.
+ (cli_table_header): Ditto.
+ (cli_field_int): Ditto.
+ (cli_field_skip): Ditto.
+ (cli_field_string): Ditto.
+ (cli_field_fmt): Ditto.
+ (cli_text): Ditto.
+ (cli_message): Ditto.
+ (out_field_fmt): Ditto.
+ * ui-out.c (default_table_begin): Ditto.
+ (default_table_header): Ditto.
+ (default_field_int): Ditto.
+ (default_field_skip): Ditto.
+ (default_field_string): Ditto.
+ (default_field_fmt): Ditto.
+ (default_text): Ditto.
+ (default_message): Ditto.
+
+2001-06-08 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (delete_breakpoint): Pass mark_inserted to
+ remove_breakpoint, so that the subsequent test for
+ bpt->inserted will succeed, and duplicates will be fixed up.
+
+2001-06-08 Per Bothner <per@bothner.com>
+
+ * dwarf2read.c (set_cu_language): Handle DW_LANG_Java.
+
+2001-06-07 Keith Seitz <keiths@redhat.com>
+
+ * tracepoint.c (tracepoint_opertation): Add ui event
+ notifications.
+ (trace_pass_command): Ditto.
+
+2001-06-07 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Write After Approval): Note the entry criteria.
+ (HP/PA): Jeff Law stepped down
+
+2001-06-07 Jim Blandy <jimb@redhat.com>
+
+ * gdbarch.sh: Make sure that '[' doesn't interpret interesting
+ variable values as operators.
+
+2001-06-07 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Fix quote escaping which was obsoleted
+ by last patch.
+
+2001-06-07 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Make if statements and tests
+ a little more portable.
+ Don't use shell's echo command to put strings containing
+ escaped characeters into a file -- different flavors of /bin/sh
+ require differnt levels of escaping. Use cat <<EOF instead.
+ Our internal field separator is a colon. Change all
+ commands which assume it is a space.
+
+2001-06-06 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (struct lwp_info): Add member `resumed'.
+ (iterate_over_lwps): Make sure we can handle CALLBACK deleting the
+ LWP it's called for.
+ (lin_lwp_attach): Mark LWP as resumed to make sure the fake
+ SIGSTOP is reported.
+ (resume_clear_callback): New function.
+ (resume_set_callback): New function.
+ (lin_lwp_resume): Mark all LWP's that we're going to resume as
+ resumed, and unmark all others.
+ (status_callback): Only report a pending wait status if we pretend
+ that LP has been resumed.
+ (resumed_callback): New function.
+ (lin_lwp_wait): Add assertions to check that LWP's are properly
+ marked as resumed. Partially revert 2001-05-25 patch by Michael
+ Snyder: do not resume all threads. Add comment explaining the
+ problems associated with this bit of code.
+
+2001-06-07 Keith Seitz <keiths@redhat.com>
+
+ * MAINTAINTERS: Syd Polk is stepping down from
+ maintaining libgui. I am replacing him.
+
+2001-06-07 Eli Zaretskii <elis@is.elta.co.il>
+
+ * config/mips/tm-irix6.h: New file.
+
+ * config/mips/irix6.mh: New file.
+
+ * config/mips/irix6.mt: New file.
+
+ * config/mips/xm-irix6.h: New file.
+
+ * config/mips/nm-irix6.h: New file.
+
+ * mips-tdep.c (mips_gdbarch_init) <MIPS_ABI_N32>: Set up the
+ disassembler info in tm_print_insn_info as appropriate for the N32
+ ABI. Force N32 ABI to be the default if the CPU is R8000 or
+ R10000.
+
+ * configure.tgt (mips*-sgi-irix6*): Map to irix6.
+
+ * configure.host (mips*-sgi-irix6*): Ditto.
+
+2001-06-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gnu-v3-abi.c: Include "gdb_assert.h".
+ (build_gdb_vtable_type): Replace abort() with gdb_assert().
+
+2001-06-06 Jim Blandy <jimb@redhat.com>
+
+ * cp-abi.h: Rearrange code to put documentation comments above the
+ functions we export. The actual function table itself simply
+ refers to those functions. Minor doc fixes.
+
+ * gdbarch.sh: Changes to effect the following:
+ * gdbarch.c (initialize_non_multiarch): New function.
+ * gdbarch.h (initialize_non_multiarch): New declaration.
+ * arch-utils.c (initialize_current_architecture): For
+ non-multiarch configurations, call initialize_non_multiarch.
+
+2001-06-06 Andrew Cagney <ac131313@redhat.com>
+
+ * symfile.c (compare_psymbols): Replace PTR with void*. Delete
+ declaration.
+ (compare_symbols): Ditto.
+
+2001-06-06 Jonathan Larmour <jlarmour@redhat.com>
+
+ * arch-utils.c (generic_prepare_to_proceed): Allow for having
+ stopped due to a Ctrl-C as well as breakpoints.
+
+ * hppa-tdep.c (hppa_prepare_to_proceed): Add FIXME as this may not
+ support thread switches after Ctrl-C.
+ * lin-lwp.c (lin_lwp_prepare_to_proceed): Ditto.
+ * linux-thread.c (linuxthreads_prepare_to_proceed): Ditto.
+ * m3-nat.c (mach3_prepare_to_proceed): Ditto.
+
+2001-06-06 Jim Blandy <jimb@redhat.com>
+
+ * gdbarch.sh, gdbarch.c: Revert change of 2001-06-01; all
+ per-architecture data should be registered at initialization time,
+ before any gdbarch objects get used, so the generality is
+ unnecessary.
+
+2001-06-06 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh (function_list): Add tracepoint_create,
+ tracepoint_delete, and tracepoint_modify events.
+ * gdb-events.c: Regenerated.
+ * gdb-events.h: Regenerated.
+
+2001-06-06 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Update copyrights.
+ Change free to xfree.
+ * gdb-events.c: Regenerated.
+ * gdb-events.h: Regenerated.
+
+2001-06-06 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * source.c (mod_path, openp): Use #ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ instead of #if HAVE_DOS_BASED_FILE_SYSTEM.
+ * completer.c: Ditto.
+ * cli/cli-cmds.c (cd_command): Ditto.
+
+2001-06-04 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * mips-tdep.c (show_mipsfpu_command): Remove unused variable msg.
+ (mips_set_processor_type_command): Remove unused variable j.
+ (mips_breakpoint_from_pc): Declare breakpoint instruction
+ sequences as unsigned char, to avoid compiler warnings.
+
+ * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM
+ instead of system-specific define's like _WIN32 and __MSDOS__.
+ Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and
+ ROOTED_P.
+ (top-level): #include "filenames.h".
+
+ * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH
+ instead of SLASH_CHAR, ROOTED_P and SLASH_P.
+ (top-level): #include "filenames.h".
+
+ * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions.
+ (SLASH_STRING): Define only for _WIN32.
+
+ * completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of
+ __MSDOS_.
+
+ * cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and
+ IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P. Replace
+ system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM.
+ (top-level): #include "filenames.h".
+
+ * go32-nat.c (go32_wait): Change the return value to ptid_t.
+
+ * config/djgpp/fnchange.lst: Add two new files in the
+ gdb/testsuite/gdb.c++/ directory to the remapped names.
+
+ * config/djgpp/djconfig.sh (lt_cv_sys_max_cmd_len): Set to 12KB.
+
+2001-06-01 Jim Blandy <jimb@redhat.com>
+
+ Expand the gdbarch per-architecture data vector as needed, rather
+ than requiring that all per-architecture data be registered before
+ the first gdbarch object is allocated.
+ * gdbarch.sh: Changes to effect the following:
+ * gdbarch.c (alloc_gdbarch_data, init_gdbarch_data): Delete
+ declarations and definitions.
+ (check_gdbarch_data): New function, and declaration.
+ (gdbarch_alloc): Don't call alloc_gdbarch_data; leaving the fields
+ zero is good enough.
+ (free_gdbarch_data): Tolerate a null data pointer. Free only
+ those data items gdbarch->data actually has allocated.
+ (set_gdbarch_data, gdbarch_data): Call check_gdbarch_data.
+ (gdbarch_update_p): No need to call init_gdbarch_data.
+
+2001-06-01 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (is_float_or_hfa_type_recurse): Call check_typedef()
+ on types that we wish to recurse on.
+ (slot_alignment_is_next_even): New function.
+ (ia64_push_arguments): Call slot_alignment_is_next_even() to
+ examine the type in order to decide if it's necessary to skip
+ an odd slot.
+
+2001-06-01 Michael Snyder <msnyder@redhat.com>
+
+ * thread.c (delete_step_resume_breakpoint): New function.
+ Maintain internal consistency of the thread list while deleting
+ a step_resume_breakpoint.
+ * gdbthread.h (delete_step_resume_breakpoint): Export.
+ * breakpoint.c (bpstat_find_step_resume_breakpoint):
+ Make thread-aware: don't return a step_resume_breakpoint
+ for the wrong thread.
+ * infrun.c (wait_for_inferior): Call delete_step_resume_breakpoint
+ instead of delete_breakpoint_current_contents.
+ (fetch_inferior_event): Ditto.
+ (handle_inferior_event): Call delete_step_resume_breakpoint
+ instead of delete_breakpoint.
+ * infrun.c (handle_inferior_event): After singlestepping over a
+ thread-specific breakpoint, use currently_stepping() to decide
+ whether to step or continue.
+
+2001-06-01 Jim Blandy <jimb@redhat.com>
+
+ * gnu-v3-abi.c (gnu_v3_abi_ops, vtable_type_gdbarch_data): Make
+ these static --- there's no reason other files should use these.
+
+ * partial-stab.h (case N_FUN: case 'f':, case N_FUN: case 'F':)
+ Fix memory leak.
+
+ * partial-stab.h: New complaint: function_outside_compilation_unit.
+ (case N_FUN: case 'f':, case N_FUN: case 'F':): If pst is zero,
+ complain, and don't try to set pst's start address.
+
+2001-05-31 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-tdep.c (IA64_LINUX_SIGCONTEXT_OFFSET): Revise to
+ match the location at which the kernel is placing the sigcontext
+ struct.
+
+ * ia64-tdep.c (max_skip_non_prologue_insns): New static global.
+ (refine_prologue_limit): New function.
+ (examine_prologue): Further limit number of instructions
+ scanned by calling refine_prologue_limit(). Revise way in
+ which the end of prologue address is computed for frameless
+ functions.
+
+2001-05-29 Christopher Faylor <cgf@redhat.com>
+
+ * partial-stab.h: Revert previous patch.
+
+2001-05-29 Christopher Faylor <cgf@redhat.com>
+
+ * partial-stab.h: Consistently guard against pst being NULL.
+
+2001-05-29 Alexandre Oliva <aoliva@redhat.com>
+
+ * symfile.c (compare_psymbols, compare_symbols): Declare using
+ PTR, as in the definition.
+ * minsyms.c (compare_minimal_symbols): Likewise.
+ * coffread.c (find_targ_sec): Likewise.
+ * elfread.c (free_elfinfo, elf_locate_sections): Likewise.
+ * mipsread.c (alphacoff_locate_sections): Likewise.
+ * mdebugread.c (compare_blocks): Likewise.
+
+2001-05-25 Nick Duffek <nsd@redhat.com>
+
+ * solib.c (update_solib_list): Move target_resize_to_sections()
+ into solib_map_sections() loop.
+ (info_sharedlibrary_command): Try bfd_arch_bits_per_address() if
+ bfd_get_arch_size() fails.
+
+2001-05-25 Nick Duffek <nsd@redhat.com>
+
+ * Makefile.in (osfsolib.c, osfsolib.o): Rename to solib-osf.c and
+ solib-osf.o.
+ * config/alpha/alpha-osf1.mh (NATDEPFILES): Replace osfsolib.o
+ with solib-osf.o and solib.o.
+ * config/alpha/alpha-osf2.mh: Likewise.
+ * config/alpha/alpha-osf3.mh: Likewise.
+ * solib-osf.c: New file, renamed and largely rewritten from
+ osfsolib.c.
+
+2001-05-25 Michael Snyder <msnyder@redhat.com>
+
+ * lin-lwp.c (lin_lwp_attach_lwp): Call stop_wait_callback,
+ to consume the SIGSTOP generated by PTRACE_ATTACH.
+ (stop_wait_callback): If a SIGTRAP or a SIGINT event is consumed,
+ try again to get the SIGSTOP event.
+ (lin_lwp_wait): Resume all threads when ignoring a signal.
+ This will insure that newly attached threads get resumed.
+ * lin-lwp.c (stop_wait_callback): Discard redundant SIGINT events.
+ * remote.c (remote_write_bytes): Update 'p' packet pointer.
+
+2001-05-25 Jim Blandy <jimb@redhat.com>
+
+ * gnu-v2-abi.c (gnuv2_virtual_fn_field): There's no need to clear
+ VALUE_POINTED_TO_OFFSET here; if value_cast doesn't return a
+ useful value, then we should fix that instead.
+
+2001-05-24 Nick Duffek <nsd@redhat.com>
+
+ * solist.h (struct so_list): Document the requirement that
+ current_sos initialize some fields to 0.
+
+2001-05-24 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c: Include <ctype.h>.
+ (gnu_pid_to_exec_file): Add PID parameter.
+ (set_sig_thread_cmd): Use PIDGET on return value from
+ thread_id_to_pid.
+ (proc_string): Use MERGEPID to construct argument to
+ pid_to_thread_id.
+
+2001-05-22 Kevin Buettner <kevinb@redhat.com>
+
+ * breakpoint.c (breakpoint_address_is_meaningful): New function.
+ (check_duplicates): Don't compare non-meaningful addresses.
+
+2001-05-22 Michael Snyder <msnyder@redhat.com>
+
+ * thread-db.c: Allow for defunct zombie threads.
+ (attach_thread): Do not attempt to attach zombie thread.
+ (thread_db_thread_alive): Return false for defunct zombie thread.
+ (find_new_threads_callback): Don't add defunct zombie thread to list.
+
+2001-05-22 Jim Blandy <jimb@redhat.com>
+
+ Add support for the GNU V3 C++ ABI.
+ (Includes changes by Dan Berlin.)
+
+ * gnu-v3-abi.c: New file.
+ * minsyms.c: #include "value.h" and "cp-abi.h".
+ (install_minimal_symbols): Check the minimal symbol table for
+ symbols that look mangled in the V3 style, and select the V3 ABI
+ if we find any.
+ * Makefile.in (SFILES): Add gnu-v3-abi.c.
+ (COMMON_OBS): Add gnu-v3-abi.o.
+ (gnu-v3-abi.o): Add new rule.
+ (minsyms.o): Depend on $(cp_abi_h) and $(value_h).
+
+2001-05-21 Jim Blandy <jimb@redhat.com>
+
+ * values.c (value_primitive_field): If we're extracting a base
+ class, then the type of the result should be the base class being
+ extracted, not the type of which it is a base class.
+
+ * value.h (struct value): Doc fix, and rearrange members to place
+ them near their explanations.
+
+2001-05-21 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (remote_async_wait): Added new variable fieldsize.
+ Add fieldsize (return value of hex2bin) to string pointer p.
+
+2001-05-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11-tdep.c (m68hc11_pop_frame): Fix stack pointer computation.
+ (m68hc11_analyze_instruction): Update the pc correctly.
+ (m68hc11_guess_from_prologue): Take into account the stack correction
+ for the saving address.
+
+2001-05-07 Daniel Berlin <dan@cgsoftware.com>
+
+ Changes by Jim Ingham:
+
+ * values.c (value_change_enclosing_type): New function. If the
+ new enclosing type is larger than the old one, we need to allocate
+ more space.
+ * value.h: Add value_change_enclosing_type prototype.
+ * valops.c (value_cast): Use it.
+ (value_assign): Use it.
+ (value_addr): Use it.
+ (value_ind): Use it.
+ (value_full_object): Use it.
+
+2001-05-07 Daniel Berlin <dan@cgsoftware.com>
+
+ * values.c (value_static_field): Handle static fields that have a
+ constant value.
+
+2001-05-17 Michael Snyder <msnyder@redhat.com>
+
+ * blockframe.c (create_new_frame): Zero all the fields via memset,
+ rather than zeroing them one by one.
+
+2001-05-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * top.c (user_args): Remove unused declaration.
+
+2001-05-16 Michael Snyder <msnyder@redhat.com>
+
+ * infcmd.c (do_registers_info): Move alloca outside of loop.
+
+2001-05-15 John S Kallal <jskallal@home.com>
+
+ * remote.c (remote_wait): Added new variable fieldsize.
+ Add fieldsize (return value of hex2bin) to string pointer p.
+
+2001-05-15 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-tdep.c (sparc_gdbarch_init): Get the architecture from
+ info.bfd_arch_info.
+
+2001-05-14 Kevin Buettner <kevinb@redhat.com>
+
+ * lin-lwp.c (detach_callback, lin_lwp_wait, lin_lwp_pid_to_str):
+ Adjust format strings for printing LWPs to account for the fact
+ that the type returned by GET_LWP() is now a long instead of an
+ int.
+
+2001-05-14 Kevin Buettner <kevinb@redhat.com>
+
+ * inferior.h (null_ptid, minus_one_ptid): New variable declarations.
+ (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
+ (ptid_get_tid, ptid_equal): New function declarations.
+ * infrun.c (null_ptid, minus_one_ptid): New variables.
+ (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
+ (ptid_get_tid, ptid_equal): New functions.
+ (_initialize_infrun): Initialize null_ptid, minus_one_ptid,
+ inferior_ptid, and target_last_wait_ptid.
+
+ * defs.h (ptid_t): Redefine to be a struct rather than an int.
+ (pid_to_ptid, null_ptid, ptid_equal): Delete these macros.
+ (PIDGET, TIDGET, MERGEPID): Redefine these macros using the
+ new ptid accessors and constructor.
+
+ * config/i386/tm-i386v42mp.h (PIDGET, TIDGET, LIDGET, MERGEPID,
+ MKLID, MKTID, ISTID): Provide new definitions for these macros.
+ The old macros are retained, but disabled via #if 0 in order
+ to aid in future restructuring. See FIXME.
+
+ * arm-linux-nat.c (PIDGET, TIDGET): Delete macro definitions.
+ * i386-linux-nat.c (PIDGET, TIDGET): Likewise.
+ * infptrace.c (PIDGET, TIDGET): Likewise.
+ * lin-lwp.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
+ * lin-thread.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
+ * proc-service.c (MERGEPID): Likewise.
+ * procfs.c (PIDGET, TIDGET, MERGEPID): Likewise.
+ * thread-db.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
+ * config/nm-linux.h (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise.
+ * config/i386/tm-i386sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID):
+ Likewise.
+ * config/sparc/tm-sun4sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID):
+ Likewise.
+
+ * lin-lwp.c (THREAD_FLAG): Delete macro definition.
+ (GET_LWP): Redefine in terms of ptid_get_lwp().
+ (GET_PID): Redefine in terms of ptid_get_pid().
+ (is_lwp): Redefine without the need for THREAD_FLAG.
+ (BUILD_LWP): Redefine in terms of ptid_build().
+ * lin-thread.c (THREAD_FLAG): Delete macro definition.
+ (GET_LWP): Redefine in terms of ptid_get_lwp().
+ (GET_PID): Redefine in terms of ptid_get_pid().
+ (GET_THREAD): Redefine in terms of ptid_get_tid().
+ (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
+ (is_lwp, is_thread): Redefine.
+ (linux_child_wait, check_all_signal_numbers)
+ (linuxthreads_discard_global_state, attach_thread): Declare these
+ functions to squash warnings about missing declarations.
+ * sol-thread.c (THREAD_FLAG): Delete macro definition.
+ (GET_PID): Redefine in terms of ptid_get_pid().
+ (GET_LWP): Redefine in terms of ptid_get_lwp().
+ (GET_THREAD): Redefine in terms of ptid_get_tid().
+ (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
+ (is_lwp, is_thread): Redefine.
+ * thread-db.c (THREAD_FLAG): Delete macro definition.
+ (GET_PID): Redefine in terms of ptid_get_pid().
+ (GET_LWP): Redefine in terms of ptid_get_lwp().
+ (GET_THREAD): Redefine in terms of ptid_get_tid().
+ (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build().
+ (is_lwp, is_thread): Redefine.
+
+ * corelow.c (add_to_thread_list, get_core_register_section):
+ Eliminate hacks needed to prevent regressions when inferior_ptid
+ wasn't wide enough to hold the core file thread id in the pid
+ component of inferior_ptid.
+
+2001-05-14 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (hex2bin): Make first argument const.
+ Require explicit count, don't accept null-terminated str.
+ (remote_resume, remote_async_resume): White space fix-up.
+ (remote_write_bytes): Set nr_bytes to return value of bin2hex.
+
+2001-05-13 Mark Kettenis <kettenis@gnu.org>
+
+ * symtab.c (lookup_symtab_1): Use lbasename (NAME) instead of
+ basename (NAME). The FreeBSD basename returns a pointer to a
+ static buffer, even if it's simply returning a string identical to
+ its argument.
+ (lookup_partial_symtab): Likewise.
+
+2001-05-14 Michael Snyder <msnyder@redhat.com>
+
+ * solib.c, solib.h: Add comment for function no_shared_libraries.
+
+2001-05-14 Kevin Buettner <kevinb@redhat.com>
+
+ * solib.h (no_shared_libraries): Make declaration match definition
+ in solib.c.
+
+2001-05-14 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (remote_write_bytes): Set nr_bytes before returning it.
+ * solib.h (no_shared_libraries): Declare.
+
+2001-05-12 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (struct gdbarch_info): Delete field bfd_architecture.
+ (gdbarch_update_p): Rewrite logic filling in INFO struct. Use
+ user specified values when available.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update. Get the
+ architecture from info.bfd_arch_info.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+2001-05-12 Fernando Nasser <fnasser@redhat.com>
+
+ * remote-e7000.c (e7000_open): Check for bad baud rate.
+ * remote-st.c (st2000_open): Ditto.
+
+2001-05-11 Jim Blandy <jimb@redhat.com>
+
+ * thread.c (do_captured_list_thread_ids): Use ui_out_tuple_begin
+ and ui_out_tuple_end instead of ui_out_list_begin and
+ ui_out_list_end.
+
+ * Makefile.in (gnu-v2-abi.o): Add $(demangle_h) to list of
+ dependencies. Reorder dependencies to match #includes in file,
+ for easier verification.
+
+Fri May 11 13:32:50 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c: Replace ui_out_list_begin, ui_out_list_end and
+ make_cleanup_ui_out_list_end with ui_out_tuple_begin,
+ ui_out_tuple_end and make_cleanup_ui_out_tuple_begin_end.
+ * cli/cli-setshow.c: Ditto.
+ * printcmd.c: Ditto.
+ * stack.c: Ditto.
+
+ * ui-out.h (enum ui_out_type): Fix tipo - tupple -> tuple.
+ * ui-out.c (ui_out_list_begin): Delete ``lstid'' parameter.
+ (ui_out_tuple_begin): New function.
+ (ui_out_tuple_end): New function.
+ (ui_out_tuple_begin_end): New function.
+ (make_cleanup_ui_out_list_begin_end): Replace
+ make_cleanup_ui_out_list_end function.
+ * ui-out.h (ui_out_list_begin): Update declaration.
+ (make_cleanup_ui_out_list_begin_end): Replace
+ make_cleanup_ui_out_list_end declaration.
+ (ui_out_tuple_begin, ui_out_tuple_end): Declare.
+ (ui_out_tuple_begin_end): Declare.
+
+2001-05-11 Jim Blandy <jimb@redhat.com>
+
+ * gnu-v2-abi.c: Don't #include "gdb_regex.h". We don't use it.
+
+2001-05-11 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-03-26 Rodney Brown <RodneyBrown@mynd.com>
+ * config/pa/tm-hppa.h: Remove trigraph.
+ * hp-symtab-read.c (hpread_type_translate): Provide return value.
+ (hpread_read_struct_type): Remove trigraph. Add parameter in
+ `warning'.
+ (hpread_read_array_type): Provide return value.
+ (hpread_type_lookup): Avoid ambiguous `else'. Provide return
+ value.
+ * hppa-tdep.c (initialize_hp_cxx_exception_support): Remove
+ trigraph.
+
+2001-05-11 Jim Blandy <jimb@redhat.com>
+
+ * mips-tdep.c (mips_store_return_value,
+ mips_extract_return_value): Pass arguments to
+ return_value_location in the proper order.
+
+2001-05-11 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (VERSION): Delete. Moved to file ``version.in''.
+ (version.c): Depends on file ``version.in''. Extract version
+ number from ``version.in'' file.
+ (clean mostlyclean): Update.
+ * version.in: New file.
+ * NEWS: Update.
+
+2001-05-11 Kevin Buettner <kevinb@redhat.com>
+
+ * breakpoint.c (set_raw_breakpoint): Add new parameter
+ representing the breakpoint's type. Adjust all callers.
+ (create_longjmp_breakpoint, create_temp_exception_breakpoint)
+ (create_thread_event_breakpoint): Don't test for zero return
+ value from set_raw_breakpoint(). It can never be zero.
+ (create_exception_catchpoint, watch_command_1): Move logic
+ which calculates the breakpoint type prior to the call to
+ set_raw_breakpoint().
+
+2001-05-11 Fernando Nasser <fnasser@redhat.com>
+
+ * ser-unix.c (rate_to_code): Issue warning if baud rate is invalid.
+ (hardwire_setbaudrate): Set errno to EINVAL and return with error
+ if the conversion of the baud rate to code fails.
+
+2001-05-10 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h (make_cleanup_ui_out_begin_end): Declare.
+ * ui-out.c (struct ui_out_end_cleanup_data): Define.
+ (do_cleanup_end): New function. Replace do_list_end.
+ (make_cleanup_ui_out_end): New function.
+ (make_cleanup_ui_out_begin_end): New function.
+ (make_cleanup_ui_out_list_end): Use make_cleanup_ui_out_end.
+
+2001-05-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * MAINTAINERS: Declare xcoffread.c open to all maintainers,
+ and make Kevin Buettner (kevinb@redhat.com) the reference person.
+
+2001-05-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * proc-api.c (ioctl_with_trace): Fix uninitialized variable.
+
+2001-05-10 Fernando Nasser <fnasser@redhat.com>
+
+ * MAINTAINERS: Add testsuite subdirectory co-maintainers.
+
+Thu May 10 16:26:47 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (mi-main.o): Compile with -Werror.
+
+2001-05-10 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (remote_open_1): Call no_shared_libraries, so that
+ symbols for shared libraries can be reloaded per session.
+ (remote_async_open_1): Ditto.
+ * remote.c (bin2hex, hex2bin): New functions. Factor out these
+ two conversions which are coded for repeatedly in this module.
+ (remote_threads_extra_info, remote_wait, remote_async_wait,
+ store_register_using_P, remote_store_registers, remote_write_bytes,
+ remote_read_bytes, remote_rcmd): Use bin2hex and hex2bin instead
+ of coding the conversions inline.
+ (fromhex): Not exported, change from extern to static.
+
+2001-05-10 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (initialize_current_architecture): Delete obsolete
+ ``info architecture'' command.
+ (info_architecture): Delete function.
+
+2001-05-10 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (5.1, 5.2): Update.
+
+2001-05-09 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Jim Ingham is no longer maintaining Arm related
+ stuff.
+
+2001-05-10 Keith Seitz <keiths@cygnus.com>
+
+ * Makefile.in (SUBDIR_GDBTK_OBS): Add gdbtk-bp.o, gdbtk-register.o
+ and gdbtk-stack.o.
+ (SUBDIR_GDBTK_SRCS): Ditto for the sources.
+ (gdbtk-bp.o): New rule.
+ (gdbtk-register.o): New rule.
+ (gdbtk-stack.o): New rule.
+ (gdbtk-cmds.o): Update dependencies.
+ (gdbtk.o): Ditto.
+ (gdbtk-hooks.o): Ditto.
+ (gdbtk-varobj.o): Ditto.
+
+2001-05-10 Fernando Nasser <fnasser@redhat.com>
+
+ * varobj.c (c_number_of_children): Fix memory leak. Delete unwanted old
+ variables, not just unregister them.
+
+2001-05-10 Fernando Nasser <fnasser@redhat.com>
+
+ * varobj.c (c_number_of_children): Check for target type of void*,
+ not the target type name. Allow dereferencing char*.
+
+2001-05-10 Fernando Nasser <fnasser@redhat.com>
+
+ * symfile.c (symbol_file_add_main_1): New static function.
+ Passes the flags arguments to symbol_file_add() and takes care
+ of any necessary reinitializations.
+ (symbol_file_command): Call symbol_file_add_main_1() instead of
+ symbol_file_add().
+ (symbol_file_add_main): Ditto.
+
+2001-05-09 Kevin Buettner <kevinb@redhat.com>
+
+ * lin-lwp.c (lin_lwp_pid_to_str): Revert inadvertent format
+ string change in 2001-05-03 changes.
+ (lin_lwp_wait): Revert GET_LWP coercion introduced in 2001-05-03
+ changes.
+
+2001-05-09 Kevin Buettner <kevinb@redhat.com>
+
+ * lin-lwp.c (lin_lwp_attach): Use PIDGET() to fetch the pid
+ component from inferior_ptid.
+ (lin_lwp_detach): Use pid_to_ptid() to convert from a pid to a
+ ptid.
+
+2001-05-09 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh3-rom.c (_initialize_sh3_rom): Get rid of specific _WINDOWS
+ conditional for help with connections through parallel ports,
+ given that the actual code for downloading through a parallel port
+ is not conditionalized.
+
+ * sh-tdep.c: Remove WIN32_WCE conditional. The wince sh target is
+ unmaintaned, and probably on its way to obsolescence.
+
+2001-05-09 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_frame_saved_pc): New function.
+ * config/i386/tm-i386.h (FRAME_SAVED_PC): Redefine in terms of
+ i386_frame_saved_pc.
+ (i386_frame_saved_pc): New prototype.
+
+ * i386-tdep.c (i386_register_virtual_type): New function.
+ (i386_register_convertible): New function.
+ * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE): Redefine in terms
+ of i386_register_virtual_type.
+ (REGISTER_CONVERTIBLE): Redefine in terms of
+ i386_register_convertible.
+ (i386_register_virtual_type, i386_register_convertible): New
+ prototypes.
+
+2001-05-08 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (mn10300-tdep.o): New rule.
+
+ * Makefile.in (gdb_string_h): Define. Use it throughout.
+ Some rules were already using this, even though it isn't defined.
+
+ * Makefile.in (obstack_h, target_h): Define; these are already
+ used elsewhere, but have been expanding to the empty string.
+ (memattr_h): Define; needed by target_h.
+
+ * mn10300-tdep.c (mn10300_extract_return_value): Mark this as
+ static. (This was accidentally omitted from the earlier patch.)
+
+ * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): New function.
+ (mn10300_gdbarch_init): Register it as the architecture's
+ dwarf2_reg_to_regnum method.
+
+ Correct and expand handling of `movm' instruction, and register
+ saves in general.
+ * config/mn10300/tm-mn10300.h (D0_REGNUM, A0_REGNUM, MDRQ_REGNUM,
+ MCRH_REGNUM, MCRL_REGNUM, MCVF_REGNUM): New definitions.
+ (enum movm_register_bits): New enum.
+ * mn10300-tdep.c (set_movm_offsets): Use symbolic names for the
+ bits, not hex literals. Handle the `other', `exreg0', and
+ `exother' bits. Correct handling of `exreg1': it saves r4, r5,
+ r6, and r7, not r2, r3, r4, and r5.
+ (saved_regs_size): New function.
+ (mn10300_frame_chain, mn10300_frame_saved_pc): Use it, instead
+ of computing the same thing inline, incorrectly.
+
+ * mn10300-tdep.c (mn10300_gdbarch_init): We do have a
+ dummy_breakpoint_offset; it's zero.
+
+ * mn10300-tdep.c (mn10300_pop_frame): Split the mn10300-specific
+ stuff out into mn10300_pop_frame_regular, and use
+ generic_pop_current_frame. This lets us share code, and also
+ makes this function's prototype match that expected by gdbarch.
+ Make this function static.
+ (mn10300_pop_frame_regular): New function.
+ (mn10300_gdbarch_init): Register mn10300_pop_frame as the
+ gdbarch's pop_frame method.
+ * config/mn10300/tm-mn10300.h (POP_FRAME): Delete definition.
+ (mn10300_pop_frame): Delete declaration.
+
+ * mn10300-tdep.c (mn10300_saved_pc_after_call,
+ mn10300_extract_return_value,
+ mn10300_extract_struct_value_address, mn10300_store_return_value,
+ mn10300_use_struct_convention, mn10300_breakpoint_from_pc,
+ mn10300_frame_chain, mn10300_skip_prologue,
+ mn10300_push_arguments, mn10300_push_return_address,
+ mn10300_store_struct_return, mn10300_frame_saved_pc,
+ mn10300_init_extra_frame_info, mn10300_frame_init_saved_regs):
+ Make these functions static; they should only be visible to the
+ outside world as gdbarch methods.
+
+ * config/mn10300/tm-mn10300.h (mn10300_find_callers_reg): Delete
+ unused declaration.
+
+ * mn10300-tdep.c (mn10300_gdbarch_init): Put the gdbarch methods
+ in some rational order.
+
+ * mn10300-tdep.c (mn10300_gdbarch_init): Rather than using
+ generic_pc_in_call_dummy, use pc_in_call_dummy_at_entry_point.
+
+ Use gdbarch for most target parameters for the MN10300, rather
+ than the tm-*.h file.
+ * config/mn10300/tm-mn10300.h (MAX_REGISTER_VIRTUAL_SIZE,
+ REGISTER_BYTES, FP_REGNUM, BREAKPOINT_FROM_PC,
+ FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK, INNER_THAN,
+ SAVED_PC_AFTER_CALL, INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS,
+ FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC,
+ EXTRACT_RETURN_VALUE, EXTRACT_STRUCT_VALUE_ADDRESS,
+ STORE_RETURN_VALUE, STORE_STRUCT_RETURN, SKIP_PROLOGUE,
+ FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS,
+ FRAME_NUM_ARGS, POP_FRAME, USE_GENERIC_DUMMY_FRAMES, CALL_DUMMY,
+ CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET,
+ CALL_DUMMY_LOCATION, FIX_CALL_DUMMY, CALL_DUMMY_ADDRESS,
+ TARGET_READ_FP, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME,
+ SAVE_DUMMY_FRAME_TOS, PUSH_ARGUMENTS, PC_IN_CALL_DUMMY,
+ REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER):
+ Delete definitions. We register gdbarch methods for these now.
+ (struct frame_info, struct type, struct value): Delete forward
+ declarations of these types; they're no longer necessary, since we
+ don't have function declarations here any more.
+ * mn10300-tdep.c: #include "arch-utils.h", to get declarations for
+ some default gdbarch methods.
+ (mn10300_store_struct_return): Return void, as expected by
+ gdbarch.
+ (mn10300_init_extra_frame_info): Take initial `fromleaf' argument,
+ as expected by gdbarch.
+ (mn10300_frame_init_saved_regs): Provide dummy definition for
+ this, as required by gdbarch.
+ (mn10300_gdbarch_init): Add mn10300_call_dummy_words, as expected
+ by gdbarch. Register gdbarch methods or values for all the stuff
+ removed from tm-10300.h, listed above.
+
+2001-05-08 Andrew Cagney <ac131313@redhat.com>
+
+ * cli-out.c (cli_begin, cli_end): Replace cli_list_begin and
+ cli_list_end.
+ (cli_ui_out_impl): Update.
+
+ * ui-out.c (default_begin, default_end): Replace
+ default_list_begin and default_list_end.
+ (default_ui_out_impl): Update.
+ (uo_begin, uo_end): Replace ou_list_begin and uo_list_end.
+ (ui_out_begin, ui_out_end): Replace ui_out_list_begin and
+ ui_out_list_end.
+ (ui_out_list_begin, ui_out_list_end): New. Compatibility
+ functions.
+ (struct ui_out_level): Add field type.
+ (push_level, pop_level): Update. Add type parameter.
+
+ * ui-out.h (enum ui_out_type): Declare.
+ (ui_out_begin, ui_out_end): Declare.
+ (ui_out_begin_ftype, ui_out_end_ftype): Replace list_begin_ftype
+ and list_end_ftype.
+ (struct ui_out_impl): Update.
+
+2001-05-07 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h (list_begin_ftype, list_end_ftype): Rename argument
+ ``list_flag'' to ``depth''.
+ * ui-out.c (default_list_begin, default_list_end): Update.
+ (uo_list_begin, uo_list_end): Update.
+ (MAX_UI_OUT_LEVELS): Define.
+ (struct ui_out_level): Define.
+ (top-level): Include "gdb_assert.h".
+ (struct ui_out): Add fields ``level'' and ``levels''. Delete
+ fields ``list_flag'' and ``field_count''.
+ (ui_out_new): Update.
+ (verify_field_proper_position): Update.
+ (current_level, push_level, pop_level): New functions.
+ (ui_out_list_begin): Use push_level.
+ (ui_out_list_end): Use pop_level.
+ (ui_out_field_int): Use current_level.
+ (ui_out_field_skip): Ditto.
+ (ui_out_field_fmt): Ditto.
+
+2001-05-08 Michael Snyder <msnyder@redhat.com>
+
+ * language.c (longest_local_hex_string_custom): Strlen test is
+ inverted -- reverse the sense of the test.
+
+2001-05-08 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386v.h (struct frame_info, struct
+ frame_saved_regs): Remove declarations.
+ (i386_frame_num_args): Remove prototype.
+
+2001-05-07 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: I'm no longer actively maintaining the mn10300
+ target.
+
+2001-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * main.c (captured_main): Delete #ifndef _WIN32 conditional for
+ WinGDB.
+
+2001-05-06 Kevin Buettner <kevinb@redhat.com>
+
+ * inferior.h (save_inferior_ptid): Declare.
+ * infrun.c (save_inferior_ptid, restore_inferior_ptid): Define.
+
+ * hpux-thread.c (save_inferior_ptid, restore_inferior_ptid):
+ Delete these functions.
+ * lin-lwp.c (save_inferior_ptid, restore_inferior_ptid): Likewise.
+ * lin-thread.c (save_inferior_ptid, restore_inferior_ptid): Likewise.
+ * linux-thread.c (save_inferior_ptid, restore_inferior_ptid):
+ Likewise.
+ * proc-service.c (save_inferior_ptid, restore_inferior_ptid):
+ Likewise.
+ * sol-thread.c (save_inferior_ptid, restore_inferior_ptid): Likewise.
+ * thread-db.c (save_inferior_ptid, restore_inferior_ptid): Likewise.
+
+ * somsolib.c (reset_inferior_ptid): Delete.
+ (som_solib_remove_inferior_hook): Use save_inferior_ptid() to
+ build the cleanup struct.
+
+ * breakpoint.c (reattach_breakpoints, detach_breakpoints): Use
+ a cleanup to save/restore inferior_ptid.
+
+2001-05-06 Mark Kettenis <kettenis@gnu.org>
+
+ Implement attach/detach for multi-threaded programs on Linux.
+ * thread-db.c (keep_thread_db): Adjust comment.
+ (deactivate_target): Removed.
+ (thread_db_new_objfile): Don't call deactivate_target. Implement
+ guts of deactivate_target inline instead.
+ (attach_thread): Call ATTACH_LWP unconditionally if defined.
+ (thread_db_attach): New function.
+ (thread_db_detach): Don't call deactivate_target. Do necessary
+ cleanup inline instead. Set inferior_ptid to LWP corresponding to
+ the current user-level thread.
+ (thread_db_kill): Set inferior_ptid to LWP corresponding to the
+ current user-level thread.
+ (thread_db_create_inferior): Deactivate target vector if
+ KEEP_THREAD_DB is zero.
+ (thread_db_mourn_inferior): Don't call deactivate_target. Do
+ necessary cleanup inline instead.
+ (init_thread_db_ops): Initialize to_attach field to
+ thread_db_attach.
+ * lin-lwp.c (lin_lwp_mourn_inferior): Remove prototype.
+ (stop_wait_callback): Add prototype.
+ (init_lwp_list): Add comment about when to re-initialize the LWP
+ list.
+ (lin_lwp_attach_lwp): Only call ptrace for cloned processes.
+ Avoid adding publicates to the LWP list. Only mark an LWP as
+ signalled if it doesn't correspond to a cloned process.
+ (lin_lwp_attach): Add initial process to the LWP list. Make sure
+ it's stopped and fake a SIGSTOP.
+ (detach_callback): New function.
+ (lin_lwp_detach): Implement.
+ (lin_lwp_create_inferior): Don't re-initialize LWP list here.
+ Call child_ops.to_create_inferior directly instead of via
+ target_beneath local.
+ (lin_lwp_mourn_inferior): Call child_ops.to_mourn_inferior
+ directly instead of via target_beneath local.
+
+2001-05-06 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * symtab.c (lookup_symtab_1, lookup_partial_symtab): Use basename
+ instead of non-portable search for `/'. Use FILENAME_CMP instead
+ of STREQ, to account for case-insensitive filesystems.
+ (top-level): #include "filenames.h".
+
+2001-05-05 Jim Blandy <jimb@redhat.com>
+
+ * breakpoint.c (check_duplicates): Use the breakpoint's type, not
+ its address, to decide whether it's a watchpoint or not. Zero
+ is a valid code address.
+ (update_breakpoints_after_exec): Admonishing comments.
+ * breakpoint.h (struct breakpoint): Doc fixes.
+
+ * breakpoint.c (check_duplicates): Take a breakpoint object as an
+ argument, rather than an address and section. All callers changed.
+
+2001-05-03 Kevin Buettner <kevinb@redhat.com>
+
+ * defs.h (ptid_t): New typedef.
+ (pid_to_ptid, null_ptid, minus_one_ptid, ptid_equal): New macros.
+
+ * a68v-nat.c, alphabsd-nat.c, arch-utils.c, arm-linux-nat.c,
+ blockframe.c, breakpoint.c, breakpoint.h,
+ config/i386/nm-i386sol2.h, config/i386/tm-i386sco5.h,
+ config/ia64/nm-linux.h, config/m68k/nm-hp300bsd.h,
+ config/mips/nm-irix4.h, config/mips/nm-irix5.h,
+ config/pa/nm-hppah.h, config/pa/tm-hppa.h,
+ config/rs6000/nm-rs6000.h, config/sparc/nm-sun4sol2.h,
+ corelow.c, cxux-nat.c, d10v-tdep.c, dink32-rom.c,
+ dve3900-rom.c, fork-child.c, frame.c, gnu-nat.c, go32-nat.c,
+ hp300ux-nat.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c,
+ hpux-thread.c, i386-linux-nat.c, i386aix-nat.c, i386b-nat.c,
+ i386bsd-nat.c, i386gnu-nat.c, i386mach-nat.c, i386nbsd-nat.c,
+ infcmd.c, inferior.h, inflow.c, infptrace.c, infrun.c,
+ inftarg.c, infttrace.c, lin-lwp.c, lin-thread.c,
+ linux-thread.c, lynx-nat.c, m3-nat.c, m32r-rom.c,
+ m68knbsd-nat.c, m88k-nat.c, mac-nat.c, mips-nat.c,
+ mon960-rom.c, monitor.c, ns32knbsd-nat.c, ocd.c, ppc-bdm.c,
+ ppcnbsd-nat.c, proc-service.c, procfs.c, ptx4-nat.c,
+ regcache.c, remote-adapt.c, remote-array.c, remote-bug.c,
+ remote-e7000.c, remote-es.c, remote-mips.c, remote-mm.c,
+ remote-nindy.c, remote-os9k.c, remote-rdi.c, remote-rdp.c,
+ remote-sds.c, remote-sim.c, remote-st.c, remote-udi.c,
+ remote-vx.c, remote.c, rs6000-nat.c, sol-thread.c,
+ solib-aix5.c, solib-svr4.c, somsolib.c, sparc-nat.c,
+ standalone.c, sun3-nat.c, sun386-nat.c, symm-nat.c, target.c,
+ target.h, thread-db.c, thread.c, top.c, ultra3-nat.c,
+ uw-thread.c, v850ice.c, win32-nat.c, wince.c, xcoffsolib.c
+ (inferior_pid): Rename to inferior_ptid everywhere - even in
+ comments and obsolete ports. In cases where this variable
+ really is supposed to be used as a process id, use PIDGET() to
+ extract the process id component from inferior_ptid. The
+ other cases, either involving other variables whose types had
+ to be changed or functions whose signatures had to changed
+ are listed separately below.
+
+ * arm-linux-nat.c (get_thread_id): Change type of argument
+ representing a combined process/thread id from ``int'' to
+ ``ptid_t''. Also change parameter name to ptid.
+ * breakpoint.h, breakpoint.c (breakpoint_thread_match): Likewise.
+ * corelow.c (core_file_thread_alive): Likewise.
+ * d10v-tdep.c (d10v_read_pc, d10v_write_pc): Likewise.
+ * defs.h (*target_wait_hook): Likewise.
+ * gdbthread.h (thread_info, delete_thread, pid_to_thread_id)
+ (find_thread_pid, save_infrun_state, load_infrun_state): Likewise.
+ * gnu-nat.c (gnu_thread_alive, gnu_pid_to_str, gnu_wait)
+ (gnu_resume): Likewise.
+ * go32-nat.c (go32_wait, go32_resume): Likewise.
+ * h8500-tdep.c (h8500_read_pc, h8500_write_pc): Likewise.
+ * hppa-tdep.c (target_read_pc, target_write_pc): Likewise.
+ * hppah-nat.c (child_pid_to_str, hppa_tid_to_str,
+ (hppa_pid_or_tid_to_str, child_post_startup_inferior)
+ (child_thread_alive): Likewise.
+ * hpux-thread.c (hpux_thread_notice_signals, hpux_thread_alive)
+ (hpux_pid_to_str, hpux_thread_wait, hpux_thread_resume): Likewise.
+ * i386-linux-nat.c (child_resume): Likewise.
+ * ia64-linux-nat.c (enable_watchpoints_in_psr, fetch_debug_register)
+ (store_debug_register, fetch_debug_register_pair)
+ (store_debug_register_pair, ia64_linux_insert_watchpoint)
+ (ia64_linux_remove_watchpoint, ia64_linux_stopped_by_watchpoint):
+ Likewise.
+ * ia64-tdep.c (ia64_read_pc, ia64_write_pc): Likewise.
+ * inferior.h (read_pc_pid, generic_target_read_pc, write_pc_pid)
+ (generic_target_write_pc, ptrace_wait, child_resume)
+ (get_last_target_status): Likewise.
+ * infptrace.c (ptrace_wait, child_resume): Likewise.
+ * inftarg.c (child_wait, child_post_wait, child_thread_live)
+ (child_pid_to_str): Likewise.
+ * infttrace.c (ptrace_wait, child_thread_alive, child_resume)
+ (hppa_pid_or_tid_to_str, child_post_startup_inferior): Likewise.
+ * lin-lwp.c (add_lwp, delete_lwp, find_lwp_pid, lin_lwp_attach_lwp)
+ (lin_lwp_resume, lin_lwp_wait, lin_lwp_thread_alive)
+ (lin_lwp_pid_to_str): Likewise.
+ * lin-thread.c (thread_db_alive, thread_db_pid_to_str)
+ (thread_db_resume, thread_db_wait): Likewise.
+ * linux-thread.c (linuxthreads_thread_alive, linuxthreads_pid_to_str)
+ (linuxthreads_resume, linuxthreads_wait): Likewise.
+ * lynx-nat.c (child_wait, child_thread_alive, child_resume)
+ (child_pid_to_str): Likewise.
+ * m3-nat.c (mach_really_wait, m3_resume): Likewise.
+ * mac-nat.c (child_wait, child_resume): Likewise.
+ * mips-tdep.c (mips_read_pc): Likewise.
+ * monitor.c (monitor_wait, monitor_resume): Likewise.
+ * ocd.c, ocd.h (ocd_thread_alive, ocd_resume): Likewise.
+ * ppc-bdm.c (bdm_ppc_wait): Likewise.
+ * procfs.c (do_attach, procfs_wait, procfs_resume)
+ (procfs_notice_signals, procfs_thread_alive, procfs_pid_to_str)
+ (procfs_set_watchpoint, procfs_stopped_by_watchpoint)
+ (procfs_find_LDT_entry): Likewise.
+ * regcache.c (read_register_pid, read_signed_register_pid)
+ (write_register_pid, generic_target_read_pc, read_pc_pid)
+ (generic_target_write_pc, write_pc_pid): Likewise.
+ * regcache.h (read_register_pid, read_signed_register_pid)
+ (write_register_pid): Likewise.
+ * remote-adapt.c (adapt_wait, adapt_resume): Likewise.
+ * remote-array.c (array_wait, array_resume): Likewise.
+ * remote-bug.c (bug_wait, bug_resume): Likewise.
+ * remote-e7000.c (e7000_wait, e7000_resume): Likewise.
+ * remote-eb.c (eb_wait, eb_resume): Likewise.
+ * remote-es.c (es1800_wait, es1800_resume): Likewise.
+ * remote-mips.c (mips_wait, mips_resume): Likewise.
+ * remote-mm.c (mm_wait, mm_resume): Likewise.
+ * remote-nindy.c (nindy_wait, nindy_resume): Likewise.
+ * remote-os9k.c (rombug_wait, rombug_resume): Likewise.
+ * remote-rdi.c (arm_rdi_wait, arm_rdi_resume): Likewise.
+ * remote-rdp.c (remote_rdp_resume, remote_rdp_wait): Likewise.
+ * remote-sds.c (sds_wait, sds_resume): Likewise.
+ * remote-sim.c (gdbsim_wait, gdbsim_resume): Likewise.
+ * remote-st.c (st2000_wait, st2000_resume): Likewise.
+ * remote-udi.c (udi_wait, udi_resume): Likewise.
+ * remote-vx.c (vx_wait, vx_resume): Likewise.
+ * remote.c (remote_current_thread, remote_resume, remote_wait)
+ (remote_async_resume, remote_async_wait, remote_cisco_wait)
+ (remote_thread_alive): Likewise.
+ * sol-thread.c (thread_to_lwp, lwp_to_thread, sol_thread_resume)
+ (sol_thread_wait, sol_thread_notice_signals, sol_thread_alive)
+ (solaris_pid_to_str): Likewise.
+ * symm-nat.c (child_wait, child_resume): Likewise.
+ * target.c (debug_to_resume, debug_to_wait, debug_to_post_wait)
+ (debug_to_notice_signals, debug_to_thread_alive)
+ (normal_target_post_startup_inferior, normal_pid_to_str)
+ (debug_to_post_startup_inferior): Likewise.
+ * target.h (to_resume, to_wait, to_post_wait)
+ (to_post_startup_inferior, to_notice_signals, to_thread_alive)
+ (to_pid_to_str [all in struct target_ops]): Likewise.
+ (child_post_wait, child_thread_alive, normal_pid_to_str): Likewise.
+ * thread-db.c (thread_from_lwp, lwp_from_thread, thread_db_wait)
+ (attach_thread, detach_thread, thread_db_resume, check_event)
+ (thread_db_post_startup_inferior, thread_db_thread_alive)
+ (thread_db_pid_to_str): Likewise.
+ * thread.c (add_thread, delete_thread, find_thread_pid)
+ (pid_to_thread_id, in_thread_list, load_infrun_state)
+ (save_infrun_state, switch_to_thread, restore_current_thread)
+ (make_cleanup_restore_current_thread): Likewise.
+ * top.c (target_wait_hook): Likewise.
+ * uw-thread.c (dbgpid, thr_to_lwp, lwp_to_thr, add_thread_uw)
+ (uw_thread_resume, libtrhead_stub, uw_thread_wait, uw_thread_alive)
+ (uw_thread_pid_to_str): Likewise.
+ * v850ice.c (v850ice_wait, v850ice_resume): Likewise.
+ * win32-nat.c (child_wait, child_resume, win32_child_thread_alive)
+ (cywin_pid_to_str): Likewise.
+ * wince.c (child_wait, child_resume, win32_child_thread_alive):
+ Likewise.
+ * config/nm-linux.h (linuxthreads_pid_to_str): Likewise.
+ * config/nm-lynx.h (child_wait, lynx_pid_to_str): Likewise.
+ * config/alpha/nm-linux.h (lin_lwp_attach_lwp): Likewise.
+ * config/arm/nm-linux.h (lin_lwp_attach_lwp): Likewise.
+ * config/h8500/tm-h8500.h (h8500_read_pc, h8500_write_pc): Likewise.
+ * config/i386/nm-i386sol2.h (procfs_stopped_by_watchpoint)
+ (procfs_set_watchpoint): Likewise.
+ * config/i386/nm-linux.h (lin_lwp_attach_lwp): Likewise.
+ * config/i386/nm-ptx4.h (child_wait): Likewise.
+ * config/i386/nm-symmetry.h (child_wait): Likewise.
+ * config/i386/tm-cygwin.h (cygwin_pid_to_str): Likewise.
+ * config/ia64/nm-linux.h (ia64_linux_stopped_by_watchpoint)
+ (ia64_linux_insert_watchpoint, ia64_linux_remove_watchpoint)
+ (lin_lwp_attach_lwp): Likewise.
+ * config/mips/nm-irix4.h, config/mips/nm-irix5.h
+ (procfs_stopped_by_watchpoint, procfs_set_watchpoint): Likewise.
+ * config/pa/nm-hppah.h (child_pid_to_str, hppa_tid_to_str)
+ (hppa_pid_or_tid_to_str): Likewise.
+ * config/pa/tm-hppa.h (target_read_pc, target_write_pc): Likewise.
+ * config/powerpc/nm-linux.h (lin_lwp_attach_lwp): Likewise.
+ * config/sparc/nm-sun4sol2.h (procfs_stopped_by_watchpoint)
+ (procfs_set_watchpoint): Likewise.
+
+ * gdbthread.h (thread_id_to_pid): Change return type which
+ represents a combined process/thread id from ``int'' to
+ ``ptid_t''.
+ * gnu-nat.c (gnu_wait): Likewise.
+ * go32-nat.c (go32_wait): Likewise.
+ * hpux-thread.c (hpux_thread_wait): Likewise.
+ * inferior.h (procfs_first_available): Likewise.
+ * inftarg.c (child_wait): Likewise.
+ * infttrace.c (ptrace_wait): Likewise.
+ * lin-lwp.c (lin_lwp_wait): Likewise.
+ * lin-thread.c (thread_db_wait): Likewise.
+ * linux-thread.c (linuxthreads_wait): Likewise.
+ * lynx-nat.c (child_wait): Likewise.
+ * m3-nat.c (mach_really_wait): Likewise.
+ * mac-nat.c (child_wait): Likewise.
+ * monitor.c (monitor_wait): Likewise.
+ * ppc-bdm.c (bdm_ppc_wait): Likewise.
+ * procfs.c (do_attach, procfs_wait, procfs_first_available): Likewise.
+ * remote-adapt.c (adapt_wait): Likewise.
+ * remote-array.c (array_wait): Likewise.
+ * remote-bug.c (bug_wait): Likewise.
+ * remote-e7000.c (e7000_wait): Likewise.
+ * remote-eb.c (eb_wait): Likewise.
+ * remote-es.c (es1800_wait): Likewise.
+ * remote-mips.c (mips_wait): Likewise.
+ * remote-mm.c (mm_wait): Likewise.
+ * remote-nindy.c (nindy_wait): Likewise.
+ * remote-os9k (rombug_wait): Likewise.
+ * remote-rdi.c (arm_rdi_wait): Likewise.
+ * remote-rdp.c (remote_rdp_wait): Likewise.
+ * remote-sds.c (sds_wait): Likewise.
+ * remote-sim.c (gdbsim_wait): Likewise.
+ * remote-st.c (st2000_wait): Likewise.
+ * remote-udi.c (udi_wait): Likewise.
+ * remote-vx.c (vx_wait): Likewise.
+ * remote.c (remote_wait, remote_async_wait, remote_current_thread)
+ (remote_cisco_wait): Likewise.
+ * sol-thread.c (thread_to_lwp, lwp_to_thread, sol_thread_wait):
+ Likewise.
+ * symm-nat.c (child_wait): Likewise.
+ * target.c (debug_to_wait): Likewise.
+ * target.h (to_wait [in struct target_ops]): Likewise.
+ * thread.c (thread_id_to_pid): Likewise.
+ * thread-db.c (thread_from_lwp, lwp_from_thread, thread_db_wait):
+ Likewise.
+ * top.c (*target_wait_hook): Likewise.
+ * uw-thread.c (lwp_to_thr, uw_thread_wait): Likewise.
+ * v850ice.c (v850ice_wait): Likewise.
+ * win32-nat.c (child_wait): Likewise.
+ * wince.c (child_wait): Likewise.
+ * config/nm-lynx.h (child_wait): Likewise.
+ * config/i386/nm-ptx4.h (child_wait): Likewise.
+ * config/i386/nm-symmetry.h (child_wait): Likewise.
+
+ * arch-utils.c (generic_prepare_to_proceed): Rename wait_pid
+ to wait_ptid and change its type from ``int'' to ``ptid_t''.
+ * breakpoint.c (reattach_breakpoints, detach_breakpoints): Likewise,
+ but rename saved_inferior_pid to saved_inferior_ptid.
+ * d10v-tdep.c (d10v_read_pc, d10_write_pc): Likewise, but rename
+ save_pid to save_ptid.
+ * gdbthread.h (struct thread_info): Likewise, but rename pid to ptid.
+ * hppah-nat.c (child_pid_to_exec): Likewise, but rename
+ saved_inferior_pid to saved_inferior_ptid.
+ * hpux-thread.c (main_ptid): Likewise, but rename from main_pid.
+ * infrun.c (previous_inferior_pid [static global]): Likewise,
+ but rename to previous_inferior_ptid.
+ (resume): Likewise, but rename resume_pid to resume_ptid.
+ (struct execution_control_state): Likewise, but rename
+ pid to ptid, saved_inferior_pid to saved_inferior_ptid,
+ and waiton_pid to waiton_ptid.
+ (target_last_wait_pid): Likewise, but rename to
+ target_last_wait_ptid.
+ * infttrace.c (saved_real_pid): Likewise, but rename to
+ saved_real_ptid.
+ (child_pid_to_exec_file): Likewise, but rename saved_inferior_pid
+ to saved_inferior_ptid.
+ * lin-lwp.c (struct lwp_info): Likewise, but rename pid to ptid.
+ (trap_ptid): Likewise, but renamed from trap_pid.
+ * lin-thread.c (handle_new_thread): Likewise, but rename gdb_pid
+ to gdb_ptid.
+ * linux-thread.c (detach_thread): Likewise, but rename pid to ptid.
+ (thread_db_wait): Likewise, but rename ret_pid to retptid.
+ * procfs.c (procfs_wait): Likewise, for retval whose name
+ doesn't change. Also, ``temp'' becomes two separate variables,
+ one named temp_tid (an int) and the other temp_ptid.
+ (procfs_notice_thread): Likewise (type change) for gdb_threadid
+ whose name does not change.
+ * regcache.c (registers_ptid): Likewise, but renamed from
+ registers_pid.
+ (read_register_pid, read_signed_register_pid, write_register_pid):
+ Likewise, but rename save_pid to save_ptid.
+ (read_pc_pid, write_pc_pid): Likewise, but rename saved_inferior_pid
+ to saved_inferior_ptid.
+ * remote.c (remote_newthread_step): Likewise, but rename pid to ptid.
+ * sol-thread.c (struct ps_prochandle): Likewise.
+ (sol_thread_resume): Likewise, for save_pid which becomes save_ptid.
+ (sol_thread_wait): Likewise, for rtnval whose name does not
+ change, and for save_pid which becomes save_ptid.
+ (solaris_pid_to_str): Likewise for lwp whose name does not change.
+ (sol_find_new_threads_callback): Likewise, for pid which becomes
+ ptid.
+ * target.h (target_resume, target_wait, target_post_wait)
+ (target_post_startup_inferior, target_notice_signals)
+ (target_thread_alive): Likewise.
+ * thread.c (info_threads_command): Likewise, but rename
+ current_pid to current_ptid.
+ (struct current_thread_cleanup): Likewise, but rename field
+ inferior_pid to inferior_ptid.
+ * thread-db.c (find_new_threads_callback): Likewise, but rename
+ pid to ptid.
+ * uw-thread.c (thr_to_lwp): Likewise for lid whose name does not
+ change.
+ (lwp_to_tr): Likewise fo tid whose name remains unchanged.
+ (thr_infpid, lwp_infpid, notice_thread, libthread_stub): Likewise,
+ but rename pid to ptid.
+ * config/alpha/nm-linux.h (ATTACH_LWP): Likewise.
+ * config/arm/nm-linux.h (ATTACH_LWP): Likewise.
+ * config/i386/nm-linux.h (ATTACH_LWP): Likewise.
+ * config/ia64/nm-linux.h (ATTACH_LWP): Likewise.
+ * config/pa/nm-hppah.h (target_tid_to_str): Likewise.
+ * config/powerpc/nm-linux.h (ATTACH_LWP): Likewise.
+
+ * arch-utils.c (generic_prepare_to_proceed): Test for the
+ "zero" ptid by using ptid_equal() to test to see if variable
+ in question is the same as null_ptid. This replaces a direct
+ test against zero.
+ * cxux-nat.c (add_shared_symbol_files): Likewise.
+ * i386aix-nat.c, i386b-nat.c (i386_float_info): Likewise.
+ * infcmd.c (run_command): Likewise.
+ * inflow.c (kill_command): Likewise.
+ * infttrace.c (call_ttrace): Likewise.
+ * lin-lwp.c (lin_lwp_prepare_to_proceed): Likewise.
+ * lin-thread.c (thread_db_kill): Likewise.
+ * procfs.c (procfs_kill_inferior, procfs_mourn_inferior): Likewise.
+ * remote-es.c (es1800_kill): Likewise.
+ * sol-thread.c (sol_thread_create_inferior): Likewise.
+ * solib.c (locate_base): Likewise.
+ * target.c (nosupport_runtime): Likewise.
+ * thread-db.c (thread_db_wait): Likewise.
+ * top.c (quit_confirm, quit_force): Likewise.
+ * uw-thread (lwp_infpid, uw_thread_resume): Likewise.
+
+ * infrun.c (handle_inferior_event, stop_stepping, normal_stop):
+ Use ptid_equal to compare value of process/thread ids instead of
+ ``=='' and ``!='' operators.
+ lin-lwp.c (delete_lwp, lin_lwp_prepare_to_proceed)
+ (stop_wait_callback, lin_lwp_wait): Likewise.
+ * procfs.c (procfs_wait): Likewise.
+ * regcache.c (read_register_bytes, read_register_gen)
+ (write_register_gen, read_register, read_register_pid)
+ (read_signed_register, read_signed_register_pid, write_register)
+ (write_register_pid, supply_register): Likewise.
+ * remote-vx.c (vx_resume): Likewise.
+ * sol-thread.c (sol_thread_wait): Likewise.
+ * symm-nat.c (kill_inferior): Likewise.
+ * thread.c (delete_thread, find_thread_pid, pid_to_thread_id)
+ (in_thread_list, info_threads_command, switch_to_thread)
+ (restore_current_thread): Likewise.
+ * uw-thread (libtread_stub): Likewise.
+
+ * arm-linux-nat.c (GET_THREAD_ID): Change PID to PTID.
+
+ * corelow.c (add_to_thread_list): Convert argument in add_thread()
+ call to a ptid_t.
+ * gnu-nat.c (inf_validate_procs): Likewise.
+ * linux-thread.c (stop_thread, update_stop_threads): Likewise.
+ * remote.c (record_currthread, remote_threads_info): Likewise.
+ * win32-nat.c (child_add_thread): Likewise.
+
+ * hpux-thread.c (save_inferior_pid, restore_inferior_pid): Rename,
+ respectively, to save_inferior_ptid() and restore_inferior_ptid().
+ Adjust implementations to operate on ``ptid_t'' instead of ``int''.
+ * lin-lwp.c (save_inferior_pid, restore_inferior_pid): Likewise.
+ * lin-thread.c (save_inferior_pid, restore_inferior_pid): Likewise.
+ * linux-thread.c (save_inferior_pid, restore_inferior_pid): Likewise.
+ * proc-service.c (save_inferior_pid, restore_inferior_pid): Likewise.
+ * sol-thread.c (save_inferior_pid, restore_inferior_pid): Likewise.
+ * thread-db.c (save_inferior_pid, restore_inferior_pid): Likewise.
+
+ * infrun.c (RESUME_ALL): New macro representing the -1 ptid
+ to be passed to target_resume() when all threads should resume.
+ (resume): Set resume_ptid to RESUME_ALL rather than -1.
+ (handle_inferior_event): Invoke target_resume() with RESUME_ALL
+ instead of -1.
+ * irix5-nat.c (solib_create_inferior_hook): Convert -1 to
+ a ptid_t in target_resume() call.
+ * osfsolib.c (solib_create_inferior_hook): Likewise.
+ * solib-svr4.c (solib_create_inferior_hook): Likewise.
+
+ * lin-lwp.c (PIDGET, PIDGET0): Rename original PIDGET macro to
+ PIDGET0. Define new PIDGET macro which uses PIDGET0, the only
+ difference being that the 0xffff pattern will be interpreted
+ as -1.
+ * lin-thread.c (PIDGET, PIDGET0): Likewise.
+ * thread-db.c (PIDGET, PIDGET0): Likewise.
+ * config/nm-linux.h (PIDGET, PIDGET0): Likewise.
+ * config/i386/tm-i386sol2.h (PIDGET, PIDGET0): Likewise.
+ * config/i386/tm-i386v42mp.h (PIDGET, PIDGET0): Likewise.
+ * config/sparc/tm-sun4sol2.h (PIDGET, PIDGET0): Likewise.
+
+ * m3-nat.c (init_m3_ops): Fix typo; initialize to_wait field to
+ mach_really_wait rather than mach_really__wait.
+ * lin-thread.c (check_for_thread_event): Fix warning; make function
+ actually return a value.
+
+ * gdbarch.sh (TARGET_READ_PC, TARGET_WRITE_PC): Change type of
+ ``pid'' arguments from ``int'' to ``ptid_t''. Also renamed
+ pid to ptid.
+ * gdbarch.h, gdbarch.c: Regenerated.
+
+2001-05-03 Jonathan Larmour <jlarmour@redhat.com>
+
+ * rdi-share/devsw.c: Include <time.h> for struct tm
+
+2001-05-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Add mappings for the new
+ opcodes/openrisc-* files.
+
+2001-05-01 Michael Snyder <msnyder@redhat.com>
+
+ * lin-lwp.c: Change printf to fprintf_unfiltered.
+ * Makefile.in: Add rules for thread-db.o, lin-lwp.o, proc-service.o.
+
+2001-05-01 Nicholas Duffek <nsd@redhat.com>
+
+ * config/rs6000/tm-rs6000.h (IN_SOLIB_RETURN_TRAMPOLINE): Define.
+ (rs6000_in_solib_return_trampoline): Declare.
+ * rs6000-tdep.c (rs6000_in_solib_return_trampoline): New
+ function.
+ (rs6000_skip_trampoline_code): Skip bigtoc fixup code.
+ * xcoffread.c (read_xcoff_symtab): Perform the ISFCN function
+ check after the CSECT check rather than before it. Allocate
+ separate symtabs for CSECTs whose names begin with '@'.
+ (scan_xcoff_symtab): Don't ignore symbols beginning with '@'.
+ Activate the misc_func_recorded mechanism for whose names begin
+ with '@'.
+
+2001-04-30 J.T. Conklin <jtc@redback.com>
+
+ * ppcnbsd-nat.c (fetch_inferior_registers)
+ (store_inferior_registers, fetch_core_registers): Changed to use
+ fpreg[] instead of r_regs[] to access floating point registers.
+
+2001-04-30 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c: Get rid of the function prototypes.
+ (sh_sh4_build_float_register_type): Move earlier in file.
+ (fv_reg_base_num): Ditto.
+ (dr_reg_base_num): Ditto.
+
+2001-04-30 Michael Snyder <msnyder@redhat.com>
+
+ * thread-db.c: Revert 2001-04-26 change for debugging output.
+ * lin-lwp.c: Ditto.
+ * lin-lwp.c: Add set/show debug lin-lwp command. Use this
+ command to turn extra debugging output on / off.
+
+2001-04-30 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * buildsym.c (start_subfile): Use FILENAME_CMP instead of STREQ.
+ (top-level): #include filenames.h.
+
+ * dwarf2read.c (dwarf2_start_subfile): Use IS_ABSOLUTE_PATH and
+ FILENAME_CMP, to DTRT on non-Posix platforms.
+ (top-level): #include filenames.h.
+
+
+2001-04-27 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.c (check_stub_method): Always initialize ``p''.
+
+2001-04-27 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.host: Delete romp host.
+ * TODO: Update.
+
+2001-04-27 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO: Updates to 5.1. No more targets to obsolete.
+
+2001-04-27 Don Howard <dhoward@redhat.com>
+
+ (Changes from Kevin Buettner, with minor update by Don Howard.)
+
+ * i387-nat.c (i387_supply_fxsave, i387_fill_fxsave, i387_tag): Fix
+ typos in which hexadecimal constants were really intended to be
+ binary constants.
+ (i387_tag): Swap logic regarding zero vs non-zero exponents.
+ * MAINTAINERS (Misc): Added myself to the write-after-approval
+ list.
+
+2001-04-26 Jim Blandy <jimb@redhat.com>
+
+ (Changes from Daniel Berlin, with revisions by Jim Blandy.)
+
+ Abstract out operations specific to particular C++ ABI's, and
+ invoke them through a function table. This removes the C++ ABI
+ dependencies scattered throughout the code, and allows us to
+ cleanly add support for new C++ ABI's.
+ * cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.
+ * c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
+ jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
+ #include "cp-abi.h". These files all use functions now declared
+ there.
+ * symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P):
+ Deleted. These services are now provided by functions declared in
+ cp-abi.h.
+ * value.h (value_rtti_type, value_virtual_fn_field): Same.
+ * values.c (value_virtual_fn_field): Same, for this definition.
+ * valops.c (value_rtti_type): Same.
+ * c-typeprint.c (c_type_print_base): Use the functions from
+ "cp-abi.h", instead of the old macros, or hard-coded ABI-specific
+ tests.
+ * dbxread.c (record_minimal_symbol): Same.
+ * gdbtypes.c (get_destructor_fn_field, virtual_base_index,
+ virtual_base_index_skip_primaries): Same.
+ * jv-typeprint.c (java_type_print_base): Same.
+ * linespec.c (find_methods, decode_line_1): Same.
+ * symtab.c (gdb_mangle_name): Same.
+ * Makefile.in (SFILES): Add the new .c files mentioned above.
+ (cp_abi_h): New variable.
+ (COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
+ (cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
+ (c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
+ jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o): Add
+ dependency on $(cp_abi_h).
+
+2001-04-26 Michael Snyder <msnyder@redhat.com>
+
+ * thread-db.c (_initialize_thread_db): Add set/show command
+ "debug-linux-threads" for debugging output.
+ * lin-lwp.c (various): Use global "debug_linux_threads to
+ turn on extra debugging output.
+ * lin-lwp.c: Minor cleanups in comments.
+ * target.c (normal_pid_to_str): Get rid of an ancient hack.
+ * remote.c (remote_pid_to_str): New function for remote target.
+
+2001-04-24 Jim Blandy <jimb@redhat.com>
+
+ * c-typeprint.c (c_type_print_cv_qualifier): Don't print `const'
+ qualifier on C++ references; all references are innately const.
+
+2001-04-20 Mark Kettenis <kettenis@gnu.org>
+
+ * event-top.h: Fix formatting.
+
+2001-04-17 Andrew Cagney <ac131313@redhat.com>
+
+ * source.c (openp): Obsolete #ifdef MPW code.
+ (open_source_file): Ditto.
+ * event-top.c (display_gdb_prompt): Ditto.
+ * utils.c (query): Ditto.
+ (init_page_info): Ditto.
+ (init_page_info): Delete #ifndef MPW.
+ * top.c (gdb_readline): Ditto.
+ * mac-xdep.c: Obsolete.
+ * mac-gdb.r: Obsolete.
+ * config/powerpc/xm-mpw.h: Obsolete.
+ * config/xm-mpw.h: Obsolete.
+ * mpw-make.sed: Obsolete.
+ * mpw-config.in: Obsolete.
+ * TODO: Update
+ * NEWS: Update
+
+2001-04-19 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_frameless_function_invocation): New function.
+ * config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION): Redefine
+ in terms of i386_frameless_function_invocation. Adjust comment.
+ (i386_frameless_function_invocation): New prototype.
+
+2001-04-18 Martin M. Hunt <hunt@redhat.com>
+
+ * top.c (gdb_init): Don't call cli_out_new() to
+ create global uiout if init_ui_hook is set. uiout will
+ have to be initialized there.
+
+2001-04-18 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c: Include "regcache.h".
+
+2001-04-18 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_saved_pc_after_call): New function.
+ * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Redefine in terms
+ of i386_saved_pc_after_call.
+ (i386_saved_pc_after_call): New prototype.
+
+2001-04-17 Michael Snyder <msnyder@redhat.com>
+
+ * i386-nat.c: Fix typo in comment.
+ * solib.c (no_shared_libraries): New function. Discard all symbols
+ from shared libraries.
+ (_initialize_solib): Add command "nosharedlibrary" as complement
+ to the command "sharedlibrary". Unloads symbols for all solibs.
+
+2001-04-16 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.host (m68030-sony-*, m68*-isi-*, m68*-sony-*):
+ * configure.tgt (m68*-rom68k-*, m68*-*bug-*, m68*-monitor-*)
+ (m68*-est-*, m68*-sony-*, m68*-isi-*):
+ * Makefile.in (xm-news1000.h, tm-news.h, xm-news.h): Obsolete..
+ * config/m68k/xm-news.h: Obsolete.
+ * config/m68k/tm-news.h:
+ * config/m68k/xm-news1000.h: Obsolete.
+ * config/m68k/news.mh: Obsolete.
+ * config/m68k/news.mt: Obsolete.
+ * config/m68k/nm-news.h: Obsolete.
+ * config/m68k/news1000.mh: Obsolete.
+ * news-xdep.c: Obsolete.
+ * Makefile.in (isi-xdep.o): Obsolete.
+ (ALLDEPFILES): Delete isi-xdep.c.
+ (tm-isi.h): Obsolete.
+ * m68k-tdep.c (altos_skip_prologue): Update comments.
+ (isi_skip_prologue): Obsolete.
+ * isi-xdep.c: Obsolete.
+ * config/m68k/xm-isi.h: Obsolete.
+ * config/m68k/isi.mh: Obsolete.
+ * config/m68k/tm-isi.h: Obsolete.
+ * config/m68k/isi.mt: Obsolete.
+
+ * TODO: Update.
+ * NEWS: Update.
+
+2001-04-17 Michael Snyder <msnyder@redhat.com>
+
+ * remote.c (remote_open_1): On opening the remote target, activate
+ the solib_create_inferior_hook, so that it can detect when the
+ target loads shared libraries.
+ (remote_async_open_1): Ditto.
+
+2001-04-17 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (print_one_breakpoint): Handle 64-bit addresses.
+ * tracepoint.c (tracepoints_info): Handle 64-bit addresses.
+ * testsuite/gdb.trace/deltrace.exp: Allow for 64-bit addresses.
+ * testsuite/gdb.trace/infotrace.exp: Ditto.
+ * testsuite/gdb.trace/passcount.exp: Ditto.
+ * testsuite/gdb.trace/while-stepping.exp: Ditto.
+
+2001-04-17 Michael Snyder <msnyder@redhat.com>
+
+ * thread-db.c (check_thread_signals): When looping over all
+ signals, ignore signal zero.
+ (disable_thread_signals): Ditto.
+
+2001-04-17 Eirik Fuller <eirik@netapp.com>
+
+ * thread.c (do_captured_thread_select): Allow the argument to the
+ thread command to be an expression rather than a literal integer.
+
+2001-04-17 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (i386_linux_saved_pc_after_call): Use
+ read_memory_unsigned_integer instead of read_memory_integer.
+
+2001-04-16 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (map_index_vs_section_name_okay): New function.
+ (aix5_relocate_main_executable): Don't use file offsets for
+ determining corresponding sections and map file entries. Call
+ map_index_vs_section_name_okay() to do this instead.
+
+2001-04-16 Kevin Buettner <kevinb@redhat.com>
+
+ * procfs.c (open_with_retry): New function.
+ (open_procinfo_files, load_syscalls, proc_iterate_over_mappings)
+ (proc_get_LDT_entry): Call open_with_retry() instead of open().
+
+2001-04-16 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-nat.c (ia64_linux_stopped_by_watchpoint): Adjust
+ comparison against TRAP_HWBKPT constant yet again to account
+ for the various values used by different kernel versions.
+
+2001-04-16 Daniel Berlin <dan@cgsoftware.com>
+
+ * demangle.c (_initialize_demangler): Use xcalloc on the
+ demangling_style_names, and make it a null terminated array of
+ names, to avoid a crash.
+
+2001-04-16 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_frame_chain): New function.
+ * config/i386/tm-i386.h (FRAME_CHAIN): Redefine in terms of
+ i386_frame_chain.
+ (i386_frame_chain): New prototype.
+
+2001-04-14 J.T. Conklin <jtc@redback.com>
+
+ * target.h (target_ops): Removed to_core_file_to_sym_file vector
+ function.
+ * corelow.c (core_ops): Updated for above change.
+ * gnu-nat.c (core_ops): Likewise.
+ * inftarg.c (child_ops): Likewise.
+ * monitor.c (monitor_ops): Likewise.
+ * ppc-bdm.c (bdm_ppc_ops): Likewise.
+ * remote-adapt.c (adapt_ops): Likewise.
+ * remote-bug.c (bug_ops): Likewise.
+ * remote-e7000.c (e7000_ops): Likewise.
+ * remote-eb.c (eb_ops): Likewise.
+ * remote-es.c (es1800_ops, es1800_child_ops): Likewise.
+ * remote-mm.c (mm_ops): Likewise.
+ * remote-nindy.c (nindy_ops): Likewise.
+ * remote-nrom.c (nrom_ops): Likewise.
+ * remote-os9k.c (rombug_ops): Likewise.
+ * remote-rdp.c (remote_rdp_ops): Likewise.
+ * remote-sim.c (gdbsim_ops): Likewise.
+ * remote-st.c (st2000_ops): Likewise.
+ * v850ice.c (v850ice_ops): Likewise.
+ * target.c (cleanup_target): Likewise
+ (update_current_target): Likewise.
+ (setup_target_debug): Likewise
+ (debug_to_core_file_to_sym_file): Removed.
+
+ * corefile.c (core_file_command) [HPUXHPPA]: Removed code that
+ sets symbol file from information obtained from the core file.
+ * corelow.c (core_file_to_sym_file): Removed.
+
+2001-04-13 Fernando Nasser <fnasser@redhat.com>
+
+ From Adam Mirowski <Adam.Mirowski@Sun.COM>
+ Fixed Insight on Solaris. It was not possible to debug a process
+ because of EINTR "errors".
+ * procfs.c: (procfs_wait): if proc_wait_for_stop() fails
+ with EINTR, retry the call.
+
+2001-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (enum maptype): Delete.
+ (struct lm_info): Add new member ``nmappings''. Make ``mapping''
+ member a pointer instead of a statically sized array.
+ (build_so_list_from_mapfile): Dynamically allocate ``mapping''
+ array.
+ (aix5_relocate_main_executable, aix5_relocate_section_addresses,
+ aix5_find_global_pointer): Search for correct mapping to use
+ based on file offset instead of knowledge of whether the section
+ is read-only or read/write.
+ (aix5_find_gate_addresses): Use the first mapping instead of
+ the (now defunct) MT_READONLY mapping.
+
+2001-04-12 Nicholas Duffek <nsd@redhat.com>
+
+ * xcoffread.c (scan_xcoff_symtab): Ignore symbols beginning with
+ "@".
+
+2001-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ * config/i386/fbsd.mh (NATDEPFILES): Add i386-nat.o.
+
+2001-04-09 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete i[3456]86-*-sunos* (aka Sun386) host and target.
+ * config/i386/sun386.mh: Obsolete.
+ * config/i386/sun386.mt: Obsolete.
+ * config/i386/xm-sun386.h: Obsolete.
+ * config/i386/tm-sun386.h: Obsolete.
+ * config/i386/nm-sun386.h: Obsolete.
+ * Makefile.in (ALLDEPFILES): Delete sun386-nat.c.
+ (sun386-nat.o): Target is obsolete.
+ * sun386-nat.c: Obsolete.
+ * configure.tgt (i[3456]86-*-sunos*): Obsolete.
+ * configure.host (i[3456]86-*-sunos*): Obsolete.
+ * NEWS: Update.
+ * TODO: Update.
+
+2001-04-10 J.T. Conklin <jtc@redback.com>
+
+ * maint.c: Fix typo in comment.
+
+2001-04-09 Keith Seitz <keiths@cygnus.com>
+
+ * MAINTAINERS: Swap with Syd Polk as a gdbtk maintainer.
+
+2001-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ * fork-child.c (fork_inferior, clone_and_follow_inferior):
+ Document fact that apparent call to vfork() might actually be
+ a call to fork() instead.
+ * ser-pipe.c (pipe_open): Likewise.
+
+2001-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ * printcmd.c (print_frame_args): Use a cleanup to invoke
+ ui_out_list_end() so that the list count nesting flag will
+ be decremented properly when an error occurs.
+ * stack.c (print_frame): Likewise.
+
+2001-04-06 J.T. Conklin <jtc@redback.com>
+
+ * dcache.c (dcache_write_line): Fixed bugs where cache line was
+ not written to target correctly.
+
+ * gdbserver/low-hppabsd.c (read_inferior_memory): Add explicit
+ void return value;
+ * gdbserver/low-nbsd.c: Likewise.
+ * gdbserver/low-sparc.c: Likewise.
+ * gdbserver/low-sun3.c: Likewise.
+
+2001-04-06 Geoffrey Keating <geoffk@redhat.com>
+
+ * config/rs6000/nm-rs6000.h (PTRACE_ATTACH): Don't define.
+ (PTRACE_DETACH): Don't define.
+
+2001-04-06 David Smith <dsmith@redhat.com>
+
+ * arch-utils.c (default_prepare_to_proceed)
+ (generic_prepare_to_proceed): Added new functions.
+ * arch-utils.h: New function declarations for
+ default_prepare_to_proceed() and generic_prepare_to_proceed().
+ * gdbarch.sh: Added PREPARE_TO_PROCEED.
+ * gdbarch.c: Regenerated.
+ * gdbarch.h: Regenerated.
+ * inferior.h: Added get_last_target_status() declaration.
+ * infrun.c (get_last_target_status): Added new function.
+ (handle_inferior_event): Saves last pid and waitstatus, which will
+ get returned by get_last_target_status().
+
+ * hppa-tdep.c (prepare_to_proceed): Added comment stating that
+ prepare_to_proceed() is potentially redundant since
+ default_prepare_to_proceed() has been added.
+ * linux-thread.c (prepare_to_proceed): Ditto.
+ * lin-lwp.c (prepare_to_proceed): Ditto.
+ * m3-nat.c (prepare_to_proceed): Ditto.
+
+2001-04-05 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete powerpcle-*-cygwin* and powerpcle-*-solaris* platforms
+ and powerpc-*-netware* target.
+ * configure.host (powerpcle-*-cygwin*, powerpcle-*-solaris*):
+ Obsolete.
+ * configure.tgt (powerpc-*-netware*, powerpcle-*-cygwin*)
+ (powerpcle-*-solaris*): Obsolete.
+ * config/powerpc/tm-cygwin.h: Obsolete.
+ * config/powerpc/cygwin.mt: Obsolete.
+ * config/powerpc/xm-cygwin.h: Obsolete.
+ * config/powerpc/cygwin.mh: Obsolete.
+ * config/powerpc/nm-solaris.h: Obsolete.
+ * config/powerpc/xm-solaris.h: Obsolete.
+ * config/powerpc/tm-solaris.h: Obsolete.
+ * config/powerpc/solaris.mt: Obsolete.
+ * config/powerpc/tm-ppc-nw.h: Obsolete.
+ * config/powerpc/ppc-nw.mt: Obsolete.
+ * TODO: Update.
+ * NEWS: Update.
+
+2001-04-06 Fernando Nasser <fnasser@redhat.com>
+
+ * buildsym.c (record_line): Turn off unused addr bits.
+
+2001-04-06 Fernando Nasser <fnasser@redhat.com>
+
+ From David Deephanphongs <deephan@telocity.com>
+ * inferior.h: Fix declarations of get_inferior_args and
+ set_inferior_args, which were missing the trailing 's'.
+
+2001-04-05 Jeff Holcomb <jeffh@redhat.com>
+
+ * monitor.c (monitor_supply_register): Only report an error if we
+ don't get a valid value.
+
+2001-04-05 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * README: Don't mention gdba.el.
+
+2001-04-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com>
+ * top.c (init_main): set prompt if annotation_level>1,
+ this is necessary when annotation_level is set to 2 via
+ --annotate=2 command line option.
+
+2001-04-04 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete a29k-*-* host and a29k-*-sym1* and a29k-*-kern* targets.
+ * configure.tgt (a29k-*-sym1*, a29k-*-kern*): Obsolete.
+ * configure.host (a29k-*-*): Obsolete.
+ * Makefile.in (ALLDEPFILES): Remove ultra3-nat.c and
+ ultra3-xdep.c.
+ (ultra3-nat.o, ultra3-xdep.o): Obsolete.
+ * config/a29k/tm-ultra3.h: Obsolete.
+ * config/a29k/ultra3.mt: Obsolete.
+ * config/a29k/ultra3.mh: Obsolete.
+ * config/a29k/nm-ultra3.h: Obsolete.
+ * config/a29k/xm-ultra3.h: Obsolete.
+ * ultra3-xdep.c: Obsolete.
+ * ultra3-nat.c: Obsolete.
+ * config/a29k/a29k-kern.mt: Obsolete.
+ * NEWS: Update.
+ * TODO: Update.
+
+Wed Apr 4 21:48:42 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * main.c: Remove windows.h use.
+ (gdbtk_test): Use PATH_MAX for home var calculation.
+ * remote-e7000.c (e7000_parse_device): Accomodate Cygwin as well as
+ Win32 in colon test.
+ * ser-tcp.c: Use modern __CYGWIN__ conditional.
+ * source.c (mod_path): Add __CYGWIN__ conditional to WIN32 test.
+ (openp): Ditto.
+ * symfile.c (symfile_bfd_open): Ditto.
+
+2001-04-04 Martin M. Hunt <hunt@redhat.com>
+
+ * main.c (captured_main): For GDBtk, don't use tui_fileopen().
+ Handle all stream setup in gdbtk_init
+
+2001-04-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_extract_return_value): Don't return the return
+ value of a void function.
+ (i386_store_return_value): Likewise.
+
+2001-04-03 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete w65-*-* target.
+ * configure.tgt (w65-*-*): Obsolete.
+ * config/w65/w65.mt: Obsolete.
+ * config/w65/tm-w65.h: Obsolete.
+ * w65-tdep.c: Obsolete.
+ * NEWS: Update. Fix TiC80 description.
+ * TODO: Update.
+
+2001-04-03 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete tic80-*-* target.
+ * configure.tgt (tic80-*-*): Obsolete.
+ * config/tic80/tic80.mt: Obsolete.
+ * config/tic80/tm-tic80.h: Obsolete.
+ * tic80-tdep.c: Obsolete.
+ * TODO: Update
+ * NEWS: Update.
+
+2001-04-02 J.T. Conklin <jtc@redback.com>
+
+ * remote-mips.c (S_IROTH): Moved definition from here.
+ * gdb_stat.h (S_IROTH): to here.
+
+ * remote.c (remote_protocol_e, remote_protocol_E): Define.
+ (set_remote_protocol_e_packet_cmd)
+ (set_remote_protocol_E_packet_cmd)
+ (show_remote_protocol_e_packet_command)
+ (show_remote_protocol_E_packet_command): New functions.
+ (init_all_packet_configs): Initialize remote_protocol_e and
+ remote_protocol_E.
+ (remote_resume, remote_async_resume): Support e/E command
+ packets.
+ (show_remote_cmd): Show state of remote_protocol_e and
+ remote_protocol_E.
+ (_initialize_remote): Add "set remote step-over-range-packet"
+ and "set remote step-over-range-w-signal-packet" to CLI.
+
+2001-04-01 Andrew Cagney <ac131313@redhat.com>
+
+ Obsolete ns32k-*-mach3*, ns32k-umax-*, ns32k-utek-sysv* and
+ ns32k-utek-*.
+ * Makefile.in (ALLDEPFILES): Delete umax-xdep.c and ns32km3-nat.c.
+ (umax-xdep.o, ns32km3-nat.o): Obsolete.
+ * configure.tgt (ns32k-*-mach3*, ns32k-utek-sysv*, ns32k-utek-*):
+ Obsolete.
+ * configure.host (ns32k-*-mach3*, ns32k-umax-*, ns32k-utek-sysv*):
+ Obsolete.
+ * config/ns32k/merlin.mh: Obsolete.
+ * config/ns32k/merlin.mt: Obsolete.
+ * config/ns32k/xm-merlin.h: Obsolete.
+ * config/ns32k/tm-merlin.h: Obsolete.
+ * config/ns32k/nm-umax.h: Obsolete.
+ * config/ns32k/umax.mh: Obsolete.
+ * config/ns32k/umax.mt: Obsolete.
+ * config/ns32k/xm-umax.h: Obsolete.
+ * umax-xdep.c: Obsolete.
+ * config/ns32k/ns32km3.mh: Obsolete.
+ * config/ns32k/ns32km3.mt: Obsolete.
+ * config/ns32k/tm-ns32km3.h: Obsolete.
+ * config/ns32k/xm-ns32km3.h: Obsolete.
+ * ns32km3-nat.c: Obsolete.
+ * ns32k-tdep.c (merlin_skip_prologue): Obsolete.
+ (merlin_frame_num_args): Ditto.
+ * NEWS: Update.
+ * TODO: Update.
+
+2001-04-02 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Tweak due to
+ expect/example/chesslib.c.
+
+2001-04-02 Kevin Buettner <kevinb@redhat.com>
+
+ * m88k-tdep.c (examine_prologue): Change type of ``insn'' from
+ unsigned int to unsigned long. Also, fix format string.
+ (pop_frame): Fix PC_IN_CALL_DUMMY() call so that it doesn't
+ use an undeclared variable. Also, delete declaration and
+ initialization of ``fp'' because it is otherwise unused.
+ * remote-bug.c (sleep): Delete declaration.
+ (bug_store_register, bug_write_memory, bug_read_memory)
+ (bug_insert_breakpoint, bug_remove_breakpoint): Fix sprintf()
+ format statements and cast certain sprintf() arguments to
+ eliminate warnings.
+ (bug_load): Likewise for call to printf_filtered().
+ * config/m88k/tm-m88k.h (FIX_CALL_DUMMY): Eliminate
+ assignment to ``pc''. The necessary assignment is done in
+ hand_function_call() after the invocation of FIX_CALL_DUMMY().
+
+2001-03-20 Daniel Berlin <dberlin@redhat.com>
+
+ * symtab.c (completion_list_add_name): Remove duplicate string checks,
+ readline already does this, and it's much faster at it, too.
+
+2001-04-01 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c: Minor tweaks, to pacify the ari script.
+
+2001-04-01 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_extract_struct_value_address): New function.
+ * config/i386/tm-i386.h (EXTRACT_STRUCT_VALUE_ADDRESS): Redefine
+ in terms of i386_extract_struct_value_address.
+ (i386_extract_struct_value_address): New prototype.
+
+ * i386-linux-nat.c (i386_linux_dr_get): Change type of return
+ value to `unsigned long'. Change type of `value' to `unsigned
+ long'.
+ (i386_linux_dr_set): Change type of second argument to `unsigned
+ long'.
+ (i386_linux_dr_set_control): Change type of first argument to
+ `unsigned long'.
+ (i386_linux_dr_get_status): Change type of return value to
+ unsigned long.
+ * config/i386/nm-linux.h (i386_linux_dr_set_control,
+ i386_linux_dr_get_status): Adjust prototypes accordingly.
+
+2001-03-31 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-linux-nat.c (ia64_linux_stopped_by_watchpoint): Change
+ TRAP_HWBKPT constant to match that in the kernel headers for
+ Linux/IA-64.
+
+2001-03-31 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-nat.c: Include "gdb_assert.h".
+ [HAVE_PT_GETDBREGS] (DBREG_DRX): Define if not
+ already defined.
+ [HAVE_PT_GETDBREGS] (i386bsd_dr_set, i386bsd_dr_set_control,
+ i386bsd_dr_set_addr, i386bsd_dr_reset_addr,
+ i386bsd_dr_get_status): New functions.
+ * config/i386/nm-fbsd.h [HAVE_PT_GETDBREGS]
+ (I386_USE_GENERIC_WATCHPOINTS): Define.
+ Include "i386/nm-i386.h".
+ (I386_DR_LOW_SET_CONTROL, I386_DR_LOW_SET_ADDR,
+ I386_DR_LOW_RESET_ADDR, I386_DR_LOW_GET_STATUS): New macros.
+ (i386bsd_dr_set_control, i386bsd_dr_set_addr,
+ i386bsd_dr_reset_addr, i386bsd_dr_get_status): New prototypes.
+ * acconfig.h (HAVE_PT_GETDBREGS): New configure macro.
+ * configure.in: Cleanup a few comments. Check for PT_GETDBREGS
+ ptrace request.
+ * config.in, configure: Regenerate.
+
+ * i386-nat.c (i386_insert_aligned_watchpoint): Set address
+ register before enabling it by setting the control register.
+ (i386_remove_aligned_watchpoint): Reset address register after
+ disabling it by setting the control register.
+
+ * i386-tdep.c (i386_extract_return_value): If the type of the
+ return value is TYPE_STRUCT and the number of fields is one, call
+ ourselves with TYPE set tp the type of the first field.
+ (i386_store_return_value): Likewise.
+ This fixes a problem with returning structs consisting of a single
+ `float' or `double' on *BSD.
+
+2001-03-30 Mark Kettenis <kettenis@gnu.org>
+
+ * lin-lwp.c (lin_lwp_resume): Don't mark LWP as not stopped until
+ we're absolutely sure we're going to resume it.
+
+ * thread-db.c (check_event): Don't report an error if we encounter
+ a thread creation event for a thread that's already in the thread
+ list, since that may legitemately happen. Instead only call
+ attach_thread if it's not already in the thread list.
+
+2001-03-28 Andrew Cagney <ac131313@redhat.com>
+
+ * config/pa/xm-hppah.h (malloc): Really delete declaration
+ (MALLOC_INCOMPATIBLE): Really delete macro.
+ * cli/cli-cmds.c (apropos_command): Use xcalloc.
+
+2001-03-28 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.in (build_warnings): Add -Wuninitialized.
+ * configure: Regenerate.
+
+ * v850-tdep.c (v850_scan_prologue): Initialize ``insn2''.
+ * sparc-tdep.c (sparc64_push_arguments): Add default case to
+ switch.
+ * sh-tdep.c (sh_do_fp_register): Replace ``?:'' printf format
+ expression with if statement.
+ * mn10200-tdep.c (mn10200_analyze_prologue): Initialize
+ ``stack_size''.
+ * mips-tdep.c (show_mipsfpu_command): Add default case to switch.
+ (mips_dump_tdep): Fix setting of ef_mips_arch.
+ * mcore-tdep.c (mcore_analyze_prologue): Initialize ``fp_regnum''.
+ * dsrec.c (make_srec): Always initialize ``binbuf''.
+ * monitor.c (monitor_read_memory_single): Do not pass an
+ uninitialized buffer to monitor_error. Make ``i'' more local.
+
+2001-03-28 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Change ns32k target to ,-Werror.
+
+ * ns32k-tdep.c: Include "gdbcore.h"
+ (flip_bytes): Change first argument to void*. Add forward
+ declaration.
+ (sign_extend): Add declaration.
+ (merlin_frame_num_args): Add final else clause to if-else chain.
+ (umax_frame_num_args): Ditto.
+ * config/ns32k/tm-umax.h (ns32k_localcount): Declare.
+ (flip_bytes): Ditto.
+
+2001-03-28 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (FRAMELESS_SIGNAL): Moved here from
+ config/i386/nm-linux.h (including comment).
+ (i386_linux_frame_chain): New function implementing guts of the
+ former FRAME_CHAIN macro, but using read_memory_unsigned_integer
+ instead of read_memory_integer.
+ (i386_linux_frame_saved_pc): Removed doc pointing to
+ i386/tm-linux.h for an explanation of FRAMELESS_SIGNAL since that
+ now lives in this file.
+ * config/i386/tm-linux.h (FRAMELESS_SIGNAL): Moved to
+ i386-linux-tdep.c (including comment).
+ (FRAME_CHAIN): Redefined in terms of i386_linux_frame_chain.
+ (i386_linux_frame_chain): New prototype.
+
+ * gdbserver/low-linux.c [I386_GNULINUX_TARGET]: Cleanup code and
+ make it work again.
+ (NUM_FREGS): Redefine to 0.
+ (NUM_REGS): Redefine as NUM_GREGS.
+ (i386_register_byte, i386_register_raw_size): Update from
+ i386-tdep.c. Add comment about their origin.
+ (regmap, register_u_addr): Take these from i386-linux-nat.c.
+ (i386_register_u_addr): Removed.
+
+ * i386-linux-nat.c (i386_linux_dr_get): Return 0 if ptrace call
+ fails instead of calling perror_with_name. This should fix
+ debugging remote i386 targets with a native Linux/x86 GDB. Add
+ FIXME for this hack.
+
+2001-03-19 J.T. Conklin <jtc@redback.com>
+
+ * arch-utils.c (#include "gdbthread.h"): Removed.
+ (#include "symfile.h"): Removed.
+ (XMALLOC): Removed unused macro.
+ * breakpoint.c (tbreak_command): Removed local declaration.
+ (awatch_command, do_enable_breakpoint, set_breakpoint_count):
+ Remove duplicate declarations.
+ (bpstat_should_step, bpstat_have_active_hw_watchpoints)
+ (remove_solib_event_breakpoints): Fix indentation botch.
+ * c-typeprint.c (#include "command.h"): Removed.
+ (#include "gdbcmd.h"): Removed.
+ * ch-exp.c (ch_terminal_match_float_literal, parse_expr)
+ (parse_primval, parse_untyped_expr, parse_opt_untyped_expr):
+ Removed duplicate declarations.
+ * ch-typeprint.c (#include "command.h"): Removed.
+ (#include "gdbcmd.h"): Removed.
+ * corefile.c (#include "frame.h"): Removed
+ (#include "symfile.h"): Removed.
+ (#include "language.h"): Removed.
+ * dbxread.c (#include "command.h"): Removed.
+ * environ.c (#include "gdbcore.h"): Removed.
+ * event-loop.c (#include "top.h"): Removed.
+ * f-typeprint.c (#include "command.h"): Removed.
+ (#include "gdbcmd.h"): Removed.
+ (#include "language.h"): Removed.
+ (#include "typeprint.h"): Removed.
+ (#include "frame.h"): Removed.
+ * gdbtypes.h (print_type_scalar): Removed declaration.
+ * infcmd.c (#include "completer.h"): Removed.
+ * language.c (#include "frame.h"): Removed.
+ * m2-typeprint.c (#include "command.h"): Removed.
+ (#include "gdbcmd.h"): Removed.
+ (#include "language.h"): Removed.
+ * m2-valprint.c (#include "valprint.h"): Removed.
+ * p-typeprint.c (#include "command.h"): Removed.
+ (#include "gdbcmd.h"): Removed.
+ * p-valprint.c (#include "typeprint.h"): Removed.
+ * parse.c (#include "linespec.h"): Removed.
+ * regcache.c (#include "frame.h"): Removed.
+ * remote.c (#include "frame.h"): Removed.
+ (getpkt_sane): Make static.
+ * source.c (#include "completer.h"): Removed.
+ * stack.c (#include "symfile.h"): Removed.
+ (#include "objfiles.h"): Removed.
+ * symfile.c (#include "completer.h"): Removed.
+ * tracepoint.c (#include "completer.h"): Removed.
+ * values.c (#include "frame.h"): Removed.
+ * varobj.c (#include "valprint.h"): Removed.
+ * wrapper.c (#include "frame.h"): Removed.
+
+ * memattr.c (create_mem_region): Removed unused variable.
+ * remote-nrom.c: Removed spurious semicolon after init_nrom_ops.
+
+2001-03-27 Nick Clifton <nickc@redhat.com>
+
+ * remote-rdp.c (rdp_set_command_line): Add missing double quote.
+
+2001-03-27 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (build_so_lib_from_mapfile): Use xfree() instead
+ of free().
+
+2001-03-27 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * TODO (Cleanups): Remove the item about converting docs to GFDL.
+
+2001-03-26 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (slotN_contents, replace_slotN_contents): Change
+ type of ``bundle'' from unsigned char * to char *.
+ (ia64_get_saved_register): Use alloca() to allocate register
+ buffers.
+
+ * solib-aix5.c (build_so_lib_from_mapfile): Fix xasprintf() usage.
+
+2001-03-26 Kevin Buettner <kevinb@redhat.com>
+
+ * proc-utils.h (procfs_ctl_t): New typedef.
+ * proc-api.c (write_with_trace): Change type of ``opcode'' from
+ long to procfs_ctl_t. Don't assume that the target has defined
+ BREAKPOINT. Handle case in which PCRESET is the same as PCUNSET.
+ * proc-events.c (sys/syscall.h, sys/fault.h): Include conditionally.
+ * procfs.c (sys/fault.h, sys/syscall.h): Include conditionally.
+ (gdb_sigset_t, gdb_sigaction_t, gdb_siginfo_t, gdb_premptysysset)
+ (gdb_praddsysset, gdb_prdelsysset, gdb_pr_issyssetmember):
+ Conditionally define as appropriate for AIX/non-AIX systems. Use
+ these defines/typedefs as appropriate elsewhere in file.
+ (struct procinfo): Change type of saved_sigset and saved_sighold
+ from sigset_t to gdb_sigset_t. Make saved_exitset and
+ saved_entryset pointer variables. Add two new fields, num_syscalls
+ and syscall_names.
+ (DYNAMIC_SYSCALLS): Define when HAVE_PRSYSENT_T is defined.
+ (sysset_t_size, sysset_t_alloc): New functions.
+ (load_syscalls, free_syscalls, find_syscall): New functions for
+ platforms which define DYNAMIC_SYSCALLS.
+ (create_procinfo): Call load_syscalls.
+ (destroy_one_procinfo): Call free_syscalls.
+ (GDBRESET): Don't define twice.
+ (proc_modify_flag): Change type of operation code array `arg'
+ from long to procfs_ctl_t.
+ (proc_stop_process, proc_wait_for_stop, proc_run_process)
+ (proc_set_traced_signals, proc_set_traced_faults)
+ (proc_set_traced_sysentry, proc_set_traced_sysexit)
+ (proc_set_held_signals, proc_clear_current_fault)
+ (proc_set_current_signal, proc_clear_current_signal, proc_set_gregs)
+ (proc_set_fpregs, proc_kill, proc_set_watchpoint): Likewise for `cmd'.
+ (proc_set_traced_sysentry): Dynamically allocate variable sized
+ struct gdb_proc_ctl_pcsentry. Also, free it at function exit.
+ (proc_set_traced_sysexit): Dynamically allocate variable
+ sized struct gdb_proc_ctl_pcsexit. Also, free it at
+ function exit.
+ (proc_get_traced_sysentry, proc_get_traced_sysexit): Add new code
+ for reading the sysset_t struct on AIX5.
+ (procfs_debug_inferior): Don't assume that SYS_exit will be
+ defined. Add new code for finding certain syscalls on AIX5.
+ (syscall_is_lwp_exit, syscall_is_exit, syscall_is_exec)
+ (syscall_is_lwp_create): New functions.
+ (procfs_wait): Restructured code which checks for certain
+ system calls to use the new syscall_is_... functions.
+ (procfs_notice_signals): Account for the fact that saved_entryset
+ and saved_exitset in struct procinfo are now pointers.
+
+2001-03-26 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.c (find_pc_sect_line): Revise method used for finding
+ the ending pc.
+
+2001-03-26 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (i386_linux_sigtramp_saved_pc,
+ i386_linux_sigtramp_saved_sp): Make static.
+ (i386_linux_frame_saved_pc): New function based on the old
+ FRAME_SAVED_PC macro, but use read_memory_unsigned_integer instead
+ of read_memory_integer.
+ * config/i386/tm-linux.h (sigtramp_saved_pc): Remove definition.
+ (i386_linux_sigtramp_saved_pc): Remove prototype.
+ (FRAME_SAVED_PC): Redefine in terms of i386_linux_frame_saved_pc.
+ (i386_linux_frame_saved_pc): New prototype.
+
+2001-03-26 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Document m88k as a ``Known problem in 5.1''.
+ * TODO (GDB 5.1 - Cleanups): Update.
+
+2001-03-26 Andrew Cagney <ac131313@redhat.com>
+
+ * fork-child.c (clone_and_follow_inferior): Delete #ifdef
+ HAVE_VFORK.
+
+2001-03-26 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-symmetry.h (PUSH_ARGUMENTS): #undef.
+
+ * i386-tdep.c (i386_push_arguments, i386_store_struct_return): New
+ functions.
+ * config/i386/tm-i386.h (PUSH_ARGUMENTS): New macro.
+ (STORE_STRUCT_RETURN): Redefine in terms of
+ i386_store_struct_return.
+ (i386_push_arguments, i386_store_struct_return): New prototypes.
+ * config/i386/tm-i386v.h (STORE_STRUCT_RETURN): Remove. It's
+ definition was identical to the definition in "i386/tm-i386.h" so
+ the new definition should suffice too.
+
+2001-03-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * event-loop.c (toplevel) [!HAVE_POLL] [NO_FD_SET]: Remove unused
+ definitions for SELECT, NBBY, FD_SETSIZE, NFDBITS, and MASK_SIZE.
+
+ * config/djgpp/djconfig.sh: Add copyright notice.
+
+ * ser-go32.c (rawclock): Remove prototype; include time.h instead.
+ (ISR, dos_hookirq, isr_t): Convert K&R definition to ANSI C.
+ (top level) <string.h>: Include gdb_string.h instead.
+ (dos_noop, dos_raw, dos_noflush_set_tty_state)
+ (dos_print_tty_state, dos_info): Remove ATTRIBUTE_UNUSED.
+
+ * go32-nat.c (go32_create_inferior): Move the declaration of
+ `environ' to here from the top level.
+ (top level) <_initialize_go32_nat>: Remove redundant prototype.
+ <gdb_string.h>: Include it instead of string.h.
+ (store_register): Call register_buffer instead of accessing
+ registers[] directly.
+ (redir_cmdline_delete, redir_cmdline_parse, redir_to_debugger)
+ (redir_to_debugger, redir_debug_init) [__DJGPP_MINOR__ < 3]: Put
+ the function names at the start of the line.
+ (go32_set_dr): Throw internal_error if the argument is not a valid
+ debug register number.
+ (go32_open, go32_close, go32_attach, go32_detach, go32_resume)
+ (go32_wait, go32_xfer_memory, go32_files_info)
+ (go32_terminal_info): Remove ATTRIBUTE_UNUSED.
+
+2001-03-25 Jim Blandy <jimb@redhat.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Tweak indentation.
+
+2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Andrew Cagney <ac131313@redhat.com>
+
+ * coffread.c: Include "gdb_assert.h".
+ (coff_symtab_read): Cast the integer s_sclass to a long before
+ casting it to a pointer.
+
+2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Andrew Cagney <ac131313@redhat.com>
+
+ * coffread.c (coff_symtab_read): Initialize
+ ``fcn_first_line_addr''. Check that the ``.bf'' always preceeds
+ the ``.ef'' info.
+ * dbxread.c (find_text_range): Initialize ``start'' and ``end''.
+
+2001-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Down grade to
+ GDB_MULTI_ARCH_PARTIAL from two. SOFTWARE_SINGLE_STEP is not
+ multi-arch.
+
+ * gdbarch.sh (SOFTWARE_SINGLE_STEP): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * target.h (SOFTWARE_SINGLE_STEP_P)
+ (SOFTWARE_SINGLE_STEP): Delete macro definitions.
+
+2001-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (gdbarch_register_read, gdbarch_register_write): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * regcache.h (regcache_read, regcache_write): Declare.
+ (registers, register_valid, register_buffer): Add note that these
+ interfaces are deprecated.
+
+ * regcache.c: Include "gdb_assert.h".
+ (legacy_write_register_gen): Rename write_register_gen.
+ (legacy_read_register_gen): Rename read_register_gen.
+ (regcache_read, regcache_write): New function.
+ (read_register_gen, write_register_gen): New function.
+ (write_register): Simplify. Use write_register_gen.
+ (read_register): Ditto using read_register_gen.
+ (read_signed_register): Ditto.
+ (read_register_bytes): Ditto!!!!
+ (supply_register): Add note that CLEANUP_REGISTER_VALUE is being
+ replaced by gdbarch_register_read.
+
+ * TODO (GDB 5.2 - Cleanups): Add list of gdbarch methods to
+ deprecate.
+
+2001-03-23 Jim Blandy <jimb@redhat.com>
+
+ Fix from Dan Berlin:
+
+ * stabsread.c (read_cpp_abbrev): Properly construct the names of
+ virtual function table pointer fields.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (xfree, mcalloc, mmalloc, mrealloc, mfree, xmmalloc,
+ xmrealloc): Move existing declarations to the one place and
+ re-order to be consistent.
+ (xmcalloc, xmfree): Declare.
+ (xmmalloc, xmrealoc): Assume ISO-C - use size_t and void* in
+ declaration.
+
+ * utils.c (size_t): Delete #ifdef defining size_t.
+ (mmalloc, mrealloc, mcalloc, mfree): Re-order.
+ (mmalloc, mrealloc, mcalloc): Document as only calls in GDB
+ corresponding malloc, realloc, calloc.
+ (mfree): Call free directly.
+ (xmmalloc, xmrealloc): Clean up. Assume ISO-C.
+ (xmcalloc, xmfree): New functions. Copy old xcalloc and xfree
+ function bodies to here.
+ (xcalloc, xfree): Call xmcalloc and xmfree respectfully.
+
+2001-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * fork-child.c (fork_inferior): Make ``argv'', ``exec_file'' and
+ ``shell_file'' static locals.
+
+ * jv-lang.c (java_link_class_type): Initialize ``field'' and
+ ``method''.
+
+ * jv-valprint.c (java_value_print): Initialize ``next_element''.
+
+2001-03-23 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-i386.h: Fix formatting and change reference to
+ i386-tdep.c to i386-nat.c.
+
+2001-03-23 David Smith <dsmith@redhat.com>
+
+ * configure.in: Corrected spelling errors.
+ * configure: Regenerated.
+
+2001-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (GDB 5.1 - Cleanups): Add more targets to obsolete.
+
+2001-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (NTSSTART): Delete.
+ (NTSOBS): Delete.
+ (kdb): Delete target.
+ * kdb-start.c, stuff.c: Mark as obsolete.
+ * NEWS: Update.
+
+2001-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * config/pa/xm-hppah.h (HPPA_COMPILER_BUG): Delete. GDB only
+ compiles using an ISO-C compiler.
+ (MALLOC_INCOMPATIBLE): Ditto.
+ * linespec.c (decode_line_1): Delete hack to work around
+ HPPA_COMPILER_BUG.
+
+2001-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * exec.c (xfer_memory): Always initialize section.
+ * infrun.c (normal_stop): Always initialize source_flag.
+
+2001-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (Remote Protocol Support): Review. Add notes about ``!'',
+ non-use of a continue address and typical use of ``q'' packet.
+
+2001-03-22 Eli Zaretskii <eliz@is.elta.co.il>
+
+ Make DJGPP use the new unified support for hardware
+ breakpoints and watchpoints on x86 targets:
+
+ * config/i386/nm-go32.h <top level>: Don't include nm-i386v.h,
+ include nm-i386.h instead.
+ (TARGET_HAS_HARDWARE_WATCHPOINTS, HAVE_CONTINUABLE_WATCHPOINT)
+ (TARGET_CAN_USE_HARDWARE_WATCHPOINT, STOPPED_BY_WATCHPOINT)
+ (TARGET_REGION_OK_FOR_HW_WATCHPOINT, DECR_PC_AFTER_HW_BREAK)
+ (target_stopped_data_address, target_insert_watchpoint)
+ (target_remove_watchpoint, target_insert_hw_breakpoint)
+ (target_remove_hw_breakpoint): Don't define.
+ (I386_USE_GENERIC_WATCHPOINTS, I386_DR_LOW_SET_CONTROL)
+ (I386_DR_LOW_SET_ADDR, I386_DR_LOW_RESET_ADDR)
+ (I386_DR_LOW_GET_STATUS): Define to call appropriate go32_*
+ functions from go32-nat.c.
+
+ * config/i386/go32.mh (NATDEPFILES): Add i386-nat.o.
+
+ * go32-nat.c <top level>: Remove prototypes for watchpoint-
+ related functions. Remove definitions of watchpoint-related
+ macros.
+ (go32_mourn_inferior): Call i386_cleanup_dregs instead of the
+ private cleanup_dregs function.
+ (cleanup_dregs, go32_insert_watchpoint)
+ (go32_insert_aligned_watchpoint, go32_handle_nonaligned_watchpoint)
+ (go32_remove_watchpoint, go32_remove_aligned_watchpoint)
+ (go32_region_ok_for_watchpoint, go32_stopped_by_watchpoint)
+ (go32_remove_hw_breakpoint, go32_insert_hw_breakpoint): Remove.
+ (go32_set_dr, go32_set_dr7, go32_get_dr6): New functions.
+
+2001-03-21 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (fetch_instruction): Warn about slot numbers greater
+ than two instead of generating an error.
+
+2001-03-21 Jim Blandy <jimb@redhat.com>
+
+ * cp-valprint.c: Reformat to bring into line with GNU coding
+ standards.
+
+2001-03-21 Mark Kettenis <kettenis@gnu.org>
+
+ Make Linux use the new unified support for hardware breakpoints
+ and watchpoints on x86 targets.
+ * i386-linux-nat.c: Doc fixes. Include "gdb_assert.h".
+ [HAVE_SYS_DEBUGREG_H]: Include <sys/debugreg.h>.
+ (DR_FIRSTADDR, DR_LASTADDR, DR_STATUS, DR_CONTROL): Define to
+ appropriate value if not already defined.
+ (register_u_addr): New function.
+ (kernel_u_size): New function.
+ (i386_linux_dr_get, i386_linux_dr_set): New functions.
+ (i386_linux_dr_set_control, i386_linux_dr_set_addr,
+ i386_linux_reset_addr, i386_linux_dr_get_status): New functions.
+ * config/i386/nm-linux.h: Don't include "nm-i386v.h".
+ (I386_USE_GENERIC_WATCHPOINTS): Define and include "nm-i386.h".
+ (TARGET_HAS_HARDWARE_WATCHPOINTS,
+ TARGET_CAN_USE_HARDWARE_WATCHPOINTS, HAVE_CONTINUABLE_WATCHPOINT,
+ STOPPED_BY_WATCHPOINT, target_insert_watchpoint,
+ target_remove_watchpoint): Remove macros.
+ (i386_stopped_by_watchpoint, i386_insert_watchpoint,
+ i386_remove_watchpoint): Remove prototypes.
+ (register_u_addr): New prototype.
+ (REGISTER_U_ADDR): Define in terms of register_u_addr.
+ (i386_linux_dr_set_control, i386_linux_dr_set_addr,
+ i386_linux_reset_addr, i386_linux_dr_get_status): New prototypes.
+ (I386_DR_LOW_SET_CONTROL, I386_DR_LOW_SET_ADDR,
+ I386_DR_LOW_RESET_ADDR, I386_DR_LOW_GET_STATUS): New macros.
+ * config/i386/linux.mh (NATDEPFILES): Replace i386v-nat.o with
+ i386-nat.o.
+
+2001-03-21 Jim Blandy <jimb@redhat.com>
+
+ Fix from Dan Berlin:
+
+ * linespec.c (find_methods): Whitespace differences aren't
+ significant in *un*mangled method names. Use strcmp_iw to compare
+ them, not STREQ.
+
+2001-03-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Allow a non- multi-arch target to override a
+ predicate.
+ * gdbarch.h: Regenerate.
+
+2001-03-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Avoid use of ``!''.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * target.h (enum target_signal): Move definition from here.
+ * defs.h (enum target_signal): To here.
+
+ * config/arc/tm-arc.h (arc_software_single_step): Change type of
+ first parameter to enum target_signal.
+ * config/rs6000/tm-rs6000.h (rs6000_software_single_step): Ditto.
+ * config/sparc/tm-sparc.h (sparc_software_single_step): Ditto.
+ * rs6000-tdep.c (rs6000_software_single_step): Update.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h (SIZEOF_FRAME_SAVED_REGS): Report an error if macro
+ already defined.
+
+ From 2000-08-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
+ * stabsread.c (define_symbol): A parameter ('R'), a local ('r'),
+ or a reference ('a') can be in a pseudo register.
+ * infcmd.c (do_registers_info): Must take into account the pseudo
+ registers to print their value.
+ (registers_info): Likewise.
+ * stack.c (frame_info): Likewise.
+ * frame.h (SIZEOF_FRAME_SAVED_REGS): Save the pseudo registers.
+
+2001-03-21 Eli Zaretskii <eliz@is.elta.co.il>
+
+ Unified support for hardware breakpoints and watchpoints on
+ x86 targets:
+
+ * config/i386/nm-i386.h: New file.
+
+ * config/i386/nm-i386.h: (i386_cleanup_dregs)
+ (i386_insert_watchpoint, i386_remove_watchpoint)
+ (i386_region_ok_for_watchpoint, i386_stopped_by_hwbp)
+ (i386_stopped_data_address, i386_insert_hw_breakpoint)
+ (i386_remove_hw_breakpoint): Declare prototypes.
+ [I386_USE_GENERIC_WATCHPOINTS] (TARGET_CAN_USE_HARDWARE_WATCHPOINT):
+ Define if not already defined.
+ (TARGET_REGION_OK_FOR_HW_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT)
+ (STOPPED_BY_WATCHPOINT, target_stopped_data_address)
+ (target_insert_watchpoint, target_remove_watchpoint)
+ (target_insert_hw_breakpoint, target_remove_hw_breakpoint): Define
+ to call the appropriate i386_* functions.
+
+ * i386-nat.c: New file.
+
+ * i386-nat.c (I386_DR_CONTROL_MASK, I386_DR_LOCAL_ENABLE)
+ (I386_DR_GLOBAL_ENABLE, I386_DR_DISABLE, I386_DR_SET_RW_LEN)
+ (I386_DR_GET_RW_LEN, I386_DR_WATCH_HIT): New macros.
+ (dr_mirror, dr_status_mirror, dr_control_mirror, dr_ref_count)
+ (maint_show_dr): New variables.
+ (i386_cleanup_dregs, i386_show_dr, i386_length_and_rw_bits)
+ (i386_insert_aligned_watchpoint, i386_remove_aligned_watchpoint)
+ (i386_handle_nonaligned_watchpoint, i386_insert_watchpoint)
+ (i386_remove_watchpoint, i386_region_ok_for_watchpoint)
+ (i386_stopped_data_address, i386_stopped_by_hwbp)
+ (i386_insert_hw_breakpoint, i386_remove_hw_breakpoint): New
+ functions.
+ (_initialize_i386_nat): New function.
+ [I386_USE_GENERIC_WATCHPOINTS]: Add new maint command
+ `show-debug-regs', sets maint_show_dr to non-zero value and
+ activates debugging print-outs in functions which insert, remove,
+ and test watchpoints and hardware breakpoints.
+
+ * Makefile.in (i386-nat.o): New target.
+ (ALLDEPFILES): Add i386-nat.o.
+
+2001-03-21 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c: Add back _initialize_i386_tdep prototype with
+ appropriate comment.
+
+2001-03-20 Kevin Buettner <kevinb@redhat.com>
+
+ * config/alpha/alpha-linux.mh (NATDEPFILES): Use proc-service.o,
+ thread-db.o, and lin-lwp.o for thread support instead of
+ linux-thread.o and lin-thread.o.
+ * config/alpha/nm-linux.h (PREPARE_TO_PROCEED, GET_THREAD_SIGNALS)
+ (ATTACH_LWP): Define to use the following lin-lwp.c functions...
+ (lin_lwp_prepare_to_proceed, lin_thread_get_thread_signals)
+ (lin_lwp_attach_lwp): Declare.
+
+2001-03-20 Jim Blandy <jimb@redhat.com>
+
+ Fix from Dan Berlin:
+
+ * Makefile.in: Clean up dependencies on ../include/demangle.h.
+ (demangle_h): New variable.
+ (jv-typeprint.o, jv-valprint.o, linespec.o): Use it.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * target.h (SOFTWARE_SINGLE_STEP_P): Add empty parameter list.
+ * breakpoint.c (bpstat_stop_status): Update.
+ * infrun.c (handle_inferior_event): Ditto.
+ * mips-tdep.c (mips_dump_tdep): Ditto.
+ * infrun.c (resume): Ditto.
+ * infptrace.c (child_resume): Ditto.
+ * config/mips/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/sh/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/sparc/tm-sparc.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/powerpc/tm-linux.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/arm/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/arc/tm-arc.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+ * config/powerpc/tm-ppc-eabi.h (SOFTWARE_SINGLE_STEP_P): Ditto.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * config/powerpc/tm-linux.h (SOFTWARE_SINGLE_STEP): Replace abort
+ with internal_error.
+
+2001-03-20 Jim Blandy <jimb@redhat.com>
+
+ Fix from Dan Berlin:
+
+ * linespec.c (find_methods): Just call CHECK_TYPEDEF on t, rather
+ than asking for sym_class's type; that's circuitous. Remove
+ sym_class, since the last use of it is gone.
+
+2001-03-20 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * breakpoint.c (print_it_typical) <bp_access_watchpoint> [UI_OUT]:
+ Correct the order of calls to ui_out_field_string and
+ ui_out_list_begin when bs->old_val is NULL.
+
+2001-03-19 Kevin Buettner <kevinb@redhat.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for existence of nlist.h.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * solib-legacy.c (nlist.h): Include if HAVE_NLIST_H is defined.
+
+2001-03-19 Kevin Buettner <kevinb@redhat.com>
+
+ * config/i386/i386v42mp.mh (NATDEPFILES): List all files on
+ same line to avoid problems with Unixware 7's make when building
+ a cross debugger.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (malloc): Move declaration from here.
+ * utils.c (malloc): To here.
+ * config/pa/xm-hppah.h (malloc): Delete declaration.
+
+ * gnu-nat.c (make_proc): Use xmalloc instead of malloc.
+ * hp-psymtab-read.c (hpread_call_pxdb): Ditto.
+ (hpread_quick_traverse): Ditto.
+ * infttrace.c (create_thread_info): Ditto.
+ (kill_inferior): Ditto.
+ * gnu-nat.c (make_inf): Ditto, and don't check return value.
+ * procfs.c (proc_update_threads): Ditto.
+ * valprint.c (print_decimal_chars): Ditto.
+ * gdbtypes.c (cfront_mangle_name): Use xasprintf instead of
+ malloc and sprintf.
+ * remote-rdp.c (rdp_set_command_line): Ditto.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (realloc): Move declaration from here.
+ * utils.c (realloc): To here.
+ * config/pa/xm-hppah.h (realloc): Delete declaration.
+ * lin-thread.c (insert_thread): Use xrealloc instead of realloc.
+ * symfile.c (add_filename_language): Ditto.
+ * event-loop.c (create_file_handler): Ditto.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (free): Move declaration from here.
+ * utils.c (free): To here.
+ (xfree): Document as the only call to free().
+ * config/pa/xm-hppah.h (free): Delete declaration.
+
+2001-03-19 Kevin Buettner <kevinb@redhat.com>
+
+ * config/ia64/linux.mh (NATDEPFILES): Add proc-service.o to
+ this list.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * eval.c (evaluate_subexp): Remove #ifdef __STDC__ and ``inline''.
+ * config/mips/xm-mips.h (offsetof): Define when !GNUC not !STDC.
+ * cli/cli-cmds.c (init_cli_cmds): Remove #ifdef __STDC__
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO: List known problems with TUI.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Jimmy Guo stepped down as a maintiner (TUI,
+ gdb.hp).
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * remote.c (remote_cisco_section_offsets): Do not cast result from
+ bfd_get_section_name.
+ (compare_sections_command): Ditto.
+ (remote_cisco_section_offsets): Make ``p'' a const pointer.
+ (compare_sections_command): Ditto for ``sectname''.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ From Mon Nov 20 13:59:29 2000 Andrew Cagney <cagney@b1.cygnus.com>:
+ * valops.c (hand_function_call): Simplify computation of the
+ address of the pushed argument.
+
+2001-03-17 Andrew Cagney <ac131313@redhat.com>
+
+ * p-exp.y (parse_number): Avoid shift overflow when ``long''.
+ Code copied from c-exp.y.
+
+2001-03-18 Kevin Buettner <kevinb@redhat.com>
+
+ * acconfig.h (HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
+ (HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS)
+ (HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS): New configure macros.
+ * configure.in (HAVE_STRUCT_LINK_MAP32): Move this test out
+ of the Solaris procfs testing section. Instead, group with...
+ (HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
+ (HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS)
+ (HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS): New <link.h> tests.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+ * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): Use
+ new configure macros to choose which (if any) code to
+ compile in. Added code to explicitly handle *BSD systems;
+ these systems were previously handled only through macro
+ redefinition. Also, due to the way the autoconf tests are set
+ up, this function will no longer return a non-zero value when
+ GDB is configured as a cross debugger. I.e, cross debuggers
+ will no longer be able to "accidentally" get the host system's
+ link map offsets.
+
+2001-03-18 Kevin Buettner <kevinb@redhat.com>
+
+ * config/i386/nbsd.mh (NATDEPFILES): List all files on the same
+ line to avoid build problem on NetBSD 1.4.
+
+2001-03-17 Michael Chastain <chastain@redhat.com>
+
+ * win32-nat.c (child_attach): check args for NULL before passing
+ to strtoul. This fixes PR gdb/43.
+
+2001-03-17 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-nat.h: Doc Fix.
+
+ * i386-tdep.c: Fix formatting.
+ (i386_get_frame_setup, i386_follow_jump, codestream_read,
+ codestream_seek, codestream_fill, skip_trampoline_code,
+ gdb_print_insn_i386, _initialize_i386_tdep): Remove redundant
+ prototypoes.
+
+2001-03-17 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-linux.h (TARGET_ANALYZE_FLOATING): Remove. It's
+ no longer used. Also remove associated FIXME.
+
+2001-03-16 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Add classes ``m'' and ``M'' for pure multi-arch. Do
+ not generate macro wrappers for multi-arch functions or
+ predicates.
+ (class_is_info_p, class_is_predicate_p): Update.
+ (class_is_function_p, class_is_variable_p): Ditto.
+ (class_is_multiarch_p): New class function.
+
+2001-03-16 J.T. Conklin <jtc@redback.com>
+
+ * config/h8300/tm-h8300.h (FRAME_ARGS_ADDRESS): Changed to use
+ h8300_frame_args_address from frame_args_address.
+ (FRAME_LOCALS_ADDRESS): Changed to use h8300_frame_locals_address
+ from frame_locals_address.
+ (PRINT_REGISTER_HOOK): Changed to use h8300_print_register_hook
+ from print_register_hook.
+ (h8300_frame_args_address): Declare.
+ (h8300_frame_find_saved_regs): Declare.
+ (h8300_frame_locals_address): Declare.
+ (h8300_frame_saved_pc): Declare.
+ (h8300_pop_frame): Declare.
+ (h8300_print_register_hook): Declare.
+ * h8300-tdep.c (h8300_frame_find_saved_regs): Removed declaration.
+ (h8300_frame_args_address): Renamed from frame_args_address.
+ (h8300_frame_locals_address): Renamed from frame_locals_address.
+ (h8300_pop_frame): Renamed from pop_frame.
+ (h8300_print_register_hook): Renamed from print_register_hook.
+
+2001-03-16 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-svr4.c (bfd_lookup_symbol): Change type of
+ ``storage_needed'' from unsigned int to long in order to
+ match return type of bfd_get_symtab_upper_bound() and
+ bfd_get_dynamic_symtab_upper_bound().
+ * solib-aix5.c (bfd_lookup_symbol): Likewise. Also, eliminate
+ REASONABLE_LIMIT hack which had been added to work around this
+ problem.
+
+2001-03-15 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (bfd_lookup_symbol, build_so_list_from_mapfile)
+ (aix5_relocate_main_executable, aix5_clear_solib): Replace calls
+ to free() with calls to xfree().
+ (bfd_lookup_symbol): Eliminate use of PTR.
+ (build_so_list_from_mapfile): Use xasprintf() instead of sprintf().
+
+2001-03-15 Martin Hunt <hunt@redhat.com>
+
+ * linespec.c (decode_line_1): Remove trailing quote
+ when parsing double quotes.
+
+2001-03-15 Kevin Buettner <kevinb@redhat.com>
+
+ * uw-thread.c (read_thr_debug, read_map, read_lwp, thread_iter)
+ (libthread_stub, libthread_init): Pass NULL for the mem_attrib
+ argument in the to_xfer_memory calls.
+
+2001-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Fix typo - w65 not w64. Still doesn't build.
+ * TODO (GDB 5.1 - Cleanups): Add status of targets being obsoleted.
+
+2001-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * wince.c (child_xfer_memory): Add attrib parameter.
+ * symm-nat.c (child_xfer_memory): Ditto.
+ * mac-nat.c (child_xfer_memory): Ditto.
+ * infttrace.c (child_xfer_memory): Ditto.
+ * procfs.c (procfs_xfer_memory): Ditto.
+ * lin-thread.c (thread_db_xfer_memory): Ditto.
+ * gnu-nat.c (gnu_xfer_memory): Ditto.
+
+2001-03-14 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Mention that Harris/CXUX m88k is obsolete.
+
+2001-03-13 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/tm-mips.h: Include "regcache.h" for macros refering
+ to regcache functions.
+ * config/m68k/tm-m68k.h: Ditto.
+ * config/i386/tm-i386v.h: Ditto.
+ * config/mcore/tm-mcore.h: Ditto.
+ * config/m88k/tm-m88k.h: Ditto.
+ * config/m68k/tm-news.h: Ditto.
+ * config/m68k/tm-linux.h: Ditto.
+ * config/m68k/tm-delta68.h: Ditto.
+ * config/m68k/nm-sun3.h: Ditto.
+ * config/m32r/tm-m32r.h: Ditto.
+ * config/i386/tm-symmetry.h: Ditto.
+ * config/i386/tm-sun386.h: Ditto.
+ * config/i386/tm-i386.h: Ditto.
+ * config/i386/nm-symmetry.h: Ditto.
+ * config/i386/nm-sun386.h: Ditto.
+ * config/i386/nm-ptx4.h: Ditto.
+ * config/i386/nm-i386mach.h: Ditto.
+ * config/h8500/tm-h8500.h: Ditto.
+ * config/h8300/tm-h8300.h: Ditto.
+ * config/fr30/tm-fr30.h: Ditto.
+ * config/d30v/tm-d30v.h: Ditto.
+ * config/arm/tm-arm.h: Ditto.
+ * config/arc/tm-arc.h: Ditto.
+ * config/alpha/tm-alpha.h: Ditto.
+ * config/a29k/tm-vx29k.h: Ditto.
+ * config/a29k/tm-a29k.h: Ditto.
+ * config/w65/tm-w65.h: Ditto.
+ * config/vax/tm-vax.h: Ditto.
+ * config/v850/tm-v850.h: Ditto.
+ * config/tic80/tm-tic80.h: Ditto.
+ * config/sparc/tm-sparclite.h: Ditto.
+ * config/sparc/tm-sparclet.h: Ditto.
+ * config/sparc/tm-sparc.h: Ditto.
+ * config/sparc/nm-sun4sol2.h: Ditto.
+ * config/sparc/nm-sun4os4.h: Ditto.
+ * config/sparc/nm-nbsd.h: Ditto.
+ * config/powerpc/nm-solaris.h: Ditto.
+ * config/pa/tm-hppao.h: Ditto.
+ * config/pa/tm-hppa.h: Ditto.
+ * config/pa/nm-hppab.h: Ditto.
+ * config/ns32k/tm-umax.h: Ditto.
+ * config/ns32k/tm-merlin.h: Ditto.
+ * config/nm-m3.h: Ditto.
+ * config/nm-gnu.h: Ditto.
+
+2001-03-14 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Update list of targets. Mark arm-* and v850-elf as
+ broken. Mark sh-*, ia64-linux and ns32k-netbsd as buildable.
+ Specify an m88k target. Include sample GAWK script to generate
+ target list. Delete non-existant romp target.
+ * TODO (GDB 5.1 - Cleanups): Update.
+
+2001-03-14 Keith Seitz <keiths@cygnus.com>
+
+ * linespec.c (decode_line_1): Skip argptr over a leading
+ double quote. Prevents alloc of 0 bytes and memcpy of -1 bytes.
+
+2001-03-14 Kevin Buettner <kevinb@redhat.com>
+
+ * config/djgpp/fnchange.lst (ia64-aix-nat.c): Add entry.
+
+2001-03-13 Andrew Cagney <ac131313@redhat.com>
+
+ * ui-out.h: Remove #if __STDC__, assume an ISO-C compiler.
+ * m3-nat.c: Ditto.
+ * p-lang.h: Ditto.
+ * printcmd.c (printf_command): Ditto.
+ * ch-exp.c (match_integer_literal): Ditto.
+ * scm-tags.h: Ditto.
+ * ser-go32.c: Ditto.
+ * hppa-tdep.c (unwind_command): Ditto.
+ * defs.h (volatile): Delete macro definition. Assume __STDC__.
+ * remote-adapt.c (volatile): Ditto.
+ * remote-eb.c (volatile): Ditto.
+ * remote-mm.c (volatile): Ditto.
+ * defs.h (alloca): Assume __STDC__, declare returning void *.
+
+2001-03-08 Andrew Cagney <ac131313@redhat.com>
+
+ * inferior.h (ARCH_NUM_REGS): Delete definition.
+ * stack.c (frame_info): Use NUM_REGS, not ARCH_NUM_REGS.
+ * regcache.c (registers_changed): Ditto.
+ (registers_fetched): Ditto.
+ * infptrace.c (fetch_inferior_registers): Ditto.
+ (store_inferior_registers): Ditto.
+ * infcmd.c (do_registers_info): Ditto.
+ (registers_info): Ditto.
+ * i386-linux-nat.c (old_fetch_inferior_registers): Ditto.
+ (old_store_inferior_registers): Ditto.
+ * gdbserver/low-linux.c (register_addr): Ditto.
+ * gdbserver/low-hppabsd.c (register_addr): Ditto.
+ * core-aout.c: Don't include "inferior.h".
+ (fetch_core_registers): Use NUM_REGS not ARCH_NUM_REGS.
+ (register_addr): Ditto.
+
+2001-03-13 Fernando Nasser <fnasser@redhat.com>
+
+ From Steven Johnson <sjohnson@neurizon.net>
+ * cli/cli-script.c (define_command): Fix setting of post hooks.
+
+2001-03-13 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c: Fix formatting and clarify comments.
+ (i386_linux_svr4_fetch_link_map_offsets): Use NULL instead of 0
+ where appropriate.
+
+2001-03-12 Andrew Cagney <ac131313@redhat.com>
+
+ * gnu-nat.c: Include "gdb_assert.h" instead of <assert.h>.
+ (proc_update_sc): Use gdb_assert instead of assert.
+ (proc_abort): Ditto.
+ (inf_set_step_thread): Ditto.
+ (gnu_wait): Ditto.
+ (S_exception_raise_request): Ditto.
+ (gnu_terminal_init_inferior): Ditto.
+
+2001-03-09 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (solib-svr4.o): Depend on solib-svr4.c, not solib.c.
+ (solib-legacy.o): New makefile target.
+ * solib-legacy.c: New file.
+ * solib-svr4.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete.
+ (default_svr4_fetch_link_map_offsets): Delete.
+ (set_solib_svr4_fetch_link_map_offsets): Declare.
+ (legacy_svr4_fetch_link_map_offsets_hook): Declare.
+ * solib-svr4.c (elf/common.h): Include.
+ (link.h): Only include for SunOS shared library support.
+ (_SYSCALL32): Don't define.
+ (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
+ (default_svr4_fetch_link_map_offsets): Made static; added forward
+ declaration.
+ (fetch_link_map_offsets): New static global.
+ (legacy_svr4_fetch_link_map_offsets_hook): New global variable.
+ (default_svr4_fetch_link_map_offsets): Rewritten. The guts
+ of what used to be in this function now reside in
+ legacy_svr4_fetch_link_map_offsets() in solib-legacy.c.
+ (open_symbol_file_object): Fix declaration in SunOS section
+ of the code.
+ (set_solib_svr4_fetch_link_map_offsets): New extern function.
+ (init_fetch_link_map_offsets): New static function.
+ (_initialize_svr4_solib): Put static global fetch_link_map_offsets
+ under multiarch control.
+
+ * config/alpha/alpha-linux.mt (TDEPFILES): Add solib-legacy.o to
+ list.
+ * config/alpha/fbsd.mh (NATDEPFILES): Likewise.
+ * config/arm/linux.mt (TDEPFILES): Likewise.
+ * config/i386/fbsd.mh (NATDEPFILES): Likewise.
+ * config/i386/i386dgux.mh (NATDEPFILES): Likewise.
+ * config/i386/i386gnu.mh (NATDEPFILES): Likewise.
+ * config/i386/i386sco5.mh (NATDEPFILES): Likewise.
+ * config/i386/i386sol2.mt (TDEPFILES): Likewise.
+ * config/i386/i386v4.mh (NATDEPFILES): Likewise.
+ * config/i386/i386v42mp.mh (NATDEPFILES): Likewise.
+ * config/i386/linux.mt (TDEPFILES): Likewise.
+ * config/i386/nbsd.mh (NATDEPFILES): Likewise.
+ * config/i386/nbsdelf.mh (NATDEPFILES): Likewise.
+ * config/i386/ncr3000.mt (TDEPFILES): Likewise.
+ * config/i386/ptx4.mh (XDEPFILES): Likewise.
+ * config/i386/sun386.mt (TDEPFILES): Likewise.
+ * config/ia64/linux.mt (TDEPFILES): Likewise.
+ * config/m68k/linux.mt (TDEPFILES): Likewise.
+ * config/m68k/m68kv4.mh (NATDEPFILES): Likewise.
+ * config/m68k/nbsd.mh (NATDEPFILES): Likewise.
+ * config/m68k/sun2os4.mt (TDEPFILES): Likewise.
+ * config/m68k/sun3os4.mt (TDEPFILES): Likewise.
+ * config/m88k/delta88v4.mh (NATDEPFILES): Likewise.
+ * config/mips/mipsv4.mh (NATDEPFILES): Likewise.
+ * config/ns32k/nbsd.mh (NATDEPFILES): Likewise.
+ * config/powerpc/linux.mt (TDEPFILES): Likewise.
+ * config/powerpc/nbsd.mh (NATDEPFILES): Likewise.
+ * config/powerpc/solaris.mh (NATDEPFILES): Likewise.
+ * config/sh/linux.mt (TDEPFILES): Likewise.
+ * config/sparc/linux.mt (TDEPFILES): Likewise.
+ * config/sparc/nbsd.mh (NATDEPFILES): Likewise.
+ * config/sparc/nbsdelf.mh (NATDEPFILES): Likewise.
+ * config/sparc/sp64linux.mt (TDEPFILES): Likewise.
+ * config/sparc/sun4os4.mt (TDEPFILES): Likewise.
+ * config/sparc/sun4sol2.mh (NATDEPFILES): Likewise.
+
+2001-03-09 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (xmrealloc, xcalloc): Return NULL for zero-sized requests.
+
+2001-03-09 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Write After Approval): Update Philip Blundell.
+
+2001-03-09 Keith Seitz <keiths@cygnus.com>
+
+ * MAINTAINERS: Add myself to write after approval list.
+
+2001-03-09 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (print_i387_status_word): Fix printing of Stack
+ fault flag. It is bit 6 of the x87 FPU status word, not bit 7.
+
+2001-03-08 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.host (m88*-harris-cxux*): Mark as obsolete.
+ * configure.tgt: Ditto.
+ * config/m88k/xm-cxux.h: Ditto.
+ * config/m88k/tm-cxux.h: Ditto.
+ * config/m88k/nm-cxux.h: Ditto.
+ * config/m88k/cxux.mt: Ditto.
+ * config/m88k/cxux.mh: Ditto.
+
+2001-03-08 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Delete rules for obsolete files.
+
+Thu Mar 8 15:43:40 2001 David Taylor <taylor@redhat.com>
+
+ * stack.c (parse_frame_specification): For one argument case,
+ handle the situation where the argument is an integer, not an
+ address -- arguably the most common case. This matters on
+ targets where pointers and addresses are different.
+
+2001-03-08 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO: Revise 5.1 list. Delete PARAMS task. Add coding standard
+ review. Clarify GNU/LINUX/sparc. Move other tasks to 5.2 or
+ general.
+
+2001-03-07 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (GDB 5.1 Known Problems): Document problem of building GDB
+ with SID on Solaris 8.
+
+2001-03-07 Mark Kettenis <kettenis@gnu.org>
+
+ * defs.h: Provide prototypes for floatformat_is_negative,
+ floatformat_is_nan and floatformat_mantissa.
+ * utils.c: Include "gdb_assert.h".
+ (floatformat_is_negative): New function.
+ (floatformat_is_nan): New function.
+ (floatformat_mantissa): New function.
+ * valprint.c: Include "floatformat.h".
+ (print_floating): Get rid of the Linux-specific
+ TARGET_ANALYZE_FLOATING macro and rewrite NaN detection with the
+ help these new functions. Print NaN's in a format conforming to
+ ISO C99.
+
+2001-03-07 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * top.c (init_main): Make `set history file name' complete on file
+ names.
+
+2001-03-06 J.T. Conklin <jtc@redback.com>
+
+ * Makefile.in (LINTFLAGS): Update to contain all of the macros
+ which define include paths used when compiling.
+
+ * util.c (savestring, msavestring): Change type of length argument.
+ * defs.h (savestring, msavestring): Update to match.
+
+ * symtab.h (decode_line_1): Removed declaration.
+
+ * symfile.c (#include <assert.h>): Removed.
+
+ * arch-utils.c (#include <ctype.h>): Removed.
+ * c-typeprint.c: Likewise.
+ * dbxread.c: Likewise.
+ * gdbtypes.c: Likewise.
+ * target.c: Likewise.
+ * os9kread.c: Likewise.
+
+ * c-valprint.c (#include "demangle.h"): Removed.
+ * ch-typeprint.c: Likewise.
+ * eval.c: Likewise.
+ * f-typeprint.c: Likewise.
+ * f-valprint.c: Likewise.
+ * m2-typeprint.c: Likewise.
+ * typeprint.c: Likewise.
+ * p-typeprint.c: Likewise.
+ * valarith.c: Likewise.
+ * valprint.c: Likewise.
+
+ * m2-typeprint.c (#include "gdb_string.h"): Removed.
+ * nlmread.c: Likewise.
+
+ * mdebugread.c (#include "gdb-stabs.h"): Removed.
+ * minsyms.c: Likewise.
+ * mipsread.c: Likewise.
+ * nlmread.c: Likewise.
+
+ * m2-typeprint.c (#include "obstack.h"): Removed.
+ * m2-valprint.c: Likewise.
+
+ * event-loop.c (#include <setjmp.h>): Removed.
+
+2001-03-06 Stan Shebs <shebs@apple.com>
+
+ * MAINTAINERS: Remove self from specific maintenance domains
+ (macos, gdbserver, documentation, testsuite).
+
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * 29k-share/udi/udip2soc.c, Makefile.in, a29k-tdep.c,
+ a68v-nat.c, abug-rom.c, aclocal.m4, alpha-nat.c, alpha-tdep.c,
+ annotate.c, annotate.h, arc-tdep.c, arch-utils.c,
+ arch-utils.h, arm-tdep.c, ax-gdb.c, ax-gdb.h, ax-general.c,
+ ax.h, bcache.c, bcache.h, blockframe.c, breakpoint.c,
+ breakpoint.h, buildsym.c, buildsym.h, c-exp.y, c-lang.c,
+ c-lang.h, c-typeprint.c, c-valprint.c, call-cmds.h, ch-exp.c,
+ ch-lang.c, ch-lang.h, ch-typeprint.c, ch-valprint.c,
+ cli/cli-cmds.h, cli/cli-decode.c, cli/cli-decode.h,
+ cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.h,
+ cli/cli-utils.h, cli-out.c, cli-out.h, coff-solib.c,
+ coff-solib.h, coffread.c, command.h, complaints.c,
+ complaints.h, completer.c, completer.h,
+ config/a29k/nm-ultra3.h, config/a29k/tm-a29k.h,
+ config/a29k/tm-ultra3.h, config/a29k/tm-vx29k.h,
+ config/a29k/xm-ultra3.h, config/alpha/nm-fbsd.h,
+ config/alpha/nm-linux.h, config/alpha/nm-osf.h,
+ config/alpha/nm-osf2.h, config/alpha/nm-osf3.h,
+ config/alpha/tm-alpha.h, config/alpha/tm-alphalinux.h,
+ config/alpha/xm-alphalinux.h, config/alpha/xm-alphaosf.h,
+ config/alpha/xm-fbsd.h, config/arc/tm-arc.h,
+ config/arm/nm-linux.h, config/arm/tm-arm.h,
+ config/arm/tm-embed.h, config/d10v/tm-d10v.h,
+ config/d30v/tm-d30v.h, config/fr30/tm-fr30.h,
+ config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ config/i386/nm-fbsd.h, config/i386/nm-gnu.h,
+ config/i386/nm-i386bsd.h, config/i386/nm-i386mach.h,
+ config/i386/nm-i386sco.h, config/i386/nm-i386sol2.h,
+ config/i386/nm-i386v.h, config/i386/nm-i386v4.h,
+ config/i386/nm-i386v42mp.h, config/i386/nm-linux.h,
+ config/i386/nm-nbsd.h, config/i386/nm-nbsdelf.h,
+ config/i386/nm-ptx4.h, config/i386/nm-sun386.h,
+ config/i386/nm-symmetry.h, config/i386/tm-cygwin.h,
+ config/i386/tm-fbsd.h, config/i386/tm-i386.h,
+ config/i386/tm-i386aix.h, config/i386/tm-i386bsd.h,
+ config/i386/tm-i386gnu.h, config/i386/tm-i386lynx.h,
+ config/i386/tm-i386m3.h, config/i386/tm-i386mk.h,
+ config/i386/tm-i386nw.h, config/i386/tm-i386os9k.h,
+ config/i386/tm-i386sco5.h, config/i386/tm-i386sol2.h,
+ config/i386/tm-i386v.h, config/i386/tm-i386v4.h,
+ config/i386/tm-i386v42mp.h, config/i386/tm-linux.h,
+ config/i386/tm-nbsd.h, config/i386/tm-ptx.h,
+ config/i386/tm-ptx4.h, config/i386/tm-sun386.h,
+ config/i386/tm-symmetry.h, config/i386/tm-vxworks.h,
+ config/i386/xm-fbsd.h, config/i386/xm-i386bsd.h,
+ config/i386/xm-i386gnu.h, config/i386/xm-i386m3.h,
+ config/i386/xm-i386mach.h, config/i386/xm-i386mk.h,
+ config/i386/xm-i386sco.h, config/i386/xm-i386v4.h,
+ config/i386/xm-linux.h, config/i386/xm-nbsd.h,
+ config/i386/xm-ptx.h, config/i386/xm-ptx4.h,
+ config/i386/xm-sun386.h, config/i386/xm-symmetry.h,
+ config/i960/tm-i960.h, config/i960/tm-mon960.h,
+ config/i960/tm-nindy960.h, config/i960/tm-vx960.h,
+ config/ia64/nm-aix.h, config/ia64/nm-linux.h,
+ config/ia64/tm-aix.h, config/ia64/tm-ia64.h,
+ config/ia64/tm-linux.h, config/ia64/xm-aix.h,
+ config/ia64/xm-linux.h, config/m68k/nm-apollo68b.h,
+ config/m68k/nm-delta68.h, config/m68k/nm-dpx2.h,
+ config/m68k/nm-hp300bsd.h, config/m68k/nm-hp300hpux.h,
+ config/m68k/nm-linux.h, config/m68k/nm-sun3.h,
+ config/m68k/tm-apollo68b.h, config/m68k/tm-cisco.h,
+ config/m68k/tm-dpx2.h, config/m68k/tm-es1800.h,
+ config/m68k/tm-hp300bsd.h, config/m68k/tm-hp300hpux.h,
+ config/m68k/tm-isi.h, config/m68k/tm-linux.h,
+ config/m68k/tm-m68k.h, config/m68k/tm-m68kv4.h,
+ config/m68k/tm-mac.h, config/m68k/tm-monitor.h,
+ config/m68k/tm-nbsd.h, config/m68k/tm-news.h,
+ config/m68k/tm-os68k.h, config/m68k/tm-sun3.h,
+ config/m68k/tm-vx68.h, config/m68k/xm-3b1.h,
+ config/m68k/xm-apollo68b.h, config/m68k/xm-dpx2.h,
+ config/m68k/xm-hp300bsd.h, config/m68k/xm-hp300hpux.h,
+ config/m68k/xm-linux.h, config/m68k/xm-m68kv4.h,
+ config/m68k/xm-mpw.h, config/m68k/xm-news.h,
+ config/m68k/xm-sun2.h, config/m68k/xm-sun3.h,
+ config/m68k/xm-sun3os4.h, config/m88k/nm-delta88v4.h,
+ config/m88k/tm-delta88.h, config/m88k/tm-delta88v4.h,
+ config/m88k/tm-m88k.h, config/m88k/xm-cxux.h,
+ config/m88k/xm-delta88.h, config/m88k/xm-delta88v4.h,
+ config/m88k/xm-dgux.h, config/mcore/tm-mcore.h,
+ config/mips/nm-irix3.h, config/mips/nm-irix4.h,
+ config/mips/nm-irix5.h, config/mips/nm-mips.h,
+ config/mips/nm-news-mips.h, config/mips/tm-bigmips.h,
+ config/mips/tm-embed.h, config/mips/tm-embed64.h,
+ config/mips/tm-embedl.h, config/mips/tm-embedl64.h,
+ config/mips/tm-irix3.h, config/mips/tm-irix5.h,
+ config/mips/tm-mips.h, config/mips/tm-mips64.h,
+ config/mips/tm-mipsm3.h, config/mips/tm-mipsv4.h,
+ config/mips/tm-tx39.h, config/mips/tm-tx39l.h,
+ config/mips/tm-vr4100.h, config/mips/tm-vr4300.h,
+ config/mips/tm-vr4300el.h, config/mips/tm-vr4xxx.h,
+ config/mips/tm-vr4xxxel.h, config/mips/tm-vr5000.h,
+ config/mips/tm-vr5000el.h, config/mips/xm-irix3.h,
+ config/mips/xm-irix4.h, config/mips/xm-irix5.h,
+ config/mips/xm-mips.h, config/mips/xm-mipsm3.h,
+ config/mips/xm-mipsv4.h, config/mips/xm-news-mips.h,
+ config/mips/xm-riscos.h, config/mn10200/tm-mn10200.h,
+ config/mn10300/tm-mn10300.h, config/nm-gnu.h,
+ config/nm-linux.h, config/nm-lynx.h, config/nm-m3.h,
+ config/nm-sysv4.h, config/none/nm-none.h,
+ config/none/tm-none.h, config/none/xm-none.h,
+ config/ns32k/nm-nbsd.h, config/ns32k/nm-umax.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-nbsd.h,
+ config/ns32k/tm-ns32km3.h, config/ns32k/tm-umax.h,
+ config/ns32k/xm-merlin.h, config/ns32k/xm-ns32km3.h,
+ config/pa/nm-hppab.h, config/pa/nm-hppah.h,
+ config/pa/nm-hppao.h, config/pa/tm-hppa.h,
+ config/pa/tm-hppa64.h, config/pa/tm-hppah.h,
+ config/pa/xm-hppab.h, config/pa/xm-hppah.h,
+ config/powerpc/nm-aix.h, config/powerpc/nm-linux.h,
+ config/powerpc/nm-macos.h, config/powerpc/nm-nbsd.h,
+ config/powerpc/tm-cygwin.h, config/powerpc/tm-linux.h,
+ config/powerpc/tm-macos.h, config/powerpc/tm-ppc-aix.h,
+ config/powerpc/tm-ppc-eabi.h, config/powerpc/tm-ppc-nw.h,
+ config/powerpc/tm-ppcle-eabi.h, config/powerpc/tm-solaris.h,
+ config/powerpc/xm-aix.h, config/powerpc/xm-linux.h,
+ config/powerpc/xm-mpw.h, config/rs6000/nm-rs6000.h,
+ config/rs6000/tm-rs6000.h, config/rs6000/tm-rs6000ly.h,
+ config/rs6000/xm-aix4.h, config/rs6000/xm-rs6000.h,
+ config/sh/tm-linux.h, config/sh/tm-sh.h, config/sh/tm-wince.h,
+ config/sparc/nm-linux.h, config/sparc/nm-nbsd.h,
+ config/sparc/nm-nbsdelf.h, config/sparc/nm-sparclynx.h,
+ config/sparc/nm-sun4os4.h, config/sparc/nm-sun4sol2.h,
+ config/sparc/tm-linux.h, config/sparc/tm-sp64.h,
+ config/sparc/tm-sp64sim.h, config/sparc/tm-sparc.h,
+ config/sparc/tm-sparclet.h, config/sparc/tm-sparclite.h,
+ config/sparc/tm-sparclynx.h, config/sparc/tm-spc-em.h,
+ config/sparc/tm-sun4os4.h, config/sparc/tm-sun4sol2.h,
+ config/sparc/xm-sun4os4.h, config/sparc/xm-sun4sol2.h,
+ config/tic80/tm-tic80.h, config/tm-linux.h, config/tm-lynx.h,
+ config/tm-sysv4.h, config/v850/tm-v850.h, config/vax/tm-vax.h,
+ config/w65/tm-w65.h, config/xm-aix4.h, config/xm-lynx.h,
+ config/xm-mpw.h, config/xm-nbsd.h, config/xm-sysv4.h,
+ config/z8k/tm-z8k.h, configure.in, core-aout.c, core-regset.c,
+ core-sol2.c, corefile.c, corelow.c, cp-valprint.c,
+ cpu32bug-rom.c, cxux-nat.c, d10v-tdep.c, d30v-tdep.c,
+ dbug-rom.c, dbxread.c, dcache.c, dcache.h, defs.h,
+ delta68-nat.c, demangle.c, dink32-rom.c, dpx2-nat.c, dsrec.c,
+ dstread.c, dve3900-rom.c, dwarf2read.c, dwarfread.c,
+ elfread.c, environ.c, environ.h, eval.c, event-loop.c,
+ event-loop.h, event-top.c, exec.c, expprint.c, f-exp.y,
+ f-lang.c, f-lang.h, f-typeprint.c, f-valprint.c, findvar.c,
+ fork-child.c, fr30-tdep.c, frame.c, frame.h, gdb-events.c,
+ gdb-events.h, gdb-events.sh, gdb-stabs.h, gdb.1, gdb_string.h,
+ gdb_thread_db.h, gdbcmd.h, gdbcore.h, gdbserver/Makefile.in,
+ gdbserver/gdbreplay.c, gdbserver/gdbserver.1,
+ gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
+ gdbserver/low-lynx.c, gdbserver/low-nbsd.c,
+ gdbserver/low-sim.c, gdbserver/low-sparc.c,
+ gdbserver/low-sun3.c, gdbserver/remote-utils.c,
+ gdbserver/server.c, gdbserver/server.h, gdbserver/utils.c,
+ gdbthread.h, gdbtypes.c, gdbtypes.h, gnu-nat.c, gnu-nat.h,
+ gnu-regex.c, gnu-regex.h, h8300-tdep.c, h8500-tdep.c,
+ hp-psymtab-read.c, hp-symtab-read.c, hp300ux-nat.c,
+ hppa-tdep.c, hppab-nat.c, hppah-nat.c, hppam3-nat.c, hpread.c,
+ hpread.h, hpux-thread.c, i386-tdep.c, i386aix-nat.c,
+ i386b-nat.c, i386gnu-nat.c, i386ly-tdep.c, i386m3-nat.c,
+ i386mach-nat.c, i386nbsd-nat.c, i386nbsd-tdep.c, i386v-nat.c,
+ i386v4-nat.c, i387-tdep.c, i960-tdep.c, infcmd.c, inferior.h,
+ inflow.c, infptrace.c, infrun.c, inftarg.c, infttrace.c,
+ irix4-nat.c, irix5-nat.c, isi-xdep.c, jv-exp.y, jv-lang.c,
+ jv-lang.h, jv-typeprint.c, jv-valprint.c, kdb-start.c,
+ kod-cisco.c, kod.c, language.c, language.h, lin-thread.c,
+ linespec.c, linespec.h, linux-thread.c, lynx-nat.c, m2-exp.y,
+ m2-lang.c, m2-lang.h, m2-typeprint.c, m2-valprint.c, m3-nat.c,
+ m32r-rom.c, m32r-tdep.c, m68k-tdep.c, m68klinux-nat.c,
+ m68knbsd-nat.c, m88k-nat.c, m88k-tdep.c, mac-nat.c,
+ mac-xdep.c, main.c, maint.c, mcore-rom.c, mcore-tdep.c,
+ mdebugread.c, mem-break.c, minimon.h, minsyms.c, mips-nat.c,
+ mips-tdep.c, mipsm3-nat.c, mipsread.c, mipsv4-nat.c,
+ mn10200-tdep.c, mn10300-tdep.c, mon960-rom.c, monitor.c,
+ monitor.h, news-xdep.c, nindy-share/env.h, nindy-tdep.c,
+ nlm/Makefile.in, nlmread.c, ns32k-tdep.c, ns32km3-nat.c,
+ ns32knbsd-nat.c, objfiles.c, objfiles.h, ocd.c, ocd.h,
+ op50-rom.c, os9kread.c, osfsolib.c, p-exp.y, pa64solib.c,
+ pa64solib.h, parse.c, parser-defs.h, partial-stab.h,
+ ppc-bdm.c, ppc-linux-nat.c, ppc-linux-tdep.c, ppcbug-rom.c,
+ ppcnbsd-nat.c, printcmd.c, proc-api.c, proc-events.c,
+ proc-flags.c, proc-utils.h, proc-why.c, procfs.c, ptx4-nat.c,
+ rdi-share/Makefile.in, rdi-share/aclocal.m4, regcache.c,
+ regcache.h, remote-adapt.c, remote-array.c, remote-bug.c,
+ remote-e7000.c, remote-eb.c, remote-es.c, remote-est.c,
+ remote-hms.c, remote-mips.c, remote-mm.c, remote-nindy.c,
+ remote-nrom.c, remote-os9k.c, remote-rdi.c, remote-rdp.c,
+ remote-sds.c, remote-sim.c, remote-st.c, remote-udi.c,
+ remote-utils.c, remote-utils.h, remote-vx.c, remote.c,
+ remote.h, reply_mig_hack.awk, rom68k-rom.c, rs6000-nat.c,
+ rs6000-tdep.c, scm-exp.c, scm-lang.c, scm-lang.h, scm-tags.h,
+ scm-valprint.c, ser-e7kpc.c, ser-mac.c, ser-ocd.c, ser-pipe.c,
+ ser-tcp.c, ser-unix.c, serial.c, serial.h, sh-tdep.c,
+ sh3-rom.c, sol-thread.c, solib-aix5.c, solib-svr4.c, solib.c,
+ solib.h, solist.h, somread.c, somsolib.c, somsolib.h,
+ source.c, sparc-nat.c, sparc-tdep.c, sparcl-tdep.c,
+ sparclet-rom.c, srec.h, stabsread.c, stabsread.h, stack.c,
+ standalone.c, stop-gdb.c, stuff.c, sun3-nat.c, sun386-nat.c,
+ symfile.c, symfile.h, symm-nat.c, symm-tdep.c, symmisc.c,
+ symtab.c, symtab.h, target.c, target.h, terminal.h, thread.c,
+ tic80-tdep.c, top.c, top.h, tracepoint.c, tracepoint.h,
+ typeprint.c, ui-file.c, ui-file.h, ui-out.h, ultra3-nat.c,
+ ultra3-xdep.c, umax-xdep.c, utils.c, v850-tdep.c, v850ice.c,
+ valarith.c, valops.c, valprint.c, value.h, values.c, varobj.h,
+ vax-tdep.c, version.h, vx-share/vxWorks.h, vx-share/xdr_ld.c,
+ vx-share/xdr_ptrace.c, vx-share/xdr_ptrace.h,
+ vx-share/xdr_rdb.c, w65-tdep.c, w89k-rom.c, win32-nat.c,
+ wrapper.c, wrapper.h, xcoffread.c, xcoffsolib.c, xcoffsolib.h,
+ xmodem.c, xmodem.h, z8k-tdep.c: Update/correct copyright
+ notices.
+
+2001-03-05 Kevin Buettner <kevinb@redhat.com>
+
+ * acconfig.h (HAVE_PRSYSENT_T, HAVE_PR_SIGSET_T,
+ HAVE_PR_SIGACTION64_T, HAVE_PR_SIGINFO64_T): New configure
+ macros.
+ * configure.in (prsysent_t, pr_sigset_t, pr_sigaction64_t,
+ pr_siginfo64_t): Test for these typedefs in <sys/procfs.h>.
+ (sys/fault.h, sys/select.h): Test for presence of these
+ header files.
+ (ia64-*-aix*): Define NEW_PROC_API for this host.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+ * configure.host (ia64-*-aix*): New host.
+ * configure.tgt (ia64-*-aix*): New target.
+
+2001-03-05 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (GDB 5.1 Known Problems): Document z8k as broken.
+
+Mon Mar 5 11:56:09 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * wince.c: Change realloc to xrealloc throughout.
+ (handle_load_dll): Use void * rather than PTR in argument.
+
+2001-03-04 Andrew Cagney <ac131313@redhat.com>
+
+ * ocd.h (ocd_xfer_memory): Add ``attrib'' parameter.
+ * ocd.c (ocd_xfer_memory): Ditto.
+ * ser-ocd.c (ocd_setstopbits): New function. Add to ocd_ops.
+ * MAINTAINERS: Document powerpc-eabi and powerpcle-eabi as
+ buildable with ,-Werror.
+
+ * Makefile.in (symfile_h): Define.
+ (mcore-tdep.o): Add $(symfile_h), $(gdbcore_h) and $(inferior_h).
+ * mcore-tdep.c: Include "symfile.h", "gdbcore.h" and "inferior.h".
+ * MAINTAINERS: Document mcore-elf and mcore-pe as buildable with
+ ,-Werror.
+
+ * dsrec.c (make_srec): Fix internal_error fmt arg.
+ * MAINTAINERS: Document i960-coff as buildable with ,-Werror.
+
+2001-03-03 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (aix5_relocate_main_executable): Don't use ANOFFSET
+ as an lvalue.
+
+2001-03-02 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (paper trail): Update.
+
+ * CONTRIBUTE: Update note on ``Fix PR gdb/4706'' convention.
+
+2001-03-02 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-03-01 Tom Rix <trix@redhat.com>:
+ * mn10200-tdep.c (mn10200_frame_chain): Pass 0 for ``pc''
+ parameter to mn10200_analyze_prologue.
+
+ * config/mn10200/tm-mn10200.h: Include "regcache.h".
+ * MAINTAINERS: Document that mn10200-elf target is buildable.
+
+2001-03-02 Kevin Buettner <kevinb@redhat.com>
+
+ * config/ia64/xm-aix.h (GDB_GREGSET_T, GDB_FPREGSET_T): Move defines
+ from here...
+ * config/ia64/nm-aix.h (GDB_GREGSET_T, GDB_FPREGSET_T): ...to here.
+ (MONTEREY): Don't define.
+ (AIX5): Define.
+
+2001-03-02 Matt Hiller <hiller@redhat.com>
+
+ * config/mn10300/tm-mn10300.h (E0_REGNUM): Correct to 15.
+
+2001-03-02 Kevin Buettner <kevinb@redhat.com>
+
+ * sparc-nat.c (sparc-nat.c): Don't include self.
+
+2001-03-01 J.T. Conklin <jtc@redback.com>
+
+ * defs.h (__CYGWIN__): Moved conditional which defines __CYGWIN__
+ if __CYGWIN32__ is set from here.
+ * config/i386/xm-cygwin.h: To here.
+ * config/powerpc/xm-cygwin.h: To here.
+
+ * i386-stub.c (handle_exception): Use 'T' response packet.
+
+2001-03-01 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * m32r-tdep.c: Fix cut and paste error in comment.
+
+2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * symtab.c (print_msymbol_info): Print addresses by portable method
+ longest_local_hex_string_custom. Allow for 64-bit addresses.
+
+2001-03-01 J.T. Conklin <jtc@redback.com>
+
+ * gdbtypes.h (builtin_type_f_integer): Removed duplicate declaration.
+ (MAX_OF_TYPE): Wrap macro definition in parenthesis.
+ (MIN_OF_TYPE): Likewise.
+
+ * memattr.h (mem_access_mode): Removed extraneous trailing comma.
+
+2001-03-01 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (os9kread.o): Do not compile with WERROR_CFLAGS.
+ * os9kread.c (os9k_process_one_symbol): Add assert to detect
+ ``loses if sizeof (char *) > sizeof (int)''.
+
+2001-03-01 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb_assert.h: Document pragmatics behind gdb_assert's case.
+
+2001-03-01 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdbtk-cmds.o): Add $(regcache_h) to dependency
+ lists.
+ (mi-main.o): Ditto.
+
+2001-03-01 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (regcache_h): Define. Add $(regcache_h) to
+ dependency lists.
+
+2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * printcmd.c (print_address_numeric): Update comments to refer
+ to sizeof addr, not sizeof pointer.
+ (x_command): Remove needless whitespace (shorten long line).
+
+ * breakpoint.c (print_one_breakpoint): Formatting clean-up.
+ (read_memory_nobpt): Ditto.
+ (ep_is_catchpoint): Ditto.
+ (ep_is_shlib_catchpoint): Ditto.
+ (ep_is_exception_catchpoint): Ditto.
+ (describe_other_breakpoints): Ditto.
+
+Wed Feb 28 20:37:36 2001 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h (register_valid): Fix comment documenting valid
+ states.
+
+Tue Feb 27 23:56:23 2001 Andrew Cagney <ac131313@redhat.com>
+
+ From Steven Johnson:
+ * regcache.h: New file.
+
+ * value.h (read_register_bytes, read_register_gen)
+ (write_register_gen, write_register_bytes)
+ (read_register, read_register_pid)
+ (read_signed_register, read_signed_register_pid)
+ (write_register, write_register_pid)
+ (register_cached, set_register_cached)
+ (register_changed, register_buffer)
+ (registers_changed, supply_register): Move declaration from here.
+ * regcache.h: To here.
+ * gdbcore.h (registers_fetched): Ditto.
+ * inferior.h (registers, registers_valid): Ditto.
+
+ * regcache.c (generic_target_read_pc, read_pc_pid, read_pc,
+ generic_target_write_pc, write_pc_pid, write_pc,
+ generic_target_read_sp, read_sp, generic_target_write_sp,
+ write_sp, generic_target_read_fp, read_fp,
+ generic_target_write_fp, write_fp): Add note that these functions
+ will be moved from this file.
+
+ * a29k-tdep.c: Include "regcache.h".
+ * a68v-nat.c: Ditto.
+ * abug-rom.c: Ditto.
+ * alpha-nat.c: Ditto.
+ * alpha-tdep.c: Ditto.
+ * alphabsd-nat.c: Ditto.
+ * arc-tdep.c: Ditto.
+ * arm-linux-nat.c: Ditto.
+ * arm-linux-tdep.c: Ditto.
+ * arm-tdep.c: Ditto.
+ * blockframe.c: Ditto.
+ * core-aout.c: Ditto.
+ * core-sol2.c: Ditto.
+ * corelow.c: Ditto.
+ * cpu32bug-rom.c: Ditto.
+ * cxux-nat.c: Ditto.
+ * d10v-tdep.c: Ditto.
+ * d30v-tdep.c: Ditto.
+ * dbug-rom.c: Ditto.
+ * dink32-rom.c: Ditto.
+ * dve3900-rom.c: Ditto.
+ * findvar.c: Ditto.
+ * fr30-tdep.c: Ditto.
+ * frame.c: Ditto.
+ * go32-nat.c: Ditto.
+ * h8300-tdep.c: Ditto.
+ * h8500-tdep.c: Ditto.
+ * hp300ux-nat.c: Ditto.
+ * hppa-tdep.c: Ditto.
+ * hppab-nat.c: Ditto.
+ * hppah-nat.c: Ditto.
+ * hppam3-nat.c: Ditto.
+ * hpux-thread.c: Ditto.
+ * i386-linux-nat.c: Ditto.
+ * i386-linux-tdep.c: Ditto.
+ * i386-tdep.c: Ditto.
+ * i386aix-nat.c: Ditto.
+ * i386b-nat.c: Ditto.
+ * i386bsd-nat.c: Ditto.
+ * i386gnu-nat.c: Ditto.
+ * i386ly-tdep.c: Ditto.
+ * i386m3-nat.c: Ditto.
+ * i386mach-nat.c: Ditto.
+ * i386nbsd-nat.c: Ditto.
+ * i386v4-nat.c: Ditto.
+ * i387-nat.c: Ditto.
+ * i387-tdep.c: Ditto.
+ * i960-tdep.c: Ditto.
+ * ia64-aix-nat.c: Ditto.
+ * ia64-linux-nat.c: Ditto.
+ * ia64-tdep.c: Ditto.
+ * infptrace.c: Ditto.
+ * infrun.c: Ditto.
+ * irix4-nat.c: Ditto.
+ * irix5-nat.c: Ditto.
+ * lin-lwp.c: Ditto.
+ * lin-thread.c: Ditto.
+ * lynx-nat.c: Ditto.
+ * m3-nat.c: Ditto.
+ * m32r-rom.c: Ditto.
+ * m32r-tdep.c: Ditto.
+ * m68hc11-tdep.c: Ditto.
+ * m68k-tdep.c: Ditto.
+ * m68klinux-nat.c: Ditto.
+ * m68knbsd-nat.c: Ditto.
+ * m68knbsd-tdep.c: Ditto.
+ * m88k-nat.c: Ditto.
+ * m88k-tdep.c: Ditto.
+ * mac-nat.c: Ditto.
+ * mcore-rom.c: Ditto.
+ * mcore-tdep.c: Ditto.
+ * mi/mi-main.c: Ditto.
+ * mips-nat.c: Ditto.
+ * mips-tdep.c: Ditto.
+ * mipsm3-nat.c: Ditto.
+ * mipsv4-nat.c: Ditto.
+ * mn10200-tdep.c: Ditto.
+ * mn10300-tdep.c: Ditto.
+ * monitor.c: Ditto.
+ * ns32km3-nat.c: Ditto.
+ * ns32knbsd-nat.c: Ditto.
+ * ocd.c: Ditto.
+ * pa64solib.c: Ditto.
+ * ppc-bdm.c: Ditto.
+ * ppc-linux-nat.c: Ditto.
+ * ppc-linux-tdep.c: Ditto.
+ * ppcbug-rom.c: Ditto.
+ * ppcnbsd-nat.c: Ditto.
+ * ptx4-nat.c: Ditto.
+ * regcache.c: Ditto.
+ * remote-adapt.c: Ditto.
+ * remote-array.c: Ditto.
+ * remote-bug.c: Ditto.
+ * remote-e7000.c: Ditto.
+ * remote-eb.c: Ditto.
+ * remote-es.c: Ditto.
+ * remote-est.c: Ditto.
+ * remote-hms.c: Ditto.
+ * remote-mips.c: Ditto.
+ * remote-mm.c: Ditto.
+ * remote-nindy.c: Ditto.
+ * remote-os9k.c: Ditto.
+ * remote-rdi.c: Ditto.
+ * remote-rdp.c: Ditto.
+ * remote-sds.c: Ditto.
+ * remote-sim.c: Ditto.
+ * remote-st.c: Ditto.
+ * remote-udi.c: Ditto.
+ * remote-utils.c: Ditto.
+ * remote-vx.c: Ditto.
+ * remote-vx29k.c: Ditto.
+ * remote-vx68.c: Ditto.
+ * remote-vx960.c: Ditto.
+ * remote-vxmips.c: Ditto.
+ * remote-vxsparc.c: Ditto.
+ * remote.c: Ditto.
+ * rom68k-rom.c: Ditto.
+ * rs6000-nat.c: Ditto.
+ * rs6000-tdep.c: Ditto.
+ * sh-tdep.c: Ditto.
+ * sh3-rom.c: Ditto.
+ * sol-thread.c: Ditto.
+ * solib-svr4.c: Ditto.
+ * somsolib.c: Ditto.
+ * sparc-nat.c: Ditto.
+ * sparc-tdep.c: Ditto.
+ * sparcl-tdep.c: Ditto.
+ * sparclet-rom.c: Ditto.
+ * sun3-nat.c: Ditto.
+ * sun386-nat.c: Ditto.
+ * symm-nat.c: Ditto.
+ * target.c: Ditto.
+ * thread-db.c: Ditto.
+ * thread.c: Ditto.
+ * tic80-tdep.c: Ditto.
+ * tracepoint.c: Ditto.
+ * ultra3-nat.c: Ditto.
+ * umax-xdep.c: Ditto.
+ * uw-thread.c: Ditto.
+ * v850-tdep.c: Ditto.
+ * v850ice.c: Ditto.
+ * valops.c: Ditto.
+ * w65-tdep.c: Ditto.
+ * w89k-rom.c: Ditto.
+ * win32-nat.c: Ditto.
+ * wince.c: Ditto.
+ * z8k-tdep.c: Ditto.
+
+2001-02-28 Matt Hiller <hiller@redhat.com>
+
+ * MAINTAINERS: Add Matt Hiller to Write After Approval list.
+
+2001-02-27 Matt Hiller <hiller@redhat.com>
+
+ * mn10300-tdep.c (mn10300_stab_reg_to_regnum): New function.
+ (mn10300_gdbarch_init): Set appropriate elements of gdbarch to
+ mn10300_stab_reg_to_regnum.
+
+Tue Feb 27 16:56:13 2001 David Taylor <taylor@redhat.com>
+
+ * symtab.c (search_symbols): Fix off by one error in test for
+ error.
+
+2001-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ * config/sparc/sp64linux.mt: New file.
+ * configure.tgt: Recognize sparc64-*-linux* as a sp64linux target.
+ * configure.host: Recognize sparc64-*-linux* as a linux host.
+
+ From 2000-03-17 Jakub Jelinek <jakub@redhat.com>:
+ * config/sparc/tm-sp64linux.h: New file.
+
+2001-02-24 Kevin Buettner <kevinb@redhat.com>
+
+ * buildsym.c (push_subfile, pop_subfile): Replace call to abort()
+ with call to internal_error().
+ * dbxread.c (process_one_symbol): Likewise.
+ * exec.c (build_section_table, xfer_memory): Likewise.
+ * h8500-tdep.c (h8500_register_size, h8500_register_virtual_type):
+ Likewise.
+ * hpread.c (hpread_type_translate, hpread_read_array_type)
+ (hpread_type_lookup): Likewise.
+ * i386-tdep.c (gdb_print_insn_i386): Likewise.
+ * i960-tdep.c (mem): Likewise
+ * inflow.c (set_sigio_trap, clear_sigio_trap): Likewise.
+ * infptrace.c (child_resume): Likewise.
+ * infttrace.c (_initialize_infttrace): Likewise.
+ * language.c (binop_result_type, add_language): Likewise.
+ * lynx-nat.c (store_inferior_registers): Likewise.
+ * m3-nat.c (port_chain_insert, m3_trace_me): Likewise.
+ * mdebugread.c (parse_partial_symbols): Likewise.
+ * monitor.c (monitor_printf_noecho, monitor_printf)
+ (monitor_dump_regs): Likewise.
+ * ocd.c (stu_put_packet): Likewise.
+ * printcmd.c (decode_format, print_scalar_formatted): Likewise.
+ * remote-bug.c (bug_open): Likewise.
+ * remote-e7000.c (fetch_regs_from_dump, e7000_wait): Likewise.
+ * remote-es.c (es1800_read_bytes): Likewise.
+ * remote-mips.c (common_breakpoint): Likewise.
+ * remote-rdp.c (send_rdp): Likewise.
+ * remote-sds.c (putmessage): Likewise.
+ * sparc-nat.c (fetch_inferior_registers, store_inferior_registers):
+ Likewise.
+ * sparcl-tdep.c (sparclite_download): Likewise.
+ * symtab.c (lookup_partial_symbol): Likewise.
+ * target.c (push_target, pop_target, initialize_targets): Likewise.
+ * utils.c (internal_verror, malloc_botch, wrap_here, decimal2str):
+ Likewise.
+ * valprint.c (print_decimal, print_longest, print_longest)
+ (strcat_longest): Likewise.
+ * w65-tdep.c (init_frame_pc, w65_push_dummy_frame): Likewise.
+ * xmodem.c (xmodem_send_packet): Likewise.
+ * z8k-tdep.c (init_frame_pc, z8k_push_dummy_frame): Likewise.
+ * config/h8500/tm-h8500.h (STORE_STRUCT_RETURN): Likewise.
+ * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE)
+ (STORE_RETURN_VALUE): Likewise.
+ * config/ns32k/nm-umax.h (REGISTER_U_ADDR): Likewise.
+ * config/ns32k/xm-merlin.h (REGISTER_U_ADDR): Likewise.
+ * config/z8k/tm-z8k.h (STORE_STRUCT_RETURN, STORE_RETURN_VALUE):
+ Likewise.
+
+2001-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ * CONTRIBUTE: Document how to cite a problem report.
+ * TODO: Note need to replace CONTRIBUTE with generated file.
+
+ * CONTRIBUTE: Mention that patches do not need to include the
+ generated files gdbarch.h and gdbarch.c.
+
+2001-02-21 Andrew Cagney <ac131313@redhat.com>
+
+ * value.h (get_saved_register): Move from here.
+ * frame.h: To here.
+
+2001-02-21 Kevin Buettner <kevinb@redhat.com>
+
+ * solib.h (in_svr4_dynsym_resolve_code): Delete declaration.
+ (in_solib_dynsym_resolve_code): Add declaration.
+ (IN_SOLIB_DYNSYM_RESOLVE_CODE): Changed define to invoke
+ in_solib_dynsym_resolve_code() rather than
+ in_svr4_dynsym_resolve_code(). Also, removed the ifdefs
+ which caused this macro to only be defined when
+ SVR4_SHARED_LIBS is defined.
+ * solib.c (in_solib_dynsym_resolve_code): New function.
+ * solist.h (struct target_so_ops): Add new member
+ in_dynsym_resolve_code.
+ * solib-aix5.c (aix5_in_dynsym_resolve_code): Renamed from
+ in_svr4_dynsym_resolve_code. Also, made static.
+ (_initialize_aix5_solib): Initialize in_dynsym_resolve_code
+ member in aix5_so_ops.
+ * solib-svr4.c (svr4_in_dynsym_resolve_code): Renamed from
+ in_svr4_dynsym_resolve_code. Also, added second version
+ of this function which will be used when SVR4_SHARED_LIBS
+ is not defined.
+ (_initialize_svr4_solib): Initialize in_dynsym_resolve_code
+ member in svr4_so_ops.
+
+ * ia64-aix-nat.c, ia64-aix-tdep.c, config/ia64/aix.mh,
+ config/ia64/aix.mt, config/ia64/nm-aix.h, config/ia64/tm-aix.h,
+ config/ia64/xm-aix.h: New files.
+ * ia64-tdep.c (_initialize_ia64_tdep): Remove declaration.
+ (ia64_aix_sigcontext_register_address): New declaration.
+ (ia64_gdbarch_init): Provide for initialization of
+ sigcontext_register_address member of struct tdep when
+ on target is detected to be running AIX.
+ * config/ia64/linux.mt (TDEPFILES): Add ia64-aix-tdep.o to
+ this list.
+
+2001-02-20 Kevin Buettner <kevinb@redhat.com>
+
+ * ia64-tdep.c (ia64_frameless_function_invocation): Implement.
+ * config/ia64/linux.mh (NATDEPFILES): Use thread-db.o and lin-lwp.o
+ for thread support instead of linux-thread.o and lin-thread.o.
+ * config/ia64/nm-linux.h (PREPARE_TO_PROCEED, GET_THREAD_SIGNALS,
+ ATTACH_LWP): Define to use the following lin-lwp.c functions...
+ (lin_lwp_prepare_to_proceed, lin_thread_get_thread_signals,
+ lin_lwp_attach_lwp): Declare.
+
+2001-02-20 Andrew Cagney <ac131313@redhat.com>
+
+ * mips-tdep.c (do_fp_register_row, do_fp_register_row): Fix printf
+ formatting.
+
+2001-02-20 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (solib-svr4.h): Remove include.
+ (solib_break_names): Delete names which aren't actually
+ used by AIX5.
+ (bkpt_names): Remove.
+ (aix5_relocate_main_executable, bfd_lookup_symbol): Replace calls
+ to STREQ() with equivalent calls to strcmp().
+ (in_svr4_dynsym_resolve_code, enable_break, bfd_lookup_symbol,
+ aix5_solib_create_inferior_hook): Revise comments.
+ (enable_break): Remove old ``bkpt_names'' code.
+
+2001-02-19 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (SFILES): Add frame.c .
+ (COMMON_OBS): Add frame.o .
+ (frame.o): New target.
+
+ * frame.c (find_saved_register):
+ (default_get_saved_register):
+ (get_saved_register):
+ (read_relative_register_raw_bytes_for_frame):
+ (read_relative_register_raw_bytes): Moved to here.
+ * regcache.c: From here.
+
+2001-02-20 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c: New file.
+
+2001-02-20 Martin M. Hunt <hunt@redhat.com>
+
+ * solib.c (info_sharedlibrary_command): Don't assume pointers
+ are the same size of long, call longest_local_hex_string_custom().
+
+ * solib-svr4.c (LM_ADDR): LM_ADDR is a signed offset, so
+ extract_signed_integer() should be called instead of
+ extract_address().
+
+2001-02-20 Martin M. Hunt <hunt@redhat.com>
+
+ * MAINTAINERS: Add Martin Hunt to Write After Approval list.
+
+2001-02-19 Andrew Cagney <ac131313@redhat.com>
+
+ Frm 2001-02-09 Jim Kingdon <jkingdon@engr.sgi.com>:
+ * mips-tdep.c (mips_register_raw_size): If FP_REGISTER_DOUBLE,
+ then floating point registers are 8 bytes.
+
+2001-02-19 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * parse.c (write_exp_msymbol): Make the type CORE_ADDR, to
+ accomodate 64-bit addresses.
+
+2001-02-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Peter Schauer <Peter.Schauer@regent.e-technik.tu-muenchen.de>
+ * symtab.c (lookup_symbol_aux): Call lookup_symbol_aux, not
+ lookup_symbol, when trying to find a symbol with a mangled name,
+ to avoid infinite recursion.
+
+2001-02-18 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (5.2): Mention G++ 3.0 ABI. General cleanups.
+
+2001-02-19 Jonathan Larmour <jlarmour@redhat.com>
+
+ * arm-tdep.c (check_prologue_cache): Fix off by 1 error.
+ (save_prologue_cache): Ditto.
+
+2001-02-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From: innadadadavida@yahoo.com:
+ * partial-stab.h (switch): Check that pst is not null
+ before dereferencing it.
+
+2001-02-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Andrew Cagney <cagney@b1.cygnus.com>:
+ * symfile.c (add_symbol_file_command): Always initialize
+ my_cleanup using a NULL cleanup.
+
+2001-02-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * demangle.c (demangling_style_names): New variable.
+ (_initialize_demangler): Fill demangling_style_names with the
+ names of known demangling styles from libiberty_demanglers[]. Use
+ add_set_enum_cmd instead of add_set_cmd, to get completion on
+ demangling style names.
+
+ * proc-api.c (_initialize_proc_api): Make `procfs-file' use
+ file-name completion.
+
+ * remote-rdi.c (_initialize_remote_rdi): Ditto for `rdilogfile'.
+
+ * solib.c (_initialize_solib): Ditto for `solib-search-path' and
+ `solib-absolute-prefix'.
+
+ * tracepoint.c (_initialize_tracepoint): Ditto for
+ `save-tracepoints'.
+
+ * win32-nat.c (_initialize_inftarg): Ditto for `dll-symbols'.
+
+ * cli/cli-cmds.c (init_cli_cmds): Make `shell' and `make' use
+ file-name completion.
+
+ * infcmd.c (_initialize_infcmd): Make the following commands use
+ the file-name completer: `tty', `args', `path', `paths', and
+ `run'.
+
+2001-02-18 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * go32-nat.c: Include i387-nat.h.
+ (fetch_register): New function, uses some of the guts of
+ go32_fetch_registers and calls i387_supply_register.
+ (go32_fetch_registers): Most of the code moved into
+ fetch_register. Use i387_supply_fsave.
+ (store_register): Use i387_fill_fsave instead of custom code.
+ (go32_store_registers): Use i387_fill_fsave.
+
+ * Makefile.in (go32-nat.o): Depend on i387-nat.h.
+
+ * config/i386/go32.mh (NATDEPFILES): Add i387-nat.o.
+
+ * completer.c (gdb_completer_file_name_break_characters): Remove
+ slash from file-name break characters.
+ [__MSDOS__]: Special definition for DOS/Windows file names.
+ (line_completion_function): When completing on file names, bump
+ `p' to the first file-name constituent character of `word', before
+ invoking the completer.
+
+2001-02-17 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-nat.c: Include "i387-nat.h". Use regnum instead of regno
+ consistently for parameter names. Fix comments accordingly.
+ (i387_supply_register): New function.
+ (i387_supply_fsave): Implement using i387_supply_register.
+ * i387-nat.h: Use regnum instead of regno consistently for
+ parameter names. Fix comments accordingly.
+ (i387_supply_register): New prototype.
+
+2001-02-16 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * remote.c (build_remote_gdbarch_data): Use new TARGET_ADDR_BIT
+ instead of TARGET_PTR_BIT (to support Harvard architectures).
+
+2001-02-16 Andrew Cagney <ac131313@redhat.com>
+
+ From 2001-02-11 Paul Hilfinger <hilfingr@lisbon.int.act-europe.fr>
+ * hpux-thread.c (hpux_thread_xfer_memory): Add mem_attrib
+ argument to parameter list and to call in order to conform to
+ to_xfer_memory field of struct target_ops.
+
+2001-02-12 Michael Chastain <chastain@redhat.com>
+
+ * somsolib.c (som_solib_add_solib_objfile): Do not use
+ section relocation feature of syms_from_objfile. Do my own
+ section relocation, offsetting each section of the som by
+ either text_addr - text_link_addr or data_start.
+
+2001-02-16 Andrew Cagney <ac131313@redhat.com>
+
+ * TODO (5.1): Move ``Hardware watchpint problems'' out of 5.1.
+
+2001-02-16 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (paper trail): Update.
+
+2001-02-16 Mark Kettenis <kettenis@gnu.org>
+
+ * target.h (target_fetch_registers): Fix comment.
+
+2001-02-15 Andrew Cagney <ac131313@redhat.com>
+
+ * f-exp.y: Include <ctype.h>.
+ (parse_number): Ensure that ``i'' is always initialized.
+
+2001-02-14 Jim Kingdon <jkingdon@engr.sgi.com>
+
+ * MAINTAINERS: Add myself to paper trail section.
+
+2001-02-14 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * configure.in (AC_CHECK_HEADERS): Add sys/file.h.
+ * configure, config.in: Regenerate.
+ * corelow.c: Include <sys/file.h> if present.
+
+2001-02-14 Andrew Cagney <ac131313@redhat.com>
+
+ * inflow.c (terminal_ours_1): Initialize ``osigtou''. Only
+ declare when have SIGTTOU.
+
+2001-02-14 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Add entries for gdb/gdbtk/*/ChangeLog-*.
+
+2001-02-12 Jim Kingdon <jkingdon@engr.sgi.com>
+
+ * MAINTAINERS: Update my email address.
+
+2001-02-11 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * NEWS: Document that "info symbol" works with COFF debug info and
+ its variants.
+
+ * minsyms.c (lookup_minimal_symbol_by_pc_section): Don't skip
+ symbols whose SYMBOL_BFD_SECTION is NULL.
+
+2001-02-10 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ Get rid of AIX specific PC_LOAD_SEGMENT, replace with PC_SOLIB.
+ * xcoffsolib.c (xcoff_solib_address): Renamed from
+ pc_load_segment_name. Return NULL if address is not in a shared
+ library. Cleanup shared library name construction, using xasprintf.
+ Format shared library member names consistent with format in exec.c.
+ (solib_info): Format shared library member names consistent with
+ format in exec.c.
+ * config/rs6000/nm-rs6000.h: Replace PC_LOAD_SEGMENT with PC_SOLIB,
+ using xcoff_solib_address for PC_SOLIB definition.
+ * stack.c (print_frame): Remove PC_LOAD_SEGMENT code, no longer
+ needed.
+
+2001-02-10 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * mipsread.c (read_alphacoff_dynamic_symtab): Replace alloca calls
+ with xmalloc calls and cleanups.
+
+2001-02-10 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * rs6000-nat.c (child_xfer_memory): Add missing parameter
+ 'struct mem_attrib *' required by 2001-01-23 change.
+
+2001-02-08 Jim Kingdon <jkingdon@engr.sgi.com>
+
+ Updates to "make TAGS":
+ * Makefile.in (ALLDEPFILES): Remove altos-xdep.c arm-convert.s
+ arm-xdep.c convex-tdep.c convex-xdep.c pyr-tdep.c pyr-xdep.c
+ tahoe-tdep.c.
+ (TAGFILES_NO_SRCDIR): Add $(SUBDIR_CLI_SRCS).
+
+2001-02-08 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Remove extraneous "too many dots".
+
+Wed Feb 7 22:39:26 2001 Andrew Cagney <cagney@redhat.com>
+
+ From Dean Luick <luick@cray.com>:
+ * defs.h (continuation): Remove unused global variable.
+
+Wed Feb 7 22:28:31 2001 Andrew Cagney <cagney@redhat.com>
+
+ * configure.tgt: Remove references to convex, pyramid, altos and
+ tahoe.
+ * configure.host: Ditto.
+ * MAINTAINERS: Ditto.
+ * NEWS: Update.
+
+ * tahoe-tdep.c: Delete obsolete file.
+ * pyr-xdep.c: Ditto.
+ * pyr-tdep.c: Ditto.
+ * convex-tdep.c: Ditto.
+ * convex-xdep.c: Ditto.
+ * config/tahoe/xm-tahoe.h: Ditto.
+ * config/tahoe/tm-tahoe.h: Ditto.
+ * config/tahoe/tahoe.mt: Ditto.
+ * config/tahoe/tahoe.mh: Ditto.
+ * config/pyr/xm-pyr.h: Ditto.
+ * config/pyr/tm-pyr.h: Ditto.
+ * config/pyr/pyramid.mt: Ditto.
+ * config/pyr/pyramid.mh: Ditto.
+ * config/m68k/xm-altos.h: Ditto.
+ * config/m68k/tm-altos.h: Ditto.
+ * config/m68k/altos.mt: Ditto.
+ * config/m68k/altos.mh: Ditto.
+ * config/convex/xm-convex.h: Ditto.
+ * config/convex/tm-convex.h: Ditto.
+ * config/convex/convex.mt: Ditto.
+ * config/convex/convex.mh: Ditto.
+ * config/convex/Convex.notes: Ditto.
+ * config/arm/xm-arm.h: Ditto.
+ * config/arm/nm-arm.h: Ditto.
+ * config/arm/arm.mt: Ditto.
+ * config/arm/arm.mh: Ditto.
+ * arm-convert.s: Ditto.
+ * arm-xdep.c: Ditto.
+ * altos-xdep.c: Ditto.
+
+Wed Feb 7 19:41:21 2001 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (internal_error, internal_verror): Add __FILE__ and
+ __LINE__ parameter.
+ * utils.c (internal_error, internal_verror): Update.
+
+ * v850-tdep.c: Update calls to internal_error.
+ * utils.c: Ditto.
+ * ui-out.c: Ditto.
+ * ui-file.c: Ditto.
+ * target.h: Ditto.
+ * symtab.h: Ditto.
+ * symm-nat.c: Ditto.
+ * sparc-tdep.c: Ditto.
+ * source.c: Ditto.
+ * serial.c: Ditto.
+ * rs6000-tdep.c: Ditto.
+ * rs6000-nat.c: Ditto.
+ * remote.c: Ditto.
+ * remote-vx.c: Ditto.
+ * remote-sim.c: Ditto.
+ * remote-mips.c: Ditto.
+ * regcache.c: Ditto.
+ * objfiles.h: Ditto.
+ * objfiles.c: Ditto.
+ * mn10300-tdep.c: Ditto.
+ * mips-tdep.c: Ditto.
+ * maint.c: Ditto.
+ * m68k-tdep.c: Ditto.
+ * m3-nat.c: Ditto.
+ * language.c: Ditto.
+ * infptrace.c: Ditto.
+ * inferior.h: Ditto.
+ * infcmd.c: Ditto.
+ * ia64-tdep.c: Ditto.
+ * i386-tdep.c: Ditto.
+ * i386-linux-nat.c: Ditto.
+ * hppah-nat.c: Ditto.
+ * go32-nat.c: Ditto.
+ * findvar.c: Ditto.
+ * f-lang.c: Ditto.
+ * elfread.c: Ditto.
+ * event-loop.c: Ditto.
+ * dwarf2read.c: Ditto.
+ * dsrec.c: Ditto.
+ * d30v-tdep.c: Ditto.
+ * d10v-tdep.c: Ditto.
+ * cli/cli-setshow.c: Ditto.
+ * cli/cli-script.c: Ditto.
+ * ch-exp.c: Ditto.
+ * breakpoint.c: Ditto.
+ * ax-gdb.c: Ditto.
+ * arch-utils.c: Ditto.
+ * a29k-tdep.c: Ditto.
+ * gdb_assert.h: Ditto.
+ * gdbarch.sh: Ditto.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2001-02-07 Andrew Cagney <ac131313@redhat.com>
+
+ From Mark Kettenis <kettenis@gnu.org>:
+ * event-top.h [!STOP_SIGNAL]: #include <signal.h>.
+
+2001-02-07 Andrew Cagney <ac131313@redhat.com>
+
+ * remote-sim.c (dump_mem): Cleanup printf format argument.
+ * MAINTAINERS: Update, mn10300-elf now builds.
+
+2001-02-07 Mark Kettenis <kettenis@gnu.org>
+
+ * event-top.c: Remove duplicate #include <signal.h>.
+
+2001-02-06 Andrew Cagney <ac131313@redhat.com>
+
+ * sol-thread.c (restore_inferior_pid): Save the PID in a freshly
+ allocated buffer.
+ (save_inferior_pid): Restore the PID from that tempoary
+ buffer. Delete the buffer.
+ * utils.c (make_cleanup_close, do_close_cleanup): Ditto for FD.
+
+2001-02-06 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add ``The Obvious Fix Rule''.
+
+2001-02-06 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Michael Snyder to Solaris/SPARC list.
+
+2001-02-06 Andrew Cagney <ac131313@cygnus.com>
+
+ * gdbarch.sh: Include "gdb_assert.h".
+ (struct gdbarch): Change ``nr_data'' to unsigned.
+ (alloc_gdbarch_data, free_gdbarch_data): New functions.
+ (gdbarch_free): Free the data-pointer vector. Use xfree to delete
+ architecture vector.
+ (struct gdbarch_data, struct gdbarch_data_registration): Move init
+ method to gdbarch_data. Add free method, make index unsigned.
+ (struct gdbarch_data_registry): Make nr unsigned.
+ (register_gdbarch_data): Add free parameter. Store in
+ gdbarch_data.
+ (init_gdbarch_data): Use set_gdbarch_data.
+ (set_gdbarch_data): New function.
+
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2001-02-06 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * ser-unix.c (hardware_print_tty_state) [HAVE_SGTTY]: Call
+ fprintf_filtered with correct arguments.
+
+2001-02-06 Michael Snyder <msnyder@makita.cygnus.com>
+ Submitted by Paul Hilfinger (hilfingr@gnat.com)
+ and Andrei Petrov (and@genesyslab.com).
+ * findvar.c: Buffers of size MAX_REGISTER_RAW_SIZE or REGISTER_BYTES
+ must be allocated dynamically, since these are no longer constants.
+ * infcmd.c: Ditto.
+ * regcache.c: Ditto.
+ * remote.c: Ditto.
+ * sol-thread.c: Ditto.
+ * valops.c: Ditto.
+ * config/sparc/sun4sol2.mh (MH_CFLAGS): Add -I/usr/include/v9, as a
+ work-around for a missing Sun header file in solaris for sparc64.
+
+2001-02-04 Philip Blundell <philb@gnu.org>
+
+ * config/arm/linux.mh (NATDEPFILES): Add proc-service.o,
+ thread-db.o, lin-lwp.o; remove lin-thread.o, linux-thread.o.
+ * config/arm/nm-linux.h (PREPARE_TO_PROCEED, ATTACH_LWP,
+ GET_THREAD_SIGNALS): Define.
+ * arm-linux-nat.c (fill_gregset): Correct type of argument.
+ (supply_gregset): Likewise.
+ (fill_fpregset): Likewise.
+ (supply_fpregset): Likewise.
+
+Tue Feb 6 11:58:57 2001 David Taylor <taylor@redhat.com>
+
+ * valops.c (value_cast): If casting a scalar to a pointer, do not
+ issue a message about truncation unless it exceeds the length of
+ an address, not the length of a pointer. This is because what the
+ user gives us is an address, not a pointer, and we will ultimately
+ convert it (via ADDRESS_TO_POINTER) to a pointer, not truncate it
+ to a pointer. This allows things like "print *(int *)0x01000234"
+ to work without generating a misleading message on a target having
+ two byte pointers and four byte addresses.
+
+2001-02-05 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c: Change PTR to void * throughout.
+
+2001-02-05 J.T. Conklin <jtc@redback.com>
+
+ * signals.h: Removed.
+ * event-top.c (#include <signal.h>): Changed from signals.h.
+ * inflow.c: Likewise.
+ * mac-xdep.c: Likewise.
+ * ser-pipe.c: Likewise.
+ * ser-tcp.c: Likewise.
+ * standalone.c: Likewise.
+ * top.c: Likewise.
+ * utils.c: Likewise.
+ * Makefile.in: Removed signals.h from dependencies.
+
+2001-02-05 Christopher Faylor <cgf@cygnus.com>
+
+ Change suggested by Dean Luick <luick@cray.com>
+ * inferior.h (step_over_calls_kind): Remove trailing comma from
+ last enum element.
+ (step_over_calls): Declare as extern rather than global.
+
+2001-02-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * sh-tdep.c: Update copyright.
+ (sh_extract_return_value): Rewrite.
+ (sh3e_sh4_extract_return_value): New function.
+ (sh_gdbarch_init): Initialize gdbarch_extract-return_value to new
+ version of the function for sh3e and sh4 CPUs.
+
+2001-02-05 Michael Chastain <chastain@redhat.com>
+
+ * hppah-nat.c (child_xfer_memory): Add parameter 'struct mem_attrib *'
+ to conform with interface change.
+
+2001-02-04 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/fnchange.lst: Tweak to make consistent with the
+ new files.
+
+ * config/djgpp/djconfig.sh: Use explicit absolute file name when
+ invoking `find'.
+
+ * ser-go32.c (dos_write) [UART_FIFO_WORKS]: Use outportsb only if
+ UART_FIFO_WORKS is defined. Otherwise use outportb.
+ From Francisco Pastor <fpastor.etra-id@etra.es>
+
+ * go32-nat.c (go32_xfer_memory): Make the argument list consistent
+ with target.h's `to_xfer_memory' member.
+
+2001-02-02 J.T. Conklin <jtc@redback.com>
+
+ * ppc-bdm.c (#include <signal.h>): Removed.
+ * remote-array.c: Likewise.
+ * remote-bug.c: Likewise.
+ * remote-e7000.c: Likewise.
+ * remote-mips.c: Likewise.
+ * remote-os9k.c: Likewise.
+ * remote-st.c: Likewise.
+ * remote-udi.c: Likewise.
+ * remote-vx29k.c: Likewise.
+ * remote-vx68.c: Likewise.
+ * remote-vx960.c: Likewise.
+ * remote-vxmips.c: Likewise.
+ * remote-vxsparc.c: Likewise.
+
+2001-02-02 John Moore <jmoore@redhat.com>
+
+ * remote-utils.h (sr_set_device): Changed free() to xfree() where
+ appropriate. Also changed Copyright to include 2001.
+ * symtab.h (obstack_chunk_free, SYMBOL_INIT_DEMANGLED_NAME): Likewise.
+ * value.h (value_free): Likewise.
+ * gdbarch.sh (gdbarch_free): Likewise.
+ * gdbarch.c, gdbarch.h: Regenerated.
+
+2001-02-02 John Moore <jmoore@redhat.com>
+
+ * cli/cli-cmds.c (apropos_command): Changed occurance of free() to
+ xfree(). Also changed Copyright to include 2001.
+
+2001-02-02 J.T. Conklin <jtc@redback.com>
+
+ * monitor.c (#include "gdb_wait.h"): Removed.
+ * ocd.c: Likewise.
+ * ppc-bdm.c: Likewise.
+ * remote-adapt.c: Likewise.
+ * remote-array.c: Likewise.
+ * remote-bug.c: Likewise.
+ * remote-e7000.c: Likewise.
+ * remote-eb.c: Likewise.
+ * remote-es.c: Likewise.
+ * remote-mips.c: Likewise.
+ * remote-mm.c: Likewise.
+ * remote-nindy.c: Likewise.
+ * remote-os9k.c: Likewise.
+ * remote-rdi.c: Likewise.
+ * remote-rdp.c: Likewise.
+ * remote-sds.c: Likewise.
+ * remote-sim.c: Likewise.
+ * remote-st.c: Likewise.
+ * remote-udi.c: Likewise.
+ * remote-vx.c: Likewise.
+ * remote-vx29k.c: Likewise.
+ * remote-vx68.c: Likewise.
+ * remote-vx960.c: Likewise.
+ * remote-vxmips.c: Likewise.
+ * remote-vxsparc.c: Likewise.
+ * remote.c: Likewise.
+ * ser-pipe.c: Likewise.
+ * ser-unix.c: Likewise.
+ * Makefile.in: Updated dependencies.
+
+2001-01-31 David Smith <dsmith@redhat.com>
+
+ * event-loop.c: Change inclusion of string.h to gdb_string.h and
+ updated the copyright notice.
+ * ser-pipe.c: Ditto.
+ * mi/mi-cmds.c: Ditto.
+ * mi/mi-console.c: Ditto.
+ * mi/mi-getopt.c: Ditto.
+ * mi/mi-parse.c: Ditto.
+
+2001-01-31 David Smith <dsmith@redhat.com>
+
+ * MAINTAINERS: Add David Smith to Write After Approval list.
+
+Tue Jan 30 15:43:08 2001 Andrew Cagney <cagney@cygnus.com>
+
+ * cli/cli-utils.c (putchar_filtered): Move function from here.
+ * utils.c (putchar_filtered): To here.
+ * cli/cli-utils.h (putchar_filtered): Move declaration from here.
+ * defs.h (putchar_filtered): To here.
+
+Tue Jan 30 17:27:11 2001 Andrew Cagney <cagney@redhat.com>
+
+ * configure.in (AC_CHECK_FUNCS): Replace vfork test with
+ AC_FUNC_VFORK macro.
+ * config.in, configure: Re-generate.
+
+ * gdb_vfork.h: New file.
+ * ser-pipe.c (pipe_open): Update. Include "gdb_vfork.h".
+ * fork-child.c (fork_inferior): Ditto.
+
+Tue Jan 30 17:09:07 2001 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (strsave): Delete declaration.
+ * utils.c (strsave): Delete definition.
+ * TODO (strsave): Update
+
+ * mac-xdep.c (tilde_expand): Replace strsave with xstrdup.
+ * sparcl-tdep.c (sparclite_open): Ditto.
+ * mips-tdep.c (mips_set_processor_type_command): Ditto.
+ (_initialize_mips_tdep): Ditto.
+ * solib.c (solib_open): Ditto.
+ * symfile.c (add_filename_language): Ditto.
+ (set_ext_lang_command): Ditto.
+ * source.c (init_source_path): Ditto.
+ (mod_path): Ditto.
+ * sh3-rom.c (sh3_open): Ditto.
+ (sh3e_open): Ditto.
+ * serial.c (serial_open): Ditto.
+ * remote-mips.c (common_open): Ditto.
+ * monitor.c (monitor_open): Ditto.
+ * m32r-rom.c (m32r_upload_command): Ditto.
+ * infcmd.c (path_command): Ditto.
+ * f-exp.y (parse_number): Ditto.
+ * breakpoint.c (create_longjmp_breakpoint): Ditto.
+ (create_thread_event_breakpoint): Ditto.
+ * arc-tdep.c (arc_set_cpu_type_command): Ditto.
+ (_initialize_arc_tdep): Ditto.
+
+Tue Jan 30 15:14:26 2001 Andrew Cagney <cagney@skil>
+
+ * cli/cli-script.c (define_command): Check for a bad hook value in
+ switch statement.
+
+2001-01-30 J.T. Conklin <jtc@redback.com>
+
+ * configure/sh/embed.mt: New file.
+ * configure/sh/linux.mt: New file.
+ * configure/sh/sh.mt: Removed.
+ * configure.tgt (sh-*-hms,sh-*-coff*,sh-*-elf*,sh-*-linux): New targets.
+ (sh-*-*): Removed.
+
+2001-01-29 Michael Chastain <chastain@redhat.com>
+
+ * symtab.c (lookup_block_symbol): Use 'namespace' parameter in
+ symbol comparisons in binary search.
+
+2001-01-27 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (child_xfer_memory): Add missing argument required by
+ 2001-01-23 change.
+
+2001-01-27 Mark Kettenis <kettenis@gnu.org>
+
+ * ui-out.c (do_list_end): New function.
+ (make_cleanup_ui_out_list_end): New function.
+ * ui-out.h: Provide prototype for make_cleanup_ui_out_list_end.
+ * stack.c (print_frame) [UI_OUT]: Call
+ make_cleanup_ui_out_list_end to make sure we mark the end of the
+ list if we do a non-local exit. At the end of the function,
+ instead of calling ui_out_list_end directly, let do_cleanups
+ handle it.
+
+2001-01-26 Fernando Nasser <fnasser@redhat.com>
+
+ Fix double parsing of filenames passed as command line arguments
+ to GDB (causes weird handling of escape characters).
+ Also, remove dependencies on the CLI from libgdb.
+ * call-cmds.h: Remove declaration of exec_file_command().
+ * gdbcore.h: Remove declaration of exec_file_command().
+ Add declarations for exec_open() and exec_file_clear().
+ * symfile.h: Add declarations for symbol_file_add_main() and
+ symbol_file_clear().
+ * exec.c (exec_open): New function. Implements to_open for exec
+ targets.
+ (exec_file_clear): New function. Makes GDB forget about a previously
+ specified executable file.
+ (exec_file_attach): Move parsing of arguments from here ...
+ (exec_file_command): ... to here.
+ (init_exec_ops): Use exec_open(), not exec_file_command() to
+ implement to_open for exec targets.
+ * symfile.c (symbol_file_add_main): New function. Call symbol_file_add()
+ with default values. Used when the file name has already been parsed.
+ (symbol_file_clear): New function. Makes GDB forget about previously
+ read symbols.
+ (symbol_file_command): Call the above function instead of inline code.
+ * main.c: Include "symfile.h" and "gdbcore.h" instead of the deprecated
+ "call-cmds.h".
+ (captured_main): Call exec_file_attach() and symbol_file_add_main()
+ instead of exec_file_command() and symbol_file_command().
+ (captured_main): Add comment.
+ * corefile.c: Include "symfile.h".
+ (core_file_command): Call symbol_file_add_main() instead of
+ symbol_file_command().
+ (reopen_exec_file): Call exec_open() instead of exec_file_command().
+ * infcmd.c: Include "symfile.h".
+ (attach_command): Call symbol_file_add_main() instead of
+ symbol_file_command().
+ * infrun.c: Remove comment about the inclusion of "symfile.h",
+ not any longer appropriate.
+ (follow_exec): Call symbol_file_add_main() instead of
+ symbol_file_command().
+ * remote-es.c: Include "symfile.h".
+ (es1800_load): Call symbol_file_add_main() instead of
+ symbol_file_command().
+ * remote-vx.c: Remove comment about the inclusion of "symfile.h",
+ not any longer appropriate.
+ (vx-wait): Call symbol_file_add_main() instead of
+ symbol_file_command().
+ * solib-svr4.c (open_symbol_file_object): Call symbol_file_add_main()
+ instead of symbol_file_command().
+ * v850ice.c (ice_file): Call exec_open(), exec_file_attach() and
+ symbol_file_add_main() instead of exec_file_command() and
+ symbol_file_command().
+ * Makefile.in: Update dependencies.
+
+2001-01-26 Jeff Holcomb <jeffh@redhat.com>
+
+ * remote-udi.c (udi_open): Change strdup to xstrdup.
+ * thread.c (thread_apply_all_command): Change strdup to xstrdup.
+ Update copyright message.
+ * varobj.c (delete_variable_1): Likewise.
+
+ * gdb_string.h: Remove declaration of strdup. Update copyright
+ message.
+ * config/xm-mpw.h: Likewise.
+ * config/i386/xm-i386mach.h: Likewise.
+ * config/m68k/xm-apollo68b.h: Likewise.
+ * config/m68k/xm-hp300bsd.h: Likewise.
+ * config/rs6000/xm-rs6000.h: Likewise.
+ * config/vax/xm-vaxult.h: Remove declaration of strdup.
+ * config/vax/xm-vaxult2.h: Likewise.
+
+2001-01-26 Jeff Holcomb <jeffh@redhat.com>
+
+ * MAINTAINERS: Add Jeff Holcomb to Write After Approval list.
+
+2001-01-25 J.T. Conklin <jtc@redback.com>
+
+ * target.c (target_xfer_memory_partial): Return -1 on failure due
+ to invalid access mode attribute.
+
+2001-01-25 Christopher Faylor <cgf@cygnus.com>
+
+ * win32-nat.c (_initialize_core_win32): Prototype correctly.
+
+2001-01-25 Mark Kettenis <kettenis@gnu.org>
+
+ * config/alpha/tm-fbsd.h: Update copyright.
+ (USE_STRUCT_CONVENTION): Define in terms of
+ alphabsd_use_struct_convention.
+ * config/alpha/fbsd.mt (TDEPFILES): Add alphafbsd-tdep.c.
+ * alphafbsd-tdep.c: New file.
+
+2001-01-24 Fernando Nasser <fnasser@redhat.com>
+
+ * top.c (print_gdb_version): Update Copyright year.
+
+2001-01-24 J.T. Conklin <jtc@redback.com>
+
+ * dcache.c (dcache_write_line): Fix typo.
+
+ * memattr.c (delete_mem_region): Replace free() with xfree().
+ (mem_number): Add explicit type.
+
+ * sol-thread.c (sol_thread_xfer_memory): Add attrib argument.
+ (rw_common): Likewise.
+
+2001-01-24 Fernando Nasser <fnasser@redhat.com>
+
+ * infcmd.c (get_inferior_args, set_inferior_args): Accessor functions
+ for the inferior program arguments.
+ (run_command, run_no_args_command, init_infcmd)): Use accessor
+ functions to set the inferior program arguments.
+ * inferior.h: Add definitions to the accessor functions above.
+
+2001-01-23 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
+ Implement these correctly, using make_cv_type.
+
+2001-01-23 J.T. Conklin <jtc@redback.com>
+
+ * exec.c (xfer_memory): Add attrib argument.
+ * infptrace.c (child_xfer_memory): Likewise.
+ * lin-lwp.c (lin_lwp_xfer_memory): Likewise.
+ * monitor.c (monitor_xfer_memory): Likewise.
+ * remote-adapt.c (adapt_xfer_inferior_memory): Likewise.
+ * remote-array.c (array_xfer_memory): Likewise.
+ * remote-bug.c (bug_xfer_memory): Likewise.
+ * remote-e7000.c (e7000_xfer_inferior_memory): Likewise.
+ * remote-eb.c (eb_xfer_inferior_memory): Likewise.
+ * remote-es.c (es1800_xfer_inferior_memory): Likewise.
+ * remote-mips.c (mips_xfer_memory): Likewise.
+ * remote-mm.c (mm_xfer_inferior_memory): Likewise.
+ * remote-nindy.c (nindy_xfer_inferior_memory): Likewise.
+ * remote-os9k.c (rombug_xfer_inferior_memory): Likewise.
+ * remote-rdi.c (arm_rdi_xfer_memory): Likewise.
+ * remote-rdp.c (remote_rdp_xfer_inferior_memory): Likewise.
+ * remote-sds.c (sds_xfer_memory): Likewise.
+ * remote-sim.c (gdbsim_xfer_inferior_memory): Likewise.
+ * remote-st.c (st2000_xfer_inferior_memory): Likewise.
+ * remote-udi.c (udi_xfer_inferior_memory): Likewise.
+ * remote-vx.c (vx_xfer_memory): Likewise.
+ * remote.c (remote_xfer_memory): Likewise.
+ * target.c (debug_to_xfer_memory, do_xfer_memory): Likewise.
+ * target.h (child_xfer_memory, do_xfer_memory, xfer_memory): Likewise.
+ * thread-db.c (thread_db_xfer_memory): Likewise.
+
+ * target.h (#include "memattr.h"): Added.
+ (target_ops.to_xfer_memory): Add attrib argument.
+
+ * wince.c (_initialize_inftarg): Removed call to set_dcache_state.
+ * dcache.h (set_dcache_state): Removed declaration.
+ * dcache.c (set_dcache_state): Removed definition
+
+ * dcache.c: Update module comment, as dcache is now enabled and
+ disabled with memory region attributes instead of by the global
+ variable "remotecache". Add comment describing the interaction
+ between dcache and memory region attributes.
+ (dcache_xfer_memory): Add comment describing benefits of moving
+ cache writeback to a higher level.
+ (dcache_struct): Removed cache_has_stuff field. This was used to
+ record whether the cache had been accessed in order to invalidate
+ it when it was disabled. However, this is not needed because the
+ cache is write through and the code that enables, disables, and
+ deletes memory regions invalidate the cache. Add comment which
+ suggests that we could be more selective and only invalidate those
+ cache lines containing data from those memory regions.
+ (dcache_invalidate): Updated.
+ (dcache_xfer_memory): Updated.
+
+ (dcache_alloc): Don't abort() if dcache_enabled_p is clear.
+ (dcache_xfer_memory): Removed code that called do_xfer_memory() to
+ perform a uncached transfer if dcache_enabled_p was clear. This
+ function is now only called if caching is enabled for the memory
+ region.
+ (dcache_info): Always print cache info.
+
+ * target.c (do_xfer_memory): Add attrib argument.
+ (target_xfer_memory, target_xfer_memory_partial): Break transfer
+ into chunks defined by memory regions, pass region attributes to
+ do_xfer_memory().
+ * dcache.c (dcache_read_line, dcache_write_line): Likewise.
+
+ * Makefile.in (SFILES): Add memattr.c.
+ (COMMON_OBS): Add memattr.o.
+ (dcache.o): Add target.h to dependencies.
+ * memattr.c: New file.
+ * memattr.h: Likewise.
+
+ * config/m32r/m32r.mt (GDBSERVER_LIBS): Added ../../intl/libintl.a.
+ * config/mips/vr5000.mt (GDBSERVER_LIBS): Likewise.
+ * config/tic80/tic80.mt (GDBSERVER_LIBS): Likewise.
+ * gdbserver/low-sim.c (#include "defs.h"): Removed.
+ (mygeneric_load): Rename from generic_load.
+
+ * gdbserver/low-hppabsd.c (#include "server.h"): Added.
+ (#include "defs.h"): Removed.
+ (inferior_pid, perror_with_name): Remove declarations.
+ * gdbserver/low-linux.c: Likewise.
+ * gdbserver/low-nbsd.c: Likewise.
+ * gdbserver/low-sparc.c: Likewise.
+ * gdbserver/low-sun3.c: Likewise.
+
+ * i386-stub.c: Re-indent.
+ * m68k-stub.c: Re-indent.
+
+2001-01-22 Nicholas Duffek <nsd@redhat.com>
+
+ * gdbarch.sh (PARM_BOUNDARY): Define.
+ * gdbarch.c: Regenerate.
+ * gdbarch.h: Regenerate.
+
+2001-01-22 J.T. Conklin <jtc@redback.com>
+
+ * ns32k-tdep.c: #include "frame.h"
+ * config/ns32k/tm-umax.h (FRAME_FIND_SAVED_REGS): Restore. It
+ appears to have been inadvertantly removed sometime in May 1999.
+
+ * Revert 2000-11-09 changes where shared library objects were
+ moved from NATDEPFILES to TDEPFILES on NetBSD targets. While
+ we'd like to be able to debug dynamically linked executables,
+ this makes it impossible to build a cross debugger on a many
+ hosts.
+
+ * config/i386/nbsd.mt: Remove solib.o, solib-svr4.o from TDEPFILES.
+ * config/i386/nbsdelf.mt: Likewise.
+ * config/m68k/nbsd.mt: Likewise.
+ * config/ns32k/nbsd.mt: Likewise.
+ * config/powerpc/nbsd.mt: Likewise.
+ * config/sparc/nbsd.mt: Likewise.
+ * config/sparc/nbsdelf.mt: Likewise.
+ * config/i386/nbsd.mh: Add solib.o, solib-svr4.o to NATDEPFILES.
+ * config/i386/nbsdelf.mh: Likewise.
+ * config/m68k/nbsd.mh: Likewise.
+ * config/ns32k/nbsd.mh: Likewise.
+ * config/powerpc/nbsd.mh: Likewise.
+ * config/sparc/nbsd.mh: Likewise.
+
+2001-01-19 Jason Merrill <jason@redhat.com>
+
+ * dbxread.c (read_ofile_symtab): Stay with AUTO_DEMANGLING for G++.
+ (process_one_symbol): Likewise.
+ * dwarfread.c (handle_producer): Likewise.
+
+Thu Jan 18 12:08:57 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (build_warnings): Disable -Wuninitialized until GDB
+ compiles with -Wuninitialized,-Werror.
+ * configure: Regenerate.
+
+ * MAINTAINERS: Add list of buildable targets.
+
+Thu Jan 18 12:48:04 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (STRCMP): Delete macro.
+
+ * objfiles.c (objfile_relocate): Replace STRCMP with call to
+ strcmp.
+ * symtab.c (lookup_partial_symbol, lookup_block_symbol): Ditto.
+ * symfile.c (compare_symbols): Ditto.
+ * standalone.c (open): Ditto.
+ * remote-es.c (verify_break): Ditto.
+ * cli/cli-decode.c (add_cmd, add_show_from_set): Ditto.
+
+ * symfile.c (compare_psymbols): Delete comment refering to STRCMP.
+
+Thu Jan 18 12:25:06 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * varobj.c (FREEIF): Delete macro.
+ (varobj_set_value, free_variable): Replace FREEIF with ``xfree''
+ call.
+
+2001-01-18 Nick Clifton <nickc@redhat.com>
+
+ * arc-tdep.c (arc_cpu_type_table): Add new arc core numbers.
+ (arc_print_insn): No bfd available, so pass NULL to
+ arc_get_disassembler.
+
+2001-01-09 James Ingham <jingham@inghji.apple.com>
+
+ * symtab.c (lookup_symbol_aux): Call lookup_symbol_aux to lookup
+ a mangled symbol rather than recursing into lookup_symbol, since
+ this will just re-unmangle the name & call lookup_symbol_aux -
+ leading to an infinite recursion.
+
+2001-01-18 Mark Kettenis <kettenis@gnu.org>
+
+ * infcmd.c (print_return_value): Restore another space lost by
+ switch to UIOUT. ``$NN='' should be ``$NN =''.
+
+Fri Jan 19 02:31:40 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * target.h (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
+ * breakpoint.c (TARGET_REGION_OK_FOR_HW_WATCHPOINT): Wrap macro
+ definition in parenthesis.
+
+Fri Jan 19 02:13:40 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-10-27 Mark Salter <msalter@redhat.com>:
+ * remote.c (remote_remove_hw_breakpoint): Add 'len' field to Z
+ packet.
+ (remote_insert_hw_breakpoint): Ditto.
+
+2001-01-17 J.T. Conklin <jtc@redback.com>
+
+ * config/m68k/tm-nbsd.h (USE_STRUCT_CONVENTION): Define.
+ (BPT_VECTOR, REMOTE_BPT_VECTOR): Change to 0xf.
+ * config/m68k/nbsd.mt (TDEPFILES): Add m68knbsd-tdep.o.
+ * m68knbsd-tdep.c: New file.
+
+ * i386nbsd-tdep.c: Remove #if 0'd out #includes.
+
+ * m68knbsd-nat.c: #include gdbcore.h.
+
+Wed Jan 17 09:41:58 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * MAINTAINERS: Add J.T. Conklin to Blanket Write Privs.
+
+2001-01-16 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * procfs.c (procfs_stopped_by_watchpoint): Don't die if process
+ goes away -- just return false (ie. not stopped by watchpoint).
+ * source.c (openp): Fix typo in comment.
+
+2001-01-12 Nicholas Duffek <nsd@redhat.com>
+
+ * blockframe.c (generic_get_saved_register): Spelling fix.
+ * frame.h (FRAME_FP): Spelling fix.
+
+Fri Jan 12 18:29:46 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * infcmd.c (print_return_value): Restore space lost by switch to
+ UIOUT. ``$NN='' should be ``$NN =''.
+
+2001-01-08 Nicholas Duffek <nsd@redhat.com>
+
+ * regcache.c (set_register_cached, register_buffer,
+ real_register, pseudo_register fetch_register, store_register):
+ New functions.
+ (register_changed, read_relative_register_raw_bytes_for_frame,
+ registers_changed, registers_fetched, read_register_bytes,
+ read_register_gen, write_register_gen, read_register,
+ read_signed_register, write_register, supply_register): Replace
+ register_valid[] with register_cached() and
+ set_register_cached().
+ (read_register_bytes, read_register_gen, write_register_gen,
+ read_register, read_signed_register, write_register,
+ supply_register): Replace registers[] with register_buffer().
+ (read_register_bytes, read_register_gen, read_register,
+ read_signed_register): Call fetch_register().
+ (write_register_gen, write_register): Call real_register() and
+ store_register().
+ (write_register_bytes): Call store_register().
+ * value.h (set_register_cached, register_buffer): Prototype.
+ * remote.c (remote_fetch_registers): Allocate regs[] with a
+ run-time size. Replace register_valid[] with
+ set_register_cached().
+ (store_register_using_P, remote_store_registers): Replace
+ registers[] with register_buffer().
+
+2001-01-08 Nicholas Duffek <nsd@redhat.com>
+
+ * regcache.c: Change "write-back" comment to "write-through".
+ Change "regno" to "regnum".
+ (read_register, read_signed_register): Remove "raw" from return
+ value description.
+ (supply_register): Spelling fix.
+ * value.h: Change "regno" to "regnum".
+
+2001-01-08 Fernando Nasser <fnasser@redhat.com>
+
+ * Makefile.in (install-gdbtk): Add .itcl files to the list of files
+ to be installed.
+
+2001-01-04 Michael Snyder <msnyder@mvstp600e.cygnus.com>
+
+ * mips-tdep.c (mips_coerce_float_to_double): Fix typo in comment.
+
+2001-01-04 Nicholas Duffek <nsd@redhat.com>
+
+ * valops.c (VALUE_SUBSTRING_START): Delete.
+
+2001-01-04 Nicholas Duffek <nsd@redhat.com>
+
+ * Makefile.in (SUBDIR_CLI_OBS): Add cli/cli-utils.o.
+ (SUBDIR_CLI_SRCS): Add cli/cli-utils.c.
+ (cli_utils_h): New variable.
+ (cli/cli-utils.o): New rule.
+ * cli/cli-utils.c: New file.
+ * cli/cli-utils.h: New file.
+
+2001-01-04 Nicholas Duffek <nsd@redhat.com>
+
+ * config/i386/tm-i386.h (REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Delete trailing semicolon.
+
+2001-01-03 J.T. Conklin <jtc@redback.com>
+
+ * alphabsd-nat.c, i386-linux-nat.c, i386bsd-nat.c: Fix typo in
+ comment.
+
+2001-01-02 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * sh-tdep.c (sh_default_store_return_value): Allow for small return type.
+ (sh3e_sh4_store_return_value): Call sh_default_store_return_value for
+ non-float types.
+ * sparc-tdep.c (sparc_frame_chain): Fix typo in comment.
+ Update copyright notice.
+
+For older changes see ChangeLog-2000
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/ChangeLog-3.x b/contrib/gdb/gdb/ChangeLog-3.x
new file mode 100644
index 0000000..672aa3d
--- /dev/null
+++ b/contrib/gdb/gdb/ChangeLog-3.x
@@ -0,0 +1,4838 @@
+Tue Jan 23 15:49:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (define_symbol): Deal with deftype 'X'.
+
+ * convex-dep.c (wait): Make it pid_t.
+
+ * convex-dep.c (comm_registers_info): accept decimal comm register
+ specification, as "i comm 32768".
+
+ * dbxread.c (process_one_symbol): Make VARIABLES_INSIDE_BLOCK
+ macro say by itself where variables are. Pass it desc.
+ m-convex.h (VARIABLES_INSIDE_BLOCK): Nonzero for native compiler.
+
+ * m-convex.h (SET_STACK_LIMIT_HUGE): Define.
+ (IGNORE_SYMBOL): Take out #ifdef N_MONPT and put in 0xc4.
+
+Fri Jan 19 20:04:15 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Always set highest_offset to
+ current_offset when former is -1.
+
+ * dbxread.c (read_struct_type): Print nice error message
+ when encountering multiple inheritance.
+
+Thu Jan 18 13:43:30 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Always treat N_FN as a potential
+ source for a x.o or -lx symbol, ignoring OFILE_FN_FLAGGED.
+
+ * printcmd.c (print_frame_args): Cast -1 to (CORE_ADDR).
+
+ * hp300bsd-dep.c (_initialize_hp300_dep): Get kernel_u_addr.
+ m-hp300bsd.h (KERNEL_U_ADDR): Use kernel_u_addr.
+
+ * infcmd.c (run_command): #if 0 out call to
+ breakpoint_clear_ignore_counts.
+
+Thu Jan 11 12:58:12 1990 Jim Kingdon (kingdon at mole)
+
+ * printcmd.c (print_frame_args) [STRUCT_ARG_SYM_GARBAGE]:
+ Try looking up name of var before giving up & printing '?'.
+
+Wed Jan 10 14:00:14 1990 Jim Kingdon (kingdon at pogo)
+
+ * many files: Move stdio.h before param.h.
+
+ * sun3-dep.c (store_inferior_registers): Only try to write FP
+ regs #ifdef FP0_REGNUM.
+
+Mon Jan 8 17:56:15 1990 Jim Kingdon (kingdon at pogo)
+
+ * symtab.c: #if 0 out "info methods" code.
+
+Sat Jan 6 12:33:04 1990 Jim Kingdon (kingdon at pogo)
+
+ * dbxread.c (read_struct_type): Set TYPE_NFN_FIELDS_TOTAL
+ from all baseclasses; remove vestigial variable baseclass.
+
+ * findvar.c (read_var_value): Check REG_STRUCT_HAS_ADDR.
+ printcmd.c (print_frame_args): Check STRUCT_ARG_SYM_GARBAGE.
+ m-sparc.h: Define REG_STRUCT_HAS_ADDR and STRUCT_ARG_SYM_GARBAGE.
+
+ * blockframe.c (get_frame_block): Subtract one from pc if not
+ innermost frame.
+
+Fri Dec 29 15:26:33 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): check highest_offset != -1, not i.
+
+Thu Dec 28 16:21:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valops.c (value_struct_elt): Clean up error msg.
+
+ * breakpoint.c (describe_other_breakpoints):
+ Delete extra space before "also set at" and add period at end.
+
+Tue Dec 19 10:28:42 1989 Jim Kingdon (kingdon at pogo)
+
+ * source.c (print_source_lines): Tell user which line number
+ was out of range when printing error message.
+
+Sun Dec 17 14:14:09 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Use
+ BLOCK_START (SYMBOL_BLOCK_VALUE (f)) instead of
+ SYMBOL_VALUE (f) to get start of function.
+
+ * dbxread.c: Make xxmalloc just a #define for xmalloc.
+
+Thu Dec 14 16:13:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m68k-opcode.h (fseq & following fp instructions):
+ Change @ to $.
+
+Fri Dec 8 19:06:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * breakpoint.c (breakpoint_clear_ignore_counts): New function.
+ infcmd.c (run_command): Call it.
+
+Wed Dec 6 15:03:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c: Change it so "array-max 0" means there is
+ no limit.
+
+ * expread.y (yylex): Change error message "invalid token in
+ expression" to "invalid character '%c' in expression".
+
+Mon Dec 4 16:12:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Always return 1
+ for success, 0 for failure, and set *NAME and *ADDRESS to
+ match the return value.
+
+ * dbxread.c (symbol_file_command): Use perror_with_name on
+ error from stat.
+ (psymtab_to_symtab, add_file_command),
+ core.c (validate_files), source.c (find_source_lines),
+ default-dep.c (exec_file_command): Check for errors from stat,
+ fstat, and myread.
+
+Fri Dec 1 05:16:42 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valops.c (check_field): When following pointers, just get
+ their types; don't call value_ind.
+
+Thu Nov 30 14:45:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb (pyr): New machine.
+ core.c [REG_STACK_SEGMENT]: New code.
+ dbxread.c (process_one_symbol): Cast return from copy_pending
+ to long before casting to enum namespace.
+ infrun.c: Split registers_info into DO_REGISTERS_INFO
+ and registers_info.
+ m-pyr.h, pyr-{dep.c,opcode.h,pinsn.c}: New files.
+
+ * hp300bsd-dep.c: Stay in sync with default-dep.c.
+
+ * m-hp300bsd.h (IN_SIGTRAMP): Define.
+
+Mon Nov 27 23:48:21 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE):
+ Return floating point values in %f0.
+
+Tue Nov 21 00:34:46 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (read_type): #if 0 out code which skips to
+ comma following x-ref.
+
+Sat Nov 18 20:10:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): Undo changes of Nov 11 & 16.
+ (print_string): Add parameter force_ellipses.
+ (val_print): Pass force_ellipses true when we stop fetching string
+ before we get to the end, else pass false.
+
+Thu Nov 16 11:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infrun.c (restore_inferior_status): Don't try to restore
+ selected frame if the inferior no longer exists.
+
+ * valprint.c (val_print): Rewrite string printing code not to
+ call print_string.
+
+ * Makefile.dist (clean): Remove xgdb and xgdb.o.
+
+Tue Nov 14 12:41:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (XGDB, bindir, xbindir, install, all): New stuff.
+
+Sat Nov 11 15:29:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): chars_to_get: New variable.
+
+Thu Nov 9 12:31:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (main): Process "-help" as a switch that doesn't
+ take an argument.
+
+Wed Nov 8 13:07:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (gdb.tar.Z): Add "else true".
+
+Tue Nov 7 12:25:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infrun.c (restore_inferior_status): Don't dereference fid if NULL.
+
+ * config.gdb (sun3, sun4): Accept "sun3" and "sun4".
+
+Mon Nov 6 09:49:23 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (Makefile): Move comments after commands.
+
+ * *-dep.c [READ_COFF_SYMTAB]: Pass optional header size to
+ read_section_hdr().
+
+ * inflow.c: Include <fcntl.h> regardless of USG.
+
+ * coffread.c (read_section_hdr): Add optional_header_size.
+ (symbol_file_command): Pass optional header size to
+ read_section_hdr().
+ (read_coff_symtab): Initialize filestring.
+
+ * version.c: Change version to 3.4.xxx.
+
+ * GDB 3.4 released.
+
+Sun Nov 5 11:39:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * version.c: Change version to 3.4.
+
+ * symtab.c (decode_line_1): Only skip past "struct" if it
+ is there.
+
+ * valops.c (value_ind), eval.c (evaluate_subexp, case UNOP_IND):
+ Have "*" <int-valued-exp> return an int, not a LONGEST.
+
+ * utils.c (fprintf_filtered): Pass arg{4,5,6} to sprintf.
+
+ * printcmd.c (x_command): Use variable itself rather
+ than treating it as a pointer only if it is a function.
+ (See comment "this makes x/i main work").
+
+ * coffread.c (symbol_file_command): Use error for
+ "%s does not have a symbol-table.\n".
+
+Wed Nov 1 19:56:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c [BELIEVE_PCC_PROMOTION_TYPE]: New code.
+ m-sparc.h: Define BELIEVE_PCC_PROMOTION_TYPE.
+
+Thu Oct 26 12:45:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infrun.c: Include <sys/dir.h>.
+
+ * dbxread.c (read_dbx_symtab, case N_LSYM, case 'T'):
+ Check for enum types and put constants in psymtab.
+
+Mon Oct 23 15:02:25 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (define_symbol, read_dbx_symtab): Handle enum
+ constants (e.g. "b:c=e6,0").
+
+Thu Oct 19 14:57:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * stack.c (frame_info): Use FRAME_ARGS_ADDRESS_CORRECT
+ m-vax.h (FRAME_ARGS_ADDRESS_CORRECT): New macro.
+ (FRAME_ARGS_ADDRESS): Restore old meaning.
+
+ * frame.h (Frame_unknown): New macro.
+ stack.c (frame_info): Check for Frame_unknown return from
+ FRAME_ARGS_ADDRESS.
+ m-vax.h (FRAME_ARGS_ADDRESS): Sometimes return Frame_unknown.
+
+ * utils.c (fatal_dump_core): Add "internal error" to message.
+
+ * infrun.c (IN_SIGTRAMP): New macro.
+ (wait_for_inferior): Use IN_SIGTRAMP.
+ m-vax.h (IN_SIGTRAMP): New macro.
+
+Wed Oct 18 15:09:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb, Makefile.dist: Shorten m-i386-sv32.h.
+
+ * coffread.c (symbol_file_command): Pass 0 to select_source_symtab.
+
+Tue Oct 17 12:24:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * i386-dep.c (i386_frame_num_args): Take function from m-i386.h
+ file. Check for pfi null.
+ m-i386.h (FRAME_NUM_ARGS): Use i386_frame_num_args.
+
+ * infrun.c (wait_for_inferior): set stop_func_name to 0
+ before calling find_pc_partial_function.
+
+Thu Oct 12 01:08:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * breakpoint.c (_initialize_breakpoint): Add "disa".
+
+ * Makefile.dist: Add GLOBAL_CFLAGS and pass to readline.
+
+ * config.gdb (various): "$machine =" -> "machine =".
+
+Wed Oct 11 11:54:31 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * inflow.c (try_writing_regs): #if 0 out this function.
+
+ * main.c (main): Add "-help" option.
+
+ * dbxread.c (read_dbx_symtab): Merge code for N_FUN with
+ N_STSYM, etc.
+
+Mon Oct 9 14:21:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * inflow.c (try_writing_regs_command): Don't write past end
+ of struct user.
+
+ * dbxread.c (read_struct_type): #if 0 out code which checks for
+ bitpos and bitsize 0.
+
+ * config.gdb: Accept sequent-i386 (not seq386).
+ (symmetry): Set depfile and paramfile.
+
+ * m-convex.h (IGNORE_SYMBOL): Check for N_MONPT if defined.
+
+Thu Oct 5 10:14:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * default-dep.c (read_inferior_memory): Put #if 0'd out comment
+ within /* */.
+
+Wed Oct 4 18:44:41 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * config.gdb: Change /dev/null to m-i386.h for various
+ 386 machine "opcodefile" entries.
+
+ * config.gdb: Accept seq386 for sequent symmetry.
+
+Mon Oct 2 09:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * hp300bsd-dep.c: Fix copyright notice.
+
+Sun Oct 1 16:25:30 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (DEPFILES): Add isi-dep.c.
+
+ * default-dep.c (read_inferior_memory): Move #endif after else.
+
+Sat Sep 30 12:50:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * version.c: Change version number to 3.3.xxx.
+
+ * GDB 3.3 released.
+
+ * version.c: Change version number to 3.3.
+
+ * Makefile.dist (READLINE): Add vi_mode.c
+
+ * config.gdb (i386): Change /dev/null to m-i386.h
+
+ * config.gdb: Add ';;' before 'esac'.
+
+ * Makefile.dist (gdb.tar.Z): Move comment above dependency.
+
+ * dbxread.c (read_ofile_symtab): Check symbol before start
+ of source file for GCC_COMPILED_FLAG_SYMBOL.
+ (start_symtab): Don't clear processing_gcc_compilation.
+
+Thu Sep 28 22:30:23 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * valprint.c (print_string): If LENGTH is zero, print "".
+
+Wed Sep 27 10:15:10 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * config.gdb: "rm tmp.c" -> "rm -f tmp.c".
+
+Tue Sep 26 13:02:10 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * utils.c (_initialize_utils): Use termcap to set lines_per_page
+ and chars_per_line.
+
+Mon Sep 25 10:06:43 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab, N_SOL): Do not add the same file
+ more than once.
+
+Thu Sep 21 12:43:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infcmd.c (unset_environment_command): Delete all variables
+ if called with no arg.
+
+ * remote.c, inferior.h (remote_{read,write}_inferior_memory):
+ New functions.
+ core.c ({read,write}_memory): Use remote_{read,write}_inferior_memory.
+
+ * valops.c (call_function): When reserving stack space for
+ arguments, call value_arg_coerce.
+
+ * m-hp9k320.h: define BROKEN_LARGE_ALLOCA.
+
+ * breakpoint.c (delete_command): Ask for confirmation only
+ when there are breakpoints.
+
+ * dbxread.c (read_struct_type): If lookup_basetype_type has
+ copied a stub type, call add_undefined_type.
+
+ * sparc_pinsn.c (compare_opcodes): Check for "1+i" anywhere
+ in args.
+
+ * val_print.c (type_print_base): Print stub types as
+ "<incomplete type>".
+
+Wed Sep 20 07:32:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * sparc-opcode.h (swapa): Remove i bit from match.
+ (all alternate space instructions): Delete surplus "foo rs1+0"
+ patterns.
+
+ * Makefile.dist (LDFLAGS): Set to $(CFLAGS).
+
+ * remote-multi.shar (remote_utils.c, putpkt): Change csum to unsigned.
+
+Tue Sep 19 14:15:16 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * sparc-opcode.h: Set i bit in lose for many instructions which
+ aren't immediate.
+
+ * stack.c (print_frame_info): add "func = 0".
+
+Mon Sep 18 16:19:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * sparc-opcode.h (mov): Add mov to/from %tbr, %psr, %wim.
+
+ * sparc-opcode.h (rett): Fix notation to use suggested assembler
+ syntax from architecture manual.
+
+ * symmetry-dep.c (I386_REGNO_TO_SYMMETRY): New macro.
+ (i386_frame_find_saved_regs): Use I386_REGNO_TO_SYMMETRY.
+
+Sat Sep 16 22:21:17 1989 Jim Kingdon (kingdon at spiff)
+
+ * remote.c (remote_close): Set remote_desc to -1.
+
+ * gdb.texinfo (Output): Fix description of echo to match
+ reality and ANSI C.
+
+Fri Sep 15 14:28:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (lookup_symbol): Add comment about "asm".
+
+ * sparc-pinsn.c: Use NUMOPCODES.
+
+ * sparc-opcode.h (NUMOPCODES): Use sparc_opcodes[0] not *sparc_opcodes.
+
+Thu Sep 14 15:25:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (xxmalloc): Print error message before calling abort().
+
+ * infrun.c (wait_for_inferior): Check for {stop,prev}_func_name
+ null before passing to strcmp.
+
+Wed Sep 13 12:34:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * sparc-opcode.h: New field delayed.
+ sparc-pinsn.c (is_delayed_branch): New function.
+ (print_insn): Check for delayed branches.
+
+ * stack.c (print_frame_info): Use misc_function_vector in
+ case where ar truncates file names.
+
+Tue Sep 12 00:16:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * convex-dep.c (psw_info): Move "struct pswbit *p" with declarations.
+
+Mon Sep 11 14:59:57 1989 Jim Kingdon (kingdon at spiff)
+
+ * convex-dep.c (core_file_command): Delete redundant printing
+ of "Program %s".
+
+ * m-convex.h (ENTRY_POINT): New macro.
+
+ * m-convex.h (FRAME_CHAIN_VALID): Change outside_first_object_file
+ to outside_startup_file
+
+ * main.c: #if 0 out catch_termination and related code.
+
+ * command.c (lookup_cmd_1): Consider underscores part of
+ command names.
+
+Sun Sep 10 09:20:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * printcmd.c: Change asdump_command to disassemble_command
+ (_initialize_printcmd): Change asdump to diassemble.
+
+ * main.c (main): Exit with code 0 if we hit the end of a batch
+ file.
+
+ * Makefile.dist (libreadline.a): Fix syntax of "CC=${CC}".
+
+Sat Sep 9 01:07:18 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * values.c (history_info): Renamed to value_history_info.
+ Command renamed to "info value" (with "info history" still
+ accepted).
+
+ * sparc-pinsn.c (print_insn): Extend symbolic address printing
+ to cover "sethi" following by an insn which uses 1+i.
+
+Fri Sep 8 14:24:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-hp9k320.h, m-hp300bsd.h, m-altos.h, m-sparc.h, m-sun3.h
+ (READ_GDB_SYMSEGS): Remove.
+ dbxread.c [READ_GDB_SYMSEGS]: Remove code to read symsegs.
+
+ * sparc-pinsn.c (print_insn): Detect "sethi-or" pairs and
+ print symbolic address.
+
+ * sparc-opcode.h (sethi, set): Change lose from 0xc0000000 to
+ 0xc0c00000000.
+
+ * remote.c (remote_desc): Initialize to -1.
+
+ * Makefile.dist (libreadline.a): Pass CC='${CC}' to readline makefile.
+
+Thu Sep 7 00:07:17 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_struct_type): Check for static member functions.
+ values.c, eval.c, valarith.c, valprint.c, valops.c: Merge changes
+ from Tiemann for static member functions.
+
+ * sparc-opcode.h (tst): Fix all 3 patterns.
+
+ * Makefile.dist (gdb1): New rule.
+
+ * sparc-opcode.h: Change comment about what the disassembler
+ does with the order of the opcodes.
+
+ * sparc-pinsn.c (compare_opcodes): Put 1+i before i+1.
+ Also fix mistaken comment about preserving order of original table.
+
+ * sparc-opcode.h (clr, mov): Fix incorrect lose entries.
+
+ * m-symmetry.h (FRAME_NUM_ARGS): Add check to deal with code that
+ GCC sometimes generates.
+
+ * config.gdb: Change all occurances of "skip" to "/dev/null".
+
+ * README (about languages other than C): Update comments about
+ Pascal and FORTRAN.
+
+ * sparc-opcode.h (nop): Change lose from 0xae3fffff to 0xfe3fffff.
+
+ * values.c (value_virtual_fn_field): #if 0-out assignment to
+ VALUE_TYPE(vtbl).
+
+Wed Sep 6 12:19:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * utils.c (fatal_dump_core): New function.
+ Makefile.dist (MALLOC_FLAGS): use -Dbotch=fatal_dump_core
+
+Tue Sep 5 15:47:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * breakpoint.c (enable_command): With no arg, enable all bkpts.
+
+ * Makefile.dist (Makefile): Remove \"'s around $(MD).
+
+ * Makefile.dist: In "cd readline; make . . ." change first
+ SYSV_DEFINE to SYSV.
+
+ * m68k-pinsn.c (_initialize_pinsn): Use alternate assembler
+ syntax #ifdef HPUX_ASM
+
+Sat Sep 2 23:24:43 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * values.c (history_info): Don't check num_exp[0] if num_exp
+ is nil (just like recent editing_info change).
+
+Fri Sep 1 19:19:01 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * gdb.texinfo (inc-history, inc-readline): Copy in the inc-* files
+ because people might not have makeinfo.
+
+ * README (xgdb): Strengthen nasty comments.
+
+ * gdb.texinfo: Change @setfilename to "gdb.info".
+
+Thu Aug 31 17:23:50 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * main.c (editing_info): Don't check arg[0] if arg is null.
+
+ * m-vax.h: Add comment about known sigtramp bug.
+
+ * sun3-dep.c, sparc-dep.c (IS_OBJECT_FILE, exec_file_command):
+ Get right text & data addresses for .o files.
+
+Wed Aug 30 13:54:19 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * utils.c (tilde_expand): Remove function (it's in readline).
+
+ * sparc-opcode.h (call): Change "8" to "9" in first two
+ patterns (%g7->%o7).
+
+Tue Aug 29 16:44:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * printcmd.c (whatis_command): Change 4th arg to type_print
+ from 1 to -1.
+
+Mon Aug 28 12:22:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (psymtab_to_symtab_1): In "and %s ..." change
+ pst->filename to pst->dependencies[i]->filename.
+
+ * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): New macro
+ made from FRAMELESS_FUNCTION_INVOCATION from m-sun3.h except
+ that it checks for zero return from get_pc_function_start.
+ m-hp9k320.h, m-hp300bsd.h, m-i386.h, m-isi.h, m-altos.h,
+ m-news.h, m-sparc.h, m-sun2.h, m-sun3.h, m-symmetry.h
+ (FRAMELESS_FUNCTION_INVOCATION): Use FRAMELESS_LOOK_FOR_PROLOGUE.
+
+ * dbxread.c (read_struct_type): Give warning and ignore field
+ if bitpos and bitsize are zero.
+
+Sun Aug 27 04:55:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (psymtab_to_symtab{,_1}): Print message about
+ reading in symbols before reading stringtab, not after.
+
+Sat Aug 26 02:01:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (IS_OBJECT_FILE, ADDR_OF_TEXT_SEGMENT): New macros.
+ (read_dbx_symtab): Use text_addr & text_size to set end_of_text_addr.
+ (symbol_file_command): pass text_addr & text_size to read_dbx_symtab.
+
+Fri Aug 25 23:08:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c (value_print): Try to give the name of function
+ pointed to when printing a function pointer.
+
+Thu Aug 24 23:18:40 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * core.c (xfer_core_file): In cases where MEMADDR is above the
+ largest address that makes sense, set i to len.
+
+Thu Aug 24 16:04:17 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * valprint.c (print_string): New function to print a character
+ string, doing array-max limiting and repeat count processing.
+ (val_print, value_print): Use print_string.
+ (REPEAT_COUNT_THRESHOLD): New #define, the max number of elts to print
+ without using a repeat count. Set to ten.
+ (value_print, val_print): Use REPEAT_COUNT_THRESHOLD.
+
+ * utils.c (printchar): Use {fputs,fprintf}_filtered.
+
+ * valprint.c (val_print): Pass the repeat count arg to the
+ fprintf_filtered call for "<repeats N times>" messages.
+
+Wed Aug 23 22:53:47 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * utils.c: Include <pwd.h>.
+
+ * main.c: Declare free.
+
+Wed Aug 23 05:05:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * utils.c, defs.h: Add tilde_expand.
+ source.c (directory_command),
+ main.c (cd_command),
+ main.c (set_history_filename),
+ dbxread.c (symbol_file_command),
+ coffread.c (symbol_file_command),
+ dbxread.c (add_file_command),
+ symmisc.c (print_symtabs),
+ *-dep.c (exec_file_command, core_file_command),
+ main.c (source_command): Use tilde_expand.
+
+ * dbxread.c (read_type): When we get a cross-reference, resolve
+ it immediately if possible, only calling add_undefined_type if
+ necessary.
+
+ * gdb.texinfo: Uncomment @includes and put comment at start
+ of file telling people to use makeinfo.
+
+ * valprint.c (type_print_base): Print the right thing for
+ bitfields.
+
+ * config.gdb (sun3os3): Set paramfile and depfile.
+
+Tue Aug 22 05:38:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (symbol_file_command): Pass string table size to
+ read_dbx_symtab().
+ (read_dbx_symtab): Before indexing into string table, check
+ string table index for reasonableness.
+ (psymtab_to_symtab{,_1}, read_ofile_symtab): Same.
+
+Tue Aug 22 04:04:39 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * m68k-pinsn.c: Replaced many calls to fprintf and fputs with
+ calls to fprintf_filtered and fputs_filtered.
+ (print_insn_arg): Use normal MIT 68k syntax for postincrement,
+ predecrement, and register indirect addressing modes.
+
+Mon Aug 21 10:08:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (initialize_signals): Set signal handler for SIGQUIT
+ and SIGHUP to do_nothing.
+
+ * ns32k-opcode.h (ord): Change 1D1D to 1D2D.
+
+ * ns32k-pinsn.c (print_insn_arg, print_insn): Handle index
+ bytes correctly.
+
+ * ns32k-opcode.h: Add comments.
+
+ * dbxread.c (read_type): Put enum fields in type.fields in order
+ that they were found in the debugging symbols (not reverse order).
+
+Sun Aug 20 21:17:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (source_command): Read .gdbinit if run without argument.
+
+ * source.c (directory_command): Only print "foo already in path"
+ if from_tty.
+
+ * version.c: Change version number to 3.2.xxx
+
+Sat Aug 19 00:24:08 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * m-news.h: Define HAVE_WAIT_STRUCT.
+
+ * m-isi.h, isi-dep.c: Replace with new version from Adam de Boor.
+ config.gdb: Remove isibsd43.
+
+ * main.c (catch_termination): Don't say we have written
+ .gdb_history until after we really have.
+
+ * convex-dep.c (attach): Add "sleep (1)".
+ (write_vector_register): Use "LL" with long long constant.
+ (wait): Close comment.
+ (wait): Change "unix 7.1 bug" to "unix 7.1 feature" & related
+ changes in comment.
+ (scan_stack): And fp with 0x80000000 in while loop test.
+ (core_file_command): Move code to set COREFILE.
+ (many places): Change printf to printf_filtered.
+ (psw_info): Allow argument giving value to print as a psw.
+ (_initialize_convex_dep): Update docstrings.
+
+ * m-convex.h (WORDS_BIG_ENDIAN): Correct typo ("WRODS")
+ define NO_SIGINTERRUPT.
+ define SET_STACK_LIMIT_HUGE.
+ add "undef BUILTIN_TYPE_LONGEST" before defining it.
+ Use "LL" after constants in CALL_DUMMY.
+
+ * dbxread.c: In the 3 places it says error "ridiculous string
+ table size"... delete extra parameter to error.
+
+ * dbxread.c (scan_file_globals): Check for FORTRAN common block.
+ Allow multiple references for the sake of common blocks.
+
+ * main.c (initialize_main): Set history_filename to include
+ current directory.
+
+ * valprint.c (decode_format): Don't return a defaulted size
+ field if osize is zero.
+
+ * gdb.texinfo (Compilation): Update information on -gg symbols.
+ Document problem with ar.
+
+Fri Aug 18 19:45:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (val_print, value_print): Add "<repeats %d times>" code.
+ Also put "..." outside quotes for strings.
+
+ * main.c (initialize_main): Add comment about history output file
+ being different from history input file.
+
+ * m-newsos3.h: Undefine NO_SIGINTERRUPT. Rearrange a few comments.
+
+ * m-newsos3.h (REGISTER_U_ADDR): Use new version from Hikichi.
+
+ * sparc-opcode.h: Add comment clarifying meaning of the order of
+ the entries in sparc_opcodes.
+
+ * eval.c (evaluate_subexp, case UNOP_IND): Deal with deferencing
+ things that are not pointers.
+
+ * valops.c (value_ind): Make dereferencing an int give a LONGEST.
+
+ * expprint.c (print_subexp): Add (int) cast in OP_LAST case.
+
+ * dbxread.c (read_array_type): Set lower and upper if adjustable.
+
+ * symtab.c (lookup_symbol): Don't abort if symbol found in psymtab
+ but not in symtab.
+
+Thu Aug 17 15:51:20 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * config.gdb: Changed "Makefile.c" to "Makefile.dist".
+
+Thu Aug 17 01:58:04 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * sparc-opcode.h (or): Removed incorrect lose bit 0x08000000.
+ [many]: Changed many `lose' entries to have the 0x10 bit set, so
+ they don't think %l0 is %g0.
+
+Wed Aug 16 00:30:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-symmetry.h (STORE_STRUCT_RETURN): Also write reg 0.
+ (EXTRACT_RETURN_VALUE): Call symmetry_extract_return_value.
+ symmetry-dep.c (symmetry_extract_return_value): New fn.
+
+ * main.c (symbol_completion_function): Deal with changed
+ result_list from lookup_cmd_1 for ambiguous return.
+ command.c (lookup_cmd): Same.
+
+ * inflow.c [TIOCGETC]: Move #include "param.h" back before
+ system #includes. Change all #ifdef TIOCGETC to
+ #if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
+ m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: Remove "#undef TIOCGETC"
+ and add "#define TIOCGETC_BROKEN".
+
+ * command.c (lookup_cmd_1): Give the correct result_list in the
+ case of an ambiguous return where there is a partial match
+ (e.g. "info a"). Add comment clarifying what is the correct
+ result_list.
+
+ * gdb.texinfo (GDB History): Document the two changes below.
+
+ * main.c (command_line_input): Make history expansion not
+ just occur at the beginning of a line.
+
+ * main.c (initialize_main): Make history expansion off by default.
+
+ * inflow.c: Move #include "param.h" after system #includes.
+
+ * i386-dep.c (i386_float_info): Use U_FPSTATE macro.
+
+ * m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: New files.
+ Makefile.dist, config.gdb: Know about these new files.
+
+Tue Aug 15 21:36:11 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * symtab.c (lookup_struct_elt_type): Use type_print rather
+ than assuming type has a name.
+
+Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * sparc-opcode.h (mov): Removed bogus "or i,0,d" pattern.
+
+ * sparc-opcode.h (mov, or): Fixed incorrect `lose' members.
+
+ * sparc-dep.c: Don't include "sparc-opcode.h".
+ (skip_prologue, isanulled): Declare special types to recognize
+ instructions, and use them.
+
+ * sparc-pinsn.c (print_insn): Sign-extend 13-bit immediate args.
+ If they are less than +9, print them in signed decimal instead
+ of unsigned hex.
+
+ * sparc-opcode.h, sparc-pinsn.c: Completely rewritten to share an
+ opcode table with gas, and thus produce disassembly that looks
+ like what the assembler accepts.
+
+Tue Aug 15 16:20:52 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (find_pc_psymbol): Move best_pc=psymtab->textlow-1
+ after test for psymtab null.
+
+ * main.c (editing_info): Remove variable retval.
+
+ * config.gdb (sun3, isi): Comment out obsolete message about telling
+ it whether you have an FPU (now that it detects it).
+
+ * config.gdb (sun3): Accept sun3os3.
+
+ * m68k-insn.h: Include <signal.h>.
+
+ * m68k-pinsn.h (convert_{to,from}_68881): Add have_fpu code
+
+ * m-newsos3.h: Undefine USE_PCB. That code didn't seem to work.
+
+ * sparc-dep.c: Put in insn_fmt and other stuff from the old
+ sparc-opcode.h.
+
+ * sparc-opcode.h, sparc-pinsn.c: Correct copyright notice.
+
+ * sparc-opcode.h, sparc-pinsn.c: Replace the old ones with the new
+ ones by roland.
+
+Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
+
+ * Makefile.dist: Don't define CC at all.
+
+ * Makefile.dist (Makefile): Remove tmp.c after preprocessing.
+ Use $(MD) instead of M_MAKEDEFINE in the cc command.
+
+ * Makefile.dist: Don't define RL_LIB as
+ "${READLINE}/libreadline.a", since READLINE is a list of files.
+
+Mon Aug 14 23:49:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (print_version): Change 1988 to 1989.
+
+ * main.c (copying_info, initialize_main): Remove #if 0'd code.
+
+Tue Aug 1 14:44:56 1989 Hikichi (hikichi at sran203)
+
+ * m-newsos3.h
+ (NO_SIGINTERRUPT): have SIGINTERRUPT on NEWS os 3.
+
+ * m-news.h(FRAME_FIND_SAVED_REGS): use the sun3's instead of old
+ one.
+
+Mon Aug 14 15:27:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-news.h, m-newsos3.h, news-dep.c: Merge additional changes
+ by Hikichi (ChangeLog entries above).
+
+ * Makefile.dist (READLINE): List readline files individually
+ so we don't accidently get random files from the readline
+ directory.
+
+ * m-news.h (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE):
+ Expect floating point returns to be in fp0.
+
+ * gdb.texinfo (Format options): New node.
+
+ * gdb.texinfo: Comment out "@include"s until bfox fixes the
+ readline & history docs.
+
+ * dbxread.c (read_addl_syms): Set startup_file_* if necessary at
+ the end (as well as when we hit ".o").
+
+ * printcmd.c (decode_format): Set val.format & val.size to '?' at
+ start and set defaults at end.
+
+ * symtab.c (decode_line_1): Check for class_name null.
+
+ * valops.c: Each place where it compares against field names,
+ check for null field names. (new t_field_name variables).
+
+ * utils.c (fputs_filtered): Check for linebuffer null before
+ checking whether to call fputs. Remove later check for linebuffer
+ null.
+
+Sun Aug 13 15:56:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-isi.h, m-sun3.h ({PUSH,POP}_FP_REGS): New macros.
+ m-sun3.h (NUM_REGS): Conditionalize on FPU.
+ config.gdb (sun3, isi): Add message about support for machines
+ without FPU.
+
+ * main.c (catch_termination, initialize_signals): new functions.
+
+ * main.c (editing_info): Add "info editing n" and "info editing +".
+ Rewrite much of this function.
+ gdb.texinfo (GDB Readline): Document it.
+
+ * values.c (history_info): Add "info history +". Also add code to
+ do "info history +" when command is repeated.
+ gdb.texinfo (Value History): Document "info history +".
+
+ * expprint.c (print_subexp): Add OP_THIS to case stmt.
+
+ * config.gdb (sun4os4): Put quotes around make define.
+
+ * config.gdb: Canonicalize machine name at beginning.
+
+Sat Aug 12 00:50:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb: define M_MAKEDEFINE
+ Makefile (Makefile, MD): Be able to re-make Makefile.
+
+ * main.c (command_line_input): Add comments to
+ the command history.
+
+ * Makefile.dist (Makefile): Add /bin/false.
+
+Fri Aug 11 14:35:33 1989 Jim Kingdon (kingdon at spiff)
+
+ * Makefile.dist: Comment out .c.o rule and add TARGET_ARCH.
+
+ * m-altos.h: Include sys/page.h & sys/net.h
+
+ * m-altos.h (FRAME_CHAIN{,_VALID}): Use outside_startup_file.
+
+ * config.gdb (altos, altosgas): Add M_SYSV & M_BSD_NM and remove
+ M_ALLOCA=alloca.o from makedefine.
+
+ * coffread.c (complete_symtab): Change a_entry to entry.
+
+ * m-altosgas.h: New file.
+
+ * m-symmetry (REGISTER_BYTE): Fix dumb mistake.
+
+Fri Aug 11 06:39:49 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * utils.c (set_screensize_command): Check for ARG being nil, since
+ that's what execute_command will pass if there's no argument.
+
+ * expread.y (yylex): Recognize "0x" or "0X" as the beginning of a
+ number.
+
+Thu Aug 10 15:43:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb, Makefile.dist: Rename Makefile.c to Makefile.dist.
+
+ * m-altos.h: Add comment about porting to USGR2.
+
+ * config.gdb (sparc): Add -Usparc.
+
+Wed Aug 9 14:20:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-sun3os4.h: Define BROKEN_LARGE_ALLOCA.
+
+ * values.c (modify_field): Check for value too large to fit in
+ bitfield.
+
+ * utils.c (fputs_filtered): Allow LINEBUFFER to be NULL.
+
+ * breakpoint.c (condition_command): Check for attempt to specify
+ non-numeric breakpoint number.
+
+ * config.gdb, Makefile, m-altos.h, altos-dep.c: Merge Altos
+ port.
+
+ * README: Change message about editing Makefile.
+
+ * config.gdb: Edit Makefile.
+ Copied Makefile to Makefile.c and changed to let config.gdb
+ run us through the C preprocessor.
+
+ * expread.y (yylex): Test correctly for definition of number.
+
+Wed Aug 9 11:56:05 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Put bracketing of entry point in
+ test case for .o symbols so that it will be correct even without
+ debugging symbols.
+ (end_psymtab): Took bracketing out.
+
+ * blockframe.c (outside_startup_file): Reverse the sense of the
+ return value to make the functionality implied by the name
+ correct.
+
+Tue Aug 8 11:48:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * coffread.c (symbol_file_command): Do not assume presence of a.out
+ header.
+
+ * blockframe.c: Replace first_object_file_end with
+ startup_file_{start,end}
+ (outside_startup_file): New function.
+ dbxread.c (read_addl_syms, read_dbx_symtab, end_psymbol): set
+ startup_file_*. Delete first_object_file_end code.
+ Add entry_point and ENTRY_POINT
+ coffread.c (complete_symtab): Set startup_file_*.
+ (first_object_file_end): Add as static.
+ m-*.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Call outside_startup_file
+ instead of comparing with first_object_file_end.
+
+ * breakpoint.c (breakpoint_1): Change -1 to (CORE_ADDR)-1.
+
+ * config.gdb (i386, i386gas): Add missing quotes at end of "echo"
+
+ * source.c (directory_command): Add dont_repeat ();
+
+Mon Aug 7 18:03:51 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (read_addl_syms): Change strcmp to strncmp and put 3rd
+ arg back.
+
+ * command.h (struct cmd_list_element): Add comment clarifying
+ purpose of abbrev_flag.
+
+Mon Aug 7 12:51:03 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * printcmd.c (_initialize_printcmd): Changed "undisplay" not to
+ have abbrev flag set; it isn't an abbreviation of "delete
+ display", it's an alias.
+
+Mon Aug 7 00:25:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * symtab.c (lookup_symtab_1): Remove filematch (never used).
+
+ * expread.y [type]: Add second argument to 2 calls to
+ lookup_member_type which were missing them.
+
+ * dbxread.c (symbol_file_command): Add from_tty arg.
+ Check it before calling query.
+
+ * infcmd.c (tty_command): Add from_tty arg.
+
+ * eval.c (evaluate_subexp): Remove 3rd argument from
+ calls to value_x_unop.
+
+ * dbxread.c (read_addl_syms): Remove 3rd argument from
+ call to strcmp.
+
+ * gdb.texinfo (Command editing): @include inc-readline.texinfo
+ and inc-history.texinfo and reorganize GDB-specific stuff.
+
+ * Makefile: Add line MAKE=make.
+
+ * README (second paragraph): Fix trivial errors.
+
+ * dbxread.c (read_struct_type): Make sure p is initialized.
+
+ * main.c (symbol_completion_function): Complete correctly
+ on the empty string.
+
+Sun Aug 6 21:01:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * symmetry-dep.c: Remove "long" from definition of i386_follow_jump.
+
+ * gdb.texinfo (Backtrace): Document "where" and "info stack".
+
+ * dbxread.c (cleanup_undefined_types): Strip off "struct "
+ or "union " from type names before doing comparison
+
+Sat Aug 5 02:05:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb (i386, i386gas): Improve makefile editing instructions.
+
+ * Makefile: Fix typo in CLIBS for SYSV.
+
+ * dbxread.c (read_dbx_symtab): Deal with N_GSYM typedefs.
+
+ * dbxread.c (add_file_command): Do not free name. We didn't
+ allocate it; it just points into arg_string.
+
+ * Makefile, m-*.h: Change LACK_VPRINTF to HAVE_VPRINTF.
+
+Fri Jul 28 00:07:48 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (val_print): Made sure that all returns returned a
+ value (usually 0, indicating no memory printed).
+
+ * core.c (read_memory): Changed "return" to "return 0".
+
+ * expread.y (parse_number): Handle scientific notation when the
+ string does not contain a '.'.
+
+Thu Jul 27 15:14:03 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * infrun.c (signals_info): Error if signal number passed is out of
+ bounds.
+
+ * defs.h: Define alloca to be __builtin_alloca if compiling with
+ gcc and localized inclusion of alloca.h on the sparc with the
+ other alloca stuff.
+ * command.c: Doesn't need to include alloca.h on the sparc; defs.h
+ does it for you.
+
+ * printcmd.c (print_frame_args): Changed test for call to
+ print_frame_nameless_args to check i to tell if any args had been
+ printed.
+
+Thu Jul 27 04:40:56 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Always check that NAME
+ and/or ADDRESS are not nil before storing into them.
+
+Wed Jul 26 23:41:21 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
+
+ * m-newsos3.h: Define BROKEN_LARGE_ALLOCA.
+ * dbxread.c (symbol_file_command, psymtab_to_symtab):
+ Use xmalloc #ifdef BROKEN_LARGE_ALLOCA.
+
+Tue Jul 25 16:28:18 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu)
+
+ * m68k-opcode.h: moved some of the fmovem entries so they're
+ all consecutive. This way the assembler doesn't bomb.
+
+Mon Jul 24 22:45:54 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * symtab.c (lookup_symbol): Changed error to an informational (if
+ not very comforting) message about internal problems. This will
+ get a null symbol returned to decode_line_1, which should force
+ things to be looked up in the misc function vector.
+
+Wed Jul 19 13:47:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (lookup_symbol): Changed "fatal" to "error" in
+ external symbol not found in symtab in which it was supposed to be
+ found. This can be reached because of a bug in ar.
+
+Tue Jul 18 22:57:43 1989 Randy Smith (roland at hobbes.ai.mit.edu)
+
+ * m-news.h [REGISTER_U_ADDR]: Decreased the assumed offset of fp0
+ by 4 to bring it into (apparently) appropriate alignment with
+ reality.
+
+Tue Jul 18 18:14:42 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * Makefile: pinsn.o should depend on opcode.h
+
+ * m68k-opcode.h: Moved fmovemx with register lists to before other
+ fmovemx.
+
+Tue Jul 18 11:21:42 1989 Jim Kingdon (kingdon at susie)
+
+ * Makefile, m*.h: Only #define vprintf (to _doprnt or printf,
+ depends on the system) if the library lacks it (controlled by
+ LACK_VPRINTF_DEFINE in makefile). Unpleasant, but necessary to
+ make this work with the GNU C library.
+
+Mon Jul 17 15:17:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * breakpoint.c (breakpoint_1): Change addr-b->address to
+ b->address-addr.
+
+Sun Jul 16 16:23:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * eval.c (evaluate_subexp): Change error message printed when
+ right operand of '@' is not an integer to English.
+
+ * infcmd.c (registers_info): Fix call to print_spaces_filtered
+ to specify right # of arguments.
+
+ * gdb.texinfo (Command Editing): Document info editing command.
+
+ * coffread.c (read_file_hdr): Add MC68MAGIC.
+
+ * source.c (select_source_symtab): Change MAX to max.
+
+Fri Jul 14 21:19:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * infcmd.c (registers_info): Clean up display to look good with long
+ register names, to say "register" instead of "reg", and to put the
+ "relative to selected stack frame" bit at the top.
+
+Fri Jul 14 18:23:09 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (record_misc_function): Put parens around | to force
+ correct evaluation.
+
+Wed Jul 12 12:25:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m-newsos3, m-news, infrun.c, Makefile, config.gdb, news-dep.c:
+ Merge in Hikichi's changes for Sony/News-OS 3 support.
+
+Tue Jul 11 21:41:32 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * utils.c (fputs_filtered): Don't do any filtering if output is
+ not to stdout, or if stdout is not a tty.
+ (fprintf_filtered): Rely on fputs_filtered's check for whether to
+ do filtering.
+
+Tue Jul 11 00:33:58 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * GDB 3.2 Released.
+
+ * valprint.h: Deleted.
+
+ * utils.c (fputs_filtered): Don't do any filtering if filtering is
+ disabled (lines_per_page == 0).
+
+Mon Jul 10 22:27:53 1989 Randy Smith (roland at hobbes.ai.mit.edu)
+
+ * expread.y [typebase]: Added "unsigned long int" and "unsigned
+ short int" to specs.
+
+Mon Jul 10 21:44:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (main): Make -cd use cd_command to avoid
+ current_directory with non-absolute pathname.
+
+Mon Jul 10 00:34:29 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (symbol_file_command): Catch errors from stat (even
+ though they should never happen).
+
+ * source.c (openp): If the path is null, use the current
+ directory.
+
+ * dbxread.c (read_dbx_symtab): Put N_SETV symbols into the misc
+ function vector ...
+ (record_misc_function): ... as data symbols.
+
+ * utils.c (fprintf_filtered): Return after printing if we aren't
+ going to do filtering.
+
+ * Makefile: Added several things for make clean to take care of.
+
+ * expread.y: Lowered "@" in precedence below +,-,*,/,%.
+
+ * eval.c (evaluate_subexp): Return an error if the rhs of "@"
+ isn't integral.
+
+ * Makefile: Added removal of core and gdb[0-9] files to clean
+ target.
+
+ * Makefile: Made a new target "distclean", which cleans things up
+ correctly for making a distribution.
+
+Sun Jul 9 23:21:27 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * dbxread.c: Surrounded define of gnu symbols with an #ifndef
+ NO_GNU_STABS in case you don't want them on some machines.
+ * m-npl.h, m-pn.h: Defined NO_GNU_STABS.
+
+Sun Jul 9 19:25:22 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * utils.c (fputs_filtered): New function.
+ (fprintf_filtered): Use fputs_filtered.
+ utils.c (print_spaces_filtered),
+ command.c (help_cmd,help_cmd_list),
+ printcmd.c (print_frame_args),
+ stack.c (print_block_frame_locals, print_frame_arg_vars),
+ valprint.c (many functions): Use fputs_filtered instead of
+ fprintf_filtered to avoid arbitrary limit.
+
+ * utils.c (fprintf_filtered): Fix incorrect comment.
+
+Sat Jul 8 18:12:01 1989 Randy Smith (randy at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): Changed assignment of pretty to use
+ prettyprint as a conditional rather than rely on values of the
+ enum.
+
+ * Projects: Cleaned up a little for release.
+
+ * main.c (initialize_main): Initialize
+ rl_completion_entry_function instead of completion_entry_function.
+
+ * Makefile: Modified to use the new readline library setup.
+
+ * breakpoint.c (break_command_1, delete_breakpoint,
+ enable_breakpoint, disable_breakpoint): Put in new printouts for
+ xgdb usage triggered off of xgdb_verbose.
+ * main.c (main): Added check for flag to set xgdb_verbose.
+ * stack.c (frame_command): Set frame_changed when frame command
+ used.
+
+Fri Jul 7 16:20:58 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Remove valprint.h and move contents to value.h (more logical).
+
+Fri Jul 7 02:28:06 1989 Randall Smith (randy at rice-chex)
+
+ * m68k-pinsn.c (print_insn): Included a check for register list;
+ if there is one, make sure to start p after it.
+
+ * breakpoint.c (break_command_1, delete_breakpoint,
+ enable_breakpoint, disable_breakpoint): #ifdef'd out changes
+ below; they produce unwanted output in gdb mode in gnu-emacs.
+
+ * gdb.texinfo: Spelled. Also removed index references from
+ command editing section; the relevance/volume ratio was too low.
+ Removed all references to the function index.
+
+ * ns32k-opcode.h, ns32k-pinsn.c: Backed out changes of June 24th;
+ haven't yet received legal papers.
+
+ * .gdbinit: Included message telling the user what it is doing.
+
+ * symmetry-dep.c: Added static decls for i386_get_frame_setup,
+ i386_follow_jump.
+ * values.c (unpack_double): Added a return (double)0 at the end to
+ silence a compiler warning.
+
+ * printcmd.c (containing_function_bounds, asdump_command): Created
+ to dump the assembly code of a function (support for xgdb and a
+ useful hack).
+ (_initialize_printcmd): Added this to command list.
+ * gdb.texinfo [Memory]: Added documentation for the asdump
+ command.
+ * breakpoint.c (break_command_1, delete_breakpoint,
+ enable_breakpoint, disable_breakpoint): Added extra verbosity for
+ xgdb conditionalized on the new external frame_full_file_name.
+ * source.c (identify_source_line): Increase verbosity of fullname
+ prointout to include pc value.
+ * stack.c: Added a new variable; "frame_changed" to indicate when
+ a frame has been changed so that gdb can print out a frame change
+ message when the frame only changes implicitly.
+ (print_frame_info): Check the new variable in determining when to
+ print out a new message and set it to zero when done.
+ (up_command): Increment it.
+ (down_command): Decrement it.
+
+ * m68k-pinsn.c (print_insn_arg [lL]): Modified cases for register
+ lists to reset the point to point to after the word from which the
+ list is grabbed *if* that would cause point to point farther than
+ it currently is.
+
+Thu Jul 6 14:28:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (val_print, value_print): Add parameter to control
+ prettyprinting.
+ valprint.h: New file containing constants used for passing
+ prettyprinting parameter to val{,ue}_print.
+ expprint.c, infcmd.c, printcmd.c, valprint.c, values.c:
+ Change all calls to val{,ue}_print to use new parameter.
+
+Mon Jul 3 22:38:11 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (,process_one_symbol): Moved extern declaration for
+ index out of function to beginning of file.
+
+Mon Jul 3 18:40:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * gdb.texinfo (Registers): Add "ps" to list of standard registers.
+
+Sun Jul 2 23:13:03 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (enable_display): Change d->next to d = d->next so
+ that "enable display" without args works.
+
+Fri Jun 30 23:42:04 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * source.c (list_command): Made error message given when no
+ symtab is loaded clearer.
+
+ * valops.c (value_assign): Make it so that when assigning to an
+ internal variable, the type of the assignment exp is the type of
+ the value being assigned.
+
+Fri Jun 30 12:12:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (verbose_info): Created.
+ (initialize_main): Put "info verbose" into command list.
+
+ * utils.c (screensize_info): Created.
+ (_initialize_utils): Defined "info screensize" as a normal command.
+
+ * valprint.c (format_info): Added information about maximum number
+ of array elements to function.
+
+ * blockframe.c (find_pc_partial_function): Again.
+
+ * blockframe.c (find_pc_partial_function): Replaced a "shouldn't
+ happen" (which does) with a zero return.
+
+ * main.c (dont_repeat): Moved ahead of first use.
+
+Thu Jun 29 19:15:08 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * vax-opcode.h: Made minor modifications (moved an instruction and
+ removed a typo) to bring this into accord with gas' table; also
+ changed copyright to reflect it being part of both gdb and gas.
+
+ * m68k-opcode.h: Added whole scads and bunches of new stuff for
+ the m68851 and changed the coptyrightto recognize that the file
+ was shared between gdb and gas.
+
+ * main.c (stop_sig): Use "dont_repeat ()" instead of *line = 0;
+
+ * core.c (read_memory): Don't do anything if length is 0.
+
+ * Makefile: Added readline.c to the list of files screwed by
+ having the ansi ioctl.h compilation with gcc.
+
+ * config.gdb: Added sun4os3 & sun4-os3 as availible options.
+
+Wed Jun 28 02:01:26 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * command.c (lookup_cmd): Add ignore_help_classes argument.
+ (lookup_cmd_1): Add ignore_help_classes argument.
+ command.c, main.c: Change callers of lookup_cmd{,_1} to supply
+ value for ignore_help_classes.
+
+Tue Jun 27 18:01:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * utils.c (print_spaces_filtered): Made more efficient.
+ * defs.h: Declaration.
+ * valprint.c (val_print): Used in a couple of new places.
+
+Mon Jun 26 18:27:28 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * m68k-pinsn.c (print_insn_arg ['#', '^']): Combined them into one
+ case which always gets the argument from the word immediately
+ following the instruction.
+ (print_insn_arg ["[lL]w"]): Make sure to always get the register
+ mask from the word immediately following the instruction.
+
+Sun Jun 25 19:14:56 1989 Randall Smith (randy at galapas.ai.mit.edu)
+
+ * Makefile: Added hp-include back in as something to distribute.
+
+ * stack.c (print_block_frame_locals): Return value changed from
+ void to int; return 1 if values printed. Use _filtered.
+ (print_frame_local_vars): Use return value from
+ print_block_frame_locals to mention if nothing printed; mention
+ lack of symbol table, use _filtered.
+ (print_frame_arg_vars): Tell the user if no symbol table
+ or no values printed. Use fprintf_filtered instead of fprintf.
+ * blockframe.c (get_prev_frame_info): Check for no inferior or
+ core file before crashing.
+
+ * inflow.c (inferior_died): Set current frame to zero to keep from
+ looking like we're in start.
+
+Sat Jun 24 15:50:53 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * stack.c (frame_command): Added a check to make sure that there
+ was an inferior or a core file.
+
+ * expread.y (yylex): Allow floating point numbers of the form ".5"
+ to be parsed.
+
+ Changes by David Taylor at TMC:
+ * ns32k-pinsn.c: Added define for ?floating point coprocessor? and
+ tables for register names to be used for each of the possibilities.
+ (list_search): Created; searches a list of options for a specific
+ value.
+ (print_insn_arg): Added 'Q', 'b', 'M', 'P', 'g', and 'G' options
+ to the value location switch.
+ * ns32k-opcode.h: Added several new location flags.
+ [addr, enter, exit, ext[bwd], exts[bwd], lmr, lpr[bwd], restore,
+ rett, spr[bwd], smr]: Improved insn format output.
+
+ * symtab.c (list_symbols): Rearrange printing to produce readable
+ output for "info types".
+
+ * eval.c (evaluate_subexp_for_address): Fixed typo.
+
+ * dbxread.c (read_type): Don't output an error message when
+ there isn't a ',' after a cross-reference.
+
+ * dbxread.c (read_dbx_symtab): #if'd out N_FN case in
+ read_dbx_symtab if it has the EXT bit set (otherwise multiple
+ cases with the same value).
+
+Fri Jun 23 13:12:08 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * symmisc.c: Changed decl of print_spaces from static to extern
+ (since it's defined in utils.c).
+
+ * remote.c (remote_open): Close remote_desc if it's already been
+ opened.
+
+ * Remote_Makefile, remote_gutils.c, remote_inflow.c,
+ remote_server.c, remote_utils.c: Combined into remote-multi.shar.
+ * remote-multi.shar: Created (Vikram Koka's remote stub).
+ * remote-sa.m68k.shar: Created (Glenn Engel's remcom.c).
+ * README: Updated to reflect new organization of remote stubs.
+
+ * dbxread.c (read_dbx_symtab): Put an N_FN in with N_FN | N_EXT to
+ account for those machines which don't use the external bit here.
+ Sigh.
+
+ * m-symmetry.h: Defined NO_SIGINTERRUPT.
+
+Thu Jun 22 12:51:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (decode_format): Make sure characters are printed
+ using a byte size.
+
+ * utils.c (error): Added a terminal_ours here.
+
+ * stack.c (locals_info): Added check for selected frame.
+
+ * dbxread.c (read_type): Checked to make sure that a "," was
+ actually found in the symbol to end a cross reference.
+
+Wed Jun 21 10:30:01 1989 Randy Smith (randy at tartarus.uchicago.edu)
+
+ * expread.y (parse_number, [exp]): Allowed for the return of a
+ number marked as unsigned; this will allow inclusion of unsigned
+ constants.
+
+ * symtab.h: Put in default definitions for BUILTIN_TYPE_LONGEST
+ and BUILTIN_TYPE_UNSIGNED_LONGEST.
+
+ * expread.y (parse_number): Will now accept integers suffixed with
+ a 'u' (though does nothing special with it).
+
+ * valarith.c (value_binop): Added cases to deal with unsigned
+ arithmetic correctly.
+
+Tue Jun 20 14:25:54 1989 Randy Smith (randy at tartarus.uchicago.edu)
+
+ * dbxread.c (psymtab_to_symtab_1): Changed reading in info message
+ to go through printf_filtered.
+
+ * symtab.c (list_symbols): Placed header message after all calls
+ to psymtab_to_symtab.
+
+ * symtab.c (smash_to_{function, reference, pointer}_type): Carried
+ attribute of permanence for the type being smashed over the bzero
+ and allowed any type to point at this one if it is permanent.
+
+ * symtab.c (smash_to_{function, reference, pointer}_type): Fix
+ typo: check flags of to_type instead of type.
+
+ * m-hp9k320.h: Changed check on __GNU__ predefine to __GNUC__.
+
+ * Makefile: Made MUNCH_DEFINE seperate and based on SYSV_DEFINE;
+ they aren't the same on hp's.
+
+Mon Jun 19 17:10:16 1989 Randy Smith (randy at tartarus.uchicago.edu)
+
+ * Makefile: Fixed typo.
+
+ * valops.c (call_function): Error if the inferior has not been
+ started.
+
+ * ns32k-opcode.h [check[wc], cmpm[bwd], movm[bwd], skpsb]: Fixed
+ typos.
+
+Fri Jun 9 16:23:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-news.h [NO_SIGINTERRUPT]: Defined.
+
+ * dbxread.c (read_type): Start copy of undefined structure name
+ past [sue] defining type of cross ref.
+
+ * dbxread.c (process_one_symbol): Changed strchr to index.
+
+ * ns32k-opcode.h, ns32k-pinsn.c: More changes to number of
+ operands, addition of all of the set condition opcodes, addition
+ of several flag letters, all patterned after the gas code.
+
+ * ns32k-opcode.h [mov{su,us}[bwd], or[bwd]]: Changed number of
+ operands from 1 to 2.
+
+Wed Jun 7 15:04:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symseg.h [TYPE_FLAG_STUB]: Created.
+ * dbxread.c (read_type): Set flag bit if type is stub.
+ (cleanup_undefined_types): Don't mark it as a stub if it's been
+ defined since we first learned about it.
+ * valprint.c (val_print): Print out a message to that effect if
+ this type is encountered.
+
+ * symseg.h, symtab.h: Moved the definition of TYPE_FLAG_PERM over
+ to symseg.h so that all such definitions would be in the same place.
+
+ * valprint.c (val_print): Print out <No data fields> for a
+ structure if there aren't any.
+
+ * dbxread.c (read_type): Set type name of a cross reference type
+ to "struct whatever" or something.
+
+Tue Jun 6 19:40:52 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * breakpoint.c (breakpoint_1): Print out symbolic location of
+ breakpoints for which there are no debugging symbols.
+
+Mon Jun 5 15:14:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * command.c (help_cmd_list): Made line_size static.
+
+Sat Jun 3 17:33:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Makefile: Don't include the binutils hp-include directory in the
+ distribution anymore; refer the users to the binutils distribution.
+
+Thu Jun 1 16:33:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (disable_display_command): Fixed loop iteration for
+ no arg case.
+
+ * printcmd.c (disable_display_command): Added from_tty parameter
+ to function.
+
+ * valops.c (value_of_variable): Call read_var_value with 0 cast to
+ FRAME instead of CORE_ADDR.
+
+ * eval.c (evaluate_subexp): Corrected number of args passed to
+ value_subscript (to 2).
+
+ * infrun.c (wait_for_inferior), symtab.c (decode_line_1),
+ m-convex.h: Changed name of FIRSTLINE_DEBUG_BROKEN to
+ PROLOGUE_FIRSTLINE_OVERLAP.
+
+ * m-merlin.h: Fixed typo.
+ * ns32k-opcode.h: Added ns32381 opcodes and "cinv" insn, and fixed
+ errors in movm[wd], rett, and sfsr.
+
+ * eval.c (evaluate_subexp, evaluate_subexp_for_address), valops.c
+ (value_zero): Change value_zero over to taking two arguments
+ instead of three.
+
+ * eval.c (evaluate_subexp)
+ [OP_VAR_VALUE]: Get correct lval type for AVOID_SIDE_EFFECTS for
+ all types of symbols.
+ [BINOP_DIV]: Don't divide if avoiding side effects; just return
+ an object of the correct type.
+ [BINOP_REPEAT]: Don't call value_repeat, just allocate a
+ repeated value.
+ (evaluete_subexp_for_address) [OP_VAR_VALUE]: Just return a thing
+ of the right type (after checking to make sure that we are allowed
+ to take the address of whatever variable has been passed).
+
+Mon May 29 11:01:02 1989 Randall Smith (randy at galapas.ai.mit.edu)
+
+ * breakpoint.c (until_break_command): Set the breakpoint with a
+ frame specification so that it won't trip in inferior calls to the
+ function. Also set things up so that it works based on selected
+ frame, not current one.
+
+Sun May 28 15:05:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * eval.c (evalue_subexp): Change subscript case to use value_zero
+ in EVAL_AVOID_SIDE_EFFECTS case.
+
+Fri May 26 12:03:56 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_addl_syms, psymtab_to_symtab): Removed
+ cleanup_undefined_types; this needs to be done on a symtab basis.
+ (end_symtab): Called cleanup_undefined_types from here.
+ (cleanup_undefined_types): No longer uses lookup_symbol (brain
+ dead idea; oh, well), now it searches through file_symbols.
+
+Wed May 24 15:52:43 1989 Randall Smith (randy at galapas)
+
+ * source.c (select_source_symtab): Only run through
+ partial_symtab_list if it exists.
+
+ * coffread.c (read_coff_symtab): Don't unrecord a misc function
+ when a function symbol is seen for it.
+
+ * expread.y [variable]: Make sure to write a type for memvals if
+ you don't get a mft you recognize.
+
+Tue May 23 12:15:57 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * dbxread.c (read_ofile_symtab, psymtab_to_symtab): Moved cleanup
+ of undefined types to psymtab_to_symtab. That way it will be
+ called once for all readins (which will, among other things,
+ help reduce infinite loops).
+
+ * symtab.h [misc_function_type]: Forced mf_unknown to 0.
+ * dbxread.c (record_misc_function): Cast enum to unsigned char (to
+ fit).
+ * expread.y [variable]: Cast unsigned char back to enum to test.
+
+Mon May 22 13:08:25 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ Patches by John Gilmore for dealing well with floating point:
+ * findvar.c (value_from_register, locate_var_value): Used
+ BYTES_BIG_ENDIAN instead of an inline test.
+ * m-sparc.h [IEEE_FLOAT]: Created to indicate that the sparc is
+ IEEE compatible.
+ * printcmd.c (print_scalar_formatted): Use BYTES_BIG_ENDIAN and
+ the stream argument for printing; also modify default type for
+ 'f'. Change handling of invalid floats; changed call syntax for
+ is_nan.
+ (print_command): Don't print out anything indicating that
+ something was recorded on the history list if it wasn't.
+ * valprint.c (val_print): Fixed to deal properley with new format
+ of is_nan and unpacking doubles without errors occuring.
+ (is_nan): Changed argument list and how it figures big endianness
+ (uses macros).
+ * values.c (record_latest_value): Return -1 and don't record if
+ it's an invalid float.
+ (value_as_double): Changed to use new unpack_double calling
+ convention.
+ (unpack_double): Changed not to call error if the float was
+ invalid; simply to set invp and return. Changed calling syntax.
+ (unpack_field_as_long, modify_field): Changed to use
+ BITS_BIG_ENDIAN to determine correct action.
+
+ * m-hp9k320.h [HP_OS_BUG]: Created; deals with problem where a
+ trap happens after a continue.
+ * infrun.c (wait_for_inferior): Used.
+
+ * m-convex.h [FIRSTLINE_DEBUG_BROKEN]: Defined a flag to indicate
+ that the debugging symbols output by the compiler for the first
+ line of a function were broken.
+ * infrun.c (wait_for_inferior), symtab.c (decode_line_1): Used.
+
+ * gdb.texinfo [Data, Memory]: Minor cleanups of phrasing.
+
+Fri May 19 00:16:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (add_undefined_type, cleanup_undefined_types): Created
+ to keep a list of cross references to as yet undefined types.
+ (read_type): Call add_undefined_type when we run into such a case.
+ (read_addl_syms, read_ofile_symtab): Call cleanup_undefined_types
+ when we're done.
+
+ * dbxread.c (psymtab_to_symtab, psymtab_to_symtab_1): Broke
+ psymtab_to_symtab out into two routines; made sure the string
+ table was only readin once and the globals were only scanned once,
+ for any number of dependencies.
+
+Thu May 18 19:59:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-*.h: Defined (or not, as appropriate per machine)
+ BITS_BIG_ENDIAN, BYTES_BIG_ENDIAN, and WORDS_BIG_ENDIAN.
+
+Wed May 17 13:37:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (symbol_completion_function): Always complete on result
+ command list, even if exact match found. If it's really an exact
+ match, it'll find it again; if there's something longer than it,
+ it'll get the right result.
+
+ * symtab.c (make_symbol_completion_function): Fixed typo; strcmp
+ ==> strncmp.
+
+ * dbxread.c (read_dbx_symtab): Change 'G' case to mark symbols as
+ LOC_EXTERNAL.
+
+ * expread.y [variables]: Changed default type of text symbols to
+ function returning int so that one can use, eg. strcmp.
+
+ * infrun.c (wait_for_inferior): Include a special flag indicating
+ that one shouldn't insert the breakpoints on the next step for
+ returning from a sigtramp and forcing at least one move forward.
+
+ * infrun.c (wait_for_inferior): Change test for nexting into a
+ function to check for current stack pointer inner than previous
+ stack pointer.
+
+ * infrun.c (wait_for_inferior): Check for step resume break
+ address before dealing with normal breakpoints.
+
+ * infrun.c (wait_for_inferior): Added a case to deal with taking
+ and passing along a signal when single stepping past breakpoints
+ before inserting breakpoints.
+
+ * infrun.c (wait_for_inferior): Inserted special case to keep
+ going after taking a signal we are supposed to be taking.
+
+Tue May 16 12:49:55 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * inflow.c (terminal_ours_1): Cast result of signal to (int
+ (*)()).
+
+ * gdb.texinfo: Made sure that references to the program were in
+ upper case. Modify description of the "set prompt" command.
+ [Running]: Cleaned up introduction.
+ [Attach]: Cleaned up.
+ [Stepping]: Change "Proceed" to "Continue running" or "Execute".
+ Minor cleanup.
+ [Source Path]: Cleaned up intro. Cleared up distinction between
+ the executable search path and the source path. Restated effect
+ of the "directory" command with no arguments.
+ [Data]: Fixed typos and trivial details.
+ [Stepping]: Fixed up explanation of "until".
+
+ * source.c (print_source_lines): Print through filter.
+
+ * printcmd.c (x_command): If the format with which to print is
+ "i", use the address of anything that isn't a pointer instead of
+ the value. This is for, eg. "x/10i main".
+
+ * gdb.texinfo: Updated last modification date on manual.
+
+Mon May 15 12:11:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (lookup_symtab): Fixed typo (name ==> copy) in call to
+ lookup_symtab_1.
+
+ * gdb.texinfo: Added documentation for "break [+-]n" and for new
+ actions of "directory" command (taking multiple directory names at
+ the same time).
+
+ * m68k-opcode.h: Replaced the version in gdb with an up-to-date
+ version from the assembler directory.
+ * m68k-pinsn.c (print_insn_arg): Added cases 'l' & 'L' to switch
+ to print register lists for movem instructions.
+
+ * dbxread.c, m-convex.h: Moved convex dependent include files over
+ from dbxread.c to m-convex.h.
+
+ * printcmd.c (disable_display, disable_display_command): Changed
+ name of first to second, and created first which takes an int as
+ arg rather than a char pointer. Changed second to use first.
+ (_initialize_printcmd): Changed to use second as command to call.
+ (delete_current_display, disable_current_display): Changed name of
+ first to second, and changed functionality to match.
+ * infrun.c (normal_stop), main.c (return_to_top_level): Changed to
+ call disable_current_display.
+
+ * dbxread.c (process_one_symbol, read_dbx_symtab): Changed N_FN to
+ be N_FN | N_EXT to deal with new Berkeley define; this works with
+ either the old or the new.
+
+ * Remote_Makefile, remote_gutils.c, remote_inflow.c,
+ remote_server.c, remote_utils.c: Created.
+ * Makefile: Included in tag and tar files.
+ * README: Included a note about them.
+
+ * printcmd.c (print_address): Use find_pc_partial_function to
+ remove need to readin symtabs for symbolic addresses.
+
+ * source.c (directory_command): Replaced function with new one
+ that can accept lists of directories seperated by spaces or :'s.
+
+ * inflow.c (new_tty): Replaced calls to dup2 with calls to dup.
+
+Sun May 14 12:33:16 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * stack.c (args_info): Make sure that you have an inferior or core
+ file before taking action.
+
+ * ns32k-opcode.h [deiw, deid]: Fixed machine code values for these
+ opcodes.
+
+ * dbxread.c (scan_file_globals): Modified to use misc function
+ vector instead of file itself. Killed all arguments to the
+ funciton; no longer needed.
+ (psymtab_to_symtab): Changed call for above to reflect new (void)
+ argument list.
+
+ * dbxread.c (read_dbx_symtab, ): Moved HASH_OFFSET define out of
+ read_dbx_symtab.
+
+ * expread.y [variable]: Changed default type of misc function in
+ text space to be (void ()).
+
+ * Makefile: Modified for proper number of s/r conflicts (order is
+ confusing; the mod that necessitated this change was on May 12th,
+ not today).
+
+ * expread.y (yylex): Added SIGNED, LONG, SHORT, and INT keywords.
+ [typename]: Created.
+ [typebase]: Added rules for LONG, LONG INT, SHORT, SHORT INT,
+ SIGNED name, and UNSIGNED name (a good approximation of ansi
+ standard).
+
+ * Makefile: Included .c.o rule to avoid sun's make from throwing
+ any curves at us.
+
+ * blockframe.c: Included <obstack.h>
+
+ * command.c (lookup_cmd): Clear out trailing whitespace.
+
+ * command.c (lookup_cmd_1): Changed malloc to alloca.
+
+Fri May 12 12:13:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Only print nameless args when you
+ know how many args there are supposed to be and when you've
+ printed fewer than them. Don't print nameless args between
+ printed args.
+
+ * symtab.c (make_symbol_completion_function): Fixed typo (= ==>
+ ==).
+
+ * remote.c (remote_open): ifdef'd out siginterrupt call by #ifndef
+ NO_SIGINTERRUPT.
+ * m-umax.h: Defined NO_SIGINTERRUPT.
+
+ * expread.y [ptype, array_mod, func_mod, direct_abs_decl,
+ abs_decl]: Added rules for parsing and creating arbitrarily
+ strange types for casts and sizeofs.
+
+ * symtab.c, symtab.h (create_array_type): Created. Some minor
+ misfeatures; see comments for details (main one being that you
+ might end up creating two arrays when you only needed one).
+
+Thu May 11 13:11:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * valops.c (value_zero): Add an argument for type of lval.
+ * eval.c (evaluate_subexp_for_address): Take address properly in
+ the avoid side affects case (ie. keep track of whether we have an
+ lval in memory and we can take the address).
+ (evaluate_subexp): Set the lval type of expressions created with
+ value_zero properley.
+
+ * valops.c, value.h (value_zero): Created--will return a value of
+ any type with contents filled with zero.
+ * symtab.c, symtab.h (lookup_struct_elt_type): Created.
+ * eval.c (evaluate_subexp): Modified to not read memory when
+ called with EVAL_AVOID_SIDE_EFFECTS.
+
+ * Makefile: Moved dbxread.c ahead of coffread.c in the list of
+ source files.
+
+Wed May 10 11:29:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * munch: Make sure that sysv version substitutes for the whole
+ line.
+
+ * symtab.h: Created an enum misc_function_type to hold the type of
+ the misc function being recorded.
+ * dbxread.c (record_misc_function): Branched on dbx symbols to
+ decide which type to assign to a misc function.
+ * coffread.c (record_misc_function): Always assign type unknown.
+ * expread.y [variable]: Now tests based on new values.
+
+Tue May 9 13:03:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c: Changed inclusion of <strings.h> (doesn't work on
+ SYSV) to declaration of index.
+
+ * Makefile: Changed last couple of READLINE_FLAGS SYSV_DEFINE
+
+ * source.c ({forward, reverse}_search_command): Made a default
+ search file similar to for the list command.
+
+Mon May 8 18:07:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): If we don't know how many
+ arguments there are to this function, don't print the nameless
+ arguments. We don't know enough to find them.
+
+ * printcmd.c (print_frame_args): Call print_frame_nameless_args
+ with proper arguments (start & end as offsets from addr).
+
+ * dbxread.c (read_addl_syms): Removed cases to deal with global
+ symbols; this should all be done in scan_global_symbols.
+
+Sun May 7 11:36:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Makefile: Added copying.awk to ${OTHERS}.
+
+Fri May 5 16:49:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (type_print_varspec_prefix): Don't pass
+ passed_a_pointer onto children.
+
+ * valprint.c (type_print_varspec_suffix): Print "array of" with
+ whatever the "of" is after tha array brackets.
+
+ * valprint.c (type_print_varspec_{prefix,suffix}): Arrange to
+ parenthesisze pointers to arrays as well as pointers to other
+ objects.
+
+ * valprint.c (type_print_varspec_suffix): Make sure to print
+ subscripts of multi-dimensional arrays in the right order.
+
+ * infcmd.c (run_command): Fixed improper usages of variables
+ within remote debugging branch.
+
+ * Makefile: Added Convex.notes to the list of extra files to carry
+ around.
+
+ * dbxread.c (symbol_file_command): Made use of alloca or malloc
+ dependent on macro define.
+
+Thu May 4 15:47:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Makefile: Changed READLINE_FLAGS to SYSV_DEFINE and called munch
+ with it also.
+ * munch: Check first argument for -DSYSV and be looser about
+ picking up init routines if you find it.
+
+ * coffread.c: Made fclose be of type int.
+
+ * breakpoint.c (_initialize_breakpoint): Put "unset" into class
+ alias.
+
+Wed May 3 14:09:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h [STACK_END_ADDR]: Parameterized off of
+ machine/vmparam.h (as per John Gilmore's suggestion).
+
+ * blockframe.c (get_prev_frame_info): Changed this function back
+ to checking frameless invocation first before checking frame
+ chain. This means that a backtrace up from start will produce the
+ wrong value, but that a backtrace from a frameless function called
+ in main will show up correctly.
+
+ * breakpoint.c (_initialize_breakpoint): Added entry in help for
+ delete that indicates that unset is an alias for it.
+
+ * main.c (symbol_completion_function): Modified recognition of
+ being within a single command.
+
+Tue May 2 15:13:45 1989 Randy Smith (randy at gnu)
+
+ * expread.y [variable]: Add some parens to get checking of the
+ misc function vector right.
+
+Mon May 1 13:07:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * default-dep.c (core_file_command): Made reg_offset unsigned.
+
+ * default-dep.c (core_file_command): Improved error messages for
+ reading in registers.
+
+ * expread.y: Allowed a BLOCKNAME to be ok for a variable name (as
+ per C syntax).
+
+ * dbxread.c (psymtab_to_symtab): Flushed stdout after printing
+ starting message about reading in symbols.
+
+ * printcmd.c (print_frame_args): Switched starting place for
+ printing of frameless args to be sizeof int above last real arg
+ printed.
+
+ * printcmd.c (print_frame_args): Modified final call to
+ print_nameless_args to not use frame slots used array if none had
+ been used.
+
+ * infrun.c (wait_for_inferior): Take FUNCTION_START_OFFSET into
+ account when dealing with comparison of pc values to function
+ addresses.
+
+ * Makefile: Added note about compiling gdb on a Vax running 4.3.
+
+Sun Apr 30 12:59:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * command.c (lookup_cmd): Got correct error message on bad
+ command.
+
+ * m-sun3.h [ABOUT_TO_RETURN]: Modified to allow any of the return
+ instructions, including trapv and return from interupt.
+
+ * command.c (lookup_cmd): If a command is found, use it's values
+ for error reporting and determination of needed subcommands.
+
+ * command.c (lookup_cmd): Use null string for error if cmdtype is
+ null; pass *line to error instead of **.
+
+ * command.c (lookup_cmd_1): End of command marked by anything but
+ alpha numeric or '-'. Included ctype.h.
+
+Fri Apr 28 18:30:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * source.c (select_source_symtab): Kept line number from ever
+ being less than 1 in main decode.
+
+Wed Apr 26 13:03:20 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * default-dep.c (core_file_command): Fixed typo.
+
+ * utils.c (fprintf_filtered): Don't use return value from
+ numchars.
+
+ * main.c, command.c (complete_on_cmdlist): Moved function to
+ command.c.
+
+ * command.c (lookup_cmd): Modified to use my new routine. Old
+ version is still there, ifdef'd out.
+
+ * command.c, command.h (lookup_cmd_1): Added a routine to do all
+ of the work of lookup_cmd with no error reporting and full return
+ of information garnered in search.
+
+Tue Apr 25 12:37:54 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * breakpoint.c (_initialize_breakpoint): Change "delete
+ breakpionts" to be in class alias and not have the abbrev flag
+ set.
+
+ * main.c (symbol_completion_function): Fix to correctly complete
+ things that correspond to multiword aliases.
+
+ * main.c (complete_on_cmdlist): Don't complete on something if it
+ isn't a command or prefix (ie. if it's just a help topic).
+
+ * main.c (symbol_completion_function): Set list index to be 0 if
+ creating a list with just one element.
+
+ * main.c (complete_on_cmdlist): Don't allow things with
+ abbrev_flag set to be completion values.
+ (symbol_completion_function): Don't accept an exact match if the
+ abbrev flag is set.
+
+ * dbxread.c (read_type): Fixed typo in comparision to check if
+ type number existed.
+
+ * dbxread.c (read_type): Made sure to only call dbx_lookup_type on
+ typenums if typenums were not -1.
+
+Mon Apr 24 17:52:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c: Added strings.h as an include file.
+
+Fri Apr 21 15:28:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (lookup_partial_symtab): Changed to only return a match
+ if the name match is exact (which is what I want in all cases in
+ which this is currently used.
+
+Thu Apr 20 11:12:34 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * m-isi.h [REGISTER_U_ADDR]: Installed new version from net.
+ * default-dep.c: Deleted inclusion of fcntl.h; apparently not
+ necessary.
+ * Makefile: Added comment about compiling on isi under 4.3.
+
+ * breakpoint.c (break_command_1): Only give decode_line_1 the
+ default_breakpoint_defaults if there's nothing better (ie. make
+ the default be off of the current_source notes if at all
+ possible).
+
+ * blockframe.c (get_prev_frame_info): Clean up comments and
+ delete code ifdefed out around FRAMELESS_FUNCTION_INVOCATION test.
+
+ * remote.c: Added a "?" message to protocol.
+ (remote_open): Used at startup.
+ (putpkt): Read whatever garbage comes over the line until we see a
+ '+' (ie. don't treat garbage as a timeout).
+
+ * valops.c (call_function): Eliminated no longer appropriate
+ comment.
+
+ * infrun.c (wait_for_inferior): Changed several convex conditional
+ compilations to be conditional on CANNOT_EXECUTE_STACK.
+
+Wed Apr 19 10:18:17 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Added code to attempt to deal
+ with arguments that are bigger than an int.
+
+ Continuation of Convex/Fortran changes:
+ * printcmd.c (print_scalar_formatted): Added leading zeros to
+ printing of large integers.
+ (address_info, print_frame_args): Added code to deal with
+ LOC_REF_ARG.
+ (print_nameless_args): Allow param file to specify a routine with
+ which to print typeless integers.
+ (printf_command): Deal with long long values well.
+ * stack.c (print_frame_arg_vars): Change to deal with LOC_REF_ARG.
+ * symmisc.c (print_symbol): Change to deal with LOC_REF_ARG.
+ * symseg.h: Added LOC_REF_ARG to enum address_class.
+ * symtab.c (lookup_block_symbol): Changed to deal with
+ LOC_REF_ARG.
+ * valarith.c (value_subscripted_rvalue): Created.
+ (value_subscript): Used above when app.
+ (value_less, value_equal): Change to cast to (char *) before doing
+ comparison, for machines where that casting does something.
+ * valops.c (call_function): Setup to deal with machines where you
+ cannot execute code on the stack segment.
+ * valprint.c (val_print): Make sure that array element size isn't
+ zero before printing. Set address of default array to address of
+ first element. Put in a couple of int cast. Removed some convex
+ specific code. Added check for endianness of machine in case of a
+ packed structure. Added code for printing typeless integers and
+ for LONG LONG's.
+ (set_maximum_command): Change to use parse_and_eval_address to get
+ argument (so can use expressions there).
+ * values.c (value_of_internalvar, set_internalvar_component,
+ set_internalvar, convenience_info): Add in hooks for trapped
+ internal vars.
+ (unpack_long): Deal with LONG_LONG.
+ (value_field): Remove LONGEST cast.
+ (using_struct_return): Fixed typo ENUM ==> UNION.
+ * xgdb.c (_initialize_xgdb): Make sure that specify_exec_file_hook
+ is not called unless we are setting up a windowing environ.
+
+Tue Apr 18 13:43:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ Various changes involved in 1) getting gdb to work on the convex,
+ and 2) Getting gdb to work with fortran (due to convex!csmith):
+ * convex-dep.c, convex-opcode.h, m-convex.h, convex-pinsn.c:
+ Created (or replaced with new files).
+ * Makefile: Add convex dependent files. Changed default flags to
+ gnu malloc to be CFLAGS.
+ * config.gdb: Added convex to list of machines.
+ * core.c (files_info): Added a FILES_INFO_HOOK to be used if
+ defined.
+ (xfer_core_file): Conditionalized compilation of xfer_core_file on
+ the macro XFER_CORE_FILE.
+ * coffread.c (record_misc_function): Made sure it zerod type field
+ (which is now being used; see next).
+ * dbxread.c: Included some convex dependent include files.
+ (copy_pending, fix_common_blocks): Created.
+ [STAB_REG_REGNUM, BELIEVE_PCC_PROMOTION]: Created default values;
+ may be overridden in m-*.h.
+ Included data structures for keeping track of common blocks.
+ (dbx_alloc_type): Modified; if called with negative 1's will
+ create a type without putting it into the type vector.
+ (read_dbx_symtab, read_addl_syms): Modified calls to
+ record_misc_function to include the new information.
+ (symbol_file_command, psymtab_to_symtab, add_file_command):
+ Modified reading in of string table to adapt to machines which
+ *don't* store the size of the string table in the first four bytes
+ of the string table.
+ (read_dbx_symtab, scan_file_globals, read_ofile_symtab,
+ read_addl_syms): Modified assignment of namestring to accept null
+ index into symtab as ok.
+ (read_addl_syms): Modified readin of a new object file to fiddle
+ with common blocks correctly.
+ (process_one_symbol): Fixed incorrect comment about convex. Get
+ symbols local to a lexical context from correct spot on a per
+ machine basis. Catch a bug in pcc which occaisionally puts an SO
+ where there should be an SOL. Seperate sections for N_BCOMM &
+ N_ECOMM.
+ (define_symbol): Ignore symbols with no ":". Use
+ STAB_REG_TO_REGNUM. Added support for function args calling by
+ reference.
+ (read_type): Only read type number if one is there. Remove old
+ (#if 0'd out) array code.
+ (read_array_type): Added code for dealing with adjustable (by
+ parameter) arrays half-heartedly.
+ (read_enum_type): Allow a ',' to end a list of values.
+ (read_range_type): Added code to check for long long.
+ * expread.y: Modified to use LONGEST instead of long where
+ necessary. Modified to use a default type of int for objects that
+ weren't in text space.
+ * findvar.c (locate_var_value, read_var_value): Modified to deal
+ with args passed by reference.
+ * inflow.c (create_inferior): Used CREATE_INFERIOR_HOOK if it
+ exists.
+ * infrun.c (attach_program): Run terminal inferior when attaching.
+ (wait_for_inferior): Removed several convex dependencies.
+ * main.c (float_handler): Created.
+ Made whatever signal indicates a stop configurable (via macro
+ STOP_SIGNAL).
+ (main): Setup use of above as a signal handler. Added check for
+ "-nw" in args already processed.
+ (command_line_input): SIGTSTP ==>STOP_SIGNAL.
+
+ * expread.y: Added token BLOCKNAME to remove reduce/reduce
+ conflict.
+ * Makefile: Change message to reflect new grammar.
+
+Mon Apr 17 13:24:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * printcmd.c (compare_ints): Created.
+ (print_frame_args): Modified to always print arguments in the
+ order in which they were found in the symbol table. Figure out
+ what apots are missing on the fly.
+
+ * stack.c (up_command): Error if no inferior or core file.
+
+ * m-i386.h, m-symmetry.h [FRAMELESS_FUNCTION_INVOCATION]: Created;
+ same as m68k.
+
+ * dbxread.c (define_symbol): Changed "desc==0" test to
+ "processing_gcc_compilation", which is the correct way to do it.
+
+Sat Apr 15 17:18:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * expread.y: Added precedence rules for arglists, ?:, and sizeof
+ to eliminate some shift-reduce conflicts.
+ * Makefile: Modified "Expect" message to conform to new results.
+
+Thu Apr 13 12:29:26 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * inflow.c (terminal_init_inferior): Fixed typo in recent diff
+ installation; TIOGETC ==> TIOCGETC.
+
+ * m-vax.h, m-sun2.h, m-sun3.h, m-sparc.h, m-hp*.h, m-isi.h,
+ m-news.h [FRAMELESS_FUNCTION_INVOCATION]: Created macro with
+ appropriate definition.
+
+Wed Apr 12 15:30:29 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * blockframe.c (get_prev_frame_info): Added in a macro to specify
+ when a "frame" is called without a frame pointer being setup.
+
+ * Makefile [clean]: Made sure to delete gnu malloc if it was being
+ used.
+
+Mon Apr 10 12:43:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (process_one_symbol): Reset within_function to 0 after
+ last RBRAC of a function.
+
+ * dbxread.c (read_struct_type): Changed check for filling in of
+ TYPE_MAIN_VARIANT of type.
+
+ * inflow.c (create_inferior): Conditionalized fork so that it
+ would be used if USG was defined and HAVE_VFORK was not defined.
+
+ * defs.h: Added comment about enum command_class element
+ class_alias.
+
+ * dbxread.c (process_one_symbol): Fixed a typo with interesting
+ implications for associative processing in the brain (':' ==> 'c').
+
+ * sparc-dep.c (isabranch): Changed name to isannulled, modified to
+ deal with coprocessor branches, and improved comment.
+ (single_step): Changed to trap at npc + 4 instead of pc +8 on
+ annulled branches. Changed name in call to isabranch as above.
+
+ * m-sun4os4.h (STACK_END_ADDRESS): Changed it to 0xf8000000 under
+ os 4.0.
+
+Sat Apr 8 17:04:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (process_one_symbol): In the case N_FUN or N_FNAME the
+ value being refered to is sometimes just a text segment variable.
+ Catch this case.
+
+ * infrun.c (wait_for_inferior), breakpoint.c
+ (breakpoint_stop_status): Move the selection of the frame to
+ inside breakpoint_stop_status so that the frame only gets selected
+ (and the symbols potentially read in) if the symbols are needed.
+
+ * symtab.c (find_pc_psymbol): Fixed minor misthough (pc >=
+ fucntion start, not >).
+
+ * breakpoint.c (_initialize_breakpoint): Change "delete" internal
+ help entry to simply refer to it being a prefix command (since the
+ list of subcommands is right there on a "help delete").
+
+Fri Apr 7 15:22:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Created; figures out
+ what function pc is in (name and address) without reading in any
+ new symbols.
+ * symtab.h: Added decl for above.
+ * infrun.c (wait_for_inferior): Used instead of
+ find_pc_function_start.
+ * stack.c (print_frame_info): Used instead of hand coding for same
+ thing.
+
+ * dbxread.c (psymtab_to_symtab): No longer patch readin pst's out
+ of the partial_symtab_list; need them there for some checks.
+ * blockframe.c (block_for_pc), source.c (select_source_symtab),
+ symtab.c (lookup_symbol, find_pc_symtab, list_symbols): Made extra
+ sure not to call psymtab_to_symtab with ->readin == 1, since these
+ psymtab now stay on the list.
+ * symtab.c (sources_info): Now distinguishes between psymtabs with
+ readin set and those with it not set.
+
+ * symtab.c (lookup_symtab): Added check through partial symtabs
+ for name with .c appended.
+
+ * source.c (select_source_symtab): Changed semantics a little so
+ that the argument means something.
+ * source.c (list_command), symtab.c (decode_line_1): Changed call
+ to select_source_symtab to match new conventions.
+
+ * dbxread.c (add_file_command): This command no longer selects a
+ symbol table to list from.
+
+ * infrun.c (wait_for_inferior): Only call find_pc_function (to
+ find out if we have debugging symbols for a function and hence if
+ we should step over or into it) if we are doing a "step".
+
+Thu Apr 6 12:42:28 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (command_line_input): Added a local buffer and only
+ copied information into the global main.c buffer when it is
+ appropriate for it to be saved (and repeated).
+ (dont_repeat): Only nail line when we are reading from stdin
+ (otherwise null lines won't repeat and what's in line needs to be
+ saved).
+ (read_command_lines): Fixed typo; you don't what to repeat when
+ reading command lines from the input stream unless it's standard
+ input.
+
+ John Gilmore's (gnu@toad.com) mods for USG gdb:
+ * inflow.c: Removed inclusion of sys/user.h; no longer necessary.
+ (, terminal_init_inferior, terminal_inferior, terminal_ours_1,
+ term_status_command, _initialize_inflow) Seperated out declaration
+ and usage of terminal mode structures based on the existence of
+ the individual ioctls.
+ * utils.c (request_quit): Restore signal handler under USG. If
+ running under USG initialize sys_siglist at run time (too much
+ variation between systems).
+
+Wed Apr 5 13:47:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ John Gilmore's (gnu@toad.com) mods for USG gdb:
+ * default-dep.c: Moved include of sys/user.h to after include of
+ a.out.h.
+ (store_inferior_registers): Fixed error message.
+ (core_file_command): Improved error messages from reading in of
+ u area in core file. Changed calculation of offset of registers
+ to account for some machines putting it in as an offset rather
+ than an absolute address. Changed error messages for reading of
+ registers from core file.
+
+ * coffread.c (read_file_hdr): Added final check for BADMAG macro
+ to use if couldn't recognize magic number.
+ * Makefile: Added explicit directions for alloca addition.
+ Included alloca.c in list of possible library files. Cleaned up
+ possible library usage. Included additional information on gcc
+ and include files.
+
+ * source.c, remote.c, inflow.c, dbxread.c, core.c, coffread.c:
+ Changed include of sys/fcntl.h to an include of fcntl.h (as per
+ posix; presumably this will break fewer machines. I hopw).
+ * README: Added a pointer to comments at top of Makefile.
+ * Makefile: Added a comment about machines which need fcntl.h in
+ sys.
+
+Tue Apr 4 11:29:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (set_prettyprint_command, set_unionprint_command,
+ format_info): Created.
+ (_initialize_valprint): Added to lists of commands.
+
+ * gdb.texinfo [Backtrace]: Added a section describing the format
+ if symbols have not yet been read in.
+
+ * valprint.c (val_print): Added code to prettyprint structures if
+ "prettyprint" is set and only to print unions below the top level
+ if "unionprint" is set.
+
+ * infcmd.c (registers_info), valprint.c (value_print, val_print):
+ Added argument to call to val_print indicating deptch of recursion.
+
+ * symtab.[ch] (find_pc_psymbol): Created; finds static function
+ psymbol with value nearest to but under value passed.
+ * stack.c (print_frame_info): Used above to make sure I have best
+ fit to pc value.
+
+ * symseg.h (struct partial_symbol): Added value field.
+ * dbxread.c (read_dbx_symtab): Set value field for partial symbols
+ saved (so that we can lookup static symbols).
+
+ * symtab.[ch] (find_pc_symtab): Changed to external.
+ * stack.c (select_frame): Call above to make sure that symbols for
+ a selected frame is readin.
+
+Mon Apr 3 12:48:16 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * stack.c (print_frame_info): Modified to only print out full
+ stack frame info on symbols whose tables have been read in.
+ * symtab.c, symtab.h (find_pc_psymtab): Made function external;
+ above needed it.
+
+ * main.c (,set_verbose_command, initialize_main): Created a
+ variable "info_verbose" which says to talk it up in various and
+ sundry places. Added command to set this variable.
+ * gdb.texinfo (GDB Output): Added documentation on "set verbose"
+ and changed the name of the "Screen Output" section to "GDB
+ Output".
+ * dbxread.c (psymtab_to_symtab): Added information message about
+ symbol readin. Conditionalized on above.
+
+ * dbxread.c (define_symbol): Made an "i" constant be of class
+ LOC_CONST and an "r" constant be of class LOC_CONST_BYTES.
+
+ * README: Made a note about modifications which may be necessary
+ to the manual for this version of gdb.
+
+ * blockframe.c (get_prev_frame_info): Now we get saved address and
+ check for validity before we check for leafism. This means that
+ we will catch the fact that we are in start, but we will miss any
+ fns that start calls without an fp. This should be fine.
+
+ * m-*.h (FRAME_CHAIN): Modified to return 0 if we are in start.
+ This is usually a test for within the first object file.
+ * m-sparc.h (FRAME_CHAIN): The test here is simply if the fp saved
+ off the the start sp is 0.
+
+ * blockframe.c (get_prev_frame_info): Removed check to see if we
+ were in start. Screws up sparc.
+
+ * m-sparc.h (FRAME_FIND_SAVED_REGISTERS): Changed test for dummy
+ frame to not need frame to be innermost.
+
+ * gdb.texinfo: Added section on frameless invocations of functions
+ and when gdb can and can't deal with this.
+
+ * stack.c (frame_info): Disallowed call if no inferior or core
+ file; fails gracefully if truely bad stack specfication has been
+ given (ie. parse_frame_specification returns 0).
+
+Fri Mar 31 13:59:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * infrun.c (normal_stop): Changed references to "unset-env" to
+ "delete env".
+
+ * infcmd.c (_initialize_infcmd): Change reference to set-args in
+ help run to "set args".
+
+ * remote.c (getpkt): Allow immediate quit when reading from
+ device; it could be hung.
+
+ * coffread.c (process_coff_symbol): Modify handling of REG
+ parameter symbols.
+
+Thu Mar 30 15:27:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (symbol_file_command): Use malloc to allocate the
+ space for the string table in symbol_file_command (and setup a
+ cleanup for this). This allows a more graceful error failure if
+ there isn't any memory availible (and probably allows more memory
+ to be avail, depending on the machine).
+
+ Additional mods for handling GNU C++ (from Tiemann):
+ * dbxread.c (read_type): Added case for '#' type (method type, I
+ believe).
+ (read_struct_type): If type code is undefined, make the main
+ variant for the type be itself. Allow recognition of bad format
+ in reading of structure fields.
+ * eval.c (evaluate_subexp): Modify evaluation of a member of a
+ structure and pointer to same to make sure that the syntax is
+ being used correctly and that the member is being accessed correctly.
+ * symseg.h: Added TYPE_CODE_METHOD to enum type_code. Add a
+ pointer to an array of argument types to the type structure.
+ * symtab.c (lookout_method_type, smash_to_method_type): Created.
+ * symtab.h (TYPE_ARG_TYPES): Created.
+ * valops.c (call_function): Modified handling of methods to be the
+ same as handling of functions; no longer check for members.
+ * valprint.c (val_print, type_print_varspec_{prefix,suffix},
+ type_print_base): Added code to print method args correctly.
+ * values.c (value_virtual_fn_field): Modify access to virtual
+ function table.
+
+Wed Mar 29 13:19:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * findvar.c: Special cases for REGISTER_WINDOWS: 1) Return 0 if we
+ are the innermost frame, and 2) return the next frame in's value
+ if the SP is being looked for.
+
+ * blockframe.c (get_next_frame): Created; returns the next (inner)
+ frame of the called frame.
+ * frame.h: Extern delcaration for above.
+
+ * main.c (command_line_input): Stick null at end before doing
+ history expansion.
+
+Tue Mar 28 17:35:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Added namestring assignment to
+ N_DATA/BSS/ABS case. Sigh.
+
+Sat Mar 25 17:49:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * expread.y: Defined YYDEBUG.
+
+Fri Mar 24 20:46:55 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symtab.c (make_symbol_completion_list): Completely rewrote to
+ never call psymtab_to_symtab, to do a correct search (no
+ duplicates) through the visible symbols, and to include structure
+ and union fields in the things that it can match.
+
+Thu Mar 23 15:27:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (dbx_create_type): Created; allocates and inits space
+ for a type without putting it on the type vector lists.
+ (dbx_alloc_type): Uses above.
+
+ * Makefile: xgdb.o now produced by default rules for .o.c.
+
+Fri Mar 17 14:27:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * infrun.c: Fixed up inclusion of aouthdr.h on UMAX_PTRACE.
+
+ * Makefile, config.gdb: Added hp300bsd to potential
+ configurations.
+ * hp300bsd-dep.c, m-hp300bsd.h: Created.
+
+ * infrun.c (wait_for_inferior): Rewrote to do no access to
+ inferior until we make sure it's still there.
+
+ * inflow.c (inferior_died): Added a select to force the selected
+ frame to null when inferior dies.
+
+ * dbxread.c (symbol_file_command): free and zero symfile when
+ discarding symbols.
+
+ * core.c (xfer_core_file): Extended and cleaned up logic in
+ interpeting memory address.
+
+ * core.c (xfer_core_file): Extended opening comment.
+
+Thu Mar 16 15:39:42 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * coffread.c (symbol_file_command): Free symfile name when freeing
+ contents.
+
+ * blockframe.c (get_prev_frame_info): Added to fatal error message
+ to indicate that it should never happen.
+
+ * stack.c (frame_info): Printed out value of "saved" sp seperately
+ to call attention to the fact that it isn't stored in memory
+ anywhere; the actual previous frames address is printed.
+
+ * m-sparc.h (FRAME_FIND_SAVED_REGS): Set address of sp saved in
+ frame to value of fp (rather than value of sp in current frame).
+
+ * expread.y: Allow "unsigned" as a type itself, as well as a type
+ modifier.
+
+ * coffread.c: Added declaration for fclose
+
+Fri Mar 10 17:22:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (command_line_input): Checked for -1 return from
+ readline; indicates EOF.
+
+Fri Mar 3 00:31:27 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * remote.c (remote_open): Cast return from signal to (void (*)) to
+ avoid problems on machines where the return type of signal is (int
+ (*)).
+
+ * Makefile: Removed deletion of version control from it (users
+ will need it for their changes).
+
+Thu Mar 2 15:32:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symmetry-dep.c (print_1167_regs): Print out effective doubles on
+ even number regs.
+ (fetch_inferior_registers): Get the floating point regs also.
+
+ * xgdb.c (do_command): Copied command before calling execute
+ command (so that execute_command wouldn't write into text space).
+
+ * copying.awk: Created (will produce copying.c as output when
+ given COPYING as input).
+ * Makefile: Used above to create copying.c.
+ * main.c: Took out info_warranty and info_copying.
+
+ * *.*: Changed copyright notice to use new GNU General Public
+ License (includes necessary changes to manual).
+
+ * xgdb.c (create_text_widget): Created text_widget before I create
+ the source and sink.
+ (print_prompt): Added fflush (stdout).
+
+ * Makefile: Added -lXmu to the compilation line for xgdb. Left
+ the old one there incase people still had R2.
+
+ * README: Added note about -gg format.
+
+ * remote.c (getpkt): Fixed typo; && ==> &.
+
+ * Makefile: Added new variable READLINE_FLAGS so that I could
+ force compilation of readline.c and history.c with -DSYSV on
+ system V machines. Mentioned in Makefile comments at top.
+
+Wed Mar 1 17:01:01 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * hp9k320-dep.c (store_inferior_registers): Fixed typo.
+
+Fri Feb 24 14:58:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * hp9k320-dep.c (store_inferior_registers,
+ fetch_inferior_registers): Added support for remote debugging.
+
+ * remote.c (remote_timer): Created.
+ (remote_open, readchar): Setup to timeout reads if they take
+ longer than "timeout". This allows one to debug how long such
+ things take.
+ (putpkt): Modified to print a debugging message (if such things
+ are enabled) each time it resends a packet.
+ (getpkt): Modified to make the variable CSUM unsigned and read it
+ CSUM with an & 0xff (presumably to deal with poor sign extension
+ on some machines). Also made c1 and c2 unsigned.
+ (remote_wait): Changed buffer to unsigned status.
+ (remote_store_registers, remote_write_bytes): Puts a null byte at
+ the end of the control string.
+
+ * infcmd.c (attach_command, detach_command, _initialize_infcmd):
+ Made attach_command and detach_command always availible, but
+ modified them to only allow device file attaches if ATTACH_DETACH
+ is not defined.
+
+ * gdb.texinfo: Added cross reference from attach command to remote
+ debugging.
+
+Thu Feb 23 12:37:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * remote.c (remote_close): Created to close the remote connection
+ and set the remote_debugging flag to 0.
+ * infcmd.c (detach_command): Now calls the above when appropriate.
+
+ * gdb.texinfo: Removed references to the ``Distribution'' section
+ in the copyright.
+
+ * main.c, utils.c (ISATTY): Created default defintions of this
+ macro which use isatty and fileno.
+ * utils.c (fprintf_filtered, print_spaces_filtered), main.c
+ (command_loop, command_line_input): Used this macro.
+ * m-news.h: Created a definition to override this one.
+
+ * utils.c (fprintf_filtered): Made line_size static (clueless).
+
+ * utils.c (fprintf_filtered): Changed max length of line printed
+ to be 255 chars or twice the format length.
+
+ * symmetry-dep.c, m-symmetry: Fixed typo (^L ==> ).
+
+ * printcmd.c (do_examine): Fixed typo (\n ==> \t).
+
+Wed Feb 22 16:00:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ Contributed by Jay Vosburgh (jay@mentor.cc.purdue.edu)
+ * m-symmetry.h, symmetry-dep.c: Created.
+ * Makefile: Added above in appropriate lists.
+ * config.gdb: Added "symmetry" target.
+
+ * utils.c (prompt_for_continue): Zero'd chars_printed also.
+
+ * utils.c (fprintf_filtered): Call prompt for continue instead of
+ doing it yourself.
+
+ * dbxread.c (read_dbx_symtab): Added code to conditionalize what
+ symbol type holds to "x.o" or "-lx" symbol that indicates the
+ beginning of a new file.
+
+Tue Feb 21 16:22:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * gdb.texinfo: Deleted @ignore block at end of file.
+
+ * findvar.c, stack.c: Changed comments that refered to "frame
+ address" to "frame id".
+
+ * findvar.c (locate_var_value): Modified so that taking the
+ address of an array generates an object whose type is a pointer to
+ the elements of the array.
+
+Sat Feb 18 16:35:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * gdb.texinfo: Removed reference to "!" as a shell escape
+ character. Added a section on controling screen output
+ (pagination); changing "Input" section to "User Interface"
+ section. Changed many inappropriate subsubsection nodes into
+ subsections nodes (in the readline and history expansion
+ sections).
+
+Fri Feb 17 11:10:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * utils.c (set_screensize_command): Created.
+ (_initialize_utils): Added above to setlist.
+
+ * main.c (main): Added check to see if ~/.gdbinit and .gdbinit
+ were the same file; only one gets read if so. Had to include
+ sys/stat.h for this.
+
+ * valprint.c (type_print_base): Changed calls to print_spaces to
+ print_spaces_filtered.
+
+ * main.c (command_line_input): Chaned test for command line
+ editing to check for stdin and isatty.
+
+ * main.c (command_loop): Call reinitialize_more_filter before each
+ command (if reading from stdin and it's a tty).
+ utils.c (initialize_more_filter): Changed name to
+ reinitialize_more_filter; killed arguments.
+ utils.c (_initialize_utils): Created; initialized lines_per_page
+ and chars_per_line here.
+
+ * utils.c (fprintf_filtered): Removed printing of "\\\n" after
+ printing linesize - 1 chars; assume that the screen display will
+ take care of that. Still watching that overflow.
+
+ * main.c: Created the global variables linesize and pagesize to
+ describe the number of chars per line and lines per page.
+
+Thu Feb 16 17:27:43 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * printcmd.c (do_examine, print_scalar_formatted, print_address,
+ whatis_command, do_one_display, ptype_command), valprint.c
+ (value_print, val_print, type_print_method_args, type_print_1,
+ type_print_derivation_info, type_print_varspec_suffix,
+ type_print_base), breakpoint.c (breakpoints_info, breakpoint_1),
+ values.c (history_info), main.c (editing_info, warranty_info,
+ copying_info), infcmd.c (registers_info), inflow.c
+ (term_status_command), infrun.c (signals_info), stack.c
+ (backtrace_command, print_frame_info), symtab.c (list_symbols,
+ output_source_filename), command.c (help_cmd, help_list,
+ help_command_list): Replaced calls to printf, fprintf, and putc
+ with calls to [f]printf_filtered to handle more processing.
+ Killed local more emulations where I noticed them.
+
+Wed Feb 15 15:27:36 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * defs.h, utils.c (initialize_more_filter, fprintf_filtered,
+ printf_filtered): Created a printf that will also act as a more
+ filter, prompting the user for a <return> whenever the page length
+ is overflowed.
+
+ * symtab.c (list_symbols): Elminated some code inside of an #if 0.
+
+Tue Feb 14 11:11:24 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * Makefile: Turned off backup versions for this file; it changes
+ too often.
+
+ * command.c (lookup_cmd, _initialize_command): Changed '!' so that
+ it was no longer a shell escape. "sh" must be used.
+
+ * main.c (command_line_input, set_history_expansion,
+ initialize_main): Turned history expansion on, made it the
+ default, and only execute it if the first character in the line is
+ a '!'.
+
+ * version.c, gdb.texinfo: Moved version to 3.2 (as usual, jumping
+ the gun some time before release).
+
+ * gdb.texinfo: Added sections (adapted from Brian's notes) on
+ command line editing and history expansion.
+
+ * main.c (set_command_editing, initialize_main): Modified name to
+ set_editing and modified command to "set editing".
+
+ * Makefile: Put in dependencies for READLINEOBJS.
+
+ * main.c (history_info, command_info): Combined into new command
+ info; deleted history_info.
+ (initialize_main): Deleted "info history" command; it was
+ interfering with the value history.
+
+ * coffread.c (enter_linenos): Modified to do bit copy instead of
+ pointer dereference, since the clipper machine can't handle having
+ longs on short boundaries.
+ (read_file_hdr): Added code to get number of syms for clipper.
+
+ * stack.c (return_command): Fixed method for checking when all of
+ the necessary frames had been popped.
+
+ * dbxread.c (read_dbx_symtab (ADD_PSYMBOL_TO_LIST)): Fixed typo in
+ allocation length.
+
+Mon Feb 13 10:03:27 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Split assignment to namestring into
+ several different assignments (so that it wouldn't be done except
+ when it had to be). Shortened switches and duplicated code to
+ produce the lowest possible execution time. Commented (at top of
+ switch) which code I duplicated.
+
+ * dbxread.c (read_dbx_symtab): Modified which variables were
+ register and deleted several variables which weren't used. Also
+ eliminated 'F' choice from subswitch, broke out strcmp's, reversed
+ compare on line 1986, and elminated test for !namestring[0]; it is
+ caught by following test for null index of ':'.
+
+Sun Feb 12 12:57:56 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * main.c (gdb_completer_word_break_characters): Turned \~ into ~.
+
+Sat Feb 11 15:39:06 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * symtab.c (find_pc_psymtab): Created; checks all psymtab's till
+ it finds pc.
+ (find_pc_symtab): Used; fatal error if psymtab found is readin
+ (should have been caught in symtab loop).
+ (lookup_symbol): Added check before scan through partial symtab
+ list for symbol name to be on the misc function vector (only if in
+ VAR_NAMESPACE). Also made sure that psymtab's weren't fooled with
+ if they had already been read in.
+ (list_symbols): Checked through misc_function_vector for matching
+ names if we were looking for functions.
+ (make_symbol_completion_list): Checked through
+ misc_function_vector for matching names.
+ * dbxread.c (read_dbx_symtab): Don't bother to do processing on
+ global function types; this will be taken care of by the
+ misc_function hack.
+
+ * symtab.h: Modified comment on misc_function structure.
+
+Fri Feb 10 18:09:33 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * symseg.h, dbxread.c (read_dbx_symtab, init_psymbol_list,
+ start_psymtab, end_psymtab), coffread.c (_initialize_coff),
+ symtab.c (lookup_partial_symbol, list_symbols,
+ make_symbol_completion_list): Changed separate variables for
+ description of partial symbol allocation into a specific kind of
+ structure.
+
+ (read_dbx_symtab, process_symbol_for_psymtab): Moved most of
+ process_symbol_for_psymtab up into read_dbx_symtab, moved a couple
+ of symbol types down to the ingore section, streamlined (I hope)
+ code some, modularized access to psymbol lists.
+
+Thu Feb 9 13:21:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (command_line_input): Made sure that it could recognize
+ newlines as indications to repeat the last line.
+
+ * symtab.c (_initialize_symtab): Changed size of builtin_type_void
+ to be 1 for compatibility with gcc.
+
+ * main.c (initialize_main): Made history_expansion the default
+ when gdb is compiled with HISTORY_EXPANSION.
+
+ * readline.c, readline.h, history.c, history.h, general.h,
+ emacs_keymap.c, vi_keymap.c, keymaps.c, funmap.c: Made all of
+ these links to /gp/gnu/bash/* to keep them updated.
+ * main.c (initialize_main): Made default be command editing on.
+
+Wed Feb 8 13:32:04 1989 & Smith (randy at hobbes)
+
+ * dbxread.c (read_dbx_symtab): Ignore N_BSLINE on first
+ readthrough.
+
+ * Makefile: Removed convex-dep.c from list of distribution files.
+
+Tue Feb 7 14:06:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c: Added command lists sethistlist and unsethistlist to
+ accesible command lists.
+ (parse_binary_operation): Created to parse a on/1/yes vs. off/0/no
+ spec.
+ (set_command_edit, set_history, set_history_expansion,
+ set_history_write, set_history_size, set_history_filename,
+ command_info, history_info): Created to allow users to control
+ various aspects of command line editing.
+
+ * main.c (symbol_creation_function): Created.
+ (command_line_input, initialize_main): Added rest of stuff
+ necessary for calling bfox' command editing routines under
+ run-time control.
+ * Makefile: Included readline and history source files for command
+ editing; also made arrangements to make sure that the termcap
+ library was available.
+ * symtab.c (make_symbol_completion_list): Created.
+
+Mon Feb 6 16:25:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c: Invented variables to control command editing.
+ command_editing_p, history_expansion_p, history_size,
+ write_history_p, history_filename. Initialized them to default
+ values in initialize_main.
+
+ * infcmd.c (registers_info), infrun.c (signals_info),
+ * main.c (gdb_read_line): Changed name to command_line_input.
+ (readline): Changed name to gdb_readline; added second argument
+ indicating that the read value shouldn't be saved (via malloc).
+ * infcmd.c (registers_info), infrun.c (signals_info), main.c
+ (copying_info), symtab.c (output_source_filename, MORE,
+ list_symbols): Converted to use gdb_readline in place of
+ gdb_read_line.
+
+
+Sun Feb 5 17:34:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * blockframe.c (get_frame_saved_regs): Removed macro expansion
+ that had accidentally been left in the code.
+
+Sat Feb 4 17:54:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * main.c (gdb_read_line, readline): Added function readline and
+ converted gdb_read_line to use it. This was a conversion to the
+ line at a time style of input, in preparation for full command
+ editing.
+
+Fri Feb 3 12:39:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Call end_psymtab at the end of
+ read_dbx_symtab if any psymtab still needs to be completed.
+
+ * config.gdb, sun3-dep.c: Brought these into accord with the
+ actual sun2 status (no floating point period; sun3-dep.c unless
+ has os > 3.0).
+ * m-sun2os2.h: Deleted; not needed.
+
+ * config.gdb: Added a couple of aliases for machines in the
+ script.
+
+ * infrun.c: Added inclusion of aouthdr.h inside of #ifdef UMAX
+ because ptrace needs to know about the a.out header.
+
+ * Makefile: Made dep.o depend on dep.c and config.status only.
+
+ * expread.y: Added declarations of all of the new write_exp_elt
+ functions at the include section in the top.
+
+ * Makefile: Added a YACC definition so that people can use bison
+ if they wish.
+
+ * Makefile: Added rms' XGDB-README to the distribution.
+
+ * Makefile: Added removal of init.o on a "make clean".
+
+Thu Feb 2 16:27:06 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * *-dep.c: Deleted definition of COFF_FORMAT if AOUTHDR was
+ defined since 1) We *may* (recent mail message) want to define
+ AOUTHDR under a basically BSD system, and 2) AOUTHDR is sometimes
+ a typedef in coff encapsulation setups. Also removed #define's of
+ AOUTHDR if AOUTHDR is already defined (inside of coff format).
+ * core.c, dbxread.c: Removed #define's of AOUTHDR if AOUTHDR is
+ already defined (inside of coff format).
+
+Tue Jan 31 12:56:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * GDB 3.1 released.
+
+ * values.c (modify_field): Changed test for endianness to assign
+ to integer and reference character (so that all bits would be
+ defined).
+
+Mon Jan 30 11:41:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * news-dep.c: Deleted inclusion of fcntl.h; just duplicates stuff
+ found in sys/file.h.
+
+ * i386-dep.c: Included default definition of N_SET_MAGIC for
+ COFF_FORMAT.
+
+ * config.gdb: Added checks for several different operating
+ systems.
+
+ * coffread.c (read_struct_type): Put in a flag variable so that
+ one could tell when you got to the end of a structure.
+
+ * sun3-dep.c (core_file_command): Changed #ifdef based on SUNOS4
+ to ifdef based on FPU.
+
+ * infrun.c (restore_inferior_status): Changed error message to
+ "unable to restore previously selected frame".
+
+ * dbxread.c (read_dbx_symtab): Used intermediate variable in error
+ message reporting a bad symbol type. (scan_file_globals,
+ read_ofile_symtab, read_addl_syms): Data type of "type" changed to
+ unsigned char (which is what it is).
+ * i386-dep.c: Removed define of COFF_FORMAT if AOUTHDR is defined.
+ Removed define of a_magic to magic (taken care of by N_MAGIC).
+ (core_file_command): Zero'd core_aouthdr instead of setting magic
+ to zero.
+ * i386-pinsn.c: Changed jcxz == jCcxz in jump table.
+ (putop): Added a case for 'C'.
+ (OP_J): Added code to handle possible masking of PC value on
+ certain kinds of data.
+ m-i386gas.h: Moved COFF_ENCAPSULATE to before inclusion of
+ m-i386.h and defined NAMES_HAVE_UNDERSCORE.
+
+ * coffread.c (unrecrod_misc_function, read_coff_symtab): Added
+ symbol number on which error occured to error output.
+
+Fri Jan 27 11:55:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Makefile: Removed init.c in make clean. Removed it without -f
+ and with leading - in make ?gdb.
+
+Thu Jan 26 15:08:03 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ Changes to get it to work on gould NP1.
+ * dbxread.c (read_dbx_symtab): Included cases for N_NBDATA and
+ N_NBBSS.
+ (psymtab_to_symtab): Changed declaration of hdr to
+ DECLARE_FILE_HEADERS. Changed access to use STRING_TABLE_SIZE and
+ SYMBOL_TABLE_SIZE.
+ * gld-pinsn.c (findframe): Added declaration of framechain() as
+ FRAME_ADDR.
+
+ * coffread.c (read_coff_symtab): Avoided treating typedefs as
+ external symbol definitions.
+
+Wed Jan 25 14:45:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Makefile: Removed reference to alloca.c. If they need it, they
+ can pull alloca.o from the gnu-emacs directory.
+
+ * version.c, gdb.texinfo: Updated version to 3.1 (jumping the gun
+ a bit so that I won't forget when I release).
+
+ * m-sun2.h, m-sun2os2.h, m-sun3os4.h, config.gdb: Modified code so
+ that default includes new sun core, ptrace, and attach-detach.
+ Added defaults for sun 2 os 2.
+
+ Modifications to reset stack limit back to what it used to be just
+ before exec. All mods inside of #ifdef SET_STACK_LIMIT_HUGE.
+ * main.c: Added global variable original_stack_limit.
+ (main): Set original_stack_limit to original stack limit.
+ * inflow.c: Added inclusion of necessary files and external
+ reference to original_stack_limit.
+ (create_inferior): Reset stack limit to original_stack_limit.
+
+ * dbxread.c (read_dbx_symtab): Killed PROFILE_SYMBOLS ifdef.
+
+ * sparc-dep.c (isabranch): Multiplied offset by 4 before adding it
+ to addr to get target.
+
+ * Makefile: Added definition of SHELL to Makefile.
+
+ * m-sun2os4.h: Added code to define NEW_SUN_PTRACE, NEW_SUN_CORE,
+ and ATTACH_DETACH.
+ * sun3-dep.c: Added code to avoid fp regs if we are on a sun2.
+
+Tue Jan 24 17:59:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_array_type): Added function.
+ (read_type): Added call to above instead of inline code.
+
+ * Makefile: Added ${GNU_MALLOC} to the list of dependencies for
+ the executables.
+
+Mon Jan 23 15:08:51 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * gdb.texinfo: Added paragraph to summary describing languages
+ with which gdb can be run. Also added descriptions of the
+ "info-methods" and "add-file" commands.
+
+ * symseg.h: Commented a range type as having TYPE_TARGET_TYPE
+ pointing at the containing type for the range (often int).
+ * dbxread.c (read_range_type): Added code to do actual range types
+ if they are defined. Assumed that the length of a range type is
+ the length of the target type; this is a lie, but will do until
+ somebody gets back to me as to what these silly dbx symbols mean.
+
+ * dbxread.c (read_range_type): Added code to be more picky about
+ recognizing builtins as range types, to treat types defined as
+ subranges of themselves to be subranges of int, and to recognize
+ the char type idiom from dbx as a special case.
+
+Sun Jan 22 01:00:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-vax.h: Removed definition of FUNCTION_HAS_FRAME_POINTER.
+ * blockframe.c (get_prev_frame_info): Removed default definition
+ and use of above. Instead conditionalized checking for leaf nodes
+ on FUNCTION_START_OFFSET (see comment in code).
+
+Sat Jan 21 16:59:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_range_type): Fixed assumption that integer was
+ always type 1.
+
+ * gdb.texinfo: Fixed spelling mistake and added a note in the
+ running section making it clear that users may invoke subroutines
+ directly from gdb.
+
+ * blockframe.c: Setup a default definition for the macro
+ FUNCTION_HAS_FRAME_POINTER.
+ (get_prev_frame_info): Used this macro instead of checking
+ SKIP_PROLOGUE directly.
+ * m-vax.h: Overroad definition; all functions on the vax have
+ frame pointers.
+
+Fri Jan 20 12:25:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * core.c: Added default definition of N_MAGIC for COFF_FORMAT.
+
+ * xgdb.c: Installed a fix to keep the thing from dying when there
+ isn't any frame selected.
+
+ * core.c: Made a change for the UMAX system; needs a different
+ file included if using that core format.
+
+ * Makefile: Deleted duplicate obstack.h in dbxread.c dependency.
+
+ * munch: Modified (much simpler) to cover (I hope) all cases.
+
+ * utils.c (save_cleanups, restore_cleanups): Added functions to
+ allow you to push and pop the chain of cleanups to be done.
+ * defs.h: Declared the new functions.
+ * main.c (catch_errors): Made sure that the only cleanups which
+ would be done were the ones put on the chain *after* the current
+ location.
+
+ * m-*.h (FRAME_CHAIN_VALID): Removed check on pc in the current
+ frame being valid.
+ * blockframe.c (get_prev_frame_info): Made the assumption that if
+ a frame's pc value was within the first object file (presumed to
+ be /lib/crt0.o), that we shouldn't go any higher.
+
+ * infrun.c (wait_for_inferior): Do *not* execute check for stop pc
+ at step_resume_break if we are proceeding over a breakpoint (ie.
+ if trap_expected != 0).
+
+ * Makefile: Added -g to LDFLAGS.
+
+ * m-news.h (POP_FRAME) Fixed typo.
+
+ * printcmd.c (print_frame_args): Modified to print out register
+ params in order by .stabs entry, not by register number.
+
+ * sparc-opcode.h: Changed declaration of (struct
+ arith_imm_fmt).simm to be signed (as per architecture manual).
+ * sparc-pinsn.c (fprint_addr1, print_insn): Forced a cast to an
+ int, so that we really would get signed behaivior (default for sun
+ cc is unsigned).
+
+ * i386-dep.c (i386_get_frame_setup): Replace function with new
+ function provided by pace to fix bug in recognizing prologue.
+
+Thu Jan 19 11:01:22 1989 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * infcmd.c (run_command): Changed error message to "Program not
+ restarted."
+
+ * value.h: Changed "frame" field in value structure to be a
+ FRAME_ADDR (actually CORE_ADDR) so that it could survive across
+ calls.
+
+ * m-sun.h (FRAME_FIND_SAVED_REGS): Fixed a typo.
+
+ * value.h: Added lval: "lval_reg_frame_relative" to indicate a
+ register that must be interpeted relative to a frame. Added
+ single entry to value structure: "frame", used to indicate which
+ frame a relative regnum is relative to.
+ * findvar.c (value_from_register): Modified to correctly setup
+ these fields when needed. Deleted section to fiddle with last
+ register copied on little endian machine; multi register
+ structures will always occupy an integral number of registers.
+ (find_saved_register): Made extern.
+ * values.c (allocate_value, allocate_repeat_value): Zero frame
+ field on creation.
+ * valops.c (value_assign): Added case for lval_reg_frame_relative;
+ copy value out, modify it, and copy it back. Desclared
+ find_saved_register as being external.
+ * value.h: Removed addition of kludgy structure; thoroughly
+ commented file.
+ * values.c (free_value, free_all_values, clear_value_history,
+ set_internalvar, clear_internavars): Killed free_value.
+
+Wed Jan 18 20:09:39 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * value.h: Deleted struct partial_storage; left over from
+ yesterday.
+
+ * findvar.c (value_from_register): Added code to create a value of
+ type lval_reg_partsaved if a value is in seperate registers and
+ saved in different places.
+
+Tue Jan 17 13:50:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * value.h: Added lval_reg_partsaved to enum lval_type and
+ commented enum lval_type. Commented value structure.
+ Added "struct partial_register_saved" to value struct; added
+ macros to deal with structure to value.h.
+ * values.c (free_value): Created; special cases lval_reg_partsaved
+ (which has a pointer to an array which also needs to be free).
+ (free_all_values, clear_value_history, set_internalvar,
+ clear_internalvars): Modified to use free_values.
+
+ * m-sunos4.h: Changed name to sun3os4.h.
+ * m-sun2os4.h, m-sun4os4.h: Created.
+ * config.gdb: Added configuration entries for each of the above.
+ * Makefile: Added into correct lists.
+
+ * Makefile: Added dependencies on a.out.encap.h. Made
+ a.out.encap.h dependent on a.out.gnu.h and dbxread.c dependent on
+ stab.gnu.h.
+
+ * infrun.c, remote.c: Removed inclusion of any a.out.h files in
+ these files; they aren't needed.
+
+ * README: Added comment about bug reporting and comment about
+ xgdb.
+
+ * Makefile: Added note to HPUX dependent section warning about
+ problems if compiled with gcc and mentioning the need to add
+ -Ihp-include to CFLAGS if you compile on those systems. Added a
+ note about needing the GNU nm with compilers *of gdb* that use the
+ coff encapsulate feature also. * hp-include: Made symbolic link
+ over to /gp/gnu/binutils.
+
+ * Makefile: Added TSOBS NTSOBS OBSTACK and REGEX to list of things
+ to delete in "make clean". Also changed "squeakyclean" target as
+ "realclean".
+
+ * findvar.c (value_from_register): Added assignment of VALUE_LVAL
+ to be lval_memory when that is appropriate (original code didn't
+ bother because it assumed that it was working with a pre lval
+ memoried value).
+
+ * expread.y (yylex): Changed to only return type THIS if the
+ symbol "$this" is defined in some block superior or equal to the
+ current expression context block.
+
+Mon Jan 16 13:56:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-*.h (FRAME_CHAIN_VALID): On machines which check the relation
+ of FRAME_SAVED_PC (thisframe) to first_object_file_end (all except
+ gould), make sure that the pc of the current frame also passes (in
+ case someone stops in _start).
+
+ * findvar.c (value_of_register): Changed error message in case of
+ no inferior or core file.
+
+ * infcmd.c (registers_info): Added a check for inferior or core
+ file; error message if not.
+
+ * main.c (gdb_read_line): Modified to take prompt as argument and
+ output it to stdout.
+ * infcmd.c (registers_info, signals_info), main.c (command_loop,
+ read_command_lines, copying_info), symtab.c (decode_line_2,
+ output_source_filename, MORE, list_symbols): Changed calling
+ convention used to call gdb_read_line.
+
+ * infcmd.c, infrun.c, main.c, symtab.c: Changed the name of the
+ function "read_line" to "gdb_read_line".
+ * breakpoint.c: Deleted external referenced to function
+ "read_line" (not needed by code).
+
+Fri Jan 13 12:22:05 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * i386-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE.
+ (N_SET_MAGIC): Defined if not defined by include file.
+ (core_file_command): Used N_SET_MAGIC instead of assignment to
+ a_magic.
+ (exec_file_command): Stuck in a HEADER_SEEK_FD.
+
+ * config.gdb: Added i386-dep.c as depfile for i386gas choice.
+
+ * munch: Added -I. to cc to pick up things included by the param
+ file.
+
+ * stab.gnu.def: Changed name to stab.def (stab.gnu.h needs this name).
+ * Makefile: Changed name here also.
+ * dbxread.c: Changed name of gnu-stab.h to stab.gnu.h.
+
+ * gnu-stab.h: Changed name to stab.gnu.h.
+ * stab.gnu.def: Added as link to binutils.
+ * Makefile: Put both in in the distribution.
+
+Thu Jan 12 11:33:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c: Made which stab.h is included dependent on
+ COFF_ENCAPSULATE; either <stab.h> or "gnu-stab.h".
+ * Makefile: Included gnu-stab.h in the list of files to include in
+ the distribution.
+ * gnu-stab.h: Made a link to /gp/gnu/binutils/stab.h
+
+ * Makefile: Included a.out.gnu.h and m-i386gas.h in list of
+ distribution files.
+ * m-i386gas.h: Changed to include m-i386.h and fiddle with it
+ instead of being a whole new file.
+ * a.out.gnu.h: Made a link to /gp/gnu/binutils/a.out.gnu.h.
+
+ Chris Hanson's changes to gdb for hp Unix.
+ * Makefile: Modified comments on hpux.
+ * hp9k320-dep.c: #define'd WOPR & moved inclusion of signal.h
+ * inflow.c: Moved around declaratiosn of <sys/fcntl.h> and
+ <sys/ioctl.h> inside of USG depends and deleted all SYSV ifdef's
+ (use USG instead).
+ * munch: Modified to accept any number of spaces between the T and
+ the symbol name.
+
+ Pace's changes to gdb to work with COFF_ENCAPSULATE (robotussin):
+ * config.gdb: Added i386gas to targets.
+ * default-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE.
+ (N_SET_MAGIC): Defined if not defined by include file.
+ (core_file_command): Used N_SET_MAGIC instead of assignment to a_magic.
+ (exec_file_command): Stuck in a HEADER_SEEK_FD.
+ * infrun.c, remote.c: Added an include of a.out.encap.h if
+ COFF_ENCAPSULATE defined. This is commented out in these two
+ files, I presume because the definitions aren't used.
+ * m-i386gas.h: Created.
+ * dbxread.c: Included defintions for USG.
+ (READ_FILE_HEADERS): Now uses HEADER_SEEK_FD if it exists.
+ (symbol_file_command): Deleted use of HEADER_SEEK_FD.
+ * core.c: Deleted extra definition of COFF_FORMAT.
+ (N_MAGIC): Defined to be a_magic if not already defined.
+ (validate_files): USed N_MAGIC instead of reading a_magic.
+
+Wed Jan 11 12:51:00 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * remote.c: Upped PBUFSIZ.
+ (getpkt): Added zeroing of c inside loop in case of error retry.
+
+ * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Removed
+ code to not put stuff with debugging symbols in the misc function
+ list. Had been ifdef'd out.
+
+ * gdb.texinfo: Added the fact that the return value for a function
+ is printed if you use return.
+
+ * infrun.c (wait_for_inferior): Removed test in "Have we hit
+ step_resume_breakpoint" for sp values in proper orientation. Was
+ in there for recursive calls in functions without frame pointers
+ and it was screwing up calls to alloca.
+
+ * dbxread.c: Added #ifdef COFF_ENCAPSULATE to include
+ a.out.encap.h.
+ (symbol_file_command): Do HEADER_SEEK_FD when defined.
+ * dbxread.c, core.c: Deleted #ifdef ROBOTUSSIN stuff.
+ * robotussin.h: Deleted local copy (was symlink).
+ * a.out.encap.h: Created symlink to
+ /gp/gnu/binutils/a.out.encap.h.
+ * Makefile: Removed robotussin.h and included a.out.encap.h in
+ list of files.
+
+ * valprint.c (val_print, print_scalar_formatted): Changed default
+ precision of printing float value; now 6 for a float and 16 for a
+ double.
+
+ * findvar.c (value_from_register): Added code to deal with the
+ case where a value is spread over several registers. Still don't
+ deal with the case when some registers are saved in memory and
+ some aren't.
+
+Tue Jan 10 17:04:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * xgdb.c (xgdb_create_window): Removed third arg (XtDepth) to
+ frameArgs.
+
+ * infrun.c (handle_command): Error if signal number is less or
+ equal to 0 or greater or equal to NSIG or a signal number is not
+ provided.
+
+ * command.c (lookup_cmd): Modified to not convert command section
+ of command line to lower case in place (in case it isn't a
+ subcommand, but an argument to a command).
+
+Fri Jan 6 17:57:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c: Changed "text area" to "data area" in comments on
+ N_SETV.
+
+Wed Jan 4 12:29:54 1989 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c: Added definitions of gnu symbol types after inclusion
+ of a.out.h and stab.h.
+
+Mon Jan 2 20:38:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * eval.c (evaluate_subexp): Binary logical operations needed to
+ know type to determine whether second value should be evaluated.
+ Modified to discover type before binup_user_defined_p branch.
+ Also commented "enum noside".
+
+ * Makefile: Changed invocations of munch to be "./munch".
+
+ * gdb.texinfo: Updated to refer to current version of gdb with
+ January 1989 last update.
+
+ * coffread.c (end_symtab): Zero context stack when finishing
+ lexical contexts.
+ (read_coff_symtab): error if context stack 0 in ".ef" else case.
+
+ * m-*.h (FRAME_SAVED_PC): Changed name of argument from "frame" to
+ "FRAME" to avoid problems with replacement of "->frame" part of
+ macro.
+
+ * i386-dep.c (i386_get_frame_setup): Added codestream_get() to
+ move codestream pointer up to the correct location in "subl $X,
+ %esp" case.
+
+Sun Jan 1 14:24:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * valprint.c (val_print): Rewrote routine to print string pointed
+ to by char pointer; was producing incorrect results when print_max
+ was 0.
+
+Fri Dec 30 12:13:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put
+ everything on the misc function list.
+
+ * Checkpointed distribution.
+
+ * Makefile: Added expread.tab.c to the list of things slated for
+ distribution.
+
+Thu Dec 29 10:06:41 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * stack.c (set_backtrace_limit_command, backtrace_limit_info,
+ bactrace_command, _initialize_stack): Removed modifications for
+ limit on backtrace. Piping the backtrace through an interuptable
+ "more" emulation is a better way to do it.
+
+Wed Dec 28 11:43:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * stack.c
+ (set_backtrace_limit_command): Added command to set a limit to the
+ number of frames for a backtrace to print by default.
+ (backtrace_limit_info): To print the current limit.
+ (backtrace_command): To use the limit.
+ (_initialize_stack): To initialize the limit to its default value
+ (30), and add the set and info commands onto the appropriate
+ command lists.
+
+ * gdb.texinfo: Documented changes to "backtrace" and "commands"
+ commands.
+
+ * stack.c (backtrace_command): Altered so that a negative argument
+ would show the last few frames on the stack instead of the first
+ few.
+ (_initialize_stack): Modified help documentation.
+
+ * breakpoint.c (commands_command): Altered so that "commands" with
+ no argument would refer to the last breakpoint set.
+ (_initialize_breakpoint): Modified help documentation.
+
+ * infrun.c (wait_for_inferior): Removed ifdef on Sun4; now you can
+ single step through compiler generated sub calls and will die if
+ you next off of the end of a function.
+
+ * sparc-dep.c (single_step): Fixed typo; "break_insn" ==> "sizeof
+ break_insn".
+
+ * m-sparc.h (INIT_EXTRA_FRAME_INFO): Set the bottom of a stack
+ frame to be the bottom of the stack frame inner from this, if that
+ inner one is a leaf node.
+
+ * dbxread.c (read_dbx_symtab): Check to make sure we don't add a
+ psymtab to it's own dependency list.
+
+ * dbxread.c (read_dbx_symtab): Modified check for duplicate
+ dependencies to catch them correctly.
+
+Tue Dec 27 17:02:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-*.h (FRAME_SAVED_PC): Modified macro to take frame info
+ pointer as argument.
+ * stack.c (frame_info), blockframe.c (get_prev_frame_info),
+ gld-pinsn.c (findframe), m-*.h (SAVED_PC_AFTER_CALL,
+ FRAME_CHAIN_VALID, FRAME_NUM_ARGS): Changed usage of macros to
+ conform to above.
+ * m-sparc.h (FRAME_SAVED_PC), sparc-dep.c (frame_saved_pc):
+ Changed frame_saved_pc to have a frame info pointer as an
+ argument.
+
+ * m-vax.h, m-umax.h, m-npl.h, infrun.c (wait_for_inferior),
+ blockframe.c (get_prev_frame_info): Modified SAVED_PC_AFTER_CALL
+ to take a frame info pointer as an argument.
+
+ * blockframe.c (get_prev_frame_info): Altered the use of the
+ macros FRAME_CHAIN, FRAME_CHAIN_VALID, and FRAME_CHAIN_COMBINE to
+ use frame info pointers as arguments instead of frame addresses.
+ * m-vax.h, m-umax.h, m-sun3.h, m-sun3.h, m-sparc.h, m-pn.h,
+ m-npl.h, m-news.h, m-merlin.h, m-isi.h, m-hp9k320.h, m-i386.h:
+ Modified definitions of the above macros to suit.
+ * m-pn.h, m-npl.h, gould-dep.c (findframe): Modified findframe to
+ use a frame info argument; also fixed internals (wouldn't work
+ before).
+
+ * m-sparc.h: Cosmetic changes; reordered some macros and made sure
+ that nothing went over 80 lines.
+
+Thu Dec 22 11:49:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * Version 3.0 released.
+
+ * README: Deleted note about changing -lobstack to obstack.o.
+
+Wed Dec 21 11:12:47 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-vax.h (SKIP_PROLOGUE): Now recognizes gcc prologue also.
+
+ * blockframe.c (get_prev_frame_info): Added FUNCTION_START_OFFSET
+ to result of get_pc_function_start.
+ * infrun.c (wait_for_inferior): Same.
+
+ * gdb.texinfo: Documented new "step" and "next" behavior in
+ functions without line number information.
+
+Tue Dec 20 18:00:45 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * infcmd.c (step_1): Changed behavior of "step" or "next" in a
+ function witout line number information. It now sets the step
+ range around the function (to single step out of it) using the
+ misc function vector, warns the user, and continues.
+
+ * symtab.c (find_pc_line): Zero "end" subsection of returned
+ symtab_and_line if no symtab found.
+
+Mon Dec 19 17:44:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * i386-pinsn.c (OP_REG): Added code from pace to streamline
+ disassembly and corrected types.
+ * i386-dep.c
+ (i386_follow_jump): Code added to follow byte and word offset
+ branches.
+ (i386_get_frame_setup): Expanded to deal with more wide ranging
+ function prologue.
+ (i386_frame_find_saved_regs, i386_skip_prologue): Changed to use
+ i386_get_frame_setup.
+
+
+Sun Dec 18 11:15:03 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h: Deleted definition of SUN4_COMPILER_BUG; was designed
+ to avoid something that I consider a bug in our code, not theirs,
+ and which I fixed earlier. Also deleted definition of
+ CANNOT_USE_ARBITRARY_FRAME; no longer used anywhere.
+ FRAME_SPECIFICATION_DYADIC used instead.
+
+ * infrun.c (wait_for_inferior): On the sun 4, if a function
+ doesn't have a prologue, a next over it single steps into it.
+ This gets around the problem of a "call .stret4" at the end of
+ functions returning structures.
+ * m-sparc.h: Defined SUN4_COMPILER_FEATURE.
+
+ * main.c (copying_info): Seperated the last printf into two
+ printfs. The 386 compiler will now handle it.
+
+ * i386-pinsn.c, i386-dep.c: Moved print_387_control_word,
+ print_387_status_word, print_387_status, and i386_float_info to
+ dep.c Also included reg.h in dep.c.
+
+Sat Dec 17 15:31:38 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * main.c (source_command): Don't close instream if it's null
+ (indicating execution of a user-defined command).
+ (execute_command): Set instream to null before executing
+ commands and setup clean stuff to put it back on error.
+
+ * inflow.c (terminal_inferior): Went back to not checking the
+ ioctl returns; there are some systems when this will simply fail.
+ It seems that, on most of these systems, nothing bad will happen
+ by that failure.
+
+ * values.c (value_static_field): Fixed dereferencing of null
+ pointer.
+
+ * i386-dep.c (i386_follow_jump): Modified to deal with
+ unconditional byte offsets also.
+
+ * dbxread.c (read_type): Fixed typo in function type case of switch.
+
+ * infcmd.c (run_command): Does not prompt to restart if command is
+ not from a tty.
+
+Fri Dec 16 15:21:58 1988 Randy Smith (randy at calvin)
+
+ * gdb.texinfo: Added a third option under the "Cannot Insert
+ Breakpoints" workarounds.
+
+ * printcmd.c (display_command): Don't do the display unless there
+ is an active inferior; only set it.
+
+ * findvar.c (value_of_register): Added an error check for calling
+ this when the inferior isn't active and a core file isn't being
+ read.
+
+ * config.gdb: Added reminder about modifying REGEX in the
+ makefile for the 386.
+
+ * i386-pinsn.c, i386-dep.c: Moved m-i386.h helper functions over
+ to i386-dep.c.b
+
+Thu Dec 15 14:04:25 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * README: Added a couple of notes about compiling gdb with itself.
+
+ * breakpoint.c (set_momentary_breakpoint): Only takes FRAME_FP of
+ frame if frame is non-zero.
+
+ * printcmd.c (print_scalar_formatted): Implemented /g size for
+ hexadecimal format on machines without an 8 byte integer type. It
+ seems to be non-trivial to implement /g for other formats.
+ (decode_format): Allowed hexadecimal format to make it through /g
+ fileter.
+
+Wed Dec 14 13:27:04 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * expread.y: Converted all calls to write_exp_elt from the parser
+ to calls to one of write_exp_elt_{opcode, sym, longcst, dblcst,
+ char, type, intern}. Created all of these routines. This gets
+ around possible problems in passing one of these things in one ear
+ and getting something different out the other. Eliminated
+ SUN4_COMPILER_BUG ifdef's; they are now superfluous.
+
+ * symmisc.c (free_all_psymtabs): Reinited partial_symtab_list to 0.
+ (_initialize_symmisc): Initialized both symtab_list and
+ partial_symtab_list.
+
+ * dbxread.c (start_psymtab): Didn't allocate anything on
+ dependency list.
+ (end_psymtab): Allocate dependency list on psymbol obstack from
+ local list.
+ (add_psymtab_dependency): Deleted.
+ (read_dbx_symtab): Put dependency on local list if it isn't on it
+ already.
+
+ * symtab.c: Added definition of psymbol_obstack.
+ * symtab.h: Added declaration of psymbol_obstack.
+ * symmisc.c (free_all_psymtabs): Added freeing and
+ reinitionaliztion of psymbol_obstack.
+ * dbxread.c (free_all_psymbols): Deleted.
+ (start_psymtab, end_psymtab,
+ process_symbol_for_psymtab): Changed most allocation
+ of partial symbol stuff to be off of psymbol_obstack.
+
+ * symmisc.c (free_psymtab, free_all_psymtabs): Deleted
+ free_psymtab subroutine.
+
+ * symtab.h: Removed num_includes and includes from partial_symtab
+ structure; no longer needed now that all include files have their
+ own psymtab.
+ * dbxread.c (start_psymtab): Eliminated initialization of above.
+ (end_psymtab): Eliminated finalization of above; get
+ includes from seperate list.
+ (read_dbx_symtab): Moved includes from psymtab list to
+ their own list; included in call to end_psymtab.
+ * symmisc.c (free_psymtab): Don't free includes.
+
+Tue Dec 13 14:48:14 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * i386-pinsn.c: Reformatted entire file to correspond to gnu
+ software indentation conventions.
+
+ * sparc-dep.c (skip_prologue): Added capability of recognizign
+ stores of input register parameters into stack slots.
+
+ * sparc-dep.c: Added an include of sparc-opcode.h.
+ * sparc-pinsn.c, sparc-opcode.h: Moved insn_fmt structures and
+ unions from pinsn.c to opcode.h.
+ * sparc-pinsn.c, sparc-dep.c (isabranch, skip_prologue): Moved
+ this function from pinsn.c to dep.c.
+
+ * Makefile: Put in warnings about compiling with gcc (non-ansi
+ include files) and compiling with shared libs on Sunos 4.0 (can't
+ debug something that's been compiled that way).
+
+ * sparc-pinsn.c: Put in a completely new file (provided by
+ Tiemann) to handle floating point disassembly, load and store
+ instructions, and etc. better. Made the modifications this file
+ (ChangeLog) list for sparc-pinsn.c again.
+
+ * symtab.c (output_source_filename): Included "more" emulation hack.
+
+ * symtab.c (output_source_filename): Initialized COLUMN to 0.
+ (sources_info): Modified to not print out a line for
+ all of the include files within a partial symtab (since
+ they have pst's of their own now). Also modified to
+ make a distinction between those pst's read in and
+ those not.
+
+ * infrun.c: Included void declaration of single_step() if it's
+ going to be used.
+ * sparc-dep.c (single_step): Moved function previous to use of it.
+
+ * Makefile: Took removal of expread.tab.c out of make clean entry
+ and put it into a new "squeakyclean" entry.
+
+Mon Dec 12 13:21:02 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * sparc-pinsn.c (skip_prologue): Changed a struct insn_fmt to a
+ union insn_fmt.
+
+ * inflow.c (terminal_inferior): Checked *all* return codes from
+ ioctl's and fcntl's in routine.
+
+ * inflow.c (terminal_inferior): Added check for sucess of
+ TIOCSPGRP ioctl call. Just notifies if bad.
+
+ * dbxread.c (symbol_file_command): Close was getting called twice;
+ once directly and once through cleanup. Killed the direct call.
+
+Sun Dec 11 19:40:40 1988 & Smith (randy at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): Deleted spurious printing of "=" from
+ TYPE_CODE_REF case.
+
+Sat Dec 10 16:41:07 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c: Changed allocation of psymbols from using malloc and
+ realloc to using obstacks. This means they aren't realloc'd out
+ from under the pointers to them.
+
+Fri Dec 9 10:33:24 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * sparc-dep.c inflow.c core.c expread.y command.c infrun.c
+ infcmd.c dbxread.c symmisc.c symtab.c printcmd.c valprint.c
+ values.c source.c stack.c findvar.c breakpoint.c blockframe.c
+ main.c: Various cleanups inspired by "gcc -Wall" (without checking
+ for implicit declarations).
+
+ * Makefile: Cleaned up some more.
+
+ * valops.c, m-*.h (FIX_CALL_DUMMY): Modified to take 5 arguments
+ as per what sparc needs (programming for a superset of needed
+ args).
+
+ * dbxread.c (process_symbol_for_psymtab): Modified to be slightly
+ more picky about what it puts on the list of things *not* to be
+ put on the misc function list. When/if I shift everything over to
+ being placed on the misc_function_list, this will go away.
+
+ * inferior.h, infrun.c: Added fields to save in inferior_status
+ structure.
+
+ * maketarfile: Deleted; functionality is in Makefile now.
+
+ * infrun.c (wait_for_inferior): Modified algorithm for determining
+ whether or not a single-step was through a subroutine call. See
+ comments at top of file.
+
+ * dbxread.c (read_dbx_symtab): Made sure that the IGNORE_SYMBOL
+ macro would be checked during initial readin.
+
+ * dbxread.c (read_ofile_symtab): Added macro GCC_COMPILED_FLAG_SYMBOL
+ into dbxread.c to indicate what string in a local text symbol will
+ indicate a file compiled with gcc. Defaults to "gcc_compiled.".
+
+Thu Dec 8 11:46:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (FRAME_FIND_SAVED_REGS): Cleaned up a little to take
+ advantage of the new frame cache system.
+
+ * inferior.h, infrun.c, valops.c, valops.c, infcmd.c: Changed
+ mechanism to save inferior status over calls to inferior (eg.
+ call_function); implemented save_inferior_info and
+ restore_inferior_info.
+
+ * blockframe.c (get_prev_frame): Simplified this by a direct call
+ to get_prev_frame_info.
+
+ * frame.h, stack.c, printcmd.c, m-sparc.h, sparc-dep.c: Removed
+ all uses of frame_id_from_addr. There are short routines like it
+ still in frame_saved_pc (m-sparc.h) and parse_frame_spec
+ (stack.c). Eventually the one in frame_saved_pc will go away.
+
+ * infcmd.c, sparc-dep.c: Implemented a new mechanism for
+ re-selecting the selected frame on return from a call.
+
+ * blockframe.c, stack.c, findvar.c, printcmd.c, m-*.h: Changed
+ all routines and macros that took a "struct frame_info" as an
+ argument to take a "struct frame_info *". Routines: findarg,
+ framechain, print_frame_args, FRAME_ARGS_ADDRESS,
+ FRAME_STRUCT_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS,
+ FRAME_FIND_SAVED_REGS.
+
+ * frame.h, stack.c, printcmd.c, infcmd.c, findvar.c, breakpoint.c,
+ blockframe.c, xgdb.c, i386-pinsn.c, gld-pinsn.c, m-umax.h,
+ m-sun2.h, m-sun3.h, m-sparc.h, m-pn.h, m-npl.h, m-news.h,
+ m-merlin.h, m-isi.h, m-i386.h, m-hp9k320.h: Changed routines to
+ use "struct frame_info *" internally.
+
+Wed Dec 7 12:07:54 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * frame.h, blockframe.c, m-sparc.h, sparc-dep.c: Changed all calls
+ to get_[prev_]frame_cache_item to get_[prev_]frame_info.
+
+ * blockframe.c: Elminated get_frame_cache_item and
+ get_prev_frame_cache_item; functionality now taken care of by
+ get_frame_info and get_prev_frame_info.
+
+ * blockframe.c: Put allocation on an obstack and eliminated fancy
+ reallocation routines, several variables, and various nasty
+ things.
+
+ * frame.h, stack.c, infrun.c, blockframe.c, sparc-dep.c: Changed
+ type FRAME to be a typedef to "struct frame_info *". Had to also
+ change routines that returned frame id's to return the pointer
+ instead of the cache index.
+
+ * infcmd.c (finish_command): Used proper method of getting from
+ function symbol to start of function. Was treating a symbol as a
+ value.
+
+ * blockframe.c, breakpoint.c, findvar.c, infcmd.c, stack.c,
+ xgdb.c, i386-pinsn.c, frame.h, m-hp9k320.h, m-i386.h, m-isi.h,
+ m-merlin.h, m-news.h, m-npl.h, m-pn.h, m-sparc.h, m-sun2.h,
+ m-sun3.h, m-umax.h: Changed get_frame_info and get_prev_frame_info
+ to return pointers instead of structures.
+
+ * blockframe.c (get_pc_function_start): Modified to go to misc
+ function table instead of bombing if pc was in a block without a
+ containing function.
+
+ * coffread.c: Dup'd descriptor passed to read_coff_symtab and
+ fdopen'd it so that there wouldn't be multiple closes on the same
+ fd. Also put (fclose, stream) on the cleanup list.
+
+ * printcmd.c, stack.c: Changed print_frame_args to take a
+ frame_info struct as argument instead of the address of the args
+ to the frame.
+
+ * m-i386.h (STORE_STRUCT_RETURN): Decremented sp by sizeof object
+ to store (an address) rather than 1.
+
+ * dbxread.c (read_dbx_symtab): Set first_object_file_end in
+ read_dbx_symtab (oops).
+
+ * coffread.c (fill_in_vptr_fieldno): Rewrote TYPE_BASECLASS as
+ necessary.
+
+Tue Dec 6 13:03:43 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * coffread.c: Added fake support for partial_symtabs to allow
+ compilation and execution without there use.
+ * inflow.c: Added a couple of minor USG mods.
+ * munch: Put in appropriate conditionals so that it would work on
+ USG systems.
+ * Makefile: Made regex.* handled same as obstack.*; made sure tar
+ file included everything I wanted it to include (including
+ malloc.c).
+
+ * dbxread.c (end_psymtab): Create an entry in the
+ partial_symtab_list for each subfile of the .o file just read in.
+ This allows a "list expread.y:10" to work when we haven't read in
+ expread.o's symbol stuff yet.
+
+ * symtab.h, dbxread.c (psymtab_to_symtab): Recognize pst->ldsymlen
+ == 0 as indicating a dummy psymtab, only in existence to cause the
+ dependency list to be read in.
+
+ * dbxread.c (sort_symtab_syms): Elminated reversal of symbols to
+ make sure that register debug symbol decls always come before
+ parameter symbols. After mod below, this is not needed.
+
+ * symtab.c (lookup_block_symbol): Take parameter type symbols
+ (LOC_ARG or LOC_REGPARM) after any other symbols which match.
+
+ * dbxread.c (read_type): When defining a type in terms of some
+ other type and the other type is supposed to have a pointer back
+ to this specific kind of type (pointer, reference, or function),
+ check to see if *that* type has been created yet. If it has, use
+ it and fill in the appropriate slot with a pointer to it.
+
+Mon Dec 5 11:25:04 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * symmisc.c: Eliminated existence of free_inclink_symtabs and
+ init_free_inclink_symtabs; they aren't called from anywhere, and
+ if they were they could disrupt gdb's data structure badly
+ (elimination of struct type's which values that stick around past
+ elimination of inclink symtabs).
+
+ * dbxread.c (symbol_file_command): Fixed a return pathway out of
+ the routine to do_cleanups before it left.
+
+ * infcmd.c (set_environment_command), gdb.texinfo: Added
+ capability to set environmental variable values to null.
+
+ * gdb.texinfo: Modified doc on "break" without args slightly.
+
+Sun Dec 4 17:03:16 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c (symbol_file_command): Added check; if there weren't
+ any debugging symbols in the file just read, the user is warned.
+
+ * infcmd.c: Commented set_environment_command (a little).
+
+ * createtags: Cleaned up and commented.
+
+ * Makefile: Updated dependency list and cleaned it up somewhat
+ (used macros, didn't make .o files depend on .c files, etc.)
+
+Fri Dec 2 11:44:46 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * value.h, values.c, infcmd.c, valops.c, m-i386.h, m-sparc.h,
+ m-merlin.h, m-npl.h, m-pn.h, m-umax.h, m-vax.h, m-hp9k320.h,
+ m-isi.h, m-news.h, m-sun2.h, m-sun3.h: Cleaned up dealings with
+ functions returning structures. Specifically: Added a function
+ called using_struct_return which indicates whether the function
+ being called is using the structure returning conventions or it is
+ using the value returning conventions on that machine. Added a
+ macro, STORE_STRUCT_RETURN to store the address of the structure
+ to be copied into wherever it's supposed to go, and changed
+ call_function to handle all of this correctly.
+
+ * symseg.h, symtab.h, dbxread.c: Added hooks to recognize an
+ N_TEXT symbol with name "*gcc-compiled*" as being a flag
+ indicating that a file had been compiled with gcc and setting a
+ flag in all blocks produced during processing of that file.
+
+Thu Dec 1 13:54:29 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (PUSH_DUMMY_FRAME): Saved 8 less than the current pc,
+ as POP_FRAME and sparc return convention restore the pc to 8 more
+ than the value saved.
+
+ * valops.c, printcmd.c, findvar.c, value.h: Added the routine
+ value_from_register, to access a specific register of a specific
+ frame as containing a specific type, and used it in read_var_value
+ and print_frame_args.
+
+Wed Nov 30 17:39:50 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * dbxread.c (read_number): Will accept either the argument passed
+ as an ending character, or a null byte as an ending character.
+
+ * Makefile, createtags: Added entry to create tags for gdb
+ distribution which will make sure currently configured machine
+ dependent files come first in the list.
+
+Wed Nov 23 13:27:34 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * stack.c, infcmd.c, sparc-dep.c: Modified record_selected_frame
+ to work off of frame address.
+
+ * blockframe.c (create_new_frame, get_prev_frame_cache_item):
+ Added code to reset pointers within frame cache if it must be
+ realloc'd.
+
+ * dbxread.c (read_dbx_symtab): Added in optimization comparing
+ last couple of characters instead of first couple to avoid
+ strcmp's in read_dbx_symtab (recording extern syms in misc
+ functions or not). 1 call to strlen is balanced out by many fewer
+ calls to strcmp.
+
+Tue Nov 22 16:40:14 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Took out optimization for ignoring
+ LSYM's; was disallowing typedefs. Silly me.
+
+ * Checkpointed distribution (mostly for sending to Tiemann).
+
+ * expression.h: Added BINOP_MIN and BINOP_MAX operators for C++.
+ * symseg.h: Included flags for types having destructors and
+ constructors, and flags being defined via public and via
+ virtual paths. Added fields NEXT_VARIANT, N_BASECLASSES,
+ and BASECLASSES to this type (tr: Changed types from
+ having to be derived from a single baseclass to a multiple
+ base class).
+ * symtab.h: Added macros to access new fields defined in symseg.h.
+ Added decl for lookup_basetype_type.
+ * dbxread.c
+ (condense_addl_misc_bunches): Function added to condense the misc
+ function bunches added by reading in a new .o file.
+ (read_addl_syms): Function added to read in symbols
+ from a new .o file (incremental linking).
+ (add_file_command): Command interface function to indicate
+ incrmental linking of a new .o file; this now calls
+ read_addl_syms and condense_addl_misc_bunches.
+ (define_symbol): Modified code to handle types defined from base
+ types which were not known when the derived class was
+ output.
+ (read_struct_type): Modified to better handle description of
+ struct types as derived types. Possibly derived from
+ several different base classes. Also added new code to
+ mark definitions via virtual paths or via public paths.
+ Killed seperate code to handle classes with destructors
+ but without constructors and improved marking of classes
+ as having destructors and constructors.
+ * infcmd.c: Modified call to val_print (one more argument).
+ * symtab.c (lookup_member_type): Modified to deal with new
+ structure in symseg.h.
+ (lookup_basetype_type): Function added to find or construct a type
+ ?derived? from the given type.
+ (decode_line_1): Modified to deal with new type data structures.
+ Modified to deal with new number of args for
+ decode_line_2.
+ (decode_line_2): Changed number of args (?why?).
+ (init_type): Added inits for new C++ fields from
+ symseg.h.
+ *valarith.c
+ (value_x_binop, value_binop): Added cases for BINOP_MIN &
+ BINOP_MAX.
+ * valops.c
+ (value_struct_elt, check_field, value_struct_elt_for_address):
+ Changed to deal with multiple possible baseclasses.
+ (value_of_this): Made SELECTED_FRAME an extern variable.
+ * valprint.c
+ (val_print): Added an argument DEREF_REF to dereference references
+ automatically, instead of printing them like pointers.
+ Changed number of arguments in recursive calls to itself.
+ Changed to deal with varibale numbers of base classes.
+ (value_print): Changed number of arguments to val_print. Print
+ type of value also if value is a reference.
+ (type_print_derivation_info): Added function to print out
+ derivation info a a type.
+ (type_print_base): Modified to use type_print_derivation_info and
+ to handle multiple baseclasses.
+
+Mon Nov 21 10:32:07 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * inflow.c (term_status_command): Add trailing newline to output.
+
+ * sparc-dep.c (do_save_insn, do_restore_insn): Saved
+ "stop_registers" over the call for the sake of normal_stop and
+ run_stack_dummy.
+
+ * m-sparc.h (EXTRACT_RETURN_VALUE): Put in parenthesis to force
+ addition of 8 to the int pointer, not the char pointer.
+
+ * sparc-pinsn.c (print_addr1): Believe that I have gotten the
+ syntax right for loads and stores as adb does it.
+
+ * symtab.c (list_symbols): Turned search for match on rexegp into
+ a single loop.
+
+ * dbxread.c (psymtab_to_symtab): Don't read it in if it's already
+ been read in.
+
+ * dbxread.c (psymtab_to_symtab): Changed error to fatal in
+ psymtab_to_symtab.
+
+ * expread.y (parse_number): Fixed bug which treated 'l' at end of
+ number as '0'.
+
+Fri Nov 18 13:57:33 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Was
+ being foolish and using pointers into an array I could realloc.
+ Converted these pointers into integers.
+
+Wed Nov 16 11:43:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (POP_FRAME): Made the new frame be PC_ADJUST of the
+ old frame.
+
+ * i386-pinsn.c, m-hp9k320.h, m-isi.h, m-merlin.h, m-news.h,
+ m-npl.h, m-pn.h, m-sparc.h, m-sun2.h, m-sun3.h, m-umax.h, m-vax.h:
+ Modified POP_FRAME to use the current frame instead of
+ read_register (FP_REGNUM) and to flush_cached_frames before
+ setting the current frame. Also added a call to set the current
+ frame in those POP_FRAMEs that didn't have it.
+
+ * infrun.c (wait_for_inferior): Moved call to set_current_frame up
+ to guarrantee that the current frame will always be set when a
+ POP_FRAME is done.
+
+ * infrun.c (normal_stop): Added something to reset the pc of the
+ current frame (was incorrect because of DECR_PC_AFTER_BREAK).
+
+ * valprint.c (val_print): Changed to check to see if a string was
+ out of bounds when being printed and to indicate this if so.
+
+ * convex-dep.c (read_inferior_memory): Changed to return the value
+ of errno if the call failed (which will be 0 if the call
+ suceeded).
+
+Tue Nov 15 10:17:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * infrun.c (wait_for_inferior): Two changes: 1) Added code to
+ not trigger the step breakpoint on recursive calls to functions
+ without frame info, and 2) Added calls to distinguish recursive
+ calls within a function without a frame (which next/nexti might
+ wish to step over) from jumps to the beginning of a function
+ (which it generally doesn't).
+
+ * m-sparc.h (INIT_EXTRA_FRAME_INFO): Bottom set correctly for leaf
+ parents.
+
+ * blockframe.c (get_prev_frame_cache_item): Put in mod to check
+ for a leaf node (by presence or lack of function prologue). If
+ there is a leaf node, it is assumed that SAVED_PC_AFTER_CALL is
+ valid. Otherwise, FRAME_SAVED_PC or read_pc is used.
+
+ * blockframe.c, frame.h: Did final deletion of unused routines and
+ commented problems with getting a pointer into the frame cache in
+ the frame_info structure comment.
+
+ * blockframe.c, frame.h, stack.c: Killed use of
+ frame_id_from_frame_info; used frame_id_from_addr instead.
+
+ * blockframe.c, frame.h, stack.c, others (oops): Combined stack
+ cache and frame info structures.
+
+ * blockframe.c, sparc-dep.c, stack.c: Created the function
+ create_new_frame and used it in place of bad calls to
+ frame_id_from_addr.
+
+ * blockframe.c, inflow.c, infrun.c, i386-pinsn.c, m-hp9k320.h,
+ m-npl.h, m-pn.h, m-sparc.h, m-sun3.h, m-vax.h, default-dep.c,
+ convex-dep.c, gould-dep.c, hp9k320-dep.c, news-dep.c, sparc-dep.c,
+ sun3-dep.c, umax-dep.c: Killed use of
+ set_current_Frame_by_address. Used set_current_frame
+ (create_new_frame...) instead.
+
+ * frame.h: Killed use of FRAME_FP_ID.
+
+ * infrun.c, blockframe.c: Killed select_frame_by_address. Used
+ select_frame (get_current_frame (), 0) (which was correct in all
+ cases that we need to worry about.
+
+Mon Nov 14 14:19:32 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * frame.h, blockframe.c, stack.c, m-sparc.h, sparc-dep.c: Added
+ mechanisms to deal with possible specification of frames
+ dyadically.
+
+Sun Nov 13 16:03:32 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
+
+ * ns32k-opcode.h: Add insns acbw, acbd.
+
+Sun Nov 13 15:09:58 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * breakpoint.c: Changed breakpoint structure to use the address of
+ a given frame (constant across inferior runs) as the criteria for
+ stopping instead of the frame ident (which varies across inferior
+ calls).
+
+Fri Nov 11 13:00:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * gld-pinsn.c (findframe): Modified to work with the new frame
+ id's. Actually, it looks as if this routine should be called with
+ an address anyway.
+
+ * findvar.c (find_saved_register): Altered bactrace loop to work
+ off of frames and not frame infos.
+
+ * frame.h, blockframe.c, stack.c, sparc-dep.c, m-sparc.h: Changed
+ FRAME from being the address of the frame to being a simple ident
+ which is an index into the frame_cache_item list.
+ * convex-dep.c, default-dep.c, gould-dep.c, hp9k320-dep.c,
+ i386-pinsn.c, inflow.c, infrun.c, news-dep.c, sparc-dep.c,
+ sun3-dep.c, umax-dep.c, m-hp9k320.h, m-npl.h, m-pn.h, m-sparc.h,
+ m-sun3.h, m-vax.h: Changed calls of the form set_current_frame
+ (read_register (FP_REGNUM)) to set_current_frame_by_address (...).
+
+Thu Nov 10 16:57:57 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * frame.h, blockframe.c, gld-pinsn.c, sparc-dep.c, stack.c,
+ infrun.c, findvar.c, m-sparc.h: Changed the FRAME type to be
+ purely an identifier, using FRAME_FP and FRAME_FP_ID to convert
+ back and forth between the two. The identifier is *currently*
+ still the frame pointer value for that frame.
+
+Wed Nov 9 17:28:14 1988 Chris Hanson (cph at kleph)
+
+ * m-hp9k320.h (FP_REGISTER_ADDR): Redefine this to return
+ difference between address of given FP register, and beginning of
+ `struct user' that it occurs in.
+
+ * hp9k320-dep.c (core_file_command): Fix sign error in size
+ argument to myread. Change buffer argument to pointer; was
+ copying entire structure.
+ (fetch_inferior_registers, store_inferior_registers): Replace
+ occurrences of `FP_REGISTER_ADDR_DIFF' with `FP_REGISTER_ADDR'.
+ Flush former definition.
+
+Wed Nov 9 12:11:37 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * xgdb.c: Killed include of initialize.h.
+
+ * Pulled in xgdb.c from the net.
+
+ * Checkpointed distribution (to provide to 3b2 guy).
+
+ * coffread.c, dbxread.c, symmisc.c, symtab.c, symseg.h: Changed
+ format of table of line number--pc mapping information. Can
+ handle negative pc's now.
+
+ * command.c: Deleted local copy of savestring; code in utils.c is
+ identical.
+
+Tue Nov 8 11:12:16 1988 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * gdb.texinfo: Added documentation for shell escape.
+
+Mon Nov 7 12:27:16 1988 Randall Smith (randy at sugar-bombs.ai.mit.edu)
+
+ * command.c: Added commands for shell escape.
+
+ * core.c, dbxread.c: Added ROBOTUSSIN mods.
+
+ * Checkpointed distribution.
+
+ * printcmd.c (x_command): Yanked error if there is no memory to
+ examine (could be looking at executable straight).
+
+ * sparc-pinsn.c (print_insn): Amount to leftshift sethi imm by is
+ now 10 (matches adb in output).
+
+ * printcmd.c (x_command): Don't attempt to set $_ & $__ if there
+ is no last_examine_value (can happen if you did an x/0).
+
+Fri Nov 4 13:44:49 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * printcmd.c (x_command): Error if there is no memory to examine.
+
+ * gdb.texinfo: Added "cont" to the command index.
+
+ * sparc-dep.c (do_save_insn): Fixed typo in shift amount.
+
+ * m68k-opcode.h: Fixed opcodes for 68881.
+
+ * breakpoint.c, infcmd.c, source.c: Changed defaults in several
+ places for decode_line_1 to work off of the default_breakpoint_*
+ values instead of current_source_* values (the current_source_*
+ values are off by 5 or so because of listing defaults).
+
+ * stack.c (frame_info): ifdef'd out FRAME_SPECIFCATION_DYADIC in
+ the stack.c module. If I can't do this right, I don't want to do
+ it at all. Read the comment there for more info.
+
+Mon Oct 31 16:23:06 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * gdb.texinfo: Added documentation on the "until" command.
+
+Sat Oct 29 17:47:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * breakpoint.c, infcmd.c: Added UNTIL_COMMAND and subroutines of
+ it.
+
+ * breakpoint.c, infcmd.c, infrun.c: Added new field to breakpoint
+ structure (silent, indicating a silent breakpoint), and modified
+ breakpoint_stop_status and things that read it's return value to
+ understand it.
+
+Fri Oct 28 17:45:33 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c, symmisc.c: Assorted speedups for readin, including
+ special casing most common symbols, and doing buffering instead of
+ calling malloc.
+
+Thu Oct 27 11:11:15 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * stack.c, sparc-dep.c, m-sparc.h: Modified to allow "info frame"
+ to take two arguments on the sparc and do the right thing with
+ them.
+
+ * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put
+ stuff to put only symbols that didn't have debugging info on the
+ misc functions list back in.
+
+Wed Oct 26 10:10:32 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * valprint.c (type_print_varspec_suffix): Added check for
+ TYPE_LENGTH(TYPE_TARGET_TYPE(type)) > 0 to prevent divide by 0.
+
+ * printcmd.c (print_formatted): Added check for VALUE_REPEATED;
+ value_print needs to be called for that.
+
+ * infrun.c (wait_for_inferior): Added break when you decide to
+ stop on a null function prologue rather than continue stepping.
+
+ * m-sun3.h: Added explanatory comment to REGISTER_RAW_SIZE.
+
+ * expread.y (parse_c_1): Initialized paren_depth for each parse.
+
+Tue Oct 25 14:19:38 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * valprint.c, coffread.c, dbxread.c: Enum constant values in enum
+ type now accessed through TYPE_FIELD_BITPOS.
+
+ * dbxread.c (process_symbol_for_psymtab): Added code to deal with
+ possible lack of a ":" in a debugging symbol (do nothing).
+
+ * symtab.c (decode_line_1): Added check in case of all numbers for
+ complete lack of symbols.
+
+ * source.c (select_source_symtab): Made sure that this wouldn't
+ bomb on complete lack of symbols.
+
+Mon Oct 24 12:28:29 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h, findvar.c: Ditched REGISTER_SAVED_UNIQUELY and based
+ code on REGISTER_IN_WINDOW_P and HAVE_REGISTER_WINDOWS. This will
+ break when we find a register window machine which saves the
+ window registers within the context of an inferior frame.
+
+ * sparc-dep.c (frame_saved_pc): Put PC_ADJUST return back in for
+ frame_saved_pc. Seems correct.
+
+ * findvar.c, m-sparc.h: Created the macro REGISTER_SAVED_UNIQUELY
+ to handle register window issues (ie. that find_saved_register
+ wasn't checking the selected frame itself for shit).
+
+ * sparc-dep.c (core_file_command): Offset target of o & g register
+ bcopy by 1 to hit correct registers.
+
+ * m-sparc.h: Changed STACK_END_ADDR.
+
+Sun Oct 23 19:41:51 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * sparc-dep.c (core_file_command): Added in code to get the i & l
+ registers from the stack in the corefile, and blew away some wrong
+ code to get i & l from inferior.
+
+Fri Oct 21 15:09:19 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (PUSH_DUMMY_FRAME): Saved the value of the RP register
+ in the location reserved for i7 (in the created frame); this way
+ the rp value won't get lost. The pc (what we put into the rp in
+ this routine) gets saved seperately, so we loose no information.
+
+ * sparc-dep.c (do_save_insn & do_restore_insn): Added a wrapper to
+ preserve the proceed status state variables around each call to
+ proceed (the current frame was getting munged because this wasn't
+ being done).
+
+ * m-sparc.h (FRAME_FIND_SAVED_REGS): Fix bug: saved registers
+ addresses were being computed using absolute registers number,
+ rather than numbers relative to each group of regs.
+
+ * m-sparc.h (POP_FRAME): Fixed a bug (I hope) in the context
+ within which saved reg numbers were being interpetted. The
+ values to be restored were being gotten in the inferior frame, and
+ the restoring was done in the superior frame. This means that i
+ registers must be restored into o registers.
+
+ * sparc-dep.c (do_restore_insn): Modified to take a pc as an
+ argument, instead of a raw_buffer. This matches (at least it
+ appears to match) usage from POP_FRAME, which is the only place
+ from which do_restore_insn is called.
+
+ * sparc-dep.c (do_save_insn and do_restore_insn): Added comments.
+
+ * m-sparc.h (FRAME_FIND_SAVED_REGS): Modified my code to find the
+ save addresses of out registers to use the in regs off the stack
+ pointer when the current frame is 1 from the innermost.
+
+Thu Oct 20 13:56:15 1988 & Smith (randy at hobbes.ai.mit.edu)
+
+ * blockframe.c, m-sparc.h: Removed code associated with
+ GET_PREV_FRAME_FROM_CACHE_ITEM. This code was not needed for the
+ sparc; you can always find the previous frames fp from the fp of
+ the current frame (which is the sp of the previous). It's getting
+ the information associated with a given frame (ie. saved
+ registers) that's a bitch, because that stuff is saved relative to
+ the stack pointer rather than the frame pointer.
+
+ * m-sparc.h (GET_PREV_FRAME_FROM_CACHE_ITEM): Modified to return
+ the frame pointer of the previous frame instead of the stack
+ pointer of same.
+
+ * blockframe.c (flush_cached_frames): Modified call to
+ obstack_free to free back to frame_cache instead of back to zero.
+ This leaves the obstack control structure in finite state (and
+ still frees the entry allocated at frame_cache).
+
+Sat Oct 15 16:30:47 1988 & Smith (randy at tartarus.uchicago.edu)
+
+ * valops.c (call_function): Suicide material here. Fixed a typo;
+ CALL_DUMMY_STACK_ADJUST was spelled CAll_DUMMY_STACK_ADJUST on
+ line 530 of the file. This cost me three days. I'm giving up
+ typing for lent.
+
+Fri Oct 14 15:10:43 1988 & Smith (randy at tartarus.uchicago.edu)
+
+ * m-sparc.h: Corrected a minor mistake in the dummy frame code
+ that was getting the 5th argument and the first argument from the
+ same place.
+
+Tue Oct 11 11:49:33 1988 & Smith (randy at tartarus.uchicago.edu)
+
+ * infrun.c: Made stop_after_trap and stop_after_attach extern
+ instead of static so that code which used proceed from machine
+ dependent files could fiddle with them.
+
+ * blockframe.c, frame.h, sparc-dep.c, m-sparc.h: Changed sense of
+ ->prev and ->next in struct frame_cache_item to fit usage in rest
+ of gdb (oops).
+
+Mon Oct 10 15:32:42 1988 Randy Smith (randy at gargoyle.uchicago.edu)
+
+ * m-sparc.h, sparc-dep.c, blockframe.c, frame.h: Wrote
+ get_frame_cache_item. Modified FRAME_SAVED_PC and frame_saved_pc
+ to take only one argument and do the correct thing with it. Added
+ the two macros I recently defined in blockframe.c to m-sparc.h.
+ Have yet to compile this thing on a sparc, but I've now merged in
+ everything that I received from tiemann, either exactly, or simply
+ effectively.
+
+ * source.c: Added code to allocated space to sals.sals in the case
+ where no line was specified.
+
+ * blockframe.c, infrun.c: Modified to cache stack frames requested
+ to minimize accesses to subprocess.
+
+Tue Oct 4 15:10:39 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
+
+ * config.gdb: Added sparc.
+
+Mon Oct 3 23:01:22 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
+
+ * Makefile, blockframe.c, command.c, core.c, dbxread.c, defs.h,
+ expread.y, findvar.c, infcmd.c, inflow.c, infrun.c, sparc-pinsn.c,
+ m-sparc.h, sparc-def.c, printcmd.c, stack.c, symmisc.c, symseg.h,
+ valops.c, values.c: Did initial merge of sparc port. This will
+ not compile; have to do stack frame caching and finish port.
+
+ * inflow.c, gdb.texinfo: `tty' now resets the controling terminal.
+
+Fri Sep 30 11:31:16 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * inferior.h, infcmd.c, infrun.c: Changed the variable
+ stop_random_signal to stopped_by_random signal to fit in better
+ with name conventions (variable is not a direction to the
+ proceed/resume set; it is information from it).
+
+Thu Sep 29 13:30:46 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
+
+ * infcmd.c (finish_command): Value type of return value is now
+ whatever the function returns, not the type of the function (fixed
+ a bug in printing said value).
+
+ * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab):
+ Put *all* global symbols into misc_functions. This is what was
+ happening anyway, and we need it for find_pc_misc_function.
+
+ ** This was eventually taken out, but I didn't mark it in the
+ ChangeLog. Oops.
+
+ * dbxread.c (process_symbol_for_psymtab): Put every debugger
+ symbol which survives the top case except for constants on the
+ symchain. This means that all of these *won't* show up in misc
+ functions (this will be fixed once I make sure it's broken the way
+ it's supposed to be).
+
+ * dbxread.c: Modified placement of debugger globals onto the hash
+ list; now we exclude the stuff after the colon and don't skip the
+ first character (debugger symbols don't have underscores).
+
+ * dbxread.c: Killed debuginfo stuff with ifdef's.
+
+Wed Sep 28 14:31:51 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
+
+ * symtab.h, dbxread.c: Modified to deal with BINCL, EINCL, and
+ EXCL symbols produced by the sun loader by adding a list of
+ pre-requisite partial_symtabs that each partial symtab needs.
+
+ * symtab.h, dbxread.c, symtab.c, symmisc.c: Modified to avoid
+ doing a qsort on the local (static) psymbols for each file to
+ speed startup. This feature is not completely debugged, but it's
+ inclusion has forced the inclusion of another feature (dealing
+ with EINCL's, BINCL's and EXCL's) and so I'm going to go in and
+ deal with them.
+
+ * dbxread.c (process_symbol_for_psymtab): Made sure that the class
+ of the symbol made it into the partial_symbol entry.
+
+Tue Sep 27 15:10:26 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c: Fixed bug; init_psymbol_list was not being called
+ with the right number of arguments (1).
+
+ * dbxread.c: Put ifdef's around N_MAIN, N_M2C, and N_SCOPE to
+ allow compilation on a microvax.
+
+ * config.gdb: Modified so that "config.gdb vax" would work.
+
+ * dbxread.c, symtab.h, symmisc.h, symtab.c, source.c: Put in many
+ and varied hacks to speed up gdb startup including: A complete
+ rewrite of read_dbx_symtab, a modification of the partial_symtab
+ data type, deletion of select_source_symtab from
+ symbol_file_command, and optimiztion of the call to strcmp in
+ compare_psymbols.
+
+Thu Sep 22 11:08:54 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * dbxread.c (psymtab_to_symtab): Removed call to
+ init_misc_functions.
+
+ * dbxread.c: Fixed enumeration type clash (used enum instead of
+ integer constant).
+
+ * breakpoint.c: Fixed typo; lack of \ at end of line in middle of
+ string constant.
+
+ * symseg.h: Fixed typo; lack of semicolon after structure
+ definition.
+
+ * command.c, breakpoint.c, printcmd.c: Added cmdlist editing
+ functions to add commands with the abbrev flag set. Changed
+ help_cmd_list to recognize this flag and modified unset,
+ undisplay, and enable, disable, and delete breakpoints to have
+ this flag set.
+
+Wed Sep 21 13:34:19 1988 Randall Smith (randy at plantaris.ai.mit.edu)
+
+ * breakpoint.c, infcmd.c, gdb.texinfo: Created "unset" as an alias
+ for delete, and changed "unset-environment" to be the
+ "environment" subcommand of "delete".
+
+ * gdb.texinfo, valprint.c: Added documentation in the manual for
+ breaking the set-* commands into subcommands of set. Changed "set
+ maximum" to "set array-max".
+
+ * main.c, printcmd.c, breakpoint.c: Moved the declaration of
+ command lists into main and setup a function in main initializing
+ them to guarrantee that they would be initialized before calling
+ any of the individual files initialize routines.
+
+ * command.c (lookup_cmd): A null string subcommand is treated as
+ an unknown subcommand rather than an ambiguous one (eg. "set $x =
+ 1" will now work).
+
+ * infrun.c (wait_for_inferior): Put in ifdef for Sony News in
+ check for trap by INNER_THAN macro.
+
+ * eval.c (evaluate_subexp): Put in catch to keep the user from
+ attempting to call a non function as a function.
+
+Tue Sep 20 10:35:53 1988 Randall Smith (randy at oatmeal.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Installed code to keep track of
+ which global symbols did not have debugger symbols refering to
+ them, and recording these via record_misc_function.
+
+ * dbxread.c: Killed code to check for extra global symbols in the
+ debugger symbol table.
+
+ * printcmd.c, breakpoint.c: Modified help entries for several
+ commands to make sure that abbreviations were clearly marked and
+ that the right commands showed up in the help listings.
+
+ * main.c, command.c, breakpoint.c, infcmd.c, printcmd.c,
+ valprint.c, defs.h: Modified help system to allow help on a class
+ name to show subcommands as well as commands and help on a command
+ to show *all* subcommands of that command.
+
+Fri Sep 16 16:51:19 1988 Randall Smith (randy at gluteus.ai.mit.edu)
+
+ * breakpoint.c (_initialize_breakpoint): Made "breakpoints"
+ subcommands of enable, disable, and delete use class 0 (ie. they
+ show up when you do a help xxx now).
+
+ * infcmd.c,printcmd,c,main.c,valprint.c: Changed the set-*
+ commands into subcommands of set. Created "set variable" for use
+ with variables whose names might conflict with other subcommands.
+
+ * blockframe.c, dbxread.c, coffread.c, expread.y, source.c:
+ Fixed mostly minor (and one major one in block_for_pc) bugs
+ involving checking the partial_symtab_list when a scan through the
+ symtab_list fails.
+
+Wed Sep 14 12:02:05 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu)
+
+ * breakpoint.c, gdb.texinfo: Added enable breakpoints, disable
+ breakpoints and delete breakpoints as synonyms for enable,
+ disable, and delete. This seemed reasonable because of the
+ immeninent arrival of watchpoints & etc.
+
+ * gdb.texinfo: Added enable display, disable display, and delete
+ display to manual.
+
+Tue Sep 13 16:53:56 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu)
+
+ * inferior.h, infrun.c, infcmd.c: Added variable
+ stop_random_signal to indicate when a proceed had been stopped by
+ an unexpected signal. Used this to determine (in normal_stop)
+ whether the current display point should be deleted.
+
+ * valops.c: Fix to value_ind to check for reference before doing a
+ COERCE_ARRAY.
+
+Sun Jul 31 11:42:36 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu)
+
+ * breakpoint.c (_initialize_breakpoint): Clean up doc for commands
+ that can now apply also to auto-displays.
+
+ * coffread.c (record_line): Corrected a spazz in editing.
+ Also removed the two lines that assume line-numbers appear
+ only in increasing order.
+
+Tue Jul 26 22:19:06 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * expression.h, eval.c, expprint.c, printcmd.c, valarith.c,
+ valops.c, valprint.c, values.c, m-*.h: Changes for evaluating and
+ displaying 64-bit `long long' integers. Each machine must define
+ a LONGEST type, and a BUILTIN_TYPE_LONGEST.
+
+ * symmisc.c: (print_symtab) check the status of the fopen and call
+ perror_with_name if needed.
+
+Thu Jul 21 00:56:11 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * Convex: core.c: changes required by Convex's SOFF format were
+ isolated in convex-dep.c.
+
+Wed Jul 20 21:26:10 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * coffread.c, core.c, expread.y, i386-pinsn.c, infcmd.c, inflow.c,
+ infrun.c, m-i386.h, main.c, remote.c, source.c, valops.c:
+ Improvements for the handling of the i386 and other machines
+ running USG. (Several of these files just needed extra header files
+ such as types.h.) utils.c: added bcopy, bcmp, bzero, getwd, list
+ of signals, and queue routines for USG systems. Added vfork macro
+ to i386
+
+ * printcmd.c, breakpoint.c: New commands to enable/disable
+ auto-displays. Also `delete display displaynumber' works like
+ `undisplay displaynumber'.
+
+Tue Jul 19 02:17:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * coffread.c: (coff_lookup_type) Wrong portion of type_vector was
+ being bzero'd after type_vector was reallocated.
+
+ * printcmd.c: (delete_display) Check for a display chain before
+ attempting to delete a display.
+
+ * core.c, *-dep.c (*-infdep moved to *-dep): machine-dependent
+ parts of core.c (core_file_command, exec_file_command) moved to
+ *-dep.c.
+
+Mon Jul 18 19:45:51 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * dbxread.c: typo in read_struct_type (missing '=') was causing a
+ C struct to be parsed as a C++ struct, resulting in a `invalid
+ character' message.
+
+Sun Jul 17 22:27:32 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * printcmd.c, symtab.c, valops.c, expread.y: When an expression is
+ read, the innermost block required to evaluate the expression is
+ saved in the global variable `innermost_block'. This information
+ is saved in the `block' field of an auto-display so that
+ expressions with inactive variables can be skipped. `info display'
+ tells the user which displays are active and which are not. New
+ fn `contained_in' returns nonzero if one block is contained within
+ another.
+
+Fri Jul 15 01:53:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * infrun.c, m-i386.h: Use macro TRAPS_EXPECTED to set number of
+ traps to skip when sh execs the program. Default is 2, m-i386.h
+ overrides this and sets to 4.
+
+ * coffread.c, infrun.c: minor changes for the i386. May be able
+ to eliminate them with more general code.
+
+ * default-infdep.c: #ifdef SYSTEMV, include header file types.h.
+ Also switched the order of signal.h and user.h, since System 5
+ requires signal.h to come first.
+
+ * core.c main.c, remote,c, source.c, inflow.c: #ifdef SYSTEMV,
+ include various header files. Usually types.h and fcntl.h.
+
+ * utils.c: added queue routines needed by the i386 (and other sys
+ 5 machines).
+
+ * sys5.c, regex.c, regex.h: new files for sys 5 systems. (The
+ regex files are simply links to /gp/gnu/lib.)
+
+Thu Jul 14 01:47:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * config.gdb, README: Provide a list of known machines when user
+ enters an invalid machine. New second arg is operating system,
+ currently only used with `sunos4' or `os4'. Entry for i386 added.
+
+ * news-infdep.c: new file.
+
+ * m-news.h: new version which deals with new bugs in news800's OS.
+
+Tue Jul 12 19:52:16 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * Makefile, *.c, munch, config.gdb, README: New initialization
+ scheme uses nm to find functions whose names begin with
+ `_initialize_'. Files `initialize.h', `firstfile.c',
+ `lastfile.c', `m-*init.h' no longer needed.
+
+ * eval.c, symtab.c, valarith.c, valops.c, value.h, values.c: Bug
+ fixes from gdb+ 2.5.4. evaluate_subexp takes a new arg, type
+ expected. New fn value_virtual_fn_field.
+
+Mon Jul 11 00:48:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * core.c (read_memory): xfer_core_file was being called with an
+ extra argument (0) by read_memory.
+
+ * core.c (read_memory), *-infdep.c (read_inferior_memory),
+ valops.c (value_at): read_memory and read_inferior_memory now work
+ like write_memory and write_inferior_memory in that errno is
+ checked after each ptrace and returned to the caller. Used in
+ value_at to detect references to addresses which are out of
+ bounds. Also core.c (xfer_core_file): return 1 if invalid
+ address, 0 otherwise.
+
+ * inflow.c, <machine>-infdep.c: removed all calls to ptrace from
+ inflow.c and put them in machine-dependent files *-infdep.c.
+
+Sun Jul 10 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * symmisc.c: (read_symsegs) Accept only format number 2. Since
+ the size of the type structure changed when C++ support was added,
+ format 1 can no longer be used.
+
+ * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0.
+ Slight change in the core structure. #ifdef SUNOS4. New file
+ m-sunos4.h. May want to change config.gdb also.
+
+Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * breakpoint.c: (break_command_1) Allow `break if condition'
+ rather than parsing `if' as a function name and returning an
+ error.
+
+Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * C++: valops.c, valprint.c, value.h, values.c: merged code to deal
+ with C++ expressions.
+
+Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches,
+ add_file_command) Merged code to read symbol information from
+ an incrementally linked file. symmisc.c:
+ (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup
+ routines.
+
+Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with
+ ambiguous line specifications. In C++ one can have overloaded
+ function names, so that `list classname::overloadedfuncname'
+ refers to several different lines, possibly in different files.
+
+Fri Jul 1 02:44:20 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
+
+ * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with
+ a modified lookup_symbol which checks for fields of the current
+ implied argument `this'. printcmd.c, source.c, symtab.c,
+ valops.c: Need to change callers once callers are
+ installed.
+
+Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
+
+ * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c,
+ Merged code to deal with evaluation of user-defined operators,
+ member functions, and virtual functions.
+ binop_must_be_user_defined tests for user-defined binops,
+ value_x_binop calls the appropriate operator function.
+
+Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
+
+ * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts
+ and 1 reduce/reduce conflict.
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/MAINTAINERS b/contrib/gdb/gdb/MAINTAINERS
new file mode 100644
index 0000000..5941946
--- /dev/null
+++ b/contrib/gdb/gdb/MAINTAINERS
@@ -0,0 +1,421 @@
+ GDB Maintainers
+
+
+ Blanket Write Privs
+ (alphabetic)
+
+Jim Blandy jimb@redhat.com
+Kevin Buettner kevinb@redhat.com
+Andrew Cagney ac131313@redhat.com
+J.T. Conklin jtc@redback.com
+Fred Fish fnf@ninemoons.com
+Mark Kettenis kettenis@gnu.org
+Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
+Stan Shebs shebs@apple.com
+Michael Snyder msnyder@redhat.com
+Elena Zannoni ezannoni@redhat.com
+Eli Zaretskii eliz@gnu.org
+
+
+ Various Maintainers
+
+Note individuals who maintain parts of the debugger need approval to
+check in changes outside of the immediate domain that they maintain.
+
+If there is no maintainer for a given domain then the responsibility
+falls to the head maintainer.
+
+If there are several maintainers for a given domain then
+responsibility falls to the first maintainer. The first maintainer is
+free to devolve that responsibility among the other maintainers.
+
+
+ The Obvious Fix Rule
+
+All maintainers listed in this file are allowed to check in obvious
+fixes.
+
+An "obvious fix" means that there is no possibility that anyone will
+disagree with the change.
+
+A good mental test is "will the person who hates my work the most be
+able to find fault with the change" - if so, then it's not obvious and
+needs to be posted first. :-)
+
+Something like changing or bypassing an interface is _not_ an obvious
+fix, since such a change without discussion will result in
+instantaneous and loud complaints.
+
+
+Target/Architecture:
+
+Generic ISA (Instruction Set Architecture) issues, API variants, CPU
+variants. *-tdep.c. The Target/Architecture maintainer works with the
+host maintainer when resolving build issues. The Target/Architecture
+maintainer works with the native maintainer when resolving API issues.
+
+ a29k OBSOLETE
+
+ alpha --target=alpha-dec-osf4.0a -Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ arc --target=arc-elf ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ arm --target=arm-elf -w
+ Fernando Nasser fnasser@redhat.com
+ Scott Bambrough scottb@netwinder.org
+ Richard Earnshaw rearnsha@arm.com
+ Not multi-arch
+
+ avr --target=avr ,-Werror
+ Theodore A. Roth troth@verinet.com
+
+ cris --target=cris-elf -w
+ Orjan Friberg orjanf@axis.com
+
+ d10v --target=d10v-elf ,-Werror
+ Maintenance only
+
+ d30v --target=d30v-elf ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ djgpp --target=i586-pc-msdosdjgpp ,-Werror
+ (See native and host)
+
+ fr30 --target=fr30-elf -Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ h8300 --target=h8300hms -Werror
+ Maintenance only
+ Not multi-arch, work in progress
+
+ h8500 --target=h8500hms -Werror
+ Maintenance only
+ Not multi-arch, work in progress
+
+ i386 --target=i386-elf,i386-aout ,-Werror
+ Mark Kettenis kettenis@gnu.org
+
+ i960 --target=i960-coff ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ ia64 --target=ia64-linux ,-Werror
+ Kevin Buettner kevinb@redhat.com
+
+ m32r --target=m32r-elf -Werror
+ Michael Snyder msnyder@redhat.com
+ Not multi-arch
+
+ m68hc11 --target=m68hc11-elf ,-Werror
+ Stephane Carrez Stephane.Carrez@worldnet.fr
+
+ m68k --target=m68k-elf ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ m88k --target=m88k ,-Werror
+ Known problem in 5.1
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ mcore --target=mcore-elf,mcore-pe ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ mips --target=mips-elf,mips64-elf ,-Werror
+ Andrew Cagney cagney@redhat.com
+
+ mn10200 --target=mn10200-elf ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ mn10300 --target=mn10300-elf ,-Werror
+ Maintenance only
+
+ ns32k --target=ns32k-netbsd ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ pa (--target=hppa1.1-hp-proelf broken)
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ powerpc --target=powerpc-eabi ,-Werror
+ Kevin Buettner kevinb@redhat.com
+
+ rs6000 --target=rs6000-ibm-aix4.1 ,-Werror
+ (see rs6000 native and ppc target)
+
+ s390 --target=s390-linux ,-Werror
+ (contact DJ Barrow djbarrow@de.ibm.com)
+
+ sh --target=sh-hms,sh-elf ,-Werror
+ Elena Zannoni ezannoni@redhat.com
+
+ sparc --target=sparc-elf,sparc64-elf ,-Werror
+ Maintenance only
+
+ tic80 Deleted.
+
+ v850 --target=v850-elf ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ vax --target=vax-dec-vms5.5 ,-Werror
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+ w65 Deleted.
+
+ x86-64 (--target=x86_64-linux-gnu broken)
+ Maintenance only
+
+ xstormy16 --target=xstormy16-elf ,-Werror
+ Corinna Vinschen vinschen@redhat.com
+
+ z8k --target=z8k-coff ,-Werror
+ Known problem in 5.1
+ Maintenance only
+ OBSOLETE candidate, not multi-arch
+
+All developers recognized by this file can make arbitrary changes to
+OBSOLETE targets.
+
+All maintainers can test and thence approve non-trivial changes to
+``maintenance only'' targets submitted by recognized developers.
+
+All recognized developers can make mechanical changes (by virtue of
+the obvious fix rule) to ``maintenance only'' targets. The change
+shall be sanity checked by compiling with one of the listed targets.
+
+The GAWK segment:
+
+ awk < "${maintainers}" '
+ $2 ~ /--target=.*/ {
+ targets = gensub (/^.*--target=/, "", 1, $2)
+ warnings = gensub (/[)]*$/, "", 1, $3)
+ split (targets, targ, /,/)
+ for (i in targ) {
+ print targ[i], warnings
+ }
+ }'
+
+can be used to generate a full list of --target=
+--enable-gdb-build-warning= pairs.
+
+
+
+Host/Native:
+
+The Native maintainer is responsible for target specific native
+support - typically shared libraries and quirks to procfs/ptrace/...
+The Native maintainer works with the Arch and Core maintainers when
+resolving more generic problems.
+
+The host maintainer ensures that gdb (including mmalloc) can be built
+as a cross debugger on their platform.
+
+AIX Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
+ Kevin Buettner kevinb@redhat.com
+
+djgpp native Eli Zaretskii eliz@gnu.org
+ DJ Delorie dj@redhat.com
+MS Windows (NT, CE, '00, 9x, Me) host & native
+ Chris Faylor cgf@redhat.com
+GNU/Linux/x86 native & host
+ Mark Kettenis kettenis@gnu.org
+ Jim Blandy jimb@redhat.com
+GNU/Linux PPC native Kevin Buettner kevinb@redhat.com
+GNU/Linux MIPS native & host
+ Daniel Jacobowitz dan@debian.org
+GNU/Linux m68k Andreas Schwab schwab@suse.de
+FreeBSD native & host Mark Kettenis kettenis@gnu.org
+ David O'Brien obrien@freebsd.org
+hurd native Mark Kettenis kettenis@gnu.org
+SCO/Unixware Robert Lipe rjl@sco.com
+GNU/Linux ARM native Scott Bambrough scottb@netwinder.org
+Solaris/x86 native & host (devolved)
+ Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
+Solaris/SPARC native & host (devolved)
+ Michael Snyder msnyder@redhat.com
+
+
+
+Core: Generic components used by all of GDB
+
+generic arch support Andrew Cagney cagney@redhat.com
+ Any host/target maintainer can add to
+ gdbarch.{c,h,sh}. Send tricky ones to cagney.
+target vector Andrew Cagney cagney@redhat.com
+main (main.c, top.c) Elena Zannoni ezannoni@redhat.com
+event loop Elena Zannoni ezannoni@redhat.com
+
+generic symtabs Jim Blandy jimb@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ dwarf readers Jim Blandy jimb@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ elf reader Jim Blandy jimb@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ stabs reader Jim Blandy jimb@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ coff reader Philippe De Muyter phdm@macqel.be
+ xcoff reader Any maintainer can modify this; please send tricky
+ ones to Kevin Buettner <kevinb@redhat.com>
+ linespec Jim Blandy jimb@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ Fernando Nasser fnasser@redhat.com
+
+tracing bytecode stuff Jim Blandy jimb@redhat.com
+tracing Michael Snyder msnyder@redhat.com
+threads Michael Snyder msnyder@redhat.com
+ Mark Kettenis kettenis@gnu.org
+breakpoints Michael Snyder msnyder@redhat.com
+ Jim Blandy jimb@redhat.com
+language support (Blanket Write Privs Maintainers)
+ C++ Daniel Jacobowitz dan@debian.org
+ Java support (devolved)
+ Per Bothner per@bothner.com
+ Anthony Green green@redhat.com
+ Pascal support Pierre Muller muller@sources.redhat.com
+ Scheme support Jim Blandy jimb@redhat.com
+
+shared libs (devolved) Jim Blandy jimb@redhat.com
+ Kevin Buettner kevinb@redhat.com
+ xcoffsolib Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
+
+remote.c Andrew Cagney cagney@redhat.com
+include/remote-sim.h, remote-sim.c
+ Andrew Cagney cagney@redhat.com
+sds protocol Fernando Nasser fnasser@redhat.com
+rdi/adp protocol Fernando Nasser fnasser@redhat.com
+documentation Eli Zaretskii eliz@gnu.org
+testsuite Fernando Nasser fnasser@redhat.com
+ config Mark Salter msalter@redhat.com
+ lib Mark Salter msalter@redhat.com
+ gdbtk (gdb.gdbtk) Keith Seitz keiths@redhat.com
+ c++ (gdb.c++) Michael Chastain mec@shout.net
+ mi tests (gdb.mi) Elena Zannoni ezannoni@redhat.com
+ Andrew Cagney cagney@redhat.com
+ stabs (gdb.stabs) Elena Zannoni ezannoni@redhat.com
+ threads (gdb.threads) Michael Snyder msnyder@redhat.com
+ trace (gdb.trace) Michael Snyder msnyder@redhat.com
+ hp tests (gdb.hp) (vacant)
+ Java tests (gdb.java) Anthony Green green@redhat.com
+Kernel Object Display Fernando Nasser fnasser@redhat.com
+
+
+UI: External (user) interfaces.
+
+command interpreter Fernando Nasser fnasser@redhat.com
+gdbtk (c & tcl) Jim Ingham jingham@apple.com
+ Fernando Nasser fnasser@redhat.com
+ Keith Seitz keiths@redhat.com
+libgui (w/foundry, sn) Jim Ingham jingham@apple.com
+ Keith Seitz keiths@redhat.com
+mi (gdb/mi) Andrew Cagney cagney@redhat.com
+ Elena Zannoni ezannoni@redhat.com
+ Fernando Nasser fnasser@redhat.com
+tui (vacant)
+ Technical Contact Point wdb@cup.hp.com
+
+
+Misc:
+
+gdb/gdbserver Daniel Jacobowitz dan@debian.org
+
+Web pages. Jim Kingdon jkingdon@engr.sgi.com ++
+ (anyone can edit; kingdon is just lead maintainer)
+
+Makefile.in, configure* ALL
+
+mmalloc/ ALL Host maintainers
+
+sim/ See sim/MAINTAINERS
+
+readline/ Master version: ftp://ftp.cwru.edu/pub/bash/
+ Elena Zannoni ezannoni@redhat.com
+ Host maintainers (host dependant parts)
+ (but get your changes into the master version)
+
+tcl/ tk/ itcl/ Ian Roxborough irox@redhat.com
+
+ Write After Approval
+ (alphabetic)
+
+To get recommended for the Write After Approval list you need a valid
+FSF assignment and have submitted one good patch.
+
+David Anderson davea@sgi.com
+Philip Blundell philb@gnu.org
+Joel Brobecker brobecker@act-europe.fr
+Nick Clifton nickc@redhat.com
+Chris G. Demetriou cgd@broadcom.com
+Klee Dienes kdienes@apple.com
+Richard Earnshaw rearnsha@arm.com
+Matthew Green mrg@eterna.com.au
+Orjan Friberg orjanf@axis.com
+Ben Harris bjh21@netbsd.org
+Paul Hilfinger hilfinger@gnat.com
+Matt Hiller hiller@redhat.com
+Kazu Hirata kazu@hxi.com
+Jeff Holcomb jeffh@redhat.com
+Don Howard dhoward@redhat.com
+Martin Hunt hunt@redhat.com
+Jim Ingham jingham@apple.com
+Daniel Jacobowitz dan@debian.org
+Andreas Jaeger aj@suse.de
+Geoff Keating geoffk@redhat.com
+Jim Kingdon jkingdon@engr.sgi.com ++
+Jonathan Larmour jlarmour@redhat.co.uk
+H.J. Lu hjl@lucon.org
+Glen McCready gkm@redhat.com
+Greg McGary greg@mcgary.org
+Jason Merrill jason@redhat.com
+Jason Molenda jmolenda@apple.com
+Pierre Muller muller@sources.redhat.com
+Alexandre Oliva aoliva@redhat.com
+Tom Rix trix@redhat.com
+Theodore A. Roth troth@verinet.com
+Mark Salter msalter@redhat.com
+Andreas Schwab schwab@suse.de
+Keith Seitz keiths@redhat.com
+Jiri Smid smid@suse.cz
+David Smith dsmith@redhat.com
+Stephen P. Smith ischis2@home.com
+Jackie Smith Cashion jsmith@redhat.com
+Petr Sorfa petrs@caldera.com
+Gary Thomas gthomas@redhat.com
+Jason Thorpe thorpej@wasabisystems.com
+Tom Tromey tromey@redhat.com
+Corinna Vinschen vinschen@redhat.com
+Keith Walker keith.walker@arm.com
+
+
+
+ Past Maintainers
+
+Jimmy Guo (gdb.hp, tui) guo at cup dot hp dot com
+Jeff Law (hppa) law at cygnus dot com
+Daniel Berlin (C++ support) dan at cgsoftware dot com
+Nick Duffek (powerpc, SCO, Sol/x86) nick at duffek dot com
+David Taylor (d10v, sparc, utils, defs,
+ expression evaluator, language support) taylor at candd dot org
+J.T. Conklin (dcache, NetBSD, remote) jtc at redback dot com
+Frank Ch. Eigler (sim) fche at redhat dot com
+
+
+
+Folks that have been caught up in a paper trail:
+
+Jim Kingdon jkingdon@engr.sgi.com
+
+--
+
+(*) Indicates folks that don't have a Kerberos/SSH account in the GDB
+group.
diff --git a/contrib/gdb/gdb/Makefile.in b/contrib/gdb/gdb/Makefile.in
index 2c6dfb5..3b31aed 100644
--- a/contrib/gdb/gdb/Makefile.in
+++ b/contrib/gdb/gdb/Makefile.in
@@ -1,5 +1,5 @@
-# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
-# Free Software Foundation, Inc.
+# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
# This file is part of GDB.
@@ -39,6 +39,7 @@ man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
+htmldir = $(prefix)/html
includedir = @includedir@
# This can be referenced by `INTLDEPS' as computed by CY_GNU_GETTEXT.
@@ -47,6 +48,9 @@ top_builddir = .
SHELL = @SHELL@
EXEEXT = @EXEEXT@
+AWK = @AWK@
+LN_S = @LN_S@
+
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
@@ -56,14 +60,7 @@ AR_FLAGS = qv
RANLIB = @RANLIB@
DLLTOOL = @DLLTOOL@
WINDRES = @WINDRES@
-
-# If the user configured GDB to include the TUI, the name of the tui
-# library goes here.
-TUI_LIBRARY = @TUI_LIBRARY@
-
-# If the user configured GDB to include the TUI, the all-tui
-# target goes here.
-BUILD_TUI = @BUILD_TUI@
+MIG = @MIG@
# Flags that describe where you can find the termcap library.
# This can be overridden in the host Makefile fragment file.
@@ -87,6 +84,10 @@ YLWRAP = $(srcdir)/../ylwrap
# where to find makeinfo, preferably one designed for texinfo-2
MAKEINFO=makeinfo
+MAKEHTML = texi2html
+
+MAKEHTMLFLAGS = -glossary -menu -split_chapter
+
# Set this up with gcc if you have gnu ld and the loader will print out
# line numbers for undefined references.
#CC_LD=gcc -static
@@ -105,6 +106,9 @@ LIBIBERTY = ../libiberty/libiberty.a
MMALLOC = @MMALLOC@
MMALLOC_CFLAGS = @MMALLOC_CFLAGS@
+# Configured by the --with-uiout option to configure.
+UIOUT_CFLAGS = @UIOUT_CFLAGS@
+
# Where is the BFD library? Typically in ../bfd.
BFD_DIR = ../bfd
BFD = $(BFD_DIR)/libbfd.a
@@ -118,6 +122,9 @@ READLINE_SRC = $(srcdir)/$(READLINE_DIR)
READLINE_CFLAGS = -I$(READLINE_SRC)/..
WARN_CFLAGS = @WARN_CFLAGS@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+GDB_WARN_CFLAGS = $(WARN_CFLAGS)
+GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
# Where is the INTL library? Typically in ../intl.
INTL_DIR = ../intl
@@ -126,10 +133,76 @@ INTL_DEPS = @INTLDEPS@
INTL_SRC = $(srcdir)/$(INTL_DIR)
INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC)
-# Where is the TUI library? Typically in tui/.
-TUI_DIR=tui
-TUI_SRC = $(srcdir)/$(TUI_DIR)
-TUI_CFLAGS= -I$(TUI_SRC)
+#
+# CLI sub directory definitons
+#
+SUBDIR_CLI_OBS = \
+ cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o
+SUBDIR_CLI_SRCS = \
+ cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
+ cli/cli-utils.c
+SUBDIR_CLI_DEPS =
+SUBDIR_CLI_INITS = \
+ $(SUBDIR_CLI_SRCS)
+SUBDIR_CLI_LDFLAGS=
+SUBDIR_CLI_CFLAGS=
+SUBDIR_CLI_ALL=
+SUBDIR_CLI_CLEAN=
+SUBDIR_CLI_INSTALL=
+SUBDIR_CLI_UNINSTALL=
+
+#
+# MI sub directory definitons
+#
+SUBDIR_MI_OBS = \
+ mi-out.o mi-console.o \
+ mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
+ mi-cmd-disas.o \
+ mi-main.o mi-parse.o mi-getopt.o
+SUBDIR_MI_SRCS = \
+ mi/mi-out.c mi/mi-console.c \
+ mi/mi-cmds.c \
+ mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
+ mi/mi-cmd-disas.c \
+ mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
+SUBDIR_MI_DEPS =
+SUBDIR_MI_INITS = \
+ $(SUBDIR_MI_SRCS)
+SUBDIR_MI_LDFLAGS=
+SUBDIR_MI_CFLAGS= \
+ -DMI_OUT=1
+SUBDIR_MI_ALL=
+SUBDIR_MI_CLEAN=
+SUBDIR_MI_INSTALL=
+SUBDIR_MI_UNINSTALL=
+
+#
+# TUI sub directory definitions
+#
+SUBDIR_TUI_OBS = \
+ tui-file.o tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o \
+ tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o \
+ tuiDisassem.o tuiSourceWin.o tuiRegs.o tuiDataWin.o \
+ tui-out.o tui-hooks.o
+SUBDIR_TUI_SRCS = \
+ tui/tui-file.c tui/tui.c tui/tuiData.c tui/tuiSource.c \
+ tui/tuiStack.c tui/tuiIO.c \
+ tui/tuiGeneralWin.c tui/tuiLayout.c \
+ tui/tuiWin.c tui/tuiCommand.c \
+ tui/tuiDisassem.c tui/tuiSourceWin.c \
+ tui/tuiRegs.c tui/tuiDataWin.c tui/tui-out.c tui/tui-hooks.c
+SUBDIR_TUI_DEPS =
+SUBDIR_TUI_INITS = \
+ $(SUBDIR_TUI_SRCS)
+SUBDIR_TUI_LDFLAGS=
+SUBDIR_TUI_CFLAGS= \
+ -DTUI=1 -I${srcdir}/tui
+SUBDIR_TUI_ALL=
+SUBDIR_TUI_CLEAN=
+SUBDIR_TUI_INSTALL=
+SUBDIR_TUI_UNINSTALL=
+
+
# Opcodes currently live in one of two places. Either they are in the
# opcode library, typically ../opcodes, or they are in a header file
@@ -146,11 +219,91 @@ OPCODES_CFLAGS = -I$(OP_INCLUDE)
# should set this to list all the .o or .a files to be linked in.
SIM =
-
+WIN32LIBS = @WIN32LIBS@
+
+# Where is the TCL library? Typically in ../tcl.
+LIB_INSTALL_DIR = $(libdir)
+# This variable is needed when doing dynamic linking.
+LIB_RUNTIME_DIR = $(libdir)
+TCL = @TCL_LD_SEARCH_FLAGS@ @TCL_BUILD_LIB_SPEC@
+TCL_CFLAGS = @TCLHDIR@
+TCL_DEPS = @TCL_DEPS@
+GDBTKLIBS = @GDBTKLIBS@
+# Extra flags that the GDBTK files need:
+GDBTK_CFLAGS = @GDBTK_CFLAGS@
+
+# Where is the TK library? Typically in ../tk.
+TK = @TK_BUILD_LIB_SPEC@
+TK_CFLAGS = @TKHDIR@ @TK_BUILD_INCLUDES@
+TK_DEPS = @TK_DEPS@
+
+# Where is Itcl? Typically in ../itcl/itcl.
+ITCL_CFLAGS = @ITCLHDIR@
+ITCL = @ITCLLIB@
+ITCL_DEPS = @ITCL_DEPS@
+
+# Where is Itk? Typically in ../itcl/itk.
+ITK_CFLAGS = @ITKHDIR@
+ITK = @ITKLIB@
+ITK_DEPS = @ITK_DEPS@
+
+# Where is Tix? Typically in ../tix.
+TIX_CFLAGS = @TIXHDIR@
+TIX = @TIXLIB@
+TIX_DEPS = @TIX_DEPS@
+
+X11_CFLAGS = @TK_XINCLUDES@
+X11_LDFLAGS =
+X11_LIBS =
+
+WIN32LDAPP = @WIN32LDAPP@
+
+LIBGUI = @LIBGUI@
+GUI_CFLAGS_X = @GUI_CFLAGS_X@
+IDE_CFLAGS=$(GUI_CFLAGS_X) $(IDE_CFLAGS_X)
+
+# The version of gdbtk we're building. This should be kept
+# in sync with GDBTK_VERSION and friends in gdbtk.h.
+GDBTK_VERSION = 1.0
+GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION)
+
+# Gdbtk requires an absolute path to the source directory or
+# the testsuite won't run properly.
+GDBTK_SRC_DIR = @GDBTK_SRC_DIR@
+
+SUBDIR_GDBTK_OBS = \
+ gdbtk.o gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o \
+ gdbtk-register.o gdbtk-stack.o gdbtk-varobj.o gdbtk-wrapper.o
+SUBDIR_GDBTK_SRCS = \
+ gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-bp.c \
+ gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c \
+ gdbtk/generic/gdbtk-register.c gdbtk/generic/gdbtk-stack.c \
+ gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c
+SUBDIR_GDBTK_DEPS = \
+ $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)
+SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c
+SUBDIR_GDBTK_LDFLAGS=
+SUBDIR_GDBTK_CFLAGS= -DGDBTK
+SUBDIR_GDBTK_ALL=
+SUBDIR_GDBTK_CLEAN=
+SUBDIR_GDBTK_INSTALL= install-gdbtk
+SUBDIR_GDBTK_UNINSTALL=
+
+CONFIG_OBS= @CONFIG_OBS@
+CONFIG_LIB_OBS= @CONFIG_LIB_OBS@
+CONFIG_SRCS= @CONFIG_SRCS@
+CONFIG_DEPS= @CONFIG_DEPS@
+CONFIG_INITS= @CONFIG_INITS@
+CONFIG_LDFLAGS = @CONFIG_LDFLAGS@
ENABLE_CFLAGS= @ENABLE_CFLAGS@
+CONFIG_ALL= @CONFIG_ALL@
+CONFIG_CLEAN= @CONFIG_CLEAN@
+CONFIG_CLEAN= @CONFIG_CLEAN@
+CONFIG_INSTALL = @CONFIG_INSTALL@
+CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
# -I. for config files.
-# -I$(srcdir) for gdb internal headers and possibly for gnu-regex.h also.
+# -I$(srcdir) for gdb internal headers.
# -I$(srcdir)/config for more generic config files.
# It is also possible that you will need to add -I/usr/include/sys if
@@ -166,7 +319,7 @@ GLOBAL_CFLAGS = $(MT_CFLAGS) $(MH_CFLAGS)
# CFLAGS is specifically reserved for setting from the command line
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
-CFLAGS = -g
+CFLAGS = @CFLAGS@
# Need to pass this to testsuite for "make check". Probably should be
# consistent with top-level Makefile.in and gdb/testsuite/Makefile.in
@@ -174,10 +327,13 @@ CFLAGS = -g
CXXFLAGS = -g -O
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
-INTERNAL_CFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
+INTERNAL_WARN_CFLAGS = \
+ $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
$(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
- $(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(WARN_CFLAGS)
+ $(INTL_CFLAGS) $(ENABLE_CFLAGS) $(UIOUT_CFLAGS) \
+ $(GDB_WARN_CFLAGS)
+INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@@ -185,14 +341,9 @@ INTERNAL_CFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
# Profiling options need to go here to work.
# I think it's perfectly reasonable for a user to set -pg in CFLAGS
# and have it work; that's why CFLAGS is here.
-INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) @CONFIG_LDFLAGS@ @HLDFLAGS@
+INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) @HLDFLAGS@
HLDENV = @HLDENV@
-# We are using our own version of REGEX now to be consistent across
-# machines.
-REGEX = gnu-regex.o
-REGEX1 = gnu-regex.o
-
# If your system is missing alloca(), or, more likely, it's there but
# it doesn't work, then refer to libiberty.
@@ -210,16 +361,17 @@ CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \
$(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
$(MMALLOC) $(LIBIBERTY) $(WIN32LIBS)
CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
- $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) @CONFIG_DEPS@
+ $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS)
-ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
+ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
+ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-VERSION=4.18
DIST=gdb
LINT=/usr/5bin/lint
-LINTFLAGS= $(BFD_CFLAGS)
+LINTFLAGS= $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
+ $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
+ $(INTL_CFLAGS)
RUNTEST = `if [ -f $${rootsrc}/../dejagnu/runtest ] ; then \
echo $${rootsrc}/../dejagnu/runtest ; else echo runtest; \
@@ -233,7 +385,7 @@ RUNTESTFLAGS=
# part of libiberty) a POSIX interface. But at least for now the
# host-dependent makefile fragment might need to use something else
# besides ser-unix.o
-SER_HARDWIRE = ser-unix.o
+SER_HARDWIRE = @SER_HARDWIRE@
# The `remote' debugging target is supported for most architectures,
# but not all (e.g. 960)
@@ -249,9 +401,17 @@ ANNOTATE_OBS = annotate.o
@target_makefile_frag@
# End of host and target-dependent makefile fragments
+# Possibly ignore the simulator. If the simulator is being ignored,
+# these expand into SIM= and SIM_OBJ=, overriding the entries from
+# target_makefile_frag
+#
+@IGNORE_SIM@
+@IGNORE_SIM_OBS@
+
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
"against=$(against)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
@@ -265,6 +425,8 @@ FLAGS_TO_PASS = \
"DLLTOOL=$(DLLTOOL)" \
"RANLIB=$(RANLIB)" \
"MAKEINFO=$(MAKEINFO)" \
+ "MAKEHTML=$(MAKEHTML)" \
+ "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
"INSTALL=$(INSTALL)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
@@ -347,6 +509,7 @@ TARGET_FLAGS_TO_PASS = \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"MAKEINFO=$(MAKEINFO)" \
+ "MAKEHTML=$(MAKEHTML)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)"
@@ -357,16 +520,22 @@ TARGET_FLAGS_TO_PASS = \
SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \
ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \
- command.c complaints.c corefile.c cp-valprint.c dbxread.c \
+ complaints.c completer.c corefile.c cp-valprint.c dbxread.c \
demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \
+ event-loop.c event-top.c \
expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
- findvar.c gdbarch.c gdbtypes.c infcmd.c inflow.c infrun.c language.c \
+ findvar.c regcache.c gdbarch.c arch-utils.c gdbtypes.c \
+ inf-loop.c infcmd.c inflow.c infrun.c language.c \
+ kod.c kod-cisco.c \
+ ui-out.c cli-out.c \
+ varobj.c wrapper.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
- mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
+ memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \
+ p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \
printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \
- scm-valprint.c source.c stabsread.c stack.c symfile.c \
- symmisc.c symtab.c target.c thread.c top.c tracepoint.c \
+ scm-valprint.c signals.c source.c stabsread.c stack.c symfile.c \
+ symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \
typeprint.c utils.c valarith.c valops.c valprint.c values.c \
serial.c ser-unix.c mdebugread.c os9kread.c \
tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \
@@ -375,9 +544,13 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
tui/tuiGeneralWin.h tui/tuiIO.c tui/tuiIO.h tui/tuiLayout.c \
tui/tuiLayout.h tui/tuiRegs.c tui/tuiRegs.h tui/tuiSource.c \
tui/tuiSource.h tui/tuiSourceWin.c tui/tuiSourceWin.h \
- tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h
+ tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h \
+ tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \
+ ui-file.h ui-file.c \
+ frame.c doublest.c \
+ gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c
-LINTFILES = $(SFILES) $(YYFILES) @CONFIG_SRCS@ init.c
+LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
# "system" headers. Using these in dependencies is a rather personal
# choice. (-rich, summer 1993)
@@ -387,13 +560,10 @@ LINTFILES = $(SFILES) $(YYFILES) @CONFIG_SRCS@ init.c
getopt_h = $(INCLUDE_DIR)/getopt.h
floatformat_h = $(INCLUDE_DIR)/floatformat.h
bfd_h = $(BFD_DIR)/bfd.h
-wait_h = $(INCLUDE_DIR)/wait.h
-dis-asm_h = $(INCLUDE_DIR)/dis-asm.h
+dis_asm_h = $(INCLUDE_DIR)/dis-asm.h
remote-sim_h = $(INCLUDE_DIR)/remote-sim.h
-
-dcache_h = dcache.h
-remote_utils_h = $(dcache_h) serial.h target.h remote-utils.h $(remote-sim_h)
-
+demangle_h = $(INCLUDE_DIR)/demangle.h
+obstack_h = $(INCLUDE_DIR)/obstack.h
readline_headers = \
$(READLINE_SRC)/chardefs.h \
@@ -409,24 +579,75 @@ udiheaders = \
$(srcdir)/29k-share/udi/udipt29k.h \
$(srcdir)/29k-share/udi/udisoc.h
-gdbcore_h = gdbcore.h $(bfd_h)
-
-frame_h = frame.h
-symtab_h = symtab.h bcache.h
-gdbtypes_h = gdbtypes.h
-expression_h = expression.h
-value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h)
+xm_h = @xm_h@
+tm_h = @tm_h@
+nm_h = @nm_h@
+annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
+arch_utils_h = arch-utils.h
+ax_h = ax.h $(doublest_h)
+bcache_h = bcache.h
breakpoint_h = breakpoint.h $(frame_h) $(value_h)
-
+buildsym_h = buildsym.h
+c_lang_h = c-lang.h $(value_h)
+call_cmds_h = call-cmds.h
+cli_cmds_h = $(srcdir)/cli/cli-cmds.h
+cli_decode_h = $(srcdir)/cli/cli-decode.h
+cli_out_h = cli-out.h
+cli_script_h = $(srcdir)/cli/cli-script.h
+cli_setshow_h = $(srcdir)/cli/cli-setshow.h
+cli_utils_h = $(srcdir)/cli/cli-utils.h
command_h = command.h
-gdbcmd_h = gdbcmd.h $(command_h)
-
-defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h
-
+complaints_h = complaints.h
+completer_h = completer.h
+cp_abi_h = cp-abi.h
+dcache_h = dcache.h
+defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h \
+ gdbarch.h ui-file.h
+doublest_h = doublest.h $(floatformat_h)
+dwarf2cfi_h = dwarf2cfi.h
+event_loop_h = event-loop.h
+event_top_h = event-top.h
+expression_h = expression.h $(doublest_h) $(symtab_h)
+frame_h = frame.h
+gdb_h = gdb.h
+gdb_events_h = gdb-events.h
+gdb_stabs_h = gdb-stabs.h
+gdb_string_h = gdb_string.h
+gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h)
+gdbcore_h = gdbcore.h $(bfd_h)
+gdbthread_h = gdbthread.h $(breakpoint_h)
+gdbtypes_h = gdbtypes.h
+inf_loop_h = inf-loop.h
inferior_h = inferior.h $(breakpoint_h)
+language_h = language.h
+linespec_h = linespec.h
+memattr_h = memattr.h
+monitor_h = monitor.h
+objfiles_h = objfiles.h
+parser_defs_h = parser-defs.h $(doublest_h)
+regcache_h = regcache.h
+remote_h = remote.h
+remote_utils_h = remote-utils.h $(target_h)
+ser_unix_h = ser-unix.h
+serial_h = serial.h
+solist_h = solist.h
+source_h = source.h
+stabsread_h = stabsread.h
+symfile_h = symfile.h
+symtab_h = symtab.h $(bcache_h)
+target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
+terminal_h = terminal.h
+top_h = top.h
tracepoint_h = tracepoint.h
-ax_h = ax.h
+typeprint_h = typeprint.h
+ui_out_h = ui-out.h
+valprint_h = valprint.h
+value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) $(doublest_h)
+varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
+version_h = version.h
+wrapper_h = wrapper.h
+xcoffsolib_h = xcoffsolib.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -435,13 +656,13 @@ ax_h = ax.h
# right, it is probably easiest just to list .h files here directly.
HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
- dst.h environ.h $(gdbcmd_h) gdbcore.h \
- gdb-stabs.h hpread.h $(inferior_h) language.h minimon.h monitor.h \
- objfiles.h parser-defs.h partial-stab.h serial.h signals.h solib.h \
+ dst.h environ.h $(gdbcmd_h) gdb.h gdbcore.h \
+ gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \
+ objfiles.h parser-defs.h serial.h solib.h \
symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
c-lang.h ch-lang.h f-lang.h \
jv-lang.h \
- m2-lang.h \
+ m2-lang.h p-lang.h \
complaints.h valprint.h \
29k-share/udi/udiids.h 29k-share/udi_soc nindy-share/b.out.h \
nindy-share/block_io.h nindy-share/coff.h \
@@ -461,61 +682,61 @@ INFOFILES = gdb.info*
REMOTE_EXAMPLES = m68k-stub.c i386-stub.c sparc-stub.c rem-multi.shar
-POSSLIBS = gnu-regex.c gnu-regex.h
-
# {X,T,NAT}DEPFILES are something of a pain in that it's hard to
# default their values the way we do for SER_HARDWIRE; in the future
# maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
# variables analogous to SER_HARDWIRE which get defaulted in this
# Makefile.in
-DEPFILES = $(TDEPFILES) $(XDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \
- $(REMOTE_OBS) $(SIM_OBS) @CONFIG_OBS@
+DEPFILES = $(TDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \
+ $(REMOTE_OBS) $(SIM_OBS) $(CONFIG_LIB_OBS)
-SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) @CONFIG_SRCS@
+SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS)
# Don't include YYFILES (*.tab.c) because we already include *.y in SFILES,
# and it's more useful to see it in the .y file.
TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
- $(POSSLIBS)
+ $(SUBDIR_CLI_SRCS)
TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
-COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
+COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
- expprint.o environ.o gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
- mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
+ symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \
+ expprint.o environ.o stack.o thread.o \
+ event-loop.o event-top.o inf-loop.o completer.o \
+ gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \
+ memattr.o mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
+ signals.o \
+ kod.o kod-cisco.o \
+ gdb-events.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
c-lang.o ch-exp.o ch-lang.o f-lang.o \
+ ui-out.o cli-out.o \
+ varobj.o wrapper.o \
jv-lang.o jv-valprint.o jv-typeprint.o \
- m2-lang.o \
+ m2-lang.o p-lang.o p-typeprint.o p-valprint.o \
scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \
c-typeprint.o ch-typeprint.o f-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \
- nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o
-
-OBS = $(COMMON_OBS) $(ANNOTATE_OBS) main.o
+ nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \
+ ui-file.o \
+ frame.o doublest.o \
+ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o
-LIBGDB_OBS =
+OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
TSOBS = inflow.o
-NTSOBS = standalone.o
-
-NTSSTART = kdb-start.o
-
-SUBDIRS = doc \
- testsuite \
- nlm
+SUBDIRS = @SUBDIRS@
# For now, shortcut the "configure GDB for fewer languages" stuff.
YYFILES = c-exp.tab.c \
jv-exp.tab.c \
- f-exp.tab.c m2-exp.tab.c
+ f-exp.tab.c m2-exp.tab.c p-exp.tab.c
YYOBJ = c-exp.tab.o \
jv-exp.tab.o \
- f-exp.tab.o m2-exp.tab.o
+ f-exp.tab.o m2-exp.tab.o p-exp.tab.o
# Things which need to be built when making a distribution.
@@ -526,7 +747,7 @@ DISTSTUFF = $(YYFILES)
.c.o:
$(CC) -c $(INTERNAL_CFLAGS) $<
-all: gdb$(EXEEXT)
+all: gdb$(EXEEXT) $(CONFIG_ALL)
@$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
installcheck:
@@ -541,7 +762,7 @@ check: force
$(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
else true; fi
-info dvi install-info clean-info: force
+info dvi install-info clean-info html install-html: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
gdb.z:gdb.1
@@ -555,7 +776,7 @@ gdb.z:gdb.1
# time it takes for make to check that all is up to date.
# install-only is intended to address that need.
install: all install-only
-install-only:
+install-only: $(CONFIG_INSTALL)
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
@@ -563,11 +784,13 @@ install-only:
else \
true ; \
fi ; \
+ $(srcdir)/../mkinstalldirs $(bindir) ; \
$(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
+ $(srcdir)/../mkinstalldirs $(man1dir) ; \
$(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
-uninstall: force
+uninstall: force $(CONFIG_UNINSTALL)
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
@@ -576,11 +799,12 @@ uninstall: force
true ; \
fi ; \
rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1
+ rm -rf $(GDBTK_LIBRARY)
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
# We do this by grepping through sources. If that turns out to be too slow,
# maybe we could just require every .o file to have an initialization routine
-# of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
+# of a given name (top.o -> _initialize_top, etc.).
#
# Formatting conventions: The name of the _initialize_* routines must start
# in column zero, and must not be inside #if.
@@ -588,18 +812,21 @@ uninstall: force
# Note that the set of files with init functions might change, or the names
# of the functions might change, so this files needs to depend on all the
# object files that will be linked into gdb.
+#
+# FIXME: There are 2 problems with this approach. First, if the INIT_FILES
+# list includes a file twice (because of some mistake somewhere else)
+# the _initialize_* function will be included twice in init.c. Second,
+# init.c may force unnecessary files to be linked in.
+#
-init.c: $(OBS) $(TSOBS)
+INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_OBS) $(CONFIG_INITS)
+init.c: $(INIT_FILES)
@echo Making init.c
- @rm -f init.c-tmp
- @echo '/* Do not modify this file. */' >init.c-tmp
- @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
- @echo '#include "ansidecl.h"' >>init.c-tmp
- @echo 'extern void initialize_all_files PARAMS ((void));' >>init.c-tmp
- @echo 'void initialize_all_files PARAMS ((void)) {' >>init.c-tmp
- @-echo $(OBS) $(TSOBS) | \
+ @rm -f init.c-tmp init.l-tmp
+ @-echo $(INIT_FILES) | \
tr ' ' '\012' | \
sed -e '/^Onindy.o/d' \
+ -e '/^init.o/d' \
-e '/^nindy.o/d' \
-e '/ttyflush.o/d' \
-e '/xdr_ld.o/d' \
@@ -614,35 +841,43 @@ init.c: $(OBS) $(TSOBS)
-e 's/\.o/.c/' \
-e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \
while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \
- sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 PARAMS ((void)); \1 ();}/' >>init.c-tmp
+ sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' > init.l-tmp
+ @echo '/* Do not modify this file. */' >>init.c-tmp
+ @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
+ @echo '#include "defs.h"' >>init.c-tmp
+ @echo '#include "call-cmds.h"' >>init.c-tmp
+ @sed -e 's/\(.*\)/extern initialize_file_ftype \1;/' <init.l-tmp >>init.c-tmp
+ @echo 'void' >>init.c-tmp
+ @echo 'initialize_all_files (void)' >>init.c-tmp
+ @echo '{' >>init.c-tmp
+ @sed -e 's/\(.*\)/ \1 ();/' <init.l-tmp >>init.c-tmp
@echo '}' >>init.c-tmp
+ @rm init.l-tmp
@mv init.c-tmp init.c
.PRECIOUS: init.c
+init.o: init.c $(defs_h) $(call_cmds_h)
+
# Removing the old gdb first works better if it is running, at least on SunOS.
-gdb$(EXEEXT): $(OBS) $(BUILD_TUI) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o
+gdb$(EXEEXT): main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
rm -f gdb$(EXEEXT)
$(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \
- init.o $(OBS) $(TSOBS) $(TUI_LIBRARY) $(ADD_FILES) $(CLIBS) $(LOADLIBES)
+ main.o libgdb.a $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\
+ $(LOADLIBES)
nlm: force
rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do
-libgdb: libgdb-files $(LIBGDB_OBS)
-
-# libproc is not listed here because all-libproc is a dependency of all-gui,
-# not all-gdb, and thus might be built after us.
-LIBGDBDEPS=$(COMMON_OBS) $(LIBGDB_OBS) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o
-# libproc needs to be before libiberty for alloca.
-LIBGDBFILES=$(COMMON_OBS) $(LIBGDB_OBS) $(TSOBS) ../libproc/libproc.a \
- $(ADD_DEPS) $(CDEPS) init.o
-
-libgdb-files: $(LIBGDBDEPS) Makefile.in
- -rm -f libgdb-files
- for i in $(LIBGDBFILES); do\
- echo $$i >> libgdb-files;\
- done
+# Create a library of the gdb object files and build GDB by linking
+# against that.
+#
+# init.o is very important. It pulls in the rest of GDB.
+LIBGDB_OBS= $(OBS) $(TSOBS) $(ADD_FILES) init.o
+libgdb.a: $(LIBGDB_OBS)
+ -rm -f libgdb.a
+ $(AR) q libgdb.a $(LIBGDB_OBS)
+ $(RANLIB) libgdb.a
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
#setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS
@@ -650,11 +885,13 @@ saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
#unload $(srcdir)/c-exp.y
#unload $(srcdir)/jv-exp.y
#unload $(srcdir)/m2-exp.y
+ #unload $(srcdir)/p-exp.y
#unload vx-share/*.h
#unload nindy-share/[A-Z]*
#load c-exp.tab.c
#load jv-exp.tab.c
#load m2-exp.tab.c
+ #load p-exp.tab.c
#load copying.c version.c
#load ../opcodes/libopcodes.a
#load ../libiberty/libiberty.a
@@ -686,27 +923,14 @@ gdb1$(EXEEXT): gdb$(EXEEXT)
# for some machines.
# But these rules don't do what we want; we want to hack the foo.o: tm.h
# dependency to do the right thing.
-tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h: tm-m68k.h
+tm-sun3.h tm-hp300bsd.h tm-altos.h: tm-m68k.h
tm-hp300hpux.h tm-sun2.h tm-3b1.h: tm-m68k.h
-xm-news1000.h: xm-news.h
xm-i386-sv32.h: xm-i386.h
tm-i386gas.h: tm-i386.h
-xm-sun4os4.h: xm-sparc.h
tm-sun4os4.h: tm-sparc.h
xm-vaxult.h: xm-vax.h
xm-vaxbsd.h: xm-vax.h
-kdb: $(NTSSTART) $(OBS) $(NTSOBS) $(ADD_DEPS) $(CDEPS)
- ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- -lc $(CLIBS)
-
-# Have the TUI library depend on a phony target, so we'll always
-# recurse and make sure it's up to date. If it is, then the file will
-# be unchanged, and we won't rebuild it.
-# .PHONY: check-tui
-all-tui:
- @(cd tui; ${MAKE} ${FLAGS_TO_PASS} all)
-
# Put the proper machine-specific files first, so M-. on a machine
# specific routine gets the one for the correct machine. (FIXME: those
# files go in twice; we should be removing them from the main list).
@@ -728,19 +952,24 @@ TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
tags: TAGS
-clean mostlyclean:
+clean mostlyclean: $(CONFIG_CLEAN)
@$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do
- rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp
+ rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp
rm -f init.c version.c
- rm -f gdb$(EXEEXT) core make.log libgdb-files
+ rm -f gdb$(EXEEXT) core make.log
rm -f gdb[0-9]$(EXEEXT)
# This used to depend on c-exp.tab.c m2-exp.tab.c TAGS
# I believe this is wrong; the makefile standards for distclean just
# describe removing files; the only sort of "re-create a distribution"
# functionality described is if the distributed files are unmodified.
+# NB: While GDBSERVER might be configured on native systems, it isn't
+# always included in SUBDIRS. Remove the gdbserver files explictly.
distclean: clean
@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do
+ rm -f gdbserver/config.status gdbserver/config.log
+ rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h
+ rm -f gdbserver/Makefile gdbserver/config.cache
rm -f nm.h tm.h xm.h config.status config.h stamp-h .gdbinit
rm -f y.output yacc.acts yacc.tmp y.tab.h
rm -f config.log config.cache
@@ -754,7 +983,7 @@ local-maintainer-clean:
@echo "it deletes files that may require special tools to rebuild."
rm -f c-exp.tab.c \
jv-exp.tab \
- f-exp.tab.c m2-exp.tab.c
+ f-exp.tab.c m2-exp.tab.c p-exp.tab.c
rm -f TAGS $(INFOFILES)
rm -f $(YYFILES)
rm -f nm.h tm.h xm.h config.status
@@ -764,7 +993,7 @@ do-maintainer-clean:
subdir_do
diststuff: $(DISTSTUFF)
- cd doc; $(MAKE) $(MFLAGS) all-doc
+ cd doc; $(MAKE) $(MFLAGS) diststuff
subdir_do: force
@for i in $(DODIRS); do \
@@ -805,13 +1034,20 @@ doc/gdb.info:
cd doc; $(MAKE) gdb.info $(FLAGS_TO_PASS)
# Make copying.c from COPYING
-copying.c: COPYING copying.awk
- awk -f $(srcdir)/copying.awk < $(srcdir)/COPYING > copying.c
-
-version.c: Makefile
- echo 'char *version = "$(VERSION)";' >version.c
- echo 'char *host_name = "$(host_alias)";' >> version.c
- echo 'char *target_name = "$(target_alias)";' >> version.c
+$(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ \
+ $(srcdir)/COPYING $(srcdir)/copying.awk
+ awk -f $(srcdir)/copying.awk \
+ < $(srcdir)/COPYING > $(srcdir)/copying.tmp
+ mv $(srcdir)/copying.tmp $(srcdir)/copying.c
+
+version.c: Makefile version.in
+ rm -f version.c-tmp version.c
+ echo '#include "version.h"' >> version.c-tmp
+ echo 'const char version[] = "'"`sed q ${srcdir}/version.in`"'";' >> version.c-tmp
+ echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp
+ echo 'const char target_name[] = "$(target_alias)";' >> version.c-tmp
+ mv version.c-tmp version.c
+version.o: version.c $(version_h)
# c-exp.tab.c is generated in objdir from c-exp.y if it doesn't exist
# in srcdir, then compiled in objdir to c-exp.tab.o.
@@ -822,7 +1058,6 @@ version.c: Makefile
# Remove bogus decls for malloc/realloc/free which conflict with everything
# else. Strictly speaking c-exp.tab.c should therefore depend on
# Makefile.in, but that was a pretty big annoyance.
-c-exp.tab.o: c-exp.tab.c
c-exp.tab.c: c-exp.y
$(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
@@ -882,9 +1117,27 @@ m2-exp.tab.c: m2-exp.y
-rm m2-exp.tmp
mv m2-exp.new ./m2-exp.tab.c
+# p-exp.tab.c is generated in objdir from p-exp.y if it doesn't exist
+# in srcdir, then compiled in objdir to p-exp.tab.o.
+# Remove bogus decls for malloc/realloc/free which conflict with everything
+# else.
+p-exp.tab.o: p-exp.tab.c
+p-exp.tab.c: p-exp.y
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/p-exp.y y.tab.c p-exp.tmp -- $(YFLAGS)
+ -sed -e '/extern.*malloc/d' \
+ -e '/extern.*realloc/d' \
+ -e '/extern.*free/d' \
+ -e '/include.*malloc.h/d' \
+ -e 's/malloc/xmalloc/g' \
+ -e 's/realloc/xrealloc/g' \
+ -e '/^#line.*y.tab.c/d' \
+ < p-exp.tmp > p-exp.new
+ -rm p-exp.tmp
+ mv p-exp.new ./p-exp.tab.c
+
# These files are updated atomically, so make never has to remove them
.PRECIOUS: m2-exp.tab.c f-exp.tab.c c-exp.tab.c
-.PRECIOUS: jv-exp.tab.c
+.PRECIOUS: jv-exp.tab.c p-exp.tab.c
lint: $(LINTFILES)
$(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
@@ -914,42 +1167,54 @@ unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
29k-share/udi/udi2go32.c \
a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
- altos-xdep.c arm-convert.s \
- arm-tdep.c arm-xdep.c coff-solib.c \
- convex-tdep.c convex-xdep.c \
+ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c armnbsd-nat.c \
+ armnbsd-tdep.c \
+ avr-tdep.c \
+ coff-solib.c \
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
- go32-xdep.c gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
- hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \
- hp-psymtab-read.c hp-symtab-read.c \
- i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \
+ go32-nat.c h8300-tdep.c h8500-tdep.c \
+ hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c hpread.c \
+ i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \
i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \
- i387-tdep.c \
+ i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \
+ i387-tdep.c i387-nat.c \
+ i386-linux-tdep.c i386-nat.c \
i960-tdep.c \
- infptrace.c inftarg.c irix4-nat.c irix5-nat.c isi-xdep.c \
+ ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \
+ infptrace.c inftarg.c irix4-nat.c irix5-nat.c \
lynx-nat.c m3-nat.c \
+ m68hc11-tdep.c \
m68k-tdep.c \
- m88k-nat.c m88k-tdep.c mac-nat.c mips-nat.c \
- mips-tdep.c mipsm3-nat.c mipsv4-nat.c news-xdep.c \
+ m88k-nat.c m88k-tdep.c mac-nat.c \
+ mcore-tdep.c \
+ mips-linux-nat.c mips-linux-tdep.c \
+ mips-nat.c \
+ mips-tdep.c mipsm3-nat.c mipsv4-nat.c \
nindy-share/Onindy.c nindy-share/nindy.c \
nindy-share/ttyflush.c nindy-tdep.c \
- ns32k-tdep.c ns32km3-nat.c osfsolib.c \
+ ns32k-tdep.c solib-osf.c \
somread.c somsolib.c $(HPREAD_SOURCE) \
- procfs.c pyr-tdep.c pyr-xdep.c \
+ ppc-linux-nat.c ppc-linux-tdep.c \
+ procfs.c \
remote-adapt.c remote-array.c remote-bug.c remote-e7000.c remote-eb.c \
remote-es.c remote-hms.c remote-mips.c \
remote-mm.c remote-nindy.c remote-os9k.c remote-rdp.c remote-sim.c \
remote-st.c remote-utils.c dcache.c \
remote-udi.c remote-vx.c remote-vx29k.c \
rs6000-nat.c rs6000-tdep.c \
- ser-go32.c ser-ocd.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \
- sparc-tdep.c sparcl-tdep.c sun3-nat.c sun386-nat.c \
+ s390-tdep.c s390-nat.c \
+ ser-go32.c ser-pipe.c ser-tcp.c \
+ sh-tdep.c solib.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \
+ sparc-nat.c \
+ sparc-tdep.c sparcl-tdep.c sun3-nat.c \
symm-tdep.c symm-nat.c \
- tahoe-tdep.c ultra3-nat.c ultra3-xdep.c umax-xdep.c \
vax-tdep.c \
vx-share/xdr_ld.c vx-share/xdr_ptrace.c vx-share/xdr_rdb.c \
win32-nat.c \
- xcoffread.c xcoffsolib.c z8k-tdep.c
+ xcoffread.c xcoffsolib.c \
+ xstormy16-tdep.c \
+ z8k-tdep.c
udip2soc.o: $(srcdir)/29k-share/udi/udip2soc.c $(udiheaders)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udip2soc.c
@@ -960,400 +1225,656 @@ udi2go32.o: $(srcdir)/29k-share/udi/udi2go32.c $(udiheaders)
udr.o: $(srcdir)/29k-share/udi/udr.c $(udiheaders)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udr.c
-a29k-tdep.o: a29k-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h)
+# OBSOLETE a29k-tdep.o: a29k-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
+# OBSOLETE $(regcache_h)
-a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+ $(regcache_h)
-alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h
+alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
+ $(regcache_h)
alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h
+ $(inferior_h) $(symtab_h) $(dis_asm_h) $(gdb_string_h) $(linespec_h) \
+ $(regcache_h) $(doublest_h)
+
+annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) $(gdbtypes_h)
-altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
+arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ $(gdb_string_h) $(regcache_h) arm-tdep.h
-annotate.o: annotate.c $(defs_h) annotate.h $(value_h) target.h $(gdbtypes_h)
+arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
+ $(gdbtypes_h) $(floatformat_h) $(regcache_h) $(doublest_h) arm-tdep.h
-arm-tdep.o: arm-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
+arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) $(doublest_h) \
+ $(value_h) $(arch_utils_h) $(solib_svr4_h) arm-tdep.h \
+ $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/coff/internal.h \
+ $(INCLUDE_DIR)/elf/arm.h
+
+armnbsd-nat.o: armnbsd-nat.c $(defs_h) arm-tdep.h $(inferior_h) $(regcache_h) \
$(gdbcore_h)
-bcache.o: bcache.c bcache.h $(defs_h)
+armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) arm-tdep.h
+
+avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
+ $(symfile_h) $(regcache_h) $(arch_utils_h)
+
+bcache.o: bcache.c $(bcache_h) $(defs_h)
blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- objfiles.h symfile.h target.h
+ $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h)
breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) language.h target.h gdbthread.h gdb_string.h
+ $(inferior_h) $(language_h) $(target_h) $(gdbthread_h) \
+ $(gdb_string_h) $(gdb_events_h) $(linespec_h) $(ui_out_h) \
+ $(completer_h) $(gdb_h)
-buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- objfiles.h symfile.h $(symtab_h) gdb_string.h
+buildsym.o: buildsym.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h)
-c-lang.o: c-lang.c c-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h parser-defs.h $(symtab_h)
+c-lang.o: c-lang.c $(c_lang_h) $(defs_h) $(expression_h) $(gdbtypes_h) \
+ $(language_h) $(parser_defs_h) $(symtab_h)
-c-typeprint.o: c-typeprint.c c-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \
- target.h typeprint.h $(value_h) gdb_string.h
+c-typeprint.o: c-typeprint.c $(c_lang_h) $(defs_h) $(expression_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
+ $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h) $(cp_abi_h)
c-valprint.o: c-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h $(symtab_h) valprint.h $(value_h)
+ $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(cp_abi_h)
+
+doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) $(gdbtypes_h) \
+ gdb_assert.h gdb_string.h
f-lang.o: f-lang.c f-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h parser-defs.h $(symtab_h) gdb_string.h
+ $(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h)
f-typeprint.o: f-typeprint.c f-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \
- target.h typeprint.h $(value_h) gdb_string.h
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
+ $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h)
f-valprint.o: f-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h $(symtab_h) valprint.h $(value_h) gdb_string.h
+ $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h)
-ch-exp.o: ch-exp.c ch-lang.h $(defs_h) language.h parser-defs.h $(bfd_h) symfile.h objfiles.h $(value_h)
+ch-exp.o: ch-exp.c ch-lang.h $(defs_h) $(language_h) $(parser_defs_h) \
+ $(bfd_h) $(symfile_h) $(objfiles_h) $(value_h)
ch-lang.o: ch-lang.c ch-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h parser-defs.h $(symtab_h)
+ $(language_h) $(parser_defs_h) $(symtab_h)
ch-typeprint.o: ch-typeprint.c ch-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \
- target.h $(value_h) typeprint.h gdb_string.h
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
+ $(target_h) $(value_h) $(typeprint_h) $(gdb_string_h)
ch-valprint.o: ch-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h $(symtab_h) valprint.h $(value_h) c-lang.h
+ $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(c_lang_h)
coff-solib.o: coff-solib.c $(defs_h)
-coffread.o: coffread.c $(bfd_h) $(breakpoint_h) buildsym.h \
- complaints.h $(defs_h) $(expression_h) $(gdbtypes_h) objfiles.h \
- symfile.h $(symtab_h) gdb-stabs.h stabsread.h target.h \
- gdb_string.h
-
-command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h $(wait_h)
+coffread.o: coffread.c $(bfd_h) $(breakpoint_h) $(buildsym_h) \
+ $(complaints_h) $(defs_h) $(expression_h) $(gdbtypes_h) $(objfiles_h) \
+ $(symfile_h) $(symtab_h) $(gdb_stabs_h) $(stabsread_h) $(target_h) \
+ $(gdb_string_h)
-complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h)
+complaints.o: complaints.c $(complaints_h) $(defs_h) $(gdbcmd_h)
-convex-tdep.o: convex-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(gdbcore_h) $(inferior_h)
+# Provide explicit rule/dependency - works for more makes.
+copying.o: $(srcdir)/copying.c $(defs_h) $(gdbcmd_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c
-convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h)
-
-copying.o: copying.c $(defs_h) $(gdbcmd_h)
-
-core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h)
+core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h) \
+ $(regcache_h)
core-sol2.o: core-sol2.c $(command_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h gdb_string.h
+ $(inferior_h) $(target_h) $(gdb_string_h) $(regcache_h)
core-regset.o: core-regset.c $(command_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h gdb_string.h
+ $(inferior_h) $(target_h) $(gdb_string_h)
-corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) target.h language.h gdb_string.h
+corefile.o: corefile.c $(dis_asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
+ $(inferior_h) $(target_h) $(language_h) $(gdb_string_h) \
+ $(completer_h) $(symfile_h)
corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
- target.h gdbthread.h gdb_string.h
+ $(target_h) $(gdbthread_h) $(gdb_string_h) $(regcache_h)
+
+gcore.o: gcore.c $(defs_h) $(command_h) $(inferior_h) $(gdbcore_h) \
+ $(BFD_SRC)/elf-bfd.h $(symfile_h) $(objfiles_h)
+
+linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(gregset_h) \
+ $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(BFD_SRC)/elf-bfd.h
+
+cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h)
cp-valprint.o: cp-valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h
+ $(gdbtypes_h) $(symtab_h) $(value_h) $(gdb_string_h) $(cp_abi_h)
-dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) gdb_string.h $(gdbcore_h)
+dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) $(gdb_string_h) \
+ $(gdbcore_h) $(target_h)
-dbxread.o: dbxread.c $(breakpoint_h) buildsym.h $(command_h) \
- complaints.h $(defs_h) $(expression_h) gdb-stabs.h $(gdbcore_h) \
- $(gdbtypes_h) language.h objfiles.h partial-stab.h stabsread.h \
- symfile.h $(symtab_h) target.h gdb_string.h
+dbxread.o: dbxread.c $(breakpoint_h) $(buildsym_h) $(command_h) \
+ $(complaints_h) $(defs_h) $(expression_h) $(gdb_stabs_h) $(gdbcore_h) \
+ $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ $(stabsread_h) $(symfile_h) $(symtab_h) $(target_h) $(gdb_string_h) \
+ $(cp_abi_h)
delta68-nat.o: delta68-nat.c $(defs_h)
-demangle.o: demangle.c $(defs_h) $(gdbcmd_h) gdb_string.h
+demangle.o: demangle.c $(defs_h) $(gdbcmd_h) $(gdb_string_h)
-dink32-rom.o: dink32-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h
+dink32-rom.o: dink32-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) \
+ $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
+ $(symfile_h) $(regcache_h)
-dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) gdb_string.h
+dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
-dstread.o: dstread.c gdb_string.h
+dstread.o: dstread.c $(gdb_string_h)
-dwarfread.o: dwarfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
- $(symtab_h) gdb_string.h
+dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(symtab_h) $(symfile_h) $(objfiles_h) \
+ $(target_h) $(inferior_h) $(regcache_h) $(dwarf2cfi_h)
-dwarf2read.o: dwarf2read.c $(bfd_h) buildsym.h $(defs_h) \
- $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
- $(symtab_h) gdb_string.h
+dwarfread.o: dwarfread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ $(symfile_h) $(symtab_h) $(gdb_string_h)
-elfread.o: elfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h \
+dwarf2read.o: dwarf2read.c $(bfd_h) $(buildsym_h) $(defs_h) \
+ $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ $(symfile_h) $(symtab_h) $(gdb_string_h)
+
+elfread.o: elfread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h) \
$(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/elf/mips.h
-environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) gdb_string.h
+environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) $(gdb_string_h)
eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
- $(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
- gdb_string.h
+ $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) $(value_h) \
+ $(gdb_string_h) $(cp_abi_h)
-exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
- target.h language.h gdb_string.h
+event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h) $(event_top_h)
-expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h parser-defs.h $(symtab_h) $(value_h)
+event-top.o: event-top.c $(top_h) $(readline_headers) \
+ $(defs_h) $(inferior_h) $(event_loop_h) $(event_top_h) $(terminal_h) \
+ $(gdbcmd_h) $(target_h)
-findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
- gdb_string.h
+inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(inf_loop_h) $(event_loop_h) \
+ $(event_top_h)
-fork-child.o: fork-child.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h terminal.h gdbthread.h gdb_string.h
+exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
+ $(target_h) $(language_h) $(gdb_string_h) $(completer_h) $(value_h)
+
+expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
+ $(language_h) $(parser_defs_h) $(symtab_h) $(value_h)
+
+findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
+ $(gdb_string_h) $(regcache_h)
+
+frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
+ $(regcache_h)
+
+regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
+
+fork-child.o: fork-child.c gdb_wait.h $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
+
+install-gdbtk:
+ $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(GDBTK_LIBRARY)/images \
+ $(GDBTK_LIBRARY)/images2 ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
+ $(GDBTK_LIBRARY)/help/images \
+ $(GDBTK_LIBRARY)/help/trace ; \
+ cd $(srcdir)/gdbtk/library ; \
+ for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \
+ do \
+ $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
+ done ;
+
+gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
+ $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
+
+gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
+ $(symtab_h) $(inferior_h) $(command_h) \
+ $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \
+ $(tracepoint_h) $(top_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(ITK_CFLAGS) $(TIX_CFLAGS) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" -DSRC_DIR=\"$(GDBTK_SRC_DIR)\"
+
+gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(defs_h) $(breakpoint_h) $(tracepoint_h) $(symfile_h) $(symtab_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(defs_h) $(symtab_h) $(inferior_h) \
+ $(command_h) $(bfd_h) $(top_h) $(symfile_h) $(objfiles_h) $(target_h) \
+ $(gdb_string_h) $(tracepoint_h) $(source_h) $(regcache_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
+ $(symtab_h) $(inferior_h) $(command_h) \
+ $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \
+ $(tracepoint_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(defs_h) $(frame_h) $(value_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
+ $(defs_h) $(frame_h) $(value_h) $(target_h) $(breakpoint_h) \
+ $(linespec_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h \
+ $(defs_h) $(value_h) $(varobj_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-varobj.c
+
+gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.c
+
+v850ice.o: v850ice.c $(defs_h) $(symtab_h) $(inferior_h) $(command_h) \
+ $(frame_h) $(breakpoint_h) $(gdbcore_h) $(value_h) $(symfile_h) \
+ $(gdb_string_h) $(target_h) $(objfiles_h) $(regcache_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/v850ice.c
+
+v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(obstack_h) \
+ $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \
+ $(symfile_h) $(arch_utils_h) $(regcache_h)
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \
- $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \
- language.h gdb_string.h $(readline_headers)
+ $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) \
+ $(language_h) $(gdb_string_h) $(readline_headers) $(remote_h) \
+ $(linespec_h) $(regcache_h) $(completer_h)
gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h)
-gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \
- $(gdbtypes_h) language.h objfiles.h symfile.h $(symtab_h) target.h \
- $(value_h) gdb_string.h
+arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \
+ $(arch_utils_h) gdb_assert.h
-gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
- exc_request_U.h msg_U.h gnu-nat.h
+gdbtypes.o: gdbtypes.c $(bfd_h) $(complaints_h) $(defs_h) $(expression_h) \
+ $(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \
+ $(target_h) $(value_h) $(gdb_string_h) $(wrapper_h) $(cp_abi_h)
-go32-xdep.o: go32-xdep.c
+go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \
+ $(command_h) $(floatformat_h) $(target_h) i387-nat.h $(regcache_h)
-# OBSOLETE gould-tdep.o: gould-tdep.c $(OP_INCLUDE)/np1.h $(defs_h) $(frame_h) \
-# OBSOLETE $(gdbcore_h) $(symtab_h)
+gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
+ exc_request_U.h msg_U.h gnu-nat.h
-# OBSOLETE gould-xdep.o: gould-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
+gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \
+ $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h)
-h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h)
+gnu-v3-abi.o: gnu-v2-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h)
+
+h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(regcache_h)
-h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) \
+h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h) \
$(expression_h) $(frame_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) \
- $(value_h)
+ $(value_h) $(regcache_h)
+
+hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+hpacc-abi.o: hpacc-abi.c $(defs_h) $(cp_abi_h) $(gdb_string_h) $(gdbtypes_h) \
+ $(value_h) $(gdbcore_h)
-hppa-tdep.o: hppa-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) objfiles.h symfile.h target.h
+hppa-tdep.o: hppa-tdep.c gdb_wait.h $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
+ $(inferior_h) $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h) \
+ $(completer_h)
-hppab-nat.o: hppab-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h
+hppab-nat.o: hppab-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
+ $(regcache_h)
-hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h
+hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
+ $(regcache_h)
i386gnu-nat.o: gnu-nat.h
-i386-tdep.o: i386-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
- gdb_string.h
+i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) \
+ $(inferior_h) $(gdbcore_h) $(target_h) $(floatformat_h) \
+ $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) \
+ $(doublest_h) $(value_h)
+
+i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h)
i386aix-nat.o: i386aix-nat.c $(defs_h) $(frame_h) $(inferior_h) \
- language.h $(gdbcore_h) $(floatformat_h) target.h
+ $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h)
+
+i386b-nat.o: i386b-nat.c $(defs_h) $(regcache_h)
-i386b-nat.o: i386b-nat.c $(defs_h)
+i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(frame_h) $(gdb_core_h) \
+ $(regcache_h)
-i386ly-nat.o: i386ly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h
+i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h)
-i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) target.h $(gdbcore_h)
+i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h)
-i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) target.h
+i386ly-nat.o: i386ly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h)
-i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
+ $(regcache_h)
+
+i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) $(target_h) \
+ $(regcache_h)
+
+i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+ $(regcache_h)
i386v-nat.o: i386v-nat.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) language.h target.h
+ $(inferior_h) $(language_h) $(target_h)
+
+i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ $(symtab_h) $(symfile_h) $(objfiles_h) $(regcache_h)
-i386v4-nat.o: i386v4-nat.c $(defs_h)
+i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
+ $(value_h) $(regcache_h)
+
+i386v4-nat.o: i386v4-nat.c $(defs_h) $(regcache_h)
i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) language.h
+ $(inferior_h) $(language_h) $(regcache_h) $(doublest_h) i386-tdep.h
+
+i387-nat.o: i387-nat.c $(defs_h) $(inferior_h) $(value_h) $(regcache_h) \
+ i387-nat.h
i960-tdep.o: i960-tdep.c $(floatformat_h) $(defs_h) $(expression_h) \
- $(frame_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(gdbcore_h)
+ $(frame_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(gdbcore_h) \
+ $(regcache_h)
+
+ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \
+ $(gdbcore_h) $(regcache_h)
+
+ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h)
+
+ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
+ $(arch_utils_h) $(floatformat_h) $(objfiles_h) $(value_h) \
+ $(INCLUDE_DIR)/elf/common.h $(regcache_h) $(doublest_h)
infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) target.h language.h gdb_string.h
+ $(inferior_h) $(target_h) $(language_h) $(symfile_h) $(gdb_string_h) \
+ $(ui_out_h) $(completer_h)
inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \
- signals.h target.h terminal.h gdbthread.h gdb_string.h
+ $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
-infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
- gdb_string.h $(wait_h) $(command_h)
+infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
+ $(gdb_string_h) gdb_wait.h $(command_h) $(regcache_h)
-infrun.o: infrun.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) target.h gdbthread.h gdb_string.h
+infrun.o: infrun.c gdb_wait.h $(defs_h) $(gdbcmd_h) $(cli_script_h) \
+ $(gdbcore_h) $(value_h) \
+ $(inferior_h) $(target_h) $(gdbthread_h) $(gdb_string_h) $(event_loop_h) \
+ $(event_top_h) $(regcache_h)
-inftarg.o: inftarg.c $(wait_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
- target.h terminal.h $(command_h)
+inftarg.o: inftarg.c gdb_wait.h $(defs_h) $(gdbcore_h) $(inferior_h) \
+ $(target_h) $(terminal_h) $(command_h)
-irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h)
-irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) target.h \
- $(symtab_h) symfile.h objfiles.h $(command_h) $(frame_h) gnu-regex.h \
- language.h gdb_string.h
-
-isi-xdep.o: isi-xdep.c
+irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h)
+irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
+ $(symtab_h) $(symfile_h) $(objfiles_h) $(command_h) $(frame_h) \
+ gdb_regex.h $(language_h) $(gdb_string_h) $(regcache_h)
jv-lang.o: jv-lang.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
- $(expression_h) parser-defs.h language.h symfile.h objfiles.h \
- gdb_string.h $(value_h) c-lang.h jv-lang.h $(gdbcore_h)
+ $(expression_h) $(parser_defs_h) $(language_h) $(symfile_h) \
+ $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) jv-lang.h \
+ $(gdbcore_h)
jv-typeprint.o: jv-typeprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
- $(value_h) $(INCLUDE_DIR)/demangle.h jv-lang.h gdb_string.h \
- typeprint.h
+ $(value_h) $(demangle_h) jv-lang.h $(gdb_string_h) \
+ $(typeprint_h) $(c_lang_h) $(cp_abi_h)
jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
- $(expression_h) $(value_h) $(INCLUDE_DIR)/demangle.h valprint.h \
- language.h jv-lang.h c-lang.h
+ $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \
+ $(language_h) jv-lang.h $(c_lang_h) gdbcore.h $(annotate_h)
+
+kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) $(target_h) $(gdb_string_h) \
+ kod.h
+
+kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) kod.h
language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
- $(gdbcmd_h) $(gdbtypes_h) language.h parser-defs.h $(symtab_h) \
- target.h $(value_h) gdb_string.h
+ $(gdbcmd_h) $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) \
+ $(target_h) $(value_h) $(gdb_string_h)
lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcore_h) \
- target.h
+ $(target_h) $(regcache_h)
m2-lang.o: m2-lang.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h m2-lang.h parser-defs.h $(symtab_h)
+ $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h)
m2-typeprint.o: m2-typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) language.h m2-lang.h $(symtab_h) target.h \
- $(value_h) gdb_string.h
+ $(gdbcore_h) $(gdbtypes_h) $(language_h) m2-lang.h $(symtab_h) \
+ $(target_h) $(value_h) $(gdb_string_h)
m2-valprint.o: m2-valprint.c $(defs_h) $(gdbtypes_h) $(symtab_h) \
- valprint.h m2-lang.h
+ $(valprint_h) m2-lang.h
-m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) language.h target.h \
- $(wait_h) $(gdbcmd_h) $(gdbcore_h)
+m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) $(language_h) \
+ $(target_h) gdb_wait.h $(gdbcmd_h) $(gdbcore_h) $(regcache_h)
-m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
+p-lang.o: p-lang.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
+ $(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h)
+
+p-typeprint.o: p-typeprint.c p-lang.h $(defs_h) $(expression_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
+ $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h)
+
+p-valprint.o: p-valprint.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
+ $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h)
+
+m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
$(gdbcore_h) gdb_string.h
-m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h
+m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
+ $(gdbcore_h) $(gdb_string_h) $(regcache_h)
+
+m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h)
m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \
- $(language_h) $(gdbcore_h) $(floatformat_h) target.h
+ $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h)
+
+m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
+
+m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+mac-nat.o: mac-nat.c $(defs_h) $(gdb_string_h) $(regcache_h)
-m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
+main.o: main.c $(top_h) $(defs_h) $(gdb_string_h) $(event_loop_h) \
+ $(symfile_h) $(gdbcore_h) $(ui_out_h)
-mac-nat.o: mac-nat.c $(defs_h) gdb_string.h
+maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) \
+ $(language_h) $(expression_h) $(objfiles_h) $(symfile_h)
-main.o: main.c top.h $(defs_h) gdb_string.h
+mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) \
+ $(symtab_h) $(symfile_h) $(gdbcore_h) $(inferior_h)
-maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
- $(expression_h) objfiles.h symfile.h
+mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
+ $(gdb_string_h) $(regcache_h) $(serial_h)
-mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
- $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
- objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \
- gdb_string.h
+mdebugread.o: mdebugread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
+ $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
+ $(language_h) $(objfiles_h) $(stabsread_h) \
+ $(symfile_h) $(symtab_h) $(gdb_string_h)
-mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h)
+mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h)
-os9kread.o: os9kread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
- $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
- objfiles.h stabsread.h symfile.h $(symtab_h) \
- target.h gdb_string.h
+# os9kread assumes that sizeof(char*) <= sizeof(int). This looses on
+# 64 bit targets where often, sizeof(int)=4 but sizeof(char*)=9.
+os9kread.o: os9kread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
+ $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
+ $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \
+ $(symtab_h) $(target_h) $(gdb_string_h)
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
+ $(srcdir)/os9kread.c
mem-break.o: mem-break.c $(defs_h)
-minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
- $(symtab_h) gdb_string.h
+memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \
+ $(target_h) $(value_h) $(language_h) $(gdb_string_h)
-mips-nat.o: mips-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+minsyms.o: minsyms.c $(bfd_h) $(defs_h) $(objfiles_h) $(symfile_h) \
+ $(symtab_h) $(gdb_string_h) $(value_h) $(cp_abi_h)
+
+mips-linux-nat.o: mips-linux-nat.c $(defs_h)
+
+mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \
+ solib-svr4.h
+
+mips-nat.o: mips-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
mips-tdep.o: mips-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) language.h objfiles.h symfile.h gdb_string.h
+ $(arch_utils_h) $(regcache_h) \
+ $(inferior_h) $(language_h) $(objfiles_h) $(symfile_h) $(gdb_string_h)
-mipsread.o: mipsread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
- $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
- objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \
- gdb_string.h
+mipsread.o: mipsread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
+ $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
+ $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) $(symtab_h) \
+ $(gdb_string_h)
-mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h
+mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
+ $(regcache_h)
-monitor.o: monitor.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h gdb_string.h
+mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
+ $(obstack_h) $(target_h) $(value_h) $(bfd_h) gdb_string.h \
+ $(gdbcore_h) $(symfile_h) $(regcache_h) $(arch-utils.h)
-news-xdep.o: news-xdep.c
+monitor.o: monitor.c $(monitor_h) $(bfd_h) $(defs_h) $(gdbcmd_h) \
+ $(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(gdb_string_h) \
+ $(regcache_h)
-Onindy.o: nindy-share/Onindy.c $(wait_h) nindy-share/block_io.h \
+Onindy.o: nindy-share/Onindy.c gdb_wait.h nindy-share/block_io.h \
nindy-share/env.h
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c
-nindy.o: nindy-share/nindy.c $(wait_h) nindy-share/block_io.h \
+nindy.o: nindy-share/nindy.c gdb_wait.h nindy-share/block_io.h \
nindy-share/env.h
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c
-nlmread.o: nlmread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- gdb-stabs.h objfiles.h symfile.h $(symtab_h) stabsread.h \
- gdb_string.h
-
-ns32km3-nat.o: ns32km3-nat.c $(defs_h) $(inferior_h)
+nlmread.o: nlmread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(stabsread_h) \
+ $(gdb_string_h)
ttyflush.o: nindy-share/ttyflush.c
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c
nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h)
-ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h)
+ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h)
+
+objfiles.o: objfiles.c $(bfd_h) $(defs_h) $(objfiles_h) $(symfile_h) \
+ $(symtab_h) $(gdb_string_h) $(breakpoint_h)
-objfiles.o: objfiles.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
- $(symtab_h) gdb_string.h
+solib-osf.o: solib-osf.c $(defs_h) $(inferior_h) $(symtab_h) $(objfiles_h) \
+ $(symfile_h) $(target_h) $(gdb_string_h) $(solist_h)
-osfsolib.o: osfsolib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
- objfiles.h gnu-regex.h symfile.h target.h language.h gdb_string.h
+somread.o: somread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h)
-somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h
+somsolib.o: somsolib.c $(defs_h) $(regcache_h)
-somsolib.o: somsolib.c $(defs_h)
+pa64solib.o: pa64solib.c $(defs_h) $(regcache_h)
-hpux-thread.o: hpux-thread.c $(defs_h) gdbthread.h target.h inferior.h
+hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) inferior.h \
+ $(regcache_h)
$(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \
-I$(srcdir)/osf-share/HP800 -I/usr/include/dce $(srcdir)/hpux-thread.c
-# FIXME!!!
-hpread.o: hpread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h
-
-hp-psymtab-read.o: hp-psymtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \
- $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h
-
-hp-symtab-read.o: hp-symtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \
- $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h
-# END FIXME!!!
+hpread.o: hpread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
+ $(demangle_h) $(gdb_stabs_h) $(gdbtypes_h) $(objfiles_h) \
+ $(symfile_h) $(syms_h) $(symtab_h) $(gdb_string_h) \
+ $(INCLUDE_DIR)/hp-symtab.h
parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \
- $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \
- gdb_string.h
+ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \
+ $(gdb_string_h) $(linespec_h) $(doublest_h)
+
+ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \
+ $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \
+ $(objfiles_h) $(gdb_stabs_h) $(serial_h) ocd.h $(regcache_h)
-ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) gdb_string.h $(frame_h) \
- $(inferior_h) $(bfd_h) symfile.h target.h $(wait_h) $(gdbcmd_h) \
- objfiles.h gdb-stabs.h serial.h ocd.h
+ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdbcore_h) $(frame_h) \
+ $(inferior_h) $(target_h) $(regcache_h) ppc-tdep.h
-ppcbug-rom.o: ppcbug-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h
+ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+ $(target_h) ppc-tdep.h $(regcache_h) $(value_h)
+
+ppcbug-rom.o: ppcbug-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) \
+ $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
+ $(regcache_h)
printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \
- symfile.h $(symtab_h) target.h gdb_string.h
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ $(symfile_h) $(symtab_h) $(target_h) $(gdb_string_h) $(ui_out_h) \
+ $(completer_h)
+# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
+# match output format strings.
procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
- target.h gdb_string.h
+ $(target_h) $(gdb_string_h) $(gdbthread_h) proc-utils.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c
+
+proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) proc-utils.h $(completer_h)
+
+proc-events.o: proc-events.c $(defs_h)
+
+proc-flags.o: proc-flags.c $(defs_h)
+
+proc-why.o: proc-why.c $(defs_h) proc-utils.h
+
+sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \
+ $(gdbcmd_h) $(regcache_h)
+
+linux-proc.o: linux-proc.c $(defs_h)
-pyr-tdep.o: pyr-tdep.c $(defs_h)
+thread-db.o: thread-db.c $(defs_h) gdb_assert.h gdb_proc_service.h \
+ gdb_thread_db.h $(bfd_h) $(gdbthread_h) $(inferior_h) $(symfile_h) \
+ $(objfiles_h) $(target_h) $(regcache_h)
-pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
+lin-lwp.o: lin-lwp.c $(defs_h) gdb_assert.h gdb_wait.h $(gdbthread_h) \
+ $(inferior_h) $(target_h) $(gdbcmd_h) $(regcache_h)
-gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) gdb_string.h
+proc-service.o: proc-service.c $(defs_h) $(inferior_h) gdb_proc_service.h \
+ $(symtab_h) $(target_h) gregset.h
-remote-adapt.o: remote-adapt.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h terminal.h gdb_string.h
+# OBSOLETE remote-adapt.o: remote-adapt.c $(defs_h) $(gdbcore_h) \
+# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(gdb_string_h) $(regcache_h)
-remote-array.o: remote-array.c $(wait_h) $(defs_h) $(gdbcore_h) target.h \
- gdb_string.h $(command_h) serial.h monitor.h $(remote_utils_h)
+remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \
+ $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) $(remote_utils_h) \
+ $(version_h) $(regcache_h)
-remote-rdi.o: remote-rdi.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) gdb_string.h
+remote-rdi.o: remote-rdi.c $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(gdb_string_h) $(completer_h) arm-tdep.h
rdi-share/libangsd.a: force
@dir=rdi-share; \
@@ -1365,218 +1886,265 @@ rdi-share/libangsd.a: force
true; \
fi
-remote-d10v.o: remote-d10v.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h
+remote-rdp.o: remote-rdp.c $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(gdb_string_h) arm-tdep.h
-remote-rdp.o: remote-rdp.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) gdb_string.h
+remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) $(serial_h) \
+ $(inferior_h) $(target_h) $(terminal_h) $(remote_utils_h) \
+ $(gdb_string_h) $(regcache_h)
-remote-bug.o: remote-bug.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h terminal.h $(remote_utils_h) gdb_string.h
+remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \
+ $(serial_h) $(gdb_string_h) $(regcache_h)
-remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) target.h \
- $(wait_h) serial.h gdb_string.h
+# OBSOLETE remote-eb.o: remote-eb.c $(srcdir)/config/a29k/tm-a29k.h \
+# OBSOLETE $(defs_h) $(gdbcore_h) $(inferior_h) $(symfile_h) $(target_h) \
+# OBSOLETE $(terminal_h) $(gdb_string_h) $(regcache_h)
-remote-eb.o: remote-eb.c $(wait_h) $(srcdir)/config/a29k/tm-a29k.h \
- $(defs_h) $(gdbcore_h) $(inferior_h) symfile.h target.h terminal.h \
- gdb_string.h
+remote-es.o: remote-es.c $(bfd_h) $(command_h) $(defs_h) \
+ $(inferior_h) $(remote_utils_h) $(terminal_h) $(gdb_string_h) \
+ $(symfile_h) $(regcache_h) $(value_h)
-remote-es.o: remote-es.c $(bfd_h) $(wait_h) $(command_h) $(defs_h) \
- $(inferior_h) $(remote_utils_h) terminal.h gdb_string.h
+remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(serial_h) $(target_h) $(terminal_h) $(regcache_h)
-remote-hms.o: remote-hms.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) serial.h target.h terminal.h gdb_string.h
+remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(serial_h) $(target_h) $(terminal_h) $(regcache_h)
-remote-mips.o: remote-mips.c $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(gdbcore_h) $(inferior_h) serial.h symfile.h target.h
+remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \
+ $(regcache_h)
-remote-mm.o: remote-mm.c $(bfd_h) $(wait_h) $(defs_h) $(inferior_h) \
- minimon.h target.h terminal.h gdb_string.h
+# OBSOLETE remote-mm.o: remote-mm.c $(bfd_h) $(defs_h) $(inferior_h) \
+# OBSOLETE minimon.h $(target_h) $(terminal_h) $(gdb_string_h) $(regcache_h)
-remote-nindy.o: remote-nindy.c $(floatformat_h) $(wait_h) $(command_h) \
+remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
$(defs_h) $(gdbcore_h) $(inferior_h) \
nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
- symfile.h
+ $(symfile_h) $(regcache_h)
-remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) $(wait_h) \
- $(command_h) monitor.h $(remote_utils_h) $(symtab_h) symfile.h \
- objfiles.h gdb-stabs.h gdb_string.h
+remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \
+ $(command_h) $(monitor_h) $(remote_utils_h) $(symtab_h) $(symfile_h) \
+ $(objfiles_h) $(gdb_stabs_h) $(gdb_string_h) $(regcache_h)
-remote-sds.o: remote-sds.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h
+remote-sds.o: remote-sds.c $(bfd_h) $(defs_h) $(gdbcmd_h) \
+ $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) \
+ $(gdb_string_h) $(regcache_h)
-remote-sim.o: remote-sim.c $(wait_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) target.h terminal.h gdb_string.h \
- $(INCLUDE_DIR)/callback.h
+remote-sim.o: remote-sim.c $(defs_h) $(gdbcore_h) \
+ $(inferior_h) $(target_h) $(terminal_h) $(gdb_string_h) \
+ $(INCLUDE_DIR)/callback.h $(regcache_h)
-remote-st.o: remote-st.c $(wait_h) $(defs_h) $(gdbcore_h) serial.h \
- target.h gdb_string.h
+remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(serial_h) \
+ $(target_h) $(gdb_string_h) $(regcache_h)
-remote-udi.o: remote-udi.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h terminal.h $(udiheaders) gdb_string.h
+# OBSOLETE remote-udi.o: remote-udi.c $(bfd_h) $(defs_h) $(gdbcmd_h) \
+# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(udiheaders) $(gdb_string_h) \
+# OBSOLETE $(regcache_h)
-remote-vx.o: remote-vx.c $(wait_h) complaints.h $(defs_h) $(gdbcmd_h) \
- $(gdbcore_h) $(inferior_h) target.h vx-share/dbgRpcLib.h \
+remote-vx.o: remote-vx.c $(complaints_h) $(defs_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \
vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \
- vx-share/xdr_rdb.h gdb-stabs.h objfiles.h symfile.h $(bfd_h) \
- gdb_string.h
+ vx-share/xdr_rdb.h $(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(bfd_h) \
+ $(gdb_string_h) $(regcache_h)
-remote-vx29k.o: remote-vx29k.c $(wait_h) complaints.h $(defs_h) $(gdbcmd_h) \
- $(gdbcore_h) $(inferior_h) target.h vx-share/dbgRpcLib.h \
+remote-vx29k.o: remote-vx29k.c $(complaints_h) $(defs_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \
vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \
- vx-share/xdr_rdb.h gdb_string.h
+ vx-share/xdr_rdb.h $(gdb_string_h) $(regcache_h)
-ocd.o: ocd.c ocd.h $(gdbcore_h) gdb_string.h $(frame_h) $(inferior_h) \
- $(bfd_h) symfile.h target.h $(wait_h) $(gdbcmd_h) objfiles.h \
- gdb-stabs.h $(dcache_h) serial.h
+ocd.o: ocd.c ocd.h $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
+ $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
+ $(gdb_stabs_h) $(dcache_h) $(serial_h) $(regcache_h)
remote-utils.o: remote-utils.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(inferior_h) $(remote_utils_h) gdb_string.h
+ $(inferior_h) $(remote_utils_h) $(gdb_string_h) $(regcache_h)
-remote.o: remote.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h
+remote.o: remote.c $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \
+ $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) \
+ $(gdb_string_h) $(event_loop_h) $(event_top_h) $(remote_h) \
+ $(inf_loop_h) $(value_h)
-remote-nrom.o: remote-nrom.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) symfile.h terminal.h
+remote-nrom.o: remote-nrom.c $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \
+ $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h)
-rom68k-rom.o: rom68k-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h
+rom68k-rom.o: rom68k-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) \
+ $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
+ $(regcache_h) $(value_h)
-rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h \
- xcoffsolib.h
+rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
+ $(gdbcore_h) $(xcoffsolib_h) $(symfile_h) $(objfiles_h) \
+ $(gdb_stabs_h) $(regcache_h) $(arch_utils_h)
rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- target.h xcoffsolib.h
+ $(target_h) ppc-tdep.h $(regcache_h) $(value_h) $(parser_defs_h)
-scm-exp.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \
- scm-lang.h scm-tags.h
+s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
+ $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
+ $(objfiles_h) $(bfd_h) $(floatformat_h) $(regcache_h) $(value_h)
+
+s390-nat.o: s390-nat.c $(defs_h) $(regcache_h)
-scm-lang.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \
- scm-lang.h scm-tags.h gdb_string.h $(gdbcore_h)
+scm-exp.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) \
+ scm-lang.h scm-tags.h
-scm-valprint.o: $(defs_h) $(value_h) parser-defs.h language.h \
- scm-lang.h valprint.h $(gdbcore_h)
+scm-lang.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) \
+ scm-lang.h scm-tags.h $(gdb_string_h) $(gdbcore_h)
-ser-go32.o: ser-go32.c $(defs_h) serial.h
+scm-valprint.o: $(defs_h) $(value_h) $(parser_defs_h) $(language_h) \
+ scm-lang.h $(valprint_h) $(gdbcore_h)
-ser-mac.o: ser-mac.c $(defs_h) serial.h signals.h
+ser-go32.o: ser-go32.c $(defs_h) $(serial_h)
-ser-ocd.o: ser-ocd.c $(defs_h) serial.h signals.h gdb_string.h
+ser-pipe.o: ser-pipe.c $(defs_h) $(serial_h) $(gdb_string_h) $(ser_unix_h)
-ser-tcp.o: ser-tcp.c $(defs_h) serial.h signals.h gdb_string.h
+ser-tcp.o: ser-tcp.c $(defs_h) $(serial_h) $(gdb_string_h) $(ser_unix_h)
-ser-unix.o: ser-unix.c $(defs_h) serial.h
+ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h)
-serial.o: serial.c $(defs_h) serial.h gdb_string.h
+serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h)
-sh-tdep.o: sh-tdep.c $(bfd_h) $(dis-asm_h) \
+sh-tdep.o: sh-tdep.c $(bfd_h) $(dis_asm_h) \
$(srcdir)/../opcodes/sh-opc.h $(defs_h) $(expression_h) $(frame_h) \
- $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(value_h)
+ $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(arch_utils_h) \
+ $(regcache_h) $(doublest_h)
-sh3-rom.o: sh3-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h
+sh3-rom.o: sh3-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \
+ $(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(arch_utils_h) \
+ $(regcache_h)
-mon960-rom.o: mon960-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) target.h serial.h terminal.h
+signals.o: signals.c $(defs_h) $(target_h)
+
+mon960-rom.o: mon960-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) \
+ $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h)
solib.o: solib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
- objfiles.h gnu-regex.h symfile.h target.h gdb_string.h
+ $(objfiles_h) gdb_regex.h $(symfile_h) $(target_h) $(gdb_string_h) \
+ $(solist_h) $(completer_h)
+
+solib-sunos.o: solib-sunos.c $(defs_h) $(symfile_h) $(objfiles_h) \
+ $(gdbcore_h) $(inferior_h) $(solist_h)
+
+solib-svr4.o: solib-svr4.c $(defs_h) $(gdbcore_h) $(inferior_h) $(objfiles_h) \
+ $(symfile_h) $(target_h) $(solist_h) solib-svr4.h
+
+solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) solib-svr4.h
source.o: source.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
- $(gdbcore_h) language.h objfiles.h gnu-regex.h symfile.h $(symtab_h) \
- gdb_string.h
+ $(gdbcore_h) $(language_h) $(objfiles_h) gdb_regex.h $(symfile_h) \
+ $(symtab_h) $(gdb_string_h) $(source_h) $(completer_h) $(linespec_h) \
+ $(ui_out_h)
+
+sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h)
sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \
- target.h
+ $(target_h) $(regcache_h)
sparc-tdep.o: sparc-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) objfiles.h symfile.h target.h gdb_string.h
+ $(inferior_h) $(objfiles_h) $(symfile_h) $(target_h) $(gdb_string_h) \
+ $(arch_utils_h) $(regcache_h)
-sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) target.h
+sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(target_h) $(regcache_h)
+
+xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \
+ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h)
dsrec.o: dsrec.c $(defs_h) srec.h
stabsread.o: stabsread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
- $(INCLUDE_DIR)/aout/stab_gnu.h buildsym.h complaints.h $(defs_h) \
- $(gdbtypes_h) objfiles.h stabsread.h symfile.h $(symtab_h) \
- gdb_string.h
+ $(INCLUDE_DIR)/aout/stab_gnu.h $(buildsym_h) $(complaints_h) \
+ $(defs_h) $(gdbtypes_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \
+ $(symtab_h) $(gdb_string_h) $(doublest_h)
stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
- language.h target.h gdb_string.h
+ $(language_h) $(target_h) $(gdb_string_h) $(ui_out_h)
-ax-general.o: ax-general.c $(ax_h) $(defs_h)
-ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) symfile.h $(gdbtypes_h) \
- $(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h
+ui-file.o: ui-file.c $(defs_h) ui-file.h
+tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h \
+ $(srcdir)/tui/tuiIO.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
-sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+ax-general.o: ax-general.c $(ax_h) $(defs_h) $(value_h)
+ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \
+ $(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h
-sun386-nat.o: sun386-nat.c $(defs_h) $(inferior_h) $(gdbcore_h)
+sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \
- $(expression_h) $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) \
- language.h objfiles.h symfile.h $(symtab_h) target.h \
- gdb_string.h
+symfile.o: symfile.c $(breakpoint_h) $(complaints_h) $(defs_h) \
+ $(expression_h) $(gdb_stabs_h) $(gdbcmd_h) $(gdbcore_h) \
+ $(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \
+ $(target_h) $(gdb_string_h) $(completer_h)
symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
-symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
symmisc.o: symmisc.c $(bfd_h) $(breakpoint_h) $(command_h) $(defs_h) \
- $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
- $(symtab_h) gdb_string.h
+ $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ $(symfile_h) $(symtab_h) $(gdb_string_h)
-symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \
- gnu-regex.h symfile.h $(symtab_h) target.h $(value_h) \
- gdb_string.h
+symtab.o: symtab.c $(call_cmds_h) $(defs_h) $(expression_h) $(frame_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
+ gdb_regex.h $(symfile_h) $(symtab_h) $(target_h) $(value_h) \
+ $(gdb_string_h) $(linespec_h) $(cp_abi_h)
-tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \
- $(symtab_h)
+linespec.o: linespec.c $(linespec_h) $(defs_h) $(frame_h) $(value_h) \
+ $(objfiles_h) $(symfile_h) $(completer_h) $(symtab_h) \
+ $(demangle_h) $(command_h) $(cp_abi_h)
target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \
- objfiles.h symfile.h target.h gdb_string.h
-
-thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h)
+ $(objfiles_h) $(symfile_h) $(target_h) $(gdb_string_h) $(regcache_h)
-top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
- $(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \
- $(remote_utils_h) gdb_string.h
+thread.o: thread.c $(defs_h) $(gdbthread_h) $(gdbcmd_h) $(target_h) \
+ $(regcache_h) $(ui_out_h) $(gdb_h)
-typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \
- $(value_h) gdb_string.h
+completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \
+ $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers)
-ultra3-nat.o: ultra3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
+top.o: top.c $(top_h) $(bfd_h) $(getopt_h) $(readline_headers) $(call_cmds_h) \
+ $(cli_cmds_h) $(cli_script_h) $(cli_setshow_h) \
+ $(defs_h) $(gdbcmd_h) $(inferior_h) $(language_h) \
+ $(remote_utils_h) $(gdb_string_h) $(event_loop_h) $(event_top_h) \
+ $(completer_h) $(version_h) $(ui_out_h) $(doublest_h) \
+ $(serial_h)
-ultra3-xdep.o: ultra3-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
-
-umax-xdep.o: umax-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
+typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) \
+ $(value_h) $(gdb_string_h) $(cp_abi_h)
utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \
- language.h signals.h target.h terminal.h $(readline_headers) \
- gdb_string.h
+ $(language_h) $(target_h) $(terminal_h) $(readline_headers) \
+ $(gdb_string_h) $(event_loop_h) $(event_top_h)
valarith.o: valarith.c $(bfd_h) $(defs_h) $(expression_h) \
- $(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
- gdb_string.h
+ $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) $(value_h) \
+ $(gdb_string_h) $(doublest_h)
-valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
- gdb_string.h
+valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
+ $(gdb_string_h) $(regcache_h) $(cp_abi_h)
valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \
- $(value_h) gdb_string.h valprint.h
+ $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) \
+ $(value_h) $(gdb_string_h) $(valprint_h) $(doublest_h)
values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) $(symtab_h) target.h $(value_h) \
- gdb_string.h scm-lang.h
+ $(gdbcore_h) $(gdbtypes_h) $(symtab_h) $(target_h) $(value_h) \
+ $(gdb_string_h) scm-lang.h $(doublest_h)
vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h)
-w65-tdep.o : w65-tdep.c $(gdbcore_h)
+x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
+ $(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h)
+
+x86-64-tdep.o : x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) $(gdbcmd_h) \
+ $(arch_utils_h) $(regcache_h) $(symfile_h) x86-64-tdep.h i386-tdep.h \
+ $(dwarf2cfi_h) gdb_assert.h
+
+x86-64-linux-nat.o : x86-64-linux-nat.c $(defs_h) $(inferior_h) \
+ $(gdbcore_h) $(regcache_h) i387-nat.h gdb_assert.h x86-64-tdep.h \
+ i386-tdep.h
win32-nat.o: win32-nat.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
- gdb_string.h
+ $(gdb_string_h) $(regcache_h) $(completer_h)
xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \
vx-share/vxWorks.h vx-share/xdr_ld.h
@@ -1592,28 +2160,189 @@ xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \
xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
$(INCLUDE_DIR)/aout/stab_gnu.h $(INCLUDE_DIR)/coff/internal.h \
- $(INCLUDE_DIR)/coff/rs6000.h $(BFD_SRC)/libcoff.h buildsym.h \
- complaints.h $(defs_h) $(gdbtypes_h) objfiles.h stabsread.h symfile.h \
- $(symtab_h) partial-stab.h gdb_string.h
-
-xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) xcoffsolib.h
-
-z8k-tdep.o: z8k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) $(frame_h) \
- $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h)
-
-c-exp.tab.o: c-exp.tab.c c-lang.h $(defs_h) $(expression_h) \
- $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \
- $(bfd_h) objfiles.h symfile.h
+ $(INCLUDE_DIR)/coff/rs6000.h $(BFD_SRC)/libcoff.h $(buildsym_h) \
+ $(complaints_h) $(defs_h) $(gdbtypes_h) $(objfiles_h) $(stabsread_h) \
+ $(symfile_h) $(symtab_h) $(gdb_string_h)
+
+xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) $(xcoffsolib_h) $(inferior_h) \
+ $(gdbcmd_h) $(symfile_h) $(frame_h) gdb_regex.h
+
+# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
+# declared -Wimplicit fails. It should be using the GDBARCH framework.
+# cagney 1999-09-02.
+z8k-tdep.o: z8k-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h) $(frame_h) \
+ $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h) $(value_h) \
+ $(regcache_h)
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
+ $(srcdir)/z8k-tdep.c
+
+c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
+ $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \
+ $(symfile_h) $(objfiles_h)
jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \
- $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \
- $(bfd_h) objfiles.h symfile.h
+ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \
+ $(bfd_h) $(objfiles_h) $(symfile_h)
f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \
- language.h parser-defs.h $(value_h) $(bfd_h) objfiles.h symfile.h
+ $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \
+ $(symfile_h)
m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- language.h m2-lang.h parser-defs.h $(symtab_h) $(value_h) \
- $(bfd_h) objfiles.h symfile.h
+ $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \
+ $(bfd_h) $(objfiles_h) $(symfile_h)
+
+p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \
+ $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \
+ $(bfd_h) $(objfiles_h) $(symfile_h)
+
+gdb-events.o: gdb-events.c $(gdb_events_h) $(defs_h) $(gdbcmd_h)
+
+ui-out.o: ui-out.c $(defs_h) $(ui_out_h) $(expression_h) $(language_h)
+cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h)
+
+varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \
+ $(language_h) $(valprint_h) $(varobj_h) $(wrapper_h)
+
+wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) $(wrapper_h)
+
+#
+# CLI dependencies
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the cli directory.
+
+cli-decode.o: $(srcdir)/cli/cli-decode.c $(cli_decode_h) \
+ $(cli_cmds_h) $(defs_h) $(ui_out_h) \
+ $(symtab_h) gdb_regex.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c
+
+cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(cli_cmds_h) $(cli_decode_h) \
+ $(cli_script_h) $(cli_setshow_h) $(top_h) $(completer_h) \
+ $(defs_h) $(target_h) gdb_wait.h gdb_regex.h $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
+
+cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(cli_setshow_h) \
+ $(cli_decode_h) $(cli_cmds_h) $(defs_h) \
+ $(value_h) $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c
+
+cli-script.o: $(srcdir)/cli/cli-script.c $(cli_script_h) \
+ $(cli_cmds_h) $(cli_decode_h) $(top_h) \
+ $(defs_h) $(value_h) $(language_h) $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c
+
+cli-utils.o: $(srcdir)/cli/cli-utils.c $(cli_utils_h) $(defs_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c
+
+#
+# MI dependencies
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
+
+mi_cmds_h = $(srcdir)/mi/mi-cmds.h
+mi_out_h = $(srcdir)/mi/mi-out.h
+mi_parse_h = $(srcdir)/mi/mi-parse.h
+mi_getopt_h = $(srcdir)/mi/mi-getopt.h
+mi_console_h = $(srcdir)/mi/mi-console.h
+
+mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c
+mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(top_h) $(mi_cmds_h) \
+ $(ui_out_h) $(varobj_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c
+mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(top_h) $(mi_cmds_h) \
+ $(ui_out_h) $(frame_h) $(value_h) $(target_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
+mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
+ $(ui_out_h) $(mi_getopt_h) $(gdb_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
+mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \
+ $(ui_out_h) $(value_h) $(target_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
+mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \
+ $(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \
+ $(mi_getopt_h) $(regcache_h) $(gdb_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
+mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
+mi-console.o: $(srcdir)/mi/mi-console.c $(mi_out_h) $(defs_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c
+mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_parse_h) $(mi_cmds_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c
+mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c
+
+#
+# TUI dependencies
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
+
+tui.o: $(srcdir)/tui/tui.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiIO.h \
+ $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui.c
+tui-out.o: $(srcdir)/tui/tui-out.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-out.c
+tui-hooks.o: $(srcdir)/tui/tui-hooks.c \
+ $(srcdir)/tui/tui.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-hooks.c
+tuiCommand.o: $(srcdir)/tui/tuiCommand.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiWin.h $(srcdir)/tui/tuiIO.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiCommand.c
+tuiData.o: $(srcdir)/tui/tuiData.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiData.c
+tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiRegs.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDataWin.c
+tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiSourceWin.h \
+ $(srcdir)/tui/tuiStack.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDisassem.c
+tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiGeneralWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c
+tuiIO.o: $(srcdir)/tui/tuiIO.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiIO.h $(srcdir)/tui/tuiCommand.h \
+ $(srcdir)/tui/tuiWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiIO.c
+tuiLayout.o: $(srcdir)/tui/tuiLayout.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \
+ $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiDisassem.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiLayout.c
+tuiRegs.o: $(srcdir)/tui/tuiRegs.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiRegs.c
+tuiSource.o: $(srcdir)/tui/tuiSource.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \
+ $(srcdir)/tui/tuiSource.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSource.c
+tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \
+ $(srcdir)/tui/tuiSource.h $(srcdir)/tui/tuiDisassem.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSourceWin.c
+tuiStack.o: $(srcdir)/tui/tuiStack.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiStack.c
+tuiWin.o: $(srcdir)/tui/tuiWin.c \
+ $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
+ $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \
+ $(srcdir)/tui/tuiSourceWin.h $(srcdir)/tui/tuiDataWin.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiWin.c
### end of the gdb Makefile.in.
diff --git a/contrib/gdb/gdb/NEWS b/contrib/gdb/gdb/NEWS
index e6aaba3..d7c0ad0 100644
--- a/contrib/gdb/gdb/NEWS
+++ b/contrib/gdb/gdb/NEWS
@@ -1,13 +1,465 @@
What has changed in GDB?
(Organized release by release)
+*** Changes since GDB 5.2:
+
+* New targets.
+
+Atmel AVR avr*-*-*
+
+* Bug fixes
+
+gdb/182: gdb/323: gdb/237: On alpha, gdb was reporting:
+mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
+Fix, by Joel Brobecker imported from mainline.
+
+gdb/439: gdb/291: On some ELF object files, gdb was reporting:
+dwarf2read.c:1072: gdb-internal-error: sect_index_text not initialize
+Fix, by Fred Fish, imported from mainline.
+
+*** Changes in GDB 5.2:
+
+* New command "set trust-readonly-sections on[off]".
+
+This command is a hint that tells gdb that read-only sections
+really are read-only (ie. that their contents will not change).
+In this mode, gdb will go to the object file rather than the
+target to read memory from read-only sections (such as ".text").
+This can be a significant performance improvement on some
+(notably embedded) targets.
+
+* New command "generate-core-file" (or "gcore").
+
+This new gdb command allows the user to drop a core file of the child
+process state at any time. So far it's been implemented only for
+GNU/Linux and Solaris, but should be relatively easily ported to other
+hosts. Argument is core file name (defaults to core.<pid>).
+
+* New command line option
+
+GDB now accepts --pid or -p followed by a process id.
+
+* Change in command line behavior -- corefiles vs. process ids.
+
+There is a subtle behavior in the way in which GDB handles
+command line arguments. The first non-flag argument is always
+a program to debug, but the second non-flag argument may either
+be a corefile or a process id. Previously, GDB would attempt to
+open the second argument as a corefile, and if that failed, would
+issue a superfluous error message and then attempt to attach it as
+a process. Now, if the second argument begins with a non-digit,
+it will be treated as a corefile. If it begins with a digit,
+GDB will attempt to attach it as a process, and if no such process
+is found, will then attempt to open it as a corefile.
+
+* Changes in ARM configurations.
+
+Multi-arch support is enabled for all ARM configurations. The ARM/NetBSD
+configuration is fully multi-arch.
+
+* New native configurations
+
+ARM NetBSD arm*-*-netbsd*
+x86 OpenBSD i[3456]86-*-openbsd*
+AMD x86-64 running GNU/Linux x86_64-*-linux-*
+Sparc64 running FreeBSD sparc64-*-freebsd*
+
+* New targets
+
+Sanyo XStormy16 xstormy16-elf
+
+* OBSOLETE configurations and files
+
+Configurations that have been declared obsolete in this release have
+been commented out. Unless there is activity to revive these
+configurations, the next release of GDB will have their sources
+permanently REMOVED.
+
+AMD 29k family via UDI a29k-amd-udi, udi29k
+A29K VxWorks a29k-*-vxworks
+AMD 29000 embedded, using EBMON a29k-none-none
+AMD 29000 embedded with COFF a29k-none-coff
+AMD 29000 embedded with a.out a29k-none-aout
+
+testsuite/gdb.hp/gdb.threads-hp/ directory
+
+* REMOVED configurations and files
+
+TI TMS320C80 tic80-*-*
+WDC 65816 w65-*-*
+PowerPC Solaris powerpcle-*-solaris*
+PowerPC Windows NT powerpcle-*-cygwin32
+PowerPC Netware powerpc-*-netware*
+Harris/CXUX m88k m88*-harris-cxux*
+Most ns32k hosts and targets ns32k-*-mach3* ns32k-umax-*
+ ns32k-utek-sysv* ns32k-utek-*
+SunOS 4.0.Xi on i386 i[3456]86-*-sunos*
+Ultracomputer (29K) running Sym1 a29k-nyu-sym1 a29k-*-kern*
+Sony NEWS (68K) running NEWSOS 3.x m68*-sony-sysv news
+ISI Optimum V (3.05) under 4.3bsd. m68*-isi-*
+Apple Macintosh (MPW) host and target N/A host, powerpc-*-macos*
+
+* Changes to command line processing
+
+The new `--args' feature can be used to specify command-line arguments
+for the inferior from gdb's command line.
+
+* Changes to key bindings
+
+There is a new `operate-and-get-next' function bound to `C-o'.
+
+*** Changes in GDB 5.1.1
+
+Fix compile problem on DJGPP.
+
+Fix a problem with floating-point registers on the i386 being
+corrupted.
+
+Fix to stop GDB crashing on .debug_str debug info.
+
+Numerous documentation fixes.
+
+Numerous testsuite fixes.
+
+*** Changes in GDB 5.1:
+
+* New native configurations
+
+Alpha FreeBSD alpha*-*-freebsd*
+x86 FreeBSD 3.x and 4.x i[3456]86*-freebsd[34]*
+MIPS GNU/Linux mips*-*-linux*
+MIPS SGI Irix 6.x mips*-sgi-irix6*
+ia64 AIX ia64-*-aix*
+s390 and s390x GNU/Linux {s390,s390x}-*-linux*
+
+* New targets
+
+Motorola 68HC11 and 68HC12 m68hc11-elf
+CRIS cris-axis
+UltraSparc running GNU/Linux sparc64-*-linux*
+
+* OBSOLETE configurations and files
+
+x86 FreeBSD before 2.2 i[3456]86*-freebsd{1,2.[01]}*,
+Harris/CXUX m88k m88*-harris-cxux*
+Most ns32k hosts and targets ns32k-*-mach3* ns32k-umax-*
+ ns32k-utek-sysv* ns32k-utek-*
+TI TMS320C80 tic80-*-*
+WDC 65816 w65-*-*
+Ultracomputer (29K) running Sym1 a29k-nyu-sym1 a29k-*-kern*
+PowerPC Solaris powerpcle-*-solaris*
+PowerPC Windows NT powerpcle-*-cygwin32
+PowerPC Netware powerpc-*-netware*
+SunOS 4.0.Xi on i386 i[3456]86-*-sunos*
+Sony NEWS (68K) running NEWSOS 3.x m68*-sony-sysv news
+ISI Optimum V (3.05) under 4.3bsd. m68*-isi-*
+Apple Macintosh (MPW) host N/A
+
+stuff.c (Program to stuff files into a specially prepared space in kdb)
+kdb-start.c (Main loop for the standalone kernel debugger)
+
+Configurations that have been declared obsolete in this release have
+been commented out. Unless there is activity to revive these
+configurations, the next release of GDB will have their sources
+permanently REMOVED.
+
+* REMOVED configurations and files
+
+Altos 3068 m68*-altos-*
+Convex c1-*-*, c2-*-*
+Pyramid pyramid-*-*
+ARM RISCix arm-*-* (as host)
+Tahoe tahoe-*-*
+ser-ocd.c *-*-*
+
+* GDB has been converted to ISO C.
+
+GDB's source code has been converted to ISO C. In particular, the
+sources are fully protoized, and rely on standard headers being
+present.
+
+* Other news:
+
+* "info symbol" works on platforms which use COFF, ECOFF, XCOFF, and NLM.
+
+* The MI enabled by default.
+
+The new machine oriented interface (MI) introduced in GDB 5.0 has been
+revised and enabled by default. Packages which use GDB as a debugging
+engine behind a UI or another front end are encouraged to switch to
+using the GDB/MI interface, instead of the old annotations interface
+which is now deprecated.
+
+* Support for debugging Pascal programs.
+
+GDB now includes support for debugging Pascal programs. The following
+main features are supported:
+
+ - Pascal-specific data types such as sets;
+
+ - automatic recognition of Pascal sources based on file-name
+ extension;
+
+ - Pascal-style display of data types, variables, and functions;
+
+ - a Pascal expression parser.
+
+However, some important features are not yet supported.
+
+ - Pascal string operations are not supported at all;
+
+ - there are some problems with boolean types;
+
+ - Pascal type hexadecimal constants are not supported
+ because they conflict with the internal variables format;
+
+ - support for Pascal objects and classes is not full yet;
+
+ - unlike Pascal, GDB is case-sensitive for symbol names.
+
+* Changes in completion.
+
+Commands such as `shell', `run' and `set args', which pass arguments
+to inferior programs, now complete on file names, similar to what
+users expect at the shell prompt.
+
+Commands which accept locations, such as `disassemble', `print',
+`breakpoint', `until', etc. now complete on filenames as well as
+program symbols. Thus, if you type "break foob TAB", and the source
+files linked into the programs include `foobar.c', that file name will
+be one of the candidates for completion. However, file names are not
+considered for completion after you typed a colon that delimits a file
+name from a name of a function in that file, as in "break foo.c:bar".
+
+`set demangle-style' completes on available demangling styles.
+
+* New platform-independent commands:
+
+It is now possible to define a post-hook for a command as well as a
+hook that runs before the command. For more details, see the
+documentation of `hookpost' in the GDB manual.
+
+* Changes in GNU/Linux native debugging.
+
+Support for debugging multi-threaded programs has been completely
+revised for all platforms except m68k and sparc. You can now debug as
+many threads as your system allows you to have.
+
+Attach/detach is supported for multi-threaded programs.
+
+Support for SSE registers was added for x86. This doesn't work for
+multi-threaded programs though.
+
+* Changes in MIPS configurations.
+
+Multi-arch support is enabled for all MIPS configurations.
+
+GDB can now be built as native debugger on SGI Irix 6.x systems for
+debugging n32 executables. (Debugging 64-bit executables is not yet
+supported.)
+
+* Unified support for hardware watchpoints in all x86 configurations.
+
+Most (if not all) native x86 configurations support hardware-assisted
+breakpoints and watchpoints in a unified manner. This support
+implements debug register sharing between watchpoints, which allows to
+put a virtually infinite number of watchpoints on the same address,
+and also supports watching regions up to 16 bytes with several debug
+registers.
+
+The new maintenance command `maintenance show-debug-regs' toggles
+debugging print-outs in functions that insert, remove, and test
+watchpoints and hardware breakpoints.
+
+* Changes in the DJGPP native configuration.
+
+New command ``info dos sysinfo'' displays assorted information about
+the CPU, OS, memory, and DPMI server.
+
+New commands ``info dos gdt'', ``info dos ldt'', and ``info dos idt''
+display information about segment descriptors stored in GDT, LDT, and
+IDT.
+
+New commands ``info dos pde'' and ``info dos pte'' display entries
+from Page Directory and Page Tables (for now works with CWSDPMI only).
+New command ``info dos address-pte'' displays the Page Table entry for
+a given linear address.
+
+GDB can now pass command lines longer than 126 characters to the
+program being debugged (requires an update to the libdbg.a library
+which is part of the DJGPP development kit).
+
+DWARF2 debug info is now supported.
+
+It is now possible to `step' and `next' through calls to `longjmp'.
+
+* Changes in documentation.
+
+All GDB documentation was converted to GFDL, the GNU Free
+Documentation License.
+
+Tracepoints-related commands are now fully documented in the GDB
+manual.
+
+TUI, the Text-mode User Interface, is now documented in the manual.
+
+Tracepoints-related commands are now fully documented in the GDB
+manual.
+
+The "GDB Internals" manual now has an index. It also includes
+documentation of `ui_out' functions, GDB coding standards, x86
+hardware watchpoints, and memory region attributes.
+
+* GDB's version number moved to ``version.in''
+
+The Makefile variable VERSION has been replaced by the file
+``version.in''. People creating GDB distributions should update the
+contents of this file.
+
+* gdba.el deleted
+
+GUD support is now a standard part of the EMACS distribution.
+
+*** Changes in GDB 5.0:
+
+* Improved support for debugging FP programs on x86 targets
+
+Unified and much-improved support for debugging floating-point
+programs on all x86 targets. In particular, ``info float'' now
+displays the FP registers in the same format on all x86 targets, with
+greater level of detail.
+
+* Improvements and bugfixes in hardware-assisted watchpoints
+
+It is now possible to watch array elements, struct members, and
+bitfields with hardware-assisted watchpoints. Data-read watchpoints
+on x86 targets no longer erroneously trigger when the address is
+written.
+
+* Improvements in the native DJGPP version of GDB
+
+The distribution now includes all the scripts and auxiliary files
+necessary to build the native DJGPP version on MS-DOS/MS-Windows
+machines ``out of the box''.
+
+The DJGPP version can now debug programs that use signals. It is
+possible to catch signals that happened in the debuggee, deliver
+signals to it, interrupt it with Ctrl-C, etc. (Previously, a signal
+would kill the program being debugged.) Programs that hook hardware
+interrupts (keyboard, timer, etc.) can also be debugged.
+
+It is now possible to debug DJGPP programs that redirect their
+standard handles or switch them to raw (as opposed to cooked) mode, or
+even close them. The command ``run < foo > bar'' works as expected,
+and ``info terminal'' reports useful information about the debuggee's
+terminal, including raw/cooked mode, redirection, etc.
+
+The DJGPP version now uses termios functions for console I/O, which
+enables debugging graphics programs. Interrupting GDB with Ctrl-C
+also works.
+
+DOS-style file names with drive letters are now fully supported by
+GDB.
+
+It is now possible to debug DJGPP programs that switch their working
+directory. It is also possible to rerun the debuggee any number of
+times without restarting GDB; thus, you can use the same setup,
+breakpoints, etc. for many debugging sessions.
+
+* New native configurations
+
+ARM GNU/Linux arm*-*-linux*
+PowerPC GNU/Linux powerpc-*-linux*
+
+* New targets
+
+Motorola MCore mcore-*-*
+x86 VxWorks i[3456]86-*-vxworks*
+PowerPC VxWorks powerpc-*-vxworks*
+TI TMS320C80 tic80-*-*
+
+* OBSOLETE configurations
+
+Altos 3068 m68*-altos-*
+Convex c1-*-*, c2-*-*
+Pyramid pyramid-*-*
+ARM RISCix arm-*-* (as host)
+Tahoe tahoe-*-*
+
+Configurations that have been declared obsolete will be commented out,
+but the code will be left in place. If there is no activity to revive
+these configurations before the next release of GDB, the sources will
+be permanently REMOVED.
+
+* Gould support removed
+
+Support for the Gould PowerNode and NP1 has been removed.
+
+* New features for SVR4
+
+On SVR4 native platforms (such as Solaris), if you attach to a process
+without first loading a symbol file, GDB will now attempt to locate and
+load symbols from the running process's executable file.
+
+* Many C++ enhancements
+
+C++ support has been greatly improved. Overload resolution now works properly
+in almost all cases. RTTI support is on the way.
+
+* Remote targets can connect to a sub-program
+
+A popen(3) style serial-device has been added. This device starts a
+sub-process (such as a stand-alone simulator) and then communicates
+with that. The sub-program to run is specified using the syntax
+``|<program> <args>'' vis:
+
+ (gdb) set remotedebug 1
+ (gdb) target extended-remote |mn10300-elf-sim program-args
+
+* MIPS 64 remote protocol
+
+A long standing bug in the mips64 remote protocol where by GDB
+expected certain 32 bit registers (ex SR) to be transfered as 32
+instead of 64 bits has been fixed.
+
+The command ``set remote-mips64-transfers-32bit-regs on'' has been
+added to provide backward compatibility with older versions of GDB.
+
+* ``set remotebinarydownload'' replaced by ``set remote X-packet''
+
+The command ``set remotebinarydownload'' command has been replaced by
+``set remote X-packet''. Other commands in ``set remote'' family
+include ``set remote P-packet''.
+
+* Breakpoint commands accept ranges.
+
+The breakpoint commands ``enable'', ``disable'', and ``delete'' now
+accept a range of breakpoints, e.g. ``5-7''. The tracepoint command
+``tracepoint passcount'' also accepts a range of tracepoints.
+
+* ``apropos'' command added.
+
+The ``apropos'' command searches through command names and
+documentation strings, printing out matches, making it much easier to
+try to find a command that does what you are looking for.
+
+* New MI interface
+
+A new machine oriented interface (MI) has been added to GDB. This
+interface is designed for debug environments running GDB as a separate
+process. This is part of the long term libGDB project. See the
+"GDB/MI" chapter of the GDB manual for further information. It can be
+enabled by configuring with:
+
+ .../configure --enable-gdbmi
+
*** Changes in GDB-4.18:
* New native configurations
HP-UX 10.20 hppa*-*-hpux10.20
HP-UX 11.x hppa*-*-hpux11.0*
-M68K Linux m68*-*-linux*
+M68K GNU/Linux m68*-*-linux*
* New targets
@@ -568,7 +1020,7 @@ breakpoints in shared libraries before the executable is run.
There is a new hardware breakpoint for the watch command for sparclite
targets. See gdb/sparclite/hw_breakpoint.note.
-Hardware watchpoints are also now supported under Linux.
+Hardware watchpoints are also now supported under GNU/Linux.
* Annotations
@@ -1072,7 +1524,7 @@ read after argv processing.
Solaris-2.0 !!! sparc-sun-solaris2 or sun4sol2
-Linux support i386-unknown-linux or linux
+GNU/Linux support i386-unknown-linux or linux
We are also including code to support the HP/PA running BSD and HPUX. This
is almost guaranteed not to work, as we didn't have time to test or build it
diff --git a/contrib/gdb/gdb/PROBLEMS b/contrib/gdb/gdb/PROBLEMS
new file mode 100644
index 0000000..49d2796
--- /dev/null
+++ b/contrib/gdb/gdb/PROBLEMS
@@ -0,0 +1,32 @@
+
+ Known problems in GDB 5.2
+
+ See also: http://www.gnu.org/software/gdb/bugs/
+
+
+hppa2.0-hp-hpux10.20
+--------------------
+
+gdb/487: The top level make files used to build GDB are not compatible
+with HP/UX make. As a workaround, use GNU make.
+
+gdb/486: The HP/UX C compiler defaults to K&R mode but GDB only builds
+with an ISO C compiler. The top level configuration incorrectly sets
+CC to `cc' instead of `cc -Ae'. As a workaround, the correct compiler
+can be specified as part of the configuration vis:
+
+ $ 'CC=cc -Ae' ./configure
+
+
+s390*-*-*
+---------
+
+gdb/513: GDB does not build on s390 GNU/Linux. The problem should be
+fixed in more recent sources.
+
+
+i386-*-freebsd4.4*
+------------------
+
+gdb/455: GDB doesn't build on a FreeBSD 4.4-STABLE system. The
+problem is still being investigated.
diff --git a/contrib/gdb/gdb/README b/contrib/gdb/gdb/README
index fd791ce..8af440f 100644
--- a/contrib/gdb/gdb/README
+++ b/contrib/gdb/gdb/README
@@ -1,95 +1,121 @@
- README for gdb-4.18 release
- Updated 4 Apr 1999 by Jim Blandy
+ README for gdb-5.2 release
+ Updated 17 April, 2002 by Andrew Cagney
This is GDB, the GNU source-level debugger.
-A summary of new features is in the file `NEWS'.
-See the GDB home page at http://www.cygnus.com/gdb/ for up to date
-release information, mailing list links and archives, etc.
+A summary of new features is in the file `gdb/NEWS'.
+
+Check the GDB home page at http://www.gnu.org/software/gdb/ for up to
+date release information, mailing list links and archives, etc.
+
+The file `gdb/PROBLEMS' contains information on problems identified
+late in the release cycle. GDB's bug tracking data base at
+http://www.gnu.org/software/gdb/bugs/ contains a more complete list of
+bugs.
Unpacking and Installation -- quick overview
==========================
-In this release, the GDB debugger sources, the generic GNU include
+ In this release, the GDB debugger sources, the generic GNU include
files, the BFD ("binary file description") library, the readline
library, and other libraries all have directories of their own
-underneath the gdb-4.18 directory. The idea is that a variety of GNU
+underneath the gdb-5.2 directory. The idea is that a variety of GNU
tools can share a common copy of these things. Be aware of variation
over time--for example don't try to build gdb with a copy of bfd from
-a release other than the gdb release (such as a binutils or gas
-release), especially if the releases are more than a few weeks apart.
+a release other than the gdb release (such as a binutils release),
+especially if the releases are more than a few weeks apart.
Configuration scripts and makefiles exist to cruise up and down this
directory tree and automatically build all the pieces in the right
order.
-When you unpack the gdb-4.18.tar.gz file, you'll find a directory
-called `gdb-4.18', which contains:
+ When you unpack the gdb-5.2.tar.gz file, you'll find a directory
+called `gdb-5.2', which contains:
+
+ COPYING config.sub intl missing opcodes
+ COPYING.LIB configure libiberty mkinstalldirs readline
+ Makefile.in configure.in libtool.m4 mmalloc sim
+ README djunpack.bat ltcf-c.sh move-if-change symlink-tree
+ bfd etc ltcf-cxx.sh mpw-README texinfo
+ config gdb ltcf-gcj.sh mpw-build.in utils
+ config-ml.in gettext.m4 ltconfig mpw-config.in ylwrap
+ config.guess include ltmain.sh mpw-configure
+ config.if install-sh md5.sum mpw-install
+
+You can build GDB right in the source directory:
+
+ cd gdb-5.2
+ ./configure
+ make
+ cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
- COPYING config.sub* libiberty/ opcodes/
- COPYING.LIB configure* mmalloc/ readline/
- Makefile.in configure.in move-if-change* sim/
- README etc/ mpw-README texinfo/
- bfd/ gdb/ mpw-build.in utils/
- config/ include/ mpw-config.in
- config.guess* install.sh* mpw-configure
+However, we recommend that an empty directory be used instead.
+This way you do not clutter your source tree with binary files
+and will be able to create different builds with different
+configuration options.
-To build GDB, you can just do:
+You can build GDB in any empty build directory:
- cd gdb-4.18
- ./configure
- make
- cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
+ mkdir build
+ cd build
+ <full path to your sources>/gdb-5.2/configure
+ make
+ cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
-This will configure and build all the libraries as well as GDB.
-If `configure' can't determine your system type, specify one as its
-argument, e.g., sun4 or decstation.
+(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly
+different; see the file gdb-5.2/gdb/config/djgpp/README for details.)
-If you get compiler warnings during this stage, see the `Reporting Bugs'
-section below; there are a few known problems.
+ This will configure and build all the libraries as well as GDB. If
+`configure' can't determine your system type, specify one as its
+argument, e.g., `./configure sun4' or `./configure decstation'.
-GDB requires an ANSI C compiler. If you do not have an ANSI C
-compiler for your system, you may be able to download and install the
-GNU CC compiler. It is available via anonymous FTP from ftp.gnu.org,
-in /pub/gnu/gcc (as a URL, that's ftp://ftp.gnu.org/pub/gnu/gcc).
+ If you get compiler errors during this stage, see the `Reporting
+Bugs' section below; there are a few known problems.
-GDB can be used as a cross-debugger, running on a machine of one type
-while debugging a program running on a machine of another type. See below.
+ GDB requires an ISO C (ANSI C) compiler. If you do not have an ISO
+C compiler for your system, you may be able to download and install
+the GNU CC compiler. It is available via anonymous FTP from the
+directory `ftp://ftp.gnu.org/pub/gnu/gcc'.
+
+ GDB can be used as a cross-debugger, running on a machine of one
+type while debugging a program running on a machine of another type.
+See below.
More Documentation
******************
All the documentation for GDB comes as part of the machine-readable
-distribution. The documentation is written in Texinfo format, which is
-a documentation system that uses a single source file to produce both
-on-line information and a printed manual. You can use one of the Info
-formatting commands to create the on-line version of the documentation
-and TeX (or `texi2roff') to typeset the printed version.
-
- GDB includes an already formatted copy of the on-line Info version of
-this manual in the `gdb/doc' subdirectory. The main Info file is
-`gdb-4.18/gdb/doc/gdb.info', and it refers to subordinate files matching
-`gdb.info*' in the same directory. If necessary, you can print out
-these files, or read them with any editor; but they are easier to read
-using the `info' subsystem in GNU Emacs or the standalone `info' program,
-available as part of the GNU Texinfo distribution.
+distribution. The documentation is written in Texinfo format, which
+is a documentation system that uses a single source file to produce
+both on-line information and a printed manual. You can use one of the
+Info formatting commands to create the on-line version of the
+documentation and TeX (or `texi2roff') to typeset the printed version.
+
+ GDB includes an already formatted copy of the on-line Info version
+of this manual in the `gdb/doc' subdirectory. The main Info file is
+`gdb-5.2/gdb/doc/gdb.info', and it refers to subordinate files
+matching `gdb.info*' in the same directory. If necessary, you can
+print out these files, or read them with any editor; but they are
+easier to read using the `info' subsystem in GNU Emacs or the
+standalone `info' program, available as part of the GNU Texinfo
+distribution.
If you want to format these Info files yourself, you need one of the
Info formatting programs, such as `texinfo-format-buffer' or
`makeinfo'.
If you have `makeinfo' installed, and are in the top level GDB
-source directory (`gdb-4.18', in the case of version 4.18), you can make
+source directory (`gdb-5.2', in the case of version 5.2), you can make
the Info file by typing:
- cd gdb/doc
- make info
+ cd gdb/doc
+ make info
If you want to typeset and print copies of this manual, you need
TeX, a program to print its DVI output files, and `texinfo.tex', the
Texinfo definitions file. This file is included in the GDB
-distribution, in the directory `gdb-4.18/texinfo'.
+distribution, in the directory `gdb-5.2/texinfo'.
TeX is a typesetting program; it does not print files directly, but
produces output files called DVI files. To print a typeset document,
@@ -103,13 +129,20 @@ without any extension or a `.dvi' extension.
This file tells TeX how to typeset a document written in Texinfo
format. On its own, TeX cannot read, much less typeset a Texinfo file.
`texinfo.tex' is distributed with GDB and is located in the
-`gdb-4.18/texinfo' directory.
+`gdb-5.2/texinfo' directory.
If you have TeX and a DVI printer program installed, you can typeset
and print this manual. First switch to the the `gdb' subdirectory of
-the main source directory (for example, to `gdb-4.18/gdb') and then type:
+the main source directory (for example, to `gdb-5.2/gdb') and then type:
+
+ make doc/gdb.dvi
+
+ If you prefer to have the manual in PDF format, type this from the
+`gdb/doc' subdirectory of the main source directory:
+
+ make gdb.pdf
- make gdb.dvi
+For this to work, you will need the PDFTeX package to be installed.
Installing GDB
@@ -123,68 +156,73 @@ preparing GDB for installation; you can then use `make' to build the
a single directory, whose name is usually composed by appending the
version number to `gdb'.
- For example, the GDB version 4.18 distribution is in the `gdb-4.18'
+ For example, the GDB version 5.2 distribution is in the `gdb-5.2'
directory. That directory contains:
-`gdb-4.18/{COPYING,COPYING.LIB}'
+`gdb-5.2/{COPYING,COPYING.LIB}'
Standard GNU license files. Please read them.
-`gdb-4.18/bfd'
+`gdb-5.2/bfd'
source for the Binary File Descriptor library
-`gdb-4.18/config*'
+`gdb-5.2/config*'
script for configuring GDB, along with other support files
-`gdb-4.18/gdb'
+`gdb-5.2/gdb'
the source specific to GDB itself
-`gdb-4.18/include'
+`gdb-5.2/include'
GNU include files
-`gdb-4.18/libiberty'
+`gdb-5.2/libiberty'
source for the `-liberty' free software library
-`gdb-4.18/mmalloc'
+`gdb-5.2/mmalloc'
source for the GNU memory-mapped malloc package
-`gdb-4.18/opcodes'
+`gdb-5.2/opcodes'
source for the library of opcode tables and disassemblers
-`gdb-4.18/readline'
+`gdb-5.2/readline'
source for the GNU command-line interface
+ NOTE: The readline library is compiled for use by GDB, but will
+ not be installed on your system when "make install" is issued.
-`gdb-4.18/sim'
+`gdb-5.2/sim'
source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)
-`gdb-4.18/intl'
+`gdb-5.2/intl'
source for the GNU gettext library, for internationalization.
This is slightly modified from the standalone gettext
distribution you can get from GNU.
-`gdb-4.18/texinfo'
+`gdb-5.2/texinfo'
The `texinfo.tex' file, which you need in order to make a printed
manual using TeX.
-`gdb-4.18/etc'
+`gdb-5.2/etc'
Coding standards, useful files for editing GDB, and other
miscellanea.
-`gdb-4.18/utils'
+`gdb-5.2/utils'
A grab bag of random utilities.
+ Note: the following instructions are for building GDB on Unix or
+Unix-like systems. Instructions for building with DJGPP for
+MS-DOS/MS-Windows are in the file gdb/config/djgpp/README.
The simplest way to configure and build GDB is to run `configure'
from the `gdb-VERSION-NUMBER' source directory, which in this example
-is the `gdb-4.18' directory.
+is the `gdb-5.2' directory.
First switch to the `gdb-VERSION-NUMBER' source directory if you are
not already in it; then run `configure'.
For example:
- cd gdb-4.18
- ./configure
- make
+ cd gdb-5.2
+ ./configure
+ make
Running `configure' followed by `make' builds the `bfd',
`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself.
@@ -195,11 +233,11 @@ corresponding source directories.
does not recognize this automatically when you run a different shell,
you may need to run `sh' on it explicitly:
- sh configure
+ sh configure
If you run `configure' from a directory that contains source
-directories for multiple libraries or programs, such as the `gdb-4.18'
-source directory for version 4.18, `configure' creates configuration
+directories for multiple libraries or programs, such as the `gdb-5.2'
+source directory for version 5.2, `configure' creates configuration
files for every directory level underneath (unless you tell it not to,
with the `--norecursion' option).
@@ -207,11 +245,11 @@ with the `--norecursion' option).
directories in the GDB distribution, if you only want to configure that
subdirectory; but be sure to specify a path to it.
- For example, with version 4.18, type the following to configure only
+ For example, with version 5.2, type the following to configure only
the `bfd' subdirectory:
- cd gdb-4.18/bfd
- ../configure
+ cd gdb-5.2/bfd
+ ../configure
You can install `gdb' anywhere; it has no hardwired paths. However,
you should make sure that the shell on your path (named by the `SHELL'
@@ -239,13 +277,13 @@ directory. If the path to `configure' would be the same as the
argument to `--srcdir', you can leave out the `--srcdir' option; it
will be assumed.)
- For example, with version 4.18, you can build GDB in a separate
+ For example, with version 5.2, you can build GDB in a separate
directory for a Sun 4 like this:
- cd gdb-4.18
+ cd gdb-5.2
mkdir ../gdb-sun4
cd ../gdb-sun4
- ../gdb-4.18/configure sun4
+ ../gdb-5.2/configure
make
When `configure' builds a configuration using a remote source
@@ -266,8 +304,8 @@ called `configure' (or one of its subdirectories).
The `Makefile' that `configure' generates in each source directory
also runs recursively. If you type `make' in a source directory such
-as `gdb-4.18' (or in a separate configured directory configured with
-`--srcdir=PATH/gdb-4.18'), you will build all the required libraries,
+as `gdb-5.2' (or in a separate configured directory configured with
+`--srcdir=PATH/gdb-5.2'), you will build all the required libraries,
and then build GDB.
When you have multiple hosts or targets configured in separate
@@ -310,7 +348,7 @@ you can use it to test your guesses on abbreviations--for example:
Invalid configuration `i786v': machine `i786v' not recognized
`config.sub' is also distributed in the GDB source directory
-(`gdb-4.18', for version 4.18).
+(`gdb-5.2', for version 5.2).
`configure' options
@@ -364,11 +402,13 @@ prefer; but you may abbreviate option names if you use `--'.
code which looks even vaguely suspicious. You should only using
this feature if you're compiling with GNU CC. It passes the
following flags:
- -Wall
+ -Wimplicit
+ -Wreturn-type
+ -Wcomment
+ -Wtrigraphs
+ -Wformat
+ -Wparentheses
-Wpointer-arith
- -Wstrict-prototypes
- -Wmissing-prototypes
- -Wmissing-declarations
`--target=TARGET'
Configure GDB for cross-debugging programs running on the specified
@@ -393,41 +433,25 @@ other GNU tools recursively; but these are the only options that affect
GDB or its supporting libraries.
-Languages other than C
-=======================
-
-See the GDB manual (gdb/doc/gdb.texinfo) for information on this.
-
-
-Kernel debugging
-=================
-
-I have't done this myself so I can't really offer any advice.
-Remote debugging over serial lines works fine, but the kernel debugging
-code in here has not been tested in years. Van Jacobson has
-better kernel debugging, but the UC lawyers won't let FSF have it.
-
-
Remote debugging
=================
-The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples of
-remote stubs to be used with remote.c. They are designed to run
-standalone on an m68k, i386, or SPARC cpu and communicate properly with
-the remote.c stub over a serial line.
+ The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples
+of remote stubs to be used with remote.c. They are designed to run
+standalone on an m68k, i386, or SPARC cpu and communicate properly
+with the remote.c stub over a serial line.
-The directory gdb/gdbserver/ contains `gdbserver', a program that
+ The directory gdb/gdbserver/ contains `gdbserver', a program that
allows remote debugging for Unix applications. gdbserver is only
-supported for some native configurations, including Sun 3, Sun 4,
-and Linux.
+supported for some native configurations, including Sun 3, Sun 4, and
+Linux.
-There are a number of remote interfaces for talking to existing ROM
+ There are a number of remote interfaces for talking to existing ROM
monitors and other hardware:
remote-adapt.c AMD 29000 "Adapt"
remote-array.c Array Tech RAID controller
remote-bug.c Motorola BUG monitor
- remote-d10v.c GDB protocol, talking to a d10v chip
remote-e7000.c Hitachi E7000 ICE
remote-eb.c AMD 29000 "EBMON"
remote-es.c Ericsson 1800 monitor
@@ -446,138 +470,67 @@ monitors and other hardware:
remote-udi.c AMD 29000 using the AMD "Universal Debug Interface"
remote-vx.c VxWorks realtime kernel
-Remote-vx.c and the vx-share subdirectory contain a remote interface for the
-VxWorks realtime kernel, which communicates over TCP using the Sun
-RPC library. This would be a useful starting point for other remote-
-via-ethernet back ends.
-
-Remote-udi.c and the 29k-share subdirectory contain a remote interface
-for AMD 29000 programs, which uses the AMD "Universal Debug Interface".
-This allows GDB to talk to software simulators, emulators, and/or bare
-hardware boards, via network or serial interfaces. Note that GDB only
-provides an interface that speaks UDI, not a complete solution. You
-will need something on the other end that also speaks UDI.
-
-
-Reporting Bugs
-===============
-
-The correct address for reporting bugs found in gdb is
-"bug-gdb@gnu.org". Please email all bugs, and all requests for
-help with GDB, to that address. Please include the GDB version number
-(e.g., gdb-4.18), and how you configured it (e.g., "sun4" or "mach386
-host, i586-intel-synopsys target"). Since GDB now supports so many
-different configurations, it is important that you be precise about this.
-If at all possible, you should include the actual banner that GDB prints
-when it starts up, or failing that, the actual configure command that
-you used when configuring GDB.
-
-For more information on how/whether to report bugs, see the GDB Bugs
-section of the GDB manual (gdb/doc/gdb.texinfo).
-
-Known bugs:
-
- * Under Ultrix 4.2 (DECstation-3100) or Alphas under OSF/1, we have
- seen problems with backtraces after interrupting the inferior out
- of a read(). The problem is caused by ptrace() returning an
- incorrect value for the frame pointer register (register 15 or
- 30). As far as we can tell, this is a kernel problem. Any help
- with this would be greatly appreciated.
-
- * Under Ultrix 4.4 (DECstation-3100), setting the TERMCAP environment
- variable to a string without a trailing ':' can cause GDB to dump
- core upon startup. Although the core file makes it look as though
- GDB code failed, the crash actually occurs within a call to the
- termcap library function tgetent(). The problem can be solved by
- using the GNU Termcap library.
-
- Alphas running OSF/1 (versions 1.0 through 2.1) have the same buggy
- termcap code, but GDB behaves strangely rather than crashing.
-
- * On DECstations there are warnings about shift counts out of range in
- various BFD modules. None of them is a cause for alarm, they are actually
- a result of bugs in the DECstation compiler.
-
- * Notes for the DEC Alpha using OSF/1:
- The debugging output of native cc has two known problems; we view these
- as compiler bugs.
- The linker miscompacts symbol tables, which causes gdb to confuse the
- type of variables or results in `struct <illegal>' type outputs.
- dbx has the same problems with those executables. A workaround is to
- specify -Wl,-b when linking, but that will increase the executable size
- considerably.
- If a structure has incomplete type in one file (e.g., "struct foo *"
- without a definition for "struct foo"), gdb will be unable to find the
- structure definition from another file.
- It has been reported that the Ultrix 4.3A compiler on decstations has the
- same problems.
-
- * Notes for Solaris 2.x, using the SPARCworks cc compiler:
- You have to compile your program with the -xs option of the SPARCworks
- compiler to be able to debug your program with gdb.
- Under Solaris 2.3 you also need patch 101409-03 (Jumbo linker patch).
- Under Solaris 2.2, if you have patch 101052 installed, make sure
- that it is at least at revision 101052-06.
-
- * Under Irix 5 for SGIs, you must have installed the `compiler_dev.hdr'
- subsystem that is on the IDO CD, otherwise you will get complaints
- that certain files such as `/usr/include/syms.h' cannot be found.
-
- * Notes for BSD/386:
- To compile gdb-4.18 on BSD/386, you must run the configure script and
- its subscripts with bash. Here is an easy way to do this:
-
- bash -c 'CONFIG_SHELL=/bin/bash ./configure'
-
- (configure will report i386-unknown-bsd). Then, compile with the
- standard "make" command.
-
-GDB can produce warnings about symbols that it does not understand. By
-default, these warnings are disabled. You can enable them by executing
-`set complaint 10' (which you can put in your ~/.gdbinit if you like).
-I recommend doing this if you are working on a compiler, assembler,
-linker, or GDB, since it will point out problems that you may be able
-to fix. Warnings produced during symbol reading indicate some mismatch
-between the object file and GDB's symbol reading code. In many cases,
-it's a mismatch between the specs for the object file format, and what
-the compiler actually outputs or the debugger actually understands.
-
-
-X Windows versus GDB
+ Remote-vx.c and the vx-share subdirectory contain a remote
+interface for the VxWorks realtime kernel, which communicates over TCP
+using the Sun RPC library. This would be a useful starting point for
+other remote- via-ethernet back ends.
+
+ Remote-udi.c and the 29k-share subdirectory contain a remote
+interface for AMD 29000 programs, which uses the AMD "Universal Debug
+Interface". This allows GDB to talk to software simulators,
+emulators, and/or bare hardware boards, via network or serial
+interfaces. Note that GDB only provides an interface that speaks UDI,
+not a complete solution. You will need something on the other end
+that also speaks UDI.
+
+
+Reporting Bugs in GDB
=====================
-You should check out DDD, the Data Display Debugger. Here's the blurb
-from the DDD web site, http://www.cs.tu-bs.de/softech/ddd:
-
- The Data Display Debugger (DDD) is a popular graphical user
- interface for command-line debuggers such as GDB, DBX, JDB, WDB,
- XDB, the Perl debugger, and the Python debugger. Besides ``usual''
- front-end features such as viewing source texts, DDD has become
- famous through its interactive graphical data display, where data
- structures are displayed as graphs. A simple mouse click
- dereferences pointers or views structure contents, updated each
- time the program stops. Using DDD, you can reason about your
- application by watching its data, not just by viewing it execute
- lines of source code.
-
-Emacs users will very likely enjoy the Grand Unified Debugger mode;
-try typing `M-x gdb RET'.
+ There are several ways of reporting bugs in GDB. The prefered
+method is to use the World Wide Web:
+
+ http://www.gnu.org/software/gdb/bugs/
+
+As an alternative, the bug report can be submitted, via e-mail, to the
+address "bug-gdb@gnu.org".
-Those interested in experimenting with a new kind of gdb-mode
-should load gdb/gdba.el into GNU Emacs 19.25 or later. Comments
-on this mode are also welcome.
+ When submitting a bug, please include the GDB version number (e.g.,
+gdb-5.2), and how you configured it (e.g., "sun4" or "mach386 host,
+i586-intel-synopsys target"). Since GDB now supports so many
+different configurations, it is important that you be precise about
+this. If at all possible, you should include the actual banner that
+GDB prints when it starts up, or failing that, the actual configure
+command that you used when configuring GDB.
+
+ For more information on how/whether to report bugs, see the
+Reporting Bugs chapter of the GDB manual (gdb/doc/gdb.texinfo).
+
+
+Graphical interface to GDB -- X Windows, MS Windows
+==========================
+
+ Several graphical interfaces to GDB are available. You should
+check:
+
+ http://www.gnu.org/software/gdb/gui/
+
+for an up-to-date list.
+
+ Emacs users will very likely enjoy the Grand Unified Debugger mode;
+try typing `M-x gdb RET'.
Writing Code for GDB
=====================
-There is a lot of information about writing code for GDB in the
+ There is a lot of information about writing code for GDB in the
internals manual, distributed with GDB in gdb/doc/gdbint.texinfo. You
can read it by hand, print it by using TeX and texinfo, or process it
into an `info' file for use with Emacs' info mode or the standalone
`info' program.
-If you are pondering writing anything but a short patch, especially
+ If you are pondering writing anything but a short patch, especially
take note of the information about copyrights in the node Submitting
Patches. It can take quite a while to get all the paperwork done, so
we encourage you to start that process as soon as you decide you are
@@ -588,26 +541,33 @@ think you will be ready to submit the patches.
GDB Testsuite
=============
-There is a DejaGNU based testsuite available for testing your newly
-built GDB, or for regression testing GDBs with local modifications.
+ Included with the GDB distribution is a DejaGNU based testsuite
+that can either be used to test your newly built GDB, or for
+regression testing a GDB with local modifications.
+
+ Running the testsuite requires the prior installation of DejaGNU,
+which is generally available via ftp. The directory
+ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot.
+Once DejaGNU is installed, you can run the tests in one of the
+following ways:
-Running the testsuite requires the prior installation of DejaGNU,
-which is generally available via ftp; you'll need a pretty recent
-release. Once DejaGNU is installed, you can run the tests in one of
-two ways:
+ (1) cd gdb-5.2
+ make check-gdb
+
+or
- (1) cd gdb-4.18/gdb (assuming you also unpacked gdb)
+ (2) cd gdb-5.2/gdb
make check
or
- (2) cd gdb-4.18/gdb/testsuite
+ (3) cd gdb-5.2/gdb/testsuite
make site.exp (builds the site specific file)
runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate)
-The second method gives you slightly more control in case of problems with
-building one or more test executables or if you are using the testsuite
-'standalone', without it being part of the GDB source tree.
+The last method gives you slightly more control in case of problems
+with building one or more test executables or if you are using the
+testsuite `standalone', without it being part of the GDB source tree.
See the DejaGNU documentation for further details.
diff --git a/contrib/gdb/gdb/TODO b/contrib/gdb/gdb/TODO
index fcbcd16..ea46e9b 100644
--- a/contrib/gdb/gdb/TODO
+++ b/contrib/gdb/gdb/TODO
@@ -1,470 +1,350 @@
If you find inaccuracies in this list, please send mail to
-bug-gdb@prep.ai.mit.edu. If you would like to work on any of these,
-you should consider sending mail to the same address, to find out
-whether anyone else is working on it.
+gdb-patches@sources.redhat.com. If you would like to work on any
+of these, you should consider sending mail to the same address, to
+find out whether anyone else is working on it.
-General To Do List
-------------------
-This list is probably not up to date, and opinions vary about the
-importance or even desirability of some of the items.
+ GDB 5.1 - Fixes
+ ===============
-Add an "info bfd" command that displays supported object formats,
-similarly to objdump -i.
+Below is a list of problems identified during the GDB 5.0 release
+cycle. People hope to have these problems fixed in 5.1.
-START_INFERIOR_TRAPS_EXPECTED need never be defined to 2, since that
-is its default value. Clean this up.
+--
-It should be possible to use symbols from shared libraries before we know
-exactly where the libraries will be loaded. E.g. "b perror" before running
-the program. This could maybe be done as an extension of the "breakpoint
-re-evaluation" after new symbols are loaded.
+Wow, three bug reports for the same problem in one day! We should
+probably make fixing this a real priority :-).
-Make single_step() insert and remove breakpoints in one operation.
+Anyway, thanks for reporting.
-Speed up single stepping by avoiding extraneous ptrace calls.
+The following patch will fix the problems with setting breakpoints in
+dynamically loaded objects:
-Speed up single stepping by not inserting and removing breakpoints
-each time the inferior starts and stops.
+ http://sources.redhat.com/ml/gdb-patches/2000-05/msg00230.html
-Breakpoints should not be inserted and deleted all the time. Only the
-one(s) there should be removed when we have to step over one. Support
-breakpoints that don't have to be removed to step over them.
+This patch isn't checked in yet (ping Michael/JimB), but I hope this
+will be in the next GDB release.
-Update gdbint.texinfo to include doc on the directory structure and
-the various tricks of building gdb.
+There should really be a test in the testsuite for this problem, since
+it keeps coming up :-(. Any volunteers?
-Do a tutorial in gdb.texinfo on how to do simple things in gdb.
-E.g. how to set a breakpoint that just prints something and continues.
-How to break on aborts. Etc.
+Mark
-Provide "voodoo" debugging of core files. This creates a zombie
-process as a child of the debugger, and loads it up with the data,
-stack, and regs of the core file. This allows you to call functions
-in the executable, to manipulate the data in the core file.
+--
-GDB reopens the source file on every line, as you "next" through it.
+ GDB 5.1 - New features
+ ======================
-Referencing the vtbl member of a struct doesn't work. It prints OK
-if you print the struct, but it gets 0 if you try to deref it.
+The following new features should be included in 5.1.
-Persistent command history: A feature where you could save off a list
-of the commands you did, so you can edit it into something that will bring
-the target to the same place every time you source it.
-This would also be useful for automated fast watchpointing; if you go
-past the place where it watchpoints, you just start it over again and
-do it more carefully.
+--
-Deal with the SunOS 4.0 and 4.1.1 ptrace bug that loses the registers if
-the stack is paged out.
+ GDB 5.1 - Cleanups
+ ==================
-Finish the C++ exception handling stub routines. Lint points them out
-as unused statics functions.
+The following code cleanups will hopefully be applied to GDB 5.1.
-Perhaps "i source" should take an argument like that of "list".
+--
-See if core-aout.c's fetch_core_registers can be used on more machines.
-E.g. MIPS (mips-xdep.c).
+ GDB 5.1 - Known Problems
+ ========================
-unpack_double() does not handle IEEE float on the target unless the host
-is also IEEE. Death on a vax.
+--
-Set up interface between GDB and INFO so that you can hop into interactive
-INFO and back out again. When running under Emacs, should use Emacs
-info, else fork the info program. Installation of GDB should install
-its texinfo files into the info tree automagically, including the readline
-texinfo files.
+z8k
-"help address" ought to find the "help set print address" entry.
+The z8k has suffered bit rot and is known to not build. The problem
+was occuring in the opcodes directory.
-Remove the VTBL internal guts from printouts of C++ structs, unless
-vtblprint is set.
+--
-Remove "at 0xnnnn" from the "b foo" response, if `print address off' and if
-it matches the source line indicated.
+The BFD directory requires bug-fixed AUTOMAKE et.al.
-The prompt at end of screen should accept space as well as CR.
+AUTOMAKE 1.4 incorrectly set the TEXINPUTS environment variable. It
+contained the full path to texinfo.tex when it should have only
+contained the directory. The bug has been fixed in the current
+AUTOMAKE sources. Automake snapshots can be found in:
+ ftp://sources.redhat.com/pub/gdb/infrastructure
+and ftp://sources.redhat.com/pub/binutils
-Check STORE_RETURN_VALUE on all architectures. Check near it in tm-sparc.h
-for other bogosities.
+--
-Check for storage leaks in GDB, I'm sure there are a lot!
+Solaris 8 x86 CURSES_H problem
+http://sources.redhat.com/ml/gdb/2000-07/msg00038.html
-vtblprint of a vtbl should demangle the names it's printing.
+The original problem was worked around with:
-Backtrace should point out what the currently selected frame is, in
-its display, perhaps showing "@3 foo (bar, ...)" or ">3 foo (bar,
-...)" rather than "#3 foo (bar, ...)".
+ 2000-06-06 Michael Snyder <msnyder@cygnus.com>
-"i program" should work for core files, and display more info, like what
-actually caused it to die.
+ * configure.in: Enable autoconf to find curses.h on Solaris 2.8.
+ * configure: Regenerate.
-"x/10i" should shorten the long name, if any, on subsequent lines.
+When building both GDB and SID using the same source tree the problem
+will still occure. sid/component/configure.in mis-configures
+<curses.h> and leaves wrong information in the config cache.
-Check through the code for FIXME comments and fix them. dbxread.c,
-blockframe.c, and plenty more. (I count 634 as of 940621 - sts)
+--
-"next" over a function that longjumps, never stops until next time you happen
-to get to that spot by accident. E.g. "n" over execute_command which has
-an error.
+ GDB 5.2 - Fixes
+ ===============
-"set zeroprint off", don't bother printing members of structs which
-are entirely zero. Useful for those big structs with few useful
-members.
+--
-GDB does four ioctl's for every command, probably switching terminal modes
-to/from inferior or for readline or something.
+ GDB 5.2 - New features
+ ======================
-terminal_ours versus terminal_inferior: cache state. Switch should be a noop
-if the state is the same, too.
+--
-ptype $i6 = void??!
+GCC 3.0 ABI support (but hopefully sooner...).
-Clean up invalid_float handling so gdb doesn't coredump when it tries to
-access a NaN. While this might work on SPARC, other machines are not
-configured right.
+--
-"b value_at ; commands ; continue ; end" stops EVERY OTHER TIME!
-Then once you enter a command, it does the command, runs two more
-times, and then stops again! Bizarre... (This behaviour has been
-modified, but it is not yet 100% predictable when e.g. the commands
-call functions in the child, and while there, the child is interrupted
-with a signal, or hits a breakpoint.)
+Objective C/C++ support (but hopefully sooner...).
-help completion, help history should work.
+--
-Check that we can handle stack trace through varargs AND alloca in same
-function, on 29K.
+Import of readline 4.2
-wait_for_inferior loops forever if wait() gives it an error.
+--
-"i frame" shows wrong "arglist at" location, doesn't show where the args
-should be found, only their actual values.
+ GDB 5.2 - Cleanups
+ ==================
-There should be a way for "set" commands to validate the new setting
-before it takes effect.
+The following cleanups have been identified as part of GDB 5.2.
-A mess of floating point opcodes are missing from sparc-opcode.h.
-Also, a little program should test the table for bits that are
-overspecified or underspecified. E.g. if the must-be-ones bits
-and the must-be-zeroes bits leave some fields unexamined, and the format
-string leaves them unprinted, then point this out. If multiple
-non-alias patterns match, point this out too. Finally, there should
-be a sparc-optest.s file that tries each pattern out. This file
-should end up coming back the same (modulo transformation comments)
-if fed to "gas" then the .o is fed to gdb for disassembly.
+--
-Eliminate all the core_file_command's in all the xdep files.
-Eliminate separate declarations of registers[] everywhere.
+Remove old code that does not use ui_out functions and all the related
+"ifdef"s. This also allows the elimination of -DUI_OUT from
+Makefile.in and configure.in.
-"ena d" is ambiguous, why? "ena delete" seems to think it is a command!
+--
-Perhaps move the tdep, xdep, and nat files, into the config
-subdirectories. If not, at least straighten out their names so that
-they all start with the machine name.
+Compiler warnings.
-inferior_status should include stop_print_frame. It won't need to be
-reset in wait_for_inferior after bpstat_stop_status call, then.
+Eliminate warnings for all targets on at least one host for one of the
+-W flags. Flags up for debate include: -Wswitch -Wcomment -trigraphs
+-Wtrigraphs -Wunused-function -Wunused-label -Wunused-variable
+-Wunused-value -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
+-Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
+-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
+-Woverloaded-virtual -Winline
-i line VAR produces "Line number not known for symbol ``var''.". I
-thought we were stashing that info now!
+--
-We should be able to write to random files at hex offsets like adb.
+Deprecate, if not delete, the following:
-Make "target xxx" command interruptible.
+ register[]
+ register_valid[]
+ REGISTER_BYTE()
+ Replaced by, on the target side
+ supply_register()
+ and on core-gdb side:
+ {read,write}_register_gen()
+ Remote.c will need to use something
+ other than REGISTER_BYTE() and
+ REGISTER_RAW_SIZE() when unpacking
+ [gG] packets.
-Handle add_file with separate text, data, and bss addresses. Maybe
-handle separate addresses for each segment in the object file?
+ STORE_PSEUDO_REGISTER
+ FETCH_PSEUDO_REGISTER
+ Now handed by the methods
+ gdbarch_{read,write}_register()
+ which sits between core GDB and
+ the register cache.
-Handle free_named_symtab to cope with multiply-loaded object files
-in a dynamic linking environment. Should remember the last copy loaded,
-but not get too snowed if it finds references to the older copy.
+ REGISTER_CONVERTIBLE
+ REGISTER_CONVERT_TO_RAW
+ REGISTER_CONVERT_TO_VIRTUAL
+ I think these three are redundant.
+ gdbarch_register_{read,write} can
+ do any conversion it likes.
-Generalize and Standardize the RPC interface to a target program,
-improve it beyond the "ptrace" interface, and see if it can become a
-standard for remote debugging. (This is talking about the vxworks
-interface. Seems unlikely to me that there will be "a standard" for
-remote debugging anytime soon --kingdon, 8 Nov 1994).
+ REGISTER_VIRTUAL_SIZE
+ MAX_REGISTER_VIRTUAL_SIZE
+ REGISTER_VIRTUAL_TYPE
+ I think these can be replaced by
+ the pair:
+ FRAME_REGISTER_TYPE(frame, regnum)
+ REGISTER_TYPE(regnum)
-Remove all references to:
- text_offset
- data_offset
- text_data_start
- text_end
- exec_data_offset
- ...
-now that we have BFD. All remaining are in machine dependent files.
+ DO_REGISTERS_INFO
+ Replace with
+ FRAME_REGISTER_INFO (frame, ...)
-When quitting with a running program, if a core file was previously
-examined, you get "Couldn't read float regs from core file"...if
-indeed it can't. generic_mourn_inferior...
+ REGISTER_SIM_REGNO()
+ If nothing else rename this so that
+ how it relates to rawreg and the
+ regnum is clear.
-Have remote targets give a warning on a signal argument to
-target_resume. Or better yet, extend the protocols so that it works
-like it does on the Unix-like systems.
+ REGISTER_BYTES
+ The size of the cache can be computed
+ on the fly.
-Sort help and info output.
+ IS_TRAPPED_INTERNALVAR
+ The pseudo registers should eventually make
+ this redundant.
-Re-organize help categories into things that tend to fit on a screen
-and hang together.
+--
-renote-nindy.c handles interrupts poorly; it error()s out of badly
-chosen places, e.g. leaving current_frame zero, which causes core dumps
-on the next command.
+Obsolete the targets:
-Add in commands like ADB's for searching for patterns, etc. We should
-be able to examine and patch raw unsymboled binaries as well in gdb as
-we can in adb. (E.g. increase the timeout in /bin/login without source).
+arm*-wince-pe
+mips*-*-pe
+sh*-*-pe
-Those xdep files that call register_addr without defining it are
-probably simply broken. When reconfiguring this part of gdb, I could
-only make guesses about how to redo some of those files, and I
-probably guessed wrong, or left them "for later" when I have a
-machine that can attempt to build them.
+--
-When doing "step" or "next", if a few lines of source are skipped between
-the previous line and the current one, print those lines, not just the
-last line of a multiline statement.
+Obsolete the protocols:
-When searching for C++ superclasses in value_cast in valops.c, we must
-not search the "fields", only the "superclasses". There might be a
-struct with a field name that matches the superclass name. This can
-happen when the struct was defined before the superclass (before the
-name became a typedef).
+RDB?
-Handling of "&" address-of operator needs some serious overhaul
-for ANSI C and consistency on arrays and functions.
- For "float point[15];":
-ptype &point[4] ==> Attempt to take address of non-lvalue.
- For "char *malloc();":
-ptype malloc ==> "char *()"; should be same as
-ptype &malloc ==> "char *(*)()"
-call printf ("%x\n", malloc) ==> weird value, should be same as
-call printf ("%x\n", &malloc) ==> correct value
+``As of version 5.3, WindRiver has removed the RDB server (RDB
+protocol support is built into gdb).'' -- Till.
-Fix dbxread.c symbol reading in the presence of interrupts. It
-currently leaves a cleanup to blow away the entire symbol table when a
-QUIT occurs. (What's wrong with that? -kingdon, 28 Oct 1993).
+--
-Mipsread.c reads include files depth-first, because the dependencies
-in the psymtabs are way too inclusive (it seems to me). Figure out what
-really depends on what, to avoid recursing 20 or 30 times while reading
-real symtabs.
+Restructure gdb directory tree so that it avoids any 8.3 and 14
+filename problems.
-value_add() should be subtracting the lower bound of arrays, if known,
-and possibly checking against the upper bound for error reporting.
+--
-mipsread.c symbol table allocation and deallocation should be checked.
-My suspicion is that it's full of memory leaks.
+Convert GDB build process to AUTOMAKE.
-SunOS should have a target_lookup_symbol() for common'd things allocated
-by the shared library linker ld.so.
+See also sub-directory configure below.
-When listing source lines, check for a preceding \n, to verify that
-the file hasn't changed out from under us.
+The current convention is (kind of) to use $(<header>_h) in all
+dependency lists. It isn't done in a consistent way.
-When listing source lines, eat leading whitespace corresponding to the
-line-number prefix we print. This avoids long lines wrapping.
+--
-mipsread.c needs to check for old symtabs and psymtabs for the same
-files, the way it happens for dbxread.c and coffread.c, for VxWorks
-incremental symbol table reloading.
+ GDB 5.2 - Known Problems
+ ========================
-Get all the remote systems (where the protocol allows it) to be able to
-stop the remote system when the GDB user types ^C (like remote.c
-does). For ebmon, use ^Ak.
-
-Possible feature: A version of the "disassemble" command which shows
-both source and assembly code ("set symbol-filename on" is a partial
-solution).
+--
-investigate "x/s 0" (right now stops early) (I think maybe GDB is
-using a 0 address for bad purposes internally).
-
-Make "info path" and path_command work again (but independent of the
-environment either of gdb or that we'll pass to the inferior).
+ Code Cleanups: General
+ ======================
-Make GDB understand the GCC feature for putting octal constants in
-enums. Make it so overflow on an enum constant does not error_type
-the whole type. Allow arbitrarily large enums with type attributes.
-Put all this stuff in the testsuite.
+The following are more general cleanups and fixes. They are not tied
+to any specific release.
-Make TYPE_CODE_ERROR with a non-zero TYPE_LENGTH more useful (print
-the value in hex; process type attributes). Add this to the
-testsuite. This way future compilers can add new types and old
-versions of GDB can do something halfway reasonable.
-Clean up formatting of "info registers" on MIPS and 88k. See if it
-is possible to do this generically across all target architectures.
+ New Features and Fixes
+ ======================
-GDB gets bfd/corefile.c and gdb/corefile.c confused (this should be easy to
-repeat even with something more recent than GDB 4.9).
+These are harder than cleanups but easier than work involving
+fundamental architectural change.
-Check that unmatched RBRAC doesn't abort().
+--
-Fix mdebugread.c:parse_type to do fundamental types right (see
-rs6000_builtin_type in stabsread.c for what "right" is--the point is
-that the debug format fixes the sizes of these things and it shouldn't
-depend on stuff like TARGET_PTR_BIT and so on. For mdebug, there seem
-to be separate bt* codes for 64 bit and 32 bit things, and GDB should
-be aware of that). Also use a switch statement for clarity and speed.
+ Language Support
+ ================
-Investigate adding symbols in target_load--some targets do, some
-don't.
+New languages come onto the scene all the time.
-Put dirname in psymtabs and change lookup*symtab to use dirname (so
-/foo/bar.c works whether compiled by cc /foo/bar.c, or cd /foo; cc
-bar.c).
+--
-Merge xcoffread.c and coffread.c. Use breakpoint_re_set instead of
-fixup_breakpoints.
+Re: Various C++ things
-Fix byte order and int size sins in tm-a29k.h
-(EXTRACT_RETURN_VALUE). Perhaps should reproduce bug and verify fix
-(or perhaps should just fix it...).
+value_headof/value_from_vtable_info are worthless, and should be
+removed. The one place in printcmd.c that uses it should use the RTTI
+functions.
-Make a watchpoint on a constant expression an error (or warning
-perhaps)
+RTTI for g++ should be using the typeinfo functions rather than the
+vtables. The typeinfo functions are always at offset 4 from the
+beginning of the vtable, and are always right. The vtables will have
+weird names like E::VB sometimes. The typeinfo function will always
+be "E type_info function", or somesuch.
-Make a watchpoint which contains a function call an error (it is
-broken now, making it work is probably not worth the effort).
+value_virtual_fn_field needs to be fixed so there are no failures for
+virtual functions for C++ using g++.
-Re-do calls to signal() in remote.c, and inflow.c (set_sigint_trap and
-so on) to be independent of the debugging target, using target_stop to
-stop the inferior. Probably the part which is now handled by
-interrupt_query in remote.c can be done without any new features in
-the debugging target.
+Testsuite cases are the major priority right now for C++ support,
+since i have to make a lot of changes that could potentially break
+each other.
-New test case based on weird.exp but in which type numbers are not
-renumbered (thus multiply defining a type). This currently causes an
-infinite loop on "p v_comb".
+--
-Nuke baseclass_addr.
-Nuke USG define.
+ Symbol Support
+ ==============
-"source file more recent" loses on re-read
+--
-Fix 386 floating point so that floating point registers are real
-registers (but code can deal at run-time if they are missing, like
-mips and 68k). This would clean up "info float" and related stuff.
+Investiagate ways of reducing memory.
-Look at Solaris bug in interrupt.exp. Can get out of syscall with
-PRSABORT (syscall will return EINTR) but merely doing that leads to a
-"can't read memory" error.
+--
-gcc -g -c enummask.c then gdb enummask.o, then "p v". GDB complains
-about not being able to access memory location 0.
+Investigate ways of improving load time.
--------------------- enummask.c
-enum mask
-{
- ANIMAL = 0,
- VEGETABLE = 1,
- MINERAL = 2,
- BASIC_CATEGORY = 3,
+--
- WHITE = 0,
- BLUE = 4,
- GREEN = 8,
- BLACK = 0xc,
- COLOR = 0xc,
+ Testsuite Support
+ =================
- ALIVE = 0x10,
+There are never to many testcases.
- LARGE = 0x20
-} v;
+--
-If try to modify value in file with "set write off" should give
-appropriate error not "cannot access memory at address 0x65e0".
+Better thread testsuite.
-Why do we allow a target to omit standard register names (NO_STD_REGS
-in tm-z8k.h)? I thought the standard register names were supposed to
-be just that, standard.
+--
-Make DEBUG_EXPRESSIONS a maintenance command, dependent on
-MAINTENANCE_COMMANDS.
+Better C++ testsuite.
-Allow core file without exec file on RS/6000.
+--
-Make sure "shell" with no arguments works right on DOS.
+ Architectural Changes: General
+ ==============================
-Make gdb.ini (as well as .gdbinit) be checked on all platforms, so
-the same directory can be NFS-mounted on unix or DOS, and work the
-same way.
+These are harder than simple cleanups / fixes and, consequently
+involve more work. Typically an Architectural Change will be broken
+down into a more digestible set of cleanups and fixes.
-cd ~/tmp/<M-?> causes infinite loop (where ~/tmp is a directory).
+--
-Get SECT_OFF_TEXT stuff out of objfile_relocate (might be needed to
-get RS/6000 to work right, might not be immediately relevant).
+ Architectural Change: Multi-arch et al.
+ =======================================
-Clean up add_toc_to_loadinfo
+The long term objective is to remove all assumptions that there is a
+single target with a single address space with a single instruction
+set architecture and single application binary interface.
-Think about attached processes and sharing terminal.
+This is an ongoing effort. The first milestone is to enable
+``multi-arch'' where by all architectural decisions are made at
+runtime.
-John sez in reference to ignoring errors from tcsegpgrp if attach_flag:
-set_tty_state should not have any trouble with attached processes.
-Instead, the tty handling should leave the pgrp of the tty alone when
-attaching to processes (perhaps pass terminal_init_inferior a flag
-saying whether we're attaching).
+It should be noted that ``gdbarch'' is really ``gdbabi'' and
+``gdbisa''. Once things are multi-arched breaking that down correctly
+will become much easier.
-PAGE_SIZE redefined warnings on AIX. Probably should be using
-BFD_PAGE_SIZE throughout BFD.
+--
-Rewrite proceed, wait_for_inferior, and normal_stop to clean them up.
-Suggestions:
+ Architectural Change: MI, LIBGDB and scripting languages
+ ========================================================
- 1) Make each test in wait_for_inferior a seperate subroutine
- call.
- 2) Combine wait_for_inferior and normal_stop to clean up
- communication via global variables.
- 3) See if you can find some way to clean up the global
- variables that are used; possibly group them by data flow
- and information content?
+See also architectural changes related to the event loop. LIBGDB
+can't be finished until there is a generic event loop being used by
+all targets.
-Work out some kind of way to allow running the inferior to be done as
-a sub-execution of, eg. breakpoint command lists. Currently running
-the inferior interupts any command list execution. This would require
-some rewriting of wait_for_inferior & friends, and hence should
-probably be done in concert with the above.
+The long term objective is it to be possible to integrate GDB into
+scripting languages.
-Add function arguments to gdb user defined functions.
+--
-Add convenience variables that refer to exec file, symbol file,
-selected frame source file, selected frame function, selected frame
-line number, etc.
+ Architectural Change: Async
+ ===========================
-Add a "suspend" subcommand of the "continue" command to suspend gdb
-while continuing execution of the subprocess. Useful when you are
-debugging servers and you want to dodge out and initiate a connection
-to a server running under gdb.
+While GDB uses an event loop when prompting the user for input. That
+event loop is not exploited by targets when they allow the target
+program to continue. Typically targets still block in (target_wait())
+until the program again halts.
-Add stab information to allow reasonable debugging of inline functions
-(possibly they should show up on a stack backtrace? With a note
-indicating that they weren't "real"?).
+The closest a target comes to supporting full asynchronous mode are
+the remote targets ``async'' and ``extended-async''.
-Modify the naked "until" command to step until past the current source
-line, rather than past the current pc value. This is tricky simply
-because the low level routines have no way of specifying a multi-line
-step range, and there is no way of saying "don't print stuff when we
-stop" from above (otherwise could just call step many times).
-
-Modify the handling of symbols grouped through BINCL/EINCL stabs to
-allocate a partial symtab for each BINCL/EINCL grouping. This will
-seriously decrease the size of inter-psymtab dependencies and hence
-lessen the amount that needs to be read in when a new source file is
-accessed.
-
-Do an "x/i $pc" after each stepi or nexti.
-
-Modify all of the disassemblers to use printf_filtered to get correct
-more filtering.
-
-Modify gdb to work correctly with Pascal.
-
-Add a command for searching memory, a la adb. It specifies size,
-mask, value, start address. ADB searches until it finds it or hits
-an error (or is interrupted).
+--
# Local Variables:
# mode: text
diff --git a/contrib/gdb/gdb/acinclude.m4 b/contrib/gdb/gdb/acinclude.m4
index 43a0b0d..12f4c48 100644
--- a/contrib/gdb/gdb/acinclude.m4
+++ b/contrib/gdb/gdb/acinclude.m4
@@ -493,7 +493,7 @@ AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
if test x"${no_itcl}" = x ; then
# we reset no_itcl in case something fails here
no_itcl=true
- AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
+ AC_ARG_WITH(itclconfig, [ --with-itclconfig Directory containing itcl configuration (itclConfig.sh)],
with_itclconfig=${withval})
AC_MSG_CHECKING([for Itcl configuration])
AC_CACHE_VAL(ac_cv_c_itclconfig,[
@@ -619,7 +619,7 @@ AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
if test x"${no_itk}" = x ; then
# we reset no_itk in case something fails here
no_itk=true
- AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
+ AC_ARG_WITH(itkconfig, [ --with-itkconfig Directory containing itk configuration (itkConfig.sh)],
with_itkconfig=${withval})
AC_MSG_CHECKING([for Itk configuration])
AC_CACHE_VAL(ac_cv_c_itkconfig,[
@@ -765,7 +765,7 @@ AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
if test x"${no_tix}" = x ; then
# we reset no_tix in case something fails here
no_tix=true
- AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
+ AC_ARG_WITH(tixconfig, [ --with-tixconfig Directory containing tix configuration (tixConfig.sh)],
with_tixconfig=${withval})
AC_MSG_CHECKING([for Tix configuration])
AC_CACHE_VAL(ac_cv_c_tixconfig,[
@@ -859,3 +859,120 @@ dnl AC_SUBST(TIX_BUILD_INCLUDES)
AC_SUBST(TIX_BUILD_LIB_SPEC)
dnl AC_SUBST(TIX_LIB_SPEC)
])
+
+dnl sinclude(../gettext.m4) already included by bfd/acinclude.m4
+dnl The lines below arrange for aclocal not to bring gettext.m4's
+dnl CY_GNU_GETTEXT into aclocal.m4.
+ifelse(yes,no,[
+AC_DEFUN([CY_GNU_GETTEXT],)
+])
+
+## ----------------------------------------- ##
+## ANSIfy the C compiler whenever possible. ##
+## From Franc,ois Pinard ##
+## ----------------------------------------- ##
+
+# Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so. This macro tries various
+# options that select ANSI C on some system or another. It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT([$am_cv_prog_cc_stdc])
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
diff --git a/contrib/gdb/gdb/aclocal.m4 b/contrib/gdb/gdb/aclocal.m4
index 4fd3658..5b9d643 100644
--- a/contrib/gdb/gdb/aclocal.m4
+++ b/contrib/gdb/gdb/aclocal.m4
@@ -505,7 +505,7 @@ AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
if test x"${no_itcl}" = x ; then
# we reset no_itcl in case something fails here
no_itcl=true
- AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
+ AC_ARG_WITH(itclconfig, [ --with-itclconfig Directory containing itcl configuration (itclConfig.sh)],
with_itclconfig=${withval})
AC_MSG_CHECKING([for Itcl configuration])
AC_CACHE_VAL(ac_cv_c_itclconfig,[
@@ -631,7 +631,7 @@ AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
if test x"${no_itk}" = x ; then
# we reset no_itk in case something fails here
no_itk=true
- AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
+ AC_ARG_WITH(itkconfig, [ --with-itkconfig Directory containing itk configuration (itkConfig.sh)],
with_itkconfig=${withval})
AC_MSG_CHECKING([for Itk configuration])
AC_CACHE_VAL(ac_cv_c_itkconfig,[
@@ -777,7 +777,7 @@ AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
if test x"${no_tix}" = x ; then
# we reset no_tix in case something fails here
no_tix=true
- AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
+ AC_ARG_WITH(tixconfig, [ --with-tixconfig Directory containing tix configuration (tixConfig.sh)],
with_tixconfig=${withval})
AC_MSG_CHECKING([for Tix configuration])
AC_CACHE_VAL(ac_cv_c_tixconfig,[
@@ -872,6 +872,30 @@ dnl AC_SUBST(TIX_BUILD_INCLUDES)
dnl AC_SUBST(TIX_LIB_SPEC)
])
+dnl sinclude(../gettext.m4) already included by bfd/acinclude.m4
+dnl The lines below arrange for aclocal not to bring gettext.m4's
+dnl CY_GNU_GETTEXT into aclocal.m4.
+ifelse(yes,no,[
+AC_DEFUN([CY_GNU_GETTEXT],)
+])
+
+
+# Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
# serial 1
@@ -890,7 +914,7 @@ dnl AC_SUBST(TIX_LIB_SPEC)
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
-AC_DEFUN(AM_PROG_CC_STDC,
+AC_DEFUN([AM_PROG_CC_STDC],
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
@@ -900,7 +924,7 @@ dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
@@ -908,9 +932,10 @@ ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
@@ -952,7 +977,7 @@ CC="$ac_save_CC"
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
+ AC_MSG_RESULT([$am_cv_prog_cc_stdc])
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
@@ -960,348 +985,36 @@ case "x$am_cv_prog_cc_stdc" in
esac
])
-# This file is derived from `gettext.m4'. The difference is that the
-# included macros assume Cygnus-style source and build trees.
-
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 3
-
-AC_DEFUN(CY_WITH_NLS,
- [AC_MSG_CHECKING([whether NLS is requested])
- dnl Default is enabled NLS
- AC_ARG_ENABLE(nls,
- [ --disable-nls do not use Native Language Support],
- USE_NLS=$enableval, USE_NLS=yes)
- AC_MSG_RESULT($USE_NLS)
- AC_SUBST(USE_NLS)
-
- USE_INCLUDED_LIBINTL=no
-
- dnl If we use NLS figure out what method
- if test "$USE_NLS" = "yes"; then
- AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
- AC_MSG_CHECKING([whether included gettext is requested])
- AC_ARG_WITH(included-gettext,
- [ --with-included-gettext use the GNU gettext library included here],
- nls_cv_force_use_gnu_gettext=$withval,
- nls_cv_force_use_gnu_gettext=no)
- AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
-
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- dnl User does not insist on using GNU NLS library. Figure out what
- dnl to use. If gettext or catgets are available (in this order) we
- dnl use this. Else we have to fall back to GNU NLS library.
- dnl catgets is only used if permitted by option --with-catgets.
- nls_cv_header_intl=
- nls_cv_header_libgt=
- CATOBJEXT=NONE
-
- AC_CHECK_HEADER(libintl.h,
- [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
- [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
- gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
-
- if test "$gt_cv_func_gettext_libc" != "yes"; then
- AC_CHECK_LIB(intl, bindtextdomain,
- [AC_CACHE_CHECK([for gettext in libintl],
- gt_cv_func_gettext_libintl,
- [AC_TRY_LINK([], [return (int) gettext ("")],
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)])])
- fi
-
- if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes"; then
- AC_DEFINE(HAVE_GETTEXT, 1,
- [Define as 1 if you have gettext and don't want to use GNU gettext.])
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
- if test "$MSGFMT" != "no"; then
- AC_CHECK_FUNCS(dcgettext)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr],
- [CATOBJEXT=.gmo
- DATADIRNAME=share],
- [CATOBJEXT=.mo
- DATADIRNAME=lib])
- INSTOBJEXT=.mo
- fi
- fi
- ])
-
- dnl In the standard gettext, we would now check for catgets.
- dnl However, we never want to use catgets for our releases.
-
- if test "$CATOBJEXT" = "NONE"; then
- dnl Neither gettext nor catgets in included in the C library.
- dnl Fall back on GNU gettext library.
- nls_cv_use_gnu_gettext=yes
- fi
- fi
-
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- dnl Mark actions used to generate GNU NLS library.
- INTLOBJS="\$(GETTOBJS)"
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_SUBST(MSGFMT)
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.gmo
- INSTOBJEXT=.mo
- DATADIRNAME=share
- INTLDEPS='$(top_builddir)/../intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=libintl.h
- nls_cv_header_libgt=libgettext.h
- fi
-
- dnl Test whether we really found GNU xgettext.
- if test "$XGETTEXT" != ":"; then
- dnl If it is no GNU xgettext we define it as : so that the
- dnl Makefiles still can work.
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
- : ;
- else
- AC_MSG_RESULT(
- [found xgettext programs is not GNU xgettext; ignore it])
- XGETTEXT=":"
- fi
- fi
-
- # We need to process the po/ directory.
- POSUB=po
- else
- DATADIRNAME=share
- nls_cv_header_intl=libintl.h
- nls_cv_header_libgt=libgettext.h
- fi
-
- # If this is used in GNU gettext we have to set USE_NLS to `yes'
- # because some of the sources are only built for this goal.
- if test "$PACKAGE" = gettext; then
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
- fi
-
- dnl These rules are solely for the distribution goal. While doing this
- dnl we only have to keep exactly one list of the available catalogs
- dnl in configure.in.
- for lang in $ALL_LINGUAS; do
- GMOFILES="$GMOFILES $lang.gmo"
- POFILES="$POFILES $lang.po"
- done
-
- dnl Make all variables we use known to autoconf.
- AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATALOGS)
- AC_SUBST(CATOBJEXT)
- AC_SUBST(DATADIRNAME)
- AC_SUBST(GMOFILES)
- AC_SUBST(INSTOBJEXT)
- AC_SUBST(INTLDEPS)
- AC_SUBST(INTLLIBS)
- AC_SUBST(INTLOBJS)
- AC_SUBST(POFILES)
- AC_SUBST(POSUB)
- ])
-
-AC_DEFUN(CY_GNU_GETTEXT,
- [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_OFF_T])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
-
- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h])
- AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
-
- if test "${ac_cv_func_stpcpy+set}" != "set"; then
- AC_CHECK_FUNCS(stpcpy)
- fi
- if test "${ac_cv_func_stpcpy}" = "yes"; then
- AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
- fi
-
- AM_LC_MESSAGES
- CY_WITH_NLS
-
- if test "x$CATOBJEXT" != "x"; then
- if test "x$ALL_LINGUAS" = "x"; then
- LINGUAS=
- else
- AC_MSG_CHECKING(for catalogs to be installed)
- NEW_LINGUAS=
- for lang in ${LINGUAS=$ALL_LINGUAS}; do
- case "$ALL_LINGUAS" in
- *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
- esac
- done
- LINGUAS=$NEW_LINGUAS
- AC_MSG_RESULT($LINGUAS)
- fi
-
- dnl Construct list of names of catalog files to be constructed.
- if test -n "$LINGUAS"; then
- for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
- fi
- fi
-
- dnl The reference to <locale.h> in the installed <libintl.h> file
- dnl must be resolved because we cannot expect the users of this
- dnl to define HAVE_LOCALE_H.
- if test $ac_cv_header_locale_h = yes; then
- INCLUDE_LOCALE_H="#include <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. Take care yourself. */"
- fi
- AC_SUBST(INCLUDE_LOCALE_H)
-
- dnl Determine which catalog format we have (if any is needed)
- dnl For now we know about two different formats:
- dnl Linux libc-5 and the normal X/Open format
- if test -f $srcdir/po2tbl.sed.in; then
- if test "$CATOBJEXT" = ".cat"; then
- AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
-
- dnl Transform the SED scripts while copying because some dumb SEDs
- dnl cannot handle comments.
- sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
- fi
- dnl po2tbl.sed is always needed.
- sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
- $srcdir/po2tbl.sed.in > po2tbl.sed
- fi
-
- dnl In the intl/Makefile.in we have a special dependency which makes
- dnl only sense for gettext. We comment this out for non-gettext
- dnl packages.
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- fi
- AC_SUBST(GT_NO)
- AC_SUBST(GT_YES)
-
- MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
- AC_SUBST(MKINSTALLDIRS)
-
- dnl *** For now the libtool support in intl/Makefile is not for real.
- l=
- AC_SUBST(l)
-
- dnl Generate list of files to be processed by xgettext which will
- dnl be included in po/Makefile. But only do this if the po directory
- dnl exists in srcdir.
- if test -d $srcdir/po; then
- test -d po || mkdir po
- if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
- posrcprefix="$srcdir/"
- else
- posrcprefix="../$srcdir/"
- fi
- else
- posrcprefix="../"
- fi
- rm -f po/POTFILES
- sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
- < $srcdir/po/POTFILES.in > po/POTFILES
- fi
- ])
-
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 1996.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
# serial 1
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-AC_DEFUN(AM_LC_MESSAGES,
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
- if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
- [Define if your locale.h file contains LC_MESSAGES.])
- fi
- fi])
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
diff --git a/contrib/gdb/gdb/alphabsd-nat.c b/contrib/gdb/gdb/alphabsd-nat.c
new file mode 100644
index 0000000..d7ad3a7
--- /dev/null
+++ b/contrib/gdb/gdb/alphabsd-nat.c
@@ -0,0 +1,211 @@
+/* Native-dependent code for Alpha BSD's.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
+
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
+#ifndef HAVE_FPREGSET_T
+typedef struct fpreg fpregset_t;
+#endif
+
+#include "gregset.h"
+
+/* Number of general-purpose registers. */
+#define NUM_GREGS 32
+
+/* Number of floating point registers. */
+#define NUM_FPREGS 31
+
+
+/* Transfering the registers between GDB, inferiors and core files. */
+
+/* Fill GDB's register array with the general-purpose register values
+ in *GREGSETP. */
+
+void
+supply_gregset (gregset_t *gregsetp)
+{
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ {
+ if (CANNOT_FETCH_REGISTER (i))
+ supply_register (i, NULL);
+ else
+ supply_register (i, (char *) &gregsetp->r_regs[i]);
+ }
+
+ /* The PC travels in the R_ZERO slot. */
+ supply_register (PC_REGNUM, (char *) &gregsetp->r_regs[R_ZERO]);
+}
+
+/* Fill register REGNO (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
+ regcache_collect (i, (char *) &gregsetp->r_regs[i]);
+
+ /* The PC travels in the R_ZERO slot. */
+ if (regno == -1 || regno == PC_REGNUM)
+ regcache_collect (PC_REGNUM, (char *) &gregsetp->r_regs[R_ZERO]);
+}
+
+/* Fill GDB's register array with the floating-point register values
+ in *FPREGSETP. */
+
+void
+supply_fpregset (fpregset_t *fpregsetp)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++)
+ {
+ if (CANNOT_FETCH_REGISTER (i))
+ supply_register (i, NULL);
+ else
+ supply_register (i, (char *) &fpregsetp->fpr_regs[i - FP0_REGNUM]);
+ }
+
+ supply_register (FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
+}
+
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++)
+ if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
+ regcache_collect (i, (char *) &fpregsetp->fpr_regs[i - FP0_REGNUM]);
+
+ if (regno == -1 || regno == FPCR_REGNUM)
+ regcache_collect (FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
+}
+
+
+/* Determine if PT_GETREGS fetches this register. */
+
+static int
+getregs_supplies (int regno)
+{
+
+ return ((regno >= V0_REGNUM && regno <= ZERO_REGNUM)
+ || regno >= PC_REGNUM);
+}
+
+
+/* Fetch register REGNO from the inferior. If REGNO is -1, do this
+ for all registers (including the floating point registers). */
+
+void
+fetch_inferior_registers (int regno)
+{
+
+ if (regno == -1 || getregs_supplies (regno))
+ {
+ gregset_t gregs;
+
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ supply_gregset (&gregs);
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || regno >= FP0_REGNUM)
+ {
+ fpregset_t fpregs;
+
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating point status");
+
+ supply_fpregset (&fpregs);
+ }
+
+ /* Reset virtual frame pointer. */
+ supply_register (FP_REGNUM, NULL);
+}
+
+/* Store register REGNO back into the inferior. If REGNO is -1, do
+ this for all registers (including the floating point registers). */
+
+void
+store_inferior_registers (int regno)
+{
+
+ if (regno == -1 || getregs_supplies (regno))
+ {
+ gregset_t gregs;
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ fill_gregset (&gregs, regno);
+
+ if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't write registers");
+
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || regno >= FP0_REGNUM)
+ {
+ fpregset_t fpregs;
+
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating point status");
+
+ fill_fpregset (&fpregs, regno);
+
+ if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't write floating point status");
+ }
+}
diff --git a/contrib/gdb/gdb/alphafbsd-tdep.c b/contrib/gdb/gdb/alphafbsd-tdep.c
new file mode 100644
index 0000000..e2d4749
--- /dev/null
+++ b/contrib/gdb/gdb/alphafbsd-tdep.c
@@ -0,0 +1,53 @@
+/* Target-dependent code for FreeBSD/Alpha.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+
+int
+alphafbsd_use_struct_convention (int gcc_p, struct type *type)
+{
+ enum type_code code;
+ int i;
+
+ /* All aggregate types that won't fit in a register must be returned
+ in memory. */
+ if (TYPE_LENGTH (type) > REGISTER_SIZE)
+ return 1;
+
+ /* The only aggregate types that can be returned in a register are
+ structs and unions. Arrays must be returned in memory. */
+ code = TYPE_CODE (type);
+ if (code != TYPE_CODE_STRUCT && code != TYPE_CODE_UNION)
+ return 1;
+
+ /* We need to check if this struct/union is "integer" like. For
+ this to be true, the offset of each adressable subfield must be
+ zero. Note that bit fields are not addressable. */
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ /* If the field bitsize is non-zero, it isn't adressable. */
+ if (TYPE_FIELD_BITPOS (type, i) != 0
+ && TYPE_FIELD_BITSIZE (type, i) == 0)
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/contrib/gdb/gdb/annotate.c b/contrib/gdb/gdb/annotate.c
index ec3e424..66211e9 100644
--- a/contrib/gdb/gdb/annotate.c
+++ b/contrib/gdb/gdb/annotate.c
@@ -1,21 +1,23 @@
/* Annotation routines for GDB.
- Copyright 1986, 89, 90, 91, 92, 95, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1998, 1999,
+ 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -27,18 +29,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for local functions. */
-static void print_value_flags PARAMS ((struct type *));
+extern void _initialize_annotate (void);
-static void breakpoint_changed PARAMS ((struct breakpoint *));
+static void print_value_flags (struct type *);
-void (*annotate_starting_hook) PARAMS ((void));
-void (*annotate_stopped_hook) PARAMS ((void));
-void (*annotate_signalled_hook) PARAMS ((void));
-void (*annotate_exited_hook) PARAMS ((void));
+static void breakpoint_changed (struct breakpoint *);
+
+void (*annotate_starting_hook) (void);
+void (*annotate_stopped_hook) (void);
+void (*annotate_signalled_hook) (void);
+void (*annotate_signal_hook) (void);
+void (*annotate_exited_hook) (void);
+
+static int ignore_count_changed = 0;
static void
-print_value_flags (t)
- struct type *t;
+print_value_flags (struct type *t)
{
if (can_dereference (t))
printf_filtered ("*");
@@ -47,41 +53,53 @@ print_value_flags (t)
}
void
-breakpoints_changed ()
+breakpoints_changed (void)
{
if (annotation_level > 1)
{
target_terminal_ours ();
printf_unfiltered ("\n\032\032breakpoints-invalid\n");
+ if (ignore_count_changed)
+ ignore_count_changed = 0; /* Avoid multiple break annotations. */
}
}
+/* The GUI needs to be informed of ignore_count changes, but we don't
+ want to provide successive multiple breakpoints-invalid messages
+ that are all caused by the fact that the ignore count is changing
+ (which could keep the GUI very busy). One is enough, after the
+ target actually "stops". */
+
void
-annotate_breakpoint (num)
- int num;
+annotate_ignore_count_change (void)
+{
+ if (annotation_level > 1)
+ ignore_count_changed = 1;
+}
+
+void
+annotate_breakpoint (int num)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032breakpoint %d\n", num);
}
void
-annotate_catchpoint (num)
- int num;
+annotate_catchpoint (int num)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032catchpoint %d\n", num);
}
void
-annotate_watchpoint (num)
- int num;
+annotate_watchpoint (int num)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032watchpoint %d\n", num);
}
void
-annotate_starting ()
+annotate_starting (void)
{
if (annotate_starting_hook)
@@ -89,39 +107,43 @@ annotate_starting ()
else
{
if (annotation_level > 1)
- {
- printf_filtered ("\n\032\032starting\n");
- }
+ {
+ printf_filtered ("\n\032\032starting\n");
+ }
}
}
void
-annotate_stopped ()
+annotate_stopped (void)
{
if (annotate_stopped_hook)
annotate_stopped_hook ();
else
{
if (annotation_level > 1)
- printf_filtered ("\n\032\032stopped\n");
+ printf_filtered ("\n\032\032stopped\n");
+ }
+ if (annotation_level > 1 && ignore_count_changed)
+ {
+ ignore_count_changed = 0;
+ breakpoints_changed ();
}
}
void
-annotate_exited (exitstatus)
- int exitstatus;
+annotate_exited (int exitstatus)
{
if (annotate_exited_hook)
annotate_exited_hook ();
else
{
if (annotation_level > 1)
- printf_filtered ("\n\032\032exited %d\n", exitstatus);
+ printf_filtered ("\n\032\032exited %d\n", exitstatus);
}
}
void
-annotate_signalled ()
+annotate_signalled (void)
{
if (annotate_signalled_hook)
annotate_signalled_hook ();
@@ -131,78 +153,80 @@ annotate_signalled ()
}
void
-annotate_signal_name ()
+annotate_signal_name (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032signal-name\n");
}
void
-annotate_signal_name_end ()
+annotate_signal_name_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032signal-name-end\n");
}
void
-annotate_signal_string ()
+annotate_signal_string (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032signal-string\n");
}
void
-annotate_signal_string_end ()
+annotate_signal_string_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032signal-string-end\n");
}
void
-annotate_signal ()
+annotate_signal (void)
{
+ if (annotate_signal_hook)
+ annotate_signal_hook ();
+
if (annotation_level > 1)
printf_filtered ("\n\032\032signal\n");
}
void
-annotate_breakpoints_headers ()
+annotate_breakpoints_headers (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032breakpoints-headers\n");
}
void
-annotate_field (num)
- int num;
+annotate_field (int num)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032field %d\n", num);
}
void
-annotate_breakpoints_table ()
+annotate_breakpoints_table (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032breakpoints-table\n");
}
void
-annotate_record ()
+annotate_record (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032record\n");
}
void
-annotate_breakpoints_table_end ()
+annotate_breakpoints_table_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032breakpoints-table-end\n");
}
void
-annotate_frames_invalid ()
+annotate_frames_invalid (void)
{
if (annotation_level > 1)
{
@@ -212,8 +236,7 @@ annotate_frames_invalid ()
}
void
-annotate_field_begin (type)
- struct type *type;
+annotate_field_begin (struct type *type)
{
if (annotation_level > 1)
{
@@ -224,51 +247,49 @@ annotate_field_begin (type)
}
void
-annotate_field_name_end ()
+annotate_field_name_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032field-name-end\n");
}
void
-annotate_field_value ()
+annotate_field_value (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032field-value\n");
}
void
-annotate_field_end ()
+annotate_field_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032field-end\n");
}
void
-annotate_quit ()
+annotate_quit (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032quit\n");
}
void
-annotate_error ()
+annotate_error (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032error\n");
}
void
-annotate_error_begin ()
+annotate_error_begin (void)
{
if (annotation_level > 1)
fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
}
void
-annotate_value_history_begin (histindex, type)
- int histindex;
- struct type *type;
+annotate_value_history_begin (int histindex, struct type *type)
{
if (annotation_level > 1)
{
@@ -279,8 +300,7 @@ annotate_value_history_begin (histindex, type)
}
void
-annotate_value_begin (type)
- struct type *type;
+annotate_value_begin (struct type *type)
{
if (annotation_level > 1)
{
@@ -291,92 +311,91 @@ annotate_value_begin (type)
}
void
-annotate_value_history_value ()
+annotate_value_history_value (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032value-history-value\n");
}
void
-annotate_value_history_end ()
+annotate_value_history_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032value-history-end\n");
}
void
-annotate_value_end ()
+annotate_value_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032value-end\n");
}
void
-annotate_display_begin ()
+annotate_display_begin (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-begin\n");
}
void
-annotate_display_number_end ()
+annotate_display_number_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-number-end\n");
}
void
-annotate_display_format ()
+annotate_display_format (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-format\n");
}
void
-annotate_display_expression ()
+annotate_display_expression (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-expression\n");
}
void
-annotate_display_expression_end ()
+annotate_display_expression_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-expression-end\n");
}
void
-annotate_display_value ()
+annotate_display_value (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-value\n");
}
void
-annotate_display_end ()
+annotate_display_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032display-end\n");
}
void
-annotate_arg_begin ()
+annotate_arg_begin (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032arg-begin\n");
}
void
-annotate_arg_name_end ()
+annotate_arg_name_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032arg-name-end\n");
}
void
-annotate_arg_value (type)
- struct type *type;
+annotate_arg_value (struct type *type)
{
if (annotation_level > 1)
{
@@ -387,19 +406,14 @@ annotate_arg_value (type)
}
void
-annotate_arg_end ()
+annotate_arg_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032arg-end\n");
}
void
-annotate_source (filename, line, character, mid, pc)
- char *filename;
- int line;
- int character;
- int mid;
- CORE_ADDR pc;
+annotate_source (char *filename, int line, int character, int mid, CORE_ADDR pc)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032source ");
@@ -414,9 +428,7 @@ annotate_source (filename, line, character, mid, pc)
}
void
-annotate_frame_begin (level, pc)
- int level;
- CORE_ADDR pc;
+annotate_frame_begin (int level, CORE_ADDR pc)
{
if (annotation_level > 1)
{
@@ -427,100 +439,98 @@ annotate_frame_begin (level, pc)
}
void
-annotate_function_call ()
+annotate_function_call (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032function-call\n");
}
void
-annotate_signal_handler_caller ()
+annotate_signal_handler_caller (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032signal-handler-caller\n");
}
void
-annotate_frame_address ()
+annotate_frame_address (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-address\n");
}
void
-annotate_frame_address_end ()
+annotate_frame_address_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-address-end\n");
}
void
-annotate_frame_function_name ()
+annotate_frame_function_name (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-function-name\n");
}
void
-annotate_frame_args ()
+annotate_frame_args (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-args\n");
}
void
-annotate_frame_source_begin ()
+annotate_frame_source_begin (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-source-begin\n");
}
void
-annotate_frame_source_file ()
+annotate_frame_source_file (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-source-file\n");
}
void
-annotate_frame_source_file_end ()
+annotate_frame_source_file_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-source-file-end\n");
}
void
-annotate_frame_source_line ()
+annotate_frame_source_line (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-source-line\n");
}
void
-annotate_frame_source_end ()
+annotate_frame_source_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-source-end\n");
}
void
-annotate_frame_where ()
+annotate_frame_where (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-where\n");
}
void
-annotate_frame_end ()
+annotate_frame_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032frame-end\n");
}
void
-annotate_array_section_begin (index, elttype)
- int index;
- struct type *elttype;
+annotate_array_section_begin (int index, struct type *elttype)
{
if (annotation_level > 1)
{
@@ -531,43 +541,41 @@ annotate_array_section_begin (index, elttype)
}
void
-annotate_elt_rep (repcount)
- unsigned int repcount;
+annotate_elt_rep (unsigned int repcount)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032elt-rep %u\n", repcount);
}
void
-annotate_elt_rep_end ()
+annotate_elt_rep_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032elt-rep-end\n");
}
void
-annotate_elt ()
+annotate_elt (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032elt\n");
}
void
-annotate_array_section_end ()
+annotate_array_section_end (void)
{
if (annotation_level > 1)
printf_filtered ("\n\032\032array-section-end\n");
}
static void
-breakpoint_changed (b)
- struct breakpoint *b;
+breakpoint_changed (struct breakpoint *b)
{
breakpoints_changed ();
}
void
-_initialize_annotate ()
+_initialize_annotate (void)
{
if (annotation_level > 1)
{
diff --git a/contrib/gdb/gdb/annotate.h b/contrib/gdb/gdb/annotate.h
index 59739db..ac3cec8 100644
--- a/contrib/gdb/gdb/annotate.h
+++ b/contrib/gdb/gdb/annotate.h
@@ -1,104 +1,106 @@
/* Annotation routines for GDB.
- Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1994, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "symtab.h"
#include "gdbtypes.h"
-extern void breakpoints_changed PARAMS ((void));
-
-extern void annotate_breakpoint PARAMS ((int));
-extern void annotate_catchpoint PARAMS ((int));
-extern void annotate_watchpoint PARAMS ((int));
-extern void annotate_starting PARAMS ((void));
-extern void annotate_stopped PARAMS ((void));
-extern void annotate_exited PARAMS ((int));
-extern void annotate_signalled PARAMS ((void));
-extern void annotate_signal_name PARAMS ((void));
-extern void annotate_signal_name_end PARAMS ((void));
-extern void annotate_signal_string PARAMS ((void));
-extern void annotate_signal_string_end PARAMS ((void));
-extern void annotate_signal PARAMS ((void));
-
-extern void annotate_breakpoints_headers PARAMS ((void));
-extern void annotate_field PARAMS ((int));
-extern void annotate_breakpoints_table PARAMS ((void));
-extern void annotate_record PARAMS ((void));
-extern void annotate_breakpoints_table_end PARAMS ((void));
-
-extern void annotate_frames_invalid PARAMS ((void));
-
-#ifdef __STDC__
+extern void breakpoints_changed (void);
+
+extern void annotate_ignore_count_change (void);
+extern void annotate_breakpoint (int);
+extern void annotate_catchpoint (int);
+extern void annotate_watchpoint (int);
+extern void annotate_starting (void);
+extern void annotate_stopped (void);
+extern void annotate_exited (int);
+extern void annotate_signalled (void);
+extern void annotate_signal_name (void);
+extern void annotate_signal_name_end (void);
+extern void annotate_signal_string (void);
+extern void annotate_signal_string_end (void);
+extern void annotate_signal (void);
+
+extern void annotate_breakpoints_headers (void);
+extern void annotate_field (int);
+extern void annotate_breakpoints_table (void);
+extern void annotate_record (void);
+extern void annotate_breakpoints_table_end (void);
+
+extern void annotate_frames_invalid (void);
+
struct type;
-#endif
-
-extern void annotate_field_begin PARAMS ((struct type *));
-extern void annotate_field_name_end PARAMS ((void));
-extern void annotate_field_value PARAMS ((void));
-extern void annotate_field_end PARAMS ((void));
-
-extern void annotate_quit PARAMS ((void));
-extern void annotate_error PARAMS ((void));
-extern void annotate_error_begin PARAMS ((void));
-
-extern void annotate_value_history_begin PARAMS ((int, struct type *));
-extern void annotate_value_begin PARAMS ((struct type *));
-extern void annotate_value_history_value PARAMS ((void));
-extern void annotate_value_history_end PARAMS ((void));
-extern void annotate_value_end PARAMS ((void));
-
-extern void annotate_display_begin PARAMS ((void));
-extern void annotate_display_number_end PARAMS ((void));
-extern void annotate_display_format PARAMS ((void));
-extern void annotate_display_expression PARAMS ((void));
-extern void annotate_display_expression_end PARAMS ((void));
-extern void annotate_display_value PARAMS ((void));
-extern void annotate_display_end PARAMS ((void));
-
-extern void annotate_arg_begin PARAMS ((void));
-extern void annotate_arg_name_end PARAMS ((void));
-extern void annotate_arg_value PARAMS ((struct type *));
-extern void annotate_arg_end PARAMS ((void));
-
-extern void annotate_source PARAMS ((char *, int, int, int, CORE_ADDR));
-
-extern void annotate_frame_begin PARAMS ((int, CORE_ADDR));
-extern void annotate_function_call PARAMS ((void));
-extern void annotate_signal_handler_caller PARAMS ((void));
-extern void annotate_frame_address PARAMS ((void));
-extern void annotate_frame_address_end PARAMS ((void));
-extern void annotate_frame_function_name PARAMS ((void));
-extern void annotate_frame_args PARAMS ((void));
-extern void annotate_frame_source_begin PARAMS ((void));
-extern void annotate_frame_source_file PARAMS ((void));
-extern void annotate_frame_source_file_end PARAMS ((void));
-extern void annotate_frame_source_line PARAMS ((void));
-extern void annotate_frame_source_end PARAMS ((void));
-extern void annotate_frame_where PARAMS ((void));
-extern void annotate_frame_end PARAMS ((void));
-
-extern void annotate_array_section_begin PARAMS ((int, struct type *));
-extern void annotate_elt_rep PARAMS ((unsigned int));
-extern void annotate_elt_rep_end PARAMS ((void));
-extern void annotate_elt PARAMS ((void));
-extern void annotate_array_section_end PARAMS ((void));
-
-extern void (*annotate_starting_hook) PARAMS ((void));
-extern void (*annotate_stopped_hook) PARAMS ((void));
-extern void (*annotate_signalled_hook) PARAMS ((void));
-extern void (*annotate_exited_hook) PARAMS ((void));
+
+extern void annotate_field_begin (struct type *);
+extern void annotate_field_name_end (void);
+extern void annotate_field_value (void);
+extern void annotate_field_end (void);
+
+extern void annotate_quit (void);
+extern void annotate_error (void);
+extern void annotate_error_begin (void);
+
+extern void annotate_value_history_begin (int, struct type *);
+extern void annotate_value_begin (struct type *);
+extern void annotate_value_history_value (void);
+extern void annotate_value_history_end (void);
+extern void annotate_value_end (void);
+
+extern void annotate_display_begin (void);
+extern void annotate_display_number_end (void);
+extern void annotate_display_format (void);
+extern void annotate_display_expression (void);
+extern void annotate_display_expression_end (void);
+extern void annotate_display_value (void);
+extern void annotate_display_end (void);
+
+extern void annotate_arg_begin (void);
+extern void annotate_arg_name_end (void);
+extern void annotate_arg_value (struct type *);
+extern void annotate_arg_end (void);
+
+extern void annotate_source (char *, int, int, int, CORE_ADDR);
+
+extern void annotate_frame_begin (int, CORE_ADDR);
+extern void annotate_function_call (void);
+extern void annotate_signal_handler_caller (void);
+extern void annotate_frame_address (void);
+extern void annotate_frame_address_end (void);
+extern void annotate_frame_function_name (void);
+extern void annotate_frame_args (void);
+extern void annotate_frame_source_begin (void);
+extern void annotate_frame_source_file (void);
+extern void annotate_frame_source_file_end (void);
+extern void annotate_frame_source_line (void);
+extern void annotate_frame_source_end (void);
+extern void annotate_frame_where (void);
+extern void annotate_frame_end (void);
+
+extern void annotate_array_section_begin (int, struct type *);
+extern void annotate_elt_rep (unsigned int);
+extern void annotate_elt_rep_end (void);
+extern void annotate_elt (void);
+extern void annotate_array_section_end (void);
+
+extern void (*annotate_starting_hook) (void);
+extern void (*annotate_stopped_hook) (void);
+extern void (*annotate_signalled_hook) (void);
+extern void (*annotate_signal_hook) (void);
+extern void (*annotate_exited_hook) (void);
diff --git a/contrib/gdb/gdb/arc-tdep.c b/contrib/gdb/gdb/arc-tdep.c
index 9295770..ffa538f 100644
--- a/contrib/gdb/gdb/arc-tdep.c
+++ b/contrib/gdb/gdb/arc-tdep.c
@@ -1,21 +1,22 @@
/* ARC target-dependent stuff.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -25,6 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "floatformat.h"
#include "symtab.h"
#include "gdbcmd.h"
+#include "regcache.h"
+
+/* Local functions */
+
+static int arc_set_cpu_type (char *str);
/* Current CPU, set with the "set cpu" command. */
static int arc_bfd_mach_type;
@@ -32,12 +38,18 @@ 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[] =
+{
+ { "arc5", bfd_mach_arc_5 },
+ { "arc6", bfd_mach_arc_6 },
+ { "arc7", bfd_mach_arc_7 },
+ { "arc8", bfd_mach_arc_8 },
+ { NULL, 0 }
};
/* Used by simulator. */
@@ -77,13 +89,14 @@ int debug_pipeline_p;
| ((d) & 511))
/* Codestream stuff. */
-static void codestream_read PARAMS ((unsigned int *, int));
-static void codestream_seek PARAMS ((CORE_ADDR));
-static unsigned int codestream_fill PARAMS ((int));
+static void codestream_read (unsigned int *, int);
+static void codestream_seek (CORE_ADDR);
+static unsigned int codestream_fill (int);
-#define CODESTREAM_BUFSIZ 16
+#define CODESTREAM_BUFSIZ 16
static CORE_ADDR codestream_next_addr;
static CORE_ADDR codestream_addr;
+/* FIXME assumes sizeof (int) == 32? */
static unsigned int codestream_buf[CODESTREAM_BUFSIZ];
static int codestream_off;
static int codestream_cnt;
@@ -99,9 +112,8 @@ static int codestream_cnt;
? codestream_fill (0) \
: codestream_buf[codestream_off++])
-static unsigned int
-codestream_fill (peek_flag)
- int peek_flag;
+static unsigned int
+codestream_fill (int peek_flag)
{
codestream_addr = codestream_next_addr;
codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]);
@@ -111,17 +123,16 @@ codestream_fill (peek_flag)
CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]));
/* FIXME: check return code? */
- /* Handle byte order differences. */
- if (HOST_BYTE_ORDER != TARGET_BYTE_ORDER)
- {
- register unsigned int i, j, n = sizeof (codestream_buf[0]);
- register char tmp, *p;
- for (i = 0, p = (char *) codestream_buf; i < CODESTREAM_BUFSIZ;
- ++i, p += n)
- for (j = 0; j < n / 2; ++j)
- tmp = p[j], p[j] = p[n - 1 - j], p[n - 1 - j] = tmp;
- }
-
+
+ /* Handle byte order differences -> convert to host byte ordering. */
+ {
+ int i;
+ for (i = 0; i < CODESTREAM_BUFSIZ; i++)
+ codestream_buf[i] =
+ extract_unsigned_integer (&codestream_buf[i],
+ sizeof (codestream_buf[i]));
+ }
+
if (peek_flag)
return codestream_peek ();
else
@@ -129,8 +140,7 @@ codestream_fill (peek_flag)
}
static void
-codestream_seek (place)
- CORE_ADDR place;
+codestream_seek (CORE_ADDR place)
{
codestream_next_addr = place / CODESTREAM_BUFSIZ;
codestream_next_addr *= CODESTREAM_BUFSIZ;
@@ -143,9 +153,7 @@ codestream_seek (place)
/* This function is currently unused but leave in for now. */
static void
-codestream_read (buf, count)
- unsigned int *buf;
- int count;
+codestream_read (unsigned int *buf, int count)
{
unsigned int *p;
int i;
@@ -157,8 +165,7 @@ codestream_read (buf, count)
/* Set up prologue scanning and return the first insn. */
static unsigned int
-setup_prologue_scan (pc)
- CORE_ADDR pc;
+setup_prologue_scan (CORE_ADDR pc)
{
unsigned int insn;
@@ -176,8 +183,7 @@ setup_prologue_scan (pc)
*/
static long
-arc_get_frame_setup (pc)
- CORE_ADDR pc;
+arc_get_frame_setup (CORE_ADDR pc)
{
unsigned int insn;
/* Size of frame or -1 if unrecognizable prologue. */
@@ -203,16 +209,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,12 +235,12 @@ 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. */
insn = codestream_peek ();
- if (insn & OPMASK == 0x60000000)
+ if ((insn & OPMASK) == 0x60000000)
codestream_get ();
}
/* Frameless fn. */
@@ -264,9 +270,7 @@ arc_get_frame_setup (pc)
This allows a quicker answer. */
CORE_ADDR
-skip_prologue (pc, frameless_p)
- CORE_ADDR pc;
- int frameless_p;
+arc_skip_prologue (CORE_ADDR pc, int frameless_p)
{
unsigned int insn;
int i, frame_size;
@@ -283,8 +287,8 @@ 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 ();
}
@@ -297,8 +301,7 @@ skip_prologue (pc, frameless_p)
This is taken from frameless_look_for_prologue. */
CORE_ADDR
-arc_frame_saved_pc (frame)
- struct frame_info *frame;
+arc_frame_saved_pc (struct frame_info *frame)
{
CORE_ADDR func_start;
unsigned int insn;
@@ -344,9 +347,7 @@ arc_frame_saved_pc (frame)
*/
void
-frame_find_saved_regs (fip, fsrp)
- struct frame_info *fip;
- struct frame_saved_regs *fsrp;
+frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp)
{
long locals;
unsigned int insn;
@@ -360,11 +361,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 +375,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 +383,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;
}
@@ -395,14 +396,14 @@ frame_find_saved_regs (fip, fsrp)
}
void
-push_dummy_frame ()
+arc_push_dummy_frame (void)
{
CORE_ADDR sp = read_register (SP_REGNUM);
int regnum;
char regbuf[MAX_REGISTER_RAW_SIZE];
read_register_gen (PC_REGNUM, regbuf);
- write_memory (sp+4, regbuf, REGISTER_SIZE);
+ 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,22 +412,22 @@ 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);
}
void
-pop_frame ()
+arc_pop_frame (void)
{
struct frame_info *frame = get_current_frame ();
CORE_ADDR fp;
int regnum;
struct frame_saved_regs fsr;
char regbuf[MAX_REGISTER_RAW_SIZE];
-
+
fp = FRAME_FP (frame);
get_frame_saved_regs (frame, &fsr);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
+ for (regnum = 0; regnum < NUM_REGS; regnum++)
{
CORE_ADDR adr;
adr = fsr.regs[regnum];
@@ -447,45 +448,48 @@ 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. */
/* ??? Need to verify all cases are properly handled. */
static insn_type
-get_insn_type (insn, pc, target)
- unsigned long insn;
- CORE_ADDR pc, *target;
+get_insn_type (unsigned long insn, CORE_ADDR pc, CORE_ADDR *target)
{
unsigned long limm;
switch (insn >> 27)
{
- case 0 : case 1 : case 2 : /* load/store insns */
+ 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 +503,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)))
@@ -517,9 +521,8 @@ get_insn_type (insn, pc, target)
set up a simulated single-step, we undo our damage. */
void
-arc_software_single_step (ignore, insert_breakpoints_p)
- enum target_signal ignore; /* sig but we don't need it */
- int insert_breakpoints_p;
+arc_software_single_step (enum target_signal ignore, /* sig but we don't need it */
+ int insert_breakpoints_p)
{
static CORE_ADDR next_pc, target;
static int brktrg_p;
@@ -543,10 +546,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;
@@ -568,22 +571,23 @@ arc_software_single_step (ignore, insert_breakpoints_p)
}
}
-#ifdef GET_LONGJMP_TARGET
+/* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test
+ for a definition of JB_PC. */
+#ifdef JB_PC
/* Figure out where the longjmp will land. Slurp the args out of the stack.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
This routine returns true on success. */
int
-get_longjmp_target(pc)
- CORE_ADDR *pc;
+get_longjmp_target (CORE_ADDR *pc)
{
char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
CORE_ADDR sp, jb_addr;
sp = read_register (SP_REGNUM);
- if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
+ if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
@@ -603,9 +607,7 @@ get_longjmp_target(pc)
/* Disassemble one instruction. */
static int
-arc_print_insn (vma, info)
- bfd_vma vma;
- disassemble_info *info;
+arc_print_insn (bfd_vma vma, disassemble_info *info)
{
static int current_mach;
static int current_endian;
@@ -617,8 +619,7 @@ arc_print_insn (vma, info)
{
current_mach = arc_bfd_mach_type;
current_endian = TARGET_BYTE_ORDER;
- current_disasm = arc_get_disassembler (current_mach,
- current_endian == BIG_ENDIAN);
+ current_disasm = arc_get_disassembler (NULL);
}
return (*current_disasm) (vma, info);
@@ -627,9 +628,7 @@ arc_print_insn (vma, info)
/* Command to set cpu type. */
void
-arc_set_cpu_type_command (args, from_tty)
- char *args;
- int from_tty;
+arc_set_cpu_type_command (char *args, int from_tty)
{
int i;
@@ -640,32 +639,29 @@ arc_set_cpu_type_command (args, from_tty)
printf_unfiltered ("%s\n", arc_cpu_type_table[i].name);
/* Restore the value. */
- tmp_arc_cpu_type = strsave (arc_cpu_type);
+ tmp_arc_cpu_type = xstrdup (arc_cpu_type);
return;
}
-
+
if (!arc_set_cpu_type (tmp_arc_cpu_type))
{
error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);
/* Restore its value. */
- tmp_arc_cpu_type = strsave (arc_cpu_type);
+ tmp_arc_cpu_type = xstrdup (arc_cpu_type);
}
}
static void
-arc_show_cpu_type_command (args, from_tty)
- char *args;
- int from_tty;
+arc_show_cpu_type_command (char *args, int from_tty)
{
}
/* Modify the actual cpu type.
Result is a boolean indicating success. */
-int
-arc_set_cpu_type (str)
- char *str;
+static int
+arc_set_cpu_type (char *str)
{
int i, j;
@@ -686,7 +682,7 @@ arc_set_cpu_type (str)
}
void
-_initialize_arc_tdep ()
+_initialize_arc_tdep (void)
{
struct cmd_list_element *c;
@@ -698,13 +694,13 @@ change the cpu being debugged. It also gives one access to\n\
cpu-type-specific registers and recognize cpu-type-specific instructions.\
",
&setlist);
- c->function.cfunc = arc_set_cpu_type_command;
+ set_cmd_cfunc (c, arc_set_cpu_type_command);
c = add_show_from_set (c, &showlist);
- c->function.cfunc = arc_show_cpu_type_command;
+ set_cmd_cfunc (c, arc_show_cpu_type_command);
- /* We have to use strsave here because the `set' command frees it before
- setting a new value. */
- tmp_arc_cpu_type = strsave (DEFAULT_ARC_CPU_TYPE);
+ /* We have to use xstrdup() here because the `set' command frees it
+ before setting a new value. */
+ tmp_arc_cpu_type = xstrdup (DEFAULT_ARC_CPU_TYPE);
arc_set_cpu_type (tmp_arc_cpu_type);
c = add_set_cmd ("displaypipeline", class_support, var_zinteger,
diff --git a/contrib/gdb/gdb/arch-utils.c b/contrib/gdb/gdb/arch-utils.c
new file mode 100644
index 0000000..5612ddf
--- /dev/null
+++ b/contrib/gdb/gdb/arch-utils.c
@@ -0,0 +1,861 @@
+/* Dynamic architecture support for GDB, the GNU debugger.
+ Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#if GDB_MULTI_ARCH
+#include "arch-utils.h"
+#include "gdbcmd.h"
+#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. */
+#include "gdb_string.h"
+#include "symtab.h"
+#include "frame.h"
+#include "inferior.h"
+#include "breakpoint.h"
+#include "gdb_wait.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "annotate.h"
+#endif
+#include "regcache.h"
+#include "gdb_assert.h"
+
+#include "version.h"
+
+#include "floatformat.h"
+
+/* Use the program counter to determine the contents and size
+ of a breakpoint instruction. If no target-dependent macro
+ BREAKPOINT_FROM_PC has been defined to implement this function,
+ assume that the breakpoint doesn't depend on the PC, and
+ use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros.
+ Return a pointer to a string of bytes that encode a breakpoint
+ instruction, stores the length of the string to *lenptr,
+ and optionally adjust the pc to point to the correct memory location
+ for inserting the breakpoint. */
+
+unsigned char *
+legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+{
+ /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
+ breakpoint. On some machines, breakpoints are handled by the
+ target environment and we don't have to worry about them here. */
+#ifdef BIG_BREAKPOINT
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ static unsigned char big_break_insn[] = BIG_BREAKPOINT;
+ *lenptr = sizeof (big_break_insn);
+ return big_break_insn;
+ }
+#endif
+#ifdef LITTLE_BREAKPOINT
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
+ {
+ static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
+ *lenptr = sizeof (little_break_insn);
+ return little_break_insn;
+ }
+#endif
+#ifdef BREAKPOINT
+ {
+ static unsigned char break_insn[] = BREAKPOINT;
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+ }
+#endif
+ *lenptr = 0;
+ return NULL;
+}
+
+int
+generic_frameless_function_invocation_not (struct frame_info *fi)
+{
+ return 0;
+}
+
+int
+generic_return_value_on_stack_not (struct type *type)
+{
+ return 0;
+}
+
+CORE_ADDR
+generic_skip_trampoline_code (CORE_ADDR pc)
+{
+ return 0;
+}
+
+int
+generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ return 0;
+}
+
+int
+generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ return 0;
+}
+
+char *
+legacy_register_name (int i)
+{
+#ifdef REGISTER_NAMES
+ static char *names[] = REGISTER_NAMES;
+ if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
+ return NULL;
+ else
+ return names[i];
+#else
+ internal_error (__FILE__, __LINE__,
+ "legacy_register_name: called.");
+ return NULL;
+#endif
+}
+
+#if defined (CALL_DUMMY)
+LONGEST legacy_call_dummy_words[] = CALL_DUMMY;
+#else
+LONGEST legacy_call_dummy_words[1];
+#endif
+int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words);
+
+void
+generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len,
+ CORE_ADDR * rem_addr, int *rem_len)
+{
+ *rem_addr = gdb_addr;
+ *rem_len = gdb_len;
+}
+
+int
+generic_prologue_frameless_p (CORE_ADDR ip)
+{
+#ifdef SKIP_PROLOGUE_FRAMELESS_P
+ return ip == SKIP_PROLOGUE_FRAMELESS_P (ip);
+#else
+ return ip == SKIP_PROLOGUE (ip);
+#endif
+}
+
+/* New/multi-arched targets should use the correct gdbarch field
+ instead of using this global pointer. */
+int
+legacy_print_insn (bfd_vma vma, disassemble_info *info)
+{
+ return (*tm_print_insn) (vma, info);
+}
+
+/* Helper functions for INNER_THAN */
+
+int
+core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
+{
+ return (lhs < rhs);
+}
+
+int
+core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
+{
+ return (lhs > rhs);
+}
+
+
+/* Helper functions for TARGET_{FLOAT,DOUBLE}_FORMAT */
+
+const struct floatformat *
+default_float_format (struct gdbarch *gdbarch)
+{
+#if GDB_MULTI_ARCH
+ int byte_order = gdbarch_byte_order (gdbarch);
+#else
+ int byte_order = TARGET_BYTE_ORDER;
+#endif
+ switch (byte_order)
+ {
+ case BFD_ENDIAN_BIG:
+ return &floatformat_ieee_single_big;
+ case BFD_ENDIAN_LITTLE:
+ return &floatformat_ieee_single_little;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "default_float_format: bad byte order");
+ }
+}
+
+
+const struct floatformat *
+default_double_format (struct gdbarch *gdbarch)
+{
+#if GDB_MULTI_ARCH
+ int byte_order = gdbarch_byte_order (gdbarch);
+#else
+ int byte_order = TARGET_BYTE_ORDER;
+#endif
+ switch (byte_order)
+ {
+ case BFD_ENDIAN_BIG:
+ return &floatformat_ieee_double_big;
+ case BFD_ENDIAN_LITTLE:
+ return &floatformat_ieee_double_little;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "default_double_format: bad byte order");
+ }
+}
+
+void
+default_print_float_info (void)
+{
+#ifdef FLOAT_INFO
+#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
+#error "FLOAT_INFO defined in multi-arch"
+#endif
+ FLOAT_INFO;
+#else
+ printf_filtered ("No floating point info available for this processor.\n");
+#endif
+}
+
+/* Misc helper functions for targets. */
+
+int
+frame_num_args_unknown (struct frame_info *fi)
+{
+ return -1;
+}
+
+
+int
+generic_register_convertible_not (int num)
+{
+ return 0;
+}
+
+
+/* Under some ABI's that specify the `struct convention' for returning
+ structures by value, by the time we've returned from the function,
+ the return value is sitting there in the caller's buffer, but GDB
+ has no way to find the address of that buffer.
+
+ On such architectures, use this function as your
+ extract_struct_value_address method. When asked to a struct
+ returned by value in this fashion, GDB will print a nice error
+ message, instead of garbage. */
+CORE_ADDR
+generic_cannot_extract_struct_value_address (char *dummy)
+{
+ return 0;
+}
+
+int
+default_register_sim_regno (int num)
+{
+ return num;
+}
+
+
+CORE_ADDR
+core_addr_identity (CORE_ADDR addr)
+{
+ return addr;
+}
+
+int
+no_op_reg_to_regnum (int reg)
+{
+ return reg;
+}
+
+/* For use by frame_args_address and frame_locals_address. */
+CORE_ADDR
+default_frame_address (struct frame_info *fi)
+{
+ return fi->frame;
+}
+
+/* Default prepare_to_procced(). */
+int
+default_prepare_to_proceed (int select_it)
+{
+ return 0;
+}
+
+/* Generic prepare_to_proceed(). This one should be suitable for most
+ targets that support threads. */
+int
+generic_prepare_to_proceed (int select_it)
+{
+ ptid_t wait_ptid;
+ struct target_waitstatus wait_status;
+
+ /* Get the last target status returned by target_wait(). */
+ get_last_target_status (&wait_ptid, &wait_status);
+
+ /* Make sure we were stopped either at a breakpoint, or because
+ of a Ctrl-C. */
+ if (wait_status.kind != TARGET_WAITKIND_STOPPED
+ || (wait_status.value.sig != TARGET_SIGNAL_TRAP &&
+ wait_status.value.sig != TARGET_SIGNAL_INT))
+ {
+ return 0;
+ }
+
+ if (!ptid_equal (wait_ptid, minus_one_ptid)
+ && !ptid_equal (inferior_ptid, wait_ptid))
+ {
+ /* Switched over from WAIT_PID. */
+ CORE_ADDR wait_pc = read_pc_pid (wait_ptid);
+
+ if (wait_pc != read_pc ())
+ {
+ if (select_it)
+ {
+ /* Switch back to WAIT_PID thread. */
+ inferior_ptid = wait_ptid;
+
+ /* FIXME: This stuff came from switch_to_thread() in
+ thread.c (which should probably be a public function). */
+ flush_cached_frames ();
+ registers_changed ();
+ stop_pc = wait_pc;
+ select_frame (get_current_frame (), 0);
+ }
+ /* We return 1 to indicate that there is a breakpoint here,
+ so we need to step over it before continuing to avoid
+ hitting it straight away. */
+ if (breakpoint_here_p (wait_pc))
+ {
+ return 1;
+ }
+ }
+ }
+ return 0;
+
+}
+
+void
+init_frame_pc_noop (int fromleaf, struct frame_info *prev)
+{
+ return;
+}
+
+void
+init_frame_pc_default (int fromleaf, struct frame_info *prev)
+{
+ if (fromleaf)
+ prev->pc = SAVED_PC_AFTER_CALL (prev->next);
+ else if (prev->next != NULL)
+ prev->pc = FRAME_SAVED_PC (prev->next);
+ else
+ prev->pc = read_pc ();
+}
+
+void
+default_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
+{
+ return;
+}
+
+void
+default_coff_make_msymbol_special (int val, struct minimal_symbol *msym)
+{
+ return;
+}
+
+int
+cannot_register_not (int regnum)
+{
+ return 0;
+}
+
+/* Legacy version of target_virtual_frame_pointer(). Assumes that
+ there is an FP_REGNUM and that it is the same, cooked or raw. */
+
+void
+legacy_virtual_frame_pointer (CORE_ADDR pc,
+ int *frame_regnum,
+ LONGEST *frame_offset)
+{
+ gdb_assert (FP_REGNUM >= 0);
+ *frame_regnum = FP_REGNUM;
+ *frame_offset = 0;
+}
+
+/* Assume the world is flat. Every register is large enough to fit a
+ target integer. */
+
+int
+generic_register_raw_size (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
+ return TARGET_INT_BIT / HOST_CHAR_BIT;
+}
+
+/* Assume the virtual size corresponds to the virtual type. */
+
+int
+generic_register_virtual_size (int regnum)
+{
+ return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum));
+}
+
+
+/* Functions to manipulate the endianness of the target. */
+
+/* ``target_byte_order'' is only used when non- multi-arch.
+ Multi-arch targets obtain the current byte order using the
+ TARGET_BYTE_ORDER gdbarch method.
+
+ The choice of initial value is entirely arbitrary. During startup,
+ the function initialize_current_architecture() updates this value
+ based on default byte-order information extracted from BFD. */
+int target_byte_order = BFD_ENDIAN_BIG;
+int target_byte_order_auto = 1;
+
+static const char endian_big[] = "big";
+static const char endian_little[] = "little";
+static const char endian_auto[] = "auto";
+static const char *endian_enum[] =
+{
+ endian_big,
+ endian_little,
+ endian_auto,
+ NULL,
+};
+static const char *set_endian_string;
+
+/* Called by ``show endian''. */
+
+static void
+show_endian (char *args, int from_tty)
+{
+ if (TARGET_BYTE_ORDER_AUTO)
+ printf_unfiltered ("The target endianness is set automatically (currently %s endian)\n",
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little"));
+ else
+ printf_unfiltered ("The target is assumed to be %s endian\n",
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little"));
+}
+
+static void
+set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
+{
+ if (set_endian_string == endian_auto)
+ {
+ target_byte_order_auto = 1;
+ }
+ else if (set_endian_string == endian_little)
+ {
+ target_byte_order_auto = 0;
+ if (GDB_MULTI_ARCH)
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.byte_order = BFD_ENDIAN_LITTLE;
+ if (! gdbarch_update_p (info))
+ {
+ printf_unfiltered ("Little endian target not supported by GDB\n");
+ }
+ }
+ else
+ {
+ target_byte_order = BFD_ENDIAN_LITTLE;
+ }
+ }
+ else if (set_endian_string == endian_big)
+ {
+ target_byte_order_auto = 0;
+ if (GDB_MULTI_ARCH)
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.byte_order = BFD_ENDIAN_BIG;
+ if (! gdbarch_update_p (info))
+ {
+ printf_unfiltered ("Big endian target not supported by GDB\n");
+ }
+ }
+ else
+ {
+ target_byte_order = BFD_ENDIAN_BIG;
+ }
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+ "set_endian: bad value");
+ show_endian (NULL, from_tty);
+}
+
+/* Set the endianness from a BFD. */
+
+static void
+set_endian_from_file (bfd *abfd)
+{
+ int want;
+ if (GDB_MULTI_ARCH)
+ internal_error (__FILE__, __LINE__,
+ "set_endian_from_file: not for multi-arch");
+ if (bfd_big_endian (abfd))
+ want = BFD_ENDIAN_BIG;
+ else
+ want = BFD_ENDIAN_LITTLE;
+ if (TARGET_BYTE_ORDER_AUTO)
+ target_byte_order = want;
+ else if (TARGET_BYTE_ORDER != want)
+ warning ("%s endian file does not match %s endian target.",
+ want == BFD_ENDIAN_BIG ? "big" : "little",
+ TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little");
+}
+
+
+/* Functions to manipulate the architecture of the target */
+
+enum set_arch { set_arch_auto, set_arch_manual };
+
+int target_architecture_auto = 1;
+
+const char *set_architecture_string;
+
+/* Old way of changing the current architecture. */
+
+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) (const struct bfd_arch_info *ap);
+
+static int
+arch_ok (const struct bfd_arch_info *arch)
+{
+ if (GDB_MULTI_ARCH)
+ internal_error (__FILE__, __LINE__,
+ "arch_ok: not multi-arched");
+ /* Should be performing the more basic check that the binary is
+ compatible with GDB. */
+ /* Check with the target that the architecture is valid. */
+ return (target_architecture_hook == NULL
+ || target_architecture_hook (arch));
+}
+
+static void
+set_arch (const struct bfd_arch_info *arch,
+ enum set_arch type)
+{
+ if (GDB_MULTI_ARCH)
+ internal_error (__FILE__, __LINE__,
+ "set_arch: not multi-arched");
+ switch (type)
+ {
+ case set_arch_auto:
+ if (!arch_ok (arch))
+ warning ("Target may not support %s architecture",
+ arch->printable_name);
+ target_architecture = arch;
+ break;
+ case set_arch_manual:
+ if (!arch_ok (arch))
+ {
+ printf_unfiltered ("Target does not support `%s' architecture.\n",
+ arch->printable_name);
+ }
+ else
+ {
+ target_architecture_auto = 0;
+ target_architecture = arch;
+ }
+ break;
+ }
+ if (gdbarch_debug)
+ gdbarch_dump (current_gdbarch, gdb_stdlog);
+}
+
+/* Set the architecture from arch/machine (deprecated) */
+
+void
+set_architecture_from_arch_mach (enum bfd_architecture arch,
+ unsigned long mach)
+{
+ const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
+ if (GDB_MULTI_ARCH)
+ internal_error (__FILE__, __LINE__,
+ "set_architecture_from_arch_mach: not multi-arched");
+ if (wanted != NULL)
+ set_arch (wanted, set_arch_manual);
+ else
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: hardwired architecture/machine not recognized");
+}
+
+/* Set the architecture from a BFD (deprecated) */
+
+static void
+set_architecture_from_file (bfd *abfd)
+{
+ const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
+ if (GDB_MULTI_ARCH)
+ internal_error (__FILE__, __LINE__,
+ "set_architecture_from_file: not multi-arched");
+ if (target_architecture_auto)
+ {
+ set_arch (wanted, set_arch_auto);
+ }
+ else if (wanted != target_architecture)
+ {
+ warning ("%s architecture file may be incompatible with %s target.",
+ wanted->printable_name,
+ target_architecture->printable_name);
+ }
+}
+
+
+/* Called if the user enters ``show architecture'' without an
+ argument. */
+
+static void
+show_architecture (char *args, int from_tty)
+{
+ const char *arch;
+ arch = TARGET_ARCHITECTURE->printable_name;
+ if (target_architecture_auto)
+ printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
+ else
+ printf_filtered ("The target architecture is assumed to be %s\n", arch);
+}
+
+
+/* Called if the user enters ``set architecture'' with or without an
+ argument. */
+
+static void
+set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
+{
+ if (strcmp (set_architecture_string, "auto") == 0)
+ {
+ target_architecture_auto = 1;
+ }
+ else if (GDB_MULTI_ARCH)
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
+ if (info.bfd_arch_info == NULL)
+ internal_error (__FILE__, __LINE__,
+ "set_architecture: bfd_scan_arch failed");
+ if (gdbarch_update_p (info))
+ target_architecture_auto = 0;
+ else
+ printf_unfiltered ("Architecture `%s' not recognized.\n",
+ set_architecture_string);
+ }
+ else
+ {
+ const struct bfd_arch_info *arch
+ = bfd_scan_arch (set_architecture_string);
+ if (arch == NULL)
+ internal_error (__FILE__, __LINE__,
+ "set_architecture: bfd_scan_arch failed");
+ set_arch (arch, set_arch_manual);
+ }
+ show_architecture (NULL, from_tty);
+}
+
+/* Set the dynamic target-system-dependent parameters (architecture,
+ byte-order) using information found in the BFD */
+
+void
+set_gdbarch_from_file (bfd *abfd)
+{
+ if (GDB_MULTI_ARCH)
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.abfd = abfd;
+ if (! gdbarch_update_p (info))
+ error ("Architecture of file not recognized.\n");
+ }
+ else
+ {
+ set_architecture_from_file (abfd);
+ set_endian_from_file (abfd);
+ }
+}
+
+/* Initialize the current architecture. Update the ``set
+ architecture'' command so that it specifies a list of valid
+ architectures. */
+
+#ifdef DEFAULT_BFD_ARCH
+extern const bfd_arch_info_type DEFAULT_BFD_ARCH;
+static const bfd_arch_info_type *default_bfd_arch = &DEFAULT_BFD_ARCH;
+#else
+static const bfd_arch_info_type *default_bfd_arch;
+#endif
+
+#ifdef DEFAULT_BFD_VEC
+extern const bfd_target DEFAULT_BFD_VEC;
+static const bfd_target *default_bfd_vec = &DEFAULT_BFD_VEC;
+#else
+static const bfd_target *default_bfd_vec;
+#endif
+
+void
+initialize_current_architecture (void)
+{
+ const char **arches = gdbarch_printable_names ();
+
+ /* determine a default architecture and byte order. */
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+
+ /* Find a default architecture. */
+ if (info.bfd_arch_info == NULL
+ && default_bfd_arch != NULL)
+ info.bfd_arch_info = default_bfd_arch;
+ if (info.bfd_arch_info == NULL)
+ {
+ /* Choose the architecture by taking the first one
+ alphabetically. */
+ const char *chosen = arches[0];
+ const char **arch;
+ for (arch = arches; *arch != NULL; arch++)
+ {
+ if (strcmp (*arch, chosen) < 0)
+ chosen = *arch;
+ }
+ if (chosen == NULL)
+ internal_error (__FILE__, __LINE__,
+ "initialize_current_architecture: No arch");
+ info.bfd_arch_info = bfd_scan_arch (chosen);
+ if (info.bfd_arch_info == NULL)
+ internal_error (__FILE__, __LINE__,
+ "initialize_current_architecture: Arch not found");
+ }
+
+ /* Take several guesses at a byte order. */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN
+ && default_bfd_vec != NULL)
+ {
+ /* Extract BFD's default vector's byte order. */
+ switch (default_bfd_vec->byteorder)
+ {
+ case BFD_ENDIAN_BIG:
+ info.byte_order = BFD_ENDIAN_BIG;
+ break;
+ case BFD_ENDIAN_LITTLE:
+ info.byte_order = BFD_ENDIAN_LITTLE;
+ break;
+ default:
+ break;
+ }
+ }
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN)
+ {
+ /* look for ``*el-*'' in the target name. */
+ const char *chp;
+ chp = strchr (target_name, '-');
+ if (chp != NULL
+ && chp - 2 >= target_name
+ && strncmp (chp - 2, "el", 2) == 0)
+ info.byte_order = BFD_ENDIAN_LITTLE;
+ }
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN)
+ {
+ /* Wire it to big-endian!!! */
+ info.byte_order = BFD_ENDIAN_BIG;
+ }
+
+ if (GDB_MULTI_ARCH)
+ {
+ if (! gdbarch_update_p (info))
+ {
+ internal_error (__FILE__, __LINE__,
+ "initialize_current_architecture: Selection of initial architecture failed");
+ }
+ }
+ else
+ {
+ /* If the multi-arch logic comes up with a byte-order (from BFD)
+ use it for the non-multi-arch case. */
+ if (info.byte_order != BFD_ENDIAN_UNKNOWN)
+ target_byte_order = info.byte_order;
+ initialize_non_multiarch ();
+ }
+
+ /* Create the ``set architecture'' command appending ``auto'' to the
+ list of architectures. */
+ {
+ struct cmd_list_element *c;
+ /* Append ``auto''. */
+ int nr;
+ for (nr = 0; arches[nr] != NULL; nr++);
+ arches = xrealloc (arches, sizeof (char*) * (nr + 2));
+ arches[nr + 0] = "auto";
+ arches[nr + 1] = NULL;
+ /* FIXME: add_set_enum_cmd() uses an array of ``char *'' instead
+ of ``const char *''. We just happen to know that the casts are
+ safe. */
+ c = add_set_enum_cmd ("architecture", class_support,
+ arches, &set_architecture_string,
+ "Set architecture of target.",
+ &setlist);
+ set_cmd_sfunc (c, set_architecture);
+ add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
+ /* Don't use set_from_show - need to print both auto/manual and
+ current setting. */
+ add_cmd ("architecture", class_support, show_architecture,
+ "Show the current target architecture", &showlist);
+ }
+}
+
+
+/* Initialize a gdbarch info to values that will be automatically
+ overridden. Note: Originally, this ``struct info'' was initialized
+ using memset(0). Unfortunatly, that ran into problems, namely
+ BFD_ENDIAN_BIG is zero. An explicit initialization function that
+ can explicitly set each field to a well defined value is used. */
+
+void
+gdbarch_info_init (struct gdbarch_info *info)
+{
+ memset (info, 0, sizeof (struct gdbarch_info));
+ info->byte_order = BFD_ENDIAN_UNKNOWN;
+}
+
+/* */
+
+extern initialize_file_ftype _initialize_gdbarch_utils;
+
+void
+_initialize_gdbarch_utils (void)
+{
+ struct cmd_list_element *c;
+ c = add_set_enum_cmd ("endian", class_support,
+ endian_enum, &set_endian_string,
+ "Set endianness of target.",
+ &setlist);
+ set_cmd_sfunc (c, set_endian);
+ /* Don't use set_from_show - need to print both auto/manual and
+ current setting. */
+ add_cmd ("endian", class_support, show_endian,
+ "Show the current byte-order", &showlist);
+}
diff --git a/contrib/gdb/gdb/arch-utils.h b/contrib/gdb/gdb/arch-utils.h
new file mode 100644
index 0000000..96d1b8b
--- /dev/null
+++ b/contrib/gdb/gdb/arch-utils.h
@@ -0,0 +1,163 @@
+/* Dynamic architecture support for GDB, the GNU debugger.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDBARCH_UTILS_H
+#define GDBARCH_UTILS_H
+
+/* gdbarch trace variable */
+extern int gdbarch_debug;
+
+/* Fallback for register convertible. */
+extern gdbarch_register_convertible_ftype generic_register_convertible_not;
+
+extern CORE_ADDR generic_cannot_extract_struct_value_address (char *dummy);
+
+/* Helper function for targets that don't know how my arguments are
+ being passed */
+extern gdbarch_frame_num_args_ftype frame_num_args_unknown;
+
+/* Implementation of breakpoint from PC using any of the deprecated
+ macros BREAKPOINT, LITTLE_BREAKPOINT, BIG_BREAPOINT. For legacy
+ targets that don't yet implement their own breakpoint_from_pc(). */
+extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc;
+
+/* Frameless functions not identifable. */
+extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
+
+/* Only structures, unions, and arrays are returned using the struct
+ convention. Note that arrays are never passed by value in the C
+ language family, so that case is irrelevant for C. */
+extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
+
+/* Map onto old REGISTER_NAMES. */
+extern char *legacy_register_name (int i);
+
+/* Accessor for old global function pointer for disassembly. */
+extern int legacy_print_insn (bfd_vma vma, disassemble_info *info);
+
+/* Backward compatible call_dummy_words. */
+extern LONGEST legacy_call_dummy_words[];
+extern int legacy_sizeof_call_dummy_words;
+
+/* Typical remote_translate_xfer_address */
+extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address;
+
+/* Generic implementation of prologue_frameless_p. Just calls
+ SKIP_PROLOG and checks the return value to see if it actually
+ changed. */
+extern gdbarch_prologue_frameless_p_ftype generic_prologue_frameless_p;
+
+/* The only possible cases for inner_than. */
+extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
+extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
+
+/* Floating point values. */
+extern const struct floatformat *default_float_format (struct gdbarch *gdbarch);
+extern const struct floatformat *default_double_format (struct gdbarch *gdbarch);
+
+/* Helper function for targets that don't know how my arguments are
+ being passed */
+extern int frame_num_args_unknown (struct frame_info *fi);
+
+
+/* The following DEPRECATED interfaces are for pre- multi-arch legacy
+ targets. */
+
+/* DEPRECATED pre- multi-arch interface. Explicitly set the dynamic
+ target-system-dependent parameters based on bfd_architecture and
+ machine. This function is deprecated, use
+ set_gdbarch_from_arch_machine(). */
+
+extern void set_architecture_from_arch_mach (enum bfd_architecture, unsigned long);
+
+/* DEPRECATED pre- multi-arch interface. Notify the target dependent
+ backend of a change to the selected architecture. A zero return
+ status indicates that the target did not like the change. */
+
+extern int (*target_architecture_hook) (const struct bfd_arch_info *);
+
+
+/* Default raw->sim register re-numbering - does nothing. */
+
+extern int default_register_sim_regno (int reg_nr);
+
+/* Identity function on a CORE_ADDR. Just returns its parameter. */
+
+extern CORE_ADDR core_addr_identity (CORE_ADDR addr);
+
+/* No-op conversion of reg to regnum. */
+
+extern int no_op_reg_to_regnum (int reg);
+
+/* Default frame_args_address and frame_locals_address. */
+
+extern CORE_ADDR default_frame_address (struct frame_info *);
+
+/* Default prepare_to_procced. */
+
+extern int default_prepare_to_proceed (int select_it);
+
+extern int generic_prepare_to_proceed (int select_it);
+
+/* Versions of init_frame_pc(). Do nothing; do the default. */
+
+void init_frame_pc_noop (int fromleaf, struct frame_info *prev);
+
+void init_frame_pc_default (int fromleaf, struct frame_info *prev);
+
+/* Do nothing version of elf_make_msymbol_special. */
+
+void default_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym);
+
+/* Do nothing version of coff_make_msymbol_special. */
+
+void default_coff_make_msymbol_special (int val, struct minimal_symbol *msym);
+
+/* Version of cannot_fetch_register() / cannot_store_register() that
+ always fails. */
+
+int cannot_register_not (int regnum);
+
+/* Legacy version of target_virtual_frame_pointer(). Assumes that
+ there is an FP_REGNUM and that it is the same, cooked or raw. */
+
+extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
+
+extern CORE_ADDR generic_skip_trampoline_code (CORE_ADDR pc);
+
+extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name);
+
+extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
+
+extern void default_print_float_info (void);
+
+/* Assume all registers are the same size and a size identical to that
+ of the integer type. */
+extern int generic_register_raw_size (int regnum);
+
+/* Assume the virtual size of registers corresponds to the virtual type. */
+
+extern int generic_register_virtual_size (int regnum);
+
+/* Initialize a ``struct info''. Can't use memset(0) since some
+ default values are not zero. */
+extern void gdbarch_info_init (struct gdbarch_info *info);
+
+#endif
diff --git a/contrib/gdb/gdb/arm-linux-nat.c b/contrib/gdb/gdb/arm-linux-nat.c
new file mode 100644
index 0000000..8d7ee9d
--- /dev/null
+++ b/contrib/gdb/gdb/arm-linux-nat.c
@@ -0,0 +1,698 @@
+/* GNU/Linux on ARM native support.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "gdb_string.h"
+#include "regcache.h"
+
+#include "arm-tdep.h"
+
+#include <sys/user.h>
+#include <sys/ptrace.h>
+#include <sys/utsname.h>
+#include <sys/procfs.h>
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+extern int arm_apcs_32;
+
+#define typeNone 0x00
+#define typeSingle 0x01
+#define typeDouble 0x02
+#define typeExtended 0x03
+#define FPWORDS 28
+#define ARM_CPSR_REGNUM 16
+
+typedef union tagFPREG
+ {
+ unsigned int fSingle;
+ unsigned int fDouble[2];
+ unsigned int fExtended[3];
+ }
+FPREG;
+
+typedef struct tagFPA11
+ {
+ FPREG fpreg[8]; /* 8 floating point registers */
+ unsigned int fpsr; /* floating point status register */
+ unsigned int fpcr; /* floating point control register */
+ unsigned char fType[8]; /* type of floating point value held in
+ floating point registers. */
+ int initflag; /* NWFPE initialization flag. */
+ }
+FPA11;
+
+/* The following variables are used to determine the version of the
+ underlying GNU/Linux operating system. Examples:
+
+ GNU/Linux 2.0.35 GNU/Linux 2.2.12
+ os_version = 0x00020023 os_version = 0x0002020c
+ os_major = 2 os_major = 2
+ os_minor = 0 os_minor = 2
+ os_release = 35 os_release = 12
+
+ Note: os_version = (os_major << 16) | (os_minor << 8) | os_release
+
+ These are initialized using get_linux_version() from
+ _initialize_arm_linux_nat(). */
+
+static unsigned int os_version, os_major, os_minor, os_release;
+
+/* On GNU/Linux, threads are implemented as pseudo-processes, in which
+ case we may be tracing more than one process at a time. In that
+ case, inferior_ptid will contain the main process ID and the
+ individual thread (process) ID. get_thread_id () is used to get
+ the thread id if it's available, and the process id otherwise. */
+
+int
+get_thread_id (ptid_t ptid)
+{
+ int tid = TIDGET (ptid);
+ if (0 == tid)
+ tid = PIDGET (ptid);
+ return tid;
+}
+#define GET_THREAD_ID(PTID) get_thread_id ((PTID));
+
+static void
+fetch_nwfpe_single (unsigned int fn, FPA11 * fpa11)
+{
+ unsigned int mem[3];
+
+ mem[0] = fpa11->fpreg[fn].fSingle;
+ mem[1] = 0;
+ mem[2] = 0;
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+}
+
+static void
+fetch_nwfpe_double (unsigned int fn, FPA11 * fpa11)
+{
+ unsigned int mem[3];
+
+ mem[0] = fpa11->fpreg[fn].fDouble[1];
+ mem[1] = fpa11->fpreg[fn].fDouble[0];
+ mem[2] = 0;
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+}
+
+static void
+fetch_nwfpe_none (unsigned int fn)
+{
+ unsigned int mem[3] =
+ {0, 0, 0};
+
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+}
+
+static void
+fetch_nwfpe_extended (unsigned int fn, FPA11 * fpa11)
+{
+ unsigned int mem[3];
+
+ mem[0] = fpa11->fpreg[fn].fExtended[0]; /* sign & exponent */
+ mem[1] = fpa11->fpreg[fn].fExtended[2]; /* ls bits */
+ mem[2] = fpa11->fpreg[fn].fExtended[1]; /* ms bits */
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+}
+
+static void
+fetch_nwfpe_register (int regno, FPA11 * fpa11)
+{
+ int fn = regno - ARM_F0_REGNUM;
+
+ switch (fpa11->fType[fn])
+ {
+ case typeSingle:
+ fetch_nwfpe_single (fn, fpa11);
+ break;
+
+ case typeDouble:
+ fetch_nwfpe_double (fn, fpa11);
+ break;
+
+ case typeExtended:
+ fetch_nwfpe_extended (fn, fpa11);
+ break;
+
+ default:
+ fetch_nwfpe_none (fn);
+ }
+}
+
+static void
+store_nwfpe_single (unsigned int fn, FPA11 *fpa11)
+{
+ unsigned int mem[3];
+
+ regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+ fpa11->fpreg[fn].fSingle = mem[0];
+ fpa11->fType[fn] = typeSingle;
+}
+
+static void
+store_nwfpe_double (unsigned int fn, FPA11 *fpa11)
+{
+ unsigned int mem[3];
+
+ regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+ fpa11->fpreg[fn].fDouble[1] = mem[0];
+ fpa11->fpreg[fn].fDouble[0] = mem[1];
+ fpa11->fType[fn] = typeDouble;
+}
+
+void
+store_nwfpe_extended (unsigned int fn, FPA11 *fpa11)
+{
+ unsigned int mem[3];
+
+ regcache_collect (ARM_F0_REGNUM + fn, (char *) &mem[0]);
+ fpa11->fpreg[fn].fExtended[0] = mem[0]; /* sign & exponent */
+ fpa11->fpreg[fn].fExtended[2] = mem[1]; /* ls bits */
+ fpa11->fpreg[fn].fExtended[1] = mem[2]; /* ms bits */
+ fpa11->fType[fn] = typeDouble;
+}
+
+void
+store_nwfpe_register (int regno, FPA11 * fpa11)
+{
+ if (register_cached (regno))
+ {
+ unsigned int fn = regno - ARM_F0_REGNUM;
+ switch (fpa11->fType[fn])
+ {
+ case typeSingle:
+ store_nwfpe_single (fn, fpa11);
+ break;
+
+ case typeDouble:
+ store_nwfpe_double (fn, fpa11);
+ break;
+
+ case typeExtended:
+ store_nwfpe_extended (fn, fpa11);
+ break;
+ }
+ }
+}
+
+
+/* Get the value of a particular register from the floating point
+ state of the process and store it into regcache. */
+
+static void
+fetch_fpregister (int regno)
+{
+ int ret, tid;
+ FPA11 fp;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Read the floating point state. */
+ ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch floating point register.");
+ return;
+ }
+
+ /* Fetch fpsr. */
+ if (ARM_FPS_REGNUM == regno)
+ supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
+
+ /* Fetch the floating point register. */
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
+ {
+ int fn = regno - ARM_F0_REGNUM;
+
+ switch (fp.fType[fn])
+ {
+ case typeSingle:
+ fetch_nwfpe_single (fn, &fp);
+ break;
+
+ case typeDouble:
+ fetch_nwfpe_double (fn, &fp);
+ break;
+
+ case typeExtended:
+ fetch_nwfpe_extended (fn, &fp);
+ break;
+
+ default:
+ fetch_nwfpe_none (fn);
+ }
+ }
+}
+
+/* Get the whole floating point state of the process and store it
+ into regcache. */
+
+static void
+fetch_fpregs (void)
+{
+ int ret, regno, tid;
+ FPA11 fp;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Read the floating point state. */
+ ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch the floating point registers.");
+ return;
+ }
+
+ /* Fetch fpsr. */
+ supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
+
+ /* Fetch the floating point registers. */
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ {
+ int fn = regno - ARM_F0_REGNUM;
+
+ switch (fp.fType[fn])
+ {
+ case typeSingle:
+ fetch_nwfpe_single (fn, &fp);
+ break;
+
+ case typeDouble:
+ fetch_nwfpe_double (fn, &fp);
+ break;
+
+ case typeExtended:
+ fetch_nwfpe_extended (fn, &fp);
+ break;
+
+ default:
+ fetch_nwfpe_none (fn);
+ }
+ }
+}
+
+/* Save a particular register into the floating point state of the
+ process using the contents from regcache. */
+
+static void
+store_fpregister (int regno)
+{
+ int ret, tid;
+ FPA11 fp;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Read the floating point state. */
+ ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch the floating point registers.");
+ return;
+ }
+
+ /* Store fpsr. */
+ if (ARM_FPS_REGNUM == regno && register_cached (ARM_FPS_REGNUM))
+ regcache_collect (ARM_FPS_REGNUM, (char *) &fp.fpsr);
+
+ /* Store the floating point register. */
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
+ {
+ store_nwfpe_register (regno, &fp);
+ }
+
+ ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to store floating point register.");
+ return;
+ }
+}
+
+/* Save the whole floating point state of the process using
+ the contents from regcache. */
+
+static void
+store_fpregs (void)
+{
+ int ret, regno, tid;
+ FPA11 fp;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Read the floating point state. */
+ ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch the floating point registers.");
+ return;
+ }
+
+ /* Store fpsr. */
+ if (register_cached (ARM_FPS_REGNUM))
+ regcache_collect (ARM_FPS_REGNUM, (char *) &fp.fpsr);
+
+ /* Store the floating point registers. */
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ {
+ fetch_nwfpe_register (regno, &fp);
+ }
+
+ ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp);
+ if (ret < 0)
+ {
+ warning ("Unable to store floating point registers.");
+ return;
+ }
+}
+
+/* Fetch a general register of the process and store into
+ regcache. */
+
+static void
+fetch_register (int regno)
+{
+ int ret, tid;
+ elf_gregset_t regs;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch general register.");
+ return;
+ }
+
+ if (regno >= ARM_A1_REGNUM && regno < ARM_PC_REGNUM)
+ supply_register (regno, (char *) &regs[regno]);
+
+ if (ARM_PS_REGNUM == regno)
+ {
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
+ }
+
+ if (ARM_PC_REGNUM == regno)
+ {
+ regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
+ }
+}
+
+/* Fetch all general registers of the process and store into
+ regcache. */
+
+static void
+fetch_regs (void)
+{
+ int ret, regno, tid;
+ elf_gregset_t regs;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch general registers.");
+ return;
+ }
+
+ for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
+ supply_register (regno, (char *) &regs[regno]);
+
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
+
+ regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
+}
+
+/* Store all general registers of the process from the values in
+ regcache. */
+
+static void
+store_register (int regno)
+{
+ int ret, tid;
+ elf_gregset_t regs;
+
+ if (!register_cached (regno))
+ return;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Get the general registers from the process. */
+ ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch general registers.");
+ return;
+ }
+
+ if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
+ regcache_collect (regno, (char *) &regs[regno]);
+
+ ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ warning ("Unable to store general register.");
+ return;
+ }
+}
+
+static void
+store_regs (void)
+{
+ int ret, regno, tid;
+ elf_gregset_t regs;
+
+ /* Get the thread id for the ptrace call. */
+ tid = GET_THREAD_ID (inferior_ptid);
+
+ /* Fetch the general registers. */
+ ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ warning ("Unable to fetch general registers.");
+ return;
+ }
+
+ for (regno = ARM_A1_REGNUM; regno <= ARM_PC_REGNUM; regno++)
+ {
+ if (register_cached (regno))
+ regcache_collect (regno, (char *) &regs[regno]);
+ }
+
+ ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
+
+ if (ret < 0)
+ {
+ warning ("Unable to store general registers.");
+ return;
+ }
+}
+
+/* Fetch registers from the child process. Fetch all registers if
+ regno == -1, otherwise fetch all general registers or all floating
+ point registers depending upon the value of regno. */
+
+void
+fetch_inferior_registers (int regno)
+{
+ if (-1 == regno)
+ {
+ fetch_regs ();
+ fetch_fpregs ();
+ }
+ else
+ {
+ if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
+ fetch_register (regno);
+
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM)
+ fetch_fpregister (regno);
+ }
+}
+
+/* Store registers back into the inferior. Store all registers if
+ regno == -1, otherwise store all general registers or all floating
+ point registers depending upon the value of regno. */
+
+void
+store_inferior_registers (int regno)
+{
+ if (-1 == regno)
+ {
+ store_regs ();
+ store_fpregs ();
+ }
+ else
+ {
+ if ((regno < ARM_F0_REGNUM) || (regno > ARM_FPS_REGNUM))
+ store_register (regno);
+
+ if ((regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM))
+ store_fpregister (regno);
+ }
+}
+
+/* Fill register regno (if it is a general-purpose register) in
+ *gregsetp with the appropriate value from GDB's register array.
+ If regno is -1, do this for all registers. */
+
+void
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
+{
+ if (-1 == regno)
+ {
+ int regnum;
+ for (regnum = ARM_A1_REGNUM; regnum <= ARM_PC_REGNUM; regnum++)
+ regcache_collect (regnum, (char *) &(*gregsetp)[regnum]);
+ }
+ else if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
+ regcache_collect (regno, (char *) &(*gregsetp)[regno]);
+
+ if (ARM_PS_REGNUM == regno || -1 == regno)
+ {
+ if (arm_apcs_32)
+ regcache_collect (ARM_PS_REGNUM,
+ (char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
+ else
+ regcache_collect (ARM_PC_REGNUM,
+ (char *) &(*gregsetp)[ARM_PC_REGNUM]);
+ }
+}
+
+/* Fill GDB's register array with the general-purpose register values
+ in *gregsetp. */
+
+void
+supply_gregset (gdb_gregset_t *gregsetp)
+{
+ int regno, reg_pc;
+
+ for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
+ supply_register (regno, (char *) &(*gregsetp)[regno]);
+
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_PC_REGNUM]);
+
+ reg_pc = ADDR_BITS_REMOVE ((CORE_ADDR)(*gregsetp)[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &reg_pc);
+}
+
+/* Fill register regno (if it is a floating-point register) in
+ *fpregsetp with the appropriate value from GDB's register array.
+ If regno is -1, do this for all registers. */
+
+void
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+{
+ FPA11 *fp = (FPA11 *) fpregsetp;
+
+ if (-1 == regno)
+ {
+ int regnum;
+ for (regnum = ARM_F0_REGNUM; regnum <= ARM_F7_REGNUM; regnum++)
+ store_nwfpe_register (regnum, fp);
+ }
+ else if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
+ {
+ store_nwfpe_register (regno, fp);
+ return;
+ }
+
+ /* Store fpsr. */
+ if (ARM_FPS_REGNUM == regno || -1 == regno)
+ regcache_collect (ARM_FPS_REGNUM, (char *) &fp->fpsr);
+}
+
+/* Fill GDB's register array with the floating-point register values
+ in *fpregsetp. */
+
+void
+supply_fpregset (gdb_fpregset_t *fpregsetp)
+{
+ int regno;
+ FPA11 *fp = (FPA11 *) fpregsetp;
+
+ /* Fetch fpsr. */
+ supply_register (ARM_FPS_REGNUM, (char *) &fp->fpsr);
+
+ /* Fetch the floating point registers. */
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ {
+ fetch_nwfpe_register (regno, fp);
+ }
+}
+
+int
+arm_linux_kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
+static unsigned int
+get_linux_version (unsigned int *vmajor,
+ unsigned int *vminor,
+ unsigned int *vrelease)
+{
+ struct utsname info;
+ char *pmajor, *pminor, *prelease, *tail;
+
+ if (-1 == uname (&info))
+ {
+ warning ("Unable to determine GNU/Linux version.");
+ return -1;
+ }
+
+ pmajor = strtok (info.release, ".");
+ pminor = strtok (NULL, ".");
+ prelease = strtok (NULL, ".");
+
+ *vmajor = (unsigned int) strtoul (pmajor, &tail, 0);
+ *vminor = (unsigned int) strtoul (pminor, &tail, 0);
+ *vrelease = (unsigned int) strtoul (prelease, &tail, 0);
+
+ return ((*vmajor << 16) | (*vminor << 8) | *vrelease);
+}
+
+void
+_initialize_arm_linux_nat (void)
+{
+ os_version = get_linux_version (&os_major, &os_minor, &os_release);
+}
diff --git a/contrib/gdb/gdb/arm-linux-tdep.c b/contrib/gdb/gdb/arm-linux-tdep.c
new file mode 100644
index 0000000..af100a5
--- /dev/null
+++ b/contrib/gdb/gdb/arm-linux-tdep.c
@@ -0,0 +1,547 @@
+/* GNU/Linux on ARM target support.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "target.h"
+#include "value.h"
+#include "gdbtypes.h"
+#include "floatformat.h"
+#include "gdbcore.h"
+#include "frame.h"
+#include "regcache.h"
+#include "doublest.h"
+
+#include "arm-tdep.h"
+
+/* For shared library handling. */
+#include "symtab.h"
+#include "symfile.h"
+#include "objfiles.h"
+
+/* Under ARM GNU/Linux the traditional way of performing a breakpoint
+ is to execute a particular software interrupt, rather than use a
+ particular undefined instruction to provoke a trap. Upon exection
+ of the software interrupt the kernel stops the inferior with a
+ SIGTRAP, and wakes the debugger. Since ARM GNU/Linux is little
+ endian, and doesn't support Thumb at the moment we only override
+ the ARM little-endian breakpoint. */
+
+static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
+
+/* CALL_DUMMY_WORDS:
+ This sequence of words is the instructions
+
+ mov lr, pc
+ mov pc, r4
+ swi bkpt_swi
+
+ Note this is 12 bytes. */
+
+LONGEST arm_linux_call_dummy_words[] =
+{
+ 0xe1a0e00f, 0xe1a0f004, 0xef9f001
+};
+
+/* Description of the longjmp buffer. */
+#define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
+#define JB_PC 21
+
+/* 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. */
+/* FIXME rearnsha/2002-02-23: This function shouldn't be necessary.
+ The ARM generic one should be able to handle the model used by
+ linux and the low-level formatting of the registers should be
+ hidden behind the regcache abstraction. */
+static void
+arm_linux_extract_return_value (struct type *type,
+ char regbuf[REGISTER_BYTES],
+ char *valbuf)
+{
+ /* ScottB: This needs to be looked at to handle the different
+ floating point emulators on ARM GNU/Linux. Right now the code
+ assumes that fetch inferior registers does the right thing for
+ GDB. I suspect this won't handle NWFPE registers correctly, nor
+ will the default ARM version (arm_extract_return_value()). */
+
+ int regnum = ((TYPE_CODE_FLT == TYPE_CODE (type))
+ ? ARM_F0_REGNUM : ARM_A1_REGNUM);
+ memcpy (valbuf, &regbuf[REGISTER_BYTE (regnum)], TYPE_LENGTH (type));
+}
+
+/* Note: ScottB
+
+ This function does not support passing parameters using the FPA
+ variant of the APCS. It passes any floating point arguments in the
+ general registers and/or on the stack.
+
+ FIXME: This and arm_push_arguments should be merged. However this
+ function breaks on a little endian host, big endian target
+ using the COFF file format. ELF is ok.
+
+ ScottB. */
+
+/* Addresses for calling Thumb functions have the bit 0 set.
+ Here are some macros to test, set, or clear bit 0 of addresses. */
+#define IS_THUMB_ADDR(addr) ((addr) & 1)
+#define MAKE_THUMB_ADDR(addr) ((addr) | 1)
+#define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
+
+static CORE_ADDR
+arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ char *fp;
+ int argnum, argreg, nstack_size;
+
+ /* Walk through the list of args and determine how large a temporary
+ stack is required. Need to take care here as structs may be
+ passed on the stack, and we have to to push them. */
+ nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
+
+ if (struct_return) /* The struct address goes in A1. */
+ nstack_size += REGISTER_SIZE;
+
+ /* Walk through the arguments and add their size to nstack_size. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ int len;
+ struct type *arg_type;
+
+ arg_type = check_typedef (VALUE_TYPE (args[argnum]));
+ len = TYPE_LENGTH (arg_type);
+
+ /* ANSI C code passes float arguments as integers, K&R code
+ passes float arguments as doubles. Correct for this here. */
+ if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len)
+ nstack_size += FP_REGISTER_VIRTUAL_SIZE;
+ else
+ nstack_size += len;
+ }
+
+ /* Allocate room on the stack, and initialize our stack frame
+ pointer. */
+ fp = NULL;
+ if (nstack_size > 0)
+ {
+ sp -= nstack_size;
+ fp = (char *) sp;
+ }
+
+ /* Initialize the integer argument register pointer. */
+ argreg = ARM_A1_REGNUM;
+
+ /* The struct_return pointer occupies the first parameter passing
+ register. */
+ if (struct_return)
+ write_register (argreg++, struct_addr);
+
+ /* Process arguments from left to right. Store as many as allowed
+ in the parameter passing registers (A1-A4), and save the rest on
+ the temporary stack. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ int len;
+ char *val;
+ CORE_ADDR regval;
+ enum type_code typecode;
+ struct type *arg_type, *target_type;
+
+ arg_type = check_typedef (VALUE_TYPE (args[argnum]));
+ target_type = TYPE_TARGET_TYPE (arg_type);
+ len = TYPE_LENGTH (arg_type);
+ typecode = TYPE_CODE (arg_type);
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+
+ /* ANSI C code passes float arguments as integers, K&R code
+ passes float arguments as doubles. The .stabs record for
+ for ANSI prototype floating point arguments records the
+ type as FP_INTEGER, while a K&R style (no prototype)
+ .stabs records the type as FP_FLOAT. In this latter case
+ the compiler converts the float arguments to double before
+ calling the function. */
+ if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
+ {
+ DOUBLEST dblval;
+ dblval = extract_floating (val, len);
+ len = TARGET_DOUBLE_BIT / TARGET_CHAR_BIT;
+ val = alloca (len);
+ store_floating (val, len, dblval);
+ }
+
+ /* If the argument is a pointer to a function, and it is a Thumb
+ function, set the low bit of the pointer. */
+ if (TYPE_CODE_PTR == typecode
+ && NULL != target_type
+ && TYPE_CODE_FUNC == TYPE_CODE (target_type))
+ {
+ CORE_ADDR regval = extract_address (val, len);
+ if (arm_pc_is_thumb (regval))
+ store_address (val, len, MAKE_THUMB_ADDR (regval));
+ }
+
+ /* Copy the argument to general registers or the stack in
+ register-sized pieces. Large arguments are split between
+ registers and stack. */
+ while (len > 0)
+ {
+ int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+
+ if (argreg <= ARM_LAST_ARG_REGNUM)
+ {
+ /* It's an argument being passed in a general register. */
+ regval = extract_address (val, partial_len);
+ write_register (argreg++, regval);
+ }
+ else
+ {
+ /* Push the arguments onto the stack. */
+ write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
+ fp += REGISTER_SIZE;
+ }
+
+ len -= partial_len;
+ val += partial_len;
+ }
+ }
+
+ /* Return adjusted stack pointer. */
+ return sp;
+}
+
+/*
+ Dynamic Linking on ARM GNU/Linux
+ --------------------------------
+
+ Note: PLT = procedure linkage table
+ GOT = global offset table
+
+ As much as possible, ELF dynamic linking defers the resolution of
+ jump/call addresses until the last minute. The technique used is
+ inspired by the i386 ELF design, and is based on the following
+ constraints.
+
+ 1) The calling technique should not force a change in the assembly
+ code produced for apps; it MAY cause changes in the way assembly
+ code is produced for position independent code (i.e. shared
+ libraries).
+
+ 2) The technique must be such that all executable areas must not be
+ modified; and any modified areas must not be executed.
+
+ To do this, there are three steps involved in a typical jump:
+
+ 1) in the code
+ 2) through the PLT
+ 3) using a pointer from the GOT
+
+ When the executable or library is first loaded, each GOT entry is
+ initialized to point to the code which implements dynamic name
+ resolution and code finding. This is normally a function in the
+ program interpreter (on ARM GNU/Linux this is usually
+ ld-linux.so.2, but it does not have to be). On the first
+ invocation, the function is located and the GOT entry is replaced
+ with the real function address. Subsequent calls go through steps
+ 1, 2 and 3 and end up calling the real code.
+
+ 1) In the code:
+
+ b function_call
+ bl function_call
+
+ This is typical ARM code using the 26 bit relative branch or branch
+ and link instructions. The target of the instruction
+ (function_call is usually the address of the function to be called.
+ In position independent code, the target of the instruction is
+ actually an entry in the PLT when calling functions in a shared
+ library. Note that this call is identical to a normal function
+ call, only the target differs.
+
+ 2) In the PLT:
+
+ The PLT is a synthetic area, created by the linker. It exists in
+ both executables and libraries. It is an array of stubs, one per
+ imported function call. It looks like this:
+
+ PLT[0]:
+ str lr, [sp, #-4]! @push the return address (lr)
+ ldr lr, [pc, #16] @load from 6 words ahead
+ add lr, pc, lr @form an address for GOT[0]
+ ldr pc, [lr, #8]! @jump to the contents of that addr
+
+ The return address (lr) is pushed on the stack and used for
+ calculations. The load on the second line loads the lr with
+ &GOT[3] - . - 20. The addition on the third leaves:
+
+ lr = (&GOT[3] - . - 20) + (. + 8)
+ lr = (&GOT[3] - 12)
+ lr = &GOT[0]
+
+ On the fourth line, the pc and lr are both updated, so that:
+
+ pc = GOT[2]
+ lr = &GOT[0] + 8
+ = &GOT[2]
+
+ NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little
+ "tight", but allows us to keep all the PLT entries the same size.
+
+ PLT[n+1]:
+ ldr ip, [pc, #4] @load offset from gotoff
+ add ip, pc, ip @add the offset to the pc
+ ldr pc, [ip] @jump to that address
+ gotoff: .word GOT[n+3] - .
+
+ The load on the first line, gets an offset from the fourth word of
+ the PLT entry. The add on the second line makes ip = &GOT[n+3],
+ which contains either a pointer to PLT[0] (the fixup trampoline) or
+ a pointer to the actual code.
+
+ 3) In the GOT:
+
+ The GOT contains helper pointers for both code (PLT) fixups and
+ data fixups. The first 3 entries of the GOT are special. The next
+ M entries (where M is the number of entries in the PLT) belong to
+ the PLT fixups. The next D (all remaining) entries belong to
+ various data fixups. The actual size of the GOT is 3 + M + D.
+
+ The GOT is also a synthetic area, created by the linker. It exists
+ in both executables and libraries. When the GOT is first
+ initialized , all the GOT entries relating to PLT fixups are
+ pointing to code back at PLT[0].
+
+ The special entries in the GOT are:
+
+ GOT[0] = linked list pointer used by the dynamic loader
+ GOT[1] = pointer to the reloc table for this module
+ GOT[2] = pointer to the fixup/resolver code
+
+ The first invocation of function call comes through and uses the
+ fixup/resolver code. On the entry to the fixup/resolver code:
+
+ ip = &GOT[n+3]
+ lr = &GOT[2]
+ stack[0] = return address (lr) of the function call
+ [r0, r1, r2, r3] are still the arguments to the function call
+
+ This is enough information for the fixup/resolver code to work
+ with. Before the fixup/resolver code returns, it actually calls
+ the requested function and repairs &GOT[n+3]. */
+
+/* Find the minimal symbol named NAME, and return both the minsym
+ struct and its objfile. This probably ought to be in minsym.c, but
+ everything there is trying to deal with things like C++ and
+ SOFUN_ADDRESS_MAYBE_TURQUOISE, ... Since this is so simple, it may
+ be considered too special-purpose for general consumption. */
+
+static struct minimal_symbol *
+find_minsym_and_objfile (char *name, struct objfile **objfile_p)
+{
+ struct objfile *objfile;
+
+ ALL_OBJFILES (objfile)
+ {
+ struct minimal_symbol *msym;
+
+ ALL_OBJFILE_MSYMBOLS (objfile, msym)
+ {
+ if (SYMBOL_NAME (msym)
+ && strcmp (SYMBOL_NAME (msym), name) == 0)
+ {
+ *objfile_p = objfile;
+ return msym;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+static CORE_ADDR
+skip_hurd_resolver (CORE_ADDR pc)
+{
+ /* The HURD dynamic linker is part of the GNU C library, so many
+ GNU/Linux distributions use it. (All ELF versions, as far as I
+ know.) An unresolved PLT entry points to "_dl_runtime_resolve",
+ which calls "fixup" to patch the PLT, and then passes control to
+ the function.
+
+ We look for the symbol `_dl_runtime_resolve', and find `fixup' in
+ the same objfile. If we are at the entry point of `fixup', then
+ we set a breakpoint at the return address (at the top of the
+ stack), and continue.
+
+ It's kind of gross to do all these checks every time we're
+ called, since they don't change once the executable has gotten
+ started. But this is only a temporary hack --- upcoming versions
+ of GNU/Linux will provide a portable, efficient interface for
+ debugging programs that use shared libraries. */
+
+ struct objfile *objfile;
+ struct minimal_symbol *resolver
+ = find_minsym_and_objfile ("_dl_runtime_resolve", &objfile);
+
+ if (resolver)
+ {
+ struct minimal_symbol *fixup
+ = lookup_minimal_symbol ("fixup", NULL, objfile);
+
+ if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
+ return (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ }
+
+ return 0;
+}
+
+/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
+ This function:
+ 1) decides whether a PLT has sent us into the linker to resolve
+ a function reference, and
+ 2) if so, tells us where to set a temporary breakpoint that will
+ trigger when the dynamic linker is done. */
+
+CORE_ADDR
+arm_linux_skip_solib_resolver (CORE_ADDR pc)
+{
+ CORE_ADDR result;
+
+ /* Plug in functions for other kinds of resolvers here. */
+ result = skip_hurd_resolver (pc);
+
+ if (result)
+ return result;
+
+ return 0;
+}
+
+/* The constants below were determined by examining the following files
+ in the linux kernel sources:
+
+ arch/arm/kernel/signal.c
+ - see SWI_SYS_SIGRETURN and SWI_SYS_RT_SIGRETURN
+ include/asm-arm/unistd.h
+ - see __NR_sigreturn, __NR_rt_sigreturn, and __NR_SYSCALL_BASE */
+
+#define ARM_LINUX_SIGRETURN_INSTR 0xef900077
+#define ARM_LINUX_RT_SIGRETURN_INSTR 0xef9000ad
+
+/* arm_linux_in_sigtramp determines if PC points at one of the
+ instructions which cause control to return to the Linux kernel upon
+ return from a signal handler. FUNC_NAME is unused. */
+
+int
+arm_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ unsigned long inst;
+
+ inst = read_memory_integer (pc, 4);
+
+ return (inst == ARM_LINUX_SIGRETURN_INSTR
+ || inst == ARM_LINUX_RT_SIGRETURN_INSTR);
+
+}
+
+/* arm_linux_sigcontext_register_address returns the address in the
+ sigcontext of register REGNO given a stack pointer value SP and
+ program counter value PC. The value 0 is returned if PC is not
+ pointing at one of the signal return instructions or if REGNO is
+ not saved in the sigcontext struct. */
+
+CORE_ADDR
+arm_linux_sigcontext_register_address (CORE_ADDR sp, CORE_ADDR pc, int regno)
+{
+ unsigned long inst;
+ CORE_ADDR reg_addr = 0;
+
+ inst = read_memory_integer (pc, 4);
+
+ if (inst == ARM_LINUX_SIGRETURN_INSTR
+ || inst == ARM_LINUX_RT_SIGRETURN_INSTR)
+ {
+ CORE_ADDR sigcontext_addr;
+
+ /* The sigcontext structure is at different places for the two
+ signal return instructions. For ARM_LINUX_SIGRETURN_INSTR,
+ it starts at the SP value. For ARM_LINUX_RT_SIGRETURN_INSTR,
+ it is at SP+8. For the latter instruction, it may also be
+ the case that the address of this structure may be determined
+ by reading the 4 bytes at SP, but I'm not convinced this is
+ reliable.
+
+ In any event, these magic constants (0 and 8) may be
+ determined by examining struct sigframe and struct
+ rt_sigframe in arch/arm/kernel/signal.c in the Linux kernel
+ sources. */
+
+ if (inst == ARM_LINUX_RT_SIGRETURN_INSTR)
+ sigcontext_addr = sp + 8;
+ else /* inst == ARM_LINUX_SIGRETURN_INSTR */
+ sigcontext_addr = sp + 0;
+
+ /* The layout of the sigcontext structure for ARM GNU/Linux is
+ in include/asm-arm/sigcontext.h in the Linux kernel sources.
+
+ There are three 4-byte fields which precede the saved r0
+ field. (This accounts for the 12 in the code below.) The
+ sixteen registers (4 bytes per field) follow in order. The
+ PSR value follows the sixteen registers which accounts for
+ the constant 19 below. */
+
+ if (0 <= regno && regno <= ARM_PC_REGNUM)
+ reg_addr = sigcontext_addr + 12 + (4 * regno);
+ else if (regno == ARM_PS_REGNUM)
+ reg_addr = sigcontext_addr + 19 * 4;
+ }
+
+ return reg_addr;
+}
+
+static void
+arm_linux_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ tdep->lowest_pc = 0x8000;
+ tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
+ tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
+
+ tdep->jb_pc = JB_PC;
+ tdep->jb_elt_size = JB_ELEMENT_SIZE;
+
+ set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (arm_linux_call_dummy_words));
+
+ /* The following two overrides shouldn't be needed. */
+ set_gdbarch_extract_return_value (gdbarch, arm_linux_extract_return_value);
+ set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments);
+
+ /* Shared library handling. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+}
+
+void
+_initialize_arm_linux_tdep (void)
+{
+ arm_gdbarch_register_os_abi (ARM_ABI_LINUX, arm_linux_init_abi);
+}
diff --git a/contrib/gdb/gdb/arm-tdep.h b/contrib/gdb/gdb/arm-tdep.h
new file mode 100644
index 0000000..a4c52dc
--- /dev/null
+++ b/contrib/gdb/gdb/arm-tdep.h
@@ -0,0 +1,174 @@
+/* Common target dependent code for GDB on ARM systems.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Register numbers of various important registers. Note that some of
+ these values are "real" register numbers, and correspond to the
+ general registers of the machine, and some are "phony" register
+ numbers which are too large to be actual register numbers as far as
+ the user is concerned but do serve to get the desired values when
+ passed to read_register. */
+
+#define ARM_A1_REGNUM 0 /* first integer-like argument */
+#define ARM_A4_REGNUM 3 /* last integer-like argument */
+#define ARM_AP_REGNUM 11
+#define ARM_SP_REGNUM 13 /* Contains address of top of stack */
+#define ARM_LR_REGNUM 14 /* address to return to from a function call */
+#define ARM_PC_REGNUM 15 /* Contains program counter */
+#define ARM_F0_REGNUM 16 /* first floating point register */
+#define ARM_F3_REGNUM 19 /* last floating point argument register */
+#define ARM_F7_REGNUM 23 /* last floating point register */
+#define ARM_FPS_REGNUM 24 /* floating point status register */
+#define ARM_PS_REGNUM 25 /* Contains processor status */
+
+#define ARM_FP_REGNUM 11 /* Frame register in ARM code, if used. */
+#define THUMB_FP_REGNUM 7 /* Frame register in Thumb code, if used. */
+
+#define ARM_NUM_ARG_REGS 4
+#define ARM_LAST_ARG_REGNUM ARM_A4_REGNUM
+#define ARM_NUM_FP_ARG_REGS 4
+#define ARM_LAST_FP_ARG_REGNUM ARM_F3_REGNUM
+
+/* Size of integer registers. */
+#define INT_REGISTER_RAW_SIZE 4
+#define INT_REGISTER_VIRTUAL_SIZE 4
+
+/* Say how long FP registers are. Used for documentation purposes and
+ code readability in this header. IEEE extended doubles are 80
+ bits. DWORD aligned they use 96 bits. */
+#define FP_REGISTER_RAW_SIZE 12
+
+/* GCC doesn't support long doubles (extended IEEE values). The FP
+ register virtual size is therefore 64 bits. Used for documentation
+ purposes and code readability in this header. */
+#define FP_REGISTER_VIRTUAL_SIZE 8
+
+/* Status registers are the same size as general purpose registers.
+ Used for documentation purposes and code readability in this
+ header. */
+#define STATUS_REGISTER_SIZE 4
+
+/* Number of machine registers. The only define actually required
+ is NUM_REGS. The other definitions are used for documentation
+ purposes and code readability. */
+/* For 26 bit ARM code, a fake copy of the PC is placed in register 25 (PS)
+ (and called PS for processor status) so the status bits can be cleared
+ from the PC (register 15). For 32 bit ARM code, a copy of CPSR is placed
+ in PS. */
+#define NUM_FREGS 8 /* Number of floating point registers. */
+#define NUM_SREGS 2 /* Number of status registers. */
+#define NUM_GREGS 16 /* Number of general purpose registers. */
+
+
+/* Instruction condition field values. */
+#define INST_EQ 0x0
+#define INST_NE 0x1
+#define INST_CS 0x2
+#define INST_CC 0x3
+#define INST_MI 0x4
+#define INST_PL 0x5
+#define INST_VS 0x6
+#define INST_VC 0x7
+#define INST_HI 0x8
+#define INST_LS 0x9
+#define INST_GE 0xa
+#define INST_LT 0xb
+#define INST_GT 0xc
+#define INST_LE 0xd
+#define INST_AL 0xe
+#define INST_NV 0xf
+
+#define FLAG_N 0x80000000
+#define FLAG_Z 0x40000000
+#define FLAG_C 0x20000000
+#define FLAG_V 0x10000000
+
+/* ABI variants that we know about. If you add to this enum, please
+ update the table of names in tm-arm.c. */
+enum arm_abi
+{
+ ARM_ABI_UNKNOWN = 0,
+ ARM_ABI_EABI_V1,
+ ARM_ABI_EABI_V2,
+ ARM_ABI_LINUX,
+ ARM_ABI_NETBSD_AOUT,
+ ARM_ABI_NETBSD_ELF,
+ ARM_ABI_APCS,
+ ARM_ABI_FREEBSD,
+ ARM_ABI_WINCE,
+
+ ARM_ABI_INVALID /* Keep this last. */
+};
+
+/* Type of floating-point code in use by inferior. There are really 3 models
+ that are traditionally supported (plus the endianness issue), but gcc can
+ only generate 2 of those. The third is APCS_FLOAT, where arguments to
+ functions are passed in floating-point registers.
+
+ In addition to the traditional models, VFP adds two more. */
+
+enum arm_float_model
+{
+ ARM_FLOAT_SOFT,
+ ARM_FLOAT_FPA,
+ ARM_FLOAT_SOFT_VFP,
+ ARM_FLOAT_VFP
+};
+
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ enum arm_abi arm_abi; /* OS/ABI of inferior. */
+ const char *abi_name; /* Name of the above. */
+
+ enum arm_float_model fp_model; /* Floating point calling conventions. */
+
+ CORE_ADDR lowest_pc; /* Lowest address at which instructions
+ will appear. */
+
+ const char *arm_breakpoint; /* Breakpoint pattern for an ARM insn. */
+ int arm_breakpoint_size; /* And its size. */
+ const char *thumb_breakpoint; /* Breakpoint pattern for an ARM insn. */
+ int thumb_breakpoint_size; /* And its size. */
+
+ int jb_pc; /* Offset to PC value in jump buffer.
+ If this is negative, longjmp support
+ will be disabled. */
+ size_t jb_elt_size; /* And the size of each entry in the buf. */
+};
+
+#ifndef LOWEST_PC
+#define LOWEST_PC (gdbarch_tdep (current_gdbarch)->lowest_pc)
+#endif
+
+/* Prototypes for internal interfaces needed by more than one MD file. */
+int arm_pc_is_thumb_dummy (CORE_ADDR);
+
+int arm_pc_is_thumb (CORE_ADDR);
+
+CORE_ADDR thumb_get_next_pc (CORE_ADDR);
+
+CORE_ADDR arm_get_next_pc (CORE_ADDR);
+
+/* How a OS variant tells the ARM generic code that it can handle an ABI
+ type. */
+void
+arm_gdbarch_register_os_abi (enum arm_abi abi,
+ void (*init_abi)(struct gdbarch_info,
+ struct gdbarch *));
diff --git a/contrib/gdb/gdb/armnbsd-nat.c b/contrib/gdb/gdb/armnbsd-nat.c
new file mode 100644
index 0000000..88396c0
--- /dev/null
+++ b/contrib/gdb/gdb/armnbsd-nat.c
@@ -0,0 +1,464 @@
+/* Native-dependent code for BSD Unix running on ARM's, for GDB.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#ifndef FETCH_INFERIOR_REGISTERS
+#error Not FETCH_INFERIOR_REGISTERS
+#endif /* !FETCH_INFERIOR_REGISTERS */
+
+#include "arm-tdep.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+#include <machine/frame.h>
+#include "inferior.h"
+#include "regcache.h"
+#include "gdbcore.h"
+
+extern int arm_apcs_32;
+
+static void
+supply_gregset (struct reg *gregset)
+{
+ int regno;
+ CORE_ADDR r_pc;
+
+ /* Integer registers. */
+ for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
+ supply_register (regno, (char *) &gregset->r[regno]);
+
+ supply_register (ARM_SP_REGNUM, (char *) &gregset->r_sp);
+ supply_register (ARM_LR_REGNUM, (char *) &gregset->r_lr);
+ /* This is ok: we're running native... */
+ r_pc = ADDR_BITS_REMOVE (gregset->r_pc);
+ supply_register (ARM_PC_REGNUM, (char *) &r_pc);
+
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &gregset->r_cpsr);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &gregset->r_pc);
+}
+
+static void
+supply_fparegset (struct fpreg *fparegset)
+{
+ int regno;
+
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ supply_register
+ (regno, (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
+
+ supply_register (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
+}
+
+static void
+fetch_register (int regno)
+{
+ struct reg inferior_registers;
+ int ret;
+
+ ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch general register");
+ return;
+ }
+
+ switch (regno)
+ {
+ case ARM_SP_REGNUM:
+ supply_register (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
+ break;
+
+ case ARM_LR_REGNUM:
+ supply_register (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
+ break;
+
+ case ARM_PC_REGNUM:
+ /* This is ok: we're running native... */
+ inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ supply_register (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
+ break;
+
+ case ARM_PS_REGNUM:
+ if (arm_apcs_32)
+ supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
+ else
+ supply_register (ARM_PS_REGNUM, (char *) &inferior_registers.r_pc);
+ break;
+
+ default:
+ supply_register (regno, (char *) &inferior_registers.r[regno]);
+ break;
+ }
+}
+
+static void
+fetch_regs (void)
+{
+ struct reg inferior_registers;
+ int ret;
+ int regno;
+
+ ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch general registers");
+ return;
+ }
+
+ supply_gregset (&inferior_registers);
+}
+
+static void
+fetch_fp_register (int regno)
+{
+ struct fpreg inferior_fp_registers;
+ int ret;
+
+ ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch floating-point register");
+ return;
+ }
+
+ switch (regno)
+ {
+ case ARM_FPS_REGNUM:
+ supply_register (ARM_FPS_REGNUM,
+ (char *) &inferior_fp_registers.fpr_fpsr);
+ break;
+
+ default:
+ supply_register
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+ break;
+ }
+}
+
+static void
+fetch_fp_regs (void)
+{
+ struct fpreg inferior_fp_registers;
+ int ret;
+ int regno;
+
+ ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch general registers");
+ return;
+ }
+
+ supply_fparegset (&inferior_fp_registers);
+}
+
+void
+fetch_inferior_registers (int regno)
+{
+ if (regno >= 0)
+ {
+ if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
+ fetch_register (regno);
+ else
+ fetch_fp_register (regno);
+ }
+ else
+ {
+ fetch_regs ();
+ fetch_fp_regs ();
+ }
+}
+
+
+static void
+store_register (int regno)
+{
+ struct reg inferior_registers;
+ int ret;
+
+ ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch general registers");
+ return;
+ }
+
+ switch (regno)
+ {
+ case ARM_SP_REGNUM:
+ regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
+ break;
+
+ case ARM_LR_REGNUM:
+ regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
+ break;
+
+ case ARM_PC_REGNUM:
+ if (arm_apcs_32)
+ regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
+ else
+ {
+ unsigned pc_val;
+
+ regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
+
+ pc_val = ADDR_BITS_REMOVE (pc_val);
+ inferior_registers.r_pc
+ ^= ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ inferior_registers.r_pc |= pc_val;
+ }
+ break;
+
+ case ARM_PS_REGNUM:
+ if (arm_apcs_32)
+ regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
+ else
+ {
+ unsigned psr_val;
+
+ regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
+
+ psr_val ^= ADDR_BITS_REMOVE (psr_val);
+ inferior_registers.r_pc = ADDR_BITS_REMOVE (inferior_registers.r_pc);
+ inferior_registers.r_pc |= psr_val;
+ }
+ break;
+
+ default:
+ regcache_collect (regno, (char *) &inferior_registers.r[regno]);
+ break;
+ }
+
+ ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+
+ if (ret < 0)
+ warning ("unable to write register %d to inferior", regno);
+}
+
+static void
+store_regs (void)
+{
+ struct reg inferior_registers;
+ int ret;
+ int regno;
+
+
+ for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
+ regcache_collect (regno, (char *) &inferior_registers.r[regno]);
+
+ regcache_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
+ regcache_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
+
+ if (arm_apcs_32)
+ {
+ regcache_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
+ regcache_collect (ARM_PS_REGNUM, (char *) &inferior_registers.r_cpsr);
+ }
+ else
+ {
+ unsigned pc_val;
+ unsigned psr_val;
+
+ regcache_collect (ARM_PC_REGNUM, (char *) &pc_val);
+ regcache_collect (ARM_PS_REGNUM, (char *) &psr_val);
+
+ pc_val = ADDR_BITS_REMOVE (pc_val);
+ psr_val ^= ADDR_BITS_REMOVE (psr_val);
+
+ inferior_registers.r_pc = pc_val | psr_val;
+ }
+
+ ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+
+ if (ret < 0)
+ warning ("unable to store general registers");
+}
+
+static void
+store_fp_register (int regno)
+{
+ struct fpreg inferior_fp_registers;
+ int ret;
+
+ ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ if (ret < 0)
+ {
+ warning ("unable to fetch floating-point registers");
+ return;
+ }
+
+ switch (regno)
+ {
+ case ARM_FPS_REGNUM:
+ regcache_collect (ARM_FPS_REGNUM,
+ (char *) &inferior_fp_registers.fpr_fpsr);
+ break;
+
+ default:
+ regcache_collect
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+ break;
+ }
+
+ ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ if (ret < 0)
+ warning ("unable to write register %d to inferior", regno);
+}
+
+static void
+store_fp_regs (void)
+{
+ struct fpreg inferior_fp_registers;
+ int ret;
+ int regno;
+
+
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
+ regcache_collect
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+
+ regcache_collect (ARM_FPS_REGNUM, (char *) &inferior_fp_registers.fpr_fpsr);
+
+ ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ if (ret < 0)
+ warning ("unable to store floating-point registers");
+}
+
+void
+store_inferior_registers (int regno)
+{
+ if (regno >= 0)
+ {
+ if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
+ store_register (regno);
+ else
+ store_fp_register (regno);
+ }
+ else
+ {
+ store_regs ();
+ store_fp_regs ();
+ }
+}
+
+struct md_core
+{
+ struct reg intreg;
+ struct fpreg freg;
+};
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR ignore)
+{
+ struct md_core *core_reg = (struct md_core *) core_reg_sect;
+ int regno;
+ CORE_ADDR r_pc;
+
+ supply_gregset (&core_reg->intreg);
+ supply_fparegset (&core_reg->freg);
+}
+
+static void
+fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR ignore)
+{
+ struct reg gregset;
+ struct fpreg fparegset;
+
+ switch (which)
+ {
+ case 0: /* Integer registers. */
+ if (core_reg_size != sizeof (struct reg))
+ warning ("wrong size of register set in core file");
+ else
+ {
+ /* The memcpy may be unnecessary, but we can't really be sure
+ of the alignment of the data in the core file. */
+ memcpy (&gregset, core_reg_sect, sizeof (gregset));
+ supply_gregset (&gregset);
+ }
+ break;
+
+ case 2:
+ if (core_reg_size != sizeof (struct fpreg))
+ warning ("wrong size of FPA register set in core file");
+ else
+ {
+ /* The memcpy may be unnecessary, but we can't really be sure
+ of the alignment of the data in the core file. */
+ memcpy (&fparegset, core_reg_sect, sizeof (fparegset));
+ supply_fparegset (&fparegset);
+ }
+ break;
+
+ default:
+ /* Don't know what kind of register request this is; just ignore it. */
+ break;
+ }
+}
+
+static struct core_fns arm_netbsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flovour. */
+ default_check_format, /* check_format. */
+ default_core_sniffer, /* core_sniffer. */
+ fetch_core_registers, /* core_read_registers. */
+ NULL
+};
+
+static struct core_fns arm_netbsd_elfcore_fns =
+{
+ bfd_target_elf_flavour, /* core_flovour. */
+ default_check_format, /* check_format. */
+ default_core_sniffer, /* core_sniffer. */
+ fetch_elfcore_registers, /* core_read_registers. */
+ NULL
+};
+
+void
+_initialize_arm_netbsd_nat (void)
+{
+ add_core_fns (&arm_netbsd_core_fns);
+ add_core_fns (&arm_netbsd_elfcore_fns);
+}
diff --git a/contrib/gdb/gdb/armnbsd-tdep.c b/contrib/gdb/gdb/armnbsd-tdep.c
new file mode 100644
index 0000000..7f6e639
--- /dev/null
+++ b/contrib/gdb/gdb/armnbsd-tdep.c
@@ -0,0 +1,85 @@
+/* Target-specific functions for ARM running under NetBSD.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "arm-tdep.h"
+
+/* Description of the longjmp buffer. */
+#define JB_PC 24
+#define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
+
+/* For compatibility with previous implemenations of GDB on arm/NetBSD,
+ override the default little-endian breakpoint. */
+static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6};
+
+static int
+arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ if (strcmp (name, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+ return 1;
+
+ return 0;
+}
+
+static void
+arm_netbsd_init_abi_common (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ tdep->lowest_pc = 0x8000;
+ tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;
+ tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint);
+
+ tdep->jb_pc = JB_PC;
+ tdep->jb_elt_size = JB_ELEMENT_SIZE;
+}
+
+static void
+arm_netbsd_aout_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ arm_netbsd_init_abi_common (info, gdbarch);
+
+ set_gdbarch_in_solib_call_trampoline
+ (gdbarch, arm_netbsd_aout_in_solib_call_trampoline);
+ tdep->fp_model = ARM_FLOAT_SOFT;
+}
+
+static void
+arm_netbsd_elf_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ arm_netbsd_init_abi_common (info, gdbarch);
+
+ tdep->fp_model = ARM_FLOAT_SOFT_VFP;
+}
+
+void
+_initialize_arm_netbsd_tdep (void)
+{
+ arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_AOUT, arm_netbsd_aout_init_abi);
+ arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_ELF, arm_netbsd_elf_init_abi);
+}
diff --git a/contrib/gdb/gdb/ax-gdb.c b/contrib/gdb/gdb/ax-gdb.c
index 55cc856..aa9f92a 100644
--- a/contrib/gdb/gdb/ax-gdb.c
+++ b/contrib/gdb/gdb/ax-gdb.c
@@ -1,23 +1,22 @@
/* GDB-specific functions for operating on agent expressions
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* $Id: ax-gdb.c,v 1.8 1998/12/03 05:34:24 cagney Exp $ */
+ You should have received a copy of the GNU General Public License
+ 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,10 +31,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ax.h"
#include "ax-gdb.h"
-/* Probably the best way to read this file is to start with the types
- and enums in ax-gdb.h, and then look at gen_expr, towards the
- bottom; that's the main function that looks at the GDB expressions
- and calls everything else to generate code.
+/* To make sense of this file, you should read doc/agentexpr.texi.
+ Then look at the types and enums in ax-gdb.h. For the code itself,
+ look at gen_expr, towards the bottom; that's the main function that
+ looks at the GDB expressions and calls everything else to generate
+ code.
I'm beginning to wonder whether it wouldn't be nicer to internally
generate trees, with types, and then spit out the bytecode in
@@ -45,114 +45,94 @@ 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. */
+
-
/* Prototypes for local functions. */
/* There's a standard order to the arguments of these functions:
union exp_element ** --- pointer into expression
struct agent_expr * --- agent expression buffer to generate code into
struct axs_value * --- describes value left on top of stack */
-
-static struct value *const_var_ref PARAMS ((struct symbol *var));
-static struct value *const_expr PARAMS ((union exp_element **pc));
-static struct value *maybe_const_expr PARAMS ((union exp_element **pc));
-
-static void gen_traced_pop PARAMS ((struct agent_expr *, struct axs_value *));
-
-static void gen_sign_extend PARAMS ((struct agent_expr *, struct type *));
-static void gen_extend PARAMS ((struct agent_expr *, struct type *));
-static void gen_fetch PARAMS ((struct agent_expr *, struct type *));
-static void gen_left_shift PARAMS ((struct agent_expr *, int));
-
-
-static void gen_frame_args_address PARAMS ((struct agent_expr *));
-static void gen_frame_locals_address PARAMS ((struct agent_expr *));
-static void gen_offset PARAMS ((struct agent_expr *ax, int offset));
-static void gen_sym_offset PARAMS ((struct agent_expr *, struct symbol *));
-static void gen_var_ref PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct symbol *var));
-
-
-static void gen_int_literal PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- LONGEST k, struct type *type));
-
-
-static void require_rvalue PARAMS ((struct agent_expr *ax,
- struct axs_value *value));
-static void gen_usual_unary PARAMS ((struct agent_expr *ax,
- struct axs_value *value));
-static int type_wider_than PARAMS ((struct type *type1,
- struct type *type2));
-static struct type *max_type PARAMS ((struct type *type1,
- struct type *type2));
-static void gen_conversion PARAMS ((struct agent_expr *ax,
- struct type *from,
- struct type *to));
-static int is_nontrivial_conversion PARAMS ((struct type *from,
- struct type *to));
-static void gen_usual_arithmetic PARAMS ((struct agent_expr *ax,
- struct axs_value *value1,
- struct axs_value *value2));
-static void gen_integral_promotions PARAMS ((struct agent_expr *ax,
- struct axs_value *value));
-static void gen_cast PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct type *type));
-static void gen_scale PARAMS ((struct agent_expr *ax,
- enum agent_op op,
- struct type *type));
-static void gen_add PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct axs_value *value1,
- struct axs_value *value2,
- char *name));
-static void gen_sub PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct axs_value *value1,
- struct axs_value *value2));
-static void gen_binop PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct axs_value *value1,
- struct axs_value *value2,
- enum agent_op op,
- enum agent_op op_unsigned,
- int may_carry,
- char *name));
-static void gen_logical_not PARAMS ((struct agent_expr *ax,
- struct axs_value *value));
-static void gen_complement PARAMS ((struct agent_expr *ax,
- struct axs_value *value));
-static void gen_deref PARAMS ((struct agent_expr *, struct axs_value *));
-static void gen_address_of PARAMS ((struct agent_expr *, struct axs_value *));
-static int find_field PARAMS ((struct type *type, char *name));
-static void gen_bitfield_ref PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- struct type *type,
- int start, int end));
-static void gen_struct_ref PARAMS ((struct agent_expr *ax,
- struct axs_value *value,
- char *field,
- char *operator_name,
- char *operand_name));
-static void gen_repeat PARAMS ((union exp_element **pc,
- struct agent_expr *ax,
- struct axs_value *value));
-static void gen_sizeof PARAMS ((union exp_element **pc,
- struct agent_expr *ax,
- struct axs_value *value));
-static void gen_expr PARAMS ((union exp_element **pc,
- struct agent_expr *ax,
- struct axs_value *value));
-
-static void print_axs_value PARAMS ((GDB_FILE *f, struct axs_value *value));
-static void agent_command PARAMS ((char *exp, int from_tty));
+static struct value *const_var_ref (struct symbol *var);
+static struct value *const_expr (union exp_element **pc);
+static struct value *maybe_const_expr (union exp_element **pc);
+
+static void gen_traced_pop (struct agent_expr *, struct axs_value *);
+
+static void gen_sign_extend (struct agent_expr *, struct type *);
+static void gen_extend (struct agent_expr *, struct type *);
+static void gen_fetch (struct agent_expr *, struct type *);
+static void gen_left_shift (struct agent_expr *, int);
+
+
+static void gen_frame_args_address (struct agent_expr *);
+static void gen_frame_locals_address (struct agent_expr *);
+static void gen_offset (struct agent_expr *ax, int offset);
+static void gen_sym_offset (struct agent_expr *, struct symbol *);
+static void gen_var_ref (struct agent_expr *ax,
+ struct axs_value *value, struct symbol *var);
+
+
+static void gen_int_literal (struct agent_expr *ax,
+ struct axs_value *value,
+ LONGEST k, struct type *type);
+
+
+static void require_rvalue (struct agent_expr *ax, struct axs_value *value);
+static void gen_usual_unary (struct agent_expr *ax, struct axs_value *value);
+static int type_wider_than (struct type *type1, struct type *type2);
+static struct type *max_type (struct type *type1, struct type *type2);
+static void gen_conversion (struct agent_expr *ax,
+ struct type *from, struct type *to);
+static int is_nontrivial_conversion (struct type *from, struct type *to);
+static void gen_usual_arithmetic (struct agent_expr *ax,
+ struct axs_value *value1,
+ struct axs_value *value2);
+static void gen_integral_promotions (struct agent_expr *ax,
+ struct axs_value *value);
+static void gen_cast (struct agent_expr *ax,
+ struct axs_value *value, struct type *type);
+static void gen_scale (struct agent_expr *ax,
+ enum agent_op op, struct type *type);
+static void gen_add (struct agent_expr *ax,
+ struct axs_value *value,
+ struct axs_value *value1,
+ struct axs_value *value2, char *name);
+static void gen_sub (struct agent_expr *ax,
+ struct axs_value *value,
+ struct axs_value *value1, struct axs_value *value2);
+static void gen_binop (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 (struct agent_expr *ax, struct axs_value *value);
+static void gen_complement (struct agent_expr *ax, struct axs_value *value);
+static void gen_deref (struct agent_expr *, struct axs_value *);
+static void gen_address_of (struct agent_expr *, struct axs_value *);
+static int find_field (struct type *type, char *name);
+static void gen_bitfield_ref (struct agent_expr *ax,
+ struct axs_value *value,
+ struct type *type, int start, int end);
+static void gen_struct_ref (struct agent_expr *ax,
+ struct axs_value *value,
+ char *field,
+ char *operator_name, char *operand_name);
+static void gen_repeat (union exp_element **pc,
+ struct agent_expr *ax, struct axs_value *value);
+static void gen_sizeof (union exp_element **pc,
+ struct agent_expr *ax, struct axs_value *value);
+static void gen_expr (union exp_element **pc,
+ struct agent_expr *ax, struct axs_value *value);
+
+static void print_axs_value (struct ui_file *f, struct axs_value * value);
+static void agent_command (char *exp, int from_tty);
+
/* Detecting constant expressions. */
/* If the variable reference at *PC is a constant, return its value.
@@ -174,8 +154,7 @@ static void agent_command PARAMS ((char *exp, int from_tty));
proletariat? */
static struct value *
-const_var_ref (var)
- struct symbol *var;
+const_var_ref (struct symbol *var)
{
struct type *type = SYMBOL_TYPE (var);
@@ -185,7 +164,7 @@ const_var_ref (var)
return value_from_longest (type, (LONGEST) SYMBOL_VALUE (var));
case LOC_LABEL:
- return value_from_longest (type, (LONGEST) SYMBOL_VALUE_ADDRESS (var));
+ return value_from_pointer (type, (CORE_ADDR) SYMBOL_VALUE_ADDRESS (var));
default:
return 0;
@@ -198,8 +177,7 @@ const_var_ref (var)
advanced to the end of it. If we return zero, *PC could be
anywhere. */
static struct value *
-const_expr (pc)
- union exp_element **pc;
+const_expr (union exp_element **pc)
{
enum exp_opcode op = (*pc)->opcode;
struct value *v1;
@@ -221,7 +199,7 @@ const_expr (pc)
return v;
}
- /* We could add more operators in here. */
+ /* We could add more operators in here. */
case UNOP_NEG:
(*pc)++;
@@ -240,8 +218,7 @@ const_expr (pc)
/* Like const_expr, but guarantee also that *PC is undisturbed if the
expression is not constant. */
static struct value *
-maybe_const_expr (pc)
- union exp_element **pc;
+maybe_const_expr (union exp_element **pc)
{
union exp_element *tentative_pc = *pc;
struct value *v = const_expr (&tentative_pc);
@@ -249,11 +226,11 @@ maybe_const_expr (pc)
/* If we got a value, then update the real PC. */
if (v)
*pc = tentative_pc;
-
+
return v;
}
-
+
/* Generating bytecode from GDB expressions: general assumptions */
/* Here are a few general assumptions made throughout the code; if you
@@ -261,43 +238,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.) */
+
/* Generating bytecode from GDB expressions: the `trace' kludge */
/* The compiler in this file is a general-purpose mechanism for
@@ -327,16 +304,14 @@ static int trace_kludge;
the value. Useful on the left side of a comma, and at the end of
an expression being used for tracing. */
static void
-gen_traced_pop (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
{
if (trace_kludge)
switch (value->kind)
{
case axs_rvalue:
/* We don't trace rvalues, just the lvalues necessary to
- produce them. So just dispose of this value. */
+ produce them. So just dispose of this value. */
ax_simple (ax, aop_pop);
break;
@@ -352,7 +327,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,
@@ -366,20 +341,18 @@ gen_traced_pop (ax, value)
/* If we're not tracing, just pop the value. */
ax_simple (ax, aop_pop);
}
+
-
/* Generating bytecode from GDB expressions: helper functions */
/* Assume that the lower bits of the top of the stack is a value of
type TYPE, and the upper bits are zero. Sign-extend if necessary. */
static void
-gen_sign_extend (ax, type)
- struct agent_expr *ax;
- struct type *type;
+gen_sign_extend (struct agent_expr *ax, 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);
}
@@ -388,9 +361,7 @@ gen_sign_extend (ax, type)
TYPE, and the upper bits are garbage. Sign-extend or truncate as
needed. */
static void
-gen_extend (ax, type)
- struct agent_expr *ax;
- struct type *type;
+gen_extend (struct agent_expr *ax, struct type *type)
{
int bits = type->length * TARGET_CHAR_BIT;
/* I just had to. */
@@ -402,9 +373,7 @@ gen_extend (ax, type)
to TYPE"; generate code to fetch its value. Note that TYPE is the
target type, not the pointer type. */
static void
-gen_fetch (ax, type)
- struct agent_expr *ax;
- struct type *type;
+gen_fetch (struct agent_expr *ax, struct type *type)
{
if (trace_kludge)
{
@@ -422,17 +391,26 @@ 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
implementing something we should be (this code's fault).
In any case, it's a bug the user shouldn't see. */
default:
- error ("GDB bug: ax-gdb.c (gen_fetch): strange size");
+ internal_error (__FILE__, __LINE__,
+ "gen_fetch: strange size");
}
gen_sign_extend (ax, type);
@@ -440,10 +418,11 @@ 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. */
- error ("GDB bug: ax-gdb.c (gen_fetch): bad type code");
+ 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. */
+ internal_error (__FILE__, __LINE__,
+ "gen_fetch: bad type code");
}
}
@@ -452,9 +431,7 @@ gen_fetch (ax, type)
right shift it by -DISTANCE bits if DISTANCE < 0. This generates
unsigned (logical) right shifts. */
static void
-gen_left_shift (ax, distance)
- struct agent_expr *ax;
- int distance;
+gen_left_shift (struct agent_expr *ax, int distance)
{
if (distance > 0)
{
@@ -467,21 +444,21 @@ gen_left_shift (ax, distance)
ax_simple (ax, aop_rsh_unsigned);
}
}
+
-
/* Generating bytecode from GDB expressions: symbol references */
/* Generate code to push the base address of the argument portion of
the top stack frame. */
static void
-gen_frame_args_address (ax)
- struct agent_expr *ax;
+gen_frame_args_address (struct agent_expr *ax)
{
- long frame_reg, frame_offset;
+ int frame_reg;
+ LONGEST 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);
}
@@ -489,13 +466,13 @@ gen_frame_args_address (ax)
/* Generate code to push the base address of the locals portion of the
top stack frame. */
static void
-gen_frame_locals_address (ax)
- struct agent_expr *ax;
+gen_frame_locals_address (struct agent_expr *ax)
{
- long frame_reg, frame_offset;
+ int frame_reg;
+ LONGEST 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);
}
@@ -506,9 +483,7 @@ gen_frame_locals_address (ax)
programming in ML, it would be clearer why these are the same
thing. */
static void
-gen_offset (ax, offset)
- struct agent_expr *ax;
- int offset;
+gen_offset (struct agent_expr *ax, int offset)
{
/* It would suffice to simply push the offset and add it, but this
makes it easier to read positive and negative offsets in the
@@ -530,9 +505,7 @@ gen_offset (ax, offset)
address (stack frame, base register, etc.) Generate code to add
VAR's value to the top of the stack. */
static void
-gen_sym_offset (ax, var)
- struct agent_expr *ax;
- struct symbol *var;
+gen_sym_offset (struct agent_expr *ax, struct symbol *var)
{
gen_offset (ax, SYMBOL_VALUE (var));
}
@@ -542,10 +515,7 @@ gen_sym_offset (ax, var)
symbol VAR. Set VALUE to describe the result. */
static void
-gen_var_ref (ax, value, var)
- struct agent_expr *ax;
- struct axs_value *value;
- struct symbol *var;
+gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
{
/* Dereference any typedefs. */
value->type = check_typedef (SYMBOL_TYPE (var));
@@ -564,7 +534,8 @@ gen_var_ref (ax, value, var)
break;
case LOC_CONST_BYTES:
- error ("GDB bug: ax-gdb.c (gen_var_ref): LOC_CONST_BYTES symbols are not supported");
+ internal_error (__FILE__, __LINE__,
+ "gen_var_ref: LOC_CONST_BYTES symbols are not supported");
/* Variable at a fixed location in memory. Easy. */
case LOC_STATIC:
@@ -622,9 +593,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;
@@ -632,16 +603,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.",
@@ -654,34 +625,29 @@ gen_var_ref (ax, value, var)
break;
}
}
+
-
/* Generating bytecode from GDB expressions: literals */
static void
-gen_int_literal (ax, value, k, type)
- struct agent_expr *ax;
- struct axs_value *value;
- LONGEST k;
- struct type *type;
+gen_int_literal (struct agent_expr *ax, struct axs_value *value, LONGEST k,
+ struct type *type)
{
ax_const_l (ax, k);
value->kind = axs_rvalue;
value->type = type;
}
+
-
/* Generating bytecode from GDB expressions: unary conversions, casts */
/* Take what's on the top of the stack (as described by VALUE), and
try to make an rvalue out of it. Signal an error if we can't do
that. */
static void
-require_rvalue (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+require_rvalue (struct agent_expr *ax, struct axs_value *value)
{
switch (value->kind)
{
@@ -698,8 +664,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;
@@ -726,9 +692,7 @@ require_rvalue (ax, value)
lvalue through unchanged, and let `+' raise an error. */
static void
-gen_usual_unary (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
{
/* We don't have to generate any code for the usual integral
conversions, since values are always represented as full-width on
@@ -744,7 +708,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);
@@ -753,10 +717,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;
@@ -775,20 +739,18 @@ gen_usual_unary (ax, value)
/* Return non-zero iff the type TYPE1 is considered "wider" than the
type TYPE2, according to the rules described in gen_usual_arithmetic. */
static int
-type_wider_than (type1, type2)
- struct type *type1, *type2;
+type_wider_than (struct type *type1, struct type *type2)
{
return (TYPE_LENGTH (type1) > TYPE_LENGTH (type2)
|| (TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
&& TYPE_UNSIGNED (type1)
- && ! TYPE_UNSIGNED (type2)));
+ && !TYPE_UNSIGNED (type2)));
}
/* Return the "wider" of the two types TYPE1 and TYPE2. */
static struct type *
-max_type (type1, type2)
- struct type *type1, *type2;
+max_type (struct type *type1, struct type *type2)
{
return type_wider_than (type1, type2) ? type1 : type2;
}
@@ -796,9 +758,7 @@ max_type (type1, type2)
/* Generate code to convert a scalar value of type FROM to type TO. */
static void
-gen_conversion (ax, from, to)
- struct agent_expr *ax;
- struct type *from, *to;
+gen_conversion (struct agent_expr *ax, struct type *from, struct type *to)
{
/* Perhaps there is a more graceful way to state these rules. */
@@ -828,8 +788,7 @@ gen_conversion (ax, from, to)
/* Return non-zero iff the type FROM will require any bytecodes to be
emitted to be converted to the type TO. */
static int
-is_nontrivial_conversion (from, to)
- struct type *from, *to;
+is_nontrivial_conversion (struct type *from, struct type *to)
{
struct agent_expr *ax = new_agent_expr (0);
int nontrivial;
@@ -853,19 +812,18 @@ is_nontrivial_conversion (from, to)
and promotes each argument to that type. *VALUE1 and *VALUE2
describe the values as they are passed in, and as they are left. */
static void
-gen_usual_arithmetic (ax, value1, value2)
- struct agent_expr *ax;
- struct axs_value *value1, *value2;
+gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
+ struct axs_value *value2)
{
/* Do the usual binary conversions. */
if (TYPE_CODE (value1->type) == TYPE_CODE_INT
&& TYPE_CODE (value2->type) == TYPE_CODE_INT)
{
/* The ANSI integral promotions seem to work this way: Order the
- integer types by size, and then by signedness: an n-bit
- unsigned type is considered "wider" than an n-bit signed
- type. Promote to the "wider" of the two types, and always
- promote at least to int. */
+ 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));
@@ -891,16 +849,14 @@ gen_usual_arithmetic (ax, value1, value2)
the value on the top of the stack, as described by VALUE. Assume
the value has integral type. */
static void
-gen_integral_promotions (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_integral_promotions (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;
@@ -910,10 +866,7 @@ gen_integral_promotions (ax, value)
/* Generate code for a cast to TYPE. */
static void
-gen_cast (ax, value, type)
- struct agent_expr *ax;
- struct axs_value *value;
- struct type *type;
+gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
{
/* GCC does allow casts to yield lvalues, so this should be fixed
before merging these changes into the trunk. */
@@ -942,16 +895,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:
@@ -960,18 +913,15 @@ gen_cast (ax, value, type)
value->type = type;
}
+
-
/* Generating bytecode from GDB expressions: arithmetic */
/* Scale the integer on the top of the stack by the size of the target
of the pointer type TYPE. */
static void
-gen_scale (ax, op, type)
- struct agent_expr *ax;
- enum agent_op op;
- struct type *type;
+gen_scale (struct agent_expr *ax, enum agent_op op, struct type *type)
{
struct type *element = TYPE_TARGET_TYPE (type);
@@ -989,10 +939,8 @@ gen_scale (ax, op, type)
they've undergone the usual binary conversions. Used by both
BINOP_ADD and BINOP_SUBSCRIPT. NAME is used in error messages. */
static void
-gen_add (ax, value, value1, value2, name)
- struct agent_expr *ax;
- struct axs_value *value, *value1, *value2;
- char *name;
+gen_add (struct agent_expr *ax, struct axs_value *value,
+ struct axs_value *value1, struct axs_value *value2, char *name)
{
/* Is it INT+PTR? */
if (value1->type->code == TYPE_CODE_INT
@@ -1002,7 +950,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;
}
@@ -1012,7 +960,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;
}
@@ -1022,7 +970,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;
}
@@ -1038,12 +986,9 @@ gen_add (ax, value, value1, value2, name)
value; we assume VALUE1 and VALUE2 describe the two operands, and
that they've undergone the usual binary conversions. */
static void
-gen_sub (ax, value, value1, value2)
- struct agent_expr *ax;
- struct axs_value *value, *value1, *value2;
+gen_sub (struct agent_expr *ax, struct axs_value *value,
+ struct axs_value *value1, struct axs_value *value2)
{
- struct type *element;
-
if (value1->type->code == TYPE_CODE_PTR)
{
/* Is it PTR - INT? */
@@ -1051,20 +996,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 ("\
@@ -1077,10 +1022,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.");
@@ -1094,31 +1039,26 @@ an integer nor a pointer of the same type.");
result needs to be extended. NAME is the English name of the
operator, used in error messages */
static void
-gen_binop (ax, value, value1, value2, op, op_unsigned, may_carry, name)
- struct agent_expr *ax;
- struct axs_value *value, *value1, *value2;
- enum agent_op op, op_unsigned;
- int may_carry;
- char *name;
+gen_binop (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)
{
/* We only handle INT op INT. */
if ((value1->type->code != TYPE_CODE_INT)
|| (value2->type->code != TYPE_CODE_INT))
error ("Illegal combination of types in %s.", name);
-
+
ax_simple (ax,
TYPE_UNSIGNED (value1->type) ? op_unsigned : op);
if (may_carry)
- gen_extend (ax, value1->type); /* catch overflow */
+ gen_extend (ax, value1->type); /* catch overflow */
value->type = value1->type;
value->kind = axs_rvalue;
}
static void
-gen_logical_not (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_logical_not (struct agent_expr *ax, struct axs_value *value)
{
if (TYPE_CODE (value->type) != TYPE_CODE_INT
&& TYPE_CODE (value->type) != TYPE_CODE_PTR)
@@ -1131,9 +1071,7 @@ gen_logical_not (ax, value)
static void
-gen_complement (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_complement (struct agent_expr *ax, struct axs_value *value)
{
if (TYPE_CODE (value->type) != TYPE_CODE_INT)
error ("Illegal type of operand to `~'.");
@@ -1143,21 +1081,20 @@ gen_complement (ax, value)
ax_simple (ax, aop_bit_not);
gen_extend (ax, value->type);
}
+
-
/* Generating bytecode from GDB expressions: * & . -> @ sizeof */
/* Dereference the value on the top of the stack. */
static void
-gen_deref (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_deref (struct agent_expr *ax, struct axs_value *value)
{
/* The caller should check the type, because several operators use
this, and we don't know what error message to generate. */
if (value->type->code != TYPE_CODE_PTR)
- error ("GDB bug: ax-gdb.c (gen_deref): expected a pointer");
+ internal_error (__FILE__, __LINE__,
+ "gen_deref: expected a pointer");
/* We've got an rvalue now, which is a pointer. We want to yield an
lvalue, whose address is exactly that pointer. So we don't
@@ -1172,9 +1109,7 @@ gen_deref (ax, value)
/* Produce the address of the lvalue on the top of the stack. */
static void
-gen_address_of (ax, value)
- struct agent_expr *ax;
- struct axs_value *value;
+gen_address_of (struct agent_expr *ax, struct axs_value *value)
{
/* Special case for taking the address of a function. The ANSI
standard describes this as a special case, too, so this
@@ -1206,9 +1141,7 @@ gen_address_of (ax, value)
/* Find the field in the structure type TYPE named NAME, and return
its index in TYPE's field array. */
static int
-find_field (type, name)
- struct type *type;
- char *name;
+find_field (struct type *type, char *name)
{
int i;
@@ -1216,7 +1149,8 @@ find_field (type, name)
/* Make sure this isn't C++. */
if (TYPE_N_BASECLASSES (type) != 0)
- error ("GDB bug: ax-gdb.c (find_field): derived classes supported");
+ internal_error (__FILE__, __LINE__,
+ "find_field: derived classes supported");
for (i = 0; i < TYPE_NFIELDS (type); i++)
{
@@ -1226,11 +1160,12 @@ find_field (type, name)
return i;
if (this_name[0] == '\0')
- error ("GDB bug: ax-gdb.c (find_field): anonymous unions not supported");
+ internal_error (__FILE__, __LINE__,
+ "find_field: anonymous unions not supported");
}
error ("Couldn't find member named `%s' in struct/union `%s'",
- name, type->tag_name);
+ name, TYPE_TAG_NAME (type));
return 0;
}
@@ -1241,15 +1176,13 @@ find_field (type, name)
starting and one-past-ending *bit* numbers of the field within the
structure. */
static void
-gen_bitfield_ref (ax, value, type, start, end)
- struct agent_expr *ax;
- struct axs_value *value;
- struct type *type;
- int start, end;
+gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
+ struct type *type, int start, int 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
@@ -1260,19 +1193,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,
@@ -1281,9 +1214,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;
@@ -1300,7 +1233,8 @@ gen_bitfield_ref (ax, value, type, start, end)
/* Can we fetch the number of bits requested at all? */
if ((end - start) > ((1 << num_ops) * 8))
- error ("GDB bug: ax-gdb.c (gen_bitfield_ref): bitfield too wide");
+ internal_error (__FILE__, __LINE__,
+ "gen_bitfield_ref: bitfield too wide");
/* Note that we know here that we only need to try each opcode once.
That may not be true on machines with weird byte sizes. */
@@ -1312,17 +1246,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);
@@ -1334,47 +1268,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. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ 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 == BFD_ENDIAN_BIG)
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);
@@ -1403,12 +1337,8 @@ gen_bitfield_ref (ax, value, type, start, end)
the operator being compiled, and OPERAND_NAME is the kind of thing
it operates on; we use them in error messages. */
static void
-gen_struct_ref (ax, value, field, operator_name, operand_name)
- struct agent_expr *ax;
- struct axs_value *value;
- char *field;
- char *operator_name;
- char *operand_name;
+gen_struct_ref (struct agent_expr *ax, struct axs_value *value, char *field,
+ char *operator_name, char *operand_name)
{
struct type *type;
int i;
@@ -1421,7 +1351,7 @@ gen_struct_ref (ax, value, field, operator_name, operand_name)
gen_usual_unary (ax, value);
gen_deref (ax, value);
}
- type = value->type;
+ type = check_typedef (value->type);
/* This must yield a structure or a union. */
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
@@ -1435,7 +1365,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),
@@ -1463,10 +1393,8 @@ gen_struct_ref (ax, value, field, operator_name, operand_name)
stack slots, doing weird things with sizeof, etc. So we require
the right operand to be a constant expression. */
static void
-gen_repeat (pc, ax, value)
- union exp_element **pc;
- struct agent_expr *ax;
- struct axs_value *value;
+gen_repeat (union exp_element **pc, struct agent_expr *ax,
+ struct axs_value *value)
{
struct axs_value value1;
/* We don't want to turn this into an rvalue, so no conversions
@@ -1480,7 +1408,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.");
@@ -1492,9 +1420,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;
@@ -1508,10 +1436,8 @@ gen_repeat (pc, ax, value)
*PC should point at the start of the operand expression; we advance it
to the first instruction after the operand. */
static void
-gen_sizeof (pc, ax, value)
- union exp_element **pc;
- struct agent_expr *ax;
- struct axs_value *value;
+gen_sizeof (union exp_element **pc, struct agent_expr *ax,
+ struct axs_value *value)
{
/* We don't care about the value of the operand expression; we only
care about its type. However, in the current arrangement, the
@@ -1523,22 +1449,20 @@ 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;
}
-
+
/* Generating bytecode from GDB expressions: general recursive thingy */
/* A gen_expr function written by a Gen-X'er guy.
Append code for the subexpression of EXPR starting at *POS_P to AX. */
static void
-gen_expr (pc, ax, value)
- union exp_element **pc;
- struct agent_expr *ax;
- struct axs_value *value;
+gen_expr (union exp_element **pc, struct agent_expr *ax,
+ struct axs_value *value)
{
/* Used to hold the descriptions of operand expressions. */
struct axs_value value1, value2;
@@ -1547,7 +1471,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));
@@ -1619,28 +1543,29 @@ 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. */
- error ("GDB bug: ax-gdb.c (gen_expr): op case sets don't match");
+ that we actually handle in the inner case statement. */
+ internal_error (__FILE__, __LINE__,
+ "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;
@@ -1648,7 +1573,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);
@@ -1663,12 +1588,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)++;
@@ -1682,7 +1607,7 @@ gen_expr (pc, ax, value)
gen_expr (pc, ax, value);
gen_cast (ax, value, type);
}
- break;
+ break;
case UNOP_MEMVAL:
{
@@ -1695,17 +1620,18 @@ gen_expr (pc, ax, value)
the given type, and dereference it. */
if (value->kind != axs_rvalue)
/* This would be weird. */
- error ("GDB bug: ax-gdb.c (gen_expr): OP_MEMVAL operand isn't an rvalue???");
+ internal_error (__FILE__, __LINE__,
+ "gen_expr: OP_MEMVAL operand isn't an rvalue???");
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);
@@ -1742,8 +1668,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;
@@ -1762,10 +1688,11 @@ 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. */
- error ("GDB bug: ax-gdb.c (gen_expr): unhandled struct case");
+ shouldn't mention it, and we shouldn't be here. */
+ internal_error (__FILE__, __LINE__,
+ "gen_expr: unhandled struct case");
}
- break;
+ break;
case OP_TYPE:
error ("Attempt to use a type name as an expression.");
@@ -1774,25 +1701,22 @@ gen_expr (pc, ax, value)
error ("Unsupported operator in expression.");
}
}
-
-
-#if 0 /* not used */
+
+
/* Generating bytecode from GDB expressions: driver */
/* Given a GDB expression EXPR, produce a string of agent bytecode
which computes its value. Return the agent expression, and set
*VALUE to describe its type, and whether it's an lvalue or rvalue. */
struct agent_expr *
-expr_to_agent (expr, value)
- struct expression *expr;
- struct axs_value *value;
+expr_to_agent (struct expression *expr, struct axs_value *value)
{
struct cleanup *old_chain = 0;
- struct agent_expr *ax = new_agent_expr ();
+ struct agent_expr *ax = new_agent_expr (0);
union exp_element *pc;
- old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
+ old_chain = make_cleanup_free_agent_expr (ax);
pc = expr->elts;
trace_kludge = 0;
@@ -1806,14 +1730,14 @@ expr_to_agent (expr, value)
}
+#if 0 /* not used */
/* Given a GDB expression EXPR denoting an lvalue in memory, produce a
string of agent bytecode which will leave its address and size on
the top of stack. Return the agent expression.
Not sure this function is useful at all. */
struct agent_expr *
-expr_to_address_and_size (expr)
- struct expression *expr;
+expr_to_address_and_size (struct expression *expr)
{
struct axs_value value;
struct agent_expr *ax = expr_to_agent (expr, &value);
@@ -1830,7 +1754,7 @@ expr_to_address_and_size (expr)
return ax;
}
-#endif /* 0 */
+#endif
/* Given a GDB expression EXPR, return bytecode to trace its value.
The result will use the `trace' and `trace_quick' bytecodes to
@@ -1838,16 +1762,14 @@ expr_to_address_and_size (expr)
caller can then use the ax_reqs function to discover which
registers it relies upon. */
struct agent_expr *
-gen_trace_for_expr (scope, expr)
- CORE_ADDR scope;
- struct expression *expr;
+gen_trace_for_expr (CORE_ADDR scope, struct expression *expr)
{
struct cleanup *old_chain = 0;
struct agent_expr *ax = new_agent_expr (scope);
union exp_element *pc;
struct axs_value value;
- old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
+ old_chain = make_cleanup_free_agent_expr (ax);
pc = expr->elts;
trace_kludge = 1;
@@ -1865,15 +1787,13 @@ gen_trace_for_expr (scope, expr)
discard_cleanups (old_chain);
return ax;
}
+
-
/* The "agent" command, for testing: compile and disassemble an expression. */
static void
-print_axs_value (f, value)
- GDB_FILE *f;
- struct axs_value *value;
+print_axs_value (struct ui_file *f, struct axs_value *value)
{
switch (value->kind)
{
@@ -1896,14 +1816,11 @@ print_axs_value (f, value)
static void
-agent_command (exp, from_tty)
- char *exp;
- int from_tty;
+agent_command (char *exp, int from_tty)
{
struct cleanup *old_chain = 0;
struct expression *expr;
struct agent_expr *agent;
- struct agent_reqs reqs;
struct frame_info *fi = get_current_frame (); /* need current scope */
/* We don't deal with overlay debugging at the moment. We need to
@@ -1915,27 +1832,27 @@ 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);
+ old_chain = make_cleanup (free_current_contents, &expr);
agent = gen_trace_for_expr (fi->pc, expr);
- make_cleanup ((make_cleanup_func) free_agent_expr, agent);
+ make_cleanup_free_agent_expr (agent);
ax_print (gdb_stdout, agent);
- ax_reqs (agent, &reqs);
+
+ /* It would be nice to call ax_reqs here to gather some general info
+ about the expression, and then print out the result. */
do_cleanups (old_chain);
dont_repeat ();
}
-
+
/* Initialization code. */
-void _initialize_ax_gdb PARAMS ((void));
+void _initialize_ax_gdb (void);
void
-_initialize_ax_gdb ()
+_initialize_ax_gdb (void)
{
- struct cmd_list_element *c;
-
add_cmd ("agent", class_maintenance, agent_command,
"Translate an expression into remote agent bytecode.",
&maintenancelist);
diff --git a/contrib/gdb/gdb/ax-gdb.h b/contrib/gdb/gdb/ax-gdb.h
index 575b4bf..3e1006a 100644
--- a/contrib/gdb/gdb/ax-gdb.h
+++ b/contrib/gdb/gdb/ax-gdb.h
@@ -1,28 +1,27 @@
/* GDB-specific functions for operating on agent expressions
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* $Id: ax-gdb.h,v 1.3.20.1 1999/04/01 17:33:04 jimb Exp $ */
+ You should have received a copy of the GNU General Public 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
-
+
/* Types and enums */
/* GDB stores expressions in the form of a flattened tree (struct
@@ -50,62 +49,64 @@ 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;
+ };
+
/* 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 (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));
+extern struct agent_expr *expr_to_address_and_size (struct expression *EXPR);
/* Given a GDB expression EXPR, return bytecode to trace its value.
The result will use the `trace' and `trace_quick' bytecodes to
record the value of all memory touched by the expression, and leave
no values on the stack. The caller can then use the ax_reqs
function to discover which registers the expression uses. */
-extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR,
- struct expression *));
+extern struct agent_expr *gen_trace_for_expr (CORE_ADDR, struct expression *);
#endif /* AX_GDB_H */
diff --git a/contrib/gdb/gdb/ax-general.c b/contrib/gdb/gdb/ax-general.c
index 6f399a8..9451837 100644
--- a/contrib/gdb/gdb/ax-general.c
+++ b/contrib/gdb/gdb/ax-general.c
@@ -1,23 +1,22 @@
/* Functions for manipulating expressions designed to be executed on the agent
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* $Id: ax-general.c,v 1.3 1998/12/02 23:22:58 msnyder Exp $ */
+ You should have received a copy of the GNU General Public 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,19 +26,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "ax.h"
+#include "value.h"
+
+static void grow_expr (struct agent_expr *x, int n);
+
+static void append_const (struct agent_expr *x, LONGEST val, int n);
+
+static LONGEST read_const (struct agent_expr *x, int o, int n);
+
+static void generic_ext (struct agent_expr *x, enum agent_op op, int n);
/* Functions for building expressions. */
/* Allocate a new, empty agent expression. */
struct agent_expr *
-new_agent_expr (scope)
- CORE_ADDR scope;
+new_agent_expr (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;
@@ -47,20 +54,29 @@ new_agent_expr (scope)
/* Free a agent expression. */
void
-free_agent_expr (x)
- struct agent_expr *x;
+free_agent_expr (struct agent_expr *x)
+{
+ xfree (x->buf);
+ xfree (x);
+}
+
+static void
+do_free_agent_expr_cleanup (void *x)
+{
+ free_agent_expr (x);
+}
+
+struct cleanup *
+make_cleanup_free_agent_expr (struct agent_expr *x)
{
- free (x->buf);
- free (x);
+ return make_cleanup (do_free_agent_expr_cleanup, x);
}
/* Make sure that X has room for at least N more bytes. This doesn't
affect the length, just the allocated size. */
static void
-grow_expr (x, n)
- struct agent_expr *x;
- int n;
+grow_expr (struct agent_expr *x, int n)
{
if (x->len + n > x->size)
{
@@ -75,10 +91,7 @@ grow_expr (x, n)
/* Append the low N bytes of VAL as an N-byte integer to the
expression X, in big-endian order. */
static void
-append_const (x, val, n)
- struct agent_expr *x;
- LONGEST val;
- int n;
+append_const (struct agent_expr *x, LONGEST val, int n)
{
int i;
@@ -95,9 +108,7 @@ append_const (x, val, n)
/* Extract an N-byte big-endian unsigned integer from expression X at
offset O. */
static LONGEST
-read_const (x, o, n)
- struct agent_expr *x;
- int o, n;
+read_const (struct agent_expr *x, int o, int n)
{
int i;
LONGEST accum = 0;
@@ -108,16 +119,14 @@ read_const (x, o, n)
for (i = 0; i < n; i++)
accum = (accum << 8) | x->buf[o + i];
-
+
return accum;
}
/* Append a simple operator OP to EXPR. */
void
-ax_simple (x, op)
- struct agent_expr *x;
- enum agent_op op;
+ax_simple (struct agent_expr *x, enum agent_op op)
{
grow_expr (x, 1);
x->buf[x->len++] = op;
@@ -127,10 +136,7 @@ ax_simple (x, op)
/* Append a sign-extension or zero-extension instruction to EXPR, to
extend an N-bit value. */
static void
-generic_ext (x, op, n)
- struct agent_expr *x;
- enum agent_op op;
- int n;
+generic_ext (struct agent_expr *x, enum agent_op op, int n)
{
/* N must fit in a byte. */
if (n < 0 || n > 255)
@@ -147,9 +153,7 @@ generic_ext (x, op, n)
/* Append a sign-extension instruction to EXPR, to extend an N-bit value. */
void
-ax_ext (x, n)
- struct agent_expr *x;
- int n;
+ax_ext (struct agent_expr *x, int n)
{
generic_ext (x, aop_ext, n);
}
@@ -157,9 +161,7 @@ ax_ext (x, n)
/* Append a zero-extension instruction to EXPR, to extend an N-bit value. */
void
-ax_zero_ext (x, n)
- struct agent_expr *x;
- int n;
+ax_zero_ext (struct agent_expr *x, int n)
{
generic_ext (x, aop_zero_ext, n);
}
@@ -167,9 +169,7 @@ ax_zero_ext (x, n)
/* Append a trace_quick instruction to EXPR, to record N bytes. */
void
-ax_trace_quick (x, n)
- struct agent_expr *x;
- int n;
+ax_trace_quick (struct agent_expr *x, int n)
{
/* N must fit in a byte. */
if (n < 0 || n > 255)
@@ -187,9 +187,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)
- struct agent_expr *x;
- enum agent_op op;
+int
+ax_goto (struct agent_expr *x, enum agent_op op)
{
grow_expr (x, 3);
x->buf[x->len + 0] = op;
@@ -201,19 +200,16 @@ 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)
- struct agent_expr *x;
- int patch;
- int target;
+ax_label (struct agent_expr *x, int patch, int target)
{
/* Make sure the value is in range. Don't accept 0xffff as an
offset; that's our magic sentinel value for unpatched branches. */
if (target < 0 || target >= 0xffff)
error ("GDB bug: ax-general.c (ax_label): label target out of range");
-
+
x->buf[patch] = (target >> 8) & 0xff;
x->buf[patch + 1] = target & 0xff;
}
@@ -221,12 +217,11 @@ ax_label (x, patch, target)
/* Assemble code to push a constant on the stack. */
void
-ax_const_l (x, l)
- struct agent_expr *x;
- LONGEST l;
+ax_const_l (struct agent_expr *x, 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;
@@ -252,9 +247,7 @@ ax_const_l (x, l)
void
-ax_const_d (x, d)
- struct agent_expr *x;
- LONGEST d;
+ax_const_d (struct agent_expr *x, LONGEST d)
{
/* FIXME: floating-point support not present yet. */
error ("GDB bug: ax-general.c (ax_const_d): floating point not supported yet");
@@ -263,83 +256,81 @@ ax_const_d (x, d)
/* Assemble code to push the value of register number REG on the
stack. */
-void ax_reg (x, reg)
- struct agent_expr *x;
- int reg;
+void
+ax_reg (struct agent_expr *x, int reg)
{
/* Make sure the register number is in range. */
if (reg < 0 || reg > 0xffff)
error ("GDB bug: ax-general.c (ax_reg): register number out of range");
grow_expr (x, 3);
- x->buf[x->len ] = aop_reg;
+ x->buf[x->len] = 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;
}
+
-
/* 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 */
};
/* Disassemble the expression EXPR, writing to F. */
void
-ax_print (f, x)
- GDB_FILE *f;
- struct agent_expr *x;
+ax_print (struct ui_file *f, struct agent_expr *x)
{
int i;
int is_float = 0;
@@ -349,13 +340,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++;
@@ -372,7 +363,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));
}
@@ -387,9 +378,7 @@ ax_print (f, x)
/* Given an agent expression AX, fill in an agent_reqs structure REQS
describing it. */
void
-ax_reqs (ax, reqs)
- struct agent_expr *ax;
- struct agent_reqs *reqs;
+ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
{
int i;
int height;
@@ -427,23 +416,23 @@ ax_reqs (ax, reqs)
if (ax->buf[i] > (sizeof (aop_map) / sizeof (aop_map[0])))
{
reqs->flaw = agent_flaw_bad_instruction;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
op = &aop_map[ax->buf[i]];
- if (! op->name)
+ if (!op->name)
{
reqs->flaw = agent_flaw_bad_instruction;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
-
+
if (i + 1 + op->op_size > ax->len)
{
reqs->flaw = agent_flaw_incomplete_instruction;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
@@ -452,7 +441,7 @@ ax_reqs (ax, reqs)
if (targets[i] && (heights[i] != height))
{
reqs->flaw = agent_flaw_height_mismatch;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
@@ -470,8 +459,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)
{
@@ -479,7 +468,7 @@ ax_reqs (ax, reqs)
if (target < 0 || target >= ax->len)
{
reqs->flaw = agent_flaw_bad_jump;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
/* Have we already found other jumps to the same location? */
@@ -488,7 +477,7 @@ ax_reqs (ax, reqs)
if (heights[i] != height)
{
reqs->flaw = agent_flaw_height_mismatch;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
}
@@ -498,16 +487,16 @@ 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);
+ xfree (reg_mask);
return;
}
@@ -524,9 +513,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]));
@@ -542,7 +531,7 @@ ax_reqs (ax, reqs)
if (targets[i] && !boundary[i])
{
reqs->flaw = agent_flaw_bad_jump;
- free (reg_mask);
+ xfree (reg_mask);
return;
}
diff --git a/contrib/gdb/gdb/ax.h b/contrib/gdb/gdb/ax.h
index fe23a31..708dba4 100644
--- a/contrib/gdb/gdb/ax.h
+++ b/contrib/gdb/gdb/ax.h
@@ -1,27 +1,28 @@
/* Definitions for expressions designed to be executed on the agent
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* $Id: ax.h,v 1.3.20.1 1999/04/01 17:33:04 jimb Exp $ */
+ You should have received a copy of the GNU General Public 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
+#include "doublest.h" /* For DOUBLEST. */
+
/* It's sometimes useful to be able to debug programs that you can't
really stop for more than a fraction of a second. To this end, the
user can specify a tracepoint (like a breakpoint, but you don't
@@ -49,8 +50,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. */
-
+
/* Agent expression data structures. */
/* The type of an element of the agent expression stack.
@@ -58,18 +59,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;
+ };
@@ -84,78 +87,80 @@ 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
+ };
+
-
/* Functions for building expressions. */
/* Allocate a new, empty agent expression. */
-extern struct agent_expr *new_agent_expr PARAMS ((CORE_ADDR));
+extern struct agent_expr *new_agent_expr (CORE_ADDR);
/* Free a agent expression. */
-extern void free_agent_expr PARAMS ((struct agent_expr *));
+extern void free_agent_expr (struct agent_expr *);
+extern struct cleanup *make_cleanup_free_agent_expr (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 (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 (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 (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 (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,
@@ -163,123 +168,125 @@ 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 (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 (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 (struct agent_expr *EXPR, LONGEST l);
+extern void ax_const_d (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 (struct agent_expr *EXPR, int REG);
+
/* Functions for printing out expressions, and otherwise debugging
things. */
/* Disassemble the expression EXPR, writing to F. */
-extern void ax_print PARAMS ((GDB_FILE *f, struct agent_expr *EXPR));
+extern void ax_print (struct ui_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 (struct agent_expr *ax, struct agent_reqs *reqs);
#endif /* AGENTEXPR_H */
diff --git a/contrib/gdb/gdb/bcache.c b/contrib/gdb/gdb/bcache.c
index d28515b..73b86e8 100644
--- a/contrib/gdb/gdb/bcache.c
+++ b/contrib/gdb/gdb/bcache.c
@@ -1,219 +1,293 @@
/* Implement a cached obstack.
- Written by Fred Fish (fnf@cygnus.com)
- Copyright 1995, 1998 Free Software Foundation, Inc.
+ Written by Fred Fish <fnf@cygnus.com>
+ Rewritten by Jim Blandy <jimb@cygnus.com>
-This file is part of GDB.
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-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 "obstack.h"
#include "bcache.h"
#include "gdb_string.h" /* For memcpy declaration */
-/* Prototypes for local functions. */
-
-static unsigned int hash PARAMS ((void *, int));
-
-static void *lookup_cache PARAMS ((void *, int, int, struct bcache *));
+#include <stddef.h>
+#include <stdlib.h>
-/* FIXME: Incredibly simplistic hash generator. Probably way too expensive
- (consider long strings) and unlikely to have good distribution across hash
- values for typical input. */
-
-static unsigned int
-hash (bytes, count)
- void *bytes;
- int count;
+/* The old hash function was stolen from SDBM. This is what DB 3.0 uses now,
+ * and is better than the old one.
+ */
+
+unsigned long
+hash(const void *addr, int length)
{
- unsigned int len;
- unsigned long hashval;
- unsigned int c;
- const unsigned char *data = bytes;
-
- hashval = 0;
- len = 0;
- while (count-- > 0)
- {
- c = *data++;
- hashval += c + (c << 17);
- hashval ^= hashval >> 2;
- ++len;
- }
- hashval += len + (len << 17);
- hashval ^= hashval >> 2;
- return (hashval % BCACHE_HASHSIZE);
+ const unsigned char *k, *e;
+ unsigned long h;
+
+ k = (const unsigned char *)addr;
+ e = k+length;
+ for (h=0; k< e;++k)
+ {
+ h *=16777619;
+ h ^= *k;
+ }
+ return (h);
}
+
+/* Growing the bcache's hash table. */
-static void *
-lookup_cache (bytes, count, hashval, bcachep)
- void *bytes;
- int count;
- int hashval;
- struct bcache *bcachep;
+/* If the average chain length grows beyond this, then we want to
+ resize our hash table. */
+#define CHAIN_LENGTH_THRESHOLD (5)
+
+static void
+expand_hash_table (struct bcache *bcache)
{
- void *location = NULL;
- struct hashlink **hashtablep;
- struct hashlink *linkp;
+ /* A table of good hash table sizes. Whenever we grow, we pick the
+ next larger size from this table. sizes[i] is close to 1 << (i+10),
+ so we roughly double the table size each time. After we fall off
+ the end of this table, we just double. Don't laugh --- there have
+ been executables sighted with a gigabyte of debug info. */
+ static unsigned long sizes[] = {
+ 1021, 2053, 4099, 8191, 16381, 32771,
+ 65537, 131071, 262144, 524287, 1048573, 2097143,
+ 4194301, 8388617, 16777213, 33554467, 67108859, 134217757,
+ 268435459, 536870923, 1073741827, 2147483659UL
+ };
+ unsigned int new_num_buckets;
+ struct bstring **new_buckets;
+ unsigned int i;
+
+ /* Find the next size. */
+ new_num_buckets = bcache->num_buckets * 2;
+ for (i = 0; i < (sizeof (sizes) / sizeof (sizes[0])); i++)
+ if (sizes[i] > bcache->num_buckets)
+ {
+ new_num_buckets = sizes[i];
+ break;
+ }
- hashtablep = bcachep -> indextable[count];
- if (hashtablep != NULL)
+ /* Allocate the new table. */
+ {
+ size_t new_size = new_num_buckets * sizeof (new_buckets[0]);
+ new_buckets = (struct bstring **) xmalloc (new_size);
+ memset (new_buckets, 0, new_size);
+
+ bcache->structure_size -= (bcache->num_buckets
+ * sizeof (bcache->bucket[0]));
+ bcache->structure_size += new_size;
+ }
+
+ /* Rehash all existing strings. */
+ for (i = 0; i < bcache->num_buckets; i++)
{
- linkp = hashtablep[hashval];
- while (linkp != NULL)
+ struct bstring *s, *next;
+
+ for (s = bcache->bucket[i]; s; s = next)
{
- if (memcmp (BCACHE_DATA (linkp), bytes, count) == 0)
- {
- location = BCACHE_DATA (linkp);
- break;
- }
- linkp = linkp -> next;
+ struct bstring **new_bucket;
+ next = s->next;
+
+ new_bucket = &new_buckets[(hash (&s->d.data, s->length)
+ % new_num_buckets)];
+ s->next = *new_bucket;
+ *new_bucket = s;
}
}
- return (location);
+
+ /* Plug in the new table. */
+ if (bcache->bucket)
+ xfree (bcache->bucket);
+ bcache->bucket = new_buckets;
+ bcache->num_buckets = new_num_buckets;
}
+
+/* Looking up things in the bcache. */
+
+/* The number of bytes needed to allocate a struct bstring whose data
+ is N bytes long. */
+#define BSTRING_SIZE(n) (offsetof (struct bstring, d.data) + (n))
+
+/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
+ never seen those bytes before, add a copy of them to BCACHE. In
+ either case, return a pointer to BCACHE's copy of that string. */
void *
-bcache (bytes, count, bcachep)
- void *bytes;
- int count;
- struct bcache *bcachep;
+bcache (const void *addr, int length, struct bcache *bcache)
{
- int hashval;
- void *location;
- struct hashlink *newlink;
- struct hashlink **linkpp;
- struct hashlink ***hashtablepp;
+ int hash_index;
+ struct bstring *s;
- if (count >= BCACHE_MAXLENGTH)
- {
- /* Rare enough to just stash unique copies */
- location = (void *) obstack_alloc (&bcachep->cache, count);
- bcachep -> cache_bytes += count;
- memcpy (location, bytes, count);
- bcachep -> bcache_overflows++;
- }
- else
- {
- hashval = hash (bytes, count);
- location = lookup_cache (bytes, count, hashval, bcachep);
- if (location != NULL)
- {
- bcachep -> cache_savings += count;
- bcachep -> cache_hits++;
- }
- else
- {
- 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 *);
- 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;
- memcpy (BCACHE_DATA (newlink), bytes, count);
- newlink -> next = *linkpp;
- *linkpp = newlink;
- location = BCACHE_DATA (newlink);
- }
- }
- return (location);
+ /* If our average chain length is too high, expand the hash table. */
+ if (bcache->unique_count >= bcache->num_buckets * CHAIN_LENGTH_THRESHOLD)
+ expand_hash_table (bcache);
+
+ bcache->total_count++;
+ bcache->total_size += length;
+
+ hash_index = hash (addr, length) % bcache->num_buckets;
+
+ /* Search the hash bucket for a string identical to the caller's. */
+ for (s = bcache->bucket[hash_index]; s; s = s->next)
+ if (s->length == length
+ && ! memcmp (&s->d.data, addr, length))
+ return &s->d.data;
+
+ /* The user's string isn't in the list. Insert it after *ps. */
+ {
+ struct bstring *new
+ = obstack_alloc (&bcache->cache, BSTRING_SIZE (length));
+ memcpy (&new->d.data, addr, length);
+ new->length = length;
+ new->next = bcache->bucket[hash_index];
+ bcache->bucket[hash_index] = new;
+
+ bcache->unique_count++;
+ bcache->unique_size += length;
+ bcache->structure_size += BSTRING_SIZE (length);
+
+ return &new->d.data;
+ }
}
-#if MAINTENANCE_CMDS
+
+/* Freeing bcaches. */
+/* Free all the storage associated with BCACHE. */
void
-print_bcache_statistics (bcachep, id)
- struct bcache *bcachep;
- char *id;
+free_bcache (struct bcache *bcache)
{
- struct hashlink **hashtablep;
- struct hashlink *linkp;
- int tidx, tcount, hidx, hcount, lcount, lmax, temp, lmaxt, lmaxh;
+ obstack_free (&bcache->cache, 0);
+ if (bcache->bucket)
+ xfree (bcache->bucket);
- for (lmax = lcount = tcount = hcount = tidx = 0; tidx < BCACHE_MAXLENGTH; tidx++)
- {
- hashtablep = bcachep -> indextable[tidx];
- if (hashtablep != NULL)
- {
- tcount++;
- for (hidx = 0; hidx < BCACHE_HASHSIZE; hidx++)
- {
- linkp = hashtablep[hidx];
- if (linkp != NULL)
- {
- hcount++;
- for (temp = 0; linkp != NULL; linkp = linkp -> next)
- {
- lcount++;
- temp++;
- }
- if (temp > lmax)
- {
- lmax = temp;
- lmaxt = tidx;
- lmaxh = hidx;
- }
- }
- }
- }
- }
- printf_filtered (" Cached '%s' statistics:\n", id);
- printf_filtered (" Cache hits: %d\n", bcachep -> cache_hits);
- printf_filtered (" Cache misses: %d\n", bcachep -> cache_misses);
- printf_filtered (" Cache hit ratio: ");
- if (bcachep -> cache_hits + bcachep -> cache_misses > 0)
- {
- printf_filtered ("%d%%\n", ((bcachep -> cache_hits) * 100) /
- (bcachep -> cache_hits + bcachep -> cache_misses));
- }
- else
- {
- printf_filtered ("(not applicable)\n");
- }
- printf_filtered (" Space used for caching: %d\n", bcachep -> cache_bytes);
- printf_filtered (" Space saved by cache hits: %d\n", bcachep -> cache_savings);
- printf_filtered (" Number of bcache overflows: %d\n", bcachep -> bcache_overflows);
- printf_filtered (" Number of index buckets used: %d\n", tcount);
- printf_filtered (" Number of hash table buckets used: %d\n", hcount);
- printf_filtered (" Number of chained items: %d\n", lcount);
- printf_filtered (" Average hash table population: ");
- if (tcount > 0)
- {
- printf_filtered ("%d%%\n", (hcount * 100) / (tcount * BCACHE_HASHSIZE));
- }
- else
- {
- printf_filtered ("(not applicable)\n");
- }
- printf_filtered (" Average chain length ");
- if (hcount > 0)
- {
- printf_filtered ("%d\n", lcount / hcount);
- }
+ /* This isn't necessary, but at least the bcache is always in a
+ consistent state. */
+ memset (bcache, 0, sizeof (*bcache));
+}
+
+
+
+/* Printing statistics. */
+
+static int
+compare_ints (const void *ap, const void *bp)
+{
+ /* Because we know we're comparing two ints which are positive,
+ there's no danger of overflow here. */
+ return * (int *) ap - * (int *) bp;
+}
+
+
+static void
+print_percentage (int portion, int total)
+{
+ if (total == 0)
+ printf_filtered ("(not applicable)\n");
else
- {
- printf_filtered ("(not applicable)\n");
- }
- printf_filtered (" Maximum chain length %d at %d:%d\n", lmax, lmaxt, lmaxh);
+ printf_filtered ("%3d%%\n", portion * 100 / total);
}
-#endif /* MAINTENANCE_CMDS */
+
+/* Print statistics on BCACHE's memory usage and efficacity at
+ eliminating duplication. NAME should describe the kind of data
+ BCACHE holds. Statistics are printed using `printf_filtered' and
+ its ilk. */
+void
+print_bcache_statistics (struct bcache *c, char *type)
+{
+ int occupied_buckets;
+ int max_chain_length;
+ int median_chain_length;
+
+ /* Count the number of occupied buckets, and measure chain lengths. */
+ {
+ unsigned int b;
+ int *chain_length
+ = (int *) alloca (c->num_buckets * sizeof (*chain_length));
+
+ occupied_buckets = 0;
+
+ for (b = 0; b < c->num_buckets; b++)
+ {
+ struct bstring *s = c->bucket[b];
+
+ chain_length[b] = 0;
+
+ if (s)
+ {
+ occupied_buckets++;
+
+ while (s)
+ {
+ chain_length[b]++;
+ s = s->next;
+ }
+ }
+ }
+
+ /* To compute the median, we need the set of chain lengths sorted. */
+ qsort (chain_length, c->num_buckets, sizeof (chain_length[0]),
+ compare_ints);
+
+ if (c->num_buckets > 0)
+ {
+ max_chain_length = chain_length[c->num_buckets - 1];
+ median_chain_length = chain_length[c->num_buckets / 2];
+ }
+ else
+ {
+ max_chain_length = 0;
+ median_chain_length = 0;
+ }
+ }
+
+ printf_filtered (" Cached '%s' statistics:\n", type);
+ printf_filtered (" Total object count: %ld\n", c->total_count);
+ printf_filtered (" Unique object count: %lu\n", c->unique_count);
+ printf_filtered (" Percentage of duplicates, by count: ");
+ print_percentage (c->total_count - c->unique_count, c->total_count);
+ printf_filtered ("\n");
+
+ printf_filtered (" Total object size: %ld\n", c->total_size);
+ printf_filtered (" Unique object size: %ld\n", c->unique_size);
+ printf_filtered (" Percentage of duplicates, by size: ");
+ print_percentage (c->total_size - c->unique_size, c->total_size);
+ printf_filtered ("\n");
+
+ printf_filtered (" Total memory used by bcache, including overhead: %ld\n",
+ c->structure_size);
+ printf_filtered (" Percentage memory overhead: ");
+ print_percentage (c->structure_size - c->unique_size, c->unique_size);
+ printf_filtered (" Net memory savings: ");
+ print_percentage (c->total_size - c->structure_size, c->total_size);
+ printf_filtered ("\n");
+
+ printf_filtered (" Hash table size: %3d\n", c->num_buckets);
+ printf_filtered (" Hash table population: ");
+ print_percentage (occupied_buckets, c->num_buckets);
+ printf_filtered (" Median hash chain length: %3d\n",
+ median_chain_length);
+ printf_filtered (" Average hash chain length: ");
+ if (c->num_buckets > 0)
+ printf_filtered ("%3lu\n", c->unique_count / c->num_buckets);
+ else
+ printf_filtered ("(not applicable)\n");
+ printf_filtered (" Maximum hash chain length: %3d\n", max_chain_length);
+ printf_filtered ("\n");
+}
diff --git a/contrib/gdb/gdb/bcache.h b/contrib/gdb/gdb/bcache.h
index cf0c62e..2b03ead 100644
--- a/contrib/gdb/gdb/bcache.h
+++ b/contrib/gdb/gdb/bcache.h
@@ -1,72 +1,130 @@
/* Include file cached obstack implementation.
- Written by Fred Fish (fnf@cygnus.com)
- Copyright 1995 Free Software Foundation, Inc.
+ Written by Fred Fish <fnf@cygnus.com>
+ Rewritten by Jim Blandy <jimb@cygnus.com>
+ Copyright 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
-#define BCACHE_HASHLENGTH 12 /* Number of bits in hash value */
-#define BCACHE_HASHSIZE (1 << BCACHE_HASHLENGTH)
-#define BCACHE_MAXLENGTH 128
-
-/* Note that the user data is stored in data[]. Since it can be any type,
- it needs to have the same alignment as the most strict alignment of
- any type on the host machine. So do it the same way obstack does. */
-
-struct hashlink {
- struct hashlink *next;
- union {
+/* A bcache is a data structure for factoring out duplication in
+ read-only structures. You give the bcache some string of bytes S.
+ If the bcache already contains a copy of S, it hands you back a
+ pointer to its copy. Otherwise, it makes a fresh copy of S, and
+ hands you back a pointer to that. In either case, you can throw
+ away your copy of S, and use the bcache's.
+
+ The "strings" in question are arbitrary strings of bytes --- they
+ can contain zero bytes. You pass in the length explicitly when you
+ call the bcache function.
+
+ This means that you can put ordinary C objects in a bcache.
+ However, if you do this, remember that structs can contain `holes'
+ between members, added for alignment. These bytes usually contain
+ garbage. If you try to bcache two objects which are identical from
+ your code's point of view, but have different garbage values in the
+ structure's holes, then the bcache will treat them as separate
+ strings, and you won't get the nice elimination of duplicates you
+ were hoping for. So, remember to memset your structures full of
+ zeros before bcaching them!
+
+ You shouldn't modify the strings you get from a bcache, because:
+
+ - You don't necessarily know who you're sharing space with. If I
+ stick eight bytes of text in a bcache, and then stick an
+ eight-byte structure in the same bcache, there's no guarantee
+ those two objects don't actually comprise the same sequence of
+ bytes. If they happen to, the bcache will use a single byte
+ string for both of them. Then, modifying the structure will
+ change the string. In bizarre ways.
+
+ - Even if you know for some other reason that all that's okay,
+ there's another problem. A bcache stores all its strings in a
+ hash table. If you modify a string's contents, you will probably
+ change its hash value. This means that the modified string is
+ now in the wrong place in the hash table, and future bcache
+ probes will never find it. So by mutating a string, you give up
+ any chance of sharing its space with future duplicates. */
+
+
+/* The type used to hold a single bcache string. The user data is
+ stored in d.data. Since it can be any type, it needs to have the
+ same alignment as the most strict alignment of any type on the host
+ machine. I don't know of any really correct way to do this in
+ stock ANSI C, so just do it the same way obstack.h does.
+
+ It would be nicer to have this stuff hidden away in bcache.c, but
+ struct objstack contains a struct bcache directly --- not a pointer
+ to one --- and then the memory-mapped stuff makes this a real pain.
+ We don't strictly need to expose struct bstring, but it's better to
+ have it all in one place. */
+
+struct bstring {
+ struct bstring *next;
+ size_t length;
+
+ union
+ {
char data[1];
double dummy;
- } d;
+ }
+ d;
};
-/* BCACHE_DATA is used to get the address of the cached data. */
-
-#define BCACHE_DATA(p) ((p)->d.data)
-
-/* BCACHE_DATA_ALIGNMENT is used to get the offset of the start of
- cached data within the hashlink struct. This value, plus the
- size of the cached data, is the amount of space to allocate for
- a hashlink struct to hold the next pointer and the data. */
-
-#define BCACHE_DATA_ALIGNMENT \
- (((char *) BCACHE_DATA((struct hashlink*) 0) - (char *) 0))
+/* The structure for a bcache itself.
+ To initialize a bcache, just fill it with zeros. */
struct bcache {
+ /* All the bstrings are allocated here. */
struct obstack cache;
- 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));
+ /* How many hash buckets we're using. */
+ unsigned int num_buckets;
+
+ /* Hash buckets. This table is allocated using malloc, so when we
+ grow the table we can return the old table to the system. */
+ struct bstring **bucket;
+
+ /* Statistics. */
+ unsigned long unique_count; /* number of unique strings */
+ long total_count; /* total number of strings cached, including dups */
+ long unique_size; /* size of unique strings, in bytes */
+ long total_size; /* total number of bytes cached, including dups */
+ long structure_size; /* total size of bcache, including infrastructure */
+};
-#if MAINTENANCE_CMDS
-extern void
-print_bcache_statistics PARAMS ((struct bcache *, char *));
+/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
+ never seen those bytes before, add a copy of them to BCACHE. In
+ either case, return a pointer to BCACHE's copy of that string. */
+extern void *bcache (const void *addr, int length, struct bcache *bcache);
-#endif /* MAINTENANCE_CMDS */
+/* Free all the storage that BCACHE refers to. The result is a valid,
+ but empty, bcache. This does not free BCACHE itself, since that
+ might be part of some larger object. */
+extern void free_bcache (struct bcache *bcache);
+/* Print statistics on BCACHE's memory usage and efficacity at
+ eliminating duplication. TYPE should be a string describing the
+ kind of data BCACHE holds. Statistics are printed using
+ `printf_filtered' and its ilk. */
+extern void print_bcache_statistics (struct bcache *bcache, char *type);
+/* The hash function */
+extern unsigned long hash(const void *addr, int length);
#endif /* BCACHE_H */
diff --git a/contrib/gdb/gdb/blockframe.c b/contrib/gdb/gdb/blockframe.c
index 9366ca6..1f10381 100644
--- a/contrib/gdb/gdb/blockframe.c
+++ b/contrib/gdb/gdb/blockframe.c
@@ -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.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -30,44 +31,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h" /* for target_has_stack */
#include "inferior.h" /* for read_pc */
#include "annotate.h"
+#include "regcache.h"
/* Prototypes for exported functions. */
-void _initialize_blockframe PARAMS ((void));
+void _initialize_blockframe (void);
/* A default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given
frame is the outermost one and has no caller. */
int
-default_frame_chain_valid (chain, thisframe)
- CORE_ADDR chain;
- struct frame_info *thisframe;
+file_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return ((chain) != 0
- && !inside_main_func ((thisframe) -> pc)
- && !inside_entry_func ((thisframe) -> pc));
+ && !inside_entry_file (FRAME_SAVED_PC (thisframe)));
}
/* Use the alternate method of avoiding running up off the end of the
frame chain or following frames back into the startup code. See
the comments in objfiles.h. */
-
+
int
-alternate_frame_chain_valid (chain, thisframe)
- CORE_ADDR chain;
- struct frame_info *thisframe;
+func_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return ((chain) != 0
- && !inside_entry_file (FRAME_SAVED_PC (thisframe)));
+ && !inside_main_func ((thisframe)->pc)
+ && !inside_entry_func ((thisframe)->pc));
}
/* A very simple method of determining a valid frame */
-
+
int
-nonnull_frame_chain_valid (chain, thisframe)
- CORE_ADDR chain;
- struct frame_info *thisframe;
+nonnull_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return ((chain) != 0);
}
@@ -81,22 +77,22 @@ nonnull_frame_chain_valid (chain, thisframe)
A PC of zero is always considered to be the bottom of the stack. */
int
-inside_entry_file (addr)
- CORE_ADDR addr;
+inside_entry_file (CORE_ADDR addr)
{
if (addr == 0)
return 1;
if (symfile_objfile == 0)
return 0;
-#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
- /* Do not stop backtracing if the pc is in the call dummy
- at the entry point. */
-/* FIXME: Won't always work with zeros for the last two arguments */
- if (PC_IN_CALL_DUMMY (addr, 0, 0))
- return 0;
-#endif
- return (addr >= symfile_objfile -> ei.entry_file_lowpc &&
- addr < symfile_objfile -> ei.entry_file_highpc);
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ /* Do not stop backtracing if the pc is in the call dummy
+ at the entry point. */
+ /* FIXME: Won't always work with zeros for the last two arguments */
+ if (PC_IN_CALL_DUMMY (addr, 0, 0))
+ return 0;
+ }
+ 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
@@ -108,8 +104,7 @@ inside_entry_file (addr)
A PC of zero is always considered to be the bottom of the stack. */
int
-inside_main_func (pc)
-CORE_ADDR pc;
+inside_main_func (CORE_ADDR pc)
{
if (pc == 0)
return 1;
@@ -120,22 +115,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 =
+ mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
+ if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
+ {
+ symfile_objfile->ei.main_func_lowpc =
BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
- symfile_objfile->ei.main_func_highpc =
+ 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
@@ -147,22 +142,22 @@ CORE_ADDR pc;
A PC of zero is always considered to be the bottom of the stack. */
int
-inside_entry_func (pc)
-CORE_ADDR pc;
+inside_entry_func (CORE_ADDR pc)
{
if (pc == 0)
return 1;
if (symfile_objfile == 0)
return 0;
-#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
- /* Do not stop backtracing if the pc is in the call dummy
- at the entry point. */
-/* FIXME: Won't always work with zeros for the last two arguments */
- if (PC_IN_CALL_DUMMY (pc, 0, 0))
- return 0;
-#endif
- return (symfile_objfile -> ei.entry_func_lowpc <= pc &&
- symfile_objfile -> ei.entry_func_highpc > pc);
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ /* Do not stop backtracing if the pc is in the call dummy
+ at the entry point. */
+ /* FIXME: Won't always work with zeros for the last two arguments */
+ if (PC_IN_CALL_DUMMY (pc, 0, 0))
+ return 0;
+ }
+ 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) */
@@ -176,17 +171,15 @@ static struct frame_info *current_frame;
static struct obstack frame_cache_obstack;
void *
-frame_obstack_alloc (size)
- unsigned long size;
+frame_obstack_alloc (unsigned long size)
{
return obstack_alloc (&frame_cache_obstack, size);
}
void
-frame_saved_regs_zalloc (fi)
- struct frame_info *fi;
+frame_saved_regs_zalloc (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);
}
@@ -195,7 +188,7 @@ frame_saved_regs_zalloc (fi)
/* Return the innermost (currently executing) stack frame. */
struct frame_info *
-get_current_frame ()
+get_current_frame (void)
{
if (current_frame == NULL)
{
@@ -208,8 +201,7 @@ get_current_frame ()
}
void
-set_current_frame (frame)
- struct frame_info *frame;
+set_current_frame (struct frame_info *frame)
{
current_frame = frame;
}
@@ -218,9 +210,7 @@ set_current_frame (frame)
Always returns a non-NULL value. */
struct frame_info *
-create_new_frame (addr, pc)
- CORE_ADDR addr;
- CORE_ADDR pc;
+create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
{
struct frame_info *fi;
char *name;
@@ -229,38 +219,25 @@ create_new_frame (addr, pc)
obstack_alloc (&frame_cache_obstack,
sizeof (struct frame_info));
- /* Arbitrary frame */
- fi->saved_regs = NULL;
- fi->next = NULL;
- fi->prev = NULL;
+ /* Zero all fields by default. */
+ memset (fi, 0, sizeof (struct frame_info));
+
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
- INIT_EXTRA_FRAME_INFO (0, fi);
-#endif
+ if (INIT_EXTRA_FRAME_INFO_P ())
+ INIT_EXTRA_FRAME_INFO (0, fi);
return fi;
}
-/* Return the frame that called FI.
- If FI is the original frame (it has no caller), return 0. */
-
-struct frame_info *
-get_prev_frame (frame)
- struct frame_info *frame;
-{
- return get_prev_frame_info (frame);
-}
-
/* Return the frame that FRAME calls (NULL if FRAME is the innermost
frame). */
struct frame_info *
-get_next_frame (frame)
- struct frame_info *frame;
+get_next_frame (struct frame_info *frame)
{
return frame->next;
}
@@ -268,13 +245,13 @@ get_next_frame (frame)
/* Flush the entire frame cache. */
void
-flush_cached_frames ()
+flush_cached_frames (void)
{
/* Since we can't really be sure what the first object allocated was */
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 ();
}
@@ -282,50 +259,39 @@ flush_cached_frames ()
/* Flush the frame cache, and start a new one if necessary. */
void
-reinit_frame_cache ()
+reinit_frame_cache (void)
{
flush_cached_frames ();
- /* FIXME: The inferior_pid test is wrong if there is a corefile. */
- if (inferior_pid != 0)
+ /* FIXME: The inferior_ptid test is wrong if there is a corefile. */
+ if (PIDGET (inferior_ptid) != 0)
{
select_frame (get_current_frame (), 0);
}
}
-/* If a machine allows frameless functions, it should define a macro
- FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) in param.h. FI is the struct
- frame_info for the frame, and FRAMELESS should be set to nonzero
- if it represents a frameless function invocation. */
-
/* Return nonzero if the function for this frame lacks a prologue. Many
machines can define FRAMELESS_FUNCTION_INVOCATION to just call this
function. */
int
-frameless_look_for_prologue (frame)
- struct frame_info *frame;
+frameless_look_for_prologue (struct frame_info *frame)
{
CORE_ADDR func_start, after_prologue;
+
func_start = get_pc_function_start (frame->pc);
if (func_start)
{
func_start += FUNCTION_START_OFFSET;
- after_prologue = func_start;
-#ifdef SKIP_PROLOGUE_FRAMELESS_P
- /* This is faster, since only care whether there *is* a prologue,
- not how long it is. */
- SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
-#else
- SKIP_PROLOGUE (after_prologue);
-#endif
- return after_prologue == func_start;
+ /* This is faster, since only care whether there *is* a
+ prologue, not how long it is. */
+ return PROLOGUE_FRAMELESS_P (func_start);
}
else if (frame->pc == 0)
- /* A frame with a zero PC is usually created by dereferencing a NULL
- function pointer, normally causing an immediate core dump of the
- inferior. Mark function as frameless, as the inferior has no chance
- of setting up a stack frame. */
+ /* A frame with a zero PC is usually created by dereferencing a
+ NULL function pointer, normally causing an immediate core dump
+ of the inferior. Mark function as frameless, as the inferior
+ has no chance of setting up a stack frame. */
return 1;
else
/* If we can't find the start of the function, we don't really
@@ -337,12 +303,6 @@ frameless_look_for_prologue (frame)
/* Default a few macros that people seldom redefine. */
-#if !defined (INIT_FRAME_PC)
-#define INIT_FRAME_PC(fromleaf, prev) \
- prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
- prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
-#endif
-
#ifndef FRAME_CHAIN_COMBINE
#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
#endif
@@ -352,8 +312,7 @@ frameless_look_for_prologue (frame)
if there is no such frame. */
struct frame_info *
-get_prev_frame_info (next_frame)
- struct frame_info *next_frame;
+get_prev_frame (struct frame_info *next_frame)
{
CORE_ADDR address = 0;
struct frame_info *prev;
@@ -368,9 +327,9 @@ get_prev_frame_info (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.");
@@ -389,33 +348,32 @@ get_prev_frame_info (next_frame)
define this macro to take two args; a frameinfo pointer
identifying a frame and a variable to set or clear if it is
or isn't leafless. */
-#ifdef FRAMELESS_FUNCTION_INVOCATION
+
/* Still don't want to worry about this except on the innermost
frame. This macro will set FROMLEAF if NEXT_FRAME is a
frameless function invocation. */
if (!(next_frame->next))
{
- FRAMELESS_FUNCTION_INVOCATION (next_frame, fromleaf);
+ fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
if (fromleaf)
address = FRAME_FP (next_frame);
}
-#endif
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;
@@ -428,24 +386,24 @@ get_prev_frame_info (next_frame)
obstack_alloc (&frame_cache_obstack,
sizeof (struct frame_info));
- prev->saved_regs = NULL;
+ /* Zero all fields by default. */
+ memset (prev, 0, sizeof (struct frame_info));
+
if (next_frame)
next_frame->prev = prev;
prev->next = next_frame;
- prev->prev = (struct frame_info *) 0;
prev->frame = address;
- prev->signal_handler_caller = 0;
/* This change should not be needed, FIXME! We should
determine whether any targets *need* INIT_FRAME_PC to happen
after INIT_EXTRA_FRAME_INFO and come up with a simple way to
express what goes on here.
- 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.
@@ -457,38 +415,35 @@ get_prev_frame_info (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
INIT_FRAME_PC_FIRST (fromleaf, prev);
-#endif
-#ifdef INIT_EXTRA_FRAME_INFO
- INIT_EXTRA_FRAME_INFO(fromleaf, prev);
-#endif
+ if (INIT_EXTRA_FRAME_INFO_P ())
+ INIT_EXTRA_FRAME_INFO (fromleaf, prev);
/* 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
@@ -506,7 +461,7 @@ get_prev_frame_info (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;
@@ -514,8 +469,7 @@ get_prev_frame_info (next_frame)
}
CORE_ADDR
-get_frame_pc (frame)
- struct frame_info *frame;
+get_frame_pc (struct frame_info *frame)
{
return frame->pc;
}
@@ -527,13 +481,12 @@ get_frame_pc (frame)
/* Find the addresses in which registers are saved in FRAME. */
void
-get_frame_saved_regs (frame, saved_regs_addr)
- struct frame_info *frame;
- struct frame_saved_regs *saved_regs_addr;
+get_frame_saved_regs (struct frame_info *frame,
+ struct frame_saved_regs *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)
@@ -554,8 +507,7 @@ get_frame_saved_regs (frame, saved_regs_addr)
in a specified stack frame. The frame address is assumed valid. */
struct block *
-get_frame_block (frame)
- struct frame_info *frame;
+get_frame_block (struct frame_info *frame)
{
CORE_ADDR pc;
@@ -572,14 +524,13 @@ get_frame_block (frame)
}
struct block *
-get_current_block ()
+get_current_block (void)
{
return block_for_pc (read_pc ());
}
CORE_ADDR
-get_pc_function_start (pc)
- CORE_ADDR pc;
+get_pc_function_start (CORE_ADDR pc)
{
register struct block *bl;
register struct symbol *symbol;
@@ -606,8 +557,7 @@ get_pc_function_start (pc)
/* Return the symbol for the function executing in frame FRAME. */
struct symbol *
-get_frame_function (frame)
- struct frame_info *frame;
+get_frame_function (struct frame_info *frame)
{
register struct block *bl = get_frame_block (frame);
if (bl == 0)
@@ -622,18 +572,14 @@ get_frame_function (frame)
is NULL, we don't pass this information back to the caller. */
struct blockvector *
-blockvector_for_pc_sect (pc, section, pindex, symtab)
- register CORE_ADDR pc;
- struct sec *section;
- int *pindex;
- struct symtab *symtab;
-
+blockvector_for_pc_sect (register CORE_ADDR pc, 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)
@@ -664,7 +610,7 @@ blockvector_for_pc_sect (pc, section, pindex, symtab)
while (bot >= 0)
{
b = BLOCKVECTOR_BLOCK (bl, bot);
- if (BLOCK_END (b) >= pc)
+ if (BLOCK_END (b) > pc)
{
if (pindex)
*pindex = bot;
@@ -680,9 +626,7 @@ blockvector_for_pc_sect (pc, section, pindex, symtab)
Backward compatibility, no section. */
struct blockvector *
-blockvector_for_pc (pc, pindex)
- register CORE_ADDR pc;
- int *pindex;
+blockvector_for_pc (register CORE_ADDR pc, int *pindex)
{
return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc),
pindex, NULL);
@@ -692,9 +636,7 @@ blockvector_for_pc (pc, pindex)
in the specified section, or 0 if there is none. */
struct block *
-block_for_pc_sect (pc, section)
- register CORE_ADDR pc;
- struct sec *section;
+block_for_pc_sect (register CORE_ADDR pc, struct sec *section)
{
register struct blockvector *bl;
int index;
@@ -709,8 +651,7 @@ block_for_pc_sect (pc, section)
or 0 if there is none. Backward compatibility, no section. */
struct block *
-block_for_pc (pc)
- register CORE_ADDR pc;
+block_for_pc (register CORE_ADDR pc)
{
return block_for_pc_sect (pc, find_pc_mapped_section (pc));
}
@@ -719,9 +660,7 @@ block_for_pc (pc)
Returns 0 if function is not known. */
struct symbol *
-find_pc_sect_function (pc, section)
- CORE_ADDR pc;
- struct sec *section;
+find_pc_sect_function (CORE_ADDR pc, struct sec *section)
{
register struct block *b = block_for_pc_sect (pc, section);
if (b == 0)
@@ -733,8 +672,7 @@ find_pc_sect_function (pc, section)
Returns 0 if function is not known. Backward compatibility, no section */
struct symbol *
-find_pc_function (pc)
- CORE_ADDR pc;
+find_pc_function (CORE_ADDR pc)
{
return find_pc_sect_function (pc, find_pc_mapped_section (pc));
}
@@ -742,19 +680,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 (void)
{
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;
}
@@ -770,24 +708,20 @@ clear_pc_function_cache()
returns 0. */
int
-find_pc_sect_partial_function (pc, section, name, address, endaddr)
- CORE_ADDR pc;
- asection *section;
- char **name;
- CORE_ADDR *address;
- CORE_ADDR *endaddr;
+find_pc_sect_partial_function (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;
@@ -795,11 +729,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;
}
@@ -828,9 +762,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;
}
@@ -881,21 +815,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;
}
@@ -907,33 +841,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;
@@ -942,13 +876,10 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
/* Backward compatibility, no section argument */
int
-find_pc_partial_function (pc, name, address, endaddr)
- CORE_ADDR pc;
- char **name;
- CORE_ADDR *address;
- CORE_ADDR *endaddr;
+find_pc_partial_function (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);
@@ -958,8 +889,7 @@ find_pc_partial_function (pc, name, address, endaddr)
or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */
struct frame_info *
-block_innermost_frame (block)
- struct block *block;
+block_innermost_frame (struct block *block)
{
struct frame_info *frame;
register CORE_ADDR start;
@@ -986,12 +916,11 @@ block_innermost_frame (block)
or NULL if no FRAME on the chain corresponds to CORE_ADDR. */
struct frame_info *
-find_frame_addr_in_frame_chain (frame_addr)
- CORE_ADDR frame_addr;
+find_frame_addr_in_frame_chain (CORE_ADDR frame_addr)
{
struct frame_info *frame = NULL;
- if (frame_addr == (CORE_ADDR)0)
+ if (frame_addr == (CORE_ADDR) 0)
return NULL;
while (1)
@@ -1008,14 +937,14 @@ find_frame_addr_in_frame_chain (frame_addr)
/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */
CORE_ADDR
-sigtramp_saved_pc (frame)
- struct frame_info *frame;
+sigtramp_saved_pc (struct frame_info *frame)
{
CORE_ADDR sigcontext_addr;
- char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+ char *buf;
int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT;
int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
+ buf = alloca (ptrbytes);
/* Get sigcontext address, it is the third parameter on the stack. */
if (frame->next)
sigcontext_addr = read_memory_integer (FRAME_ARGS_ADDRESS (frame->next)
@@ -1024,7 +953,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
@@ -1034,7 +963,63 @@ sigtramp_saved_pc (frame)
}
#endif /* SIGCONTEXT_PC_OFFSET */
-#ifdef USE_GENERIC_DUMMY_FRAMES
+
+/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
+ below is for infrun.c, which may give the macro a pc without that
+ subtracted out. */
+
+extern CORE_ADDR text_end;
+
+int
+pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address)
+{
+ return ((pc) >= text_end - CALL_DUMMY_LENGTH
+ && (pc) <= text_end + DECR_PC_AFTER_BREAK);
+}
+
+int
+pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address)
+{
+ return ((pc) >= text_end
+ && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK);
+}
+
+/* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and
+ top of the stack frame which we are checking, where "bottom" and
+ "top" refer to some section of memory which contains the code for
+ the call dummy. Calls to this macro assume that the contents of
+ SP_REGNUM and FP_REGNUM (or the saved values thereof), respectively,
+ are the things to pass.
+
+ This won't work on the 29k, where SP_REGNUM and FP_REGNUM don't
+ have that meaning, but the 29k doesn't use ON_STACK. This could be
+ fixed by generalizing this scheme, perhaps by passing in a frame
+ and adding a few fields, at least on machines which need them for
+ PC_IN_CALL_DUMMY.
+
+ Something simpler, like checking for the stack segment, doesn't work,
+ since various programs (threads implementations, gcc nested function
+ stubs, etc) may either allocate stack frames in another segment, or
+ allocate other kinds of code on the stack. */
+
+int
+pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
+{
+ return (INNER_THAN ((sp), (pc))
+ && (frame_address != 0)
+ && INNER_THAN ((pc), (frame_address)));
+}
+
+int
+pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address)
+{
+ return ((pc) >= CALL_DUMMY_ADDRESS ()
+ && (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK));
+}
+
/*
* GENERIC DUMMY FRAMES
@@ -1042,7 +1027,7 @@ sigtramp_saved_pc (frame)
* The following code serves to maintain the dummy stack frames for
* inferior function calls (ie. when gdb calls into the inferior via
* call_function_by_hand). This code saves the machine state before
- * the call in host memory, so we must maintain an independant stack
+ * the call in host memory, so we must maintain an independent stack
* and keep it consistant etc. I am attempting to make this code
* generic enough to be used by many targets.
*
@@ -1051,7 +1036,23 @@ sigtramp_saved_pc (frame)
* zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
* to define PUSH_RETURN_ADDRESS, because no call instruction will be
* being executed by the target. Also FRAME_CHAIN_VALID as
- * generic_frame_chain_valid. */
+ * generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as
+ * generic_fix_call_dummy. */
+
+/* Dummy frame. This saves the processor state just prior to setting
+ up the inferior function call. Older targets save the registers
+ on the target stack (but that really slows down function calls). */
+
+struct dummy_frame
+{
+ struct dummy_frame *next;
+
+ CORE_ADDR pc;
+ CORE_ADDR fp;
+ CORE_ADDR sp;
+ CORE_ADDR top;
+ char *registers;
+};
static struct dummy_frame *dummy_frame_stack = NULL;
@@ -1059,21 +1060,21 @@ 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 *
-generic_find_dummy_frame (pc, fp)
- CORE_ADDR pc;
- CORE_ADDR fp;
+char *
+generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
- struct dummy_frame * dummyframe;
+ struct dummy_frame *dummyframe;
if (pc != entry_point_address ())
return 0;
for (dummyframe = dummy_frame_stack; dummyframe != NULL;
dummyframe = dummyframe->next)
- if (fp == dummyframe->fp || fp == dummyframe->sp)
+ if (fp == dummyframe->fp
+ || fp == dummyframe->sp
+ || fp == dummyframe->top)
/* The frame in question lies between the saved fp and sp, inclusive */
- return dummyframe->regs;
+ return dummyframe->registers;
return 0;
}
@@ -1082,28 +1083,24 @@ generic_find_dummy_frame (pc, fp)
Return true if this is a dummy frame created by gdb for an inferior call */
int
-generic_pc_in_call_dummy (pc, fp)
- CORE_ADDR pc;
- CORE_ADDR fp;
+generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
{
/* if find_dummy_frame succeeds, then PC is in a call dummy */
- return (generic_find_dummy_frame (pc, fp) != 0);
+ /* Note: SP and not FP is passed on. */
+ return (generic_find_dummy_frame (pc, sp) != 0);
}
/* Function: read_register_dummy
Find a saved register from before GDB calls a function in the inferior */
CORE_ADDR
-generic_read_register_dummy (pc, fp, regno)
- CORE_ADDR pc;
- CORE_ADDR fp;
- int regno;
+generic_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
{
char *dummy_regs = generic_find_dummy_frame (pc, fp);
if (dummy_regs)
return extract_address (&dummy_regs[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE(regno));
+ REGISTER_RAW_SIZE (regno));
else
return 0;
}
@@ -1116,7 +1113,7 @@ generic_read_register_dummy (pc, fp, regno)
where a breakpoint is laying in wait. */
void
-generic_push_dummy_frame ()
+generic_push_dummy_frame (void)
{
struct dummy_frame *dummy_frame;
CORE_ADDR fp = (get_current_frame ())->frame;
@@ -1130,41 +1127,50 @@ generic_push_dummy_frame ()
if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
{
dummy_frame_stack = dummy_frame->next;
- free (dummy_frame);
+ xfree (dummy_frame->registers);
+ xfree (dummy_frame);
dummy_frame = dummy_frame_stack;
}
else
dummy_frame = dummy_frame->next;
dummy_frame = xmalloc (sizeof (struct dummy_frame));
- dummy_frame->pc = read_register (PC_REGNUM);
- dummy_frame->sp = read_register (SP_REGNUM);
- dummy_frame->fp = fp;
- read_register_bytes (0, dummy_frame->regs, REGISTER_BYTES);
+ dummy_frame->registers = xmalloc (REGISTER_BYTES);
+
+ dummy_frame->pc = read_pc ();
+ dummy_frame->sp = read_sp ();
+ dummy_frame->top = dummy_frame->sp;
+ dummy_frame->fp = fp;
+ read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
dummy_frame->next = dummy_frame_stack;
dummy_frame_stack = dummy_frame;
}
-/* Function: pop_frame
- Restore the machine state from either the saved dummy stack or a
+void
+generic_save_dummy_frame_tos (CORE_ADDR sp)
+{
+ dummy_frame_stack->top = sp;
+}
+
+/* Restore the machine state from either the saved dummy stack or a
real stack frame. */
void
-generic_pop_current_frame (pop)
- void (*pop) PARAMS ((struct frame_info *frame));
+generic_pop_current_frame (void (*popper) (struct frame_info * frame))
{
struct frame_info *frame = get_current_frame ();
- if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
- pop (frame);
+ (*popper) (frame);
}
/* Function: pop_dummy_frame
Restore the machine state from a saved dummy stack frame. */
void
-generic_pop_dummy_frame ()
+generic_pop_dummy_frame (void)
{
struct dummy_frame *dummy_frame = dummy_frame_stack;
@@ -1174,28 +1180,51 @@ generic_pop_dummy_frame ()
if (!dummy_frame)
error ("Can't pop dummy frame!");
dummy_frame_stack = dummy_frame->next;
- write_register_bytes (0, dummy_frame->regs, REGISTER_BYTES);
+ write_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
flush_cached_frames ();
- free (dummy_frame);
+
+ xfree (dummy_frame->registers);
+ xfree (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;
+generic_file_frame_chain_valid (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)));
}
-
+
+int
+generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
+{
+ if (PC_IN_CALL_DUMMY ((fi)->pc, 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_main_func ((fi)->pc)
+ && !inside_entry_func ((fi)->pc));
+}
+
+/* Function: fix_call_dummy
+ Stub function. Generic dummy frames typically do not need to fix
+ the frame being created */
+
+void
+generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ struct value **args, struct type *type, int gcc_p)
+{
+ return;
+}
+
/* Function: get_saved_register
Find register number REGNUM relative to FRAME and put its (raw,
target format) contents in *RAW_BUFFER.
@@ -1210,7 +1239,7 @@ generic_frame_chain_valid (fp, fi)
calculated rather than fetched). We will use not_lval for values
fetched from generic dummy frames.
- Set *ADDRP to the address, either in memory on as a REGISTER_BYTE
+ Set *ADDRP to the address, either in memory or as a REGISTER_BYTE
offset into the registers array. If the value is stored in a dummy
frame, set *ADDRP to zero.
@@ -1221,13 +1250,9 @@ generic_frame_chain_valid (fp, fi)
The argument RAW_BUFFER must point to aligned memory. */
void
-generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
- char *raw_buffer;
- int *optimized;
- CORE_ADDR *addrp;
- struct frame_info *frame;
- int regnum;
- enum lval_type *lval;
+generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
+ struct frame_info *frame, int regnum,
+ enum lval_type *lval)
{
if (!target_has_registers)
error ("No registers.");
@@ -1236,7 +1261,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
@@ -1248,34 +1273,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;
@@ -1285,17 +1310,16 @@ 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);
if (raw_buffer)
read_register_gen (regnum, raw_buffer);
}
-#endif /* USE_GENERIC_DUMMY_FRAMES */
void
-_initialize_blockframe ()
+_initialize_blockframe (void)
{
obstack_init (&frame_cache_obstack);
}
diff --git a/contrib/gdb/gdb/breakpoint.c b/contrib/gdb/gdb/breakpoint.c
index 4b05949..640505e 100644
--- a/contrib/gdb/gdb/breakpoint.c
+++ b/contrib/gdb/gdb/breakpoint.c
@@ -1,22 +1,25 @@
/* Everything about breakpoints, for GDB.
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
- Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 <ctype.h>
@@ -38,174 +41,179 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "annotate.h"
#include "symfile.h"
#include "objfiles.h"
+#include "linespec.h"
+#include "completer.h"
+#include "gdb.h"
+#include "ui-out.h"
+
+#include "gdb-events.h"
/* Prototypes for local functions. */
-static void
-catch_command_1 PARAMS ((char *, int, int));
+static void until_break_command_continuation (struct continuation_arg *arg);
-static void
-enable_delete_command PARAMS ((char *, int));
+static void catch_command_1 (char *, int, int);
-static void
-enable_delete_breakpoint PARAMS ((struct breakpoint *));
+static void enable_delete_command (char *, int);
-static void
-enable_once_command PARAMS ((char *, int));
+static void enable_delete_breakpoint (struct breakpoint *);
-static void
-enable_once_breakpoint PARAMS ((struct breakpoint *));
+static void enable_once_command (char *, int);
-static void
-disable_command PARAMS ((char *, int));
+static void enable_once_breakpoint (struct breakpoint *);
-static void
-enable_command PARAMS ((char *, int));
+static void disable_command (char *, int);
-static void
-map_breakpoint_numbers PARAMS ((char *, void (*)(struct breakpoint *)));
+static void enable_command (char *, int);
-static void
-ignore_command PARAMS ((char *, int));
+static void map_breakpoint_numbers (char *, void (*)(struct breakpoint *));
-static int breakpoint_re_set_one PARAMS ((PTR));
+static void ignore_command (char *, int);
-static void
-clear_command PARAMS ((char *, int));
+static int breakpoint_re_set_one (PTR);
-static void
-catch_command PARAMS ((char *, int));
+static void clear_command (char *, int);
-static void
-handle_gnu_4_16_catch_command PARAMS ((char *, int, int));
+static void catch_command (char *, int);
-static struct symtabs_and_lines
-get_catch_sals PARAMS ((int));
+static void handle_gnu_4_16_catch_command (char *, int, int);
-static void
-watch_command PARAMS ((char *, int));
+static struct symtabs_and_lines get_catch_sals (int);
-static int
-can_use_hardware_watchpoint PARAMS ((struct value *));
+static void watch_command (char *, int);
-void
-tbreak_command PARAMS ((char *, int));
+static int can_use_hardware_watchpoint (struct value *);
-static void
-break_command_1 PARAMS ((char *, int, int));
+extern void break_at_finish_command (char *, int);
+extern void break_at_finish_at_depth_command (char *, int);
-static void
-mention PARAMS ((struct breakpoint *));
+extern void tbreak_at_finish_command (char *, int);
-struct breakpoint *
-set_raw_breakpoint PARAMS ((struct symtab_and_line));
+static void break_command_1 (char *, int, int);
-static void
-check_duplicates PARAMS ((CORE_ADDR, asection *));
+static void mention (struct breakpoint *);
-static void
-describe_other_breakpoints PARAMS ((CORE_ADDR, asection *));
+struct breakpoint *set_raw_breakpoint (struct symtab_and_line, enum bptype);
-static void
-breakpoints_info PARAMS ((char *, int));
+static void check_duplicates (struct breakpoint *);
-static void
-breakpoint_1 PARAMS ((int, int));
+static void describe_other_breakpoints (CORE_ADDR, asection *);
-static bpstat
-bpstat_alloc PARAMS ((struct breakpoint *, bpstat));
+static void breakpoints_info (char *, int);
-static int breakpoint_cond_eval PARAMS ((PTR));
+static void breakpoint_1 (int, int);
-static void
-cleanup_executing_breakpoints PARAMS ((PTR));
+static bpstat bpstat_alloc (struct breakpoint *, bpstat);
-static void
-commands_command PARAMS ((char *, int));
+static int breakpoint_cond_eval (PTR);
-static void
-condition_command PARAMS ((char *, int));
+static void cleanup_executing_breakpoints (PTR);
-static int
-get_number PARAMS ((char **));
+static void commands_command (char *, int);
-void
-set_breakpoint_count PARAMS ((int));
+static void condition_command (char *, int);
-#if 0
-static struct breakpoint *
-create_temp_exception_breakpoint PARAMS ((CORE_ADDR));
-#endif
+static int get_number_trailer (char **, int);
-typedef enum {
- mark_inserted,
- mark_uninserted
-} insertion_state_t;
+void set_breakpoint_count (int);
-static int
-remove_breakpoint PARAMS ((struct breakpoint *, insertion_state_t));
+typedef enum
+ {
+ mark_inserted,
+ mark_uninserted
+ }
+insertion_state_t;
-static int print_it_normal PARAMS ((bpstat));
+static int remove_breakpoint (struct breakpoint *, insertion_state_t);
-typedef struct {
- enum exception_event_kind kind;
- int enable;
-} args_for_catchpoint_enable;
+static enum print_stop_action print_it_typical (bpstat);
-static int watchpoint_check PARAMS ((PTR));
+static enum print_stop_action print_bp_stop_message (bpstat bs);
-static int cover_target_enable_exception_callback PARAMS ((PTR));
+typedef struct
+ {
+ enum exception_event_kind kind;
+ int enable_p;
+ }
+args_for_catchpoint_enable;
-static int print_it_done PARAMS ((bpstat));
+static int watchpoint_check (PTR);
-static int print_it_noop PARAMS ((bpstat));
+static int cover_target_enable_exception_callback (PTR);
-static void maintenance_info_breakpoints PARAMS ((char *, int));
+static void maintenance_info_breakpoints (char *, int);
-#ifdef GET_LONGJMP_TARGET
-static void create_longjmp_breakpoint PARAMS ((char *));
-#endif
+static void create_longjmp_breakpoint (char *);
-static int hw_breakpoint_used_count PARAMS ((void));
+static void create_overlay_event_breakpoint (char *);
-static int hw_watchpoint_used_count PARAMS ((enum bptype, int *));
+static int hw_breakpoint_used_count (void);
-static void hbreak_command PARAMS ((char *, int));
+static int hw_watchpoint_used_count (enum bptype, int *);
-static void thbreak_command PARAMS ((char *, int));
+static void hbreak_command (char *, int);
-static void watch_command_1 PARAMS ((char *, int, int));
+static void thbreak_command (char *, int);
-static void rwatch_command PARAMS ((char *, int));
+static void watch_command_1 (char *, int, int);
-static void awatch_command PARAMS ((char *, int));
+static void rwatch_command (char *, int);
-static void do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp));
+static void awatch_command (char *, int);
-/* Prototypes for exported functions. */
+static void do_enable_breakpoint (struct breakpoint *, enum bpdisp);
-static void
-awatch_command PARAMS ((char *, int));
+static void solib_load_unload_1 (char *hookname,
+ int tempflag,
+ char *dll_pathname,
+ char *cond_string, enum bptype bp_kind);
-static void
-do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp));
+static void create_fork_vfork_event_catchpoint (int tempflag,
+ char *cond_string,
+ enum bptype bp_kind);
-/* If FALSE, gdb will not use hardware support for watchpoints, even
- if such is available. */
-static int can_use_hw_watchpoints;
+static void break_at_finish_at_depth_command_1 (char *arg,
+ int flag, int from_tty);
+
+static void break_at_finish_command_1 (char *arg, int flag, int from_tty);
+
+static void stop_command (char *arg, int from_tty);
-void delete_command PARAMS ((char *, int));
+static void stopin_command (char *arg, int from_tty);
-void _initialize_breakpoint PARAMS ((void));
+static void stopat_command (char *arg, int from_tty);
-void set_breakpoint_count PARAMS ((int));
+static char *ep_find_event_name_end (char *arg);
-extern int addressprint; /* Print machine addresses? */
+static char *ep_parse_optional_if_clause (char **arg);
-#if defined (GET_LONGJMP_TARGET) || defined (SOLIB_ADD)
-static int internal_breakpoint_number = -1;
+static char *ep_parse_optional_filename (char **arg);
+
+#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
+static void catch_exec_command_1 (char *arg, int tempflag, int from_tty);
#endif
+static void create_exception_catchpoint (int tempflag, char *cond_string,
+ enum exception_event_kind ex_event,
+ struct symtab_and_line *sal);
+
+static void catch_exception_command_1 (enum exception_event_kind ex_event,
+ char *arg, int tempflag, int from_tty);
+
+static void tcatch_command (char *arg, int from_tty);
+
+static void ep_skip_leading_whitespace (char **s);
+
+/* Prototypes for exported functions. */
+
+/* If FALSE, gdb will not use hardware support for watchpoints, even
+ if such is available. */
+static int can_use_hw_watchpoints;
+
+void _initialize_breakpoint (void);
+
+extern int addressprint; /* Print machine addresses? */
+
/* Are we executing breakpoint commands? */
static int executing_breakpoint_commands;
@@ -213,12 +221,12 @@ static int executing_breakpoint_commands;
ALL_BREAKPOINTS_SAFE does so even if the statment deletes the current
breakpoint. */
-#define ALL_BREAKPOINTS(b) for (b = breakpoint_chain; b; b = b->next)
+#define ALL_BREAKPOINTS(B) for (B = breakpoint_chain; B; B = B->next)
-#define ALL_BREAKPOINTS_SAFE(b,tmp) \
- for (b = breakpoint_chain; \
- b? (tmp=b->next, 1): 0; \
- b = tmp)
+#define ALL_BREAKPOINTS_SAFE(B,TMP) \
+ for (B = breakpoint_chain; \
+ B ? (TMP=B->next, 1): 0; \
+ B = TMP)
/* True if SHIFT_INST_REGS defined, false otherwise. */
@@ -228,7 +236,7 @@ int must_shift_inst_regs =
#else
0
#endif
-;
+ ;
/* True if breakpoint hit counts should be displayed in breakpoint info. */
@@ -242,13 +250,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;
@@ -309,8 +317,7 @@ int exception_support_initialized = 0;
/* Set breakpoint count to NUM. */
void
-set_breakpoint_count (num)
- int num;
+set_breakpoint_count (int num)
{
breakpoint_count = num;
set_internalvar (lookup_internalvar ("bpnum"),
@@ -320,7 +327,7 @@ set_breakpoint_count (num)
/* Used in run_command to zero the hit count when a new run starts. */
void
-clear_breakpoint_hit_counts ()
+clear_breakpoint_hit_counts (void)
{
struct breakpoint *b;
@@ -345,12 +352,14 @@ int default_breakpoint_line;
Currently the string can either be a number or "$" followed by the name
of a convenience variable. Making it an expression wouldn't work well
- for map_breakpoint_numbers (e.g. "4 + 5 + 6"). */
+ for map_breakpoint_numbers (e.g. "4 + 5 + 6").
+
+ TRAILER is a character which can be found after the number; most
+ commonly this is `-'. If you don't want a trailer, use \0. */
static int
-get_number (pp)
- char **pp;
+get_number_trailer (char **pp, int trailer)
{
- int retval;
+ int retval = 0; /* default */
char *p = *pp;
if (p == NULL)
@@ -359,10 +368,10 @@ 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;
+ struct value *val;
while (isalnum (*p) || *p == '_')
p++;
@@ -370,11 +379,13 @@ get_number (pp)
strncpy (varname, start, p - start);
varname[p - start] = '\0';
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."
- );
- retval = (int) value_as_long (val);
+ if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT)
+ retval = (int) value_as_long (val);
+ else
+ {
+ printf_filtered ("Convenience variable must have integer value.\n");
+ retval = 0;
+ }
}
else
{
@@ -384,23 +395,119 @@ get_number (pp)
++p;
if (p == *pp)
/* There is no number here. (e.g. "cond a == b"). */
- error_no_arg ("breakpoint number");
- retval = atoi (*pp);
+ {
+ /* Skip non-numeric token */
+ while (*p && !isspace((int) *p))
+ ++p;
+ /* Return zero, which caller must interpret as error. */
+ retval = 0;
+ }
+ else
+ retval = atoi (*pp);
+ }
+ if (!(isspace (*p) || *p == '\0' || *p == trailer))
+ {
+ /* Trailing junk: return 0 and let caller print error msg. */
+ while (!(isspace (*p) || *p == '\0' || *p == trailer))
+ ++p;
+ retval = 0;
}
- if (!(isspace (*p) || *p == '\0'))
- error ("breakpoint number expected");
while (isspace (*p))
p++;
*pp = p;
return retval;
}
+
+
+/* Like get_number_trailer, but don't allow a trailer. */
+int
+get_number (char **pp)
+{
+ return get_number_trailer (pp, '\0');
+}
+
+/* Parse a number or a range.
+ * A number will be of the form handled by get_number.
+ * A range will be of the form <number1> - <number2>, and
+ * will represent all the integers between number1 and number2,
+ * inclusive.
+ *
+ * While processing a range, this fuction is called iteratively;
+ * At each call it will return the next value in the range.
+ *
+ * At the beginning of parsing a range, the char pointer PP will
+ * be advanced past <number1> and left pointing at the '-' token.
+ * Subsequent calls will not advance the pointer until the range
+ * is completed. The call that completes the range will advance
+ * pointer PP past <number2>.
+ */
+
+int
+get_number_or_range (char **pp)
+{
+ static int last_retval, end_value;
+ static char *end_ptr;
+ static int in_range = 0;
+
+ if (**pp != '-')
+ {
+ /* Default case: pp is pointing either to a solo number,
+ or to the first number of a range. */
+ last_retval = get_number_trailer (pp, '-');
+ if (**pp == '-')
+ {
+ char **temp;
+
+ /* This is the start of a range (<number1> - <number2>).
+ Skip the '-', parse and remember the second number,
+ and also remember the end of the final token. */
+
+ temp = &end_ptr;
+ end_ptr = *pp + 1;
+ while (isspace ((int) *end_ptr))
+ end_ptr++; /* skip white space */
+ end_value = get_number (temp);
+ if (end_value < last_retval)
+ {
+ error ("inverted range");
+ }
+ else if (end_value == last_retval)
+ {
+ /* degenerate range (number1 == number2). Advance the
+ token pointer so that the range will be treated as a
+ single number. */
+ *pp = end_ptr;
+ }
+ else
+ in_range = 1;
+ }
+ }
+ else if (! in_range)
+ error ("negative value");
+ else
+ {
+ /* pp points to the '-' that betokens a range. All
+ number-parsing has already been done. Return the next
+ integer value (one greater than the saved previous value).
+ Do not advance the token pointer 'pp' until the end of range
+ is reached. */
+
+ if (++last_retval == end_value)
+ {
+ /* End of range reached; advance token pointer. */
+ *pp = end_ptr;
+ in_range = 0;
+ }
+ }
+ return last_retval;
+}
+
+
/* condition N EXP -- set break condition of breakpoint N to EXP. */
static void
-condition_command (arg, from_tty)
- char *arg;
- int from_tty;
+condition_command (char *arg, int from_tty)
{
register struct breakpoint *b;
char *p;
@@ -411,47 +518,47 @@ condition_command (arg, from_tty)
p = arg;
bnum = get_number (&p);
+ if (bnum == 0)
+ error ("Bad breakpoint argument: '%s'", arg);
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)
+ {
+ xfree (b->cond);
+ b->cond = 0;
+ }
+ if (b->cond_string != NULL)
+ xfree (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);
}
/* ARGSUSED */
static void
-commands_command (arg, from_tty)
- char *arg;
- int from_tty;
+commands_command (char *arg, int from_tty)
{
register struct breakpoint *b;
char *p;
@@ -467,20 +574,23 @@ commands_command (arg, from_tty)
p = arg;
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);
}
@@ -493,10 +603,7 @@ commands_command (arg, from_tty)
shadow contents, not the breakpoints themselves. From breakpoint.c. */
int
-read_memory_nobpt (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- unsigned len;
+read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
{
int status;
struct breakpoint *b;
@@ -506,100 +613,101 @@ 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 ("reading through apparently deleted breakpoint #%d?",
+ 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);
}
-
+
/* insert_breakpoints is used when starting or continuing the program.
remove_breakpoints is used when the program stops.
Both return zero if successful,
or an `errno' value if could not write the inferior. */
int
-insert_breakpoints ()
+insert_breakpoints (void)
{
register struct breakpoint *b, *temp;
+ int return_val = 0; /* return success code. */
int val = 0;
int disabled_breaks = 0;
@@ -608,112 +716,118 @@ 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->enable_state == bp_permanent)
+ /* Permanent breakpoints cannot be inserted or removed. */
+ continue;
+ else 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_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_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_state = bp_shlib_disabled;
+ if (!disabled_breaks)
+ {
+ target_terminal_ours_for_output ();
+ warning ("Cannot insert breakpoint %d:", b->number);
+ warning ("Temporarily disabling shared library breakpoints:");
+ }
+ disabled_breaks = 1;
+ warning ("breakpoint #%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 ();
+ warning ("Cannot insert breakpoint %d:", b->number);
#ifdef ONE_PROCESS_WRITETEXT
- fprintf_unfiltered (gdb_stderr,
- "The same program may be running in another process.\n");
+ warning ("The same program may be running in another process.");
#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;
+
+ if (val)
+ return_val = val; /* remember failure */
+ }
else if (ep_is_exception_catchpoint (b)
- && b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
- && ! b->inserted
- && ! b->duplicate)
+ && b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_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. */
+ /* Format possible error message */
+ sprintf (message, message1, b->number);
+
+ val = target_insert_breakpoint (b->address, b->shadow_contents);
+ if (val)
+ {
+ /* Couldn't set breakpoint for some reason */
+ target_terminal_ours_for_output ();
+ warning ("Cannot insert catchpoint %d; disabling it.",
+ b->number);
+ b->enable_state = bp_disabled;
+ }
+ else
+ {
+ /* Bp set, now make sure callbacks are enabled */
int val;
- args_for_catchpoint_enable args;
- args.kind = b->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW;
- args.enable = 1;
+ args_for_catchpoint_enable args;
+ args.kind = b->type == bp_catch_catch ?
+ EX_EVENT_CATCH : EX_EVENT_THROW;
+ args.enable_p = 1;
val = catch_errors (cover_target_enable_exception_callback,
&args,
message, RETURN_MASK_ALL);
@@ -721,196 +835,257 @@ 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;
+ warning ("Cannot insert catchpoint %d; disabling it.",
+ b->number);
+ b->enable_state = bp_disabled;
}
- }
+ }
+
+ if (val)
+ return_val = val; /* remember failure */
}
- 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",
+ else if ((b->type == bp_hardware_watchpoint ||
+ b->type == bp_read_watchpoint ||
+ b->type == bp_access_watchpoint)
+ && b->enable_state == bp_enabled
+ && b->disposition != disp_del_at_next_stop
+ && !b->inserted
+ && !b->duplicate)
+ {
+ struct frame_info *saved_frame;
+ int saved_level, within_current_scope;
+ struct value *mark = value_mark ();
+ struct value *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.
+
+ Make sure the value returned isn't lazy; we use
+ laziness to determine what memory GDB actually needed
+ in order to compute the value of the expression. */
+ v = evaluate_expression (b->exp);
+ VALUE_CONTENTS(v);
+ 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, and GDB actually needed
+ its contents to evaluate the expression, then we
+ must watch it. */
+ if (VALUE_LVAL (v) == lval_memory
+ && ! VALUE_LAZY (v))
+ {
+ struct type *vtype = check_typedef (VALUE_TYPE (v));
+
+ /* We only watch structs and arrays if user asked
+ for it explicitly, never if they just happen to
+ appear in the middle of some value chain. */
+ if (v == b->val_chain
+ || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR addr;
+ int len, type;
+
+ addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ len = TYPE_LENGTH (VALUE_TYPE (v));
+ type = hw_write;
+ if (b->type == bp_read_watchpoint)
+ type = hw_read;
+ else if (b->type == bp_access_watchpoint)
+ type = hw_access;
+
+ val = target_insert_watchpoint (addr, len, type);
+ if (val == -1)
+ {
+ /* Don't exit the loop, try to insert
+ every value on the value chain. That's
+ because we will be removing all the
+ watches below, and removing a
+ watchpoint we didn't insert could have
+ adverse effects. */
+ b->inserted = 0;
+ }
+ val = 0;
+ }
+ }
+ }
+ /* Failure to insert a watchpoint on any memory value in the
+ value chain brings us here. */
+ if (!b->inserted)
+ {
+ remove_breakpoint (b, mark_uninserted);
+ warning ("Could not insert hardware watchpoint %d.",
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;
- }
+ val = -1;
+ }
+ }
+ else
+ {
+ printf_filtered ("Hardware watchpoint %d deleted ", b->number);
+ printf_filtered ("because the program has left the block \n");
+ printf_filtered ("in which its expression is valid.\n");
+ if (b->related_breakpoint)
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_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;
- }
- 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");
+ /* Restore the frame and level. */
+ if ((saved_frame != selected_frame) ||
+ (saved_level != selected_frame_level))
+ select_frame (saved_frame, saved_level);
- return val;
+ if (val)
+ return_val = val; /* remember failure */
+ }
+ else if ((b->type == bp_catch_fork
+ || b->type == bp_catch_vfork
+ || b->type == bp_catch_exec)
+ && b->enable_state == bp_enabled
+ && !b->inserted
+ && !b->duplicate)
+ {
+ val = -1;
+ switch (b->type)
+ {
+ case bp_catch_fork:
+ val = target_insert_fork_catchpoint (PIDGET (inferior_ptid));
+ break;
+ case bp_catch_vfork:
+ val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
+ break;
+ case bp_catch_exec:
+ val = target_insert_exec_catchpoint (PIDGET (inferior_ptid));
+ break;
+ default:
+ warning ("Internal error, %s line %d.", __FILE__, __LINE__);
+ break;
+ }
+ if (val < 0)
+ {
+ target_terminal_ours_for_output ();
+ warning ("Cannot insert catchpoint %d.", b->number);
+ }
+ else
+ b->inserted = 1;
+
+ if (val)
+ return_val = val; /* remember failure */
+ }
+ }
+
+ return return_val;
}
int
-remove_breakpoints ()
+remove_breakpoints (void)
{
register struct breakpoint *b;
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;
+remove_hw_watchpoints (void)
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
ALL_BREAKPOINTS (b)
- {
- if (b->inserted)
- {
- remove_breakpoint (b, mark_inserted);
- if (b->type == bp_hardware_breakpoint)
- val = target_insert_hw_breakpoint(b->address, b->shadow_contents);
- else
- val = target_insert_breakpoint(b->address, b->shadow_contents);
- if (val != 0)
- {
- inferior_pid = saved_inferior_pid;
- return val;
- }
- }
- }
- inferior_pid = saved_inferior_pid;
+ {
+ if (b->inserted
+ && (b->type == bp_hardware_watchpoint
+ || b->type == bp_read_watchpoint
+ || b->type == bp_access_watchpoint))
+ {
+ val = remove_breakpoint (b, mark_uninserted);
+ if (val != 0)
+ return val;
+ }
+ }
+ return 0;
+}
+
+int
+reattach_breakpoints (int pid)
+{
+ register struct breakpoint *b;
+ int val;
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ /* Set inferior_ptid; remove_breakpoint uses this global. */
+ inferior_ptid = pid_to_ptid (pid);
+ 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)
+ {
+ do_cleanups (old_chain);
+ return val;
+ }
+ }
+ }
+ do_cleanups (old_chain);
return 0;
}
void
-update_breakpoints_after_exec ()
+update_breakpoints_after_exec (void)
{
- 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
@@ -918,137 +1093,168 @@ 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;
- }
+ /* Thread event breakpoints must be set anew after an exec(),
+ as must overlay event breakpoints. */
+ if (b->type == bp_thread_event || b->type == bp_overlay_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.
+
+ Jim Blandy <jimb@redhat.com>: Actually, zero is a perfectly
+ valid code address on some platforms (like the mn10200 and
+ mn10300 simulators). We shouldn't assign any special
+ interpretation to a breakpoint with a zero address. And in
+ fact, GDB doesn't --- I can't see what that comment above is
+ talking about. As far as I can tell, setting the address of a
+ bp_catch_exec/bp_catch_vfork/bp_catch_fork breakpoint to zero
+ is meaningless, since those are implemented with HP-UX kernel
+ hackery, not by storing breakpoint instructions somewhere. */
+ 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.
+
+ Jim Blandy <jimb@redhat.com>: As explained above in the comment
+ for bp_catch_exec and friends, I'm pretty sure this is entirely
+ unnecessary. A call to breakpoint_re_set_one always recomputes
+ the breakpoint's address from scratch, or deletes it if it can't.
+ So I think this assignment could be deleted without effect. */
+ b->address = (CORE_ADDR) NULL;
+ }
+ /* FIXME what about longjmp breakpoints? Re-create them here? */
+ create_overlay_event_breakpoint ("_ovly_debug_event");
}
int
-detach_breakpoints (pid)
- int pid;
+detach_breakpoints (int pid)
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
-
- if (pid == inferior_pid)
- error ("Cannot detach breakpoints of inferior_pid");
-
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ if (pid == PIDGET (inferior_ptid))
+ error ("Cannot detach breakpoints of inferior_ptid");
+
+ /* Set inferior_ptid; remove_breakpoint uses this global. */
+ inferior_ptid = pid_to_ptid (pid);
ALL_BREAKPOINTS (b)
- {
- if (b->inserted)
- {
- val = remove_breakpoint (b, mark_inserted);
- if (val != 0)
- {
- inferior_pid = saved_inferior_pid;
- return val;
- }
- }
- }
- inferior_pid = saved_inferior_pid;
+ {
+ if (b->inserted)
+ {
+ val = remove_breakpoint (b, mark_inserted);
+ if (val != 0)
+ {
+ do_cleanups (old_chain);
+ return val;
+ }
+ }
+ }
+ do_cleanups (old_chain);
return 0;
}
static int
-remove_breakpoint (b, is)
- struct breakpoint *b;
- insertion_state_t is;
+remove_breakpoint (struct breakpoint *b, insertion_state_t is)
{
int val;
-
+
+ if (b->enable_state == bp_permanent)
+ /* Permanent breakpoints cannot be inserted or removed. */
+ return 0;
+
if (b->type == bp_none)
- warning ("attempted to remove apparently deleted breakpoint #%d?\n", b->number);
+ warning ("attempted to remove apparently deleted breakpoint #%d?",
+ b->number);
if (b->type != bp_watchpoint
&& b->type != bp_hardware_watchpoint
@@ -1059,78 +1265,87 @@ 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 &&
- section_is_overlay (b->section))
+ presumably remove the breakpoint there as well. */
+ if (overlay_debugging && b->section
+ && section_is_overlay (b->section))
{
CORE_ADDR addr;
addr = overlay_unmapped_address (b->address, b->section);
val = target_remove_breakpoint (addr, b->shadow_contents);
/* This would be the time to check val, to see if the
- shadow breakpoint write to the load address succeeded.
- However, this might be an ordinary occurrance, eg. if
- the unmapped overlay is in ROM. */
- val = 0; /* in case unmapped address failed */
+ 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->enable == enabled
- && ! b->duplicate)
+ b->type == bp_read_watchpoint ||
+ b->type == bp_access_watchpoint)
+ && b->enable_state == bp_enabled
+ && !b->duplicate)
{
- value_ptr v, n;
-
+ struct value *v;
+ struct value *n;
+
b->inserted = (is == mark_inserted);
/* Walk down the saved value chain. */
for (v = b->val_chain; v; v = v->next)
{
/* For each memory reference remove the watchpoint
at that address. */
- if (v->lval == lval_memory)
+ if (VALUE_LVAL (v) == lval_memory
+ && ! VALUE_LAZY (v))
{
- 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;
+ struct type *vtype = check_typedef (VALUE_TYPE (v));
- val = target_remove_watchpoint (addr, len, type);
- if (val == -1)
- b->inserted = 1;
- val = 0;
+ if (v == b->val_chain
+ || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR addr;
+ int len, type;
+
+ addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ len = TYPE_LENGTH (VALUE_TYPE (v));
+ type = hw_write;
+ if (b->type == bp_read_watchpoint)
+ type = hw_read;
+ else if (b->type == bp_access_watchpoint)
+ type = hw_access;
+
+ val = target_remove_watchpoint (addr, len, type);
+ if (val == -1)
+ b->inserted = 1;
+ val = 0;
+ }
}
}
/* Failure to remove any of the hardware watchpoints comes here. */
if ((is == mark_uninserted) && (b->inserted))
- warning ("Hardware watchpoint %d: Could not remove watchpoint\n",
+ warning ("Could not remove hardware watchpoint %d.",
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;
@@ -1139,49 +1354,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->enable == enabled
- && ! b->duplicate)
+ b->type == bp_catch_vfork ||
+ b->type == bp_catch_exec)
+ && b->enable_state == bp_enabled
+ && !b->duplicate)
{
val = -1;
switch (b->type)
- {
- case bp_catch_fork:
- val = target_remove_fork_catchpoint (inferior_pid);
- break;
- case bp_catch_vfork :
- val = target_remove_vfork_catchpoint (inferior_pid);
- break;
- case bp_catch_exec :
- val = target_remove_exec_catchpoint (inferior_pid);
- break;
- }
+ {
+ case bp_catch_fork:
+ val = target_remove_fork_catchpoint (PIDGET (inferior_ptid));
+ break;
+ case bp_catch_vfork:
+ val = target_remove_vfork_catchpoint (PIDGET (inferior_ptid));
+ break;
+ case bp_catch_exec:
+ val = target_remove_exec_catchpoint (PIDGET (inferior_ptid));
+ break;
+ default:
+ warning ("Internal error, %s line %d.", __FILE__, __LINE__);
+ 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_state == bp_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_state == bp_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);
}
@@ -1191,7 +1409,7 @@ remove_breakpoint (b, is)
/* Clear the "inserted" flag in all breakpoints. */
void
-mark_breakpoints_out ()
+mark_breakpoints_out (void)
{
register struct breakpoint *b;
@@ -1199,198 +1417,201 @@ mark_breakpoints_out ()
b->inserted = 0;
}
-/* Clear the "inserted" flag in all breakpoints and delete any breakpoints
- which should go away between runs of the program.
+/* Clear the "inserted" flag in all breakpoints and delete any
+ breakpoints which should go away between runs of the program.
Plus other such housekeeping that has to be done for breakpoints
between runs.
- Note: this function gets called at the end of a run (by generic_mourn_inferior)
- and when a run begins (by init_wait_for_inferior). */
+ Note: this function gets called at the end of a run (by
+ generic_mourn_inferior) and when a run begins (by
+ init_wait_for_inferior). */
void
-breakpoint_init_inferior (context)
- enum inf_context context;
+breakpoint_init_inferior (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 ("Exception catchpoints from last run were deleted.");
+ warning ("You must reinsert them explicitly.");
warning_needed = 0;
- }
+ }
}
-/* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC.
- When continuing from a location with a breakpoint,
- we actually single step once before calling insert_breakpoints. */
+/* breakpoint_here_p (PC) returns non-zero if an enabled breakpoint
+ exists at PC. It returns ordinary_breakpoint_here if it's an
+ ordinary breakpoint, or permanent_breakpoint_here if it's a
+ permanent breakpoint.
+ - When continuing from a location with an ordinary breakpoint, we
+ actually single step once before calling insert_breakpoints.
+ - When continuing from a localion with a permanent breakpoint, we
+ need to use the `SKIP_PERMANENT_BREAKPOINT' macro, provided by
+ the target, to advance the PC past the breakpoint. */
-int
-breakpoint_here_p (pc)
- CORE_ADDR pc;
+enum breakpoint_here
+breakpoint_here_p (CORE_ADDR pc)
{
register struct breakpoint *b;
+ int any_breakpoint_here = 0;
ALL_BREAKPOINTS (b)
- if (b->enable == enabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ if ((b->enable_state == bp_enabled
+ || b->enable_state == bp_permanent)
&& b->address == pc) /* bp is enabled and matches pc */
{
- if (overlay_debugging &&
- section_is_overlay (b->section) &&
- !section_is_mapped (b->section))
+ if (overlay_debugging
+ && section_is_overlay (b->section)
+ && !section_is_mapped (b->section))
continue; /* unmapped overlay -- can't be a match */
- else
- return 1;
+ else if (b->enable_state == bp_permanent)
+ return permanent_breakpoint_here;
+ else
+ any_breakpoint_here = 1;
}
- return 0;
+ return any_breakpoint_here ? ordinary_breakpoint_here : 0;
}
-/* breakpoint_inserted_here_p (PC) is just like breakpoint_here_p(), but it
- only returns true if there is actually a breakpoint inserted at PC. */
+
+/* breakpoint_inserted_here_p (PC) is just like breakpoint_here_p(),
+ but it only returns true if there is actually a breakpoint inserted
+ at PC. */
int
-breakpoint_inserted_here_p (pc)
- CORE_ADDR pc;
+breakpoint_inserted_here_p (CORE_ADDR pc)
{
register struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->inserted
&& b->address == pc) /* bp is inserted and matches pc */
- {
- if (overlay_debugging &&
- section_is_overlay (b->section) &&
- !section_is_mapped (b->section))
- continue; /* unmapped overlay -- can't be a match */
- else
- return 1;
- }
+ {
+ 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;
}
-/* Return nonzero if FRAME is a dummy frame. We can't use PC_IN_CALL_DUMMY
- because figuring out the saved SP would take too much time, at least using
- get_saved_register on the 68k. This means that for this function to
- work right a port must use the bp_call_dummy breakpoint. */
+/* Return nonzero if FRAME is a dummy frame. We can't use
+ PC_IN_CALL_DUMMY because figuring out the saved SP would take too
+ much time, at least using get_saved_register on the 68k. This
+ means that for this function to work right a port must use the
+ bp_call_dummy breakpoint. */
int
-frame_in_dummy (frame)
- struct frame_info *frame;
+frame_in_dummy (struct frame_info *frame)
{
-#ifdef CALL_DUMMY
-#ifdef USE_GENERIC_DUMMY_FRAMES
- return generic_pc_in_call_dummy (frame->pc, frame->frame);
-#else
struct breakpoint *b;
- ALL_BREAKPOINTS (b)
- {
- static ULONGEST dummy[] = CALL_DUMMY;
+ if (!CALL_DUMMY_P)
+ return 0;
- if (b->type == bp_call_dummy
- && b->frame == frame->frame
+ if (USE_GENERIC_DUMMY_FRAMES)
+ return generic_pc_in_call_dummy (frame->pc, frame->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 (dummy) / sizeof (LONGEST) * REGISTER_SIZE))
- && frame->pc <= b->address)
- return 1;
- }
-#endif /* GENERIC_DUMMY_FRAMES */
-#endif /* CALL_DUMMY */
+ 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;
+ }
return 0;
}
-/* breakpoint_match_thread (PC, PID) returns true if the breakpoint at PC
- is valid for process/thread PID. */
+/* breakpoint_thread_match (PC, PID) returns true if the breakpoint at
+ PC is valid for process/thread PID. */
int
-breakpoint_thread_match (pc, pid)
- CORE_ADDR pc;
- int pid;
+breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
{
struct breakpoint *b;
int thread;
- thread = pid_to_thread_id (pid);
+ thread = pid_to_thread_id (ptid);
ALL_BREAKPOINTS (b)
- if (b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_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;
}
-
+
/* bpstat stuff. External routines' interfaces are documented
in breakpoint.h. */
int
-ep_is_catchpoint (ep)
- struct breakpoint * ep;
+ep_is_catchpoint (struct breakpoint *ep)
{
return
(ep->type == bp_catch_load)
@@ -1399,39 +1620,32 @@ ep_is_catchpoint (ep)
|| (ep->type == bp_catch_vfork)
|| (ep->type == bp_catch_exec)
|| (ep->type == bp_catch_catch)
- || (ep->type == bp_catch_throw)
-
+ || (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;
+ep_is_shlib_catchpoint (struct breakpoint *ep)
{
return
(ep->type == bp_catch_load)
- || (ep->type == bp_catch_unload)
- ;
+ || (ep->type == bp_catch_unload);
}
int
-ep_is_exception_catchpoint (ep)
- struct breakpoint * ep;
+ep_is_exception_catchpoint (struct breakpoint *ep)
{
return
(ep->type == bp_catch_catch)
- || (ep->type == bp_catch_throw)
- ;
+ || (ep->type == bp_catch_throw);
}
/* Clear a bpstat so that it says we are not at any breakpoint.
Also free any storage that is part of a bpstat. */
void
-bpstat_clear (bsp)
- bpstat *bsp;
+bpstat_clear (bpstat *bsp)
{
bpstat p;
bpstat q;
@@ -1444,7 +1658,7 @@ bpstat_clear (bsp)
q = p->next;
if (p->old_val != NULL)
value_free (p->old_val);
- free ((PTR)p);
+ xfree (p);
p = q;
}
*bsp = NULL;
@@ -1454,8 +1668,7 @@ bpstat_clear (bsp)
is part of the bpstat is copied as well. */
bpstat
-bpstat_copy (bs)
- bpstat bs;
+bpstat_copy (bpstat bs)
{
bpstat p = NULL;
bpstat tmp;
@@ -1482,15 +1695,16 @@ bpstat_copy (bs)
/* Find the bpstat associated with this breakpoint */
bpstat
-bpstat_find_breakpoint(bsp, breakpoint)
- bpstat bsp;
- struct breakpoint *breakpoint;
+bpstat_find_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;
}
@@ -1503,17 +1717,22 @@ 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_find_step_resume_breakpoint (bpstat bsp)
{
+ int current_thread;
+
if (bsp == NULL)
error ("Internal error (bpstat_find_step_resume_breakpoint)");
+ current_thread = pid_to_thread_id (inferior_ptid);
+
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) &&
+ (bsp->breakpoint_at->thread == current_thread ||
+ bsp->breakpoint_at->thread == -1))
+ return bsp->breakpoint_at;
}
error ("Internal error (no step_resume breakpoint found)");
@@ -1527,8 +1746,7 @@ bpstat_find_step_resume_breakpoint (bsp)
Return 0 if passed a bpstat which does not indicate any breakpoints. */
int
-bpstat_num (bsp)
- bpstat *bsp;
+bpstat_num (bpstat *bsp)
{
struct breakpoint *b;
@@ -1541,15 +1759,14 @@ 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 */
}
}
/* Modify BS so that the actions will not be performed. */
void
-bpstat_clear_actions (bs)
- bpstat bs;
+bpstat_clear_actions (bpstat bs)
{
for (; bs != NULL; bs = bs->next)
{
@@ -1565,8 +1782,7 @@ bpstat_clear_actions (bs)
/* Stub for cleaning up our state if we error-out of a breakpoint command */
/* ARGSUSED */
static void
-cleanup_executing_breakpoints (ignore)
- PTR ignore;
+cleanup_executing_breakpoints (PTR ignore)
{
executing_breakpoint_commands = 0;
}
@@ -1577,8 +1793,7 @@ cleanup_executing_breakpoints (ignore)
the global "breakpoint_proceeded" after each command. */
void
-bpstat_do_actions (bsp)
- bpstat *bsp;
+bpstat_do_actions (bpstat *bsp)
{
bpstat bs;
struct cleanup *old_chain;
@@ -1631,220 +1846,351 @@ top:
discard_cleanups (old_chain);
}
-/* This is the normal print_it function for a bpstat. In the future,
+/* This is the normal print function for a bpstat. In the future,
much of this logic could (should?) be moved to bpstat_stop_status,
- by having it set different print_it functions.
-
- Current scheme: When we stop, bpstat_print() is called.
- It loops through the bpstat list of things causing this stop,
- calling the print_it function for each one. The default
- print_it function, used for breakpoints, is print_it_normal().
- (Also see print_it_noop() and print_it_done()).
-
- Return values from this routine (used by bpstat_print() to
- decide what to do):
- 1: Means we printed something, and we do *not* desire that
- something to be followed by a location.
- 0: Means we printed something, and we *do* desire that
- something to be followed by a location.
- -1: Means we printed nothing. */
-
-static int
-print_it_normal (bs)
- bpstat bs;
+ by having it set different print_it values.
+
+ Current scheme: When we stop, bpstat_print() is called. It loops
+ through the bpstat list of things causing this stop, calling the
+ print_bp_stop_message function on each one. The behavior of the
+ print_bp_stop_message function depends on the print_it field of
+ bpstat. If such field so indicates, call this function here.
+
+ Return values from this routine (ultimately used by bpstat_print()
+ and normal_stop() to decide what to do):
+ PRINT_NOTHING: Means we already printed all we needed to print,
+ don't print anything else.
+ PRINT_SRC_ONLY: Means we printed something, and we do *not* desire
+ that something to be followed by a location.
+ PRINT_SCR_AND_LOC: Means we printed something, and we *do* desire
+ that something to be followed by a location.
+ PRINT_UNKNOWN: Means we printed nothing or we need to do some more
+ analysis. */
+
+static enum print_stop_action
+print_it_typical (bpstat bs)
{
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
/* bs->breakpoint_at can be NULL if it was a momentary breakpoint
which has since been deleted. */
- if (bs->breakpoint_at == NULL
- || (bs->breakpoint_at->type != bp_breakpoint
- && bs->breakpoint_at->type != bp_catch_load
- && bs->breakpoint_at->type != bp_catch_unload
- && bs->breakpoint_at->type != bp_catch_fork
- && bs->breakpoint_at->type != bp_catch_vfork
- && bs->breakpoint_at->type != bp_catch_exec
- && bs->breakpoint_at->type != bp_catch_catch
- && bs->breakpoint_at->type != bp_catch_throw
- && bs->breakpoint_at->type != bp_hardware_breakpoint
- && bs->breakpoint_at->type != bp_watchpoint
- && bs->breakpoint_at->type != bp_read_watchpoint
- && bs->breakpoint_at->type != bp_access_watchpoint
- && bs->breakpoint_at->type != bp_hardware_watchpoint))
- return -1;
+ if (bs->breakpoint_at == NULL)
+ return PRINT_UNKNOWN;
- if (ep_is_shlib_catchpoint (bs->breakpoint_at))
+ switch (bs->breakpoint_at->type)
{
+ case bp_breakpoint:
+ case bp_hardware_breakpoint:
+ annotate_breakpoint (bs->breakpoint_at->number);
+ ui_out_text (uiout, "\nBreakpoint ");
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "breakpoint-hit");
+ ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_text (uiout, ", ");
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case bp_shlib_event:
+ /* Did we stop because the user set the stop_on_solib_events
+ variable? (If so, we report this as a generic, "Stopped due
+ to shlib event" message.) */
+ printf_filtered ("Stopped due to shared library event\n");
+ return PRINT_NOTHING;
+ break;
+
+ case bp_thread_event:
+ /* Not sure how we will get here.
+ GDB should not stop for these breakpoints. */
+ printf_filtered ("Thread Event Breakpoint: gdb should not stop!\n");
+ return PRINT_NOTHING;
+ break;
+
+ case bp_overlay_event:
+ /* By analogy with the thread event, GDB should not stop for these. */
+ printf_filtered ("Overlay Event Breakpoint: gdb should not stop!\n");
+ return PRINT_NOTHING;
+ break;
+
+ case bp_catch_load:
annotate_catchpoint (bs->breakpoint_at->number);
printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
- if (bs->breakpoint_at->type == bp_catch_load)
- printf_filtered ("loaded");
- else if (bs->breakpoint_at->type == bp_catch_unload)
- printf_filtered ("unloaded");
+ printf_filtered ("loaded");
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)
- {
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case bp_catch_unload:
annotate_catchpoint (bs->breakpoint_at->number);
printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
- if (bs->breakpoint_at->type == bp_catch_fork)
- printf_filtered ("forked");
- else if (bs->breakpoint_at->type == bp_catch_vfork)
- printf_filtered ("vforked");
- printf_filtered (" process %d), ", bs->breakpoint_at->forked_inferior_pid);
- return 0;
- }
- else if (bs->breakpoint_at->type == bp_catch_exec)
- {
+ printf_filtered ("unloaded");
+ printf_filtered (" %s), ", bs->breakpoint_at->triggered_dll_pathname);
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case bp_catch_fork:
+ annotate_catchpoint (bs->breakpoint_at->number);
+ printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
+ printf_filtered ("forked");
+ printf_filtered (" process %d), ",
+ bs->breakpoint_at->forked_inferior_pid);
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case bp_catch_vfork:
+ annotate_catchpoint (bs->breakpoint_at->number);
+ printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
+ printf_filtered ("vforked");
+ printf_filtered (" process %d), ",
+ bs->breakpoint_at->forked_inferior_pid);
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case bp_catch_exec:
annotate_catchpoint (bs->breakpoint_at->number);
printf_filtered ("\nCatchpoint %d (exec'd %s), ",
- bs->breakpoint_at->number,
- bs->breakpoint_at->exec_pathname);
- return 0;
- }
- else if (bs->breakpoint_at->type == bp_catch_catch)
- {
- if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
- {
- annotate_catchpoint (bs->breakpoint_at->number);
- printf_filtered ("\nCatchpoint %d (exception caught), ", bs->breakpoint_at->number);
- printf_filtered ("throw location ");
- if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
- printf_filtered ("%s:%d",
- CURRENT_EXCEPTION_THROW_FILE,
- CURRENT_EXCEPTION_THROW_LINE);
- else
- printf_filtered ("unknown");
-
- printf_filtered (", catch location ");
- if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
- printf_filtered ("%s:%d",
- CURRENT_EXCEPTION_CATCH_FILE,
- CURRENT_EXCEPTION_CATCH_LINE);
- else
- printf_filtered ("unknown");
-
- printf_filtered ("\n");
- return 1; /* don't bother to print location frame info */
- }
+ bs->breakpoint_at->number,
+ bs->breakpoint_at->exec_pathname);
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case 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");
+ /* don't bother to print location frame info */
+ return PRINT_SRC_ONLY;
+ }
else
- {
- return -1; /* really throw, some other bpstat will handle it */
- }
- }
- else if (bs->breakpoint_at->type == bp_catch_throw)
- {
- if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
- {
- annotate_catchpoint (bs->breakpoint_at->number);
- printf_filtered ("\nCatchpoint %d (exception thrown), ", bs->breakpoint_at->number);
- printf_filtered ("throw location ");
- if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
- printf_filtered ("%s:%d",
- CURRENT_EXCEPTION_THROW_FILE,
- CURRENT_EXCEPTION_THROW_LINE);
- else
- printf_filtered ("unknown");
-
- printf_filtered (", catch location ");
- if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
- printf_filtered ("%s:%d",
- CURRENT_EXCEPTION_CATCH_FILE,
- CURRENT_EXCEPTION_CATCH_LINE);
- else
- printf_filtered ("unknown");
-
- printf_filtered ("\n");
- return 1; /* don't bother to print location frame info */
- }
+ {
+ /* really throw, some other bpstat will handle it */
+ return PRINT_UNKNOWN;
+ }
+ break;
+
+ case 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");
+ /* don't bother to print location frame info */
+ return PRINT_SRC_ONLY;
+ }
else
- {
- return -1; /* really catch, some other bpstat willhandle it */
- }
- }
+ {
+ /* really catch, some other bpstat will handle it */
+ return PRINT_UNKNOWN;
+ }
+ break;
- else if (bs->breakpoint_at->type == bp_breakpoint ||
- bs->breakpoint_at->type == bp_hardware_breakpoint)
- {
- /* I think the user probably only wants to see one breakpoint
- 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))
- {
- annotate_watchpoint (bs->breakpoint_at->number);
- mention (bs->breakpoint_at);
- printf_filtered ("\nOld value = ");
- value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
- printf_filtered ("\nNew value = ");
- value_print (bs->breakpoint_at->val, gdb_stdout, 0,
- Val_pretty_default);
- printf_filtered ("\n");
- value_free (bs->old_val);
- bs->old_val = NULL;
+ case bp_watchpoint:
+ case bp_hardware_watchpoint:
+ if (bs->old_val != NULL)
+ {
+ annotate_watchpoint (bs->breakpoint_at->number);
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "watchpoint-trigger");
+ mention (bs->breakpoint_at);
+ ui_out_tuple_begin (uiout, "value");
+ ui_out_text (uiout, "\nOld value = ");
+ value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "old", stb);
+ ui_out_text (uiout, "\nNew value = ");
+ value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "new", stb);
+ ui_out_tuple_end (uiout);
+ ui_out_text (uiout, "\n");
+ value_free (bs->old_val);
+ bs->old_val = NULL;
+ }
/* More than one watchpoint may have been triggered. */
- return -1;
+ return PRINT_UNKNOWN;
+ break;
+
+ case bp_read_watchpoint:
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
+ mention (bs->breakpoint_at);
+ ui_out_tuple_begin (uiout, "value");
+ ui_out_text (uiout, "\nValue = ");
+ value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "value", stb);
+ ui_out_tuple_end (uiout);
+ ui_out_text (uiout, "\n");
+ return PRINT_UNKNOWN;
+ break;
+
+ case bp_access_watchpoint:
+ if (bs->old_val != NULL)
+ {
+ annotate_watchpoint (bs->breakpoint_at->number);
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ mention (bs->breakpoint_at);
+ ui_out_tuple_begin (uiout, "value");
+ ui_out_text (uiout, "\nOld value = ");
+ value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "old", stb);
+ value_free (bs->old_val);
+ bs->old_val = NULL;
+ ui_out_text (uiout, "\nNew value = ");
+ }
+ else
+ {
+ mention (bs->breakpoint_at);
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_tuple_begin (uiout, "value");
+ ui_out_text (uiout, "\nValue = ");
+ }
+ value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
+ ui_out_field_stream (uiout, "new", stb);
+ ui_out_tuple_end (uiout);
+ ui_out_text (uiout, "\n");
+ return PRINT_UNKNOWN;
+ break;
+
+ /* Fall through, we don't deal with these types of breakpoints
+ here. */
+
+ case bp_finish:
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "function-finished");
+ return PRINT_UNKNOWN;
+ break;
+
+ case bp_until:
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "location-reached");
+ return PRINT_UNKNOWN;
+ break;
+
+ case bp_none:
+ case bp_longjmp:
+ case bp_longjmp_resume:
+ case bp_step_resume:
+ case bp_through_sigtramp:
+ case bp_watchpoint_scope:
+ case bp_call_dummy:
+ default:
+ return PRINT_UNKNOWN;
}
- else if (bs->breakpoint_at->type == bp_access_watchpoint ||
- bs->breakpoint_at->type == bp_read_watchpoint)
+}
+
+/* Generic routine for printing messages indicating why we
+ stopped. The behavior of this function depends on the value
+ 'print_it' in the bpstat structure. Under some circumstances we
+ may decide not to print anything here and delegate the task to
+ normal_stop(). */
+
+static enum print_stop_action
+print_bp_stop_message (bpstat bs)
+{
+ switch (bs->print_it)
{
- mention (bs->breakpoint_at);
- printf_filtered ("\nValue = ");
- value_print (bs->breakpoint_at->val, gdb_stdout, 0,
- Val_pretty_default);
- printf_filtered ("\n");
- return -1;
- }
- /* We can't deal with it. Maybe another member of the bpstat chain can. */
- return -1;
-}
-
-/* Print a message indicating what happened.
- This is called from normal_stop().
- The input to this routine is the head of the bpstat list - a list
- of the eventpoints that caused this stop.
- This routine calls the "print_it" routine(s) associated
- with these eventpoints. This will print (for example)
- the "Breakpoint n," part of the output.
- The return value of this routine is one of:
-
- -1: Means we printed nothing
- 0: Means we printed something, and expect subsequent
- code to print the location. An example is
- "Breakpoint 1, " which should be followed by
- the location.
- 1 : Means we printed something, but there is no need
- to also print the location part of the message.
- An example is the catch/throw messages, which
- don't require a location appended to the end. */
+ case print_it_noop:
+ /* Nothing should be printed for this bpstat entry. */
+ return PRINT_UNKNOWN;
+ break;
-int
-bpstat_print (bs)
- bpstat bs;
+ case print_it_done:
+ /* We still want to print the frame, but we already printed the
+ relevant messages. */
+ return PRINT_SRC_AND_LOC;
+ break;
+
+ case print_it_normal:
+ /* Normal case, we handle everything in print_it_typical. */
+ return print_it_typical (bs);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "print_bp_stop_message: unrecognized enum value");
+ break;
+ }
+}
+
+/* Print a message indicating what happened. This is called from
+ normal_stop(). The input to this routine is the head of the bpstat
+ list - a list of the eventpoints that caused this stop. This
+ routine calls the generic print routine for printing a message
+ about reasons for stopping. This will print (for example) the
+ "Breakpoint n," part of the output. The return value of this
+ routine is one of:
+
+ PRINT_UNKNOWN: Means we printed nothing
+ PRINT_SRC_AND_LOC: Means we printed something, and expect subsequent
+ code to print the location. An example is
+ "Breakpoint 1, " which should be followed by
+ the location.
+ PRINT_SRC_ONLY: 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.
+ PRINT_NOTHING: We have done some printing and we don't need any
+ further info to be printed.*/
+
+enum print_stop_action
+bpstat_print (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
+ (Currently all watchpoints go on the bpstat whether hit or not.
+ That probably could (should) be changed, provided care is taken
with respect to bpstat_explains_signal). */
- if (bs->next)
- return bpstat_print (bs->next);
+ for (; bs; bs = bs->next)
+ {
+ val = print_bp_stop_message (bs);
+ if (val == PRINT_SRC_ONLY
+ || val == PRINT_SRC_AND_LOC
+ || val == PRINT_NOTHING)
+ return val;
+ }
- /* We reached the end of the chain without printing anything. */
- return -1;
+ /* We reached the end of the chain, or we got a null BS to start
+ with and nothing was printed. */
+ return PRINT_UNKNOWN;
}
/* Evaluate the expression EXP and return 1 if value is zero.
@@ -1853,11 +2199,10 @@ bpstat_print (bs)
make it pass through catch_errors. */
static int
-breakpoint_cond_eval (exp)
- PTR exp;
+breakpoint_cond_eval (PTR exp)
{
- value_ptr mark = value_mark ();
- int i = !value_true (evaluate_expression ((struct expression *)exp));
+ struct value *mark = value_mark ();
+ int i = !value_true (evaluate_expression ((struct expression *) exp));
value_free_to_mark (mark);
return i;
}
@@ -1865,9 +2210,7 @@ breakpoint_cond_eval (exp)
/* Allocate a new bpstat and chain it to the current one. */
static bpstat
-bpstat_alloc (b, cbs)
- register struct breakpoint *b;
- bpstat cbs; /* Current "bs" value */
+bpstat_alloc (struct breakpoint *b, bpstat cbs /* Current "bs" value */ )
{
bpstat bs;
@@ -1896,8 +2239,7 @@ bpstat_alloc (b, cbs)
/* Check watchpoint condition. */
static int
-watchpoint_check (p)
- PTR p;
+watchpoint_check (PTR p)
{
bpstat bs = (bpstat) p;
struct breakpoint *b;
@@ -1911,27 +2253,35 @@ 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);
+ /* in_function_epilogue_p() returns a non-zero value if we're still
+ in the function but the stack frame has already been invalidated.
+ Since we can't rely on the values of local variables after the
+ stack has been destroyed, we are treating the watchpoint in that
+ state as `not changed' without further checking. */
+ if (within_current_scope && fr == get_current_frame ()
+ && gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
+ return WP_VALUE_NOT_CHANGED;
if (within_current_scope)
/* If we end up stopping, the current frame will get selected
in normal_stop. So this call to select_frame won't affect
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);
+ struct value *mark = value_mark ();
+ struct value *new_val = evaluate_expression (bs->breakpoint_at->exp);
if (!value_equal (b->val, new_val))
{
release_value (new_val);
@@ -1952,58 +2302,32 @@ 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). */
- printf_filtered ("\
-Watchpoint %d deleted because the program has left the block in\n\
-which its expression is valid.\n", bs->breakpoint_at->number);
+ 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). */
+ /* We print all the stop information in print_it_typical(), but
+ in this case, by the time we call print_it_typical() this bp
+ will be deleted already. So we have no choice but print the
+ information here. */
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "watchpoint-scope");
+ ui_out_text (uiout, "\nWatchpoint ");
+ ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
+ ui_out_text (uiout, " deleted because the program has left the block in\n\
+which its expression is valid.\n");
+
if (b->related_breakpoint)
- b->related_breakpoint->disposition = del_at_next_stop;
- b->disposition = del_at_next_stop;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
return WP_DELETED;
}
}
-/* This is used when everything which needs to be printed has
- already been printed. But we still want to print the frame. */
-
-/* Background: When we stop, bpstat_print() is called.
- It loops through the bpstat list of things causing this stop,
- calling the print_it function for each one. The default
- print_it function, used for breakpoints, is print_it_normal().
- Also see print_it_noop() and print_it_done() are the other
- two possibilities. See comments in bpstat_print() and
- in header of print_it_normal() for more detail. */
-
-static int
-print_it_done (bs)
- bpstat bs;
-{
- return 0;
-}
-
-/* This is used when nothing should be printed for this bpstat entry. */
-/* Background: When we stop, bpstat_print() is called.
- It loops through the bpstat list of things causing this stop,
- calling the print_it function for each one. The default
- print_it function, used for breakpoints, is print_it_normal().
- Also see print_it_noop() and print_it_done() are the other
- two possibilities. See comments in bpstat_print() and
- in header of print_it_normal() for more detail. */
-
-static int
-print_it_noop (bs)
- bpstat bs;
-{
- return -1;
-}
-
/* Get a bpstat associated with having just stopped at address *PC
and frame address CORE_ADDRESS. Update *PC to point at the
breakpoint (if we hit a breakpoint). NOT_A_BREAKPOINT is nonzero
@@ -2013,21 +2337,19 @@ 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)
- CORE_ADDR *pc;
- int not_a_breakpoint;
+bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
{
register struct breakpoint *b, *temp;
CORE_ADDR bp_addr;
@@ -2038,95 +2360,176 @@ 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;
+ /* Get the address where the breakpoint would have been.
+ The "not_a_breakpoint" argument is meant to distinguish
+ between a breakpoint trap event and a trace/singlestep
+ trap event. For a trace/singlestep trap event, we would
+ not want to subtract DECR_PC_AFTER_BREAK from the PC. */
- ALL_BREAKPOINTS_SAFE (b, temp)
- {
- if (b->enable == disabled
- || b->enable == shlib_disabled
- || b->enable == call_disabled)
- continue;
+ bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ?
+ 0 : DECR_PC_AFTER_BREAK);
- 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)))
+ ALL_BREAKPOINTS_SAFE (b, temp)
+ {
+ if (b->enable_state == bp_disabled
+ || b->enable_state == bp_shlib_disabled
+ || b->enable_state == bp_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 */
continue;
+ if (overlay_debugging /* unmapped overlay section */
+ && 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)
- continue;
+ if (b->type == bp_hardware_breakpoint
+ && b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
+ 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)
+ /* 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 (PIDGET (inferior_ptid))
+ || ((b->dll_pathname != NULL)
+ && (strcmp (b->dll_pathname,
+ SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
+ != 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 (PIDGET (inferior_ptid))
+ || ((b->dll_pathname != NULL)
+ && (strcmp (b->dll_pathname,
+ SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
+ != 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 (PIDGET (inferior_ptid),
+ &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 (PIDGET (inferior_ptid),
+ &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 (PIDGET (inferior_ptid), &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)
- {
- switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL))
+ /* 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. */
+ /* Actually this is superfluous, because by the time we
+ call print_it_typical() the wp will be already deleted,
+ and the function will return immediately. */
+ 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;
+ 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 = disp_del_at_next_stop;
+ b->disposition = disp_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;
+ struct value *v;
+ int found = 0;
+
+ addr = target_stopped_data_address ();
+ if (addr == 0)
+ continue;
+ for (v = b->val_chain; v; v = v->next)
+ {
+ if (VALUE_LVAL (v) == lval_memory
+ && ! VALUE_LAZY (v))
+ {
+ struct type *vtype = check_typedef (VALUE_TYPE (v));
+
+ if (v == b->val_chain
+ || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR vaddr;
+
+ vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ /* Exact match not required. Within range is
+ sufficient. */
+ if (addr >= vaddr &&
+ addr < vaddr + TYPE_LENGTH (VALUE_TYPE (v)))
+ 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. */
@@ -2134,147 +2537,114 @@ bpstat_stop_status (pc, not_a_breakpoint)
/* Stop. */
break;
case WP_VALUE_CHANGED:
- /* Stop. */
+ if (b->type == bp_read_watchpoint)
+ {
+ /* Don't stop: read watchpoints shouldn't fire if
+ the value has changed. This is for targets which
+ cannot set read-only watchpoints. */
+ bs->print_it = print_it_noop;
+ bs->stop = 0;
+ continue;
+ }
++(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;
+ /* Stop. */
+ ++(b->hit_count);
+ break;
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;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_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 /* found == 0 */
+ {
+ /* This is a case where some watchpoint(s) triggered,
+ but not at the address of this watchpoint (FOUND
+ was left zero). So don't print anything for this
+ watchpoint. */
+ bs->print_it = print_it_noop;
+ bs->stop = 0;
+ continue;
+ }
+ }
+ 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)
+ 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--;
+ annotate_ignore_count_change ();
+ bs->stop = 0;
+ }
+ else
+ {
+ /* We will stop here */
+ if (b->disposition == disp_disable)
+ b->enable_state = bp_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);
@@ -2286,7 +2656,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. */
@@ -2296,7 +2666,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))
@@ -2309,49 +2679,49 @@ bpstat_stop_status (pc, not_a_breakpoint)
/* Tell what to do about this bpstat. */
struct bpstat_what
-bpstat_what (bs)
- bpstat bs;
+bpstat_what (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,
-
- /* This is just used to count how many enums there are. */
- class_last
+ /* We caught a shared library event. */
+ catch_shlib_event,
+
+ /* 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
@@ -2379,8 +2749,34 @@ bpstat_what (bs)
as bp_silent and wp_noisy is the same as bp_noisy. That is because
after stopping, the check for whether to step over a breakpoint
(BPSTAT_WHAT_SINGLE type stuff) is handled in proceed() without
- reference to how we stopped. We retain separate wp_silent and bp_silent
- codes in case we want to change that someday. */
+ reference to how we stopped. We retain separate wp_silent and
+ bp_silent codes in case we want to change that someday.
+
+ Another possibly interesting property of this table is that
+ there's a partial ordering, priority-like, of the actions. Once
+ you've decided that some action is appropriate, you'll never go
+ back and decide something of a lower priority is better. The
+ ordering is:
+
+ kc < clr sgl shl shlr 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
+ and choose the highest priority action we find, with a little
+ logic to handle the 'err' cases, and the CLEAR_LONGJMP_RESUME/
+ CLEAR_LONGJMP_RESUME_SINGLE distinction (which breakpoint.h says
+ is messy anyway). */
/* step_resume entries: a step resume breakpoint overrides another
breakpoint of signal handling (see comment in wait_for_inferior
@@ -2389,24 +2785,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, slr, 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
@@ -2462,8 +2870,8 @@ bpstat_what (bs)
bs_class = wp_silent;
}
else
- /* There was a watchpoint, but we're not stopping. This requires
- no further action. */
+ /* There was a watchpoint, but we're not stopping.
+ This requires no further action. */
bs_class = no_effect;
break;
case bp_longjmp:
@@ -2490,51 +2898,55 @@ bpstat_what (bs)
case bp_shlib_event:
bs_class = shlib_event;
break;
- case bp_catch_load:
- case bp_catch_unload:
- /* Only if this catchpoint triggered should we cause the
- step-out-of-dld behaviour. Otherwise, we ignore this
- catchpoint. */
- if (bs->stop)
- bs_class = catch_shlib_event;
- else
- bs_class = no_effect;
- break;
- case bp_catch_fork:
- case bp_catch_vfork:
+ case bp_thread_event:
+ case bp_overlay_event:
+ bs_class = bp_nostop;
+ 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;
+ 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. */
+ /* Make sure the action is stop (silent or noisy),
+ so infrun.c pops the dummy frame. */
bs_class = bp_silent;
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;
@@ -2544,66 +2956,65 @@ bpstat_what (bs)
without hardware support). This isn't related to a specific bpstat,
just to things like whether watchpoints are set. */
-int
-bpstat_should_step ()
+int
+bpstat_should_step (void)
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->enable == enabled && b->type == bp_watchpoint)
+ if (b->enable_state == bp_enabled && b->type == bp_watchpoint)
return 1;
return 0;
}
/* Nonzero if there are enabled hardware watchpoints. */
int
-bpstat_have_active_hw_watchpoints ()
+bpstat_have_active_hw_watchpoints (void)
{
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)))
+ if ((b->enable_state == bp_enabled) &&
+ (b->inserted) &&
+ ((b->type == bp_hardware_watchpoint) ||
+ (b->type == bp_read_watchpoint) ||
+ (b->type == bp_access_watchpoint)))
return 1;
return 0;
}
-
+
/* Given a bpstat that records zero or more triggered eventpoints, this
function returns another bpstat which contains only the catchpoints
on that first list, if any. */
void
-bpstat_get_triggered_catchpoints (ep_list, cp_list)
- bpstat ep_list;
- bpstat * cp_list;
-{
- struct bpstats root_bs[1];
- bpstat bs = root_bs;
- struct breakpoint * ep;
- char * dll_pathname;
-
+bpstat_get_triggered_catchpoints (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,
@@ -2611,375 +3022,521 @@ 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);
+ xfree (ep->triggered_dll_pathname);
if (ep->type == bp_catch_load)
- dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
else
- dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
#else
dll_pathname = NULL;
#endif
if (dll_pathname)
{
- ep->triggered_dll_pathname = (char *) xmalloc (strlen (dll_pathname) + 1);
+ ep->triggered_dll_pathname = (char *)
+ xmalloc (strlen (dll_pathname) + 1);
strcpy (ep->triggered_dll_pathname, dll_pathname);
}
else
ep->triggered_dll_pathname = NULL;
}
-
+
*cp_list = bs;
}
-/* Print information on breakpoint number BNUM, or -1 if all.
- If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS
- is nonzero, process only watchpoints. */
-
-typedef struct {
- enum bptype type;
- char * description;
-} ep_type_description_t;
-
+/* Print B to gdb_stdout. */
static void
-breakpoint_1 (bnum, allflag)
- int bnum;
- int allflag;
+print_one_breakpoint (struct breakpoint *b,
+ CORE_ADDR *last_addr)
{
- register struct breakpoint *b;
register struct command_line *l;
register struct symbol *sym;
- CORE_ADDR last_addr = (CORE_ADDR)-1;
- int found_a_breakpoint = 0;
- static ep_type_description_t bptypes[] =
+ struct ep_type_description
+ {
+ enum bptype type;
+ char *description;
+ };
+ static struct ep_type_description 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"};
- static char bpenables[] = "nyn";
+ {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_thread_event, "thread events"},
+ {bp_overlay_event, "overlay 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[] = "nynny";
char wrap_indent[80];
+ struct ui_stream *stb = ui_out_stream_new (uiout);
+ struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
+
+ annotate_record ();
+ ui_out_tuple_begin (uiout, "bkpt");
+
+ /* 1 */
+ annotate_field (0);
+ ui_out_field_int (uiout, "number", b->number);
+
+ /* 2 */
+ annotate_field (1);
+ if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0])))
+ || ((int) b->type != bptypes[(int) b->type].type))
+ internal_error (__FILE__, __LINE__,
+ "bptypes table does not describe type #%d.",
+ (int) b->type);
+ ui_out_field_string (uiout, "type", bptypes[(int) b->type].description);
+
+ /* 3 */
+ annotate_field (2);
+ ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]);
+
+ /* 4 */
+ annotate_field (3);
+ ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable_state]);
+ ui_out_spaces (uiout, 2);
+
+ /* 5 and 6 */
+ strcpy (wrap_indent, " ");
+ if (addressprint)
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ strcat (wrap_indent, " ");
+ else
+ strcat (wrap_indent, " ");
+ }
+ switch (b->type)
+ {
+ case bp_none:
+ internal_error (__FILE__, __LINE__,
+ "print_one_breakpoint: bp_none encountered\n");
+ break;
- 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;
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "what", stb);
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->dll_pathname == NULL)
+ {
+ ui_out_field_string (uiout, "what", "<any library>");
+ ui_out_spaces (uiout, 1);
+ }
+ else
+ {
+ ui_out_text (uiout, "library \"");
+ ui_out_field_string (uiout, "what", b->dll_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->forked_inferior_pid != 0)
+ {
+ ui_out_text (uiout, "process ");
+ ui_out_field_int (uiout, "what", b->forked_inferior_pid);
+ ui_out_spaces (uiout, 1);
+ }
+
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->exec_pathname != NULL)
+ {
+ ui_out_text (uiout, "program \"");
+ ui_out_field_string (uiout, "what", b->exec_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+ break;
- if (!found_a_breakpoint++)
- {
- annotate_breakpoints_headers ();
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception catch");
+ ui_out_spaces (uiout, 1);
+ 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). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception throw");
+ ui_out_spaces (uiout, 1);
+ 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:
+ case bp_thread_event:
+ case bp_overlay_event:
+ if (addressprint)
+ {
+ annotate_field (4);
+ ui_out_field_core_addr (uiout, "addr", b->address);
+ }
+ annotate_field (5);
+ *last_addr = b->address;
+ if (b->source_file)
+ {
+ sym = find_pc_sect_function (b->address, b->section);
+ if (sym)
+ {
+ ui_out_text (uiout, "in ");
+ ui_out_field_string (uiout, "func",
+ SYMBOL_SOURCE_NAME (sym));
+ ui_out_wrap_hint (uiout, wrap_indent);
+ ui_out_text (uiout, " at ");
+ }
+ ui_out_field_string (uiout, "file", b->source_file);
+ ui_out_text (uiout, ":");
+ ui_out_field_int (uiout, "line", b->line_number);
+ }
+ else
+ {
+ print_address_symbolic (b->address, stb->stream, demangle, "");
+ ui_out_field_stream (uiout, "at", stb);
+ }
+ break;
+ }
- 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");
+ if (b->thread != -1)
+ {
+ /* FIXME: This seems to be redundant and lost here; see the
+ "stop only in" line a little further down. */
+ ui_out_text (uiout, " thread ");
+ ui_out_field_int (uiout, "thread", b->thread);
+ }
- annotate_breakpoints_table ();
- }
+ ui_out_text (uiout, "\n");
- 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"));
- }
-
- annotate_field (5);
-
- 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)
- printf_filtered (" thread %d", b->thread );
-
- printf_filtered ("\n");
-
- if (b->frame)
- {
- annotate_field (6);
+ if (b->frame)
+ {
+ annotate_field (6);
+ ui_out_text (uiout, "\tstop only in stack frame at ");
+ ui_out_field_core_addr (uiout, "frame", b->frame);
+ ui_out_text (uiout, "\n");
+ }
+
+ if (b->cond)
+ {
+ annotate_field (7);
+ ui_out_text (uiout, "\tstop only if ");
+ print_expression (b->cond, stb->stream);
+ ui_out_field_stream (uiout, "cond", stb);
+ ui_out_text (uiout, "\n");
+ }
+
+ if (b->thread != -1)
+ {
+ /* FIXME should make an annotation for this */
+ ui_out_text (uiout, "\tstop only in thread ");
+ ui_out_field_int (uiout, "thread", b->thread);
+ ui_out_text (uiout, "\n");
+ }
+
+ if (show_breakpoint_hit_counts && b->hit_count)
+ {
+ /* FIXME should make an annotation for this */
+ if (ep_is_catchpoint (b))
+ ui_out_text (uiout, "\tcatchpoint");
+ else
+ ui_out_text (uiout, "\tbreakpoint");
+ ui_out_text (uiout, " already hit ");
+ ui_out_field_int (uiout, "times", b->hit_count);
+ if (b->hit_count == 1)
+ ui_out_text (uiout, " time\n");
+ else
+ ui_out_text (uiout, " times\n");
+ }
+
+ /* Output the count also if it is zero, but only if this is
+ mi. FIXME: Should have a better test for this. */
+ if (ui_out_is_mi_like_p (uiout))
+ if (show_breakpoint_hit_counts && b->hit_count == 0)
+ ui_out_field_int (uiout, "times", b->hit_count);
- printf_filtered ("\tstop only in stack frame at ");
- print_address_numeric (b->frame, 1, gdb_stdout);
- printf_filtered ("\n");
- }
+ if (b->ignore_count)
+ {
+ annotate_field (8);
+ ui_out_text (uiout, "\tignore next ");
+ ui_out_field_int (uiout, "ignore", b->ignore_count);
+ ui_out_text (uiout, " hits\n");
+ }
+
+ if ((l = b->commands))
+ {
+ annotate_field (9);
+ ui_out_tuple_begin (uiout, "script");
+ print_command_lines (uiout, l, 4);
+ ui_out_tuple_end (uiout);
+ }
+ ui_out_tuple_end (uiout);
+ do_cleanups (old_chain);
+}
- if (b->cond)
- {
- annotate_field (7);
+struct captured_breakpoint_query_args
+ {
+ int bnum;
+ };
- printf_filtered ("\tstop only if ");
- print_expression (b->cond, gdb_stdout);
- printf_filtered ("\n");
- }
+static int
+do_captured_breakpoint_query (struct ui_out *uiout, void *data)
+{
+ struct captured_breakpoint_query_args *args = data;
+ register struct breakpoint *b;
+ CORE_ADDR dummy_addr = 0;
+ ALL_BREAKPOINTS (b)
+ {
+ if (args->bnum == b->number)
+ {
+ print_one_breakpoint (b, &dummy_addr);
+ return GDB_RC_OK;
+ }
+ }
+ return GDB_RC_NONE;
+}
- if (b->thread != -1)
- {
- /* FIXME should make an annotation for this */
- printf_filtered ("\tstop only in thread %d\n", b->thread);
- }
+enum gdb_rc
+gdb_breakpoint_query (struct ui_out *uiout, int bnum)
+{
+ struct captured_breakpoint_query_args args;
+ args.bnum = bnum;
+ /* For the moment we don't trust print_one_breakpoint() to not throw
+ an error. */
+ return catch_exceptions (uiout, do_captured_breakpoint_query, &args,
+ NULL, RETURN_MASK_ALL);
+}
- 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"));
- }
+/* Return non-zero if B is user settable (breakpoints, watchpoints,
+ catchpoints, et.al.). */
- if (b->ignore_count)
- {
- annotate_field (8);
+static int
+user_settable_breakpoint (const struct breakpoint *b)
+{
+ return (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);
+}
+
+/* Print information on user settable breakpoint (watchpoint, etc)
+ number BNUM. If BNUM is -1 print all user settable breakpoints.
+ If ALLFLAG is non-zero, include non- user settable breakpoints. */
- printf_filtered ("\tignore next %d hits\n", b->ignore_count);
- }
+static void
+breakpoint_1 (int bnum, int allflag)
+{
+ register struct breakpoint *b;
+ CORE_ADDR last_addr = (CORE_ADDR) -1;
+ int nr_printable_breakpoints;
+
+ /* Compute the number of rows in the table. */
+ nr_printable_breakpoints = 0;
+ ALL_BREAKPOINTS (b)
+ if (bnum == -1
+ || bnum == b->number)
+ {
+ if (allflag || user_settable_breakpoint (b))
+ nr_printable_breakpoints++;
+ }
- if ((l = b->commands))
- {
- annotate_field (9);
+ if (addressprint)
+ ui_out_table_begin (uiout, 6, nr_printable_breakpoints, "BreakpointTable");
+ else
+ ui_out_table_begin (uiout, 5, nr_printable_breakpoints, "BreakpointTable");
+
+ if (nr_printable_breakpoints > 0)
+ annotate_breakpoints_headers ();
+ if (nr_printable_breakpoints > 0)
+ annotate_field (0);
+ ui_out_table_header (uiout, 3, ui_left, "number", "Num"); /* 1 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (1);
+ ui_out_table_header (uiout, 14, ui_left, "type", "Type"); /* 2 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (2);
+ ui_out_table_header (uiout, 4, ui_left, "disp", "Disp"); /* 3 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (3);
+ ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb"); /* 4 */
+ if (addressprint)
+ {
+ if (nr_printable_breakpoints > 0)
+ annotate_field (4);
+ if (TARGET_ADDR_BIT <= 32)
+ ui_out_table_header (uiout, 10, ui_left, "addr", "Address");/* 5 */
+ else
+ ui_out_table_header (uiout, 18, ui_left, "addr", "Address");/* 5 */
+ }
+ if (nr_printable_breakpoints > 0)
+ annotate_field (5);
+ ui_out_table_header (uiout, 40, ui_noalign, "what", "What"); /* 6 */
+ ui_out_table_body (uiout);
+ if (nr_printable_breakpoints > 0)
+ annotate_breakpoints_table ();
- while (l)
- {
- print_command_line (l, 4);
- l = l->next;
- }
- }
+ ALL_BREAKPOINTS (b)
+ if (bnum == -1
+ || bnum == b->number)
+ {
+ /* We only print out user settable breakpoints unless the
+ allflag is set. */
+ if (allflag || user_settable_breakpoint (b))
+ print_one_breakpoint (b, &last_addr);
}
+
+ ui_out_table_end (uiout);
- if (!found_a_breakpoint)
+ if (nr_printable_breakpoints == 0)
{
if (bnum == -1)
- printf_filtered ("No breakpoints or watchpoints.\n");
+ ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
else
- printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
+ ui_out_message (uiout, 0, "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);
+ {
+ /* 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);
+ }
+ /* FIXME? Should this be moved up so that it is only called when
+ there have been breakpoints? */
annotate_breakpoints_table_end ();
}
/* ARGSUSED */
static void
-breakpoints_info (bnum_exp, from_tty)
- char *bnum_exp;
- int from_tty;
+breakpoints_info (char *bnum_exp, int from_tty)
{
int bnum = -1;
if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
+ bnum = parse_and_eval_long (bnum_exp);
breakpoint_1 (bnum, 0);
}
-#if MAINTENANCE_CMDS
-
/* ARGSUSED */
-void
-maintenance_info_breakpoints (bnum_exp, from_tty)
- char *bnum_exp;
- int from_tty;
+static void
+maintenance_info_breakpoints (char *bnum_exp, int from_tty)
{
int bnum = -1;
if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
+ bnum = parse_and_eval_long (bnum_exp);
breakpoint_1 (bnum, 1);
}
-#endif
-
/* Print a message describing any breakpoints set at PC. */
static void
-describe_other_breakpoints (pc, section)
- CORE_ADDR pc;
- asection *section;
+describe_other_breakpoints (CORE_ADDR pc, asection *section)
{
register int others = 0;
register struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->address == pc)
- if (overlay_debugging == 0 ||
- b->section == section)
+ if (b->address == pc) /* address match / overlay match */
+ if (!overlay_debugging || 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)
+ if (b->address == pc) /* address match / overlay match */
+ if (!overlay_debugging || 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 ("%d%s%s ",
+ b->number,
+ ((b->enable_state == bp_disabled ||
+ b->enable_state == bp_shlib_disabled ||
+ b->enable_state == bp_call_disabled)
+ ? " (disabled)"
+ : b->enable_state == bp_permanent
+ ? " (permanent)"
+ : ""),
+ (others > 1) ? ","
+ : ((others == 1) ? " and" : ""));
}
printf_filtered ("also set at pc ");
print_address_numeric (pc, 1, gdb_stdout);
@@ -2991,11 +3548,8 @@ describe_other_breakpoints (pc, section)
for the `break' command with no arguments. */
void
-set_default_breakpoint (valid, addr, symtab, line)
- int valid;
- CORE_ADDR addr;
- struct symtab *symtab;
- int line;
+set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab,
+ int line)
{
default_breakpoint_valid = valid;
default_breakpoint_address = addr;
@@ -3003,46 +3557,126 @@ set_default_breakpoint (valid, addr, symtab, line)
default_breakpoint_line = line;
}
-/* Rescan breakpoints at address ADDRESS,
+/* Return true iff it is meaningful to use the address member of
+ BPT. For some breakpoint types, the address member is irrelevant
+ and it makes no sense to attempt to compare it to other addresses
+ (or use it for any other purpose either).
+
+ More specifically, each of the following breakpoint types will always
+ have a zero valued address and we don't want check_duplicates() to mark
+ breakpoints of any of these types to be a duplicate of an actual
+ breakpoint at address zero:
+
+ bp_watchpoint
+ bp_hardware_watchpoint
+ bp_read_watchpoint
+ bp_access_watchpoint
+ bp_catch_exec
+ bp_longjmp_resume
+ bp_catch_fork
+ bp_catch_vork */
+
+static int
+breakpoint_address_is_meaningful (struct breakpoint *bpt)
+{
+ enum bptype type = bpt->type;
+
+ return (type != bp_watchpoint
+ && type != bp_hardware_watchpoint
+ && type != bp_read_watchpoint
+ && type != bp_access_watchpoint
+ && type != bp_catch_exec
+ && type != bp_longjmp_resume
+ && type != bp_catch_fork
+ && type != bp_catch_vfork);
+}
+
+/* Rescan breakpoints at the same address and section as BPT,
marking the first one as "first" and any others as "duplicates".
- This is so that the bpt instruction is only inserted once. */
+ This is so that the bpt instruction is only inserted once.
+ If we have a permanent breakpoint at the same place as BPT, make
+ that one the official one, and the rest as duplicates. */
static void
-check_duplicates (address, section)
- CORE_ADDR address;
- asection *section;
+check_duplicates (struct breakpoint *bpt)
{
register struct breakpoint *b;
register int count = 0;
+ struct breakpoint *perm_bp = 0;
+ CORE_ADDR address = bpt->address;
+ asection *section = bpt->section;
- if (address == 0) /* Watchpoints are uninteresting */
+ if (! breakpoint_address_is_meaningful (bpt))
return;
ALL_BREAKPOINTS (b)
- if (b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
- && b->address == address
- && (overlay_debugging == 0 || b->section == section))
- {
- count++;
- b->duplicate = count > 1;
- }
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
+ && b->address == address /* address / overlay match */
+ && (!overlay_debugging || b->section == section)
+ && breakpoint_address_is_meaningful (b))
+ {
+ /* Have we found a permanent breakpoint? */
+ if (b->enable_state == bp_permanent)
+ {
+ perm_bp = b;
+ break;
+ }
+
+ count++;
+ b->duplicate = count > 1;
+ }
+
+ /* If we found a permanent breakpoint at this address, go over the
+ list again and declare all the other breakpoints there to be the
+ duplicates. */
+ if (perm_bp)
+ {
+ perm_bp->duplicate = 0;
+
+ /* Permanent breakpoint should always be inserted. */
+ if (! perm_bp->inserted)
+ internal_error (__FILE__, __LINE__,
+ "allegedly permanent breakpoint is not "
+ "actually inserted");
+
+ ALL_BREAKPOINTS (b)
+ if (b != perm_bp)
+ {
+ if (b->inserted)
+ internal_error (__FILE__, __LINE__,
+ "another breakpoint was inserted on top of "
+ "a permanent breakpoint");
+
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
+ && b->address == address /* address / overlay match */
+ && (!overlay_debugging || b->section == section)
+ && breakpoint_address_is_meaningful (b))
+ b->duplicate = 1;
+ }
+ }
}
-/* Low level routine to set a breakpoint.
- Takes as args the three things that every breakpoint must have.
- Returns the breakpoint object so caller can set other things.
- Does not set the breakpoint number!
- Does not print anything.
+/* set_raw_breakpoint() is a low level routine for allocating and
+ partially initializing a breakpoint of type BPTYPE. The newly
+ created breakpoint's address, section, source file name, and line
+ number are provided by SAL. The newly created and partially
+ initialized breakpoint is added to the breakpoint chain and
+ is also returned as the value of this function.
- ==> This routine should not be called if there is a chance of later
- error(); otherwise it leaves a bogus breakpoint on the chain. Validate
- your arguments BEFORE calling this routine! */
+ It is expected that the caller will complete the initialization of
+ the newly created breakpoint struct as well as output any status
+ information regarding the creation of a new breakpoint. In
+ particular, set_raw_breakpoint() does NOT set the breakpoint
+ number! Care should be taken to not allow an error() to occur
+ prior to completing the initialization of the breakpoint. If this
+ should happen, a bogus breakpoint will be left on the chain. */
struct breakpoint *
-set_raw_breakpoint (sal)
- struct symtab_and_line sal;
+set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
{
register struct breakpoint *b, *b1;
@@ -3055,11 +3689,12 @@ set_raw_breakpoint (sal)
b->source_file = savestring (sal.symtab->filename,
strlen (sal.symtab->filename));
b->section = sal.section;
+ b->type = bptype;
b->language = current_language->la_language;
b->input_radix = input_radix;
b->thread = -1;
b->line_number = sal.line;
- b->enable = enabled;
+ b->enable_state = bp_enabled;
b->next = 0;
b->silent = 0;
b->ignore_count = 0;
@@ -3084,81 +3719,171 @@ set_raw_breakpoint (sal)
b1->next = b;
}
- check_duplicates (sal.pc, sal.section);
+ check_duplicates (b);
breakpoints_changed ();
return b;
}
-#ifdef GET_LONGJMP_TARGET
-static void
-create_longjmp_breakpoint (func_name)
- char *func_name;
+/* Note that the breakpoint object B describes a permanent breakpoint
+ instruction, hard-wired into the inferior's code. */
+void
+make_breakpoint_permanent (struct breakpoint *b)
{
+ b->enable_state = bp_permanent;
+
+ /* By definition, permanent breakpoints are already present in the code. */
+ b->inserted = 1;
+}
+
+static struct breakpoint *
+create_internal_breakpoint (CORE_ADDR address, enum bptype type)
+{
+ static int internal_breakpoint_number = -1;
struct symtab_and_line sal;
struct breakpoint *b;
- INIT_SAL (&sal); /* initialize to zeroes */
- if (func_name != NULL)
- {
- struct minimal_symbol *m;
+ INIT_SAL (&sal); /* initialize to zeroes */
- m = lookup_minimal_symbol_text (func_name, NULL, (struct objfile *)NULL);
- if (m)
- sal.pc = SYMBOL_VALUE_ADDRESS (m);
- else
+ sal.pc = address;
+ sal.section = find_pc_overlay (sal.pc);
+
+ b = set_raw_breakpoint (sal, type);
+ b->number = internal_breakpoint_number--;
+ b->disposition = disp_donttouch;
+
+ return b;
+}
+
+
+static void
+create_longjmp_breakpoint (char *func_name)
+{
+ struct breakpoint *b;
+ struct minimal_symbol *m;
+
+ if (func_name == NULL)
+ b = create_internal_breakpoint (0, bp_longjmp_resume);
+ else
+ {
+ if ((m = lookup_minimal_symbol_text (func_name, NULL, NULL)) == NULL)
return;
+
+ b = create_internal_breakpoint (SYMBOL_VALUE_ADDRESS (m), bp_longjmp);
}
- sal.section = find_pc_overlay (sal.pc);
- b = set_raw_breakpoint (sal);
- if (!b) return;
- b->type = func_name != NULL ? bp_longjmp : bp_longjmp_resume;
- b->disposition = donttouch;
- b->enable = disabled;
+ b->enable_state = bp_disabled;
b->silent = 1;
if (func_name)
- b->addr_string = strsave(func_name);
- b->number = internal_breakpoint_number--;
+ b->addr_string = xstrdup (func_name);
}
-#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
+/* 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 (void)
{
register struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_longjmp)
- {
- b->enable = enabled;
- check_duplicates (b->address, b->section);
- }
+ {
+ b->enable_state = bp_enabled;
+ check_duplicates (b);
+ }
}
void
-disable_longjmp_breakpoint()
+disable_longjmp_breakpoint (void)
{
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_state = bp_disabled;
+ check_duplicates (b);
+ }
+}
+
+static void
+create_overlay_event_breakpoint (char *func_name)
+{
+ struct breakpoint *b;
+ struct minimal_symbol *m;
+
+ if ((m = lookup_minimal_symbol_text (func_name, NULL, NULL)) == NULL)
+ return;
+
+ b = create_internal_breakpoint (SYMBOL_VALUE_ADDRESS (m),
+ bp_overlay_event);
+ b->addr_string = xstrdup (func_name);
+
+ if (overlay_debugging == ovly_auto)
+ b->enable_state = bp_enabled;
+ else
+ b->enable_state = bp_disabled;
+}
+
+void
+enable_overlay_breakpoints (void)
+{
+ register struct breakpoint *b;
+
+ ALL_BREAKPOINTS (b)
+ if (b->type == bp_overlay_event)
+ {
+ b->enable_state = bp_enabled;
+ check_duplicates (b);
+ }
+}
+
+void
+disable_overlay_breakpoints (void)
+{
+ register struct breakpoint *b;
+
+ ALL_BREAKPOINTS (b)
+ if (b->type == bp_overlay_event)
+ {
+ b->enable_state = bp_disabled;
+ check_duplicates (b);
+ }
+}
+
+struct breakpoint *
+create_thread_event_breakpoint (CORE_ADDR address)
+{
+ struct breakpoint *b;
+ char addr_string[80]; /* Surely an addr can't be longer than that. */
+
+ b = create_internal_breakpoint (address, bp_thread_event);
+
+ b->enable_state = bp_enabled;
+ /* addr_string has to be used or breakpoint_re_set will delete me. */
+ sprintf (addr_string, "*0x%s", paddr (b->address));
+ b->addr_string = xstrdup (addr_string);
+
+ return b;
+}
+
+void
+remove_thread_event_breakpoints (void)
+{
+ struct breakpoint *b, *temp;
+
+ ALL_BREAKPOINTS_SAFE (b, temp)
+ if (b->type == bp_thread_event)
+ delete_breakpoint (b);
}
#ifdef SOLIB_ADD
void
-remove_solib_event_breakpoints ()
+remove_solib_event_breakpoints (void)
{
register struct breakpoint *b, *temp;
@@ -3167,101 +3892,87 @@ remove_solib_event_breakpoints ()
delete_breakpoint (b);
}
-void
-create_solib_event_breakpoint (address)
- CORE_ADDR address;
+struct breakpoint *
+create_solib_event_breakpoint (CORE_ADDR address)
{
struct breakpoint *b;
- struct symtab_and_line sal;
- INIT_SAL (&sal); /* initialize to zeroes */
- sal.pc = address;
- sal.section = find_pc_overlay (sal.pc);
- b = set_raw_breakpoint (sal);
- b->number = internal_breakpoint_number--;
- b->disposition = donttouch;
- b->type = bp_shlib_event;
+ b = create_internal_breakpoint (address, bp_shlib_event);
+ return b;
}
+/* Disable any breakpoints that are on code in shared libraries. Only
+ apply to enabled breakpoints, disabled ones can just stay disabled. */
+
void
-disable_breakpoints_in_shlibs (silent)
- int silent;
+disable_breakpoints_in_shlibs (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_state == bp_enabled &&
+ !b->duplicate &&
+ PC_SOLIB (b->address))
+ {
+ b->enable_state = bp_shlib_disabled;
+ if (!silent)
+ {
+ if (!disabled_shlib_breaks)
+ {
+ target_terminal_ours_for_output ();
+ warning ("Temporarily disabling shared library breakpoints:");
+ }
+ disabled_shlib_breaks = 1;
+ warning ("breakpoint #%d ", b->number);
+ }
+ }
#endif
- }
- if (disabled_shlib_breaks && !silent)
- printf_filtered ("\n");
+ }
}
/* Try to reenable any breakpoints in shared libraries. */
void
-re_enable_breakpoints_in_shlibs ()
+re_enable_breakpoints_in_shlibs (void)
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->enable == shlib_disabled)
- {
- char buf[1];
+ if (b->enable_state == bp_shlib_disabled)
+ {
+ char buf[1];
- /* Do not reenable the breakpoint if the shared library
- is still not mapped in. */
- if (target_read_memory (b->address, buf, 1) == 0)
- b->enable = enabled;
- }
+ /* 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_state = bp_enabled;
+ }
}
#endif
static void
-create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, cond_string, bp_kind)
- char * hookname;
- int tempflag;
- char * dll_pathname;
- char * cond_string;
- enum bptype bp_kind;
-{
- struct breakpoint * b;
+solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
+ char *cond_string, enum bptype bp_kind)
+{
+ struct breakpoint *b;
struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- struct cleanup * old_chain;
- struct cleanup * canonical_strings_chain = NULL;
- int i;
- char * addr_start = hookname;
- char * addr_end = NULL;
- char ** canonical = (char **) NULL;
- int thread = -1; /* All threads. */
-
+ struct cleanup *old_chain;
+ struct cleanup *canonical_strings_chain = NULL;
+ 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.");
@@ -3271,43 +3982,44 @@ create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, con
}
if (sals.nelts != 1)
{
- warning ("Unable to set a unique breakpoint on dynamic linker callback.");
+ warning ("Unable to set unique breakpoint on dynamic linker callback.");
warning ("GDB will be unable to track shl_load/shl_unload calls");
return;
}
- /* Make sure that all storage allocated in decode_line_1 gets freed in case
- the following errors out. */
- old_chain = make_cleanup (free, sals.sals);
- if (canonical != (char **)NULL)
+ /* Make sure that all storage allocated in decode_line_1 gets freed
+ in case the following errors out. */
+ old_chain = make_cleanup (xfree, sals.sals);
+ if (canonical != (char **) NULL)
{
- make_cleanup (free, canonical);
+ make_cleanup (xfree, canonical);
canonical_strings_chain = make_cleanup (null_cleanup, 0);
if (canonical[0] != NULL)
- make_cleanup (free, canonical[0]);
+ make_cleanup (xfree, 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]);
+
+ b = set_raw_breakpoint (sals.sals[0], bp_kind);
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->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;
-
+
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
+
if (dll_pathname == NULL)
b->dll_pathname = NULL;
else
@@ -3315,220 +4027,194 @@ create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, con
b->dll_pathname = (char *) xmalloc (strlen (dll_pathname) + 1);
strcpy (b->dll_pathname, dll_pathname);
}
- b->type = bp_kind;
-
+
mention (b);
do_cleanups (old_chain);
}
void
-create_solib_load_event_breakpoint (hookname, tempflag, dll_pathname, cond_string)
- char * hookname;
- int tempflag;
- char * dll_pathname;
- char * cond_string;
+create_solib_load_event_breakpoint (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);
+ solib_load_unload_1 (hookname, 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;
+create_solib_unload_event_breakpoint (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);
+ solib_load_unload_1 (hookname,tempflag, dll_pathname,
+ cond_string, bp_catch_unload);
}
static void
-create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_kind)
- int tempflag;
- char * cond_string;
- enum bptype bp_kind;
-{
- struct symtab_and_line sal;
- struct breakpoint * b;
- int thread = -1; /* All threads. */
-
- INIT_SAL(&sal);
+create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
+ enum bptype bp_kind)
+{
+ struct symtab_and_line sal;
+ struct breakpoint *b;
+ int thread = -1; /* All threads. */
+
+ INIT_SAL (&sal);
sal.pc = 0;
sal.symtab = NULL;
sal.line = 0;
-
- b = set_raw_breakpoint (sal);
+
+ b = set_raw_breakpoint (sal, bp_kind);
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->cond_string = (cond_string == NULL) ?
+ NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_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;
+create_fork_event_catchpoint (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;
+create_vfork_event_catchpoint (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;
+create_exec_event_catchpoint (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;
- b = set_raw_breakpoint (sal);
+ b = set_raw_breakpoint (sal, bp_catch_exec);
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->cond_string = (cond_string == NULL) ?
+ NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
-
- b->type = bp_catch_exec;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
mention (b);
}
static int
-hw_breakpoint_used_count()
+hw_breakpoint_used_count (void)
{
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_state == bp_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 (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_state == bp_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_state == bp_enabled)
+ *other_type_used = 1;
+ }
+ }
return i;
}
-/* Call this after hitting the longjmp() breakpoint. Use this to set a new
- breakpoint at the target of the jmp_buf.
+/* Call this after hitting the longjmp() breakpoint. Use this to set
+ a new breakpoint at the target of the jmp_buf.
- FIXME - This ought to be done by setting a temporary breakpoint that gets
- deleted automatically... */
+ FIXME - This ought to be done by setting a temporary breakpoint
+ that gets deleted automatically... */
void
-set_longjmp_resume_breakpoint(pc, frame)
- CORE_ADDR pc;
- struct frame_info *frame;
+set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame)
{
register struct breakpoint *b;
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_state = bp_enabled;
+ if (frame != NULL)
+ b->frame = frame->frame;
+ else
+ b->frame = 0;
+ check_duplicates (b);
+ return;
+ }
}
void
-disable_watchpoints_before_interactive_call_start ()
+disable_watchpoints_before_interactive_call_start (void)
{
- 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_state == bp_enabled))
+ {
+ b->enable_state = bp_call_disabled;
+ check_duplicates (b);
+ }
+ }
}
void
-enable_watchpoints_after_interactive_call_stop ()
+enable_watchpoints_after_interactive_call_stop (void)
{
- 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_state == bp_call_disabled))
+ {
+ b->enable_state = bp_enabled;
+ check_duplicates (b);
+ }
+ }
}
@@ -3537,35 +4223,36 @@ enable_watchpoints_after_interactive_call_stop ()
Restrict it to frame FRAME if FRAME is nonzero. */
struct breakpoint *
-set_momentary_breakpoint (sal, frame, type)
- struct symtab_and_line sal;
- struct frame_info *frame;
- enum bptype type;
+set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame,
+ enum bptype type)
{
register struct breakpoint *b;
- b = set_raw_breakpoint (sal);
- b->type = type;
- b->enable = enabled;
- b->disposition = donttouch;
+ b = set_raw_breakpoint (sal, type);
+ b->enable_state = bp_enabled;
+ b->disposition = disp_donttouch;
b->frame = (frame ? frame->frame : 0);
/* If we're debugging a multi-threaded program, then we
want momentary breakpoints to be active in only a
single thread of control. */
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
return b;
}
-
+
/* Tell the user we have just set a breakpoint B. */
static void
-mention (b)
- struct breakpoint *b;
+mention (struct breakpoint *b)
{
int say_where = 0;
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
/* FIXME: This is misplaced; mention() is called by things (like hitting a
watchpoint) other than breakpoint creation. It should be possible to
@@ -3574,6 +4261,7 @@ mention (b)
delete_breakpoint_hook and so on. */
if (create_breakpoint_hook)
create_breakpoint_hook (b);
+ breakpoint_create_event (b->number);
switch (b->type)
{
@@ -3581,51 +4269,82 @@ mention (b)
printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
break;
case bp_watchpoint:
- printf_filtered ("Watchpoint %d: ", b->number);
- print_expression (b->exp, gdb_stdout);
+ ui_out_text (uiout, "Watchpoint ");
+ ui_out_tuple_begin (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_tuple_end (uiout);
break;
case bp_hardware_watchpoint:
- printf_filtered ("Hardware watchpoint %d: ", b->number);
- print_expression (b->exp, gdb_stdout);
+ ui_out_text (uiout, "Hardware watchpoint ");
+ ui_out_tuple_begin (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_tuple_end (uiout);
break;
case bp_read_watchpoint:
- printf_filtered ("Hardware read watchpoint %d: ", b->number);
- print_expression (b->exp, gdb_stdout);
+ ui_out_text (uiout, "Hardware read watchpoint ");
+ ui_out_tuple_begin (uiout, "hw-rwpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_tuple_end (uiout);
break;
case bp_access_watchpoint:
- printf_filtered ("Hardware access (read/write) watchpoint %d: ",b->number);
- print_expression (b->exp, gdb_stdout);
+ ui_out_text (uiout, "Hardware access (read/write) watchpoint ");
+ ui_out_tuple_begin (uiout, "hw-awpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_tuple_end (uiout);
break;
case bp_breakpoint:
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ say_where = 0;
+ break;
+ }
printf_filtered ("Breakpoint %d", b->number);
say_where = 1;
break;
case bp_hardware_breakpoint:
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ say_where = 0;
+ break;
+ }
printf_filtered ("Hardware assisted breakpoint %d", b->number);
say_where = 1;
break;
case bp_catch_load:
case bp_catch_unload:
printf_filtered ("Catchpoint %d (%s %s)",
- b->number,
- (b->type == bp_catch_load) ? "load" : "unload",
- (b->dll_pathname != NULL) ? b->dll_pathname : "<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:
@@ -3637,6 +4356,8 @@ mention (b)
case bp_call_dummy:
case bp_watchpoint_scope:
case bp_shlib_event:
+ case bp_thread_event:
+ case bp_overlay_event:
break;
}
if (say_where)
@@ -3649,114 +4370,142 @@ 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));
}
+ do_cleanups (old_chain);
+ if (ui_out_is_mi_like_p (uiout))
+ return;
printf_filtered ("\n");
}
-
-/* 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. */
-static void
-break_command_1 (arg, flag, from_tty)
- char *arg;
- int flag, from_tty;
-{
- int tempflag, hardwareflag;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- register struct expression *cond = 0;
- register struct breakpoint *b;
+/* Add SALS.nelts breakpoints to the breakpoint table. For each
+ SALS.sal[i] breakpoint, include the corresponding ADDR_STRING[i],
+ COND[i] and COND_STRING[i] values.
- /* Pointers in arg to the start, and one past the end, of the condition. */
- char *cond_start = NULL;
- char *cond_end = NULL;
- /* Pointers in arg to the start, and one past the end,
- of the address part. */
- char *addr_start = NULL;
- char *addr_end = NULL;
- struct cleanup *old_chain;
- struct cleanup *canonical_strings_chain = NULL;
- char **canonical = (char **)NULL;
- int i;
- int thread;
+ NOTE: If the function succeeds, the caller is expected to cleanup
+ the arrays ADDR_STRING, COND_STRING, COND and SALS (but not the
+ array contents). If the function fails (error() is called), the
+ caller is expected to cleanups both the ADDR_STRING, COND_STRING,
+ COND and SALS arrays and each of those arrays contents. */
- hardwareflag = flag & BP_HARDWAREFLAG;
- tempflag = flag & BP_TEMPFLAG;
+static void
+create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
+ struct expression **cond, char **cond_string,
+ enum bptype type, enum bpdisp disposition,
+ int thread, int ignore_count, int from_tty)
+{
+ if (type == bp_hardware_breakpoint)
+ {
+ int i = hw_breakpoint_used_count ();
+ int target_resources_ok =
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT (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.");
+ }
- sals.sals = NULL;
- sals.nelts = 0;
+ /* Now set all the breakpoints. */
+ {
+ int i;
+ for (i = 0; i < sals.nelts; i++)
+ {
+ struct breakpoint *b;
+ struct symtab_and_line sal = sals.sals[i];
- INIT_SAL (&sal); /* initialize to zeroes */
+ if (from_tty)
+ describe_other_breakpoints (sal.pc, sal.section);
+
+ b = set_raw_breakpoint (sal, type);
+ set_breakpoint_count (breakpoint_count + 1);
+ b->number = breakpoint_count;
+ b->cond = cond[i];
+ b->thread = thread;
+ b->addr_string = addr_string[i];
+ b->cond_string = cond_string[i];
+ b->ignore_count = ignore_count;
+ b->enable_state = bp_enabled;
+ b->disposition = disposition;
+ mention (b);
+ }
+ }
+}
- /* If no arg given, or if first arg is 'if ', use the default breakpoint. */
+/* Parse ARG which is assumed to be a SAL specification possibly
+ followed by conditionals. On return, SALS contains an array of SAL
+ addresses found. ADDR_STRING contains a vector of (canonical)
+ address strings. ARG points to the end of the SAL. */
- if (!arg || (arg[0] == 'i' && arg[1] == 'f'
- && (arg[2] == ' ' || arg[2] == '\t')))
+void
+parse_breakpoint_sals (char **address,
+ struct symtabs_and_lines *sals,
+ char ***addr_string)
+{
+ char *addr_start = *address;
+ *addr_string = NULL;
+ /* If no arg given, or if first arg is 'if ', use the default
+ breakpoint. */
+ if ((*address) == NULL
+ || (strncmp ((*address), "if", 2) == 0 && isspace ((*address)[2])))
{
if (default_breakpoint_valid)
{
- sals.sals = (struct symtab_and_line *)
+ struct symtab_and_line sal;
+ INIT_SAL (&sal); /* initialize to zeroes */
+ 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);
- sals.sals[0] = sal;
- sals.nelts = 1;
+ sal.section = find_pc_overlay (sal.pc);
+ sals->sals[0] = sal;
+ sals->nelts = 1;
}
else
error ("No default breakpoint address now.");
}
else
{
- 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);
+ || (strchr ("+-", (*address)[0]) != NULL)))
+ *sals = decode_line_1 (address, 1, default_breakpoint_symtab,
+ default_breakpoint_line, addr_string);
else
- sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0, &canonical);
-
- addr_end = arg;
+ *sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string);
}
-
- 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)
+ /* For any SAL that didn't have a canonical string, fill one in. */
+ if (sals->nelts > 0 && *addr_string == NULL)
+ *addr_string = xcalloc (sals->nelts, sizeof (char **));
+ if (addr_start != (*address))
{
- make_cleanup (free, canonical);
- canonical_strings_chain = make_cleanup (null_cleanup, 0);
- for (i = 0; i < sals.nelts; i++)
+ int i;
+ for (i = 0; i < sals->nelts; i++)
{
- if (canonical[i] != NULL)
- make_cleanup (free, canonical[i]);
+ /* Add the string if not present. */
+ if ((*addr_string)[i] == NULL)
+ (*addr_string)[i] = savestring (addr_start, (*address) - addr_start);
}
}
+}
- thread = -1; /* No specific thread yet */
- /* Resolve all line numbers to PC's, and verify that conditions
- can be parsed, before setting any breakpoints. */
- for (i = 0; i < sals.nelts; i++)
- {
- char *tok, *end_tok;
- int toklen;
+/* Convert each SAL into a real PC. Verify that the PC can be
+ inserted as a breakpoint. If it can't throw an error. */
- resolve_sal_pc (&sals.sals[i]);
+void
+breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
+ char *address)
+{
+ int i;
+ for (i = 0; i < sals->nelts; i++)
+ {
+ resolve_sal_pc (&sals->sals[i]);
/* It's possible for the PC to be nonzero, but still an illegal
value on some targets.
@@ -3771,15 +4520,98 @@ 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);
- }
-
- tok = arg;
+ if (PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc))
+ {
+ if (address == NULL)
+ error ("Cannot break without a running program.");
+ else
+ error ("Cannot break on %s without a running program.",
+ address);
+ }
+ }
+}
+
+/* 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. */
+
+static void
+break_command_1 (char *arg, int flag, int from_tty)
+{
+ int tempflag, hardwareflag;
+ struct symtabs_and_lines sals;
+ register struct expression **cond = 0;
+ /* Pointers in arg to the start, and one past the end, of the
+ condition. */
+ char **cond_string = (char **) NULL;
+ char *addr_start = arg;
+ char **addr_string;
+ struct cleanup *old_chain;
+ struct cleanup *breakpoint_chain = NULL;
+ int i;
+ int thread = -1;
+ int ignore_count = 0;
+
+ hardwareflag = flag & BP_HARDWAREFLAG;
+ tempflag = flag & BP_TEMPFLAG;
+
+ sals.sals = NULL;
+ sals.nelts = 0;
+ addr_string = NULL;
+ parse_breakpoint_sals (&arg, &sals, &addr_string);
+
+ if (!sals.nelts)
+ return;
+
+ /* Create a chain of things that always need to be cleaned up. */
+ old_chain = make_cleanup (null_cleanup, 0);
+
+ /* Make sure that all storage allocated to SALS gets freed. */
+ make_cleanup (xfree, sals.sals);
+
+ /* Cleanup the addr_string array but not its contents. */
+ make_cleanup (xfree, addr_string);
+
+ /* Allocate space for all the cond expressions. */
+ cond = xcalloc (sals.nelts, sizeof (struct expression *));
+ make_cleanup (xfree, cond);
+
+ /* Allocate space for all the cond strings. */
+ cond_string = xcalloc (sals.nelts, sizeof (char **));
+ make_cleanup (xfree, cond_string);
+
+ /* ----------------------------- SNIP -----------------------------
+ Anything added to the cleanup chain beyond this point is assumed
+ to be part of a breakpoint. If the breakpoint create succeeds
+ then the memory is not reclaimed. */
+ breakpoint_chain = make_cleanup (null_cleanup, 0);
+
+ /* Mark the contents of the addr_string for cleanup. These go on
+ the breakpoint_chain and only occure if the breakpoint create
+ fails. */
+ for (i = 0; i < sals.nelts; i++)
+ {
+ if (addr_string[i] != NULL)
+ make_cleanup (xfree, addr_string[i]);
+ }
+
+ /* Resolve all line numbers to PC's and verify that the addresses
+ are ok for the target. */
+ breakpoint_sals_to_pc (&sals, addr_start);
+ /* Verify that condition can be parsed, before setting any
+ breakpoints. Allocate a separate condition expression for each
+ breakpoint. */
+ thread = -1; /* No specific thread yet */
+ for (i = 0; i < sals.nelts; i++)
+ {
+ char *tok = arg;
while (tok && *tok)
{
+ char *end_tok;
+ int toklen;
+ char *cond_start = NULL;
+ char *cond_end = NULL;
while (*tok == ' ' || *tok == '\t')
tok++;
@@ -3793,8 +4625,11 @@ break_command_1 (arg, flag, from_tty)
if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
{
tok = cond_start = end_tok + 1;
- cond = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
+ cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
+ make_cleanup (xfree, cond[i]);
cond_end = tok;
+ cond_string[i] = savestring (cond_start, cond_end - cond_start);
+ make_cleanup (xfree, cond_string[i]);
}
else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
{
@@ -3812,69 +4647,157 @@ break_command_1 (arg, flag, from_tty)
error ("Junk at end of arguments.");
}
}
- if (hardwareflag)
- {
- int i, target_resources_ok;
- i = hw_breakpoint_used_count ();
- target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
- 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.");
+ create_breakpoints (sals, addr_string, cond, cond_string,
+ hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
+ tempflag ? disp_del : disp_donttouch,
+ thread, ignore_count, from_tty);
+
+ if (sals.nelts > 1)
+ {
+ warning ("Multiple breakpoints were set.");
+ warning ("Use the \"delete\" command to delete unwanted breakpoints.");
}
+ /* That's it. Discard the cleanups for data inserted into the
+ breakpoint. */
+ discard_cleanups (breakpoint_chain);
+ /* But cleanup everything else. */
+ do_cleanups (old_chain);
+}
- /* Remove the canonical strings from the cleanup, they are needed below. */
- if (canonical != (char **)NULL)
- discard_cleanups (canonical_strings_chain);
+/* Set a breakpoint of TYPE/DISPOSITION according to ARG (function,
+ linenum or *address) with COND and IGNORE_COUNT. */
- /* Now set all the breakpoints. */
+struct captured_breakpoint_args
+ {
+ char *address;
+ char *condition;
+ int hardwareflag;
+ int tempflag;
+ int thread;
+ int ignore_count;
+ };
+
+static int
+do_captured_breakpoint (void *data)
+{
+ struct captured_breakpoint_args *args = data;
+ struct symtabs_and_lines sals;
+ register struct expression **cond;
+ struct cleanup *old_chain;
+ struct cleanup *breakpoint_chain = NULL;
+ int i;
+ char **addr_string;
+ char **cond_string;
+
+ char *address_end;
+
+ /* Parse the source and lines spec. Delay check that the expression
+ didn't contain trailing garbage until after cleanups are in
+ place. */
+ sals.sals = NULL;
+ sals.nelts = 0;
+ address_end = args->address;
+ addr_string = NULL;
+ parse_breakpoint_sals (&address_end, &sals, &addr_string);
+
+ if (!sals.nelts)
+ return GDB_RC_NONE;
+
+ /* Create a chain of things at always need to be cleaned up. */
+ old_chain = make_cleanup (null_cleanup, 0);
+
+ /* Always have a addr_string array, even if it is empty. */
+ make_cleanup (xfree, addr_string);
+
+ /* Make sure that all storage allocated to SALS gets freed. */
+ make_cleanup (xfree, sals.sals);
+
+ /* Allocate space for all the cond expressions. */
+ cond = xcalloc (sals.nelts, sizeof (struct expression *));
+ make_cleanup (xfree, cond);
+
+ /* Allocate space for all the cond strings. */
+ cond_string = xcalloc (sals.nelts, sizeof (char **));
+ make_cleanup (xfree, cond_string);
+
+ /* ----------------------------- SNIP -----------------------------
+ Anything added to the cleanup chain beyond this point is assumed
+ to be part of a breakpoint. If the breakpoint create goes
+ through then that memory is not cleaned up. */
+ breakpoint_chain = make_cleanup (null_cleanup, 0);
+
+ /* Mark the contents of the addr_string for cleanup. These go on
+ the breakpoint_chain and only occure if the breakpoint create
+ fails. */
for (i = 0; i < sals.nelts; i++)
{
- sal = sals.sals[i];
+ if (addr_string[i] != NULL)
+ make_cleanup (xfree, addr_string[i]);
+ }
- if (from_tty)
- describe_other_breakpoints (sal.pc, sal.section);
+ /* Wait until now before checking for garbage at the end of the
+ address. That way cleanups can take care of freeing any
+ memory. */
+ if (*address_end != '\0')
+ error ("Garbage %s following breakpoint address", address_end);
- b = set_raw_breakpoint (sal);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->type = hardwareflag ? bp_hardware_breakpoint : bp_breakpoint;
- b->cond = cond;
- b->thread = thread;
-
- /* If a canonical line spec is needed use that instead of the
- 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);
- }
+ /* Resolve all line numbers to PC's. */
+ breakpoint_sals_to_pc (&sals, args->address);
- if (sals.nelts > 1)
+ /* Verify that conditions can be parsed, before setting any
+ breakpoints. */
+ for (i = 0; i < sals.nelts; i++)
{
- printf_filtered ("Multiple breakpoints were set.\n");
- printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
+ if (args->condition != NULL)
+ {
+ char *tok = args->condition;
+ cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
+ if (*tok != '\0')
+ error ("Garbage %s follows condition", tok);
+ make_cleanup (xfree, cond[i]);
+ cond_string[i] = xstrdup (args->condition);
+ }
}
+
+ create_breakpoints (sals, addr_string, cond, cond_string,
+ args->hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
+ args->tempflag ? disp_del : disp_donttouch,
+ args->thread, args->ignore_count, 0/*from-tty*/);
+
+ /* That's it. Discard the cleanups for data inserted into the
+ breakpoint. */
+ discard_cleanups (breakpoint_chain);
+ /* But cleanup everything else. */
do_cleanups (old_chain);
+ return GDB_RC_OK;
+}
+
+enum gdb_rc
+gdb_breakpoint (char *address, char *condition,
+ int hardwareflag, int tempflag,
+ int thread, int ignore_count)
+{
+ struct captured_breakpoint_args args;
+ args.address = address;
+ args.condition = condition;
+ args.hardwareflag = hardwareflag;
+ args.tempflag = tempflag;
+ args.thread = thread;
+ args.ignore_count = ignore_count;
+ return catch_errors (do_captured_breakpoint, &args,
+ NULL, RETURN_MASK_ALL);
}
+
static void
-break_at_finish_at_depth_command_1 (arg, flag, from_tty)
- char *arg;
- int flag;
- int from_tty;
+break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty)
{
struct frame_info *frame;
CORE_ADDR low, high, selected_pc = 0;
- char *extra_args, *level_arg, *addr_string;
+ char *extra_args = NULL;
+ char *level_arg;
+ char *addr_string;
int extra_args_len = 0, if_arg = 0;
if (!arg ||
@@ -3921,20 +4844,20 @@ 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)
- sprintf (addr_string, "*0x%x %s", high, extra_args);
+ sprintf (addr_string, "*0x%s %s", paddr_nz (high), extra_args);
else
- sprintf (addr_string, "*0x%x", high);
+ sprintf (addr_string, "*0x%s", paddr_nz (high));
break_command_1 (addr_string, flag, from_tty);
- free (addr_string);
+ xfree (addr_string);
}
else
error ("No function contains the specified address");
@@ -3945,17 +4868,14 @@ break_at_finish_at_depth_command_1 (arg, flag, from_tty)
static void
-break_at_finish_command_1 (arg, flag, from_tty)
- char *arg;
- int flag;
- int from_tty;
+break_at_finish_command_1 (char *arg, int flag, int from_tty)
{
char *addr_string, *break_string, *beg_addr_string;
CORE_ADDR low, high;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct cleanup *old_chain;
- char *extra_args;
+ char *extra_args = NULL;
int extra_args_len = 0;
int i, if_arg = 0;
@@ -3967,7 +4887,7 @@ break_at_finish_command_1 (arg, flag, from_tty)
if (selected_frame)
{
addr_string = (char *) xmalloc (15);
- sprintf (addr_string, "*0x%x", selected_frame->pc);
+ sprintf (addr_string, "*0x%s", paddr_nz (selected_frame->pc));
if (arg)
if_arg = 1;
}
@@ -3986,59 +4906,57 @@ 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);
+ xfree (beg_addr_string);
+ old_chain = make_cleanup (xfree, 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)
- sprintf (break_string, "*0x%x %s", high, extra_args);
+ sprintf (break_string, "*0x%s %s", paddr_nz (high), extra_args);
else
- sprintf (break_string, "*0x%x", high);
+ sprintf (break_string, "*0x%s", paddr_nz (high));
break_command_1 (break_string, flag, from_tty);
- free(break_string);
+ xfree (break_string);
}
else
error ("No function contains the specified address");
}
if (sals.nelts > 1)
{
- printf_filtered ("Multiple breakpoints were set.\n");
- printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
+ warning ("Multiple breakpoints were set.\n");
+ warning ("Use the \"delete\" command to delete unwanted breakpoints.");
}
- do_cleanups(old_chain);
+ do_cleanups (old_chain);
}
/* Helper function for break_command_1 and disassemble_command. */
void
-resolve_sal_pc (sal)
- struct symtab_and_line *sal;
+resolve_sal_pc (struct symtab_and_line *sal)
{
CORE_ADDR pc;
@@ -4053,14 +4971,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)
{
@@ -4070,11 +4988,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)
@@ -4085,65 +5003,49 @@ resolve_sal_pc (sal)
}
void
-break_command (arg, from_tty)
- char *arg;
- int from_tty;
+break_command (char *arg, int from_tty)
{
break_command_1 (arg, 0, from_tty);
}
void
-break_at_finish_command (arg, from_tty)
- char *arg;
- int from_tty;
+break_at_finish_command (char *arg, int from_tty)
{
break_at_finish_command_1 (arg, 0, from_tty);
}
void
-break_at_finish_at_depth_command (arg, from_tty)
- char *arg;
- int from_tty;
+break_at_finish_at_depth_command (char *arg, int from_tty)
{
break_at_finish_at_depth_command_1 (arg, 0, from_tty);
}
void
-tbreak_command (arg, from_tty)
- char *arg;
- int from_tty;
+tbreak_command (char *arg, int from_tty)
{
break_command_1 (arg, BP_TEMPFLAG, from_tty);
}
void
-tbreak_at_finish_command (arg, from_tty)
- char *arg;
- int from_tty;
+tbreak_at_finish_command (char *arg, int from_tty)
{
break_at_finish_command_1 (arg, BP_TEMPFLAG, from_tty);
}
static void
-hbreak_command (arg, from_tty)
- char *arg;
- int from_tty;
+hbreak_command (char *arg, int from_tty)
{
break_command_1 (arg, BP_HARDWAREFLAG, from_tty);
}
static void
-thbreak_command (arg, from_tty)
- char *arg;
- int from_tty;
+thbreak_command (char *arg, int from_tty)
{
break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty);
}
static void
-stop_command (arg, from_tty)
- char *arg;
- int from_tty;
+stop_command (char *arg, int from_tty)
{
printf_filtered ("Specify the type of breakpoint to set.\n\
Usage: stop in <function | address>\n\
@@ -4151,48 +5053,44 @@ Usage: stop in <function | address>\n\
}
static void
-stopin_command (arg, from_tty)
- char *arg;
- int from_tty;
+stopin_command (char *arg, int from_tty)
{
int badInput = 0;
- if (arg == (char *)NULL)
+ if (arg == (char *) NULL)
badInput = 1;
else if (*arg != '*')
{
char *argptr = arg;
int hasColon = 0;
- /* look for a ':'. If this is a line number specification, then say
- it is bad, otherwise, it should be an address or function/method
- name */
+ /* look for a ':'. If this is a line number specification, then
+ say it is bad, otherwise, it should be an address or
+ function/method name */
while (*argptr && !hasColon)
- {
- hasColon = (*argptr == ':');
- argptr++;
- }
+ {
+ 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);
}
static void
-stopat_command (arg, from_tty)
- char *arg;
- int from_tty;
+stopat_command (char *arg, int from_tty)
{
int badInput = 0;
- if (arg == (char *)NULL || *arg == '*') /* no line number */
+ if (arg == (char *) NULL || *arg == '*') /* no line number */
badInput = 1;
else
{
@@ -4200,32 +5098,31 @@ 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);
}
/* ARGSUSED */
-/* accessflag: 0: watch write, 1: watch read, 2: watch access(read or write) */
+/* accessflag: hw_write: watch write,
+ hw_read: watch read,
+ hw_access: watch access (read or write) */
static void
-watch_command_1 (arg, accessflag, from_tty)
- char *arg;
- int accessflag;
- int from_tty;
+watch_command_1 (char *arg, int accessflag, int from_tty)
{
struct breakpoint *b;
struct symtab_and_line sal;
@@ -4245,8 +5142,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;
@@ -4275,52 +5172,63 @@ 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 == hw_read)
+ bp_type = bp_read_watchpoint;
+ else if (accessflag == hw_access)
+ 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 support this type of hardware watchpoint.");
+
+ if (target_resources_ok < 0 && bp_type != bp_hardware_watchpoint)
+ error ("Target can only support one kind of HW watchpoint at a time.");
+ }
#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
startup sequence by the dynamic linker.
However, I tried avoiding that by having HP-UX's implementation of
- TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_pid
+ TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_ptid
yet, which forced slow watches before a "run" or "attach", and it
still fails somewhere in the startup code.
Until I figure out what's happening, I'm disallowing watches altogether
before the "run" or "attach" command. We'll tell the user they must
set watches after getting the program started. */
- if (! target_has_execution)
+ if (!target_has_execution)
{
warning ("can't do that without a running program; try \"break main\", \"run\" first");
return;
}
#endif /* HPUXHPPA */
-
+
+ /* Change the type of breakpoint to an ordinary watchpoint if a hardware
+ watchpoint could not be set. */
+ if (!mem_cnt || target_resources_ok <= 0)
+ bp_type = bp_watchpoint;
+
/* Now set up the breakpoint. */
- b = set_raw_breakpoint (sal);
+ b = set_raw_breakpoint (sal, bp_type);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->disposition = donttouch;
+ b->disposition = disp_donttouch;
b->exp = exp;
b->exp_valid_block = exp_valid_block;
b->exp_string = savestring (exp_start, exp_end - exp_start);
@@ -4330,7 +5238,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)
{
@@ -4338,12 +5246,7 @@ watch_command_1 (arg, accessflag, from_tty)
b->watchpoint_frame = frame->frame;
}
else
- b->watchpoint_frame = (CORE_ADDR)0;
-
- if (mem_cnt && target_resources_ok > 0)
- b->type = bp_type;
- else
- b->type = bp_watchpoint;
+ b->watchpoint_frame = (CORE_ADDR) 0;
/* If the expression is "local", then set up a "watchpoint scope"
breakpoint at the point where we've left the scope of the watchpoint
@@ -4356,18 +5259,18 @@ 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);
+ scope_breakpoint = set_raw_breakpoint (scope_sal,
+ bp_watchpoint_scope);
set_breakpoint_count (breakpoint_count + 1);
scope_breakpoint->number = breakpoint_count;
- scope_breakpoint->type = bp_watchpoint_scope;
- scope_breakpoint->enable = enabled;
+ scope_breakpoint->enable_state = bp_enabled;
/* Automatically delete the breakpoint when it hits. */
- scope_breakpoint->disposition = del;
+ scope_breakpoint->disposition = disp_del;
/* Only break in the proper frame (help with recursion). */
scope_breakpoint->frame = prev_frame->frame;
@@ -4389,33 +5292,80 @@ watch_command_1 (arg, accessflag, from_tty)
in hardware return zero. */
#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
-#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_size) \
- ((byte_size) <= (REGISTER_SIZE))
+#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \
+ ((BYTE_SIZE) <= (REGISTER_SIZE))
+#endif
+
+#if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT)
+#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR,LEN) \
+ (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN))
#endif
static int
-can_use_hardware_watchpoint (v)
- struct value *v;
+can_use_hardware_watchpoint (struct value *v)
{
int found_memory_cnt = 0;
+ struct value *head = v;
/* 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)
+
+ /* Make sure that the value of the expression depends only upon
+ memory contents, and values computed from them within GDB. If we
+ find any register references or function calls, we can't use a
+ hardware watchpoint.
+
+ The idea here is that evaluating an expression generates a series
+ of values, one holding the value of every subexpression. (The
+ expression a*b+c has five subexpressions: a, b, a*b, c, and
+ a*b+c.) GDB's values hold almost enough information to establish
+ the criteria given above --- they identify memory lvalues,
+ register lvalues, computed values, etcetera. So we can evaluate
+ the expression, and then scan the chain of values that leaves
+ behind to decide whether we can detect any possible change to the
+ expression's final value using only hardware watchpoints.
+
+ However, I don't think that the values returned by inferior
+ function calls are special in any way. So this function may not
+ notice that an expression involving an inferior function call
+ can't be watched with hardware watchpoints. FIXME. */
+ for (; v; v = v->next)
{
- if (v->lval == lval_memory)
+ if (VALUE_LVAL (v) == lval_memory)
{
- if (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (TYPE_LENGTH (VALUE_TYPE (v))))
- found_memory_cnt++;
- }
+ if (VALUE_LAZY (v))
+ /* A lazy memory lvalue is one that GDB never needed to fetch;
+ we either just used its address (e.g., `a' in `a.b') or
+ we never needed it at all (e.g., `a' in `a,b'). */
+ ;
+ else
+ {
+ /* Ahh, memory we actually used! Check if we can cover
+ it with hardware watchpoints. */
+ struct type *vtype = check_typedef (VALUE_TYPE (v));
+
+ /* We only watch structs and arrays if user asked for it
+ explicitly, never if they just happen to appear in a
+ middle of some value chain. */
+ if (v == head
+ || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ int len = TYPE_LENGTH (VALUE_TYPE (v));
+
+ if (!TARGET_REGION_OK_FOR_HW_WATCHPOINT (vaddr, len))
+ return 0;
+ else
+ found_memory_cnt++;
+ }
+ }
+ }
else if (v->lval != not_lval && v->modifiable == 0)
- return 0;
+ return 0; /* ??? What does this represent? */
+ else if (v->lval == lval_register)
+ return 0; /* cannot watch a register with a HW watchpoint */
}
/* The expression itself looks suitable for using a hardware
@@ -4423,104 +5373,162 @@ can_use_hardware_watchpoint (v)
return found_memory_cnt;
}
-static void watch_command (arg, from_tty)
- char *arg;
- int from_tty;
+void
+watch_command_wrapper (char *arg, int from_tty)
{
- watch_command_1 (arg, 0, from_tty);
+ watch_command (arg, from_tty);
}
-static void rwatch_command (arg, from_tty)
- char *arg;
- int from_tty;
+static void
+watch_command (char *arg, int from_tty)
{
- watch_command_1 (arg, 1, from_tty);
+ watch_command_1 (arg, hw_write, from_tty);
}
-static void awatch_command (arg, from_tty)
- char *arg;
- int from_tty;
+void
+rwatch_command_wrapper (char *arg, int from_tty)
{
- watch_command_1 (arg, 2, from_tty);
+ rwatch_command (arg, from_tty);
}
+static void
+rwatch_command (char *arg, int from_tty)
+{
+ watch_command_1 (arg, hw_read, from_tty);
+}
+
+void
+awatch_command_wrapper (char *arg, int from_tty)
+{
+ awatch_command (arg, from_tty);
+}
+
+static void
+awatch_command (char *arg, int from_tty)
+{
+ watch_command_1 (arg, hw_access, from_tty);
+}
-/* Helper routine for the until_command routine in infcmd.c. Here
+
+/* Helper routines for the until_command routine in infcmd.c. Here
because it uses the mechanisms of breakpoints. */
+/* This function is called by fetch_inferior_event via the
+ cmd_continuation pointer, to complete the until command. It takes
+ care of cleaning up the temporary breakpoints set up by the until
+ command. */
+static void
+until_break_command_continuation (struct continuation_arg *arg)
+{
+ struct cleanup *cleanups;
+
+ cleanups = (struct cleanup *) arg->data.pointer;
+ do_exec_cleanups (cleanups);
+}
+
/* ARGSUSED */
void
-until_break_command (arg, from_tty)
- char *arg;
- int from_tty;
+until_break_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct frame_info *prev_frame = get_prev_frame (selected_frame);
struct breakpoint *breakpoint;
struct cleanup *old_chain;
+ struct continuation_arg *arg1;
+
clear_proceed_status ();
/* 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 */
-
+ xfree (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);
-
- old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+
+ if (!event_loop_p || !target_can_async_p ())
+ old_chain = make_cleanup_delete_breakpoint (breakpoint);
+ else
+ old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
+
+ /* If we are running asynchronously, and the target supports async
+ execution, we are not waiting for the target to stop, in the call
+ tp proceed, below. This means that we cannot delete the
+ brekpoints until the target has actually stopped. The only place
+ where we get a chance to do that is in fetch_inferior_event, so
+ we must set things up for that. */
+
+ if (event_loop_p && target_can_async_p ())
+ {
+ /* In this case the arg for the continuation is just the point
+ in the exec_cleanups chain from where to start doing
+ cleanups, because all the continuation does is the cleanups in
+ the exec_cleanup_chain. */
+ arg1 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg1->next = NULL;
+ arg1->data.pointer = old_chain;
+
+ add_continuation (until_break_command_continuation, arg1);
+ }
/* Keep within the current frame */
-
+
if (prev_frame)
{
sal = find_pc_line (prev_frame->pc, 0);
sal.pc = prev_frame->pc;
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
- make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ if (!event_loop_p || !target_can_async_p ())
+ make_cleanup_delete_breakpoint (breakpoint);
+ else
+ make_exec_cleanup_delete_breakpoint (breakpoint);
}
-
+
proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
- do_cleanups(old_chain);
+ /* Do the cleanups now, anly if we are not running asynchronously,
+ of if we are, but the target is still synchronous. */
+ if (!event_loop_p || !target_can_async_p ())
+ do_cleanups (old_chain);
}
#if 0
/* These aren't used; I don't konw what they were for. */
/* Set a breakpoint at the catch clause for NAME. */
static int
-catch_breakpoint (name)
- char *name;
+catch_breakpoint (char *name)
{
}
static int
-disable_catch_breakpoint ()
+disable_catch_breakpoint (void)
{
}
static int
-delete_catch_breakpoint ()
+delete_catch_breakpoint (void)
{
}
static int
-enable_catch_breakpoint ()
+enable_catch_breakpoint (void)
{
}
#endif /* 0 */
@@ -4531,6 +5539,7 @@ struct sal_chain
struct symtab_and_line sal;
};
+#if 0
/* Not really used -- invocation in handle_gnu_4_16_catch_command
had been commented out in the v.4.16 sources, and stays
disabled there now because "catch NAME" syntax isn't allowed.
@@ -4539,9 +5548,7 @@ struct sal_chain
/* For each catch clause identified in ARGS, run FUNCTION
with that clause as an argument. */
static struct symtabs_and_lines
-map_catch_names (args, function)
- char *args;
- int (*function)();
+map_catch_names (char *args, int (*function) ())
{
register char *p = args;
register char *p1;
@@ -4579,7 +5586,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;
@@ -4591,15 +5598,16 @@ map_catch_names (args, function)
win:
#endif
p = p1;
- while (*p == ' ' || *p == '\t') p++;
+ while (*p == ' ' || *p == '\t')
+ p++;
}
}
+#endif
/* This shares a lot of code with `print_frame_label_vars' from stack.c. */
static struct symtabs_and_lines
-get_catch_sals (this_level_only)
- int this_level_only;
+get_catch_sals (int this_level_only)
{
register struct blockvector *bl;
register struct block *block;
@@ -4649,15 +5657,11 @@ get_catch_sals (this_level_only)
if (blocks_searched[index] == 0)
{
struct block *b = BLOCKVECTOR_BLOCK (bl, index);
- int nsyms;
register int i;
register struct symbol *sym;
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
+ ALL_BLOCK_SYMBOLS (b, i, sym)
{
- sym = BLOCK_SYM (b, i);
if (STREQ (SYMBOL_NAME (sym), "default"))
{
if (have_default)
@@ -4667,9 +5671,10 @@ 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);
+ next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym),
+ 0);
sal_chain = next;
}
}
@@ -4683,8 +5688,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);
@@ -4710,166 +5715,169 @@ get_catch_sals (this_level_only)
}
static void
-ep_skip_leading_whitespace (s)
- char ** s;
+ep_skip_leading_whitespace (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
the token is returned. Else, NULL is returned. */
+
static char *
-ep_find_event_name_end (arg)
- char * arg;
+ep_find_event_name_end (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
if clause in the arg string. */
+
static char *
-ep_parse_optional_if_clause (arg)
- char ** arg;
+ep_parse_optional_if_clause (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;
+ep_parse_optional_filename (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;
+
+#if defined(CHILD_INSERT_FORK_CATCHPOINT) || defined(CHILD_INSERT_VFORK_CATCHPOINT)
+static void catch_fork_command_1 (catch_fork_kind fork_kind,
+ char *arg, int tempflag, int from_tty);
+
static void
-catch_fork_command_1 (fork_kind, arg, tempflag, from_tty)
- catch_fork_kind fork_kind;
- char * arg;
- int tempflag;
- int from_tty;
+catch_fork_command_1 (catch_fork_kind fork_kind, char *arg, 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;
- }
+ }
}
+#endif
+#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
static void
-catch_exec_command_1 (arg, tempflag, from_tty)
- char * arg;
- int tempflag;
- int from_tty;
+catch_exec_command_1 (char *arg, 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);
@@ -4881,34 +5889,32 @@ catch_exec_command_1 (arg, tempflag, from_tty)
and enable reporting of such events. */
create_exec_event_catchpoint (tempflag, cond_string);
}
-
+#endif
+
#if defined(SOLIB_ADD)
static void
-catch_load_command_1 (arg, tempflag, from_tty)
- char * arg;
- int tempflag;
- int from_tty;
+catch_load_command_1 (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)
@@ -4917,42 +5923,40 @@ 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);
+ SOLIB_CREATE_CATCH_LOAD_HOOK (PIDGET (inferior_ptid), tempflag,
+ dll_pathname, cond_string);
}
-
+
static void
-catch_unload_command_1 (arg, tempflag, from_tty)
- char * arg;
- int tempflag;
- int from_tty;
+catch_unload_command_1 (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)
@@ -4961,75 +5965,71 @@ 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. */
- SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag, dll_pathname, cond_string);
+ SOLIB_CREATE_CATCH_UNLOAD_HOOK (PIDGET (inferior_ptid), tempflag,
+ dll_pathname, cond_string);
}
#endif /* SOLIB_ADD */
/* Commands to deal with catching exceptions. */
/* Set a breakpoint at the specified callback routine for an
- exception event callback */
+ exception event callback */
static void
-create_exception_catchpoint (tempflag, cond_string, ex_event, sal)
- int tempflag;
- char * cond_string;
- enum exception_event_kind ex_event;
- struct symtab_and_line * sal;
+create_exception_catchpoint (int tempflag, char *cond_string,
+ enum exception_event_kind ex_event,
+ struct symtab_and_line *sal)
{
- struct breakpoint * b;
- int i;
- int thread = -1; /* All threads. */
+ struct breakpoint *b;
+ int thread = -1; /* All threads. */
+ enum bptype bptype;
- if (!sal) /* no exception support? */
+ if (!sal) /* no exception support? */
return;
- b = set_raw_breakpoint (*sal);
+ switch (ex_event)
+ {
+ case EX_EVENT_THROW:
+ bptype = bp_catch_throw;
+ break;
+ case EX_EVENT_CATCH:
+ bptype = bp_catch_catch;
+ break;
+ default: /* error condition */
+ error ("Internal error -- invalid catchpoint kind");
+ }
+
+ b = set_raw_breakpoint (*sal, bptype);
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->cond_string = (cond_string == NULL) ?
+ NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
- switch (ex_event)
- {
- case EX_EVENT_THROW:
- b->type = bp_catch_throw;
- break;
- case EX_EVENT_CATCH:
- b->type = bp_catch_catch;
- break;
- default: /* error condition */
- b->type = bp_none;
- b->enable = disabled;
- error ("Internal error -- invalid catchpoint kind");
- }
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
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)
- enum exception_event_kind ex_event;
- char * arg;
- int tempflag;
- int from_tty;
-{
- char * cond_string = NULL;
- struct symtab_and_line * sal = NULL;
-
+catch_exception_command_1 (enum exception_event_kind ex_event, char *arg,
+ int tempflag, int from_tty)
+{
+ char *cond_string = NULL;
+ struct symtab_and_line *sal = NULL;
+
ep_skip_leading_whitespace (&arg);
-
+
cond_string = ep_parse_optional_if_clause (&arg);
if ((*arg != '\0') && !isspace (*arg))
@@ -5042,31 +6042,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 () */
+
+ warning ("Unsupported with this platform/compiler combination.");
+ warning ("Perhaps you can achieve the effect you want by setting");
+ warning ("a breakpoint on __raise_exception().");
+ }
}
}
@@ -5074,18 +6074,17 @@ catch_exception_command_1 (ex_event, arg, tempflag, from_tty)
inside a catch_errors */
static int
-cover_target_enable_exception_callback (arg)
- PTR arg;
+cover_target_enable_exception_callback (PTR arg)
{
args_for_catchpoint_enable *args = arg;
struct symtab_and_line *sal;
- sal = target_enable_exception_callback (args->kind, args->enable);
+ sal = target_enable_exception_callback (args->kind, args->enable_p);
if (sal == NULL)
return 0;
else if (sal == (struct symtab_and_line *) -1)
return -1;
else
- return 1; /*is valid*/
+ return 1; /*is valid */
}
@@ -5098,15 +6097,12 @@ 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 () */
static void
-handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
- char *arg;
- int tempflag;
- int from_tty;
+handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty)
{
/* First, translate ARG into something we can deal with in terms
of breakpoints. */
@@ -5118,12 +6114,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. */
@@ -5138,26 +6134,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.");
@@ -5172,82 +6168,50 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
if (from_tty)
describe_other_breakpoints (sal.pc, sal.section);
- b = set_raw_breakpoint (sal);
+ /* 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 = set_raw_breakpoint (sal, bp_breakpoint);
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->cond = cond;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
mention (b);
}
if (sals.nelts > 1)
{
- printf_unfiltered ("Multiple breakpoints were set.\n");
- printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
+ warning ("Multiple breakpoints were set.");
+ warning ("Use the \"delete\" command to delete unwanted breakpoints.");
}
- free ((PTR)sals.sals);
+ xfree (sals.sals);
}
-#if 0
-/* This creates a temporary internal breakpoint
- just to placate infrun */
-static struct breakpoint *
-create_temp_exception_breakpoint (pc)
- CORE_ADDR pc;
-{
- struct symtab_and_line sal;
- struct breakpoint *b;
-
- INIT_SAL(&sal);
- sal.pc = pc;
- sal.symtab = NULL;
- sal.line = 0;
-
- b = set_raw_breakpoint (sal);
- if (!b)
- error ("Internal error -- couldn't set temp exception breakpoint");
-
- b->type = bp_breakpoint;
- b->disposition = del;
- b->enable = enabled;
- b->silent = 1;
- b->number = internal_breakpoint_number--;
- return b;
-}
-#endif
-
static void
-catch_command_1 (arg, tempflag, from_tty)
- char *arg;
- int tempflag;
- int from_tty;
+catch_command_1 (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.");
}
@@ -5255,7 +6219,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)
{
@@ -5263,11 +6227,13 @@ 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)
{
@@ -5292,7 +6258,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
@@ -5300,7 +6266,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
@@ -5308,7 +6274,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
@@ -5316,7 +6282,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
@@ -5324,7 +6290,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
@@ -5333,15 +6299,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");
}
@@ -5350,14 +6316,12 @@ catch_command_1 (arg, tempflag, from_tty)
/* Used by the gui, could be made a worker for other things. */
struct breakpoint *
-set_breakpoint_sal (sal)
- struct symtab_and_line sal;
+set_breakpoint_sal (struct symtab_and_line sal)
{
struct breakpoint *b;
- b = set_raw_breakpoint (sal);
+ b = set_raw_breakpoint (sal, bp_breakpoint);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->type = bp_breakpoint;
b->cond = 0;
b->thread = -1;
return b;
@@ -5367,51 +6331,42 @@ set_breakpoint_sal (sal)
/* These aren't used; I don't know what they were for. */
/* Disable breakpoints on all catch clauses described in ARGS. */
static void
-disable_catch (args)
- char *args;
+disable_catch (char *args)
{
/* Map the disable command to catch clauses described in ARGS. */
}
/* Enable breakpoints on all catch clauses described in ARGS. */
static void
-enable_catch (args)
- char *args;
+enable_catch (char *args)
{
/* Map the disable command to catch clauses described in ARGS. */
}
/* Delete breakpoints on all catch clauses in the active scope. */
static void
-delete_catch (args)
- char *args;
+delete_catch (char *args)
{
/* Map the delete command to catch clauses described in ARGS. */
}
#endif /* 0 */
static void
-catch_command (arg, from_tty)
- char *arg;
- int from_tty;
+catch_command (char *arg, int from_tty)
{
catch_command_1 (arg, 0, from_tty);
}
static void
-tcatch_command (arg, from_tty)
- char *arg;
- int from_tty;
+tcatch_command (char *arg, int from_tty)
{
catch_command_1 (arg, 1, from_tty);
}
static void
-clear_command (arg, from_tty)
- char *arg;
- int from_tty;
+clear_command (char *arg, int from_tty)
{
register struct breakpoint *b, *b1;
int default_match;
@@ -5427,9 +6382,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;
@@ -5453,37 +6408,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
+ || 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;
@@ -5493,29 +6448,27 @@ 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 || 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)
{
@@ -5525,19 +6478,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);
+ xfree (sals.sals);
}
/* Delete breakpoint in BS if they are `delete' breakpoints and
@@ -5545,28 +6502,27 @@ clear_command (arg, from_tty)
This is called after any breakpoint is hit, or after errors. */
void
-breakpoint_auto_delete (bs)
- bpstat bs;
+breakpoint_auto_delete (bpstat 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 == disp_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 == disp_del_at_next_stop)
+ delete_breakpoint (b);
+ }
}
-/* Delete a breakpoint and clean up all traces of it in the data structures. */
+/* Delete a breakpoint and clean up all traces of it in the data
+ structures. */
void
-delete_breakpoint (bpt)
- struct breakpoint *bpt;
+delete_breakpoint (struct breakpoint *bpt)
{
register struct breakpoint *b;
register bpstat bs;
@@ -5593,10 +6549,11 @@ delete_breakpoint (bpt)
if (delete_breakpoint_hook)
delete_breakpoint_hook (bpt);
+ breakpoint_delete_event (bpt->number);
if (bpt->inserted)
- remove_breakpoint (bpt, mark_uninserted);
-
+ remove_breakpoint (bpt, mark_inserted);
+
if (breakpoint_chain == bpt)
breakpoint_chain = bpt->next;
@@ -5605,16 +6562,18 @@ 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 */
- args.kind = bpt->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW;
- args.enable = 0;
+ /* Format possible error msg */
+ sprintf (message, message1, bpt->number);
+ args.kind = bpt->type == bp_catch_catch ?
+ EX_EVENT_CATCH : EX_EVENT_THROW;
+ args.enable_p = 0;
catch_errors (cover_target_enable_exception_callback, &args,
message, RETURN_MASK_ALL);
}
@@ -5622,32 +6581,12 @@ delete_breakpoint (bpt)
ALL_BREAKPOINTS (b)
if (b->next == bpt)
- {
- 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. */
- if (tui_version)
{
- int clearIt;
-
- ALL_BREAKPOINTS (b)
- {
- clearIt = (b->address != bpt->address);
- if (!clearIt)
- break;
- }
-
- if (clearIt)
- {
- TUIDO(((TuiOpaqueFuncPtr)tui_vAllSetHasBreakAt, bpt, 0));
- TUIDO(((TuiOpaqueFuncPtr)tuiUpdateAllExecInfos));
- }
+ b->next = bpt->next;
+ break;
}
- check_duplicates (bpt->address, bpt->section);
+ check_duplicates (bpt);
/* If this breakpoint was inserted, and there is another breakpoint
at the same address, we need to insert the other breakpoint. */
if (bpt->inserted
@@ -5662,44 +6601,58 @@ delete_breakpoint (bpt)
if (b->address == bpt->address
&& b->section == bpt->section
&& !b->duplicate
- && b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled)
- {
- int val;
+ && b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled)
+ {
+ int val;
+
+ /* We should never reach this point if there is a permanent
+ breakpoint at the same address as the one being deleted.
+ If there is a permanent breakpoint somewhere, it should
+ always be the only one inserted. */
+ if (b->enable_state == bp_permanent)
+ internal_error (__FILE__, __LINE__,
+ "another breakpoint was inserted on top of "
+ "a permanent breakpoint");
+
+ 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)
- {
- 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;
- }
+
+ if (val != 0)
+ {
+ target_terminal_ours_for_output ();
+ warning ("Cannot insert breakpoint %d:", b->number);
+ memory_error (val, b->address); /* which bombs us out */
+ }
+ else
+ b->inserted = 1;
+ }
}
free_command_lines (&bpt->commands);
if (bpt->cond)
- free (bpt->cond);
+ xfree (bpt->cond);
if (bpt->cond_string != NULL)
- free (bpt->cond_string);
+ xfree (bpt->cond_string);
if (bpt->addr_string != NULL)
- free (bpt->addr_string);
+ xfree (bpt->addr_string);
if (bpt->exp != NULL)
- free (bpt->exp);
+ xfree (bpt->exp);
if (bpt->exp_string != NULL)
- free (bpt->exp_string);
+ xfree (bpt->exp_string);
if (bpt->val != NULL)
value_free (bpt->val);
if (bpt->source_file != NULL)
- free (bpt->source_file);
+ xfree (bpt->source_file);
if (bpt->dll_pathname != NULL)
- free (bpt->dll_pathname);
+ xfree (bpt->dll_pathname);
if (bpt->triggered_dll_pathname != NULL)
- free (bpt->triggered_dll_pathname);
+ xfree (bpt->triggered_dll_pathname);
if (bpt->exec_pathname != NULL)
- free (bpt->exec_pathname);
+ xfree (bpt->exec_pathname);
/* Be sure no bpstat's are pointing at it after it's been freed. */
/* FIXME, how can we find all bpstat's?
@@ -5721,13 +6674,29 @@ delete_breakpoint (bpt)
bp, we mark it as deleted before freeing its storage. */
bpt->type = bp_none;
- free ((PTR)bpt);
+ xfree (bpt);
+}
+
+static void
+do_delete_breakpoint_cleanup (void *b)
+{
+ delete_breakpoint (b);
+}
+
+struct cleanup *
+make_cleanup_delete_breakpoint (struct breakpoint *b)
+{
+ return make_cleanup (do_delete_breakpoint_cleanup, b);
+}
+
+struct cleanup *
+make_exec_cleanup_delete_breakpoint (struct breakpoint *b)
+{
+ return make_exec_cleanup (do_delete_breakpoint_cleanup, b);
}
void
-delete_command (arg, from_tty)
- char *arg;
- int from_tty;
+delete_command (char *arg, int from_tty)
{
struct breakpoint *b, *temp;
@@ -5736,27 +6705,31 @@ 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->type != bp_thread_event &&
+ b->type != bp_overlay_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->type != bp_thread_event &&
+ b->type != bp_overlay_event &&
+ b->number >= 0)
+ delete_breakpoint (b);
+ }
}
}
else
@@ -5768,20 +6741,21 @@ delete_command (arg, from_tty)
Unused in this case. */
static int
-breakpoint_re_set_one (bint)
- PTR bint;
+breakpoint_re_set_one (PTR bint)
{
- struct breakpoint *b = (struct breakpoint *)bint; /* get past catch_errs */
+ /* get past catch_errs */
+ struct breakpoint *b = (struct breakpoint *) bint;
struct value *mark;
int i;
struct symtabs_and_lines sals;
char *s;
- enum enable save_enable;
+ enum enable_state save_enable;
switch (b->type)
{
case bp_none:
- warning ("attempted to reset apparently deleted breakpoint #%d?\n", b->number);
+ warning ("attempted to reset apparently deleted breakpoint #%d?",
+ b->number);
return 0;
case bp_breakpoint:
case bp_hardware_breakpoint:
@@ -5793,15 +6767,37 @@ breakpoint_re_set_one (bint)
delete_breakpoint (b);
return 0;
}
- /* In case we have a problem, disable this breakpoint. We'll restore
- its status if we succeed. */
- save_enable = b->enable;
- b->enable = disabled;
+ /* HACK: cagney/2001-11-11: kettenis/2001-11-11: MarkK wrote:
+
+ ``And a hack it is, although Apple's Darwin version of GDB
+ contains an almost identical hack to implement a "future
+ break" command. It seems to work in many real world cases,
+ but it is easy to come up with a test case where the patch
+ doesn't help at all.''
+
+ ``It seems that the way GDB implements breakpoints - in -
+ shared - libraries was designed for a.out shared library
+ systems (SunOS 4) where shared libraries were loaded at a
+ fixed address in memory. Since ELF shared libraries can (and
+ will) be loaded at any address in memory, things break.
+ Fixing this is not trivial. Therefore, I'm not sure whether
+ we should add this hack to the branch only. I cannot
+ guarantee that things will be fixed on the trunk in the near
+ future.''
+
+ In case we have a problem, disable this breakpoint. We'll
+ restore its status if we succeed. Don't disable a
+ shlib_disabled breakpoint though. There's a fair chance we
+ can't re-set it if the shared library it's in hasn't been
+ loaded yet. */
+ save_enable = b->enable_state;
+ if (b->enable_state != bp_shlib_disabled)
+ b->enable_state = bp_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]);
@@ -5812,26 +6808,26 @@ breakpoint_re_set_one (bint)
{
s = b->cond_string;
if (b->cond)
- free ((PTR)b->cond);
+ xfree (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);
+ xfree (b->source_file);
if (sals.sals[i].symtab == NULL)
b->source_file = NULL;
else
@@ -5841,26 +6837,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 disabled
+ 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. */
+ b->enable_state = 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);
}
- free ((PTR)sals.sals);
+ xfree (sals.sals);
break;
case bp_watchpoint:
@@ -5868,16 +6864,17 @@ breakpoint_re_set_one (bint)
case bp_read_watchpoint:
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. */
+ /* 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 function names. */
+
/* So for now, just use a global context. */
if (b->exp)
- free ((PTR)b->exp);
+ xfree (b->exp);
b->exp = parse_expression (b->exp_string);
b->exp_valid_block = innermost_block;
mark = value_mark ();
@@ -5892,42 +6889,47 @@ 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);
+ xfree (b->cond);
+ b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
- if (b->enable == enabled)
+ if (b->enable_state == bp_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 and overlay event breakpoints; they will be
+ reset later by breakpoint_re_set. */
case bp_longjmp:
case bp_longjmp_resume:
+ case bp_overlay_event:
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. */
+ /* Like bp_shlib_event, this breakpoint type is special.
+ Once it is set up, we do not want to touch it. */
+ case bp_thread_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. */
case bp_until:
case bp_finish:
case bp_watchpoint_scope:
@@ -5941,62 +6943,57 @@ breakpoint_re_set_one (bint)
/* Re-set all breakpoints after symbols have been re-loaded. */
void
-breakpoint_re_set ()
+breakpoint_re_set (void)
{
struct breakpoint *b, *temp;
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);
- }
+ {
+ /* Format possible error msg */
+ sprintf (message, message1, b->number);
+ catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL);
+ }
set_language (save_language);
input_radix = save_input_radix;
-#ifdef GET_LONGJMP_TARGET
- create_longjmp_breakpoint ("longjmp");
- create_longjmp_breakpoint ("_longjmp");
- create_longjmp_breakpoint ("siglongjmp");
- create_longjmp_breakpoint ("_siglongjmp");
- create_longjmp_breakpoint (NULL);
-#endif
-
-#if 0
- /* Took this out (temporarily at least), since it produces an extra
- blank line at startup. This messes up the gdbtests. -PB */
- /* Blank line to finish off all those mention() messages we just printed. */
- printf_filtered ("\n");
-#endif
+ if (GET_LONGJMP_TARGET_P ())
+ {
+ create_longjmp_breakpoint ("longjmp");
+ create_longjmp_breakpoint ("_longjmp");
+ create_longjmp_breakpoint ("siglongjmp");
+ create_longjmp_breakpoint ("_siglongjmp");
+ create_longjmp_breakpoint (NULL);
+ }
+
+ create_overlay_event_breakpoint ("_ovly_debug_event");
}
-/* Set ignore-count of breakpoint number BPTNUM to COUNT.
- If from_tty is nonzero, it prints a message to that effect,
- which ends with a period (no newline). */
-
/* Reset the thread number of this breakpoint:
- If the breakpoint is for all threads, leave it as-is.
- - Else, reset it to the current thread for inferior_pid. */
+ - Else, reset it to the current thread for inferior_ptid. */
void
-breakpoint_re_set_thread (b)
- struct breakpoint * b;
+breakpoint_re_set_thread (struct breakpoint *b)
{
if (b->thread != -1)
{
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
}
}
+/* Set ignore-count of breakpoint number BPTNUM to COUNT.
+ If from_tty is nonzero, it prints a message to that effect,
+ which ends with a period (no newline). */
+
void
-set_ignore_count (bptnum, count, from_tty)
- int bptnum, count, from_tty;
+set_ignore_count (int bptnum, int count, int from_tty)
{
register struct breakpoint *b;
@@ -6005,29 +7002,29 @@ 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);
}
/* Clear the ignore counts of all breakpoints. */
void
-breakpoint_clear_ignore_counts ()
+breakpoint_clear_ignore_counts (void)
{
struct breakpoint *b;
@@ -6038,18 +7035,17 @@ breakpoint_clear_ignore_counts ()
/* Command to set ignore-count of breakpoint N to COUNT. */
static void
-ignore_command (args, from_tty)
- char *args;
- int from_tty;
+ignore_command (char *args, int from_tty)
{
char *p = args;
register int num;
if (p == 0)
error_no_arg ("a breakpoint number");
-
- num = get_number (&p);
+ num = get_number (&p);
+ if (num == 0)
+ error ("bad breakpoint number: '%s'", args);
if (*p == 0)
error ("Second argument (specified ignore-count) is missing.");
@@ -6064,42 +7060,52 @@ ignore_command (args, from_tty)
whose numbers are given in ARGS. */
static void
-map_breakpoint_numbers (args, function)
- char *args;
- void (*function) PARAMS ((struct breakpoint *));
+map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *))
{
register char *p = args;
char *p1;
register int num;
- register struct breakpoint *b;
+ register struct breakpoint *b, *tmp;
+ int match;
if (p == 0)
error_no_arg ("one or more breakpoint numbers");
while (*p)
{
+ match = 0;
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;
- }
- printf_unfiltered ("No breakpoint number %d.\n", num);
- win:
+ num = get_number_or_range (&p1);
+ if (num == 0)
+ {
+ warning ("bad breakpoint number at or near '%s'", p);
+ }
+ else
+ {
+ ALL_BREAKPOINTS_SAFE (b, tmp)
+ if (b->number == num)
+ {
+ struct breakpoint *related_breakpoint = b->related_breakpoint;
+ match = 1;
+ function (b);
+ if (related_breakpoint)
+ function (related_breakpoint);
+ break;
+ }
+ if (match == 0)
+ printf_unfiltered ("No breakpoint number %d.\n", num);
+ }
p = p1;
}
}
+/* Set ignore-count of breakpoint number BPTNUM to COUNT.
+ If from_tty is nonzero, it prints a message to that effect,
+ which ends with a period (no newline). */
+
void
-disable_breakpoint (bpt)
- struct breakpoint *bpt;
+disable_breakpoint (struct breakpoint *bpt)
{
/* Never disable a watchpoint scope breakpoint; we want to
hit them when we leave scope so we can delete both the
@@ -6107,53 +7113,55 @@ disable_breakpoint (bpt)
if (bpt->type == bp_watchpoint_scope)
return;
- bpt->enable = disabled;
+ /* You can't disable permanent breakpoints. */
+ if (bpt->enable_state == bp_permanent)
+ return;
+
+ bpt->enable_state = bp_disabled;
- check_duplicates (bpt->address, bpt->section);
+ check_duplicates (bpt);
if (modify_breakpoint_hook)
modify_breakpoint_hook (bpt);
+ breakpoint_modify_event (bpt->number);
}
/* ARGSUSED */
static void
-disable_command (args, from_tty)
- char *args;
- int from_tty;
+disable_command (char *args, int from_tty)
{
register struct breakpoint *bpt;
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?",
+ 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);
}
static void
-do_enable_breakpoint (bpt, disposition)
- struct breakpoint *bpt;
- enum bpdisp disposition;
+do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
{
struct frame_info *save_selected_frame = NULL;
int save_selected_frame_level = -1;
@@ -6163,38 +7171,42 @@ 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;
+ if (bpt->enable_state != bp_permanent)
+ bpt->enable_state = bp_enabled;
bpt->disposition = disposition;
- check_duplicates (bpt->address, bpt->section);
+ check_duplicates (bpt);
breakpoints_changed ();
- if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint ||
- bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint)
+ if (bpt->type == bp_watchpoint ||
+ bpt->type == bp_hardware_watchpoint ||
+ bpt->type == bp_read_watchpoint ||
+ bpt->type == bp_access_watchpoint)
{
if (bpt->exp_valid_block != NULL)
{
struct frame_info *fr =
- /* 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 ("\
Cannot enable watchpoint %d because the block in which its expression\n\
is valid is not currently in scope.\n", bpt->number);
- bpt->enable = disabled;
+ bpt->enable_state = bp_disabled;
return;
}
@@ -6211,40 +7223,40 @@ 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_state = bp_disabled;
+ value_free_to_mark (mark);
+ return;
+ }
+ }
if (save_selected_frame_level >= 0)
- select_and_print_frame (save_selected_frame, save_selected_frame_level);
+ select_frame (save_selected_frame, save_selected_frame_level);
value_free_to_mark (mark);
}
if (modify_breakpoint_hook)
modify_breakpoint_hook (bpt);
+ breakpoint_modify_event (bpt->number);
}
void
-enable_breakpoint (bpt)
- struct breakpoint *bpt;
+enable_breakpoint (struct breakpoint *bpt)
{
do_enable_breakpoint (bpt, bpt->disposition);
}
@@ -6255,67 +7267,60 @@ enable_breakpoint (bpt)
/* ARGSUSED */
static void
-enable_command (args, from_tty)
- char *args;
- int from_tty;
+enable_command (char *args, int from_tty)
{
register struct breakpoint *bpt;
if (args == 0)
ALL_BREAKPOINTS (bpt)
switch (bpt->type)
- {
- case bp_none:
- warning ("attempted to enable apparently deleted breakpoint #%d?\n", bpt->number);
- continue;
- case bp_breakpoint:
- case bp_catch_load:
- case bp_catch_unload:
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
- case bp_catch_catch:
- case bp_catch_throw:
- case bp_hardware_breakpoint:
- case bp_watchpoint:
- case bp_hardware_watchpoint:
- case bp_read_watchpoint:
- case bp_access_watchpoint:
- enable_breakpoint (bpt);
- default:
- continue;
- }
+ {
+ case bp_none:
+ warning ("attempted to enable apparently deleted breakpoint #%d?",
+ bpt->number);
+ continue;
+ case bp_breakpoint:
+ case bp_catch_load:
+ case bp_catch_unload:
+ case bp_catch_fork:
+ case bp_catch_vfork:
+ case bp_catch_exec:
+ case bp_catch_catch:
+ case bp_catch_throw:
+ case bp_hardware_breakpoint:
+ case bp_watchpoint:
+ case bp_hardware_watchpoint:
+ case bp_read_watchpoint:
+ case bp_access_watchpoint:
+ enable_breakpoint (bpt);
+ default:
+ continue;
+ }
else
map_breakpoint_numbers (args, enable_breakpoint);
}
static void
-enable_once_breakpoint (bpt)
- struct breakpoint *bpt;
+enable_once_breakpoint (struct breakpoint *bpt)
{
- do_enable_breakpoint (bpt, disable);
+ do_enable_breakpoint (bpt, disp_disable);
}
/* ARGSUSED */
static void
-enable_once_command (args, from_tty)
- char *args;
- int from_tty;
+enable_once_command (char *args, int from_tty)
{
map_breakpoint_numbers (args, enable_once_breakpoint);
}
static void
-enable_delete_breakpoint (bpt)
- struct breakpoint *bpt;
+enable_delete_breakpoint (struct breakpoint *bpt)
{
- do_enable_breakpoint (bpt, del);
+ do_enable_breakpoint (bpt, disp_del);
}
/* ARGSUSED */
static void
-enable_delete_command (args, from_tty)
- char *args;
- int from_tty;
+enable_delete_command (char *args, int from_tty)
{
map_breakpoint_numbers (args, enable_delete_breakpoint);
}
@@ -6323,27 +7328,26 @@ enable_delete_command (args, from_tty)
/* Use default_breakpoint_'s, or nothing if they aren't valid. */
struct symtabs_and_lines
-decode_line_spec_1 (string, funfirstline)
- char *string;
- int funfirstline;
+decode_line_spec_1 (char *string, int funfirstline)
{
struct symtabs_and_lines sals;
if (string == 0)
error ("Empty line specification.");
if (default_breakpoint_valid)
sals = decode_line_1 (&string, funfirstline,
- default_breakpoint_symtab, default_breakpoint_line,
- (char ***)NULL);
+ default_breakpoint_symtab,
+ default_breakpoint_line,
+ (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;
}
void
-_initialize_breakpoint ()
+_initialize_breakpoint (void)
{
struct cmd_list_element *c;
@@ -6356,7 +7360,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\
@@ -6372,24 +7376,24 @@ then no output is printed when it is hit, except what the commands print.");
Usage is `condition N COND', where N is an integer and COND is an\n\
expression to be evaluated whenever breakpoint N is reached. ");
- add_com ("tbreak", class_breakpoint, tbreak_command,
- "Set a temporary breakpoint. Args like \"break\" command.\n\
+ c = add_com ("tbreak", class_breakpoint, tbreak_command,
+ "Set a temporary breakpoint. Args like \"break\" command.\n\
Like \"break\" except the breakpoint is only temporary,\n\
so it will be deleted when hit. Equivalent to \"break\" followed\n\
by using \"enable delete\" on the breakpoint number.");
- add_com("txbreak", class_breakpoint, tbreak_at_finish_command,
- "Set temporary breakpoint at procedure exit. Either there should\n\
-be no argument or the argument must be a depth.\n");
+ c->completer = location_completer;
- add_com ("hbreak", class_breakpoint, hbreak_command,
- "Set a hardware assisted breakpoint. Args like \"break\" command.\n\
+ c = add_com ("hbreak", class_breakpoint, hbreak_command,
+ "Set a hardware assisted breakpoint. Args like \"break\" command.\n\
Like \"break\" except the breakpoint requires hardware support,\n\
some target hardware may not have this support.");
+ c->completer = location_completer;
- add_com ("thbreak", class_breakpoint, thbreak_command,
- "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\
+ c = add_com ("thbreak", class_breakpoint, thbreak_command,
+ "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\
Like \"hbreak\" except the breakpoint is only temporary,\n\
so it will be deleted when hit.");
+ c->completer = location_completer;
add_prefix_cmd ("enable", class_breakpoint, enable_command,
"Enable some breakpoints.\n\
@@ -6399,8 +7403,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\
@@ -6409,11 +7413,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\
@@ -6436,7 +7440,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.",
@@ -6444,8 +7448,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.");
@@ -6459,7 +7463,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\
@@ -6469,7 +7473,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");
@@ -6486,65 +7490,47 @@ 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));
- add_com ("break", class_breakpoint, break_command,
- concat ("Set breakpoint at specified line or function.\n\
+ c = add_com ("break", class_breakpoint, break_command,
+ concat ("Set breakpoint at specified line or function.\n\
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\
\n\
Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL));
+ c->completer = location_completer;
+
add_com_alias ("b", "break", class_run, 1);
add_com_alias ("br", "break", class_run, 1);
add_com_alias ("bre", "break", class_run, 1);
add_com_alias ("brea", "break", class_run, 1);
- add_com("xbreak", class_breakpoint, break_at_finish_command,
- concat("Set breakpoint at procedure exit. \n\
-Argument may be function name, or \"*\" and an address.\n\
-If function is specified, break at end of code for that function.\n\
-If an address is specified, break at the end of the function that contains \n\
-that exact address.\n",
-"With no arg, uses current execution address of selected stack frame.\n\
-This is useful for breaking on return to a stack frame.\n\
-\n\
-Multiple breakpoints at one place are permitted, and useful if conditional.\n\
-\n\
-Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL));
- add_com_alias ("xb", "xbreak", class_breakpoint, 1);
- add_com_alias ("xbr", "xbreak", class_breakpoint, 1);
- add_com_alias ("xbre", "xbreak", class_breakpoint, 1);
- add_com_alias ("xbrea", "xbreak", class_breakpoint, 1);
-
- if (xdb_commands)
+ if (xdb_commands)
{
add_com_alias ("ba", "break", class_breakpoint, 1);
add_com_alias ("bu", "ubreak", class_breakpoint, 1);
- add_com ("bx", class_breakpoint, break_at_finish_at_depth_command,
- "Set breakpoint at procedure exit. Either there should\n\
-be no argument or the argument must be a depth.\n");
}
if (dbx_commands)
{
- add_abbrev_prefix_cmd("stop", class_breakpoint, stop_command,
- "Break in function/address or break at a line in the current file.",
- &stoplist, "stop ", 1, &cmdlist);
- add_cmd("in", class_breakpoint, stopin_command,
- "Break in function or address.\n", &stoplist);
- add_cmd("at", class_breakpoint, stopat_command,
- "Break at a line in the current file.\n", &stoplist);
- add_com("status", class_info, breakpoints_info,
- concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\
+ 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\
@@ -6552,7 +7538,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));
@@ -6567,14 +7553,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\
@@ -6582,15 +7568,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));
-#if MAINTENANCE_CMDS
-
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\
@@ -6598,20 +7582,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);
-#endif /* MAINTENANCE_CMDS */
-
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\
@@ -6644,42 +7626,44 @@ 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,
- "Set a watchpoint for an expression.\n\
+ c = add_com ("watch", class_breakpoint, watch_command,
+ "Set a watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression changes.");
+ c->completer = location_completer;
- add_com ("rwatch", class_breakpoint, rwatch_command,
- "Set a read watchpoint for an expression.\n\
+ c = add_com ("rwatch", class_breakpoint, rwatch_command,
+ "Set a read watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression is read.");
+ c->completer = location_completer;
- add_com ("awatch", class_breakpoint, awatch_command,
- "Set a watchpoint for an expression.\n\
+ c = add_com ("awatch", class_breakpoint, awatch_command,
+ "Set a watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression is either read or written.");
+ c->completer = location_completer;
add_info ("watchpoints", breakpoints_info,
"Synonym for ``info breakpoints''.");
c = add_set_cmd ("can-use-hw-watchpoints", class_support, var_zinteger,
- (char *) &can_use_hw_watchpoints,
- "Set debugger's willingness to use watchpoint hardware.\n\
+ (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;
diff --git a/contrib/gdb/gdb/breakpoint.h b/contrib/gdb/gdb/breakpoint.h
index e2febac..3a58aad 100644
--- a/contrib/gdb/gdb/breakpoint.h
+++ b/contrib/gdb/gdb/breakpoint.h
@@ -1,21 +1,23 @@
/* Data structures associated with breakpoints in GDB.
- Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -23,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "frame.h"
#include "value.h"
+#include "gdb-events.h"
+
+struct value;
+
/* This is the maximum number of bytes a breakpoint instruction can take.
Feel free to increase it. It's just used in a few places to size
arrays that should be independent of the target architecture. */
@@ -34,33 +40,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,77 +76,112 @@ 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,
+
+ /* Some multi-threaded systems can arrange for a location in the
+ inferior to be executed when certain thread-related events occur
+ (such as thread creation or thread death).
+
+ By placing a breakpoint at one of these locations, GDB will get
+ control when these events occur. GDB can then update its thread
+ lists etc. */
+
+ bp_thread_event,
+
+ /* On the same principal, an overlay manager can arrange to call a
+ magic location in the inferior whenever there is an interesting
+ change in overlay status. GDB can update its overlay tables
+ and fiddle with breakpoints in overlays when this breakpoint
+ is hit. */
+
+ bp_overlay_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_state
+ {
+ bp_disabled, /* The eventpoint is inactive, and cannot trigger. */
+ bp_enabled, /* The eventpoint is active, and can trigger. */
+ bp_shlib_disabled, /* The eventpoint's address is in an unloaded solib.
+ The eventpoint will be automatically enabled
+ and reset when that solib is loaded. */
+ bp_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 and reset when the call
+ "lands" (either completes, or stops at another
+ eventpoint). */
+ bp_permanent /* There is a breakpoint instruction hard-wired into
+ the target's code. Don't try to write another
+ breakpoint instruction on top of it, or restore
+ its value. Step over it using the architecture's
+ SKIP_INSN macro. */
+ };
/* 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
+ {
+ disp_del, /* Delete it */
+ disp_del_at_next_stop, /* Delete at next stop, whether hit or not */
+ disp_disable, /* Disable it */
+ disp_donttouch /* Leave it alone */
+ };
+
+enum target_hw_bp_type
+ {
+ hw_write = 0, /* Common HW watchpoint */
+ hw_read = 1, /* Read HW watchpoint */
+ hw_access = 2, /* Access HW watchpoint */
+ hw_execute = 3 /* Execute HW breakpoint */
+ };
/* 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
@@ -150,210 +192,224 @@ 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_state enable_state;
+ /* What to do with this breakpoint after we hit it. */
+ enum bpdisp disposition;
+ /* Number assigned to distinguish breakpoints. */
+ int number;
+
+ /* Address to break at.
+ Note that zero is a perfectly valid code address on some
+ platforms (for example, the mn10200 and mn10300 simulators).
+ NULL is not a special value for this field. */
+ CORE_ADDR address;
+
+ /* Line number of this address. */
+
+ int line_number;
+
+ /* Source file name of this address. */
+
+ 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. */
+ char inserted;
+ /* Nonzero if this is not the first breakpoint in the list
+ for the given address. */
+ 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). */
+ 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. */
+ struct value *val;
+
+ /* Holds the value chain for a hardware watchpoint expression. */
+ struct value *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 valid 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 valid immediately after this
+ catchpoint has triggered. */
+ int forked_inferior_pid;
+
+ /* Filename of a program whose exec triggered this catchpoint.
+ This field is only valid immediately after this catchpoint has
+ triggered. */
+ char *exec_pathname;
+
+ asection *section;
+ };
-/* The following stuff is an abstract data type "bpstat" ("breakpoint status").
- This provides the ability to determine whether we have stopped at a
- breakpoint, and what we should do about it. */
+/* The following stuff is an abstract data type "bpstat" ("breakpoint
+ status"). This provides the ability to determine whether we have
+ stopped at a breakpoint, and what we should do about it. */
typedef struct bpstats *bpstat;
/* Interface: */
/* Clear a bpstat so that it says we are not at any breakpoint.
Also free any storage that is part of a bpstat. */
-extern void bpstat_clear PARAMS ((bpstat *));
+extern void bpstat_clear (bpstat *);
/* Return a copy of a bpstat. Like "bs1 = bs2" but all storage that
is part of the bpstat is copied as well. */
-extern bpstat bpstat_copy PARAMS ((bpstat));
+extern bpstat bpstat_copy (bpstat);
-extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, int));
+extern bpstat bpstat_stop_status (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;
+ };
+
+/* The possible return values for print_bpstat, print_it_normal,
+ print_it_done, print_it_noop. */
+enum print_stop_action
+ {
+ PRINT_UNKNOWN = -1,
+ PRINT_SRC_AND_LOC,
+ PRINT_SRC_ONLY,
+ PRINT_NOTHING
+ };
/* Tell what to do about this bpstat. */
-struct bpstat_what bpstat_what PARAMS ((bpstat));
+struct bpstat_what bpstat_what (bpstat);
/* Find the bpstat associated with a breakpoint. NULL otherwise. */
-bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *));
+bpstat bpstat_find_breakpoint (bpstat, struct breakpoint *);
/* Find a step_resume breakpoint associated with this bpstat.
(If there are multiple step_resume bp's on the list, this function
@@ -363,9 +419,8 @@ 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));
+ */
+extern struct breakpoint *bpstat_find_step_resume_breakpoint (bpstat);
/* Nonzero if a signal that we got in wait() was due to circumstances
explained by the BS. */
@@ -376,140 +431,173 @@ bpstat_find_step_resume_breakpoint PARAMS ((bpstat));
/* Nonzero if we should step constantly (e.g. watchpoints on machines
without hardware support). This isn't related to a specific bpstat,
just to things like whether watchpoints are set. */
-extern int bpstat_should_step PARAMS ((void));
+extern int bpstat_should_step (void);
/* Nonzero if there are enabled hardware watchpoints. */
-extern int bpstat_have_active_hw_watchpoints PARAMS ((void));
+extern int bpstat_have_active_hw_watchpoints (void);
/* Print a message indicating what happened. Returns nonzero to
say that only the source line should be printed after this (zero
return means print the frame as well as the source line). */
-extern int bpstat_print PARAMS ((bpstat));
+extern enum print_stop_action bpstat_print (bpstat);
/* Return the breakpoint number of the first breakpoint we are stopped
at. *BSP upon return is a bpstat which points to the remaining
breakpoints stopped at (but which is not guaranteed to be good for
anything but further calls to bpstat_num).
Return 0 if passed a bpstat which does not indicate any breakpoints. */
-extern int bpstat_num PARAMS ((bpstat *));
+extern int bpstat_num (bpstat *);
/* Perform actions associated with having stopped at *BSP. Actually, we just
use this for breakpoint commands. Perhaps other actions will go here
later, but this is executed at a late time (from the command loop). */
-extern void bpstat_do_actions PARAMS ((bpstat *));
+extern void bpstat_do_actions (bpstat *);
/* Modify BS so that the actions will not be performed. */
-extern void bpstat_clear_actions PARAMS ((bpstat));
+extern void bpstat_clear_actions (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 *));
-
+ */
+extern void bpstat_get_triggered_catchpoints (bpstat, bpstat *);
+
/* Implementation: */
+
+/* Values used to tell the printing routine how to behave for this bpstat. */
+enum bp_print_how
+ {
+ /* This is used when we want to do a normal printing of the reason
+ for stopping. The output will depend on the type of eventpoint
+ we are dealing with. This is the default value, most commonly
+ used. */
+ print_it_normal,
+ /* This is used when nothing should be printed for this bpstat entry. */
+ print_it_noop,
+ /* This is used when everything which needs to be printed has
+ already been printed. But we still want to print the frame. */
+ print_it_done
+ };
+
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. */
+ struct value *old_val;
+
+ /* Nonzero if this breakpoint tells us to print the frame. */
+ char print;
+
+ /* Nonzero if this breakpoint tells us to stop. */
+ char stop;
+
+ /* Tell bpstat_print and print_bp_stop_message how to print stuff
+ associated with this element of the bpstat chain. */
+ enum bp_print_how print_it;
+ };
enum inf_context
-{
- inf_starting,
- inf_running,
- inf_exited
-};
-
+ {
+ inf_starting,
+ inf_running,
+ inf_exited
+ };
+
+/* The possible return values for breakpoint_here_p.
+ We guarantee that zero always means "no breakpoint here". */
+enum breakpoint_here
+ {
+ no_breakpoint_here = 0,
+ ordinary_breakpoint_here,
+ permanent_breakpoint_here
+ };
+
/* Prototypes for breakpoint-related functions. */
-#ifdef __STDC__ /* Forward declarations for prototypes */
+/* Forward declarations for prototypes */
struct frame_info;
-#endif
-extern int breakpoint_here_p PARAMS ((CORE_ADDR));
+extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
-extern int breakpoint_inserted_here_p PARAMS ((CORE_ADDR));
+extern int breakpoint_inserted_here_p (CORE_ADDR);
-extern int frame_in_dummy PARAMS ((struct frame_info *));
+extern int frame_in_dummy (struct frame_info *);
-extern int breakpoint_thread_match PARAMS ((CORE_ADDR, int));
+extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
-extern void until_break_command PARAMS ((char *, int));
+extern void until_break_command (char *, int);
-extern void breakpoint_re_set PARAMS ((void));
+extern void breakpoint_re_set (void);
-extern void breakpoint_re_set_thread PARAMS ((struct breakpoint *));
+extern void breakpoint_re_set_thread (struct breakpoint *);
-extern int ep_is_exception_catchpoint PARAMS ((struct breakpoint *));
+extern int ep_is_exception_catchpoint (struct breakpoint *);
extern struct breakpoint *set_momentary_breakpoint
- PARAMS ((struct symtab_and_line, struct frame_info *, enum bptype));
+ (struct symtab_and_line, struct frame_info *, enum bptype);
+
+extern void set_ignore_count (int, int, int);
+
+extern void set_default_breakpoint (int, CORE_ADDR, struct symtab *, int);
-extern void set_ignore_count PARAMS ((int, int, int));
+extern void mark_breakpoints_out (void);
-extern void set_default_breakpoint PARAMS ((int, CORE_ADDR, struct symtab *, int));
+extern void breakpoint_init_inferior (enum inf_context);
-extern void mark_breakpoints_out PARAMS ((void));
+extern struct cleanup *make_cleanup_delete_breakpoint (struct breakpoint *);
-extern void breakpoint_init_inferior PARAMS ((enum inf_context));
+extern struct cleanup *make_exec_cleanup_delete_breakpoint (struct breakpoint *);
-extern void delete_breakpoint PARAMS ((struct breakpoint *));
+extern void delete_breakpoint (struct breakpoint *);
-extern void breakpoint_auto_delete PARAMS ((bpstat));
+extern void breakpoint_auto_delete (bpstat);
-extern void breakpoint_clear_ignore_counts PARAMS ((void));
+extern void breakpoint_clear_ignore_counts (void);
-extern void break_command PARAMS ((char *, int));
+extern void break_command (char *, int);
-extern void tbreak_command PARAMS ((char *, int));
+extern void hbreak_command_wrapper (char *, int);
+extern void thbreak_command_wrapper (char *, int);
+extern void rbreak_command_wrapper (char *, int);
+extern void watch_command_wrapper (char *, int);
+extern void awatch_command_wrapper (char *, int);
+extern void rwatch_command_wrapper (char *, int);
+extern void tbreak_command (char *, int);
-extern int insert_breakpoints PARAMS ((void));
+extern int insert_breakpoints (void);
-extern int remove_breakpoints PARAMS ((void));
+extern int remove_breakpoints (void);
/* This function can be used to physically insert eventpoints from the
specified traced inferior process, without modifying the breakpoint
package's state. This can be useful for those targets which support
following the processes of a fork() or vfork() system call, when both
of the resulting two processes are to be followed. */
-extern int reattach_breakpoints PARAMS ((int));
+extern int reattach_breakpoints (int);
/* This function can be used to update the breakpoint package's state
after an exec() system call has been executed.
This function causes the following:
- - All eventpoints are marked "not inserted".
- - All eventpoints with a symbolic address are reset such that
- the symbolic address must be reevaluated before the eventpoints
- can be reinserted.
- - The solib breakpoints are explicitly removed from the breakpoint
- list.
- - A step-resume breakpoint, if any, is explicitly removed from the
- breakpoint list.
- - All eventpoints without a symbolic address are removed from the
- breakpoint list. */
-extern void update_breakpoints_after_exec PARAMS ((void));
+ - 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 (void);
/* This function can be used to physically remove hardware breakpoints
and watchpoints from the specified traced inferior process, without
@@ -517,17 +605,17 @@ 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));
+ inferior_ptid. */
+extern int detach_breakpoints (int);
-extern void disable_longjmp_breakpoint PARAMS ((void));
+extern void enable_longjmp_breakpoint (void);
+extern void disable_longjmp_breakpoint (void);
+extern void enable_overlay_breakpoints (void);
+extern void disable_overlay_breakpoints (void);
-extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR,
- struct frame_info *));
+extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_info *);
/* These functions respectively disable or reenable all currently
enabled watchpoints. When disabled, the watchpoints are marked
call_disabled. When reenabled, they are marked enabled.
@@ -543,62 +631,79 @@ extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR,
cause the inferior to stop in places where this frame is visible,
and that can cause execution control to become very confused.
- Note that if a user sets breakpoints in an interactively call
+ Note that if a user sets breakpoints in an interactively called
function, the call_disabled watchpoints will have been reenabled
when the first such breakpoint is reached. However, on targets
that are unable to unwind through the call dummy frame, watches
of stack-based storage may then be deleted, because gdb will
believe that their watched storage is out of scope. (Sigh.) */
-extern void
-disable_watchpoints_before_interactive_call_start PARAMS ((void));
+extern void disable_watchpoints_before_interactive_call_start (void);
+
+extern void enable_watchpoints_after_interactive_call_stop (void);
+
-extern void
-enable_watchpoints_after_interactive_call_stop PARAMS ((void));
+extern void clear_breakpoint_hit_counts (void);
-
-extern void clear_breakpoint_hit_counts PARAMS ((void));
+extern int get_number (char **);
+
+extern int get_number_or_range (char **);
/* The following are for displays, which aren't really breakpoints, but
here is as good a place as any for them. */
-extern void disable_current_display PARAMS ((void));
+extern void disable_current_display (void);
+
+extern void do_displays (void);
+
+extern void disable_display (int);
+
+extern void clear_displays (void);
+
+extern void disable_breakpoint (struct breakpoint *);
+
+extern void enable_breakpoint (struct breakpoint *);
-extern void do_displays PARAMS ((void));
+extern void make_breakpoint_permanent (struct breakpoint *);
-extern void disable_display PARAMS ((int));
+extern struct breakpoint *create_solib_event_breakpoint (CORE_ADDR);
-extern void clear_displays PARAMS ((void));
+extern struct breakpoint *create_thread_event_breakpoint (CORE_ADDR);
-extern void disable_breakpoint PARAMS ((struct breakpoint *));
+extern void remove_solib_event_breakpoints (void);
-extern void enable_breakpoint PARAMS ((struct breakpoint *));
+extern void remove_thread_event_breakpoints (void);
-extern void create_solib_event_breakpoint PARAMS ((CORE_ADDR));
+extern void disable_breakpoints_in_shlibs (int silent);
-extern void remove_solib_event_breakpoints PARAMS ((void));
+extern void re_enable_breakpoints_in_shlibs (void);
-extern void disable_breakpoints_in_shlibs PARAMS ((int silent));
+extern void create_solib_load_event_breakpoint (char *, int, char *, char *);
-extern void re_enable_breakpoints_in_shlibs PARAMS ((void));
+extern void create_solib_unload_event_breakpoint (char *, int,
+ char *, char *);
-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_fork_event_catchpoint (int, char *);
+
+extern void create_vfork_event_catchpoint (int, char *);
+
+extern void create_exec_event_catchpoint (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 *));
-
+extern int ep_is_catchpoint (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));
+extern int ep_is_shlib_catchpoint (struct breakpoint *);
+
+extern struct breakpoint *set_breakpoint_sal (struct symtab_and_line);
+
+/* Enable breakpoints and delete when hit. Called with ARG == NULL
+ deletes all breakpoints. */
+extern void delete_command (char *arg, int from_tty);
+
+/* Pull all H/W watchpoints from the target. Return non-zero if the
+ remove fails. */
+extern int remove_hw_watchpoints (void);
#endif /* !defined (BREAKPOINT_H) */
diff --git a/contrib/gdb/gdb/buildsym.c b/contrib/gdb/gdb/buildsym.c
index 24b64be..0e4f9b8 100644
--- a/contrib/gdb/gdb/buildsym.c
+++ b/contrib/gdb/gdb/buildsym.c
@@ -1,21 +1,23 @@
/* Support routines for building symbol tables in GDB's internal format.
- Copyright 1986-1999 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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-
@@ -33,9 +35,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbtypes.h"
#include "complaints.h"
#include "gdb_string.h"
-
+#include "expression.h" /* For "enum exp_opcode" used by... */
+#include "language.h" /* For "longest_local_hex_string_custom" */
+#include "bcache.h"
+#include "filenames.h" /* For DOSish file names */
/* Ask buildsym.h to define the vars it normally declares `extern'. */
-#define EXTERN /**/
+#define EXTERN
+/**/
#include "buildsym.h" /* Our own declarations */
#undef EXTERN
@@ -79,10 +85,24 @@ struct complaint innerblock_anon_complaint =
{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0};
struct complaint blockvector_complaint =
-{"block at 0x%lx out of order", 0, 0};
+{"block at %s out of order", 0, 0};
/* maintain the lists of symbols and blocks */
+/* Add a pending list to free_pendings. */
+void
+add_free_pendings (struct pending *list)
+{
+ register struct pending *link = list;
+
+ if (list)
+ {
+ while (link->next) link = link->next;
+ link->next = free_pendings;
+ free_pendings = list;
+ }
+}
+
/* Add a symbol to one of the lists of symbols. */
void
@@ -146,14 +166,14 @@ find_symbol_in_list (struct pending *list, char *name, int length)
/* ARGSUSED */
void
-really_free_pendings (int foo)
+really_free_pendings (PTR dummy)
{
struct pending *next, *next1;
for (next = free_pendings; next; next = next1)
{
next1 = next->next;
- free ((void *) next);
+ xfree ((void *) next);
}
free_pendings = NULL;
@@ -162,14 +182,14 @@ really_free_pendings (int foo)
for (next = file_symbols; next != NULL; next = next1)
{
next1 = next->next;
- free ((void *) next);
+ xfree ((void *) next);
}
file_symbols = NULL;
for (next = global_symbols; next != NULL; next = next1)
{
next1 = next->next;
- free ((void *) next);
+ xfree ((void *) next);
}
global_symbols = NULL;
}
@@ -187,7 +207,7 @@ free_pending_blocks (void)
for (bnext = pending_blocks; bnext; bnext = bnext1)
{
bnext1 = bnext->next;
- free ((void *) bnext);
+ xfree ((void *) bnext);
}
#endif
pending_blocks = NULL;
@@ -220,7 +240,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. */
@@ -255,9 +275,8 @@ finish_block (struct symbol *symbol, struct pending **listhead,
parameter symbols. */
int nparams = 0, iparams;
struct symbol *sym;
- for (i = 0; i < BLOCK_NSYMS (block); i++)
+ ALL_BLOCK_SYMBOLS (block, i, sym)
{
- sym = BLOCK_SYM (block, i);
switch (SYMBOL_CLASS (sym))
{
case LOC_ARG:
@@ -303,6 +322,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
case LOC_BASEREG_ARG:
case LOC_LOCAL_ARG:
TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym);
+ TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
iparams++;
break;
case LOC_UNDEF:
@@ -382,7 +402,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))
@@ -468,7 +488,7 @@ make_blockvector (struct objfile *objfile)
for (next = pending_blocks; next; next = next1)
{
next1 = next->next;
- free (next);
+ xfree (next);
}
#endif
pending_blocks = NULL;
@@ -485,17 +505,11 @@ make_blockvector (struct objfile *objfile)
if (BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i - 1))
> BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)))
{
-
- /* FIXME-32x64: loses if CORE_ADDR doesn't fit in a
- long. Possible solutions include a version of
- complain which takes a callback, a
- sprintf_address_numeric to match
- print_address_numeric, or a way to set up a GDB_FILE
- which causes sprintf rather than fprintf to be
- called. */
+ CORE_ADDR start
+ = BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i));
complain (&blockvector_complaint,
- (unsigned long) BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)));
+ longest_local_hex_string ((LONGEST) start));
}
}
}
@@ -519,7 +533,7 @@ start_subfile (char *name, char *dirname)
for (subfile = subfiles; subfile; subfile = subfile->next)
{
- if (STREQ (subfile->name, name))
+ if (FILENAME_CMP (subfile->name, name) == 0)
{
current_subfile = subfile;
return;
@@ -531,6 +545,7 @@ start_subfile (char *name, char *dirname)
source file. */
subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
+ memset ((char *) subfile, 0, sizeof (struct subfile));
subfile->next = subfiles;
subfiles = subfile;
current_subfile = subfile;
@@ -569,7 +584,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
@@ -654,7 +669,7 @@ push_subfile (void)
subfile_stack = tem;
if (current_subfile == NULL || current_subfile->name == NULL)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
tem->name = current_subfile->name;
}
@@ -667,11 +682,11 @@ pop_subfile (void)
if (link == NULL)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
name = link->name;
subfile_stack = link->next;
- free ((void *) link);
+ xfree ((void *) link);
return (name);
}
@@ -695,7 +710,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;
}
@@ -712,7 +727,7 @@ record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
- e->pc = pc;
+ e->pc = ADDR_BITS_REMOVE(pc);
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
@@ -855,7 +870,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 +936,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 +983,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
@@ -980,23 +995,23 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
}
if (subfile->name != NULL)
{
- free ((void *) subfile->name);
+ xfree ((void *) subfile->name);
}
if (subfile->dirname != NULL)
{
- free ((void *) subfile->dirname);
+ xfree ((void *) subfile->dirname);
}
if (subfile->line_vector != NULL)
{
- free ((void *) subfile->line_vector);
+ xfree ((void *) subfile->line_vector);
}
if (subfile->debugformat != NULL)
{
- free ((void *) subfile->debugformat);
+ xfree ((void *) subfile->debugformat);
}
nextsub = subfile->next;
- free ((void *) subfile);
+ xfree ((void *) subfile);
}
/* Set this for the main source file. */
@@ -1025,7 +1040,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++];
@@ -1042,33 +1057,13 @@ push_context (int desc, CORE_ADDR valu)
return new;
}
+
/* Compute a small integer hash code for the given name. */
int
hashname (char *name)
{
- register char *p = name;
- register int total = p[0];
- register int c;
-
- c = p[1];
- total += c << 2;
- if (c)
- {
- c = p[2];
- total += c << 4;
- if (c)
- {
- total += p[3] << 6;
- }
- }
-
- /* Ensure result is positive. */
- if (total < 0)
- {
- total += (1000 << 6);
- }
- return (total % HASHSIZE);
+ return (hash(name,strlen(name)) % HASHSIZE);
}
@@ -1111,7 +1106,7 @@ merge_symbol_lists (struct pending **srclist, struct pending **targetlist)
corresponding to a psymtab. */
void
-buildsym_init ()
+buildsym_init (void)
{
free_pendings = NULL;
file_symbols = NULL;
@@ -1124,7 +1119,7 @@ buildsym_init ()
file, e.g. a shared library). */
void
-buildsym_new_init ()
+buildsym_new_init (void)
{
buildsym_init ();
}
diff --git a/contrib/gdb/gdb/buildsym.h b/contrib/gdb/gdb/buildsym.h
index e3a34c9..40a339d 100644
--- a/contrib/gdb/gdb/buildsym.h
+++ b/contrib/gdb/gdb/buildsym.h
@@ -1,21 +1,23 @@
/* Build symbol tables in GDB's internal format.
- Copyright 1986-1993, 1996-1999 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1996,
+ 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -230,6 +232,8 @@ EXTERN int type_vector_length;
#define INITIAL_TYPE_VECTOR_LENGTH 160
+extern void add_free_pendings (struct pending *list);
+
extern void add_symbol_to_list (struct symbol *symbol,
struct pending **listhead);
@@ -242,7 +246,7 @@ extern void finish_block (struct symbol *symbol,
CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile);
-extern void really_free_pendings (int foo);
+extern void really_free_pendings (PTR dummy);
extern void start_subfile (char *name, char *dirname);
diff --git a/contrib/gdb/gdb/c-exp.y b/contrib/gdb/gdb/c-exp.y
index 377f92a..3d2d1aa 100644
--- a/contrib/gdb/gdb/c-exp.y
+++ b/contrib/gdb/gdb/c-exp.y
@@ -1,5 +1,6 @@
/* YACC parser for C expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1996, 1997
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GDB.
@@ -102,14 +103,11 @@ extern int hp_som_som_object_present;
#define YYDEBUG 0 /* Default to no yydebug support */
#endif
-int
-yyparse PARAMS ((void));
+int yyparse (void);
-static int
-yylex PARAMS ((void));
+static int yylex (void);
-void
-yyerror PARAMS ((char *));
+void yyerror (char *);
%}
@@ -144,8 +142,7 @@ yyerror PARAMS ((char *));
%{
/* YYSTYPE gets defined by %union */
-static int
-parse_number PARAMS ((char *, int, int, YYSTYPE *));
+static int parse_number (char *, int, int, YYSTYPE *);
%}
%type <voidval> exp exp1 type_exp start variable qualified_name lcurly
@@ -721,21 +718,26 @@ variable: name_not_typename
}
;
+space_identifier : '@' NAME
+ { push_type_address_space (copy_name ($2.stoken));
+ push_type (tp_space_identifier);
+ }
+ ;
-ptype : typebase
- /* "const" and "volatile" are curently ignored. A type qualifier
- before the type is currently handled in the typebase rule.
- The reason for recognizing these here (shift/reduce conflicts)
- might be obsolete now that some pointer to member rules have
- been deleted. */
- | typebase CONST_KEYWORD
- | typebase VOLATILE_KEYWORD
- | typebase abs_decl
- { $$ = follow_types ($1); }
- | typebase CONST_KEYWORD abs_decl
- { $$ = follow_types ($1); }
- | typebase VOLATILE_KEYWORD abs_decl
- { $$ = follow_types ($1); }
+const_or_volatile: const_or_volatile_noopt
+ |
+ ;
+
+cv_with_space_id : const_or_volatile space_identifier const_or_volatile
+ ;
+
+const_or_volatile_or_space_identifier_noopt: cv_with_space_id
+ | const_or_volatile_noopt
+ ;
+
+const_or_volatile_or_space_identifier:
+ const_or_volatile_or_space_identifier_noopt
+ |
;
abs_decl: '*'
@@ -815,6 +817,10 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = builtin_type_unsigned_long_long; }
| UNSIGNED LONG LONG INT_KEYWORD
{ $$ = builtin_type_unsigned_long_long; }
+ | SIGNED_KEYWORD LONG LONG
+ { $$ = lookup_signed_typename ("long long"); }
+ | SIGNED_KEYWORD LONG LONG INT_KEYWORD
+ { $$ = lookup_signed_typename ("long long"); }
| SHORT INT_KEYWORD
{ $$ = builtin_type_short; }
| UNSIGNED SHORT INT_KEYWORD
@@ -850,11 +856,10 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = lookup_template_type(copy_name($2), $4,
expression_context_block);
}
- /* "const" and "volatile" are curently ignored. A type qualifier
- after the type is handled in the ptype rule. I think these could
- be too. */
- | CONST_KEYWORD typebase { $$ = $2; }
- | VOLATILE_KEYWORD typebase { $$ = $2; }
+ | const_or_volatile_or_space_identifier_noopt typebase
+ { $$ = follow_types ($2); }
+ | typebase const_or_volatile_or_space_identifier_noopt
+ { $$ = follow_types ($1); }
;
typename: TYPENAME
@@ -891,6 +896,25 @@ nonempty_typelist
}
;
+ptype : typebase
+ | ptype const_or_volatile_or_space_identifier abs_decl const_or_volatile_or_space_identifier
+ { $$ = follow_types ($1); }
+ ;
+
+const_and_volatile: CONST_KEYWORD VOLATILE_KEYWORD
+ | VOLATILE_KEYWORD CONST_KEYWORD
+ ;
+
+const_or_volatile_noopt: const_and_volatile
+ { push_type (tp_const);
+ push_type (tp_volatile);
+ }
+ | CONST_KEYWORD
+ { push_type (tp_const); }
+ | VOLATILE_KEYWORD
+ { push_type (tp_volatile); }
+ ;
+
name : NAME { $$ = $1.stoken; }
| BLOCKNAME { $$ = $1.stoken; }
| TYPENAME { $$ = $1.stoken; }
@@ -1437,8 +1461,6 @@ yylex ()
if (c == '<')
{
- if (hp_som_som_object_present)
- {
/* Scan ahead to get rest of the template specification. Note
that we look ahead only when the '<' adjoins non-whitespace
characters; for comparison expressions, e.g. "a < b > c",
@@ -1448,26 +1470,6 @@ yylex ()
if (p)
namelen = p - tokstart;
break;
- }
- else
- {
- int i = namelen;
- int nesting_level = 1;
- while (tokstart[++i])
- {
- if (tokstart[i] == '<')
- nesting_level++;
- else if (tokstart[i] == '>')
- {
- if (--nesting_level == 0)
- break;
- }
- }
- if (tokstart[i] == '>')
- namelen = i;
- else
- break;
- }
}
c = tokstart[++namelen];
}
@@ -1706,7 +1708,7 @@ yylex ()
return TYPENAME;
}
if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
+ return TYPENAME;
/* Input names that aren't symbols but ARE valid hex numbers,
when the input radix permits them, can be names or numbers
diff --git a/contrib/gdb/gdb/c-lang.c b/contrib/gdb/gdb/c-lang.c
index e7aa055..fa977cd 100644
--- a/contrib/gdb/gdb/c-lang.c
+++ b/contrib/gdb/gdb/c-lang.c
@@ -1,21 +1,23 @@
/* C language support routines for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -24,18 +26,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "parser-defs.h"
#include "language.h"
#include "c-lang.h"
+#include "valprint.h"
-static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+extern void _initialize_c_language (void);
+static void c_emit_char (int c, struct ui_file * stream, int quoter);
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
characters and strings is language specific. */
static void
-c_emit_char (c, stream, quoter)
- register int c;
- GDB_FILE *stream;
- int quoter;
+c_emit_char (register int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -66,12 +67,18 @@ c_emit_char (c, stream, quoter)
case '\r':
fputs_filtered ("\\r", stream);
break;
+ case '\013':
+ fputs_filtered ("\\v", stream);
+ break;
case '\033':
fputs_filtered ("\\e", stream);
break;
case '\007':
fputs_filtered ("\\a", stream);
break;
+ case '\0':
+ fputs_filtered ("\\0", stream);
+ break;
default:
fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
break;
@@ -80,9 +87,7 @@ c_emit_char (c, stream, quoter)
}
void
-c_printchar (c, stream)
- int c;
- GDB_FILE *stream;
+c_printchar (int c, struct ui_file *stream)
{
fputc_filtered ('\'', stream);
LA_EMIT_CHAR (c, stream, '\'');
@@ -96,27 +101,22 @@ c_printchar (c, stream)
printing LENGTH characters, or if FORCE_ELLIPSES. */
void
-c_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+c_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
register unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
extern int inspect_it;
- extern int repeat_count_threshold;
- extern int print_max;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C
style. */
if (!force_ellipses
&& length > 0
- && extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
+ && (extract_unsigned_integer (string + (length - 1) * width, width)
+ == '\0'))
length--;
if (length == 0)
@@ -128,7 +128,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;
@@ -148,7 +148,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;
@@ -222,177 +222,170 @@ c_printstr (stream, string, length, width, force_ellipses)
debugging information supplied by the compiler. fnf@cygnus.com */
struct type *
-c_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+c_create_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type *type = NULL;
switch (typeid)
{
- default:
- /* FIXME: For now, if we are asked to produce a type not in this
- language, create the equivalent of a C integer type with the
- name "<?type?>". When all the dust settles from the type
- reconstruction work, this should probably become an error. */
- type = init_type (TYPE_CODE_INT,
- 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,
+ TYPE_FLAG_NOSIGN, "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_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);
}
-
+
/* 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},
- /* C++ */
- {"::", BINOP_SCOPE, PREC_PREFIX, 0},
- {NULL, 0, 0, 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},
+ {NULL, 0, 0, 0}
};
-struct type ** CONST_PTR (c_builtin_types[]) =
+struct type **const (c_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
@@ -414,12 +407,14 @@ struct type ** CONST_PTR (c_builtin_types[]) =
0
};
-const struct language_defn c_language_defn = {
+const struct language_defn c_language_defn =
+{
"c", /* Language name */
language_c,
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
@@ -430,18 +425,18 @@ 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,
@@ -464,12 +459,14 @@ struct type ** const (cplus_builtin_types[]) =
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,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
@@ -480,23 +477,25 @@ 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,
range_check_off,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
@@ -507,19 +506,19 @@ 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
};
void
-_initialize_c_language ()
+_initialize_c_language (void)
{
add_language (&c_language_defn);
add_language (&cplus_language_defn);
diff --git a/contrib/gdb/gdb/c-lang.h b/contrib/gdb/gdb/c-lang.h
index 28486fd..b1925e1 100644
--- a/contrib/gdb/gdb/c-lang.h
+++ b/contrib/gdb/gdb/c-lang.h
@@ -1,21 +1,23 @@
/* C language support definitions for GDB, the GNU debugger.
- Copyright 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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)
@@ -24,41 +26,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
-extern int
-c_parse PARAMS ((void)); /* Defined in c-exp.y */
+extern int c_parse (void); /* Defined in c-exp.y */
-extern void
-c_error PARAMS ((char *)); /* Defined in c-exp.y */
+extern void c_error (char *); /* Defined in c-exp.y */
-extern void /* Defined in c-typeprint.c */
-c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+/* Defined in c-typeprint.c */
+extern void c_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int
-c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
+extern int c_value_print (struct value *, struct ui_file *, int,
+ enum val_prettyprint);
/* These are in c-lang.c: */
-extern void c_printchar PARAMS ((int, GDB_FILE*));
+extern void c_printchar (int, struct ui_file *);
-extern void c_printstr PARAMS ((GDB_FILE *stream, char *string,
- unsigned int length, int width,
- int force_ellipses));
+extern void c_printstr (struct ui_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 (struct objfile *, int);
-extern struct type ** CONST_PTR (c_builtin_types[]);
+extern struct type **const (c_builtin_types[]);
/* These are in c-typeprint.c: */
-extern void
-c_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
+extern void c_type_print_base (struct type *, struct ui_file *, int, int);
-extern void
-c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
+extern void c_type_print_varspec_prefix (struct type *, struct ui_file *,
+ int, int);
/* These are in cp-valprint.c */
@@ -66,22 +66,19 @@ extern int vtblprint; /* Controls printing of vtbl's */
extern int static_field_print;
-extern void
-cp_print_class_member PARAMS ((char *, struct type *, GDB_FILE *, char *));
+extern void cp_print_class_member (char *, struct type *, struct ui_file *,
+ char *);
-extern void
-cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
+extern void cp_print_class_method (char *, struct type *, struct ui_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));
+extern void cp_print_value_fields (struct type *, struct type *, char *,
+ int, CORE_ADDR, struct ui_file *, int,
+ int, enum val_prettyprint,
+ struct type **, int);
-extern int
-cp_is_vtbl_ptr_type PARAMS ((struct type *));
+extern int cp_is_vtbl_ptr_type (struct type *);
-extern int
-cp_is_vtbl_member PARAMS ((struct type *));
+extern int cp_is_vtbl_member (struct type *);
-#endif /* !defined (C_LANG_H) */
+#endif /* !defined (C_LANG_H) */
diff --git a/contrib/gdb/gdb/c-typeprint.c b/contrib/gdb/gdb/c-typeprint.c
index e155503..0c460e9 100644
--- a/contrib/gdb/gdb/c-typeprint.c
+++ b/contrib/gdb/gdb/c-typeprint.c
@@ -1,22 +1,24 @@
/* Support for printing C and C++ types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 1999
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+ 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,95 +29,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
#include "gdbcore.h"
#include "target.h"
-#include "command.h"
-#include "gdbcmd.h"
#include "language.h"
#include "demangle.h"
#include "c-lang.h"
#include "typeprint.h"
+#include "cp-abi.h"
#include "gdb_string.h"
#include <errno.h>
-#include <ctype.h>
/* Flag indicating target was compiled by HP compiler */
extern int hp_som_som_object_present;
-static void
-c_type_print_args PARAMS ((struct type *, GDB_FILE *));
+static void cp_type_print_method_args (struct type ** args, char *prefix,
+ char *varstring, int staticp,
+ struct ui_file *stream);
-static void
-cp_type_print_derivation_info PARAMS ((GDB_FILE *, struct type *));
+static void c_type_print_args (struct type *, struct ui_file *);
-void
-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));
+static void cp_type_print_derivation_info (struct ui_file *, struct type *);
+void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
+ int);
+/* Print "const", "volatile", or address space modifiers. */
+static void c_type_print_modifier (struct type *, struct ui_file *,
+ int, int);
-/* 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;
-{
- CHECK_TYPEDEF (type);
- 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));
- 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));
- else
- 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));
- else
- fprintf_filtered(stream, "<builtin> = ");
- type_print(type,"",stream,0);
- break;
-#endif
- default:
- error("Language not supported.");
- }
- fprintf_filtered(stream, ";\n");
-}
/* LEVEL is the depth to indent lines by. */
void
-c_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+c_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
register enum type_code code;
int demangled_args;
@@ -127,8 +75,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
@@ -144,33 +92,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.
@@ -179,9 +127,7 @@ c_print_type (type, varstring, stream, show, level)
derivation via protected inheritance, so gdb can print it out */
static void
-cp_type_print_derivation_info (stream, type)
- GDB_FILE *stream;
- struct type *type;
+cp_type_print_derivation_info (struct ui_file *stream, struct type *type)
{
char *name;
int i;
@@ -190,9 +136,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)");
}
@@ -202,43 +148,40 @@ cp_type_print_derivation_info (stream, type)
}
}
/* Print the C++ method arguments ARGS to the file STREAM. */
-
-void
-cp_type_print_method_args (args, prefix, varstring, staticp, stream)
- struct type **args;
- char *prefix;
- char *varstring;
- int staticp;
- GDB_FILE *stream;
+
+static void
+cp_type_print_method_args (struct type **args, char *prefix, char *varstring,
+ int staticp, struct ui_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, ")");
}
@@ -252,11 +195,8 @@ cp_type_print_method_args (args, prefix, varstring, staticp, stream)
SHOW is always zero on recursive calls. */
void
-c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int passed_a_ptr;
+c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr)
{
char *name;
if (type == 0)
@@ -272,7 +212,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
case TYPE_CODE_PTR:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
fprintf_filtered (stream, "*");
- c_type_print_cv_qualifier (type, stream, 1, 0);
+ c_type_print_modifier (type, stream, 1, 0);
break;
case TYPE_CODE_MEMBER:
@@ -284,7 +224,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;
@@ -303,7 +243,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
case TYPE_CODE_REF:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
fprintf_filtered (stream, "&");
- c_type_print_cv_qualifier (type, stream, 1, 0);
+ c_type_print_modifier (type, stream, 1, 0);
break;
case TYPE_CODE_FUNC:
@@ -334,8 +274,12 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_TEMPLATE:
/* 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;
+ default:
+ error ("type not handled in c_type_print_varspec_prefix()");
break;
}
}
@@ -346,31 +290,42 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
NEED_SPACE = 1 indicates an initial white space is needed */
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;
+c_type_print_modifier (struct type *type, struct ui_file *stream,
+ int need_pre_space, int need_post_space)
{
- int flag = 0;
-
- if (TYPE_CONST (type))
+ int did_print_modifier = 0;
+ char *address_space_id;
+
+ /* We don't print `const' qualifiers for references --- since all
+ operators affect the thing referenced, not the reference itself,
+ every reference is `const'. */
+ if (TYPE_CONST (type)
+ && TYPE_CODE (type) != TYPE_CODE_REF)
{
if (need_pre_space)
- fprintf_filtered (stream, " ");
+ fprintf_filtered (stream, " ");
fprintf_filtered (stream, "const");
- flag = 1;
+ did_print_modifier = 1;
}
-
+
if (TYPE_VOLATILE (type))
{
- if (flag || need_pre_space)
- fprintf_filtered (stream, " ");
+ if (did_print_modifier || need_pre_space)
+ fprintf_filtered (stream, " ");
fprintf_filtered (stream, "volatile");
- flag = 1;
+ did_print_modifier = 1;
+ }
+
+ address_space_id = address_space_int_to_name (TYPE_FLAGS (type));
+ if (address_space_id)
+ {
+ if (did_print_modifier || need_pre_space)
+ fprintf_filtered (stream, " ");
+ fprintf_filtered (stream, "@%s", address_space_id);
+ did_print_modifier = 1;
}
- if (flag && need_post_space)
+ if (did_print_modifier && need_post_space)
fprintf_filtered (stream, " ");
}
@@ -378,9 +333,7 @@ c_type_print_cv_qualifier (type, stream, need_pre_space, need_post_space)
static void
-c_type_print_args (type, stream)
- struct type *type;
- GDB_FILE *stream;
+c_type_print_args (struct type *type, struct ui_file *stream)
{
int i;
struct type **args;
@@ -394,10 +347,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;
@@ -405,11 +358,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 (" ");
@@ -421,21 +374,154 @@ c_type_print_args (type, stream)
{
fprintf_filtered (stream, "void");
}
-
+
fprintf_filtered (stream, ")");
}
+
+/* Return true iff the j'th overloading of the i'th method of TYPE
+ is a type conversion operator, like `operator int () { ... }'.
+ When listing a class's methods, we don't print the return type of
+ such operators. */
+static int
+is_type_conversion_operator (struct type *type, int i, int j)
+{
+ /* I think the whole idea of recognizing type conversion operators
+ by their name is pretty terrible. But I don't think our present
+ data structure gives us any other way to tell. If you know of
+ some other way, feel free to rewrite this function. */
+ char *name = TYPE_FN_FIELDLIST_NAME (type, i);
+
+ if (strncmp (name, "operator", 8) != 0)
+ return 0;
+
+ name += 8;
+ if (! strchr (" \t\f\n\r", *name))
+ return 0;
+
+ while (strchr (" \t\f\n\r", *name))
+ name++;
+
+ if (!('a' <= *name && *name <= 'z')
+ && !('A' <= *name && *name <= 'Z')
+ && *name != '_')
+ /* If this doesn't look like the start of an identifier, then it
+ isn't a type conversion operator. */
+ return 0;
+ else if (strncmp (name, "new", 3) == 0)
+ name += 3;
+ else if (strncmp (name, "delete", 6) == 0)
+ name += 6;
+ else
+ /* If it doesn't look like new or delete, it's a type conversion
+ operator. */
+ return 1;
+
+ /* Is that really the end of the name? */
+ if (('a' <= *name && *name <= 'z')
+ || ('A' <= *name && *name <= 'Z')
+ || ('0' <= *name && *name <= '9')
+ || *name == '_')
+ /* No, so the identifier following "operator" must be a type name,
+ and this is a type conversion operator. */
+ return 1;
+
+ /* That was indeed the end of the name, so it was `operator new' or
+ `operator delete', neither of which are type conversion operators. */
+ return 0;
+}
+
+
+/* Given a C++ qualified identifier QID, strip off the qualifiers,
+ yielding the unqualified name. The return value is a pointer into
+ the original string.
+
+ It's a pity we don't have this information in some more structured
+ form. Even the author of this function feels that writing little
+ parsers like this everywhere is stupid. */
+static char *
+remove_qualifiers (char *qid)
+{
+ int quoted = 0; /* zero if we're not in quotes;
+ '"' if we're in a double-quoted string;
+ '\'' if we're in a single-quoted string. */
+ int depth = 0; /* number of unclosed parens we've seen */
+ char *parenstack = (char *) alloca (strlen (qid));
+ char *scan;
+ char *last = 0; /* The character after the rightmost
+ `::' token we've seen so far. */
+
+ for (scan = qid; *scan; scan++)
+ {
+ if (quoted)
+ {
+ if (*scan == quoted)
+ quoted = 0;
+ else if (*scan == '\\' && *(scan + 1))
+ scan++;
+ }
+ else if (scan[0] == ':' && scan[1] == ':')
+ {
+ /* If we're inside parenthesis (i.e., an argument list) or
+ angle brackets (i.e., a list of template arguments), then
+ we don't record the position of this :: token, since it's
+ not relevant to the top-level structure we're trying
+ to operate on. */
+ if (depth == 0)
+ {
+ last = scan + 2;
+ scan++;
+ }
+ }
+ else if (*scan == '"' || *scan == '\'')
+ quoted = *scan;
+ else if (*scan == '(')
+ parenstack[depth++] = ')';
+ else if (*scan == '[')
+ parenstack[depth++] = ']';
+ /* We're going to treat <> as a pair of matching characters,
+ since we're more likely to see those in template id's than
+ real less-than characters. What a crock. */
+ else if (*scan == '<')
+ parenstack[depth++] = '>';
+ else if (*scan == ')' || *scan == ']' || *scan == '>')
+ {
+ if (depth > 0 && parenstack[depth - 1] == *scan)
+ depth--;
+ else
+ {
+ /* We're going to do a little error recovery here. If we
+ don't find a match for *scan on the paren stack, but
+ there is something lower on the stack that does match, we
+ pop the stack to that point. */
+ int i;
+
+ for (i = depth - 1; i >= 0; i--)
+ if (parenstack[i] == *scan)
+ {
+ depth = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (last)
+ return last;
+ else
+ /* We didn't find any :: tokens at the top level, so declare the
+ whole thing an unqualified identifier. */
+ return qid;
+}
+
+
/* Print any array sizes, function arguments or close parentheses
needed after the variable name (to describe its type).
Args work like c_type_print_varspec_prefix. */
void
-c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int passed_a_ptr;
- int demangled_args;
+c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr, int demangled_args)
{
if (type == 0)
return;
@@ -450,15 +536,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;
@@ -487,22 +573,25 @@ 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
+ && (TYPE_PROTOTYPED (type)
+ || 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,
@@ -525,8 +614,12 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_TEMPLATE:
/* 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;
+ default:
+ error ("type not handled in c_type_print_varspec_suffix()");
break;
}
}
@@ -548,19 +641,20 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
We increase it for some recursive calls. */
void
-c_type_print_base (type, stream, show, level)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int level;
+c_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
{
- register int i;
- register int len;
- register int lastval;
+ int i;
+ int len, real_len;
+ int lastval;
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;
@@ -582,13 +676,13 @@ c_type_print_base (type, stream, show, level)
if (show <= 0
&& TYPE_NAME (type) != NULL)
{
- c_type_print_cv_qualifier (type, stream, 0, 1);
+ c_type_print_modifier (type, stream, 0, 1);
fputs_filtered (TYPE_NAME (type), stream);
return;
}
CHECK_TYPEDEF (type);
-
+
switch (TYPE_CODE (type))
{
case TYPE_CODE_TYPEDEF:
@@ -602,36 +696,40 @@ c_type_print_base (type, stream, show, level)
break;
case TYPE_CODE_STRUCT:
- c_type_print_cv_qualifier (type, stream, 0, 1);
+ c_type_print_modifier (type, stream, 0, 1);
/* 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:
- c_type_print_cv_qualifier (type, stream, 0, 1);
+ c_type_print_modifier (type, stream, 0, 1);
fprintf_filtered (stream, "union ");
struct_union:
@@ -643,7 +741,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)
@@ -659,11 +757,11 @@ 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))
{
- if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
+ if (TYPE_STUB (type))
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
else
fprintfi_filtered (level + 4, stream, "<no data fields>\n");
@@ -675,71 +773,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. */
@@ -749,17 +847,16 @@ 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 */
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)
{
@@ -812,10 +909,22 @@ c_type_print_base (type, stream, show, level)
fprintf_filtered (stream, ";\n");
}
- /* If there are both fields and methods, put a space between. */
+ /* If there are both fields and methods, put a blank line
+ between them. Make sure to count only method that we will
+ display; artificial methods will be hidden. */
len = TYPE_NFN_FIELDS (type);
- if (len && section_type != s_none)
- fprintf_filtered (stream, "\n");
+ real_len = 0;
+ for (i = 0; i < len; i++)
+ {
+ struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
+ int len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
+ int j;
+ for (j = 0; j < len2; j++)
+ if (!TYPE_FN_FIELD_ARTIFICIAL (f, j))
+ real_len++;
+ }
+ if (real_len > 0 && section_type != s_none)
+ fprintf_filtered (stream, "\n");
/* C++: print out the methods */
for (i = 0; i < len; i++)
@@ -824,16 +933,18 @@ 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 =
+ is_constructor_name (physname)
+ || is_destructor_name (physname)
+ || method_name[0] == '~';
+
+ /* Do not print out artificial methods. */
+ if (TYPE_FN_FIELD_ARTIFICIAL (f, j))
+ continue;
QUIT;
if (TYPE_FN_FIELD_PROTECTED (f, j))
@@ -871,13 +982,12 @@ 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 && /* " " */
+ !is_type_conversion_operator (type, i, j))
{
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, -1);
@@ -895,14 +1005,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'>",
@@ -911,71 +1021,66 @@ c_type_print_base (type, stream, show, level)
else
{
char *p;
- char *demangled_no_class = demangled_name;
-
- while (p = strchr (demangled_no_class, ':'))
- {
- demangled_no_class = p;
- if (*++demangled_no_class == ':')
- ++demangled_no_class;
- }
- /* get rid of the static word appended by the demangler */
+ char *demangled_no_class
+ = remove_qualifiers (demangled_name);
+
+ /* get rid of the `static' appended by the demangler */
p = strstr (demangled_no_class, " static");
if (p != NULL)
{
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);
+ xfree (demangled_no_static);
}
else
fputs_filtered (demangled_no_class, stream);
- free (demangled_name);
+ xfree (demangled_name);
}
if (TYPE_FN_FIELD_STUB (f, j))
- free (mangled_name);
+ xfree (mangled_name);
fprintf_filtered (stream, ";\n");
}
}
- 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_LOCALTYPE_PTR (type) && show >= 0)
+ fprintfi_filtered (level, stream, " (Local at %s:%d)\n",
+ TYPE_LOCALTYPE_FILE (type),
+ TYPE_LOCALTYPE_LINE (type));
}
- 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);
+ c_type_print_modifier (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)
@@ -997,7 +1102,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))
@@ -1031,41 +1137,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);
+ c_type_print_modifier (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_modifier (type, stream, 0, 1);
fputs_filtered (TYPE_NAME (type), stream);
}
else
@@ -1078,12 +1188,3 @@ go_back:
break;
}
}
-
-
-
-
-
-
-
-
-
diff --git a/contrib/gdb/gdb/c-valprint.c b/contrib/gdb/gdb/c-valprint.c
index 7a9c6be..9361067 100644
--- a/contrib/gdb/gdb/c-valprint.c
+++ b/contrib/gdb/gdb/c-valprint.c
@@ -1,34 +1,56 @@
/* 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.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
-#include "demangle.h"
#include "valprint.h"
#include "language.h"
#include "c-lang.h"
-
+#include "cp-abi.h"
+
+/* Print function pointer with inferior address ADDRESS onto stdio
+ stream STREAM. */
+
+static void
+print_function_pointer_address (CORE_ADDR address, struct ui_file *stream)
+{
+ CORE_ADDR func_addr = CONVERT_FROM_FUNC_PTR_ADDR (address);
+
+ /* If the function pointer is represented by a description, print the
+ address of the description. */
+ if (addressprint && func_addr != address)
+ {
+ fputs_filtered ("@", stream);
+ print_address_numeric (address, 1, stream);
+ fputs_filtered (": ", stream);
+ }
+ print_address_demangle (func_addr, stream, demangle);
+}
+
+
/* 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
@@ -43,19 +65,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
The PRETTY parameter controls prettyprinting. */
int
-c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, recurse,
- pretty)
- 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;
+c_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
- 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 +97,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;
-
+ unsigned int temp_len;
+
/* Look for a NULL char. */
for (temp_len = 0;
(valaddr + embedded_offset)[temp_len]
@@ -95,7 +109,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 +117,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 +128,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 +143,14 @@ 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);
+ CORE_ADDR addr
+ = extract_typed_address (valaddr + embedded_offset, type);
+ print_function_pointer_address (addr, stream);
break;
}
elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -153,12 +168,11 @@ 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));
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
+ print_function_pointer_address (addr, stream);
/* Return value is irrelevant except for string pointers. */
return (0);
}
@@ -179,13 +193,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 +208,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 value *vt_val;
+ 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 +237,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 +254,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)
- {
+ {
+ CORE_ADDR addr
+ = extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
- print_address_numeric
- (extract_address (valaddr + embedded_offset,
- TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
+ print_address_numeric (addr, 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);
+ struct value *deref_val =
+ 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 +303,19 @@ 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))
+ /*FIXME: Abstract this away */
+ 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);
+ int offset = (embedded_offset +
+ TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8);
+ struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
+ CORE_ADDR addr
+ = extract_typed_address (valaddr + offset, field_type);
+
+ print_function_pointer_address (addr, stream);
}
else
cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format,
@@ -338,7 +355,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 +381,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:
@@ -402,10 +419,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
else
{
- fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%u" : "%d",
- unpack_long (type, valaddr + embedded_offset));
+ val = unpack_long (type, valaddr + embedded_offset);
+ if (TYPE_UNSIGNED (type))
+ fprintf_filtered (stream, "%u", (unsigned int) val);
+ else
+ fprintf_filtered (stream, "%d", (int) val);
fputs_filtered (" ", stream);
- LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset), stream);
+ LA_PRINT_CHAR ((unsigned char) val, stream);
}
break;
@@ -421,8 +441,12 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
break;
case TYPE_CODE_METHOD:
- cp_print_class_method (valaddr + embedded_offset, lookup_pointer_type (type), stream);
- break;
+ {
+ struct value *v = value_at (type, address, NULL);
+ cp_print_class_method (VALUE_CONTENTS (value_addr (v)),
+ lookup_pointer_type (type), stream);
+ break;
+ }
case TYPE_CODE_VOID:
fprintf_filtered (stream, "void");
@@ -434,11 +458,33 @@ 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;
+ case TYPE_CODE_COMPLEX:
+ if (format)
+ print_scalar_formatted (valaddr + embedded_offset,
+ TYPE_TARGET_TYPE (type),
+ format, 0, stream);
+ else
+ print_floating (valaddr + embedded_offset, TYPE_TARGET_TYPE (type),
+ stream);
+ fprintf_filtered (stream, " + ");
+ if (format)
+ print_scalar_formatted (valaddr + embedded_offset
+ + TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
+ TYPE_TARGET_TYPE (type),
+ format, 0, stream);
+ else
+ print_floating (valaddr + embedded_offset
+ + TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
+ TYPE_TARGET_TYPE (type),
+ stream);
+ fprintf_filtered (stream, " * I");
+ break;
+
default:
error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type));
}
@@ -447,16 +493,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
int
-c_value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+c_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
struct type *type = VALUE_TYPE (val);
- struct type * real_type;
+ 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 +510,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 +519,46 @@ 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 */
+ {
+
+ if (TYPE_CODE(type) == TYPE_CODE_REF)
+ {
+ /* Copy value, change to pointer, so we don't get an
+ * error about a non-pointer type in value_rtti_target_type
+ */
+ struct value *temparg;
+ temparg=value_copy(val);
+ VALUE_TYPE (temparg) = lookup_pointer_type(TYPE_TARGET_TYPE(type));
+ val=temparg;
+ }
+ /* 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, " ?");
+ real_type = value_rtti_target_type (val, &full, &top, &using_enc);
+ if (real_type)
+ {
+ /* RTTI entry found */
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ {
+ /* create a pointer type pointing to the real type */
+ type = lookup_pointer_type (real_type);
+ }
+ else
+ {
+ /* create a reference type referencing the real type */
+ type = lookup_reference_type (real_type);
+ }
+ /* JYG: Need to adjust pointer value. */
+ val->aligner.contents[0] -= top;
+
+ /* Note: When we look up RTTI entries, we don't get any
+ information on const or volatile attributes */
}
+ type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
- }
+ }
else
{
- /* normal case */
+ /* normal case */
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
@@ -507,29 +568,31 @@ 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);
+ /* Note: When we look up RTTI entries, we don't get any information on
+ const or volatile attributes */
+ }
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);
}
diff --git a/contrib/gdb/gdb/call-cmds.h b/contrib/gdb/gdb/call-cmds.h
index 4c02004..3d2cda1 100644
--- a/contrib/gdb/gdb/call-cmds.h
+++ b/contrib/gdb/gdb/call-cmds.h
@@ -1,28 +1,35 @@
+/* ***DEPRECATED*** The gdblib files must not be calling/using things in any
+ of the possible command languages. If necessary, a hook (that may be
+ present or not) must be used and set to the appropriate routine by any
+ command language that cares about it. If you are having to include this
+ file you are possibly doing things the old way. This file will disapear.
+ 2000-12-01 fnasser@redhat.com */
+
/* Prototypes for GDB commands that are called internally by other functions.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 2000, 2001 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 CALL_CMDS_H
+#define CALL_CMDS_H
-extern void
-initialize_all_files PARAMS ((void));
+extern void initialize_all_files (void);
-extern void
-exec_file_command PARAMS ((char *, int));
+extern void core_file_command (char *, int);
-extern void
-core_file_command PARAMS ((char *, int));
+extern void break_command (char *, int);
-extern void
-break_command PARAMS ((char *, int));
+#endif
diff --git a/contrib/gdb/gdb/ch-exp.c b/contrib/gdb/gdb/ch-exp.c
index 45436a3..e96a6f8 100644
--- a/contrib/gdb/gdb/ch-exp.c
+++ b/contrib/gdb/gdb/ch-exp.c
@@ -1,21 +1,23 @@
/* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*-
- Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 +53,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,137 +66,137 @@ 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. */
-static void write_lower_upper_value PARAMS ((enum exp_opcode, struct type *));
-static enum ch_terminal match_bitstring_literal PARAMS ((void));
-static enum ch_terminal match_integer_literal PARAMS ((void));
-static enum ch_terminal match_character_literal PARAMS ((void));
-static enum ch_terminal match_string_literal PARAMS ((void));
-static enum ch_terminal match_float_literal PARAMS ((void));
-static enum ch_terminal match_float_literal PARAMS ((void));
-static int decode_integer_literal PARAMS ((LONGEST *, char **));
-static int decode_integer_value PARAMS ((int, char **, LONGEST *));
-static char *match_simple_name_string PARAMS ((void));
-static void growbuf_by_size PARAMS ((int));
-static void parse_untyped_expr PARAMS ((void));
-static void parse_if_expression PARAMS ((void));
-static void parse_else_alternative PARAMS ((void));
-static void parse_then_alternative PARAMS ((void));
-static void parse_expr PARAMS ((void));
-static void parse_operand0 PARAMS ((void));
-static void parse_operand1 PARAMS ((void));
-static void parse_operand2 PARAMS ((void));
-static void parse_operand3 PARAMS ((void));
-static void parse_operand4 PARAMS ((void));
-static void parse_operand5 PARAMS ((void));
-static void parse_operand6 PARAMS ((void));
-static void parse_primval PARAMS ((void));
-static void parse_tuple PARAMS ((struct type *));
-static void parse_opt_element_list PARAMS ((struct type *));
-static void parse_tuple_element PARAMS ((struct type *));
-static void parse_named_record_element PARAMS ((void));
-static void parse_call PARAMS ((void));
-static struct type *parse_mode_or_normal_call PARAMS ((void));
+static void write_lower_upper_value (enum exp_opcode, struct type *);
+static enum ch_terminal match_bitstring_literal (void);
+static enum ch_terminal match_integer_literal (void);
+static enum ch_terminal match_character_literal (void);
+static enum ch_terminal match_string_literal (void);
+static enum ch_terminal match_float_literal (void);
+static int decode_integer_literal (LONGEST *, char **);
+static int decode_integer_value (int, char **, LONGEST *);
+static char *match_simple_name_string (void);
+static void growbuf_by_size (int);
+static void parse_case_label (void);
+static void parse_untyped_expr (void);
+static void parse_if_expression (void);
+static void parse_if_expression_body (void);
+static void parse_else_alternative (void);
+static void parse_then_alternative (void);
+static void parse_expr (void);
+static void parse_operand0 (void);
+static void parse_operand1 (void);
+static void parse_operand2 (void);
+static void parse_operand3 (void);
+static void parse_operand4 (void);
+static void parse_operand5 (void);
+static void parse_operand6 (void);
+static void parse_primval (void);
+static void parse_tuple (struct type *);
+static void parse_opt_element_list (struct type *);
+static void parse_tuple_element (struct type *);
+static void parse_named_record_element (void);
+static void parse_call (void);
+static struct type *parse_mode_or_normal_call (void);
#if 0
-static struct type *parse_mode_call PARAMS ((void));
+static struct type *parse_mode_call (void);
#endif
-static void parse_unary_call PARAMS ((void));
-static int parse_opt_untyped_expr PARAMS ((void));
-static void parse_case_label PARAMS ((void));
-static int expect PARAMS ((enum ch_terminal, char *));
-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 enum ch_terminal ch_lex PARAMS ((void));
-INLINE static enum ch_terminal PEEK_TOKEN PARAMS ((void));
-static enum ch_terminal peek_token_ PARAMS ((int));
-static void forward_token_ PARAMS ((void));
-static void require PARAMS ((enum ch_terminal));
-static int check_token PARAMS ((enum ch_terminal));
+static void parse_unary_call (void);
+static int parse_opt_untyped_expr (void);
+static int expect (enum ch_terminal, char *);
+static enum ch_terminal ch_lex (void);
+INLINE static enum ch_terminal PEEK_TOKEN (void);
+static enum ch_terminal peek_token_ (int);
+static void forward_token_ (void);
+static void require (enum ch_terminal);
+static int check_token (enum ch_terminal);
#define MAX_LOOK_AHEAD 2
-static enum ch_terminal terminal_buffer[MAX_LOOK_AHEAD+1] = {
+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 (void)
{
if (terminal_buffer[0] == TOKEN_NOT_READ)
{
@@ -207,11 +209,11 @@ PEEK_TOKEN()
#define PEEK_TOKEN1() peek_token_(1)
#define PEEK_TOKEN2() peek_token_(2)
static enum ch_terminal
-peek_token_ (i)
- int i;
+peek_token_ (int i)
{
if (i > MAX_LOOK_AHEAD)
- fatal ("internal error - too much lookahead");
+ internal_error (__FILE__, __LINE__,
+ "too much lookahead");
if (terminal_buffer[i] == TOKEN_NOT_READ)
{
terminal_buffer[i] = ch_lex ();
@@ -223,18 +225,17 @@ peek_token_ (i)
#if 0
static void
-pushback_token (code, node)
- enum ch_terminal code;
- YYSTYPE node;
+pushback_token (enum ch_terminal code, YYSTYPE node)
{
int i;
if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
- fatal ("internal error - cannot pushback token");
+ internal_error (__FILE__, __LINE__,
+ "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 +243,13 @@ pushback_token (code, node)
#endif
static void
-forward_token_()
+forward_token_ (void)
{
int i;
for (i = 0; i < MAX_LOOK_AHEAD; i++)
{
- terminal_buffer[i] = terminal_buffer[i+1];
- val_buffer[i] = val_buffer[i+1];
+ terminal_buffer[i] = terminal_buffer[i + 1];
+ val_buffer[i] = val_buffer[i + 1];
}
terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ;
}
@@ -258,23 +259,20 @@ forward_token_()
if it isn't TOKEN, the parser is broken. */
static void
-require(token)
- enum ch_terminal token;
+require (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);
+ internal_error (__FILE__, __LINE__,
+ "expected token %d", (int) token);
}
- FORWARD_TOKEN();
+ FORWARD_TOKEN ();
}
static int
-check_token (token)
- enum ch_terminal token;
+check_token (enum ch_terminal token)
{
- if (PEEK_TOKEN() != token)
+ if (PEEK_TOKEN () != token)
return 0;
FORWARD_TOKEN ();
return 1;
@@ -282,13 +280,11 @@ 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;
+expect (enum ch_terminal token, char *message)
{
- if (PEEK_TOKEN() != token)
+ if (PEEK_TOKEN () != token)
{
if (message)
error (message);
@@ -299,16 +295,17 @@ expect (token, message)
return 0;
}
else
- FORWARD_TOKEN();
+ FORWARD_TOKEN ();
return 1;
}
#if 0
+/* Parse a name string. If ALLOW_ALL is 1, ALL is allowed as a postfix. */
+
static tree
-parse_opt_name_string (allow_all)
- int allow_all; /* 1 if ALL is allowed as a postfix */
+parse_opt_name_string (int allow_all)
{
- int token = PEEK_TOKEN();
+ int token = PEEK_TOKEN ();
tree name;
if (token != NAME)
{
@@ -319,17 +316,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 +334,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 ()
+parse_simple_name_string (void)
{
- int token = PEEK_TOKEN();
+ int token = PEEK_TOKEN ();
tree name;
if (token != NAME)
{
@@ -358,7 +355,7 @@ parse_simple_name_string ()
}
static tree
-parse_name_string ()
+parse_name_string (void)
{
tree name = parse_opt_name_string (0);
if (name)
@@ -373,7 +370,7 @@ parse_name_string ()
Returns if pass 2: a decl or value for identifier. */
static tree
-parse_name ()
+parse_name (void)
{
tree name = parse_name_string ();
if (pass == 1 || ignoring)
@@ -394,14 +391,13 @@ parse_name ()
return convert_from_reference (decl);
else
return decl;
- }
+ }
}
#endif
#if 0
static void
-pushback_paren_expr (expr)
- tree expr;
+pushback_paren_expr (tree expr)
{
if (pass == 1 && !ignoring)
expr = build1 (PAREN_EXPR, NULL_TREE, expr);
@@ -412,7 +408,7 @@ pushback_paren_expr (expr)
/* Matches: <case label> */
static void
-parse_case_label ()
+parse_case_label (void)
{
if (check_token (ELSE))
error ("ELSE in tuples labels not implemented");
@@ -426,7 +422,7 @@ parse_case_label ()
}
static int
-parse_opt_untyped_expr ()
+parse_opt_untyped_expr (void)
{
switch (PEEK_TOKEN ())
{
@@ -441,7 +437,7 @@ parse_opt_untyped_expr ()
}
static void
-parse_unary_call ()
+parse_unary_call (void)
{
FORWARD_TOKEN ();
expect ('(', NULL);
@@ -454,14 +450,14 @@ parse_unary_call ()
#if 0
static struct type *
-parse_mode_call ()
+parse_mode_call (void)
{
struct type *type;
FORWARD_TOKEN ();
expect ('(', NULL);
if (PEEK_TOKEN () != TYPENAME)
error ("expect MODENAME here `%s'", lexptr);
- type = PEEK_LVAL().tsym.type;
+ type = PEEK_LVAL ().tsym.type;
FORWARD_TOKEN ();
expect (')', NULL);
return type;
@@ -470,14 +466,14 @@ parse_mode_call ()
#endif
static struct type *
-parse_mode_or_normal_call ()
+parse_mode_or_normal_call (void)
{
struct type *type;
FORWARD_TOKEN ();
expect ('(', NULL);
if (PEEK_TOKEN () == TYPENAME)
{
- type = PEEK_LVAL().tsym.type;
+ type = PEEK_LVAL ().tsym.type;
FORWARD_TOKEN ();
}
else
@@ -493,7 +489,7 @@ parse_mode_or_normal_call ()
Assume we have parsed the function, and are at the '('. */
static void
-parse_call ()
+parse_call (void)
{
int arg_count;
require ('(');
@@ -530,7 +526,7 @@ parse_call ()
}
static void
-parse_named_record_element ()
+parse_named_record_element (void)
{
struct stoken label;
char buf[256];
@@ -552,8 +548,7 @@ parse_named_record_element ()
/* Returns one or more TREE_LIST nodes, in reverse order. */
static void
-parse_tuple_element (type)
- struct type *type;
+parse_tuple_element (struct type *type)
{
if (PEEK_TOKEN () == DOT_FIELD_NAME)
{
@@ -618,8 +613,7 @@ parse_tuple_element (type)
/* Matches: a COMMA-separated list of tuple elements.
Returns a list (of TREE_LIST nodes). */
static void
-parse_opt_element_list (type)
- struct type *type;
+parse_opt_element_list (struct type *type)
{
arglist_len = 0;
if (PEEK_TOKEN () == ']')
@@ -639,8 +633,7 @@ parse_opt_element_list (type)
If modename is non-NULL it prefixed the tuple. */
static void
-parse_tuple (mode)
- struct type *mode;
+parse_tuple (struct type *mode)
{
struct type *type;
if (mode)
@@ -668,14 +661,14 @@ parse_tuple (mode)
}
static void
-parse_primval ()
+parse_primval (void)
{
struct type *type;
enum exp_opcode op;
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 +711,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 +724,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 +732,7 @@ parse_primval ()
#if 0
case CONST:
case EXPR:
- val = PEEK_LVAL();
+ val = PEEK_LVAL ();
FORWARD_TOKEN ();
break;
#endif
@@ -759,7 +752,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 +773,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 +793,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 +820,7 @@ parse_primval ()
case TYPENAME:
type = PEEK_LVAL ().tsym.type;
FORWARD_TOKEN ();
- switch (PEEK_TOKEN())
+ switch (PEEK_TOKEN ())
{
case '[':
parse_tuple (type);
@@ -837,8 +837,8 @@ parse_primval ()
error ("typename in invalid context");
}
break;
-
- default:
+
+ default:
error ("invalid expression syntax at `%s'", lexptr);
}
for (;;)
@@ -931,7 +931,7 @@ parse_primval ()
}
static void
-parse_operand6 ()
+parse_operand6 (void)
{
if (check_token (RECEIVE))
{
@@ -944,11 +944,11 @@ parse_operand6 ()
write_exp_elt_opcode (UNOP_ADDR);
}
else
- parse_primval();
+ parse_primval ();
}
static void
-parse_operand5()
+parse_operand5 (void)
{
enum exp_opcode op;
/* We are supposed to be looking for a <string repetition operator>,
@@ -960,65 +960,83 @@ 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);
}
static void
-parse_operand4 ()
+parse_operand4 (void)
{
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);
}
}
static void
-parse_operand3 ()
+parse_operand3 (void)
{
enum exp_opcode op;
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);
}
}
static void
-parse_operand2 ()
+parse_operand2 (void)
{
enum exp_opcode op;
parse_operand3 ();
@@ -1026,72 +1044,94 @@ 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);
}
}
}
static void
-parse_operand1 ()
+parse_operand1 (void)
{
enum exp_opcode op;
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 ()
-{
+parse_operand0 (void)
+{
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);
}
}
static void
-parse_expr ()
+parse_expr (void)
{
parse_operand0 ();
if (check_token (GDB_ASSIGNMENT))
@@ -1102,14 +1142,14 @@ parse_expr ()
}
static void
-parse_then_alternative ()
+parse_then_alternative (void)
{
expect (THEN, "missing 'THEN' in 'IF' expression");
parse_expr ();
}
static void
-parse_else_alternative ()
+parse_else_alternative (void)
{
if (check_token (ELSIF))
parse_if_expression_body ();
@@ -1122,7 +1162,7 @@ parse_else_alternative ()
/* Matches: <boolean expression> <then alternative> <else alternative> */
static void
-parse_if_expression_body ()
+parse_if_expression_body (void)
{
parse_expr ();
parse_then_alternative ();
@@ -1131,7 +1171,7 @@ parse_if_expression_body ()
}
static void
-parse_if_expression ()
+parse_if_expression (void)
{
require (IF);
parse_if_expression_body ();
@@ -1145,9 +1185,9 @@ parse_if_expression ()
You should call convert() to fix up the <untyped_expr>. */
static void
-parse_untyped_expr ()
+parse_untyped_expr (void)
{
- switch (PEEK_TOKEN())
+ switch (PEEK_TOKEN ())
{
case IF:
parse_if_expression ();
@@ -1155,7 +1195,7 @@ parse_untyped_expr ()
case CASE:
error ("not implemented: CASE expression");
case '(':
- switch (PEEK_TOKEN1())
+ switch (PEEK_TOKEN1 ())
{
case IF:
case CASE:
@@ -1166,7 +1206,7 @@ parse_untyped_expr ()
parse_untyped_expr ();
expect (')', "missing ')'");
return;
- default: ;
+ default:;
/* fall through */
}
default:
@@ -1175,14 +1215,14 @@ parse_untyped_expr ()
}
int
-chill_parse ()
+chill_parse (void)
{
terminal_buffer[0] = TOKEN_NOT_READ;
if (PEEK_TOKEN () == TYPENAME && PEEK_TOKEN1 () == END_TOKEN)
{
- write_exp_elt_opcode(OP_TYPE);
- write_exp_elt_type(PEEK_LVAL ().tsym.type);
- write_exp_elt_opcode(OP_TYPE);
+ 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 +1230,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.");
}
@@ -1220,8 +1260,7 @@ static int tempbufindex; /* Current index into buffer */
on demand. */
static void
-growbuf_by_size (count)
- int count;
+growbuf_by_size (int count)
{
int growby;
@@ -1242,16 +1281,18 @@ growbuf_by_size (count)
in symbol table lookups. If not successful, returns NULL. */
static char *
-match_simple_name_string ()
+match_simple_name_string (void)
{
char *tokptr = lexptr;
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 +1307,9 @@ 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;
+decode_integer_value (int base, char **tokptrptr, LONGEST *ivalptr)
{
char *tokptr = *tokptrptr;
int temp;
@@ -1281,17 +1319,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 +1359,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);
@@ -1329,17 +1380,15 @@ decode_integer_value (base, tokptrptr, ivalptr)
}
static int
-decode_integer_literal (valptr, tokptrptr)
- LONGEST *valptr;
- char **tokptrptr;
+decode_integer_literal (LONGEST *valptr, char **tokptrptr)
{
char *tokptr = *tokptrptr;
int base = 0;
LONGEST ival = 0;
int explicit_base = 0;
-
+
/* Look for an explicit base specifier, which is optional. */
-
+
switch (*tokptr)
{
case 'd':
@@ -1370,15 +1419,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,29 +1453,29 @@ 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 ()
+match_float_literal (void)
{
char *tokptr = lexptr;
char *buf;
char *copy;
double dval;
extern double strtod ();
-
+
/* Make local buffer in which to build the string to convert. This is
required because underscores are valid in chill floating point numbers
but not in the string passed to strtod to convert. The string will be
no longer than our input string. */
-
+
copy = buf = (char *) alloca (strlen (tokptr) + 1);
/* Transfer all leading digits to the conversion buffer, discarding any
@@ -1450,26 +1499,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 +1539,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 +1571,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);
}
@@ -1544,7 +1593,7 @@ match_float_literal ()
a string, it is simply doubled (I.E. "this""is""one""string") */
static enum ch_terminal
-match_string_literal ()
+match_string_literal (void)
{
char *tokptr = lexptr;
int in_ctrlseq = 0;
@@ -1553,7 +1602,7 @@ match_string_literal ()
for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
{
CHECKBUF (1);
- tryagain: ;
+ tryagain:;
if (in_ctrlseq)
{
/* skip possible whitespaces */
@@ -1608,7 +1657,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 +1686,19 @@ match_string_literal ()
a string literal.
Returns CHARACTER_LITERAL if a match is found.
- */
+ */
static enum ch_terminal
-match_character_literal ()
+match_character_literal (void)
{
char *tokptr = lexptr;
LONGEST ival = 0;
-
+
if ((*tokptr == 'c' || *tokptr == 'C') && (*(tokptr + 1) == '\''))
{
/* We have a GNU chill extension form, so skip the leading "C'",
- decode the hex value, and then ensure that we have a trailing
- single quote character. */
+ 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 +1711,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 +1747,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);
@@ -1722,20 +1771,20 @@ match_character_literal ()
in any integer literal. */
static enum ch_terminal
-match_integer_literal ()
+match_integer_literal (void)
{
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 defined(CC_HAS_LONG_LONG)
+ if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U)
yylval.typed_val.type = builtin_type_long_long;
else
#endif
@@ -1751,20 +1800,20 @@ match_integer_literal ()
in any bit-string literal. */
static enum ch_terminal
-match_bitstring_literal ()
+match_bitstring_literal (void)
{
register char *tokptr = lexptr;
int bitoffset = 0;
int bitcount = 0;
int bits_per_char;
int digit;
-
+
tempbufindex = 0;
CHECKBUF (1);
tempbuf[0] = 0;
/* Look for the required explicit base specifier. */
-
+
switch (*tokptr++)
{
case 'b':
@@ -1785,33 +1834,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)
{
@@ -1821,30 +1883,30 @@ match_bitstring_literal ()
else
{
/* Extract bits from digit, packing them into the bitstring byte. */
- int k = TARGET_BYTE_ORDER == BIG_ENDIAN ? bits_per_char - 1 : 0;
- for (; TARGET_BYTE_ORDER == BIG_ENDIAN ? k >= 0 : k < bits_per_char;
- TARGET_BYTE_ORDER == BIG_ENDIAN ? k-- : k++)
+ int k = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? bits_per_char - 1 : 0;
+ for (; TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k >= 0 : k < bits_per_char;
+ TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k-- : k++)
{
bitcount++;
if (digit & (1 << k))
{
tempbuf[tempbufindex] |=
- (TARGET_BYTE_ORDER == BIG_ENDIAN)
- ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
- : (1 << bitoffset);
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
+ : (1 << bitoffset);
}
bitoffset++;
if (bitoffset == HOST_CHAR_BIT)
{
bitoffset = 0;
tempbufindex++;
- CHECKBUF(1);
+ 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 +1914,7 @@ match_bitstring_literal ()
{
return (0);
}
- else
+ else
{
yylval.sval.ptr = tempbuf;
yylval.sval.length = bitcount;
@@ -1869,40 +1931,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. */
@@ -1910,243 +1972,246 @@ static const struct token tokentab2[] =
operators used are compatible. */
static enum ch_terminal
-ch_lex ()
+ch_lex (void)
{
- 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;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "unhandled SYMBOL_CLASS in ch_lex()");
+ break;
}
+ }
+ else if (!have_full_symbols () && !have_partial_symbols ())
+ {
+ error ("No symbol table is loaded. Use the \"file\" command.");
+ }
+ else
+ {
+ error ("No symbol \"%s\" in current context.", inputname);
+ }
+ }
- 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 */
- struct type *type;
+write_lower_upper_value (enum exp_opcode opcode, /* Either UNOP_LOWER or UNOP_UPPER */
+ struct type *type)
{
if (type == NULL)
write_exp_elt_opcode (opcode);
@@ -2162,8 +2227,7 @@ write_lower_upper_value (opcode, type)
}
void
-chill_error (msg)
- char *msg;
+chill_error (char *msg)
{
/* Never used. */
}
diff --git a/contrib/gdb/gdb/ch-lang.c b/contrib/gdb/gdb/ch-lang.c
index c54e8bb..b46dce0 100644
--- a/contrib/gdb/gdb/ch-lang.c
+++ b/contrib/gdb/gdb/ch-lang.c
@@ -1,21 +1,23 @@
/* Chill language support routines for GDB, the GNU debugger.
- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -25,35 +27,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "parser-defs.h"
#include "language.h"
#include "ch-lang.h"
+#include "valprint.h"
-static value_ptr
-evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));
+extern void _initialize_chill_language (void);
-static value_ptr
-value_chill_max_min PARAMS ((enum exp_opcode, value_ptr));
+static struct value *evaluate_subexp_chill (struct type *, struct expression *,
+ int *, enum noside);
-static value_ptr
-value_chill_card PARAMS ((value_ptr));
+static struct value *value_chill_max_min (enum exp_opcode, struct value *);
-static value_ptr
- value_chill_length PARAMS ((value_ptr));
+static struct value *value_chill_card (struct value *);
-static struct type *
-chill_create_fundamental_type PARAMS ((struct objfile *, int));
+static struct value *value_chill_length (struct value *);
-static void
-chill_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+static struct type *chill_create_fundamental_type (struct objfile *, int);
-static void
-chill_printchar PARAMS ((int, GDB_FILE *));
+static void chill_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+
+static void chill_printchar (int, struct ui_file *);
/* For now, Chill uses a simple mangling algorithm whereby you simply
discard everything after the occurance of two successive CPLUS_MARKER
characters to derive the demangled form. */
char *
-chill_demangle (mangled)
- const char *mangled;
+chill_demangle (const char *mangled)
{
const char *joiner = NULL;
char *demangled;
@@ -80,9 +80,7 @@ chill_demangle (mangled)
}
static void
-chill_printchar (c, stream)
- register int c;
- GDB_FILE *stream;
+chill_printchar (register int c, struct ui_file *stream)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -108,15 +106,11 @@ 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)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+chill_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
register unsigned int i;
unsigned int things_printed = 0;
@@ -124,8 +118,6 @@ chill_printstr (stream, string, length, width, force_ellipses)
int in_control_form = 0;
int need_slashslash = 0;
unsigned int c;
- extern int repeat_count_threshold;
- extern int print_max;
if (length == 0)
{
@@ -136,7 +128,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;
@@ -175,7 +167,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))
{
@@ -229,98 +221,97 @@ chill_printstr (stream, string, length, width, force_ellipses)
}
static struct type *
-chill_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+chill_create_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type *type = NULL;
switch (typeid)
{
- default:
- /* FIXME: For now, if we are asked to produce a type not in this
- language, create the equivalent of a C integer type with the
- name "<?type?>". When all the dust settles from the type
- reconstruction work, this should probably become an error. */
- type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
- warning ("internal error: no chill fundamental type %d", typeid);
- break;
- case FT_VOID:
- /* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
- typedefs, unrelated to anything directly in the code being compiled,
- that have some FT_VOID types. Just fake it for now. */
- type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
- break;
- case FT_BOOLEAN:
- type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
- break;
- case FT_CHAR:
- type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
- break;
- case FT_SIGNED_CHAR:
- type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
- break;
- case FT_UNSIGNED_CHAR:
- type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
- break;
- case FT_SHORT: /* Chill ints are 2 bytes */
- type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
- break;
- case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
- type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
- break;
- case FT_INTEGER: /* FIXME? */
- case FT_SIGNED_INTEGER: /* FIXME? */
- case FT_LONG: /* Chill longs are 4 bytes */
- case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
- type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
- break;
- case FT_UNSIGNED_INTEGER: /* FIXME? */
- case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
- type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
- break;
- case FT_FLOAT:
- type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
- break;
- case FT_DBL_PREC_FLOAT:
- type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
- break;
- }
+ default:
+ /* FIXME: For now, if we are asked to produce a type not in this
+ language, create the equivalent of a C integer type with the
+ name "<?type?>". When all the dust settles from the type
+ reconstruction work, this should probably become an error. */
+ type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
+ warning ("internal error: no chill fundamental type %d", typeid);
+ break;
+ case FT_VOID:
+ /* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
+ typedefs, unrelated to anything directly in the code being compiled,
+ that have some FT_VOID types. Just fake it for now. */
+ type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
+ break;
+ case FT_BOOLEAN:
+ type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
+ break;
+ case FT_CHAR:
+ type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
+ break;
+ case FT_SIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
+ break;
+ case FT_UNSIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
+ break;
+ case FT_SHORT: /* Chill ints are 2 bytes */
+ type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
+ break;
+ case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
+ type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
+ break;
+ case FT_INTEGER: /* FIXME? */
+ case FT_SIGNED_INTEGER: /* FIXME? */
+ case FT_LONG: /* Chill longs are 4 bytes */
+ case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
+ type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
+ break;
+ case FT_UNSIGNED_INTEGER: /* FIXME? */
+ case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
+ type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
+ break;
+ case FT_FLOAT:
+ type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
+ break;
+ case FT_DBL_PREC_FLOAT:
+ type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
+ break;
+ }
return (type);
}
-
+
/* Table of operators and their precedences for printing expressions. */
-static const struct op_print chill_op_print_tab[] = {
- {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
- {"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
- {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
- {"MOD", BINOP_MOD, PREC_MUL, 0},
- {"REM", BINOP_REM, PREC_MUL, 0},
- {"SIZE",UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
- {"LOWER",UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
- {"UPPER",UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
- {"CARD",UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
- {"MAX",UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
- {"MIN",UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
- {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"=", BINOP_EQUAL, PREC_EQUAL, 0},
- {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"->", UNOP_IND, PREC_SUFFIX, 1},
- {"->", UNOP_ADDR, PREC_PREFIX, 0},
- {":", BINOP_RANGE, PREC_ASSIGN, 0},
- {NULL, 0, 0, 0}
+static const struct op_print chill_op_print_tab[] =
+{
+ {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+ {"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+ {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+ {"MOD", BINOP_MOD, PREC_MUL, 0},
+ {"REM", BINOP_REM, PREC_MUL, 0},
+ {"SIZE", UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
+ {"LOWER", UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
+ {"UPPER", UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
+ {"CARD", UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
+ {"MAX", UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
+ {"MIN", UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
+ {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+ {"=", BINOP_EQUAL, PREC_EQUAL, 0},
+ {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
+ {"<=", BINOP_LEQ, PREC_ORDER, 0},
+ {">=", BINOP_GEQ, PREC_ORDER, 0},
+ {">", BINOP_GTR, PREC_ORDER, 0},
+ {"<", BINOP_LESS, PREC_ORDER, 0},
+ {"+", BINOP_ADD, PREC_ADD, 0},
+ {"-", BINOP_SUB, PREC_ADD, 0},
+ {"*", BINOP_MUL, PREC_MUL, 0},
+ {"/", BINOP_DIV, PREC_MUL, 0},
+ {"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
+ {"-", UNOP_NEG, PREC_PREFIX, 0},
+ {"->", UNOP_IND, PREC_SUFFIX, 1},
+ {"->", UNOP_ADDR, PREC_PREFIX, 0},
+ {":", BINOP_RANGE, PREC_ASSIGN, 0},
+ {NULL, 0, 0, 0}
};
/* The built-in types of Chill. */
@@ -331,14 +322,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 (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.
@@ -346,10 +337,8 @@ struct type ** CONST_PTR (chill_builtin_types[]) =
*RESULT_TYPE is the appropriate type for the result. */
LONGEST
-type_lower_upper (op, type, result_type)
- enum exp_opcode op; /* Either UNOP_LOWER or UNOP_UPPER */
- struct type *type;
- struct type **result_type;
+type_lower_upper (enum exp_opcode op, /* Either UNOP_LOWER or UNOP_UPPER */
+ struct type *type, struct type **result_type)
{
LONGEST low, high;
*result_type = type;
@@ -364,7 +353,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:
@@ -399,9 +388,8 @@ type_lower_upper (op, type, result_type)
error ("unknown mode for LOWER/UPPER builtin");
}
-static value_ptr
-value_chill_length (val)
- value_ptr val;
+static struct value *
+value_chill_length (struct value *val)
{
LONGEST tmp;
struct type *type = VALUE_TYPE (val);
@@ -428,9 +416,8 @@ value_chill_length (val)
return value_from_longest (builtin_type_int, tmp);
}
-static value_ptr
-value_chill_card (val)
- value_ptr val;
+static struct value *
+value_chill_card (struct value *val)
{
LONGEST tmp = 0;
struct type *type = VALUE_TYPE (val);
@@ -453,10 +440,8 @@ value_chill_card (val)
return value_from_longest (builtin_type_int, tmp);
}
-static value_ptr
-value_chill_max_min (op, val)
- enum exp_opcode op;
- value_ptr val;
+static struct value *
+value_chill_max_min (enum exp_opcode op, struct value *val)
{
LONGEST tmp = 0;
struct type *type = VALUE_TYPE (val);
@@ -503,23 +488,21 @@ 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);
}
-static value_ptr
-evaluate_subexp_chill (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+static struct value *
+evaluate_subexp_chill (struct type *expect_type,
+ register struct expression *exp, register int *pos,
+ enum noside noside)
{
int pc = *pos;
struct type *type;
int tem, nargs;
- value_ptr arg1;
- value_ptr *argvec;
+ struct value *arg1;
+ struct value **argvec;
enum exp_opcode op = exp->elts[*pos].opcode;
switch (op)
{
@@ -534,7 +517,8 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
if (nargs == 1 && TYPE_CODE (type) == TYPE_CODE_INT)
{
/* Looks like string repetition. */
- value_ptr string = evaluate_subexp_with_coercion (exp, pos, noside);
+ struct value *string = evaluate_subexp_with_coercion (exp, pos,
+ noside);
return value_concat (arg1, string);
}
@@ -552,18 +536,19 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL */
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * (nargs + 2));
+ argvec = (struct value **) alloca (sizeof (struct value *)
+ * (nargs + 2));
argvec[0] = arg1;
tem = 1;
for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
{
argvec[tem]
- = evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem-1),
+ = 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:
@@ -572,7 +557,8 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
while (nargs-- > 0)
{
- value_ptr index = evaluate_subexp_with_coercion (exp, pos, noside);
+ struct value *index = evaluate_subexp_with_coercion (exp, pos,
+ noside);
arg1 = value_subscript (arg1, index);
}
return (arg1);
@@ -614,41 +600,43 @@ 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,
range_check_on,
type_check_on,
+ case_sensitive_on,
chill_parse, /* parser */
chill_error, /* parser error function */
evaluate_subexp_chill,
chill_printchar, /* print a character constant */
chill_printstr, /* function to print a string constant */
NULL, /* Function to print a single char */
- chill_create_fundamental_type,/* Create fundamental type in this language */
+ chill_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
};
/* Initialization for Chill */
void
-_initialize_chill_language ()
+_initialize_chill_language (void)
{
builtin_type_chill_bool =
init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
diff --git a/contrib/gdb/gdb/ch-lang.h b/contrib/gdb/gdb/ch-lang.h
index 6525c30..b55e2dd 100644
--- a/contrib/gdb/gdb/ch-lang.h
+++ b/contrib/gdb/gdb/ch-lang.h
@@ -1,42 +1,41 @@
/* Chill language support definitions for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1994, 1996, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 */
+/* Forward decls for prototypes */
struct value;
-#endif
-extern int
-chill_parse PARAMS ((void)); /* Defined in ch-exp.y */
+extern int chill_parse (void); /* Defined in ch-exp.y */
-extern void
-chill_error PARAMS ((char *)); /* Defined in ch-exp.y */
+extern void chill_error (char *); /* Defined in ch-exp.y */
-extern void /* Defined in ch-typeprint.c */
-chill_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+/* Defined in ch-typeprint.c */
+extern void chill_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-chill_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int chill_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int
-chill_value_print PARAMS ((struct value *, GDB_FILE *,
- int, enum val_prettyprint));
+extern int chill_value_print (struct value *, struct ui_file *,
+ int, enum val_prettyprint);
extern LONGEST
-type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));
+type_lower_upper (enum exp_opcode, struct type *, struct type **);
diff --git a/contrib/gdb/gdb/ch-typeprint.c b/contrib/gdb/gdb/ch-typeprint.c
index a6b1944..011bd12 100644
--- a/contrib/gdb/gdb/ch-typeprint.c
+++ b/contrib/gdb/gdb/ch-typeprint.c
@@ -1,21 +1,23 @@
/* Support for printing Chill types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -26,26 +28,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
#include "gdbcore.h"
#include "target.h"
-#include "command.h"
-#include "gdbcmd.h"
#include "language.h"
-#include "demangle.h"
#include "ch-lang.h"
#include "typeprint.h"
#include "gdb_string.h"
#include <errno.h>
-static void
-chill_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
+static void chill_type_print_base (struct type *, struct ui_file *, int, int);
void
-chill_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+chill_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
if (varstring != NULL && *varstring != '\0')
{
@@ -68,11 +62,8 @@ chill_print_type (type, varstring, stream, show, level)
We increase it for some recursive calls. */
static void
-chill_type_print_base (type, stream, show, level)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int level;
+chill_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
{
register int len;
register int i;
@@ -104,243 +95,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_STUB (type))
+ {
+ fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
+ }
+ else
+ {
+ fprintfi_filtered (level + 4, stream, "<no data fields>\n");
+ }
+ }
+ else
+ {
+ len = TYPE_NFIELDS (type);
+ for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+ {
+ struct type *field_type = TYPE_FIELD_TYPE (type, i);
+ QUIT;
+ print_spaces_filtered (level + 4, stream);
+ if (TYPE_CODE (field_type) == TYPE_CODE_UNION)
+ {
+ int j; /* variant number */
+ fputs_filtered ("CASE OF\n", stream);
+ for (j = 0; j < TYPE_NFIELDS (field_type); j++)
+ {
+ int k; /* variant field index */
+ struct type *variant_type
+ = TYPE_FIELD_TYPE (field_type, j);
+ int var_len = TYPE_NFIELDS (variant_type);
+ print_spaces_filtered (level + 4, stream);
+ if (strcmp (TYPE_FIELD_NAME (field_type, j),
+ "else") == 0)
+ fputs_filtered ("ELSE\n", stream);
+ else
+ fputs_filtered (":\n", stream);
+ if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT)
+ error ("variant record confusion");
+ for (k = 0; k < var_len; k++)
+ {
+ print_spaces_filtered (level + 8, stream);
+ chill_print_type (TYPE_FIELD_TYPE (variant_type, k),
+ TYPE_FIELD_NAME (variant_type, k),
+ stream, show - 1, level + 8);
+ if (k < (var_len - 1))
+ fputs_filtered (",", stream);
+ fputs_filtered ("\n", stream);
+ }
+ }
+ print_spaces_filtered (level + 4, stream);
+ fputs_filtered ("ESAC", stream);
+ }
+ else
+ chill_print_type (field_type,
+ TYPE_FIELD_NAME (type, i),
+ stream, show - 1, level + 4);
+ if (i < (len - 1))
+ {
+ fputs_filtered (",", stream);
+ }
+ fputs_filtered ("\n", stream);
+ }
+ }
+ fprintfi_filtered (level, stream, ")");
+ }
+ break;
+
+ case TYPE_CODE_RANGE:
+ {
+ struct type *target = TYPE_TARGET_TYPE (type);
+ if (target && TYPE_NAME (target))
+ fputs_filtered (TYPE_NAME (target), stream);
else
- {
- 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;
+ }
}
diff --git a/contrib/gdb/gdb/ch-valprint.c b/contrib/gdb/gdb/ch-valprint.c
index 663ba64..44b1c53 100644
--- a/contrib/gdb/gdb/ch-valprint.c
+++ b/contrib/gdb/gdb/ch-valprint.c
@@ -1,22 +1,24 @@
/* Support for printing Chill values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,23 +29,24 @@ 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"
-static void
-chill_print_value_fields PARAMS ((struct type *, char *, GDB_FILE *, int, int,
- enum val_prettyprint, struct type **));
-
-static void
-chill_print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
+static void chill_print_value_fields (struct type *, char *,
+ struct ui_file *, int, int,
+ enum val_prettyprint, struct type **);
-static void
-chill_val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+static void chill_print_type_scalar (struct type *, LONGEST,
+ struct ui_file *);
+static void chill_val_print_array_elements (struct type *, char *,
+ CORE_ADDR, struct ui_file *,
+ int, int, int,
+ enum val_prettyprint);
+
/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
Used to print data from type structures in a specified type. For example,
array bounds may be characters or booleans in some languages, and this
@@ -51,10 +54,7 @@ chill_val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FI
decimal integer values. */
static void
-chill_print_type_scalar (type, val, stream)
- struct type *type;
- LONGEST val;
- GDB_FILE *stream;
+chill_print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
{
switch (TYPE_CODE (type))
{
@@ -97,16 +97,10 @@ chill_print_type_scalar (type, val, stream)
element indexes (in Chill syntax). */
static void
-chill_val_print_array_elements (type, valaddr, address, stream,
- format, deref_ref, recurse, pretty)
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+chill_val_print_array_elements (struct type *type, char *valaddr,
+ CORE_ADDR address, struct ui_file *stream,
+ int format, int deref_ref, int recurse,
+ enum val_prettyprint pretty)
{
unsigned int i = 0;
unsigned int things_printed = 0;
@@ -120,8 +114,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 +140,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;
@@ -197,17 +191,9 @@ chill_val_print_array_elements (type, valaddr, address, stream,
The PRETTY parameter controls prettyprinting. */
int
-chill_val_print (type, valaddr, embedded_offset, address,
- stream, format, deref_ref, recurse, pretty)
- 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;
+chill_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
LONGEST val;
unsigned int i = 0; /* Number of characters printed. */
@@ -227,7 +213,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 +274,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 +294,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 +306,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 +327,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;
@@ -349,7 +335,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
case TYPE_CODE_SET:
elttype = TYPE_INDEX_TYPE (type);
CHECK_TYPEDEF (elttype);
- if (TYPE_FLAGS (elttype) & TYPE_FLAG_STUB)
+ if (TYPE_STUB (elttype))
{
fprintf_filtered (stream, "<incomplete type>");
gdb_flush (stream);
@@ -393,11 +379,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 +404,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 +430,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 +439,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);
+ struct value *deref_val =
+ value_at
+ (TYPE_TARGET_TYPE (type),
+ unpack_pointer (lookup_pointer_type (builtin_type_void),
+ valaddr),
+ NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
- 0,
+ 0,
VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty);
}
@@ -494,7 +480,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);
}
@@ -512,15 +498,9 @@ chill_val_print (type, valaddr, embedded_offset, address,
should not print, or zero if called from top level. */
static void
-chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
- dont_print)
- struct type *type;
- char *valaddr;
- GDB_FILE *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
- struct type **dont_print;
+chill_print_value_fields (struct type *type, char *valaddr,
+ struct ui_file *stream, int format, int recurse,
+ enum val_prettyprint pretty, struct type **dont_print)
{
int i, len;
int fields_seen = 0;
@@ -547,7 +527,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));
}
@@ -557,19 +537,19 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
fputs_filtered (": ", stream);
if (TYPE_FIELD_PACKED (type, i))
{
- value_ptr v;
+ struct value *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);
}
@@ -584,14 +564,11 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
}
int
-chill_value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+chill_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
struct type *type = VALUE_TYPE (val);
- struct type *real_type = check_typedef (type);
+ struct type *real_type = check_typedef (type);
/* If it is a pointer, indicate what it points to.
@@ -626,5 +603,3 @@ chill_value_print (val, stream, format, pretty)
return (val_print (type, VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
}
-
-
diff --git a/contrib/gdb/gdb/cli-out.c b/contrib/gdb/gdb/cli-out.c
new file mode 100644
index 0000000..9bcfa46
--- /dev/null
+++ b/contrib/gdb/gdb/cli-out.c
@@ -0,0 +1,377 @@
+/* Output generating routines for GDB CLI.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+ Written by Fernando Nasser 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. */
+
+#include "defs.h"
+#include "ui-out.h"
+#include "cli-out.h"
+#include "gdb_string.h"
+#include "gdb_assert.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#ifndef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+#endif
+
+struct ui_out_data
+ {
+ struct ui_file *stream;
+ int suppress_output;
+ };
+
+/* These are the CLI output functions */
+
+static void cli_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows, const char *tblid);
+static void cli_table_body (struct ui_out *uiout);
+static void cli_table_end (struct ui_out *uiout);
+static void cli_table_header (struct ui_out *uiout, int width,
+ enum ui_align alig, const char *col_name,
+ const char *colhdr);
+static void cli_begin (struct ui_out *uiout, enum ui_out_type type,
+ int level, const char *lstid);
+static void cli_end (struct ui_out *uiout, enum ui_out_type type, int level);
+static void cli_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname, int value);
+static void cli_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname);
+static void cli_field_string (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname,
+ const char *string);
+static void cli_field_fmt (struct ui_out *uiout, int fldno,
+ int width, enum ui_align align,
+ const char *fldname, const char *format,
+ va_list args);
+static void cli_spaces (struct ui_out *uiout, int numspaces);
+static void cli_text (struct ui_out *uiout, const char *string);
+static void cli_message (struct ui_out *uiout, int verbosity,
+ const char *format, va_list args);
+static void cli_wrap_hint (struct ui_out *uiout, char *identstring);
+static void cli_flush (struct ui_out *uiout);
+
+/* This is the CLI ui-out implementation functions vector */
+
+/* FIXME: This can be initialized dynamically after default is set to
+ handle initial output in main.c */
+
+static struct ui_out_impl cli_ui_out_impl =
+{
+ cli_table_begin,
+ cli_table_body,
+ cli_table_end,
+ cli_table_header,
+ cli_begin,
+ cli_end,
+ cli_field_int,
+ cli_field_skip,
+ cli_field_string,
+ cli_field_fmt,
+ cli_spaces,
+ cli_text,
+ cli_message,
+ cli_wrap_hint,
+ cli_flush,
+ 0, /* Does not need MI hacks (i.e. needs CLI hacks). */
+};
+
+/* Prototypes for local functions */
+
+extern void _initialize_cli_out (void);
+
+static void field_separator (void);
+
+static void out_field_fmt (struct ui_out *uiout, int fldno,
+ const char *fldname,
+ const char *format,...);
+
+/* local variables */
+
+/* (none yet) */
+
+/* Mark beginning of a table */
+
+void
+cli_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows,
+ const char *tblid)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (nr_rows == 0)
+ data->suppress_output = 1;
+ else
+ /* Only the table suppresses the output and, fortunatly, a table
+ is not a recursive data structure. */
+ gdb_assert (data->suppress_output == 0);
+}
+
+/* Mark beginning of a table body */
+
+void
+cli_table_body (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ /* first, close the table header line */
+ cli_text (uiout, "\n");
+}
+
+/* Mark end of a table */
+
+void
+cli_table_end (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ data->suppress_output = 0;
+}
+
+/* Specify table header */
+
+void
+cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+ const char *col_name,
+ const char *colhdr)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ cli_field_string (uiout, 0, width, alignment, 0, colhdr);
+}
+
+/* Mark beginning of a list */
+
+void
+cli_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level,
+ const char *id)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+}
+
+/* Mark end of a list */
+
+void
+cli_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+}
+
+/* output an int field */
+
+void
+cli_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alignment,
+ const char *fldname, int value)
+{
+ char buffer[20]; /* FIXME: how many chars long a %d can become? */
+
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ sprintf (buffer, "%d", value);
+ cli_field_string (uiout, fldno, width, alignment, fldname, buffer);
+}
+
+/* used to ommit a field */
+
+void
+cli_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alignment,
+ const char *fldname)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ cli_field_string (uiout, fldno, width, alignment, fldname, "");
+}
+
+/* other specific cli_field_* end up here so alignment and field
+ separators are both handled by cli_field_string */
+
+void
+cli_field_string (struct ui_out *uiout,
+ int fldno,
+ int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string)
+{
+ int before = 0;
+ int after = 0;
+
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+
+ if ((align != ui_noalign) && string)
+ {
+ before = width - strlen (string);
+ if (before <= 0)
+ before = 0;
+ else
+ {
+ if (align == ui_right)
+ after = 0;
+ else if (align == ui_left)
+ {
+ after = before;
+ before = 0;
+ }
+ else
+ /* ui_center */
+ {
+ after = before / 2;
+ before -= after;
+ }
+ }
+ }
+
+ if (before)
+ ui_out_spaces (uiout, before);
+ if (string)
+ out_field_fmt (uiout, fldno, fldname, "%s", string);
+ if (after)
+ ui_out_spaces (uiout, after);
+
+ if (align != ui_noalign)
+ field_separator ();
+}
+
+/* This is the only field function that does not align */
+
+void
+cli_field_fmt (struct ui_out *uiout, int fldno,
+ int width, enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+
+ vfprintf_filtered (data->stream, format, args);
+
+ if (align != ui_noalign)
+ field_separator ();
+}
+
+void
+cli_spaces (struct ui_out *uiout, int numspaces)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ print_spaces_filtered (numspaces, data->stream);
+}
+
+void
+cli_text (struct ui_out *uiout, const char *string)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ fputs_filtered (string, data->stream);
+}
+
+void
+cli_message (struct ui_out *uiout, int verbosity,
+ const char *format, va_list args)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ if (ui_out_get_verblvl (uiout) >= verbosity)
+ vfprintf_unfiltered (data->stream, format, args);
+}
+
+void
+cli_wrap_hint (struct ui_out *uiout, char *identstring)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ wrap_here (identstring);
+}
+
+void
+cli_flush (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ gdb_flush (data->stream);
+}
+
+/* local functions */
+
+/* Like cli_field_fmt, but takes a variable number of args
+ and makes a va_list and does not insert a separator */
+
+/* VARARGS */
+static void
+out_field_fmt (struct ui_out *uiout, int fldno,
+ const char *fldname,
+ const char *format,...)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ va_list args;
+
+ va_start (args, format);
+ vfprintf_filtered (data->stream, format, args);
+
+ va_end (args);
+}
+
+/* access to ui_out format private members */
+
+static void
+field_separator (void)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ fputc_filtered (' ', data->stream);
+}
+
+/* initalize private members at startup */
+
+struct ui_out *
+cli_out_new (struct ui_file *stream)
+{
+ int flags = ui_source_list;
+
+ struct ui_out_data *data = XMALLOC (struct ui_out_data);
+ data->stream = stream;
+ data->suppress_output = 0;
+ return ui_out_new (&cli_ui_out_impl, data, flags);
+}
+
+/* standard gdb initialization hook */
+void
+_initialize_cli_out (void)
+{
+ /* nothing needs to be done */
+}
diff --git a/contrib/gdb/gdb/cli-out.h b/contrib/gdb/gdb/cli-out.h
new file mode 100644
index 0000000..723b726
--- /dev/null
+++ b/contrib/gdb/gdb/cli-out.h
@@ -0,0 +1,27 @@
+/* Output generating routines for GDB CLI.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 CLI_OUT_H
+#define CLI_OUT_H
+
+extern struct ui_out *cli_out_new (struct ui_file *stream);
+
+#endif
diff --git a/contrib/gdb/gdb/cli/cli-cmds.c b/contrib/gdb/gdb/cli/cli-cmds.c
new file mode 100644
index 0000000..16cc989
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-cmds.c
@@ -0,0 +1,826 @@
+/* GDB CLI commands.
+
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "completer.h"
+#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
+#include "gdb_wait.h" /* For shell escape implementation */
+#include "gdb_regex.h" /* Used by apropos_command */
+#include "filenames.h" /* for DOSish file names */
+
+#include "ui-out.h"
+
+#include "top.h"
+#include "cli/cli-decode.h"
+#include "cli/cli-script.h"
+#include "cli/cli-setshow.h"
+#include "cli/cli-cmds.h"
+
+#ifndef GDBINIT_FILENAME
+#define GDBINIT_FILENAME ".gdbinit"
+#endif
+
+/* From gdb/top.c */
+
+extern void dont_repeat (void);
+
+extern void set_verbose (char *, int, struct cmd_list_element *);
+
+extern void show_history (char *, int);
+
+extern void set_history (char *, int);
+
+extern void show_commands (char *, int);
+
+/* Prototypes for local functions */
+
+static void complete_command (char *, int);
+
+static void echo_command (char *, int);
+
+static void pwd_command (char *, int);
+
+static void show_version (char *, int);
+
+static void validate_comname (char *);
+
+static void help_command (char *, int);
+
+static void show_command (char *, int);
+
+static void info_command (char *, int);
+
+static void show_debug (char *, int);
+
+static void set_debug (char *, int);
+
+static void show_user (char *, int);
+
+static void make_command (char *, int);
+
+static void shell_escape (char *, int);
+
+void apropos_command (char *, int);
+
+/* Define all cmd_list_elements. */
+
+/* Chain containing all defined commands. */
+
+struct cmd_list_element *cmdlist;
+
+/* Chain containing all defined info subcommands. */
+
+struct cmd_list_element *infolist;
+
+/* Chain containing all defined enable subcommands. */
+
+struct cmd_list_element *enablelist;
+
+/* Chain containing all defined disable subcommands. */
+
+struct cmd_list_element *disablelist;
+
+/* Chain containing all defined toggle subcommands. */
+
+struct cmd_list_element *togglelist;
+
+/* Chain containing all defined stop subcommands. */
+
+struct cmd_list_element *stoplist;
+
+/* Chain containing all defined delete subcommands. */
+
+struct cmd_list_element *deletelist;
+
+/* Chain containing all defined "enable breakpoint" subcommands. */
+
+struct cmd_list_element *enablebreaklist;
+
+/* Chain containing all defined set subcommands */
+
+struct cmd_list_element *setlist;
+
+/* Chain containing all defined unset subcommands */
+
+struct cmd_list_element *unsetlist;
+
+/* Chain containing all defined show subcommands. */
+
+struct cmd_list_element *showlist;
+
+/* Chain containing all defined \"set history\". */
+
+struct cmd_list_element *sethistlist;
+
+/* Chain containing all defined \"show history\". */
+
+struct cmd_list_element *showhistlist;
+
+/* Chain containing all defined \"unset history\". */
+
+struct cmd_list_element *unsethistlist;
+
+/* Chain containing all defined maintenance subcommands. */
+
+struct cmd_list_element *maintenancelist;
+
+/* Chain containing all defined "maintenance info" subcommands. */
+
+struct cmd_list_element *maintenanceinfolist;
+
+/* Chain containing all defined "maintenance print" subcommands. */
+
+struct cmd_list_element *maintenanceprintlist;
+
+struct cmd_list_element *setprintlist;
+
+struct cmd_list_element *showprintlist;
+
+struct cmd_list_element *setdebuglist;
+
+struct cmd_list_element *showdebuglist;
+
+struct cmd_list_element *setchecklist;
+
+struct cmd_list_element *showchecklist;
+
+/* Utility used everywhere when at least one argument is needed and
+ none is supplied. */
+
+void
+error_no_arg (char *why)
+{
+ error ("Argument required (%s).", why);
+}
+
+/* The "info" command is defined as a prefix, with allow_unknown = 0.
+ Therefore, its own definition is called only for "info" with no args. */
+
+/* ARGSUSED */
+static void
+info_command (char *arg, int from_tty)
+{
+ printf_unfiltered ("\"info\" must be followed by the name of an info command.\n");
+ help_list (infolist, "info ", -1, gdb_stdout);
+}
+
+/* The "show" command with no arguments shows all the settings. */
+
+/* ARGSUSED */
+static void
+show_command (char *arg, int from_tty)
+{
+ cmd_show_list (showlist, from_tty, "");
+}
+
+/* Provide documentation on command or list given by COMMAND. FROM_TTY
+ is ignored. */
+
+/* ARGSUSED */
+static void
+help_command (char *command, int from_tty)
+{
+ help_cmd (command, gdb_stdout);
+}
+
+/* String compare function for qsort. */
+static int
+compare_strings (const void *arg1, const void *arg2)
+{
+ const char **s1 = (const char **) arg1;
+ const char **s2 = (const char **) arg2;
+ return strcmp (*s1, *s2);
+}
+
+/* The "complete" command is used by Emacs to implement completion. */
+
+/* ARGSUSED */
+static void
+complete_command (char *arg, int from_tty)
+{
+ int i;
+ int argpoint;
+ char **completions;
+
+ dont_repeat ();
+
+ if (arg == NULL)
+ arg = "";
+ argpoint = strlen (arg);
+
+ completions = complete_line (arg, arg, argpoint);
+
+ if (completions)
+ {
+ int item, size;
+
+ for (size = 0; completions[size]; ++size)
+ ;
+ qsort (completions, size, sizeof (char *), compare_strings);
+
+ /* We do extra processing here since we only want to print each
+ unique item once. */
+ item = 0;
+ while (item < size)
+ {
+ int next_item;
+ printf_unfiltered ("%s\n", completions[item]);
+ next_item = item + 1;
+ while (next_item < size
+ && ! strcmp (completions[item], completions[next_item]))
+ {
+ xfree (completions[next_item]);
+ ++next_item;
+ }
+
+ xfree (completions[item]);
+ item = next_item;
+ }
+
+ xfree (completions);
+ }
+}
+
+int
+is_complete_command (struct cmd_list_element *c)
+{
+ return cmd_cfunc_eq (c, complete_command);
+}
+
+/* ARGSUSED */
+static void
+show_version (char *args, int from_tty)
+{
+ immediate_quit++;
+ print_gdb_version (gdb_stdout);
+ printf_filtered ("\n");
+ immediate_quit--;
+}
+
+/* Handle the quit command. */
+
+void
+quit_command (char *args, int from_tty)
+{
+ if (!quit_confirm ())
+ error ("Not confirmed.");
+ quit_force (args, from_tty);
+}
+
+/* ARGSUSED */
+static void
+pwd_command (char *args, int from_tty)
+{
+ 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);
+ else
+ printf_unfiltered ("Working directory %s.\n", current_directory);
+}
+
+void
+cd_command (char *dir, int from_tty)
+{
+ int len;
+ /* Found something other than leading repetitions of "/..". */
+ int found_real_path;
+ char *p;
+
+ /* If the new directory is absolute, repeat is a no-op; if relative,
+ repeat might be useful but is more likely to be a mistake. */
+ dont_repeat ();
+
+ if (dir == 0)
+ error_no_arg ("new working directory");
+
+ dir = tilde_expand (dir);
+ make_cleanup (xfree, dir);
+
+ if (chdir (dir) < 0)
+ perror_with_name (dir);
+
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ /* There's too much mess with DOSish names like "d:", "d:.",
+ "d:./foo" etc. Instead of having lots of special #ifdef'ed code,
+ simply get the canonicalized name of the current directory. */
+ dir = getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
+#endif
+
+ len = strlen (dir);
+ if (IS_DIR_SEPARATOR (dir[len - 1]))
+ {
+ /* Remove the trailing slash unless this is a root directory
+ (including a drive letter on non-Unix systems). */
+ if (!(len == 1) /* "/" */
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ && !(len == 3 && dir[1] == ':') /* "d:/" */
+#endif
+ )
+ len--;
+ }
+
+ dir = savestring (dir, len);
+ if (IS_ABSOLUTE_PATH (dir))
+ current_directory = dir;
+ else
+ {
+ if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]))
+ current_directory = concat (current_directory, dir, NULL);
+ else
+ current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
+ xfree (dir);
+ }
+
+ /* Now simplify any occurrences of `.' and `..' in the pathname. */
+
+ found_real_path = 0;
+ for (p = current_directory; *p;)
+ {
+ if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.'
+ && (p[2] == 0 || IS_DIR_SEPARATOR (p[2])))
+ strcpy (p, p + 2);
+ else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.'
+ && (p[3] == 0 || IS_DIR_SEPARATOR (p[3])))
+ {
+ if (found_real_path)
+ {
+ /* Search backwards for the directory just before the "/.."
+ and obliterate it and the "/..". */
+ char *q = p;
+ while (q != current_directory && !IS_DIR_SEPARATOR (q[-1]))
+ --q;
+
+ if (q == current_directory)
+ /* current_directory is
+ a relative pathname ("can't happen"--leave it alone). */
+ ++p;
+ else
+ {
+ strcpy (q - 1, p + 3);
+ p = q - 1;
+ }
+ }
+ else
+ /* We are dealing with leading repetitions of "/..", for example
+ "/../..", which is the Mach super-root. */
+ p += 3;
+ }
+ else
+ {
+ found_real_path = 1;
+ ++p;
+ }
+ }
+
+ forget_cached_source_info ();
+
+ if (from_tty)
+ pwd_command ((char *) 0, 1);
+}
+
+void
+source_command (char *args, int from_tty)
+{
+ FILE *stream;
+ struct cleanup *old_cleanups;
+ char *file = args;
+
+ if (file == NULL)
+ {
+ error ("source command requires pathname of file to source.");
+ }
+
+ file = tilde_expand (file);
+ old_cleanups = make_cleanup (xfree, file);
+
+ stream = fopen (file, FOPEN_RT);
+ if (!stream)
+ {
+ if (from_tty)
+ perror_with_name (file);
+ else
+ return;
+ }
+
+ script_from_file (stream, file);
+
+ do_cleanups (old_cleanups);
+}
+
+/* ARGSUSED */
+static void
+echo_command (char *text, int from_tty)
+{
+ char *p = text;
+ register int c;
+
+ if (text)
+ while ((c = *p++) != '\0')
+ {
+ if (c == '\\')
+ {
+ /* \ at end of argument is used after spaces
+ so they won't be lost. */
+ if (*p == 0)
+ return;
+
+ c = parse_escape (&p);
+ if (c >= 0)
+ printf_filtered ("%c", c);
+ }
+ else
+ printf_filtered ("%c", c);
+ }
+
+ /* Force this output to appear now. */
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
+}
+
+/* ARGSUSED */
+static void
+shell_escape (char *arg, int from_tty)
+{
+#ifdef CANT_FORK
+ /* If ARG is NULL, they want an inferior shell, but `system' just
+ reports if the shell is available when passed a NULL arg. */
+ int rc = system (arg ? arg : "");
+
+ if (!arg)
+ arg = "inferior shell";
+
+ if (rc == -1)
+ {
+ fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", arg,
+ safe_strerror (errno));
+ gdb_flush (gdb_stderr);
+ }
+ else if (rc)
+ {
+ fprintf_unfiltered (gdb_stderr, "%s exited with status %d\n", arg, rc);
+ gdb_flush (gdb_stderr);
+ }
+#ifdef GLOBAL_CURDIR
+ /* Make sure to return to the directory GDB thinks it is, in case the
+ shell command we just ran changed it. */
+ chdir (current_directory);
+#endif
+#else /* Can fork. */
+ int rc, status, pid;
+ char *p, *user_shell;
+
+ if ((user_shell = (char *) getenv ("SHELL")) == NULL)
+ user_shell = "/bin/sh";
+
+ /* Get the name of the shell for arg0 */
+ if ((p = strrchr (user_shell, '/')) == NULL)
+ p = user_shell;
+ else
+ p++; /* Get past '/' */
+
+ if ((pid = fork ()) == 0)
+ {
+ if (!arg)
+ execl (user_shell, p, 0);
+ else
+ execl (user_shell, p, "-c", arg, 0);
+
+ fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell,
+ safe_strerror (errno));
+ gdb_flush (gdb_stderr);
+ _exit (0177);
+ }
+
+ if (pid != -1)
+ while ((rc = wait (&status)) != pid && rc != -1)
+ ;
+ else
+ error ("Fork failed");
+#endif /* Can fork. */
+}
+
+static void
+make_command (char *arg, int from_tty)
+{
+ char *p;
+
+ if (arg == 0)
+ p = "make";
+ else
+ {
+ p = xmalloc (sizeof ("make ") + strlen (arg));
+ strcpy (p, "make ");
+ strcpy (p + sizeof ("make ") - 1, arg);
+ }
+
+ shell_escape (p, from_tty);
+}
+
+/* ARGSUSED */
+static void
+show_user (char *args, int from_tty)
+{
+ struct cmd_list_element *c;
+ extern struct cmd_list_element *cmdlist;
+
+ if (args)
+ {
+ c = lookup_cmd (&args, cmdlist, "", 0, 1);
+ if (c->class != class_user)
+ error ("Not a user command.");
+ show_user_1 (c, gdb_stdout);
+ }
+ else
+ {
+ for (c = cmdlist; c; c = c->next)
+ {
+ if (c->class == class_user)
+ show_user_1 (c, gdb_stdout);
+ }
+ }
+}
+
+/* Search through names of commands and documentations for a certain
+ regular expression.
+*/
+void
+apropos_command (char *searchstr, int from_tty)
+{
+ extern struct cmd_list_element *cmdlist; /*This is the main command list*/
+ regex_t pattern;
+ char *pattern_fastmap;
+ char errorbuffer[512];
+ pattern_fastmap = xcalloc (256, sizeof (char));
+ if (searchstr == NULL)
+ error("REGEXP string is empty");
+
+ if (regcomp(&pattern,searchstr,REG_ICASE) == 0)
+ {
+ pattern.fastmap=pattern_fastmap;
+ re_compile_fastmap(&pattern);
+ apropos_cmd (gdb_stdout,cmdlist,&pattern,"");
+ }
+ else
+ {
+ regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
+ error("Error in regular expression:%s",errorbuffer);
+ }
+ xfree (pattern_fastmap);
+}
+
+static void
+set_debug (char *arg, int from_tty)
+{
+ printf_unfiltered ("\"set debug\" must be followed by the name of a print subcommand.\n");
+ help_list (setdebuglist, "set debug ", -1, gdb_stdout);
+}
+
+static void
+show_debug (char *args, int from_tty)
+{
+ cmd_show_list (showdebuglist, from_tty, "");
+}
+
+void
+init_cmd_lists (void)
+{
+ cmdlist = NULL;
+ infolist = NULL;
+ enablelist = NULL;
+ disablelist = NULL;
+ togglelist = NULL;
+ stoplist = NULL;
+ deletelist = NULL;
+ enablebreaklist = NULL;
+ setlist = NULL;
+ unsetlist = NULL;
+ showlist = NULL;
+ sethistlist = NULL;
+ showhistlist = NULL;
+ unsethistlist = NULL;
+ maintenancelist = NULL;
+ maintenanceinfolist = NULL;
+ maintenanceprintlist = NULL;
+ setprintlist = NULL;
+ showprintlist = NULL;
+ setchecklist = NULL;
+ showchecklist = NULL;
+}
+
+
+void
+init_cli_cmds (void)
+{
+ struct cmd_list_element *c;
+
+ /* Define the classes of commands.
+ They will appear in the help list in the reverse of this order. */
+
+ add_cmd ("internals", class_maintenance, NULL,
+ "Maintenance commands.\n\
+Some gdb commands are provided just for use by gdb maintainers.\n\
+These commands are subject to frequent change, and may not be as\n\
+well documented as user commands.",
+ &cmdlist);
+ add_cmd ("obscure", class_obscure, NULL, "Obscure features.", &cmdlist);
+ add_cmd ("aliases", class_alias, NULL, "Aliases of other commands.", &cmdlist);
+ add_cmd ("user-defined", class_user, NULL, "User-defined commands.\n\
+The commands in this class are those defined by the user.\n\
+Use the \"define\" command to define a command.", &cmdlist);
+ add_cmd ("support", class_support, NULL, "Support facilities.", &cmdlist);
+ if (!dbx_commands)
+ add_cmd ("status", class_info, NULL, "Status inquiries.", &cmdlist);
+ add_cmd ("files", class_files, NULL, "Specifying and examining files.", &cmdlist);
+ add_cmd ("breakpoints", class_breakpoint, NULL, "Making program stop at certain points.", &cmdlist);
+ add_cmd ("data", class_vars, NULL, "Examining data.", &cmdlist);
+ add_cmd ("stack", class_stack, NULL, "Examining the stack.\n\
+The stack is made up of stack frames. Gdb assigns numbers to stack frames\n\
+counting from zero for the innermost (currently executing) frame.\n\n\
+At any time gdb identifies one frame as the \"selected\" frame.\n\
+Variable lookups are done with respect to the selected frame.\n\
+When the program being debugged stops, gdb selects the innermost frame.\n\
+The commands below can be used to select other frames by number or address.",
+ &cmdlist);
+ add_cmd ("running", class_run, NULL, "Running the program.", &cmdlist);
+
+ /* Define general commands. */
+
+ add_com ("pwd", class_files, pwd_command,
+ "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\
+The change does not take effect for the program being debugged\n\
+until the next time it is started.", &cmdlist);
+ c->completer = filename_completer;
+
+ add_com ("echo", class_support, echo_command,
+ "Print a constant string. Give string as argument.\n\
+C escape sequences may be used in the argument.\n\
+No newline is added at the end of the argument;\n\
+use \"\\n\" if you want a newline to be printed.\n\
+Since leading and trailing whitespace are ignored in command arguments,\n\
+if you want to print some you must use \"\\\" before leading whitespace\n\
+to be printed or after trailing whitespace.");
+ add_com ("document", class_support, document_command,
+ "Document a user-defined command.\n\
+Give command name as argument. Give documentation on following lines.\n\
+End with a line of just \"end\".");
+ add_com ("define", class_support, define_command,
+ "Define a new command name. Command name is argument.\n\
+Definition appears on following lines, one command per line.\n\
+End with a line of just \"end\".\n\
+Use the \"document\" command to give documentation for the new command.\n\
+Commands defined in this way may have up to ten arguments.");
+
+ c = add_cmd ("source", class_support, source_command,
+ "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);
+ c->completer = filename_completer;
+
+ add_com ("quit", class_support, quit_command, "Exit gdb.");
+ c = add_com ("help", class_support, help_command, "Print list of commands.");
+ c->completer = command_completer;
+ add_com_alias ("q", "quit", class_support, 1);
+ add_com_alias ("h", "help", class_support, 1);
+
+ c = add_set_cmd ("verbose", class_support, var_boolean, (char *) &info_verbose,
+ "Set ",
+ &setlist),
+ add_show_from_set (c, &showlist);
+ set_cmd_sfunc (c, set_verbose);
+ set_verbose (NULL, 0, c);
+
+ add_prefix_cmd ("history", class_support, set_history,
+ "Generic command for setting command history parameters.",
+ &sethistlist, "set history ", 0, &setlist);
+ add_prefix_cmd ("history", class_support, show_history,
+ "Generic command for showing command history parameters.",
+ &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\
+Without an argument, history expansion is enabled.", &sethistlist),
+ &showhistlist);
+
+ add_prefix_cmd ("info", class_info, info_command,
+ "Generic command for showing things about the program being debugged.",
+ &infolist, "info ", 0, &cmdlist);
+ add_com_alias ("i", "info", class_info, 1);
+
+ add_com ("complete", class_obscure, complete_command,
+ "List the completions for the rest of the line as a command.");
+
+ add_prefix_cmd ("show", class_info, show_command,
+ "Generic command for showing things about the debugger.",
+ &showlist, "show ", 0, &cmdlist);
+ /* Another way to get at the same thing. */
+ add_info ("set", show_command, "Show all GDB settings.");
+
+ add_cmd ("commands", no_class, show_commands,
+ "Show the history of commands you typed.\n\
+You can supply a command number to start with, or a `+' to start after\n\
+the previous command number shown.",
+ &showlist);
+
+ add_cmd ("version", no_class, show_version,
+ "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\
+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\
+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\
+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,
+ "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);
+
+ c = 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);
+ deprecate_cmd (c, "set debug remote");
+ deprecate_cmd (add_show_from_set (c, &showlist), "show debug remote");
+
+ add_show_from_set (add_set_cmd ("remote", 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.", &setdebuglist),
+ &showdebuglist);
+
+ 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\
+This value is used to set the time limit for gdb to wait for a response\n\
+from the target.", &setlist),
+ &showlist);
+
+ add_prefix_cmd ("debug", no_class, set_debug,
+ "Generic command for setting gdb debugging flags",
+ &setdebuglist, "set debug ", 0, &setlist);
+
+ add_prefix_cmd ("debug", no_class, show_debug,
+ "Generic command for showing gdb debugging flags",
+ &showdebuglist, "show debug ", 0, &showlist);
+
+ c = add_com ("shell", class_support, shell_escape,
+ "Execute the rest of the line as a shell command. \n\
+With no arguments, run an inferior shell.");
+ c->completer = filename_completer;
+
+ /* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
+ be a really useful feature. Unfortunately, the below wont do
+ this. Instead it adds support for the form ``(gdb) ! ls''
+ (i.e. the space is required). If the ``!'' command below is
+ added the complains about no ``!'' command would be replaced by
+ complains about how the ``!'' command is broken :-) */
+ if (xdb_commands)
+ add_com_alias ("!", "shell", class_support, 0);
+
+ c = add_com ("make", class_support, make_command,
+ "Run the ``make'' program using the rest of the line as arguments.");
+ c->completer = filename_completer;
+ 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);
+ add_com ("apropos", class_support, apropos_command, "Search for commands matching a REGEXP");
+}
diff --git a/contrib/gdb/gdb/cli/cli-cmds.h b/contrib/gdb/gdb/cli/cli-cmds.h
new file mode 100644
index 0000000..a6e574e
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-cmds.h
@@ -0,0 +1,125 @@
+/* Header file for GDB CLI command implementation library.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (CLI_CMDS_H)
+#define CLI_CMDS_H 1
+
+/* Chain containing all defined commands. */
+
+extern struct cmd_list_element *cmdlist;
+
+/* Chain containing all defined info subcommands. */
+
+extern struct cmd_list_element *infolist;
+
+/* Chain containing all defined enable subcommands. */
+
+extern struct cmd_list_element *enablelist;
+
+/* Chain containing all defined disable subcommands. */
+
+extern struct cmd_list_element *disablelist;
+
+/* Chain containing all defined delete subcommands. */
+
+extern struct cmd_list_element *deletelist;
+
+/* Chain containing all defined toggle subcommands. */
+
+extern struct cmd_list_element *togglelist;
+
+/* Chain containing all defined stop subcommands. */
+
+extern struct cmd_list_element *stoplist;
+
+/* Chain containing all defined "enable breakpoint" subcommands. */
+
+extern struct cmd_list_element *enablebreaklist;
+
+/* Chain containing all defined set subcommands */
+
+extern struct cmd_list_element *setlist;
+
+/* Chain containing all defined unset subcommands */
+
+extern struct cmd_list_element *unsetlist;
+
+/* Chain containing all defined show subcommands. */
+
+extern struct cmd_list_element *showlist;
+
+/* Chain containing all defined \"set history\". */
+
+extern struct cmd_list_element *sethistlist;
+
+/* Chain containing all defined \"show history\". */
+
+extern struct cmd_list_element *showhistlist;
+
+/* Chain containing all defined \"unset history\". */
+
+extern struct cmd_list_element *unsethistlist;
+
+/* Chain containing all defined maintenance subcommands. */
+
+extern struct cmd_list_element *maintenancelist;
+
+/* Chain containing all defined "maintenance info" subcommands. */
+
+extern struct cmd_list_element *maintenanceinfolist;
+
+/* Chain containing all defined "maintenance print" subcommands. */
+
+extern struct cmd_list_element *maintenanceprintlist;
+
+extern struct cmd_list_element *setprintlist;
+
+extern struct cmd_list_element *showprintlist;
+
+extern struct cmd_list_element *setdebuglist;
+
+extern struct cmd_list_element *showdebuglist;
+
+extern struct cmd_list_element *setchecklist;
+
+extern struct cmd_list_element *showchecklist;
+
+/* Exported to gdb/top.c */
+
+void init_cmd_lists (void);
+
+void init_cli_cmds (void);
+
+int is_complete_command (struct cmd_list_element *cmd);
+
+/* Exported to gdb/main.c */
+
+extern void cd_command (char *, int);
+
+/* Exported to gdb/top.c and gdb/main.c */
+
+extern void quit_command (char *, int);
+
+extern void source_command (char *, int);
+
+/* Used everywhere whenever at least one parameter is required and
+ none is specified. */
+
+extern NORETURN void error_no_arg (char *) ATTR_NORETURN;
+
+#endif /* !defined (CLI_CMDS_H) */
diff --git a/contrib/gdb/gdb/cli/cli-decode.c b/contrib/gdb/gdb/cli/cli-decode.c
new file mode 100644
index 0000000..a13b7b8
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-decode.c
@@ -0,0 +1,1409 @@
+/* Handle lists of commands, their decoding and documentation, for GDB.
+
+ Copyright 1986, 1989, 1990, 1991, 1998, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "symtab.h"
+#include <ctype.h>
+#include "gdb_regex.h"
+
+#include "ui-out.h"
+
+#include "cli/cli-cmds.h"
+#include "cli/cli-decode.h"
+
+/* Prototypes for local functions */
+
+static void undef_cmd_error (char *, char *);
+
+static struct cmd_list_element *find_cmd (char *command,
+ int len,
+ struct cmd_list_element *clist,
+ int ignore_help_classes,
+ int *nfound);
+
+static void help_all (struct ui_file *stream);
+
+/* Set the callback function for the specified command. For each both
+ the commands callback and func() are set. The latter set to a
+ bounce function (unless cfunc / sfunc is NULL that is). */
+
+static void
+do_cfunc (struct cmd_list_element *c, char *args, int from_tty)
+{
+ c->function.cfunc (args, from_tty); /* Ok. */
+}
+
+void
+set_cmd_cfunc (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty))
+{
+ if (cfunc == NULL)
+ cmd->func = NULL;
+ else
+ cmd->func = do_cfunc;
+ cmd->function.cfunc = cfunc; /* Ok. */
+}
+
+static void
+do_sfunc (struct cmd_list_element *c, char *args, int from_tty)
+{
+ c->function.sfunc (args, from_tty, c); /* Ok. */
+}
+
+void
+set_cmd_sfunc (struct cmd_list_element *cmd,
+ void (*sfunc) (char *args, int from_tty,
+ struct cmd_list_element * c))
+{
+ if (sfunc == NULL)
+ cmd->func = NULL;
+ else
+ cmd->func = do_sfunc;
+ cmd->function.sfunc = sfunc; /* Ok. */
+}
+
+int
+cmd_cfunc_eq (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty))
+{
+ return cmd->func == do_cfunc && cmd->function.cfunc == cfunc;
+}
+
+
+/* Add element named NAME.
+ CLASS is the top level category into which commands are broken down
+ for "help" purposes.
+ FUN should be the function to execute the command;
+ it will get a character string as argument, with leading
+ and trailing blanks already eliminated.
+
+ DOC is a documentation string for the command.
+ Its first line should be a complete sentence.
+ It should start with ? for a command that is an abbreviation
+ or with * for a command that most users don't need to know about.
+
+ Add this command to command list *LIST.
+
+ Returns a pointer to the added command (not necessarily the head
+ of *LIST). */
+
+struct cmd_list_element *
+add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+ char *doc, 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 *p;
+
+ delete_cmd (name, list);
+
+ if (*list == NULL || strcmp ((*list)->name, name) >= 0)
+ {
+ c->next = *list;
+ *list = c;
+ }
+ else
+ {
+ p = *list;
+ while (p->next && strcmp (p->next->name, name) <= 0)
+ {
+ p = p->next;
+ }
+ c->next = p->next;
+ p->next = c;
+ }
+
+ c->name = name;
+ c->class = class;
+ set_cmd_cfunc (c, fun);
+ c->doc = doc;
+ c->flags = 0;
+ c->replacement = NULL;
+ c->pre_show_hook = NULL;
+ c->hook_pre = NULL;
+ c->hook_post = NULL;
+ c->hook_in = 0;
+ c->prefixlist = NULL;
+ c->prefixname = NULL;
+ c->allow_unknown = 0;
+ c->abbrev_flag = 0;
+ c->completer = make_symbol_completion_list;
+ c->type = not_set_cmd;
+ c->var = NULL;
+ c->var_type = var_boolean;
+ c->enums = NULL;
+ c->user_commands = NULL;
+ c->hookee_pre = NULL;
+ c->hookee_post = NULL;
+ c->cmd_pointer = NULL;
+
+ return c;
+}
+
+/* Same as above, except that the abbrev_flag is set. */
+/* Note: Doesn't seem to be used anywhere currently. */
+
+struct cmd_list_element *
+add_abbrev_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+ char *doc, struct cmd_list_element **list)
+{
+ register struct cmd_list_element *c
+ = add_cmd (name, class, fun, doc, list);
+
+ c->abbrev_flag = 1;
+ return c;
+}
+
+/* Deprecates a command CMD.
+ REPLACEMENT is the name of the command which should be used in place
+ of this command, or NULL if no such command exists.
+
+ This function does not check to see if command REPLACEMENT exists
+ since gdb may not have gotten around to adding REPLACEMENT when this
+ function is called.
+
+ Returns a pointer to the deprecated command. */
+
+struct cmd_list_element *
+deprecate_cmd (struct cmd_list_element *cmd, char *replacement)
+{
+ cmd->flags |= (CMD_DEPRECATED | DEPRECATED_WARN_USER);
+
+ if (replacement != NULL)
+ cmd->replacement = replacement;
+ else
+ cmd->replacement = NULL;
+
+ return cmd;
+}
+
+struct cmd_list_element *
+add_alias_cmd (char *name, char *oldname, enum command_class class,
+ int abbrev_flag, struct cmd_list_element **list)
+{
+ /* Must do this since lookup_cmd tries to side-effect its first arg */
+ char *copied_name;
+ register struct cmd_list_element *old;
+ 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);
+
+ if (old == 0)
+ {
+ delete_cmd (name, list);
+ return 0;
+ }
+
+ c = add_cmd (name, class, NULL, old->doc, list);
+ /* NOTE: Both FUNC and all the FUNCTIONs need to be copied. */
+ c->func = old->func;
+ c->function = old->function;
+ c->prefixlist = old->prefixlist;
+ c->prefixname = old->prefixname;
+ c->allow_unknown = old->allow_unknown;
+ c->abbrev_flag = abbrev_flag;
+ c->cmd_pointer = old;
+ return c;
+}
+
+/* Like add_cmd but adds an element for a command prefix:
+ a name that should be followed by a subcommand to be looked up
+ in another command list. PREFIXLIST should be the address
+ of the variable containing that list. */
+
+struct cmd_list_element *
+add_prefix_cmd (char *name, enum command_class class, void (*fun) (char *, int),
+ char *doc, struct cmd_list_element **prefixlist,
+ char *prefixname, int allow_unknown,
+ struct cmd_list_element **list)
+{
+ register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+ c->prefixlist = prefixlist;
+ c->prefixname = prefixname;
+ c->allow_unknown = allow_unknown;
+ return c;
+}
+
+/* Like add_prefix_cmd but sets the abbrev_flag on the new command. */
+
+struct cmd_list_element *
+add_abbrev_prefix_cmd (char *name, enum command_class class,
+ void (*fun) (char *, int), char *doc,
+ struct cmd_list_element **prefixlist, char *prefixname,
+ int allow_unknown, struct cmd_list_element **list)
+{
+ register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+ c->prefixlist = prefixlist;
+ c->prefixname = prefixname;
+ c->allow_unknown = allow_unknown;
+ c->abbrev_flag = 1;
+ return c;
+}
+
+/* This is an empty "cfunc". */
+void
+not_just_help_class_command (char *args, int from_tty)
+{
+}
+
+/* This is an empty "sfunc". */
+static void empty_sfunc (char *, int, struct cmd_list_element *);
+
+static void
+empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
+{
+}
+
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ CLASS is as in add_cmd.
+ VAR_TYPE is the kind of thing we are setting.
+ VAR is address of the variable being controlled by this command.
+ DOC is the documentation string. */
+
+struct cmd_list_element *
+add_set_cmd (char *name,
+ enum command_class class,
+ var_types var_type,
+ void *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ struct cmd_list_element *c = add_cmd (name, class, NULL, doc, list);
+
+ c->type = set_cmd;
+ c->var_type = var_type;
+ c->var = var;
+ /* This needs to be something besides NULL so that this isn't
+ treated as a help class. */
+ set_cmd_sfunc (c, empty_sfunc);
+ return c;
+}
+
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ 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).
+ DOC is the documentation string. */
+
+struct cmd_list_element *
+add_set_enum_cmd (char *name,
+ enum command_class class,
+ const char *enumlist[],
+ const char **var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ struct cmd_list_element *c
+ = add_set_cmd (name, class, var_enum, var, doc, list);
+ c->enums = enumlist;
+
+ return c;
+}
+
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ CLASS is as in add_cmd.
+ VAR is address of the variable which will contain the value.
+ DOC is the documentation string. */
+struct cmd_list_element *
+add_set_auto_boolean_cmd (char *name,
+ enum command_class class,
+ enum cmd_auto_boolean *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ static const char *auto_boolean_enums[] = { "on", "off", "auto", NULL };
+ struct cmd_list_element *c;
+ c = add_set_cmd (name, class, var_auto_boolean, var, doc, list);
+ c->enums = auto_boolean_enums;
+ return c;
+}
+
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ CLASS is as in add_cmd.
+ VAR is address of the variable which will contain the value.
+ DOC is the documentation string. */
+struct cmd_list_element *
+add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ static const char *boolean_enums[] = { "on", "off", NULL };
+ struct cmd_list_element *c;
+ c = add_set_cmd (name, class, var_boolean, var, doc, list);
+ c->enums = boolean_enums;
+ return c;
+}
+
+/* Where SETCMD has already been added, add the corresponding show
+ command to LIST and return a pointer to the added command (not
+ necessarily the head of LIST). */
+struct cmd_list_element *
+add_show_from_set (struct cmd_list_element *setcmd,
+ struct cmd_list_element **list)
+{
+ struct cmd_list_element *showcmd =
+ (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)
+ {
+ showcmd->next = *list;
+ *list = showcmd;
+ }
+ else
+ {
+ p = *list;
+ while (p->next && strcmp (p->next->name, showcmd->name) <= 0)
+ {
+ p = p->next;
+ }
+ showcmd->next = p->next;
+ p->next = showcmd;
+ }
+
+ return showcmd;
+}
+
+/* Remove the command named NAME from the command list. */
+
+void
+delete_cmd (char *name, struct cmd_list_element **list)
+{
+ register struct cmd_list_element *c;
+ struct cmd_list_element *p;
+
+ while (*list && STREQ ((*list)->name, name))
+ {
+ if ((*list)->hookee_pre)
+ (*list)->hookee_pre->hook_pre = 0; /* Hook slips out of its mouth */
+ if ((*list)->hookee_post)
+ (*list)->hookee_post->hook_post = 0; /* Hook slips out of its bottom */
+ p = (*list)->next;
+ xfree (* list);
+ *list = p;
+ }
+
+ if (*list)
+ for (c = *list; c->next;)
+ {
+ if (STREQ (c->next->name, name))
+ {
+ if (c->next->hookee_pre)
+ c->next->hookee_pre->hook_pre = 0; /* hooked cmd gets away. */
+ if (c->next->hookee_post)
+ c->next->hookee_post->hook_post = 0; /* remove post hook */
+ /* :( no fishing metaphore */
+ p = c->next->next;
+ xfree (c->next);
+ c->next = p;
+ }
+ else
+ c = c->next;
+ }
+}
+
+/* Shorthands to the commands above. */
+
+/* Add an element to the list of info subcommands. */
+
+struct cmd_list_element *
+add_info (char *name, void (*fun) (char *, int), char *doc)
+{
+ return add_cmd (name, no_class, fun, doc, &infolist);
+}
+
+/* Add an alias to the list of info subcommands. */
+
+struct cmd_list_element *
+add_info_alias (char *name, char *oldname, int abbrev_flag)
+{
+ return add_alias_cmd (name, oldname, 0, abbrev_flag, &infolist);
+}
+
+/* Add an element to the list of commands. */
+
+struct cmd_list_element *
+add_com (char *name, enum command_class class, void (*fun) (char *, int),
+ char *doc)
+{
+ return add_cmd (name, class, fun, doc, &cmdlist);
+}
+
+/* Add an alias or abbreviation command to the list of commands. */
+
+struct cmd_list_element *
+add_com_alias (char *name, char *oldname, enum command_class class,
+ int abbrev_flag)
+{
+ return add_alias_cmd (name, oldname, class, abbrev_flag, &cmdlist);
+}
+
+/* Recursively walk the commandlist structures, and print out the
+ documentation of commands that match our regex in either their
+ name, or their documentation.
+*/
+void
+apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist,
+ struct re_pattern_buffer *regex, char *prefix)
+{
+ register struct cmd_list_element *c;
+ int returnvalue=1; /*Needed to avoid double printing*/
+ /* Walk through the commands */
+ for (c=commandlist;c;c=c->next)
+ {
+ if (c->name != NULL)
+ {
+ /* Try to match against the name*/
+ returnvalue=re_search(regex,c->name,strlen(c->name),0,strlen(c->name),NULL);
+ if (returnvalue >= 0)
+ {
+ /* Stolen from help_cmd_list. We don't directly use
+ * help_cmd_list because it doesn't let us print out
+ * single commands
+ */
+ fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
+ print_doc_line (stream, c->doc);
+ fputs_filtered ("\n", stream);
+ returnvalue=0; /*Set this so we don't print it again.*/
+ }
+ }
+ if (c->doc != NULL && returnvalue != 0)
+ {
+ /* Try to match against documentation */
+ if (re_search(regex,c->doc,strlen(c->doc),0,strlen(c->doc),NULL) >=0)
+ {
+ /* Stolen from help_cmd_list. We don't directly use
+ * help_cmd_list because it doesn't let us print out
+ * single commands
+ */
+ fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
+ print_doc_line (stream, c->doc);
+ fputs_filtered ("\n", stream);
+ }
+ }
+ /* Check if this command has subcommands */
+ if (c->prefixlist != NULL)
+ {
+ /* Recursively call ourselves on the subcommand list,
+ passing the right prefix in.
+ */
+ apropos_cmd (stream,*c->prefixlist,regex,c->prefixname);
+ }
+ }
+}
+
+/* This command really has to deal with two things:
+ * 1) I want documentation on *this string* (usually called by
+ * "help commandname").
+ * 2) I want documentation on *this list* (usually called by
+ * giving a command that requires subcommands. Also called by saying
+ * just "help".)
+ *
+ * I am going to split this into two seperate comamnds, help_cmd and
+ * help_list.
+ */
+
+void
+help_cmd (char *command, struct ui_file *stream)
+{
+ struct cmd_list_element *c;
+ extern struct cmd_list_element *cmdlist;
+
+ if (!command)
+ {
+ help_list (cmdlist, "", all_classes, stream);
+ return;
+ }
+
+ if (strcmp (command, "all") == 0)
+ {
+ help_all (stream);
+ return;
+ }
+
+ c = lookup_cmd (&command, cmdlist, "", 0, 0);
+
+ if (c == 0)
+ return;
+
+ /* There are three cases here.
+ If c->prefixlist is nonzero, we have a prefix command.
+ Print its documentation, then list its subcommands.
+
+ If c->func is non NULL, we really have a command. Print its
+ documentation and return.
+
+ If c->func is NULL, we have a class name. Print its
+ documentation (as if it were a command) and then set class to the
+ number of this class so that the commands in the class will be
+ listed. */
+
+ fputs_filtered (c->doc, stream);
+ fputs_filtered ("\n", stream);
+
+ if (c->prefixlist == 0 && c->func != NULL)
+ return;
+ fprintf_filtered (stream, "\n");
+
+ /* If this is a prefix command, print it's subcommands */
+ if (c->prefixlist)
+ help_list (*c->prefixlist, c->prefixname, all_commands, stream);
+
+ /* If this is a class name, print all of the commands in the class */
+ if (c->func == NULL)
+ help_list (cmdlist, "", c->class, stream);
+
+ if (c->hook_pre || c->hook_post)
+ fprintf_filtered (stream,
+ "\nThis command has a hook (or hooks) defined:\n");
+
+ if (c->hook_pre)
+ fprintf_filtered (stream,
+ "\tThis command is run after : %s (pre hook)\n",
+ c->hook_pre->name);
+ if (c->hook_post)
+ fprintf_filtered (stream,
+ "\tThis command is run before : %s (post hook)\n",
+ c->hook_post->name);
+}
+
+/*
+ * Get a specific kind of help on a command list.
+ *
+ * LIST is the list.
+ * CMDTYPE is the prefix to use in the title string.
+ * CLASS is the class with which to list the nodes of this list (see
+ * documentation for help_cmd_list below), As usual, ALL_COMMANDS for
+ * everything, ALL_CLASSES for just classes, and non-negative for only things
+ * in a specific class.
+ * and STREAM is the output stream on which to print things.
+ * If you call this routine with a class >= 0, it recurses.
+ */
+void
+help_list (struct cmd_list_element *list, char *cmdtype,
+ enum command_class class, struct ui_file *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);
+ cmdtype1[0] = 0;
+ cmdtype2 = (char *) alloca (len + 4);
+ cmdtype2[0] = 0;
+ if (len)
+ {
+ cmdtype1[0] = ' ';
+ strncpy (cmdtype1 + 1, cmdtype, len - 1);
+ cmdtype1[len] = 0;
+ strncpy (cmdtype2, cmdtype, len - 1);
+ strcpy (cmdtype2 + len - 1, " sub");
+ }
+
+ if (class == all_classes)
+ fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
+ else
+ fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
+
+ 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);
+
+ 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);
+}
+
+static void
+help_all (struct ui_file *stream)
+{
+ struct cmd_list_element *c;
+ extern struct cmd_list_element *cmdlist;
+
+ for (c = cmdlist; c; c = c->next)
+ {
+ if (c->abbrev_flag)
+ continue;
+ /* If this is a prefix command, print it's subcommands */
+ if (c->prefixlist)
+ help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 0, stream);
+
+ /* If this is a class name, print all of the commands in the class */
+ else if (c->func == NULL)
+ help_cmd_list (cmdlist, c->class, "", 0, stream);
+ }
+}
+
+/* Print only the first line of STR on STREAM. */
+void
+print_doc_line (struct ui_file *stream, char *str)
+{
+ static char *line_buffer = 0;
+ static int line_size;
+ register char *p;
+
+ if (!line_buffer)
+ {
+ line_size = 80;
+ line_buffer = (char *) xmalloc (line_size);
+ }
+
+ p = str;
+ while (*p && *p != '\n' && *p != '.' && *p != ',')
+ p++;
+ if (p - str > line_size - 1)
+ {
+ line_size = p - str + 1;
+ xfree (line_buffer);
+ line_buffer = (char *) xmalloc (line_size);
+ }
+ strncpy (line_buffer, str, p - str);
+ line_buffer[p - str] = '\0';
+ if (islower (line_buffer[0]))
+ line_buffer[0] = toupper (line_buffer[0]);
+ ui_out_text (uiout, line_buffer);
+}
+
+/*
+ * Implement a help command on command list LIST.
+ * RECURSE should be non-zero if this should be done recursively on
+ * all sublists of LIST.
+ * 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
+ * class.
+ * 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
+ * is at the low level, not the high-level).
+ */
+void
+help_cmd_list (struct cmd_list_element *list, enum command_class class,
+ char *prefix, int recurse, struct ui_file *stream)
+{
+ register struct cmd_list_element *c;
+
+ for (c = list; c; c = c->next)
+ {
+ if (c->abbrev_flag == 0 &&
+ (class == all_commands
+ || (class == all_classes && c->func == NULL)
+ || (class == c->class && c->func != NULL)))
+ {
+ fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
+ print_doc_line (stream, c->doc);
+ fputs_filtered ("\n", stream);
+ }
+ if (recurse
+ && c->prefixlist != 0
+ && c->abbrev_flag == 0)
+ help_cmd_list (*c->prefixlist, class, c->prefixname, 1, stream);
+ }
+}
+
+
+/* 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 (char *command, int len, struct cmd_list_element *clist,
+ int ignore_help_classes, int *nfound)
+{
+ struct cmd_list_element *found, *c;
+
+ 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->func))
+ {
+ found = c;
+ (*nfound)++;
+ if (c->name[len] == '\0')
+ {
+ *nfound = 1;
+ break;
+ }
+ }
+ return found;
+}
+
+/* This routine takes a line of TEXT and a CLIST in which to start the
+ lookup. When it returns it will have incremented the text pointer past
+ the section of text it matched, set *RESULT_LIST to point to the list in
+ which the last word was matched, and will return a pointer to the cmd
+ list element which the text matches. It will return NULL if no match at
+ all was possible. It will return -1 (cast appropriately, ick) if ambigous
+ matches are possible; in this case *RESULT_LIST will be set to point to
+ the list in which there are ambiguous choices (and *TEXT will be set to
+ the ambiguous text string).
+
+ If the located command was an abbreviation, this routine returns the base
+ command of the abbreviation.
+
+ It does no error reporting whatsoever; control will always return
+ to the superior routine.
+
+ In the case of an ambiguous return (-1), *RESULT_LIST will be set to point
+ at the prefix_command (ie. the best match) *or* (special case) will be NULL
+ if no prefix command was ever found. For example, in the case of "info a",
+ "info" matches without ambiguity, but "a" could be "args" or "address", so
+ *RESULT_LIST is set to the cmd_list_element for "info". So in this case
+ RESULT_LIST should not be interpeted as a pointer to the beginning of a
+ list; it simply points to a specific command. In the case of an ambiguous
+ return *TEXT is advanced past the last non-ambiguous prefix (e.g.
+ "info t" can be "info types" or "info target"; upon return *TEXT has been
+ advanced past "info ").
+
+ If RESULT_LIST is NULL, don't set *RESULT_LIST (but don't otherwise
+ 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). */
+
+struct cmd_list_element *
+lookup_cmd_1 (char **text, struct cmd_list_element *clist,
+ struct cmd_list_element **result_list, int ignore_help_classes)
+{
+ char *p, *command;
+ int len, tmp, nfound;
+ struct cmd_list_element *found, *c;
+ char *line = *text;
+
+ while (**text == ' ' || **text == '\t')
+ (*text)++;
+
+ /* Treating underscores as part of command words is important
+ so that "set args_foo()" doesn't get interpreted as
+ "set args _foo()". */
+ for (p = *text;
+ *p && (isalnum (*p) || *p == '-' || *p == '_' ||
+ (tui_version &&
+ (*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
+ (xdb_commands && (*p == '!' || *p == '/' || *p == '?')));
+ p++)
+ ;
+
+ /* 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
+ it's length is len). We copy this into a local temporary */
+
+
+ command = (char *) alloca (len + 1);
+ for (tmp = 0; tmp < len; tmp++)
+ {
+ char x = (*text)[tmp];
+ command[tmp] = x;
+ }
+ command[len] = '\0';
+
+ /* Look it up. */
+ found = 0;
+ nfound = 0;
+ 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.
+ */
+ 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);
+ }
+
+ /* If nothing matches, we have a simple failure. */
+ if (nfound == 0)
+ return 0;
+
+ if (nfound > 1)
+ {
+ 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. */
+ }
+
+ /* We've matched something on this list. Move text pointer forward. */
+
+ *text = p;
+
+ if (found->cmd_pointer)
+ {
+ /* We drop the alias (abbreviation) in favor of the command it is
+ pointing to. If the alias is deprecated, though, we need to
+ warn the user about it before we drop it. Note that while we
+ are warning about the alias, we may also warn about the command
+ itself and we will adjust the appropriate DEPRECATED_WARN_USER
+ flags */
+
+ if (found->flags & DEPRECATED_WARN_USER)
+ deprecated_cmd_warning (&line);
+ found = found->cmd_pointer;
+ }
+ /* If we found a prefix command, keep looking. */
+
+ if (found->prefixlist)
+ {
+ c = lookup_cmd_1 (text, *found->prefixlist, result_list,
+ ignore_help_classes);
+ if (!c)
+ {
+ /* Didn't find anything; this is as far as we got. */
+ if (result_list != NULL)
+ *result_list = clist;
+ return found;
+ }
+ else if (c == (struct cmd_list_element *) -1)
+ {
+ /* We've gotten this far properly, but the next step
+ is ambiguous. We need to set the result list to the best
+ we've found (if an inferior hasn't already set it). */
+ 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. */
+ *result_list = found;
+ return c;
+ }
+ else
+ {
+ /* We matched! */
+ return c;
+ }
+ }
+ else
+ {
+ if (result_list != NULL)
+ *result_list = clist;
+ return found;
+ }
+}
+
+/* All this hair to move the space to the front of cmdtype */
+
+static void
+undef_cmd_error (char *cmdtype, char *q)
+{
+ error ("Undefined %scommand: \"%s\". Try \"help%s%.*s\".",
+ cmdtype,
+ q,
+ *cmdtype ? " " : "",
+ strlen (cmdtype) - 1,
+ cmdtype);
+}
+
+/* Look up the contents of *LINE as a command in the command list LIST.
+ LIST is a chain of struct cmd_list_element's.
+ If it is found, return the struct cmd_list_element for that command
+ and update *LINE to point after the command name, at the first argument.
+ If not found, call error if ALLOW_UNKNOWN is zero
+ otherwise (or if error returns) return zero.
+ Call error if specified command is ambiguous,
+ unless ALLOW_UNKNOWN is negative.
+ CMDTYPE precedes the word "command" in the error message.
+
+ If INGNORE_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 0). */
+
+struct cmd_list_element *
+lookup_cmd (char **line, struct cmd_list_element *list, char *cmdtype,
+ int allow_unknown, int 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);
+
+ /* Note: Do not remove trailing whitespace here because this
+ would be wrong for complete_command. Jim Kingdon */
+
+ if (!c)
+ {
+ if (!allow_unknown)
+ {
+ if (!*line)
+ error ("Lack of needed %scommand", cmdtype);
+ else
+ {
+ char *p = *line, *q;
+
+ while (isalnum (*p) || *p == '-')
+ p++;
+
+ q = (char *) alloca (p - *line + 1);
+ strncpy (q, *line, p - *line);
+ q[p - *line] = '\0';
+ undef_cmd_error (cmdtype, q);
+ }
+ }
+ else
+ return 0;
+ }
+ else if (c == (struct cmd_list_element *) -1)
+ {
+ /* Ambigous. Local values should be off prefixlist or called
+ 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);
+
+ if (local_allow_unknown < 0)
+ {
+ if (last_list)
+ return last_list; /* Found something. */
+ else
+ return 0; /* Found nothing. */
+ }
+ else
+ {
+ /* Report as error. */
+ int amb_len;
+ char ambbuf[100];
+
+ for (amb_len = 0;
+ ((*line)[amb_len] && (*line)[amb_len] != ' '
+ && (*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))
+ strcat (ambbuf, ", ");
+ strcat (ambbuf, c->name);
+ }
+ else
+ {
+ strcat (ambbuf, "..");
+ break;
+ }
+ }
+ error ("Ambiguous %scommand \"%s\": %s.", local_cmdtype,
+ *line, ambbuf);
+ return 0; /* lint */
+ }
+ }
+ else
+ {
+ /* We've got something. It may still not be what the caller
+ wants (if this command *needs* a subcommand). */
+ while (**line == ' ' || **line == '\t')
+ (*line)++;
+
+ if (c->prefixlist && **line && !c->allow_unknown)
+ undef_cmd_error (c->prefixname, *line);
+
+ /* Seems to be what he wants. Return it. */
+ return c;
+ }
+ return 0;
+}
+
+/* We are here presumably because an alias or command in *TEXT is
+ deprecated and a warning message should be generated. This function
+ decodes *TEXT and potentially generates a warning message as outlined
+ below.
+
+ Example for 'set endian big' which has a fictitious alias 'seb'.
+
+ If alias wasn't used in *TEXT, and the command is deprecated:
+ "warning: 'set endian big' is deprecated."
+
+ If alias was used, and only the alias is deprecated:
+ "warning: 'seb' an alias for the command 'set endian big' is deprecated."
+
+ If alias was used and command is deprecated (regardless of whether the
+ alias itself is deprecated:
+
+ "warning: 'set endian big' (seb) is deprecated."
+
+ After the message has been sent, clear the appropriate flags in the
+ command and/or the alias so the user is no longer bothered.
+
+*/
+void
+deprecated_cmd_warning (char **text)
+{
+ struct cmd_list_element *alias = NULL;
+ struct cmd_list_element *prefix_cmd = NULL;
+ struct cmd_list_element *cmd = NULL;
+ struct cmd_list_element *c;
+ char *type;
+
+ if (!lookup_cmd_composition (*text, &alias, &prefix_cmd, &cmd))
+ /* return if text doesn't evaluate to a command */
+ return;
+
+ if (!((alias ? (alias->flags & DEPRECATED_WARN_USER) : 0)
+ || (cmd->flags & DEPRECATED_WARN_USER) ) )
+ /* return if nothing is deprecated */
+ return;
+
+ printf_filtered ("Warning:");
+
+ if (alias && !(cmd->flags & CMD_DEPRECATED))
+ printf_filtered (" '%s', an alias for the", alias->name);
+
+ printf_filtered (" command '");
+
+ if (prefix_cmd)
+ printf_filtered ("%s", prefix_cmd->prefixname);
+
+ printf_filtered ("%s", cmd->name);
+
+ if (alias && (cmd->flags & CMD_DEPRECATED))
+ printf_filtered ("' (%s) is deprecated.\n", alias->name);
+ else
+ printf_filtered ("' is deprecated.\n");
+
+
+ /* if it is only the alias that is deprecated, we want to indicate the
+ new alias, otherwise we'll indicate the new command */
+
+ if (alias && !(cmd->flags & CMD_DEPRECATED))
+ {
+ if (alias->replacement)
+ printf_filtered ("Use '%s'.\n\n", alias->replacement);
+ else
+ printf_filtered ("No alternative known.\n\n");
+ }
+ else
+ {
+ if (cmd->replacement)
+ printf_filtered ("Use '%s'.\n\n", cmd->replacement);
+ else
+ printf_filtered ("No alternative known.\n\n");
+ }
+
+ /* We've warned you, now we'll keep quiet */
+ if (alias)
+ alias->flags &= ~DEPRECATED_WARN_USER;
+
+ cmd->flags &= ~DEPRECATED_WARN_USER;
+}
+
+
+
+/* Look up the contents of LINE as a command in the command list 'cmdlist'.
+ Return 1 on success, 0 on failure.
+
+ If LINE refers to an alias, *alias will point to that alias.
+
+ If LINE is a postfix command (i.e. one that is preceeded by a prefix
+ command) set *prefix_cmd.
+
+ Set *cmd to point to the command LINE indicates.
+
+ If any of *alias, *prefix_cmd, or *cmd cannot be determined or do not
+ exist, they are NULL when we return.
+
+*/
+int
+lookup_cmd_composition (char *text,
+ struct cmd_list_element **alias,
+ struct cmd_list_element **prefix_cmd,
+ struct cmd_list_element **cmd)
+{
+ char *p, *command;
+ int len, tmp, nfound;
+ struct cmd_list_element *cur_list;
+ struct cmd_list_element *prev_cmd;
+ *alias = NULL;
+ *prefix_cmd = NULL;
+ *cmd = NULL;
+
+ cur_list = cmdlist;
+
+ while (1)
+ {
+ /* Go through as many command lists as we need to
+ to find the command TEXT refers to. */
+
+ prev_cmd = *cmd;
+
+ while (*text == ' ' || *text == '\t')
+ (text)++;
+
+ /* Treating underscores as part of command words is important
+ so that "set args_foo()" doesn't get interpreted as
+ "set args _foo()". */
+ for (p = text;
+ *p && (isalnum (*p) || *p == '-' || *p == '_' ||
+ (tui_version &&
+ (*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
+ (xdb_commands && (*p == '!' || *p == '/' || *p == '?')));
+ p++)
+ ;
+
+ /* If nothing but whitespace, return. */
+ if (p == text)
+ return 0;
+
+ len = p - text;
+
+ /* text and p now bracket the first command word to lookup (and
+ it's length is len). We copy this into a local temporary */
+
+ command = (char *) alloca (len + 1);
+ for (tmp = 0; tmp < len; tmp++)
+ {
+ char x = text[tmp];
+ command[tmp] = x;
+ }
+ command[len] = '\0';
+
+ /* Look it up. */
+ *cmd = 0;
+ nfound = 0;
+ *cmd = find_cmd (command, len, cur_list, 1, &nfound);
+
+ /* We didn't find the command in the entered case, so lower case it
+ and search again.
+ */
+ if (!*cmd || nfound == 0)
+ {
+ for (tmp = 0; tmp < len; tmp++)
+ {
+ char x = command[tmp];
+ command[tmp] = isupper (x) ? tolower (x) : x;
+ }
+ *cmd = find_cmd (command, len, cur_list, 1, &nfound);
+ }
+
+ if (*cmd == (struct cmd_list_element *) -1)
+ {
+ return 0; /* ambiguous */
+ }
+
+ if (*cmd == NULL)
+ return 0; /* nothing found */
+ else
+ {
+ if ((*cmd)->cmd_pointer)
+ {
+ /* cmd was actually an alias, we note that an alias was used
+ (by assigning *alais) and we set *cmd.
+ */
+ *alias = *cmd;
+ *cmd = (*cmd)->cmd_pointer;
+ }
+ *prefix_cmd = prev_cmd;
+ }
+ if ((*cmd)->prefixlist)
+ cur_list = *(*cmd)->prefixlist;
+ else
+ return 1;
+
+ text = p;
+ }
+}
+
+/* Helper function for SYMBOL_COMPLETION_FUNCTION. */
+
+/* Return a vector of char pointers which point to the different
+ possible completions in LIST of TEXT.
+
+ WORD points in the same buffer as TEXT, and completions should be
+ 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 **
+complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
+{
+ struct cmd_list_element *ptr;
+ char **matchlist;
+ int sizeof_matchlist;
+ int matches;
+ int textlen = strlen (text);
+
+ sizeof_matchlist = 10;
+ matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
+ matches = 0;
+
+ for (ptr = list; ptr; ptr = ptr->next)
+ if (!strncmp (ptr->name, text, textlen)
+ && !ptr->abbrev_flag
+ && (ptr->func
+ || ptr->prefixlist))
+ {
+ if (matches == sizeof_matchlist)
+ {
+ sizeof_matchlist *= 2;
+ matchlist = (char **) xrealloc ((char *) matchlist,
+ (sizeof_matchlist
+ * sizeof (char *)));
+ }
+
+ matchlist[matches] = (char *)
+ xmalloc (strlen (word) + strlen (ptr->name) + 1);
+ if (word == text)
+ strcpy (matchlist[matches], ptr->name);
+ else if (word > text)
+ {
+ /* Return some portion of ptr->name. */
+ strcpy (matchlist[matches], ptr->name + (word - text));
+ }
+ else
+ {
+ /* Return some of text plus ptr->name. */
+ strncpy (matchlist[matches], word, text - word);
+ matchlist[matches][text - word] = '\0';
+ strcat (matchlist[matches], ptr->name);
+ }
+ ++matches;
+ }
+
+ if (matches == 0)
+ {
+ xfree (matchlist);
+ matchlist = 0;
+ }
+ else
+ {
+ matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
+ * sizeof (char *)));
+ matchlist[matches] = (char *) 0;
+ }
+
+ return matchlist;
+}
+
+/* Helper function for SYMBOL_COMPLETION_FUNCTION. */
+
+/* Return a vector of char pointers which point to the different
+ possible completions in CMD of TEXT.
+
+ WORD points in the same buffer as TEXT, and completions should be
+ 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 **
+complete_on_enum (const char *enumlist[],
+ char *text,
+ char *word)
+{
+ char **matchlist;
+ int sizeof_matchlist;
+ int matches;
+ int textlen = strlen (text);
+ int i;
+ const char *name;
+
+ sizeof_matchlist = 10;
+ matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
+ matches = 0;
+
+ for (i = 0; (name = enumlist[i]) != NULL; i++)
+ if (strncmp (name, text, textlen) == 0)
+ {
+ if (matches == sizeof_matchlist)
+ {
+ sizeof_matchlist *= 2;
+ matchlist = (char **) xrealloc ((char *) matchlist,
+ (sizeof_matchlist
+ * sizeof (char *)));
+ }
+
+ matchlist[matches] = (char *)
+ xmalloc (strlen (word) + strlen (name) + 1);
+ if (word == text)
+ strcpy (matchlist[matches], name);
+ else if (word > text)
+ {
+ /* Return some portion of name. */
+ strcpy (matchlist[matches], name + (word - text));
+ }
+ else
+ {
+ /* Return some of text plus name. */
+ strncpy (matchlist[matches], word, text - word);
+ matchlist[matches][text - word] = '\0';
+ strcat (matchlist[matches], name);
+ }
+ ++matches;
+ }
+
+ if (matches == 0)
+ {
+ xfree (matchlist);
+ matchlist = 0;
+ }
+ else
+ {
+ matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
+ * sizeof (char *)));
+ matchlist[matches] = (char *) 0;
+ }
+
+ return matchlist;
+}
+
diff --git a/contrib/gdb/gdb/cli/cli-decode.h b/contrib/gdb/gdb/cli/cli-decode.h
new file mode 100644
index 0000000..e4b7c55
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-decode.h
@@ -0,0 +1,385 @@
+/* Header file for GDB command decoding library.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (CLI_DECODE_H)
+#define CLI_DECODE_H 1
+
+#include "gdb_regex.h" /* Needed by apropos_cmd. */
+
+/* Command classes are top-level categories into which commands are broken
+ down for "help" purposes.
+ Notes on classes: class_alias is for alias commands which are not
+ abbreviations of the original command. class-pseudo is for
+ commands which are not really commands nor help topics ("stop"). */
+
+enum command_class
+{
+ /* Special args to help_list */
+ class_deprecated, all_classes = -2, all_commands = -1,
+ /* Classes of commands */
+ no_class = -1, class_run = 0, class_vars, class_stack,
+ class_files, class_support, class_info, class_breakpoint, class_trace,
+ class_alias, class_obscure, class_user, class_maintenance,
+ class_pseudo, class_tui, class_xdb
+};
+
+/* 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;
+
+/* Reasonable values for an AUTO_BOOLEAN variable. */
+enum cmd_auto_boolean
+{
+ CMD_AUTO_BOOLEAN_TRUE,
+ CMD_AUTO_BOOLEAN_FALSE,
+ CMD_AUTO_BOOLEAN_AUTO
+};
+
+/* Types of "set" or "show" command. */
+typedef enum var_types
+ {
+ /* "on" or "off". *VAR is an integer which is nonzero for on,
+ zero for off. */
+ var_boolean,
+
+ /* "on" / "true" / "enable" or "off" / "false" / "disable" or
+ "auto. *VAR is an ``enum cmd_auto_boolean''. NOTE: In general
+ a custom show command will need to be implemented - one that
+ for "auto" prints both the "auto" and the current auto-selected
+ value. */
+ var_auto_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. */
+
+
+/* This flag is used by the code executing commands to warn the user
+ the first time a deprecated command is used, see the 'flags' field in
+ the following struct.
+*/
+#define CMD_DEPRECATED 0x1
+#define DEPRECATED_WARN_USER 0x2
+#define MALLOCED_REPLACEMENT 0x4
+
+struct cmd_list_element
+ {
+ /* Points to next command in this list. */
+ struct cmd_list_element *next;
+
+ /* Name of this command. */
+ char *name;
+
+ /* Command class; class values are chosen by application program. */
+ enum command_class class;
+
+ /* Function definition of this command. NULL for command class
+ names and for help topics that are not really commands. NOTE:
+ cagney/2002-02-02: This function signature is evolving. For
+ the moment suggest sticking with either set_cmd_cfunc() or
+ set_cmd_sfunc(). */
+ void (*func) (struct cmd_list_element *c, char *args, int from_tty);
+ /* The command's real callback. At present func() bounces through
+ to one of the below. */
+ union
+ {
+ /* If type is not_set_cmd, call it like this: */
+ void (*cfunc) (char *args, int from_tty);
+
+ /* If type is set_cmd or show_cmd, first set the variables, and
+ then call this. */
+ void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c);
+ }
+ function;
+
+ /* Documentation of this command (or help topic).
+ First line is brief documentation; remaining lines form, with it,
+ the full documentation. First line should end with a period.
+ Entire string should also end with a period, not a newline. */
+ char *doc;
+
+ /* flags : a bitfield
+
+ bit 0: (LSB) CMD_DEPRECATED, when 1 indicated that this command
+ is deprecated. It may be removed from gdb's command set in the
+ future.
+
+ bit 1: DEPRECATED_WARN_USER, the user needs to be warned that
+ this is a deprecated command. The user should only be warned
+ the first time a command is used.
+
+ bit 2: MALLOCED_REPLACEMENT, when functions are deprecated at
+ compile time (this is the way it should, in general, be done)
+ the memory containing the replacement string is statically
+ allocated. In some cases it makes sense to deprecate commands
+ at runtime (the testsuite is one example). In this case the
+ memory for replacement is malloc'ed. When a command is
+ undeprecated or re-deprecated at runtime we don't want to risk
+ calling free on statically allocated memory, so we check this
+ flag.
+ */
+ int flags;
+
+ /* if this command is deprecated, this is the replacement name */
+ char *replacement;
+
+ /* If this command represents a show command, then this function
+ is called before the variable's value is examined. */
+ void (*pre_show_hook) (struct cmd_list_element *c);
+
+ /* Hook for another command to be executed before this command. */
+ struct cmd_list_element *hook_pre;
+
+ /* Hook for another command to be executed after this command. */
+ struct cmd_list_element *hook_post;
+
+ /* Flag that specifies if this command is already running it's hook. */
+ /* Prevents the possibility of hook recursion. */
+ int hook_in;
+
+ /* Nonzero identifies a prefix command. For them, the address
+ of the variable containing the list of subcommands. */
+ struct cmd_list_element **prefixlist;
+
+ /* For prefix commands only:
+ String containing prefix commands to get here: this one
+ plus any others needed to get to it. Should end in a space.
+ It is used before the word "command" in describing the
+ commands reached through this prefix. */
+ char *prefixname;
+
+ /* For prefix commands only:
+ nonzero means do not get an error if subcommand is not
+ recognized; call the prefix's own function in that case. */
+ char allow_unknown;
+
+ /* Nonzero says this is an abbreviation, and should not
+ be mentioned in lists of commands.
+ This allows "br<tab>" to complete to "break", which it
+ otherwise wouldn't. */
+ char abbrev_flag;
+
+ /* Completion routine for this command. TEXT is the text beyond
+ what was matched for the command itself (leading whitespace is
+ skipped). It stops where we are supposed to stop completing
+ (rl_point) and is '\0' terminated.
+
+ Return value is a malloc'd vector of pointers to possible completions
+ terminated with NULL. If there are no completions, returning a pointer
+ to a NULL would work but returning NULL itself is also valid.
+ WORD points in the same buffer as TEXT, and completions should be
+ 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) (char *text, char *word);
+
+ /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
+ or "show"). */
+ cmd_types type;
+
+ /* Pointer to variable affected by "set" and "show". Doesn't matter
+ if type is not_set. */
+ void *var;
+
+ /* What kind of variable is *VAR? */
+ var_types var_type;
+
+ /* Pointer to NULL terminated list of enumerated values (like argv). */
+ const char **enums;
+
+ /* Pointer to command strings of user-defined commands */
+ struct command_line *user_commands;
+
+ /* Pointer to command that is hooked by this one, (by hook_pre)
+ so the hook can be removed when this one is deleted. */
+ struct cmd_list_element *hookee_pre;
+
+ /* Pointer to command that is hooked by this one, (by hook_post)
+ so the hook can be removed when this one is deleted. */
+ struct cmd_list_element *hookee_post;
+
+ /* Pointer to command that is aliased by this one, so the
+ aliased command can be located in case it has been hooked. */
+ struct cmd_list_element *cmd_pointer;
+ };
+
+/* API to the manipulation of command lists. */
+
+extern struct cmd_list_element *add_cmd (char *, enum command_class,
+ void (*fun) (char *, int), char *,
+ struct cmd_list_element **);
+
+extern struct cmd_list_element *add_alias_cmd (char *, char *,
+ enum command_class, int,
+ struct cmd_list_element **);
+
+extern struct cmd_list_element *add_prefix_cmd (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 (char *,
+ enum command_class,
+ void (*fun) (char *,
+ int),
+ char *,
+ struct cmd_list_element
+ **, char *, int,
+ struct cmd_list_element
+ **);
+
+/* Set the commands corresponding callback. */
+
+extern void set_cmd_cfunc (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty));
+
+extern void set_cmd_sfunc (struct cmd_list_element *cmd,
+ void (*sfunc) (char *args, int from_tty,
+ struct cmd_list_element * c));
+
+/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
+ around in cmd objects to test the value of the commands sfunc(). */
+extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty));
+
+extern struct cmd_list_element *lookup_cmd (char **,
+ struct cmd_list_element *, char *,
+ int, int);
+
+extern struct cmd_list_element *lookup_cmd_1 (char **,
+ struct cmd_list_element *,
+ struct cmd_list_element **,
+ int);
+
+extern struct cmd_list_element *
+ deprecate_cmd (struct cmd_list_element *, char * );
+
+extern void
+ deprecated_cmd_warning (char **);
+
+extern int
+ lookup_cmd_composition (char *text,
+ struct cmd_list_element **alias,
+ struct cmd_list_element **prefix_cmd,
+ struct cmd_list_element **cmd);
+
+extern struct cmd_list_element *add_com (char *, enum command_class,
+ void (*fun) (char *, int), char *);
+
+extern struct cmd_list_element *add_com_alias (char *, char *,
+ enum command_class, int);
+
+extern struct cmd_list_element *add_info (char *, void (*fun) (char *, int),
+ char *);
+
+extern struct cmd_list_element *add_info_alias (char *, char *, int);
+
+extern char **complete_on_cmdlist (struct cmd_list_element *, char *, char *);
+
+extern char **complete_on_enum (const char *enumlist[], char *, char *);
+
+extern void delete_cmd (char *, struct cmd_list_element **);
+
+extern void help_cmd_list (struct cmd_list_element *, enum command_class,
+ char *, int, struct ui_file *);
+
+extern struct cmd_list_element *add_set_cmd (char *name, enum
+ command_class class,
+ var_types var_type, void *var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_set_enum_cmd (char *name,
+ enum command_class class,
+ const char *enumlist[],
+ const char **var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
+ enum command_class class,
+ enum cmd_auto_boolean *var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
+ struct cmd_list_element
+ **);
+
+/* Functions that implement commands about CLI commands. */
+
+extern void help_cmd (char *, struct ui_file *);
+
+extern void help_list (struct cmd_list_element *, char *,
+ enum command_class, struct ui_file *);
+
+extern void apropos_cmd (struct ui_file *, struct cmd_list_element *,
+ struct re_pattern_buffer *, char *);
+
+/* Used to mark commands that don't do anything. If we just leave the
+ function field NULL, the command is interpreted as a help topic, or
+ as a class of commands. */
+
+extern void not_just_help_class_command (char *arg, int from_tty);
+
+/* Exported to cli/cli-setshow.c */
+
+extern void print_doc_line (struct ui_file *, char *);
+
+
+#endif /* !defined (CLI_DECODE_H) */
diff --git a/contrib/gdb/gdb/cli/cli-script.c b/contrib/gdb/gdb/cli/cli-script.c
new file mode 100644
index 0000000..4545117
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-script.c
@@ -0,0 +1,1228 @@
+/* GDB CLI command scripting.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "language.h" /* For value_true */
+#include <ctype.h>
+
+#include "ui-out.h"
+
+#include "top.h"
+#include "cli/cli-cmds.h"
+#include "cli/cli-decode.h"
+#include "cli/cli-script.h"
+
+/* From gdb/top.c */
+
+extern void dont_repeat (void);
+
+extern void do_restore_instream_cleanup (void *stream);
+
+/* Prototypes for local functions */
+
+static struct cleanup *
+ make_cleanup_free_command_lines (struct command_line **arg);
+
+static enum command_control_type
+ recurse_read_control_structure (struct command_line *current_cmd);
+
+static char *insert_args (char *line);
+
+static struct cleanup * setup_user_args (char *p);
+
+static void validate_comname (char *);
+
+/* Level of control structure. */
+static int control_level;
+
+/* Source command state variable. */
+static int source_error_allocated;
+
+/* 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;
+
+
+/* Allocate, initialize a new command line structure for one of the
+ control commands (if/while). */
+
+static struct command_line *
+build_command_line (enum command_control_type type, char *args)
+{
+ struct command_line *cmd;
+
+ if (args == NULL)
+ error ("if/while commands require arguments.\n");
+
+ 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);
+ memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count);
+ cmd->line = savestring (args, strlen (args));
+ return cmd;
+}
+
+/* Build and return a new command structure for the control commands
+ such as "if" and "while". */
+
+static struct command_line *
+get_command_line (enum command_control_type type, char *arg)
+{
+ struct command_line *cmd;
+ struct cleanup *old_chain = NULL;
+
+ /* Allocate and build a new command line structure. */
+ cmd = build_command_line (type, arg);
+
+ old_chain = make_cleanup_free_command_lines (&cmd);
+
+ /* Read in the body of this command. */
+ if (recurse_read_control_structure (cmd) == invalid_control)
+ {
+ warning ("error reading in control structure\n");
+ do_cleanups (old_chain);
+ return NULL;
+ }
+
+ discard_cleanups (old_chain);
+ return cmd;
+}
+
+/* Recursively print a command (including full control structures). */
+
+void
+print_command_lines (struct ui_out *uiout, struct command_line *cmd,
+ unsigned int depth)
+{
+ struct command_line *list;
+
+ list = cmd;
+ while (list)
+ {
+
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+
+ /* A simple command, print it and continue. */
+ if (list->control_type == simple_control)
+ {
+ ui_out_field_string (uiout, NULL, list->line);
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* loop_continue to jump to the start of a while loop, print it
+ and continue. */
+ if (list->control_type == continue_control)
+ {
+ ui_out_field_string (uiout, NULL, "loop_continue");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* loop_break to break out of a while loop, print it and continue. */
+ if (list->control_type == break_control)
+ {
+ ui_out_field_string (uiout, NULL, "loop_break");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* A while command. Recursively print its subcommands and continue. */
+ if (list->control_type == while_control)
+ {
+ ui_out_field_fmt (uiout, NULL, "while %s", list->line);
+ ui_out_text (uiout, "\n");
+ print_command_lines (uiout, *list->body_list, depth + 1);
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_field_string (uiout, NULL, "end");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* An if command. Recursively print both arms before continueing. */
+ if (list->control_type == if_control)
+ {
+ ui_out_field_fmt (uiout, NULL, "if %s", list->line);
+ ui_out_text (uiout, "\n");
+ /* The true arm. */
+ print_command_lines (uiout, list->body_list[0], depth + 1);
+
+ /* Show the false arm if it exists. */
+ if (list->body_count == 2)
+ {
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_field_string (uiout, NULL, "else");
+ ui_out_text (uiout, "\n");
+ print_command_lines (uiout, list->body_list[1], depth + 1);
+ }
+
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_field_string (uiout, NULL, "end");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* ignore illegal command type and try next */
+ list = list->next;
+ } /* while (list) */
+}
+
+/* Execute the command in CMD. */
+
+void
+execute_user_command (struct cmd_list_element *c, char *args)
+{
+ register struct command_line *cmdlines;
+ struct cleanup *old_chain;
+ enum command_control_type ret;
+
+ old_chain = setup_user_args (args);
+
+ cmdlines = c->user_commands;
+ if (cmdlines == 0)
+ /* Null command */
+ return;
+
+ /* Set the instream to 0, indicating execution of a
+ user-defined function. */
+ old_chain = make_cleanup (do_restore_instream_cleanup, instream);
+ instream = (FILE *) 0;
+ while (cmdlines)
+ {
+ ret = execute_control_command (cmdlines);
+ if (ret != simple_control && ret != break_control)
+ {
+ warning ("Error in control structure.\n");
+ break;
+ }
+ cmdlines = cmdlines->next;
+ }
+ do_cleanups (old_chain);
+}
+
+enum command_control_type
+execute_control_command (struct command_line *cmd)
+{
+ struct expression *expr;
+ struct command_line *current;
+ struct cleanup *old_chain = 0;
+ struct value *val;
+ struct value *val_mark;
+ int loop;
+ enum command_control_type ret;
+ char *new_line;
+
+ switch (cmd->control_type)
+ {
+ case simple_control:
+ /* A simple command, execute it and return. */
+ new_line = insert_args (cmd->line);
+ if (!new_line)
+ return invalid_control;
+ old_chain = make_cleanup (free_current_contents, &new_line);
+ execute_command (new_line, 0);
+ ret = cmd->control_type;
+ break;
+
+ case continue_control:
+ case break_control:
+ /* Return for "continue", and "break" so we can either
+ continue the loop at the top, or break out. */
+ ret = cmd->control_type;
+ break;
+
+ case while_control:
+ {
+ /* Parse the loop control expression for the while statement. */
+ new_line = insert_args (cmd->line);
+ if (!new_line)
+ return invalid_control;
+ old_chain = make_cleanup (free_current_contents, &new_line);
+ expr = parse_expression (new_line);
+ make_cleanup (free_current_contents, &expr);
+
+ ret = simple_control;
+ loop = 1;
+
+ /* Keep iterating so long as the expression is true. */
+ while (loop == 1)
+ {
+ int cond_result;
+
+ QUIT;
+
+ /* Evaluate the expression. */
+ val_mark = value_mark ();
+ val = evaluate_expression (expr);
+ cond_result = value_true (val);
+ value_free_to_mark (val_mark);
+
+ /* If the value is false, then break out of the loop. */
+ if (!cond_result)
+ break;
+
+ /* Execute the body of the while statement. */
+ current = *cmd->body_list;
+ while (current)
+ {
+ ret = execute_control_command (current);
+
+ /* If we got an error, or a "break" command, then stop
+ looping. */
+ if (ret == invalid_control || ret == break_control)
+ {
+ loop = 0;
+ break;
+ }
+
+ /* If we got a "continue" command, then restart the loop
+ at this point. */
+ if (ret == continue_control)
+ break;
+
+ /* Get the next statement. */
+ current = current->next;
+ }
+ }
+
+ /* Reset RET so that we don't recurse the break all the way down. */
+ if (ret == break_control)
+ ret = simple_control;
+
+ break;
+ }
+
+ case if_control:
+ {
+ new_line = insert_args (cmd->line);
+ if (!new_line)
+ return invalid_control;
+ old_chain = make_cleanup (free_current_contents, &new_line);
+ /* Parse the conditional for the if statement. */
+ expr = parse_expression (new_line);
+ make_cleanup (free_current_contents, &expr);
+
+ current = NULL;
+ ret = simple_control;
+
+ /* Evaluate the conditional. */
+ val_mark = value_mark ();
+ val = evaluate_expression (expr);
+
+ /* Choose which arm to take commands from based on the value of the
+ conditional expression. */
+ if (value_true (val))
+ current = *cmd->body_list;
+ else if (cmd->body_count == 2)
+ current = *(cmd->body_list + 1);
+ value_free_to_mark (val_mark);
+
+ /* Execute commands in the given arm. */
+ while (current)
+ {
+ ret = execute_control_command (current);
+
+ /* If we got an error, get out. */
+ if (ret != simple_control)
+ break;
+
+ /* Get the next statement in the body. */
+ current = current->next;
+ }
+
+ break;
+ }
+
+ default:
+ warning ("Invalid control type in command structure.");
+ return invalid_control;
+ }
+
+ if (old_chain)
+ do_cleanups (old_chain);
+
+ return ret;
+}
+
+/* "while" command support. Executes a body of statements while the
+ loop condition is nonzero. */
+
+void
+while_command (char *arg, int from_tty)
+{
+ struct command_line *command = NULL;
+
+ control_level = 1;
+ command = get_command_line (while_control, arg);
+
+ if (command == NULL)
+ return;
+
+ execute_control_command (command);
+ free_command_lines (&command);
+}
+
+/* "if" command support. Execute either the true or false arm depending
+ on the value of the if conditional. */
+
+void
+if_command (char *arg, int from_tty)
+{
+ struct command_line *command = NULL;
+
+ control_level = 1;
+ command = get_command_line (if_control, arg);
+
+ if (command == NULL)
+ return;
+
+ execute_control_command (command);
+ free_command_lines (&command);
+}
+
+/* Cleanup */
+static void
+arg_cleanup (void *ignore)
+{
+ struct user_args *oargs = user_args;
+ if (!user_args)
+ internal_error (__FILE__, __LINE__,
+ "arg_cleanup called with no user args.\n");
+
+ user_args = user_args->next;
+ xfree (oargs);
+}
+
+/* Bind the incomming arguments for a user defined command to
+ $arg0, $arg1 ... $argMAXUSERARGS. */
+
+static struct cleanup *
+setup_user_args (char *p)
+{
+ struct user_args *args;
+ struct cleanup *old_chain;
+ unsigned int arg_count = 0;
+
+ args = (struct user_args *) xmalloc (sizeof (struct user_args));
+ memset (args, 0, sizeof (struct user_args));
+
+ args->next = user_args;
+ user_args = args;
+
+ old_chain = make_cleanup (arg_cleanup, 0/*ignored*/);
+
+ if (p == NULL)
+ return old_chain;
+
+ while (*p)
+ {
+ char *start_arg;
+ int squote = 0;
+ int dquote = 0;
+ int bsquote = 0;
+
+ if (arg_count >= MAXUSERARGS)
+ {
+ error ("user defined function may only have %d arguments.\n",
+ MAXUSERARGS);
+ return old_chain;
+ }
+
+ /* Strip whitespace. */
+ while (*p == ' ' || *p == '\t')
+ p++;
+
+ /* P now points to an argument. */
+ start_arg = p;
+ user_args->a[arg_count].arg = p;
+
+ /* Get to the end of this argument. */
+ while (*p)
+ {
+ if (((*p == ' ' || *p == '\t')) && !squote && !dquote && !bsquote)
+ break;
+ else
+ {
+ if (bsquote)
+ bsquote = 0;
+ else if (*p == '\\')
+ bsquote = 1;
+ else if (squote)
+ {
+ if (*p == '\'')
+ squote = 0;
+ }
+ else if (dquote)
+ {
+ if (*p == '"')
+ dquote = 0;
+ }
+ else
+ {
+ if (*p == '\'')
+ squote = 1;
+ else if (*p == '"')
+ dquote = 1;
+ }
+ p++;
+ }
+ }
+
+ user_args->a[arg_count].len = p - start_arg;
+ arg_count++;
+ user_args->count++;
+ }
+ return old_chain;
+}
+
+/* Given character string P, return a point to the first argument ($arg),
+ or NULL if P contains no arguments. */
+
+static char *
+locate_arg (char *p)
+{
+ while ((p = strchr (p, '$')))
+ {
+ if (strncmp (p, "$arg", 4) == 0 && isdigit (p[4]))
+ return p;
+ p++;
+ }
+ return NULL;
+}
+
+/* Insert the user defined arguments stored in user_arg into the $arg
+ arguments found in line, with the updated copy being placed into nline. */
+
+static char *
+insert_args (char *line)
+{
+ char *p, *save_line, *new_line;
+ unsigned len, i;
+
+ /* First we need to know how much memory to allocate for the new line. */
+ save_line = line;
+ len = 0;
+ while ((p = locate_arg (line)))
+ {
+ len += p - line;
+ i = p[4] - '0';
+
+ if (i >= user_args->count)
+ {
+ error ("Missing argument %d in user function.\n", i);
+ return NULL;
+ }
+ len += user_args->a[i].len;
+ line = p + 5;
+ }
+
+ /* Don't forget the tail. */
+ len += strlen (line);
+
+ /* Allocate space for the new line and fill it in. */
+ new_line = (char *) xmalloc (len + 1);
+ if (new_line == NULL)
+ return NULL;
+
+ /* Restore pointer to beginning of old line. */
+ line = save_line;
+
+ /* Save pointer to beginning of new line. */
+ save_line = new_line;
+
+ while ((p = locate_arg (line)))
+ {
+ int i, len;
+
+ memcpy (new_line, line, p - line);
+ new_line += p - line;
+ i = p[4] - '0';
+
+ len = user_args->a[i].len;
+ if (len)
+ {
+ memcpy (new_line, user_args->a[i].arg, len);
+ new_line += len;
+ }
+ line = p + 5;
+ }
+ /* Don't forget the tail. */
+ strcpy (new_line, line);
+
+ /* Return a pointer to the beginning of the new line. */
+ return save_line;
+}
+
+
+/* Expand the body_list of COMMAND so that it can hold NEW_LENGTH
+ code bodies. This is typically used when we encounter an "else"
+ clause for an "if" command. */
+
+static void
+realloc_body_list (struct command_line *command, int new_length)
+{
+ int n;
+ struct command_line **body_list;
+
+ n = command->body_count;
+
+ /* Nothing to do? */
+ if (new_length <= n)
+ return;
+
+ body_list = (struct command_line **)
+ xmalloc (sizeof (struct command_line *) * new_length);
+
+ memcpy (body_list, command->body_list, sizeof (struct command_line *) * n);
+
+ xfree (command->body_list);
+ command->body_list = body_list;
+ command->body_count = new_length;
+}
+
+/* Read one line from the input stream. If the command is an "else" or
+ "end", return such an indication to the caller. */
+
+static enum misc_command_type
+read_next_line (struct command_line **command)
+{
+ char *p, *p1, *prompt_ptr, control_prompt[256];
+ int i = 0;
+
+ if (control_level >= 254)
+ error ("Control nesting too deep!\n");
+
+ /* Set a prompt based on the nesting of the control commands. */
+ if (instream == stdin || (instream == 0 && readline_hook != NULL))
+ {
+ for (i = 0; i < control_level; i++)
+ control_prompt[i] = ' ';
+ control_prompt[i] = '>';
+ control_prompt[i + 1] = '\0';
+ prompt_ptr = (char *) &control_prompt[0];
+ }
+ else
+ prompt_ptr = NULL;
+
+ p = command_line_input (prompt_ptr, instream == stdin, "commands");
+
+ /* Not sure what to do here. */
+ if (p == NULL)
+ return end_command;
+
+ /* Strip leading and trailing whitespace. */
+ while (*p == ' ' || *p == '\t')
+ p++;
+
+ p1 = p + strlen (p);
+ while (p1 != p && (p1[-1] == ' ' || p1[-1] == '\t'))
+ p1--;
+
+ /* Blanks and comments don't really do anything, but we need to
+ distinguish them from else, end and other commands which can be
+ 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;
+
+ /* Is the else clause of an if control structure? */
+ if (p1 - p == 4 && !strncmp (p, "else", 4))
+ return else_command;
+
+ /* Check for while, if, break, continue, etc and build a new command
+ line structure for them. */
+ if (p1 - p > 5 && !strncmp (p, "while", 5))
+ *command = build_command_line (while_control, p + 6);
+ else if (p1 - p > 2 && !strncmp (p, "if", 2))
+ *command = build_command_line (if_control, p + 3);
+ else if (p1 - p == 10 && !strncmp (p, "loop_break", 10))
+ {
+ *command = (struct command_line *)
+ xmalloc (sizeof (struct command_line));
+ (*command)->next = NULL;
+ (*command)->line = NULL;
+ (*command)->control_type = break_control;
+ (*command)->body_count = 0;
+ (*command)->body_list = NULL;
+ }
+ else if (p1 - p == 13 && !strncmp (p, "loop_continue", 13))
+ {
+ *command = (struct command_line *)
+ xmalloc (sizeof (struct command_line));
+ (*command)->next = NULL;
+ (*command)->line = NULL;
+ (*command)->control_type = continue_control;
+ (*command)->body_count = 0;
+ (*command)->body_list = NULL;
+ }
+ else
+ {
+ /* A normal command. */
+ *command = (struct command_line *)
+ xmalloc (sizeof (struct command_line));
+ (*command)->next = NULL;
+ (*command)->line = savestring (p, p1 - p);
+ (*command)->control_type = simple_control;
+ (*command)->body_count = 0;
+ (*command)->body_list = NULL;
+ }
+
+ /* Nothing special. */
+ return ok_command;
+}
+
+/* Recursively read in the control structures and create a command_line
+ structure from them.
+
+ The parent_control parameter is the control structure in which the
+ following commands are nested. */
+
+static enum command_control_type
+recurse_read_control_structure (struct command_line *current_cmd)
+{
+ int current_body, i;
+ enum misc_command_type val;
+ enum command_control_type ret;
+ struct command_line **body_ptr, *child_tail, *next;
+
+ child_tail = NULL;
+ current_body = 1;
+
+ /* Sanity checks. */
+ if (current_cmd->control_type == simple_control)
+ {
+ error ("Recursed on a simple control type\n");
+ return invalid_control;
+ }
+
+ if (current_body > current_cmd->body_count)
+ {
+ error ("Allocated body is smaller than this command type needs\n");
+ return invalid_control;
+ }
+
+ /* Read lines from the input stream and build control structures. */
+ while (1)
+ {
+ dont_repeat ();
+
+ next = NULL;
+ val = read_next_line (&next);
+
+ /* Just skip blanks and comments. */
+ if (val == nop_command)
+ continue;
+
+ if (val == end_command)
+ {
+ if (current_cmd->control_type == while_control
+ || current_cmd->control_type == if_control)
+ {
+ /* Success reading an entire control structure. */
+ ret = simple_control;
+ break;
+ }
+ else
+ {
+ ret = invalid_control;
+ break;
+ }
+ }
+
+ /* Not the end of a control structure. */
+ if (val == else_command)
+ {
+ if (current_cmd->control_type == if_control
+ && current_body == 1)
+ {
+ realloc_body_list (current_cmd, 2);
+ current_body = 2;
+ child_tail = NULL;
+ continue;
+ }
+ else
+ {
+ ret = invalid_control;
+ break;
+ }
+ }
+
+ if (child_tail)
+ {
+ child_tail->next = next;
+ }
+ else
+ {
+ body_ptr = current_cmd->body_list;
+ for (i = 1; i < current_body; i++)
+ body_ptr++;
+
+ *body_ptr = next;
+
+ }
+
+ child_tail = next;
+
+ /* If the latest line is another control structure, then recurse
+ on it. */
+ if (next->control_type == while_control
+ || next->control_type == if_control)
+ {
+ control_level++;
+ ret = recurse_read_control_structure (next);
+ control_level--;
+
+ if (ret != simple_control)
+ break;
+ }
+ }
+
+ dont_repeat ();
+
+ return ret;
+}
+
+/* Read lines from the input stream and accumulate them in a chain of
+ struct command_line's, which is then returned. For input from a
+ terminal, the special command "end" is used to mark the end of the
+ input, and is not included in the returned chain of commands. */
+
+#define END_MESSAGE "End with a line saying just \"end\"."
+
+struct command_line *
+read_command_lines (char *prompt_arg, int from_tty)
+{
+ struct command_line *head, *tail, *next;
+ struct cleanup *old_chain;
+ enum command_control_type ret;
+ enum misc_command_type val;
+
+ control_level = 0;
+ if (readline_begin_hook)
+ {
+ /* Note - intentional to merge messages with no newline */
+ (*readline_begin_hook) ("%s %s\n", prompt_arg, END_MESSAGE);
+ }
+ else if (from_tty && input_from_terminal_p ())
+ {
+ printf_unfiltered ("%s\n%s\n", prompt_arg, END_MESSAGE);
+ gdb_flush (gdb_stdout);
+ }
+
+ head = tail = NULL;
+ old_chain = NULL;
+
+ while (1)
+ {
+ val = read_next_line (&next);
+
+ /* Ignore blank lines or comments. */
+ if (val == nop_command)
+ continue;
+
+ if (val == end_command)
+ {
+ ret = simple_control;
+ break;
+ }
+
+ if (val != ok_command)
+ {
+ ret = invalid_control;
+ break;
+ }
+
+ if (next->control_type == while_control
+ || next->control_type == if_control)
+ {
+ control_level++;
+ ret = recurse_read_control_structure (next);
+ control_level--;
+
+ if (ret == invalid_control)
+ break;
+ }
+
+ if (tail)
+ {
+ tail->next = next;
+ }
+ else
+ {
+ head = next;
+ old_chain = make_cleanup_free_command_lines (&head);
+ }
+ tail = next;
+ }
+
+ dont_repeat ();
+
+ if (head)
+ {
+ if (ret != invalid_control)
+ {
+ discard_cleanups (old_chain);
+ }
+ else
+ do_cleanups (old_chain);
+ }
+
+ if (readline_end_hook)
+ {
+ (*readline_end_hook) ();
+ }
+ return (head);
+}
+
+/* Free a chain of struct command_line's. */
+
+void
+free_command_lines (struct command_line **lptr)
+{
+ register struct command_line *l = *lptr;
+ register struct command_line *next;
+ struct command_line **blist;
+ int i;
+
+ while (l)
+ {
+ if (l->body_count > 0)
+ {
+ blist = l->body_list;
+ for (i = 0; i < l->body_count; i++, blist++)
+ free_command_lines (blist);
+ }
+ next = l->next;
+ xfree (l->line);
+ xfree (l);
+ l = next;
+ }
+ *lptr = NULL;
+}
+
+static void
+do_free_command_lines_cleanup (void *arg)
+{
+ free_command_lines (arg);
+}
+
+static struct cleanup *
+make_cleanup_free_command_lines (struct command_line **arg)
+{
+ return make_cleanup (do_free_command_lines_cleanup, arg);
+}
+
+static void
+validate_comname (char *comname)
+{
+ register char *p;
+
+ if (comname == 0)
+ error_no_arg ("name of command to define");
+
+ p = comname;
+ while (*p)
+ {
+ if (!isalnum (*p) && *p != '-' && *p != '_')
+ error ("Junk in argument list: \"%s\"", p);
+ p++;
+ }
+}
+
+/* This is just a placeholder in the command data structures. */
+static void
+user_defined_command (char *ignore, int from_tty)
+{
+}
+
+void
+define_command (char *comname, int from_tty)
+{
+#define MAX_TMPBUF 128
+ enum cmd_hook_type
+ {
+ CMD_NO_HOOK = 0,
+ CMD_PRE_HOOK,
+ CMD_POST_HOOK
+ };
+ register struct command_line *cmds;
+ register struct cmd_list_element *c, *newc, *oldc, *hookc = 0;
+ char *tem = comname;
+ char *tem2;
+ char tmpbuf[MAX_TMPBUF];
+ int hook_type = CMD_NO_HOOK;
+ int hook_name_size = 0;
+
+#define HOOK_STRING "hook-"
+#define HOOK_LEN 5
+#define HOOK_POST_STRING "hookpost-"
+#define HOOK_POST_LEN 9
+
+ validate_comname (comname);
+
+ /* Look it up, and verify that we got an exact match. */
+ c = lookup_cmd (&tem, cmdlist, "", -1, 1);
+ if (c && !STREQ (comname, c->name))
+ c = 0;
+
+ if (c)
+ {
+ if (c->class == class_user || c->class == class_alias)
+ tem = "Redefine command \"%s\"? ";
+ else
+ tem = "Really redefine built-in command \"%s\"? ";
+ if (!query (tem, c->name))
+ error ("Command \"%s\" not redefined.", c->name);
+ }
+
+ /* If this new command is a hook, then mark the command which it
+ is hooking. Note that we allow hooking `help' commands, so that
+ we can hook the `stop' pseudo-command. */
+
+ if (!strncmp (comname, HOOK_STRING, HOOK_LEN))
+ {
+ hook_type = CMD_PRE_HOOK;
+ hook_name_size = HOOK_LEN;
+ }
+ else if (!strncmp (comname, HOOK_POST_STRING, HOOK_POST_LEN))
+ {
+ hook_type = CMD_POST_HOOK;
+ hook_name_size = HOOK_POST_LEN;
+ }
+
+ if (hook_type != CMD_NO_HOOK)
+ {
+ /* Look up cmd it hooks, and verify that we got an exact match. */
+ tem = comname + hook_name_size;
+ hookc = lookup_cmd (&tem, cmdlist, "", -1, 0);
+ if (hookc && !STREQ (comname + hook_name_size, hookc->name))
+ hookc = 0;
+ if (!hookc)
+ {
+ warning ("Your new `%s' command does not hook any existing command.",
+ comname);
+ if (!query ("Proceed? "))
+ error ("Not confirmed.");
+ }
+ }
+
+ comname = savestring (comname, strlen (comname));
+
+ /* 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);
+
+ sprintf (tmpbuf, "Type commands for definition of \"%s\".", comname);
+ cmds = read_command_lines (tmpbuf, from_tty);
+
+ if (c && c->class == class_user)
+ 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);
+ newc->user_commands = cmds;
+
+ /* If this new command is a hook, then mark both commands as being
+ tied. */
+ if (hookc)
+ {
+ switch (hook_type)
+ {
+ case CMD_PRE_HOOK:
+ hookc->hook_pre = newc; /* Target gets hooked. */
+ newc->hookee_pre = hookc; /* We are marked as hooking target cmd. */
+ break;
+ case CMD_POST_HOOK:
+ hookc->hook_post = newc; /* Target gets hooked. */
+ newc->hookee_post = hookc; /* We are marked as hooking target cmd. */
+ break;
+ default:
+ /* Should never come here as hookc would be 0. */
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ }
+}
+
+void
+document_command (char *comname, int from_tty)
+{
+ struct command_line *doclines;
+ register struct cmd_list_element *c;
+ char *tem = comname;
+ char tmpbuf[128];
+
+ validate_comname (comname);
+
+ c = lookup_cmd (&tem, cmdlist, "", 0, 1);
+
+ if (c->class != class_user)
+ error ("Command \"%s\" is built-in.", comname);
+
+ sprintf (tmpbuf, "Type documentation for \"%s\".", comname);
+ doclines = read_command_lines (tmpbuf, from_tty);
+
+ if (c->doc)
+ xfree (c->doc);
+
+ {
+ register struct command_line *cl1;
+ register int len = 0;
+
+ for (cl1 = doclines; cl1; cl1 = cl1->next)
+ len += strlen (cl1->line) + 1;
+
+ c->doc = (char *) xmalloc (len + 1);
+ *c->doc = 0;
+
+ for (cl1 = doclines; cl1; cl1 = cl1->next)
+ {
+ strcat (c->doc, cl1->line);
+ if (cl1->next)
+ strcat (c->doc, "\n");
+ }
+ }
+
+ free_command_lines (&doclines);
+}
+
+struct source_cleanup_lines_args
+{
+ int old_line;
+ char *old_file;
+ char *old_pre_error;
+ char *old_error_pre_print;
+};
+
+static void
+source_cleanup_lines (PTR args)
+{
+ struct source_cleanup_lines_args *p =
+ (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;
+ error_pre_print = p->old_error_pre_print;
+}
+
+/* ARGSUSED */
+static void
+do_fclose_cleanup (void *stream)
+{
+ fclose (stream);
+}
+
+/* Used to implement source_command */
+
+void
+script_from_file (FILE *stream, char *file)
+{
+ struct cleanup *old_cleanups;
+ struct source_cleanup_lines_args old_lines;
+ int needed_length;
+
+ if (stream == NULL)
+ {
+ internal_error (__FILE__, __LINE__, "called with NULL file pointer!");
+ }
+
+ old_cleanups = make_cleanup (do_fclose_cleanup, stream);
+
+ old_lines.old_line = source_line_number;
+ old_lines.old_file = source_file_name;
+ old_lines.old_pre_error = source_pre_error;
+ old_lines.old_error_pre_print = error_pre_print;
+ make_cleanup (source_cleanup_lines, &old_lines);
+ source_line_number = 0;
+ source_file_name = file;
+ source_pre_error = error_pre_print == NULL ? "" : error_pre_print;
+ source_pre_error = savestring (source_pre_error, strlen (source_pre_error));
+ make_cleanup (xfree, source_pre_error);
+ /* This will get set every time we read a line. So it won't stay "" for
+ long. */
+ error_pre_print = "";
+
+ needed_length = strlen (source_file_name) + strlen (source_pre_error) + 80;
+ if (source_error_allocated < needed_length)
+ {
+ source_error_allocated *= 2;
+ if (source_error_allocated < needed_length)
+ source_error_allocated = needed_length;
+ if (source_error == NULL)
+ source_error = xmalloc (source_error_allocated);
+ else
+ source_error = xrealloc (source_error, source_error_allocated);
+ }
+
+ read_command_file (stream);
+
+ do_cleanups (old_cleanups);
+}
+
+void
+show_user_1 (struct cmd_list_element *c, struct ui_file *stream)
+{
+ register struct command_line *cmdlines;
+
+ cmdlines = c->user_commands;
+ if (!cmdlines)
+ return;
+ fputs_filtered ("User command ", stream);
+ fputs_filtered (c->name, stream);
+ fputs_filtered (":\n", stream);
+
+ print_command_lines (uiout, cmdlines, 1);
+ fputs_filtered ("\n", stream);
+}
+
diff --git a/contrib/gdb/gdb/cli/cli-script.h b/contrib/gdb/gdb/cli/cli-script.h
new file mode 100644
index 0000000..f8604c6
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-script.h
@@ -0,0 +1,48 @@
+/* Header file for GDB CLI command implementation library.
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 (CLI_SCRIPT_H)
+#define CLI_SCRIPT_H 1
+
+/* Exported to cli/cli-cmds.c */
+
+extern void script_from_file (FILE *stream, char *file);
+
+extern void document_command (char *, int);
+
+extern void define_command (char *, int);
+
+extern void while_command (char *arg, int from_tty);
+
+extern void if_command (char *arg, int from_tty);
+
+extern void show_user_1 (struct cmd_list_element *c, struct ui_file *stream);
+
+/* Exported to gdb/breakpoint.c */
+
+extern enum command_control_type
+ execute_control_command (struct command_line *cmd);
+
+extern void print_command_lines (struct ui_out *,
+ struct command_line *, unsigned int);
+
+/* Exported to gdb/infrun.c */
+
+extern void execute_user_command (struct cmd_list_element *c, char *args);
+
+#endif /* !defined (CLI_SCRIPT_H) */
diff --git a/contrib/gdb/gdb/cli/cli-setshow.c b/contrib/gdb/gdb/cli/cli-setshow.c
new file mode 100644
index 0000000..f967b0c
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-setshow.c
@@ -0,0 +1,382 @@
+/* Handle set and show GDB commands.
+
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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"
+#include <ctype.h>
+#if 0
+#include "gdb_string.h"
+#endif
+
+#include "ui-out.h"
+
+#include "cli/cli-decode.h"
+#include "cli/cli-cmds.h"
+#include "cli/cli-setshow.h"
+
+/* Prototypes for local functions */
+
+static int parse_binary_operation (char *);
+
+static enum cmd_auto_boolean parse_auto_binary_operation (const char *arg);
+
+static enum cmd_auto_boolean
+parse_auto_binary_operation (const char *arg)
+{
+ if (arg != NULL && *arg != '\0')
+ {
+ int length = strlen (arg);
+ while (isspace (arg[length - 1]) && length > 0)
+ length--;
+ if (strncmp (arg, "on", length) == 0
+ || strncmp (arg, "1", length) == 0
+ || strncmp (arg, "yes", length) == 0
+ || strncmp (arg, "enable", length) == 0)
+ return CMD_AUTO_BOOLEAN_TRUE;
+ else if (strncmp (arg, "off", length) == 0
+ || strncmp (arg, "0", length) == 0
+ || strncmp (arg, "no", length) == 0
+ || strncmp (arg, "disable", length) == 0)
+ return CMD_AUTO_BOOLEAN_FALSE;
+ else if (strncmp (arg, "auto", length) == 0
+ || (strncmp (arg, "-1", length) == 0 && length > 1))
+ return CMD_AUTO_BOOLEAN_AUTO;
+ }
+ error ("\"on\", \"off\" or \"auto\" expected.");
+ return CMD_AUTO_BOOLEAN_AUTO; /* pacify GCC */
+}
+
+static int
+parse_binary_operation (char *arg)
+{
+ int length;
+
+ if (!arg || !*arg)
+ return 1;
+
+ length = strlen (arg);
+
+ while (arg[length - 1] == ' ' || arg[length - 1] == '\t')
+ length--;
+
+ if (strncmp (arg, "on", length) == 0
+ || strncmp (arg, "1", length) == 0
+ || strncmp (arg, "yes", length) == 0
+ || strncmp (arg, "enable", length) == 0)
+ return 1;
+ else if (strncmp (arg, "off", length) == 0
+ || strncmp (arg, "0", length) == 0
+ || strncmp (arg, "no", length) == 0
+ || strncmp (arg, "disable", length) == 0)
+ 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
+ of the argument, and FROM_TTY is nonzero if this command is being entered
+ directly by the user (i.e. these are just like any other
+ command). C is the command list element for the command. */
+
+void
+do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
+{
+ if (c->type == set_cmd)
+ {
+ switch (c->var_type)
+ {
+ case var_string:
+ {
+ char *new;
+ char *p;
+ char *q;
+ int ch;
+
+ if (arg == NULL)
+ arg = "";
+ new = (char *) xmalloc (strlen (arg) + 2);
+ p = arg;
+ q = new;
+ while ((ch = *p++) != '\000')
+ {
+ if (ch == '\\')
+ {
+ /* \ at end of argument is used after spaces
+ so they won't be lost. */
+ /* This is obsolete now that we no longer strip
+ trailing whitespace and actually, the backslash
+ didn't get here in my test, readline or
+ something did something funky with a backslash
+ right before a newline. */
+ if (*p == 0)
+ break;
+ ch = parse_escape (&p);
+ if (ch == 0)
+ break; /* C loses */
+ else if (ch > 0)
+ *q++ = ch;
+ }
+ else
+ *q++ = ch;
+ }
+#if 0
+ if (*(p - 1) != '\\')
+ *q++ = ' ';
+#endif
+ *q++ = '\0';
+ new = (char *) xrealloc (new, q - new);
+ if (*(char **) c->var != NULL)
+ xfree (*(char **) c->var);
+ *(char **) c->var = new;
+ }
+ break;
+ case var_string_noescape:
+ if (arg == NULL)
+ arg = "";
+ if (*(char **) c->var != NULL)
+ xfree (*(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)
+ xfree (*(char **) c->var);
+ *(char **) c->var = tilde_expand (arg);
+ break;
+ case var_boolean:
+ *(int *) c->var = parse_binary_operation (arg);
+ break;
+ case var_auto_boolean:
+ *(enum cmd_auto_boolean *) c->var = parse_auto_binary_operation (arg);
+ break;
+ case var_uinteger:
+ if (arg == NULL)
+ error_no_arg ("integer to set it to.");
+ *(unsigned int *) c->var = parse_and_eval_long (arg);
+ if (*(unsigned int *) c->var == 0)
+ *(unsigned int *) c->var = UINT_MAX;
+ break;
+ case var_integer:
+ {
+ unsigned int val;
+ if (arg == NULL)
+ error_no_arg ("integer to set it to.");
+ val = parse_and_eval_long (arg);
+ if (val == 0)
+ *(int *) c->var = INT_MAX;
+ else if (val >= INT_MAX)
+ error ("integer %u out of range", val);
+ else
+ *(int *) c->var = val;
+ break;
+ }
+ case var_zinteger:
+ if (arg == NULL)
+ error_no_arg ("integer to set it to.");
+ *(int *) c->var = parse_and_eval_long (arg);
+ break;
+ case var_enum:
+ {
+ int i;
+ int len;
+ int nmatches;
+ const char *match = NULL;
+ char *p;
+
+ /* if no argument was supplied, print an informative error message */
+ if (arg == NULL)
+ {
+ char msg[1024];
+ strcpy (msg, "Requires an argument. Valid arguments are ");
+ for (i = 0; c->enums[i]; i++)
+ {
+ if (i != 0)
+ strcat (msg, ", ");
+ strcat (msg, c->enums[i]);
+ }
+ strcat (msg, ".");
+ error (msg);
+ }
+
+ p = strchr (arg, ' ');
+
+ if (p)
+ len = p - arg;
+ else
+ len = strlen (arg);
+
+ nmatches = 0;
+ for (i = 0; c->enums[i]; i++)
+ if (strncmp (arg, c->enums[i], len) == 0)
+ {
+ if (c->enums[i][len] == '\0')
+ {
+ match = c->enums[i];
+ nmatches = 1;
+ break; /* exact match. */
+ }
+ else
+ {
+ match = c->enums[i];
+ nmatches++;
+ }
+ }
+
+ if (nmatches <= 0)
+ error ("Undefined item: \"%s\".", arg);
+
+ if (nmatches > 1)
+ error ("Ambiguous item \"%s\".", arg);
+
+ *(const char **) c->var = match;
+ }
+ break;
+ default:
+ error ("gdb internal error: bad var_type in do_setshow_command");
+ }
+ }
+ else if (c->type == show_cmd)
+ {
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+ int quote;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
+
+ /* Possibly call the pre hook. */
+ if (c->pre_show_hook)
+ (c->pre_show_hook) (c);
+
+ /* Print doc minus "show" at start. */
+ print_doc_line (gdb_stdout, c->doc + 5);
+
+ ui_out_text (uiout, " is ");
+ ui_out_wrap_hint (uiout, " ");
+ quote = 0;
+ switch (c->var_type)
+ {
+ case var_string:
+ {
+ unsigned char *p;
+
+ if (*(unsigned char **) c->var)
+ fputstr_filtered (*(unsigned char **) c->var, '"', stb->stream);
+ quote = 1;
+ }
+ break;
+ case var_string_noescape:
+ case var_filename:
+ case var_enum:
+ if (*(char **) c->var)
+ fputs_filtered (*(char **) c->var, stb->stream);
+ quote = 1;
+ break;
+ case var_boolean:
+ fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
+ break;
+ case var_auto_boolean:
+ switch (*(enum cmd_auto_boolean*) c->var)
+ {
+ case CMD_AUTO_BOOLEAN_TRUE:
+ fputs_filtered ("on", stb->stream);
+ break;
+ case CMD_AUTO_BOOLEAN_FALSE:
+ fputs_filtered ("off", stb->stream);
+ break;
+ case CMD_AUTO_BOOLEAN_AUTO:
+ fputs_filtered ("auto", stb->stream);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "do_setshow_command: invalid var_auto_boolean");
+ break;
+ }
+ break;
+ case var_uinteger:
+ if (*(unsigned int *) c->var == UINT_MAX)
+ {
+ fputs_filtered ("unlimited", stb->stream);
+ break;
+ }
+ /* else fall through */
+ case var_zinteger:
+ fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
+ break;
+ case var_integer:
+ if (*(int *) c->var == INT_MAX)
+ {
+ fputs_filtered ("unlimited", stb->stream);
+ }
+ else
+ fprintf_filtered (stb->stream, "%d", *(int *) c->var);
+ break;
+
+ default:
+ error ("gdb internal error: bad var_type in do_setshow_command");
+ }
+ if (quote)
+ ui_out_text (uiout, "\"");
+ ui_out_field_stream (uiout, "value", stb);
+ if (quote)
+ ui_out_text (uiout, "\"");
+ ui_out_text (uiout, ".\n");
+ do_cleanups (old_chain);
+ }
+ else
+ error ("gdb internal error: bad cmd_type in do_setshow_command");
+ c->func (c, NULL, from_tty);
+ if (c->type == set_cmd && set_hook)
+ set_hook (c);
+}
+
+/* Show all the settings in a list of show commands. */
+
+void
+cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
+{
+ ui_out_tuple_begin (uiout, "showlist");
+ 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)
+ {
+ ui_out_tuple_begin (uiout, "optionlist");
+ ui_out_field_string (uiout, "prefix", list->prefixname + 5);
+ cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+ ui_out_tuple_end (uiout);
+ }
+ if (list->type == show_cmd)
+ {
+ ui_out_tuple_begin (uiout, "option");
+ ui_out_text (uiout, prefix);
+ ui_out_field_string (uiout, "name", list->name);
+ ui_out_text (uiout, ": ");
+ do_setshow_command ((char *) NULL, from_tty, list);
+ ui_out_tuple_end (uiout);
+ }
+ }
+ ui_out_tuple_end (uiout);
+}
+
diff --git a/contrib/gdb/gdb/cli/cli-setshow.h b/contrib/gdb/gdb/cli/cli-setshow.h
new file mode 100644
index 0000000..393612a
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-setshow.h
@@ -0,0 +1,36 @@
+/* Header file for GDB CLI set and show commands implementation.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (CLI_SETSHOW_H)
+#define CLI_SETSHOW_H 1
+
+/* Exported to cli/cli-cmds.c and gdb/top.c */
+
+/* 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
+ directly by the user (i.e. these are just like any other
+ command). C is the command list element for the command. */
+extern void do_setshow_command (char *arg, int from_tty,
+ struct cmd_list_element *c);
+
+/* Exported to cli/cli-cmds.c and gdb/top.c, language.c and valprint.c */
+
+extern void cmd_show_list (struct cmd_list_element *list, int from_tty,
+ char *prefix);
+
+#endif /* !defined (CLI_SETSHOW_H) */
diff --git a/contrib/gdb/gdb/cli/cli-utils.c b/contrib/gdb/gdb/cli/cli-utils.c
new file mode 100644
index 0000000..396d6ea
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-utils.c
@@ -0,0 +1,21 @@
+/* GDB CLI utility library.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "cli/cli-utils.h"
+
diff --git a/contrib/gdb/gdb/cli/cli-utils.h b/contrib/gdb/gdb/cli/cli-utils.h
new file mode 100644
index 0000000..7c318af
--- /dev/null
+++ b/contrib/gdb/gdb/cli/cli-utils.h
@@ -0,0 +1,22 @@
+/* Header file for GDB CLI utility library.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (CLI_UTILS_H)
+# define CLI_UTILS_H 1
+
+#endif /* !defined (CLI_UTILS_H) */
diff --git a/contrib/gdb/gdb/command.h b/contrib/gdb/gdb/command.h
index 5a20923..7c20a42 100644
--- a/contrib/gdb/gdb/command.h
+++ b/contrib/gdb/gdb/command.h
@@ -1,65 +1,120 @@
+/* ***DEPRECATED*** The gdblib files must not be calling/using things in any
+ of the possible command languages. If necessary, a hook (that may be
+ present or not) must be used and set to the appropriate routine by any
+ command language that cares about it. If you are having to include this
+ file you are possibly doing things the old way. This file will disapear.
+ 2000-12-01 fnasser@redhat.com */
+
/* Header file for command-reading library command.c.
- Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000
+ 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
+/* Command classes are top-level categories into which commands are broken
+ down for "help" purposes.
+ Notes on classes: class_alias is for alias commands which are not
+ abbreviations of the original command. class-pseudo is for
+ commands which are not really commands nor help topics ("stop"). */
+
+enum command_class
+{
+ /* Special args to help_list */
+ class_deprecated, all_classes = -2, all_commands = -1,
+ /* Classes of commands */
+ no_class = -1, class_run = 0, class_vars, class_stack,
+ class_files, class_support, class_info, class_breakpoint, class_trace,
+ class_alias, class_obscure, class_user, class_maintenance,
+ class_pseudo, class_tui, class_xdb
+};
+
/* 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;
+
+/* Reasonable values for an AUTO_BOOLEAN variable. */
+enum cmd_auto_boolean
+{
+ CMD_AUTO_BOOLEAN_TRUE,
+ CMD_AUTO_BOOLEAN_FALSE,
+ CMD_AUTO_BOOLEAN_AUTO
+};
/* Types of "set" or "show" command. */
-typedef enum var_types {
- /* "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,
+
+ /* "on" / "true" / "enable" or "off" / "false" / "disable" or
+ "auto. *VAR is an ``enum cmd_auto_boolean''. NOTE: In general
+ a custom show command will need to be implemented - one that
+ for "auto" prints both the "auto" and the current auto-selected
+ value. */
+ var_auto_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. */
+
+/* This flag is used by the code executing commands to warn the user
+ the first time a deprecated command is used, see the 'flags' field in
+ the following struct.
+*/
+#define CMD_DEPRECATED 0x1
+#define DEPRECATED_WARN_USER 0x2
+#define MALLOCED_REPLACEMENT 0x4
+
struct cmd_list_element
{
/* Points to next command in this list. */
@@ -71,20 +126,24 @@ struct cmd_list_element
/* Command class; class values are chosen by application program. */
enum command_class class;
- /* Function definition of this command.
- NO_FUNCTION for command class names and for help topics that
- are not really commands. */
+ /* Function definition of this command. NULL for command class
+ names and for help topics that are not really commands. NOTE:
+ cagney/2002-02-02: This function signature is evolving. For
+ the moment suggest sticking with either set_cmd_cfunc() or
+ set_cmd_sfunc(). */
+ void (*func) (struct cmd_list_element *c, char *args, int from_tty);
+ /* The command's real callback. At present func() bounces through
+ to one of the below. */
union
{
/* If type is not_set_cmd, call it like this: */
- void (*cfunc) PARAMS ((char *args, int from_tty));
+ void (*cfunc) (char *args, int from_tty);
- /* If type is cmd_set or show_cmd, first set the variables, and
+ /* If type is set_cmd 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)
+ void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c);
+ }
+ function;
/* Documentation of this command (or help topic).
First line is brief documentation; remaining lines form, with it,
@@ -92,8 +151,44 @@ struct cmd_list_element
Entire string should also end with a period, not a newline. */
char *doc;
+ /* flags : a bitfield
+
+ bit 0: (LSB) CMD_DEPRECATED, when 1 indicated that this command
+ is deprecated. It may be removed from gdb's command set in the
+ future.
+
+ bit 1: DEPRECATED_WARN_USER, the user needs to be warned that
+ this is a deprecated command. The user should only be warned
+ the first time a command is used.
+
+ bit 2: MALLOCED_REPLACEMENT, when functions are deprecated at
+ compile time (this is the way it should, in general, be done)
+ the memory containing the replacement string is statically
+ allocated. In some cases it makes sense to deprecate commands
+ at runtime (the testsuite is one example). In this case the
+ memory for replacement is malloc'ed. When a command is
+ undeprecated or re-deprecated at runtime we don't want to risk
+ calling free on statically allocated memory, so we check this
+ flag.
+ */
+ int flags;
+
+ /* if this command is deprecated, this is the replacement name */
+ char *replacement;
+
+ /* If this command represents a show command, then this function
+ is called before the variable's value is examined. */
+ void (*pre_show_hook) (struct cmd_list_element *c);
+
/* Hook for another command to be executed before this command. */
- struct cmd_list_element *hook;
+ struct cmd_list_element *hook_pre;
+
+ /* Hook for another command to be executed after this command. */
+ struct cmd_list_element *hook_post;
+
+ /* Flag that specifies if this command is already running it's hook. */
+ /* Prevents the possibility of hook recursion. */
+ int hook_in;
/* Nonzero identifies a prefix command. For them, the address
of the variable containing the list of subcommands. */
@@ -129,7 +224,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) (char *text, char *word);
/* Type of "set" or "show" command (or SET_NOT_SET if not "set"
or "show"). */
@@ -137,123 +232,158 @@ struct cmd_list_element
/* Pointer to variable affected by "set" and "show". Doesn't matter
if type is not_set. */
- char *var;
+ void *var;
/* What kind of variable is *VAR? */
var_types var_type;
/* Pointer to NULL terminated list of enumerated values (like argv). */
- char **enums;
+ const char **enums;
/* Pointer to command strings of user-defined commands */
struct command_line *user_commands;
- /* Pointer to command that is hooked by this one,
+ /* Pointer to command that is hooked by this one, (by hook_pre)
so the hook can be removed when this one is deleted. */
- struct cmd_list_element *hookee;
+ struct cmd_list_element *hookee_pre;
+
+ /* Pointer to command that is hooked by this one, (by hook_post)
+ so the hook can be removed when this one is deleted. */
+ struct cmd_list_element *hookee_post;
/* Pointer to command that is aliased by this one, so the
aliased command can be located in case it has been hooked. */
struct cmd_list_element *cmd_pointer;
};
-/* Forward-declarations of the entry-points of command.c. */
+/* Forward-declarations of the entry-points of cli/cli-decode.c. */
-extern 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_cmd (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 **));
+extern struct cmd_list_element *add_alias_cmd (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 **));
+extern struct cmd_list_element *add_prefix_cmd (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 **));
+extern struct cmd_list_element *add_abbrev_prefix_cmd (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));
+/* Set the commands corresponding callback. */
+
+extern void set_cmd_cfunc (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty));
+
+extern void set_cmd_sfunc (struct cmd_list_element *cmd,
+ void (*sfunc) (char *args, int from_tty,
+ struct cmd_list_element * c));
+
+/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
+ around in cmd objects to test the value of the commands sfunc(). */
+extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty));
+
+extern struct cmd_list_element *lookup_cmd (char **,
+ struct cmd_list_element *, char *,
+ int, int);
+
+extern struct cmd_list_element *lookup_cmd_1 (char **,
+ struct cmd_list_element *,
+ struct cmd_list_element **,
+ int);
extern struct cmd_list_element *
-lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *,
- struct cmd_list_element **, int));
+ deprecate_cmd (struct cmd_list_element *, char * );
extern void
-add_com PARAMS ((char *, enum command_class, void (*fun)(char *, int),
- char *));
+ deprecated_cmd_warning (char **);
-extern void
-add_com_alias PARAMS ((char *, char *, enum command_class, int));
+extern int
+ lookup_cmd_composition (char *text,
+ struct cmd_list_element **alias,
+ struct cmd_list_element **prefix_cmd,
+ struct cmd_list_element **cmd);
-extern void
-add_info PARAMS ((char *, void (*fun) (char *, int), char *));
+extern struct cmd_list_element *add_com (char *, enum command_class,
+ void (*fun) (char *, int), char *);
-extern void
-add_info_alias PARAMS ((char *, char *, int));
+extern struct cmd_list_element *add_com_alias (char *, char *,
+ enum command_class, int);
-extern char **
-complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *));
+extern struct cmd_list_element *add_info (char *, void (*fun) (char *, int),
+ char *);
-extern char **
-complete_on_enum PARAMS ((char **enumlist, char *, char *));
+extern struct cmd_list_element *add_info_alias (char *, char *, int);
-extern void
-delete_cmd PARAMS ((char *, struct cmd_list_element **));
+extern char **complete_on_cmdlist (struct cmd_list_element *, char *, char *);
-extern void
-help_cmd PARAMS ((char *, GDB_FILE *));
+extern char **complete_on_enum (const char *enumlist[], char *, char *);
-extern void
-help_list PARAMS ((struct cmd_list_element *, char *, enum command_class,
- GDB_FILE *));
+extern void delete_cmd (char *, struct cmd_list_element **);
-extern void
-help_cmd_list PARAMS ((struct cmd_list_element *, enum command_class, char *,
- int, GDB_FILE *));
+extern void help_cmd (char *, struct ui_file *);
-extern struct cmd_list_element *
-add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
- struct cmd_list_element **));
+extern void help_list (struct cmd_list_element *, char *,
+ enum command_class, struct ui_file *);
-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));
+extern void help_cmd_list (struct cmd_list_element *, enum command_class,
+ char *, int, struct ui_file *);
-extern struct cmd_list_element *
-add_show_from_set PARAMS ((struct cmd_list_element *,
- struct cmd_list_element **));
+extern struct cmd_list_element *add_set_cmd (char *name, enum
+ command_class class,
+ var_types var_type, void *var,
+ char *doc,
+ struct cmd_list_element **list);
-/* 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
- directly by the user (i.e. these are just like any other
- command). C is the command list element for the command. */
+extern struct cmd_list_element *add_set_enum_cmd (char *name,
+ enum command_class class,
+ const char *enumlist[],
+ const char **var,
+ char *doc,
+ struct cmd_list_element **list);
-extern void
-do_setshow_command PARAMS ((char *, int, struct cmd_list_element *));
+extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
+ enum command_class class,
+ enum cmd_auto_boolean *var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
+ struct cmd_list_element
+ **);
/* Do a "show" command for each thing on a command list. */
-extern void
-cmd_show_list PARAMS ((struct cmd_list_element *, int, char *));
+extern void cmd_show_list (struct cmd_list_element *, int, char *);
-extern void
-error_no_arg PARAMS ((char *));
+extern NORETURN void error_no_arg (char *) ATTR_NORETURN;
-extern void
-dont_repeat PARAMS ((void));
+extern void dont_repeat (void);
/* Used to mark commands that don't do anything. If we just leave the
function field NULL, the command is interpreted as a help topic, or
as a class of commands. */
-extern void
-not_just_help_class_command PARAMS ((char *, int));
+extern void not_just_help_class_command (char *, int);
#endif /* !defined (COMMAND_H) */
diff --git a/contrib/gdb/gdb/complaints.c b/contrib/gdb/gdb/complaints.c
index e38038d..04e49a2 100644
--- a/contrib/gdb/gdb/complaints.c
+++ b/contrib/gdb/gdb/complaints.c
@@ -1,33 +1,38 @@
/* Support for complaint handling during symbol reading in GDB.
- Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1995, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
#include "gdbcmd.h"
+extern void _initialize_complaints (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. */
}
};
@@ -42,46 +47,30 @@ 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;
-
+
/* Functions to handle complaints during symbol reading. */
/* Print a complaint about the input symbols, and link the complaint block
into a chain for later handling. */
-/* VARARGS */
void
-#ifdef ANSI_PROTOTYPES
-complain (struct complaint *complaint, ...)
-#else
-complain (va_alist)
- va_dcl
-#endif
+complain (struct complaint *complaint,...)
{
va_list args;
-#ifdef ANSI_PROTOTYPES
va_start (args, complaint);
-#else
- struct complaint *complaint;
-
- va_start (args);
- 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;
}
@@ -91,36 +80,51 @@ 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:
+ if (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ begin_line ();
+ fputs_filtered ("During symbol reading, ", gdb_stderr);
+ wrap_here ("");
+ vfprintf_filtered (gdb_stderr, complaint->message, args);
+ fputs_filtered (".\n", gdb_stderr);
+ }
+ 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:
+ if (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ begin_line ();
+ fputs_filtered ("During symbol reading...", gdb_stderr);
+ vfprintf_filtered (gdb_stderr, complaint->message, args);
+ fputs_filtered ("...", gdb_stderr);
+ 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:
+ if (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ vfprintf_filtered (gdb_stderr, complaint->message, args);
+ fputs_filtered ("...", gdb_stderr);
+ 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
performance hog. */
- gdb_flush (gdb_stdout);
+ gdb_flush (gdb_stderr);
va_end (args);
}
@@ -133,18 +137,16 @@ complain (va_alist)
context for the user to figure it out. */
void
-clear_complaints (sym_reading, noisy)
- int sym_reading;
- int noisy;
+clear_complaints (int sym_reading, int 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)
+ if (!sym_reading && !noisy && complaint_series > 1 && !warning_hook)
{
/* Terminate previous series, since caller won't. */
puts_filtered ("\n");
@@ -154,7 +156,7 @@ clear_complaints (sym_reading, noisy)
}
void
-_initialize_complaints ()
+_initialize_complaints (void)
{
add_show_from_set
(add_set_cmd ("complaints", class_support, var_zinteger,
diff --git a/contrib/gdb/gdb/complaints.h b/contrib/gdb/gdb/complaints.h
index 4b9b5de..ecd822f 100644
--- a/contrib/gdb/gdb/complaints.h
+++ b/contrib/gdb/gdb/complaints.h
@@ -1,21 +1,23 @@
/* Definitions for complaint handling during symbol reading in GDB.
- Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1995, 1998, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 +32,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. */
@@ -43,11 +45,9 @@ extern struct complaint complaint_root[1];
/* Functions that handle complaints. (in complaints.c) */
-extern void
-complain PARAMS ((struct complaint *, ...));
+extern void complain (struct complaint *, ...);
-extern void
-clear_complaints PARAMS ((int, int));
+extern void clear_complaints (int, int);
-#endif /* !defined (COMPLAINTS_H) */
+#endif /* !defined (COMPLAINTS_H) */
diff --git a/contrib/gdb/gdb/completer.c b/contrib/gdb/gdb/completer.c
new file mode 100644
index 0000000..30a84d6
--- /dev/null
+++ b/contrib/gdb/gdb/completer.c
@@ -0,0 +1,713 @@
+/* Line completion stuff for GDB, the GNU debugger.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "expression.h"
+#include "filenames.h" /* for DOSish file names */
+
+/* FIXME: This is needed because of lookup_cmd_1().
+ We should be calling a hook instead so we eliminate the CLI dependency. */
+#include "gdbcmd.h"
+
+/* Needed for rl_completer_word_break_characters() and for
+ filename_completion_function. */
+#include <readline/readline.h>
+
+/* readline defines this. */
+#undef savestring
+
+#include "completer.h"
+
+/* Prototypes for local functions */
+char *line_completion_function (char *text, int matches, char *line_buffer,
+ int point);
+
+/* readline uses the word breaks for two things:
+ (1) In figuring out where to point the TEXT parameter to the
+ rl_completion_entry_function. Since we don't use TEXT for much,
+ it doesn't matter a lot what the word breaks are for this purpose, but
+ it does affect how much stuff M-? lists.
+ (2) If one of the matches contains a word break character, readline
+ will quote it. That's why we switch between
+ gdb_completer_word_break_characters and
+ gdb_completer_command_word_break_characters. I'm not sure when
+ we need this behavior (perhaps for funky characters in C++ symbols?). */
+
+/* Variables which are necessary for fancy command line editing. */
+static char *gdb_completer_word_break_characters =
+" \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
+ readline library sees one in any of the current completion strings,
+ it thinks that the string needs to be quoted and automatically supplies
+ a leading quote. */
+static char *gdb_completer_command_word_break_characters =
+" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
+
+/* When completing on file names, we remove from the list of word
+ break characters any characters that are commonly used in file
+ names, such as '-', '+', '~', etc. Otherwise, readline displays
+ incorrect completion candidates. */
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+/* MS-DOS and MS-Windows use colon as part of the drive spec, and most
+ programs support @foo style response files. */
+static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@";
+#else
+static char *gdb_completer_file_name_break_characters = " \t\n*|\"';:?><";
+#endif
+
+/* These are used when completing on locations, which can mix file
+ names and symbol names separated by a colon. */
+static char *gdb_completer_loc_break_characters = " \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. */
+static char *gdb_completer_quote_characters = "'";
+
+/* Accessor for some completer data that may interest other files. */
+
+char *
+get_gdb_completer_word_break_characters (void)
+{
+ return gdb_completer_word_break_characters;
+}
+
+char *
+get_gdb_completer_quote_characters (void)
+{
+ return gdb_completer_quote_characters;
+}
+
+/* Line completion interface function for readline. */
+
+char *
+readline_line_completion_function (char *text, int matches)
+{
+ return line_completion_function (text, matches, rl_line_buffer, rl_point);
+}
+
+/* This can be used for functions which don't want to complete on symbols
+ but don't want to complete on anything else either. */
+char **
+noop_completer (char *text, char *prefix)
+{
+ return NULL;
+}
+
+/* Complete on filenames. */
+char **
+filename_completer (char *text, char *word)
+{
+ int subsequent_name;
+ char **return_val;
+ int return_val_used;
+ int return_val_alloced;
+
+ return_val_used = 0;
+ /* Small for testing. */
+ return_val_alloced = 1;
+ return_val = (char **) xmalloc (return_val_alloced * sizeof (char *));
+
+ subsequent_name = 0;
+ while (1)
+ {
+ char *p;
+ p = filename_completion_function (text, subsequent_name);
+ if (return_val_used >= return_val_alloced)
+ {
+ return_val_alloced *= 2;
+ return_val =
+ (char **) xrealloc (return_val,
+ return_val_alloced * sizeof (char *));
+ }
+ if (p == NULL)
+ {
+ return_val[return_val_used++] = p;
+ break;
+ }
+ /* We need to set subsequent_name to a non-zero value before the
+ continue line below, because otherwise, if the first file seen
+ by GDB is a backup file whose name ends in a `~', we will loop
+ indefinitely. */
+ subsequent_name = 1;
+ /* Like emacs, don't complete on old versions. Especially useful
+ in the "source" command. */
+ if (p[strlen (p) - 1] == '~')
+ continue;
+
+ {
+ char *q;
+ if (word == text)
+ /* Return exactly p. */
+ return_val[return_val_used++] = p;
+ else if (word > text)
+ {
+ /* Return some portion of p. */
+ q = xmalloc (strlen (p) + 5);
+ strcpy (q, p + (word - text));
+ return_val[return_val_used++] = q;
+ xfree (p);
+ }
+ else
+ {
+ /* Return some of TEXT plus p. */
+ q = xmalloc (strlen (p) + (text - word) + 5);
+ strncpy (q, word, text - word);
+ q[text - word] = '\0';
+ strcat (q, p);
+ return_val[return_val_used++] = q;
+ xfree (p);
+ }
+ }
+ }
+#if 0
+ /* There is no way to do this just long enough to affect quote inserting
+ without also affecting the next completion. This should be fixed in
+ readline. FIXME. */
+ /* Insure that readline does the right thing
+ with respect to inserting quotes. */
+ rl_completer_word_break_characters = "";
+#endif
+ return return_val;
+}
+
+/* Complete on locations, which might be of two possible forms:
+
+ file:line
+ or
+ symbol+offset
+
+ This is intended to be used in commands that set breakpoints etc. */
+char **
+location_completer (char *text, char *word)
+{
+ int n_syms = 0, n_files = 0;
+ char ** fn_list = NULL;
+ char ** list = NULL;
+ char *p;
+ int quote_found = 0;
+ int quoted = *text == '\'' || *text == '"';
+ int quote_char = '\0';
+ char *colon = NULL;
+ char *file_to_match = NULL;
+ char *symbol_start = text;
+ char *orig_text = text;
+ size_t text_len;
+
+ /* Do we have an unquoted colon, as in "break foo.c::bar"? */
+ for (p = text; *p != '\0'; ++p)
+ {
+ if (*p == '\\' && p[1] == '\'')
+ p++;
+ else if (*p == '\'' || *p == '"')
+ {
+ quote_found = *p;
+ quote_char = *p++;
+ while (*p != '\0' && *p != quote_found)
+ {
+ if (*p == '\\' && p[1] == quote_found)
+ p++;
+ p++;
+ }
+
+ if (*p == quote_found)
+ quote_found = 0;
+ else
+ break; /* hit the end of text */
+ }
+#if HAVE_DOS_BASED_FILE_SYSTEM
+ /* If we have a DOS-style absolute file name at the beginning of
+ TEXT, and the colon after the drive letter is the only colon
+ we found, pretend the colon is not there. */
+ else if (p < text + 3 && *p == ':' && p == text + 1 + quoted)
+ ;
+#endif
+ else if (*p == ':' && !colon)
+ {
+ colon = p;
+ symbol_start = p + 1;
+ }
+ else if (strchr (gdb_completer_word_break_characters, *p))
+ symbol_start = p + 1;
+ }
+
+ if (quoted)
+ text++;
+ text_len = strlen (text);
+
+ /* Where is the file name? */
+ if (colon)
+ {
+ char *s;
+
+ file_to_match = (char *) xmalloc (colon - text + 1);
+ strncpy (file_to_match, text, colon - text + 1);
+ /* Remove trailing colons and quotes from the file name. */
+ for (s = file_to_match + (colon - text);
+ s > file_to_match;
+ s--)
+ if (*s == ':' || *s == quote_char)
+ *s = '\0';
+ }
+ /* If the text includes a colon, they want completion only on a
+ symbol name after the colon. Otherwise, we need to complete on
+ symbols as well as on files. */
+ if (colon)
+ {
+ list = make_file_symbol_completion_list (symbol_start, word,
+ file_to_match);
+ xfree (file_to_match);
+ }
+ else
+ {
+ list = make_symbol_completion_list (symbol_start, word);
+ /* If text includes characters which cannot appear in a file
+ name, they cannot be asking for completion on files. */
+ if (strcspn (text, gdb_completer_file_name_break_characters) == text_len)
+ fn_list = make_source_files_completion_list (text, text);
+ }
+
+ /* How many completions do we have in both lists? */
+ if (fn_list)
+ for ( ; fn_list[n_files]; n_files++)
+ ;
+ if (list)
+ for ( ; list[n_syms]; n_syms++)
+ ;
+
+ /* Make list[] large enough to hold both lists, then catenate
+ fn_list[] onto the end of list[]. */
+ if (n_syms && n_files)
+ {
+ list = xrealloc (list, (n_syms + n_files + 1) * sizeof (char *));
+ memcpy (list + n_syms, fn_list, (n_files + 1) * sizeof (char *));
+ xfree (fn_list);
+ }
+ else if (n_files)
+ {
+ /* If we only have file names as possible completion, we should
+ bring them in sync with what rl_complete expects. The
+ problem is that if the user types "break /foo/b TAB", and the
+ possible completions are "/foo/bar" and "/foo/baz"
+ rl_complete expects us to return "bar" and "baz", without the
+ leading directories, as possible completions, because `word'
+ starts at the "b". But we ignore the value of `word' when we
+ call make_source_files_completion_list above (because that
+ would not DTRT when the completion results in both symbols
+ and file names), so make_source_files_completion_list returns
+ the full "/foo/bar" and "/foo/baz" strings. This produces
+ wrong results when, e.g., there's only one possible
+ completion, because rl_complete will prepend "/foo/" to each
+ candidate completion. The loop below removes that leading
+ part. */
+ for (n_files = 0; fn_list[n_files]; n_files++)
+ {
+ memmove (fn_list[n_files], fn_list[n_files] + (word - text),
+ strlen (fn_list[n_files]) + 1 - (word - text));
+ }
+ /* Return just the file-name list as the result. */
+ list = fn_list;
+ }
+ else if (!n_syms)
+ {
+ /* No completions at all. As the final resort, try completing
+ on the entire text as a symbol. */
+ list = make_symbol_completion_list (orig_text, word);
+ }
+
+ return list;
+}
+
+/* Complete on command names. Used by "help". */
+char **
+command_completer (char *text, char *word)
+{
+ return complete_on_cmdlist (cmdlist, text, word);
+}
+
+
+/* Here are some useful test cases for completion. FIXME: These should
+ be put in the test suite. They should be tested with both M-? and TAB.
+
+ "show output-" "radix"
+ "show output" "-radix"
+ "p" ambiguous (commands starting with p--path, print, printf, etc.)
+ "p " ambiguous (all symbols)
+ "info t foo" no completions
+ "info t " no completions
+ "info t" ambiguous ("info target", "info terminal", etc.)
+ "info ajksdlfk" no completions
+ "info ajksdlfk " no completions
+ "info" " "
+ "info " ambiguous (all info commands)
+ "p \"a" no completions (string constant)
+ "p 'a" ambiguous (all symbols starting with a)
+ "p b-a" ambiguous (all symbols starting with a)
+ "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 all at once. Returns a NULL-terminated array
+ of strings. Both the array and each element are allocated with
+ xmalloc. It can also return NULL if there are no completions.
+
+ TEXT is the caller's idea of the "word" we are looking at.
+
+ LINE_BUFFER is available to be looked at; it contains the entire text
+ of the line. POINT is the offset in that line of the cursor. You
+ should pretend that the line ends at POINT. */
+
+char **
+complete_line (char *text, char *line_buffer, int point)
+{
+ char **list = NULL;
+ char *tmp_command, *p;
+ /* Pointer within tmp_command which corresponds to text. */
+ char *word;
+ struct cmd_list_element *c, *result_list;
+
+ /* 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. */
+
+ rl_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);
+ p = tmp_command;
+
+ 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. */
+ word = tmp_command + point - strlen (text);
+
+ if (point == 0)
+ {
+ /* An empty line we want to consider ambiguous; that is, it
+ could be any command. */
+ c = (struct cmd_list_element *) -1;
+ result_list = 0;
+ }
+ else
+ {
+ c = lookup_cmd_1 (&p, cmdlist, &result_list, 1);
+ }
+
+ /* Move p up to the next interesting thing. */
+ while (*p == ' ' || *p == '\t')
+ {
+ p++;
+ }
+
+ if (!c)
+ {
+ /* It is an unrecognized command. So there are no
+ possible completions. */
+ list = NULL;
+ }
+ else if (c == (struct cmd_list_element *) -1)
+ {
+ char *q;
+
+ /* lookup_cmd_1 advances p up to the first ambiguous thing, but
+ doesn't advance over that thing itself. Do so now. */
+ q = p;
+ while (*q && (isalnum (*q) || *q == '-' || *q == '_'))
+ ++q;
+ 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". */
+ list = NULL;
+ }
+ else
+ {
+ /* We're trying to complete on the command which was ambiguous.
+ This we can deal with. */
+ if (result_list)
+ {
+ list = complete_on_cmdlist (*result_list->prefixlist, p,
+ word);
+ }
+ else
+ {
+ list = complete_on_cmdlist (cmdlist, p, word);
+ }
+ /* Insure that readline does the right thing with respect to
+ inserting quotes. */
+ rl_completer_word_break_characters =
+ gdb_completer_command_word_break_characters;
+ }
+ }
+ else
+ {
+ /* We've recognized a full command. */
+
+ if (p == tmp_command + point)
+ {
+ /* There is no non-whitespace in the line beyond the command. */
+
+ if (p[-1] == ' ' || p[-1] == '\t')
+ {
+ /* The command is followed by whitespace; we need to complete
+ on whatever comes after command. */
+ if (c->prefixlist)
+ {
+ /* It is a prefix command; what comes after it is
+ 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. */
+ rl_completer_word_break_characters =
+ gdb_completer_command_word_break_characters;
+ }
+ else if (c->enums)
+ {
+ list = complete_on_enum (c->enums, p, word);
+ rl_completer_word_break_characters =
+ gdb_completer_command_word_break_characters;
+ }
+ else
+ {
+ /* It is a normal command; what comes after it is
+ completed by the command's completer function. */
+ if (c->completer == filename_completer)
+ {
+ /* Many commands which want to complete on
+ file names accept several file names, as
+ in "run foo bar >>baz". So we don't want
+ to complete the entire text after the
+ command, just the last word. To this
+ end, we need to find the beginning of the
+ file name by starting at `word' and going
+ backwards. */
+ for (p = word;
+ p > tmp_command
+ && strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL;
+ p--)
+ ;
+ rl_completer_word_break_characters =
+ gdb_completer_file_name_break_characters;
+ }
+ else if (c->completer == location_completer)
+ {
+ /* Commands which complete on locations want to
+ see the entire argument. */
+ for (p = word;
+ p > tmp_command
+ && p[-1] != ' ' && p[-1] != '\t';
+ p--)
+ ;
+ }
+ list = (*c->completer) (p, word);
+ }
+ }
+ else
+ {
+ /* The command is not followed by whitespace; we need to
+ complete on the command itself. e.g. "p" which is a
+ command itself but also can complete to "print", "ptype"
+ etc. */
+ char *q;
+
+ /* Find the command we are completing on. */
+ q = p;
+ while (q > tmp_command)
+ {
+ if (isalnum (q[-1]) || q[-1] == '-' || q[-1] == '_')
+ --q;
+ else
+ break;
+ }
+
+ list = complete_on_cmdlist (result_list, q, word);
+
+ /* Insure that readline does the right thing
+ with respect to inserting quotes. */
+ rl_completer_word_break_characters =
+ gdb_completer_command_word_break_characters;
+ }
+ }
+ else
+ {
+ /* There is non-whitespace beyond the command. */
+
+ if (c->prefixlist && !c->allow_unknown)
+ {
+ /* It is an unrecognized subcommand of a prefix command,
+ e.g. "info adsfkdj". */
+ list = NULL;
+ }
+ else if (c->enums)
+ {
+ list = complete_on_enum (c->enums, p, word);
+ }
+ else
+ {
+ /* It is a normal command. */
+ if (c->completer == filename_completer)
+ {
+ /* See the commentary above about the specifics
+ of file-name completion. */
+ for (p = word;
+ p > tmp_command
+ && strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL;
+ p--)
+ ;
+ rl_completer_word_break_characters =
+ gdb_completer_file_name_break_characters;
+ }
+ else if (c->completer == location_completer)
+ {
+ for (p = word;
+ p > tmp_command
+ && p[-1] != ' ' && p[-1] != '\t';
+ p--)
+ ;
+ }
+ list = (*c->completer) (p, word);
+ }
+ }
+ }
+
+ return list;
+}
+
+/* Generate completions one by one for the completer. Each time we are
+ called return another potential completion to the caller.
+ line_completion just completes on commands or passes the buck to the
+ command's completer function, the stuff specific to symbol completion
+ is in make_symbol_completion_list.
+
+ TEXT is the caller's idea of the "word" we are looking at.
+
+ MATCHES is the number of matches that have currently been collected from
+ calling this completion function. When zero, then we need to initialize,
+ otherwise the initialization has already taken place and we can just
+ return the next potential completion string.
+
+ LINE_BUFFER is available to be looked at; it contains the entire text
+ of the line. POINT is the offset in that line of the cursor. You
+ should pretend that the line ends at POINT.
+
+ Returns NULL if there are no more completions, else a pointer to a string
+ which is a possible completion, it is the caller's responsibility to
+ free the string. */
+
+char *
+line_completion_function (char *text, int matches, char *line_buffer, int point)
+{
+ static char **list = (char **) NULL; /* Cache of completions */
+ static int index; /* Next cached completion */
+ char *output = NULL;
+
+ 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. */
+
+ if (list)
+ {
+ /* Free the storage used by LIST, but not by the strings inside.
+ This is because rl_complete_internal () frees the strings. */
+ xfree (list);
+ }
+ index = 0;
+ list = complete_line (text, line_buffer, point);
+ }
+
+ /* If we found a list of potential completions during initialization then
+ dole them out one at a time. The vector of completions is NULL
+ terminated, so after returning the last one, return NULL (and continue
+ to do so) each time we are called after that, until a new list is
+ available. */
+
+ if (list)
+ {
+ output = list[index];
+ if (output)
+ {
+ index++;
+ }
+ }
+
+#if 0
+ /* Can't do this because readline hasn't yet checked the word breaks
+ for figuring out whether to insert a quote. */
+ if (output == NULL)
+ /* Make sure the word break characters are set back to normal for the
+ next time that readline tries to complete something. */
+ rl_completer_word_break_characters =
+ gdb_completer_word_break_characters;
+#endif
+
+ return (output);
+}
+/* Skip over a possibly quoted word (as defined by the quote characters
+ and word break characters the completer uses). Returns pointer to the
+ location after the "word". */
+
+char *
+skip_quoted (char *str)
+{
+ char quote_char = '\0';
+ char *scan;
+
+ for (scan = str; *scan != '\0'; scan++)
+ {
+ if (quote_char != '\0')
+ {
+ /* Ignore everything until the matching close quote char */
+ if (*scan == quote_char)
+ {
+ /* Found matching close quote. */
+ scan++;
+ break;
+ }
+ }
+ else if (strchr (gdb_completer_quote_characters, *scan))
+ {
+ /* Found start of a quoted string. */
+ quote_char = *scan;
+ }
+ else if (strchr (gdb_completer_word_break_characters, *scan))
+ {
+ break;
+ }
+ }
+ return (scan);
+}
+
diff --git a/contrib/gdb/gdb/completer.h b/contrib/gdb/gdb/completer.h
new file mode 100644
index 0000000..98b9ed8
--- /dev/null
+++ b/contrib/gdb/gdb/completer.h
@@ -0,0 +1,44 @@
+/* Header for GDB line completion.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (COMPLETER_H)
+#define COMPLETER_H 1
+
+extern char **complete_line (char *text, char *line_buffer, int point);
+
+extern char *line_completion_function (char *, int, char *, int);
+
+extern char *readline_line_completion_function (char *text, int matches);
+
+extern char **noop_completer (char *, char *);
+
+extern char **filename_completer (char *, char *);
+
+extern char **location_completer (char *, char *);
+
+extern char **command_completer (char *, char *);
+
+extern char *get_gdb_completer_word_break_characters (void);
+
+extern char *get_gdb_completer_quote_characters (void);
+
+/* Exported to linespec.c */
+
+extern char *skip_quoted (char *str);
+
+#endif /* defined (COMPLETER_H) */
diff --git a/contrib/gdb/gdb/config.in b/contrib/gdb/gdb/config.in
index d6bfe94..f2bab55 100644
--- a/contrib/gdb/gdb/config.in
+++ b/contrib/gdb/gdb/config.in
@@ -1,17 +1,5 @@
/* config.in. Generated automatically from configure.in by autoheader. */
-/* Whether malloc must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_MALLOC
-
-/* Whether realloc must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_REALLOC
-
-/* Whether free must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_FREE
-
-/* Whether strerror must be declared even if <string.h> is included. */
-#undef NEED_DECLARATION_STRERROR
-
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
@@ -41,18 +29,24 @@
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define if you have <vfork.h>. */
+#undef HAVE_VFORK_H
+
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
+/* Define if the `setpgrp' function takes no argument. */
+#undef SETPGRP_VOID
+
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
@@ -71,13 +65,44 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define vfork as fork if vfork does not work. */
+#undef vfork
+
+/* Define if compiling on Solaris 7. */
+#undef _MSE_INT_H
+
+/* Define if your struct reg has r_fs. */
+#undef HAVE_STRUCT_REG_R_FS
+
+/* Define if your struct reg has r_gs. */
+#undef HAVE_STRUCT_REG_R_GS
+
+/* Define if <link.h> exists and defines struct link_map which has
+ members with an ``l_'' prefix. (For Solaris, SVR4, and
+ SVR4-like systems.) */
+#undef HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS
+
+/* Define if <link.h> exists and defines struct link_map which has
+ members with an ``lm_'' prefix. (For SunOS.) */
+#undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS
+
+/* Define if <link.h> exists and defines a struct so_map which has
+ members with an ``som_'' prefix. (Found on older *BSD systems.) */
+#undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
+
+/* Define if <sys/link.h> has struct link_map32 */
+#undef HAVE_STRUCT_LINK_MAP32
+
+/* Define if the prfpregset_t type is broken. */
+#undef PRFPREGSET_T_BROKEN
+
+/* Define if you want to use new multi-fd /proc interface
+ (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
+#undef NEW_PROC_API
+
/* Define if ioctl argument PIOCSET is available. */
#undef HAVE_PROCFS_PIOCSET
-/* /proc PID entries are directories containing the files
- ctl as map status */
-#undef HAVE_MULTIPLE_PROC_FDS
-
/* Define if the `long long' type works. */
#undef CC_HAS_LONG_LONG
@@ -109,18 +134,55 @@
to explicitly deallocate that memory when gdb calls exit. */
#undef MMCHECK_FORCE
-/* Define if you want to use the full-screen terminal user interface. */
-#undef TUI
-
/* Define if <proc_service.h> on solaris uses int instead of
size_t, and assorted other type changes. */
#undef PROC_SERVICE_IS_OLD
+/* If you want to specify a default CPU variant, define this to be its
+ name, as a C string. */
+#undef TARGET_CPU_DEFAULT
+
+/* Define if the simulator is being linked in. */
+#undef WITH_SIM
+
/* Set to true if the save_state_t structure is present */
-#define HAVE_STRUCT_SAVE_STATE_T 0
+#undef HAVE_STRUCT_SAVE_STATE_T
/* Set to true if the save_state_t structure has the ss_wide member */
-#define HAVE_STRUCT_MEMBER_SS_WIDE 0
+#undef HAVE_STRUCT_MEMBER_SS_WIDE
+
+/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
+#undef HAVE_PTRACE_GETREGS
+
+/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
+#undef HAVE_PT_GETDBREGS
+
+/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
+#undef HAVE_PT_GETXMMREGS
+
+/* Define if gnu-regex.c included with GDB should be used. */
+#undef USE_INCLUDED_REGEX
+
+/* BFD's default architecture. */
+#undef DEFAULT_BFD_ARCH
+
+/* BFD's default target vector. */
+#undef DEFAULT_BFD_VEC
+
+/* Multi-arch enabled. */
+#undef GDB_MULTI_ARCH
+
+/* hostfile */
+#undef GDB_XM_FILE
+
+/* targetfile */
+#undef GDB_TM_FILE
+
+/* nativefile */
+#undef GDB_NM_FILE
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -140,6 +202,9 @@
/* Define if you have the bzero function. */
#undef HAVE_BZERO
+/* Define if you have the canonicalize_file_name function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
@@ -155,9 +220,15 @@
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
+/* Define if you have the poll function. */
+#undef HAVE_POLL
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
+/* Define if you have the realpath function. */
+#undef HAVE_REALPATH
+
/* Define if you have the sbrk function. */
#undef HAVE_SBRK
@@ -170,9 +241,21 @@
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
+/* Define if you have the setpgrp function. */
+#undef HAVE_SETPGRP
+
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
+/* Define if you have the sigprocmask function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if you have the sigsetmask function. */
+#undef HAVE_SIGSETMASK
+
+/* Define if you have the socketpair function. */
+#undef HAVE_SOCKETPAIR
+
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
@@ -194,8 +277,8 @@
/* Define if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
-/* Define if you have the <endian.h> header file. */
-#undef HAVE_ENDIAN_H
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
@@ -212,12 +295,27 @@
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define if you have the <ncurses.h> header file. */
+#undef HAVE_NCURSES_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
+/* Define if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
/* Define if you have the <objlist.h> header file. */
#undef HAVE_OBJLIST_H
+/* Define if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
/* Define if you have the <ptrace.h> header file. */
#undef HAVE_PTRACE_H
@@ -227,6 +325,9 @@
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
+/* Define if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -236,9 +337,30 @@
/* Define if you have the <sys/debugreg.h> header file. */
#undef HAVE_SYS_DEBUGREG_H
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/fault.h> header file. */
+#undef HAVE_SYS_FAULT_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
/* Define if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
@@ -248,6 +370,15 @@
/* Define if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <sys/syscall.h> header file. */
+#undef HAVE_SYS_SYSCALL_H
+
+/* Define if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
/* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
@@ -260,6 +391,12 @@
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
+/* Define if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -281,6 +418,9 @@
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
+/* Define if you have the socket library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
/* Define if you have the w library (-lw). */
#undef HAVE_LIBW
@@ -296,6 +436,9 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
/* Define if malloc is not declared in system header files. */
#undef NEED_DECLARATION_MALLOC
@@ -311,6 +454,9 @@
/* Define if strdup is not declared in system header files. */
#undef NEED_DECLARATION_STRDUP
+/* Define if strstr is not declared in system header files. */
+#undef NEED_DECLARATION_STRSTR
+
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T
@@ -323,3 +469,33 @@
/* Define if <sys/procfs.h> has fpregset_t. */
#undef HAVE_FPREGSET_T
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prfpregset32_t. */
+#undef HAVE_PRFPREGSET32_T
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Define if <sys/procfs.h> has prsysent_t. */
+#undef HAVE_PRSYSENT_T
+
+/* Define if <sys/procfs.h> has pr_sigset_t. */
+#undef HAVE_PR_SIGSET_T
+
+/* Define if <sys/procfs.h> has pr_sigaction64_t. */
+#undef HAVE_PR_SIGACTION64_T
+
+/* Define if <sys/procfs.h> has pr_siginfo64_t. */
+#undef HAVE_PR_SIGINFO64_T
+
diff --git a/contrib/gdb/gdb/config/alpha/alpha-linux.mh b/contrib/gdb/gdb/config/alpha/alpha-linux.mh
index aa4a069..39f3532 100644
--- a/contrib/gdb/gdb/config/alpha/alpha-linux.mh
+++ b/contrib/gdb/gdb/config/alpha/alpha-linux.mh
@@ -1,9 +1,10 @@
# Host: Little-endian Alpha running Linux
-XDEPFILES= ser-tcp.o
XM_FILE= xm-alphalinux.h
NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o corelow.o core-regset.o alpha-nat.o \
- fork-child.o solib.o
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \
+ fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o
+
+LOADLIBES = -ldl -rdynamic
MMALLOC =
MMALLOC_CFLAGS = -DNO_MMALLOC
diff --git a/contrib/gdb/gdb/config/alpha/alpha-linux.mt b/contrib/gdb/gdb/config/alpha/alpha-linux.mt
index 7789252..dd1c8e2 100644
--- a/contrib/gdb/gdb/config/alpha/alpha-linux.mt
+++ b/contrib/gdb/gdb/config/alpha/alpha-linux.mt
@@ -1,3 +1,3 @@
# Target: Little-endian Alpha
-TDEPFILES= alpha-tdep.o
+TDEPFILES= alpha-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-alphalinux.h
diff --git a/contrib/gdb/gdb/config/alpha/alpha-osf1.mh b/contrib/gdb/gdb/config/alpha/alpha-osf1.mh
index 6ed0f95..6d53b44 100644
--- a/contrib/gdb/gdb/config/alpha/alpha-osf1.mh
+++ b/contrib/gdb/gdb/config/alpha/alpha-osf1.mh
@@ -1,5 +1,5 @@
# Host: Little-endian Alpha running OSF/1-1.x
-XDEPFILES=
XM_FILE= xm-alphaosf.h
NAT_FILE= nm-osf.h
-NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o osfsolib.o
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \
+ solib-osf.o solib.o
diff --git a/contrib/gdb/gdb/config/alpha/alpha-osf2.mh b/contrib/gdb/gdb/config/alpha/alpha-osf2.mh
index 569b6fd..b853ebb 100644
--- a/contrib/gdb/gdb/config/alpha/alpha-osf2.mh
+++ b/contrib/gdb/gdb/config/alpha/alpha-osf2.mh
@@ -1,5 +1,6 @@
# Host: Little-endian Alpha running OSF/1-2.x using procfs
-XDEPFILES=
XM_FILE= xm-alphaosf.h
NAT_FILE= nm-osf2.h
-NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o osfsolib.o procfs.o
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \
+ solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \
+ proc-why.o
diff --git a/contrib/gdb/gdb/config/alpha/alpha-osf3.mh b/contrib/gdb/gdb/config/alpha/alpha-osf3.mh
index 4997531..f074444 100644
--- a/contrib/gdb/gdb/config/alpha/alpha-osf3.mh
+++ b/contrib/gdb/gdb/config/alpha/alpha-osf3.mh
@@ -1,5 +1,6 @@
# Host: Little-endian Alpha running OSF/1-3.x and higher using procfs
-XDEPFILES=
XM_FILE= xm-alphaosf.h
NAT_FILE= nm-osf3.h
-NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o osfsolib.o procfs.o
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \
+ solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \
+ proc-why.o
diff --git a/contrib/gdb/gdb/config/alpha/fbsd.mh b/contrib/gdb/gdb/config/alpha/fbsd.mh
new file mode 100644
index 0000000..7e036e4
--- /dev/null
+++ b/contrib/gdb/gdb/config/alpha/fbsd.mh
@@ -0,0 +1,5 @@
+# Host: FreeBSD/Alpha
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+ solib.o solib-svr4.o solib-legacy.o \
+ corelow.o core-regset.o alphabsd-nat.o
+NAT_FILE= nm-fbsd.h
diff --git a/contrib/gdb/gdb/config/alpha/fbsd.mt b/contrib/gdb/gdb/config/alpha/fbsd.mt
new file mode 100644
index 0000000..48e54fa
--- /dev/null
+++ b/contrib/gdb/gdb/config/alpha/fbsd.mt
@@ -0,0 +1,3 @@
+# Target: FreeBSD/Alpha
+TDEPFILES= alpha-tdep.o alphafbsd-tdep.o
+TM_FILE= tm-fbsd.h
diff --git a/contrib/gdb/gdb/config/alpha/nm-fbsd.h b/contrib/gdb/gdb/config/alpha/nm-fbsd.h
new file mode 100644
index 0000000..f3fb129
--- /dev/null
+++ b/contrib/gdb/gdb/config/alpha/nm-fbsd.h
@@ -0,0 +1,45 @@
+/* Native-dependent definitions for FreeBSD/Alpha.
+ Copyright 1986, 1987, 1989, 1992, 1996, 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_FBSD_H
+#define NM_FBSD_H
+
+/* Type of the third argument to the `ptrace' system call. */
+#define PTRACE_ARG3_TYPE caddr_t
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* We can attach and detach. */
+#define ATTACH_DETACH
+
+/* The Alpha does not step over a breakpoint. */
+#define CANNOT_STEP_BREAKPOINT
+
+
+/* Shared library support. */
+
+#define SVR4_SHARED_LIBS
+
+#include "solib.h" /* Support for shared libraries. */
+#include "elf/common.h" /* Additional ELF shared library info. */
+
+#endif /* NM_FBSD_H */
diff --git a/contrib/gdb/gdb/config/alpha/nm-linux.h b/contrib/gdb/gdb/config/alpha/nm-linux.h
index eedb1a9..5d5e945 100644
--- a/contrib/gdb/gdb/config/alpha/nm-linux.h
+++ b/contrib/gdb/gdb/config/alpha/nm-linux.h
@@ -1,21 +1,29 @@
-/* Native definitions for alpha running Linux.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+/* Native definitions for alpha running GNU/Linux.
-This file is part of GDB.
+ Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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., 675 Mass Ave, Cambridge, MA 02139, 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. */
+
+#ifndef NM_LINUX_H
+#define NM_LINUX_H
+
+#include "nm-linux.h"
/* 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
@@ -24,16 +32,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
This routine returns true on success */
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-extern int
-get_longjmp_target PARAMS ((CORE_ADDR *));
-
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
+extern int get_longjmp_target (CORE_ADDR *);
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
+/* FIXME: This is probably true, or should be, on all GNU/Linux ports.
+ IA64? Sparc64? */
#define PTRACE_ARG3_TYPE long
/* ptrace transfers longs, the ptrace man page is lying. */
@@ -44,23 +50,12 @@ get_longjmp_target PARAMS ((CORE_ADDR *));
#define CANNOT_STEP_BREAKPOINT
-/* Linux has shared libraries. */
+/* GNU/Linux has shared libraries. */
#define GDB_TARGET_HAS_SHARED_LIBS
-/* Support for shared libraries. */
-
-#include "solib.h"
-
-#ifdef __ELF__
-#define SVR4_SHARED_LIBS
-#define TARGET_ELF64
-#endif
-
-/* This is a lie. It's actually in stdio.h. */
-
-#define PSIGNAL_IN_SIGNAL_H
-
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
#define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp))
+
+#endif /* NM_LINUX_H */
diff --git a/contrib/gdb/gdb/config/alpha/nm-osf.h b/contrib/gdb/gdb/config/alpha/nm-osf.h
index e06140d..5fc99e4 100644
--- a/contrib/gdb/gdb/config/alpha/nm-osf.h
+++ b/contrib/gdb/gdb/config/alpha/nm-osf.h
@@ -1,21 +1,22 @@
/* Native definitions for alpha running OSF/1.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1998, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -24,8 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
This routine returns true on success */
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-extern int
-get_longjmp_target PARAMS ((CORE_ADDR *));
+extern int get_longjmp_target (CORE_ADDR *);
/* ptrace register ``addresses'' are absolute. */
diff --git a/contrib/gdb/gdb/config/alpha/nm-osf2.h b/contrib/gdb/gdb/config/alpha/nm-osf2.h
index 01725ef..4b225af 100644
--- a/contrib/gdb/gdb/config/alpha/nm-osf2.h
+++ b/contrib/gdb/gdb/config/alpha/nm-osf2.h
@@ -1,21 +1,22 @@
/* Native definitions for alpha running OSF/1-2.x, using procfs.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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"
@@ -44,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return sizeof user struct to callers in less machine dependent routines */
#define KERNEL_U_SIZE kernel_u_size()
-extern int kernel_u_size PARAMS ((void));
+extern int kernel_u_size (void);
/* poll() doesn't seem to work properly for /proc in this version of the OS.
If we only specify POLLPRI, things hang. It seems to get better when we set
diff --git a/contrib/gdb/gdb/config/alpha/nm-osf3.h b/contrib/gdb/gdb/config/alpha/nm-osf3.h
index a1871a6..e2818d5 100644
--- a/contrib/gdb/gdb/config/alpha/nm-osf3.h
+++ b/contrib/gdb/gdb/config/alpha/nm-osf3.h
@@ -1,21 +1,22 @@
/* Native definitions for alpha running OSF/1-3.x and higher, using procfs.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ 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. */
/* OSF/1-3.x fixes some OSF/1-2.x procfs peculiarities and adds
a new one. */
diff --git a/contrib/gdb/gdb/config/alpha/tm-alphalinux.h b/contrib/gdb/gdb/config/alpha/tm-alphalinux.h
index d836a70..23592aa 100644
--- a/contrib/gdb/gdb/config/alpha/tm-alphalinux.h
+++ b/contrib/gdb/gdb/config/alpha/tm-alphalinux.h
@@ -1,22 +1,26 @@
-/* Definitions to make GDB run on an Alpha box under Linux. The
- definitions here are used when the _target_ system is running Linux.
- Copyright 1996 Free Software Foundation, Inc.
+/* Definitions to make GDB run on an Alpha box under GNU/Linux. The
+ definitions here are used when the _target_ system is running
+ GNU/Linux.
-This file is part of GDB.
+ Copyright 1996, 1998, 1999, 2000, 2002 Free Software Foundation,
+ Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-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. */
#ifndef TM_LINUXALPHA_H
#define TM_LINUXALPHA_H
@@ -25,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Are we currently handling a signal ? */
-extern long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR));
+extern long alpha_linux_sigtramp_offset (CORE_ADDR);
#undef IN_SIGTRAMP
#define IN_SIGTRAMP(pc, name) (alpha_linux_sigtramp_offset (pc) >= 0)
@@ -37,7 +41,7 @@ extern long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR));
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
- on Linux and most implementations. */
+ on GNU/Linux and most implementations. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
@@ -68,13 +72,12 @@ extern long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR));
/* If FRAME refers to a sigtramp frame, return the address of the next frame.
- Under Linux, sigtramp handlers have dynamically generated procedure
- descriptors that make this hack unnecessary. */
+ Under GNU/Linux, sigtramp handlers have dynamically generated
+ procedure descriptors that make this hack unnecessary. */
#undef FRAME_PAST_SIGTRAMP_FRAME
#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) (0)
-/* We need this for the SOLIB_TRAMPOLINE stuff. */
-#include "tm-sysv4.h"
+#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */
diff --git a/contrib/gdb/gdb/config/alpha/tm-fbsd.h b/contrib/gdb/gdb/config/alpha/tm-fbsd.h
new file mode 100644
index 0000000..00d3c27
--- /dev/null
+++ b/contrib/gdb/gdb/config/alpha/tm-fbsd.h
@@ -0,0 +1,45 @@
+/* Target-dependent definitions for FreeBSD/Alpha.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_FBSD_H
+#define TM_FBSD_H
+
+#include "alpha/tm-alpha.h"
+
+/* FreeBSD uses the old gcc convention for struct returns. */
+
+#undef USE_STRUCT_CONVENTION
+#define USE_STRUCT_CONVENTION(gcc_p, type) \
+ alphafbsd_use_struct_convention (gcc_p, type)
+
+/* FreeBSD doesn't mark the outermost frame. While some FreeBSD/Alpha
+ releases include (a minimal amount of) debugging info in its
+ startup code (crt1.o), the safest thing is to consider the user
+ code entry point as the outermost frame. */
+#define FRAME_CHAIN_VALID(chain, thisframe) \
+ func_frame_chain_valid(chain, thisframe)
+
+/* Number of traps that happen between exec'ing the shell to run an
+ inferior, and when we finally get to the inferior code. The
+ default is right for FreeBSD. */
+
+#undef START_INFERIOR_TRAPS_EXPECTED
+
+#endif /* TM_FBSD_H */
diff --git a/contrib/gdb/gdb/config/alpha/xm-alphalinux.h b/contrib/gdb/gdb/config/alpha/xm-alphalinux.h
index a7aeab0..f1bc14d 100644
--- a/contrib/gdb/gdb/config/alpha/xm-alphalinux.h
+++ b/contrib/gdb/gdb/config/alpha/xm-alphalinux.h
@@ -1,29 +1,26 @@
-/* Host definitions for GDB running on an Alpha under Linux
- Copyright (C) 1996 Free Software Foundation, Inc.
+/* Host definitions for GDB running on an Alpha under GNU/Linux.
-This file is part of GDB.
+ Copyright 1996, 2001, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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., 675 Mass Ave, Cambridge, MA 02139, 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.
-#if !defined (HOST_BYTE_ORDER)
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-#endif
+ You should have received a copy of the GNU General Public 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 alpha has no siginterrupt routine. */
#define NO_SIGINTERRUPT
#define HAVE_TERMIOS
-#define HAVE_SIGSETMASK 1
#define USG
diff --git a/contrib/gdb/gdb/config/alpha/xm-alphaosf.h b/contrib/gdb/gdb/config/alpha/xm-alphaosf.h
index 40b7fe0..67d3cc4 100644
--- a/contrib/gdb/gdb/config/alpha/xm-alphaosf.h
+++ b/contrib/gdb/gdb/config/alpha/xm-alphaosf.h
@@ -1,25 +1,22 @@
/* Host definitions for GDB running on an alpha under OSF/1
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1992, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (HOST_BYTE_ORDER)
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-#endif
+ You should have received a copy of the GNU General Public 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 alpha has no siginterrupt routine. */
#define NO_SIGINTERRUPT
diff --git a/contrib/gdb/gdb/config/i386/cygwin.mh b/contrib/gdb/gdb/config/i386/cygwin.mh
index d93acb6..ce4656f 100644
--- a/contrib/gdb/gdb/config/i386/cygwin.mh
+++ b/contrib/gdb/gdb/config/i386/cygwin.mh
@@ -1,6 +1,5 @@
MH_CFLAGS=
XM_FILE=xm-cygwin.h
-XDEPFILES=ser-tcp.o
-NATDEPFILES= win32-nat.o
-NAT_FILE=../nm-empty.h
+NATDEPFILES= i386-nat.o win32-nat.o corelow.o
+NAT_FILE=nm-cygwin.h
XM_CLIBS=
diff --git a/contrib/gdb/gdb/config/i386/embed.mt b/contrib/gdb/gdb/config/i386/embed.mt
new file mode 100644
index 0000000..6925a83
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/embed.mt
@@ -0,0 +1,3 @@
+# Target: Embedded Intel 386
+TDEPFILES= i386-tdep.o i387-tdep.o
+TM_FILE= tm-i386.h
diff --git a/contrib/gdb/gdb/config/i386/fbsd.mh b/contrib/gdb/gdb/config/i386/fbsd.mh
index 499ed48..364dfa6 100644
--- a/contrib/gdb/gdb/config/i386/fbsd.mh
+++ b/contrib/gdb/gdb/config/i386/fbsd.mh
@@ -1,5 +1,7 @@
# Host: Intel 386 running FreeBSD
-XDEPFILES= ser-tcp.o
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o
-XM_FILE= xm-i386bsd.h
+
+XM_FILE= xm-i386.h
+
NAT_FILE= nm-fbsd.h
+# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
+NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-aout.o core-regset.o i386-nat.o i387-nat.o i386bsd-nat.o i386fbsd-nat.o
diff --git a/contrib/gdb/gdb/config/i386/fbsd.mt b/contrib/gdb/gdb/config/i386/fbsd.mt
index e644f1c..7a95e00 100644
--- a/contrib/gdb/gdb/config/i386/fbsd.mt
+++ b/contrib/gdb/gdb/config/i386/fbsd.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running FreeBSD
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
TM_FILE= tm-fbsd.h
diff --git a/contrib/gdb/gdb/config/i386/go32.mh b/contrib/gdb/gdb/config/i386/go32.mh
index 311ee1c..3d3bdfd 100644
--- a/contrib/gdb/gdb/config/i386/go32.mh
+++ b/contrib/gdb/gdb/config/i386/go32.mh
@@ -1,8 +1,17 @@
-MH_CFLAGS=-D__GO32__ -D__MSDOS__
-XDEPFILES= go32-xdep.o
+# Host: Intel x86 running DJGPP
+# we don't need mmalloc on DJGPP
+MH_CFLAGS= -DNO_MMALLOC
+MMALLOC=
+MMALLOC_CFLAGS=
+
XM_FILE= xm-go32.h
-HOST_IPC=-DDOS_IPC
-SER_HARDWIRE= ser-go32.o
-CC=i386-go32-gcc -O2 -fno-omit-frame-pointer
+
+NAT_FILE= nm-go32.h
+NATDEPFILES= go32-nat.o i386-nat.o i387-nat.o
+
+TERMCAP=
+HOST_IPC=
+CC= gcc
+XM_CLIBS= -ldbg
diff --git a/contrib/gdb/gdb/config/i386/go32.mt b/contrib/gdb/gdb/config/i386/go32.mt
new file mode 100644
index 0000000..9b82c64
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/go32.mt
@@ -0,0 +1,3 @@
+# Target: Intel 386 running DJGPP
+TDEPFILES= i386-tdep.o i387-tdep.o
+TM_FILE= tm-go32.h
diff --git a/contrib/gdb/gdb/config/i386/i386aix.mh b/contrib/gdb/gdb/config/i386/i386aix.mh
index cea05f0..af88729 100644
--- a/contrib/gdb/gdb/config/i386/i386aix.mh
+++ b/contrib/gdb/gdb/config/i386/i386aix.mh
@@ -1,7 +1,6 @@
# Host: IBM PS/2 (i386) running AIX PS/2
XM_FILE= xm-i386aix.h
-XDEPFILES=
NAT_FILE= nm-i386aix.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o
diff --git a/contrib/gdb/gdb/config/i386/i386bsd.mh b/contrib/gdb/gdb/config/i386/i386bsd.mh
index f95c6ed..01457d4 100644
--- a/contrib/gdb/gdb/config/i386/i386bsd.mh
+++ b/contrib/gdb/gdb/config/i386/i386bsd.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running 386BSD
XM_FILE= xm-i386bsd.h
-XDEPFILES=
NAT_FILE= nm-i386bsd.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o
diff --git a/contrib/gdb/gdb/config/i386/i386dgux.mh b/contrib/gdb/gdb/config/i386/i386dgux.mh
index e05ebcd..fd7f56c 100644
--- a/contrib/gdb/gdb/config/i386/i386dgux.mh
+++ b/contrib/gdb/gdb/config/i386/i386dgux.mh
@@ -1,9 +1,10 @@
# Host: Intel 386 running DGUX, cloned from SVR4
XM_FILE= xm-i386v4.h
-XDEPFILES= ser-tcp.o
# for network communication
XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386v4.h
-NATDEPFILES= corelow.o core-regset.o solib.o procfs.o fork-child.o i386v4-nat.o
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o \
+ solib.o solib-svr4.o solib-legacy.o \
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/contrib/gdb/gdb/config/i386/i386gnu.mh b/contrib/gdb/gdb/config/i386/i386gnu.mh
index 4ceac7e..252b2e5 100644
--- a/contrib/gdb/gdb/config/i386/i386gnu.mh
+++ b/contrib/gdb/gdb/config/i386/i386gnu.mh
@@ -1,6 +1,5 @@
# Host: Intel 386 running the GNU Hurd
-XDEPFILES= i387-tdep.o
-NATDEPFILES= i386gnu-nat.o gnu-nat.o fork-child.o solib.o corelow.o notify_S.o process_reply_S.o msg_reply_S.o msg_U.o exc_request_U.o exc_request_S.o
+NATDEPFILES= i386gnu-nat.o i387-nat.o gnu-nat.o fork-child.o solib.o solib-svr4.o solib-legacy.o corelow.o notify_S.o process_reply_S.o msg_reply_S.o msg_U.o exc_request_U.o exc_request_S.o
XM_FILE= xm-i386gnu.h
NAT_FILE= nm-gnu.h
MH_CFLAGS = -D_GNU_SOURCE
@@ -12,7 +11,6 @@ XM_CLIBS = -lshouldbeinlibc
msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
# ick
-MIG = mig
MIGCOM = $(MIG) -cc cat - /dev/null
# Reply servers need special massaging of the code mig generates, to make
diff --git a/contrib/gdb/gdb/config/i386/i386gnu.mt b/contrib/gdb/gdb/config/i386/i386gnu.mt
index 64fb018..e08e2a2 100644
--- a/contrib/gdb/gdb/config/i386/i386gnu.mt
+++ b/contrib/gdb/gdb/config/i386/i386gnu.mt
@@ -1,3 +1,3 @@
# Target: Intel 386/elf/GNU Hurd
-TDEPFILES= i386-tdep.o
+TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386gnu.h
diff --git a/contrib/gdb/gdb/config/i386/i386lynx.mh b/contrib/gdb/gdb/config/i386/i386lynx.mh
index 9cb086f..0552b4d 100644
--- a/contrib/gdb/gdb/config/i386/i386lynx.mh
+++ b/contrib/gdb/gdb/config/i386/i386lynx.mh
@@ -1,11 +1,9 @@
# Host: Intel 386 running LynxOS
-XM_FILE= xm-i386lynx.h
XM_CLIBS= -lbsd
-XDEPFILES= ser-tcp.o
NAT_FILE= nm-i386lynx.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o
-GDBSERVER_LIBS= -lbsd
-GDBSERVER_DEPFILES= low-lynx.o
+## OBSOLETE ## GDBSERVER_LIBS= -lbsd
+## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o
diff --git a/contrib/gdb/gdb/config/i386/i386m3.mh b/contrib/gdb/gdb/config/i386/i386m3.mh
index 0a83ebf7..41ea30c 100644
--- a/contrib/gdb/gdb/config/i386/i386m3.mh
+++ b/contrib/gdb/gdb/config/i386/i386m3.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running Mach3
-XDEPFILES= i387-tdep.o core-aout.o
-NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o
+NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o
NAT_CLIBS= -lmachid -lnetname -lmach
XM_FILE= xm-i386m3.h
NAT_FILE= nm-m3.h
diff --git a/contrib/gdb/gdb/config/i386/i386mach.mh b/contrib/gdb/gdb/config/i386/i386mach.mh
index 44766c5..90dbdf4 100644
--- a/contrib/gdb/gdb/config/i386/i386mach.mh
+++ b/contrib/gdb/gdb/config/i386/i386mach.mh
@@ -4,7 +4,6 @@
# host and native, not target). Once we get the mach3 stuff working,
# I think it can go away.
-XDEPFILES=
XM_FILE= xm-i386mach.h
NAT_FILE= nm-i386mach.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o
diff --git a/contrib/gdb/gdb/config/i386/i386mk.mh b/contrib/gdb/gdb/config/i386/i386mk.mh
index 849677c..0c119be 100644
--- a/contrib/gdb/gdb/config/i386/i386mk.mh
+++ b/contrib/gdb/gdb/config/i386/i386mk.mh
@@ -1,4 +1,4 @@
# Host: Intel 386 running Mach3 with OSF 1/MK
-XDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o
+NATDEPFILES= os-mach3.o i386mach3-xdep.o i387-tdep.o
XM_FILE= xm-i386osf1mk.h
diff --git a/contrib/gdb/gdb/config/i386/i386sco.mh b/contrib/gdb/gdb/config/i386/i386sco.mh
index 69076b5..d039944 100644
--- a/contrib/gdb/gdb/config/i386/i386sco.mh
+++ b/contrib/gdb/gdb/config/i386/i386sco.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running SCO Unix (pre-SVR4)
XM_FILE= xm-i386sco.h
-XDEPFILES=
XM_CLIBS= -lPW
NAT_FILE= nm-i386sco.h
diff --git a/contrib/gdb/gdb/config/i386/i386sco4.mh b/contrib/gdb/gdb/config/i386/i386sco4.mh
index a13f993..2507e07 100644
--- a/contrib/gdb/gdb/config/i386/i386sco4.mh
+++ b/contrib/gdb/gdb/config/i386/i386sco4.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running SCO Unix 3.2v4
XM_FILE= xm-i386sco.h
-XDEPFILES=
XM_CLIBS= -lPW
NAT_FILE= nm-i386sco4.h
diff --git a/contrib/gdb/gdb/config/i386/i386sco5.mh b/contrib/gdb/gdb/config/i386/i386sco5.mh
index 3bea87a..7b8b827 100644
--- a/contrib/gdb/gdb/config/i386/i386sco5.mh
+++ b/contrib/gdb/gdb/config/i386/i386sco5.mh
@@ -8,10 +8,9 @@ XM_FILE= xm-i386sco.h
# runtime, but all come with the development system, so we always
# have socket(), gethostbyname(), and friends.
#
-XDEPFILES= ser-tcp.o
XM_CLIBS= -lPW -lsocket
NAT_FILE= nm-i386sco5.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corefile.o core-aout.o \
- corelow.o i386v-nat.o solib.o
+ corelow.o i386v-nat.o solib.o solib-svr4.o solib-legacy.o
diff --git a/contrib/gdb/gdb/config/i386/i386sol2.mh b/contrib/gdb/gdb/config/i386/i386sol2.mh
index ff24294..ab7f474 100644
--- a/contrib/gdb/gdb/config/i386/i386sol2.mh
+++ b/contrib/gdb/gdb/config/i386/i386sol2.mh
@@ -1,7 +1,8 @@
# Host: Intel 386 running Solaris 2 (SVR4)
XM_FILE= xm-i386v4.h
-XDEPFILES=
+XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386sol2.h
-NATDEPFILES= core-regset.o procfs.o fork-child.o i386v4-nat.o corelow.o
+NATDEPFILES= core-regset.o fork-child.o i386v4-nat.o i387-nat.o corelow.o \
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o
diff --git a/contrib/gdb/gdb/config/i386/i386sol2.mt b/contrib/gdb/gdb/config/i386/i386sol2.mt
index 80b576f..86d93a3 100644
--- a/contrib/gdb/gdb/config/i386/i386sol2.mt
+++ b/contrib/gdb/gdb/config/i386/i386sol2.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o
+TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-i386sol2.h
diff --git a/contrib/gdb/gdb/config/i386/i386v.mh b/contrib/gdb/gdb/config/i386/i386v.mh
index d67a30f..7f0ea6e 100644
--- a/contrib/gdb/gdb/config/i386/i386v.mh
+++ b/contrib/gdb/gdb/config/i386/i386v.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running System V
XM_FILE= xm-i386v.h
-XDEPFILES=
XM_CLIBS= -lPW
NAT_FILE= nm-i386v.h
diff --git a/contrib/gdb/gdb/config/i386/i386v32.mh b/contrib/gdb/gdb/config/i386/i386v32.mh
index 5b4175f..f394372 100644
--- a/contrib/gdb/gdb/config/i386/i386v32.mh
+++ b/contrib/gdb/gdb/config/i386/i386v32.mh
@@ -1,7 +1,6 @@
# Host: Intel 386 running System V release 3.2
XM_FILE= xm-i386v32.h
-XDEPFILES=
XM_CLIBS= -lPW
NAT_FILE= nm-i386v.h
diff --git a/contrib/gdb/gdb/config/i386/i386v4.mh b/contrib/gdb/gdb/config/i386/i386v4.mh
index 4653887..a3952bc 100644
--- a/contrib/gdb/gdb/config/i386/i386v4.mh
+++ b/contrib/gdb/gdb/config/i386/i386v4.mh
@@ -1,9 +1,10 @@
# Host: Intel 386 running SVR4
XM_FILE= xm-i386v4.h
-XDEPFILES=
# for network communication
XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386v4.h
-NATDEPFILES= corelow.o core-regset.o solib.o procfs.o fork-child.o i386v4-nat.o
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o \
+ solib.o solib-svr4.o solib-legacy.o \
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/contrib/gdb/gdb/config/i386/i386v42mp.mh b/contrib/gdb/gdb/config/i386/i386v42mp.mh
index 94b6c06..007a8bf 100644
--- a/contrib/gdb/gdb/config/i386/i386v42mp.mh
+++ b/contrib/gdb/gdb/config/i386/i386v42mp.mh
@@ -1,11 +1,18 @@
# Host: Intel 386 running SVR4
XM_FILE= xm-i386v4.h
-XDEPFILES=
# for network communication
XM_CLIBS= -lsocket -lnsl
# we don't want nm-i386v4.h since that defines LOSING_POLL which isn't
# appropriate for i386v42mp
NAT_FILE= nm-i386v42mp.h
-NATDEPFILES= corelow.o core-regset.o solib.o procfs.o fork-child.o i386v4-nat.o
+
+# NATDEPFILES must remain entirely on one line. When building a cross
+# debugger, configure will cause this line to be commented out in the
+# Makefile. Many non-GNU versions of make don't permit the use of a
+# continuation character (backslash) to extend a commented line. As a
+# consequence, make considers subsequent tab-indented lines to be
+# some sort of error.
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o i387-nat.o solib.o solib-svr4.o solib-legacy.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o uw-thread.o
+
diff --git a/contrib/gdb/gdb/config/i386/linux.mh b/contrib/gdb/gdb/config/i386/linux.mh
index 30de91d..cc645e95 100644
--- a/contrib/gdb/gdb/config/i386/linux.mh
+++ b/contrib/gdb/gdb/config/i386/linux.mh
@@ -1,7 +1,12 @@
-# Host: Intel 386 running GNU/Linux
+# Host: Intel 386 running GNU/Linux.
-XM_FILE= xm-linux.h
-XDEPFILES= ser-tcp.o
+XM_FILE= xm-i386.h
NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o i386v-nat.o i386v4-nat.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
+ core-aout.o i386-nat.o i386-linux-nat.o i387-nat.o \
+ proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o
+
+# The dynamically loaded libthread_db needs access to symbols in the
+# gdb executable.
+LOADLIBES = -ldl -rdynamic
diff --git a/contrib/gdb/gdb/config/i386/linux.mt b/contrib/gdb/gdb/config/i386/linux.mt
index 66cc97d..43bc2d26 100644
--- a/contrib/gdb/gdb/config/i386/linux.mt
+++ b/contrib/gdb/gdb/config/i386/linux.mt
@@ -1,5 +1,6 @@
# Target: Intel 386 running GNU/Linux
-TDEPFILES= i386-tdep.o i387-tdep.o
+TDEPFILES= i386-tdep.o i386-linux-tdep.o i387-tdep.o \
+ solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-linux.h
-GDBSERVER_DEPFILES= low-linux.o
+GDBSERVER_DEPFILES = linux-low.o linux-i386-low.o reg-i386.o
diff --git a/contrib/gdb/gdb/config/i386/nbsd.mh b/contrib/gdb/gdb/config/i386/nbsd.mh
index c76b897..66f4561 100644
--- a/contrib/gdb/gdb/config/i386/nbsd.mh
+++ b/contrib/gdb/gdb/config/i386/nbsd.mh
@@ -1,5 +1,12 @@
# Host: Intel 386 running NetBSD
-XDEPFILES= ser-tcp.o
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o i386b-nat.o
+
+# NATDEPFILES must remain entirely on one line for *BSD. When
+# building a cross debugger, configure will cause this line to be
+# commented out in the Makefile. BSD make doesn't permit the use of a
+# continuation character (backslash) to extend a commented line. As a
+# consequence, BSD make considers subsequent tab-indented lines to be
+# "unassociated shell commands".
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o i387-nat.o i386bsd-nat.o i386nbsd-nat.o solib.o solib-sunos.o
+
XM_FILE= xm-nbsd.h
NAT_FILE= nm-nbsd.h
diff --git a/contrib/gdb/gdb/config/i386/nbsd.mt b/contrib/gdb/gdb/config/i386/nbsd.mt
index 7570850..8ab606e 100644
--- a/contrib/gdb/gdb/config/i386/nbsd.mt
+++ b/contrib/gdb/gdb/config/i386/nbsd.mt
@@ -1,3 +1,5 @@
# Target: Intel 386 running NetBSD
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o
TM_FILE= tm-nbsd.h
+
+## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/contrib/gdb/gdb/config/i386/nbsdelf.mh b/contrib/gdb/gdb/config/i386/nbsdelf.mh
new file mode 100644
index 0000000..f25a406
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nbsdelf.mh
@@ -0,0 +1,4 @@
+# Host: Intel 386 running NetBSD
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o i387-nat.o i386bsd-nat.o i386nbsd-nat.o solib.o solib-svr4.o solib-legacy.o
+XM_FILE= xm-nbsd.h
+NAT_FILE= nm-nbsdelf.h
diff --git a/contrib/gdb/gdb/config/i386/nbsdelf.mt b/contrib/gdb/gdb/config/i386/nbsdelf.mt
new file mode 100644
index 0000000..ab173d3
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nbsdelf.mt
@@ -0,0 +1,5 @@
+# Target: Intel 386 running NetBSD
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
+TM_FILE= tm-nbsdelf.h
+
+## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/contrib/gdb/gdb/config/i386/ncr3000.mh b/contrib/gdb/gdb/config/i386/ncr3000.mh
index 4f60756..4e669ba 100644
--- a/contrib/gdb/gdb/config/i386/ncr3000.mh
+++ b/contrib/gdb/gdb/config/i386/ncr3000.mh
@@ -10,7 +10,7 @@ CC = /usr/ccs/ATT/cc
CFLAGS =
XM_FILE= xm-i386v4.h
-XDEPFILES=
NAT_FILE= nm-i386v4.h
-NATDEPFILES= corelow.o core-regset.o procfs.o fork-child.o i386v4-nat.o
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o procfs.o \
+ proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/contrib/gdb/gdb/config/i386/ncr3000.mt b/contrib/gdb/gdb/config/i386/ncr3000.mt
index 0bbf9b36..11bc474 100644
--- a/contrib/gdb/gdb/config/i386/ncr3000.mt
+++ b/contrib/gdb/gdb/config/i386/ncr3000.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o
+TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-i386v4.h
diff --git a/contrib/gdb/gdb/config/i386/nm-cygwin.h b/contrib/gdb/gdb/config/i386/nm-cygwin.h
new file mode 100644
index 0000000..b5e4890
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-cygwin.h
@@ -0,0 +1,38 @@
+/* Native definitions for Intel x86 running CYGWIN.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#define NO_PTRACE_H
+
+#define I386_USE_GENERIC_WATCHPOINTS
+
+#include "i386/nm-i386.h"
+
+/* Support for hardware-assisted breakpoints and watchpoints. */
+
+#define I386_DR_LOW_SET_CONTROL(VAL) cygwin_set_dr7 (VAL)
+extern void cygwin_set_dr7 (unsigned);
+
+#define I386_DR_LOW_SET_ADDR(N,ADDR) cygwin_set_dr (N,ADDR)
+extern void cygwin_set_dr (int, CORE_ADDR);
+
+#define I386_DR_LOW_RESET_ADDR(N)
+
+#define I386_DR_LOW_GET_STATUS() cygwin_get_dr6 ()
+extern unsigned cygwin_get_dr6 (void);
diff --git a/contrib/gdb/gdb/config/i386/nm-fbsd.h b/contrib/gdb/gdb/config/i386/nm-fbsd.h
index 727623c..939b880 100644
--- a/contrib/gdb/gdb/config/i386/nm-fbsd.h
+++ b/contrib/gdb/gdb/config/i386/nm-fbsd.h
@@ -1,27 +1,71 @@
-/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
+/* Native-dependent definitions for FreeBSD/i386.
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
+#ifndef NM_FBSD_H
+#define NM_FBSD_H
-/* Be shared lib aware */
-#include "solib.h"
+#ifdef HAVE_PT_GETDBREGS
+#define I386_USE_GENERIC_WATCHPOINTS
+#endif
+
+#include "i386/nm-i386.h"
+
+/* Provide access to the i386 hardware debugging registers. */
+
+#define I386_DR_LOW_SET_CONTROL(control) \
+ i386bsd_dr_set_control (control)
+extern void i386bsd_dr_set_control (unsigned long control);
+
+#define I386_DR_LOW_SET_ADDR(regnum, addr) \
+ i386bsd_dr_set_addr (regnum, addr)
+extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr);
+
+#define I386_DR_LOW_RESET_ADDR(regnum) \
+ i386bsd_dr_reset_addr (regnum)
+extern void i386bsd_dr_reset_addr (int regnum);
+
+#define I386_DR_LOW_GET_STATUS() \
+ i386bsd_dr_get_status ()
+extern unsigned long i386bsd_dr_get_status (void);
+
+
+/* Type of the third argument to the `ptrace' system call. */
+#define PTRACE_ARG3_TYPE caddr_t
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* Override child_resume in `infptrace.c' to work around a kernel bug. */
+#define CHILD_RESUME
+
+/* We can attach and detach. */
+#define ATTACH_DETACH
+
+
+/* Support for the user struct. */
+
+/* Return the size of the user struct. */
+
+#define KERNEL_U_SIZE kernel_u_size ()
+extern int kernel_u_size (void);
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
@@ -30,14 +74,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define KERNEL_U_ADDR USRSTACK
#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = i386_register_u_addr ((blockend),(regno));
+ (addr) = register_u_addr ((blockend), (regno))
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
+
-extern int
-i386_register_u_addr PARAMS ((int, int));
+/* Shared library support. */
-#define PTRACE_ARG3_TYPE char*
+/* The FreeBSD <link.h> uses the same condition to distinguish ELF
+ from a.out. ELF implies SVR4 shared libraries. */
+#if (defined (FREEBSD_ELF) || defined (__ELF__)) && !defined (FREEBSD_AOUT)
+#define SVR4_SHARED_LIBS
+#endif
+
+#include "solib.h" /* Support for shared libraries. */
+#ifdef SVR4_SHARED_LIBS
+#include "elf/common.h" /* Additional ELF shared library info. */
+#endif
+
+#ifndef SVR4_SHARED_LIBS
+
+/* Make structure definitions match up with those expected in `solib.c'. */
-/* make structure definitions match up with those expected in solib.c */
#define link_object sod
#define lo_name sod_name
#define lo_library sod_library
@@ -90,9 +147,6 @@ i386_register_u_addr PARAMS ((int, int));
#define ld_un d_un
#define ld_2 d_sdt
-/* Return sizeof user struct to callers in less machine dependent routines */
-
-#define KERNEL_U_SIZE kernel_u_size()
-extern int kernel_u_size PARAMS ((void));
+#endif /* !SVR4_SHARED_LIBS */
-#endif /* NM_FREEBSD_H */
+#endif /* NM_FBSD_H */
diff --git a/contrib/gdb/gdb/config/i386/nm-gnu.h b/contrib/gdb/gdb/config/i386/nm-gnu.h
index 95f25a5..fa6d829 100644
--- a/contrib/gdb/gdb/config/i386/nm-gnu.h
+++ b/contrib/gdb/gdb/config/i386/nm-gnu.h
@@ -1,21 +1,22 @@
/* Native-dependent definitions for Intel 386 running the GNU Hurd
- Copyright 1994, 1995 Free Software Foundation, Inc.
+ 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 the generic hurd definitions. */
diff --git a/contrib/gdb/gdb/config/i386/nm-go32.h b/contrib/gdb/gdb/config/i386/nm-go32.h
new file mode 100644
index 0000000..70b1907
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-go32.h
@@ -0,0 +1,38 @@
+/* Native definitions for Intel x86 running DJGPP.
+ Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#define NO_PTRACE_H
+
+#define I386_USE_GENERIC_WATCHPOINTS
+
+#include "i386/nm-i386.h"
+
+/* Support for hardware-assisted breakpoints and watchpoints. */
+
+#define I386_DR_LOW_SET_CONTROL(VAL) go32_set_dr7 (VAL)
+extern void go32_set_dr7 (unsigned);
+
+#define I386_DR_LOW_SET_ADDR(N,ADDR) go32_set_dr (N,ADDR)
+extern void go32_set_dr (int, CORE_ADDR);
+
+#define I386_DR_LOW_RESET_ADDR(N)
+
+#define I386_DR_LOW_GET_STATUS() go32_get_dr6 ()
+extern unsigned go32_get_dr6 (void);
diff --git a/contrib/gdb/gdb/config/i386/nm-i386.h b/contrib/gdb/gdb/config/i386/nm-i386.h
new file mode 100644
index 0000000..500bf7b
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-i386.h
@@ -0,0 +1,120 @@
+/* Native macro definitions for GDB on an Intel i[3456]86.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_I386_H
+#define NM_I386_H 1
+
+/* Hardware-assisted breakpoints and watchpoints. */
+
+/* Targets should define this to use the generic x86 watchpoint support. */
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
+#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
+#define TARGET_HAS_HARDWARE_WATCHPOINTS
+#endif
+
+/* Clear the reference counts and forget everything we knew about DRi. */
+extern void i386_cleanup_dregs (void);
+
+/* Insert a watchpoint to watch a memory region which starts at
+ address ADDR and whose length is LEN bytes. Watch memory accesses
+ of the type TYPE. Return 0 on success, -1 on failure. */
+extern int i386_insert_watchpoint (CORE_ADDR addr, int len, int type);
+
+/* Remove a watchpoint that watched the memory region which starts at
+ address ADDR, whose length is LEN bytes, and for accesses of the
+ type TYPE. Return 0 on success, -1 on failure. */
+extern int i386_remove_watchpoint (CORE_ADDR addr, int len, int type);
+
+/* Return non-zero if we can watch a memory region that starts at
+ address ADDR and whose length is LEN bytes. */
+extern int i386_region_ok_for_watchpoint (CORE_ADDR addr, int len);
+
+/* Return non-zero if the inferior has some break/watchpoint that
+ triggered. */
+extern int i386_stopped_by_hwbp (void);
+
+/* If the inferior has some break/watchpoint that triggered, return
+ the address associated with that break/watchpoint. Otherwise,
+ return zero. */
+extern CORE_ADDR i386_stopped_data_address (void);
+
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, EBUSY on failure. */
+extern int i386_insert_hw_breakpoint (CORE_ADDR addr, void *shadow);
+
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, -1 on failure. */
+extern int i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
+
+/* Returns the number of hardware watchpoints of type TYPE that we can
+ set. Value is positive if we can set CNT watchpoints, zero if
+ setting watchpoints of type TYPE is not supported, and negative if
+ CNT is more than the maximum number of watchpoints of type TYPE
+ that we can support. TYPE is one of bp_hardware_watchpoint,
+ bp_read_watchpoint, bp_write_watchpoint, or bp_hardware_breakpoint.
+ CNT is the number of such watchpoints used so far (including this
+ one). OTHERTYPE is non-zero if other types of watchpoints are
+ currently enabled.
+
+ We always return 1 here because we don't have enough information
+ about possible overlap of addresses that they want to watch. As an
+ extreme example, consider the case where all the watchpoints watch
+ the same address and the same region length: then we can handle a
+ virtually unlimited number of watchpoints, due to debug register
+ sharing implemented via reference counts in i386-nat.c. */
+
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
+
+/* Returns non-zero if we can use hardware watchpoints to watch a
+ region whose address is ADDR and whose length is LEN. */
+
+#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, len) \
+ i386_region_ok_for_watchpoint (addr, len)
+
+/* After a watchpoint trap, the PC points to the instruction after the
+ one that caused the trap. Therefore we don't need to step over it.
+ But we do need to reset the status register to avoid another trap. */
+
+#define HAVE_CONTINUABLE_WATCHPOINT
+
+#define STOPPED_BY_WATCHPOINT(W) (i386_stopped_data_address () != 0)
+
+#define target_stopped_data_address() i386_stopped_data_address ()
+
+/* Use these macros for watchpoint insertion/removal. */
+
+#define target_insert_watchpoint(addr, len, type) \
+ i386_insert_watchpoint (addr, len, type)
+
+#define target_remove_watchpoint(addr, len, type) \
+ i386_remove_watchpoint (addr, len, type)
+
+#define target_insert_hw_breakpoint(addr, shadow) \
+ i386_insert_hw_breakpoint (addr, shadow)
+
+#define target_remove_hw_breakpoint(addr, shadow) \
+ i386_remove_hw_breakpoint (addr, shadow)
+
+#define DECR_PC_AFTER_HW_BREAK 0
+
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
+#endif /* NM_I386_H */
diff --git a/contrib/gdb/gdb/config/i386/nm-i386aix.h b/contrib/gdb/gdb/config/i386/nm-i386aix.h
index 4240393..4a6ffc1 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386aix.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386aix.h
@@ -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
diff --git a/contrib/gdb/gdb/config/i386/nm-i386bsd.h b/contrib/gdb/gdb/config/i386/nm-i386bsd.h
index 7366f2d..0015af2 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386bsd.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386bsd.h
@@ -1,21 +1,23 @@
/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1993, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,13 +28,12 @@ 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));
-extern int
-i386_register_u_addr PARAMS ((int, int));
+extern int i386_register_u_addr (int, int);
#define PTRACE_ARG3_TYPE char*
diff --git a/contrib/gdb/gdb/config/i386/nm-i386lynx.h b/contrib/gdb/gdb/config/i386/nm-i386lynx.h
index e29821f..5d0d41d 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386lynx.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386lynx.h
@@ -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
diff --git a/contrib/gdb/gdb/config/i386/nm-i386mach.h b/contrib/gdb/gdb/config/i386/nm-i386mach.h
index f01d2b1..ef10a28 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386mach.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386mach.h
@@ -1,24 +1,28 @@
/* Native definitions for Mach on an Intel 386
- Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 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 "regcache.h"
/* 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
diff --git a/contrib/gdb/gdb/config/i386/nm-i386sco.h b/contrib/gdb/gdb/config/i386/nm-i386sco.h
index 33ab6de..b467761 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386sco.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386sco.h
@@ -1,22 +1,24 @@
/* Native support for i386.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1994, 1998, 2000
+ 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,13 +29,12 @@ 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));
-extern int
-i386_register_u_addr PARAMS ((int, int));
+extern int i386_register_u_addr (int, int);
/* When calling functions on SCO, sometimes we get an error writing some
of the segment registers. This would appear to be a kernel
diff --git a/contrib/gdb/gdb/config/i386/nm-i386sco4.h b/contrib/gdb/gdb/config/i386/nm-i386sco4.h
index 41daef5..6947f3f 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386sco4.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386sco4.h
@@ -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. */
diff --git a/contrib/gdb/gdb/config/i386/nm-i386sco5.h b/contrib/gdb/gdb/config/i386/nm-i386sco5.h
index 10e749b..db2880c 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386sco5.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386sco5.h
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU General Public 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PTRACE_ATTACH 10
#define PTRACE_DETACH 11
-
-
diff --git a/contrib/gdb/gdb/config/i386/nm-i386sol2.h b/contrib/gdb/gdb/config/i386/nm-i386sol2.h
index 2ae966c..0e6b3ef 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386sol2.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386sol2.h
@@ -1,35 +1,60 @@
/* Native support for i386 running Solaris 2.
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
-#ifdef HAVE_THREAD_DB_LIB
+#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints */
-#ifdef __STDC__
-struct objfile;
-#endif
+#define TARGET_HAS_HARDWARE_WATCHPOINTS
-#define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
+/* The man page for proc4 on solaris 6 and 7 says that the system
+ can support "thousands" of hardware watchpoints, but gives no
+ method for finding out how many. So just tell GDB 'yes'. */
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE, CNT, OT) 1
-void sol_thread_new_objfile PARAMS ((struct objfile *objfile));
+/* When a hardware watchpoint fires off the PC will be left at the
+ instruction following the one which caused the watchpoint.
+ It will *NOT* be necessary for GDB to step over the watchpoint. */
+#define HAVE_CONTINUABLE_WATCHPOINT
-#define FIND_NEW_THREADS sol_find_new_threads
-void sol_find_new_threads PARAMS ((void));
+/* Solaris x86 2.6 and 2.7 targets have a kernel bug when stepping
+ over an instruction that causes a page fault without triggering
+ a hardware watchpoint. The kernel properly notices that it shouldn't
+ stop, because the hardware watchpoint is not triggered, but it forgets
+ the step request and continues the program normally.
+ Work around the problem by removing hardware watchpoints if a step is
+ requested, GDB will check for a hardware watchpoint trigger after the
+ step anyway. */
+#define CANNOT_STEP_HW_WATCHPOINTS
-#endif
+extern int procfs_stopped_by_watchpoint (ptid_t);
+#define STOPPED_BY_WATCHPOINT(W) \
+ procfs_stopped_by_watchpoint(inferior_ptid)
+
+/* Use these macros for watchpoint insertion/deletion. */
+/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
+
+extern int procfs_set_watchpoint (ptid_t, CORE_ADDR, int, int, int);
+#define target_insert_watchpoint(ADDR, LEN, TYPE) \
+ procfs_set_watchpoint (inferior_ptid, ADDR, LEN, TYPE, 1)
+#define target_remove_watchpoint(ADDR, LEN, TYPE) \
+ procfs_set_watchpoint (inferior_ptid, ADDR, 0, 0, 0)
+
+#endif /* NEW_PROC_API */
diff --git a/contrib/gdb/gdb/config/i386/nm-i386v.h b/contrib/gdb/gdb/config/i386/nm-i386v.h
index 8e6877e..e7bfca4 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386v.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386v.h
@@ -1,22 +1,24 @@
/* Native support for i386.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1993, 1998, 2000
+ 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,10 +29,9 @@ 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));
-extern int
-i386_register_u_addr PARAMS ((int, int));
+extern int i386_register_u_addr (int, int);
diff --git a/contrib/gdb/gdb/config/i386/nm-i386v4.h b/contrib/gdb/gdb/config/i386/nm-i386v4.h
index 8722a40..02d445e 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386v4.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386v4.h
@@ -1,22 +1,24 @@
/* Native support for i386 running SVR4.
- Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1993, 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"
diff --git a/contrib/gdb/gdb/config/i386/nm-i386v42mp.h b/contrib/gdb/gdb/config/i386/nm-i386v42mp.h
index 6ffd128..72e440d 100644
--- a/contrib/gdb/gdb/config/i386/nm-i386v42mp.h
+++ b/contrib/gdb/gdb/config/i386/nm-i386v42mp.h
@@ -1,22 +1,23 @@
/* Native support for i386 running SVR4.
- Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1996, 1997, 1998
+ 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"
-
diff --git a/contrib/gdb/gdb/config/i386/nm-linux.h b/contrib/gdb/gdb/config/i386/nm-linux.h
index ad0b8db..8ae3ece 100644
--- a/contrib/gdb/gdb/config/i386/nm-linux.h
+++ b/contrib/gdb/gdb/config/i386/nm-linux.h
@@ -1,73 +1,83 @@
-/* Native support for GNU/Linux, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1992, 1996, 1998
- Free Software Foundation, Inc.
+/* Native support for GNU/Linux x86.
-This file is part of GDB.
+ Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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. */
#ifndef NM_LINUX_H
#define NM_LINUX_H
-#include "i386/nm-i386v.h"
+/* GNU/Linux supports the i386 hardware debugging registers. */
+#define I386_USE_GENERIC_WATCHPOINTS
+
+#include "i386/nm-i386.h"
+#include "nm-linux.h"
-/* Return sizeof user struct to callers in less machine dependent routines */
+/* Support for the user area. */
+/* Return the size of the user struct. */
+extern int kernel_u_size (void);
#define KERNEL_U_SIZE kernel_u_size()
-extern int kernel_u_size PARAMS ((void));
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
+/* This is the amount to substract from u.u_ar0 to get the offset in
+ the core file of the register values. */
+#define KERNEL_U_ADDR 0
+/* Offset of the registers within the user area. */
#define U_REGS_OFFSET 0
-/* GNU/Linux supports the 386 hardware debugging registers. */
-
-#define TARGET_HAS_HARDWARE_WATCHPOINTS
-
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
-
-/* After a watchpoint trap, the PC points to the instruction after
- the one that caused the trap. Therefore we don't need to step over it.
- But we do need to reset the status register to avoid another trap. */
-#define HAVE_CONTINUABLE_WATCHPOINT
-
-#define STOPPED_BY_WATCHPOINT(W) \
- i386_stopped_by_watchpoint (inferior_pid)
-
-/* Use these macros for watchpoint insertion/removal. */
-
-#define target_insert_watchpoint(addr, len, type) \
- i386_insert_watchpoint (inferior_pid, addr, len, type)
-
-#define target_remove_watchpoint(addr, len, type) \
- i386_remove_watchpoint (inferior_pid, addr, len)
-
-/* We define this if link.h is available, because with ELF we use SVR4 style
- shared libraries. */
-
-#ifdef HAVE_LINK_H
-#define SVR4_SHARED_LIBS
-#include "solib.h" /* Support for shared libraries. */
-#endif
-
-extern CORE_ADDR
-i386_stopped_by_watchpoint PARAMS ((int));
-extern int
-i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw));
-extern int
-i386_remove_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len));
-
-#endif /* #ifndef NM_LINUX_H */
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum);
+#define REGISTER_U_ADDR(addr, blockend, regnum) \
+ (addr) = register_u_addr (blockend, regnum)
+
+/* Provide access to the i386 hardware debugging registers. */
+
+extern void i386_linux_dr_set_control (unsigned long control);
+#define I386_DR_LOW_SET_CONTROL(control) \
+ i386_linux_dr_set_control (control)
+
+extern void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr);
+#define I386_DR_LOW_SET_ADDR(regnum, addr) \
+ i386_linux_dr_set_addr (regnum, addr)
+
+extern void i386_linux_dr_reset_addr (int regnum);
+#define I386_DR_LOW_RESET_ADDR(regnum) \
+ i386_linux_dr_reset_addr (regnum)
+
+extern unsigned long i386_linux_dr_get_status (void);
+#define I386_DR_LOW_GET_STATUS() \
+ i386_linux_dr_get_status ()
+
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we
+ might fall back on the code `infptrace.c' (well a copy of that code
+ in `i386-linux-nat.c' for now) and we can access only the
+ general-purpose registers in that way. */
+extern int cannot_fetch_register (int regno);
+extern int cannot_store_register (int regno);
+#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno)
+#define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno)
+
+/* Override child_resume in `infptrace.c'. */
+#define CHILD_RESUME
+
+#endif /* nm-linux.h */
diff --git a/contrib/gdb/gdb/config/i386/nm-m3.h b/contrib/gdb/gdb/config/i386/nm-m3.h
index 5127091..00128cf 100644
--- a/contrib/gdb/gdb/config/i386/nm-m3.h
+++ b/contrib/gdb/gdb/config/i386/nm-m3.h
@@ -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. */
diff --git a/contrib/gdb/gdb/config/i386/nm-nbsd.h b/contrib/gdb/gdb/config/i386/nm-nbsd.h
index b59fec6..f926f9b 100644
--- a/contrib/gdb/gdb/config/i386/nm-nbsd.h
+++ b/contrib/gdb/gdb/config/i386/nm-nbsd.h
@@ -1,34 +1,33 @@
/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
/* Get generic NetBSD native definitions. */
-#include "nm-nbsd.h"
-
-/* #define FLOAT_INFO { i386_float_info(); } */
+#include "config/nm-nbsd.h"
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));
-extern int
-i386_register_u_addr PARAMS ((int, int));
+extern int i386_register_u_addr (int, int);
#endif /* NM_NBSD_H */
diff --git a/contrib/gdb/gdb/config/i386/nm-nbsdelf.h b/contrib/gdb/gdb/config/i386/nm-nbsdelf.h
new file mode 100644
index 0000000..1aee1c7
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-nbsdelf.h
@@ -0,0 +1,28 @@
+/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
+ Copyright 1986, 1987, 1989, 1992, 1994, 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_NBSDELF_H
+#define NM_NBSDELF_H
+
+#define SVR4_SHARED_LIBS
+#include "i386/nm-nbsd.h"
+
+#endif /* NM_NBSDELF_H */
diff --git a/contrib/gdb/gdb/config/i386/nm-obsd.h b/contrib/gdb/gdb/config/i386/nm-obsd.h
new file mode 100644
index 0000000..6113e14
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-obsd.h
@@ -0,0 +1,110 @@
+/* Native-dependent definitions for OpenBSD/i386.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
+
+/* Type of the third argument to the `ptrace' system call. */
+#define PTRACE_ARG3_TYPE caddr_t
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* We can attach and detach. */
+#define ATTACH_DETACH
+
+
+/* Support for the user struct. */
+
+/* Return the size of the user struct. */
+
+#define KERNEL_U_SIZE kernel_u_size ()
+extern int kernel_u_size (void);
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+#include <machine/vmparam.h>
+#define KERNEL_U_ADDR USRSTACK
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = register_u_addr ((blockend), (regno))
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
+
+
+/* Shared library support. */
+
+#include "solib.h" /* Support for shared libraries. */
+
+/* Make structure definitions match up with those expected in `solib.c'. */
+
+#define link_object sod
+#define lo_name sod_name
+#define lo_library sod_library
+#define lo_unused sod_reserved
+#define lo_major sod_major
+#define lo_minor sod_minor
+#define lo_next sod_next
+
+#define link_map so_map
+#define lm_addr som_addr
+#define lm_name som_path
+#define lm_next som_next
+#define lm_lop som_sod
+#define lm_lob som_sodbase
+#define lm_rwt som_write
+#define lm_ld som_dynamic
+#define lm_lpd som_spd
+
+#define link_dynamic_2 section_dispatch_table
+#define ld_loaded sdt_loaded
+#define ld_need sdt_sods
+#define ld_rules sdt_filler1
+#define ld_got sdt_got
+#define ld_plt sdt_plt
+#define ld_rel sdt_rel
+#define ld_hash sdt_hash
+#define ld_stab sdt_nzlist
+#define ld_stab_hash sdt_filler2
+#define ld_buckets sdt_buckets
+#define ld_symbols sdt_strings
+#define ld_symb_size sdt_str_sz
+#define ld_text sdt_text_sz
+#define ld_plt_sz sdt_plt_sz
+
+#define rtc_symb rt_symbol
+#define rtc_sp rt_sp
+#define rtc_next rt_next
+
+#define ld_debug so_debug
+#define ldd_version dd_version
+#define ldd_in_debugger dd_in_debugger
+#define ldd_sym_loaded dd_sym_loaded
+#define ldd_bp_addr dd_bpt_addr
+#define ldd_bp_inst dd_bpt_shadow
+#define ldd_cp dd_cc
+
+#define link_dynamic _dynamic
+#define ld_version d_version
+#define ldd d_debug
+#define ld_un d_un
+#define ld_2 d_sdt
+
+#endif /* nm-obsd.h */
diff --git a/contrib/gdb/gdb/config/i386/nm-ptx4.h b/contrib/gdb/gdb/config/i386/nm-ptx4.h
index 5e6cd56..32b76d2 100644
--- a/contrib/gdb/gdb/config/i386/nm-ptx4.h
+++ b/contrib/gdb/gdb/config/i386/nm-ptx4.h
@@ -1,22 +1,26 @@
/* Definitions to make GDB run on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "regcache.h"
#include "nm-sysv4.h"
@@ -38,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define CHILD_WAIT
struct target_waitstatus;
-extern int child_wait PARAMS ((int, struct target_waitstatus *));
+extern ptid_t child_wait (ptid_t, struct target_waitstatus *);
/*
* ptx does attach as of ptx version 2.1. Prior to that, the interface
@@ -49,7 +53,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
diff --git a/contrib/gdb/gdb/config/i386/nm-symmetry.h b/contrib/gdb/gdb/config/i386/nm-symmetry.h
index 80cf097..a589a3d 100644
--- a/contrib/gdb/gdb/config/i386/nm-symmetry.h
+++ b/contrib/gdb/gdb/config/i386/nm-symmetry.h
@@ -1,22 +1,26 @@
/* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1998, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "regcache.h"
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
@@ -28,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef _SEQUENT_
#define CHILD_WAIT
-extern int child_wait PARAMS ((int, struct target_waitstatus *));
+extern ptid_t child_wait (ptid_t, struct target_waitstatus *);
#endif
/* This is the amount to subtract from u.u_ar0
@@ -40,7 +44,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
diff --git a/contrib/gdb/gdb/config/i386/nm-x86-64.h b/contrib/gdb/gdb/config/i386/nm-x86-64.h
new file mode 100644
index 0000000..30e3731
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/nm-x86-64.h
@@ -0,0 +1,90 @@
+/* Native support for GNU/Linux x86-64.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc. Contributed by
+ Jiri Smid, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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_X86_64_H
+#define NM_X86_64_H
+
+#include "nm-linux.h"
+
+#define I386_USE_GENERIC_WATCHPOINTS
+#include "i386/nm-i386.h"
+
+/* Support for 8-byte wide hw watchpoints. */
+#define TARGET_HAS_DR_LEN_8 1
+
+/* Provide access to the i386 hardware debugging registers. */
+
+extern void x86_64_linux_dr_set_control (unsigned long control);
+#define I386_DR_LOW_SET_CONTROL(control) \
+ x86_64_linux_dr_set_control (control)
+
+extern void x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
+#define I386_DR_LOW_SET_ADDR(regnum, addr) \
+ x86_64_linux_dr_set_addr (regnum, addr)
+
+extern void x86_64_linux_dr_reset_addr (int regnum);
+#define I386_DR_LOW_RESET_ADDR(regnum) \
+ x86_64_linux_dr_reset_addr (regnum)
+
+extern unsigned long x86_64_linux_dr_get_status (void);
+#define I386_DR_LOW_GET_STATUS() \
+ x86_64_linux_dr_get_status ()
+
+
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = x86_64_register_u_addr ((blockend),(regno));
+CORE_ADDR x86_64_register_u_addr (CORE_ADDR, int);
+
+/* Return the size of the user struct. */
+#define KERNEL_U_SIZE kernel_u_size()
+extern int kernel_u_size (void);
+
+/* Offset of the registers within the user area. */
+#define U_REGS_OFFSET 0
+
+/* 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 0x0
+
+#define PTRACE_ARG3_TYPE void*
+#define PTRACE_XFER_TYPE unsigned long
+
+
+/* We define this if link.h is available, because with ELF we use SVR4 style
+ shared libraries. */
+
+#ifdef HAVE_LINK_H
+#define SVR4_SHARED_LIBS
+#include "solib.h" /* Support for shared libraries. */
+#endif
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+#undef PREPARE_TO_PROCEED
+
+#include <signal.h>
+
+extern void lin_thread_get_thread_signals (sigset_t * mask);
+#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
+
+#endif /* NM_X86_64.h */
diff --git a/contrib/gdb/gdb/config/i386/obsd.mh b/contrib/gdb/gdb/config/i386/obsd.mh
new file mode 100644
index 0000000..2bfd732
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/obsd.mh
@@ -0,0 +1,7 @@
+# Host: Intel 386 running OpenBSD
+
+XM_FILE= xm-i386.h
+
+NAT_FILE= nm-obsd.h
+# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
+NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-sunos.o corelow.o core-aout.o i386-nat.o i387-nat.o i386bsd-nat.o
diff --git a/contrib/gdb/gdb/config/i386/obsd.mt b/contrib/gdb/gdb/config/i386/obsd.mt
new file mode 100644
index 0000000..5c96426
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/obsd.mt
@@ -0,0 +1,3 @@
+# Target: Intel 386 running OpenBSD
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
+TM_FILE= tm-obsd.h
diff --git a/contrib/gdb/gdb/config/i386/ptx.mh b/contrib/gdb/gdb/config/i386/ptx.mh
index e623538..554b411 100644
--- a/contrib/gdb/gdb/config/i386/ptx.mh
+++ b/contrib/gdb/gdb/config/i386/ptx.mh
@@ -1,7 +1,7 @@
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387
XM_FILE= xm-ptx.h
-XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o
+NATDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o
XM_CLIBS= -lPW -lseq
NAT_FILE= nm-symmetry.h
diff --git a/contrib/gdb/gdb/config/i386/ptx4.mh b/contrib/gdb/gdb/config/i386/ptx4.mh
index 7b9d11b..e4aa55e 100644
--- a/contrib/gdb/gdb/config/i386/ptx4.mh
+++ b/contrib/gdb/gdb/config/i386/ptx4.mh
@@ -1,7 +1,8 @@
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387
XM_FILE= xm-ptx4.h
-XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o solib.o core-regset.o
+NATDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o \
+ core-regset.o solib.o solib-svr4.o solib-legacy.o
XM_CLIBS= -lseq
NAT_FILE= nm-ptx4.h
diff --git a/contrib/gdb/gdb/config/i386/symmetry.mh b/contrib/gdb/gdb/config/i386/symmetry.mh
index 69c05bc..486a2fb 100644
--- a/contrib/gdb/gdb/config/i386/symmetry.mh
+++ b/contrib/gdb/gdb/config/i386/symmetry.mh
@@ -1,5 +1,4 @@
# Host: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
-XDEPFILES=
XM_FILE= xm-symmetry.h
NAT_FILE= nm-symmetry.h
NATDEPFILES= inftarg.o fork-child.o corelow.o core-aout.o symm-nat.o
diff --git a/contrib/gdb/gdb/config/i386/tm-cygwin.h b/contrib/gdb/gdb/config/i386/tm-cygwin.h
index b1ad894..1d49133 100644
--- a/contrib/gdb/gdb/config/i386/tm-cygwin.h
+++ b/contrib/gdb/gdb/config/i386/tm-cygwin.h
@@ -1,5 +1,6 @@
/* Macro definitions for i386 running under the win32 API Unix.
- Copyright 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -15,113 +16,34 @@
You should have received a copy of the GNU General Public 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. */
+/* Use SSE registers if winnt.h contains information about them. */
+#ifdef HAVE_CONTEXT_EXTENDED_REGISTERS
+#define HAVE_SSE_REGS
+#else
+#undef HAVE_SSE_REGS
+#endif /* CONTEXT_EXTENDED_REGISTERS */
+#define HAVE_I387_REGS
-#include "i386/tm-i386v.h"
-
-#undef MAX_REGISTER_RAW_SIZE
-#undef MAX_REGISTER_VIRTUAL_SIZE
-#undef NUM_REGS
-#undef REGISTER_BYTE
-#undef REGISTER_BYTES
-#undef REGISTER_CONVERTIBLE
-#undef REGISTER_CONVERT_TO_RAW
-#undef REGISTER_CONVERT_TO_VIRTUAL
-#undef REGISTER_NAMES
-#undef REGISTER_RAW_SIZE
-#undef REGISTER_VIRTUAL_SIZE
-#undef REGISTER_VIRTUAL_TYPE
-
-/* Number of machine registers */
-
-#define NUM_REGS 24
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-/* the order of the first 8 registers must match the compiler's
- * numbering scheme (which is the same as the 386 scheme)
- * also, this table must match regmap in i386-pinsn.c.
- */
-
-#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
- "esp", "ebp", "esi", "edi", \
- "eip", "ps", "cs", "ss", \
- "ds", "es", "fs", "gs", \
- "st", "st(1)","st(2)","st(3)",\
- "st(4)","st(5)","st(6)","st(7)",}
-
-#define FP0_REGNUM 16
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#define REGISTER_BYTES (16 * 4 + 8 * 10)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) (((N) < 16) ? (N) * 4 : (((N) - 16) * 10) + (16 * 4))
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) (((N) < 16) ? 4 : 10)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((N) < 16) ? 4 : 10)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 10
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) \
- ((N < FP0_REGNUM) ? 0 : 1)
-
-/* Convert data from raw format for register REGNUM in buffer FROM
- to virtual format with type TYPE in buffer TO. */
-extern void
-i387_to_double PARAMS ((char *, char *));
-
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
-{ \
- double val; \
- i387_to_double ((FROM), (char *)&val); \
- store_floating ((TO), TYPE_LENGTH (TYPE), val); \
-}
-
-extern void
-double_to_i387 PARAMS ((char *, char *));
-
-#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
-{ \
- double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
- double_to_i387((char *)&val, (TO)); \
-}
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N < FP0_REGNUM) ? builtin_type_int : \
- builtin_type_double)
-
-#define NAMES_HAVE_UNDERSCORE
+#include "i386/tm-i386.h"
+#if 0
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0)
-extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR pc, char *name));
-
-extern char *cygwin_pid_to_str PARAMS ((int pid));
-#define target_pid_to_str(PID) cygwin_pid_to_str (PID)
+extern CORE_ADDR skip_trampoline_code (CORE_ADDR pc, char *name);
+#endif
+
+#define ATTACH_NO_WAIT
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms)
+#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
+#define CLEAR_SOLIB child_clear_solibs
+#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
+
+struct target_ops;
+char *cygwin_pid_to_str (ptid_t ptid);
+void child_solib_add (char *, int, struct target_ops *, int);
+char *child_solib_loaded_library_pathname(int);
+void child_clear_solibs (void);
+void dll_symbol_command (char *, int);
diff --git a/contrib/gdb/gdb/config/i386/tm-fbsd.h b/contrib/gdb/gdb/config/i386/tm-fbsd.h
index 9933e10..61f5de5 100644
--- a/contrib/gdb/gdb/config/i386/tm-fbsd.h
+++ b/contrib/gdb/gdb/config/i386/tm-fbsd.h
@@ -1,32 +1,89 @@
-/* Target macro definitions for i386 running FreeBSD
- Copyright (C) 1997 Free Software Foundation, Inc.
+/* Target-dependent definitions for FreeBSD/i386.
+ Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
+#ifndef TM_FBSD_H
+#define TM_FBSD_H
+#define HAVE_I387_REGS
+#include "i386/tm-i386.h"
-#undef NUM_REGS
-#define NUM_REGS 14
+/* FreeBSD/ELF uses stabs-in-ELF with the DWARF register numbering
+ scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
+ messes up the floating-point registers for a.out, but there is not
+ much we can do about that. */
+#undef STAB_REG_TO_REGNUM
+#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-#undef IN_SOLIB_CALL_TRAMPOLINE
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) STREQ (name, "_DYNAMIC")
+/* FreeBSD uses the old gcc convention for struct returns. */
+#define USE_STRUCT_CONVENTION(gcc_p, type) \
+ generic_use_struct_convention (1, type)
+
-extern i386_float_info ();
-#define FLOAT_INFO i386_float_info ()
+/* Support for longjmp. */
+
+/* Details about jmp_buf. It's supposed to be an array of integers. */
+
+#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
+#define JB_PC 0 /* Array index of saved PC. */
+
+/* Figure out where the longjmp will land. Store the address that
+ longjmp will jump to in *ADDR, and return non-zero if successful. */
+
+#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
+extern int get_longjmp_target (CORE_ADDR *addr);
+
+
+/* Support for signal handlers. */
+
+#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
+extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
+
+/* These defines allow the recognition of sigtramps as a function name
+ <sigtramp>.
+
+ FIXME: kettenis/2001-07-13: These should be added to the target
+ vector and turned into functions when we go "multi-arch". */
+
+#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
+#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
+extern CORE_ADDR i386bsd_sigtramp_start;
+extern CORE_ADDR i386bsd_sigtramp_end;
+
+/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
+extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
+
+
+/* Shared library support. */
+
+#ifndef SVR4_SHARED_LIBS
+
+/* Return non-zero if we are in a shared library trampoline code stub. */
+
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
+ (name && !strcmp(name, "_DYNAMIC"))
+
+#endif /* !SVR4_SHARED_LIBS */
+
+#endif /* TM_FBSD_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-go32.h b/contrib/gdb/gdb/config/i386/tm-go32.h
new file mode 100644
index 0000000..b660827
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/tm-go32.h
@@ -0,0 +1,68 @@
+/* Target-dependent definitions for Intel x86 running DJGPP.
+ Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_GO32_H
+#define TM_GO32_H
+
+#undef HAVE_SSE_REGS /* FIXME! go32-nat.c needs to support XMMi registers */
+#define HAVE_I387_REGS
+
+#include "i386/tm-i386.h"
+
+/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
+ chain-pointer.
+ In the case of the i386, the frame's nominal address
+ is the address of a 4-byte word containing the calling frame's address.
+ DJGPP doesn't have any special frames for signal handlers, they are
+ just normal C functions. */
+#undef FRAME_CHAIN
+#define FRAME_CHAIN(thisframe) \
+ (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame, 4) :\
+ 0)
+
+/* A macro that tells us whether the function invocation represented
+ by FI does not have a frame on the stack associated with it. If it
+ does not, FRAMELESS is set to 1, else 0. */
+#undef FRAMELESS_FUNCTION_INVOCATION
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+ (frameless_look_for_prologue(FI))
+
+extern CORE_ADDR i386go32_frame_saved_pc (struct frame_info *frame);
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(FRAME) (i386go32_frame_saved_pc ((FRAME)))
+
+/* Support for longjmp. */
+
+/* Details about jmp_buf. It's supposed to be an array of integers. */
+
+#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
+#define JB_PC 8 /* Array index of saved PC inside jmp_buf. */
+
+/* Figure out where the longjmp will land. Slurp the args out of the
+ stack. We expect the first arg to be a pointer to the jmp_buf
+ structure from which we extract the pc (JB_PC) that we will land
+ at. The pc is copied into ADDR. This routine returns true on
+ success. */
+
+#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
+extern int get_longjmp_target (CORE_ADDR *addr);
+
+#endif /* TM_GO32_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386.h b/contrib/gdb/gdb/config/i386/tm-i386.h
index e2039e5..f9326fe 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386.h
@@ -1,37 +1,49 @@
/* Macro definitions for GDB on an Intel i[345]86.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU General Public 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 */
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
+#include "regcache.h"
+
+/* Forward declarations for prototypes. */
struct frame_info;
struct frame_saved_regs;
+struct value;
struct type;
-#endif
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
+/* The format used for `long double' on almost all i386 targets is the
+ i387 extended floating-point format. In fact, of all targets in the
+ GCC 2.95 tree, only OSF/1 does it different, and insists on having
+ a `long double' that's not `long' at all. */
-/* Used for example in valprint.c:print_floating() to enable checking
- for NaN's */
+#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-#define IEEE_FLOAT
+/* Although the i386 extended floating-point has only 80 significant
+ bits, a `long double' actually takes up 96, probably to enforce
+ alignment. */
+
+#define TARGET_LONG_DOUBLE_BIT 96
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
@@ -47,15 +59,14 @@ struct type;
/* Advance PC across any function entry prologue instructions to reach some
"real" code. */
-#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
+#define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc))
-extern int i386_skip_prologue PARAMS ((int));
+extern int i386_skip_prologue (int);
-/* Immediately after a function call, return the saved pc. Can't always go
- through the frames for this because on some machines the new frame is not
- set up until the new function executes some instructions. */
+/* Immediately after a function call, return the saved pc. */
-#define SAVED_PC_AFTER_CALL(frame) (read_memory_integer (read_register (SP_REGNUM), 4))
+#define SAVED_PC_AFTER_CALL(frame) i386_saved_pc_after_call (frame)
+extern CORE_ADDR i386_saved_pc_after_call (struct frame_info *frame);
/* Stack grows downward. */
@@ -76,24 +87,38 @@ extern int i386_skip_prologue PARAMS ((int));
#define REGISTER_SIZE 4
-/* Number of machine registers */
-
-#define NUM_FREGS 0 /*8*/ /* Number of FP regs */
-#define NUM_REGS (16 + NUM_FREGS) /* Basic i*86 regs + FP regs */
+/* This register file is parameterized by two macros:
+ HAVE_I387_REGS --- register file should include i387 registers
+ HAVE_SSE_REGS --- register file should include SSE registers
+ If HAVE_SSE_REGS is #defined, then HAVE_I387_REGS must also be #defined.
+
+ However, GDB code should not test those macros with #ifdef, since
+ that makes code which is annoying to multi-arch. Instead, GDB code
+ should check the values of NUM_GREGS, NUM_FREGS, and NUM_SSE_REGS,
+ which will eventually get mapped onto architecture vector entries.
+
+ It's okay to use the macros in tm-*.h files, though, since those
+ files will get completely replaced when we multi-arch anyway. */
+
+/* Number of general registers, present on every 32-bit x86 variant. */
+#define NUM_GREGS (16)
+
+/* Number of floating-point unit registers. */
+#ifdef HAVE_I387_REGS
+#define NUM_FREGS (16)
+#else
+#define NUM_FREGS (0)
+#endif
-/* 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.
- The order of the first 8 registers must match the compiler's numbering
- scheme (which is the same as the 386 scheme) and also regmap in the various
- *-nat.c files. */
+/* Number of SSE registers. */
+#ifdef HAVE_SSE_REGS
+#define NUM_SSE_REGS (9)
+#else
+#define NUM_SSE_REGS (0)
+#endif
-#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
- "esp", "ebp", "esi", "edi", \
- "eip", "eflags", "cs", "ss", \
- "ds", "es", "fs", "gs", \
- "st0", "st1", "st2", "st3", \
- "st4", "st5", "st6", "st7", \
- }
+/* Largest number of registers we could have in any configuration. */
+#define MAX_NUM_REGS (16 + 16 + 9)
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
@@ -102,128 +127,178 @@ 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 */
+
+/* First FPU data register. */
+#ifdef HAVE_I387_REGS
+#define FP0_REGNUM 16
+#else
+#define FP0_REGNUM 0
+#endif
+
+/* Return the name of register REG. */
+
+#define REGISTER_NAME(reg) i386_register_name ((reg))
+extern char *i386_register_name (int reg);
+
+/* Use the "default" register numbering scheme for stabs and COFF. */
+
+#define STAB_REG_TO_REGNUM(reg) i386_stab_reg_to_regnum ((reg))
+#define SDB_REG_TO_REGNUM(reg) i386_stab_reg_to_regnum ((reg))
+extern int i386_stab_reg_to_regnum (int reg);
+
+/* Use the DWARF register numbering scheme for DWARF and DWARF 2. */
+
+#define DWARF_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
+#define DWARF2_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
+extern int i386_dwarf_reg_to_regnum (int reg);
+
+/* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to be
+ in use on any of the supported i386 targets. */
+
+
+/* Sizes of individual register sets. These cover the entire register
+ file, so summing up the sizes of those portions actually present
+ yields REGISTER_BYTES. */
+#define SIZEOF_GREGS (NUM_GREGS * 4)
+#define SIZEOF_FPU_REGS (8 * 10)
+#define SIZEOF_FPU_CTRL_REGS (8 * 4)
+#define SIZEOF_SSE_REGS (8 * 16 + 4)
-#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'. */
+#ifdef HAVE_SSE_REGS
+#define REGISTER_BYTES \
+ (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS)
+#else
+#ifdef HAVE_I387_REGS
+#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS)
+#else
+#define REGISTER_BYTES (SIZEOF_GREGS)
+#endif
+#endif
-#define REGISTER_BYTES ((NUM_REGS - NUM_FREGS)*4 + NUM_FREGS*10)
+/* Return the offset into the register array of the start of register
+ number REG. */
+#define REGISTER_BYTE(reg) i386_register_byte ((reg))
+extern int i386_register_byte (int reg);
-/* Index within `registers' of the first byte of the space for register N. */
+/* Return the number of bytes of storage in GDB's register array
+ occupied by register REG. */
+#define REGISTER_RAW_SIZE(reg) i386_register_raw_size ((reg))
+extern int i386_register_raw_size (int reg);
-#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. */
+/* Largest value REGISTER_RAW_SIZE can have. */
+#define MAX_REGISTER_RAW_SIZE 16
-#define REGISTER_RAW_SIZE(N) (((N) < FP0_REGNUM) ? 4 : 10)
+/* Return the size in bytes of the virtual type of register REG. */
+#define REGISTER_VIRTUAL_SIZE(reg) i386_register_virtual_size ((reg))
+extern int i386_register_virtual_size (int reg);
-/* Largest value REGISTER_RAW_SIZE can have. */
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+#define MAX_REGISTER_VIRTUAL_SIZE 16
-#define MAX_REGISTER_RAW_SIZE 10
+/* Return the GDB type object for the "standard" data type of data in
+ register REGNUM. */
-/* Number of bytes of storage in the program's representation
- for register N. */
+#define REGISTER_VIRTUAL_TYPE(regnum) i386_register_virtual_type (regnum)
+extern struct type *i386_register_virtual_type (int regnum);
-#define REGISTER_VIRTUAL_SIZE(N) (((N) < FP0_REGNUM) ? 4 : 8)
+/* Return true iff register REGNUM's virtual format is different from
+ its raw format. */
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+#define REGISTER_CONVERTIBLE(regnum) i386_register_convertible (regnum)
+extern int i386_register_convertible (int regnum);
+
+/* Convert data from raw format for register REGNUM in buffer FROM to
+ virtual format with type TYPE in buffer TO. */
-#define MAX_REGISTER_VIRTUAL_SIZE 8
+#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) \
+ i386_register_convert_to_virtual ((regnum), (type), (from), (to))
+extern void i386_register_convert_to_virtual (int regnum, struct type *type,
+ char *from, char *to);
-/* Return the GDB type object for the "standard" data type of data in
- register N. Perhaps si and di should go here, but potentially they
- could be used for things other than address. */
+/* Convert data from virtual format with type TYPE in buffer FROM to
+ raw format for register REGNUM in buffer TO. */
+
+#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) \
+ i386_register_convert_to_raw ((type), (regnum), (from), (to))
+extern void i386_register_convert_to_raw (struct type *type, int regnum,
+ char *from, char *to);
+
+/* Print out the i387 floating point state. */
+#ifdef HAVE_I387_REGS
+extern void i387_float_info (void);
+#define FLOAT_INFO { i387_float_info (); }
+#endif
+
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM) \
- ? lookup_pointer_type (builtin_type_void) \
- : (((N) < FP0_REGNUM) \
- ? builtin_type_int \
- : builtin_type_double))
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ i386_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
+extern CORE_ADDR i386_push_arguments (int nargs, struct value **args,
+ CORE_ADDR sp, int struct_return,
+ CORE_ADDR struct_addr);
/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
+ subroutine will return. This is called from call_function. */
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { char buf[REGISTER_SIZE]; \
- (SP) -= sizeof (ADDR); \
- store_address (buf, sizeof (ADDR), ADDR); \
- write_memory ((SP), buf, sizeof (ADDR)); }
+#define STORE_STRUCT_RETURN(addr, sp) \
+ i386_store_struct_return ((addr), (sp))
+extern void i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- i386_extract_return_value ((TYPE),(REGBUF),(VALBUF))
+#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) \
+ i386_extract_return_value ((type), (regbuf), (valbuf))
+extern void i386_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf);
-extern void i386_extract_return_value PARAMS ((struct type *, char [], char *));
+/* Write into the appropriate registers a function return value stored
+ in VALBUF of type TYPE, given in virtual format. */
-/* Write into appropriate registers a function return value of type TYPE, given
- in virtual format. */
+#define STORE_RETURN_VALUE(type, valbuf) \
+ i386_store_return_value ((type), (valbuf))
+extern void i386_store_return_value (struct type *type, char *valbuf);
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- else \
- write_register_bytes (0, (VALBUF), TYPE_LENGTH (TYPE)); \
- }
-
-/* Extract from an array REGBUF containing the (raw) register state the address
- in which a function should return its structure value, as a CORE_ADDR (or an
- expression that can be used as one). */
+/* Extract from an array REGBUF containing the (raw) register state
+ the address in which a function should return its structure value,
+ as a CORE_ADDR. */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) \
+ i386_extract_struct_value_address ((regbuf))
+extern CORE_ADDR i386_extract_struct_value_address (char *regbuf);
/* The following redefines make backtracing through sigtramp work.
They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
from the sigcontext structure which is pushed by the kernel on the
user stack, along with a pointer to it. */
-/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
- chain-pointer.
- In the case of the i386, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
-#define FRAME_CHAIN(thisframe) \
- ((thisframe)->signal_handler_caller \
- ? (thisframe)->frame \
- : (!inside_entry_file ((thisframe)->pc) \
- ? read_memory_integer ((thisframe)->frame, 4) \
- : 0))
+/* Return the chain-pointer for FRAME. In the case of the i386, the
+ frame's nominal address is the address of a 4-byte word containing
+ the calling frame's address. */
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
+#define FRAME_CHAIN(frame) i386_frame_chain ((frame))
+extern CORE_ADDR i386_frame_chain (struct frame_info *frame);
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- do { \
- if ((FI)->signal_handler_caller) \
- (FRAMELESS) = 0; \
- else \
- (FRAMELESS) = frameless_look_for_prologue(FI); \
- } while (0)
+/* Determine whether the function invocation represented by FRAME does
+ not have a from on the stack associated with it. If it does not,
+ return non-zero, otherwise return zero. */
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
+#define FRAMELESS_FUNCTION_INVOCATION(frame) \
+ i386_frameless_function_invocation (frame)
+extern int i386_frameless_function_invocation (struct frame_info *frame);
-#define FRAME_SAVED_PC(FRAME) \
- (((FRAME)->signal_handler_caller \
- ? sigtramp_saved_pc (FRAME) \
- : read_memory_integer ((FRAME)->frame + 4, 4)) \
- )
+/* Return the saved program counter for FRAME. */
-extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
+#define FRAME_SAVED_PC(frame) i386_frame_saved_pc (frame)
+extern CORE_ADDR i386_frame_saved_pc (struct frame_info *frame);
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
@@ -232,9 +307,9 @@ extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame. Can return -1, meaning no way
to tell, which is typical now that the C compiler delays popping them. */
-#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
+#define FRAME_NUM_ARGS(fi) (i386_frame_num_args(fi))
-extern int i386_frame_num_args PARAMS ((struct frame_info *));
+extern int i386_frame_num_args (struct frame_info *);
/* Return number of bytes at start of arglist that are not really args. */
@@ -246,28 +321,31 @@ extern int i386_frame_num_args PARAMS ((struct frame_info *));
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
-
-extern void i386_frame_find_saved_regs PARAMS ((struct frame_info *,
- struct frame_saved_regs *));
+extern void i386_frame_init_saved_regs (struct frame_info *);
+#define FRAME_INIT_SAVED_REGS(FI) i386_frame_init_saved_regs (FI)
+
/* Things needed for making the inferior call functions. */
+/* "An argument's size is increased, if necessary, to make it a
+ multiple of [32 bit] words. This may require tail padding,
+ depending on the size of the argument" - from the x86 ABI. */
+#define PARM_BOUNDARY 32
+
/* Push an empty stack frame, to record the current PC, etc. */
#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
-extern void i386_push_dummy_frame PARAMS ((void));
+extern void i386_push_dummy_frame (void);
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME { i386_pop_frame (); }
-extern void i386_pop_frame PARAMS ((void));
-
+extern void i386_pop_frame (void);
+
/* this is
* call 11223344 (32 bit relative)
* int3
@@ -277,28 +355,22 @@ 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
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- int from, to, delta, loc; \
- loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
- from = loc + 5; \
- to = (int)(fun); \
- delta = to - from; \
- *((char *)(dummyname) + 1) = (delta & 0xff); \
- *((char *)(dummyname) + 2) = ((delta >> 8) & 0xff); \
- *((char *)(dummyname) + 3) = ((delta >> 16) & 0xff); \
- *((char *)(dummyname) + 4) = ((delta >> 24) & 0xff); \
-}
-
-extern void print_387_control_word PARAMS ((unsigned int));
-extern void print_387_status_word PARAMS ((unsigned int));
+#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+ i386_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
+extern void i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
+ int nargs, struct value **args,
+ struct type *type, int gcc_p);
+
+/* FIXME: kettenis/2000-06-12: These do not belong here. */
+extern void print_387_control_word (unsigned int);
+extern void print_387_status_word (unsigned int);
/* Offset from SP to first arg on stack at first instruction of a function */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386aix.h b/contrib/gdb/gdb/config/i386/tm-i386aix.h
index b0121fa..a8f24ed 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386aix.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386aix.h
@@ -1,21 +1,23 @@
/* Macro defintions for IBM AIX PS/2 (i386).
- Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,42 +28,21 @@ 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
-#endif
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#undef REGISTER_CONVERTIBLE
-#define REGISTER_CONVERTIBLE(N) \
- ((N < FP0_REGNUM) ? 0 : 1)
-/* Convert data from raw format for register REGNUM in buffer FROM
- to virtual format with type TYPE in buffer TO. */
+/* AIX/i386 has FPU support. However, the native configuration (which
+ is the only supported configuration) doesn't make the FPU control
+ registers available. Override the appropriate symbols such that
+ only the normal FPU registers are included in GDB's register array. */
-#undef REGISTER_CONVERT_TO_VIRTUAL
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
-{ \
- double val; \
- i387_to_double ((FROM), (char *)&val); \
- store_floating ((TO), TYPE_LENGTH (TYPE), val); \
-}
-extern void
-i387_to_double PARAMS ((char *, char *));
+#undef NUM_FPREGS
+#define NUM_FPREGS (8)
-/* Convert data from virtual format with type TYPE in buffer FROM
- to raw format for register REGNUM in buffer TO. */
+#undef NUM_REGS
+#define NUM_REGS (NUM_GREGS + NUM_FPREGS)
-#undef REGISTER_CONVERT_TO_RAW
-#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
-{ \
- double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
- double_to_i387((char *)&val, (TO)); \
-}
-extern void
-double_to_i387 PARAMS ((char *, char *));
+#undef REGISTER_BYTES
+#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS)
#endif /* TM_I386AIX_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386bsd.h b/contrib/gdb/gdb/config/i386/tm-i386bsd.h
index 8b8c3a9..e2b2229 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386bsd.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386bsd.h
@@ -1,21 +1,23 @@
/* Macro definitions for i386 running under BSD Unix.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 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. */
#ifndef TM_I386BSD_H
#define TM_I386BSD_H 1
@@ -40,4 +42,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 */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386gnu.h b/contrib/gdb/gdb/config/i386/tm-i386gnu.h
index a6e3c08..00cb5a9 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386gnu.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386gnu.h
@@ -1,48 +1,56 @@
-/* Macro definitions for i386, GNU Hurd
- Copyright (C) 1992 Free Software Foundation, Inc.
+/* Macro definitions for i386 running the GNU Hurd.
+ Copyright 1992, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 gnu systems */
+#ifndef TM_I386GNU_H
+#define TM_I386GNU_H 1
+
+/* Include common definitions for GNU systems.
+ FIXME: This does not belong here since this is supposed to contain
+ only native-dependent information. */
#include "nm-gnu.h"
/* Thread flavors used in re-setting the T bit.
- * @@ this is also bad for cross debugging.
- */
-#define THREAD_STATE_FLAVOR i386_THREAD_STATE
+ FIXME: This is native-dependent. */
+#define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE
#define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT
#define THREAD_STATE_SET_TRACED(state) \
((struct i386_thread_state *)state)->efl |= 0x100
#define THREAD_STATE_CLEAR_TRACED(state) \
((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
-/* we can do it */
+/* We can attach and detach.
+ FIXME: This is probably native-dependent too. */
#define ATTACH_DETACH 1
-/* Sigh. There should be a file for i386 but no sysv stuff in it */
-#include "i386/tm-i386v.h"
+#define HAVE_I387_REGS
+#include "i386/tm-i386.h"
+
+/* We use stabs-in-ELF with the DWARF register numbering scheme. */
+
+#undef STAB_REG_TO_REGNUM
+#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
+
+/* Offset to saved PC in sigcontext. */
+#define SIGCONTEXT_PC_OFFSET 68
-/* I want to test this float info code. See comment in tm-i386v.h */
-#undef FLOAT_INFO
-#define FLOAT_INFO { i386_mach3_float_info (); }
+/* We need this file for the SOLIB_TRAMPOLINE stuff. */
+#include "tm-sysv4.h"
-/* Address of end of stack space.
- * for MACH, see <machine/vmparam.h>
- * @@@ I don't know what is in the 5 ints...
- */
-#undef STACK_END_ADDR
-#define STACK_END_ADDR (0xc0000000-sizeof(int [5]))
+#endif /* TM_I386GNU_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386lynx.h b/contrib/gdb/gdb/config/i386/tm-i386lynx.h
index 9e732b3..842f9a7 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386lynx.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386lynx.h
@@ -1,21 +1,22 @@
/* Macro definitions for Intel 386 running under LynxOS.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 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. */
#ifndef TM_I386LYNX_H
#define TM_I386LYNX_H
diff --git a/contrib/gdb/gdb/config/i386/tm-i386m3.h b/contrib/gdb/gdb/config/i386/tm-i386m3.h
index 2f97505..edc301d 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386m3.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386m3.h
@@ -1,21 +1,22 @@
/* Macro definitions for i386, Mach 3.0
- Copyright (C) 1992 Free Software Foundation, Inc.
+ Copyright 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 common definitions for Mach3 systems */
#include "nm-m3.h"
@@ -40,11 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* we can do it */
#define ATTACH_DETACH 1
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
/* Sigh. There should be a file for i386 but no sysv stuff in it */
#include "i386/tm-i386.h"
diff --git a/contrib/gdb/gdb/config/i386/tm-i386mk.h b/contrib/gdb/gdb/config/i386/tm-i386mk.h
index 3625efb..e46ca55 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386mk.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386mk.h
@@ -1,21 +1,22 @@
/* Macro definitions for i386, Mach 3.0, OSF 1/MK
- Copyright (C) 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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.
@@ -23,3 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define MK67 1
#include "i386/tm-i386m3.h"
+
+/* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent
+ to `double'. However, I'm not sure what is the consequence of:
+
+ #define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT
+ #define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT
+
+ So I'll go with the current status quo instead. It looks like this
+ target won't compile anyway. Perhaps it should be obsoleted? */
+
+#undef TARGET_LONG_DOUBLE_FORMAT
+#undef TARGET_LONG_DOUBLE_BIT
diff --git a/contrib/gdb/gdb/config/i386/tm-i386nw.h b/contrib/gdb/gdb/config/i386/tm-i386nw.h
index e5cdade..9ede2c0 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386nw.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386nw.h
@@ -1,21 +1,23 @@
/* Macro definitions for i386 running NetWare.
- Copyright 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -24,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Stop backtracing when we wander into main. */
-#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi)
+#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
/* Offsets (in target ints) into jmp_buf. Not defined in any system header
@@ -40,10 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
-extern int
-get_longjmp_target PARAMS ((CORE_ADDR *));
+extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-#endif /* ifndef TM_I386NW_H */
-
+#endif /* ifndef TM_I386NW_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386os9k.h b/contrib/gdb/gdb/config/i386/tm-i386os9k.h
index 2b48641..78fbc21 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386os9k.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386os9k.h
@@ -1,20 +1,22 @@
/* Macro definitions for i386 running under BSD Unix.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996
+ Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 +26,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.
@@ -32,14 +34,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
scheme (which is the same as the 386 scheme) and also regmap in the various
*-nat.c files. */
-#undef REGISTER_NAMES
+#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "eflags", "cs", "ss", \
"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 +62,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 */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386sco5.h b/contrib/gdb/gdb/config/i386/tm-i386sco5.h
index ffac5b3..e4cb014 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386sco5.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386sco5.h
@@ -1,22 +1,23 @@
/* Macro definitions for GDB on an Intel i386 running SCO Open Server 5.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright 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
@@ -51,12 +52,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define HAVE_STEPPABLE_WATCHPOINT
#define STOPPED_BY_WATCHPOINT(W) \
- i386_stopped_by_watchpoint (inferior_pid)
+ i386_stopped_by_watchpoint (PIDGET (inferior_ptid))
#define target_insert_watchpoint(addr, len, type) \
- i386_insert_watchpoint (inferior_pid, addr, len, type)
+ i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type)
#define target_remove_watchpoint(addr, len, type) \
- i386_remove_watchpoint (inferior_pid, addr, len)
+ i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len)
-#endif /* ifndef TM_I386SCO5_H */
+#endif /* ifndef TM_I386SCO5_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386sol2.h b/contrib/gdb/gdb/config/i386/tm-i386sol2.h
index dbd6317..c90e0d4 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386sol2.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386sol2.h
@@ -1,27 +1,42 @@
/* Macro definitions for GDB on an Intel i386 running Solaris 2.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
+#define HAVE_I387_REGS
#include "i386/tm-i386v4.h"
-
+
+/* We use stabs-in-ELF with the DWARF register numbering scheme. */
+
+#undef STAB_REG_TO_REGNUM
+#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
+
+/* If the current gcc for for this target does not produce correct
+ debugging information for float parameters, both prototyped and
+ unprototyped, then define this macro. This forces gdb to always
+ assume that floats are passed as doubles and then converted in the
+ callee. */
+
+#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
+
/* Signal handler frames under Solaris 2 are recognized by a return address
of 0xFFFFFFFF, the third parameter on the signal handler stack is
a pointer to an ucontext. */
@@ -35,30 +50,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
and for SunPRO 3.0, N_FUN symbols too. */
#define SOFUN_ADDRESS_MAYBE_MISSING
-extern char *sunpro_static_transform_name PARAMS ((char *));
+extern char *sunpro_static_transform_name (char *);
#define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x)
#define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '.')
#define FAULTED_USE_SIGINFO
-/* Macros to extract process id and thread id from a composite pid/tid */
-#define PIDGET(pid) ((pid) & 0xffff)
-#define TIDGET(pid) (((pid) >> 16) & 0xffff)
-
-/* Macro to extract carry from given regset. */
-#define PS_FLAG_CARRY 0x1 /* Carry bit in PS */
-#define PROCFS_GET_CARRY(regset) ((regset)[EFL] & PS_FLAG_CARRY)
-
-#ifdef HAVE_THREAD_DB_LIB
-
-extern char *solaris_pid_to_str PARAMS ((int pid));
-#define target_pid_to_str(PID) solaris_pid_to_str (PID)
-
-#else
-
-extern char *procfs_pid_to_str PARAMS ((int pid));
-#define target_pid_to_str(PID) procfs_pid_to_str (PID)
-
-#endif
-
-#endif /* ifndef TM_I386SOL2_H */
+#endif /* ifndef TM_I386SOL2_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386v.h b/contrib/gdb/gdb/config/i386/tm-i386v.h
index bb31cb0..d524652 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386v.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386v.h
@@ -1,21 +1,23 @@
/* Macro definitions for i386, Unix System V.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -31,133 +33,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 4
-/* Number of machine registers */
-
-#undef NUM_REGS
-#define NUM_REGS 16
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-/* the order of the first 8 registers must match the compiler's
- * numbering scheme (which is the same as the 386 scheme)
- * also, this table must match regmap in i386-pinsn.c.
- */
-
-#undef REGISTER_NAMES
-#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
- "esp", "ebp", "esi", "edi", \
- "eip", "ps", "cs", "ss", \
- "ds", "es", "fs", "gs", \
- }
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (NUM_REGS * 4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(N) ((N)*4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#undef REGISTER_VIRTUAL_SIZE
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#undef MAX_REGISTER_RAW_SIZE
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#undef MAX_REGISTER_VIRTUAL_SIZE
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-/* Perhaps si and di should go here, but potentially they could be
- used for things other than address. */
-
-#undef REGISTER_VIRTUAL_TYPE
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
- lookup_pointer_type (builtin_type_void) : 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. */
-
-#undef STORE_STRUCT_RETURN
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { char buf[REGISTER_SIZE]; \
- (SP) -= sizeof (ADDR); \
- store_address (buf, sizeof (ADDR), ADDR); \
- write_memory ((SP), buf, sizeof (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#undef EXTRACT_RETURN_VALUE
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#undef STORE_RETURN_VALUE
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer. */
-
-#undef FRAME_CHAIN
-#define FRAME_CHAIN(thisframe) \
- (!inside_entry_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-#undef FRAMELESS_FUNCTION_INVOCATION
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#undef FRAME_NUM_ARGS
-#define FRAME_NUM_ARGS(numargs, fi) (numargs) = -1
-
-#ifdef __STDC__ /* Forward decl's for prototypes */
-struct frame_info;
-struct frame_saved_regs;
-#endif
-
-extern int
-i386_frame_num_args PARAMS ((struct frame_info *));
-
-#endif /* ifndef TM_I386V_H */
+#endif /* ifndef TM_I386V_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386v4.h b/contrib/gdb/gdb/config/i386/tm-i386v4.h
index eafff01..2003b96d 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386v4.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386v4.h
@@ -1,28 +1,30 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.
- Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+ Copyright 1991, 1994, 1995, 1998, 1999, 2000
+ 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
/* Pick up most of what we need from the generic i386 target include file. */
-
+#define HAVE_I387_REGS
#include "i386/tm-i386.h"
/* Pick up more stuff from the generic SVR4 host include file. */
@@ -31,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Use the alternate method of determining valid frame chains. */
-#define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi)
+#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
/* Offsets (in target ints) into jmp_buf. Not defined in any system header
file, so we have to step through setjmp/longjmp with a debugger and figure
@@ -47,15 +49,14 @@ 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
we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
-extern int
-get_longjmp_target PARAMS ((CORE_ADDR *));
+extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
@@ -73,6 +74,6 @@ get_longjmp_target PARAMS ((CORE_ADDR *));
/* Saved Pc. Get it from ucontext if within sigtramp. */
#define sigtramp_saved_pc i386v4_sigtramp_saved_pc
-extern CORE_ADDR i386v4_sigtramp_saved_pc PARAMS ((struct frame_info *));
+extern CORE_ADDR i386v4_sigtramp_saved_pc (struct frame_info *);
-#endif /* ifndef TM_I386V4_H */
+#endif /* ifndef TM_I386V4_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-i386v42mp.h b/contrib/gdb/gdb/config/i386/tm-i386v42mp.h
index 81df85b..5671e42 100644
--- a/contrib/gdb/gdb/config/i386/tm-i386v42mp.h
+++ b/contrib/gdb/gdb/config/i386/tm-i386v42mp.h
@@ -1,22 +1,23 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.2MP
- Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+ Copyright 1991, 1994, 1997, 1999, 2000 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
@@ -25,20 +26,68 @@ 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 */
+/* define to select for other sysv4.2mp weirdness (see procfs.c) */
-#ifndef HAVE_MULTIPLE_PROC_FDS
-#define HAVE_MULTIPLE_PROC_FDS
+#define UNIXWARE
+
+#if 0
+/* The following macros extract process and lwp/thread ids from a
+ composite id.
+
+ For consistency with UnixWare core files, allocate bits 0-15 for
+ process ids and bits 16 and up for lwp ids. Reserve bit 31 for
+ negative return values to indicate exceptions, and use bit 30 as a
+ flag to indicate a user-mode thread, leaving 14 bits for lwp
+ ids. */
+
+/* Number of bits in composite id allocated to process number. */
+#define PIDBITS 16
+
+/* Return the process id stored in composite PID. */
+#define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1)))
+
+/* Return the thread or lwp id stored in composite PID. */
+#define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS)
+#define LIDGET(PID) TIDGET(PID)
+
+/* Construct a composite id from lwp LID and the process portion of
+ composite PID. */
+#define MERGEPID(PID, LID) (PIDGET(PID) | ((LID) << PIDBITS))
+#define MKLID(PID, LID) MERGEPID(PID, LID)
+
+/* Construct a composite id from thread TID and the process portion of
+ composite PID. */
+#define MKTID(PID, TID) (MERGEPID(PID, TID) | 0x40000000)
+
+/* Return whether PID contains a user-space thread id. */
+#define ISTID(PID) ((PID) & 0x40000000)
#endif
-/* procfs on this architecture communicates with read/write instead
- of ioctl */
+/* New definitions of the ptid stuff. Due to the way the
+ code is structured in uw-thread.c, I'm overloading the thread id
+ and lwp id onto the lwp field. The tid field is used to indicate
+ whether the lwp is a tid or not.
+
+ FIXME: Check that core file support is not broken. (See original
+ #if 0'd comments above.)
+ FIXME: Restructure uw-thread.c so that the struct ptid fields
+ can be used as intended. */
-#define PROCFS_USE_READ_WRITE
+/* Return the process id stored in composite PID. */
+#define PIDGET(PID) (ptid_get_pid (PID))
-/* define to select for other sysv4.2mp weirdness */
+/* Return the thread or lwp id stored in composite PID. */
+#define TIDGET(PID) (ptid_get_lwp (PID))
+#define LIDGET(PID) TIDGET(PID)
-#define UNIXWARE
+#define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0))
+#define MKLID(PID, LID) (ptid_build ((PID), (LID), 0))
+
+/* Construct a composite id from thread TID and the process portion of
+ composite PID. */
+#define MKTID(PID, TID) (ptid_build ((PID), (TID), 1))
+
+/* Return whether PID contains a user-space thread id. */
+#define ISTID(PID) (ptid_get_tid (PID))
-#endif /* ifndef TM_I386V42MP_H */
+#endif /* ifndef TM_I386V42MP_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-linux.h b/contrib/gdb/gdb/config/i386/tm-linux.h
index 417d151..5c549b9 100644
--- a/contrib/gdb/gdb/config/i386/tm-linux.h
+++ b/contrib/gdb/gdb/config/i386/tm-linux.h
@@ -1,38 +1,130 @@
/* Definitions to target GDB to GNU/Linux on 386.
- Copyright 1992, 1993 Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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. */
#ifndef TM_LINUX_H
#define TM_LINUX_H
-/* FIXME: If nothing else gets added to this file, it could be removed
- and configure could just use tm-i386.h instead. -fnf */
+#define I386_GNULINUX_TARGET
+#define HAVE_I387_REGS
+#ifdef HAVE_PTRACE_GETFPXREGS
+#define HAVE_SSE_REGS
+#endif
#include "i386/tm-i386.h"
+#include "tm-linux.h"
+
+/* Register number for the "orig_eax" pseudo-register. If this
+ pseudo-register contains a value >= 0 it is interpreted as the
+ system call number that the kernel is supposed to restart. */
+#define I386_LINUX_ORIG_EAX_REGNUM (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS)
+
+/* Adjust a few macros to deal with this extra register. */
+
+#undef NUM_REGS
+#define NUM_REGS (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS + 1)
+
+#undef MAX_NUM_REGS
+#define MAX_NUM_REGS (16 + 16 + 9 + 1)
+
+#undef REGISTER_BYTES
+#define REGISTER_BYTES \
+ (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS + 4)
-/* Offset to saved PC in sigcontext, from <linux/signal.h>. */
-#define SIGCONTEXT_PC_OFFSET 38
+#undef REGISTER_NAME
+#define REGISTER_NAME(reg) i386_linux_register_name ((reg))
+extern char *i386_linux_register_name (int reg);
-/* We need this file for the SOLIB_TRAMPOLINE stuff. */
+#undef REGISTER_BYTE
+#define REGISTER_BYTE(reg) i386_linux_register_byte ((reg))
+extern int i386_linux_register_byte (int reg);
-#include "tm-sysv4.h"
+#undef REGISTER_RAW_SIZE
+#define REGISTER_RAW_SIZE(reg) i386_linux_register_raw_size ((reg))
+extern int i386_linux_register_raw_size (int reg);
+
+/* GNU/Linux ELF uses stabs-in-ELF with the DWARF register numbering
+ scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
+ messes up the floating-point registers for a.out, but there is not
+ much we can do about that. */
+#undef STAB_REG_TO_REGNUM
+#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
+
+/* Use target_specific function to define link map offsets. */
+extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
+#define SVR4_FETCH_LINK_MAP_OFFSETS() i386_linux_svr4_fetch_link_map_offsets ()
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
-#endif /* #ifndef TM_LINUX_H */
+/* When the i386 Linux kernel calls a signal handler, the return
+ address points to a bit of code on the stack. These definitions
+ are used to identify this bit of code as a signal trampoline in
+ order to support backtracing through calls to signal handlers. */
+
+#define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
+extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
+
+#undef FRAME_CHAIN
+#define FRAME_CHAIN(frame) i386_linux_frame_chain (frame)
+extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame);
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
+extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
+
+#undef SAVED_PC_AFTER_CALL
+#define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
+extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *);
+
+#define TARGET_WRITE_PC(pc, ptid) i386_linux_write_pc (pc, ptid)
+extern void i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid);
+
+/* When we call a function in a shared library, and the PLT sends us
+ into the dynamic linker to find the function's real address, we
+ need to skip over the dynamic linker call. This function decides
+ when to skip, and where to skip to. See the comments for
+ SKIP_SOLIB_RESOLVER at the top of infrun.c. */
+#define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
+extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
+
+/* N_FUN symbols in shared libaries have 0 for their values and need
+ to be relocated. */
+#define SOFUN_ADDRESS_MAYBE_MISSING
+
+
+/* Support for longjmp. */
+
+/* Details about jmp_buf. It's supposed to be an array of integers. */
+
+#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
+#define JB_PC 5 /* Array index of saved PC. */
+
+/* Figure out where the longjmp will land. Slurp the args out of the
+ stack. We expect the first arg to be a pointer to the jmp_buf
+ structure from which we extract the pc (JB_PC) that we will land
+ at. The pc is copied into ADDR. This routine returns true on
+ success. */
+
+#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
+extern int get_longjmp_target (CORE_ADDR *addr);
+
+#endif /* #ifndef TM_LINUX_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-nbsd.h b/contrib/gdb/gdb/config/i386/tm-nbsd.h
index cf5159f..ff67a5e 100644
--- a/contrib/gdb/gdb/config/i386/tm-nbsd.h
+++ b/contrib/gdb/gdb/config/i386/tm-nbsd.h
@@ -1,42 +1,70 @@
/* Macro definitions for i386 running under NetBSD.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 1996, 2000, 2002 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
-#include "i386/tm-i386bsd.h"
-#include "tm-nbsd.h"
+#define HAVE_I387_REGS
+#define HAVE_SSE_REGS
+
+#include "i386/tm-i386.h"
+#include "config/tm-nbsd.h"
+
+extern use_struct_convention_fn i386nbsd_use_struct_convention;
+#define USE_STRUCT_CONVENTION(gcc_p, type) \
+ i386nbsd_use_struct_convention(gcc_p, type)
-#undef NUM_REGS
-#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
we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
-extern int
-get_longjmp_target PARAMS ((CORE_ADDR *));
+extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
+
+/* Support for signal handlers. */
+
+#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
+extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
+
+/* These defines allow the recognition of sigtramps as a function name
+ <sigtramp>.
+
+ FIXME: kettenis/2001-07-13: These should be added to the target
+ vector and turned into functions when we go "multi-arch". */
+
+#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
+#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
+extern CORE_ADDR i386bsd_sigtramp_start;
+extern CORE_ADDR i386bsd_sigtramp_end;
+
+/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
+extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
+
#endif /* TM_NBSD_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-nbsdelf.h b/contrib/gdb/gdb/config/i386/tm-nbsdelf.h
new file mode 100644
index 0000000..4d802c5
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/tm-nbsdelf.h
@@ -0,0 +1,28 @@
+/* Macro definitions for i386 running under NetBSD.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_NBSDELF_H
+#define TM_NBSDELF_H
+
+#include "i386/tm-nbsd.h"
+
+#undef USE_STRUCT_CONVENTION
+
+#endif /* TM_NBSD_H */
diff --git a/contrib/gdb/gdb/config/i386/tm-obsd.h b/contrib/gdb/gdb/config/i386/tm-obsd.h
new file mode 100644
index 0000000..d26b03b
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/tm-obsd.h
@@ -0,0 +1,77 @@
+/* Target-dependent definitions for OpenBSD/i386.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_OBSD_H
+#define TM_OBSD_H
+
+#define HAVE_I387_REGS
+#include "i386/tm-i386.h"
+
+/* OpenBSD uses the old gcc convention for struct returns. */
+
+#define USE_STRUCT_CONVENTION(gcc_p, type) \
+ generic_use_struct_convention (1, type)
+
+
+/* Support for longjmp. */
+
+/* Details about jmp_buf. It's supposed to be an array of integers. */
+
+#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
+#define JB_PC 0 /* Array index of saved PC. */
+
+/* Figure out where the longjmp will land. Store the address that
+ longjmp will jump to in *ADDR, and return non-zero if successful. */
+
+#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
+extern int get_longjmp_target (CORE_ADDR *addr);
+
+
+/* Support for signal handlers. */
+
+#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
+extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
+
+/* These defines allow the recognition of sigtramps as a function name
+ <sigtramp>.
+
+ FIXME: kettenis/2001-07-13: These should be added to the target
+ vector and turned into functions when we go "multi-arch". */
+
+#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
+#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
+extern CORE_ADDR i386bsd_sigtramp_start;
+extern CORE_ADDR i386bsd_sigtramp_end;
+
+/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
+extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
+
+
+/* Shared library support. */
+
+/* Return non-zero if we are in a shared library trampoline code stub. */
+
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
+ (name && !strcmp(name, "_DYNAMIC"))
+
+#endif /* tm-obsd.h */
diff --git a/contrib/gdb/gdb/config/i386/tm-ptx.h b/contrib/gdb/gdb/config/i386/tm-ptx.h
index c9f67d7..2a1731a 100644
--- a/contrib/gdb/gdb/config/i386/tm-ptx.h
+++ b/contrib/gdb/gdb/config/i386/tm-ptx.h
@@ -1,23 +1,25 @@
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000
+ 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 +50,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.
*/
@@ -67,7 +69,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
scheme (which is the same as the 386 scheme) and also regmap in the various
*-nat.c files. */
-#undef REGISTER_NAMES
+#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "eflags", "st0", "st1", \
@@ -138,8 +140,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ (addr) = ptx_register_u_addr((blockend), (regno)); }
-extern int
-ptx_register_u_addr PARAMS ((int, int));
+extern int ptx_register_u_addr (int, int);
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. 10 i*86 registers, 8 i387
@@ -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 */
diff --git a/contrib/gdb/gdb/config/i386/tm-ptx4.h b/contrib/gdb/gdb/config/i386/tm-ptx4.h
index a576acc..1f221ba 100644
--- a/contrib/gdb/gdb/config/i386/tm-ptx4.h
+++ b/contrib/gdb/gdb/config/i386/tm-ptx4.h
@@ -1,23 +1,25 @@
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+ 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
diff --git a/contrib/gdb/gdb/config/i386/tm-symmetry.h b/contrib/gdb/gdb/config/i386/tm-symmetry.h
index 11931d4..7828181 100644
--- a/contrib/gdb/gdb/config/i386/tm-symmetry.h
+++ b/contrib/gdb/gdb/config/i386/tm-symmetry.h
@@ -1,28 +1,32 @@
/* Target machine definitions for GDB on a Sequent Symmetry under dynix 3.0,
with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995
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
+#include "regcache.h"
+#include "doublest.h"
+
/* I don't know if this will work for cross-debugging, even if you do get
a copy of the right include file. */
#include <machine/reg.h>
@@ -40,7 +44,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.
*/
@@ -62,7 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
break mysteriously for no apparent reason. Also note that the st(0)...
st(7) 387 registers are represented as st0...st7. */
-#undef REGISTER_NAMES
+#undef REGISTER_NAME
#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \
"ebx", "esi", "edi", "st2", "st3", \
"st4", "st5", "st6", "st7", "esp", \
@@ -101,16 +105,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
/*
@@ -264,8 +268,8 @@ switch (regno) { \
#undef REGISTER_CONVERT_TO_VIRTUAL
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
- double val; \
- floatformat_to_double (&floatformat_i387_ext, (FROM), &val); \
+ DOUBLEST val; \
+ floatformat_to_doublest (&floatformat_i387_ext, (FROM), &val); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
@@ -275,8 +279,8 @@ switch (regno) { \
#undef REGISTER_CONVERT_TO_RAW
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
- double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
- floatformat_from_double (&floatformat_i387_ext, &val, (TO)); \
+ DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
+ floatformat_from_doublest (&floatformat_i387_ext, &val, (TO)); \
}
/* Return the GDB type object for the "standard" data type
@@ -296,6 +300,7 @@ switch (regno) { \
passes it on the stack. gcc should be fixed in future versions to
adopt native cc conventions. */
+#undef PUSH_ARGUMENTS
#undef STORE_STRUCT_RETURN
#define STORE_STRUCT_RETURN(ADDR, SP) write_register(0, (ADDR))
@@ -317,5 +322,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 */
diff --git a/contrib/gdb/gdb/config/i386/tm-vxworks.h b/contrib/gdb/gdb/config/i386/tm-vxworks.h
new file mode 100644
index 0000000..6434a6e
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/tm-vxworks.h
@@ -0,0 +1,28 @@
+/* Target machine description for VxWorks on the 80[3456]86,
+ for GDB, the GNU debugger.
+ Copyright 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. */
+
+#ifndef TM_VXWORKS_H
+#define TM_VXWORKS_H
+
+#include "i386/tm-i386v.h"
+#include "tm-vxworks.h"
+
+#endif /* ifndef TM_VXWORKS_H */
diff --git a/contrib/gdb/gdb/config/i386/vxworks.mt b/contrib/gdb/gdb/config/i386/vxworks.mt
new file mode 100644
index 0000000..a14aacc
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/vxworks.mt
@@ -0,0 +1,3 @@
+# Target: i386 running VxWorks
+TDEPFILES= i386-tdep.o i387-tdep.o
+TM_FILE= tm-vxworks.h
diff --git a/contrib/gdb/gdb/config/i386/x86-64linux.mh b/contrib/gdb/gdb/config/i386/x86-64linux.mh
new file mode 100644
index 0000000..a0a192c
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/x86-64linux.mh
@@ -0,0 +1,11 @@
+# Host: AMD x86-64 running GNU/Linux
+
+XM_FILE= xm-i386.h
+
+NAT_FILE= nm-x86-64.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
+ core-aout.o i386-nat.o x86-64-linux-nat.o \
+ i387-nat.o proc-service.o thread-db.o lin-lwp.o \
+ linux-proc.o gcore.o
+
+LOADLIBES = -ldl -rdynamic
diff --git a/contrib/gdb/gdb/config/i386/x86-64linux.mt b/contrib/gdb/gdb/config/i386/x86-64linux.mt
new file mode 100644
index 0000000..1f3a796
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/x86-64linux.mt
@@ -0,0 +1,5 @@
+# Target: AMD x86-64 running GNU/Linux
+TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o i387-tdep.o dwarf2cfi.o \
+ solib.o solib-svr4.o solib-legacy.o
+
+## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o
diff --git a/contrib/gdb/gdb/config/i386/xm-cygwin.h b/contrib/gdb/gdb/config/i386/xm-cygwin.h
index f0b8227..6470727 100644
--- a/contrib/gdb/gdb/config/i386/xm-cygwin.h
+++ b/contrib/gdb/gdb/config/i386/xm-cygwin.h
@@ -1,34 +1,24 @@
/* Definitions for hosting on WIN32, for GDB.
- Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public 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
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "fopen-bin.h"
-#define GDBINIT_FILENAME "gdb.ini"
-
-#define SLASH_P(X) ((X)=='\\' || (X) == '/')
-#define ROOTED_P(X) ((SLASH_P((X)[0]))|| ((X)[1] ==':'))
-#define SLASH_CHAR '/'
-#define SLASH_STRING "/"
-
/* Define this if source files use \r\n rather than just \n. */
#define CRLF_SOURCE_FILES
-
-#define HAVE_SIGSETMASK 0
diff --git a/contrib/gdb/gdb/config/i386/xm-go32.h b/contrib/gdb/gdb/config/i386/xm-go32.h
index 0797833..dead9f6 100644
--- a/contrib/gdb/gdb/config/i386/xm-go32.h
+++ b/contrib/gdb/gdb/config/i386/xm-go32.h
@@ -1,31 +1,26 @@
-/* Definitions for hosting on GO32, for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+/* Host-dependent definitions for Intel x86 running DJGPP.
+ Copyright 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 HOST_BYTE_ORDER LITTLE_ENDIAN
+#include "i386/xm-i386.h"
#include "fopen-bin.h"
-/* Define this lseek(n) != nth byte of file */
-#define LSEEK_NOT_LINEAR
-
-#define CANT_FORK
-
-#undef QUIT
-#define QUIT { pollquit(); }
-
#define GDBINIT_FILENAME "gdb.ini"
+#define CRLF_SOURCE_FILES
+#define DIRNAME_SEPARATOR ';'
diff --git a/contrib/gdb/gdb/config/i386/xm-i386.h b/contrib/gdb/gdb/config/i386/xm-i386.h
new file mode 100644
index 0000000..151e7a6
--- /dev/null
+++ b/contrib/gdb/gdb/config/i386/xm-i386.h
@@ -0,0 +1,30 @@
+/* Host-dependent definitions for i386.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef XM_I386_H
+#define XM_I386_H
+
+#include "floatformat.h"
+
+#define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
+#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
+
+#endif /* XM_386_H */
diff --git a/contrib/gdb/gdb/config/i386/xm-i386aix.h b/contrib/gdb/gdb/config/i386/xm-i386aix.h
index 652a149..842eadf 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386aix.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386aix.h
@@ -1,33 +1,29 @@
/* Macro defintions for AIX PS/2 (i386)
Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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"
#undef HAVE_TERMIO
#define HAVE_SGTTY
-
-#include <limits.h>
-
-/* Use setpgid instead of setpgrp on AIX */
-#define NEED_POSIX_SETPGID
diff --git a/contrib/gdb/gdb/config/i386/xm-i386bsd.h b/contrib/gdb/gdb/config/i386/xm-i386bsd.h
index e5c4c89..ca0ffb2 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386bsd.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386bsd.h
@@ -1,22 +1,22 @@
/* Host-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 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. */
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-#include <machine/limits.h> /* for INT_MIN */
+#include <machine/limits.h> /* for INT_MIN */
diff --git a/contrib/gdb/gdb/config/i386/xm-i386gnu.h b/contrib/gdb/gdb/config/i386/xm-i386gnu.h
index 60307b2..711aeeb 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386gnu.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386gnu.h
@@ -1,23 +1,25 @@
/* Definitions to make GDB run on the GNU Hurd on an Intel 386
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1996, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
/* Do implement the attach and detach commands. */
#define ATTACH_DETACH 1
diff --git a/contrib/gdb/gdb/config/i386/xm-i386m3.h b/contrib/gdb/gdb/config/i386/xm-i386m3.h
index b667409..f25b389 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386m3.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386m3.h
@@ -1,23 +1,23 @@
/* Definitions to make GDB run on Mach 3 on an Intel 386
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 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. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
+ You should have received a copy of the GNU General Public 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
diff --git a/contrib/gdb/gdb/config/i386/xm-i386mach.h b/contrib/gdb/gdb/config/i386/xm-i386mach.h
index eb47bfb..e0a5d65 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386mach.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386mach.h
@@ -1,23 +1,23 @@
/* Definitions to make GDB run on Mach on an Intel 386
- Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1996, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public 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
+ You should have received a copy of the GNU General Public 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. */
@@ -26,5 +26,3 @@ 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();
diff --git a/contrib/gdb/gdb/config/i386/xm-i386mk.h b/contrib/gdb/gdb/config/i386/xm-i386mk.h
index 661c9cb..cbf6271 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386mk.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386mk.h
@@ -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.
+ 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. */
#define HAVE_TERMIO 1
diff --git a/contrib/gdb/gdb/config/i386/xm-i386sco.h b/contrib/gdb/gdb/config/i386/xm-i386sco.h
index 31fa7e6..920ebbb 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386sco.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386sco.h
@@ -1,21 +1,22 @@
/* Macro defintions for i386, running SCO Unix System V/386 3.2.
- Copyright (C) 1989 Free Software Foundation, Inc.
+ Copyright 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. */
/* In 3.2v4 <sys/user.h> requires on <sys/dir.h>. */
#include <sys/types.h>
@@ -37,6 +38,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
So we use dots instead. This item must be coordinated with G++. */
#undef CPLUS_MARKER
#define CPLUS_MARKER '.'
-
-/* Use setpgid instead of setpgrp on SCO */
-#define NEED_POSIX_SETPGID
diff --git a/contrib/gdb/gdb/config/i386/xm-i386v.h b/contrib/gdb/gdb/config/i386/xm-i386v.h
index 480dfd6..1c32905 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386v.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386v.h
@@ -2,35 +2,34 @@
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. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* 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 +41,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
-
diff --git a/contrib/gdb/gdb/config/i386/xm-i386v32.h b/contrib/gdb/gdb/config/i386/xm-i386v32.h
index daaac80..706822f 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386v32.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386v32.h
@@ -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"
diff --git a/contrib/gdb/gdb/config/i386/xm-i386v4.h b/contrib/gdb/gdb/config/i386/xm-i386v4.h
index 7f782db..c324110 100644
--- a/contrib/gdb/gdb/config/i386/xm-i386v4.h
+++ b/contrib/gdb/gdb/config/i386/xm-i386v4.h
@@ -1,22 +1,23 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1994, 1996 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. */
/* Pick up most of what we need from the generic i386 host include file. */
diff --git a/contrib/gdb/gdb/config/i386/xm-nbsd.h b/contrib/gdb/gdb/config/i386/xm-nbsd.h
index b5624ac..415d0fa 100644
--- a/contrib/gdb/gdb/config/i386/xm-nbsd.h
+++ b/contrib/gdb/gdb/config/i386/xm-nbsd.h
@@ -1,21 +1,24 @@
/* Parameters for execution on a i386 running NetBSD, for GDB.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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"
+
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
diff --git a/contrib/gdb/gdb/config/i386/xm-ptx.h b/contrib/gdb/gdb/config/i386/xm-ptx.h
index 99b46cc..6dfb9d6 100644
--- a/contrib/gdb/gdb/config/i386/xm-ptx.h
+++ b/contrib/gdb/gdb/config/i386/xm-ptx.h
@@ -1,23 +1,24 @@
/* Definitions to make GDB run on a Sequent Symmetry under ptx, with
Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1992, 1993, 1996
+ Copyright 1986, 1987, 1989, 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. */
/* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
@@ -34,8 +35,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define HAVE_TERMIOS
#define USG
-#define NEED_POSIX_SETPGID
-
#define USE_O_NOCTTY
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
diff --git a/contrib/gdb/gdb/config/i386/xm-ptx4.h b/contrib/gdb/gdb/config/i386/xm-ptx4.h
index bdbdefd..2f466e6 100644
--- a/contrib/gdb/gdb/config/i386/xm-ptx4.h
+++ b/contrib/gdb/gdb/config/i386/xm-ptx4.h
@@ -1,22 +1,24 @@
/* Definitions to make GDB run on a Sequent Symmetry under ptx, with
- Weitek 1167 and i387 support. Copyright 1986, 1987, 1989, 1992,
- 1993 Free Software Foundation, Inc.
+ Weitek 1167 and i387 support.
+ Copyright 1986, 1987, 1989, 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. */
/* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
diff --git a/contrib/gdb/gdb/config/i386/xm-symmetry.h b/contrib/gdb/gdb/config/i386/xm-symmetry.h
index 52e9a9a..781a343 100644
--- a/contrib/gdb/gdb/config/i386/xm-symmetry.h
+++ b/contrib/gdb/gdb/config/i386/xm-symmetry.h
@@ -1,22 +1,24 @@
/* Definitions to make GDB run on a Sequent Symmetry under
dynix 3.1, with Weitek 1167 and i387 support.
- Copyright 1986, 1987, 1989, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 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. */
/* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
@@ -24,5 +26,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NO_SIGINTERRUPT
#define HAVE_WAIT_STRUCT
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
diff --git a/contrib/gdb/gdb/config/ia64/aix.mh b/contrib/gdb/gdb/config/ia64/aix.mh
new file mode 100644
index 0000000..e180594
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/aix.mh
@@ -0,0 +1,8 @@
+# Host: Intel IA-64 running AIX
+
+XM_FILE= xm-aix.h
+
+NAT_FILE= nm-aix.h
+NATDEPFILES= corelow.o core-regset.o solib.o solib-aix5.o fork-child.o \
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o \
+ ia64-aix-nat.o
diff --git a/contrib/gdb/gdb/config/ia64/aix.mt b/contrib/gdb/gdb/config/ia64/aix.mt
new file mode 100644
index 0000000..0348146
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/aix.mt
@@ -0,0 +1,4 @@
+# Target: Intel IA-64 running AIX
+
+TDEPFILES= ia64-tdep.o ia64-linux-tdep.o ia64-aix-tdep.o
+TM_FILE= tm-aix.h
diff --git a/contrib/gdb/gdb/config/ia64/linux.mh b/contrib/gdb/gdb/config/ia64/linux.mh
new file mode 100644
index 0000000..65f3028
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/linux.mh
@@ -0,0 +1,10 @@
+# Host: Intel IA-64 running GNU/Linux
+
+XM_FILE= xm-linux.h
+
+NAT_FILE= nm-linux.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o gcore.o \
+ core-aout.o core-regset.o ia64-linux-nat.o linux-proc.o \
+ proc-service.o thread-db.o lin-lwp.o
+
+LOADLIBES = -ldl -rdynamic
diff --git a/contrib/gdb/gdb/config/ia64/linux.mt b/contrib/gdb/gdb/config/ia64/linux.mt
new file mode 100644
index 0000000..d841f75
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/linux.mt
@@ -0,0 +1,6 @@
+# Target: Intel IA-64 running GNU/Linux
+TDEPFILES= ia64-tdep.o ia64-aix-tdep.o ia64-linux-tdep.o \
+ solib.o solib-svr4.o solib-legacy.o
+TM_FILE= tm-linux.h
+
+GDBSERVER_DEPFILES = linux-low.o linux-ia64-low.o reg-ia64.o
diff --git a/contrib/gdb/gdb/config/ia64/nm-aix.h b/contrib/gdb/gdb/config/ia64/nm-aix.h
new file mode 100644
index 0000000..3f6764c
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/nm-aix.h
@@ -0,0 +1,37 @@
+/* Native support for AIX, for GDB, the GNU debugger.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_AIX_H
+#define NM_AIX_H
+
+#include "nm-sysv4.h"
+
+#ifndef AIX5
+#define AIX5 1
+#endif
+
+/* Type of the operation code for sending control messages to the
+ /proc/PID/ctl file */
+#define PROC_CTL_WORD_TYPE int
+
+#define GDB_GREGSET_T prgregset_t
+#define GDB_FPREGSET_T prfpregset_t
+
+#endif /* #ifndef NM_AIX_H */
diff --git a/contrib/gdb/gdb/config/ia64/nm-linux.h b/contrib/gdb/gdb/config/ia64/nm-linux.h
new file mode 100644
index 0000000..2c980c0
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/nm-linux.h
@@ -0,0 +1,79 @@
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+ Copyright 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef NM_LINUX_H
+#define NM_LINUX_H
+
+#include "nm-linux.h"
+
+/* Note: It seems likely that we'll have to eventually define
+ FETCH_INFERIOR_REGISTERS. But until that time, we'll make do
+ with the following. */
+
+#define CANNOT_FETCH_REGISTER(regno) ia64_cannot_fetch_register(regno)
+extern int ia64_cannot_fetch_register (int regno);
+
+#define CANNOT_STORE_REGISTER(regno) ia64_cannot_store_register(regno)
+extern int ia64_cannot_store_register (int regno);
+
+#ifdef GDBSERVER
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+ (addr) = ia64_register_u_addr ((blockend),(regno));
+
+extern int ia64_register_u_addr(int, int);
+#endif /* GDBSERVER */
+
+#define U_REGS_OFFSET 0
+
+#define PTRACE_ARG3_TYPE long
+#define PTRACE_XFER_TYPE long
+
+/* Hardware watchpoints */
+
+#define TARGET_HAS_HARDWARE_WATCHPOINTS
+
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
+
+/* The IA-64 architecture can step over a watch point (without triggering
+ it again) if the "dd" (data debug fault disable) bit in the processor
+ status word is set.
+
+ This PSR bit is set in ia64_linux_stopped_by_watchpoint when the
+ code there has determined that a hardware watchpoint has indeed
+ been hit. The CPU will then be able to execute one instruction
+ without triggering a watchpoint. */
+#define HAVE_STEPPABLE_WATCHPOINT 1
+
+#define STOPPED_BY_WATCHPOINT(W) \
+ ia64_linux_stopped_by_watchpoint (inferior_ptid)
+extern CORE_ADDR ia64_linux_stopped_by_watchpoint (ptid_t ptid);
+
+#define target_insert_watchpoint(addr, len, type) \
+ ia64_linux_insert_watchpoint (inferior_ptid, addr, len, type)
+extern int ia64_linux_insert_watchpoint (ptid_t ptid, CORE_ADDR addr,
+ int len, int rw);
+
+#define target_remove_watchpoint(addr, len, type) \
+ ia64_linux_remove_watchpoint (inferior_ptid, addr, len)
+extern int ia64_linux_remove_watchpoint (ptid_t ptid, CORE_ADDR addr,
+ int len);
+
+#endif /* #ifndef NM_LINUX_H */
diff --git a/contrib/gdb/gdb/config/ia64/tm-aix.h b/contrib/gdb/gdb/config/ia64/tm-aix.h
new file mode 100644
index 0000000..0160140
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/tm-aix.h
@@ -0,0 +1,32 @@
+/* Definitions to target GDB to GNU/Linux on IA-64 running AIX.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_AIX_H
+#define TM_AIX_H
+
+#include "ia64/tm-ia64.h"
+#include "tm-sysv4.h"
+
+#define TARGET_ELF64
+
+extern int ia64_aix_in_sigtramp (CORE_ADDR pc, char *func_name);
+#define IN_SIGTRAMP(pc,func_name) ia64_aix_in_sigtramp (pc, func_name)
+
+#endif /* #ifndef TM_AIX_H */
diff --git a/contrib/gdb/gdb/config/ia64/tm-ia64.h b/contrib/gdb/gdb/config/ia64/tm-ia64.h
new file mode 100644
index 0000000..d08e59b
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/tm-ia64.h
@@ -0,0 +1,252 @@
+/* Definitions to target GDB to GNU/Linux on an ia64 architecture.
+ Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_IA64_H
+#define TM_IA64_H
+
+#if !defined(GDBSERVER)
+
+#define GDB_MULTI_ARCH 1
+
+#else /* defines needed for GDBSERVER */
+
+/* Say how long (ordinary) registers are. This is a piece of bogosity
+ used in push_word and a few other places; REGISTER_RAW_SIZE is the
+ real way to know how big a register is. */
+
+#define REGISTER_SIZE 8
+
+#undef NUM_REGS
+#define NUM_REGS 590
+
+/* Some pseudo register numbers */
+
+#define PC_REGNUM IA64_IP_REGNUM
+#define SP_REGNUM IA64_GR12_REGNUM
+#define FP_REGNUM IA64_VFP_REGNUM
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. On the ia64, all registers
+ fit in 64 bits except for the floating point registers which require
+ 84 bits. But 84 isn't a nice number, so we'll just allocate 128
+ bits for each of these. The expression below says that we
+ need 8 bytes for each register, plus an additional 8 bytes for each
+ of the 128 floating point registers. */
+
+#define REGISTER_BYTES (NUM_REGS*8+128*8)
+
+/* Index within `registers' of the first byte of the space for
+ register N. */
+
+#define REGISTER_BYTE(N) (((N) * 8) \
+ + ((N) <= IA64_FR0_REGNUM ? 0 : 8 * (((N) > IA64_FR127_REGNUM) ? 128 : (N) - IA64_FR0_REGNUM)))
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. */
+
+#define REGISTER_RAW_SIZE(N) \
+ ((IA64_FR0_REGNUM <= (N) && (N) <= IA64_FR127_REGNUM) ? 16 : 8)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#define MAX_REGISTER_RAW_SIZE 16
+
+
+#define GDBSERVER_RESUME_REGS { IA64_IP_REGNUM, IA64_PSR_REGNUM, SP_REGNUM, IA64_BSP_REGNUM, IA64_CFM_REGNUM }
+
+#endif /* GDBSERVER */
+
+
+/* Register numbers of various important registers */
+
+/* General registers; there are 128 of these 64 bit wide registers. The
+ first 32 are static and the last 96 are stacked. */
+#define IA64_GR0_REGNUM 0
+#define IA64_GR1_REGNUM (IA64_GR0_REGNUM+1)
+#define IA64_GR2_REGNUM (IA64_GR0_REGNUM+2)
+#define IA64_GR3_REGNUM (IA64_GR0_REGNUM+3)
+#define IA64_GR4_REGNUM (IA64_GR0_REGNUM+4)
+#define IA64_GR5_REGNUM (IA64_GR0_REGNUM+5)
+#define IA64_GR6_REGNUM (IA64_GR0_REGNUM+6)
+#define IA64_GR7_REGNUM (IA64_GR0_REGNUM+7)
+#define IA64_GR8_REGNUM (IA64_GR0_REGNUM+8)
+#define IA64_GR9_REGNUM (IA64_GR0_REGNUM+9)
+#define IA64_GR10_REGNUM (IA64_GR0_REGNUM+10)
+#define IA64_GR11_REGNUM (IA64_GR0_REGNUM+11)
+#define IA64_GR12_REGNUM (IA64_GR0_REGNUM+12)
+#define IA64_GR31_REGNUM (IA64_GR0_REGNUM+31)
+#define IA64_GR32_REGNUM (IA64_GR0_REGNUM+32)
+#define IA64_GR127_REGNUM (IA64_GR0_REGNUM+127)
+
+/* Floating point registers; 128 82-bit wide registers */
+#define IA64_FR0_REGNUM 128
+#define IA64_FR1_REGNUM (IA64_FR0_REGNUM+1)
+#define IA64_FR2_REGNUM (IA64_FR0_REGNUM+2)
+#define IA64_FR8_REGNUM (IA64_FR0_REGNUM+8)
+#define IA64_FR9_REGNUM (IA64_FR0_REGNUM+9)
+#define IA64_FR10_REGNUM (IA64_FR0_REGNUM+10)
+#define IA64_FR11_REGNUM (IA64_FR0_REGNUM+11)
+#define IA64_FR12_REGNUM (IA64_FR0_REGNUM+12)
+#define IA64_FR13_REGNUM (IA64_FR0_REGNUM+13)
+#define IA64_FR14_REGNUM (IA64_FR0_REGNUM+14)
+#define IA64_FR15_REGNUM (IA64_FR0_REGNUM+15)
+#define IA64_FR16_REGNUM (IA64_FR0_REGNUM+16)
+#define IA64_FR31_REGNUM (IA64_FR0_REGNUM+31)
+#define IA64_FR32_REGNUM (IA64_FR0_REGNUM+32)
+#define IA64_FR127_REGNUM (IA64_FR0_REGNUM+127)
+
+/* Predicate registers; There are 64 of these one bit registers.
+ It'd be more convenient (implementation-wise) to use a single
+ 64 bit word with all of these register in them. Note that there's
+ also a IA64_PR_REGNUM below which contains all the bits and is used for
+ communicating the actual values to the target. */
+
+#define IA64_PR0_REGNUM 256
+#define IA64_PR1_REGNUM (IA64_PR0_REGNUM+1)
+#define IA64_PR2_REGNUM (IA64_PR0_REGNUM+2)
+#define IA64_PR3_REGNUM (IA64_PR0_REGNUM+3)
+#define IA64_PR4_REGNUM (IA64_PR0_REGNUM+4)
+#define IA64_PR5_REGNUM (IA64_PR0_REGNUM+5)
+#define IA64_PR6_REGNUM (IA64_PR0_REGNUM+6)
+#define IA64_PR7_REGNUM (IA64_PR0_REGNUM+7)
+#define IA64_PR8_REGNUM (IA64_PR0_REGNUM+8)
+#define IA64_PR9_REGNUM (IA64_PR0_REGNUM+9)
+#define IA64_PR10_REGNUM (IA64_PR0_REGNUM+10)
+#define IA64_PR11_REGNUM (IA64_PR0_REGNUM+11)
+#define IA64_PR12_REGNUM (IA64_PR0_REGNUM+12)
+#define IA64_PR13_REGNUM (IA64_PR0_REGNUM+13)
+#define IA64_PR14_REGNUM (IA64_PR0_REGNUM+14)
+#define IA64_PR15_REGNUM (IA64_PR0_REGNUM+15)
+#define IA64_PR16_REGNUM (IA64_PR0_REGNUM+16)
+#define IA64_PR17_REGNUM (IA64_PR0_REGNUM+17)
+#define IA64_PR18_REGNUM (IA64_PR0_REGNUM+18)
+#define IA64_PR19_REGNUM (IA64_PR0_REGNUM+19)
+#define IA64_PR20_REGNUM (IA64_PR0_REGNUM+20)
+#define IA64_PR21_REGNUM (IA64_PR0_REGNUM+21)
+#define IA64_PR22_REGNUM (IA64_PR0_REGNUM+22)
+#define IA64_PR23_REGNUM (IA64_PR0_REGNUM+23)
+#define IA64_PR24_REGNUM (IA64_PR0_REGNUM+24)
+#define IA64_PR25_REGNUM (IA64_PR0_REGNUM+25)
+#define IA64_PR26_REGNUM (IA64_PR0_REGNUM+26)
+#define IA64_PR27_REGNUM (IA64_PR0_REGNUM+27)
+#define IA64_PR28_REGNUM (IA64_PR0_REGNUM+28)
+#define IA64_PR29_REGNUM (IA64_PR0_REGNUM+29)
+#define IA64_PR30_REGNUM (IA64_PR0_REGNUM+30)
+#define IA64_PR31_REGNUM (IA64_PR0_REGNUM+31)
+#define IA64_PR32_REGNUM (IA64_PR0_REGNUM+32)
+#define IA64_PR33_REGNUM (IA64_PR0_REGNUM+33)
+#define IA64_PR34_REGNUM (IA64_PR0_REGNUM+34)
+#define IA64_PR35_REGNUM (IA64_PR0_REGNUM+35)
+#define IA64_PR36_REGNUM (IA64_PR0_REGNUM+36)
+#define IA64_PR37_REGNUM (IA64_PR0_REGNUM+37)
+#define IA64_PR38_REGNUM (IA64_PR0_REGNUM+38)
+#define IA64_PR39_REGNUM (IA64_PR0_REGNUM+39)
+#define IA64_PR40_REGNUM (IA64_PR0_REGNUM+40)
+#define IA64_PR41_REGNUM (IA64_PR0_REGNUM+41)
+#define IA64_PR42_REGNUM (IA64_PR0_REGNUM+42)
+#define IA64_PR43_REGNUM (IA64_PR0_REGNUM+43)
+#define IA64_PR44_REGNUM (IA64_PR0_REGNUM+44)
+#define IA64_PR45_REGNUM (IA64_PR0_REGNUM+45)
+#define IA64_PR46_REGNUM (IA64_PR0_REGNUM+46)
+#define IA64_PR47_REGNUM (IA64_PR0_REGNUM+47)
+#define IA64_PR48_REGNUM (IA64_PR0_REGNUM+48)
+#define IA64_PR49_REGNUM (IA64_PR0_REGNUM+49)
+#define IA64_PR50_REGNUM (IA64_PR0_REGNUM+50)
+#define IA64_PR51_REGNUM (IA64_PR0_REGNUM+51)
+#define IA64_PR52_REGNUM (IA64_PR0_REGNUM+52)
+#define IA64_PR53_REGNUM (IA64_PR0_REGNUM+53)
+#define IA64_PR54_REGNUM (IA64_PR0_REGNUM+54)
+#define IA64_PR55_REGNUM (IA64_PR0_REGNUM+55)
+#define IA64_PR56_REGNUM (IA64_PR0_REGNUM+56)
+#define IA64_PR57_REGNUM (IA64_PR0_REGNUM+57)
+#define IA64_PR58_REGNUM (IA64_PR0_REGNUM+58)
+#define IA64_PR59_REGNUM (IA64_PR0_REGNUM+59)
+#define IA64_PR60_REGNUM (IA64_PR0_REGNUM+60)
+#define IA64_PR61_REGNUM (IA64_PR0_REGNUM+61)
+#define IA64_PR62_REGNUM (IA64_PR0_REGNUM+62)
+#define IA64_PR63_REGNUM (IA64_PR0_REGNUM+63)
+
+
+/* Branch registers: 8 64-bit registers for holding branch targets */
+#define IA64_BR0_REGNUM 320
+#define IA64_BR1_REGNUM (IA64_BR0_REGNUM+1)
+#define IA64_BR2_REGNUM (IA64_BR0_REGNUM+2)
+#define IA64_BR3_REGNUM (IA64_BR0_REGNUM+3)
+#define IA64_BR4_REGNUM (IA64_BR0_REGNUM+4)
+#define IA64_BR5_REGNUM (IA64_BR0_REGNUM+5)
+#define IA64_BR6_REGNUM (IA64_BR0_REGNUM+6)
+#define IA64_BR7_REGNUM (IA64_BR0_REGNUM+7)
+
+/* Virtual frame pointer; this matches IA64_FRAME_POINTER_REGNUM in
+ gcc/config/ia64/ia64.h. */
+#define IA64_VFP_REGNUM 328
+
+/* Virtual return address pointer; this matches IA64_RETURN_ADDRESS_POINTER_REGNUM
+ in gcc/config/ia64/ia64.h. */
+#define IA64_VRAP_REGNUM 329
+
+/* Predicate registers: There are 64 of these 1-bit registers. We
+ define a single register which is used to communicate these values
+ to/from the target. We will somehow contrive to make it appear that
+ IA64_PR0_REGNUM thru IA64_PR63_REGNUM hold the actual values. */
+#define IA64_PR_REGNUM 330
+
+/* Instruction pointer: 64 bits wide */
+#define IA64_IP_REGNUM 331
+
+/* Process Status Register */
+#define IA64_PSR_REGNUM 332
+
+/* Current Frame Marker (Raw form may be the cr.ifs) */
+#define IA64_CFM_REGNUM 333
+
+/* Application registers; 128 64-bit wide registers possible, but some
+ of them are reserved */
+#define IA64_AR0_REGNUM 334
+#define IA64_KR0_REGNUM (IA64_AR0_REGNUM+0)
+#define IA64_KR7_REGNUM (IA64_KR0_REGNUM+7)
+
+#define IA64_RSC_REGNUM (IA64_AR0_REGNUM+16)
+#define IA64_BSP_REGNUM (IA64_AR0_REGNUM+17)
+#define IA64_BSPSTORE_REGNUM (IA64_AR0_REGNUM+18)
+#define IA64_RNAT_REGNUM (IA64_AR0_REGNUM+19)
+#define IA64_FCR_REGNUM (IA64_AR0_REGNUM+21)
+#define IA64_EFLAG_REGNUM (IA64_AR0_REGNUM+24)
+#define IA64_CSD_REGNUM (IA64_AR0_REGNUM+25)
+#define IA64_SSD_REGNUM (IA64_AR0_REGNUM+26)
+#define IA64_CFLG_REGNUM (IA64_AR0_REGNUM+27)
+#define IA64_FSR_REGNUM (IA64_AR0_REGNUM+28)
+#define IA64_FIR_REGNUM (IA64_AR0_REGNUM+29)
+#define IA64_FDR_REGNUM (IA64_AR0_REGNUM+30)
+#define IA64_CCV_REGNUM (IA64_AR0_REGNUM+32)
+#define IA64_UNAT_REGNUM (IA64_AR0_REGNUM+36)
+#define IA64_FPSR_REGNUM (IA64_AR0_REGNUM+40)
+#define IA64_ITC_REGNUM (IA64_AR0_REGNUM+44)
+#define IA64_PFS_REGNUM (IA64_AR0_REGNUM+64)
+#define IA64_LC_REGNUM (IA64_AR0_REGNUM+65)
+#define IA64_EC_REGNUM (IA64_AR0_REGNUM+66)
+
+/* NAT (Not A Thing) Bits for the general registers; there are 128 of these */
+#define IA64_NAT0_REGNUM 462
+#define IA64_NAT31_REGNUM (IA64_NAT0_REGNUM+31)
+#define IA64_NAT32_REGNUM (IA64_NAT0_REGNUM+32)
+#define IA64_NAT127_REGNUM (IA64_NAT0_REGNUM+127)
+
+#endif /* TM_IA64_H */
diff --git a/contrib/gdb/gdb/config/ia64/tm-linux.h b/contrib/gdb/gdb/config/ia64/tm-linux.h
new file mode 100644
index 0000000..f716d83
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/tm-linux.h
@@ -0,0 +1,34 @@
+/* Definitions to target GDB to GNU/Linux on IA-64 Linux.
+ Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_LINUX_H
+#define TM_LINUX_H
+
+#define IA64_GNULINUX_TARGET
+
+#include "ia64/tm-ia64.h"
+#include "tm-linux.h"
+
+#define TARGET_ELF64
+
+extern int ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name);
+#define IN_SIGTRAMP(pc,func_name) ia64_linux_in_sigtramp (pc, func_name)
+
+#endif /* #ifndef TM_LINUX_H */
diff --git a/contrib/gdb/gdb/config/ia64/xm-aix.h b/contrib/gdb/gdb/config/ia64/xm-aix.h
new file mode 100644
index 0000000..6ca026d
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/xm-aix.h
@@ -0,0 +1,28 @@
+/* Native support for AIX, for GDB, the GNU debugger.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef XM_AIX_H
+#define XM_AIX_H
+
+/* Pick up more stuff from the generic SVR4 host include file. */
+
+#include "xm-sysv4.h"
+
+#endif /* #ifndef XM_AIX_H */
diff --git a/contrib/gdb/gdb/config/ia64/xm-linux.h b/contrib/gdb/gdb/config/ia64/xm-linux.h
new file mode 100644
index 0000000..adf6b21
--- /dev/null
+++ b/contrib/gdb/gdb/config/ia64/xm-linux.h
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef XM_LINUX_H
+#define XM_LINUX_H
+
+/* 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 0x0
+
+#endif /* #ifndef XM_LINUX_H */
diff --git a/contrib/gdb/gdb/config/nm-linux.h b/contrib/gdb/gdb/config/nm-linux.h
new file mode 100644
index 0000000..a2d4292
--- /dev/null
+++ b/contrib/gdb/gdb/config/nm-linux.h
@@ -0,0 +1,74 @@
+/* Native support for GNU/Linux.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* GNU/Linux is SVR4-ish but its /proc file system isn't. */
+#undef USE_PROC_FS
+
+/* Tell GDB that we can attach and detach other processes. */
+#define ATTACH_DETACH
+
+/* Since we're building a native debugger, we can include <signal.h>
+ to find the range of real-time signals. */
+
+#include <signal.h>
+
+#ifdef __SIGRTMIN
+#define REALTIME_LO __SIGRTMIN
+#define REALTIME_HI (__SIGRTMAX + 1)
+#endif
+
+/* We define this if link.h is available, because with ELF we use SVR4
+ style shared libraries. */
+
+#ifdef HAVE_LINK_H
+#define SVR4_SHARED_LIBS
+#include "solib.h" /* Support for shared libraries. */
+#endif
+
+
+/* Override child_wait in `inftarg.c'. */
+struct target_waitstatus;
+extern ptid_t child_wait (ptid_t ptid, struct target_waitstatus *ourstatus);
+#define CHILD_WAIT
+
+extern int lin_lwp_prepare_to_proceed (void);
+#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
+
+extern void lin_lwp_attach_lwp (ptid_t ptid, int verbose);
+#define ATTACH_LWP(ptid, verbose) lin_lwp_attach_lwp ((ptid), (verbose))
+
+extern void lin_thread_get_thread_signals (sigset_t *mask);
+#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
+
+/* Defined to make stepping-over-breakpoints be thread-atomic. */
+#define USE_THREAD_STEP_NEEDED 1
+
+
+/* Use elf_gregset_t and elf_fpregset_t, rather than
+ gregset_t and fpregset_t. */
+
+#define GDB_GREGSET_T elf_gregset_t
+#define GDB_FPREGSET_T elf_fpregset_t
+
+/* Override child_pid_to_exec_file in 'inftarg.c'. */
+#define CHILD_PID_TO_EXEC_FILE
+
+
diff --git a/contrib/gdb/gdb/config/none/nm-none.h b/contrib/gdb/gdb/config/none/nm-none.h
new file mode 100644
index 0000000..7647bdb
--- /dev/null
+++ b/contrib/gdb/gdb/config/none/nm-none.h
@@ -0,0 +1,19 @@
+/* Defines needed when configuring for "none".
+ 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. */
diff --git a/contrib/gdb/gdb/config/none/none.mh b/contrib/gdb/gdb/config/none/none.mh
new file mode 100644
index 0000000..33d5e4a
--- /dev/null
+++ b/contrib/gdb/gdb/config/none/none.mh
@@ -0,0 +1,5 @@
+# Host: "no target". This can be used to build you
+# a Makefile that only runs administrative commands like 'clean',
+# 'gdb.tar.Z', etc.
+NAT_FILE= nm-none.h
+XM_FILE= xm-none.h
diff --git a/contrib/gdb/gdb/config/none/none.mt b/contrib/gdb/gdb/config/none/none.mt
new file mode 100644
index 0000000..300e2dc
--- /dev/null
+++ b/contrib/gdb/gdb/config/none/none.mt
@@ -0,0 +1,4 @@
+# Target: "no target".
+# This can be used to build you a Makefile that only runs administrative
+# commands like 'clean', 'gdb.tar.Z', etc.
+TM_FILE= tm-none.h
diff --git a/contrib/gdb/gdb/config/none/tm-none.h b/contrib/gdb/gdb/config/none/tm-none.h
new file mode 100644
index 0000000..3db049a
--- /dev/null
+++ b/contrib/gdb/gdb/config/none/tm-none.h
@@ -0,0 +1,24 @@
+/* Defines needed when configuring for "none".
+ Copyright 1993, 1998 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* 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. */
+
+#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
diff --git a/contrib/gdb/gdb/config/none/xm-none.h b/contrib/gdb/gdb/config/none/xm-none.h
new file mode 100644
index 0000000..7647bdb
--- /dev/null
+++ b/contrib/gdb/gdb/config/none/xm-none.h
@@ -0,0 +1,19 @@
+/* Defines needed when configuring for "none".
+ 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. */
diff --git a/contrib/gdb/gdb/config/tm-linux.h b/contrib/gdb/gdb/config/tm-linux.h
new file mode 100644
index 0000000..9389872
--- /dev/null
+++ b/contrib/gdb/gdb/config/tm-linux.h
@@ -0,0 +1,42 @@
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+ Copyright 1999, 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Pick reasonable defaults for the number of real-time signals. */
+
+#ifndef REALTIME_LO
+#define REALTIME_LO 32
+#endif
+#ifndef REALTIME_HI
+#define REALTIME_HI 64
+#endif
+
+/* We need this file for the SOLIB_TRAMPOLINE stuff. */
+
+#include "tm-sysv4.h"
+
+/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that
+ link.h is available on all linux platforms. For I386 and SH3/4,
+ we hard-code the information rather than use link.h anyway (for
+ the benefit of cross-debugging). We may move to doing that for
+ other architectures as well. */
+
+#define SVR4_SHARED_LIBS
+#include "solib.h" /* Support for shared libraries. */
diff --git a/contrib/gdb/gdb/config/tm-vxworks.h b/contrib/gdb/gdb/config/tm-vxworks.h
new file mode 100644
index 0000000..9afc0b4
--- /dev/null
+++ b/contrib/gdb/gdb/config/tm-vxworks.h
@@ -0,0 +1,23 @@
+/* Target machine description for VxWorks, for GDB, the GNU debugger.
+ Copyright 1999 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#define GDBINIT_FILENAME ".vxgdbinit"
+
+#define DEFAULT_PROMPT "(vxgdb) "
diff --git a/contrib/gdb/gdb/configure b/contrib/gdb/gdb/configure
index f70d046..f67945f 100644
--- a/contrib/gdb/gdb/configure
+++ b/contrib/gdb/gdb/configure
@@ -12,20 +12,55 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
--disable-nls do not use Native Language Support"
ac_help="$ac_help
--with-included-gettext use the GNU gettext library included here"
ac_help="$ac_help
+ --enable-multi-ice Build the multi-ice-gdb-server"
+ac_help="$ac_help
+ --enable-gdbcli Enable GDB-CLI interface"
+ac_help="$ac_help
+ --enable-gdbmi Enable GDB-MI interface"
+ac_help="$ac_help
+ --with-uiout Use new uiout functions instead of *printf's"
+ac_help="$ac_help
--enable-tui Enable full-screen terminal user interface"
ac_help="$ac_help
--enable-netrom Enable NetROM support"
ac_help="$ac_help
--enable-build-warnings Enable build-time compiler warnings if gcc is used"
ac_help="$ac_help
+ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used"
+ac_help="$ac_help
--with-mmalloc Use memory mapped malloc package"
ac_help="$ac_help
+ --with-included-regex Use included regex"
+ac_help="$ac_help
+ --with-cpu=CPU Set the default CPU variant to debug"
+ac_help="$ac_help
+ --enable-gdbtk Enable GDBTK GUI front end"
+ac_help="$ac_help
+ --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)"
+ac_help="$ac_help
+ --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)"
+ac_help="$ac_help
+ --with-tclinclude=DIR Directory where tcl private headers are"
+ac_help="$ac_help
+ --with-tkinclude=DIR Directory where tk private headers are"
+ac_help="$ac_help
+ --with-itclconfig Directory containing itcl configuration (itclConfig.sh)"
+ac_help="$ac_help
+ --with-itkconfig Directory containing itk configuration (itkConfig.sh)"
+ac_help="$ac_help
+ --with-tixconfig Directory containing tix configuration (tixConfig.sh)"
+ac_help="$ac_help
--with-x use the X Window System"
ac_help="$ac_help
+ --enable-sim Link gdb with simulator"
+ac_help="$ac_help
--enable-shared Use shared libraries"
# Initialize some variables set by options.
@@ -44,6 +79,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -158,6 +194,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -328,6 +365,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -493,12 +535,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -538,11 +584,34 @@ fi
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:589: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:546: checking for $ac_word" >&5
+echo "configure:615: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -572,7 +641,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:576: checking for $ac_word" >&5
+echo "configure:645: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -623,7 +692,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:627: checking for $ac_word" >&5
+echo "configure:696: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -655,7 +724,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:659: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -666,12 +735,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 670 "configure"
+#line 739 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -697,12 +766,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:701: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:706: checking whether we are using GNU C" >&5
+echo "configure:775: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -711,7 +780,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -730,7 +799,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:734: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:803: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -762,7 +831,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:766: checking how to run the C preprocessor" >&5
+echo "configure:835: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -777,13 +846,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 781 "configure"
+#line 850 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -794,13 +863,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 798 "configure"
+#line 867 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -811,13 +880,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 815 "configure"
+#line 884 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -842,9 +911,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:846: checking for AIX" >&5
+echo "configure:915: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 848 "configure"
+#line 917 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -866,7 +935,7 @@ rm -f conftest*
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:870: checking for POSIXized ISC" >&5
+echo "configure:939: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -890,7 +959,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:894: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:963: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -900,13 +969,14 @@ ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 910 "configure"
+#line 980 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -943,7 +1013,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -1014,7 +1084,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1018: checking host system type" >&5
+echo "configure:1088: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1035,7 +1105,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1039: checking target system type" >&5
+echo "configure:1109: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1053,7 +1123,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1057: checking build system type" >&5
+echo "configure:1127: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1078,7 +1148,7 @@ test "$host_alias" != "$target_alias" &&
ALL_LINGUAS=
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1082: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1107,7 +1177,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1111: checking for $ac_word" >&5
+echo "configure:1181: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1135,12 +1205,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1139: checking for ANSI C header files" >&5
+echo "configure:1209: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1144 "configure"
+#line 1214 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1148,7 +1218,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1165,7 +1235,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1169 "configure"
+#line 1239 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1183,7 +1253,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1187 "configure"
+#line 1257 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1204,7 +1274,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1208 "configure"
+#line 1278 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1215,7 +1285,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1239,12 +1309,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1243: checking for working const" >&5
+echo "configure:1313: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1248 "configure"
+#line 1318 "configure"
#include "confdefs.h"
int main() {
@@ -1293,7 +1363,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1314,21 +1384,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1318: checking for inline" >&5
+echo "configure:1388: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1325 "configure"
+#line 1395 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1354,12 +1424,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1358: checking for off_t" >&5
+echo "configure:1428: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1363 "configure"
+#line 1433 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1387,12 +1457,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1391: checking for size_t" >&5
+echo "configure:1461: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1396 "configure"
+#line 1466 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1422,19 +1492,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1426: checking for working alloca.h" >&5
+echo "configure:1496: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1431 "configure"
+#line 1501 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1455,12 +1525,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1459: checking for alloca" >&5
+echo "configure:1529: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1464 "configure"
+#line 1534 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1488,7 +1558,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1520,12 +1590,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1524: checking whether alloca needs Cray hooks" >&5
+echo "configure:1594: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1599 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1550,12 +1620,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1554: checking for $ac_func" >&5
+echo "configure:1624: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1559 "configure"
+#line 1629 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1578,7 +1648,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1605,7 +1675,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1609: checking stack direction for C alloca" >&5
+echo "configure:1679: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1613,7 +1683,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1617 "configure"
+#line 1687 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1632,7 +1702,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1657,17 +1727,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1661: checking for $ac_hdr" >&5
+echo "configure:1731: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1666 "configure"
+#line 1736 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1696,12 +1766,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1700: checking for $ac_func" >&5
+echo "configure:1770: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1705 "configure"
+#line 1775 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1724,7 +1794,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1749,7 +1819,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1753: checking for working mmap" >&5
+echo "configure:1823: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1757,7 +1827,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1761 "configure"
+#line 1831 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1897,7 +1967,7 @@ main()
}
EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -1925,17 +1995,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1929: checking for $ac_hdr" >&5
+echo "configure:1999: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1934 "configure"
+#line 2004 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1965,12 +2035,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1969: checking for $ac_func" >&5
+echo "configure:2039: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 2044 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1993,7 +2063,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2022,12 +2092,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2026: checking for $ac_func" >&5
+echo "configure:2096: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2031 "configure"
+#line 2101 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2050,7 +2120,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2084,19 +2154,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2088: checking for LC_MESSAGES" >&5
+echo "configure:2158: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2093 "configure"
+#line 2163 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2117,7 +2187,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2121: checking whether NLS is requested" >&5
+echo "configure:2191: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2137,7 +2207,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2141: checking whether included gettext is requested" >&5
+echo "configure:2211: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -2156,17 +2226,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2160: checking for libintl.h" >&5
+echo "configure:2230: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2165 "configure"
+#line 2235 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2183,19 +2253,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2187: checking for gettext in libc" >&5
+echo "configure:2257: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2192 "configure"
+#line 2262 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2211,7 +2281,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2215: checking for bindtextdomain in -lintl" >&5
+echo "configure:2285: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2219,7 +2289,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2223 "configure"
+#line 2293 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2230,7 +2300,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2246,19 +2316,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2250: checking for gettext in libintl" >&5
+echo "configure:2320: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2255 "configure"
+#line 2325 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -2286,7 +2356,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2290: checking for $ac_word" >&5
+echo "configure:2360: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2320,12 +2390,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2324: checking for $ac_func" >&5
+echo "configure:2394: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2329 "configure"
+#line 2399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2348,7 +2418,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2375,7 +2445,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2379: checking for $ac_word" >&5
+echo "configure:2449: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2411,7 +2481,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2415: checking for $ac_word" >&5
+echo "configure:2485: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2443,7 +2513,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2447 "configure"
+#line 2517 "configure"
#include "confdefs.h"
int main() {
@@ -2451,7 +2521,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -2483,7 +2553,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2487: checking for $ac_word" >&5
+echo "configure:2557: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2517,7 +2587,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2521: checking for $ac_word" >&5
+echo "configure:2591: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2553,7 +2623,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2557: checking for $ac_word" >&5
+echo "configure:2627: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2643,7 +2713,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2647: checking for catalogs to be installed" >&5
+echo "configure:2717: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -2671,17 +2741,17 @@ echo "configure:2647: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2675: checking for linux/version.h" >&5
+echo "configure:2745: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2680 "configure"
+#line 2750 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2726,7 +2796,7 @@ fi
l=
- if test -d $srcdir/po; then
+ if test -f $srcdir/po/POTFILES.in; then
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
@@ -2745,16 +2815,93 @@ fi
CONFIG_OBS=
+CONFIG_LIB_OBS=
CONFIG_DEPS=
CONFIG_SRCS=
+CONFIG_INITS=
+ENABLE_CFLAGS=
+CONFIG_ALL=
+CONFIG_CLEAN=
+CONFIG_INSTALL=
+CONFIG_UNINSTALL=
configdirs="doc testsuite"
+# Check whether --enable-multi-ice or --disable-multi-ice was given.
+if test "${enable_multi_ice+set}" = set; then
+ enableval="$enable_multi_ice"
+ case "${enableval}" in
+ yes ) enable_multi_ice="yes" ;;
+ no) enable_multi_ice="no" ;;
+ *) { echo "configure: error: Bad value for --enable-multi-ice: ${enableval}" 1>&2; exit 1; } ;;
+ esac
+
+fi
+
+
+if test "${enable_multi_ice}" = "yes"; then
+ configdirs="${configdirs} multi-ice"
+fi
+
. ${srcdir}/configure.host
. ${srcdir}/configure.tgt
+targ=${target} ; . ${srcdir}/../bfd/config.bfd
+
+
+targ=${target}
+. ${srcdir}/../bfd/config.bfd
+
+targ_archs=`echo ${targ_archs} | sed -e 's/ .*//;'`
+
+if test x"${targ_archs}" != x ; then
+ cat >> confdefs.h <<EOF
+#define DEFAULT_BFD_ARCH ${targ_archs}
+EOF
+
+fi
+if test x"${targ_defvec}" != x ; then
+ cat >> confdefs.h <<EOF
+#define DEFAULT_BFD_VEC ${targ_defvec}
+EOF
+
+fi
+
+for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2878: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AWK="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+ echo "$ac_t""$AWK" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2768,7 +2915,7 @@ configdirs="doc testsuite"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2772: checking for a BSD compatible install" >&5
+echo "configure:2919: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2829,7 +2976,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2833: checking for $ac_word" >&5
+echo "configure:2980: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2861,7 +3008,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2865: checking for $ac_word" >&5
+echo "configure:3012: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2893,7 +3040,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2897: checking for $ac_word" >&5
+echo "configure:3044: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2925,12 +3072,76 @@ else
fi
fi
+# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3079: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool"
+fi
+fi
+DLLTOOL="$ac_cv_prog_DLLTOOL"
+if test -n "$DLLTOOL"; then
+ echo "$ac_t""$DLLTOOL" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3111: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$WINDRES"; then
+ ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_WINDRES" && ac_cv_prog_WINDRES="windres"
+fi
+fi
+WINDRES="$ac_cv_prog_WINDRES"
+if test -n "$WINDRES"; then
+ echo "$ac_t""$WINDRES" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2934: checking for $ac_word" >&5
+echo "configure:3145: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2961,6 +3172,39 @@ done
test -n "$YACC" || YACC="yacc"
+# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mig; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3179: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$MIG"; then
+ ac_cv_prog_MIG="$MIG" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_MIG="${ac_tool_prefix}mig"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig"
+fi
+fi
+MIG="$ac_cv_prog_MIG"
+if test -n "$MIG"; then
+ echo "$ac_t""$MIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
@@ -2982,12 +3226,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2986: checking return type of signal handlers" >&5
+echo "configure:3230: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2991 "configure"
+#line 3235 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3004,7 +3248,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3024,12 +3268,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3028: checking for ANSI C header files" >&5
+echo "configure:3272: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3033 "configure"
+#line 3277 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3037,7 +3281,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3054,7 +3298,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3058 "configure"
+#line 3302 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3072,7 +3316,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3076 "configure"
+#line 3320 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3093,7 +3337,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3097 "configure"
+#line 3341 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3104,7 +3348,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -3128,25 +3372,37 @@ EOF
fi
-for ac_hdr in ctype.h curses.h endian.h link.h \
+
+case $host_os in solaris2.7 | solaris2.8) case "$GCC" in yes)
+ cat >> confdefs.h <<\EOF
+#define _MSE_INT_H 1
+EOF
+
+esac; esac
+
+for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
- string.h sys/procfs.h sys/ptrace.h sys/reg.h \
+ string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
- wchar.h wctype.h asm/debugreg.h sys/debugreg.h
+ wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
+ time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
+ dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
+ curses.h ncurses.h \
+ poll.h sys/poll.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3140: checking for $ac_hdr" >&5
+echo "configure:3396: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3145 "configure"
+#line 3401 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3173,12 +3429,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3177: checking whether stat file-mode macros are broken" >&5
+echo "configure:3433: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3182 "configure"
+#line 3438 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -3230,12 +3486,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3234: checking for working const" >&5
+echo "configure:3490: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3239 "configure"
+#line 3495 "configure"
#include "confdefs.h"
int main() {
@@ -3284,7 +3540,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3305,15 +3561,16 @@ EOF
fi
-for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc
+for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \
+ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3312: checking for $ac_func" >&5
+echo "configure:3569: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3317 "configure"
+#line 3574 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3336,7 +3593,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3363,19 +3620,19 @@ done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3367: checking for working alloca.h" >&5
+echo "configure:3624: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+#line 3629 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -3396,12 +3653,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3400: checking for alloca" >&5
+echo "configure:3657: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3405 "configure"
+#line 3662 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3429,7 +3686,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -3461,12 +3718,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3465: checking whether alloca needs Cray hooks" >&5
+echo "configure:3722: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3470 "configure"
+#line 3727 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3491,12 +3748,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3495: checking for $ac_func" >&5
+echo "configure:3752: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3500 "configure"
+#line 3757 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3519,7 +3776,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3546,7 +3803,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3550: checking stack direction for C alloca" >&5
+echo "configure:3807: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3554,7 +3811,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3558 "configure"
+#line 3815 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3573,7 +3830,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -3594,14 +3851,698 @@ EOF
fi
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:3856: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3861 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_pid_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_pid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define pid_t int
+EOF
+
+fi
+
+ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
+echo "configure:3890: checking for vfork.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3895 "configure"
+#include "confdefs.h"
+#include <vfork.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_VFORK_H 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for working vfork""... $ac_c" 1>&6
+echo "configure:3925: checking for working vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ echo $ac_n "checking for vfork""... $ac_c" 1>&6
+echo "configure:3931: checking for vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3936 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vfork(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char vfork();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_vfork) || defined (__stub___vfork)
+choke me
+#else
+vfork();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_vfork=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_vfork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3981 "configure"
+#include "confdefs.h"
+/* Thanks to Paul Eggert for this test. */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent.
+ The compiler is told about this with #include <vfork.h>,
+ but some compilers (e.g. gcc -O) don't grok <vfork.h>.
+ Test for this by using a static variable whose address
+ is put into a register that is clobbered by the vfork. */
+static
+#ifdef __cplusplus
+sparc_address_test (int arg)
+#else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+main() {
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test ();
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems.
+ This test uses lots of local variables, at least
+ as many local variables as main has allocated so far
+ including compiler temporaries. 4 locals are enough for
+ gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
+ A buggy compiler should reuse the register of parent
+ for one of the local variables, since it will think that
+ parent can't possibly be used any more in this routine.
+ Assigning to the local variable will thus munge parent
+ in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3),
+ vfork doesn't separate parent from child file descriptors.
+ If the child closes a descriptor before it execs or exits,
+ this munges the parent's descriptor as well.
+ Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ exit(
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+EOF
+if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_vfork_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_vfork_works=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
+if test $ac_cv_func_vfork_works = no; then
+ cat >> confdefs.h <<\EOF
+#define vfork fork
+EOF
+
+fi
+
+if test "$cross_compiling" = no; then
+ echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
+echo "configure:4100: checking whether setpgrp takes no argument" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4108 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/*
+ * If this system has a BSD-style setpgrp, which takes arguments, exit
+ * successfully.
+ */
+main()
+{
+ if (setpgrp(1,1) == -1)
+ exit(0);
+ else
+ exit(1);
+}
+
+EOF
+if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_setpgrp_void=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_setpgrp_void=yes
+fi
+rm -fr conftest*
+fi
+
+
+fi
+
+echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
+if test $ac_cv_func_setpgrp_void = yes; then
+ cat >> confdefs.h <<\EOF
+#define SETPGRP_VOID 1
+EOF
+
+fi
+
+else
+ echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
+echo "configure:4153: checking whether setpgrp takes no argument" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4158 "configure"
+#include "confdefs.h"
+
+#include <unistd.h>
+
+int main() {
+
+ if (setpgrp(1,1) == -1)
+ exit (0);
+ else
+ exit (1);
+
+; return 0; }
+EOF
+if { (eval echo configure:4172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_func_setpgrp_void=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_func_setpgrp_void=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
+if test $ac_cv_func_setpgrp_void = yes; then
+ cat >> confdefs.h <<\EOF
+#define SETPGRP_VOID 1
+EOF
+
+fi
+fi
+
+# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
+# since sigsetjmp might only be defined as a macro.
+echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
+echo "configure:4196: checking for sigsetjmp" >&5
+if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4201 "configure"
+#include "confdefs.h"
+
+#include <setjmp.h>
+
+int main() {
+sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+; return 0; }
+EOF
+if { (eval echo configure:4210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_func_sigsetjmp=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_func_sigsetjmp=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_func_sigsetjmp" 1>&6
+if test $gdb_cv_func_sigsetjmp = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SIGSETJMP 1
+EOF
+
+fi
+
+# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
+# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
+echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
+echo "configure:4233: checking for r_fs in struct reg" >&5
+if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4238 "configure"
+#include "confdefs.h"
+#include <machine/reg.h>
+int main() {
+struct reg r; r.r_fs;
+; return 0; }
+EOF
+if { (eval echo configure:4245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_struct_reg_r_fs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_struct_reg_r_fs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_struct_reg_r_fs" 1>&6
+if test $gdb_cv_struct_reg_r_fs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_REG_R_FS 1
+EOF
+
+fi
+echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
+echo "configure:4265: checking for r_gs in struct reg" >&5
+if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4270 "configure"
+#include "confdefs.h"
+#include <machine/reg.h>
+int main() {
+struct reg r; r.r_gs;
+; return 0; }
+EOF
+if { (eval echo configure:4277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_struct_reg_r_gs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_struct_reg_r_gs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_struct_reg_r_gs" 1>&6
+if test $gdb_cv_struct_reg_r_gs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_REG_R_GS 1
+EOF
+
+fi
+
+# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
+echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
+echo "configure:4299: checking for PTRACE_GETREGS" >&5
+if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4304 "configure"
+#include "confdefs.h"
+#include <sys/ptrace.h>
+int main() {
+PTRACE_GETREGS;
+; return 0; }
+EOF
+if { (eval echo configure:4311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_ptrace_getregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_ptrace_getregs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_have_ptrace_getregs" 1>&6
+if test $gdb_cv_have_ptrace_getregs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTRACE_GETREGS 1
+EOF
+
+fi
+
+# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
+echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
+echo "configure:4333: checking for PTRACE_GETFPXREGS" >&5
+if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4338 "configure"
+#include "confdefs.h"
+#include <sys/ptrace.h>
+int main() {
+PTRACE_GETFPXREGS;
+; return 0; }
+EOF
+if { (eval echo configure:4345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_ptrace_getfpxregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_ptrace_getfpxregs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_have_ptrace_getfpxregs" 1>&6
+if test $gdb_cv_have_ptrace_getfpxregs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTRACE_GETFPXREGS 1
+EOF
+
+fi
+
+# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
+echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
+echo "configure:4367: checking for PT_GETDBREGS" >&5
+if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4372 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/ptrace.h>
+int main() {
+PT_GETDBREGS;
+; return 0; }
+EOF
+if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_pt_getdbregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_pt_getdbregs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_have_pt_getdbregs" 1>&6
+if test $gdb_cv_have_pt_getdbregs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PT_GETDBREGS 1
+EOF
+
+fi
+
+# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
+echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
+echo "configure:4402: checking for PT_GETXMMREGS" >&5
+if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4407 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/ptrace.h>
+int main() {
+PT_GETXMMREGS;
+; return 0; }
+EOF
+if { (eval echo configure:4415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_pt_getxmmregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_pt_getxmmregs=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_have_pt_getxmmregs" 1>&6
+if test $gdb_cv_have_pt_getxmmregs = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PT_GETXMMREGS 1
+EOF
+
+fi
+
+
+echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
+echo "configure:4437: checking for socketpair in -lsocket" >&5
+ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4445 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socketpair();
+
+int main() {
+socketpair()
+; return 0; }
+EOF
+if { (eval echo configure:4456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+for ac_func in socketpair
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:4486: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4491 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:3600: checking whether malloc must be declared" >&5
+echo "configure:4541: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3605 "configure"
+#line 4546 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3622,7 +4563,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:3626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -3643,12 +4584,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:3647: checking whether realloc must be declared" >&5
+echo "configure:4588: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3652 "configure"
+#line 4593 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3669,7 +4610,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:3673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -3690,12 +4631,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:3694: checking whether free must be declared" >&5
+echo "configure:4635: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3699 "configure"
+#line 4640 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3716,7 +4657,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:3720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -3737,12 +4678,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:3741: checking whether strerror must be declared" >&5
+echo "configure:4682: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3746 "configure"
+#line 4687 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3763,7 +4704,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -3784,12 +4725,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:3788: checking whether strdup must be declared" >&5
+echo "configure:4729: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3793 "configure"
+#line 4734 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3810,7 +4751,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -3830,6 +4771,100 @@ EOF
fi
+echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
+echo "configure:4776: checking whether strstr must be declared" >&5
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4781 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) strstr
+; return 0; }
+EOF
+if { (eval echo configure:4802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_strstr=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_decl_needed_strstr=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
+if test $bfd_cv_decl_needed_strstr = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_STRSTR 1
+EOF
+
+fi
+
+echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
+echo "configure:4823: checking whether canonicalize_file_name must be declared" >&5
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4828 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) canonicalize_file_name
+; return 0; }
+EOF
+if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_canonicalize_file_name=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_decl_needed_canonicalize_file_name=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_canonicalize_file_name" 1>&6
+if test $bfd_cv_decl_needed_canonicalize_file_name = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
+EOF
+
+fi
+
# The following save_state_t checkery is only necessary for HPUX
@@ -3837,9 +4872,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:3841: checking for HPUX save_state structure" >&5
+echo "configure:4876: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 3843 "configure"
+#line 4878 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -3854,7 +4889,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3858 "configure"
+#line 4893 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -3887,7 +4922,7 @@ echo "$ac_t""$gdb_cv_hpux_sswide" 1>&6
# If we are configured native on GNU/Linux, work around problems with
# sys/procfs.h
-# Also detect which type of /proc is in use, such as for Unixware.
+# Also detect which type of /proc is in use, such as for Unixware or Solaris.
if test "${target}" = "${host}"; then
case "${host}" in
@@ -3901,42 +4936,44 @@ EOF
EOF
;;
- esac
- echo $ac_n "checking for directory proc entries""... $ac_c" 1>&6
-echo "configure:3907: checking for directory proc entries" >&5
-# The [gdb_host != sun4sol2] hack is because Solaris does provide the
-# multiple procfs files as of Solaris 2.6, but GDB can't use it right now.
- if test "$ac_cv_header_sys_procfs_h" = yes -a "$gdb_host" != sun4sol2 \
- -a -d /proc/$$ \
- -a -f /proc/$$/ctl \
- -a -f /proc/$$/as \
- -a -f /proc/$$/map \
- -a -f /proc/$$/status; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_MULTIPLE_PROC_FDS 1
+ ia64-*-aix*)
+ cat >> confdefs.h <<\EOF
+#define NEW_PROC_API 1
EOF
- else
- echo "$ac_t""no" 1>&6
- fi
+ ;;
+ *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+ cat >> confdefs.h <<\EOF
+#define NEW_PROC_API 1
+EOF
+
+ ;;
+ *-*-solaris2.[678])
+ cat >> confdefs.h <<\EOF
+#define NEW_PROC_API 1
+EOF
+
+ ;;
+ esac
fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:3928: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:4963: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3933 "configure"
+#line 4968 "configure"
#include "confdefs.h"
+
+#define _SYSCALL32
#include <sys/procfs.h>
int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:3940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -3958,19 +4995,21 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:3962: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:4999: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3967 "configure"
+#line 5004 "configure"
#include "confdefs.h"
+
+#define _SYSCALL32
#include <sys/procfs.h>
int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:3974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -3992,19 +5031,21 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:3996: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:5035: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4001 "configure"
+#line 5040 "configure"
#include "confdefs.h"
+
+#define _SYSCALL32
#include <sys/procfs.h>
int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:4008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -4026,19 +5067,21 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4030: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:5071: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4035 "configure"
+#line 5076 "configure"
#include "confdefs.h"
+
+#define _SYSCALL32
#include <sys/procfs.h>
int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -4059,15 +5102,421 @@ EOF
fi
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
+ echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5107: checking for prgregset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5112 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prgregset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRGREGSET_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
+
+ echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5143: checking for prfpregset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5148 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prfpregset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRFPREGSET_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
+
+ echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5179: checking for prgregset32_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5184 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prgregset32_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset32_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset32_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRGREGSET32_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
+
+ echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5215: checking for prfpregset32_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5220 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prfpregset32_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset32_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset32_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRFPREGSET32_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
+
+ echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5251: checking for lwpid_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5256 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+lwpid_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpid_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpid_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWPID_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
+
+ echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5287: checking for psaddr_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5292 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+psaddr_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psaddr_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psaddr_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PSADDR_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
+
+ echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5323: checking for prsysent_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5328 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prsysent_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prsysent_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prsysent_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prsysent_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRSYSENT_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
+
+ echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5359: checking for pr_sigset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5364 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+pr_sigset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_sigset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_pr_sigset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PR_SIGSET_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
+
+ echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5395: checking for pr_sigaction64_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5400 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+pr_sigaction64_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_sigaction64_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_pr_sigaction64_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PR_SIGACTION64_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
+
+ echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:5431: checking for pr_siginfo64_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5436 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+pr_siginfo64_t avar
+; return 0; }
+EOF
+if { (eval echo configure:5445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pr_siginfo64_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_pr_siginfo64_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PR_SIGINFO64_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_siginfo64_t" 1>&6
+
+
+
+
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
+echo "configure:5472: checking whether prfpregset_t type is broken" >&5
+ if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ gdb_cv_prfpregset_t_broken=yes
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5480 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+ int main ()
+ {
+ if (sizeof (prfpregset_t) == sizeof (void *))
+ return 1;
+ return 0;
+ }
+EOF
+if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ gdb_cv_prfpregset_t_broken=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ gdb_cv_prfpregset_t_broken=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+ echo "$ac_t""$gdb_cv_prfpregset_t_broken" 1>&6
+ if test $gdb_cv_prfpregset_t_broken = yes; then
+ cat >> confdefs.h <<\EOF
+#define PRFPREGSET_T_BROKEN 1
+EOF
+
+ fi
+ fi
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4066: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:5515: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4071 "configure"
+#line 5520 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -4080,7 +5529,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -4101,8 +5550,152 @@ EOF
fi
fi
+if test ${host} = ${target} ; then
+
+ echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
+echo "configure:5557: checking for member l_addr in struct link_map" >&5
+ if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5562 "configure"
+#include "confdefs.h"
+#include <link.h>
+int main() {
+struct link_map lm; (void) lm.l_addr;
+; return 0; }
+EOF
+if { (eval echo configure:5569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map_with_l_members=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map_with_l_members=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdb_cv_have_struct_link_map_with_l_members" 1>&6
+ if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
+EOF
+
+ fi
+
+
+ echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
+echo "configure:5591: checking for member lm_addr in struct link_map" >&5
+ if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5596 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <link.h>
+int main() {
+struct link_map lm; (void) lm.lm_addr;
+; return 0; }
+EOF
+if { (eval echo configure:5604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map_with_lm_members=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map_with_lm_members=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdb_cv_have_struct_link_map_with_lm_members" 1>&6
+ if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS 1
+EOF
+
+ fi
+
+
+ echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
+echo "configure:5626: checking for member som_addr in struct so_map" >&5
+ if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5631 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+#include <link.h>
+int main() {
+struct so_map lm; (void) lm.som_addr;
+; return 0; }
+EOF
+if { (eval echo configure:5642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_struct_so_map_with_som_members=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_struct_so_map_with_som_members=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdb_cv_have_struct_so_map_with_som_members" 1>&6
+ if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS 1
+EOF
+
+ fi
+
+
+ echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
+echo "configure:5664: checking for struct link_map32 in sys/link.h" >&5
+ if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5669 "configure"
+#include "confdefs.h"
+#define _SYSCALL32
+#include <sys/link.h>
+int main() {
+struct link_map32 l;
+; return 0; }
+EOF
+if { (eval echo configure:5677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_struct_link_map32=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdb_cv_have_struct_link_map32" 1>&6
+ if test $gdb_cv_have_struct_link_map32 = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_LINK_MAP32 1
+EOF
+
+ fi
+fi
+
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:4106: checking for main in -lm" >&5
+echo "configure:5699: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4110,14 +5703,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4114 "configure"
+#line 5707 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4146,7 +5739,7 @@ fi
echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
-echo "configure:4150: checking for wctype in -lc" >&5
+echo "configure:5743: checking for wctype in -lc" >&5
ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4154,7 +5747,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4158 "configure"
+#line 5751 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4165,7 +5758,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:4169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4184,7 +5777,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:4188: checking for wctype in -lw" >&5
+echo "configure:5781: checking for wctype in -lw" >&5
ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4192,7 +5785,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4196 "configure"
+#line 5789 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4203,7 +5796,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:4207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4235,12 +5828,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:4239: checking for long long support in compiler" >&5
+echo "configure:5832: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4244 "configure"
+#line 5837 "configure"
#include "confdefs.h"
int main() {
@@ -4250,7 +5843,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -4272,7 +5865,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:4276: checking for long long support in printf" >&5
+echo "configure:5869: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4280,7 +5873,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 4284 "configure"
+#line 5877 "configure"
#include "confdefs.h"
int main () {
@@ -4294,7 +5887,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -4318,19 +5911,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:4322: checking for long double support in compiler" >&5
+echo "configure:5915: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4327 "configure"
+#line 5920 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:4334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -4352,7 +5945,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:4356: checking for long double support in printf" >&5
+echo "configure:5949: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4360,7 +5953,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 4364 "configure"
+#line 5957 "configure"
#include "confdefs.h"
int main () {
@@ -4370,7 +5963,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -4394,7 +5987,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:4398: checking for long double support in scanf" >&5
+echo "configure:5991: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4402,7 +5995,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 4406 "configure"
+#line 5999 "configure"
#include "confdefs.h"
int main () {
@@ -4412,7 +6005,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:4416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -4438,17 +6031,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4442: checking for $ac_hdr" >&5
+echo "configure:6035: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4447 "configure"
+#line 6040 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4477,12 +6070,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4481: checking for $ac_func" >&5
+echo "configure:6074: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4486 "configure"
+#line 6079 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4505,7 +6098,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4530,7 +6123,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:4534: checking for working mmap" >&5
+echo "configure:6127: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4538,7 +6131,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 4542 "configure"
+#line 6135 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -4678,7 +6271,7 @@ main()
}
EOF
-if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -4701,13 +6294,54 @@ EOF
fi
+case ${host_os} in
+aix*)
+ echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
+echo "configure:6301: checking for -bbigtoc option" >&5
+if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ SAVE_LDFLAGS=$LDFLAGS
+
+ case $GCC in
+ yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+ *) gdb_cv_bigtoc=-bbigtoc ;;
+ esac
+
+ LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+ cat > conftest.$ac_ext <<EOF
+#line 6315 "configure"
+#include "confdefs.h"
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:6322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_bigtoc=
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_cv_bigtoc" 1>&6
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
+ ;;
+esac
+
if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:4711: checking for HPUX/OSF thread support" >&5
+echo "configure:6345: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -4715,7 +6349,7 @@ echo "configure:4711: checking for HPUX/OSF thread support" >&5
#define HAVE_HPUX_THREAD_SUPPORT 1
EOF
- CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} hpux-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
else
echo "$ac_t""no (suppressed because you are not using GCC)" 1>&6
@@ -4726,17 +6360,17 @@ EOF
;;
solaris*)
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:4730: checking for Solaris thread debugging library" >&5
+echo "configure:6364: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_THREAD_DB_LIB 1
EOF
- CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4740: checking for dlopen in -ldl" >&5
+echo "configure:6374: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4744,7 +6378,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4748 "configure"
+#line 6382 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4755,7 +6389,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4787,17 +6421,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:4791: checking for the ld -export-dynamic flag" >&5
+echo "configure:6425: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 4794 "configure"
+#line 6428 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -4816,13 +6450,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:4820: checking if <proc_service.h> is old" >&5
+echo "configure:6454: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4826 "configure"
+#line 6460 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -4833,7 +6467,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -4861,7 +6495,100 @@ EOF
fi
-ENABLE_CFLAGS=
+
+# Check whether --enable-gdbcli or --disable-gdbcli was given.
+if test "${enable_gdbcli+set}" = set; then
+ enableval="$enable_gdbcli"
+
+ case "${enableval}" in
+ yes) enable_gdbcli=yes ;;
+ "") enable_gdbcli=yes ;;
+ no)
+ { echo "configure: error: The CLI cannot be disabled yet" 1>&2; exit 1; }
+ ;;
+ *)
+ { echo "configure: error: Bad value for --enable-gdbcli: ${enableval}" 1>&2; exit 1; }
+ ;;
+ esac
+
+else
+ enable_gdbcli=yes
+fi
+
+case ${enable_gdbcli} in
+ "yes" )
+ if test -d "${srcdir}/cli" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_CLI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_CLI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_CLI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_CLI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_CLI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_CLI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_CLI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_CLI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_CLI_UNINSTALL)"
+ fi
+ ;;
+esac
+
+
+# Check whether --enable-gdbmi or --disable-gdbmi was given.
+if test "${enable_gdbmi+set}" = set; then
+ enableval="$enable_gdbmi"
+
+ case "${enable_gdbmi}" in
+ yes | no) ;;
+ "") enable_gdbmi=yes ;;
+ *)
+ { echo "configure: error: Bad value for --enable-gdbmi: ${enableval}" 1>&2; exit 1; }
+ ;;
+ esac
+
+else
+ enable_gdbmi=yes
+fi
+
+case ${enable_gdbmi} in
+ "yes" )
+ if test -d "${srcdir}/mi" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_MI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_MI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_MI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_MI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_MI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_MI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_MI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_MI_UNINSTALL)"
+ fi
+ ;;
+esac
+
+# Configure UI_OUT by default (before 5.2 it can be disabled)
+# It must be configured if gdbmi is configured
+
+UIOUT_CFLAGS=
+
+
+# Check whether --with-uiout or --without-uiout was given.
+if test "${with_uiout+set}" = set; then
+ withval="$with_uiout"
+ case "${withval}" in
+ yes) want_uiout=true ;;
+ no) if test $enable_gdbmi = yes; then
+ { echo "configure: error: uiout is needed for MI and cannot be disabled" 1>&2; exit 1; }
+ else
+ want_uiout=false
+ fi ;;
+ *) { echo "configure: error: bad value ${withval} for GDB with-uiout option" 1>&2; exit 1; } ;;
+esac
+else
+ want_uiout=true
+fi
+
+if test $want_uiout = true; then
+ UIOUT_CFLAGS="-DUI_OUT=1"
+fi
# Check whether --enable-tui or --disable-tui was given.
if test "${enable_tui+set}" = set; then
@@ -4879,21 +6606,20 @@ fi
case ${enable_tui} in
"yes" )
- cat >> confdefs.h <<\EOF
-#define TUI 1
-EOF
-
- BUILD_TUI=all-tui
- TUI_LIBRARY=tui/libtui.a
- ;;
- * )
- BUILD_TUI=
- TUI_LIBRARY=
- ;;
+ if test -d "${srcdir}/tui" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_TUI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)"
+ fi
+ ;;
esac
-
-
# Check whether --enable-netrom or --disable-netrom was given.
if test "${enable_netrom+set}" = set; then
enableval="$enable_netrom"
@@ -4906,15 +6632,27 @@ fi
if test "${enable_netrom}" = "yes"; then
- CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} remote-nrom.o"
CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
fi
+
+# NOTE: Don't add -Wall or -Wunused, they both include
+# -Wunused-parameter which reports bogus warnings.
+# NOTE: If you add to this list, remember to update
+# gdb/doc/gdbint.texinfo.
+build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
+# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
+# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
+# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
+# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
+# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
+# -Woverloaded-virtual -Winline -Werror"
# Check whether --enable-build-warnings or --disable-build-warnings was given.
if test "${enable_build_warnings+set}" = set; then
enableval="$enable_build_warnings"
- build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
-case "${enableval}" in
+ case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
@@ -4923,18 +6661,64 @@ case "${enableval}" in
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
-else
- build_warnings=""
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting compiler warning flags = $build_warnings" 6>&1
fi
-
+fi
+# Check whether --enable-gdb-build-warnings or --disable-gdb-build-warnings was given.
+if test "${enable_gdb_build_warnings+set}" = set; then
+ enableval="$enable_gdb_build_warnings"
+ case "${enableval}" in
+ yes) ;;
+ no) build_warnings="-w";;
+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${build_warnings} ${t}";;
+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${t} ${build_warnings}";;
+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+WARN_CFLAGS=""
+WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
- WARN_CFLAGS="${build_warnings}"
+ echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
+echo "configure:6690: checking compiler warning flags" >&5
+ # Separate out the -Werror flag as some files just cannot be
+ # compiled with it enabled.
+ for w in ${build_warnings}; do
+ case $w in
+ -Werr*) WERROR_CFLAGS=-Werror ;;
+ *) # Check that GCC accepts it
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $w"
+ cat > conftest.$ac_ext <<EOF
+#line 6700 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ WARN_CFLAGS="${WARN_CFLAGS} $w"
else
- WARN_CFLAGS=""
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ CFLAGS="$saved_CFLAGS"
+ esac
+ done
+ echo "$ac_t""${WARN_CFLAGS}${WERROR_CFLAGS}" 1>&6
fi
+
MMALLOC_CFLAGS=
MMALLOC=
@@ -4965,12 +6749,110 @@ EOF
MMALLOC='../mmalloc/libmmalloc.a'
fi
+# Check whether --with-included-regex or --without-included-regex was given.
+if test "${with_included_regex+set}" = set; then
+ withval="$with_included_regex"
+ case "${withval}" in
+ yes) want_included_regex=true ;;
+ no) want_included_regex=false;;
+ *) { echo "configure: error: bad value ${withval} for GDB with-included-regex option" 1>&2; exit 1; } ;;
+esac
+else
+ want_included_regex=true
+fi
+
+if test $want_included_regex = false; then
+ echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
+echo "configure:6767: checking for GNU regex" >&5
+ if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6772 "configure"
+#include "confdefs.h"
+#include <gnu-versions.h>
+#include <sys/types.h>
+#include <regex.h>
+int main() {
+#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2
+#error No valid GNU regex.
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_have_gnu_regex=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_have_gnu_regex=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdb_cv_have_gnu_regex" 1>&6
+ if test $gdb_cv_have_gnu_regex = no; then
+ want_included_regex=true
+ fi
+fi
+
+if test x${want_included_regex} = xtrue; then
+ REGEX="gnu-regex.o"
+ cat >> confdefs.h <<\EOF
+#define USE_INCLUDED_REGEX 1
+EOF
+
+fi
+
+
+# In the Cygwin environment, we need some additional flags.
+echo $ac_n "checking for cygwin""... $ac_c" 1>&6
+echo "configure:6813: checking for cygwin" >&5
+if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6818 "configure"
+#include "confdefs.h"
+
+#if defined (__CYGWIN__) || defined (__CYGWIN32__)
+lose
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "lose" >/dev/null 2>&1; then
+ rm -rf conftest*
+ gdb_cv_os_cygwin=yes
+else
+ rm -rf conftest*
+ gdb_cv_os_cygwin=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_cv_os_cygwin" 1>&6
+
+
+SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
+case ${host} in
+ *go32* ) SER_HARDWIRE=ser-go32.o ;;
+ *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
+esac
+
+
+
+if test x$gdb_host = xgo32; then
+ TERM_LIB=
+else
if test x$gdb_cv_os_cygwin = xyes; then
TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:4974: checking for tgetent in -lncurses" >&5
+echo "configure:6856: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4978,7 +6860,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4982 "configure"
+#line 6864 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4989,7 +6871,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:4993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5008,7 +6890,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
-echo "configure:5012: checking for tgetent in -lHcurses" >&5
+echo "configure:6894: checking for tgetent in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5016,7 +6898,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5020 "configure"
+#line 6902 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5027,7 +6909,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5046,7 +6928,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
-echo "configure:5050: checking for tgetent in -ltermlib" >&5
+echo "configure:6932: checking for tgetent in -ltermlib" >&5
ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5054,7 +6936,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5058 "configure"
+#line 6940 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5065,7 +6947,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5084,7 +6966,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:5088: checking for tgetent in -ltermcap" >&5
+echo "configure:6970: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5092,7 +6974,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5096 "configure"
+#line 6978 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5103,7 +6985,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5122,7 +7004,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:5126: checking for tgetent in -lcurses" >&5
+echo "configure:7008: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5130,7 +7012,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5134 "configure"
+#line 7016 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5141,7 +7023,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5160,7 +7042,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
-echo "configure:5164: checking for tgetent in -lterminfo" >&5
+echo "configure:7046: checking for tgetent in -lterminfo" >&5
ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5168,7 +7050,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5172 "configure"
+#line 7054 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5179,7 +7061,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5215,6 +7097,1049 @@ fi
{ echo "configure: error: Could not find a term library" 1>&2; exit 1; }
fi
fi
+fi
+
+
+# libreadline needs libuser32.a in a cygwin environment
+WIN32LIBS=
+if test x$gdb_cv_os_cygwin = xyes; then
+ WIN32LIBS="-luser32"
+ case "${target}" in
+ *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
+ ;;
+ esac
+fi
+
+
+LIBGUI="../libgui/src/libgui.a"
+GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
+
+
+
+# Check whether --with-cpu or --without-cpu was given.
+if test "${with_cpu+set}" = set; then
+ withval="$with_cpu"
+ case "${target}" in
+ powerpc-* | powerpcle-* )
+ ## It would be nice to keep this table in sync with the one in
+ ## gcc/configure.
+ case "${with_cpu}" in
+ ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
+ | 604 | 750 )
+ ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
+ ;;
+ common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
+ ## These are all RS6000 variants, as far as GDB is concerned.
+ with_cpu=rs6000
+ ;;
+ 603e | ec603e )
+ with_cpu=603
+ ;;
+ 604e )
+ with_cpu=604
+ ;;
+ * )
+ echo "configure: warning: GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'." 1>&2
+ with_cpu=ppc-uisa
+ ;;
+ esac
+ ;;
+ * )
+ echo "configure: warning: GDB may ignore the --with-cpu flag for ${target} targets" 1>&2
+ ;;
+esac
+cat >> confdefs.h <<EOF
+#define TARGET_CPU_DEFAULT "${with_cpu}"
+EOF
+
+
+fi
+
+
+
+# Check whether --enable-gdbtk or --disable-gdbtk was given.
+if test "${enable_gdbtk+set}" = set; then
+ enableval="$enable_gdbtk"
+ case "${enableval}" in
+ yes)
+ case "$host" in
+ *go32*)
+ echo "configure: warning: GDB does not support GDBtk on host ${host}. GDBtk will be disabled." 1>&2
+ enable_gdbtk=no ;;
+ *windows*)
+ echo "configure: warning: GDB does not support GDBtk on host ${host}. GDBtk will be disabled." 1>&2
+ enable_gdbtk=no ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac ;;
+ no)
+ enable_gdbtk=no ;;
+ *)
+ { echo "configure: error: bad value ${enableval} given for gdbtk option" 1>&2; exit 1; } ;;
+esac
+else
+
+# Default is on for everything but go32 and Cygwin
+case "$host" in
+ *go32* | *windows*)
+ ;;
+ *)
+ if test -d "${srcdir}/gdbtk" ; then
+ enable_gdbtk=yes
+ fi
+ ;;
+esac
+
+fi
+
+
+WIN32LDAPP=
+
+
+
+configdir="unix"
+
+GDBTKLIBS=
+if test "${enable_gdbtk}" = "yes"; then
+
+ # Gdbtk must have an absolute path to srcdir in order to run
+ # properly when not installed.
+ here=`pwd`
+ cd ${srcdir}
+ GDBTK_SRC_DIR=`pwd`
+ cd $here
+
+
+#
+# Ok, lets find the tcl configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-tclconfig
+#
+
+if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+ # Check whether --with-tclconfig or --without-tclconfig was given.
+if test "${with_tclconfig+set}" = set; then
+ withval="$with_tclconfig"
+ with_tclconfig=${withval}
+fi
+
+ echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
+echo "configure:7230: checking for Tcl configuration" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ # First check to see if --with-tclconfig was specified.
+ if test x"${with_tclconfig}" != x ; then
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
+ else
+ { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; }
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[7-9]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[7-9]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[7-9]* 2>/dev/null` ; do
+ if test -f "$i/${configdir}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[7-9]* 2>/dev/null` ; do
+ if test -f "$i/${configdir}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCLCONFIG="# no Tcl configs found"
+ echo "configure: warning: Can't find Tcl configuration definitions" 1>&2
+ else
+ no_tcl=
+ TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
+ echo "$ac_t""found $TCLCONFIG" 1>&6
+ fi
+fi
+
+ if test -z "${no_tcl}"; then
+
+ . $TCLCONFIG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Ok, lets find the tk configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-tkconfig
+#
+
+if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+ # Check whether --with-tkconfig or --without-tkconfig was given.
+if test "${with_tkconfig+set}" = set; then
+ withval="$with_tkconfig"
+ with_tkconfig=${withval}
+fi
+
+ echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
+echo "configure:7338: checking for Tk configuration" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
+ else
+ { echo "configure: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" 1>&2; exit 1; }
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[4-9]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[4-9]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[4-9]* 2>/dev/null` ; do
+ if test -f "$i/${configdir}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[4-9]* 2>/dev/null` ; do
+ if test -f "$i/${configdir}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TKCONFIG="# no Tk configs found"
+ echo "configure: warning: Can't find Tk configuration definitions" 1>&2
+ else
+ no_tk=
+ TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
+ echo "$ac_t""found $TKCONFIG" 1>&6
+ fi
+fi
+
+
+
+ # now look for Tcl library stuff
+
+ case "${host}" in
+ *-*-cygwin*)
+ tcldir=../tcl/win/
+ ;;
+ *)
+ tcldir=../tcl/unix/
+ ;;
+ esac
+
+ TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
+
+ # If $no_tk is nonempty, then we can't do Tk, and there is no
+ # point to doing Tcl.
+ if test -z "${no_tk}"; then
+
+ if test -f "$TKCONFIG" ; then
+ . $TKCONFIG
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Ok, lets find the tcl source trees so we can use the headers
+# Warning: transition of version 9 to 10 will break this algorithm
+# because 10 sorts before 9. We also look for just tcl. We have to
+# be careful that we don't match stuff like tclX by accident.
+# the alternative search directory is involked by --with-tclinclude
+#
+
+no_tcl=true
+echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
+echo "configure:7447: checking for Tcl private headers. dir=${configdir}" >&5
+# Check whether --with-tclinclude or --without-tclinclude was given.
+if test "${with_tclinclude+set}" = set; then
+ withval="$with_tclinclude"
+ with_tclinclude=${withval}
+fi
+
+if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+# first check to see if --with-tclinclude was specified
+if test x"${with_tclinclude}" != x ; then
+ if test -f ${with_tclinclude}/tclInt.h ; then
+ ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
+ elif test -f ${with_tclinclude}/generic/tclInt.h ; then
+ ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
+ else
+ { echo "configure: error: ${with_tclinclude} directory doesn't contain private headers" 1>&2; exit 1; }
+ fi
+fi
+
+# next check if it came with Tcl configuration file
+if test x"${ac_cv_c_tclconfig}" = x ; then
+ if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)`
+ fi
+fi
+
+# next check in private source directory
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tclh}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[7-9]* 2>/dev/null` \
+ ${srcdir}/../../tcl \
+ `ls -dr ${srcdir}/../../tcl[7-9]* 2>/dev/null` \
+ ${srcdir}/../../../tcl \
+ `ls -dr ${srcdir}/../../../tcl[7-9]* 2>/dev/null ` ; do
+ if test -f $i/generic/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+# finally check in a few common install locations
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tclh}" = x ; then
+ for i in \
+ `ls -dr /usr/local/src/tcl[7-9]* 2>/dev/null` \
+ `ls -dr /usr/local/lib/tcl[7-9]* 2>/dev/null` \
+ /usr/local/src/tcl \
+ /usr/local/lib/tcl \
+ ${prefix}/include ; do
+ if test -f $i/generic/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+# see if one is installed
+if test x"${ac_cv_c_tclh}" = x ; then
+ ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
+echo "configure:7513: checking for tclInt.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7518 "configure"
+#include "confdefs.h"
+#include <tclInt.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_cv_c_tclh=installed
+else
+ echo "$ac_t""no" 1>&6
+ac_cv_c_tclh=""
+fi
+
+fi
+
+fi
+
+if test x"${ac_cv_c_tclh}" = x ; then
+ TCLHDIR="# no Tcl private headers found"
+ { echo "configure: error: Can't find Tcl private headers" 1>&2; exit 1; }
+fi
+if test x"${ac_cv_c_tclh}" != x ; then
+ no_tcl=""
+ if test x"${ac_cv_c_tclh}" = x"installed" ; then
+ echo "$ac_t""is installed" 1>&6
+ TCLHDIR=""
+ else
+ echo "$ac_t""found in ${ac_cv_c_tclh}" 1>&6
+ # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
+ TCLHDIR="-I${ac_cv_c_tclh}"
+ fi
+fi
+
+
+
+
+#
+# Ok, lets find the tk source trees so we can use the headers
+# If the directory (presumably symlink) named "tk" exists, use that one
+# in preference to any others. Same logic is used when choosing library
+# and again with Tcl. The search order is the best place to look first, then in
+# decreasing significance. The loop breaks if the trigger file is found.
+# Note the gross little conversion here of srcdir by cd'ing to the found
+# directory. This converts the path from a relative to an absolute, so
+# recursive cache variables for the path will work right. We check all
+# the possible paths in one loop rather than many seperate loops to speed
+# things up.
+# the alternative search directory is involked by --with-tkinclude
+#
+no_tk=true
+echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
+echo "configure:7583: checking for Tk private headers" >&5
+# Check whether --with-tkinclude or --without-tkinclude was given.
+if test "${with_tkinclude+set}" = set; then
+ withval="$with_tkinclude"
+ with_tkinclude=${withval}
+fi
+
+if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+# first check to see if --with-tkinclude was specified
+if test x"${with_tkinclude}" != x ; then
+ if test -f ${with_tkinclude}/tk.h ; then
+ ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
+ elif test -f ${with_tkinclude}/generic/tk.h ; then
+ ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
+ else
+ { echo "configure: error: ${with_tkinclude} directory doesn't contain private headers" 1>&2; exit 1; }
+ fi
+fi
+
+# next check if it came with Tk configuration file
+if test x"${ac_cv_c_tkconfig}" = x ; then
+ if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then
+ ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)`
+ fi
+fi
+
+# next check in private source directory
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tkh}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[4-9]* 2>/dev/null` \
+ ${srcdir}/../../tk \
+ `ls -dr ${srcdir}/../../tk[4-9]* 2>/dev/null` \
+ ${srcdir}/../../../tk \
+ `ls -dr ${srcdir}/../../../tk[4-9]* 2>/dev/null ` ; do
+ if test -f $i/generic/tk.h ; then
+ ac_cv_c_tkh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+# finally check in a few common install locations
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tkh}" = x ; then
+ for i in \
+ `ls -dr /usr/local/src/tk[4-9]* 2>/dev/null` \
+ `ls -dr /usr/local/lib/tk[4-9]* 2>/dev/null` \
+ /usr/local/src/tk \
+ /usr/local/lib/tk \
+ ${prefix}/include ; do
+ if test -f $i/generic/tk.h ; then
+ ac_cv_c_tkh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+# see if one is installed
+if test x"${ac_cv_c_tkh}" = x ; then
+ ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for tk.h""... $ac_c" 1>&6
+echo "configure:7649: checking for tk.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7654 "configure"
+#include "confdefs.h"
+#include <tk.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_cv_c_tkh=installed
+else
+ echo "$ac_t""no" 1>&6
+ac_cv_c_tkh=""
+fi
+
+fi
+
+fi
+
+if test x"${ac_cv_c_tkh}" != x ; then
+ no_tk=""
+ if test x"${ac_cv_c_tkh}" = x"installed" ; then
+ echo "$ac_t""is installed" 1>&6
+ TKHDIR=""
+ else
+ echo "$ac_t""found in ${ac_cv_c_tkh}" 1>&6
+ # this hack is cause the TKHDIR won't print if there is a "-I" in it.
+ TKHDIR="-I${ac_cv_c_tkh}"
+ fi
+else
+ TKHDIR="# no Tk directory found"
+ echo "configure: warning: Can't find Tk private headers" 1>&2
+ no_tk=true
+fi
+
+
+
+
+echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
+echo "configure:7705: checking for Itcl private headers. srcdir=${srcdir}" >&5
+if test x"${ac_cv_c_itclh}" = x ; then
+ for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
+ if test -f $i/generic/itcl.h ; then
+ ac_cv_c_itclh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+if test x"${ac_cv_c_itclh}" = x ; then
+ ITCLHDIR="# no Itcl private headers found"
+ { echo "configure: error: Can't find Itcl private headers" 1>&2; exit 1; }
+fi
+if test x"${ac_cv_c_itclh}" != x ; then
+ ITCLHDIR="-I${ac_cv_c_itclh}"
+fi
+# should always be here
+# ITCLLIB="../itcl/itcl/unix/libitcl.a"
+
+#AC_SUBST(ITCLLIB)
+
+
+echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
+echo "configure:7728: checking for Itk private headers. srcdir=${srcdir}" >&5
+if test x"${ac_cv_c_itkh}" = x ; then
+ for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
+ if test -f $i/generic/itk.h ; then
+ ac_cv_c_itkh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+if test x"${ac_cv_c_itkh}" = x ; then
+ ITKHDIR="# no Itk private headers found"
+ { echo "configure: error: Can't find Itk private headers" 1>&2; exit 1; }
+fi
+if test x"${ac_cv_c_itkh}" != x ; then
+ ITKHDIR="-I${ac_cv_c_itkh}"
+fi
+# should always be here
+# ITKLIB="../itcl/itk/unix/libitk.a"
+
+#AC_SUBST(ITKLIB)
+
+
+echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
+echo "configure:7751: checking for Tix private headers. srcdir=${srcdir}" >&5
+if test x"${ac_cv_c_tixh}" = x ; then
+ for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
+ if test -f $i/generic/tix.h ; then
+ ac_cv_c_tixh=`(cd $i/generic; pwd)`
+ break
+ fi
+ done
+fi
+if test x"${ac_cv_c_tixh}" = x ; then
+ TIXHDIR="# no Tix private headers found"
+ { echo "configure: error: Can't find Tix private headers" 1>&2; exit 1; }
+fi
+if test x"${ac_cv_c_tixh}" != x ; then
+ TIXHDIR="-I${ac_cv_c_tixh}"
+fi
+
+
+
+
+ # now look for Tk library stuff
+
+ case "${host}" in
+ *-*-cygwin*)
+ tkdir=../tk/win/
+ ;;
+ *)
+ tkdir=../tk/unix/
+ ;;
+ esac
+
+ TK_DEPS="${tkdir}${TK_LIB_FILE}"
+
+ # now look for Itcl library stuff
+
+
+#
+# Ok, lets find the itcl configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-itclconfig
+#
+
+if test x"${no_itcl}" = x ; then
+ # we reset no_itcl in case something fails here
+ no_itcl=true
+ # Check whether --with-itclconfig or --without-itclconfig was given.
+if test "${with_itclconfig+set}" = set; then
+ withval="$with_itclconfig"
+ with_itclconfig=${withval}
+fi
+
+ echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
+echo "configure:7803: checking for Itcl configuration" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ # First check to see if --with-itclconfig was specified.
+ if test x"${with_itclconfig}" != x ; then
+ if test -f "${with_itclconfig}/itclConfig.sh" ; then
+ ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
+ else
+ { echo "configure: error: ${with_itclconfig} directory doesn't contain itclConfig.sh" 1>&2; exit 1; }
+ fi
+ fi
+
+ # then check for a private Itcl library
+ if test x"${ac_cv_c_itclconfig}" = x ; then
+ for i in \
+ ../itcl/itcl \
+ `ls -dr ../itcl[4-9]*/itcl 2>/dev/null` \
+ ../../itcl \
+ `ls -dr ../../itcl[4-9]*/itcl 2>/dev/null` \
+ ../../../itcl \
+ `ls -dr ../../../itcl[4-9]*/itcl 2>/dev/null` ; do
+ if test -f "$i/itclConfig.sh" ; then
+ ac_cv_c_itclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_itclconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/itclConfig.sh" ; then
+ ac_cv_c_itclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_itclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../itcl/itcl \
+ `ls -dr ${srcdir}/../itcl[4-9]*/itcl 2>/dev/null` ; do
+ if test -f "$i/itclConfig.sh" ; then
+ ac_cv_c_itclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_itclconfig}" = x ; then
+ ITCLCONFIG="# no Itcl configs found"
+ echo "configure: warning: Can't find Itcl configuration definitions" 1>&2
+ else
+ no_itcl=
+ ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
+ echo "$ac_t""found $ITCLCONFIG" 1>&6
+ fi
+fi
+
+ if test -z "${no_itcl}"; then
+
+ if test -f "$ITCLCONFIG" ; then
+ . $ITCLCONFIG
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
+ ITCL_DEPS="${ITCL_LIB_FULL_PATH}"
+ fi
+
+
+ # now look for Itk library stuff
+
+#
+# Ok, lets find the itk configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-itkconfig
+#
+
+if test x"${no_itk}" = x ; then
+ # we reset no_itk in case something fails here
+ no_itk=true
+ # Check whether --with-itkconfig or --without-itkconfig was given.
+if test "${with_itkconfig+set}" = set; then
+ withval="$with_itkconfig"
+ with_itkconfig=${withval}
+fi
+
+ echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
+echo "configure:7906: checking for Itk configuration" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ # First check to see if --with-itkconfig was specified.
+ if test x"${with_itkconfig}" != x ; then
+ if test -f "${with_itkconfig}/itkConfig.sh" ; then
+ ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)`
+ else
+ { echo "configure: error: ${with_itkconfig} directory doesn't contain itkConfig.sh" 1>&2; exit 1; }
+ fi
+ fi
+
+ # then check for a private Itk library
+ if test x"${ac_cv_c_itkconfig}" = x ; then
+ for i in \
+ ../itcl/itk \
+ `ls -dr ../itcl[4-9]*/itk 2>/dev/null` \
+ ../../itk \
+ `ls -dr ../../itcl[4-9]*/itk 2>/dev/null` \
+ ../../../itk \
+ `ls -dr ../../../itcl[4-9]*/itk 2>/dev/null` ; do
+ if test -f "$i/itkConfig.sh" ; then
+ ac_cv_c_itkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_itkconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/itkConfig.sh" ; then
+ ac_cv_c_itkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_itkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../itcl/itk \
+ `ls -dr ${srcdir}/../itcl[4-9]*/itk 2>/dev/null` ; do
+ if test -f "$i/itkConfig.sh" ; then
+ ac_cv_c_itkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_itkconfig}" = x ; then
+ ITKCONFIG="# no Itk configs found"
+ echo "configure: warning: Can't find Itk configuration definitions" 1>&2
+ else
+ no_itk=
+ ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
+ echo "$ac_t""found $ITKCONFIG" 1>&6
+ fi
+fi
+
+
+ if test -z "${no_itcl}"; then
+
+ if test -f "$ITKCONFIG" ; then
+ . $ITKCONFIG
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ ITKLIB="${ITK_BUILD_LIB_SPEC}"
+ ITK_DEPS="${ITK_LIB_FULL_PATH}"
+ fi
+
+ # now look for Tix library stuff
+
+#
+# Ok, lets find the tix configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-itkconfig
+#
+
+if test x"${no_tix}" = x ; then
+ # we reset no_tix in case something fails here
+ no_tix=true
+ # Check whether --with-tixconfig or --without-tixconfig was given.
+if test "${with_tixconfig+set}" = set; then
+ withval="$with_tixconfig"
+ with_tixconfig=${withval}
+fi
+
+ echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6
+echo "configure:8009: checking for Tix configuration" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ # First check to see if --with-tixconfig was specified.
+ if test x"${with_tixconfig}" != x ; then
+ if test -f "${with_tixconfig}/tixConfig.sh" ; then
+ ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)`
+ else
+ { echo "configure: error: ${with_tixconfig} directory doesn't contain tixConfig.sh" 1>&2; exit 1; }
+ fi
+ fi
+
+ # then check for a private Tix library
+ if test x"${ac_cv_c_tixconfig}" = x ; then
+ for i in \
+ ../tix \
+ `ls -dr ../tix 2>/dev/null` \
+ ../../tix \
+ `ls -dr ../../tix 2>/dev/null` \
+ ../../../tix \
+ `ls -dr ../../../tix 2>/dev/null` ; do
+ echo "**** Looking at $i - with ${configdir}"
+ if test -f "$i/tixConfig.sh" ; then
+ ac_cv_c_tixconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_tixconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ echo "**** Looking at $i"
+ if test -f "$i/tixConfig.sh" ; then
+ ac_cv_c_tixconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ echo "**** Other private locations"
+ if test x"${ac_cv_c_tixconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tix \
+ `ls -dr ${srcdir}/../tix 2>/dev/null` ; do
+ echo "**** Looking at $i - with ${configdir}"
+ if test -f "$i/${configdir}/tixConfig.sh" ; then
+ ac_cv_c_tixconfig=`(cd $i/${configdir}; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_tixconfig}" = x ; then
+ TIXCONFIG="# no Tix configs found"
+ echo "configure: warning: Can't find Tix configuration definitions" 1>&2
+ else
+ no_tix=
+ TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
+ echo "$ac_t""found $TIXCONFIG" 1>&6
+ fi
+fi
+
+
+ if test -z "${no_tix}"; then
+
+ if test -f "$TIXCONFIG" ; then
+ . $TIXCONFIG
+ fi
+
+
+
+
+
+
+
+
+ TIXLIB="${TIX_BUILD_LIB_SPEC}"
+ TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
+ fi
+
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
+ # Tcl/Tk 8.1 require -fwritable strings. I don't
+ # know whether 8.2 will or not, but I bet it will.
+ # I don't have to worry about 7.x since we don't support it.
+ GDBTK_CFLAGS=""
+ if test "$GCC" = "yes"; then
+ if test "$TCL_VERSION" != "8.0" ; then
+ GDBTK_CFLAGS="-fwritable-strings"
+ fi
+ fi
+
+ # Include some libraries that Tcl and Tk want.
+ TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
+ # Yes, the ordering seems wrong here. But it isn't.
+ # TK_LIBS is the list of libraries that need to be linked
+ # after Tcl/Tk. Note that this isn't put into LIBS. If it
+ # were in LIBS then any link tests after this point would
+ # try to include things like `$(LIBGUI)', which wouldn't work.
+ GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
+
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_GDBTK_INITS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_GDBTK_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
+
+ if test x$gdb_cv_os_cygwin = xyes; then
+ WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
+ WIN32LDAPP="-Wl,--subsystem,console"
+ CONFIG_OBS="${CONFIG_OBS} gdbres.o"
+ fi
+ fi
+ fi
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -5223,7 +8148,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:5227: checking for X" >&5
+echo "configure:8152: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -5285,12 +8210,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 5289 "configure"
+#line 8214 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5359,14 +8284,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5363 "configure"
+#line 8288 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -5453,6 +8378,53 @@ else
fi
+
+# Unlike the sim directory, whether a simulator is linked is controlled by
+# presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
+# This code just checks for a few cases where we'd like to ignore those
+# definitions, even when they're present in the '.mt' file. These cases
+# are when --disable-sim is specified, or if the simulator directory is
+# not part of the source tree.
+#
+# Check whether --enable-sim or --disable-sim was given.
+if test "${enable_sim+set}" = set; then
+ enableval="$enable_sim"
+ echo "enable_sim = $enable_sim";
+ echo "enableval = ${enableval}";
+ case "${enableval}" in
+ yes) ignore_sim=false ;;
+ no) ignore_sim=true ;;
+ *) ignore_sim=false ;;
+ esac
+else
+ ignore_sim=false
+fi
+
+
+if test ! -d "${srcdir}/../sim"; then
+ ignore_sim=true
+fi
+
+if test "${ignore_sim}" = "true"; then
+ IGNORE_SIM="SIM="
+ IGNORE_SIM_OBS="SIM_OBS="
+else
+ IGNORE_SIM=""
+ IGNORE_SIM_OBS=""
+ cat >> confdefs.h <<\EOF
+#define WITH_SIM 1
+EOF
+
+fi
+
+
+
+
+
+
+
+
+
@@ -5483,7 +8455,7 @@ if test "${shared}" = "true"; then
;;
*-*-linux*aout*)
;;
- *-*-linux* | *-pc-linux-gnu)
+ *-*-linux* | *-pc-linux-gnu*)
HLDFLAGS='-Wl,-rpath,$(libdir)'
;;
*-*-solaris*)
@@ -5532,7 +8504,14 @@ fi
frags=
host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
if test ! -f ${host_makefile_frag}; then
-{ echo "configure: error: "*** Gdb does not support host ${host}"" 1>&2; exit 1; }
+ # When building a native debuger the .mh file containing things
+ # like NATDEPFILES is needed. Cross debuggers don't need .mh
+ # since it no longer contains anything useful.
+ if test "${target}" = "${host}"; then
+ { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; }
+ else
+ host_makefile_frag=/dev/null
+ fi
fi
frags="$frags $host_makefile_frag"
@@ -5554,56 +8533,149 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
-# these really aren't orthogonal true/false values of the same condition,
-# but shells are slow enough that I like to reuse the test conditions
-# whenever possible
+GDB_MULTI_ARCH=`sed -n '
+s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
+' ${target_makefile_frag}`
+
if test "${target}" = "${host}"; then
+# We pick this up from the host configuration file (.mh) because we
+# do not have a native configuration Makefile fragment.
nativefile=`sed -n '
s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${host_makefile_frag}`
-# else
-# GDBserver is only useful in a "native" enviroment
-# configdirs=`echo $configdirs | sed 's/gdbserver//'`
fi
+# New targets should just set gdb_multi_arch=yes in configure.tgt.
+# Old targets being converted can either do that or set GDB_MULTI_ARCH
+# in the target specific makefile frag. Eventually gdb_multi_arch=yes
+# will be the default.
+if test x"${GDB_MULTI_ARCH}" = x ; then
+ case "${gdb_multi_arch}" in
+ yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
+ no ) GDB_MULTI_ARCH=0 ;;
+ 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
+ esac
+fi
+if test x"${GDB_MULTI_ARCH}" != x ; then
+ cat >> confdefs.h <<EOF
+#define GDB_MULTI_ARCH ${GDB_MULTI_ARCH}
+EOF
+
+fi
+# Warn the user when they use an old practice
+case "${GDB_MULTI_ARCH}" in
+ "" ) ;;
+ 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
+ echo "configure: warning: "GDB: Target is not pure multi-arch"" 1>&2 ;;
+ GDB_MULTI_ARCH_PURE )
+ if test x"${targetfile}" != x ; then
+ echo "configure: warning: "GDB: Ignoring TM_FILE in ${target_makefile_frag}"" 1>&2
+ targetfile=""
+ fi ;;
+ *) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };;
+esac
+
+SUBDIRS="doc testsuite nlm"
+if test "${enable_multi_ice}" = "yes"; then
+ SUBDIRS="${SUBDIRS} multi-ice"
+fi
+
+# ``gdbserver'' can only be built in a native configuration.
+if test x"${target}" = x"${host}"; then
+ echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
+echo "configure:8588: checking whether gdbserver is supported on this host" >&5
+ if test x"${build_gdbserver}" = xyes ; then
+ configdirs="${configdirs} gdbserver"
+ SUBDIRS="${SUBDIRS} gdbserver"
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+fi
+
+
+
# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
-# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
-# corresponding links. But we have to remove the xm.h files and tm.h
-# files anyway, e.g. when switching from "configure host" to
-# "configure none".
+# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
+# version.
files=
links=
+
rm -f xm.h
+xm_h=""
if test "${hostfile}" != ""; then
-files="${files} config/${gdb_host_cpu}/${hostfile}"
-links="${links} xm.h"
+ xm_h=xm.h
+ GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}"
+ files="${files} ${GDB_XM_FILE}"
+ links="${links} xm.h"
+ cat >> confdefs.h <<EOF
+#define GDB_XM_FILE ${GDB_XM_FILE}
+EOF
+
fi
+
+
rm -f tm.h
+tm_h=""
if test "${targetfile}" != ""; then
-files="${files} config/${gdb_target_cpu}/${targetfile}"
-links="${links} tm.h"
+ tm_h=tm.h
+ GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}"
+ files="${files} ${GDB_TM_FILE}"
+ links="${links} tm.h"
+ cat >> confdefs.h <<EOF
+#define GDB_TM_FILE ${GDB_TM_FILE}
+EOF
+
fi
+
+
rm -f nm.h
+nm_h=""
if test "${nativefile}" != ""; then
-files="${files} config/${gdb_host_cpu}/${nativefile}"
-links="${links} nm.h"
+ nm_h=nm.h
+ GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}"
+ files="${files} ${GDB_NM_FILE}"
+ links="${links} nm.h"
+ cat >> confdefs.h <<EOF
+#define GDB_NM_FILE ${GDB_NM_FILE}
+EOF
+
+fi
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:8650: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
-# A cross-only configuration.
-files="${files} config/nm-empty.h"
-links="${links} nm.h"
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:5602: checking for Cygwin environment" >&5
+echo "configure:8674: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5607 "configure"
+#line 8679 "configure"
#include "confdefs.h"
int main() {
@@ -5614,7 +8686,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:5618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -5631,19 +8703,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:5635: checking for mingw32 environment" >&5
+echo "configure:8707: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5640 "configure"
+#line 8712 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:5647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -5662,7 +8734,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:5666: checking for executable suffix" >&5
+echo "configure:8738: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5672,7 +8744,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:5676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:8748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -5796,7 +8868,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile tui/Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -5828,6 +8900,9 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@host@%$host%g
@@ -5868,22 +8943,95 @@ s%@GT_NO@%$GT_NO%g
s%@GT_YES@%$GT_YES%g
s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
s%@l@%$l%g
+s%@AWK@%$AWK%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@AR@%$AR%g
+s%@DLLTOOL@%$DLLTOOL%g
+s%@WINDRES@%$WINDRES%g
s%@YACC@%$YACC%g
+s%@MIG@%$MIG%g
s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g
-s%@BUILD_TUI@%$BUILD_TUI%g
-s%@TUI_LIBRARY@%$TUI_LIBRARY%g
+s%@UIOUT_CFLAGS@%$UIOUT_CFLAGS%g
s%@WARN_CFLAGS@%$WARN_CFLAGS%g
+s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g
s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g
s%@MMALLOC@%$MMALLOC%g
+s%@REGEX@%$REGEX%g
+s%@SER_HARDWIRE@%$SER_HARDWIRE%g
s%@TERM_LIB@%$TERM_LIB%g
+s%@WIN32LIBS@%$WIN32LIBS%g
+s%@LIBGUI@%$LIBGUI%g
+s%@GUI_CFLAGS_X@%$GUI_CFLAGS_X%g
+s%@WIN32LDAPP@%$WIN32LDAPP%g
+s%@TCL_VERSION@%$TCL_VERSION%g
+s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
+s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g
+s%@TCL_CC@%$TCL_CC%g
+s%@TCL_DEFS@%$TCL_DEFS%g
+s%@TCL_SHLIB_CFLAGS@%$TCL_SHLIB_CFLAGS%g
+s%@TCL_SHLIB_LD@%$TCL_SHLIB_LD%g
+s%@TCL_SHLIB_LD_LIBS@%$TCL_SHLIB_LD_LIBS%g
+s%@TCL_SHLIB_SUFFIX@%$TCL_SHLIB_SUFFIX%g
+s%@TCL_DL_LIBS@%$TCL_DL_LIBS%g
+s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g
+s%@TCL_LD_SEARCH_FLAGS@%$TCL_LD_SEARCH_FLAGS%g
+s%@TCL_COMPAT_OBJS@%$TCL_COMPAT_OBJS%g
+s%@TCL_RANLIB@%$TCL_RANLIB%g
+s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
+s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
+s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g
+s%@TK_VERSION@%$TK_VERSION%g
+s%@TK_DEFS@%$TK_DEFS%g
+s%@TK_BUILD_INCLUDES@%$TK_BUILD_INCLUDES%g
+s%@TK_XINCLUDES@%$TK_XINCLUDES%g
+s%@TK_XLIBSW@%$TK_XLIBSW%g
+s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
+s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
+s%@TCLHDIR@%$TCLHDIR%g
+s%@TKHDIR@%$TKHDIR%g
+s%@ITCLHDIR@%$ITCLHDIR%g
+s%@ITKHDIR@%$ITKHDIR%g
+s%@TIXHDIR@%$TIXHDIR%g
+s%@ITCL_VERSION@%$ITCL_VERSION%g
+s%@ITCL_DEFS@%$ITCL_DEFS%g
+s%@ITCL_BUILD_INCLUDES@%$ITCL_BUILD_INCLUDES%g
+s%@ITCL_BUILD_LIB_SPEC@%$ITCL_BUILD_LIB_SPEC%g
+s%@ITCL_LIB_SPEC@%$ITCL_LIB_SPEC%g
+s%@ITK_VERSION@%$ITK_VERSION%g
+s%@ITK_DEFS@%$ITK_DEFS%g
+s%@ITK_BUILD_INCLUDES@%$ITK_BUILD_INCLUDES%g
+s%@ITK_BUILD_LIB_SPEC@%$ITK_BUILD_LIB_SPEC%g
+s%@ITK_LIB_SPEC@%$ITK_LIB_SPEC%g
+s%@TIX_VERSION@%$TIX_VERSION%g
+s%@TIX_BUILD_LIB_SPEC@%$TIX_BUILD_LIB_SPEC%g
+s%@X_CFLAGS@%$X_CFLAGS%g
+s%@X_LDFLAGS@%$X_LDFLAGS%g
+s%@X_LIBS@%$X_LIBS%g
+s%@TCL_DEPS@%$TCL_DEPS%g
+s%@TK_DEPS@%$TK_DEPS%g
+s%@ITCLLIB@%$ITCLLIB%g
+s%@ITCL_DEPS@%$ITCL_DEPS%g
+s%@ITKLIB@%$ITKLIB%g
+s%@ITK_DEPS@%$ITK_DEPS%g
+s%@TIXLIB@%$TIXLIB%g
+s%@TIX_DEPS@%$TIX_DEPS%g
+s%@GDBTKLIBS@%$GDBTKLIBS%g
+s%@GDBTK_CFLAGS@%$GDBTK_CFLAGS%g
+s%@GDBTK_SRC_DIR@%$GDBTK_SRC_DIR%g
+s%@IGNORE_SIM@%$IGNORE_SIM%g
+s%@IGNORE_SIM_OBS@%$IGNORE_SIM_OBS%g
s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g
s%@CONFIG_OBS@%$CONFIG_OBS%g
+s%@CONFIG_LIB_OBS@%$CONFIG_LIB_OBS%g
s%@CONFIG_DEPS@%$CONFIG_DEPS%g
s%@CONFIG_SRCS@%$CONFIG_SRCS%g
+s%@CONFIG_INITS@%$CONFIG_INITS%g
+s%@CONFIG_ALL@%$CONFIG_ALL%g
+s%@CONFIG_CLEAN@%$CONFIG_CLEAN%g
+s%@CONFIG_INSTALL@%$CONFIG_INSTALL%g
+s%@CONFIG_UNINSTALL@%$CONFIG_UNINSTALL%g
s%@HLDFLAGS@%$HLDFLAGS%g
s%@HLDENV@%$HLDENV%g
s%@target_subdir@%$target_subdir%g
@@ -5892,6 +9040,11 @@ s%@host_makefile_frag@%%g
/@target_makefile_frag@/r $target_makefile_frag
s%@target_makefile_frag@%%g
s%@frags@%$frags%g
+s%@SUBDIRS@%$SUBDIRS%g
+s%@xm_h@%$xm_h%g
+s%@tm_h@%$tm_h%g
+s%@nm_h@%$nm_h%g
+s%@LN_S@%$LN_S%g
s%@EXEEXT@%$EXEEXT%g
s%@subdirs@%$subdirs%g
@@ -5935,7 +9088,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile tui/Makefile .gdbinit:gdbinit.in"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile .gdbinit:gdbinit.in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -6157,8 +9310,10 @@ EOF
cat >> $CONFIG_STATUS <<\EOF
if test "${nativefile}" = ""; then
-sed -e '/^NATDEPFILES[ ]*=[ ]*/s//# NATDEPFILES=/' \
- < Makefile > Makefile.tem
+ < Makefile \
+ sed -e '/^NATDEPFILES[ ]*=[ ]*/s//# NATDEPFILES=/' \
+ | sed -e '/^\(NATDEPFILES[ ]*[+]=[ ]*\)/s//# \1/' \
+ > Makefile.tem
mv -f Makefile.tem Makefile
fi
@@ -6167,6 +9322,7 @@ sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
mv -f Makefile.tmp Makefile
+
case x$CONFIG_HEADERS in
xconfig.h:config.in)
echo > stamp-h ;;
diff --git a/contrib/gdb/gdb/configure.host b/contrib/gdb/gdb/configure.host
index aca63e6..4c69fff 100644
--- a/contrib/gdb/gdb/configure.host
+++ b/contrib/gdb/gdb/configure.host
@@ -11,15 +11,16 @@
case "${host_cpu}" in
alpha*) gdb_host_cpu=alpha ;;
-c[12]) gdb_host_cpu=convex ;;
+arm*) gdb_host_cpu=arm ;;
hppa*) gdb_host_cpu=pa ;;
i[3456]86*) gdb_host_cpu=i386 ;;
m68*) gdb_host_cpu=m68k ;;
m88*) gdb_host_cpu=m88k ;;
-# OBSOLETE np1) gdb_host_cpu=gould ;;
-pyramid) gdb_host_cpu=pyr ;;
+mips*) gdb_host_cpu=mips ;;
powerpc*) gdb_host_cpu=powerpc ;;
-sparc64) gdb_host_cpu=sparc ;;
+sparcv9 | sparc64) gdb_host_cpu=sparc ;;
+s390*) gdb_host_cpu=s390 ;;
+x86_64*) gdb_host_cpu=i386 ;;
*) gdb_host_cpu=$host_cpu ;;
esac
@@ -28,21 +29,21 @@ esac
case "${host}" in
-a29k-*-*) gdb_host=ultra3 ;;
-
alpha*-*-osf1*) gdb_host=alpha-osf1 ;;
alpha*-*-osf2*) gdb_host=alpha-osf2 ;;
alpha*-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
alpha*-*-linux*) gdb_host=alpha-linux ;;
+alpha*-*-freebsd*) gdb_host=fbsd ;;
-arm-*-*) gdb_host=arm ;;
-
-c[12]-*-*) gdb_host=convex ;;
+arm*-*-linux*) gdb_host=linux ;;
+arm*-*-netbsd*) gdb_host=nbsd ;;
+arm*-*-*) gdb_host=arm ;;
hppa*-*-bsd*) gdb_host=hppabsd ;;
hppa*-*-hiux*) gdb_host=hppahpux ;;
hppa*-*-hpux10.20) gdb_host=hpux1020 ;;
-hppa*-*-hpux11.0*) gdb_host=hpux1100 ;;
+hppa*64*-*-hpux11*) gdb_host=hpux11w ;;
+hppa*-*-hpux11*) gdb_host=hpux11 ;;
hppa*-*-hpux*) gdb_host=hppahpux ;;
hppa*-*-osf*) gdb_host=hppaosf ;;
@@ -54,19 +55,22 @@ i[3456]86-*-aix*) gdb_host=i386aix ;;
i[3456]86-*-bsd*) gdb_host=i386bsd ;;
i[3456]86-*-dgux*) gdb_host=i386dgux ;;
i[3456]86-*-freebsd*) gdb_host=fbsd ;;
+i[3456]86-*-netbsdelf*) gdb_host=nbsdelf ;;
+i[3456]86-*-netbsdaout*) gdb_host=nbsd ;;
i[3456]86-*-netbsd*) gdb_host=nbsd ;;
i[3456]86-*-go32*) gdb_host=go32 ;;
+i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;;
i[3456]86-*-linux*) gdb_host=linux ;;
i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
i[3456]86-*-mach3*) gdb_host=i386m3 ;;
i[3456]86-*-mach*) gdb_host=i386mach ;;
i[3456]86-*-gnu*) gdb_host=i386gnu ;;
+i[3456]86-*-openbsd*) gdb_host=obsd ;;
i[3456]86-*-osf1mk*) gdb_host=i386mk ;;
i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
i[3456]86-*-sco*) gdb_host=i386sco ;;
i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
-i[3456]86-*-sunos*) gdb_host=sun386 ;;
i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
i[3456]86-*-sysv4.2*) gdb_host=i386v42mp ;;
@@ -77,42 +81,41 @@ i[3456]86-*-unixware*) gdb_host=i386v4 ;;
i[3456]86-*-sysv*) gdb_host=i386v ;;
i[3456]86-*-isc*) gdb_host=i386v32 ;;
i[3456]86-*-cygwin*) gdb_host=cygwin ;;
+
+ia64-*-aix*) gdb_host=aix ;;
+ia64-*-linux*) gdb_host=linux ;;
+
m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
-m68030-sony-*) gdb_host=news1000 ;;
-m68*-altos-*) gdb_host=altos ;;
m68*-apollo*-sysv*) gdb_host=apollo68v ;;
m68*-apollo*-bsd*) gdb_host=apollo68b ;;
m68*-att-*) gdb_host=3b1 ;;
m68*-bull*-sysv*) gdb_host=dpx2 ;;
m68*-hp-bsd*) gdb_host=hp300bsd ;;
m68*-hp-hpux*) gdb_host=hp300hpux ;;
-m68*-isi-*) gdb_host=isi ;;
m68*-*-linux*) gdb_host=linux ;;
m68*-*-lynxos*) gdb_host=m68klynx ;;
m68*-*-netbsd*) gdb_host=nbsd ;;
m68*-*-sysv4*) gdb_host=m68kv4 ;;
m68*-motorola-*) gdb_host=delta68 ;;
-m68*-sony-*) gdb_host=news ;;
m68*-sun-sunos3*) gdb_host=sun3os3 ;;
m68*-sun-sunos4*) gdb_host=sun3os4 ;;
m68*-sun-*) gdb_host=sun3os4 ;;
-m88*-harris-cxux*) gdb_host=cxux ;;
m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
m88*-motorola-sysv*) gdb_host=delta88 ;;
m88*-*-*) gdb_host=m88k ;;
-mips-dec-mach3*) gdb_host=mach3 ;;
+mips-dec-mach3*) gdb_host=mipsm3 ;;
mips-dec-*) gdb_host=decstation ;;
mips-little-*) gdb_host=littlemips ;;
mips-sgi-irix3*) gdb_host=irix3 ;;
mips-sgi-irix4*) gdb_host=irix4 ;;
mips-sgi-irix5*) gdb_host=irix5 ;;
-# Close enough for now.
-mips-sgi-irix6*) gdb_host=irix5 ;;
+mips-sgi-irix6*) gdb_host=irix6 ;;
mips-sony-*) gdb_host=news-mips ;;
+mips*-*-linux*) gdb_host=linux ;;
mips-*-mach3*) gdb_host=mipsm3 ;;
mips-*-sysv4*) gdb_host=mipsv4 ;;
mips-*-sysv*) gdb_host=riscos ;;
@@ -120,43 +123,39 @@ mips-*-riscos*) gdb_host=riscos ;;
none-*-*) gdb_host=none ;;
-# OBSOLETE np1-*-*) gdb_host=np1 ;;
-
-ns32k-*-mach3*) gdb_host=ns32km3 ;;
ns32k-*-netbsd*) gdb_host=nbsd ;;
-ns32k-umax-*) gdb_host=umax ;;
-ns32k-utek-sysv*) gdb_host=merlin ;;
powerpc-*-aix*) gdb_host=aix ;;
-powerpcle-*-cygwin*) gdb_host=cygwin ;;
-powerpcle-*-solaris*) gdb_host=solaris ;;
powerpc-*-linux*) gdb_host=linux ;;
-
-# OBSOLETE pn-*-*) gdb_host=pn ;;
-
-pyramid-*-*) gdb_host=pyramid ;;
-
-romp-*-*) gdb_host=rtbsd ;;
+powerpc-*-netbsd*) gdb_host=nbsd ;;
rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
rs6000-*-aix4*) gdb_host=aix4 ;;
rs6000-*-*) gdb_host=rs6000 ;;
+s390*-*-*) gdb_host=s390 ;;
+
sparc-*-linux*) gdb_host=linux ;;
sparc-*-lynxos*) gdb_host=sparclynx ;;
+sparc-*-netbsdelf*) gdb_host=nbsdelf ;;
+sparc-*-netbsdaout*) gdb_host=nbsd ;;
sparc-*-netbsd*) gdb_host=nbsd ;;
sparc-*-solaris2*) gdb_host=sun4sol2 ;;
sparc-*-sunos4*) gdb_host=sun4os4 ;;
sparc-*-sunos5*) gdb_host=sun4sol2 ;;
sparc-*-*) gdb_host=sun4os4 ;;
-sparc64-*-*) gdb_host=sun4sol2 ;;
+sparc64-*-freebsd*|ultrasparc-*-freebsd*|sparcv9-*-freebsd*)
+ gdb_host=fbsd ;;
+sparc64-*-linux*) gdb_host=linux ;;
+sparcv9-*-* | sparc64-*-*) gdb_host=sun4sol2 ;;
strongarm-*-*) gdb_host=arm ;;
-
-tahoe-*-*) gdb_host=tahoe ;;
+xscale-*-*) gdb_host=arm ;;
vax-*-bsd*) gdb_host=vaxbsd ;;
vax-*-ultrix2*) gdb_host=vaxult2 ;;
vax-*-ultrix*) gdb_host=vaxult ;;
+x86_64-*-linux*) gdb_host=x86-64linux ;;
+
esac
diff --git a/contrib/gdb/gdb/configure.in b/contrib/gdb/gdb/configure.in
index d658118..9ca988f 100644
--- a/contrib/gdb/gdb/configure.in
+++ b/contrib/gdb/gdb/configure.in
@@ -1,5 +1,6 @@
dnl Autoconf configure script for GDB, the GNU debugger.
-dnl Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GDB.
dnl
@@ -22,6 +23,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)dnl
AC_INIT(main.c)
AC_CONFIG_HEADER(config.h:config.in)
+AM_MAINTAINER_MODE
AC_PROG_CC
AC_AIX
@@ -39,11 +41,31 @@ CY_GNU_GETTEXT
dnl List of object files added by configure.
CONFIG_OBS=
+CONFIG_LIB_OBS=
CONFIG_DEPS=
CONFIG_SRCS=
+CONFIG_INITS=
+ENABLE_CFLAGS=
+CONFIG_ALL=
+CONFIG_CLEAN=
+CONFIG_INSTALL=
+CONFIG_UNINSTALL=
configdirs="doc testsuite"
+AC_ARG_ENABLE(multi-ice,
+[ --enable-multi-ice Build the multi-ice-gdb-server],
+[case "${enableval}" in
+ yes ) enable_multi_ice="yes" ;;
+ no) enable_multi_ice="no" ;;
+ *) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
+ esac
+])
+
+if test "${enable_multi_ice}" = "yes"; then
+ configdirs="${configdirs} multi-ice"
+fi
+
dnl
changequote(,)dnl
@@ -51,37 +73,175 @@ changequote(,)dnl
. ${srcdir}/configure.tgt
+targ=${target} ; . ${srcdir}/../bfd/config.bfd
+
dnl
changequote([,])dnl
+dnl use BFD to determine the default architecture and byte order
+dnl (bfd_vec->byteorder provides the latter).
+targ=${target}
+. ${srcdir}/../bfd/config.bfd
+
+dnl We only want the first arch, if there is more than one.
+targ_archs=`echo ${targ_archs} | sed -e 's/ .*//;'`
+
+if test x"${targ_archs}" != x ; then
+ AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, ${targ_archs})
+fi
+if test x"${targ_defvec}" != x ; then
+ AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, ${targ_defvec})
+fi
+
+AC_PROG_AWK
AC_PROG_INSTALL
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(DLLTOOL, dlltool)
+AC_CHECK_TOOL(WINDRES, windres)
AC_PROG_YACC
+dnl MiG is needed for the Hurd.
+AC_CHECK_TOOL(MIG, mig)
+
AC_ARG_PROGRAM
AC_TYPE_SIGNAL
AC_HEADER_STDC
-AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h \
+dnl Solaris 7 needs _MSE_INT_H defined to avoid a clash between <widec.h>
+dnl and <wchar.h> that causes AC_CHECK_HEADERS to think <curses.h> doesn't
+dnl exist.
+
+case $host_os in solaris2.7 | solaris2.8) case "$GCC" in yes)
+ AC_DEFINE(_MSE_INT_H)
+esac; esac
+
+AC_CHECK_HEADERS(ctype.h nlist.h link.h thread_db.h proc_service.h \
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
- string.h sys/procfs.h sys/ptrace.h sys/reg.h \
+ string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
- wchar.h wctype.h asm/debugreg.h sys/debugreg.h)
+ wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
+ time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
+ dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
+ curses.h ncurses.h \
+ poll.h sys/poll.h)
AC_HEADER_STAT
AC_C_CONST
-AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
+AC_CHECK_FUNCS(bcopy btowc bzero canonicalize_file_name isascii poll \
+ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask )
AC_FUNC_ALLOCA
+AC_FUNC_VFORK
+dnl AC_FUNC_SETPGRP does not work when cross compiling
+dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
+if test "$cross_compiling" = no; then
+ AC_FUNC_SETPGRP
+else
+ AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
+ [AC_TRY_COMPILE([
+#include <unistd.h>
+], [
+ if (setpgrp(1,1) == -1)
+ exit (0);
+ else
+ exit (1);
+], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
+if test $ac_cv_func_setpgrp_void = yes; then
+ AC_DEFINE(SETPGRP_VOID, 1)
+fi
+fi
+
+# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
+# since sigsetjmp might only be defined as a macro.
+AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
+[AC_TRY_COMPILE([
+#include <setjmp.h>
+], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
+gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
+if test $gdb_cv_func_sigsetjmp = yes; then
+ AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
+fi
+
+# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
+# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
+AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs,
+[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;],
+gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)])
+if test $gdb_cv_struct_reg_r_fs = yes; then
+ AC_DEFINE(HAVE_STRUCT_REG_R_FS)
+fi
+AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs,
+[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;],
+gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)])
+if test $gdb_cv_struct_reg_r_gs = yes; then
+ AC_DEFINE(HAVE_STRUCT_REG_R_GS)
+fi
+
+# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
+AC_MSG_CHECKING(for PTRACE_GETREGS)
+AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
+[AC_TRY_COMPILE([#include <sys/ptrace.h>],
+ [PTRACE_GETREGS;],
+ [gdb_cv_have_ptrace_getregs=yes],
+ [gdb_cv_have_ptrace_getregs=no])])
+AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
+if test $gdb_cv_have_ptrace_getregs = yes; then
+ AC_DEFINE(HAVE_PTRACE_GETREGS)
+fi
+
+# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
+AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
+AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
+[AC_TRY_COMPILE([#include <sys/ptrace.h>],
+ [PTRACE_GETFPXREGS;],
+ [gdb_cv_have_ptrace_getfpxregs=yes],
+ [gdb_cv_have_ptrace_getfpxregs=no])])
+AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
+if test $gdb_cv_have_ptrace_getfpxregs = yes; then
+ AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
+fi
+
+# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
+AC_MSG_CHECKING(for PT_GETDBREGS)
+AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ptrace.h>],
+ [PT_GETDBREGS;],
+ [gdb_cv_have_pt_getdbregs=yes],
+ [gdb_cv_have_pt_getdbregs=no])])
+AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
+if test $gdb_cv_have_pt_getdbregs = yes; then
+ AC_DEFINE(HAVE_PT_GETDBREGS)
+fi
+
+# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
+AC_MSG_CHECKING(for PT_GETXMMREGS)
+AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ptrace.h>],
+ [PT_GETXMMREGS;],
+ [gdb_cv_have_pt_getxmmregs=yes],
+ [gdb_cv_have_pt_getxmmregs=no])])
+AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
+if test $gdb_cv_have_pt_getxmmregs = yes; then
+ AC_DEFINE(HAVE_PT_GETXMMREGS)
+fi
+
+
+AC_CHECK_LIB(socket, socketpair)
+AC_CHECK_FUNCS(socketpair)
+
BFD_NEED_DECLARATION(malloc)
BFD_NEED_DECLARATION(realloc)
BFD_NEED_DECLARATION(free)
BFD_NEED_DECLARATION(strerror)
BFD_NEED_DECLARATION(strdup)
+BFD_NEED_DECLARATION(strstr)
+BFD_NEED_DECLARATION(canonicalize_file_name)
# The following save_state_t checkery is only necessary for HPUX
@@ -106,7 +266,7 @@ AC_MSG_RESULT($gdb_cv_hpux_sswide)
# If we are configured native on GNU/Linux, work around problems with
# sys/procfs.h
-# Also detect which type of /proc is in use, such as for Unixware.
+# Also detect which type of /proc is in use, such as for Unixware or Solaris.
if test "${target}" = "${host}"; then
case "${host}" in
@@ -114,21 +274,16 @@ if test "${target}" = "${host}"; then
AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
AC_DEFINE(sys_quotactl)
;;
+ ia64-*-aix*)
+ AC_DEFINE(NEW_PROC_API)
+ ;;
+ *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+ AC_DEFINE(NEW_PROC_API)
+ ;;
+ *-*-solaris2.[[678]])
+ AC_DEFINE(NEW_PROC_API)
+ ;;
esac
- AC_MSG_CHECKING(for directory proc entries)
-# The [gdb_host != sun4sol2] hack is because Solaris does provide the
-# multiple procfs files as of Solaris 2.6, but GDB can't use it right now.
- if test "$ac_cv_header_sys_procfs_h" = yes -a "$gdb_host" != sun4sol2 \
- -a -d /proc/$$ \
- -a -f /proc/$$/ctl \
- -a -f /proc/$$/as \
- -a -f /proc/$$/map \
- -a -f /proc/$$/status; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MULTIPLE_PROC_FDS)
- else
- AC_MSG_RESULT(no)
- fi
fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
@@ -136,6 +291,43 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t)
+
+
+ dnl Check for broken prfpregset_t type
+
+ dnl For Linux/i386, glibc 2.1.3 was released with a bogus
+ dnl prfpregset_t type (it's a typedef for the pointer to a struct
+ dnl instead of the struct itself). We detect this here, and work
+ dnl around it in gdb_proc_service.h.
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ AC_MSG_CHECKING(whether prfpregset_t type is broken)
+ AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
+ [AC_TRY_RUN([#include <sys/procfs.h>
+ int main ()
+ {
+ if (sizeof (prfpregset_t) == sizeof (void *))
+ return 1;
+ return 0;
+ }],
+ gdb_cv_prfpregset_t_broken=no,
+ gdb_cv_prfpregset_t_broken=yes,
+ gdb_cv_prfpregset_t_broken=yes)])
+ AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
+ if test $gdb_cv_prfpregset_t_broken = yes; then
+ AC_DEFINE(PRFPREGSET_T_BROKEN)
+ fi
+ fi
dnl Check for PIOCSET ioctl entry
@@ -155,6 +347,71 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
fi
fi
+dnl For native ports (host == target), check to see what kind of
+dnl legacy link.h support is needed. (See solib-legacy.c.)
+if test ${host} = ${target} ; then
+ dnl Check for struct link_map with l_ members which are indicative
+ dnl of SVR4-like shared libraries
+
+ AC_MSG_CHECKING(for member l_addr in struct link_map)
+ AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members,
+ [AC_TRY_COMPILE([#include <link.h>],
+ [struct link_map lm; (void) lm.l_addr;],
+ gdb_cv_have_struct_link_map_with_l_members=yes,
+ gdb_cv_have_struct_link_map_with_l_members=no)])
+ AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members)
+ if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
+ AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
+ fi
+
+ dnl Check for struct link_map with lm_ members which are indicative
+ dnl of SunOS-like shared libraries
+
+ AC_MSG_CHECKING(for member lm_addr in struct link_map)
+ AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#include <link.h>],
+ [struct link_map lm; (void) lm.lm_addr;],
+ gdb_cv_have_struct_link_map_with_lm_members=yes,
+ gdb_cv_have_struct_link_map_with_lm_members=no)])
+ AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members)
+ if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
+ AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS)
+ fi
+
+ dnl Check for struct so_map with som_ members which are found on
+ dnl some *BSD systems.
+
+ AC_MSG_CHECKING(for member som_addr in struct so_map)
+ AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+#include <link.h>],
+ [struct so_map lm; (void) lm.som_addr;],
+ gdb_cv_have_struct_so_map_with_som_members=yes,
+ gdb_cv_have_struct_so_map_with_som_members=no)])
+ AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members)
+ if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
+ AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS)
+ fi
+
+ dnl Check for struct link_map32 type, which allows a 64-bit Solaris
+ dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries.
+
+ AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
+ AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
+ [AC_TRY_COMPILE([#define _SYSCALL32
+#include <sys/link.h>], [struct link_map32 l;],
+ gdb_cv_have_struct_link_map32=yes,
+ gdb_cv_have_struct_link_map32=no)])
+ AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
+ if test $gdb_cv_have_struct_link_map32 = yes; then
+ AC_DEFINE(HAVE_STRUCT_LINK_MAP32)
+ fi
+fi
+
dnl See if host has libm. This is usually needed by simulators.
AC_CHECK_LIB(m, main)
@@ -255,6 +512,23 @@ AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
AC_FUNC_MMAP
+case ${host_os} in
+aix*)
+ AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
+ SAVE_LDFLAGS=$LDFLAGS
+
+ case $GCC in
+ yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+ *) gdb_cv_bigtoc=-bbigtoc ;;
+ esac
+
+ LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+ AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
+ ])
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
+ ;;
+esac
+
dnl See if thread_db library is around for Solaris thread debugging. Note that
dnl we must explicitly test for version 1 of the library because version 0
dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
@@ -270,7 +544,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
if test "$GCC" = "yes" ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
- CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} hpux-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
else
AC_MSG_RESULT(no (suppressed because you are not using GCC))
@@ -284,7 +558,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
if test -f /usr/lib/libthread_db.so.1 ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_THREAD_DB_LIB)
- CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
AC_CHECK_LIB(dl, dlopen)
if test "$GCC" = "yes" ; then
@@ -323,8 +597,93 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
AC_SUBST(CONFIG_LDFLAGS)
fi
+dnl The CLI cannot be disabled yet, but may be in the future
+
+dnl Handle CLI sub-directory configury.
+AC_ARG_ENABLE(gdbcli,
+[ --enable-gdbcli Enable GDB-CLI interface],
+[
+ case "${enableval}" in
+ yes) enable_gdbcli=yes ;;
+ "") enable_gdbcli=yes ;;
+ no)
+ AC_MSG_ERROR(The CLI cannot be disabled yet)
+ ;;
+ *)
+ AC_MSG_ERROR(Bad value for --enable-gdbcli: ${enableval})
+ ;;
+ esac
+],
+[enable_gdbcli=yes])
+case ${enable_gdbcli} in
+ "yes" )
+ if test -d "${srcdir}/cli" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_CLI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_CLI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_CLI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_CLI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_CLI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_CLI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_CLI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_CLI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_CLI_UNINSTALL)"
+ fi
+ ;;
+esac
+
dnl Handle optional features that can be enabled.
-ENABLE_CFLAGS=
+
+dnl Handle MI sub-directory configury.
+AC_ARG_ENABLE(gdbmi,
+[ --enable-gdbmi Enable GDB-MI interface],
+[
+ case "${enable_gdbmi}" in
+ yes | no) ;;
+ "") enable_gdbmi=yes ;;
+ *)
+ AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval})
+ ;;
+ esac
+],
+[enable_gdbmi=yes])
+case ${enable_gdbmi} in
+ "yes" )
+ if test -d "${srcdir}/mi" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_MI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_MI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_MI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_MI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_MI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_MI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_MI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_MI_UNINSTALL)"
+ fi
+ ;;
+esac
+
+# Configure UI_OUT by default (before 5.2 it can be disabled)
+# It must be configured if gdbmi is configured
+
+UIOUT_CFLAGS=
+AC_SUBST(UIOUT_CFLAGS)
+
+AC_ARG_WITH(uiout,
+[ --with-uiout Use new uiout functions instead of *printf's],
+[case "${withval}" in
+ yes) want_uiout=true ;;
+ no) if test $enable_gdbmi = yes; then
+ AC_MSG_ERROR(uiout is needed for MI and cannot be disabled)
+ else
+ want_uiout=false
+ fi ;;
+ *) AC_MSG_ERROR(bad value ${withval} for GDB with-uiout option) ;;
+esac],
+[want_uiout=true])dnl
+
+if test $want_uiout = true; then
+ UIOUT_CFLAGS="-DUI_OUT=1"
+fi
AC_ARG_ENABLE(tui,
[ --enable-tui Enable full-screen terminal user interface],
@@ -339,17 +698,19 @@ AC_ARG_ENABLE(tui,
])
case ${enable_tui} in
"yes" )
- AC_DEFINE(TUI)
- BUILD_TUI=all-tui
- TUI_LIBRARY=tui/libtui.a
- ;;
- * )
- BUILD_TUI=
- TUI_LIBRARY=
- ;;
+ if test -d "${srcdir}/tui" ; then
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_TUI_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)"
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)"
+ fi
+ ;;
esac
-AC_SUBST(BUILD_TUI)
-AC_SUBST(TUI_LIBRARY)
AC_ARG_ENABLE(netrom,
[ --enable-netrom Enable NetROM support],
@@ -360,14 +721,26 @@ no) enable_netrom=no ;;
esac])
if test "${enable_netrom}" = "yes"; then
- CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} remote-nrom.o"
CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
fi
+
+# NOTE: Don't add -Wall or -Wunused, they both include
+# -Wunused-parameter which reports bogus warnings.
+# NOTE: If you add to this list, remember to update
+# gdb/doc/gdbint.texinfo.
+build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
+# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
+# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
+# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
+# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
+# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
+# -Woverloaded-virtual -Winline -Werror"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
-case "${enableval}" in
+[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
@@ -375,15 +748,45 @@ case "${enableval}" in
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac],[build_warnings=""])dnl
-
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting compiler warning flags = $build_warnings" 6>&1
+fi])dnl
+AC_ARG_ENABLE(gdb-build-warnings,
+[ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used],
+[case "${enableval}" in
+ yes) ;;
+ no) build_warnings="-w";;
+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${build_warnings} ${t}";;
+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${t} ${build_warnings}";;
+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+fi])dnl
+WARN_CFLAGS=""
+WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
- WARN_CFLAGS="${build_warnings}"
-else
- WARN_CFLAGS=""
+ AC_MSG_CHECKING(compiler warning flags)
+ # Separate out the -Werror flag as some files just cannot be
+ # compiled with it enabled.
+ for w in ${build_warnings}; do
+ case $w in
+ -Werr*) WERROR_CFLAGS=-Werror ;;
+ *) # Check that GCC accepts it
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $w"
+ AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
+ CFLAGS="$saved_CFLAGS"
+ esac
+ done
+ AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
fi
AC_SUBST(WARN_CFLAGS)
+AC_SUBST(WERROR_CFLAGS)
MMALLOC_CFLAGS=
MMALLOC=
@@ -405,7 +808,59 @@ if test x$want_mmalloc = xtrue; then
MMALLOC='../mmalloc/libmmalloc.a'
fi
+AC_ARG_WITH(included-regex,
+[ --with-included-regex Use included regex],
+[case "${withval}" in
+ yes) want_included_regex=true ;;
+ no) want_included_regex=false;;
+ *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;;
+esac],[want_included_regex=true])dnl
+
+if test $want_included_regex = false; then
+ AC_MSG_CHECKING(for GNU regex)
+ AC_CACHE_VAL(gdb_cv_have_gnu_regex,
+[AC_TRY_COMPILE([#include <gnu-versions.h>
+#include <sys/types.h>
+#include <regex.h>],
+[#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2
+#error No valid GNU regex.
+#endif
+],
+ [gdb_cv_have_gnu_regex=yes],
+ [gdb_cv_have_gnu_regex=no])])
+ AC_MSG_RESULT($gdb_cv_have_gnu_regex)
+ if test $gdb_cv_have_gnu_regex = no; then
+ want_included_regex=true
+ fi
+fi
+
+if test x${want_included_regex} = xtrue; then
+ REGEX="gnu-regex.o"
+ AC_DEFINE(USE_INCLUDED_REGEX)
+fi
+AC_SUBST(REGEX)
+
+# In the Cygwin environment, we need some additional flags.
+AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
+[AC_EGREP_CPP(lose, [
+#if defined (__CYGWIN__) || defined (__CYGWIN32__)
+lose
+#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
+
+
+dnl Figure out which of the many generic ser-*.c files the _host_ supports.
+SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
+case ${host} in
+ *go32* ) SER_HARDWIRE=ser-go32.o ;;
+ *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
+esac
+AC_SUBST(SER_HARDWIRE)
+
+
dnl Figure out which term library to use.
+if test x$gdb_host = xgo32; then
+ TERM_LIB=
+else
if test x$gdb_cv_os_cygwin = xyes; then
TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
else
@@ -422,16 +877,278 @@ else
AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
fi
fi
+fi
AC_SUBST(TERM_LIB)
+# libreadline needs libuser32.a in a cygwin environment
+WIN32LIBS=
+if test x$gdb_cv_os_cygwin = xyes; then
+ WIN32LIBS="-luser32"
+ case "${target}" in
+ *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
+ ;;
+ esac
+fi
+AC_SUBST(WIN32LIBS)
+
+LIBGUI="../libgui/src/libgui.a"
+GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
+AC_SUBST(LIBGUI)
+AC_SUBST(GUI_CFLAGS_X)
+
+AC_ARG_WITH(cpu,
+[ --with-cpu=CPU Set the default CPU variant to debug],
+[case "${target}" in
+ powerpc-* | powerpcle-* )
+ ## It would be nice to keep this table in sync with the one in
+ ## gcc/configure.
+ case "${with_cpu}" in
+ ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
+ | 604 | 750 )
+ ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
+ ;;
+ common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
+ ## These are all RS6000 variants, as far as GDB is concerned.
+ with_cpu=rs6000
+ ;;
+ 603e | ec603e )
+ with_cpu=603
+ ;;
+ 604e )
+ with_cpu=604
+ ;;
+ * )
+ AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
+ with_cpu=ppc-uisa
+ ;;
+ esac
+ ;;
+ * )
+ AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
+ ;;
+esac
+AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
+],)
+
+
+AC_ARG_ENABLE(gdbtk,
+[ --enable-gdbtk Enable GDBTK GUI front end],
+[case "${enableval}" in
+ yes)
+ case "$host" in
+ *go32*)
+ AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
+ enable_gdbtk=no ;;
+ *windows*)
+ AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
+ enable_gdbtk=no ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac ;;
+ no)
+ enable_gdbtk=no ;;
+ *)
+ AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
+esac],
+[
+# Default is on for everything but go32 and Cygwin
+case "$host" in
+ *go32* | *windows*)
+ ;;
+ *)
+ if test -d "${srcdir}/gdbtk" ; then
+ enable_gdbtk=yes
+ fi
+ ;;
+esac
+])
+
+WIN32LDAPP=
+AC_SUBST(WIN32LIBS)
+AC_SUBST(WIN32LDAPP)
+
+configdir="unix"
+
+GDBTKLIBS=
+if test "${enable_gdbtk}" = "yes"; then
+
+ # Gdbtk must have an absolute path to srcdir in order to run
+ # properly when not installed.
+ here=`pwd`
+ cd ${srcdir}
+ GDBTK_SRC_DIR=`pwd`
+ cd $here
+
+ CY_AC_PATH_TCLCONFIG
+ if test -z "${no_tcl}"; then
+ CY_AC_LOAD_TCLCONFIG
+ CY_AC_PATH_TKCONFIG
+
+ # now look for Tcl library stuff
+
+ case "${host}" in
+ *-*-cygwin*)
+ tcldir=../tcl/win/
+ ;;
+ *)
+ tcldir=../tcl/unix/
+ ;;
+ esac
+
+ TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
+
+ # If $no_tk is nonempty, then we can't do Tk, and there is no
+ # point to doing Tcl.
+ if test -z "${no_tk}"; then
+ CY_AC_LOAD_TKCONFIG
+ CY_AC_PATH_TCLH
+ CY_AC_PATH_TKH
+ CY_AC_PATH_ITCLH
+ CY_AC_PATH_ITKH
+ CY_AC_PATH_TIXH
+
+
+ # now look for Tk library stuff
+
+ case "${host}" in
+ *-*-cygwin*)
+ tkdir=../tk/win/
+ ;;
+ *)
+ tkdir=../tk/unix/
+ ;;
+ esac
+
+ TK_DEPS="${tkdir}${TK_LIB_FILE}"
+
+ # now look for Itcl library stuff
+
+ CY_AC_PATH_ITCLCONFIG
+ if test -z "${no_itcl}"; then
+ CY_AC_LOAD_ITCLCONFIG
+
+ ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
+ ITCL_DEPS="${ITCL_LIB_FULL_PATH}"
+ fi
+
+
+ # now look for Itk library stuff
+ CY_AC_PATH_ITKCONFIG
+ if test -z "${no_itcl}"; then
+ CY_AC_LOAD_ITKCONFIG
+
+ ITKLIB="${ITK_BUILD_LIB_SPEC}"
+ ITK_DEPS="${ITK_LIB_FULL_PATH}"
+ fi
+
+ # now look for Tix library stuff
+ CY_AC_PATH_TIXCONFIG
+ if test -z "${no_tix}"; then
+ CY_AC_LOAD_TIXCONFIG
+ TIXLIB="${TIX_BUILD_LIB_SPEC}"
+ TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
+ fi
+
+ ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
+ # Tcl/Tk 8.1 require -fwritable strings. I don't
+ # know whether 8.2 will or not, but I bet it will.
+ # I don't have to worry about 7.x since we don't support it.
+ GDBTK_CFLAGS=""
+ if test "$GCC" = "yes"; then
+ if test "$TCL_VERSION" != "8.0" ; then
+ GDBTK_CFLAGS="-fwritable-strings"
+ fi
+ fi
+
+ # Include some libraries that Tcl and Tk want.
+ TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
+ # Yes, the ordering seems wrong here. But it isn't.
+ # TK_LIBS is the list of libraries that need to be linked
+ # after Tcl/Tk. Note that this isn't put into LIBS. If it
+ # were in LIBS then any link tests after this point would
+ # try to include things like `$(LIBGUI)', which wouldn't work.
+ GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
+
+ CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
+ CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
+ CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
+ CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_GDBTK_INITS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_GDBTK_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
+
+ if test x$gdb_cv_os_cygwin = xyes; then
+ WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
+ WIN32LDAPP="-Wl,--subsystem,console"
+ CONFIG_OBS="${CONFIG_OBS} gdbres.o"
+ fi
+ fi
+ fi
+fi
+
+AC_SUBST(X_CFLAGS)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(X_LIBS)
+AC_SUBST(TCL_DEPS)
+AC_SUBST(TK_DEPS)
+AC_SUBST(ITCLLIB)
+AC_SUBST(ITCL_DEPS)
+AC_SUBST(ITKLIB)
+AC_SUBST(ITK_DEPS)
+AC_SUBST(TIXLIB)
+AC_SUBST(TIX_DEPS)
+AC_SUBST(GDBTKLIBS)
+AC_SUBST(GDBTK_CFLAGS)
+AC_SUBST(GDBTK_SRC_DIR)
AC_PATH_X
+
+# Unlike the sim directory, whether a simulator is linked is controlled by
+# presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
+# This code just checks for a few cases where we'd like to ignore those
+# definitions, even when they're present in the '.mt' file. These cases
+# are when --disable-sim is specified, or if the simulator directory is
+# not part of the source tree.
+#
+AC_ARG_ENABLE(sim,
+[ --enable-sim Link gdb with simulator],
+[echo "enable_sim = $enable_sim";
+ echo "enableval = ${enableval}";
+ case "${enableval}" in
+ yes) ignore_sim=false ;;
+ no) ignore_sim=true ;;
+ *) ignore_sim=false ;;
+ esac],
+[ignore_sim=false])
+
+if test ! -d "${srcdir}/../sim"; then
+ ignore_sim=true
+fi
+
+if test "${ignore_sim}" = "true"; then
+ IGNORE_SIM="SIM="
+ IGNORE_SIM_OBS="SIM_OBS="
+else
+ IGNORE_SIM=""
+ IGNORE_SIM_OBS=""
+ AC_DEFINE(WITH_SIM)
+fi
+AC_SUBST(IGNORE_SIM)
+AC_SUBST(IGNORE_SIM_OBS)
+
AC_SUBST(ENABLE_CFLAGS)
AC_SUBST(CONFIG_OBS)
+AC_SUBST(CONFIG_LIB_OBS)
AC_SUBST(CONFIG_DEPS)
AC_SUBST(CONFIG_SRCS)
+AC_SUBST(CONFIG_INITS)
+AC_SUBST(CONFIG_ALL)
+AC_SUBST(CONFIG_CLEAN)
+AC_SUBST(CONFIG_INSTALL)
+AC_SUBST(CONFIG_UNINSTALL)
# Begin stuff to support --enable-shared
AC_ARG_ENABLE(shared,
@@ -455,7 +1172,7 @@ if test "${shared}" = "true"; then
;;
*-*-linux*aout*)
;;
- *-*-linux* | *-pc-linux-gnu)
+ *-*-linux* | *-pc-linux-gnu*)
HLDFLAGS='-Wl,-rpath,$(libdir)'
;;
*-*-solaris*)
@@ -504,7 +1221,14 @@ AC_SUBST(target_subdir)
frags=
host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
if test ! -f ${host_makefile_frag}; then
-AC_MSG_ERROR("*** Gdb does not support host ${host}")
+ # When building a native debuger the .mh file containing things
+ # like NATDEPFILES is needed. Cross debuggers don't need .mh
+ # since it no longer contains anything useful.
+ if test "${target}" = "${host}"; then
+ AC_MSG_ERROR("*** Gdb does not support native target ${host}")
+ else
+ host_makefile_frag=/dev/null
+ fi
fi
frags="$frags $host_makefile_frag"
@@ -527,46 +1251,106 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
-# these really aren't orthogonal true/false values of the same condition,
-# but shells are slow enough that I like to reuse the test conditions
-# whenever possible
+GDB_MULTI_ARCH=`sed -n '
+s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
+' ${target_makefile_frag}`
+
if test "${target}" = "${host}"; then
+# We pick this up from the host configuration file (.mh) because we
+# do not have a native configuration Makefile fragment.
nativefile=`sed -n '
s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${host_makefile_frag}`
-# else
-# GDBserver is only useful in a "native" enviroment
-# configdirs=`echo $configdirs | sed 's/gdbserver//'`
fi
changequote([,])
+# New targets should just set gdb_multi_arch=yes in configure.tgt.
+# Old targets being converted can either do that or set GDB_MULTI_ARCH
+# in the target specific makefile frag. Eventually gdb_multi_arch=yes
+# will be the default.
+if test x"${GDB_MULTI_ARCH}" = x ; then
+ case "${gdb_multi_arch}" in
+ yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
+ no ) GDB_MULTI_ARCH=0 ;;
+ 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
+ esac
+fi
+if test x"${GDB_MULTI_ARCH}" != x ; then
+ AC_DEFINE_UNQUOTED(GDB_MULTI_ARCH, ${GDB_MULTI_ARCH})
+fi
+# Warn the user when they use an old practice
+case "${GDB_MULTI_ARCH}" in
+ "" ) ;;
+ 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
+ AC_MSG_WARN("GDB: Target is not pure multi-arch") ;;
+ GDB_MULTI_ARCH_PURE )
+ if test x"${targetfile}" != x ; then
+ AC_MSG_WARN("GDB: Ignoring TM_FILE in ${target_makefile_frag}")
+ targetfile=""
+ fi ;;
+ *) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
+esac
+
+SUBDIRS="doc testsuite nlm"
+if test "${enable_multi_ice}" = "yes"; then
+ SUBDIRS="${SUBDIRS} multi-ice"
+fi
+
+# ``gdbserver'' can only be built in a native configuration.
+if test x"${target}" = x"${host}"; then
+ AC_MSG_CHECKING(whether gdbserver is supported on this host)
+ if test x"${build_gdbserver}" = xyes ; then
+ configdirs="${configdirs} gdbserver"
+ SUBDIRS="${SUBDIRS} gdbserver"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+AC_SUBST(SUBDIRS)
+
# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
-# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
-# corresponding links. But we have to remove the xm.h files and tm.h
-# files anyway, e.g. when switching from "configure host" to
-# "configure none".
+# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
+# version.
files=
links=
+
rm -f xm.h
+xm_h=""
if test "${hostfile}" != ""; then
-files="${files} config/${gdb_host_cpu}/${hostfile}"
-links="${links} xm.h"
+ xm_h=xm.h
+ GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}"
+ files="${files} ${GDB_XM_FILE}"
+ links="${links} xm.h"
+ AC_DEFINE_UNQUOTED(GDB_XM_FILE, ${GDB_XM_FILE})
fi
+AC_SUBST(xm_h)
+
rm -f tm.h
+tm_h=""
if test "${targetfile}" != ""; then
-files="${files} config/${gdb_target_cpu}/${targetfile}"
-links="${links} tm.h"
+ tm_h=tm.h
+ GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}"
+ files="${files} ${GDB_TM_FILE}"
+ links="${links} tm.h"
+ AC_DEFINE_UNQUOTED(GDB_TM_FILE, ${GDB_TM_FILE})
fi
+AC_SUBST(tm_h)
+
rm -f nm.h
+nm_h=""
if test "${nativefile}" != ""; then
-files="${files} config/${gdb_host_cpu}/${nativefile}"
-links="${links} nm.h"
-else
-# A cross-only configuration.
-files="${files} config/nm-empty.h"
-links="${links} nm.h"
+ nm_h=nm.h
+ GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}"
+ files="${files} ${GDB_NM_FILE}"
+ links="${links} nm.h"
+ AC_DEFINE_UNQUOTED(GDB_NM_FILE, ${GDB_NM_FILE})
fi
+AC_SUBST(nm_h)
+
+AC_PROG_LN_S
AC_LINK_FILES($files, $links)
@@ -574,14 +1358,16 @@ dnl Check for exe extension set on certain hosts (e.g. Win32)
AC_EXEEXT
AC_CONFIG_SUBDIRS($configdirs)
-AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
+AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
[
dnl Autoconf doesn't provide a mechanism for modifying definitions
dnl provided by makefile fragments.
dnl
if test "${nativefile}" = ""; then
-sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
- < Makefile > Makefile.tem
+ < Makefile \
+ sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
+ | sed -e '/^\(NATDEPFILES[[ ]]*[[+]]=[[ ]]*\)/s//# \1/' \
+ > Makefile.tem
mv -f Makefile.tem Makefile
fi
@@ -592,6 +1378,7 @@ sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
mv -f Makefile.tmp Makefile
changequote([,])dnl
+
case x$CONFIG_HEADERS in
xconfig.h:config.in)
echo > stamp-h ;;
diff --git a/contrib/gdb/gdb/configure.tgt b/contrib/gdb/gdb/configure.tgt
index 95fc274..cf9a1e0 100644
--- a/contrib/gdb/gdb/configure.tgt
+++ b/contrib/gdb/gdb/configure.tgt
@@ -13,20 +13,22 @@
case "${target_cpu}" in
alpha*) gdb_target_cpu=alpha ;;
-c[12]) gdb_target_cpu=convex ;;
+arm*) gdb_target_cpu=arm ;;
+avr*) gdb_target_cpu=avr ;;
hppa*) gdb_target_cpu=pa ;;
i[3456]86*) gdb_target_cpu=i386 ;;
+m68hc11*|m6811*) gdb_target_cpu=m68hc11 ;;
m68*) gdb_target_cpu=m68k ;;
m88*) gdb_target_cpu=m88k ;;
mips*) gdb_target_cpu=mips ;;
-# OBSOLETE np1) gdb_target_cpu=gould ;;
powerpc*) gdb_target_cpu=powerpc ;;
-# OBSOLETE pn) gdb_target_cpu=gould ;;
-pyramid) gdb_target_cpu=pyr ;;
sparc*) gdb_target_cpu=sparc ;;
thumb*) gdb_target_cpu=arm ;;
+s390*) gdb_target_cpu=s390 ;;
strongarm*) gdb_target_cpu=arm ;;
+xscale*) gdb_target_cpu=arm ;;
v850*) gdb_target_cpu=v850 ;;
+x86_64*) gdb_target_cpu=i386 ;;
*) gdb_target_cpu=$target_cpu ;;
esac
@@ -35,35 +37,40 @@ esac
case "${target}" in
-a29k-*-aout*) gdb_target=a29k ;;
-a29k-*-coff*) gdb_target=a29k ;;
-a29k-*-elf*) gdb_target=a29k ;;
-a29k-*-ebmon*) gdb_target=a29k ;;
-a29k-*-kern*) gdb_target=a29k-kern ;;
-a29k-*-none*) gdb_target=a29k ;;
-a29k-*-sym1*) gdb_target=ultra3 ;;
-a29k-*-udi*) gdb_target=a29k-udi ;;
-a29k-*-vxworks*) gdb_target=vx29k ;;
+# OBSOLETE a29k-*-aout*) gdb_target=a29k ;;
+# OBSOLETE a29k-*-coff*) gdb_target=a29k ;;
+# OBSOLETE a29k-*-elf*) gdb_target=a29k ;;
+# OBSOLETE a29k-*-ebmon*) gdb_target=a29k ;;
+# OBSOLETE a29k-*-kern*) gdb_target=a29k-kern ;;
+# OBSOLETE a29k-*-none*) gdb_target=a29k ;;
+# OBSOLETE a29k-*-udi*) gdb_target=a29k-udi ;;
+# OBSOLETE a29k-*-vxworks*) gdb_target=vx29k ;;
alpha*-*-osf*) gdb_target=alpha-osf1 ;;
alpha*-*-linux*) gdb_target=alpha-linux ;;
+alpha*-*-freebsd*) gdb_target=fbsd ;;
arc-*-*) gdb_target=arc ;;
-arm-*-* | thumb-*-* | strongarm-*-*) gdb_target=arm
-
- # rdi doesn't work for wingdb yet
- case $gdb_host in
- windows) ;;
- *)
- configdirs="$configdirs rdi-share"
- CONFIG_OBS="$CONFIG_OBS remote-rdi.o rdi-share/libangsd.a"
- ;;
- esac
+arm*-wince-pe) gdb_target=wince ;;
+arm*-*-linux*) gdb_target=linux
+ build_gdbserver=yes
+ ;;
+arm*-*-netbsd*) gdb_target=nbsd
+ gdb_multi_arch=yes ;;
+arm*-*-* | thumb*-*-* | strongarm*-*-*)
+ gdb_target=embed
+ configdirs="$configdirs rdi-share"
+ ;;
+xscale-*-*) gdb_target=embed
+ configdirs="$configdirs rdi-share"
+ ;;
+
+avr-*-*) gdb_target=avr
+ gdb_multi_arch=yes
;;
-c1-*-*) gdb_target=convex ;;
-c2-*-*) gdb_target=convex ;;
+cris*) gdb_target=cris ;;
d10v-*-*) gdb_target=d10v ;;
d30v-*-*) gdb_target=d30v ;;
@@ -71,12 +78,13 @@ d30v-*-*) gdb_target=d30v ;;
h8300-*-*) gdb_target=h8300 ;;
h8500-*-*) gdb_target=h8500 ;;
-sh-*-*) gdb_target=sh ;;
fr30-*-elf*) gdb_target=fr30 ;;
+
hppa*-*-bsd*) gdb_target=hppabsd ;;
hppa*-*-pro*) gdb_target=hppapro ;;
+hppa*64*-*-hpux11*) gdb_target=hppa64 ;;
hppa*-*-hpux*) gdb_target=hppahpux ;;
hppa*-*-hiux*) gdb_target=hppahpux ;;
hppa*-*-osf*) gdb_target=hppaosf ;;
@@ -85,22 +93,23 @@ i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
i[3456]86-sequent-sysv*) gdb_target=ptx ;;
i[3456]86-ncr-*) gdb_target=ncr3000 ;;
-i[3456]86-*-aout*) gdb_target=i386aout ;;
-i[3456]86-*-coff*) gdb_target=i386v ;;
-i[3456]86-*-elf*) gdb_target=i386v ;;
+i[3456]86-*-aout*) gdb_target=embed ;;
+i[3456]86-*-coff*) gdb_target=embed ;;
+i[3456]86-*-elf*) gdb_target=embed ;;
i[3456]86-*-aix*) gdb_target=i386aix ;;
i[3456]86-*-bsd*) gdb_target=i386bsd ;;
i[3456]86-*-freebsd*) gdb_target=fbsd ;;
+i[3456]86-*-netbsdelf*) gdb_target=nbsdelf ;;
i[3456]86-*-netbsd*) gdb_target=nbsd ;;
i[3456]86-*-os9k) gdb_target=i386os9k ;;
i[3456]86-*-go32*) gdb_target=i386aout ;;
-i[3456]86-*-lynxos*) gdb_target=i386lynx
- configdirs="${configdirs} gdbserver" ;;
+i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;;
+i[3456]86-*-lynxos*) gdb_target=i386lynx ;;
+i[3456]86-*-openbsd*) gdb_target=obsd ;;
i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
-i[3456]86-*-sunos*) gdb_target=sun386 ;;
-i[3456]86-*-sysv4.2MP) gdb_target=i386v42mp ;;
-i[3456]86-*-sysv4.2uw2*) gdb_target=i386v42mp ;;
+i[3456]86-*-sysv4.2*) gdb_target=i386v42mp ;;
i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
+i[3456]86-*-sysv5*) gdb_target=i386v42mp ;;
i[3456]86-*-unixware2*) gdb_target=i386v42mp ;;
i[3456]86-*-unixware*) gdb_target=i386v4 ;;
i[3456]86-*-sco3.2v4*) gdb_target=i386sco4 ;;
@@ -108,9 +117,8 @@ i[3456]86-*-sco3.2v5*) gdb_target=i386sco5 ;;
i[3456]86-*-sco*) gdb_target=i386v ;;
i[3456]86-*-sysv*) gdb_target=i386v ;;
i[3456]86-*-linux*) gdb_target=linux
- configdirs="${configdirs} gdbserver" ;;
-i[3456]86-pc-linux-gnu) gdb_target=linux
- configdirs="${configdirs} gdbserver" ;;
+ build_gdbserver=yes
+ ;;
i[3456]86-*-isc*) gdb_target=i386v ;;
i[3456]86-*-mach3*) gdb_target=i386m3 ;;
i[3456]86-*-gnu*) gdb_target=i386gnu ;;
@@ -118,17 +126,26 @@ i[3456]86-*-netware*) gdb_target=i386nw
configdirs="${configdirs} nlm" ;;
i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
i[3456]86-*-cygwin*) gdb_target=cygwin ;;
+i[3456]86-*-pe*) gdb_target=embed ;;
+i[3456]86-*-vxworks*) gdb_target=vxworks ;;
+
i960-*-bout*) gdb_target=vxworks960 ;;
i960-nindy-coff*) gdb_target=nindy960 ;;
i960-*-coff*) gdb_target=mon960 ;;
i960-nindy-elf*) gdb_target=nindy960 ;;
i960-*-elf*) gdb_target=mon960 ;;
-
i960-*-nindy*) gdb_target=nindy960 ;;
i960-*-vxworks*) gdb_target=vxworks960 ;;
+ia64-*-aix*) gdb_target=aix ;;
+ia64-*-linux*) gdb_target=linux
+ build_gdbserver=yes
+ ;;
+
m32r-*-elf*) gdb_target=m32r ;;
+m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;;
+
m68000-*-sunos3*) gdb_target=sun2os3 ;;
m68000-*-sunos4*) gdb_target=sun2os4 ;;
@@ -136,26 +153,19 @@ m68*-apollo*-bsd*) gdb_target=apollo68b ;;
m68*-bull-sysv*) gdb_target=dpx2 ;;
m68*-hp-bsd*) gdb_target=hp300bsd ;;
m68*-hp-hpux*) gdb_target=hp300hpux ;;
-m68*-altos-*) gdb_target=altos ;;
m68*-att-*) gdb_target=3b1 ;;
m68*-cisco*-*) gdb_target=cisco ;;
m68*-ericsson-*) gdb_target=es1800 ;;
-m68*-isi-*) gdb_target=isi ;;
m68*-motorola-*) gdb_target=delta68 ;;
m68*-netx-*) gdb_target=vxworks68 ;;
-m68*-sony-*) gdb_target=news ;;
m68*-tandem-*) gdb_target=st2000 ;;
-m68*-rom68k-*) gdb_target=monitor ;;
-m68*-*bug-*) gdb_target=monitor ;;
-m68*-monitor-*) gdb_target=monitor ;;
-m68*-est-*) gdb_target=monitor ;;
m68*-*-aout*) gdb_target=monitor ;;
m68*-*-coff*) gdb_target=monitor ;;
m68*-*-elf*) gdb_target=monitor ;;
m68*-*-linux*) gdb_target=linux
- configdirs="${configdirs} gdbserver" ;;
-m68*-*-lynxos*) gdb_target=m68klynx
- configdirs="${configdirs} gdbserver" ;;
+ build_gdbserver=yes
+ ;;
+m68*-*-lynxos*) gdb_target=m68klynx ;;
m68*-*-netbsd*) gdb_target=nbsd ;;
m68*-*-os68k*) gdb_target=os68k ;;
m68*-*-sunos3*) gdb_target=sun3os3 ;;
@@ -163,24 +173,26 @@ m68*-*-sunos4*) gdb_target=sun3os4 ;;
m68*-*-sysv4*) gdb_target=m68kv4 ;;
m68*-*-vxworks*) gdb_target=vxworks68 ;;
-m88*-harris-cxux*) gdb_target=cxux ;;
m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
m88*-motorola-*) gdb_target=delta88 ;;
m88*-*-*) gdb_target=m88k ;;
+mcore*-*-*) gdb_target=mcore ;;
mips64*-big-*) gdb_target=bigmips64 ;;
mips*-big-*) gdb_target=bigmips ;;
mips*-dec-mach3*) gdb_target=mach3 ;;
mips*-dec-*) gdb_target=decstation ;;
+mips*-*-pe) gdb_target=wince ;;
mips64*el-*-ecoff*) gdb_target=embedl64 ;;
mips64*-*-ecoff*) gdb_target=embed64 ;;
+mips64*vr4xxx*el-*-elf*)gdb_target=vr4xxxel ;;
+mips64*vr4xxx*-*-elf*) gdb_target=vr4xxx ;;
mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
mips64*vr4100*el-*-elf*) gdb_target=vr4300el ;;
mips64*vr4100*-*-elf*) gdb_target=vr4100 ;;
mips64*vr5000*el-*-elf*) gdb_target=vr5000el ;;
-mips64*vr5000*-*-elf*) gdb_target=vr5000
- configdirs="${configdirs} gdbserver" ;;
+mips64*vr5000*-*-elf*) gdb_target=vr5000 ;;
mips*tx39*el*-elf*) gdb_target=tx39l ;;
mips*tx39*-elf*) gdb_target=tx39 ;;
mips64*el-*-elf*) gdb_target=embedl64 ;;
@@ -192,9 +204,12 @@ mips*-*-elf*) gdb_target=embed ;;
mips*-little-*) gdb_target=littlemips ;;
mips*-*-lnews*) gdb_target=embedl ;;
mips*-sgi-irix5*) gdb_target=irix5 ;;
-mips*-sgi-irix6*) gdb_target=irix5 ;;
+mips*-sgi-irix6*) gdb_target=irix6 ;;
mips*-sgi-*) gdb_target=irix3 ;;
mips*-sony-*) gdb_target=bigmips ;;
+mips*-*-linux*) gdb_target=linux
+ build_gdbserver=yes
+ ;;
mips*-*-mach3*) gdb_target=mipsm3 ;;
mips*-*-sysv4*) gdb_target=mipsv4 ;;
mips*-*-sysv*) gdb_target=bigmips ;;
@@ -206,23 +221,11 @@ mn10300-*-*) gdb_target=mn10300 ;;
none-*-*) gdb_target=none ;;
-# OBSOLETE np1-*-*) gdb_target=np1 ;;
-
-ns32k-*-mach3*) gdb_target=ns32km3 ;;
ns32k-*-netbsd*) gdb_target=nbsd ;;
-ns32k-utek-sysv*) gdb_target=merlin ;;
-ns32k-utek-*) gdb_target=umax ;;
-
-# OBSOLETE pn-*-*) gdb_target=pn ;;
-
-powerpc-*-macos*) gdb_target=macos ;;
-powerpc-*-netware*) gdb_target=ppc-nw
- configdirs="${configdirs} nlm" ;;
+powerpc-*-netbsd*) gdb_target=nbsd ;;
powerpc-*-aix*) gdb_target=aix ;;
-powerpcle-*-cygwin*) gdb_target=cygwin ;;
-powerpcle-*-solaris*) gdb_target=solaris ;;
-powerpc-*-eabi* | powerpc-*-linux* | powerpc-*-sysv* | powerpc-*-elf*)
+powerpc-*-eabi* | powerpc-*-sysv* | powerpc-*-elf*)
if test -f ../sim/ppc/Makefile; then
gdb_target=ppc-sim
else
@@ -234,19 +237,35 @@ powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*)
else
gdb_target=ppcle-eabi
fi ;;
-
-pyramid-*-*) gdb_target=pyramid ;;
+powerpc-*-linux*) gdb_target=linux
+ build_gdbserver=yes
+ ;;
+powerpc-*-vxworks*) gdb_target=vxworks ;;
rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
rs6000-*-aix4*) gdb_target=aix4 ;;
rs6000-*-*) gdb_target=rs6000 ;;
+s390-*-*) gdb_target=s390
+ build_gdbserver=yes
+ ;;
+s390x-*-*) gdb_target=s390x
+ build_gdbserver=yes
+ ;;
+
+sh*-*-pe) gdb_target=wince ;;
+sh-*-hms) gdb_target=embed ;;
+sh-*-coff*) gdb_target=embed ;;
+sh-*-elf*) gdb_target=embed ;;
+sh-*-linux*) gdb_target=linux
+ build_gdbserver=yes
+ ;;
+
sparc-*-aout*) gdb_target=sparc-em ;;
sparc-*-coff*) gdb_target=sparc-em ;;
sparc-*-elf*) gdb_target=sparc-em ;;
sparc-*-linux*) gdb_target=linux ;;
-sparc-*-lynxos*) gdb_target=sparclynx
- configdirs="${configdirs} gdbserver" ;;
+sparc-*-lynxos*) gdb_target=sparclynx ;;
sparc-*-netbsd*) gdb_target=nbsd ;;
sparc-*-solaris2*) gdb_target=sun4sol2 ;;
sparc-*-sunos4*) gdb_target=sun4os4 ;;
@@ -262,10 +281,12 @@ sparc86x-*-*) gdb_target=sparclite ;;
# regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
# deleted though presumably it should be eventually.
#sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
-sparc64-*-*) gdb_target=sp64 ;;
-
-tahoe-*-*) gdb_target=tahoe ;;
+sparc64-*-freebsd*|ultrasparc-*-freebsd*|sparcv9-*-freebsd*)
+ gdb_target=fbsd ;;
+sparc64-*-linux*) gdb_target=sp64linux ;;
+sparcv9-*-* | sparc64-*-*) gdb_target=sp64 ;;
+xstormy16-*-*) gdb_target=xstormy16 ;;
vax-*-*) gdb_target=vax ;;
@@ -273,10 +294,29 @@ fr30-*-*) gdb_target=fr30
;;
v850*-*-*) gdb_target=v850
+ case ${gdb_host} in
+ cygwin*)
+ CONFIG_OBS="${CONFIG_OBS} v850ice.o" ;;
+ * ) ;;
+ esac
+ ;;
+
+x86_64-*-linux*) gdb_target=x86-64linux
+ build_gdbserver=yes
;;
-w65-*-*) gdb_target=w65 ;;
z8k-*-coff*) gdb_target=z8k ;;
esac
+
+
+# map GDB target onto multi-arch support
+
+case "${gdb_target}" in
+d10v) gdb_multi_arch=yes ;;
+m68hc11) gdb_multi_arch=yes ;;
+mn10300) gdb_multi_arch=yes ;;
+x86-64linux) gdb_multi_arch=yes ;;
+xstormy16) gdb_multi_arch=yes ;;
+esac
diff --git a/contrib/gdb/gdb/copying.awk b/contrib/gdb/gdb/copying.awk
index 4f53e92..53f7a6f 100644
--- a/contrib/gdb/gdb/copying.awk
+++ b/contrib/gdb/gdb/copying.awk
@@ -7,11 +7,11 @@ BEGIN {
print "#include \"command.h\""
print "#include \"gdbcmd.h\""
print ""
- print "static void show_copying_command PARAMS ((char *, int));"
+ print "static void show_copying_command (char *, int);"
print ""
- print "static void show_warranty_command PARAMS ((char *, int));"
+ print "static void show_warranty_command (char *, int);"
print ""
- print "void _initialize_copying PARAMS ((void));"
+ print "void _initialize_copying (void);"
print ""
print "extern int immediate_quit;";
print "static void";
diff --git a/contrib/gdb/gdb/copying.c b/contrib/gdb/gdb/copying.c
index a36db1f..a78a862 100644
--- a/contrib/gdb/gdb/copying.c
+++ b/contrib/gdb/gdb/copying.c
@@ -5,17 +5,15 @@
#include "command.h"
#include "gdbcmd.h"
-static void show_copying_command PARAMS ((char *, int));
+static void show_copying_command (char *, int);
-static void show_warranty_command PARAMS ((char *, int));
+static void show_warranty_command (char *, int);
-void _initialize_copying PARAMS ((void));
+void _initialize_copying (void);
extern int immediate_quit;
static void
-show_copying_command (ignore, from_tty)
- char *ignore;
- int from_tty;
+show_copying_command (char *ignore, int from_tty)
{
immediate_quit++;
printf_filtered (" GNU GENERAL PUBLIC LICENSE\n");
@@ -279,9 +277,7 @@ show_copying_command (ignore, from_tty)
}
static void
-show_warranty_command (ignore, from_tty)
- char *ignore;
- int from_tty;
+show_warranty_command (char *ignore, int from_tty)
{
immediate_quit++;
printf_filtered (" NO WARRANTY\n");
@@ -310,7 +306,7 @@ show_warranty_command (ignore, from_tty)
}
void
-_initialize_copying ()
+_initialize_copying (void)
{
add_cmd ("copying", no_class, show_copying_command,
"Conditions for redistributing copies of GDB.",
diff --git a/contrib/gdb/gdb/corefile.c b/contrib/gdb/gdb/corefile.c
index 94e56eb..7acbd6e 100644
--- a/contrib/gdb/gdb/corefile.c
+++ b/contrib/gdb/gdb/corefile.c
@@ -1,29 +1,30 @@
/* Core dump and executable file functions above target vector, for GDB.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
+ 1999, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 "inferior.h"
#include "symtab.h"
#include "command.h"
@@ -32,16 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "gdbcore.h"
#include "dis-asm.h"
-#include "language.h"
#include "gdb_stat.h"
-#include "symfile.h"
-#include "objfiles.h"
-
-extern char registers[];
+#include "completer.h"
/* Local function declarations. */
-static void call_extra_exec_file_hooks PARAMS ((char *filename));
+extern void _initialize_core (void);
+static void call_extra_exec_file_hooks (char *filename);
/* You can have any number of hooks for `exec_file_command' command to call.
If there's only one hook, it is set in exec_file_display hook.
@@ -51,80 +49,54 @@ static void call_extra_exec_file_hooks PARAMS ((char *filename));
old code that assumed that only one hook could be set, and which called
exec_file_display_hook directly. */
-typedef void (*hook_type) PARAMS ((char *));
+typedef void (*hook_type) (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;
-
+
/* Backward compatability with old way of specifying core files. */
void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
+core_file_command (char *filename, int 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)
- if (!filename)
- (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.
- */
-#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);
- }
-#endif
- (t->to_open) (filename, from_tty);
- }
- else
+ if (t == NULL)
error ("GDB can't read core files on this machine.");
-}
+ if (!filename)
+ (t->to_detach) (filename, from_tty);
+ else
+ (t->to_open) (filename, from_tty);
+}
+
/* If there are two or more functions that wish to hook into exec_file_command,
* this function will call all of the hook functions. */
static void
-call_extra_exec_file_hooks (filename)
- char *filename;
+call_extra_exec_file_hooks (char *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.
This is called from the x-window display code. */
void
-specify_exec_file_hook (hook)
- void (*hook) PARAMS ((char *));
+specify_exec_file_hook (void (*hook) (char *))
{
hook_type *new_array;
@@ -135,7 +107,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;
@@ -147,7 +119,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;
}
@@ -160,18 +132,18 @@ specify_exec_file_hook (hook)
be reopened. */
void
-close_exec_file ()
+close_exec_file (void)
{
-#if 0 /* FIXME */
+#if 0 /* FIXME */
if (exec_bfd)
bfd_tempclose (exec_bfd);
#endif
}
void
-reopen_exec_file ()
+reopen_exec_file (void)
{
-#if 0 /* FIXME */
+#if 0 /* FIXME */
if (exec_bfd)
bfd_reopen (exec_bfd);
#else
@@ -183,15 +155,17 @@ 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);
+ filename = xstrdup (bfd_get_filename (exec_bfd));
+ make_cleanup (xfree, filename);
+ mtime = bfd_get_mtime (exec_bfd);
res = stat (filename, &st);
if (mtime && mtime != st.st_mtime)
- exec_file_command (filename, 0);
+ {
+ exec_open (filename, 0);
+ }
#endif
}
@@ -199,13 +173,13 @@ reopen_exec_file ()
print a warning if they don't go together. */
void
-validate_files ()
+validate_files (void)
{
if (exec_bfd && core_bfd)
{
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.");
}
}
@@ -215,52 +189,48 @@ validate_files ()
otherwise return 0 in that case. */
char *
-get_exec_file (err)
- int err;
+get_exec_file (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;
}
-
+
/* Report a memory error with error(). */
void
-memory_error (status, memaddr)
- int status;
- CORE_ADDR memaddr;
+memory_error (int status, CORE_ADDR memaddr)
{
+ struct ui_file *tmp_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_stream);
+
if (status == EIO)
{
/* Actually, address between memaddr and memaddr + len
- was out of bounds. */
- error_begin ();
- printf_filtered ("Cannot access memory at address ");
- print_address_numeric (memaddr, 1, gdb_stdout);
- printf_filtered (".\n");
- return_to_top_level (RETURN_ERROR);
+ was out of bounds. */
+ fprintf_unfiltered (tmp_stream, "Cannot access memory at address ");
+ print_address_numeric (memaddr, 1, tmp_stream);
}
else
{
- error_begin ();
- printf_filtered ("Error accessing memory address ");
- print_address_numeric (memaddr, 1, gdb_stdout);
- printf_filtered (": %s.\n",
- safe_strerror (status));
- return_to_top_level (RETURN_ERROR);
+ fprintf_filtered (tmp_stream, "Error accessing memory address ");
+ print_address_numeric (memaddr, 1, tmp_stream);
+ fprintf_filtered (tmp_stream, ": %s.",
+ safe_strerror (status));
}
+
+ error_stream (tmp_stream);
}
/* Same as target_read_memory, but report an error if can't read. */
void
-read_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+read_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
int status;
status = target_read_memory (memaddr, myaddr, len);
@@ -268,70 +238,67 @@ read_memory (memaddr, myaddr, len)
memory_error (status, memaddr);
}
-void
-read_memory_section (memaddr, myaddr, len, bfd_section)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- asection *bfd_section;
-{
- int status;
- status = target_read_memory_section (memaddr, myaddr, len, bfd_section);
- if (status != 0)
- memory_error (status, memaddr);
-}
-
/* Like target_read_memory, but slightly different parameters. */
-
int
-dis_asm_read_memory (memaddr, myaddr, len, info)
- bfd_vma memaddr;
- bfd_byte *myaddr;
- int len;
- disassemble_info *info;
+dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
+ disassemble_info *info)
{
return target_read_memory (memaddr, (char *) myaddr, len);
}
/* Like memory_error with slightly different parameters. */
void
-dis_asm_memory_error (status, memaddr, info)
- int status;
- bfd_vma memaddr;
- disassemble_info *info;
+dis_asm_memory_error (int status, bfd_vma memaddr, disassemble_info *info)
{
memory_error (status, memaddr);
}
/* Like print_address with slightly different parameters. */
void
-dis_asm_print_address (addr, info)
- bfd_vma addr;
- struct disassemble_info *info;
+dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
{
print_address (addr, info->stream);
}
-/* Same as target_write_memory, but report an error if can't write. */
-void
-write_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+/* Read an integer from debugged memory, given address and number of bytes. */
+
+struct captured_read_memory_integer_arguments
{
- int status;
+ CORE_ADDR memaddr;
+ int len;
+ LONGEST result;
+};
- status = target_write_memory (memaddr, myaddr, len);
- if (status != 0)
- memory_error (status, memaddr);
+static int
+do_captured_read_memory_integer (void *data)
+{
+ struct captured_read_memory_integer_arguments *args = (struct captured_read_memory_integer_arguments*) data;
+ CORE_ADDR memaddr = args->memaddr;
+ int len = args->len;
+
+ args->result = read_memory_integer (memaddr, len);
+
+ return 0;
}
-/* Read an integer from debugged memory, given address and number of bytes. */
+int
+safe_read_memory_integer (CORE_ADDR memaddr, int len, LONGEST *return_value)
+{
+ int status;
+ struct captured_read_memory_integer_arguments args;
+ args.memaddr = memaddr;
+ args.len = len;
+
+ status = catch_errors (do_captured_read_memory_integer, &args,
+ "", RETURN_MASK_ALL);
+ if (!status)
+ *return_value = args.result;
+
+ return status;
+}
LONGEST
-read_memory_integer (memaddr, len)
- CORE_ADDR memaddr;
- int len;
+read_memory_integer (CORE_ADDR memaddr, int len)
{
char buf[sizeof (LONGEST)];
@@ -340,9 +307,7 @@ read_memory_integer (memaddr, len)
}
ULONGEST
-read_memory_unsigned_integer (memaddr, len)
- CORE_ADDR memaddr;
- int len;
+read_memory_unsigned_integer (CORE_ADDR memaddr, int len)
{
char buf[sizeof (ULONGEST)];
@@ -351,12 +316,9 @@ read_memory_unsigned_integer (memaddr, len)
}
void
-read_memory_string (memaddr, buffer, max_len)
- CORE_ADDR memaddr;
- char * buffer;
- int max_len;
+read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len)
{
- register char * cp;
+ register char *cp;
register int i;
int cnt;
@@ -364,23 +326,53 @@ 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;
}
}
+/* Same as target_write_memory, but report an error if can't write. */
+void
+write_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ int status;
+
+ status = target_write_memory (memaddr, myaddr, len);
+ if (status != 0)
+ memory_error (status, memaddr);
+}
+
+/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
+void
+write_memory_unsigned_integer (CORE_ADDR addr, int len, ULONGEST value)
+{
+ char *buf = alloca (len);
+ store_unsigned_integer (buf, len, value);
+ write_memory (addr, buf, len);
+}
+
+/* Store VALUE at ADDR in the inferior as a LEN-byte signed integer. */
+void
+write_memory_signed_integer (CORE_ADDR addr, int len, LONGEST value)
+{
+ char *buf = alloca (len);
+ store_signed_integer (buf, len, value);
+ write_memory (addr, buf, len);
+}
+
+
#if 0
/* Enable after 4.12. It is not tested. */
@@ -388,17 +380,9 @@ read_memory_string (memaddr, buffer, max_len)
if the protocol has a less general search function, they can call this
in the cases it can't handle. */
void
-generic_search (len, data, mask, startaddr, increment, lorange, hirange
- addr_found, data_found)
- int len;
- char *data;
- char *mask;
- CORE_ADDR startaddr;
- int increment;
- CORE_ADDR lorange;
- CORE_ADDR hirange;
- CORE_ADDR *addr_found;
- char *data_found;
+generic_search (int len, char *data, char *mask, CORE_ADDR startaddr,
+ int increment, CORE_ADDR lorange, CORE_ADDR hirange,
+ CORE_ADDR *addr_found, char *data_found)
{
int i;
CORE_ADDR curaddr = startaddr;
@@ -416,7 +400,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 */
@@ -428,14 +412,10 @@ char *gnutarget;
/* Same thing, except it is "auto" not NULL for the default case. */
static char *gnutarget_string;
-static void set_gnutarget_command
- PARAMS ((char *, int, struct cmd_list_element *));
+static void set_gnutarget_command (char *, int, struct cmd_list_element *);
static void
-set_gnutarget_command (ignore, from_tty, c)
- char *ignore;
- int from_tty;
- struct cmd_list_element *c;
+set_gnutarget_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
if (STREQ (gnutarget_string, "auto"))
gnutarget = NULL;
@@ -445,17 +425,16 @@ set_gnutarget_command (ignore, from_tty, c)
/* Set the gnutarget. */
void
-set_gnutarget (newtarget)
- char *newtarget;
+set_gnutarget (char *newtarget)
{
if (gnutarget_string != NULL)
- free (gnutarget_string);
+ xfree (gnutarget_string);
gnutarget_string = savestring (newtarget, strlen (newtarget));
set_gnutarget_command (NULL, 0, NULL);
}
void
-_initialize_core()
+_initialize_core (void)
{
struct cmd_list_element *c;
c = add_cmd ("core-file", class_files, core_file_command,
@@ -465,11 +444,11 @@ 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);
- c->function.sfunc = set_gnutarget_command;
+ &setlist);
+ set_cmd_sfunc (c, set_gnutarget_command);
add_show_from_set (c, &showlist);
if (getenv ("GNUTARGET"))
diff --git a/contrib/gdb/gdb/corelow.c b/contrib/gdb/gdb/corelow.c
index e635257..68219c5 100644
--- a/contrib/gdb/gdb/corelow.c
+++ b/contrib/gdb/gdb/corelow.c
@@ -1,30 +1,34 @@
/* Core dump and executable file functions below target vector, for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 <unistd.h>
-#include "frame.h" /* required by inferior.h */
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h> /* needed for F_OK and friends */
+#endif
+#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "symtab.h"
#include "command.h"
@@ -32,6 +36,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "gdbcore.h"
#include "gdbthread.h"
+#include "regcache.h"
+#include "symfile.h"
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
/* List of all available core_fns. On gdb startup, each core file register
reader calls add_core_fns() to register information on each core format it
@@ -39,31 +49,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static struct core_fns *core_file_fns = NULL;
-static void core_files_info PARAMS ((struct target_ops *));
+/* The core_fns for a core file handler that is prepared to read the core
+ file currently open on core_bfd. */
+
+static struct core_fns *core_vec = NULL;
+
+static void core_files_info (struct target_ops *);
#ifdef SOLIB_ADD
-static int solib_add_stub PARAMS ((PTR));
+static int solib_add_stub (PTR);
#endif
-static void core_open PARAMS ((char *, int));
+static struct core_fns *sniff_core_bfd (bfd *);
+
+static boolean gdb_check_format (bfd *);
+
+static void core_open (char *, int);
-static void core_detach PARAMS ((char *, int));
+static void core_detach (char *, int);
-static void core_close PARAMS ((int));
+static void core_close (int);
-static void get_core_registers PARAMS ((int));
+static void core_close_cleanup (void *ignore);
-static void add_to_thread_list PARAMS ((bfd *, asection *, PTR));
+static void get_core_registers (int);
-static int ignore PARAMS ((CORE_ADDR, char *));
+static void add_to_thread_list (bfd *, asection *, PTR);
-static char *core_file_to_sym_file PARAMS ((char *));
+static int ignore (CORE_ADDR, char *);
-static int core_file_thread_alive PARAMS ((int tid));
+static int core_file_thread_alive (ptid_t tid);
-static void init_core_ops PARAMS ((void));
+static void init_core_ops (void);
-void _initialize_corelow PARAMS ((void));
+void _initialize_corelow (void);
struct target_ops core_ops;
@@ -73,55 +92,138 @@ struct target_ops core_ops;
handle. */
void
-add_core_fns (cf)
- struct core_fns *cf;
+add_core_fns (struct core_fns *cf)
{
- cf -> next = core_file_fns;
+ cf->next = core_file_fns;
core_file_fns = cf;
}
+/* The default function that core file handlers can use to examine a
+ core file BFD and decide whether or not to accept the job of
+ reading the core file. */
+
+int
+default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
+{
+ int result;
+
+ result = (bfd_get_flavour (abfd) == our_fns -> core_flavour);
+ return (result);
+}
+
+/* Walk through the list of core functions to find a set that can
+ handle the core file open on ABFD. Default to the first one in the
+ list if nothing matches. Returns pointer to set that is
+ selected. */
+
+static struct core_fns *
+sniff_core_bfd (bfd *abfd)
+{
+ struct core_fns *cf;
+ struct core_fns *yummy = NULL;
+ int matches = 0;;
+
+ for (cf = core_file_fns; cf != NULL; cf = cf->next)
+ {
+ if (cf->core_sniffer (cf, abfd))
+ {
+ yummy = cf;
+ matches++;
+ }
+ }
+ if (matches > 1)
+ {
+ warning ("\"%s\": ambiguous core format, %d handlers match",
+ bfd_get_filename (abfd), matches);
+ }
+ else if (matches == 0)
+ {
+ warning ("\"%s\": no core file handler recognizes format, using default",
+ bfd_get_filename (abfd));
+ }
+ if (yummy == NULL)
+ {
+ yummy = core_file_fns;
+ }
+ return (yummy);
+}
+
+/* The default is to reject every core file format we see. Either
+ BFD has to recognize it, or we have to provide a function in the
+ core file handler that recognizes it. */
+
+int
+default_check_format (bfd *abfd)
+{
+ return (0);
+}
+
+/* Attempt to recognize core file formats that BFD rejects. */
+
+static boolean
+gdb_check_format (bfd *abfd)
+{
+ struct core_fns *cf;
+
+ for (cf = core_file_fns; cf != NULL; cf = cf->next)
+ {
+ if (cf->check_format (abfd))
+ {
+ return (1);
+ }
+ }
+ return (0);
+}
/* Discard all vestiges of any previous core file and mark data and stack
spaces as empty. */
/* ARGSUSED */
static void
-core_close (quitting)
- int quitting;
+core_close (int quitting)
{
char *name;
if (core_bfd)
{
- inferior_pid = 0; /* Avoid confusion from thread stuff */
+ inferior_ptid = null_ptid; /* Avoid confusion from thread stuff */
+
+ /* Clear out solib state while the bfd is still open. See
+ comments in clear_solib in solib.c. */
+#ifdef CLEAR_SOLIB
+ CLEAR_SOLIB ();
+#endif
name = bfd_get_filename (core_bfd);
if (!bfd_close (core_bfd))
warning ("cannot close \"%s\": %s",
name, bfd_errmsg (bfd_get_error ()));
- free (name);
+ xfree (name);
core_bfd = NULL;
-#ifdef CLEAR_SOLIB
- CLEAR_SOLIB ();
-#endif
if (core_ops.to_sections)
{
- free ((PTR)core_ops.to_sections);
+ xfree (core_ops.to_sections);
core_ops.to_sections = NULL;
core_ops.to_sections_end = NULL;
}
}
+ core_vec = NULL;
+}
+
+static void
+core_close_cleanup (void *ignore)
+{
+ core_close (0/*ignored*/);
}
#ifdef SOLIB_ADD
/* Stub function for catch_errors around shared library hacking. FROM_TTYP
is really an int * which points to from_tty. */
-static int
-solib_add_stub (from_ttyp)
- PTR from_ttyp;
+static int
+solib_add_stub (PTR from_ttyp)
{
- SOLIB_ADD (NULL, *(int *)from_ttyp, &current_target);
+ SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target, auto_solib_add);
re_enable_breakpoints_in_shlibs ();
return 0;
}
@@ -131,10 +233,7 @@ solib_add_stub (from_ttyp)
list of threads in a core file. */
static void
-add_to_thread_list (abfd, asect, reg_sect_arg)
- bfd *abfd;
- asection *asect;
- PTR reg_sect_arg;
+add_to_thread_list (bfd *abfd, asection *asect, PTR reg_sect_arg)
{
int thread_id;
asection *reg_sect = (asection *) reg_sect_arg;
@@ -144,21 +243,19 @@ add_to_thread_list (abfd, asect, reg_sect_arg)
thread_id = atoi (bfd_section_name (abfd, asect) + 5);
- add_thread (thread_id);
+ add_thread (pid_to_ptid (thread_id));
/* Warning, Will Robinson, looking at BFD private data! */
if (reg_sect != NULL
- && asect->filepos == reg_sect->filepos) /* Did we find .reg? */
- inferior_pid = thread_id; /* Yes, make it current */
+ && asect->filepos == reg_sect->filepos) /* Did we find .reg? */
+ inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */
}
/* This routine opens and sets up the core file bfd. */
static void
-core_open (filename, from_tty)
- char *filename;
- int from_tty;
+core_open (char *filename, int from_tty)
{
const char *p;
int siggy;
@@ -171,22 +268,22 @@ 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);
if (filename[0] != '/')
{
temp = concat (current_directory, "/", filename, NULL);
- free (filename);
+ xfree (filename);
filename = temp;
}
- old_chain = make_cleanup (free, filename);
+ old_chain = make_cleanup (xfree, filename);
- scratch_chan = open (filename, write_files ? O_RDWR : O_RDONLY, 0);
+ scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
if (scratch_chan < 0)
perror_with_name (filename);
@@ -194,23 +291,27 @@ core_open (filename, from_tty)
if (temp_bfd == NULL)
perror_with_name (filename);
- if (!bfd_check_format (temp_bfd, bfd_core))
+ if (!bfd_check_format (temp_bfd, bfd_core) &&
+ !gdb_check_format (temp_bfd))
{
/* 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). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
+ on error it does not free all the storage associated with the
+ bfd). */
+ make_cleanup_bfd_close (temp_bfd);
error ("\"%s\" is not a core dump: %s",
filename, bfd_errmsg (bfd_get_error ()));
}
/* 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);
+ old_chain = make_cleanup (core_close_cleanup, 0 /*ignore*/);
+
+ /* Find a suitable core file handler to munch on core_bfd */
+ core_vec = sniff_core_bfd (core_bfd);
validate_files ();
@@ -220,6 +321,8 @@ core_open (filename, from_tty)
error ("\"%s\": Can't find sections: %s",
bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
+ set_gdbarch_from_file (core_bfd);
+
ontop = !push_target (&core_ops);
discard_cleanups (old_chain);
@@ -229,8 +332,12 @@ core_open (filename, from_tty)
siggy = bfd_core_file_failing_signal (core_bfd);
if (siggy > 0)
+ /* NOTE: target_signal_from_host() converts a target signal value
+ into gdb's internal signal value. Unfortunately gdb's internal
+ value is called ``target_signal'' and this function got the
+ name ..._from_host(). */
printf_filtered ("Program terminated with signal %d, %s.\n", siggy,
- safe_strsignal (siggy));
+ target_signal_to_string (target_signal_from_host (siggy)));
/* Build up thread list from BFD sections. */
@@ -245,7 +352,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
@@ -257,15 +364,13 @@ 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);
}
}
static void
-core_detach (args, from_tty)
- char *args;
- int from_tty;
+core_detach (char *args, int from_tty)
{
if (args)
error ("Too many arguments");
@@ -275,164 +380,91 @@ core_detach (args, from_tty)
printf_filtered ("No core file now.\n");
}
-/* Get the registers out of a core file. This is the machine-
- independent part. Fetch_core_registers is the machine-dependent
- part, typically implemented in the xm-file for each architecture. */
-/* We just get all the registers, so we don't use regno. */
+/* Try to retrieve registers from a section in core_bfd, and supply
+ them to core_vec->core_read_registers, as the register set numbered
+ WHICH.
-/* ARGSUSED */
-static void
-get_core_registers (regno)
- int regno;
-{
- sec_ptr reg_sec;
- unsigned size;
- char *the_regs;
- char secname[30];
- enum bfd_flavour our_flavour = bfd_get_flavour (core_bfd);
- struct core_fns *cf = NULL;
-
- if (core_file_fns == NULL)
- {
- fprintf_filtered (gdb_stderr,
- "Can't fetch registers from this type of core file\n");
- return;
- }
+ If inferior_ptid is zero, do the single-threaded thing: look for a
+ section named NAME. If inferior_ptid is non-zero, do the
+ multi-threaded thing: look for a section named "NAME/PID", where
+ PID is the shortest ASCII decimal representation of inferior_ptid.
- /* Thread support. If inferior_pid is non-zero, then we have found a core
- file with threads (or multiple processes). In that case, we need to
- use the appropriate register section, else we just use `.reg'. */
+ HUMAN_NAME is a human-readable name for the kind of registers the
+ NAME section contains, for use in error messages.
- /* XXX - same thing needs to be done for floating-point (.reg2) sections. */
+ If REQUIRED is non-zero, print an error if the core file doesn't
+ have a section by the appropriate name. Otherwise, just do nothing. */
- if (inferior_pid)
- sprintf (secname, ".reg/%d", inferior_pid);
- else
- strcpy (secname, ".reg");
-
- reg_sec = bfd_get_section_by_name (core_bfd, secname);
- if (!reg_sec)
- goto cant;
- size = bfd_section_size (core_bfd, reg_sec);
- 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)
- {
- if (our_flavour == cf -> core_flavour)
- {
- break;
- }
- }
- if (cf == NULL)
- {
- 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)
- {
- (cf -> core_read_registers (the_regs, size, 0,
- (unsigned) bfd_section_vma (abfd,reg_sec)));
- }
+static void
+get_core_register_section (char *name,
+ int which,
+ char *human_name,
+ int required)
+{
+ char section_name[100];
+ sec_ptr section;
+ bfd_size_type size;
+ char *contents;
+
+ if (PIDGET (inferior_ptid))
+ sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
else
+ strcpy (section_name, name);
+
+ section = bfd_get_section_by_name (core_bfd, section_name);
+ if (! section)
{
-cant:
- fprintf_filtered (gdb_stderr,
- "Couldn't fetch registers from core file: %s\n",
- bfd_errmsg (bfd_get_error ()));
+ if (required)
+ warning ("Couldn't find %s registers in core file.\n", human_name);
+ return;
}
- /* Now do it again for the float registers, if they exist. */
- reg_sec = bfd_get_section_by_name (core_bfd, ".reg2");
- if (reg_sec)
+ size = bfd_section_size (core_bfd, section);
+ contents = alloca (size);
+ if (! bfd_get_section_contents (core_bfd, section, contents,
+ (file_ptr) 0, size))
{
- 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)
- {
- (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",
- bfd_errmsg (bfd_get_error ()));
- }
+ warning ("Couldn't read %s registers from `%s' section in core file.\n",
+ human_name, name);
+ return;
}
- registers_fetched ();
-}
-static char *
-core_file_to_sym_file (core)
- char * core;
-{
- CONST char * failing_command;
- char * p;
- char * temp;
- bfd * temp_bfd;
- int scratch_chan;
+ core_vec->core_read_registers (contents, size, which,
+ ((CORE_ADDR)
+ bfd_section_vma (core_bfd, section)));
+}
- if (! core)
- error ("No core file specified.");
- core = tilde_expand (core);
- if (core[0] != '/')
- {
- temp = concat (current_directory, "/", core, NULL);
- core = temp;
- }
+/* Get the registers out of a core file. This is the machine-
+ independent part. Fetch_core_registers is the machine-dependent
+ part, typically implemented in the xm-file for each architecture. */
- scratch_chan = open (core, write_files ? O_RDWR : O_RDONLY, 0);
- if (scratch_chan < 0)
- perror_with_name (core);
+/* We just get all the registers, so we don't use regno. */
- temp_bfd = bfd_fdopenr (core, gnutarget, scratch_chan);
- if (temp_bfd == NULL)
- perror_with_name (core);
+/* ARGSUSED */
+static void
+get_core_registers (int regno)
+{
+ int status;
- if (!bfd_check_format (temp_bfd, bfd_core))
+ if (core_vec == NULL
+ || core_vec->core_read_registers == NULL)
{
- /* 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). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
- error ("\"%s\" is not a core dump: %s",
- core, bfd_errmsg (bfd_get_error ()));
+ fprintf_filtered (gdb_stderr,
+ "Can't fetch registers from this type of core file\n");
+ return;
}
- /* Find the data section */
- if (build_section_table (temp_bfd, &core_ops.to_sections,
- &core_ops.to_sections_end))
- error ("\"%s\": Can't find sections: %s",
- bfd_get_filename (temp_bfd), bfd_errmsg (bfd_get_error ()));
-
- failing_command = bfd_core_file_failing_command (temp_bfd);
+ get_core_register_section (".reg", 0, "general-purpose", 1);
+ get_core_register_section (".reg2", 2, "floating-point", 0);
+ get_core_register_section (".reg-xfp", 3, "extended floating-point", 0);
- bfd_close (temp_bfd);
-
- /* If we found a filename, remember that it is probably saved
- relative to the executable that created it. If working directory
- isn't there now, we may not be able to find the executable. Rather
- 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;
-
- return p;
+ registers_fetched ();
}
static void
-core_files_info (t)
- struct target_ops *t;
+core_files_info (struct target_ops *t)
{
print_section_info (t, core_bfd);
}
@@ -441,9 +473,7 @@ core_files_info (t)
`gdb internal error' (since generic_mourn calls breakpoint_init_inferior). */
static int
-ignore (addr, contents)
- CORE_ADDR addr;
- char *contents;
+ignore (CORE_ADDR addr, char *contents)
{
return 0;
}
@@ -454,10 +484,9 @@ 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;
+core_file_thread_alive (ptid_t tid)
{
return 1;
}
@@ -465,7 +494,7 @@ core_file_thread_alive (tid)
/* Fill in core_ops with its defined operations and properties. */
static void
-init_core_ops ()
+init_core_ops (void)
{
core_ops.to_shortname = "core";
core_ops.to_longname = "Local core dump file";
@@ -485,12 +514,11 @@ init_core_ops ()
core_ops.to_create_inferior = find_default_create_inferior;
core_ops.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior;
core_ops.to_thread_alive = core_file_thread_alive;
- core_ops.to_core_file_to_sym_file = core_file_to_sym_file;
core_ops.to_stratum = core_stratum;
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
@@ -502,7 +530,7 @@ init_core_ops ()
int coreops_suppress_target;
void
-_initialize_corelow ()
+_initialize_corelow (void)
{
init_core_ops ();
diff --git a/contrib/gdb/gdb/cp-abi.c b/contrib/gdb/gdb/cp-abi.c
new file mode 100644
index 0000000..d4eb0a0
--- /dev/null
+++ b/contrib/gdb/gdb/cp-abi.c
@@ -0,0 +1,109 @@
+/* Generic code for supporting multiple C++ ABI's
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "cp-abi.h"
+
+struct cp_abi_ops current_cp_abi;
+
+struct cp_abi_ops *cp_abis;
+
+int num_cp_abis = 0;
+
+enum ctor_kinds
+is_constructor_name (const char *name)
+{
+ if ((current_cp_abi.is_constructor_name) == NULL)
+ error ("ABI doesn't define required function is_constructor_name");
+ return (*current_cp_abi.is_constructor_name) (name);
+}
+
+enum dtor_kinds
+is_destructor_name (const char *name)
+{
+ if ((current_cp_abi.is_destructor_name) == NULL)
+ error ("ABI doesn't define required function is_destructor_name");
+ return (*current_cp_abi.is_destructor_name) (name);
+}
+
+int
+is_vtable_name (const char *name)
+{
+ if ((current_cp_abi.is_vtable_name) == NULL)
+ error ("ABI doesn't define required function is_vtable_name");
+ return (*current_cp_abi.is_vtable_name) (name);
+}
+
+int
+is_operator_name (const char *name)
+{
+ if ((current_cp_abi.is_operator_name) == NULL)
+ error ("ABI doesn't define required function is_operator_name");
+ return (*current_cp_abi.is_operator_name) (name);
+}
+
+int
+baseclass_offset (struct type *type, int index, char *valaddr,
+ CORE_ADDR address)
+{
+ if (current_cp_abi.baseclass_offset == NULL)
+ error ("ABI doesn't define required function baseclass_offset");
+ return (*current_cp_abi.baseclass_offset) (type, index, valaddr, address);
+}
+
+struct value *
+value_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
+ struct type * type, int offset)
+{
+ if ((current_cp_abi.virtual_fn_field) == NULL)
+ return NULL;
+ return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, type, offset);
+}
+
+struct type *
+value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
+{
+ if ((current_cp_abi.rtti_type) == NULL)
+ return NULL;
+ return (*current_cp_abi.rtti_type) (v, full, top, using_enc);
+}
+
+int
+register_cp_abi (struct cp_abi_ops abi)
+{
+ cp_abis =
+ xrealloc (cp_abis, (num_cp_abis + 1) * sizeof (struct cp_abi_ops));
+ cp_abis[num_cp_abis++] = abi;
+
+ return 1;
+
+}
+
+int
+switch_to_cp_abi (const char *short_name)
+{
+ int i;
+ for (i = 0; i < num_cp_abis; i++)
+ if (strcmp (cp_abis[i].shortname, short_name) == 0)
+ current_cp_abi = cp_abis[i];
+ return 1;
+}
+
diff --git a/contrib/gdb/gdb/cp-abi.h b/contrib/gdb/gdb/cp-abi.h
new file mode 100644
index 0000000..7c1e952
--- /dev/null
+++ b/contrib/gdb/gdb/cp-abi.h
@@ -0,0 +1,173 @@
+/* Abstraction of various C++ ABI's we support, and the info we need
+ to get from them.
+ Contributed by Daniel Berlin <dberlin@redhat.com>
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or
+ modify
+ it under the terms of the GNU General Public License as published
+ by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef CP_ABI_H_
+#define CP_ABI_H_ 1
+
+struct value;
+
+/* The functions here that attempt to determine what sort of thing a
+ mangled name refers to may well be revised in the future. It would
+ certainly be cleaner to carry this information explicitly in GDB's
+ data structures than to derive it from the mangled name. */
+
+
+/* Kinds of constructors. All these values are guaranteed to be
+ non-zero. */
+enum ctor_kinds {
+
+ /* Initialize a complete object, including virtual bases, using
+ memory provided by caller. */
+ complete_object_ctor = 1,
+
+ /* Initialize a base object of some larger object. */
+ base_object_ctor,
+
+ /* An allocating complete-object constructor. */
+ complete_object_allocating_ctor
+};
+
+/* Return non-zero iff NAME is the mangled name of a constructor.
+ Actually, return an `enum ctor_kind' value describing what *kind*
+ of constructor it is. */
+extern enum ctor_kinds is_constructor_name (const char *name);
+
+
+/* Kinds of destructors. All these values are guaranteed to be
+ non-zero. */
+enum dtor_kinds {
+
+ /* A destructor which finalizes the entire object, and then calls
+ `delete' on its storage. */
+ deleting_dtor = 1,
+
+ /* A destructor which finalizes the entire object, but does not call
+ `delete'. */
+ complete_object_dtor,
+
+ /* A destructor which finalizes a subobject of some larger object. */
+ base_object_dtor
+};
+
+/* Return non-zero iff NAME is the mangled name of a destructor.
+ Actually, return an `enum dtor_kind' value describing what *kind*
+ of destructor it is. */
+extern enum dtor_kinds is_destructor_name (const char *name);
+
+
+/* Return non-zero iff NAME is the mangled name of a vtable. */
+extern int is_vtable_name (const char *name);
+
+
+/* Return non-zero iff NAME is the un-mangled name of an operator,
+ perhaps scoped within some class. */
+extern int is_operator_name (const char *name);
+
+
+/* Return an object's virtual function as a value.
+
+ VALUEP is a pointer to a pointer to a value, holding the object
+ whose virtual function we want to invoke. If the ABI requires a
+ virtual function's caller to adjust the `this' pointer by an amount
+ retrieved from the vtable before invoking the function (i.e., we're
+ not using "vtable thunks" to do the adjustment automatically), then
+ this function may set *VALUEP to point to a new object with an
+ appropriately tweaked address.
+
+ The J'th element of the overload set F is the virtual function of
+ *VALUEP we want to invoke.
+
+ TYPE is the base type of *VALUEP whose method we're invoking ---
+ this is the type containing F. OFFSET is the offset of that base
+ type within *VALUEP. */
+extern struct value *value_virtual_fn_field (struct value **valuep,
+ struct fn_field *f, int j,
+ struct type *type, int offset);
+
+
+/* Try to find the run-time type of VALUE, using C++ run-time type
+ information. Return the run-time type, or zero if we can't figure
+ it out.
+
+ If we do find the run-time type:
+ - Set *FULL to non-zero if VALUE already contains the complete
+ run-time object, not just some embedded base class of the object.
+ - Set *TOP and *USING_ENC to indicate where the enclosing object
+ starts relative to VALUE:
+ - If *USING_ENC is zero, then *TOP is the offset from the start
+ of the complete object to the start of the embedded subobject
+ VALUE represents. In other words, the enclosing object starts
+ at VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) +
+ VALUE_EMBEDDED_OFFSET (VALUE) + *TOP
+ - If *USING_ENC is non-zero, then *TOP is the offset from the
+ address of the complete object to the enclosing object stored
+ in VALUE. In other words, the enclosing object starts at
+ VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) + *TOP.
+ If VALUE's type and enclosing type are the same, then these two
+ cases are equivalent.
+
+ FULL, TOP, and USING_ENC can each be zero, in which case we don't
+ provide the corresponding piece of information. */
+extern struct type *value_rtti_type (struct value *value,
+ int *full, int *top, int *using_enc);
+
+/* Compute the offset of the baseclass which is
+ the INDEXth baseclass of class TYPE,
+ for value at VALADDR (in host) at ADDRESS (in target).
+ The result is the offset of the baseclass value relative
+ to (the address of)(ARG) + OFFSET.
+
+ -1 is returned on error. */
+
+extern int baseclass_offset (struct type *type, int index, char *valaddr,
+ CORE_ADDR address);
+
+struct cp_abi_ops
+{
+ const char *shortname;
+ const char *longname;
+ const char *doc;
+
+ /* ABI-specific implementations for the functions declared above. */
+ enum ctor_kinds (*is_constructor_name) (const char *name);
+ enum dtor_kinds (*is_destructor_name) (const char *name);
+ int (*is_vtable_name) (const char *name);
+ int (*is_operator_name) (const char *name);
+ struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f,
+ int j, struct type * type, int offset);
+ struct type *(*rtti_type) (struct value *v, int *full, int *top,
+ int *using_enc);
+ int (*baseclass_offset) (struct type *type, int index, char *valaddr,
+ CORE_ADDR address);
+};
+
+
+extern struct cp_abi_ops *cp_abis;
+extern int num_cp_abis;
+extern struct cp_abi_ops current_cp_abi;
+extern int register_cp_abi (struct cp_abi_ops abi);
+extern int switch_to_cp_abi (const char *short_name);
+
+#endif
+
diff --git a/contrib/gdb/gdb/cp-valprint.c b/contrib/gdb/gdb/cp-valprint.c
index eeeb79e..6692031 100644
--- a/contrib/gdb/gdb/cp-valprint.c
+++ b/contrib/gdb/gdb/cp-valprint.c
@@ -1,22 +1,24 @@
/* Support for printing C++ values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1994, 1995, 1996
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -31,37 +33,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_string.h"
#include "c-lang.h"
#include "target.h"
+#include "cp-abi.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;
-static void
-cp_print_static_field PARAMS ((struct type *, value_ptr, GDB_FILE *, int, int,
- enum val_prettyprint));
+extern void _initialize_cp_valprint (void);
-static void
-cp_print_value PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, enum val_prettyprint, struct type **));
+static void cp_print_static_field (struct type *, struct value *,
+ struct ui_file *, int, int,
+ enum val_prettyprint);
-static void
-cp_print_hpacc_virtual_table_entries PARAMS ((struct type *, int *, value_ptr, GDB_FILE *,
- int, int, enum val_prettyprint));
+static void cp_print_value (struct type *, struct type *, char *, int,
+ CORE_ADDR, struct ui_file *, int, int,
+ enum val_prettyprint, struct type **);
+
+static void cp_print_hpacc_virtual_table_entries (struct type *, int *,
+ struct value *,
+ struct ui_file *, int,
+ int,
+ enum val_prettyprint);
void
-cp_print_class_method (valaddr, type, stream)
- char *valaddr;
- struct type *type;
- GDB_FILE *stream;
+cp_print_class_method (char *valaddr,
+ struct type *type,
+ struct ui_file *stream)
{
struct type *domain;
struct fn_field *f = NULL;
@@ -76,7 +82,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;
@@ -90,7 +96,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;
@@ -109,12 +115,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);
@@ -122,7 +128,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;
@@ -135,7 +141,7 @@ cp_print_class_method (valaddr, type, stream)
}
}
}
- common:
+ common:
if (i < len)
{
char *demangled_name;
@@ -150,7 +156,7 @@ cp_print_class_method (valaddr, type, stream)
else
{
fputs_filtered (demangled_name, stream);
- free (demangled_name);
+ xfree (demangled_name);
}
}
else
@@ -163,24 +169,24 @@ 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 };
+const char vtbl_ptr_name[] = "__vtbl_ptr_type";
/* HP aCC uses different names */
-const char hpacc_vtbl_ptr_name[] =
- { '_', '_', 'v', 'f', 'p', 0 };
-const char hpacc_vtbl_ptr_type_name[] =
- { '_', '_', 'v', 'f', 't', 'y', 'p', 0 };
+const char hpacc_vtbl_ptr_name[] = "__vfp";
+const char hpacc_vtbl_ptr_type_name[] = "__vftyp";
/* Return truth value for assertion that TYPE is of the type
"pointer to virtual function". */
int
-cp_is_vtbl_ptr_type(type)
- struct type *type;
+cp_is_vtbl_ptr_type (struct type *type)
{
char *typename = type_name_no_tag (type);
@@ -193,8 +199,7 @@ cp_is_vtbl_ptr_type(type)
"pointer to virtual function table". */
int
-cp_is_vtbl_member(type)
- struct type *type;
+cp_is_vtbl_member (struct type *type)
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
{
@@ -202,11 +207,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);
}
}
@@ -216,7 +221,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.
@@ -227,19 +232,10 @@ cp_is_vtbl_member(type)
should not print, or zero if called from top level. */
void
-cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format, recurse, pretty,
- dont_print_vb, dont_print_statmem)
- struct type *type;
- struct type *real_type;
- char *valaddr;
- int offset;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
- struct type **dont_print_vb;
- int dont_print_statmem;
+cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
+ int offset, CORE_ADDR address, struct ui_file *stream,
+ int format, int recurse, enum val_prettyprint pretty,
+ struct type **dont_print_vb, int dont_print_statmem)
{
int i, len, n_baseclasses;
struct obstack tmp_obstack;
@@ -257,17 +253,18 @@ 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 */
- if ((len == n_baseclasses) ||
- ((len - n_baseclasses == 1) &&
- TYPE_HAS_VTABLE(type) &&
- STREQN(TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5)) ||
- !len)
+ * 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))
+ || !len)
fprintf_filtered (stream, "<No data fields>");
else
{
@@ -288,10 +285,11 @@ 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)
@@ -312,7 +310,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));
}
@@ -351,32 +349,33 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
{
- value_ptr v;
+ struct value *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))
{
- value_ptr v = value_static_field (type, i);
+ struct value *v = value_static_field (type, i);
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
@@ -386,10 +385,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 ();
@@ -408,12 +407,15 @@ 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*/
+ struct value *v;
+ /* First get the virtual table pointer and print it out */
#if 0
fputs_filtered ("__vfp = ", stream);
@@ -424,56 +426,60 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
/* pai: FIXME 32x64 problem? */
/* 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));
+ v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long),
+ *(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 -- see comments above */
+ /* RRBC support present; function pointers are found
+ * by indirection through the class segment entries. */
+
+
+ } /* RRBC case */
+ } /* if vtblprint */
if (pretty)
{
@@ -481,8 +487,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, "}");
}
@@ -490,29 +496,23 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
baseclasses. */
static void
-cp_print_value (type, real_type, valaddr, offset, address, stream, format, recurse, pretty,
- dont_print_vb)
- struct type *type;
- struct type *real_type;
- char *valaddr;
- int offset;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
- struct type **dont_print_vb;
+cp_print_value (struct type *type, struct type *real_type, char *valaddr,
+ int offset, CORE_ADDR address, struct ui_file *stream,
+ int format, int recurse, enum val_prettyprint pretty,
+ struct type **dont_print_vb)
{
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);
+ int thisoffset;
+ struct type *thistype;
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);
@@ -529,9 +529,9 @@ 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)
+ int j = (struct type **) obstack_next_free (&dont_print_vb_obstack)
- first_dont_print;
while (--j >= 0)
@@ -541,38 +541,49 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
obstack_ptr_grow (&dont_print_vb_obstack, baseclass);
}
+ thisoffset = offset;
+ thistype = real_type;
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;
-
- 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;
+ {
+ 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 user program. Make sure that it
+ still points to a valid memory location. */
+
+ if (boffset != -1
+ && ((boffset + offset) < 0
+ || (boffset + offset) >= TYPE_LENGTH (type)))
+ {
+ /* FIXME (alloca): unsafe if baseclass is really really large. */
+ base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
+ if (target_read_memory (address + offset + boffset, base_valaddr,
+ TYPE_LENGTH (baseclass)) != 0)
+ skip = 1;
+ thisoffset = 0;
+ boffset = 0;
+ thistype = baseclass;
+ }
+ else
+ base_valaddr = valaddr;
+ }
+ else
+ base_valaddr = valaddr;
}
/* now do the printing */
@@ -583,7 +594,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);
@@ -591,9 +602,11 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
if (skip >= 1)
fprintf_filtered (stream, "<invalid address>");
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),
+ cp_print_value_fields (baseclass, thistype, base_valaddr,
+ thisoffset + boffset, address, stream, format,
+ recurse, pretty,
+ ((struct type **)
+ obstack_base (&dont_print_vb_obstack)),
0);
fputs_filtered (", ", stream);
@@ -604,10 +617,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;
}
}
@@ -622,13 +635,12 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
have the same meanings as in c_val_print. */
static void
-cp_print_static_field (type, val, stream, format, recurse, pretty)
- struct type *type;
- value_ptr val;
- GDB_FILE *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
+cp_print_static_field (struct type *type,
+ struct value *val,
+ struct ui_file *stream,
+ int format,
+ int recurse,
+ enum val_prettyprint pretty)
{
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
@@ -636,15 +648,16 @@ 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)
{
if (VALUE_ADDRESS (val) == first_dont_print[i])
{
- fputs_filtered ("<same as static member of an already seen type>",
+ fputs_filtered ("<same as static member of an already"
+ " seen type>",
stream);
return;
}
@@ -654,22 +667,21 @@ cp_print_static_field (type, val, stream, format, recurse, pretty)
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
- cp_print_value_fields (type, type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
+ cp_print_value_fields (type, type, VALUE_CONTENTS_ALL (val),
+ VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, recurse, pretty, NULL, 1);
return;
}
- val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
+ val_print (type, VALUE_CONTENTS_ALL (val),
+ VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, 0, recurse, pretty);
}
void
-cp_print_class_member (valaddr, domain, stream, prefix)
- char *valaddr;
- struct type *domain;
- GDB_FILE *stream;
- char *prefix;
+cp_print_class_member (char *valaddr, struct type *domain,
+ struct ui_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. */
@@ -685,8 +697,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++)
{
@@ -712,7 +724,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, "::");
@@ -723,7 +735,7 @@ cp_print_class_member (valaddr, domain, stream, prefix)
fprintf_filtered (stream, " (offset in bits)");
}
else
- fprintf_filtered (stream, "%d", val >> 3);
+ fprintf_filtered (stream, "%ld", (long) (val >> 3));
}
@@ -738,17 +750,13 @@ 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;
+cp_print_hpacc_virtual_table_entries (struct type *type, int *vfuncs,
+ struct value *v, struct ui_file *stream,
+ int format, int recurse,
+ enum val_prettyprint pretty)
{
int fn, oi;
@@ -756,48 +764,54 @@ 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);
-
+ 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;
+ const char *field_physname;
+
+ /* virtual function offset */
+ int vx = (TYPE_FN_FIELD_VOFFSET (TYPE_FN_FIELDLIST1 (type, fn), oi)
+ - 1);
+
+ /* Get the address of the vfunction entry */
+ struct value *vf = value_copy (v);
+ if (VALUE_LAZY (vf))
+ (void) value_fetch_lazy (vf);
+ /* adjust by offset */
+ vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
+ 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);
+ field_physname
+ = TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi);
+ /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */
+ vf_name = cplus_demangle (field_physname, DMGL_ARM);
+ fprintf_filtered (stream, " %s", vf_name);
+ if (--(*vfuncs) > 0)
+ fputs_filtered (", ", stream);
+ }
}
void
-_initialize_cp_valprint ()
+_initialize_cp_valprint (void)
{
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);
@@ -805,14 +819,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);
@@ -822,5 +836,5 @@ _initialize_cp_valprint ()
obstack_begin (&dont_print_vb_obstack, 32 * sizeof (struct type *));
obstack_specify_allocation (&dont_print_statmem_obstack,
32 * sizeof (CORE_ADDR), sizeof (CORE_ADDR),
- xmalloc, free);
+ xmalloc, xfree);
}
diff --git a/contrib/gdb/gdb/dbug-rom.c b/contrib/gdb/gdb/dbug-rom.c
new file mode 100644
index 0000000..f315557
--- /dev/null
+++ b/contrib/gdb/gdb/dbug-rom.c
@@ -0,0 +1,161 @@
+/* Remote debugging interface to dBUG ROM monitor for GDB, the GNU debugger.
+ Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Written by Stan Shebs of Cygnus Support.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* dBUG is a monitor supplied on various Motorola boards, including
+ m68k, ColdFire, and PowerPC-based designs. The code here assumes
+ the ColdFire, and (as of 9/25/96) has only been tested with a
+ ColdFire IDP board. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "monitor.h"
+#include "serial.h"
+#include "regcache.h"
+
+static void dbug_open (char *args, int from_tty);
+
+static void
+dbug_supply_register (char *regname, int regnamelen, char *val, int vallen)
+{
+ int regno;
+
+ if (regnamelen != 2)
+ return;
+
+ switch (regname[0])
+ {
+ case 'S':
+ if (regname[1] != 'R')
+ return;
+ regno = PS_REGNUM;
+ break;
+ case 'P':
+ if (regname[1] != 'C')
+ return;
+ regno = PC_REGNUM;
+ break;
+ case 'D':
+ if (regname[1] < '0' || regname[1] > '7')
+ return;
+ regno = regname[1] - '0' + D0_REGNUM;
+ break;
+ case 'A':
+ if (regname[1] < '0' || regname[1] > '7')
+ return;
+ regno = regname[1] - '0' + A0_REGNUM;
+ break;
+ default:
+ return;
+ }
+
+ monitor_supply_register (regno, val);
+}
+
+/* This array of registers needs to match the indexes used by GDB. The
+ whole reason this exists is because the various ROM monitors use
+ different names than GDB does, and don't support all the registers
+ either. So, typing "info reg sp" becomes an "A7". */
+
+static char *dbug_regnames[NUM_REGS] =
+{
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC"
+ /* no float registers */
+};
+static struct target_ops dbug_ops;
+static struct monitor_ops dbug_cmds;
+
+static char *dbug_inits[] =
+{"\r", NULL};
+
+
+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 */
+
+static void
+dbug_open (char *args, int from_tty)
+{
+ monitor_open (args, &dbug_cmds, from_tty);
+}
+
+void
+_initialize_dbug_rom (void)
+{
+ init_dbug_cmds ();
+ init_monitor_ops (&dbug_ops);
+
+ dbug_ops.to_shortname = "dbug";
+ dbug_ops.to_longname = "dBUG monitor";
+ dbug_ops.to_doc = "Debug via the dBUG monitor.\n\
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+ dbug_ops.to_open = dbug_open;
+
+ add_target (&dbug_ops);
+}
diff --git a/contrib/gdb/gdb/dcache.c b/contrib/gdb/gdb/dcache.c
index a97a940..6e74274 100644
--- a/contrib/gdb/gdb/dcache.c
+++ b/contrib/gdb/gdb/dcache.c
@@ -1,7 +1,6 @@
-/* Caching code. Typically used by remote back ends for
- caching remote memory.
-
- Copyright 1992, 1993, 1995, 1998 Free Software Foundation, Inc.
+/* Caching code.
+ Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,22 +16,20 @@
You should have received a copy of the GNU General Public 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"
#include "gdbcmd.h"
#include "gdb_string.h"
#include "gdbcore.h"
+#include "target.h"
-/*
- The data cache could lead to incorrect results because it doesn't know
- about volatile variables, thus making it impossible to debug
- functions which use memory mapped I/O devices.
-
- set remotecache 0
-
- In those cases.
+/* The data cache could lead to incorrect results because it doesn't
+ know about volatile variables, thus making it impossible to debug
+ functions which use memory mapped I/O devices. Set the nocache
+ memory region attribute in those cases.
In general the dcache speeds up performance, some speed improvement
comes from the actual caching mechanism, but the major gain is in
@@ -61,8 +58,10 @@
ENTRY_DIRTY means that the byte has some data in it which should be
written out to the remote target one day, but contains correct
- data. ENTRY_OK means that the data is the same in the cache as it
- is in remote memory.
+ data.
+
+ ENTRY_OK means that the data is the same in the cache as it is in
+ remote memory.
The ENTRY_DIRTY state is necessary because GDB likes to write large
@@ -76,107 +75,119 @@
protocol overhead. This way, all those little writes are bundled
up into an entire cache line write in one go, without having to
read the cache line in the first place.
+ */
+/* NOTE: Interaction of dcache and memory region attributes
- */
+ As there is no requirement that memory region attributes be aligned
+ to or be a multiple of the dcache page size, dcache_read_line() and
+ dcache_write_line() must break up the page by memory region. If a
+ chunk does not have the cache attribute set, an invalid memory type
+ is set, etc., then the chunk is skipped. Those chunks are handled
+ in target_xfer_memory() (or target_xfer_memory_partial()).
+ This doesn't occur very often. The most common occurance is when
+ the last bit of the .text segment and the first bit of the .data
+ segment fall within the same dcache page with a ro/cacheable memory
+ region defined for the .text segment and a rw/non-cacheable memory
+ region defined for the .data segment. */
/* This value regulates the number of cache blocks stored.
Smaller values reduce the time spent searching for a cache
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;
+/* FIXME: dcache_struct used to have a cache_has_stuff field that was
+ used to record whether the cache had been accessed. This was used
+ to invalidate the cache whenever caching was (re-)enabled (if the
+ cache was disabled and later re-enabled, it could contain stale
+ data). This was not needed because the cache is write through and
+ the code that enables, disables, and deletes memory region all
+ invalidate the cache.
- /* Function to actually write the target memory */
- memxferfunc write_memory;
+ This is overkill, since it also invalidates cache lines from
+ unrelated regions. One way this could be addressed by adding a
+ new function that takes an address and a length and invalidates
+ only those cache lines that match. */
- /* free list */
- struct dcache_block *free_head;
- struct dcache_block *free_tail;
+struct dcache_struct
+ {
+ /* 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;
-} ;
+static int dcache_poke_byte (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 (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 (DCACHE *dcache, CORE_ADDR addr);
-static struct dcache_block *dcache_hit PARAMS ((DCACHE *dcache,
- CORE_ADDR addr));
+static int dcache_write_line (DCACHE *dcache, struct dcache_block *db);
-static int dcache_write_line PARAMS ((DCACHE *dcache,struct dcache_block *db));
+static int dcache_read_line (DCACHE *dcache, struct dcache_block *db);
-static struct dcache_block *dcache_alloc PARAMS ((DCACHE *dcache));
+static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr);
-static int dcache_writeback PARAMS ((DCACHE *dcache));
+static int dcache_writeback (DCACHE *dcache);
-static void dcache_info PARAMS ((char *exp, int tty));
+static void dcache_info (char *exp, int tty);
-void _initialize_dcache PARAMS ((void));
+void _initialize_dcache (void);
-int remote_dcache = 0;
+static int dcache_enabled_p = 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. */
void
-dcache_flush (dcache)
- DCACHE *dcache;
+dcache_invalidate (DCACHE *dcache)
{
int i;
dcache->valid_head = 0;
@@ -197,8 +208,6 @@ dcache_flush (dcache)
db->p = 0;
}
- dcache->cache_has_stuff = 0;
-
return;
}
@@ -206,9 +215,7 @@ dcache_flush (dcache)
containing it. */
static struct dcache_block *
-dcache_hit (dcache, addr)
- DCACHE *dcache;
- CORE_ADDR addr;
+dcache_hit (DCACHE *dcache, CORE_ADDR addr)
{
register struct dcache_block *db;
@@ -217,7 +224,7 @@ dcache_hit (dcache, addr)
while (db)
{
- if (MASK(addr) == db->addr)
+ if (MASK (addr) == db->addr)
{
db->refs++;
return db;
@@ -232,63 +239,152 @@ dcache_hit (dcache, addr)
be written is. */
static int
-dcache_write_line (dcache, db)
- DCACHE *dcache;
- register struct dcache_block *db;
+dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
{
- int s;
- int e;
- s = 0;
- if (db->anydirty)
+ CORE_ADDR memaddr;
+ char *myaddr;
+ int len;
+ int res;
+ int reg_len;
+ struct mem_region *region;
+
+ if (!db->anydirty)
+ return 1;
+
+ len = LINE_SIZE;
+ memaddr = db->addr;
+ myaddr = db->data;
+
+ while (len > 0)
{
- for (s = 0; s < LINE_SIZE; s++)
+ int s;
+ int e;
+ int dirty_len;
+
+ region = lookup_mem_region(memaddr);
+ if (memaddr + len < region->hi)
+ reg_len = len;
+ else
+ reg_len = region->hi - memaddr;
+
+ if (!region->attrib.cache || region->attrib.mode == MEM_RO)
+ {
+ memaddr += reg_len;
+ myaddr += reg_len;
+ len -= reg_len;
+ continue;
+ }
+
+ while (reg_len > 0)
{
- if (db->state[s] == ENTRY_DIRTY)
+ s = XFORM(memaddr);
+ while (reg_len > 0) {
+ if (db->state[s] == ENTRY_DIRTY)
+ break;
+ s++;
+ reg_len--;
+
+ memaddr++;
+ myaddr++;
+ len--;
+ }
+
+ e = s;
+ while (reg_len > 0) {
+ if (db->state[e] != ENTRY_DIRTY)
+ break;
+ e++;
+ reg_len--;
+ }
+
+ dirty_len = e - s;
+ while (dirty_len > 0)
{
- int len = 0;
- 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;
- }
- memset (db->state + s, ENTRY_OK, len);
- s = e;
- }
+ res = do_xfer_memory(memaddr, myaddr, dirty_len, 1,
+ &region->attrib);
+ if (res <= 0)
+ return 0;
+
+ memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
+ memaddr += res;
+ myaddr += res;
+ len -= res;
+ dirty_len -= res;
}
}
- db->anydirty = 0;
}
+
+ db->anydirty = 0;
return 1;
}
+/* Read cache line */
+static int
+dcache_read_line (DCACHE *dcache, struct dcache_block *db)
+{
+ CORE_ADDR memaddr;
+ char *myaddr;
+ int len;
+ int res;
+ int reg_len;
+ struct mem_region *region;
+
+ /* If there are any dirty bytes in the line, it must be written
+ before a new line can be read */
+ if (db->anydirty)
+ {
+ if (!dcache_write_line (dcache, db))
+ return 0;
+ }
+
+ len = LINE_SIZE;
+ memaddr = db->addr;
+ myaddr = db->data;
+
+ while (len > 0)
+ {
+ region = lookup_mem_region(memaddr);
+ if (memaddr + len < region->hi)
+ reg_len = len;
+ else
+ reg_len = region->hi - memaddr;
+
+ if (!region->attrib.cache || region->attrib.mode == MEM_WO)
+ {
+ memaddr += reg_len;
+ myaddr += reg_len;
+ len -= reg_len;
+ continue;
+ }
+
+ while (reg_len > 0)
+ {
+ res = do_xfer_memory (memaddr, myaddr, reg_len, 0,
+ &region->attrib);
+ if (res <= 0)
+ return 0;
+
+ memaddr += res;
+ myaddr += res;
+ len -= res;
+ reg_len -= res;
+ }
+ }
+
+ memset (db->state, ENTRY_OK, sizeof (db->data));
+ db->anydirty = 0;
+
+ return 1;
+}
/* Get a free cache block, put or keep it on the valid list,
- and return its address. The caller should store into the block
- the address and data that it describes, then remque it from the
- free list and insert it into the valid list. This procedure
- prevents errors from creeping in if a memory retrieval is
- interrupted (which used to put garbage blocks in the valid
- list...). */
+ and return its address. */
static struct dcache_block *
-dcache_alloc (dcache)
- DCACHE *dcache;
+dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
{
register struct dcache_block *db;
- if (remote_dcache == 0)
- abort ();
-
/* Take something from the free list */
db = dcache->free_head;
if (db)
@@ -299,11 +395,18 @@ dcache_alloc (dcache)
{
/* Nothing left on free list, so grab one from the valid list */
db = dcache->valid_head;
- dcache->valid_head = db->p;
- dcache_write_line (dcache, db);
+ if (!dcache_write_line (dcache, db))
+ return NULL;
+
+ dcache->valid_head = db->p;
}
+ db->addr = MASK(addr);
+ db->refs = 0;
+ db->anydirty = 0;
+ memset (db->state, ENTRY_BAD, sizeof (db->data));
+
/* append this line to end of valid list */
if (!dcache->valid_head)
dcache->valid_head = db;
@@ -315,55 +418,9 @@ dcache_alloc (dcache)
return db;
}
-/* Using the data cache DCACHE return the contents of the byte at
- address ADDR in the remote machine.
-
- Returns 0 on error. */
-
+/* Writeback any dirty lines. */
static int
-dcache_peek_byte (dcache, addr, ptr)
- DCACHE *dcache;
- CORE_ADDR addr;
- char *ptr;
-{
- register struct dcache_block *db = dcache_hit (dcache, addr);
- int ok=1;
- int done = 0;
- if (db == 0
- || db->state[XFORM (addr)] == ENTRY_BAD)
- {
- if (db)
- {
- dcache_write_line (dcache, db);
- }
- else
- db = dcache_alloc (dcache);
- immediate_quit++;
- db->addr = MASK (addr);
- while (done < LINE_SIZE)
- {
- int try =
- (*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;
- }
- *ptr = db->data[XFORM (addr)];
- return ok;
-}
-
-/* Writeback any dirty lines to the remote. */
-static int
-dcache_writeback (dcache)
- DCACHE *dcache;
+dcache_writeback (DCACHE *dcache)
{
struct dcache_block *db;
@@ -379,19 +436,31 @@ dcache_writeback (dcache)
}
-/* Using the data cache DCACHE return the contents of the word at
- address ADDR in the remote machine. */
-int
-dcache_fetch (dcache, addr)
- DCACHE *dcache;
- CORE_ADDR addr;
+/* Using the data cache DCACHE return the contents of the byte at
+ address ADDR in the remote machine.
+
+ Returns 0 on error. */
+
+static int
+dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
{
- int res;
+ register struct dcache_block *db = dcache_hit (dcache, addr);
- if (dcache_xfer_memory (dcache, addr, (char *)&res, sizeof res, 0) != sizeof res)
- memory_error (EIO, addr);
+ if (!db)
+ {
+ db = dcache_alloc (dcache, addr);
+ if (!db)
+ return 0;
+ }
+
+ if (db->state[XFORM (addr)] == ENTRY_BAD)
+ {
+ if (!dcache_read_line(dcache, db))
+ return 0;
+ }
- return res;
+ *ptr = db->data[XFORM (addr)];
+ return 1;
}
@@ -400,18 +469,15 @@ dcache_fetch (dcache, addr)
*/
static int
-dcache_poke_byte (dcache, addr, ptr)
- DCACHE *dcache;
- CORE_ADDR addr;
- char *ptr;
+dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
{
register struct dcache_block *db = dcache_hit (dcache, addr);
if (!db)
{
- db = dcache_alloc (dcache);
- db->addr = MASK (addr);
- memset (db->state, ENTRY_BAD, sizeof (db->data));
+ db = dcache_alloc (dcache, addr);
+ if (!db)
+ return 0;
}
db->data[XFORM (addr)] = *ptr;
@@ -420,45 +486,35 @@ dcache_poke_byte (dcache, addr, ptr)
return 1;
}
-/* Write the word at ADDR both in the data cache and in the remote machine.
- Return zero on write error.
- */
-
-int
-dcache_poke (dcache, addr, data)
- DCACHE *dcache;
- CORE_ADDR addr;
- int data;
-{
- if (dcache_xfer_memory (dcache, addr, (char *)&data, sizeof data, 1) != sizeof data)
- return 0;
-
- return dcache_writeback (dcache);
-}
-
-
/* Initialize the data cache. */
DCACHE *
-dcache_init (reading, writing)
- memxferfunc reading;
- memxferfunc writing;
+dcache_init (void)
{
int csize = sizeof (struct dcache_block) * DCACHE_SIZE;
DCACHE *dcache;
dcache = (DCACHE *) xmalloc (sizeof (*dcache));
- dcache->read_memory = reading;
- dcache->write_memory = writing;
dcache->the_cache = (struct dcache_block *) xmalloc (csize);
memset (dcache->the_cache, 0, csize);
- dcache_flush (dcache);
+ dcache_invalidate (dcache);
last_cache = dcache;
return dcache;
}
+/* Free a data cache */
+void
+dcache_free (DCACHE *dcache)
+{
+ if (last_cache == dcache)
+ last_cache = NULL;
+
+ xfree (dcache->the_cache);
+ xfree (dcache);
+}
+
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
nonzero.
@@ -468,87 +524,76 @@ dcache_init (reading, writing)
This routine is indended to be called by remote_xfer_ functions. */
int
-dcache_xfer_memory (dcache, memaddr, myaddr, len, should_write)
- DCACHE *dcache;
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int should_write;
+dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, char *myaddr, int len,
+ int should_write)
{
int i;
+ int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, char *ptr);
+ xfunc = should_write ? dcache_poke_byte : dcache_peek_byte;
- if (remote_dcache)
+ for (i = 0; i < len; i++)
{
- 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++)
- {
- if (!xfunc (dcache, memaddr + i, myaddr + i))
- return 0;
- }
- dcache->cache_has_stuff = 1;
- dcache_writeback (dcache);
+ if (!xfunc (dcache, memaddr + i, myaddr + i))
+ return 0;
}
- else
- {
- memxferfunc xfunc;
- xfunc = should_write ? dcache->write_memory : dcache->read_memory;
-
- if (dcache->cache_has_stuff)
- dcache_flush (dcache);
- len = xfunc (memaddr, myaddr, len);
- }
+ /* FIXME: There may be some benefit from moving the cache writeback
+ to a higher layer, as it could occur after a sequence of smaller
+ writes have been completed (as when a stack frame is constructed
+ for an inferior function call). Note that only moving it up one
+ level to target_xfer_memory() (also target_xfer_memory_partial())
+ is not sufficent, since we want to coalesce memory transfers that
+ are "logically" connected but not actually a single call to one
+ of the memory transfer functions. */
+
+ if (should_write)
+ dcache_writeback (dcache);
+
return len;
}
-static void
-dcache_info (exp, tty)
- char *exp;
- int tty;
+static void
+dcache_info (char *exp, int tty)
{
struct dcache_block *p;
- if (!remote_dcache)
- {
- printf_filtered ("Dcache not enabled\n");
- return;
- }
- printf_filtered ("Dcache enabled, line width %d, depth %d\n",
+ printf_filtered ("Dcache line width %d, depth %d\n",
LINE_SIZE, DCACHE_SIZE);
- printf_filtered ("Cache state:\n");
-
- for (p = last_cache->valid_head; p; p = p->p)
+ if (last_cache)
{
- int j;
- printf_filtered ("Line at %08xd, referenced %d times\n",
- p->addr, p->refs);
+ printf_filtered ("Cache state:\n");
- for (j = 0; j < LINE_SIZE; j++)
- printf_filtered ("%02x", p->data[j] & 0xFF);
- printf_filtered ("\n");
+ for (p = last_cache->valid_head; p; p = p->p)
+ {
+ int j;
+ printf_filtered ("Line at %s, referenced %d times\n",
+ paddr (p->addr), p->refs);
+
+ for (j = 0; j < LINE_SIZE; j++)
+ printf_filtered ("%02x", p->data[j] & 0xFF);
+ printf_filtered ("\n");
- for (j = 0; j < LINE_SIZE; j++)
- printf_filtered (" %2x", p->state[j]);
- printf_filtered ("\n");
+ for (j = 0; j < LINE_SIZE; j++)
+ printf_filtered ("%2x", p->state[j]);
+ printf_filtered ("\n");
+ }
}
}
void
-_initialize_dcache ()
+_initialize_dcache (void)
{
add_show_from_set
(add_set_cmd ("remotecache", class_support, var_boolean,
- (char *) &remote_dcache,
+ (char *) &dcache_enabled_p,
"\
Set cache use for remote targets.\n\
When on, use data caching for remote targets. For many remote targets\n\
this option can offer better throughput for reading target memory.\n\
Unfortunately, gdb does not currently know anything about volatile\n\
registers and thus data caching will produce incorrect results with\n\
-volatile registers are in use. By default, this option is on.",
+volatile registers are in use. By default, this option is off.",
&setlist),
&showlist);
diff --git a/contrib/gdb/gdb/dcache.h b/contrib/gdb/gdb/dcache.h
index a0b762a..5f9da65 100644
--- a/contrib/gdb/gdb/dcache.h
+++ b/contrib/gdb/gdb/dcache.h
@@ -1,50 +1,43 @@
/* Declarations for caching. Typically used by remote back ends for
caching remote memory.
- Copyright 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1995, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 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));
-
-/* Flush DCACHE. */
-void dcache_flush PARAMS((DCACHE *dcache));
+/* Invalidate DCACHE. */
+void dcache_invalidate (DCACHE *dcache);
/* Initialize DCACHE. */
-DCACHE *dcache_init PARAMS((memxferfunc reading, memxferfunc writing));
+DCACHE *dcache_init (void);
-/* 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));
+/* Free a DCACHE */
+void dcache_free (DCACHE *);
/* 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 (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));
#endif /* DCACHE_H */
diff --git a/contrib/gdb/gdb/dink32-rom.c b/contrib/gdb/gdb/dink32-rom.c
index c0c2e51..f62e712 100644
--- a/contrib/gdb/gdb/dink32-rom.c
+++ b/contrib/gdb/gdb/dink32-rom.c
@@ -1,39 +1,39 @@
/* Remote debugging interface for DINK32 (PowerPC) ROM monitor for
GDB, the GNU debugger.
- Copyright 1997 Free Software Foundation, Inc.
+ Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcore.h"
#include "target.h"
#include "monitor.h"
#include "serial.h"
+#include "symfile.h" /* For generic_load() */
+#include "inferior.h" /* For write_pc() */
+#include "regcache.h"
-static void dink32_open PARAMS ((char *args, int from_tty));
+static void dink32_open (char *args, int from_tty);
static void
-dink32_supply_register (regname, regnamelen, val, vallen)
- char *regname;
- int regnamelen;
- char *val;
- int vallen;
+dink32_supply_register (char *regname, int regnamelen, char *val, int vallen)
{
- int regno = 0, base = 0;
+ int regno = 0;
if (regnamelen < 2 || regnamelen > 4)
return;
@@ -97,20 +97,15 @@ dink32_supply_register (regname, regnamelen, val, vallen)
}
static void
-dink32_load (monops, filename, from_tty)
- struct monitor_ops *monops;
- char *filename;
- int from_tty;
+dink32_load (struct monitor_ops *monops, char *filename, int from_tty)
{
- extern int inferior_pid;
-
generic_load (filename, from_tty);
/* 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_ptid = null_ptid; /* No process now */
}
@@ -119,37 +114,36 @@ dink32_load (monops, filename, from_tty)
different names than GDB does, and don't support all the registers
either. */
-static char *dink32_regnames[NUM_REGS] =
+static char *dink32_regnames[] =
{
- "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;
static void
-dink32_open (args, from_tty)
- char *args;
- int from_tty;
+dink32_open (char *args, int from_tty)
{
monitor_open (args, &dink32_cmds, from_tty);
}
void
-_initialize_dink32_rom ()
+_initialize_dink32_rom (void)
{
dink32_cmds.flags = MO_HEX_PREFIX | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR | MO_HANDLE_NL | MO_32_REGS_PAIRED | MO_SETREG_INTERACTIVE | MO_SETMEM_INTERACTIVE | MO_GETMEM_16_BOUNDARY | MO_CLR_BREAK_1_BASED | MO_SREC_ACK | MO_SREC_ACK_ROTATE;
dink32_cmds.init = dink32_inits;
@@ -157,7 +151,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 +170,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 >>";
diff --git a/contrib/gdb/gdb/doc/ChangeLog b/contrib/gdb/gdb/doc/ChangeLog
index 1e03a80..51606f5 100644
--- a/contrib/gdb/gdb/doc/ChangeLog
+++ b/contrib/gdb/gdb/doc/ChangeLog
@@ -1,3 +1,1115 @@
+2002-04-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbint.texinfo (Releasing GDB, Coding): Fix typos. Reported by
+ "Theodore A. Roth" <troth@verinet.com>.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Bug Reporting): Document that the web is the
+ prefered way of submitting bug reports.
+ (Bug Reporting): Delete the s-mail address as the last resort.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdb.info): Add explicit path to gdb.texinfo.
+ Remove reference to 3.12.
+
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo: Include fdl.texi.
+ (Top): Add GNU Free Documentation License.
+ * Makefile.in (SFILES_INCLUDED): Add gpl.texi.
+ (gdbint.dvi, gdbint.pdf, gdbint.info): Add dependency on fdl.texi.
+ (gdbint_toc.html): Add dependency on gdb-cfg.texi and fdl.texi.
+ (gdbint.info): Add srcdir to include path.
+ * gdb.texinfo: Include gpl.texi.
+ (Top): Add Copying.
+ * gpl.texi: New file.
+
+2002-02-23 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Debugging GDB): Remove references to cygnus.com.
+
+2002-02-19 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * gdb.texinfo: Document Cygwin native specific commands.
+
+2002-02-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.texinfo: Document gdbserver ``--attach'' command.
+
+2002-02-07 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (overlays): Change @var(_ovly_debug_event)
+ to @code(_ovly_debug_event).
+
+2002-02-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (How Overlays Work): Shrink the overlay diagram.
+
+2002-02-06 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (overlays): Mention new magic symbol
+ '_ovly_debug_event', which allows GDB to keep better track
+ of overlays.
+
+2002-02-03 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Memory Region Attributes): Fix the wording.
+ Suggested by Dmitry Sivachenko.
+
+ * (<many nodes>): Fix the spelling and punctuation of "i.e.".
+
+2002-02-01 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (set trust-readonly): Change value{gdbn} to value{GDBN}.
+
+2002-01-30 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo: (remote protocol): Gramatical fix-up.
+ (set trust-readonly-sections): Document.
+
+2002-01-29 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Revise and update.
+
+2002-01-28 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ description of TARGET_BYTE_ORDER_DEFAULT.
+
+2002-01-27 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: Fix typos and markup. From Dmitry Sivachenko
+ <mitya@cavia.pp.ru>.
+
+2002-01-23 Andrew Cagney <ac131313@redhat.com>
+
+ * libgdb.texinfo: Delete file.
+
+2002-01-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo: Remove makeinfo 3.12 hacks.
+ * gdbint.texinfo: Ditto.
+
+Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo: Fix typo ``Remove' -> ``Remote''.
+
+2002-01-22 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Update copyright.
+ (TEXI2DVI): Define.
+ (gdb.dvi, gdb.pdf, stabs.dvi, stabs.pdf): Use TEXI2DVI.
+ (gdbint.dvi, gdbint.pdf): Use TEXI2DVI. Add dependency on
+ gdb-cfg.texi.
+ (TEXINDEX, PDFTEX): Delete makefile variables.
+
+2002-01-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Protocol): Move section to appendix.
+
+2002-01-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Remote Debugging): Create a menu.
+ (Top): Add ``Remote Debugging'' to menu.
+
+2002-01-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Remote): Move the sub-section ``The GDB remote
+ serial protocol'' from here.
+ (Remote Debugging): To here. New chapter.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ description of TARGET_BYTE_ORDER_SELECTABLE_P.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Host Definition): Revise. xm-xyz.h and xyz.mh
+ are no longer needed.
+ (Porting GDB): Add maintainer note about configure.host.
+
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Remove
+ definition of IEEE_FLOAT.
+
+2002-01-20 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: Beautify copyright years; fix a typo.
+ (DJGPP Native): Fix overfull hboxes in examples. From Brian Youmans
+ <3diff@gnu.org>
+
+2002-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Host Definition): Remove references to
+ MALLOC_INCOMPATIBLE.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Host Definition): Remove references to XDEPFILES
+ and xyz-xdep.o.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Maintenance Commands): Add appendix.
+ (Set Breaks): Copy ``maint info breakpoint'' doco to
+ ``Maintenance Commands'' appendix. Add reference.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * fdl.texi: Remove next/prev from @node.
+
+2002-01-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: @include fdl.texi. Fixes for overfull hboxes and
+ for monstrous @multitable (from Brian Youmans).
+
+ * fdl.texi: New file.
+
+ * Makefile.in (SFILES_INCLUDED): Add fdl.texi.
+
+2002-01-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): New chapter.
+
+2002-01-14 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Embedded Processors, Calling program functions):
+ Obsolete references to a29k.
+
+2002-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Coding): Review Cleanups section. Examples
+ examples. Document that a code-block should do or discard its
+ cleanups before exit.
+
+2002-01-11 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (Choosing files): Change @samp to @file.
+
+2002-01-05 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (--pid): Document new command line option (attach).
+
+2002-01-07 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Tracepoints): Clarify that tracepoints need support
+ in the stub.
+
+2002-01-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ BIG_ENDIAN with BFD_ENDIAN_BIG.
+
+2002-01-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ value_ptr with struct value pointer.
+
+2002-01-02 Eli Zaretskii <eliz@gnu.org>
+
+ * gdb.texinfo (Free Software): Fix wording.
+
+2001-12-31 Eli Zaretskii <eliz@gnu.org>
+
+ * gdb.texinfo (Free Software): New section ``Free Software Needs
+ Free Documentation''.
+
+2001-12-30 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * stabs.texinfo:
+ * gdb.texinfo:
+ * gdbint.texinfo:
+ * libgdb.texinfo:
+ * annotate.texi: Fix the application of GFDL in the Copyright notice.
+
+2001-12-29 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (maint info sections): Fix typo.
+
+2001-12-26 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (maint info sections): Document.
+
+ * gdb.texinfo (info proc): Comment out documentation for
+ 'info proc' sub-options that are currently not implemented.
+
+2001-12-20 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (TARGET_CHAR_SIGNED): Document.
+
+2001-12-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ LITTLE_ENDIAN with BFD_ENDIAN_LITTLE.
+
+2001-12-01 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Host Definition): Delete documentation on
+ HOST_BYTE_ORDER.
+
+2001-11-30 Jim Blandy <jimb@redhat.com>
+
+ * gdb.texinfo (Overlays): New chapter, documenting GDB's
+ overlay support. Add to top-level menu.
+
+2001-11-26 Tom Tromey <tromey@redhat.com>
+
+ * gdb.texinfo (Command Syntax): Document C-o binding.
+
+2001-07-26 Christopher Faylor <cgf@redhat.com>
+
+ * gdb.texinfo (Options): Eliminate attempt to explain .gdbinit/gdb.ini
+ use since it is described in the referenced section.
+
+ From Eli Zaretskii <eliz@is.elta.co.il>
+ * gdb.texinfo (Command Files): Reword to make gdb.ini requirement
+ clearer when using DJGPP.
+
+2001-11-24 Christopher Faylor <cgf@redhat.com>
+
+ * gdb.texinfo (File Options): Change description of -nx and gdb.ini to
+ specifically refer to MS-DOS.
+ (command files): Mention gdb.ini is only used on MS-DOS.
+
+2001-11-21 Tom Tromey <tromey@redhat.com>
+
+ * gdb.texinfo (Invoking GDB): Document --args.
+ (Mode Options): Likewise.
+
+2001-11-21 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT):
+ Delete documentation; this macro has been removed from the
+ sources.
+
+2001-11-13 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (COERCE_FLOAT_TO_DOUBLE): Clarify.
+
+2001-11-06 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.texinfo (gdbarch_in_function_epilogue_p): Add documentation.
+
+2001-11-05 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (info functions): Document use of backslash to
+ quote regexp chars in function names such as "operator*()".
+
+2001-11-01 Fred Fish <fnf@redhat.com>
+
+ * gdbint.texinfo (SOLIB_ADD): Document additional new
+ "readsyms" arg.
+
+2001-10-30 Don Howard <dhoward@redhat.com>
+
+ * gdb.texinfo: (Command Files) Added documentation for the
+ behavior of gdb with input redirected from a file.
+
+2001-10-28 Fred Fish <fnf@redhat.com>
+
+ * gdb.texinfo (auto-solib-add): Change docs to match
+ implementation change.
+ (auto-solib-limit): Add docs for new variable.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Function
+ value_as_pointer renamed to value_as_address.
+
+2001-10-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Default
+ POINTER_TO_ADDRESS functions assume unsigned addresses.
+ (INTEGER_TO_ADDRESS): Document. Derive pragmatics section from a
+ posting by Jim Blandy.
+
+2001-10-12 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (MAKEHTMLFLAGS): Remove -glossary; the most recent
+ version of texi2html (1.64) doesn't support this flag any more.
+
+2001-09-08 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbint.texinfo (Host Definition): Remove description of
+ MEM_FNS_DECLARED.
+
+ * gdbint.texinfo (Host Definition): Remove description of R_OK.
+
+ * gdbint.texinfo (Host Definition): Remove description of
+ HAVE_SIGSETMASK.
+
+2001-09-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Add
+ explanation of TARGET_PRINT_INSN macro.
+
+2001-08-30 Jim Blandy <jimb@redhat.com>
+
+ * gdb.texinfo (`add-symbol-file'): Correct synopsis.
+ Explain what it means to load relocatable files.
+
+2001-08-28 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo: Bring the HTML `top' menu into sync with the
+ info `top' menu.
+
+Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * gdbint.texinfo: Add a cautionary note about macro use.
+
+2001-08-02 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.texinfo: Explain omitting the hostname in the
+ `target remote' command.
+
+2001-07-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbint.texinfo: Remove extraneous START-INFO-DIR-ENTRY
+ and END-INFO-DIR-ENTRY.
+
+2001-07-28 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gdb.texinfo (TUI Configuration): Rename tui configuration variables.
+
+2001-07-25 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (libgdb): Rewrite.
+
+2001-07-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (gdbgui.dvi, gdb-gui, gdbgui.info): Targets deleted.
+
+2001-07-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gdb.texinfo (TUI): New chapter, document the TUI.
+ (Mode Options): Document the -tui option.
+
+2001-07-23 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbint.texinfo (Host Definition): Remove description of
+ NEED_POSIX_SETPGID.
+
+2001-07-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.tex (DJGPP Native): New node, with descriptions of
+ DJGPP-specific commands.
+
+2001-07-19 John R. Moore <jmoore@redhat.com>
+
+ * gdbint.texinfo: Three misspellings.
+
+2001-07-06 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (refcard.dvi): Rewrite to avoid problems with empty
+ `test` expressions on bash. Problem reported by Colin Walters.
+
+2001-07-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (User Interface): Update ui-out documentation to
+ refelect recent UI/MI updates.
+
+2001-07-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Mode Options): Mention the mi0 and mi1
+ interpreters.
+
+2001-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): GDBARCH is a C
+ structure and not macros.
+ (Host Definition): Document that much of this chapter is obsolete.
+ (Target Architecture Definition): Update list of files that make
+ up a target architecture.
+ (Coding): Update.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Update
+ EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_STRUCT_VALUE_ADDRESS_P.
+ The latter has been changed to a true predicate.
+
+2001-06-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * annotate.texi: Add @noindent where needed. From Dmitry
+ Sivachenko <dima@Chg.RU>.
+ * gdb.texinfo: Indexing fix. From Dmitry Sivachenko.
+
+2001-06-16 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Protocol): Fix typo. Extra parenthesis.
+
+2001-06-14 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Remote Protocol): Document that the ``!'' packet
+ returns ``OK''. Document that the ``R'' packet does not reply.
+
+2001-06-13 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo (Protocol): Add doc for new packet "qSymbol:".
+
+2001-06-13 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Signals): Clarify the default setting of signal
+ handling.
+
+2001-05-14 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (CLEAR_DEFERRED_STORES): Delete stray @item
+ (FRAME_ARGS_ADDRESS_CORRECT): Ditto.
+
+2001-05-12 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (GDBvn.texi): Set GDBVN from ../version.in.
+
+2001-05-10 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbint.texinfo (Clean Design and Portable Implementation):
+ Renamed from "Clean Design".
+ (Clean Design and Portable Implementation): Document portable
+ methods of handling file names, and the associated macros.
+
+2001-04-02 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Tracepoint Actions): Mention the "info scope"
+ command and provide a cross-reference to its description.
+ (Symbols): Note that "info scope" is useful for trace experiments.
+
+2001-04-01 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Symbols): Document "info scope".
+ (Tracepoints): New chapter.
+ (Contributors): Update for v5.1.
+ <All nodes>: Change "C++" to "C@t{++}".
+
+ * gdbint.texinfo (User Interface): A new section about ui_out
+ functions, based on text written by Fernando Nasser.
+
+ * stabs.texinfo: Change Permissions to GFDL. Update Copyright.
+
+2001-03-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: Change Permissions to GFDL. Update Copyright.
+
+ * gdbint.texinfo: Change Permissions to GFDL. Update Copyright.
+
+ * gdbgui.texinfo: Change Permissions to GFDL. Update Copyright.
+ Replace "GDB" with "@value{GDBN}". Fix markup.
+
+ * annotate.texi: Change Permissions to GFDL. Update Copyright.
+
+ * gdb.texinfo (Output Formats): Mention "info symbol" and provide
+ a cross-reference to its description.
+ (Symbols): Document "info symbol".
+
+2001-03-21 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbint.texinfo (Algorithms): New section "Watchpoints" and new
+ subsection "x86 Watchpoints".
+ (Target Architecture Definition): Document the macros
+ I386_USE_GENERIC_WATCHPOINTS and TARGET_HAS_HARDWARE_WATCHPOINTS.
+ (Native Debugging): Document I386_USE_GENERIC_WATCHPOINTS.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Update
+ definition of SOFTWARE_SINGLE_STEP_P to include empty parameter
+ list.
+
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in, all-cfg.texi, annotate.texi, gdb.texinfo,
+ gdbint.texinfo, refcard.tex: Update/correct copyright notices.
+
+2001-02-21 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Signals): Document "ignore", "noignore", and "all".
+
+2001-02-11 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Environment): Document that `path' does not change
+ the value of PATH in GDB's own environment (it did in the past,
+ but that was changed on March 15, 1994). Reported by Doug Evans
+ <dje@transmeta.com>.
+
+ * gdbint.texinfo: Fix up @itemize lists so that @item is alone on
+ its line. Fix markup of commands and macros. Add an Index node
+ and index entries.
+
+2001-01-23 J.T. Conklin <jtc@redback.com>
+
+ * gdb.texinfo (Memory region attributes): New manual section.
+
+2001-01-04 Nicholas Duffek <nsd@redhat.com>
+
+ * gdbint.texinfo (POP_FRAME): Document use by return_command.
+
+2000-12-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * refcard.tex: Version and copyright fixed. From Phil Edwards
+ <pedwards@disaster.jaj.com>.
+
+Thu Nov 30 16:57:19 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (ECOFF_REG_TO_REGNUM, DWARF_REG_TO_REGNUM,
+ DWARF2_REG_TO_REGNUM): Document.
+
+Mon Nov 20 21:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (Coding): Update current value of
+ --enable-build-warnings. Mention --enable-gdb-build-warnings.
+
+2000-11-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Continuing and Stepping): Fixed markup and typos,
+ as suggested by Dmitry Sivachenko <dima@Chg.RU>.
+
+2000-11-10 Christopher Faylor <cgf@cygnus.com>
+
+ * gdb.texinfo: Document new 'set step-mode' command.
+
+2000-10-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Contributors, MIPS Embedded): Minor spelling
+ changes from Dmitry Sivachenko <dima@Chg.RU>.
+
+2000-09-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Hooks): Document the new post-hook functionality.
+ From Steven Johnson <sbjohnson@ozemail.com.au>.
+
+2000-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbint.texinfo (Overall Structure): Spelling fix.
+
+2000-08-10 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbint.texinfo (Target Architecture Definition): Document that
+ REGISTER_CONVERT_TO_VIRTUAL should only be called on a register
+ for which REGISTER_CONVERTIBLE returns a zero value.
+
+2000-07-08 Christopher Faylor <cgf@cygnus.com>
+
+ * Makefile.in (install-info): Find files to install in either the
+ build or source directories (adapted from Makefile.am).
+
+2000-07-07 Nicholas Duffek <nsd@redhat.com>
+
+ * stabs.texinfo: Fix spelling errors.
+ (String Field): FILE-NUMBER starts from 0, not 1.
+
+2000-07-05 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * refcard.tex: Remove \centerline from the blurb. Patch from
+ Brian Youmans.
+
+2000-06-25 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (install-info): Support installation from outside of
+ the source directory. Reported by Mark Harig
+ <markh@frazier.landmark.com>.
+
+2000-06-20 J.T. Conklin <jtc@redback.com>
+
+ * gdb.texinfo: Fix typo, $bpnum is set to last breakpoint number.
+
+Fri May 26 15:55:33 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (pdf, gdbint.pdf, gdb.pdf, stabs.pdf): New targets.
+ Generate using pdftex.
+ (PDFTEX): Define.
+ (STAGESTUFF, maintainer-clean realclean): Add *.pdf.
+ (gdb.texinfo, gdbint.texinfo, stabs.texinfo): When TeX insert the
+ @contents at the start.
+
+2000-05-24 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: Remove duplicate @syncodeindex. From Brian
+ Youmans.
+
+Wed May 24 21:27:58 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Brian Youmans:
+ * gdb.texinfo: Fix ``et al.''.
+
+Tue May 23 22:57:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (refcard.dvi): Remove quotes around REFEDITS in for
+ loop.
+
+2000-05-19 Jimmy Guo <guo@cup.hp.com>
+
+ * configure: Regenerate.
+
+2000-05-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (install-info): Run install-info on installed Info
+ files.
+
+Fri May 12 20:18:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo: Add Stan Shebs, et.al. as authors. Mention
+ Andrew Cagney.
+
+2000-05-09 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo: Proofreading changes from Brian Youmans.
+
+2000-05-01 Nick Duffek <nsd@cygnus.com>
+
+ * gdb.texinfo (Command Files): Mention -x, use @enumerate for
+ startup sequence, minor edits.
+
+2000-05-01 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * annotate.texi: Remove "@syncodeindex fn cp", it causes grief in
+ TeX.
+
+ * gdb.texinfo: Add "@syncodeindex fn cp". Convert all entries
+ "@kindex f" into "@kindex f (foo)", otherwise we get index entries
+ like `n' and `s' which look weird. Convert some of the @kindex to
+ @vindex, when they refer to variables, not commands.
+
+Sat Apr 29 17:01:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (Hints): Do not use @value{GDBN in @nodes.
+
+2000-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (GDBMI_DIR): New variable.
+ (SET_TEXINPUTS): Add $(GDBMI_DIR).
+ (SFILES_DOC): Add $(GDBMI_DIR)/gdbmi.texinfo.
+ (gdbmi.texinfo): New target, for texi2roff.
+ (gdb.me, gdb.ms, gdb.mm): Depend on gdbmi.texinfo.
+ (gdb.info, gdb_toc.html): Add "-I ${GDBMI_DIR}".
+
+ * gdb.texinfo (Top): Add GDB/MI to the main menu and @include
+ gdbmi.texinfo.
+ (Mode Options): Add xref to GDB/MI docs and remove a FIXME
+ comment.
+
+2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.texinfo (Files): Update description of add-symbol-file
+ command.
+
+2000-04-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Porting GDB): Don't use @value in the node name, it
+ prevents the build (and is generally a Bad Idea).
+
+2000-04-17 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Protocol): Prevent makeinfo from complaining about
+ a comma inside @var.
+ (Command Files): Index markup changes from Dmitry Sivachenko
+ <dima@Chg.RU>.
+
+2000-04-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.in (LN_S): Define.
+ (gdb-cfg.texi, gdb.dvi, links2roff, inc-hist.texinfo): Don't
+ invoke "ln -s" unless it is known to work.
+
+ * configure.in (AC_PROG_LN_S): Add.
+
+2000-04-14 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (Pointers Are Not Always Addresses): New manual
+ section.
+ (Target Conditionals): Document ADDRESS_TO_POINTER,
+ POINTER_TO_ADDRESS.
+
+2000-04-11 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdbint.texinfo: Replaced GDB with @value{GDBN}, @include
+ gdb-cfg.texi to get the value.
+
+2000-04-10 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Fix
+ cross-references.
+
+2000-04-08 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (Using Different Register and Memory Data
+ Representations): New section.
+ (REGISTER_CONVERTIBLE, REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE,
+ REGISTER_VIRTUAL_TYPE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Document.
+
+Mon Apr 3 19:16:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo (Protocol): Deprecate the sequence-id. Add cindex
+ for acknowledgments.
+
+Tue Mar 28 18:28:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo (Protocol): Replace ``qfThreadExtraInfo'' with
+ qThreadExtraInfo.
+
+2000-03-28 J.T. Conklin <jtc@redback.com>
+
+ * gdb.texinfo: Clarify which remote debug protocol commands are
+ required and which are optional.
+
+Tue Mar 28 16:06:22 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo: Revert remainder of Fri Mar 24 18:06:34 2000 Andrew
+ Cagney <cagney@b1.cygnus.com>. Move @chapter and @node entries
+ back to annotate.texi, rluser.texinfo and inc-hist.texinfo.
+ * annotate.texi: Update.
+
+2000-03-28 Stan Shebs <shebs@apple.com>
+
+ * gdb.texinfo: Update dates, bump to Eighth Edition (note
+ expectation of additional changes before release), update
+ ISBN, add copy of top-level menu for @ifhtml, remove explicit
+ node links, rephrase and/or shorten lines to fix formatting
+ problem in both regular and @smallbook formats.
+ * annotate.texi: Shorten lines in example, use smallexample
+ consistently everywhere.
+ * Makefile.in: Add comment about texinfo 4.0 html generation.
+ (SFILES_INCLUDED): Add annotate.texi.
+
+2000-03-27 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdb.texinfo (Debugging Output): Added new section, documenting
+ the "set/show debug" commands.
+
+Fri Mar 24 18:06:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * annotate.texi (Annotations): When GDBN omit @chapter and @node
+ entry.
+
+ * gdb.texinfo: Check for @ifinfo instead of @ifnottex.
+ (rluser.texinfo, inc-hist.texinfo, annotate.texi): Add local
+ @chapter and @node entries.
+
+ * gdb.texinfo: Link all top-level nodes.
+
+Fri Mar 24 17:56:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (install-info): Create $(infodir) before installing
+ files.
+
+2000-03-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From David Whedon <dwhedon@gordian.com>
+ * gdbint.texinfo : Added paragraphs about command deprecation.
+
+2000-03-22 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdb.texinfo: Add documentation for the apropos command.
+
+2000-03-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * gdb.texinfo: Add new queries ThreadInfo and ThreadExtraInfo.
+
+2000-03-20 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * gdb.texinfo: Add white space to prevent overprinting in
+ two places.
+
+2000-03-17 Stan Shebs <shebs@apple.com>
+
+ * gdb.texinfo: Many minor changes from Dmitry Sivachenko
+ <dima@Chg.RU>, also clarification of allowed content for
+ string constants.
+
+2000-03-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (main menu): Add Annotations.
+ (File Options): Add @cindex entries for each command-line option.
+ Document --epoch, --annotate, --async, --interpreter, --write,
+ --statistics, and --version.
+
+ * annotate.texi: Convert to a chapter. Use @value{GDBN} instead
+ of GDB.
+
+2000-02-23 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo (FUNCTION_START_OFFSET): Document.
+
+2000-02-22 Jim Blandy <jimb@redhat.com>
+
+ * gdbint.texinfo: Document COERCE_FLOAT_TO_DOUBLE --- the new form.
+
+2000-02-15 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in (diststuff): New target.
+
+2000-02-15 Kevin Buettner <kevinb@redhat.com>
+
+ * agentexpr.texi: Fix wording regarding Intel's IA-64
+ architecture. [From Jim Wilson.]
+
+2000-01-16 Tom Tromey <tromey@cygnus.com>
+
+ * gdb.texinfo (Breakpoints): Mention breakpoint ranges.
+ (Delete Breaks): Mention range arguments.
+ (Disabling): Likewise.
+
+2000-01-05 Dmitry Sivachenko <dima@Chg.RU>
+
+ * gdb.texinfo: Wrap "ASCII" in @sc{}; clarify a few sentences.
+
+Wed Dec 8 19:53:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (FRAME_CHAIN_VALID): Add the generic frame-chain
+ valid functions.
+
+1999-11-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.texinfo: Clarify regular expressions used in rbreak.
+
+1999-10-15 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdbint.texinfo (MEMORY_INSERT_BREAKPOINT,
+ MEMORY_REMOVE_BREAKPOINT): Document.
+
+Thu Oct 14 21:17:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo (remote): Document how GDB ignores the qOffsets BSS
+ offset re-using the DATA offset instead.
+
+1999-10-11 Jim Kingdon <kingdon@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Add PARM_BOUNDARY.
+
+1999-10-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Dmitry Sivachenko <demon@gpad.ac.ru>:
+ * gdb.texinfo: Use GDBP and GDBN everywhere, fix a couple other
+ typos.
+
+ * gdb.texinfo: Various minor wording and formatting improvements,
+ mentions of additional command-line options.
+
+1999-09-30 Fred Fish <fnf@cygnus.com>
+
+ * gdb.texinfo: Document additional forms of specifying section
+ names and addresses for the add-symbol-file command.
+
+1999-09-14 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * gdbint.texinfo: Fix typo, add the word "have".
+
+1999-09-14 Jim Blandy <jimb@cris.red-bean.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Document the
+ SKIP_PERMANENT_BREAKPOINT macro.
+
+1999-09-07 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.texinfo: Fiks speling errers.
+
+ * gdb.texinfo: Fix uses of @multitable.
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * gdb.texinfo: Include details specific to DOS host, clarify
+ some confusing language, fix @ref/@xref/@pxref usages, add
+ comments about using with optimization, add more indexing,
+ fix info about disassembly-flavor.
+
+Tue Sep 7 09:11:24 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdbint.texinfo (IN_SOLIB_DYNSYM_RESOLVE_CODE,
+ SKIP_SOLIB_RESOLVER): Define.
+
+Fri Sep 3 18:05:14 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.texinfo (Protocol): Review. Add tables describing ``q'' and
+ ``g'' packets.
+
+1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.texinfo: Create a new "Configurations" chapter with
+ platform-specific info, inline remote.texi and move sections of it
+ into the new chapter, move bits about info proc, heuristic search,
+ and register stack into the new chapter.
+ * remote.texi: Remove, now part of gdb.texinfo.
+ * Makefile.in (SFILES_INCLUDED): Remove ref to remote.texi.
+
+1999-08-27 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gdbint.texinfo (GDB_TARGET_IS_SUN3, GDB_TARGET_IS_SUN386,
+ GDB_TARGET_IS_MACH386): These kludges have gone away.
+
+Wed Aug 25 10:47:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Mention
+ TDEPLIBS.
+
+1999-08-20 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.texinfo: Remove remaining "HPPA" conditionals, rewrite
+ surrounding text to fit HP-UX bits into general info.
+ (HPPA-cfg.texi): Remove, no longer useful.
+
+ * gdb.texinfo: Remove explicit links from @node lines, remove
+ HP-added "Detailed Node Listing" from main menu which confuses
+ things.
+
+ From Dmitry Sivachenko <dima@Chg.RU>:
+ * gdb.texinfo: Use @value{GDBN} instead of plain GDB, fix grouping
+ in description of `set environment'.
+
+1999-08-17 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbint.texinfo: Update coding standard to allow pure ANSI/ISO C.
+
+1999-08-12 Ben Elliston <bje@cygnus.com>
+
+ * gdbint.texinfo (Breakpoint Handling): Add missing words.
+
+1999-08-10 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdb.texinfo (Set Watchpoints): Explain some subtleties about
+ watch, awatch, and rwatch. Explain why the latter two cannot be
+ set as software watchpoints. Document that watchpoints for local
+ variables are deleted when the debuggee terminates.
+
+Wed Aug 11 13:18:14 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * remote.texi (Protocol): Further clarification of the "qRcmd"
+ packet. Allow E.. response packet. "qRcmd" packet is no longer
+ reserved.
+
+1999-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * Makefile.in: Rename inc-hist.texi to inc-hist.texinfo.
+ * gdb.texinfo: Ditto.
+
+1999-08-06 Tom Tromey <tromey@cygnus.com>
+
+ * gdb.texinfo (KOD): New node.
+
+Fri Aug 6 17:05:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.texi (Rcmd): Fix minor formatting typos.
+
+Thu Aug 5 17:57:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.texi (protocol qRcmd): Allow ``OK'' and ``O...'' response
+ packets.
+
+1999-07-14 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdbint.texinfo (PREPARE_TO_PROCEED, ADDR_BITS_REMOVE): Doc
+ fixes.
+
+Tue Jun 29 11:43:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (SAVE_DUMMY_FRAME_TOS): Define.
+
+Fri Jun 25 11:47:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.texi (Communication Protocol): ``v'' is in use. Fix
+ numerous formatting errors. Clarify ``i''. Mark ``i'', ``Z'',
+ ``z'' and ``qRcmd'' as draft instead of reserved. Identify
+ packets that are not supported on all hosts. Expand examples.
+ Spell check.
+
+1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in: Recognize html, install-html. Add targets
+ to build HTML versions of documentation via texi2html.
+
+Thu Jun 24 15:59:03 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbint.texinfo (Testsuite): New chapter, information about the
+ testsuite.
+
+Fri Jun 25 02:40:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.texi (Communication Protocol): Rewrite.
+
+Thu Jun 24 16:59:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * stabs.texinfo: Fix uses of xref.
+
+Thu Jun 17 17:23:25 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbint.texinfo: Add an anti-printf exhortation, and update the
+ info about patch submission.
+
+Mon Jun 7 15:49:40 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Per Bothner <bothner@cygnus.com>:
+ * gdb.texinfo: Document Chill support.
+
+Fri Jun 4 16:58:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (SP_REGNUM, FP_REGNUM, PC_REGNUM): Add reference
+ to corresponding TARGET_READ_reg TARGET_WRITE_reg macros.
+ Document that the value should be greater-than or equal-to zero.
+ (NO_STD_REGS): Document. Deprecate.
+
+Tue Jun 1 15:04:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT):
+ Document that these are not used.
+
+Thu May 27 09:28:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (EXTRACT_STRUCT_VALUE_ADDRESS_P): Document.
+
+Mon May 24 10:07:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (FRAME_NUM_ARGS): Update definition. Parameter
+ numargs was dropped.
+
+Thu May 20 12:26:59 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (FRAMELESS_FUNCTION_INVOCATION): Update.
+
+Tue Apr 27 19:14:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
+ Update.
+
+Thu Apr 22 13:07:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (USE_GENERIC_DUMMY_FRAMES): Document.
+ (GET_SAVED_REGISTER): Update, not just the a29k uses this.
+
+Wed Apr 21 13:59:01 1999 Dave Brolley <brolley@cygnus.com>
+
+ * gdbint.texinfo: Fix typos: $ -> @.
+
+Tue Apr 20 11:59:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (REGISTER_NAMES, BREAKPOINT, BIG_BREAKPOINT,
+ LITTLE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT,
+ BIG_REMOTE_BREAKPOINT): Deprecate in favor of REGISTER_NAME and
+ BREAKPOINT_FROM_PC.
+
+Mon Apr 12 16:00:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (CALL_DUMMY_STACK_ADJUST_P,
+ CALL_DUMMY_STACK_ADJUST): Document.
+
+Thu Apr 8 17:23:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (CALL_DUMMY_P, CALL_DUMMY_WORDS,
+ SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY): Define.
+
+1999-04-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbint.texinfo (MAINTENANCE_CMDS): Remove ref, since it no
+ longer exists.
+
+Tue Mar 9 19:25:11 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.texinfo, remote.texi, all-cfg.texi, HPPA-cfg.texi: Remove
+ nearly all @ifset/@ifclear conditionals; nobody uses them, and
+ they make the manual source incomprehensible.
+ * h8-cfg.texi: Remove, hasn't been used in years.
+
Thu Feb 11 18:00:59 1999 Stan Shebs <shebs@andros.cygnus.com>
* gdb.texinfo: Update the credits.
@@ -383,6 +1495,10 @@ Tue Jan 17 14:09:03 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
* remote.texi: Update documentation of set/show mipsfpu.
+Fri Jan 6 17:17:28 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbgui.texinfo: New file, manual for GUI (gdbtk) users.
+ * Makefile.in (gdbgui.dvi, gdbgui.info): New actions.
Sun Sep 4 16:47:21 1994 Stan Shebs (shebs@andros.cygnus.com)
@@ -1466,7 +2582,7 @@ Thu Dec 5 22:46:12 1991 K. Richard Pixley (rich at rtl.cygnus.com)
Local Variables:
-mode: indented-text
+mode: change-log
left-margin: 8
fill-column: 74
version-control: never
diff --git a/contrib/gdb/gdb/doc/Makefile.in b/contrib/gdb/gdb/doc/Makefile.in
index 4bcd62e..3b549b8 100644
--- a/contrib/gdb/gdb/doc/Makefile.in
+++ b/contrib/gdb/gdb/doc/Makefile.in
@@ -1,4 +1,5 @@
-##Copyright (C) 1991, 1992, 1999 Free Software Foundation, Inc.
+##Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002
+##Free Software Foundation, Inc.
# Makefile for GDB documentation.
# This file is part of GDB.
@@ -23,9 +24,12 @@ VPATH = @srcdir@
prefix = @prefix@
infodir = @infodir@
+htmldir = $(prefix)/html
SHELL = @SHELL@
+LN_S = @LN_S@
+
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
@@ -39,14 +43,31 @@ TEXIDIR=${gdbdir}/../texinfo
# where to find makeinfo, preferably one designed for texinfo-2
MAKEINFO=makeinfo
+# Note that texinfo 4.0's makeinfo --html can only generate a
+# single file, which would be too large, so continue to use
+# texi2html. -sts 2000-03-28
+
+MAKEHTML = texi2html
+MAKEHTMLFLAGS = -menu -split_chapter
+
# where to find texi2roff, ditto
TEXI2ROFF=texi2roff
+# where to find texi2dvi, ditto
+TEXI2DVI=texi2dvi
+
# Where is the source dir for the READLINE library doc?
# Traditionally readline is in .. or .
READLINE_DIR = ${gdbdir}/../readline/doc
-SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS
+# The GDB/MI docs come from a sibling directory ../mi
+GDBMI_DIR = ${gdbdir}/mi
+
+SET_TEXINPUTS = \
+ TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
+
+# Files which should be generated via 'info' and installed by 'install-info'
+INFO_DEPS = gdb.info gdbint.info stabs.info
# There may be alternate predefined collections of switches to configure
# the GDB manual. Normally this is not done in synch with the software
@@ -72,36 +93,59 @@ REFEDITS =
# Don Knuth's TeX formatter
TEX = tex
-# auxiliary program for sorting Texinfo indices
-TEXINDEX = texindex
-
# Program to generate Postscript files from DVI files.
DVIPS = dvips
# Main GDB manual's source files
-SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/remote.texi
+SFILES_INCLUDED = gdb-cfg.texi \
+ $(srcdir)/annotate.texi \
+ $(srcdir)/fdl.texi \
+ $(srcdir)/gpl.texi
SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
-SFILES_DOC = $(SFILES_LOCAL) \
- $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi
+SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \
+ $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo
#### Host, target, and site specific Makefile fragments come in here.
###
all install:
-info: gdb.info gdbint.info stabs.info
+info: $(INFO_DEPS)
dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
ps: gdb.ps gdbint.ps stabs.ps refcard.ps
-all-doc: info dvi ps
-
-install-info: info
- for i in *.info* ; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i ; \
+html: gdb_toc.html gdbint_toc.html stabs_toc.html
+pdf: gdb.pdf gdbint.pdf stabs.pdf
+all-doc: info dvi ps # pdf
+diststuff: info
+
+install-info: $(INFO_DEPS)
+ $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+ if test -f $$d/$$ifile; then \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ else : ; fi; \
+ done; \
+ done
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
+ install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ done; \
+ else : ; fi
+
+install-html: html
+ for i in *.html ; do \
+ $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
done
-STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi
+STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
# Copy the object files from a particular stage into a subdirectory.
stage1: force
@@ -142,7 +186,7 @@ mostlyclean:
rm -f sedref.dvi sedref.tex tmp.sed
clean: mostlyclean
- rm -f rluser.texinfo inc-hist.texi gdb-cfg.texi
+ rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi
distclean: clean
rm -f Makefile config.status
@@ -152,18 +196,16 @@ distclean: clean
# "clean" or "distclean". Use maintainer-clean to remove them.
maintainer-clean realclean: distclean
- rm -f GDBvn.texi *.info* *.dvi *.ps
+ rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf
# GDB QUICK REFERENCE (dvi output)
refcard.dvi : refcard.tex $(REFEDITS)
- if [ -z "$(REFEDITS)" ]; then \
- cp $(srcdir)/refcard.tex sedref.tex ; \
- else \
- echo > tmp.sed ; \
- for f in "$(REFEDITS)" ; do \
- cat $(srcdir)/$$f >>tmp.sed ; done ; \
- sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \
- fi
+ echo > tmp.sed
+ for f in x $(REFEDITS) ; do \
+ test x$$f = xx && continue ; \
+ cat $(srcdir)/$$f >>tmp.sed ; \
+ done
+ sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
$(SET_TEXINPUTS) $(TEX) sedref.tex
mv sedref.dvi refcard.dvi
rm -f sedref.log sedref.tex tmp.sed
@@ -171,9 +213,9 @@ refcard.dvi : refcard.tex $(REFEDITS)
refcard.ps : refcard.dvi
$(DVIPS) -t landscape -o $@ $?
-# File to record current GDB version number (copied from main dir Makefile.in)
-GDBvn.texi : ${gdbdir}/Makefile.in
- echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/^VERSION *= *//p'`" > ./GDBvn.new
+# File to record current GDB version number (copied from main dir version.in)
+GDBvn.texi : ${gdbdir}/version.in
+ echo "@set GDBVN `head -1 $(srcdir)/../version.in`" > ./GDBvn.new
mv GDBvn.new GDBvn.texi
# Updated atomically
@@ -184,7 +226,8 @@ GDBvn.texi : ${gdbdir}/Makefile.in
# not one for their binary config---which may not be specifically
# defined anyways).
gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
- ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
+ (test "$$LN_S" = "ln -s" && \
+ ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \
ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \
cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi
@@ -200,24 +243,29 @@ gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi
# GDB MANUAL: TeX dvi file
gdb.dvi: ${SFILES_DOC}
if [ ! -f ./GDBvn.texi ]; then \
- ln -s $(srcdir)/GDBvn.texi . || \
+ (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
ln $(srcdir)/GDBvn.texi . || \
cp $(srcdir)/GDBvn.texi . ; else true; fi
- $(SET_TEXINPUTS) $(TEX) gdb.texinfo
- $(SET_TEXINPUTS) $(TEX) gdb.texinfo
- $(TEXINDEX) gdb.??
- $(SET_TEXINPUTS) $(TEX) gdb.texinfo
+ $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdb.texinfo
rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
gdb.tp* gdb.vr*
gdb.ps: gdb.dvi
$(DVIPS) -o $@ $?
+gdb.pdf: ${SFILES_DOC}
+ if [ ! -f ./GDBvn.texi ]; then \
+ (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \
+ ln $(srcdir)/GDBvn.texi . || \
+ cp $(srcdir)/GDBvn.texi . ; else true; fi
+ $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdb.texinfo
+ rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \
+ gdb.tp* gdb.vr*
+
# GDB MANUAL: info file
-# We're using texinfo2, and older makeinfo's may not be able to
-# cope with all the markup.
gdb.info: ${SFILES_DOC}
- $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo
+ $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) \
+ -o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
# Try to use a recent texi2roff. v2 was put on prep in jan91.
@@ -235,7 +283,7 @@ gdb.info: ${SFILES_DOC}
# in main sourcedir.
links2roff: $(SFILES_INCLUDED)
if [ ! -f gdb.texinfo ]; then \
- ln -s $(SFILES_INCLUDED) . || \
+ (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \
ln $(SFILES_INCLUDED) . || \
cp $(SFILES_INCLUDED) . ; \
fi
@@ -250,13 +298,20 @@ rluser.texinfo: ${READLINE_DIR}/rluser.texinfo
-e 's/^@end ftable/@end table/g' \
${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo
-inc-hist.texi: ${READLINE_DIR}/inc-hist.texi
- ln -s ${READLINE_DIR}/inc-hist.texi . || \
- ln ${READLINE_DIR}/inc-hist.texi . || \
- cp ${READLINE_DIR}/inc-hist.texi .
+inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo
+ (test "$$LN_S" = "ln -s" && \
+ ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \
+ ln ${READLINE_DIR}/inc-hist.texinfo . || \
+ cp ${READLINE_DIR}/inc-hist.texinfo .
+
+gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo
+ (test "$$LN_S" = "ln -s" && \
+ ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \
+ ln ${GDBMI_DIR}/gdbmi.texinfo . || \
+ cp ${GDBMI_DIR}/gdbmi.texinfo .
# gdb manual suitable for [gtn]roff -me
-gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
+gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
@@ -271,7 +326,7 @@ gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
>gdb.me
# gdb manual suitable for [gtn]roff -ms
-gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
+gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
@@ -288,7 +343,7 @@ gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
# gdb manual suitable for [tn]roff -mm
# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
-gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
+gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo
sed -e '/\\input texinfo/d' \
-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
-e '/^@ifinfo/,/^@end ifinfo/d' \
@@ -303,37 +358,57 @@ gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
sed -e 's/---/\\(em/g' \
>gdb.mm
+# GDB MANUAL: HTML file
+
+gdb_toc.html: ${SFILES_DOC}
+ $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
# GDB INTERNALS MANUAL: TeX dvi file
-gdbint.dvi : gdbint.texinfo
- $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
- $(TEXINDEX) gdbint.??
- $(SET_TEXINPUTS) $(TEX) gdbint.texinfo
+gdbint.dvi: gdbint.texinfo gdb-cfg.texi fdl.texi
+ $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/gdbint.texinfo
rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
gdbint.ps : gdbint.dvi
$(DVIPS) -o $@ $?
+gdbint.pdf: gdbint.texinfo gdb-cfg.texi fdl.texi
+ $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/gdbint.texinfo
+ rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \
+ gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr*
+
# GDB INTERNALS MANUAL: info file
-gdbint.info: gdbint.texinfo
- $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
+gdbint.info: gdbint.texinfo fdl.texi
+ $(MAKEINFO) -I $(srcdir) -o gdbint.info $(srcdir)/gdbint.texinfo
+
+# GDB INTERNALS MANUAL: HTML file
+
+gdbint_toc.html: gdbint.texinfo gdb-cfg.texi fdl.texi
+ $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
stabs.info: stabs.texinfo
$(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
+# STABS DOCUMENTATION: HTML file
+
+stabs_toc.html: stabs.texinfo
+ $(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
+
# STABS DOCUMENTATION: TeX dvi file
stabs.dvi : stabs.texinfo
- $(SET_TEXINPUTS) $(TEX) stabs.texinfo
- $(TEXINDEX) stabs.??
- $(SET_TEXINPUTS) $(TEX) stabs.texinfo
+ $(SET_TEXINPUTS) $(TEXI2DVI) $(srcdir)/stabs.texinfo
rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
stabs.ps: stabs.dvi
$(DVIPS) -o $@ $?
+stabs.pdf: stabs.dvi
+ $(SET_TEXINPUTS) $(TEXI2DVI) --pdf $(srcdir)/stabs.texinfo
+ rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \
+ stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr*
+
force:
Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status
diff --git a/contrib/gdb/gdb/doc/agentexpr.texi b/contrib/gdb/gdb/doc/agentexpr.texi
index 8484aa2..e49232c 100644
--- a/contrib/gdb/gdb/doc/agentexpr.texi
+++ b/contrib/gdb/gdb/doc/agentexpr.texi
@@ -798,7 +798,7 @@ When we add side-effects, we should add this.
@item Why does the @code{reg} bytecode take a 16-bit register number?
-Intel's IA64-architecture, Merced, has 128 general-purpose registers,
+Intel's IA-64 architecture has 128 general-purpose registers,
and 128 floating-point registers, and I'm sure it has some random
control registers.
diff --git a/contrib/gdb/gdb/doc/all-cfg.texi b/contrib/gdb/gdb/doc/all-cfg.texi
index 74d8090..6dee4e4 100644
--- a/contrib/gdb/gdb/doc/all-cfg.texi
+++ b/contrib/gdb/gdb/doc/all-cfg.texi
@@ -1,5 +1,5 @@
@c GDB MANUAL configuration file.
-@c Copyright (c) 1993 Free Software Foundation, Inc.
+@c Copyright 1993, 1995, 1999 Free Software Foundation, Inc.
@c
@c NOTE: While the GDB manual is configurable (by changing these
@c switches), its configuration is ***NOT*** automatically tied in to
@@ -21,76 +21,9 @@
@c HP PA-RISC target ONLY:
@clear HPPA
@c
-@c Hitachi H8/300 target:
-@set H8
-@c Hitachi H8/300 target ONLY:
-@clear H8EXCLUSIVE
-@c
-@c remote MIPS target:
-@set MIPS
-@c
-@c SPARC target:
-@set SPARC
-@set SPARCLET
-@c
-@c AMD 29000 target:
-@set AMD29K
-@c
-@c Intel 960 target:
-@set I960
-@c
-@c Tandem ST2000 (phone switch) target:
-@set ST2000
-@c
-@c Zilog 8000 target:
-@set Z8K
-@c
-@c Wind River Systems VxWorks environment:
-@set VXWORKS
-@c
-@c ----------------------------------------------------------------------
-@c DOC FEATURE FLAGS:
-@c
-@c Bare-board target?
-@clear BARETARGET
-@c
-@c Restrict languages discussed to C?
-@c This is backward. As time permits, change this to language-specific
-@c switches for what to include.
-@clear CONLY
-@c Discuss Fortran?
-@set FORTRAN
-@c
-@c Discuss Modula 2?
-@set MOD2
-@c
-@c Specifically for host machine running DOS?
-@clear DOSHOST
-@c
-@c Talk about CPU simulator targets?
-@set SIMS
-@c
-@c Remote serial line settings of interest?
-@set SERIAL
-@c
-@c Discuss features requiring Posix or similar OS environment?
-@set POSIX
-@c
-@c Discuss remote serial debugging stub?
-@set REMOTESTUB
-@c
-@c Discuss gdbserver?
-@set GDBSERVER
-@c
-@c Discuss gdbserve.nlm?
-@set GDBSERVE
-@c
@c Refrain from discussing how to configure sw and format doc?
@clear PRECONFIGURED
@c
-@c Refrain from referring to unfree publications?
-@set FSFDOC
-@c
@c ----------------------------------------------------------------------
@c STRINGS:
@c
diff --git a/contrib/gdb/gdb/doc/annotate.texi b/contrib/gdb/gdb/doc/annotate.texi
index 9d5850d..59d599b 100644
--- a/contrib/gdb/gdb/doc/annotate.texi
+++ b/contrib/gdb/gdb/doc/annotate.texi
@@ -1,85 +1,83 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename annotate.info
-@settitle GDB Annotations
-@setchapternewpage off
-@c %**end of header
-
-@set EDITION 0.5
-@set DATE May 1994
-
-@ifinfo
-This file documents GDB annotations.
-
-This is Edition @value{EDITION}, @value{DATE}, of @cite{GDB
-Annotations}. Copyright 1994 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@titlepage
-@title GDB Annotations
-@subtitle Edition @value{EDITION}
-@subtitle @value{DATE}
-@author Cygnus Support
-@page
-@vskip 0pt plus 1filll
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Copyright @copyright{} 1994 Free Software Foundation
-@end titlepage
-
-@ifinfo
-@node Top
-@top GDB Annotations
-
-This file describes annotations in GDB, the GNU symbolic debugger.
-Annotations are designed to interface GDB to graphical user interfaces
-or other similar programs which want to interact with GDB at a
+@c \input texinfo @c -*-texinfo-*-
+@c @c %**start of header
+@c @setfilename annotate.info
+@c @settitle GDB Annotations
+@c @setchapternewpage off
+@c @c %**end of header
+
+@c @set EDITION 0.5
+@c @set DATE May 1994
+
+@c @ifinfo
+@c This file documents GDB annotations.
+
+@c This is Edition @value{EDITION}, @value{DATE}, of @cite{GDB
+@c Annotations}. Copyright 1994,1995,2000,2001 Free Software Foundation, Inc.
+
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.1 or
+@c any later version published by the Free Software Foundation; with no
+@c Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
+@c and with the Back-Cover Texts as in (a) below.
+
+@c (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+@c this GNU Manual, like GNU software. Copies published by the Free
+@c Software Foundation raise funds for GNU development.''
+@c @end ifinfo
+
+@c @titlepage
+@c @title GDB Annotations
+@c @subtitle Edition @value{EDITION}
+@c @subtitle @value{DATE}
+@c @author Cygnus Support
+@c @page
+@c @vskip 0pt plus 1filll
+@c Permission is granted to make and distribute verbatim copies of
+@c this manual provided the copyright notice and this permission notice
+@c are preserved on all copies.
+
+@c Copyright @copyright{} 1994,1995,2000,2001 Free Software Foundation
+@c @end titlepage
+
+@c @ifinfo
+@c @node Top
+@c @top GDB Annotations
+
+@c @syncodeindex fn cp
+
+@node Annotations
+@chapter @value{GDBN} Annotations
+
+This chapter describes annotations in @value{GDBN}. Annotations are
+designed to interface @value{GDBN} to graphical user interfaces or
+other similar programs which want to interact with @value{GDBN} at a
relatively high level.
+@ignore
This is Edition @value{EDITION}, @value{DATE}.
+@end ignore
@menu
-* General:: What annotations are; the general syntax.
-* Server:: Issuing a command without affecting user state.
-* Values:: Values are marked as such.
-* Frames:: Stack frames are annotated.
-* Displays:: GDB can be told to display something periodically.
-* Prompting:: Annotations marking GDB's need for input.
+* Annotations Overview:: What annotations are; the general syntax.
+* Server Prefix:: Issuing a command without affecting user state.
+* Value Annotations:: Values are marked as such.
+* Frame Annotations:: Stack frames are annotated.
+* Displays:: @value{GDBN} can be told to display something periodically.
+* Prompting:: Annotations marking @value{GDBN}'s need for input.
* Errors:: Annotations for error messages.
* Breakpoint Info:: Information on breakpoints.
* Invalidation:: Some annotations describe things now invalid.
-* Running:: Whether the program is running, how it stopped, etc.
-* Source:: Annotations describing source code.
+* Annotations for Running::
+ Whether the program is running, how it stopped, etc.
+* Source Annotations:: Annotations describing source code.
* TODO:: Annotations which might be added in the future.
-* Index:: Index
@end menu
-@end ifinfo
-@node General
-@chapter What is an Annotation?
+@node Annotations Overview
+@section What is an Annotation?
+@cindex annotations
-To produce annotations, start GDB with the @code{--annotate=2} option.
+To produce annotations, start @value{GDBN} with the @code{--annotate=2} option.
Annotations start with a newline character, two @samp{control-z}
characters, and the name of the annotation. If there is no additional
@@ -90,20 +88,25 @@ additional information, and a newline. The additional information
cannot contain newline characters.
Any output not beginning with a newline and two @samp{control-z}
-characters denotes literal output from GDB. Currently there is no need
-for GDB to output a newline followed by two @samp{control-z} characters,
-but if there was such a need, the annotations could be extended with an
-@samp{escape} annotation which means those three characters as output.
+characters denotes literal output from @value{GDBN}. Currently there is
+no need for @value{GDBN} to output a newline followed by two
+@samp{control-z} characters, but if there was such a need, the
+annotations could be extended with an @samp{escape} annotation which
+means those three characters as output.
-A simple example of starting up GDB with annotations is:
+A simple example of starting up @value{GDBN} with annotations is:
-@example
+@smallexample
$ gdb --annotate=2
-GDB is free software and you are welcome to distribute copies of it
- under certain conditions; type "show copying" to see the conditions.
-There is absolutely no warranty for GDB; type "show warranty" for details.
-GDB 4.12.3 (sparc-sun-sunos4.1.3),
-Copyright 1994 Free Software Foundation, Inc.
+GNU GDB 5.0
+Copyright 2000 Free Software Foundation, Inc.
+GDB is free software, covered by the GNU General Public License,
+and you are welcome to change it and/or distribute copies of it
+under certain conditions.
+Type "show copying" to see the conditions.
+There is absolutely no warranty for GDB. Type "show warranty"
+for details.
+This GDB was configured as "sparc-sun-sunos4.1.3"
^Z^Zpre-prompt
(gdb)
@@ -112,30 +115,33 @@ quit
^Z^Zpost-prompt
$
-@end example
+@end smallexample
-Here @samp{quit} is input to GDB; the rest is output from GDB. The three
-lines beginning @samp{^Z^Z} (where @samp{^Z} denotes a @samp{control-z}
-character) are annotations; the rest is output from GDB.
+Here @samp{quit} is input to @value{GDBN}; the rest is output from
+@value{GDBN}. The three lines beginning @samp{^Z^Z} (where @samp{^Z}
+denotes a @samp{control-z} character) are annotations; the rest is
+output from @value{GDBN}.
-@node Server
-@chapter The Server Prefix
+@node Server Prefix
+@section The Server Prefix
+@cindex server prefix for annotations
-To issue a command to GDB without affecting certain aspects of the state
-which is seen by users, prefix it with @samp{server }. This means that
-this command will not affect the command history, nor will it affect
-GDB's notion of which command to repeat if @key{RET} is pressed on a
-line by itself.
+To issue a command to @value{GDBN} without affecting certain aspects of
+the state which is seen by users, prefix it with @samp{server }. This
+means that this command will not affect the command history, nor will it
+affect @value{GDBN}'s notion of which command to repeat if @key{RET} is
+pressed on a line by itself.
The server prefix does not affect the recording of values into the value
history; to print a value without recording it into the value history,
use the @code{output} command instead of the @code{print} command.
-@node Values
-@chapter Values
+@node Value Annotations
+@section Values
-When a value is printed in various contexts, GDB uses annotations to
-delimit the value from the surrounding text.
+@cindex annotations for values
+When a value is printed in various contexts, @value{GDBN} uses
+annotations to delimit the value from the surrounding text.
@findex value-history-begin
@findex value-history-value
@@ -143,14 +149,15 @@ delimit the value from the surrounding text.
If a value is printed using @code{print} and added to the value history,
the annotation looks like
-@example
+@smallexample
^Z^Zvalue-history-begin @var{history-number} @var{value-flags}
@var{history-string}
^Z^Zvalue-history-value
@var{the-value}
^Z^Zvalue-history-end
-@end example
+@end smallexample
+@noindent
where @var{history-number} is the number it is getting in the value
history, @var{history-string} is a string, such as @samp{$5 = }, which
introduces the value to the user, @var{the-value} is the output
@@ -162,20 +169,20 @@ a value which can be dereferenced and @samp{-} for a value which cannot.
If the value is not added to the value history (it is an invalid float
or it is printed with the @code{output} command), the annotation is similar:
-@example
+@smallexample
^Z^Zvalue-begin @var{value-flags}
@var{the-value}
^Z^Zvalue-end
-@end example
+@end smallexample
@findex arg-begin
@findex arg-name-end
@findex arg-value
@findex arg-end
-When GDB prints an argument to a function (for example, in the output
+When @value{GDBN} prints an argument to a function (for example, in the output
from the @code{backtrace} command), it annotates it as follows:
-@example
+@smallexample
^Z^Zarg-begin
@var{argument-name}
^Z^Zarg-name-end
@@ -183,8 +190,9 @@ from the @code{backtrace} command), it annotates it as follows:
^Z^Zarg-value @var{value-flags}
@var{the-value}
^Z^Zarg-end
-@end example
+@end smallexample
+@noindent
where @var{argument-name} is the name of the argument,
@var{separator-string} is text which separates the name from the value
for the user's benefit (such as @samp{=}), and @var{value-flags} and
@@ -195,9 +203,9 @@ for the user's benefit (such as @samp{=}), and @var{value-flags} and
@findex field-name-end
@findex field-value
@findex field-end
-When printing a structure, GDB annotates it as follows:
+When printing a structure, @value{GDBN} annotates it as follows:
-@example
+@smallexample
^Z^Zfield-begin @var{value-flags}
@var{field-name}
^Z^Zfield-name-end
@@ -205,42 +213,44 @@ When printing a structure, GDB annotates it as follows:
^Z^Zfield-value
@var{the-value}
^Z^Zfield-end
-@end example
+@end smallexample
+@noindent
where @var{field-name} is the name of the field, @var{separator-string}
is text which separates the name from the value for the user's benefit
(such as @samp{=}), and @var{value-flags} and @var{the-value} have the
same meanings as in a @code{value-history-begin} annotation.
-When printing an array, GDB annotates it as follows:
+When printing an array, @value{GDBN} annotates it as follows:
-@example
+@smallexample
^Z^Zarray-section-begin @var{array-index} @var{value-flags}
-@end example
+@end smallexample
+@noindent
where @var{array-index} is the index of the first element being
annotated and @var{value-flags} has the same meaning as in a
@code{value-history-begin} annotation. This is followed by any number
of elements, where is element can be either a single element:
@findex elt
-@example
+@smallexample
@samp{,} @var{whitespace} ; @r{omitted for the first element}
@var{the-value}
^Z^Zelt
-@end example
+@end smallexample
or a repeated element
@findex elt-rep
@findex elt-rep-end
-@example
+@smallexample
@samp{,} @var{whitespace} ; @r{omitted for the first element}
@var{the-value}
^Z^Zelt-rep @var{number-of-repititions}
@var{repetition-string}
^Z^Zelt-rep-end
-@end example
+@end smallexample
In both cases, @var{the-value} is the output for the value of the
element and @var{whitespace} can contain spaces, tabs, and newlines. In
@@ -253,25 +263,27 @@ user that repitition is being depicted.
Once all the array elements have been output, the array annotation is
ended with
-@example
+@smallexample
^Z^Zarray-section-end
-@end example
+@end smallexample
-@node Frames
-@chapter Frames
+@node Frame Annotations
+@section Frames
-Whenever GDB prints a frame, it annotates it. For example, this applies
-to frames printed when GDB stops, output from commands such as
+@cindex annotations for frames
+Whenever @value{GDBN} prints a frame, it annotates it. For example, this applies
+to frames printed when @value{GDBN} stops, output from commands such as
@code{backtrace} or @code{up}, etc.
@findex frame-begin
The frame annotation begins with
-@example
+@smallexample
^Z^Zframe-begin @var{level} @var{address}
@var{level-string}
-@end example
+@end smallexample
+@noindent
where @var{level} is the number of the frame (0 is the innermost frame,
and other frames have positive numbers), @var{address} is the address of
the code executing in that frame, and @var{level-string} is a string
@@ -280,9 +292,9 @@ designed to convey the level to the user. @var{address} is in the form
does not depend on the language). The frame ends with
@findex frame-end
-@example
+@smallexample
^Z^Zframe-end
-@end example
+@end smallexample
Between these annotations is the main body of the frame, which can
consist of
@@ -290,21 +302,21 @@ consist of
@itemize @bullet
@item
@findex function-call
-@example
+@smallexample
^Z^Zfunction-call
@var{function-call-string}
-@end example
+@end smallexample
where @var{function-call-string} is text designed to convey to the user
-that this frame is associated with a function call made by GDB to a
+that this frame is associated with a function call made by @value{GDBN} to a
function in the program being debugged.
@item
@findex signal-handler-caller
-@example
+@smallexample
^Z^Zsignal-handler-caller
@var{signal-handler-caller-string}
-@end example
+@end smallexample
where @var{signal-handler-caller-string} is text designed to convey to
the user that this frame is associated with whatever mechanism is used
@@ -319,12 +331,12 @@ A normal frame.
This can optionally (depending on whether this is thought of as
interesting information for the user to see) begin with
-@example
+@smallexample
^Z^Zframe-address
@var{address}
^Z^Zframe-address-end
@var{separator-string}
-@end example
+@end smallexample
where @var{address} is the address executing in the frame (the same
address as in the @code{frame-begin} annotation, but printed in a form
@@ -337,17 +349,17 @@ benefit.
@findex frame-args
Then comes
-@example
+@smallexample
^Z^Zframe-function-name
@var{function-name}
^Z^Zframe-args
@var{arguments}
-@end example
+@end smallexample
where @var{function-name} is the name of the function executing in the
frame, or @samp{??} if not known, and @var{arguments} are the arguments
to the frame, with parentheses around them (each argument is annotated
-individually as well @pxref{Values}).
+individually as well, @pxref{Value Annotations}).
@findex frame-source-begin
@findex frame-source-file
@@ -356,7 +368,7 @@ individually as well @pxref{Values}).
@findex frame-source-end
If source information is available, a reference to it is then printed:
-@example
+@smallexample
^Z^Zframe-source-begin
@var{source-intro-string}
^Z^Zframe-source-file
@@ -366,7 +378,7 @@ If source information is available, a reference to it is then printed:
^Z^Zframe-source-line
@var{line-number}
^Z^Zframe-source-end
-@end example
+@end smallexample
where @var{source-intro-string} separates for the user's benefit the
reference from the text which precedes it, @var{filename} is the name of
@@ -374,24 +386,24 @@ the source file, and @var{line-number} is the line number within that
file (the first line is line 1).
@findex frame-where
-If GDB prints some information about where the frame is from (which
+If @value{GDBN} prints some information about where the frame is from (which
library, which load segment, etc.; currently only done on the RS/6000),
it is annotated with
-@example
+@smallexample
^Z^Zframe-where
@var{information}
-@end example
+@end smallexample
Then, if source is to actually be displayed for this frame (for example,
this is not true for output from the @code{backtrace} command), then a
-@code{source} annotation (@pxref{Source}) is displayed. Unlike most
-annotations, this is output instead of the normal text which would be
+@code{source} annotation (@pxref{Source Annotations}) is displayed. Unlike
+most annotations, this is output instead of the normal text which would be
output, not in addition.
@end itemize
@node Displays
-@chapter Displays
+@section Displays
@findex display-begin
@findex display-number-end
@@ -400,10 +412,11 @@ output, not in addition.
@findex display-expression-end
@findex display-value
@findex display-end
-When GDB is told to display something using the @code{display} command,
+@cindex annotations for display
+When @value{GDBN} is told to display something using the @code{display} command,
the results of the display are annotated:
-@example
+@smallexample
^Z^Zdisplay-begin
@var{number}
^Z^Zdisplay-number-end
@@ -417,8 +430,9 @@ the results of the display are annotated:
^Z^Zdisplay-value
@var{value}
^Z^Zdisplay-end
-@end example
+@end smallexample
+@noindent
where @var{number} is the number of the display, @var{number-separator}
is intended to separate the number from what follows for the user,
@var{format} includes information such as the size, format, or other
@@ -428,9 +442,10 @@ to separate the expression from the text that follows for the user,
and @var{value} is the actual value being displayed.
@node Prompting
-@chapter Annotation for GDB Input
+@section Annotation for @value{GDBN} Input
-When GDB prompts for input, it annotates this fact so it is possible
+@cindex annotations for prompts
+When @value{GDBN} prompts for input, it annotates this fact so it is possible
to know when to send output, when the output from a given command is
over, etc.
@@ -442,11 +457,11 @@ annotation which denotes the end of any echo which may (or may not) be
associated with the input. For example, the @code{prompt} input type
features the following annotations:
-@example
+@smallexample
^Z^Zpre-prompt
^Z^Zprompt
^Z^Zpost-prompt
-@end example
+@end smallexample
The input types are
@@ -455,68 +470,69 @@ The input types are
@findex prompt
@findex post-prompt
@item prompt
-When GDB is prompting for a command (the main GDB prompt).
+When @value{GDBN} is prompting for a command (the main @value{GDBN} prompt).
@findex pre-commands
@findex commands
@findex post-commands
@item commands
-When GDB prompts for a set of commands, like in the @code{commands}
+When @value{GDBN} prompts for a set of commands, like in the @code{commands}
command. The annotations are repeated for each command which is input.
@findex pre-overload-choice
@findex overload-choice
@findex post-overload-choice
@item overload-choice
-When GDB wants the user to select between various overloaded functions.
+When @value{GDBN} wants the user to select between various overloaded functions.
@findex pre-query
@findex query
@findex post-query
@item query
-When GDB wants the user to confirm a potentially dangerous operation.
+When @value{GDBN} wants the user to confirm a potentially dangerous operation.
@findex pre-prompt-for-continue
@findex prompt-for-continue
@findex post-prompt-for-continue
@item prompt-for-continue
-When GDB is asking the user to press return to continue. Note: Don't
+When @value{GDBN} is asking the user to press return to continue. Note: Don't
expect this to work well; instead use @code{set height 0} to disable
prompting. This is because the counting of lines is buggy in the
presence of annotations.
@end table
@node Errors
-@chapter Errors
+@section Errors
+@cindex annotations for errors, warnings and interrupts
@findex quit
-@example
+@smallexample
^Z^Zquit
-@end example
+@end smallexample
-This annotation occurs right before GDB responds to an interrupt.
+This annotation occurs right before @value{GDBN} responds to an interrupt.
@findex error
-@example
+@smallexample
^Z^Zerror
-@end example
+@end smallexample
-This annotation occurs right before GDB responds to an error.
+This annotation occurs right before @value{GDBN} responds to an error.
-Quit and error annotations indicate that any annotations which GDB was
+Quit and error annotations indicate that any annotations which @value{GDBN} was
in the middle of may end abruptly. For example, if a
@code{value-history-begin} annotation is followed by a @code{error}, one
cannot expect to receive the matching @code{value-history-end}. One
cannot expect not to receive it either, however; an error annotation
-does not necessarily mean that GDB is immediately returning all the way
+does not necessarily mean that @value{GDBN} is immediately returning all the way
to the top level.
@findex error-begin
A quit or error annotation may be preceded by
-@example
+@smallexample
^Z^Zerror-begin
-@end example
+@end smallexample
Any output between that and the quit or error annotation is the error
message.
@@ -526,18 +542,20 @@ Warning messages are not yet annotated.
@c range_error(), and possibly other places.
@node Breakpoint Info
-@chapter Information on Breakpoints
+@section Information on Breakpoints
+@cindex annotations for breakpoints
The output from the @code{info breakpoints} command is annotated as follows:
@findex breakpoints-headers
@findex breakpoints-table
-@example
+@smallexample
^Z^Zbreakpoints-headers
@var{header-entry}
^Z^Zbreakpoints-table
-@end example
+@end smallexample
+@noindent
where @var{header-entry} has the same syntax as an entry (see below) but
instead of containing data, it contains strings which are intended to
convey the meaning of each field to the user. This is followed by any
@@ -547,7 +565,7 @@ of:
@findex record
@findex field
-@example
+@smallexample
^Z^Zrecord
^Z^Zfield 0
@var{number}
@@ -569,7 +587,7 @@ of:
@var{ignore-count}
^Z^Zfield 9
@var{commands}
-@end example
+@end smallexample
Note that @var{address} is intended for user consumption---the syntax
varies depending on the language.
@@ -577,13 +595,14 @@ varies depending on the language.
The output ends with
@findex breakpoints-table-end
-@example
+@smallexample
^Z^Zbreakpoints-table-end
-@end example
+@end smallexample
@node Invalidation
-@chapter Invalidation Notices
+@section Invalidation Notices
+@cindex annotations for invalidation messages
The following annotations say that certain pieces of state may have
changed.
@@ -601,23 +620,24 @@ The breakpoints may have changed. For example, the user just added or
deleted a breakpoint.
@end table
-@node Running
-@chapter Running the Program
+@node Annotations for Running
+@section Running the Program
+@cindex annotations for running programs
@findex starting
@findex stopping
-When the program starts executing due to a GDB command such as
+When the program starts executing due to a @value{GDBN} command such as
@code{step} or @code{continue},
-@example
+@smallexample
^Z^Zstarting
-@end example
+@end smallexample
is output. When the program stops,
-@example
+@smallexample
^Z^Zstopped
-@end example
+@end smallexample
is output. Before the @code{stopped} annotation, a variety of
annotations describe how the program stopped.
@@ -637,7 +657,7 @@ successful exit, otherwise nonzero).
The program exited with a signal. After the @code{^Z^Zsignalled}, the
annotation continues:
-@example
+@smallexample
@var{intro-text}
^Z^Zsignal-name
@var{name}
@@ -647,8 +667,9 @@ annotation continues:
@var{string}
^Z^Zsignal-string-end
@var{end-text}
-@end example
+@end smallexample
+@noindent
where @var{name} is the name of the signal, such as @code{SIGILL} or
@code{SIGSEGV}, and @var{string} is the explanation of the signal, such
as @code{Illegal Instruction} or @code{Segmentation fault}.
@@ -657,7 +678,7 @@ user's benefit and have no particular format.
@findex signal
@item ^Z^Zsignal
-The syntax of this annotation is just like @code{signalled}, but GDB is
+The syntax of this annotation is just like @code{signalled}, but @value{GDBN} is
just saying that the program received the signal, not that it was
terminated with it.
@@ -670,15 +691,16 @@ The program hit breakpoint number @var{number}.
The program hit watchpoint number @var{number}.
@end table
-@node Source
-@chapter Displaying Source
+@node Source Annotations
+@section Displaying Source
+@cindex annotations for source display
@findex source
The following annotation is used instead of displaying source code:
-@example
+@smallexample
^Z^Zsource @var{filename}:@var{line}:@var{character}:@var{middle}:@var{addr}
-@end example
+@end smallexample
where @var{filename} is an absolute file name indicating which source
file, @var{line} is the line number within that file (where 1 is the
@@ -693,7 +715,7 @@ followed by one or more lowercase hex digits (note that this does not
depend on the language).
@node TODO
-@chapter Annotations We Might Want in the Future
+@section Annotations We Might Want in the Future
@format
- target-invalid
@@ -709,9 +731,11 @@ depend on the language).
notices.
@end format
+@ignore
@node Index
@unnumbered Index
@printindex fn
+@end ignore
-@bye
+@c @bye
diff --git a/contrib/gdb/gdb/doc/configure b/contrib/gdb/gdb/doc/configure
index 8c5591ce..2f9ade3 100644
--- a/contrib/gdb/gdb/doc/configure
+++ b/contrib/gdb/gdb/doc/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.2
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -333,7 +333,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12.2"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -600,8 +600,31 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:609: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -625,7 +648,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -704,7 +727,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12.2"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -728,6 +751,7 @@ s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -747,7 +771,9 @@ s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LN_S@%$LN_S%g
CEOF
EOF
diff --git a/contrib/gdb/gdb/doc/configure.in b/contrib/gdb/gdb/doc/configure.in
index 460efc2..fee9ece 100644
--- a/contrib/gdb/gdb/doc/configure.in
+++ b/contrib/gdb/gdb/doc/configure.in
@@ -1,4 +1,5 @@
AC_PREREQ(2.12.1)
AC_INIT(refcard.tex)
AC_PROG_INSTALL
+AC_PROG_LN_S
AC_OUTPUT(Makefile)
diff --git a/contrib/gdb/gdb/doc/fdl.texi b/contrib/gdb/gdb/doc/fdl.texi
new file mode 100644
index 0000000..f4726b9
--- /dev/null
+++ b/contrib/gdb/gdb/doc/fdl.texi
@@ -0,0 +1,368 @@
+@c -*-texinfo-*-
+@node GNU Free Documentation License
+
+@appendix GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright (C) 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+@sp 1
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document ``free'' in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@sp 1
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you.''
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque.''
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+@sp 1
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+@sp 1
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+@sp 1
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.@*
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).@*
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.@*
+D. Preserve all the copyright notices of the Document.@*
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.@*
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.@*
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.@*
+H. Include an unaltered copy of this License.@*
+I. Preserve the section entitled ``History'', and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled ``History'' in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.@*
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the ``History'' section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.@*
+K. In any section entitled ``Acknowledgements'' or ``Dedications'',
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.@*
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.@*
+M. Delete any section entitled ``Endorsements.'' Such a section
+ may not be included in the Modified Version.@*
+N. Do not retitle any existing section as ``Endorsements''
+ or to conflict in title with any Invariant Section.@*
+@sp 1
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+@sp 1
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgements'',
+and any sections entitled ``Dedications.'' You must delete all sections
+entitled ``Endorsements.''
+@sp 1
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+@sp 1
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+@sp 1
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+@sp 1
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+@sp 1
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+@end enumerate
+
+@unnumberedsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+Copyright (C) @var{year} @var{your name}.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1
+or any later version published by the Free Software Foundation;
+with the Invariant Sections being @var{list their titles}, with the
+Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+A copy of the license is included in the section entitled "GNU
+Free Documentation License."
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/contrib/gdb/gdb/doc/gdbint.texinfo b/contrib/gdb/gdb/doc/gdbint.texinfo
index 33b5979..67f22f0 100644
--- a/contrib/gdb/gdb/doc/gdbint.texinfo
+++ b/contrib/gdb/gdb/doc/gdbint.texinfo
@@ -1,42 +1,37 @@
-\input texinfo
+\input texinfo @c -*- texinfo -*-
@setfilename gdbint.info
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@include gdb-cfg.texi
+@dircategory Programming & development tools.
+@direntry
* Gdb-Internals: (gdbint). The GNU debugger's internals.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
+@end direntry
@ifinfo
-This file documents the internals of the GNU debugger GDB.
-
-Copyright 1990-1999 Free Software Foundation, Inc.
+This file documents the internals of the GNU debugger @value{GDBN}.
+Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002
+ Free Software Foundation, Inc.
Contributed by Cygnus Solutions. Written by John Gilmore.
Second Edition by Stan Shebs.
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission notice
-identical to this one except for the removal of this paragraph (this
-paragraph not being relevant to the printed manual).
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.
-@end ignore
-Permission is granted to copy or distribute modified versions of this
-manual under the terms of the GPL (for which purpose this text may be
-regarded as a program in the language TeX).
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+this GNU Manual, like GNU software. Copies published by the Free
+Software Foundation raise funds for GNU development.''
@end ifinfo
@setchapternewpage off
-@settitle GDB Internals
+@settitle @value{GDBN} Internals
+
+@syncodeindex fn cp
+@syncodeindex vr cp
@titlepage
-@title{GDB Internals}
+@title @value{GDBN} Internals
@subtitle{A guide to the internals of the GNU debugger}
@author John Gilmore
@author Cygnus Solutions
@@ -46,7 +41,7 @@ regarded as a program in the language TeX).
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.107 $} % For use in headers, footers too
+\xdef\manvers{\$Revision$} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
@@ -55,28 +50,37 @@ regarded as a program in the language TeX).
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1990-1999 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
+Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001
+ Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.
+
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+this GNU Manual, like GNU software. Copies published by the Free
+Software Foundation raise funds for GNU development.''
@end titlepage
+@contents
+
@node Top
@c Perhaps this should be the title of the document (but only for info,
@c not for TeX). Existing GNU manuals seem inconsistent on this point.
@top Scope of this Document
-This document documents the internals of the GNU debugger, GDB. It
-includes description of GDB's key algorithms and operations, as well
-as the mechanisms that adapt GDB to specific hosts and targets.
+This document documents the internals of the GNU debugger, @value{GDBN}. It
+includes description of @value{GDBN}'s key algorithms and operations, as well
+as the mechanisms that adapt @value{GDBN} to specific hosts and targets.
@menu
* Requirements::
* Overall Structure::
* Algorithms::
* User Interface::
+* libgdb::
* Symbol Handling::
* Language Support::
* Host Definition::
@@ -86,52 +90,61 @@ as the mechanisms that adapt GDB to specific hosts and targets.
* Support Libraries::
* Coding::
* Porting GDB::
+* Releasing GDB::
+* Testsuite::
* Hints::
+
+* GNU Free Documentation License:: The license for this documentation
+* Index::
@end menu
@node Requirements
@chapter Requirements
+@cindex requirements for @value{GDBN}
Before diving into the internals, you should understand the formal
-requirements and other expectations for GDB. Although some of these may
-seem obvious, there have been proposals for GDB that have run counter to
-these requirements.
+requirements and other expectations for @value{GDBN}. Although some
+of these may seem obvious, there have been proposals for @value{GDBN}
+that have run counter to these requirements.
-First of all, GDB is a debugger. It's not designed to be a front panel
-for embedded systems. It's not a text editor. It's not a shell. It's
-not a programming environment.
+First of all, @value{GDBN} is a debugger. It's not designed to be a
+front panel for embedded systems. It's not a text editor. It's not a
+shell. It's not a programming environment.
-GDB is an interactive tool. Although a batch mode is available, GDB's
-primary role is to interact with a human programmer.
+@value{GDBN} is an interactive tool. Although a batch mode is
+available, @value{GDBN}'s primary role is to interact with a human
+programmer.
-GDB should be responsive to the user. A programmer hot on the trail of
-a nasty bug, and operating under a looming deadline, is going to be very
-impatient of everything, including the response time to debugger
-commands.
+@value{GDBN} should be responsive to the user. A programmer hot on
+the trail of a nasty bug, and operating under a looming deadline, is
+going to be very impatient of everything, including the response time
+to debugger commands.
-GDB should be relatively permissive, such as for expressions. While the
-compiler should be picky (or have the option to be made picky), since
-source code lives for a long time usually, the programmer doing
-debugging shouldn't be spending time figuring out to mollify the
-debugger.
+@value{GDBN} should be relatively permissive, such as for expressions.
+While the compiler should be picky (or have the option to be made
+picky), since source code lives for a long time usually, the
+programmer doing debugging shouldn't be spending time figuring out to
+mollify the debugger.
-GDB will be called upon to deal with really large programs. Executable
-sizes of 50 to 100 megabytes occur regularly, and we've heard reports of
-programs approaching 1 gigabyte in size.
+@value{GDBN} will be called upon to deal with really large programs.
+Executable sizes of 50 to 100 megabytes occur regularly, and we've
+heard reports of programs approaching 1 gigabyte in size.
-GDB should be able to run everywhere. No other debugger is available
-for even half as many configurations as GDB supports.
+@value{GDBN} should be able to run everywhere. No other debugger is
+available for even half as many configurations as @value{GDBN}
+supports.
@node Overall Structure
@chapter Overall Structure
-GDB consists of three major subsystems: user interface, symbol handling
-(the ``symbol side''), and target system handling (the ``target side'').
+@value{GDBN} consists of three major subsystems: user interface,
+symbol handling (the @dfn{symbol side}), and target system handling (the
+@dfn{target side}).
-Ther user interface consists of several actual interfaces, plus
+The user interface consists of several actual interfaces, plus
supporting code.
The symbol side consists of object file readers, debugging info
@@ -150,26 +163,29 @@ should fit together.
@section The Symbol Side
-The symbolic side of GDB can be thought of as ``everything you can do in
-GDB without having a live program running''. For instance, you can look
-at the types of variables, and evaluate many kinds of expressions.
+The symbolic side of @value{GDBN} can be thought of as ``everything
+you can do in @value{GDBN} without having a live program running''.
+For instance, you can look at the types of variables, and evaluate
+many kinds of expressions.
@section The Target Side
-The target side of GDB is the ``bits and bytes manipulator''. Although
-it may make reference to symbolic info here and there, most of the
-target side will run with only a stripped executable available -- or
-even no executable at all, in remote debugging cases.
+The target side of @value{GDBN} is the ``bits and bytes manipulator''.
+Although it may make reference to symbolic info here and there, most
+of the target side will run with only a stripped executable
+available---or even no executable at all, in remote debugging cases.
Operations such as disassembly, stack frame crawls, and register
display, are able to work with no symbolic info at all. In some cases,
-such as disassembly, GDB will use symbolic info to present addresses
+such as disassembly, @value{GDBN} will use symbolic info to present addresses
relative to symbols rather than as raw numbers, but it will work either
way.
@section Configurations
-@dfn{Host} refers to attributes of the system where GDB runs.
+@cindex host
+@cindex target
+@dfn{Host} refers to attributes of the system where @value{GDBN} runs.
@dfn{Target} refers to the system where the program being debugged
executes. In most cases they are the same machine, in which case a
third type of @dfn{Native} attributes come into play.
@@ -195,32 +211,39 @@ are really part of the target environment, but which require
@code{#include} files that are only available on the host system. Core
file handling and @code{setjmp} handling are two common cases.
-When you want to make GDB work ``native'' on a particular machine, you
+When you want to make @value{GDBN} work ``native'' on a particular machine, you
have to include all three kinds of information.
@node Algorithms
@chapter Algorithms
+@cindex algorithms
-GDB uses a number of debugging-specific algorithms. They are often not
-very complicated, but get lost in the thicket of special cases and
-real-world issues. This chapter describes the basic algorithms and
-mentions some of the specific target definitions that they use.
+@value{GDBN} uses a number of debugging-specific algorithms. They are
+often not very complicated, but get lost in the thicket of special
+cases and real-world issues. This chapter describes the basic
+algorithms and mentions some of the specific target definitions that
+they use.
@section Frames
-A frame is a construct that GDB uses to keep track of calling and called
-functions.
+@cindex frame
+@cindex call stack frame
+A frame is a construct that @value{GDBN} uses to keep track of calling
+and called functions.
+@findex create_new_frame
+@vindex FRAME_FP
@code{FRAME_FP} in the machine description has no meaning to the
-machine-independent part of GDB, except that it is used when setting up
-a new frame from scratch, as follows:
+machine-independent part of @value{GDBN}, except that it is used when
+setting up a new frame from scratch, as follows:
@example
create_new_frame (read_register (FP_REGNUM), read_pc ()));
@end example
+@cindex frame pointer register
Other than that, all the meaning imparted to @code{FP_REGNUM} is
imparted by the machine-dependent code. So, @code{FP_REGNUM} can have
any value that is convenient for the code that creates new frames.
@@ -228,13 +251,15 @@ any value that is convenient for the code that creates new frames.
defined; that is where you should use the @code{FP_REGNUM} value, if
your frames are nonstandard.)
-Given a GDB frame, define @code{FRAME_CHAIN} to determine the address of
-the calling function's frame. This will be used to create a new GDB
-frame struct, and then @code{INIT_EXTRA_FRAME_INFO} and
-@code{INIT_FRAME_PC} will be called for the new frame.
+@cindex frame chain
+Given a @value{GDBN} frame, define @code{FRAME_CHAIN} to determine the
+address of the calling function's frame. This will be used to create
+a new @value{GDBN} frame struct, and then @code{INIT_EXTRA_FRAME_INFO}
+and @code{INIT_FRAME_PC} will be called for the new frame.
@section Breakpoint Handling
+@cindex breakpoints
In general, a breakpoint is a user-designated location in the program
where the user wants to regain control if program execution ever reaches
that location.
@@ -242,35 +267,48 @@ that location.
There are two main ways to implement breakpoints; either as ``hardware''
breakpoints or as ``software'' breakpoints.
+@cindex hardware breakpoints
+@cindex program counter
Hardware breakpoints are sometimes available as a builtin debugging
features with some chips. Typically these work by having dedicated
register into which the breakpoint address may be stored. If the PC
+(shorthand for @dfn{program counter})
ever matches a value in a breakpoint registers, the CPU raises an
-exception and reports it to GDB. Another possibility is when an
-emulator is in use; many emulators include circuitry that watches the
-address lines coming out from the processor, and force it to stop if the
-address matches a breakpoint's address. A third possibility is that the
-target already has the ability to do breakpoints somehow; for instance,
-a ROM monitor may do its own software breakpoints. So although these
-are not literally ``hardware breakpoints'', from GDB's point of view
-they work the same; GDB need not do nothing more than set the breakpoint
-and wait for something to happen.
+exception and reports it to @value{GDBN}.
+
+Another possibility is when an emulator is in use; many emulators
+include circuitry that watches the address lines coming out from the
+processor, and force it to stop if the address matches a breakpoint's
+address.
+
+A third possibility is that the target already has the ability to do
+breakpoints somehow; for instance, a ROM monitor may do its own
+software breakpoints. So although these are not literally ``hardware
+breakpoints'', from @value{GDBN}'s point of view they work the same;
+@value{GDBN} need not do nothing more than set the breakpoint and wait
+for something to happen.
Since they depend on hardware resources, hardware breakpoints may be
-limited in number; when the user asks for more, GDB will start trying to
-set software breakpoints.
-
-Software breakpoints require GDB to do somewhat more work. The basic
-theory is that GDB will replace a program instruction a trap, illegal
-divide, or some other instruction that will cause an exception, and then
-when it's encountered, GDB will take the exception and stop the program.
-When the user says to continue, GDB will restore the original
+limited in number; when the user asks for more, @value{GDBN} will
+start trying to set software breakpoints. (On some architectures,
+notably the 32-bit x86 platforms, @value{GDBN} cannot alsways know
+whether there's enough hardware resources to insert all the hardware
+breakpoints and watchpoints. On those platforms, @value{GDBN} prints
+an error message only when the program being debugged is continued.)
+
+@cindex software breakpoints
+Software breakpoints require @value{GDBN} to do somewhat more work.
+The basic theory is that @value{GDBN} will replace a program
+instruction with a trap, illegal divide, or some other instruction
+that will cause an exception, and then when it's encountered,
+@value{GDBN} will take the exception and stop the program. When the
+user says to continue, @value{GDBN} will restore the original
instruction, single-step, re-insert the trap, and continue on.
Since it literally overwrites the program being tested, the program area
-must be writeable, so this technique won't work on programs in ROM. It
+must be writable, so this technique won't work on programs in ROM. It
can also distort the behavior of programs that examine themselves,
-although the situation would be highly unusual.
+although such a situation would be highly unusual.
Also, the software breakpoint instruction should be the smallest size of
instruction, so it doesn't overwrite an instruction that might be a jump
@@ -283,6 +321,7 @@ set not to have any instructions usable for a software breakpoint,
although in practice only the ARC has failed to define such an
instruction.
+@findex BREAKPOINT
The basic definition of the software breakpoint is the macro
@code{BREAKPOINT}.
@@ -299,76 +338,1175 @@ much of the interesting breakpoint action is in @file{infrun.c}.
@section Longjmp Support
-GDB has support for figuring out that the target is doing a
+@cindex @code{longjmp} debugging
+@value{GDBN} has support for figuring out that the target is doing a
@code{longjmp} and for stopping at the target of the jump, if we are
stepping. This is done with a few specialized internal breakpoints,
-which are visible in the @code{maint info breakpoint} command.
+which are visible in the output of the @samp{maint info breakpoint}
+command.
+@findex GET_LONGJMP_TARGET
To make this work, you need to define a macro called
@code{GET_LONGJMP_TARGET}, which will examine the @code{jmp_buf}
structure and extract the longjmp target address. Since @code{jmp_buf}
is target specific, you will need to define it in the appropriate
-@file{tm-@var{xyz}.h} file. Look in @file{tm-sun4os4.h} and
+@file{tm-@var{target}.h} file. Look in @file{tm-sun4os4.h} and
@file{sparc-tdep.c} for examples of how to do this.
+@section Watchpoints
+@cindex watchpoints
+
+Watchpoints are a special kind of breakpoints (@pxref{Algorithms,
+breakpoints}) which break when data is accessed rather than when some
+instruction is executed. When you have data which changes without
+your knowing what code does that, watchpoints are the silver bullet to
+hunt down and kill such bugs.
+
+@cindex hardware watchpoints
+@cindex software watchpoints
+Watchpoints can be either hardware-assisted or not; the latter type is
+known as ``software watchpoints.'' @value{GDBN} always uses
+hardware-assisted watchpoints if they are available, and falls back on
+software watchpoints otherwise. Typical situations where @value{GDBN}
+will use software watchpoints are:
+
+@itemize @bullet
+@item
+The watched memory region is too large for the underlying hardware
+watchpoint support. For example, each x86 debug register can watch up
+to 4 bytes of memory, so trying to watch data structures whose size is
+more than 16 bytes will cause @value{GDBN} to use software
+watchpoints.
+
+@item
+The value of the expression to be watched depends on data held in
+registers (as opposed to memory).
+
+@item
+Too many different watchpoints requested. (On some architectures,
+this situation is impossible to detect until the debugged program is
+resumed.) Note that x86 debug registers are used both for hardware
+breakpoints and for watchpoints, so setting too many hardware
+breakpoints might cause watchpoint insertion to fail.
+
+@item
+No hardware-assisted watchpoints provided by the target
+implementation.
+@end itemize
+
+Software watchpoints are very slow, since @value{GDBN} needs to
+single-step the program being debugged and test the value of the
+watched expression(s) after each instruction. The rest of this
+section is mostly irrelevant for software watchpoints.
+
+@value{GDBN} uses several macros and primitives to support hardware
+watchpoints:
+
+@table @code
+@findex TARGET_HAS_HARDWARE_WATCHPOINTS
+@item TARGET_HAS_HARDWARE_WATCHPOINTS
+If defined, the target supports hardware watchpoints.
+
+@findex TARGET_CAN_USE_HARDWARE_WATCHPOINT
+@item TARGET_CAN_USE_HARDWARE_WATCHPOINT (@var{type}, @var{count}, @var{other})
+Return the number of hardware watchpoints of type @var{type} that are
+possible to be set. The value is positive if @var{count} watchpoints
+of this type can be set, zero if setting watchpoints of this type is
+not supported, and negative if @var{count} is more than the maximum
+number of watchpoints of type @var{type} that can be set. @var{other}
+is non-zero if other types of watchpoints are currently enabled (there
+are architectures which cannot set watchpoints of different types at
+the same time).
+
+@findex TARGET_REGION_OK_FOR_HW_WATCHPOINT
+@item TARGET_REGION_OK_FOR_HW_WATCHPOINT (@var{addr}, @var{len})
+Return non-zero if hardware watchpoints can be used to watch a region
+whose address is @var{addr} and whose length in bytes is @var{len}.
+
+@findex TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT
+@item TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (@var{size})
+Return non-zero if hardware watchpoints can be used to watch a region
+whose size is @var{size}. @value{GDBN} only uses this macro as a
+fall-back, in case @code{TARGET_REGION_OK_FOR_HW_WATCHPOINT} is not
+defined.
+
+@findex TARGET_DISABLE_HW_WATCHPOINTS
+@item TARGET_DISABLE_HW_WATCHPOINTS (@var{pid})
+Disables watchpoints in the process identified by @var{pid}. This is
+used, e.g., on HP-UX which provides operations to disable and enable
+the page-level memory protection that implements hardware watchpoints
+on that platform.
+
+@findex TARGET_ENABLE_HW_WATCHPOINTS
+@item TARGET_ENABLE_HW_WATCHPOINTS (@var{pid})
+Enables watchpoints in the process identified by @var{pid}. This is
+used, e.g., on HP-UX which provides operations to disable and enable
+the page-level memory protection that implements hardware watchpoints
+on that platform.
+
+@findex target_insert_watchpoint
+@findex target_remove_watchpoint
+@item target_insert_watchpoint (@var{addr}, @var{len}, @var{type})
+@itemx target_remove_watchpoint (@var{addr}, @var{len}, @var{type})
+Insert or remove a hardware watchpoint starting at @var{addr}, for
+@var{len} bytes. @var{type} is the watchpoint type, one of the
+possible values of the enumerated data type @code{target_hw_bp_type},
+defined by @file{breakpoint.h} as follows:
+
+@example
+ enum target_hw_bp_type
+ @{
+ hw_write = 0, /* Common (write) HW watchpoint */
+ hw_read = 1, /* Read HW watchpoint */
+ hw_access = 2, /* Access (read or write) HW watchpoint */
+ hw_execute = 3 /* Execute HW breakpoint */
+ @};
+@end example
+
+@noindent
+These two macros should return 0 for success, non-zero for failure.
+
+@cindex insert or remove hardware breakpoint
+@findex target_remove_hw_breakpoint
+@findex target_insert_hw_breakpoint
+@item target_remove_hw_breakpoint (@var{addr}, @var{shadow})
+@itemx target_insert_hw_breakpoint (@var{addr}, @var{shadow})
+Insert or remove a hardware-assisted breakpoint at address @var{addr}.
+Returns zero for success, non-zero for failure. @var{shadow} is the
+real contents of the byte where the breakpoint has been inserted; it
+is generally not valid when hardware breakpoints are used, but since
+no other code touches these values, the implementations of the above
+two macros can use them for their internal purposes.
+
+@findex target_stopped_data_address
+@item target_stopped_data_address ()
+If the inferior has some watchpoint that triggered, return the address
+associated with that watchpoint. Otherwise, return zero.
+
+@findex DECR_PC_AFTER_HW_BREAK
+@item DECR_PC_AFTER_HW_BREAK
+If defined, @value{GDBN} decrements the program counter by the value
+of @code{DECR_PC_AFTER_HW_BREAK} after a hardware break-point. This
+overrides the value of @code{DECR_PC_AFTER_BREAK} when a breakpoint
+that breaks is a hardware-assisted breakpoint.
+
+@findex HAVE_STEPPABLE_WATCHPOINT
+@item HAVE_STEPPABLE_WATCHPOINT
+If defined to a non-zero value, it is not necessary to disable a
+watchpoint to step over it.
+
+@findex HAVE_NONSTEPPABLE_WATCHPOINT
+@item HAVE_NONSTEPPABLE_WATCHPOINT
+If defined to a non-zero value, @value{GDBN} should disable a
+watchpoint to step the inferior over it.
+
+@findex HAVE_CONTINUABLE_WATCHPOINT
+@item HAVE_CONTINUABLE_WATCHPOINT
+If defined to a non-zero value, it is possible to continue the
+inferior after a watchpoint has been hit.
+
+@findex CANNOT_STEP_HW_WATCHPOINTS
+@item CANNOT_STEP_HW_WATCHPOINTS
+If this is defined to a non-zero value, @value{GDBN} will remove all
+watchpoints before stepping the inferior.
+
+@findex STOPPED_BY_WATCHPOINT
+@item STOPPED_BY_WATCHPOINT (@var{wait_status})
+Return non-zero if stopped by a watchpoint. @var{wait_status} is of
+the type @code{struct target_waitstatus}, defined by @file{target.h}.
+@end table
+
+@subsection x86 Watchpoints
+@cindex x86 debug registers
+@cindex watchpoints, on x86
+
+The 32-bit Intel x86 (a.k.a.@: ia32) processors feature special debug
+registers designed to facilitate debugging. @value{GDBN} provides a
+generic library of functions that x86-based ports can use to implement
+support for watchpoints and hardware-assisted breakpoints. This
+subsection documents the x86 watchpoint facilities in @value{GDBN}.
+
+To use the generic x86 watchpoint support, a port should do the
+following:
+
+@itemize @bullet
+@findex I386_USE_GENERIC_WATCHPOINTS
+@item
+Define the macro @code{I386_USE_GENERIC_WATCHPOINTS} somewhere in the
+target-dependent headers.
+
+@item
+Include the @file{config/i386/nm-i386.h} header file @emph{after}
+defining @code{I386_USE_GENERIC_WATCHPOINTS}.
+
+@item
+Add @file{i386-nat.o} to the value of the Make variable
+@code{NATDEPFILES} (@pxref{Native Debugging, NATDEPFILES}) or
+@code{TDEPFILES} (@pxref{Target Architecture Definition, TDEPFILES}).
+
+@item
+Provide implementations for the @code{I386_DR_LOW_*} macros described
+below. Typically, each macro should call a target-specific function
+which does the real work.
+@end itemize
+
+The x86 watchpoint support works by maintaining mirror images of the
+debug registers. Values are copied between the mirror images and the
+real debug registers via a set of macros which each target needs to
+provide:
+
+@table @code
+@findex I386_DR_LOW_SET_CONTROL
+@item I386_DR_LOW_SET_CONTROL (@var{val})
+Set the Debug Control (DR7) register to the value @var{val}.
+
+@findex I386_DR_LOW_SET_ADDR
+@item I386_DR_LOW_SET_ADDR (@var{idx}, @var{addr})
+Put the address @var{addr} into the debug register number @var{idx}.
+
+@findex I386_DR_LOW_RESET_ADDR
+@item I386_DR_LOW_RESET_ADDR (@var{idx})
+Reset (i.e.@: zero out) the address stored in the debug register
+number @var{idx}.
+
+@findex I386_DR_LOW_GET_STATUS
+@item I386_DR_LOW_GET_STATUS
+Return the value of the Debug Status (DR6) register. This value is
+used immediately after it is returned by
+@code{I386_DR_LOW_GET_STATUS}, so as to support per-thread status
+register values.
+@end table
+
+For each one of the 4 debug registers (whose indices are from 0 to 3)
+that store addresses, a reference count is maintained by @value{GDBN},
+to allow sharing of debug registers by several watchpoints. This
+allows users to define several watchpoints that watch the same
+expression, but with different conditions and/or commands, without
+wasting debug registers which are in short supply. @value{GDBN}
+maintains the reference counts internally, targets don't have to do
+anything to use this feature.
+
+The x86 debug registers can each watch a region that is 1, 2, or 4
+bytes long. The ia32 architecture requires that each watched region
+be appropriately aligned: 2-byte region on 2-byte boundary, 4-byte
+region on 4-byte boundary. However, the x86 watchpoint support in
+@value{GDBN} can watch unaligned regions and regions larger than 4
+bytes (up to 16 bytes) by allocating several debug registers to watch
+a single region. This allocation of several registers per a watched
+region is also done automatically without target code intervention.
+
+The generic x86 watchpoint support provides the following API for the
+@value{GDBN}'s application code:
+
+@table @code
+@findex i386_region_ok_for_watchpoint
+@item i386_region_ok_for_watchpoint (@var{addr}, @var{len})
+The macro @code{TARGET_REGION_OK_FOR_HW_WATCHPOINT} is set to call
+this function. It counts the number of debug registers required to
+watch a given region, and returns a non-zero value if that number is
+less than 4, the number of debug registers available to x86
+processors.
+
+@findex i386_stopped_data_address
+@item i386_stopped_data_address (void)
+The macros @code{STOPPED_BY_WATCHPOINT} and
+@code{target_stopped_data_address} are set to call this function. The
+argument passed to @code{STOPPED_BY_WATCHPOINT} is ignored. This
+function examines the breakpoint condition bits in the DR6 Debug
+Status register, as returned by the @code{I386_DR_LOW_GET_STATUS}
+macro, and returns the address associated with the first bit that is
+set in DR6.
+
+@findex i386_insert_watchpoint
+@findex i386_remove_watchpoint
+@item i386_insert_watchpoint (@var{addr}, @var{len}, @var{type})
+@itemx i386_remove_watchpoint (@var{addr}, @var{len}, @var{type})
+Insert or remove a watchpoint. The macros
+@code{target_insert_watchpoint} and @code{target_remove_watchpoint}
+are set to call these functions. @code{i386_insert_watchpoint} first
+looks for a debug register which is already set to watch the same
+region for the same access types; if found, it just increments the
+reference count of that debug register, thus implementing debug
+register sharing between watchpoints. If no such register is found,
+the function looks for a vacant debug register, sets its mirrorred
+value to @var{addr}, sets the mirrorred value of DR7 Debug Control
+register as appropriate for the @var{len} and @var{type} parameters,
+and then passes the new values of the debug register and DR7 to the
+inferior by calling @code{I386_DR_LOW_SET_ADDR} and
+@code{I386_DR_LOW_SET_CONTROL}. If more than one debug register is
+required to cover the given region, the above process is repeated for
+each debug register.
+
+@code{i386_remove_watchpoint} does the opposite: it resets the address
+in the mirrorred value of the debug register and its read/write and
+length bits in the mirrorred value of DR7, then passes these new
+values to the inferior via @code{I386_DR_LOW_RESET_ADDR} and
+@code{I386_DR_LOW_SET_CONTROL}. If a register is shared by several
+watchpoints, each time a @code{i386_remove_watchpoint} is called, it
+decrements the reference count, and only calls
+@code{I386_DR_LOW_RESET_ADDR} and @code{I386_DR_LOW_SET_CONTROL} when
+the count goes to zero.
+
+@findex i386_insert_hw_breakpoint
+@findex i386_remove_hw_breakpoint
+@item i386_insert_hw_breakpoint (@var{addr}, @var{shadow}
+@itemx i386_remove_hw_breakpoint (@var{addr}, @var{shadow})
+These functions insert and remove hardware-assisted breakpoints. The
+macros @code{target_insert_hw_breakpoint} and
+@code{target_remove_hw_breakpoint} are set to call these functions.
+These functions work like @code{i386_insert_watchpoint} and
+@code{i386_remove_watchpoint}, respectively, except that they set up
+the debug registers to watch instruction execution, and each
+hardware-assisted breakpoint always requires exactly one debug
+register.
+
+@findex i386_stopped_by_hwbp
+@item i386_stopped_by_hwbp (void)
+This function returns non-zero if the inferior has some watchpoint or
+hardware breakpoint that triggered. It works like
+@code{i386_stopped_data_address}, except that it doesn't return the
+address whose watchpoint triggered.
+
+@findex i386_cleanup_dregs
+@item i386_cleanup_dregs (void)
+This function clears all the reference counts, addresses, and control
+bits in the mirror images of the debug registers. It doesn't affect
+the actual debug registers in the inferior process.
+@end table
+
+@noindent
+@strong{Notes:}
+@enumerate 1
+@item
+x86 processors support setting watchpoints on I/O reads or writes.
+However, since no target supports this (as of March 2001), and since
+@code{enum target_hw_bp_type} doesn't even have an enumeration for I/O
+watchpoints, this feature is not yet available to @value{GDBN} running
+on x86.
+
+@item
+x86 processors can enable watchpoints locally, for the current task
+only, or globally, for all the tasks. For each debug register,
+there's a bit in the DR7 Debug Control register that determines
+whether the associated address is watched locally or globally. The
+current implementation of x86 watchpoint support in @value{GDBN}
+always sets watchpoints to be locally enabled, since global
+watchpoints might interfere with the underlying OS and are probably
+unavailable in many platforms.
+@end enumerate
+
@node User Interface
@chapter User Interface
-GDB has several user interfaces. Although the command-line interface
+@value{GDBN} has several user interfaces. Although the command-line interface
is the most common and most familiar, there are others.
@section Command Interpreter
-The command interpreter in GDB is fairly simple. It is designed to
+@cindex command interpreter
+@cindex CLI
+The command interpreter in @value{GDBN} is fairly simple. It is designed to
allow for the set of commands to be augmented dynamically, and also
has a recursive subcommand capability, where the first argument to
a command may itself direct a lookup on a different command list.
-For instance, the @code{set} command just starts a lookup on the
-@code{setlist} command list, while @code{set thread} recurses
+For instance, the @samp{set} command just starts a lookup on the
+@code{setlist} command list, while @samp{set thread} recurses
to the @code{set_thread_cmd_list}.
+@findex add_cmd
+@findex add_com
To add commands in general, use @code{add_cmd}. @code{add_com} adds to
the main command list, and should be used for those commands. The usual
-place to add commands is in the @code{_initialize_@var{xyz}} routines at the
-ends of most source files.
+place to add commands is in the @code{_initialize_@var{xyz}} routines at
+the ends of most source files.
+
+@cindex deprecating commands
+@findex deprecate_cmd
+Before removing commands from the command set it is a good idea to
+deprecate them for some time. Use @code{deprecate_cmd} on commands or
+aliases to set the deprecated flag. @code{deprecate_cmd} takes a
+@code{struct cmd_list_element} as it's first argument. You can use the
+return value from @code{add_com} or @code{add_cmd} to deprecate the
+command immediately after it is created.
+
+The first time a command is used the user will be warned and offered a
+replacement (if one exists). Note that the replacement string passed to
+@code{deprecate_cmd} should be the full name of the command, i.e. the
+entire string the user should type at the command line.
+
+@section UI-Independent Output---the @code{ui_out} Functions
+@c This section is based on the documentation written by Fernando
+@c Nasser <fnasser@redhat.com>.
+
+@cindex @code{ui_out} functions
+The @code{ui_out} functions present an abstraction level for the
+@value{GDBN} output code. They hide the specifics of different user
+interfaces supported by @value{GDBN}, and thus free the programmer
+from the need to write several versions of the same code, one each for
+every UI, to produce output.
+
+@subsection Overview and Terminology
+
+In general, execution of each @value{GDBN} command produces some sort
+of output, and can even generate an input request.
+
+Output can be generated for the following purposes:
+
+@itemize @bullet
+@item
+to display a @emph{result} of an operation;
+
+@item
+to convey @emph{info} or produce side-effects of a requested
+operation;
+
+@item
+to provide a @emph{notification} of an asynchronous event (including
+progress indication of a prolonged asynchronous operation);
+
+@item
+to display @emph{error messages} (including warnings);
+
+@item
+to show @emph{debug data};
+
+@item
+to @emph{query} or prompt a user for input (a special case).
+@end itemize
+
+@noindent
+This section mainly concentrates on how to build result output,
+although some of it also applies to other kinds of output.
+
+Generation of output that displays the results of an operation
+involves one or more of the following:
+
+@itemize @bullet
+@item
+output of the actual data
+
+@item
+formatting the output as appropriate for console output, to make it
+easily readable by humans
+
+@item
+machine oriented formatting--a more terse formatting to allow for easy
+parsing by programs which read @value{GDBN}'s output
+
+@item
+annotation, whose purpose is to help legacy GUIs to identify interesting
+parts in the output
+@end itemize
+
+The @code{ui_out} routines take care of the first three aspects.
+Annotations are provided by separate annotation routines. Note that use
+of annotations for an interface between a GUI and @value{GDBN} is
+deprecated.
+
+Output can be in the form of a single item, which we call a @dfn{field};
+a @dfn{list} consisting of identical fields; a @dfn{tuple} consisting of
+non-identical fields; or a @dfn{table}, which is a tuple consisting of a
+header and a body. In a BNF-like form:
+
+@table @code
+@item <table> @expansion{}
+@code{<header> <body>}
+@item <header> @expansion{}
+@code{@{ <column> @}}
+@item <column> @expansion{}
+@code{<width> <alignment> <title>}
+@item <body> @expansion{}
+@code{@{<row>@}}
+@end table
+
+
+@subsection General Conventions
+
+Most @code{ui_out} routines are of type @code{void}, the exceptions are
+@code{ui_out_stream_new} (which returns a pointer to the newly created
+object) and the @code{make_cleanup} routines.
+
+The first parameter is always the @code{ui_out} vector object, a pointer
+to a @code{struct ui_out}.
+
+The @var{format} parameter is like in @code{printf} family of functions.
+When it is present, there must also be a variable list of arguments
+sufficient used to satisfy the @code{%} specifiers in the supplied
+format.
+
+When a character string argument is not used in a @code{ui_out} function
+call, a @code{NULL} pointer has to be supplied instead.
+
+
+@subsection Table, Tuple and List Functions
+
+@cindex list output functions
+@cindex table output functions
+@cindex tuple output functions
+This section introduces @code{ui_out} routines for building lists,
+tuples and tables. The routines to output the actual data items
+(fields) are presented in the next section.
+
+To recap: A @dfn{tuple} is a sequence of @dfn{fields}, each field
+containing information about an object; a @dfn{list} is a sequence of
+fields where each field describes an identical object.
+
+Use the @dfn{table} functions when your output consists of a list of
+rows (tuples) and the console output should include a heading. Use this
+even when you are listing just one object but you still want the header.
+
+@cindex nesting level in @code{ui_out} functions
+Tables can not be nested. Tuples and lists can be nested up to a
+maximum of five levels.
+
+The overall structure of the table output code is something like this:
+
+@example
+ ui_out_table_begin
+ ui_out_table_header
+ @dots{}
+ ui_out_table_body
+ ui_out_tuple_begin
+ ui_out_field_*
+ @dots{}
+ ui_out_tuple_end
+ @dots{}
+ ui_out_table_end
+@end example
+
+Here is the description of table-, tuple- and list-related @code{ui_out}
+functions:
+
+@deftypefun void ui_out_table_begin (struct ui_out *@var{uiout}, int @var{nbrofcols}, int @var{nr_rows}, const char *@var{tblid})
+The function @code{ui_out_table_begin} marks the beginning of the output
+of a table. It should always be called before any other @code{ui_out}
+function for a given table. @var{nbrofcols} is the number of columns in
+the table. @var{nr_rows} is the number of rows in the table.
+@var{tblid} is an optional string identifying the table. The string
+pointed to by @var{tblid} is copied by the implementation of
+@code{ui_out_table_begin}, so the application can free the string if it
+was @code{malloc}ed.
+
+The companion function @code{ui_out_table_end}, described below, marks
+the end of the table's output.
+@end deftypefun
+
+@deftypefun void ui_out_table_header (struct ui_out *@var{uiout}, int @var{width}, enum ui_align @var{alignment}, const char *@var{colhdr})
+@code{ui_out_table_header} provides the header information for a single
+table column. You call this function several times, one each for every
+column of the table, after @code{ui_out_table_begin}, but before
+@code{ui_out_table_body}.
+
+The value of @var{width} gives the column width in characters. The
+value of @var{alignment} is one of @code{left}, @code{center}, and
+@code{right}, and it specifies how to align the header: left-justify,
+center, or right-justify it. @var{colhdr} points to a string that
+specifies the column header; the implementation copies that string, so
+column header strings in @code{malloc}ed storage can be freed after the
+call.
+@end deftypefun
+
+@deftypefun void ui_out_table_body (struct ui_out *@var{uiout})
+This function delimits the table header from the table body.
+@end deftypefun
+
+@deftypefun void ui_out_table_end (struct ui_out *@var{uiout})
+This function signals the end of a table's output. It should be called
+after the table body has been produced by the list and field output
+functions.
+
+There should be exactly one call to @code{ui_out_table_end} for each
+call to @code{ui_out_table_begin}, otherwise the @code{ui_out} functions
+will signal an internal error.
+@end deftypefun
+
+The output of the tuples that represent the table rows must follow the
+call to @code{ui_out_table_body} and precede the call to
+@code{ui_out_table_end}. You build a tuple by calling
+@code{ui_out_tuple_begin} and @code{ui_out_tuple_end}, with suitable
+calls to functions which actually output fields between them.
+
+@deftypefun void ui_out_tuple_begin (struct ui_out *@var{uiout}, const char *@var{id})
+This function marks the beginning of a tuple output. @var{id} points
+to an optional string that identifies the tuple; it is copied by the
+implementation, and so strings in @code{malloc}ed storage can be freed
+after the call.
+@end deftypefun
+
+@deftypefun void ui_out_tuple_end (struct ui_out *@var{uiout})
+This function signals an end of a tuple output. There should be exactly
+one call to @code{ui_out_tuple_end} for each call to
+@code{ui_out_tuple_begin}, otherwise an internal @value{GDBN} error will
+be signaled.
+@end deftypefun
+
+@deftypefun struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *@var{uiout}, const char *@var{id})
+This function first opens the tuple and then establishes a cleanup
+(@pxref{Coding, Cleanups}) to close the tuple. It provides a convenient
+and correct implementation of the non-portable@footnote{The function
+cast is not portable ISO-C.} code sequence:
+@smallexample
+struct cleanup *old_cleanup;
+ui_out_tuple_begin (uiout, "...");
+old_cleanup = make_cleanup ((void(*)(void *)) ui_out_tuple_end,
+ uiout);
+@end smallexample
+@end deftypefun
+
+@deftypefun void ui_out_list_begin (struct ui_out *@var{uiout}, const char *@var{id})
+This function marks the beginning of a list output. @var{id} points to
+an optional string that identifies the list; it is copied by the
+implementation, and so strings in @code{malloc}ed storage can be freed
+after the call.
+@end deftypefun
+
+@deftypefun void ui_out_list_end (struct ui_out *@var{uiout})
+This function signals an end of a list output. There should be exactly
+one call to @code{ui_out_list_end} for each call to
+@code{ui_out_list_begin}, otherwise an internal @value{GDBN} error will
+be signaled.
+@end deftypefun
+
+@deftypefun struct cleanup *make_cleanup_ui_out_list_begin_end (struct ui_out *@var{uiout}, const char *@var{id})
+Similar to @code{make_cleanup_ui_out_tuple_begin_end}, this function
+opens a list and then establishes cleanup (@pxref{Coding, Cleanups})
+that will close the list.list.
+@end deftypefun
+
+@subsection Item Output Functions
+
+@cindex item output functions
+@cindex field output functions
+@cindex data output
+The functions described below produce output for the actual data
+items, or fields, which contain information about the object.
+
+Choose the appropriate function accordingly to your particular needs.
+
+@deftypefun void ui_out_field_fmt (struct ui_out *@var{uiout}, char *@var{fldname}, char *@var{format}, ...)
+This is the most general output function. It produces the
+representation of the data in the variable-length argument list
+according to formatting specifications in @var{format}, a
+@code{printf}-like format string. The optional argument @var{fldname}
+supplies the name of the field. The data items themselves are
+supplied as additional arguments after @var{format}.
+
+This generic function should be used only when it is not possible to
+use one of the specialized versions (see below).
+@end deftypefun
+
+@deftypefun void ui_out_field_int (struct ui_out *@var{uiout}, const char *@var{fldname}, int @var{value})
+This function outputs a value of an @code{int} variable. It uses the
+@code{"%d"} output conversion specification. @var{fldname} specifies
+the name of the field.
+@end deftypefun
+
+@deftypefun void ui_out_field_core_addr (struct ui_out *@var{uiout}, const char *@var{fldname}, CORE_ADDR @var{address})
+This function outputs an address.
+@end deftypefun
+
+@deftypefun void ui_out_field_string (struct ui_out *@var{uiout}, const char *@var{fldname}, const char *@var{string})
+This function outputs a string using the @code{"%s"} conversion
+specification.
+@end deftypefun
+
+Sometimes, there's a need to compose your output piece by piece using
+functions that operate on a stream, such as @code{value_print} or
+@code{fprintf_symbol_filtered}. These functions accept an argument of
+the type @code{struct ui_file *}, a pointer to a @code{ui_file} object
+used to store the data stream used for the output. When you use one
+of these functions, you need a way to pass their results stored in a
+@code{ui_file} object to the @code{ui_out} functions. To this end,
+you first create a @code{ui_stream} object by calling
+@code{ui_out_stream_new}, pass the @code{stream} member of that
+@code{ui_stream} object to @code{value_print} and similar functions,
+and finally call @code{ui_out_field_stream} to output the field you
+constructed. When the @code{ui_stream} object is no longer needed,
+you should destroy it and free its memory by calling
+@code{ui_out_stream_delete}.
+
+@deftypefun struct ui_stream *ui_out_stream_new (struct ui_out *@var{uiout})
+This function creates a new @code{ui_stream} object which uses the
+same output methods as the @code{ui_out} object whose pointer is
+passed in @var{uiout}. It returns a pointer to the newly created
+@code{ui_stream} object.
+@end deftypefun
+
+@deftypefun void ui_out_stream_delete (struct ui_stream *@var{streambuf})
+This functions destroys a @code{ui_stream} object specified by
+@var{streambuf}.
+@end deftypefun
+
+@deftypefun void ui_out_field_stream (struct ui_out *@var{uiout}, const char *@var{fieldname}, struct ui_stream *@var{streambuf})
+This function consumes all the data accumulated in
+@code{streambuf->stream} and outputs it like
+@code{ui_out_field_string} does. After a call to
+@code{ui_out_field_stream}, the accumulated data no longer exists, but
+the stream is still valid and may be used for producing more fields.
+@end deftypefun
+
+@strong{Important:} If there is any chance that your code could bail
+out before completing output generation and reaching the point where
+@code{ui_out_stream_delete} is called, it is necessary to set up a
+cleanup, to avoid leaking memory and other resources. Here's a
+skeleton code to do that:
+
+@smallexample
+ struct ui_stream *mybuf = ui_out_stream_new (uiout);
+ struct cleanup *old = make_cleanup (ui_out_stream_delete, mybuf);
+ ...
+ do_cleanups (old);
+@end smallexample
+
+If the function already has the old cleanup chain set (for other kinds
+of cleanups), you just have to add your cleanup to it:
+
+@smallexample
+ mybuf = ui_out_stream_new (uiout);
+ make_cleanup (ui_out_stream_delete, mybuf);
+@end smallexample
+
+Note that with cleanups in place, you should not call
+@code{ui_out_stream_delete} directly, or you would attempt to free the
+same buffer twice.
+
+@subsection Utility Output Functions
+
+@deftypefun void ui_out_field_skip (struct ui_out *@var{uiout}, const char *@var{fldname})
+This function skips a field in a table. Use it if you have to leave
+an empty field without disrupting the table alignment. The argument
+@var{fldname} specifies a name for the (missing) filed.
+@end deftypefun
+
+@deftypefun void ui_out_text (struct ui_out *@var{uiout}, const char *@var{string})
+This function outputs the text in @var{string} in a way that makes it
+easy to be read by humans. For example, the console implementation of
+this method filters the text through a built-in pager, to prevent it
+from scrolling off the visible portion of the screen.
+
+Use this function for printing relatively long chunks of text around
+the actual field data: the text it produces is not aligned according
+to the table's format. Use @code{ui_out_field_string} to output a
+string field, and use @code{ui_out_message}, described below, to
+output short messages.
+@end deftypefun
+
+@deftypefun void ui_out_spaces (struct ui_out *@var{uiout}, int @var{nspaces})
+This function outputs @var{nspaces} spaces. It is handy to align the
+text produced by @code{ui_out_text} with the rest of the table or
+list.
+@end deftypefun
+
+@deftypefun void ui_out_message (struct ui_out *@var{uiout}, int @var{verbosity}, const char *@var{format}, ...)
+This function produces a formatted message, provided that the current
+verbosity level is at least as large as given by @var{verbosity}. The
+current verbosity level is specified by the user with the @samp{set
+verbositylevel} command.@footnote{As of this writing (April 2001),
+setting verbosity level is not yet implemented, and is always returned
+as zero. So calling @code{ui_out_message} with a @var{verbosity}
+argument more than zero will cause the message to never be printed.}
+@end deftypefun
+
+@deftypefun void ui_out_wrap_hint (struct ui_out *@var{uiout}, char *@var{indent})
+This function gives the console output filter (a paging filter) a hint
+of where to break lines which are too long. Ignored for all other
+output consumers. @var{indent}, if non-@code{NULL}, is the string to
+be printed to indent the wrapped text on the next line; it must remain
+accessible until the next call to @code{ui_out_wrap_hint}, or until an
+explicit newline is produced by one of the other functions. If
+@var{indent} is @code{NULL}, the wrapped text will not be indented.
+@end deftypefun
+
+@deftypefun void ui_out_flush (struct ui_out *@var{uiout})
+This function flushes whatever output has been accumulated so far, if
+the UI buffers output.
+@end deftypefun
+
+
+@subsection Examples of Use of @code{ui_out} functions
+
+@cindex using @code{ui_out} functions
+@cindex @code{ui_out} functions, usage examples
+This section gives some practical examples of using the @code{ui_out}
+functions to generalize the old console-oriented code in
+@value{GDBN}. The examples all come from functions defined on the
+@file{breakpoints.c} file.
+
+This example, from the @code{breakpoint_1} function, shows how to
+produce a table.
+
+The original code was:
+
+@example
+ 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 ();
+ @}
+@end example
+
+Here's the new version:
+
+@example
+ nr_printable_breakpoints = @dots{};
+
+ if (addressprint)
+ ui_out_table_begin (ui, 6, nr_printable_breakpoints, "BreakpointTable");
+ else
+ ui_out_table_begin (ui, 5, nr_printable_breakpoints, "BreakpointTable");
+
+ if (nr_printable_breakpoints > 0)
+ annotate_breakpoints_headers ();
+ if (nr_printable_breakpoints > 0)
+ annotate_field (0);
+ ui_out_table_header (uiout, 3, ui_left, "number", "Num"); /* 1 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (1);
+ ui_out_table_header (uiout, 14, ui_left, "type", "Type"); /* 2 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (2);
+ ui_out_table_header (uiout, 4, ui_left, "disp", "Disp"); /* 3 */
+ if (nr_printable_breakpoints > 0)
+ annotate_field (3);
+ ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb"); /* 4 */
+ if (addressprint)
+ @{
+ if (nr_printable_breakpoints > 0)
+ annotate_field (4);
+ if (TARGET_ADDR_BIT <= 32)
+ ui_out_table_header (uiout, 10, ui_left, "addr", "Address");/* 5 */
+ else
+ ui_out_table_header (uiout, 18, ui_left, "addr", "Address");/* 5 */
+ @}
+ if (nr_printable_breakpoints > 0)
+ annotate_field (5);
+ ui_out_table_header (uiout, 40, ui_noalign, "what", "What"); /* 6 */
+ ui_out_table_body (uiout);
+ if (nr_printable_breakpoints > 0)
+ annotate_breakpoints_table ();
+@end example
+
+This example, from the @code{print_one_breakpoint} function, shows how
+to produce the actual data for the table whose structure was defined
+in the above example. The original code was:
+
+@example
+ annotate_record ();
+ annotate_field (0);
+ printf_filtered ("%-3d ", b->number);
+ annotate_field (1);
+ if ((int)b->type > (sizeof(bptypes)/sizeof(bptypes[0]))
+ || ((int) b->type != bptypes[(int) b->type].type))
+ internal_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]);
+ @dots{}
+@end example
+
+This is the new version:
+
+@example
+ annotate_record ();
+ ui_out_tuple_begin (uiout, "bkpt");
+ annotate_field (0);
+ ui_out_field_int (uiout, "number", b->number);
+ annotate_field (1);
+ if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0])))
+ || ((int) b->type != bptypes[(int) b->type].type))
+ internal_error ("bptypes table does not describe type #%d.",
+ (int) b->type);
+ ui_out_field_string (uiout, "type", bptypes[(int)b->type].description);
+ annotate_field (2);
+ ui_out_field_string (uiout, "disp", bpdisps[(int)b->disposition]);
+ annotate_field (3);
+ ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int)b->enable]);
+ @dots{}
+@end example
+
+This example, also from @code{print_one_breakpoint}, shows how to
+produce a complicated output field using the @code{print_expression}
+functions which requires a stream to be passed. It also shows how to
+automate stream destruction with cleanups. The original code was:
+
+@example
+ annotate_field (5);
+ print_expression (b->exp, gdb_stdout);
+@end example
+
+The new version is:
+
+@example
+ struct ui_stream *stb = ui_out_stream_new (uiout);
+ struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
+ ...
+ annotate_field (5);
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "what", local_stream);
+@end example
+
+This example, also from @code{print_one_breakpoint}, shows how to use
+@code{ui_out_text} and @code{ui_out_field_string}. The original code
+was:
+
+@example
+ annotate_field (5);
+ if (b->dll_pathname == NULL)
+ printf_filtered ("<any library> ");
+ else
+ printf_filtered ("library \"%s\" ", b->dll_pathname);
+@end example
+
+It became:
+
+@example
+ annotate_field (5);
+ if (b->dll_pathname == NULL)
+ @{
+ ui_out_field_string (uiout, "what", "<any library>");
+ ui_out_spaces (uiout, 1);
+ @}
+ else
+ @{
+ ui_out_text (uiout, "library \"");
+ ui_out_field_string (uiout, "what", b->dll_pathname);
+ ui_out_text (uiout, "\" ");
+ @}
+@end example
+
+The following example from @code{print_one_breakpoint} shows how to
+use @code{ui_out_field_int} and @code{ui_out_spaces}. The original
+code was:
+
+@example
+ annotate_field (5);
+ if (b->forked_inferior_pid != 0)
+ printf_filtered ("process %d ", b->forked_inferior_pid);
+@end example
+
+It became:
+
+@example
+ annotate_field (5);
+ if (b->forked_inferior_pid != 0)
+ @{
+ ui_out_text (uiout, "process ");
+ ui_out_field_int (uiout, "what", b->forked_inferior_pid);
+ ui_out_spaces (uiout, 1);
+ @}
+@end example
+
+Here's an example of using @code{ui_out_field_string}. The original
+code was:
+
+@example
+ annotate_field (5);
+ if (b->exec_pathname != NULL)
+ printf_filtered ("program \"%s\" ", b->exec_pathname);
+@end example
+
+It became:
+
+@example
+ annotate_field (5);
+ if (b->exec_pathname != NULL)
+ @{
+ ui_out_text (uiout, "program \"");
+ ui_out_field_string (uiout, "what", b->exec_pathname);
+ ui_out_text (uiout, "\" ");
+ @}
+@end example
+
+Finally, here's an example of printing an address. The original code:
+
+@example
+ annotate_field (4);
+ printf_filtered ("%s ",
+ local_hex_string_custom ((unsigned long) b->address, "08l"));
+@end example
+
+It became:
+
+@example
+ annotate_field (4);
+ ui_out_field_core_addr (uiout, "Address", b->address);
+@end example
+
@section Console Printing
@section TUI
-@section libgdb
+@node libgdb
+
+@chapter libgdb
-@code{libgdb} was an abortive project of years ago. The theory was to
-provide an API to GDB's functionality.
+@section libgdb 1.0
+@cindex @code{libgdb}
+@code{libgdb} 1.0 was an abortive project of years ago. The theory was
+to provide an API to @value{GDBN}'s functionality.
+
+@section libgdb 2.0
+@cindex @code{libgdb}
+@code{libgdb} 2.0 is an ongoing effort to update @value{GDBN} so that is
+better able to support graphical and other environments.
+
+Since @code{libgdb} development is on-going, its architecture is still
+evolving. The following components have so far been identified:
+
+@itemize @bullet
+@item
+Observer - @file{gdb-events.h}.
+@item
+Builder - @file{ui-out.h}
+@item
+Event Loop - @file{event-loop.h}
+@item
+Library - @file{gdb.h}
+@end itemize
+
+The model that ties these components together is described below.
+
+@section The @code{libgdb} Model
+
+A client of @code{libgdb} interacts with the library in two ways.
+
+@itemize @bullet
+@item
+As an observer (using @file{gdb-events}) receiving notifications from
+@code{libgdb} of any internal state changes (break point changes, run
+state, etc).
+@item
+As a client querying @code{libgdb} (using the @file{ui-out} builder) to
+obtain various status values from @value{GDBN}.
+@end itemize
+
+Since @code{libgdb} could have multiple clients (e.g. a GUI supporting
+the existing @value{GDBN} CLI), those clients must co-operate when
+controlling @code{libgdb}. In particular, a client must ensure that
+@code{libgdb} is idle (i.e. no other client is using @code{libgdb})
+before responding to a @file{gdb-event} by making a query.
+
+@section CLI support
+
+At present @value{GDBN}'s CLI is very much entangled in with the core of
+@code{libgdb}. Consequently, a client wishing to include the CLI in
+their interface needs to carefully co-ordinate its own and the CLI's
+requirements.
+
+It is suggested that the client set @code{libgdb} up to be bi-modal
+(alternate between CLI and client query modes). The notes below sketch
+out the theory:
+
+@itemize @bullet
+@item
+The client registers itself as an observer of @code{libgdb}.
+@item
+The client create and install @code{cli-out} builder using its own
+versions of the @code{ui-file} @code{gdb_stderr}, @code{gdb_stdtarg} and
+@code{gdb_stdout} streams.
+@item
+The client creates a separate custom @code{ui-out} builder that is only
+used while making direct queries to @code{libgdb}.
+@end itemize
+
+When the client receives input intended for the CLI, it simply passes it
+along. Since the @code{cli-out} builder is installed by default, all
+the CLI output in response to that command is routed (pronounced rooted)
+through to the client controlled @code{gdb_stdout} et.@: al.@: streams.
+At the same time, the client is kept abreast of internal changes by
+virtue of being a @code{libgdb} observer.
+
+The only restriction on the client is that it must wait until
+@code{libgdb} becomes idle before initiating any queries (using the
+client's custom builder).
+
+@section @code{libgdb} components
+
+@subheading Observer - @file{gdb-events.h}
+@file{gdb-events} provides the client with a very raw mechanism that can
+be used to implement an observer. At present it only allows for one
+observer and that observer must, internally, handle the need to delay
+the processing of any event notifications until after @code{libgdb} has
+finished the current command.
+
+@subheading Builder - @file{ui-out.h}
+@file{ui-out} provides the infrastructure necessary for a client to
+create a builder. That builder is then passed down to @code{libgdb}
+when doing any queries.
+
+@subheading Event Loop - @file{event-loop.h}
+@c There could be an entire section on the event-loop
+@file{event-loop}, currently non-re-entrant, provides a simple event
+loop. A client would need to either plug its self into this loop or,
+implement a new event-loop that GDB would use.
+
+The event-loop will eventually be made re-entrant. This is so that
+@value{GDB} can better handle the problem of some commands blocking
+instead of returning.
+
+@subheading Library - @file{gdb.h}
+@file{libgdb} is the most obvious component of this system. It provides
+the query interface. Each function is parameterized by a @code{ui-out}
+builder. The result of the query is constructed using that builder
+before the query function returns.
@node Symbol Handling
@chapter Symbol Handling
-Symbols are a key part of GDB's operation. Symbols include variables,
+Symbols are a key part of @value{GDBN}'s operation. Symbols include variables,
functions, and types.
@section Symbol Reading
-GDB reads symbols from ``symbol files''. The usual symbol file is the
-file containing the program which GDB is debugging. GDB can be directed
-to use a different file for symbols (with the @code{symbol-file}
-command), and it can also read more symbols via the ``add-file'' and
-``load'' commands, or while reading symbols from shared libraries.
-
-Symbol files are initially opened by code in @file{symfile.c} using the
-BFD library. BFD identifies the type of the file by examining its
-header. @code{symfile_init} then uses this identification to locate a
-set of symbol-reading functions.
-
-Symbol reading modules identify themselves to GDB by calling
+@cindex symbol reading
+@cindex reading of symbols
+@cindex symbol files
+@value{GDBN} reads symbols from @dfn{symbol files}. The usual symbol
+file is the file containing the program which @value{GDBN} is
+debugging. @value{GDBN} can be directed to use a different file for
+symbols (with the @samp{symbol-file} command), and it can also read
+more symbols via the @samp{add-file} and @samp{load} commands, or while
+reading symbols from shared libraries.
+
+@findex find_sym_fns
+Symbol files are initially opened by code in @file{symfile.c} using
+the BFD library (@pxref{Support Libraries}). BFD identifies the type
+of the file by examining its header. @code{find_sym_fns} then uses
+this identification to locate a set of symbol-reading functions.
+
+@findex add_symtab_fns
+@cindex @code{sym_fns} structure
+@cindex adding a symbol-reading module
+Symbol-reading modules identify themselves to @value{GDBN} by calling
@code{add_symtab_fns} during their module initialization. The argument
to @code{add_symtab_fns} is a @code{struct sym_fns} which contains the
name (or name prefix) of the symbol format, the length of the prefix,
and pointers to four functions. These functions are called at various
-times to process symbol-files whose identification matches the specified
+times to process symbol files whose identification matches the specified
prefix.
The functions supplied by each module are:
@@ -376,11 +1514,12 @@ The functions supplied by each module are:
@table @code
@item @var{xyz}_symfile_init(struct sym_fns *sf)
+@cindex secondary symbol file
Called from @code{symbol_file_add} when we are about to read a new
symbol file. This function should clean up any internal state (possibly
resulting from half-read previous files, for example) and prepare to
-read a new symbol file. Note that the symbol file which we are reading
-might be a new "main" symbol file, or might be a secondary symbol file
+read a new symbol file. Note that the symbol file which we are reading
+might be a new ``main'' symbol file, or might be a secondary symbol file
whose symbols are being added to the existing symbol table.
The argument to @code{@var{xyz}_symfile_init} is a newly allocated
@@ -396,19 +1535,19 @@ There is no result from @code{@var{xyz}_symfile_init}, but it can call
@item @var{xyz}_new_init()
Called from @code{symbol_file_add} when discarding existing symbols.
-This function need only handle the symbol-reading module's internal
-state; the symbol table data structures visible to the rest of GDB will
-be discarded by @code{symbol_file_add}. It has no arguments and no
-result. It may be called after @code{@var{xyz}_symfile_init}, if a new
-symbol table is being read, or may be called alone if all symbols are
-simply being discarded.
+This function needs only handle the symbol-reading module's internal
+state; the symbol table data structures visible to the rest of
+@value{GDBN} will be discarded by @code{symbol_file_add}. It has no
+arguments and no result. It may be called after
+@code{@var{xyz}_symfile_init}, if a new symbol table is being read, or
+may be called alone if all symbols are simply being discarded.
@item @var{xyz}_symfile_read(struct sym_fns *sf, CORE_ADDR addr, int mainline)
Called from @code{symbol_file_add} to actually read the symbols from a
symbol-file into a set of psymtabs or symtabs.
-@code{sf} points to the struct sym_fns originally passed to
+@code{sf} points to the @code{struct sym_fns} originally passed to
@code{@var{xyz}_sym_init} for possible initialization. @code{addr} is
the offset between the file's specified start address and its true
address in memory. @code{mainline} is 1 if this is the main symbol
@@ -419,44 +1558,51 @@ or dynamically loaded file) is being read.@refill
In addition, if a symbol-reading module creates psymtabs when
@var{xyz}_symfile_read is called, these psymtabs will contain a pointer
to a function @code{@var{xyz}_psymtab_to_symtab}, which can be called
-from any point in the GDB symbol-handling code.
+from any point in the @value{GDBN} symbol-handling code.
@table @code
@item @var{xyz}_psymtab_to_symtab (struct partial_symtab *pst)
-Called from @code{psymtab_to_symtab} (or the PSYMTAB_TO_SYMTAB macro) if
+Called from @code{psymtab_to_symtab} (or the @code{PSYMTAB_TO_SYMTAB} macro) if
the psymtab has not already been read in and had its @code{pst->symtab}
pointer set. The argument is the psymtab to be fleshed-out into a
-symtab. Upon return, pst->readin should have been set to 1, and
-pst->symtab should contain a pointer to the new corresponding symtab, or
+symtab. Upon return, @code{pst->readin} should have been set to 1, and
+@code{pst->symtab} should contain a pointer to the new corresponding symtab, or
zero if there were no symbols in that part of the symbol file.
@end table
@section Partial Symbol Tables
-GDB has three types of symbol tables.
+@value{GDBN} has three types of symbol tables:
@itemize @bullet
-
-@item full symbol tables (symtabs). These contain the main information
-about symbols and addresses.
-
-@item partial symbol tables (psymtabs). These contain enough
+@cindex full symbol table
+@cindex symtabs
+@item
+Full symbol tables (@dfn{symtabs}). These contain the main
+information about symbols and addresses.
+
+@cindex psymtabs
+@item
+Partial symbol tables (@dfn{psymtabs}). These contain enough
information to know when to read the corresponding part of the full
symbol table.
-@item minimal symbol tables (msymtabs). These contain information
+@cindex minimal symbol table
+@cindex minsymtabs
+@item
+Minimal symbol tables (@dfn{msymtabs}). These contain information
gleaned from non-debugging symbols.
-
@end itemize
+@cindex partial symbol table
This section describes partial symbol tables.
A psymtab is constructed by doing a very quick pass over an executable
file's debugging information. Small amounts of information are
-extracted -- enough to identify which parts of the symbol table will
+extracted---enough to identify which parts of the symbol table will
need to be re-read and fully digested later, when the user needs the
-information. The speed of this pass causes GDB to start up very
+information. The speed of this pass causes @value{GDBN} to start up very
quickly. Later, as the detailed rereading occurs, it occurs in small
pieces, at various times, and the delay therefrom is mostly invisible to
the user.
@@ -465,33 +1611,37 @@ the user.
The symbols that show up in a file's psymtab should be, roughly, those
visible to the debugger's user when the program is not running code from
that file. These include external symbols and types, static symbols and
-types, and enum values declared at file scope.
+types, and @code{enum} values declared at file scope.
The psymtab also contains the range of instruction addresses that the
full symbol table would represent.
+@cindex finding a symbol
+@cindex symbol lookup
The idea is that there are only two ways for the user (or much of the
code in the debugger) to reference a symbol:
@itemize @bullet
-
-@item by its address
-(e.g. execution stops at some address which is inside a function in this
-file). The address will be noticed to be in the range of this psymtab,
-and the full symtab will be read in. @code{find_pc_function},
-@code{find_pc_line}, and other @code{find_pc_@dots{}} functions handle
-this.
-
-@item by its name
+@findex find_pc_function
+@findex find_pc_line
+@item
+By its address (e.g. execution stops at some address which is inside a
+function in this file). The address will be noticed to be in the
+range of this psymtab, and the full symtab will be read in.
+@code{find_pc_function}, @code{find_pc_line}, and other
+@code{find_pc_@dots{}} functions handle this.
+
+@cindex lookup_symbol
+@item
+By its name
(e.g. the user asks to print a variable, or set a breakpoint on a
function). Global names and file-scope names will be found in the
psymtab, which will cause the symtab to be pulled in. Local names will
have to be qualified by a global name, or a file-scope name, in which
case we will have already read in the symtab as we evaluated the
-qualifier. Or, a local symbol can be referenced when we are "in" a
+qualifier. Or, a local symbol can be referenced when we are ``in'' a
local scope, in which case the first case applies. @code{lookup_symbol}
does most of the work here.
-
@end itemize
The only reason that psymtabs exist is to cause a symtab to be read in
@@ -502,12 +1652,13 @@ them anyway. Psymtabs don't have the idea of the type of a symbol,
either, so types need not appear, unless they will be referenced by
name.
-It is a bug for GDB to behave one way when only a psymtab has been read,
-and another way if the corresponding symtab has been read in. Such bugs
-are typically caused by a psymtab that does not contain all the visible
-symbols, or which has the wrong instruction address ranges.
+It is a bug for @value{GDBN} to behave one way when only a psymtab has
+been read, and another way if the corresponding symtab has been read
+in. Such bugs are typically caused by a psymtab that does not contain
+all the visible symbols, or which has the wrong instruction address
+ranges.
-The psymtab for a particular section of a symbol-file (objfile) could be
+The psymtab for a particular section of a symbol file (objfile) could be
thrown away after the symtab has been read in. The symtab should always
be searched before the psymtab, so the psymtab will never be used (in a
bug-free environment). Currently, psymtabs are allocated on an obstack,
@@ -517,52 +1668,62 @@ unless you want to do a lot more work.
@section Types
-Fundamental Types (e.g., FT_VOID, FT_BOOLEAN).
+@unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}).
-These are the fundamental types that GDB uses internally. Fundamental
+@cindex fundamental types
+These are the fundamental types that @value{GDBN} uses internally. Fundamental
types from the various debugging formats (stabs, ELF, etc) are mapped
into one of these. They are basically a union of all fundamental types
-that gdb knows about for all the languages that GDB knows about.
+that @value{GDBN} knows about for all the languages that @value{GDBN}
+knows about.
-Type Codes (e.g., TYPE_CODE_PTR, TYPE_CODE_ARRAY).
+@unnumberedsubsec Type Codes (e.g., @code{TYPE_CODE_PTR}, @code{TYPE_CODE_ARRAY}).
-Each time GDB builds an internal type, it marks it with one of these
-types. The type may be a fundamental type, such as TYPE_CODE_INT, or a
-derived type, such as TYPE_CODE_PTR which is a pointer to another type.
-Typically, several FT_* types map to one TYPE_CODE_* type, and are
-distinguished by other members of the type struct, such as whether the
-type is signed or unsigned, and how many bits it uses.
+@cindex type codes
+Each time @value{GDBN} builds an internal type, it marks it with one
+of these types. The type may be a fundamental type, such as
+@code{TYPE_CODE_INT}, or a derived type, such as @code{TYPE_CODE_PTR}
+which is a pointer to another type. Typically, several @code{FT_*}
+types map to one @code{TYPE_CODE_*} type, and are distinguished by
+other members of the type struct, such as whether the type is signed
+or unsigned, and how many bits it uses.
-Builtin Types (e.g., builtin_type_void, builtin_type_char).
+@unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}).
These are instances of type structs that roughly correspond to
-fundamental types and are created as global types for GDB to use for
-various ugly historical reasons. We eventually want to eliminate these.
-Note for example that builtin_type_int initialized in gdbtypes.c is
-basically the same as a TYPE_CODE_INT type that is initialized in
-c-lang.c for an FT_INTEGER fundamental type. The difference is that the
-builtin_type is not associated with any particular objfile, and only one
-instance exists, while c-lang.c builds as many TYPE_CODE_INT types as
-needed, with each one associated with some particular objfile.
+fundamental types and are created as global types for @value{GDBN} to
+use for various ugly historical reasons. We eventually want to
+eliminate these. Note for example that @code{builtin_type_int}
+initialized in @file{gdbtypes.c} is basically the same as a
+@code{TYPE_CODE_INT} type that is initialized in @file{c-lang.c} for
+an @code{FT_INTEGER} fundamental type. The difference is that the
+@code{builtin_type} is not associated with any particular objfile, and
+only one instance exists, while @file{c-lang.c} builds as many
+@code{TYPE_CODE_INT} types as needed, with each one associated with
+some particular objfile.
@section Object File Formats
+@cindex object file formats
@subsection a.out
-The @file{a.out} format is the original file format for Unix. It
-consists of three sections: text, data, and bss, which are for program
-code, initialized data, and uninitialized data, respectively.
+@cindex @code{a.out} format
+The @code{a.out} format is the original file format for Unix. It
+consists of three sections: @code{text}, @code{data}, and @code{bss},
+which are for program code, initialized data, and uninitialized data,
+respectively.
-The @file{a.out} format is so simple that it doesn't have any reserved
+The @code{a.out} format is so simple that it doesn't have any reserved
place for debugging information. (Hey, the original Unix hackers used
-@file{adb}, which is a machine-language debugger.) The only debugging
-format for @file{a.out} is stabs, which is encoded as a set of normal
+@samp{adb}, which is a machine-language debugger!) The only debugging
+format for @code{a.out} is stabs, which is encoded as a set of normal
symbols with distinctive attributes.
-The basic @file{a.out} reader is in @file{dbxread.c}.
+The basic @code{a.out} reader is in @file{dbxread.c}.
@subsection COFF
+@cindex COFF format
The COFF format was introduced with System V Release 3 (SVR3) Unix.
COFF files may have multiple sections, each prefixed by a header. The
number of sections is limited.
@@ -576,6 +1737,7 @@ The COFF reader is in @file{coffread.c}.
@subsection ECOFF
+@cindex ECOFF format
ECOFF is an extended COFF originally introduced for Mips and Alpha
workstations.
@@ -583,11 +1745,12 @@ The basic ECOFF reader is in @file{mipsread.c}.
@subsection XCOFF
+@cindex XCOFF format
The IBM RS/6000 running AIX uses an object file format called XCOFF.
The COFF sections, symbols, and line numbers are used, but debugging
-symbols are dbx-style stabs whose strings are located in the
-@samp{.debug} section (rather than the string table). For more
-information, see @xref{Top,,,stabs,The Stabs Debugging Format}.
+symbols are @code{dbx}-style stabs whose strings are located in the
+@code{.debug} section (rather than the string table). For more
+information, see @ref{Top,,,stabs,The Stabs Debugging Format}.
The shared library scheme has a clean interface for figuring out what
shared libraries are in use, but the catch is that everything which
@@ -598,14 +1761,16 @@ been run (or the core file has been read).
@subsection PE
-Windows 95 and NT use the PE (Portable Executable) format for their
+@cindex PE-COFF format
+Windows 95 and NT use the PE (@dfn{Portable Executable}) format for their
executables. PE is basically COFF with additional headers.
-While BFD includes special PE support, GDB needs only the basic
+While BFD includes special PE support, @value{GDBN} needs only the basic
COFF reader.
@subsection ELF
+@cindex ELF format
The ELF format came with System V Release 4 (SVR4) Unix. ELF is similar
to COFF in being organized into a number of sections, but it removes
many of COFF's limitations.
@@ -614,6 +1779,7 @@ The basic ELF reader is in @file{elfread.c}.
@subsection SOM
+@cindex SOM format
SOM is HP's object file and debug format (not to be confused with IBM's
SOM, which is a cross-language ABI).
@@ -621,8 +1787,9 @@ The SOM reader is in @file{hpread.c}.
@subsection Other File Formats
-Other file formats that have been supported by GDB include Netware
-Loadable Modules (@file{nlmread.c}.
+@cindex Netware Loadable Module format
+Other file formats that have been supported by @value{GDBN} include Netware
+Loadable Modules (@file{nlmread.c}).
@section Debugging File Formats
@@ -631,6 +1798,7 @@ are independent of the object file format.
@subsection stabs
+@cindex stabs debugging info
@code{stabs} started out as special symbols within the @code{a.out}
format. Since then, it has been encapsulated into other file
formats, such as COFF and ELF.
@@ -641,17 +1809,20 @@ the real work.
@subsection COFF
+@cindex COFF debugging info
The basic COFF definition includes debugging information. The level
of support is minimal and non-extensible, and is not often used.
@subsection Mips debug (Third Eye)
+@cindex ECOFF debugging info
ECOFF includes a definition of a special debug format.
The file @file{mdebugread.c} implements reading for this format.
@subsection DWARF 1
+@cindex DWARF 1 debugging info
DWARF 1 is a debugging format that was originally designed to be
used with ELF in SVR4 systems.
@@ -666,26 +1837,29 @@ The DWARF 1 reader is in @file{dwarfread.c}.
@subsection DWARF 2
+@cindex DWARF 2 debugging info
DWARF 2 is an improved but incompatible version of DWARF 1.
The DWARF 2 reader is in @file{dwarf2read.c}.
@subsection SOM
+@cindex SOM debugging info
Like COFF, the SOM definition includes debugging information.
-@section Adding a New Symbol Reader to GDB
+@section Adding a New Symbol Reader to @value{GDBN}
-If you are using an existing object file format (a.out, COFF, ELF, etc),
+@cindex adding debugging info reader
+If you are using an existing object file format (@code{a.out}, COFF, ELF, etc),
there is probably little to be done.
If you need to add a new object file format, you must first add it to
BFD. This is beyond the scope of this document.
You must then arrange for the BFD code to provide access to the
-debugging symbols. Generally GDB will have to call swapping routines
+debugging symbols. Generally @value{GDBN} will have to call swapping routines
from BFD and a few other BFD internal routines to locate the debugging
-information. As much as possible, GDB should not depend on the BFD
+information. As much as possible, @value{GDBN} should not depend on the BFD
internal data structures.
For some targets (e.g., COFF), there is a special transfer vector used
@@ -693,61 +1867,66 @@ to call swapping routines, since the external data structures on various
platforms have different sizes and layouts. Specialized routines that
will only ever be implemented by one object file format may be called
directly. This interface should be described in a file
-@file{bfd/libxyz.h}, which is included by GDB.
+@file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}.
@node Language Support
@chapter Language Support
-GDB's language support is mainly driven by the symbol reader, although
-it is possible for the user to set the source language manually.
+@cindex language support
+@value{GDBN}'s language support is mainly driven by the symbol reader,
+although it is possible for the user to set the source language
+manually.
-GDB chooses the source language by looking at the extension of the file
-recorded in the debug info; @code{.c} means C, @code{.f} means Fortran,
-etc. It may also use a special-purpose language identifier if the debug
-format supports it, such as DWARF.
+@value{GDBN} chooses the source language by looking at the extension
+of the file recorded in the debug info; @file{.c} means C, @file{.f}
+means Fortran, etc. It may also use a special-purpose language
+identifier if the debug format supports it, like with DWARF.
-@section Adding a Source Language to GDB
+@section Adding a Source Language to @value{GDBN}
-To add other languages to GDB's expression parser, follow the following
-steps:
+@cindex adding source language
+To add other languages to @value{GDBN}'s expression parser, follow the
+following steps:
@table @emph
@item Create the expression parser.
+@cindex expression parser
This should reside in a file @file{@var{lang}-exp.y}. Routines for
-building parsed expressions into a @samp{union exp_element} list are in
+building parsed expressions into a @code{union exp_element} list are in
@file{parse.c}.
+@cindex language parser
Since we can't depend upon everyone having Bison, and YACC produces
parsers that define a bunch of global names, the following lines
-@emph{must} be included at the top of the YACC parser, to prevent the
+@strong{must} be included at the top of the YACC parser, to prevent the
various parsers from defining the same global names:
@example
-#define yyparse @var{lang}_parse
-#define yylex @var{lang}_lex
-#define yyerror @var{lang}_error
-#define yylval @var{lang}_lval
-#define yychar @var{lang}_char
-#define yydebug @var{lang}_debug
-#define yypact @var{lang}_pact
-#define yyr1 @var{lang}_r1
-#define yyr2 @var{lang}_r2
-#define yydef @var{lang}_def
-#define yychk @var{lang}_chk
-#define yypgo @var{lang}_pgo
-#define yyact @var{lang}_act
-#define yyexca @var{lang}_exca
-#define yyerrflag @var{lang}_errflag
-#define yynerrs @var{lang}_nerrs
+#define yyparse @var{lang}_parse
+#define yylex @var{lang}_lex
+#define yyerror @var{lang}_error
+#define yylval @var{lang}_lval
+#define yychar @var{lang}_char
+#define yydebug @var{lang}_debug
+#define yypact @var{lang}_pact
+#define yyr1 @var{lang}_r1
+#define yyr2 @var{lang}_r2
+#define yydef @var{lang}_def
+#define yychk @var{lang}_chk
+#define yypgo @var{lang}_pgo
+#define yyact @var{lang}_act
+#define yyexca @var{lang}_exca
+#define yyerrflag @var{lang}_errflag
+#define yynerrs @var{lang}_nerrs
@end example
At the bottom of your parser, define a @code{struct language_defn} and
initialize it with the right values for your language. Define an
@code{initialize_@var{lang}} routine and have it call
-@samp{add_language(@var{lang}_language_defn)} to tell the rest of GDB
+@samp{add_language(@var{lang}_language_defn)} to tell the rest of @value{GDBN}
that your language exists. You'll need some other supporting variables
and functions, which will be used via pointers from your
@code{@var{lang}_language_defn}. See the declaration of @code{struct
@@ -756,11 +1935,16 @@ for more information.
@item Add any evaluation routines, if necessary
+@cindex expression evaluation routines
+@findex evaluate_subexp
+@findex prefixify_subexp
+@findex length_of_subexp
If you need new opcodes (that represent the operations of the language),
add them to the enumerated type in @file{expression.h}. Add support
-code for these operations in @code{eval.c:evaluate_subexp()}. Add cases
+code for these operations in the @code{evaluate_subexp} function
+defined in the file @file{eval.c}. Add cases
for new opcodes in two functions from @file{parse.c}:
-@code{prefixify_subexp()} and @code{length_of_subexp()}. These compute
+@code{prefixify_subexp} and @code{length_of_subexp}. These compute
the number of @code{exp_element}s that a given operation takes up.
@item Update some existing code
@@ -773,15 +1957,18 @@ These routines include type predicates and such, which (in some cases)
are language dependent. If your language does not appear in the switch
statement, an error is reported.
+@vindex current_language
Also included in @file{language.c} is the code that updates the variable
@code{current_language}, and the routines that translate the
@code{language_@var{lang}} enumerated identifier into a printable
string.
+@findex _initialize_language
Update the function @code{_initialize_language} to include your
language. This function picks the default language upon startup, so is
-dependent upon which languages that GDB is built for.
+dependent upon which languages that @value{GDBN} is built for.
+@findex allocate_symtab
Update @code{allocate_symtab} in @file{symfile.c} and/or symbol-reading
code so that the language of each symtab (source file) is set properly.
This is used to determine the language to use at each stack frame level.
@@ -790,30 +1977,34 @@ file. If the language can be better inferred from the symbol
information, please set the language of the symtab in the symbol-reading
code.
-Add helper code to @code{expprint.c:print_subexp()} to handle any new
+@findex print_subexp
+@findex op_print_tab
+Add helper code to @code{print_subexp} (in @file{expprint.c}) to handle any new
expression opcodes you have added to @file{expression.h}. Also, add the
printed representations of your operators to @code{op_print_tab}.
@item Add a place of call
+@findex parse_exp_1
Add a call to @code{@var{lang}_parse()} and @code{@var{lang}_error} in
-@code{parse.c:parse_exp_1()}.
+@code{parse_exp_1} (defined in @file{parse.c}).
@item Use macros to trim code
-The user has the option of building GDB for some or all of the
-languages. If the user decides to build GDB for the language
+@cindex trimming language-dependent code
+The user has the option of building @value{GDBN} for some or all of the
+languages. If the user decides to build @value{GDBN} for the language
@var{lang}, then every file dependent on @file{language.h} will have the
macro @code{_LANG_@var{lang}} defined in it. Use @code{#ifdef}s to
leave out large routines that the user won't need if he or she is not
using your language.
-Note that you do not need to do this in your YACC parser, since if GDB
+Note that you do not need to do this in your YACC parser, since if @value{GDBN}
is not build for @var{lang}, then @file{@var{lang}-exp.tab.o} (the
-compiled form of your parser) is not linked into GDB at all.
+compiled form of your parser) is not linked into @value{GDBN} at all.
-See the file @file{configure.in} for how GDB is configured for different
-languages.
+See the file @file{configure.in} for how @value{GDBN} is configured
+for different languages.
@item Edit @file{Makefile.in}
@@ -821,7 +2012,6 @@ Add dependencies in @file{Makefile.in}. Make sure you update the macro
variables such as @code{HFILES} and @code{OBJS}, otherwise your code may
not get linked in, or, worse yet, it may not get @code{tar}red into the
distribution!
-
@end table
@@ -829,44 +2019,50 @@ distribution!
@chapter Host Definition
-With the advent of autoconf, it's rarely necessary to have host
-definition machinery anymore.
+With the advent of Autoconf, it's rarely necessary to have host
+definition machinery anymore. The following information is provided,
+mainly, as an historical reference.
@section Adding a New Host
-Most of GDB's host configuration support happens via autoconf. It
-should be rare to need new host-specific definitions. GDB still uses
-the host-specific definitions and files listed below, but these mostly
-exist for historical reasons, and should eventually disappear.
-
-Several files control GDB's configuration for host systems:
+@cindex adding a new host
+@cindex host, adding
+@value{GDBN}'s host configuration support normally happens via Autoconf.
+New host-specific definitions should not be needed. Older hosts
+@value{GDBN} still use the host-specific definitions and files listed
+below, but these mostly exist for historical reasons, and will
+eventually disappear.
@table @file
-
@item gdb/config/@var{arch}/@var{xyz}.mh
-Specifies Makefile fragments needed when hosting on machine @var{xyz}.
-In particular, this lists the required machine-dependent object files,
-by defining @samp{XDEPFILES=@dots{}}. Also specifies the header file
-which describes host @var{xyz}, by defining @code{XM_FILE=
-xm-@var{xyz}.h}. You can also define @code{CC}, @code{SYSV_DEFINE},
-@code{XM_CFLAGS}, @code{XM_ADD_FILES}, @code{XM_CLIBS}, @code{XM_CDEPS},
-etc.; see @file{Makefile.in}.
+This file once contained both host and native configuration information
+(@pxref{Native Debugging}) for the machine @var{xyz}. The host
+configuration information is now handed by Autoconf.
+
+Host configuration information included a definition of
+@code{XM_FILE=xm-@var{xyz}.h} and possibly definitions for @code{CC},
+@code{SYSV_DEFINE}, @code{XM_CFLAGS}, @code{XM_ADD_FILES},
+@code{XM_CLIBS}, @code{XM_CDEPS}, etc.; see @file{Makefile.in}.
+
+New host only configurations do not need this file.
@item gdb/config/@var{arch}/xm-@var{xyz}.h
-(@file{xm.h} is a link to this file, created by configure). Contains C
-macro definitions describing the host system environment, such as byte
-order, host C compiler and library.
+This file once contained definitions and includes required when hosting
+gdb on machine @var{xyz}. Those definitions and includes are now
+handled by Autoconf.
-@item gdb/@var{xyz}-xdep.c
-Contains any miscellaneous C code required for this machine as a host.
-On most machines it doesn't exist at all. If it does exist, put
-@file{@var{xyz}-xdep.o} into the @code{XDEPFILES} line in
-@file{gdb/config/@var{arch}/@var{xyz}.mh}.
+New host and native configurations do not need this file.
+
+@emph{Maintainer's note: Some hosts continue to use the @file{xm-xyz.h}
+file to define the macros @var{HOST_FLOAT_FORMAT},
+@var{HOST_DOUBLE_FORMAT} and @var{HOST_LONG_DOUBLE_FORMAT}. That code
+also needs to be replaced with either an Autoconf or run-time test.}
@end table
@subheading Generic Host Support Files
+@cindex generic host support
There are some ``generic'' versions of routines that can be used by
various systems. These can be customized in various ways by macros
defined in your @file{xm-@var{xyz}.h} file. If these routines work for
@@ -879,7 +2075,8 @@ Put them into @code{@var{xyz}-xdep.c}, and put @code{@var{xyz}-xdep.o}
into @code{XDEPFILES}.
@table @file
-
+@cindex remote debugging support
+@cindex serial line support
@item ser-unix.c
This contains serial line support for Unix systems. This is always
included, via the makefile variable @code{SER_HARDWIRE}; override this
@@ -887,30 +2084,28 @@ variable in the @file{.mh} file to avoid it.
@item ser-go32.c
This contains serial line support for 32-bit programs running under DOS,
-using the GO32 execution environment.
+using the DJGPP (a.k.a.@: GO32) execution environment.
+@cindex TCP remote support
@item ser-tcp.c
This contains generic TCP support using sockets.
-
@end table
@section Host Conditionals
-When GDB is configured and compiled, various macros are defined or left
-undefined, to control compilation based on the attributes of the host
-system. These macros and their meanings (or if the meaning is not
-documented here, then one of the source files where they are used is
-indicated) are:
-
-@table @code
+When @value{GDBN} is configured and compiled, various macros are
+defined or left undefined, to control compilation based on the
+attributes of the host system. These macros and their meanings (or if
+the meaning is not documented here, then one of the source files where
+they are used is indicated) are:
-@item GDBINIT_FILENAME
-The default name of GDB's initialization file (normally @file{.gdbinit}).
+@ftable @code
+@item @value{GDBN}INIT_FILENAME
+The default name of @value{GDBN}'s initialization file (normally
+@file{.gdbinit}).
-@item MEM_FNS_DECLARED
-Your host config file defines this if it includes declarations of
-@code{memcpy} and @code{memset}. Define this to avoid conflicts between
-the native include files and the declarations in @file{defs.h}.
+@item NO_STD_REGS
+This macro is deprecated.
@item NO_SYS_FILE
Define this if your system does not have a @code{<sys/file.h>}.
@@ -924,22 +2119,26 @@ Define this to expand into code that will define the function named by
the expansion of @code{SIGWINCH_HANDLER}.
@item ALIGN_STACK_ON_STARTUP
+@cindex stack alignment
Define this if your system is of a sort that will crash in
@code{tgetent} if the stack happens not to be longword-aligned when
@code{main} is called. This is a rare situation, but is known to occur
on several different types of systems.
@item CRLF_SOURCE_FILES
+@cindex DOS text files
Define this if host files use @code{\r\n} rather than @code{\n} as a
line terminator. This will cause source file listings to omit @code{\r}
-characters when printing and it will allow \r\n line endings of files
-which are "sourced" by gdb. It must be possible to open files in binary
+characters when printing and it will allow @code{\r\n} line endings of files
+which are ``sourced'' by gdb. It must be possible to open files in binary
mode using @code{O_BINARY} or, for fopen, @code{"rb"}.
@item DEFAULT_PROMPT
+@cindex prompt
The default value of the prompt string (normally @code{"(gdb) "}).
@item DEV_TTY
+@cindex terminal device
The name of the generic TTY device, defaults to @code{"/dev/tty"}.
@item FCLOSE_PROVIDED
@@ -952,29 +2151,22 @@ Define this if binary files are opened the same way as text files.
@item GETENV_PROVIDED
Define this if the system declares @code{getenv} in its headers included
-in @code{defs.h}. This isn't needed unless your compiler is unusually
+in @code{defs.h}. This isn't needed unless your compiler is unusually
anal.
@item HAVE_MMAP
+@findex mmap
In some cases, use the system call @code{mmap} for reading symbol
tables. For some machines this allows for sharing and quick updates.
-@item HAVE_SIGSETMASK
-Define this if the host system has job control, but does not define
-@code{sigsetmask()}. Currently, this is only true of the RS/6000.
-
@item HAVE_TERMIO
Define this if the host system has @code{termio.h}.
-@item HOST_BYTE_ORDER
-The ordering of bytes in the host. This must be defined to be either
-@code{BIG_ENDIAN} or @code{LITTLE_ENDIAN}.
-
@item INT_MAX
-@item INT_MIN
-@item LONG_MAX
-@item UINT_MAX
-@item ULONG_MAX
+@itemx INT_MIN
+@itemx LONG_MAX
+@itemx UINT_MAX
+@itemx ULONG_MAX
Values for host-side constants.
@item ISATTY
@@ -986,26 +2178,28 @@ it will default to @code{long long} or @code{long}, depending on
@code{CC_HAS_LONG_LONG}.
@item CC_HAS_LONG_LONG
-Define this if the host C compiler supports ``long long''. This is set
-by the configure script.
+@cindex @code{long long} data type
+Define this if the host C compiler supports @code{long long}. This is set
+by the @code{configure} script.
@item PRINTF_HAS_LONG_LONG
Define this if the host can handle printing of long long integers via
-the printf format directive ``ll''. This is set by the configure script.
+the printf format conversion specifier @code{ll}. This is set by the
+@code{configure} script.
@item HAVE_LONG_DOUBLE
-Define this if the host C compiler supports ``long double''. This is
-set by the configure script.
+Define this if the host C compiler supports @code{long double}. This is
+set by the @code{configure} script.
@item PRINTF_HAS_LONG_DOUBLE
Define this if the host can handle printing of long double float-point
-numbers via the printf format directive ``Lg''. This is set by the
-configure script.
+numbers via the printf format conversion specifier @code{Lg}. This is
+set by the @code{configure} script.
@item SCANF_HAS_LONG_DOUBLE
Define this if the host can handle the parsing of long double
-float-point numbers via the scanf format directive directive
-``Lg''. This is set by the configure script.
+float-point numbers via the scanf format conversion specifier
+@code{Lg}. This is set by the @code{configure} script.
@item LSEEK_NOT_LINEAR
Define this if @code{lseek (n)} does not necessarily move to byte number
@@ -1013,17 +2207,9 @@ Define this if @code{lseek (n)} does not necessarily move to byte number
is normally faster to define @code{CRLF_SOURCE_FILES} when possible.
@item L_SET
-This macro is used as the argument to lseek (or, most commonly,
-bfd_seek). FIXME, should be replaced by SEEK_SET instead, which is the
-POSIX equivalent.
-
-@item MAINTENANCE_CMDS
-If the value of this is 1, then a number of optional maintenance
-commands are compiled in.
-
-@item MALLOC_INCOMPATIBLE
-Define this if the system's prototype for @code{malloc} differs from the
-@sc{ANSI} definition.
+This macro is used as the argument to @code{lseek} (or, most commonly,
+@code{bfd_seek}). FIXME, should be replaced by SEEK_SET instead,
+which is the POSIX equivalent.
@item MMAP_BASE_ADDRESS
When using HAVE_MMAP, the first mapping should go at this address.
@@ -1031,10 +2217,6 @@ When using HAVE_MMAP, the first mapping should go at this address.
@item MMAP_INCREMENT
when using HAVE_MMAP, this is the increment between mappings.
-@item NEED_POSIX_SETPGID
-Define this to use the POSIX version of @code{setpgid} to determine
-whether job control is available.
-
@item NORETURN
If defined, this should be one or more tokens, such as @code{volatile},
that can be used in both the declaration and definition of functions to
@@ -1048,24 +2230,31 @@ of functions to indicate that they never return. The default is already
set correctly if compiling with GCC. This will almost never need to be
defined.
+@item USE_GENERIC_DUMMY_FRAMES
+@cindex generic dummy frames
+Define this to 1 if the target is using the generic inferior function
+call code. See @code{blockframe.c} for more information.
+
@item USE_MMALLOC
-GDB will use the @code{mmalloc} library for memory allocation for symbol
-reading if this symbol is defined. Be careful defining it since there
-are systems on which @code{mmalloc} does not work for some reason. One
-example is the DECstation, where its RPC library can't cope with our
-redefinition of @code{malloc} to call @code{mmalloc}. When defining
-@code{USE_MMALLOC}, you will also have to set @code{MMALLOC} in the
-Makefile, to point to the mmalloc library. This define is set when you
-configure with --with-mmalloc.
+@findex mmalloc
+@value{GDBN} will use the @code{mmalloc} library for memory allocation
+for symbol reading if this symbol is defined. Be careful defining it
+since there are systems on which @code{mmalloc} does not work for some
+reason. One example is the DECstation, where its RPC library can't
+cope with our redefinition of @code{malloc} to call @code{mmalloc}.
+When defining @code{USE_MMALLOC}, you will also have to set
+@code{MMALLOC} in the Makefile, to point to the @code{mmalloc} library. This
+define is set when you configure with @samp{--with-mmalloc}.
@item NO_MMCHECK
+@findex mmcheck
Define this if you are using @code{mmalloc}, but don't want the overhead
of checking the heap with @code{mmcheck}. Note that on some systems,
-the C runtime makes calls to malloc prior to calling @code{main}, and if
+the C runtime makes calls to @code{malloc} prior to calling @code{main}, and if
@code{free} is ever called with these pointers after calling
@code{mmcheck} to enable checking, a memory corruption abort is certain
-to occur. These systems can still use mmalloc, but must define
-NO_MMCHECK.
+to occur. These systems can still use @code{mmalloc}, but must define
+@code{NO_MMCHECK}.
@item MMCHECK_FORCE
Define this to 1 if the C runtime allocates memory prior to
@@ -1073,27 +2262,25 @@ Define this to 1 if the C runtime allocates memory prior to
have to worry about it triggering a memory corruption abort. The
default is 0, which means that @code{mmcheck} will only install the heap
checking functions if there has not yet been any memory allocation
-calls, and if it fails to install the functions, gdb will issue a
+calls, and if it fails to install the functions, @value{GDBN} will issue a
warning. This is currently defined if you configure using
---with-mmalloc.
+@samp{--with-mmalloc}.
@item NO_SIGINTERRUPT
-Define this to indicate that siginterrupt() is not available.
-
-@item R_OK
-Define if this is not in a system .h file.
+@findex siginterrupt
+Define this to indicate that @code{siginterrupt} is not available.
@item SEEK_CUR
-@item SEEK_SET
-Define these to appropriate value for the system lseek(), if not already
+@itemx SEEK_SET
+Define these to appropriate value for the system @code{lseek}, if not already
defined.
@item STOP_SIGNAL
-This is the signal for stopping GDB. Defaults to SIGTSTP. (Only
-redefined for the Convex.)
+This is the signal for stopping @value{GDBN}. Defaults to
+@code{SIGTSTP}. (Only redefined for the Convex.)
@item USE_O_NOCTTY
-Define this if the interior's tty should be opened with the O_NOCTTY
+Define this if the interior's tty should be opened with the @code{O_NOCTTY}
flag. (FIXME: This should be a native-only flag, but @file{inflow.c} is
always linked in.)
@@ -1104,38 +2291,303 @@ This symbol is abused in @file{infrun.c}, @file{regex.c},
moment.)
@item lint
-Define this to help placate lint in some situations.
+Define this to help placate @code{lint} in some situations.
@item volatile
Define this to override the defaults of @code{__volatile__} or
@code{/**/}.
-
-@end table
+@end ftable
@node Target Architecture Definition
@chapter Target Architecture Definition
-GDB's target architecture defines what sort of machine-language programs
-GDB can work with, and how it works with them.
+@cindex target architecture definition
+@value{GDBN}'s target architecture defines what sort of
+machine-language programs @value{GDBN} can work with, and how it works
+with them.
-At present, the target architecture definition consists of a number of C
-macros.
+The target architecture object is implemented as the C structure
+@code{struct gdbarch *}. The structure, and its methods, are generated
+using the Bourne shell script @file{gdbarch.sh}.
@section Registers and Memory
-GDB's model of the target machine is rather simple. GDB assumes the
-machine includes a bank of registers and a block of memory. Each
-register may have a different size.
+@value{GDBN}'s model of the target machine is rather simple.
+@value{GDBN} assumes the machine includes a bank of registers and a
+block of memory. Each register may have a different size.
+
+@value{GDBN} does not have a magical way to match up with the
+compiler's idea of which registers are which; however, it is critical
+that they do match up accurately. The only way to make this work is
+to get accurate information about the order that the compiler uses,
+and to reflect that in the @code{REGISTER_NAME} and related macros.
+
+@value{GDBN} can handle big-endian, little-endian, and bi-endian architectures.
+
+@section Pointers Are Not Always Addresses
+@cindex pointer representation
+@cindex address representation
+@cindex word-addressed machines
+@cindex separate data and code address spaces
+@cindex spaces, separate data and code address
+@cindex address spaces, separate data and code
+@cindex code pointers, word-addressed
+@cindex converting between pointers and addresses
+@cindex D10V addresses
+
+On almost all 32-bit architectures, the representation of a pointer is
+indistinguishable from the representation of some fixed-length number
+whose value is the byte address of the object pointed to. On such
+machines, the words ``pointer'' and ``address'' can be used interchangeably.
+However, architectures with smaller word sizes are often cramped for
+address space, so they may choose a pointer representation that breaks this
+identity, and allows a larger code address space.
+
+For example, the Mitsubishi D10V is a 16-bit VLIW processor whose
+instructions are 32 bits long@footnote{Some D10V instructions are
+actually pairs of 16-bit sub-instructions. However, since you can't
+jump into the middle of such a pair, code addresses can only refer to
+full 32 bit instructions, which is what matters in this explanation.}.
+If the D10V used ordinary byte addresses to refer to code locations,
+then the processor would only be able to address 64kb of instructions.
+However, since instructions must be aligned on four-byte boundaries, the
+low two bits of any valid instruction's byte address are always
+zero---byte addresses waste two bits. So instead of byte addresses,
+the D10V uses word addresses---byte addresses shifted right two bits---to
+refer to code. Thus, the D10V can use 16-bit words to address 256kb of
+code space.
+
+However, this means that code pointers and data pointers have different
+forms on the D10V. The 16-bit word @code{0xC020} refers to byte address
+@code{0xC020} when used as a data address, but refers to byte address
+@code{0x30080} when used as a code address.
+
+(The D10V also uses separate code and data address spaces, which also
+affects the correspondence between pointers and addresses, but we're
+going to ignore that here; this example is already too long.)
+
+To cope with architectures like this---the D10V is not the only
+one!---@value{GDBN} tries to distinguish between @dfn{addresses}, which are
+byte numbers, and @dfn{pointers}, which are the target's representation
+of an address of a particular type of data. In the example above,
+@code{0xC020} is the pointer, which refers to one of the addresses
+@code{0xC020} or @code{0x30080}, depending on the type imposed upon it.
+@value{GDBN} provides functions for turning a pointer into an address
+and vice versa, in the appropriate way for the current architecture.
+
+Unfortunately, since addresses and pointers are identical on almost all
+processors, this distinction tends to bit-rot pretty quickly. Thus,
+each time you port @value{GDBN} to an architecture which does
+distinguish between pointers and addresses, you'll probably need to
+clean up some architecture-independent code.
+
+Here are functions which convert between pointers and addresses:
+
+@deftypefun CORE_ADDR extract_typed_address (void *@var{buf}, struct type *@var{type})
+Treat the bytes at @var{buf} as a pointer or reference of type
+@var{type}, and return the address it represents, in a manner
+appropriate for the current architecture. This yields an address
+@value{GDBN} can use to read target memory, disassemble, etc. Note that
+@var{buf} refers to a buffer in @value{GDBN}'s memory, not the
+inferior's.
+
+For example, if the current architecture is the Intel x86, this function
+extracts a little-endian integer of the appropriate length from
+@var{buf} and returns it. However, if the current architecture is the
+D10V, this function will return a 16-bit integer extracted from
+@var{buf}, multiplied by four if @var{type} is a pointer to a function.
+
+If @var{type} is not a pointer or reference type, then this function
+will signal an internal error.
+@end deftypefun
+
+@deftypefun CORE_ADDR store_typed_address (void *@var{buf}, struct type *@var{type}, CORE_ADDR @var{addr})
+Store the address @var{addr} in @var{buf}, in the proper format for a
+pointer of type @var{type} in the current architecture. Note that
+@var{buf} refers to a buffer in @value{GDBN}'s memory, not the
+inferior's.
+
+For example, if the current architecture is the Intel x86, this function
+stores @var{addr} unmodified as a little-endian integer of the
+appropriate length in @var{buf}. However, if the current architecture
+is the D10V, this function divides @var{addr} by four if @var{type} is
+a pointer to a function, and then stores it in @var{buf}.
+
+If @var{type} is not a pointer or reference type, then this function
+will signal an internal error.
+@end deftypefun
+
+@deftypefun CORE_ADDR value_as_address (struct value *@var{val})
+Assuming that @var{val} is a pointer, return the address it represents,
+as appropriate for the current architecture.
+
+This function actually works on integral values, as well as pointers.
+For pointers, it performs architecture-specific conversions as
+described above for @code{extract_typed_address}.
+@end deftypefun
+
+@deftypefun CORE_ADDR value_from_pointer (struct type *@var{type}, CORE_ADDR @var{addr})
+Create and return a value representing a pointer of type @var{type} to
+the address @var{addr}, as appropriate for the current architecture.
+This function performs architecture-specific conversions as described
+above for @code{store_typed_address}.
+@end deftypefun
+
+
+@value{GDBN} also provides functions that do the same tasks, but assume
+that pointers are simply byte addresses; they aren't sensitive to the
+current architecture, beyond knowing the appropriate endianness.
+
+@deftypefun CORE_ADDR extract_address (void *@var{addr}, int len)
+Extract a @var{len}-byte number from @var{addr} in the appropriate
+endianness for the current architecture, and return it. Note that
+@var{addr} refers to @value{GDBN}'s memory, not the inferior's.
+
+This function should only be used in architecture-specific code; it
+doesn't have enough information to turn bits into a true address in the
+appropriate way for the current architecture. If you can, use
+@code{extract_typed_address} instead.
+@end deftypefun
+
+@deftypefun void store_address (void *@var{addr}, int @var{len}, LONGEST @var{val})
+Store @var{val} at @var{addr} as a @var{len}-byte integer, in the
+appropriate endianness for the current architecture. Note that
+@var{addr} refers to a buffer in @value{GDBN}'s memory, not the
+inferior's.
+
+This function should only be used in architecture-specific code; it
+doesn't have enough information to turn a true address into bits in the
+appropriate way for the current architecture. If you can, use
+@code{store_typed_address} instead.
+@end deftypefun
+
+
+Here are some macros which architectures can define to indicate the
+relationship between pointers and addresses. These have default
+definitions, appropriate for architectures on which all pointers are
+simple unsigned byte addresses.
+
+@deftypefn {Target Macro} CORE_ADDR POINTER_TO_ADDRESS (struct type *@var{type}, char *@var{buf})
+Assume that @var{buf} holds a pointer of type @var{type}, in the
+appropriate format for the current architecture. Return the byte
+address the pointer refers to.
+
+This function may safely assume that @var{type} is either a pointer or a
+C@t{++} reference type.
+@end deftypefn
+
+@deftypefn {Target Macro} void ADDRESS_TO_POINTER (struct type *@var{type}, char *@var{buf}, CORE_ADDR @var{addr})
+Store in @var{buf} a pointer of type @var{type} representing the address
+@var{addr}, in the appropriate format for the current architecture.
+
+This function may safely assume that @var{type} is either a pointer or a
+C@t{++} reference type.
+@end deftypefn
+
+
+@section Using Different Register and Memory Data Representations
+@cindex raw representation
+@cindex virtual representation
+@cindex representations, raw and virtual
+@cindex register data formats, converting
+@cindex @code{struct value}, converting register contents to
+
+@emph{Maintainer's note: The way GDB manipulates registers is undergoing
+significant change. Many of the macros and functions refered to in the
+sections below are likely to be made obsolete. See the file @file{TODO}
+for more up-to-date information.}
+
+Some architectures use one representation for a value when it lives in a
+register, but use a different representation when it lives in memory.
+In @value{GDBN}'s terminology, the @dfn{raw} representation is the one used in
+the target registers, and the @dfn{virtual} representation is the one
+used in memory, and within @value{GDBN} @code{struct value} objects.
+
+For almost all data types on almost all architectures, the virtual and
+raw representations are identical, and no special handling is needed.
+However, they do occasionally differ. For example:
+
+@itemize @bullet
+@item
+The x86 architecture supports an 80-bit @code{long double} type. However, when
+we store those values in memory, they occupy twelve bytes: the
+floating-point number occupies the first ten, and the final two bytes
+are unused. This keeps the values aligned on four-byte boundaries,
+allowing more efficient access. Thus, the x86 80-bit floating-point
+type is the raw representation, and the twelve-byte loosely-packed
+arrangement is the virtual representation.
+
+@item
+Some 64-bit MIPS targets present 32-bit registers to @value{GDBN} as 64-bit
+registers, with garbage in their upper bits. @value{GDBN} ignores the top 32
+bits. Thus, the 64-bit form, with garbage in the upper 32 bits, is the
+raw representation, and the trimmed 32-bit representation is the
+virtual representation.
+@end itemize
-GDB does not have a magical way to match up with the compiler's idea of
-which registers are which; however, it is critical that they do match up
-accurately. The only way to make this work is to get accurate
-information about the order that the compiler uses, and to reflect that
-in the @code{REGISTER_NAME} and related macros.
+In general, the raw representation is determined by the architecture, or
+@value{GDBN}'s interface to the architecture, while the virtual representation
+can be chosen for @value{GDBN}'s convenience. @value{GDBN}'s register file,
+@code{registers}, holds the register contents in raw format, and the
+@value{GDBN} remote protocol transmits register values in raw format.
+
+Your architecture may define the following macros to request
+conversions between the raw and virtual format:
+
+@deftypefn {Target Macro} int REGISTER_CONVERTIBLE (int @var{reg})
+Return non-zero if register number @var{reg}'s value needs different raw
+and virtual formats.
+
+You should not use @code{REGISTER_CONVERT_TO_VIRTUAL} for a register
+unless this macro returns a non-zero value for that register.
+@end deftypefn
+
+@deftypefn {Target Macro} int REGISTER_RAW_SIZE (int @var{reg})
+The size of register number @var{reg}'s raw value. This is the number
+of bytes the register will occupy in @code{registers}, or in a @value{GDBN}
+remote protocol packet.
+@end deftypefn
+
+@deftypefn {Target Macro} int REGISTER_VIRTUAL_SIZE (int @var{reg})
+The size of register number @var{reg}'s value, in its virtual format.
+This is the size a @code{struct value}'s buffer will have, holding that
+register's value.
+@end deftypefn
+
+@deftypefn {Target Macro} struct type *REGISTER_VIRTUAL_TYPE (int @var{reg})
+This is the type of the virtual representation of register number
+@var{reg}. Note that there is no need for a macro giving a type for the
+register's raw form; once the register's value has been obtained, @value{GDBN}
+always uses the virtual form.
+@end deftypefn
+
+@deftypefn {Target Macro} void REGISTER_CONVERT_TO_VIRTUAL (int @var{reg}, struct type *@var{type}, char *@var{from}, char *@var{to})
+Convert the value of register number @var{reg} to @var{type}, which
+should always be @code{REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
+at @var{from} holds the register's value in raw format; the macro should
+convert the value to virtual format, and place it at @var{to}.
+
+Note that @code{REGISTER_CONVERT_TO_VIRTUAL} and
+@code{REGISTER_CONVERT_TO_RAW} take their @var{reg} and @var{type}
+arguments in different orders.
+
+You should only use @code{REGISTER_CONVERT_TO_VIRTUAL} with registers
+for which the @code{REGISTER_CONVERTIBLE} macro returns a non-zero
+value.
+@end deftypefn
+
+@deftypefn {Target Macro} void REGISTER_CONVERT_TO_RAW (struct type *@var{type}, int @var{reg}, char *@var{from}, char *@var{to})
+Convert the value of register number @var{reg} to @var{type}, which
+should always be @code{REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
+at @var{from} holds the register's value in raw format; the macro should
+convert the value to virtual format, and place it at @var{to}.
+
+Note that REGISTER_CONVERT_TO_VIRTUAL and REGISTER_CONVERT_TO_RAW take
+their @var{reg} and @var{type} arguments in different orders.
+@end deftypefn
-GDB can handle big-endian, little-endian, and bi-endian architectures.
@section Frame Interpretation
@@ -1151,483 +2603,993 @@ machine.
@table @code
@item ADDITIONAL_OPTIONS
-@item ADDITIONAL_OPTION_CASES
-@item ADDITIONAL_OPTION_HANDLER
-@item ADDITIONAL_OPTION_HELP
+@itemx ADDITIONAL_OPTION_CASES
+@itemx ADDITIONAL_OPTION_HANDLER
+@itemx ADDITIONAL_OPTION_HELP
+@findex ADDITIONAL_OPTION_HELP
+@findex ADDITIONAL_OPTION_HANDLER
+@findex ADDITIONAL_OPTION_CASES
+@findex ADDITIONAL_OPTIONS
These are a set of macros that allow the addition of additional command
-line options to GDB. They are currently used only for the unsupported
+line options to @value{GDBN}. They are currently used only for the unsupported
i960 Nindy target, and should not be used in any other configuration.
@item ADDR_BITS_REMOVE (addr)
-If a raw machine address includes any bits that are not really part of
-the address, then define this macro to expand into an expression that
-zeros those bits in @var{addr}. For example, the two low-order bits of
-a Motorola 88K address may be used by some kernels for their own
-purposes, since addresses must always be 4-byte aligned, and so are of
-no use for addressing. Those bits should be filtered out with an
-expression such as @code{((addr) & ~3)}.
+@findex ADDR_BITS_REMOVE
+If a raw machine instruction address includes any bits that are not
+really part of the address, then define this macro to expand into an
+expression that zeroes those bits in @var{addr}. This is only used for
+addresses of instructions, and even then not in all contexts.
+
+For example, the two low-order bits of the PC on the Hewlett-Packard PA
+2.0 architecture contain the privilege level of the corresponding
+instruction. Since instructions must always be aligned on four-byte
+boundaries, the processor masks out these bits to generate the actual
+address of the instruction. ADDR_BITS_REMOVE should filter out these
+bits with an expression such as @code{((addr) & ~3)}.
+
+@item ADDRESS_TO_POINTER (@var{type}, @var{buf}, @var{addr})
+@findex ADDRESS_TO_POINTER
+Store in @var{buf} a pointer of type @var{type} representing the address
+@var{addr}, in the appropriate format for the current architecture.
+This macro may safely assume that @var{type} is either a pointer or a
+C@t{++} reference type.
+@xref{Target Architecture Definition, , Pointers Are Not Always Addresses}.
@item BEFORE_MAIN_LOOP_HOOK
+@findex BEFORE_MAIN_LOOP_HOOK
Define this to expand into any code that you want to execute before the
main loop starts. Although this is not, strictly speaking, a target
conditional, that is how it is currently being used. Note that if a
configuration were to define it one way for a host and a different way
-for the target, GDB will probably not compile, let alone run correctly.
-This is currently used only for the unsupported i960 Nindy target, and
-should not be used in any other configuration.
+for the target, @value{GDBN} will probably not compile, let alone run
+correctly. This macro is currently used only for the unsupported i960 Nindy
+target, and should not be used in any other configuration.
@item BELIEVE_PCC_PROMOTION
-Define if the compiler promotes a short or char parameter to an int, but
-still reports the parameter as its original type, rather than the
-promoted type.
+@findex BELIEVE_PCC_PROMOTION
+Define if the compiler promotes a @code{short} or @code{char}
+parameter to an @code{int}, but still reports the parameter as its
+original type, rather than the promoted type.
@item BELIEVE_PCC_PROMOTION_TYPE
-Define this if GDB should believe the type of a short argument when
-compiled by pcc, but look within a full int space to get its value.
-Only defined for Sun-3 at present.
+@findex BELIEVE_PCC_PROMOTION_TYPE
+Define this if @value{GDBN} should believe the type of a @code{short}
+argument when compiled by @code{pcc}, but look within a full int space to get
+its value. Only defined for Sun-3 at present.
@item BITS_BIG_ENDIAN
-Define this if the numbering of bits in the targets does *not* match the
+@findex BITS_BIG_ENDIAN
+Define this if the numbering of bits in the targets does @strong{not} match the
endianness of the target byte order. A value of 1 means that the bits
-are numbered in a big-endian order, 0 means little-endian.
+are numbered in a big-endian bit order, 0 means little-endian.
@item BREAKPOINT
+@findex BREAKPOINT
This is the character array initializer for the bit pattern to put into
memory where a breakpoint is set. Although it's common to use a trap
instruction for a breakpoint, it's not required; for instance, the bit
pattern could be an invalid instruction. The breakpoint must be no
longer than the shortest instruction of the architecture.
+@code{BREAKPOINT} has been deprecated in favor of
+@code{BREAKPOINT_FROM_PC}.
+
@item BIG_BREAKPOINT
-@item LITTLE_BREAKPOINT
+@itemx LITTLE_BREAKPOINT
+@findex LITTLE_BREAKPOINT
+@findex BIG_BREAKPOINT
Similar to BREAKPOINT, but used for bi-endian targets.
+@code{BIG_BREAKPOINT} and @code{LITTLE_BREAKPOINT} have been deprecated in
+favor of @code{BREAKPOINT_FROM_PC}.
+
@item REMOTE_BREAKPOINT
-@item LITTLE_REMOTE_BREAKPOINT
-@item BIG_REMOTE_BREAKPOINT
+@itemx LITTLE_REMOTE_BREAKPOINT
+@itemx BIG_REMOTE_BREAKPOINT
+@findex BIG_REMOTE_BREAKPOINT
+@findex LITTLE_REMOTE_BREAKPOINT
+@findex REMOTE_BREAKPOINT
Similar to BREAKPOINT, but used for remote targets.
-@item BREAKPOINT_FROM_PC (pcptr, lenptr)
+@code{BIG_REMOTE_BREAKPOINT} and @code{LITTLE_REMOTE_BREAKPOINT} have been
+deprecated in favor of @code{BREAKPOINT_FROM_PC}.
+@item BREAKPOINT_FROM_PC (@var{pcptr}, @var{lenptr})
+@findex BREAKPOINT_FROM_PC
Use the program counter to determine the contents and size of a
-breakpoint instruction. It returns a pointer to a string of bytes that
-encode a breakpoint instruction, stores the length of the string to
-*lenptr, and adjusts pc (if necessary) to point to the actual memory
-location where the breakpoint should be inserted.
+breakpoint instruction. It returns a pointer to a string of bytes
+that encode a breakpoint instruction, stores the length of the string
+to *@var{lenptr}, and adjusts pc (if necessary) to point to the actual
+memory location where the breakpoint should be inserted.
Although it is common to use a trap instruction for a breakpoint, it's
not required; for instance, the bit pattern could be an invalid
instruction. The breakpoint must be no longer than the shortest
instruction of the architecture.
-Replaces all the other BREAKPOINTs.
+Replaces all the other @var{BREAKPOINT} macros.
+
+@item MEMORY_INSERT_BREAKPOINT (@var{addr}, @var{contents_cache})
+@itemx MEMORY_REMOVE_BREAKPOINT (@var{addr}, @var{contents_cache})
+@findex MEMORY_REMOVE_BREAKPOINT
+@findex MEMORY_INSERT_BREAKPOINT
+Insert or remove memory based breakpoints. Reasonable defaults
+(@code{default_memory_insert_breakpoint} and
+@code{default_memory_remove_breakpoint} respectively) have been
+provided so that it is not necessary to define these for most
+architectures. Architectures which may want to define
+@code{MEMORY_INSERT_BREAKPOINT} and @code{MEMORY_REMOVE_BREAKPOINT} will
+likely have instructions that are oddly sized or are not stored in a
+conventional manner.
+
+It may also be desirable (from an efficiency standpoint) to define
+custom breakpoint insertion and removal routines if
+@code{BREAKPOINT_FROM_PC} needs to read the target's memory for some
+reason.
+
+@item CALL_DUMMY_P
+@findex CALL_DUMMY_P
+A C expresson that is non-zero when the target suports inferior function
+calls.
+
+@item CALL_DUMMY_WORDS
+@findex CALL_DUMMY_WORDS
+Pointer to an array of @code{LONGEST} words of data containing
+host-byte-ordered @code{REGISTER_BYTES} sized values that partially
+specify the sequence of instructions needed for an inferior function
+call.
+
+Should be deprecated in favor of a macro that uses target-byte-ordered
+data.
+
+@item SIZEOF_CALL_DUMMY_WORDS
+@findex SIZEOF_CALL_DUMMY_WORDS
+The size of @code{CALL_DUMMY_WORDS}. When @code{CALL_DUMMY_P} this must
+return a positive value. See also @code{CALL_DUMMY_LENGTH}.
@item CALL_DUMMY
-valops.c
+@findex CALL_DUMMY
+A static initializer for @code{CALL_DUMMY_WORDS}. Deprecated.
+
@item CALL_DUMMY_LOCATION
-inferior.h
+@findex CALL_DUMMY_LOCATION
+See the file @file{inferior.h}.
+
@item CALL_DUMMY_STACK_ADJUST
-valops.c
+@findex CALL_DUMMY_STACK_ADJUST
+Stack adjustment needed when performing an inferior function call.
-@item CANNOT_FETCH_REGISTER (regno)
+Should be deprecated in favor of something like @code{STACK_ALIGN}.
+
+@item CALL_DUMMY_STACK_ADJUST_P
+@findex CALL_DUMMY_STACK_ADJUST_P
+Predicate for use of @code{CALL_DUMMY_STACK_ADJUST}.
+
+Should be deprecated in favor of something like @code{STACK_ALIGN}.
+
+@item CANNOT_FETCH_REGISTER (@var{regno})
+@findex CANNOT_FETCH_REGISTER
A C expression that should be nonzero if @var{regno} cannot be fetched
from an inferior process. This is only relevant if
@code{FETCH_INFERIOR_REGISTERS} is not defined.
-@item CANNOT_STORE_REGISTER (regno)
+@item CANNOT_STORE_REGISTER (@var{regno})
+@findex CANNOT_STORE_REGISTER
A C expression that should be nonzero if @var{regno} should not be
written to the target. This is often the case for program counters,
-status words, and other special registers. If this is not defined, GDB
-will assume that all registers may be written.
+status words, and other special registers. If this is not defined,
+@value{GDBN} will assume that all registers may be written.
@item DO_DEFERRED_STORES
-@item CLEAR_DEFERRED_STORES
+@itemx CLEAR_DEFERRED_STORES
+@findex CLEAR_DEFERRED_STORES
+@findex DO_DEFERRED_STORES
Define this to execute any deferred stores of registers into the inferior,
and to cancel any deferred stores.
Currently only implemented correctly for native Sparc configurations?
+@item COERCE_FLOAT_TO_DOUBLE (@var{formal}, @var{actual})
+@findex COERCE_FLOAT_TO_DOUBLE
+@cindex promotion to @code{double}
+@cindex @code{float} arguments
+@cindex prototyped functions, passing arguments to
+@cindex passing arguments to prototyped functions
+Return non-zero if GDB should promote @code{float} values to
+@code{double} when calling a non-prototyped function. The argument
+@var{actual} is the type of the value we want to pass to the function.
+The argument @var{formal} is the type of this argument, as it appears in
+the function's definition. Note that @var{formal} may be zero if we
+have no debugging information for the function, or if we're passing more
+arguments than are officially declared (for example, varargs). This
+macro is never invoked if the function definitely has a prototype.
+
+How you should pass arguments to a function depends on whether it was
+defined in K&R style or prototype style. If you define a function using
+the K&R syntax that takes a @code{float} argument, then callers must
+pass that argument as a @code{double}. If you define the function using
+the prototype syntax, then you must pass the argument as a @code{float},
+with no promotion.
+
+Unfortunately, on certain older platforms, the debug info doesn't
+indicate reliably how each function was defined. A function type's
+@code{TYPE_FLAG_PROTOTYPED} flag may be unset, even if the function was
+defined in prototype style. When calling a function whose
+@code{TYPE_FLAG_PROTOTYPED} flag is unset, GDB consults the
+@code{COERCE_FLOAT_TO_DOUBLE} macro to decide what to do.
+
+@findex standard_coerce_float_to_double
+For modern targets, it is proper to assume that, if the prototype flag
+is unset, that can be trusted: @code{float} arguments should be promoted
+to @code{double}. You should use the function
+@code{standard_coerce_float_to_double} to get this behavior.
+
+@findex default_coerce_float_to_double
+For some older targets, if the prototype flag is unset, that doesn't
+tell us anything. So we guess that, if we don't have a type for the
+formal parameter (@i{i.e.}, the first argument to
+@code{COERCE_FLOAT_TO_DOUBLE} is null), then we should promote it;
+otherwise, we should leave it alone. The function
+@code{default_coerce_float_to_double} provides this behavior; it is the
+default value, for compatibility with older configurations.
+
@item CPLUS_MARKER
-Define this to expand into the character that G++ uses to distinguish
+@findex CPLUS_MARKERz
+Define this to expand into the character that G@t{++} uses to distinguish
compiler-generated identifiers from programmer-specified identifiers.
By default, this expands into @code{'$'}. Most System V targets should
define this to @code{'.'}.
@item DBX_PARM_SYMBOL_CLASS
+@findex DBX_PARM_SYMBOL_CLASS
Hook for the @code{SYMBOL_CLASS} of a parameter when decoding DBX symbol
information. In the i960, parameters can be stored as locals or as
args, depending on the type of the debug record.
@item DECR_PC_AFTER_BREAK
+@findex DECR_PC_AFTER_BREAK
Define this to be the amount by which to decrement the PC after the
program encounters a breakpoint. This is often the number of bytes in
-BREAKPOINT, though not always. For most targets this value will be 0.
+@code{BREAKPOINT}, though not always. For most targets this value will be 0.
@item DECR_PC_AFTER_HW_BREAK
+@findex DECR_PC_AFTER_HW_BREAK
Similarly, for hardware breakpoints.
-@item DISABLE_UNSETTABLE_BREAK addr
+@item DISABLE_UNSETTABLE_BREAK (@var{addr})
+@findex DISABLE_UNSETTABLE_BREAK
If defined, this should evaluate to 1 if @var{addr} is in a shared
library in which breakpoints cannot be set and so should be disabled.
@item DO_REGISTERS_INFO
+@findex DO_REGISTERS_INFO
If defined, use this to print the value of a register or all registers.
+@item PRINT_FLOAT_INFO()
+#findex PRINT_FLOAT_INFO
+If defined, then the @samp{info float} command will print information about
+the processor's floating point unit.
+
+@item DWARF_REG_TO_REGNUM
+@findex DWARF_REG_TO_REGNUM
+Convert DWARF register number into @value{GDBN} regnum. If not defined,
+no conversion will be performed.
+
+@item DWARF2_REG_TO_REGNUM
+@findex DWARF2_REG_TO_REGNUM
+Convert DWARF2 register number into @value{GDBN} regnum. If not
+defined, no conversion will be performed.
+
+@item ECOFF_REG_TO_REGNUM
+@findex ECOFF_REG_TO_REGNUM
+Convert ECOFF register number into @value{GDBN} regnum. If not defined,
+no conversion will be performed.
+
@item END_OF_TEXT_DEFAULT
-This is an expression that should designate the end of the text section
-(? FIXME ?)
+@findex END_OF_TEXT_DEFAULT
+This is an expression that should designate the end of the text section.
+@c (? FIXME ?)
-@item EXTRACT_RETURN_VALUE(type,regbuf,valbuf)
+@item EXTRACT_RETURN_VALUE(@var{type}, @var{regbuf}, @var{valbuf})
+@findex EXTRACT_RETURN_VALUE
Define this to extract a function's return value of type @var{type} from
the raw register state @var{regbuf} and copy that, in virtual format,
into @var{valbuf}.
-@item EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)
-Define this to extract from an array @var{regbuf} containing the (raw)
-register state, the address in which a function should return its
-structure value, as a CORE_ADDR (or an expression that can be used as
-one).
+@item EXTRACT_STRUCT_VALUE_ADDRESS(@var{regbuf})
+@findex EXTRACT_STRUCT_VALUE_ADDRESS
+When defined, extract from the array @var{regbuf} (containing the raw
+register state) the @code{CORE_ADDR} at which a function should return
+its structure value.
+
+If not defined, @code{EXTRACT_RETURN_VALUE} is used.
+
+@item EXTRACT_STRUCT_VALUE_ADDRESS_P()
+@findex EXTRACT_STRUCT_VALUE_ADDRESS_P
+Predicate for @code{EXTRACT_STRUCT_VALUE_ADDRESS}.
@item FLOAT_INFO
-If defined, then the `info float' command will print information about
-the processor's floating point unit.
+@findex FLOAT_INFO
+Deprecated in favor of @code{PRINT_FLOAT_INFO}.
@item FP_REGNUM
-The number of the frame pointer register.
+@findex FP_REGNUM
+If the virtual frame pointer is kept in a register, then define this
+macro to be the number (greater than or equal to zero) of that register.
-@item FRAMELESS_FUNCTION_INVOCATION(fi, frameless)
-Define this to set the variable @var{frameless} to 1 if the function
-invocation represented by @var{fi} does not have a stack frame
-associated with it. Otherwise set it to 0.
+This should only need to be defined if @code{TARGET_READ_FP} and
+@code{TARGET_WRITE_FP} are not defined.
+
+@item FRAMELESS_FUNCTION_INVOCATION(@var{fi})
+@findex FRAMELESS_FUNCTION_INVOCATION
+Define this to an expression that returns 1 if the function invocation
+represented by @var{fi} does not have a stack frame associated with it.
+Otherwise return 0.
@item FRAME_ARGS_ADDRESS_CORRECT
-stack.c
+@findex FRAME_ARGS_ADDRESS_CORRECT
+See @file{stack.c}.
-@item FRAME_CHAIN(frame)
+@item FRAME_CHAIN(@var{frame})
+@findex FRAME_CHAIN
Given @var{frame}, return a pointer to the calling frame.
-@item FRAME_CHAIN_COMBINE(chain,frame)
+@item FRAME_CHAIN_COMBINE(@var{chain}, @var{frame})
+@findex FRAME_CHAIN_COMBINE
Define this to take the frame chain pointer and the frame's nominal
address and produce the nominal address of the caller's frame.
Presently only defined for HP PA.
-@item FRAME_CHAIN_VALID(chain,thisframe)
-
+@item FRAME_CHAIN_VALID(@var{chain}, @var{thisframe})
+@findex FRAME_CHAIN_VALID
Define this to be an expression that returns zero if the given frame is
-an outermost frame, with no caller, and nonzero otherwise. Three common
-definitions are available. @code{default_frame_chain_valid} (the
-default) is nonzero if the chain pointer is nonzero and given frame's PC
-is not inside the startup file (such as @file{crt0.o}).
-@code{alternate_frame_chain_valid} is nonzero if the chain pointer is
-nonzero and the given frame's PC is not in @code{main()} or a known
-entry point function (such as @code{_start()}).
-
-@item FRAME_INIT_SAVED_REGS(frame)
+an outermost frame, with no caller, and nonzero otherwise. Several
+common definitions are available:
+
+@itemize @bullet
+@item
+@code{file_frame_chain_valid} is nonzero if the chain pointer is nonzero
+and given frame's PC is not inside the startup file (such as
+@file{crt0.o}).
+
+@item
+@code{func_frame_chain_valid} is nonzero if the chain
+pointer is nonzero and the given frame's PC is not in @code{main} or a
+known entry point function (such as @code{_start}).
+
+@item
+@code{generic_file_frame_chain_valid} and
+@code{generic_func_frame_chain_valid} are equivalent implementations for
+targets using generic dummy frames.
+@end itemize
+
+@item FRAME_INIT_SAVED_REGS(@var{frame})
+@findex FRAME_INIT_SAVED_REGS
See @file{frame.h}. Determines the address of all registers in the
current stack frame storing each in @code{frame->saved_regs}. Space for
@code{frame->saved_regs} shall be allocated by
@code{FRAME_INIT_SAVED_REGS} using either
@code{frame_saved_regs_zalloc} or @code{frame_obstack_alloc}.
-@var{FRAME_FIND_SAVED_REGS} and @var{EXTRA_FRAME_INFO} are deprecated.
+@code{FRAME_FIND_SAVED_REGS} and @code{EXTRA_FRAME_INFO} are deprecated.
-@item FRAME_NUM_ARGS (val, fi)
-For the frame described by @var{fi}, set @var{val} to the number of arguments
-that are being passed.
+@item FRAME_NUM_ARGS (@var{fi})
+@findex FRAME_NUM_ARGS
+For the frame described by @var{fi} return the number of arguments that
+are being passed. If the number of arguments is not known, return
+@code{-1}.
-@item FRAME_SAVED_PC(frame)
-Given @var{frame}, return the pc saved there. That is, the return
+@item FRAME_SAVED_PC(@var{frame})
+@findex FRAME_SAVED_PC
+Given @var{frame}, return the pc saved there. This is the return
address.
@item FUNCTION_EPILOGUE_SIZE
+@findex FUNCTION_EPILOGUE_SIZE
For some COFF targets, the @code{x_sym.x_misc.x_fsize} field of the
function end symbol is 0. For such targets, you must define
@code{FUNCTION_EPILOGUE_SIZE} to expand into the standard size of a
function's epilogue.
+@item FUNCTION_START_OFFSET
+@findex FUNCTION_START_OFFSET
+An integer, giving the offset in bytes from a function's address (as
+used in the values of symbols, function pointers, etc.), and the
+function's first genuine instruction.
+
+This is zero on almost all machines: the function's address is usually
+the address of its first instruction. However, on the VAX, for example,
+each function starts with two bytes containing a bitmask indicating
+which registers to save upon entry to the function. The VAX @code{call}
+instructions check this value, and save the appropriate registers
+automatically. Thus, since the offset from the function's address to
+its first instruction is two bytes, @code{FUNCTION_START_OFFSET} would
+be 2 on the VAX.
+
@item GCC_COMPILED_FLAG_SYMBOL
-@item GCC2_COMPILED_FLAG_SYMBOL
-If defined, these are the names of the symbols that GDB will look for to
-detect that GCC compiled the file. The default symbols are
-@code{gcc_compiled.} and @code{gcc2_compiled.}, respectively. (Currently
-only defined for the Delta 68.)
-
-@item GDB_TARGET_IS_HPPA
-This determines whether horrible kludge code in dbxread.c and
-partial-stab.h is used to mangle multiple-symbol-table files from
-HPPA's. This should all be ripped out, and a scheme like elfread.c
-used.
-
-@item GDB_TARGET_IS_MACH386
-@item GDB_TARGET_IS_SUN3
-@item GDB_TARGET_IS_SUN386
-Kludges that should go away.
+@itemx GCC2_COMPILED_FLAG_SYMBOL
+@findex GCC2_COMPILED_FLAG_SYMBOL
+@findex GCC_COMPILED_FLAG_SYMBOL
+If defined, these are the names of the symbols that @value{GDBN} will
+look for to detect that GCC compiled the file. The default symbols
+are @code{gcc_compiled.} and @code{gcc2_compiled.},
+respectively. (Currently only defined for the Delta 68.)
+
+@item @value{GDBN}_MULTI_ARCH
+@findex @value{GDBN}_MULTI_ARCH
+If defined and non-zero, enables suport for multiple architectures
+within @value{GDBN}.
+
+This support can be enabled at two levels. At level one, only
+definitions for previously undefined macros are provided; at level two,
+a multi-arch definition of all architecture dependant macros will be
+defined.
+
+@item @value{GDBN}_TARGET_IS_HPPA
+@findex @value{GDBN}_TARGET_IS_HPPA
+This determines whether horrible kludge code in @file{dbxread.c} and
+@file{partial-stab.h} is used to mangle multiple-symbol-table files from
+HPPA's. This should all be ripped out, and a scheme like @file{elfread.c}
+used instead.
@item GET_LONGJMP_TARGET
+@findex GET_LONGJMP_TARGET
For most machines, this is a target-dependent parameter. On the
DECstation and the Iris, this is a native-dependent parameter, since
-<setjmp.h> is needed to define it.
+trhe header file @file{setjmp.h} is needed to define it.
-This macro determines the target PC address that longjmp() will jump to,
-assuming that we have just stopped at a longjmp breakpoint. It takes a
-CORE_ADDR * as argument, and stores the target PC value through this
+This macro determines the target PC address that @code{longjmp} will jump to,
+assuming that we have just stopped at a @code{longjmp} breakpoint. It takes a
+@code{CORE_ADDR *} as argument, and stores the target PC value through this
pointer. It examines the current state of the machine as needed.
@item GET_SAVED_REGISTER
+@findex GET_SAVED_REGISTER
+@findex get_saved_register
Define this if you need to supply your own definition for the function
-@code{get_saved_register}. Currently this is only done for the a29k.
+@code{get_saved_register}.
@item HAVE_REGISTER_WINDOWS
+@findex HAVE_REGISTER_WINDOWS
Define this if the target has register windows.
-@item REGISTER_IN_WINDOW_P (regnum)
+
+@item REGISTER_IN_WINDOW_P (@var{regnum})
+@findex REGISTER_IN_WINDOW_P
Define this to be an expression that is 1 if the given register is in
the window.
@item IBM6000_TARGET
+@findex IBM6000_TARGET
Shows that we are configured for an IBM RS/6000 target. This
conditional should be eliminated (FIXME) and replaced by
-feature-specific macros. It was introduced in haste and we are
+feature-specific macros. It was introduced in a haste and we are
repenting at leisure.
-@item IEEE_FLOAT
-Define this if the target system uses IEEE-format floating point numbers.
+@item I386_USE_GENERIC_WATCHPOINTS
+An x86-based target can define this to use the generic x86 watchpoint
+support; see @ref{Algorithms, I386_USE_GENERIC_WATCHPOINTS}.
+
+@item SYMBOLS_CAN_START_WITH_DOLLAR
+@findex SYMBOLS_CAN_START_WITH_DOLLAR
+Some systems have routines whose names start with @samp{$}. Giving this
+macro a non-zero value tells @value{GDBN}'s expression parser to check for such
+routines when parsing tokens that begin with @samp{$}.
-@item INIT_EXTRA_FRAME_INFO (fromleaf, frame)
+On HP-UX, certain system routines (millicode) have names beginning with
+@samp{$} or @samp{$$}. For example, @code{$$dyncall} is a millicode
+routine that handles inter-space procedure calls on PA-RISC.
+
+@item INIT_EXTRA_FRAME_INFO (@var{fromleaf}, @var{frame})
+@findex INIT_EXTRA_FRAME_INFO
If additional information about the frame is required this should be
stored in @code{frame->extra_info}. Space for @code{frame->extra_info}
is allocated using @code{frame_obstack_alloc}.
-@item INIT_FRAME_PC (fromleaf, prev)
+@item INIT_FRAME_PC (@var{fromleaf}, @var{prev})
+@findex INIT_FRAME_PC
This is a C statement that sets the pc of the frame pointed to by
@var{prev}. [By default...]
-@item INNER_THAN (lhs,rhs)
+@item INNER_THAN (@var{lhs}, @var{rhs})
+@findex INNER_THAN
Returns non-zero if stack address @var{lhs} is inner than (nearer to the
stack top) stack address @var{rhs}. Define this as @code{lhs < rhs} if
the target's stack grows downward in memory, or @code{lhs > rsh} if the
stack grows upward.
-@item IN_SIGTRAMP (pc, name)
-Define this to return true if the given @var{pc} and/or @var{name}
-indicates that the current function is a sigtramp.
-
-@item SIGTRAMP_START (pc)
-@item SIGTRAMP_END (pc)
-Define these to be the start and end address of the sigtramp for the
+@item gdbarch_in_function_epilogue_p (@var{gdbarch}, @var{pc})
+@findex gdbarch_in_function_epilogue_p
+Returns non-zero if the given @var{pc} is in the epilogue of a function.
+The epilogue of a function is defined as the part of a function where
+the stack frame of the function already has been destroyed up to the
+final `return from function call' instruction.
+
+@item IN_SIGTRAMP (@var{pc}, @var{name})
+@findex IN_SIGTRAMP
+Define this to return non-zero if the given @var{pc} and/or @var{name}
+indicates that the current function is a @code{sigtramp}.
+
+@item SIGTRAMP_START (@var{pc})
+@findex SIGTRAMP_START
+@itemx SIGTRAMP_END (@var{pc})
+@findex SIGTRAMP_END
+Define these to be the start and end address of the @code{sigtramp} for the
given @var{pc}. On machines where the address is just a compile time
constant, the macro expansion will typically just ignore the supplied
@var{pc}.
-@item IN_SOLIB_CALL_TRAMPOLINE pc name
+@item IN_SOLIB_CALL_TRAMPOLINE (@var{pc}, @var{name})
+@findex IN_SOLIB_CALL_TRAMPOLINE
Define this to evaluate to nonzero if the program is stopped in the
trampoline that connects to a shared library.
-@item IN_SOLIB_RETURN_TRAMPOLINE pc name
+@item IN_SOLIB_RETURN_TRAMPOLINE (@var{pc}, @var{name})
+@findex IN_SOLIB_RETURN_TRAMPOLINE
Define this to evaluate to nonzero if the program is stopped in the
trampoline that returns from a shared library.
-@item IS_TRAPPED_INTERNALVAR (name)
+@item IN_SOLIB_DYNSYM_RESOLVE_CODE (@var{pc})
+@findex IN_SOLIB_DYNSYM_RESOLVE_CODE
+Define this to evaluate to nonzero if the program is stopped in the
+dynamic linker.
+
+@item SKIP_SOLIB_RESOLVER (@var{pc})
+@findex SKIP_SOLIB_RESOLVER
+Define this to evaluate to the (nonzero) address at which execution
+should continue to get past the dynamic linker's symbol resolution
+function. A zero value indicates that it is not important or necessary
+to set a breakpoint to get through the dynamic linker and that single
+stepping will suffice.
+
+@item INTEGER_TO_ADDRESS (@var{type}, @var{buf})
+@findex INTEGER_TO_ADDRESS
+@cindex converting integers to addresses
+Define this when the architecture needs to handle non-pointer to address
+conversions specially. Converts that value to an address according to
+the current architectures conventions.
+
+@emph{Pragmatics: When the user copies a well defined expression from
+their source code and passes it, as a parameter, to @value{GDBN}'s
+@code{print} command, they should get the same value as would have been
+computed by the target program. Any deviation from this rule can cause
+major confusion and annoyance, and needs to be justified carefully. In
+other words, @value{GDBN} doesn't really have the freedom to do these
+conversions in clever and useful ways. It has, however, been pointed
+out that users aren't complaining about how @value{GDBN} casts integers
+to pointers; they are complaining that they can't take an address from a
+disassembly listing and give it to @code{x/i}. Adding an architecture
+method like @code{INTEGER_TO_ADDRESS} certainly makes it possible for
+@value{GDBN} to ``get it right'' in all circumstances.}
+
+@xref{Target Architecture Definition, , Pointers Are Not Always
+Addresses}.
+
+@item IS_TRAPPED_INTERNALVAR (@var{name})
+@findex IS_TRAPPED_INTERNALVAR
This is an ugly hook to allow the specification of special actions that
should occur as a side-effect of setting the value of a variable
-internal to GDB. Currently only used by the h8500. Note that this
+internal to @value{GDBN}. Currently only used by the h8500. Note that this
could be either a host or target conditional.
@item NEED_TEXT_START_END
-Define this if GDB should determine the start and end addresses of the
+@findex NEED_TEXT_START_END
+Define this if @value{GDBN} should determine the start and end addresses of the
text section. (Seems dubious.)
@item NO_HIF_SUPPORT
+@findex NO_HIF_SUPPORT
(Specific to the a29k.)
-@item SOFTWARE_SINGLE_STEP_P
+@item POINTER_TO_ADDRESS (@var{type}, @var{buf})
+@findex POINTER_TO_ADDRESS
+Assume that @var{buf} holds a pointer of type @var{type}, in the
+appropriate format for the current architecture. Return the byte
+address the pointer refers to.
+@xref{Target Architecture Definition, , Pointers Are Not Always Addresses}.
+
+@item REGISTER_CONVERTIBLE (@var{reg})
+@findex REGISTER_CONVERTIBLE
+Return non-zero if @var{reg} uses different raw and virtual formats.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item REGISTER_RAW_SIZE (@var{reg})
+@findex REGISTER_RAW_SIZE
+Return the raw size of @var{reg}.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item REGISTER_VIRTUAL_SIZE (@var{reg})
+@findex REGISTER_VIRTUAL_SIZE
+Return the virtual size of @var{reg}.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item REGISTER_VIRTUAL_TYPE (@var{reg})
+@findex REGISTER_VIRTUAL_TYPE
+Return the virtual type of @var{reg}.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item REGISTER_CONVERT_TO_VIRTUAL(@var{reg}, @var{type}, @var{from}, @var{to})
+@findex REGISTER_CONVERT_TO_VIRTUAL
+Convert the value of register @var{reg} from its raw form to its virtual
+form.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item REGISTER_CONVERT_TO_RAW(@var{type}, @var{reg}, @var{from}, @var{to})
+@findex REGISTER_CONVERT_TO_RAW
+Convert the value of register @var{reg} from its virtual form to its raw
+form.
+@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
+
+@item RETURN_VALUE_ON_STACK(@var{type})
+@findex RETURN_VALUE_ON_STACK
+@cindex returning structures by value
+@cindex structures, returning by value
+
+Return non-zero if values of type TYPE are returned on the stack, using
+the ``struct convention'' (i.e., the caller provides a pointer to a
+buffer in which the callee should store the return value). This
+controls how the @samp{finish} command finds a function's return value,
+and whether an inferior function call reserves space on the stack for
+the return value.
+
+The full logic @value{GDBN} uses here is kind of odd.
+
+@itemize @bullet
+@item
+If the type being returned by value is not a structure, union, or array,
+and @code{RETURN_VALUE_ON_STACK} returns zero, then @value{GDBN}
+concludes the value is not returned using the struct convention.
+
+@item
+Otherwise, @value{GDBN} calls @code{USE_STRUCT_CONVENTION} (see below).
+If that returns non-zero, @value{GDBN} assumes the struct convention is
+in use.
+@end itemize
+
+In other words, to indicate that a given type is returned by value using
+the struct convention, that type must be either a struct, union, array,
+or something @code{RETURN_VALUE_ON_STACK} likes, @emph{and} something
+that @code{USE_STRUCT_CONVENTION} likes.
+
+Note that, in C and C@t{++}, arrays are never returned by value. In those
+languages, these predicates will always see a pointer type, never an
+array type. All the references above to arrays being returned by value
+apply only to other languages.
+
+@item SOFTWARE_SINGLE_STEP_P()
+@findex SOFTWARE_SINGLE_STEP_P
Define this as 1 if the target does not have a hardware single-step
-mechanism. The macro @code{SOFTWARE_SINGLE_STEP} must also be defined.
+mechanism. The macro @code{SOFTWARE_SINGLE_STEP} must also be defined.
-@item SOFTWARE_SINGLE_STEP(signal,insert_breapoints_p)
-A function that inserts or removes (dependant on
+@item SOFTWARE_SINGLE_STEP(@var{signal}, @var{insert_breapoints_p})
+@findex SOFTWARE_SINGLE_STEP
+A function that inserts or removes (depending on
@var{insert_breapoints_p}) breakpoints at each possible destinations of
-the next instruction. See @code{sparc-tdep.c} and @code{rs6000-tdep.c}
+the next instruction. See @file{sparc-tdep.c} and @file{rs6000-tdep.c}
for examples.
+@item SOFUN_ADDRESS_MAYBE_MISSING
+@findex SOFUN_ADDRESS_MAYBE_MISSING
+Somebody clever observed that, the more actual addresses you have in the
+debug information, the more time the linker has to spend relocating
+them. So whenever there's some other way the debugger could find the
+address it needs, you should omit it from the debug info, to make
+linking faster.
+
+@code{SOFUN_ADDRESS_MAYBE_MISSING} indicates that a particular set of
+hacks of this sort are in use, affecting @code{N_SO} and @code{N_FUN}
+entries in stabs-format debugging information. @code{N_SO} stabs mark
+the beginning and ending addresses of compilation units in the text
+segment. @code{N_FUN} stabs mark the starts and ends of functions.
+
+@code{SOFUN_ADDRESS_MAYBE_MISSING} means two things:
+
+@itemize @bullet
+@item
+@code{N_FUN} stabs have an address of zero. Instead, you should find the
+addresses where the function starts by taking the function name from
+the stab, and then looking that up in the minsyms (the
+linker/assembler symbol table). In other words, the stab has the
+name, and the linker/assembler symbol table is the only place that carries
+the address.
+
+@item
+@code{N_SO} stabs have an address of zero, too. You just look at the
+@code{N_FUN} stabs that appear before and after the @code{N_SO} stab,
+and guess the starting and ending addresses of the compilation unit from
+them.
+@end itemize
+
@item PCC_SOL_BROKEN
+@findex PCC_SOL_BROKEN
(Used only in the Convex target.)
@item PC_IN_CALL_DUMMY
-inferior.h
+@findex PC_IN_CALL_DUMMY
+See @file{inferior.h}.
@item PC_LOAD_SEGMENT
+@findex PC_LOAD_SEGMENT
If defined, print information about the load segment for the program
counter. (Defined only for the RS/6000.)
@item PC_REGNUM
+@findex PC_REGNUM
If the program counter is kept in a register, then define this macro to
-be the number of that register. This need be defined only if
-@code{TARGET_WRITE_PC} is not defined.
+be the number (greater than or equal to zero) of that register.
+
+This should only need to be defined if @code{TARGET_READ_PC} and
+@code{TARGET_WRITE_PC} are not defined.
@item NPC_REGNUM
+@findex NPC_REGNUM
The number of the ``next program counter'' register, if defined.
@item NNPC_REGNUM
+@findex NNPC_REGNUM
The number of the ``next next program counter'' register, if defined.
Currently, this is only defined for the Motorola 88K.
-@item PRINT_REGISTER_HOOK (regno)
+@item PARM_BOUNDARY
+@findex PARM_BOUNDARY
+If non-zero, round arguments to a boundary of this many bits before
+pushing them on the stack.
+
+@item PRINT_REGISTER_HOOK (@var{regno})
+@findex PRINT_REGISTER_HOOK
If defined, this must be a function that prints the contents of the
given register to standard output.
@item PRINT_TYPELESS_INTEGER
+@findex PRINT_TYPELESS_INTEGER
This is an obscure substitute for @code{print_longest} that seems to
have been defined for the Convex target.
@item PROCESS_LINENUMBER_HOOK
+@findex PROCESS_LINENUMBER_HOOK
A hook defined for XCOFF reading.
@item PROLOGUE_FIRSTLINE_OVERLAP
+@findex PROLOGUE_FIRSTLINE_OVERLAP
(Only used in unsupported Convex configuration.)
@item PS_REGNUM
+@findex PS_REGNUM
If defined, this is the number of the processor status register. (This
definition is only used in generic code when parsing "$ps".)
@item POP_FRAME
+@findex POP_FRAME
+@findex call_function_by_hand
+@findex return_command
Used in @samp{call_function_by_hand} to remove an artificial stack
-frame.
+frame and in @samp{return_command} to remove a real stack frame.
-@item PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)
-Define this to push arguments onto the stack for inferior function call.
+@item PUSH_ARGUMENTS (@var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr})
+@findex PUSH_ARGUMENTS
+Define this to push arguments onto the stack for inferior function
+call. Returns the updated stack pointer value.
@item PUSH_DUMMY_FRAME
+@findex PUSH_DUMMY_FRAME
Used in @samp{call_function_by_hand} to create an artificial stack frame.
@item REGISTER_BYTES
-The total amount of space needed to store GDB's copy of the machine's
+@findex REGISTER_BYTES
+The total amount of space needed to store @value{GDBN}'s copy of the machine's
register state.
-@item REGISTER_NAME(i)
-Return the name of register @var{i} as a string. May return @var{NULL}
-or @var{NUL} to indicate that register @var{i} is not valid.
+@item REGISTER_NAME(@var{i})
+@findex REGISTER_NAME
+Return the name of register @var{i} as a string. May return @code{NULL}
+or @code{NUL} to indicate that register @var{i} is not valid.
+
+@item REGISTER_NAMES
+@findex REGISTER_NAMES
+Deprecated in favor of @code{REGISTER_NAME}.
-@item REG_STRUCT_HAS_ADDR (gcc_p, type)
+@item REG_STRUCT_HAS_ADDR (@var{gcc_p}, @var{type})
+@findex REG_STRUCT_HAS_ADDR
Define this to return 1 if the given type will be passed by pointer
rather than directly.
+@item SAVE_DUMMY_FRAME_TOS (@var{sp})
+@findex SAVE_DUMMY_FRAME_TOS
+Used in @samp{call_function_by_hand} to notify the target dependent code
+of the top-of-stack value that will be passed to the the inferior code.
+This is the value of the @code{SP} after both the dummy frame and space
+for parameters/results have been allocated on the stack.
+
@item SDB_REG_TO_REGNUM
-Define this to convert sdb register numbers into GDB regnums. If not
+@findex SDB_REG_TO_REGNUM
+Define this to convert sdb register numbers into @value{GDBN} regnums. If not
defined, no conversion will be done.
@item SHIFT_INST_REGS
+@findex SHIFT_INST_REGS
(Only used for m88k targets.)
-@item SKIP_PROLOGUE (pc)
-A C statement that advances the @var{pc} across any function entry
-prologue instructions so as to reach ``real'' code.
+@item SKIP_PERMANENT_BREAKPOINT
+@findex SKIP_PERMANENT_BREAKPOINT
+Advance the inferior's PC past a permanent breakpoint. @value{GDBN} normally
+steps over a breakpoint by removing it, stepping one instruction, and
+re-inserting the breakpoint. However, permanent breakpoints are
+hardwired into the inferior, and can't be removed, so this strategy
+doesn't work. Calling @code{SKIP_PERMANENT_BREAKPOINT} adjusts the processor's
+state so that execution will resume just after the breakpoint. This
+macro does the right thing even when the breakpoint is in the delay slot
+of a branch or jump.
+
+@item SKIP_PROLOGUE (@var{pc})
+@findex SKIP_PROLOGUE
+A C expression that returns the address of the ``real'' code beyond the
+function entry prologue found at @var{pc}.
@item SKIP_PROLOGUE_FRAMELESS_P
-A C statement that should behave similarly, but that can stop as soon as
-the function is known to have a frame. If not defined,
+@findex SKIP_PROLOGUE_FRAMELESS_P
+A C expression that should behave similarly, but that can stop as soon
+as the function is known to have a frame. If not defined,
@code{SKIP_PROLOGUE} will be used instead.
-@item SKIP_TRAMPOLINE_CODE (pc)
+@item SKIP_TRAMPOLINE_CODE (@var{pc})
+@findex SKIP_TRAMPOLINE_CODE
If the target machine has trampoline code that sits between callers and
the functions being called, then define this macro to return a new PC
that is at the start of the real function.
@item SP_REGNUM
-Define this to be the number of the register that serves as the stack
-pointer.
+@findex SP_REGNUM
+If the stack-pointer is kept in a register, then define this macro to be
+the number (greater than or equal to zero) of that register.
+
+This should only need to be defined if @code{TARGET_WRITE_SP} and
+@code{TARGET_WRITE_SP} are not defined.
@item STAB_REG_TO_REGNUM
+@findex STAB_REG_TO_REGNUM
Define this to convert stab register numbers (as gotten from `r'
-declarations) into GDB regnums. If not defined, no conversion will be
+declarations) into @value{GDBN} regnums. If not defined, no conversion will be
done.
-@item STACK_ALIGN (addr)
+@item STACK_ALIGN (@var{addr})
+@findex STACK_ALIGN
Define this to adjust the address to the alignment required for the
processor's stack.
-@item STEP_SKIPS_DELAY (addr)
+@item STEP_SKIPS_DELAY (@var{addr})
+@findex STEP_SKIPS_DELAY
Define this to return true if the address is of an instruction with a
delay slot. If a breakpoint has been placed in the instruction's delay
-slot, GDB will single-step over that instruction before resuming
+slot, @value{GDBN} will single-step over that instruction before resuming
normally. Currently only defined for the Mips.
-@item STORE_RETURN_VALUE (type, valbuf)
+@item STORE_RETURN_VALUE (@var{type}, @var{valbuf})
+@findex STORE_RETURN_VALUE
A C expression that stores a function return value of type @var{type},
where @var{valbuf} is the address of the value to be stored.
@item SUN_FIXED_LBRAC_BUG
+@findex SUN_FIXED_LBRAC_BUG
(Used only for Sun-3 and Sun-4 targets.)
@item SYMBOL_RELOADING_DEFAULT
-The default value of the `symbol-reloading' variable. (Never defined in
+@findex SYMBOL_RELOADING_DEFAULT
+The default value of the ``symbol-reloading'' variable. (Never defined in
current sources.)
-@item TARGET_BYTE_ORDER_DEFAULT
-The ordering of bytes in the target. This must be either
-@code{BIG_ENDIAN} or @code{LITTLE_ENDIAN}. This macro replaces
-@var{TARGET_BYTE_ORDER} which is deprecated.
-
-@item TARGET_BYTE_ORDER_SELECTABLE_P
-Non-zero if the target has both @code{BIG_ENDIAN} and
-@code{LITTLE_ENDIAN} variants. This macro replaces
-@var{TARGET_BYTE_ORDER_SELECTABLE} which is deprecated.
-
@item TARGET_CHAR_BIT
+@findex TARGET_CHAR_BIT
Number of bits in a char; defaults to 8.
+@item TARGET_CHAR_SIGNED
+@findex TARGET_CHAR_SIGNED
+Non-zero if @code{char} is normally signed on this architecture; zero if
+it should be unsigned.
+
+The ISO C standard requires the compiler to treat @code{char} as
+equivalent to either @code{signed char} or @code{unsigned char}; any
+character in the standard execution set is supposed to be positive.
+Most compilers treat @code{char} as signed, but @code{char} is unsigned
+on the IBM S/390, RS6000, and PowerPC targets.
+
@item TARGET_COMPLEX_BIT
+@findex TARGET_COMPLEX_BIT
Number of bits in a complex number; defaults to @code{2 * TARGET_FLOAT_BIT}.
+At present this macro is not used.
+
@item TARGET_DOUBLE_BIT
+@findex TARGET_DOUBLE_BIT
Number of bits in a double float; defaults to @code{8 * TARGET_CHAR_BIT}.
@item TARGET_DOUBLE_COMPLEX_BIT
+@findex TARGET_DOUBLE_COMPLEX_BIT
Number of bits in a double complex; defaults to @code{2 * TARGET_DOUBLE_BIT}.
+At present this macro is not used.
+
@item TARGET_FLOAT_BIT
+@findex TARGET_FLOAT_BIT
Number of bits in a float; defaults to @code{4 * TARGET_CHAR_BIT}.
@item TARGET_INT_BIT
+@findex TARGET_INT_BIT
Number of bits in an integer; defaults to @code{4 * TARGET_CHAR_BIT}.
@item TARGET_LONG_BIT
+@findex TARGET_LONG_BIT
Number of bits in a long integer; defaults to @code{4 * TARGET_CHAR_BIT}.
@item TARGET_LONG_DOUBLE_BIT
+@findex TARGET_LONG_DOUBLE_BIT
Number of bits in a long double float;
defaults to @code{2 * TARGET_DOUBLE_BIT}.
@item TARGET_LONG_LONG_BIT
+@findex TARGET_LONG_LONG_BIT
Number of bits in a long long integer; defaults to @code{2 * TARGET_LONG_BIT}.
@item TARGET_PTR_BIT
+@findex TARGET_PTR_BIT
Number of bits in a pointer; defaults to @code{TARGET_INT_BIT}.
@item TARGET_SHORT_BIT
+@findex TARGET_SHORT_BIT
Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}.
@item TARGET_READ_PC
-@item TARGET_WRITE_PC (val, pid)
-@item TARGET_READ_SP
-@item TARGET_WRITE_SP
-@item TARGET_READ_FP
-@item TARGET_WRITE_FP
+@findex TARGET_READ_PC
+@itemx TARGET_WRITE_PC (@var{val}, @var{pid})
+@findex TARGET_WRITE_PC
+@itemx TARGET_READ_SP
+@findex TARGET_READ_SP
+@itemx TARGET_WRITE_SP
+@findex TARGET_WRITE_SP
+@itemx TARGET_READ_FP
+@findex TARGET_READ_FP
+@itemx TARGET_WRITE_FP
+@findex TARGET_WRITE_FP
+@findex read_pc
+@findex write_pc
+@findex read_sp
+@findex write_sp
+@findex read_fp
+@findex write_fp
These change the behavior of @code{read_pc}, @code{write_pc},
@code{read_sp}, @code{write_sp}, @code{read_fp} and @code{write_fp}.
-For most targets, these may be left undefined. GDB will call the read
+For most targets, these may be left undefined. @value{GDBN} will call the read
and write register functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
in an ordinary register.
-@item TARGET_VIRTUAL_FRAME_POINTER(pc,regp,offsetp)
+@item TARGET_VIRTUAL_FRAME_POINTER(@var{pc}, @var{regp}, @var{offsetp})
+@findex TARGET_VIRTUAL_FRAME_POINTER
Returns a @code{(register, offset)} pair representing the virtual
-frame pointer in use at the code address @code{"pc"}. If virtual
+frame pointer in use at the code address @var{pc}. If virtual
frame pointers are not used, a default definition simply returns
@code{FP_REGNUM}, with an offset of zero.
-@item USE_STRUCT_CONVENTION (gcc_p, type)
+@item TARGET_HAS_HARDWARE_WATCHPOINTS
+If non-zero, the target has support for hardware-assisted
+watchpoints. @xref{Algorithms, watchpoints}, for more details and
+other related macros.
+
+@item TARGET_PRINT_INSN (@var{addr}, @var{info})
+@findex TARGET_PRINT_INSN
+This is the function used by @value{GDBN} to print an assembly
+instruction. It prints the instruction at address @var{addr} in
+debugged memory and returns the length of the instruction, in bytes. If
+a target doesn't define its own printing routine, it defaults to an
+accessor function for the global pointer @code{tm_print_insn}. This
+usually points to a function in the @code{opcodes} library (@pxref{Support
+Libraries, ,Opcodes}). @var{info} is a structure (of type
+@code{disassemble_info}) defined in @file{include/dis-asm.h} used to
+pass information to the instruction decoding routine.
+
+@item USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type})
+@findex USE_STRUCT_CONVENTION
If defined, this must be an expression that is nonzero if a value of the
given @var{type} being returned from a function must have space
allocated for it on the stack. @var{gcc_p} is true if the function
@@ -1635,50 +3597,48 @@ being considered is known to have been compiled by GCC; this is helpful
for systems where GCC is known to use different calling convention than
other compilers.
-@item VARIABLES_INSIDE_BLOCK (desc, gcc_p)
+@item VARIABLES_INSIDE_BLOCK (@var{desc}, @var{gcc_p})
+@findex VARIABLES_INSIDE_BLOCK
For dbx-style debugging information, if the compiler puts variable
declarations inside LBRAC/RBRAC blocks, this should be defined to be
nonzero. @var{desc} is the value of @code{n_desc} from the
-@code{N_RBRAC} symbol, and @var{gcc_p} is true if GDB has noticed the
+@code{N_RBRAC} symbol, and @var{gcc_p} is true if @value{GDBN} has noticed the
presence of either the @code{GCC_COMPILED_SYMBOL} or the
@code{GCC2_COMPILED_SYMBOL}. By default, this is 0.
-@item OS9K_VARIABLES_INSIDE_BLOCK (desc, gcc_p)
+@item OS9K_VARIABLES_INSIDE_BLOCK (@var{desc}, @var{gcc_p})
+@findex OS9K_VARIABLES_INSIDE_BLOCK
Similarly, for OS/9000. Defaults to 1.
-
@end table
Motorola M68K target conditionals.
-@table @code
-
+@ftable @code
@item BPT_VECTOR
Define this to be the 4-bit location of the breakpoint trap vector. If
not defined, it will default to @code{0xf}.
@item REMOTE_BPT_VECTOR
Defaults to @code{1}.
-
-@end table
+@end ftable
@section Adding a New Target
-The following files define a target to GDB:
+@cindex adding a target
+The following files add a target to @value{GDBN}:
@table @file
-
+@vindex TDEPFILES
@item gdb/config/@var{arch}/@var{ttt}.mt
Contains a Makefile fragment specific to this target. Specifies what
object files are needed for target @var{ttt}, by defining
-@samp{TDEPFILES=@dots{}}. Also specifies the header file which
-describes @var{ttt}, by defining @samp{TM_FILE= tm-@var{ttt}.h}. You
-can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS}, but
-these are now deprecated and may go away in future versions of GDB.
+@samp{TDEPFILES=@dots{}} and @samp{TDEPLIBS=@dots{}}. Also specifies
+the header file which describes @var{ttt}, by defining @samp{TM_FILE=
+tm-@var{ttt}.h}.
-@item gdb/config/@var{arch}/tm-@var{ttt}.h
-(@file{tm.h} is a link to this file, created by configure). Contains
-macro definitions about the target machine's registers, stack frame
-format and instructions.
+You can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS},
+but these are now deprecated, replaced by autoconf, and may go away in
+future versions of @value{GDBN}.
@item gdb/@var{ttt}-tdep.c
Contains any miscellaneous code required for this target machine. On
@@ -1688,22 +3648,34 @@ as functions here instead, and the macro is simply defined to call the
function. This is vastly preferable, since it is easier to understand
and debug.
+@item gdb/@var{arch}-tdep.c
+@itemx gdb/@var{arch}-tdep.h
+This often exists to describe the basic layout of the target machine's
+processor chip (registers, stack, etc.). If used, it is included by
+@file{@var{ttt}-tdep.h}. It can be shared among many targets that use
+the same processor.
+
+@item gdb/config/@var{arch}/tm-@var{ttt}.h
+(@file{tm.h} is a link to this file, created by @code{configure}). Contains
+macro definitions about the target machine's registers, stack frame
+format and instructions.
+
+New targets do not need this file and should not create it.
+
@item gdb/config/@var{arch}/tm-@var{arch}.h
This often exists to describe the basic layout of the target machine's
-processor chip (registers, stack, etc). If used, it is included by
+processor chip (registers, stack, etc.). If used, it is included by
@file{tm-@var{ttt}.h}. It can be shared among many targets that use the
same processor.
-@item gdb/@var{arch}-tdep.c
-Similarly, there are often common subroutines that are shared by all
-target machines that use this particular architecture.
+New targets do not need this file and should not create it.
@end table
If you are adding a new operating system for an existing CPU chip, add a
@file{config/tm-@var{os}.h} file that describes the operating system
facilities that are unusual (extra symbol table info; the breakpoint
-instruction needed; etc). Then write a @file{@var{arch}/tm-@var{os}.h}
+instruction needed; etc.). Then write a @file{@var{arch}/tm-@var{os}.h}
that just @code{#include}s @file{tm-@var{arch}.h} and
@file{config/tm-@var{os}.h}.
@@ -1711,12 +3683,13 @@ that just @code{#include}s @file{tm-@var{arch}.h} and
@node Target Vector Definition
@chapter Target Vector Definition
+@cindex target vector
-The target vector defines the interface between GDB's abstract handling
-of target systems, and the nitty-gritty code that actually exercises
-control over a process or a serial port. GDB includes some 30-40
-different target vectors; however, each configuration of GDB includes
-only a few of them.
+The target vector defines the interface between @value{GDBN}'s
+abstract handling of target systems, and the nitty-gritty code that
+actually exercises control over a process or a serial port.
+@value{GDBN} includes some 30-40 different target vectors; however,
+each configuration of @value{GDBN} includes only a few of them.
@section File Targets
@@ -1724,39 +3697,40 @@ Both executables and core files have target vectors.
@section Standard Protocol and Remote Stubs
-GDB's file @file{remote.c} talks a serial protocol to code that runs in
-the target system. GDB provides several sample ``stubs'' that can be
-integrated into target programs or operating systems for this purpose;
-they are named @file{*-stub.c}.
+@value{GDBN}'s file @file{remote.c} talks a serial protocol to code
+that runs in the target system. @value{GDBN} provides several sample
+@dfn{stubs} that can be integrated into target programs or operating
+systems for this purpose; they are named @file{*-stub.c}.
-The GDB user's manual describes how to put such a stub into your target
-code. What follows is a discussion of integrating the SPARC stub into a
-complicated operating system (rather than a simple program), by Stu
-Grossman, the author of this stub.
+The @value{GDBN} user's manual describes how to put such a stub into
+your target code. What follows is a discussion of integrating the
+SPARC stub into a complicated operating system (rather than a simple
+program), by Stu Grossman, the author of this stub.
The trap handling code in the stub assumes the following upon entry to
-trap_low:
+@code{trap_low}:
@enumerate
+@item
+%l1 and %l2 contain pc and npc respectively at the time of the trap;
-@item %l1 and %l2 contain pc and npc respectively at the time of the trap
-
-@item traps are disabled
-
-@item you are in the correct trap window
+@item
+traps are disabled;
+@item
+you are in the correct trap window.
@end enumerate
As long as your trap handler can guarantee those conditions, then there
-is no reason why you shouldn't be able to `share' traps with the stub.
+is no reason why you shouldn't be able to ``share'' traps with the stub.
The stub has no requirement that it be jumped to directly from the
hardware trap vector. That is why it calls @code{exceptionHandler()},
which is provided by the external environment. For instance, this could
-setup the hardware traps to actually execute code which calls the stub
+set up the hardware traps to actually execute code which calls the stub
first, and then transfers to its own trap handler.
For the most point, there probably won't be much of an issue with
-`sharing' traps, as the traps we use are usually not used by the kernel,
+``sharing'' traps, as the traps we use are usually not used by the kernel,
and often indicate unrecoverable error conditions. Anyway, this is all
controlled by a table, and is trivial to modify. The most important
trap for us is for @code{ta 1}. Without that, we can't single step or
@@ -1764,7 +3738,7 @@ do breakpoints. Everything else is unnecessary for the proper operation
of the debugger/stub.
From reading the stub, it's probably not obvious how breakpoints work.
-They are simply done by deposit/examine operations from GDB.
+They are simply done by deposit/examine operations from @value{GDBN}.
@section ROM Monitor Interface
@@ -1778,13 +3752,14 @@ They are simply done by deposit/examine operations from GDB.
@node Native Debugging
@chapter Native Debugging
+@cindex native debugging
-Several files control GDB's configuration for native support:
+Several files control @value{GDBN}'s configuration for native support:
@table @file
-
+@vindex NATDEPFILES
@item gdb/config/@var{arch}/@var{xyz}.mh
-Specifies Makefile fragments needed when hosting @emph{or native} on
+Specifies Makefile fragments needed by a @emph{native} configuration on
machine @var{xyz}. In particular, this lists the required
native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}.
Also specifies the header file which describes native support on
@@ -1792,15 +3767,21 @@ Also specifies the header file which describes native support on
define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS},
@samp{NAT_CDEPS}, etc.; see @file{Makefile.in}.
+@emph{Maintainer's note: The @file{.mh} suffix is because this file
+originally contained @file{Makefile} fragments for hosting @value{GDBN}
+on machine @var{xyz}. While the file is no longer used for this
+purpose, the @file{.mh} suffix remains. Perhaphs someone will
+eventually rename these fragments so that they have a @file{.mn}
+suffix.}
+
@item gdb/config/@var{arch}/nm-@var{xyz}.h
-(@file{nm.h} is a link to this file, created by configure). Contains C
+(@file{nm.h} is a link to this file, created by @code{configure}). Contains C
macro definitions describing the native system environment, such as
child process control and core file support.
@item gdb/@var{xyz}-nat.c
Contains any miscellaneous C code required for this native support of
this machine. On some machines it doesn't exist at all.
-
@end table
There are some ``generic'' versions of routines that can be used by
@@ -1811,11 +3792,10 @@ the @var{xyz} host, you can just include the generic file's name (with
Otherwise, if your machine needs custom support routines, you will need
to write routines that perform the same functions as the generic file.
-Put them into @code{@var{xyz}-nat.c}, and put @code{@var{xyz}-nat.o}
+Put them into @file{@var{xyz}-nat.c}, and put @file{@var{xyz}-nat.o}
into @code{NATDEPFILES}.
@table @file
-
@item inftarg.c
This contains the @emph{target_ops vector} that supports Unix child
processes on systems which use ptrace and wait to control the child.
@@ -1825,19 +3805,19 @@ This contains the @emph{target_ops vector} that supports Unix child
processes on systems which use /proc to control the child.
@item fork-child.c
-This does the low-level grunge that uses Unix system calls to do a "fork
-and exec" to start up a child process.
+This does the low-level grunge that uses Unix system calls to do a ``fork
+and exec'' to start up a child process.
@item infptrace.c
This is the low level interface to inferior processes for systems using
the Unix @code{ptrace} call in a vanilla way.
-
@end table
@section Native core file Support
+@cindex native core files
@table @file
-
+@findex fetch_core_registers
@item core-aout.c::fetch_core_registers()
Support for reading registers out of a core file. This routine calls
@code{register_addr()}, see below. Now that BFD is used to read core
@@ -1848,7 +3828,7 @@ just provide @code{fetch_core_registers} in @code{@var{xyz}-nat.c} (or
@item core-aout.c::register_addr()
If your @code{nm-@var{xyz}.h} file defines the macro
@code{REGISTER_U_ADDR(addr, blockend, regno)}, it should be defined to
-set @code{addr} to the offset within the @samp{user} struct of GDB
+set @code{addr} to the offset within the @samp{user} struct of @value{GDBN}
register number @code{regno}. @code{blockend} is the offset within the
``upage'' of @code{u.u_ar0}. If @code{REGISTER_U_ADDR} is defined,
@file{core-aout.c} will define the @code{register_addr()} function and
@@ -1860,18 +3840,17 @@ the @code{NATDEPFILES} list. If you have your own
@code{fetch_core_registers()}, you may not need a separate
@code{register_addr()}. Many custom @code{fetch_core_registers()}
implementations simply locate the registers themselves.@refill
-
@end table
-When making GDB run native on a new operating system, to make it
+When making @value{GDBN} run native on a new operating system, to make it
possible to debug core files, you will need to either write specific
code for parsing your OS's core files, or customize
@file{bfd/trad-core.c}. First, use whatever @code{#include} files your
machine uses to define the struct of registers that is accessible
(possibly in the u-area) in a core file (rather than
@file{machine/reg.h}), and an include file that defines whatever header
-exists on a core file (e.g. the u-area or a @samp{struct core}). Then
-modify @code{trad_unix_core_file_p()} to use these values to set up the
+exists on a core file (e.g. the u-area or a @code{struct core}). Then
+modify @code{trad_unix_core_file_p} to use these values to set up the
section information for the data segment, stack segment, any other
segments in the core file (perhaps shared library contents or control
information), ``registers'' segment, and if there are two discontiguous
@@ -1880,13 +3859,13 @@ section information basically delimits areas in the core file in a
standard way, which the section-reading routines in BFD know how to seek
around in.
-Then back in GDB, you need a matching routine called
-@code{fetch_core_registers()}. If you can use the generic one, it's in
+Then back in @value{GDBN}, you need a matching routine called
+@code{fetch_core_registers}. If you can use the generic one, it's in
@file{core-aout.c}; if not, it's in your @file{@var{xyz}-nat.c} file.
It will be passed a char pointer to the entire ``registers'' segment,
its length, and a zero; or a char pointer to the entire ``regs2''
segment, its length, and a 2. The routine should suck out the supplied
-register values and install them into GDB's ``registers'' array.
+register values and install them into @value{GDBN}'s ``registers'' array.
If your system uses @file{/proc} to control processes, and uses ELF
format core files, then you may be able to use the same routines for
@@ -1901,19 +3880,21 @@ reading the registers out of processes and out of core files.
@section shared libraries
@section Native Conditionals
+@cindex native conditionals
-When GDB is configured and compiled, various macros are defined or left
-undefined, to control compilation when the host and target systems are
-the same. These macros should be defined (or left undefined) in
-@file{nm-@var{system}.h}.
+When @value{GDBN} is configured and compiled, various macros are
+defined or left undefined, to control compilation when the host and
+target systems are the same. These macros should be defined (or left
+undefined) in @file{nm-@var{system}.h}.
@table @code
-
@item ATTACH_DETACH
-If defined, then GDB will include support for the @code{attach} and
+@findex ATTACH_DETACH
+If defined, then @value{GDBN} will include support for the @code{attach} and
@code{detach} commands.
@item CHILD_PREPARE_TO_STORE
+@findex CHILD_PREPARE_TO_STORE
If the machine stores all registers at once in the child process, then
define this to ensure that all values are correct. This usually entails
a read from the child.
@@ -1922,98 +3903,142 @@ a read from the child.
currently.]
@item FETCH_INFERIOR_REGISTERS
+@findex FETCH_INFERIOR_REGISTERS
Define this if the native-dependent code will provide its own routines
@code{fetch_inferior_registers} and @code{store_inferior_registers} in
-@file{@var{HOST}-nat.c}. If this symbol is @emph{not} defined, and
+@file{@var{host}-nat.c}. If this symbol is @emph{not} defined, and
@file{infptrace.c} is included in this configuration, the default
routines in @file{infptrace.c} are used for these functions.
@item FILES_INFO_HOOK
+@findex FILES_INFO_HOOK
(Only defined for Convex.)
@item FP0_REGNUM
+@findex FP0_REGNUM
This macro is normally defined to be the number of the first floating
point register, if the machine has such registers. As such, it would
-appear only in target-specific code. However, /proc support uses this
+appear only in target-specific code. However, @file{/proc} support uses this
to decide whether floats are in use on this target.
@item GET_LONGJMP_TARGET
+@findex GET_LONGJMP_TARGET
For most machines, this is a target-dependent parameter. On the
DECstation and the Iris, this is a native-dependent parameter, since
-<setjmp.h> is needed to define it.
+@file{setjmp.h} is needed to define it.
-This macro determines the target PC address that longjmp() will jump to,
+This macro determines the target PC address that @code{longjmp} will jump to,
assuming that we have just stopped at a longjmp breakpoint. It takes a
-CORE_ADDR * as argument, and stores the target PC value through this
+@code{CORE_ADDR *} as argument, and stores the target PC value through this
pointer. It examines the current state of the machine as needed.
+@item I386_USE_GENERIC_WATCHPOINTS
+An x86-based machine can define this to use the generic x86 watchpoint
+support; see @ref{Algorithms, I386_USE_GENERIC_WATCHPOINTS}.
+
@item KERNEL_U_ADDR
+@findex KERNEL_U_ADDR
Define this to the address of the @code{u} structure (the ``user
-struct'', also known as the ``u-page'') in kernel virtual memory. GDB
+struct'', also known as the ``u-page'') in kernel virtual memory. @value{GDBN}
needs to know this so that it can subtract this address from absolute
addresses in the upage, that are obtained via ptrace or from core files.
On systems that don't need this value, set it to zero.
@item KERNEL_U_ADDR_BSD
-Define this to cause GDB to determine the address of @code{u} at
+@findex KERNEL_U_ADDR_BSD
+Define this to cause @value{GDBN} to determine the address of @code{u} at
runtime, by using Berkeley-style @code{nlist} on the kernel's image in
the root directory.
@item KERNEL_U_ADDR_HPUX
-Define this to cause GDB to determine the address of @code{u} at
+@findex KERNEL_U_ADDR_HPUX
+Define this to cause @value{GDBN} to determine the address of @code{u} at
runtime, by using HP-style @code{nlist} on the kernel's image in the
root directory.
@item ONE_PROCESS_WRITETEXT
+@findex ONE_PROCESS_WRITETEXT
Define this to be able to, when a breakpoint insertion fails, warn the
user that another process may be running with the same executable.
+@item PREPARE_TO_PROCEED (@var{select_it})
+@findex PREPARE_TO_PROCEED
+This (ugly) macro allows a native configuration to customize the way the
+@code{proceed} function in @file{infrun.c} deals with switching between
+threads.
+
+In a multi-threaded task we may select another thread and then continue
+or step. But if the old thread was stopped at a breakpoint, it will
+immediately cause another breakpoint stop without any execution (i.e. it
+will report a breakpoint hit incorrectly). So @value{GDBN} must step over it
+first.
+
+If defined, @code{PREPARE_TO_PROCEED} should check the current thread
+against the thread that reported the most recent event. If a step-over
+is required, it returns TRUE. If @var{select_it} is non-zero, it should
+reselect the old thread.
+
@item PROC_NAME_FMT
+@findex PROC_NAME_FMT
Defines the format for the name of a @file{/proc} device. Should be
defined in @file{nm.h} @emph{only} in order to override the default
definition in @file{procfs.c}.
@item PTRACE_FP_BUG
-mach386-xdep.c
+@findex PTRACE_FP_BUG
+See @file{mach386-xdep.c}.
@item PTRACE_ARG3_TYPE
+@findex PTRACE_ARG3_TYPE
The type of the third argument to the @code{ptrace} system call, if it
exists and is different from @code{int}.
@item REGISTER_U_ADDR
+@findex REGISTER_U_ADDR
Defines the offset of the registers in the ``u area''.
@item SHELL_COMMAND_CONCAT
+@findex SHELL_COMMAND_CONCAT
If defined, is a string to prefix on the shell command used to start the
inferior.
@item SHELL_FILE
+@findex SHELL_FILE
If defined, this is the name of the shell to use to run the inferior.
Defaults to @code{"/bin/sh"}.
-@item SOLIB_ADD (filename, from_tty, targ)
+@item SOLIB_ADD (@var{filename}, @var{from_tty}, @var{targ}, @var{readsyms})
+@findex SOLIB_ADD
Define this to expand into an expression that will cause the symbols in
-@var{filename} to be added to GDB's symbol table.
+@var{filename} to be added to @value{GDBN}'s symbol table. If
+@var{readsyms} is zero symbols are not read but any necessary low level
+processing for @var{filename} is still done.
@item SOLIB_CREATE_INFERIOR_HOOK
+@findex SOLIB_CREATE_INFERIOR_HOOK
Define this to expand into any shared-library-relocation code that you
want to be run just after the child process has been forked.
@item START_INFERIOR_TRAPS_EXPECTED
-When starting an inferior, GDB normally expects to trap twice; once when
+@findex START_INFERIOR_TRAPS_EXPECTED
+When starting an inferior, @value{GDBN} normally expects to trap
+twice; once when
the shell execs, and once when the program itself execs. If the actual
number of traps is something other than 2, then define this macro to
expand into the number expected.
@item SVR4_SHARED_LIBS
+@findex SVR4_SHARED_LIBS
Define this to indicate that SVR4-style shared libraries are in use.
@item USE_PROC_FS
+@findex USE_PROC_FS
This determines whether small routines in @file{*-tdep.c}, which
-translate register values between GDB's internal representation and the
-/proc representation, are compiled.
+translate register values between @value{GDBN}'s internal
+representation and the @file{/proc} representation, are compiled.
@item U_REGS_OFFSET
+@findex U_REGS_OFFSET
This is the offset of the registers in the upage. It need only be
defined if the generic ptrace register access routines in
@file{infptrace.c} are being used (that is, @file{infptrace.c} is
@@ -2023,14 +4048,15 @@ undefined.
The default value means that u.u_ar0 @emph{points to} the location of
the registers. I'm guessing that @code{#define U_REGS_OFFSET 0} means
-that u.u_ar0 @emph{is} the location of the registers.
+that @code{u.u_ar0} @emph{is} the location of the registers.
@item CLEAR_SOLIB
-objfiles.c
+@findex CLEAR_SOLIB
+See @file{objfiles.c}.
@item DEBUG_PTRACE
-Define this to debug ptrace calls.
-
+@findex DEBUG_PTRACE
+Define this to debug @code{ptrace} calls.
@end table
@@ -2039,11 +4065,11 @@ Define this to debug ptrace calls.
@chapter Support Libraries
@section BFD
+@cindex BFD library
-BFD provides support for GDB in several ways:
+BFD provides support for @value{GDBN} in several ways:
@table @emph
-
@item identifying executable and core files
BFD will identify a variety of file types, including a.out, coff, and
several variants thereof, as well as several kinds of core files.
@@ -2051,27 +4077,28 @@ several variants thereof, as well as several kinds of core files.
@item access to sections of files
BFD parses the file headers to determine the names, virtual addresses,
sizes, and file locations of all the various named sections in files
-(such as the text section or the data section). GDB simply calls BFD to
-read or write section X at byte offset Y for length Z.
+(such as the text section or the data section). @value{GDBN} simply
+calls BFD to read or write section @var{x} at byte offset @var{y} for
+length @var{z}.
@item specialized core file support
BFD provides routines to determine the failing command name stored in a
core file, the signal with which the program failed, and whether a core
-file matches (i.e. could be a core dump of) a particular executable
+file matches (i.e.@: could be a core dump of) a particular executable
file.
@item locating the symbol information
-GDB uses an internal interface of BFD to determine where to find the
-symbol information in an executable file or symbol-file. GDB itself
+@value{GDBN} uses an internal interface of BFD to determine where to find the
+symbol information in an executable file or symbol-file. @value{GDBN} itself
handles the reading of symbols, since BFD does not ``understand'' debug
-symbols, but GDB uses BFD's cached information to find the symbols,
+symbols, but @value{GDBN} uses BFD's cached information to find the symbols,
string table, etc.
-
@end table
@section opcodes
+@cindex opcodes library
-The opcodes library provides GDB's disassembler. (It's a separate
+The opcodes library provides @value{GDBN}'s disassembler. (It's a separate
library because it's also used in binutils, for @file{objdump}).
@section readline
@@ -2081,11 +4108,11 @@ library because it's also used in binutils, for @file{objdump}).
@section libiberty
@section gnu-regex
+@cindex regular expressions library
Regex conditionals.
@table @code
-
@item C_ALLOCA
@item NFAILURES
@@ -2101,7 +4128,6 @@ Regex conditionals.
@item Sword
@item sparc
-
@end table
@section include
@@ -2111,53 +4137,102 @@ Regex conditionals.
@chapter Coding
This chapter covers topics that are lower-level than the major
-algorithms of GDB.
+algorithms of @value{GDBN}.
@section Cleanups
+@cindex cleanups
Cleanups are a structured way to deal with things that need to be done
-later. When your code does something (like @code{malloc} some memory,
-or open a file) that needs to be undone later (e.g. free the memory or
-close the file), it can make a cleanup. The cleanup will be done at
-some future point: when the command is finished, when an error occurs,
-or when your code decides it's time to do cleanups.
+later.
-You can also discard cleanups, that is, throw them away without doing
-what they say. This is only done if you ask that it be done.
+When your code does something (e.g., @code{xmalloc} some memory, or
+@code{open} a file) that needs to be undone later (e.g., @code{xfree}
+the memory or @code{close} the file), it can make a cleanup. The
+cleanup will be done at some future point: when the command is finished
+and control returns to the top level; when an error occurs and the stack
+is unwound; or when your code decides it's time to explicitly perform
+cleanups. Alternatively you can elect to discard the cleanups you
+created.
Syntax:
@table @code
-
@item struct cleanup *@var{old_chain};
Declare a variable which will hold a cleanup chain handle.
+@findex make_cleanup
@item @var{old_chain} = make_cleanup (@var{function}, @var{arg});
Make a cleanup which will cause @var{function} to be called with
@var{arg} (a @code{char *}) later. The result, @var{old_chain}, is a
-handle that can be passed to @code{do_cleanups} or
-@code{discard_cleanups} later. Unless you are going to call
-@code{do_cleanups} or @code{discard_cleanups} yourself, you can ignore
-the result from @code{make_cleanup}.
+handle that can later be passed to @code{do_cleanups} or
+@code{discard_cleanups}. Unless you are going to call
+@code{do_cleanups} or @code{discard_cleanups}, you can ignore the result
+from @code{make_cleanup}.
+@findex do_cleanups
@item do_cleanups (@var{old_chain});
-Perform all cleanups done since @code{make_cleanup} returned
-@var{old_chain}. E.g.:
+Do all cleanups added to the chain since the corresponding
+@code{make_cleanup} call was made.
+
+@findex discard_cleanups
+@item discard_cleanups (@var{old_chain});
+Same as @code{do_cleanups} except that it just removes the cleanups from
+the chain and does not call the specified functions.
+@end table
+
+Cleanups are implemented as a chain. The handle returned by
+@code{make_cleanups} includes the cleanup passed to the call and any
+later cleanups appended to the chain (but not yet discarded or
+performed). E.g.:
+
@example
make_cleanup (a, 0);
-old = make_cleanup (b, 0);
-do_cleanups (old);
+@{
+ struct cleanup *old = make_cleanup (b, 0);
+ make_cleanup (c, 0)
+ ...
+ do_cleanups (old);
+@}
@end example
+
@noindent
-will call @code{b()} but will not call @code{a()}. The cleanup that
-calls @code{a()} will remain in the cleanup chain, and will be done
-later unless otherwise discarded.@refill
+will call @code{c()} and @code{b()} but will not call @code{a()}. The
+cleanup that calls @code{a()} will remain in the cleanup chain, and will
+be done later unless otherwise discarded.@refill
+
+Your function should explicitly do or discard the cleanups it creates.
+Failing to do this leads to non-deterministic behavior since the caller
+will arbitrarily do or discard your functions cleanups. This need leads
+to two common cleanup styles.
+
+The first style is try/finally. Before it exits, your code-block calls
+@code{do_cleanups} with the old cleanup chain and thus ensures that your
+code-block's cleanups are always performed. For instance, the following
+code-segment avoids a memory leak problem (even when @code{error} is
+called and a forced stack unwind occurs) by ensuring that the
+@code{xfree} will always be called:
-@item discard_cleanups (@var{old_chain});
-Same as @code{do_cleanups} except that it just removes the cleanups from
-the chain and does not call the specified functions.
+@example
+struct cleanup *old = make_cleanup (null_cleanup, 0);
+data = xmalloc (sizeof blah);
+make_cleanup (xfree, data);
+... blah blah ...
+do_cleanups (old);
+@end example
-@end table
+The second style is try/except. Before it exits, your code-block calls
+@code{discard_cleanups} with the old cleanup chain and thus ensures that
+any created cleanups are not performed. For instance, the following
+code segment, ensures that the file will be closed but only if there is
+an error:
+
+@example
+FILE *file = fopen ("afile", "r");
+struct cleanup *old = make_cleanup (close_file, file);
+... blah blah ...
+discard_cleanups (old);
+return file;
+@end example
Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify
that they ``should not be called when cleanups are not in place''. This
@@ -2167,7 +4242,9 @@ functions, since they might never return to your code (they
@samp{longjmp} instead).
@section Wrapping Output Lines
+@cindex line wrap in output
+@findex wrap_here
Output that goes through @code{printf_filtered} or @code{fputs_filtered}
or @code{fputs_demangled} needs only to have calls to @code{wrap_here}
added in places that would be good breaking points. The utility
@@ -2181,70 +4258,193 @@ away and used later. It must remain valid until the next call to
@code{*_filtered} functions. Don't pass in a local variable and then
return!
-It is usually best to call @code{wrap_here()} after printing a comma or
+It is usually best to call @code{wrap_here} after printing a comma or
space. If you call it before printing a space, make sure that your
indentation properly accounts for the leading space that will print if
the line wraps there.
Any function or set of functions that produce filtered output must
finish by printing a newline, to flush the wrap buffer, before switching
-to unfiltered (``@code{printf}'') output. Symbol reading routines that
+to unfiltered (@code{printf}) output. Symbol reading routines that
print warnings are a good example.
-@section GDB Coding Standards
+@section @value{GDBN} Coding Standards
+@cindex coding standards
-GDB follows the GNU coding standards, as described in
+@value{GDBN} follows the GNU coding standards, as described in
@file{etc/standards.texi}. This file is also available for anonymous
-FTP from GNU archive sites. GDB takes a strict interpretation of the
-standard; in general, when the GNU standard recommends a practice but
-does not require it, GDB requires it.
+FTP from GNU archive sites. @value{GDBN} takes a strict interpretation
+of the standard; in general, when the GNU standard recommends a practice
+but does not require it, @value{GDBN} requires it.
+
+@value{GDBN} follows an additional set of coding standards specific to
+@value{GDBN}, as described in the following sections.
+
+
+@subsection ISO-C
+
+@value{GDBN} assumes an ISO-C compliant compiler.
+
+@value{GDBN} does not assume an ISO-C or POSIX compliant C library.
+
+
+@subsection Memory Management
+
+@value{GDBN} does not use the functions @code{malloc}, @code{realloc},
+@code{calloc}, @code{free} and @code{asprintf}.
+
+@value{GDBN} uses the functions @code{xmalloc}, @code{xrealloc} and
+@code{xcalloc} when allocating memory. Unlike @code{malloc} et.al.@:
+these functions do not return when the memory pool is empty. Instead,
+they unwind the stack using cleanups. These functions return
+@code{NULL} when requested to allocate a chunk of memory of size zero.
+
+@emph{Pragmatics: By using these functions, the need to check every
+memory allocation is removed. These functions provide portable
+behavior.}
+
+@value{GDBN} does not use the function @code{free}.
+
+@value{GDBN} uses the function @code{xfree} to return memory to the
+memory pool. Consistent with ISO-C, this function ignores a request to
+free a @code{NULL} pointer.
-GDB follows an additional set of coding standards specific to GDB,
-as described in the following sections.
+@emph{Pragmatics: On some systems @code{free} fails when passed a
+@code{NULL} pointer.}
-You can configure with @samp{--enable-build-warnings} to get GCC to
-check on a number of these rules. GDB sources ought not to engender any
-complaints, unless they are caused by bogus host systems. (The exact
-set of enabled warnings is currently @samp{-Wall -Wpointer-arith
--Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations}.
+@value{GDBN} can use the non-portable function @code{alloca} for the
+allocation of small temporary values (such as strings).
+
+@emph{Pragmatics: This function is very non-portable. Some systems
+restrict the memory being allocated to no more than a few kilobytes.}
+
+@value{GDBN} uses the string function @code{xstrdup} and the print
+function @code{xasprintf}.
+
+@emph{Pragmatics: @code{asprintf} and @code{strdup} can fail. Print
+functions such as @code{sprintf} are very prone to buffer overflow
+errors.}
+
+
+@subsection Compiler Warnings
+@cindex compiler warnings
+
+With few exceptions, developers should include the configuration option
+@samp{--enable-gdb-build-warnings=,-Werror} when building @value{GDBN}.
+The exceptions are listed in the file @file{gdb/MAINTAINERS}.
+
+This option causes @value{GDBN} (when built using GCC) to be compiled
+with a carefully selected list of compiler warning flags. Any warnings
+from those flags being treated as errors.
+
+The current list of warning flags includes:
+
+@table @samp
+@item -Wimplicit
+Since @value{GDBN} coding standard requires all functions to be declared
+using a prototype, the flag has the side effect of ensuring that
+prototyped functions are always visible with out resorting to
+@samp{-Wstrict-prototypes}.
+
+@item -Wreturn-type
+Such code often appears to work except on instruction set architectures
+that use register windows.
+
+@item -Wcomment
+
+@item -Wtrigraphs
+
+@item -Wformat
+Since @value{GDBN} uses the @code{format printf} attribute on all
+@code{printf} like functions this checks not just @code{printf} calls
+but also calls to functions such as @code{fprintf_unfiltered}.
+
+@item -Wparentheses
+This warning includes uses of the assignment operator within an
+@code{if} statement.
+
+@item -Wpointer-arith
+
+@item -Wuninitialized
+@end table
+
+@emph{Pragmatics: Due to the way that @value{GDBN} is implemented most
+functions have unused parameters. Consequently the warning
+@samp{-Wunused-parameter} is precluded from the list. The macro
+@code{ATTRIBUTE_UNUSED} is not used as it leads to false negatives ---
+it is not an error to have @code{ATTRIBUTE_UNUSED} on a parameter that
+is being used. The options @samp{-Wall} and @samp{-Wunused} are also
+precluded because they both include @samp{-Wunused-parameter}.}
+
+@emph{Pragmatics: @value{GDBN} has not simply accepted the warnings
+enabled by @samp{-Wall -Werror -W...}. Instead it is selecting warnings
+when and where their benefits can be demonstrated.}
@subsection Formatting
+@cindex source code formatting
The standard GNU recommendations for formatting must be followed
strictly.
-Note that while in a definition, the function's name must be in column
-zero; in a function declaration, the name must be on the same line as
-the return type.
+A function declaration should not have its name in column zero. A
+function definition should have its name in column zero.
+
+@example
+/* Declaration */
+static void foo (void);
+/* Definition */
+void
+foo (void)
+@{
+@}
+@end example
+
+@emph{Pragmatics: This simplifies scripting. Function definitions can
+be found using @samp{^function-name}.}
-In addition, there must be a space between a function or macro name and
-the opening parenthesis of its argument list (except for macro
-definitions, as required by C). There must not be a space after an open
-paren/bracket or before a close paren/bracket.
+There must be a space between a function or macro name and the opening
+parenthesis of its argument list (except for macro definitions, as
+required by C). There must not be a space after an open paren/bracket
+or before a close paren/bracket.
While additional whitespace is generally helpful for reading, do not use
more than one blank line to separate blocks, and avoid adding whitespace
-after the end of a program line (as of 1/99, some 600 lines had whitespace
-after the semicolon). Excess whitespace causes difficulties for diff and
-patch.
+after the end of a program line (as of 1/99, some 600 lines had
+whitespace after the semicolon). Excess whitespace causes difficulties
+for @code{diff} and @code{patch} utilities.
+
+Pointers are declared using the traditional K&R C style:
+
+@example
+void *foo;
+@end example
+
+@noindent
+and not:
+
+@example
+void * foo;
+void* foo;
+@end example
@subsection Comments
+@cindex comment formatting
The standard GNU requirements on comments must be followed strictly.
-Block comments must appear in the following form, with no `/*'- or
-'*/'-only lines, and no leading `*':
+Block comments must appear in the following form, with no @code{/*}- or
+@code{*/}-only lines, and no leading @code{*}:
-@example @code
+@example
/* Wait for control to return from inferior to debugger. If inferior
gets a signal, we may decide to start it up again instead of
returning. That is why there is a loop in this function. When
this function actually returns it means the inferior should be left
- stopped and GDB should read more commands. */
+ stopped and @value{GDBN} should read more commands. */
@end example
(Note that this format is encouraged by Emacs; tabbing for a multi-line
-comment works correctly, and M-Q fills the block consistently.)
+comment works correctly, and @kbd{M-q} fills the block consistently.)
Put a blank line between the block comments preceding function or
variable definitions, and the definition itself.
@@ -2256,64 +4456,130 @@ than will fit, and then somebody will have to move it anyhow.
@subsection C Usage
+@cindex C data types
Code must not depend on the sizes of C data types, the format of the
host's floating point numbers, the alignment of anything, or the order
of evaluation of expressions.
+@cindex function usage
Use functions freely. There are only a handful of compute-bound areas
-in GDB that might be affected by the overhead of a function call, mainly
-in symbol reading. Most of GDB's performance is limited by the target
-interface (whether serial line or system call).
+in @value{GDBN} that might be affected by the overhead of a function
+call, mainly in symbol reading. Most of @value{GDBN}'s performance is
+limited by the target interface (whether serial line or system call).
However, use functions with moderation. A thousand one-line functions
are just as hard to understand as a single thousand-line function.
+@emph{Macros are bad, M'kay.}
+(But if you have to use a macro, make sure that the macro arguments are
+protected with parentheses.)
+
+@cindex types
+
+Declarations like @samp{struct foo *} should be used in preference to
+declarations like @samp{typedef struct foo @{ @dots{} @} *foo_ptr}.
+
+
@subsection Function Prototypes
+@cindex function prototypes
-Prototypes must be used to @emph{declare} functions but never to
-@emph{define} them. Prototypes for GDB functions must include both the
+Prototypes must be used when both @emph{declaring} and @emph{defining}
+a function. Prototypes for @value{GDBN} functions must include both the
argument type and name, with the name matching that used in the actual
function definition.
-For the sake of compatibility with pre-ANSI compilers, define prototypes
-with the @code{PARAMS} macro:
+All external functions should have a declaration in a header file that
+callers include, except for @code{_initialize_*} functions, which must
+be external so that @file{init.c} construction works, but shouldn't be
+visible to random source files.
-@example @code
-extern int memory_remove_breakpoint PARAMS ((CORE_ADDR addr,
- char *contents_cache));
-@end example
+Where a source file needs a forward declaration of a static function,
+that declaration must appear in a block near the top of the source file.
-Note the double parentheses around the parameter types. This allows an
-arbitrary number of parameters to be described, without freaking out the
-C preprocessor. When the function has no parameters, it should be
-described like:
-@example @code
-extern void noprocess PARAMS ((void));
-@end example
+@subsection Internal Error Recovery
+
+During its execution, @value{GDBN} can encounter two types of errors.
+User errors and internal errors. User errors include not only a user
+entering an incorrect command but also problems arising from corrupt
+object files and system errors when interacting with the target.
+Internal errors include situtations where @value{GDBN} has detected, at
+run time, a corrupt or erroneous situtation.
+
+When reporting an internal error, @value{GDBN} uses
+@code{internal_error} and @code{gdb_assert}.
+
+@value{GDBN} must not call @code{abort} or @code{assert}.
+
+@emph{Pragmatics: There is no @code{internal_warning} function. Either
+the code detected a user error, recovered from it and issued a
+@code{warning} or the code failed to correctly recover from the user
+error and issued an @code{internal_error}.}
+
+@subsection File Names
+
+Any file used when building the core of @value{GDBN} must be in lower
+case. Any file used when building the core of @value{GDBN} must be 8.3
+unique. These requirements apply to both source and generated files.
+
+@emph{Pragmatics: The core of @value{GDBN} must be buildable on many
+platforms including DJGPP and MacOS/HFS. Every time an unfriendly file
+is introduced to the build process both @file{Makefile.in} and
+@file{configure.in} need to be modified accordingly. Compare the
+convoluted conversion process needed to transform @file{COPYING} into
+@file{copying.c} with the conversion needed to transform
+@file{version.in} into @file{version.c}.}
-The @code{PARAMS} macro expands to its argument in ANSI C, or to a
-simple @code{()} in traditional C.
+Any file non 8.3 compliant file (that is not used when building the core
+of @value{GDBN}) must be added to @file{gdb/config/djgpp/fnchange.lst}.
-All external functions should have a @code{PARAMS} declaration in a
-header file that callers include, except for @code{_initialize_*}
-functions, which must be external so that @file{init.c} construction
-works, but shouldn't be visible to random source files.
+@emph{Pragmatics: This is clearly a compromise.}
-All static functions must be declared in a block near the top of the
-source file.
+When @value{GDBN} has a local version of a system header file (ex
+@file{string.h}) the file name based on the POSIX header prefixed with
+@file{gdb_} (@file{gdb_string.h}).
-@subsection Clean Design
+For other files @samp{-} is used as the separator.
+
+@subsection Include Files
+
+All @file{.c} files should include @file{defs.h} first.
+
+All @file{.c} files should explicitly include the headers for any
+declarations they refer to. They should not rely on files being
+included indirectly.
+
+With the exception of the global definitions supplied by @file{defs.h},
+a header file should explictily include the header declaring any
+@code{typedefs} et.al.@: it refers to.
+
+@code{extern} declarations should never appear in @code{.c} files.
+
+All include files should be wrapped in:
+
+@example
+#ifndef INCLUDE_FILE_NAME_H
+#define INCLUDE_FILE_NAME_H
+header body
+#endif
+@end example
+
+
+@subsection Clean Design and Portable Implementation
+
+@cindex design
In addition to getting the syntax right, there's the little question of
-semantics. Some things are done in certain ways in GDB because long
+semantics. Some things are done in certain ways in @value{GDBN} because long
experience has shown that the more obvious ways caused various kinds of
trouble.
+@cindex assumptions about targets
You can't assume the byte order of anything that comes from a target
(including @var{value}s, object files, and instructions). Such things
-must be byte-swapped using @code{SWAP_TARGET_AND_HOST} in GDB, or one of
-the swap routines defined in @file{bfd.h}, such as @code{bfd_get_32}.
+must be byte-swapped using @code{SWAP_TARGET_AND_HOST} in
+@value{GDBN}, or one of the swap routines defined in @file{bfd.h},
+such as @code{bfd_get_32}.
You can't assume that you know what interface is being used to talk to
the target system. All references to the target must go through the
@@ -2326,10 +4592,12 @@ host machine. Target code must bring along its own header files --
written from scratch or explicitly donated by their owner, to avoid
copyright problems.
+@cindex portability
Insertion of new @code{#ifdef}'s will be frowned upon. It's much better
to write the code portably than to conditionalize it for various
systems.
+@cindex system dependencies
New @code{#ifdef}'s which test for specific compilers or manufacturers
or operating systems are unacceptable. All @code{#ifdef}'s should test
for features. The information about which configurations contain which
@@ -2341,84 +4609,113 @@ time, as new versions of your system come out that behave differently
with regard to this feature.
Adding code that handles specific architectures, operating systems,
-target interfaces, or hosts, is not acceptable in generic code. If a
-hook is needed at that point, invent a generic hook and define it for
-your configuration, with something like:
-
-@example
-#ifdef WRANGLE_SIGNALS
- WRANGLE_SIGNALS (signo);
-#endif
-@end example
-
-In your host, target, or native configuration file, as appropriate,
-define @code{WRANGLE_SIGNALS} to do the machine-dependent thing. Take a
-bit of care in defining the hook, so that it can be used by other ports
-in the future, if they need a hook in the same place.
+target interfaces, or hosts, is not acceptable in generic code.
+
+@cindex portable file name handling
+@cindex file names, portability
+One particularly notorious area where system dependencies tend to
+creep in is handling of file names. The mainline @value{GDBN} code
+assumes Posix semantics of file names: absolute file names begin with
+a forward slash @file{/}, slashes are used to separate leading
+directories, case-sensitive file names. These assumptions are not
+necessarily true on non-Posix systems such as MS-Windows. To avoid
+system-dependent code where you need to take apart or construct a file
+name, use the following portable macros:
-If the hook is not defined, the code should do whatever "most" machines
-want. Using @code{#ifdef}, as above, is the preferred way to do this,
-but sometimes that gets convoluted, in which case use
-
-@example
-#ifndef SPECIAL_FOO_HANDLING
-#define SPECIAL_FOO_HANDLING(pc, sp) (0)
-#endif
-@end example
+@table @code
+@findex HAVE_DOS_BASED_FILE_SYSTEM
+@item HAVE_DOS_BASED_FILE_SYSTEM
+This preprocessing symbol is defined to a non-zero value on hosts
+whose filesystems belong to the MS-DOS/MS-Windows family. Use this
+symbol to write conditional code which should only be compiled for
+such hosts.
+
+@findex IS_DIR_SEPARATOR
+@item IS_DIR_SEPARATOR (@var{c})
+Evaluates to a non-zero value if @var{c} is a directory separator
+character. On Unix and GNU/Linux systems, only a slash @file{/} is
+such a character, but on Windows, both @file{/} and @file{\} will
+pass.
+
+@findex IS_ABSOLUTE_PATH
+@item IS_ABSOLUTE_PATH (@var{file})
+Evaluates to a non-zero value if @var{file} is an absolute file name.
+For Unix and GNU/Linux hosts, a name which begins with a slash
+@file{/} is absolute. On DOS and Windows, @file{d:/foo} and
+@file{x:\bar} are also absolute file names.
+
+@findex FILENAME_CMP
+@item FILENAME_CMP (@var{f1}, @var{f2})
+Calls a function which compares file names @var{f1} and @var{f2} as
+appropriate for the underlying host filesystem. For Posix systems,
+this simply calls @code{strcmp}; on case-insensitive filesystems it
+will call @code{strcasecmp} instead.
+
+@findex DIRNAME_SEPARATOR
+@item DIRNAME_SEPARATOR
+Evaluates to a character which separates directories in
+@code{PATH}-style lists, typically held in environment variables.
+This character is @samp{:} on Unix, @samp{;} on DOS and Windows.
+
+@findex SLASH_STRING
+@item SLASH_STRING
+This evaluates to a constant string you should use to produce an
+absolute filename from leading directories and the file's basename.
+@code{SLASH_STRING} is @code{"/"} on most systems, but might be
+@code{"\\"} for some Windows-based ports.
+@end table
-where the macro is used or in an appropriate header file.
-
-Whether to include a @dfn{small} hook, a hook around the exact pieces of
-code which are system-dependent, or whether to replace a whole function
-with a hook depends on the case. A good example of this dilemma can be
-found in @code{get_saved_register}. All machines that GDB 2.8 ran on
-just needed the @code{FRAME_FIND_SAVED_REGS} hook to find the saved
-registers. Then the SPARC and Pyramid came along, and
-@code{HAVE_REGISTER_WINDOWS} and @code{REGISTER_IN_WINDOW_P} were
-introduced. Then the 29k and 88k required the @code{GET_SAVED_REGISTER}
-hook. The first three are examples of small hooks; the latter replaces
-a whole function. In this specific case, it is useful to have both
-kinds; it would be a bad idea to replace all the uses of the small hooks
-with @code{GET_SAVED_REGISTER}, since that would result in much
-duplicated code. Other times, duplicating a few lines of code here or
-there is much cleaner than introducing a large number of small hooks.
-
-Another way to generalize GDB along a particular interface is with an
-attribute struct. For example, GDB has been generalized to handle
-multiple kinds of remote interfaces -- not by #ifdef's everywhere, but
-by defining the "target_ops" structure and having a current target (as
+In addition to using these macros, be sure to use portable library
+functions whenever possible. For example, to extract a directory or a
+basename part from a file name, use the @code{dirname} and
+@code{basename} library functions (available in @code{libiberty} for
+platforms which don't provide them), instead of searching for a slash
+with @code{strrchr}.
+
+Another way to generalize @value{GDBN} along a particular interface is with an
+attribute struct. For example, @value{GDBN} has been generalized to handle
+multiple kinds of remote interfaces---not by @code{#ifdef}s everywhere, but
+by defining the @code{target_ops} structure and having a current target (as
well as a stack of targets below it, for memory references). Whenever
something needs to be done that depends on which remote interface we are
-using, a flag in the current target_ops structure is tested (e.g.
-`target_has_stack'), or a function is called through a pointer in the
+using, a flag in the current target_ops structure is tested (e.g.,
+@code{target_has_stack}), or a function is called through a pointer in the
current target_ops structure. In this way, when a new remote interface
-is added, only one module needs to be touched -- the one that actually
+is added, only one module needs to be touched---the one that actually
implements the new remote interface. Other examples of
attribute-structs are BFD access to multiple kinds of object file
-formats, or GDB's access to multiple source languages.
+formats, or @value{GDBN}'s access to multiple source languages.
+
+Please avoid duplicating code. For example, in @value{GDBN} 3.x all
+the code interfacing between @code{ptrace} and the rest of
+@value{GDBN} was duplicated in @file{*-dep.c}, and so changing
+something was very painful. In @value{GDBN} 4.x, these have all been
+consolidated into @file{infptrace.c}. @file{infptrace.c} can deal
+with variations between systems the same way any system-independent
+file would (hooks, @code{#if defined}, etc.), and machines which are
+radically different don't need to use @file{infptrace.c} at all.
-Please avoid duplicating code. For example, in GDB 3.x all the code
-interfacing between @code{ptrace} and the rest of GDB was duplicated in
-@file{*-dep.c}, and so changing something was very painful. In GDB 4.x,
-these have all been consolidated into @file{infptrace.c}.
-@file{infptrace.c} can deal with variations between systems the same way
-any system-independent file would (hooks, #if defined, etc.), and
-machines which are radically different don't need to use infptrace.c at
-all.
+All debugging code must be controllable using the @samp{set debug
+@var{module}} command. Do not use @code{printf} to print trace
+messages. Use @code{fprintf_unfiltered(gdb_stdlog, ...}. Do not use
+@code{#ifdef DEBUG}.
@node Porting GDB
-@chapter Porting GDB
+@chapter Porting @value{GDBN}
+@cindex porting to new machines
-Most of the work in making GDB compile on a new machine is in specifying
-the configuration of the machine. This is done in a dizzying variety of
-header files and configuration scripts, which we hope to make more
-sensible soon. Let's say your new host is called an @var{xyz} (e.g.
-@samp{sun4}), and its full three-part configuration name is
-@code{@var{arch}-@var{xvend}-@var{xos}} (e.g. @samp{sparc-sun-sunos4}).
-In particular:
+Most of the work in making @value{GDBN} compile on a new machine is in
+specifying the configuration of the machine. This is done in a
+dizzying variety of header files and configuration scripts, which we
+hope to make more sensible soon. Let's say your new host is called an
+@var{xyz} (e.g., @samp{sun4}), and its full three-part configuration
+name is @code{@var{arch}-@var{xvend}-@var{xos}} (e.g.,
+@samp{sparc-sun-sunos4}). In particular:
+@itemize @bullet
+@item
In the top level directory, edit @file{config.sub} and add @var{arch},
@var{xvend}, and @var{xos} to the lists of supported architectures,
vendors, and operating systems near the bottom of the file. Also, add
@@ -2429,49 +4726,79 @@ running
@example
./config.sub @var{xyz}
@end example
+
@noindent
and
+
@example
./config.sub @code{@var{arch}-@var{xvend}-@var{xos}}
@end example
+
@noindent
which should both respond with @code{@var{arch}-@var{xvend}-@var{xos}}
and no error messages.
+@noindent
You need to port BFD, if that hasn't been done already. Porting BFD is
beyond the scope of this manual.
-To configure GDB itself, edit @file{gdb/configure.host} to recognize
+@item
+To configure @value{GDBN} itself, edit @file{gdb/configure.host} to recognize
your system and set @code{gdb_host} to @var{xyz}, and (unless your
desired target is already available) also edit @file{gdb/configure.tgt},
setting @code{gdb_target} to something appropriate (for instance,
@var{xyz}).
-Finally, you'll need to specify and define GDB's host-, native-, and
+@emph{Maintainer's note: Work in progress. The file
+@file{gdb/configure.host} originally needed to be modified when either a
+new native target or a new host machine was being added to @value{GDBN}.
+Recent changes have removed this requirement. The file now only needs
+to be modified when adding a new native configuration. This will likely
+changed again in the future.}
+
+@item
+Finally, you'll need to specify and define @value{GDBN}'s host-, native-, and
target-dependent @file{.h} and @file{.c} files used for your
configuration.
+@end itemize
-@section Configuring GDB for Release
+@section Configuring @value{GDBN} for Release
+@cindex preparing a release
+@cindex making a distribution tarball
From the top level directory (containing @file{gdb}, @file{bfd},
@file{libiberty}, and so on):
+
@example
make -f Makefile.in gdb.tar.gz
@end example
+@noindent
This will properly configure, clean, rebuild any files that are
distributed pre-built (e.g. @file{c-exp.tab.c} or @file{refcard.ps}),
and will then make a tarfile. (If the top level directory has already
been configured, you can just do @code{make gdb.tar.gz} instead.)
This procedure requires:
+
@itemize @bullet
-@item symbolic links
-@item @code{makeinfo} (texinfo2 level)
-@item @TeX{}
-@item @code{dvips}
-@item @code{yacc} or @code{bison}
+
+@item
+symbolic links;
+
+@item
+@code{makeinfo} (texinfo2 level);
+
+@item
+@TeX{};
+
+@item
+@code{dvips};
+
+@item
+@code{yacc} or @code{bison}.
@end itemize
+
@noindent
@dots{} and the usual slew of utilities (@code{sed}, @code{tar}, etc.).
@@ -2490,6 +4817,598 @@ files @file{gdb.info*} in the distribution. Note the plural;
@code{makeinfo} will split the document into one overall file and five
or so included files.
+@node Releasing GDB
+
+@chapter Releasing @value{GDBN}
+@cindex making a new release of gdb
+
+@section Obsolete any code
+
+Before anything else, poke the other developers (and around the source
+code) to see if there is anything that can be removed from @value{GDBN}
+(an old target, an unused file).
+
+Obsolete code is identified by adding an @code{OBSOLETE} prefix to every
+line. Doing this means that it is easy to identify obsolete code when
+grepping through the sources.
+
+The process has a number of steps and is intentionally slow --- this is
+to mainly ensure that people have had a reasonable chance to respond.
+Remember, everything on the internet takes a week.
+
+@itemize @bullet
+@item
+announce the change on @email{gdb@@sources.redhat.com, GDB mailing list}
+@item
+wait a week or so
+@item
+announce the change on @email{gdb-announce@@sources.redhat.com, GDB
+Announcement mailing list}
+@item
+wait a week or so
+@item
+go through and edit all relevant files and lines (e.g., in
+@file{configure.tgt}) so that they are prefixed with the word
+@code{OBSOLETE}.
+@end itemize
+
+@emph{Maintainer note: Removing old code, while regrettable, is a good
+thing. Firstly it helps the developers by removing code that is either
+no longer relevant or simply wrong. Secondly since it removes any
+history associated with the file (effectively clearing the slate) the
+developer has a much freer hand when it comes to fixing broken files.}
+
+@section Before the branch
+
+The most important objective at this stage is to find and fix simple
+changes that become a pain to track once the branch is created. For
+instance, configuration problems that stop @value{GDBN} from even
+building. If you can't get the problem fixed, document it in the
+@file{gdb/PROBLEMS} file.
+
+@subheading Organize and announce the schedule.
+
+The following is a possible schedule. It is based on the rule-of-thumb
+that everything on the Internet takes a week. You may want to even
+increase those times further since an analysis of the actual data
+strongly suggests that the below is far to aggressive.
+
+@itemize @bullet
+@item
+announce it
+@item
+wait a week
+@item
+announce branch date
+@item
+wait a week
+@item
+Cut the branch
+@item
+wait a week
+@item
+start enjoying all the fun
+@end itemize
+
+As an aside, the branch tag name is probably regrettable vis:
+@example
+gdb_N_M-YYYY-MM-DD-@{branch,branchpoint@}
+@end example
+
+@subheading Refresh any imported files.
+
+A number of files are taken from external repositories. They include:
+
+@itemize @bullet
+@item
+@file{texinfo/texinfo.tex}
+@item
+@file{config.guess} et.@: al.@:
+@end itemize
+
+and should be refreshed.
+
+@subheading Prompt for @file{gdb/NEWS}
+
+People always forget. Send a post reminding them but also if you know
+something interesting happened add it your self.
+
+@subheading Review @file{gdb/README}
+
+Grab one of the nightly snapshots and then walk through the
+@file{gdb/README} looking for anything that can be improved.
+
+@subheading Check the ARI
+
+ARI is an @code{awk} script (Awk Regression Indicator?) that checks for a
+number of errors and coding conventions. The checks include things like
+using @code{malloc} instead of @code{xmalloc} and file naming problems.
+There shouldn't be any regressions.
+
+@section Cut the branch
+
+@subheading The dirty work
+
+I think something like the below was used:
+
+@example
+$ d=`date -u +%Y-%m-%d`
+$ echo $d
+2002-01-24
+$ cvs -f -d /cvs/src rtag -D $d-gmt \
+gdb_5_1-$d-branchpoint insight+dejagnu
+$ cvs -f -d /cvs/src rtag -b -r gdb_V_V-$d-branchpoint \
+gdb_5_1-$d-branch insight+dejagnu
+$
+@end example
+
+@itemize @bullet
+@item
+the @kbd{-D YYYY-MM-DD-gmt} forces the branch to an exact date/time.
+@item
+the trunk is first taged so that the branch point can easily be found
+@item
+Insight (which includes GDB) and dejagnu are tagged at the same time
+@end itemize
+
+@subheading Post the branch info
+
+@subheading Update the web and news pages
+
+@subheading Tweak cron to track the new branch
+
+@section Stabilize the branch
+
+Something goes here.
+
+@section Create a Release
+
+This procedure can be followed when creating beta and final final
+releases. With a beta many of the steps can be skipped.
+
+@subheading Establish a few defaults.
+
+@example
+$ b=gdb_5_1-2001-07-29-branch
+$ v=5.1.1
+$ t=/sourceware/snapshot-tmp/gdbadmin-tmp
+$ echo $t/$b/$v
+$ mkdir -p $t/$b/$v
+$ cd $t/$b/$v
+$ pwd
+/sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_1-2001-07-29-branch/5.1.1
+$ which autoconf
+/home/gdbadmin/bin/autoconf
+$
+@end example
+
+NB: Check the autoconf version carefully. You want to be using the
+version taken from the binutils snapshot directory. It is most likely
+that your system's installed version (@file{/usr/bin}?) is probably
+correct.
+
+@subheading Check out the relevant modules:
+
+@example
+$ for m in gdb insight dejagnu
+do
+( mkdir -p $m && cd $m && cvs -q -f -d /cvs/src co -P -r $b $m )
+done
+$
+@end example
+
+NB: The reading of @file{.cvsrc} is disabled (@file{-f}) so that there
+isn't any confusion between what is written here and what your local CVS
+really does.
+
+@subheading Update relevant files.
+
+@subsubheading @file{gdb/NEWS}
+
+Major releases get their comments added as part of the mainline. Minor
+releases should probably mention any significant bugs that were fixed.
+
+Don't forget to update the ChangeLog.
+
+@example
+$ emacs gdb/src/gdb/NEWS
+...
+c-x 4 a
+...
+c-x c-s c-x c-c
+$ cp gdb/src/gdb/NEWS insight/src/gdb/NEWS
+$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
+@end example
+
+@subsubheading @file{gdb/README}
+
+You'll need to update: the version, the update date, and who did it.
+
+@example
+$ emacs gdb/src/gdb/README
+...
+c-x 4 a
+...
+c-x c-s c-x c-c
+$ cp gdb/src/gdb/README insight/src/gdb/README
+$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
+@end example
+
+@emph{Maintainer note: Hopefully the README file was reviewed before the
+initial branch was cut so just a simple substitute is needed to get it
+updated.}
+
+@emph{Maintainer note: Other projects generate @file{README} and
+@file{INSTALL} from the core documentation. This might be worth
+pursuing.}
+
+@subsubheading @file{gdb/version.in}
+
+@example
+$ echo $v > gdb/src/gdb/version.in
+$ emacs gdb/src/gdb/version.in
+...
+c-x 4 a
+...
+c-x c-s c-x c-c
+$ cp gdb/src/gdb/version.in insight/src/gdb/version.in
+$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
+@end example
+
+@subsubheading @file{dejagnu/src/dejagnu/configure.in}
+
+Dejagnu is more complicated. The version number is a parameter to
+@var{AM_INIT_AUTOMAKE}. Tweak it to read something like
+@var{gdb-5.1.1}.
+
+Re-generate configure.
+
+Add a ChangeLog.
+
+@subheading Do the dirty work
+
+This is identical to the process used when creating the daily snapshot.
+
+@example
+$ for m in gdb insight dejagnu
+do
+( cd $m/src && gmake -f Makefile.in $m.tar.bz2 )
+done
+@end example
+
+@subheading Check the source files
+
+You're looking for files that have mysteriously disappeared as the
+@kbd{distclean} has the habit of deleting files it shouldn't. Watch out
+for the @file{version.in} update @kbd{cronjob}.
+
+@example
+$ ( cd gdb/src && cvs -f -q -n update )
+M djunpack.bat
+? proto-toplev
+? gdb-5.1.1.tar.bz2
+M gdb/ChangeLog
+M gdb/NEWS
+M gdb/README
+M gdb/version.in
+? gdb/p-exp.tab.c
+? gdb/doc/gdb.info-11
+? gdb/doc/gdb.info-12
+? gdb/doc/gdb.info-13
+? gdb/doc/gdb.info-14
+? gdb/doc/gdb.info-15
+? gdb/doc/gdbint.info-4
+? gdb/doc/gdbint.info-5
+$
+@end example
+
+@emph{Don't worry about the @file{gdb.info-??} or
+@file{gdb/p-exp.tab.c}. They were generated (and yes @file{gdb.info-1}
+was also generated only something strange with CVS means that they
+didn't get supressed). Fixing it would be nice though.}
+
+@subheading Re-pack the release with @code{gzip}
+
+@example
+$ cp */*/*.bz2 .
+$ bunzip2 -k -v *.bz2
+$ gzip -9 -v *.tar
+@end example
+
+NB: A pipe such as @kbd{bunzip2 < xxx.bz2 | gzip -9 > xxx.gz} shouldn't
+be used since, in that mode, gzip doesn't know the file name information
+and consequently can't include it. This is also why the release process
+runs @code{tar} and @code{bzip2} as separate passes.
+
+@emph{Maintainer note: The release process could be changed to create
+@file{.tar} rather than @file{.tar.bz2} files.}
+
+@section Check the release
+
+Grab the @file{gdb.tar.bz2}, copy it to your local machine and then try
+a simple build using it.
+
+If this is a pre-release just copy the @file{.bz2} files to the snapshot
+directory and skip the remaining steps.
+
+If it is a final release, also make it available under a bogus name so
+that others can download and check it.
+
+@emph{Maintainer note: This adds an extra day to the release process but
+is very much worth it. Other developers are given the oportunity to
+check that things like your @file{NEWS} entries are correct or that
+other changes actually work.}
+
+@section Release the tar ball
+
+This is where, unfortunatly, the notes just get vague.
+
+@subheading Install on sware
+
+@example
+$ cp *.bz2 *.gz ~ftp/pub/gdb/releases
+@end example
+
+@subheading Create and update the web pages.
+
+Try the following:
+
+@itemize @bullet
+@item
+create the directory @file{htdocs/@var{version}} (e.g., @file{htdocs/5.1.1}
+@item
+copy @file{index.html} and @file{ANNOUNCE} from the previous release
+into the @file{htdocs/@var{version}} directory and edit for content.
+Things like the MD5 sums, @kbd{ls -l} output, the version number and so
+on will need updating. Add NEWS entries to the @file{ANNOUNCE}. This
+ensures that the previous announcement is kept somewhere handy.
+@item
+copy the @file{NEWS} from the distro into the
+@file{htdocs/@var{version}} directory, trim down to just the most recent
+news items
+@item
+Add a short (identical) announcement to both @file{htdocs/index.html}
+and @file{htdocs/news/index.html}
+@item
+edit the script @file{htdocs/index.sh} to link in the new release
+number. Run it across all @file{index.html} files vis @kbd{./index.sh
+index.html */index.html}.
+@item
+grep the @file{htdocs} tree for references to the previous release
+version (@file{htdocs/download/index.html})
+@end itemize
+
+@emph{Maintainer note: This step is too fragile --- it is too easy to
+mis one of the entries and forget to update it.}
+
+@subheading Generate online docs
+
+You need to find the magic command that is used to generate the online
+docs from the @file{.tar.bz2}. The best way is to look in the output
+from one of the nightly cronjobs and then just edit accordingly.
+Something like:
+
+@example
+$ ~/ss/update-web-docs \
+ ~ftp/pub/gdb/releases/gdb-5.1.1.tar.bz2 \
+ $PWD/www \
+ /www/sourceware/htdocs/gdb/5.1.1/onlinedocs \
+ gdb
+@end example
+
+@subheading Something about @file{ANNOUNCEMENT}
+
+Send the @file{ANNOUNCEMENT} file you created above to:
+
+@itemize @bullet
+@item
+@email{gdb-announce@@sources.redhat.com, GDB Announcement mailing list}
+@item
+The gnu announce list (but delay it a day or so to let things get out).
+@end itemize
+
+@subheading Install it on GNU
+
+At the time of writing, the GNU machine was @kbd{gnudist.gnu.org} in
+@file{~ftp/gnu/gdb} (I think, I'm still waiting for it to copy into my
+home directory).
+
+@section Cleanup
+
+@subheading Commit outstanding changes
+
+In particular you'll need to commit the changes to:
+
+@itemize @bullet
+@item
+@file{gdb/ChangeLog}
+@item
+@file{gdb/version.in}
+@item
+@file{gdb/NEWS}
+@item
+@file{gdb/README}
+@end itemize
+
+@subheading Tag the release
+
+Something like:
+
+@example
+$ d=`date -u +%Y-%m-%d`
+$ echo $d
+2002-01-24
+$ ( cd insight/src/gdb && cvs -f -q update )
+$ ( cd insight/src && cvs -f -q tag gdb_5_1_1-$d-release )
+@end example
+
+Insight is used since that contains more of the release than GDB (yes
+dejagnu doesn't get tagged but I think we can live with that.).
+
+@subheading Restart @file{gdb/version.in}
+
+If @file{gdb/version.in} does not contain an ISO date such as
+@kbd{2002-01-24} then the daily @code{cronjob} won't update it. Having
+committed all the release changes it can be set to
+@file{5.1.0_0000-00-00-cvs} which will restart things (yes the @kbd{_}
+is important - it affects the snapshot process).
+
+Don't forget the @file{ChangeLog}.
+
+@subheading Merge into trunk
+
+The files committed to the branch may also need changes merged into the
+trunk.
+
+@section Post release
+
+Remove any @code{OBSOLETE} code.
+
+@node Testsuite
+
+@chapter Testsuite
+@cindex test suite
+
+The testsuite is an important component of the @value{GDBN} package.
+While it is always worthwhile to encourage user testing, in practice
+this is rarely sufficient; users typically use only a small subset of
+the available commands, and it has proven all too common for a change
+to cause a significant regression that went unnoticed for some time.
+
+The @value{GDBN} testsuite uses the DejaGNU testing framework.
+DejaGNU is built using @code{Tcl} and @code{expect}. The tests
+themselves are calls to various @code{Tcl} procs; the framework runs all the
+procs and summarizes the passes and fails.
+
+@section Using the Testsuite
+
+@cindex running the test suite
+To run the testsuite, simply go to the @value{GDBN} object directory (or to the
+testsuite's objdir) and type @code{make check}. This just sets up some
+environment variables and invokes DejaGNU's @code{runtest} script. While
+the testsuite is running, you'll get mentions of which test file is in use,
+and a mention of any unexpected passes or fails. When the testsuite is
+finished, you'll get a summary that looks like this:
+
+@example
+ === gdb Summary ===
+
+# of expected passes 6016
+# of unexpected failures 58
+# of unexpected successes 5
+# of expected failures 183
+# of unresolved testcases 3
+# of untested testcases 5
+@end example
+
+The ideal test run consists of expected passes only; however, reality
+conspires to keep us from this ideal. Unexpected failures indicate
+real problems, whether in @value{GDBN} or in the testsuite. Expected
+failures are still failures, but ones which have been decided are too
+hard to deal with at the time; for instance, a test case might work
+everywhere except on AIX, and there is no prospect of the AIX case
+being fixed in the near future. Expected failures should not be added
+lightly, since you may be masking serious bugs in @value{GDBN}.
+Unexpected successes are expected fails that are passing for some
+reason, while unresolved and untested cases often indicate some minor
+catastrophe, such as the compiler being unable to deal with a test
+program.
+
+When making any significant change to @value{GDBN}, you should run the
+testsuite before and after the change, to confirm that there are no
+regressions. Note that truly complete testing would require that you
+run the testsuite with all supported configurations and a variety of
+compilers; however this is more than really necessary. In many cases
+testing with a single configuration is sufficient. Other useful
+options are to test one big-endian (Sparc) and one little-endian (x86)
+host, a cross config with a builtin simulator (powerpc-eabi,
+mips-elf), or a 64-bit host (Alpha).
+
+If you add new functionality to @value{GDBN}, please consider adding
+tests for it as well; this way future @value{GDBN} hackers can detect
+and fix their changes that break the functionality you added.
+Similarly, if you fix a bug that was not previously reported as a test
+failure, please add a test case for it. Some cases are extremely
+difficult to test, such as code that handles host OS failures or bugs
+in particular versions of compilers, and it's OK not to try to write
+tests for all of those.
+
+@section Testsuite Organization
+
+@cindex test suite organization
+The testsuite is entirely contained in @file{gdb/testsuite}. While the
+testsuite includes some makefiles and configury, these are very minimal,
+and used for little besides cleaning up, since the tests themselves
+handle the compilation of the programs that @value{GDBN} will run. The file
+@file{testsuite/lib/gdb.exp} contains common utility procs useful for
+all @value{GDBN} tests, while the directory @file{testsuite/config} contains
+configuration-specific files, typically used for special-purpose
+definitions of procs like @code{gdb_load} and @code{gdb_start}.
+
+The tests themselves are to be found in @file{testsuite/gdb.*} and
+subdirectories of those. The names of the test files must always end
+with @file{.exp}. DejaGNU collects the test files by wildcarding
+in the test directories, so both subdirectories and individual files
+get chosen and run in alphabetical order.
+
+The following table lists the main types of subdirectories and what they
+are for. Since DejaGNU finds test files no matter where they are
+located, and since each test file sets up its own compilation and
+execution environment, this organization is simply for convenience and
+intelligibility.
+
+@table @file
+@item gdb.base
+This is the base testsuite. The tests in it should apply to all
+configurations of @value{GDBN} (but generic native-only tests may live here).
+The test programs should be in the subset of C that is valid K&R,
+ANSI/ISO, and C++ (@code{#ifdef}s are allowed if necessary, for instance
+for prototypes).
+
+@item gdb.@var{lang}
+Language-specific tests for any language @var{lang} besides C. Examples are
+@file{gdb.c++} and @file{gdb.java}.
+
+@item gdb.@var{platform}
+Non-portable tests. The tests are specific to a specific configuration
+(host or target), such as HP-UX or eCos. Example is @file{gdb.hp}, for
+HP-UX.
+
+@item gdb.@var{compiler}
+Tests specific to a particular compiler. As of this writing (June
+1999), there aren't currently any groups of tests in this category that
+couldn't just as sensibly be made platform-specific, but one could
+imagine a @file{gdb.gcc}, for tests of @value{GDBN}'s handling of GCC
+extensions.
+
+@item gdb.@var{subsystem}
+Tests that exercise a specific @value{GDBN} subsystem in more depth. For
+instance, @file{gdb.disasm} exercises various disassemblers, while
+@file{gdb.stabs} tests pathways through the stabs symbol reader.
+@end table
+
+@section Writing Tests
+@cindex writing tests
+
+In many areas, the @value{GDBN} tests are already quite comprehensive; you
+should be able to copy existing tests to handle new cases.
+
+You should try to use @code{gdb_test} whenever possible, since it
+includes cases to handle all the unexpected errors that might happen.
+However, it doesn't cost anything to add new test procedures; for
+instance, @file{gdb.base/exprs.exp} defines a @code{test_expr} that
+calls @code{gdb_test} multiple times.
+
+Only use @code{send_gdb} and @code{gdb_expect} when absolutely
+necessary, such as when @value{GDBN} has several valid responses to a command.
+
+The source language programs do @emph{not} need to be in a consistent
+style. Since @value{GDBN} is used to debug programs written in many different
+styles, it's worth having a mix of styles in the testsuite; for
+instance, some @value{GDBN} bugs involving the display of source lines would
+never manifest themselves if the programs used GNU coding style
+uniformly.
+
@node Hints
@chapter Hints
@@ -2498,25 +5417,25 @@ Check the @file{README} file, it often has useful information that does not
appear anywhere else in the directory.
@menu
-* Getting Started:: Getting started working on GDB
-* Debugging GDB:: Debugging GDB with itself
+* Getting Started:: Getting started working on @value{GDBN}
+* Debugging GDB:: Debugging @value{GDBN} with itself
@end menu
@node Getting Started,,, Hints
@section Getting Started
-GDB is a large and complicated program, and if you first starting to
+@value{GDBN} is a large and complicated program, and if you first starting to
work on it, it can be hard to know where to start. Fortunately, if you
know how to go about it, there are ways to figure out what is going on.
-This manual, the GDB Internals manual, has information which applies
-generally to many parts of GDB.
+This manual, the @value{GDBN} Internals manual, has information which applies
+generally to many parts of @value{GDBN}.
Information about particular functions or data structures are located in
comments with those functions or data structures. If you run across a
function or a global variable which does not have a comment correctly
-explaining what is does, this can be thought of as a bug in GDB; feel
+explaining what is does, this can be thought of as a bug in @value{GDBN}; feel
free to submit a bug report, with a suggested comment if you can figure
out what the comment should say. If you find a comment which is
actually wrong, be especially sure to report that.
@@ -2531,20 +5450,20 @@ also documents all the available macros.
@c Conditionals}, @pxref{Native Conditionals}, and @pxref{Obsolete
@c Conditionals})
-Start with the header files. Once you some idea of how GDB's internal
-symbol tables are stored (see @file{symtab.h}, @file{gdbtypes.h}), you
-will find it much easier to understand the code which uses and creates
-those symbol tables.
+Start with the header files. Once you have some idea of how
+@value{GDBN}'s internal symbol tables are stored (see @file{symtab.h},
+@file{gdbtypes.h}), you will find it much easier to understand the
+code which uses and creates those symbol tables.
You may wish to process the information you are getting somehow, to
enhance your understanding of it. Summarize it, translate it to another
-language, add some (perhaps trivial or non-useful) feature to GDB, use
+language, add some (perhaps trivial or non-useful) feature to @value{GDBN}, use
the code to predict what a test case would do and write the test case
and verify your prediction, etc. If you are reading code and your eyes
are starting to glaze over, this is a sign you need to use a more active
approach.
-Once you have a part of GDB to start with, you can find more
+Once you have a part of @value{GDBN} to start with, you can find more
specifically the part you are looking for by stepping through each
function with the @code{next} command. Do not use @code{step} or you
will quickly get distracted; when the function you are stepping through
@@ -2563,40 +5482,44 @@ principle applies---when the code you are looking at calls something
else, just try to understand generally what the code being called does,
rather than worrying about all its details.
-A good place to start when tracking down some particular area is with a
-command which invokes that feature. Suppose you want to know how
-single-stepping works. As a GDB user, you know that the @code{step}
-command invokes single-stepping. The command is invoked via command
-tables (see @file{command.h}); by convention the function which actually
-performs the command is formed by taking the name of the command and
-adding @samp{_command}, or in the case of an @code{info} subcommand,
-@samp{_info}. For example, the @code{step} command invokes the
-@code{step_command} function and the @code{info display} command invokes
-@code{display_info}. When this convention is not followed, you might
-have to use @code{grep} or @kbd{M-x tags-search} in emacs, or run GDB on
-itself and set a breakpoint in @code{execute_command}.
-
+@cindex command implementation
+A good place to start when tracking down some particular area is with
+a command which invokes that feature. Suppose you want to know how
+single-stepping works. As a @value{GDBN} user, you know that the
+@code{step} command invokes single-stepping. The command is invoked
+via command tables (see @file{command.h}); by convention the function
+which actually performs the command is formed by taking the name of
+the command and adding @samp{_command}, or in the case of an
+@code{info} subcommand, @samp{_info}. For example, the @code{step}
+command invokes the @code{step_command} function and the @code{info
+display} command invokes @code{display_info}. When this convention is
+not followed, you might have to use @code{grep} or @kbd{M-x
+tags-search} in emacs, or run @value{GDBN} on itself and set a
+breakpoint in @code{execute_command}.
+
+@cindex @code{bug-gdb} mailing list
If all of the above fail, it may be appropriate to ask for information
on @code{bug-gdb}. But @emph{never} post a generic question like ``I was
wondering if anyone could give me some tips about understanding
-GDB''---if we had some magic secret we would put it in this manual.
+@value{GDBN}''---if we had some magic secret we would put it in this manual.
Suggestions for improving the manual are always welcome, of course.
@node Debugging GDB,,,Hints
-@section Debugging GDB with itself
+@section Debugging @value{GDBN} with itself
+@cindex debugging @value{GDBN}
-If GDB is limping on your machine, this is the preferred way to get it
+If @value{GDBN} is limping on your machine, this is the preferred way to get it
fully functional. Be warned that in some ancient Unix systems, like
Ultrix 4.2, a program can't be running in one process while it is being
-debugged in another. Rather than typing the command @code{@w{./gdb
+debugged in another. Rather than typing the command @kbd{@w{./gdb
./gdb}}, which works on Suns and such, you can copy @file{gdb} to
-@file{gdb2} and then type @code{@w{./gdb ./gdb2}}.
+@file{gdb2} and then type @kbd{@w{./gdb ./gdb2}}.
-When you run GDB in the GDB source directory, it will read a
+When you run @value{GDBN} in the @value{GDBN} source directory, it will read a
@file{.gdbinit} file that sets up some simple things to make debugging
gdb easier. The @code{info} command, when executed without a subcommand
-in a GDB being debugged by gdb, will pop you back up to the top level
+in a @value{GDBN} being debugged by gdb, will pop you back up to the top level
gdb. See @file{.gdbinit} for details.
If you use emacs, you will probably want to do a @code{make TAGS} after
@@ -2604,92 +5527,90 @@ you configure your distribution; this will put the machine dependent
routines for your local machine where they will be accessed first by
@kbd{M-.}
-Also, make sure that you've either compiled GDB with your local cc, or
+Also, make sure that you've either compiled @value{GDBN} with your local cc, or
have run @code{fixincludes} if you are compiling with gcc.
@section Submitting Patches
+@cindex submitting patches
Thanks for thinking of offering your changes back to the community of
-GDB users. In general we like to get well designed enhancements.
+@value{GDBN} users. In general we like to get well designed enhancements.
Thanks also for checking in advance about the best way to transfer the
changes.
-The GDB maintainers will only install ``cleanly designed'' patches. You
-may not always agree on what is clean design.
-@c @pxref{Coding Style}, @pxref{Clean Design}.
+The @value{GDBN} maintainers will only install ``cleanly designed'' patches.
+This manual summarizes what we believe to be clean design for @value{GDBN}.
If the maintainers don't have time to put the patch in when it arrives,
or if there is any question about a patch, it goes into a large queue
with everyone else's patches and bug reports.
+@cindex legal papers for code contributions
The legal issue is that to incorporate substantial changes requires a
copyright assignment from you and/or your employer, granting ownership
of the changes to the Free Software Foundation. You can get the
-standard document for doing this by sending mail to
-@code{gnu@@prep.ai.mit.edu} and asking for it. I recommend that people
-write in "All programs owned by the Free Software Foundation" as "NAME
-OF PROGRAM", so that changes in many programs (not just GDB, but GAS,
-Emacs, GCC, etc) can be contributed with only one piece of legalese
-pushed through the bureacracy and filed with the FSF. I can't start
-merging changes until this paperwork is received by the FSF (their
-rules, which I follow since I maintain it for them).
+standard documents for doing this by sending mail to @code{gnu@@gnu.org}
+and asking for it. We recommend that people write in "All programs
+owned by the Free Software Foundation" as "NAME OF PROGRAM", so that
+changes in many programs (not just @value{GDBN}, but GAS, Emacs, GCC,
+etc) can be
+contributed with only one piece of legalese pushed through the
+bureaucracy and filed with the FSF. We can't start merging changes until
+this paperwork is received by the FSF (their rules, which we follow
+since we maintain it for them).
Technically, the easiest way to receive changes is to receive each
-feature as a small context diff or unidiff, suitable for "patch".
+feature as a small context diff or unidiff, suitable for @code{patch}.
Each message sent to me should include the changes to C code and
-header files for a single feature, plus ChangeLog entries for each
-directory where files were modified, and diffs for any changes needed
-to the manuals (gdb/doc/gdb.texi or gdb/doc/gdbint.texi). If there
-are a lot of changes for a single feature, they can be split down
-into multiple messages.
+header files for a single feature, plus @file{ChangeLog} entries for
+each directory where files were modified, and diffs for any changes
+needed to the manuals (@file{gdb/doc/gdb.texinfo} or
+@file{gdb/doc/gdbint.texinfo}). If there are a lot of changes for a
+single feature, they can be split down into multiple messages.
-In this way, if I read and like the feature, I can add it to the
+In this way, if we read and like the feature, we can add it to the
sources with a single patch command, do some testing, and check it in.
-If you leave out the ChangeLog, I have to write one. If you leave
-out the doc, I have to puzzle out what needs documenting. Etc.
+If you leave out the @file{ChangeLog}, we have to write one. If you leave
+out the doc, we have to puzzle out what needs documenting. Etc., etc.
-The reason to send each change in a separate message is that I will
-not install some of the changes. They'll be returned to you with
-questions or comments. If I'm doing my job, my message back to you
+The reason to send each change in a separate message is that we will not
+install some of the changes. They'll be returned to you with questions
+or comments. If we're doing our job correctly, the message back to you
will say what you have to fix in order to make the change acceptable.
-The reason to have separate messages for separate features is so
-that other changes (which I @emph{am} willing to accept) can be installed
-while one or more changes are being reworked. If multiple features
-are sent in a single message, I tend to not put in the effort to sort
-out the acceptable changes from the unacceptable, so none of the
-features get installed until all are acceptable.
-
-If this sounds painful or authoritarian, well, it is. But I get a lot
-of bug reports and a lot of patches, and most of them don't get
-installed because I don't have the time to finish the job that the bug
+The reason to have separate messages for separate features is so that
+the acceptable changes can be installed while one or more changes are
+being reworked. If multiple features are sent in a single message, we
+tend to not put in the effort to sort out the acceptable changes from
+the unacceptable, so none of the features get installed until all are
+acceptable.
+
+If this sounds painful or authoritarian, well, it is. But we get a lot
+of bug reports and a lot of patches, and many of them don't get
+installed because we don't have the time to finish the job that the bug
reporter or the contributor could have done. Patches that arrive
complete, working, and well designed, tend to get installed on the day
-they arrive. The others go into a queue and get installed if and when
-I scan back over the queue -- which can literally take months
-sometimes. It's in both our interests to make patch installation easy
--- you get your changes installed, and I make some forward progress on
-GDB in a normal 12-hour day (instead of them having to wait until I
-have a 14-hour or 16-hour day to spend cleaning up patches before I
-can install them).
+they arrive. The others go into a queue and get installed as time
+permits, which, since the maintainers have many demands to meet, may not
+be for quite some time.
-Please send patches directly to the GDB maintainers at
-@code{gdb-patches@@cygnus.com}.
+Please send patches directly to
+@email{gdb-patches@@sources.redhat.com, the @value{GDBN} maintainers}.
@section Obsolete Conditionals
+@cindex obsolete code
-Fragments of old code in GDB sometimes reference or set the following
+Fragments of old code in @value{GDBN} sometimes reference or set the following
configuration macros. They should not be used by new code, and old uses
should be removed as those parts of the debugger are otherwise touched.
@table @code
-
@item STACK_END_ADDR
This macro used to define where the end of the stack appeared, for use
in interpreting core file formats that don't record this address in the
-core file itself. This information is now configured in BFD, and GDB
-gets the info portably from there. The values in GDB's configuration
+core file itself. This information is now configured in BFD, and @value{GDBN}
+gets the info portably from there. The values in @value{GDBN}'s configuration
files should be moved into BFD configuration files (if needed there),
-and deleted from all of GDB's config files.
+and deleted from all of @value{GDBN}'s config files.
Any @file{@var{foo}-xdep.c} file that references STACK_END_ADDR
is so old that it has never been converted to use BFD. Now that's old!
@@ -2706,6 +5627,11 @@ exec.c
@end table
+@include fdl.texi
+
+@node Index
+@unnumbered Index
+
+@printindex cp
-@contents
@bye
diff --git a/contrib/gdb/gdb/doc/gpl.texi b/contrib/gdb/gdb/doc/gpl.texi
new file mode 100644
index 0000000..be7ddc2
--- /dev/null
+++ b/contrib/gdb/gdb/doc/gpl.texi
@@ -0,0 +1,409 @@
+@ignore
+@c Set file name and title for man page.
+@setfilename gpl
+@settitle GNU General Public License
+@c man begin SEEALSO
+gfdl(7), fsf-funding(7).
+@c man end
+@c man begin COPYRIGHT
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@c man end
+@end ignore
+@node Copying
+@c man begin DESCRIPTION
+@appendix GNU GENERAL PUBLIC LICENSE
+@center Version 2, June 1991
+
+@display
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@unnumberedsec Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software---to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+@iftex
+@unnumberedsec TERMS AND CONDITIONS FOR COPYING,@*DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifnottex
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifnottex
+
+@enumerate 0
+@item
+This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The ``Program'', below,
+refers to any such program or work, and a ``work based on the Program''
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term ``modification''.) Each licensee is addressed as ``you''.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+@item
+You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+@item
+You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+@enumerate a
+@item
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+
+@item
+If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+@item
+You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+@enumerate a
+@item
+Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+
+@item
+Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+@item
+Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)
+@end enumerate
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+@item
+You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+@item
+Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+@item
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+@item
+If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+@item
+The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+@item
+If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+@iftex
+@heading NO WARRANTY
+@end iftex
+@ifnottex
+@center NO WARRANTY
+@end ifnottex
+
+@item
+BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+@item
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+@end enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifnottex
+@center END OF TERMS AND CONDITIONS
+@end ifnottex
+
+@page
+@unnumberedsec How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the ``copyright'' line and a pointer to where the full notice is found.
+
+@smallexample
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) @var{year} @var{name of author}
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+@smallexample
+Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than @samp{show w} and
+@samp{show c}; they could even be mouse-clicks or menu items---whatever
+suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the program, if
+necessary. Here is a sample; alter the names:
+
+@smallexample
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+@var{signature of Ty Coon}, 1 April 1989
+Ty Coon, President of Vice
+@end smallexample
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+@c man end
diff --git a/contrib/gdb/gdb/doc/refcard.tex b/contrib/gdb/gdb/doc/refcard.tex
index d2b72de..a8de900 100644
--- a/contrib/gdb/gdb/doc/refcard.tex
+++ b/contrib/gdb/gdb/doc/refcard.tex
@@ -1,7 +1,8 @@
%%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%%
%This file is TeX source for a reference card describing GDB, the GNU debugger.
-%Copyright (C) 1991, 1992, 1993, 1998 Free Software Foundation, Inc.
+%Copyright 1991, 1992, 1993, 1996, 1998, 1999, 2000
+%Free Software Foundation, Inc.
%Permission is granted to make and distribute verbatim copies of
%this reference provided the copyright notices and permission notices
%are preserved on all copies.
@@ -240,7 +241,7 @@
}
}
-{\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 4}\qquad
+{\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 5}\qquad
\sec Essential Commands;
gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using
@@ -304,7 +305,7 @@ shell {\it cmd}&execute arbitrary shell command string\cr
\line{\smrm \opt{ } surround optional arguments \hfill $\ldots$ show
one or more arguments}
\vskip\baselineskip
-\centerline{\smrm \copyright 1998 Free Software Foundation, Inc.\qquad Permissions on back}
+\centerline{\smrm \copyright 1998,2000 Free Software Foundation, Inc.\qquad Permissions on back}
\eject
\sec Breakpoints and Watchpoints;
break \opt{\it file\tt:}{\it line}\par
@@ -628,15 +629,16 @@ statement.\cr
\vfill
{\smrm\parskip=6pt
-\centerline{Copyright \copyright 1991, '92, '93, '98 Free Software Foundation, Inc.}
-\centerline{Roland H. Pesch}
-\centerline{The author assumes no responsibility for any errors on this card.}
+Copyright \copyright 1991,'92,'93,'98,2000 Free Software Foundation, Inc.
+Author: Roland H. Pesch
+
+The author assumes no responsibility for any errors on this card.
This card may be freely distributed under the terms of the GNU
General Public License.
-\centerline{Please contribute to development of this card by
-annotating it. Improvements can be sent to bug-gdb@gnu.org.}
+Please contribute to development of this card by
+annotating it. Improvements can be sent to bug-gdb@gnu.org.
GDB itself is free software; you are welcome to distribute copies of
it under the terms of the GNU General Public License. There is
diff --git a/contrib/gdb/gdb/doublest.c b/contrib/gdb/gdb/doublest.c
new file mode 100644
index 0000000..a4b4b76
--- /dev/null
+++ b/contrib/gdb/gdb/doublest.c
@@ -0,0 +1,788 @@
+/* Floating point routines for GDB, the GNU debugger.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Support for converting target fp numbers into host DOUBLEST format. */
+
+/* XXX - This code should really be in libiberty/floatformat.c,
+ however configuration issues with libiberty made this very
+ difficult to do in the available time. */
+
+#include "defs.h"
+#include "doublest.h"
+#include "floatformat.h"
+#include "gdb_assert.h"
+#include "gdb_string.h"
+#include "gdbtypes.h"
+#include <math.h> /* ldexp */
+
+/* The odds that CHAR_BIT will be anything but 8 are low enough that I'm not
+ going to bother with trying to muck around with whether it is defined in
+ a system header, what we do if not, etc. */
+#define FLOATFORMAT_CHAR_BIT 8
+
+static unsigned long get_field (unsigned char *,
+ enum floatformat_byteorders,
+ unsigned int, unsigned int, unsigned int);
+
+/* Extract a field which starts at START and is LEN bytes long. DATA and
+ TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
+static unsigned long
+get_field (unsigned char *data, enum floatformat_byteorders order,
+ unsigned int total_len, unsigned int start, unsigned int len)
+{
+ unsigned long result;
+ unsigned int cur_byte;
+ int cur_bitshift;
+
+ /* Start at the least significant part of the field. */
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ {
+ /* We start counting from the other end (i.e, from the high bytes
+ rather than the low bytes). As such, we need to be concerned
+ with what happens if bit 0 doesn't start on a byte boundary.
+ I.e, we need to properly handle the case where total_len is
+ not evenly divisible by 8. So we compute ``excess'' which
+ represents the number of bits from the end of our starting
+ byte needed to get to bit 0. */
+ int excess = FLOATFORMAT_CHAR_BIT - (total_len % FLOATFORMAT_CHAR_BIT);
+ cur_byte = (total_len / FLOATFORMAT_CHAR_BIT)
+ - ((start + len + excess) / FLOATFORMAT_CHAR_BIT);
+ cur_bitshift = ((start + len + excess) % FLOATFORMAT_CHAR_BIT)
+ - FLOATFORMAT_CHAR_BIT;
+ }
+ else
+ {
+ cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT;
+ cur_bitshift =
+ ((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT;
+ }
+ if (cur_bitshift > -FLOATFORMAT_CHAR_BIT)
+ result = *(data + cur_byte) >> (-cur_bitshift);
+ else
+ result = 0;
+ cur_bitshift += FLOATFORMAT_CHAR_BIT;
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ ++cur_byte;
+ else
+ --cur_byte;
+
+ /* Move towards the most significant part of the field. */
+ while (cur_bitshift < len)
+ {
+ result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
+ cur_bitshift += FLOATFORMAT_CHAR_BIT;
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ ++cur_byte;
+ else
+ --cur_byte;
+ }
+ if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
+ /* Mask out bits which are not part of the field */
+ result &= ((1UL << len) - 1);
+ return result;
+}
+
+/* Convert from FMT to a DOUBLEST.
+ FROM is the address of the extended float.
+ Store the DOUBLEST in *TO. */
+
+static void
+convert_floatformat_to_doublest (const struct floatformat *fmt,
+ const void *from,
+ DOUBLEST *to)
+{
+ unsigned char *ufrom = (unsigned char *) from;
+ DOUBLEST dto;
+ long exponent;
+ unsigned long mant;
+ unsigned int mant_bits, mant_off;
+ int mant_bits_left;
+ int special_exponent; /* It's a NaN, denorm or zero */
+
+ /* If the mantissa bits are not contiguous from one end of the
+ mantissa to the other, we need to make a private copy of the
+ source bytes that is in the right order since the unpacking
+ algorithm assumes that the bits are contiguous.
+
+ Swap the bytes individually rather than accessing them through
+ "long *" since we have no guarantee that they start on a long
+ alignment, and also sizeof(long) for the host could be different
+ than sizeof(long) for the target. FIXME: Assumes sizeof(long)
+ for the target is 4. */
+
+ if (fmt->byteorder == floatformat_littlebyte_bigword)
+ {
+ static unsigned char *newfrom;
+ unsigned char *swapin, *swapout;
+ int longswaps;
+
+ longswaps = fmt->totalsize / FLOATFORMAT_CHAR_BIT;
+ longswaps >>= 3;
+
+ if (newfrom == NULL)
+ {
+ newfrom = (unsigned char *) xmalloc (fmt->totalsize);
+ }
+ swapout = newfrom;
+ swapin = ufrom;
+ ufrom = newfrom;
+ while (longswaps-- > 0)
+ {
+ /* This is ugly, but efficient */
+ *swapout++ = swapin[4];
+ *swapout++ = swapin[5];
+ *swapout++ = swapin[6];
+ *swapout++ = swapin[7];
+ *swapout++ = swapin[0];
+ *swapout++ = swapin[1];
+ *swapout++ = swapin[2];
+ *swapout++ = swapin[3];
+ swapin += 8;
+ }
+ }
+
+ exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ fmt->exp_start, fmt->exp_len);
+ /* Note that if exponent indicates a NaN, we can't really do anything useful
+ (not knowing if the host has NaN's, or how to build one). So it will
+ end up as an infinity or something close; that is OK. */
+
+ mant_bits_left = fmt->man_len;
+ mant_off = fmt->man_start;
+ dto = 0.0;
+
+ special_exponent = exponent == 0 || exponent == fmt->exp_nan;
+
+/* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
+ we don't check for zero as the exponent doesn't matter. */
+ if (!special_exponent)
+ exponent -= fmt->exp_bias;
+ else if (exponent == 0)
+ exponent = 1 - fmt->exp_bias;
+
+ /* Build the result algebraically. Might go infinite, underflow, etc;
+ who cares. */
+
+/* If this format uses a hidden bit, explicitly add it in now. Otherwise,
+ increment the exponent by one to account for the integer bit. */
+
+ if (!special_exponent)
+ {
+ if (fmt->intbit == floatformat_intbit_no)
+ dto = ldexp (1.0, exponent);
+ else
+ exponent++;
+ }
+
+ while (mant_bits_left > 0)
+ {
+ mant_bits = min (mant_bits_left, 32);
+
+ mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ mant_off, mant_bits);
+
+ dto += ldexp ((double) mant, exponent - mant_bits);
+ exponent -= mant_bits;
+ mant_off += mant_bits;
+ mant_bits_left -= mant_bits;
+ }
+
+ /* Negate it if negative. */
+ if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
+ dto = -dto;
+ *to = dto;
+}
+
+static void put_field (unsigned char *, enum floatformat_byteorders,
+ unsigned int,
+ unsigned int, unsigned int, unsigned long);
+
+/* Set a field which starts at START and is LEN bytes long. DATA and
+ TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
+static void
+put_field (unsigned char *data, enum floatformat_byteorders order,
+ unsigned int total_len, unsigned int start, unsigned int len,
+ unsigned long stuff_to_put)
+{
+ unsigned int cur_byte;
+ int cur_bitshift;
+
+ /* Start at the least significant part of the field. */
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ {
+ int excess = FLOATFORMAT_CHAR_BIT - (total_len % FLOATFORMAT_CHAR_BIT);
+ cur_byte = (total_len / FLOATFORMAT_CHAR_BIT)
+ - ((start + len + excess) / FLOATFORMAT_CHAR_BIT);
+ cur_bitshift = ((start + len + excess) % FLOATFORMAT_CHAR_BIT)
+ - FLOATFORMAT_CHAR_BIT;
+ }
+ else
+ {
+ cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT;
+ cur_bitshift =
+ ((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT;
+ }
+ if (cur_bitshift > -FLOATFORMAT_CHAR_BIT)
+ {
+ *(data + cur_byte) &=
+ ~(((1 << ((start + len) % FLOATFORMAT_CHAR_BIT)) - 1)
+ << (-cur_bitshift));
+ *(data + cur_byte) |=
+ (stuff_to_put & ((1 << FLOATFORMAT_CHAR_BIT) - 1)) << (-cur_bitshift);
+ }
+ cur_bitshift += FLOATFORMAT_CHAR_BIT;
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ ++cur_byte;
+ else
+ --cur_byte;
+
+ /* Move towards the most significant part of the field. */
+ while (cur_bitshift < len)
+ {
+ if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
+ {
+ /* This is the last byte. */
+ *(data + cur_byte) &=
+ ~((1 << (len - cur_bitshift)) - 1);
+ *(data + cur_byte) |= (stuff_to_put >> cur_bitshift);
+ }
+ else
+ *(data + cur_byte) = ((stuff_to_put >> cur_bitshift)
+ & ((1 << FLOATFORMAT_CHAR_BIT) - 1));
+ cur_bitshift += FLOATFORMAT_CHAR_BIT;
+ if (order == floatformat_little || order == floatformat_littlebyte_bigword)
+ ++cur_byte;
+ else
+ --cur_byte;
+ }
+}
+
+#ifdef HAVE_LONG_DOUBLE
+/* Return the fractional part of VALUE, and put the exponent of VALUE in *EPTR.
+ The range of the returned value is >= 0.5 and < 1.0. This is equivalent to
+ frexp, but operates on the long double data type. */
+
+static long double ldfrexp (long double value, int *eptr);
+
+static long double
+ldfrexp (long double value, int *eptr)
+{
+ long double tmp;
+ int exp;
+
+ /* Unfortunately, there are no portable functions for extracting the exponent
+ of a long double, so we have to do it iteratively by multiplying or dividing
+ by two until the fraction is between 0.5 and 1.0. */
+
+ if (value < 0.0l)
+ value = -value;
+
+ tmp = 1.0l;
+ exp = 0;
+
+ if (value >= tmp) /* Value >= 1.0 */
+ while (value >= tmp)
+ {
+ tmp *= 2.0l;
+ exp++;
+ }
+ else if (value != 0.0l) /* Value < 1.0 and > 0.0 */
+ {
+ while (value < tmp)
+ {
+ tmp /= 2.0l;
+ exp--;
+ }
+ tmp *= 2.0l;
+ exp++;
+ }
+
+ *eptr = exp;
+ return value / tmp;
+}
+#endif /* HAVE_LONG_DOUBLE */
+
+
+/* The converse: convert the DOUBLEST *FROM to an extended float
+ and store where TO points. Neither FROM nor TO have any alignment
+ restrictions. */
+
+static void
+convert_doublest_to_floatformat (CONST struct floatformat *fmt,
+ const DOUBLEST *from,
+ void *to)
+{
+ DOUBLEST dfrom;
+ int exponent;
+ DOUBLEST mant;
+ unsigned int mant_bits, mant_off;
+ int mant_bits_left;
+ unsigned char *uto = (unsigned char *) to;
+
+ memcpy (&dfrom, from, sizeof (dfrom));
+ memset (uto, 0, (fmt->totalsize + FLOATFORMAT_CHAR_BIT - 1)
+ / FLOATFORMAT_CHAR_BIT);
+ if (dfrom == 0)
+ return; /* Result is zero */
+ if (dfrom != dfrom) /* Result is NaN */
+ {
+ /* From is NaN */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
+ fmt->exp_len, fmt->exp_nan);
+ /* Be sure it's not infinity, but NaN value is irrel */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
+ 32, 1);
+ return;
+ }
+
+ /* If negative, set the sign bit. */
+ if (dfrom < 0)
+ {
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
+ dfrom = -dfrom;
+ }
+
+ if (dfrom + dfrom == dfrom && dfrom != 0.0) /* Result is Infinity */
+ {
+ /* Infinity exponent is same as NaN's. */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
+ fmt->exp_len, fmt->exp_nan);
+ /* Infinity mantissa is all zeroes. */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
+ fmt->man_len, 0);
+ return;
+ }
+
+#ifdef HAVE_LONG_DOUBLE
+ mant = ldfrexp (dfrom, &exponent);
+#else
+ mant = frexp (dfrom, &exponent);
+#endif
+
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start, fmt->exp_len,
+ exponent + fmt->exp_bias - 1);
+
+ mant_bits_left = fmt->man_len;
+ mant_off = fmt->man_start;
+ while (mant_bits_left > 0)
+ {
+ unsigned long mant_long;
+ mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;
+
+ mant *= 4294967296.0;
+ mant_long = ((unsigned long) mant) & 0xffffffffL;
+ 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 (mant_bits_left == fmt->man_len
+ && fmt->intbit == floatformat_intbit_no)
+ {
+ mant_long <<= 1;
+ mant_long &= 0xffffffffL;
+ mant_bits -= 1;
+ }
+
+ if (mant_bits < 32)
+ {
+ /* The bits we want are in the most significant MANT_BITS bits of
+ mant_long. Move them to the least significant. */
+ mant_long >>= 32 - mant_bits;
+ }
+
+ put_field (uto, fmt->byteorder, fmt->totalsize,
+ mant_off, mant_bits, mant_long);
+ mant_off += mant_bits;
+ mant_bits_left -= mant_bits;
+ }
+ if (fmt->byteorder == floatformat_littlebyte_bigword)
+ {
+ int count;
+ unsigned char *swaplow = uto;
+ unsigned char *swaphigh = uto + 4;
+ unsigned char tmp;
+
+ for (count = 0; count < 4; count++)
+ {
+ tmp = *swaplow;
+ *swaplow++ = *swaphigh;
+ *swaphigh++ = tmp;
+ }
+ }
+}
+
+/* Check if VAL (which is assumed to be a floating point number whose
+ format is described by FMT) is negative. */
+
+int
+floatformat_is_negative (const struct floatformat *fmt, char *val)
+{
+ unsigned char *uval = (unsigned char *) val;
+ gdb_assert (fmt != NULL);
+ return get_field (uval, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1);
+}
+
+/* Check if VAL is "not a number" (NaN) for FMT. */
+
+int
+floatformat_is_nan (const struct floatformat *fmt, char *val)
+{
+ unsigned char *uval = (unsigned char *) val;
+ long exponent;
+ unsigned long mant;
+ unsigned int mant_bits, mant_off;
+ int mant_bits_left;
+
+ gdb_assert (fmt != NULL);
+
+ if (! fmt->exp_nan)
+ return 0;
+
+ exponent = get_field (uval, fmt->byteorder, fmt->totalsize,
+ fmt->exp_start, fmt->exp_len);
+
+ if (exponent != fmt->exp_nan)
+ return 0;
+
+ mant_bits_left = fmt->man_len;
+ mant_off = fmt->man_start;
+
+ while (mant_bits_left > 0)
+ {
+ mant_bits = min (mant_bits_left, 32);
+
+ mant = get_field (uval, fmt->byteorder, fmt->totalsize,
+ mant_off, mant_bits);
+
+ /* If there is an explicit integer bit, mask it off. */
+ if (mant_off == fmt->man_start
+ && fmt->intbit == floatformat_intbit_yes)
+ mant &= ~(1 << (mant_bits - 1));
+
+ if (mant)
+ return 1;
+
+ mant_off += mant_bits;
+ mant_bits_left -= mant_bits;
+ }
+
+ return 0;
+}
+
+/* Convert the mantissa of VAL (which is assumed to be a floating
+ point number whose format is described by FMT) into a hexadecimal
+ and store it in a static string. Return a pointer to that string. */
+
+char *
+floatformat_mantissa (const struct floatformat *fmt, char *val)
+{
+ unsigned char *uval = (unsigned char *) val;
+ unsigned long mant;
+ unsigned int mant_bits, mant_off;
+ int mant_bits_left;
+ static char res[50];
+ char buf[9];
+
+ /* Make sure we have enough room to store the mantissa. */
+ gdb_assert (fmt != NULL);
+ gdb_assert (sizeof res > ((fmt->man_len + 7) / 8) * 2);
+
+ mant_off = fmt->man_start;
+ mant_bits_left = fmt->man_len;
+ mant_bits = (mant_bits_left % 32) > 0 ? mant_bits_left % 32 : 32;
+
+ mant = get_field (uval, fmt->byteorder, fmt->totalsize,
+ mant_off, mant_bits);
+
+ sprintf (res, "%lx", mant);
+
+ mant_off += mant_bits;
+ mant_bits_left -= mant_bits;
+
+ while (mant_bits_left > 0)
+ {
+ mant = get_field (uval, fmt->byteorder, fmt->totalsize,
+ mant_off, 32);
+
+ sprintf (buf, "%08lx", mant);
+ strcat (res, buf);
+
+ mant_off += 32;
+ mant_bits_left -= 32;
+ }
+
+ return res;
+}
+
+
+/* Convert TO/FROM target to the hosts DOUBLEST floating-point format.
+
+ If the host and target formats agree, we just copy the raw data
+ into the appropriate type of variable and return, letting the host
+ increase precision as necessary. Otherwise, we call the conversion
+ routine and let it do the dirty work. */
+
+#ifndef HOST_FLOAT_FORMAT
+#define HOST_FLOAT_FORMAT 0
+#endif
+#ifndef HOST_DOUBLE_FORMAT
+#define HOST_DOUBLE_FORMAT 0
+#endif
+#ifndef HOST_LONG_DOUBLE_FORMAT
+#define HOST_LONG_DOUBLE_FORMAT 0
+#endif
+
+static const struct floatformat *host_float_format = HOST_FLOAT_FORMAT;
+static const struct floatformat *host_double_format = HOST_DOUBLE_FORMAT;
+static const struct floatformat *host_long_double_format = HOST_LONG_DOUBLE_FORMAT;
+
+void
+floatformat_to_doublest (const struct floatformat *fmt,
+ const void *in, DOUBLEST *out)
+{
+ gdb_assert (fmt != NULL);
+ if (fmt == host_float_format)
+ {
+ float val;
+ memcpy (&val, in, sizeof (val));
+ *out = val;
+ }
+ else if (fmt == host_double_format)
+ {
+ double val;
+ memcpy (&val, in, sizeof (val));
+ *out = val;
+ }
+ else if (fmt == host_long_double_format)
+ {
+ long double val;
+ memcpy (&val, in, sizeof (val));
+ *out = val;
+ }
+ else
+ convert_floatformat_to_doublest (fmt, in, out);
+}
+
+void
+floatformat_from_doublest (const struct floatformat *fmt,
+ const DOUBLEST *in, void *out)
+{
+ gdb_assert (fmt != NULL);
+ if (fmt == host_float_format)
+ {
+ float val = *in;
+ memcpy (out, &val, sizeof (val));
+ }
+ else if (fmt == host_double_format)
+ {
+ double val = *in;
+ memcpy (out, &val, sizeof (val));
+ }
+ else if (fmt == host_long_double_format)
+ {
+ long double val = *in;
+ memcpy (out, &val, sizeof (val));
+ }
+ else
+ convert_doublest_to_floatformat (fmt, in, out);
+}
+
+
+/* Return a floating-point format for a floating-point variable of
+ length LEN. Return NULL, if no suitable floating-point format
+ could be found.
+
+ We need this functionality since information about the
+ floating-point format of a type is not always available to GDB; the
+ debug information typically only tells us the size of a
+ floating-point type.
+
+ FIXME: kettenis/2001-10-28: In many places, particularly in
+ target-dependent code, the format of floating-point types is known,
+ but not passed on by GDB. This should be fixed. */
+
+const struct floatformat *
+floatformat_from_length (int len)
+{
+ if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
+ return TARGET_FLOAT_FORMAT;
+ else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
+ return TARGET_DOUBLE_FORMAT;
+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
+ return TARGET_LONG_DOUBLE_FORMAT;
+
+ return NULL;
+}
+
+const struct floatformat *
+floatformat_from_type (const struct type *type)
+{
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+ if (TYPE_FLOATFORMAT (type) != NULL)
+ return TYPE_FLOATFORMAT (type);
+ else
+ return floatformat_from_length (TYPE_LENGTH (type));
+}
+
+/* If the host doesn't define NAN, use zero instead. */
+#ifndef NAN
+#define NAN 0.0
+#endif
+
+/* Extract a floating-point number of length LEN from a target-order
+ byte-stream at ADDR. Returns the value as type DOUBLEST. */
+
+DOUBLEST
+extract_floating (const void *addr, int len)
+{
+ const struct floatformat *fmt = floatformat_from_length (len);
+ DOUBLEST val;
+
+ if (fmt == NULL)
+ {
+ warning ("Can't store a floating-point number of %d bytes.", len);
+ return NAN;
+ }
+
+ floatformat_to_doublest (fmt, addr, &val);
+ return val;
+}
+
+/* Store VAL as a floating-point number of length LEN to a
+ target-order byte-stream at ADDR. */
+
+void
+store_floating (void *addr, int len, DOUBLEST val)
+{
+ const struct floatformat *fmt = floatformat_from_length (len);
+
+ if (fmt == NULL)
+ {
+ warning ("Can't store a floating-point number of %d bytes.", len);
+ memset (addr, 0, len);
+ }
+
+ floatformat_from_doublest (fmt, &val, addr);
+}
+
+/* Extract a floating-point number of type TYPE from a target-order
+ byte-stream at ADDR. Returns the value as type DOUBLEST. */
+
+DOUBLEST
+extract_typed_floating (const void *addr, const struct type *type)
+{
+ DOUBLEST retval;
+
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+
+ if (TYPE_FLOATFORMAT (type) == NULL)
+ return extract_floating (addr, TYPE_LENGTH (type));
+
+ floatformat_to_doublest (TYPE_FLOATFORMAT (type), addr, &retval);
+ return retval;
+}
+
+/* Store VAL as a floating-point number of type TYPE to a target-order
+ byte-stream at ADDR. */
+
+void
+store_typed_floating (void *addr, const struct type *type, DOUBLEST val)
+{
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+
+ /* FIXME: kettenis/2001-10-28: It is debatable whether we should
+ zero out any remaining bytes in the target buffer when TYPE is
+ longer than the actual underlying floating-point format. Perhaps
+ we should store a fixed bitpattern in those remaining bytes,
+ instead of zero, or perhaps we shouldn't touch those remaining
+ bytes at all.
+
+ NOTE: cagney/2001-10-28: With the way things currently work, it
+ isn't a good idea to leave the end bits undefined. This is
+ because GDB writes out the entire sizeof(<floating>) bits of the
+ floating-point type even though the value might only be stored
+ in, and the target processor may only refer to, the first N <
+ TYPE_LENGTH (type) bits. If the end of the buffer wasn't
+ initialized, GDB would write undefined data to the target. An
+ errant program, refering to that undefined data, would then
+ become non-deterministic.
+
+ See also the function convert_typed_floating below. */
+ memset (addr, 0, TYPE_LENGTH (type));
+
+ if (TYPE_FLOATFORMAT (type) == NULL)
+ store_floating (addr, TYPE_LENGTH (type), val);
+ else
+ floatformat_from_doublest (TYPE_FLOATFORMAT (type), &val, addr);
+}
+
+/* Convert a floating-point number of type FROM_TYPE from a
+ target-order byte-stream at FROM to a floating-point number of type
+ TO_TYPE, and store it to a target-order byte-stream at TO. */
+
+void
+convert_typed_floating (const void *from, const struct type *from_type,
+ void *to, const struct type *to_type)
+{
+ const struct floatformat *from_fmt = floatformat_from_type (from_type);
+ const struct floatformat *to_fmt = floatformat_from_type (to_type);
+
+ gdb_assert (TYPE_CODE (from_type) == TYPE_CODE_FLT);
+ gdb_assert (TYPE_CODE (to_type) == TYPE_CODE_FLT);
+
+ if (from_fmt == NULL || to_fmt == NULL)
+ {
+ /* If we don't know the floating-point format of FROM_TYPE or
+ TO_TYPE, there's not much we can do. We might make the
+ assumption that if the length of FROM_TYPE and TO_TYPE match,
+ their floating-point format would match too, but that
+ assumption might be wrong on targets that support
+ floating-point types that only differ in endianness for
+ example. So we warn instead, and zero out the target buffer. */
+ warning ("Can't convert floating-point number to desired type.");
+ memset (to, 0, TYPE_LENGTH (to_type));
+ }
+ else if (from_fmt == to_fmt)
+ {
+ /* We're in business. The floating-point format of FROM_TYPE
+ and TO_TYPE match. However, even though the floating-point
+ format matches, the length of the type might still be
+ different. Make sure we don't overrun any buffers. See
+ comment in store_typed_floating for a discussion about
+ zeroing out remaining bytes in the target buffer. */
+ memset (to, 0, TYPE_LENGTH (to_type));
+ memcpy (to, from, min (TYPE_LENGTH (from_type), TYPE_LENGTH (to_type)));
+ }
+ else
+ {
+ /* The floating-point types don't match. The best we can do
+ (aport from simulating the target FPU) is converting to the
+ widest floating-point type supported by the host, and then
+ again to the desired type. */
+ DOUBLEST d;
+
+ floatformat_to_doublest (from_fmt, from, &d);
+ floatformat_from_doublest (to_fmt, &d, to);
+ }
+}
diff --git a/contrib/gdb/gdb/doublest.h b/contrib/gdb/gdb/doublest.h
new file mode 100644
index 0000000..920d702
--- /dev/null
+++ b/contrib/gdb/gdb/doublest.h
@@ -0,0 +1,83 @@
+/* Floating point definitions for GDB.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef DOUBLEST_H
+#define DOUBLEST_H
+
+/* Setup definitions for host and target floating point formats. We need to
+ consider the format for `float', `double', and `long double' for both target
+ and host. We need to do this so that we know what kind of conversions need
+ to be done when converting target numbers to and from the hosts DOUBLEST
+ data type. */
+
+/* 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
+ is irrelevant, since no conversions will be taking place. */
+
+#include "floatformat.h" /* For struct floatformat */
+
+/* Use `long double' if the host compiler supports it. (Note that this is not
+ necessarily any longer than `double'. On SunOS/gcc, it's the same as
+ double.) This is necessary because GDB internally converts all floating
+ point values to the widest type supported by the host.
+
+ There are problems however, when the target `long double' is longer than the
+ host's `long double'. In general, we'll probably reduce the precision of
+ any such values and print a warning. */
+
+#ifdef HAVE_LONG_DOUBLE
+typedef long double DOUBLEST;
+#else
+typedef double DOUBLEST;
+#endif
+
+extern void floatformat_to_doublest (const struct floatformat *,
+ const void *in, DOUBLEST *out);
+extern void floatformat_from_doublest (const struct floatformat *,
+ const DOUBLEST *in, void *out);
+
+extern int floatformat_is_negative (const struct floatformat *, char *);
+extern int floatformat_is_nan (const struct floatformat *, char *);
+extern char *floatformat_mantissa (const struct floatformat *, char *);
+
+/* These two functions are deprecated in favour of
+ extract_typed_floating and store_typed_floating. See comments in
+ 'doublest.c' for details. */
+
+extern DOUBLEST extract_floating (const void *addr, int len);
+extern void store_floating (void *addr, int len, DOUBLEST val);
+
+/* Given TYPE, return its floatformat. TYPE_FLOATFORMAT() may return
+ NULL. type_floatformat() detects that and returns a floatformat
+ based on the type size when FLOATFORMAT is NULL. */
+
+const struct floatformat *floatformat_from_type (const struct type *type);
+
+extern DOUBLEST extract_typed_floating (const void *addr,
+ const struct type *type);
+extern void store_typed_floating (void *addr, const struct type *type,
+ DOUBLEST val);
+extern void convert_typed_floating (const void *from,
+ const struct type *from_type,
+ void *to, const struct type *to_type);
+
+#endif
diff --git a/contrib/gdb/gdb/dsrec.c b/contrib/gdb/gdb/dsrec.c
new file mode 100644
index 0000000..5f2c2d7
--- /dev/null
+++ b/contrib/gdb/gdb/dsrec.c
@@ -0,0 +1,311 @@
+/* S-record download support for GDB, the GNU debugger.
+ Copyright 1995, 1996, 1997, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "serial.h"
+#include "srec.h"
+#include <time.h>
+
+extern void report_transfer_performance (unsigned long, time_t, time_t);
+
+extern int remote_debug;
+
+static int make_srec (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
+ `struct serial *' 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 (struct serial *desc, const char *file, bfd_vma load_offset,
+ int maxrecsize,
+ int flags, int hashmark, int (*waitack) (void))
+{
+ bfd *abfd;
+ asection *s;
+ char *srec;
+ int i;
+ int reclen;
+ time_t start_time, end_time;
+ unsigned long data_count = 0;
+
+ srec = (char *) alloca (maxrecsize + 1);
+
+ abfd = bfd_openr (file, 0);
+ if (!abfd)
+ {
+ 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;
+ }
+
+ start_time = time (NULL);
+
+ /* Write a type 0 header record. no data for a type 0, and there
+ is no data, so len is 0. */
+
+ reclen = maxrecsize;
+ make_srec (srec, 0, NULL, (asection *) 1, 0, &reclen, flags);
+ if (remote_debug)
+ {
+ srec[reclen] = '\0';
+ puts_debug ("sent -->", srec, "<--");
+ }
+ serial_write (desc, srec, reclen);
+
+ for (s = abfd->sections; s; s = s->next)
+ if (s->flags & SEC_LOAD)
+ {
+ 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);
+ /* Both GDB and BFD have mechanisms for printing addresses.
+ In the below, GDB's is used so that the address is
+ consistent with the rest of GDB. BFD's printf_vma() could
+ have also been used. cagney 1999-09-01 */
+ printf_filtered ("%s\t: 0x%s .. 0x%s ",
+ section_name,
+ paddr (addr),
+ paddr (addr + size));
+ gdb_flush (gdb_stdout);
+
+ data_count += size;
+
+ for (i = 0; i < size; i += numbytes)
+ {
+ reclen = maxrecsize;
+ numbytes = make_srec (srec, (CORE_ADDR) (addr + i), abfd, s,
+ i, &reclen, flags);
+
+ if (remote_debug)
+ {
+ srec[reclen] = '\0';
+ puts_debug ("sent -->", srec, "<--");
+ }
+
+ /* Repeatedly send the S-record until a good
+ acknowledgement is sent back. */
+ do
+ {
+ serial_write (desc, srec, reclen);
+ if (ui_load_progress_hook)
+ if (ui_load_progress_hook (section_name, (unsigned long) i))
+ error ("Canceled the download");
+ }
+ while (waitack != NULL && !waitack ());
+
+ if (hashmark)
+ {
+ putchar_unfiltered ('#');
+ gdb_flush (gdb_stdout);
+ }
+ } /* Per-packet (or S-record) loop */
+
+ if (ui_load_progress_hook)
+ if (ui_load_progress_hook (section_name, (unsigned long) i))
+ error ("Canceled the download");
+ putchar_unfiltered ('\n');
+ }
+
+ if (hashmark)
+ putchar_unfiltered ('\n');
+
+ end_time = time (NULL);
+
+ /* Write a terminator record. */
+
+ reclen = maxrecsize;
+ make_srec (srec, abfd->start_address, NULL, NULL, 0, &reclen, flags);
+
+ if (remote_debug)
+ {
+ srec[reclen] = '\0';
+ puts_debug ("sent -->", srec, "<--");
+ }
+
+ serial_write (desc, srec, reclen);
+
+ /* Some monitors need these to wake up properly. (Which ones? -sts) */
+ serial_write (desc, "\r\r", 2);
+ if (remote_debug)
+ puts_debug ("sent -->", "\r\r", "<---");
+
+ serial_flush_input (desc);
+
+ report_transfer_performance (data_count, start_time, end_time);
+}
+
+/*
+ * 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:
+ *
+ * byte count-+ address
+ * start ---+ | | data +- checksum
+ * | | | |
+ * S01000006F6B692D746573742E73726563E4
+ * S315000448600000000000000000FC00005900000000E9
+ * S31A0004000023C1400037DE00F023604000377B009020825000348D
+ * S30B0004485A0000000000004E
+ * S70500040000F6
+ *
+ * S<type><length><address><data><checksum>
+ *
+ * Where
+ * - length
+ * is the number of bytes following upto the checksum. Note that
+ * this is not the number of chars following, since it takes two
+ * chars to represent a byte.
+ * - type
+ * is one of:
+ * 0) header record
+ * 1) two byte address data record
+ * 2) three byte address data record
+ * 3) four byte address data record
+ * 7) four byte address termination record
+ * 8) three byte address termination record
+ * 9) two byte address termination record
+ *
+ * - address
+ * is the start address of the data following, or in the case of
+ * a termination record, the start address of the image
+ * - data
+ * is the data.
+ * - checksum
+ * 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.
+ *
+ */
+
+static int
+make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
+ int sectoff, int *maxrecsize, int flags)
+{
+ unsigned char checksum;
+ int tmp;
+ const static char hextab[] = "0123456789ABCDEF";
+ 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"};
+ char const *code_table;
+ int addr_size;
+ int payload_size;
+ char *binbuf;
+ char *p;
+
+ if (sect)
+ {
+ tmp = flags; /* Data or header record */
+ code_table = abfd ? data_code_table : header_code_table;
+ binbuf = alloca (*maxrecsize / 2);
+ }
+ else
+ {
+ tmp = flags >> SREC_TERM_SHIFT; /* Term record */
+ code_table = term_code_table;
+ binbuf = NULL;
+ }
+
+ if ((tmp & SREC_2_BYTE_ADDR) && (targ_addr <= 0xffff))
+ addr_size = 2;
+ else if ((tmp & SREC_3_BYTE_ADDR) && (targ_addr <= 0xffffff))
+ addr_size = 3;
+ else if (tmp & SREC_4_BYTE_ADDR)
+ addr_size = 4;
+ else
+ internal_error (__FILE__, __LINE__,
+ "make_srec: Bad address (0x%s), or bad flags (0x%x).",
+ paddr (targ_addr), flags);
+
+ /* Now that we know the address size, we can figure out how much
+ data this record can hold. */
+
+ if (sect && abfd)
+ {
+ payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2;
+ payload_size = min (payload_size, sect->_raw_size - sectoff);
+
+ bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size);
+ }
+ else
+ payload_size = 0; /* Term or header packets have no payload */
+
+ /* Output the header. */
+
+ sprintf (srec, formats[addr_size - 2], code_table[addr_size - 2],
+ 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 >> 16) & 0xff)
+ + ((targ_addr >> 24) & 0xff));
+
+ p = srec + 1 + 1 + 2 + addr_size * 2;
+
+ /* Build the Srecord. */
+ for (tmp = 0; tmp < payload_size; tmp++)
+ {
+ unsigned char k;
+
+ k = binbuf[tmp];
+ *p++ = hextab[k >> 4];
+ *p++ = hextab[k & 0xf];
+ checksum += k;
+ }
+
+ checksum = ~checksum;
+
+ *p++ = hextab[checksum >> 4];
+ *p++ = hextab[checksum & 0xf];
+ *p++ = '\r';
+
+ *maxrecsize = p - srec;
+ return payload_size;
+}
diff --git a/contrib/gdb/gdb/dst.h b/contrib/gdb/gdb/dst.h
new file mode 100644
index 0000000..b72c58c
--- /dev/null
+++ b/contrib/gdb/gdb/dst.h
@@ -0,0 +1,1671 @@
+/* <apollo/dst.h> */
+/* Apollo object module DST (debug symbol table) description */
+
+#ifndef apollo_dst_h
+#define apollo_dst_h
+
+#if defined(apollo) && !defined(__GNUC__)
+#define ALIGNED1 __attribute( (aligned(1)) )
+#else
+/* Remove attribute directives from non-Apollo code: */
+#define ALIGNED1 /* nil */
+#endif
+
+
+
+/* Identification of this version of the debug symbol table. Producers of the
+ debug symbol table must write these values into the version number field of
+ the compilation unit record in .blocks .
+ */
+#define dst_version_major 1
+#define dst_version_minor 3
+
+
+/*
+ ** Enumeration of debug record types appearing in .blocks and .symbols ...
+ */
+typedef enum
+ {
+ dst_typ_pad, /* 0 */
+ dst_typ_comp_unit, /* 1 */
+ dst_typ_section_tab, /* 2 */
+ dst_typ_file_tab, /* 3 */
+ dst_typ_block, /* 4 */
+ dst_typ_5,
+ dst_typ_var,
+ dst_typ_pointer, /* 7 */
+ dst_typ_array, /* 8 */
+ dst_typ_subrange, /* 9 */
+ dst_typ_set, /* 10 */
+ dst_typ_implicit_enum, /* 11 */
+ dst_typ_explicit_enum, /* 12 */
+ dst_typ_short_rec, /* 13 */
+ dst_typ_old_record,
+ dst_typ_short_union, /* 15 */
+ dst_typ_old_union,
+ dst_typ_file, /* 17 */
+ dst_typ_offset, /* 18 */
+ dst_typ_alias, /* 19 */
+ dst_typ_signature, /* 20 */
+ dst_typ_21,
+ dst_typ_old_label, /* 22 */
+ dst_typ_scope, /* 23 */
+ dst_typ_end_scope, /* 24 */
+ dst_typ_25,
+ dst_typ_26,
+ dst_typ_string_tab, /* 27 */
+ dst_typ_global_name_tab, /* 28 */
+ dst_typ_forward, /* 29 */
+ dst_typ_aux_size, /* 30 */
+ dst_typ_aux_align, /* 31 */
+ dst_typ_aux_field_size, /* 32 */
+ dst_typ_aux_field_off, /* 33 */
+ dst_typ_aux_field_align, /* 34 */
+ dst_typ_aux_qual, /* 35 */
+ dst_typ_aux_var_bound, /* 36 */
+ dst_typ_extension, /* 37 */
+ dst_typ_string, /* 38 */
+ dst_typ_old_entry,
+ dst_typ_const, /* 40 */
+ dst_typ_reference, /* 41 */
+ dst_typ_record, /* 42 */
+ dst_typ_union, /* 43 */
+ dst_typ_aux_type_deriv, /* 44 */
+ dst_typ_locpool, /* 45 */
+ dst_typ_variable, /* 46 */
+ dst_typ_label, /* 47 */
+ dst_typ_entry, /* 48 */
+ dst_typ_aux_lifetime, /* 49 */
+ dst_typ_aux_ptr_base, /* 50 */
+ dst_typ_aux_src_range, /* 51 */
+ dst_typ_aux_reg_val, /* 52 */
+ dst_typ_aux_unit_names, /* 53 */
+ dst_typ_aux_sect_info, /* 54 */
+ dst_typ_END_OF_ENUM
+ }
+dst_rec_type_t;
+
+
+/*
+ ** Dummy bounds for variably dimensioned arrays:
+ */
+#define dst_dummy_array_size 100
+
+
+/*
+ ** Reference to another item in the symbol table.
+ **
+ ** The value of a dst_rel_offset_t is the relative offset from the start of the
+ ** referencing record to the start of the referenced record, string, etc.
+ **
+ ** The value of a NIL dst_rel_offset_t is zero.
+ */
+
+typedef long dst_rel_offset_t ALIGNED1;
+
+
+/* FIXME: Here and many places we make assumptions about sizes of host
+ data types, structure layout, etc. Only needs to be fixed if we care
+ about cross-debugging, though. */
+
+/*
+ ** Section-relative reference.
+ **
+ ** The section index field is an index into the local compilation unit's
+ ** section table (see dst_rec_section_tab_t)--NOT into the object module
+ ** section table!
+ **
+ ** The sect_offset field is the offset in bytes into the section.
+ **
+ ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate
+ ** at one.
+ */
+
+typedef struct
+ {
+ unsigned short sect_index;
+ unsigned long sect_offset ALIGNED1;
+ }
+dst_sect_ref_t;
+
+#define dst_sect_index_nil 0
+#define dst_sect_index_origin 1
+
+
+/*
+ ** Source location descriptor.
+ **
+ ** The file_index field is an index into the local compilation unit's
+ ** file table (see dst_rec_file_tab_t).
+ **
+ ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate
+ ** at one.
+ */
+
+typedef struct
+ {
+ boolean reserved:1; /* reserved for future use */
+ int file_index:11; /* index into .blocks source file list */
+ int line_number:20; /* source line number */
+ }
+dst_src_loc_t;
+
+#define dst_file_index_nil 0
+#define dst_file_index_origin 1
+
+
+/*
+ ** Standard (primitive) type codes.
+ */
+
+typedef enum
+ {
+ dst_non_std_type,
+ dst_int8_type, /* 8 bit integer */
+ dst_int16_type, /* 16 bit integer */
+ dst_int32_type, /* 32 bit integer */
+ dst_uint8_type, /* 8 bit unsigned integer */
+ dst_uint16_type, /* 16 bit unsigned integer */
+ dst_uint32_type, /* 32 bit unsigned integer */
+ dst_real32_type, /* single precision ieee floatining point */
+ dst_real64_type, /* double precision ieee floatining point */
+ dst_complex_type, /* single precision complex */
+ dst_dcomplex_type, /* double precision complex */
+ dst_bool8_type, /* boolean =logical*1 */
+ dst_bool16_type, /* boolean =logical*2 */
+ dst_bool32_type, /* boolean =logical*4 */
+ dst_char_type, /* 8 bit ascii character */
+ dst_string_type, /* string of 8 bit ascii characters */
+ dst_ptr_type, /* univ_pointer */
+ dst_set_type, /* generic 256 bit set */
+ dst_proc_type, /* generic procedure (signature not specified) */
+ dst_func_type, /* generic function (signature not specified) */
+ dst_void_type, /* c void type */
+ dst_uchar_type, /* c unsigned char */
+ dst_std_type_END_OF_ENUM
+ }
+dst_std_type_t;
+
+
+/*
+ ** General data type descriptor
+ **
+ ** If the user_defined_type bit is clear, then the type is a standard type, and
+ ** the remaining bits contain the dst_std_type_t of the type. If the bit is
+ ** set, then the type is defined in a separate dst record, which is referenced
+ ** by the remaining bits as a dst_rel_offset_t.
+ */
+
+typedef union
+ {
+ struct
+ {
+ boolean user_defined_type:1; /* tag field */
+ int must_be_zero:23; /* 23 bits of pad */
+ dst_std_type_t dtc:8; /* 8 bit primitive data */
+ }
+ std_type;
+
+ struct
+ {
+ boolean user_defined_type:1; /* tag field */
+ int doffset:31; /* offset to type record */
+ }
+ user_type;
+ }
+dst_type_t ALIGNED1;
+
+/* The user_type.doffset field is a 31-bit signed value. Some versions of C
+ do not support signed bit fields. The following macro will extract that
+ field as a signed value:
+ */
+#define dst_user_type_offset(type_rec) \
+ ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 )
+
+
+/*================================================*/
+/*========== RECORDS IN .blocks SECTION ==========*/
+/*================================================*/
+
+/*-----------------------
+ COMPILATION UNIT record
+ -----------------------
+ This must be the first record in each .blocks section.
+ Provides a set of information describing the output of a single compilation
+ and pointers to additional information for the compilation unit.
+*/
+
+typedef enum
+ {
+ dst_pc_code_locs, /* ranges in loc strings are pc ranges */
+ dst_comp_unit_END_OF_ENUM
+ }
+dst_comp_unit_flag_t;
+
+typedef enum
+ {
+ dst_lang_unk, /* unknown language */
+ dst_lang_pas, /* Pascal */
+ dst_lang_ftn, /* FORTRAN */
+ dst_lang_c, /* C */
+ dst_lang_mod2, /* Modula-2 */
+ dst_lang_asm_m68k, /* 68K assembly language */
+ dst_lang_asm_a88k, /* AT assembly language */
+ dst_lang_ada, /* Ada */
+ dst_lang_cxx, /* C++ */
+ dst_lang_END_OF_ENUM
+ }
+dst_lang_type_t;
+
+typedef struct
+ {
+ struct
+ {
+ unsigned char major_part; /* = dst_version_major */
+ unsigned char minor_part; /* = dst_version_minor */
+ }
+ version; /* version of dst */
+ unsigned short flags; /* mask of dst_comp_unit_flag_t */
+ unsigned short lang_type; /* source language */
+ unsigned short number_of_blocks; /* number of blocks records */
+ dst_rel_offset_t root_block_offset; /* offset to root block (module?) */
+ dst_rel_offset_t section_table /* offset to section table record */ ;
+ dst_rel_offset_t file_table; /* offset to file table record */
+ unsigned long data_size; /* total size of .blocks data */
+ }
+dst_rec_comp_unit_t ALIGNED1;
+
+
+/*--------------------
+ SECTION TABLE record
+ --------------------
+ There must be one section table associated with each compilation unit.
+ Other debug records refer to sections via their index in this table. The
+ section base addresses in the table are virtual addresses of the sections,
+ relocated by the linker.
+*/
+
+typedef struct
+ {
+ unsigned short number_of_sections; /* size of array: */
+ unsigned long section_base[dst_dummy_array_size] ALIGNED1;
+ }
+dst_rec_section_tab_t ALIGNED1;
+
+
+/*-----------------
+ FILE TABLE record
+ -----------------
+ There must be one file table associated with each compilation unit describing
+ the source (and include) files used by each compilation unit. Other debug
+ records refer to files via their index in this table. The first entry is the
+ primary source file.
+*/
+
+typedef struct
+ {
+ long dtm; /* time last modified (time_$clock_t) */
+ dst_rel_offset_t noffset; /* offset to name string for source file */
+ }
+dst_file_desc_t;
+
+typedef struct
+ {
+ unsigned short number_of_files; /* size of array: */
+ dst_file_desc_t files[dst_dummy_array_size] ALIGNED1;
+ }
+dst_rec_file_tab_t ALIGNED1;
+
+
+/*-----------------
+ NAME TABLE record
+ -----------------
+ A name table record may appear as an auxiliary record to the file table,
+ providing additional qualification of the file indexes for languages that
+ need it (i.e. Ada). Name table entries parallel file table entries of the
+ same file index.
+*/
+
+typedef struct
+ {
+ unsigned short number_of_names; /* size of array: */
+ dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1;
+ }
+dst_rec_name_tab_t ALIGNED1;
+
+
+/*--------------
+ BLOCK record
+ --------------
+ Describes a lexical program block--a procedure, function, module, etc.
+*/
+
+/* Block types. These may be used in any way desired by the compiler writers.
+ The debugger uses them only to give a description to the user of the type of
+ a block. The debugger makes no other assumptions about the meaning of any
+ of these. For example, the fact that a block is executable (e.g., program)
+ or not (e.g., module) is expressed in block attributes (see below), not
+ guessed at from the block type.
+ */
+typedef enum
+ {
+ dst_block_module, /* some pascal = modula = ada types */
+ dst_block_program,
+ dst_block_procedure,
+ dst_block_function, /* C function */
+ dst_block_subroutine, /* some fortran block types */
+ dst_block_block_data,
+ dst_block_stmt_function,
+ dst_block_package, /* a few particular to Ada */
+ dst_block_package_body,
+ dst_block_subunit,
+ dst_block_task,
+ dst_block_file, /* a C outer scope? */
+ dst_block_class, /* C++ or Simula */
+ dst_block_END_OF_ENUM
+ }
+dst_block_type_t;
+
+/* Block attributes. This is the information used by the debugger to represent
+ the semantics of blocks.
+ */
+typedef enum
+ {
+ dst_block_main_entry, /* the block's entry point is a main entry into
+ the compilation unit */
+ dst_block_executable, /* the block has an entry point */
+ dst_block_attr_END_OF_ENUM
+ }
+dst_block_attr_t;
+
+/* Code range. Each block has associated with it one or more code ranges. An
+ individual code range is identified by a range of source (possibly nil) and
+ a range of executable code. For example, a block which has its executable
+ code spread over multiple sections will have one code range per section.
+ */
+typedef struct
+ {
+ unsigned long code_size; /* size of executable code (in bytes ) */
+ dst_sect_ref_t code_start; /* starting address of executable code */
+ dst_sect_ref_t lines_start; /* start of line number tables */
+ }
+dst_code_range_t;
+
+typedef struct
+ {
+ dst_block_type_t block_type:8;
+ unsigned short flags:8; /* mask of dst_block_attr_t flags */
+ dst_rel_offset_t sibling_block_off; /* offset to next sibling block */
+ dst_rel_offset_t child_block_off; /* offset to first contained block */
+ dst_rel_offset_t noffset; /* offset to block name string */
+ dst_sect_ref_t symbols_start; /* start of debug symbols */
+ unsigned short n_of_code_ranges; /* size of array... */
+ dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1;
+ }
+dst_rec_block_t ALIGNED1;
+
+
+/*--------------------------
+ AUX SECT INFO TABLE record
+ --------------------------
+ Appears as an auxiliary to a block record. Expands code range information
+ by providing references into additional, language-dependent sections for
+ information related to specific code ranges of the block. Sect info table
+ entries parallel code range array entries of the same index.
+*/
+
+typedef struct
+ {
+ unsigned char tag; /* currently can only be zero */
+ unsigned char number_of_refs; /* size of array: */
+ dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1;
+ }
+dst_rec_sect_info_tab_t ALIGNED1;
+
+/*=================================================*/
+/*========== RECORDS IN .symbols SECTION ==========*/
+/*=================================================*/
+
+/*-----------------
+ CONSTANT record
+ -----------------
+ Describes a symbolic constant.
+*/
+
+typedef struct
+ {
+ float r; /* real part */
+ float i; /* imaginary part */
+ }
+dst_complex_t;
+
+typedef struct
+ {
+ double dr; /* real part */
+ double di; /* imaginary part */
+ }
+dst_double_complex_t;
+
+/* The following record provides a way of describing constant values with
+ non-standard type and no limit on size.
+ */
+typedef union
+ {
+ char char_data[dst_dummy_array_size];
+ short int_data[dst_dummy_array_size];
+ long long_data[dst_dummy_array_size];
+ }
+dst_big_kon_t;
+
+/* Representation of the value of a general constant.
+ */
+typedef struct
+ {
+ unsigned short length; /* size of constant value (bytes) */
+
+ union
+ {
+ unsigned short kon_int8;
+ short kon_int16;
+ long kon_int32 ALIGNED1;
+ float kon_real ALIGNED1;
+ double kon_dbl ALIGNED1;
+ dst_complex_t kon_cplx ALIGNED1;
+ dst_double_complex_t kon_dcplx ALIGNED1;
+ char kon_char;
+ dst_big_kon_t kon ALIGNED1;
+ }
+ val; /* value data of constant */
+ }
+dst_const_t ALIGNED1;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of const definition */
+ dst_type_t type_desc; /* type of this (manifest) constant */
+ dst_const_t value;
+ }
+dst_rec_const_t ALIGNED1;
+
+/*----------------
+ VARIABLE record
+ ----------------
+ Describes a program variable.
+*/
+
+/* Variable attributes. These define certain variable semantics to the
+ debugger.
+ */
+typedef enum
+ {
+ dst_var_attr_read_only, /* is read-only (a program literal) */
+ dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */
+ dst_var_attr_global, /* is a global definition or reference */
+ dst_var_attr_compiler_gen, /* is compiler-generated */
+ dst_var_attr_static, /* has static location */
+ dst_var_attr_END_OF_ENUM
+ }
+dst_var_attr_t;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_rel_offset_t loffset; /* offset to loc string */
+ dst_src_loc_t src_loc; /* file/line of variable definition */
+ dst_type_t type_desc; /* type descriptor */
+ unsigned short attributes; /* mask of dst_var_attr_t flags */
+ }
+dst_rec_variable_t ALIGNED1;
+
+
+/*----------------
+ old VAR record
+ -----------------
+ Used by older compilers to describe a variable
+*/
+
+typedef enum
+ {
+ dst_var_loc_unknown, /* Actually defined as "unknown" */
+ dst_var_loc_abs, /* Absolute address */
+ dst_var_loc_sect_off, /* Absolute address as a section offset */
+ dst_var_loc_ind_sect_off, /* An indexed section offset ???? */
+ dst_var_loc_reg, /* register */
+ dst_var_loc_reg_rel, /* register relative - usually fp */
+ dst_var_loc_ind_reg_rel, /* Indexed register relative */
+ dst_var_loc_ftn_ptr_based, /* Fortran pointer based */
+ dst_var_loc_pc_rel, /* PC relative. Really. */
+ dst_var_loc_external, /* External */
+ dst_var_loc_END_OF_ENUM
+ }
+dst_var_loc_t;
+
+/* Locations come in two versions. The short, and the long. The difference
+ * between the short and the long is the addition of a statement number
+ * field to the start andend of the range of the long, and and unkown
+ * purpose field in the middle. Also, loc_type and loc_index aren't
+ * bitfields in the long version.
+ */
+
+typedef struct
+ {
+ unsigned short loc_type:4;
+ unsigned short loc_index:12;
+ long location;
+ short start_line; /* start_line and end_line? */
+ short end_line; /* I'm guessing here. */
+ }
+dst_var_loc_short_t;
+
+typedef struct
+ {
+ unsigned short loc_type;
+ unsigned short loc_index;
+ long location;
+ short unknown; /* Always 0003 or 3b3c. Why? */
+ short start_statement;
+ short start_line;
+ short end_statement;
+ short end_line;
+ }
+dst_var_loc_long_t;
+
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of description */
+ dst_type_t type_desc; /* Type description */
+ unsigned short attributes; /* mask of dst_var_attr_t flags */
+ unsigned short no_of_locs:15; /* Number of locations */
+ unsigned short short_locs:1; /* True if short locations. */
+ union
+ {
+ dst_var_loc_short_t shorts[dst_dummy_array_size];
+ dst_var_loc_long_t longs[dst_dummy_array_size];
+ }
+ locs;
+ }
+dst_rec_var_t;
+
+/*----------------
+ old LABEL record
+ -----------------
+ Used by older compilers to describe a label
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of description */
+ char location[12]; /* location string */
+ }
+dst_rec_old_label_t ALIGNED1;
+
+/*----------------
+ POINTER record
+ ----------------
+ Describes a pointer type.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to the name string for this type */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_type_t type_desc; /* base type of this pointer */
+ }
+dst_rec_pointer_t ALIGNED1;
+
+
+/*-------------
+ ARRAY record
+ -------------
+ Describes an array type.
+
+ Multidimensional arrays are described with a number of dst_rec_array_t
+ records, one per array dimension, each linked to the next through the
+ elem_type_desc.doffset field. Each record must have its multi_dim flag
+ set.
+
+ If column_major is true (as with FORTRAN arrays) then the last array bound in
+ the declaration is the first array index in memory, which is the opposite of
+ the usual case (as with Pascal and C arrays).
+
+ Variable array bounds are described by auxiliary records; if aux_var_bound
+ records are present, the lo_bound and hi_bound fields of this record are
+ ignored by the debugger.
+
+ span_comp identifies one of the language-dependent ways in which the distance
+ between successive array elements (span) is calculated.
+ dst_use_span_field -- the span is the value of span field.
+ dst_compute_from_prev -- the span is the size of the previous dimension.
+ dst_compute_from_next -- the span is the size of the next dimension.
+ In the latter two cases, the span field contains an amount of padding to add
+ to the size of the appropriate dimension to calculate the span.
+*/
+
+typedef enum
+ {
+ dst_use_span_field,
+ dst_compute_from_prev,
+ dst_compute_from_next,
+ dst_span_comp_END_OF_ENUM
+ }
+dst_span_comp_t;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_type_t elem_type_desc; /* array element type */
+ dst_type_t indx_type_desc; /* array index type */
+ long lo_bound; /* lower bound of index */
+ long hi_bound; /* upper bound of index */
+ unsigned long span; /* see above */
+ unsigned long size; /* total array size (bytes) */
+ boolean multi_dim:1;
+ boolean is_packed:1; /* true if packed array */
+ boolean is_signed:1; /* true if packed elements are signed */
+ dst_span_comp_t span_comp:2; /* how to compute span */
+ boolean column_major:1;
+ unsigned short reserved:2; /* must be zero */
+ unsigned short elem_size:8; /* element size if packed (bits) */
+ }
+dst_rec_array_t ALIGNED1;
+
+
+/*-----------------
+ SUBRANGE record
+ -----------------
+ Describes a subrange type.
+*/
+
+/* Variable subrange bounds are described by auxiliary records; if aux_var_bound
+ records are present, the lo_bound and hi_bound fields of this record are
+ ignored by the debugger.
+ */
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of subrange definition */
+ dst_type_t type_desc; /* parent type */
+ long lo_bound; /* lower bound of subrange */
+ long hi_bound; /* upper bound of subrange */
+ unsigned short size; /* storage size (bytes) */
+ }
+dst_rec_subrange_t ALIGNED1;
+
+
+/*---------------
+ STRING record
+ ---------------
+ Describes a string type.
+*/
+
+/* Variable subrange bounds are described by auxiliary records; if aux_var_bound
+ records are present, the lo_bound and hi_bound fields of this record are
+ ignored by the debugger.
+ */
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of string definition */
+ dst_type_t elem_type_desc; /* element type */
+ dst_type_t indx_type_desc; /* index type */
+ long lo_bound; /* lower bound */
+ long hi_bound; /* upper bound */
+ unsigned long size; /* total string size (bytes) if fixed */
+ }
+dst_rec_string_t ALIGNED1;
+
+
+/*---------------
+ SET record
+ ---------------
+ Describes a set type.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_type_t type_desc; /* element type */
+ unsigned short nbits; /* number of bits in set */
+ unsigned short size; /* storage size (bytes) */
+ }
+dst_rec_set_t ALIGNED1;
+
+
+/*-----------------------------
+ IMPLICIT ENUMERATION record
+ -----------------------------
+ Describes an enumeration type with implicit element values = 0, 1, 2, ...
+ (Pascal-style).
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ unsigned short nelems; /* number of elements in enumeration */
+ unsigned short size; /* storage size (bytes) */
+ /* offsets to name strings of elements 0, 1, 2, ... */
+ dst_rel_offset_t elem_noffsets[dst_dummy_array_size];
+ }
+dst_rec_implicit_enum_t ALIGNED1;
+
+
+/*-----------------------------
+ EXPLICIT ENUMERATION record
+ -----------------------------
+ Describes an enumeration type with explicitly assigned element values
+ (C-style).
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to element name string */
+ long value; /* element value */
+ }
+dst_enum_elem_t;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ unsigned short nelems; /* number of elements in enumeration */
+ unsigned short size; /* storage size (bytes) */
+ /* name/value pairs, one describing each enumeration value: */
+ dst_enum_elem_t elems[dst_dummy_array_size];
+ }
+dst_rec_explicit_enum_t ALIGNED1;
+
+
+/*-----------------------
+ RECORD / UNION record
+ -----------------------
+ Describes a record (struct) or union.
+
+ If the record is larger than 2**16 bytes then an attached aux record
+ specifies its size. Also, if the record is stored in short form then
+ attached records specify field offsets larger than 2**16 bytes.
+
+ Whether the fields[] array or sfields[] array is used is selected by
+ the dst_rec_type_t of the overall dst record.
+*/
+
+/*
+ Record field descriptor, short form. This form handles only fields which
+ are an even number of bytes long, located some number of bytes from the
+ start of the record.
+ */
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to field name string */
+ dst_type_t type_desc; /* field type */
+ unsigned short foffset; /* field offset from start of record (bytes) */
+ }
+dst_short_field_t ALIGNED1;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_type_t type_desc; /* field type */
+ unsigned short foffset; /* byte offset */
+ unsigned short is_packed:1; /* True if field is packed */
+ unsigned short bit_offset:6; /* Bit offset */
+ unsigned short size:6; /* Size in bits */
+ unsigned short sign:1; /* True if signed */
+ unsigned short pad:2; /* Padding. Must be 0 */
+ }
+dst_old_field_t ALIGNED1;
+
+/* Tag enumeration for long record field descriptor:
+ */
+typedef enum
+ {
+ dst_field_byte,
+ dst_field_bit,
+ dst_field_loc,
+ dst_field_END_OF_ENUM
+ }
+dst_field_format_t;
+
+/*
+ Record field descriptor, long form. The format of the field information
+ is identified by the format_tag, which contains one of the above values.
+ The field_byte variant is equivalent to the short form of field descriptor.
+ The field_bit variant handles fields which are any number of bits long,
+ located some number of bits from the start of the record. The field_loc
+ variant allows the location of the field to be described by a general loc
+ string.
+ */
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name of field */
+ dst_type_t type_desc; /* type of field */
+ union
+ {
+ struct
+ {
+ dst_field_format_t format_tag:2; /* dst_field_byte */
+ unsigned long offset:30; /* offset of field in bytes */
+ }
+ field_byte ALIGNED1;
+ struct
+ {
+ dst_field_format_t format_tag:2; /* dst_field_bit */
+ unsigned long nbits:6; /* bit size of field */
+ unsigned long is_signed:1; /* signed/unsigned attribute */
+ unsigned long bit_offset:3; /* bit offset from byte boundary */
+ int pad:4; /* must be zero */
+ unsigned short byte_offset; /* offset of byte boundary */
+ }
+ field_bit ALIGNED1;
+ struct
+ {
+ dst_field_format_t format_tag:2; /* dst_field_loc */
+ int loffset:30; /* dst_rel_offset_t to loc string */
+ }
+ field_loc ALIGNED1;
+ }
+ f ALIGNED1;
+ }
+dst_field_t;
+
+/* The field_loc.loffset field is a 30-bit signed value. Some versions of C do
+ not support signed bit fields. The following macro will extract that field
+ as a signed value:
+ */
+#define dst_field_loffset(field_rec) \
+ ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 )
+
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to record name string */
+ dst_src_loc_t src_loc; /* file/line where this record is defined */
+ unsigned short size; /* storage size (bytes) */
+ unsigned short nfields; /* number of fields in this record */
+ union
+ {
+ dst_field_t fields[dst_dummy_array_size];
+ dst_short_field_t sfields[dst_dummy_array_size];
+ dst_old_field_t ofields[dst_dummy_array_size];
+ }
+ f; /* array of fields */
+ }
+dst_rec_record_t ALIGNED1;
+
+
+/*-------------
+ FILE record
+ -------------
+ Describes a file type.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line where type was defined */
+ dst_type_t type_desc; /* file element type */
+ }
+dst_rec_file_t ALIGNED1;
+
+
+/*---------------
+ OFFSET record
+ ---------------
+ Describes a Pascal offset type.
+ (This type, an undocumented Domain Pascal extension, is currently not
+ supported by the debugger)
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to the name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_type_t area_type_desc; /* area type */
+ dst_type_t base_type_desc; /* base type */
+ long lo_bound; /* low bound of the offset range */
+ long hi_bound; /* high bound of the offset range */
+ long bias; /* bias */
+ unsigned short scale; /* scale factor */
+ unsigned short size; /* storage size (bytes) */
+ }
+dst_rec_offset_t ALIGNED1;
+
+
+/*--------------
+ ALIAS record
+ --------------
+ Describes a type alias (e.g., typedef).
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_type_t type_desc; /* parent type */
+ }
+dst_rec_alias_t ALIGNED1;
+
+
+/*------------------
+ SIGNATURE record
+ ------------------
+ Describes a procedure/function type.
+*/
+
+/* Enumeration of argument semantics. Note that most are mutually
+ exclusive.
+ */
+typedef enum
+ {
+ dst_arg_attr_val, /* passed by value */
+ dst_arg_attr_ref, /* passed by reference */
+ dst_arg_attr_name, /* passed by name */
+ dst_arg_attr_in, /* readable in the callee */
+ dst_arg_attr_out, /* writable in the callee */
+ dst_arg_attr_hidden, /* not visible in the caller */
+ dst_arg_attr_END_OF_ENUM
+ }
+dst_arg_attr_t;
+
+/* Argument descriptor. Actually points to a variable record for most of the
+ information.
+ */
+typedef struct
+ {
+ dst_rel_offset_t var_offset; /* offset to variable record */
+ unsigned short attributes; /* a mask of dst_arg_attr_t flags */
+ }
+dst_arg_t ALIGNED1;
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to name string */
+ dst_src_loc_t src_loc; /* file/line of function definition */
+ dst_rel_offset_t result; /* offset to function result variable record */
+ unsigned short nargs; /* number of arguments */
+ dst_arg_t args[dst_dummy_array_size];
+ }
+dst_rec_signature_t ALIGNED1;
+
+/*--------------
+ SCOPE record
+ --------------
+ Obsolete. Use the new ENTRY type instead.
+ Old compilers may put this in as the first entry in a function,
+ terminated by an end of scope entry.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* Name offset */
+ dst_src_loc_t start_line; /* Starting line */
+ dst_src_loc_t end_line; /* Ending line */
+ }
+dst_rec_scope_t ALIGNED1;
+
+/*--------------
+ ENTRY record
+ --------------
+ Describes a procedure/function entry point. An entry record is to a
+ signature record roughly as a variable record is to a type descriptor record.
+
+ The entry_number field is keyed to the entry numbers in .lines -- the
+ debugger locates the code location of an entry by searching the line
+ number table for an entry numbered with the value of entry_number. The
+ main entry is numbered zero.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to entry name string */
+ dst_rel_offset_t loffset; /* where to jump to call this entry */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ dst_rel_offset_t sig_desc; /* offset to signature descriptor */
+ unsigned int entry_number:8;
+ int pad:8; /* must be zero */
+ }
+dst_rec_entry_t ALIGNED1;
+
+/*-----------------------
+ Old format ENTRY record
+ -----------------------
+ Supposedly obsolete but still used by some compilers.
+ */
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* Offset to entry name string */
+ dst_src_loc_t src_loc; /* Location in source */
+ dst_rel_offset_t sig_desc; /* Signature description */
+ char unknown[36];
+ }
+dst_rec_old_entry_t ALIGNED1;
+
+/*--------------
+ LABEL record
+ --------------
+ Describes a program label.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t noffset; /* offset to label string */
+ dst_rel_offset_t loffset; /* offset to loc string */
+ dst_src_loc_t src_loc; /* file/line of definition */
+ }
+dst_rec_label_t ALIGNED1;
+
+
+/*-----------------------
+ AUXILIARY SIZE record
+ -----------------------
+ May appear in the auxiliary record list of any type or variable record to
+ modify the default size of the type or variable.
+*/
+
+typedef struct
+ {
+ unsigned long size; /* size (bytes) */
+ }
+dst_rec_aux_size_t ALIGNED1;
+
+
+/*-----------------------
+ AUXILIARY ALIGN record
+ -----------------------
+ May appear in the auxiliary record list of any type or variable record to
+ modify the default alignment of the type or variable.
+*/
+
+typedef struct
+ {
+ unsigned short alignment; /* # of low order zero bits */
+ }
+dst_rec_aux_align_t ALIGNED1;
+
+
+/*-----------------------------
+ AUXILIARY FIELD SIZE record
+ -----------------------------
+ May appear in the auxiliary record list of any RECORD/UNION record to
+ modify the default size of a field.
+*/
+
+typedef struct
+ {
+ unsigned short field_no; /* field number */
+ unsigned long size; /* size (bits) */
+ }
+dst_rec_aux_field_size_t ALIGNED1;
+
+
+
+/*-----------------------------
+ AUXILIARY FIELD OFFSET record
+ -----------------------------
+ May appear in the auxiliary record list of any RECORD/UNION record to
+ specify a field offset larger than 2**16.
+*/
+
+typedef struct
+ {
+ unsigned short field_no; /* field number */
+ unsigned long foffset; /* offset */
+ }
+dst_rec_aux_field_off_t ALIGNED1;
+
+
+/*-----------------------------
+ AUXILIARY FIELD ALIGN record
+ -----------------------------
+ May appear in the auxiliary record list of any RECORD/UNION record to
+ modify the default alignment of a field.
+*/
+
+typedef struct
+ {
+ unsigned short field_no; /* field number */
+ unsigned short alignment; /* number of low order zero bits */
+ }
+dst_rec_aux_field_align_t ALIGNED1;
+
+
+/*----------------------------
+ AUXILIARY VAR BOUND record
+ ----------------------------
+ May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING
+ record to describe a variable bound for the range of the type.
+*/
+
+typedef enum
+ {
+ dst_low_bound, /* the low bound is variable */
+ dst_high_bound, /* the high bound is variable */
+ dst_var_bound_END_OF_ENUM
+ }
+dst_var_bound_t;
+
+typedef struct
+ {
+ unsigned short which; /* which bound */
+ dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */
+ }
+dst_rec_aux_var_bound_t ALIGNED1;
+
+
+/*----------------------------------
+ AUXILIARY TYPE DERIVATION record
+ ----------------------------------
+ May appear in the auxiliary record list of any RECORD/UNION record to denote
+ class inheritance of that type from a parent type.
+
+ Inheritance implies that it is possible to convert the inheritor type to the
+ inherited type, retaining those fields which were inherited. To allow this,
+ orig_field_no, a field number into the record type, is provided. If
+ orig_is_pointer is false, then the start of the inherited record is located
+ at the location of the field indexed by orig_field_no. If orig_is_pointer
+ is true, then it is located at the address contained in the field indexed
+ by orig_field_no (assumed to be a pointer).
+*/
+
+typedef struct
+ {
+ dst_type_t parent_type; /* reference to inherited type */
+ unsigned short orig_field_no;
+ boolean orig_is_pointer:1;
+ int unused:15; /* must be zero */
+ }
+dst_rec_aux_type_deriv_t ALIGNED1;
+
+
+/*------------------------------------
+ AUXILIARY VARIABLE LIFETIME record
+ ------------------------------------
+ May appear in the auxiliary record list of a VARIABLE record to add location
+ information for an additional variable lifetime.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t loffset;
+ }
+dst_rec_aux_lifetime_t ALIGNED1;
+
+
+/*-------------------------------
+ AUXILIARY POINTER BASE record
+ -------------------------------
+ May appear in the auxiliary record list of a VARIABLE record to provide a
+ pointer base to substitute for references to any such bases in the location
+ string of the variable. A pointer base is another VARIABLE record. When
+ the variable is evaluated by the debugger, it uses the current value of the
+ pointer base variable in computing its location.
+
+ This is useful for representing FORTRAN pointer-based variables.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t voffset;
+ }
+dst_rec_aux_ptr_base_t ALIGNED1;
+
+
+/*---------------------------------
+ AUXILIARY REGISTER VALUE record
+ ---------------------------------
+ May appear in the auxiliary record list of an ENTRY record to specify
+ a register that must be set to a specific value before jumping to the entry
+ point in a debugger "call". The debugger must set the debuggee register,
+ specified by the register code, to the value of the *address* to which the
+ location string resolves. If the address is register-relative, then the
+ call cannot be made unless the current stack frame is the lexical parent
+ of the entry. An example of this is when a (Pascal) nested procedure
+ contains references to its parent's variables, which it accesses through
+ a static link register. The static link register must be set to some
+ address relative to the parent's stack base register.
+*/
+
+typedef struct
+ {
+ unsigned short reg; /* identifies register to set (isp enum) */
+ dst_rel_offset_t loffset; /* references a location string */
+ }
+dst_rec_aux_reg_val_t ALIGNED1;
+
+
+/*==========================================================*/
+/*========== RECORDS USED IN .blocks AND .symbols ==========*/
+/*==========================================================*/
+
+/*---------------------
+ STRING TABLE record
+ ---------------------
+ A string table record contains any number of null-terminated, variable length
+ strings. The length field gives the size in bytes of the text field, which
+ can be any size.
+
+ The global name table shares this format. This record appears in the
+ .blocks section. Each string in the table identifies a global defined in
+ the current compilation unit.
+
+ The loc pool record shares this format as well. Loc strings are described
+ elsewhere.
+*/
+
+typedef struct
+ {
+ unsigned long length;
+ char text[dst_dummy_array_size];
+ }
+dst_rec_string_tab_t ALIGNED1;
+
+
+/*-----------------------
+ AUXILIARY QUAL record
+ -----------------------
+ May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record
+ to provide it with a fully-qualified, language-dependent name.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t lang_qual_name;
+ }
+dst_rec_aux_qual_t ALIGNED1;
+
+
+/*----------------
+ FORWARD record
+ ----------------
+ Reference to a record somewhere else. This allows identical definitions in
+ different scopes to share data.
+*/
+
+typedef struct
+ {
+ dst_rel_offset_t rec_off;
+ }
+dst_rec_forward_t ALIGNED1;
+
+
+/*-------------------------------
+ AUXILIARY SOURCE RANGE record
+ -------------------------------
+ May appear in the auxiliary record list of any BLOCK record to specify a
+ range of source lines over which the block is active.
+*/
+
+typedef struct
+ {
+ dst_src_loc_t first_line; /* first source line */
+ dst_src_loc_t last_line; /* last source line */
+ }
+dst_rec_aux_src_range_t ALIGNED1;
+
+
+/*------------------
+ EXTENSION record
+ ------------------
+ Provision for "foreign" records, such as might be generated by a non-Apollo
+ compiler. Apollo software will ignore these.
+*/
+
+typedef struct
+ {
+ unsigned short rec_size; /* record size (bytes) */
+ unsigned short ext_type; /* defined by whoever generates it */
+ unsigned short ext_data; /* place-holder for arbitrary amount of data */
+ }
+dst_rec_extension_t ALIGNED1;
+
+
+/*
+ ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records.
+ **
+ ** This record ties together all previous .blocks and .symbols records
+ ** together in a union with a common header. The rec_type field of the
+ ** header identifies the record type. The rec_flags field currently only
+ ** defines auxiliary record lists.
+ **
+ ** If a record carries with it a non-null auxiliary record list, its
+ ** dst_flag_has_aux_recs flag is set, and each of the records that follow
+ ** it are treated as its auxiliary records, until the end of the compilation
+ ** unit or scope is reached, or until an auxiliary record with its
+ ** dst_flag_last_aux_rec flag set is reached.
+ */
+
+typedef enum
+ {
+ dst_flag_has_aux_recs,
+ dst_flag_last_aux_rec,
+ dst_rec_flag_END_OF_ENUM
+ }
+dst_rec_flags_t;
+
+typedef struct
+ {
+ dst_rec_type_t rec_type:8; /* record type */
+ int rec_flags:8; /* mask of dst_rec_flags_t */
+ union /* switched on rec_type field above */
+ {
+ /* dst_typ_pad requires no additional fields */
+ dst_rec_comp_unit_t comp_unit_;
+ dst_rec_section_tab_t section_tab_;
+ dst_rec_file_tab_t file_tab_;
+ dst_rec_block_t block_;
+ dst_rec_var_t var_;
+ dst_rec_pointer_t pointer_;
+ dst_rec_array_t array_;
+ dst_rec_subrange_t subrange_;
+ dst_rec_set_t set_;
+ dst_rec_implicit_enum_t implicit_enum_;
+ dst_rec_explicit_enum_t explicit_enum_;
+ /* dst_typ_short_{rec,union} are represented by 'rec' (below) */
+ dst_rec_file_t file_;
+ dst_rec_offset_t offset_;
+ dst_rec_alias_t alias_;
+ dst_rec_signature_t signature_;
+ dst_rec_old_label_t old_label_;
+ dst_rec_scope_t scope_;
+ /* dst_typ_end_scope requires no additional fields */
+ dst_rec_string_tab_t string_tab_;
+ /* dst_typ_global_name_tab is represented by 'string_tab' (above) */
+ dst_rec_forward_t forward_;
+ dst_rec_aux_size_t aux_size_;
+ dst_rec_aux_align_t aux_align_;
+ dst_rec_aux_field_size_t aux_field_size_;
+ dst_rec_aux_field_off_t aux_field_off_;
+ dst_rec_aux_field_align_t aux_field_align_;
+ dst_rec_aux_qual_t aux_qual_;
+ dst_rec_aux_var_bound_t aux_var_bound_;
+ dst_rec_extension_t extension_;
+ dst_rec_string_t string_;
+ dst_rec_const_t const_;
+ /* dst_typ_reference is represented by 'pointer' (above) */
+ dst_rec_record_t record_;
+ /* dst_typ_union is represented by 'record' (above) */
+ dst_rec_aux_type_deriv_t aux_type_deriv_;
+ /* dst_typ_locpool is represented by 'string_tab' (above) */
+ dst_rec_variable_t variable_;
+ dst_rec_label_t label_;
+ dst_rec_entry_t entry_;
+ dst_rec_aux_lifetime_t aux_lifetime_;
+ dst_rec_aux_ptr_base_t aux_ptr_base_;
+ dst_rec_aux_src_range_t aux_src_range_;
+ dst_rec_aux_reg_val_t aux_reg_val_;
+ dst_rec_name_tab_t aux_unit_names_;
+ dst_rec_sect_info_tab_t aux_sect_info_;
+ }
+ rec_data ALIGNED1;
+ }
+dst_rec_t, *dst_rec_ptr_t;
+
+
+/*===============================================*/
+/*========== .lines SECTION DEFINITIONS =========*/
+/*===============================================*/
+/*
+ The .lines section contains a sequence of line number tables. There is no
+ record structure within the section. The start of the table for a routine
+ is pointed to by the block record, and the end of the table is signaled by
+ an escape code.
+
+ A line number table is a sequence of bytes. The default entry contains a line
+ number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4
+ bits. Special cases, including when one or both of the values is too large
+ to fit in 4 bits and other special cases are handled through escape entries.
+ Escape entries are identified by the value 0x8 in the high 4 bits. The low 4
+ bits are occupied by a function code. Some escape entries are followed by
+ additional arguments, which may be bytes, words, or longwords. This data is
+ not aligned.
+
+ The initial PC offset, file number and line number are zero. Normally, the
+ table begins with a dst_ln_file escape which establishes the initial file
+ and line number. All PC deltas are unsigned (thus the table is ordered by
+ increasing PC); line number deltas are signed. The table ends with a
+ dst_ln_end escape, which is followed by a final table entry whose PC delta
+ gives the code size of the last statement.
+
+ Escape Semantic
+ --------- ------------------------------------------------------------
+ file Changes file state. The current source file remains constant
+ until another file escape. Though the line number state is
+ also updated by a file escape, a file escape does NOT
+ constitute a line table entry.
+
+ statement Alters the statement number of the next table entry. By
+ default, all table entries refer to the first statement on a
+ line. Statement number one is the second statement, and so on.
+
+ entry Identifies the next table entry as the position of an entry
+ point for the current block. The PC position should follow
+ any procedure prologue code. An argument specifies the entry
+ number, which is keyed to the entry number of the corresponding
+ .symbols ENTRY record.
+
+ exit Identifies the next table entry as the last position within
+ the current block before a procedure epiloge and subsequent
+ procedure exit.
+
+ gap By default, the executable code corresponding to a table entry
+ is assumed to extend to the beginning of the next table entry.
+ If this is not the case--there is a "hole" in the table--then
+ a gap escape should follow the first table entry to specify
+ where the code for that entry ends.
+ */
+
+#define dst_ln_escape_flag -8
+
+/*
+ Escape function codes:
+ */
+typedef enum
+ {
+ dst_ln_pad, /* pad byte */
+ dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */
+ dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */
+ dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */
+ dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
+ dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */
+ dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */
+ dst_ln_ln_off, /* statement escape, stmt # = next byte */
+ dst_ln_entry, /* entry escape, next byte is entry number */
+ dst_ln_exit, /* exit escape */
+ dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */
+ dst_ln_escape_11, /* reserved */
+ dst_ln_escape_12, /* reserved */
+ dst_ln_escape_13, /* reserved */
+ dst_ln_nxt_byte, /* next byte contains the real escape code */
+ dst_ln_end, /* end escape, final entry follows */
+ dst_ln_escape_END_OF_ENUM
+ }
+dst_ln_escape_t;
+
+/*
+ Line number table entry
+ */
+typedef union
+ {
+ struct
+ {
+ unsigned int ln_delta:4; /* 4 bit line number delta */
+ unsigned int pc_delta:4; /* 4 bit pc delta */
+ }
+ delta;
+
+ struct
+ {
+ unsigned int esc_flag:4; /* alias for ln_delta */
+ dst_ln_escape_t esc_code:4; /* escape function code */
+ }
+ esc;
+
+ char sdata; /* signed data byte */
+ unsigned char udata; /* unsigned data byte */
+ }
+dst_ln_entry_t,
+ *dst_ln_entry_ptr_t,
+ dst_ln_table_t[dst_dummy_array_size];
+
+/* The following macro will extract the ln_delta field as a signed value:
+ */
+#define dst_ln_ln_delta(ln_rec) \
+ ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 )
+
+
+
+
+typedef struct dst_sec_struct
+ {
+ char *buffer;
+ long position;
+ long size;
+ long base;
+ }
+dst_sec;
+
+
+/* Macros for access to the data */
+
+#define DST_comp_unit(x) ((x)->rec_data.comp_unit_)
+#define DST_section_tab(x) ((x)->rec_data.section_tab_)
+#define DST_file_tab(x) ((x)->rec_data.file_tab_)
+#define DST_block(x) ((x)->rec_data.block_)
+#define DST_var(x) ((x)->rec_data.var_)
+#define DST_pointer(x) ((x)->rec_data.pointer_)
+#define DST_array(x) ((x)->rec_data.array_)
+#define DST_subrange(x) ((x)->rec_data.subrange_)
+#define DST_set(x) ((x)->rec_data.set_)
+#define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_)
+#define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_)
+#define DST_short_rec(x) ((x)->rec_data.record_)
+#define DST_short_union(x) ((x)->rec_data.record_)
+#define DST_file(x) ((x)->rec_data.file_)
+#define DST_offset(x) ((x)->rec_data.offset_)
+#define DST_alias(x) ((x)->rec_data.alias_)
+#define DST_signature(x) ((x)->rec_data.signature_)
+#define DST_old_label(x) ((x)->rec_data.old_label_)
+#define DST_scope(x) ((x)->rec_data.scope_)
+#define DST_string_tab(x) ((x)->rec_data.string_tab_)
+#define DST_global_name_tab(x) ((x)->rec_data.string_tab_)
+#define DST_forward(x) ((x)->rec_data.forward_)
+#define DST_aux_size(x) ((x)->rec_data.aux_size_)
+#define DST_aux_align(x) ((x)->rec_data.aux_align_)
+#define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_)
+#define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_)
+#define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_)
+#define DST_aux_qual(x) ((x)->rec_data.aux_qual_)
+#define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_)
+#define DST_extension(x) ((x)->rec_data.extension_)
+#define DST_string(x) ((x)->rec_data.string_)
+#define DST_const(x) ((x)->rec_data.const_)
+#define DST_reference(x) ((x)->rec_data.pointer_)
+#define DST_record(x) ((x)->rec_data.record_)
+#define DST_union(x) ((x)->rec_data.record_)
+#define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_)
+#define DST_locpool(x) ((x)->rec_data.string_tab_)
+#define DST_variable(x) ((x)->rec_data.variable_)
+#define DST_label(x) ((x)->rec_data.label_)
+#define DST_entry(x) ((x)->rec_data.entry_)
+#define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_)
+#define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_)
+#define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_)
+#define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_)
+#define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_)
+#define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_)
+
+
+/*
+ * Type codes for loc strings. I'm not entirely certain about all of
+ * these, but they seem to work.
+ * troy@cbme.unsw.EDU.AU
+ * If you find a variable whose location can't be decoded, you should
+ * find out it's code using "dstdump -s filename". It will record an
+ * entry for the variable, and give a text representation of what
+ * the locstring means. Before that explaination there will be a
+ * number. In the LOCSTRING table, that number will appear before
+ * the start of the location string. Location string codes are
+ * five bit codes with a 3 bit argument. Check the high 5 bits of
+ * the one byte code, and figure out where it goes in here.
+ * Then figure out exactly what the meaning is and code it in
+ * dstread.c
+ *
+ * Note that ranged locs mean that the variable is in different locations
+ * depending on the current PC. We ignore these because (a) gcc can't handle
+ * them, and (b), If you don't use high levels of optimisation they won't
+ * occur.
+ */
+typedef enum
+ {
+ dst_lsc_end, /* End of string */
+ dst_lsc_indirect, /* Indirect through previous. Arg == 6 */
+ /* Or register ax (x=arg) */
+ dst_lsc_dreg, /* register dx (x=arg) */
+ dst_lsc_03,
+ dst_lsc_section, /* Section (arg+1) */
+ dst_lsc_05,
+ dst_lsc_06,
+ dst_lsc_add, /* Add (arg+1)*2 */
+ dst_lsc_sub, /* Subtract (arg+1)*2 */
+ dst_lsc_09,
+ dst_lsc_0a,
+ dst_lsc_sec_byte, /* Section of next byte+1 */
+ dst_lsc_add_byte, /* Add next byte (arg == 5) or next word
+ * (arg == 6)
+ */
+ dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next
+ * word (arg == 6 ?)
+ */
+ dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0 */
+ dst_lsc_0f,
+ dst_lsc_ranged, /* location is pc dependent */
+ dst_lsc_11,
+ dst_lsc_12,
+ dst_lsc_13,
+ dst_lsc_14,
+ dst_lsc_15,
+ dst_lsc_16,
+ dst_lsc_17,
+ dst_lsc_18,
+ dst_lsc_19,
+ dst_lsc_1a,
+ dst_lsc_1b,
+ dst_lsc_1c,
+ dst_lsc_1d,
+ dst_lsc_1e,
+ dst_lsc_1f
+ }
+dst_loc_string_code_t;
+
+/* If the following occurs after an addition/subtraction, that addition
+ * or subtraction should be multiplied by 256. It's a complete byte, not
+ * a code.
+ */
+
+#define dst_multiply_256 ((char) 0x73)
+
+typedef struct
+ {
+ char code:5;
+ char arg:3;
+ }
+dst_loc_header_t ALIGNED1;
+
+typedef union
+ {
+ dst_loc_header_t header;
+ char data;
+ }
+dst_loc_entry_t ALIGNED1;
+
+#undef ALIGNED1
+#endif /* apollo_dst_h */
diff --git a/contrib/gdb/gdb/dstread.c b/contrib/gdb/gdb/dstread.c
new file mode 100644
index 0000000..c3a73f0
--- /dev/null
+++ b/contrib/gdb/gdb/dstread.c
@@ -0,0 +1,1607 @@
+/* Read apollo DST symbol tables and convert to internal format, for GDB.
+ Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "breakpoint.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "buildsym.h"
+#include "obstack.h"
+
+#include "gdb_string.h"
+
+#include "dst.h"
+
+CORE_ADDR cur_src_start_addr, cur_src_end_addr;
+dst_sec blocks_info, lines_info, symbols_info;
+
+/* Vector of line number information. */
+
+static struct linetable *line_vector;
+
+/* Index of next entry to go in line_vector_index. */
+
+static int line_vector_index;
+
+/* Last line number recorded in the line vector. */
+
+static int prev_line_number;
+
+/* Number of elements allocated for line_vector currently. */
+
+static int line_vector_length;
+
+static int init_dst_sections (int);
+
+static void read_dst_symtab (struct objfile *);
+
+static void find_dst_sections (bfd *, sec_ptr, PTR);
+
+static void dst_symfile_init (struct objfile *);
+
+static void dst_new_init (struct objfile *);
+
+static void dst_symfile_read (struct objfile *, int);
+
+static void dst_symfile_finish (struct objfile *);
+
+static void dst_end_symtab (struct objfile *);
+
+static void complete_symtab (char *, CORE_ADDR, unsigned int);
+
+static void dst_start_symtab (void);
+
+static void dst_record_line (int, CORE_ADDR);
+
+/* Manage the vector of line numbers. */
+/* FIXME: Use record_line instead. */
+
+static void
+dst_record_line (int line, CORE_ADDR pc)
+{
+ struct linetable_entry *e;
+ /* Make sure line vector is big enough. */
+
+ if (line_vector_index + 2 >= line_vector_length)
+ {
+ line_vector_length *= 2;
+ line_vector = (struct linetable *)
+ xrealloc ((char *) line_vector, sizeof (struct linetable)
+ + (line_vector_length
+ * sizeof (struct linetable_entry)));
+ }
+
+ e = line_vector->item + line_vector_index++;
+ e->line = line;
+ e->pc = pc;
+}
+
+/* Start a new symtab for a new source file.
+ It indicates the start of data for one original source file. */
+/* FIXME: use start_symtab, like coffread.c now does. */
+
+static void
+dst_start_symtab (void)
+{
+ /* Initialize the source file line number information for this file. */
+
+ if (line_vector) /* Unlikely, but maybe possible? */
+ xfree (line_vector);
+ line_vector_index = 0;
+ line_vector_length = 1000;
+ prev_line_number = -2; /* Force first line number to be explicit */
+ line_vector = (struct linetable *)
+ xmalloc (sizeof (struct linetable)
+ + line_vector_length * sizeof (struct linetable_entry));
+}
+
+/* Save the vital information from when starting to read a file,
+ for use when closing off the current file.
+ NAME is the file name the symbols came from, START_ADDR is the first
+ text address for the file, and SIZE is the number of bytes of text. */
+
+static void
+complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
+{
+ last_source_file = savestring (name, strlen (name));
+ cur_src_start_addr = start_addr;
+ cur_src_end_addr = start_addr + size;
+
+ if (current_objfile->ei.entry_point >= cur_src_start_addr &&
+ current_objfile->ei.entry_point < cur_src_end_addr)
+ {
+ current_objfile->ei.entry_file_lowpc = cur_src_start_addr;
+ current_objfile->ei.entry_file_highpc = cur_src_end_addr;
+ }
+}
+
+/* Finish the symbol definitions for one main source file,
+ close off all the lexical contexts for that file
+ (creating struct block's for them), then make the
+ struct symtab for that file and put it in the list of all such. */
+/* FIXME: Use end_symtab, like coffread.c now does. */
+
+static void
+dst_end_symtab (struct objfile *objfile)
+{
+ register struct symtab *symtab;
+ register struct blockvector *blockvector;
+ register struct linetable *lv;
+
+ /* Create the blockvector that points to all the file's blocks. */
+
+ blockvector = make_blockvector (objfile);
+
+ /* Now create the symtab object for this source file. */
+ symtab = allocate_symtab (last_source_file, objfile);
+
+ /* Fill in its components. */
+ symtab->blockvector = blockvector;
+ symtab->free_code = free_linetable;
+ symtab->free_ptr = 0;
+ symtab->filename = last_source_file;
+ symtab->dirname = NULL;
+ symtab->debugformat = obsavestring ("Apollo DST", 10,
+ &objfile->symbol_obstack);
+ lv = line_vector;
+ lv->nitems = line_vector_index;
+ symtab->linetable = (struct linetable *)
+ xrealloc ((char *) lv, (sizeof (struct linetable)
+ + lv->nitems * sizeof (struct linetable_entry)));
+
+ free_named_symtabs (symtab->filename);
+
+ /* Reinitialize for beginning of new file. */
+ line_vector = 0;
+ line_vector_length = -1;
+ last_source_file = NULL;
+}
+
+/* dst_symfile_init ()
+ is the dst-specific initialization routine for reading symbols.
+
+ We will only be called if this is a DST or DST-like file.
+ BFD handles figuring out the format of the file, and code in symtab.c
+ uses BFD's determination to vector to us.
+
+ The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
+
+static void
+dst_symfile_init (struct objfile *objfile)
+{
+ asection *section;
+ bfd *abfd = objfile->obfd;
+
+ init_entry_point_info (objfile);
+
+}
+
+/* This function is called for every section; it finds the outer limits
+ of the line table (minimum and maximum file offset) so that the
+ mainline code can read the whole thing for efficiency. */
+
+/* ARGSUSED */
+static void
+find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo)
+{
+ int size, count;
+ long base;
+ file_ptr offset, maxoff;
+ dst_sec *section;
+
+/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
+ size = asect->_raw_size;
+ offset = asect->filepos;
+ base = asect->vma;
+/* End of warning */
+
+ section = NULL;
+ if (!strcmp (asect->name, ".blocks"))
+ section = &blocks_info;
+ else if (!strcmp (asect->name, ".lines"))
+ section = &lines_info;
+ else if (!strcmp (asect->name, ".symbols"))
+ section = &symbols_info;
+ if (!section)
+ return;
+ section->size = size;
+ section->position = offset;
+ section->base = base;
+}
+
+
+/* The BFD for this file -- only good while we're actively reading
+ symbols into a psymtab or a symtab. */
+
+static bfd *symfile_bfd;
+
+/* Read a symbol file, after initialization by dst_symfile_init. */
+/* FIXME! Addr and Mainline are not used yet -- this will not work for
+ shared libraries or add_file! */
+
+/* ARGSUSED */
+static void
+dst_symfile_read (struct objfile *objfile, int mainline)
+{
+ bfd *abfd = objfile->obfd;
+ char *name = bfd_get_filename (abfd);
+ int desc;
+ register int val;
+ int num_symbols;
+ int symtab_offset;
+ int stringtab_offset;
+
+ symfile_bfd = abfd; /* Kludge for swap routines */
+
+/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
+ desc = fileno ((FILE *) (abfd->iostream)); /* File descriptor */
+
+ /* Read the line number table, all at once. */
+ bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL);
+
+ val = init_dst_sections (desc);
+ if (val < 0)
+ error ("\"%s\": error reading debugging symbol tables\n", name);
+
+ init_minimal_symbol_collection ();
+ make_cleanup_discard_minimal_symbols ();
+
+ /* Now that the executable file is positioned at symbol table,
+ process it and define symbols accordingly. */
+
+ read_dst_symtab (objfile);
+
+ /* Sort symbols alphabetically within each block. */
+
+ {
+ struct symtab *s;
+ for (s = objfile->symtabs; s != NULL; s = s->next)
+ {
+ sort_symtab_syms (s);
+ }
+ }
+
+ /* Install any minimal symbols that have been collected as the current
+ minimal symbols for this objfile. */
+
+ install_minimal_symbols (objfile);
+}
+
+static void
+dst_new_init (struct objfile *ignore)
+{
+ /* Nothin' to do */
+}
+
+/* Perform any local cleanups required when we are done with a particular
+ objfile. I.E, we are in the process of discarding all symbol information
+ for an objfile, freeing up all memory held for it, and unlinking the
+ objfile struct from the global list of known objfiles. */
+
+static void
+dst_symfile_finish (struct objfile *objfile)
+{
+ /* Nothing to do */
+}
+
+
+/* Get the next line number from the DST. Returns 0 when we hit an
+ * end directive or cannot continue for any other reason.
+ *
+ * Note that ordinary pc deltas are multiplied by two. Apparently
+ * this is what was really intended.
+ */
+static int
+get_dst_line (signed char **buffer, long *pc)
+{
+ static last_pc = 0;
+ static long last_line = 0;
+ static int last_file = 0;
+ dst_ln_entry_ptr_t entry;
+ int size;
+ dst_src_loc_t *src_loc;
+
+ if (*pc != -1)
+ {
+ last_pc = *pc;
+ *pc = -1;
+ }
+ entry = (dst_ln_entry_ptr_t) * buffer;
+
+ while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag)
+ {
+ switch (entry->esc.esc_code)
+ {
+ case dst_ln_pad:
+ size = 1; /* pad byte */
+ break;
+ case dst_ln_file:
+ /* file escape. Next 4 bytes are a dst_src_loc_t */
+ size = 5;
+ src_loc = (dst_src_loc_t *) (*buffer + 1);
+ last_line = src_loc->line_number;
+ last_file = src_loc->file_index;
+ break;
+ case dst_ln_dln1_dpc1:
+ /* 1 byte line delta, 1 byte pc delta */
+ last_line += (*buffer)[1];
+ last_pc += 2 * (unsigned char) (*buffer)[2];
+ dst_record_line (last_line, last_pc);
+ size = 3;
+ break;
+ case dst_ln_dln2_dpc2:
+ /* 2 bytes line delta, 2 bytes pc delta */
+ last_line += *(short *) (*buffer + 1);
+ last_pc += 2 * (*(short *) (*buffer + 3));
+ size = 5;
+ dst_record_line (last_line, last_pc);
+ break;
+ case dst_ln_ln4_pc4:
+ /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
+ last_line = *(unsigned long *) (*buffer + 1);
+ last_pc = *(unsigned long *) (*buffer + 5);
+ size = 9;
+ dst_record_line (last_line, last_pc);
+ break;
+ case dst_ln_dln1_dpc0:
+ /* 1 byte line delta, pc delta = 0 */
+ size = 2;
+ last_line += (*buffer)[1];
+ break;
+ case dst_ln_ln_off_1:
+ /* statement escape, stmt # = 1 (2nd stmt on line) */
+ size = 1;
+ break;
+ case dst_ln_ln_off:
+ /* statement escape, stmt # = next byte */
+ size = 2;
+ break;
+ case dst_ln_entry:
+ /* entry escape, next byte is entry number */
+ size = 2;
+ break;
+ case dst_ln_exit:
+ /* exit escape */
+ size = 1;
+ break;
+ case dst_ln_stmt_end:
+ /* gap escape, 4 bytes pc delta */
+ size = 5;
+ /* last_pc += 2 * (*(long *) (*buffer + 1)); */
+ /* Apparently this isn't supposed to actually modify
+ * the pc value. Totally weird.
+ */
+ break;
+ case dst_ln_escape_11:
+ case dst_ln_escape_12:
+ case dst_ln_escape_13:
+ size = 1;
+ break;
+ case dst_ln_nxt_byte:
+ /* This shouldn't happen. If it does, we're SOL */
+ return 0;
+ break;
+ case dst_ln_end:
+ /* end escape, final entry follows */
+ return 0;
+ }
+ *buffer += (size < 0) ? -size : size;
+ entry = (dst_ln_entry_ptr_t) * buffer;
+ }
+ last_line += dst_ln_ln_delta (*entry);
+ last_pc += entry->delta.pc_delta * 2;
+ (*buffer)++;
+ dst_record_line (last_line, last_pc);
+ return 1;
+}
+
+static void
+enter_all_lines (char *buffer, long address)
+{
+ if (buffer)
+ while (get_dst_line (&buffer, &address));
+}
+
+static int
+get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry)
+{
+ int size;
+ dst_rec_ptr_t entry;
+ static int last_type;
+ int ar_size;
+ static unsigned lu3;
+
+ entry = (dst_rec_ptr_t) buffer;
+ switch (entry->rec_type)
+ {
+ case dst_typ_pad:
+ size = 0;
+ break;
+ case dst_typ_comp_unit:
+ size = sizeof (DST_comp_unit (entry));
+ break;
+ case dst_typ_section_tab:
+ size = sizeof (DST_section_tab (entry))
+ + ((int) DST_section_tab (entry).number_of_sections
+ - dst_dummy_array_size) * sizeof (long);
+ break;
+ case dst_typ_file_tab:
+ size = sizeof (DST_file_tab (entry))
+ + ((int) DST_file_tab (entry).number_of_files
+ - dst_dummy_array_size) * sizeof (dst_file_desc_t);
+ break;
+ case dst_typ_block:
+ size = sizeof (DST_block (entry))
+ + ((int) DST_block (entry).n_of_code_ranges
+ - dst_dummy_array_size) * sizeof (dst_code_range_t);
+ break;
+ case dst_typ_5:
+ size = -1;
+ break;
+ case dst_typ_var:
+ size = sizeof (DST_var (entry)) -
+ sizeof (dst_var_loc_long_t) * dst_dummy_array_size +
+ DST_var (entry).no_of_locs *
+ (DST_var (entry).short_locs ?
+ sizeof (dst_var_loc_short_t) :
+ sizeof (dst_var_loc_long_t));
+ break;
+ case dst_typ_pointer:
+ size = sizeof (DST_pointer (entry));
+ break;
+ case dst_typ_array:
+ size = sizeof (DST_array (entry));
+ break;
+ case dst_typ_subrange:
+ size = sizeof (DST_subrange (entry));
+ break;
+ case dst_typ_set:
+ size = sizeof (DST_set (entry));
+ break;
+ case dst_typ_implicit_enum:
+ size = sizeof (DST_implicit_enum (entry))
+ + ((int) DST_implicit_enum (entry).nelems
+ - dst_dummy_array_size) * sizeof (dst_rel_offset_t);
+ break;
+ case dst_typ_explicit_enum:
+ size = sizeof (DST_explicit_enum (entry))
+ + ((int) DST_explicit_enum (entry).nelems
+ - dst_dummy_array_size) * sizeof (dst_enum_elem_t);
+ break;
+ case dst_typ_short_rec:
+ size = sizeof (DST_short_rec (entry))
+ + DST_short_rec (entry).nfields * sizeof (dst_short_field_t)
+ - dst_dummy_array_size * sizeof (dst_field_t);
+ break;
+ case dst_typ_short_union:
+ size = sizeof (DST_short_union (entry))
+ + DST_short_union (entry).nfields * sizeof (dst_short_field_t)
+ - dst_dummy_array_size * sizeof (dst_field_t);
+ break;
+ case dst_typ_file:
+ size = sizeof (DST_file (entry));
+ break;
+ case dst_typ_offset:
+ size = sizeof (DST_offset (entry));
+ break;
+ case dst_typ_alias:
+ size = sizeof (DST_alias (entry));
+ break;
+ case dst_typ_signature:
+ size = sizeof (DST_signature (entry)) +
+ ((int) DST_signature (entry).nargs -
+ dst_dummy_array_size) * sizeof (dst_arg_t);
+ break;
+ case dst_typ_21:
+ size = -1;
+ break;
+ case dst_typ_old_label:
+ size = sizeof (DST_old_label (entry));
+ break;
+ case dst_typ_scope:
+ size = sizeof (DST_scope (entry));
+ break;
+ case dst_typ_end_scope:
+ size = 0;
+ break;
+ case dst_typ_25:
+ case dst_typ_26:
+ size = -1;
+ break;
+ case dst_typ_string_tab:
+ case dst_typ_global_name_tab:
+ size = sizeof (DST_string_tab (entry))
+ + DST_string_tab (entry).length
+ - dst_dummy_array_size;
+ break;
+ case dst_typ_forward:
+ size = sizeof (DST_forward (entry));
+ get_dst_entry ((char *) entry + DST_forward (entry).rec_off, &entry);
+ break;
+ case dst_typ_aux_size:
+ size = sizeof (DST_aux_size (entry));
+ break;
+ case dst_typ_aux_align:
+ size = sizeof (DST_aux_align (entry));
+ break;
+ case dst_typ_aux_field_size:
+ size = sizeof (DST_aux_field_size (entry));
+ break;
+ case dst_typ_aux_field_off:
+ size = sizeof (DST_aux_field_off (entry));
+ break;
+ case dst_typ_aux_field_align:
+ size = sizeof (DST_aux_field_align (entry));
+ break;
+ case dst_typ_aux_qual:
+ size = sizeof (DST_aux_qual (entry));
+ break;
+ case dst_typ_aux_var_bound:
+ size = sizeof (DST_aux_var_bound (entry));
+ break;
+ case dst_typ_extension:
+ size = DST_extension (entry).rec_size;
+ break;
+ case dst_typ_string:
+ size = sizeof (DST_string (entry));
+ break;
+ case dst_typ_old_entry:
+ size = 48; /* Obsolete entry type */
+ break;
+ case dst_typ_const:
+ size = sizeof (DST_const (entry))
+ + DST_const (entry).value.length
+ - sizeof (DST_const (entry).value.val);
+ break;
+ case dst_typ_reference:
+ size = sizeof (DST_reference (entry));
+ break;
+ case dst_typ_old_record:
+ case dst_typ_old_union:
+ case dst_typ_record:
+ case dst_typ_union:
+ size = sizeof (DST_record (entry))
+ + ((int) DST_record (entry).nfields
+ - dst_dummy_array_size) * sizeof (dst_field_t);
+ break;
+ case dst_typ_aux_type_deriv:
+ size = sizeof (DST_aux_type_deriv (entry));
+ break;
+ case dst_typ_locpool:
+ size = sizeof (DST_locpool (entry))
+ + ((int) DST_locpool (entry).length -
+ dst_dummy_array_size);
+ break;
+ case dst_typ_variable:
+ size = sizeof (DST_variable (entry));
+ break;
+ case dst_typ_label:
+ size = sizeof (DST_label (entry));
+ break;
+ case dst_typ_entry:
+ size = sizeof (DST_entry (entry));
+ break;
+ case dst_typ_aux_lifetime:
+ size = sizeof (DST_aux_lifetime (entry));
+ break;
+ case dst_typ_aux_ptr_base:
+ size = sizeof (DST_aux_ptr_base (entry));
+ break;
+ case dst_typ_aux_src_range:
+ size = sizeof (DST_aux_src_range (entry));
+ break;
+ case dst_typ_aux_reg_val:
+ size = sizeof (DST_aux_reg_val (entry));
+ break;
+ case dst_typ_aux_unit_names:
+ size = sizeof (DST_aux_unit_names (entry))
+ + ((int) DST_aux_unit_names (entry).number_of_names
+ - dst_dummy_array_size) * sizeof (dst_rel_offset_t);
+ break;
+ case dst_typ_aux_sect_info:
+ size = sizeof (DST_aux_sect_info (entry))
+ + ((int) DST_aux_sect_info (entry).number_of_refs
+ - dst_dummy_array_size) * sizeof (dst_sect_ref_t);
+ break;
+ default:
+ size = -1;
+ break;
+ }
+ if (size == -1)
+ {
+ fprintf_unfiltered (gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n",
+ (int) entry->rec_type,
+ last_type);
+ fprintf_unfiltered (gdb_stderr, "Last unknown_3 value: %d\n", lu3);
+ size = 0;
+ }
+ else
+ last_type = entry->rec_type;
+ if (size & 1) /* Align on a word boundary */
+ size++;
+ size += 2;
+ *ret_entry = entry;
+ return size;
+}
+
+static int
+next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table)
+{
+ if (*buffer - table->buffer >= table->size)
+ {
+ *entry = NULL;
+ return 0;
+ }
+ *buffer += get_dst_entry (*buffer, entry);
+ return 1;
+}
+
+#define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info)
+#define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info)
+#define DST_OFFSET(a, b) ((char *) (a) + (b))
+
+static dst_rec_ptr_t section_table = NULL;
+
+char *
+get_sec_ref (dst_sect_ref_t *ref)
+{
+ dst_sec *section = NULL;
+ long offset;
+
+ if (!section_table || !ref->sect_index)
+ return NULL;
+ offset = DST_section_tab (section_table).section_base[ref->sect_index - 1]
+ + ref->sect_offset;
+ if (offset >= blocks_info.base &&
+ offset < blocks_info.base + blocks_info.size)
+ section = &blocks_info;
+ else if (offset >= symbols_info.base &&
+ offset < symbols_info.base + symbols_info.size)
+ section = &symbols_info;
+ else if (offset >= lines_info.base &&
+ offset < lines_info.base + lines_info.size)
+ section = &lines_info;
+ if (!section)
+ return NULL;
+ return section->buffer + (offset - section->base);
+}
+
+CORE_ADDR
+dst_get_addr (int section, long offset)
+{
+ if (!section_table || !section)
+ return 0;
+ return DST_section_tab (section_table).section_base[section - 1] + offset;
+}
+
+CORE_ADDR
+dst_sym_addr (dst_sect_ref_t *ref)
+{
+ if (!section_table || !ref->sect_index)
+ return 0;
+ return DST_section_tab (section_table).section_base[ref->sect_index - 1]
+ + ref->sect_offset;
+}
+
+static struct type *
+create_new_type (struct objfile *objfile)
+{
+ struct type *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 (struct objfile *objfile, char *name)
+{
+ struct symbol *sym = (struct symbol *)
+ obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+ memset (sym, 0, sizeof (struct symbol));
+ SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
+ &objfile->symbol_obstack);
+ SYMBOL_VALUE (sym) = 0;
+ SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+
+ SYMBOL_CLASS (sym) = LOC_BLOCK;
+ return sym;
+};
+
+static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t);
+
+static struct type *
+decode_type_desc (struct objfile *objfile, dst_type_t *type_desc,
+ dst_rec_ptr_t base)
+{
+ struct type *type;
+ dst_rec_ptr_t entry;
+ if (type_desc->std_type.user_defined_type)
+ {
+ entry = (dst_rec_ptr_t) DST_OFFSET (base,
+ dst_user_type_offset (*type_desc));
+ type = decode_dst_type (objfile, entry);
+ }
+ else
+ {
+ switch (type_desc->std_type.dtc)
+ {
+ case dst_int8_type:
+ type = builtin_type_signed_char;
+ break;
+ case dst_int16_type:
+ type = builtin_type_short;
+ break;
+ case dst_int32_type:
+ type = builtin_type_long;
+ break;
+ case dst_uint8_type:
+ type = builtin_type_unsigned_char;
+ break;
+ case dst_uint16_type:
+ type = builtin_type_unsigned_short;
+ break;
+ case dst_uint32_type:
+ type = builtin_type_unsigned_long;
+ break;
+ case dst_real32_type:
+ type = builtin_type_float;
+ break;
+ case dst_real64_type:
+ type = builtin_type_double;
+ break;
+ case dst_complex_type:
+ type = builtin_type_complex;
+ break;
+ case dst_dcomplex_type:
+ type = builtin_type_double_complex;
+ break;
+ case dst_bool8_type:
+ type = builtin_type_char;
+ break;
+ case dst_bool16_type:
+ type = builtin_type_short;
+ break;
+ case dst_bool32_type:
+ type = builtin_type_long;
+ break;
+ case dst_char_type:
+ type = builtin_type_char;
+ break;
+ /* The next few are more complex. I will take care
+ * of them properly at a later point.
+ */
+ case dst_string_type:
+ type = builtin_type_void;
+ break;
+ case dst_ptr_type:
+ type = builtin_type_void;
+ break;
+ case dst_set_type:
+ type = builtin_type_void;
+ break;
+ case dst_proc_type:
+ type = builtin_type_void;
+ break;
+ case dst_func_type:
+ type = builtin_type_void;
+ break;
+ /* Back tto some ordinary ones */
+ case dst_void_type:
+ type = builtin_type_void;
+ break;
+ case dst_uchar_type:
+ type = builtin_type_unsigned_char;
+ break;
+ default:
+ type = builtin_type_void;
+ break;
+ }
+ }
+ return type;
+}
+
+struct structure_list
+{
+ struct structure_list *next;
+ struct type *type;
+};
+
+static struct structure_list *struct_list = NULL;
+
+static struct type *
+find_dst_structure (char *name)
+{
+ struct structure_list *element;
+
+ for (element = struct_list; element; element = element->next)
+ if (!strcmp (name, TYPE_NAME (element->type)))
+ return element->type;
+ return NULL;
+}
+
+
+static struct type *
+decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code,
+ int version)
+{
+ struct type *type, *child_type;
+ char *struct_name;
+ char *name, *field_name;
+ int i;
+ int fieldoffset, fieldsize;
+ dst_type_t type_desc;
+ struct structure_list *element;
+
+ struct_name = DST_OFFSET (entry, DST_record (entry).noffset);
+ name = concat ((code == TYPE_CODE_UNION) ? "union " : "struct ",
+ struct_name, NULL);
+ type = find_dst_structure (name);
+ if (type)
+ {
+ xfree (name);
+ return type;
+ }
+ type = create_new_type (objfile);
+ TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
+ name, strlen (name));
+ xfree (name);
+ TYPE_CODE (type) = code;
+ TYPE_LENGTH (type) = DST_record (entry).size;
+ TYPE_NFIELDS (type) = DST_record (entry).nfields;
+ TYPE_FIELDS (type) = (struct field *)
+ obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) *
+ DST_record (entry).nfields);
+ fieldoffset = fieldsize = 0;
+ INIT_CPLUS_SPECIFIC (type);
+ element = (struct structure_list *)
+ xmalloc (sizeof (struct structure_list));
+ element->type = type;
+ element->next = struct_list;
+ struct_list = element;
+ for (i = 0; i < DST_record (entry).nfields; i++)
+ {
+ switch (version)
+ {
+ case 2:
+ field_name = DST_OFFSET (entry,
+ DST_record (entry).f.ofields[i].noffset);
+ fieldoffset = DST_record (entry).f.ofields[i].foffset * 8 +
+ DST_record (entry).f.ofields[i].bit_offset;
+ fieldsize = DST_record (entry).f.ofields[i].size;
+ type_desc = DST_record (entry).f.ofields[i].type_desc;
+ break;
+ case 1:
+ field_name = DST_OFFSET (entry,
+ DST_record (entry).f.fields[i].noffset);
+ type_desc = DST_record (entry).f.fields[i].type_desc;
+ switch (DST_record (entry).f.fields[i].f.field_loc.format_tag)
+ {
+ case dst_field_byte:
+ fieldoffset = DST_record (entry).f.
+ fields[i].f.field_byte.offset * 8;
+ fieldsize = -1;
+ break;
+ case dst_field_bit:
+ fieldoffset = DST_record (entry).f.
+ fields[i].f.field_bit.byte_offset * 8 +
+ DST_record (entry).f.
+ fields[i].f.field_bit.bit_offset;
+ fieldsize = DST_record (entry).f.
+ fields[i].f.field_bit.nbits;
+ break;
+ case dst_field_loc:
+ fieldoffset += fieldsize;
+ fieldsize = -1;
+ break;
+ }
+ break;
+ case 0:
+ field_name = DST_OFFSET (entry,
+ DST_record (entry).f.sfields[i].noffset);
+ fieldoffset = DST_record (entry).f.sfields[i].foffset;
+ type_desc = DST_record (entry).f.sfields[i].type_desc;
+ if (i < DST_record (entry).nfields - 1)
+ fieldsize = DST_record (entry).f.sfields[i + 1].foffset;
+ else
+ fieldsize = DST_record (entry).size;
+ fieldsize -= fieldoffset;
+ fieldoffset *= 8;
+ fieldsize *= 8;
+ }
+ TYPE_FIELDS (type)[i].name =
+ obstack_copy0 (&objfile->symbol_obstack,
+ field_name, strlen (field_name));
+ TYPE_FIELDS (type)[i].type = decode_type_desc (objfile,
+ &type_desc,
+ entry);
+ if (fieldsize == -1)
+ fieldsize = TYPE_LENGTH (TYPE_FIELDS (type)[i].type) *
+ 8;
+ TYPE_FIELDS (type)[i].bitsize = fieldsize;
+ TYPE_FIELDS (type)[i].bitpos = fieldoffset;
+ }
+ return type;
+}
+
+static struct type *
+decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry)
+{
+ struct type *child_type, *type, *range_type, *index_type;
+
+ switch (entry->rec_type)
+ {
+ case dst_typ_var:
+ return decode_type_desc (objfile,
+ &DST_var (entry).type_desc,
+ entry);
+ break;
+ case dst_typ_variable:
+ return decode_type_desc (objfile,
+ &DST_variable (entry).type_desc,
+ entry);
+ break;
+ case dst_typ_short_rec:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 0);
+ case dst_typ_short_union:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 0);
+ case dst_typ_union:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 1);
+ case dst_typ_record:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 1);
+ case dst_typ_old_union:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 2);
+ case dst_typ_old_record:
+ return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 2);
+ case dst_typ_pointer:
+ return make_pointer_type (
+ decode_type_desc (objfile,
+ &DST_pointer (entry).type_desc,
+ entry),
+ NULL);
+ case dst_typ_array:
+ child_type = decode_type_desc (objfile,
+ &DST_pointer (entry).type_desc,
+ entry);
+ index_type = lookup_fundamental_type (objfile,
+ FT_INTEGER);
+ range_type = create_range_type ((struct type *) NULL,
+ index_type, DST_array (entry).lo_bound,
+ DST_array (entry).hi_bound);
+ return create_array_type ((struct type *) NULL, child_type,
+ range_type);
+ case dst_typ_alias:
+ return decode_type_desc (objfile,
+ &DST_alias (entry).type_desc,
+ entry);
+ default:
+ return builtin_type_int;
+ }
+}
+
+struct symbol_list
+{
+ struct symbol_list *next;
+ struct symbol *symbol;
+};
+
+static struct symbol_list *dst_global_symbols = NULL;
+static int total_globals = 0;
+
+static void
+decode_dst_locstring (char *locstr, struct symbol *sym)
+{
+ dst_loc_entry_t *entry, *next_entry;
+ CORE_ADDR temp;
+ int count = 0;
+
+ while (1)
+ {
+ if (count++ == 100)
+ {
+ fprintf_unfiltered (gdb_stderr, "Error reading locstring\n");
+ break;
+ }
+ entry = (dst_loc_entry_t *) locstr;
+ next_entry = (dst_loc_entry_t *) (locstr + 1);
+ switch (entry->header.code)
+ {
+ case dst_lsc_end: /* End of string */
+ return;
+ case dst_lsc_indirect: /* Indirect through previous. Arg == 6 */
+ /* Or register ax x == arg */
+ if (entry->header.arg < 6)
+ {
+ SYMBOL_CLASS (sym) = LOC_REGISTER;
+ SYMBOL_VALUE (sym) = entry->header.arg + 8;
+ }
+ /* We predict indirects */
+ locstr++;
+ break;
+ case dst_lsc_dreg:
+ SYMBOL_CLASS (sym) = LOC_REGISTER;
+ SYMBOL_VALUE (sym) = entry->header.arg;
+ locstr++;
+ break;
+ case dst_lsc_section: /* Section (arg+1) */
+ SYMBOL_VALUE (sym) = dst_get_addr (entry->header.arg + 1, 0);
+ locstr++;
+ break;
+ case dst_lsc_sec_byte: /* Section (next_byte+1) */
+ SYMBOL_VALUE (sym) = dst_get_addr (locstr[1] + 1, 0);
+ locstr += 2;
+ break;
+ case dst_lsc_add: /* Add (arg+1)*2 */
+ case dst_lsc_sub: /* Subtract (arg+1)*2 */
+ temp = (entry->header.arg + 1) * 2;
+ locstr++;
+ if (*locstr == dst_multiply_256)
+ {
+ temp <<= 8;
+ locstr++;
+ }
+ switch (entry->header.code)
+ {
+ case dst_lsc_add:
+ if (SYMBOL_CLASS (sym) == LOC_LOCAL)
+ SYMBOL_CLASS (sym) = LOC_ARG;
+ SYMBOL_VALUE (sym) += temp;
+ break;
+ case dst_lsc_sub:
+ SYMBOL_VALUE (sym) -= temp;
+ break;
+ }
+ break;
+ case dst_lsc_add_byte:
+ case dst_lsc_sub_byte:
+ switch (entry->header.arg & 0x03)
+ {
+ case 1:
+ temp = (unsigned char) locstr[1];
+ locstr += 2;
+ break;
+ case 2:
+ temp = *(unsigned short *) (locstr + 1);
+ locstr += 3;
+ break;
+ case 3:
+ temp = *(unsigned long *) (locstr + 1);
+ locstr += 5;
+ break;
+ }
+ if (*locstr == dst_multiply_256)
+ {
+ temp <<= 8;
+ locstr++;
+ }
+ switch (entry->header.code)
+ {
+ case dst_lsc_add_byte:
+ if (SYMBOL_CLASS (sym) == LOC_LOCAL)
+ SYMBOL_CLASS (sym) = LOC_ARG;
+ SYMBOL_VALUE (sym) += temp;
+ break;
+ case dst_lsc_sub_byte:
+ SYMBOL_VALUE (sym) -= temp;
+ break;
+ }
+ break;
+ case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0 */
+ if (next_entry->header.code != dst_lsc_indirect)
+ {
+ SYMBOL_VALUE (sym) = 0;
+ SYMBOL_CLASS (sym) = LOC_STATIC;
+ return;
+ }
+ SYMBOL_VALUE (sym) = 0;
+ SYMBOL_CLASS (sym) = LOC_LOCAL;
+ locstr++;
+ break;
+ default:
+ SYMBOL_VALUE (sym) = 0;
+ SYMBOL_CLASS (sym) = LOC_STATIC;
+ return;
+ }
+ }
+}
+
+static struct symbol_list *
+process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
+ int *nsyms_ret)
+{
+ struct symbol_list *list = NULL, *element;
+ struct symbol *sym;
+ char *symname;
+ int nsyms = 0;
+ char *location;
+ long line;
+ dst_type_t symtype;
+ struct type *type;
+ dst_var_attr_t attr;
+ dst_var_loc_t loc_type;
+ unsigned loc_index;
+ long loc_value;
+
+ if (!entry)
+ {
+ *nsyms_ret = 0;
+ return NULL;
+ }
+ location = (char *) entry;
+ while (NEXT_SYM (&location, &entry) &&
+ entry->rec_type != dst_typ_end_scope)
+ {
+ if (entry->rec_type == dst_typ_var)
+ {
+ if (DST_var (entry).short_locs)
+ {
+ loc_type = DST_var (entry).locs.shorts[0].loc_type;
+ loc_index = DST_var (entry).locs.shorts[0].loc_index;
+ loc_value = DST_var (entry).locs.shorts[0].location;
+ }
+ else
+ {
+ loc_type = DST_var (entry).locs.longs[0].loc_type;
+ loc_index = DST_var (entry).locs.longs[0].loc_index;
+ loc_value = DST_var (entry).locs.longs[0].location;
+ }
+ if (loc_type == dst_var_loc_external)
+ continue;
+ symname = DST_OFFSET (entry, DST_var (entry).noffset);
+ line = DST_var (entry).src_loc.line_number;
+ symtype = DST_var (entry).type_desc;
+ attr = DST_var (entry).attributes;
+ }
+ else if (entry->rec_type == dst_typ_variable)
+ {
+ symname = DST_OFFSET (entry,
+ DST_variable (entry).noffset);
+ line = DST_variable (entry).src_loc.line_number;
+ symtype = DST_variable (entry).type_desc;
+ attr = DST_variable (entry).attributes;
+ }
+ else
+ {
+ continue;
+ }
+ if (symname && name && !strcmp (symname, name))
+ /* It's the function return value */
+ continue;
+ sym = create_new_symbol (objfile, symname);
+
+ if ((attr & (1 << dst_var_attr_global)) ||
+ (attr & (1 << dst_var_attr_static)))
+ SYMBOL_CLASS (sym) = LOC_STATIC;
+ else
+ SYMBOL_CLASS (sym) = LOC_LOCAL;
+ SYMBOL_LINE (sym) = line;
+ SYMBOL_TYPE (sym) = decode_type_desc (objfile, &symtype,
+ entry);
+ SYMBOL_VALUE (sym) = 0;
+ switch (entry->rec_type)
+ {
+ case dst_typ_var:
+ switch (loc_type)
+ {
+ case dst_var_loc_abs:
+ SYMBOL_VALUE_ADDRESS (sym) = loc_value;
+ break;
+ case dst_var_loc_sect_off:
+ case dst_var_loc_ind_sect_off: /* What is this? */
+ SYMBOL_VALUE_ADDRESS (sym) = dst_get_addr (
+ loc_index,
+ loc_value);
+ break;
+ case dst_var_loc_ind_reg_rel: /* What is this? */
+ case dst_var_loc_reg_rel:
+ /* If it isn't fp relative, specify the
+ * register it's relative to.
+ */
+ if (loc_index)
+ {
+ sym->aux_value.basereg = loc_index;
+ }
+ SYMBOL_VALUE (sym) = loc_value;
+ if (loc_value > 0 &&
+ SYMBOL_CLASS (sym) == LOC_BASEREG)
+ SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
+ break;
+ case dst_var_loc_reg:
+ SYMBOL_VALUE (sym) = loc_index;
+ SYMBOL_CLASS (sym) = LOC_REGISTER;
+ break;
+ }
+ break;
+ case dst_typ_variable:
+ /* External variable..... don't try to interpret
+ * its nonexistant locstring.
+ */
+ if (DST_variable (entry).loffset == -1)
+ continue;
+ decode_dst_locstring (DST_OFFSET (entry,
+ DST_variable (entry).loffset),
+ sym);
+ }
+ element = (struct symbol_list *)
+ xmalloc (sizeof (struct symbol_list));
+
+ if (attr & (1 << dst_var_attr_global))
+ {
+ element->next = dst_global_symbols;
+ dst_global_symbols = element;
+ total_globals++;
+ }
+ else
+ {
+ element->next = list;
+ list = element;
+ nsyms++;
+ }
+ element->symbol = sym;
+ }
+ *nsyms_ret = nsyms;
+ return list;
+}
+
+
+static struct symbol *
+process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
+ CORE_ADDR address)
+{
+ struct symbol *sym;
+ struct type *type, *ftype;
+ dst_rec_ptr_t sym_entry, typ_entry;
+ char *location;
+ struct symbol_list *element;
+
+ type = builtin_type_int;
+ sym = create_new_symbol (objfile, name);
+ SYMBOL_CLASS (sym) = LOC_BLOCK;
+
+ if (entry)
+ {
+ location = (char *) entry;
+ do
+ {
+ NEXT_SYM (&location, &sym_entry);
+ }
+ while (sym_entry && sym_entry->rec_type != dst_typ_signature);
+
+ if (sym_entry)
+ {
+ SYMBOL_LINE (sym) =
+ DST_signature (sym_entry).src_loc.line_number;
+ if (DST_signature (sym_entry).result)
+ {
+ typ_entry = (dst_rec_ptr_t)
+ DST_OFFSET (sym_entry,
+ DST_signature (sym_entry).result);
+ type = decode_dst_type (objfile, typ_entry);
+ }
+ }
+ }
+
+ if (!type->function_type)
+ {
+ ftype = 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;
+
+ return sym;
+}
+
+static struct block *
+process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry)
+{
+ struct block *block;
+ struct symbol *function = NULL;
+ CORE_ADDR address;
+ long size;
+ char *name;
+ dst_rec_ptr_t child_entry, symbol_entry;
+ struct block *child_block;
+ int total_symbols = 0;
+ char fake_name[20];
+ static long fake_seq = 0;
+ struct symbol_list *symlist, *nextsym;
+ int symnum;
+
+ if (DST_block (entry).noffset)
+ name = DST_OFFSET (entry, DST_block (entry).noffset);
+ else
+ name = NULL;
+ if (DST_block (entry).n_of_code_ranges)
+ {
+ address = dst_sym_addr (
+ &DST_block (entry).code_ranges[0].code_start);
+ size = DST_block (entry).code_ranges[0].code_size;
+ }
+ else
+ {
+ address = -1;
+ size = 0;
+ }
+ symbol_entry = (dst_rec_ptr_t) get_sec_ref (&DST_block (entry).symbols_start);
+ switch (DST_block (entry).block_type)
+ {
+ /* These are all really functions. Even the "program" type.
+ * This is because the Apollo OS was written in Pascal, and
+ * in Pascal, the main procedure is described as the Program.
+ * Cute, huh?
+ */
+ case dst_block_procedure:
+ case dst_block_function:
+ case dst_block_subroutine:
+ case dst_block_program:
+ prim_record_minimal_symbol (name, address, mst_text, objfile);
+ function = process_dst_function (
+ objfile,
+ symbol_entry,
+ name,
+ address);
+ enter_all_lines (get_sec_ref (&DST_block (entry).code_ranges[0].lines_start), address);
+ break;
+ case dst_block_block_data:
+ break;
+
+ default:
+ /* GDB has to call it something, and the module name
+ * won't cut it
+ */
+ sprintf (fake_name, "block_%08lx", fake_seq++);
+ function = process_dst_function (
+ objfile, NULL, fake_name, address);
+ break;
+ }
+ symlist = process_dst_symbols (objfile, symbol_entry,
+ name, &total_symbols);
+ block = (struct block *)
+ obstack_alloc (&objfile->symbol_obstack,
+ sizeof (struct block) +
+ (total_symbols - 1) * sizeof (struct symbol *));
+
+ symnum = 0;
+ while (symlist)
+ {
+ nextsym = symlist->next;
+
+ block->sym[symnum] = symlist->symbol;
+
+ xfree (symlist);
+ symlist = nextsym;
+ symnum++;
+ }
+ BLOCK_NSYMS (block) = total_symbols;
+ BLOCK_START (block) = address;
+ BLOCK_END (block) = address + size;
+ BLOCK_SUPERBLOCK (block) = 0;
+ if (function)
+ {
+ SYMBOL_BLOCK_VALUE (function) = block;
+ BLOCK_FUNCTION (block) = function;
+ }
+ else
+ BLOCK_FUNCTION (block) = 0;
+
+ if (DST_block (entry).child_block_off)
+ {
+ child_entry = (dst_rec_ptr_t) DST_OFFSET (entry,
+ DST_block (entry).child_block_off);
+ while (child_entry)
+ {
+ child_block = process_dst_block (objfile, child_entry);
+ if (child_block)
+ {
+ if (BLOCK_START (child_block) <
+ BLOCK_START (block) ||
+ BLOCK_START (block) == -1)
+ BLOCK_START (block) =
+ BLOCK_START (child_block);
+ if (BLOCK_END (child_block) >
+ BLOCK_END (block) ||
+ BLOCK_END (block) == -1)
+ BLOCK_END (block) =
+ BLOCK_END (child_block);
+ BLOCK_SUPERBLOCK (child_block) = block;
+ }
+ if (DST_block (child_entry).sibling_block_off)
+ child_entry = (dst_rec_ptr_t) DST_OFFSET (
+ child_entry,
+ DST_block (child_entry).sibling_block_off);
+ else
+ child_entry = NULL;
+ }
+ }
+ record_pending_block (objfile, block, NULL);
+ return block;
+}
+
+
+static void
+read_dst_symtab (struct objfile *objfile)
+{
+ char *buffer;
+ dst_rec_ptr_t entry, file_table, root_block;
+ char *source_file;
+ struct block *block, *global_block;
+ int symnum;
+ struct symbol_list *nextsym;
+ int module_num = 0;
+ struct structure_list *element;
+
+ current_objfile = objfile;
+ buffer = blocks_info.buffer;
+ while (NEXT_BLK (&buffer, &entry))
+ {
+ if (entry->rec_type == dst_typ_comp_unit)
+ {
+ file_table = (dst_rec_ptr_t) DST_OFFSET (entry,
+ DST_comp_unit (entry).file_table);
+ section_table = (dst_rec_ptr_t) DST_OFFSET (entry,
+ DST_comp_unit (entry).section_table);
+ root_block = (dst_rec_ptr_t) DST_OFFSET (entry,
+ DST_comp_unit (entry).root_block_offset);
+ source_file = DST_OFFSET (file_table,
+ DST_file_tab (file_table).files[0].noffset);
+ /* Point buffer to the start of the next comp_unit */
+ buffer = DST_OFFSET (entry,
+ DST_comp_unit (entry).data_size);
+ dst_start_symtab ();
+
+ block = process_dst_block (objfile, root_block);
+
+ global_block = (struct block *)
+ obstack_alloc (&objfile->symbol_obstack,
+ sizeof (struct block) +
+ (total_globals - 1) *
+ sizeof (struct symbol *));
+ BLOCK_NSYMS (global_block) = total_globals;
+ for (symnum = 0; symnum < total_globals; symnum++)
+ {
+ nextsym = dst_global_symbols->next;
+
+ global_block->sym[symnum] =
+ dst_global_symbols->symbol;
+
+ xfree (dst_global_symbols);
+ dst_global_symbols = nextsym;
+ }
+ dst_global_symbols = NULL;
+ total_globals = 0;
+ BLOCK_FUNCTION (global_block) = 0;
+ BLOCK_START (global_block) = BLOCK_START (block);
+ BLOCK_END (global_block) = BLOCK_END (block);
+ BLOCK_SUPERBLOCK (global_block) = 0;
+ BLOCK_SUPERBLOCK (block) = global_block;
+ record_pending_block (objfile, global_block, NULL);
+
+ complete_symtab (source_file,
+ BLOCK_START (block),
+ BLOCK_END (block) - BLOCK_START (block));
+ module_num++;
+ dst_end_symtab (objfile);
+ }
+ }
+ if (module_num)
+ prim_record_minimal_symbol ("<end_of_program>",
+ BLOCK_END (block), mst_text, objfile);
+ /* One more faked symbol to make sure nothing can ever run off the
+ * end of the symbol table. This one represents the end of the
+ * text space. It used to be (CORE_ADDR) -1 (effectively the highest
+ * int possible), but some parts of gdb treated it as a signed
+ * number and failed comparisons. We could equally use 7fffffff,
+ * but no functions are ever mapped to an address higher than
+ * 40000000
+ */
+ prim_record_minimal_symbol ("<end_of_text>",
+ (CORE_ADDR) 0x40000000,
+ mst_text, objfile);
+ while (struct_list)
+ {
+ element = struct_list;
+ struct_list = element->next;
+ xfree (element);
+ }
+}
+
+
+/* Support for line number handling */
+static char *linetab = NULL;
+static long linetab_offset;
+static unsigned long linetab_size;
+
+/* Read in all the line numbers for fast lookups later. Leave them in
+ external (unswapped) format in memory; we'll swap them as we enter
+ them into GDB's data structures. */
+static int
+init_one_section (int chan, dst_sec *secinfo)
+{
+ if (secinfo->size == 0
+ || lseek (chan, secinfo->position, 0) == -1
+ || (secinfo->buffer = xmalloc (secinfo->size)) == NULL
+ || myread (chan, secinfo->buffer, secinfo->size) == -1)
+ return 0;
+ else
+ return 1;
+}
+
+static int
+init_dst_sections (int chan)
+{
+
+ if (!init_one_section (chan, &blocks_info) ||
+ !init_one_section (chan, &lines_info) ||
+ !init_one_section (chan, &symbols_info))
+ return -1;
+ else
+ return 0;
+}
+
+/* Fake up support for relocating symbol addresses. FIXME. */
+
+struct section_offsets dst_symfile_faker =
+{0};
+
+void
+dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
+{
+ objfile->num_sections = 1;
+ objfile->section_offsets = &dst_symfile_faker;
+}
+
+/* Register our ability to parse symbols for DST BFD files */
+
+static struct sym_fns dst_sym_fns =
+{
+ /* FIXME: Can this be integrated with coffread.c? If not, should it be
+ a separate flavour like ecoff? */
+ (enum bfd_flavour) -2,
+
+ dst_new_init, /* sym_new_init: init anything gbl to entire symtab */
+ dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */
+ dst_symfile_read, /* sym_read: read a symbol file into symtab */
+ dst_symfile_finish, /* sym_finish: finished with file, cleanup */
+ dst_symfile_offsets, /* sym_offsets: xlate external to internal form */
+ NULL /* next: pointer to next struct sym_fns */
+};
+
+void
+_initialize_dstread (void)
+{
+ add_symtab_fns (&dst_sym_fns);
+}
diff --git a/contrib/gdb/gdb/dwarf2cfi.c b/contrib/gdb/gdb/dwarf2cfi.c
new file mode 100644
index 0000000..783d1c0
--- /dev/null
+++ b/contrib/gdb/gdb/dwarf2cfi.c
@@ -0,0 +1,1784 @@
+/* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Jiri Smid, SuSE Labs.
+ Based on code written by Daniel Berlin (dan@dberlin.org).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "symtab.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "target.h"
+#include "elf/dwarf2.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "dwarf2cfi.h"
+
+/* Common Information Entry - holds information that is shared among many
+ Frame Descriptors. */
+struct cie_unit
+{
+ /* Offset of this unit in dwarf_frame_buffer. */
+ ULONGEST offset;
+
+ /* A null-terminated string that identifies the augmentation to this CIE or
+ to the FDEs that use it. */
+ char *augmentation;
+
+ /* A constant that is factored out of all advance location instructions. */
+ unsigned int code_align;
+
+ /* A constant that is factored out of all offset instructions. */
+ int data_align;
+
+ /* A constant that indicates which regiter represents the return address
+ of a function. */
+ unsigned char ra;
+
+ /* Indicates how addresses are encoded. */
+ unsigned char addr_encoding;
+
+ /* Pointer and length of the cie program. */
+ char *data;
+ unsigned int data_length;
+
+ struct objfile *objfile;
+
+ /* Next in chain. */
+ struct cie_unit *next;
+};
+
+/* Frame Description Entry. */
+struct fde_unit
+{
+ /* Address of the first location associated with this entry. */
+ CORE_ADDR initial_location;
+
+ /* Length of program section described by this entry. */
+ CORE_ADDR address_range;
+
+ /* Pointer to asociated CIE. */
+ struct cie_unit *cie_ptr;
+
+ /* Pointer and length of the cie program. */
+ char *data;
+ unsigned int data_length;
+};
+
+struct fde_array
+{
+ struct fde_unit **array;
+ int elems;
+ int array_size;
+};
+
+struct context_reg
+{
+ union
+ {
+ unsigned int reg;
+ long offset;
+ CORE_ADDR addr;
+ }
+ loc;
+ enum
+ {
+ REG_CTX_UNSAVED,
+ REG_CTX_SAVED_OFFSET,
+ REG_CTX_SAVED_REG,
+ REG_CTX_SAVED_ADDR,
+ REG_CTX_VALUE,
+ }
+ how;
+};
+
+/* This is the register and unwind state for a particular frame. */
+struct context
+{
+ struct context_reg *reg;
+
+ CORE_ADDR cfa;
+ CORE_ADDR ra;
+ void *lsda;
+ int args_size;
+};
+
+struct frame_state_reg
+{
+ union
+ {
+ unsigned int reg;
+ long offset;
+ unsigned char *exp;
+ }
+ loc;
+ enum
+ {
+ REG_UNSAVED,
+ REG_SAVED_OFFSET,
+ REG_SAVED_REG,
+ REG_SAVED_EXP,
+ }
+ how;
+};
+
+struct frame_state
+{
+ /* Each register save state can be described in terms of a CFA slot,
+ another register, or a location expression. */
+ struct frame_state_regs
+ {
+ struct frame_state_reg *reg;
+
+ /* Used to implement DW_CFA_remember_state. */
+ struct frame_state_regs *prev;
+ }
+ regs;
+
+ /* The CFA can be described in terms of a reg+offset or a
+ location expression. */
+ long cfa_offset;
+ int cfa_reg;
+ unsigned char *cfa_exp;
+ enum
+ {
+ CFA_UNSET,
+ CFA_REG_OFFSET,
+ CFA_EXP,
+ }
+ cfa_how;
+
+ /* The PC described by the current frame state. */
+ CORE_ADDR pc;
+
+ /* The information we care about from the CIE/FDE. */
+ int data_align;
+ unsigned int code_align;
+ unsigned char retaddr_column;
+ unsigned char addr_encoding;
+
+ struct objfile *objfile;
+};
+
+#define UNWIND_CONTEXT(fi) ((struct context *) (fi->context))
+
+
+static struct cie_unit *cie_chunks;
+static struct fde_array fde_chunks;
+/* Obstack for allocating temporary storage used during unwind operations. */
+static struct obstack unwind_tmp_obstack;
+
+extern file_ptr dwarf_frame_offset;
+extern unsigned int dwarf_frame_size;
+extern file_ptr dwarf_eh_frame_offset;
+extern unsigned int dwarf_eh_frame_size;
+
+static char *dwarf_frame_buffer;
+
+
+extern char *dwarf2_read_section (struct objfile *objfile, file_ptr offset,
+ unsigned int size);
+
+static struct fde_unit *fde_unit_alloc (void);
+static struct cie_unit *cie_unit_alloc (void);
+static void fde_chunks_need_space ();
+
+static struct context *context_alloc ();
+static struct frame_state *frame_state_alloc ();
+static void unwind_tmp_obstack_free ();
+static void context_cpy (struct context *dst, struct context *src);
+
+static unsigned int read_1u (bfd *abfd, char **p);
+static int read_1s (bfd *abfd, char **p);
+static unsigned int read_2u (bfd *abfd, char **p);
+static int read_2s (bfd *abfd, char **p);
+static unsigned int read_4u (bfd *abfd, char **p);
+static int read_4s (bfd *abfd, char **p);
+static ULONGEST read_8u (bfd *abfd, char **p);
+static LONGEST read_8s (bfd *abfd, char **p);
+
+static ULONGEST read_uleb128 (bfd *abfd, char **p);
+static LONGEST read_sleb128 (bfd *abfd, char **p);
+static CORE_ADDR read_pointer (bfd *abfd, char **p);
+static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p,
+ unsigned char encoding);
+
+static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read);
+static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read,
+ int dwarf64);
+
+static int is_cie (ULONGEST cie_id, int dwarf64);
+static int compare_fde_unit (const void *a, const void *b);
+void dwarf2_build_frame_info (struct objfile *objfile);
+
+static void execute_cfa_program (struct objfile *objfile, char *insn_ptr,
+ char *insn_end, struct context *context,
+ struct frame_state *fs);
+static struct fde_unit *get_fde_for_addr (CORE_ADDR pc);
+static void frame_state_for (struct context *context, struct frame_state *fs);
+static void get_reg (char *reg, struct context *context, int regnum);
+static CORE_ADDR execute_stack_op (struct objfile *objfile,
+ char *op_ptr, char *op_end,
+ struct context *context, CORE_ADDR initial);
+static void update_context (struct context *context, struct frame_state *fs,
+ int chain);
+
+
+/* Memory allocation functions. */
+static struct fde_unit *
+fde_unit_alloc (void)
+{
+ struct fde_unit *fde;
+
+ fde = (struct fde_unit *) xmalloc (sizeof (struct fde_unit));
+ memset (fde, 0, sizeof (struct fde_unit));
+ return fde;
+}
+
+static struct cie_unit *
+cie_unit_alloc (void)
+{
+ struct cie_unit *cie;
+
+ cie = (struct cie_unit *) xmalloc (sizeof (struct cie_unit));
+ memset (cie, 0, sizeof (struct cie_unit));
+ return cie;
+}
+
+static void
+fde_chunks_need_space ()
+{
+ if (fde_chunks.elems < fde_chunks.array_size)
+ return;
+ fde_chunks.array_size =
+ fde_chunks.array_size ? 2 * fde_chunks.array_size : 1024;
+ fde_chunks.array =
+ xrealloc (fde_chunks.array,
+ sizeof (struct fde_unit) * fde_chunks.array_size);
+}
+
+/* Alocate a new `struct context' on temporary obstack. */
+static struct context *
+context_alloc ()
+{
+ struct context *context;
+
+ int regs_size = sizeof (struct context_reg) * NUM_REGS;
+
+ context = (struct context *) obstack_alloc (&unwind_tmp_obstack,
+ sizeof (struct context));
+ memset (context, 0, sizeof (struct context));
+ context->reg = (struct context_reg *) obstack_alloc (&unwind_tmp_obstack,
+ regs_size);
+ memset (context->reg, 0, regs_size);
+ return context;
+}
+
+/* Alocate a new `struct frame_state' on temporary obstack. */
+static struct frame_state *
+frame_state_alloc ()
+{
+ struct frame_state *fs;
+
+ int regs_size = sizeof (struct frame_state_reg) * NUM_REGS;
+
+ fs = (struct frame_state *) obstack_alloc (&unwind_tmp_obstack,
+ sizeof (struct frame_state));
+ memset (fs, 0, sizeof (struct frame_state));
+ fs->regs.reg = (struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack,
+ regs_size);
+ memset (fs->regs.reg, 0, regs_size);
+ return fs;
+}
+
+static void
+unwind_tmp_obstack_free ()
+{
+ obstack_free (&unwind_tmp_obstack, NULL);
+ obstack_init (&unwind_tmp_obstack);
+}
+
+static void
+context_cpy (struct context *dst, struct context *src)
+{
+ int regs_size = sizeof (struct context_reg) * NUM_REGS;
+ struct context_reg *dreg;
+
+ /* Structure dst contains a pointer to an array of
+ * registers of a given frame as well as src does. This
+ * array was already allocated before dst was passed to
+ * context_cpy but the pointer to it was overriden by
+ * '*dst = *src' and the array was lost. This led to the
+ * situation, that we've had a copy of src placed in dst,
+ * but both of them pointed to the same regs array and
+ * thus we've sometimes blindly rewritten it. Now we save
+ * the pointer before copying src to dst, return it back
+ * after that and copy the registers into their new place
+ * finally. --- mludvig@suse.cz */
+ dreg = dst->reg;
+ *dst = *src;
+ dst->reg = dreg;
+
+ memcpy (dst->reg, src->reg, regs_size);
+}
+
+static unsigned int
+read_1u (bfd *abfd, char **p)
+{
+ unsigned ret;
+
+ ret= bfd_get_8 (abfd, (bfd_byte *) *p);
+ (*p) ++;
+ return ret;
+}
+
+static int
+read_1s (bfd *abfd, char **p)
+{
+ int ret;
+
+ ret= bfd_get_signed_8 (abfd, (bfd_byte *) *p);
+ (*p) ++;
+ return ret;
+}
+
+static unsigned int
+read_2u (bfd *abfd, char **p)
+{
+ unsigned ret;
+
+ ret= bfd_get_16 (abfd, (bfd_byte *) *p);
+ (*p) ++;
+ return ret;
+}
+
+static int
+read_2s (bfd *abfd, char **p)
+{
+ int ret;
+
+ ret= bfd_get_signed_16 (abfd, (bfd_byte *) *p);
+ (*p) += 2;
+ return ret;
+}
+
+static unsigned int
+read_4u (bfd *abfd, char **p)
+{
+ unsigned int ret;
+
+ ret= bfd_get_32 (abfd, (bfd_byte *) *p);
+ (*p) += 4;
+ return ret;
+}
+
+static int
+read_4s (bfd *abfd, char **p)
+{
+ int ret;
+
+ ret= bfd_get_signed_32 (abfd, (bfd_byte *) *p);
+ (*p) += 4;
+ return ret;
+}
+
+static ULONGEST
+read_8u (bfd *abfd, char **p)
+{
+ ULONGEST ret;
+
+ ret = bfd_get_64 (abfd, (bfd_byte *) *p);
+ (*p) += 8;
+ return ret;
+}
+
+static LONGEST
+read_8s (bfd *abfd, char **p)
+{
+ LONGEST ret;
+
+ ret = bfd_get_signed_64 (abfd, (bfd_byte *) *p);
+ (*p) += 8;
+ return ret;
+}
+
+static ULONGEST
+read_uleb128 (bfd *abfd, char **p)
+{
+ ULONGEST ret;
+ int i, shift;
+ unsigned char byte;
+
+ ret = 0;
+ shift = 0;
+ i = 0;
+ while (1)
+ {
+ byte = bfd_get_8 (abfd, (bfd_byte *) *p);
+ (*p) ++;
+ ret |= ((unsigned long) (byte & 127) << shift);
+ if ((byte & 128) == 0)
+ {
+ break;
+ }
+ shift += 7;
+ }
+ return ret;
+}
+
+static LONGEST
+read_sleb128 (bfd *abfd, char **p)
+{
+ LONGEST ret;
+ int i, shift, size, num_read;
+ unsigned char byte;
+
+ ret = 0;
+ shift = 0;
+ size = 32;
+ num_read = 0;
+ i = 0;
+ while (1)
+ {
+ byte = bfd_get_8 (abfd, (bfd_byte *) *p);
+ (*p) ++;
+ ret |= ((long) (byte & 127) << shift);
+ shift += 7;
+ if ((byte & 128) == 0)
+ {
+ break;
+ }
+ }
+ if ((shift < size) && (byte & 0x40))
+ {
+ ret |= -(1 << shift);
+ }
+ return ret;
+}
+
+static CORE_ADDR
+read_pointer (bfd *abfd, char **p)
+{
+ switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+ {
+ case 4:
+ return read_4u (abfd, p);
+ case 8:
+ return read_8u (abfd, p);
+ default:
+ error ("dwarf cfi error: unsupported target address length.");
+ }
+}
+
+static CORE_ADDR
+read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
+{
+ CORE_ADDR ret;
+
+ switch (encoding & 0x0f)
+ {
+ case DW_EH_PE_absptr:
+ ret = read_pointer (abfd, p);
+ break;
+
+ case DW_EH_PE_uleb128:
+ ret = read_uleb128 (abfd, p);
+ break;
+ case DW_EH_PE_sleb128:
+ ret = read_sleb128 (abfd, p);
+ break;
+
+ case DW_EH_PE_udata2:
+ ret = read_2u (abfd, p);
+ break;
+ case DW_EH_PE_udata4:
+ ret = read_4u (abfd, p);
+ break;
+ case DW_EH_PE_udata8:
+ ret = read_8u (abfd, p);
+ break;
+
+ case DW_EH_PE_sdata2:
+ ret = read_2s (abfd, p);
+ break;
+ case DW_EH_PE_sdata4:
+ ret = read_4s (abfd, p);
+ break;
+ case DW_EH_PE_sdata8:
+ ret = read_8s (abfd, p);
+ break;
+
+ default:
+ internal_error (__FILE__, __LINE__,
+ "read_encoded_pointer: unknown pointer encoding");
+ }
+
+ if (ret != 0)
+ switch (encoding & 0xf0)
+ {
+ case DW_EH_PE_absptr:
+ break;
+ case DW_EH_PE_pcrel:
+ ret += (CORE_ADDR) *p;
+ break;
+ case DW_EH_PE_textrel:
+ case DW_EH_PE_datarel:
+ case DW_EH_PE_funcrel:
+ default:
+ internal_error (__FILE__, __LINE__,
+ "read_encoded_pointer: unknown pointer encoding");
+ }
+
+ return ret;
+}
+
+static LONGEST
+read_initial_length (bfd * abfd, char *buf, int *bytes_read)
+{
+ LONGEST ret = 0;
+
+ ret = bfd_get_32 (abfd, (bfd_byte *) buf);
+
+ if (ret == 0xffffffff)
+ {
+ ret = bfd_get_64 (abfd, (bfd_byte *) buf + 4);
+ *bytes_read = 12;
+ }
+ else
+ {
+ *bytes_read = 4;
+ }
+
+ return ret;
+}
+
+static ULONGEST
+read_length (bfd * abfd, char *buf, int *bytes_read, int dwarf64)
+{
+ if (dwarf64)
+ {
+ *bytes_read = 8;
+ return read_8u (abfd, &buf);
+ }
+ else
+ {
+ *bytes_read = 4;
+ return read_4u (abfd, &buf);
+ }
+}
+
+static void
+execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
+ struct context *context, struct frame_state *fs)
+{
+ struct frame_state_regs *unused_rs = NULL;
+
+ /* Don't allow remember/restore between CIE and FDE programs. */
+ fs->regs.prev = NULL;
+
+ while (insn_ptr < insn_end && fs->pc < context->ra)
+ {
+ unsigned char insn = *insn_ptr++;
+ ULONGEST reg, uoffset;
+ LONGEST offset;
+
+ if (insn & DW_CFA_advance_loc)
+ fs->pc += (insn & 0x3f) * fs->code_align;
+ else if (insn & DW_CFA_offset)
+ {
+ reg = insn & 0x3f;
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ offset = (long) uoffset * fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ }
+ else if (insn & DW_CFA_restore)
+ {
+ reg = insn & 0x3f;
+ fs->regs.reg[reg].how = REG_UNSAVED;
+ }
+ else
+ switch (insn)
+ {
+ case DW_CFA_set_loc:
+ fs->pc = read_encoded_pointer (objfile->obfd, &insn_ptr,
+ fs->addr_encoding);
+ break;
+
+ case DW_CFA_advance_loc1:
+ fs->pc += read_1u (objfile->obfd, &insn_ptr);
+ break;
+ case DW_CFA_advance_loc2:
+ fs->pc += read_2u (objfile->obfd, &insn_ptr);
+ break;
+ case DW_CFA_advance_loc4:
+ fs->pc += read_4u (objfile->obfd, &insn_ptr);
+ break;
+
+ case DW_CFA_offset_extended:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ offset = (long) uoffset *fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ break;
+
+ case DW_CFA_restore_extended:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->regs.reg[reg].how = REG_UNSAVED;
+ break;
+
+ case DW_CFA_undefined:
+ case DW_CFA_same_value:
+ case DW_CFA_nop:
+ break;
+
+ case DW_CFA_register:
+ {
+ ULONGEST reg2;
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ reg2 = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->regs.reg[reg].how = REG_SAVED_REG;
+ fs->regs.reg[reg].loc.reg = reg2;
+ }
+ break;
+
+ case DW_CFA_remember_state:
+ {
+ struct frame_state_regs *new_rs;
+ if (unused_rs)
+ {
+ new_rs = unused_rs;
+ unused_rs = unused_rs->prev;
+ }
+ else
+ new_rs = xmalloc (sizeof (struct frame_state_regs));
+
+ *new_rs = fs->regs;
+ fs->regs.prev = new_rs;
+ }
+ break;
+
+ case DW_CFA_restore_state:
+ {
+ struct frame_state_regs *old_rs = fs->regs.prev;
+ fs->regs = *old_rs;
+ old_rs->prev = unused_rs;
+ unused_rs = old_rs;
+ }
+ break;
+
+ case DW_CFA_def_cfa:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_reg = reg;
+ fs->cfa_offset = uoffset;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_register:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_reg = reg;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_offset:
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_offset = uoffset;
+ break;
+
+ case DW_CFA_def_cfa_expression:
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_exp = insn_ptr;
+ fs->cfa_how = CFA_EXP;
+ insn_ptr += uoffset;
+ break;
+
+ case DW_CFA_expression:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->regs.reg[reg].how = REG_SAVED_EXP;
+ fs->regs.reg[reg].loc.exp = insn_ptr;
+ insn_ptr += uoffset;
+ break;
+
+ /* From the 2.1 draft. */
+ case DW_CFA_offset_extended_sf:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ offset = read_sleb128 (objfile->obfd, &insn_ptr);
+ offset *= fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ break;
+
+ case DW_CFA_def_cfa_sf:
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ offset = read_sleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_offset = offset;
+ fs->cfa_reg = reg;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_offset_sf:
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ fs->cfa_offset = uoffset;
+ /* cfa_how deliberately not set. */
+ break;
+
+ case DW_CFA_GNU_window_save:
+ /* ??? Hardcoded for SPARC register window configuration. */
+ for (reg = 16; reg < 32; ++reg)
+ {
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *);
+ }
+ break;
+
+ case DW_CFA_GNU_args_size:
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ context->args_size = uoffset;
+ break;
+
+ case DW_CFA_GNU_negative_offset_extended:
+ /* Obsoleted by DW_CFA_offset_extended_sf, but used by
+ older PowerPC code. */
+ reg = read_uleb128 (objfile->obfd, &insn_ptr);
+ uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
+ offset = (long) uoffset *fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = -offset;
+ break;
+
+ default:
+ error ("dwarf cfi error: unknown cfa instruction %d.", insn);
+ }
+ }
+}
+
+static struct fde_unit *
+get_fde_for_addr (CORE_ADDR pc)
+{
+ size_t lo, hi;
+ struct fde_unit *fde = NULL;
+ lo = 0;
+ hi = fde_chunks.elems;
+
+ while (lo < hi)
+ {
+ size_t i = (lo + hi) / 2;
+ fde = fde_chunks.array[i];
+ if (pc < fde->initial_location)
+ hi = i;
+ else if (pc >= fde->initial_location + fde->address_range)
+ lo = i + 1;
+ else
+ return fde;
+ }
+ return 0;
+}
+
+static void
+frame_state_for (struct context *context, struct frame_state *fs)
+{
+ struct fde_unit *fde;
+ struct cie_unit *cie;
+
+ context->args_size = 0;
+ context->lsda = 0;
+
+ fde = get_fde_for_addr (context->ra - 1);
+
+ if (fde == NULL)
+ return;
+
+ fs->pc = fde->initial_location;
+
+ if (fde->cie_ptr)
+ {
+ cie = fde->cie_ptr;
+
+ fs->code_align = cie->code_align;
+ fs->data_align = cie->data_align;
+ fs->retaddr_column = cie->ra;
+ fs->addr_encoding = cie->addr_encoding;
+ fs->objfile = cie->objfile;
+
+ execute_cfa_program (cie->objfile, cie->data,
+ cie->data + cie->data_length, context, fs);
+ execute_cfa_program (cie->objfile, fde->data,
+ fde->data + fde->data_length, context, fs);
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+ "%s(): Internal error: fde->cie_ptr==NULL !",
+ __func__);
+}
+
+static void
+get_reg (char *reg, struct context *context, int regnum)
+{
+ switch (context->reg[regnum].how)
+ {
+ case REG_CTX_UNSAVED:
+ read_register_gen (regnum, reg);
+ break;
+ case REG_CTX_SAVED_OFFSET:
+ target_read_memory (context->cfa + context->reg[regnum].loc.offset,
+ reg, REGISTER_RAW_SIZE (regnum));
+ break;
+ case REG_CTX_SAVED_REG:
+ read_register_gen (context->reg[regnum].loc.reg, reg);
+ break;
+ case REG_CTX_SAVED_ADDR:
+ target_read_memory (context->reg[regnum].loc.addr,
+ reg, REGISTER_RAW_SIZE (regnum));
+ break;
+ case REG_CTX_VALUE:
+ memcpy (reg, &context->reg[regnum].loc.addr,
+ REGISTER_RAW_SIZE (regnum));
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "get_reg: unknown register rule");
+ }
+}
+
+/* Decode a DW_OP stack program. Return the top of stack. Push INITIAL
+ onto the stack to start. */
+static CORE_ADDR
+execute_stack_op (struct objfile *objfile,
+ char *op_ptr, char *op_end, struct context *context,
+ CORE_ADDR initial)
+{
+ CORE_ADDR stack[64]; /* ??? Assume this is enough. */
+ int stack_elt;
+
+ stack[0] = initial;
+ stack_elt = 1;
+
+ while (op_ptr < op_end)
+ {
+ enum dwarf_location_atom op = *op_ptr++;
+ CORE_ADDR result;
+ ULONGEST reg;
+ LONGEST offset;
+
+ switch (op)
+ {
+ case DW_OP_lit0:
+ case DW_OP_lit1:
+ case DW_OP_lit2:
+ case DW_OP_lit3:
+ case DW_OP_lit4:
+ case DW_OP_lit5:
+ case DW_OP_lit6:
+ case DW_OP_lit7:
+ case DW_OP_lit8:
+ case DW_OP_lit9:
+ case DW_OP_lit10:
+ case DW_OP_lit11:
+ case DW_OP_lit12:
+ case DW_OP_lit13:
+ case DW_OP_lit14:
+ case DW_OP_lit15:
+ case DW_OP_lit16:
+ case DW_OP_lit17:
+ case DW_OP_lit18:
+ case DW_OP_lit19:
+ case DW_OP_lit20:
+ case DW_OP_lit21:
+ case DW_OP_lit22:
+ case DW_OP_lit23:
+ case DW_OP_lit24:
+ case DW_OP_lit25:
+ case DW_OP_lit26:
+ case DW_OP_lit27:
+ case DW_OP_lit28:
+ case DW_OP_lit29:
+ case DW_OP_lit30:
+ case DW_OP_lit31:
+ result = op - DW_OP_lit0;
+ break;
+
+ case DW_OP_addr:
+ result = read_pointer (objfile->obfd, &op_ptr);
+ break;
+
+ case DW_OP_const1u:
+ result = read_1u (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const1s:
+ result = read_1s (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const2u:
+ result = read_2u (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const2s:
+ result = read_2s (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const4u:
+ result = read_4u (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const4s:
+ result = read_4s (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const8u:
+ result = read_8u (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_const8s:
+ result = read_8s (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_constu:
+ result = read_uleb128 (objfile->obfd, &op_ptr);
+ break;
+ case DW_OP_consts:
+ result = read_sleb128 (objfile->obfd, &op_ptr);
+ break;
+
+ case DW_OP_reg0:
+ case DW_OP_reg1:
+ case DW_OP_reg2:
+ case DW_OP_reg3:
+ case DW_OP_reg4:
+ case DW_OP_reg5:
+ case DW_OP_reg6:
+ case DW_OP_reg7:
+ case DW_OP_reg8:
+ case DW_OP_reg9:
+ case DW_OP_reg10:
+ case DW_OP_reg11:
+ case DW_OP_reg12:
+ case DW_OP_reg13:
+ case DW_OP_reg14:
+ case DW_OP_reg15:
+ case DW_OP_reg16:
+ case DW_OP_reg17:
+ case DW_OP_reg18:
+ case DW_OP_reg19:
+ case DW_OP_reg20:
+ case DW_OP_reg21:
+ case DW_OP_reg22:
+ case DW_OP_reg23:
+ case DW_OP_reg24:
+ case DW_OP_reg25:
+ case DW_OP_reg26:
+ case DW_OP_reg27:
+ case DW_OP_reg28:
+ case DW_OP_reg29:
+ case DW_OP_reg30:
+ case DW_OP_reg31:
+ get_reg ((char *) &result, context, op - DW_OP_reg0);
+ break;
+ case DW_OP_regx:
+ reg = read_uleb128 (objfile->obfd, &op_ptr);
+ get_reg ((char *) &result, context, reg);
+ break;
+
+ case DW_OP_breg0:
+ case DW_OP_breg1:
+ case DW_OP_breg2:
+ case DW_OP_breg3:
+ case DW_OP_breg4:
+ case DW_OP_breg5:
+ case DW_OP_breg6:
+ case DW_OP_breg7:
+ case DW_OP_breg8:
+ case DW_OP_breg9:
+ case DW_OP_breg10:
+ case DW_OP_breg11:
+ case DW_OP_breg12:
+ case DW_OP_breg13:
+ case DW_OP_breg14:
+ case DW_OP_breg15:
+ case DW_OP_breg16:
+ case DW_OP_breg17:
+ case DW_OP_breg18:
+ case DW_OP_breg19:
+ case DW_OP_breg20:
+ case DW_OP_breg21:
+ case DW_OP_breg22:
+ case DW_OP_breg23:
+ case DW_OP_breg24:
+ case DW_OP_breg25:
+ case DW_OP_breg26:
+ case DW_OP_breg27:
+ case DW_OP_breg28:
+ case DW_OP_breg29:
+ case DW_OP_breg30:
+ case DW_OP_breg31:
+ offset = read_sleb128 (objfile->obfd, &op_ptr);
+ get_reg ((char *) &result, context, op - DW_OP_breg0);
+ result += offset;
+ break;
+ case DW_OP_bregx:
+ reg = read_uleb128 (objfile->obfd, &op_ptr);
+ offset = read_sleb128 (objfile->obfd, &op_ptr);
+ get_reg ((char *) &result, context, reg);
+ result += offset;
+ break;
+
+ case DW_OP_dup:
+ if (stack_elt < 1)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ result = stack[stack_elt - 1];
+ break;
+
+ case DW_OP_drop:
+ if (--stack_elt < 0)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ goto no_push;
+
+ case DW_OP_pick:
+ offset = *op_ptr++;
+ if (offset >= stack_elt - 1)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ result = stack[stack_elt - 1 - offset];
+ break;
+
+ case DW_OP_over:
+ if (stack_elt < 2)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ result = stack[stack_elt - 2];
+ break;
+
+ case DW_OP_rot:
+ {
+ CORE_ADDR t1, t2, t3;
+
+ if (stack_elt < 3)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ t1 = stack[stack_elt - 1];
+ t2 = stack[stack_elt - 2];
+ t3 = stack[stack_elt - 3];
+ stack[stack_elt - 1] = t2;
+ stack[stack_elt - 2] = t3;
+ stack[stack_elt - 3] = t1;
+ goto no_push;
+ }
+
+ case DW_OP_deref:
+ case DW_OP_deref_size:
+ case DW_OP_abs:
+ case DW_OP_neg:
+ case DW_OP_not:
+ case DW_OP_plus_uconst:
+ /* Unary operations. */
+ if (--stack_elt < 0)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ result = stack[stack_elt];
+
+ switch (op)
+ {
+ case DW_OP_deref:
+ {
+ char *ptr = (char *) result;
+ result = read_pointer (objfile->obfd, &ptr);
+ }
+ break;
+
+ case DW_OP_deref_size:
+ {
+ char *ptr = (char *) result;
+ switch (*op_ptr++)
+ {
+ case 1:
+ result = read_1u (objfile->obfd, &ptr);
+ break;
+ case 2:
+ result = read_2u (objfile->obfd, &ptr);
+ break;
+ case 4:
+ result = read_4u (objfile->obfd, &ptr);
+ break;
+ case 8:
+ result = read_8u (objfile->obfd, &ptr);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "execute_stack_op error");
+ }
+ }
+ break;
+
+ case DW_OP_abs:
+ if (result < 0)
+ result = -result;
+ break;
+ case DW_OP_neg:
+ result = -result;
+ break;
+ case DW_OP_not:
+ result = ~result;
+ break;
+ case DW_OP_plus_uconst:
+ result += read_uleb128 (objfile->obfd, &op_ptr);
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case DW_OP_and:
+ case DW_OP_div:
+ case DW_OP_minus:
+ case DW_OP_mod:
+ case DW_OP_mul:
+ case DW_OP_or:
+ case DW_OP_plus:
+ case DW_OP_le:
+ case DW_OP_ge:
+ case DW_OP_eq:
+ case DW_OP_lt:
+ case DW_OP_gt:
+ case DW_OP_ne:
+ {
+ /* Binary operations. */
+ CORE_ADDR first, second;
+ if ((stack_elt -= 2) < 0)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ second = stack[stack_elt];
+ first = stack[stack_elt + 1];
+
+ switch (op)
+ {
+ case DW_OP_and:
+ result = second & first;
+ break;
+ case DW_OP_div:
+ result = (LONGEST) second / (LONGEST) first;
+ break;
+ case DW_OP_minus:
+ result = second - first;
+ break;
+ case DW_OP_mod:
+ result = (LONGEST) second % (LONGEST) first;
+ break;
+ case DW_OP_mul:
+ result = second * first;
+ break;
+ case DW_OP_or:
+ result = second | first;
+ break;
+ case DW_OP_plus:
+ result = second + first;
+ break;
+ case DW_OP_shl:
+ result = second << first;
+ break;
+ case DW_OP_shr:
+ result = second >> first;
+ break;
+ case DW_OP_shra:
+ result = (LONGEST) second >> first;
+ break;
+ case DW_OP_xor:
+ result = second ^ first;
+ break;
+ case DW_OP_le:
+ result = (LONGEST) first <= (LONGEST) second;
+ break;
+ case DW_OP_ge:
+ result = (LONGEST) first >= (LONGEST) second;
+ break;
+ case DW_OP_eq:
+ result = (LONGEST) first == (LONGEST) second;
+ break;
+ case DW_OP_lt:
+ result = (LONGEST) first < (LONGEST) second;
+ break;
+ case DW_OP_gt:
+ result = (LONGEST) first > (LONGEST) second;
+ break;
+ case DW_OP_ne:
+ result = (LONGEST) first != (LONGEST) second;
+ break;
+ default: /* This label is here just to avoid warning. */
+ break;
+ }
+ }
+ break;
+
+ case DW_OP_skip:
+ offset = read_2s (objfile->obfd, &op_ptr);
+ op_ptr += offset;
+ goto no_push;
+
+ case DW_OP_bra:
+ if (--stack_elt < 0)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ offset = read_2s (objfile->obfd, &op_ptr);
+ if (stack[stack_elt] != 0)
+ op_ptr += offset;
+ goto no_push;
+
+ case DW_OP_nop:
+ goto no_push;
+
+ default:
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ }
+
+ /* Most things push a result value. */
+ if ((size_t) stack_elt >= sizeof (stack) / sizeof (*stack))
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ stack[++stack_elt] = result;
+ no_push:;
+ }
+
+ /* We were executing this program to get a value. It should be
+ at top of stack. */
+ if (--stack_elt < 0)
+ internal_error (__FILE__, __LINE__, "execute_stack_op error");
+ return stack[stack_elt];
+}
+
+static void
+update_context (struct context *context, struct frame_state *fs, int chain)
+{
+ struct context *orig_context;
+ CORE_ADDR cfa;
+ long i;
+
+ orig_context = context_alloc ();
+ context_cpy (orig_context, context);
+ /* Compute this frame's CFA. */
+ switch (fs->cfa_how)
+ {
+ case CFA_REG_OFFSET:
+ get_reg ((char *) &cfa, context, fs->cfa_reg);
+ cfa += fs->cfa_offset;
+ break;
+
+ case CFA_EXP:
+ /* ??? No way of knowing what register number is the stack pointer
+ to do the same sort of handling as above. Assume that if the
+ CFA calculation is so complicated as to require a stack program
+ that this will not be a problem. */
+ {
+ char *exp = fs->cfa_exp;
+ ULONGEST len;
+
+ len = read_uleb128 (fs->objfile->obfd, &exp);
+ cfa = (CORE_ADDR) execute_stack_op (fs->objfile, exp,
+ exp + len, context, 0);
+ break;
+ }
+ default:
+ break;
+ }
+ context->cfa = cfa;
+
+ if (!chain)
+ orig_context->cfa = cfa;
+
+ /* Compute the addresses of all registers saved in this frame. */
+ for (i = 0; i < NUM_REGS; ++i)
+ switch (fs->regs.reg[i].how)
+ {
+ case REG_UNSAVED:
+ if (i == SP_REGNUM)
+ {
+ context->reg[i].how = REG_CTX_VALUE;
+ context->reg[i].loc.addr = cfa;
+ }
+ else
+ context->reg[i].how = REG_CTX_UNSAVED;
+ break;
+ case REG_SAVED_OFFSET:
+ context->reg[i].how = REG_CTX_SAVED_OFFSET;
+ context->reg[i].loc.offset = fs->regs.reg[i].loc.offset;
+ break;
+ case REG_SAVED_REG:
+ switch (orig_context->reg[fs->regs.reg[i].loc.reg].how)
+ {
+ case REG_CTX_UNSAVED:
+ context->reg[i].how = REG_CTX_UNSAVED;
+ break;
+ case REG_CTX_SAVED_OFFSET:
+ context->reg[i].how = REG_CTX_SAVED_OFFSET;
+ context->reg[i].loc.offset = orig_context->cfa - context->cfa +
+ orig_context->reg[fs->regs.reg[i].loc.reg].loc.offset;
+ break;
+ case REG_CTX_SAVED_REG:
+ context->reg[i].how = REG_CTX_SAVED_REG;
+ context->reg[i].loc.reg =
+ orig_context->reg[fs->regs.reg[i].loc.reg].loc.reg;
+ break;
+ case REG_CTX_SAVED_ADDR:
+ context->reg[i].how = REG_CTX_SAVED_ADDR;
+ context->reg[i].loc.addr =
+ orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "%s: unknown register rule", __func__);
+ }
+ break;
+ case REG_SAVED_EXP:
+ {
+ char *exp = fs->regs.reg[i].loc.exp;
+ ULONGEST len;
+ CORE_ADDR val;
+
+ len = read_uleb128 (fs->objfile->obfd, &exp);
+ val = execute_stack_op (fs->objfile, exp, exp + len,
+ orig_context, cfa);
+ context->reg[i].how = REG_CTX_SAVED_ADDR;
+ context->reg[i].loc.addr = val;
+ }
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "%s: unknown register rule", __func__);
+ }
+ get_reg ((char *) &context->ra, context, fs->retaddr_column);
+ unwind_tmp_obstack_free ();
+}
+
+static int
+is_cie (ULONGEST cie_id, int dwarf64)
+{
+ return dwarf64 ? (cie_id == 0xffffffffffffffff) : (cie_id == 0xffffffff);
+}
+
+static int
+compare_fde_unit (const void *a, const void *b)
+{
+ struct fde_unit **first, **second;
+ first = (struct fde_unit **) a;
+ second = (struct fde_unit **) b;
+ if ((*first)->initial_location > (*second)->initial_location)
+ return 1;
+ else if ((*first)->initial_location < (*second)->initial_location)
+ return -1;
+ else
+ return 0;
+}
+
+/* Build the cie_chunks and fde_chunks tables from informations
+ in .debug_frame section. */
+void
+dwarf2_build_frame_info (struct objfile *objfile)
+{
+ bfd *abfd = objfile->obfd;
+ char *start = NULL;
+ char *end = NULL;
+ int from_eh = 0;
+
+ obstack_init (&unwind_tmp_obstack);
+
+ dwarf_frame_buffer = 0;
+
+ if (dwarf_frame_offset)
+ {
+ dwarf_frame_buffer = dwarf2_read_section (objfile,
+ dwarf_frame_offset,
+ dwarf_frame_size);
+
+ start = dwarf_frame_buffer;
+ end = dwarf_frame_buffer + dwarf_frame_size;
+ }
+ else if (dwarf_eh_frame_offset)
+ {
+ dwarf_frame_buffer = dwarf2_read_section (objfile,
+ dwarf_eh_frame_offset,
+ dwarf_eh_frame_size);
+
+ start = dwarf_frame_buffer;
+ end = dwarf_frame_buffer + dwarf_eh_frame_size;
+
+ from_eh = 1;
+ }
+
+ if (start)
+ {
+ while (start < end)
+ {
+ unsigned long length;
+ ULONGEST cie_id;
+ ULONGEST unit_offset = start - dwarf_frame_buffer;
+ int bytes_read;
+ int dwarf64;
+ char *block_end;
+
+ length = read_initial_length (abfd, start, &bytes_read);
+ start += bytes_read;
+ dwarf64 = (bytes_read == 12);
+ block_end = start + length;
+
+ cie_id = read_length (abfd, start, &bytes_read, dwarf64);
+ start += bytes_read;
+
+ if ((from_eh && cie_id == 0) || is_cie (cie_id, dwarf64))
+ {
+ struct cie_unit *cie = cie_unit_alloc ();
+ char *aug;
+
+ cie->objfile = objfile;
+ cie->next = cie_chunks;
+ cie_chunks = cie;
+
+ cie->objfile = objfile;
+
+ cie->offset = unit_offset;
+
+ start++; /* version */
+
+ cie->augmentation = aug = start;
+ while (*start)
+ start++;
+ start++; /* skip past NUL */
+
+ cie->code_align = read_uleb128 (abfd, &start);
+ cie->data_align = read_sleb128 (abfd, &start);
+ cie->ra = read_1u (abfd, &start);
+
+ if (*aug == 'z')
+ {
+ int xtra = read_uleb128 (abfd, &start);
+ start += xtra;
+ ++aug;
+ }
+
+ while (*aug != '\0')
+ {
+ if (aug[0] == 'e' && aug[1] == 'h')
+ {
+ start += sizeof (void *);
+ aug += 2;
+ }
+ else if (aug[0] == 'R')
+ {
+ cie->addr_encoding = *start++;
+ aug += 1;
+ }
+ else if (aug[0] == 'P')
+ {
+ CORE_ADDR ptr;
+ ptr = read_encoded_pointer (abfd, &start,
+ cie->addr_encoding);
+ aug += 1;
+ }
+ else
+ warning ("%s(): unknown augmentation", __func__);
+ }
+
+ cie->data = start;
+ cie->data_length = block_end - start;
+ }
+ else
+ {
+ struct fde_unit *fde;
+ struct cie_unit *cie;
+
+ fde_chunks_need_space ();
+ fde = fde_unit_alloc ();
+
+ fde_chunks.array[fde_chunks.elems++] = fde;
+
+ fde->initial_location = read_pointer (abfd, &start)
+ + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ fde->address_range = read_pointer (abfd, &start);
+
+ cie = cie_chunks;
+ while(cie)
+ {
+ if (cie->objfile == objfile)
+ {
+ if (from_eh && (cie->offset == (unit_offset + bytes_read - cie_id)))
+ break;
+ if (!from_eh && (cie->offset == cie_id))
+ break;
+ }
+
+ cie = cie->next;
+ }
+
+ if (!cie)
+ error ("%s(): can't find CIE pointer", __func__);
+ fde->cie_ptr = cie;
+
+ if (cie->augmentation[0] == 'z')
+ read_uleb128 (abfd, &start);
+
+ fde->data = start;
+ fde->data_length = block_end - start;
+ }
+ start = block_end;
+ }
+ qsort (fde_chunks.array, fde_chunks.elems,
+ sizeof (struct fde_unit *), compare_fde_unit);
+ }
+}
+
+
+/* Return the frame address. */
+CORE_ADDR
+cfi_read_fp ()
+{
+ struct context *context;
+ struct frame_state *fs;
+ CORE_ADDR cfa;
+
+ context = context_alloc ();
+ fs = frame_state_alloc ();
+
+ context->ra = read_pc () + 1;
+
+ frame_state_for (context, fs);
+ update_context (context, fs, 0);
+
+ cfa = context->cfa;
+ unwind_tmp_obstack_free ();
+ return cfa;
+}
+
+/* Store the frame address. This function is not used. */
+
+void
+cfi_write_fp (CORE_ADDR val)
+{
+ struct context *context;
+ struct frame_state *fs;
+
+ context = context_alloc ();
+ fs = frame_state_alloc ();
+
+ context->ra = read_pc () + 1;
+
+ frame_state_for (context, fs);
+
+ if (fs->cfa_how == CFA_REG_OFFSET)
+ {
+ val -= fs->cfa_offset;
+ write_register_gen (fs->cfa_reg, (char *) &val);
+ }
+ else
+ warning ("Can't write fp.");
+
+ unwind_tmp_obstack_free ();
+}
+
+/* Restore the machine to the state it had before the current frame
+ was created. */
+void
+cfi_pop_frame (struct frame_info *fi)
+{
+ char regbuf[MAX_REGISTER_RAW_SIZE];
+ int regnum;
+
+ fi = get_current_frame ();
+
+ for (regnum = 0; regnum < NUM_REGS; regnum++)
+ {
+ get_reg (regbuf, UNWIND_CONTEXT (fi), regnum);
+ write_register_bytes (REGISTER_BYTE (regnum), regbuf,
+ REGISTER_RAW_SIZE (regnum));
+ }
+ write_register (PC_REGNUM, UNWIND_CONTEXT (fi)->ra);
+
+ flush_cached_frames ();
+}
+
+/* Determine the address of the calling function's frame. */
+CORE_ADDR
+cfi_frame_chain (struct frame_info *fi)
+{
+ struct context *context;
+ struct frame_state *fs;
+ CORE_ADDR cfa;
+
+ context = context_alloc ();
+ fs = frame_state_alloc ();
+ context_cpy (context, UNWIND_CONTEXT (fi));
+
+ /* outermost frame */
+ if (context->ra == 0)
+ {
+ unwind_tmp_obstack_free ();
+ return 0;
+ }
+
+ frame_state_for (context, fs);
+ update_context (context, fs, 1);
+
+ cfa = context->cfa;
+ unwind_tmp_obstack_free ();
+
+ return cfa;
+}
+
+/* Sets the pc of the frame. */
+void
+cfi_init_frame_pc (int fromleaf, struct frame_info *fi)
+{
+ if (fi->next)
+ get_reg ((char *) &(fi->pc), UNWIND_CONTEXT (fi->next), PC_REGNUM);
+ else
+ fi->pc = read_pc ();
+}
+
+/* Initialize unwind context informations of the frame. */
+void
+cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ struct frame_state *fs;
+
+ fs = frame_state_alloc ();
+ fi->context = frame_obstack_alloc (sizeof (struct context));
+ UNWIND_CONTEXT (fi)->reg =
+ frame_obstack_alloc (sizeof (struct context_reg) * NUM_REGS);
+ memset (UNWIND_CONTEXT (fi)->reg, 0,
+ sizeof (struct context_reg) * NUM_REGS);
+
+ if (fi->next)
+ {
+ context_cpy (UNWIND_CONTEXT (fi), UNWIND_CONTEXT (fi->next));
+ frame_state_for (UNWIND_CONTEXT (fi), fs);
+ update_context (UNWIND_CONTEXT (fi), fs, 1);
+ }
+ else
+ {
+ UNWIND_CONTEXT (fi)->ra = fi->pc + 1;
+ frame_state_for (UNWIND_CONTEXT (fi), fs);
+ update_context (UNWIND_CONTEXT (fi), fs, 0);
+ }
+ unwind_tmp_obstack_free ();
+}
+
+/* Obtain return address of the frame. */
+CORE_ADDR
+cfi_get_ra (struct frame_info *fi)
+{
+ return UNWIND_CONTEXT (fi)->ra;
+}
+
+/* Find register number REGNUM relative to FRAME and put its
+ (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
+ was optimized out (and thus can't be fetched). If the variable
+ was fetched from memory, set *ADDRP to where it was fetched from,
+ otherwise it was fetched from a register.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+void
+cfi_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR * addrp,
+ struct frame_info *frame,
+ int regnum, enum lval_type *lval)
+{
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+
+ if (addrp) /* default assumption: not found in memory */
+ *addrp = 0;
+
+ if (!frame->next)
+ {
+ read_register_gen (regnum, raw_buffer);
+ if (lval != NULL)
+ *lval = lval_register;
+ if (addrp != NULL)
+ *addrp = REGISTER_BYTE (regnum);
+ }
+ else
+ {
+ frame = frame->next;
+ switch (UNWIND_CONTEXT (frame)->reg[regnum].how)
+ {
+ case REG_CTX_UNSAVED:
+ read_register_gen (regnum, raw_buffer);
+ if (lval != NULL)
+ *lval = not_lval;
+ if (optimized != NULL)
+ *optimized = 1;
+ break;
+ case REG_CTX_SAVED_OFFSET:
+ target_read_memory (UNWIND_CONTEXT (frame)->cfa +
+ UNWIND_CONTEXT (frame)->reg[regnum].loc.offset,
+ raw_buffer, REGISTER_RAW_SIZE (regnum));
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (addrp != NULL)
+ *addrp =
+ UNWIND_CONTEXT (frame)->cfa +
+ UNWIND_CONTEXT (frame)->reg[regnum].loc.offset;
+ break;
+ case REG_CTX_SAVED_REG:
+ read_register_gen (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg,
+ raw_buffer);
+ if (lval != NULL)
+ *lval = lval_register;
+ if (addrp != NULL)
+ *addrp =
+ REGISTER_BYTE (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg);
+ break;
+ case REG_CTX_SAVED_ADDR:
+ target_read_memory (UNWIND_CONTEXT (frame)->reg[regnum].loc.addr,
+ raw_buffer, REGISTER_RAW_SIZE (regnum));
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (addrp != NULL)
+ *addrp = UNWIND_CONTEXT (frame)->reg[regnum].loc.addr;
+ break;
+ case REG_CTX_VALUE:
+ memcpy (raw_buffer, &UNWIND_CONTEXT (frame)->reg[regnum].loc.addr,
+ REGISTER_RAW_SIZE (regnum));
+ if (lval != NULL)
+ *lval = not_lval;
+ if (optimized != NULL)
+ *optimized = 0;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "cfi_get_saved_register: unknown register rule");
+ }
+ }
+}
+
+/* Return the register that the function uses for a frame pointer,
+ plus any necessary offset to be applied to the register before
+ any frame pointer offsets. */
+void
+cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_reg,
+ LONGEST * frame_offset)
+{
+ struct context *context;
+ struct frame_state *fs;
+
+ context = context_alloc ();
+ fs = frame_state_alloc ();
+
+ context->ra = read_pc () + 1;
+
+ frame_state_for (context, fs);
+
+ if (fs->cfa_how == CFA_REG_OFFSET)
+ {
+ *frame_reg = fs->cfa_reg;
+ *frame_offset = fs->cfa_offset;
+ }
+ else
+ error ("dwarf cfi error: CFA is not defined as CFA_REG_OFFSET");
+
+ unwind_tmp_obstack_free ();
+}
diff --git a/contrib/gdb/gdb/dwarf2cfi.h b/contrib/gdb/gdb/dwarf2cfi.h
new file mode 100644
index 0000000..f4c675a
--- /dev/null
+++ b/contrib/gdb/gdb/dwarf2cfi.h
@@ -0,0 +1,66 @@
+/* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger.
+ Copyright 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef DWARF2CFI_H
+#define DWARF2CFI_H
+
+/* Return the frame address. */
+CORE_ADDR cfi_read_fp ();
+
+/* Store the frame address. */
+void cfi_write_fp (CORE_ADDR val);
+
+/* Restore the machine to the state it had before the current frame
+ was created. */
+void cfi_pop_frame (struct frame_info *);
+
+/* Determine the address of the calling function's frame. */
+CORE_ADDR cfi_frame_chain (struct frame_info *fi);
+
+/* Sets the pc of the frame. */
+void cfi_init_frame_pc (int fromleaf, struct frame_info *fi);
+
+/* Initialize unwind context informations of the frame. */
+void cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi);
+
+/* Obtain return address of the frame. */
+CORE_ADDR cfi_get_ra (struct frame_info *fi);
+
+/* Find register number REGNUM relative to FRAME and put its
+ (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
+ was optimized out (and thus can't be fetched). If the variable
+ was fetched from memory, set *ADDRP to where it was fetched from,
+ otherwise it was fetched from a register.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+void cfi_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR * addrp,
+ struct frame_info *frame,
+ int regnum, enum lval_type *lval);
+
+/* Return the register that the function uses for a frame pointer,
+ plus any necessary offset to be applied to the register before
+ any frame pointer offsets. */
+void cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_regnum,
+ LONGEST * frame_offset);
+
+#endif
diff --git a/contrib/gdb/gdb/dwarf2read.c b/contrib/gdb/gdb/dwarf2read.c
index cf52066..9dbcbde 100644
--- a/contrib/gdb/gdb/dwarf2read.c
+++ b/contrib/gdb/gdb/dwarf2read.c
@@ -1,5 +1,6 @@
/* DWARF 2 debugging format support for GDB.
- Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
Inc. with support from Florida State University (under contract
@@ -8,25 +9,25 @@
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"
-#include "elf-bfd.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "symfile.h"
@@ -35,14 +36,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "buildsym.h"
#include "demangle.h"
#include "expression.h"
+#include "filenames.h" /* for DOSish file names */
+
#include "language.h"
#include "complaints.h"
-
+#include "bcache.h"
#include <fcntl.h>
#include "gdb_string.h"
+#include "gdb_assert.h"
#include <sys/types.h>
-/* .debug_info header for a compilation unit
+#ifndef DWARF2_REG_TO_REGNUM
+#define DWARF2_REG_TO_REGNUM(REG) (REG)
+#endif
+
+#if 0
+/* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot
be mapped directly onto the beginning of the .debug_info section. */
typedef struct comp_unit_header
@@ -56,6 +65,7 @@ typedef struct comp_unit_header
}
_COMP_UNIT_HEADER;
#define _ACTUAL_COMP_UNIT_HEADER_SIZE 11
+#endif
/* .debug_pubnames header
Because of alignment constraints, this structure has padding and cannot
@@ -122,6 +132,8 @@ static file_ptr dwarf_aranges_offset;
static file_ptr dwarf_loc_offset;
static file_ptr dwarf_macinfo_offset;
static file_ptr dwarf_str_offset;
+file_ptr dwarf_frame_offset;
+file_ptr dwarf_eh_frame_offset;
static unsigned int dwarf_info_size;
static unsigned int dwarf_abbrev_size;
@@ -131,6 +143,8 @@ static unsigned int dwarf_aranges_size;
static unsigned int dwarf_loc_size;
static unsigned int dwarf_macinfo_size;
static unsigned int dwarf_str_size;
+unsigned int dwarf_frame_size;
+unsigned int dwarf_eh_frame_size;
/* names of the debugging sections */
@@ -142,16 +156,23 @@ static unsigned int dwarf_str_size;
#define LOC_SECTION ".debug_loc"
#define MACINFO_SECTION ".debug_macinfo"
#define STR_SECTION ".debug_str"
+#define FRAME_SECTION ".debug_frame"
+#define EH_FRAME_SECTION ".eh_frame"
/* local data types */
-/* The data in a compilation unit header looks like this. */
+/* The data in a compilation unit header, after target2host
+ translation, looks like this. */
struct comp_unit_head
{
- unsigned int length;
+ unsigned long length;
short version;
unsigned int abbrev_offset;
unsigned char addr_size;
+ unsigned char signed_addr_p;
+ unsigned int offset_size; /* size of file offsets; either 4 or 8 */
+ unsigned int initial_length_size; /* size of the length field; either
+ 4 or 12 */
};
/* The data in the .debug_line statement prologue looks like this. */
@@ -180,6 +201,7 @@ struct partial_die_info
unsigned int offset;
unsigned int abbrev;
char *name;
+ int has_pc_info;
CORE_ADDR lowpc;
CORE_ADDR highpc;
struct dwarf_block *locdesc;
@@ -207,15 +229,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 */
@@ -227,8 +249,8 @@ struct attribute
{
char *str;
struct dwarf_block *blk;
- unsigned int unsnd;
- int snd;
+ unsigned long unsnd;
+ long int snd;
CORE_ADDR addr;
}
u;
@@ -287,6 +309,7 @@ static const struct language_defn *cu_language_defn;
static char *dwarf_info_buffer;
static char *dwarf_abbrev_buffer;
static char *dwarf_line_buffer;
+static char *dwarf_str_buffer;
/* A zeroed version of a partial die for initialization purposes. */
static struct partial_die_info zeroed_partial_die;
@@ -302,13 +325,28 @@ static struct partial_die_info zeroed_partial_die;
in buildsym.c. */
static struct pending **list_in_scope = &file_symbols;
-/* FIXME: The following variables pass additional information from
- decode_locdesc to the caller. */
-static int optimized_out; /* Kludge to identify optimized out variables */
-static int isreg; /* Kludge to identify register variables */
-static int offreg; /* Kludge to identify basereg references */
-static int basereg; /* Which base register is it relative to? */
-static int islocal; /* Kludge to identify local variables */
+/* FIXME: decode_locdesc sets these variables to describe the location
+ to the caller. These ought to be a structure or something. If
+ none of the flags are set, the object lives at the address returned
+ by decode_locdesc. */
+
+static int optimized_out; /* No ops in location in expression,
+ so object was optimized out. */
+static int isreg; /* Object lives in register.
+ decode_locdesc's return value is
+ the register number. */
+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 isderef; /* Value described by flags above is
+ the address of a pointer to the object. */
+static int islocal; /* Variable is at the returned offset
+ from the frame start, but there's
+ no identified frame pointer for
+ this function, so we can't say
+ which register it's relative to;
+ use LOC_LOCAL. */
/* DW_AT_frame_base values for the current function.
frame_base_reg is -1 if DW_AT_frame_base is missing, otherwise it
@@ -318,7 +356,7 @@ static int islocal; /* Kludge to identify local variables */
static int frame_base_reg;
static CORE_ADDR frame_base_offset;
-/* This value is added to each symbol value. FIXME: Generalize to
+/* This value is added to each symbol value. FIXME: Generalize to
the section_offsets structure used by dbxread (once this is done,
pass the appropriate section number to end_symtab). */
static CORE_ADDR baseaddr; /* Add to each symbol value */
@@ -333,27 +371,35 @@ 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;
+
+ /* Pointer to start of dwarf string buffer for the objfile. */
+
+ char *dwarf_str_buffer;
+
+ /* Size of dwarf string section for the objfile. */
+
+ unsigned int dwarf_str_size;
+ };
#define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private)
#define DWARF_INFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_info_buffer)
@@ -361,6 +407,8 @@ struct dwarf2_pinfo
#define DWARF_ABBREV_BUFFER(p) (PST_PRIVATE(p)->dwarf_abbrev_buffer)
#define DWARF_ABBREV_SIZE(p) (PST_PRIVATE(p)->dwarf_abbrev_size)
#define DWARF_LINE_BUFFER(p) (PST_PRIVATE(p)->dwarf_line_buffer)
+#define DWARF_STR_BUFFER(p) (PST_PRIVATE(p)->dwarf_str_buffer)
+#define DWARF_STR_SIZE(p) (PST_PRIVATE(p)->dwarf_str_size)
/* Maintain an array of referenced fundamental types for the current
compilation unit being read. For DWARF version 1, we have to construct
@@ -382,57 +430,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;
-
- /* Number of fields. */
- int nfields;
-
- /* Number of baseclasses. */
- int nbaseclasses;
+ {
+ /* List of data member and baseclasses fields. */
+ struct nextfield
+ {
+ struct nextfield *next;
+ int accessibility;
+ int virtuality;
+ struct field field;
+ }
+ *fields;
- /* Set if the accesibility of one of the fields is not public. */
- int non_public_fields;
+ /* Number of fields. */
+ int nfields;
- /* 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;
+ /* Number of baseclasses. */
+ int nbaseclasses;
- /* 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;
+ /* Set if the accesibility of one of the fields is not public. */
+ int non_public_fields;
- /* Number of entries in the fnfieldlists array. */
- int nfnfields;
-};
+ /* 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;
-/* FIXME: Kludge to mark a varargs function type for C++ member function
- argument processing. */
-#define TYPE_FLAG_VARARGS (1 << 10)
+ /* 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;
-/* 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 between dwarf2_add_member_fn and
- read_subroutine_type via TYPE_FIELD_ARTIFICIAL. */
-#define TYPE_FIELD_ARTIFICIAL TYPE_FIELD_BITPOS
+ /* Number of entries in the fnfieldlists array. */
+ int nfnfields;
+ };
/* Various complaints about symbol reading that don't abort the process */
@@ -464,6 +504,10 @@ static struct complaint dwarf2_unsupported_stack_op =
{
"unsupported stack op: '%s'", 0, 0
};
+static struct complaint dwarf2_complex_location_expr =
+{
+ "location expression too complex", 0, 0
+};
static struct complaint dwarf2_unsupported_tag =
{
"unsupported tag: '%s'", 0, 0
@@ -517,240 +561,248 @@ static struct complaint dwarf2_unsupported_const_value_attr =
"unsupported const value attribute form: '%s'", 0, 0
};
-/* Remember the addr_size read from the dwarf.
- If a target expects to link compilation units with differing address
- sizes, gdb needs to be sure that the appropriate size is here for
- whatever scope is currently getting read. */
-static int address_size;
-
-/* Some elf32 object file formats while linked for a 32 bit address
- space contain debug information that has assumed 64 bit
- addresses. Eg 64 bit MIPS target produced by GCC/GAS/LD where the
- symbol table contains 32bit address values while its .debug_info
- section contains 64 bit address values.
- ADDRESS_SIGNIFICANT_SIZE specifies the number significant bits in
- the ADDRESS_SIZE bytes read from the file */
-static int address_significant_size;
-
-/* Externals references. */
-extern int info_verbose; /* From main.c; nonzero => verbose */
-
/* local function prototypes */
-static void dwarf2_locate_sections PARAMS ((bfd *, asection *, PTR));
+static void dwarf2_locate_sections (bfd *, asection *, PTR);
#if 0
-static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *,
- struct section_offsets *,
- int));
+static void dwarf2_build_psymtabs_easy (struct objfile *, int);
#endif
-static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *,
- struct section_offsets *,
- int));
+static void dwarf2_build_psymtabs_hard (struct objfile *, int);
+
+static char *scan_partial_symbols (char *, struct objfile *,
+ CORE_ADDR *, CORE_ADDR *,
+ const struct comp_unit_head *);
+
+static void add_partial_symbol (struct partial_die_info *, struct objfile *,
+ const struct comp_unit_head *);
+
+static void dwarf2_psymtab_to_symtab (struct partial_symtab *);
+
+static void psymtab_to_symtab_1 (struct partial_symtab *);
-static char *scan_partial_symbols PARAMS ((char *, struct objfile *,
- CORE_ADDR *, CORE_ADDR *));
+char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int);
-static void add_partial_symbol PARAMS ((struct partial_die_info *,
- struct objfile *));
+static void dwarf2_read_abbrevs (bfd *, unsigned int);
-static void dwarf2_psymtab_to_symtab PARAMS ((struct partial_symtab *));
+static void dwarf2_empty_abbrev_table (PTR);
-static void psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
+static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int);
-static char *dwarf2_read_section PARAMS ((struct objfile *, file_ptr,
- unsigned int));
+static char *read_partial_die (struct partial_die_info *,
+ bfd *, char *,
+ const struct comp_unit_head *);
-static void dwarf2_read_abbrevs PARAMS ((bfd *, unsigned int));
+static char *read_full_die (struct die_info **, bfd *, char *,
+ const struct comp_unit_head *);
-static void dwarf2_empty_abbrev_table PARAMS ((PTR));
+static char *read_attribute (struct attribute *, struct attr_abbrev *,
+ bfd *, char *, const struct comp_unit_head *);
-static struct abbrev_info *dwarf2_lookup_abbrev PARAMS ((unsigned int));
+static char *read_attribute_value (struct attribute *, unsigned,
+ bfd *, char *, const struct comp_unit_head *);
-static char *read_partial_die PARAMS ((struct partial_die_info *,
- bfd *, char *, int *));
+static unsigned int read_1_byte (bfd *, char *);
-static char *read_full_die PARAMS ((struct die_info **, bfd *, char *));
+static int read_1_signed_byte (bfd *, char *);
-static char *read_attribute PARAMS ((struct attribute *, struct attr_abbrev *,
- bfd *, char *));
+static unsigned int read_2_bytes (bfd *, char *);
-static unsigned int read_1_byte PARAMS ((bfd *, char *));
+static unsigned int read_4_bytes (bfd *, char *);
-static int read_1_signed_byte PARAMS ((bfd *, char *));
+static unsigned long read_8_bytes (bfd *, char *);
-static unsigned int read_2_bytes PARAMS ((bfd *, char *));
+static CORE_ADDR read_address (bfd *, char *ptr, const struct comp_unit_head *,
+ int *bytes_read);
-static unsigned int read_4_bytes PARAMS ((bfd *, char *));
+static LONGEST read_initial_length (bfd *, char *,
+ struct comp_unit_head *, int *bytes_read);
-static unsigned int read_8_bytes PARAMS ((bfd *, char *));
+static LONGEST read_offset (bfd *, char *, const struct comp_unit_head *,
+ int *bytes_read);
-static CORE_ADDR read_address PARAMS ((bfd *, char *));
+static char *read_n_bytes (bfd *, char *, unsigned int);
-static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int));
+static char *read_string (bfd *, char *, unsigned int *);
-static char *read_string PARAMS ((bfd *, char *, unsigned int *));
+static char *read_indirect_string (bfd *, char *, const struct comp_unit_head *,
+ unsigned int *);
-static unsigned int read_unsigned_leb128 PARAMS ((bfd *, char *,
- unsigned int *));
+static unsigned long read_unsigned_leb128 (bfd *, char *, unsigned int *);
-static int read_signed_leb128 PARAMS ((bfd *, char *, unsigned int *));
+static long read_signed_leb128 (bfd *, char *, unsigned int *);
-static void set_cu_language PARAMS ((unsigned int));
+static void set_cu_language (unsigned int);
-static struct attribute *dwarf_attr PARAMS ((struct die_info *,
- unsigned int));
+static struct attribute *dwarf_attr (struct die_info *, unsigned int);
-static void dwarf_decode_lines PARAMS ((unsigned int, char *, bfd *));
+static int die_is_declaration (struct die_info *);
-static void dwarf2_start_subfile PARAMS ((char *, char *));
+static void dwarf_decode_lines (unsigned int, char *, bfd *,
+ const struct comp_unit_head *);
-static struct symbol *new_symbol PARAMS ((struct die_info *, struct type *,
- struct objfile *));
+static void dwarf2_start_subfile (char *, char *);
-static void dwarf2_const_value PARAMS ((struct attribute *, struct symbol *,
- struct objfile *));
+static struct symbol *new_symbol (struct die_info *, struct type *,
+ struct objfile *, const struct comp_unit_head *);
-static struct type *die_type PARAMS ((struct die_info *, struct objfile *));
+static void dwarf2_const_value (struct attribute *, struct symbol *,
+ struct objfile *, const struct comp_unit_head *);
-static struct type *die_containing_type PARAMS ((struct die_info *,
- struct objfile *));
+static void dwarf2_const_value_data (struct attribute *attr,
+ struct symbol *sym,
+ int bits);
+
+static struct type *die_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
+
+static struct type *die_containing_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
#if 0
-static struct type *type_at_offset PARAMS ((unsigned int, struct objfile *));
+static struct type *type_at_offset (unsigned int, struct objfile *);
#endif
-static struct type *tag_type_to_type PARAMS ((struct die_info *,
- struct objfile *));
+static struct type *tag_type_to_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_type_die PARAMS ((struct die_info *, struct objfile *));
+static void read_type_die (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_typedef PARAMS ((struct die_info *, struct objfile *));
+static void read_typedef (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_base_type PARAMS ((struct die_info *, struct objfile *));
+static void read_base_type (struct die_info *, struct objfile *);
-static void read_file_scope PARAMS ((struct die_info *, struct objfile *));
+static void read_file_scope (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_func_scope PARAMS ((struct die_info *, struct objfile *));
+static void read_func_scope (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_lexical_block_scope PARAMS ((struct die_info *,
- struct objfile *));
+static void read_lexical_block_scope (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static int dwarf2_get_pc_bounds PARAMS ((struct die_info *,
- CORE_ADDR *, CORE_ADDR *,
- struct objfile *));
+static int dwarf2_get_pc_bounds (struct die_info *,
+ CORE_ADDR *, CORE_ADDR *, struct objfile *);
-static void dwarf2_add_field PARAMS ((struct field_info *, struct die_info *,
- struct objfile *));
+static void dwarf2_add_field (struct field_info *, struct die_info *,
+ struct objfile *, const struct comp_unit_head *);
-static void dwarf2_attach_fields_to_type PARAMS ((struct field_info *,
- struct type *,
- struct objfile *));
+static void dwarf2_attach_fields_to_type (struct field_info *,
+ struct type *, struct objfile *);
-static char *skip_member_fn_name PARAMS ((char *));
+static void dwarf2_add_member_fn (struct field_info *,
+ struct die_info *, struct type *,
+ struct objfile *objfile,
+ const struct comp_unit_head *);
-static void dwarf2_add_member_fn PARAMS ((struct field_info *,
- struct die_info *, struct type *,
- struct objfile *objfile));
+static void dwarf2_attach_fn_fields_to_type (struct field_info *,
+ struct type *, struct objfile *);
-static void dwarf2_attach_fn_fields_to_type PARAMS ((struct field_info *,
- struct type *,
- struct objfile *));
+static void read_structure_scope (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_structure_scope PARAMS ((struct die_info *, struct objfile *));
+static void read_common_block (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_common_block PARAMS ((struct die_info *, struct objfile *));
+static void read_enumeration (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_enumeration PARAMS ((struct die_info *, struct objfile *));
+static struct type *dwarf_base_type (int, int, struct objfile *);
-static struct type *dwarf_base_type PARAMS ((int, int, struct objfile *));
+static CORE_ADDR decode_locdesc (struct dwarf_block *, struct objfile *,
+ const struct comp_unit_head *);
-static CORE_ADDR decode_locdesc PARAMS ((struct dwarf_block *,
- struct objfile *));
+static void read_array_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_array_type PARAMS ((struct die_info *, struct objfile *));
+static void read_tag_pointer_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_tag_pointer_type PARAMS ((struct die_info *,
- struct objfile *));
+static void read_tag_ptr_to_member_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_tag_ptr_to_member_type PARAMS ((struct die_info *,
- struct objfile *));
+static void read_tag_reference_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_tag_reference_type PARAMS ((struct die_info *,
- struct objfile *));
+static void read_tag_const_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_tag_const_type PARAMS ((struct die_info *, struct objfile *));
+static void read_tag_volatile_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_tag_volatile_type PARAMS ((struct die_info *,
- struct objfile *));
+static void read_tag_string_type (struct die_info *, struct objfile *);
-static void read_tag_string_type PARAMS ((struct die_info *,
- struct objfile *));
+static void read_subroutine_type (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static void read_subroutine_type PARAMS ((struct die_info *,
- struct objfile *));
+static struct die_info *read_comp_unit (char *, bfd *,
+ const struct comp_unit_head *);
-struct die_info *read_comp_unit PARAMS ((char *, bfd *));
+static void free_die_list (struct die_info *);
-static void free_die_list PARAMS ((struct die_info *));
+static struct cleanup *make_cleanup_free_die_list (struct die_info *);
-static void process_die PARAMS ((struct die_info *, struct objfile *));
+static void process_die (struct die_info *, struct objfile *,
+ const struct comp_unit_head *);
-static char *dwarf2_linkage_name PARAMS ((struct die_info *));
+static char *dwarf2_linkage_name (struct die_info *);
-static char *dwarf_tag_name PARAMS ((unsigned int));
+static char *dwarf_tag_name (unsigned int);
-static char *dwarf_attr_name PARAMS ((unsigned int));
+static char *dwarf_attr_name (unsigned int);
-static char *dwarf_form_name PARAMS ((unsigned int));
+static char *dwarf_form_name (unsigned int);
-static char *dwarf_stack_op_name PARAMS ((unsigned int));
+static char *dwarf_stack_op_name (unsigned int);
-static char *dwarf_bool_name PARAMS ((unsigned int));
+static char *dwarf_bool_name (unsigned int);
-static char *dwarf_type_encoding_name PARAMS ((unsigned int));
+static char *dwarf_type_encoding_name (unsigned int);
#if 0
-static char *dwarf_cfi_name PARAMS ((unsigned int));
+static char *dwarf_cfi_name (unsigned int);
-struct die_info *copy_die PARAMS ((struct die_info *));
+struct die_info *copy_die (struct die_info *);
#endif
-struct die_info *sibling_die PARAMS ((struct die_info *));
+static struct die_info *sibling_die (struct die_info *);
-void dump_die PARAMS ((struct die_info *));
+static void dump_die (struct die_info *);
-void dump_die_list PARAMS ((struct die_info *));
+static void dump_die_list (struct die_info *);
-void store_in_ref_table PARAMS ((unsigned int, struct die_info *));
+static void store_in_ref_table (unsigned int, struct die_info *);
-static void dwarf2_empty_die_ref_table PARAMS ((void));
+static void dwarf2_empty_hash_tables (void);
-static unsigned int dwarf2_get_ref_die_offset PARAMS ((struct attribute *));
+static unsigned int dwarf2_get_ref_die_offset (struct attribute *);
-struct die_info *follow_die_ref PARAMS ((unsigned int));
+static struct die_info *follow_die_ref (unsigned int);
-static struct type *dwarf2_fundamental_type PARAMS ((struct objfile *, int));
+static struct type *dwarf2_fundamental_type (struct objfile *, int);
/* memory allocation interface */
-static void dwarf2_free_tmp_obstack PARAMS ((PTR));
+static void dwarf2_free_tmp_obstack (PTR);
-static struct dwarf_block *dwarf_alloc_block PARAMS ((void));
+static struct dwarf_block *dwarf_alloc_block (void);
-static struct abbrev_info *dwarf_alloc_abbrev PARAMS ((void));
+static struct abbrev_info *dwarf_alloc_abbrev (void);
-static struct die_info *dwarf_alloc_die PARAMS ((void));
+static struct die_info *dwarf_alloc_die (void);
/* Try to locate the sections we need for DWARF 2 debugging
information and return true if we have enough to do something. */
int
-dwarf2_has_info (abfd)
- bfd *abfd;
+dwarf2_has_info (bfd *abfd)
{
dwarf_info_offset = dwarf_abbrev_offset = dwarf_line_offset = 0;
+ dwarf_str_offset = 0;
+ dwarf_frame_offset = dwarf_eh_frame_offset = 0;
bfd_map_over_sections (abfd, dwarf2_locate_sections, NULL);
if (dwarf_info_offset && dwarf_abbrev_offset)
{
@@ -767,10 +819,7 @@ dwarf2_has_info (abfd)
in. */
static void
-dwarf2_locate_sections (ignore_abfd, sectp, ignore_ptr)
- bfd *ignore_abfd;
- asection *sectp;
- PTR ignore_ptr;
+dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, PTR ignore_ptr)
{
if (STREQ (sectp->name, INFO_SECTION))
{
@@ -812,15 +861,22 @@ dwarf2_locate_sections (ignore_abfd, sectp, ignore_ptr)
dwarf_str_offset = sectp->filepos;
dwarf_str_size = bfd_get_section_size_before_reloc (sectp);
}
+ else if (STREQ (sectp->name, FRAME_SECTION))
+ {
+ dwarf_frame_offset = sectp->filepos;
+ dwarf_frame_size = bfd_get_section_size_before_reloc (sectp);
+ }
+ else if (STREQ (sectp->name, EH_FRAME_SECTION))
+ {
+ dwarf_eh_frame_offset = sectp->filepos;
+ dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp);
+ }
}
/* Build a partial symbol table. */
void
-dwarf2_build_psymtabs (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
{
/* We definitely need the .debug_info and .debug_abbrev sections */
@@ -835,8 +891,16 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
dwarf_line_offset,
dwarf_line_size);
- if (mainline || objfile->global_psymbols.size == 0 ||
- objfile->static_psymbols.size == 0)
+ if (dwarf_str_offset)
+ dwarf_str_buffer = dwarf2_read_section (objfile,
+ dwarf_str_offset,
+ dwarf_str_size);
+ else
+ dwarf_str_buffer = NULL;
+
+ if (mainline
+ || (objfile->global_psymbols.size == 0
+ && objfile->static_psymbols.size == 0))
{
init_psymbol_list (objfile, 1024);
}
@@ -844,17 +908,17 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
#if 0
if (dwarf_aranges_offset && dwarf_pubnames_offset)
{
- /* Things are significanlty easier if we have .debug_aranges and
+ /* Things are significantly easier if we have .debug_aranges and
.debug_pubnames sections */
- dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline);
+ dwarf2_build_psymtabs_easy (objfile, 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);
+ dwarf2_build_psymtabs_hard (objfile, mainline);
}
}
@@ -863,10 +927,7 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
.debug_pubnames and .debug_aranges sections. */
static void
-dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline)
{
bfd *abfd = objfile->obfd;
char *aranges_buffer, *pubnames_buffer;
@@ -879,8 +940,12 @@ dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
pubnames_ptr = pubnames_buffer;
while ((pubnames_ptr - pubnames_buffer) < dwarf_pubnames_size)
{
- entry_length = read_4_bytes (abfd, pubnames_ptr);
- pubnames_ptr += 4;
+ struct comp_unit_head cu_header;
+ int bytes_read;
+
+ entry_length = read_initial_length (abfd, pubnames_ptr, &cu_header,
+ &bytes_read);
+ pubnames_ptr += bytes_read;
version = read_1_byte (abfd, pubnames_ptr);
pubnames_ptr += 1;
info_offset = read_4_bytes (abfd, pubnames_ptr);
@@ -896,49 +961,101 @@ dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
}
#endif
+/* Read in the comp unit header information from the debug_info at
+ info_ptr. */
+
+static char *
+read_comp_unit_head (struct comp_unit_head *cu_header,
+ char *info_ptr, bfd *abfd)
+{
+ int signed_addr;
+ int bytes_read;
+ cu_header->length = read_initial_length (abfd, info_ptr, cu_header,
+ &bytes_read);
+ info_ptr += bytes_read;
+ cu_header->version = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ cu_header->abbrev_offset = read_offset (abfd, info_ptr, cu_header,
+ &bytes_read);
+ info_ptr += bytes_read;
+ cu_header->addr_size = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ signed_addr = bfd_get_sign_extend_vma (abfd);
+ if (signed_addr < 0)
+ internal_error (__FILE__, __LINE__,
+ "read_comp_unit_head: dwarf from non elf file");
+ cu_header->signed_addr_p = signed_addr;
+ return info_ptr;
+}
+
/* Build the partial symbol table by doing a quick pass through the
.debug_info and .debug_abbrev sections. */
static void
-dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
{
/* Instead of reading this into a big buffer, we should probably use
mmap() on architectures that support it. (FIXME) */
bfd *abfd = objfile->obfd;
char *info_ptr, *abbrev_ptr;
char *beg_of_comp_unit;
- struct comp_unit_head cu_header;
struct partial_die_info comp_unit_die;
struct partial_symtab *pst;
struct cleanup *back_to;
- int comp_unit_has_pc_info;
CORE_ADDR lowpc, highpc;
- /* Number of bytes of any addresses that are signficant */
- address_significant_size = get_elf_backend_data (abfd)->s->arch_size / 8;
-
info_ptr = dwarf_info_buffer;
abbrev_ptr = dwarf_abbrev_buffer;
+ /* We use dwarf2_tmp_obstack for objects that don't need to survive
+ the partial symbol scan, like attribute values.
+
+ We could reduce our peak memory consumption during partial symbol
+ table construction by freeing stuff from this obstack more often
+ --- say, after processing each compilation unit, or each die ---
+ but it turns out that this saves almost nothing. For an
+ executable with 11Mb of Dwarf 2 data, I found about 64k allocated
+ on dwarf2_tmp_obstack. Some investigation showed:
+
+ 1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*,
+ DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*. These are
+ all fixed-length values not requiring dynamic allocation.
+
+ 2) 30% of the attributes used the form DW_FORM_string. For
+ DW_FORM_string, read_attribute simply hands back a pointer to
+ the null-terminated string in dwarf_info_buffer, so no dynamic
+ allocation is needed there either.
+
+ 3) The remaining 1% of the attributes all used DW_FORM_block1.
+ 75% of those were DW_AT_frame_base location lists for
+ functions; the rest were DW_AT_location attributes, probably
+ for the global variables.
+
+ Anyway, what this all means is that the memory the dwarf2
+ reader uses as temporary space reading partial symbols is about
+ 0.5% as much as we use for dwarf_*_buffer. That's noise. */
+
obstack_init (&dwarf2_tmp_obstack);
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)
+ /* Since the objects we're extracting from dwarf_info_buffer vary in
+ length, only the individual functions to extract them (like
+ read_comp_unit_head and read_partial_die) can really know whether
+ the buffer is large enough to hold another complete object.
+
+ At the moment, they don't actually check that. If
+ dwarf_info_buffer holds just one extra byte after the last
+ compilation unit's dies, then read_comp_unit_head will happily
+ read off the end of the buffer. read_partial_die is similarly
+ casual. Those functions should be fixed.
+
+ For this loop condition, simply checking whether there's any data
+ left at all should be sufficient. */
+ while (info_ptr < dwarf_info_buffer + dwarf_info_size)
{
+ struct comp_unit_head cu_header;
beg_of_comp_unit = info_ptr;
- cu_header.length = read_4_bytes (abfd, info_ptr);
- info_ptr += 4;
- cu_header.version = read_2_bytes (abfd, info_ptr);
- info_ptr += 2;
- cu_header.abbrev_offset = read_4_bytes (abfd, info_ptr);
- info_ptr += 4;
- cu_header.addr_size = read_1_byte (abfd, info_ptr);
- info_ptr += 1;
- address_size = cu_header.addr_size;
+ info_ptr = read_comp_unit_head (&cu_header, info_ptr, abfd);
if (cu_header.version != 2)
{
@@ -952,7 +1069,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
(long) (beg_of_comp_unit - dwarf_info_buffer));
return;
}
- if (beg_of_comp_unit + cu_header.length + 4
+ if (beg_of_comp_unit + cu_header.length + cu_header.initial_length_size
> dwarf_info_buffer + dwarf_info_size)
{
error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0).",
@@ -960,27 +1077,20 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
(long) (beg_of_comp_unit - dwarf_info_buffer));
return;
}
- if (address_size < address_significant_size)
- {
- error ("Dwarf Error: bad address size (%ld) in compilation unit header (offset 0x%lx + 11).",
- (long) cu_header.addr_size,
- (long) (beg_of_comp_unit - dwarf_info_buffer));
- }
-
/* Read the abbrevs for this compilation unit into a table */
dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
make_cleanup (dwarf2_empty_abbrev_table, NULL);
/* Read the compilation unit die */
- info_ptr = read_partial_die (&comp_unit_die, abfd,
- info_ptr, &comp_unit_has_pc_info);
+ info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr,
+ &cu_header);
/* Set the language we're debugging */
set_cu_language (comp_unit_die.language);
/* Allocate a new partial symbol table structure */
- pst = start_psymtab_common (objfile, section_offsets,
- comp_unit_die.name ? comp_unit_die.name : "",
+ pst = start_psymtab_common (objfile, objfile->section_offsets,
+ comp_unit_die.name ? comp_unit_die.name : "",
comp_unit_die.lowpc,
objfile->global_psymbols.next,
objfile->static_psymbols.next);
@@ -988,12 +1098,14 @@ 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;
- baseaddr = ANOFFSET (section_offsets, 0);
+ 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_STR_BUFFER (pst) = dwarf_str_buffer;
+ DWARF_STR_SIZE (pst) = dwarf_str_size;
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
/* Store the function that reads in the rest of the symbol table */
pst->read_symtab = dwarf2_psymtab_to_symtab;
@@ -1003,17 +1115,18 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
If not, there's no more debug_info for this comp unit. */
if (comp_unit_die.has_children)
{
- info_ptr = scan_partial_symbols (info_ptr, objfile, &lowpc, &highpc);
+ info_ptr = scan_partial_symbols (info_ptr, objfile, &lowpc, &highpc,
+ &cu_header);
/* If the compilation unit didn't have an explicit address range,
then use the information extracted from its child dies. */
- if (!comp_unit_has_pc_info)
+ if (! comp_unit_die.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 -
@@ -1027,7 +1140,8 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
also happen.) This happens in VxWorks. */
free_named_symtabs (pst->filename);
- info_ptr = beg_of_comp_unit + cu_header.length + 4;
+ info_ptr = beg_of_comp_unit + cu_header.length
+ + cu_header.initial_length_size;
}
do_cleanups (back_to);
}
@@ -1035,11 +1149,9 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
/* Read in all interesting dies to the end of the compilation unit. */
static char *
-scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
- char *info_ptr;
- struct objfile *objfile;
- CORE_ADDR *lowpc;
- CORE_ADDR *highpc;
+scan_partial_symbols (char *info_ptr, struct objfile *objfile,
+ CORE_ADDR *lowpc, CORE_ADDR *highpc,
+ const struct comp_unit_head *cu_header)
{
bfd *abfd = objfile->obfd;
struct partial_die_info pdi;
@@ -1051,21 +1163,20 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
back to that level. */
int nesting_level = 1;
- int has_pc_info;
-
- *lowpc = ((CORE_ADDR) -1);
+
+ *lowpc = ((CORE_ADDR) -1);
*highpc = ((CORE_ADDR) 0);
while (nesting_level)
{
- info_ptr = read_partial_die (&pdi, abfd, info_ptr, &has_pc_info);
+ info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
if (pdi.name)
{
switch (pdi.tag)
{
case DW_TAG_subprogram:
- if (has_pc_info)
+ if (pdi.has_pc_info)
{
if (pdi.lowpc < *lowpc)
{
@@ -1078,7 +1189,7 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
if ((pdi.is_external || nesting_level == 1)
&& !pdi.is_declaration)
{
- add_partial_symbol (&pdi, objfile);
+ add_partial_symbol (&pdi, objfile, cu_header);
}
}
break;
@@ -1091,20 +1202,20 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
if ((pdi.is_external || nesting_level == 1)
&& !pdi.is_declaration)
{
- add_partial_symbol (&pdi, objfile);
+ add_partial_symbol (&pdi, objfile, cu_header);
}
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);
+ add_partial_symbol (&pdi, objfile, cu_header);
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);
+ add_partial_symbol (&pdi, objfile, cu_header);
break;
default:
break;
@@ -1112,8 +1223,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;
@@ -1139,9 +1250,8 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
}
static void
-add_partial_symbol (pdi, objfile)
- struct partial_die_info *pdi;
- struct objfile *objfile;
+add_partial_symbol (struct partial_die_info *pdi, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
CORE_ADDR addr = 0;
@@ -1151,20 +1261,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:
@@ -1184,7 +1294,7 @@ add_partial_symbol (pdi, objfile)
table building. */
if (pdi->locdesc)
- addr = decode_locdesc (pdi->locdesc, objfile);
+ addr = decode_locdesc (pdi->locdesc, objfile, cu_header);
if (pdi->locdesc || pdi->has_type)
add_psymbol_to_list (pdi->name, strlen (pdi->name),
VAR_NAMESPACE, LOC_STATIC,
@@ -1196,9 +1306,9 @@ add_partial_symbol (pdi, objfile)
/* Static Variable. Skip symbols without location descriptors. */
if (pdi->locdesc == NULL)
return;
- addr = decode_locdesc (pdi->locdesc, objfile);
+ addr = decode_locdesc (pdi->locdesc, objfile, cu_header);
/*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,
@@ -1217,7 +1327,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),
@@ -1248,8 +1358,7 @@ add_partial_symbol (pdi, objfile)
/* Expand this partial symbol table into a full symbol table. */
static void
-dwarf2_psymtab_to_symtab (pst)
- struct partial_symtab *pst;
+dwarf2_psymtab_to_symtab (struct partial_symtab *pst)
{
/* FIXME: This is barely more than a stub. */
if (pst != NULL)
@@ -1276,8 +1385,7 @@ dwarf2_psymtab_to_symtab (pst)
}
static void
-psymtab_to_symtab_1 (pst)
- struct partial_symtab *pst;
+psymtab_to_symtab_1 (struct partial_symtab *pst)
{
struct objfile *objfile = pst->objfile;
bfd *abfd = objfile->obfd;
@@ -1291,12 +1399,14 @@ 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);
- baseaddr = ANOFFSET (pst->section_offsets, 0);
+ 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);
+ dwarf_str_buffer = DWARF_STR_BUFFER (pst);
+ dwarf_str_size = DWARF_STR_SIZE (pst);
+ baseaddr = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (objfile));
cu_header_offset = offset;
info_ptr = dwarf_info_buffer + offset;
@@ -1304,34 +1414,27 @@ psymtab_to_symtab_1 (pst)
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
buildsym_init ();
- make_cleanup ((make_cleanup_func) really_free_pendings, NULL);
+ make_cleanup (really_free_pendings, NULL);
/* read in the comp_unit header */
- cu_header.length = read_4_bytes (abfd, info_ptr);
- info_ptr += 4;
- cu_header.version = read_2_bytes (abfd, info_ptr);
- info_ptr += 2;
- cu_header.abbrev_offset = read_4_bytes (abfd, info_ptr);
- info_ptr += 4;
- cu_header.addr_size = read_1_byte (abfd, info_ptr);
- info_ptr += 1;
+ info_ptr = read_comp_unit_head (&cu_header, info_ptr, abfd);
/* Read the abbrevs for this compilation unit */
dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
make_cleanup (dwarf2_empty_abbrev_table, NULL);
- dies = read_comp_unit (info_ptr, abfd);
+ dies = read_comp_unit (info_ptr, abfd, &cu_header);
- make_cleanup ((make_cleanup_func) free_die_list, dies);
+ make_cleanup_free_die_list (dies);
/* Do line number decoding in read_file_scope () */
- process_die (dies, objfile);
+ process_die (dies, objfile, &cu_header);
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)
{
@@ -1351,7 +1454,7 @@ psymtab_to_symtab_1 (pst)
}
}
}
- symtab = end_symtab (highpc + baseaddr, objfile, 0);
+ symtab = end_symtab (highpc + baseaddr, objfile, SECT_OFF_TEXT (objfile));
/* Set symtab language to language from DW_AT_language.
If the compilation is from a C file generated by language preprocessors,
@@ -1371,51 +1474,50 @@ psymtab_to_symtab_1 (pst)
/* Process a die and its children. */
static void
-process_die (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+process_die (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
switch (die->tag)
{
case DW_TAG_padding:
break;
case DW_TAG_compile_unit:
- read_file_scope (die, objfile);
+ read_file_scope (die, objfile, cu_header);
break;
case DW_TAG_subprogram:
- read_subroutine_type (die, objfile);
- read_func_scope (die, objfile);
+ read_subroutine_type (die, objfile, cu_header);
+ read_func_scope (die, objfile, cu_header);
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);
+ read_lexical_block_scope (die, objfile, cu_header);
break;
case DW_TAG_class_type:
case DW_TAG_structure_type:
case DW_TAG_union_type:
- read_structure_scope (die, objfile);
+ read_structure_scope (die, objfile, cu_header);
break;
case DW_TAG_enumeration_type:
- read_enumeration (die, objfile);
+ read_enumeration (die, objfile, cu_header);
break;
case DW_TAG_subroutine_type:
- read_subroutine_type (die, objfile);
+ read_subroutine_type (die, objfile, cu_header);
break;
case DW_TAG_array_type:
- read_array_type (die, objfile);
+ read_array_type (die, objfile, cu_header);
break;
case DW_TAG_pointer_type:
- read_tag_pointer_type (die, objfile);
+ read_tag_pointer_type (die, objfile, cu_header);
break;
case DW_TAG_ptr_to_member_type:
- read_tag_ptr_to_member_type (die, objfile);
+ read_tag_ptr_to_member_type (die, objfile, cu_header);
break;
case DW_TAG_reference_type:
- read_tag_reference_type (die, objfile);
+ read_tag_reference_type (die, objfile, cu_header);
break;
case DW_TAG_string_type:
read_tag_string_type (die, objfile);
@@ -1425,27 +1527,26 @@ process_die (die, objfile)
if (dwarf_attr (die, DW_AT_name))
{
/* Add a typedef symbol for the base type definition. */
- new_symbol (die, die->type, objfile);
+ new_symbol (die, die->type, objfile, cu_header);
}
break;
case DW_TAG_common_block:
- read_common_block (die, objfile);
+ read_common_block (die, objfile, cu_header);
break;
case DW_TAG_common_inclusion:
break;
default:
- new_symbol (die, NULL, objfile);
+ new_symbol (die, NULL, objfile, cu_header);
break;
}
}
static void
-read_file_scope (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_file_scope (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
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>";
@@ -1518,8 +1619,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);
}
@@ -1537,7 +1638,7 @@ read_file_scope (die, objfile)
if (attr)
{
line_offset = DW_UNSND (attr);
- dwarf_decode_lines (line_offset, comp_dir, abfd);
+ dwarf_decode_lines (line_offset, comp_dir, abfd, cu_header);
}
/* Process all dies in compilation unit. */
@@ -1546,16 +1647,15 @@ read_file_scope (die, objfile)
child_die = die->next;
while (child_die && child_die->tag)
{
- process_die (child_die, objfile);
+ process_die (child_die, objfile, cu_header);
child_die = sibling_die (child_die);
}
}
}
static void
-read_func_scope (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_func_scope (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
register struct context_stack *new;
CORE_ADDR lowpc;
@@ -1581,12 +1681,6 @@ read_func_scope (die, objfile)
objfile->ei.entry_func_highpc = highpc;
}
- if (STREQ (name, "main")) /* FIXME: hardwired name */
- {
- objfile->ei.main_func_lowpc = lowpc;
- objfile->ei.main_func_highpc = highpc;
- }
-
/* Decode DW_AT_frame_base location descriptor if present, keep result
for DW_OP_fbreg operands in decode_locdesc. */
frame_base_reg = -1;
@@ -1594,8 +1688,10 @@ read_func_scope (die, objfile)
attr = dwarf_attr (die, DW_AT_frame_base);
if (attr)
{
- CORE_ADDR addr = decode_locdesc (DW_BLOCK (attr), objfile);
- if (isreg)
+ CORE_ADDR addr = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ if (isderef)
+ complain (&dwarf2_unsupported_at_frame_base, name);
+ else if (isreg)
frame_base_reg = addr;
else if (offreg)
{
@@ -1607,7 +1703,7 @@ read_func_scope (die, objfile)
}
new = push_context (0, lowpc);
- new->name = new_symbol (die, die->type, objfile);
+ new->name = new_symbol (die, die->type, objfile, cu_header);
list_in_scope = &local_symbols;
if (die->has_children)
@@ -1615,7 +1711,7 @@ read_func_scope (die, objfile)
child_die = die->next;
while (child_die && child_die->tag)
{
- process_die (child_die, objfile);
+ process_die (child_die, objfile, cu_header);
child_die = sibling_die (child_die);
}
}
@@ -1631,9 +1727,8 @@ read_func_scope (die, objfile)
a new scope, process the dies, and then close the scope. */
static void
-read_lexical_block_scope (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_lexical_block_scope (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
register struct context_stack *new;
CORE_ADDR lowpc, highpc;
@@ -1651,7 +1746,7 @@ read_lexical_block_scope (die, objfile)
child_die = die->next;
while (child_die && child_die->tag)
{
- process_die (child_die, objfile);
+ process_die (child_die, objfile, cu_header);
child_die = sibling_die (child_die);
}
}
@@ -1669,11 +1764,8 @@ read_lexical_block_scope (die, objfile)
Return 1 if the attributes are present and valid, otherwise, return 0. */
static int
-dwarf2_get_pc_bounds (die, lowpc, highpc, objfile)
- struct die_info *die;
- CORE_ADDR *lowpc;
- CORE_ADDR *highpc;
- struct objfile *objfile;
+dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, CORE_ADDR *highpc,
+ struct objfile *objfile)
{
struct attribute *attr;
CORE_ADDR low;
@@ -1712,10 +1804,9 @@ dwarf2_get_pc_bounds (die, lowpc, highpc, objfile)
/* Add an aggregate field to the field list. */
static void
-dwarf2_add_field (fip, die, objfile)
- struct field_info *fip;
- struct die_info *die;
- struct objfile *objfile;
+dwarf2_add_field (struct field_info *fip, struct die_info *die,
+ struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct nextfield *new_field;
struct attribute *attr;
@@ -1724,7 +1815,7 @@ dwarf2_add_field (fip, die, objfile)
/* Allocate a new field list entry and link it in. */
new_field = (struct nextfield *) xmalloc (sizeof (struct nextfield));
- make_cleanup (free, new_field);
+ make_cleanup (xfree, new_field);
memset (new_field, 0, sizeof (struct nextfield));
new_field->next = fip->fields;
fip->fields = new_field;
@@ -1752,7 +1843,7 @@ dwarf2_add_field (fip, die, objfile)
if (die->tag == DW_TAG_member)
{
/* Get type of field. */
- fp->type = die_type (die, objfile);
+ fp->type = die_type (die, objfile, cu_header);
/* Get bit size of field (zero if none). */
attr = dwarf_attr (die, DW_AT_bit_size);
@@ -1770,7 +1861,7 @@ dwarf2_add_field (fip, die, objfile)
if (attr)
{
FIELD_BITPOS (*fp) =
- decode_locdesc (DW_BLOCK (attr), objfile) * bits_per_byte;
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header) * bits_per_byte;
}
else
FIELD_BITPOS (*fp) = 0;
@@ -1780,20 +1871,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);
@@ -1826,7 +1917,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;
@@ -1836,38 +1927,33 @@ dwarf2_add_field (fip, die, objfile)
else if (die->tag == DW_TAG_variable)
{
char *physname;
- char *cp;
/* C++ static member.
- Get physical name, extract field name from physical name. */
- physname = dwarf2_linkage_name (die);
- if (physname == NULL)
+ Get name of field. */
+ attr = dwarf_attr (die, DW_AT_name);
+ if (attr && DW_STRING (attr))
+ fieldname = DW_STRING (attr);
+ else
return;
- cp = physname;
- while (*cp && !is_cplus_marker (*cp))
- cp++;
- if (*cp)
- fieldname = cp + 1;
- if (*fieldname == '\0')
- {
- complain (&dwarf2_bad_static_member_name, physname);
- }
+ /* Get physical name. */
+ physname = dwarf2_linkage_name (die);
SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname),
- &objfile->type_obstack));
- FIELD_TYPE (*fp) = die_type (die, objfile);
+ &objfile->type_obstack));
+ FIELD_TYPE (*fp) = die_type (die, objfile, cu_header);
FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname),
- &objfile->type_obstack);
+ &objfile->type_obstack);
}
else if (die->tag == DW_TAG_inheritance)
{
/* C++ base class field. */
attr = dwarf_attr (die, DW_AT_data_member_location);
if (attr)
- FIELD_BITPOS (*fp) = decode_locdesc (DW_BLOCK (attr), objfile) * bits_per_byte;
+ FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), objfile, cu_header)
+ * bits_per_byte);
FIELD_BITSIZE (*fp) = 0;
- FIELD_TYPE (*fp) = die_type (die, objfile);
+ FIELD_TYPE (*fp) = die_type (die, objfile, cu_header);
FIELD_NAME (*fp) = type_name_no_tag (fp->type);
fip->nbaseclasses++;
}
@@ -1876,10 +1962,8 @@ dwarf2_add_field (fip, die, objfile)
/* Create the vector of fields, and attach it to the type. */
static void
-dwarf2_attach_fields_to_type (fip, type, objfile)
- struct field_info *fip;
- struct type *type;
- struct objfile *objfile;
+dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type,
+ struct objfile *objfile)
{
int nfields = fip->nfields;
@@ -1929,78 +2013,45 @@ 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;
}
}
-/* Skip to the end of a member function name in a mangled name. */
-
-static char *
-skip_member_fn_name (physname)
- char *physname;
-{
- char *endname = physname;
-
- /* Skip over leading underscores. */
- while (*endname == '_')
- endname++;
-
- /* Find two succesive underscores. */
- do
- endname = strchr (endname, '_');
- while (endname != NULL && *++endname != '_');
-
- if (endname == NULL)
- {
- complain (&dwarf2_bad_member_name_complaint, physname);
- endname = physname;
- }
- else
- {
- /* Take care of trailing underscores. */
- if (endname[1] != '_')
- endname--;
- }
- return endname;
-}
-
/* Add a member function to the proper fieldlist. */
static void
-dwarf2_add_member_fn (fip, die, type, objfile)
- struct field_info *fip;
- struct die_info *die;
- struct type *type;
- struct objfile *objfile;
+dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
+ struct type *type, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct attribute *attr;
struct fnfieldlist *flp;
@@ -2010,46 +2061,15 @@ dwarf2_add_member_fn (fip, die, type, objfile)
char *physname;
struct nextfnfield *new_fnfield;
- /* Extract member function name from mangled name. */
- physname = dwarf2_linkage_name (die);
- if (physname == NULL)
- return;
- if ((physname[0] == '_' && physname[1] == '_'
- && 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. */
- if (TYPE_TAG_NAME (type))
- {
- char *p = strchr (TYPE_TAG_NAME (type), '<');
-
- if (p == NULL)
- fieldname = TYPE_TAG_NAME (type);
- else
- fieldname = obsavestring (TYPE_TAG_NAME (type),
- p - TYPE_TAG_NAME (type),
- &objfile->type_obstack);
- }
- else
- {
- char *anon_name = "";
- fieldname = obsavestring (anon_name, strlen (anon_name),
- &objfile->type_obstack);
- }
- }
+ /* Get name of member function. */
+ attr = dwarf_attr (die, DW_AT_name);
+ if (attr && DW_STRING (attr))
+ fieldname = DW_STRING (attr);
else
- {
- char *endname = skip_member_fn_name (physname);
+ return;
- /* Ignore member function if we were unable not extract the member
- function name. */
- if (endname == physname)
- return;
- fieldname = obsavestring (physname, endname - physname,
- &objfile->type_obstack);
- }
+ /* Get the mangled name. */
+ physname = dwarf2_linkage_name (die);
/* Look up member function name in fieldlist. */
for (i = 0; i < fip->nfnfields; i++)
@@ -2068,10 +2088,9 @@ 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 (free_current_contents, &fip->fnfieldlists);
}
flp = &fip->fnfieldlists[fip->nfnfields];
flp->name = fieldname;
@@ -2083,7 +2102,7 @@ dwarf2_add_member_fn (fip, die, type, objfile)
/* Create a new member function field and chain it to the field list
entry. */
new_fnfield = (struct nextfnfield *) xmalloc (sizeof (struct nextfnfield));
- make_cleanup (free, new_fnfield);
+ make_cleanup (xfree, new_fnfield);
memset (new_fnfield, 0, sizeof (struct nextfnfield));
new_fnfield->next = flp->head;
flp->head = new_fnfield;
@@ -2108,7 +2127,7 @@ dwarf2_add_member_fn (fip, die, type, objfile)
arg_types[iparams] = TYPE_FIELD_TYPE (die->type, iparams);
/* Set last entry in argument type vector. */
- if (TYPE_FLAGS (die->type) & TYPE_FLAG_VARARGS)
+ if (TYPE_VARARGS (die->type))
arg_types[nparams] = NULL;
else
arg_types[nparams] = dwarf2_fundamental_type (objfile, FT_VOID);
@@ -2116,11 +2135,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;
}
@@ -2129,7 +2148,7 @@ dwarf2_add_member_fn (fip, die, type, objfile)
/* Get fcontext from DW_AT_containing_type if present. */
if (dwarf_attr (die, DW_AT_containing_type) != NULL)
- fnp->fcontext = die_containing_type (die, objfile);
+ fnp->fcontext = die_containing_type (die, objfile, cu_header);
/* dwarf2 doesn't have stubbed physical names, so the setting of is_const
and is_volatile is irrelevant, as it is needed by gdb_mangle_name only. */
@@ -2140,28 +2159,31 @@ 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;
}
}
+ /* Check for artificial methods. */
+ attr = dwarf_attr (die, DW_AT_artificial);
+ if (attr && DW_UNSND (attr) != 0)
+ fnp->is_artificial = 1;
+
/* Get index in virtual function table if it is a virtual member function. */
attr = dwarf_attr (die, DW_AT_vtable_elem_location);
if (attr)
- fnp->voffset = decode_locdesc (DW_BLOCK (attr), objfile) + 2;
+ fnp->voffset = decode_locdesc (DW_BLOCK (attr), objfile, cu_header) + 2;
}
/* Create the vector of member function fields, and attach it to the type. */
static void
-dwarf2_attach_fn_fields_to_type (fip, type, objfile)
- struct field_info *fip;
- struct type *type;
- struct objfile *objfile;
+dwarf2_attach_fn_fields_to_type (struct field_info *fip, struct type *type,
+ struct objfile *objfile)
{
struct fnfieldlist *flp;
int total_length = 0;
@@ -2182,7 +2204,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;
}
@@ -2208,9 +2230,8 @@ dwarf2_attach_fn_fields_to_type (fip, type, objfile)
suppresses creating a symbol table entry itself). */
static void
-read_structure_scope (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_structure_scope (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type;
struct attribute *attr;
@@ -2237,7 +2258,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;
}
@@ -2256,7 +2277,7 @@ read_structure_scope (die, objfile)
type within the structure itself. */
die->type = type;
- if (die->has_children)
+ if (die->has_children && ! die_is_declaration (die))
{
struct field_info fi;
struct die_info *child_die;
@@ -2270,27 +2291,27 @@ read_structure_scope (die, objfile)
{
if (child_die->tag == DW_TAG_member)
{
- dwarf2_add_field (&fi, child_die, objfile);
+ dwarf2_add_field (&fi, child_die, objfile, cu_header);
}
else if (child_die->tag == DW_TAG_variable)
{
/* C++ static member. */
- dwarf2_add_field (&fi, child_die, objfile);
+ dwarf2_add_field (&fi, child_die, objfile, cu_header);
}
else if (child_die->tag == DW_TAG_subprogram)
{
/* C++ member function. */
- process_die (child_die, objfile);
- dwarf2_add_member_fn (&fi, child_die, type, objfile);
+ process_die (child_die, objfile, cu_header);
+ dwarf2_add_member_fn (&fi, child_die, type, objfile, cu_header);
}
else if (child_die->tag == DW_TAG_inheritance)
{
/* C++ base class field. */
- dwarf2_add_field (&fi, child_die, objfile);
+ dwarf2_add_field (&fi, child_die, objfile, cu_header);
}
else
{
- process_die (child_die, objfile);
+ process_die (child_die, objfile, cu_header);
}
child_die = sibling_die (child_die);
}
@@ -2302,18 +2323,19 @@ 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. */
if (dwarf_attr (die, DW_AT_containing_type) != NULL)
{
- struct type *t = die_containing_type (die, objfile);
+ struct type *t = die_containing_type (die, objfile, cu_header);
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. */
@@ -2334,7 +2356,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
{
@@ -2343,7 +2365,7 @@ read_structure_scope (die, objfile)
}
}
- new_symbol (die, type, objfile);
+ new_symbol (die, type, objfile, cu_header);
do_cleanups (back_to);
}
@@ -2353,7 +2375,7 @@ read_structure_scope (die, objfile)
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
}
- die->type = type;
+ finish_cv_type (die->type);
}
/* Given a pointer to a die which begins an enumeration, process all
@@ -2366,9 +2388,8 @@ read_structure_scope (die, objfile)
NOTE: We reverse the order of the element list. */
static void
-read_enumeration (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_enumeration (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct die_info *child_die;
struct type *type;
@@ -2408,14 +2429,14 @@ read_enumeration (die, objfile)
{
if (child_die->tag != DW_TAG_enumerator)
{
- process_die (child_die, objfile);
+ process_die (child_die, objfile, cu_header);
}
else
{
attr = dwarf_attr (child_die, DW_AT_name);
if (attr)
{
- sym = new_symbol (child_die, type, objfile);
+ sym = new_symbol (child_die, type, objfile, cu_header);
if (SYMBOL_VALUE (sym) < 0)
unsigned_enum = 0;
@@ -2424,7 +2445,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);
@@ -2446,13 +2467,13 @@ read_enumeration (die, objfile)
TYPE_ALLOC (type, sizeof (struct field) * num_fields);
memcpy (TYPE_FIELDS (type), fields,
sizeof (struct field) * num_fields);
- free (fields);
+ xfree (fields);
}
if (unsigned_enum)
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
}
die->type = type;
- new_symbol (die, type, objfile);
+ new_symbol (die, type, objfile, cu_header);
}
/* Extract all information from a DW_TAG_array_type DIE and put it in
@@ -2460,9 +2481,8 @@ read_enumeration (die, objfile)
arrays. */
static void
-read_array_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_array_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct die_info *child_die;
struct type *type = NULL;
@@ -2478,7 +2498,7 @@ read_array_type (die, objfile)
return;
}
- element_type = die_type (die, objfile);
+ element_type = die_type (die, objfile, cu_header);
/* Irix 6.2 native cc creates array types without children for
arrays with unspecified length. */
@@ -2507,7 +2527,7 @@ read_array_type (die, objfile)
low = 1;
}
- index_type = die_type (child_die, objfile);
+ index_type = die_type (child_die, objfile, cu_header);
attr = dwarf_attr (child_die, DW_AT_lower_bound);
if (attr)
{
@@ -2516,9 +2536,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);
}
@@ -2542,9 +2562,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);
}
@@ -2575,10 +2595,9 @@ 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 (free_current_contents, &range_types);
}
range_types[ndim++] = create_range_type (NULL, index_type, low, high);
}
@@ -2600,9 +2619,8 @@ read_array_type (die, objfile)
/* First cut: install each common block member as a global variable. */
static void
-read_common_block (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_common_block (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct die_info *child_die;
struct attribute *attr;
@@ -2612,19 +2630,19 @@ read_common_block (die, objfile)
attr = dwarf_attr (die, DW_AT_location);
if (attr)
{
- base = decode_locdesc (DW_BLOCK (attr), objfile);
+ base = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
}
if (die->has_children)
{
child_die = die->next;
while (child_die && child_die->tag)
{
- sym = new_symbol (child_die, NULL, objfile);
+ sym = new_symbol (child_die, NULL, objfile, cu_header);
attr = dwarf_attr (child_die, DW_AT_data_member_location);
if (attr)
{
SYMBOL_VALUE_ADDRESS (sym) =
- base + decode_locdesc (DW_BLOCK (attr), objfile);
+ base + decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
add_symbol_to_list (sym, &global_symbols);
}
child_die = sibling_die (child_die);
@@ -2636,9 +2654,8 @@ read_common_block (die, objfile)
the user defined type vector. */
static void
-read_tag_pointer_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_pointer_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type;
struct attribute *attr;
@@ -2648,7 +2665,7 @@ read_tag_pointer_type (die, objfile)
return;
}
- type = lookup_pointer_type (die_type (die, objfile));
+ type = lookup_pointer_type (die_type (die, objfile, cu_header));
attr = dwarf_attr (die, DW_AT_byte_size);
if (attr)
{
@@ -2656,7 +2673,7 @@ read_tag_pointer_type (die, objfile)
}
else
{
- TYPE_LENGTH (type) = address_size;
+ TYPE_LENGTH (type) = cu_header->addr_size;
}
die->type = type;
}
@@ -2665,9 +2682,8 @@ read_tag_pointer_type (die, objfile)
the user defined type vector. */
static void
-read_tag_ptr_to_member_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_ptr_to_member_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type;
struct type *to_type;
@@ -2679,8 +2695,8 @@ read_tag_ptr_to_member_type (die, objfile)
}
type = alloc_type (objfile);
- to_type = die_type (die, objfile);
- domain = die_containing_type (die, objfile);
+ to_type = die_type (die, objfile, cu_header);
+ domain = die_containing_type (die, objfile, cu_header);
smash_to_member_type (type, domain, to_type);
die->type = type;
@@ -2690,9 +2706,8 @@ read_tag_ptr_to_member_type (die, objfile)
the user defined type vector. */
static void
-read_tag_reference_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_reference_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type;
struct attribute *attr;
@@ -2702,7 +2717,7 @@ read_tag_reference_type (die, objfile)
return;
}
- type = lookup_reference_type (die_type (die, objfile));
+ type = lookup_reference_type (die_type (die, objfile, cu_header));
attr = dwarf_attr (die, DW_AT_byte_size);
if (attr)
{
@@ -2710,37 +2725,39 @@ read_tag_reference_type (die, objfile)
}
else
{
- TYPE_LENGTH (type) = address_size;
+ TYPE_LENGTH (type) = cu_header->addr_size;
}
die->type = type;
}
static void
-read_tag_const_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_const_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
+ struct type *base_type;
+
if (die->type)
{
return;
}
- complain (&dwarf2_const_ignored);
- die->type = die_type (die, objfile);
+ base_type = die_type (die, objfile, cu_header);
+ die->type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0);
}
static void
-read_tag_volatile_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_volatile_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
+ struct type *base_type;
+
if (die->type)
{
return;
}
- complain (&dwarf2_volatile_ignored);
- die->type = die_type (die, objfile);
+ base_type = die_type (die, objfile, cu_header);
+ die->type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0);
}
/* Extract all information from a DW_TAG_string_type DIE and add to
@@ -2749,9 +2766,7 @@ read_tag_volatile_type (die, objfile)
attribute to reference it. */
static void
-read_tag_string_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_tag_string_type (struct die_info *die, struct objfile *objfile)
{
struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr;
@@ -2769,30 +2784,47 @@ read_tag_string_type (die, objfile)
}
else
{
- length = 1;
+ /* check for the DW_AT_byte_size attribute */
+ attr = dwarf_attr (die, DW_AT_byte_size);
+ if (attr)
+ {
+ length = DW_UNSND (attr);
+ }
+ else
+ {
+ length = 1;
+ }
}
index_type = dwarf2_fundamental_type (objfile, FT_INTEGER);
range_type = create_range_type (NULL, index_type, 1, length);
- char_type = dwarf2_fundamental_type (objfile, FT_CHAR);
- type = create_string_type (char_type, range_type);
+ if (cu_language == language_fortran)
+ {
+ /* Need to create a unique string type for bounds
+ information */
+ type = create_string_type (0, range_type);
+ }
+ else
+ {
+ char_type = dwarf2_fundamental_type (objfile, FT_CHAR);
+ type = create_string_type (char_type, range_type);
+ }
die->type = type;
}
/* 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)
- struct die_info *die;
- struct objfile *objfile;
+read_subroutine_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type; /* Type that this function returns */
struct type *ftype; /* Function that returns above type */
@@ -2803,7 +2835,7 @@ read_subroutine_type (die, objfile)
{
return;
}
- type = die_type (die, objfile);
+ type = die_type (die, objfile, cu_header);
ftype = lookup_function_type (type);
/* All functions in C++ have prototypes. */
@@ -2842,16 +2874,17 @@ 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);
else
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
- TYPE_FIELD_TYPE (ftype, iparams) = die_type (child_die, objfile);
+ TYPE_FIELD_TYPE (ftype, iparams) = die_type (child_die, objfile,
+ cu_header);
iparams++;
}
child_die = sibling_die (child_die);
@@ -2862,30 +2895,21 @@ read_subroutine_type (die, objfile)
}
static void
-read_typedef (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_typedef (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
- struct type *type;
+ struct attribute *attr;
+ char *name = NULL;
if (!die->type)
{
- struct attribute *attr;
- struct type *xtype;
-
- xtype = die_type (die, objfile);
-
- type = alloc_type (objfile);
- TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
- TYPE_FLAGS (type) |= TYPE_FLAG_TARGET_STUB;
- TYPE_TARGET_TYPE (type) = xtype;
attr = dwarf_attr (die, DW_AT_name);
if (attr && DW_STRING (attr))
- TYPE_NAME (type) = obsavestring (DW_STRING (attr),
- strlen (DW_STRING (attr)),
- &objfile->type_obstack);
-
- die->type = type;
+ {
+ name = DW_STRING (attr);
+ }
+ die->type = init_type (TYPE_CODE_TYPEDEF, 0, TYPE_FLAG_TARGET_STUB, name, objfile);
+ TYPE_TARGET_TYPE (die->type) = die_type (die, objfile, cu_header);
}
}
@@ -2893,9 +2917,7 @@ read_typedef (die, objfile)
it in the TYPE field of the die. */
static void
-read_base_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_base_type (struct die_info *die, struct objfile *objfile)
{
struct type *type;
struct attribute *attr;
@@ -2921,18 +2943,18 @@ read_base_type (die, objfile)
if (attr && DW_STRING (attr))
{
enum type_code code = TYPE_CODE_INT;
- int is_unsigned = 0;
+ int type_flags = 0;
switch (encoding)
{
case DW_ATE_address:
/* Turn DW_ATE_address into a void * pointer. */
code = TYPE_CODE_PTR;
- is_unsigned = 1;
+ type_flags |= TYPE_FLAG_UNSIGNED;
break;
case DW_ATE_boolean:
code = TYPE_CODE_BOOL;
- is_unsigned = 1;
+ type_flags |= TYPE_FLAG_UNSIGNED;
break;
case DW_ATE_complex_float:
code = TYPE_CODE_COMPLEX;
@@ -2945,14 +2967,14 @@ read_base_type (die, objfile)
break;
case DW_ATE_unsigned:
case DW_ATE_unsigned_char:
- is_unsigned = 1;
+ type_flags |= TYPE_FLAG_UNSIGNED;
break;
default:
complain (&dwarf2_unsupported_at_encoding,
dwarf_type_encoding_name (encoding));
break;
}
- type = init_type (code, size, is_unsigned, DW_STRING (attr), objfile);
+ type = init_type (code, size, type_flags, DW_STRING (attr), objfile);
if (encoding == DW_ATE_address)
TYPE_TARGET_TYPE (type) = dwarf2_fundamental_type (objfile, FT_VOID);
}
@@ -2965,24 +2987,24 @@ read_base_type (die, objfile)
/* Read a whole compilation unit into a linked list of dies. */
-struct die_info *
-read_comp_unit (info_ptr, abfd)
- char *info_ptr;
- bfd *abfd;
+static struct die_info *
+read_comp_unit (char *info_ptr, bfd *abfd,
+ const struct comp_unit_head *cu_header)
{
struct die_info *first_die, *last_die, *die;
char *cur_ptr;
int nesting_level;
- /* Reset die reference table, we are building a new one now. */
- dwarf2_empty_die_ref_table ();
+ /* Reset die reference table; we are
+ building new ones now. */
+ dwarf2_empty_hash_tables ();
cur_ptr = info_ptr;
nesting_level = 0;
first_die = last_die = NULL;
do
{
- cur_ptr = read_full_die (&die, abfd, cur_ptr);
+ cur_ptr = read_full_die (&die, abfd, cur_ptr, cu_header);
if (die->has_children)
{
nesting_level++;
@@ -3014,8 +3036,7 @@ read_comp_unit (info_ptr, abfd)
/* Free a linked list of dies. */
static void
-free_die_list (dies)
- struct die_info *dies;
+free_die_list (struct die_info *dies)
{
struct die_info *die, *next;
@@ -3023,20 +3044,31 @@ free_die_list (dies)
while (die)
{
next = die->next;
- free (die->attrs);
- free (die);
+ xfree (die->attrs);
+ xfree (die);
die = next;
}
}
+static void
+do_free_die_list_cleanup (void *dies)
+{
+ free_die_list (dies);
+}
+
+static struct cleanup *
+make_cleanup_free_die_list (struct die_info *dies)
+{
+ return make_cleanup (do_free_die_list_cleanup, dies);
+}
+
+
/* Read the contents of the section at OFFSET and of size SIZE from the
object file specified by OBJFILE into the psymbol_obstack and return it. */
-static char *
-dwarf2_read_section (objfile, offset, size)
- struct objfile *objfile;
- file_ptr offset;
- unsigned int size;
+char *
+dwarf2_read_section (struct objfile *objfile, file_ptr offset,
+ unsigned int size)
{
bfd *abfd = objfile->obfd;
char *buf;
@@ -3046,11 +3078,11 @@ dwarf2_read_section (objfile, offset, size)
buf = (char *) obstack_alloc (&objfile->psymbol_obstack, size);
if ((bfd_seek (abfd, offset, SEEK_SET) != 0) ||
- (bfd_read (buf, size, 1, abfd) != size))
+ (bfd_bread (buf, size, abfd) != size))
{
buf = NULL;
error ("Dwarf Error: Can't read DWARF data from '%s'",
- bfd_get_filename (abfd));
+ bfd_get_filename (abfd));
}
return buf;
}
@@ -3061,9 +3093,7 @@ dwarf2_read_section (objfile, offset, size)
in a hash table. */
static void
-dwarf2_read_abbrevs (abfd, offset)
- bfd * abfd;
- unsigned int offset;
+dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
{
char *abbrev_ptr;
struct abbrev_info *cur_abbrev;
@@ -3101,7 +3131,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;
@@ -3117,13 +3147,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;
@@ -3136,8 +3166,7 @@ dwarf2_read_abbrevs (abfd, offset)
/* ARGSUSED */
static void
-dwarf2_empty_abbrev_table (ignore)
- PTR ignore;
+dwarf2_empty_abbrev_table (PTR ignore)
{
int i;
struct abbrev_info *abbrev, *next;
@@ -3149,8 +3178,8 @@ dwarf2_empty_abbrev_table (ignore)
while (abbrev)
{
next = abbrev->next;
- free (abbrev->attrs);
- free (abbrev);
+ xfree (abbrev->attrs);
+ xfree (abbrev);
abbrev = next;
}
dwarf2_abbrevs[i] = NULL;
@@ -3160,8 +3189,7 @@ dwarf2_empty_abbrev_table (ignore)
/* Lookup an abbrev_info structure in the abbrev hash table. */
static struct abbrev_info *
-dwarf2_lookup_abbrev (number)
- unsigned int number;
+dwarf2_lookup_abbrev (unsigned int number)
{
unsigned int hash_number;
struct abbrev_info *abbrev;
@@ -3182,22 +3210,18 @@ dwarf2_lookup_abbrev (number)
/* Read a minimal amount of information into the minimal die structure. */
static char *
-read_partial_die (part_die, abfd, info_ptr, has_pc_info)
- struct partial_die_info *part_die;
- bfd * abfd;
- char *info_ptr;
- int *has_pc_info;
+read_partial_die (struct partial_die_info *part_die, bfd *abfd,
+ char *info_ptr, const struct comp_unit_head *cu_header)
{
unsigned int abbrev_number, bytes_read, i;
struct abbrev_info *abbrev;
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;
- *has_pc_info = 0;
abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
info_ptr += bytes_read;
if (!abbrev_number)
@@ -3215,10 +3239,11 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
for (i = 0; i < abbrev->num_attrs; ++i)
{
- info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd,
+ info_ptr, cu_header);
/* 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:
@@ -3262,7 +3287,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);
@@ -3282,7 +3307,7 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
int dummy;
spec_ptr = dwarf_info_buffer + dwarf2_get_ref_die_offset (&spec_attr);
- read_partial_die (&spec_die, abfd, spec_ptr, &dummy);
+ read_partial_die (&spec_die, abfd, spec_ptr, cu_header);
if (spec_die.name)
{
part_die->name = spec_die.name;
@@ -3305,7 +3330,7 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
&& part_die->lowpc < part_die->highpc
&& (part_die->lowpc != 0
|| (bfd_get_file_flags (abfd) & HAS_RELOC)))
- *has_pc_info = 1;
+ part_die->has_pc_info = 1;
return info_ptr;
}
@@ -3313,10 +3338,8 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
point to a newly allocated die with its information. */
static char *
-read_full_die (diep, abfd, info_ptr)
- struct die_info **diep;
- bfd *abfd;
- char *info_ptr;
+read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr,
+ const struct comp_unit_head *cu_header)
{
unsigned int abbrev_number, bytes_read, i, offset;
struct abbrev_info *abbrev;
@@ -3354,33 +3377,30 @@ read_full_die (diep, abfd, info_ptr)
for (i = 0; i < abbrev->num_attrs; ++i)
{
info_ptr = read_attribute (&die->attrs[i], &abbrev->attrs[i],
- abfd, info_ptr);
+ abfd, info_ptr, cu_header);
}
*diep = die;
return info_ptr;
}
-/* Read an attribute described by an abbreviated attribute. */
+/* Read an attribute value described by an attribute form. */
static char *
-read_attribute (attr, abbrev, abfd, info_ptr)
- struct attribute *attr;
- struct attr_abbrev *abbrev;
- bfd *abfd;
- char *info_ptr;
+read_attribute_value (struct attribute *attr, unsigned form,
+ bfd *abfd, char *info_ptr,
+ const struct comp_unit_head *cu_header)
{
unsigned int bytes_read;
struct dwarf_block *blk;
- attr->name = abbrev->name;
- attr->form = abbrev->form;
- switch (abbrev->form)
+ attr->form = form;
+ switch (form)
{
case DW_FORM_addr:
case DW_FORM_ref_addr:
- DW_ADDR (attr) = read_address (abfd, info_ptr);
- info_ptr += address_size;
+ DW_ADDR (attr) = read_address (abfd, info_ptr, cu_header, &bytes_read);
+ info_ptr += bytes_read;
break;
case DW_FORM_block2:
blk = dwarf_alloc_block ();
@@ -3414,6 +3434,11 @@ read_attribute (attr, abbrev, abfd, info_ptr)
DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read);
info_ptr += bytes_read;
break;
+ case DW_FORM_strp:
+ DW_STRING (attr) = read_indirect_string (abfd, info_ptr, cu_header,
+ &bytes_read);
+ info_ptr += bytes_read;
+ break;
case DW_FORM_block:
blk = dwarf_alloc_block ();
blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
@@ -3458,144 +3483,229 @@ read_attribute (attr, abbrev, abfd, info_ptr)
DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
info_ptr += 4;
break;
+ case DW_FORM_ref8:
+ DW_UNSND (attr) = read_8_bytes (abfd, info_ptr);
+ info_ptr += 8;
+ break;
case DW_FORM_ref_udata:
DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
info_ptr += bytes_read;
break;
- case DW_FORM_strp:
case DW_FORM_indirect:
+ form = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ info_ptr = read_attribute_value (attr, form, abfd, info_ptr, cu_header);
+ break;
default:
error ("Dwarf Error: Cannot handle %s in DWARF reader.",
- dwarf_form_name (abbrev->form));
+ dwarf_form_name (form));
}
return info_ptr;
}
+/* Read an attribute described by an abbreviated attribute. */
+
+static char *
+read_attribute (struct attribute *attr, struct attr_abbrev *abbrev,
+ bfd *abfd, char *info_ptr,
+ const struct comp_unit_head *cu_header)
+{
+ attr->name = abbrev->name;
+ return read_attribute_value (attr, abbrev->form, abfd, info_ptr, cu_header);
+}
+
/* read dwarf information from a buffer */
static unsigned int
-read_1_byte (abfd, buf)
- bfd *abfd;
- char *buf;
+read_1_byte (bfd *abfd, char *buf)
{
return bfd_get_8 (abfd, (bfd_byte *) buf);
}
static int
-read_1_signed_byte (abfd, buf)
- bfd *abfd;
- char *buf;
+read_1_signed_byte (bfd *abfd, char *buf)
{
return bfd_get_signed_8 (abfd, (bfd_byte *) buf);
}
static unsigned int
-read_2_bytes (abfd, buf)
- bfd *abfd;
- char *buf;
+read_2_bytes (bfd *abfd, char *buf)
{
return bfd_get_16 (abfd, (bfd_byte *) buf);
}
static int
-read_2_signed_bytes (abfd, buf)
- bfd *abfd;
- char *buf;
+read_2_signed_bytes (bfd *abfd, char *buf)
{
return bfd_get_signed_16 (abfd, (bfd_byte *) buf);
}
static unsigned int
-read_4_bytes (abfd, buf)
- bfd *abfd;
- char *buf;
+read_4_bytes (bfd *abfd, char *buf)
{
return bfd_get_32 (abfd, (bfd_byte *) buf);
}
static int
-read_4_signed_bytes (abfd, buf)
- bfd *abfd;
- char *buf;
+read_4_signed_bytes (bfd *abfd, char *buf)
{
return bfd_get_signed_32 (abfd, (bfd_byte *) buf);
}
-static unsigned int
-read_8_bytes (abfd, buf)
- bfd *abfd;
- char *buf;
+static unsigned long
+read_8_bytes (bfd *abfd, char *buf)
{
return bfd_get_64 (abfd, (bfd_byte *) buf);
}
static CORE_ADDR
-read_address (abfd, buf)
- bfd *abfd;
- char *buf;
+read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
+ int *bytes_read)
{
CORE_ADDR retval = 0;
- switch (address_size)
+ if (cu_header->signed_addr_p)
+ {
+ switch (cu_header->addr_size)
+ {
+ case 2:
+ retval = bfd_get_signed_16 (abfd, (bfd_byte *) buf);
+ break;
+ case 4:
+ retval = bfd_get_signed_32 (abfd, (bfd_byte *) buf);
+ break;
+ case 8:
+ retval = bfd_get_signed_64 (abfd, (bfd_byte *) buf);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "read_address: bad switch, signed");
+ }
+ }
+ else
+ {
+ switch (cu_header->addr_size)
+ {
+ case 2:
+ retval = bfd_get_16 (abfd, (bfd_byte *) buf);
+ break;
+ case 4:
+ retval = bfd_get_32 (abfd, (bfd_byte *) buf);
+ break;
+ case 8:
+ retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "read_address: bad switch, unsigned");
+ }
+ }
+
+ *bytes_read = cu_header->addr_size;
+ return retval;
+}
+
+/* Reads the initial length from a section. The (draft) DWARF 2.1
+ specification allows the initial length to take up either 4 bytes
+ or 12 bytes. If the first 4 bytes are 0xffffffff, then the next 8
+ bytes describe the length and all offsets will be 8 bytes in length
+ instead of 4.
+
+ The value returned via bytes_read should be used to increment
+ the relevant pointer after calling read_initial_length().
+
+ As a side effect, this function sets the fields initial_length_size
+ and offset_size in cu_header to the values appropriate for the
+ length field. (The format of the initial length field determines
+ the width of file offsets to be fetched later with fetch_offset().)
+
+ [ Note: read_initial_length() and read_offset() are based on the
+ document entitled "DWARF Debugging Information Format", revision
+ 2.1, draft 4, dated July 20, 2000. This document was obtained
+ from:
+
+ http://reality.sgi.com/dehnert_engr/dwarf/dwarf2p1-draft4-000720.pdf
+
+ This document is only a draft and is subject to change. (So beware.)
+
+ - Kevin, Aug 4, 2000
+ ] */
+
+static LONGEST
+read_initial_length (bfd *abfd, char *buf, struct comp_unit_head *cu_header,
+ int *bytes_read)
+{
+ LONGEST retval = 0;
+
+ retval = bfd_get_32 (abfd, (bfd_byte *) buf);
+
+ if (retval == 0xffffffff)
+ {
+ retval = bfd_get_64 (abfd, (bfd_byte *) buf + 4);
+ *bytes_read = 12;
+ if (cu_header != NULL)
+ {
+ cu_header->initial_length_size = 12;
+ cu_header->offset_size = 8;
+ }
+ }
+ else
+ {
+ *bytes_read = 4;
+ if (cu_header != NULL)
+ {
+ cu_header->initial_length_size = 4;
+ cu_header->offset_size = 4;
+ }
+ }
+
+ return retval;
+}
+
+/* Read an offset from the data stream. The size of the offset is
+ given by cu_header->offset_size. */
+
+static LONGEST
+read_offset (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
+ int *bytes_read)
+{
+ LONGEST retval = 0;
+
+ switch (cu_header->offset_size)
{
case 4:
retval = bfd_get_32 (abfd, (bfd_byte *) buf);
+ *bytes_read = 4;
break;
case 8:
retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ *bytes_read = 8;
break;
default:
- /* *THE* alternative is 8, right? */
- abort ();
- }
- /* If the address being read is larger than the address that is
- applicable for the object file format then mask it down to the
- correct size. Take care to avoid unnecessary shift or shift
- overflow */
- if (address_size > address_significant_size
- && address_significant_size < sizeof (CORE_ADDR))
- {
- CORE_ADDR mask = ((CORE_ADDR) 0) - 1;
- retval &= ~(mask << (address_significant_size * 8));
+ internal_error (__FILE__, __LINE__,
+ "read_offset: bad switch");
}
- return retval;
+
+ return retval;
}
static char *
-read_n_bytes (abfd, buf, size)
- bfd * abfd;
- char *buf;
- unsigned int size;
+read_n_bytes (bfd *abfd, char *buf, unsigned int size)
{
/* If the size of a host char is 8 bits, we can return a pointer
to the buffer, otherwise we have to copy the data to a buffer
allocated on the temporary obstack. */
-#if HOST_CHAR_BIT == 8
+ gdb_assert (HOST_CHAR_BIT == 8);
return buf;
-#else
- char *ret;
- unsigned int i;
-
- ret = obstack_alloc (&dwarf2_tmp_obstack, size);
- for (i = 0; i < size; ++i)
- {
- ret[i] = bfd_get_8 (abfd, (bfd_byte *) buf);
- buf++;
- }
- return ret;
-#endif
}
static char *
-read_string (abfd, buf, bytes_read_ptr)
- bfd *abfd;
- char *buf;
- unsigned int *bytes_read_ptr;
+read_string (bfd *abfd, char *buf, unsigned int *bytes_read_ptr)
{
/* If the size of a host char is 8 bits, we can return a pointer
to the string, otherwise we have to copy the string to a buffer
allocated on the temporary obstack. */
-#if HOST_CHAR_BIT == 8
+ gdb_assert (HOST_CHAR_BIT == 8);
if (*buf == '\0')
{
*bytes_read_ptr = 1;
@@ -3603,34 +3713,37 @@ read_string (abfd, buf, bytes_read_ptr)
}
*bytes_read_ptr = strlen (buf) + 1;
return buf;
-#else
- int byte;
- unsigned int i = 0;
+}
+
+static char *
+read_indirect_string (bfd *abfd, char *buf,
+ const struct comp_unit_head *cu_header,
+ unsigned int *bytes_read_ptr)
+{
+ LONGEST str_offset = read_offset (abfd, buf, cu_header,
+ (int *) bytes_read_ptr);
- while ((byte = bfd_get_8 (abfd, (bfd_byte *) buf)) != 0)
+ if (dwarf_str_buffer == NULL)
{
- obstack_1grow (&dwarf2_tmp_obstack, byte);
- i++;
- buf++;
+ error ("DW_FORM_strp used without .debug_str section");
+ return NULL;
}
- if (i == 0)
+ if (str_offset >= dwarf_str_size)
{
- *bytes_read_ptr = 1;
+ error ("DW_FORM_strp pointing outside of .debug_str section");
return NULL;
}
- obstack_1grow (&dwarf2_tmp_obstack, '\0');
- *bytes_read_ptr = i + 1;
- return obstack_finish (&dwarf2_tmp_obstack);
-#endif
+ gdb_assert (HOST_CHAR_BIT == 8);
+ if (dwarf_str_buffer[str_offset] == '\0')
+ return NULL;
+ return dwarf_str_buffer + str_offset;
}
-static unsigned int
-read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd;
- char *buf;
- unsigned int *bytes_read_ptr;
+static unsigned long
+read_unsigned_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr)
{
- unsigned int result, num_read;
+ unsigned long result;
+ unsigned int num_read;
int i, shift;
unsigned char byte;
@@ -3643,7 +3756,7 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
byte = bfd_get_8 (abfd, (bfd_byte *) buf);
buf++;
num_read++;
- result |= ((byte & 127) << shift);
+ result |= ((unsigned long)(byte & 127) << shift);
if ((byte & 128) == 0)
{
break;
@@ -3654,13 +3767,10 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
return result;
}
-static int
-read_signed_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd;
- char *buf;
- unsigned int *bytes_read_ptr;
+static long
+read_signed_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr)
{
- int result;
+ long result;
int i, shift, size, num_read;
unsigned char byte;
@@ -3674,7 +3784,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr)
byte = bfd_get_8 (abfd, (bfd_byte *) buf);
buf++;
num_read++;
- result |= ((byte & 127) << shift);
+ result |= ((long)(byte & 127) << shift);
shift += 7;
if ((byte & 128) == 0)
{
@@ -3690,8 +3800,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr)
}
static void
-set_cu_language (lang)
- unsigned int lang;
+set_cu_language (unsigned int lang)
{
switch (lang)
{
@@ -3704,11 +3813,15 @@ set_cu_language (lang)
break;
case DW_LANG_Fortran77:
case DW_LANG_Fortran90:
+ case DW_LANG_Fortran95:
cu_language = language_fortran;
break;
case DW_LANG_Mips_Assembler:
cu_language = language_asm;
break;
+ case DW_LANG_Java:
+ cu_language = language_java;
+ break;
case DW_LANG_Ada83:
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
@@ -3724,9 +3837,7 @@ set_cu_language (lang)
/* Return the named attribute or NULL if not there. */
static struct attribute *
-dwarf_attr (die, name)
- struct die_info *die;
- unsigned int name;
+dwarf_attr (struct die_info *die, unsigned int name)
{
unsigned int i;
struct attribute *spec = NULL;
@@ -3744,15 +3855,22 @@ 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;
}
+static int
+die_is_declaration (struct die_info *die)
+{
+ return (dwarf_attr (die, DW_AT_declaration)
+ && ! dwarf_attr (die, DW_AT_specification));
+}
+
/* Decode the line number information for the compilation unit whose
line number info is at OFFSET in the .debug_line section.
The compilation directory of the file is passed in COMP_DIR. */
@@ -3761,26 +3879,24 @@ 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)
- unsigned int offset;
- char *comp_dir;
- bfd *abfd;
+dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
+ const struct comp_unit_head *cu_header)
{
char *line_ptr;
char *line_end;
@@ -3811,13 +3927,13 @@ dwarf_decode_lines (offset, comp_dir, abfd)
line_ptr = dwarf_line_buffer + offset;
/* read in the prologue */
- lh.total_length = read_4_bytes (abfd, line_ptr);
- line_ptr += 4;
+ lh.total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read);
+ line_ptr += bytes_read;
line_end = line_ptr + lh.total_length;
lh.version = read_2_bytes (abfd, line_ptr);
line_ptr += 2;
- lh.prologue_length = read_4_bytes (abfd, line_ptr);
- line_ptr += 4;
+ lh.prologue_length = read_offset (abfd, line_ptr, cu_header, &bytes_read);
+ line_ptr += bytes_read;
lh.minimum_instruction_length = read_1_byte (abfd, line_ptr);
line_ptr += 1;
lh.default_is_stmt = read_1_byte (abfd, line_ptr);
@@ -3830,8 +3946,7 @@ 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 (free_current_contents, &lh.standard_opcode_lengths);
lh.standard_opcode_lengths[0] = 1;
for (i = 1; i < lh.opcode_base; ++i)
@@ -3850,7 +3965,7 @@ dwarf_decode_lines (offset, comp_dir, abfd)
xrealloc (dirs.dirs,
(dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
if (dirs.num_dirs == 0)
- make_cleanup ((make_cleanup_func) free_current_contents, &dirs.dirs);
+ make_cleanup (free_current_contents, &dirs.dirs);
}
dirs.dirs[dirs.num_dirs++] = cur_dir;
}
@@ -3865,10 +3980,9 @@ 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 (free_current_contents, &files.files);
}
files.files[files.num_files].name = cur_file;
files.files[files.num_files].dir =
@@ -3908,11 +4022,22 @@ 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;
- switch (op_code)
+
+ if (op_code >= lh.opcode_base)
+ { /* Special operand. */
+ adj_opcode = op_code - lh.opcode_base;
+ address += (adj_opcode / lh.line_range)
+ * lh.minimum_instruction_length;
+ line += lh.line_base + (adj_opcode % lh.line_range);
+ /* append row to matrix using current values */
+ record_line (current_subfile, line, address);
+ basic_block = 1;
+ }
+ else switch (op_code)
{
case DW_LNS_extended_op:
line_ptr += 1; /* ignore length */
@@ -3922,11 +4047,17 @@ dwarf_decode_lines (offset, comp_dir, abfd)
{
case DW_LNE_end_sequence:
end_sequence = 1;
- record_line (current_subfile, line, address);
+ /* Don't call record_line here. The end_sequence
+ instruction provides the address of the first byte
+ *after* the last line in the sequence; it's not the
+ address of any real source line. However, the GDB
+ linetable structure only records the starts of lines,
+ not the ends. This is a weakness of GDB. */
break;
case DW_LNE_set_address:
- address = read_address (abfd, line_ptr) + baseaddr;
- line_ptr += address_size;
+ address = read_address (abfd, line_ptr, cu_header, &bytes_read);
+ line_ptr += bytes_read;
+ address += baseaddr;
break;
case DW_LNE_define_file:
cur_file = read_string (abfd, line_ptr, &bytes_read);
@@ -3936,10 +4067,9 @@ 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 (free_current_contents, &files.files);
}
files.files[files.num_files].name = cur_file;
files.files[files.num_files].dir =
@@ -3973,7 +4103,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
@@ -3992,21 +4122,28 @@ dwarf_decode_lines (offset, comp_dir, abfd)
case DW_LNS_set_basic_block:
basic_block = 1;
break;
+ /* Add to the address register of the state machine the
+ address increment value corresponding to special opcode
+ 255. Ie, this value is scaled by the minimum instruction
+ length since special opcode 255 would have scaled the
+ the increment. */
case DW_LNS_const_add_pc:
- address += (255 - lh.opcode_base) / lh.line_range;
+ address += (lh.minimum_instruction_length
+ * ((255 - lh.opcode_base) / lh.line_range));
break;
case DW_LNS_fixed_advance_pc:
address += read_2_bytes (abfd, line_ptr);
line_ptr += 2;
break;
- default: /* special operand */
- adj_opcode = op_code - lh.opcode_base;
- address += (adj_opcode / lh.line_range)
- * lh.minimum_instruction_length;
- line += lh.line_base + (adj_opcode % lh.line_range);
- /* append row to matrix using current values */
- record_line (current_subfile, line, address);
- basic_block = 1;
+ default:
+ { /* Unknown standard opcode, ignore it. */
+ int i;
+ for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++)
+ {
+ (void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ }
+ }
}
}
}
@@ -4024,39 +4161,37 @@ 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. */
static void
-dwarf2_start_subfile (filename, dirname)
- char *filename;
- char *dirname;
+dwarf2_start_subfile (char *filename, char *dirname)
{
/* If the filename isn't absolute, try to match an existing subfile
with the full pathname. */
- if (*filename != '/' && dirname != NULL)
+ if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL)
{
struct subfile *subfile;
char *fullname = concat (dirname, "/", filename, NULL);
for (subfile = subfiles; subfile; subfile = subfile->next)
{
- if (STREQ (subfile->name, fullname))
+ if (FILENAME_CMP (subfile->name, fullname) == 0)
{
current_subfile = subfile;
- free (fullname);
+ xfree (fullname);
return;
}
}
- free (fullname);
+ xfree (fullname);
}
start_subfile (filename, dirname);
}
@@ -4065,14 +4200,11 @@ dwarf2_start_subfile (filename, dirname)
to make a symbol table entry for it, and if so, create a new entry
and return a pointer to it.
If TYPE is NULL, determine symbol type from the die, otherwise
- used the passed type.
- */
+ used the passed type. */
static struct symbol *
-new_symbol (die, type, objfile)
- struct die_info *die;
- struct type *type;
- struct objfile *objfile;
+new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct symbol *sym = NULL;
char *name;
@@ -4091,13 +4223,13 @@ 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)
SYMBOL_TYPE (sym) = type;
else
- SYMBOL_TYPE (sym) = die_type (die, objfile);
+ SYMBOL_TYPE (sym) = die_type (die, objfile, cu_header);
attr = dwarf_attr (die, DW_AT_decl_line);
if (attr)
{
@@ -4148,7 +4280,7 @@ new_symbol (die, type, objfile)
attr = dwarf_attr (die, DW_AT_const_value);
if (attr)
{
- dwarf2_const_value (attr, sym, objfile);
+ dwarf2_const_value (attr, sym, objfile, cu_header);
attr2 = dwarf_attr (die, DW_AT_external);
if (attr2 && (DW_UNSND (attr2) != 0))
add_symbol_to_list (sym, &global_symbols);
@@ -4163,10 +4295,10 @@ new_symbol (die, type, objfile)
if (attr2 && (DW_UNSND (attr2) != 0))
{
SYMBOL_VALUE_ADDRESS (sym) =
- decode_locdesc (DW_BLOCK (attr), objfile);
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
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
@@ -4175,7 +4307,10 @@ new_symbol (die, type, objfile)
the variable is referenced. */
if (SYMBOL_VALUE_ADDRESS (sym))
{
- SYMBOL_VALUE_ADDRESS (sym) += baseaddr;
+ fixup_symbol_section (sym, objfile);
+ SYMBOL_VALUE_ADDRESS (sym) +=
+ ANOFFSET (objfile->section_offsets,
+ SYMBOL_SECTION (sym));
SYMBOL_CLASS (sym) = LOC_STATIC;
}
else
@@ -4184,7 +4319,7 @@ new_symbol (die, type, objfile)
else
{
SYMBOL_VALUE (sym) = addr =
- decode_locdesc (DW_BLOCK (attr), objfile);
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
add_symbol_to_list (sym, list_in_scope);
if (optimized_out)
{
@@ -4193,11 +4328,13 @@ new_symbol (die, type, objfile)
else if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGISTER;
+ SYMBOL_VALUE (sym) =
+ DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
}
else if (offreg)
{
SYMBOL_CLASS (sym) = LOC_BASEREG;
- SYMBOL_BASEREG (sym) = basereg;
+ SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
}
else if (islocal)
{
@@ -4205,19 +4342,22 @@ new_symbol (die, type, objfile)
}
else
{
+ fixup_symbol_section (sym, objfile);
+ SYMBOL_VALUE_ADDRESS (sym) =
+ addr + ANOFFSET (objfile->section_offsets,
+ SYMBOL_SECTION (sym));
SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = addr + baseaddr;
}
}
}
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)
@@ -4231,15 +4371,27 @@ new_symbol (die, type, objfile)
attr = dwarf_attr (die, DW_AT_location);
if (attr)
{
- SYMBOL_VALUE (sym) = decode_locdesc (DW_BLOCK (attr), objfile);
+ SYMBOL_VALUE (sym) =
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGPARM;
+ SYMBOL_VALUE (sym) =
+ DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
}
else if (offreg)
{
- SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
- SYMBOL_BASEREG (sym) = basereg;
+ if (isderef)
+ {
+ if (basereg != frame_base_reg)
+ complain (&dwarf2_complex_location_expr);
+ SYMBOL_CLASS (sym) = LOC_REF_ARG;
+ }
+ else
+ {
+ SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
+ SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
+ }
}
else
{
@@ -4249,7 +4401,7 @@ new_symbol (die, type, objfile)
attr = dwarf_attr (die, DW_AT_const_value);
if (attr)
{
- dwarf2_const_value (attr, sym, objfile);
+ dwarf2_const_value (attr, sym, objfile, cu_header);
}
add_symbol_to_list (sym, list_in_scope);
break;
@@ -4272,8 +4424,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)
@@ -4294,7 +4446,7 @@ new_symbol (die, type, objfile)
attr = dwarf_attr (die, DW_AT_const_value);
if (attr)
{
- dwarf2_const_value (attr, sym, objfile);
+ dwarf2_const_value (attr, sym, objfile, cu_header);
}
add_symbol_to_list (sym, list_in_scope);
break;
@@ -4313,22 +4465,22 @@ new_symbol (die, type, objfile)
/* Copy constant value from an attribute to a symbol. */
static void
-dwarf2_const_value (attr, sym, objfile)
- struct attribute *attr;
- struct symbol *sym;
- struct objfile *objfile;
+dwarf2_const_value (struct attribute *attr, struct symbol *sym,
+ struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct dwarf_block *blk;
switch (attr->form)
{
case DW_FORM_addr:
- if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != (unsigned int) address_size)
+ if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != cu_header->addr_size)
complain (&dwarf2_const_value_length_mismatch, SYMBOL_NAME (sym),
- address_size, TYPE_LENGTH (SYMBOL_TYPE (sym)));
+ cu_header->addr_size, TYPE_LENGTH (SYMBOL_TYPE (sym)));
SYMBOL_VALUE_BYTES (sym) = (char *)
- obstack_alloc (&objfile->symbol_obstack, address_size);
- store_address (SYMBOL_VALUE_BYTES (sym), address_size, DW_ADDR (attr));
+ obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size);
+ store_address (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size,
+ DW_ADDR (attr));
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
break;
case DW_FORM_block1:
@@ -4344,15 +4496,35 @@ dwarf2_const_value (attr, sym, objfile)
memcpy (SYMBOL_VALUE_BYTES (sym), blk->data, blk->size);
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
break;
+
+ /* The DW_AT_const_value attributes are supposed to carry the
+ symbol's value "represented as it would be on the target
+ architecture." By the time we get here, it's already been
+ converted to host endianness, so we just need to sign- or
+ zero-extend it as appropriate. */
+ case DW_FORM_data1:
+ dwarf2_const_value_data (attr, sym, 8);
+ break;
case DW_FORM_data2:
+ dwarf2_const_value_data (attr, sym, 16);
+ break;
case DW_FORM_data4:
+ dwarf2_const_value_data (attr, sym, 32);
+ break;
case DW_FORM_data8:
- case DW_FORM_data1:
+ dwarf2_const_value_data (attr, sym, 64);
+ break;
+
case DW_FORM_sdata:
+ SYMBOL_VALUE (sym) = DW_SND (attr);
+ SYMBOL_CLASS (sym) = LOC_CONST;
+ break;
+
case DW_FORM_udata:
SYMBOL_VALUE (sym) = DW_UNSND (attr);
SYMBOL_CLASS (sym) = LOC_CONST;
break;
+
default:
complain (&dwarf2_unsupported_const_value_attr,
dwarf_form_name (attr->form));
@@ -4362,12 +4534,34 @@ dwarf2_const_value (attr, sym, objfile)
}
}
+
+/* Given an attr with a DW_FORM_dataN value in host byte order, sign-
+ or zero-extend it as appropriate for the symbol's type. */
+static void
+dwarf2_const_value_data (struct attribute *attr,
+ struct symbol *sym,
+ int bits)
+{
+ LONGEST l = DW_UNSND (attr);
+
+ if (bits < sizeof (l) * 8)
+ {
+ if (TYPE_UNSIGNED (SYMBOL_TYPE (sym)))
+ l &= ((LONGEST) 1 << bits) - 1;
+ else
+ l = (l << (sizeof (l) * 8 - bits)) >> (sizeof (l) * 8 - bits);
+ }
+
+ SYMBOL_VALUE (sym) = l;
+ SYMBOL_CLASS (sym) = LOC_CONST;
+}
+
+
/* Return the type of the die in question using its DW_AT_type attribute. */
static struct type *
-die_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+die_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type;
struct attribute *type_attr;
@@ -4390,7 +4584,7 @@ die_type (die, objfile)
return NULL;
}
}
- type = tag_type_to_type (type_die, objfile);
+ type = tag_type_to_type (type_die, objfile, cu_header);
if (!type)
{
dump_die (type_die);
@@ -4403,9 +4597,8 @@ die_type (die, objfile)
DW_AT_containing_type attribute. */
static struct type *
-die_containing_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+die_containing_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
struct type *type = NULL;
struct attribute *type_attr;
@@ -4422,7 +4615,7 @@ die_containing_type (die, objfile)
error ("Dwarf Error: Cannot find referent at offset %d.", ref);
return NULL;
}
- type = tag_type_to_type (type_die, objfile);
+ type = tag_type_to_type (type_die, objfile, cu_header);
}
if (!type)
{
@@ -4435,9 +4628,7 @@ die_containing_type (die, objfile)
#if 0
static struct type *
-type_at_offset (offset, objfile)
- unsigned int offset;
- struct objfile *objfile;
+type_at_offset (unsigned int offset, struct objfile *objfile)
{
struct die_info *die;
struct type *type;
@@ -4454,9 +4645,8 @@ type_at_offset (offset, objfile)
#endif
static struct type *
-tag_type_to_type (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+tag_type_to_type (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
if (die->type)
{
@@ -4464,7 +4654,7 @@ tag_type_to_type (die, objfile)
}
else
{
- read_type_die (die, objfile);
+ read_type_die (die, objfile, cu_header);
if (!die->type)
{
dump_die (die);
@@ -4475,47 +4665,46 @@ tag_type_to_type (die, objfile)
}
static void
-read_type_die (die, objfile)
- struct die_info *die;
- struct objfile *objfile;
+read_type_die (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
switch (die->tag)
{
case DW_TAG_class_type:
case DW_TAG_structure_type:
case DW_TAG_union_type:
- read_structure_scope (die, objfile);
+ read_structure_scope (die, objfile, cu_header);
break;
case DW_TAG_enumeration_type:
- read_enumeration (die, objfile);
+ read_enumeration (die, objfile, cu_header);
break;
case DW_TAG_subprogram:
case DW_TAG_subroutine_type:
- read_subroutine_type (die, objfile);
+ read_subroutine_type (die, objfile, cu_header);
break;
case DW_TAG_array_type:
- read_array_type (die, objfile);
+ read_array_type (die, objfile, cu_header);
break;
case DW_TAG_pointer_type:
- read_tag_pointer_type (die, objfile);
+ read_tag_pointer_type (die, objfile, cu_header);
break;
case DW_TAG_ptr_to_member_type:
- read_tag_ptr_to_member_type (die, objfile);
+ read_tag_ptr_to_member_type (die, objfile, cu_header);
break;
case DW_TAG_reference_type:
- read_tag_reference_type (die, objfile);
+ read_tag_reference_type (die, objfile, cu_header);
break;
case DW_TAG_const_type:
- read_tag_const_type (die, objfile);
+ read_tag_const_type (die, objfile, cu_header);
break;
case DW_TAG_volatile_type:
- read_tag_volatile_type (die, objfile);
+ read_tag_volatile_type (die, objfile, cu_header);
break;
case DW_TAG_string_type:
read_tag_string_type (die, objfile);
break;
case DW_TAG_typedef:
- read_typedef (die, objfile);
+ read_typedef (die, objfile, cu_header);
break;
case DW_TAG_base_type:
read_base_type (die, objfile);
@@ -4527,10 +4716,7 @@ read_type_die (die, objfile)
}
static struct type *
-dwarf_base_type (encoding, size, objfile)
- int encoding;
- int size;
- struct objfile *objfile;
+dwarf_base_type (int encoding, int size, struct objfile *objfile)
{
/* FIXME - this should not produce a new (struct type *)
every time. It should cache base types. */
@@ -4607,8 +4793,7 @@ dwarf_base_type (encoding, size, objfile)
#if 0
struct die_info *
-copy_die (old_die)
- struct die_info *old_die;
+copy_die (struct die_info *old_die)
{
struct die_info *new_die;
int i, num_attrs;
@@ -4641,9 +4826,8 @@ copy_die (old_die)
/* Return sibling of die, NULL if no sibling. */
-struct die_info *
-sibling_die (die)
- struct die_info *die;
+static struct die_info *
+sibling_die (struct die_info *die)
{
int nesting_level = 0;
@@ -4687,8 +4871,7 @@ sibling_die (die)
/* Get linkage name of a die, return NULL if not found. */
static char *
-dwarf2_linkage_name (die)
- struct die_info *die;
+dwarf2_linkage_name (struct die_info *die)
{
struct attribute *attr;
@@ -4704,8 +4887,7 @@ dwarf2_linkage_name (die)
/* Convert a DIE tag into its string name. */
static char *
-dwarf_tag_name (tag)
- register unsigned tag;
+dwarf_tag_name (register unsigned tag)
{
switch (tag)
{
@@ -4821,8 +5003,7 @@ dwarf_tag_name (tag)
/* Convert a DWARF attribute code into its string name. */
static char *
-dwarf_attr_name (attr)
- register unsigned attr;
+dwarf_attr_name (register unsigned attr)
{
switch (attr)
{
@@ -4988,8 +5169,7 @@ dwarf_attr_name (attr)
/* Convert a DWARF value form code into its string name. */
static char *
-dwarf_form_name (form)
- register unsigned form;
+dwarf_form_name (register unsigned form)
{
switch (form)
{
@@ -5043,8 +5223,7 @@ dwarf_form_name (form)
/* Convert a DWARF stack opcode into its string name. */
static char *
-dwarf_stack_op_name (op)
- register unsigned op;
+dwarf_stack_op_name (register unsigned op)
{
switch (op)
{
@@ -5344,8 +5523,7 @@ dwarf_stack_op_name (op)
}
static char *
-dwarf_bool_name (mybool)
- unsigned mybool;
+dwarf_bool_name (unsigned mybool)
{
if (mybool)
return "TRUE";
@@ -5356,8 +5534,7 @@ dwarf_bool_name (mybool)
/* Convert a DWARF type code into its string name. */
static char *
-dwarf_type_encoding_name (enc)
- register unsigned enc;
+dwarf_type_encoding_name (register unsigned enc)
{
switch (enc)
{
@@ -5386,8 +5563,7 @@ dwarf_type_encoding_name (enc)
#if 0
static char *
-dwarf_cfi_name (cfi_opc)
- register unsigned cfi_opc;
+dwarf_cfi_name (register unsigned cfi_opc)
{
switch (cfi_opc)
{
@@ -5427,81 +5603,104 @@ dwarf_cfi_name (cfi_opc)
return "DW_CFA_def_cfa_register";
case DW_CFA_def_cfa_offset:
return "DW_CFA_def_cfa_offset";
+
+ /* DWARF 3 */
+ case DW_CFA_def_cfa_expression:
+ return "DW_CFA_def_cfa_expression";
+ case DW_CFA_expression:
+ return "DW_CFA_expression";
+ case DW_CFA_offset_extended_sf:
+ return "DW_CFA_offset_extended_sf";
+ case DW_CFA_def_cfa_sf:
+ return "DW_CFA_def_cfa_sf";
+ case DW_CFA_def_cfa_offset_sf:
+ return "DW_CFA_def_cfa_offset_sf";
+
/* SGI/MIPS specific */
case DW_CFA_MIPS_advance_loc8:
return "DW_CFA_MIPS_advance_loc8";
+
+ /* GNU extensions */
+ case DW_CFA_GNU_window_save:
+ return "DW_CFA_GNU_window_save";
+ case DW_CFA_GNU_args_size:
+ return "DW_CFA_GNU_args_size";
+ case DW_CFA_GNU_negative_offset_extended:
+ return "DW_CFA_GNU_negative_offset_extended";
+
default:
return "DW_CFA_<unknown>";
}
}
#endif
-void
-dump_die (die)
- struct die_info *die;
+static void
+dump_die (struct die_info *die)
{
unsigned int i;
- fprintf (stderr, "Die: %s (abbrev = %d, offset = %d)\n",
+ fprintf_unfiltered (gdb_stderr, "Die: %s (abbrev = %d, offset = %d)\n",
dwarf_tag_name (die->tag), die->abbrev, die->offset);
- fprintf (stderr, "\thas children: %s\n",
+ fprintf_unfiltered (gdb_stderr, "\thas children: %s\n",
dwarf_bool_name (die->has_children));
- fprintf (stderr, "\tattributes:\n");
+ fprintf_unfiltered (gdb_stderr, "\tattributes:\n");
for (i = 0; i < die->num_attrs; ++i)
{
- fprintf (stderr, "\t\t%s (%s) ",
+ fprintf_unfiltered (gdb_stderr, "\t\t%s (%s) ",
dwarf_attr_name (die->attrs[i].name),
dwarf_form_name (die->attrs[i].form));
switch (die->attrs[i].form)
{
case DW_FORM_ref_addr:
case DW_FORM_addr:
- fprintf (stderr, "address: ");
+ fprintf_unfiltered (gdb_stderr, "address: ");
print_address_numeric (DW_ADDR (&die->attrs[i]), 1, gdb_stderr);
break;
case DW_FORM_block2:
case DW_FORM_block4:
case DW_FORM_block:
case DW_FORM_block1:
- fprintf (stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (gdb_stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
break;
case DW_FORM_data1:
case DW_FORM_data2:
case DW_FORM_data4:
+ case DW_FORM_data8:
case DW_FORM_ref1:
case DW_FORM_ref2:
case DW_FORM_ref4:
case DW_FORM_udata:
case DW_FORM_sdata:
- fprintf (stderr, "constant: %d", DW_UNSND (&die->attrs[i]));
+ fprintf_unfiltered (gdb_stderr, "constant: %ld", DW_UNSND (&die->attrs[i]));
break;
case DW_FORM_string:
- fprintf (stderr, "string: \"%s\"",
+ case DW_FORM_strp:
+ fprintf_unfiltered (gdb_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]))
- fprintf (stderr, "flag: TRUE");
+ fprintf_unfiltered (gdb_stderr, "flag: TRUE");
else
- fprintf (stderr, "flag: FALSE");
+ fprintf_unfiltered (gdb_stderr, "flag: FALSE");
+ break;
+ case DW_FORM_indirect:
+ /* the reader will have reduced the indirect form to
+ the "base form" so this form should not occur */
+ fprintf_unfiltered (gdb_stderr, "unexpected attribute form: DW_FORM_indirect");
break;
- case DW_FORM_strp: /* we do not support separate string
- section yet */
- case DW_FORM_indirect: /* we do not handle indirect yet */
- case DW_FORM_data8: /* we do not have 64 bit quantities */
default:
- fprintf (stderr, "unsupported attribute form: %d.",
- die->attrs[i].form);
+ fprintf_unfiltered (gdb_stderr, "unsupported attribute form: %d.",
+ die->attrs[i].form);
}
- fprintf (stderr, "\n");
+ fprintf_unfiltered (gdb_stderr, "\n");
}
}
-void
-dump_die_list (die)
- struct die_info *die;
+static void
+dump_die_list (struct die_info *die)
{
while (die)
{
@@ -5510,10 +5709,8 @@ dump_die_list (die)
}
}
-void
-store_in_ref_table (offset, die)
- unsigned int offset;
- struct die_info *die;
+static void
+store_in_ref_table (unsigned int offset, struct die_info *die)
{
int h;
struct die_info *old;
@@ -5526,14 +5723,13 @@ store_in_ref_table (offset, die)
static void
-dwarf2_empty_die_ref_table ()
+dwarf2_empty_hash_tables (void)
{
memset (die_ref_table, 0, sizeof (die_ref_table));
}
static unsigned int
-dwarf2_get_ref_die_offset (attr)
- struct attribute *attr;
+dwarf2_get_ref_die_offset (struct attribute *attr)
{
unsigned int result = 0;
@@ -5545,6 +5741,7 @@ dwarf2_get_ref_die_offset (attr)
case DW_FORM_ref1:
case DW_FORM_ref2:
case DW_FORM_ref4:
+ case DW_FORM_ref8:
case DW_FORM_ref_udata:
result = cu_header_offset + DW_UNSND (attr);
break;
@@ -5554,9 +5751,8 @@ dwarf2_get_ref_die_offset (attr)
return result;
}
-struct die_info *
-follow_die_ref (offset)
- unsigned int offset;
+static struct die_info *
+follow_die_ref (unsigned int offset)
{
struct die_info *die;
int h;
@@ -5575,9 +5771,7 @@ follow_die_ref (offset)
}
static struct type *
-dwarf2_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+dwarf2_fundamental_type (struct objfile *objfile, int typeid)
{
if (typeid < 0 || typeid >= FT_NUM_MEMBERS)
{
@@ -5621,14 +5815,13 @@ 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. */
static CORE_ADDR
-decode_locdesc (blk, objfile)
- struct dwarf_block *blk;
- struct objfile *objfile;
+decode_locdesc (struct dwarf_block *blk, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
{
int i;
int size = blk->size;
@@ -5643,6 +5836,7 @@ decode_locdesc (blk, objfile)
stack[stacki] = 0;
isreg = 0;
offreg = 0;
+ isderef = 0;
islocal = 0;
optimized_out = 1;
@@ -5652,6 +5846,41 @@ decode_locdesc (blk, objfile)
op = data[i++];
switch (op)
{
+ case DW_OP_lit0:
+ case DW_OP_lit1:
+ case DW_OP_lit2:
+ case DW_OP_lit3:
+ case DW_OP_lit4:
+ case DW_OP_lit5:
+ case DW_OP_lit6:
+ case DW_OP_lit7:
+ case DW_OP_lit8:
+ case DW_OP_lit9:
+ case DW_OP_lit10:
+ case DW_OP_lit11:
+ case DW_OP_lit12:
+ case DW_OP_lit13:
+ case DW_OP_lit14:
+ case DW_OP_lit15:
+ case DW_OP_lit16:
+ case DW_OP_lit17:
+ case DW_OP_lit18:
+ case DW_OP_lit19:
+ case DW_OP_lit20:
+ case DW_OP_lit21:
+ case DW_OP_lit22:
+ case DW_OP_lit23:
+ case DW_OP_lit24:
+ case DW_OP_lit25:
+ case DW_OP_lit26:
+ case DW_OP_lit27:
+ case DW_OP_lit28:
+ case DW_OP_lit29:
+ case DW_OP_lit30:
+ case DW_OP_lit31:
+ stack[++stacki] = op - DW_OP_lit0;
+ break;
+
case DW_OP_reg0:
case DW_OP_reg1:
case DW_OP_reg2:
@@ -5739,6 +5968,14 @@ decode_locdesc (blk, objfile)
i += bytes_read;
break;
+ case DW_OP_bregx:
+ offreg = 1;
+ basereg = read_unsigned_leb128 (NULL, (data + i), &bytes_read);
+ i += bytes_read;
+ stack[++stacki] = read_signed_leb128 (NULL, (data + i), &bytes_read);
+ i += bytes_read;
+ break;
+
case DW_OP_fbreg:
stack[++stacki] = read_signed_leb128 (NULL, (data + i), &bytes_read);
i += bytes_read;
@@ -5756,8 +5993,9 @@ decode_locdesc (blk, objfile)
break;
case DW_OP_addr:
- stack[++stacki] = read_address (objfile->obfd, &data[i]);
- i += address_size;
+ stack[++stacki] = read_address (objfile->obfd, &data[i],
+ cu_header, &bytes_read);
+ i += bytes_read;
break;
case DW_OP_const1u:
@@ -5792,7 +6030,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;
@@ -5801,6 +6039,11 @@ decode_locdesc (blk, objfile)
i += bytes_read;
break;
+ case DW_OP_dup:
+ stack[stacki + 1] = stack[stacki];
+ stacki++;
+ break;
+
case DW_OP_plus:
stack[stacki - 1] += stack[stacki];
stacki--;
@@ -5812,12 +6055,20 @@ decode_locdesc (blk, objfile)
break;
case DW_OP_minus:
- stack[stacki - 1] = stack[stacki] - stack[stacki - 1];
+ stack[stacki - 1] -= stack[stacki];
stacki--;
break;
+ 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. */
+ 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]);
}
}
@@ -5828,14 +6079,13 @@ decode_locdesc (blk, objfile)
/* ARGSUSED */
static void
-dwarf2_free_tmp_obstack (ignore)
- PTR ignore;
+dwarf2_free_tmp_obstack (PTR ignore)
{
obstack_free (&dwarf2_tmp_obstack, NULL);
}
static struct dwarf_block *
-dwarf_alloc_block ()
+dwarf_alloc_block (void)
{
struct dwarf_block *blk;
@@ -5845,7 +6095,7 @@ dwarf_alloc_block ()
}
static struct abbrev_info *
-dwarf_alloc_abbrev ()
+dwarf_alloc_abbrev (void)
{
struct abbrev_info *abbrev;
@@ -5855,7 +6105,7 @@ dwarf_alloc_abbrev ()
}
static struct die_info *
-dwarf_alloc_die ()
+dwarf_alloc_die (void)
{
struct die_info *die;
diff --git a/contrib/gdb/gdb/dwarfread.c b/contrib/gdb/gdb/dwarfread.c
index 9de0312..dc72f87 100644
--- a/contrib/gdb/gdb/dwarfread.c
+++ b/contrib/gdb/gdb/dwarfread.c
@@ -1,43 +1,44 @@
/* DWARF debugging format support for GDB.
- Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002
Free Software Foundation, Inc.
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 +48,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"
@@ -189,11 +190,6 @@ typedef unsigned int DIE_REF; /* Reference to a DIE */
#define CHILL_PRODUCER "GNU Chill "
#endif
-/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
-#ifndef DWARF_REG_TO_REGNUM
-#define DWARF_REG_TO_REGNUM(num) (num)
-#endif
-
/* Flags to target_to_host() that tell whether or not the data object is
expected to be signed. Used, for example, when fetching a signed
integer in the target environment which is used as a signed integer
@@ -243,11 +239,6 @@ typedef unsigned int DIE_REF; /* Reference to a DIE */
#define AT_short_element_list (0x00f0|FORM_BLOCK2)
-/* External variables referenced. */
-
-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
is a line number table. The "struct dieinfo" structure contains
@@ -272,74 +263,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 +345,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 +423,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,
@@ -448,172 +441,133 @@ static const struct language_defn *cu_language_defn;
/* Forward declarations of static functions so we don't have to worry
about ordering within this file. */
-static void
-free_utypes PARAMS ((PTR));
+static void free_utypes (PTR);
-static int
-attribute_size PARAMS ((unsigned int));
+static int attribute_size (unsigned int);
-static CORE_ADDR
-target_to_host PARAMS ((char *, int, int, struct objfile *));
+static CORE_ADDR target_to_host (char *, int, int, struct objfile *);
-static void
-add_enum_psymbol PARAMS ((struct dieinfo *, struct objfile *));
+static void add_enum_psymbol (struct dieinfo *, struct objfile *);
-static void
-handle_producer PARAMS ((char *));
+static void handle_producer (char *);
static void
-read_file_scope PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
+read_file_scope (struct dieinfo *, char *, char *, struct objfile *);
static void
-read_func_scope PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
+read_func_scope (struct dieinfo *, char *, char *, struct objfile *);
static void
-read_lexical_block_scope PARAMS ((struct dieinfo *, char *, char *,
- struct objfile *));
+read_lexical_block_scope (struct dieinfo *, char *, char *, struct objfile *);
-static void
-scan_partial_symbols PARAMS ((char *, char *, struct objfile *));
+static void scan_partial_symbols (char *, char *, struct objfile *);
static void
-scan_compilation_units PARAMS ((char *, char *, file_ptr,
- file_ptr, struct objfile *));
+scan_compilation_units (char *, char *, file_ptr, file_ptr, struct objfile *);
-static void
-add_partial_symbol PARAMS ((struct dieinfo *, struct objfile *));
+static void add_partial_symbol (struct dieinfo *, struct objfile *);
-static void
-basicdieinfo PARAMS ((struct dieinfo *, char *, struct objfile *));
+static void basicdieinfo (struct dieinfo *, char *, struct objfile *);
-static void
-completedieinfo PARAMS ((struct dieinfo *, struct objfile *));
+static void completedieinfo (struct dieinfo *, struct objfile *);
-static void
-dwarf_psymtab_to_symtab PARAMS ((struct partial_symtab *));
+static void dwarf_psymtab_to_symtab (struct partial_symtab *);
-static void
-psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
+static void psymtab_to_symtab_1 (struct partial_symtab *);
-static void
-read_ofile_symtab PARAMS ((struct partial_symtab *));
+static void read_ofile_symtab (struct partial_symtab *);
-static void
-process_dies PARAMS ((char *, char *, struct objfile *));
+static void process_dies (char *, char *, struct objfile *);
static void
-read_structure_scope PARAMS ((struct dieinfo *, char *, char *,
- struct objfile *));
+read_structure_scope (struct dieinfo *, char *, char *, struct objfile *);
-static struct type *
-decode_array_element_type PARAMS ((char *));
+static struct type *decode_array_element_type (char *);
-static struct type *
-decode_subscript_data_item PARAMS ((char *, char *));
+static struct type *decode_subscript_data_item (char *, char *);
-static void
-dwarf_read_array_type PARAMS ((struct dieinfo *));
+static void dwarf_read_array_type (struct dieinfo *);
-static void
-read_tag_pointer_type PARAMS ((struct dieinfo *dip));
+static void read_tag_pointer_type (struct dieinfo *dip);
-static void
-read_tag_string_type PARAMS ((struct dieinfo *dip));
+static void read_tag_string_type (struct dieinfo *dip);
-static void
-read_subroutine_type PARAMS ((struct dieinfo *, char *, char *));
+static void read_subroutine_type (struct dieinfo *, char *, char *);
static void
-read_enumeration PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
+read_enumeration (struct dieinfo *, char *, char *, struct objfile *);
-static struct type *
-struct_type PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
+static struct type *struct_type (struct dieinfo *, char *, char *,
+ struct objfile *);
-static struct type *
-enum_type PARAMS ((struct dieinfo *, struct objfile *));
+static struct type *enum_type (struct dieinfo *, struct objfile *);
-static void
-decode_line_numbers PARAMS ((char *));
+static void decode_line_numbers (char *);
-static struct type *
-decode_die_type PARAMS ((struct dieinfo *));
+static struct type *decode_die_type (struct dieinfo *);
-static struct type *
-decode_mod_fund_type PARAMS ((char *));
+static struct type *decode_mod_fund_type (char *);
-static struct type *
-decode_mod_u_d_type PARAMS ((char *));
+static struct type *decode_mod_u_d_type (char *);
-static struct type *
-decode_modified_type PARAMS ((char *, unsigned int, int));
+static struct type *decode_modified_type (char *, unsigned int, int);
-static struct type *
-decode_fund_type PARAMS ((unsigned int));
+static struct type *decode_fund_type (unsigned int);
-static char *
-create_name PARAMS ((char *, struct obstack *));
+static char *create_name (char *, struct obstack *);
-static struct type *
-lookup_utype PARAMS ((DIE_REF));
+static struct type *lookup_utype (DIE_REF);
-static struct type *
-alloc_utype PARAMS ((DIE_REF, struct type *));
+static struct type *alloc_utype (DIE_REF, struct type *);
-static struct symbol *
-new_symbol PARAMS ((struct dieinfo *, struct objfile *));
+static struct symbol *new_symbol (struct dieinfo *, struct objfile *);
static void
-synthesize_typedef PARAMS ((struct dieinfo *, struct objfile *,
- struct type *));
+synthesize_typedef (struct dieinfo *, struct objfile *, struct type *);
-static int
-locval PARAMS ((struct dieinfo *));
+static int locval (struct dieinfo *);
-static void
-set_cu_language PARAMS ((struct dieinfo *));
+static void set_cu_language (struct dieinfo *);
-static struct type *
-dwarf_fundamental_type PARAMS ((struct objfile *, int));
+static struct type *dwarf_fundamental_type (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)
- struct objfile *objfile;
- int typeid;
+dwarf_fundamental_type (struct objfile *objfile, int typeid)
{
if (typeid < 0 || typeid >= FT_NUM_MEMBERS)
{
@@ -626,7 +580,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,212 +588,201 @@ 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.
*/
static void
-set_cu_language (dip)
- struct dieinfo *dip;
+set_cu_language (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,
+ 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.
*/
void
-dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
- lnoffset, lnsize)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
- file_ptr dbfoff;
- unsigned int dbfsize;
- file_ptr lnoffset;
- unsigned int lnsize;
+dwarf_build_psymtabs (struct objfile *objfile, int mainline, file_ptr dbfoff,
+ unsigned int dbfsize, file_ptr lnoffset,
+ unsigned int lnsize)
{
bfd *abfd = objfile->obfd;
struct cleanup *back_to;
-
+
current_objfile = objfile;
dbsize = dbfsize;
dbbase = xmalloc (dbsize);
dbroff = 0;
if ((bfd_seek (abfd, dbfoff, SEEK_SET) != 0) ||
- (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+ (bfd_bread (dbbase, dbsize, abfd) != dbsize))
{
- free (dbbase);
+ xfree (dbbase);
error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
}
- back_to = make_cleanup (free, dbbase);
-
+ back_to = make_cleanup (xfree, 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;
- baseaddr = ANOFFSET (section_offsets, 0);
+ base_section_offsets = objfile->section_offsets;
+ baseaddr = ANOFFSET (objfile->section_offsets, 0);
/* 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.
*/
static void
-read_lexical_block_scope (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+read_lexical_block_scope (struct dieinfo *dip, char *thisdie, char *enddie,
+ struct objfile *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 *
-lookup_utype (die_ref)
- DIE_REF die_ref;
+lookup_utype (DIE_REF die_ref)
{
struct type *type = NULL;
int utypeidx;
-
+
utypeidx = (die_ref - dbroff) / 4;
if ((utypeidx < 0) || (utypeidx >= numutypes))
{
@@ -855,33 +798,31 @@ 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 *
-alloc_utype (die_ref, utypep)
- DIE_REF die_ref;
- struct type *utypep;
+alloc_utype (DIE_REF die_ref, struct type *utypep)
{
struct type **typep;
int utypeidx;
-
+
utypeidx = (die_ref - dbroff) / 4;
typep = utypes + utypeidx;
if ((utypeidx < 0) || (utypeidx >= numutypes))
@@ -907,26 +848,25 @@ 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
-free_utypes (dummy)
- PTR dummy;
+free_utypes (PTR dummy)
{
- free (utypes);
+ xfree (utypes);
utypes = NULL;
numutypes = 0;
}
@@ -934,45 +874,44 @@ 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 *
-decode_die_type (dip)
- struct dieinfo *dip;
+decode_die_type (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,36 +922,34 @@ 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 *
-struct_type (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+struct_type (struct dieinfo *dip, char *thisdie, char *enddie,
+ 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 +957,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 +1019,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 +1032,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,60 +1093,57 @@ 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
-read_structure_scope (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+read_structure_scope (struct dieinfo *dip, char *thisdie, char *enddie,
+ struct objfile *objfile)
{
struct type *type;
struct symbol *sym;
-
+
type = struct_type (dip, thisdie, enddie, objfile);
- if (!(TYPE_FLAGS (type) & TYPE_FLAG_STUB))
+ if (!TYPE_STUB (type))
{
sym = new_symbol (dip, objfile);
if (sym != NULL)
@@ -1225,33 +1159,32 @@ 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 *
-decode_array_element_type (scan)
- char *scan;
+decode_array_element_type (char *scan)
{
struct type *typep;
DIE_REF die_ref;
unsigned short attribute;
unsigned short fundtype;
int nbytes;
-
+
attribute = target_to_host (scan, SIZEOF_ATTRIBUTE, GET_UNSIGNED,
current_objfile);
scan += SIZEOF_ATTRIBUTE;
@@ -1264,83 +1197,81 @@ 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 *
-decode_subscript_data_item (scan, end)
- char *scan;
- char *end;
+decode_subscript_data_item (char *scan, char *end)
{
struct type *typep = NULL; /* Array type we are building */
struct type *nexttype; /* Type of each element (may be array) */
@@ -1351,7 +1282,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 +1309,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,23 +1336,22 @@ 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
-dwarf_read_array_type (dip)
- struct dieinfo *dip;
+dwarf_read_array_type (struct dieinfo *dip)
{
struct type *type;
struct type *utype;
@@ -1429,23 +1359,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,32 +1400,31 @@ 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
-read_tag_pointer_type (dip)
- struct dieinfo *dip;
+read_tag_pointer_type (struct dieinfo *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,32 +1433,31 @@ 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
-read_tag_string_type (dip)
- struct dieinfo *dip;
+read_tag_string_type (struct dieinfo *dip)
{
struct type *utype;
struct type *indextype;
@@ -1537,10 +1465,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 +1478,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,40 +1502,37 @@ 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
-read_subroutine_type (dip, thisdie, enddie)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
+read_subroutine_type (struct dieinfo *dip, char *thisdie, char *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 +1540,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,37 +1563,34 @@ 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
-read_enumeration (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+read_enumeration (struct dieinfo *dip, char *thisdie, char *enddie,
+ struct objfile *objfile)
{
struct type *type;
struct symbol *sym;
-
+
type = enum_type (dip, objfile);
sym = new_symbol (dip, objfile);
if (sym != NULL)
@@ -1683,45 +1605,44 @@ 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 *
-enum_type (dip, objfile)
- struct dieinfo *dip;
- struct objfile *objfile;
+enum_type (struct dieinfo *dip, 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 +1653,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 +1690,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 +1698,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 +1718,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 +1730,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,83 +1741,74 @@ 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
-read_func_scope (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+read_func_scope (struct dieinfo *dip, char *thisdie, char *enddie,
+ 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 */
- {
- 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.
*/
static void
-handle_producer (producer)
- char *producer;
+handle_producer (char *producer)
{
/* If this compilation unit was compiled with g++ or gcc, then set the
@@ -1923,7 +1835,11 @@ handle_producer (producer)
{
if (STREQN (producer, GPLUS_PRODUCER, strlen (GPLUS_PRODUCER)))
{
+#if 0
+ /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+ know whether it will use the old style or v3 mangling. */
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
+#endif
}
else if (STREQN (producer, LCC_PRODUCER, strlen (LCC_PRODUCER)))
{
@@ -1935,91 +1851,85 @@ 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
-read_file_scope (dip, thisdie, enddie, objfile)
- struct dieinfo *dip;
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+read_file_scope (struct dieinfo *dip, char *thisdie, char *enddie,
+ struct objfile *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
-process_dies (thisdie, enddie, objfile)
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+process_dies (char *thisdie, char *enddie, struct objfile *objfile)
{
char *nextdie;
struct dieinfo di;
-
+
while (thisdie < enddie)
{
basicdieinfo (&di, thisdie, objfile);
@@ -2042,17 +1952,15 @@ process_dies (thisdie, enddie, objfile)
{
nextdie = thisdie + di.die_length;
}
-#ifdef SMASH_TEXT_ADDRESS
/* I think that these are always text, not data, addresses. */
- SMASH_TEXT_ADDRESS (di.at_low_pc);
- SMASH_TEXT_ADDRESS (di.at_high_pc);
-#endif
+ di.at_low_pc = SMASH_TEXT_ADDRESS (di.at_low_pc);
+ di.at_high_pc = SMASH_TEXT_ADDRESS (di.at_high_pc);
switch (di.die_tag)
{
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,67 +2007,66 @@ 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
-decode_line_numbers (linetable)
- char *linetable;
+decode_line_numbers (char *linetable)
{
char *tblscan;
char *tblend;
@@ -2167,7 +2074,7 @@ decode_line_numbers (linetable)
unsigned long base;
unsigned long line;
unsigned long pc;
-
+
if (linetable != NULL)
{
tblscan = tblend = linetable;
@@ -2198,42 +2105,41 @@ 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.
+
+ 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.
+ Note that stack[0] is unused except as a default error return.
+ Note that stack overflow is not yet handled.
*/
static int
-locval (dip)
- struct dieinfo *dip;
+locval (struct dieinfo *dip)
{
unsigned short nbytes;
unsigned short locsize;
@@ -2243,72 +2149,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,26 +2222,25 @@ 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
-read_ofile_symtab (pst)
- struct partial_symtab *pst;
+read_ofile_symtab (struct partial_symtab *pst)
{
struct cleanup *back_to;
unsigned long lnsize;
@@ -2343,8 +2248,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,17 +2257,17 @@ 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) ||
- (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+ (bfd_bread (dbbase, dbsize, abfd) != dbsize))
{
- free (dbbase);
+ xfree (dbbase);
error ("can't read DWARF data");
}
- back_to = make_cleanup (free, dbbase);
+ back_to = make_cleanup (xfree, dbbase);
/* If there is a line number table associated with this compilation unit
then read the size of this fragment in bytes, from the fragment itself.
@@ -2373,66 +2278,65 @@ read_ofile_symtab (pst)
if (LNFOFF (pst))
{
if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
- (bfd_read ((PTR) lnsizedata, sizeof (lnsizedata), 1, abfd) !=
- sizeof (lnsizedata)))
+ (bfd_bread ((PTR) lnsizedata, sizeof (lnsizedata), abfd)
+ != sizeof (lnsizedata)))
{
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))
+ (bfd_bread (lnbase, lnsize, abfd) != lnsize))
{
- free (lnbase);
+ xfree (lnbase);
error ("can't read DWARF line numbers");
}
- make_cleanup (free, lnbase);
+ make_cleanup (xfree, 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)
- struct partial_symtab *pst;
+psymtab_to_symtab_1 (struct partial_symtab *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 +2346,17 @@ 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 (really_free_pendings, 0);
read_ofile_symtab (pst);
if (info_verbose)
{
@@ -2461,68 +2364,67 @@ 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)
- struct partial_symtab *pst;
+dwarf_psymtab_to_symtab (struct partial_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,30 +2438,28 @@ 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)
- struct dieinfo *dip;
- struct objfile *objfile;
+add_enum_psymbol (struct dieinfo *dip, struct objfile *objfile)
{
char *scan;
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 +2474,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 +2483,54 @@ 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;
+add_partial_symbol (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 +2538,24 @@ 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* */
/*
LOCAL FUNCTION
@@ -2721,17 +2619,17 @@ NOTES
where the actual definition occurs, rather than just a reference
to an external.
*/
+/* *INDENT-ON* */
+
+
static void
-scan_partial_symbols (thisdie, enddie, objfile)
- char *thisdie;
- char *enddie;
- struct objfile *objfile;
+scan_partial_symbols (char *thisdie, char *enddie, struct objfile *objfile)
{
char *nextdie;
char *temp;
struct dieinfo di;
-
+
while (thisdie < enddie)
{
basicdieinfo (&di, thisdie, objfile);
@@ -2805,54 +2703,50 @@ 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.
- 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.
+ NOTES
-RETURNS
+ 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 no value.
+ RETURNS
+
+ Returns no value.
*/
static void
-scan_compilation_units (thisdie, enddie, dbfoff, lnoffset, objfile)
- char *thisdie;
- char *enddie;
- file_ptr dbfoff;
- file_ptr lnoffset;
- struct objfile *objfile;
+scan_compilation_units (char *thisdie, char *enddie, file_ptr dbfoff,
+ file_ptr lnoffset, struct objfile *objfile)
{
char *nextdie;
struct dieinfo di;
@@ -2892,69 +2786,67 @@ 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 *
-new_symbol (dip, objfile)
- struct dieinfo *dip;
- struct objfile *objfile;
+new_symbol (struct dieinfo *dip, 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;
@@ -2962,26 +2854,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);
}
@@ -2991,7 +2883,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);
@@ -3000,21 +2892,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
{
@@ -3035,19 +2927,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
{
@@ -3083,41 +2975,39 @@ 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.
*/
static void
-synthesize_typedef (dip, objfile, type)
- struct dieinfo *dip;
- struct objfile *objfile;
- struct type *type;
+synthesize_typedef (struct dieinfo *dip, struct objfile *objfile,
+ 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;
@@ -3129,35 +3019,34 @@ 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)
- char *typedata;
+decode_mod_fund_type (char *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);
@@ -3176,35 +3065,34 @@ 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)
- char *typedata;
+decode_mod_u_d_type (char *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);
@@ -3223,56 +3111,53 @@ 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)
*/
static struct type *
-decode_modified_type (modifiers, modcount, mtype)
- char *modifiers;
- unsigned int modcount;
- int mtype;
+decode_modified_type (char *modifiers, unsigned int modcount, int mtype)
{
struct type *typep = NULL;
unsigned short fundtype;
DIE_REF die_ref;
char modifier;
int nbytes;
-
+
if (modcount == 0)
{
switch (mtype)
@@ -3304,25 +3189,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);
@@ -3330,39 +3215,38 @@ 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;
+decode_fund_type (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;
@@ -3371,11 +3255,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;
@@ -3383,7 +3267,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;
@@ -3391,11 +3275,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;
@@ -3403,11 +3287,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;
@@ -3415,11 +3299,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;
@@ -3435,27 +3319,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)
@@ -3466,27 +3350,25 @@ 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)
- char *name;
- struct obstack *obstackp;
+create_name (char *name, struct obstack *obstackp)
{
int length;
char *newname;
@@ -3499,134 +3381,129 @@ 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.
-
- 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.
+ 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.
*/
static void
-basicdieinfo (dip, diep, objfile)
- struct dieinfo *dip;
- char *diep;
- struct objfile *objfile;
+basicdieinfo (struct dieinfo *dip, char *diep, struct objfile *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.
+
+ 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.
+ 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.
*/
static void
-completedieinfo (dip, objfile)
- struct dieinfo *dip;
- struct objfile *objfile;
+completedieinfo (struct dieinfo *dip, struct objfile *objfile)
{
char *diep; /* Current pointer into raw DIE data */
char *end; /* Terminate DIE scan here */
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)
{
@@ -3641,121 +3518,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
@@ -3800,87 +3677,83 @@ 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?
*/
static CORE_ADDR
-target_to_host (from, nbytes, signextend, objfile)
- char *from;
- int nbytes;
- int signextend; /* FIXME: Unused */
- struct objfile *objfile;
+target_to_host (char *from, int nbytes, int signextend, /* FIXME: Unused */
+ struct objfile *objfile)
{
CORE_ADDR rtnval;
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.
*/
static int
-attribute_size (attr)
- unsigned int attr;
+attribute_size (unsigned int attr)
{
int nbytes; /* Size of next data for this attribute */
unsigned short form; /* Form of the attribute */
@@ -3888,28 +3761,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);
}
diff --git a/contrib/gdb/gdb/elfread.c b/contrib/gdb/gdb/elfread.c
index 417039e..e76cd0d 100644
--- a/contrib/gdb/gdb/elfread.c
+++ b/contrib/gdb/gdb/elfread.c
@@ -1,22 +1,25 @@
/* Read ELF (Executable and Linking Format) object files for GDB.
- Copyright 1991, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002
+ 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"
@@ -32,60 +35,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "demangle.h"
+extern void _initialize_elfread (void);
+
/* The struct elfinfo is available only during ELF symbol table and
- psymtab reading. It is destroyed at the complation of psymtab-reading.
+ psymtab reading. It is destroyed at the completion 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_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_questionable_complaint =
- {"elf/stab section information questionable for %s", 0, 0};
-
-static void
-elf_symfile_init PARAMS ((struct objfile *));
-
-static void
-elf_new_init PARAMS ((struct objfile *));
-
-static void
-elf_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
+struct complaint section_info_complaint =
+{"elf/stab section information %s without a preceding file symbol", 0, 0};
-static void
-elf_symfile_finish PARAMS ((struct objfile *));
+struct complaint section_info_dup_complaint =
+{"duplicated elf/stab section information for %s", 0, 0};
-static void
-elf_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *, int));
+struct complaint stab_info_mismatch_complaint =
+{"elf/stab section information missing for %s", 0, 0};
-static void
-free_elfinfo PARAMS ((void *));
+struct complaint stab_info_questionable_complaint =
+{"elf/stab section information questionable for %s", 0, 0};
-static struct minimal_symbol *
-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 *));
+static void free_elfinfo (void *);
/* We are called once per section from elf_symfile_read. We
need to examine each section we are passed, check to see
@@ -107,43 +88,39 @@ elf_locate_sections PARAMS ((bfd *, asection *, void *));
-kingdon). */
static void
-elf_locate_sections (ignore_abfd, sectp, eip)
- bfd *ignore_abfd;
- asection *sectp;
- PTR eip;
+elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *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)
- bfd *abfd;
+elf_interpreter (bfd *abfd)
{
sec_ptr interp_sec;
unsigned size;
@@ -154,7 +131,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);
@@ -170,77 +147,43 @@ elf_interpreter (abfd)
#endif
static struct minimal_symbol *
-record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section,
- objfile)
- char *name;
- CORE_ADDR address;
- enum minimal_symbol_type ms_type;
- char *info; /* FIXME, is this really char *? */
- asection *bfd_section;
- struct objfile *objfile;
+record_minimal_symbol_and_info (char *name, CORE_ADDR address,
+ enum minimal_symbol_type ms_type, char *info, /* FIXME, is this really char *? */
+ asection *bfd_section, struct objfile *objfile)
{
- int section;
-
- /* Guess the section from the type. This is likely to be wrong in
- some cases. */
- switch (ms_type)
- {
- case mst_text:
- case mst_file_text:
- section = SECT_OFF_TEXT;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (address);
-#endif
- break;
- case mst_data:
- case mst_file_data:
- section = SECT_OFF_DATA;
- break;
- case mst_bss:
- case mst_file_bss:
- section = SECT_OFF_BSS;
- break;
- default:
- section = -1;
- break;
- }
+ if (ms_type == mst_text || ms_type == mst_file_text)
+ address = SMASH_TEXT_ADDRESS (address);
return prim_record_minimal_symbol_and_info
- (name, address, ms_type, info, section, bfd_section, objfile);
+ (name, address, ms_type, info, bfd_section->index, bfd_section, objfile);
}
/*
-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 (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 objfile and a flag that specifies whether or not the objfile
+ 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)
- bfd *abfd;
- CORE_ADDR addr;
- struct objfile *objfile;
- int dynamic;
+elf_symtab_read (struct objfile *objfile, int dynamic)
{
long storage_needed;
asymbol *sym;
@@ -250,6 +193,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
int index;
struct cleanup *back_to;
CORE_ADDR symaddr;
+ CORE_ADDR offset;
enum minimal_symbol_type ms_type;
/* If sectinfo is nonNULL, it contains section info that should end up
filed in the objfile. */
@@ -263,11 +207,11 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
#endif
struct dbx_symfile_info *dbx = objfile->sym_stab_info;
unsigned long size;
- int stripped = (bfd_get_symcount (abfd) == 0);
-
+ int stripped = (bfd_get_symcount (objfile->obfd) == 0);
+
if (dynamic)
{
- storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
+ storage_needed = bfd_get_dynamic_symtab_upper_bound (objfile->obfd);
/* Nothing to be done if there is no dynamic symtab. */
if (storage_needed < 0)
@@ -275,54 +219,56 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
else
{
- storage_needed = bfd_get_symtab_upper_bound (abfd);
+ storage_needed = bfd_get_symtab_upper_bound (objfile->obfd);
if (storage_needed < 0)
- error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
+ error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
bfd_errmsg (bfd_get_error ()));
}
if (storage_needed > 0)
{
symbol_table = (asymbol **) xmalloc (storage_needed);
- back_to = make_cleanup (free, symbol_table);
+ back_to = make_cleanup (xfree, symbol_table);
if (dynamic)
- number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd,
+ number_of_symbols = bfd_canonicalize_dynamic_symtab (objfile->obfd,
symbol_table);
else
- number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+ number_of_symbols = bfd_canonicalize_symtab (objfile->obfd, symbol_table);
if (number_of_symbols < 0)
- error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
+ error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
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;
}
+ offset = ANOFFSET (objfile->section_offsets, sym->section->index);
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,
+ plus the desired section offset.
+ 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;
+ symaddr += offset;
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;
@@ -335,47 +281,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;
- /* Relocate all non-absolute symbols by base address. */
- if (sym -> section != &bfd_abs_section)
+ symaddr = sym->value + sym->section->vma;
+ /* Relocate all non-absolute symbols by the section offset. */
+ if (sym->section != &bfd_abs_section)
{
- symaddr += addr;
+ symaddr += offset;
}
/* 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
+ right for Irix 5, which has absolute addresses
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)
{
@@ -393,22 +339,22 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
/* If it is an Irix dynamic symbol, skip section name
- symbols, relocate all others. */
+ symbols, relocate all others by section offset. */
if (ms_type != mst_abs)
{
if (sym->name[0] == '.')
continue;
- symaddr += addr;
+ symaddr += offset;
}
}
- 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.
@@ -422,23 +368,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 | BSF_WEAK))
{
- if (sym -> section -> flags & SEC_LOAD)
+ if (sym->section->flags & SEC_LOAD)
{
ms_type = mst_data;
}
@@ -447,25 +393,25 @@ 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;
+ index = SECT_OFF_BSS (objfile);
}
- else if (STREQ ("Ddata.data", sym -> name))
+ else if (STREQ ("Ddata.data", sym->name))
{
- index = SECT_OFF_DATA;
+ index = SECT_OFF_DATA (objfile);
}
- else if (STREQ ("Drodata.rodata", sym -> name))
+ else if (STREQ ("Drodata.rodata", sym->name))
{
- index = SECT_OFF_RODATA;
+ index = SECT_OFF_RODATA (objfile);
}
if (index != SECT_OFF_MAX)
{
@@ -474,39 +420,50 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
if (sectinfo == NULL)
{
sectinfo = (struct stab_section_info *)
- xmmalloc (objfile -> md, sizeof (*sectinfo));
- memset ((PTR) sectinfo, 0, sizeof (*sectinfo));
+ xmmalloc (objfile->md, sizeof (*sectinfo));
+ memset (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)
- {
- complain (&section_info_dup_complaint,
- sectinfo -> filename);
+ if (index != -1)
+ {
+ if (sectinfo->sections[index] != 0)
+ {
+ complain (&section_info_dup_complaint,
+ sectinfo->filename);
+ }
}
+ else
+ internal_error (__FILE__, __LINE__,
+ "Section index uninitialized.");
/* Bfd symbols are section relative. */
- symaddr = sym -> value + sym -> section -> vma;
- /* Relocate non-absolute symbols by base address. */
- if (sym -> section != &bfd_abs_section)
+ symaddr = sym->value + sym->section->vma;
+ /* Relocate non-absolute symbols by the section offset. */
+ if (sym->section != &bfd_abs_section)
{
- symaddr += addr;
+ symaddr += offset;
}
- sectinfo -> sections[index] = symaddr;
+ if (index != -1)
+ sectinfo->sections[index] = symaddr;
+ else
+ internal_error (__FILE__, __LINE__,
+ "Section index uninitialized.");
/* 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;
}
@@ -527,20 +484,18 @@ 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, (void *) 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);
-#endif
+ ELF_MAKE_MSYMBOL_SPECIAL (sym, msym);
}
}
do_cleanups (back_to);
@@ -580,10 +535,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
capability even for files compiled without -g. */
static void
-elf_symfile_read (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+elf_symfile_read (struct objfile *objfile, int mainline)
{
bfd *abfd = objfile->obfd;
struct elfinfo ei;
@@ -591,27 +543,25 @@ elf_symfile_read (objfile, section_offsets, mainline)
CORE_ADDR offset;
init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup_discard_minimal_symbols ();
memset ((char *) &ei, 0, sizeof (ei));
/* 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);
+ make_cleanup (free_elfinfo, (void *) objfile);
/* Process the normal ELF symbol table first. This may write some
chain of info into the dbx_symfile_info in objfile->sym_stab_info,
which can later be used by elfstab_offset_sections. */
- /* FIXME, should take a section_offsets param, not just an offset. */
- offset = ANOFFSET (section_offsets, 0);
- elf_symtab_read (abfd, offset, objfile, 0);
+ elf_symtab_read (objfile, 0);
/* Add the dynamic symbols. */
- elf_symtab_read (abfd, offset, objfile, 1);
+ elf_symtab_read (objfile, 1);
/* Now process debugging information, which is contained in
special ELF sections. */
@@ -626,7 +576,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, (void *) & ei);
/* ELF debugging information is inserted into the psymtab in the
order of least informative first - most informative last. Since
@@ -645,24 +595,22 @@ 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,
- section_offsets);
+ elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect);
}
if (ei.stabsect)
{
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. */
if (str_sect)
elfstab_build_psymtabs (objfile,
- section_offsets,
mainline,
ei.stabsect->filepos,
bfd_section_size (abfd, ei.stabsect),
@@ -672,17 +620,20 @@ elf_symfile_read (objfile, section_offsets, mainline)
if (dwarf2_has_info (abfd))
{
/* DWARF 2 sections */
- dwarf2_build_psymtabs (objfile, section_offsets, mainline);
+ dwarf2_build_psymtabs (objfile, mainline);
}
else if (ei.dboffset && ei.lnoffset)
{
/* DWARF sections */
dwarf_build_psymtabs (objfile,
- section_offsets, mainline,
+ mainline,
ei.dboffset, ei.dbsize,
ei.lnoffset, ei.lnsize);
}
+ if (DWARF2_BUILD_FRAME_INFO_P ())
+ DWARF2_BUILD_FRAME_INFO(objfile);
+
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
@@ -695,10 +646,9 @@ elf_symfile_read (objfile, section_offsets, mainline)
stab_section_info's, that might be dangling from it. */
static void
-free_elfinfo (objp)
- PTR objp;
+free_elfinfo (void *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;
@@ -706,7 +656,7 @@ free_elfinfo (objp)
while (ssi)
{
nssi = ssi->next;
- mfree (objfile->md, ssi);
+ xmfree (objfile->md, ssi);
ssi = nssi;
}
@@ -721,8 +671,7 @@ free_elfinfo (objp)
We reinitialize buildsym, since we may be reading stabs from an ELF file. */
static void
-elf_new_init (ignore)
- struct objfile *ignore;
+elf_new_init (struct objfile *ignore)
{
stabsread_new_init ();
buildsym_new_init ();
@@ -734,12 +683,11 @@ elf_new_init (ignore)
objfile struct from the global list of known objfiles. */
static void
-elf_symfile_finish (objfile)
- struct objfile *objfile;
+elf_symfile_finish (struct objfile *objfile)
{
- if (objfile -> sym_stab_info != NULL)
+ if (objfile->sym_stab_info != NULL)
{
- mfree (objfile -> md, objfile -> sym_stab_info);
+ xmfree (objfile->md, objfile->sym_stab_info);
}
}
@@ -753,8 +701,7 @@ elf_symfile_finish (objfile)
just a stub. */
static void
-elf_symfile_init (objfile)
- struct objfile *objfile;
+elf_symfile_init (struct objfile *objfile)
{
/* ELF objects may be reordered, so set OBJF_REORDERED. If we
find this causes a significant slowdown in gdb then we could
@@ -771,9 +718,7 @@ elf_symfile_init (objfile)
with wierd names. Go get 'em when needed. */
void
-elfstab_offset_sections (objfile, pst)
- struct objfile *objfile;
- struct partial_symtab *pst;
+elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
{
char *filename = pst->filename;
struct dbx_symfile_info *dbx = objfile->sym_stab_info;
@@ -785,7 +730,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,
@@ -799,7 +744,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. */
}
}
@@ -814,17 +759,14 @@ 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,
- sizeof (struct section_offsets) +
- sizeof (pst->section_offsets->offsets) * (SECT_OFF_MAX-1));
-
+ obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
for (i = 0; i < SECT_OFF_MAX; i++)
- ANOFFSET (pst->section_offsets, i) = maybe->sections[i];
+ (pst->section_offsets)->offsets[i] = maybe->sections[i];
return;
}
/* 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);
}
@@ -833,17 +775,16 @@ 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 */
- default_symfile_offsets,
- /* sym_offsets: Translate ext. to int. relocation */
- NULL /* next: pointer to next struct sym_fns */
+ 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 */
};
void
-_initialize_elfread ()
+_initialize_elfread (void)
{
add_symtab_fns (&elf_sym_fns);
}
diff --git a/contrib/gdb/gdb/environ.c b/contrib/gdb/gdb/environ.c
index 77296be..1f9a9d6 100644
--- a/contrib/gdb/gdb/environ.c
+++ b/contrib/gdb/gdb/environ.c
@@ -1,19 +1,21 @@
/* environ.c -- library for manipulating environments for GNU.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 2000
+ 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))
@@ -21,13 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "environ.h"
#include "gdb_string.h"
-#include "gdbcore.h"
-
+
/* Return a new environment object. */
struct environ *
-make_environ ()
+make_environ (void)
{
register struct environ *e;
@@ -42,15 +43,14 @@ make_environ ()
/* Free an environment and all the strings in it. */
void
-free_environ (e)
- register struct environ *e;
+free_environ (register struct environ *e)
{
register char **vector = e->vector;
while (*vector)
- free (*vector++);
+ xfree (*vector++);
- free (e);
+ xfree (e);
}
/* Copy the environment given to this process into E.
@@ -58,8 +58,7 @@ free_environ (e)
that all strings in these environments are safe to free. */
void
-init_environ (e)
- register struct environ *e;
+init_environ (register struct environ *e)
{
extern char **environ;
register int i;
@@ -67,12 +66,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 *));
}
@@ -91,8 +90,7 @@ init_environ (e)
This is used to get something to pass to execve. */
char **
-environ_vector (e)
- struct environ *e;
+environ_vector (struct environ *e)
{
return e->vector;
}
@@ -100,9 +98,7 @@ environ_vector (e)
/* Return the value in environment E of variable VAR. */
char *
-get_in_environ (e, var)
- const struct environ *e;
- const char *var;
+get_in_environ (const struct environ *e, const char *var)
{
register int len = strlen (var);
register char **vector = e->vector;
@@ -118,10 +114,7 @@ get_in_environ (e, var)
/* Store the value in E of VAR as VALUE. */
void
-set_in_environ (e, var, value)
- struct environ *e;
- const char *var;
- const char *value;
+set_in_environ (struct environ *e, const char *var, const char *value)
{
register int i;
register int len = strlen (var);
@@ -137,14 +130,14 @@ 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;
}
vector[i + 1] = 0;
}
else
- free (s);
+ xfree (s);
s = (char *) xmalloc (len + strlen (value) + 2);
strcpy (s, var);
@@ -168,9 +161,7 @@ set_in_environ (e, var, value)
/* Remove the setting for variable VAR from environment E. */
void
-unset_in_environ (e, var)
- struct environ *e;
- char *var;
+unset_in_environ (struct environ *e, char *var)
{
register int len = strlen (var);
register char **vector = e->vector;
@@ -180,7 +171,7 @@ unset_in_environ (e, var)
{
if (STREQN (s, var, len) && s[len] == '=')
{
- free (s);
+ xfree (s);
/* Walk through the vector, shuffling args down by one, including
the NULL terminator. Can't use memcpy() here since the regions
overlap, and memmove() might not be available. */
diff --git a/contrib/gdb/gdb/environ.h b/contrib/gdb/gdb/environ.h
index 87a538a..1aa1394 100644
--- a/contrib/gdb/gdb/environ.h
+++ b/contrib/gdb/gdb/environ.h
@@ -1,19 +1,20 @@
/* Header for environment manipulation library.
- Copyright 1989, 1992 Free Software Foundation.
+ Copyright 1989, 1992, 2000 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 (ENVIRON_H)
#define ENVIRON_H 1
@@ -21,38 +22,30 @@ 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));
+extern struct environ *make_environ (void);
-extern void
-free_environ PARAMS ((struct environ *));
+extern void free_environ (struct environ *);
-extern void
-init_environ PARAMS ((struct environ *));
+extern void init_environ (struct environ *);
-extern char *
-get_in_environ PARAMS ((const struct environ *, const char *));
+extern char *get_in_environ (const struct environ *, const char *);
-extern void
-set_in_environ PARAMS ((struct environ *, const char *,
- const char *));
+extern void set_in_environ (struct environ *, const char *, const char *);
-extern void
-unset_in_environ PARAMS ((struct environ *, char *));
+extern void unset_in_environ (struct environ *, char *);
-extern char **
-environ_vector PARAMS ((struct environ *));
+extern char **environ_vector (struct environ *);
-#endif /* defined (ENVIRON_H) */
+#endif /* defined (ENVIRON_H) */
diff --git a/contrib/gdb/gdb/eval.c b/contrib/gdb/gdb/eval.c
index d3c3465..3f5aca3 100644
--- a/contrib/gdb/gdb/eval.c
+++ b/contrib/gdb/gdb/eval.c
@@ -1,22 +1,24 @@
/* Evaluate expressions for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -26,47 +28,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "expression.h"
#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 */
+#include "cp-abi.h"
-/* 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;
+/* JYG: lookup rtti type of STRUCTOP_PTR when this is set to continue
+ on with successful lookup for member/method of the rtti type. */
+extern int objectprint;
/* Prototypes for local functions. */
-static value_ptr evaluate_subexp_for_sizeof PARAMS ((struct expression *,
- int *));
+static struct value *evaluate_subexp_for_sizeof (struct expression *, int *);
-static value_ptr evaluate_subexp_for_address PARAMS ((struct expression *,
- int *, enum noside));
+static struct value *evaluate_subexp_for_address (struct expression *,
+ int *, enum noside);
-static value_ptr evaluate_subexp PARAMS ((struct type *, struct expression *,
- int *, enum noside));
+static struct value *evaluate_subexp (struct type *, struct expression *,
+ int *, enum noside);
-static char *get_label PARAMS ((struct expression *, int *));
+static char *get_label (struct expression *, int *);
-static value_ptr
-evaluate_struct_tuple PARAMS ((value_ptr, struct expression *, int *,
- enum noside, int));
+static struct value *evaluate_struct_tuple (struct value *,
+ struct expression *, int *,
+ enum noside, int);
-static LONGEST
-init_array_element PARAMS ((value_ptr, value_ptr, struct expression *,
- int *, enum noside, LONGEST, LONGEST));
-
-#ifdef __GNUC__
-inline
-#endif
-static value_ptr
-evaluate_subexp (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+static LONGEST init_array_element (struct value *, struct value *,
+ struct expression *, int *, enum noside,
+ LONGEST, LONGEST);
+
+static struct value *
+evaluate_subexp (struct type *expect_type, register struct expression *exp,
+ register int *pos, enum noside noside)
{
return (*exp->language_defn->evaluate_exp) (expect_type, exp, pos, noside);
}
@@ -75,15 +73,14 @@ evaluate_subexp (expect_type, exp, pos, noside)
and return the result as a number. */
CORE_ADDR
-parse_and_eval_address (exp)
- char *exp;
+parse_and_eval_address (char *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 (free_current_contents, &expr);
- addr = value_as_pointer (evaluate_expression (expr));
+ addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
return addr;
}
@@ -92,27 +89,40 @@ parse_and_eval_address (exp)
and advanced that variable across the characters parsed. */
CORE_ADDR
-parse_and_eval_address_1 (expptr)
- char **expptr;
+parse_and_eval_address_1 (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 (free_current_contents, &expr);
- addr = value_as_pointer (evaluate_expression (expr));
+ addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
return addr;
}
-value_ptr
-parse_and_eval (exp)
- char *exp;
+/* Like parse_and_eval_address, but treats the value of the expression
+ as an integer, not an address, returns a LONGEST, not a CORE_ADDR */
+LONGEST
+parse_and_eval_long (char *exp)
{
struct expression *expr = parse_expression (exp);
- register value_ptr val;
+ register LONGEST retval;
+ register struct cleanup *old_chain =
+ make_cleanup (free_current_contents, &expr);
+
+ retval = value_as_long (evaluate_expression (expr));
+ do_cleanups (old_chain);
+ return (retval);
+}
+
+struct value *
+parse_and_eval (char *exp)
+{
+ struct expression *expr = parse_expression (exp);
+ struct value *val;
register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
do_cleanups (old_chain);
@@ -123,14 +133,13 @@ parse_and_eval (exp)
in the string EXPP as an expression, evaluate it, and return the value.
EXPP is advanced to point to the comma. */
-value_ptr
-parse_to_comma_and_eval (expp)
- char **expp;
+struct value *
+parse_to_comma_and_eval (char **expp)
{
struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
- register value_ptr val;
+ struct value *val;
register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
do_cleanups (old_chain);
@@ -142,9 +151,8 @@ parse_to_comma_and_eval (expp)
See expression.h for info on the format of an expression. */
-value_ptr
-evaluate_expression (exp)
- struct expression *exp;
+struct value *
+evaluate_expression (struct expression *exp)
{
int pc = 0;
return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_NORMAL);
@@ -153,9 +161,8 @@ evaluate_expression (exp)
/* Evaluate an expression, avoiding all memory references
and getting a value whose type alone is correct. */
-value_ptr
-evaluate_type (exp)
- struct expression *exp;
+struct value *
+evaluate_type (struct expression *exp)
{
int pc = 0;
return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_AVOID_SIDE_EFFECTS);
@@ -164,10 +171,8 @@ 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*
-get_label (exp, pos)
- register struct expression *exp;
- int *pos;
+static char *
+get_label (register struct expression *exp, int *pos)
{
if (exp->elts[*pos].opcode == OP_LABELED)
{
@@ -181,16 +186,13 @@ get_label (exp, pos)
return NULL;
}
-/* This function evaluates tupes (in Chill) or brace-initializers
+/* This function evaluates tuples (in Chill) or brace-initializers
(in C/C++) for structure types. */
-static value_ptr
-evaluate_struct_tuple (struct_val, exp, pos, noside, nargs)
- value_ptr struct_val;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
- int nargs;
+static struct value *
+evaluate_struct_tuple (struct value *struct_val,
+ register struct expression *exp,
+ register int *pos, enum noside noside, int nargs)
{
struct type *struct_type = check_typedef (VALUE_TYPE (struct_val));
struct type *substruct_type = struct_type;
@@ -198,14 +200,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;
+ struct value *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 +244,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 +319,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;
}
@@ -331,12 +334,9 @@ evaluate_struct_tuple (struct_val, exp, pos, noside, nargs)
Returns last index value. */
static LONGEST
-init_array_element (array, element, exp, pos, noside, low_bound, high_bound)
- value_ptr array, element;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
- LONGEST low_bound, high_bound;
+init_array_element (struct value *array, struct value *element,
+ register struct expression *exp, register int *pos,
+ enum noside noside, LONGEST low_bound, LONGEST high_bound)
{
LONGEST index;
int element_size = TYPE_LENGTH (VALUE_TYPE (element));
@@ -356,7 +356,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,
@@ -374,41 +374,27 @@ init_array_element (array, element, exp, pos, noside, low_bound, high_bound)
return index;
}
-value_ptr
-evaluate_subexp_standard (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+struct value *
+evaluate_subexp_standard (struct type *expect_type,
+ register struct expression *exp, register int *pos,
+ enum noside noside)
{
enum exp_opcode op;
int tem, tem2, tem3;
register int pc, pc2 = 0, oldpos;
- register value_ptr arg1 = NULL, arg2 = NULL, arg3;
+ struct value *arg1 = NULL;
+ struct value *arg2 = NULL;
+ struct value *arg3;
struct type *type;
int nargs;
- value_ptr *argvec;
- int upper, lower, retcode;
+ struct value **argvec;
+ int upper, lower, retcode;
int code;
int ix;
long mem_offset;
- struct symbol * sym;
- struct type ** arg_types;
+ struct type **arg_types;
int save_pos1;
- /* This expect_type crap should not be used for C. C expressions do
- not have any notion of expected types, never has and (goddess
- willing) never will. The C++ code uses it for some twisted
- purpose (I haven't investigated but I suspect it just the usual
- combination of Stroustrup figuring out some crazy language
- feature and Tiemann figuring out some crazier way to try to
- implement it). CHILL has the tuple stuff; I don't know enough
- about CHILL to know whether expected types is the way to do it.
- FORTRAN I don't know. */
- if (exp->language_defn->la_language != language_cplus
- && exp->language_defn->la_language != language_chill)
- expect_type = NULL_TYPE;
-
pc = (*pos)++;
op = exp->elts[pc].opcode;
@@ -421,7 +407,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
0,
exp->elts[pc + 1].type,
&exp->elts[pc + 3].string,
- expect_type);
+ NULL_TYPE);
if (arg1 == NULL)
error ("There is no field named %s", &exp->elts[pc + 3].string);
return arg1;
@@ -440,32 +426,16 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
(*pos) += 3;
if (noside == EVAL_SKIP)
goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- struct symbol * sym = exp->elts[pc + 2].symbol;
- enum lval_type lv;
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_CONST:
- case LOC_LABEL:
- case LOC_CONST_BYTES:
- lv = not_lval;
- break;
-
- case LOC_REGISTER:
- case LOC_REGPARM:
- lv = lval_register;
- break;
-
- default:
- lv = lval_memory;
- break;
- }
+ /* JYG: We used to just return value_zero of the symbol type
+ if we're asked to avoid side effects. Otherwise we return
+ value_of_variable (...). However I'm not sure if
+ value_of_variable () has any side effect.
+ We need a full value object returned here for whatis_exp ()
+ to call evaluate_type () and then pass the full value to
+ value_rtti_target_type () if we are dealing with a pointer
+ or reference to a base class and print object is on. */
- return value_zero (SYMBOL_TYPE (sym), lv);
- }
- else
return value_of_variable (exp->elts[pc + 2].symbol,
exp->elts[pc + 1].block);
@@ -476,8 +446,8 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
case OP_REGISTER:
{
- int regno = longest_to_int (exp->elts[pc + 1].longconst);
- value_ptr val = value_of_register (regno);
+ int regno = longest_to_int (exp->elts[pc + 1].longconst);
+ struct value *val = value_of_register (regno);
(*pos) += 2;
if (val == NULL)
@@ -488,7 +458,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;
@@ -520,7 +490,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
if (expect_type != NULL_TYPE && noside != EVAL_SKIP
&& TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
- value_ptr rec = allocate_value (expect_type);
+ struct value *rec = allocate_value (expect_type);
memset (VALUE_CONTENTS_RAW (rec), '\0', TYPE_LENGTH (type));
return evaluate_struct_tuple (rec, exp, pos, noside, nargs);
}
@@ -530,7 +500,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
{
struct type *range_type = TYPE_FIELD_TYPE (type, 0);
struct type *element_type = TYPE_TARGET_TYPE (type);
- value_ptr array = allocate_value (expect_type);
+ struct value *array = allocate_value (expect_type);
int element_size = TYPE_LENGTH (check_typedef (element_type));
LONGEST low_bound, high_bound, index;
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
@@ -540,9 +510,9 @@ 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;
+ struct value *element;
int index_pc = 0;
if (exp->elts[*pos].opcode == BINOP_RANGE)
{
@@ -578,7 +548,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
if (expect_type != NULL_TYPE && noside != EVAL_SKIP
&& TYPE_CODE (type) == TYPE_CODE_SET)
{
- value_ptr set = allocate_value (expect_type);
+ struct value *set = allocate_value (expect_type);
char *valaddr = VALUE_CONTENTS_RAW (set);
struct type *element_type = TYPE_INDEX_TYPE (type);
struct type *check_type = element_type;
@@ -596,7 +566,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
{
LONGEST range_low, range_high;
struct type *range_low_type, *range_high_type;
- value_ptr elem_val;
+ struct value *elem_val;
if (exp->elts[*pos].opcode == BINOP_RANGE)
{
(*pos)++;
@@ -614,8 +584,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)
@@ -638,19 +608,19 @@ 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;
}
}
return set;
}
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * nargs);
+ argvec = (struct value **) alloca (sizeof (struct value *) * nargs);
for (tem = 0; tem < nargs; tem++)
{
/* Ensure that array expressions are coerced into pointer objects. */
@@ -662,11 +632,11 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
case TERNOP_SLICE:
{
- value_ptr array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
int lowbound
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = 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);
@@ -674,11 +644,11 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
case TERNOP_SLICE_COUNT:
{
- value_ptr array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
int lowbound
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = 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);
}
@@ -702,19 +672,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 */
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * (nargs + 3));
+ called in argvec[0] and a terminating NULL */
+ argvec = (struct value **) alloca (sizeof (struct value *) * (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 */
@@ -742,16 +712,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--)
{
@@ -761,7 +731,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
for (j = TYPE_FN_FIELDLIST_LENGTH (basetype, i) - 1; j >= 0; --j)
if ((int) TYPE_FN_FIELD_VOFFSET (f, j) == fnoffset)
{
- value_ptr temp = value_ind (arg2);
+ struct value *temp = value_ind (arg2);
arg1 = value_virtual_fn_field (&temp, f, j, domain_type, 0);
arg2 = value_addr (temp);
goto got_it;
@@ -795,19 +765,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
@@ -830,9 +800,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);
}
}
@@ -851,49 +821,47 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
{
int static_memfuncp;
- value_ptr temp = arg2;
+ struct value *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 */
- 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 */
- }
+
+ /* 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_pointer (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 */
+ struct value *valp = NULL;
+
+ /* Prepare list of argument types for overload resolution */
+ arg_types = (struct type **) alloca (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)
{
@@ -907,40 +875,50 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
argvec[1] = arg2;
argvec[0] = arg1;
}
- else
- {
+ else if (op == OP_VAR_VALUE)
+ {
/* Non-member function being called */
+ /* fn: This can only be done for C++ functions. A C-style function
+ in a C++ program, for instance, does not have the fields that
+ are expected here */
- 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 **) alloca (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[save_pos1+2].symbol /* the function */ ,
+ NULL, &symp, NULL);
+
+ /* Now fix the expression being evaluated */
+ exp->elts[save_pos1+2].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 */
+ }
+ }
+ else
+ {
+ /* It is probably a C-style function */
+ /* nothing to be done; argvec already correctly set up */
+ }
do_call_it:
if (noside == EVAL_SKIP)
goto nosideret;
+ if (argvec[0] == NULL)
+ error ("Cannot evaluate function -- may be inlined");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
/* If the return type doesn't look like a function type, call an
@@ -951,36 +929,34 @@ 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])));
else
error ("Expression of type other than \"Function returning ...\" used as function");
}
- if (argvec[0] == NULL)
- 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;
@@ -993,16 +969,16 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
/* It's a function call. */
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL */
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * (nargs + 2));
+ argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 2));
argvec[0] = arg1;
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:
@@ -1019,18 +995,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);
@@ -1047,7 +1023,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
lval_memory);
else
{
- value_ptr temp = arg1;
+ struct value *temp = arg1;
return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string,
NULL, "structure");
}
@@ -1058,6 +1034,31 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
+
+ /* JYG: if print object is on we need to replace the base type
+ with rtti type in order to continue on with successful
+ lookup of member / method only available in the rtti type. */
+ {
+ struct type *type = VALUE_TYPE (arg1);
+ struct type *real_type;
+ int full, top, using_enc;
+
+ if (objectprint && TYPE_TARGET_TYPE(type) &&
+ (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+ {
+ real_type = value_rtti_target_type (arg1, &full, &top, &using_enc);
+ if (real_type)
+ {
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ real_type = lookup_pointer_type (real_type);
+ else
+ real_type = lookup_reference_type (real_type);
+
+ arg1 = value_cast (real_type, arg1);
+ }
+ }
+ }
+
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (lookup_struct_elt_type (VALUE_TYPE (arg1),
&exp->elts[pc + 2].string,
@@ -1065,7 +1066,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
lval_memory);
else
{
- value_ptr temp = arg1;
+ struct value *temp = arg1;
return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string,
NULL, "structure pointer");
}
@@ -1074,12 +1075,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;
@@ -1087,23 +1088,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));
@@ -1117,11 +1118,11 @@ handle_pointer_to_member:
/* Now, convert these values to an address. */
arg1 = value_cast (lookup_pointer_type (TYPE_DOMAIN_TYPE (type)),
arg1);
- arg3 = value_from_longest (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+ arg3 = value_from_pointer (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);
@@ -1137,26 +1138,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))
@@ -1216,10 +1217,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);
@@ -1238,7 +1238,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. */
@@ -1259,7 +1259,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);
@@ -1267,7 +1267,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);
@@ -1291,9 +1291,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)
{
@@ -1307,7 +1307,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);
@@ -1320,13 +1320,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);
@@ -1338,30 +1338,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
@@ -1370,23 +1370,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
@@ -1395,7 +1395,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));
}
@@ -1406,12 +1406,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);
@@ -1422,7 +1422,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:
@@ -1432,12 +1432,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);
@@ -1448,7 +1448,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:
@@ -1535,7 +1535,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);
@@ -1552,7 +1552,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)));
@@ -1594,12 +1594,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))
@@ -1609,9 +1609,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)
@@ -1624,34 +1624,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 (expect_type, exp, pos, EVAL_SKIP);
+ 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
+ {
+ struct value *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,7 +1679,7 @@ bad_pointer_to_member:
return value_zero (exp->elts[pc + 1].type, lval_memory);
else
return value_at_lazy (exp->elts[pc + 1].type,
- value_as_pointer (arg1),
+ value_as_address (arg1),
NULL);
case UNOP_PREINCREMENT:
@@ -1692,8 +1692,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);
}
@@ -1707,8 +1707,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);
}
@@ -1722,8 +1722,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;
}
@@ -1738,12 +1738,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);
@@ -1753,20 +1753,19 @@ 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; 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);
}
@@ -1777,11 +1776,9 @@ GDB does not (yet) know how to evaluate that kind of expression");
NOSIDE may be EVAL_AVOID_SIDE_EFFECTS;
then only the type of the result need be correct. */
-static value_ptr
-evaluate_subexp_for_address (exp, pos, noside)
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+static struct value *
+evaluate_subexp_for_address (register struct expression *exp, register int *pos,
+ enum noside noside)
{
enum exp_opcode op;
register int pc;
@@ -1807,13 +1804,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
@@ -1822,20 +1819,20 @@ 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:
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- value_ptr x = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ struct value *x = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (VALUE_LVAL (x) == lval_memory)
return value_zero (lookup_pointer_type (VALUE_TYPE (x)),
not_lval);
@@ -1857,17 +1854,15 @@ 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)
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+struct value *
+evaluate_subexp_with_coercion (register struct expression *exp,
+ register int *pos, enum noside noside)
{
register enum exp_opcode op;
register int pc;
- register value_ptr val;
+ struct value *val;
struct symbol *var;
pc = (*pos);
@@ -1883,8 +1878,8 @@ evaluate_subexp_with_coercion (exp, pos, noside)
(*pos) += 4;
val =
locate_var_value
- (var, block_innermost_frame (exp->elts[pc + 1].block));
- return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (SYMBOL_TYPE (var))),
+ (var, block_innermost_frame (exp->elts[pc + 1].block));
+ return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (check_typedef (SYMBOL_TYPE (var)))),
val);
}
/* FALLTHROUGH */
@@ -1898,15 +1893,13 @@ evaluate_subexp_with_coercion (exp, pos, noside)
and return a value for the size of that subexpression.
Advance *POS over the subexpression. */
-static value_ptr
-evaluate_subexp_for_sizeof (exp, pos)
- register struct expression *exp;
- register int *pos;
+static struct value *
+evaluate_subexp_for_sizeof (register struct expression *exp, register int *pos)
{
enum exp_opcode op;
register int pc;
struct type *type;
- value_ptr val;
+ struct value *val;
pc = (*pos);
op = exp->elts[pc].opcode;
@@ -1914,9 +1907,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);
@@ -1927,7 +1920,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;
@@ -1944,46 +1937,43 @@ 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)));
}
}
/* Parse a type expression in the string [P..P+LENGTH). */
struct type *
-parse_and_eval_type (p, length)
- char *p;
- int length;
+parse_and_eval_type (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
-calc_f77_array_dims (array_type)
- struct type *array_type;
+calc_f77_array_dims (struct type *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;
}
diff --git a/contrib/gdb/gdb/event-loop.c b/contrib/gdb/gdb/event-loop.c
new file mode 100644
index 0000000..ea74419
--- /dev/null
+++ b/contrib/gdb/gdb/event-loop.c
@@ -0,0 +1,1151 @@
+/* Event loop machinery for GDB, the GNU debugger.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "event-loop.h"
+#include "event-top.h"
+
+#ifdef HAVE_POLL
+#if defined (HAVE_POLL_H)
+#include <poll.h>
+#elif defined (HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+#endif
+
+#include <sys/types.h>
+#include "gdb_string.h"
+#include <errno.h>
+#include <sys/time.h>
+
+typedef struct gdb_event gdb_event;
+typedef void (event_handler_func) (int);
+
+/* Event for the GDB event system. Events are queued by calling
+ async_queue_event and serviced later on by gdb_do_one_event. An
+ event can be, for instance, a file descriptor becoming ready to be
+ read. Servicing an event simply means that the procedure PROC will
+ be called. We have 2 queues, one for file handlers that we listen
+ to in the event loop, and one for the file handlers+events that are
+ ready. The procedure PROC associated with each event is always the
+ same (handle_file_event). Its duty is to invoke the handler
+ associated with the file descriptor whose state change generated
+ the event, plus doing other cleanups and such. */
+
+struct gdb_event
+ {
+ event_handler_func *proc; /* Procedure to call to service this event. */
+ int fd; /* File descriptor that is ready. */
+ struct gdb_event *next_event; /* Next in list of events or NULL. */
+ };
+
+/* Information about each file descriptor we register with the event
+ loop. */
+
+typedef struct file_handler
+ {
+ int fd; /* File descriptor. */
+ int mask; /* Events we want to monitor: POLLIN, etc. */
+ int ready_mask; /* Events that have been seen since
+ the last time. */
+ handler_func *proc; /* Procedure to call when fd is ready. */
+ gdb_client_data client_data; /* Argument to pass to proc. */
+ int error; /* Was an error detected on this fd? */
+ struct file_handler *next_file; /* Next registered file descriptor. */
+ }
+file_handler;
+
+/* PROC is a function to be invoked when the READY flag is set. This
+ happens when there has been a signal and the corresponding signal
+ handler has 'triggered' this async_signal_handler for
+ execution. The actual work to be done in response to a signal will
+ be carried out by PROC at a later time, within process_event. This
+ provides a deferred execution of signal handlers.
+ Async_init_signals takes care of setting up such an
+ asyn_signal_handler for each interesting signal. */
+typedef struct async_signal_handler
+ {
+ 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 */
+ sig_handler_func *proc; /* Function to call to do the work */
+ gdb_client_data client_data; /* Argument to async_handler_func */
+ }
+async_signal_handler;
+
+
+/* Event queue:
+ - the first event in the queue is the head of the queue.
+ It will be the next to be serviced.
+ - the last event in the queue
+
+ Events can be inserted at the front of the queue or at the end of
+ the queue. Events will be extracted from the queue for processing
+ starting from the head. Therefore, events inserted at the head of
+ the queue will be processed in a last in first out fashion, while
+ those inserted at the tail of the queue will be processed in a first
+ in first out manner. All the fields are NULL if the queue is
+ empty. */
+
+static struct
+ {
+ gdb_event *first_event; /* First pending event */
+ gdb_event *last_event; /* Last pending event */
+ }
+event_queue;
+
+/* Gdb_notifier is just a list of file descriptors gdb is interested in.
+ These are the input file descriptor, and the target file
+ descriptor. We have two flavors of the notifier, one for platforms
+ that have the POLL function, the other for those that don't, and
+ only support SELECT. Each of the elements in the gdb_notifier list is
+ basically a description of what kind of events gdb is interested
+ in, for each fd. */
+
+/* As of 1999-04-30 only the input file descriptor is registered with the
+ event loop. */
+
+/* Do we use poll or select ? */
+#ifdef HAVE_POLL
+#define USE_POLL 1
+#else
+#define USE_POLL 0
+#endif /* HAVE_POLL */
+
+static unsigned char use_poll = USE_POLL;
+
+static struct
+ {
+ /* Ptr to head of file handler list. */
+ file_handler *first_file_handler;
+
+#ifdef HAVE_POLL
+ /* Ptr to array of pollfd structures. */
+ struct pollfd *poll_fds;
+
+ /* Timeout in milliseconds for calls to poll(). */
+ int poll_timeout;
+#endif
+
+ /* Masks to be used in the next call to select.
+ Bits are set in response to calls to create_file_handler. */
+ fd_set check_masks[3];
+
+ /* What file descriptors were found ready by select. */
+ fd_set ready_masks[3];
+
+ /* Number of file descriptors to monitor. (for poll) */
+ /* Number of valid bits (highest fd value + 1). (for select) */
+ int num_fds;
+
+ /* Time structure for calls to select(). */
+ struct timeval select_timeout;
+
+ /* Flag to tell whether the timeout should be used. */
+ int timeout_valid;
+ }
+gdb_notifier;
+
+/* Structure associated with a timer. PROC will be executed at the
+ first occasion after WHEN. */
+struct gdb_timer
+ {
+ struct timeval when;
+ int timer_id;
+ struct gdb_timer *next;
+ timer_handler_func *proc; /* Function to call to do the work */
+ gdb_client_data client_data; /* Argument to async_handler_func */
+ }
+gdb_timer;
+
+/* List of currently active timers. It is sorted in order of
+ increasing timers. */
+static struct
+ {
+ /* Pointer to first in timer list. */
+ struct gdb_timer *first_timer;
+
+ /* Id of the last timer created. */
+ int num_timers;
+ }
+timer_list;
+
+/* All the async_signal_handlers gdb is interested in are kept onto
+ this list. */
+static struct
+ {
+ /* Pointer to first in handler list. */
+ async_signal_handler *first_handler;
+
+ /* Pointer to last in handler list. */
+ async_signal_handler *last_handler;
+ }
+sighandler_list;
+
+/* Are any of the handlers ready? Check this variable using
+ check_async_ready. This is used by process_event, to determine
+ whether or not to invoke the invoke_async_signal_handler
+ function. */
+static int async_handler_ready = 0;
+
+static void create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data);
+static void invoke_async_signal_handler (void);
+static void handle_file_event (int event_file_desc);
+static int gdb_wait_for_event (void);
+static int gdb_do_one_event (void *data);
+static int check_async_ready (void);
+static void async_queue_event (gdb_event * event_ptr, queue_position position);
+static gdb_event *create_file_event (int fd);
+static int process_event (void);
+static void handle_timer_event (int dummy);
+static void poll_timers (void);
+
+
+/* Insert an event object into the gdb event queue at
+ the specified position.
+ POSITION can be head or tail, with values TAIL, HEAD.
+ EVENT_PTR points to the event to be inserted into the queue.
+ The caller must allocate memory for the event. It is freed
+ after the event has ben handled.
+ Events in the queue will be processed head to tail, therefore,
+ events inserted at the head of the queue will be processed
+ as last in first out. Event appended at the tail of the queue
+ will be processed first in first out. */
+static void
+async_queue_event (gdb_event * event_ptr, queue_position position)
+{
+ if (position == TAIL)
+ {
+ /* The event will become the new last_event. */
+
+ event_ptr->next_event = NULL;
+ if (event_queue.first_event == NULL)
+ event_queue.first_event = event_ptr;
+ else
+ event_queue.last_event->next_event = event_ptr;
+ event_queue.last_event = event_ptr;
+ }
+ else if (position == HEAD)
+ {
+ /* The event becomes the new first_event. */
+
+ event_ptr->next_event = event_queue.first_event;
+ if (event_queue.first_event == NULL)
+ event_queue.last_event = event_ptr;
+ event_queue.first_event = event_ptr;
+ }
+}
+
+/* Create a file event, to be enqueued in the event queue for
+ processing. The procedure associated to this event is always
+ handle_file_event, which will in turn invoke the one that was
+ associated to FD when it was registered with the event loop. */
+static gdb_event *
+create_file_event (int fd)
+{
+ gdb_event *file_event_ptr;
+
+ file_event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
+ file_event_ptr->proc = handle_file_event;
+ file_event_ptr->fd = fd;
+ return (file_event_ptr);
+}
+
+/* Process one event.
+ The event can be the next one to be serviced in the event queue,
+ or an asynchronous event handler can be invoked in response to
+ the reception of a signal.
+ If an event was processed (either way), 1 is returned otherwise
+ 0 is returned.
+ Scan the queue from head to tail, processing therefore the high
+ priority events first, by invoking the associated event handler
+ procedure. */
+static int
+process_event (void)
+{
+ gdb_event *event_ptr, *prev_ptr;
+ event_handler_func *proc;
+ int fd;
+
+ /* First let's see if there are any asynchronous event handlers that
+ are ready. These would be the result of invoking any of the
+ signal handlers. */
+
+ if (check_async_ready ())
+ {
+ invoke_async_signal_handler ();
+ return 1;
+ }
+
+ /* Look in the event queue to find an event that is ready
+ to be processed. */
+
+ for (event_ptr = event_queue.first_event; event_ptr != NULL;
+ event_ptr = event_ptr->next_event)
+ {
+ /* Call the handler for the event. */
+
+ proc = event_ptr->proc;
+ fd = event_ptr->fd;
+
+ /* Let's get rid of the event from the event queue. We need to
+ do this now because while processing the event, the proc
+ function could end up calling 'error' and therefore jump out
+ to the caller of this function, gdb_do_one_event. In that
+ case, we would have on the event queue an event wich has been
+ processed, but not deleted. */
+
+ if (event_queue.first_event == event_ptr)
+ {
+ event_queue.first_event = event_ptr->next_event;
+ if (event_ptr->next_event == NULL)
+ event_queue.last_event = NULL;
+ }
+ else
+ {
+ prev_ptr = event_queue.first_event;
+ while (prev_ptr->next_event != event_ptr)
+ prev_ptr = prev_ptr->next_event;
+
+ prev_ptr->next_event = event_ptr->next_event;
+ if (event_ptr->next_event == NULL)
+ event_queue.last_event = prev_ptr;
+ }
+ xfree (event_ptr);
+
+ /* Now call the procedure associated with the event. */
+ (*proc) (fd);
+ return 1;
+ }
+
+ /* this is the case if there are no event on the event queue. */
+ return 0;
+}
+
+/* Process one high level event. If nothing is ready at this time,
+ wait for something to happen (via gdb_wait_for_event), then process
+ it. Returns >0 if something was done otherwise returns <0 (this
+ can happen if there are no event sources to wait for). If an error
+ occurs catch_errors() which calls this function returns zero. */
+
+static int
+gdb_do_one_event (void *data)
+{
+ /* Any events already waiting in the queue? */
+ if (process_event ())
+ {
+ return 1;
+ }
+
+ /* Are any timers that are ready? If so, put an event on the queue. */
+ poll_timers ();
+
+ /* Wait for a new event. If gdb_wait_for_event returns -1,
+ we should get out because this means that there are no
+ event sources left. This will make the event loop stop,
+ and the application exit. */
+
+ if (gdb_wait_for_event () < 0)
+ {
+ return -1;
+ }
+
+ /* Handle any new events occurred while waiting. */
+ if (process_event ())
+ {
+ return 1;
+ }
+
+ /* If gdb_wait_for_event has returned 1, it means that one
+ event has been handled. We break out of the loop. */
+ return 1;
+}
+
+/* Start up the event loop. This is the entry point to the event loop
+ from the command loop. */
+
+void
+start_event_loop (void)
+{
+ /* Loop until there is nothing to do. This is the entry point to the
+ event loop engine. gdb_do_one_event, called via catch_errors()
+ will process one event for each invocation. It blocks waits for
+ an event and then processes it. >0 when an event is processed, 0
+ when catch_errors() caught an error and <0 when there are no
+ longer any event sources registered. */
+ while (1)
+ {
+ int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
+ if (result < 0)
+ break;
+ if (result == 0)
+ {
+ /* FIXME: this should really be a call to a hook that is
+ interface specific, because interfaces can display the
+ prompt in their own way. */
+ display_gdb_prompt (0);
+ /* This call looks bizarre, but it is required. If the user
+ entered a command that caused an error,
+ after_char_processing_hook won't be called from
+ rl_callback_read_char_wrapper. Using a cleanup there
+ won't work, since we want this function to be called
+ after a new prompt is printed. */
+ if (after_char_processing_hook)
+ (*after_char_processing_hook) ();
+ /* Maybe better to set a flag to be checked somewhere as to
+ whether display the prompt or not. */
+ }
+ }
+
+ /* We are done with the event loop. There are no more event sources
+ to listen to. So we exit GDB. */
+ return;
+}
+
+
+/* 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
+add_file_handler (int fd, handler_func * proc, gdb_client_data client_data)
+{
+#ifdef HAVE_POLL
+ struct pollfd fds;
+#endif
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ /* Check to see if poll () is usable. If not, we'll switch to
+ use select. This can happen on systems like
+ m68k-motorola-sys, `poll' cannot be used to wait for `stdin'.
+ On m68k-motorola-sysv, tty's are not stream-based and not
+ `poll'able. */
+ fds.fd = fd;
+ fds.events = POLLIN;
+ if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL))
+ use_poll = 0;
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ create_file_handler (fd, POLLIN, proc, client_data);
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif
+ }
+ else
+ create_file_handler (fd, GDB_READABLE | GDB_EXCEPTION, proc, client_data);
+}
+
+/* Add a file handler/descriptor to the list of descriptors we are
+ interested in.
+ FD is the file descriptor for the file/stream to be listened to.
+ For the poll case, MASK is a combination (OR) of
+ POLLIN, POLLRDNORM, POLLRDBAND, POLLPRI, POLLOUT, POLLWRNORM,
+ POLLWRBAND: these are the events we are interested in. If any of them
+ occurs, proc should be called.
+ For the select case, MASK is a combination of READABLE, WRITABLE, EXCEPTION.
+ PROC is the procedure that will be called when an event occurs for
+ FD. CLIENT_DATA is the argument to pass to PROC. */
+static void
+create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data)
+{
+ file_handler *file_ptr;
+
+ /* Do we already have a file handler for this file? (We may be
+ changing its associated procedure). */
+ for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
+ file_ptr = file_ptr->next_file)
+ {
+ if (file_ptr->fd == fd)
+ break;
+ }
+
+ /* It is a new file descriptor. Add it to the list. Otherwise, just
+ change the data associated with it. */
+ if (file_ptr == NULL)
+ {
+ file_ptr = (file_handler *) xmalloc (sizeof (file_handler));
+ file_ptr->fd = fd;
+ file_ptr->ready_mask = 0;
+ file_ptr->next_file = gdb_notifier.first_file_handler;
+ gdb_notifier.first_file_handler = file_ptr;
+ }
+ file_ptr->proc = proc;
+ file_ptr->client_data = client_data;
+ file_ptr->mask = mask;
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ gdb_notifier.num_fds++;
+ if (gdb_notifier.poll_fds)
+ gdb_notifier.poll_fds =
+ (struct pollfd *) xrealloc (gdb_notifier.poll_fds,
+ (gdb_notifier.num_fds
+ * sizeof (struct pollfd)));
+ else
+ 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;
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ if (mask & GDB_READABLE)
+ FD_SET (fd, &gdb_notifier.check_masks[0]);
+ else
+ FD_CLR (fd, &gdb_notifier.check_masks[0]);
+
+ if (mask & GDB_WRITABLE)
+ FD_SET (fd, &gdb_notifier.check_masks[1]);
+ else
+ FD_CLR (fd, &gdb_notifier.check_masks[1]);
+
+ if (mask & GDB_EXCEPTION)
+ FD_SET (fd, &gdb_notifier.check_masks[2]);
+ else
+ FD_CLR (fd, &gdb_notifier.check_masks[2]);
+
+ if (gdb_notifier.num_fds <= fd)
+ gdb_notifier.num_fds = fd + 1;
+ }
+}
+
+/* Remove the file descriptor FD from the list of monitored fd's:
+ i.e. we don't care anymore about events on the FD. */
+void
+delete_file_handler (int fd)
+{
+ file_handler *file_ptr, *prev_ptr = NULL;
+ int i;
+#ifdef HAVE_POLL
+ int j;
+ struct pollfd *new_poll_fds;
+#endif
+
+ /* Find the entry for the given file. */
+
+ for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
+ file_ptr = file_ptr->next_file)
+ {
+ if (file_ptr->fd == fd)
+ break;
+ }
+
+ if (file_ptr == NULL)
+ return;
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ /* Create a new poll_fds array by copying every fd's information but the
+ one we want to get rid of. */
+
+ new_poll_fds =
+ (struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
+
+ for (i = 0, j = 0; i < gdb_notifier.num_fds; i++)
+ {
+ if ((gdb_notifier.poll_fds + i)->fd != fd)
+ {
+ (new_poll_fds + j)->fd = (gdb_notifier.poll_fds + i)->fd;
+ (new_poll_fds + j)->events = (gdb_notifier.poll_fds + i)->events;
+ (new_poll_fds + j)->revents = (gdb_notifier.poll_fds + i)->revents;
+ j++;
+ }
+ }
+ xfree (gdb_notifier.poll_fds);
+ gdb_notifier.poll_fds = new_poll_fds;
+ gdb_notifier.num_fds--;
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ if (file_ptr->mask & GDB_READABLE)
+ FD_CLR (fd, &gdb_notifier.check_masks[0]);
+ if (file_ptr->mask & GDB_WRITABLE)
+ FD_CLR (fd, &gdb_notifier.check_masks[1]);
+ if (file_ptr->mask & GDB_EXCEPTION)
+ FD_CLR (fd, &gdb_notifier.check_masks[2]);
+
+ /* Find current max fd. */
+
+ if ((fd + 1) == gdb_notifier.num_fds)
+ {
+ gdb_notifier.num_fds--;
+ for (i = gdb_notifier.num_fds; i; i--)
+ {
+ if (FD_ISSET (i - 1, &gdb_notifier.check_masks[0])
+ || FD_ISSET (i - 1, &gdb_notifier.check_masks[1])
+ || FD_ISSET (i - 1, &gdb_notifier.check_masks[2]))
+ break;
+ }
+ gdb_notifier.num_fds = i;
+ }
+ }
+
+ /* Deactivate the file descriptor, by clearing its mask,
+ so that it will not fire again. */
+
+ file_ptr->mask = 0;
+
+ /* Get rid of the file handler in the file handler list. */
+ if (file_ptr == gdb_notifier.first_file_handler)
+ gdb_notifier.first_file_handler = file_ptr->next_file;
+ else
+ {
+ for (prev_ptr = gdb_notifier.first_file_handler;
+ prev_ptr->next_file != file_ptr;
+ prev_ptr = prev_ptr->next_file)
+ ;
+ prev_ptr->next_file = file_ptr->next_file;
+ }
+ xfree (file_ptr);
+}
+
+/* Handle the given event by calling the procedure associated to the
+ corresponding file handler. Called by process_event indirectly,
+ through event_ptr->proc. EVENT_FILE_DESC is file descriptor of the
+ event in the front of the event queue. */
+static void
+handle_file_event (int event_file_desc)
+{
+ file_handler *file_ptr;
+ int mask;
+#ifdef HAVE_POLL
+ int error_mask;
+ int error_mask_returned;
+#endif
+
+ /* Search the file handler list to find one that matches the fd in
+ the event. */
+ for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
+ file_ptr = file_ptr->next_file)
+ {
+ if (file_ptr->fd == event_file_desc)
+ {
+ /* With poll, the ready_mask could have any of three events
+ set to 1: POLLHUP, POLLERR, POLLNVAL. These events cannot
+ be used in the requested event mask (events), but they
+ can be returned in the return mask (revents). We need to
+ check for those event too, and add them to the mask which
+ will be passed to the handler. */
+
+ /* See if the desired events (mask) match the received
+ events (ready_mask). */
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ error_mask = POLLHUP | POLLERR | POLLNVAL;
+ mask = (file_ptr->ready_mask & file_ptr->mask) |
+ (file_ptr->ready_mask & error_mask);
+ error_mask_returned = mask & error_mask;
+
+ if (error_mask_returned != 0)
+ {
+ /* Work in progress. We may need to tell somebody what
+ kind of error we had. */
+ if (error_mask_returned & POLLHUP)
+ printf_unfiltered ("Hangup detected on fd %d\n", file_ptr->fd);
+ if (error_mask_returned & POLLERR)
+ printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
+ if (error_mask_returned & POLLNVAL)
+ printf_unfiltered ("Invalid or non-`poll'able fd %d\n", file_ptr->fd);
+ file_ptr->error = 1;
+ }
+ else
+ file_ptr->error = 0;
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ if (file_ptr->ready_mask & GDB_EXCEPTION)
+ {
+ printf_unfiltered ("Exception condition detected on fd %d\n", file_ptr->fd);
+ file_ptr->error = 1;
+ }
+ else
+ file_ptr->error = 0;
+ mask = file_ptr->ready_mask & file_ptr->mask;
+ }
+
+ /* Clear the received events for next time around. */
+ file_ptr->ready_mask = 0;
+
+ /* If there was a match, then call the handler. */
+ if (mask != 0)
+ (*file_ptr->proc) (file_ptr->error, file_ptr->client_data);
+ break;
+ }
+ }
+}
+
+/* Called by gdb_do_one_event to wait for new events on the
+ monitored file descriptors. Queue file events as they are
+ detected by the poll.
+ If there are no events, this function will block in the
+ call to poll.
+ Return -1 if there are no files descriptors to monitor,
+ otherwise return 0. */
+static int
+gdb_wait_for_event (void)
+{
+ file_handler *file_ptr;
+ gdb_event *file_event_ptr;
+ int num_found = 0;
+ int i;
+
+ /* Make sure all output is done before getting another event. */
+ gdb_flush (gdb_stdout);
+ gdb_flush (gdb_stderr);
+
+ if (gdb_notifier.num_fds == 0)
+ return -1;
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ num_found =
+ poll (gdb_notifier.poll_fds,
+ (unsigned long) gdb_notifier.num_fds,
+ gdb_notifier.timeout_valid ? gdb_notifier.poll_timeout : -1);
+
+ /* Don't print anything if we get out of poll because of a
+ signal. */
+ if (num_found == -1 && errno != EINTR)
+ perror_with_name ("Poll");
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0];
+ gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1];
+ gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2];
+ num_found = select (gdb_notifier.num_fds,
+ &gdb_notifier.ready_masks[0],
+ &gdb_notifier.ready_masks[1],
+ &gdb_notifier.ready_masks[2],
+ gdb_notifier.timeout_valid
+ ? &gdb_notifier.select_timeout : NULL);
+
+ /* Clear the masks after an error from select. */
+ if (num_found == -1)
+ {
+ FD_ZERO (&gdb_notifier.ready_masks[0]);
+ FD_ZERO (&gdb_notifier.ready_masks[1]);
+ FD_ZERO (&gdb_notifier.ready_masks[2]);
+ /* Dont print anything is we got a signal, let gdb handle it. */
+ if (errno != EINTR)
+ perror_with_name ("Select");
+ }
+ }
+
+ /* Enqueue all detected file events. */
+
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ for (i = 0; (i < gdb_notifier.num_fds) && (num_found > 0); i++)
+ {
+ if ((gdb_notifier.poll_fds + i)->revents)
+ num_found--;
+ else
+ continue;
+
+ for (file_ptr = gdb_notifier.first_file_handler;
+ file_ptr != NULL;
+ file_ptr = file_ptr->next_file)
+ {
+ if (file_ptr->fd == (gdb_notifier.poll_fds + i)->fd)
+ break;
+ }
+
+ if (file_ptr)
+ {
+ /* Enqueue an event only if this is still a new event for
+ this fd. */
+ if (file_ptr->ready_mask == 0)
+ {
+ file_event_ptr = create_file_event (file_ptr->fd);
+ async_queue_event (file_event_ptr, TAIL);
+ }
+ }
+
+ file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents;
+ }
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ for (file_ptr = gdb_notifier.first_file_handler;
+ (file_ptr != NULL) && (num_found > 0);
+ file_ptr = file_ptr->next_file)
+ {
+ int mask = 0;
+
+ if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[0]))
+ mask |= GDB_READABLE;
+ if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[1]))
+ mask |= GDB_WRITABLE;
+ if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[2]))
+ mask |= GDB_EXCEPTION;
+
+ if (!mask)
+ continue;
+ else
+ num_found--;
+
+ /* Enqueue an event only if this is still a new event for
+ this fd. */
+
+ if (file_ptr->ready_mask == 0)
+ {
+ file_event_ptr = create_file_event (file_ptr->fd);
+ async_queue_event (file_event_ptr, TAIL);
+ }
+ file_ptr->ready_mask = mask;
+ }
+ }
+ return 0;
+}
+
+
+/* Create an asynchronous handler, allocating memory for it.
+ Return a pointer to the newly created handler.
+ This pointer will be used to invoke the handler by
+ invoke_async_signal_handler.
+ PROC is the function to call with CLIENT_DATA argument
+ whenever the handler is invoked. */
+async_signal_handler *
+create_async_signal_handler (sig_handler_func * proc, gdb_client_data client_data)
+{
+ async_signal_handler *async_handler_ptr;
+
+ async_handler_ptr =
+ (async_signal_handler *) xmalloc (sizeof (async_signal_handler));
+ async_handler_ptr->ready = 0;
+ async_handler_ptr->next_handler = NULL;
+ async_handler_ptr->proc = proc;
+ async_handler_ptr->client_data = client_data;
+ if (sighandler_list.first_handler == NULL)
+ sighandler_list.first_handler = async_handler_ptr;
+ else
+ sighandler_list.last_handler->next_handler = async_handler_ptr;
+ sighandler_list.last_handler = async_handler_ptr;
+ return async_handler_ptr;
+}
+
+/* Mark the handler (ASYNC_HANDLER_PTR) as ready. This information will
+ be used when the handlers are invoked, after we have waited for
+ some event. The caller of this function is the interrupt handler
+ associated with a signal. */
+void
+mark_async_signal_handler (async_signal_handler * async_handler_ptr)
+{
+ ((async_signal_handler *) async_handler_ptr)->ready = 1;
+ async_handler_ready = 1;
+}
+
+/* Call all the handlers that are ready. */
+static void
+invoke_async_signal_handler (void)
+{
+ async_signal_handler *async_handler_ptr;
+
+ if (async_handler_ready == 0)
+ return;
+ async_handler_ready = 0;
+
+ /* Invoke ready handlers. */
+
+ while (1)
+ {
+ for (async_handler_ptr = sighandler_list.first_handler;
+ async_handler_ptr != NULL;
+ async_handler_ptr = async_handler_ptr->next_handler)
+ {
+ if (async_handler_ptr->ready)
+ break;
+ }
+ if (async_handler_ptr == NULL)
+ break;
+ async_handler_ptr->ready = 0;
+ (*async_handler_ptr->proc) (async_handler_ptr->client_data);
+ }
+
+ return;
+}
+
+/* Delete an asynchronous handler (ASYNC_HANDLER_PTR).
+ Free the space allocated for it. */
+void
+delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
+{
+ async_signal_handler *prev_ptr;
+
+ if (sighandler_list.first_handler == (*async_handler_ptr))
+ {
+ sighandler_list.first_handler = (*async_handler_ptr)->next_handler;
+ if (sighandler_list.first_handler == NULL)
+ sighandler_list.last_handler = NULL;
+ }
+ else
+ {
+ prev_ptr = sighandler_list.first_handler;
+ while (prev_ptr->next_handler != (*async_handler_ptr) && prev_ptr)
+ prev_ptr = prev_ptr->next_handler;
+ prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
+ if (sighandler_list.last_handler == (*async_handler_ptr))
+ sighandler_list.last_handler = prev_ptr;
+ }
+ xfree ((*async_handler_ptr));
+ (*async_handler_ptr) = NULL;
+}
+
+/* Is it necessary to call invoke_async_signal_handler? */
+static int
+check_async_ready (void)
+{
+ return async_handler_ready;
+}
+
+/* Create a timer that will expire in MILLISECONDS from now. When the
+ timer is ready, PROC will be executed. At creation, the timer is
+ aded to the timers queue. This queue is kept sorted in order of
+ increasing timers. Return a handle to the timer struct. */
+int
+create_timer (int milliseconds, timer_handler_func * proc, gdb_client_data client_data)
+{
+ struct gdb_timer *timer_ptr, *timer_index, *prev_timer;
+ struct timeval time_now, delta;
+
+ /* compute seconds */
+ delta.tv_sec = milliseconds / 1000;
+ /* compute microseconds */
+ delta.tv_usec = (milliseconds % 1000) * 1000;
+
+ gettimeofday (&time_now, NULL);
+
+ timer_ptr = (struct gdb_timer *) xmalloc (sizeof (gdb_timer));
+ timer_ptr->when.tv_sec = time_now.tv_sec + delta.tv_sec;
+ timer_ptr->when.tv_usec = time_now.tv_usec + delta.tv_usec;
+ /* carry? */
+ if (timer_ptr->when.tv_usec >= 1000000)
+ {
+ timer_ptr->when.tv_sec += 1;
+ timer_ptr->when.tv_usec -= 1000000;
+ }
+ timer_ptr->proc = proc;
+ timer_ptr->client_data = client_data;
+ timer_list.num_timers++;
+ timer_ptr->timer_id = timer_list.num_timers;
+
+ /* Now add the timer to the timer queue, making sure it is sorted in
+ increasing order of expiration. */
+
+ for (timer_index = timer_list.first_timer;
+ timer_index != NULL;
+ timer_index = timer_index->next)
+ {
+ /* If the seconds field is greater or if it is the same, but the
+ microsecond field is greater. */
+ if ((timer_index->when.tv_sec > timer_ptr->when.tv_sec) ||
+ ((timer_index->when.tv_sec == timer_ptr->when.tv_sec)
+ && (timer_index->when.tv_usec > timer_ptr->when.tv_usec)))
+ break;
+ }
+
+ if (timer_index == timer_list.first_timer)
+ {
+ timer_ptr->next = timer_list.first_timer;
+ timer_list.first_timer = timer_ptr;
+
+ }
+ else
+ {
+ for (prev_timer = timer_list.first_timer;
+ prev_timer->next != timer_index;
+ prev_timer = prev_timer->next)
+ ;
+
+ prev_timer->next = timer_ptr;
+ timer_ptr->next = timer_index;
+ }
+
+ gdb_notifier.timeout_valid = 0;
+ return timer_ptr->timer_id;
+}
+
+/* There is a chance that the creator of the timer wants to get rid of
+ it before it expires. */
+void
+delete_timer (int id)
+{
+ struct gdb_timer *timer_ptr, *prev_timer = NULL;
+
+ /* Find the entry for the given timer. */
+
+ for (timer_ptr = timer_list.first_timer; timer_ptr != NULL;
+ timer_ptr = timer_ptr->next)
+ {
+ if (timer_ptr->timer_id == id)
+ break;
+ }
+
+ if (timer_ptr == NULL)
+ return;
+ /* Get rid of the timer in the timer list. */
+ if (timer_ptr == timer_list.first_timer)
+ timer_list.first_timer = timer_ptr->next;
+ else
+ {
+ for (prev_timer = timer_list.first_timer;
+ prev_timer->next != timer_ptr;
+ prev_timer = prev_timer->next)
+ ;
+ prev_timer->next = timer_ptr->next;
+ }
+ xfree (timer_ptr);
+
+ gdb_notifier.timeout_valid = 0;
+}
+
+/* When a timer event is put on the event queue, it will be handled by
+ this function. Just call the assiciated procedure and delete the
+ timer event from the event queue. Repeat this for each timer that
+ has expired. */
+static void
+handle_timer_event (int dummy)
+{
+ struct timeval time_now;
+ struct gdb_timer *timer_ptr, *saved_timer;
+
+ gettimeofday (&time_now, NULL);
+ timer_ptr = timer_list.first_timer;
+
+ while (timer_ptr != NULL)
+ {
+ if ((timer_ptr->when.tv_sec > time_now.tv_sec) ||
+ ((timer_ptr->when.tv_sec == time_now.tv_sec) &&
+ (timer_ptr->when.tv_usec > time_now.tv_usec)))
+ break;
+
+ /* Get rid of the timer from the beginning of the list. */
+ timer_list.first_timer = timer_ptr->next;
+ saved_timer = timer_ptr;
+ timer_ptr = timer_ptr->next;
+ /* Call the procedure associated with that timer. */
+ (*saved_timer->proc) (saved_timer->client_data);
+ xfree (saved_timer);
+ }
+
+ gdb_notifier.timeout_valid = 0;
+}
+
+/* Check whether any timers in the timers queue are ready. If at least
+ one timer is ready, stick an event onto the event queue. Even in
+ case more than one timer is ready, one event is enough, because the
+ handle_timer_event() will go through the timers list and call the
+ procedures associated with all that have expired. Update the
+ timeout for the select() or poll() as well. */
+static void
+poll_timers (void)
+{
+ struct timeval time_now, delta;
+ gdb_event *event_ptr;
+
+ if (timer_list.first_timer != NULL)
+ {
+ gettimeofday (&time_now, NULL);
+ delta.tv_sec = timer_list.first_timer->when.tv_sec - time_now.tv_sec;
+ delta.tv_usec = timer_list.first_timer->when.tv_usec - time_now.tv_usec;
+ /* borrow? */
+ if (delta.tv_usec < 0)
+ {
+ delta.tv_sec -= 1;
+ delta.tv_usec += 1000000;
+ }
+
+ /* Oops it expired already. Tell select / poll to return
+ immediately. (Cannot simply test if delta.tv_sec is negative
+ because time_t might be unsigned.) */
+ if (timer_list.first_timer->when.tv_sec < time_now.tv_sec
+ || (timer_list.first_timer->when.tv_sec == time_now.tv_sec
+ && timer_list.first_timer->when.tv_usec < time_now.tv_usec))
+ {
+ delta.tv_sec = 0;
+ delta.tv_usec = 0;
+ }
+
+ if (delta.tv_sec == 0 && delta.tv_usec == 0)
+ {
+ event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
+ event_ptr->proc = handle_timer_event;
+ event_ptr->fd = timer_list.first_timer->timer_id;
+ async_queue_event (event_ptr, TAIL);
+ }
+
+ /* Now we need to update the timeout for select/ poll, because we
+ don't want to sit there while this timer is expiring. */
+ if (use_poll)
+ {
+#ifdef HAVE_POLL
+ gdb_notifier.poll_timeout = delta.tv_sec * 1000;
+#else
+ internal_error (__FILE__, __LINE__,
+ "use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+ }
+ else
+ {
+ gdb_notifier.select_timeout.tv_sec = delta.tv_sec;
+ gdb_notifier.select_timeout.tv_usec = delta.tv_usec;
+ }
+ gdb_notifier.timeout_valid = 1;
+ }
+ else
+ gdb_notifier.timeout_valid = 0;
+}
diff --git a/contrib/gdb/gdb/event-loop.h b/contrib/gdb/gdb/event-loop.h
new file mode 100644
index 0000000..2f2ff00
--- /dev/null
+++ b/contrib/gdb/gdb/event-loop.h
@@ -0,0 +1,95 @@
+/* Definitions used by the GDB event loop.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ 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
+ appropriate event handler. The event loop then continues to listen
+ for more events. An event loop completes when there are no event
+ sources to listen on. External event sources can be plugged into
+ the loop.
+
+ There are 3 main components:
+ - a list of file descriptors to be monitored, GDB_NOTIFIER.
+ - a list of events that have occurred, EVENT_QUEUE.
+ - a list of signal handling functions, SIGHANDLER_LIST.
+
+ GDB_NOTIFIER keeps track of the event sources. Event sources for
+ gdb are currently the UI and the target. Gdb communicates with the
+ command line user interface via the readline library and usually
+ communicates with remote targets via a serial port. Serial ports
+ are represented in GDB as file descriptors and select/poll calls.
+ For native targets instead, the communication consists of calls to
+ ptrace and waits (via signals) or calls to poll/select (via file
+ descriptors). In the current gdb, the code handling events related
+ to the target resides in the wait_for_inferior function and in
+ various target specific files (*-tdep.c).
+
+ EVENT_QUEUE keeps track of the events that have happened during the
+ last iteration of the event loop, and need to be processed. An
+ event is represented by a procedure to be invoked in order to
+ process the event. The queue is scanned head to tail. If the
+ event of interest is a change of state in a file descriptor, then a
+ call to poll or select will be made to detect it.
+
+ If the events generate signals, they are also queued by special
+ functions that are invoked through traditional signal handlers.
+ The actions to be taken is response to such events will be executed
+ when the SIGHANDLER_LIST is scanned, the next time through the
+ infinite loop.
+
+ Corollary tasks are the creation and deletion of event sources. */
+
+typedef void *gdb_client_data;
+struct async_signal_handler;
+typedef void (handler_func) (int, gdb_client_data);
+typedef void (sig_handler_func) (gdb_client_data);
+typedef void (timer_handler_func) (gdb_client_data);
+
+/* Where to add an event onto the event queue, by queue_event. */
+typedef enum
+ {
+ /* Add at tail of queue. It will be processed in first in first
+ out order. */
+ TAIL,
+ /* Add at head of queue. It will be processed in last in first out
+ order. */
+ HEAD
+ }
+queue_position;
+
+/* Tell create_file_handler what events we are interested in.
+ This is used by the select version of the event loop. */
+
+#define GDB_READABLE (1<<1)
+#define GDB_WRITABLE (1<<2)
+#define GDB_EXCEPTION (1<<3)
+
+/* Exported functions from event-loop.c */
+
+extern void start_event_loop (void);
+extern void delete_file_handler (int fd);
+extern void add_file_handler (int fd, handler_func * proc, gdb_client_data client_data);
+extern void mark_async_signal_handler (struct async_signal_handler *async_handler_ptr);
+extern struct async_signal_handler *
+ create_async_signal_handler (sig_handler_func * proc, gdb_client_data client_data);
+extern void delete_async_signal_handler (struct async_signal_handler **async_handler_ptr);
+extern int create_timer (int milliseconds, timer_handler_func * proc, gdb_client_data client_data);
+extern void delete_timer (int id);
diff --git a/contrib/gdb/gdb/event-top.c b/contrib/gdb/gdb/event-top.c
new file mode 100644
index 0000000..91ffc85
--- /dev/null
+++ b/contrib/gdb/gdb/event-top.c
@@ -0,0 +1,1171 @@
+/* Top level stuff for GDB, the GNU debugger.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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"
+#include "inferior.h"
+#include "target.h"
+#include "terminal.h" /* for job_control */
+#include "event-loop.h"
+#include "event-top.h"
+#include <signal.h>
+
+/* For dont_repeat() */
+#include "gdbcmd.h"
+
+/* readline include files */
+#include <readline/readline.h>
+#include <readline/history.h>
+
+/* readline defines this. */
+#undef savestring
+
+extern void _initialize_event_loop (void);
+
+static void rl_callback_read_char_wrapper (gdb_client_data client_data);
+static void command_line_handler (char *rl);
+static void command_line_handler_continuation (struct continuation_arg *arg);
+static void change_line_handler (void);
+static void change_annotation_level (void);
+static void command_handler (char *command);
+void cli_command_loop (void);
+static void async_do_nothing (gdb_client_data arg);
+static void async_disconnect (gdb_client_data arg);
+static void async_stop_sig (gdb_client_data arg);
+static void async_float_handler (gdb_client_data arg);
+
+/* Signal handlers. */
+static void handle_sigquit (int sig);
+static void handle_sighup (int sig);
+static void handle_sigfpe (int sig);
+#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
+static void handle_sigwinch (int sig);
+#endif
+
+/* Functions to be invoked by the event loop in response to
+ signals. */
+static void async_do_nothing (gdb_client_data);
+static void async_disconnect (gdb_client_data);
+static void async_float_handler (gdb_client_data);
+static void async_stop_sig (gdb_client_data);
+
+/* Readline offers an alternate interface, via callback
+ functions. These are all included in the file callback.c in the
+ readline distribution. This file provides (mainly) a function, which
+ the event loop uses as callback (i.e. event handler) whenever an event
+ is detected on the standard input file descriptor.
+ readline_callback_read_char is called (by the GDB event loop) whenever
+ there is a new character ready on the input stream. This function
+ incrementally builds a buffer internal to readline where it
+ accumulates the line read up to the point of invocation. In the
+ special case in which the character read is newline, the function
+ invokes a GDB supplied callback routine, which does the processing of
+ a full command line. This latter routine is the asynchronous analog
+ of the old command_line_input in gdb. Instead of invoking (and waiting
+ for) readline to read the command line and pass it back to
+ command_loop for processing, the new command_line_handler function has
+ the command line already available as its parameter. INPUT_HANDLER is
+ to be set to the function that readline will invoke when a complete
+ line of input is ready. CALL_READLINE is to be set to the function
+ that readline offers as callback to the event_loop. */
+
+void (*input_handler) (char *);
+void (*call_readline) (gdb_client_data);
+
+/* Important variables for the event loop. */
+
+/* This is used to determine if GDB is using the readline library or
+ its own simplified form of readline. It is used by the asynchronous
+ form of the set editing command.
+ ezannoni: as of 1999-04-29 I expect that this
+ variable will not be used after gdb is changed to use the event
+ loop as default engine, and event-top.c is merged into top.c. */
+int async_command_editing_p;
+
+/* This variable contains the new prompt that the user sets with the
+ set prompt command. */
+char *new_async_prompt;
+
+/* This is the annotation suffix that will be used when the
+ annotation_level is 2. */
+char *async_annotation_suffix;
+
+/* This is used to display the notification of the completion of an
+ asynchronous execution command. */
+int exec_done_display_p = 0;
+
+/* This is the file descriptor for the input stream that GDB uses to
+ read commands from. */
+int input_fd;
+
+/* This is the prompt stack. Prompts will be pushed on the stack as
+ needed by the different 'kinds' of user inputs GDB is asking
+ for. See event-loop.h. */
+struct prompts the_prompts;
+
+/* signal handling variables */
+/* Each of these is a pointer to a function that the event loop will
+ invoke if the corresponding signal has received. The real signal
+ handlers mark these functions as ready to be executed and the event
+ loop, in a later iteration, calls them. See the function
+ invoke_async_signal_handler. */
+void *sigint_token;
+#ifdef SIGHUP
+void *sighup_token;
+#endif
+void *sigquit_token;
+void *sigfpe_token;
+#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
+void *sigwinch_token;
+#endif
+#ifdef STOP_SIGNAL
+void *sigtstp_token;
+#endif
+
+/* Structure to save a partially entered command. This is used when
+ the user types '\' at the end of a command line. This is necessary
+ because each line of input is handled by a different call to
+ command_line_handler, and normally there is no state retained
+ between different calls. */
+int more_to_come = 0;
+
+struct readline_input_state
+ {
+ char *linebuffer;
+ char *linebuffer_ptr;
+ }
+readline_input_state;
+
+/* This hook is called by rl_callback_read_char_wrapper after each
+ character is processed. */
+void (*after_char_processing_hook) ();
+
+
+/* Wrapper function for calling into the readline library. The event
+ loop expects the callback function to have a paramter, while readline
+ expects none. */
+static void
+rl_callback_read_char_wrapper (gdb_client_data client_data)
+{
+ rl_callback_read_char ();
+ if (after_char_processing_hook)
+ (*after_char_processing_hook) ();
+}
+
+/* Initialize all the necessary variables, start the event loop,
+ register readline, and stdin, start the loop. */
+void
+cli_command_loop (void)
+{
+ int length;
+ char *a_prompt;
+ char *gdb_prompt = get_prompt ();
+
+ /* If we are using readline, set things up and display the first
+ prompt, otherwise just print the prompt. */
+ 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. */
+ length = strlen (PREFIX (0)) + strlen (gdb_prompt) + strlen (SUFFIX (0)) + 1;
+ a_prompt = (char *) xmalloc (length);
+ strcpy (a_prompt, PREFIX (0));
+ strcat (a_prompt, gdb_prompt);
+ strcat (a_prompt, SUFFIX (0));
+ rl_callback_handler_install (a_prompt, input_handler);
+ }
+ else
+ display_gdb_prompt (0);
+
+ /* Now it's time to start the event loop. */
+ start_event_loop ();
+}
+
+/* Change the function to be invoked every time there is a character
+ ready on stdin. This is used when the user sets the editing off,
+ therefore bypassing readline, and letting gdb handle the input
+ itself, via gdb_readline2. Also it is used in the opposite case in
+ which the user sets editing on again, by restoring readline
+ handling of the input. */
+static void
+change_line_handler (void)
+{
+ /* NOTE: this operates on input_fd, not instream. If we are reading
+ commands from a file, instream will point to the file. However in
+ async mode, we always read commands from a file with editing
+ off. This means that the 'set editing on/off' will have effect
+ only on the interactive session. */
+
+ if (async_command_editing_p)
+ {
+ /* Turn on editing by using readline. */
+ call_readline = rl_callback_read_char_wrapper;
+ input_handler = command_line_handler;
+ }
+ else
+ {
+ /* Turn off editing by using gdb_readline2. */
+ rl_callback_handler_remove ();
+ call_readline = gdb_readline2;
+
+ /* Set up the command handler as well, in case we are called as
+ first thing from .gdbinit. */
+ input_handler = command_line_handler;
+ }
+}
+
+/* Displays the prompt. The prompt that is displayed is the current
+ top of the prompt stack, if the argument NEW_PROMPT is
+ 0. Otherwise, it displays whatever NEW_PROMPT is. This is used
+ after each gdb command has completed, and in the following cases:
+ 1. when the user enters a command line which is ended by '\'
+ indicating that the command will continue on the next line.
+ In that case the prompt that is displayed is the empty string.
+ 2. When the user is entering 'commands' for a breakpoint, or
+ actions for a tracepoint. In this case the prompt will be '>'
+ 3. Other????
+ FIXME: 2. & 3. not implemented yet for async. */
+void
+display_gdb_prompt (char *new_prompt)
+{
+ int prompt_length = 0;
+ char *gdb_prompt = get_prompt ();
+
+ /* When an alternative interpreter has been installed, do not
+ display the comand prompt. */
+ if (interpreter_p)
+ return;
+
+ if (target_executing && sync_execution)
+ {
+ /* This is to trick readline into not trying to display the
+ prompt. Even though we display the prompt using this
+ function, readline still tries to do its own display if we
+ don't call rl_callback_handler_install and
+ rl_callback_handler_remove (which readline detects because a
+ global variable is not set). If readline did that, it could
+ mess up gdb signal handlers for SIGINT. Readline assumes
+ that between calls to rl_set_signals and rl_clear_signals gdb
+ doesn't do anything with the signal handlers. Well, that's
+ not the case, because when the target executes we change the
+ SIGINT signal handler. If we allowed readline to display the
+ prompt, the signal handler change would happen exactly
+ between the calls to the above two functions.
+ Calling rl_callback_handler_remove(), does the job. */
+
+ rl_callback_handler_remove ();
+ return;
+ }
+
+ if (!new_prompt)
+ {
+ /* Just use the top of the prompt stack. */
+ prompt_length = strlen (PREFIX (0)) +
+ strlen (SUFFIX (0)) +
+ strlen (gdb_prompt) + 1;
+
+ new_prompt = (char *) alloca (prompt_length);
+
+ /* Prefix needs to have new line at end. */
+ strcpy (new_prompt, PREFIX (0));
+ strcat (new_prompt, gdb_prompt);
+ /* Suffix needs to have a new line at end and \032 \032 at
+ beginning. */
+ strcat (new_prompt, SUFFIX (0));
+ }
+
+ if (async_command_editing_p)
+ {
+ rl_callback_handler_remove ();
+ rl_callback_handler_install (new_prompt, input_handler);
+ }
+ /* new_prompt at this point can be the top of the stack or the one passed in */
+ else if (new_prompt)
+ {
+ /* 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. */
+ fputs_unfiltered (new_prompt, gdb_stdout);
+ gdb_flush (gdb_stdout);
+ }
+}
+
+/* Used when the user requests a different annotation level, with
+ 'set annotate'. It pushes a new prompt (with prefix and suffix) on top
+ of the prompt stack, if the annotation level desired is 2, otherwise
+ it pops the top of the prompt stack when we want the annotation level
+ to be the normal ones (1 or 0). */
+static void
+change_annotation_level (void)
+{
+ char *prefix, *suffix;
+
+ if (!PREFIX (0) || !PROMPT (0) || !SUFFIX (0))
+ {
+ /* The prompt stack has not been initialized to "", we are
+ using gdb w/o the --async switch */
+ warning ("Command has same effect as set annotate");
+ return;
+ }
+
+ if (annotation_level > 1)
+ {
+ if (!strcmp (PREFIX (0), "") && !strcmp (SUFFIX (0), ""))
+ {
+ /* Push a new prompt if the previous annotation_level was not >1. */
+ prefix = (char *) alloca (strlen (async_annotation_suffix) + 10);
+ strcpy (prefix, "\n\032\032pre-");
+ strcat (prefix, async_annotation_suffix);
+ strcat (prefix, "\n");
+
+ suffix = (char *) alloca (strlen (async_annotation_suffix) + 6);
+ strcpy (suffix, "\n\032\032");
+ strcat (suffix, async_annotation_suffix);
+ strcat (suffix, "\n");
+
+ push_prompt (prefix, (char *) 0, suffix);
+ }
+ }
+ else
+ {
+ if (strcmp (PREFIX (0), "") && strcmp (SUFFIX (0), ""))
+ {
+ /* Pop the top of the stack, we are going back to annotation < 1. */
+ pop_prompt ();
+ }
+ }
+}
+
+/* Pushes a new prompt on the prompt stack. Each prompt has three
+ parts: prefix, prompt, suffix. Usually prefix and suffix are empty
+ strings, except when the annotation level is 2. Memory is allocated
+ within savestring for the new prompt. */
+void
+push_prompt (char *prefix, char *prompt, char *suffix)
+{
+ the_prompts.top++;
+ PREFIX (0) = savestring (prefix, strlen (prefix));
+
+ /* Note that this function is used by the set annotate 2
+ command. This is why we take care of saving the old prompt
+ in case a new one is not specified. */
+ if (prompt)
+ PROMPT (0) = savestring (prompt, strlen (prompt));
+ else
+ PROMPT (0) = savestring (PROMPT (-1), strlen (PROMPT (-1)));
+
+ SUFFIX (0) = savestring (suffix, strlen (suffix));
+}
+
+/* Pops the top of the prompt stack, and frees the memory allocated for it. */
+void
+pop_prompt (void)
+{
+ /* If we are not during a 'synchronous' execution command, in which
+ case, the top prompt would be empty. */
+ if (strcmp (PROMPT (0), ""))
+ /* This is for the case in which the prompt is set while the
+ annotation level is 2. The top prompt will be changed, but when
+ we return to annotation level < 2, we want that new prompt to be
+ in effect, until the user does another 'set prompt'. */
+ if (strcmp (PROMPT (0), PROMPT (-1)))
+ {
+ xfree (PROMPT (-1));
+ PROMPT (-1) = savestring (PROMPT (0), strlen (PROMPT (0)));
+ }
+
+ xfree (PREFIX (0));
+ xfree (PROMPT (0));
+ xfree (SUFFIX (0));
+ the_prompts.top--;
+}
+
+/* When there is an event ready on the stdin file desriptor, instead
+ of calling readline directly throught the callback function, or
+ instead of calling gdb_readline2, give gdb a chance to detect
+ errors and do something. */
+void
+stdin_event_handler (int error, gdb_client_data client_data)
+{
+ if (error)
+ {
+ printf_unfiltered ("error detected on stdin\n");
+ delete_file_handler (input_fd);
+ discard_all_continuations ();
+ /* If stdin died, we may as well kill gdb. */
+ quit_command ((char *) 0, stdin == instream);
+ }
+ else
+ (*call_readline) (client_data);
+}
+
+/* Re-enable stdin after the end of an execution command in
+ synchronous mode, or after an error from the target, and we aborted
+ the exec operation. */
+
+void
+async_enable_stdin (void *dummy)
+{
+ /* See NOTE in async_disable_stdin() */
+ /* FIXME: cagney/1999-09-27: Call this before clearing
+ sync_execution. Current target_terminal_ours() implementations
+ check for sync_execution before switching the terminal. */
+ target_terminal_ours ();
+ pop_prompt ();
+ sync_execution = 0;
+}
+
+/* Disable reads from stdin (the console) marking the command as
+ synchronous. */
+
+void
+async_disable_stdin (void)
+{
+ sync_execution = 1;
+ push_prompt ("", "", "");
+ /* FIXME: cagney/1999-09-27: At present this call is technically
+ redundant since infcmd.c and infrun.c both already call
+ target_terminal_inferior(). As the terminal handling (in
+ sync/async mode) is refined, the duplicate calls can be
+ eliminated (Here or in infcmd.c/infrun.c). */
+ target_terminal_inferior ();
+ /* Add the reinstate of stdin to the list of cleanups to be done
+ in case the target errors out and dies. These cleanups are also
+ done in case of normal successful termination of the execution
+ command, by complete_execution(). */
+ make_exec_error_cleanup (async_enable_stdin, NULL);
+}
+
+
+/* Handles a gdb command. This function is called by
+ command_line_handler, which has processed one or more input lines
+ into COMMAND. */
+/* NOTE: 1999-04-30 This is the asynchronous version of the command_loop
+ function. The command_loop function will be obsolete when we
+ switch to use the event loop at every execution of gdb. */
+static void
+command_handler (char *command)
+{
+ struct cleanup *old_chain;
+ int stdin_is_tty = ISATTY (stdin);
+ struct continuation_arg *arg1;
+ struct continuation_arg *arg2;
+ long time_at_cmd_start;
+#ifdef HAVE_SBRK
+ long space_at_cmd_start = 0;
+#endif
+ extern int display_time;
+ extern int display_space;
+
+ quit_flag = 0;
+ if (instream == stdin && stdin_is_tty)
+ reinitialize_more_filter ();
+ old_chain = make_cleanup (null_cleanup, 0);
+
+ /* If readline returned a NULL command, it means that the
+ connection with the terminal is gone. This happens at the
+ end of a testsuite run, after Expect has hung up
+ but GDB is still alive. In such a case, we just quit gdb
+ killing the inferior program too. */
+ if (command == 0)
+ quit_command ((char *) 0, stdin == instream);
+
+ time_at_cmd_start = get_run_time ();
+
+ if (display_space)
+ {
+#ifdef HAVE_SBRK
+ extern char **environ;
+ char *lim = (char *) sbrk (0);
+
+ space_at_cmd_start = (long) (lim - (char *) &environ);
+#endif
+ }
+
+ execute_command (command, instream == stdin);
+
+ /* Set things up for this function to be compete later, once the
+ execution has completed, if we are doing an execution command,
+ otherwise, just go ahead and finish. */
+ if (target_can_async_p () && target_executing)
+ {
+ arg1 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg2 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg1->next = arg2;
+ arg2->next = NULL;
+ arg1->data.longint = time_at_cmd_start;
+#ifdef HAVE_SBRK
+ arg2->data.longint = space_at_cmd_start;
+#endif
+ add_continuation (command_line_handler_continuation, arg1);
+ }
+
+ /* Do any commands attached to breakpoint we stopped at. Only if we
+ are always running synchronously. Or if we have just executed a
+ command that doesn't start the target. */
+ if (!target_can_async_p () || !target_executing)
+ {
+ bpstat_do_actions (&stop_bpstat);
+ do_cleanups (old_chain);
+
+ if (display_time)
+ {
+ long cmd_time = get_run_time () - time_at_cmd_start;
+
+ printf_unfiltered ("Command execution time: %ld.%06ld\n",
+ cmd_time / 1000000, cmd_time % 1000000);
+ }
+
+ if (display_space)
+ {
+#ifdef HAVE_SBRK
+ extern char **environ;
+ char *lim = (char *) sbrk (0);
+ long space_now = lim - (char *) &environ;
+ long space_diff = space_now - space_at_cmd_start;
+
+ printf_unfiltered ("Space used: %ld (%c%ld for this command)\n",
+ space_now,
+ (space_diff >= 0 ? '+' : '-'),
+ space_diff);
+#endif
+ }
+ }
+}
+
+/* Do any commands attached to breakpoint we stopped at. Only if we
+ are always running synchronously. Or if we have just executed a
+ command that doesn't start the target. */
+void
+command_line_handler_continuation (struct continuation_arg *arg)
+{
+ extern int display_time;
+ extern int display_space;
+
+ long time_at_cmd_start = arg->data.longint;
+ long space_at_cmd_start = arg->next->data.longint;
+
+ bpstat_do_actions (&stop_bpstat);
+ /*do_cleanups (old_chain); *//*?????FIXME????? */
+
+ if (display_time)
+ {
+ long cmd_time = get_run_time () - time_at_cmd_start;
+
+ printf_unfiltered ("Command execution time: %ld.%06ld\n",
+ cmd_time / 1000000, cmd_time % 1000000);
+ }
+ if (display_space)
+ {
+#ifdef HAVE_SBRK
+ extern char **environ;
+ char *lim = (char *) sbrk (0);
+ long space_now = lim - (char *) &environ;
+ long space_diff = space_now - space_at_cmd_start;
+
+ printf_unfiltered ("Space used: %ld (%c%ld for this command)\n",
+ space_now,
+ (space_diff >= 0 ? '+' : '-'),
+ space_diff);
+#endif
+ }
+}
+
+/* Handle a complete line of input. This is called by the callback
+ mechanism within the readline library. Deal with incomplete commands
+ as well, by saving the partial input in a global buffer. */
+
+/* NOTE: 1999-04-30 This is the asynchronous version of the
+ command_line_input function. command_line_input will become
+ obsolete once we use the event loop as the default mechanism in
+ GDB. */
+static void
+command_line_handler (char *rl)
+{
+ static char *linebuffer = 0;
+ static unsigned linelength = 0;
+ register char *p;
+ char *p1;
+ extern char *line;
+ extern int linesize;
+ char *nline;
+ char got_eof = 0;
+
+
+ int repeat = (instream == stdin);
+
+ if (annotation_level > 1 && instream == stdin)
+ {
+ printf_unfiltered ("\n\032\032post-");
+ printf_unfiltered (async_annotation_suffix);
+ printf_unfiltered ("\n");
+ }
+
+ if (linebuffer == 0)
+ {
+ linelength = 80;
+ linebuffer = (char *) xmalloc (linelength);
+ }
+
+ p = linebuffer;
+
+ if (more_to_come)
+ {
+ strcpy (linebuffer, readline_input_state.linebuffer);
+ p = readline_input_state.linebuffer_ptr;
+ xfree (readline_input_state.linebuffer);
+ more_to_come = 0;
+ pop_prompt ();
+ }
+
+#ifdef STOP_SIGNAL
+ if (job_control)
+ signal (STOP_SIGNAL, handle_stop_sig);
+#endif
+
+ /* 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. */
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
+ gdb_flush (gdb_stderr);
+
+ if (source_file_name != NULL)
+ {
+ ++source_line_number;
+ sprintf (source_error,
+ "%s%s:%d: Error in sourced command file:\n",
+ source_pre_error,
+ source_file_name,
+ source_line_number);
+ error_pre_print = source_error;
+ }
+
+ /* If we are in this case, then command_handler will call quit
+ and exit from gdb. */
+ if (!rl || rl == (char *) EOF)
+ {
+ got_eof = 1;
+ command_handler (0);
+ }
+ if (strlen (rl) + 1 + (p - linebuffer) > linelength)
+ {
+ linelength = strlen (rl) + 1 + (p - linebuffer);
+ nline = (char *) xrealloc (linebuffer, linelength);
+ p += nline - linebuffer;
+ linebuffer = nline;
+ }
+ p1 = rl;
+ /* Copy line. Don't copy null at end. (Leaves line alone
+ if this was just a newline) */
+ while (*p1)
+ *p++ = *p1++;
+
+ xfree (rl); /* Allocated in readline. */
+
+ if (*(p - 1) == '\\')
+ {
+ p--; /* Put on top of '\'. */
+
+ if (*p == '\\')
+ {
+ readline_input_state.linebuffer = savestring (linebuffer,
+ strlen (linebuffer));
+ readline_input_state.linebuffer_ptr = p;
+
+ /* We will not invoke a execute_command if there is more
+ input expected to complete the command. So, we need to
+ print an empty prompt here. */
+ more_to_come = 1;
+ push_prompt ("", "", "");
+ display_gdb_prompt (0);
+ return;
+ }
+ }
+
+#ifdef STOP_SIGNAL
+ if (job_control)
+ signal (STOP_SIGNAL, SIG_DFL);
+#endif
+
+#define SERVER_COMMAND_LENGTH 7
+ server_command =
+ (p - linebuffer > 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. */
+ *p = '\0';
+ command_handler (linebuffer + SERVER_COMMAND_LENGTH);
+ display_gdb_prompt (0);
+ return;
+ }
+
+ /* Do history expansion if that is wished. */
+ if (history_expansion_p && instream == stdin
+ && ISATTY (instream))
+ {
+ char *history_value;
+ int expanded;
+
+ *p = '\0'; /* Insert null now. */
+ expanded = history_expand (linebuffer, &history_value);
+ if (expanded)
+ {
+ /* Print the changes. */
+ printf_unfiltered ("%s\n", history_value);
+
+ /* If there was an error, call this function again. */
+ if (expanded < 0)
+ {
+ xfree (history_value);
+ return;
+ }
+ if (strlen (history_value) > linelength)
+ {
+ linelength = strlen (history_value) + 1;
+ linebuffer = (char *) xrealloc (linebuffer, linelength);
+ }
+ strcpy (linebuffer, history_value);
+ p = linebuffer + strlen (linebuffer);
+ xfree (history_value);
+ }
+ }
+
+ /* If we just got an empty line, and that is supposed
+ to repeat the previous command, return the value in the
+ global buffer. */
+ if (repeat && p == linebuffer && *p != '\\')
+ {
+ command_handler (line);
+ display_gdb_prompt (0);
+ return;
+ }
+
+ for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++);
+ if (repeat && !*p1)
+ {
+ command_handler (line);
+ display_gdb_prompt (0);
+ return;
+ }
+
+ *p = 0;
+
+ /* Add line to history if appropriate. */
+ if (instream == stdin
+ && ISATTY (stdin) && *linebuffer)
+ add_history (linebuffer);
+
+ /* Note: lines consisting solely of comments are added to the command
+ history. This is useful when you type a command, and then
+ realize you don't want to execute it quite yet. You can comment
+ out the command and then later fetch it from the value history
+ 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. */
+
+ /* Save into global buffer if appropriate. */
+ if (repeat)
+ {
+ if (linelength > linesize)
+ {
+ line = xrealloc (line, linelength);
+ linesize = linelength;
+ }
+ strcpy (line, linebuffer);
+ if (!more_to_come)
+ {
+ command_handler (line);
+ display_gdb_prompt (0);
+ }
+ return;
+ }
+
+ command_handler (linebuffer);
+ display_gdb_prompt (0);
+ return;
+}
+
+/* Does reading of input from terminal w/o the editing features
+ provided by the readline library. */
+
+/* NOTE: 1999-04-30 Asynchronous version of gdb_readline. gdb_readline
+ will become obsolete when the event loop is made the default
+ execution for gdb. */
+void
+gdb_readline2 (gdb_client_data client_data)
+{
+ int c;
+ char *result;
+ int input_index = 0;
+ int result_size = 80;
+ static int done_once = 0;
+
+ /* Unbuffer the input stream, so that, later on, the calls to fgetc
+ fetch only one char at the time from the stream. The fgetc's will
+ get up to the first newline, but there may be more chars in the
+ stream after '\n'. If we buffer the input and fgetc drains the
+ stream, getting stuff beyond the newline as well, a select, done
+ afterwards will not trigger. */
+ if (!done_once && !ISATTY (instream))
+ {
+ setbuf (instream, NULL);
+ done_once = 1;
+ }
+
+ result = (char *) xmalloc (result_size);
+
+ /* We still need the while loop here, even though it would seem
+ obvious to invoke gdb_readline2 at every character entered. If
+ not using the readline library, the terminal is in cooked mode,
+ which sends the characters all at once. Poll will notice that the
+ input fd has changed state only after enter is pressed. At this
+ point we still need to fetch all the chars entered. */
+
+ while (1)
+ {
+ /* Read from stdin if we are executing a user defined command.
+ This is the right thing for prompt_for_continue, at least. */
+ c = fgetc (instream ? instream : stdin);
+
+ if (c == EOF)
+ {
+ if (input_index > 0)
+ /* The last line does not end with a newline. Return it, and
+ if we are called again fgetc will still return EOF and
+ we'll return NULL then. */
+ break;
+ xfree (result);
+ (*input_handler) (0);
+ }
+
+ if (c == '\n')
+#ifndef CRLF_SOURCE_FILES
+ break;
+#else
+ {
+ if (input_index > 0 && result[input_index - 1] == '\r')
+ input_index--;
+ break;
+ }
+#endif
+
+ result[input_index++] = c;
+ while (input_index >= result_size)
+ {
+ result_size *= 2;
+ result = (char *) xrealloc (result, result_size);
+ }
+ }
+
+ result[input_index++] = '\0';
+ (*input_handler) (result);
+}
+
+
+/* Initialization of signal handlers and tokens. There is a function
+ handle_sig* for each of the signals GDB cares about. Specifically:
+ SIGINT, SIGFPE, SIGQUIT, SIGTSTP, SIGHUP, SIGWINCH. These
+ functions are the actual signal handlers associated to the signals
+ via calls to signal(). The only job for these functions is to
+ enqueue the appropriate event/procedure with the event loop. Such
+ procedures are the old signal handlers. The event loop will take
+ care of invoking the queued procedures to perform the usual tasks
+ associated with the reception of the signal. */
+/* NOTE: 1999-04-30 This is the asynchronous version of init_signals.
+ init_signals will become obsolete as we move to have to event loop
+ as the default for gdb. */
+void
+async_init_signals (void)
+{
+ signal (SIGINT, handle_sigint);
+ sigint_token =
+ create_async_signal_handler (async_request_quit, NULL);
+
+ /* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed
+ to the inferior and breakpoints will be ignored. */
+#ifdef SIGTRAP
+ signal (SIGTRAP, SIG_DFL);
+#endif
+
+ /* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get
+ passed to the inferior, which we don't want. It would be
+ possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but
+ on BSD4.3 systems using vfork, that can affect the
+ GDB process as well as the inferior (the signal handling tables
+ might be in memory, shared between the two). Since we establish
+ a handler for SIGQUIT, when we call exec it will set the signal
+ to SIG_DFL for us. */
+ signal (SIGQUIT, handle_sigquit);
+ sigquit_token =
+ create_async_signal_handler (async_do_nothing, NULL);
+#ifdef SIGHUP
+ if (signal (SIGHUP, handle_sighup) != SIG_IGN)
+ sighup_token =
+ create_async_signal_handler (async_disconnect, NULL);
+ else
+ sighup_token =
+ create_async_signal_handler (async_do_nothing, NULL);
+#endif
+ signal (SIGFPE, handle_sigfpe);
+ sigfpe_token =
+ create_async_signal_handler (async_float_handler, NULL);
+
+#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
+ signal (SIGWINCH, handle_sigwinch);
+ sigwinch_token =
+ create_async_signal_handler (SIGWINCH_HANDLER, NULL);
+#endif
+#ifdef STOP_SIGNAL
+ sigtstp_token =
+ create_async_signal_handler (async_stop_sig, NULL);
+#endif
+
+}
+
+void
+mark_async_signal_handler_wrapper (void *token)
+{
+ mark_async_signal_handler ((struct async_signal_handler *) token);
+}
+
+/* Tell the event loop what to do if SIGINT is received.
+ See event-signal.c. */
+void
+handle_sigint (int sig)
+{
+ signal (sig, handle_sigint);
+
+ /* If immediate_quit is set, we go ahead and process the SIGINT right
+ away, even if we usually would defer this to the event loop. The
+ assumption here is that it is safe to process ^C immediately if
+ immediate_quit is set. If we didn't, SIGINT would be really
+ processed only the next time through the event loop. To get to
+ that point, though, the command that we want to interrupt needs to
+ finish first, which is unacceptable. */
+ if (immediate_quit)
+ async_request_quit (0);
+ else
+ /* If immediate quit is not set, we process SIGINT the next time
+ through the loop, which is fine. */
+ mark_async_signal_handler_wrapper (sigint_token);
+}
+
+/* Do the quit. All the checks have been done by the caller. */
+void
+async_request_quit (gdb_client_data arg)
+{
+ quit_flag = 1;
+#ifdef REQUEST_QUIT
+ REQUEST_QUIT;
+#else
+ quit ();
+#endif
+}
+
+/* Tell the event loop what to do if SIGQUIT is received.
+ See event-signal.c. */
+static void
+handle_sigquit (int sig)
+{
+ mark_async_signal_handler_wrapper (sigquit_token);
+ signal (sig, handle_sigquit);
+}
+
+/* Called by the event loop in response to a SIGQUIT. */
+static void
+async_do_nothing (gdb_client_data arg)
+{
+ /* Empty function body. */
+}
+
+#ifdef SIGHUP
+/* Tell the event loop what to do if SIGHUP is received.
+ See event-signal.c. */
+static void
+handle_sighup (int sig)
+{
+ mark_async_signal_handler_wrapper (sighup_token);
+ signal (sig, handle_sighup);
+}
+
+/* Called by the event loop to process a SIGHUP */
+static void
+async_disconnect (gdb_client_data arg)
+{
+ catch_errors (quit_cover, NULL,
+ "Could not kill the program being debugged",
+ RETURN_MASK_ALL);
+ signal (SIGHUP, SIG_DFL); /*FIXME: ??????????? */
+ kill (getpid (), SIGHUP);
+}
+#endif
+
+#ifdef STOP_SIGNAL
+void
+handle_stop_sig (int sig)
+{
+ mark_async_signal_handler_wrapper (sigtstp_token);
+ signal (sig, handle_stop_sig);
+}
+
+static void
+async_stop_sig (gdb_client_data arg)
+{
+ char *prompt = get_prompt ();
+#if STOP_SIGNAL == SIGTSTP
+ signal (SIGTSTP, SIG_DFL);
+#if HAVE_SIGPROCMASK
+ {
+ sigset_t zero;
+
+ sigemptyset (&zero);
+ sigprocmask (SIG_SETMASK, &zero, 0);
+ }
+#elif HAVE_SIGSETMASK
+ sigsetmask (0);
+#endif
+ kill (getpid (), SIGTSTP);
+ signal (SIGTSTP, handle_stop_sig);
+#else
+ signal (STOP_SIGNAL, handle_stop_sig);
+#endif
+ printf_unfiltered ("%s", prompt);
+ gdb_flush (gdb_stdout);
+
+ /* Forget about any previous command -- null line now will do nothing. */
+ dont_repeat ();
+}
+#endif /* STOP_SIGNAL */
+
+/* Tell the event loop what to do if SIGFPE is received.
+ See event-signal.c. */
+static void
+handle_sigfpe (int sig)
+{
+ mark_async_signal_handler_wrapper (sigfpe_token);
+ signal (sig, handle_sigfpe);
+}
+
+/* Event loop will call this functin to process a SIGFPE. */
+static void
+async_float_handler (gdb_client_data arg)
+{
+ /* This message is based on ANSI C, section 4.7. Note that integer
+ divide by zero causes this, so "float" is a misnomer. */
+ error ("Erroneous arithmetic operation.");
+}
+
+/* Tell the event loop what to do if SIGWINCH is received.
+ See event-signal.c. */
+#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
+static void
+handle_sigwinch (int sig)
+{
+ mark_async_signal_handler_wrapper (sigwinch_token);
+ signal (sig, handle_sigwinch);
+}
+#endif
+
+
+/* Called by do_setshow_command. */
+/* ARGSUSED */
+void
+set_async_editing_command (char *args, int from_tty, struct cmd_list_element *c)
+{
+ change_line_handler ();
+}
+
+/* Called by do_setshow_command. */
+/* ARGSUSED */
+void
+set_async_annotation_level (char *args, int from_tty, struct cmd_list_element *c)
+{
+ change_annotation_level ();
+}
+
+/* Called by do_setshow_command. */
+/* ARGSUSED */
+void
+set_async_prompt (char *args, int from_tty, struct cmd_list_element *c)
+{
+ PROMPT (0) = savestring (new_async_prompt, strlen (new_async_prompt));
+}
+
+/* Set things up for readline to be invoked via the alternate
+ interface, i.e. via a callback function (rl_callback_read_char),
+ and hook up instream to the event loop. */
+void
+_initialize_event_loop (void)
+{
+ if (event_loop_p)
+ {
+ /* If the input stream is connected to a terminal, turn on
+ editing. */
+ if (ISATTY (instream))
+ {
+ /* 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'. */
+ async_command_editing_p = 1;
+
+ /* When a character is detected on instream by select or
+ poll, readline will be invoked via this callback
+ function. */
+ call_readline = rl_callback_read_char_wrapper;
+ }
+ else
+ {
+ async_command_editing_p = 0;
+ call_readline = gdb_readline2;
+ }
+
+ /* 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. */
+ input_handler = command_line_handler;
+
+ /* Tell readline to use the same input stream that gdb uses. */
+ rl_instream = instream;
+
+ /* Get a file descriptor for the input stream, so that we can
+ register it with the event loop. */
+ input_fd = fileno (instream);
+
+ /* Tell gdb to use the cli_command_loop as the main loop. */
+ command_loop_hook = cli_command_loop;
+
+ /* Now we need to create the event sources for the input file
+ descriptor. */
+ /* At this point in time, this is the only event source that we
+ 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, stdin_event_handler, 0);
+ }
+}
diff --git a/contrib/gdb/gdb/event-top.h b/contrib/gdb/gdb/event-top.h
new file mode 100644
index 0000000..24044a5
--- /dev/null
+++ b/contrib/gdb/gdb/event-top.h
@@ -0,0 +1,111 @@
+/* Definitions used by GDB event-top.c.
+ Copyright 1999, 2001 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Stack for prompts. Each prompt is composed as a prefix, a prompt
+ and a suffix. The prompt to be displayed at any given time is the
+ one on top of the stack. A stack is necessary because of cases in
+ which the execution of a gdb command requires further input from
+ the user, like for instance 'commands' for breakpoints and
+ 'actions' for tracepoints. In these cases, the prompt is '>' and
+ gdb should process input using the asynchronous readline interface
+ and the event loop. In order to achieve this, we need to save
+ somewhere the state of GDB, i.e. that it is processing user input
+ as part of a command and not as part of the top level command loop.
+ The prompt stack represents part of the saved state. Another part
+ would be the function that readline would invoke after a whole line
+ of input has ben entered. This second piece would be something
+ like, for instance, where to return within the code for the actions
+ commands after a line has been read. This latter portion has not
+ beeen implemented yet. The need for a 3-part prompt arises from
+ the annotation level. When this is set to 2, the prompt is
+ actually composed of a prefix, the prompt itself and a suffix. */
+
+/* At any particular time there will be always at least one prompt on
+ the stack, the one being currently displayed by gdb. If gdb is
+ using annotation level equal 2, there will be 2 prompts on the
+ stack: the usual one, w/o prefix and suffix (at top - 1), and the
+ 'composite' one with prefix and suffix added (at top). At this
+ time, this is the only use of the prompt stack. Resetting annotate
+ to 0 or 1, pops the top of the stack, resetting its size to one
+ element. The MAXPROMPTS limit is safe, for now. Once other cases
+ are dealt with (like the different prompts used for 'commands' or
+ 'actions') this array implementation of the prompt stack may have
+ to change. */
+
+#define MAXPROMPTS 10
+struct prompts
+ {
+ struct
+ {
+ char *prefix;
+ char *prompt;
+ char *suffix;
+ }
+ prompt_stack[MAXPROMPTS];
+ int top;
+ };
+
+#define PROMPT(X) the_prompts.prompt_stack[the_prompts.top + X].prompt
+#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
+#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
+
+/* Exported functions from event-top.c.
+ FIXME: these should really go into top.h. */
+
+extern void display_gdb_prompt (char *new_prompt);
+extern void async_init_signals (void);
+extern void set_async_editing_command (char *args, int from_tty,
+ struct cmd_list_element *c);
+extern void set_async_annotation_level (char *args, int from_tty,
+ struct cmd_list_element *c);
+extern void set_async_prompt (char *args, int from_tty,
+ struct cmd_list_element *c);
+
+/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */
+#ifndef STOP_SIGNAL
+#include <signal.h>
+#ifdef SIGTSTP
+#define STOP_SIGNAL SIGTSTP
+extern void handle_stop_sig (int sig);
+#endif
+#endif
+extern void handle_sigint (int sig);
+extern void pop_prompt (void);
+extern void push_prompt (char *prefix, char *prompt, char *suffix);
+extern void gdb_readline2 (void *client_data);
+extern void mark_async_signal_handler_wrapper (void *token);
+extern void async_request_quit (void *arg);
+extern void stdin_event_handler (int error, void *client_data);
+extern void async_disable_stdin (void);
+extern void async_enable_stdin (void *dummy);
+
+/* Exported variables from event-top.c.
+ FIXME: these should really go into top.h. */
+
+extern int async_command_editing_p;
+extern int exec_done_display_p;
+extern char *async_annotation_suffix;
+extern char *new_async_prompt;
+extern struct prompts the_prompts;
+extern void (*call_readline) (void *);
+extern void (*input_handler) (char *);
+extern int input_fd;
+extern void (*after_char_processing_hook) (void);
diff --git a/contrib/gdb/gdb/expprint.c b/contrib/gdb/gdb/expprint.c
index 939919a..cb61711 100644
--- a/contrib/gdb/gdb/expprint.c
+++ b/contrib/gdb/gdb/expprint.c
@@ -1,21 +1,23 @@
/* Print in infix form a struct expression.
- Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -31,13 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for local functions */
-static void
-print_subexp PARAMS ((struct expression *, int *, GDB_FILE *, enum precedence));
+static void print_subexp (struct expression *, int *, struct ui_file *,
+ enum precedence);
void
-print_expression (exp, stream)
- struct expression *exp;
- GDB_FILE *stream;
+print_expression (struct expression *exp, struct ui_file *stream)
{
int pc = 0;
print_subexp (exp, &pc, stream, PREC_NULL);
@@ -49,11 +49,8 @@ print_expression (exp, stream)
parentheses are needed here. */
static void
-print_subexp (exp, pos, stream, prec)
- register struct expression *exp;
- register int *pos;
- GDB_FILE *stream;
- enum precedence prec;
+print_subexp (register struct expression *exp, register int *pos,
+ struct ui_file *stream, enum precedence prec)
{
register unsigned tem;
register const struct op_print *op_print_tab;
@@ -65,7 +62,7 @@ print_subexp (exp, pos, stream, prec)
enum precedence myprec = PREC_NULL;
/* Set to 1 for a right-associative operator. */
int assoc = 0;
- value_ptr val;
+ struct value *val;
char *tempstr = NULL;
op_print_tab = exp->language_defn->la_op_print_tab;
@@ -73,7 +70,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 +121,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 +134,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 +153,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 +262,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 +292,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 +321,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 +377,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 +401,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 +430,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 +458,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 +470,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 +484,7 @@ 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 (enum exp_opcode op)
{
int tem;
register const struct op_print *op_print_tab;
@@ -497,16 +496,13 @@ op_string(op)
return NULL;
}
-#ifdef MAINTENANCE_CMDS
-
/* Support for dumping the raw data from expressions in a human readable
form. */
-static char * op_name PARAMS ((int opcode));
+static char *op_name (int opcode);
static char *
-op_name (opcode)
- int opcode;
+op_name (int opcode)
{
switch (opcode)
{
@@ -517,100 +513,182 @@ 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 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";
}
}
void
-dump_prefix_expression (exp, stream, note)
- struct expression *exp;
- GDB_FILE *stream;
- char *note;
+dump_prefix_expression (struct expression *exp, struct ui_file *stream,
+ char *note)
{
int elt;
char *opcode_name;
@@ -618,28 +696,28 @@ dump_prefix_expression (exp, stream, note)
int eltsize;
fprintf_filtered (stream, "Dump of expression @ ");
- gdb_print_address (exp, stream);
+ gdb_print_host_address (exp, stream);
fprintf_filtered (stream, ", %s:\nExpression: `", note);
if (exp->elts[0].opcode != OP_TYPE)
print_expression (exp, stream);
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,
- sizeof (union exp_element));
+ fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
+ exp->language_defn->la_name, exp->nelts,
+ (long) 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++)
{
@@ -650,13 +728,11 @@ dump_prefix_expression (exp, stream, note)
}
}
-static int dump_subexp PARAMS ((struct expression *exp, GDB_FILE *stream, int elt));
+static int dump_subexp (struct expression *exp, struct ui_file *stream,
+ int elt);
static int
-dump_subexp (exp, stream, elt)
- struct expression *exp;
- GDB_FILE *stream;
- int elt;
+dump_subexp (struct expression *exp, struct ui_file *stream, int elt)
{
static int indent = 0;
int i;
@@ -670,7 +746,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:
@@ -702,7 +778,6 @@ dump_subexp (exp, stream, elt)
case BINOP_EXP:
case BINOP_MIN:
case BINOP_MAX:
- case BINOP_SCOPE:
case BINOP_INTDIV:
case BINOP_ASSIGN_MODIFY:
case BINOP_VAL:
@@ -743,40 +818,47 @@ dump_subexp (exp, stream, elt)
elt = dump_subexp (exp, stream, elt);
break;
case OP_LONG:
- fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
+ fprintf_filtered (stream, "Type @");
+ gdb_print_host_address (exp->elts[elt].type, stream);
+ fprintf_filtered (stream, " (");
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);
+ fprintf_filtered (stream, "Type @");
+ gdb_print_host_address (exp->elts[elt].type, stream);
+ fprintf_filtered (stream, " (");
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));
+ fprintf_filtered (stream, "Block @");
+ gdb_print_host_address (exp->elts[elt].block, stream);
+ fprintf_filtered (stream, ", symbol @");
+ gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
+ fprintf_filtered (stream, " (%s)",
+ 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:
- fprintf_filtered (stream, "Internal var @0x%x (%s)",
- exp->elts[elt].internalvar,
+ fprintf_filtered (stream, "Internal var @");
+ gdb_print_host_address (exp->elts[elt].internalvar, stream);
+ fprintf_filtered (stream, " (%s)",
exp->elts[elt].internalvar->name);
elt += 2;
break;
@@ -810,15 +892,17 @@ dump_subexp (exp, stream, elt)
break;
case UNOP_MEMVAL:
case UNOP_CAST:
- fprintf_filtered (stream, "Type @0x%x (",
- exp->elts[elt].type);
+ fprintf_filtered (stream, "Type @");
+ gdb_print_host_address (exp->elts[elt].type, stream);
+ fprintf_filtered (stream, " (");
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);
+ fprintf_filtered (stream, "Type @");
+ gdb_print_host_address (exp->elts[elt].type, stream);
+ fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt += 2;
@@ -841,7 +925,9 @@ dump_subexp (exp, stream, elt)
char *elem_name;
int len;
- fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
+ fprintf_filtered (stream, "Type @");
+ gdb_print_host_address (exp->elts[elt].type, stream);
+ fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ") ");
@@ -876,28 +962,24 @@ dump_subexp (exp, stream, elt)
}
void
-dump_postfix_expression (exp, stream, note)
- struct expression *exp;
- GDB_FILE *stream;
- char *note;
+dump_postfix_expression (struct expression *exp, struct ui_file *stream,
+ char *note)
{
int elt;
fprintf_filtered (stream, "Dump of expression @ ");
- gdb_print_address (exp, stream);
+ gdb_print_host_address (exp, stream);
fprintf_filtered (stream, ", %s:\nExpression: `", note);
if (exp->elts[0].opcode != OP_TYPE)
print_expression (exp, stream);
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,
- sizeof (union exp_element));
+ fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
+ exp->language_defn->la_name, exp->nelts,
+ (long) 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);
}
-
-#endif /* MAINTENANCE_CMDS */
diff --git a/contrib/gdb/gdb/expression.h b/contrib/gdb/gdb/expression.h
index 310b2e2..0fbab03 100644
--- a/contrib/gdb/gdb/expression.h
+++ b/contrib/gdb/gdb/expression.h
@@ -1,27 +1,29 @@
/* Definitions for expressions stored in reversed prefix form, for GDB.
- Copyright 1986, 1989, 1992, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1992, 1994, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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. */
+#include "doublest.h" /* Needed for DOUBLEST. */
/* Definitions for saved C expressions. */
@@ -40,288 +42,287 @@ 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, /* >? */
+
+ /* 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. */
@@ -333,9 +334,9 @@ struct expression
/* From parse.c */
-extern struct expression *parse_expression PARAMS ((char *));
+extern struct expression *parse_expression (char *);
-extern struct expression *parse_exp_1 PARAMS ((char **, struct block *, int));
+extern struct expression *parse_exp_1 (char **, struct block *, int);
/* The innermost context required by the stack and register variables
we've encountered so far. To use this, set it to NULL, then call
@@ -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,24 +360,22 @@ enum noside
listed as being in a register in
the function in which it was
declared will be lval_register). */
-};
+ };
-extern struct value* evaluate_subexp_standard
-PARAMS ((struct type *, struct expression *, int*, enum noside));
+extern struct value *evaluate_subexp_standard
+ (struct type *, struct expression *, int *, enum noside);
/* From expprint.c */
-extern void print_expression PARAMS ((struct expression *, GDB_FILE *));
+extern void print_expression (struct expression *, struct ui_file *);
-extern char *op_string PARAMS ((enum exp_opcode));
+extern char *op_string (enum exp_opcode);
-#ifdef MAINTENANCE_CMDS
-extern void dump_prefix_expression PARAMS ((struct expression *,
- GDB_FILE *,
- char *));
-extern void dump_postfix_expression PARAMS ((struct expression *,
- GDB_FILE *,
- char *));
-#endif /* MAINTENANCE_CMDS */
+extern void dump_prefix_expression (struct expression *,
+ struct ui_file *,
+ char *);
+extern void dump_postfix_expression (struct expression *,
+ struct ui_file *,
+ char *);
-#endif /* !defined (EXPRESSION_H) */
+#endif /* !defined (EXPRESSION_H) */
diff --git a/contrib/gdb/gdb/f-exp.y b/contrib/gdb/gdb/f-exp.y
index 4a1f747..7cbfd5a 100644
--- a/contrib/gdb/gdb/f-exp.y
+++ b/contrib/gdb/gdb/f-exp.y
@@ -1,6 +1,7 @@
/* YACC parser for Fortran expressions, for GDB.
- Copyright 1986, 1989, 1990, 1991, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001
+ Free Software Foundation, Inc.
+
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
@@ -52,6 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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 <ctype.h>
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
@@ -103,15 +105,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define YYDEBUG 1 /* Default to no yydebug support */
#endif
-int yyparse PARAMS ((void));
+int yyparse (void);
-static int yylex PARAMS ((void));
+static int yylex (void);
-void yyerror PARAMS ((char *));
+void yyerror (char *);
-static void growbuf_by_size PARAMS ((int));
+static void growbuf_by_size (int);
-static int match_string_literal PARAMS ((void));
+static int match_string_literal (void);
%}
@@ -143,7 +145,7 @@ static int match_string_literal PARAMS ((void));
%{
/* YYSTYPE gets defined by %union */
-static int parse_number PARAMS ((char *, int, int, YYSTYPE *));
+static int parse_number (char *, int, int, YYSTYPE *);
%}
%type <voidval> exp type_exp start variable
@@ -638,7 +640,6 @@ parse_number (p, len, parsed_float, putithere)
{
register LONGEST n = 0;
register LONGEST prevn = 0;
- register int i;
register int c;
register int base = input_radix;
int unsigned_p = 0;
@@ -653,7 +654,7 @@ parse_number (p, len, parsed_float, putithere)
/* [dD] is not understood as an exponent by atof, change it to 'e'. */
char *tmp, *tmp2;
- tmp = strsave (p);
+ tmp = xstrdup (p);
for (tmp2 = tmp; *tmp2; ++tmp2)
if (*tmp2 == 'd' || *tmp2 == 'D')
*tmp2 = 'e';
@@ -696,26 +697,26 @@ parse_number (p, len, parsed_float, putithere)
while (len-- > 0)
{
c = *p++;
- if (c >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- if (c != 'l' && c != 'u')
- n *= base;
- if (c >= '0' && c <= '9')
- n += i = c - '0';
+ if (isupper (c))
+ c = tolower (c);
+ if (len == 0 && c == 'l')
+ long_p = 1;
+ else if (len == 0 && c == 'u')
+ unsigned_p = 1;
else
{
- if (base > 10 && c >= 'a' && c <= 'f')
- n += i = c - 'a' + 10;
- else if (len == 0 && c == 'l')
- long_p = 1;
- else if (len == 0 && c == 'u')
- unsigned_p = 1;
+ int i;
+ if (c >= '0' && c <= '9')
+ i = c - '0';
+ else if (c >= 'a' && c <= 'f')
+ i = c - 'a' + 10;
else
return ERROR; /* Char not a digit */
+ if (i >= base)
+ return ERROR; /* Invalid digit in this base */
+ n *= base;
+ n += i;
}
- if (i >= base)
- return ERROR; /* Invalid digit in this base */
-
/* Portably test for overflow (only works for nonzero values, so make
a second check for zero). */
if ((prevn >= n) && n != 0)
diff --git a/contrib/gdb/gdb/f-lang.c b/contrib/gdb/gdb/f-lang.c
index 4ee66d5..1727bda 100644
--- a/contrib/gdb/gdb/f-lang.c
+++ b/contrib/gdb/gdb/f-lang.c
@@ -1,23 +1,25 @@
/* Fortran language support routines for GDB, the GNU debugger.
- Copyright 1993, 1994, 1996 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
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"
@@ -27,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "parser-defs.h"
#include "language.h"
#include "f-lang.h"
+#include "valprint.h"
/* The built-in types of F77. FIXME: integer*4 is missing, plain
logical is missing (builtin_type_logical is logical*4). */
@@ -35,7 +38,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,43 +51,46 @@ 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 */
+extern void _initialize_f_language (void);
#if 0
-static void clear_function_list PARAMS ((void));
-static long get_bf_for_fcn PARAMS ((long));
-static void clear_bf_list PARAMS ((void));
-static void patch_all_commons_by_name PARAMS ((char *, CORE_ADDR, int));
-static SAVED_F77_COMMON_PTR find_first_common_named PARAMS ((char *));
-static void add_common_entry PARAMS ((struct symbol *));
-static void add_common_block PARAMS ((char *, CORE_ADDR, int, char *));
-static SAVED_FUNCTION *allocate_saved_function_node PARAMS ((void));
-static SAVED_BF_PTR allocate_saved_bf_node PARAMS ((void));
-static COMMON_ENTRY_PTR allocate_common_entry_node PARAMS ((void));
-static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node PARAMS ((void));
-static void patch_common_entries PARAMS ((SAVED_F77_COMMON_PTR, CORE_ADDR, int));
+static void clear_function_list (void);
+static long get_bf_for_fcn (long);
+static void clear_bf_list (void);
+static void patch_all_commons_by_name (char *, CORE_ADDR, int);
+static SAVED_F77_COMMON_PTR find_first_common_named (char *);
+static void add_common_entry (struct symbol *);
+static void add_common_block (char *, CORE_ADDR, int, char *);
+static SAVED_FUNCTION *allocate_saved_function_node (void);
+static SAVED_BF_PTR allocate_saved_bf_node (void);
+static COMMON_ENTRY_PTR allocate_common_entry_node (void);
+static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void);
+static void patch_common_entries (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 struct type *f_create_fundamental_type (struct objfile *, int);
+static void f_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+static void f_printchar (int c, struct ui_file * stream);
+static void f_emit_char (int c, struct ui_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
@@ -93,13 +99,10 @@ static void f_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
be replaced with a true F77 version. */
static void
-f_emit_char (c, stream, quoter)
- register int c;
- GDB_FILE *stream;
- int quoter;
+f_emit_char (register int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
-
+
if (PRINT_LITERAL_FORM (c))
{
if (c == '\\' || c == quoter)
@@ -142,9 +145,7 @@ f_emit_char (c, stream, quoter)
be replaced with a true F77version. */
static void
-f_printchar (c, stream)
- int c;
- GDB_FILE *stream;
+f_printchar (int c, struct ui_file *stream)
{
fputs_filtered ("'", stream);
LA_EMIT_CHAR (c, stream, '\'');
@@ -159,43 +160,37 @@ f_printchar (c, stream)
be replaced with a true F77 version. */
static void
-f_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+f_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
register unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
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])
@@ -203,7 +198,7 @@ f_printstr (stream, string, length, width, force_ellipses)
++rep1;
++reps;
}
-
+
if (reps > repeat_count_threshold)
{
if (in_quotes)
@@ -234,7 +229,7 @@ f_printstr (stream, string, length, width, force_ellipses)
++things_printed;
}
}
-
+
/* Terminate the quotes if necessary. */
if (in_quotes)
{
@@ -243,7 +238,7 @@ f_printstr (stream, string, length, width, force_ellipses)
else
fputs_filtered ("'", stream);
}
-
+
if (force_ellipses || i < length)
fputs_filtered ("...", stream);
}
@@ -253,12 +248,10 @@ f_printstr (stream, string, length, width, force_ellipses)
by an experienced F77 programmer. */
static struct type *
-f_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+f_create_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type *type = NULL;
-
+
switch (typeid)
{
case FT_VOID:
@@ -314,10 +307,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;
@@ -334,7 +327,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,
@@ -396,9 +389,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);
@@ -407,65 +400,68 @@ f_create_fundamental_type (objfile, typeid)
}
return (type);
}
-
+
/* 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}
};
-struct type ** CONST_PTR (f_builtin_types[]) =
+struct type **const (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
is already just a hack. */
-extern int
-c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
+extern int c_value_print (struct value *, struct ui_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,
range_check_on,
type_check_on,
+ case_sensitive_off,
f_parse, /* parser */
f_error, /* parser error function */
evaluate_subexp_standard,
@@ -473,89 +469,89 @@ 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 ()
+_initialize_f_language (void)
{
builtin_type_f_void =
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);
@@ -564,215 +560,210 @@ _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 (void)
{
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 (void)
{
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 (void)
{
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 (void)
{
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)
- char *name;
- CORE_ADDR offset;
- int secnum;
- char *func_stab;
+add_common_block (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);
+
+ xfree (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 (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 (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)
- char *name;
- char *funcname;
+SAVED_F77_COMMON_PTR
+find_common_for_function (char *name, 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);
}
@@ -780,28 +771,25 @@ 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)
- SAVED_F77_COMMON_PTR blk;
- CORE_ADDR offset;
- int secnum;
+patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, 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
@@ -811,35 +799,32 @@ patch_common_entries (blk, offset, secnum)
(which is where common data lives). */
static void
-patch_all_commons_by_name (name, offset, secnum)
- char *name;
- CORE_ADDR offset;
- int secnum;
+patch_all_commons_by_name (char *name, 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);
+ xfree (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
@@ -849,7 +834,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) \
@@ -875,24 +860,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 (void)
{
-
+
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;
+ xfree (tmp);
+ tmp = next;
}
saved_bf_list = NULL;
}
@@ -903,71 +888,70 @@ int global_remote_debug;
#if 0
static long
-get_bf_for_fcn (the_function)
- long the_function;
+get_bf_for_fcn (long 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)
+ internal_error (__FILE__, __LINE__,
+ "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 (void)
{
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);
+ xfree (tmp);
tmp = next;
}
-
+
saved_function_list = NULL;
}
#endif
-
diff --git a/contrib/gdb/gdb/f-lang.h b/contrib/gdb/gdb/f-lang.h
index c6b8f02..d929b91 100644
--- a/contrib/gdb/gdb/f-lang.h
+++ b/contrib/gdb/gdb/f-lang.h
@@ -1,94 +1,96 @@
/* Fortran language support definitions for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1998, 2000
+ Free Software Foundation, Inc.
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));
+extern int f_parse (void);
-extern void f_error PARAMS ((char *)); /* Defined in f-exp.y */
+extern void f_error (char *); /* Defined in f-exp.y */
-extern void f_print_type PARAMS ((struct type *, char *,
- GDB_FILE *, int, int));
+extern void f_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int f_val_print PARAMS ((struct type *, char *, int,
- CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+extern int f_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_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 *));
+extern SAVED_F77_COMMON_PTR find_common_for_function (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_upperbound (struct type *, int *);
-extern int f77_get_dynamic_lowerbound PARAMS ((struct type *, int *));
+extern int f77_get_dynamic_lowerbound (struct type *, int *);
-extern void f77_get_dynamic_array_length PARAMS ((struct type *));
+extern void f77_get_dynamic_array_length (struct type *);
-extern int calc_f77_array_dims PARAMS ((struct type *));
+extern int calc_f77_array_dims (struct type *);
#define DEFAULT_DOTMAIN_NAME_IN_MF77 ".MAIN_"
#define DEFAULT_MAIN_NAME_IN_MF77 "MAIN_"
diff --git a/contrib/gdb/gdb/f-typeprint.c b/contrib/gdb/gdb/f-typeprint.c
index 09bb3eb..2beae0f 100644
--- a/contrib/gdb/gdb/f-typeprint.c
+++ b/contrib/gdb/gdb/f-typeprint.c
@@ -1,23 +1,26 @@
/* Support for printing Fortran types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002
+ Free Software Foundation, Inc.
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"
@@ -28,42 +31,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
#include "gdbcore.h"
#include "target.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "language.h"
-#include "demangle.h"
#include "f-lang.h"
-#include "typeprint.h"
-#include "frame.h" /* ??? */
#include "gdb_string.h"
#include <errno.h>
-#if 0 /* Currently unused */
-static void f_type_print_args PARAMS ((struct type *, GDB_FILE *));
+#if 0 /* Currently unused */
+static void f_type_print_args (struct type *, struct ui_file *);
#endif
-static void print_equivalent_f77_float_type PARAMS ((struct type *,
- GDB_FILE *));
+static void print_equivalent_f77_float_type (struct type *,
+ struct ui_file *);
-static void f_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *,
- int, int, int));
+static void f_type_print_varspec_suffix (struct type *, struct ui_file *,
+ int, int, int);
-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));
+void f_type_print_varspec_prefix (struct type *, struct ui_file *,
+ int, int);
+void f_type_print_base (struct type *, struct ui_file *, int, int);
+
/* LEVEL is the depth to indent lines by. */
void
-f_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+f_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
register enum type_code code;
int demangled_args;
@@ -72,8 +65,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 +82,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);
}
@@ -102,11 +95,8 @@ f_print_type (type, varstring, stream, show, level)
SHOW is always zero on recursive calls. */
void
-f_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int passed_a_ptr;
+f_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr)
{
if (type == 0)
return;
@@ -152,60 +142,18 @@ 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 */
-
-static void
-f_type_print_args (type, stream)
- struct type *type;
- GDB_FILE *stream;
-{
- int i;
- struct type **args;
-
- fprintf_filtered (stream, "(");
- args = TYPE_ARG_TYPES (type);
- if (args != NULL)
- {
- if (args[1] == NULL)
- {
- fprintf_filtered (stream, "...");
- }
- else
- {
- 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)
- fprintf_filtered (stream, "...");
- else if (args[i+1]->code != TYPE_CODE_VOID)
- {
- fprintf_filtered (stream, ",");
- wrap_here (" ");
- }
- }
- }
- }
- fprintf_filtered (stream, ")");
-}
-
-#endif /* 0 */
-
/* Print any array sizes, function arguments or close parentheses
needed after the variable name (to describe its type).
Args work like c_type_print_varspec_prefix. */
static void
-f_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int passed_a_ptr;
- int demangled_args;
+f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr, int demangled_args)
{
int upper_bound, lower_bound;
int lower_bound_was_default = 0;
@@ -226,61 +174,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,15 +253,13 @@ 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;
}
}
static void
-print_equivalent_f77_float_type (type, stream)
- struct type *type;
- GDB_FILE *stream;
+print_equivalent_f77_float_type (struct type *type, struct ui_file *stream)
{
/* Override type name "float" and make it the
appropriate real. XLC stupidly outputs -12 as a type
@@ -337,11 +282,8 @@ print_equivalent_f77_float_type (type, stream)
We increase it for some recursive calls. */
void
-f_type_print_base (type, stream, show, level)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int level;
+f_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
{
int retcode;
int upper_bound;
@@ -381,7 +323,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 +388,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
diff --git a/contrib/gdb/gdb/f-valprint.c b/contrib/gdb/gdb/f-valprint.c
index bb0b1d0..48c5113 100644
--- a/contrib/gdb/gdb/f-valprint.c
+++ b/contrib/gdb/gdb/f-valprint.c
@@ -1,23 +1,25 @@
/* Support for printing Fortran values for GDB, the GNU debugger.
- Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ Free Software Foundation, Inc.
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"
@@ -25,248 +27,241 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
-#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"
#if 0
-static int there_is_a_visible_common_named PARAMS ((char *));
+static int there_is_a_visible_common_named (char *);
#endif
-static void info_common_command PARAMS ((char *, int));
-static void list_all_visible_commons PARAMS ((char *));
-static void f77_print_array PARAMS ((struct type *, char *, CORE_ADDR,
- GDB_FILE *, int, int, int,
- enum val_prettyprint));
-static void f77_print_array_1 PARAMS ((int, int, struct type *, char *,
- CORE_ADDR, GDB_FILE *, int, int, int,
- enum val_prettyprint));
-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];
+extern void _initialize_f_valprint (void);
+static void info_common_command (char *, int);
+static void list_all_visible_commons (char *);
+static void f77_print_array (struct type *, char *, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
+static void f77_print_array_1 (int, int, struct type *, char *,
+ CORE_ADDR, struct ui_file *, int, int, int,
+ enum val_prettyprint);
+static void f77_create_arrayprint_offset_tbl (struct type *,
+ struct ui_file *);
+static void f77_get_dynamic_length_of_aggregate (struct type *);
+
+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
-f77_get_dynamic_lowerbound (type, lower_bound)
- struct type *type;
- int *lower_bound;
+int
+f77_get_dynamic_lowerbound (struct type *type, 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
-f77_get_dynamic_upperbound (type, upper_bound)
- struct type *type;
- int *upper_bound;
+int
+f77_get_dynamic_upperbound (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;
+f77_get_dynamic_length_of_aggregate (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
-f77_create_arrayprint_offset_tbl (type, stream)
- struct type *type;
- GDB_FILE *stream;
+static void
+f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *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)
{
@@ -278,31 +273,22 @@ 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,
- stream, format, deref_ref, recurse, pretty)
- int nss;
- int ndimensions;
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+static void
+f77_print_array_1 (int nss, int ndimensions, struct type *type, char *valaddr,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, 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, ") ");
}
}
@@ -312,13 +298,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, "...");
}
@@ -328,87 +314,72 @@ 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,
- pretty)
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+static void
+f77_print_array (struct type *type, char *valaddr, CORE_ADDR address,
+ struct ui_file *stream, int format, int deref_ref, 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);
+}
+
/* 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
-f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, recurse,
- pretty)
- 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;
+f_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
- 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')
{
@@ -419,7 +390,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. */
@@ -427,10 +398,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);
-
+ fprintf_filtered (stream, "0x%s", paddr_nz (addr));
+
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
if (TYPE_LENGTH (elttype) == 1
@@ -438,13 +409,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)
{
@@ -452,14 +423,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)
@@ -479,95 +450,100 @@ 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);
fputs_filtered (",", stream);
- print_floating (valaddr, type, stream);
+ print_floating (valaddr + TYPE_LENGTH (type), 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));
}
@@ -576,73 +552,70 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
static void
-list_all_visible_commons (funname)
- char *funname;
+list_all_visible_commons (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
-info_common_command (comname, from_tty)
- char *comname;
- int from_tty;
+static void
+info_common_command (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
@@ -651,91 +624,90 @@ 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;
+there_is_a_visible_common_named (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
@@ -743,25 +715,25 @@ 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
void
-_initialize_f_valprint ()
+_initialize_f_valprint (void)
{
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.");
}
diff --git a/contrib/gdb/gdb/findvar.c b/contrib/gdb/gdb/findvar.c
index 5bfecc2..3a160a3 100644
--- a/contrib/gdb/gdb/findvar.c
+++ b/contrib/gdb/gdb/findvar.c
@@ -1,22 +1,24 @@
/* Find a variable's value in memory, for GDB, the GNU debugger.
- Copyright 1986, 87, 89, 91, 94, 95, 96, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,21 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "inferior.h"
#include "target.h"
#include "gdb_string.h"
+#include "gdb_assert.h"
#include "floatformat.h"
-#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
- is irrelevant, since no conversions will be taking place. */
-
-const struct floatformat floatformat_unknown;
-
-/* Registers we shouldn't try to store. */
-#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) 0
-#endif
-
-static void write_register_gen PARAMS ((int, char *));
+#include "symfile.h" /* for overlay functions */
+#include "regcache.h"
/* 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. */
@@ -51,17 +42,15 @@ static void write_register_gen PARAMS ((int, 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
-extract_signed_integer (addr, len)
- PTR addr;
- int len;
+extract_signed_integer (void *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))
@@ -71,11 +60,11 @@ That operation is not available on integers of more than %d bytes.",
/* Start at the most significant end of the integer, and work towards
the least significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
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;
}
@@ -83,7 +72,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;
}
@@ -91,13 +80,11 @@ That operation is not available on integers of more than %d bytes.",
}
ULONGEST
-extract_unsigned_integer (addr, len)
- PTR addr;
- int len;
+extract_unsigned_integer (void *addr, int 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))
@@ -108,7 +95,7 @@ That operation is not available on integers of more than %d bytes.",
/* Start at the most significant end of the integer, and work towards
the least significant. */
retval = 0;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = startaddr; p < endaddr; ++p)
retval = (retval << 8) | *p;
@@ -127,16 +114,13 @@ That operation is not available on integers of more than %d bytes.",
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (addr, orig_len, pval)
- PTR addr;
- int orig_len;
- LONGEST *pval;
+extract_long_unsigned_integer (void *addr, int orig_len, LONGEST *pval)
{
char *p, *first_addr;
int len;
len = orig_len;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = (char *) addr;
len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
@@ -173,29 +157,54 @@ extract_long_unsigned_integer (addr, orig_len, pval)
return 0;
}
+
+/* Treat the LEN bytes at ADDR as a target-format address, and return
+ that address. ADDR is a buffer in the GDB process, not in the
+ inferior.
+
+ This function should only be used by target-specific code. It
+ assumes that a pointer has the same representation as that thing's
+ address represented as an integer. Some machines use word
+ addresses, or similarly munged things, for certain types of
+ pointers, so that assumption doesn't hold everywhere.
+
+ Common code should use extract_typed_address instead, or something
+ else based on POINTER_TO_ADDRESS. */
+
CORE_ADDR
-extract_address (addr, len)
- PTR addr;
- int len;
+extract_address (void *addr, int 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);
+}
+
+
+/* Treat the bytes at BUF as a pointer of type TYPE, and return the
+ address it represents. */
+CORE_ADDR
+extract_typed_address (void *buf, struct type *type)
+{
+ if (TYPE_CODE (type) != TYPE_CODE_PTR
+ && TYPE_CODE (type) != TYPE_CODE_REF)
+ internal_error (__FILE__, __LINE__,
+ "extract_typed_address: "
+ "type is not a pointer or reference");
+
+ return POINTER_TO_ADDRESS (type, buf);
}
+
void
-store_signed_integer (addr, len, val)
- PTR addr;
- int len;
- LONGEST val;
+store_signed_integer (void *addr, int len, 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
the most significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = endaddr - 1; p >= startaddr; --p)
{
@@ -214,18 +223,15 @@ store_signed_integer (addr, len, val)
}
void
-store_unsigned_integer (addr, len, val)
- PTR addr;
- int len;
- ULONGEST val;
+store_unsigned_integer (void *addr, int len, 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
the most significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = endaddr - 1; p >= startaddr; --p)
{
@@ -243,333 +249,39 @@ store_unsigned_integer (addr, len, val)
}
}
-/* Store the literal address "val" into
- gdb-local memory pointed to by "addr"
- for "len" bytes. */
-void
-store_address (addr, len, val)
- PTR addr;
- int len;
- LONGEST val;
-{
- if( TARGET_BYTE_ORDER == BIG_ENDIAN
- && len != sizeof( LONGEST )) {
- /* On big-endian machines (e.g., HPPA 2.0, narrow mode)
- * just letting this fall through to the call below will
- * lead to the wrong bits being stored.
- *
- * Only the simplest case is fixed here, the others just
- * get the old behavior.
- */
- if( (len == sizeof( CORE_ADDR ))
- && (sizeof( LONGEST ) == 2 * sizeof( CORE_ADDR ))) {
- /* Watch out! The high bits are garbage! */
- CORE_ADDR coerce[2];
- *(LONGEST*)&coerce = val;
-
- store_unsigned_integer (addr, len, coerce[1] ); /* BIG_ENDIAN code! */
- return;
- }
- }
- store_unsigned_integer (addr, len, val);
-}
-
-/* Swap LEN bytes at BUFFER between target and host byte-order. */
-#define SWAP_FLOATING(buffer,len) \
- do \
- { \
- if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \
- { \
- char tmp; \
- char *p = (char *)(buffer); \
- char *q = ((char *)(buffer)) + len - 1; \
- for (; p < q; p++, q--) \
- { \
- tmp = *q; \
- *q = *p; \
- *p = tmp; \
- } \
- } \
- } \
- while (0)
-
-/* Extract a floating-point number from a target-order byte-stream at ADDR.
- Returns the value as type DOUBLEST.
-
- If the host and target formats agree, we just copy the raw data into the
- appropriate type of variable and return, letting the host increase precision
- as necessary. Otherwise, we call the conversion routine and let it do the
- dirty work. */
-
-DOUBLEST
-extract_floating (addr, len)
- PTR addr;
- int len;
-{
- DOUBLEST dretval;
-
- if (len == sizeof (float))
- {
- if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
- {
- float retval;
-
- memcpy (&retval, addr, sizeof (retval));
- return retval;
- }
- else
- floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval);
- }
- else if (len == sizeof (double))
- {
- if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
- {
- double retval;
-
- memcpy (&retval, addr, sizeof (retval));
- return retval;
- }
- else
- floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval);
- }
- else if (len == sizeof (DOUBLEST))
- {
- if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
- {
- DOUBLEST retval;
-
- memcpy (&retval, addr, sizeof (retval));
- return retval;
- }
- else
- floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval);
- }
- else
- {
- error ("Can't deal with a floating point number of %d bytes.", len);
- }
+/* Store the address VAL as a LEN-byte value in target byte order at
+ ADDR. ADDR is a buffer in the GDB process, not in the inferior.
- return dretval;
-}
+ This function should only be used by target-specific code. It
+ assumes that a pointer has the same representation as that thing's
+ address represented as an integer. Some machines use word
+ addresses, or similarly munged things, for certain types of
+ pointers, so that assumption doesn't hold everywhere.
+ Common code should use store_typed_address instead, or something else
+ based on ADDRESS_TO_POINTER. */
void
-store_floating (addr, len, val)
- PTR addr;
- int len;
- DOUBLEST val;
+store_address (void *addr, int len, LONGEST val)
{
- if (len == sizeof (float))
- {
- if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
- {
- float floatval = val;
-
- memcpy (addr, &floatval, sizeof (floatval));
- }
- else
- floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr);
- }
- else if (len == sizeof (double))
- {
- if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
- {
- double doubleval = val;
-
- memcpy (addr, &doubleval, sizeof (doubleval));
- }
- else
- floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr);
- }
- else if (len == sizeof (DOUBLEST))
- {
- if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
- memcpy (addr, &val, sizeof (val));
- else
- floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
- }
- else
- {
- error ("Can't deal with a floating point number of %d bytes.", len);
- }
-}
-
-#if !defined (GET_SAVED_REGISTER)
-
-/* Return the address in which frame FRAME's value of register REGNUM
- has been saved in memory. Or return zero if it has not been saved.
- If REGNUM specifies the SP, the value we return is actually
- the SP value, not an address where it was saved. */
-
-CORE_ADDR
-find_saved_register (frame, regnum)
- struct frame_info *frame;
- int regnum;
-{
- register struct frame_info *frame1 = NULL;
- register CORE_ADDR addr = 0;
-
- if (frame == NULL) /* No regs saved if want current frame */
- return 0;
-
-#ifdef HAVE_REGISTER_WINDOWS
- /* We assume that a register in a register window will only be saved
- in one place (since the name changes and/or disappears as you go
- towards inner frames), so we only call get_frame_saved_regs on
- the current frame. This is directly in contradiction to the
- usage below, which assumes that registers used in a frame must be
- saved in a lower (more interior) frame. This change is a result
- of working on a register window machine; get_frame_saved_regs
- always returns the registers saved within a frame, within the
- context (register namespace) of that frame. */
-
- /* However, note that we don't want this to return anything if
- nothing is saved (if there's a frame inside of this one). Also,
- callers to this routine asking for the stack pointer want the
- stack pointer saved for *this* frame; this is returned from the
- next frame. */
-
- if (REGISTER_IN_WINDOW_P(regnum))
- {
- frame1 = get_next_frame (frame);
- if (!frame1) return 0; /* Registers of this frame are active. */
-
- /* Get the SP from the next frame in; it will be this
- current frame. */
- if (regnum != SP_REGNUM)
- frame1 = frame;
-
- FRAME_INIT_SAVED_REGS (frame1);
- return frame1->saved_regs[regnum]; /* ... which might be zero */
- }
-#endif /* HAVE_REGISTER_WINDOWS */
-
- /* Note that this next routine assumes that registers used in
- frame x will be saved only in the frame that x calls and
- frames interior to it. This is not true on the sparc, but the
- above macro takes care of it, so we should be all right. */
- while (1)
- {
- QUIT;
- frame1 = get_prev_frame (frame1);
- if (frame1 == 0 || frame1 == frame)
- break;
- FRAME_INIT_SAVED_REGS (frame1);
- if (frame1->saved_regs[regnum])
- addr = frame1->saved_regs[regnum];
- }
-
- return addr;
+ store_unsigned_integer (addr, len, val);
}
-/* Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
- variable was optimized out (and thus can't be fetched). Set *LVAL
- to lval_memory, lval_register, or not_lval, depending on whether
- the value was fetched from memory, from a register, or in a strange
- and non-modifiable way (e.g. a frame pointer which was calculated
- rather than fetched). Set *ADDRP to the address, either in memory
- on as a REGISTER_BYTE offset into the registers array.
-
- Note that this implementation never sets *LVAL to not_lval. But
- it can be replaced by defining GET_SAVED_REGISTER and supplying
- your own.
-
- The argument RAW_BUFFER must point to aligned memory. */
+/* Store the address ADDR as a pointer of type TYPE at BUF, in target
+ form. */
void
-get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
- char *raw_buffer;
- int *optimized;
- CORE_ADDR *addrp;
- struct frame_info *frame;
- int regnum;
- enum lval_type *lval;
+store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
{
- CORE_ADDR addr;
+ if (TYPE_CODE (type) != TYPE_CODE_PTR
+ && TYPE_CODE (type) != TYPE_CODE_REF)
+ internal_error (__FILE__, __LINE__,
+ "store_typed_address: "
+ "type is not a pointer or reference");
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), (LONGEST)addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
+ ADDRESS_TO_POINTER (type, buf, addr);
}
-#endif /* GET_SAVED_REGISTER. */
-/* Copy the bytes of register REGNUM, relative to the input stack frame,
- into our memory at MYADDR, in target byte order.
- The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
- Returns 1 if could not be read, 0 if could. */
-
-int
-read_relative_register_raw_bytes_for_frame (regnum, myaddr, frame)
- int regnum;
- char *myaddr;
- struct frame_info *frame;
-{
- int optim;
- if (regnum == FP_REGNUM && frame)
- {
- /* Put it back in target format. */
- 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);
-
- if (register_valid [regnum] < 0)
- return 1; /* register value not available */
-
- return optim;
-}
-
-/* Copy the bytes of register REGNUM, relative to the current stack frame,
- into our memory at MYADDR, in target byte order.
- The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
-
- Returns 1 if could not be read, 0 if could. */
-
-int
-read_relative_register_raw_bytes (regnum, myaddr)
- int regnum;
- char *myaddr;
-{
- return read_relative_register_raw_bytes_for_frame (regnum, myaddr,
- selected_frame);
-}
/* Return a `value' with the contents of register REGNUM
in its virtual format, with the type specified by
@@ -578,550 +290,85 @@ read_relative_register_raw_bytes (regnum, myaddr)
NOTE: returns NULL if register value is not available.
Caller will check return value or die! */
-value_ptr
-value_of_register (regnum)
- int regnum;
+struct value *
+value_of_register (int regnum)
{
CORE_ADDR addr;
int optim;
- register value_ptr reg_val;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ struct value *reg_val;
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval;
get_saved_register (raw_buffer, &optim, &addr,
selected_frame, regnum, &lval);
- if (register_valid[regnum] < 0)
- return NULL; /* register value not available */
+ if (register_cached (regnum) < 0)
+ return NULL; /* register value not available */
reg_val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum));
/* Convert raw data to virtual format if necessary. */
-#ifdef REGISTER_CONVERTIBLE
if (REGISTER_CONVERTIBLE (regnum))
{
REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum),
raw_buffer, VALUE_CONTENTS_RAW (reg_val));
}
+ else if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum))
+ memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
+ REGISTER_RAW_SIZE (regnum));
else
-#endif
- if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum))
- memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
- REGISTER_RAW_SIZE (regnum));
- else
- fatal ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
- REGISTER_NAME (regnum), regnum,
- REGISTER_RAW_SIZE (regnum), REGISTER_VIRTUAL_SIZE (regnum));
+ internal_error (__FILE__, __LINE__,
+ "Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
+ REGISTER_NAME (regnum),
+ regnum,
+ REGISTER_RAW_SIZE (regnum),
+ REGISTER_VIRTUAL_SIZE (regnum));
VALUE_LVAL (reg_val) = lval;
VALUE_ADDRESS (reg_val) = addr;
VALUE_REGNO (reg_val) = regnum;
VALUE_OPTIMIZED_OUT (reg_val) = optim;
return reg_val;
}
-
-/* Low level examining and depositing of registers.
-
- The caller is responsible for making
- sure that the inferior is stopped before calling the fetching routines,
- or it will get garbage. (a change from GDB version 3, in which
- the caller got the value from the last stop). */
-
-/* Contents of the registers in target byte order.
- We allocate some extra slop since we do a lot of memcpy's around
- `registers', and failing-soft is better than failing hard. */
-
-char registers[REGISTER_BYTES + /* SLOP */ 256];
-
-/* Nonzero if that register has been fetched,
- -1 if register value not available. */
-SIGNED char register_valid[NUM_REGS];
-
-/* The thread/process associated with the current set of registers. For now,
- -1 is special, and means `no current process'. */
-int registers_pid = -1;
-
-/* Indicate that registers may have changed, so invalidate the cache. */
-
-void
-registers_changed ()
-{
- int i;
- int numregs = ARCH_NUM_REGS;
-
- registers_pid = -1;
-
- /* Force cleanup of any alloca areas if using C alloca instead of
- a builtin alloca. This particular call is used to clean up
- areas allocated by low level target code which may build up
- during lengthy interactions between gdb and the target before
- gdb gives control to the user (ie watchpoints). */
- alloca (0);
-
- for (i = 0; i < numregs; i++)
- register_valid[i] = 0;
-
- if (registers_changed_hook)
- registers_changed_hook ();
-}
-
-/* Indicate that all registers have been fetched, so mark them all valid. */
-void
-registers_fetched ()
-{
- int i;
- int numregs = ARCH_NUM_REGS;
- for (i = 0; i < numregs; i++)
- register_valid[i] = 1;
-}
-
-/* read_register_bytes and write_register_bytes are generally a *BAD* idea.
- 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
- 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.
-
- Prior to the recent fixes to check for partial updates, both read and
- write_register_bytes always checked to see if any registers were stale, and
- then called target_fetch_registers (-1) to update the whole set. This
- caused really slowed things down for remote targets. */
-
-/* Copy INLEN bytes of consecutive data from registers
- starting with the INREGBYTE'th byte of register data
- into memory at MYADDR. */
-
-void
-read_register_bytes (inregbyte, myaddr, inlen)
- int inregbyte;
- char *myaddr;
- int inlen;
-{
- int inregend = inregbyte + inlen;
- int regno;
-
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-
- /* See if we are trying to read bytes from out-of-date registers. If so,
- update just those registers. */
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- int regstart, regend;
- int startin, endin;
-
- if (register_valid[regno])
- continue;
-
- if (REGISTER_NAME (regno) == NULL || *REGISTER_NAME (regno) == '\0')
- continue;
-
- regstart = REGISTER_BYTE (regno);
- regend = regstart + REGISTER_RAW_SIZE (regno);
-
- startin = regstart >= inregbyte && regstart < inregend;
- endin = regend > inregbyte && regend <= inregend;
-
- if (!startin && !endin)
- continue;
-
- /* We've found an invalid register where at least one byte will be read.
- Update it from the target. */
-
- target_fetch_registers (regno);
-
- if (!register_valid[regno])
- error ("read_register_bytes: Couldn't update register %d.", regno);
- }
-
- if (myaddr != NULL)
- memcpy (myaddr, &registers[inregbyte], inlen);
-}
-
-/* Read register REGNO into memory at MYADDR, which must be large enough
- for REGISTER_RAW_BYTES (REGNO). Target byte-order.
- If the register is known to be the size of a CORE_ADDR or smaller,
- read_register can be used instead. */
-void
-read_register_gen (regno, myaddr)
- int regno;
- char *myaddr;
-{
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-
- if (!register_valid[regno])
- target_fetch_registers (regno);
- memcpy (myaddr, &registers[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno));
-}
-
-/* Write register REGNO at MYADDR to the target. MYADDR points at
- REGISTER_RAW_BYTES(REGNO), which must be in target byte-order. */
-
-static void
-write_register_gen (regno, myaddr)
- int regno;
- char *myaddr;
-{
- int size;
-
- /* On the sparc, writing %g0 is a no-op, so we don't even want to change
- the registers array if something writes to this register. */
- if (CANNOT_STORE_REGISTER (regno))
- return;
-
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-
- 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]
- && memcmp (&registers[REGISTER_BYTE (regno)], myaddr, size) == 0)
- return;
-
- target_prepare_to_store ();
-
- memcpy (&registers[REGISTER_BYTE (regno)], myaddr, size);
-
- register_valid [regno] = 1;
-
- target_store_registers (regno);
-}
-
-/* Copy INLEN bytes of consecutive data from memory at MYADDR
- into registers starting with the MYREGSTART'th byte of register data. */
-
-void
-write_register_bytes (myregstart, myaddr, inlen)
- int myregstart;
- char *myaddr;
- int inlen;
-{
- int myregend = myregstart + inlen;
- int regno;
-
- target_prepare_to_store ();
-
- /* Scan through the registers updating any that are covered by the range
- myregstart<=>myregend using write_register_gen, which does nice things
- like handling threads, and avoiding updates when the new and old contents
- are the same. */
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- int regstart, regend;
- int startin, endin;
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- regstart = REGISTER_BYTE (regno);
- regend = regstart + REGISTER_RAW_SIZE (regno);
-
- startin = regstart >= myregstart && regstart < myregend;
- endin = regend > myregstart && regend <= myregend;
-
- if (!startin && !endin)
- continue; /* Register is completely out of range */
-
- if (startin && endin) /* register is completely in range */
- {
- write_register_gen (regno, myaddr + (regstart - myregstart));
- continue;
- }
-
- /* We may be doing a partial update of an invalid register. Update it
- from the target before scribbling on it. */
- read_register_gen (regno, regbuf);
-
- if (startin)
- memcpy (registers + regstart,
- myaddr + regstart - myregstart,
- myregend - regstart);
- else /* endin */
- memcpy (registers + myregstart,
- myaddr,
- regend - myregstart);
- target_store_registers (regno);
- }
-}
-
-/* Return the raw contents of register REGNO, regarding it as an integer. */
-/* This probably should be returning LONGEST rather than CORE_ADDR. */
+/* Given a pointer of type TYPE in target form in BUF, return the
+ address it represents. */
CORE_ADDR
-read_register (regno)
- int regno;
+unsigned_pointer_to_address (struct type *type, void *buf)
{
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-
- if (!register_valid[regno])
- target_fetch_registers (regno);
-
- return (CORE_ADDR)extract_address (&registers[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE(regno));
+ return extract_address (buf, TYPE_LENGTH (type));
}
CORE_ADDR
-read_register_pid (regno, pid)
- int regno, pid;
-{
- int save_pid;
- CORE_ADDR retval;
-
- if (pid == inferior_pid)
- return read_register (regno);
-
- save_pid = inferior_pid;
-
- inferior_pid = pid;
-
- retval = read_register (regno);
-
- inferior_pid = save_pid;
-
- return retval;
-}
-
-/* Store VALUE, into the raw contents of register number REGNO.
- This should probably write a LONGEST rather than a CORE_ADDR */
-
-void
-write_register (regno, val)
- int regno;
- LONGEST val;
+signed_pointer_to_address (struct type *type, void *buf)
{
- PTR buf;
- int size;
-
- /* On the sparc, writing %g0 is a no-op, so we don't even want to change
- the registers array if something writes to this register. */
- if (CANNOT_STORE_REGISTER (regno))
- return;
-
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-
- size = REGISTER_RAW_SIZE(regno);
- buf = alloca (size);
- 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]
- && memcmp (&registers[REGISTER_BYTE (regno)], buf, size) == 0)
- return;
-
- target_prepare_to_store ();
-
- memcpy (&registers[REGISTER_BYTE (regno)], buf, size);
-
- register_valid [regno] = 1;
-
- target_store_registers (regno);
+ return extract_signed_integer (buf, TYPE_LENGTH (type));
}
+/* Given an address, store it as a pointer of type TYPE in target
+ format in BUF. */
void
-write_register_pid (regno, val, pid)
- int regno;
- CORE_ADDR val;
- int pid;
+unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
{
- int save_pid;
-
- if (pid == inferior_pid)
- {
- write_register (regno, val);
- return;
- }
-
- save_pid = inferior_pid;
-
- inferior_pid = pid;
-
- write_register (regno, val);
-
- inferior_pid = save_pid;
+ store_address (buf, TYPE_LENGTH (type), addr);
}
-/* Record that register REGNO contains VAL.
- This is used when the value is obtained from the inferior or core dump,
- so there is no need to store the value there.
-
- 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)
- int regno;
- char *val;
+address_to_signed_pointer (struct type *type, void *buf, CORE_ADDR addr)
{
-#if 1
- if (registers_pid != inferior_pid)
- {
- registers_changed ();
- registers_pid = inferior_pid;
- }
-#endif
-
- register_valid[regno] = 1;
- if (val)
- memcpy (&registers[REGISTER_BYTE (regno)], val, REGISTER_RAW_SIZE (regno));
- else
- memset (&registers[REGISTER_BYTE (regno)], '\000', REGISTER_RAW_SIZE (regno));
-
- /* 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)]);
-#endif
-}
-
-
-/* This routine is getting awfully cluttered with #if's. It's probably
- time to turn this into READ_PC and define it in the tm.h file.
- Ditto for write_pc. */
-
-CORE_ADDR
-read_pc_pid (pid)
- int pid;
-{
- int saved_inferior_pid;
- CORE_ADDR pc_val;
-
- /* In case pid != inferior_pid. */
- saved_inferior_pid = inferior_pid;
- inferior_pid = pid;
-
-#ifdef TARGET_READ_PC
- pc_val = TARGET_READ_PC (pid);
-#else
- pc_val = ADDR_BITS_REMOVE ((CORE_ADDR) read_register_pid (PC_REGNUM, pid));
-#endif
-
- inferior_pid = saved_inferior_pid;
- return pc_val;
-}
-
-CORE_ADDR
-read_pc ()
-{
- return read_pc_pid (inferior_pid);
-}
-
-void
-write_pc_pid (pc, pid)
- CORE_ADDR pc;
- int pid;
-{
- int saved_inferior_pid;
-
- /* In case pid != inferior_pid. */
- saved_inferior_pid = inferior_pid;
- inferior_pid = pid;
-
-#ifdef TARGET_WRITE_PC
- TARGET_WRITE_PC (pc, pid);
-#else
- write_register_pid (PC_REGNUM, pc, pid);
-#ifdef NPC_REGNUM
- write_register_pid (NPC_REGNUM, pc + 4, pid);
-#ifdef NNPC_REGNUM
- write_register_pid (NNPC_REGNUM, pc + 8, pid);
-#endif
-#endif
-#endif
-
- inferior_pid = saved_inferior_pid;
-}
-
-void
-write_pc (pc)
- CORE_ADDR pc;
-{
- write_pc_pid (pc, inferior_pid);
-}
-
-/* Cope with strage ways of getting to the stack and frame pointers */
-
-CORE_ADDR
-read_sp ()
-{
-#ifdef TARGET_READ_SP
- return TARGET_READ_SP ();
-#else
- return read_register (SP_REGNUM);
-#endif
-}
-
-void
-write_sp (val)
- CORE_ADDR val;
-{
-#ifdef TARGET_WRITE_SP
- TARGET_WRITE_SP (val);
-#else
- write_register (SP_REGNUM, val);
-#endif
-}
-
-CORE_ADDR
-read_fp ()
-{
-#ifdef TARGET_READ_FP
- return TARGET_READ_FP ();
-#else
- return read_register (FP_REGNUM);
-#endif
-}
-
-void
-write_fp (val)
- CORE_ADDR val;
-{
-#ifdef TARGET_WRITE_FP
- TARGET_WRITE_FP (val);
-#else
- write_register (FP_REGNUM, val);
-#endif
+ store_signed_integer (buf, TYPE_LENGTH (type), addr);
}
/* Will calling read_var_value or locate_var_value on SYM end
up caring what frame it is being evaluated relative to? SYM must
be non-NULL. */
int
-symbol_read_needs_frame (sym)
- struct symbol *sym;
+symbol_read_needs_frame (struct symbol *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:
@@ -1142,8 +389,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:
@@ -1160,12 +407,10 @@ symbol_read_needs_frame (sym)
If the variable cannot be found, return a zero pointer.
If FRAME is NULL, use the selected_frame. */
-value_ptr
-read_var_value (var, frame)
- register struct symbol *var;
- struct frame_info *frame;
+struct value *
+read_var_value (register struct symbol *var, struct frame_info *frame)
{
- register value_ptr v;
+ register struct value *v;
struct type *type = SYMBOL_TYPE (var);
CORE_ADDR addr;
register int len;
@@ -1176,7 +421,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))
{
@@ -1190,12 +436,15 @@ 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)));
+ {
+ CORE_ADDR addr
+ = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+ SYMBOL_BFD_SECTION (var));
+ store_typed_address (VALUE_CONTENTS_RAW (v), type, addr);
+ }
else
- store_address (VALUE_CONTENTS_RAW (v), len,
- (LONGEST)SYMBOL_VALUE_ADDRESS (var));
+ store_typed_address (VALUE_CONTENTS_RAW (v), type,
+ SYMBOL_VALUE_ADDRESS (var));
VALUE_LVAL (v) = not_lval;
return v;
@@ -1217,18 +466,21 @@ read_var_value (var, frame)
break;
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. */
- if (!target_has_execution)
- error ("\
+ {
+ /* 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. */
+ CORE_ADDR locaddr;
+ struct value *loc;
+ if (!target_has_execution)
+ 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);
- break;
+
+ locaddr = SYMBOL_VALUE_ADDRESS (var);
+ loc = value_at (lookup_pointer_type (type), locaddr, NULL);
+ addr = value_as_address (loc);
+ }
case LOC_ARG:
if (frame == NULL)
@@ -1240,15 +492,19 @@ addresses have not been bound by the dynamic loader. Try again when executable i
break;
case LOC_REF_ARG:
- if (frame == NULL)
- return 0;
- addr = FRAME_ARGS_ADDRESS (frame);
- if (!addr)
- return 0;
- addr += SYMBOL_VALUE (var);
- addr = read_memory_unsigned_integer
- (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
- break;
+ {
+ struct value *ref;
+ CORE_ADDR argref;
+ if (frame == NULL)
+ return 0;
+ argref = FRAME_ARGS_ADDRESS (frame);
+ if (!argref)
+ return 0;
+ argref += SYMBOL_VALUE (var);
+ ref = value_at (lookup_pointer_type (type), argref, NULL);
+ addr = value_as_address (ref);
+ break;
+ }
case LOC_LOCAL:
case LOC_LOCAL_ARG:
@@ -1260,33 +516,26 @@ addresses have not been bound by the dynamic loader. Try again when executable i
case LOC_BASEREG:
case LOC_BASEREG_ARG:
+ case LOC_THREAD_LOCAL_STATIC:
{
- 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)));
+ struct value *regval;
+
+ regval = value_from_register (lookup_pointer_type (type),
+ SYMBOL_BASEREG (var), frame);
+ if (regval == NULL)
+ error ("Value of base register not available.");
+ addr = value_as_address (regval);
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),
- NULL);
- 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));
@@ -1298,7 +547,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
{
struct block *b;
int regno = SYMBOL_VALUE (var);
- value_ptr regval;
+ struct value *regval;
if (frame == NULL)
return 0;
@@ -1307,13 +556,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_address (regval);
VALUE_LVAL (v) = lval_memory;
}
else
@@ -1358,21 +607,18 @@ addresses have not been bound by the dynamic loader. Try again when executable i
}
/* Return a value of type TYPE, stored in register REGNUM, in frame
- FRAME.
+ FRAME.
NOTE: returns NULL if register value is not available.
Caller will check return value or die! */
-value_ptr
-value_from_register (type, regnum, frame)
- struct type *type;
- int regnum;
- struct frame_info *frame;
+struct value *
+value_from_register (struct type *type, int regnum, struct frame_info *frame)
{
- char raw_buffer [MAX_REGISTER_RAW_SIZE];
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
CORE_ADDR addr;
int optim;
- value_ptr v = allocate_value (type);
+ struct value *v = allocate_value (type);
char *value_bytes = 0;
int value_bytes_copied = 0;
int num_storage_locs;
@@ -1392,10 +638,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;
@@ -1421,13 +667,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;
}
@@ -1440,7 +691,7 @@ value_from_register (type, regnum, frame)
page_regnum,
&lval);
- if (register_valid[page_regnum] == -1)
+ if (register_cached (page_regnum) == -1)
return NULL; /* register value not available */
if (lval == lval_register)
@@ -1457,7 +708,7 @@ value_from_register (type, regnum, frame)
regnum,
&lval);
- if (register_valid[regnum] == -1)
+ if (register_cached (regnum) == -1)
return NULL; /* register value not available */
if (lval == lval_register)
@@ -1470,7 +721,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),
@@ -1483,8 +734,8 @@ value_from_register (type, regnum, frame)
local_regnum,
&lval);
- if (register_valid[local_regnum] == -1)
- return NULL; /* register value not available */
+ if (register_cached (local_regnum) == -1)
+ return NULL; /* register value not available */
if (regnum == local_regnum)
first_addr = addr;
@@ -1493,7 +744,7 @@ value_from_register (type, regnum, frame)
else
{
mem_stor++;
-
+
mem_tracking =
(mem_tracking
&& (regnum == local_regnum
@@ -1522,14 +773,15 @@ value_from_register (type, regnum, frame)
VALUE_ADDRESS (v) = first_addr;
}
else
- fatal ("value_from_register: Value not stored anywhere!");
+ internal_error (__FILE__, __LINE__,
+ "value_from_register: Value not stored anywhere!");
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);
@@ -1537,7 +789,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;
}
@@ -1548,35 +800,33 @@ 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 */
+ if (register_cached (regnum) == -1)
+ 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. */
-
-#ifdef REGISTER_CONVERTIBLE
+
if (REGISTER_CONVERTIBLE (regnum))
{
REGISTER_CONVERT_TO_VIRTUAL (regnum, type,
raw_buffer, VALUE_CONTENTS_RAW (v));
}
else
-#endif
{
/* Raw and virtual formats are the same for this register. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN && len < REGISTER_RAW_SIZE (regnum))
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && 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;
}
@@ -1585,14 +835,12 @@ value_from_register (type, regnum, frame)
return a (pointer to a) struct value containing the properly typed
address. */
-value_ptr
-locate_var_value (var, frame)
- register struct symbol *var;
- struct frame_info *frame;
+struct value *
+locate_var_value (register struct symbol *var, struct frame_info *frame)
{
CORE_ADDR addr = 0;
struct type *type = SYMBOL_TYPE (var);
- value_ptr lazy_value;
+ struct value *lazy_value;
/* Evaluate it first; if the result is a memory address, we're fine.
Lazy evaluation pays off here. */
@@ -1604,21 +852,33 @@ locate_var_value (var, frame)
if (VALUE_LAZY (lazy_value)
|| TYPE_CODE (type) == TYPE_CODE_FUNC)
{
- value_ptr val;
+ struct value *val;
addr = VALUE_ADDRESS (lazy_value);
- val = value_from_longest (lookup_pointer_type (type), (LONGEST) addr);
+ val = value_from_pointer (lookup_pointer_type (type), 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:
+ gdb_assert (REGISTER_NAME (VALUE_REGNO (lazy_value)) != NULL
+ && *REGISTER_NAME (VALUE_REGNO (lazy_value)) != '\0');
+ error("Address requested for identifier "
+ "\"%s\" which is in register $%s",
+ SYMBOL_SOURCE_NAME (var),
+ REGISTER_NAME (VALUE_REGNO (lazy_value)));
+ break;
+
case lval_reg_frame_relative:
- error ("Address requested for identifier \"%s\" which is in a register.",
- SYMBOL_SOURCE_NAME (var));
+ gdb_assert (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != NULL
+ && *REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != '\0');
+ error("Address requested for identifier "
+ "\"%s\" which is in frame register $%s",
+ SYMBOL_SOURCE_NAME (var),
+ REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
break;
default:
@@ -1626,5 +886,5 @@ locate_var_value (var, frame)
SYMBOL_SOURCE_NAME (var));
break;
}
- return 0; /* For lint -- never reached */
+ return 0; /* For lint -- never reached */
}
diff --git a/contrib/gdb/gdb/fork-child.c b/contrib/gdb/gdb/fork-child.c
index f3504bc..aacd53c 100644
--- a/contrib/gdb/gdb/fork-child.c
+++ b/contrib/gdb/gdb/fork-child.c
@@ -1,39 +1,38 @@
/* Fork a Unix child process, and set up to debug it, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2001 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"
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "target.h"
-#include "wait.h"
+#include "gdb_wait.h"
+#include "gdb_vfork.h"
#include "gdbcore.h"
#include "terminal.h"
#include "gdbthread.h"
+#include "command.h" /* for dont_repeat () */
#include <signal.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#define DEBUGGING 0
/* This just gets used as a default if we can't find SHELL */
#ifndef SHELL_FILE
@@ -49,17 +48,10 @@ extern char **environ;
* the four arguments "a", "b", "c", "d".
*/
static void
-breakup_args (
- scratch,
- argv)
- char *scratch;
- char **argv;
+breakup_args (char *scratch, char **argv)
{
char *cp = scratch;
-#if DEBUGGING
- printf ("breakup_args: input = %s\n", scratch);
-#endif
for (;;)
{
@@ -97,22 +89,19 @@ breakup_args (
}
-/* Start an inferior Unix child process and sets inferior_pid to its pid.
+/* Start an inferior Unix child process and sets inferior_ptid to its pid.
EXEC_FILE is the file to run.
ALLARGS is a string containing the arguments to the program.
ENV is the environment vector to pass. SHELL_FILE is the shell file,
or NULL if we should pick one. Errors reported with error(). */
+/* This function is NOT-REENTRANT. Some of the variables have been
+ made static to ensure that they survive the vfork() call. */
+
void
-fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
- pre_trace_fun, shell_file)
- char *exec_file;
- char *allargs;
- char **env;
- void (*traceme_fun) PARAMS ((void));
- void (*init_trace_fun) PARAMS ((int));
- void (*pre_trace_fun) PARAMS ((void));
- char *shell_file;
+fork_inferior (char *exec_file_arg, char *allargs, char **env,
+ void (*traceme_fun) (void), void (*init_trace_fun) (int),
+ void (*pre_trace_fun) (void), char *shell_file_arg)
{
int pid;
char *shell_command;
@@ -123,13 +112,15 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
/* This is set to the result of setpgrp, which if vforked, will be visible
to you in the parent process. It's only used by humans for debugging. */
static int debug_setpgrp = 657473;
+ static char *shell_file;
+ static char *exec_file;
char **save_our_env;
int shell = 0;
- char **argv;
- char *tryname;
+ static char **argv;
/* If no exec file handed to us, get it from the exec-file command -- with
a good, common error message if none is specified. */
+ exec_file = exec_file_arg;
if (exec_file == 0)
exec_file = get_exec_file (1);
@@ -137,6 +128,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
* If 0, we'll just do a fork/exec, no shell, so don't
* bother figuring out what shell.
*/
+ shell_file = shell_file_arg;
if (STARTUP_WITH_SHELL)
{
/* Figure out what shell to start up the user program under. */
@@ -147,14 +139,10 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
shell = 1;
}
-#if DEBUGGING
- printf ("shell is %s\n", shell_file);
-#endif
-
/* 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
@@ -169,14 +157,6 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
{
/* We're going to call execvp. Create argv */
/* Largest case: every other character is a separate arg */
-#if DEBUGGING
- printf ("allocating argv, length = %d\n",
- (
- (strlen (allargs) + 1) / (unsigned) 2
- + 2
- ) * sizeof (*argv)
- );
-#endif
argv = (char **) xmalloc (((strlen (allargs) + 1) / (unsigned) 2 + 2) * sizeof (*argv));
argv[0] = exec_file;
breakup_args (allargs, &argv[1]);
@@ -195,14 +175,15 @@ 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)
{
switch (*p)
{
case '\'':
+ case '!':
case '"':
case '(':
case ')':
@@ -234,6 +215,8 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
{
if (*p == '\'')
strcat (shell_command, "'\\''");
+ else if (*p == '!')
+ strcat (shell_command, "\\!");
else
strncat (shell_command, p, 1);
}
@@ -268,19 +251,18 @@ 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) ();
-#if defined(USG) && !defined(HAVE_VFORK)
- pid = fork ();
-#else
+ /* Create the child process. Note that the apparent call to vfork()
+ below *might* actually be a call to fork() due to the fact that
+ autoconf will ``#define vfork fork'' on certain platforms. */
if (debug_fork)
pid = fork ();
else
pid = vfork ();
-#endif
if (pid < 0)
perror_with_name ("vfork");
@@ -296,15 +278,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) ();
@@ -318,10 +300,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,
@@ -334,16 +316,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
*/
if (shell)
{
-#if 0
-
- /* HP change is problematic. The -f option has different meanings
- for different shells. It is particularly inappropriate for
- bourne shells. */
- execlp (shell_file, shell_file, "-f", "-c", shell_command, (char *) 0);
-#else
execlp (shell_file, shell_file, "-c", shell_command, (char *) 0);
-#endif
-
/* If we get here, it's an error */
fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,
@@ -356,16 +329,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
/* Otherwise, we directly exec the target program with execvp. */
int i;
char *errstring;
-#if DEBUGGING
- printf ("about to exec target, exec_file = %s\n", exec_file);
- i = 0;
- while (argv[i] != NULL)
- {
- printf ("strlen(argv[%d]) is %d\n", i, strlen (argv[i]));
- printf ("argv[%d] is %s\n", i, argv[i]);
- i++;
- }
-#endif
+
execvp (exec_file, argv);
/* If we get here, it's an error */
@@ -382,8 +346,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);
}
@@ -394,7 +358,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
init_thread_list ();
- inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
+ inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior stuff below */
/* Now that we have a child process, make it our target, and
initialize anything target-vector-specific that needs initializing. */
@@ -405,7 +369,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
correct program, and are poised at the first instruction of the
new program. */
- /* Allow target dependant code to play with the new process. This might be
+ /* Allow target dependent code to play with the new process. This might be
used to have target-specific code initialize a variable in the new process
prior to executing the first instruction. */
TARGET_CREATE_INFERIOR_HOOK (pid);
@@ -423,14 +387,10 @@ 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;
- int *followed_child;
+clone_and_follow_inferior (int child_pid, int *followed_child)
{
- extern int auto_solib_add;
-
int debugger_pid;
int status;
char pid_spelling[100]; /* Arbitrary but sufficient length. */
@@ -441,7 +401,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] */
@@ -459,33 +419,31 @@ 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");
- /* Clone the debugger. */
-#if defined(USG) && !defined(HAVE_VFORK)
- debugger_pid = fork ();
-#else
+ /* Clone the debugger. Note that the apparent call to vfork()
+ below *might* actually be a call to fork() due to the fact that
+ autoconf will ``#define vfork fork'' on certain platforms. */
if (debug_fork)
debugger_pid = fork ();
else
debugger_pid = vfork ();
-#endif
if (debugger_pid < 0)
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);
@@ -505,21 +463,21 @@ clone_and_follow_inferior (child_pid, followed_child)
sleep (debug_fork);
/* The child (i.e., the cloned debugger) must now attach to
- CHILD_PID. inferior_pid is presently set to the parent process
+ CHILD_PID. inferior_ptid is presently set to the parent process
of the fork, while CHILD_PID should be the child process of the
fork.
Wait until the original debugger relinquishes control of CHILD_PID,
though.
- */
+ */
read (handoff_semaphore[SEM_LISTEN], &listen_value, sizeof (listen_value));
- /* Note that we DON'T want to actually detach from inferior_pid,
+ /* Note that we DON'T want to actually detach from inferior_ptid,
because that would allow it to run free. The original
debugger wants to retain control of the process. So, we
- just reset inferior_pid to CHILD_PID, and then ensure that all
+ just reset inferior_ptid to CHILD_PID, and then ensure that all
breakpoints are really set in CHILD_PID.
- */
+ */
target_mourn_inferior ();
/* Ask the tty subsystem to switch to the one we specified earlier
@@ -535,7 +493,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;
@@ -549,8 +507,7 @@ clone_and_follow_inferior (child_pid, followed_child)
/* Accept NTRAPS traps from the inferior. */
void
-startup_inferior (ntraps)
- int ntraps;
+startup_inferior (int ntraps)
{
int pending_execs = ntraps;
int terminal_initted;
@@ -591,11 +548,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. */
diff --git a/contrib/gdb/gdb/frame.c b/contrib/gdb/gdb/frame.c
new file mode 100644
index 0000000..ea59eba
--- /dev/null
+++ b/contrib/gdb/gdb/frame.c
@@ -0,0 +1,225 @@
+/* Cache and manage the values of registers for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "target.h"
+#include "value.h"
+#include "inferior.h" /* for inferior_ptid */
+#include "regcache.h"
+
+/* FIND_SAVED_REGISTER ()
+
+ Return the address in which frame FRAME's value of register REGNUM
+ has been saved in memory. Or return zero if it has not been saved.
+ If REGNUM specifies the SP, the value we return is actually
+ the SP value, not an address where it was saved. */
+
+CORE_ADDR
+find_saved_register (struct frame_info *frame, int regnum)
+{
+ register struct frame_info *frame1 = NULL;
+ register CORE_ADDR addr = 0;
+
+ if (frame == NULL) /* No regs saved if want current frame */
+ return 0;
+
+#ifdef HAVE_REGISTER_WINDOWS
+ /* We assume that a register in a register window will only be saved
+ in one place (since the name changes and/or disappears as you go
+ towards inner frames), so we only call get_frame_saved_regs on
+ the current frame. This is directly in contradiction to the
+ usage below, which assumes that registers used in a frame must be
+ saved in a lower (more interior) frame. This change is a result
+ of working on a register window machine; get_frame_saved_regs
+ always returns the registers saved within a frame, within the
+ context (register namespace) of that frame. */
+
+ /* However, note that we don't want this to return anything if
+ nothing is saved (if there's a frame inside of this one). Also,
+ callers to this routine asking for the stack pointer want the
+ stack pointer saved for *this* frame; this is returned from the
+ next frame. */
+
+ if (REGISTER_IN_WINDOW_P (regnum))
+ {
+ frame1 = get_next_frame (frame);
+ if (!frame1)
+ return 0; /* Registers of this frame are active. */
+
+ /* Get the SP from the next frame in; it will be this
+ current frame. */
+ if (regnum != SP_REGNUM)
+ frame1 = frame;
+
+ FRAME_INIT_SAVED_REGS (frame1);
+ return frame1->saved_regs[regnum]; /* ... which might be zero */
+ }
+#endif /* HAVE_REGISTER_WINDOWS */
+
+ /* Note that this next routine assumes that registers used in
+ frame x will be saved only in the frame that x calls and
+ frames interior to it. This is not true on the sparc, but the
+ above macro takes care of it, so we should be all right. */
+ while (1)
+ {
+ QUIT;
+ frame1 = get_prev_frame (frame1);
+ if (frame1 == 0 || frame1 == frame)
+ break;
+ FRAME_INIT_SAVED_REGS (frame1);
+ if (frame1->saved_regs[regnum])
+ addr = frame1->saved_regs[regnum];
+ }
+
+ return addr;
+}
+
+/* DEFAULT_GET_SAVED_REGISTER ()
+
+ Find register number REGNUM relative to FRAME and put its (raw,
+ target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
+ variable was optimized out (and thus can't be fetched). Set *LVAL
+ to lval_memory, lval_register, or not_lval, depending on whether
+ the value was fetched from memory, from a register, or in a strange
+ and non-modifiable way (e.g. a frame pointer which was calculated
+ rather than fetched). Set *ADDRP to the address, either in memory
+ on as a REGISTER_BYTE offset into the registers array.
+
+ Note that this implementation never sets *LVAL to not_lval. But
+ it can be replaced by defining GET_SAVED_REGISTER and supplying
+ your own.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+
+static void
+default_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval)
+{
+ CORE_ADDR addr;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+ addr = find_saved_register (frame, regnum);
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ (LONGEST) addr);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+ if (raw_buffer != NULL)
+ target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ if (lval != NULL)
+ *lval = lval_register;
+ addr = REGISTER_BYTE (regnum);
+ if (raw_buffer != NULL)
+ read_register_gen (regnum, raw_buffer);
+ }
+ if (addrp != NULL)
+ *addrp = addr;
+}
+
+#if !defined (GET_SAVED_REGISTER)
+#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
+ default_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
+#endif
+
+void
+get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval)
+{
+ GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
+}
+
+/* READ_RELATIVE_REGISTER_RAW_BYTES_FOR_FRAME
+
+ Copy the bytes of register REGNUM, relative to the input stack frame,
+ into our memory at MYADDR, in target byte order.
+ The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
+
+ Returns 1 if could not be read, 0 if could. */
+
+/* FIXME: This function increases the confusion between FP_REGNUM
+ and the virtual/pseudo-frame pointer. */
+
+static int
+read_relative_register_raw_bytes_for_frame (int regnum,
+ char *myaddr,
+ struct frame_info *frame)
+{
+ int optim;
+ if (regnum == FP_REGNUM && frame)
+ {
+ /* Put it back in target format. */
+ 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);
+
+ if (register_cached (regnum) < 0)
+ return 1; /* register value not available */
+
+ return optim;
+}
+
+/* READ_RELATIVE_REGISTER_RAW_BYTES
+
+ Copy the bytes of register REGNUM, relative to the current stack
+ frame, into our memory at MYADDR, in target byte order.
+ The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
+
+ Returns 1 if could not be read, 0 if could. */
+
+int
+read_relative_register_raw_bytes (int regnum, char *myaddr)
+{
+ return read_relative_register_raw_bytes_for_frame (regnum, myaddr,
+ selected_frame);
+}
diff --git a/contrib/gdb/gdb/frame.h b/contrib/gdb/gdb/frame.h
index 6836c6c..b5f535a 100644
--- a/contrib/gdb/gdb/frame.h
+++ b/contrib/gdb/gdb/frame.h
@@ -1,21 +1,23 @@
/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
- Copyright 1986, 1989, 1991, 1992, 1999 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
+ 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -26,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* XXXX - deprecated */
struct frame_saved_regs
{
+ /* For each register R (except the SP), regs[R] is the address at
+ which it was saved on entry to the frame, or zero if it was not
+ saved on entry to this frame. This includes special registers
+ such as pc and fp saved in special ways in the stack frame.
- /* For each register, address of where it was saved on entry to
- the frame, or zero if it was not saved on entry to this frame.
- This includes special registers such as pc and fp saved in
- special ways in the stack frame. The SP_REGNUM is even more
- special, the address here is the sp for the next frame, not the
- address where the sp was saved. */
+ regs[SP_REGNUM] is different. It holds the actual SP, not the
+ address at which it was saved. */
CORE_ADDR regs[NUM_REGS];
};
@@ -42,7 +44,7 @@ struct frame_saved_regs
frame_info". The innermost one gets allocated (in
wait_for_inferior) each time the inferior stops; current_frame
points to it. Additional frames get allocated (in
- get_prev_frame_info) as needed, and are chained through the next
+ get_prev_frame) as needed, and are chained through the next
and prev fields. Any time that the frame cache becomes invalid
(most notably when we execute something, but also if we change how
we interpret the frames (e.g. "set heuristic-fence-post" in
@@ -66,7 +68,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;
@@ -75,17 +77,17 @@ struct frame_info
the frame, or zero if it was not saved on entry to this frame.
This includes special registers such as pc and fp saved in
special ways in the stack frame. The SP_REGNUM is even more
- special, the address here is the sp for the next frame, not the
- address where the sp was saved. */
+ special, the address here is the sp for the previous frame, not
+ the 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 + NUM_PSEUDO_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
@@ -94,33 +96,45 @@ struct frame_info
initialized by INIT_EXTRA_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;
- };
+ /* If dwarf2 unwind frame informations is used, this structure holds all
+ related unwind data. */
+ struct unwind_contect *context;
-/* Allocate additional space for appendices to a struct frame_info. */
+ /* Pointers to the next (down, inner) and previous (up, outer)
+ frame_info's in the frame cache. */
+ struct frame_info *next; /* down, inner */
+ struct frame_info *prev; /* up, outer */
+ };
-#ifndef SIZEOF_FRAME_SAVED_REGS
-#define SIZEOF_FRAME_SAVED_REGS (sizeof (CORE_ADDR) * (NUM_REGS))
-#endif
-extern void *frame_obstack_alloc PARAMS ((unsigned long size));
-extern void frame_saved_regs_zalloc PARAMS ((struct frame_info *));
+/* Values for the source flag to be used in print_frame_info_base(). */
+enum print_what
+ {
+ /* Print only the source line, like in stepi. */
+ SRC_LINE = -1,
+ /* Print only the location, i.e. level, address (sometimes)
+ function, args, file, line, line num. */
+ LOCATION,
+ /* Print both of the above. */
+ SRC_AND_LOC,
+ /* Print location only, but always include the address. */
+ LOC_AND_ADDRESS
+ };
-/* Dummy frame. This saves the processor state just prior to setting up the
- inferior function call. On most targets, the registers are saved on the
- target stack, but that really slows down function calls. */
+/* Allocate additional space for appendices to a struct frame_info.
+ NOTE: Much of GDB's code works on the assumption that the allocated
+ saved_regs[] array is the size specified below. If you try to make
+ that array smaller, GDB will happily walk off its end. */
-struct dummy_frame
-{
- struct dummy_frame *next;
+#ifdef SIZEOF_FRAME_SAVED_REGS
+#error "SIZEOF_FRAME_SAVED_REGS can not be re-defined"
+#endif
+#define SIZEOF_FRAME_SAVED_REGS \
+ (sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS))
- CORE_ADDR pc;
- CORE_ADDR fp;
- CORE_ADDR sp;
- char regs[REGISTER_BYTES];
-};
+extern void *frame_obstack_alloc (unsigned long size);
+extern void frame_saved_regs_zalloc (struct frame_info *);
-/* Return the frame address from FR. Except in the machine-dependent
+/* Return the frame address from FI. Except in the machine-dependent
*FRAME* macros, a frame address has no defined meaning other than
as a magic cookie which identifies a frame over calls to the
inferior. The only known exception is inferior.h
@@ -138,27 +152,16 @@ struct dummy_frame
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
- If a particular target needs a different definition, then it can override
- the definition here by providing one in the tm file.
-
XXXX - both default and alternate frame_chain_valid functions are
- deprecated. New code should use generic dummy frames. */
-
-extern int default_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
-extern int alternate_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
-extern int nonnull_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
-extern int generic_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
-
-#if !defined (FRAME_CHAIN_VALID)
-#if !defined (FRAME_CHAIN_VALID_ALTERNATE)
-#define FRAME_CHAIN_VALID(chain, thisframe) default_frame_chain_valid (chain, thisframe)
-#else
-/* 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. */
-#define FRAME_CHAIN_VALID(chain, thisframe) alternate_frame_chain_valid (chain,thisframe)
-#endif /* FRAME_CHAIN_VALID_ALTERNATE */
-#endif /* FRAME_CHAIN_VALID */
+ deprecated. New code should use dummy frames and one of the
+ generic functions. */
+
+extern int file_frame_chain_valid (CORE_ADDR, struct frame_info *);
+extern int func_frame_chain_valid (CORE_ADDR, struct frame_info *);
+extern int nonnull_frame_chain_valid (CORE_ADDR, struct frame_info *);
+extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *);
+extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *);
+extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
/* 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,94 +174,99 @@ extern struct frame_info *selected_frame;
extern int selected_frame_level;
-extern struct frame_info *get_prev_frame_info PARAMS ((struct frame_info *));
+extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR);
-extern struct frame_info *create_new_frame PARAMS ((CORE_ADDR, CORE_ADDR));
+extern void flush_cached_frames (void);
-extern void flush_cached_frames PARAMS ((void));
-
-extern void reinit_frame_cache PARAMS ((void));
+extern void reinit_frame_cache (void);
#ifdef FRAME_FIND_SAVED_REGS
/* XXX - deprecated */
#define FRAME_INIT_SAVED_REGS(FI) get_frame_saved_regs (FI, NULL)
-extern void get_frame_saved_regs PARAMS ((struct frame_info *,
- struct frame_saved_regs *));
+extern void get_frame_saved_regs (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 *));
+extern void set_current_frame (struct frame_info *);
-extern struct frame_info *get_current_frame PARAMS ((void));
+extern struct frame_info *get_prev_frame (struct frame_info *);
-extern struct frame_info *get_next_frame PARAMS ((struct frame_info *));
+extern struct frame_info *get_current_frame (void);
-extern struct block *get_frame_block PARAMS ((struct frame_info *));
+extern struct frame_info *get_next_frame (struct frame_info *);
-extern struct block *get_current_block PARAMS ((void));
+extern struct block *get_frame_block (struct frame_info *);
-extern struct block *get_selected_block PARAMS ((void));
+extern struct block *get_current_block (void);
-extern struct symbol *get_frame_function PARAMS ((struct frame_info *));
+extern struct block *get_selected_block (void);
-extern CORE_ADDR get_frame_pc PARAMS ((struct frame_info *));
+extern struct symbol *get_frame_function (struct frame_info *);
-extern CORE_ADDR get_pc_function_start PARAMS ((CORE_ADDR));
+extern CORE_ADDR get_frame_pc (struct frame_info *);
-extern struct block * block_for_pc PARAMS ((CORE_ADDR));
+extern CORE_ADDR get_pc_function_start (CORE_ADDR);
-extern struct block * block_for_pc_sect PARAMS ((CORE_ADDR, asection *));
+extern struct block *block_for_pc (CORE_ADDR);
-extern int frameless_look_for_prologue PARAMS ((struct frame_info *));
+extern struct block *block_for_pc_sect (CORE_ADDR, asection *);
-extern void print_frame_args PARAMS ((struct symbol *, struct frame_info *,
- int, GDB_FILE *));
+extern int frameless_look_for_prologue (struct frame_info *);
-extern struct frame_info *find_relative_frame PARAMS ((struct frame_info *, int*));
+extern void print_frame_args (struct symbol *, struct frame_info *,
+ int, struct ui_file *);
-extern void print_stack_frame PARAMS ((struct frame_info *, int, int));
+extern struct frame_info *find_relative_frame (struct frame_info *, int *);
-extern void print_only_stack_frame PARAMS ((struct frame_info *, int, int));
+extern void show_and_print_stack_frame (struct frame_info *fi, int level,
+ int source);
-extern void show_stack_frame PARAMS ((struct frame_info *));
+extern void print_stack_frame (struct frame_info *, int, int);
-extern void select_frame PARAMS ((struct frame_info *, int));
+extern void print_only_stack_frame (struct frame_info *, int, int);
-extern void record_selected_frame PARAMS ((CORE_ADDR *, int *));
+extern void show_stack_frame (struct frame_info *);
-extern void select_and_print_frame PARAMS ((struct frame_info *, int));
+extern void select_frame (struct frame_info *, int);
-extern void print_frame_info PARAMS ((struct frame_info *, int, int, int));
+extern void record_selected_frame (CORE_ADDR *, int *);
-extern void show_frame_info PARAMS ((struct frame_info *, int, int, int));
+extern void select_and_print_frame (struct frame_info *, int);
-extern CORE_ADDR find_saved_register PARAMS ((struct frame_info *, int));
+extern void print_frame_info (struct frame_info *, int, int, int);
-extern struct frame_info *block_innermost_frame PARAMS ((struct block *));
+extern void show_frame_info (struct frame_info *, int, int, int);
-extern struct frame_info *find_frame_addr_in_frame_chain PARAMS ((CORE_ADDR));
+extern CORE_ADDR find_saved_register (struct frame_info *, int);
-extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
+extern struct frame_info *block_innermost_frame (struct block *);
-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 struct frame_info *find_frame_addr_in_frame_chain (CORE_ADDR);
-extern int generic_pc_in_call_dummy PARAMS ((CORE_ADDR pc,
- CORE_ADDR fp));
-extern char * generic_find_dummy_frame PARAMS ((CORE_ADDR pc,
- CORE_ADDR fp));
+extern CORE_ADDR sigtramp_saved_pc (struct frame_info *);
-#ifdef __GNUC__
-/* 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 *));
-#endif
+extern CORE_ADDR generic_read_register_dummy (CORE_ADDR pc,
+ CORE_ADDR fp, int);
+extern void generic_push_dummy_frame (void);
+extern void generic_pop_current_frame (void (*)(struct frame_info *));
+extern void generic_pop_dummy_frame (void);
+
+extern int generic_pc_in_call_dummy (CORE_ADDR pc,
+ CORE_ADDR sp, CORE_ADDR fp);
+extern char *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
+
+extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
+ int nargs, struct value **args,
+ struct type *type, int gcc_p);
+
+extern void generic_get_saved_register (char *, int *, CORE_ADDR *,
+ struct frame_info *, int,
+ enum lval_type *);
+
+extern void get_saved_register (char *raw_buffer, int *optimized,
+ CORE_ADDR * addrp,
+ struct frame_info *frame,
+ int regnum, enum lval_type *lval);
#endif /* !defined (FRAME_H) */
diff --git a/contrib/gdb/gdb/gcore.c b/contrib/gdb/gdb/gcore.c
new file mode 100644
index 0000000..494efad
--- /dev/null
+++ b/contrib/gdb/gdb/gcore.c
@@ -0,0 +1,497 @@
+/* Generate a core file for the inferior process.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "cli/cli-decode.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "elf-bfd.h"
+#include <sys/procfs.h>
+#include "symfile.h"
+#include "objfiles.h"
+
+static char *default_gcore_target (void);
+static enum bfd_architecture default_gcore_arch (void);
+static unsigned long default_gcore_mach (void);
+static int gcore_memory_sections (bfd *);
+
+/* Function: gcore_command
+ Generate a core file from the inferior process. */
+
+static void
+gcore_command (char *args, int from_tty)
+{
+ struct cleanup *old_chain;
+ char *corefilename, corefilename_buffer[40];
+ asection *note_sec = NULL;
+ bfd *obfd;
+ void *note_data = NULL;
+ int note_size = 0;
+
+ /* No use generating a corefile without a target process. */
+ if (!(target_has_execution))
+ noprocess ();
+
+ if (args && *args)
+ corefilename = args;
+ else
+ {
+ /* Default corefile name is "core.PID". */
+ sprintf (corefilename_buffer, "core.%d", PIDGET (inferior_ptid));
+ corefilename = corefilename_buffer;
+ }
+
+ if (info_verbose)
+ fprintf_filtered (gdb_stdout,
+ "Opening corefile '%s' for output.\n", corefilename);
+
+ /* Open the output file. */
+ if (!(obfd = bfd_openw (corefilename, default_gcore_target ())))
+ {
+ error ("Failed to open '%s' for output.", corefilename);
+ }
+
+ /* Need a cleanup that will close the file (FIXME: delete it?). */
+ old_chain = make_cleanup_bfd_close (obfd);
+
+ bfd_set_format (obfd, bfd_core);
+ bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
+
+ /* An external target method must build the notes section. */
+ note_data = (char *) target_make_corefile_notes (obfd, &note_size);
+
+ /* Create the note section. */
+ if (note_data != NULL && note_size != 0)
+ {
+ if ((note_sec = bfd_make_section_anyway (obfd, "note0")) == NULL)
+ error ("Failed to create 'note' section for corefile: %s",
+ bfd_errmsg (bfd_get_error ()));
+
+ bfd_set_section_vma (obfd, note_sec, 0);
+ bfd_set_section_flags (obfd, note_sec,
+ SEC_HAS_CONTENTS | SEC_READONLY | SEC_ALLOC);
+ bfd_set_section_alignment (obfd, note_sec, 0);
+ bfd_set_section_size (obfd, note_sec, note_size);
+ }
+
+ /* Now create the memory/load sections. */
+ if (gcore_memory_sections (obfd) == 0)
+ error ("gcore: failed to get corefile memory sections from target.");
+
+ /* Write out the contents of the note section. */
+ if (note_data != NULL && note_size != 0)
+ {
+ if (!bfd_set_section_contents (obfd, note_sec, note_data, 0, note_size))
+ {
+ warning ("writing note section (%s)",
+ bfd_errmsg (bfd_get_error ()));
+ }
+ }
+
+ /* Succeeded. */
+ fprintf_filtered (gdb_stdout,
+ "Saved corefile %s\n", corefilename);
+
+ /* Clean-ups will close the output file and free malloc memory. */
+ do_cleanups (old_chain);
+ return;
+}
+
+static unsigned long
+default_gcore_mach (void)
+{
+#if 1 /* See if this even matters... */
+ return 0;
+#else
+#ifdef TARGET_ARCHITECTURE
+ const struct bfd_arch_info * bfdarch = TARGET_ARCHITECTURE;
+
+ if (bfdarch != NULL)
+ return bfdarch->mach;
+#endif /* TARGET_ARCHITECTURE */
+ if (exec_bfd == NULL)
+ error ("Can't find default bfd machine type (need execfile).");
+
+ return bfd_get_mach (exec_bfd);
+#endif /* 1 */
+}
+
+static enum bfd_architecture
+default_gcore_arch (void)
+{
+#ifdef TARGET_ARCHITECTURE
+ const struct bfd_arch_info * bfdarch = TARGET_ARCHITECTURE;
+
+ if (bfdarch != NULL)
+ return bfdarch->arch;
+#endif
+ if (exec_bfd == NULL)
+ error ("Can't find bfd architecture for corefile (need execfile).");
+
+ return bfd_get_arch (exec_bfd);
+}
+
+static char *
+default_gcore_target (void)
+{
+ /* FIXME -- this may only work for ELF targets. */
+ if (exec_bfd == NULL)
+ return NULL;
+ else
+ return bfd_get_target (exec_bfd);
+}
+
+/*
+ * Default method for stack segment (preemptable by target).
+ */
+
+static int (*override_derive_stack_segment) (bfd_vma *, bfd_vma *);
+
+extern void
+preempt_derive_stack_segment (int (*override_func) (bfd_vma *, bfd_vma *))
+{
+ override_derive_stack_segment = override_func;
+}
+
+/* Function: default_derive_stack_segment
+ Derive a reasonable stack segment by unwinding the target stack.
+
+ Returns 0 for failure, 1 for success. */
+
+static int
+default_derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
+{
+ bfd_vma tmp_vma;
+ struct frame_info *fi, *tmp_fi;
+
+ if (bottom == NULL || top == NULL)
+ return 0; /* Paranoia. */
+
+ if (!target_has_stack || !target_has_registers)
+ return 0; /* Can't succeed without stack and registers. */
+
+ if ((fi = get_current_frame ()) == NULL)
+ return 0; /* Can't succeed without current frame. */
+
+ /* Save frame pointer of TOS frame. */
+ *top = fi->frame;
+ /* If current stack pointer is more "inner", use that instead. */
+ if (INNER_THAN (read_sp (), *top))
+ *top = read_sp ();
+
+ /* Find prev-most frame. */
+ while ((tmp_fi = get_prev_frame (fi)) != NULL)
+ fi = tmp_fi;
+
+ /* Save frame pointer of prev-most frame. */
+ *bottom = fi->frame;
+
+ /* Now canonicalize their order, so that 'bottom' is a lower address
+ (as opposed to a lower stack frame). */
+ if (*bottom > *top)
+ {
+ tmp_vma = *top;
+ *top = *bottom;
+ *bottom = tmp_vma;
+ }
+
+ return 1; /* success */
+}
+
+static int
+derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
+{
+ if (override_derive_stack_segment)
+ return override_derive_stack_segment (bottom, top);
+ else
+ return default_derive_stack_segment (bottom, top);
+}
+
+/*
+ * Default method for heap segment (preemptable by target).
+ */
+
+static int (*override_derive_heap_segment) (bfd *, bfd_vma *, bfd_vma *);
+
+extern void
+preempt_derive_heap_segment (int (*override_func) (bfd *,
+ bfd_vma *, bfd_vma *))
+{
+ override_derive_heap_segment = override_func;
+}
+
+/* Function: default_derive_heap_segment
+ Derive a reasonable heap segment by looking at sbrk and
+ the static data sections.
+
+ Returns 0 for failure, 1 for success. */
+
+static int
+default_derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
+{
+ bfd_vma top_of_data_memory = 0;
+ bfd_vma top_of_heap = 0;
+ bfd_size_type sec_size;
+ struct value *zero, *sbrk;
+ bfd_vma sec_vaddr;
+ asection *sec;
+
+ if (bottom == NULL || top == NULL)
+ return 0; /* Paranoia. */
+
+ if (!target_has_execution)
+ return 0; /* This function depends on being able
+ to call a function in the inferior. */
+
+ /* Assumption: link map is arranged as follows (low to high addresses):
+ text sections
+ data sections (including bss)
+ heap
+ */
+
+ for (sec = abfd->sections; sec; sec = sec->next)
+ {
+ if (bfd_get_section_flags (abfd, sec) & SEC_DATA ||
+ strcmp (".bss", bfd_get_section_name (abfd, sec)) == 0)
+ {
+ sec_vaddr = bfd_get_section_vma (abfd, sec);
+ sec_size = bfd_get_section_size_before_reloc (sec);
+ if (sec_vaddr + sec_size > top_of_data_memory)
+ top_of_data_memory = sec_vaddr + sec_size;
+ }
+ }
+ /* Now get the top-of-heap by calling sbrk in the inferior. */
+ if ((sbrk = find_function_in_inferior ("sbrk")) == NULL)
+ return 0;
+ if ((zero = value_from_longest (builtin_type_int, (LONGEST) 0)) == NULL)
+ return 0;
+ if ((sbrk = call_function_by_hand (sbrk, 1, &zero)) == NULL)
+ return 0;
+ top_of_heap = value_as_long (sbrk);
+
+ /* Return results. */
+ if (top_of_heap > top_of_data_memory)
+ {
+ *bottom = top_of_data_memory;
+ *top = top_of_heap;
+ return 1; /* success */
+ }
+ else
+ return 0; /* No additional heap space needs to be saved. */
+}
+
+static int
+derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
+{
+ if (override_derive_heap_segment)
+ return override_derive_heap_segment (abfd, bottom, top);
+ else
+ return default_derive_heap_segment (abfd, bottom, top);
+}
+
+/* ARGSUSED */
+static void
+make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
+{
+ int p_flags = 0;
+ int p_type;
+
+ /* FIXME: these constants may only be applicable for ELF. */
+ if (strncmp (osec->name, "load", 4) == 0)
+ p_type = PT_LOAD;
+ else
+ p_type = PT_NOTE;
+
+ p_flags |= PF_R; /* Segment is readable. */
+ if (!(bfd_get_section_flags (obfd, osec) & SEC_READONLY))
+ p_flags |= PF_W; /* Segment is writable. */
+ if (bfd_get_section_flags (obfd, osec) & SEC_CODE)
+ p_flags |= PF_X; /* Segment is executable. */
+
+ bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0,
+ 0, 0, 1, &osec);
+}
+
+static asection *
+make_mem_sec (bfd *obfd,
+ bfd_vma addr,
+ bfd_size_type size,
+ unsigned int flags,
+ unsigned int alignment)
+{
+ asection *osec;
+
+ if ((osec = bfd_make_section_anyway (obfd, "load")) == NULL)
+ {
+ warning ("Couldn't make gcore segment: %s",
+ bfd_errmsg (bfd_get_error ()));
+ return NULL;
+ }
+
+ if (info_verbose)
+ {
+ fprintf_filtered (gdb_stdout,
+ "Save segment, %lld bytes at 0x%s\n",
+ (long long) size, paddr_nz (addr));
+ }
+
+ bfd_set_section_size (obfd, osec, size);
+ bfd_set_section_vma (obfd, osec, addr);
+ osec->lma = 0; /* FIXME: there should be a macro for this! */
+ bfd_set_section_alignment (obfd, osec, alignment);
+ bfd_set_section_flags (obfd, osec,
+ flags | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS);
+ return osec;
+}
+
+static int
+gcore_create_callback (CORE_ADDR vaddr,
+ unsigned long size,
+ int read, int write, int exec,
+ void *data)
+{
+ flagword flags = 0;
+
+ if (write == 0)
+ {
+ flags |= SEC_READONLY;
+ /* Set size == zero for readonly sections. */
+ size = 0;
+ }
+ if (exec)
+ {
+ flags |= SEC_CODE;
+ }
+ else
+ {
+ flags |= SEC_DATA;
+ }
+
+ return ((make_mem_sec ((bfd *) data, vaddr, size, flags, 0)) == NULL);
+}
+
+static int
+objfile_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *obfd)
+{
+ /* Use objfile data to create memory sections. */
+ struct objfile *objfile;
+ struct obj_section *objsec;
+ bfd_vma temp_bottom, temp_top;
+
+ /* Call callback function for each objfile section. */
+ ALL_OBJSECTIONS (objfile, objsec)
+ {
+ bfd *ibfd = objfile->obfd;
+ asection *isec = objsec->the_bfd_section;
+ flagword flags = bfd_get_section_flags (ibfd, isec);
+ int ret;
+
+ if ((flags & SEC_ALLOC) || (flags & SEC_LOAD))
+ {
+ int size = bfd_section_size (ibfd, isec);
+ int ret;
+
+ if ((ret = (*func) (objsec->addr,
+ bfd_section_size (ibfd, isec),
+ 1, /* All sections will be readable. */
+ (flags & SEC_READONLY) == 0, /* writable */
+ (flags & SEC_CODE) != 0, /* executable */
+ obfd)) != 0)
+ return ret;
+ }
+ }
+
+ /* Make a stack segment. */
+ if (derive_stack_segment (&temp_bottom, &temp_top))
+ (*func) (temp_bottom,
+ temp_top - temp_bottom,
+ 1, /* Stack section will be readable */
+ 1, /* Stack section will be writable */
+ 0, /* Stack section will not be executable */
+ obfd);
+
+ /* Make a heap segment. */
+ if (derive_heap_segment (exec_bfd, &temp_bottom, &temp_top))
+ (*func) (temp_bottom,
+ temp_top - temp_bottom,
+ 1, /* Heap section will be readable */
+ 1, /* Heap section will be writable */
+ 0, /* Heap section will not be executable */
+ obfd);
+ return 0;
+}
+
+static void
+gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
+{
+ bfd_size_type size = bfd_section_size (obfd, osec);
+ struct cleanup *old_chain = NULL;
+ void *memhunk;
+
+ if (size == 0)
+ return; /* Read-only sections are marked as zero-size.
+ We don't have to copy their contents. */
+ if (strncmp ("load", bfd_get_section_name (obfd, osec), 4) != 0)
+ return; /* Only interested in "load" sections. */
+
+ if ((memhunk = xmalloc (size)) == NULL)
+ error ("Not enough memory to create corefile.");
+ old_chain = make_cleanup (xfree, memhunk);
+
+ if (target_read_memory (bfd_section_vma (obfd, osec),
+ memhunk, size) != 0)
+ warning ("Memory read failed for corefile section, %ld bytes at 0x%s\n",
+ (long) size, paddr (bfd_section_vma (obfd, osec)));
+ if (!bfd_set_section_contents (obfd, osec, memhunk, 0, size))
+ warning ("Failed to write corefile contents (%s).",
+ bfd_errmsg (bfd_get_error ()));
+
+ do_cleanups (old_chain); /* frees the xmalloc buffer */
+}
+
+static int
+gcore_memory_sections (bfd *obfd)
+{
+ if (target_find_memory_regions (gcore_create_callback, obfd) != 0)
+ return 0; /* FIXME error return/msg? */
+
+ /* Record phdrs for section-to-segment mapping. */
+ bfd_map_over_sections (obfd, make_output_phdrs, NULL);
+
+ /* Copy memory region contents. */
+ bfd_map_over_sections (obfd, gcore_copy_callback, NULL);
+
+ return 1; /* success */
+}
+
+void
+_initialize_gcore (void)
+{
+ add_com ("generate-core-file", class_files, gcore_command,
+ "Save a core file with the current state of the debugged process.\n\
+Argument is optional filename. Default filename is 'core.<process_id>'.");
+
+ add_com_alias ("gcore", "generate-core-file", class_files, 1);
+ exec_set_find_memory_regions (objfile_find_memory_regions);
+}
diff --git a/contrib/gdb/gdb/gdb-events.c b/contrib/gdb/gdb/gdb-events.c
new file mode 100644
index 0000000..0fbb3ba
--- /dev/null
+++ b/contrib/gdb/gdb/gdb-events.c
@@ -0,0 +1,353 @@
+/* User Interface Events.
+ Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Contributed by Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Work in progress */
+
+/* This file was created with the aid of ``gdb-events.sh''.
+
+ The bourn shell script ``gdb-events.sh'' creates the files
+ ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
+ them against the existing ``gdb-events.[hc]''. Any differences
+ found being reported.
+
+ If editing this file, please also run gdb-events.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdb-events.sh and using its output may
+ prove easier. */
+
+
+#include "defs.h"
+#include "gdb-events.h"
+#include "gdbcmd.h"
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+#if WITH_GDB_EVENTS
+static struct gdb_events null_event_hooks;
+static struct gdb_events queue_event_hooks;
+static struct gdb_events *current_event_hooks = &null_event_hooks;
+#endif
+
+int gdb_events_debug;
+
+#if WITH_GDB_EVENTS
+
+void
+breakpoint_create_event (int b)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "breakpoint_create_event\n");
+ if (!current_event_hooks->breakpoint_create)
+ return;
+ current_event_hooks->breakpoint_create (b);
+}
+
+void
+breakpoint_delete_event (int b)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "breakpoint_delete_event\n");
+ if (!current_event_hooks->breakpoint_delete)
+ return;
+ current_event_hooks->breakpoint_delete (b);
+}
+
+void
+breakpoint_modify_event (int b)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "breakpoint_modify_event\n");
+ if (!current_event_hooks->breakpoint_modify)
+ return;
+ current_event_hooks->breakpoint_modify (b);
+}
+
+void
+tracepoint_create_event (int number)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "tracepoint_create_event\n");
+ if (!current_event_hooks->tracepoint_create)
+ return;
+ current_event_hooks->tracepoint_create (number);
+}
+
+void
+tracepoint_delete_event (int number)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "tracepoint_delete_event\n");
+ if (!current_event_hooks->tracepoint_delete)
+ return;
+ current_event_hooks->tracepoint_delete (number);
+}
+
+void
+tracepoint_modify_event (int number)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "tracepoint_modify_event\n");
+ if (!current_event_hooks->tracepoint_modify)
+ return;
+ current_event_hooks->tracepoint_modify (number);
+}
+
+void
+architecture_changed_event (void)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "architecture_changed_event\n");
+ if (!current_event_hooks->architecture_changed)
+ return;
+ current_event_hooks->architecture_changed ();
+}
+
+#endif
+
+#if WITH_GDB_EVENTS
+struct gdb_events *
+set_gdb_event_hooks (struct gdb_events *vector)
+{
+ struct gdb_events *old_events = current_event_hooks;
+ if (vector == NULL)
+ current_event_hooks = &queue_event_hooks;
+ else
+ current_event_hooks = vector;
+ return old_events;
+}
+#endif
+
+enum gdb_event
+{
+ breakpoint_create,
+ breakpoint_delete,
+ breakpoint_modify,
+ tracepoint_create,
+ tracepoint_delete,
+ tracepoint_modify,
+ architecture_changed,
+ nr_gdb_events
+};
+
+struct breakpoint_create
+ {
+ int b;
+ };
+
+struct breakpoint_delete
+ {
+ int b;
+ };
+
+struct breakpoint_modify
+ {
+ int b;
+ };
+
+struct tracepoint_create
+ {
+ int number;
+ };
+
+struct tracepoint_delete
+ {
+ int number;
+ };
+
+struct tracepoint_modify
+ {
+ int number;
+ };
+
+struct event
+ {
+ enum gdb_event type;
+ struct event *next;
+ union
+ {
+ struct breakpoint_create breakpoint_create;
+ struct breakpoint_delete breakpoint_delete;
+ struct breakpoint_modify breakpoint_modify;
+ struct tracepoint_create tracepoint_create;
+ struct tracepoint_delete tracepoint_delete;
+ struct tracepoint_modify tracepoint_modify;
+ }
+ data;
+ };
+struct event *pending_events;
+struct event *delivering_events;
+
+static void
+append (struct event *new_event)
+{
+ struct event **event = &pending_events;
+ while ((*event) != NULL)
+ event = &((*event)->next);
+ (*event) = new_event;
+ (*event)->next = NULL;
+}
+
+static void
+queue_breakpoint_create (int b)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = breakpoint_create;
+ event->data.breakpoint_create.b = b;
+ append (event);
+}
+
+static void
+queue_breakpoint_delete (int b)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = breakpoint_delete;
+ event->data.breakpoint_delete.b = b;
+ append (event);
+}
+
+static void
+queue_breakpoint_modify (int b)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = breakpoint_modify;
+ event->data.breakpoint_modify.b = b;
+ append (event);
+}
+
+static void
+queue_tracepoint_create (int number)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = tracepoint_create;
+ event->data.tracepoint_create.number = number;
+ append (event);
+}
+
+static void
+queue_tracepoint_delete (int number)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = tracepoint_delete;
+ event->data.tracepoint_delete.number = number;
+ append (event);
+}
+
+static void
+queue_tracepoint_modify (int number)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = tracepoint_modify;
+ event->data.tracepoint_modify.number = number;
+ append (event);
+}
+
+static void
+queue_architecture_changed (void)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = architecture_changed;
+ append (event);
+}
+
+void
+gdb_events_deliver (struct gdb_events *vector)
+{
+ /* Just zap any events left around from last time. */
+ while (delivering_events != NULL)
+ {
+ struct event *event = delivering_events;
+ delivering_events = event->next;
+ xfree (event);
+ }
+ /* Process any pending events. Because one of the deliveries could
+ bail out we move everything off of the pending queue onto an
+ in-progress queue where it can, later, be cleaned up if
+ necessary. */
+ delivering_events = pending_events;
+ pending_events = NULL;
+ while (delivering_events != NULL)
+ {
+ struct event *event = delivering_events;
+ switch (event->type)
+ {
+ case breakpoint_create:
+ vector->breakpoint_create
+ (event->data.breakpoint_create.b);
+ break;
+ case breakpoint_delete:
+ vector->breakpoint_delete
+ (event->data.breakpoint_delete.b);
+ break;
+ case breakpoint_modify:
+ vector->breakpoint_modify
+ (event->data.breakpoint_modify.b);
+ break;
+ case tracepoint_create:
+ vector->tracepoint_create
+ (event->data.tracepoint_create.number);
+ break;
+ case tracepoint_delete:
+ vector->tracepoint_delete
+ (event->data.tracepoint_delete.number);
+ break;
+ case tracepoint_modify:
+ vector->tracepoint_modify
+ (event->data.tracepoint_modify.number);
+ break;
+ case architecture_changed:
+ vector->architecture_changed ();
+ break;
+ }
+ delivering_events = event->next;
+ xfree (event);
+ }
+}
+
+void _initialize_gdb_events (void);
+void
+_initialize_gdb_events (void)
+{
+ struct cmd_list_element *c;
+#if WITH_GDB_EVENTS
+ queue_event_hooks.breakpoint_create = queue_breakpoint_create;
+ queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
+ queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
+ queue_event_hooks.tracepoint_create = queue_tracepoint_create;
+ queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
+ queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
+ queue_event_hooks.architecture_changed = queue_architecture_changed;
+#endif
+
+ c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
+ (char *) (&gdb_events_debug), "Set event debugging.\n\
+When non-zero, event/notify debugging is enabled.", &setlist);
+ deprecate_cmd (c, "set debug event");
+ deprecate_cmd (add_show_from_set (c, &showlist), "show debug event");
+
+ add_show_from_set (add_set_cmd ("event",
+ class_maintenance,
+ var_zinteger,
+ (char *) (&gdb_events_debug),
+ "Set event debugging.\n\
+When non-zero, event/notify debugging is enabled.", &setdebuglist),
+ &showdebuglist);
+}
diff --git a/contrib/gdb/gdb/gdb-events.h b/contrib/gdb/gdb/gdb-events.h
new file mode 100644
index 0000000..18a4a20
--- /dev/null
+++ b/contrib/gdb/gdb/gdb-events.h
@@ -0,0 +1,113 @@
+/* User Interface Events.
+ Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Contributed by Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Work in progress */
+
+/* This file was created with the aid of ``gdb-events.sh''.
+
+ The bourn shell script ``gdb-events.sh'' creates the files
+ ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
+ them against the existing ``gdb-events.[hc]''. Any differences
+ found being reported.
+
+ If editing this file, please also run gdb-events.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdb-events.sh and using its output may
+ prove easier. */
+
+
+#ifndef GDB_EVENTS_H
+#define GDB_EVENTS_H
+
+#ifndef WITH_GDB_EVENTS
+#define WITH_GDB_EVENTS 1
+#endif
+
+
+/* COMPAT: pointer variables for old, unconverted events.
+ A call to set_gdb_events() will automatically update these. */
+
+
+
+/* Type definition of all hook functions.
+ Recommended pratice is to first declare each hook function using
+ the below ftype and then define it. */
+
+typedef void (gdb_events_breakpoint_create_ftype) (int b);
+typedef void (gdb_events_breakpoint_delete_ftype) (int b);
+typedef void (gdb_events_breakpoint_modify_ftype) (int b);
+typedef void (gdb_events_tracepoint_create_ftype) (int number);
+typedef void (gdb_events_tracepoint_delete_ftype) (int number);
+typedef void (gdb_events_tracepoint_modify_ftype) (int number);
+typedef void (gdb_events_architecture_changed_ftype) (void);
+
+
+/* gdb-events: object. */
+
+struct gdb_events
+ {
+ gdb_events_breakpoint_create_ftype *breakpoint_create;
+ gdb_events_breakpoint_delete_ftype *breakpoint_delete;
+ gdb_events_breakpoint_modify_ftype *breakpoint_modify;
+ gdb_events_tracepoint_create_ftype *tracepoint_create;
+ gdb_events_tracepoint_delete_ftype *tracepoint_delete;
+ gdb_events_tracepoint_modify_ftype *tracepoint_modify;
+ gdb_events_architecture_changed_ftype *architecture_changed;
+ };
+
+
+/* Interface into events functions.
+ Where a *_p() predicate is present, it must be called before
+ calling the hook proper. */
+extern void breakpoint_create_event (int b);
+extern void breakpoint_delete_event (int b);
+extern void breakpoint_modify_event (int b);
+extern void tracepoint_create_event (int number);
+extern void tracepoint_delete_event (int number);
+extern void tracepoint_modify_event (int number);
+extern void architecture_changed_event (void);
+
+
+/* When GDB_EVENTS are not being used, completly disable them. */
+
+#if !WITH_GDB_EVENTS
+#define breakpoint_create_event(b) 0
+#define breakpoint_delete_event(b) 0
+#define breakpoint_modify_event(b) 0
+#define tracepoint_create_event(number) 0
+#define tracepoint_delete_event(number) 0
+#define tracepoint_modify_event(number) 0
+#define architecture_changed_event() 0
+#endif
+
+/* Install custom gdb-events hooks. */
+extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
+
+/* Deliver any pending events. */
+extern void gdb_events_deliver (struct gdb_events *vector);
+
+#if !WITH_GDB_EVENTS
+#define set_gdb_events(x) 0
+#define set_gdb_event_hooks(x) 0
+#define gdb_events_deliver(x) 0
+#endif
+
+#endif
diff --git a/contrib/gdb/gdb/gdb-events.sh b/contrib/gdb/gdb/gdb-events.sh
new file mode 100755
index 0000000..eb73465
--- /dev/null
+++ b/contrib/gdb/gdb/gdb-events.sh
@@ -0,0 +1,607 @@
+#!/bin/sh
+
+# User Interface Events.
+# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+#
+# Contributed by Cygnus Solutions.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#
+# What happens next:
+#
+
+# The gdb-events.h/gdb-events.c files this script generates are commited
+# and published.
+
+# Any UI module that is installing events is changed so that the
+# events are installed using the ``set_gdb_events()'' and
+# ``gdb_event_hooks()'' interfaces. There could prove to be an issue
+# here with respect to annotate. We might need to accomodate a hook
+# stack that allows several ui blocks to install their own events.
+
+# Each of the variable events (as currently generated) is converted
+# to either a straight function call or a function call with a
+# predicate.
+
+
+IFS=:
+
+read="class returntype function formal actual attrib"
+
+function_list ()
+{
+ # category:
+ # # -> disable
+ # * -> compatibility - pointer variable that is initialized
+ # by set_gdb_events().
+ # ? -> Predicate and function proper.
+ # f -> always call (must have a void returntype)
+ # return-type
+ # name
+ # formal argument list
+ # actual argument list
+ # attributes
+ # description
+ cat <<EOF |
+f:void:breakpoint_create:int b:b
+f:void:breakpoint_delete:int b:b
+f:void:breakpoint_modify:int b:b
+f:void:tracepoint_create:int number:number
+f:void:tracepoint_delete:int number:number
+f:void:tracepoint_modify:int number:number
+f:void:architecture_changed:void
+#*:void:annotate_starting_hook:void
+#*:void:annotate_stopped_hook:void
+#*:void:annotate_signalled_hook:void
+#*:void:annotate_signal_hook:void
+#*:void:annotate_exited_hook:void
+##*:void:print_register_hook:int
+##*:CORE_ADDR:find_toc_address_hook:CORE_ADDR
+##*:void:sparc_print_register_hook:int regno:regno
+#*:void:target_resume_hook:void
+#*:void:target_wait_loop_hook:void
+#*:void:init_gdb_hook:char *argv0:argv0
+#*:void:command_loop_hook:void
+#*:void:fputs_unfiltered_hook:const char *linebuff,struct ui_file *stream:linebuff, stream
+#*:void:print_frame_info_listing_hook:struct symtab *s, int line, int stopline, int noerror:s, line, stopline, noerror
+#*:int:query_hook:const char *query, va_list args:query, args
+#*:void:warning_hook:const char *string, va_list args:string, args
+#*:void:target_output_hook:char *b:b
+#*:void:interactive_hook:void
+#*:void:registers_changed_hook:void
+#*:void:readline_begin_hook:char *format, ...:format
+#*:char *:readline_hook:char *prompt:prompt
+#*:void:readline_end_hook:void
+#*:void:register_changed_hook:int regno:regno
+#*:void:memory_changed_hook:CORE_ADDR addr, int len:addr, len
+#*:void:context_hook:int num:num
+#*:int:target_wait_hook:int pid, struct target_waitstatus *status:pid, status
+#*:void:call_command_hook:struct cmd_list_element *c, char *cmd, int from_tty:c, cmd, from_tty
+#*:NORETURN void:error_hook:void:: ATTR_NORETURN
+#*:void:error_begin_hook:void
+##*:int:target_architecture_hook:const struct bfd_arch_info *
+#*:void:exec_file_display_hook:char *filename:filename
+#*:void:file_changed_hook:char *filename:filename
+##*:void:specify_exec_file_hook:
+#*:int:gdb_load_progress_hook:char *section, unsigned long num:section, num
+#*:void:pre_add_symbol_hook:char *name:name
+#*:void:post_add_symbol_hook:void
+#*:void:selected_frame_level_changed_hook:int level:level
+#*:int:gdb_loop_hook:int signo:signo
+##*:void:solib_create_inferior_hook:void
+##*:void:xcoff_relocate_symtab_hook:unsigned int
+EOF
+ grep -v '^#'
+}
+
+copyright ()
+{
+ cat <<EOF
+/* User Interface Events.
+ Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Contributed by Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Work in progress */
+
+/* This file was created with the aid of \`\`gdb-events.sh''.
+
+ The bourn shell script \`\`gdb-events.sh'' creates the files
+ \`\`new-gdb-events.c'' and \`\`new-gdb-events.h and then compares
+ them against the existing \`\`gdb-events.[hc]''. Any differences
+ found being reported.
+
+ If editing this file, please also run gdb-events.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdb-events.sh and using its output may
+ prove easier. */
+
+EOF
+}
+
+#
+# The .h file
+#
+
+exec > new-gdb-events.h
+copyright
+cat <<EOF
+
+#ifndef GDB_EVENTS_H
+#define GDB_EVENTS_H
+
+#ifndef WITH_GDB_EVENTS
+#define WITH_GDB_EVENTS 1
+#endif
+EOF
+
+# pointer declarations
+echo ""
+echo ""
+cat <<EOF
+/* COMPAT: pointer variables for old, unconverted events.
+ A call to set_gdb_events() will automatically update these. */
+EOF
+echo ""
+function_list | while eval read $read
+do
+ case "${class}" in
+ "*" )
+ echo "extern ${returntype} (*${function}_event) (${formal})${attrib};"
+ ;;
+ esac
+done
+
+# function typedef's
+echo ""
+echo ""
+cat <<EOF
+/* Type definition of all hook functions.
+ Recommended pratice is to first declare each hook function using
+ the below ftype and then define it. */
+EOF
+echo ""
+function_list | while eval read $read
+do
+ echo "typedef ${returntype} (gdb_events_${function}_ftype) (${formal});"
+done
+
+# gdb_events object
+echo ""
+echo ""
+cat <<EOF
+/* gdb-events: object. */
+EOF
+echo ""
+echo "struct gdb_events"
+echo " {"
+function_list | while eval read $read
+do
+ echo " gdb_events_${function}_ftype *${function}${attrib};"
+done
+echo " };"
+
+# function declarations
+echo ""
+echo ""
+cat <<EOF
+/* Interface into events functions.
+ Where a *_p() predicate is present, it must be called before
+ calling the hook proper. */
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "*" ) continue ;;
+ "?" )
+ echo "extern int ${function}_p (void);"
+ echo "extern ${returntype} ${function}_event (${formal})${attrib};"
+ ;;
+ "f" )
+ echo "extern ${returntype} ${function}_event (${formal})${attrib};"
+ ;;
+ esac
+done
+
+# function macros
+echo ""
+echo ""
+cat <<EOF
+/* When GDB_EVENTS are not being used, completly disable them. */
+EOF
+echo ""
+echo "#if !WITH_GDB_EVENTS"
+function_list | while eval read $read
+do
+ case "${class}" in
+ "*" ) continue ;;
+ "?" )
+ echo "#define ${function}_event_p() 0"
+ echo "#define ${function}_event(${actual}) 0"
+ ;;
+ "f" )
+ echo "#define ${function}_event(${actual}) 0"
+ ;;
+ esac
+done
+echo "#endif"
+
+# our set function
+cat <<EOF
+
+/* Install custom gdb-events hooks. */
+extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
+
+/* Deliver any pending events. */
+extern void gdb_events_deliver (struct gdb_events *vector);
+
+#if !WITH_GDB_EVENTS
+#define set_gdb_events(x) 0
+#define set_gdb_event_hooks(x) 0
+#define gdb_events_deliver(x) 0
+#endif
+EOF
+
+# close it off
+echo ""
+echo "#endif"
+exec 1>&2
+#../move-if-change new-gdb-events.h gdb-events.h
+if test -r gdb-events.h
+then
+ diff -c gdb-events.h new-gdb-events.h
+ if [ $? = 1 ]
+ then
+ echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2
+ fi
+else
+ echo "File missing? mv new-gdb-events.h gdb-events.h" 1>&2
+fi
+
+
+
+#
+# C file
+#
+
+exec > new-gdb-events.c
+copyright
+cat <<EOF
+
+#include "defs.h"
+#include "gdb-events.h"
+#include "gdbcmd.h"
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+#if WITH_GDB_EVENTS
+static struct gdb_events null_event_hooks;
+static struct gdb_events queue_event_hooks;
+static struct gdb_events *current_event_hooks = &null_event_hooks;
+#endif
+
+int gdb_events_debug;
+EOF
+
+# global pointer variables - always have this
+#echo ""
+#function_list | while eval read $read
+#do
+# case "${class}" in
+# "*" )
+# echo "${returntype} (*${function}_event) (${formal})${attrib} = 0;"
+# ;;
+# esac
+#done
+
+# function bodies
+echo ""
+echo "#if WITH_GDB_EVENTS"
+function_list | while eval read $read
+do
+ case "${class}" in
+ "*" ) continue ;;
+ "?" )
+cat <<EOF
+
+int
+${function}_event_p (${formal})
+{
+ return current_event_hooks->${function};
+}
+
+${returntype}
+${function}_event (${formal})
+{
+ return current_events->${function} (${actual});
+}
+EOF
+ ;;
+ "f" )
+cat <<EOF
+
+void
+${function}_event (${formal})
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "${function}_event\n");
+ if (!current_event_hooks->${function})
+ return;
+ current_event_hooks->${function} (${actual});
+}
+EOF
+ ;;
+ esac
+done
+echo ""
+echo "#endif"
+
+# Set hooks function
+echo ""
+cat <<EOF
+#if WITH_GDB_EVENTS
+struct gdb_events *
+set_gdb_event_hooks (struct gdb_events *vector)
+{
+ struct gdb_events *old_events = current_event_hooks;
+ if (vector == NULL)
+ current_event_hooks = &queue_event_hooks;
+ else
+ current_event_hooks = vector;
+ return old_events;
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "*" )
+ echo " ${function}_event = hooks->${function};"
+ ;;
+ esac
+done
+cat <<EOF
+}
+#endif
+EOF
+
+# event type
+echo ""
+cat <<EOF
+enum gdb_event
+{
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ echo " ${function},"
+ ;;
+ esac
+done
+cat <<EOF
+ nr_gdb_events
+};
+EOF
+
+# event data
+echo ""
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ if test ${actual}
+ then
+ echo "struct ${function}"
+ echo " {"
+ echo " `echo ${formal} | tr '[,]' '[;]'`;"
+ echo " };"
+ echo ""
+ fi
+ ;;
+ esac
+done
+
+# event queue
+cat <<EOF
+struct event
+ {
+ enum gdb_event type;
+ struct event *next;
+ union
+ {
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ if test ${actual}
+ then
+ echo " struct ${function} ${function};"
+ fi
+ ;;
+ esac
+done
+cat <<EOF
+ }
+ data;
+ };
+struct event *pending_events;
+struct event *delivering_events;
+EOF
+
+# append
+echo ""
+cat <<EOF
+static void
+append (struct event *new_event)
+{
+ struct event **event = &pending_events;
+ while ((*event) != NULL)
+ event = &((*event)->next);
+ (*event) = new_event;
+ (*event)->next = NULL;
+}
+EOF
+
+# schedule a given event
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ echo ""
+ echo "static void"
+ echo "queue_${function} (${formal})"
+ echo "{"
+ echo " struct event *event = XMALLOC (struct event);"
+ echo " event->type = ${function};"
+ for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do
+ echo " event->data.${function}.${arg} = ${arg};"
+ done
+ echo " append (event);"
+ echo "}"
+ ;;
+ esac
+done
+
+# deliver
+echo ""
+cat <<EOF
+void
+gdb_events_deliver (struct gdb_events *vector)
+{
+ /* Just zap any events left around from last time. */
+ while (delivering_events != NULL)
+ {
+ struct event *event = delivering_events;
+ delivering_events = event->next;
+ xfree (event);
+ }
+ /* Process any pending events. Because one of the deliveries could
+ bail out we move everything off of the pending queue onto an
+ in-progress queue where it can, later, be cleaned up if
+ necessary. */
+ delivering_events = pending_events;
+ pending_events = NULL;
+ while (delivering_events != NULL)
+ {
+ struct event *event = delivering_events;
+ switch (event->type)
+ {
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ echo " case ${function}:"
+ if test ${actual}
+ then
+ echo " vector->${function}"
+ sep=" ("
+ ass=""
+ for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do
+ ass="${ass}${sep}event->data.${function}.${arg}"
+ sep=",
+ "
+ done
+ echo "${ass});"
+ else
+ echo " vector->${function} ();"
+ fi
+ echo " break;"
+ ;;
+ esac
+done
+cat <<EOF
+ }
+ delivering_events = event->next;
+ xfree (event);
+ }
+}
+EOF
+
+# Finally the initialization
+echo ""
+cat <<EOF
+void _initialize_gdb_events (void);
+void
+_initialize_gdb_events (void)
+{
+ struct cmd_list_element *c;
+#if WITH_GDB_EVENTS
+EOF
+function_list | while eval read $read
+do
+ case "${class}" in
+ "f" )
+ echo " queue_event_hooks.${function} = queue_${function};"
+ ;;
+ esac
+done
+cat <<EOF
+#endif
+
+ c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
+ (char *) (&gdb_events_debug), "Set event debugging.\n\\
+When non-zero, event/notify debugging is enabled.", &setlist);
+ deprecate_cmd (c, "set debug event");
+ deprecate_cmd (add_show_from_set (c, &showlist), "show debug event");
+
+ add_show_from_set (add_set_cmd ("event",
+ class_maintenance,
+ var_zinteger,
+ (char *) (&gdb_events_debug),
+ "Set event debugging.\n\\
+When non-zero, event/notify debugging is enabled.", &setdebuglist),
+ &showdebuglist);
+}
+EOF
+
+# close things off
+exec 1>&2
+#../move-if-change new-gdb-events.c gdb-events.c
+# Replace any leading spaces with tabs
+sed < new-gdb-events.c > tmp-gdb-events.c \
+ -e 's/\( \)* /\1 /g'
+mv tmp-gdb-events.c new-gdb-events.c
+# Move if changed?
+if test -r gdb-events.c
+then
+ diff -c gdb-events.c new-gdb-events.c
+ if [ $? = 1 ]
+ then
+ echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2
+ fi
+else
+ echo "File missing? mv new-gdb-events.c gdb-events.c" 1>&2
+fi
diff --git a/contrib/gdb/gdb/gdb-stabs.h b/contrib/gdb/gdb/gdb-stabs.h
index 1ad782a..d2da2d1 100644
--- a/contrib/gdb/gdb/gdb-stabs.h
+++ b/contrib/gdb/gdb/gdb-stabs.h
@@ -1,22 +1,24 @@
/* Definitions for symbol-reading containing "stabs", for GDB.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1995, 1996, 1997, 1999, 2000
+ 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
@@ -27,55 +29,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (GDBSTABS_H)
#define GDBSTABS_H
-/* Offsets in the psymtab's section_offsets array for various kinds of
- stabs symbols. Every psymtab built from stabs will have these offsets
- filled in by these guidelines, so that when actually reading symbols, the
- proper offset can simply be selected and added to the symbol value. */
-
-#define SECT_OFF_TEXT 0
-#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 64 /* 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;
+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;
-};
+ /* 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)
diff --git a/contrib/gdb/gdb/gdb.1 b/contrib/gdb/gdb/gdb.1
index 2e55a49..55272c6 100644
--- a/contrib/gdb/gdb/gdb.1
+++ b/contrib/gdb/gdb/gdb.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991 Free Software Foundation
+.\" Copyright 1991, 1999 Free Software Foundation, Inc.
.\" See section COPYING for conditions for redistribution
.\" $Id: gdb.1,v 1.4 1999/01/05 00:50:50 jsm Exp $
.TH gdb 1 "4nov1991" "GNU Tools" "GNU Tools"
diff --git a/contrib/gdb/gdb/gdb.h b/contrib/gdb/gdb/gdb.h
new file mode 100644
index 0000000..737ac82
--- /dev/null
+++ b/contrib/gdb/gdb/gdb.h
@@ -0,0 +1,60 @@
+/* Library interface into GDB.
+ Copyright 1999, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_H
+#define GDB_H
+
+/* Return-code (RC) from a gdb library call. (The abreviation RC is
+ taken from the sim/common directory.) */
+
+enum gdb_rc {
+ /* The operation failed. The failure message can be fetched by
+ calling ``char *error_last_message(void)''. The value is
+ determined by the catch_errors() interface. */
+ /* NOTE: Since ``defs.h:catch_errors()'' does not return an error /
+ internal / quit indication it is not possible to return that
+ here. */
+ GDB_RC_FAIL = 0,
+ /* No error occured but nothing happened. Due to the catch_errors()
+ interface, this must be non-zero. */
+ GDB_RC_NONE = 1,
+ /* The operation was successful. Due to the catch_errors()
+ interface, this must be non-zero. */
+ GDB_RC_OK = 2
+};
+
+
+/* Print the specified breakpoint on GDB_STDOUT. (Eventually this
+ function will ``print'' the object on ``output''). */
+enum gdb_rc gdb_breakpoint_query (struct ui_out *uiout, int bnum);
+
+/* Create a breakpoint at ADDRESS (a GDB source and line). */
+enum gdb_rc gdb_breakpoint (char *address, char *condition,
+ int hardwareflag, int tempflag,
+ int thread, int ignore_count);
+
+/* Switch thread and print notification. */
+enum gdb_rc gdb_thread_select (struct ui_out *uiout, char *tidstr);
+
+/* Print a list of known thread ids. */
+enum gdb_rc gdb_list_thread_ids (struct ui_out *uiout);
+
+#endif
diff --git a/contrib/gdb/gdb/gdb_assert.h b/contrib/gdb/gdb/gdb_assert.h
new file mode 100644
index 0000000..4f0bcdc
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_assert.h
@@ -0,0 +1,55 @@
+/* GDB-friendly replacement for <assert.h>.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_ASSERT_H
+#define GDB_ASSERT_H
+
+/* PRAGMATICS: "gdb_assert.h":gdb_assert() is a lower case (rather
+ than upper case) macro since that provides the closest fit to the
+ existing lower case macro <assert.h>:assert() that it is
+ replacing. */
+
+#define gdb_assert(expr) \
+ ((void) ((expr) ? 0 : \
+ (gdb_assert_fail (#expr, __FILE__, __LINE__, ASSERT_FUNCTION), 0)))
+
+/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
+ which contains the name of the function currently being defined.
+ This is broken in G++ before version 2.6.
+ C9x has a similar variable called __func__, but prefer the GCC one since
+ it demangles C++ function names. */
+#if (GCC_VERSION >= 2004)
+#define ASSERT_FUNCTION __PRETTY_FUNCTION__
+#else
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#define ASSERT_FUNCTION __func__
+#else
+#define ASSERT_FUNCTION ((const char *) 0)
+#endif
+#endif
+
+/* This prints an "Assertion failed" message, aksing the user if they
+ want to continue, dump core, or just exit. */
+#define gdb_assert_fail(assertion, file, line, function) \
+ internal_error (file, line, "%s%sAssertion `%s' failed.", \
+ function ? function : "", function ? ": " : "", \
+ assertion)
+
+#endif /* gdb_assert.h */
diff --git a/contrib/gdb/gdb/gdb_dirent.h b/contrib/gdb/gdb/gdb_dirent.h
new file mode 100644
index 0000000..9cb4006
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_dirent.h
@@ -0,0 +1,40 @@
+/* Portable <dirent.h>
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined(GDB_DIRENT_H)
+#define GDB_DIRENT_H
+
+/* From bfd/hpux-core.c. */
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+#endif /* !defined(GDB_DIRENT_H) */
diff --git a/contrib/gdb/gdb/gdb_indent.sh b/contrib/gdb/gdb/gdb_indent.sh
new file mode 100755
index 0000000..e54e08e
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_indent.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# Try to find a GNU indent. There could be a BSD indent in front of a
+# GNU gindent so when indent is found, keep looking.
+
+gindent=
+indent=
+paths=`echo $PATH | sed \
+ -e 's/::/:.:/g' \
+ -e 's/^:/.:/' \
+ -e 's/:$/:./' \
+ -e 's/:/ /g'`
+for path in $paths
+do
+ if test ! -n "${gindent}" -a -x ${path}/gindent
+ then
+ gindent=${path}/gindent
+ break
+ elif test ! -n "${indent}" -a -x ${path}/indent
+ then
+ indent=${path}/indent
+ fi
+done
+
+if test -n "${gindent}"
+then
+ indent=${gindent}
+elif test -n "${indent}"
+then
+ :
+else
+ echo "Indent not found" 1>&2
+fi
+
+
+# Check that the indent found is both GNU and a reasonable version.
+# Different indent versions give different indentation.
+
+case `${indent} --version 2>/dev/null < /dev/null` in
+ GNU*2.2.6 ) ;;
+ *GNU* ) echo "Incorrect version of GNU indent" 1>&2 ;;
+ * ) echo "Indent is not GNU" 1>&2 ;;
+esac
+
+
+# Check that we're in the GDB source directory
+
+case `pwd` in
+ */gdb ) ;;
+ * ) echo "Not in GDB directory" 1>&2 ; exit 1 ;;
+esac
+
+
+# Run indent per GDB specs
+
+types="-T FILE `cat *.h | sed -n \
+ -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
+ -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
+ -e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \
+ | sort -u`"
+
+${indent} ${types} "$@"
diff --git a/contrib/gdb/gdb/gdb_proc_service.h b/contrib/gdb/gdb/gdb_proc_service.h
new file mode 100644
index 0000000..e77cdf6
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_proc_service.h
@@ -0,0 +1,86 @@
+/* <proc_service.h> replacement for systems that don't have it.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_PROC_SERVICE_H
+#define GDB_PROC_SERVICE_H
+
+#include <sys/types.h>
+
+#ifdef HAVE_PROC_SERVICE_H
+#include <proc_service.h>
+#else
+
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
+
+#include "gregset.h"
+
+typedef enum
+{
+ PS_OK, /* Success. */
+ PS_ERR, /* Generic error. */
+ PS_BADPID, /* Bad process handle. */
+ PS_BADLID, /* Bad LWP id. */
+ PS_BADADDR, /* Bad address. */
+ PS_NOSYM, /* Symbol not found. */
+ PS_NOFREGS /* FPU register set not available. */
+} ps_err_e;
+
+#ifndef HAVE_LWPID_T
+typedef unsigned int lwpid_t;
+#endif
+
+typedef unsigned long paddr_t;
+
+#ifndef HAVE_PSADDR_T
+typedef unsigned long psaddr_t;
+#endif
+
+#ifndef HAVE_PRGREGSET_T
+typedef gdb_gregset_t prgregset_t;
+#endif
+
+#ifndef HAVE_PRFPREGSET_T
+typedef gdb_fpregset_t prfpregset_t;
+#endif
+
+#endif /* HAVE_PROC_SERVICE_H */
+
+/* Fix-up some broken systems. */
+
+/* Unfortunately glibc 2.1.3 was released with a broken prfpregset_t
+ type. We let configure check for this lossage, and make
+ appropriate typedefs here. */
+
+#ifdef PRFPREGSET_T_BROKEN
+typedef gdb_fpregset_t gdb_prfpregset_t;
+#else
+typedef prfpregset_t gdb_prfpregset_t;
+#endif
+
+/* Structure that identifies the target process. */
+struct ps_prochandle
+{
+ /* The process id is all we need. */
+ pid_t pid;
+};
+
+#endif /* gdb_proc_service.h */
diff --git a/contrib/gdb/gdb/gdb_regex.h b/contrib/gdb/gdb/gdb_regex.h
new file mode 100644
index 0000000..27a570a
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_regex.h
@@ -0,0 +1,30 @@
+/* Portable <regex.h>
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_REGEX_H
+#define GDB_REGEX_H
+
+#ifdef USE_INCLUDED_REGEX
+#include "xregex.h"
+#else
+#include <regex.h>
+#endif
+
+#endif /* gdb_regex.h */
diff --git a/contrib/gdb/gdb/gdb_stat.h b/contrib/gdb/gdb/gdb_stat.h
index b871b29..f3577f2 100644
--- a/contrib/gdb/gdb/gdb_stat.h
+++ b/contrib/gdb/gdb/gdb_stat.h
@@ -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,17 @@ 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) */
+/* Microsoft C's stat.h doesn't define all the POSIX file modes. */
+#ifndef S_IROTH
+#define S_IROTH S_IREAD
+#endif
+
+#endif /* !defined(GDB_STAT_H) */
diff --git a/contrib/gdb/gdb/gdb_string.h b/contrib/gdb/gdb/gdb_string.h
index 944eec1..f54af80 100644
--- a/contrib/gdb/gdb/gdb_string.h
+++ b/contrib/gdb/gdb/gdb_string.h
@@ -1,21 +1,22 @@
/* Portable <string.h>
- Copyright 1995, 1998 Free Software Foundation, Inc.
+ Copyright 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,46 +24,44 @@ 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 */
+extern char *strchr (const char *, int); /* X3.159-1989 4.11.5.2 */
#endif
#ifndef strrchr
-extern char *strrchr PARAMS ((const char *, int)); /* X3.159-1989 4.11.5.5 */
-#endif
-
-#ifndef strstr
-extern char *strstr PARAMS ((const char *, const char *)); /* X3.159-1989 4.11.5.7 */
+extern char *strrchr (const char *, int); /* X3.159-1989 4.11.5.5 */
#endif
#ifndef strtok
-extern char *strtok PARAMS ((char *, const char *)); /* X3.159-1989 4.11.5.8 */
+extern char *strtok (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
#ifndef strerror
-extern char *strerror PARAMS ((int)); /* X3.159-1989 4.11.6.2 */
+extern char *strerror (int); /* X3.159-1989 4.11.6.2 */
#endif
#endif
-#ifdef NEED_DECLARATION_STRDUP
-extern char *strdup (); /* full prototype collides w/ some OSes (AIX 3.2.5) */
+#ifdef NEED_DECLARATION_STRSTR
+#ifndef strstr
+extern char *strstr (const char *, const char *); /* X3.159-1989 4.11.5.7 */
+#endif
#endif
-#endif /* !defined(GDB_STRING_H) */
+#endif /* !defined(GDB_STRING_H) */
diff --git a/contrib/gdb/gdb/gdb_thread_db.h b/contrib/gdb/gdb/gdb_thread_db.h
new file mode 100644
index 0000000..8088da0
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_thread_db.h
@@ -0,0 +1,450 @@
+#ifdef HAVE_THREAD_DB_H
+#include <thread_db.h>
+#else
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+typedef uint32_t gdb_uint32_t;
+#define GDB_UINT32_C(c) UINT32_C(c)
+#else
+typedef unsigned int gdb_uint32_t;
+#define GDB_UINT32_C(c) c ## U
+#endif
+
+/* Copyright 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _THREAD_DB_H
+#define _THREAD_DB_H 1
+
+/* This is the debugger interface for the LinuxThreads library. It is
+ modelled closely after the interface with same names in Solaris with
+ the goal to share the same code in the debugger. */
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+
+
+/* Error codes of the library. */
+typedef enum
+{
+ TD_OK, /* No error. */
+ TD_ERR, /* No further specified error. */
+ TD_NOTHR, /* No matching thread found. */
+ TD_NOSV, /* No matching synchronization handle found. */
+ TD_NOLWP, /* No matching light-weighted process found. */
+ 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, /* No event available. */
+ TD_NOFPREGS, /* No floating-point register content available. */
+ TD_NOLIBTHREAD, /* Application not linked with thread library. */
+ TD_NOEVENT, /* Requested event is not supported. */
+ TD_NOCAPAB, /* Capability not available. */
+ TD_DBERR, /* Internal debug library error. */
+ TD_NOAPLIC, /* Operation is not applicable. */
+ TD_NOTSD, /* No thread-specific data available. */
+ TD_MALLOC, /* Out of memory. */
+ TD_PARTIALREG, /* Not entire register set was read or written. */
+ TD_NOXREGS /* X register set not available for given thread. */
+} td_err_e;
+
+
+/* Possible thread states. TD_THR_ANY_STATE is a pseudo-state used to
+ select threads regardless of state in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_STATE,
+ TD_THR_UNKNOWN,
+ TD_THR_STOPPED,
+ TD_THR_RUN,
+ TD_THR_ACTIVE,
+ TD_THR_ZOMBIE,
+ TD_THR_SLEEP,
+ TD_THR_STOPPED_ASLEEP
+} td_thr_state_e;
+
+/* Thread type: user or system. TD_THR_ANY_TYPE is a pseudo-type used
+ to select threads regardless of type in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_TYPE,
+ TD_THR_USER,
+ TD_THR_SYSTEM
+} td_thr_type_e;
+
+
+/* Types of the debugging library. */
+
+/* Handle for a process. This type is opaque. */
+typedef struct td_thragent td_thragent_t;
+
+/* The actual thread handle type. This is also opaque. */
+typedef struct td_thrhandle
+{
+ td_thragent_t *th_ta_p;
+ psaddr_t th_unique;
+} td_thrhandle_t;
+
+
+/* Flags for `td_ta_thr_iter'. */
+#define TD_THR_ANY_USER_FLAGS 0xffffffff
+#define TD_THR_LOWEST_PRIORITY -20
+#define TD_SIGNO_MASK NULL
+
+
+#define TD_EVENTSIZE 2
+#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */
+#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */
+#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */
+
+/* Bitmask of enabled events. */
+typedef struct td_thr_events
+{
+ gdb_uint32_t event_bits[TD_EVENTSIZE];
+} td_thr_events_t;
+
+/* Event set manipulation macros. */
+#define __td_eventmask(n) \
+ (GDB_UINT32_C (1) << (((n) - 1) & BT_UIMASK))
+#define __td_eventword(n) \
+ ((GDB_UINT32_C ((n) - 1)) >> BT_UISHIFT)
+
+#define td_event_emptyset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = 0; \
+ } while (0)
+
+#define td_event_fillset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = GDB_UINT32_C (0xffffffff); \
+ } while (0)
+
+#define td_event_addset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) |= __td_eventmask (n))
+#define td_event_delset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) &= ~__td_eventmask (n))
+#define td_eventismember(setp, n) \
+ (__td_eventmask (n) & ((setp)->event_bits[__td_eventword (n)]))
+#if TD_EVENTSIZE == 2
+# define td_eventisempty(setp) \
+ (!((setp)->event_bits[0]) && !((setp)->event_bits[1]))
+#else
+# error "td_eventisempty must be changed to match TD_EVENTSIZE"
+#endif
+
+/* Events reportable by the thread implementation. */
+typedef enum
+{
+ TD_ALL_EVENTS, /* Pseudo-event number. */
+ TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */
+ TD_READY, /* Is executable now. */
+ TD_SLEEP, /* Blocked in a synchronization obj. */
+ TD_SWITCHTO, /* Now assigned to a process. */
+ TD_SWITCHFROM, /* Not anymore assigned to a process. */
+ TD_LOCK_TRY, /* Trying to get an unavailable lock. */
+ TD_CATCHSIG, /* Signal posted to the thread. */
+ TD_IDLE, /* Process getting idle. */
+ TD_CREATE, /* New thread created. */
+ TD_DEATH, /* Thread terminated. */
+ TD_PREEMPT, /* Preempted. */
+ TD_PRI_INHERIT, /* Inherited elevated priority. */
+ TD_REAP, /* Reaped. */
+ TD_CONCURRENCY, /* Number of processes changing. */
+ TD_TIMEOUT, /* Conditional variable wait timed out. */
+ TD_MIN_EVENT_NUM = TD_READY,
+ TD_MAX_EVENT_NUM = TD_TIMEOUT,
+ TD_EVENTS_ENABLE = 31 /* Event reporting enabled. */
+} td_event_e;
+
+/* Values representing the different ways events are reported. */
+typedef enum
+{
+ NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */
+ NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically
+ inserted. */
+ NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */
+} td_notify_e;
+
+/* Description how event type is reported. */
+typedef struct td_notify
+{
+ td_notify_e type; /* Way the event is reported. */
+ union
+ {
+ psaddr_t bptaddr; /* Address of breakpoint. */
+ int syscallno; /* Number of system call used. */
+ } u;
+} td_notify_t;
+
+/* Structure used to report event. */
+typedef struct td_event_msg
+{
+ td_event_e event; /* Event type being reported. */
+ const td_thrhandle_t *th_p; /* Thread reporting the event. */
+ union
+ {
+#if 0
+ td_synchandle_t *sh; /* Handle of synchronization object. */
+#endif
+ uintptr_t data; /* Event specific data. */
+ } msg;
+} td_event_msg_t;
+
+/* Structure containing event data available in each thread structure. */
+typedef struct
+{
+ td_thr_events_t eventmask; /* Mask of enabled events. */
+ td_event_e eventnum; /* Number of last event. */
+ void *eventdata; /* Data associated with event. */
+} td_eventbuf_t;
+
+
+/* Gathered statistics about the process. */
+typedef struct td_ta_stats
+{
+ int nthreads; /* Total number of threads in use. */
+ int r_concurrency; /* Concurrency level requested by user. */
+ int nrunnable_num; /* Average runnable threads, numerator. */
+ int nrunnable_den; /* Average runnable threads, denominator. */
+ int a_concurrency_num; /* Achieved concurrency level, numerator. */
+ int a_concurrency_den; /* Achieved concurrency level, denominator. */
+ int nlwps_num; /* Average number of processes in use,
+ numerator. */
+ int nlwps_den; /* Average number of processes in use,
+ denominator. */
+ int nidle_num; /* Average number of idling processes,
+ numerator. */
+ int nidle_den; /* Average number of idling processes,
+ denominator. */
+} td_ta_stats_t;
+
+
+/* Since Sun's library is based on Solaris threads we have to define a few
+ types to map them to POSIX threads. */
+typedef pthread_t thread_t;
+typedef pthread_key_t thread_key_t;
+
+
+/* Callback for iteration over threads. */
+typedef int td_thr_iter_f (const td_thrhandle_t *, void *);
+
+/* Callback for iteration over thread local data. */
+typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *);
+
+
+
+/* Forward declaration. This has to be defined by the user. */
+struct ps_prochandle;
+
+
+/* Information about the thread. */
+typedef struct td_thrinfo
+{
+ td_thragent_t *ti_ta_p; /* Process handle. */
+ unsigned int ti_user_flags; /* Unused. */
+ thread_t ti_tid; /* Thread ID returned by
+ pthread_create(). */
+ char *ti_tls; /* Pointer to thread-local data. */
+ psaddr_t ti_startfunc; /* Start function passed to
+ pthread_create(). */
+ psaddr_t ti_stkbase; /* Base of thread's stack. */
+ long int ti_stksize; /* Size of thread's stack. */
+ psaddr_t ti_ro_area; /* Unused. */
+ int ti_ro_size; /* Unused. */
+ td_thr_state_e ti_state; /* Thread state. */
+ unsigned char ti_db_suspended; /* Nonzero if suspended by debugger. */
+ td_thr_type_e ti_type; /* Type of the thread (system vs
+ user thread). */
+ intptr_t ti_pc; /* Unused. */
+ intptr_t ti_sp; /* Unused. */
+ short int ti_flags; /* Unused. */
+ int ti_pri; /* Thread priority. */
+ lwpid_t ti_lid; /* Unused. */
+ sigset_t ti_sigmask; /* Signal mask. */
+ unsigned char ti_traceme; /* Nonzero if event reporting
+ enabled. */
+ unsigned char ti_preemptflag; /* Unused. */
+ unsigned char ti_pirecflag; /* Unused. */
+ sigset_t ti_pending; /* Set of pending signals. */
+ td_thr_events_t ti_events; /* Set of enabled events. */
+} td_thrinfo_t;
+
+
+
+/* Prototypes for exported library functions. */
+
+/* Initialize the thread debug support library. */
+extern td_err_e td_init (void);
+
+/* Historical relict. Should not be used anymore. */
+extern td_err_e td_log (void);
+
+/* Generate new thread debug library handle for process PS. */
+extern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta);
+
+/* Free resources allocated for TA. */
+extern td_err_e td_ta_delete (td_thragent_t *__ta);
+
+/* Get number of currently running threads in process associated with TA. */
+extern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np);
+
+/* Return process handle passed in `td_ta_new' for process associated with
+ TA. */
+extern td_err_e td_ta_get_ph (const td_thragent_t *__ta,
+ struct ps_prochandle **__ph);
+
+/* Map thread library handle PT to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt,
+ td_thrhandle_t *__th);
+
+/* Map process ID LWPID to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid,
+ td_thrhandle_t *__th);
+
+
+/* Call for each thread in a process associated with TA the callback function
+ CALLBACK. */
+extern td_err_e td_ta_thr_iter (const td_thragent_t *__ta,
+ td_thr_iter_f *__callback, void *__cbdata_p,
+ td_thr_state_e __state, int __ti_pri,
+ sigset_t *__ti_sigmask_p,
+ unsigned int __ti_user_flags);
+
+/* Call for each defined thread local data entry the callback function KI. */
+extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki,
+ void *__p);
+
+
+/* Get event address for EVENT. */
+extern td_err_e td_ta_event_addr (const td_thragent_t *__ta,
+ td_event_e __event, td_notify_t *__ptr);
+
+/* Enable EVENT in global mask. */
+extern td_err_e td_ta_set_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Disable EVENT in global mask. */
+extern td_err_e td_ta_clear_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Return information about last event. */
+extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta,
+ td_event_msg_t *msg);
+
+
+/* Set suggested concurrency level for process associated with TA. */
+extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level);
+
+
+/* Enable collecting statistics for process associated with TA. */
+extern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable);
+
+/* Reset statistics. */
+extern td_err_e td_ta_reset_stats (const td_thragent_t *__ta);
+
+/* Retrieve statistics from process associated with TA. */
+extern td_err_e td_ta_get_stats (const td_thragent_t *__ta,
+ td_ta_stats_t *__statsp);
+
+
+/* Validate that TH is a thread handle. */
+extern td_err_e td_thr_validate (const td_thrhandle_t *__th);
+
+/* Return information about thread TH. */
+extern td_err_e td_thr_get_info (const td_thrhandle_t *__th,
+ td_thrinfo_t *__infop);
+
+/* Retrieve floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th,
+ prfpregset_t *__regset);
+
+/* Retrieve general register contents of process running thread TH. */
+extern td_err_e td_thr_getgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Retrieve extended register contents of process running thread TH. */
+extern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs);
+
+/* Get size of extended register set of process running thread TH. */
+extern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep);
+
+/* Set floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th,
+ const prfpregset_t *__fpregs);
+
+/* Set general register contents of process running thread TH. */
+extern td_err_e td_thr_setgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Set extended register contents of process running thread TH. */
+extern td_err_e td_thr_setxregs (const td_thrhandle_t *__th,
+ const void *__addr);
+
+
+/* Enable reporting for EVENT for thread TH. */
+extern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event);
+
+/* Enable EVENT for thread TH. */
+extern td_err_e td_thr_set_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Disable EVENT for thread TH. */
+extern td_err_e td_thr_clear_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Get event message for thread TH. */
+extern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th,
+ td_event_msg_t *__msg);
+
+
+/* Set priority of thread TH. */
+extern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio);
+
+
+/* Set pending signals for thread TH. */
+extern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th,
+ unsigned char __n, const sigset_t *__ss);
+
+/* Set signal mask for thread TH. */
+extern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th,
+ const sigset_t *__ss);
+
+
+/* Return thread local data associated with key TK in thread TH. */
+extern td_err_e td_thr_tsd (const td_thrhandle_t *__th,
+ const thread_key_t __tk, void **__data);
+
+
+/* Suspend execution of thread TH. */
+extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
+
+/* Resume execution of thread TH. */
+extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
+
+#endif /* thread_db.h */
+
+#endif /* HAVE_THREAD_DB_H */
diff --git a/contrib/gdb/gdb/gdb_vfork.h b/contrib/gdb/gdb/gdb_vfork.h
new file mode 100644
index 0000000..b9cef96
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_vfork.h
@@ -0,0 +1,28 @@
+/* GDB-friendly replacement for <vfork.h>.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_VFORK_H
+#define GDB_VFORK_H
+
+#if HAVE_VFORK_H
+#include <vfork.h>
+#endif
+
+#endif /* GDB_VFORK_H */
diff --git a/contrib/gdb/gdb/gdb_wait.h b/contrib/gdb/gdb/gdb_wait.h
new file mode 100644
index 0000000..fec6f60
--- /dev/null
+++ b/contrib/gdb/gdb/gdb_wait.h
@@ -0,0 +1,121 @@
+/* Standard wait macros.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GDB_WAIT_H
+#define GDB_WAIT_H
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h> /* POSIX */
+#else
+#ifdef HAVE_WAIT_H
+#include <wait.h> /* legacy */
+#endif
+#endif
+
+/* Define how to access the int that the wait system call stores.
+ This has been compatible in all Unix systems since time immemorial,
+ but various well-meaning people have defined various different
+ words for the same old bits in the same old int (sometimes claimed
+ to be a struct). We just know it's an int and we use these macros
+ to access the bits. */
+
+/* The following macros are defined equivalently to their definitions
+ in POSIX.1. We fail to define WNOHANG and WUNTRACED, which POSIX.1
+ <sys/wait.h> defines, since our code does not use waitpid() (but
+ NOTE exception for GNU/Linux below). We also fail to declare
+ wait() and waitpid(). */
+
+#ifndef WIFEXITED
+#define WIFEXITED(w) (((w)&0377) == 0)
+#endif
+
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
+#endif
+
+#ifndef WIFSTOPPED
+#ifdef IBM6000
+
+/* Unfortunately, the above comment (about being compatible in all Unix
+ systems) is not quite correct for AIX, sigh. And AIX 3.2 can generate
+ status words like 0x57c (sigtrap received after load), and gdb would
+ choke on it. */
+
+#define WIFSTOPPED(w) ((w)&0x40)
+
+#else
+#define WIFSTOPPED(w) (((w)&0377) == 0177)
+#endif
+#endif
+
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(w) (((w) >> 8) & 0377) /* same as WRETCODE */
+#endif
+
+#ifndef WTERMSIG
+#define WTERMSIG(w) ((w) & 0177)
+#endif
+
+#ifndef WSTOPSIG
+#define WSTOPSIG WEXITSTATUS
+#endif
+
+/* These are not defined in POSIX, but are used by our programs. */
+
+#define WAITTYPE int
+
+#ifndef WCOREDUMP
+#define WCOREDUMP(w) (((w)&0200) != 0)
+#endif
+
+#ifndef WSETEXIT
+# ifdef W_EXITCODE
+#define WSETEXIT(w,status) ((w) = W_EXITCODE(status,0))
+# else
+#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
+# endif
+#endif
+
+#ifndef WSETSTOP
+# ifdef W_STOPCODE
+#define WSETSTOP(w,sig) ((w) = W_STOPCODE(sig))
+# else
+#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
+# endif
+#endif
+
+/* For native GNU/Linux we may use waitpid and the __WCLONE option.
+ <GRIPE> It is of course dangerous not to use the REAL header file...
+ </GRIPE>. */
+
+/* Bits in the third argument to `waitpid'. */
+#ifndef WNOHANG
+#define WNOHANG 1 /* Don't block waiting. */
+#endif
+
+#ifndef WUNTRACED
+#define WUNTRACED 2 /* Report status of stopped children. */
+#endif
+
+#ifndef __WCLONE
+#define __WCLONE 0x80000000 /* Wait for cloned process. */
+#endif
+
+#endif
diff --git a/contrib/gdb/gdb/gdbarch.c b/contrib/gdb/gdb/gdbarch.c
index 154fa8f..5aad461 100644
--- a/contrib/gdb/gdb/gdbarch.c
+++ b/contrib/gdb/gdb/gdbarch.c
@@ -1,26 +1,84 @@
-/* Semi-dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, Free Software Foundation, Inc.
+/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-This file is part of GDB.
+/* Dynamic architecture support for GDB, the GNU debugger.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 created with the aid of ``gdbarch.sh''.
+
+ The Bourne shell script ``gdbarch.sh'' creates the files
+ ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
+ against the existing ``gdbarch.[hc]''. Any differences found
+ being reported.
+
+ If editing this file, please also run gdbarch.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdbarch.sh and using its output may prove
+ easier. */
-You should have received a copy of the GNU General Public License
-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 "arch-utils.h"
+
+#if GDB_MULTI_ARCH
#include "gdbcmd.h"
+#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. */
+#include "gdb_string.h"
+#include <ctype.h>
+#include "symtab.h"
+#include "frame.h"
+#include "inferior.h"
+#include "breakpoint.h"
+#include "gdb_wait.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "gdbthread.h"
+#include "annotate.h"
+#include "symfile.h" /* for overlay functions */
+#include "value.h" /* For old tm.h/nm.h macros. */
+#endif
+#include "symcat.h"
+
+#include "floatformat.h"
+
+#include "gdb_assert.h"
+#include "gdb-events.h"
+
+/* Static function declarations */
+static void verify_gdbarch (struct gdbarch *gdbarch);
+static void alloc_gdbarch_data (struct gdbarch *);
+static void init_gdbarch_data (struct gdbarch *);
+static void free_gdbarch_data (struct gdbarch *);
+static void init_gdbarch_swap (struct gdbarch *);
+static void swapout_gdbarch_swap (struct gdbarch *);
+static void swapin_gdbarch_swap (struct gdbarch *);
+
+/* Convenience macro for allocting typesafe memory. */
+
+#ifndef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+#endif
/* Non-zero if we want to trace architecture code. */
@@ -31,316 +89,4960 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
int gdbarch_debug = GDBARCH_DEBUG;
-/* Functions to manipulate the endianness of the target. */
+/* Maintain the struct gdbarch object */
+
+struct gdbarch
+{
+ /* basic architectural information */
+ const struct bfd_arch_info * bfd_arch_info;
+ int byte_order;
+
+ /* target specific vector. */
+ struct gdbarch_tdep *tdep;
+ gdbarch_dump_tdep_ftype *dump_tdep;
+
+ /* per-architecture data-pointers */
+ unsigned nr_data;
+ void **data;
+
+ /* per-architecture swap-regions */
+ struct gdbarch_swap *swap;
+
+ /* Multi-arch values.
+
+ When extending this structure you must:
+
+ Add the field below.
+
+ 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.
+
+ verify_gdbarch(): Confirm that the target updated the field
+ correctly.
+
+ gdbarch_dump(): Add a fprintf_unfiltered call so that the new
+ field is dumped out
+
+ ``startup_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).
+
+ */
+
+ int short_bit;
+ int int_bit;
+ int long_bit;
+ int long_long_bit;
+ int float_bit;
+ int double_bit;
+ int long_double_bit;
+ int ptr_bit;
+ int addr_bit;
+ int bfd_vma_bit;
+ int char_signed;
+ 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;
+ gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
+ gdbarch_register_read_ftype *register_read;
+ gdbarch_register_write_ftype *register_write;
+ int num_regs;
+ int num_pseudo_regs;
+ int sp_regnum;
+ int fp_regnum;
+ int pc_regnum;
+ int fp0_regnum;
+ int npc_regnum;
+ int nnpc_regnum;
+ gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
+ gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
+ gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
+ gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
+ gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_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;
+ gdbarch_do_registers_info_ftype *do_registers_info;
+ gdbarch_print_float_info_ftype *print_float_info;
+ gdbarch_register_sim_regno_ftype *register_sim_regno;
+ gdbarch_register_bytes_ok_ftype *register_bytes_ok;
+ gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
+ gdbarch_cannot_store_register_ftype *cannot_store_register;
+ gdbarch_get_longjmp_target_ftype *get_longjmp_target;
+ 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;
+ gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
+ gdbarch_init_frame_pc_ftype *init_frame_pc;
+ int believe_pcc_promotion;
+ int believe_pcc_promotion_type;
+ gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
+ 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_fetch_pseudo_register_ftype *fetch_pseudo_register;
+ gdbarch_store_pseudo_register_ftype *store_pseudo_register;
+ gdbarch_pointer_to_address_ftype *pointer_to_address;
+ gdbarch_address_to_pointer_ftype *address_to_pointer;
+ gdbarch_integer_to_address_ftype *integer_to_address;
+ gdbarch_return_value_on_stack_ftype *return_value_on_stack;
+ gdbarch_extract_return_value_ftype *extract_return_value;
+ gdbarch_push_arguments_ftype *push_arguments;
+ gdbarch_push_dummy_frame_ftype *push_dummy_frame;
+ gdbarch_push_return_address_ftype *push_return_address;
+ gdbarch_pop_frame_ftype *pop_frame;
+ gdbarch_store_struct_return_ftype *store_struct_return;
+ gdbarch_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_prologue_frameless_p_ftype *prologue_frameless_p;
+ gdbarch_inner_than_ftype *inner_than;
+ gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
+ gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
+ gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
+ CORE_ADDR decr_pc_after_break;
+ gdbarch_prepare_to_proceed_ftype *prepare_to_proceed;
+ 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;
+ gdbarch_stack_align_ftype *stack_align;
+ int extra_stack_alignment_needed;
+ gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
+ gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
+ int parm_boundary;
+ const struct floatformat * float_format;
+ const struct floatformat * double_format;
+ const struct floatformat * long_double_format;
+ gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
+ gdbarch_addr_bits_remove_ftype *addr_bits_remove;
+ gdbarch_smash_text_address_ftype *smash_text_address;
+ gdbarch_software_single_step_ftype *software_single_step;
+ gdbarch_print_insn_ftype *print_insn;
+ gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
+ gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+ gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
+ gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
+ gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
+ gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
+ gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
+};
+
+
+/* The default architecture uses host values (for want of a better
+ choice). */
+
+extern const struct bfd_arch_info bfd_default_arch_struct;
+
+struct gdbarch startup_gdbarch =
+{
+ /* basic architecture information */
+ &bfd_default_arch_struct,
+ BFD_ENDIAN_BIG,
+ /* target specific vector and its dump routine */
+ NULL, NULL,
+ /*per-architecture data-pointers and swap regions */
+ 0, NULL, NULL,
+ /* Multi-arch values */
+ 8 * sizeof (short),
+ 8 * sizeof (int),
+ 8 * sizeof (long),
+ 8 * sizeof (LONGEST),
+ 8 * sizeof (float),
+ 8 * sizeof (double),
+ 8 * sizeof (long double),
+ 8 * sizeof (void*),
+ 8 * sizeof (void*),
+ 8 * sizeof (void*),
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ generic_register_raw_size,
+ 0,
+ generic_register_virtual_size,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ generic_get_saved_register,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ generic_in_function_epilogue_p,
+ construct_inferior_arguments,
+ 0,
+ 0,
+ 0,
+ /* startup_gdbarch() */
+};
+
+struct gdbarch *current_gdbarch = &startup_gdbarch;
+
+/* Do any initialization needed for a non-multiarch configuration
+ after the _initialize_MODULE functions have been run. */
+void
+initialize_non_multiarch ()
+{
+ alloc_gdbarch_data (&startup_gdbarch);
+ init_gdbarch_data (&startup_gdbarch);
+}
+
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-/* compat - Catch old targets that expect a selectable byte-order to
- default to BIG_ENDIAN */
-#ifndef TARGET_BYTE_ORDER_DEFAULT
-#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
+/* Create a new ``struct gdbarch'' based on information provided by
+ ``struct gdbarch_info''. */
+
+struct gdbarch *
+gdbarch_alloc (const struct gdbarch_info *info,
+ struct gdbarch_tdep *tdep)
+{
+ /* NOTE: The new architecture variable is named ``current_gdbarch''
+ so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
+ the current local architecture and not the previous global
+ architecture. This ensures that the new architectures initial
+ values are not influenced by the previous architecture. Once
+ everything is parameterised with gdbarch, this will go away. */
+ struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
+ memset (current_gdbarch, 0, sizeof (*current_gdbarch));
+
+ alloc_gdbarch_data (current_gdbarch);
+
+ current_gdbarch->tdep = tdep;
+
+ current_gdbarch->bfd_arch_info = info->bfd_arch_info;
+ current_gdbarch->byte_order = info->byte_order;
+
+ /* Force the explicit initialization of these. */
+ current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
+ current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
+ current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
+ current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
+ current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
+ current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
+ current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
+ current_gdbarch->ptr_bit = TARGET_INT_BIT;
+ current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+ current_gdbarch->char_signed = -1;
+ current_gdbarch->read_pc = generic_target_read_pc;
+ current_gdbarch->write_pc = generic_target_write_pc;
+ current_gdbarch->read_fp = generic_target_read_fp;
+ current_gdbarch->write_fp = generic_target_write_fp;
+ current_gdbarch->read_sp = generic_target_read_sp;
+ current_gdbarch->write_sp = generic_target_write_sp;
+ current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
+ current_gdbarch->num_regs = -1;
+ current_gdbarch->sp_regnum = -1;
+ current_gdbarch->fp_regnum = -1;
+ current_gdbarch->pc_regnum = -1;
+ current_gdbarch->fp0_regnum = -1;
+ current_gdbarch->npc_regnum = -1;
+ current_gdbarch->nnpc_regnum = -1;
+ current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
+ current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
+ current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
+ current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
+ current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
+ current_gdbarch->register_name = legacy_register_name;
+ current_gdbarch->register_size = -1;
+ current_gdbarch->register_bytes = -1;
+ current_gdbarch->max_register_raw_size = -1;
+ current_gdbarch->max_register_virtual_size = -1;
+ current_gdbarch->do_registers_info = do_registers_info;
+ current_gdbarch->print_float_info = default_print_float_info;
+ current_gdbarch->register_sim_regno = default_register_sim_regno;
+ current_gdbarch->cannot_fetch_register = cannot_register_not;
+ current_gdbarch->cannot_store_register = cannot_register_not;
+ current_gdbarch->use_generic_dummy_frames = -1;
+ current_gdbarch->call_dummy_start_offset = -1;
+ current_gdbarch->call_dummy_breakpoint_offset = -1;
+ current_gdbarch->call_dummy_breakpoint_offset_p = -1;
+ current_gdbarch->call_dummy_length = -1;
+ current_gdbarch->call_dummy_p = -1;
+ current_gdbarch->call_dummy_words = legacy_call_dummy_words;
+ current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
+ current_gdbarch->call_dummy_stack_adjust_p = -1;
+ current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
+ current_gdbarch->init_frame_pc = init_frame_pc_default;
+ current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
+ current_gdbarch->register_convertible = generic_register_convertible_not;
+ current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
+ current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
+ current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+ current_gdbarch->push_arguments = default_push_arguments;
+ current_gdbarch->use_struct_convention = generic_use_struct_convention;
+ current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
+ current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
+ current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
+ current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
+ current_gdbarch->decr_pc_after_break = -1;
+ current_gdbarch->prepare_to_proceed = default_prepare_to_proceed;
+ current_gdbarch->function_start_offset = -1;
+ current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
+ current_gdbarch->frame_args_skip = -1;
+ current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
+ current_gdbarch->frame_chain_valid = func_frame_chain_valid;
+ current_gdbarch->extra_stack_alignment_needed = 1;
+ current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
+ current_gdbarch->addr_bits_remove = core_addr_identity;
+ current_gdbarch->smash_text_address = core_addr_identity;
+ current_gdbarch->print_insn = legacy_print_insn;
+ current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
+ current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+ current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
+ current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
+ current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
+ current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
+ /* gdbarch_alloc() */
+
+ return current_gdbarch;
+}
+
+
+/* Free a gdbarch struct. This should never happen in normal
+ operation --- once you've created a gdbarch, you keep it around.
+ However, if an architecture's init function encounters an error
+ building the structure, it may need to clean up a partially
+ constructed gdbarch. */
+
+void
+gdbarch_free (struct gdbarch *arch)
+{
+ gdb_assert (arch != NULL);
+ free_gdbarch_data (arch);
+ xfree (arch);
+}
+
+
+/* Ensure that all values in a GDBARCH are reasonable. */
+
+static void
+verify_gdbarch (struct gdbarch *gdbarch)
+{
+ struct ui_file *log;
+ struct cleanup *cleanups;
+ long dummy;
+ char *buf;
+ /* Only perform sanity checks on a multi-arch target. */
+ if (!GDB_MULTI_ARCH)
+ return;
+ log = mem_fileopen ();
+ cleanups = make_cleanup_ui_file_delete (log);
+ /* fundamental */
+ if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
+ fprintf_unfiltered (log, "\n\tbyte-order");
+ if (gdbarch->bfd_arch_info == NULL)
+ fprintf_unfiltered (log, "\n\tbfd_arch_info");
+ /* Check those that need to be defined for the given multi-arch level. */
+ /* Skip verify of short_bit, invalid_p == 0 */
+ /* Skip verify of int_bit, invalid_p == 0 */
+ /* Skip verify of long_bit, invalid_p == 0 */
+ /* Skip verify of long_long_bit, invalid_p == 0 */
+ /* Skip verify of float_bit, invalid_p == 0 */
+ /* Skip verify of double_bit, invalid_p == 0 */
+ /* Skip verify of long_double_bit, invalid_p == 0 */
+ /* Skip verify of ptr_bit, invalid_p == 0 */
+ if (gdbarch->addr_bit == 0)
+ gdbarch->addr_bit = TARGET_PTR_BIT;
+ /* Skip verify of bfd_vma_bit, invalid_p == 0 */
+ if (gdbarch->char_signed == -1)
+ gdbarch->char_signed = 1;
+ /* Skip verify of read_pc, invalid_p == 0 */
+ /* Skip verify of write_pc, invalid_p == 0 */
+ /* Skip verify of read_fp, invalid_p == 0 */
+ /* Skip verify of write_fp, invalid_p == 0 */
+ /* Skip verify of read_sp, invalid_p == 0 */
+ /* Skip verify of write_sp, invalid_p == 0 */
+ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
+ /* Skip verify of register_read, has predicate */
+ /* Skip verify of register_write, has predicate */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->num_regs == -1))
+ fprintf_unfiltered (log, "\n\tnum_regs");
+ /* Skip verify of num_pseudo_regs, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->sp_regnum == -1))
+ fprintf_unfiltered (log, "\n\tsp_regnum");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->fp_regnum == -1))
+ fprintf_unfiltered (log, "\n\tfp_regnum");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->pc_regnum == -1))
+ fprintf_unfiltered (log, "\n\tpc_regnum");
+ /* Skip verify of fp0_regnum, invalid_p == 0 */
+ /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of nnpc_regnum, invalid_p == 0 */
+ /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of register_name, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_size == -1))
+ fprintf_unfiltered (log, "\n\tregister_size");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_bytes == -1))
+ fprintf_unfiltered (log, "\n\tregister_bytes");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_byte == 0))
+ fprintf_unfiltered (log, "\n\tregister_byte");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_raw_size == 0))
+ fprintf_unfiltered (log, "\n\tregister_raw_size");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->max_register_raw_size == -1))
+ fprintf_unfiltered (log, "\n\tmax_register_raw_size");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_virtual_size == 0))
+ fprintf_unfiltered (log, "\n\tregister_virtual_size");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->max_register_virtual_size == -1))
+ fprintf_unfiltered (log, "\n\tmax_register_virtual_size");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->register_virtual_type == 0))
+ fprintf_unfiltered (log, "\n\tregister_virtual_type");
+ /* Skip verify of do_registers_info, invalid_p == 0 */
+ /* Skip verify of print_float_info, invalid_p == 0 */
+ /* Skip verify of register_sim_regno, invalid_p == 0 */
+ /* Skip verify of register_bytes_ok, has predicate */
+ /* Skip verify of cannot_fetch_register, invalid_p == 0 */
+ /* Skip verify of cannot_store_register, invalid_p == 0 */
+ /* Skip verify of get_longjmp_target, has predicate */
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->use_generic_dummy_frames == -1))
+ fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames");
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_location == 0))
+ fprintf_unfiltered (log, "\n\tcall_dummy_location");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
+ fprintf_unfiltered (log, "\n\tcall_dummy_address");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_start_offset == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset");
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_breakpoint_offset_p == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_length == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_length");
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->pc_in_call_dummy == 0))
+ fprintf_unfiltered (log, "\n\tpc_in_call_dummy");
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_p == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_p");
+ /* Skip verify of call_dummy_words, invalid_p == 0 */
+ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_stack_adjust_p == -1))
+ fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
+ fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->fix_call_dummy == 0))
+ fprintf_unfiltered (log, "\n\tfix_call_dummy");
+ /* Skip verify of init_frame_pc_first, invalid_p == 0 */
+ /* Skip verify of init_frame_pc, invalid_p == 0 */
+ /* Skip verify of coerce_float_to_double, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->get_saved_register == 0))
+ fprintf_unfiltered (log, "\n\tget_saved_register");
+ /* Skip verify of register_convertible, invalid_p == 0 */
+ /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
+ /* Skip verify of register_convert_to_raw, invalid_p == 0 */
+ /* Skip verify of fetch_pseudo_register, has predicate */
+ /* Skip verify of store_pseudo_register, has predicate */
+ /* Skip verify of pointer_to_address, invalid_p == 0 */
+ /* Skip verify of address_to_pointer, invalid_p == 0 */
+ /* Skip verify of integer_to_address, has predicate */
+ /* Skip verify of return_value_on_stack, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->extract_return_value == 0))
+ fprintf_unfiltered (log, "\n\textract_return_value");
+ /* Skip verify of push_arguments, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->push_dummy_frame == 0))
+ fprintf_unfiltered (log, "\n\tpush_dummy_frame");
+ /* Skip verify of push_return_address, has predicate */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->pop_frame == 0))
+ fprintf_unfiltered (log, "\n\tpop_frame");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->store_struct_return == 0))
+ fprintf_unfiltered (log, "\n\tstore_struct_return");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->store_return_value == 0))
+ fprintf_unfiltered (log, "\n\tstore_return_value");
+ /* Skip verify of extract_struct_value_address, has predicate */
+ /* Skip verify of use_struct_convention, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_init_saved_regs == 0))
+ fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
+ /* Skip verify of init_extra_frame_info, has predicate */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->skip_prologue == 0))
+ fprintf_unfiltered (log, "\n\tskip_prologue");
+ /* Skip verify of prologue_frameless_p, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->inner_than == 0))
+ fprintf_unfiltered (log, "\n\tinner_than");
+ /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
+ /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
+ /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->decr_pc_after_break == -1))
+ fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
+ /* Skip verify of prepare_to_proceed, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->function_start_offset == -1))
+ fprintf_unfiltered (log, "\n\tfunction_start_offset");
+ /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_args_skip == -1))
+ fprintf_unfiltered (log, "\n\tframe_args_skip");
+ /* Skip verify of frameless_function_invocation, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_chain == 0))
+ fprintf_unfiltered (log, "\n\tframe_chain");
+ /* Skip verify of frame_chain_valid, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_saved_pc == 0))
+ fprintf_unfiltered (log, "\n\tframe_saved_pc");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_args_address == 0))
+ fprintf_unfiltered (log, "\n\tframe_args_address");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_locals_address == 0))
+ fprintf_unfiltered (log, "\n\tframe_locals_address");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->saved_pc_after_call == 0))
+ fprintf_unfiltered (log, "\n\tsaved_pc_after_call");
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->frame_num_args == 0))
+ fprintf_unfiltered (log, "\n\tframe_num_args");
+ /* Skip verify of stack_align, has predicate */
+ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+ /* Skip verify of reg_struct_has_addr, has predicate */
+ /* Skip verify of save_dummy_frame_tos, has predicate */
+ if (gdbarch->float_format == 0)
+ gdbarch->float_format = default_float_format (gdbarch);
+ if (gdbarch->double_format == 0)
+ gdbarch->double_format = default_double_format (gdbarch);
+ if (gdbarch->long_double_format == 0)
+ gdbarch->long_double_format = default_double_format (gdbarch);
+ /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
+ /* Skip verify of addr_bits_remove, invalid_p == 0 */
+ /* Skip verify of smash_text_address, invalid_p == 0 */
+ /* Skip verify of software_single_step, has predicate */
+ /* Skip verify of print_insn, invalid_p == 0 */
+ /* Skip verify of skip_trampoline_code, invalid_p == 0 */
+ /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+ /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
+ /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
+ /* Skip verify of dwarf2_build_frame_info, has predicate */
+ /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
+ /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
+ buf = ui_file_xstrdup (log, &dummy);
+ make_cleanup (xfree, buf);
+ if (strlen (buf) > 0)
+ internal_error (__FILE__, __LINE__,
+ "verify_gdbarch: the following are invalid ...%s",
+ buf);
+ do_cleanups (cleanups);
+}
+
+
+/* Print out the details of the current architecture. */
+
+/* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
+ just happens to match the global variable ``current_gdbarch''. That
+ way macros refering to that variable get the local and not the global
+ version - ulgh. Once everything is parameterised with gdbarch, this
+ will go away. */
+
+void
+gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
+{
+ fprintf_unfiltered (file,
+ "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
+ GDB_MULTI_ARCH);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
+ (long) current_gdbarch->in_function_epilogue_p);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_read = 0x%08lx\n",
+ (long) current_gdbarch->register_read);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_write = 0x%08lx\n",
+ (long) current_gdbarch->register_write);
+#ifdef ADDRESS_TO_POINTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ADDRESS_TO_POINTER(type, buf, addr)",
+ XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n",
+ (long) current_gdbarch->address_to_pointer
+ /*ADDRESS_TO_POINTER ()*/);
+#endif
+#ifdef ADDR_BITS_REMOVE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ADDR_BITS_REMOVE(addr)",
+ XSTRING (ADDR_BITS_REMOVE (addr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
+ (long) current_gdbarch->addr_bits_remove
+ /*ADDR_BITS_REMOVE ()*/);
+#endif
+#ifdef BELIEVE_PCC_PROMOTION
+ fprintf_unfiltered (file,
+ "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
+ XSTRING (BELIEVE_PCC_PROMOTION));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
+ BELIEVE_PCC_PROMOTION);
+#endif
+#ifdef BELIEVE_PCC_PROMOTION_TYPE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
+ XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n",
+ BELIEVE_PCC_PROMOTION_TYPE);
+#endif
+#ifdef BREAKPOINT_FROM_PC
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "BREAKPOINT_FROM_PC(pcptr, lenptr)",
+ XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n",
+ (long) current_gdbarch->breakpoint_from_pc
+ /*BREAKPOINT_FROM_PC ()*/);
+#endif
+#ifdef CALL_DUMMY_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "CALL_DUMMY_ADDRESS()",
+ XSTRING (CALL_DUMMY_ADDRESS ()));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->call_dummy_address
+ /*CALL_DUMMY_ADDRESS ()*/);
+#endif
+#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
+ XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
+ if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
+ (long) CALL_DUMMY_BREAKPOINT_OFFSET);
+#endif
+#ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n",
+ XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n",
+ CALL_DUMMY_BREAKPOINT_OFFSET_P);
+#endif
+#ifdef CALL_DUMMY_LENGTH
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
+ XSTRING (CALL_DUMMY_LENGTH));
+ if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
+ CALL_DUMMY_LENGTH);
+#endif
+#ifdef CALL_DUMMY_LOCATION
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
+ XSTRING (CALL_DUMMY_LOCATION));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
+ CALL_DUMMY_LOCATION);
+#endif
+#ifdef CALL_DUMMY_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_P # %s\n",
+ XSTRING (CALL_DUMMY_P));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_P = %d\n",
+ CALL_DUMMY_P);
+#endif
+#ifdef CALL_DUMMY_STACK_ADJUST
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n",
+ XSTRING (CALL_DUMMY_STACK_ADJUST));
+ if (CALL_DUMMY_STACK_ADJUST_P)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
+ (long) CALL_DUMMY_STACK_ADJUST);
+#endif
+#ifdef CALL_DUMMY_STACK_ADJUST_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n",
+ XSTRING (CALL_DUMMY_STACK_ADJUST_P));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
+ (long) CALL_DUMMY_STACK_ADJUST_P);
+#endif
+#ifdef CALL_DUMMY_START_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
+ XSTRING (CALL_DUMMY_START_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
+ (long) CALL_DUMMY_START_OFFSET);
+#endif
+#ifdef CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
+ XSTRING (CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
+ (long) CALL_DUMMY_WORDS);
+#endif
+#ifdef CANNOT_FETCH_REGISTER
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "CANNOT_FETCH_REGISTER(regnum)",
+ XSTRING (CANNOT_FETCH_REGISTER (regnum)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->cannot_fetch_register
+ /*CANNOT_FETCH_REGISTER ()*/);
+#endif
+#ifdef CANNOT_STORE_REGISTER
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "CANNOT_STORE_REGISTER(regnum)",
+ XSTRING (CANNOT_STORE_REGISTER (regnum)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->cannot_store_register
+ /*CANNOT_STORE_REGISTER ()*/);
+#endif
+#ifdef COERCE_FLOAT_TO_DOUBLE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
+ XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
+ (long) current_gdbarch->coerce_float_to_double
+ /*COERCE_FLOAT_TO_DOUBLE ()*/);
+#endif
+#ifdef COFF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
+ XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+ (long) current_gdbarch->coff_make_msymbol_special
+ /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
+ (long) current_gdbarch->construct_inferior_arguments);
+#ifdef CONVERT_FROM_FUNC_PTR_ADDR
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
+ XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
+ (long) current_gdbarch->convert_from_func_ptr_addr
+ /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
+#endif
+#ifdef DECR_PC_AFTER_BREAK
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
+ XSTRING (DECR_PC_AFTER_BREAK));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
+ (long) DECR_PC_AFTER_BREAK);
+#endif
+#ifdef DO_REGISTERS_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DO_REGISTERS_INFO(reg_nr, fpregs)",
+ XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
+ (long) current_gdbarch->do_registers_info
+ /*DO_REGISTERS_INFO ()*/);
+#endif
+#ifdef DWARF2_BUILD_FRAME_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF2_BUILD_FRAME_INFO(objfile)",
+ XSTRING (DWARF2_BUILD_FRAME_INFO (objfile)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n",
+ (long) current_gdbarch->dwarf2_build_frame_info
+ /*DWARF2_BUILD_FRAME_INFO ()*/);
+#endif
+#ifdef DWARF2_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
+ XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->dwarf2_reg_to_regnum
+ /*DWARF2_REG_TO_REGNUM ()*/);
+#endif
+#ifdef DWARF_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF_REG_TO_REGNUM(dwarf_regnr)",
+ XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->dwarf_reg_to_regnum
+ /*DWARF_REG_TO_REGNUM ()*/);
+#endif
+#ifdef ECOFF_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
+ XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->ecoff_reg_to_regnum
+ /*ECOFF_REG_TO_REGNUM ()*/);
+#endif
+#ifdef ELF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
+ XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+ (long) current_gdbarch->elf_make_msymbol_special
+ /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
+#endif
+#ifdef EXTRACT_RETURN_VALUE
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
+ XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n",
+ (long) current_gdbarch->extract_return_value
+ /*EXTRACT_RETURN_VALUE ()*/);
+#endif
+#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
+ XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->extract_struct_value_address
+ /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
+#endif
+#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
+ XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
+ EXTRA_STACK_ALIGNMENT_NEEDED);
+#endif
+#ifdef FETCH_PSEUDO_REGISTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FETCH_PSEUDO_REGISTER(regnum)",
+ XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->fetch_pseudo_register
+ /*FETCH_PSEUDO_REGISTER ()*/);
+#endif
+#ifdef FIX_CALL_DUMMY
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
+ XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n",
+ (long) current_gdbarch->fix_call_dummy
+ /*FIX_CALL_DUMMY ()*/);
+#endif
+#ifdef FP0_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FP0_REGNUM # %s\n",
+ XSTRING (FP0_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FP0_REGNUM = %d\n",
+ FP0_REGNUM);
+#endif
+#ifdef FP_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FP_REGNUM # %s\n",
+ XSTRING (FP_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FP_REGNUM = %d\n",
+ FP_REGNUM);
+#endif
+#ifdef FRAMELESS_FUNCTION_INVOCATION
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAMELESS_FUNCTION_INVOCATION(fi)",
+ XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
+ (long) current_gdbarch->frameless_function_invocation
+ /*FRAMELESS_FUNCTION_INVOCATION ()*/);
+#endif
+#ifdef FRAME_ARGS_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_ARGS_ADDRESS(fi)",
+ XSTRING (FRAME_ARGS_ADDRESS (fi)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->frame_args_address
+ /*FRAME_ARGS_ADDRESS ()*/);
+#endif
+#ifdef FRAME_ARGS_SKIP
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
+ XSTRING (FRAME_ARGS_SKIP));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
+ (long) FRAME_ARGS_SKIP);
+#endif
+#ifdef FRAME_CHAIN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_CHAIN(frame)",
+ XSTRING (FRAME_CHAIN (frame)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n",
+ (long) current_gdbarch->frame_chain
+ /*FRAME_CHAIN ()*/);
+#endif
+#ifdef FRAME_CHAIN_VALID
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_CHAIN_VALID(chain, thisframe)",
+ XSTRING (FRAME_CHAIN_VALID (chain, thisframe)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n",
+ (long) current_gdbarch->frame_chain_valid
+ /*FRAME_CHAIN_VALID ()*/);
+#endif
+#ifdef FRAME_INIT_SAVED_REGS
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_INIT_SAVED_REGS(frame)",
+ XSTRING (FRAME_INIT_SAVED_REGS (frame)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
+ (long) current_gdbarch->frame_init_saved_regs
+ /*FRAME_INIT_SAVED_REGS ()*/);
+#endif
+#ifdef FRAME_LOCALS_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_LOCALS_ADDRESS(fi)",
+ XSTRING (FRAME_LOCALS_ADDRESS (fi)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->frame_locals_address
+ /*FRAME_LOCALS_ADDRESS ()*/);
+#endif
+#ifdef FRAME_NUM_ARGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_NUM_ARGS(frame)",
+ XSTRING (FRAME_NUM_ARGS (frame)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n",
+ (long) current_gdbarch->frame_num_args
+ /*FRAME_NUM_ARGS ()*/);
+#endif
+#ifdef FRAME_SAVED_PC
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_SAVED_PC(fi)",
+ XSTRING (FRAME_SAVED_PC (fi)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n",
+ (long) current_gdbarch->frame_saved_pc
+ /*FRAME_SAVED_PC ()*/);
+#endif
+#ifdef FUNCTION_START_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
+ XSTRING (FUNCTION_START_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
+ (long) FUNCTION_START_OFFSET);
+#endif
+#ifdef GET_LONGJMP_TARGET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "GET_LONGJMP_TARGET(pc)",
+ XSTRING (GET_LONGJMP_TARGET (pc)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n",
+ (long) current_gdbarch->get_longjmp_target
+ /*GET_LONGJMP_TARGET ()*/);
+#endif
+#ifdef GET_SAVED_REGISTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
+ XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->get_saved_register
+ /*GET_SAVED_REGISTER ()*/);
+#endif
+#ifdef INIT_EXTRA_FRAME_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
+ XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
+ (long) current_gdbarch->init_extra_frame_info
+ /*INIT_EXTRA_FRAME_INFO ()*/);
+#endif
+#ifdef INIT_FRAME_PC
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INIT_FRAME_PC(fromleaf, prev)",
+ XSTRING (INIT_FRAME_PC (fromleaf, prev)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
+ (long) current_gdbarch->init_frame_pc
+ /*INIT_FRAME_PC ()*/);
+#endif
+#ifdef INIT_FRAME_PC_FIRST
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INIT_FRAME_PC_FIRST(fromleaf, prev)",
+ XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
+ (long) current_gdbarch->init_frame_pc_first
+ /*INIT_FRAME_PC_FIRST ()*/);
+#endif
+#ifdef INNER_THAN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INNER_THAN(lhs, rhs)",
+ XSTRING (INNER_THAN (lhs, rhs)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INNER_THAN = 0x%08lx\n",
+ (long) current_gdbarch->inner_than
+ /*INNER_THAN ()*/);
+#endif
+#ifdef INTEGER_TO_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INTEGER_TO_ADDRESS(type, buf)",
+ XSTRING (INTEGER_TO_ADDRESS (type, buf)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INTEGER_TO_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->integer_to_address
+ /*INTEGER_TO_ADDRESS ()*/);
+#endif
+#ifdef IN_SOLIB_CALL_TRAMPOLINE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
+ XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
+ (long) current_gdbarch->in_solib_call_trampoline
+ /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
+#endif
+#ifdef MAX_REGISTER_RAW_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
+ XSTRING (MAX_REGISTER_RAW_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n",
+ MAX_REGISTER_RAW_SIZE);
+#endif
+#ifdef MAX_REGISTER_VIRTUAL_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
+ XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n",
+ MAX_REGISTER_VIRTUAL_SIZE);
+#endif
+#ifdef MEMORY_INSERT_BREAKPOINT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
+ XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n",
+ (long) current_gdbarch->memory_insert_breakpoint
+ /*MEMORY_INSERT_BREAKPOINT ()*/);
+#endif
+#ifdef MEMORY_REMOVE_BREAKPOINT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
+ XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n",
+ (long) current_gdbarch->memory_remove_breakpoint
+ /*MEMORY_REMOVE_BREAKPOINT ()*/);
+#endif
+#ifdef NNPC_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NNPC_REGNUM # %s\n",
+ XSTRING (NNPC_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NNPC_REGNUM = %d\n",
+ NNPC_REGNUM);
+#endif
+#ifdef NPC_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NPC_REGNUM # %s\n",
+ XSTRING (NPC_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NPC_REGNUM = %d\n",
+ NPC_REGNUM);
+#endif
+#ifdef NUM_PSEUDO_REGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
+ XSTRING (NUM_PSEUDO_REGS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
+ NUM_PSEUDO_REGS);
+#endif
+#ifdef NUM_REGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_REGS # %s\n",
+ XSTRING (NUM_REGS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_REGS = %d\n",
+ NUM_REGS);
+#endif
+#ifdef PARM_BOUNDARY
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PARM_BOUNDARY # %s\n",
+ XSTRING (PARM_BOUNDARY));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PARM_BOUNDARY = %d\n",
+ PARM_BOUNDARY);
+#endif
+#ifdef PC_IN_CALL_DUMMY
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PC_IN_CALL_DUMMY(pc, sp, frame_address)",
+ XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n",
+ (long) current_gdbarch->pc_in_call_dummy
+ /*PC_IN_CALL_DUMMY ()*/);
+#endif
+#ifdef PC_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PC_REGNUM # %s\n",
+ XSTRING (PC_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PC_REGNUM = %d\n",
+ PC_REGNUM);
+#endif
+#ifdef POINTER_TO_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "POINTER_TO_ADDRESS(type, buf)",
+ XSTRING (POINTER_TO_ADDRESS (type, buf)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->pointer_to_address
+ /*POINTER_TO_ADDRESS ()*/);
+#endif
+#ifdef POP_FRAME
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "POP_FRAME(-)",
+ XSTRING (POP_FRAME (-)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: POP_FRAME = 0x%08lx\n",
+ (long) current_gdbarch->pop_frame
+ /*POP_FRAME ()*/);
+#endif
+#ifdef PREPARE_TO_PROCEED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PREPARE_TO_PROCEED(select_it)",
+ XSTRING (PREPARE_TO_PROCEED (select_it)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n",
+ (long) current_gdbarch->prepare_to_proceed
+ /*PREPARE_TO_PROCEED ()*/);
+#endif
+#ifdef PRINT_FLOAT_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PRINT_FLOAT_INFO()",
+ XSTRING (PRINT_FLOAT_INFO ()));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PRINT_FLOAT_INFO = 0x%08lx\n",
+ (long) current_gdbarch->print_float_info
+ /*PRINT_FLOAT_INFO ()*/);
+#endif
+#ifdef PROLOGUE_FRAMELESS_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PROLOGUE_FRAMELESS_P(ip)",
+ XSTRING (PROLOGUE_FRAMELESS_P (ip)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n",
+ (long) current_gdbarch->prologue_frameless_p
+ /*PROLOGUE_FRAMELESS_P ()*/);
+#endif
+#ifdef PUSH_ARGUMENTS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
+ XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n",
+ (long) current_gdbarch->push_arguments
+ /*PUSH_ARGUMENTS ()*/);
+#endif
+#ifdef PUSH_DUMMY_FRAME
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PUSH_DUMMY_FRAME(-)",
+ XSTRING (PUSH_DUMMY_FRAME (-)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n",
+ (long) current_gdbarch->push_dummy_frame
+ /*PUSH_DUMMY_FRAME ()*/);
+#endif
+#ifdef PUSH_RETURN_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PUSH_RETURN_ADDRESS(pc, sp)",
+ XSTRING (PUSH_RETURN_ADDRESS (pc, sp)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->push_return_address
+ /*PUSH_RETURN_ADDRESS ()*/);
+#endif
+#ifdef REGISTER_BYTE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_BYTE(reg_nr)",
+ XSTRING (REGISTER_BYTE (reg_nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n",
+ (long) current_gdbarch->register_byte
+ /*REGISTER_BYTE ()*/);
+#endif
+#ifdef REGISTER_BYTES
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTES # %s\n",
+ XSTRING (REGISTER_BYTES));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTES = %d\n",
+ REGISTER_BYTES);
+#endif
+#ifdef REGISTER_BYTES_OK
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_BYTES_OK(nr_bytes)",
+ XSTRING (REGISTER_BYTES_OK (nr_bytes)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
+ (long) current_gdbarch->register_bytes_ok
+ /*REGISTER_BYTES_OK ()*/);
+#endif
+#ifdef REGISTER_CONVERTIBLE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_CONVERTIBLE(nr)",
+ XSTRING (REGISTER_CONVERTIBLE (nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n",
+ (long) current_gdbarch->register_convertible
+ /*REGISTER_CONVERTIBLE ()*/);
+#endif
+#ifdef REGISTER_CONVERT_TO_RAW
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
+ XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
+ (long) current_gdbarch->register_convert_to_raw
+ /*REGISTER_CONVERT_TO_RAW ()*/);
+#endif
+#ifdef REGISTER_CONVERT_TO_VIRTUAL
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
+ XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
+ (long) current_gdbarch->register_convert_to_virtual
+ /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
+#endif
+#ifdef REGISTER_NAME
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_NAME(regnr)",
+ XSTRING (REGISTER_NAME (regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_NAME = 0x%08lx\n",
+ (long) current_gdbarch->register_name
+ /*REGISTER_NAME ()*/);
+#endif
+#ifdef REGISTER_RAW_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_RAW_SIZE(reg_nr)",
+ XSTRING (REGISTER_RAW_SIZE (reg_nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n",
+ (long) current_gdbarch->register_raw_size
+ /*REGISTER_RAW_SIZE ()*/);
+#endif
+#ifdef REGISTER_SIM_REGNO
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_SIM_REGNO(reg_nr)",
+ XSTRING (REGISTER_SIM_REGNO (reg_nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n",
+ (long) current_gdbarch->register_sim_regno
+ /*REGISTER_SIM_REGNO ()*/);
+#endif
+#ifdef REGISTER_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIZE # %s\n",
+ XSTRING (REGISTER_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIZE = %d\n",
+ REGISTER_SIZE);
#endif
+#ifdef REGISTER_VIRTUAL_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_VIRTUAL_SIZE(reg_nr)",
+ XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
+ (long) current_gdbarch->register_virtual_size
+ /*REGISTER_VIRTUAL_SIZE ()*/);
#endif
-#ifndef TARGET_BYTE_ORDER_DEFAULT
-/* compat - Catch old non byte-order selectable targets that do not
- define TARGET_BYTE_ORDER_DEFAULT and instead expect
- TARGET_BYTE_ORDER to be used as the default. For targets that
- defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
- below will get a strange compiler warning. */
-#define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
+#ifdef REGISTER_VIRTUAL_TYPE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_VIRTUAL_TYPE(reg_nr)",
+ XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
+ (long) current_gdbarch->register_virtual_type
+ /*REGISTER_VIRTUAL_TYPE ()*/);
#endif
-int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
-int target_byte_order_auto = 1;
+#ifdef REG_STRUCT_HAS_ADDR
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REG_STRUCT_HAS_ADDR(gcc_p, type)",
+ XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n",
+ (long) current_gdbarch->reg_struct_has_addr
+ /*REG_STRUCT_HAS_ADDR ()*/);
+#endif
+#ifdef REMOTE_TRANSLATE_XFER_ADDRESS
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
+ XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->remote_translate_xfer_address
+ /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
+#endif
+#ifdef RETURN_VALUE_ON_STACK
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "RETURN_VALUE_ON_STACK(type)",
+ XSTRING (RETURN_VALUE_ON_STACK (type)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n",
+ (long) current_gdbarch->return_value_on_stack
+ /*RETURN_VALUE_ON_STACK ()*/);
+#endif
+#ifdef SAVED_PC_AFTER_CALL
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SAVED_PC_AFTER_CALL(frame)",
+ XSTRING (SAVED_PC_AFTER_CALL (frame)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n",
+ (long) current_gdbarch->saved_pc_after_call
+ /*SAVED_PC_AFTER_CALL ()*/);
+#endif
+#ifdef SAVE_DUMMY_FRAME_TOS
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SAVE_DUMMY_FRAME_TOS(sp)",
+ XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n",
+ (long) current_gdbarch->save_dummy_frame_tos
+ /*SAVE_DUMMY_FRAME_TOS ()*/);
+#endif
+#ifdef SDB_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SDB_REG_TO_REGNUM(sdb_regnr)",
+ XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->sdb_reg_to_regnum
+ /*SDB_REG_TO_REGNUM ()*/);
+#endif
+#ifdef SIZEOF_CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
+ XSTRING (SIZEOF_CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
+ (long) SIZEOF_CALL_DUMMY_WORDS);
+#endif
+#ifdef SKIP_PROLOGUE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SKIP_PROLOGUE(ip)",
+ XSTRING (SKIP_PROLOGUE (ip)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n",
+ (long) current_gdbarch->skip_prologue
+ /*SKIP_PROLOGUE ()*/);
+#endif
+#ifdef SKIP_TRAMPOLINE_CODE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SKIP_TRAMPOLINE_CODE(pc)",
+ XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n",
+ (long) current_gdbarch->skip_trampoline_code
+ /*SKIP_TRAMPOLINE_CODE ()*/);
+#endif
+#ifdef SMASH_TEXT_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SMASH_TEXT_ADDRESS(addr)",
+ XSTRING (SMASH_TEXT_ADDRESS (addr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->smash_text_address
+ /*SMASH_TEXT_ADDRESS ()*/);
+#endif
+#ifdef SOFTWARE_SINGLE_STEP
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
+ XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
+ (long) current_gdbarch->software_single_step
+ /*SOFTWARE_SINGLE_STEP ()*/);
+#endif
+#ifdef SP_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SP_REGNUM # %s\n",
+ XSTRING (SP_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SP_REGNUM = %d\n",
+ SP_REGNUM);
+#endif
+#ifdef STAB_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STAB_REG_TO_REGNUM(stab_regnr)",
+ XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->stab_reg_to_regnum
+ /*STAB_REG_TO_REGNUM ()*/);
+#endif
+#ifdef STACK_ALIGN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STACK_ALIGN(sp)",
+ XSTRING (STACK_ALIGN (sp)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STACK_ALIGN = 0x%08lx\n",
+ (long) current_gdbarch->stack_align
+ /*STACK_ALIGN ()*/);
+#endif
+#ifdef STORE_PSEUDO_REGISTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STORE_PSEUDO_REGISTER(regnum)",
+ XSTRING (STORE_PSEUDO_REGISTER (regnum)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->store_pseudo_register
+ /*STORE_PSEUDO_REGISTER ()*/);
+#endif
+#ifdef STORE_RETURN_VALUE
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STORE_RETURN_VALUE(type, valbuf)",
+ XSTRING (STORE_RETURN_VALUE (type, valbuf)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n",
+ (long) current_gdbarch->store_return_value
+ /*STORE_RETURN_VALUE ()*/);
+#endif
+#ifdef STORE_STRUCT_RETURN
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STORE_STRUCT_RETURN(addr, sp)",
+ XSTRING (STORE_STRUCT_RETURN (addr, sp)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n",
+ (long) current_gdbarch->store_struct_return
+ /*STORE_STRUCT_RETURN ()*/);
+#endif
+#ifdef TARGET_ADDR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
+ XSTRING (TARGET_ADDR_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
+ TARGET_ADDR_BIT);
+#endif
+#ifdef TARGET_ARCHITECTURE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
+ XSTRING (TARGET_ARCHITECTURE));
+ if (TARGET_ARCHITECTURE != NULL)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
+ TARGET_ARCHITECTURE->printable_name);
+#endif
+#ifdef TARGET_BFD_VMA_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
+ XSTRING (TARGET_BFD_VMA_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
+ TARGET_BFD_VMA_BIT);
+#endif
+#ifdef TARGET_BYTE_ORDER
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
+ XSTRING (TARGET_BYTE_ORDER));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
+ (long) TARGET_BYTE_ORDER);
+#endif
+#ifdef TARGET_CHAR_SIGNED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
+ XSTRING (TARGET_CHAR_SIGNED));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
+ TARGET_CHAR_SIGNED);
+#endif
+#ifdef TARGET_DOUBLE_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
+ XSTRING (TARGET_DOUBLE_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
+ TARGET_DOUBLE_BIT);
+#endif
+#ifdef TARGET_DOUBLE_FORMAT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
+ XSTRING (TARGET_DOUBLE_FORMAT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n",
+ (long) TARGET_DOUBLE_FORMAT);
+#endif
+#ifdef TARGET_FLOAT_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
+ XSTRING (TARGET_FLOAT_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
+ TARGET_FLOAT_BIT);
+#endif
+#ifdef TARGET_FLOAT_FORMAT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
+ XSTRING (TARGET_FLOAT_FORMAT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
+ (long) TARGET_FLOAT_FORMAT);
+#endif
+#ifdef TARGET_INT_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_INT_BIT # %s\n",
+ XSTRING (TARGET_INT_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_INT_BIT = %d\n",
+ TARGET_INT_BIT);
+#endif
+#ifdef TARGET_LONG_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_BIT # %s\n",
+ XSTRING (TARGET_LONG_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_BIT = %d\n",
+ TARGET_LONG_BIT);
+#endif
+#ifdef TARGET_LONG_DOUBLE_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
+ XSTRING (TARGET_LONG_DOUBLE_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
+ TARGET_LONG_DOUBLE_BIT);
+#endif
+#ifdef TARGET_LONG_DOUBLE_FORMAT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
+ XSTRING (TARGET_LONG_DOUBLE_FORMAT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
+ (long) TARGET_LONG_DOUBLE_FORMAT);
+#endif
+#ifdef TARGET_LONG_LONG_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
+ XSTRING (TARGET_LONG_LONG_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
+ TARGET_LONG_LONG_BIT);
+#endif
+#ifdef TARGET_PRINT_INSN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_PRINT_INSN(vma, info)",
+ XSTRING (TARGET_PRINT_INSN (vma, info)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n",
+ (long) current_gdbarch->print_insn
+ /*TARGET_PRINT_INSN ()*/);
+#endif
+#ifdef TARGET_PTR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PTR_BIT # %s\n",
+ XSTRING (TARGET_PTR_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PTR_BIT = %d\n",
+ TARGET_PTR_BIT);
+#endif
+#ifdef TARGET_READ_FP
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_READ_FP()",
+ XSTRING (TARGET_READ_FP ()));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n",
+ (long) current_gdbarch->read_fp
+ /*TARGET_READ_FP ()*/);
+#endif
+#ifdef TARGET_READ_PC
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_READ_PC(ptid)",
+ XSTRING (TARGET_READ_PC (ptid)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n",
+ (long) current_gdbarch->read_pc
+ /*TARGET_READ_PC ()*/);
+#endif
+#ifdef TARGET_READ_SP
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_READ_SP()",
+ XSTRING (TARGET_READ_SP ()));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n",
+ (long) current_gdbarch->read_sp
+ /*TARGET_READ_SP ()*/);
+#endif
+#ifdef TARGET_SHORT_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
+ XSTRING (TARGET_SHORT_BIT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
+ TARGET_SHORT_BIT);
+#endif
+#ifdef TARGET_VIRTUAL_FRAME_POINTER
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
+ XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n",
+ (long) current_gdbarch->virtual_frame_pointer
+ /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
+#endif
+#ifdef TARGET_WRITE_FP
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_WRITE_FP(val)",
+ XSTRING (TARGET_WRITE_FP (val)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
+ (long) current_gdbarch->write_fp
+ /*TARGET_WRITE_FP ()*/);
+#endif
+#ifdef TARGET_WRITE_PC
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_WRITE_PC(val, ptid)",
+ XSTRING (TARGET_WRITE_PC (val, ptid)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n",
+ (long) current_gdbarch->write_pc
+ /*TARGET_WRITE_PC ()*/);
+#endif
+#ifdef TARGET_WRITE_SP
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_WRITE_SP(val)",
+ XSTRING (TARGET_WRITE_SP (val)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n",
+ (long) current_gdbarch->write_sp
+ /*TARGET_WRITE_SP ()*/);
+#endif
+#ifdef USE_GENERIC_DUMMY_FRAMES
+ fprintf_unfiltered (file,
+ "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
+ XSTRING (USE_GENERIC_DUMMY_FRAMES));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %d\n",
+ USE_GENERIC_DUMMY_FRAMES);
+#endif
+#ifdef USE_STRUCT_CONVENTION
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "USE_STRUCT_CONVENTION(gcc_p, value_type)",
+ XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n",
+ (long) current_gdbarch->use_struct_convention
+ /*USE_STRUCT_CONVENTION ()*/);
+#endif
+ if (current_gdbarch->dump_tdep != NULL)
+ current_gdbarch->dump_tdep (current_gdbarch, file);
+}
-/* Chain containing the \"set endian\" commands. */
-static struct cmd_list_element *endianlist = NULL;
+struct gdbarch_tdep *
+gdbarch_tdep (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
+ return gdbarch->tdep;
+}
-/* Called by ``show endian''. */
-static void show_endian PARAMS ((char *, int));
-static void
-show_endian (args, from_tty)
- char *args;
- int from_tty;
+
+const struct bfd_arch_info *
+gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
{
- 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");
- printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
+ return gdbarch->bfd_arch_info;
}
-/* Called if the user enters ``set endian'' without an argument. */
-static void set_endian PARAMS ((char *, int));
-static void
-set_endian (args, from_tty)
- char *args;
- int from_tty;
+int
+gdbarch_byte_order (struct gdbarch *gdbarch)
{
- printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
- show_endian (args, from_tty);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
+ return gdbarch->byte_order;
}
-/* Called by ``set endian big''. */
-static void set_endian_big PARAMS ((char *, int));
-static void
-set_endian_big (args, from_tty)
- char *args;
- int from_tty;
+int
+gdbarch_short_bit (struct gdbarch *gdbarch)
{
- if (TARGET_BYTE_ORDER_SELECTABLE_P)
- {
- target_byte_order = BIG_ENDIAN;
- target_byte_order_auto = 0;
- }
- else
- {
- printf_unfiltered ("Byte order is not selectable.");
- show_endian (args, from_tty);
- }
+ /* Skip verify of short_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
+ return gdbarch->short_bit;
+}
+
+void
+set_gdbarch_short_bit (struct gdbarch *gdbarch,
+ int short_bit)
+{
+ gdbarch->short_bit = short_bit;
+}
+
+int
+gdbarch_int_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of int_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
+ return gdbarch->int_bit;
+}
+
+void
+set_gdbarch_int_bit (struct gdbarch *gdbarch,
+ int int_bit)
+{
+ gdbarch->int_bit = int_bit;
+}
+
+int
+gdbarch_long_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of long_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
+ return gdbarch->long_bit;
+}
+
+void
+set_gdbarch_long_bit (struct gdbarch *gdbarch,
+ int long_bit)
+{
+ gdbarch->long_bit = long_bit;
}
-/* Called by ``set endian little''. */
-static void set_endian_little PARAMS ((char *, int));
+int
+gdbarch_long_long_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of long_long_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
+ return gdbarch->long_long_bit;
+}
+
+void
+set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
+ int long_long_bit)
+{
+ gdbarch->long_long_bit = long_long_bit;
+}
+
+int
+gdbarch_float_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of float_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
+ return gdbarch->float_bit;
+}
+
+void
+set_gdbarch_float_bit (struct gdbarch *gdbarch,
+ int float_bit)
+{
+ gdbarch->float_bit = float_bit;
+}
+
+int
+gdbarch_double_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of double_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
+ return gdbarch->double_bit;
+}
+
+void
+set_gdbarch_double_bit (struct gdbarch *gdbarch,
+ int double_bit)
+{
+ gdbarch->double_bit = double_bit;
+}
+
+int
+gdbarch_long_double_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of long_double_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
+ return gdbarch->long_double_bit;
+}
+
+void
+set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
+ int long_double_bit)
+{
+ gdbarch->long_double_bit = long_double_bit;
+}
+
+int
+gdbarch_ptr_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of ptr_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
+ return gdbarch->ptr_bit;
+}
+
+void
+set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
+ int ptr_bit)
+{
+ gdbarch->ptr_bit = ptr_bit;
+}
+
+int
+gdbarch_addr_bit (struct gdbarch *gdbarch)
+{
+ if (gdbarch->addr_bit == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_addr_bit invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
+ return gdbarch->addr_bit;
+}
+
+void
+set_gdbarch_addr_bit (struct gdbarch *gdbarch,
+ int addr_bit)
+{
+ gdbarch->addr_bit = addr_bit;
+}
+
+int
+gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of bfd_vma_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
+ return gdbarch->bfd_vma_bit;
+}
+
+void
+set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
+ int bfd_vma_bit)
+{
+ gdbarch->bfd_vma_bit = bfd_vma_bit;
+}
+
+int
+gdbarch_char_signed (struct gdbarch *gdbarch)
+{
+ if (gdbarch->char_signed == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_char_signed invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
+ return gdbarch->char_signed;
+}
+
+void
+set_gdbarch_char_signed (struct gdbarch *gdbarch,
+ int char_signed)
+{
+ gdbarch->char_signed = char_signed;
+}
+
+CORE_ADDR
+gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
+{
+ if (gdbarch->read_pc == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_read_pc invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
+ return gdbarch->read_pc (ptid);
+}
+
+void
+set_gdbarch_read_pc (struct gdbarch *gdbarch,
+ gdbarch_read_pc_ftype read_pc)
+{
+ gdbarch->read_pc = read_pc;
+}
+
+void
+gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
+{
+ if (gdbarch->write_pc == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_write_pc invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
+ gdbarch->write_pc (val, ptid);
+}
+
+void
+set_gdbarch_write_pc (struct gdbarch *gdbarch,
+ gdbarch_write_pc_ftype write_pc)
+{
+ gdbarch->write_pc = write_pc;
+}
+
+CORE_ADDR
+gdbarch_read_fp (struct gdbarch *gdbarch)
+{
+ if (gdbarch->read_fp == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_read_fp invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
+ return gdbarch->read_fp ();
+}
+
+void
+set_gdbarch_read_fp (struct gdbarch *gdbarch,
+ gdbarch_read_fp_ftype read_fp)
+{
+ gdbarch->read_fp = read_fp;
+}
+
+void
+gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
+{
+ if (gdbarch->write_fp == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_write_fp invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
+ gdbarch->write_fp (val);
+}
+
+void
+set_gdbarch_write_fp (struct gdbarch *gdbarch,
+ gdbarch_write_fp_ftype write_fp)
+{
+ gdbarch->write_fp = write_fp;
+}
+
+CORE_ADDR
+gdbarch_read_sp (struct gdbarch *gdbarch)
+{
+ if (gdbarch->read_sp == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_read_sp invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
+ return gdbarch->read_sp ();
+}
+
+void
+set_gdbarch_read_sp (struct gdbarch *gdbarch,
+ gdbarch_read_sp_ftype read_sp)
+{
+ gdbarch->read_sp = read_sp;
+}
+
+void
+gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
+{
+ if (gdbarch->write_sp == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_write_sp invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
+ gdbarch->write_sp (val);
+}
+
+void
+set_gdbarch_write_sp (struct gdbarch *gdbarch,
+ gdbarch_write_sp_ftype write_sp)
+{
+ gdbarch->write_sp = write_sp;
+}
+
+void
+gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
+{
+ if (gdbarch->virtual_frame_pointer == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_virtual_frame_pointer invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
+ gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
+}
+
+void
+set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
+ gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
+{
+ gdbarch->virtual_frame_pointer = virtual_frame_pointer;
+}
+
+int
+gdbarch_register_read_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->register_read != 0;
+}
+
+void
+gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
+{
+ if (gdbarch->register_read == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_read invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n");
+ gdbarch->register_read (gdbarch, regnum, buf);
+}
+
+void
+set_gdbarch_register_read (struct gdbarch *gdbarch,
+ gdbarch_register_read_ftype register_read)
+{
+ gdbarch->register_read = register_read;
+}
+
+int
+gdbarch_register_write_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->register_write != 0;
+}
+
+void
+gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
+{
+ if (gdbarch->register_write == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_write invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n");
+ gdbarch->register_write (gdbarch, regnum, buf);
+}
+
+void
+set_gdbarch_register_write (struct gdbarch *gdbarch,
+ gdbarch_register_write_ftype register_write)
+{
+ gdbarch->register_write = register_write;
+}
+
+int
+gdbarch_num_regs (struct gdbarch *gdbarch)
+{
+ if (gdbarch->num_regs == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_num_regs invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
+ return gdbarch->num_regs;
+}
+
+void
+set_gdbarch_num_regs (struct gdbarch *gdbarch,
+ int num_regs)
+{
+ gdbarch->num_regs = num_regs;
+}
+
+int
+gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
+{
+ /* Skip verify of num_pseudo_regs, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
+ return gdbarch->num_pseudo_regs;
+}
+
+void
+set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
+ int num_pseudo_regs)
+{
+ gdbarch->num_pseudo_regs = num_pseudo_regs;
+}
+
+int
+gdbarch_sp_regnum (struct gdbarch *gdbarch)
+{
+ if (gdbarch->sp_regnum == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_sp_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
+ return gdbarch->sp_regnum;
+}
+
+void
+set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
+ int sp_regnum)
+{
+ gdbarch->sp_regnum = sp_regnum;
+}
+
+int
+gdbarch_fp_regnum (struct gdbarch *gdbarch)
+{
+ if (gdbarch->fp_regnum == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_fp_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
+ return gdbarch->fp_regnum;
+}
+
+void
+set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
+ int fp_regnum)
+{
+ gdbarch->fp_regnum = fp_regnum;
+}
+
+int
+gdbarch_pc_regnum (struct gdbarch *gdbarch)
+{
+ if (gdbarch->pc_regnum == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_pc_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
+ return gdbarch->pc_regnum;
+}
+
+void
+set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
+ int pc_regnum)
+{
+ gdbarch->pc_regnum = pc_regnum;
+}
+
+int
+gdbarch_fp0_regnum (struct gdbarch *gdbarch)
+{
+ /* Skip verify of fp0_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
+ return gdbarch->fp0_regnum;
+}
+
+void
+set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
+ int fp0_regnum)
+{
+ gdbarch->fp0_regnum = fp0_regnum;
+}
+
+int
+gdbarch_npc_regnum (struct gdbarch *gdbarch)
+{
+ /* Skip verify of npc_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
+ return gdbarch->npc_regnum;
+}
+
+void
+set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
+ int npc_regnum)
+{
+ gdbarch->npc_regnum = npc_regnum;
+}
+
+int
+gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
+{
+ /* Skip verify of nnpc_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
+ return gdbarch->nnpc_regnum;
+}
+
+void
+set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
+ int nnpc_regnum)
+{
+ gdbarch->nnpc_regnum = nnpc_regnum;
+}
+
+int
+gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
+{
+ if (gdbarch->stab_reg_to_regnum == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_stab_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
+ return gdbarch->stab_reg_to_regnum (stab_regnr);
+}
+
+void
+set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
+{
+ gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
+}
+
+int
+gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
+{
+ if (gdbarch->ecoff_reg_to_regnum == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
+ return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
+}
+
+void
+set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
+{
+ gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
+}
+
+int
+gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
+{
+ if (gdbarch->dwarf_reg_to_regnum == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
+ return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
+}
+
+void
+set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
+{
+ gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
+}
+
+int
+gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
+{
+ if (gdbarch->sdb_reg_to_regnum == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
+ return gdbarch->sdb_reg_to_regnum (sdb_regnr);
+}
+
+void
+set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
+{
+ gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
+}
+
+int
+gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
+{
+ if (gdbarch->dwarf2_reg_to_regnum == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
+ return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
+}
+
+void
+set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
+{
+ gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
+}
+
+char *
+gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
+{
+ if (gdbarch->register_name == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_name invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
+ return gdbarch->register_name (regnr);
+}
+
+void
+set_gdbarch_register_name (struct gdbarch *gdbarch,
+ gdbarch_register_name_ftype register_name)
+{
+ gdbarch->register_name = register_name;
+}
+
+int
+gdbarch_register_size (struct gdbarch *gdbarch)
+{
+ if (gdbarch->register_size == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_size invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
+ return gdbarch->register_size;
+}
+
+void
+set_gdbarch_register_size (struct gdbarch *gdbarch,
+ int register_size)
+{
+ gdbarch->register_size = register_size;
+}
+
+int
+gdbarch_register_bytes (struct gdbarch *gdbarch)
+{
+ if (gdbarch->register_bytes == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_bytes invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
+ return gdbarch->register_bytes;
+}
+
+void
+set_gdbarch_register_bytes (struct gdbarch *gdbarch,
+ int register_bytes)
+{
+ gdbarch->register_bytes = register_bytes;
+}
+
+int
+gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
+{
+ if (gdbarch->register_byte == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_byte invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
+ return gdbarch->register_byte (reg_nr);
+}
+
+void
+set_gdbarch_register_byte (struct gdbarch *gdbarch,
+ gdbarch_register_byte_ftype register_byte)
+{
+ gdbarch->register_byte = register_byte;
+}
+
+int
+gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
+{
+ if (gdbarch->register_raw_size == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_raw_size invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
+ return gdbarch->register_raw_size (reg_nr);
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->max_register_raw_size == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_max_register_raw_size invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
+ return gdbarch->max_register_raw_size;
+}
+
+void
+set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
+ int max_register_raw_size)
+{
+ gdbarch->max_register_raw_size = max_register_raw_size;
+}
+
+int
+gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
+{
+ if (gdbarch->register_virtual_size == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_virtual_size invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
+ return gdbarch->register_virtual_size (reg_nr);
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->max_register_virtual_size == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_max_register_virtual_size invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
+ return gdbarch->max_register_virtual_size;
+}
+
+void
+set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
+ int max_register_virtual_size)
+{
+ gdbarch->max_register_virtual_size = max_register_virtual_size;
+}
+
+struct type *
+gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
+{
+ if (gdbarch->register_virtual_type == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_virtual_type invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
+ return gdbarch->register_virtual_type (reg_nr);
+}
+
+void
+set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
+ gdbarch_register_virtual_type_ftype register_virtual_type)
+{
+ gdbarch->register_virtual_type = register_virtual_type;
+}
+
+void
+gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
+{
+ if (gdbarch->do_registers_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_do_registers_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
+ gdbarch->do_registers_info (reg_nr, fpregs);
+}
+
+void
+set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
+ gdbarch_do_registers_info_ftype do_registers_info)
+{
+ gdbarch->do_registers_info = do_registers_info;
+}
+
+void
+gdbarch_print_float_info (struct gdbarch *gdbarch)
+{
+ if (gdbarch->print_float_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_float_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
+ gdbarch->print_float_info ();
+}
+
+void
+set_gdbarch_print_float_info (struct gdbarch *gdbarch,
+ gdbarch_print_float_info_ftype print_float_info)
+{
+ gdbarch->print_float_info = print_float_info;
+}
+
+int
+gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
+{
+ if (gdbarch->register_sim_regno == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_sim_regno invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
+ return gdbarch->register_sim_regno (reg_nr);
+}
+
+void
+set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
+ gdbarch_register_sim_regno_ftype register_sim_regno)
+{
+ gdbarch->register_sim_regno = register_sim_regno;
+}
+
+int
+gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->register_bytes_ok != 0;
+}
+
+int
+gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
+{
+ if (gdbarch->register_bytes_ok == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_bytes_ok invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
+ return gdbarch->register_bytes_ok (nr_bytes);
+}
+
+void
+set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
+ gdbarch_register_bytes_ok_ftype register_bytes_ok)
+{
+ gdbarch->register_bytes_ok = register_bytes_ok;
+}
+
+int
+gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->cannot_fetch_register == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_cannot_fetch_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
+ return gdbarch->cannot_fetch_register (regnum);
+}
+
+void
+set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
+ gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
+{
+ gdbarch->cannot_fetch_register = cannot_fetch_register;
+}
+
+int
+gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->cannot_store_register == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_cannot_store_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
+ return gdbarch->cannot_store_register (regnum);
+}
+
+void
+set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
+ gdbarch_cannot_store_register_ftype cannot_store_register)
+{
+ gdbarch->cannot_store_register = cannot_store_register;
+}
+
+int
+gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->get_longjmp_target != 0;
+}
+
+int
+gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
+{
+ if (gdbarch->get_longjmp_target == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_get_longjmp_target invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
+ return gdbarch->get_longjmp_target (pc);
+}
+
+void
+set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
+ gdbarch_get_longjmp_target_ftype get_longjmp_target)
+{
+ gdbarch->get_longjmp_target = get_longjmp_target;
+}
+
+int
+gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
+{
+ if (gdbarch->use_generic_dummy_frames == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_use_generic_dummy_frames invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
+ return gdbarch->use_generic_dummy_frames;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_location == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_location invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
+ return gdbarch->call_dummy_location;
+}
+
+void
+set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
+ int call_dummy_location)
+{
+ gdbarch->call_dummy_location = call_dummy_location;
+}
+
+CORE_ADDR
+gdbarch_call_dummy_address (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
+ return gdbarch->call_dummy_address ();
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_start_offset == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_start_offset invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
+ return gdbarch->call_dummy_start_offset;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
+ return gdbarch->call_dummy_breakpoint_offset;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_breakpoint_offset_p == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
+ return gdbarch->call_dummy_breakpoint_offset_p;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_length == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_length invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
+ return gdbarch->call_dummy_length;
+}
+
+void
+set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
+ int call_dummy_length)
+{
+ gdbarch->call_dummy_length = call_dummy_length;
+}
+
+int
+gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
+{
+ if (gdbarch->pc_in_call_dummy == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_pc_in_call_dummy invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
+ return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_p == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
+ return gdbarch->call_dummy_p;
+}
+
+void
+set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
+ int call_dummy_p)
+{
+ gdbarch->call_dummy_p = call_dummy_p;
+}
+
+LONGEST *
+gdbarch_call_dummy_words (struct gdbarch *gdbarch)
+{
+ /* Skip verify of call_dummy_words, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
+ return gdbarch->call_dummy_words;
+}
+
+void
+set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
+ LONGEST * call_dummy_words)
+{
+ gdbarch->call_dummy_words = call_dummy_words;
+}
+
+int
+gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
+{
+ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
+ return gdbarch->sizeof_call_dummy_words;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_stack_adjust_p == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
+ return gdbarch->call_dummy_stack_adjust_p;
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
+ return gdbarch->call_dummy_stack_adjust;
+}
+
+void
+set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
+ int call_dummy_stack_adjust)
+{
+ gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
+}
+
+void
+gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
+{
+ if (gdbarch->fix_call_dummy == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_fix_call_dummy invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
+ gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
+}
+
+void
+set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
+ gdbarch_fix_call_dummy_ftype fix_call_dummy)
+{
+ gdbarch->fix_call_dummy = fix_call_dummy;
+}
+
+void
+gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+{
+ if (gdbarch->init_frame_pc_first == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_init_frame_pc_first invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
+ gdbarch->init_frame_pc_first (fromleaf, prev);
+}
+
+void
+set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
+ gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
+{
+ gdbarch->init_frame_pc_first = init_frame_pc_first;
+}
+
+void
+gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+{
+ if (gdbarch->init_frame_pc == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_init_frame_pc invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n");
+ gdbarch->init_frame_pc (fromleaf, prev);
+}
+
+void
+set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
+ gdbarch_init_frame_pc_ftype init_frame_pc)
+{
+ gdbarch->init_frame_pc = init_frame_pc;
+}
+
+int
+gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
+ return gdbarch->believe_pcc_promotion;
+}
+
+void
+set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
+ int believe_pcc_promotion)
+{
+ gdbarch->believe_pcc_promotion = believe_pcc_promotion;
+}
+
+int
+gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
+ return gdbarch->believe_pcc_promotion_type;
+}
+
+void
+set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
+ int believe_pcc_promotion_type)
+{
+ gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
+}
+
+int
+gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
+{
+ if (gdbarch->coerce_float_to_double == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_coerce_float_to_double invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
+ return gdbarch->coerce_float_to_double (formal, actual);
+}
+
+void
+set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
+ gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
+{
+ gdbarch->coerce_float_to_double = coerce_float_to_double;
+}
+
+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)
+{
+ if (gdbarch->get_saved_register == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_get_saved_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
+ gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
+}
+
+void
+set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
+ gdbarch_get_saved_register_ftype get_saved_register)
+{
+ gdbarch->get_saved_register = get_saved_register;
+}
+
+int
+gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
+{
+ if (gdbarch->register_convertible == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_convertible invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
+ return gdbarch->register_convertible (nr);
+}
+
+void
+set_gdbarch_register_convertible (struct gdbarch *gdbarch,
+ gdbarch_register_convertible_ftype register_convertible)
+{
+ gdbarch->register_convertible = register_convertible;
+}
+
+void
+gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
+{
+ if (gdbarch->register_convert_to_virtual == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_convert_to_virtual invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
+ gdbarch->register_convert_to_virtual (regnum, type, from, to);
+}
+
+void
+set_gdbarch_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;
+}
+
+void
+gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
+{
+ if (gdbarch->register_convert_to_raw == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_convert_to_raw invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
+ gdbarch->register_convert_to_raw (type, regnum, from, to);
+}
+
+void
+set_gdbarch_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;
+}
+
+int
+gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->fetch_pseudo_register != 0;
+}
+
+void
+gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->fetch_pseudo_register == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_fetch_pseudo_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
+ gdbarch->fetch_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
+ gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
+{
+ gdbarch->fetch_pseudo_register = fetch_pseudo_register;
+}
+
+int
+gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->store_pseudo_register != 0;
+}
+
+void
+gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->store_pseudo_register == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_store_pseudo_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
+ gdbarch->store_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
+ gdbarch_store_pseudo_register_ftype store_pseudo_register)
+{
+ gdbarch->store_pseudo_register = store_pseudo_register;
+}
+
+CORE_ADDR
+gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
+{
+ if (gdbarch->pointer_to_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_pointer_to_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
+ return gdbarch->pointer_to_address (type, buf);
+}
+
+void
+set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
+ gdbarch_pointer_to_address_ftype pointer_to_address)
+{
+ gdbarch->pointer_to_address = pointer_to_address;
+}
+
+void
+gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
+{
+ if (gdbarch->address_to_pointer == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_address_to_pointer invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
+ gdbarch->address_to_pointer (type, buf, addr);
+}
+
+void
+set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
+ gdbarch_address_to_pointer_ftype address_to_pointer)
+{
+ gdbarch->address_to_pointer = address_to_pointer;
+}
+
+int
+gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->integer_to_address != 0;
+}
+
+CORE_ADDR
+gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
+{
+ if (gdbarch->integer_to_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_integer_to_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
+ return gdbarch->integer_to_address (type, buf);
+}
+
+void
+set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
+ gdbarch_integer_to_address_ftype integer_to_address)
+{
+ gdbarch->integer_to_address = integer_to_address;
+}
+
+int
+gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
+{
+ if (gdbarch->return_value_on_stack == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_return_value_on_stack invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
+ return gdbarch->return_value_on_stack (type);
+}
+
+void
+set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
+ gdbarch_return_value_on_stack_ftype return_value_on_stack)
+{
+ gdbarch->return_value_on_stack = return_value_on_stack;
+}
+
+void
+gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
+{
+ if (gdbarch->extract_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_extract_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
+ gdbarch->extract_return_value (type, regbuf, valbuf);
+}
+
+void
+set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
+ gdbarch_extract_return_value_ftype extract_return_value)
+{
+ gdbarch->extract_return_value = extract_return_value;
+}
+
+CORE_ADDR
+gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
+{
+ if (gdbarch->push_arguments == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_push_arguments invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
+ return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
+}
+
+void
+set_gdbarch_push_arguments (struct gdbarch *gdbarch,
+ gdbarch_push_arguments_ftype push_arguments)
+{
+ gdbarch->push_arguments = push_arguments;
+}
+
+void
+gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
+{
+ if (gdbarch->push_dummy_frame == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_push_dummy_frame invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
+ gdbarch->push_dummy_frame ();
+}
+
+void
+set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
+ gdbarch_push_dummy_frame_ftype push_dummy_frame)
+{
+ gdbarch->push_dummy_frame = push_dummy_frame;
+}
+
+int
+gdbarch_push_return_address_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->push_return_address != 0;
+}
+
+CORE_ADDR
+gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
+{
+ if (gdbarch->push_return_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_push_return_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
+ return gdbarch->push_return_address (pc, sp);
+}
+
+void
+set_gdbarch_push_return_address (struct gdbarch *gdbarch,
+ gdbarch_push_return_address_ftype push_return_address)
+{
+ gdbarch->push_return_address = push_return_address;
+}
+
+void
+gdbarch_pop_frame (struct gdbarch *gdbarch)
+{
+ if (gdbarch->pop_frame == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_pop_frame invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
+ gdbarch->pop_frame ();
+}
+
+void
+set_gdbarch_pop_frame (struct gdbarch *gdbarch,
+ gdbarch_pop_frame_ftype pop_frame)
+{
+ gdbarch->pop_frame = pop_frame;
+}
+
+void
+gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
+{
+ if (gdbarch->store_struct_return == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_store_struct_return invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
+ gdbarch->store_struct_return (addr, sp);
+}
+
+void
+set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
+ gdbarch_store_struct_return_ftype store_struct_return)
+{
+ gdbarch->store_struct_return = store_struct_return;
+}
+
+void
+gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
+{
+ if (gdbarch->store_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_store_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
+ gdbarch->store_return_value (type, valbuf);
+}
+
+void
+set_gdbarch_store_return_value (struct gdbarch *gdbarch,
+ gdbarch_store_return_value_ftype store_return_value)
+{
+ gdbarch->store_return_value = store_return_value;
+}
+
+int
+gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->extract_struct_value_address != 0;
+}
+
+CORE_ADDR
+gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
+{
+ if (gdbarch->extract_struct_value_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_extract_struct_value_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
+ return gdbarch->extract_struct_value_address (regbuf);
+}
+
+void
+set_gdbarch_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;
+}
+
+int
+gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
+{
+ if (gdbarch->use_struct_convention == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_use_struct_convention invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
+ return gdbarch->use_struct_convention (gcc_p, value_type);
+}
+
+void
+set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
+ gdbarch_use_struct_convention_ftype use_struct_convention)
+{
+ gdbarch->use_struct_convention = use_struct_convention;
+}
+
+void
+gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+ if (gdbarch->frame_init_saved_regs == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_init_saved_regs invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
+ gdbarch->frame_init_saved_regs (frame);
+}
+
+void
+set_gdbarch_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;
+}
+
+int
+gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->init_extra_frame_info != 0;
+}
+
+void
+gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
+{
+ if (gdbarch->init_extra_frame_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_init_extra_frame_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
+ gdbarch->init_extra_frame_info (fromleaf, frame);
+}
+
+void
+set_gdbarch_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;
+}
+
+CORE_ADDR
+gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
+{
+ if (gdbarch->skip_prologue == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_skip_prologue invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
+ return gdbarch->skip_prologue (ip);
+}
+
+void
+set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
+ gdbarch_skip_prologue_ftype skip_prologue)
+{
+ gdbarch->skip_prologue = skip_prologue;
+}
+
+int
+gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
+{
+ if (gdbarch->prologue_frameless_p == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_prologue_frameless_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n");
+ return gdbarch->prologue_frameless_p (ip);
+}
+
+void
+set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
+ gdbarch_prologue_frameless_p_ftype prologue_frameless_p)
+{
+ gdbarch->prologue_frameless_p = prologue_frameless_p;
+}
+
+int
+gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
+{
+ if (gdbarch->inner_than == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_inner_than invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
+ return gdbarch->inner_than (lhs, rhs);
+}
+
+void
+set_gdbarch_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)
+{
+ if (gdbarch->breakpoint_from_pc == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_breakpoint_from_pc invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
+ return gdbarch->breakpoint_from_pc (pcptr, lenptr);
+}
+
+void
+set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
+ gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
+{
+ gdbarch->breakpoint_from_pc = breakpoint_from_pc;
+}
+
+int
+gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
+{
+ if (gdbarch->memory_insert_breakpoint == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_memory_insert_breakpoint invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
+ return gdbarch->memory_insert_breakpoint (addr, contents_cache);
+}
+
+void
+set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
+ gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
+{
+ gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
+}
+
+int
+gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
+{
+ if (gdbarch->memory_remove_breakpoint == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_memory_remove_breakpoint invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
+ return gdbarch->memory_remove_breakpoint (addr, contents_cache);
+}
+
+void
+set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
+ gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
+{
+ gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
+}
+
+CORE_ADDR
+gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
+{
+ if (gdbarch->decr_pc_after_break == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_decr_pc_after_break invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
+ return gdbarch->decr_pc_after_break;
+}
+
+void
+set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
+ CORE_ADDR decr_pc_after_break)
+{
+ gdbarch->decr_pc_after_break = decr_pc_after_break;
+}
+
+int
+gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
+{
+ if (gdbarch->prepare_to_proceed == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_prepare_to_proceed invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n");
+ return gdbarch->prepare_to_proceed (select_it);
+}
+
+void
+set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
+ gdbarch_prepare_to_proceed_ftype prepare_to_proceed)
+{
+ gdbarch->prepare_to_proceed = prepare_to_proceed;
+}
+
+CORE_ADDR
+gdbarch_function_start_offset (struct gdbarch *gdbarch)
+{
+ if (gdbarch->function_start_offset == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_function_start_offset invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
+ return gdbarch->function_start_offset;
+}
+
+void
+set_gdbarch_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)
+{
+ if (gdbarch->remote_translate_xfer_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_remote_translate_xfer_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
+ gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
+}
+
+void
+set_gdbarch_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 (struct gdbarch *gdbarch)
+{
+ if (gdbarch->frame_args_skip == -1)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_args_skip invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
+ return gdbarch->frame_args_skip;
+}
+
+void
+set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
+ CORE_ADDR frame_args_skip)
+{
+ gdbarch->frame_args_skip = frame_args_skip;
+}
+
+int
+gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
+{
+ if (gdbarch->frameless_function_invocation == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frameless_function_invocation invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
+ return gdbarch->frameless_function_invocation (fi);
+}
+
+void
+set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
+ gdbarch_frameless_function_invocation_ftype frameless_function_invocation)
+{
+ gdbarch->frameless_function_invocation = frameless_function_invocation;
+}
+
+CORE_ADDR
+gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+ if (gdbarch->frame_chain == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_chain invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
+ return gdbarch->frame_chain (frame);
+}
+
+void
+set_gdbarch_frame_chain (struct gdbarch *gdbarch,
+ gdbarch_frame_chain_ftype frame_chain)
+{
+ gdbarch->frame_chain = frame_chain;
+}
+
+int
+gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
+{
+ if (gdbarch->frame_chain_valid == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_chain_valid invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
+ return gdbarch->frame_chain_valid (chain, thisframe);
+}
+
+void
+set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
+ gdbarch_frame_chain_valid_ftype frame_chain_valid)
+{
+ gdbarch->frame_chain_valid = frame_chain_valid;
+}
+
+CORE_ADDR
+gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
+{
+ if (gdbarch->frame_saved_pc == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_saved_pc invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
+ return gdbarch->frame_saved_pc (fi);
+}
+
+void
+set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
+ gdbarch_frame_saved_pc_ftype frame_saved_pc)
+{
+ gdbarch->frame_saved_pc = frame_saved_pc;
+}
+
+CORE_ADDR
+gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
+{
+ if (gdbarch->frame_args_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_args_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
+ return gdbarch->frame_args_address (fi);
+}
+
+void
+set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
+ gdbarch_frame_args_address_ftype frame_args_address)
+{
+ gdbarch->frame_args_address = frame_args_address;
+}
+
+CORE_ADDR
+gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
+{
+ if (gdbarch->frame_locals_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_locals_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
+ return gdbarch->frame_locals_address (fi);
+}
+
+void
+set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
+ gdbarch_frame_locals_address_ftype frame_locals_address)
+{
+ gdbarch->frame_locals_address = frame_locals_address;
+}
+
+CORE_ADDR
+gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+ if (gdbarch->saved_pc_after_call == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_saved_pc_after_call invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
+ return gdbarch->saved_pc_after_call (frame);
+}
+
+void
+set_gdbarch_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;
+}
+
+int
+gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+ if (gdbarch->frame_num_args == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_frame_num_args invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
+ return gdbarch->frame_num_args (frame);
+}
+
+void
+set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
+ gdbarch_frame_num_args_ftype frame_num_args)
+{
+ gdbarch->frame_num_args = frame_num_args;
+}
+
+int
+gdbarch_stack_align_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->stack_align != 0;
+}
+
+CORE_ADDR
+gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ if (gdbarch->stack_align == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_stack_align invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
+ return gdbarch->stack_align (sp);
+}
+
+void
+set_gdbarch_stack_align (struct gdbarch *gdbarch,
+ gdbarch_stack_align_ftype stack_align)
+{
+ gdbarch->stack_align = stack_align;
+}
+
+int
+gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
+{
+ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
+ return gdbarch->extra_stack_alignment_needed;
+}
+
+void
+set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
+ int extra_stack_alignment_needed)
+{
+ gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
+}
+
+int
+gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->reg_struct_has_addr != 0;
+}
+
+int
+gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
+{
+ if (gdbarch->reg_struct_has_addr == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_reg_struct_has_addr invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
+ return gdbarch->reg_struct_has_addr (gcc_p, type);
+}
+
+void
+set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
+ gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
+{
+ gdbarch->reg_struct_has_addr = reg_struct_has_addr;
+}
+
+int
+gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->save_dummy_frame_tos != 0;
+}
+
+void
+gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ if (gdbarch->save_dummy_frame_tos == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_save_dummy_frame_tos invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n");
+ gdbarch->save_dummy_frame_tos (sp);
+}
+
+void
+set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
+ gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos)
+{
+ gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
+}
+
+int
+gdbarch_parm_boundary (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
+ return gdbarch->parm_boundary;
+}
+
+void
+set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
+ int parm_boundary)
+{
+ gdbarch->parm_boundary = parm_boundary;
+}
+
+const struct floatformat *
+gdbarch_float_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
+ return gdbarch->float_format;
+}
+
+void
+set_gdbarch_float_format (struct gdbarch *gdbarch,
+ const struct floatformat * float_format)
+{
+ gdbarch->float_format = float_format;
+}
+
+const struct floatformat *
+gdbarch_double_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
+ return gdbarch->double_format;
+}
+
+void
+set_gdbarch_double_format (struct gdbarch *gdbarch,
+ const struct floatformat * double_format)
+{
+ gdbarch->double_format = double_format;
+}
+
+const struct floatformat *
+gdbarch_long_double_format (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
+ return gdbarch->long_double_format;
+}
+
+void
+set_gdbarch_long_double_format (struct gdbarch *gdbarch,
+ const struct floatformat * long_double_format)
+{
+ gdbarch->long_double_format = long_double_format;
+}
+
+CORE_ADDR
+gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->convert_from_func_ptr_addr == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
+ return gdbarch->convert_from_func_ptr_addr (addr);
+}
+
+void
+set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
+{
+ gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
+}
+
+CORE_ADDR
+gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->addr_bits_remove == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_addr_bits_remove invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
+ return gdbarch->addr_bits_remove (addr);
+}
+
+void
+set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
+ gdbarch_addr_bits_remove_ftype addr_bits_remove)
+{
+ gdbarch->addr_bits_remove = addr_bits_remove;
+}
+
+CORE_ADDR
+gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->smash_text_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_smash_text_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
+ return gdbarch->smash_text_address (addr);
+}
+
+void
+set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
+ gdbarch_smash_text_address_ftype smash_text_address)
+{
+ gdbarch->smash_text_address = smash_text_address;
+}
+
+int
+gdbarch_software_single_step_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->software_single_step != 0;
+}
+
+void
+gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
+{
+ if (gdbarch->software_single_step == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_software_single_step invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
+ gdbarch->software_single_step (sig, insert_breakpoints_p);
+}
+
+void
+set_gdbarch_software_single_step (struct gdbarch *gdbarch,
+ gdbarch_software_single_step_ftype software_single_step)
+{
+ gdbarch->software_single_step = software_single_step;
+}
+
+int
+gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
+{
+ if (gdbarch->print_insn == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_insn invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
+ return gdbarch->print_insn (vma, info);
+}
+
+void
+set_gdbarch_print_insn (struct gdbarch *gdbarch,
+ gdbarch_print_insn_ftype print_insn)
+{
+ gdbarch->print_insn = print_insn;
+}
+
+CORE_ADDR
+gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ if (gdbarch->skip_trampoline_code == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_skip_trampoline_code invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
+ return gdbarch->skip_trampoline_code (pc);
+}
+
+void
+set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
+ gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
+{
+ gdbarch->skip_trampoline_code = skip_trampoline_code;
+}
+
+int
+gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+ if (gdbarch->in_solib_call_trampoline == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_solib_call_trampoline invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
+ return gdbarch->in_solib_call_trampoline (pc, name);
+}
+
+void
+set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
+ gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
+{
+ gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
+}
+
+int
+gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->in_function_epilogue_p == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_function_epilogue_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
+ return gdbarch->in_function_epilogue_p (gdbarch, addr);
+}
+
+void
+set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
+ gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
+{
+ gdbarch->in_function_epilogue_p = in_function_epilogue_p;
+}
+
+char *
+gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
+{
+ if (gdbarch->construct_inferior_arguments == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_construct_inferior_arguments invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
+ return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
+}
+
+void
+set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
+ gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
+{
+ gdbarch->construct_inferior_arguments = construct_inferior_arguments;
+}
+
+int
+gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->dwarf2_build_frame_info != 0;
+}
+
+void
+gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
+{
+ if (gdbarch->dwarf2_build_frame_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n");
+ gdbarch->dwarf2_build_frame_info (objfile);
+}
+
+void
+set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
+ gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info)
+{
+ gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
+}
+
+void
+gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
+{
+ if (gdbarch->elf_make_msymbol_special == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_elf_make_msymbol_special invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
+ gdbarch->elf_make_msymbol_special (sym, msym);
+}
+
+void
+set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
+ gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
+{
+ gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
+}
+
+void
+gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
+{
+ if (gdbarch->coff_make_msymbol_special == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_coff_make_msymbol_special invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
+ gdbarch->coff_make_msymbol_special (val, msym);
+}
+
+void
+set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
+ gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
+{
+ gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
+}
+
+
+/* Keep a registry of per-architecture data-pointers required by GDB
+ modules. */
+
+struct gdbarch_data
+{
+ unsigned index;
+ gdbarch_data_init_ftype *init;
+ gdbarch_data_free_ftype *free;
+};
+
+struct gdbarch_data_registration
+{
+ struct gdbarch_data *data;
+ struct gdbarch_data_registration *next;
+};
+
+struct gdbarch_data_registry
+{
+ unsigned nr;
+ struct gdbarch_data_registration *registrations;
+};
+
+struct gdbarch_data_registry gdbarch_data_registry =
+{
+ 0, NULL,
+};
+
+struct gdbarch_data *
+register_gdbarch_data (gdbarch_data_init_ftype *init,
+ gdbarch_data_free_ftype *free)
+{
+ struct gdbarch_data_registration **curr;
+ for (curr = &gdbarch_data_registry.registrations;
+ (*curr) != NULL;
+ curr = &(*curr)->next);
+ (*curr) = XMALLOC (struct gdbarch_data_registration);
+ (*curr)->next = NULL;
+ (*curr)->data = XMALLOC (struct gdbarch_data);
+ (*curr)->data->index = gdbarch_data_registry.nr++;
+ (*curr)->data->init = init;
+ (*curr)->data->free = free;
+ return (*curr)->data;
+}
+
+
+/* Walk through all the registered users initializing each in turn. */
+
static void
-set_endian_little (args, from_tty)
- char *args;
- int from_tty;
+init_gdbarch_data (struct gdbarch *gdbarch)
{
- if (TARGET_BYTE_ORDER_SELECTABLE_P)
+ struct gdbarch_data_registration *rego;
+ for (rego = gdbarch_data_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
{
- target_byte_order = LITTLE_ENDIAN;
- target_byte_order_auto = 0;
- }
- else
- {
- printf_unfiltered ("Byte order is not selectable.");
- show_endian (args, from_tty);
+ struct gdbarch_data *data = rego->data;
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->init != NULL)
+ {
+ void *pointer = data->init (gdbarch);
+ set_gdbarch_data (gdbarch, data, pointer);
+ }
}
}
-/* Called by ``set endian auto''. */
-static void set_endian_auto PARAMS ((char *, int));
+/* Create/delete the gdbarch data vector. */
+
static void
-set_endian_auto (args, from_tty)
- char *args;
- int from_tty;
+alloc_gdbarch_data (struct gdbarch *gdbarch)
{
- if (TARGET_BYTE_ORDER_SELECTABLE_P)
- {
- target_byte_order_auto = 1;
- }
- else
- {
- printf_unfiltered ("Byte order is not selectable.");
- show_endian (args, from_tty);
- }
+ gdb_assert (gdbarch->data == NULL);
+ gdbarch->nr_data = gdbarch_data_registry.nr;
+ gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
}
-/* Set the endianness from a BFD. */
-static void set_endian_from_file PARAMS ((bfd *));
static void
-set_endian_from_file (abfd)
- bfd *abfd;
+free_gdbarch_data (struct gdbarch *gdbarch)
{
- if (TARGET_BYTE_ORDER_SELECTABLE_P)
+ struct gdbarch_data_registration *rego;
+ gdb_assert (gdbarch->data != NULL);
+ for (rego = gdbarch_data_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
{
- int want;
-
- if (bfd_big_endian (abfd))
- want = BIG_ENDIAN;
- else
- want = LITTLE_ENDIAN;
- if (TARGET_BYTE_ORDER_AUTO)
- target_byte_order = want;
- else if (TARGET_BYTE_ORDER != want)
- warning ("%s endian file does not match %s endian target.",
- want == BIG_ENDIAN ? "big" : "little",
- TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
- }
- else
- {
- if (bfd_big_endian (abfd)
- ? TARGET_BYTE_ORDER != BIG_ENDIAN
- : TARGET_BYTE_ORDER == BIG_ENDIAN)
- warning ("%s endian file does not match %s endian target.",
- bfd_big_endian (abfd) ? "big" : "little",
- TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
+ struct gdbarch_data *data = rego->data;
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->free != NULL && gdbarch->data[data->index] != NULL)
+ {
+ data->free (gdbarch, gdbarch->data[data->index]);
+ gdbarch->data[data->index] = NULL;
+ }
}
+ xfree (gdbarch->data);
+ gdbarch->data = NULL;
}
+/* Initialize the current value of thee specified per-architecture
+ data-pointer. */
+
+void
+set_gdbarch_data (struct gdbarch *gdbarch,
+ struct gdbarch_data *data,
+ void *pointer)
+{
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->free != NULL && gdbarch->data[data->index] != NULL)
+ data->free (gdbarch, gdbarch->data[data->index]);
+ gdbarch->data[data->index] = pointer;
+}
-/* Functions to manipulate the architecture of the target */
+/* Return the current value of the specified per-architecture
+ data-pointer. */
+
+void *
+gdbarch_data (struct gdbarch_data *data)
+{
+ gdb_assert (data->index < current_gdbarch->nr_data);
+ return current_gdbarch->data[data->index];
+}
+
+
+
+/* Keep a registry of swapped data required by GDB modules. */
+
+struct gdbarch_swap
+{
+ void *swap;
+ struct gdbarch_swap_registration *source;
+ struct gdbarch_swap *next;
+};
+
+struct gdbarch_swap_registration
+{
+ void *data;
+ unsigned long sizeof_data;
+ gdbarch_swap_ftype *init;
+ struct gdbarch_swap_registration *next;
+};
+
+struct gdbarch_swap_registry
+{
+ int nr;
+ struct gdbarch_swap_registration *registrations;
+};
+
+struct gdbarch_swap_registry gdbarch_swap_registry =
+{
+ 0, NULL,
+};
+
+void
+register_gdbarch_swap (void *data,
+ unsigned long sizeof_data,
+ gdbarch_swap_ftype *init)
+{
+ struct gdbarch_swap_registration **rego;
+ for (rego = &gdbarch_swap_registry.registrations;
+ (*rego) != NULL;
+ rego = &(*rego)->next);
+ (*rego) = XMALLOC (struct gdbarch_swap_registration);
+ (*rego)->next = NULL;
+ (*rego)->init = init;
+ (*rego)->data = data;
+ (*rego)->sizeof_data = sizeof_data;
+}
-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));
-/* Do the real work of changing the current architecture */
static void
-set_arch (arch)
- const struct bfd_arch_info *arch;
-{
- /* FIXME: Is it compatible with gdb? */
- /* Check with the target on the setting */
- if (target_architecture_hook != NULL
- && !target_architecture_hook (arch))
- printf_unfiltered ("Target does not support `%s' architecture.\n",
- arch->printable_name);
- else
+init_gdbarch_swap (struct gdbarch *gdbarch)
+{
+ struct gdbarch_swap_registration *rego;
+ struct gdbarch_swap **curr = &gdbarch->swap;
+ for (rego = gdbarch_swap_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
{
- target_architecture_auto = 0;
- target_architecture = arch;
+ if (rego->data != NULL)
+ {
+ (*curr) = XMALLOC (struct gdbarch_swap);
+ (*curr)->source = rego;
+ (*curr)->swap = xmalloc (rego->sizeof_data);
+ (*curr)->next = NULL;
+ memset (rego->data, 0, rego->sizeof_data);
+ curr = &(*curr)->next;
+ }
+ if (rego->init != NULL)
+ rego->init ();
}
}
-/* Called if the user enters ``show architecture'' without an argument. */
-static void show_architecture PARAMS ((char *, int));
static void
-show_architecture (args, from_tty)
- char *args;
- int from_tty;
-{
- const char *arch;
- arch = TARGET_ARCHITECTURE->printable_name;
- if (target_architecture_auto)
- printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
- else
- printf_filtered ("The target architecture is assumed to be %s\n", arch);
+swapout_gdbarch_swap (struct gdbarch *gdbarch)
+{
+ struct gdbarch_swap *curr;
+ for (curr = gdbarch->swap;
+ curr != NULL;
+ curr = curr->next)
+ memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
}
-/* Called if the user enters ``set architecture'' with or without an
- argument. */
-static void set_architecture PARAMS ((char *, int));
static void
-set_architecture (args, from_tty)
- char *args;
- int from_tty;
+swapin_gdbarch_swap (struct gdbarch *gdbarch)
{
- if (args == NULL)
- {
- printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
- }
- else if (strcmp (args, "auto") == 0)
- {
- target_architecture_auto = 1;
- }
- else
- {
- const struct bfd_arch_info *arch = bfd_scan_arch (args);
- if (arch != NULL)
- set_arch (arch);
- else
- printf_unfiltered ("Architecture `%s' not reconized.\n", args);
- }
+ struct gdbarch_swap *curr;
+ for (curr = gdbarch->swap;
+ curr != NULL;
+ curr = curr->next)
+ memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
}
-/* Called if the user enters ``info architecture'' without an argument. */
-static void info_architecture PARAMS ((char *, int));
+
+/* Keep a registry of the architectures known by GDB. */
+
+struct gdbarch_registration
+{
+ enum bfd_architecture bfd_architecture;
+ gdbarch_init_ftype *init;
+ gdbarch_dump_tdep_ftype *dump_tdep;
+ struct gdbarch_list *arches;
+ struct gdbarch_registration *next;
+};
+
+static struct gdbarch_registration *gdbarch_registry = NULL;
+
static void
-info_architecture (args, from_tty)
- char *args;
- int from_tty;
+append_name (const char ***buf, int *nr, const char *name)
+{
+ *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
+ (*buf)[*nr] = name;
+ *nr += 1;
+}
+
+const char **
+gdbarch_printable_names (void)
{
- enum bfd_architecture a;
- printf_filtered ("Available architectures are:\n");
- for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
+ if (GDB_MULTI_ARCH)
{
- const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0);
- if (ap != NULL)
+ /* Accumulate a list of names based on the registed list of
+ architectures. */
+ enum bfd_architecture a;
+ int nr_arches = 0;
+ const char **arches = NULL;
+ struct gdbarch_registration *rego;
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
{
+ const struct bfd_arch_info *ap;
+ ap = bfd_lookup_arch (rego->bfd_architecture, 0);
+ if (ap == NULL)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch_architecture_names: multi-arch unknown");
do
{
- printf_filtered (" %s", ap->printable_name);
+ append_name (&arches, &nr_arches, ap->printable_name);
ap = ap->next;
}
while (ap != NULL);
- printf_filtered ("\n");
}
+ append_name (&arches, &nr_arches, NULL);
+ return arches;
}
+ else
+ /* Just return all the architectures that BFD knows. Assume that
+ the legacy architecture framework supports them. */
+ return bfd_arch_list ();
}
-/* Set the architecture from arch/machine */
+
void
-set_architecture_from_arch_mach (arch, mach)
- enum bfd_architecture arch;
- unsigned long mach;
+gdbarch_register (enum bfd_architecture bfd_architecture,
+ gdbarch_init_ftype *init,
+ gdbarch_dump_tdep_ftype *dump_tdep)
{
- const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
- if (wanted != NULL)
- set_arch (wanted);
- else
- fatal ("hardwired architecture/machine not reconized");
+ struct gdbarch_registration **curr;
+ const struct bfd_arch_info *bfd_arch_info;
+ /* Check that BFD recognizes this architecture */
+ bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
+ if (bfd_arch_info == NULL)
+ {
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: Attempt to register unknown architecture (%d)",
+ bfd_architecture);
+ }
+ /* Check that we haven't seen this architecture before */
+ for (curr = &gdbarch_registry;
+ (*curr) != NULL;
+ curr = &(*curr)->next)
+ {
+ if (bfd_architecture == (*curr)->bfd_architecture)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: Duplicate registraration of architecture (%s)",
+ bfd_arch_info->printable_name);
+ }
+ /* log it */
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
+ bfd_arch_info->printable_name,
+ (long) init);
+ /* Append it */
+ (*curr) = XMALLOC (struct gdbarch_registration);
+ (*curr)->bfd_architecture = bfd_architecture;
+ (*curr)->init = init;
+ (*curr)->dump_tdep = dump_tdep;
+ (*curr)->arches = NULL;
+ (*curr)->next = NULL;
+ /* When non- multi-arch, install whatever target dump routine we've
+ been provided - hopefully that routine has been written correctly
+ and works regardless of multi-arch. */
+ if (!GDB_MULTI_ARCH && dump_tdep != NULL
+ && startup_gdbarch.dump_tdep == NULL)
+ startup_gdbarch.dump_tdep = dump_tdep;
}
-/* Set the architecture from a BFD */
-static void set_architecture_from_file PARAMS ((bfd *));
-static void
-set_architecture_from_file (abfd)
- bfd *abfd;
+void
+register_gdbarch_init (enum bfd_architecture bfd_architecture,
+ gdbarch_init_ftype *init)
+{
+ gdbarch_register (bfd_architecture, init, NULL);
+}
+
+
+/* Look for an architecture using gdbarch_info. Base search on only
+ BFD_ARCH_INFO and BYTE_ORDER. */
+
+struct gdbarch_list *
+gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
+ const struct gdbarch_info *info)
{
- const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
- if (target_architecture_auto)
+ for (; arches != NULL; arches = arches->next)
{
- if (target_architecture_hook != NULL
- && !target_architecture_hook (wanted))
- warning ("Target may not support %s architecture",
- wanted->printable_name);
- target_architecture = wanted;
+ if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
+ continue;
+ if (info->byte_order != arches->gdbarch->byte_order)
+ continue;
+ return arches;
}
- else if (wanted != target_architecture)
+ return NULL;
+}
+
+
+/* Update the current architecture. Return ZERO if the update request
+ failed. */
+
+int
+gdbarch_update_p (struct gdbarch_info info)
+{
+ struct gdbarch *new_gdbarch;
+ struct gdbarch_list **list;
+ struct gdbarch_registration *rego;
+
+ /* Fill in missing parts of the INFO struct using a number of
+ sources: ``set ...''; INFOabfd supplied; existing target. */
+
+ /* ``(gdb) set architecture ...'' */
+ if (info.bfd_arch_info == NULL
+ && !TARGET_ARCHITECTURE_AUTO)
+ info.bfd_arch_info = TARGET_ARCHITECTURE;
+ if (info.bfd_arch_info == NULL
+ && info.abfd != NULL
+ && bfd_get_arch (info.abfd) != bfd_arch_unknown
+ && bfd_get_arch (info.abfd) != bfd_arch_obscure)
+ info.bfd_arch_info = bfd_get_arch_info (info.abfd);
+ if (info.bfd_arch_info == NULL)
+ info.bfd_arch_info = TARGET_ARCHITECTURE;
+
+ /* ``(gdb) set byte-order ...'' */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN
+ && !TARGET_BYTE_ORDER_AUTO)
+ info.byte_order = TARGET_BYTE_ORDER;
+ /* From the INFO struct. */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN
+ && info.abfd != NULL)
+ info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
+ : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
+ : BFD_ENDIAN_UNKNOWN);
+ /* From the current target. */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN)
+ info.byte_order = TARGET_BYTE_ORDER;
+
+ /* Must have found some sort of architecture. */
+ gdb_assert (info.bfd_arch_info != NULL);
+
+ if (gdbarch_debug)
{
- warning ("%s architecture file may be incompatible with %s target.",
- wanted->printable_name,
- target_architecture->printable_name);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.bfd_arch_info %s\n",
+ (info.bfd_arch_info != NULL
+ ? info.bfd_arch_info->printable_name
+ : "(null)"));
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.byte_order %d (%s)\n",
+ info.byte_order,
+ (info.byte_order == BFD_ENDIAN_BIG ? "big"
+ : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
+ : "default"));
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.abfd 0x%lx\n",
+ (long) info.abfd);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.tdep_info 0x%lx\n",
+ (long) info.tdep_info);
}
-}
+ /* Find the target that knows about this architecture. */
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
+ if (rego->bfd_architecture == info.bfd_arch_info->arch)
+ break;
+ if (rego == NULL)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
+ return 0;
+ }
+ /* Ask the target for a replacement architecture. */
+ new_gdbarch = rego->init (info, rego->arches);
-/* Disassembler */
+ /* Did the target like it? No. Reject the change. */
+ if (new_gdbarch == NULL)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
+ return 0;
+ }
-/* Pointer to the target-dependent disassembly function. */
-int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
-disassemble_info tm_print_insn_info;
+ /* Did the architecture change? No. Do nothing. */
+ if (current_gdbarch == new_gdbarch)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ return 1;
+ }
+ /* Swap all data belonging to the old target out */
+ swapout_gdbarch_swap (current_gdbarch);
+ /* Is this a pre-existing architecture? Yes. Swap it in. */
+ for (list = &rego->arches;
+ (*list) != NULL;
+ list = &(*list)->next)
+ {
+ if ((*list)->gdbarch == new_gdbarch)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ current_gdbarch = new_gdbarch;
+ swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
+ return 1;
+ }
+ }
-/* Set the dynamic target-system-dependant parameters (architecture,
- byte-order) using information found in the BFD */
+ /* Append this new architecture to this targets list. */
+ (*list) = XMALLOC (struct gdbarch_list);
+ (*list)->next = NULL;
+ (*list)->gdbarch = new_gdbarch;
-void
-set_gdbarch_from_file (abfd)
- bfd *abfd;
-{
- set_architecture_from_file (abfd);
- set_endian_from_file (abfd);
+ /* Switch to this new architecture. Dump it out. */
+ current_gdbarch = new_gdbarch;
+ if (gdbarch_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ }
+
+ /* Check that the newly installed architecture is valid. Plug in
+ any post init values. */
+ new_gdbarch->dump_tdep = rego->dump_tdep;
+ verify_gdbarch (new_gdbarch);
+
+ /* Initialize the per-architecture memory (swap) areas.
+ 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);
+ architecture_changed_event ();
+
+ if (gdbarch_debug)
+ gdbarch_dump (current_gdbarch, gdb_stdlog);
+
+ return 1;
}
-extern void _initialize_gdbarch PARAMS ((void));
+/* Disassembler */
+
+/* Pointer to the target-dependent disassembly function. */
+int (*tm_print_insn) (bfd_vma, disassemble_info *);
+disassemble_info tm_print_insn_info;
+
+
+extern void _initialize_gdbarch (void);
+
void
-_initialize_gdbarch ()
+_initialize_gdbarch (void)
{
- add_prefix_cmd ("endian", class_support, set_endian,
- "Set endianness of target.",
- &endianlist, "set endian ", 0, &setlist);
- add_cmd ("big", class_support, set_endian_big,
- "Set target as being big endian.", &endianlist);
- add_cmd ("little", class_support, set_endian_little,
- "Set target as being little endian.", &endianlist);
- add_cmd ("auto", class_support, set_endian_auto,
- "Select target endianness automatically.", &endianlist);
- add_cmd ("endian", class_support, show_endian,
- "Show endianness of target.", &showlist);
-
- add_cmd ("architecture", class_support, set_architecture,
- "Set architecture of target.", &setlist);
- add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
- add_cmd ("architecture", class_support, show_architecture,
- "Show architecture of target.", &showlist);
- add_cmd ("architecture", class_support, info_architecture,
- "List supported target architectures", &infolist);
+ struct cmd_list_element *c;
INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
tm_print_insn_info.flavour = bfd_target_unknown_flavour;
@@ -348,13 +5050,20 @@ _initialize_gdbarch ()
tm_print_insn_info.memory_error_func = dis_asm_memory_error;
tm_print_insn_info.print_address_func = dis_asm_print_address;
-#ifdef MAINTENANCE_CMDS
- add_show_from_set (add_set_cmd ("archdebug",
+ add_show_from_set (add_set_cmd ("arch",
class_maintenance,
var_zinteger,
(char *)&gdbarch_debug,
"Set architecture debugging.\n\
-When non-zero, architecture debugging is enabled.", &setlist),
- &showlist);
-#endif
+When non-zero, architecture debugging is enabled.", &setdebuglist),
+ &showdebuglist);
+ c = add_set_cmd ("archdebug",
+ class_maintenance,
+ var_zinteger,
+ (char *)&gdbarch_debug,
+ "Set architecture debugging.\n\
+When non-zero, architecture debugging is enabled.", &setlist);
+
+ deprecate_cmd (c, "set debug arch");
+ deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
}
diff --git a/contrib/gdb/gdb/gdbarch.h b/contrib/gdb/gdb/gdbarch.h
index 098db4c..81f5174 100644
--- a/contrib/gdb/gdb/gdbarch.h
+++ b/contrib/gdb/gdb/gdbarch.h
@@ -1,50 +1,2539 @@
-/* Architecture commands for GDB, the GNU debugger.
- Copyright 1998, Free Software Foundation, Inc.
+/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
-This file is part of GDB.
+/* Dynamic architecture support for GDB, the GNU debugger.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 was created with the aid of ``gdbarch.sh''.
+
+ The Bourne shell script ``gdbarch.sh'' creates the files
+ ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
+ against the existing ``gdbarch.[hc]''. Any differences found
+ being reported.
+
+ If editing this file, please also run gdbarch.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdbarch.sh and using its output may prove
+ easier. */
#ifndef GDBARCH_H
#define GDBARCH_H
+#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
+#if !GDB_MULTI_ARCH
+#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
+#endif
+
+struct frame_info;
+struct value;
+struct objfile;
+struct minimal_symbol;
+
+extern struct gdbarch *current_gdbarch;
-/* The target-system-dependant byte order is dynamic */
-/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
- is selectable at runtime. The user can use the `set endian'
- command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when
- target_byte_order should be auto-detected (from the program image
- say). */
+/* If any of the following are defined, the target wasn't correctly
+ converted. */
-#ifndef TARGET_BYTE_ORDER_SELECTABLE_P
-/* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE
- when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-#define TARGET_BYTE_ORDER_SELECTABLE_P 1
-#else
-#define TARGET_BYTE_ORDER_SELECTABLE_P 0
+#if GDB_MULTI_ARCH
+#if defined (EXTRA_FRAME_INFO)
+#error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
#endif
#endif
-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. */
-#undef TARGET_BYTE_ORDER
+#if GDB_MULTI_ARCH
+#if defined (FRAME_FIND_SAVED_REGS)
+#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
+#endif
+#endif
+
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
+#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
+#endif
+
+
+/* The following are pre-initialized by GDBARCH. */
+
+extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
+/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE)
+#error "Non multi-arch definition of TARGET_ARCHITECTURE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE)
+#define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_byte_order (struct gdbarch *gdbarch);
+/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER)
+#error "Non multi-arch definition of TARGET_BYTE_ORDER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER)
+#define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
+#endif
+#endif
+
+
+/* The following are initialized by the target dependent code. */
+
+/* Number of bits in a char or unsigned char for the target machine.
+ Just like CHAR_BIT in <limits.h> but describes the target machine.
+ v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
+
+ Number of bits in a short or unsigned short for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
+#define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_short_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
+#error "Non multi-arch definition of TARGET_SHORT_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT)
+#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in an int or unsigned int for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
+#define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_int_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
+#error "Non multi-arch definition of TARGET_INT_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT)
+#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a long or unsigned long for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
+#define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_long_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
+#error "Non multi-arch definition of TARGET_LONG_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT)
+#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a long long or unsigned long long for the target
+ machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
+#define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
+#endif
+
+extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
+#error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT)
+#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a float for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
+#define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_float_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
+#error "Non multi-arch definition of TARGET_FLOAT_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT)
+#define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a double for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
+#define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_double_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
+#error "Non multi-arch definition of TARGET_DOUBLE_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT)
+#define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a long double for the target machine. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
+#define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT)
+#endif
+
+extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
+#error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT)
+#define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
+#endif
+#endif
+
+/* For most targets, a pointer on the target and its representation as an
+ address in GDB have the same size and "look the same". For such a
+ target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+ / addr_bit will be set from it.
+
+ If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+ also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+
+ ptr_bit is the size of a pointer on the target */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
+#define TARGET_PTR_BIT (TARGET_INT_BIT)
+#endif
+
+extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
+#error "Non multi-arch definition of TARGET_PTR_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT)
+#define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
+#endif
+#endif
+
+/* addr_bit is the size of a target address as represented in gdb */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
+#endif
+
+extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
+#error "Non multi-arch definition of TARGET_ADDR_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
+#endif
+#endif
+
+/* Number of bits in a BFD_VMA for the target object file format. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
+#define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
+#endif
+
+extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
+#error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT)
+#define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
+#endif
+#endif
+
+/* One if `char' acts like `signed char', zero if `unsigned char'. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
+#define TARGET_CHAR_SIGNED (1)
+#endif
+
+extern int gdbarch_char_signed (struct gdbarch *gdbarch);
+extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
+#error "Non multi-arch definition of TARGET_CHAR_SIGNED"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED)
+#define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
+#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
+#endif
+
+typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
+extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
+extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
+#error "Non multi-arch definition of TARGET_READ_PC"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
+#define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
+#define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
+#endif
+
+typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
+extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
+extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
+#error "Non multi-arch definition of TARGET_WRITE_PC"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
+#define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
+#define TARGET_READ_FP() (generic_target_read_fp ())
+#endif
+
+typedef CORE_ADDR (gdbarch_read_fp_ftype) (void);
+extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch);
+extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP)
+#error "Non multi-arch definition of TARGET_READ_FP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP)
+#define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_FP)
+#define TARGET_WRITE_FP(val) (generic_target_write_fp (val))
+#endif
+
+typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val);
+extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val);
+extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_FP)
+#error "Non multi-arch definition of TARGET_WRITE_FP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_FP)
+#define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
+#define TARGET_READ_SP() (generic_target_read_sp ())
+#endif
+
+typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
+extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
+extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
+#error "Non multi-arch definition of TARGET_READ_SP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP)
+#define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP)
+#define TARGET_WRITE_SP(val) (generic_target_write_sp (val))
+#endif
+
+typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val);
+extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
+extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP)
+#error "Non multi-arch definition of TARGET_WRITE_SP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP)
+#define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
+#endif
+#endif
+
+/* Function for getting target's idea of a frame pointer. FIXME: GDB's
+ whole scheme for dealing with "frames" and "frame pointers" needs a
+ serious shakedown. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER)
+#define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset))
+#endif
+
+typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
+extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
+extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER)
+#error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER)
+#define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset))
+#endif
+#endif
+
+extern int gdbarch_register_read_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read);
+
+extern int gdbarch_register_write_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write);
+
+extern int gdbarch_num_regs (struct gdbarch *gdbarch);
+extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
+#error "Non multi-arch definition of NUM_REGS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS)
+#define NUM_REGS (gdbarch_num_regs (current_gdbarch))
+#endif
+#endif
+
+/* This macro gives the number of pseudo-registers that live in the
+ register namespace but do not get fetched or stored on the target.
+ These pseudo-registers may be aliases for other registers,
+ combinations of other registers, or they may be computed by GDB. */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
+#define NUM_PSEUDO_REGS (0)
+#endif
+
+extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
+extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
+#error "Non multi-arch definition of NUM_PSEUDO_REGS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS)
+#define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
+#error "Non multi-arch definition of SP_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM)
+#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_fp_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
+#error "Non multi-arch definition of FP_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM)
+#define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
+#error "Non multi-arch definition of PC_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM)
+#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
+#define FP0_REGNUM (-1)
+#endif
+
+extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
+#error "Non multi-arch definition of FP0_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM)
+#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
+#define NPC_REGNUM (-1)
+#endif
+
+extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
+#error "Non multi-arch definition of NPC_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM)
+#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM)
+#define NNPC_REGNUM (-1)
+#endif
+
+extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM)
+#error "Non multi-arch definition of NNPC_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM)
+#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
+#define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
+#endif
+
+typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
+extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
+extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
+#error "Non multi-arch definition of STAB_REG_TO_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
+#define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
+#endif
+#endif
+
+/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
+#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
+#endif
+
+typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
+extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
+extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
+#error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
+#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
+#endif
+#endif
+
+/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
+#define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
+#endif
+
+typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
+extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
+extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
+#error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
+#define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
+#endif
+#endif
+
+/* Convert from an sdb register number to an internal gdb register number.
+ This should be defined in tm.h, if REGISTER_NAMES is not set up
+ to map one to one onto the sdb register numbers. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
+#define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
+#endif
+
+typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
+extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
+extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
+#error "Non multi-arch definition of SDB_REG_TO_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
+#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
+#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
+#endif
+
+typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
+extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
+extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
+#error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
+#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
+#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
+#endif
+
+typedef char * (gdbarch_register_name_ftype) (int regnr);
+extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
+extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
+#error "Non multi-arch definition of REGISTER_NAME"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME)
+#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
+#endif
+#endif
+
+extern int gdbarch_register_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
+#error "Non multi-arch definition of REGISTER_SIZE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE)
+#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
+extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
+#error "Non multi-arch definition of REGISTER_BYTES"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES)
+#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
+#endif
+#endif
+
+typedef int (gdbarch_register_byte_ftype) (int reg_nr);
+extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
+#error "Non multi-arch definition of REGISTER_BYTE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE)
+#define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
+#endif
+#endif
+
+typedef int (gdbarch_register_raw_size_ftype) (int reg_nr);
+extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE)
+#error "Non multi-arch definition of REGISTER_RAW_SIZE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE)
+#error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (int reg_nr);
+extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE)
+#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE)
+#error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (int reg_nr);
+extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE)
+#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE)
+#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
+#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
+#endif
+
+typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
+extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
+extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO)
+#error "Non multi-arch definition of DO_REGISTERS_INFO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
+#define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO)
+#define PRINT_FLOAT_INFO() (default_print_float_info ())
+#endif
+
+typedef void (gdbarch_print_float_info_ftype) (void);
+extern void gdbarch_print_float_info (struct gdbarch *gdbarch);
+extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO)
+#error "Non multi-arch definition of PRINT_FLOAT_INFO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO)
+#define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch))
+#endif
+#endif
+
+/* MAP a GDB RAW register number onto a simulator register number. See
+ also include/...-sim.h. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
+#define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr))
+#endif
+
+typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
+extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
+#error "Non multi-arch definition of REGISTER_SIM_REGNO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO)
+#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
+#endif
+#endif
+
+#if defined (REGISTER_BYTES_OK)
+/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
+#if !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (0)
+#endif
+
+extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
+#error "Non multi-arch definition of REGISTER_BYTES_OK"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
+#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
+#endif
+
+typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
+extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
+extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
+#error "Non multi-arch definition of REGISTER_BYTES_OK"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
+#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
+#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
+#endif
+
+typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
+extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
+#error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
+#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
+#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
+#endif
+
+typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
+extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
+#error "Non multi-arch definition of CANNOT_STORE_REGISTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
+#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
+#endif
+#endif
+
+/* setjmp/longjmp support. */
+
+#if defined (GET_LONGJMP_TARGET)
+/* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */
+#if !defined (GET_LONGJMP_TARGET_P)
+#define GET_LONGJMP_TARGET_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P)
+#define GET_LONGJMP_TARGET_P() (0)
+#endif
+
+extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
+#error "Non multi-arch definition of GET_LONGJMP_TARGET"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
+#define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET)
+#define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0)
+#endif
+
+typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
+extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
+extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET)
+#error "Non multi-arch definition of GET_LONGJMP_TARGET"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET)
+#define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
+#endif
+#endif
+
+/* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that
+ much better but at least they are vaguely consistent). The headers
+ and body contain convoluted #if/#else sequences for determine how
+ things should be compiled. Instead of trying to mimic that
+ behaviour here (and hence entrench it further) gdbarch simply
+ reqires that these methods be set up from the word go. This also
+ avoids any potential problems with moving beyond multi-arch partial. */
+
+extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
+extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES)
+#error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES)
+#define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
+#error "Non multi-arch definition of CALL_DUMMY_LOCATION"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION)
+#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
+#endif
+#endif
+
+typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
+extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
+#error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS)
+#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
+#endif
+#endif
+
+extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
+#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
+#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
+#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
+#error "Non multi-arch definition of CALL_DUMMY_LENGTH"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH)
+#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
+#endif
+#endif
+
+typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
+extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
+extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY)
+#error "Non multi-arch definition of PC_IN_CALL_DUMMY"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY)
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
+#endif
+#endif
+
+extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P)
+#error "Non multi-arch definition of CALL_DUMMY_P"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P)
+#define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
+#define CALL_DUMMY_WORDS (legacy_call_dummy_words)
+#endif
+
+extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of CALL_DUMMY_WORDS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS)
+#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
+#define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
+#endif
+
+extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P)
+#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST)
+#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (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 (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 (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
+#error "Non multi-arch definition of FIX_CALL_DUMMY"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
+#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
+#endif
+
+typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
+extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
+extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
+#error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
+#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC)
+#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
+#endif
+
+typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
+extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
+extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC)
+#error "Non multi-arch definition of INIT_FRAME_PC"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC)
+#define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev))
+#endif
+#endif
+
+extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
+extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
+#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION)
+#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
+#endif
+#endif
+
+extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch);
+extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
+#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
+#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE)
+#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual))
+#endif
+
+typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual);
+extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual);
+extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE)
+#error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE)
+#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual))
+#endif
+#endif
+
+/* GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the
+ old code has strange #ifdef interaction. So far no one has found
+ that default_get_saved_register() is the default they are after. */
+
+typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
+#error "Non multi-arch definition of GET_SAVED_REGISTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
+#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
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE)
+#define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr))
+#endif
+
+typedef int (gdbarch_register_convertible_ftype) (int nr);
+extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr);
+extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE)
+#error "Non multi-arch definition of REGISTER_CONVERTIBLE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE)
+#define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
+#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
+#endif
+
+typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
+extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
+extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL)
+#error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
+#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
+#endif
+
+typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to);
+extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
+extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW)
+#error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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
+
+/* This function is called when the value of a pseudo-register needs to
+ be updated. Typically it will be defined on a per-architecture
+ basis. */
+
+#if defined (FETCH_PSEUDO_REGISTER)
+/* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */
+#if !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P)
+#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P)
+#define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
+#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
+#endif
+
+typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
+extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER)
+#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER)
+#define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
+#endif
+#endif
+
+/* This function is called when the value of a pseudo-register needs to
+ be set or stored. Typically it will be defined on a
+ per-architecture basis. */
+
+#if defined (STORE_PSEUDO_REGISTER)
+/* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */
+#if !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P)
+#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P)
+#define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
+#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
+#endif
+
+typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
+extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER)
+#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER)
+#define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
+#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
+#endif
+
+typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf);
+extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
+extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
+#error "Non multi-arch definition of POINTER_TO_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS)
+#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
+#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
+#endif
+
+typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
+extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
+extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
+#error "Non multi-arch definition of ADDRESS_TO_POINTER"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER)
+#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
+#endif
+#endif
+
+#if defined (INTEGER_TO_ADDRESS)
+/* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */
+#if !defined (INTEGER_TO_ADDRESS_P)
+#define INTEGER_TO_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P)
+#define INTEGER_TO_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
+#error "Non multi-arch definition of INTEGER_TO_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
+#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS)
+#define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf);
+extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
+extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS)
+#error "Non multi-arch definition of INTEGER_TO_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS)
+#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
+#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
+#endif
+
+typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
+extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
+extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
+#error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK)
+#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
+#endif
+#endif
+
+typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
+extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
+extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
+#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS)
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
+extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
+extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS)
+#error "Non multi-arch definition of PUSH_ARGUMENTS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (void);
+extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch);
+extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME)
+#error "Non multi-arch definition of PUSH_DUMMY_FRAME"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME)
+#define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
+#endif
+#endif
+
+#if defined (PUSH_RETURN_ADDRESS)
+/* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */
+#if !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P)
+#error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P)
+#define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS)
+#define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
+extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
+extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS)
+#error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (void);
+extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
+extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
+#error "Non multi-arch definition of POP_FRAME"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
+#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
+#endif
+#endif
+
+typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
+extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
+extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN)
+#error "Non multi-arch definition of STORE_STRUCT_RETURN"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct type *type, char *valbuf);
+extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
+extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
+#error "Non multi-arch definition of STORE_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
+#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
+#endif
+#endif
+
+#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
+#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
+extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
+extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
+#define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
+#endif
+
+typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
+extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
+extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
+#error "Non multi-arch definition of USE_STRUCT_CONVENTION"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *frame);
+extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS)
+#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS)
+#define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
+#endif
+#endif
+
+#if defined (INIT_EXTRA_FRAME_INFO)
+/* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */
+#if !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (0)
+#endif
+
+extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P)
+#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P)
+#define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO)
+#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0)
+#endif
+
+typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
+extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
+extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO)
+#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (CORE_ADDR ip);
+extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
+#error "Non multi-arch definition of SKIP_PROLOGUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE)
+#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
+#define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
+#endif
+
+typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
+extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P)
+#error "Non multi-arch definition of PROLOGUE_FRAMELESS_P"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P)
+#define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
+#endif
+#endif
+
+typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
+extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
+extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
+#error "Non multi-arch definition of INNER_THAN"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN)
+#define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
+#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
+#endif
+
+typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
+extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
+extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
+#error "Non multi-arch definition of BREAKPOINT_FROM_PC"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
+#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
+#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
+#endif
+
+typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
+extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
+extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
+#error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
+#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
+#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
+#endif
+
+typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
+extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
+extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
+#error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
+#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
+#endif
+#endif
+
+extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
+extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
+#error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
+#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
+#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
+#endif
+
+typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
+extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
+extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
+#error "Non multi-arch definition of PREPARE_TO_PROCEED"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
+#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
+#endif
+#endif
+
+extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
+#error "Non multi-arch definition of FUNCTION_START_OFFSET"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
+#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
+#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len))
+#endif
+
+typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
+extern void gdbarch_remote_translate_xfer_address (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 (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
+#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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 (struct gdbarch *gdbarch);
+extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
+#error "Non multi-arch definition of FRAME_ARGS_SKIP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
+#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
+#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
+#endif
+
+typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
+extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
+extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
+#error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *frame);
+extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN)
+#error "Non multi-arch definition of FRAME_CHAIN"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN)
+#define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
+#endif
+#endif
+
+/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for
+ most targets. If FRAME_CHAIN_VALID returns zero it means that the
+ given frame is the outermost one and has no caller.
+
+ XXXX - both default and alternate frame_chain_valid functions are
+ deprecated. New code should use dummy frames and one of the generic
+ functions. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
+#define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe))
+#endif
+
+typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
+extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
+extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
+#error "Non multi-arch definition of FRAME_CHAIN_VALID"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *fi);
+extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
+extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC)
+#error "Non multi-arch definition of FRAME_SAVED_PC"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *fi);
+extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
+extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
+#error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *fi);
+extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
+extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
+#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *frame);
+extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL)
+#error "Non multi-arch definition of SAVED_PC_AFTER_CALL"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !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) (struct frame_info *frame);
+extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
+#error "Non multi-arch definition of FRAME_NUM_ARGS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
+#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
+#endif
+#endif
+
+#if defined (STACK_ALIGN)
+/* Legacy for systems yet to multi-arch STACK_ALIGN */
+#if !defined (STACK_ALIGN_P)
+#define STACK_ALIGN_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
+#define STACK_ALIGN_P() (0)
+#endif
+
+extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
+#error "Non multi-arch definition of STACK_ALIGN"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
+#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
+#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
+extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
+extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
+#error "Non multi-arch definition of STACK_ALIGN"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
+#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
+#define EXTRA_STACK_ALIGNMENT_NEEDED (1)
+#endif
+
+extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch);
+extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED)
+#error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
+#define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch))
+#endif
+#endif
+
+#if defined (REG_STRUCT_HAS_ADDR)
+/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
+#if !defined (REG_STRUCT_HAS_ADDR_P)
+#define REG_STRUCT_HAS_ADDR_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
+#define REG_STRUCT_HAS_ADDR_P() (0)
+#endif
+
+extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
+#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
+#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
+#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
+#endif
+
+typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
+extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
+extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
+#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
+#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
+#endif
+#endif
+
+#if defined (SAVE_DUMMY_FRAME_TOS)
+/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
+#if !defined (SAVE_DUMMY_FRAME_TOS_P)
+#define SAVE_DUMMY_FRAME_TOS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
+#define SAVE_DUMMY_FRAME_TOS_P() (0)
+#endif
+
+extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
+#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
+#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
+#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
+#endif
+
+typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
+extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
+extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
+#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
+#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
+#endif
+#endif
+
+extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
+extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
+#error "Non multi-arch definition of PARM_BOUNDARY"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
+#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
+#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
+#endif
+
+extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
+#error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
+#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
+#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
+#endif
+
+extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
+#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
+#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
+#define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
+#endif
+
+extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
+#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
+#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
+#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
+#error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
+#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
+#endif
+#endif
+
+/* On some machines there are bits in addresses which are not really
+ part of the address, but are used by the kernel, the hardware, etc.
+ for special purposes. ADDR_BITS_REMOVE takes out any such bits so
+ we get a "real" address such as one would find in a symbol table.
+ This is used only for addresses of instructions, and even then I'm
+ not sure it's used in all contexts. It exists to deal with there
+ being a few stray bits in the PC which would mislead us, not as some
+ sort of generic thing to handle alignment or segmentation (it's
+ possible it should be in TARGET_READ_PC instead). */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
+#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
+#error "Non multi-arch definition of ADDR_BITS_REMOVE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
+#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
+#endif
+#endif
+
+/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
+ ADDR_BITS_REMOVE. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
+#define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
+#error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
+#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
+#endif
+#endif
+
+/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
+ the target needs software single step. An ISA method to implement it.
+
+ FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+ using the breakpoint system instead of blatting memory directly (as with rs6000).
+
+ FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
+ single step. If not, then implement single step using breakpoints. */
+
+#if defined (SOFTWARE_SINGLE_STEP)
+/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
+#if !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (0)
+#endif
+
+extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
+#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
+#endif
+
+typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
+extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
+extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
+#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
+#define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
+#endif
+
+typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info);
+extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info);
+extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
+#error "Non multi-arch definition of TARGET_PRINT_INSN"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN)
+#define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
+#define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
+#endif
+
+typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
+extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
+#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
+#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
+#endif
+#endif
+
+/* For SVR4 shared libraries, each call goes through a small piece of
+ trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
+ to nonzero if we are current stopped in one of these. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
+#endif
+
+typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
+extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
+extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
+#error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
+#endif
+#endif
+
+/* A target might have problems with watchpoints as soon as the stack
+ frame of the current function has been destroyed. This mostly happens
+ as the first action in a funtion's epilogue. in_function_epilogue_p()
+ is defined to return a non-zero value if either the given addr is one
+ instruction after the stack destroying instruction up to the trailing
+ return instruction or if we can figure out that the stack frame has
+ already been invalidated regardless of the value of addr. Targets
+ which don't suffer from that problem could just let this functionality
+ untouched. */
+
+typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
+
+/* Given a vector of command-line arguments, return a newly allocated
+ string which, when passed to the create_inferior function, will be
+ parsed (on Unix systems, by the shell) to yield the same vector.
+ This function should call error() if the argument vector is not
+ representable for this target or if this target does not support
+ command-line arguments.
+ ARGC is the number of elements in the vector.
+ ARGV is an array of strings, one per argument. */
+
+typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
+extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
+extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
+
+#if defined (DWARF2_BUILD_FRAME_INFO)
+/* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
+#if !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (0)
+#endif
+
+extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
+#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
+#define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
+#define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
+#endif
+
+typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile);
+extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile);
+extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
+#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
+#define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
+#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
+#endif
+
+typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
+extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
+extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
+#error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL)
+#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
+#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
+#endif
+
+typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
+extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
+extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
+#error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL)
+#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
+#endif
+#endif
+
+extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
+
+
+/* Mechanism for co-ordinating the selection of a specific
+ architecture.
+
+ GDB targets (*-tdep.c) can register an interest in a specific
+ architecture. Other GDB components can register a need to maintain
+ per-architecture data.
+
+ The mechanisms below ensures that there is only a loose connection
+ between the set-architecture command and the various GDB
+ components. Each component can independently register their need
+ to maintain architecture specific data with gdbarch.
+
+ Pragmatics:
+
+ Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
+ didn't scale.
+
+ The more traditional mega-struct containing architecture specific
+ data for all the various GDB components was also considered. Since
+ GDB is built from a variable number of (fairly independent)
+ components it was determined that the global aproach was not
+ applicable. */
+
+
+/* Register a new architectural family with GDB.
+
+ Register support for the specified ARCHITECTURE with GDB. When
+ gdbarch determines that the specified architecture has been
+ selected, the corresponding INIT function is called.
+
+ --
+
+ The INIT function takes two parameters: INFO which contains the
+ information available to gdbarch about the (possibly new)
+ architecture; ARCHES which is a list of the previously created
+ ``struct gdbarch'' for this architecture.
+
+ The INIT function parameter INFO shall, as far as possible, be
+ pre-initialized with information obtained from INFO.ABFD or
+ previously selected architecture (if similar).
+
+ The INIT function shall return any of: NULL - indicating that it
+ doesn't recognize the selected architecture; an existing ``struct
+ gdbarch'' from the ARCHES list - indicating that the new
+ architecture is just a synonym for an earlier architecture (see
+ gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
+ - that describes the selected architecture (see gdbarch_alloc()).
+
+ The DUMP_TDEP function shall print out all target specific values.
+ Care should be taken to ensure that the function works in both the
+ multi-arch and non- multi-arch cases. */
+
+struct gdbarch_list
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_list *next;
+};
+
+struct gdbarch_info
+{
+ /* Use default: NULL (ZERO). */
+ const struct bfd_arch_info *bfd_arch_info;
+
+ /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
+ int byte_order;
+
+ /* Use default: NULL (ZERO). */
+ bfd *abfd;
+
+ /* Use default: NULL (ZERO). */
+ struct gdbarch_tdep_info *tdep_info;
+};
+
+typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
+typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
+
+/* DEPRECATED - use gdbarch_register() */
+extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
+
+extern void gdbarch_register (enum bfd_architecture architecture,
+ gdbarch_init_ftype *,
+ gdbarch_dump_tdep_ftype *);
+
+
+/* Return a freshly allocated, NULL terminated, array of the valid
+ architecture names. Since architectures are registered during the
+ _initialize phase this function only returns useful information
+ once initialization has been completed. */
+
+extern const char **gdbarch_printable_names (void);
+
+
+/* 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 (struct gdbarch_list *arches, const struct gdbarch_info *info);
+
+
+/* Helper function. Create a preliminary ``struct gdbarch''. Perform
+ basic initialization using values obtained from the INFO andTDEP
+ parameters. set_gdbarch_*() functions are called to complete the
+ initialization of the object. */
+
+extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
+
+
+/* Helper function. Free a partially-constructed ``struct gdbarch''.
+ It is assumed that the caller freeds the ``struct
+ gdbarch_tdep''. */
+
+extern void gdbarch_free (struct gdbarch *);
+
+
+/* Helper function. Force an update of the current architecture.
+
+ The actual architecture selected is determined by INFO, ``(gdb) set
+ architecture'' et.al., the existing architecture and BFD's default
+ architecture. INFO should be initialized to zero and then selected
+ fields should be updated.
+
+ Returns non-zero if the update succeeds */
+
+extern int gdbarch_update_p (struct gdbarch_info info);
+
+
+
+/* Register per-architecture data-pointer.
+
+ Reserve space for a per-architecture data-pointer. An identifier
+ for the reserved data-pointer is returned. That identifer should
+ be saved in a local static variable.
+
+ The per-architecture data-pointer can be initialized in one of two
+ ways: The value can be set explicitly using a call to
+ set_gdbarch_data(); the value can be set implicitly using the value
+ returned by a non-NULL INIT() callback. INIT(), when non-NULL is
+ called after the basic architecture vector has been created.
+
+ When a previously created architecture is re-selected, the
+ per-architecture data-pointer for that previous architecture is
+ restored. INIT() is not called.
+
+ During initialization, multiple assignments of the data-pointer are
+ allowed, non-NULL values are deleted by calling FREE(). If the
+ architecture is deleted using gdbarch_free() all non-NULL data
+ pointers are also deleted using FREE().
+
+ Multiple registrarants for any architecture are allowed (and
+ strongly encouraged). */
+
+struct gdbarch_data;
+
+typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
+typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
+ void *pointer);
+extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
+ gdbarch_data_free_ftype *free);
+extern void set_gdbarch_data (struct gdbarch *gdbarch,
+ struct gdbarch_data *data,
+ void *pointer);
+
+extern void *gdbarch_data (struct gdbarch_data*);
+
+
+/* Register per-architecture memory region.
+
+ Provide a memory-region swap mechanism. Per-architecture memory
+ region are created. These memory regions are swapped whenever the
+ architecture is changed. For a new architecture, the memory region
+ is initialized with zero (0) and the INIT function is called.
+
+ Memory regions are swapped / initialized in the order that they are
+ registered. NULL DATA and/or INIT values can be specified.
+
+ New code should use register_gdbarch_data(). */
+
+typedef void (gdbarch_swap_ftype) (void);
+extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
+#define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
+
+
+
+/* The target-system-dependent byte order is dynamic */
+
+extern int target_byte_order;
#ifndef TARGET_BYTE_ORDER
#define TARGET_BYTE_ORDER (target_byte_order + 0)
#endif
@@ -56,7 +2545,7 @@ extern int target_byte_order_auto;
-/* The target-system-dependant BFD architecture is dynamic */
+/* The target-system-dependent BFD architecture is dynamic */
extern int target_architecture_auto;
#ifndef TARGET_ARCHITECTURE_AUTO
@@ -68,51 +2557,45 @@ extern const struct bfd_arch_info *target_architecture;
#define TARGET_ARCHITECTURE (target_architecture + 0)
#endif
-/* Notify the target dependant backend of a change to the selected
- 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 *));
+/* The target-system-dependent disassembler is semi-dynamic */
+extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
+ unsigned int len, disassemble_info *info);
+extern void dis_asm_memory_error (int status, bfd_vma memaddr,
+ disassemble_info *info);
-/* The target-system-dependant disassembler is semi-dynamic */
+extern void dis_asm_print_address (bfd_vma addr,
+ disassemble_info *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 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 int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
+extern int (*tm_print_insn) (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
#ifndef TARGET_PRINT_INSN_INFO
#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
#endif
-/* Set the dynamic target-system-dependant parameters (architecture,
+/* Set the dynamic target-system-dependent parameters (architecture,
byte-order, ...) using information found in the BFD */
-extern void set_gdbarch_from_file PARAMS ((bfd *));
+extern void set_gdbarch_from_file (bfd *);
-/* Explicitly set the dynamic target-system-dependant parameters based
- on bfd_architecture and machine. */
+/* Initialize the current architecture to the "first" one we find on
+ our list. */
-extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
+extern void initialize_current_architecture (void);
+/* For non-multiarched targets, do any initialization of the default
+ gdbarch object necessary after the _initialize_MODULE functions
+ have run. */
+extern void initialize_non_multiarch ();
/* gdbarch trace variable */
extern int gdbarch_debug;
+extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
+
#endif
diff --git a/contrib/gdb/gdb/gdbarch.sh b/contrib/gdb/gdb/gdbarch.sh
new file mode 100755
index 0000000..310d3c4
--- /dev/null
+++ b/contrib/gdb/gdb/gdbarch.sh
@@ -0,0 +1,2240 @@
+#!/bin/sh -u
+
+# Architecture commands for GDB, the GNU debugger.
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+compare_new ()
+{
+ file=$1
+ if test ! -r ${file}
+ then
+ echo "${file} missing? cp new-${file} ${file}" 1>&2
+ elif diff -u ${file} new-${file}
+ then
+ echo "${file} unchanged" 1>&2
+ else
+ echo "${file} has changed? cp new-${file} ${file}" 1>&2
+ fi
+}
+
+
+# Format of the input table
+read="class level macro returntype function formal actual attrib staticdefault predefault postdefault invalid_p fmt print print_p description"
+
+do_read ()
+{
+ comment=""
+ class=""
+ while read line
+ do
+ if test "${line}" = ""
+ then
+ continue
+ elif test "${line}" = "#" -a "${comment}" = ""
+ then
+ continue
+ elif expr "${line}" : "#" > /dev/null
+ then
+ comment="${comment}
+${line}"
+ else
+
+ # The semantics of IFS varies between different SH's. Some
+ # treat ``::' as three fields while some treat it as just too.
+ # Work around this by eliminating ``::'' ....
+ line="`echo "${line}" | sed -e 's/::/: :/g' -e 's/::/: :/g'`"
+
+ OFS="${IFS}" ; IFS="[:]"
+ eval read ${read} <<EOF
+${line}
+EOF
+ IFS="${OFS}"
+
+ # .... and then going back through each field and strip out those
+ # that ended up with just that space character.
+ for r in ${read}
+ do
+ if eval test \"\${${r}}\" = \"\ \"
+ then
+ eval ${r}=""
+ fi
+ done
+
+ case "${level}" in
+ 1 ) gt_level=">= GDB_MULTI_ARCH_PARTIAL" ;;
+ 2 ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
+ "" ) ;;
+ * ) error "Error: bad level for ${function}" 1>&2 ; kill $$ ; exit 1 ;;
+ esac
+
+ case "${class}" in
+ m ) staticdefault="${predefault}" ;;
+ M ) staticdefault="0" ;;
+ * ) test "${staticdefault}" || staticdefault=0 ;;
+ esac
+ # NOT YET: Breaks BELIEVE_PCC_PROMOTION and confuses non-
+ # multi-arch defaults.
+ # test "${predefault}" || predefault=0
+
+ # come up with a format, use a few guesses for variables
+ case ":${class}:${fmt}:${print}:" in
+ :[vV]::: )
+ if [ "${returntype}" = int ]
+ then
+ fmt="%d"
+ print="${macro}"
+ elif [ "${returntype}" = long ]
+ then
+ fmt="%ld"
+ print="${macro}"
+ fi
+ ;;
+ esac
+ test "${fmt}" || fmt="%ld"
+ test "${print}" || print="(long) ${macro}"
+
+ case "${invalid_p}" in
+ 0 ) valid_p=1 ;;
+ "" )
+ if [ -n "${predefault}" ]
+ then
+ #invalid_p="gdbarch->${function} == ${predefault}"
+ valid_p="gdbarch->${function} != ${predefault}"
+ else
+ #invalid_p="gdbarch->${function} == 0"
+ valid_p="gdbarch->${function} != 0"
+ fi
+ ;;
+ * ) valid_p="!(${invalid_p})"
+ esac
+
+ # PREDEFAULT is a valid fallback definition of MEMBER when
+ # multi-arch is not enabled. This ensures that the
+ # default value, when multi-arch is the same as the
+ # default value when not multi-arch. POSTDEFAULT is
+ # always a valid definition of MEMBER as this again
+ # ensures consistency.
+
+ if [ -n "${postdefault}" ]
+ then
+ fallbackdefault="${postdefault}"
+ elif [ -n "${predefault}" ]
+ then
+ fallbackdefault="${predefault}"
+ else
+ fallbackdefault="0"
+ fi
+
+ #NOT YET: See gdbarch.log for basic verification of
+ # database
+
+ break
+ fi
+ done
+ if [ -n "${class}" ]
+ then
+ true
+ else
+ false
+ fi
+}
+
+
+fallback_default_p ()
+{
+ [ -n "${postdefault}" -a "x${invalid_p}" != "x0" ] \
+ || [ -n "${predefault}" -a "x${invalid_p}" = "x0" ]
+}
+
+class_is_variable_p ()
+{
+ case "${class}" in
+ *v* | *V* ) true ;;
+ * ) false ;;
+ esac
+}
+
+class_is_function_p ()
+{
+ case "${class}" in
+ *f* | *F* | *m* | *M* ) true ;;
+ * ) false ;;
+ esac
+}
+
+class_is_multiarch_p ()
+{
+ case "${class}" in
+ *m* | *M* ) true ;;
+ * ) false ;;
+ esac
+}
+
+class_is_predicate_p ()
+{
+ case "${class}" in
+ *F* | *V* | *M* ) true ;;
+ * ) false ;;
+ esac
+}
+
+class_is_info_p ()
+{
+ case "${class}" in
+ *i* ) true ;;
+ * ) false ;;
+ esac
+}
+
+
+# dump out/verify the doco
+for field in ${read}
+do
+ case ${field} in
+
+ class ) : ;;
+
+ # # -> line disable
+ # f -> function
+ # hiding a function
+ # F -> function + predicate
+ # hiding a function + predicate to test function validity
+ # v -> variable
+ # hiding a variable
+ # V -> variable + predicate
+ # hiding a variable + predicate to test variables validity
+ # i -> set from info
+ # hiding something from the ``struct info'' object
+ # m -> multi-arch function
+ # hiding a multi-arch function (parameterised with the architecture)
+ # M -> multi-arch function + predicate
+ # hiding a multi-arch function + predicate to test function validity
+
+ level ) : ;;
+
+ # See GDB_MULTI_ARCH description. Having GDB_MULTI_ARCH >=
+ # LEVEL is a predicate on checking that a given method is
+ # initialized (using INVALID_P).
+
+ macro ) : ;;
+
+ # The name of the MACRO that this method is to be accessed by.
+
+ returntype ) : ;;
+
+ # For functions, the return type; for variables, the data type
+
+ function ) : ;;
+
+ # For functions, the member function name; for variables, the
+ # variable name. Member function names are always prefixed with
+ # ``gdbarch_'' for name-space purity.
+
+ formal ) : ;;
+
+ # The formal argument list. It is assumed that the formal
+ # argument list includes the actual name of each list element.
+ # A function with no arguments shall have ``void'' as the
+ # formal argument list.
+
+ actual ) : ;;
+
+ # The list of actual arguments. The arguments specified shall
+ # match the FORMAL list given above. Functions with out
+ # arguments leave this blank.
+
+ attrib ) : ;;
+
+ # Any GCC attributes that should be attached to the function
+ # declaration. At present this field is unused.
+
+ staticdefault ) : ;;
+
+ # To help with the GDB startup a static gdbarch object is
+ # created. STATICDEFAULT is the value to insert into that
+ # static gdbarch object. Since this a static object only
+ # simple expressions can be used.
+
+ # If STATICDEFAULT is empty, zero is used.
+
+ predefault ) : ;;
+
+ # An initial value to assign to MEMBER of the freshly
+ # malloc()ed gdbarch object. After initialization, the
+ # freshly malloc()ed object is passed to the target
+ # architecture code for further updates.
+
+ # If PREDEFAULT is empty, zero is used.
+
+ # A non-empty PREDEFAULT, an empty POSTDEFAULT and a zero
+ # INVALID_P are specified, PREDEFAULT will be used as the
+ # default for the non- multi-arch target.
+
+ # A zero PREDEFAULT function will force the fallback to call
+ # internal_error().
+
+ # Variable declarations can refer to ``gdbarch'' which will
+ # contain the current architecture. Care should be taken.
+
+ postdefault ) : ;;
+
+ # A value to assign to MEMBER of the new gdbarch object should
+ # the target architecture code fail to change the PREDEFAULT
+ # value.
+
+ # If POSTDEFAULT is empty, no post update is performed.
+
+ # If both INVALID_P and POSTDEFAULT are non-empty then
+ # INVALID_P will be used to determine if MEMBER should be
+ # changed to POSTDEFAULT.
+
+ # If a non-empty POSTDEFAULT and a zero INVALID_P are
+ # specified, POSTDEFAULT will be used as the default for the
+ # non- multi-arch target (regardless of the value of
+ # PREDEFAULT).
+
+ # You cannot specify both a zero INVALID_P and a POSTDEFAULT.
+
+ # Variable declarations can refer to ``gdbarch'' which will
+ # contain the current architecture. Care should be taken.
+
+ invalid_p ) : ;;
+
+ # A predicate equation that validates MEMBER. Non-zero is
+ # returned if the code creating the new architecture failed to
+ # initialize MEMBER or the initialized the member is invalid.
+ # If POSTDEFAULT is non-empty then MEMBER will be updated to
+ # that value. If POSTDEFAULT is empty then internal_error()
+ # is called.
+
+ # If INVALID_P is empty, a check that MEMBER is no longer
+ # equal to PREDEFAULT is used.
+
+ # The expression ``0'' disables the INVALID_P check making
+ # PREDEFAULT a legitimate value.
+
+ # See also PREDEFAULT and POSTDEFAULT.
+
+ fmt ) : ;;
+
+ # printf style format string that can be used to print out the
+ # MEMBER. Sometimes "%s" is useful. For functions, this is
+ # ignored and the function address is printed.
+
+ # If FMT is empty, ``%ld'' is used.
+
+ print ) : ;;
+
+ # An optional equation that casts MEMBER to a value suitable
+ # for formatting by FMT.
+
+ # If PRINT is empty, ``(long)'' is used.
+
+ print_p ) : ;;
+
+ # An optional indicator for any predicte to wrap around the
+ # print member code.
+
+ # () -> Call a custom function to do the dump.
+ # exp -> Wrap print up in ``if (${print_p}) ...
+ # ``'' -> No predicate
+
+ # If PRINT_P is empty, ``1'' is always used.
+
+ description ) : ;;
+
+ # Currently unused.
+
+ *)
+ echo "Bad field ${field}"
+ exit 1;;
+ esac
+done
+
+
+function_list ()
+{
+ # See below (DOCO) for description of each field
+ cat <<EOF
+i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
+#
+i:2:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG
+# Number of bits in a char or unsigned char for the target machine.
+# Just like CHAR_BIT in <limits.h> but describes the target machine.
+# v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
+#
+# Number of bits in a short or unsigned short for the target machine.
+v::TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0
+# Number of bits in an int or unsigned int for the target machine.
+v::TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0
+# Number of bits in a long or unsigned long for the target machine.
+v::TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0
+# Number of bits in a long long or unsigned long long for the target
+# machine.
+v::TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
+# Number of bits in a float for the target machine.
+v::TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0
+# Number of bits in a double for the target machine.
+v::TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0
+# Number of bits in a long double for the target machine.
+v::TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0
+# For most targets, a pointer on the target and its representation as an
+# address in GDB have the same size and "look the same". For such a
+# target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+# / addr_bit will be set from it.
+#
+# If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+# also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+#
+# ptr_bit is the size of a pointer on the target
+v::TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
+# addr_bit is the size of a target address as represented in gdb
+v::TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT:
+# Number of bits in a BFD_VMA for the target object file format.
+v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
+#
+# One if \`char' acts like \`signed char', zero if \`unsigned char'.
+v::TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
+#
+f::TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0
+f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
+f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
+f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
+f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
+f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
+# Function for getting target's idea of a frame pointer. FIXME: GDB's
+# whole scheme for dealing with "frames" and "frame pointers" needs a
+# serious shakedown.
+f::TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0
+#
+M:::void:register_read:int regnum, char *buf:regnum, buf:
+M:::void:register_write:int regnum, char *buf:regnum, buf:
+#
+v:2:NUM_REGS:int:num_regs::::0:-1
+# This macro gives the number of pseudo-registers that live in the
+# register namespace but do not get fetched or stored on the target.
+# These pseudo-registers may be aliases for other registers,
+# combinations of other registers, or they may be computed by GDB.
+v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
+v:2:SP_REGNUM:int:sp_regnum::::0:-1
+v:2:FP_REGNUM:int:fp_regnum::::0:-1
+v:2:PC_REGNUM:int:pc_regnum::::0:-1
+v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
+v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
+v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0
+# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
+f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
+# Provide a default mapping from a ecoff register number to a gdb REGNUM.
+f:2:ECOFF_REG_TO_REGNUM:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr:::no_op_reg_to_regnum::0
+# Provide a default mapping from a DWARF register number to a gdb REGNUM.
+f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no_op_reg_to_regnum::0
+# Convert from an sdb register number to an internal gdb register number.
+# This should be defined in tm.h, if REGISTER_NAMES is not set up
+# to map one to one onto the sdb register numbers.
+f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
+f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
+f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name::0
+v:2:REGISTER_SIZE:int:register_size::::0:-1
+v:2:REGISTER_BYTES:int:register_bytes::::0:-1
+f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
+f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_raw_size:0
+v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
+f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_virtual_size:0
+v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
+f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
+f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
+f:2:PRINT_FLOAT_INFO:void:print_float_info:void::::default_print_float_info::0
+# MAP a GDB RAW register number onto a simulator register number. See
+# also include/...-sim.h.
+f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::default_register_sim_regno::0
+F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes::0:0
+f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
+f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
+# setjmp/longjmp support.
+F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc::0:0
+#
+# Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that
+# much better but at least they are vaguely consistent). The headers
+# and body contain convoluted #if/#else sequences for determine how
+# things should be compiled. Instead of trying to mimic that
+# behaviour here (and hence entrench it further) gdbarch simply
+# reqires that these methods be set up from the word go. This also
+# avoids any potential problems with moving beyond multi-arch partial.
+v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1
+v:1:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0
+f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0
+v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx
+v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P
+v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1
+v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END
+f:1:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::0:0
+v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1
+v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
+v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx
+v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx
+v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P
+f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
+f:2:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
+f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0
+#
+v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
+v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
+f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double::0
+# GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the
+# old code has strange #ifdef interaction. So far no one has found
+# that default_get_saved_register() is the default they are after.
+f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval::generic_get_saved_register:0
+#
+f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
+f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
+f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0::0
+# This function is called when the value of a pseudo-register needs to
+# be updated. Typically it will be defined on a per-architecture
+# basis.
+F:2:FETCH_PSEUDO_REGISTER:void:fetch_pseudo_register:int regnum:regnum:
+# This function is called when the value of a pseudo-register needs to
+# be set or stored. Typically it will be defined on a
+# per-architecture basis.
+F:2:STORE_PSEUDO_REGISTER:void:store_pseudo_register:int regnum:regnum:
+#
+f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, void *buf:type, buf:::unsigned_pointer_to_address::0
+f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
+F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
+#
+f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
+f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0
+f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
+f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
+F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
+f:2:POP_FRAME:void:pop_frame:void:-:::0
+#
+f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
+f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
+F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
+f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
+#
+f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
+F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
+#
+f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
+f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0
+f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
+f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0
+f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
+f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
+v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
+f::PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0
+v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
+#
+f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
+#
+v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
+f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
+f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
+# Define a default FRAME_CHAIN_VALID, in the form that is suitable for
+# most targets. If FRAME_CHAIN_VALID returns zero it means that the
+# given frame is the outermost one and has no caller.
+#
+# XXXX - both default and alternate frame_chain_valid functions are
+# deprecated. New code should use dummy frames and one of the generic
+# functions.
+f:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe:::func_frame_chain_valid::0
+f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
+f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:0
+f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:0
+f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0
+f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0
+#
+F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
+v:2:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0:::
+F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
+F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0
+v:2:PARM_BOUNDARY:int:parm_boundary
+#
+v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch)
+v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)
+v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (gdbarch)
+f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::core_addr_identity::0
+# On some machines there are bits in addresses which are not really
+# part of the address, but are used by the kernel, the hardware, etc.
+# for special purposes. ADDR_BITS_REMOVE takes out any such bits so
+# we get a "real" address such as one would find in a symbol table.
+# This is used only for addresses of instructions, and even then I'm
+# not sure it's used in all contexts. It exists to deal with there
+# being a few stray bits in the PC which would mislead us, not as some
+# sort of generic thing to handle alignment or segmentation (it's
+# possible it should be in TARGET_READ_PC instead).
+f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0
+# It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
+# ADDR_BITS_REMOVE.
+f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_addr_identity::0
+# FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
+# the target needs software single step. An ISA method to implement it.
+#
+# FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+# using the breakpoint system instead of blatting memory directly (as with rs6000).
+#
+# FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
+# single step. If not, then implement single step using breakpoints.
+F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
+f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
+f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
+# For SVR4 shared libraries, each call goes through a small piece of
+# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
+# to nonzero if we are current stopped in one of these.
+f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
+# A target might have problems with watchpoints as soon as the stack
+# frame of the current function has been destroyed. This mostly happens
+# as the first action in a funtion's epilogue. in_function_epilogue_p()
+# is defined to return a non-zero value if either the given addr is one
+# instruction after the stack destroying instruction up to the trailing
+# return instruction or if we can figure out that the stack frame has
+# already been invalidated regardless of the value of addr. Targets
+# which don't suffer from that problem could just let this functionality
+# untouched.
+m:::int:in_function_epilogue_p:CORE_ADDR addr:addr::0:generic_in_function_epilogue_p::0
+# Given a vector of command-line arguments, return a newly allocated
+# string which, when passed to the create_inferior function, will be
+# parsed (on Unix systems, by the shell) to yield the same vector.
+# This function should call error() if the argument vector is not
+# representable for this target or if this target does not support
+# command-line arguments.
+# ARGC is the number of elements in the vector.
+# ARGV is an array of strings, one per argument.
+m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:construct_inferior_arguments:int argc, char **argv:argc, argv:::construct_inferior_arguments::0
+F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile:objfile:::0
+f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
+f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
+EOF
+}
+
+#
+# The .log file
+#
+exec > new-gdbarch.log
+function_list | while do_read
+do
+ cat <<EOF
+${class} ${macro}(${actual})
+ ${returntype} ${function} ($formal)${attrib}
+EOF
+ for r in ${read}
+ do
+ eval echo \"\ \ \ \ ${r}=\${${r}}\"
+ done
+# #fallbackdefault=${fallbackdefault}
+# #valid_p=${valid_p}
+#EOF
+ if class_is_predicate_p && fallback_default_p
+ then
+ echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2
+ kill $$
+ exit 1
+ fi
+ if [ "x${invalid_p}" = "x0" -a -n "${postdefault}" ]
+ then
+ echo "Error: postdefault is useless when invalid_p=0" 1>&2
+ kill $$
+ exit 1
+ fi
+ if class_is_multiarch_p
+ then
+ if class_is_predicate_p ; then :
+ elif test "x${predefault}" = "x"
+ then
+ echo "Error: pure multi-arch function must have a predefault" 1>&2
+ kill $$
+ exit 1
+ fi
+ fi
+ echo ""
+done
+
+exec 1>&2
+compare_new gdbarch.log
+
+
+copyright ()
+{
+cat <<EOF
+/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
+
+/* Dynamic architecture support for GDB, the GNU debugger.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This file was created with the aid of \`\`gdbarch.sh''.
+
+ The Bourne shell script \`\`gdbarch.sh'' creates the files
+ \`\`new-gdbarch.c'' and \`\`new-gdbarch.h and then compares them
+ against the existing \`\`gdbarch.[hc]''. Any differences found
+ being reported.
+
+ If editing this file, please also run gdbarch.sh and merge any
+ changes into that script. Conversely, when making sweeping changes
+ to this file, modifying gdbarch.sh and using its output may prove
+ easier. */
+
+EOF
+}
+
+#
+# The .h file
+#
+
+exec > new-gdbarch.h
+copyright
+cat <<EOF
+#ifndef GDBARCH_H
+#define GDBARCH_H
+
+#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
+#if !GDB_MULTI_ARCH
+#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
+#endif
+
+struct frame_info;
+struct value;
+struct objfile;
+struct minimal_symbol;
+
+extern struct gdbarch *current_gdbarch;
+
+
+/* If any of the following are defined, the target wasn't correctly
+ converted. */
+
+#if GDB_MULTI_ARCH
+#if defined (EXTRA_FRAME_INFO)
+#error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
+#endif
+#endif
+
+#if GDB_MULTI_ARCH
+#if defined (FRAME_FIND_SAVED_REGS)
+#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
+#endif
+#endif
+
+#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
+#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
+#endif
+EOF
+
+# function typedef's
+printf "\n"
+printf "\n"
+printf "/* The following are pre-initialized by GDBARCH. */\n"
+function_list | while do_read
+do
+ if class_is_info_p
+ then
+ printf "\n"
+ printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
+ printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
+ printf "#error \"Non multi-arch definition of ${macro}\"\n"
+ printf "#endif\n"
+ printf "#if GDB_MULTI_ARCH\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
+ printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+ printf "#endif\n"
+ printf "#endif\n"
+ fi
+done
+
+# function typedef's
+printf "\n"
+printf "\n"
+printf "/* The following are initialized by the target dependent code. */\n"
+function_list | while do_read
+do
+ if [ -n "${comment}" ]
+ then
+ echo "${comment}" | sed \
+ -e '2 s,#,/*,' \
+ -e '3,$ s,#, ,' \
+ -e '$ s,$, */,'
+ fi
+ if class_is_multiarch_p
+ then
+ if class_is_predicate_p
+ then
+ printf "\n"
+ printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
+ fi
+ else
+ if class_is_predicate_p
+ then
+ printf "\n"
+ printf "#if defined (${macro})\n"
+ printf "/* Legacy for systems yet to multi-arch ${macro} */\n"
+ #printf "#if (GDB_MULTI_ARCH <= GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+ printf "#if !defined (${macro}_P)\n"
+ printf "#define ${macro}_P() (1)\n"
+ printf "#endif\n"
+ printf "#endif\n"
+ printf "\n"
+ printf "/* Default predicate for non- multi-arch targets. */\n"
+ printf "#if (!GDB_MULTI_ARCH) && !defined (${macro}_P)\n"
+ printf "#define ${macro}_P() (0)\n"
+ printf "#endif\n"
+ printf "\n"
+ printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro}_P)\n"
+ printf "#error \"Non multi-arch definition of ${macro}\"\n"
+ printf "#endif\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro}_P)\n"
+ printf "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))\n"
+ printf "#endif\n"
+ fi
+ fi
+ if class_is_variable_p
+ then
+ if fallback_default_p || class_is_predicate_p
+ then
+ printf "\n"
+ printf "/* Default (value) for non- multi-arch platforms. */\n"
+ printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n"
+ echo "#define ${macro} (${fallbackdefault})" \
+ | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g'
+ printf "#endif\n"
+ fi
+ printf "\n"
+ printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
+ printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
+ printf "#error \"Non multi-arch definition of ${macro}\"\n"
+ printf "#endif\n"
+ printf "#if GDB_MULTI_ARCH\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
+ printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+ printf "#endif\n"
+ printf "#endif\n"
+ fi
+ if class_is_function_p
+ then
+ if class_is_multiarch_p ; then :
+ elif fallback_default_p || class_is_predicate_p
+ then
+ printf "\n"
+ printf "/* Default (function) for non- multi-arch platforms. */\n"
+ printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n"
+ if [ "x${fallbackdefault}" = "x0" ]
+ then
+ printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
+ else
+ # FIXME: Should be passing current_gdbarch through!
+ echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \
+ | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g'
+ fi
+ printf "#endif\n"
+ fi
+ printf "\n"
+ if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
+ then
+ printf "typedef ${returntype} (gdbarch_${function}_ftype) (struct gdbarch *gdbarch);\n"
+ elif class_is_multiarch_p
+ then
+ printf "typedef ${returntype} (gdbarch_${function}_ftype) (struct gdbarch *gdbarch, ${formal});\n"
+ else
+ printf "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});\n"
+ fi
+ if [ "x${formal}" = "xvoid" ]
+ then
+ printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
+ else
+ printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});\n"
+ fi
+ printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});\n"
+ if class_is_multiarch_p ; then :
+ else
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
+ printf "#error \"Non multi-arch definition of ${macro}\"\n"
+ printf "#endif\n"
+ printf "#if GDB_MULTI_ARCH\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
+ if [ "x${actual}" = "x" ]
+ then
+ printf "#define ${macro}() (gdbarch_${function} (current_gdbarch))\n"
+ elif [ "x${actual}" = "x-" ]
+ then
+ printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+ else
+ printf "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))\n"
+ fi
+ printf "#endif\n"
+ printf "#endif\n"
+ fi
+ fi
+done
+
+# close it off
+cat <<EOF
+
+extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
+
+
+/* Mechanism for co-ordinating the selection of a specific
+ architecture.
+
+ GDB targets (*-tdep.c) can register an interest in a specific
+ architecture. Other GDB components can register a need to maintain
+ per-architecture data.
+
+ The mechanisms below ensures that there is only a loose connection
+ between the set-architecture command and the various GDB
+ components. Each component can independently register their need
+ to maintain architecture specific data with gdbarch.
+
+ Pragmatics:
+
+ Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
+ didn't scale.
+
+ The more traditional mega-struct containing architecture specific
+ data for all the various GDB components was also considered. Since
+ GDB is built from a variable number of (fairly independent)
+ components it was determined that the global aproach was not
+ applicable. */
+
+
+/* Register a new architectural family with GDB.
+
+ Register support for the specified ARCHITECTURE with GDB. When
+ gdbarch determines that the specified architecture has been
+ selected, the corresponding INIT function is called.
+
+ --
+
+ The INIT function takes two parameters: INFO which contains the
+ information available to gdbarch about the (possibly new)
+ architecture; ARCHES which is a list of the previously created
+ \`\`struct gdbarch'' for this architecture.
+
+ The INIT function parameter INFO shall, as far as possible, be
+ pre-initialized with information obtained from INFO.ABFD or
+ previously selected architecture (if similar).
+
+ The INIT function shall return any of: NULL - indicating that it
+ doesn't recognize the selected architecture; an existing \`\`struct
+ gdbarch'' from the ARCHES list - indicating that the new
+ architecture is just a synonym for an earlier architecture (see
+ gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch''
+ - that describes the selected architecture (see gdbarch_alloc()).
+
+ The DUMP_TDEP function shall print out all target specific values.
+ Care should be taken to ensure that the function works in both the
+ multi-arch and non- multi-arch cases. */
+
+struct gdbarch_list
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_list *next;
+};
+
+struct gdbarch_info
+{
+ /* Use default: NULL (ZERO). */
+ const struct bfd_arch_info *bfd_arch_info;
+
+ /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
+ int byte_order;
+
+ /* Use default: NULL (ZERO). */
+ bfd *abfd;
+
+ /* Use default: NULL (ZERO). */
+ struct gdbarch_tdep_info *tdep_info;
+};
+
+typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
+typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
+
+/* DEPRECATED - use gdbarch_register() */
+extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
+
+extern void gdbarch_register (enum bfd_architecture architecture,
+ gdbarch_init_ftype *,
+ gdbarch_dump_tdep_ftype *);
+
+
+/* Return a freshly allocated, NULL terminated, array of the valid
+ architecture names. Since architectures are registered during the
+ _initialize phase this function only returns useful information
+ once initialization has been completed. */
+
+extern const char **gdbarch_printable_names (void);
+
+
+/* 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 (struct gdbarch_list *arches, const struct gdbarch_info *info);
+
+
+/* Helper function. Create a preliminary \`\`struct gdbarch''. Perform
+ basic initialization using values obtained from the INFO andTDEP
+ parameters. set_gdbarch_*() functions are called to complete the
+ initialization of the object. */
+
+extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
+
+
+/* Helper function. Free a partially-constructed \`\`struct gdbarch''.
+ It is assumed that the caller freeds the \`\`struct
+ gdbarch_tdep''. */
+
+extern void gdbarch_free (struct gdbarch *);
+
+
+/* Helper function. Force an update of the current architecture.
+
+ The actual architecture selected is determined by INFO, \`\`(gdb) set
+ architecture'' et.al., the existing architecture and BFD's default
+ architecture. INFO should be initialized to zero and then selected
+ fields should be updated.
+
+ Returns non-zero if the update succeeds */
+
+extern int gdbarch_update_p (struct gdbarch_info info);
+
+
+
+/* Register per-architecture data-pointer.
+
+ Reserve space for a per-architecture data-pointer. An identifier
+ for the reserved data-pointer is returned. That identifer should
+ be saved in a local static variable.
+
+ The per-architecture data-pointer can be initialized in one of two
+ ways: The value can be set explicitly using a call to
+ set_gdbarch_data(); the value can be set implicitly using the value
+ returned by a non-NULL INIT() callback. INIT(), when non-NULL is
+ called after the basic architecture vector has been created.
+
+ When a previously created architecture is re-selected, the
+ per-architecture data-pointer for that previous architecture is
+ restored. INIT() is not called.
+
+ During initialization, multiple assignments of the data-pointer are
+ allowed, non-NULL values are deleted by calling FREE(). If the
+ architecture is deleted using gdbarch_free() all non-NULL data
+ pointers are also deleted using FREE().
+
+ Multiple registrarants for any architecture are allowed (and
+ strongly encouraged). */
+
+struct gdbarch_data;
+
+typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
+typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
+ void *pointer);
+extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
+ gdbarch_data_free_ftype *free);
+extern void set_gdbarch_data (struct gdbarch *gdbarch,
+ struct gdbarch_data *data,
+ void *pointer);
+
+extern void *gdbarch_data (struct gdbarch_data*);
+
+
+/* Register per-architecture memory region.
+
+ Provide a memory-region swap mechanism. Per-architecture memory
+ region are created. These memory regions are swapped whenever the
+ architecture is changed. For a new architecture, the memory region
+ is initialized with zero (0) and the INIT function is called.
+
+ Memory regions are swapped / initialized in the order that they are
+ registered. NULL DATA and/or INIT values can be specified.
+
+ New code should use register_gdbarch_data(). */
+
+typedef void (gdbarch_swap_ftype) (void);
+extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
+#define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
+
+
+
+/* The target-system-dependent byte order is dynamic */
+
+extern int target_byte_order;
+#ifndef TARGET_BYTE_ORDER
+#define TARGET_BYTE_ORDER (target_byte_order + 0)
+#endif
+
+extern int target_byte_order_auto;
+#ifndef TARGET_BYTE_ORDER_AUTO
+#define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
+#endif
+
+
+
+/* The target-system-dependent BFD architecture is dynamic */
+
+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;
+#ifndef TARGET_ARCHITECTURE
+#define TARGET_ARCHITECTURE (target_architecture + 0)
+#endif
+
+
+/* The target-system-dependent disassembler is semi-dynamic */
+
+extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
+ unsigned int len, disassemble_info *info);
+
+extern void dis_asm_memory_error (int status, bfd_vma memaddr,
+ disassemble_info *info);
+
+extern void dis_asm_print_address (bfd_vma addr,
+ disassemble_info *info);
+
+extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
+extern disassemble_info tm_print_insn_info;
+#ifndef TARGET_PRINT_INSN_INFO
+#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
+#endif
+
+
+
+/* Set the dynamic target-system-dependent parameters (architecture,
+ byte-order, ...) using information found in the BFD */
+
+extern void set_gdbarch_from_file (bfd *);
+
+
+/* Initialize the current architecture to the "first" one we find on
+ our list. */
+
+extern void initialize_current_architecture (void);
+
+/* For non-multiarched targets, do any initialization of the default
+ gdbarch object necessary after the _initialize_MODULE functions
+ have run. */
+extern void initialize_non_multiarch ();
+
+/* gdbarch trace variable */
+extern int gdbarch_debug;
+
+extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
+
+#endif
+EOF
+exec 1>&2
+#../move-if-change new-gdbarch.h gdbarch.h
+compare_new gdbarch.h
+
+
+#
+# C file
+#
+
+exec > new-gdbarch.c
+copyright
+cat <<EOF
+
+#include "defs.h"
+#include "arch-utils.h"
+
+#if GDB_MULTI_ARCH
+#include "gdbcmd.h"
+#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. */
+#include "gdb_string.h"
+#include <ctype.h>
+#include "symtab.h"
+#include "frame.h"
+#include "inferior.h"
+#include "breakpoint.h"
+#include "gdb_wait.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "gdbthread.h"
+#include "annotate.h"
+#include "symfile.h" /* for overlay functions */
+#include "value.h" /* For old tm.h/nm.h macros. */
+#endif
+#include "symcat.h"
+
+#include "floatformat.h"
+
+#include "gdb_assert.h"
+#include "gdb-events.h"
+
+/* Static function declarations */
+
+static void verify_gdbarch (struct gdbarch *gdbarch);
+static void alloc_gdbarch_data (struct gdbarch *);
+static void init_gdbarch_data (struct gdbarch *);
+static void free_gdbarch_data (struct gdbarch *);
+static void init_gdbarch_swap (struct gdbarch *);
+static void swapout_gdbarch_swap (struct gdbarch *);
+static void swapin_gdbarch_swap (struct gdbarch *);
+
+/* Convenience macro for allocting typesafe memory. */
+
+#ifndef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+#endif
+
+
+/* Non-zero if we want to trace architecture code. */
+
+#ifndef GDBARCH_DEBUG
+#define GDBARCH_DEBUG 0
+#endif
+int gdbarch_debug = GDBARCH_DEBUG;
+
+EOF
+
+# gdbarch open the gdbarch object
+printf "\n"
+printf "/* Maintain the struct gdbarch object */\n"
+printf "\n"
+printf "struct gdbarch\n"
+printf "{\n"
+printf " /* basic architectural information */\n"
+function_list | while do_read
+do
+ if class_is_info_p
+ then
+ printf " ${returntype} ${function};\n"
+ fi
+done
+printf "\n"
+printf " /* target specific vector. */\n"
+printf " struct gdbarch_tdep *tdep;\n"
+printf " gdbarch_dump_tdep_ftype *dump_tdep;\n"
+printf "\n"
+printf " /* per-architecture data-pointers */\n"
+printf " unsigned nr_data;\n"
+printf " void **data;\n"
+printf "\n"
+printf " /* per-architecture swap-regions */\n"
+printf " struct gdbarch_swap *swap;\n"
+printf "\n"
+cat <<EOF
+ /* Multi-arch values.
+
+ When extending this structure you must:
+
+ Add the field below.
+
+ 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.
+
+ verify_gdbarch(): Confirm that the target updated the field
+ correctly.
+
+ gdbarch_dump(): Add a fprintf_unfiltered call so that the new
+ field is dumped out
+
+ \`\`startup_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).
+
+ */
+
+EOF
+function_list | while do_read
+do
+ if class_is_variable_p
+ then
+ printf " ${returntype} ${function};\n"
+ elif class_is_function_p
+ then
+ printf " gdbarch_${function}_ftype *${function}${attrib};\n"
+ fi
+done
+printf "};\n"
+
+# A pre-initialized vector
+printf "\n"
+printf "\n"
+cat <<EOF
+/* The default architecture uses host values (for want of a better
+ choice). */
+EOF
+printf "\n"
+printf "extern const struct bfd_arch_info bfd_default_arch_struct;\n"
+printf "\n"
+printf "struct gdbarch startup_gdbarch =\n"
+printf "{\n"
+printf " /* basic architecture information */\n"
+function_list | while do_read
+do
+ if class_is_info_p
+ then
+ printf " ${staticdefault},\n"
+ fi
+done
+cat <<EOF
+ /* target specific vector and its dump routine */
+ NULL, NULL,
+ /*per-architecture data-pointers and swap regions */
+ 0, NULL, NULL,
+ /* Multi-arch values */
+EOF
+function_list | while do_read
+do
+ if class_is_function_p || class_is_variable_p
+ then
+ printf " ${staticdefault},\n"
+ fi
+done
+cat <<EOF
+ /* startup_gdbarch() */
+};
+
+struct gdbarch *current_gdbarch = &startup_gdbarch;
+
+/* Do any initialization needed for a non-multiarch configuration
+ after the _initialize_MODULE functions have been run. */
+void
+initialize_non_multiarch ()
+{
+ alloc_gdbarch_data (&startup_gdbarch);
+ init_gdbarch_data (&startup_gdbarch);
+}
+EOF
+
+# Create a new gdbarch struct
+printf "\n"
+printf "\n"
+cat <<EOF
+/* Create a new \`\`struct gdbarch'' based on information provided by
+ \`\`struct gdbarch_info''. */
+EOF
+printf "\n"
+cat <<EOF
+struct gdbarch *
+gdbarch_alloc (const struct gdbarch_info *info,
+ struct gdbarch_tdep *tdep)
+{
+ /* NOTE: The new architecture variable is named \`\`current_gdbarch''
+ so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
+ the current local architecture and not the previous global
+ architecture. This ensures that the new architectures initial
+ values are not influenced by the previous architecture. Once
+ everything is parameterised with gdbarch, this will go away. */
+ struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
+ memset (current_gdbarch, 0, sizeof (*current_gdbarch));
+
+ alloc_gdbarch_data (current_gdbarch);
+
+ current_gdbarch->tdep = tdep;
+EOF
+printf "\n"
+function_list | while do_read
+do
+ if class_is_info_p
+ then
+ printf " current_gdbarch->${function} = info->${function};\n"
+ fi
+done
+printf "\n"
+printf " /* Force the explicit initialization of these. */\n"
+function_list | while do_read
+do
+ if class_is_function_p || class_is_variable_p
+ then
+ if [ -n "${predefault}" -a "x${predefault}" != "x0" ]
+ then
+ printf " current_gdbarch->${function} = ${predefault};\n"
+ fi
+ fi
+done
+cat <<EOF
+ /* gdbarch_alloc() */
+
+ return current_gdbarch;
+}
+EOF
+
+# Free a gdbarch struct.
+printf "\n"
+printf "\n"
+cat <<EOF
+/* Free a gdbarch struct. This should never happen in normal
+ operation --- once you've created a gdbarch, you keep it around.
+ However, if an architecture's init function encounters an error
+ building the structure, it may need to clean up a partially
+ constructed gdbarch. */
+
+void
+gdbarch_free (struct gdbarch *arch)
+{
+ gdb_assert (arch != NULL);
+ free_gdbarch_data (arch);
+ xfree (arch);
+}
+EOF
+
+# verify a new architecture
+printf "\n"
+printf "\n"
+printf "/* Ensure that all values in a GDBARCH are reasonable. */\n"
+printf "\n"
+cat <<EOF
+static void
+verify_gdbarch (struct gdbarch *gdbarch)
+{
+ struct ui_file *log;
+ struct cleanup *cleanups;
+ long dummy;
+ char *buf;
+ /* Only perform sanity checks on a multi-arch target. */
+ if (!GDB_MULTI_ARCH)
+ return;
+ log = mem_fileopen ();
+ cleanups = make_cleanup_ui_file_delete (log);
+ /* fundamental */
+ if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
+ fprintf_unfiltered (log, "\n\tbyte-order");
+ if (gdbarch->bfd_arch_info == NULL)
+ fprintf_unfiltered (log, "\n\tbfd_arch_info");
+ /* Check those that need to be defined for the given multi-arch level. */
+EOF
+function_list | while do_read
+do
+ if class_is_function_p || class_is_variable_p
+ then
+ if [ "x${invalid_p}" = "x0" ]
+ then
+ printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
+ elif class_is_predicate_p
+ then
+ printf " /* Skip verify of ${function}, has predicate */\n"
+ # FIXME: See do_read for potential simplification
+ elif [ -n "${invalid_p}" -a -n "${postdefault}" ]
+ then
+ printf " if (${invalid_p})\n"
+ printf " gdbarch->${function} = ${postdefault};\n"
+ elif [ -n "${predefault}" -a -n "${postdefault}" ]
+ then
+ printf " if (gdbarch->${function} == ${predefault})\n"
+ printf " gdbarch->${function} = ${postdefault};\n"
+ elif [ -n "${postdefault}" ]
+ then
+ printf " if (gdbarch->${function} == 0)\n"
+ printf " gdbarch->${function} = ${postdefault};\n"
+ elif [ -n "${invalid_p}" ]
+ then
+ printf " if ((GDB_MULTI_ARCH ${gt_level})\n"
+ printf " && (${invalid_p}))\n"
+ printf " fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
+ elif [ -n "${predefault}" ]
+ then
+ printf " if ((GDB_MULTI_ARCH ${gt_level})\n"
+ printf " && (gdbarch->${function} == ${predefault}))\n"
+ printf " fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
+ fi
+ fi
+done
+cat <<EOF
+ buf = ui_file_xstrdup (log, &dummy);
+ make_cleanup (xfree, buf);
+ if (strlen (buf) > 0)
+ internal_error (__FILE__, __LINE__,
+ "verify_gdbarch: the following are invalid ...%s",
+ buf);
+ do_cleanups (cleanups);
+}
+EOF
+
+# dump the structure
+printf "\n"
+printf "\n"
+cat <<EOF
+/* Print out the details of the current architecture. */
+
+/* NOTE/WARNING: The parameter is called \`\`current_gdbarch'' so that it
+ just happens to match the global variable \`\`current_gdbarch''. That
+ way macros refering to that variable get the local and not the global
+ version - ulgh. Once everything is parameterised with gdbarch, this
+ will go away. */
+
+void
+gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
+{
+ fprintf_unfiltered (file,
+ "gdbarch_dump: GDB_MULTI_ARCH = %d\\n",
+ GDB_MULTI_ARCH);
+EOF
+function_list | sort -t: +2 | while do_read
+do
+ # multiarch functions don't have macros.
+ if class_is_multiarch_p
+ then
+ printf " if (GDB_MULTI_ARCH)\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
+ printf " (long) current_gdbarch->${function});\n"
+ continue
+ fi
+ # Print the macro definition.
+ printf "#ifdef ${macro}\n"
+ if [ "x${returntype}" = "xvoid" ]
+ then
+ printf "#if GDB_MULTI_ARCH\n"
+ printf " /* Macro might contain \`[{}]' when not multi-arch */\n"
+ fi
+ if class_is_function_p
+ then
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: %%s # %%s\\\\n\",\n"
+ printf " \"${macro}(${actual})\",\n"
+ printf " XSTRING (${macro} (${actual})));\n"
+ else
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
+ printf " XSTRING (${macro}));\n"
+ fi
+ # Print the architecture vector value
+ if [ "x${returntype}" = "xvoid" ]
+ then
+ printf "#endif\n"
+ fi
+ if [ "x${print_p}" = "x()" ]
+ then
+ printf " gdbarch_dump_${function} (current_gdbarch);\n"
+ elif [ "x${print_p}" = "x0" ]
+ then
+ printf " /* skip print of ${macro}, print_p == 0. */\n"
+ elif [ -n "${print_p}" ]
+ then
+ printf " if (${print_p})\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
+ printf " ${print});\n"
+ elif class_is_function_p
+ then
+ printf " if (GDB_MULTI_ARCH)\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro} = 0x%%08lx\\\\n\",\n"
+ printf " (long) current_gdbarch->${function}\n"
+ printf " /*${macro} ()*/);\n"
+ else
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
+ printf " ${print});\n"
+ fi
+ printf "#endif\n"
+done
+cat <<EOF
+ if (current_gdbarch->dump_tdep != NULL)
+ current_gdbarch->dump_tdep (current_gdbarch, file);
+}
+EOF
+
+
+# GET/SET
+printf "\n"
+cat <<EOF
+struct gdbarch_tdep *
+gdbarch_tdep (struct gdbarch *gdbarch)
+{
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\\n");
+ return gdbarch->tdep;
+}
+EOF
+printf "\n"
+function_list | while do_read
+do
+ if class_is_predicate_p
+ then
+ printf "\n"
+ printf "int\n"
+ printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n"
+ printf "{\n"
+ if [ -n "${valid_p}" ]
+ then
+ printf " return ${valid_p};\n"
+ else
+ printf "#error \"gdbarch_${function}_p: not defined\"\n"
+ fi
+ printf "}\n"
+ fi
+ if class_is_function_p
+ then
+ printf "\n"
+ printf "${returntype}\n"
+ if [ "x${formal}" = "xvoid" ]
+ then
+ printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
+ else
+ printf "gdbarch_${function} (struct gdbarch *gdbarch, ${formal})\n"
+ fi
+ printf "{\n"
+ printf " if (gdbarch->${function} == 0)\n"
+ printf " internal_error (__FILE__, __LINE__,\n"
+ printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ printf " if (gdbarch_debug >= 2)\n"
+ printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
+ if [ "x${actual}" = "x-" -o "x${actual}" = "x" ]
+ then
+ if class_is_multiarch_p
+ then
+ params="gdbarch"
+ else
+ params=""
+ fi
+ else
+ if class_is_multiarch_p
+ then
+ params="gdbarch, ${actual}"
+ else
+ params="${actual}"
+ fi
+ fi
+ if [ "x${returntype}" = "xvoid" ]
+ then
+ printf " gdbarch->${function} (${params});\n"
+ else
+ printf " return gdbarch->${function} (${params});\n"
+ fi
+ printf "}\n"
+ printf "\n"
+ printf "void\n"
+ printf "set_gdbarch_${function} (struct gdbarch *gdbarch,\n"
+ printf " `echo ${function} | sed -e 's/./ /g'` gdbarch_${function}_ftype ${function})\n"
+ printf "{\n"
+ printf " gdbarch->${function} = ${function};\n"
+ printf "}\n"
+ elif class_is_variable_p
+ then
+ printf "\n"
+ printf "${returntype}\n"
+ printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
+ printf "{\n"
+ if [ "x${invalid_p}" = "x0" ]
+ then
+ printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
+ elif [ -n "${invalid_p}" ]
+ then
+ printf " if (${invalid_p})\n"
+ printf " internal_error (__FILE__, __LINE__,\n"
+ printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ elif [ -n "${predefault}" ]
+ then
+ printf " if (gdbarch->${function} == ${predefault})\n"
+ printf " internal_error (__FILE__, __LINE__,\n"
+ printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ fi
+ printf " if (gdbarch_debug >= 2)\n"
+ printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
+ printf " return gdbarch->${function};\n"
+ printf "}\n"
+ printf "\n"
+ printf "void\n"
+ printf "set_gdbarch_${function} (struct gdbarch *gdbarch,\n"
+ printf " `echo ${function} | sed -e 's/./ /g'` ${returntype} ${function})\n"
+ printf "{\n"
+ printf " gdbarch->${function} = ${function};\n"
+ printf "}\n"
+ elif class_is_info_p
+ then
+ printf "\n"
+ printf "${returntype}\n"
+ printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
+ printf "{\n"
+ printf " if (gdbarch_debug >= 2)\n"
+ printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
+ printf " return gdbarch->${function};\n"
+ printf "}\n"
+ fi
+done
+
+# All the trailing guff
+cat <<EOF
+
+
+/* Keep a registry of per-architecture data-pointers required by GDB
+ modules. */
+
+struct gdbarch_data
+{
+ unsigned index;
+ gdbarch_data_init_ftype *init;
+ gdbarch_data_free_ftype *free;
+};
+
+struct gdbarch_data_registration
+{
+ struct gdbarch_data *data;
+ struct gdbarch_data_registration *next;
+};
+
+struct gdbarch_data_registry
+{
+ unsigned nr;
+ struct gdbarch_data_registration *registrations;
+};
+
+struct gdbarch_data_registry gdbarch_data_registry =
+{
+ 0, NULL,
+};
+
+struct gdbarch_data *
+register_gdbarch_data (gdbarch_data_init_ftype *init,
+ gdbarch_data_free_ftype *free)
+{
+ struct gdbarch_data_registration **curr;
+ for (curr = &gdbarch_data_registry.registrations;
+ (*curr) != NULL;
+ curr = &(*curr)->next);
+ (*curr) = XMALLOC (struct gdbarch_data_registration);
+ (*curr)->next = NULL;
+ (*curr)->data = XMALLOC (struct gdbarch_data);
+ (*curr)->data->index = gdbarch_data_registry.nr++;
+ (*curr)->data->init = init;
+ (*curr)->data->free = free;
+ return (*curr)->data;
+}
+
+
+/* Walk through all the registered users initializing each in turn. */
+
+static void
+init_gdbarch_data (struct gdbarch *gdbarch)
+{
+ struct gdbarch_data_registration *rego;
+ for (rego = gdbarch_data_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
+ {
+ struct gdbarch_data *data = rego->data;
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->init != NULL)
+ {
+ void *pointer = data->init (gdbarch);
+ set_gdbarch_data (gdbarch, data, pointer);
+ }
+ }
+}
+
+/* Create/delete the gdbarch data vector. */
+
+static void
+alloc_gdbarch_data (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch->data == NULL);
+ gdbarch->nr_data = gdbarch_data_registry.nr;
+ gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*));
+}
+
+static void
+free_gdbarch_data (struct gdbarch *gdbarch)
+{
+ struct gdbarch_data_registration *rego;
+ gdb_assert (gdbarch->data != NULL);
+ for (rego = gdbarch_data_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
+ {
+ struct gdbarch_data *data = rego->data;
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->free != NULL && gdbarch->data[data->index] != NULL)
+ {
+ data->free (gdbarch, gdbarch->data[data->index]);
+ gdbarch->data[data->index] = NULL;
+ }
+ }
+ xfree (gdbarch->data);
+ gdbarch->data = NULL;
+}
+
+
+/* Initialize the current value of thee specified per-architecture
+ data-pointer. */
+
+void
+set_gdbarch_data (struct gdbarch *gdbarch,
+ struct gdbarch_data *data,
+ void *pointer)
+{
+ gdb_assert (data->index < gdbarch->nr_data);
+ if (data->free != NULL && gdbarch->data[data->index] != NULL)
+ data->free (gdbarch, gdbarch->data[data->index]);
+ gdbarch->data[data->index] = pointer;
+}
+
+/* Return the current value of the specified per-architecture
+ data-pointer. */
+
+void *
+gdbarch_data (struct gdbarch_data *data)
+{
+ gdb_assert (data->index < current_gdbarch->nr_data);
+ return current_gdbarch->data[data->index];
+}
+
+
+
+/* Keep a registry of swapped data required by GDB modules. */
+
+struct gdbarch_swap
+{
+ void *swap;
+ struct gdbarch_swap_registration *source;
+ struct gdbarch_swap *next;
+};
+
+struct gdbarch_swap_registration
+{
+ void *data;
+ unsigned long sizeof_data;
+ gdbarch_swap_ftype *init;
+ struct gdbarch_swap_registration *next;
+};
+
+struct gdbarch_swap_registry
+{
+ int nr;
+ struct gdbarch_swap_registration *registrations;
+};
+
+struct gdbarch_swap_registry gdbarch_swap_registry =
+{
+ 0, NULL,
+};
+
+void
+register_gdbarch_swap (void *data,
+ unsigned long sizeof_data,
+ gdbarch_swap_ftype *init)
+{
+ struct gdbarch_swap_registration **rego;
+ for (rego = &gdbarch_swap_registry.registrations;
+ (*rego) != NULL;
+ rego = &(*rego)->next);
+ (*rego) = XMALLOC (struct gdbarch_swap_registration);
+ (*rego)->next = NULL;
+ (*rego)->init = init;
+ (*rego)->data = data;
+ (*rego)->sizeof_data = sizeof_data;
+}
+
+
+static void
+init_gdbarch_swap (struct gdbarch *gdbarch)
+{
+ struct gdbarch_swap_registration *rego;
+ struct gdbarch_swap **curr = &gdbarch->swap;
+ for (rego = gdbarch_swap_registry.registrations;
+ rego != NULL;
+ rego = rego->next)
+ {
+ if (rego->data != NULL)
+ {
+ (*curr) = XMALLOC (struct gdbarch_swap);
+ (*curr)->source = rego;
+ (*curr)->swap = xmalloc (rego->sizeof_data);
+ (*curr)->next = NULL;
+ memset (rego->data, 0, rego->sizeof_data);
+ curr = &(*curr)->next;
+ }
+ if (rego->init != NULL)
+ rego->init ();
+ }
+}
+
+static void
+swapout_gdbarch_swap (struct gdbarch *gdbarch)
+{
+ struct gdbarch_swap *curr;
+ for (curr = gdbarch->swap;
+ curr != NULL;
+ curr = curr->next)
+ memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
+}
+
+static void
+swapin_gdbarch_swap (struct gdbarch *gdbarch)
+{
+ struct gdbarch_swap *curr;
+ for (curr = gdbarch->swap;
+ curr != NULL;
+ curr = curr->next)
+ memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
+}
+
+
+/* Keep a registry of the architectures known by GDB. */
+
+struct gdbarch_registration
+{
+ enum bfd_architecture bfd_architecture;
+ gdbarch_init_ftype *init;
+ gdbarch_dump_tdep_ftype *dump_tdep;
+ struct gdbarch_list *arches;
+ struct gdbarch_registration *next;
+};
+
+static struct gdbarch_registration *gdbarch_registry = NULL;
+
+static void
+append_name (const char ***buf, int *nr, const char *name)
+{
+ *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
+ (*buf)[*nr] = name;
+ *nr += 1;
+}
+
+const char **
+gdbarch_printable_names (void)
+{
+ if (GDB_MULTI_ARCH)
+ {
+ /* Accumulate a list of names based on the registed list of
+ architectures. */
+ enum bfd_architecture a;
+ int nr_arches = 0;
+ const char **arches = NULL;
+ struct gdbarch_registration *rego;
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
+ {
+ const struct bfd_arch_info *ap;
+ ap = bfd_lookup_arch (rego->bfd_architecture, 0);
+ if (ap == NULL)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch_architecture_names: multi-arch unknown");
+ do
+ {
+ append_name (&arches, &nr_arches, ap->printable_name);
+ ap = ap->next;
+ }
+ while (ap != NULL);
+ }
+ append_name (&arches, &nr_arches, NULL);
+ return arches;
+ }
+ else
+ /* Just return all the architectures that BFD knows. Assume that
+ the legacy architecture framework supports them. */
+ return bfd_arch_list ();
+}
+
+
+void
+gdbarch_register (enum bfd_architecture bfd_architecture,
+ gdbarch_init_ftype *init,
+ gdbarch_dump_tdep_ftype *dump_tdep)
+{
+ struct gdbarch_registration **curr;
+ const struct bfd_arch_info *bfd_arch_info;
+ /* Check that BFD recognizes this architecture */
+ bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
+ if (bfd_arch_info == NULL)
+ {
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: Attempt to register unknown architecture (%d)",
+ bfd_architecture);
+ }
+ /* Check that we haven't seen this architecture before */
+ for (curr = &gdbarch_registry;
+ (*curr) != NULL;
+ curr = &(*curr)->next)
+ {
+ if (bfd_architecture == (*curr)->bfd_architecture)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: Duplicate registraration of architecture (%s)",
+ bfd_arch_info->printable_name);
+ }
+ /* log it */
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
+ bfd_arch_info->printable_name,
+ (long) init);
+ /* Append it */
+ (*curr) = XMALLOC (struct gdbarch_registration);
+ (*curr)->bfd_architecture = bfd_architecture;
+ (*curr)->init = init;
+ (*curr)->dump_tdep = dump_tdep;
+ (*curr)->arches = NULL;
+ (*curr)->next = NULL;
+ /* When non- multi-arch, install whatever target dump routine we've
+ been provided - hopefully that routine has been written correctly
+ and works regardless of multi-arch. */
+ if (!GDB_MULTI_ARCH && dump_tdep != NULL
+ && startup_gdbarch.dump_tdep == NULL)
+ startup_gdbarch.dump_tdep = dump_tdep;
+}
+
+void
+register_gdbarch_init (enum bfd_architecture bfd_architecture,
+ gdbarch_init_ftype *init)
+{
+ gdbarch_register (bfd_architecture, init, NULL);
+}
+
+
+/* Look for an architecture using gdbarch_info. Base search on only
+ BFD_ARCH_INFO and BYTE_ORDER. */
+
+struct gdbarch_list *
+gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
+ const struct gdbarch_info *info)
+{
+ for (; arches != NULL; arches = arches->next)
+ {
+ if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
+ continue;
+ if (info->byte_order != arches->gdbarch->byte_order)
+ continue;
+ return arches;
+ }
+ return NULL;
+}
+
+
+/* Update the current architecture. Return ZERO if the update request
+ failed. */
+
+int
+gdbarch_update_p (struct gdbarch_info info)
+{
+ struct gdbarch *new_gdbarch;
+ struct gdbarch_list **list;
+ struct gdbarch_registration *rego;
+
+ /* Fill in missing parts of the INFO struct using a number of
+ sources: \`\`set ...''; INFOabfd supplied; existing target. */
+
+ /* \`\`(gdb) set architecture ...'' */
+ if (info.bfd_arch_info == NULL
+ && !TARGET_ARCHITECTURE_AUTO)
+ info.bfd_arch_info = TARGET_ARCHITECTURE;
+ if (info.bfd_arch_info == NULL
+ && info.abfd != NULL
+ && bfd_get_arch (info.abfd) != bfd_arch_unknown
+ && bfd_get_arch (info.abfd) != bfd_arch_obscure)
+ info.bfd_arch_info = bfd_get_arch_info (info.abfd);
+ if (info.bfd_arch_info == NULL)
+ info.bfd_arch_info = TARGET_ARCHITECTURE;
+
+ /* \`\`(gdb) set byte-order ...'' */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN
+ && !TARGET_BYTE_ORDER_AUTO)
+ info.byte_order = TARGET_BYTE_ORDER;
+ /* From the INFO struct. */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN
+ && info.abfd != NULL)
+ info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
+ : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
+ : BFD_ENDIAN_UNKNOWN);
+ /* From the current target. */
+ if (info.byte_order == BFD_ENDIAN_UNKNOWN)
+ info.byte_order = TARGET_BYTE_ORDER;
+
+ /* Must have found some sort of architecture. */
+ gdb_assert (info.bfd_arch_info != NULL);
+
+ if (gdbarch_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.bfd_arch_info %s\n",
+ (info.bfd_arch_info != NULL
+ ? info.bfd_arch_info->printable_name
+ : "(null)"));
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.byte_order %d (%s)\n",
+ info.byte_order,
+ (info.byte_order == BFD_ENDIAN_BIG ? "big"
+ : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
+ : "default"));
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.abfd 0x%lx\n",
+ (long) info.abfd);
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: info.tdep_info 0x%lx\n",
+ (long) info.tdep_info);
+ }
+
+ /* Find the target that knows about this architecture. */
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
+ if (rego->bfd_architecture == info.bfd_arch_info->arch)
+ break;
+ if (rego == NULL)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\\n");
+ return 0;
+ }
+
+ /* Ask the target for a replacement architecture. */
+ new_gdbarch = rego->init (info, rego->arches);
+
+ /* Did the target like it? No. Reject the change. */
+ if (new_gdbarch == NULL)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\\n");
+ return 0;
+ }
+
+ /* Did the architecture change? No. Do nothing. */
+ if (current_gdbarch == new_gdbarch)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ return 1;
+ }
+
+ /* Swap all data belonging to the old target out */
+ swapout_gdbarch_swap (current_gdbarch);
+
+ /* Is this a pre-existing architecture? Yes. Swap it in. */
+ for (list = &rego->arches;
+ (*list) != NULL;
+ list = &(*list)->next)
+ {
+ if ((*list)->gdbarch == new_gdbarch)
+ {
+ if (gdbarch_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: Previous architecture 0x%08lx (%s) selected\\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ current_gdbarch = new_gdbarch;
+ swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
+ return 1;
+ }
+ }
+
+ /* Append this new architecture to this targets list. */
+ (*list) = XMALLOC (struct gdbarch_list);
+ (*list)->next = NULL;
+ (*list)->gdbarch = new_gdbarch;
+
+ /* Switch to this new architecture. Dump it out. */
+ current_gdbarch = new_gdbarch;
+ if (gdbarch_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "gdbarch_update: New architecture 0x%08lx (%s) selected\\n",
+ (long) new_gdbarch,
+ new_gdbarch->bfd_arch_info->printable_name);
+ }
+
+ /* Check that the newly installed architecture is valid. Plug in
+ any post init values. */
+ new_gdbarch->dump_tdep = rego->dump_tdep;
+ verify_gdbarch (new_gdbarch);
+
+ /* Initialize the per-architecture memory (swap) areas.
+ 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);
+ architecture_changed_event ();
+
+ if (gdbarch_debug)
+ gdbarch_dump (current_gdbarch, gdb_stdlog);
+
+ return 1;
+}
+
+
+/* Disassembler */
+
+/* Pointer to the target-dependent disassembly function. */
+int (*tm_print_insn) (bfd_vma, disassemble_info *);
+disassemble_info tm_print_insn_info;
+
+
+extern void _initialize_gdbarch (void);
+
+void
+_initialize_gdbarch (void)
+{
+ struct cmd_list_element *c;
+
+ 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;
+ tm_print_insn_info.print_address_func = dis_asm_print_address;
+
+ add_show_from_set (add_set_cmd ("arch",
+ class_maintenance,
+ var_zinteger,
+ (char *)&gdbarch_debug,
+ "Set architecture debugging.\\n\\
+When non-zero, architecture debugging is enabled.", &setdebuglist),
+ &showdebuglist);
+ c = add_set_cmd ("archdebug",
+ class_maintenance,
+ var_zinteger,
+ (char *)&gdbarch_debug,
+ "Set architecture debugging.\\n\\
+When non-zero, architecture debugging is enabled.", &setlist);
+
+ deprecate_cmd (c, "set debug arch");
+ deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
+}
+EOF
+
+# close things off
+exec 1>&2
+#../move-if-change new-gdbarch.c gdbarch.c
+compare_new gdbarch.c
diff --git a/contrib/gdb/gdb/gdbcmd.h b/contrib/gdb/gdb/gdbcmd.h
index 65b3b7a..8c4490e 100644
--- a/contrib/gdb/gdb/gdbcmd.h
+++ b/contrib/gdb/gdb/gdbcmd.h
@@ -1,24 +1,34 @@
+/* ***DEPRECATED*** The gdblib files must not be calling/using things in any
+ of the possible command languages. If necessary, a hook (that may be
+ present or not) must be used and set to the appropriate routine by any
+ command language that cares about it. If you are having to include this
+ file you are possibly doing things the old way. This file will disapear.
+ fnasser@redhat.com */
+
/* Header file for GDB-specific command-line stuff.
- Copyright 1986, 1989, 1990, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999,
+ 2000, 2002 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
#include "command.h"
+#include "ui-out.h"
/* Chain containing all defined commands. */
@@ -92,23 +102,21 @@ extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
-extern struct cmd_list_element *setchecklist;
-
-extern struct cmd_list_element *showchecklist;
+extern struct cmd_list_element *setdebuglist;
-extern void
-execute_user_command PARAMS ((struct cmd_list_element *, char *));
+extern struct cmd_list_element *showdebuglist;
-extern void
-execute_command PARAMS ((char *, int));
+extern struct cmd_list_element *setchecklist;
-enum command_control_type
-execute_control_command PARAMS ((struct command_line *));
+extern struct cmd_list_element *showchecklist;
-void print_command_line PARAMS ((struct command_line *, unsigned int));
+extern void execute_command (char *, int);
-extern char **noop_completer PARAMS ((char *, char *));
+enum command_control_type execute_control_command (struct command_line *);
-extern char **filename_completer PARAMS ((char *, char *));
+extern void print_command_line (struct command_line *, unsigned int,
+ struct ui_file *);
+extern void print_command_lines (struct ui_out *,
+ struct command_line *, unsigned int);
-#endif /* !defined (GDBCMD_H) */
+#endif /* !defined (GDBCMD_H) */
diff --git a/contrib/gdb/gdb/gdbcore.h b/contrib/gdb/gdb/gdbcore.h
index 6501e30..8859455 100644
--- a/contrib/gdb/gdb/gdbcore.h
+++ b/contrib/gdb/gdb/gdbcore.h
@@ -1,21 +1,23 @@
/* Machine independent variables that describe the core file under GDB.
- Copyright 1986, 1987, 1989, 1990, 1992, 1995 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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. */
@@ -28,67 +30,72 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
ERR nonzero means get error if there is none specified;
otherwise return 0 in that case. */
-extern char *get_exec_file PARAMS ((int err));
+extern char *get_exec_file (int err);
/* Nonzero if there is a core file. */
-extern int have_core_file_p PARAMS ((void));
+extern int have_core_file_p (void);
/* Read "memory data" from whatever target or inferior we have.
Returns zero if successful, errno value if not. EIO is used for
address out of bounds. If breakpoints are inserted, returns shadow
contents, not the breakpoints themselves. From breakpoint.c. */
-extern int read_memory_nobpt PARAMS ((CORE_ADDR memaddr, char *myaddr,
- unsigned len));
+extern int read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len);
/* Report a memory error with error(). */
-extern void memory_error PARAMS ((int status, CORE_ADDR memaddr));
+extern void memory_error (int status, CORE_ADDR memaddr);
/* Like target_read_memory, but report an error if can't read. */
-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));
+extern void read_memory (CORE_ADDR memaddr, char *myaddr, int len);
/* Read an integer from debugged memory, given address and number of
bytes. */
-extern LONGEST read_memory_integer PARAMS ((CORE_ADDR memaddr, int len));
+extern LONGEST read_memory_integer (CORE_ADDR memaddr, int len);
+extern int safe_read_memory_integer (CORE_ADDR memaddr, int len, LONGEST *return_value);
/* Read an unsigned integer from debugged memory, given address and
number of bytes. */
-extern ULONGEST read_memory_unsigned_integer PARAMS ((CORE_ADDR memaddr, int len));
+extern ULONGEST read_memory_unsigned_integer (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 */
-extern void read_memory_string PARAMS ((CORE_ADDR, char *, int));
+ * a buffer into which to place the string, and the maximum available space */
+extern void read_memory_string (CORE_ADDR, char *, int);
/* This takes a char *, not void *. This is probably right, because
passing in an int * or whatever is wrong with respect to
byteswapping, alignment, different sizes for host vs. target types,
etc. */
-extern void write_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+extern void write_memory (CORE_ADDR memaddr, char *myaddr, int len);
+
+/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
+extern void write_memory_unsigned_integer (CORE_ADDR addr, int len,
+ ULONGEST value);
-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));
+/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
+extern void write_memory_signed_integer (CORE_ADDR addr, int len,
+ LONGEST value);
+
+extern void generic_search (int len, char *data, char *mask,
+ CORE_ADDR startaddr, int increment,
+ CORE_ADDR lorange, CORE_ADDR hirange,
+ CORE_ADDR * addr_found, char *data_found);
/* Hook for `exec_file_command' command to call. */
-extern void (*exec_file_display_hook) PARAMS ((char *filename));
+extern void (*exec_file_display_hook) (char *filename);
/* Hook for "file_command", which is more useful than above
(because it is invoked AFTER symbols are read, not before) */
-extern void (*file_changed_hook) PARAMS ((char *filename));
+extern void (*file_changed_hook) (char *filename);
-extern void specify_exec_file_hook PARAMS ((void (*hook) (char *filename)));
+extern void specify_exec_file_hook (void (*hook) (char *filename));
/* Binary File Diddlers for the exec and core files */
@@ -99,17 +106,17 @@ extern bfd *exec_bfd;
extern int write_files;
-extern void core_file_command PARAMS ((char *filename, int from_tty));
+extern void core_file_command (char *filename, int from_tty);
-extern void exec_file_attach PARAMS ((char *filename, int from_tty));
+extern void exec_open (char *filename, int from_tty);
-extern void exec_file_command PARAMS ((char *filename, int from_tty));
+extern void exec_file_attach (char *filename, int from_tty);
-extern void validate_files PARAMS ((void));
+extern void exec_file_clear (int from_tty);
-extern CORE_ADDR register_addr PARAMS ((int regno, CORE_ADDR blockend));
+extern void validate_files (void);
-extern void registers_fetched PARAMS ((void));
+extern CORE_ADDR register_addr (int regno, CORE_ADDR blockend);
#if !defined (KERNEL_U_ADDR)
extern CORE_ADDR kernel_u_addr;
@@ -124,46 +131,71 @@ extern struct target_ops core_ops;
extern char *gnutarget;
-extern void set_gnutarget PARAMS ((char *));
+extern void set_gnutarget (char *);
/* Structure to keep track of core register reading functions for
various core file types. */
-struct core_fns {
+struct core_fns
+ {
+
+ /* BFD flavour that a core file handler is prepared to read. This
+ can be used by the handler's core tasting function as a first
+ level filter to reject BFD's that don't have the right
+ flavour. */
+
+ enum bfd_flavour core_flavour;
+
+ /* Core file handler function to call to recognize corefile
+ formats that BFD rejects. Some core file format just don't fit
+ into the BFD model, or may require other resources to identify
+ them, that simply aren't available to BFD (such as symbols from
+ another file). Returns nonzero if the handler recognizes the
+ format, zero otherwise. */
+
+ int (*check_format) (bfd *);
- /* 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. */
+ /* Core file handler function to call to ask if it can handle a
+ given core file format or not. Returns zero if it can't,
+ nonzero otherwise. */
- enum bfd_flavour core_flavour;
+ int (*core_sniffer) (struct core_fns *, bfd *);
- /* 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 --- integer registers
+ 2 --- floating-point registers, on machines where they are
+ discontiguous
+ 3 --- extended floating-point registers, on machines where
+ these are present in yet a third area. (GNU/Linux uses
+ this to get at the SSE registers.)
- 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) (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 (struct core_fns *cf);
+extern int default_core_sniffer (struct core_fns *cf, bfd * abfd);
+extern int default_check_format (bfd * abfd);
-#endif /* !defined (GDBCORE_H) */
+#endif /* !defined (GDBCORE_H) */
diff --git a/contrib/gdb/gdb/gdbinit.in b/contrib/gdb/gdb/gdbinit.in
index af97d2c..b6a32db 100644
--- a/contrib/gdb/gdb/gdbinit.in
+++ b/contrib/gdb/gdb/gdbinit.in
@@ -2,7 +2,7 @@ echo Setting up the environment for debugging gdb.\n
set complaints 1
-b fatal
+b internal_error
b info_command
commands
diff --git a/contrib/gdb/gdb/gdbserver/Makefile.in b/contrib/gdb/gdb/gdbserver/Makefile.in
index b016e13..c553d92 100644
--- a/contrib/gdb/gdb/gdbserver/Makefile.in
+++ b/contrib/gdb/gdb/gdbserver/Makefile.in
@@ -1,5 +1,5 @@
-#Copyright 1989, 90, 91, 92, 93, 94, 95, 96, 1997
-#Free Software Foundation, Inc.
+# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
# This file is part of GDB.
@@ -17,16 +17,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-prefix = /usr/local
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-program_transform_name =
-exec_prefix = $(prefix)
-bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib
+host_alias = @host_alias@
+target_alias = @target_alias@
+program_transform_name = @program_transform_name@
+bindir = @bindir@
+libdir = @libdir@
tooldir = $(libdir)/$(target_alias)
-datadir = $(prefix)/share
-mandir = $(prefix)/man
+datadir = @datadir@
+mandir = @mandir@
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
@@ -36,31 +38,22 @@ man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
-infodir = $(prefix)/info
-includedir = $(prefix)/include
+infodir = @infodir@
+htmldir = $(prefix)/html
+includedir = @includedir@
SHELL = /bin/sh
-INSTALL = `cd $(srcdir)/../..;pwd`/install-sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
-AR = ar
-AR_FLAGS = qv
-RANLIB = ranlib
-
-# If you are compiling with GCC, make sure that either 1) You use the
-# -traditional flag, or 2) You have the fixed include files where GCC
-# can reach them. Otherwise the ioctl calls in inflow.c
-# will be incorrectly compiled. The "fixincludes" script in the gcc
-# distribution will fix your include files up.
-#CC=cc
-#CC=gcc -traditional
-GCC=gcc
+CC = @CC@
# Directory containing source files. Don't clean up the spacing,
# this exact string is matched for by the "configure" script.
-srcdir = .
+srcdir = @srcdir@
+VPATH = @srcdir@
# It is also possible that you will need to add -I/usr/include/sys to the
# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
@@ -88,9 +81,9 @@ READLINE_DEP = $$(READLINE_DIR)
# All the includes used for CFLAGS and for lint.
# -I. for config files.
-# -I${srcdir} possibly for regex.h also.
-# -I${srcdir}/config for more generic config files.
-INCLUDE_CFLAGS = -I. -I${srcdir} -I${srcdir}/.. -I${srcdir}/../config -I$(INCLUDE_DIR)
+# -I${srcdir} for our headers.
+# -I$(srcdir)/../regformats for regdef.h.
+INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)
# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
# from the config/ directory.
@@ -99,10 +92,11 @@ GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
# CFLAGS is specifically reserved for setting from the command line
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
-CFLAGS = -g
+CFLAGS = @CFLAGS@
+
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS = ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} \
- ${BFD_CFLAGS} ${INCLUDE_CFLAGS}
+ ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@@ -114,22 +108,19 @@ DIST=gdb
LINT=/usr/5bin/lint
LINTFLAGS= $(BFD_CFLAGS)
-# Host and target-dependent makefile fragments come in here.
-####
-# End of host and target-dependent makefile fragments
-
# All source files that go into linking GDB remote server.
-SFILES = $(srcdir)/low-lynx.c $(srcdir)/low-sparc.c $(srcdir)/low-sun3.c \
- $(srcdir)/low-hppabsd.c \
- $(srcdir)/utils.c $(srcdir)/server.c $(srcdir)/remote-utils.c
+SFILES = $(srcdir)/low-hppabsd.c $(srcdir)/low-linux.c $(srcdir)/low-lynx.c \
+ $(srcdir)/low-nbsd.c $(srcdir)/low-sim.c $(srcdir)/low-sparc.c \
+ $(srcdir)/low-sun3.c $(srcdir)/utils.c $(srcdir)/server.c \
+ $(srcdir)/remote-utils.c
-DEPFILES = $(GDBSERVER_DEPFILES)
+DEPFILES = @GDBSERVER_DEPFILES@
-SOURCES = $(SFILES) $(ALLDEPFILES)
+SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
-OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o
+OBS = utils.o $(DEPFILES) server.o remote-utils.o regcache.o signals.o
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
@@ -159,6 +150,8 @@ installcheck:
check:
info dvi:
install-info:
+html:
+install-html:
clean-info:
gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS}
@@ -171,10 +164,6 @@ gdbreplay: gdbreplay.o
${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \
$(XM_CLIBS)
-config.status:
- @echo "You must configure gdbserver. Look at the README file for details."
- @false
-
# Put the proper machine-specific files first, so M-. on a machine
# specific routine gets the one for the correct machine.
# The xyzzy stuff below deals with empty DEPFILES
@@ -192,7 +181,9 @@ tags: TAGS
clean:
rm -f *.o ${ADD_FILES} *~
- rm -f gdbserver core make.log
+ rm -f gdbserver gdbreplay core make.log
+ rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m68k.c reg-mips.c
+ rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c
distclean: clean
rm -f nm.h tm.h xm.h config.status
@@ -204,9 +195,12 @@ maintainer-clean realclean: clean
STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
+Makefile: Makefile.in config.status
$(SHELL) ./config.status
+config.status: configure configure.srv
+ $(SHELL) ./config.status --recheck
+
force:
version.c: Makefile
@@ -228,14 +222,73 @@ MAKEOVERRIDES=
## with no dependencies and no actions.
unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
-server.o : ${srcdir}/server.c ${srcdir}/server.h
-remote-utils.o : ${srcdir}/remote-utils.c ${srcdir}/server.h
-low-linux.o : ${srcdir}/low-linux.c ${srcdir}/server.h
-low-lynx.o : ${srcdir}/low-lynx.c ${srcdir}/server.h
-low-sim.o : ${srcdir}/low-sim.c ${srcdir}/server.h
-low-sparc.o : $(srcdir)/low-sparc.c $(srcdir)/server.h
-low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h
-low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h
-utils.o : ${srcdir}/utils.c ${srcdir}/server.h
+regdat_sh = $(srcdir)/../regformats/regdat.sh
+regdef_h = $(srcdir)/../regformats/regdef.h
+regcache_h = $(srcdir)/regcache.h
+server_h = $(srcdir)/server.h $(regcache_h) config.h
+
+server.o: server.c $(server_h)
+remote-utils.o: remote-utils.c terminal.h $(server_h)
+utils.o: utils.c $(server_h)
+regcache.o: regcache.c $(server_h) $(regdef_h)
+
+signals.o: ../signals/signals.c $(server_h)
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+
+i387-fp.o: i387-fp.c $(server_h)
+
+linux_low_h = $(srcdir)/linux-low.h
+
+linux-low.o: linux-low.c $(linux_low_h) $(server_h)
+linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
+linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
+linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h)
+linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h)
+linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h)
+linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h)
+linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h)
+linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h)
+
+# OBSOLETE TARGETS
+# OBSOLETE # low-lynx.o : ${srcdir}/low-lynx.c ${srcdir}/server.h
+# OBSOLETE # low-nbsd.o : ${srcdir}/low-nbsd.c ${srcdir}/server.h
+# OBSOLETE # low-sim.o : ${srcdir}/low-sim.c ${srcdir}/server.h
+# OBSOLETE # low-sparc.o : $(srcdir)/low-sparc.c $(srcdir)/server.h
+# OBSOLETE # low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h
+# OBSOLETE # low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h
+
+reg-arm.o : reg-arm.c $(regdef_h)
+reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c
+reg-i386.o : reg-i386.c $(regdef_h)
+reg-i386.c : $(srcdir)/../regformats/reg-i386.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-i386.dat reg-i386.c
+reg-i386-linux.o : reg-i386-linux.c $(regdef_h)
+reg-i386-linux.c : $(srcdir)/../regformats/reg-i386-linux.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-i386-linux.dat reg-i386-linux.c
+reg-ia64.o : reg-ia64.c $(regdef_h)
+reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c
+reg-m68k.o : reg-m68k.c $(regdef_h)
+reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
+reg-mips.o : reg-mips.c $(regdef_h)
+reg-mips.c : $(srcdir)/../regformats/reg-mips.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-mips.dat reg-mips.c
+reg-ppc.o : reg-ppc.c $(regdef_h)
+reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c
+reg-s390.o : reg-s390.c $(regdef_h)
+reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c
+reg-s390x.o : reg-s390x.c $(regdef_h)
+reg-s390x.c : $(srcdir)/../regformats/reg-s390x.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-s390x.dat reg-s390x.c
+reg-sh.o : reg-sh.c $(regdef_h)
+reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c
+reg-x86-64.o : reg-x86-64.c $(regdef_h)
+reg-x86-64.c : $(srcdir)/../regformats/reg-x86-64.dat $(regdat_sh)
+ sh $(regdat_sh) $(srcdir)/../regformats/reg-x86-64.dat reg-x86-64.c
# This is the end of "Makefile.in".
diff --git a/contrib/gdb/gdb/gdbserver/README b/contrib/gdb/gdb/gdbserver/README
index 2281bf6..71887ca 100644
--- a/contrib/gdb/gdb/gdbserver/README
+++ b/contrib/gdb/gdb/gdbserver/README
@@ -44,6 +44,14 @@ GDBs `target remote' command, which will be described shortly. Note that if
you chose a port number that conflicts with another service, gdbserver will
print an error message and exit.
+On some targets, gdbserver can also attach to running programs. This is
+accomplished via the --attach argument. The syntax is:
+
+ target> gdbserver COMM --attach PID
+
+PID is the process ID of a currently running process. It isn't necessary
+to point gdbserver at a binary for the running process.
+
Usage (host side):
You need an unstripped copy of the target program on your host system, since
@@ -67,7 +75,16 @@ TCP connections, you must start up gdbserver prior to using the `target remote'
command, otherwise you may get an error that looks something like
`Connection refused'.
-Building:
+Building gdbserver:
+
+The supported targets as of February 2002 are:
+ arm-*-linux-gnu
+ i386-*-linux-gnu
+ ia64-*-linux-gnu
+ m68k-*-linux-gnu
+ mips-*-linux-gnu
+ powerpc-*-linux-gnu
+ sh-*-linux-gnu
Configuring gdbserver you should specify the same machine for host and
target (which are the machine that gdbserver is going to run on. This
@@ -76,27 +93,21 @@ gdbserver automatically as part of building a whole tree of tools does
not currently work if cross-compilation is involved (we don't get the
right CC in the Makefile, to start with)).
-gdbserver should work on sparc-sun-sunos4* or Lynx. The following
-instructions pertain to Lynx. To build the server for Lynx, make a
-new copy of the distribution onto a disk that is NFS shared with the
-Lynx system. Lets say that's in a directory called xyzzy. Then,
-follow these steps under the host system:
-
- 1) cd xyzzy/gdb/gdbserver
- 2) ../../configure i386-none-lynx
-
-When that completes, do the following on the Lynx system:
-
- 3) cd xyzzy/gdb/gdbserver
- 4) make CC=gcc
+Building gdbserver for your target is very straightforward. If you build
+GDB natively on a target which gdbserver supports, it will be built
+automatically when you build GDB. You can also build just gdbserver:
-It should build with only a minor complaint about NULL being redefined. That's
-a LynxOS problem, and can be ignored.
+ % mkdir obj
+ % cd obj
+ % path-to-gdbserver-sources/configure
+ % make
-It's also possible that you may have a cross-compiler to Lynx. In that case,
-you can skip the stuff about NFS. You would replace steps 3 & 4 with:
+If you prefer to cross-compile to your target, then you can also build
+gdbserver that way. In a Bourne shell, for example:
- make CC=lynx-target-compiler...
+ % export CC=your-cross-compiler
+ % path-to-gdbserver-sources/configure your-target-name
+ % make
Using GDBreplay:
diff --git a/contrib/gdb/gdb/gdbserver/acconfig.h b/contrib/gdb/gdb/gdbserver/acconfig.h
new file mode 100644
index 0000000..968feb8
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/acconfig.h
@@ -0,0 +1,9 @@
+/* Define if the target supports PTRACE_PEEKUSR for register access. */
+#undef HAVE_LINUX_USRREGS
+
+/* Define if the target supports PTRACE_GETREGS for register access. */
+#undef HAVE_LINUX_REGSETS
+
+/* Define if the target supports PTRACE_GETFPXREGS for extended
+ register access. */
+#undef HAVE_PTRACE_GETFPXREGS
diff --git a/contrib/gdb/gdb/gdbserver/aclocal.m4 b/contrib/gdb/gdb/gdbserver/aclocal.m4
new file mode 100644
index 0000000..24b9ced
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/aclocal.m4
@@ -0,0 +1,100 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+
+# serial 1
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so. This macro tries various
+# options that select ANSI C on some system or another. It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN(AM_PROG_CC_STDC,
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT($am_cv_prog_cc_stdc)
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
+
diff --git a/contrib/gdb/gdb/gdbserver/config.in b/contrib/gdb/gdb/gdbserver/config.in
new file mode 100644
index 0000000..e77d5a7
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/config.in
@@ -0,0 +1,26 @@
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if the target supports PTRACE_PEEKUSR for register access. */
+#undef HAVE_LINUX_USRREGS
+
+/* Define if the target supports PTRACE_GETREGS for register access. */
+#undef HAVE_LINUX_REGSETS
+
+/* Define if the target supports PTRACE_GETFPXREGS for extended
+ register access. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define if you have the <sys/reg.h> header file. */
+#undef HAVE_SYS_REG_H
+
+/* Define if you have the <termio.h> header file. */
+#undef HAVE_TERMIO_H
+
+/* Define if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
diff --git a/contrib/gdb/gdb/gdbserver/configure b/contrib/gdb/gdb/gdbserver/configure
new file mode 100644
index 0000000..c08d5c2
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/configure
@@ -0,0 +1,1602 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=server.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:530: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:560: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:611: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:643: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 654 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:690: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:718: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:797: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:818: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:836: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:871: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:925: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 940 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 957 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 974 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1005: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1010 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1035 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1053 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1074 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+
+for ac_hdr in sgtty.h termio.h termios.h sys/reg.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1113: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1118 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+. ${srcdir}/configure.srv
+
+if test "${srv_linux_usrregs}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_USRREGS 1
+EOF
+
+fi
+
+if test "${srv_linux_regsets}" = "yes"; then
+ echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
+echo "configure:1161: checking for PTRACE_GETREGS" >&5
+ if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1166 "configure"
+#include "confdefs.h"
+#include <sys/ptrace.h>
+int main() {
+PTRACE_GETREGS;
+; return 0; }
+EOF
+if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdbsrv_cv_have_ptrace_getregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdbsrv_cv_have_ptrace_getregs=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdbsrv_cv_have_ptrace_getregs" 1>&6
+ if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_REGSETS 1
+EOF
+
+ fi
+
+ echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
+echo "configure:1194: checking for PTRACE_GETFPXREGS" >&5
+ if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1199 "configure"
+#include "confdefs.h"
+#include <sys/ptrace.h>
+int main() {
+PTRACE_GETFPXREGS;
+; return 0; }
+EOF
+if { (eval echo configure:1206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdbsrv_cv_have_ptrace_getfpxregs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdbsrv_cv_have_ptrace_getfpxregs=no
+fi
+rm -f conftest*
+fi
+
+ echo "$ac_t""$gdbsrv_cv_have_ptrace_getfpxregs" 1>&6
+ if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTRACE_GETFPXREGS 1
+EOF
+
+ fi
+fi
+
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@CPP@%$CPP%g
+s%@GDBSERVER_DEPFILES@%$GDBSERVER_DEPFILES%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h:config.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/contrib/gdb/gdb/gdbserver/configure.in b/contrib/gdb/gdb/gdbserver/configure.in
index 1bbb73c..744aac2 100644
--- a/contrib/gdb/gdb/gdbserver/configure.in
+++ b/contrib/gdb/gdb/gdbserver/configure.in
@@ -1,100 +1,69 @@
-srcname="Remote GDB server"
-srctrigger=server.c
-gdb_serial_driver=../ser-unix.c
+dnl Autoconf configure script for GDB server.
+dnl Copyright 2000, 2002 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GDB.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# per-host:
+dnl Process this file with autoconf to produce a configure script.
-. ${srcdir}/../configure.host
+AC_INIT(server.c)
+AC_CONFIG_HEADER(config.h:config.in)
-echo "gdbserver/configure.in: host is $host, target is $target"
+AC_PROG_CC
-if [ ! -f ${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh ]; then
- echo '***' "GDB remote does not support host ${host}" 1>&2
- exit 1
-fi
-
-# We really shouldn't depend on there being a space after XM_FILE= ...
-hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh`
+AC_CANONICAL_SYSTEM
-# per-target:
+AC_PROG_INSTALL
-. ${srcdir}/../configure.tgt
+AC_HEADER_STDC
-echo "gdbserver/configure.in: host_cpu is $host_cpu, target_cpu is $target_cpu"
+AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h)
-if [ ! -f ${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt ]; then
- echo '***' "GDB remote does not support target ${target}" 1>&2
- exit 1
-fi
+. ${srcdir}/configure.srv
-if [ -z "${removing}" ] ; then
- cat ${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh ${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt | awk '$1 == "#msg" {
- print substr($0,6)}'
+if test "${srv_linux_usrregs}" = "yes"; then
+ AC_DEFINE(HAVE_LINUX_USRREGS)
fi
-# We really shouldn't depend on there being a space after TM_FILE= ...
-targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt`
-
-if [ "${target}" = "${host}" ] ; then
- nativefile=`awk '$1 == "NAT_FILE=" { print $2 }' <${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh`
+if test "${srv_linux_regsets}" = "yes"; then
+ AC_MSG_CHECKING(for PTRACE_GETREGS)
+ AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
+ [AC_TRY_COMPILE([#include <sys/ptrace.h>],
+ [PTRACE_GETREGS;],
+ [gdbsrv_cv_have_ptrace_getregs=yes],
+ [gdbsrv_cv_have_ptrace_getregs=no])])
+ AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
+ if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
+ AC_DEFINE(HAVE_LINUX_REGSETS)
+ fi
+
+ AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
+ AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
+ [AC_TRY_COMPILE([#include <sys/ptrace.h>],
+ [PTRACE_GETFPXREGS;],
+ [gdbsrv_cv_have_ptrace_getfpxregs=yes],
+ [gdbsrv_cv_have_ptrace_getfpxregs=no])])
+ AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
+ if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
+ AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
+ fi
fi
-host_makefile_frag=../config/${gdb_host_cpu}/${gdb_host}.mh
-target_makefile_frag=../config/${gdb_target_cpu}/${gdb_target}.mt
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
-# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
-# (NAT_FILE) is not set in the ?config/* file, we don't make the
-# corresponding links. But we have to remove the xm.h files and tm.h
-# files anyway, e.g. when switching from "configure host" to
-# "configure none".
+AC_SUBST(GDBSERVER_DEPFILES)
-files=
-links=
-rm -f xm.h
-rm -f ser-hardwire.c
-if [ "${hostfile}" != "" ]; then
- if [ -f ${srcdir}/../config/${hostfile} ]; then
- files="${files} ../config/${hostfile}"
- else
- files="${files} ../config/${gdb_host_cpu}/${hostfile}"
- fi
- links="${links} xm.h"
-
-# files="${files} ${gdb_serial_driver}"
-# links="${links} ser-hardwire.c"
-fi
-rm -f tm.h
-if [ "${targetfile}" != "" ]; then
- if [ -f ${srcdir}/../config/${targetfile} ]; then
- files="${files} ../config/${targetfile}"
- else
- files="${files} ../config/${gdb_target_cpu}/${targetfile}"
- fi
- links="${links} tm.h"
-fi
-rm -f nm.h
-if [ "${nativefile}" != "" ]; then
- if [ -f ${srcdir}/../config/${nativefile} ]; then
- files="${files} ../config/${nativefile}"
- else
- files="${files} ../config/${gdb_host_cpu}/${nativefile}"
- fi
- links="${links} nm.h"
-# temporary scaffolding until all hosts have the host/target/native
-# split in place.
-else
- files="${files} ../config/nm-empty.h"
- links="${links} nm.h"
-fi
-
-if [ ${target_cpu} = "sparclite" ]; then
- configdirs="${configdirs} sparclite"
-fi
-
-# post-target:
-
-if [ "${nativefile}" = "" ] ; then
- sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
- < Makefile > Makefile.tem
- mv -f Makefile.tem Makefile
-fi
+AC_OUTPUT(Makefile)
diff --git a/contrib/gdb/gdb/gdbserver/configure.srv b/contrib/gdb/gdb/gdbserver/configure.srv
new file mode 100644
index 0000000..3268cd7
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/configure.srv
@@ -0,0 +1,65 @@
+# Mappings from configuration triplets to gdbserver build options.
+# This is invoked from the autoconf-generated configure script, to
+# produce the appropriate Makefile substitutions.
+
+# This file sets the following shell variables:
+# srv_regobj The register protocol appropriate for this target.
+# srv_tgtobj Any other target-specific modules appropriate
+# for this target.
+#
+# In addition, on GNU/Linux the following shell variables will be set:
+# srv_linux_regsets Set to "yes" if ptrace(PTRACE_GETREGS) and friends
+# may be available on this platform; unset otherwise.
+# They will only be used if <sys/ptrace.h> defines
+# PTRACE_GETREGS.
+# srv_linux_usrregs Set to "yes" if we can get at registers via
+# PTRACE_PEEKUSR / PTRACE_POKEUSR.
+
+# Input is taken from the "${target}" variable.
+
+case "${target}" in
+ arm*-*-linux*) srv_regobj=reg-arm.o
+ srv_tgtobj="linux-low.o linux-arm-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ i[3456]86-*-linux*) srv_regobj=reg-i386-linux.o
+ srv_tgtobj="linux-low.o linux-i386-low.o i387-fp.o"
+ srv_linux_usrregs=yes
+ srv_linux_regsets=yes
+ ;;
+ ia64-*-linux*) srv_regobj=reg-ia64.o
+ srv_tgtobj="linux-low.o linux-ia64-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ m68*-*-linux*) srv_regobj=reg-m68k.o
+ srv_tgtobj="linux-low.o linux-m68k-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ mips*-*-linux*) srv_regobj=reg-mips.o
+ srv_tgtobj="linux-low.o linux-mips-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ powerpc*-*-linux*) srv_regobj=reg-ppc.o
+ srv_tgtobj="linux-low.o linux-ppc-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ s390-*-linux*) srv_regobj=reg-s390.o
+ srv_tgtobj="linux-low.o linux-s390-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ s390x-*-linux*) srv_regobj=reg-s390x.o
+ srv_tgtobj="linux-low.o linux-s390-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ sh*-*-linux*) srv_regobj=reg-sh.o
+ srv_tgtobj="linux-low.o linux-sh-low.o"
+ srv_linux_usrregs=yes
+ ;;
+ x86_64-*-linux*) srv_regobj=reg-x86-64.o
+ srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o"
+ srv_linux_regsets=yes
+ ;;
+ *) echo "Error: target not supported by gdbserver."
+ exit 1
+ ;;
+esac
diff --git a/contrib/gdb/gdb/gdbserver/gdbserver.1 b/contrib/gdb/gdb/gdbserver/gdbserver.1
index 9d3fdcd..846634b 100644
--- a/contrib/gdb/gdb/gdbserver/gdbserver.1
+++ b/contrib/gdb/gdb/gdbserver/gdbserver.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1993 Free Software Foundation
+.\" Copyright 1993 Free Software Foundation, Inc.
.\" See section COPYING for conditions for redistribution
.TH gdbserver 1 "2 November 1993" "Cygnus Support" "GNU Development Tools"
.SH NAME
@@ -10,6 +10,11 @@ gdbserver \- Remote Server for the GNU Debugger
.RB tty
.RB prog
.RB "[\|" args... "\|]"
+.PP
+.B gdbserver
+.RB tty
+.B --attach
+.RB PID
.ad b
.SH DESCRIPTION
GDBSERVER is a program that allows you to run GDB on a different machine
@@ -50,6 +55,14 @@ GDBs `target remote' command, which will be described shortly. Note that if
you chose a port number that conflicts with another service, gdbserver will
print an error message and exit.
+On some targets, gdbserver can also attach to running programs.
+This is accomplished via the --attach argument. The syntax is:
+
+ target> gdbserver COMM --attach PID
+
+PID is the process ID of a currently running process. It isn't
+necessary to point gdbserver at a binary for the running process.
+
Usage (host side):
You need an unstripped copy of the target program on your host system, since
diff --git a/contrib/gdb/gdb/gdbserver/i387-fp.c b/contrib/gdb/gdb/gdbserver/i387-fp.c
new file mode 100644
index 0000000..3d1d6a6
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/i387-fp.c
@@ -0,0 +1,290 @@
+/* i387-specific utility functions, for the remote server for GDB.
+ Copyright 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+
+int num_xmm_registers = 8;
+
+/* Note: These functions preserve the reserved bits in control registers.
+ However, gdbserver promptly throws away that information. */
+
+/* These structs should have the proper sizes and alignment on both
+ i386 and x86-64 machines. */
+
+struct i387_fsave {
+ /* All these are only sixteen bits, plus padding, except for fop (which
+ is only eleven bits), and fooff / fioff (which are 32 bits each). */
+ unsigned int fctrl;
+ unsigned int fstat;
+ unsigned int ftag;
+ unsigned int fioff;
+ unsigned short fiseg;
+ unsigned short fop;
+ unsigned int fooff;
+ unsigned int foseg;
+
+ /* Space for eight 80-bit FP values. */
+ char st_space[80];
+};
+
+struct i387_fxsave {
+ /* All these are only sixteen bits, plus padding, except for fop (which
+ is only eleven bits), and fooff / fioff (which are 32 bits each). */
+ unsigned short fctrl;
+ unsigned short fstat;
+ unsigned short ftag;
+ unsigned short fop;
+ unsigned int fioff;
+ unsigned int fiseg;
+ unsigned int fooff;
+ unsigned int foseg;
+
+ unsigned int mxcsr;
+
+ unsigned int _pad1;
+
+ /* Space for eight 80-bit FP values in 128-bit spaces. */
+ char st_space[128];
+
+ /* Space for eight 128-bit XMM values, or 16 on x86-64. */
+ char xmm_space[256];
+};
+
+void
+i387_cache_to_fsave (void *buf)
+{
+ struct i387_fsave *fp = (struct i387_fsave *) buf;
+ int i;
+ int st0_regnum = find_regno ("st0");
+ unsigned long val, val2;
+
+ for (i = 0; i < 8; i++)
+ collect_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 10);
+
+ collect_register_by_name ("fioff", &fp->fioff);
+ collect_register_by_name ("fooff", &fp->fooff);
+
+ /* This one's 11 bits... */
+ collect_register_by_name ("fop", &val2);
+ fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800);
+
+ /* Some registers are 16-bit. */
+ collect_register_by_name ("fctrl", &val);
+ *(unsigned short *) &fp->fctrl = val;
+
+ collect_register_by_name ("fstat", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->fstat = val;
+
+ collect_register_by_name ("ftag", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->ftag = val;
+
+ collect_register_by_name ("fiseg", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->fiseg = val;
+
+ collect_register_by_name ("foseg", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->foseg = val;
+}
+
+void
+i387_fsave_to_cache (void *buf)
+{
+ struct i387_fsave *fp = (struct i387_fsave *) buf;
+ int i;
+ int st0_regnum = find_regno ("st0");
+ unsigned long val;
+
+ for (i = 0; i < 8; i++)
+ supply_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 10);
+
+ supply_register_by_name ("fioff", &fp->fioff);
+ supply_register_by_name ("fooff", &fp->fooff);
+
+ /* Some registers are 16-bit. */
+ val = fp->fctrl & 0xFFFF;
+ supply_register_by_name ("fctrl", &val);
+
+ val = fp->fstat & 0xFFFF;
+ supply_register_by_name ("fstat", &val);
+
+ val = fp->ftag & 0xFFFF;
+ supply_register_by_name ("ftag", &val);
+
+ val = fp->fiseg & 0xFFFF;
+ supply_register_by_name ("fiseg", &val);
+
+ val = fp->foseg & 0xFFFF;
+ supply_register_by_name ("foseg", &val);
+
+ val = (fp->fop) & 0x7FF;
+ supply_register_by_name ("fop", &val);
+}
+
+void
+i387_cache_to_fxsave (void *buf)
+{
+ struct i387_fxsave *fp = (struct i387_fxsave *) buf;
+ int i;
+ int st0_regnum = find_regno ("st0");
+ int xmm0_regnum = find_regno ("xmm0");
+ unsigned long val, val2;
+
+ for (i = 0; i < 8; i++)
+ collect_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 16);
+ for (i = 0; i < num_xmm_registers; i++)
+ collect_register (i + xmm0_regnum, ((char *) &fp->xmm_space[0]) + i * 16);
+
+ collect_register_by_name ("fioff", &fp->fioff);
+ collect_register_by_name ("fooff", &fp->fooff);
+ collect_register_by_name ("mxcsr", &fp->mxcsr);
+
+ /* This one's 11 bits... */
+ collect_register_by_name ("fop", &val2);
+ fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800);
+
+ /* Some registers are 16-bit. */
+ collect_register_by_name ("fctrl", &val);
+ *(unsigned short *) &fp->fctrl = val;
+
+ collect_register_by_name ("fstat", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->fstat = val;
+
+ /* Convert to the simplifed tag form stored in fxsave data. */
+ collect_register_by_name ("ftag", &val);
+ val &= 0xFFFF;
+ for (i = 7; i >= 0; i--)
+ {
+ int tag = (val >> (i * 2)) & 3;
+
+ if (tag != 3)
+ val2 |= (1 << i);
+ }
+ *(unsigned short *) &fp->ftag = val2;
+
+ collect_register_by_name ("fiseg", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->fiseg = val;
+
+ collect_register_by_name ("foseg", &val);
+ val &= 0xFFFF;
+ *(unsigned short *) &fp->foseg = val;
+}
+
+static int
+i387_ftag (struct i387_fxsave *fp, int regno)
+{
+ unsigned char *raw = &fp->st_space[regno * 16];
+ unsigned int exponent;
+ unsigned long fraction[2];
+ int integer;
+
+ integer = raw[7] & 0x80;
+ exponent = (((raw[9] & 0x7f) << 8) | raw[8]);
+ fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]);
+ fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16)
+ | (raw[5] << 8) | raw[4]);
+
+ if (exponent == 0x7fff)
+ {
+ /* Special. */
+ return (2);
+ }
+ else if (exponent == 0x0000)
+ {
+ if (fraction[0] == 0x0000 && fraction[1] == 0x0000 && !integer)
+ {
+ /* Zero. */
+ return (1);
+ }
+ else
+ {
+ /* Special. */
+ return (2);
+ }
+ }
+ else
+ {
+ if (integer)
+ {
+ /* Valid. */
+ return (0);
+ }
+ else
+ {
+ /* Special. */
+ return (2);
+ }
+ }
+}
+
+void
+i387_fxsave_to_cache (void *buf)
+{
+ struct i387_fxsave *fp = (struct i387_fxsave *) buf;
+ int i, top;
+ int st0_regnum = find_regno ("st0");
+ int xmm0_regnum = find_regno ("xmm0");
+ unsigned long val;
+
+ for (i = 0; i < 8; i++)
+ supply_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 16);
+ for (i = 0; i < num_xmm_registers; i++)
+ supply_register (i + xmm0_regnum, ((char *) &fp->xmm_space[0]) + i * 16);
+
+ supply_register_by_name ("fioff", &fp->fioff);
+ supply_register_by_name ("fooff", &fp->fooff);
+ supply_register_by_name ("mxcsr", &fp->mxcsr);
+
+ /* Some registers are 16-bit. */
+ val = fp->fctrl & 0xFFFF;
+ supply_register_by_name ("fctrl", &val);
+
+ val = fp->fstat & 0xFFFF;
+ supply_register_by_name ("fstat", &val);
+
+ /* Generate the form of ftag data that GDB expects. */
+ top = (fp->fstat >> 11) & 0x7;
+ val = 0;
+ for (i = 7; i >= 0; i--)
+ {
+ int tag;
+ if (val & (1 << i))
+ tag = i387_ftag (fp, (i + 8 - top) % 8);
+ else
+ tag = 3;
+ val |= tag << (2 * i);
+ }
+ supply_register_by_name ("ftag", &val);
+
+ val = fp->fiseg & 0xFFFF;
+ supply_register_by_name ("fiseg", &val);
+
+ val = fp->foseg & 0xFFFF;
+ supply_register_by_name ("foseg", &val);
+
+ val = (fp->fop) & 0x7FF;
+ supply_register_by_name ("fop", &val);
+}
+
diff --git a/contrib/gdb/gdb/gdbserver/i387-fp.h b/contrib/gdb/gdb/gdbserver/i387-fp.h
new file mode 100644
index 0000000..90fe4ca
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/i387-fp.h
@@ -0,0 +1,33 @@
+/* i387-specific utility functions, for the remote server for GDB.
+ Copyright 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef I387_FP_H
+#define I387_FP_H
+
+void i387_cache_to_fsave (void *buf);
+void i387_fsave_to_cache (void *buf);
+
+void i387_cache_to_fxsave (void *buf);
+void i387_fxsave_to_cache (void *buf);
+
+extern int num_xmm_registers;
+
+#endif /* I387_FP_H */
diff --git a/contrib/gdb/gdb/gdbserver/linux-arm-low.c b/contrib/gdb/gdb/gdbserver/linux-arm-low.c
new file mode 100644
index 0000000..f873b07
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-arm-low.c
@@ -0,0 +1,47 @@
+/* GNU/Linux/ARM specific low level interface, for the remote server for GDB.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "linux-low.h"
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
+int num_regs = 16;
+
+int regmap[] = {
+ 0, 4, 8, 12, 16, 20, 24, 28,
+ 32, 36, 40, 44, 48, 52, 56, 60,
+};
+
+int
+cannot_store_register (int regno)
+{
+ return (regno >= num_regs);
+}
+
+int
+cannot_fetch_register (int regno)
+{
+ return (regno >= num_regs);
+}
+
diff --git a/contrib/gdb/gdb/gdbserver/linux-i386-low.c b/contrib/gdb/gdb/gdbserver/linux-i386-low.c
new file mode 100644
index 0000000..2a66efa
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-i386-low.c
@@ -0,0 +1,123 @@
+/* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "linux-low.h"
+#include "i387-fp.h"
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
+/* This module only supports access to the general purpose registers. */
+
+int num_regs = 16;
+
+/* This stuff comes from i386-linux-nat.c. */
+
+/* Mapping between the general-purpose registers in `struct user'
+ format and GDB's register array layout. */
+int regmap[] =
+{
+ EAX * 4, ECX * 4, EDX * 4, EBX * 4,
+ UESP * 4, EBP * 4, ESI * 4, EDI * 4,
+ EIP * 4, EFL * 4, CS * 4, SS * 4,
+ DS * 4, ES * 4, FS * 4, GS * 4
+};
+
+int
+cannot_store_register (int regno)
+{
+ return (regno >= num_regs);
+}
+
+int
+cannot_fetch_register (int regno)
+{
+ return (regno >= num_regs);
+}
+
+
+#ifdef HAVE_LINUX_REGSETS
+#include <sys/procfs.h>
+#include <sys/ptrace.h>
+
+static void
+i386_fill_gregset (void *buf)
+{
+ int i;
+
+ for (i = 0; i < num_regs; i++)
+ collect_register (i, ((char *) buf) + regmap[i]);
+
+ collect_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
+}
+
+static void
+i386_store_gregset (void *buf)
+{
+ int i;
+
+ for (i = 0; i < num_regs; i++)
+ supply_register (i, ((char *) buf) + regmap[i]);
+
+ supply_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
+}
+
+static void
+i386_fill_fpregset (void *buf)
+{
+ i387_cache_to_fsave (buf);
+}
+
+static void
+i386_store_fpregset (void *buf)
+{
+ i387_fsave_to_cache (buf);
+}
+
+static void
+i386_fill_fpxregset (void *buf)
+{
+ i387_cache_to_fxsave (buf);
+}
+
+static void
+i386_store_fpxregset (void *buf)
+{
+ i387_fxsave_to_cache (buf);
+}
+
+
+struct regset_info target_regsets[] = {
+ { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
+ i386_fill_gregset, i386_store_gregset },
+#ifdef HAVE_PTRACE_GETFPXREGS
+ { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t),
+ i386_fill_fpxregset, i386_store_fpxregset },
+#endif
+ { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
+ i386_fill_fpregset, i386_store_fpregset },
+ { 0, 0, -1, NULL, NULL }
+};
+
+#endif /* HAVE_LINUX_REGSETS */
+
diff --git a/contrib/gdb/gdb/gdbserver/linux-ia64-low.c b/contrib/gdb/gdb/gdbserver/linux-ia64-low.c
new file mode 100644
index 0000000..f0f238f
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-ia64-low.c
@@ -0,0 +1,297 @@
+/* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "linux-low.h"
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
+int num_regs = 590;
+
+#include <asm/ptrace_offsets.h>
+
+int regmap[] =
+ {
+ /* general registers */
+ -1, /* gr0 not available; i.e, it's always zero */
+ PT_R1,
+ PT_R2,
+ PT_R3,
+ PT_R4,
+ PT_R5,
+ PT_R6,
+ PT_R7,
+ PT_R8,
+ PT_R9,
+ PT_R10,
+ PT_R11,
+ PT_R12,
+ PT_R13,
+ PT_R14,
+ PT_R15,
+ PT_R16,
+ PT_R17,
+ PT_R18,
+ PT_R19,
+ PT_R20,
+ PT_R21,
+ PT_R22,
+ PT_R23,
+ PT_R24,
+ PT_R25,
+ PT_R26,
+ PT_R27,
+ PT_R28,
+ PT_R29,
+ PT_R30,
+ PT_R31,
+ /* gr32 through gr127 not directly available via the ptrace interface */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ /* Floating point registers */
+ -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
+ PT_F2,
+ PT_F3,
+ PT_F4,
+ PT_F5,
+ PT_F6,
+ PT_F7,
+ PT_F8,
+ PT_F9,
+ PT_F10,
+ PT_F11,
+ PT_F12,
+ PT_F13,
+ PT_F14,
+ PT_F15,
+ PT_F16,
+ PT_F17,
+ PT_F18,
+ PT_F19,
+ PT_F20,
+ PT_F21,
+ PT_F22,
+ PT_F23,
+ PT_F24,
+ PT_F25,
+ PT_F26,
+ PT_F27,
+ PT_F28,
+ PT_F29,
+ PT_F30,
+ PT_F31,
+ PT_F32,
+ PT_F33,
+ PT_F34,
+ PT_F35,
+ PT_F36,
+ PT_F37,
+ PT_F38,
+ PT_F39,
+ PT_F40,
+ PT_F41,
+ PT_F42,
+ PT_F43,
+ PT_F44,
+ PT_F45,
+ PT_F46,
+ PT_F47,
+ PT_F48,
+ PT_F49,
+ PT_F50,
+ PT_F51,
+ PT_F52,
+ PT_F53,
+ PT_F54,
+ PT_F55,
+ PT_F56,
+ PT_F57,
+ PT_F58,
+ PT_F59,
+ PT_F60,
+ PT_F61,
+ PT_F62,
+ PT_F63,
+ PT_F64,
+ PT_F65,
+ PT_F66,
+ PT_F67,
+ PT_F68,
+ PT_F69,
+ PT_F70,
+ PT_F71,
+ PT_F72,
+ PT_F73,
+ PT_F74,
+ PT_F75,
+ PT_F76,
+ PT_F77,
+ PT_F78,
+ PT_F79,
+ PT_F80,
+ PT_F81,
+ PT_F82,
+ PT_F83,
+ PT_F84,
+ PT_F85,
+ PT_F86,
+ PT_F87,
+ PT_F88,
+ PT_F89,
+ PT_F90,
+ PT_F91,
+ PT_F92,
+ PT_F93,
+ PT_F94,
+ PT_F95,
+ PT_F96,
+ PT_F97,
+ PT_F98,
+ PT_F99,
+ PT_F100,
+ PT_F101,
+ PT_F102,
+ PT_F103,
+ PT_F104,
+ PT_F105,
+ PT_F106,
+ PT_F107,
+ PT_F108,
+ PT_F109,
+ PT_F110,
+ PT_F111,
+ PT_F112,
+ PT_F113,
+ PT_F114,
+ PT_F115,
+ PT_F116,
+ PT_F117,
+ PT_F118,
+ PT_F119,
+ PT_F120,
+ PT_F121,
+ PT_F122,
+ PT_F123,
+ PT_F124,
+ PT_F125,
+ PT_F126,
+ PT_F127,
+ /* predicate registers - we don't fetch these individually */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ /* branch registers */
+ PT_B0,
+ PT_B1,
+ PT_B2,
+ PT_B3,
+ PT_B4,
+ PT_B5,
+ PT_B6,
+ PT_B7,
+ /* virtual frame pointer and virtual return address pointer */
+ -1, -1,
+ /* other registers */
+ PT_PR,
+ PT_CR_IIP, /* ip */
+ PT_CR_IPSR, /* psr */
+ PT_CFM, /* cfm */
+ /* kernel registers not visible via ptrace interface (?) */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ /* hole */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ PT_AR_RSC,
+ PT_AR_BSP,
+ PT_AR_BSPSTORE,
+ PT_AR_RNAT,
+ -1,
+ -1, /* Not available: FCR, IA32 floating control register */
+ -1, -1,
+ -1, /* Not available: EFLAG */
+ -1, /* Not available: CSD */
+ -1, /* Not available: SSD */
+ -1, /* Not available: CFLG */
+ -1, /* Not available: FSR */
+ -1, /* Not available: FIR */
+ -1, /* Not available: FDR */
+ -1,
+ PT_AR_CCV,
+ -1, -1, -1,
+ PT_AR_UNAT,
+ -1, -1, -1,
+ PT_AR_FPSR,
+ -1, -1, -1,
+ -1, /* Not available: ITC */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ PT_AR_PFS,
+ PT_AR_LC,
+ -1, /* Not available: EC, the Epilog Count register */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1,
+ /* nat bits - not fetched directly; instead we obtain these bits from
+ either rnat or unat or from memory. */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ };
+
+int
+cannot_store_register (int regno)
+{
+ return 0;
+}
+
+int
+cannot_fetch_register (int regno)
+{
+ return 0;
+}
+
diff --git a/contrib/gdb/gdb/gdbserver/linux-low.c b/contrib/gdb/gdb/gdbserver/linux-low.c
new file mode 100644
index 0000000..4e40d07
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-low.c
@@ -0,0 +1,484 @@
+/* Low level interface to ptrace, for the remote server for GDB.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "linux-low.h"
+
+#include <sys/wait.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/dir.h>
+#include <sys/ptrace.h>
+#include <sys/user.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define PTRACE_ARG3_TYPE long
+#define PTRACE_XFER_TYPE long
+
+#ifdef HAVE_LINUX_REGSETS
+static int use_regsets_p = 1;
+#endif
+
+extern int errno;
+
+#ifdef HAVE_LINUX_USRREGS
+extern int num_regs;
+extern int regmap[];
+#endif
+
+/* Start an inferior process and returns its pid.
+ ALLARGS is a vector of program-name and args. */
+
+int
+create_inferior (char *program, char **allargs)
+{
+ int pid;
+
+ pid = fork ();
+ if (pid < 0)
+ perror_with_name ("fork");
+
+ if (pid == 0)
+ {
+ ptrace (PTRACE_TRACEME, 0, 0, 0);
+
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+
+ return pid;
+}
+
+/* Attach to an inferior process. */
+
+int
+myattach (int pid)
+{
+ if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
+ {
+ fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
+ errno < sys_nerr ? sys_errlist[errno] : "unknown error",
+ errno);
+ fflush (stderr);
+ _exit (0177);
+ }
+
+ return 0;
+}
+
+/* Kill the inferior process. Make us have no inferior. */
+
+void
+kill_inferior (void)
+{
+ if (inferior_pid == 0)
+ return;
+ ptrace (PTRACE_KILL, inferior_pid, 0, 0);
+ wait (0);
+}
+
+/* Return nonzero if the given thread is still alive. */
+int
+mythread_alive (int pid)
+{
+ return 1;
+}
+
+/* Wait for process, returns status */
+
+unsigned char
+mywait (char *status)
+{
+ int pid;
+ int w;
+
+ enable_async_io ();
+ pid = waitpid (inferior_pid, &w, 0);
+ disable_async_io ();
+ if (pid != inferior_pid)
+ perror_with_name ("wait");
+
+ if (WIFEXITED (w))
+ {
+ fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
+ *status = 'W';
+ return ((unsigned char) WEXITSTATUS (w));
+ }
+ else if (!WIFSTOPPED (w))
+ {
+ fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
+ *status = 'X';
+ return ((unsigned char) WTERMSIG (w));
+ }
+
+ fetch_inferior_registers (0);
+
+ *status = 'T';
+ return ((unsigned char) WSTOPSIG (w));
+}
+
+/* Resume execution of the inferior process.
+ If STEP is nonzero, single-step it.
+ If SIGNAL is nonzero, give it that signal. */
+
+void
+myresume (int step, int signal)
+{
+ errno = 0;
+ ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal);
+ if (errno)
+ perror_with_name ("ptrace");
+}
+
+
+#ifdef HAVE_LINUX_USRREGS
+
+#define REGISTER_RAW_SIZE(regno) register_size((regno))
+
+int
+register_addr (int regnum)
+{
+ int addr;
+
+ if (regnum < 0 || regnum >= num_regs)
+ error ("Invalid register number %d.", regnum);
+
+ addr = regmap[regnum];
+ if (addr == -1)
+ addr = 0;
+
+ return addr;
+}
+
+/* Fetch one register. */
+static void
+fetch_register (int regno)
+{
+ CORE_ADDR regaddr;
+ register int i;
+
+ if (regno >= num_regs)
+ return;
+ if (cannot_fetch_register (regno))
+ return;
+
+ regaddr = register_addr (regno);
+ if (regaddr == -1)
+ return;
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ *(PTRACE_XFER_TYPE *) (register_data (regno) + i) =
+ ptrace (PTRACE_PEEKUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, 0);
+ regaddr += sizeof (PTRACE_XFER_TYPE);
+ if (errno != 0)
+ {
+ /* Warning, not error, in case we are attached; sometimes the
+ kernel doesn't let us at the registers. */
+ char *err = strerror (errno);
+ char *msg = alloca (strlen (err) + 128);
+ sprintf (msg, "reading register %d: %s", regno, err);
+ error (msg);
+ goto error_exit;
+ }
+ }
+error_exit:;
+}
+
+/* Fetch all registers, or just one, from the child process. */
+static void
+usr_fetch_inferior_registers (int regno)
+{
+ if (regno == -1 || regno == 0)
+ for (regno = 0; regno < num_regs; regno++)
+ fetch_register (regno);
+ else
+ fetch_register (regno);
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+static void
+usr_store_inferior_registers (int regno)
+{
+ CORE_ADDR regaddr;
+ int i;
+
+ if (regno >= 0)
+ {
+ if (regno >= num_regs)
+ return;
+
+ if (cannot_store_register (regno))
+ return;
+
+ regaddr = register_addr (regno);
+ if (regaddr == -1)
+ return;
+ errno = 0;
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+ *(int *) (register_data (regno) + i));
+ if (errno != 0)
+ {
+ /* Warning, not error, in case we are attached; sometimes the
+ kernel doesn't let us at the registers. */
+ char *err = strerror (errno);
+ char *msg = alloca (strlen (err) + 128);
+ sprintf (msg, "writing register %d: %s",
+ regno, err);
+ error (msg);
+ return;
+ }
+ regaddr += sizeof (int);
+ }
+ }
+ else
+ for (regno = 0; regno < num_regs; regno++)
+ store_inferior_registers (regno);
+}
+#endif /* HAVE_LINUX_USRREGS */
+
+
+
+#ifdef HAVE_LINUX_REGSETS
+
+static int
+regsets_fetch_inferior_registers (void)
+{
+ struct regset_info *regset;
+
+ regset = target_regsets;
+
+ while (regset->size >= 0)
+ {
+ void *buf;
+ int res;
+
+ if (regset->size == 0)
+ {
+ regset ++;
+ continue;
+ }
+
+ buf = malloc (regset->size);
+ res = ptrace (regset->get_request, inferior_pid, 0, (int) buf);
+ if (res < 0)
+ {
+ if (errno == EIO)
+ {
+ /* If we get EIO on the first regset, do not try regsets again.
+ If we get EIO on a later regset, disable that regset. */
+ if (regset == target_regsets)
+ {
+ use_regsets_p = 0;
+ return -1;
+ }
+ else
+ {
+ regset->size = 0;
+ continue;
+ }
+ }
+ else
+ {
+ perror ("Warning: ptrace(regsets_fetch_inferior_registers)");
+ }
+ }
+ regset->store_function (buf);
+ regset ++;
+ }
+}
+
+static int
+regsets_store_inferior_registers (void)
+{
+ struct regset_info *regset;
+
+ regset = target_regsets;
+
+ while (regset->size >= 0)
+ {
+ void *buf;
+ int res;
+
+ if (regset->size == 0)
+ {
+ regset ++;
+ continue;
+ }
+
+ buf = malloc (regset->size);
+ regset->fill_function (buf);
+ res = ptrace (regset->set_request, inferior_pid, 0, (int) buf);
+ if (res < 0)
+ {
+ if (errno == EIO)
+ {
+ /* If we get EIO on the first regset, do not try regsets again.
+ If we get EIO on a later regset, disable that regset. */
+ if (regset == target_regsets)
+ {
+ use_regsets_p = 0;
+ return -1;
+ }
+ else
+ {
+ regset->size = 0;
+ continue;
+ }
+ }
+ else
+ {
+ perror ("Warning: ptrace(regsets_fetch_inferior_registers)");
+ }
+ }
+ regset ++;
+ }
+}
+
+#endif /* HAVE_LINUX_REGSETS */
+
+
+void
+fetch_inferior_registers (int regno)
+{
+#ifdef HAVE_LINUX_REGSETS
+ if (use_regsets_p)
+ {
+ if (regsets_fetch_inferior_registers () == 0)
+ return;
+ }
+#endif
+#ifdef HAVE_LINUX_USRREGS
+ usr_fetch_inferior_registers (regno);
+#endif
+}
+
+void
+store_inferior_registers (int regno)
+{
+#ifdef HAVE_LINUX_REGSETS
+ if (use_regsets_p)
+ {
+ if (regsets_store_inferior_registers () == 0)
+ return;
+ }
+#endif
+#ifdef HAVE_LINUX_USRREGS
+ usr_store_inferior_registers (regno);
+#endif
+}
+
+
+/* Copy LEN bytes from inferior's memory starting at MEMADDR
+ to debugger memory starting at MYADDR. */
+
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
+ / sizeof (PTRACE_XFER_TYPE);
+ /* Allocate buffer of that many longwords. */
+ register PTRACE_XFER_TYPE *buffer
+ = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+
+ /* Read all the longwords */
+ for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
+ {
+ buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
+ }
+
+ /* Copy appropriate bytes out of the buffer. */
+ memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
+}
+
+/* Copy LEN bytes of data from debugger memory at MYADDR
+ to inferior's memory at MEMADDR.
+ On failure (cannot write the inferior)
+ returns the value of errno. */
+
+int
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
+ /* Allocate buffer of that many longwords. */
+ register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+ extern int errno;
+
+ /* Fill start and end extra bytes of buffer with existing memory data. */
+
+ buffer[0] = ptrace (PTRACE_PEEKTEXT, inferior_pid,
+ (PTRACE_ARG3_TYPE) addr, 0);
+
+ if (count > 1)
+ {
+ buffer[count - 1]
+ = ptrace (PTRACE_PEEKTEXT, inferior_pid,
+ (PTRACE_ARG3_TYPE) (addr + (count - 1)
+ * sizeof (PTRACE_XFER_TYPE)),
+ 0);
+ }
+
+ /* Copy data to be written over corresponding part of buffer */
+
+ memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len);
+
+ /* Write the entire buffer. */
+
+ for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ ptrace (PTRACE_POKETEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]);
+ if (errno)
+ return errno;
+ }
+
+ return 0;
+}
+
+void
+initialize_low (void)
+{
+ init_registers ();
+}
diff --git a/contrib/gdb/gdb/gdbserver/linux-low.h b/contrib/gdb/gdb/gdbserver/linux-low.h
new file mode 100644
index 0000000..421fa22
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-low.h
@@ -0,0 +1,37 @@
+/* Internal interfaces for the GNU/Linux specific target code for gdbserver.
+ Copyright 2002, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_LINUX_USR_REGISTERS
+extern int regmap[];
+extern int num_regs;
+int cannot_fetch_register (int regno);
+int cannot_store_register (int regno);
+#endif
+
+#ifdef HAVE_LINUX_REGSETS
+typedef void (*regset_func) (void *);
+struct regset_info
+{
+ int get_request, set_request;
+ int size;
+ regset_func fill_function, store_function;
+};
+extern struct regset_info target_regsets[];
+#endif
diff --git a/contrib/gdb/gdb/gdbserver/linux-x86-64-low.c b/contrib/gdb/gdb/gdbserver/linux-x86-64-low.c
new file mode 100644
index 0000000..ffb0ce7
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/linux-x86-64-low.c
@@ -0,0 +1,76 @@
+/* GNU/Linux/x86-64 specific low level interface, for the remote server
+ for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "linux-low.h"
+#include "i387-fp.h"
+
+#include <sys/reg.h>
+#include <sys/procfs.h>
+#include <sys/ptrace.h>
+
+static int regmap[] = {
+ RAX, RDX, RCX, RBX,
+ RSI, RDI, RBP, RSP,
+ R8, R9, R10, R11,
+ R12, R13, R14, R15,
+ RIP, EFLAGS
+};
+
+static void
+x86_64_fill_gregset (void *buf)
+{
+ int i;
+
+ for (i = 0; i < 18; i++)
+ collect_register (i, ((char *) buf) + regmap[i]);
+}
+
+static void
+x86_64_store_gregset (void *buf)
+{
+ int i;
+
+ for (i = 0; i < 18; i++)
+ supply_register (i, ((char *) buf) + regmap[i]);
+}
+
+static void
+x86_64_fill_fpregset (void *buf)
+{
+ i387_cache_to_fxsave (buf);
+}
+
+static void
+x86_64_store_fpregset (void *buf)
+{
+ i387_fxsave_to_cache (buf);
+}
+
+
+struct regset_info target_regsets[] = {
+ { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
+ x86_64_fill_gregset, x86_64_store_gregset },
+ { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
+ x86_64_fill_fpregset, x86_64_store_fpregset },
+ { 0, 0, -1, NULL, NULL }
+};
diff --git a/contrib/gdb/gdb/gdbserver/low-hppabsd.c b/contrib/gdb/gdb/gdbserver/low-hppabsd.c
index c784d0c..3287923 100644
--- a/contrib/gdb/gdb/gdbserver/low-hppabsd.c
+++ b/contrib/gdb/gdb/gdbserver/low-hppabsd.c
@@ -1,23 +1,24 @@
/* Low level interface to ptrace, for the remote server for GDB.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 "server.h"
#include <sys/wait.h>
#include "frame.h"
#include "inferior.h"
@@ -32,33 +33,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <fcntl.h>
/***************Begin MY defs*********************/
-int quit_flag = 0;
-char registers[REGISTER_BYTES];
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-
-char buf2[MAX_REGISTER_RAW_SIZE];
+static char my_registers[REGISTER_BYTES];
+char *registers = my_registers;
/***************End MY defs*********************/
#include <sys/ptrace.h>
#include <machine/reg.h>
-extern char **environ;
extern int errno;
-extern int inferior_pid;
-void quit (), perror_with_name ();
-int query ();
/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args.
- ENV is the environment vector to pass. */
+ ALLARGS is a vector of program-name and args. */
int
-create_inferior (program, allargs)
- char *program;
- char **allargs;
+create_inferior (char *program, char **allargs)
{
int pid;
@@ -84,19 +72,25 @@ create_inferior (program, allargs)
/* Kill the inferior process. Make us have no inferior. */
void
-kill_inferior ()
+kill_inferior (void)
{
if (inferior_pid == 0)
return;
ptrace (8, inferior_pid, 0, 0, 0);
wait (0);
- /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
+}
+
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
}
/* Return nonzero if the given thread is still alive. */
int
-mythread_alive (pid)
- int pid;
+mythread_alive (int pid)
{
return 1;
}
@@ -104,13 +98,14 @@ mythread_alive (pid)
/* Wait for process, returns status */
unsigned char
-mywait (status)
- char *status;
+mywait (char *status)
{
int pid;
union wait w;
- pid = wait (&w);
+ enable_async_io ();
+ pid = waitpid (inferior_pid, &w, 0);
+ disable_async_io ();
if (pid != inferior_pid)
perror_with_name ("wait");
@@ -138,9 +133,7 @@ mywait (status)
If SIGNAL is nonzero, give it that signal. */
void
-myresume (step, signal)
- int step;
- int signal;
+myresume (int step, int signal)
{
errno = 0;
ptrace (step ? PT_STEP : PT_CONTINUE, inferior_pid, 1, signal, 0);
@@ -162,13 +155,11 @@ myresume (step, signal)
#endif
CORE_ADDR
-register_addr (regno, blockend)
- int regno;
- CORE_ADDR blockend;
+register_addr (int regno, CORE_ADDR blockend)
{
CORE_ADDR addr;
- if (regno < 0 || regno >= ARCH_NUM_REGS)
+ if (regno < 0 || regno >= NUM_REGS)
error ("Invalid register number %d.", regno);
REGISTER_U_ADDR (addr, blockend, regno);
@@ -179,8 +170,7 @@ register_addr (regno, blockend)
/* Fetch one register. */
static void
-fetch_register (regno)
- int regno;
+fetch_register (int regno)
{
register unsigned int regaddr;
char buf[MAX_REGISTER_RAW_SIZE];
@@ -195,8 +185,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,14 +199,13 @@ fetch_register (regno)
goto error_exit;
}
}
- error_exit:;
+error_exit:;
}
/* Fetch all registers, or just one, from the child process. */
void
-fetch_inferior_registers (regno)
- int regno;
+fetch_inferior_registers (int regno)
{
if (regno == -1 || regno == 0)
for (regno = 0; regno < NUM_REGS; regno++)
@@ -230,8 +219,7 @@ fetch_inferior_registers (regno)
Otherwise, REGNO specifies which register (so we can save time). */
void
-store_inferior_registers (regno)
- int regno;
+store_inferior_registers (int regno)
{
register unsigned int regaddr;
char buf[80];
@@ -247,20 +235,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 +264,7 @@ store_inferior_registers (regno)
error (msg);
return;
}
- regaddr += sizeof(int);
+ regaddr += sizeof (int);
}
}
else
@@ -293,14 +281,12 @@ store_inferior_registers (regno)
/* Copy LEN bytes from inferior's memory starting at MEMADDR
to debugger memory starting at MYADDR. */
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -323,14 +309,11 @@ read_inferior_memory (memaddr, myaddr, len)
returns the value of errno. */
int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -367,13 +350,6 @@ write_inferior_memory (memaddr, myaddr, len)
}
void
-initialize ()
-{
- inferior_pid = 0;
-}
-
-int
-have_inferior_p ()
+initialize_low (void)
{
- return inferior_pid != 0;
}
diff --git a/contrib/gdb/gdb/gdbserver/low-lynx.c b/contrib/gdb/gdb/gdbserver/low-lynx.c
index 3444f7a..90e18db 100644
--- a/contrib/gdb/gdb/gdbserver/low-lynx.c
+++ b/contrib/gdb/gdb/gdbserver/low-lynx.c
@@ -1,21 +1,23 @@
/* Low level interface to ptrace, for the remote server for GDB.
- Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -43,7 +45,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <sys/wait.h>
#include <sys/fpp.h>
-char registers[REGISTER_BYTES];
+static char my_registers[REGISTER_BYTES];
+char *registers = my_registers;
#include <sys/ptrace.h>
@@ -51,9 +54,7 @@ char registers[REGISTER_BYTES];
ALLARGS is a vector of program-name and args. */
int
-create_inferior (program, allargs)
- char *program;
- char **allargs;
+create_inferior (char *program, char **allargs)
{
int pid;
@@ -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);
@@ -86,10 +87,17 @@ create_inferior (program, allargs)
return pid;
}
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
+}
+
/* Kill the inferior process. Make us have no inferior. */
void
-kill_inferior ()
+kill_inferior (void)
{
if (inferior_pid == 0)
return;
@@ -101,8 +109,7 @@ kill_inferior ()
/* Return nonzero if the given thread is still alive. */
int
-mythread_alive (pid)
- int pid;
+mythread_alive (int pid)
{
/* Arggh. Apparently pthread_kill only works for threads within
the process that calls pthread_kill.
@@ -120,42 +127,41 @@ mythread_alive (pid)
/* Wait for process, returns status */
unsigned char
-mywait (status)
- char *status;
+mywait (char *status)
{
int pid;
union wait w;
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. */
;
}
}
@@ -184,9 +190,7 @@ mywait (status)
If SIGNAL is nonzero, give it that signal. */
void
-myresume (step, signal)
- int step;
- int signal;
+myresume (int step, int signal)
{
errno = 0;
ptrace (step ? PTRACE_SINGLESTEP_ONE : PTRACE_CONT,
@@ -209,22 +213,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 +238,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 +282,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
@@ -350,8 +354,7 @@ static int regmap[] =
It also handles knows where to find the I & L regs on the stack. */
void
-fetch_inferior_registers (regno)
- int regno;
+fetch_inferior_registers (int regno)
{
#if 0
int whatregs = 0;
@@ -371,7 +374,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 +382,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 +416,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 +430,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
}
@@ -455,8 +458,7 @@ fetch_inferior_registers (regno)
this point. */
void
-store_inferior_registers (regno)
- int regno;
+store_inferior_registers (int regno)
{
#if 0
int whatregs = 0;
@@ -474,7 +476,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 +493,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 +508,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 +521,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 +535,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 +566,20 @@ store_inferior_registers (regno)
saved context block. */
static unsigned long
-lynx_registers_addr()
+lynx_registers_addr (void)
{
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)");
@@ -589,14 +591,13 @@ lynx_registers_addr()
marking them as valid so we won't fetch them again. */
void
-fetch_inferior_registers (ignored)
- int ignored;
+fetch_inferior_registers (int ignored)
{
int regno;
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;
}
}
@@ -621,14 +622,13 @@ fetch_inferior_registers (ignored)
Otherwise, REGNO specifies which register (so we can save time). */
void
-store_inferior_registers (ignored)
- int ignored;
+store_inferior_registers (int ignored)
{
int regno;
unsigned long reg;
unsigned long ecp;
- ecp = lynx_registers_addr();
+ ecp = lynx_registers_addr ();
for (regno = 0; regno < NUM_REGS; regno++)
{
@@ -638,7 +638,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),
@@ -660,14 +660,11 @@ store_inferior_registers (ignored)
to debugger memory starting at MYADDR. */
void
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -690,14 +687,11 @@ read_inferior_memory (memaddr, myaddr, len)
returns the value of errno. */
int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -730,12 +724,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;
@@ -744,3 +738,8 @@ ptrace (PTRACE_POKETEXT): errno=%d, pid=0x%x, addr=0x%x, buffer[i] = 0x%x\n",
return 0;
}
+
+void
+initialize_low (void)
+{
+}
diff --git a/contrib/gdb/gdb/gdbserver/low-nbsd.c b/contrib/gdb/gdb/gdbserver/low-nbsd.c
new file mode 100644
index 0000000..9046d63
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/low-nbsd.c
@@ -0,0 +1,599 @@
+/* Low level interface to ptrace, for the remote server for GDB.
+ Copyright 1986, 1987, 1993, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#include "frame.h"
+#include "inferior.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+/***************Begin MY defs*********************/
+static char my_registers[REGISTER_BYTES];
+char *registers = my_registers;
+/***************End MY defs*********************/
+
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#define RF(dst, src) \
+ memcpy(&registers[REGISTER_BYTE(dst)], &src, sizeof(src))
+
+#define RS(src, dst) \
+ memcpy(&dst, &registers[REGISTER_BYTE(src)], sizeof(dst))
+
+#ifdef __i386__
+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];
+ };
+
+/* i386_register_raw_size[i] is the number of bytes of storage in the
+ actual machine representation for register i. */
+int i386_register_raw_size[MAX_NUM_REGS] = {
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 10, 10, 10, 10,
+ 10, 10, 10, 10,
+ 4, 4, 4, 4,
+ 4, 4, 4, 4,
+ 16, 16, 16, 16,
+ 16, 16, 16, 16,
+ 4
+};
+
+int i386_register_byte[MAX_NUM_REGS];
+
+static void
+initialize_arch (void)
+{
+ /* Initialize the table saying where each register starts in the
+ register file. */
+ {
+ int i, offset;
+
+ offset = 0;
+ for (i = 0; i < MAX_NUM_REGS; i++)
+ {
+ i386_register_byte[i] = offset;
+ offset += i386_register_raw_size[i];
+ }
+ }
+}
+#endif /* !__i386__ */
+
+#ifdef __m68k__
+static void
+initialize_arch (void)
+{
+}
+#endif /* !__m68k__ */
+
+#ifdef __ns32k__
+static void
+initialize_arch (void)
+{
+}
+#endif /* !__ns32k__ */
+
+#ifdef __powerpc__
+#include "ppc-tdep.h"
+
+static void
+initialize_arch (void)
+{
+}
+#endif /* !__powerpc__ */
+
+
+/* Start an inferior process and returns its pid.
+ ALLARGS is a vector of program-name and args. */
+
+int
+create_inferior (char *program, char **allargs)
+{
+ int pid;
+
+ pid = fork ();
+ if (pid < 0)
+ perror_with_name ("fork");
+
+ if (pid == 0)
+ {
+ ptrace (PT_TRACE_ME, 0, 0, 0);
+
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+ errno < sys_nerr ? sys_errlist[errno] : "unknown error");
+ fflush (stderr);
+ _exit (0177);
+ }
+
+ return pid;
+}
+
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
+}
+
+/* Kill the inferior process. Make us have no inferior. */
+
+void
+kill_inferior (void)
+{
+ if (inferior_pid == 0)
+ return;
+ ptrace (PT_KILL, inferior_pid, 0, 0);
+ wait (0);
+ /*************inferior_died ();****VK**************/
+}
+
+/* Return nonzero if the given thread is still alive. */
+int
+mythread_alive (int pid)
+{
+ return 1;
+}
+
+/* Wait for process, returns status */
+
+unsigned char
+mywait (char *status)
+{
+ int pid;
+ int w;
+
+ enable_async_io ();
+ pid = waitpid (inferior_pid, &w, 0);
+ disable_async_io ();
+ if (pid != inferior_pid)
+ perror_with_name ("wait");
+
+ if (WIFEXITED (w))
+ {
+ fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
+ *status = 'W';
+ return ((unsigned char) WEXITSTATUS (w));
+ }
+ else if (!WIFSTOPPED (w))
+ {
+ fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
+ *status = 'X';
+ return ((unsigned char) WTERMSIG (w));
+ }
+
+ fetch_inferior_registers (0);
+
+ *status = 'T';
+ return ((unsigned char) WSTOPSIG (w));
+}
+
+/* Resume execution of the inferior process.
+ If STEP is nonzero, single-step it.
+ If SIGNAL is nonzero, give it that signal. */
+
+void
+myresume (int step, int signal)
+{
+ errno = 0;
+ ptrace (step ? PT_STEP : PT_CONTINUE, inferior_pid,
+ (PTRACE_ARG3_TYPE) 1, signal);
+ if (errno)
+ perror_with_name ("ptrace");
+}
+
+
+#ifdef __i386__
+/* Fetch one or more registers from the inferior. REGNO == -1 to get
+ them all. We actually fetch more than requested, when convenient,
+ marking them as valid so we won't fetch them again. */
+
+void
+fetch_inferior_registers (int ignored)
+{
+ struct reg inferior_registers;
+ struct env387 inferior_fp_registers;
+
+ ptrace (PT_GETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ ptrace (PT_GETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+
+ RF ( 0, inferior_registers.r_eax);
+ RF ( 1, inferior_registers.r_ecx);
+ RF ( 2, inferior_registers.r_edx);
+ RF ( 3, inferior_registers.r_ebx);
+ RF ( 4, inferior_registers.r_esp);
+ RF ( 5, inferior_registers.r_ebp);
+ RF ( 6, inferior_registers.r_esi);
+ RF ( 7, inferior_registers.r_edi);
+ RF ( 8, inferior_registers.r_eip);
+ RF ( 9, inferior_registers.r_eflags);
+ RF (10, inferior_registers.r_cs);
+ RF (11, inferior_registers.r_ss);
+ RF (12, inferior_registers.r_ds);
+ RF (13, inferior_registers.r_es);
+ RF (14, inferior_registers.r_fs);
+ RF (15, inferior_registers.r_gs);
+
+ RF (FP0_REGNUM, inferior_fp_registers.regs[0]);
+ RF (FP0_REGNUM + 1, inferior_fp_registers.regs[1]);
+ RF (FP0_REGNUM + 2, inferior_fp_registers.regs[2]);
+ RF (FP0_REGNUM + 3, inferior_fp_registers.regs[3]);
+ RF (FP0_REGNUM + 4, inferior_fp_registers.regs[4]);
+ RF (FP0_REGNUM + 5, inferior_fp_registers.regs[5]);
+ RF (FP0_REGNUM + 6, inferior_fp_registers.regs[6]);
+ RF (FP0_REGNUM + 7, inferior_fp_registers.regs[7]);
+
+ RF (FCTRL_REGNUM, inferior_fp_registers.control);
+ RF (FSTAT_REGNUM, inferior_fp_registers.status);
+ RF (FTAG_REGNUM, inferior_fp_registers.tag);
+ RF (FCS_REGNUM, inferior_fp_registers.code_seg);
+ RF (FCOFF_REGNUM, inferior_fp_registers.eip);
+ RF (FDS_REGNUM, inferior_fp_registers.operand_seg);
+ RF (FDOFF_REGNUM, inferior_fp_registers.operand);
+ RF (FOP_REGNUM, inferior_fp_registers.opcode);
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+store_inferior_registers (int ignored)
+{
+ struct reg inferior_registers;
+ struct env387 inferior_fp_registers;
+
+ RS ( 0, inferior_registers.r_eax);
+ RS ( 1, inferior_registers.r_ecx);
+ RS ( 2, inferior_registers.r_edx);
+ RS ( 3, inferior_registers.r_ebx);
+ RS ( 4, inferior_registers.r_esp);
+ RS ( 5, inferior_registers.r_ebp);
+ RS ( 6, inferior_registers.r_esi);
+ RS ( 7, inferior_registers.r_edi);
+ RS ( 8, inferior_registers.r_eip);
+ RS ( 9, inferior_registers.r_eflags);
+ RS (10, inferior_registers.r_cs);
+ RS (11, inferior_registers.r_ss);
+ RS (12, inferior_registers.r_ds);
+ RS (13, inferior_registers.r_es);
+ RS (14, inferior_registers.r_fs);
+ RS (15, inferior_registers.r_gs);
+
+ RS (FP0_REGNUM, inferior_fp_registers.regs[0]);
+ RS (FP0_REGNUM + 1, inferior_fp_registers.regs[1]);
+ RS (FP0_REGNUM + 2, inferior_fp_registers.regs[2]);
+ RS (FP0_REGNUM + 3, inferior_fp_registers.regs[3]);
+ RS (FP0_REGNUM + 4, inferior_fp_registers.regs[4]);
+ RS (FP0_REGNUM + 5, inferior_fp_registers.regs[5]);
+ RS (FP0_REGNUM + 6, inferior_fp_registers.regs[6]);
+ RS (FP0_REGNUM + 7, inferior_fp_registers.regs[7]);
+
+ RS (FCTRL_REGNUM, inferior_fp_registers.control);
+ RS (FSTAT_REGNUM, inferior_fp_registers.status);
+ RS (FTAG_REGNUM, inferior_fp_registers.tag);
+ RS (FCS_REGNUM, inferior_fp_registers.code_seg);
+ RS (FCOFF_REGNUM, inferior_fp_registers.eip);
+ RS (FDS_REGNUM, inferior_fp_registers.operand_seg);
+ RS (FDOFF_REGNUM, inferior_fp_registers.operand);
+ RS (FOP_REGNUM, inferior_fp_registers.opcode);
+
+ ptrace (PT_SETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ ptrace (PT_SETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+}
+#endif /* !__i386__ */
+
+#ifdef __m68k__
+/* Fetch one or more registers from the inferior. REGNO == -1 to get
+ them all. We actually fetch more than requested, when convenient,
+ marking them as valid so we won't fetch them again. */
+
+void
+fetch_inferior_registers (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_GETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+ memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
+ sizeof (inferior_fp_registers));
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+store_inferior_registers (int regno)
+{
+ struct 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);
+
+ 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);
+}
+#endif /* !__m68k__ */
+
+
+#ifdef __ns32k__
+/* Fetch one or more registers from the inferior. REGNO == -1 to get
+ them all. We actually fetch more than requested, when convenient,
+ marking them as valid so we won't fetch them again. */
+
+void
+fetch_inferior_registers (int regno)
+{
+ struct reg inferior_registers;
+ struct fpreg inferior_fpregisters;
+
+ ptrace (PT_GETREGS, inferior_pid,
+ (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]);
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+store_inferior_registers (int regno)
+{
+ struct 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]);
+
+ ptrace (PT_SETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+ ptrace (PT_SETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0);
+
+}
+#endif /* !__ns32k__ */
+
+#ifdef __powerpc__
+/* Fetch one or more registers from the inferior. REGNO == -1 to get
+ them all. We actually fetch more than requested, when convenient,
+ marking them as valid so we won't fetch them again. */
+
+void
+fetch_inferior_registers (int regno)
+{
+ struct reg inferior_registers;
+#ifdef PT_GETFPREGS
+ struct fpreg inferior_fp_registers;
+#endif
+ int i;
+
+ ptrace (PT_GETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+ for (i = 0; i < 32; i++)
+ RF (i, inferior_registers.fixreg[i]);
+ RF (PPC_LR_REGNUM, inferior_registers.lr);
+ RF (PPC_CR_REGNUM, inferior_registers.cr);
+ RF (PPC_XER_REGNUM, inferior_registers.xer);
+ RF (PPC_CTR_REGNUM, inferior_registers.ctr);
+ RF (PC_REGNUM, inferior_registers.pc);
+
+#ifdef PT_GETFPREGS
+ ptrace (PT_GETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+ for (i = 0; i < 32; i++)
+ RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
+#endif
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+store_inferior_registers (int regno)
+{
+ struct reg inferior_registers;
+#ifdef PT_SETFPREGS
+ struct fpreg inferior_fp_registers;
+#endif
+ int i;
+
+ for (i = 0; i < 32; i++)
+ RS (i, inferior_registers.fixreg[i]);
+ RS (PPC_LR_REGNUM, inferior_registers.lr);
+ RS (PPC_CR_REGNUM, inferior_registers.cr);
+ RS (PPC_XER_REGNUM, inferior_registers.xer);
+ RS (PPC_CTR_REGNUM, inferior_registers.ctr);
+ RS (PC_REGNUM, inferior_registers.pc);
+ ptrace (PT_SETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+
+#ifdef PT_SETFPREGS
+ for (i = 0; i < 32; i++)
+ RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
+ ptrace (PT_SETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+#endif
+}
+#endif /* !__powerpc__ */
+
+/* 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
+ not write the data that I specified. I cannot understand where
+ it got the data that it actually did write. */
+
+/* Copy LEN bytes from inferior's memory starting at MEMADDR
+ to debugger memory starting at MYADDR. */
+
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+ /* Allocate buffer of that many longwords. */
+ register int *buffer = (int *) alloca (count * sizeof (int));
+
+ /* Read all the longwords */
+ for (i = 0; i < count; i++, addr += sizeof (int))
+ {
+ buffer[i] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
+ }
+
+ /* Copy appropriate bytes out of the buffer. */
+ memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
+}
+
+/* Copy LEN bytes of data from debugger memory at MYADDR
+ to inferior's memory at MEMADDR.
+ On failure (cannot write the inferior)
+ returns the value of errno. */
+
+int
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+ /* Allocate buffer of that many longwords. */
+ register int *buffer = (int *) alloca (count * sizeof (int));
+ extern int errno;
+
+ /* Fill start and end extra bytes of buffer with existing memory data. */
+
+ buffer[0] = ptrace (PT_READ_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
+
+ if (count > 1)
+ {
+ buffer[count - 1]
+ = ptrace (PT_READ_D, inferior_pid,
+ (PTRACE_ARG3_TYPE) addr + (count - 1) * sizeof (int), 0);
+ }
+
+ /* Copy data to be written over corresponding part of buffer */
+
+ memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
+
+ /* Write the entire buffer. */
+
+ for (i = 0; i < count; i++, addr += sizeof (int))
+ {
+ errno = 0;
+ ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]);
+ if (errno)
+ return errno;
+ }
+
+ return 0;
+}
+
+void
+initialize_low (void)
+{
+ initialize_arch ();
+}
diff --git a/contrib/gdb/gdb/gdbserver/low-sim.c b/contrib/gdb/gdb/gdbserver/low-sim.c
index 8ad6e91..86a0406 100644
--- a/contrib/gdb/gdb/gdbserver/low-sim.c
+++ b/contrib/gdb/gdb/gdbserver/low-sim.c
@@ -1,35 +1,37 @@
/* Low level interface to simulators, for the remote server for GDB.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 "bfd.h"
+#include "callback.h" /* GDB simulator callback interface */
+#include "remote-sim.h" /* GDB simulator interface */
extern int remote_debug;
extern host_callback default_callback; /* in sim/common/callback.c */
-char registers[REGISTER_BYTES] __attribute__ ((aligned));
+static char my_registers[REGISTER_BYTES] __attribute__ ((aligned));
+char * registers = my_registers;
-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. */
@@ -39,14 +41,13 @@ static SIM_DESC gdbsim_desc = 0;
does not support loading itself. */
static void
-generic_load (loadfile_bfd)
- bfd *loadfile_bfd;
+mygeneric_load (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,29 +76,25 @@ 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
-create_inferior (program, argv)
- char *program;
- char **argv;
+create_inferior (char *program, char **argv)
{
bfd *abfd;
int pid = 0;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
char **new_argv;
int nargs;
-#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);
}
@@ -109,7 +106,6 @@ create_inferior (program, argv)
exit (1);
}
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
/* Add "-E big" or "-E little" to the argument list depending on the
endianness of the program to be loaded. */
for (nargs = 0; argv[nargs] != NULL; nargs++) /* count the args */
@@ -121,7 +117,6 @@ create_inferior (program, argv)
new_argv[nargs + 1] = bfd_big_endian (abfd) ? "big" : "little";
new_argv[nargs + 2] = NULL;
argv = new_argv;
-#endif
/* Create an instance of the simulator. */
default_callback.init (&default_callback);
@@ -132,7 +127,7 @@ create_inferior (program, argv)
/* Load the program into the simulator. */
if (abfd)
if (sim_load (gdbsim_desc, program, NULL, 0) == SIM_RC_FAIL)
- generic_load (abfd);
+ mygeneric_load (abfd);
/* Create an inferior process in the simulator. This initializes SP. */
sim_create_inferior (gdbsim_desc, abfd, argv, /* env */ NULL);
@@ -140,10 +135,17 @@ create_inferior (program, argv)
return pid;
}
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
+}
+
/* Kill the inferior process. Make us have no inferior. */
void
-kill_inferior ()
+kill_inferior (void)
{
sim_close (gdbsim_desc, 0);
default_callback.shutdown (&default_callback);
@@ -152,8 +154,7 @@ kill_inferior ()
/* Fetch one register. */
static void
-fetch_register (regno)
- int regno;
+fetch_register (int regno)
{
sim_fetch_register (gdbsim_desc, regno, &registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
@@ -162,11 +163,10 @@ fetch_register (regno)
/* Fetch all registers, or just one, from the child process. */
void
-fetch_inferior_registers (regno)
- int regno;
+fetch_inferior_registers (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);
@@ -177,10 +177,9 @@ fetch_inferior_registers (regno)
Otherwise, REGNO specifies which register (so we can save time). */
void
-store_inferior_registers (regno)
- int regno;
+store_inferior_registers (int regno)
{
- if (regno == -1)
+ if (regno == -1)
{
for (regno = 0; regno < NUM_REGS; regno++)
store_inferior_registers (regno);
@@ -192,8 +191,7 @@ store_inferior_registers (regno)
/* Return nonzero if the given thread is still alive. */
int
-mythread_alive (pid)
- int pid;
+mythread_alive (int pid)
{
return 1;
}
@@ -201,8 +199,7 @@ mythread_alive (pid)
/* Wait for process, returns status */
unsigned char
-mywait (status)
- char *status;
+mywait (char *status)
{
int sigrc;
enum sim_stop reason;
@@ -224,7 +221,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);
@@ -238,9 +235,7 @@ mywait (status)
If SIGNAL is nonzero, give it that signal. */
void
-myresume (step, signo)
- int step;
- int signo;
+myresume (int step, int signo)
{
/* Should be using target_signal_to_host() or signal numbers in target.h
to convert GDB signal number to target signal number. */
@@ -251,10 +246,7 @@ myresume (step, signo)
to debugger memory starting at MYADDR. */
void
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
sim_read (gdbsim_desc, memaddr, myaddr, len);
}
@@ -265,25 +257,13 @@ read_inferior_memory (memaddr, myaddr, len)
returns the value of errno. */
int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+write_inferior_memory (CORE_ADDR memaddr, 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;
}
-#if 0
void
-initialize ()
+initialize_low (void)
{
- inferior_pid = 0;
}
-
-int
-have_inferior_p ()
-{
- return inferior_pid != 0;
-}
-#endif
diff --git a/contrib/gdb/gdb/gdbserver/low-sparc.c b/contrib/gdb/gdb/gdbserver/low-sparc.c
index ddffaec..4b03140 100644
--- a/contrib/gdb/gdb/gdbserver/low-sparc.c
+++ b/contrib/gdb/gdb/gdbserver/low-sparc.c
@@ -1,23 +1,25 @@
/* Low level interface to ptrace, for the remote server for GDB.
- Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 "server.h"
#include <sys/wait.h>
#include "frame.h"
#include "inferior.h"
@@ -35,14 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <fcntl.h>
/***************Begin MY defs*********************/
-int quit_flag = 0;
-char registers[REGISTER_BYTES];
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-
-char buf2[MAX_REGISTER_RAW_SIZE];
+static char my_registers[REGISTER_BYTES];
+char *registers = my_registers;
/***************End MY defs*********************/
#include <sys/ptrace.h>
@@ -50,20 +46,13 @@ char buf2[MAX_REGISTER_RAW_SIZE];
extern int sys_nerr;
extern char **sys_errlist;
-extern char **environ;
extern int errno;
-extern int inferior_pid;
-void quit (), perror_with_name ();
-int query ();
/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args.
- ENV is the environment vector to pass. */
+ ALLARGS is a vector of program-name and args. */
int
-create_inferior (program, allargs)
- char *program;
- char **allargs;
+create_inferior (char *program, char **allargs)
{
int pid;
@@ -86,22 +75,28 @@ create_inferior (program, allargs)
return pid;
}
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
+}
+
/* Kill the inferior process. Make us have no inferior. */
void
-kill_inferior ()
+kill_inferior (void)
{
if (inferior_pid == 0)
return;
ptrace (8, inferior_pid, 0, 0);
wait (0);
- /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
}
/* Return nonzero if the given thread is still alive. */
int
-mythread_alive (pid)
- int pid;
+mythread_alive (int pid)
{
return 1;
}
@@ -109,13 +104,14 @@ mythread_alive (pid)
/* Wait for process, returns status */
unsigned char
-mywait (status)
- char *status;
+mywait (char *status)
{
int pid;
union wait w;
- pid = wait (&w);
+ enable_async_io ();
+ pid = waitpid (inferior_pid, &w, 0);
+ disable_async_io ();
if (pid != inferior_pid)
perror_with_name ("wait");
@@ -143,9 +139,7 @@ mywait (status)
If SIGNAL is nonzero, give it that signal. */
void
-myresume (step, signal)
- int step;
- int signal;
+myresume (int step, int signal)
{
errno = 0;
ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal);
@@ -158,8 +152,7 @@ myresume (step, signal)
marking them as valid so we won't fetch them again. */
void
-fetch_inferior_registers (ignored)
- int ignored;
+fetch_inferior_registers (int ignored)
{
struct regs inferior_registers;
struct fp_status inferior_fp_registers;
@@ -172,32 +165,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.
@@ -205,38 +198,37 @@ fetch_inferior_registers (ignored)
Otherwise, REGNO specifies which register (so we can save time). */
void
-store_inferior_registers (ignored)
- int ignored;
+store_inferior_registers (int 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
@@ -248,14 +240,12 @@ store_inferior_registers (ignored)
/* Copy LEN bytes from inferior's memory starting at MEMADDR
to debugger memory starting at MYADDR. */
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -278,14 +268,11 @@ read_inferior_memory (memaddr, myaddr, len)
returns the value of errno. */
int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -322,13 +309,6 @@ write_inferior_memory (memaddr, myaddr, len)
}
void
-initialize ()
-{
- inferior_pid = 0;
-}
-
-int
-have_inferior_p ()
+initialize_low (void)
{
- return inferior_pid != 0;
}
diff --git a/contrib/gdb/gdb/gdbserver/low-sun3.c b/contrib/gdb/gdb/gdbserver/low-sun3.c
index c84b79f..ccaded8 100644
--- a/contrib/gdb/gdb/gdbserver/low-sun3.c
+++ b/contrib/gdb/gdb/gdbserver/low-sun3.c
@@ -1,23 +1,25 @@
/* Low level interface to ptrace, for the remote server for GDB.
- Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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 "server.h"
#include "<sys/wait.h>"
#include "frame.h"
#include "inferior.h"
@@ -32,14 +34,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <fcntl.h>
/***************Begin MY defs*********************/
-int quit_flag = 0;
-char registers[REGISTER_BYTES];
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-
-char buf2[MAX_REGISTER_RAW_SIZE];
+static char my_registers[REGISTER_BYTES];
+char *registers = my_registers;
/***************End MY defs*********************/
#include <sys/ptrace.h>
@@ -47,20 +43,13 @@ char buf2[MAX_REGISTER_RAW_SIZE];
extern int sys_nerr;
extern char **sys_errlist;
-extern char **environ;
extern int errno;
-extern int inferior_pid;
-void quit (), perror_with_name ();
-int query ();
/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args.
- ENV is the environment vector to pass. */
+ ALLARGS is a vector of program-name and args. */
int
-create_inferior (program, allargs)
- char *program;
- char **allargs;
+create_inferior (char *program, char **allargs)
{
int pid;
@@ -83,22 +72,28 @@ create_inferior (program, allargs)
return pid;
}
+/* Attaching is not supported. */
+int
+myattach (int pid)
+{
+ return -1;
+}
+
/* Kill the inferior process. Make us have no inferior. */
void
-kill_inferior ()
+kill_inferior (void)
{
if (inferior_pid == 0)
return;
ptrace (8, inferior_pid, 0, 0);
wait (0);
- /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
}
/* Return nonzero if the given thread is still alive. */
int
-mythread_alive (pid)
- int pid;
+mythread_alive (int pid)
{
return 1;
}
@@ -106,8 +101,7 @@ mythread_alive (pid)
/* Wait for process, returns status */
unsigned char
-mywait (status)
- char *status;
+mywait (char *status)
{
int pid;
union wait w;
@@ -140,9 +134,7 @@ mywait (status)
If SIGNAL is nonzero, give it that signal. */
void
-myresume (step, signal)
- int step;
- int signal;
+myresume (int step, int signal)
{
errno = 0;
ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal);
@@ -155,32 +147,31 @@ myresume (step, signal)
marking them as valid so we won't fetch them again. */
void
-fetch_inferior_registers (ignored)
- int ignored;
+fetch_inferior_registers (int ignored)
{
struct regs inferior_registers;
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.
@@ -188,8 +179,7 @@ fetch_inferior_registers (ignored)
Otherwise, REGNO specifies which register (so we can save time). */
void
-store_inferior_registers (ignored)
- int ignored;
+store_inferior_registers (int ignored)
{
struct regs inferior_registers;
struct fp_status inferior_fp_registers;
@@ -200,8 +190,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 +201,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
}
@@ -227,14 +217,12 @@ store_inferior_registers (ignored)
/* Copy LEN bytes from inferior's memory starting at MEMADDR
to debugger memory starting at MYADDR. */
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -257,14 +245,11 @@ read_inferior_memory (memaddr, myaddr, len)
returns the value of errno. */
int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
@@ -301,13 +286,6 @@ write_inferior_memory (memaddr, myaddr, len)
}
void
-initialize ()
-{
- inferior_pid = 0;
-}
-
-int
-have_inferior_p ()
+initialize_low (void)
{
- return inferior_pid != 0;
}
diff --git a/contrib/gdb/gdb/gdbserver/regcache.c b/contrib/gdb/gdb/gdbserver/regcache.c
new file mode 100644
index 0000000..bec20bb
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/regcache.c
@@ -0,0 +1,147 @@
+/* Register support routines for the remote server for GDB.
+ Copyright 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "server.h"
+#include "regdef.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+static char *registers;
+static int register_bytes;
+
+static struct reg *reg_defs;
+static int num_registers;
+
+const char **gdbserver_expedite_regs;
+
+int
+registers_length (void)
+{
+ return 2 * register_bytes;
+}
+
+void
+set_register_cache (struct reg *regs, int n)
+{
+ int offset, i;
+
+ reg_defs = regs;
+ num_registers = n;
+
+ offset = 0;
+ for (i = 0; i < n; i++)
+ {
+ regs[i].offset = offset;
+ offset += regs[i].size;
+ }
+
+ register_bytes = offset / 8;
+ registers = malloc (offset / 8);
+ if (!registers)
+ fatal ("Could not allocate register cache.");
+}
+
+void
+registers_to_string (char *buf)
+{
+ convert_int_to_ascii (registers, buf, register_bytes);
+}
+
+void
+registers_from_string (char *buf)
+{
+ int len = strlen (buf);
+
+ if (len != register_bytes * 2)
+ {
+ warning ("Wrong sized register packet (expected %d bytes, got %d)", 2*register_bytes, len);
+ if (len > register_bytes * 2)
+ len = register_bytes * 2;
+ }
+ convert_ascii_to_int (buf, registers, len / 2);
+}
+
+struct reg *
+find_register_by_name (const char *name)
+{
+ int i;
+
+ for (i = 0; i < num_registers; i++)
+ if (!strcmp (name, reg_defs[i].name))
+ return &reg_defs[i];
+ fatal ("Unknown register %s requested", name);
+ return 0;
+}
+
+int
+find_regno (const char *name)
+{
+ int i;
+
+ for (i = 0; i < num_registers; i++)
+ if (!strcmp (name, reg_defs[i].name))
+ return i;
+ fatal ("Unknown register %s requested", name);
+ return -1;
+}
+
+struct reg *
+find_register_by_number (int n)
+{
+ return &reg_defs[n];
+}
+
+int
+register_size (int n)
+{
+ return reg_defs[n].size / 8;
+}
+
+char *
+register_data (int n)
+{
+ return registers + (reg_defs[n].offset / 8);
+}
+
+void
+supply_register (int n, const char *buf)
+{
+ memcpy (register_data (n), buf, register_size (n));
+}
+
+void
+supply_register_by_name (const char *name, const char *buf)
+{
+ supply_register (find_regno (name), buf);
+}
+
+void
+collect_register (int n, char *buf)
+{
+ memcpy (buf, register_data (n), register_size (n));
+}
+
+void
+collect_register_by_name (const char *name, char *buf)
+{
+ collect_register (find_regno (name), buf);
+}
diff --git a/contrib/gdb/gdb/gdbserver/regcache.h b/contrib/gdb/gdb/gdbserver/regcache.h
new file mode 100644
index 0000000..07195b3
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/regcache.h
@@ -0,0 +1,49 @@
+/* Register support routines for the remote server for GDB.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef REGCACHE_H
+#define REGCACHE_H
+
+/* Convert all registers to a string in the currently specified remote
+ format. */
+
+void registers_to_string (char *buf);
+
+/* Convert a string to register values and fill our register cache. */
+
+void registers_from_string (char *buf);
+
+/* Return the size in bytes of a string-encoded register packet. */
+
+int registers_length (void);
+
+/* Return a pointer to the description of register ``n''. */
+
+struct reg *find_register_by_number (int n);
+
+char *register_data (int n);
+
+int register_size (int n);
+
+int find_regno (const char *name);
+
+extern const char **gdbserver_expedite_regs;
+
+#endif /* REGCACHE_H */
diff --git a/contrib/gdb/gdb/gdbserver/remote-utils.c b/contrib/gdb/gdb/gdbserver/remote-utils.c
index 0a7e0fb..adf5299 100644
--- a/contrib/gdb/gdb/gdbserver/remote-utils.c
+++ b/contrib/gdb/gdb/gdbserver/remote-utils.c
@@ -1,21 +1,24 @@
/* Remote utility routines for the remote server for GDB.
- Copyright (C) 1986, 1989, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -30,8 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <sys/ioctl.h>
#include <signal.h>
#include <fcntl.h>
+#include <sys/time.h>
+#include <unistd.h>
int remote_debug = 0;
+struct ui_file *gdb_stdlog;
static int remote_desc;
@@ -39,11 +45,10 @@ static int remote_desc;
NAME is the filename used for communication. */
void
-remote_open (name)
- char *name;
+remote_open (char *name)
{
int save_fcntl_flags;
-
+
if (!strchr (name, ':'))
{
remote_desc = open (name, O_RDWR);
@@ -53,17 +58,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[VMIN] = 1;
termios.c_cc[VTIME] = 0;
- tcsetattr(remote_desc, TCSANOW, &termios);
+ tcsetattr (remote_desc, TCSANOW, &termios);
}
#endif
@@ -75,9 +80,9 @@ 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[VMIN] = 1;
termio.c_cc[VTIME] = 0;
ioctl (remote_desc, TCSETA, &termio);
@@ -94,7 +99,7 @@ remote_open (name)
}
#endif
-
+ fprintf (stderr, "Remote debugging using %s\n", name);
}
else
{
@@ -102,7 +107,6 @@ remote_open (name)
int port;
struct sockaddr_in sockaddr;
int tmp;
- struct protoent *protoent;
int tmp_desc;
port_str = strchr (name, ':');
@@ -115,52 +119,54 @@ 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");
- protoent = getprotobyname ("tcp");
- if (!protoent)
- perror_with_name ("getprotobyname");
-
/* 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));
+ setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
+ (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. */
+
+ /* Convert IP address to string. */
+ fprintf (stderr, "Remote debugging from host %s\n",
+ inet_ntoa (sockaddr.sin_addr));
}
#if defined(F_SETFL) && defined (FASYNC)
save_fcntl_flags = fcntl (remote_desc, F_GETFL, 0);
fcntl (remote_desc, F_SETFL, save_fcntl_flags | FASYNC);
+#if defined (F_SETOWN)
+ fcntl (remote_desc, F_SETOWN, getpid ());
+#endif
+#endif
disable_async_io ();
-#endif /* FASYNC */
- fprintf (stderr, "Remote debugging using %s\n", name);
}
void
-remote_close()
+remote_close (void)
{
close (remote_desc);
}
@@ -168,8 +174,7 @@ remote_close()
/* Convert hex digit A to a number. */
static int
-fromhex (a)
- int a;
+fromhex (int a)
{
if (a >= '0' && a <= '9')
return a - '0';
@@ -177,13 +182,13 @@ fromhex (a)
return a - 'a' + 10;
else
error ("Reply contains invalid hex digit");
+ return 0;
}
/* Convert number NIB to a hex digit. */
static int
-tohex (nib)
- int nib;
+tohex (int nib)
{
if (nib < 10)
return '0' + nib;
@@ -195,16 +200,17 @@ tohex (nib)
The data of the packet is in BUF. Returns >= 0 on success, -1 otherwise. */
int
-putpkt (buf)
- char *buf;
+putpkt (char *buf)
{
int i;
unsigned char csum = 0;
- char buf2[2000];
+ char *buf2;
char buf3[1];
int cnt = strlen (buf);
char *p;
+ buf2 = malloc (PBUFSIZ);
+
/* Copy the packet into buffer BUF2, encapsulating it
and giving it a checksum. */
@@ -246,11 +252,13 @@ putpkt (buf)
else
perror ("putpkt(read)");
+ free (buf2);
return -1;
}
}
while (buf3[0] != '+');
+ free (buf2);
return 1; /* Success! */
}
@@ -260,30 +268,41 @@ putpkt (buf)
will cause us to send a SIGINT to the child. */
static void
-input_interrupt()
+input_interrupt (int unused)
{
- int cc;
- char c;
+ fd_set readset;
+ struct timeval immediate = { 0, 0 };
- cc = read (remote_desc, &c, 1);
+ /* Protect against spurious interrupts. This has been observed to
+ be a problem under NetBSD 1.4 and 1.5. */
- if (cc != 1 || c != '\003')
+ FD_ZERO (&readset);
+ FD_SET (remote_desc, &readset);
+ if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0)
{
- fprintf(stderr, "input_interrupt, cc = %d c = %d\n", cc, c);
- return;
- }
+ int cc;
+ char c;
+
+ cc = read (remote_desc, &c, 1);
- kill (inferior_pid, SIGINT);
+ if (cc != 1 || c != '\003')
+ {
+ fprintf (stderr, "input_interrupt, cc = %d c = %d\n", cc, c);
+ return;
+ }
+
+ kill (inferior_pid, SIGINT);
+ }
}
void
-enable_async_io()
+enable_async_io (void)
{
signal (SIGIO, input_interrupt);
}
void
-disable_async_io()
+disable_async_io (void)
{
signal (SIGIO, SIG_IGN);
}
@@ -291,7 +310,7 @@ disable_async_io()
/* Returns next char from remote GDB. -1 if error. */
static int
-readchar ()
+readchar (void)
{
static char buf[BUFSIZ];
static int bufcnt = 0;
@@ -321,8 +340,7 @@ readchar ()
and store it in BUF. Returns length of packet, or negative if error. */
int
-getpkt (buf)
- char *buf;
+getpkt (char *buf)
{
char *bp;
unsigned char csum, c1, c2;
@@ -358,7 +376,7 @@ getpkt (buf)
c1 = fromhex (readchar ());
c2 = fromhex (readchar ());
-
+
if (csum == (c1 << 4) + c2)
break;
@@ -378,8 +396,7 @@ getpkt (buf)
}
void
-write_ok (buf)
- char *buf;
+write_ok (char *buf)
{
buf[0] = 'O';
buf[1] = 'K';
@@ -387,8 +404,7 @@ write_ok (buf)
}
void
-write_enn (buf)
- char *buf;
+write_enn (char *buf)
{
buf[0] = 'E';
buf[1] = 'N';
@@ -397,9 +413,7 @@ write_enn (buf)
}
void
-convert_int_to_ascii (from, to, n)
- char *from, *to;
- int n;
+convert_int_to_ascii (char *from, char *to, int n)
{
int nib;
char ch;
@@ -416,9 +430,7 @@ convert_int_to_ascii (from, to, n)
void
-convert_ascii_to_int (from, to, n)
- char *from, *to;
- int n;
+convert_ascii_to_int (char *from, char *to, int n)
{
int nib1, nib2;
while (n--)
@@ -430,17 +442,18 @@ convert_ascii_to_int (from, to, n)
}
static char *
-outreg(regno, buf)
- int regno;
- char *buf;
+outreg (int regno, char *buf)
{
- extern char registers[];
- int regsize = REGISTER_RAW_SIZE (regno);
+ int regsize = register_size (regno);
- *buf++ = tohex (regno >> 4);
+ if ((regno >> 12) != 0)
+ *buf++ = tohex ((regno >> 12) & 0xf);
+ if ((regno >> 8) != 0)
+ *buf++ = tohex ((regno >> 8) & 0xf);
+ *buf++ = tohex ((regno >> 4) & 0xf);
*buf++ = tohex (regno & 0xf);
*buf++ = ':';
- convert_int_to_ascii (&registers[REGISTER_BYTE (regno)], buf, regsize);
+ convert_int_to_ascii (register_data (regno), buf, regsize);
buf += 2 * regsize;
*buf++ = ';';
@@ -448,35 +461,27 @@ outreg(regno, buf)
}
void
-prepare_resume_reply (buf, status, signo)
- char *buf;
- char status;
- unsigned char signo;
+prepare_resume_reply (char *buf, char status, unsigned char signo)
{
- int nib;
+ int nib, sig;
*buf++ = status;
- /* FIXME! Should be converting this signal number (numbered
- according to the signal numbering of the system we are running on)
- to the signal numbers used by the gdb protocol (see enum target_signal
- in gdb/target.h). */
- nib = ((signo & 0xf0) >> 4);
+ sig = (int)target_signal_from_host (signo);
+
+ nib = ((sig & 0xf0) >> 4);
*buf++ = tohex (nib);
- nib = signo & 0x0f;
+ nib = sig & 0x0f;
*buf++ = tohex (nib);
if (status == 'T')
{
- buf = outreg (PC_REGNUM, buf);
- buf = outreg (FP_REGNUM, buf);
- buf = outreg (SP_REGNUM, buf);
-#ifdef NPC_REGNUM
- buf = outreg (NPC_REGNUM, buf);
-#endif
-#ifdef O7_REGNUM
- buf = outreg (O7_REGNUM, buf);
-#endif
+ const char **regp = gdbserver_expedite_regs;
+ while (*regp)
+ {
+ buf = outreg (find_regno (*regp), buf);
+ regp ++;
+ }
/* If the debugger hasn't used any thread features, don't burden it with
threads. If we didn't check this, GDB 4.13 and older would choke. */
@@ -495,10 +500,7 @@ prepare_resume_reply (buf, status, signo)
}
void
-decode_m_packet (from, mem_addr_ptr, len_ptr)
- char *from;
- CORE_ADDR *mem_addr_ptr;
- unsigned int *len_ptr;
+decode_m_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr)
{
int i = 0, j = 0;
char ch;
@@ -520,10 +522,8 @@ decode_m_packet (from, mem_addr_ptr, len_ptr)
}
void
-decode_M_packet (from, mem_addr_ptr, len_ptr, to)
- char *from, *to;
- CORE_ADDR *mem_addr_ptr;
- unsigned int *len_ptr;
+decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
+ char *to)
{
int i = 0;
char ch;
diff --git a/contrib/gdb/gdb/gdbserver/server.c b/contrib/gdb/gdb/gdbserver/server.c
index cdec0f8..adaabac 100644
--- a/contrib/gdb/gdb/gdbserver/server.c
+++ b/contrib/gdb/gdb/gdbserver/server.c
@@ -1,21 +1,23 @@
/* Main code for remote server for GDB.
- Copyright (C) 1989, 1993 Free Software Foundation, Inc.
+ Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -28,9 +30,7 @@ jmp_buf toplevel;
int inferior_pid;
static unsigned char
-start_inferior (argv, statusptr)
- char *argv[];
- char *statusptr;
+start_inferior (char *argv[], char *statusptr)
{
inferior_pid = create_inferior (argv[0], argv);
fprintf (stderr, "Process %s created; pid = %d\n", argv[0], inferior_pid);
@@ -39,39 +39,89 @@ start_inferior (argv, statusptr)
return mywait (statusptr);
}
+static int
+attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
+{
+ /* myattach should return -1 if attaching is unsupported,
+ 0 if it succeeded, and call error() otherwise. */
+ if (myattach (pid) != 0)
+ return -1;
+
+ inferior_pid = pid;
+
+ *sigptr = mywait (statusptr);
+
+ return 0;
+}
+
extern int remote_debug;
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
- char ch, status, own_buf[2000], mem_buf[2000];
+ char ch, status, *own_buf, mem_buf[2000];
int i = 0;
unsigned char signal;
unsigned int len;
CORE_ADDR mem_addr;
+ int bad_attach = 0;
+ int pid = 0;
+ int attached = 0;
+ char *arg_end;
- 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 ...]");
+ if (argc >= 3 && strcmp (argv[2], "--attach") == 0)
+ {
+ if (argc == 4
+ && argv[3] != '\0'
+ && (pid = strtoul (argv[3], &arg_end, 10)) != 0
+ && *arg_end == '\0')
+ {
+ ;
+ }
+ else
+ bad_attach = 1;
+ }
+
+ if (argc < 3 || bad_attach)
+ error ("Usage:\tgdbserver tty prog [args ...]\n"
+ "\tgdbserver tty --attach pid");
- /* Wait till we are at first instruction in program. */
- signal = start_inferior (&argv[2], &status);
+ initialize_low ();
+
+ own_buf = malloc (PBUFSIZ);
+
+ if (pid == 0)
+ {
+ /* Wait till we are at first instruction in program. */
+ signal = start_inferior (&argv[2], &status);
- /* We are now stopped at the first instruction of the target process */
+ /* We are now stopped at the first instruction of the target process */
+ }
+ else
+ {
+ switch (attach_inferior (pid, &status, &signal))
+ {
+ case -1:
+ error ("Attaching not supported on this target");
+ break;
+ default:
+ attached = 1;
+ break;
+ }
+ }
while (1)
{
remote_open (argv[1]);
-restart:
- setjmp(toplevel);
+ restart:
+ setjmp (toplevel);
while (getpkt (own_buf) > 0)
{
unsigned char sig;
@@ -83,8 +133,18 @@ restart:
remote_debug = !remote_debug;
break;
case '!':
- extended_protocol = 1;
- prepare_resume_reply (own_buf, status, signal);
+ if (attached == 0)
+ {
+ extended_protocol = 1;
+ prepare_resume_reply (own_buf, status, signal);
+ }
+ else
+ {
+ /* We can not use the extended protocol if we are
+ attached, because we can not restart the running
+ program. So return unrecognized. */
+ own_buf[0] = '\0';
+ }
break;
case '?':
prepare_resume_reply (own_buf, status, signal);
@@ -109,10 +169,10 @@ restart:
}
break;
case 'g':
- convert_int_to_ascii (registers, own_buf, REGISTER_BYTES);
+ registers_to_string (own_buf);
break;
case 'G':
- convert_ascii_to_int (&own_buf[1], registers, REGISTER_BYTES);
+ registers_from_string (&own_buf[1]);
store_inferior_registers (-1);
write_ok (own_buf);
break;
@@ -130,13 +190,21 @@ restart:
break;
case 'C':
convert_ascii_to_int (own_buf + 1, &sig, 1);
- myresume (0, sig);
+ if (target_signal_to_host_p (sig))
+ signal = target_signal_to_host (sig);
+ else
+ signal = 0;
+ myresume (0, signal);
signal = mywait (&status);
prepare_resume_reply (own_buf, status, signal);
break;
case 'S':
convert_ascii_to_int (own_buf + 1, &sig, 1);
- myresume (1, sig);
+ if (target_signal_to_host_p (sig))
+ signal = target_signal_to_host (sig);
+ else
+ signal = 0;
+ myresume (1, signal);
signal = mywait (&status);
prepare_resume_reply (own_buf, status, signal);
break;
@@ -154,7 +222,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 +247,7 @@ restart:
break;
case 'R':
/* Restarting the inferior is only supported in the
- extended protocol. */
+ extended protocol. */
if (extended_protocol)
{
kill_inferior ();
@@ -201,8 +269,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 +306,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 ();
@@ -250,8 +318,8 @@ restart:
}
else
{
- fprintf (stderr, "Remote side has terminated connection. GDBserver will reopen the connection.\n");
-
+ fprintf (stderr, "Remote side has terminated connection. "
+ "GDBserver will reopen the connection.\n");
remote_close ();
}
}
diff --git a/contrib/gdb/gdb/gdbserver/server.h b/contrib/gdb/gdb/gdbserver/server.h
index e23c773..7f22041 100644
--- a/contrib/gdb/gdb/gdbserver/server.h
+++ b/contrib/gdb/gdb/gdbserver/server.h
@@ -1,41 +1,60 @@
/* Common definitions for remote server for GDB.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 1997, 1998, 1999, 2000, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 SERVER_H
+#define SERVER_H
+
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+
+/* FIXME: Both of these should be autoconf'd for. */
+#define NORETURN
+typedef long long CORE_ADDR;
+
+#include "regcache.h"
+#include "gdb/signals.h"
-#include "defs.h"
#include <setjmp.h>
/* Target-specific functions */
-int create_inferior PARAMS ((char *program, char **allargs));
-void kill_inferior PARAMS ((void));
-void fetch_inferior_registers PARAMS ((int regno));
-void store_inferior_registers PARAMS ((int regno));
-int mythread_alive PARAMS ((int pid));
-void myresume PARAMS ((int step, int signo));
-unsigned char mywait PARAMS ((char *status));
-void read_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
-int write_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+int create_inferior (char *program, char **allargs);
+void kill_inferior (void);
+void fetch_inferior_registers (int regno);
+void store_inferior_registers (int regno);
+int mythread_alive (int pid);
+void myresume (int step, int signo);
+unsigned char mywait (char *status);
+void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
+int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
int create_inferior ();
+void initialize_low ();
/* Target-specific variables */
-extern char registers[];
+extern char *registers;
/* Public variables in server.c */
@@ -49,24 +68,45 @@ extern int inferior_pid;
/* Functions from remote-utils.c */
-int putpkt PARAMS ((char *buf));
-int getpkt PARAMS ((char *buf));
-void remote_open PARAMS ((char *name));
-void remote_close PARAMS ((void));
-void write_ok PARAMS ((char *buf));
-void write_enn PARAMS ((char *buf));
-void enable_async_io PARAMS ((void));
-void disable_async_io PARAMS ((void));
-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));
+int putpkt (char *buf);
+int getpkt (char *buf);
+void remote_open (char *name);
+void remote_close (void);
+void write_ok (char *buf);
+void write_enn (char *buf);
+void enable_async_io (void);
+void disable_async_io (void);
+void convert_ascii_to_int (char *from, char *to, int n);
+void convert_int_to_ascii (char *from, char *to, int n);
+void prepare_resume_reply (char *buf, char status, unsigned char sig);
+
+void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
+ unsigned int *len_ptr);
+void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
+ unsigned int *len_ptr, char *to);
+
+/* Functions from ``signals.c''. */
+enum target_signal target_signal_from_host (int hostsig);
+int target_signal_to_host_p (enum target_signal oursig);
+int target_signal_to_host (enum target_signal oursig);
-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 */
+void perror_with_name (char *string);
+void error (const char *string,...);
+void fatal (const char *string,...);
+void warning (const char *string,...);
-/* Functions from utils.c */
-void perror_with_name PARAMS ((char *string));
+
+/* Maximum number of bytes to read/write at once. The value here
+ is chosen to fill up a packet (the headers account for the 32). */
+#define MAXBUFBYTES(N) (((N)-32)/2)
+
+/* Buffer sizes for transferring memory, registers, etc. Round up PBUFSIZ to
+ hold all the registers, at least. */
+#define PBUFSIZ ((registers_length () + 32 > 2000) \
+ ? (registers_length () + 32) \
+ : 2000)
+
+#endif /* SERVER_H */
diff --git a/contrib/gdb/gdb/gdbserver/terminal.h b/contrib/gdb/gdb/gdbserver/terminal.h
new file mode 100644
index 0000000..69b6692
--- /dev/null
+++ b/contrib/gdb/gdb/gdbserver/terminal.h
@@ -0,0 +1,51 @@
+/* Terminal interface definitions for the GDB remote server.
+ Copyright 2002, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (TERMINAL_H)
+#define TERMINAL_H 1
+
+/* Autoconf will have defined HAVE_TERMIOS_H, HAVE_TERMIO_H,
+ and HAVE_SGTTY_H for us as appropriate. */
+
+#if defined(HAVE_TERMIOS_H)
+#define HAVE_TERMIOS
+#include <termios.h>
+#else /* ! HAVE_TERMIOS_H */
+#if defined(HAVE_TERMIO_H)
+#define HAVE_TERMIO
+#include <termio.h>
+
+#undef TIOCGETP
+#define TIOCGETP TCGETA
+#undef TIOCSETN
+#define TIOCSETN TCSETA
+#undef TIOCSETP
+#define TIOCSETP TCSETAF
+#define TERMINAL struct termio
+#else /* ! HAVE_TERMIO_H; default to SGTTY. */
+#define HAVE_SGTTY
+#include <fcntl.h>
+#include <sgtty.h>
+#include <sys/ioctl.h>
+#define TERMINAL struct sgttyb
+#endif
+#endif
+
+#endif /* !defined (TERMINAL_H) */
diff --git a/contrib/gdb/gdb/gdbthread.h b/contrib/gdb/gdb/gdbthread.h
index 653dd65..da89b36 100644
--- a/contrib/gdb/gdb/gdbthread.h
+++ b/contrib/gdb/gdb/gdbthread.h
@@ -1,24 +1,26 @@
/* Multi-process/thread control defs for GDB, the GNU debugger.
- Copyright 1987, 88, 89, 90, 91, 92, 1993, 1998
-
- Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
+ Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999,
+ 2000
Free Software Foundation, Inc.
+ Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
+
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -26,96 +28,128 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* For bpstat */
#include "breakpoint.h"
-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));
-
-extern int pid_to_thread_id PARAMS ((int pid));
-
-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 *));
-
-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));
+struct thread_info
+{
+ struct thread_info *next;
+ ptid_t ptid; /* "Actual process id";
+ In fact, this may be overloaded with
+ kernel thread id, etc. */
+ int num; /* Convenient handle (GDB thread id) */
+ /* State from wait_for_inferior */
+ CORE_ADDR prev_pc;
+ 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;
+ CORE_ADDR step_sp;
+ int current_line;
+ struct symtab *current_symtab;
+ 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;
+
+ /* 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;
+
+ /* 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;
+
+ /* Private data used by the target vector implementation. */
+ struct private_thread_info *private;
+};
+
+/* Create an empty thread list, or empty the existing one. */
+extern void init_thread_list (void);
+
+/* Add a thread to the thread list.
+ Note that add_thread now returns the handle of the new thread,
+ so that the caller may initialize the private thread data. */
+extern struct thread_info *add_thread (ptid_t ptid);
+
+/* Delete an existing thread list entry. */
+extern void delete_thread (ptid_t);
+
+/* Delete a step_resume_breakpoint from the thread database. */
+extern void delete_step_resume_breakpoint (void *);
+
+/* Translate the integer thread id (GDB's homegrown id, not the system's)
+ into a "pid" (which may be overloaded with extra thread information). */
+extern ptid_t thread_id_to_pid (int);
+
+/* Translate a 'pid' (which may be overloaded with extra thread information)
+ into the integer thread id (GDB's homegrown id, not the system's). */
+extern int pid_to_thread_id (ptid_t ptid);
+
+/* Boolean test for an already-known pid (which may be overloaded with
+ extra thread information). */
+extern int in_thread_list (ptid_t ptid);
+
+/* Boolean test for an already-known thread id (GDB's homegrown id,
+ not the system's). */
+extern int valid_thread_id (int thread);
+
+/* Search function to lookup a thread by 'pid'. */
+extern struct thread_info *find_thread_pid (ptid_t ptid);
+
+/* Iterator function to call a user-provided callback function
+ once for each known thread. */
+typedef int (*thread_callback_func) (struct thread_info *, void *);
+extern struct thread_info *iterate_over_threads (thread_callback_func, void *);
+
+/* infrun context switch: save the debugger state for the given thread. */
+extern void save_infrun_state (ptid_t ptid,
+ CORE_ADDR prev_pc,
+ CORE_ADDR prev_func_start,
+ char *prev_func_name,
+ int trap_expected,
+ 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 handling_longjmp,
+ int another_trap,
+ int stepping_through_solib_after_catch,
+ bpstat stepping_through_solib_catchpoints,
+ int stepping_through_sigtramp,
+ int current_line,
+ struct symtab *current_symtab,
+ CORE_ADDR step_sp);
+
+/* infrun context switch: load the debugger state previously saved
+ for the given thread. */
+extern void load_infrun_state (ptid_t ptid,
+ CORE_ADDR *prev_pc,
+ CORE_ADDR *prev_func_start,
+ char **prev_func_name,
+ int *trap_expected,
+ 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 *handling_longjmp,
+ int *another_trap,
+ int *stepping_through_solib_affter_catch,
+ bpstat *stepping_through_solib_catchpoints,
+ int *stepping_through_sigtramp,
+ int *current_line,
+ struct symtab **current_symtab,
+ CORE_ADDR *step_sp);
/* Commands with a prefix of `thread'. */
extern struct cmd_list_element *thread_cmd_list;
-/* Support for external (remote) systems with threads (processes) */
-/* For example real time operating systems */
-
-#define OPAQUETHREADBYTES 8
-/* a 64 bit opaque identifier */
-typedef unsigned char threadref[OPAQUETHREADBYTES] ;
-/* WARNING: This threadref data structure comes from the remote O.S., libstub
- protocol encoding, and remote.c. it is not particularly changable */
-
-/* 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 */
-
-/* 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 */
-} ;
-
-/* 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
-
-/* Always initialize an instance of this structure using run time assignments */
-/* Because we are likely to add entrtries to it. */
-/* Alternatly, WE COULD ADD THESE TO THE TARGET VECTOR */
-
-struct target_thread_vector
-{
- int (*find_new_threads)PARAMS((void)) ;
- int (*get_thread_info) PARAMS((
- gdb_threadref * ref,
- int selection,
- struct gdb_ext_thread_info * info
- )) ;
- /* to_thread_alive - Already in the target vector */
- /* to_switch_thread - Done via select frame */
-} ;
-
-extern void bind_target_thread_vector PARAMS((struct target_thread_vector * vec)) ;
-
-extern struct target_thread_vector * unbind_target_thread_vector PARAMS ((void)) ;
-
-extern int target_get_thread_info PARAMS((
- gdb_threadref * ref,
- int selection,
- struct gdb_ext_thread_info * info)) ;
-
-
-#endif /* GDBTHREAD_H */
+#endif /* GDBTHREAD_H */
diff --git a/contrib/gdb/gdb/gdbtypes.c b/contrib/gdb/gdb/gdbtypes.c
index 0393462..a13847e 100644
--- a/contrib/gdb/gdb/gdbtypes.c
+++ b/contrib/gdb/gdb/gdbtypes.c
@@ -1,22 +1,24 @@
/* Support routines for manipulating internal types for GDB.
- Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -32,12 +34,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "demangle.h"
#include "complaints.h"
#include "gdbcmd.h"
+#include "wrapper.h"
+#include "cp-abi.h"
+#include "gdb_assert.h"
/* These variables point to the objects
representing the predefined C data types. */
struct type *builtin_type_void;
struct type *builtin_type_char;
+struct type *builtin_type_true_char;
struct type *builtin_type_short;
struct type *builtin_type_int;
struct type *builtin_type_long;
@@ -62,30 +68,65 @@ struct type *builtin_type_int32;
struct type *builtin_type_uint32;
struct type *builtin_type_int64;
struct type *builtin_type_uint64;
+struct type *builtin_type_int128;
+struct type *builtin_type_uint128;
struct type *builtin_type_bool;
+struct type *builtin_type_v4sf;
+struct type *builtin_type_v4si;
+struct type *builtin_type_v16qi;
+struct type *builtin_type_v8qi;
+struct type *builtin_type_v8hi;
+struct type *builtin_type_v4hi;
+struct type *builtin_type_v2si;
+struct type *builtin_type_vec128;
+struct type *builtin_type_ieee_single_big;
+struct type *builtin_type_ieee_single_little;
+struct type *builtin_type_ieee_double_big;
+struct type *builtin_type_ieee_double_little;
+struct type *builtin_type_ieee_double_littlebyte_bigword;
+struct type *builtin_type_i387_ext;
+struct type *builtin_type_m68881_ext;
+struct type *builtin_type_i960_ext;
+struct type *builtin_type_m88110_ext;
+struct type *builtin_type_m88110_harris_ext;
+struct type *builtin_type_arm_ext_big;
+struct type *builtin_type_arm_ext_littlebyte_bigword;
+struct type *builtin_type_ia64_spill_big;
+struct type *builtin_type_ia64_spill_little;
+struct type *builtin_type_ia64_quad_big;
+struct type *builtin_type_ia64_quad_little;
+struct type *builtin_type_void_data_ptr;
+struct type *builtin_type_void_func_ptr;
+struct type *builtin_type_CORE_ADDR;
+struct type *builtin_type_bfd_vma;
int opaque_type_resolution = 1;
+int overload_debug = 0;
+struct extra
+ {
+ char str[128];
+ int len;
+ }; /* maximum extension 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 *));
+static void add_name (struct extra *, char *);
+static void add_mangled_type (struct extra *, struct type *);
#if 0
-static void cfront_mangle_name PARAMS ((struct type *, int, int));
+static void cfront_mangle_name (struct type *, int, int);
#endif
-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 print_bit_vector (B_TYPE *, int);
+static void print_arg_types (struct type **, int);
+static void dump_fn_fieldlists (struct type *, int);
+static void print_cplus_stuff (struct type *, int);
+static void virtual_base_list_aux (struct type *dclass);
+
/* Alloc a new type structure and fill it with some defaults. If
OBJFILE is non-NULL, then allocate the space for the type structure
in that objfile's type_obstack. */
struct type *
-alloc_type (objfile)
- struct objfile *objfile;
+alloc_type (struct objfile *objfile)
{
register struct type *type;
@@ -93,12 +134,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));
@@ -108,7 +149,8 @@ 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 */
+ TYPE_AS_TYPE (type) = type; /* ditto */
return (type);
}
@@ -119,24 +161,22 @@ alloc_type (objfile)
We allocate new memory if needed. */
struct type *
-make_pointer_type (type, typeptr)
- struct type *type;
- struct type **typeptr;
+make_pointer_type (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. */
@@ -145,7 +185,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);
@@ -161,9 +202,11 @@ make_pointer_type (type, typeptr)
TYPE_LENGTH (ntype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
TYPE_CODE (ntype) = TYPE_CODE_PTR;
- /* pointers are unsigned */
+ /* Mark pointers as unsigned. The target converts between pointers
+ and addresses (CORE_ADDRs) using POINTER_TO_ADDRESS() and
+ ADDRESS_TO_POINTER(). */
TYPE_FLAGS (ntype) |= TYPE_FLAG_UNSIGNED;
-
+
if (!TYPE_POINTER_TYPE (type)) /* Remember it, if don't have one. */
TYPE_POINTER_TYPE (type) = ntype;
@@ -174,10 +217,9 @@ make_pointer_type (type, typeptr)
May need to construct such a type if this is the first use. */
struct type *
-lookup_pointer_type (type)
- struct type *type;
+lookup_pointer_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
@@ -186,24 +228,22 @@ lookup_pointer_type (type)
We allocate new memory if needed. */
struct type *
-make_reference_type (type, typeptr)
- struct type *type;
- struct type **typeptr;
+make_reference_type (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. */
@@ -212,7 +252,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);
@@ -228,7 +269,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;
@@ -238,10 +279,9 @@ make_reference_type (type, typeptr)
/* Same as above, but caller doesn't care about memory allocation details. */
struct type *
-lookup_reference_type (type)
- struct type *type;
+lookup_reference_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
@@ -250,11 +290,9 @@ lookup_reference_type (type)
We allocate new memory if needed. */
struct type *
-make_function_type (type, typeptr)
- struct type *type;
- struct type **typeptr;
+make_function_type (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. */
@@ -263,7 +301,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);
@@ -275,7 +314,7 @@ make_function_type (type, typeptr)
TYPE_LENGTH (ntype) = 1;
TYPE_CODE (ntype) = TYPE_CODE_FUNC;
-
+
return ntype;
}
@@ -284,10 +323,76 @@ make_function_type (type, typeptr)
May need to construct such a type if this is the first use. */
struct type *
-lookup_function_type (type)
- struct type *type;
+lookup_function_type (struct type *type)
+{
+ return make_function_type (type, (struct type **) 0);
+}
+
+/* Identify address space identifier by name --
+ return the integer flag defined in gdbtypes.h. */
+extern int
+address_space_name_to_int (char *space_identifier)
+{
+ /* Check for known address space delimiters. */
+ if (!strcmp (space_identifier, "code"))
+ return TYPE_FLAG_CODE_SPACE;
+ else if (!strcmp (space_identifier, "data"))
+ return TYPE_FLAG_DATA_SPACE;
+ else
+ error ("Unknown address space specifier: \"%s\"", space_identifier);
+}
+
+/* Identify address space identifier by integer flag as defined in
+ gdbtypes.h -- return the string version of the adress space name. */
+
+extern char *
+address_space_int_to_name (int space_flag)
+{
+ if (space_flag & TYPE_FLAG_CODE_SPACE)
+ return "code";
+ else if (space_flag & TYPE_FLAG_DATA_SPACE)
+ return "data";
+ else
+ return NULL;
+}
+
+/* Make an address-space-delimited variant of a type -- a type that
+ is identical to the one supplied except that it has an address
+ space attribute attached to it (such as "code" or "data").
+
+ This is for Harvard architectures. */
+
+struct type *
+make_type_with_address_space (struct type *type, int space_flag)
{
- return make_function_type (type, (struct type **)0);
+ struct type *ntype;
+
+ ntype = type;
+ do {
+ if ((ntype->flags & space_flag) != 0)
+ return ntype;
+ ntype = TYPE_AS_TYPE (ntype);
+ } while (ntype != type);
+
+ /* Create a new, duplicate type. */
+ ntype = alloc_type (TYPE_OBJFILE (type));
+ /* Copy original type. */
+ memcpy ((char *) ntype, (char *) type, sizeof (struct type));
+
+ /* Pointers or references to the original type are not relevant to
+ the new type; but if the original type is a pointer, the new type
+ points to the same thing (so TYPE_TARGET_TYPE remains unchanged). */
+ TYPE_POINTER_TYPE (ntype) = (struct type *) 0;
+ TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0;
+ TYPE_CV_TYPE (ntype) = ntype;
+
+ /* Chain the new address-space-specific type to the old type. */
+ ntype->as_type = type->as_type;
+ type->as_type = ntype;
+
+ /* Now set the address-space flag, and return the new type. */
+ ntype->flags |= space_flag;
+ return ntype;
}
@@ -302,14 +407,10 @@ lookup_function_type (type)
We allocate new memory if needed. */
struct type *
-make_cv_type (cnst, voltl, type, typeptr)
- int cnst;
- int voltl;
- struct type *type;
- struct type **typeptr;
-{
- register struct type *ntype; /* New type */
- register struct type *tmp_type = type; /* tmp type */
+make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr)
+{
+ register struct type *ntype; /* New type */
+ register struct type *tmp_type = type; /* tmp type */
struct objfile *objfile;
ntype = TYPE_CV_TYPE (type);
@@ -317,16 +418,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);
}
@@ -337,7 +438,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);
@@ -345,23 +447,24 @@ 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 */
+ TYPE_AS_TYPE (ntype) = ntype; /* Need new address-space 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;
@@ -370,8 +473,77 @@ make_cv_type (cnst, voltl, type, typeptr)
return ntype;
}
+/* When reading in a class type, we may have created references to
+ cv-qualified versions of the type (in method arguments, for
+ instance). Update everything on the cv ring from the primary
+ type TYPE.
+
+ The only reason we do not need to do the same thing for address
+ spaces is that type readers do not create address space qualified
+ types. */
+void
+finish_cv_type (struct type *type)
+{
+ struct type *ntype, *cv_type, *ptr_type, *ref_type;
+ int cv_flags;
+
+ gdb_assert (!TYPE_CONST (type) && !TYPE_VOLATILE (type));
+
+ ntype = type;
+ while ((ntype = TYPE_CV_TYPE (ntype)) != type)
+ {
+ /* Save cv_flags. */
+ cv_flags = TYPE_FLAGS (ntype) & (TYPE_FLAG_VOLATILE | TYPE_FLAG_CONST);
+ /* If any reference or pointer types were created, save them too. */
+ ptr_type = TYPE_POINTER_TYPE (ntype);
+ ref_type = TYPE_REFERENCE_TYPE (ntype);
+ /* Don't disturb the CV chain. */
+ cv_type = TYPE_CV_TYPE (ntype);
+
+ /* Verify that we haven't added any address-space qualified types,
+ for the future. */
+ gdb_assert (ntype == TYPE_AS_TYPE (ntype));
+
+ /* Copy original type */
+ memcpy ((char *) ntype, (char *) type, sizeof (struct type));
+
+ /* Restore everything. */
+ TYPE_POINTER_TYPE (ntype) = ptr_type;
+ TYPE_REFERENCE_TYPE (ntype) = ref_type;
+ TYPE_CV_TYPE (ntype) = cv_type;
+ TYPE_FLAGS (ntype) = TYPE_FLAGS (ntype) | cv_flags;
+
+ TYPE_AS_TYPE (ntype) = ntype;
+ }
+}
+
+/* Replace the contents of ntype with the type *type.
+
+ This function should not be necessary, but is due to quirks in the stabs
+ reader. This should go away. It does not handle the replacement type
+ being cv-qualified; it could be easily fixed to, but it should go away,
+ remember? */
+void
+replace_type (struct type *ntype, struct type *type)
+{
+ struct type *cv_chain, *as_chain, *ptr, *ref;
+
+ cv_chain = TYPE_CV_TYPE (ntype);
+ as_chain = TYPE_AS_TYPE (ntype);
+ ptr = TYPE_POINTER_TYPE (ntype);
+ ref = TYPE_REFERENCE_TYPE (ntype);
+
+ *ntype = *type;
+
+ TYPE_POINTER_TYPE (ntype) = ptr;
+ TYPE_REFERENCE_TYPE (ntype) = ref;
+ TYPE_CV_TYPE (ntype) = cv_chain;
+ TYPE_AS_TYPE (ntype) = as_chain;
+
+ finish_cv_type (ntype);
+}
/* Implement direct support for MEMBER_TYPE in GNU C++.
May need to construct such a type if this is the first use.
@@ -379,9 +551,7 @@ make_cv_type (cnst, voltl, type, typeptr)
of the aggregate that the member belongs to. */
struct type *
-lookup_member_type (type, domain)
- struct type *type;
- struct type *domain;
+lookup_member_type (struct type *type, struct type *domain)
{
register struct type *mtype;
@@ -397,18 +567,15 @@ lookup_member_type (type, domain)
This always returns a fresh type. */
struct type *
-allocate_stub_method (type)
- struct type *type;
+allocate_stub_method (struct type *type)
{
struct type *mtype;
- mtype = alloc_type (TYPE_OBJFILE (type));
+ mtype = init_type (TYPE_CODE_METHOD, 1, TYPE_FLAG_STUB, NULL,
+ TYPE_OBJFILE (type));
TYPE_TARGET_TYPE (mtype) = type;
/* _DOMAIN_TYPE (mtype) = unknown yet */
/* _ARG_TYPES (mtype) = unknown yet */
- TYPE_FLAGS (mtype) = TYPE_FLAG_STUB;
- TYPE_CODE (mtype) = TYPE_CODE_METHOD;
- TYPE_LENGTH (mtype) = 1;
return (mtype);
}
@@ -422,11 +589,8 @@ allocate_stub_method (type)
sure it is TYPE_CODE_UNDEF before we bash it into a range type? */
struct type *
-create_range_type (result_type, index_type, low_bound, high_bound)
- struct type *result_type;
- struct type *index_type;
- int low_bound;
- int high_bound;
+create_range_type (struct type *result_type, struct type *index_type,
+ int low_bound, int high_bound)
{
if (result_type == NULL)
{
@@ -434,7 +598,7 @@ create_range_type (result_type, index_type, low_bound, high_bound)
}
TYPE_CODE (result_type) = TYPE_CODE_RANGE;
TYPE_TARGET_TYPE (result_type) = index_type;
- if (TYPE_FLAGS (index_type) & TYPE_FLAG_STUB)
+ if (TYPE_STUB (index_type))
TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB;
else
TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
@@ -444,10 +608,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);
@@ -458,9 +622,7 @@ create_range_type (result_type, index_type, low_bound, high_bound)
will fit in LONGEST), or -1 otherwise. */
int
-get_discrete_bounds (type, lowp, highp)
- struct type *type;
- LONGEST *lowp, *highp;
+get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
{
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
@@ -486,7 +648,7 @@ get_discrete_bounds (type, lowp, highp)
}
/* Set unsigned indicator if warranted. */
- if(*lowp >= 0)
+ if (*lowp >= 0)
{
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
}
@@ -502,11 +664,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;
}
@@ -514,8 +676,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;
@@ -534,10 +696,8 @@ get_discrete_bounds (type, lowp, highp)
sure it is TYPE_CODE_UNDEF before we bash it into an array type? */
struct type *
-create_array_type (result_type, element_type, range_type)
- struct type *result_type;
- struct type *element_type;
- struct type *range_type;
+create_array_type (struct type *result_type, struct type *element_type,
+ struct type *range_type)
{
LONGEST low_bound, high_bound;
@@ -578,9 +738,7 @@ create_array_type (result_type, element_type, range_type)
sure it is TYPE_CODE_UNDEF before we bash it into a string type? */
struct type *
-create_string_type (result_type, range_type)
- struct type *result_type;
- struct type *range_type;
+create_string_type (struct type *result_type, struct type *range_type)
{
result_type = create_array_type (result_type,
*current_language->string_char_type,
@@ -590,9 +748,7 @@ create_string_type (result_type, range_type)
}
struct type *
-create_set_type (result_type, domain_type)
- struct type *result_type;
- struct type *domain_type;
+create_set_type (struct type *result_type, struct type *domain_type)
{
LONGEST low_bound, high_bound, bit_length;
if (result_type == NULL)
@@ -605,7 +761,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_STUB (domain_type))
{
if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
@@ -615,12 +771,94 @@ 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);
}
+
+/* Construct and return a type of the form:
+ struct NAME { ELT_TYPE ELT_NAME[N]; }
+ We use these types for SIMD registers. For example, the type of
+ the SSE registers on the late x86-family processors is:
+ struct __builtin_v4sf { float f[4]; }
+ built by the function call:
+ init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4)
+ The type returned is a permanent type, allocated using malloc; it
+ doesn't live in any objfile's obstack. */
+static struct type *
+init_simd_type (char *name,
+ struct type *elt_type,
+ char *elt_name,
+ int n)
+{
+ struct type *t;
+ struct field *f;
+
+ /* Build the field structure. */
+ f = xmalloc (sizeof (*f));
+ memset (f, 0, sizeof (*f));
+ f->loc.bitpos = 0;
+ f->type = create_array_type (0, elt_type,
+ create_range_type (0, builtin_type_int,
+ 0, n-1));
+ f->name = elt_name;
+
+ /* Build a struct type with that field. */
+ t = init_type (TYPE_CODE_STRUCT, n * TYPE_LENGTH (elt_type), 0, 0, 0);
+ t->nfields = 1;
+ t->fields = f;
+ TYPE_TAG_NAME (t) = name;
+
+ return t;
+}
+
+static struct type *
+build_builtin_type_vec128 (void)
+{
+ /* Construct a type for the 128 bit registers. The type we're
+ building is this: */
+#if 0
+ union __gdb_builtin_type_vec128
+ {
+ struct __builtin_v16qi v16qi;
+ struct __builtin_v8hi v8hi;
+ struct __builtin_v4si v4si;
+ struct __builtin_v4sf v4sf;
+ uint128_t uint128;
+ };
+#endif
+
+ struct type *t;
+ struct field *f;
+
+ f = (struct field *) xcalloc (5, sizeof (*f));
+
+ FIELD_TYPE (f[0]) = builtin_type_int128;
+ FIELD_NAME (f[0]) = "uint128";
+
+ FIELD_TYPE (f[1]) = builtin_type_v4sf;
+ FIELD_NAME (f[1]) = "v4sf";
+
+ FIELD_TYPE (f[2]) = builtin_type_v4si;
+ FIELD_NAME (f[2]) = "v4si";
+
+ FIELD_TYPE (f[3]) = builtin_type_v8hi;
+ FIELD_NAME (f[3]) = "v8hi";
+
+ FIELD_TYPE (f[4]) = builtin_type_v16qi;
+ FIELD_NAME (f[4]) = "v16qi";
+
+ /* Build a union type with those fields. */
+ t = init_type (TYPE_CODE_UNION, 16, 0, 0, 0);
+ TYPE_NFIELDS (t) = 5;
+ TYPE_FIELDS (t) = f;
+ TYPE_TAG_NAME (t) = "__gdb_builtin_type_vec128";
+
+ return t;
+}
+
/* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE.
A MEMBER is a wierd thing -- it amounts to a typed offset into
a struct, e.g. "an int at offset 8". A MEMBER TYPE doesn't
@@ -632,10 +870,8 @@ create_set_type (result_type, domain_type)
allocated. */
void
-smash_to_member_type (type, domain, to_type)
- struct type *type;
- struct type *domain;
- struct type *to_type;
+smash_to_member_type (struct type *type, struct type *domain,
+ struct type *to_type)
{
struct objfile *objfile;
@@ -657,11 +893,8 @@ smash_to_member_type (type, domain, to_type)
allocated. */
void
-smash_to_method_type (type, domain, to_type, args)
- struct type *type;
- struct type *domain;
- struct type *to_type;
- struct type **args;
+smash_to_method_type (struct type *type, struct type *domain,
+ struct type *to_type, struct type **args)
{
struct objfile *objfile;
@@ -680,8 +913,7 @@ smash_to_method_type (type, domain, to_type, args)
"union ", or "enum ". If the type has a NULL name, return NULL. */
char *
-type_name_no_tag (type)
- register const struct type *type;
+type_name_no_tag (register const struct type *type)
{
if (TYPE_TAG_NAME (type) != NULL)
return TYPE_TAG_NAME (type);
@@ -693,22 +925,21 @@ 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;
+lookup_primitive_typename (char *name)
{
- struct type ** const *p;
+ struct type **const *p;
- for (p = current_language -> la_builtin_type_vector; *p != NULL; p++)
- {
- if (STREQ ((**p) -> name, name))
- {
- return (**p);
- }
- }
- return (NULL);
+ 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,
@@ -716,10 +947,7 @@ lookup_primitive_typename (name)
If NOERR is nonzero, return zero if NAME is not suitably defined. */
struct type *
-lookup_typename (name, block, noerr)
- char *name;
- struct block *block;
- int noerr;
+lookup_typename (char *name, struct block *block, int noerr)
{
register struct symbol *sym;
register struct type *tmp;
@@ -745,8 +973,7 @@ lookup_typename (name, block, noerr)
}
struct type *
-lookup_unsigned_typename (name)
- char *name;
+lookup_unsigned_typename (char *name)
{
char *uns = alloca (strlen (name) + 10);
@@ -756,8 +983,7 @@ lookup_unsigned_typename (name)
}
struct type *
-lookup_signed_typename (name)
- char *name;
+lookup_signed_typename (char *name)
{
struct type *t;
char *uns = alloca (strlen (name) + 8);
@@ -775,9 +1001,7 @@ lookup_signed_typename (name)
visible in lexical block BLOCK. */
struct type *
-lookup_struct (name, block)
- char *name;
- struct block *block;
+lookup_struct (char *name, struct block *block)
{
register struct symbol *sym;
@@ -799,12 +1023,10 @@ lookup_struct (name, block)
visible in lexical block BLOCK. */
struct type *
-lookup_union (name, block)
- char *name;
- struct block *block;
+lookup_union (char *name, struct block *block)
{
register struct symbol *sym;
- struct type * t;
+ struct type *t;
sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
(struct symtab **) NULL);
@@ -812,7 +1034,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);
@@ -820,8 +1042,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 */
@@ -833,13 +1055,11 @@ lookup_union (name, block)
visible in lexical block BLOCK. */
struct type *
-lookup_enum (name, block)
- char *name;
- struct block *block;
+lookup_enum (char *name, struct block *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)
{
@@ -856,19 +1076,16 @@ lookup_enum (name, block)
visible in lexical block BLOCK. */
struct type *
-lookup_template_type (name, type, block)
- char *name;
- struct type *type;
- struct block *block;
+lookup_template_type (char *name, struct type *type, 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)
{
@@ -892,10 +1109,7 @@ lookup_template_type (name, type, block)
If NAME is the name of a baseclass type, return that type. */
struct type *
-lookup_struct_elt_type (type, name, noerr)
- struct type *type;
- char *name;
- int noerr;
+lookup_struct_elt_type (struct type *type, char *name, int noerr)
{
int i;
@@ -936,7 +1150,7 @@ lookup_struct_elt_type (type, name, noerr)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
return TYPE_FIELD_TYPE (type, i);
}
@@ -958,7 +1172,7 @@ lookup_struct_elt_type (type, name, noerr)
{
return NULL;
}
-
+
target_terminal_ours ();
gdb_flush (gdb_stdout);
fprintf_unfiltered (gdb_stderr, "Type ");
@@ -966,7 +1180,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
@@ -977,8 +1191,7 @@ lookup_struct_elt_type (type, name, noerr)
will remain NULL. */
void
-fill_in_vptr_fieldno (type)
- struct type *type;
+fill_in_vptr_fieldno (struct type *type)
{
CHECK_TYPEDEF (type);
@@ -987,7 +1200,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));
@@ -1007,10 +1220,7 @@ fill_in_vptr_fieldno (type)
Return 1 if the destructor was found, otherwise, return 0. */
int
-get_destructor_fn_field (t, method_indexp, field_indexp)
- struct type *t;
- int *method_indexp;
- int *field_indexp;
+get_destructor_fn_field (struct type *t, int *method_indexp, int *field_indexp)
{
int i;
@@ -1021,7 +1231,7 @@ get_destructor_fn_field (t, method_indexp, field_indexp)
for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (t, i); j++)
{
- if (DESTRUCTOR_PREFIX_P (TYPE_FN_FIELD_PHYSNAME (f, j)))
+ if (is_destructor_name (TYPE_FN_FIELD_PHYSNAME (f, j)) != 0)
{
*method_indexp = i;
*field_indexp = j;
@@ -1046,18 +1256,19 @@ 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)
- register struct type *type;
+check_typedef (struct type *type)
{
struct type *orig_type = type;
+ int is_const, is_volatile;
+
while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
{
if (!TYPE_TARGET_TYPE (type))
{
- char* name;
+ char *name;
struct symbol *sym;
/* It is dangerous to call lookup_symbol if we are currently
@@ -1075,25 +1286,28 @@ 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);
}
+ is_const = TYPE_CONST (type);
+ is_volatile = TYPE_VOLATILE (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);
@@ -1101,18 +1315,16 @@ check_typedef (type)
}
newtype = lookup_transparent_type (name);
if (newtype)
- {
- memcpy ((char *) type, (char *) newtype, sizeof (struct type));
- }
+ make_cv_type (is_const, is_volatile, newtype, &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_STUB (type) && !currently_reading_symtab)
{
- char* name = 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)
{
@@ -1121,18 +1333,17 @@ 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));
- }
+ make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
}
- if (TYPE_FLAGS (type) & TYPE_FLAG_TARGET_STUB)
+ if (TYPE_TARGET_STUB (type))
{
struct type *range_type;
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
- if (TYPE_FLAGS (target_type) & (TYPE_FLAG_STUB | TYPE_FLAG_TARGET_STUB))
- { }
+ if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type))
+ {
+ }
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
&& TYPE_NFIELDS (type) == 1
&& (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
@@ -1159,201 +1370,225 @@ check_typedef (type)
}
/* New code added to support parsing of Cfront stabs strings */
-#include <ctype.h>
#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 (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 (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"))
- ADD_EXTRA('l')
- else
- 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);
- }
+ 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');
+ }
+ else
+ {
+ 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);
+ }
/* 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)
- 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
+cfront_mangle_name (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
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 */
+ xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str);
+ xfree (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 */
+/* Parse a type expression in the string [P..P+LENGTH). If an error occurs,
+ silently return builtin_type_void. */
+
+struct type *
+safe_parse_type (char *p, int length)
+{
+ struct ui_file *saved_gdb_stderr;
+ struct type *type;
+
+ /* Suppress error messages. */
+ saved_gdb_stderr = gdb_stderr;
+ gdb_stderr = ui_file_new ();
+
+ /* Call parse_and_eval_type() without fear of longjmp()s. */
+ if (!gdb_parse_and_eval_type (p, length, &type))
+ type = builtin_type_void;
+
+ /* Stop suppressing error messages. */
+ ui_file_delete (gdb_stderr);
+ gdb_stderr = saved_gdb_stderr;
+
+ return type;
+}
+
/* Ugly hack to convert method stubs into method types.
He ain't kiddin'. This demangles the name of the method into a string
@@ -1365,10 +1600,7 @@ cfront_mangle_name(type, i, j)
the space required for them. */
void
-check_stub_method (type, method_id, signature_id)
- struct type *type;
- int method_id;
- int signature_id;
+check_stub_method (struct type *type, int method_id, int signature_id)
{
struct fn_field *f;
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
@@ -1382,6 +1614,8 @@ check_stub_method (type, method_id, signature_id)
/* Make sure we got back a function string that we can use. */
if (demangled_name)
p = strchr (demangled_name, '(');
+ else
+ p = NULL;
if (demangled_name == NULL || p == NULL)
error ("Internal: Cannot demangle mangled name `%s'.", mangled_name);
@@ -1391,11 +1625,11 @@ check_stub_method (type, method_id, signature_id)
argtypetext = p;
while (*p)
{
- if (*p == '(')
+ if (*p == '(' || *p == '<')
{
depth += 1;
}
- else if (*p == ')')
+ else if (*p == ')' || *p == '>')
{
depth -= 1;
}
@@ -1417,7 +1651,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)
@@ -1428,17 +1662,17 @@ check_stub_method (type, method_id, signature_id)
if (strncmp (argtypetext, "...", p - argtypetext) != 0)
{
argtypes[argcount] =
- parse_and_eval_type (argtypetext, p - argtypetext);
+ safe_parse_type (argtypetext, p - argtypetext);
argcount += 1;
}
argtypetext = p + 1;
}
- if (*p == '(')
+ if (*p == '(' || *p == '<')
{
depth += 1;
}
- else if (*p == ')')
+ else if (*p == ')' || *p == '>')
{
depth -= 1;
}
@@ -1447,18 +1681,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);
+ xfree (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;
@@ -1473,14 +1707,13 @@ check_stub_method (type, method_id, signature_id)
const struct cplus_struct_type cplus_struct_default;
void
-allocate_cplus_struct_type (type)
- struct type *type;
+allocate_cplus_struct_type (struct type *type)
{
if (!HAVE_CPLUS_STRUCT (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;
}
}
@@ -1492,12 +1725,8 @@ allocate_cplus_struct_type (type)
in particular, where init_type is called with a NULL value for NAME). */
struct type *
-init_type (code, length, flags, name, objfile)
- enum type_code code;
- int length;
- int flags;
- char *name;
- struct objfile *objfile;
+init_type (enum type_code code, int length, int flags, char *name,
+ struct objfile *objfile)
{
register struct type *type;
@@ -1508,7 +1737,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
{
@@ -1546,9 +1775,7 @@ init_type (code, length, flags, name, objfile)
struct type *
-lookup_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+lookup_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type **typep;
register int nbytes;
@@ -1560,20 +1787,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);
@@ -1583,8 +1810,7 @@ lookup_fundamental_type (objfile, typeid)
}
int
-can_dereference (t)
- struct type *t;
+can_dereference (struct type *t)
{
/* FIXME: Should we return true for references as well as pointers? */
CHECK_TYPEDEF (t);
@@ -1594,6 +1820,19 @@ can_dereference (t)
&& TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID);
}
+int
+is_integral_type (struct type *t)
+{
+ CHECK_TYPEDEF (t);
+ return
+ ((t != NULL)
+ && ((TYPE_CODE (t) == TYPE_CODE_INT)
+ || (TYPE_CODE (t) == TYPE_CODE_ENUM)
+ || (TYPE_CODE (t) == TYPE_CODE_CHAR)
+ || (TYPE_CODE (t) == TYPE_CODE_RANGE)
+ || (TYPE_CODE (t) == TYPE_CODE_BOOL)));
+}
+
/* Chill varying string and arrays are represented as follows:
struct { int __var_length; ELEMENT_TYPE[MAX_SIZE] __var_data};
@@ -1601,8 +1840,7 @@ can_dereference (t)
Return true if TYPE is such a Chill varying type. */
int
-chill_varying_type (type)
- struct type *type;
+chill_varying_type (struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
|| TYPE_NFIELDS (type) != 2
@@ -1618,17 +1856,18 @@ chill_varying_type (type)
the ancestor relationship even if they're identical */
int
-is_ancestor (base, dclass)
- struct type * base;
- struct type * dclass;
+is_ancestor (struct type *base, struct type *dclass)
{
int i;
-
+
CHECK_TYPEDEF (base);
CHECK_TYPEDEF (dclass);
if (base == dclass)
return 1;
+ if (TYPE_NAME (base) && TYPE_NAME (dclass) &&
+ !strcmp (TYPE_NAME (base), TYPE_NAME (dclass)))
+ return 1;
for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
if (is_ancestor (base, TYPE_BASECLASS (dclass, i)))
@@ -1644,51 +1883,49 @@ is_ancestor (base, dclass)
runtime models. Return 1 => Yes, 0 => No. */
int
-has_vtable (dclass)
- struct type * dclass;
+has_vtable (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;
+
+ /* 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 */
+
+ /* 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;
+primary_base_class (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
@@ -1696,70 +1933,69 @@ 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. */
-struct vbase *
-virtual_base_list_aux (dclass)
- struct type * dclass;
+static void
+virtual_base_list_aux (struct type *dclass)
{
- struct vbase * tmp_vbase;
+ struct vbase *tmp_vbase;
register int i;
- if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
- return NULL;
+ 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 */
}
@@ -1767,38 +2003,37 @@ 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;
+virtual_base_list (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 */
@@ -1806,10 +2041,10 @@ virtual_base_list (dclass)
while (tmp_vbase)
{
tmp_vbase = tmp_vbase->next;
- free(tmp_vbase_2);
+ xfree (tmp_vbase_2);
tmp_vbase_2 = tmp_vbase;
}
-
+
vbase_array[count] = NULL;
return vbase_array;
}
@@ -1817,16 +2052,15 @@ virtual_base_list (dclass)
/* Return the length of the virtual base list of the type DCLASS. */
int
-virtual_base_list_length (dclass)
- struct type * dclass;
+virtual_base_list_length (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;
}
@@ -1836,12 +2070,11 @@ virtual_base_list_length (dclass)
primary base, recursively). */
int
-virtual_base_list_length_skip_primaries (dclass)
- struct type * dclass;
+virtual_base_list_length_skip_primaries (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;
@@ -1849,12 +2082,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;
@@ -1866,24 +2099,22 @@ 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 (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 = virtual_base_list (dclass)[0];
while (vbase)
{
if (vbase == base)
- break;
- vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[++i];
+ break;
+ vbase = virtual_base_list (dclass)[++i];
}
return vbase ? i : -1;
@@ -1898,30 +2129,28 @@ 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 (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 = 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 = virtual_base_list (dclass)[++i];
}
return vbase ? j : -1;
@@ -1932,12 +2161,11 @@ virtual_base_index_skip_primaries(base, dclass)
* Position returned is 0-based. */
int
-class_index_in_primary_list (dclass)
- struct type * dclass;
+class_index_in_primary_list (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);
@@ -1955,29 +2183,28 @@ class_index_in_primary_list (dclass)
*/
int
-count_virtual_fns (dclass)
- struct type * dclass;
+count_virtual_fns (struct type *dclass)
{
- int base; /* index for base classes */
- int fn, oi; /* function and overloaded instance indices */
-
- int vfuncs; /* count to return */
+ int fn, oi; /* function and overloaded instance indices */
+ int vfuncs; /* count to return */
- /* recurse on bases that can share virtual table */
- struct type * pbc = primary_base_class (dclass);
+ /* recurse on bases that can share virtual table */
+ struct type *pbc = primary_base_class (dclass);
if (pbc)
vfuncs = count_virtual_fns (pbc);
-
+ else
+ vfuncs = 0;
+
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;
}
-
+
/* Functions for overload resolution begin here */
/* Compare two badness vectors A and B and return the result.
@@ -1987,42 +2214,41 @@ count_virtual_fns (dclass)
* 3 => A is worse than B */
int
-compare_badness (a, b)
- struct badness_vector * a;
- struct badness_vector * b;
+compare_badness (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 */
}
}
@@ -2031,23 +2257,19 @@ compare_badness (a, b)
* Return a pointer to a badness vector. This has NARGS + 1 entries. */
struct badness_vector *
-rank_function (parms, nparms, args, nargs)
- struct type ** parms;
- int nparms;
- struct type ** args;
- int nargs;
+rank_function (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. */
@@ -2055,11 +2277,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++)
+ 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;
@@ -2076,9 +2298,7 @@ rank_function (parms, nparms, args, nargs)
* Generally the "bad" conversions are all uniformly assigned a 100 */
int
-rank_one_type (parm, arg)
- struct type * parm;
- struct type * arg;
+rank_one_type (struct type *parm, struct type *arg)
{
/* Identical type pointers */
/* However, this still doesn't catch all cases of same type for arg
@@ -2093,311 +2313,323 @@ rank_one_type (parm, arg)
if (TYPE_CODE (arg) == TYPE_CODE_TYPEDEF)
arg = check_typedef (arg);
+ /*
+ Well, damnit, if the names are exactly the same,
+ i'll say they are exactly the same. This happens when we generate
+ method stubs. The types won't point to the same address, but they
+ really are the same.
+ */
+
+ if (TYPE_NAME (parm) && TYPE_NAME (arg) &&
+ !strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
+ return 0;
+
/* Check if identical after resolving typedefs */
if (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));
-#endif
+ /* See through references, since we can almost make non-references
+ references. */
+ if (TYPE_CODE (arg) == TYPE_CODE_REF)
+ return (rank_one_type (parm, TYPE_TARGET_TYPE (arg))
+ + REFERENCE_CONVERSION_BADNESS);
+ if (TYPE_CODE (parm) == TYPE_CODE_REF)
+ return (rank_one_type (TYPE_TARGET_TYPE (parm), arg)
+ + REFERENCE_CONVERSION_BADNESS);
+ if (overload_debug)
+ /* Debugging only. */
+ fprintf_filtered (gdb_stderr,"------ Arg is %s [%d], parm is %s [%d]\n",
+ TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
/* 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_iw (TYPE_NAME (parm), TYPE_NAME (arg)))
+ return 0; /* unsigned int -> unsigned int, or unsigned long -> unsigned long */
+ else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (TYPE_NAME (parm), "long"))
+ return INTEGER_PROMOTION_BADNESS; /* unsigned int -> unsigned long */
+ else
+ return INTEGER_COERCION_BADNESS; /* unsigned long -> unsigned int */
+ }
+ else
+ {
+ if (!strcmp_iw (TYPE_NAME (arg), "long") && !strcmp_iw (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_iw (TYPE_NAME (parm), TYPE_NAME (arg)))
+ return 0;
+ else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (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)) */
-}
-
-
-/* End of functions for overload resolution */
-
-
-
-#if MAINTENANCE_CMDS
+ 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 */
static void
-print_bit_vector (bits, nbits)
- B_TYPE *bits;
- int nbits;
+print_bit_vector (B_TYPE *bits, int nbits)
{
int bitno;
@@ -2425,16 +2657,14 @@ print_bit_vector (bits, nbits)
include it since we may get into a infinitely recursive situation. */
static void
-print_arg_types (args, spaces)
- struct type **args;
- int spaces;
+print_arg_types (struct type **args, int spaces)
{
if (args != NULL)
{
while (*args != NULL)
{
recursive_dump_type (*args, spaces + 2);
- if ((*args++) -> code == TYPE_CODE_VOID)
+ if ((*args++)->code == TYPE_CODE_VOID)
{
break;
}
@@ -2443,16 +2673,14 @@ print_arg_types (args, spaces)
}
static void
-dump_fn_fieldlists (type, spaces)
- struct type *type;
- int spaces;
+dump_fn_fieldlists (struct type *type, int spaces)
{
int method_idx;
int overload_idx;
struct fn_field *f;
printfi_filtered (spaces, "fn_fieldlists ");
- gdb_print_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
printf_filtered ("\n");
for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++)
{
@@ -2460,8 +2688,8 @@ dump_fn_fieldlists (type, spaces)
printfi_filtered (spaces + 2, "[%d] name '%s' (",
method_idx,
TYPE_FN_FIELDLIST_NAME (type, method_idx));
- gdb_print_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
+ gdb_stdout);
printf_filtered (") length %d\n",
TYPE_FN_FIELDLIST_LENGTH (type, method_idx));
for (overload_idx = 0;
@@ -2471,24 +2699,24 @@ dump_fn_fieldlists (type, spaces)
printfi_filtered (spaces + 4, "[%d] physname '%s' (",
overload_idx,
TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
- gdb_print_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
+ gdb_stdout);
printf_filtered (")\n");
printfi_filtered (spaces + 8, "type ");
- gdb_print_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx),
spaces + 8 + 2);
printfi_filtered (spaces + 8, "args ");
- gdb_print_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces);
printfi_filtered (spaces + 8, "fcontext ");
- gdb_print_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
+ gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces + 8, "is_const %d\n",
@@ -2508,9 +2736,7 @@ dump_fn_fieldlists (type, spaces)
}
static void
-print_cplus_stuff (type, spaces)
- struct type *type;
- int spaces;
+print_cplus_stuff (struct type *type, int spaces)
{
printfi_filtered (spaces, "n_baseclasses %d\n",
TYPE_N_BASECLASSES (type));
@@ -2522,7 +2748,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "virtual_field_bits (%d bits at *",
TYPE_N_BASECLASSES (type));
- gdb_print_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type),
@@ -2535,7 +2761,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "private_field_bits (%d bits at *",
TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type),
TYPE_NFIELDS (type));
@@ -2545,7 +2771,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "protected_field_bits (%d bits at *",
TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type),
TYPE_NFIELDS (type));
@@ -2558,12 +2784,39 @@ print_cplus_stuff (type, spaces)
}
}
+static void
+print_bound_type (int bt)
+{
+ switch (bt)
+ {
+ case BOUND_CANNOT_BE_DETERMINED:
+ printf_filtered ("(BOUND_CANNOT_BE_DETERMINED)");
+ break;
+ case BOUND_BY_REF_ON_STACK:
+ printf_filtered ("(BOUND_BY_REF_ON_STACK)");
+ break;
+ case BOUND_BY_VALUE_ON_STACK:
+ printf_filtered ("(BOUND_BY_VALUE_ON_STACK)");
+ break;
+ case BOUND_BY_REF_IN_REG:
+ printf_filtered ("(BOUND_BY_REF_IN_REG)");
+ break;
+ case BOUND_BY_VALUE_IN_REG:
+ printf_filtered ("(BOUND_BY_VALUE_IN_REG)");
+ break;
+ case BOUND_SIMPLE:
+ printf_filtered ("(BOUND_SIMPLE)");
+ break;
+ default:
+ printf_filtered ("(unknown bound type)");
+ break;
+ }
+}
+
static struct obstack dont_print_type_obstack;
void
-recursive_dump_type (type, spaces)
- struct type *type;
- int spaces;
+recursive_dump_type (struct type *type, int spaces)
{
int idx;
@@ -2574,17 +2827,17 @@ 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)
{
if (type == first_dont_print[i])
{
printfi_filtered (spaces, "type node ");
- gdb_print_address (type, gdb_stdout);
+ gdb_print_host_address (type, gdb_stdout);
printf_filtered (" <same as already seen type>\n");
return;
}
@@ -2594,116 +2847,179 @@ recursive_dump_type (type, spaces)
}
printfi_filtered (spaces, "type node ");
- gdb_print_address (type, gdb_stdout);
+ gdb_print_host_address (type, gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "name '%s' (",
TYPE_NAME (type) ? TYPE_NAME (type) : "<NULL>");
- gdb_print_address (TYPE_NAME (type), gdb_stdout);
+ gdb_print_host_address (TYPE_NAME (type), gdb_stdout);
+ printf_filtered (")\n");
+ printfi_filtered (spaces, "tagname '%s' (",
+ TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : "<NULL>");
+ gdb_print_host_address (TYPE_TAG_NAME (type), gdb_stdout);
printf_filtered (")\n");
- if (TYPE_TAG_NAME (type) != NULL)
- {
- printfi_filtered (spaces, "tagname '%s' (",
- TYPE_TAG_NAME (type));
- gdb_print_address (TYPE_TAG_NAME (type), gdb_stdout);
- printf_filtered (")\n");
- }
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_BITSTRING:
+ printf_filtered ("(TYPE_CODE_BITSTRING)");
+ 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_COMPLEX:
+ printf_filtered ("(TYPE_CODE_COMPLEX)");
+ break;
+ case TYPE_CODE_TYPEDEF:
+ printf_filtered ("(TYPE_CODE_TYPEDEF)");
+ break;
+ case TYPE_CODE_TEMPLATE:
+ printf_filtered ("(TYPE_CODE_TEMPLATE)");
+ break;
+ case TYPE_CODE_TEMPLATE_ARG:
+ printf_filtered ("(TYPE_CODE_TEMPLATE_ARG)");
+ break;
+ default:
+ printf_filtered ("(UNKNOWN TYPE CODE)");
+ break;
}
puts_filtered ("\n");
printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
+ printfi_filtered (spaces, "upper_bound_type 0x%x ",
+ TYPE_ARRAY_UPPER_BOUND_TYPE (type));
+ print_bound_type (TYPE_ARRAY_UPPER_BOUND_TYPE (type));
+ puts_filtered ("\n");
+ printfi_filtered (spaces, "lower_bound_type 0x%x ",
+ TYPE_ARRAY_LOWER_BOUND_TYPE (type));
+ print_bound_type (TYPE_ARRAY_LOWER_BOUND_TYPE (type));
+ puts_filtered ("\n");
printfi_filtered (spaces, "objfile ");
- gdb_print_address (TYPE_OBJFILE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "target_type ");
- gdb_print_address (TYPE_TARGET_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
printf_filtered ("\n");
if (TYPE_TARGET_TYPE (type) != NULL)
{
recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2);
}
printfi_filtered (spaces, "pointer_type ");
- gdb_print_address (TYPE_POINTER_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "reference_type ");
- gdb_print_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
+ printf_filtered ("\n");
+ printfi_filtered (spaces, "cv_type ");
+ gdb_print_host_address (TYPE_CV_TYPE (type), gdb_stdout);
+ printf_filtered ("\n");
+ printfi_filtered (spaces, "as_type ");
+ gdb_print_host_address (TYPE_AS_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
- if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
+ if (TYPE_UNSIGNED (type))
{
puts_filtered (" TYPE_FLAG_UNSIGNED");
}
- if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
+ if (TYPE_NOSIGN (type))
+ {
+ puts_filtered (" TYPE_FLAG_NOSIGN");
+ }
+ if (TYPE_STUB (type))
{
puts_filtered (" TYPE_FLAG_STUB");
}
+ if (TYPE_TARGET_STUB (type))
+ {
+ puts_filtered (" TYPE_FLAG_TARGET_STUB");
+ }
+ if (TYPE_STATIC (type))
+ {
+ puts_filtered (" TYPE_FLAG_STATIC");
+ }
+ if (TYPE_CONST (type))
+ {
+ puts_filtered (" TYPE_FLAG_CONST");
+ }
+ if (TYPE_VOLATILE (type))
+ {
+ puts_filtered (" TYPE_FLAG_VOLATILE");
+ }
+ if (TYPE_PROTOTYPED (type))
+ {
+ puts_filtered (" TYPE_FLAG_PROTOTYPED");
+ }
+ if (TYPE_INCOMPLETE (type))
+ {
+ puts_filtered (" TYPE_FLAG_INCOMPLETE");
+ }
+ if (TYPE_CODE_SPACE (type))
+ {
+ puts_filtered (" TYPE_FLAG_CODE_SPACE");
+ }
+ if (TYPE_DATA_SPACE (type))
+ {
+ puts_filtered (" TYPE_FLAG_DATA_SPACE");
+ }
+ if (TYPE_VARARGS (type))
+ {
+ puts_filtered (" TYPE_FLAG_VARARGS");
+ }
puts_filtered ("\n");
printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELDS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
puts_filtered ("\n");
for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
{
@@ -2711,12 +3027,12 @@ recursive_dump_type (type, spaces)
"[%d] bitpos %d bitsize %d type ",
idx, TYPE_FIELD_BITPOS (type, idx),
TYPE_FIELD_BITSIZE (type, idx));
- gdb_print_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
printf_filtered (" name '%s' (",
TYPE_FIELD_NAME (type, idx) != NULL
? TYPE_FIELD_NAME (type, idx)
: "<NULL>");
- gdb_print_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
printf_filtered (")\n");
if (TYPE_FIELD_TYPE (type, idx) != NULL)
{
@@ -2724,7 +3040,7 @@ recursive_dump_type (type, spaces)
}
}
printfi_filtered (spaces, "vptr_basetype ");
- gdb_print_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
puts_filtered ("\n");
if (TYPE_VPTR_BASETYPE (type) != NULL)
{
@@ -2733,45 +3049,52 @@ 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_host_address (TYPE_ARG_TYPES (type), gdb_stdout);
+ puts_filtered ("\n");
+ print_arg_types (TYPE_ARG_TYPES (type), spaces);
+ break;
- case TYPE_CODE_STRUCT:
- printfi_filtered (spaces, "cplus_stuff ");
- gdb_print_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_host_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;
+ case TYPE_CODE_FLT:
+ printfi_filtered (spaces, "floatformat ");
+ if (TYPE_FLOATFORMAT (type) == NULL
+ || TYPE_FLOATFORMAT (type)->name == NULL)
+ puts_filtered ("(null)");
+ else
+ puts_filtered (TYPE_FLOATFORMAT (type)->name);
+ puts_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_host_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)
obstack_free (&dont_print_type_obstack, NULL);
}
-#endif /* MAINTENANCE_CMDS */
-
-
-static void build_gdbtypes PARAMS ((void));
+static void build_gdbtypes (void);
static void
-build_gdbtypes ()
+build_gdbtypes (void)
{
builtin_type_void =
init_type (TYPE_CODE_VOID, 1,
@@ -2779,10 +3102,13 @@ build_gdbtypes ()
"void", (struct objfile *) NULL);
builtin_type_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
+ (TYPE_FLAG_NOSIGN
+ | (TARGET_CHAR_SIGNED ? 0 : TYPE_FLAG_UNSIGNED)),
"char", (struct objfile *) NULL);
- TYPE_FLAGS (builtin_type_char) |= TYPE_FLAG_NOSIGN;
-
+ builtin_type_true_char =
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0,
+ "true character", (struct objfile *) NULL);
builtin_type_signed_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
@@ -2819,7 +3145,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);
@@ -2827,14 +3153,31 @@ build_gdbtypes ()
init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
0,
"float", (struct objfile *) NULL);
+/* vinschen@redhat.com 2002-02-08:
+ The below lines are disabled since they are doing the wrong
+ thing for non-multiarch targets. They are setting the correct
+ type of floats for the target but while on multiarch targets
+ this is done everytime the architecture changes, it's done on
+ non-multiarch targets only on startup, leaving the wrong values
+ in even if the architecture changes (eg. from big-endian to
+ little-endian). */
+#if 0
+ TYPE_FLOATFORMAT (builtin_type_float) = TARGET_FLOAT_FORMAT;
+#endif
builtin_type_double =
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
0,
"double", (struct objfile *) NULL);
+#if 0
+ TYPE_FLOATFORMAT (builtin_type_double) = TARGET_DOUBLE_FORMAT;
+#endif
builtin_type_long_double =
init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
0,
"long double", (struct objfile *) NULL);
+#if 0
+ TYPE_FLOATFORMAT (builtin_type_long_double) = TARGET_LONG_DOUBLE_FORMAT;
+#endif
builtin_type_complex =
init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
0,
@@ -2881,25 +3224,212 @@ build_gdbtypes ()
init_type (TYPE_CODE_INT, 64 / 8,
TYPE_FLAG_UNSIGNED,
"uint64_t", (struct objfile *) NULL);
+ builtin_type_int128 =
+ init_type (TYPE_CODE_INT, 128 / 8,
+ 0,
+ "int128_t", (struct objfile *) NULL);
+ builtin_type_uint128 =
+ init_type (TYPE_CODE_INT, 128 / 8,
+ TYPE_FLAG_UNSIGNED,
+ "uint128_t", (struct objfile *) NULL);
builtin_type_bool =
init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
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);
opaque_type_resolution = 1;
+ /* Build SIMD types. */
+ builtin_type_v4sf
+ = init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4);
+ builtin_type_v4si
+ = init_simd_type ("__builtin_v4si", builtin_type_int32, "f", 4);
+ builtin_type_v16qi
+ = init_simd_type ("__builtin_v16qi", builtin_type_int8, "f", 16);
+ builtin_type_v8qi
+ = init_simd_type ("__builtin_v8qi", builtin_type_int8, "f", 8);
+ builtin_type_v8hi
+ = init_simd_type ("__builtin_v8hi", builtin_type_int16, "f", 8);
+ builtin_type_v4hi
+ = init_simd_type ("__builtin_v4hi", builtin_type_int16, "f", 4);
+ builtin_type_v2si
+ = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2);
+
+ /* Vector types. */
+ builtin_type_vec128
+ = build_builtin_type_vec128 ();
+
+ /* Pointer/Address types. */
+
+ /* NOTE: on some targets, addresses and pointers are not necessarily
+ the same --- for example, on the D10V, pointers are 16 bits long,
+ but addresses are 32 bits long. See doc/gdbint.texinfo,
+ ``Pointers Are Not Always Addresses''.
+
+ The upshot is:
+ - gdb's `struct type' always describes the target's
+ representation.
+ - gdb's `struct value' objects should always hold values in
+ target form.
+ - gdb's CORE_ADDR values are addresses in the unified virtual
+ address space that the assembler and linker work with. Thus,
+ since target_read_memory takes a CORE_ADDR as an argument, it
+ can access any memory on the target, even if the processor has
+ separate code and data address spaces.
+
+ So, for example:
+ - If v is a value holding a D10V code pointer, its contents are
+ in target form: a big-endian address left-shifted two bits.
+ - If p is a D10V pointer type, TYPE_LENGTH (p) == 2, just as
+ sizeof (void *) == 2 on the target.
+
+ In this context, builtin_type_CORE_ADDR is a bit odd: it's a
+ target type for a value the target will never see. It's only
+ used to hold the values of (typeless) linker symbols, which are
+ indeed in the unified virtual address space. */
+ builtin_type_void_data_ptr = make_pointer_type (builtin_type_void, NULL);
+ builtin_type_void_func_ptr
+ = lookup_pointer_type (lookup_function_type (builtin_type_void));
+ builtin_type_CORE_ADDR =
+ init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8,
+ TYPE_FLAG_UNSIGNED,
+ "__CORE_ADDR", (struct objfile *) NULL);
+ builtin_type_bfd_vma =
+ init_type (TYPE_CODE_INT, TARGET_BFD_VMA_BIT / 8,
+ TYPE_FLAG_UNSIGNED,
+ "__bfd_vma", (struct objfile *) NULL);
}
-extern void _initialize_gdbtypes PARAMS ((void));
+extern void _initialize_gdbtypes (void);
void
-_initialize_gdbtypes ()
+_initialize_gdbtypes (void)
{
+ struct cmd_list_element *c;
build_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_int128, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_uint128, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4sf, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4si, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v16qi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v8qi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v8hi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_vec128, sizeof (struct type *), NULL);
+ REGISTER_GDBARCH_SWAP (builtin_type_void_data_ptr);
+ REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr);
+ REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
+ REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
+ register_gdbarch_swap (NULL, 0, build_gdbtypes);
+
+ /* Note: These types do not need to be swapped - they are target
+ neutral. */
+ builtin_type_ieee_single_big =
+ init_type (TYPE_CODE_FLT, floatformat_ieee_single_big.totalsize / 8,
+ 0, "builtin_type_ieee_single_big", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ieee_single_big) = &floatformat_ieee_single_big;
+ builtin_type_ieee_single_little =
+ init_type (TYPE_CODE_FLT, floatformat_ieee_single_little.totalsize / 8,
+ 0, "builtin_type_ieee_single_little", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ieee_single_little) = &floatformat_ieee_single_little;
+ builtin_type_ieee_double_big =
+ init_type (TYPE_CODE_FLT, floatformat_ieee_double_big.totalsize / 8,
+ 0, "builtin_type_ieee_double_big", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ieee_double_big) = &floatformat_ieee_double_big;
+ builtin_type_ieee_double_little =
+ init_type (TYPE_CODE_FLT, floatformat_ieee_double_little.totalsize / 8,
+ 0, "builtin_type_ieee_double_little", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ieee_double_little) = &floatformat_ieee_double_little;
+ builtin_type_ieee_double_littlebyte_bigword =
+ init_type (TYPE_CODE_FLT, floatformat_ieee_double_littlebyte_bigword.totalsize / 8,
+ 0, "builtin_type_ieee_double_littlebyte_bigword", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ieee_double_littlebyte_bigword) = &floatformat_ieee_double_littlebyte_bigword;
+ builtin_type_i387_ext =
+ init_type (TYPE_CODE_FLT, floatformat_i387_ext.totalsize / 8,
+ 0, "builtin_type_i387_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_i387_ext) = &floatformat_i387_ext;
+ builtin_type_m68881_ext =
+ init_type (TYPE_CODE_FLT, floatformat_m68881_ext.totalsize / 8,
+ 0, "builtin_type_m68881_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_m68881_ext) = &floatformat_m68881_ext;
+ builtin_type_i960_ext =
+ init_type (TYPE_CODE_FLT, floatformat_i960_ext.totalsize / 8,
+ 0, "builtin_type_i960_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_i960_ext) = &floatformat_i960_ext;
+ builtin_type_m88110_ext =
+ init_type (TYPE_CODE_FLT, floatformat_m88110_ext.totalsize / 8,
+ 0, "builtin_type_m88110_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_m88110_ext) = &floatformat_m88110_ext;
+ builtin_type_m88110_harris_ext =
+ init_type (TYPE_CODE_FLT, floatformat_m88110_harris_ext.totalsize / 8,
+ 0, "builtin_type_m88110_harris_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_m88110_harris_ext) = &floatformat_m88110_harris_ext;
+ builtin_type_arm_ext_big =
+ init_type (TYPE_CODE_FLT, floatformat_arm_ext_big.totalsize / 8,
+ 0, "builtin_type_arm_ext_big", NULL);
+ TYPE_FLOATFORMAT (builtin_type_arm_ext_big) = &floatformat_arm_ext_big;
+ builtin_type_arm_ext_littlebyte_bigword =
+ init_type (TYPE_CODE_FLT, floatformat_arm_ext_littlebyte_bigword.totalsize / 8,
+ 0, "builtin_type_arm_ext_littlebyte_bigword", NULL);
+ TYPE_FLOATFORMAT (builtin_type_arm_ext_littlebyte_bigword) = &floatformat_arm_ext_littlebyte_bigword;
+ builtin_type_ia64_spill_big =
+ init_type (TYPE_CODE_FLT, floatformat_ia64_spill_big.totalsize / 8,
+ 0, "builtin_type_ia64_spill_big", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ia64_spill_big) = &floatformat_ia64_spill_big;
+ builtin_type_ia64_spill_little =
+ init_type (TYPE_CODE_FLT, floatformat_ia64_spill_little.totalsize / 8,
+ 0, "builtin_type_ia64_spill_little", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ia64_spill_little) = &floatformat_ia64_spill_little;
+ builtin_type_ia64_quad_big =
+ init_type (TYPE_CODE_FLT, floatformat_ia64_quad_big.totalsize / 8,
+ 0, "builtin_type_ia64_quad_big", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ia64_quad_big) = &floatformat_ia64_quad_big;
+ builtin_type_ia64_quad_little =
+ init_type (TYPE_CODE_FLT, floatformat_ia64_quad_little.totalsize / 8,
+ 0, "builtin_type_ia64_quad_little", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ia64_quad_little) = &floatformat_ia64_quad_little;
+
+ add_show_from_set (
+ add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug,
+ "Set debugging of C++ overloading.\n\
+ When enabled, ranking of the functions\n\
+ is displayed.", &setdebuglist),
+ &showdebuglist);
}
diff --git a/contrib/gdb/gdb/gdbtypes.h b/contrib/gdb/gdb/gdbtypes.h
index 107eb46..74b521a 100644
--- a/contrib/gdb/gdb/gdbtypes.h
+++ b/contrib/gdb/gdb/gdbtypes.h
@@ -1,27 +1,31 @@
/* Internal type definitions for GDB.
- Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
+/* Forward declarations for prototypes. */
+struct block;
+
/* Codes for `fundamental types'. This is a monstrosity based on the
bogus notion that there are certain compiler-independent
`fundamental types'. None of these is well-defined (how big is
@@ -30,9 +34,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 +76,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
@@ -138,24 +142,27 @@ enum type_code
#define TYPE_CODE_CLASS TYPE_CODE_STRUCT
-/* Some bits for the type's flags word. */
+/* Some bits for the type's flags word, and macros to test them. */
/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
type is signed (unless TYPE_FLAG_NOSIGN (below) is set). */
#define TYPE_FLAG_UNSIGNED (1 << 0)
+#define TYPE_UNSIGNED(t) ((t)->flags & TYPE_FLAG_UNSIGNED)
/* No sign for this type. In C++, "char", "signed char", and "unsigned
char" are distinct types; so we need an extra flag to indicate the
- absence ofa sign! */
+ absence of a sign! */
#define TYPE_FLAG_NOSIGN (1 << 1)
+#define TYPE_NOSIGN(t) ((t)->flags & TYPE_FLAG_NOSIGN)
/* This appears in a type's flags word if it is a stub type (e.g., if
someone referenced a type that wasn't defined in a source file
via (struct sir_not_appearing_in_this_film *)). */
#define TYPE_FLAG_STUB (1 << 2)
+#define TYPE_STUB(t) ((t)->flags & TYPE_FLAG_STUB)
/* The target type of this type is a stub type, and this type needs to
be updated if it gets un-stubbed in check_typedef.
@@ -163,7 +170,8 @@ enum type_code
gets set based on the TYPE_LENGTH of the target type.
Also, set for TYPE_CODE_TYPEDEF. */
-#define TYPE_FLAG_TARGET_STUB (1 << 3)
+#define TYPE_FLAG_TARGET_STUB (1 << 3)
+#define TYPE_TARGET_STUB(t) ((t)->flags & TYPE_FLAG_TARGET_STUB)
/* Static type. If this is set, the corresponding type had
* a static modifier.
@@ -171,243 +179,306 @@ enum type_code
* are indicated by other means (bitpos == -1)
*/
-#define TYPE_FLAG_STATIC (1 << 4)
+#define TYPE_FLAG_STATIC (1 << 4)
+#define TYPE_STATIC(t) ((t)->flags & TYPE_FLAG_STATIC)
/* Constant type. If this is set, the corresponding type has a
* const modifier.
*/
-#define TYPE_FLAG_CONST (1 << 5)
+#define TYPE_FLAG_CONST (1 << 5)
+#define TYPE_CONST(t) ((t)->flags & TYPE_FLAG_CONST)
/* Volatile type. If this is set, the corresponding type has a
* volatile modifier.
*/
-#define TYPE_FLAG_VOLATILE (1 << 6)
+#define TYPE_FLAG_VOLATILE (1 << 6)
+#define TYPE_VOLATILE(t) ((t)->flags & TYPE_FLAG_VOLATILE)
/* This is a function type which appears to have a prototype. We need this
for function calls in order to tell us if it's necessary to coerce the args,
or to just do the standard conversions. This is used with a short field. */
-#define TYPE_FLAG_PROTOTYPED (1 << 7)
+#define TYPE_FLAG_PROTOTYPED (1 << 7)
+#define TYPE_PROTOTYPED(t) ((t)->flags & TYPE_FLAG_PROTOTYPED)
/* 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
the method can be assigned correct types.) */
-#define TYPE_FLAG_INCOMPLETE (1 << 8)
-
-
-struct type
-{
-
- /* Code for kind of type */
+#define TYPE_FLAG_INCOMPLETE (1 << 8)
+#define TYPE_INCOMPLETE(t) ((t)->flags & TYPE_FLAG_INCOMPLETE)
- enum type_code code;
+/* Instruction-space delimited type. This is for Harvard architectures
+ which have separate instruction and data address spaces (and perhaps
+ others).
- /* Name of this type, or NULL if none.
+ GDB usually defines a flat address space that is a superset of the
+ architecture's two (or more) address spaces, but this is an extension
+ of the architecture's model.
- 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. */
+ If TYPE_FLAG_INST is set, an object of the corresponding type
+ resides in instruction memory, even if its address (in the extended
+ flat address space) does not reflect this.
- char *name;
+ Similarly, if TYPE_FLAG_DATA is set, then an object of the
+ corresponding type resides in the data memory space, even if
+ this is not indicated by its (flat address space) address.
- /* 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.
+ If neither flag is set, the default space for functions / methods
+ is instruction space, and for data objects is data memory. */
- 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. */
+#define TYPE_FLAG_CODE_SPACE (1 << 9)
+#define TYPE_CODE_SPACE(t) ((t)->flags & TYPE_FLAG_CODE_SPACE)
- char *tag_name;
+#define TYPE_FLAG_DATA_SPACE (1 << 10)
+#define TYPE_DATA_SPACE(t) ((t)->flags & TYPE_FLAG_DATA_SPACE)
- /* 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. */
+/* FIXME: Kludge to mark a varargs function type for C++ member
+ function argument processing. Currently only used in dwarf2read.c,
+ but put it here so we won't accidentally overload the bit with
+ another flag. */
- unsigned length;
+#define TYPE_FLAG_VARARGS (1 << 11)
+#define TYPE_VARARGS(t) ((t)->flags & TYPE_FLAG_VARARGS)
- /* FIXME, these should probably be restricted to a Fortran-specific
- field in some fashion. */
+struct type
+ {
+
+ /* Code for kind of type */
+
+ enum type_code code;
+
+ /* 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. */
+
+ 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.
+
+ 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;
+
+ /* Length of storage for a value of this type. This is what
+ sizeof(type) would return; use it for address arithmetic,
+ memory reads and writes, etc. This size includes padding. For
+ example, an i386 extended-precision floating point value really
+ only occupies ten bytes, but most ABI's declare its size to be
+ 12 bytes, to preserve alignment. A `struct type' representing
+ such a floating-point type would have a `length' value of 12,
+ even though the last two bytes are unused.
+
+ There's a bit of a host/target mess here, if you're concerned
+ about machines whose bytes aren't eight bits long, or who don't
+ have byte-addressed memory. Various places pass this to memcpy
+ and such, meaning it must be in units of host bytes. Various
+ other places expect they can calculate addresses by adding it
+ and such, meaning it must be in units of target bytes. 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. However, this would still fail to address
+ machines based on a ternary or decimal representation. */
+ unsigned length;
+
+ /* 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;
-
- /* 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. */
+ 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. */
+
+ 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. */
+
+ 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. */
- struct objfile *objfile;
+ struct type *pointer_type;
- /* 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. */
+ /* C++: also need a reference type. */
- struct type *target_type;
+ struct type *reference_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. */
+ /* 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;
- struct type *pointer_type;
+ /* Address-space delimited variant chain. This points to a type
+ that differs from this one only in an address-space qualifier
+ attribute. The otherwise-identical address-space delimited
+ types are chained together in a ring. */
+ struct type *as_type;
- /* C++: also need a reference type. */
+ /* Flags about this type. */
- struct type *reference_type;
+ int flags;
- /* 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;
+ /* Number of fields described for this type */
- /* Flags about this type. */
+ short nfields;
- int flags;
+ /* 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.
- /* Number of fields described for this type */
+ 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. */
- short nfields;
+ 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 range bound or enum value, this is the value itself. */
- /* 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.
+ int bitpos;
- 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. */
+ /* 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. */
- struct field
- {
+ CORE_ADDR physaddr;
+ char *physname;
+ /* For a function type, this is 1 if the argument is marked
+ artificial. Artificial arguments should not be shown to the
+ user. */
+ int artificial;
+ }
+ 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. */
- 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 bitsize;
- int bitpos;
+ /* 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. */
- /* 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. */
+ struct type *type;
- CORE_ADDR physaddr;
- char* physname;
- } loc;
+ /* Name of field, value or argument.
+ NULL for range bounds and array domains. */
- /* 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. */
+ char *name;
- int bitsize;
+ }
+ *fields;
- /* 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. */
+ /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
+ is the base class which defined the virtual function table pointer.
- struct type *type;
+ For types that are pointer to member types (TYPE_CODE_MEMBER),
+ VPTR_BASETYPE is the type that this pointer is a member of.
- /* Name of field, value or argument.
- NULL for range bounds and array domains. */
+ For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
+ type that contains the method.
- char *name;
+ Unused otherwise. */
- } *fields;
+ struct type *vptr_basetype;
- /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
- is the base class which defined the virtual function table pointer.
+ /* 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.
- For types that are pointer to member types (TYPE_CODE_MEMBER),
- VPTR_BASETYPE is the type that this pointer is a member of.
+ Unused if this type does not have virtual functions. */
- For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
- type that contains the method.
+ int vptr_fieldno;
- Unused otherwise. */
+ /* Slot to point to additional language-specific fields of this type. */
- struct type *vptr_basetype;
+ union type_specific
+ {
- /* 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.
+ /* 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. */
- Unused if this type does not have virtual functions. */
+ struct type **arg_types;
- int vptr_fieldno;
+ /* 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. */
- /* Slot to point to additional language-specific fields of this type. */
+ struct cplus_struct_type *cplus_stuff;
- union type_specific
- {
+ /* FLOATFORMAT is for TYPE_CODE_FLT. It is a pointer to the
+ floatformat object that describes the floating-point value
+ that resides within the type. */
- /* ARG_TYPES is for TYPE_CODE_METHOD.
- Contains the type of each argument, ending with a void type
- after the last argument for normal member functions or a NULL
- pointer after the last argument for functions with variable
- arguments. */
-
- struct type **arg_types;
-
- /* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
- cplus_struct_default, a default static instance of a struct
- cplus_struct_type. */
-
- struct cplus_struct_type *cplus_stuff;
-
- } type_specific;
-};
+ const struct floatformat *floatformat;
+ }
+ type_specific;
+ };
#define NULL_TYPE ((struct type *) 0)
@@ -415,160 +486,163 @@ 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 */
- class A{};
- class B{};
- class C : public B, public virtual A {};
+ /* 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:
- B is a baseclass of C; A is a virtual baseclass for C.
- This is a C++ 2.0 language feature. */
+ class A{};
+ class B{};
+ class C : public B, public virtual A {};
- B_TYPE *virtual_field_bits;
+ B is a baseclass of C; A is a virtual baseclass for C.
+ This is a C++ 2.0 language feature. */
- /* 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 *virtual_field_bits;
- B_TYPE *private_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 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 *private_field_bits;
- B_TYPE *protected_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 fields to be ignored, either this is optimized out
- or this field has length 0 */
+ B_TYPE *protected_field_bits;
- B_TYPE *ignore_field_bits;
+ /* for classes with fields to be ignored, either this is optimized out
+ or this field has length 0 */
- /* 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.
+ B_TYPE *ignore_field_bits;
- fn_fieldlists points to an array of nfn_fields of these. */
+ /* 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.
- struct fn_fieldlist
- {
+ fn_fieldlists points to an array of nfn_fields of these. */
- /* The overloaded name. */
+ struct fn_fieldlist
+ {
- char *name;
+ /* The overloaded name. */
- /* The number of methods with this name. */
+ char *name;
- int length;
+ /* The number of methods with this name. */
- /* The list of methods. */
+ int length;
- struct fn_field
- {
+ /* The list of methods. */
- /* 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). */
+ struct fn_field
+ {
- /* 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 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). */
- char *physname;
+ /* 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. */
- /* 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). */
+ char *physname;
- struct type *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). */
- /* 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 *type;
- struct type **args;
+ /* 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. */
- /* For virtual functions.
- First baseclass that defines this virtual function. */
+ struct type **args;
- struct type *fcontext;
+ /* For virtual functions.
+ First baseclass that defines this virtual function. */
- /* Attributes. */
+ struct type *fcontext;
- 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;
+ /* Attributes. */
- /* A stub method only has some fields valid (but they are enough
- to reconstruct the rest of the fields). */
- unsigned int is_stub : 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;
+ unsigned int is_artificial:1;
- /* C++ method that is inlined */
- unsigned int is_inlined : 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;
- /* Unused. */
- unsigned int dummy : 4;
+ /* C++ method that is inlined */
+ unsigned int is_inlined:1;
- /* Index into that baseclass's virtual function table,
- minus 2; else if static: VOFFSET_STATIC; else: 0. */
+ /* Unused. */
+ unsigned int dummy:3;
- unsigned int voffset : 16;
+ /* Index into that baseclass's virtual function table,
+ minus 2; else if static: VOFFSET_STATIC; else: 0. */
-# define VOFFSET_STATIC 1
+ unsigned int voffset:16;
- } *fn_fields;
+#define VOFFSET_STATIC 1
- } *fn_fieldlists;
+ }
+ *fn_fields;
+
+ }
+ *fn_fieldlists;
/* If this "struct type" describes a template, then it
* has arguments. "template_args" points to an array of
@@ -579,10 +653,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,41 +685,45 @@ 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. */
extern const struct cplus_struct_type cplus_struct_default;
-extern void
-allocate_cplus_struct_type PARAMS ((struct type *));
+extern void allocate_cplus_struct_type (struct type *);
#define INIT_CPLUS_SPECIFIC(type) \
(TYPE_CPLUS_SPECIFIC(type)=(struct cplus_struct_type*)&cplus_struct_default)
@@ -658,6 +737,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
#define TYPE_CV_TYPE(thistype) (thistype)->cv_type
+#define TYPE_AS_TYPE(thistype) (thistype)->as_type
/* Note that if thistype is a TYPEDEF type, you have to call check_typedef.
But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
so you only have to call check_typedef once. Since allocate_value
@@ -665,12 +745,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_LENGTH(thistype) (thistype)->length
#define TYPE_OBJFILE(thistype) (thistype)->objfile
#define TYPE_FLAGS(thistype) (thistype)->flags
-#define TYPE_UNSIGNED(thistype) ((thistype)->flags & TYPE_FLAG_UNSIGNED)
-#define TYPE_NOSIGN(thistype) ((thistype)->flags & TYPE_FLAG_NOSIGN)
-#define TYPE_CONST(thistype) ((thistype)->flags & TYPE_FLAG_CONST)
-#define TYPE_VOLATILE(thistype) ((thistype)->flags & TYPE_FLAG_VOLATILE)
-#define TYPE_INCOMPLETE(thistype) ((thistype)->flags & TYPE_FLAG_INCOMPLETE)
-/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you wan the real
+/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
type, you need to do TYPE_CODE (check_type (this_type)). */
#define TYPE_CODE(thistype) (thistype)->code
#define TYPE_NFIELDS(thistype) (thistype)->nfields
@@ -707,6 +782,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific
#define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types
#define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff
+#define TYPE_FLOATFORMAT(thistype) (thistype)->type_specific.floatformat
#define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type
#define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
#define TYPE_BASECLASS_NAME(thistype,index) (thistype)->fields[index].name
@@ -721,6 +797,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define FIELD_TYPE(thisfld) ((thisfld).type)
#define FIELD_NAME(thisfld) ((thisfld).name)
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
+#define FIELD_ARTIFICIAL(thisfld) ((thisfld).loc.artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
@@ -732,6 +809,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
+#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
#define TYPE_TEMPLATE_ARG(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->template_args[n]
@@ -790,6 +868,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_FN_FIELD_FINAL(thisfn, n) ((thisfn)[n].is_final)
#define TYPE_FN_FIELD_SYNCHRONIZED(thisfn, n) ((thisfn)[n].is_synchronized)
#define TYPE_FN_FIELD_NATIVE(thisfn, n) ((thisfn)[n].is_native)
+#define TYPE_FN_FIELD_ARTIFICIAL(thisfn, n) ((thisfn)[n].is_artificial)
#define TYPE_FN_FIELD_ABSTRACT(thisfn, n) ((thisfn)[n].is_abstract)
#define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
#define TYPE_FN_FIELD_INLINED(thisfn, n) ((thisfn)[n].is_inlined)
@@ -803,18 +882,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;
@@ -834,7 +913,29 @@ extern struct type *builtin_type_double_complex;
extern struct type *builtin_type_string;
extern struct type *builtin_type_bool;
-/* Explicit sizes - see <intypes.h> for naming schema */
+/* Address/pointer types: */
+/* (C) Language `pointer to data' type. Some target platforms use an
+ implicitly {sign,zero} -extended 32 bit C language pointer on a 64
+ bit ISA. */
+extern struct type *builtin_type_void_data_ptr;
+
+/* (C) Language `pointer to function returning void' type. Since
+ ANSI, C standards have explicitly said that pointers to functions
+ and pointers to data are not interconvertible --- that is, you
+ can't cast a function pointer to void * and back, and expect to get
+ the same value. However, all function pointer types are
+ interconvertible, so void (*) () can server as a generic function
+ pointer. */
+extern struct type *builtin_type_void_func_ptr;
+
+/* The target CPU's address type. This is the ISA address size. */
+extern struct type *builtin_type_CORE_ADDR;
+/* The symbol table address type. Some object file formats have a 32
+ bit address type even though the TARGET has a 64 bit pointer type
+ (cf MIPS). */
+extern struct type *builtin_type_bfd_vma;
+
+/* Explicit sizes - see C9X <intypes.h> for naming scheme */
extern struct type *builtin_type_int8;
extern struct type *builtin_type_uint8;
extern struct type *builtin_type_int16;
@@ -843,6 +944,43 @@ extern struct type *builtin_type_int32;
extern struct type *builtin_type_uint32;
extern struct type *builtin_type_int64;
extern struct type *builtin_type_uint64;
+extern struct type *builtin_type_int128;
+extern struct type *builtin_type_uint128;
+
+/* SIMD types. We inherit these names from GCC. */
+extern struct type *builtin_type_v4sf;
+extern struct type *builtin_type_v4si;
+extern struct type *builtin_type_v16qi;
+extern struct type *builtin_type_v8qi;
+extern struct type *builtin_type_v8hi;
+extern struct type *builtin_type_v4hi;
+extern struct type *builtin_type_v2si;
+
+/* Type for 128 bit vectors. */
+extern struct type *builtin_type_vec128;
+
+/* Explicit floating-point formats. See "floatformat.h". */
+extern struct type *builtin_type_ieee_single_big;
+extern struct type *builtin_type_ieee_single_little;
+extern struct type *builtin_type_ieee_double_big;
+extern struct type *builtin_type_ieee_double_little;
+extern struct type *builtin_type_ieee_double_littlebyte_bigword;
+extern struct type *builtin_type_i387_ext;
+extern struct type *builtin_type_m68881_ext;
+extern struct type *builtin_type_i960_ext;
+extern struct type *builtin_type_m88110_ext;
+extern struct type *builtin_type_m88110_harris_ext;
+extern struct type *builtin_type_arm_ext_big;
+extern struct type *builtin_type_arm_ext_littlebyte_bigword;
+extern struct type *builtin_type_ia64_spill_big;
+extern struct type *builtin_type_ia64_spill_little;
+extern struct type *builtin_type_ia64_quad_big;
+extern struct type *builtin_type_ia64_quad_little;
+
+/* We use this for the '/c' print format, because builtin_type_char is
+ just a one-byte integral type, which languages less laid back than
+ C will print as ... well, a one-byte integral type. */
+extern struct type *builtin_type_true_char;
/* This type represents a type that was unrecognized in symbol
read-in. */
@@ -872,11 +1010,10 @@ extern struct type *builtin_type_chill_real;
extern struct type *builtin_type_f_character;
extern struct type *builtin_type_f_integer;
+extern struct type *builtin_type_f_integer_s2;
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_s2;
extern struct type *builtin_type_f_real;
extern struct type *builtin_type_f_real_s8;
extern struct type *builtin_type_f_real_s16;
@@ -886,17 +1023,17 @@ 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 */
#define MAX_OF_TYPE(t) \
- TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
- : MAX_OF_SIZE(TYPE_LENGTH(t))
+ (TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
+ : MAX_OF_SIZE(TYPE_LENGTH(t)))
#define MIN_OF_TYPE(t) \
- TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
- : MIN_OF_SIZE(TYPE_LENGTH(t))
+ (TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
+ : MIN_OF_SIZE(TYPE_LENGTH(t)))
/* Allocate space for storing data associated with a particular type.
We ensure that the space is allocated using the same mechanism that
@@ -912,132 +1049,110 @@ extern struct type *builtin_type_f_void;
? obstack_alloc (&TYPE_OBJFILE (t) -> type_obstack, size) \
: xmalloc (size))
-extern struct type *
-alloc_type PARAMS ((struct objfile *));
+extern struct type *alloc_type (struct objfile *);
+
+extern struct type *init_type (enum type_code, int, int, char *,
+ struct objfile *);
+
+extern struct type *lookup_reference_type (struct type *);
+
+extern struct type *make_reference_type (struct type *, struct type **);
-extern struct type *
-init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
+extern struct type *make_cv_type (int, int, struct type *, struct type **);
-extern struct type *
-lookup_reference_type PARAMS ((struct type *));
+extern void finish_cv_type (struct type *);
-extern struct type *
-make_reference_type PARAMS ((struct type *, struct type **));
+extern void replace_type (struct type *, struct type *);
-extern struct type *
-make_cv_type PARAMS ((int, int, struct type *, struct type **));
+extern int address_space_name_to_int (char *);
-extern struct type *
-lookup_member_type PARAMS ((struct type *, struct type *));
+extern char *address_space_int_to_name (int);
+
+extern struct type *make_type_with_address_space (struct type *type,
+ int space_identifier);
+
+extern struct type *lookup_member_type (struct type *, struct type *);
extern void
-smash_to_method_type PARAMS ((struct type *, struct type *, struct type *,
- struct type **));
+smash_to_method_type (struct type *, struct type *, struct type *,
+ struct type **);
extern void
-smash_to_member_type PARAMS ((struct type *, struct type *, struct type *));
+smash_to_member_type (struct type *, struct type *, struct type *);
-extern struct type *
-allocate_stub_method PARAMS ((struct type *));
+extern struct type *allocate_stub_method (struct type *);
-extern char *
-type_name_no_tag PARAMS ((const struct type *));
+extern char *type_name_no_tag (const struct type *);
-extern struct type *
-lookup_struct_elt_type PARAMS ((struct type *, char *, int));
+extern struct type *lookup_struct_elt_type (struct type *, char *, int);
-extern struct type *
-make_pointer_type PARAMS ((struct type *, struct type **));
+extern struct type *make_pointer_type (struct type *, struct type **);
-extern struct type *
-lookup_pointer_type PARAMS ((struct type *));
+extern struct type *lookup_pointer_type (struct type *);
-extern struct type *
-make_function_type PARAMS ((struct type *, struct type **));
+extern struct type *make_function_type (struct type *, struct type **);
-extern struct type *
-lookup_function_type PARAMS ((struct type *));
+extern struct type *lookup_function_type (struct type *);
-extern struct type *
-create_range_type PARAMS ((struct type *, struct type *, int, int));
+extern struct type *create_range_type (struct type *, struct type *, int,
+ int);
-extern struct type *
-create_array_type PARAMS ((struct type *, struct type *, struct type *));
+extern struct type *create_array_type (struct type *, struct type *,
+ struct type *);
-extern struct type *
-create_string_type PARAMS ((struct type *, struct type *));
+extern struct type *create_string_type (struct type *, struct type *);
-extern struct type *create_set_type PARAMS ((struct type *, struct type *));
+extern struct type *create_set_type (struct type *, struct type *);
-extern int chill_varying_type PARAMS ((struct type*));
+extern int chill_varying_type (struct type *);
-extern struct type *
-lookup_unsigned_typename PARAMS ((char *));
+extern struct type *lookup_unsigned_typename (char *);
-extern struct type *
-lookup_signed_typename PARAMS ((char *));
+extern struct type *lookup_signed_typename (char *);
-extern struct type *
-check_typedef PARAMS ((struct type *));
+extern struct type *check_typedef (struct type *);
#define CHECK_TYPEDEF(TYPE) (TYPE) = check_typedef (TYPE)
-extern void
-check_stub_method PARAMS ((struct type *, int, int));
+extern void check_stub_method (struct type *, int, int);
-extern struct type *
-lookup_primitive_typename PARAMS ((char *));
+extern struct type *lookup_primitive_typename (char *);
-extern char *
-gdb_mangle_name PARAMS ((struct type *, int, int));
+extern char *gdb_mangle_name (struct type *, int, int);
-extern struct type *
-builtin_type PARAMS ((char **));
+extern struct type *builtin_type (char **);
-extern struct type *
-lookup_typename PARAMS ((char *, struct block *, int));
+extern struct type *lookup_typename (char *, struct block *, int);
-extern struct type *
-lookup_template_type PARAMS ((char *, struct type *, struct block *));
+extern struct type *lookup_template_type (char *, struct type *,
+ struct block *);
-extern struct type *
-lookup_fundamental_type PARAMS ((struct objfile *, int));
+extern struct type *lookup_fundamental_type (struct objfile *, int);
-extern void
-fill_in_vptr_fieldno PARAMS ((struct type *));
+extern void fill_in_vptr_fieldno (struct type *);
-extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *));
+extern int get_destructor_fn_field (struct type *, int *, int *);
-extern int get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
+extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *);
-extern int
-is_ancestor PARAMS ((struct type *, struct type *));
+extern int is_ancestor (struct type *, struct type *);
-extern int
-has_vtable PARAMS ((struct type *));
+extern int has_vtable (struct type *);
-extern struct type *
-primary_base_class PARAMS ((struct type *));
+extern struct type *primary_base_class (struct type *);
-extern struct type **
-virtual_base_list PARAMS ((struct type *));
+extern struct type **virtual_base_list (struct type *);
-extern int
-virtual_base_list_length PARAMS ((struct type *));
-extern int
-virtual_base_list_length_skip_primaries PARAMS ((struct type *));
+extern int virtual_base_list_length (struct type *);
+extern int virtual_base_list_length_skip_primaries (struct type *);
-extern int
-virtual_base_index PARAMS ((struct type *, struct type *));
-extern int
-virtual_base_index_skip_primaries PARAMS ((struct type *, struct type *));
+extern int virtual_base_index (struct type *, struct type *);
+extern int virtual_base_index_skip_primaries (struct type *, struct type *);
-extern int
-class_index_in_primary_list PARAMS ((struct type *));
+extern int class_index_in_primary_list (struct type *);
-extern int
-count_virtual_fns PARAMS ((struct type*));
+extern int count_virtual_fns (struct type *);
/* Constants for HP/Taligent ANSI C++ runtime model */
@@ -1068,9 +1183,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
@@ -1095,41 +1210,34 @@ count_virtual_fns PARAMS ((struct type*));
#define POINTER_CONVERSION_BADNESS 2
/* Badness of conversion of pointer to void pointer */
#define VOID_PTR_CONVERSION_BADNESS 2
-/* Badness of convering derived to base class */
+/* Badness of converting derived to base class */
#define BASE_CONVERSION_BADNESS 2
+/* Badness of converting from non-reference to reference */
+#define REFERENCE_CONVERSION_BADNESS 2
/* Non-standard conversions allowed by the debugger */
/* Converting a pointer to an int is usually OK */
#define NS_POINTER_CONVERSION_BADNESS 10
-extern int
-compare_badness PARAMS ((struct badness_vector *, struct badness_vector *));
+extern int compare_badness (struct badness_vector *, struct badness_vector *);
-extern struct badness_vector *
-rank_function PARAMS ((struct type **, int, struct type **, int));
+extern struct badness_vector *rank_function (struct type **, int,
+ struct type **, int);
-extern int
-rank_one_type PARAMS ((struct type *, struct type *));
+extern int rank_one_type (struct type *, struct type *);
-
-#if MAINTENANCE_CMDS
-extern void recursive_dump_type PARAMS ((struct type *, int));
-#endif
+extern void recursive_dump_type (struct type *, int);
/* printcmd.c */
-extern void
-print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
-
-extern int can_dereference PARAMS ((struct type *));
+extern void print_scalar_formatted (char *, struct type *, int, int,
+ struct ui_file *);
-#if MAINTENANCE_CMDS
-extern void maintenance_print_type PARAMS ((char *, int));
-#endif
+extern int can_dereference (struct type *);
-/* typeprint.c */
+extern int is_integral_type (struct type *);
-extern void print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
+extern void maintenance_print_type (char *, int);
-#endif /* GDBTYPES_H */
+#endif /* GDBTYPES_H */
diff --git a/contrib/gdb/gdb/gnu-v2-abi.c b/contrib/gdb/gdb/gnu-v2-abi.c
new file mode 100644
index 0000000..2b086c5
--- /dev/null
+++ b/contrib/gdb/gdb/gnu-v2-abi.c
@@ -0,0 +1,429 @@
+/* Abstraction of GNU v2 abi.
+ Contributed by Daniel Berlin <dberlin@redhat.com>
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or
+ modify
+ it under the terms of the GNU General Public License as published
+ by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdb_string.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "value.h"
+#include "demangle.h"
+#include "cp-abi.h"
+
+#include <ctype.h>
+
+struct cp_abi_ops gnu_v2_abi_ops;
+
+static int vb_match (struct type *, int, struct type *);
+int gnuv2_baseclass_offset (struct type *type, int index, char *valaddr,
+ CORE_ADDR address);
+
+static enum dtor_kinds
+gnuv2_is_destructor_name (const char *name)
+{
+ if ((name[0] == '_' && is_cplus_marker (name[1]) && name[2] == '_')
+ || strncmp (name, "__dt__", 6) == 0)
+ return complete_object_dtor;
+ else
+ return 0;
+}
+
+static enum ctor_kinds
+gnuv2_is_constructor_name (const char *name)
+{
+ if ((name[0] == '_' && name[1] == '_'
+ && (isdigit (name[2]) || strchr ("Qt", name[2])))
+ || strncmp (name, "__ct__", 6) == 0)
+ return complete_object_ctor;
+ else
+ return 0;
+}
+
+static int
+gnuv2_is_vtable_name (const char *name)
+{
+ return (((name)[0] == '_'
+ && (((name)[1] == 'V' && (name)[2] == 'T')
+ || ((name)[1] == 'v' && (name)[2] == 't'))
+ && is_cplus_marker ((name)[3])) ||
+ ((name)[0] == '_' && (name)[1] == '_'
+ && (name)[2] == 'v' && (name)[3] == 't' && (name)[4] == '_'));
+}
+
+static int
+gnuv2_is_operator_name (const char *name)
+{
+ return strncmp (name, "operator", 8) == 0;
+}
+
+
+/* Return a virtual function as a value.
+ ARG1 is the object which provides the virtual function
+ table pointer. *ARG1P is side-effected in calling this function.
+ F is the list of member functions which contains the desired virtual
+ function.
+ J is an index into F which provides the desired virtual function.
+
+ TYPE is the type in which F is located. */
+static struct value *
+gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
+ struct type * type, int offset)
+{
+ struct value *arg1 = *arg1p;
+ struct type *type1 = check_typedef (VALUE_TYPE (arg1));
+
+
+ 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. */
+ struct value *entry;
+ struct value *vfn;
+ struct value *vtbl;
+ struct value *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);
+ context = lookup_pointer_type (fcontext);
+ /* Now context is a pointer to the basetype containing the vtbl. */
+ if (TYPE_TARGET_TYPE (context) != type1)
+ {
+ struct value *tmp = value_cast (context, value_addr (arg1));
+ arg1 = value_ind (tmp);
+ type1 = check_typedef (VALUE_TYPE (arg1));
+ }
+
+ context = type1;
+ /* Now context is the basetype containing the vtbl. */
+
+ /* This type may have been defined before its virtual function table
+ 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);
+
+ /* 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. */
+ if (TYPE_CODE (VALUE_TYPE (vtbl)) == TYPE_CODE_PTR
+ && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (vtbl))) == TYPE_CODE_ARRAY)
+ {
+ /* Handle the case where the vtbl field points to an
+ array of structures. */
+ vtbl = value_ind (vtbl);
+
+ /* Index into the virtual function table. This is hard-coded because
+ looking up a field is not cheap, and it may be important to save
+ time, e.g. if the user has set a conditional breakpoint calling
+ a virtual function. */
+ entry = value_subscript (vtbl, vi);
+ }
+ else
+ {
+ /* Handle the case where the vtbl field points directly to a structure. */
+ vtbl = value_add (vtbl, vi);
+ entry = value_ind (vtbl);
+ }
+
+ 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);
+ }
+ else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
+ vfn = entry;
+ else
+ 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));
+
+ *arg1p = arg1;
+ return vfn;
+}
+
+
+struct type *
+gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
+{
+ struct type *known_type;
+ struct type *rtti_type;
+ CORE_ADDR coreptr;
+ struct value *vp;
+ int using_enclosing = 0;
+ long top_offset = 0;
+ char rtti_type_name[256];
+ CORE_ADDR vtbl;
+ struct minimal_symbol *minsym;
+ struct symbol *sym;
+ char *demangled_name;
+ struct type *btype;
+
+ if (full)
+ *full = 0;
+ if (top)
+ *top = -1;
+ if (using_enc)
+ *using_enc = 0;
+
+ /* Get declared type */
+ known_type = VALUE_TYPE (v);
+ CHECK_TYPEDEF (known_type);
+ /* RTTI works only or class objects */
+ if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
+ return NULL;
+
+ /* Plan on this changing in the future as i get around to setting
+ the vtables properly for G++ compiled stuff. Also, I'll be using
+ the type info functions, which are always right. Deal with it
+ until then. */
+
+ /* If the type has no vptr fieldno, try to get it filled in */
+ if (TYPE_VPTR_FIELDNO(known_type) < 0)
+ fill_in_vptr_fieldno(known_type);
+
+ /* If we still can't find one, give up */
+ if (TYPE_VPTR_FIELDNO(known_type) < 0)
+ return NULL;
+
+ /* Make sure our basetype and known type match, otherwise, cast
+ so we can get at the vtable properly.
+ */
+ btype = TYPE_VPTR_BASETYPE (known_type);
+ CHECK_TYPEDEF (btype);
+ if (btype != known_type )
+ {
+ v = value_cast (btype, v);
+ if (using_enc)
+ *using_enc=1;
+ }
+ /*
+ We can't use value_ind here, because it would want to use RTTI, and
+ we'd waste a bunch of time figuring out we already know the type.
+ Besides, we don't care about the type, just the actual pointer
+ */
+ if (VALUE_ADDRESS (value_field (v, TYPE_VPTR_FIELDNO (known_type))) == 0)
+ return NULL;
+
+ /*
+ If we are enclosed by something that isn't us, adjust the
+ address properly and set using_enclosing.
+ */
+ if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
+ {
+ struct value *tempval;
+ int bitpos = TYPE_BASECLASS_BITPOS (known_type,
+ TYPE_VPTR_FIELDNO (known_type));
+ tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));
+ VALUE_ADDRESS(tempval) += bitpos / 8;
+ vtbl=value_as_address (tempval);
+ using_enclosing=1;
+ }
+ else
+ {
+ vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
+ using_enclosing=0;
+ }
+
+ /* Try to find a symbol that is the vtable */
+ minsym=lookup_minimal_symbol_by_pc(vtbl);
+ if (minsym==NULL
+ || (demangled_name=SYMBOL_NAME(minsym))==NULL
+ || !is_vtable_name (demangled_name))
+ return NULL;
+
+ /* If we just skip the prefix, we get screwed by namespaces */
+ demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI);
+ *(strchr(demangled_name,' '))=0;
+
+ /* Lookup the type for the name */
+ rtti_type=lookup_typename(demangled_name, (struct block *)0,1);
+
+ if (rtti_type==NULL)
+ return NULL;
+
+ if (TYPE_N_BASECLASSES(rtti_type) > 1 && full && (*full) != 1)
+ {
+ if (top)
+ *top=TYPE_BASECLASS_BITPOS(rtti_type,TYPE_VPTR_FIELDNO(rtti_type))/8;
+ if (top && ((*top) >0))
+ {
+ if (TYPE_LENGTH(rtti_type) > TYPE_LENGTH(known_type))
+ {
+ if (full)
+ *full=0;
+ }
+ else
+ {
+ if (full)
+ *full=1;
+ }
+ }
+ }
+ else
+ {
+ if (full)
+ *full=1;
+ }
+ if (using_enc)
+ *using_enc=using_enclosing;
+
+ return rtti_type;
+}
+
+/* Return true if the INDEXth field of TYPE is a virtual baseclass
+ pointer which is for the base class whose type is BASECLASS. */
+
+static int
+vb_match (struct type *type, int index, struct type *basetype)
+{
+ struct type *fieldtype;
+ char *name = TYPE_FIELD_NAME (type, index);
+ char *field_class_name = NULL;
+
+ if (*name != '_')
+ return 0;
+ /* gcc 2.4 uses _vb$. */
+ if (name[1] == 'v' && name[2] == 'b' && is_cplus_marker (name[3]))
+ field_class_name = name + 4;
+ /* gcc 2.5 will use __vb_. */
+ if (name[1] == '_' && name[2] == 'v' && name[3] == 'b' && name[4] == '_')
+ field_class_name = name + 5;
+
+ if (field_class_name == NULL)
+ /* This field is not a virtual base class pointer. */
+ return 0;
+
+ /* It's a virtual baseclass pointer, now we just need to find out whether
+ it is for this baseclass. */
+ fieldtype = TYPE_FIELD_TYPE (type, index);
+ if (fieldtype == NULL
+ || TYPE_CODE (fieldtype) != TYPE_CODE_PTR)
+ /* "Can't happen". */
+ return 0;
+
+ /* What we check for is that either the types are equal (needed for
+ nameless types) or have the same name. This is ugly, and a more
+ elegant solution should be devised (which would probably just push
+ the ugliness into symbol reading unless we change the stabs format). */
+ if (TYPE_TARGET_TYPE (fieldtype) == basetype)
+ return 1;
+
+ if (TYPE_NAME (basetype) != NULL
+ && TYPE_NAME (TYPE_TARGET_TYPE (fieldtype)) != NULL
+ && STREQ (TYPE_NAME (basetype),
+ TYPE_NAME (TYPE_TARGET_TYPE (fieldtype))))
+ return 1;
+ return 0;
+}
+
+/* Compute the offset of the baseclass which is
+ the INDEXth baseclass of class TYPE,
+ for value at VALADDR (in host) at ADDRESS (in target).
+ The result is the offset of the baseclass value relative
+ to (the address of)(ARG) + OFFSET.
+
+ -1 is returned on error. */
+
+int
+gnuv2_baseclass_offset (struct type *type, int index, char *valaddr,
+ CORE_ADDR address)
+{
+ struct type *basetype = TYPE_BASECLASS (type, index);
+
+ if (BASETYPE_VIA_VIRTUAL (type, index))
+ {
+ /* Must hunt for the pointer to this virtual baseclass. */
+ register int i, len = TYPE_NFIELDS (type);
+ register int n_baseclasses = TYPE_N_BASECLASSES (type);
+
+ /* First look for the virtual baseclass pointer
+ 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));
+
+ return addr - (LONGEST) address;
+ }
+ }
+ /* Not in the fields, so try looking through the baseclasses. */
+ for (i = index + 1; i < n_baseclasses; i++)
+ {
+ int boffset =
+ baseclass_offset (type, i, valaddr, address);
+ if (boffset)
+ return boffset;
+ }
+ /* Not found. */
+ return -1;
+ }
+
+ /* Baseclass is easily computed. */
+ return TYPE_BASECLASS_BITPOS (type, index) / 8;
+}
+
+static void
+init_gnuv2_ops (void)
+{
+ gnu_v2_abi_ops.shortname = "gnu-v2";
+ gnu_v2_abi_ops.longname = "GNU G++ Version 2 ABI";
+ gnu_v2_abi_ops.doc = "G++ Version 2 ABI";
+ gnu_v2_abi_ops.is_destructor_name = gnuv2_is_destructor_name;
+ gnu_v2_abi_ops.is_constructor_name = gnuv2_is_constructor_name;
+ gnu_v2_abi_ops.is_vtable_name = gnuv2_is_vtable_name;
+ gnu_v2_abi_ops.is_operator_name = gnuv2_is_operator_name;
+ gnu_v2_abi_ops.virtual_fn_field = gnuv2_virtual_fn_field;
+ gnu_v2_abi_ops.rtti_type = gnuv2_value_rtti_type;
+ gnu_v2_abi_ops.baseclass_offset = gnuv2_baseclass_offset;
+}
+
+void
+_initialize_gnu_v2_abi (void)
+{
+ init_gnuv2_ops ();
+ register_cp_abi (gnu_v2_abi_ops);
+ switch_to_cp_abi ("gnu-v2");
+}
diff --git a/contrib/gdb/gdb/gnu-v3-abi.c b/contrib/gdb/gdb/gnu-v3-abi.c
new file mode 100644
index 0000000..ae2104d
--- /dev/null
+++ b/contrib/gdb/gdb/gnu-v3-abi.c
@@ -0,0 +1,434 @@
+/* Abstraction of GNU v3 abi.
+ Contributed by Jim Blandy <jimb@redhat.com>
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "cp-abi.h"
+#include "demangle.h"
+#include "gdb_assert.h"
+
+static struct cp_abi_ops gnu_v3_abi_ops;
+
+static int
+gnuv3_is_vtable_name (const char *name)
+{
+ return strncmp (name, "_ZTV", 4) == 0;
+}
+
+static int
+gnuv3_is_operator_name (const char *name)
+{
+ return strncmp (name, "operator", 8) == 0;
+}
+
+
+/* To help us find the components of a vtable, we build ourselves a
+ GDB type object representing the vtable structure. Following the
+ V3 ABI, it goes something like this:
+
+ struct gdb_gnu_v3_abi_vtable {
+
+ / * An array of virtual call and virtual base offsets. The real
+ length of this array depends on the class hierarchy; we use
+ negative subscripts to access the elements. Yucky, but
+ better than the alternatives. * /
+ ptrdiff_t vcall_and_vbase_offsets[0];
+
+ / * The offset from a virtual pointer referring to this table
+ to the top of the complete object. * /
+ ptrdiff_t offset_to_top;
+
+ / * The type_info pointer for this class. This is really a
+ std::type_info *, but GDB doesn't really look at the
+ type_info object itself, so we don't bother to get the type
+ exactly right. * /
+ void *type_info;
+
+ / * Virtual table pointers in objects point here. * /
+
+ / * Virtual function pointers. Like the vcall/vbase array, the
+ real length of this table depends on the class hierarchy. * /
+ void (*virtual_functions[0]) ();
+
+ };
+
+ The catch, of course, is that the exact layout of this table
+ depends on the ABI --- word size, endianness, alignment, etc. So
+ the GDB type object is actually a per-architecture kind of thing.
+
+ vtable_type_gdbarch_data is a gdbarch per-architecture data pointer
+ which refers to the struct type * for this structure, laid out
+ appropriately for the architecture. */
+static struct gdbarch_data *vtable_type_gdbarch_data;
+
+
+/* Human-readable names for the numbers of the fields above. */
+enum {
+ vtable_field_vcall_and_vbase_offsets,
+ vtable_field_offset_to_top,
+ vtable_field_type_info,
+ vtable_field_virtual_functions
+};
+
+
+/* Return a GDB type representing `struct gdb_gnu_v3_abi_vtable',
+ described above, laid out appropriately for ARCH.
+
+ We use this function as the gdbarch per-architecture data
+ initialization function. We assume that the gdbarch framework
+ calls the per-architecture data initialization functions after it
+ sets current_gdbarch to the new architecture. */
+static void *
+build_gdb_vtable_type (struct gdbarch *arch)
+{
+ struct type *t;
+ struct field *field_list, *field;
+ int offset;
+
+ struct type *void_ptr_type
+ = lookup_pointer_type (builtin_type_void);
+ struct type *ptr_to_void_fn_type
+ = lookup_pointer_type (lookup_function_type (builtin_type_void));
+
+ /* ARCH can't give us the true ptrdiff_t type, so we guess. */
+ struct type *ptrdiff_type
+ = init_type (TYPE_CODE_INT, TARGET_PTR_BIT / TARGET_CHAR_BIT, 0,
+ "ptrdiff_t", 0);
+
+ /* We assume no padding is necessary, since GDB doesn't know
+ anything about alignment at the moment. If this assumption bites
+ us, we should add a gdbarch method which, given a type, returns
+ the alignment that type requires, and then use that here. */
+
+ /* Build the field list. */
+ field_list = xmalloc (sizeof (struct field [4]));
+ memset (field_list, 0, sizeof (struct field [4]));
+ field = &field_list[0];
+ offset = 0;
+
+ /* ptrdiff_t vcall_and_vbase_offsets[0]; */
+ FIELD_NAME (*field) = "vcall_and_vbase_offsets";
+ FIELD_TYPE (*field)
+ = create_array_type (0, ptrdiff_type,
+ create_range_type (0, builtin_type_int, 0, -1));
+ FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
+ offset += TYPE_LENGTH (FIELD_TYPE (*field));
+ field++;
+
+ /* ptrdiff_t offset_to_top; */
+ FIELD_NAME (*field) = "offset_to_top";
+ FIELD_TYPE (*field) = ptrdiff_type;
+ FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
+ offset += TYPE_LENGTH (FIELD_TYPE (*field));
+ field++;
+
+ /* void *type_info; */
+ FIELD_NAME (*field) = "type_info";
+ FIELD_TYPE (*field) = void_ptr_type;
+ FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
+ offset += TYPE_LENGTH (FIELD_TYPE (*field));
+ field++;
+
+ /* void (*virtual_functions[0]) (); */
+ FIELD_NAME (*field) = "virtual_functions";
+ FIELD_TYPE (*field)
+ = create_array_type (0, ptr_to_void_fn_type,
+ create_range_type (0, builtin_type_int, 0, -1));
+ FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
+ offset += TYPE_LENGTH (FIELD_TYPE (*field));
+ field++;
+
+ /* We assumed in the allocation above that there were four fields. */
+ gdb_assert (field == (field_list + 4));
+
+ t = init_type (TYPE_CODE_STRUCT, offset, 0, 0, 0);
+ TYPE_NFIELDS (t) = field - field_list;
+ TYPE_FIELDS (t) = field_list;
+ TYPE_TAG_NAME (t) = "gdb_gnu_v3_abi_vtable";
+
+ return t;
+}
+
+
+/* Return the offset from the start of the imaginary `struct
+ gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
+ (i.e., where objects' virtual table pointers point). */
+static int
+vtable_address_point_offset ()
+{
+ struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+
+ return (TYPE_FIELD_BITPOS (vtable_type, vtable_field_virtual_functions)
+ / TARGET_CHAR_BIT);
+}
+
+
+static struct type *
+gnuv3_rtti_type (struct value *value,
+ int *full_p, int *top_p, int *using_enc_p)
+{
+ struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+ struct type *value_type = check_typedef (VALUE_TYPE (value));
+ CORE_ADDR vtable_address;
+ struct value *vtable;
+ struct minimal_symbol *vtable_symbol;
+ const char *vtable_symbol_name;
+ const char *class_name;
+ struct symbol *class_symbol;
+ struct type *run_time_type;
+ struct type *base_type;
+ LONGEST offset_to_top;
+
+ /* We only have RTTI for class objects. */
+ if (TYPE_CODE (value_type) != TYPE_CODE_CLASS)
+ return NULL;
+
+ /* If we can't find the virtual table pointer for value_type, we
+ can't find the RTTI. */
+ fill_in_vptr_fieldno (value_type);
+ if (TYPE_VPTR_FIELDNO (value_type) == -1)
+ return NULL;
+
+ if (using_enc_p)
+ *using_enc_p = 0;
+
+ /* Fetch VALUE's virtual table pointer, and tweak it to point at
+ an instance of our imaginary gdb_gnu_v3_abi_vtable structure. */
+ base_type = check_typedef (TYPE_VPTR_BASETYPE (value_type));
+ if (value_type != base_type)
+ {
+ value = value_cast (base_type, value);
+ if (using_enc_p)
+ *using_enc_p = 1;
+ }
+ vtable_address
+ = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (value_type)));
+ vtable = value_at_lazy (vtable_type,
+ vtable_address - vtable_address_point_offset (),
+ VALUE_BFD_SECTION (value));
+
+ /* Find the linker symbol for this vtable. */
+ vtable_symbol
+ = lookup_minimal_symbol_by_pc (VALUE_ADDRESS (vtable)
+ + VALUE_OFFSET (vtable)
+ + VALUE_EMBEDDED_OFFSET (vtable));
+ if (! vtable_symbol)
+ return NULL;
+
+ /* The symbol's demangled name should be something like "vtable for
+ CLASS", where CLASS is the name of the run-time type of VALUE.
+ If we didn't like this approach, we could instead look in the
+ type_info object itself to get the class name. But this way
+ should work just as well, and doesn't read target memory. */
+ vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol);
+ if (vtable_symbol_name == NULL
+ || strncmp (vtable_symbol_name, "vtable for ", 11))
+ error ("can't find linker symbol for virtual table for `%s' value",
+ TYPE_NAME (value_type));
+ class_name = vtable_symbol_name + 11;
+
+ /* Try to look up the class name as a type name. */
+ class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0);
+ if (! class_symbol)
+ error ("can't find class named `%s', as given by C++ RTTI", class_name);
+
+ /* Make sure the type symbol is sane. (An earlier version of this
+ code would find constructor functions, who have the same name as
+ the class.) */
+ if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF
+ || TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS)
+ error ("C++ RTTI gives a class name of `%s', but that isn't a type name",
+ class_name);
+
+ /* This is the object's run-time type! */
+ run_time_type = SYMBOL_TYPE (class_symbol);
+
+ /* Get the offset from VALUE to the top of the complete object.
+ NOTE: this is the reverse of the meaning of *TOP_P. */
+ offset_to_top
+ = value_as_long (value_field (vtable, vtable_field_offset_to_top));
+
+ if (full_p)
+ *full_p = (- offset_to_top == VALUE_EMBEDDED_OFFSET (value)
+ && (TYPE_LENGTH (VALUE_ENCLOSING_TYPE (value))
+ >= TYPE_LENGTH (run_time_type)));
+ if (top_p)
+ *top_p = - offset_to_top;
+
+ return run_time_type;
+}
+
+
+static struct value *
+gnuv3_virtual_fn_field (struct value **value_p,
+ struct fn_field *f, int j,
+ struct type *type, int offset)
+{
+ struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+ struct value *value = *value_p;
+ struct type *value_type = check_typedef (VALUE_TYPE (value));
+ struct type *vfn_base;
+ CORE_ADDR vtable_address;
+ struct value *vtable;
+ struct value *vfn;
+
+ /* Some simple sanity checks. */
+ if (TYPE_CODE (value_type) != TYPE_CODE_CLASS)
+ error ("Only classes can have virtual functions.");
+
+ /* Find the base class that defines this virtual function. */
+ vfn_base = TYPE_FN_FIELD_FCONTEXT (f, j);
+ if (! vfn_base)
+ /* In programs compiled with G++ version 1, the debug info doesn't
+ say which base class defined the virtual function. We'll guess
+ it's the same base class that has our vtable; this is wrong for
+ multiple inheritance, but it's better than nothing. */
+ vfn_base = TYPE_VPTR_BASETYPE (type);
+
+ /* This type may have been defined before its virtual function table
+ was. If so, fill in the virtual function table entry for the
+ type now. */
+ if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
+ fill_in_vptr_fieldno (vfn_base);
+
+ /* Now that we know which base class is defining our virtual
+ function, cast our value to that baseclass. This takes care of
+ any necessary `this' adjustments. */
+ if (vfn_base != value_type)
+ value = value_cast (vfn_base, value);
+
+ /* Now value is an object of the appropriate base type. Fetch its
+ virtual table. */
+ /* It might be possible to do this cast at the same time as the above.
+ Does multiple inheritance affect this?
+ Can this even trigger, or is TYPE_VPTR_BASETYPE idempotent?
+ */
+ if (TYPE_VPTR_BASETYPE (vfn_base) != vfn_base)
+ value = value_cast (TYPE_VPTR_BASETYPE (vfn_base), value);
+ vtable_address
+ = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (vfn_base)));
+
+ vtable = value_at_lazy (vtable_type,
+ vtable_address - vtable_address_point_offset (),
+ VALUE_BFD_SECTION (value));
+
+ /* Fetch the appropriate function pointer from the vtable. */
+ vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions),
+ value_from_longest (builtin_type_int,
+ TYPE_FN_FIELD_VOFFSET (f, j)));
+
+ /* Cast the function pointer to the appropriate type. */
+ vfn = value_cast (lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)),
+ vfn);
+
+ /* Is (type)value always numerically the same as (vfn_base)value?
+ If so we can spare this cast and use one of the ones above. */
+ *value_p = value_addr (value_cast (type, *value_p));
+
+ return vfn;
+}
+
+/* Compute the offset of the baseclass which is
+ the INDEXth baseclass of class TYPE,
+ for value at VALADDR (in host) at ADDRESS (in target).
+ The result is the offset of the baseclass value relative
+ to (the address of)(ARG) + OFFSET.
+
+ -1 is returned on error. */
+int
+gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
+ CORE_ADDR address)
+{
+ struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+ struct type *basetype = TYPE_BASECLASS (type, index);
+ struct value *full_object, *vbase_object, *orig_object;
+ struct value *vtable, *orig_typeinfo, *orig_base_info;
+ struct type *orig_type, *vbasetype;
+ struct value *offset_val, *vbase_array;
+ CORE_ADDR vtable_address;
+ long int cur_base_offset, base_offset;
+ int to_top;
+ int baseclasses, i;
+
+ /* If it isn't a virtual base, this is easy. The offset is in the
+ type definition. */
+ if (!BASETYPE_VIA_VIRTUAL (type, index))
+ return TYPE_BASECLASS_BITPOS (type, index) / 8;
+
+ /* To access a virtual base, we need to use the vbase offset stored in
+ our vtable. Recent GCC versions provide this information. If it isn't
+ available, we could get what we needed from RTTI, or from drawing the
+ complete inheritance graph based on the debug info. Neither is
+ worthwhile. */
+ cur_base_offset = TYPE_BASECLASS_BITPOS (type, index) / 8;
+ if (cur_base_offset >= - vtable_address_point_offset ())
+ error ("Expected a negative vbase offset (old compiler?)");
+
+ cur_base_offset = cur_base_offset + vtable_address_point_offset ();
+ if ((- cur_base_offset) % TYPE_LENGTH (builtin_type_void_data_ptr) != 0)
+ error ("Misaligned vbase offset.");
+ cur_base_offset = cur_base_offset
+ / ((int) TYPE_LENGTH (builtin_type_void_data_ptr));
+
+ /* We're now looking for the cur_base_offset'th entry (negative index)
+ in the vcall_and_vbase_offsets array. */
+
+ orig_object = value_at_lazy (type, address, NULL);
+ vbasetype = TYPE_VPTR_BASETYPE (VALUE_TYPE (orig_object));
+ vbase_object = value_cast (vbasetype, orig_object);
+
+ vtable_address
+ = value_as_address (value_field (vbase_object,
+ TYPE_VPTR_FIELDNO (vbasetype)));
+ vtable = value_at_lazy (vtable_type,
+ vtable_address - vtable_address_point_offset (),
+ NULL);
+ offset_val = value_from_longest(builtin_type_int, cur_base_offset);
+ vbase_array = value_field (vtable, vtable_field_vcall_and_vbase_offsets);
+ base_offset = value_as_long (value_subscript (vbase_array, offset_val));
+ return base_offset;
+}
+
+static void
+init_gnuv3_ops (void)
+{
+ vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type, 0);
+
+ gnu_v3_abi_ops.shortname = "gnu-v3";
+ gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI";
+ gnu_v3_abi_ops.doc = "G++ Version 3 ABI";
+ gnu_v3_abi_ops.is_destructor_name = is_gnu_v3_mangled_dtor;
+ gnu_v3_abi_ops.is_constructor_name = is_gnu_v3_mangled_ctor;
+ gnu_v3_abi_ops.is_vtable_name = gnuv3_is_vtable_name;
+ gnu_v3_abi_ops.is_operator_name = gnuv3_is_operator_name;
+ gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type;
+ gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field;
+ gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset;
+}
+
+
+void
+_initialize_gnu_v3_abi (void)
+{
+ init_gnuv3_ops ();
+
+ register_cp_abi (gnu_v3_abi_ops);
+}
diff --git a/contrib/gdb/gdb/gregset.h b/contrib/gdb/gdb/gregset.h
new file mode 100644
index 0000000..a3a1325
--- /dev/null
+++ b/contrib/gdb/gdb/gregset.h
@@ -0,0 +1,56 @@
+/* Interface for functions using gregset and fpregset types.
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef GREGSET_H
+#define GREGSET_H
+
+#ifndef GDB_GREGSET_T
+#define GDB_GREGSET_T gregset_t
+#endif
+
+#ifndef GDB_FPREGSET_T
+#define GDB_FPREGSET_T fpregset_t
+#endif
+
+typedef GDB_GREGSET_T gdb_gregset_t;
+typedef GDB_FPREGSET_T gdb_fpregset_t;
+
+/* A gregset is a data structure supplied by the native OS containing
+ the general register values of the debugged process. Usually this
+ includes integer registers and control registers. An fpregset is a
+ data structure containing the floating point registers. These data
+ structures were originally a part of the /proc interface, but have
+ been borrowed or copied by other GDB targets, eg. GNU/Linux. */
+
+/* Copy register values from the native target gregset/fpregset
+ into GDB's internal register cache. */
+
+extern void supply_gregset (gdb_gregset_t *gregs);
+extern void supply_fpregset (gdb_fpregset_t *fpregs);
+
+/* Copy register values from GDB's register cache into
+ the native target gregset/fpregset. If regno is -1,
+ copy all the registers. */
+
+extern void fill_gregset (gdb_gregset_t *gregs, int regno);
+extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
+
+
+#endif
diff --git a/contrib/gdb/gdb/hpacc-abi.c b/contrib/gdb/gdb/hpacc-abi.c
new file mode 100644
index 0000000..6753cd7
--- /dev/null
+++ b/contrib/gdb/gdb/hpacc-abi.c
@@ -0,0 +1,328 @@
+/* Abstraction of HP aCC ABI.
+ Contributed by Daniel Berlin <dberlin@redhat.com>
+ Most of the real code is from HP, i've just fiddled it to fit in
+ the C++ ABI abstraction framework.
+
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or
+ modify
+ it under the terms of the GNU General Public License as published
+ by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "gdb_regex.h"
+#include "gdb_string.h"
+#include "gdbtypes.h"
+#include "gdbcore.h"
+#include "cp-abi.h"
+
+struct cp_abi_ops hpacc_abi_ops;
+
+/* It appears the is_*_name stuff is never used when we try the hpACC
+ * ABI. As such, I have no clue what the real answers are. Shouldn't
+ * have any more effect than it does now. */
+static regex_t constructor_pattern;
+static regex_t destructor_pattern;
+static regex_t operator_pattern;
+
+static enum dtor_kinds
+hpacc_is_destructor_name (const char *name)
+{
+ if (regexec (&destructor_pattern, name, 0, 0, 0) == 0)
+ return complete_object_dtor;
+ else
+ return 0;
+}
+
+static enum ctor_kinds
+hpacc_is_constructor_name (const char *name)
+{
+ if (regexec (&constructor_pattern, name, 0, 0, 0) == 0)
+ return complete_object_ctor;
+ else
+ return 0;
+}
+
+static int
+hpacc_is_operator_name (const char *name)
+{
+ return regexec (&operator_pattern, name, 0, 0, 0) == 0;
+}
+
+static int
+hpacc_is_vtable_name (const char *name)
+{
+ return strcmp (name,
+ "This will never match anything, please fill it in") == 0;
+}
+
+/* Return a virtual function as a value.
+ ARG1 is the object which provides the virtual function
+ table pointer. *ARG1P is side-effected in calling this function.
+ F is the list of member functions which contains the desired virtual
+ function.
+ J is an index into F which provides the desired virtual function.
+
+ TYPE is the type in which F is located. */
+static struct value *
+hpacc_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
+ struct type * type, int offset)
+{
+ struct value *arg1 = *arg1p;
+ struct type *type1 = check_typedef (VALUE_TYPE (arg1));
+
+ /* Deal with HP/Taligent runtime model for virtual functions */
+ struct value *vp;
+ struct value *argp; /* arg1 cast to base */
+ 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.");
+
+ /* 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)); */
+
+ if (!coreptr)
+ 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. */
+ }
+ 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.) */
+
+ }
+
+ if (!coreptr)
+ error ("Address of virtual function is null; error in virtual table?");
+
+ /* 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;
+}
+
+
+static struct type *
+hpacc_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
+{
+ struct type *known_type;
+ struct type *rtti_type;
+ CORE_ADDR coreptr;
+ struct value *vp;
+ int using_enclosing = 0;
+ long top_offset = 0;
+ char rtti_type_name[256];
+
+ if (full)
+ *full = 0;
+ if (top)
+ *top = -1;
+ if (using_enc)
+ *using_enc = 0;
+
+ /* Get declared type */
+ known_type = VALUE_TYPE (v);
+ CHECK_TYPEDEF (known_type);
+ /* RTTI works only or class objects */
+ if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
+ return NULL;
+
+ /* If neither the declared type nor the enclosing type of the
+ * value structure has a HP ANSI C++ style virtual table,
+ * we can't do anything. */
+ if (!TYPE_HAS_VTABLE (known_type))
+ {
+ 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 */
+ CHECK_TYPEDEF (known_type);
+ using_enclosing = 1;
+ }
+
+ if (using_enclosing && 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)));
+ if (coreptr == 0)
+ /* return silently -- maybe called on gdb-generated value */
+ return NULL;
+
+ /* 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));
+ top_offset = value_as_long (vp);
+ if (top)
+ *top = top_offset;
+
+ /* Fetch the typeinfo pointer */
+ /* FIXME possible 32x64 problem with pointer size & arithmetic */
+ 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));
+ if (!coreptr)
+ error ("Retrieved null typeinfo pointer in trying to determine "
+ "run-time type");
+ /* 4 -> offset of name field */
+ vp = value_at (builtin_type_int, coreptr + 4, VALUE_BFD_SECTION (v));
+ /* FIXME possible 32x64 problem */
+
+ 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
+ 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 */
+ &&
+ /* 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;
+}
+
+extern int gnuv2_baseclass_offset (struct type *type, int index,
+ char *valaddr, CORE_ADDR address);
+
+static void
+init_hpacc_ops (void)
+{
+ hpacc_abi_ops.shortname = "hpaCC";
+ hpacc_abi_ops.longname = "HP aCC ABI";
+ hpacc_abi_ops.doc = "HP aCC ABI";
+ hpacc_abi_ops.is_destructor_name = hpacc_is_destructor_name;
+ hpacc_abi_ops.is_constructor_name = hpacc_is_constructor_name;
+ hpacc_abi_ops.is_vtable_name = hpacc_is_vtable_name;
+ hpacc_abi_ops.is_operator_name = hpacc_is_operator_name;
+ hpacc_abi_ops.virtual_fn_field = hpacc_virtual_fn_field;
+ hpacc_abi_ops.rtti_type = hpacc_value_rtti_type;
+ /* It seems that this function is specific to GNU G++ < 3.0.
+ However, it is called for data members even in the HP
+ case (although not for member functions).
+ FIXME: Is that correct? */
+ hpacc_abi_ops.baseclass_offset = gnuv2_baseclass_offset;
+}
+
+
+void
+_initialize_hpacc_abi (void)
+{
+ init_hpacc_ops ();
+
+ regcomp (&constructor_pattern,
+ "^This will never match anything, please fill it in$", REG_NOSUB);
+
+ regcomp (&destructor_pattern,
+ "^This will never match anything, please fill it in$", REG_NOSUB);
+
+ regcomp (&operator_pattern,
+ "^This will never match anything, please fill it in$", REG_NOSUB);
+
+ register_cp_abi (hpacc_abi_ops);
+}
diff --git a/contrib/gdb/gdb/hpux-thread.c b/contrib/gdb/gdb/hpux-thread.c
index 36421f3..eec18ff 100644
--- a/contrib/gdb/gdb/hpux-thread.c
+++ b/contrib/gdb/gdb/hpux-thread.c
@@ -1,21 +1,22 @@
/* Low level interface for debugging HPUX/DCE threads for GDB, the GNU debugger.
- Copyright 1996, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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"
@@ -38,140 +39,92 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbthread.h"
#include "target.h"
#include "inferior.h"
+#include "regcache.h"
#include <fcntl.h>
-#include <unistd.h>
#include <sys/stat.h>
#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));
+extern void _initialize_hpux_thread (void);
struct string_map
-{
- int num;
- char *str;
-};
+ {
+ int num;
+ char *str;
+ };
static int hpux_thread_active = 0;
-static int main_pid; /* Real process ID */
+static ptid_t main_ptid; /* 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 void restore_inferior_pid PARAMS ((int pid));
-
-static void hpux_thread_resume PARAMS ((int pid, int step,
- enum target_signal signo));
+static void hpux_thread_resume (ptid_t ptid, int step,
+ enum target_signal signo);
-static void init_hpux_thread_ops PARAMS ((void));
+static void init_hpux_thread_ops (void);
static struct target_ops hpux_thread_ops;
-/*
-
-LOCAL FUNCTION
-
- save_inferior_pid - Save inferior_pid on the cleanup list
- restore_inferior_pid - Restore inferior_pid from the cleanup list
-
-SYNOPSIS
-
- struct cleanup *save_inferior_pid ()
- void restore_inferior_pid (int pid)
-
-DESCRIPTION
-
- These two functions act in unison to restore inferior_pid in
- case of an error.
-
-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.
-
- */
-
-
-static struct cleanup *
-save_inferior_pid ()
-{
- return make_cleanup (restore_inferior_pid, inferior_pid);
-}
-
-static void
-restore_inferior_pid (pid)
- int pid;
-{
- inferior_pid = pid;
-}
-
-static int find_active_thread PARAMS ((void));
+static ptid_t find_active_thread (void);
static int cached_thread;
-static int cached_active_thread;
static cma__t_int_tcb cached_tcb;
-static int
-find_active_thread ()
+static ptid_t
+find_active_thread (void)
{
static cma__t_int_tcb tcb;
CORE_ADDR tcb_ptr;
- 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;
+ return (ptid_build (PIDGET (main_ptid), 0,
+ cma_thread_get_unique (&tcb.prolog.client_thread)));
}
-static cma__t_int_tcb * find_tcb PARAMS ((int thread));
+static cma__t_int_tcb *find_tcb (ptid_t ptid);
static cma__t_int_tcb *
-find_tcb (thread)
- int thread;
+find_tcb (ptid_t ptid)
{
cma__t_known_object queue_header;
cma__t_queue *queue_ptr;
+ int thread = ptid_get_tid (ptid);
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)
+ if (cma_thread_get_unique (&cached_tcb.prolog.client_thread) == thread)
{
cached_thread = thread;
return &cached_tcb;
}
}
- error ("Can't find TCB %d,%d", thread >> 16, thread & 0xffff);
+ error ("Can't find TCB %d", thread);
return NULL;
}
@@ -180,9 +133,7 @@ find_tcb (thread)
/* ARGSUSED */
static void
-hpux_thread_open (arg, from_tty)
- char *arg;
- int from_tty;
+hpux_thread_open (char *arg, int from_tty)
{
child_ops.to_open (arg, from_tty);
}
@@ -191,9 +142,7 @@ hpux_thread_open (arg, from_tty)
and wait for the trace-trap that results from attaching. */
static void
-hpux_thread_attach (args, from_tty)
- char *args;
- int from_tty;
+hpux_thread_attach (char *args, int from_tty)
{
child_ops.to_attach (args, from_tty);
@@ -209,9 +158,7 @@ hpux_thread_attach (args, from_tty)
started via the normal ptrace (PTRACE_TRACEME). */
static void
-hpux_thread_detach (args, from_tty)
- char *args;
- int from_tty;
+hpux_thread_detach (char *args, int from_tty)
{
child_ops.to_detach (args, from_tty);
}
@@ -222,16 +169,14 @@ hpux_thread_detach (args, from_tty)
for procfs. */
static void
-hpux_thread_resume (pid, step, signo)
- int pid;
- int step;
- enum target_signal signo;
+hpux_thread_resume (ptid_t ptid, int step, enum target_signal signo)
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- pid = inferior_pid = main_pid;
+ ptid = main_ptid;
+ inferior_ptid = main_ptid;
#if 0
if (pid != -1)
@@ -242,10 +187,9 @@ hpux_thread_resume (pid, step, signo)
}
#endif
- child_ops.to_resume (pid, step, signo);
+ child_ops.to_resume (ptid, step, signo);
cached_thread = 0;
- cached_active_thread = 0;
do_cleanups (old_chain);
}
@@ -253,22 +197,20 @@ hpux_thread_resume (pid, step, signo)
/* Wait for any threads to stop. We may have to convert PID from a thread id
to a LWP id, and vice versa on the way out. */
-static int
-hpux_thread_wait (pid, ourstatus)
- int pid;
- struct target_waitstatus *ourstatus;
+static ptid_t
+hpux_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
- int rtnval;
+ ptid_t rtnval;
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = main_pid;
+ inferior_ptid = main_ptid;
- if (pid != -1)
- pid = main_pid;
+ if (!ptid_equal (ptid, minus_one_ptid))
+ ptid = main_ptid;
- rtnval = child_ops.to_wait (pid, ourstatus);
+ rtnval = child_ops.to_wait (ptid, ourstatus);
rtnval = find_active_thread ();
@@ -279,9 +221,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,30 +235,29 @@ 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
-hpux_thread_fetch_registers (regno)
- int regno;
+hpux_thread_fetch_registers (int regno)
{
cma__t_int_tcb tcb, *tcb_ptr;
struct cleanup *old_chain;
int i;
int first_regno, last_regno;
- tcb_ptr = find_tcb (inferior_pid);
+ tcb_ptr = find_tcb (inferior_ptid);
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = main_pid;
+ inferior_ptid = main_ptid;
if (tcb_ptr->state == cma__c_state_running)
{
@@ -347,7 +288,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 */
@@ -367,19 +308,18 @@ hpux_thread_fetch_registers (regno)
}
static void
-hpux_thread_store_registers (regno)
- int regno;
+hpux_thread_store_registers (int regno)
{
cma__t_int_tcb tcb, *tcb_ptr;
struct cleanup *old_chain;
int i;
int first_regno, last_regno;
- tcb_ptr = find_tcb (inferior_pid);
+ tcb_ptr = find_tcb (inferior_ptid);
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = main_pid;
+ inferior_ptid = main_ptid;
if (tcb_ptr->state == cma__c_state_running)
{
@@ -410,13 +350,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 *)
@@ -443,27 +383,25 @@ hpux_thread_store_registers (regno)
debugged. */
static void
-hpux_thread_prepare_to_store ()
+hpux_thread_prepare_to_store (void)
{
child_ops.to_prepare_to_store ();
}
static int
-hpux_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int dowrite;
- struct target_ops *target; /* ignored */
+hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+ int dowrite, struct mem_attrib *attribs,
+ struct target_ops *target)
{
int retval;
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = main_pid;
+ inferior_ptid = main_ptid;
- retval = child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, target);
+ retval =
+ child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target);
do_cleanups (old_chain);
@@ -473,44 +411,39 @@ hpux_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
/* Print status information about what we're accessing. */
static void
-hpux_thread_files_info (ignore)
- struct target_ops *ignore;
+hpux_thread_files_info (struct target_ops *ignore)
{
child_ops.to_files_info (ignore);
}
static void
-hpux_thread_kill_inferior ()
+hpux_thread_kill_inferior (void)
{
child_ops.to_kill ();
}
static void
-hpux_thread_notice_signals (pid)
- int pid;
+hpux_thread_notice_signals (ptid_t ptid)
{
- child_ops.to_notice_signals (pid);
+ child_ops.to_notice_signals (ptid);
}
/* Fork an inferior process, and start debugging it with /proc. */
static void
-hpux_thread_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
+hpux_thread_create_inferior (char *exec_file, char *allargs, char **env)
{
child_ops.to_create_inferior (exec_file, allargs, env);
if (hpux_thread_active)
{
- main_pid = inferior_pid;
+ main_ptid = inferior_ptid;
push_target (&hpux_thread_ops);
- inferior_pid = find_active_thread ();
+ inferior_ptid = find_active_thread ();
- add_thread (inferior_pid);
+ add_thread (inferior_ptid);
}
}
@@ -520,40 +453,49 @@ hpux_thread_create_inferior (exec_file, allargs, env)
those variables don't show up until the library gets mapped and the symbol
table is read in. */
+/* This new_objfile event is now managed by a chained function pointer.
+ * It is the callee's responsability to call the next client on the chain.
+ */
+
+/* Saved pointer to previous owner of the new_objfile event. */
+static void (*target_new_objfile_chain) (struct objfile *);
+
void
-hpux_thread_new_objfile (objfile)
- struct objfile *objfile;
+hpux_thread_new_objfile (struct objfile *objfile)
{
struct minimal_symbol *ms;
if (!objfile)
{
hpux_thread_active = 0;
-
- return;
+ goto quit;
}
ms = lookup_minimal_symbol ("cma__g_known_threads", NULL, objfile);
if (!ms)
- return;
+ goto quit;
P_cma__g_known_threads = SYMBOL_VALUE_ADDRESS (ms);
ms = lookup_minimal_symbol ("cma__g_current_thread", NULL, objfile);
if (!ms)
- return;
+ goto quit;
P_cma__g_current_thread = SYMBOL_VALUE_ADDRESS (ms);
hpux_thread_active = 1;
+quit:
+ /* Call predecessor on chain, if any. */
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
}
/* Clean up after the inferior dies. */
static void
-hpux_thread_mourn_inferior ()
+hpux_thread_mourn_inferior (void)
{
child_ops.to_mourn_inferior ();
}
@@ -561,20 +503,19 @@ hpux_thread_mourn_inferior ()
/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
static int
-hpux_thread_can_run ()
+hpux_thread_can_run (void)
{
return child_suppress_run;
}
static int
-hpux_thread_alive (pid)
- int pid;
+hpux_thread_alive (ptid_t ptid)
{
return 1;
}
static void
-hpux_thread_stop ()
+hpux_thread_stop (void)
{
child_ops.to_stop ();
}
@@ -582,18 +523,18 @@ hpux_thread_stop ()
/* Convert a pid to printable form. */
char *
-hpux_pid_to_str (pid)
- int pid;
+hpux_pid_to_str (ptid_t ptid)
{
static char buf[100];
+ int pid = PIDGET (ptid);
- sprintf (buf, "Thread %d", pid >> 16);
+ sprintf (buf, "Thread %ld", ptid_get_tid (ptid));
return buf;
}
static void
-init_hpux_thread_ops ()
+init_hpux_thread_ops (void)
{
hpux_thread_ops.to_shortname = "hpux-threads";
hpux_thread_ops.to_longname = "HPUX threads and pthread.";
@@ -620,7 +561,7 @@ init_hpux_thread_ops ()
hpux_thread_ops.to_mourn_inferior = hpux_thread_mourn_inferior;
hpux_thread_ops.to_can_run = hpux_thread_can_run;
hpux_thread_ops.to_notice_signals = hpux_thread_notice_signals;
- hpux_thread_ops.to_thread_alive = hpux_thread_thread_alive;
+ hpux_thread_ops.to_thread_alive = hpux_thread_alive;
hpux_thread_ops.to_stop = hpux_thread_stop;
hpux_thread_ops.to_stratum = process_stratum;
hpux_thread_ops.to_has_all_memory = 1;
@@ -632,10 +573,13 @@ init_hpux_thread_ops ()
}
void
-_initialize_hpux_thread ()
+_initialize_hpux_thread (void)
{
init_hpux_thread_ops ();
add_target (&hpux_thread_ops);
child_suppress_run = 1;
+ /* Hook into new_objfile notification. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = hpux_thread_new_objfile;
}
diff --git a/contrib/gdb/gdb/i386-linux-nat.c b/contrib/gdb/gdb/i386-linux-nat.c
new file mode 100644
index 0000000..a0d19e7
--- /dev/null
+++ b/contrib/gdb/gdb/i386-linux-nat.c
@@ -0,0 +1,955 @@
+/* Native-dependent code for GNU/Linux x86.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include "gdb_assert.h"
+#include <sys/ptrace.h>
+#include <sys/user.h>
+#include <sys/procfs.h>
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
+#ifdef HAVE_SYS_DEBUGREG_H
+#include <sys/debugreg.h>
+#endif
+
+#ifndef DR_FIRSTADDR
+#define DR_FIRSTADDR 0
+#endif
+
+#ifndef DR_LASTADDR
+#define DR_LASTADDR 3
+#endif
+
+#ifndef DR_STATUS
+#define DR_STATUS 6
+#endif
+
+#ifndef DR_CONTROL
+#define DR_CONTROL 7
+#endif
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+/* Prototypes for i387_supply_fsave etc. */
+#include "i387-nat.h"
+
+/* Defines for XMM0_REGNUM etc. */
+#include "i386-tdep.h"
+
+/* Prototypes for local functions. */
+static void dummy_sse_values (void);
+
+
+
+/* The register sets used in GNU/Linux ELF core-dumps are identical to
+ the register sets in `struct user' that is used for a.out
+ core-dumps, and is also used by `ptrace'. The corresponding types
+ are `elf_gregset_t' for the general-purpose registers (with
+ `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
+ for the floating-point registers.
+
+ Those types used to be available under the names `gregset_t' and
+ `fpregset_t' too, and this file used those names in the past. But
+ those names are now used for the register sets used in the
+ `mcontext_t' type, and have a different size and layout. */
+
+/* Mapping between the general-purpose registers in `struct user'
+ format and GDB's register array layout. */
+static int regmap[] =
+{
+ EAX, ECX, EDX, EBX,
+ UESP, EBP, ESI, EDI,
+ EIP, EFL, CS, SS,
+ DS, ES, FS, GS
+};
+
+/* Which ptrace request retrieves which registers?
+ These apply to the corresponding SET requests as well. */
+#define GETREGS_SUPPLIES(regno) \
+ ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
+#define GETFPREGS_SUPPLIES(regno) \
+ (FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
+#define GETFPXREGS_SUPPLIES(regno) \
+ (FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
+
+/* Does the current host support the GETREGS request? */
+int have_ptrace_getregs =
+#ifdef HAVE_PTRACE_GETREGS
+ 1
+#else
+ 0
+#endif
+;
+
+/* Does the current host support the GETFPXREGS request? The header
+ file may or may not define it, and even if it is defined, the
+ kernel will return EIO if it's running on a pre-SSE processor.
+
+ My instinct is to attach this to some architecture- or
+ target-specific data structure, but really, a particular GDB
+ process can only run on top of one kernel at a time. So it's okay
+ for this to be a simple variable. */
+int have_ptrace_getfpxregs =
+#ifdef HAVE_PTRACE_GETFPXREGS
+ 1
+#else
+ 0
+#endif
+;
+
+
+/* Support for the user struct. */
+
+/* Return the address of register REGNUM. BLOCKEND is the value of
+ u.u_ar0, which should point to the registers. */
+
+CORE_ADDR
+register_u_addr (CORE_ADDR blockend, int regnum)
+{
+ return (blockend + 4 * regmap[regnum]);
+}
+
+/* Return the size of the user struct. */
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
+
+/* Fetching registers directly from the U area, one at a time. */
+
+/* FIXME: kettenis/2000-03-05: This duplicates code from `inptrace.c'.
+ The problem is that we define FETCH_INFERIOR_REGISTERS since we
+ want to use our own versions of {fetch,store}_inferior_registers
+ that use the GETREGS request. This means that the code in
+ `infptrace.c' is #ifdef'd out. But we need to fall back on that
+ code when GDB is running on top of a kernel that doesn't support
+ the GETREGS request. I want to avoid changing `infptrace.c' right
+ now. */
+
+#ifndef PT_READ_U
+#define PT_READ_U PTRACE_PEEKUSR
+#endif
+#ifndef PT_WRITE_U
+#define PT_WRITE_U PTRACE_POKEUSR
+#endif
+
+/* Default the type of the ptrace transfer to int. */
+#ifndef PTRACE_XFER_TYPE
+#define PTRACE_XFER_TYPE int
+#endif
+
+/* Registers we shouldn't try to fetch. */
+#define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= NUM_GREGS)
+
+/* Fetch one register. */
+
+static void
+fetch_register (int regno)
+{
+ /* This isn't really an address. But ptrace thinks of it as one. */
+ CORE_ADDR regaddr;
+ char mess[128]; /* For messages */
+ register int i;
+ unsigned int offset; /* Offset of registers within the u area. */
+ char buf[MAX_REGISTER_RAW_SIZE];
+ int tid;
+
+ if (OLD_CANNOT_FETCH_REGISTER (regno))
+ {
+ memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
+ supply_register (regno, buf);
+ return;
+ }
+
+ /* Overload thread id onto process id */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
+
+ offset = U_REGS_OFFSET;
+
+ regaddr = register_addr (regno, offset);
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
+ (PTRACE_ARG3_TYPE) regaddr, 0);
+ regaddr += sizeof (PTRACE_XFER_TYPE);
+ if (errno != 0)
+ {
+ sprintf (mess, "reading register %s (#%d)",
+ REGISTER_NAME (regno), regno);
+ perror_with_name (mess);
+ }
+ }
+ supply_register (regno, buf);
+}
+
+/* Fetch register values from the inferior.
+ If REGNO is negative, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+old_fetch_inferior_registers (int regno)
+{
+ if (regno >= 0)
+ {
+ fetch_register (regno);
+ }
+ else
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ fetch_register (regno);
+ }
+ }
+}
+
+/* Registers we shouldn't try to store. */
+#define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= NUM_GREGS)
+
+/* Store one register. */
+
+static void
+store_register (int regno)
+{
+ /* This isn't really an address. But ptrace thinks of it as one. */
+ CORE_ADDR regaddr;
+ char mess[128]; /* For messages */
+ register int i;
+ unsigned int offset; /* Offset of registers within the u area. */
+ int tid;
+
+ if (OLD_CANNOT_STORE_REGISTER (regno))
+ {
+ return;
+ }
+
+ /* Overload thread id onto process id */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
+
+ offset = U_REGS_OFFSET;
+
+ regaddr = register_addr (regno, offset);
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
+ *(PTRACE_XFER_TYPE *) & registers[REGISTER_BYTE (regno) + i]);
+ regaddr += sizeof (PTRACE_XFER_TYPE);
+ if (errno != 0)
+ {
+ sprintf (mess, "writing register %s (#%d)",
+ REGISTER_NAME (regno), regno);
+ perror_with_name (mess);
+ }
+ }
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is negative, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+old_store_inferior_registers (int regno)
+{
+ if (regno >= 0)
+ {
+ store_register (regno);
+ }
+ else
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ store_register (regno);
+ }
+ }
+}
+
+
+/* Transfering the general-purpose registers between GDB, inferiors
+ and core files. */
+
+/* Fill GDB's register array with the general-purpose register values
+ in *GREGSETP. */
+
+void
+supply_gregset (elf_gregset_t *gregsetp)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ supply_register (i, (char *) (regp + regmap[i]));
+
+ supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
+}
+
+/* Fill register REGNO (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_gregset (elf_gregset_t *gregsetp, int regno)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ if ((regno == -1 || regno == i))
+ regcache_collect (i, regp + regmap[i]);
+
+ if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ regcache_collect (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX);
+}
+
+#ifdef HAVE_PTRACE_GETREGS
+
+/* Fetch all general-purpose registers from process/thread TID and
+ store their values in GDB's register array. */
+
+static void
+fetch_regs (int tid)
+{
+ elf_gregset_t regs;
+
+ if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
+ {
+ if (errno == EIO)
+ {
+ /* The kernel we're running on doesn't support the GETREGS
+ request. Reset `have_ptrace_getregs'. */
+ have_ptrace_getregs = 0;
+ return;
+ }
+
+ perror_with_name ("Couldn't get registers");
+ }
+
+ supply_gregset (&regs);
+}
+
+/* Store all valid general-purpose registers in GDB's register array
+ into the process/thread specified by TID. */
+
+static void
+store_regs (int tid, int regno)
+{
+ elf_gregset_t regs;
+
+ if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
+ perror_with_name ("Couldn't get registers");
+
+ fill_gregset (&regs, regno);
+
+ if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
+ perror_with_name ("Couldn't write registers");
+}
+
+#else
+
+static void fetch_regs (int tid) {}
+static void store_regs (int tid, int regno) {}
+
+#endif
+
+
+/* Transfering floating-point registers between GDB, inferiors and cores. */
+
+/* Fill GDB's register array with the floating-point register values in
+ *FPREGSETP. */
+
+void
+supply_fpregset (elf_fpregset_t *fpregsetp)
+{
+ i387_supply_fsave ((char *) fpregsetp);
+ dummy_sse_values ();
+}
+
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
+{
+ i387_fill_fsave ((char *) fpregsetp, regno);
+}
+
+#ifdef HAVE_PTRACE_GETREGS
+
+/* Fetch all floating-point registers from process/thread TID and store
+ thier values in GDB's register array. */
+
+static void
+fetch_fpregs (int tid)
+{
+ elf_fpregset_t fpregs;
+
+ if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
+ perror_with_name ("Couldn't get floating point status");
+
+ supply_fpregset (&fpregs);
+}
+
+/* Store all valid floating-point registers in GDB's register array
+ into the process/thread specified by TID. */
+
+static void
+store_fpregs (int tid, int regno)
+{
+ elf_fpregset_t fpregs;
+
+ if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
+ perror_with_name ("Couldn't get floating point status");
+
+ fill_fpregset (&fpregs, regno);
+
+ if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0)
+ perror_with_name ("Couldn't write floating point status");
+}
+
+#else
+
+static void fetch_fpregs (int tid) {}
+static void store_fpregs (int tid, int regno) {}
+
+#endif
+
+
+/* Transfering floating-point and SSE registers to and from GDB. */
+
+#ifdef HAVE_PTRACE_GETFPXREGS
+
+/* Fill GDB's register array with the floating-point and SSE register
+ values in *FPXREGSETP. */
+
+void
+supply_fpxregset (elf_fpxregset_t *fpxregsetp)
+{
+ i387_supply_fxsave ((char *) fpxregsetp);
+}
+
+/* Fill register REGNO (if it is a floating-point or SSE register) in
+ *FPXREGSETP with the value in GDB's register array. If REGNO is
+ -1, do this for all registers. */
+
+void
+fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno)
+{
+ i387_fill_fxsave ((char *) fpxregsetp, regno);
+}
+
+/* Fetch all registers covered by the PTRACE_GETFPXREGS request from
+ process/thread TID and store their values in GDB's register array.
+ Return non-zero if successful, zero otherwise. */
+
+static int
+fetch_fpxregs (int tid)
+{
+ elf_fpxregset_t fpxregs;
+
+ if (! have_ptrace_getfpxregs)
+ return 0;
+
+ if (ptrace (PTRACE_GETFPXREGS, tid, 0, (int) &fpxregs) < 0)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getfpxregs = 0;
+ return 0;
+ }
+
+ perror_with_name ("Couldn't read floating-point and SSE registers");
+ }
+
+ supply_fpxregset (&fpxregs);
+ return 1;
+}
+
+/* Store all valid registers in GDB's register array covered by the
+ PTRACE_SETFPXREGS request into the process/thread specified by TID.
+ Return non-zero if successful, zero otherwise. */
+
+static int
+store_fpxregs (int tid, int regno)
+{
+ elf_fpxregset_t fpxregs;
+
+ if (! have_ptrace_getfpxregs)
+ return 0;
+
+ if (ptrace (PTRACE_GETFPXREGS, tid, 0, &fpxregs) == -1)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getfpxregs = 0;
+ return 0;
+ }
+
+ perror_with_name ("Couldn't read floating-point and SSE registers");
+ }
+
+ fill_fpxregset (&fpxregs, regno);
+
+ if (ptrace (PTRACE_SETFPXREGS, tid, 0, &fpxregs) == -1)
+ perror_with_name ("Couldn't write floating-point and SSE registers");
+
+ return 1;
+}
+
+/* Fill the XMM registers in the register array with dummy values. For
+ cases where we don't have access to the XMM registers. I think
+ this is cleaner than printing a warning. For a cleaner solution,
+ we should gdbarchify the i386 family. */
+
+static void
+dummy_sse_values (void)
+{
+ /* C doesn't have a syntax for NaN's, so write it out as an array of
+ longs. */
+ static long dummy[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff };
+ static long mxcsr = 0x1f80;
+ int reg;
+
+ for (reg = 0; reg < 8; reg++)
+ supply_register (XMM0_REGNUM + reg, (char *) dummy);
+ supply_register (MXCSR_REGNUM, (char *) &mxcsr);
+}
+
+#else
+
+static int fetch_fpxregs (int tid) { return 0; }
+static int store_fpxregs (int tid, int regno) { return 0; }
+static void dummy_sse_values (void) {}
+
+#endif /* HAVE_PTRACE_GETFPXREGS */
+
+
+/* Transferring arbitrary registers between GDB and inferior. */
+
+/* Check if register REGNO in the child process is accessible.
+ If we are accessing registers directly via the U area, only the
+ general-purpose registers are available.
+ All registers should be accessible if we have GETREGS support. */
+
+int
+cannot_fetch_register (int regno)
+{
+ if (! have_ptrace_getregs)
+ return OLD_CANNOT_FETCH_REGISTER (regno);
+ return 0;
+}
+int
+cannot_store_register (int regno)
+{
+ if (! have_ptrace_getregs)
+ return OLD_CANNOT_STORE_REGISTER (regno);
+ return 0;
+}
+
+/* Fetch register REGNO from the child process. If REGNO is -1, do
+ this for all registers (including the floating point and SSE
+ registers). */
+
+void
+fetch_inferior_registers (int regno)
+{
+ int tid;
+
+ /* Use the old method of peeking around in `struct user' if the
+ GETREGS request isn't available. */
+ if (! have_ptrace_getregs)
+ {
+ old_fetch_inferior_registers (regno);
+ return;
+ }
+
+ /* GNU/Linux LWP ID's are process ID's. */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+
+ /* Use the PTRACE_GETFPXREGS request whenever possible, since it
+ transfers more registers in one system call, and we'll cache the
+ results. But remember that fetch_fpxregs can fail, and return
+ zero. */
+ if (regno == -1)
+ {
+ fetch_regs (tid);
+
+ /* The call above might reset `have_ptrace_getregs'. */
+ if (! have_ptrace_getregs)
+ {
+ old_fetch_inferior_registers (-1);
+ return;
+ }
+
+ if (fetch_fpxregs (tid))
+ return;
+ fetch_fpregs (tid);
+ return;
+ }
+
+ if (GETREGS_SUPPLIES (regno))
+ {
+ fetch_regs (tid);
+ return;
+ }
+
+ if (GETFPXREGS_SUPPLIES (regno))
+ {
+ if (fetch_fpxregs (tid))
+ return;
+
+ /* Either our processor or our kernel doesn't support the SSE
+ registers, so read the FP registers in the traditional way,
+ and fill the SSE registers with dummy values. It would be
+ more graceful to handle differences in the register set using
+ gdbarch. Until then, this will at least make things work
+ plausibly. */
+ fetch_fpregs (tid);
+ return;
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "Got request for bad register number %d.", regno);
+}
+
+/* Store register REGNO back into the child process. If REGNO is -1,
+ do this for all registers (including the floating point and SSE
+ registers). */
+void
+store_inferior_registers (int regno)
+{
+ int tid;
+
+ /* Use the old method of poking around in `struct user' if the
+ SETREGS request isn't available. */
+ if (! have_ptrace_getregs)
+ {
+ old_store_inferior_registers (regno);
+ return;
+ }
+
+ /* GNU/Linux LWP ID's are process ID's. */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+
+ /* Use the PTRACE_SETFPXREGS requests whenever possible, since it
+ transfers more registers in one system call. But remember that
+ store_fpxregs can fail, and return zero. */
+ if (regno == -1)
+ {
+ store_regs (tid, regno);
+ if (store_fpxregs (tid, regno))
+ return;
+ store_fpregs (tid, regno);
+ return;
+ }
+
+ if (GETREGS_SUPPLIES (regno))
+ {
+ store_regs (tid, regno);
+ return;
+ }
+
+ if (GETFPXREGS_SUPPLIES (regno))
+ {
+ if (store_fpxregs (tid, regno))
+ return;
+
+ /* Either our processor or our kernel doesn't support the SSE
+ registers, so just write the FP registers in the traditional
+ way. */
+ store_fpregs (tid, regno);
+ return;
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "Got request to store bad register number %d.", regno);
+}
+
+
+static unsigned long
+i386_linux_dr_get (int regnum)
+{
+ int tid;
+ unsigned long value;
+
+ /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
+ multi-threaded processes here. For now, pretend there is just
+ one thread. */
+ tid = PIDGET (inferior_ptid);
+
+ /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
+ ptrace call fails breaks debugging remote targets. The correct
+ way to fix this is to add the hardware breakpoint and watchpoint
+ stuff to the target vectore. For now, just return zero if the
+ ptrace call fails. */
+ errno = 0;
+ value = ptrace (PT_READ_U, tid,
+ offsetof (struct user, u_debugreg[regnum]), 0);
+ if (errno != 0)
+#if 0
+ perror_with_name ("Couldn't read debug register");
+#else
+ return 0;
+#endif
+
+ return value;
+}
+
+static void
+i386_linux_dr_set (int regnum, unsigned long value)
+{
+ int tid;
+
+ /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
+ multi-threaded processes here. For now, pretend there is just
+ one thread. */
+ tid = PIDGET (inferior_ptid);
+
+ errno = 0;
+ ptrace (PT_WRITE_U, tid,
+ offsetof (struct user, u_debugreg[regnum]), value);
+ if (errno != 0)
+ perror_with_name ("Couldn't write debug register");
+}
+
+void
+i386_linux_dr_set_control (unsigned long control)
+{
+ i386_linux_dr_set (DR_CONTROL, control);
+}
+
+void
+i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+{
+ gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+
+ i386_linux_dr_set (DR_FIRSTADDR + regnum, addr);
+}
+
+void
+i386_linux_dr_reset_addr (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+
+ i386_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
+}
+
+unsigned long
+i386_linux_dr_get_status (void)
+{
+ return i386_linux_dr_get (DR_STATUS);
+}
+
+
+/* Interpreting register set info found in core files. */
+
+/* Provide registers to GDB from a core file.
+
+ (We can't use the generic version of this function in
+ core-regset.c, because GNU/Linux has *three* different kinds of
+ register set notes. core-regset.c would have to call
+ supply_fpxregset, which most platforms don't have.)
+
+ CORE_REG_SECT points to an array of bytes, which are the contents
+ of a `note' from a core file which BFD thinks might contain
+ register contents. CORE_REG_SIZE is its size.
+
+ WHICH says which register set corelow suspects this is:
+ 0 --- the general-purpose register set, in elf_gregset_t format
+ 2 --- the floating-point register set, in elf_fpregset_t format
+ 3 --- the extended floating-point register set, in elf_fpxregset_t format
+
+ REG_ADDR isn't used on GNU/Linux. */
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR reg_addr)
+{
+ elf_gregset_t gregset;
+ elf_fpregset_t fpregset;
+
+ switch (which)
+ {
+ case 0:
+ if (core_reg_size != sizeof (gregset))
+ warning ("Wrong size gregset in core file.");
+ else
+ {
+ memcpy (&gregset, core_reg_sect, sizeof (gregset));
+ supply_gregset (&gregset);
+ }
+ break;
+
+ case 2:
+ if (core_reg_size != sizeof (fpregset))
+ warning ("Wrong size fpregset in core file.");
+ else
+ {
+ memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
+ supply_fpregset (&fpregset);
+ }
+ break;
+
+#ifdef HAVE_PTRACE_GETFPXREGS
+ {
+ elf_fpxregset_t fpxregset;
+
+ case 3:
+ if (core_reg_size != sizeof (fpxregset))
+ warning ("Wrong size fpxregset in core file.");
+ else
+ {
+ memcpy (&fpxregset, core_reg_sect, sizeof (fpxregset));
+ supply_fpxregset (&fpxregset);
+ }
+ break;
+ }
+#endif
+
+ default:
+ /* We've covered all the kinds of registers we know about here,
+ so this must be something we wouldn't know what to do with
+ anyway. Just ignore it. */
+ break;
+ }
+}
+
+
+/* The instruction for a GNU/Linux system call is:
+ int $0x80
+ or 0xcd 0x80. */
+
+static const unsigned char linux_syscall[] = { 0xcd, 0x80 };
+
+#define LINUX_SYSCALL_LEN (sizeof linux_syscall)
+
+/* The system call number is stored in the %eax register. */
+#define LINUX_SYSCALL_REGNUM 0 /* %eax */
+
+/* We are specifically interested in the sigreturn and rt_sigreturn
+ system calls. */
+
+#ifndef SYS_sigreturn
+#define SYS_sigreturn 0x77
+#endif
+#ifndef SYS_rt_sigreturn
+#define SYS_rt_sigreturn 0xad
+#endif
+
+/* Offset to saved processor flags, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_EFLAGS_OFFSET (64)
+
+/* Resume execution of the inferior process.
+ If STEP is nonzero, single-step it.
+ If SIGNAL is nonzero, give it that signal. */
+
+void
+child_resume (ptid_t ptid, int step, enum target_signal signal)
+{
+ int pid = PIDGET (ptid);
+
+ int request = PTRACE_CONT;
+
+ if (pid == -1)
+ /* Resume all threads. */
+ /* I think this only gets used in the non-threaded case, where "resume
+ all threads" and "resume inferior_ptid" are the same. */
+ pid = PIDGET (inferior_ptid);
+
+ if (step)
+ {
+ CORE_ADDR pc = read_pc_pid (pid_to_ptid (pid));
+ unsigned char buf[LINUX_SYSCALL_LEN];
+
+ request = PTRACE_SINGLESTEP;
+
+ /* Returning from a signal trampoline is done by calling a
+ special system call (sigreturn or rt_sigreturn, see
+ i386-linux-tdep.c for more information). This system call
+ restores the registers that were saved when the signal was
+ raised, including %eflags. That means that single-stepping
+ won't work. Instead, we'll have to modify the signal context
+ that's about to be restored, and set the trace flag there. */
+
+ /* First check if PC is at a system call. */
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SYSCALL_LEN) == 0
+ && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0)
+ {
+ int syscall = read_register_pid (LINUX_SYSCALL_REGNUM,
+ pid_to_ptid (pid));
+
+ /* Then check the system call number. */
+ if (syscall == SYS_sigreturn || syscall == SYS_rt_sigreturn)
+ {
+ CORE_ADDR sp = read_register (SP_REGNUM);
+ CORE_ADDR addr = sp;
+ unsigned long int eflags;
+
+ if (syscall == SYS_rt_sigreturn)
+ addr = read_memory_integer (sp + 8, 4) + 20;
+
+ /* Set the trace flag in the context that's about to be
+ restored. */
+ addr += LINUX_SIGCONTEXT_EFLAGS_OFFSET;
+ read_memory (addr, (char *) &eflags, 4);
+ eflags |= 0x0100;
+ write_memory (addr, (char *) &eflags, 4);
+ }
+ }
+ }
+
+ if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)
+ perror_with_name ("ptrace");
+}
+
+
+/* Register that we are able to handle GNU/Linux ELF core file
+ formats. */
+
+static struct core_fns linux_elf_core_fns =
+{
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_i386_linux_nat (void)
+{
+ add_core_fns (&linux_elf_core_fns);
+}
diff --git a/contrib/gdb/gdb/i386-linux-tdep.c b/contrib/gdb/gdb/i386-linux-tdep.c
new file mode 100644
index 0000000..d67c01c
--- /dev/null
+++ b/contrib/gdb/gdb/i386-linux-tdep.c
@@ -0,0 +1,530 @@
+/* Target-dependent code for GNU/Linux running on i386's, for GDB.
+
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "frame.h"
+#include "value.h"
+#include "regcache.h"
+#include "inferior.h"
+
+/* For i386_linux_skip_solib_resolver. */
+#include "symtab.h"
+#include "symfile.h"
+#include "objfiles.h"
+
+#include "solib-svr4.h" /* For struct link_map_offsets. */
+
+/* Return the name of register REG. */
+
+char *
+i386_linux_register_name (int reg)
+{
+ /* Deal with the extra "orig_eax" pseudo register. */
+ if (reg == I386_LINUX_ORIG_EAX_REGNUM)
+ return "orig_eax";
+
+ return i386_register_name (reg);
+}
+
+int
+i386_linux_register_byte (int reg)
+{
+ /* Deal with the extra "orig_eax" pseudo register. */
+ if (reg == I386_LINUX_ORIG_EAX_REGNUM)
+ return (i386_register_byte (I386_LINUX_ORIG_EAX_REGNUM - 1)
+ + i386_register_raw_size (I386_LINUX_ORIG_EAX_REGNUM - 1));
+
+ return i386_register_byte (reg);
+}
+
+int
+i386_linux_register_raw_size (int reg)
+{
+ /* Deal with the extra "orig_eax" pseudo register. */
+ if (reg == I386_LINUX_ORIG_EAX_REGNUM)
+ return 4;
+
+ return i386_register_raw_size (reg);
+}
+
+/* Recognizing signal handler frames. */
+
+/* GNU/Linux has two flavors of signals. Normal signal handlers, and
+ "realtime" (RT) signals. The RT signals can provide additional
+ information to the signal handler if the SA_SIGINFO flag is set
+ when establishing a signal handler using `sigaction'. It is not
+ unlikely that future versions of GNU/Linux will support SA_SIGINFO
+ for normal signals too. */
+
+/* When the i386 Linux kernel calls a signal handler and the
+ SA_RESTORER flag isn't set, the return address points to a bit of
+ code on the stack. This function returns whether the PC appears to
+ be within this bit of code.
+
+ The instruction sequence for normal signals is
+ pop %eax
+ mov $0x77,%eax
+ int $0x80
+ or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
+
+ Checking for the code sequence should be somewhat reliable, because
+ the effect is to call the system call sigreturn. This is unlikely
+ to occur anywhere other than a signal trampoline.
+
+ It kind of sucks that we have to read memory from the process in
+ order to identify a signal trampoline, but there doesn't seem to be
+ any other way. The IN_SIGTRAMP macro in tm-linux.h arranges to
+ only call us if no function name could be identified, which should
+ be the case since the code is on the stack.
+
+ Detection of signal trampolines for handlers that set the
+ SA_RESTORER flag is in general not possible. Unfortunately this is
+ what the GNU C Library has been doing for quite some time now.
+ However, as of version 2.1.2, the GNU C Library uses signal
+ trampolines (named __restore and __restore_rt) that are identical
+ to the ones used by the kernel. Therefore, these trampolines are
+ supported too. */
+
+#define LINUX_SIGTRAMP_INSN0 (0x58) /* pop %eax */
+#define LINUX_SIGTRAMP_OFFSET0 (0)
+#define LINUX_SIGTRAMP_INSN1 (0xb8) /* mov $NNNN,%eax */
+#define LINUX_SIGTRAMP_OFFSET1 (1)
+#define LINUX_SIGTRAMP_INSN2 (0xcd) /* int */
+#define LINUX_SIGTRAMP_OFFSET2 (6)
+
+static const unsigned char linux_sigtramp_code[] =
+{
+ LINUX_SIGTRAMP_INSN0, /* pop %eax */
+ LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77,%eax */
+ LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
+};
+
+#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
+
+/* If PC is in a sigtramp routine, return the address of the start of
+ the routine. Otherwise, return 0. */
+
+static CORE_ADDR
+i386_linux_sigtramp_start (CORE_ADDR pc)
+{
+ unsigned char buf[LINUX_SIGTRAMP_LEN];
+
+ /* We only recognize a signal trampoline if PC is at the start of
+ one of the three instructions. We optimize for finding the PC at
+ the start, as will be the case when the trampoline is not the
+ first frame on the stack. We assume that in the case where the
+ PC is not at the start of the instruction sequence, there will be
+ a few trailing readable bytes on the stack. */
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ if (buf[0] != LINUX_SIGTRAMP_INSN0)
+ {
+ int adjust;
+
+ switch (buf[0])
+ {
+ case LINUX_SIGTRAMP_INSN1:
+ adjust = LINUX_SIGTRAMP_OFFSET1;
+ break;
+ case LINUX_SIGTRAMP_INSN2:
+ adjust = LINUX_SIGTRAMP_OFFSET2;
+ break;
+ default:
+ return 0;
+ }
+
+ pc -= adjust;
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+ }
+
+ if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ return pc;
+}
+
+/* This function does the same for RT signals. Here the instruction
+ sequence is
+ mov $0xad,%eax
+ int $0x80
+ or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80.
+
+ The effect is to call the system call rt_sigreturn. */
+
+#define LINUX_RT_SIGTRAMP_INSN0 (0xb8) /* mov $NNNN,%eax */
+#define LINUX_RT_SIGTRAMP_OFFSET0 (0)
+#define LINUX_RT_SIGTRAMP_INSN1 (0xcd) /* int */
+#define LINUX_RT_SIGTRAMP_OFFSET1 (5)
+
+static const unsigned char linux_rt_sigtramp_code[] =
+{
+ LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad,%eax */
+ LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */
+};
+
+#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
+
+/* If PC is in a RT sigtramp routine, return the address of the start
+ of the routine. Otherwise, return 0. */
+
+static CORE_ADDR
+i386_linux_rt_sigtramp_start (CORE_ADDR pc)
+{
+ unsigned char buf[LINUX_RT_SIGTRAMP_LEN];
+
+ /* We only recognize a signal trampoline if PC is at the start of
+ one of the two instructions. We optimize for finding the PC at
+ the start, as will be the case when the trampoline is not the
+ first frame on the stack. We assume that in the case where the
+ PC is not at the start of the instruction sequence, there will be
+ a few trailing readable bytes on the stack. */
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
+ {
+ if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
+ return 0;
+
+ pc -= LINUX_RT_SIGTRAMP_OFFSET1;
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
+ return 0;
+ }
+
+ if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ return pc;
+}
+
+/* Return whether PC is in a GNU/Linux sigtramp routine. */
+
+int
+i386_linux_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ if (name)
+ return STREQ ("__restore", name) || STREQ ("__restore_rt", name);
+
+ return (i386_linux_sigtramp_start (pc) != 0
+ || i386_linux_rt_sigtramp_start (pc) != 0);
+}
+
+/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
+ address of the associated sigcontext structure. */
+
+CORE_ADDR
+i386_linux_sigcontext_addr (struct frame_info *frame)
+{
+ CORE_ADDR pc;
+
+ pc = i386_linux_sigtramp_start (frame->pc);
+ if (pc)
+ {
+ CORE_ADDR sp;
+
+ if (frame->next)
+ /* If this isn't the top frame, the next frame must be for the
+ signal handler itself. The sigcontext structure lives on
+ the stack, right after the signum argument. */
+ return frame->next->frame + 12;
+
+ /* This is the top frame. We'll have to find the address of the
+ sigcontext structure by looking at the stack pointer. Keep
+ in mind that the first instruction of the sigtramp code is
+ "pop %eax". If the PC is at this instruction, adjust the
+ returned value accordingly. */
+ sp = read_register (SP_REGNUM);
+ if (pc == frame->pc)
+ return sp + 4;
+ return sp;
+ }
+
+ pc = i386_linux_rt_sigtramp_start (frame->pc);
+ if (pc)
+ {
+ if (frame->next)
+ /* If this isn't the top frame, the next frame must be for the
+ signal handler itself. The sigcontext structure is part of
+ the user context. A pointer to the user context is passed
+ as the third argument to the signal handler. */
+ return read_memory_integer (frame->next->frame + 16, 4) + 20;
+
+ /* This is the top frame. Again, use the stack pointer to find
+ the address of the sigcontext structure. */
+ return read_memory_integer (read_register (SP_REGNUM) + 8, 4) + 20;
+ }
+
+ error ("Couldn't recognize signal trampoline.");
+ return 0;
+}
+
+/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_PC_OFFSET (56)
+
+/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
+ saved program counter. */
+
+static CORE_ADDR
+i386_linux_sigtramp_saved_pc (struct frame_info *frame)
+{
+ CORE_ADDR addr;
+ addr = i386_linux_sigcontext_addr (frame);
+ return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 4);
+}
+
+/* Offset to saved SP in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_SP_OFFSET (28)
+
+/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
+ saved stack pointer. */
+
+static CORE_ADDR
+i386_linux_sigtramp_saved_sp (struct frame_info *frame)
+{
+ CORE_ADDR addr;
+ addr = i386_linux_sigcontext_addr (frame);
+ return read_memory_integer (addr + LINUX_SIGCONTEXT_SP_OFFSET, 4);
+}
+
+/* Signal trampolines don't have a meaningful frame. As in
+ "i386/tm-i386.h", the frame pointer value we use is actually the
+ frame pointer of the calling frame -- that is, the frame which was
+ in progress when the signal trampoline was entered. GDB mostly
+ treats this frame pointer value as a magic cookie. We detect the
+ case of a signal trampoline by looking at the SIGNAL_HANDLER_CALLER
+ field, which is set based on IN_SIGTRAMP.
+
+ When a signal trampoline is invoked from a frameless function, we
+ essentially have two frameless functions in a row. In this case,
+ we use the same magic cookie for three frames in a row. We detect
+ this case by seeing whether the next frame has
+ SIGNAL_HANDLER_CALLER set, and, if it does, checking whether the
+ current frame is actually frameless. In this case, we need to get
+ the PC by looking at the SP register value stored in the signal
+ context.
+
+ This should work in most cases except in horrible situations where
+ a signal occurs just as we enter a function but before the frame
+ has been set up. */
+
+#define FRAMELESS_SIGNAL(frame) \
+ ((frame)->next != NULL \
+ && (frame)->next->signal_handler_caller \
+ && frameless_look_for_prologue (frame))
+
+CORE_ADDR
+i386_linux_frame_chain (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame))
+ return frame->frame;
+
+ if (! inside_entry_file (frame->pc))
+ return read_memory_unsigned_integer (frame->frame, 4);
+
+ return 0;
+}
+
+/* Return the saved program counter for FRAME. */
+
+CORE_ADDR
+i386_linux_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return i386_linux_sigtramp_saved_pc (frame);
+
+ if (FRAMELESS_SIGNAL (frame))
+ {
+ CORE_ADDR sp = i386_linux_sigtramp_saved_sp (frame->next);
+ return read_memory_unsigned_integer (sp, 4);
+ }
+
+ return read_memory_unsigned_integer (frame->frame + 4, 4);
+}
+
+/* Immediately after a function call, return the saved pc. */
+
+CORE_ADDR
+i386_linux_saved_pc_after_call (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return i386_linux_sigtramp_saved_pc (frame);
+
+ return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
+}
+
+/* Set the program counter for process PTID to PC. */
+
+void
+i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+ write_register_pid (PC_REGNUM, pc, ptid);
+
+ /* We must be careful with modifying the program counter. If we
+ just interrupted a system call, the kernel might try to restart
+ it when we resume the inferior. On restarting the system call,
+ the kernel will try backing up the program counter even though it
+ no longer points at the system call. This typically results in a
+ SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
+ "orig_eax" pseudo-register.
+
+ Note that "orig_eax" is saved when setting up a dummy call frame.
+ This means that it is properly restored when that frame is
+ popped, and that the interrupted system call will be restarted
+ when we resume the inferior on return from a function call from
+ within GDB. In all other cases the system call will not be
+ restarted. */
+ write_register_pid (I386_LINUX_ORIG_EAX_REGNUM, -1, ptid);
+}
+
+/* Calling functions in shared libraries. */
+
+/* Find the minimal symbol named NAME, and return both the minsym
+ struct and its objfile. This probably ought to be in minsym.c, but
+ everything there is trying to deal with things like C++ and
+ SOFUN_ADDRESS_MAYBE_TURQUOISE, ... Since this is so simple, it may
+ be considered too special-purpose for general consumption. */
+
+static struct minimal_symbol *
+find_minsym_and_objfile (char *name, struct objfile **objfile_p)
+{
+ struct objfile *objfile;
+
+ ALL_OBJFILES (objfile)
+ {
+ struct minimal_symbol *msym;
+
+ ALL_OBJFILE_MSYMBOLS (objfile, msym)
+ {
+ if (SYMBOL_NAME (msym)
+ && STREQ (SYMBOL_NAME (msym), name))
+ {
+ *objfile_p = objfile;
+ return msym;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static CORE_ADDR
+skip_hurd_resolver (CORE_ADDR pc)
+{
+ /* The HURD dynamic linker is part of the GNU C library, so many
+ GNU/Linux distributions use it. (All ELF versions, as far as I
+ know.) An unresolved PLT entry points to "_dl_runtime_resolve",
+ which calls "fixup" to patch the PLT, and then passes control to
+ the function.
+
+ We look for the symbol `_dl_runtime_resolve', and find `fixup' in
+ the same objfile. If we are at the entry point of `fixup', then
+ we set a breakpoint at the return address (at the top of the
+ stack), and continue.
+
+ It's kind of gross to do all these checks every time we're
+ called, since they don't change once the executable has gotten
+ started. But this is only a temporary hack --- upcoming versions
+ of GNU/Linux will provide a portable, efficient interface for
+ debugging programs that use shared libraries. */
+
+ struct objfile *objfile;
+ struct minimal_symbol *resolver
+ = find_minsym_and_objfile ("_dl_runtime_resolve", &objfile);
+
+ if (resolver)
+ {
+ struct minimal_symbol *fixup
+ = lookup_minimal_symbol ("fixup", NULL, objfile);
+
+ if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
+ return (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ }
+
+ return 0;
+}
+
+/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
+ This function:
+ 1) decides whether a PLT has sent us into the linker to resolve
+ a function reference, and
+ 2) if so, tells us where to set a temporary breakpoint that will
+ trigger when the dynamic linker is done. */
+
+CORE_ADDR
+i386_linux_skip_solib_resolver (CORE_ADDR pc)
+{
+ CORE_ADDR result;
+
+ /* Plug in functions for other kinds of resolvers here. */
+ result = skip_hurd_resolver (pc);
+ if (result)
+ return result;
+
+ return 0;
+}
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+ structure for native GNU/Linux x86 targets using the struct offsets
+ defined in link.h (but without actual reference to that file).
+
+ This makes it possible to access GNU/Linux x86 shared libraries
+ from a GDB that was not built on an GNU/Linux x86 host (for cross
+ debugging). */
+
+struct link_map_offsets *
+i386_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
+ this is all we need. */
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* The actual size is 552 bytes, but
+ this is all we need. */
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
diff --git a/contrib/gdb/gdb/i386-nat.c b/contrib/gdb/gdb/i386-nat.c
new file mode 100644
index 0000000..adf220b
--- /dev/null
+++ b/contrib/gdb/gdb/i386-nat.c
@@ -0,0 +1,635 @@
+/* Intel x86 (a.k.a. ia32) native-dependent code.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "breakpoint.h"
+#include "command.h"
+#include "gdbcmd.h"
+
+/* Support for hardware watchpoints and breakpoints using the x86
+ debug registers.
+
+ This provides several functions for inserting and removing
+ hardware-assisted breakpoints and watchpoints, testing if
+ one or more of the watchpoints triggered and at what address,
+ checking whether a given region can be watched, etc.
+
+ A target which wants to use these functions should define
+ several macros, such as `target_insert_watchpoint' and
+ `target_stopped_data_address', listed in target.h, to call
+ the appropriate functions below. It should also define
+ I386_USE_GENERIC_WATCHPOINTS in its tm.h file.
+
+ In addition, each target should provide several low-level
+ macros that will be called to insert watchpoints and hardware
+ breakpoints into the inferior, remove them, and check their
+ status. These macros are:
+
+ I386_DR_LOW_SET_CONTROL -- set the debug control (DR7)
+ register to a given value
+
+ I386_DR_LOW_SET_ADDR -- put an address into one debug
+ register
+
+ I386_DR_LOW_RESET_ADDR -- reset the address stored in
+ one debug register
+
+ I386_DR_LOW_GET_STATUS -- return the value of the debug
+ status (DR6) register.
+
+ The functions below implement debug registers sharing by
+ reference counts, and allow to watch regions up to 16 bytes
+ long. */
+
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+
+/* Support for 8-byte wide hw watchpoints. */
+#ifndef TARGET_HAS_DR_LEN_8
+#define TARGET_HAS_DR_LEN_8 0
+#endif
+
+/* Debug registers' indices. */
+#define DR_NADDR 4 /* the number of debug address registers */
+#define DR_STATUS 6 /* index of debug status register (DR6) */
+#define DR_CONTROL 7 /* index of debug control register (DR7) */
+
+/* DR7 Debug Control register fields. */
+
+/* How many bits to skip in DR7 to get to R/W and LEN fields. */
+#define DR_CONTROL_SHIFT 16
+/* How many bits in DR7 per R/W and LEN field for each watchpoint. */
+#define DR_CONTROL_SIZE 4
+
+/* Watchpoint/breakpoint read/write fields in DR7. */
+#define DR_RW_EXECUTE (0x0) /* break on instruction execution */
+#define DR_RW_WRITE (0x1) /* break on data writes */
+#define DR_RW_READ (0x3) /* break on data reads or writes */
+
+/* This is here for completeness. No platform supports this
+ functionality yet (as of Mar-2001). Note that the DE flag in the
+ CR4 register needs to be set to support this. */
+#ifndef DR_RW_IORW
+#define DR_RW_IORW (0x2) /* break on I/O reads or writes */
+#endif
+
+/* Watchpoint/breakpoint length fields in DR7. The 2-bit left shift
+ is so we could OR this with the read/write field defined above. */
+#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpt */
+#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch */
+#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch */
+#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (x86-64) */
+
+/* Local and Global Enable flags in DR7.
+
+ When the Local Enable flag is set, the breakpoint/watchpoint is
+ enabled only for the current task; the processor automatically
+ clears this flag on every task switch. When the Global Enable
+ flag is set, the breakpoint/watchpoint is enabled for all tasks;
+ the processor never clears this flag.
+
+ Currently, all watchpoint are locally enabled. If you need to
+ enable them globally, read the comment which pertains to this in
+ i386_insert_aligned_watchpoint below. */
+#define DR_LOCAL_ENABLE_SHIFT 0 /* extra shift to the local enable bit */
+#define DR_GLOBAL_ENABLE_SHIFT 1 /* extra shift to the global enable bit */
+#define DR_ENABLE_SIZE 2 /* 2 enable bits per debug register */
+
+/* Local and global exact breakpoint enable flags (a.k.a. slowdown
+ flags). These are only required on i386, to allow detection of the
+ exact instruction which caused a watchpoint to break; i486 and
+ later processors do that automatically. We set these flags for
+ back compatibility. */
+#define DR_LOCAL_SLOWDOWN (0x100)
+#define DR_GLOBAL_SLOWDOWN (0x200)
+
+/* Fields reserved by Intel. This includes the GD (General Detect
+ Enable) flag, which causes a debug exception to be generated when a
+ MOV instruction accesses one of the debug registers.
+
+ FIXME: My Intel manual says we should use 0xF800, not 0xFC00. */
+#define DR_CONTROL_RESERVED (0xFC00)
+
+/* Auxiliary helper macros. */
+
+/* A value that masks all fields in DR7 that are reserved by Intel. */
+#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED)
+
+/* The I'th debug register is vacant if its Local and Global Enable
+ bits are reset in the Debug Control register. */
+#define I386_DR_VACANT(i) \
+ ((dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0)
+
+/* Locally enable the break/watchpoint in the I'th debug register. */
+#define I386_DR_LOCAL_ENABLE(i) \
+ dr_control_mirror |= (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))
+
+/* Globally enable the break/watchpoint in the I'th debug register. */
+#define I386_DR_GLOBAL_ENABLE(i) \
+ dr_control_mirror |= (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))
+
+/* Disable the break/watchpoint in the I'th debug register. */
+#define I386_DR_DISABLE(i) \
+ dr_control_mirror &= ~(3 << (DR_ENABLE_SIZE * (i)))
+
+/* Set in DR7 the RW and LEN fields for the I'th debug register. */
+#define I386_DR_SET_RW_LEN(i,rwlen) \
+ do { \
+ dr_control_mirror &= ~(0x0f << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i))); \
+ dr_control_mirror |= ((rwlen) << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i))); \
+ } while (0)
+
+/* Get from DR7 the RW and LEN fields for the I'th debug register. */
+#define I386_DR_GET_RW_LEN(i) \
+ ((dr_control_mirror >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f)
+
+/* Did the watchpoint whose address is in the I'th register break? */
+#define I386_DR_WATCH_HIT(i) (dr_status_mirror & (1 << (i)))
+
+/* A macro to loop over all debug registers. */
+#define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++)
+
+/* Mirror the inferior's DRi registers. We keep the status and
+ control registers separated because they don't hold addresses. */
+static CORE_ADDR dr_mirror[DR_NADDR];
+static unsigned dr_status_mirror, dr_control_mirror;
+
+/* Reference counts for each debug register. */
+static int dr_ref_count[DR_NADDR];
+
+/* Whether or not to print the mirrored debug registers. */
+static int maint_show_dr;
+
+/* Types of operations supported by i386_handle_nonaligned_watchpoint. */
+typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t;
+
+/* Internal functions. */
+
+/* Return the value of a 4-bit field for DR7 suitable for watching a
+ region of LEN bytes for accesses of type TYPE. LEN is assumed
+ to have the value of 1, 2, or 4. */
+static unsigned i386_length_and_rw_bits (int len, enum target_hw_bp_type type);
+
+/* Insert a watchpoint at address ADDR, which is assumed to be aligned
+ according to the length of the region to watch. LEN_RW_BITS is the
+ value of the bit-field from DR7 which describes the length and
+ access type of the region to be watched by this watchpoint. Return
+ 0 on success, -1 on failure. */
+static int i386_insert_aligned_watchpoint (CORE_ADDR addr,
+ unsigned len_rw_bits);
+
+/* Remove a watchpoint at address ADDR, which is assumed to be aligned
+ according to the length of the region to watch. LEN_RW_BITS is the
+ value of the bits from DR7 which describes the length and access
+ type of the region watched by this watchpoint. Return 0 on
+ success, -1 on failure. */
+static int i386_remove_aligned_watchpoint (CORE_ADDR addr,
+ unsigned len_rw_bits);
+
+/* Insert or remove a (possibly non-aligned) watchpoint, or count the
+ number of debug registers required to watch a region at address
+ ADDR whose length is LEN for accesses of type TYPE. Return 0 on
+ successful insertion or removal, a positive number when queried
+ about the number of registers, or -1 on failure. If WHAT is not
+ a valid value, bombs through internal_error. */
+static int i386_handle_nonaligned_watchpoint (i386_wp_op_t what,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type);
+
+/* Implementation. */
+
+/* Clear the reference counts and forget everything we knew about
+ the debug registers. */
+void
+i386_cleanup_dregs (void)
+{
+ int i;
+
+ ALL_DEBUG_REGISTERS(i)
+ {
+ dr_mirror[i] = 0;
+ dr_ref_count[i] = 0;
+ }
+ dr_control_mirror = 0;
+ dr_status_mirror = 0;
+}
+
+/* Print the values of the mirrored debug registers.
+ This is called when maint_show_dr is non-zero. To set that
+ up, type "maint show-debug-regs" at GDB's prompt. */
+static void
+i386_show_dr (const char *func, CORE_ADDR addr,
+ int len, enum target_hw_bp_type type)
+{
+ int i;
+
+ puts_unfiltered (func);
+ if (addr || len)
+ printf_unfiltered (" (addr=%lx, len=%d, type=%s)",
+ /* This code is for ia32, so casting CORE_ADDR
+ to unsigned long should be okay. */
+ (unsigned long)addr, len,
+ type == hw_write ? "data-write"
+ : (type == hw_read ? "data-read"
+ : (type == hw_access ? "data-read/write"
+ : (type == hw_execute ? "instruction-execute"
+ /* FIXME: if/when I/O read/write
+ watchpoints are supported, add them
+ here. */
+ : "??unknown??"))));
+ puts_unfiltered (":\n");
+ printf_unfiltered ("\tCONTROL (DR7): %08x STATUS (DR6): %08x\n",
+ dr_control_mirror, dr_status_mirror);
+ ALL_DEBUG_REGISTERS(i)
+ {
+ printf_unfiltered ("\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
+ i, paddr(dr_mirror[i]), dr_ref_count[i],
+ i+1, paddr(dr_mirror[i+1]), dr_ref_count[i+1]);
+ i++;
+ }
+}
+
+/* Return the value of a 4-bit field for DR7 suitable for watching a
+ region of LEN bytes for accesses of type TYPE. LEN is assumed
+ to have the value of 1, 2, or 4. */
+static unsigned
+i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
+{
+ unsigned rw;
+
+ switch (type)
+ {
+ case hw_execute:
+ rw = DR_RW_EXECUTE;
+ break;
+ case hw_write:
+ rw = DR_RW_WRITE;
+ break;
+ case hw_read: /* x86 doesn't support data-read watchpoints */
+ case hw_access:
+ rw = DR_RW_READ;
+ break;
+#if 0
+ case hw_io_access: /* not yet supported */
+ rw = DR_RW_IORW;
+ break;
+#endif
+ default:
+ internal_error (__FILE__, __LINE__, "\
+Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (int)type);
+ }
+
+ switch (len)
+ {
+ case 1:
+ return (DR_LEN_1 | rw);
+ case 2:
+ return (DR_LEN_2 | rw);
+ case 4:
+ return (DR_LEN_4 | rw);
+ case 8:
+ if (TARGET_HAS_DR_LEN_8)
+ return (DR_LEN_8 | rw);
+ default:
+ internal_error (__FILE__, __LINE__, "\
+Invalid hw breakpoint length %d in i386_length_and_rw_bits.\n", len);
+ }
+}
+
+/* Insert a watchpoint at address ADDR, which is assumed to be aligned
+ according to the length of the region to watch. LEN_RW_BITS is the
+ value of the bits from DR7 which describes the length and access
+ type of the region to be watched by this watchpoint. Return 0 on
+ success, -1 on failure. */
+static int
+i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+{
+ int i;
+
+ /* First, look for an occupied debug register with the same address
+ and the same RW and LEN definitions. If we find one, we can
+ reuse it for this watchpoint as well (and save a register). */
+ ALL_DEBUG_REGISTERS(i)
+ {
+ if (!I386_DR_VACANT (i)
+ && dr_mirror[i] == addr
+ && I386_DR_GET_RW_LEN (i) == len_rw_bits)
+ {
+ dr_ref_count[i]++;
+ return 0;
+ }
+ }
+
+ /* Next, look for a vacant debug register. */
+ ALL_DEBUG_REGISTERS(i)
+ {
+ if (I386_DR_VACANT (i))
+ break;
+ }
+
+ /* No more debug registers! */
+ if (i >= DR_NADDR)
+ return -1;
+
+ /* Now set up the register I to watch our region. */
+
+ /* Record the info in our local mirrored array. */
+ dr_mirror[i] = addr;
+ dr_ref_count[i] = 1;
+ I386_DR_SET_RW_LEN (i, len_rw_bits);
+ /* Note: we only enable the watchpoint locally, i.e. in the current
+ task. Currently, no x86 target allows or supports global
+ watchpoints; however, if any target would want that in the
+ future, GDB should probably provide a command to control whether
+ to enable watchpoints globally or locally, and the code below
+ should use global or local enable and slow-down flags as
+ appropriate. */
+ I386_DR_LOCAL_ENABLE (i);
+ dr_control_mirror |= DR_LOCAL_SLOWDOWN;
+ dr_control_mirror &= I386_DR_CONTROL_MASK;
+
+ /* Finally, actually pass the info to the inferior. */
+ I386_DR_LOW_SET_ADDR (i, addr);
+ I386_DR_LOW_SET_CONTROL (dr_control_mirror);
+
+ return 0;
+}
+
+/* Remove a watchpoint at address ADDR, which is assumed to be aligned
+ according to the length of the region to watch. LEN_RW_BITS is the
+ value of the bits from DR7 which describes the length and access
+ type of the region watched by this watchpoint. Return 0 on
+ success, -1 on failure. */
+static int
+i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+{
+ int i, retval = -1;
+
+ ALL_DEBUG_REGISTERS(i)
+ {
+ if (!I386_DR_VACANT (i)
+ && dr_mirror[i] == addr
+ && I386_DR_GET_RW_LEN (i) == len_rw_bits)
+ {
+ if (--dr_ref_count[i] == 0) /* no longer in use? */
+ {
+ /* Reset our mirror. */
+ dr_mirror[i] = 0;
+ I386_DR_DISABLE (i);
+ /* Reset it in the inferior. */
+ I386_DR_LOW_SET_CONTROL (dr_control_mirror);
+ I386_DR_LOW_RESET_ADDR (i);
+ }
+ retval = 0;
+ }
+ }
+
+ return retval;
+}
+
+/* Insert or remove a (possibly non-aligned) watchpoint, or count the
+ number of debug registers required to watch a region at address
+ ADDR whose length is LEN for accesses of type TYPE. Return 0 on
+ successful insertion or removal, a positive number when queried
+ about the number of registers, or -1 on failure. If WHAT is not
+ a valid value, bombs through internal_error. */
+static int
+i386_handle_nonaligned_watchpoint (i386_wp_op_t what, CORE_ADDR addr, int len,
+ enum target_hw_bp_type type)
+{
+ int align;
+ int size;
+ int rv = 0, status = 0;
+ int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4;
+
+ static int size_try_array[8][8] =
+ {
+ {1, 1, 1, 1, 1, 1, 1, 1}, /* trying size one */
+ {2, 1, 2, 1, 2, 1, 2, 1}, /* trying size two */
+ {2, 1, 2, 1, 2, 1, 2, 1}, /* trying size three */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size four */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size five */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size six */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size seven */
+ {8, 1, 2, 1, 4, 1, 2, 1}, /* trying size eight */
+ };
+
+ while (len > 0)
+ {
+ align = addr % max_wp_len;
+ /* Four(eigth on x86_64) is the maximum length an x86 debug register
+ can watch. */
+ size = size_try_array[len > max_wp_len ? (max_wp_len - 1) : len - 1][align];
+ if (what == WP_COUNT)
+ /* size_try_array[] is defined so that each iteration through
+ the loop is guaranteed to produce an address and a size
+ that can be watched with a single debug register. Thus,
+ for counting the registers required to watch a region, we
+ simply need to increment the count on each iteration. */
+ rv++;
+ else
+ {
+ unsigned len_rw = i386_length_and_rw_bits (size, type);
+
+ if (what == WP_INSERT)
+ status = i386_insert_aligned_watchpoint (addr, len_rw);
+ else if (what == WP_REMOVE)
+ status = i386_remove_aligned_watchpoint (addr, len_rw);
+ else
+ internal_error (__FILE__, __LINE__, "\
+Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n",
+ (int)what);
+ /* We keep the loop going even after a failure, because some
+ of the other aligned watchpoints might still succeed
+ (e.g. if they watch addresses that are already watched,
+ in which case we just increment the reference counts of
+ occupied debug registers). If we break out of the loop
+ too early, we could cause those addresses watched by
+ other watchpoints to be disabled when breakpoint.c reacts
+ to our failure to insert this watchpoint and tries to
+ remove it. */
+ if (status)
+ rv = status;
+ }
+ addr += size;
+ len -= size;
+ }
+ return rv;
+}
+
+/* Insert a watchpoint to watch a memory region which starts at
+ address ADDR and whose length is LEN bytes. Watch memory accesses
+ of the type TYPE. Return 0 on success, -1 on failure. */
+int
+i386_insert_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ int retval;
+
+ if (((len != 1 && len !=2 && len !=4) && !(TARGET_HAS_DR_LEN_8 && len == 8))
+ || addr % len != 0)
+ retval = i386_handle_nonaligned_watchpoint (WP_INSERT, addr, len, type);
+ else
+ {
+ unsigned len_rw = i386_length_and_rw_bits (len, type);
+
+ retval = i386_insert_aligned_watchpoint (addr, len_rw);
+ }
+
+ if (maint_show_dr)
+ i386_show_dr ("insert_watchpoint", addr, len, type);
+
+ return retval;
+}
+
+/* Remove a watchpoint that watched the memory region which starts at
+ address ADDR, whose length is LEN bytes, and for accesses of the
+ type TYPE. Return 0 on success, -1 on failure. */
+int
+i386_remove_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ int retval;
+
+ if (((len != 1 && len !=2 && len !=4) && !(TARGET_HAS_DR_LEN_8 && len == 8))
+ || addr % len != 0)
+ retval = i386_handle_nonaligned_watchpoint (WP_REMOVE, addr, len, type);
+ else
+ {
+ unsigned len_rw = i386_length_and_rw_bits (len, type);
+
+ retval = i386_remove_aligned_watchpoint (addr, len_rw);
+ }
+
+ if (maint_show_dr)
+ i386_show_dr ("remove_watchpoint", addr, len, type);
+
+ return retval;
+}
+
+/* Return non-zero if we can watch a memory region that starts at
+ address ADDR and whose length is LEN bytes. */
+int
+i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
+{
+ /* Compute how many aligned watchpoints we would need to cover this
+ region. */
+ int nregs = i386_handle_nonaligned_watchpoint (WP_COUNT, addr, len,
+ hw_write);
+
+ return nregs <= DR_NADDR ? 1 : 0;
+}
+
+/* If the inferior has some watchpoint that triggered, return the
+ address associated with that watchpoint. Otherwise, return
+ zero. */
+CORE_ADDR
+i386_stopped_data_address (void)
+{
+ int i;
+ CORE_ADDR ret = 0;
+
+ dr_status_mirror = I386_DR_LOW_GET_STATUS ();
+
+ ALL_DEBUG_REGISTERS(i)
+ {
+ if (I386_DR_WATCH_HIT (i)
+ /* This second condition makes sure DRi is set up for a data
+ watchpoint, not a hardware breakpoint. The reason is
+ that GDB doesn't call the target_stopped_data_address
+ method except for data watchpoints. In other words, I'm
+ being paranoiac. */
+ && I386_DR_GET_RW_LEN (i) != 0)
+ {
+ ret = dr_mirror[i];
+ if (maint_show_dr)
+ i386_show_dr ("watchpoint_hit", ret, -1, hw_write);
+ }
+ }
+ if (maint_show_dr && ret == 0)
+ i386_show_dr ("stopped_data_addr", 0, 0, hw_write);
+
+ return ret;
+}
+
+/* Return non-zero if the inferior has some break/watchpoint that
+ triggered. */
+int
+i386_stopped_by_hwbp (void)
+{
+ int i;
+
+ dr_status_mirror = I386_DR_LOW_GET_STATUS ();
+ if (maint_show_dr)
+ i386_show_dr ("stopped_by_hwbp", 0, 0, hw_execute);
+
+ ALL_DEBUG_REGISTERS(i)
+ {
+ if (I386_DR_WATCH_HIT (i))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, EBUSY on failure. */
+int
+i386_insert_hw_breakpoint (CORE_ADDR addr, void *shadow)
+{
+ unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
+ int retval = i386_insert_aligned_watchpoint (addr, len_rw) ? EBUSY : 0;
+
+ if (maint_show_dr)
+ i386_show_dr ("insert_hwbp", addr, 1, hw_execute);
+
+ return retval;
+}
+
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, -1 on failure. */
+int
+i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow)
+{
+ unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
+ int retval = i386_remove_aligned_watchpoint (addr, len_rw);
+
+ if (maint_show_dr)
+ i386_show_dr ("remove_hwbp", addr, 1, hw_execute);
+
+ return retval;
+}
+
+#endif /* I386_USE_GENERIC_WATCHPOINTS */
+
+
+void
+_initialize_i386_nat (void)
+{
+#ifdef I386_USE_GENERIC_WATCHPOINTS
+ /* A maintenance command to enable printing the internal DRi mirror
+ variables. */
+ add_set_cmd ("show-debug-regs", class_maintenance,
+ var_boolean, (char *) &maint_show_dr,
+ "\
+Set whether to show variables that mirror the x86 debug registers.\n\
+Use \"on\" to enable, \"off\" to disable.\n\
+If enabled, the debug registers values are shown when GDB inserts\n\
+or removes a hardware breakpoint or watchpoint, and when the inferior\n\
+triggers a breakpoint or watchpoint.", &maintenancelist);
+#endif
+}
diff --git a/contrib/gdb/gdb/i386-tdep.h b/contrib/gdb/gdb/i386-tdep.h
new file mode 100644
index 0000000..a990adf
--- /dev/null
+++ b/contrib/gdb/gdb/i386-tdep.h
@@ -0,0 +1,116 @@
+/* Target-dependent code for GDB, the GNU debugger.
+ Copyright 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef I386_TDEP_H
+#define I386_TDEP_H
+
+/* GDB's i386 target supports both the 32-bit Intel Architecture
+ (IA-32) and the 64-bit AMD x86-64 architecture. Internally it uses
+ a similar register layout for both.
+
+ - General purpose registers
+ - FPU data registers
+ - FPU control registers
+ - SSE data registers
+ - SSE control register
+
+ The general purpose registers for the x86-64 architecture are quite
+ different from IA-32. Therefore, the FP0_REGNUM target macro
+ determines the register number at which the FPU data registers
+ start. The number of FPU data and control registers is the same
+ for both architectures. The number of SSE registers however,
+ differs and is determined by the num_xmm_regs member of `struct
+ gdbarch_tdep'. */
+
+/* i386 architecture specific information. */
+struct gdbarch_tdep
+{
+ /* OS/ABI. */
+ int os_ident;
+
+ /* Number of SSE registers. */
+ int num_xmm_regs;
+};
+
+/* Floating-point registers. */
+
+#define FPU_REG_RAW_SIZE 10
+
+/* All FPU control regusters (except for FIOFF and FOOFF) are 16-bit
+ (at most) in the FPU, but are zero-extended to 32 bits in GDB's
+ register cache. */
+
+/* "Generic" floating point control register. */
+#define FPC_REGNUM (FP0_REGNUM + 8)
+
+/* FPU control word. */
+#define FCTRL_REGNUM FPC_REGNUM
+
+/* FPU status word. */
+#define FSTAT_REGNUM (FPC_REGNUM + 1)
+
+/* FPU register tag word. */
+#define FTAG_REGNUM (FPC_REGNUM + 2)
+
+/* FPU instruction's code segment selector, called "FPU Instruction
+ Pointer Selector" in the IA-32 manuals. */
+#define FISEG_REGNUM (FPC_REGNUM + 3)
+
+/* FPU instruction's offset within segment. */
+#define FIOFF_REGNUM (FPC_REGNUM + 4)
+
+/* FPU operand's data segment. */
+#define FOSEG_REGNUM (FPC_REGNUM + 5)
+
+/* FPU operand's offset within segment */
+#define FOOFF_REGNUM (FPC_REGNUM + 6)
+
+/* FPU opcode, bottom eleven bits. */
+#define FOP_REGNUM (FPC_REGNUM + 7)
+
+/* Return non-zero if N corresponds to a FPU data registers. */
+#define FP_REGNUM_P(n) (FP0_REGNUM <= (n) && (n) < FPC_REGNUM)
+
+/* Return non-zero if N corresponds to a FPU control register. */
+#define FPC_REGNUM_P(n) (FPC_REGNUM <= (n) && (n) < XMM0_REGNUM)
+
+/* SSE registers. */
+
+/* First SSE data register. */
+#define XMM0_REGNUM (FPC_REGNUM + 8)
+
+/* SSE control/status register. */
+#define MXCSR_REGNUM \
+ (XMM0_REGNUM + gdbarch_tdep (current_gdbarch)->num_xmm_regs)
+
+/* Return non-zero if N corresponds to a SSE data register. */
+#define SSE_REGNUM_P(n) (XMM0_REGNUM <= (n) && (n) < MXCSR_REGNUM)
+
+/* FIXME: kettenis/2001-11-24: Obsolete macro's. */
+#define FCS_REGNUM FISEG_REGNUM
+#define FCOFF_REGNUM FIOFF_REGNUM
+#define FDS_REGNUM FOSEG_REGNUM
+#define FDOFF_REGNUM FOOFF_REGNUM
+#define IS_FP_REGNUM(n) FP_REGNUM_P (n)
+#define IS_FPU_CTRL_REGNUM(n) FPC_REGNUM_P (n)
+#define IS_SSE_REGNUM(n) SSE_REGNUM_P (n)
+
+#endif /* i386-tdep.h */
diff --git a/contrib/gdb/gdb/i386bsd-nat.c b/contrib/gdb/gdb/i386bsd-nat.c
new file mode 100644
index 0000000..5d35830
--- /dev/null
+++ b/contrib/gdb/gdb/i386bsd-nat.c
@@ -0,0 +1,400 @@
+/* Native-dependent code for modern i386 BSD's.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include "gdb_assert.h"
+#include <signal.h>
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+#include <machine/frame.h>
+
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
+
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
+#ifndef HAVE_FPREGSET_T
+typedef struct fpreg fpregset_t;
+#endif
+
+#include "gregset.h"
+
+
+/* In older BSD versions we cannot get at some of the segment
+ registers. FreeBSD for example didn't support the %fs and %gs
+ registers until the 3.0 release. We have autoconf checks for their
+ presence, and deal gracefully with their absence. */
+
+/* Registers we shouldn't try to fetch. */
+#if !defined (CANNOT_FETCH_REGISTER)
+#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno)
+#endif
+
+/* Registers we shouldn't try to store. */
+#if !defined (CANNOT_STORE_REGISTER)
+#define CANNOT_STORE_REGISTER(regno) cannot_fetch_register (regno)
+#endif
+
+/* Offset to the gregset_t location where REG is stored. */
+#define REG_OFFSET(reg) offsetof (gregset_t, reg)
+
+/* At reg_offset[REGNO] you'll find the offset to the gregset_t
+ location where the GDB register REGNO is stored. Unsupported
+ registers are marked with `-1'. */
+static int reg_offset[] =
+{
+ REG_OFFSET (r_eax),
+ REG_OFFSET (r_ecx),
+ REG_OFFSET (r_edx),
+ REG_OFFSET (r_ebx),
+ REG_OFFSET (r_esp),
+ REG_OFFSET (r_ebp),
+ REG_OFFSET (r_esi),
+ REG_OFFSET (r_edi),
+ REG_OFFSET (r_eip),
+ REG_OFFSET (r_eflags),
+ REG_OFFSET (r_cs),
+ REG_OFFSET (r_ss),
+ REG_OFFSET (r_ds),
+ REG_OFFSET (r_es),
+#ifdef HAVE_STRUCT_REG_R_FS
+ REG_OFFSET (r_fs),
+#else
+ -1,
+#endif
+#ifdef HAVE_STRUCT_REG_R_GS
+ REG_OFFSET (r_gs)
+#else
+ -1
+#endif
+};
+
+#define REG_ADDR(regset, regno) ((char *) (regset) + reg_offset[regno])
+
+/* Macro to determine if a register is fetched with PT_GETREGS. */
+#define GETREGS_SUPPLIES(regno) \
+ ((0 <= (regno) && (regno) <= 15))
+
+#ifdef HAVE_PT_GETXMMREGS
+/* Set to 1 if the kernel supports PT_GETXMMREGS. Initialized to -1
+ so that we try PT_GETXMMREGS the first time around. */
+static int have_ptrace_xmmregs = -1;
+#endif
+
+/* Return nonzero if we shouldn't try to fetch register REGNO. */
+
+static int
+cannot_fetch_register (int regno)
+{
+ return (reg_offset[regno] == -1);
+}
+
+
+/* Transfering the registers between GDB, inferiors and core files. */
+
+/* Fill GDB's register array with the general-purpose register values
+ in *GREGSETP. */
+
+void
+supply_gregset (gregset_t *gregsetp)
+{
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ {
+ if (CANNOT_FETCH_REGISTER (i))
+ supply_register (i, NULL);
+ else
+ supply_register (i, REG_ADDR (gregsetp, i));
+ }
+}
+
+/* Fill register REGNO (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+ int i;
+
+ for (i = 0; i < NUM_GREGS; i++)
+ if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
+ regcache_collect (i, REG_ADDR (gregsetp, i));
+}
+
+#include "i387-nat.h"
+
+/* Fill GDB's register array with the floating-point register values
+ in *FPREGSETP. */
+
+void
+supply_fpregset (fpregset_t *fpregsetp)
+{
+ i387_supply_fsave ((char *) fpregsetp);
+}
+
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+ i387_fill_fsave ((char *) fpregsetp, regno);
+}
+
+/* Fetch register REGNO from the inferior. If REGNO is -1, do this
+ for all registers (including the floating point registers). */
+
+void
+fetch_inferior_registers (int regno)
+{
+
+ if (regno == -1 || GETREGS_SUPPLIES (regno))
+ {
+ gregset_t gregs;
+
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ supply_gregset (&gregs);
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || regno >= FP0_REGNUM)
+ {
+ fpregset_t fpregs;
+#ifdef HAVE_PT_GETXMMREGS
+ char xmmregs[512];
+
+ if (have_ptrace_xmmregs != 0 &&
+ ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
+ {
+ have_ptrace_xmmregs = 1;
+ i387_supply_fxsave (xmmregs);
+ }
+ else
+ {
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating point status");
+
+ supply_fpregset (&fpregs);
+ }
+#else
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating point status");
+
+ supply_fpregset (&fpregs);
+#endif
+ }
+}
+
+/* Store register REGNO back into the inferior. If REGNO is -1, do
+ this for all registers (including the floating point registers). */
+
+void
+store_inferior_registers (int regno)
+{
+
+ if (regno == -1 || GETREGS_SUPPLIES (regno))
+ {
+ gregset_t gregs;
+
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ fill_gregset (&gregs, regno);
+
+ if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ perror_with_name ("Couldn't write registers");
+
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || regno >= FP0_REGNUM)
+ {
+ fpregset_t fpregs;
+#ifdef HAVE_PT_GETXMMREGS
+ char xmmregs[512];
+
+ if (have_ptrace_xmmregs != 0 &&
+ ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
+ {
+ have_ptrace_xmmregs = 1;
+
+ i387_fill_fxsave (xmmregs, regno);
+
+ if (ptrace (PT_SETXMMREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) xmmregs, 0) == -1)
+ perror_with_name ("Couldn't write XMM registers");
+ }
+ else
+ {
+ have_ptrace_xmmregs = 0;
+#endif
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating point status");
+
+ fill_fpregset (&fpregs, regno);
+
+ if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't write floating point status");
+#ifdef HAVE_PT_GETXMMREGS
+ }
+#endif
+ }
+}
+
+
+/* Support for debug registers. */
+
+#ifdef HAVE_PT_GETDBREGS
+
+/* Not all versions of FreeBSD/i386 that support the debug registers
+ have this macro. */
+#ifndef DBREG_DRX
+#define DBREG_DRX(d, x) ((&d->dr0)[x])
+#endif
+
+static void
+i386bsd_dr_set (int regnum, unsigned int value)
+{
+ struct dbreg dbregs;
+
+ if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &dbregs, 0) == -1)
+ perror_with_name ("Couldn't get debug registers");
+
+ /* For some mysterious reason, some of the reserved bits in the
+ debug control register get set. Mask these off, otherwise the
+ ptrace call below will fail. */
+ dbregs.dr7 &= ~(0x0000fc00);
+
+ DBREG_DRX ((&dbregs), regnum) = value;
+
+ if (ptrace (PT_SETDBREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &dbregs, 0) == -1)
+ perror_with_name ("Couldn't write debug registers");
+}
+
+void
+i386bsd_dr_set_control (unsigned long control)
+{
+ i386bsd_dr_set (7, control);
+}
+
+void
+i386bsd_dr_set_addr (int regnum, CORE_ADDR addr)
+{
+ gdb_assert (regnum >= 0 && regnum <= 4);
+
+ i386bsd_dr_set (regnum, addr);
+}
+
+void
+i386bsd_dr_reset_addr (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum <= 4);
+
+ i386bsd_dr_set (regnum, 0);
+}
+
+unsigned long
+i386bsd_dr_get_status (void)
+{
+ struct dbreg dbregs;
+
+ /* FIXME: kettenis/2001-03-31: Calling perror_with_name if the
+ ptrace call fails breaks debugging remote targets. The correct
+ way to fix this is to add the hardware breakpoint and watchpoint
+ stuff to the target vector. For now, just return zero if the
+ ptrace call fails. */
+ if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & dbregs, 0) == -1)
+#if 0
+ perror_with_name ("Couldn't read debug registers");
+#else
+ return 0;
+#endif
+
+ return dbregs.dr6;
+}
+
+#endif /* PT_GETDBREGS */
+
+
+/* Support for the user struct. */
+
+/* Return the address register REGNO. BLOCKEND is the value of
+ u.u_ar0, which should point to the registers. */
+
+CORE_ADDR
+register_u_addr (CORE_ADDR blockend, int regno)
+{
+ return (CORE_ADDR) REG_ADDR (blockend, regno);
+}
+
+#include <sys/param.h>
+#include <sys/user.h>
+
+/* Return the size of the user struct. */
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
+/* See i386bsd-tdep.c. */
+extern int i386bsd_sigcontext_pc_offset;
+
+void
+_initialize_i386bsd_nat (void)
+{
+ /* To support the recognition of signal handlers, i386bsd-tdep.c
+ hardcodes some constants. Inclusion of this file means that we
+ are compiling a native debugger, which means that we can use the
+ system header files and sysctl(3) to get at the relevant
+ information. */
+
+ /* Override the default value for the offset of the program counter
+ in the sigcontext structure. */
+ i386bsd_sigcontext_pc_offset = offsetof (struct sigcontext, sc_pc);
+}
diff --git a/contrib/gdb/gdb/i386bsd-tdep.c b/contrib/gdb/gdb/i386bsd-tdep.c
new file mode 100644
index 0000000..a01ed6b
--- /dev/null
+++ b/contrib/gdb/gdb/i386bsd-tdep.c
@@ -0,0 +1,84 @@
+/* Target-dependent code for i386 BSD's.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+/* Support for signal handlers. */
+
+/* Range in which to find the signaltramp routine, traditionally found
+ on the use stack, just below the user area. Initialized to values
+ that work for NetBSD and FreeBSD. */
+
+CORE_ADDR i386bsd_sigtramp_start = 0xbfbfdf20;
+CORE_ADDR i386bsd_sigtramp_end = 0xbfbfdff0;
+
+/* Return whether PC is in a BSD sigtramp routine. */
+
+int
+i386bsd_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ return (pc >= i386bsd_sigtramp_start && pc < i386bsd_sigtramp_end);
+}
+
+/* Offset in the sigcontext structure of the program counter.
+ Initialized to the value from 4.4 BSD Lite. */
+int i386bsd_sigcontext_pc_offset = 20;
+
+/* Assuming FRAME is for a BSD sigtramp routine, return the address of
+ the associated sigcontext structure. */
+
+static CORE_ADDR
+i386bsd_sigcontext_addr (struct frame_info *frame)
+{
+ if (frame->next)
+ /* If this isn't the top frame, the next frame must be for the
+ signal handler itself. A pointer to the sigcontext structure
+ is passed as the third argument to the signal handler. */
+ return read_memory_unsigned_integer (frame->next->frame + 16, 4);
+
+ /* This is the top frame. We'll have to find the address of the
+ sigcontext structure by looking at the stack pointer. */
+ return read_memory_unsigned_integer (read_register (SP_REGNUM) + 8, 4);
+}
+
+/* Assuming FRAME is for a BSD sigtramp routine, return the saved
+ program counter. */
+
+static CORE_ADDR
+i386bsd_sigtramp_saved_pc (struct frame_info *frame)
+{
+ CORE_ADDR addr;
+ addr = i386bsd_sigcontext_addr (frame);
+ return read_memory_unsigned_integer (addr + i386bsd_sigcontext_pc_offset, 4);
+}
+
+/* Return the saved program counter for FRAME. */
+
+CORE_ADDR
+i386bsd_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return i386bsd_sigtramp_saved_pc (frame);
+
+ return read_memory_unsigned_integer (frame->frame + 4, 4);
+}
diff --git a/contrib/gdb/gdb/i386fbsd-nat.c b/contrib/gdb/gdb/i386fbsd-nat.c
new file mode 100644
index 0000000..1c19ac8
--- /dev/null
+++ b/contrib/gdb/gdb/i386fbsd-nat.c
@@ -0,0 +1,102 @@
+/* Native-dependent code for FreeBSD/i386.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <sys/sysctl.h>
+
+/* Prevent warning from -Wmissing-prototypes. */
+void _initialize_i386fbsd_nat (void);
+
+/* Resume execution of the inferior process.
+ If STEP is nonzero, single-step it.
+ If SIGNAL is nonzero, give it that signal. */
+
+void
+child_resume (ptid_t ptid, int step, enum target_signal signal)
+{
+ pid_t pid = ptid_get_pid (ptid);
+ int request = PT_STEP;
+
+ if (pid == -1)
+ /* Resume all threads. This only gets used in the non-threaded
+ case, where "resume all threads" and "resume inferior_ptid" are
+ the same. */
+ pid = ptid_get_pid (inferior_ptid);
+
+ if (!step)
+ {
+ unsigned int eflags;
+
+ /* Workaround for a bug in FreeBSD. Make sure that the trace
+ flag is off when doing a continue. There is a code path
+ through the kernel which leaves the flag set when it should
+ have been cleared. If a process has a signal pending (such
+ as SIGALRM) and we do a PT_STEP, the process never really has
+ a chance to run because the kernel needs to notify the
+ debugger that a signal is being sent. Therefore, the process
+ never goes through the kernel's trap() function which would
+ normally clear it. */
+
+ eflags = read_register (PS_REGNUM);
+ if (eflags & 0x0100)
+ write_register (PS_REGNUM, eflags & ~0x0100);
+
+ request = PT_CONTINUE;
+ }
+
+ /* An addres of (caddr_t) 1 tells ptrace to continue from where it
+ was. (If GDB wanted it to start some other way, we have already
+ written a new PC value to the child.) */
+ if (ptrace (request, pid, (caddr_t) 1,
+ target_signal_to_host (signal)) == -1)
+ perror_with_name ("ptrace");
+}
+
+void
+_initialize_i386fbsd_nat (void)
+{
+ /* FreeBSD provides a kern.ps_strings sysctl that we can use to
+ locate the sigtramp. That way we can still recognize a sigtramp
+ if it's location is changed in a new kernel. Of course this is
+ still based on the assumption that the sigtramp is placed
+ directly under the location where the program arguments and
+ environment can be found. */
+#ifdef KERN_PS_STRINGS
+ {
+ int mib[2];
+ int ps_strings;
+ size_t len;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PS_STRINGS;
+ len = sizeof (ps_strings);
+ if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
+ {
+ i386bsd_sigtramp_start = ps_strings - 128;
+ i386bsd_sigtramp_end = ps_strings;
+ }
+ }
+#endif
+}
diff --git a/contrib/gdb/gdb/i386nbsd-nat.c b/contrib/gdb/gdb/i386nbsd-nat.c
new file mode 100644
index 0000000..32a3d78
--- /dev/null
+++ b/contrib/gdb/gdb/i386nbsd-nat.c
@@ -0,0 +1,132 @@
+/* Native-dependent code for NetBSD/i386, for GDB.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+#include <machine/frame.h>
+#include "inferior.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
+#ifndef HAVE_FPREGSET_T
+typedef struct fpreg fpregset_t;
+#endif
+
+#include "gregset.h"
+
+/* Prototypes for i387_supply_fsave etc. */
+#include "i387-nat.h"
+
+struct md_core
+{
+ struct reg intreg;
+ char freg[108];
+};
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ struct md_core *core_reg = (struct md_core *) core_reg_sect;
+
+ /* We get everything from one section. */
+ if (which != 0)
+ return;
+
+ /* Integer registers. */
+ supply_gregset (&core_reg->intreg);
+
+ /* Floating point registers. */
+ i387_supply_fsave (core_reg->freg);
+}
+
+static void
+fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ gregset_t gregset;
+
+ switch (which)
+ {
+ case 0: /* Integer registers. */
+ if (core_reg_size != sizeof (struct reg))
+ warning ("Wrong size register set in core file.");
+ else
+ {
+ memcpy (&gregset, core_reg_sect, sizeof (gregset));
+ supply_gregset (&gregset);
+ }
+ break;
+
+ case 2: /* Floating point registers. */
+ if (core_reg_size != 108)
+ warning ("Wrong size FP register set in core file.");
+ else
+ i387_supply_fsave (core_reg_sect);
+ break;
+
+ case 3: /* "Extended" floating point registers. This is gdb-speak
+ for SSE/SSE2. */
+ if (core_reg_size != 512)
+ warning ("Wrong size XMM register set in core file.");
+ else
+ i387_supply_fxsave (core_reg_sect);
+ break;
+
+ default:
+ /* Don't know what kind of register request this is; just ignore it. */
+ break;
+ }
+}
+
+/* Register that we are able to handle i386nbsd core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns i386nbsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+static struct core_fns i386nbsd_elfcore_fns =
+{
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_elfcore_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_i386nbsd_nat (void)
+{
+ add_core_fns (&i386nbsd_core_fns);
+ add_core_fns (&i386nbsd_elfcore_fns);
+}
diff --git a/contrib/gdb/gdb/i386nbsd-tdep.c b/contrib/gdb/gdb/i386nbsd-tdep.c
new file mode 100644
index 0000000..7174d4d
--- /dev/null
+++ b/contrib/gdb/gdb/i386nbsd-tdep.c
@@ -0,0 +1,32 @@
+/* Target-dependent code for NetBSD/i386, for GDB.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbtypes.h"
+
+int
+i386nbsd_use_struct_convention (int gcc_p, struct type *type)
+{
+ return !(TYPE_LENGTH (type) == 1
+ || TYPE_LENGTH (type) == 2
+ || TYPE_LENGTH (type) == 4
+ || TYPE_LENGTH (type) == 8);
+}
diff --git a/contrib/gdb/gdb/i387-nat.c b/contrib/gdb/gdb/i387-nat.c
new file mode 100644
index 0000000..62c26f8
--- /dev/null
+++ b/contrib/gdb/gdb/i387-nat.c
@@ -0,0 +1,346 @@
+/* Native-dependent code for the i387.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "value.h"
+#include "regcache.h"
+
+#include "i387-nat.h"
+#include "i386-tdep.h"
+
+/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets
+ define their own routines to manage the floating-point registers in
+ GDB's register array. Most (if not all) of these targets use the
+ format used by the "fsave" instruction in their communication with
+ the OS. They should all be converted to use the routines below. */
+
+/* At fsave_offset[REGNUM] you'll find the offset to the location in
+ the data structure used by the "fsave" instruction where GDB
+ register REGNUM is stored. */
+
+static int fsave_offset[] =
+{
+ 28 + 0 * FPU_REG_RAW_SIZE, /* FP0_REGNUM through ... */
+ 28 + 1 * FPU_REG_RAW_SIZE,
+ 28 + 2 * FPU_REG_RAW_SIZE,
+ 28 + 3 * FPU_REG_RAW_SIZE,
+ 28 + 4 * FPU_REG_RAW_SIZE,
+ 28 + 5 * FPU_REG_RAW_SIZE,
+ 28 + 6 * FPU_REG_RAW_SIZE,
+ 28 + 7 * FPU_REG_RAW_SIZE, /* ... FP7_REGNUM. */
+ 0, /* FCTRL_REGNUM (16 bits). */
+ 4, /* FSTAT_REGNUM (16 bits). */
+ 8, /* FTAG_REGNUM (16 bits). */
+ 16, /* FISEG_REGNUM (16 bits). */
+ 12, /* FIOFF_REGNUM. */
+ 24, /* FOSEG_REGNUM. */
+ 20, /* FOOFF_REGNUM. */
+ 18 /* FOP_REGNUM (bottom 11 bits). */
+};
+
+#define FSAVE_ADDR(fsave, regnum) (fsave + fsave_offset[regnum - FP0_REGNUM])
+
+
+/* Fill register REGNUM in GDB's register array with the appropriate
+ value from *FSAVE. This function masks off any of the reserved
+ bits in *FSAVE. */
+
+void
+i387_supply_register (int regnum, char *fsave)
+{
+ /* Most of the FPU control registers occupy only 16 bits in
+ the fsave area. Give those a special treatment. */
+ if (regnum >= FPC_REGNUM
+ && regnum != FIOFF_REGNUM && regnum != FOOFF_REGNUM)
+ {
+ unsigned int val = *(unsigned short *) (FSAVE_ADDR (fsave, regnum));
+
+ if (regnum == FOP_REGNUM)
+ {
+ val &= ((1 << 11) - 1);
+ supply_register (regnum, (char *) &val);
+ }
+ else
+ supply_register (regnum, (char *) &val);
+ }
+ else
+ supply_register (regnum, FSAVE_ADDR (fsave, regnum));
+}
+
+/* Fill GDB's register array with the floating-point register values
+ in *FSAVE. This function masks off any of the reserved
+ bits in *FSAVE. */
+
+void
+i387_supply_fsave (char *fsave)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < XMM0_REGNUM; i++)
+ i387_supply_register (i, fsave);
+}
+
+/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
+ with the value in GDB's register array. If REGNUM is -1, do this
+ for all registers. This function doesn't touch any of the reserved
+ bits in *FSAVE. */
+
+void
+i387_fill_fsave (char *fsave, int regnum)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < XMM0_REGNUM; i++)
+ if (regnum == -1 || regnum == i)
+ {
+ /* Most of the FPU control registers occupy only 16 bits in
+ the fsave area. Give those a special treatment. */
+ if (i >= FPC_REGNUM
+ && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
+ {
+ if (i == FOP_REGNUM)
+ {
+ unsigned short oldval, newval;
+
+ /* The opcode occupies only 11 bits. */
+ oldval = (*(unsigned short *) (FSAVE_ADDR (fsave, i)));
+ newval = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+ newval &= ((1 << 11) - 1);
+ newval |= oldval & ~((1 << 11) - 1);
+ memcpy (FSAVE_ADDR (fsave, i), &newval, 2);
+ }
+ else
+ memcpy (FSAVE_ADDR (fsave, i), &registers[REGISTER_BYTE (i)], 2);
+ }
+ else
+ memcpy (FSAVE_ADDR (fsave, i), &registers[REGISTER_BYTE (i)],
+ REGISTER_RAW_SIZE (i));
+ }
+}
+
+
+/* At fxsave_offset[REGNUM] you'll find the offset to the location in
+ the data structure used by the "fxsave" instruction where GDB
+ register REGNUM is stored. */
+
+static int fxsave_offset[] =
+{
+ 32, /* FP0_REGNUM through ... */
+ 48,
+ 64,
+ 80,
+ 96,
+ 112,
+ 128,
+ 144, /* ... FP7_REGNUM (80 bits each). */
+ 0, /* FCTRL_REGNUM (16 bits). */
+ 2, /* FSTAT_REGNUM (16 bits). */
+ 4, /* FTAG_REGNUM (16 bits). */
+ 12, /* FISEG_REGNUM (16 bits). */
+ 8, /* FIOFF_REGNUM. */
+ 20, /* FOSEG_REGNUM (16 bits). */
+ 16, /* FOOFF_REGNUM. */
+ 6, /* FOP_REGNUM (bottom 11 bits). */
+ 160, /* XMM0_REGNUM through ... */
+ 176,
+ 192,
+ 208,
+ 224,
+ 240,
+ 256,
+ 272, /* ... XMM7_REGNUM (128 bits each). */
+ 24, /* MXCSR_REGNUM. */
+};
+
+#define FXSAVE_ADDR(fxsave, regnum) \
+ (fxsave + fxsave_offset[regnum - FP0_REGNUM])
+
+static int i387_tag (unsigned char *raw);
+
+
+/* Fill GDB's register array with the floating-point and SSE register
+ values in *FXSAVE. This function masks off any of the reserved
+ bits in *FXSAVE. */
+
+void
+i387_supply_fxsave (char *fxsave)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
+ {
+ /* Most of the FPU control registers occupy only 16 bits in
+ the fxsave area. Give those a special treatment. */
+ if (i >= FPC_REGNUM && i < XMM0_REGNUM
+ && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
+ {
+ unsigned long val = *(unsigned short *) (FXSAVE_ADDR (fxsave, i));
+
+ if (i == FOP_REGNUM)
+ {
+ val &= ((1 << 11) - 1);
+ supply_register (i, (char *) &val);
+ }
+ else if (i== FTAG_REGNUM)
+ {
+ /* The fxsave area contains a simplified version of the
+ tag word. We have to look at the actual 80-bit FP
+ data to recreate the traditional i387 tag word. */
+
+ unsigned long ftag = 0;
+ unsigned long fstat;
+ int fpreg;
+ int top;
+
+ fstat = *(unsigned short *) (FXSAVE_ADDR (fxsave, FSTAT_REGNUM));
+ top = ((fstat >> 11) & 0x7);
+
+ for (fpreg = 7; fpreg >= 0; fpreg--)
+ {
+ int tag;
+
+ if (val & (1 << fpreg))
+ {
+ int regnum = (fpreg + 8 - top) % 8 + FP0_REGNUM;
+ tag = i387_tag (FXSAVE_ADDR (fxsave, regnum));
+ }
+ else
+ tag = 3; /* Empty */
+
+ ftag |= tag << (2 * fpreg);
+ }
+ supply_register (i, (char *) &ftag);
+ }
+ else
+ supply_register (i, (char *) &val);
+ }
+ else
+ supply_register (i, FXSAVE_ADDR (fxsave, i));
+ }
+}
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ this for all registers. This function doesn't touch any of the
+ reserved bits in *FXSAVE. */
+
+void
+i387_fill_fxsave (char *fxsave, int regnum)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
+ if (regnum == -1 || regnum == i)
+ {
+ /* Most of the FPU control registers occupy only 16 bits in
+ the fxsave area. Give those a special treatment. */
+ if (i >= FPC_REGNUM && i < XMM0_REGNUM
+ && i != FIOFF_REGNUM && i != FDOFF_REGNUM)
+ {
+ if (i == FOP_REGNUM)
+ {
+ unsigned short oldval, newval;
+
+ /* The opcode occupies only 11 bits. */
+ oldval = (*(unsigned short *) (FXSAVE_ADDR (fxsave, i)));
+ newval = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+ newval &= ((1 << 11) - 1);
+ newval |= oldval & ~((1 << 11) - 1);
+ memcpy (FXSAVE_ADDR (fxsave, i), &newval, 2);
+ }
+ else if (i == FTAG_REGNUM)
+ {
+ /* Converting back is much easier. */
+
+ unsigned short val = 0;
+ unsigned short ftag;
+ int fpreg;
+
+ ftag = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+
+ for (fpreg = 7; fpreg >= 0; fpreg--)
+ {
+ int tag = (ftag >> (fpreg * 2)) & 3;
+
+ if (tag != 3)
+ val |= (1 << fpreg);
+ }
+
+ memcpy (FXSAVE_ADDR (fxsave, i), &val, 2);
+ }
+ else
+ memcpy (FXSAVE_ADDR (fxsave, i),
+ &registers[REGISTER_BYTE (i)], 2);
+ }
+ else
+ memcpy (FXSAVE_ADDR (fxsave, i), &registers[REGISTER_BYTE (i)],
+ REGISTER_RAW_SIZE (i));
+ }
+}
+
+/* Recreate the FTW (tag word) valid bits from the 80-bit FP data in
+ *RAW. */
+
+static int
+i387_tag (unsigned char *raw)
+{
+ int integer;
+ unsigned int exponent;
+ unsigned long fraction[2];
+
+ integer = raw[7] & 0x80;
+ exponent = (((raw[9] & 0x7f) << 8) | raw[8]);
+ fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]);
+ fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16)
+ | (raw[5] << 8) | raw[4]);
+
+ if (exponent == 0x7fff)
+ {
+ /* Special. */
+ return (2);
+ }
+ else if (exponent == 0x0000)
+ {
+ if (fraction[0] == 0x0000 && fraction[1] == 0x0000 && !integer)
+ {
+ /* Zero. */
+ return (1);
+ }
+ else
+ {
+ /* Special. */
+ return (2);
+ }
+ }
+ else
+ {
+ if (integer)
+ {
+ /* Valid. */
+ return (0);
+ }
+ else
+ {
+ /* Special. */
+ return (2);
+ }
+ }
+}
diff --git a/contrib/gdb/gdb/i387-nat.h b/contrib/gdb/gdb/i387-nat.h
new file mode 100644
index 0000000..1637e9b
--- /dev/null
+++ b/contrib/gdb/gdb/i387-nat.h
@@ -0,0 +1,56 @@
+/* Native-dependent code for the i387.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef I387_NAT_H
+#define I387_NAT_H
+
+/* Fill register REGNUM in GDB's register array with the appropriate
+ value from *FSAVE. This function masks off any of the reserved
+ bits in *FSAVE. */
+
+extern void i387_supply_register (int regnum, char *fsave);
+
+/* Fill GDB's register array with the floating-point register values
+ in *FSAVE. This function masks off any of the reserved
+ bits in *FSAVE. */
+
+extern void i387_supply_fsave (char *fsave);
+
+/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
+ with the value in GDB's register array. If REGNUM is -1, do this
+ for all registers. This function doesn't touch any of the reserved
+ bits in *FSAVE. */
+
+extern void i387_fill_fsave (char *fsave, int regnum);
+
+/* Fill GDB's register array with the floating-point and SSE register
+ values in *FXSAVE. This function masks off any of the reserved
+ bits in *FXSAVE. */
+
+extern void i387_supply_fxsave (char *fxsave);
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ this for all registers. This function doesn't touch any of the
+ reserved bits in *FXSAVE. */
+
+extern void i387_fill_fxsave (char *fxsave, int regnum);
+
+#endif /* i387-nat.h */
diff --git a/contrib/gdb/gdb/i387-tdep.c b/contrib/gdb/gdb/i387-tdep.c
index 869ab9a..2a6f77c 100644
--- a/contrib/gdb/gdb/i387-tdep.c
+++ b/contrib/gdb/gdb/i387-tdep.c
@@ -1,111 +1,390 @@
/* Intel 387 floating point stuff.
- Copyright (C) 1988, 1989, 1991, 1998 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "language.h"
+#include "value.h"
#include "gdbcore.h"
#include "floatformat.h"
+#include "regcache.h"
+#include "gdb_assert.h"
+#include "doublest.h"
-void i387_to_double PARAMS ((char *, char *));
+#include "i386-tdep.h"
-void double_to_i387 PARAMS ((char *, char *));
+/* FIXME: Eliminate the next two functions when we have the time to
+ change all the callers. */
-/* FIXME: Eliminate these routines when we have the time to change all
- the callers. */
+void i387_to_double (char *from, char *to);
+void double_to_i387 (char *from, char *to);
void
-i387_to_double (from, to)
- char *from;
- char *to;
+i387_to_double (char *from, char *to)
{
- floatformat_to_double (&floatformat_i387_ext, from, (double *)to);
+ floatformat_to_double (&floatformat_i387_ext, from, (double *) to);
}
void
-double_to_i387 (from, to)
- char *from;
- char *to;
+double_to_i387 (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;
+
+/* FIXME: The functions on this page are used by the old `info float'
+ implementations that a few of the i386 targets provide. These
+ functions should be removed if all of these have been converted to
+ use the generic implementation based on the new register file
+ layout. */
+
+static void print_387_control_bits (unsigned int control);
+static void print_387_status_bits (unsigned int status);
+
+static void
+print_387_control_bits (unsigned int 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:
+ puts_unfiltered (" 24 bit; ");
+ break;
+ case 1:
+ puts_unfiltered (" (bad); ");
+ break;
+ case 2:
+ puts_unfiltered (" 53 bit; ");
+ break;
+ case 3:
+ puts_unfiltered (" 64 bit; ");
+ 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:
+ puts_unfiltered ("NEAR; ");
+ break;
+ case 1:
+ puts_unfiltered ("DOWN; ");
+ break;
+ case 2:
+ puts_unfiltered ("UP; ");
+ break;
+ case 3:
+ puts_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");
- printf_unfiltered (";");
+ puts_unfiltered ("mask");
+ if (control & 0x0001)
+ puts_unfiltered (" INVAL");
+ if (control & 0x0002)
+ puts_unfiltered (" DENOR");
+ if (control & 0x0004)
+ puts_unfiltered (" DIVZ");
+ if (control & 0x0008)
+ puts_unfiltered (" OVERF");
+ if (control & 0x0010)
+ puts_unfiltered (" UNDER");
+ if (control & 0x0020)
+ puts_unfiltered (" LOS");
+ puts_unfiltered (";");
}
- printf_unfiltered ("\n");
- if (control & 0xe080) warning ("reserved bits on: %s\n",
- local_hex_string(control & 0xe080));
+
+ if (control & 0xe080)
+ warning ("\nreserved bits on: %s",
+ local_hex_string (control & 0xe080));
}
void
-print_387_status_word (status)
- unsigned int status;
+print_387_control_word (unsigned int control)
+{
+ printf_filtered ("control %s:", local_hex_string(control & 0xffff));
+ print_387_control_bits (control);
+ puts_unfiltered ("\n");
+}
+
+static void
+print_387_status_bits (unsigned int status)
{
- printf_unfiltered ("status %s: ", local_hex_string (status));
+ printf_unfiltered (" flags %d%d%d%d; ",
+ (status & 0x4000) != 0,
+ (status & 0x0400) != 0,
+ (status & 0x0200) != 0,
+ (status & 0x0100) != 0);
+ printf_unfiltered ("top %d; ", (status >> 11) & 7);
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");
- printf_unfiltered ("; ");
+ puts_unfiltered ("excep");
+ if (status & 0x0001) puts_unfiltered (" INVAL");
+ if (status & 0x0002) puts_unfiltered (" DENOR");
+ if (status & 0x0004) puts_unfiltered (" DIVZ");
+ if (status & 0x0008) puts_unfiltered (" OVERF");
+ if (status & 0x0010) puts_unfiltered (" UNDER");
+ if (status & 0x0020) puts_unfiltered (" LOS");
+ if (status & 0x0040) puts_unfiltered (" STACK");
+ }
+}
+
+void
+print_387_status_word (unsigned int status)
+{
+ printf_filtered ("status %s:", local_hex_string (status & 0xffff));
+ print_387_status_bits (status);
+ puts_unfiltered ("\n");
+}
+
+
+/* Implement the `info float' layout based on the register definitions
+ in `tm-i386.h'. */
+
+/* Print the floating point number specified by RAW. */
+static void
+print_i387_value (char *raw)
+{
+ DOUBLEST value;
+
+ /* Using extract_typed_floating here might affect the representation
+ of certain numbers such as NaNs, even if GDB is running natively.
+ This is fine since our caller already detects such special
+ numbers and we print the hexadecimal representation anyway. */
+ value = extract_typed_floating (raw, builtin_type_i387_ext);
+
+ /* We try to print 19 digits. The last digit may or may not contain
+ garbage, but we'd better print one too many. We need enough room
+ to print the value, 1 position for the sign, 1 for the decimal
+ point, 19 for the digits and 6 for the exponent adds up to 27. */
+#ifdef PRINTF_HAS_LONG_DOUBLE
+ printf_filtered (" %-+27.19Lg", (long double) value);
+#else
+ printf_filtered (" %-+27.19g", (double) value);
+#endif
+}
+
+/* Print the classification for the register contents RAW. */
+static void
+print_i387_ext (unsigned char *raw)
+{
+ int sign;
+ int integer;
+ unsigned int exponent;
+ unsigned long fraction[2];
+
+ sign = raw[9] & 0x80;
+ integer = raw[7] & 0x80;
+ exponent = (((raw[9] & 0x7f) << 8) | raw[8]);
+ fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]);
+ fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16)
+ | (raw[5] << 8) | raw[4]);
+
+ if (exponent == 0x7fff && integer)
+ {
+ if (fraction[0] == 0x00000000 && fraction[1] == 0x00000000)
+ /* Infinity. */
+ printf_filtered (" %cInf", (sign ? '-' : '+'));
+ else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000)
+ /* Real Indefinite (QNaN). */
+ puts_unfiltered (" Real Indefinite (QNaN)");
+ else if (fraction[1] & 0x40000000)
+ /* QNaN. */
+ puts_filtered (" QNaN");
+ else
+ /* SNaN. */
+ puts_filtered (" SNaN");
}
- printf_unfiltered ("flags: %d%d%d%d; ",
- (status & 0x4000) != 0,
- (status & 0x0400) != 0,
- (status & 0x0200) != 0,
- (status & 0x0100) != 0);
+ else if (exponent < 0x7fff && exponent > 0x0000 && integer)
+ /* Normal. */
+ print_i387_value (raw);
+ else if (exponent == 0x0000)
+ {
+ /* Denormal or zero. */
+ print_i387_value (raw);
+
+ if (integer)
+ /* Pseudo-denormal. */
+ puts_filtered (" Pseudo-denormal");
+ else if (fraction[0] || fraction[1])
+ /* Denormal. */
+ puts_filtered (" Denormal");
+ }
+ else
+ /* Unsupported. */
+ puts_filtered (" Unsupported");
+}
+
+/* Print the status word STATUS. */
+static void
+print_i387_status_word (unsigned int status)
+{
+ printf_filtered ("Status Word: %s",
+ local_hex_string_custom (status, "04"));
+ puts_filtered (" ");
+ printf_filtered (" %s", (status & 0x0001) ? "IE" : " ");
+ printf_filtered (" %s", (status & 0x0002) ? "DE" : " ");
+ printf_filtered (" %s", (status & 0x0004) ? "ZE" : " ");
+ printf_filtered (" %s", (status & 0x0008) ? "OE" : " ");
+ printf_filtered (" %s", (status & 0x0010) ? "UE" : " ");
+ printf_filtered (" %s", (status & 0x0020) ? "PE" : " ");
+ puts_filtered (" ");
+ printf_filtered (" %s", (status & 0x0080) ? "ES" : " ");
+ puts_filtered (" ");
+ printf_filtered (" %s", (status & 0x0040) ? "SF" : " ");
+ puts_filtered (" ");
+ printf_filtered (" %s", (status & 0x0100) ? "C0" : " ");
+ printf_filtered (" %s", (status & 0x0200) ? "C1" : " ");
+ printf_filtered (" %s", (status & 0x0400) ? "C2" : " ");
+ printf_filtered (" %s", (status & 0x4000) ? "C3" : " ");
+
+ puts_filtered ("\n");
+
+ printf_filtered (" TOP: %d\n", ((status >> 11) & 7));
+}
+
+/* Print the control word CONTROL. */
+static void
+print_i387_control_word (unsigned int control)
+{
+ printf_filtered ("Control Word: %s",
+ local_hex_string_custom (control, "04"));
+ puts_filtered (" ");
+ printf_filtered (" %s", (control & 0x0001) ? "IM" : " ");
+ printf_filtered (" %s", (control & 0x0002) ? "DM" : " ");
+ printf_filtered (" %s", (control & 0x0004) ? "ZM" : " ");
+ printf_filtered (" %s", (control & 0x0008) ? "OM" : " ");
+ printf_filtered (" %s", (control & 0x0010) ? "UM" : " ");
+ printf_filtered (" %s", (control & 0x0020) ? "PM" : " ");
+
+ puts_filtered ("\n");
+
+ puts_filtered (" PC: ");
+ switch ((control >> 8) & 3)
+ {
+ case 0:
+ puts_filtered ("Single Precision (24-bits)\n");
+ break;
+ case 1:
+ puts_filtered ("Reserved\n");
+ break;
+ case 2:
+ puts_filtered ("Double Precision (53-bits)\n");
+ break;
+ case 3:
+ puts_filtered ("Extended Precision (64-bits)\n");
+ break;
+ }
+
+ puts_filtered (" RC: ");
+ switch ((control >> 10) & 3)
+ {
+ case 0:
+ puts_filtered ("Round to nearest\n");
+ break;
+ case 1:
+ puts_filtered ("Round down\n");
+ break;
+ case 2:
+ puts_filtered ("Round up\n");
+ break;
+ case 3:
+ puts_filtered ("Round toward zero\n");
+ break;
+ }
+}
+
+/* Print out the i387 floating poin state. */
+void
+i387_float_info (void)
+{
+ unsigned int fctrl;
+ unsigned int fstat;
+ unsigned int ftag;
+ unsigned int fiseg;
+ unsigned int fioff;
+ unsigned int foseg;
+ unsigned int fooff;
+ unsigned int fop;
+ int fpreg;
+ int top;
+
+ fctrl = read_register (FCTRL_REGNUM);
+ fstat = read_register (FSTAT_REGNUM);
+ ftag = read_register (FTAG_REGNUM);
+ fiseg = read_register (FCS_REGNUM);
+ fioff = read_register (FCOFF_REGNUM);
+ foseg = read_register (FDS_REGNUM);
+ fooff = read_register (FDOFF_REGNUM);
+ fop = read_register (FOP_REGNUM);
+
+ top = ((fstat >> 11) & 7);
+
+ for (fpreg = 7; fpreg >= 0; fpreg--)
+ {
+ unsigned char raw[FPU_REG_RAW_SIZE];
+ int tag = (ftag >> (fpreg * 2)) & 3;
+ int i;
+
+ printf_filtered ("%sR%d: ", fpreg == top ? "=>" : " ", fpreg);
+
+ switch (tag)
+ {
+ case 0:
+ puts_filtered ("Valid ");
+ break;
+ case 1:
+ puts_filtered ("Zero ");
+ break;
+ case 2:
+ puts_filtered ("Special ");
+ break;
+ case 3:
+ puts_filtered ("Empty ");
+ break;
+ }
+
+ read_register_gen ((fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
+
+ puts_filtered ("0x");
+ for (i = 9; i >= 0; i--)
+ printf_filtered ("%02x", raw[i]);
+
+ if (tag != 3)
+ print_i387_ext (raw);
+
+ puts_filtered ("\n");
+ }
+
+ puts_filtered ("\n");
- printf_unfiltered ("top %d\n", (status >> 11) & 7);
+ print_i387_status_word (fstat);
+ print_i387_control_word (fctrl);
+ printf_filtered ("Tag Word: %s\n",
+ local_hex_string_custom (ftag, "04"));
+ printf_filtered ("Instruction Pointer: %s:",
+ local_hex_string_custom (fiseg, "02"));
+ printf_filtered ("%s\n", local_hex_string_custom (fioff, "08"));
+ printf_filtered ("Operand Pointer: %s:",
+ local_hex_string_custom (foseg, "02"));
+ printf_filtered ("%s\n", local_hex_string_custom (fooff, "08"));
+ printf_filtered ("Opcode: %s\n",
+ local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04"));
}
diff --git a/contrib/gdb/gdb/ia64-aix-nat.c b/contrib/gdb/gdb/ia64-aix-nat.c
new file mode 100644
index 0000000..c41cc7c
--- /dev/null
+++ b/contrib/gdb/gdb/ia64-aix-nat.c
@@ -0,0 +1,161 @@
+/* Functions specific to running gdb native on IA-64 running AIX.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "target.h"
+#include "gdbcore.h"
+#include "regcache.h"
+#include <sys/procfs.h>
+
+#include "symtab.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
+
+#include <sys/types.h>
+#include <fcntl.h>
+#include "gdb_stat.h"
+
+void
+supply_gregset (prgregset_t *gregsetp)
+{
+ int regi;
+
+ for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
+ {
+ supply_register (regi,
+ (char *) &(gregsetp->__gpr[regi - IA64_GR0_REGNUM]));
+ }
+
+ for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
+ {
+ supply_register (regi,
+ (char *) &(gregsetp->__br[regi - IA64_BR0_REGNUM]));
+ }
+
+ supply_register (IA64_PSR_REGNUM, (char *) &(gregsetp->__psr));
+ supply_register (IA64_IP_REGNUM, (char *) &(gregsetp->__ip));
+ supply_register (IA64_CFM_REGNUM, (char *) &(gregsetp->__ifs));
+ supply_register (IA64_RSC_REGNUM, (char *) &(gregsetp->__rsc));
+ supply_register (IA64_BSP_REGNUM, (char *) &(gregsetp->__bsp));
+ supply_register (IA64_BSPSTORE_REGNUM, (char *) &(gregsetp->__bspstore));
+ supply_register (IA64_RNAT_REGNUM, (char *) &(gregsetp->__rnat));
+ supply_register (IA64_PFS_REGNUM, (char *) &(gregsetp->__pfs));
+ supply_register (IA64_UNAT_REGNUM, (char *) &(gregsetp->__unat));
+ supply_register (IA64_PR_REGNUM, (char *) &(gregsetp->__preds));
+ supply_register (IA64_CCV_REGNUM, (char *) &(gregsetp->__ccv));
+ supply_register (IA64_LC_REGNUM, (char *) &(gregsetp->__lc));
+ supply_register (IA64_EC_REGNUM, (char *) &(gregsetp->__ec));
+ /* FIXME: __nats */
+ supply_register (IA64_FPSR_REGNUM, (char *) &(gregsetp->__fpsr));
+
+ /* These (for the most part) are pseudo registers and are obtained
+ by other means. Those that aren't are already handled by the
+ code above. */
+ for (regi = IA64_GR32_REGNUM; regi <= IA64_GR127_REGNUM; regi++)
+ register_valid[regi] = 1;
+ for (regi = IA64_PR0_REGNUM; regi <= IA64_PR63_REGNUM; regi++)
+ register_valid[regi] = 1;
+ for (regi = IA64_VFP_REGNUM; regi <= NUM_REGS; regi++)
+ register_valid[regi] = 1;
+}
+
+void
+fill_gregset (prgregset_t *gregsetp, int regno)
+{
+ int regi;
+
+#define COPY_REG(_fld_,_regi_) \
+ if ((regno == -1) || regno == _regi_) \
+ memcpy (&(gregsetp->_fld_), &registers[REGISTER_BYTE (_regi_)], \
+ REGISTER_RAW_SIZE (_regi_))
+
+ for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
+ {
+ COPY_REG (__gpr[regi - IA64_GR0_REGNUM], regi);
+ }
+
+ for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
+ {
+ COPY_REG (__br[regi - IA64_BR0_REGNUM], regi);
+ }
+ COPY_REG (__psr, IA64_PSR_REGNUM);
+ COPY_REG (__ip, IA64_IP_REGNUM);
+ COPY_REG (__ifs, IA64_CFM_REGNUM);
+ COPY_REG (__rsc, IA64_RSC_REGNUM);
+ COPY_REG (__bsp, IA64_BSP_REGNUM);
+
+ /* Bad things happen if we don't update both bsp and bspstore at the
+ same time. */
+ if (regno == IA64_BSP_REGNUM || regno == -1)
+ {
+ memcpy (&(gregsetp->__bspstore),
+ &registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
+ memcpy (&registers[REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
+ &registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
+ }
+
+#if 0
+ /* We never actually write to bspstore, or we'd have to do the same thing
+ here too. */
+ COPY_REG (__bspstore, IA64_BSPSTORE_REGNUM);
+#endif
+ COPY_REG (__rnat, IA64_RNAT_REGNUM);
+ COPY_REG (__pfs, IA64_PFS_REGNUM);
+ COPY_REG (__unat, IA64_UNAT_REGNUM);
+ COPY_REG (__preds, IA64_PR_REGNUM);
+ COPY_REG (__ccv, IA64_CCV_REGNUM);
+ COPY_REG (__lc, IA64_LC_REGNUM);
+ COPY_REG (__ec, IA64_EC_REGNUM);
+ /* FIXME: __nats */
+ COPY_REG (__fpsr, IA64_FPSR_REGNUM);
+#undef COPY_REG
+}
+
+void
+supply_fpregset (prfpregset_t *fpregsetp)
+{
+ register int regi;
+
+ for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
+ supply_register (regi,
+ (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]));
+}
+
+void
+fill_fpregset (prfpregset_t *fpregsetp, int regno)
+{
+ int regi;
+ char *to;
+ char *from;
+
+ for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
+ {
+ if ((regno == -1) || (regno == regi))
+ {
+ from = (char *) &registers[REGISTER_BYTE (regi)];
+ to = (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]);
+ memcpy (to, from, REGISTER_RAW_SIZE (regi));
+ }
+ }
+}
diff --git a/contrib/gdb/gdb/ia64-aix-tdep.c b/contrib/gdb/gdb/ia64-aix-tdep.c
new file mode 100644
index 0000000..26eca6b
--- /dev/null
+++ b/contrib/gdb/gdb/ia64-aix-tdep.c
@@ -0,0 +1,107 @@
+/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
+ Copyright 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+/* External hook for finding gate addresses on AIX. */
+void (*aix5_find_gate_addresses_hook) (CORE_ADDR *, CORE_ADDR *) = 0;
+
+/* Offset to sc_context member of sigcontext structure from frame of handler */
+#define IA64_AIX_SIGCONTEXT_OFFSET 64
+
+/* Return a non-zero value iff PC is in a signal trampoline. On
+ AIX, we determine this by seeing if the pc is in a special
+ execute only page called the ``gate page''. The addresses in
+ question are determined by letting the AIX native portion of
+ the code determine these addresses via its own nefarious
+ means. */
+
+int
+ia64_aix_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ CORE_ADDR gate_area_start, gate_area_end;
+
+ if (aix5_find_gate_addresses_hook == 0)
+ return 0;
+
+ (*aix5_find_gate_addresses_hook) (&gate_area_start, &gate_area_end);
+
+ return (pc >= gate_area_start && pc < gate_area_end);
+}
+
+
+/* IA-64 AIX specific function which, given a frame address and
+ a register number, returns the address at which that register may be
+ found. 0 is returned for registers which aren't stored in the
+ sigcontext structure. */
+
+CORE_ADDR
+ia64_aix_sigcontext_register_address (CORE_ADDR sp, int regno)
+{
+ /* The hardcoded offsets that follow are actually offsets to the
+ corresponding members in struct __context in
+ /usr/include/sys/context.h (on an IA-64 AIX5 box). */
+ if (IA64_GR0_REGNUM <= regno && regno <= IA64_GR31_REGNUM)
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 152 + 8 * (regno - IA64_GR0_REGNUM);
+ else if (IA64_BR0_REGNUM <= regno && regno <= IA64_BR7_REGNUM)
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 408 + 8 * (regno - IA64_BR0_REGNUM);
+ else if (IA64_FR0_REGNUM <= regno && regno <= IA64_FR127_REGNUM)
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 480 + 16 * (regno - IA64_FR0_REGNUM);
+ else
+ switch (regno)
+ {
+ case IA64_PSR_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 0;
+ case IA64_IP_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 8;
+ /* iipa is at 16.
+ isr is at 24.
+ ifa is at 32.
+ iim is at 40. */
+ case IA64_CFM_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 48; /* ifs, actually */
+ case IA64_RSC_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 56;
+ case IA64_BSP_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 64;
+ case IA64_BSPSTORE_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 72;
+ case IA64_RNAT_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 80;
+ case IA64_PFS_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 88;
+ case IA64_UNAT_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 96;
+ case IA64_PR_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 104;
+ case IA64_CCV_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 112;
+ case IA64_LC_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 120;
+ case IA64_EC_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 128;
+ /* nats is at 136; this is an address independent NaT bitmask */
+ case IA64_FPSR_REGNUM :
+ return sp + IA64_AIX_SIGCONTEXT_OFFSET + 144;
+ default :
+ return 0;
+ }
+}
diff --git a/contrib/gdb/gdb/ia64-linux-nat.c b/contrib/gdb/gdb/ia64-linux-nat.c
new file mode 100644
index 0000000..82695ef
--- /dev/null
+++ b/contrib/gdb/gdb/ia64-linux-nat.c
@@ -0,0 +1,644 @@
+/* Functions specific to running gdb native on IA-64 running
+ GNU/Linux.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "target.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include <signal.h>
+#include <sys/ptrace.h>
+#include <sys/wait.h>
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+#include <sys/user.h>
+
+#include <asm/ptrace_offsets.h>
+#include <sys/procfs.h>
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+/* These must match the order of the register names.
+
+ Some sort of lookup table is needed because the offsets associated
+ with the registers are all over the board. */
+
+static int u_offsets[] =
+ {
+ /* general registers */
+ -1, /* gr0 not available; i.e, it's always zero */
+ PT_R1,
+ PT_R2,
+ PT_R3,
+ PT_R4,
+ PT_R5,
+ PT_R6,
+ PT_R7,
+ PT_R8,
+ PT_R9,
+ PT_R10,
+ PT_R11,
+ PT_R12,
+ PT_R13,
+ PT_R14,
+ PT_R15,
+ PT_R16,
+ PT_R17,
+ PT_R18,
+ PT_R19,
+ PT_R20,
+ PT_R21,
+ PT_R22,
+ PT_R23,
+ PT_R24,
+ PT_R25,
+ PT_R26,
+ PT_R27,
+ PT_R28,
+ PT_R29,
+ PT_R30,
+ PT_R31,
+ /* gr32 through gr127 not directly available via the ptrace interface */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ /* Floating point registers */
+ -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
+ PT_F2,
+ PT_F3,
+ PT_F4,
+ PT_F5,
+ PT_F6,
+ PT_F7,
+ PT_F8,
+ PT_F9,
+ PT_F10,
+ PT_F11,
+ PT_F12,
+ PT_F13,
+ PT_F14,
+ PT_F15,
+ PT_F16,
+ PT_F17,
+ PT_F18,
+ PT_F19,
+ PT_F20,
+ PT_F21,
+ PT_F22,
+ PT_F23,
+ PT_F24,
+ PT_F25,
+ PT_F26,
+ PT_F27,
+ PT_F28,
+ PT_F29,
+ PT_F30,
+ PT_F31,
+ PT_F32,
+ PT_F33,
+ PT_F34,
+ PT_F35,
+ PT_F36,
+ PT_F37,
+ PT_F38,
+ PT_F39,
+ PT_F40,
+ PT_F41,
+ PT_F42,
+ PT_F43,
+ PT_F44,
+ PT_F45,
+ PT_F46,
+ PT_F47,
+ PT_F48,
+ PT_F49,
+ PT_F50,
+ PT_F51,
+ PT_F52,
+ PT_F53,
+ PT_F54,
+ PT_F55,
+ PT_F56,
+ PT_F57,
+ PT_F58,
+ PT_F59,
+ PT_F60,
+ PT_F61,
+ PT_F62,
+ PT_F63,
+ PT_F64,
+ PT_F65,
+ PT_F66,
+ PT_F67,
+ PT_F68,
+ PT_F69,
+ PT_F70,
+ PT_F71,
+ PT_F72,
+ PT_F73,
+ PT_F74,
+ PT_F75,
+ PT_F76,
+ PT_F77,
+ PT_F78,
+ PT_F79,
+ PT_F80,
+ PT_F81,
+ PT_F82,
+ PT_F83,
+ PT_F84,
+ PT_F85,
+ PT_F86,
+ PT_F87,
+ PT_F88,
+ PT_F89,
+ PT_F90,
+ PT_F91,
+ PT_F92,
+ PT_F93,
+ PT_F94,
+ PT_F95,
+ PT_F96,
+ PT_F97,
+ PT_F98,
+ PT_F99,
+ PT_F100,
+ PT_F101,
+ PT_F102,
+ PT_F103,
+ PT_F104,
+ PT_F105,
+ PT_F106,
+ PT_F107,
+ PT_F108,
+ PT_F109,
+ PT_F110,
+ PT_F111,
+ PT_F112,
+ PT_F113,
+ PT_F114,
+ PT_F115,
+ PT_F116,
+ PT_F117,
+ PT_F118,
+ PT_F119,
+ PT_F120,
+ PT_F121,
+ PT_F122,
+ PT_F123,
+ PT_F124,
+ PT_F125,
+ PT_F126,
+ PT_F127,
+ /* predicate registers - we don't fetch these individually */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ /* branch registers */
+ PT_B0,
+ PT_B1,
+ PT_B2,
+ PT_B3,
+ PT_B4,
+ PT_B5,
+ PT_B6,
+ PT_B7,
+ /* virtual frame pointer and virtual return address pointer */
+ -1, -1,
+ /* other registers */
+ PT_PR,
+ PT_CR_IIP, /* ip */
+ PT_CR_IPSR, /* psr */
+ PT_CFM, /* cfm */
+ /* kernel registers not visible via ptrace interface (?) */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ /* hole */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ PT_AR_RSC,
+ PT_AR_BSP,
+ PT_AR_BSPSTORE,
+ PT_AR_RNAT,
+ -1,
+ -1, /* Not available: FCR, IA32 floating control register */
+ -1, -1,
+ -1, /* Not available: EFLAG */
+ -1, /* Not available: CSD */
+ -1, /* Not available: SSD */
+ -1, /* Not available: CFLG */
+ -1, /* Not available: FSR */
+ -1, /* Not available: FIR */
+ -1, /* Not available: FDR */
+ -1,
+ PT_AR_CCV,
+ -1, -1, -1,
+ PT_AR_UNAT,
+ -1, -1, -1,
+ PT_AR_FPSR,
+ -1, -1, -1,
+ -1, /* Not available: ITC */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ PT_AR_PFS,
+ PT_AR_LC,
+ -1, /* Not available: EC, the Epilog Count register */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1,
+ /* nat bits - not fetched directly; instead we obtain these bits from
+ either rnat or unat or from memory. */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ };
+
+CORE_ADDR
+register_addr (int regno, CORE_ADDR blockend)
+{
+ CORE_ADDR addr;
+
+ if (regno < 0 || regno >= NUM_REGS)
+ error ("Invalid register number %d.", regno);
+
+ if (u_offsets[regno] == -1)
+ addr = 0;
+ else
+ addr = (CORE_ADDR) u_offsets[regno];
+
+ return addr;
+}
+
+int ia64_cannot_fetch_register (regno)
+ int regno;
+{
+ return regno < 0 || regno >= NUM_REGS || u_offsets[regno] == -1;
+}
+
+int ia64_cannot_store_register (regno)
+ int regno;
+{
+ /* Rationale behind not permitting stores to bspstore...
+
+ The IA-64 architecture provides bspstore and bsp which refer
+ memory locations in the RSE's backing store. bspstore is the
+ next location which will be written when the RSE needs to write
+ to memory. bsp is the address at which r32 in the current frame
+ would be found if it were written to the backing store.
+
+ The IA-64 architecture provides read-only access to bsp and
+ read/write access to bspstore (but only when the RSE is in
+ the enforced lazy mode). It should be noted that stores
+ to bspstore also affect the value of bsp. Changing bspstore
+ does not affect the number of dirty entries between bspstore
+ and bsp, so changing bspstore by N words will also cause bsp
+ to be changed by (roughly) N as well. (It could be N-1 or N+1
+ depending upon where the NaT collection bits fall.)
+
+ OTOH, the Linux kernel provides read/write access to bsp (and
+ currently read/write access to bspstore as well). But it
+ is definitely the case that if you change one, the other
+ will change at the same time. It is more useful to gdb to
+ be able to change bsp. So in order to prevent strange and
+ undesirable things from happening when a dummy stack frame
+ is popped (after calling an inferior function), we allow
+ bspstore to be read, but not written. (Note that popping
+ a (generic) dummy stack frame causes all registers that
+ were previously read from the inferior process to be written
+ back.) */
+
+ return regno < 0 || regno >= NUM_REGS || u_offsets[regno] == -1
+ || regno == IA64_BSPSTORE_REGNUM;
+}
+
+void
+supply_gregset (gregset_t *gregsetp)
+{
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp;
+
+ for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
+ {
+ supply_register (regi, (char *) (regp + (regi - IA64_GR0_REGNUM)));
+ }
+
+ /* FIXME: NAT collection bits are at index 32; gotta deal with these
+ somehow... */
+
+ supply_register (IA64_PR_REGNUM, (char *) (regp + 33));
+
+ for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
+ {
+ supply_register (regi, (char *) (regp + 34 + (regi - IA64_BR0_REGNUM)));
+ }
+
+ supply_register (IA64_IP_REGNUM, (char *) (regp + 42));
+ supply_register (IA64_CFM_REGNUM, (char *) (regp + 43));
+ supply_register (IA64_PSR_REGNUM, (char *) (regp + 44));
+ supply_register (IA64_RSC_REGNUM, (char *) (regp + 45));
+ supply_register (IA64_BSP_REGNUM, (char *) (regp + 46));
+ supply_register (IA64_BSPSTORE_REGNUM, (char *) (regp + 47));
+ supply_register (IA64_RNAT_REGNUM, (char *) (regp + 48));
+ supply_register (IA64_CCV_REGNUM, (char *) (regp + 49));
+ supply_register (IA64_UNAT_REGNUM, (char *) (regp + 50));
+ supply_register (IA64_FPSR_REGNUM, (char *) (regp + 51));
+ supply_register (IA64_PFS_REGNUM, (char *) (regp + 52));
+ supply_register (IA64_LC_REGNUM, (char *) (regp + 53));
+ supply_register (IA64_EC_REGNUM, (char *) (regp + 54));
+}
+
+void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp;
+
+#define COPY_REG(_idx_,_regi_) \
+ if ((regno == -1) || regno == _regi_) \
+ memcpy (regp + _idx_, &registers[REGISTER_BYTE (_regi_)], \
+ REGISTER_RAW_SIZE (_regi_))
+
+ for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
+ {
+ COPY_REG (regi - IA64_GR0_REGNUM, regi);
+ }
+
+ /* FIXME: NAT collection bits at index 32? */
+
+ COPY_REG (33, IA64_PR_REGNUM);
+
+ for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
+ {
+ COPY_REG (34 + (regi - IA64_BR0_REGNUM), regi);
+ }
+
+ COPY_REG (42, IA64_IP_REGNUM);
+ COPY_REG (43, IA64_CFM_REGNUM);
+ COPY_REG (44, IA64_PSR_REGNUM);
+ COPY_REG (45, IA64_RSC_REGNUM);
+ COPY_REG (46, IA64_BSP_REGNUM);
+ COPY_REG (47, IA64_BSPSTORE_REGNUM);
+ COPY_REG (48, IA64_RNAT_REGNUM);
+ COPY_REG (49, IA64_CCV_REGNUM);
+ COPY_REG (50, IA64_UNAT_REGNUM);
+ COPY_REG (51, IA64_FPSR_REGNUM);
+ COPY_REG (52, IA64_PFS_REGNUM);
+ COPY_REG (53, IA64_LC_REGNUM);
+ COPY_REG (54, IA64_EC_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. */
+
+void
+supply_fpregset (fpregset_t *fpregsetp)
+{
+ register int regi;
+ char *from;
+
+ for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
+ {
+ from = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
+ supply_register (regi, from);
+ }
+}
+
+/* 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. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+ int regi;
+ char *to;
+ char *from;
+
+ for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
+ {
+ if ((regno == -1) || (regno == regi))
+ {
+ from = (char *) &registers[REGISTER_BYTE (regi)];
+ to = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
+ memcpy (to, from, REGISTER_RAW_SIZE (regi));
+ }
+ }
+}
+
+#define IA64_PSR_DB (1UL << 24)
+#define IA64_PSR_DD (1UL << 39)
+
+static void
+enable_watchpoints_in_psr (ptid_t ptid)
+{
+ CORE_ADDR psr;
+
+ psr = read_register_pid (IA64_PSR_REGNUM, ptid);
+ if (!(psr & IA64_PSR_DB))
+ {
+ psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware
+ watchpoints and breakpoints. */
+ write_register_pid (IA64_PSR_REGNUM, psr, ptid);
+ }
+}
+
+static long
+fetch_debug_register (ptid_t ptid, int idx)
+{
+ long val;
+ int tid;
+
+ tid = TIDGET (ptid);
+ if (tid == 0)
+ tid = PIDGET (ptid);
+
+ val = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) (PT_DBR + 8 * idx), 0);
+
+ return val;
+}
+
+static void
+store_debug_register (ptid_t ptid, int idx, long val)
+{
+ int tid;
+
+ tid = TIDGET (ptid);
+ if (tid == 0)
+ tid = PIDGET (ptid);
+
+ (void) ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) (PT_DBR + 8 * idx), val);
+}
+
+static void
+fetch_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
+{
+ if (dbr_addr)
+ *dbr_addr = fetch_debug_register (ptid, 2 * idx);
+ if (dbr_mask)
+ *dbr_mask = fetch_debug_register (ptid, 2 * idx + 1);
+}
+
+static void
+store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
+{
+ if (dbr_addr)
+ store_debug_register (ptid, 2 * idx, *dbr_addr);
+ if (dbr_mask)
+ store_debug_register (ptid, 2 * idx + 1, *dbr_mask);
+}
+
+static int
+is_power_of_2 (int val)
+{
+ int i, onecount;
+
+ onecount = 0;
+ for (i = 0; i < 8 * sizeof (val); i++)
+ if (val & (1 << i))
+ onecount++;
+
+ return onecount <= 1;
+}
+
+int
+ia64_linux_insert_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rw)
+{
+ int idx;
+ long dbr_addr, dbr_mask;
+ int max_watchpoints = 4;
+
+ if (len <= 0 || !is_power_of_2 (len))
+ return -1;
+
+ for (idx = 0; idx < max_watchpoints; idx++)
+ {
+ fetch_debug_register_pair (ptid, idx, NULL, &dbr_mask);
+ if ((dbr_mask & (0x3UL << 62)) == 0)
+ {
+ /* Exit loop if both r and w bits clear */
+ break;
+ }
+ }
+
+ if (idx == max_watchpoints)
+ return -1;
+
+ dbr_addr = (long) addr;
+ dbr_mask = (~(len - 1) & 0x00ffffffffffffffL); /* construct mask to match */
+ dbr_mask |= 0x0800000000000000L; /* Only match privilege level 3 */
+ switch (rw)
+ {
+ case hw_write:
+ dbr_mask |= (1L << 62); /* Set w bit */
+ break;
+ case hw_read:
+ dbr_mask |= (1L << 63); /* Set r bit */
+ break;
+ case hw_access:
+ dbr_mask |= (3L << 62); /* Set both r and w bits */
+ break;
+ default:
+ return -1;
+ }
+
+ store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
+ enable_watchpoints_in_psr (ptid);
+
+ return 0;
+}
+
+int
+ia64_linux_remove_watchpoint (ptid_t ptid, CORE_ADDR addr, int len)
+{
+ int idx;
+ long dbr_addr, dbr_mask;
+ int max_watchpoints = 4;
+
+ if (len <= 0 || !is_power_of_2 (len))
+ return -1;
+
+ for (idx = 0; idx < max_watchpoints; idx++)
+ {
+ fetch_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
+ if ((dbr_mask & (0x3UL << 62)) && addr == (CORE_ADDR) dbr_addr)
+ {
+ dbr_addr = 0;
+ dbr_mask = 0;
+ store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
+ return 0;
+ }
+ }
+ return -1;
+}
+
+CORE_ADDR
+ia64_linux_stopped_by_watchpoint (ptid_t ptid)
+{
+ CORE_ADDR psr;
+ int tid;
+ struct siginfo siginfo;
+
+ tid = TIDGET(ptid);
+ if (tid == 0)
+ tid = PIDGET (ptid);
+
+ errno = 0;
+ ptrace (PTRACE_GETSIGINFO, tid, (PTRACE_ARG3_TYPE) 0, &siginfo);
+
+ if (errno != 0 || (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
+ return 0;
+
+ psr = read_register_pid (IA64_PSR_REGNUM, ptid);
+ psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint
+ for the next instruction */
+ write_register_pid (IA64_PSR_REGNUM, psr, ptid);
+
+ return (CORE_ADDR) siginfo.si_addr;
+}
diff --git a/contrib/gdb/gdb/ia64-linux-tdep.c b/contrib/gdb/gdb/ia64-linux-tdep.c
new file mode 100644
index 0000000..97f8814
--- /dev/null
+++ b/contrib/gdb/gdb/ia64-linux-tdep.c
@@ -0,0 +1,87 @@
+/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
+ Copyright 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "arch-utils.h"
+
+/* The sigtramp code is in a non-readable (executable-only) region
+ of memory called the ``gate page''. The addresses in question
+ were determined by examining the system headers. They are
+ overly generous to allow for different pages sizes. */
+
+#define GATE_AREA_START 0xa000000000000100LL
+#define GATE_AREA_END 0xa000000000010000LL
+
+/* Offset to sigcontext structure from frame of handler */
+#define IA64_LINUX_SIGCONTEXT_OFFSET 192
+
+int
+ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ return (pc >= (CORE_ADDR) GATE_AREA_START && pc < (CORE_ADDR) GATE_AREA_END);
+}
+
+/* IA-64 GNU/Linux specific function which, given a frame address and
+ a register number, returns the address at which that register may be
+ found. 0 is returned for registers which aren't stored in the the
+ sigcontext structure. */
+
+CORE_ADDR
+ia64_linux_sigcontext_register_address (CORE_ADDR sp, int regno)
+{
+ if (IA64_GR0_REGNUM <= regno && regno <= IA64_GR31_REGNUM)
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 200 + 8 * (regno - IA64_GR0_REGNUM);
+ else if (IA64_BR0_REGNUM <= regno && regno <= IA64_BR7_REGNUM)
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 136 + 8 * (regno - IA64_BR0_REGNUM);
+ else if (IA64_FR0_REGNUM <= regno && regno <= IA64_FR127_REGNUM)
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 464 + 16 * (regno - IA64_FR0_REGNUM);
+ else
+ switch (regno)
+ {
+ case IA64_IP_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 40;
+ case IA64_CFM_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 48;
+ case IA64_PSR_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 56; /* user mask only */
+ /* sc_ar_rsc is provided, from which we could compute bspstore, but
+ I don't think it's worth it. Anyway, if we want it, it's at offset
+ 64 */
+ case IA64_BSP_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 72;
+ case IA64_RNAT_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 80;
+ case IA64_CCV_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 88;
+ case IA64_UNAT_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 96;
+ case IA64_FPSR_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 104;
+ case IA64_PFS_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 112;
+ case IA64_LC_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 120;
+ case IA64_PR_REGNUM :
+ return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 128;
+ default :
+ return 0;
+ }
+}
diff --git a/contrib/gdb/gdb/ia64-tdep.c b/contrib/gdb/gdb/ia64-tdep.c
new file mode 100644
index 0000000..7ca7fe7
--- /dev/null
+++ b/contrib/gdb/gdb/ia64-tdep.c
@@ -0,0 +1,2240 @@
+/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "symfile.h" /* for entry_point_address */
+#include "gdbcore.h"
+#include "arch-utils.h"
+#include "floatformat.h"
+#include "regcache.h"
+#include "doublest.h"
+#include "value.h"
+
+#include "objfiles.h"
+#include "elf/common.h" /* for DT_PLTGOT value */
+#include "elf-bfd.h"
+
+/* Hook for determining the global pointer when calling functions in
+ the inferior under AIX. The initialization code in ia64-aix-nat.c
+ sets this hook to the address of a function which will find the
+ global pointer for a given address.
+
+ The generic code which uses the dynamic section in the inferior for
+ finding the global pointer is not of much use on AIX since the
+ values obtained from the inferior have not been relocated. */
+
+CORE_ADDR (*native_find_global_pointer) (CORE_ADDR) = 0;
+
+/* An enumeration of the different IA-64 instruction types. */
+
+typedef enum instruction_type
+{
+ A, /* Integer ALU ; I-unit or M-unit */
+ I, /* Non-ALU integer; I-unit */
+ M, /* Memory ; M-unit */
+ F, /* Floating-point ; F-unit */
+ B, /* Branch ; B-unit */
+ L, /* Extended (L+X) ; I-unit */
+ X, /* Extended (L+X) ; I-unit */
+ undefined /* undefined or reserved */
+} instruction_type;
+
+/* We represent IA-64 PC addresses as the value of the instruction
+ pointer or'd with some bit combination in the low nibble which
+ represents the slot number in the bundle addressed by the
+ instruction pointer. The problem is that the Linux kernel
+ multiplies its slot numbers (for exceptions) by one while the
+ disassembler multiplies its slot numbers by 6. In addition, I've
+ heard it said that the simulator uses 1 as the multiplier.
+
+ I've fixed the disassembler so that the bytes_per_line field will
+ be the slot multiplier. If bytes_per_line comes in as zero, it
+ is set to six (which is how it was set up initially). -- objdump
+ displays pretty disassembly dumps with this value. For our purposes,
+ we'll set bytes_per_line to SLOT_MULTIPLIER. This is okay since we
+ never want to also display the raw bytes the way objdump does. */
+
+#define SLOT_MULTIPLIER 1
+
+/* Length in bytes of an instruction bundle */
+
+#define BUNDLE_LEN 16
+
+/* FIXME: These extern declarations should go in ia64-tdep.h. */
+extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int);
+extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int);
+
+static gdbarch_init_ftype ia64_gdbarch_init;
+
+static gdbarch_register_name_ftype ia64_register_name;
+static gdbarch_register_raw_size_ftype ia64_register_raw_size;
+static gdbarch_register_virtual_size_ftype ia64_register_virtual_size;
+static gdbarch_register_virtual_type_ftype ia64_register_virtual_type;
+static gdbarch_register_byte_ftype ia64_register_byte;
+static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
+static gdbarch_frame_chain_ftype ia64_frame_chain;
+static gdbarch_frame_saved_pc_ftype ia64_frame_saved_pc;
+static gdbarch_skip_prologue_ftype ia64_skip_prologue;
+static gdbarch_frame_init_saved_regs_ftype ia64_frame_init_saved_regs;
+static gdbarch_get_saved_register_ftype ia64_get_saved_register;
+static gdbarch_extract_return_value_ftype ia64_extract_return_value;
+static gdbarch_extract_struct_value_address_ftype ia64_extract_struct_value_address;
+static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
+static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation;
+static gdbarch_init_extra_frame_info_ftype ia64_init_extra_frame_info;
+static gdbarch_store_return_value_ftype ia64_store_return_value;
+static gdbarch_store_struct_return_ftype ia64_store_struct_return;
+static gdbarch_push_arguments_ftype ia64_push_arguments;
+static gdbarch_push_return_address_ftype ia64_push_return_address;
+static gdbarch_pop_frame_ftype ia64_pop_frame;
+static gdbarch_saved_pc_after_call_ftype ia64_saved_pc_after_call;
+static void ia64_pop_frame_regular (struct frame_info *frame);
+static struct type *is_float_or_hfa_type (struct type *t);
+
+static int ia64_num_regs = 590;
+
+static int pc_regnum = IA64_IP_REGNUM;
+static int sp_regnum = IA64_GR12_REGNUM;
+static int fp_regnum = IA64_VFP_REGNUM;
+static int lr_regnum = IA64_VRAP_REGNUM;
+
+static LONGEST ia64_call_dummy_words[] = {0};
+
+/* Array of register names; There should be ia64_num_regs strings in
+ the initializer. */
+
+static char *ia64_register_names[] =
+{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
+ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
+ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
+ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
+ "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
+ "r64", "r65", "r66", "r67", "r68", "r69", "r70", "r71",
+ "r72", "r73", "r74", "r75", "r76", "r77", "r78", "r79",
+ "r80", "r81", "r82", "r83", "r84", "r85", "r86", "r87",
+ "r88", "r89", "r90", "r91", "r92", "r93", "r94", "r95",
+ "r96", "r97", "r98", "r99", "r100", "r101", "r102", "r103",
+ "r104", "r105", "r106", "r107", "r108", "r109", "r110", "r111",
+ "r112", "r113", "r114", "r115", "r116", "r117", "r118", "r119",
+ "r120", "r121", "r122", "r123", "r124", "r125", "r126", "r127",
+
+ "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",
+ "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39",
+ "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47",
+ "f48", "f49", "f50", "f51", "f52", "f53", "f54", "f55",
+ "f56", "f57", "f58", "f59", "f60", "f61", "f62", "f63",
+ "f64", "f65", "f66", "f67", "f68", "f69", "f70", "f71",
+ "f72", "f73", "f74", "f75", "f76", "f77", "f78", "f79",
+ "f80", "f81", "f82", "f83", "f84", "f85", "f86", "f87",
+ "f88", "f89", "f90", "f91", "f92", "f93", "f94", "f95",
+ "f96", "f97", "f98", "f99", "f100", "f101", "f102", "f103",
+ "f104", "f105", "f106", "f107", "f108", "f109", "f110", "f111",
+ "f112", "f113", "f114", "f115", "f116", "f117", "f118", "f119",
+ "f120", "f121", "f122", "f123", "f124", "f125", "f126", "f127",
+
+ "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7",
+ "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",
+ "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23",
+ "p24", "p25", "p26", "p27", "p28", "p29", "p30", "p31",
+ "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39",
+ "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47",
+ "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55",
+ "p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63",
+
+ "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7",
+
+ "vfp", "vrap",
+
+ "pr", "ip", "psr", "cfm",
+
+ "kr0", "kr1", "kr2", "kr3", "kr4", "kr5", "kr6", "kr7",
+ "", "", "", "", "", "", "", "",
+ "rsc", "bsp", "bspstore", "rnat",
+ "", "fcr", "", "",
+ "eflag", "csd", "ssd", "cflg", "fsr", "fir", "fdr", "",
+ "ccv", "", "", "", "unat", "", "", "",
+ "fpsr", "", "", "", "itc",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "",
+ "pfs", "lc", "ec",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "",
+ "nat0", "nat1", "nat2", "nat3", "nat4", "nat5", "nat6", "nat7",
+ "nat8", "nat9", "nat10", "nat11", "nat12", "nat13", "nat14", "nat15",
+ "nat16", "nat17", "nat18", "nat19", "nat20", "nat21", "nat22", "nat23",
+ "nat24", "nat25", "nat26", "nat27", "nat28", "nat29", "nat30", "nat31",
+ "nat32", "nat33", "nat34", "nat35", "nat36", "nat37", "nat38", "nat39",
+ "nat40", "nat41", "nat42", "nat43", "nat44", "nat45", "nat46", "nat47",
+ "nat48", "nat49", "nat50", "nat51", "nat52", "nat53", "nat54", "nat55",
+ "nat56", "nat57", "nat58", "nat59", "nat60", "nat61", "nat62", "nat63",
+ "nat64", "nat65", "nat66", "nat67", "nat68", "nat69", "nat70", "nat71",
+ "nat72", "nat73", "nat74", "nat75", "nat76", "nat77", "nat78", "nat79",
+ "nat80", "nat81", "nat82", "nat83", "nat84", "nat85", "nat86", "nat87",
+ "nat88", "nat89", "nat90", "nat91", "nat92", "nat93", "nat94", "nat95",
+ "nat96", "nat97", "nat98", "nat99", "nat100","nat101","nat102","nat103",
+ "nat104","nat105","nat106","nat107","nat108","nat109","nat110","nat111",
+ "nat112","nat113","nat114","nat115","nat116","nat117","nat118","nat119",
+ "nat120","nat121","nat122","nat123","nat124","nat125","nat126","nat127",
+};
+
+struct frame_extra_info
+ {
+ CORE_ADDR bsp; /* points at r32 for the current frame */
+ CORE_ADDR cfm; /* cfm value for current frame */
+ int sof; /* Size of frame (decoded from cfm value) */
+ int sol; /* Size of locals (decoded from cfm value) */
+ CORE_ADDR after_prologue;
+ /* Address of first instruction after the last
+ prologue instruction; Note that there may
+ be instructions from the function's body
+ intermingled with the prologue. */
+ int mem_stack_frame_size;
+ /* Size of the memory stack frame (may be zero),
+ or -1 if it has not been determined yet. */
+ int fp_reg; /* Register number (if any) used a frame pointer
+ for this frame. 0 if no register is being used
+ as the frame pointer. */
+ };
+
+struct gdbarch_tdep
+ {
+ int os_ident; /* From the ELF header, one of the ELFOSABI_
+ constants: ELFOSABI_LINUX, ELFOSABI_AIX,
+ etc. */
+ CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int);
+ /* OS specific function which, given a frame address
+ and register number, returns the offset to the
+ given register from the start of the frame. */
+ CORE_ADDR (*find_global_pointer) (CORE_ADDR);
+ };
+
+#define SIGCONTEXT_REGISTER_ADDRESS \
+ (gdbarch_tdep (current_gdbarch)->sigcontext_register_address)
+#define FIND_GLOBAL_POINTER \
+ (gdbarch_tdep (current_gdbarch)->find_global_pointer)
+
+static char *
+ia64_register_name (int reg)
+{
+ return ia64_register_names[reg];
+}
+
+int
+ia64_register_raw_size (int reg)
+{
+ return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8;
+}
+
+int
+ia64_register_virtual_size (int reg)
+{
+ return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8;
+}
+
+/* Return true iff register N's virtual format is different from
+ its raw format. */
+int
+ia64_register_convertible (int nr)
+{
+ return (IA64_FR0_REGNUM <= nr && nr <= IA64_FR127_REGNUM);
+}
+
+const struct floatformat floatformat_ia64_ext =
+{
+ floatformat_little, 82, 0, 1, 17, 65535, 0x1ffff, 18, 64,
+ floatformat_intbit_yes
+};
+
+void
+ia64_register_convert_to_virtual (int regnum, struct type *type,
+ char *from, char *to)
+{
+ if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM)
+ {
+ DOUBLEST val;
+ floatformat_to_doublest (&floatformat_ia64_ext, from, &val);
+ store_floating(to, TYPE_LENGTH(type), val);
+ }
+ else
+ error("ia64_register_convert_to_virtual called with non floating point register number");
+}
+
+void
+ia64_register_convert_to_raw (struct type *type, int regnum,
+ char *from, char *to)
+{
+ if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM)
+ {
+ DOUBLEST val = extract_floating (from, TYPE_LENGTH(type));
+ floatformat_from_doublest (&floatformat_ia64_ext, &val, to);
+ }
+ else
+ error("ia64_register_convert_to_raw called with non floating point register number");
+}
+
+struct type *
+ia64_register_virtual_type (int reg)
+{
+ if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
+ return builtin_type_long_double;
+ else
+ return builtin_type_long;
+}
+
+int
+ia64_register_byte (int reg)
+{
+ return (8 * reg) +
+ (reg <= IA64_FR0_REGNUM ? 0 : 8 * ((reg > IA64_FR127_REGNUM) ? 128 : reg - IA64_FR0_REGNUM));
+}
+
+/* Read the given register from a sigcontext structure in the
+ specified frame. */
+
+static CORE_ADDR
+read_sigcontext_register (struct frame_info *frame, int regnum)
+{
+ CORE_ADDR regaddr;
+
+ if (frame == NULL)
+ internal_error (__FILE__, __LINE__,
+ "read_sigcontext_register: NULL frame");
+ if (!frame->signal_handler_caller)
+ internal_error (__FILE__, __LINE__,
+ "read_sigcontext_register: frame not a signal_handler_caller");
+ if (SIGCONTEXT_REGISTER_ADDRESS == 0)
+ internal_error (__FILE__, __LINE__,
+ "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
+
+ regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum);
+ if (regaddr)
+ return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum));
+ else
+ internal_error (__FILE__, __LINE__,
+ "read_sigcontext_register: Register %d not in struct sigcontext", regnum);
+}
+
+/* Extract ``len'' bits from an instruction bundle starting at
+ bit ``from''. */
+
+static long long
+extract_bit_field (char *bundle, int from, int len)
+{
+ long long result = 0LL;
+ int to = from + len;
+ int from_byte = from / 8;
+ int to_byte = to / 8;
+ unsigned char *b = (unsigned char *) bundle;
+ unsigned char c;
+ int lshift;
+ int i;
+
+ c = b[from_byte];
+ if (from_byte == to_byte)
+ c = ((unsigned char) (c << (8 - to % 8))) >> (8 - to % 8);
+ result = c >> (from % 8);
+ lshift = 8 - (from % 8);
+
+ for (i = from_byte+1; i < to_byte; i++)
+ {
+ result |= ((long long) b[i]) << lshift;
+ lshift += 8;
+ }
+
+ if (from_byte < to_byte && (to % 8 != 0))
+ {
+ c = b[to_byte];
+ c = ((unsigned char) (c << (8 - to % 8))) >> (8 - to % 8);
+ result |= ((long long) c) << lshift;
+ }
+
+ return result;
+}
+
+/* Replace the specified bits in an instruction bundle */
+
+static void
+replace_bit_field (char *bundle, long long val, int from, int len)
+{
+ int to = from + len;
+ int from_byte = from / 8;
+ int to_byte = to / 8;
+ unsigned char *b = (unsigned char *) bundle;
+ unsigned char c;
+
+ if (from_byte == to_byte)
+ {
+ unsigned char left, right;
+ c = b[from_byte];
+ left = (c >> (to % 8)) << (to % 8);
+ right = ((unsigned char) (c << (8 - from % 8))) >> (8 - from % 8);
+ c = (unsigned char) (val & 0xff);
+ c = (unsigned char) (c << (from % 8 + 8 - to % 8)) >> (8 - to % 8);
+ c |= right | left;
+ b[from_byte] = c;
+ }
+ else
+ {
+ int i;
+ c = b[from_byte];
+ c = ((unsigned char) (c << (8 - from % 8))) >> (8 - from % 8);
+ c = c | (val << (from % 8));
+ b[from_byte] = c;
+ val >>= 8 - from % 8;
+
+ for (i = from_byte+1; i < to_byte; i++)
+ {
+ c = val & 0xff;
+ val >>= 8;
+ b[i] = c;
+ }
+
+ if (to % 8 != 0)
+ {
+ unsigned char cv = (unsigned char) val;
+ c = b[to_byte];
+ c = c >> (to % 8) << (to % 8);
+ c |= ((unsigned char) (cv << (8 - to % 8))) >> (8 - to % 8);
+ b[to_byte] = c;
+ }
+ }
+}
+
+/* Return the contents of slot N (for N = 0, 1, or 2) in
+ and instruction bundle */
+
+static long long
+slotN_contents (char *bundle, int slotnum)
+{
+ return extract_bit_field (bundle, 5+41*slotnum, 41);
+}
+
+/* Store an instruction in an instruction bundle */
+
+static void
+replace_slotN_contents (char *bundle, long long instr, int slotnum)
+{
+ replace_bit_field (bundle, instr, 5+41*slotnum, 41);
+}
+
+static enum instruction_type template_encoding_table[32][3] =
+{
+ { M, I, I }, /* 00 */
+ { M, I, I }, /* 01 */
+ { M, I, I }, /* 02 */
+ { M, I, I }, /* 03 */
+ { M, L, X }, /* 04 */
+ { M, L, X }, /* 05 */
+ { undefined, undefined, undefined }, /* 06 */
+ { undefined, undefined, undefined }, /* 07 */
+ { M, M, I }, /* 08 */
+ { M, M, I }, /* 09 */
+ { M, M, I }, /* 0A */
+ { M, M, I }, /* 0B */
+ { M, F, I }, /* 0C */
+ { M, F, I }, /* 0D */
+ { M, M, F }, /* 0E */
+ { M, M, F }, /* 0F */
+ { M, I, B }, /* 10 */
+ { M, I, B }, /* 11 */
+ { M, B, B }, /* 12 */
+ { M, B, B }, /* 13 */
+ { undefined, undefined, undefined }, /* 14 */
+ { undefined, undefined, undefined }, /* 15 */
+ { B, B, B }, /* 16 */
+ { B, B, B }, /* 17 */
+ { M, M, B }, /* 18 */
+ { M, M, B }, /* 19 */
+ { undefined, undefined, undefined }, /* 1A */
+ { undefined, undefined, undefined }, /* 1B */
+ { M, F, B }, /* 1C */
+ { M, F, B }, /* 1D */
+ { undefined, undefined, undefined }, /* 1E */
+ { undefined, undefined, undefined }, /* 1F */
+};
+
+/* Fetch and (partially) decode an instruction at ADDR and return the
+ address of the next instruction to fetch. */
+
+static CORE_ADDR
+fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
+{
+ char bundle[BUNDLE_LEN];
+ int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
+ long long template;
+ int val;
+
+ /* Warn about slot numbers greater than 2. We used to generate
+ an error here on the assumption that the user entered an invalid
+ address. But, sometimes GDB itself requests an invalid address.
+ This can (easily) happen when execution stops in a function for
+ which there are no symbols. The prologue scanner will attempt to
+ find the beginning of the function - if the nearest symbol
+ happens to not be aligned on a bundle boundary (16 bytes), the
+ resulting starting address will cause GDB to think that the slot
+ number is too large.
+
+ So we warn about it and set the slot number to zero. It is
+ not necessarily a fatal condition, particularly if debugging
+ at the assembly language level. */
+ if (slotnum > 2)
+ {
+ warning ("Can't fetch instructions for slot numbers greater than 2.\n"
+ "Using slot 0 instead");
+ slotnum = 0;
+ }
+
+ addr &= ~0x0f;
+
+ val = target_read_memory (addr, bundle, BUNDLE_LEN);
+
+ if (val != 0)
+ return 0;
+
+ *instr = slotN_contents (bundle, slotnum);
+ template = extract_bit_field (bundle, 0, 5);
+ *it = template_encoding_table[(int)template][slotnum];
+
+ if (slotnum == 2 || (slotnum == 1 && *it == L))
+ addr += 16;
+ else
+ addr += (slotnum + 1) * SLOT_MULTIPLIER;
+
+ return addr;
+}
+
+/* There are 5 different break instructions (break.i, break.b,
+ break.m, break.f, and break.x), but they all have the same
+ encoding. (The five bit template in the low five bits of the
+ instruction bundle distinguishes one from another.)
+
+ The runtime architecture manual specifies that break instructions
+ used for debugging purposes must have the upper two bits of the 21
+ bit immediate set to a 0 and a 1 respectively. A breakpoint
+ instruction encodes the most significant bit of its 21 bit
+ immediate at bit 36 of the 41 bit instruction. The penultimate msb
+ is at bit 25 which leads to the pattern below.
+
+ Originally, I had this set up to do, e.g, a "break.i 0x80000" But
+ it turns out that 0x80000 was used as the syscall break in the early
+ simulators. So I changed the pattern slightly to do "break.i 0x080001"
+ instead. But that didn't work either (I later found out that this
+ pattern was used by the simulator that I was using.) So I ended up
+ using the pattern seen below. */
+
+#if 0
+#define BREAKPOINT 0x00002000040LL
+#endif
+#define BREAKPOINT 0x00003333300LL
+
+static int
+ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
+{
+ char bundle[BUNDLE_LEN];
+ int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
+ long long instr;
+ int val;
+
+ if (slotnum > 2)
+ error("Can't insert breakpoint for slot numbers greater than 2.");
+
+ addr &= ~0x0f;
+
+ val = target_read_memory (addr, bundle, BUNDLE_LEN);
+ instr = slotN_contents (bundle, slotnum);
+ memcpy(contents_cache, &instr, sizeof(instr));
+ replace_slotN_contents (bundle, BREAKPOINT, slotnum);
+ if (val == 0)
+ target_write_memory (addr, bundle, BUNDLE_LEN);
+
+ return val;
+}
+
+static int
+ia64_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
+{
+ char bundle[BUNDLE_LEN];
+ int slotnum = (addr & 0x0f) / SLOT_MULTIPLIER;
+ long long instr;
+ int val;
+
+ addr &= ~0x0f;
+
+ val = target_read_memory (addr, bundle, BUNDLE_LEN);
+ memcpy (&instr, contents_cache, sizeof instr);
+ replace_slotN_contents (bundle, instr, slotnum);
+ if (val == 0)
+ target_write_memory (addr, bundle, BUNDLE_LEN);
+
+ return val;
+}
+
+/* We don't really want to use this, but remote.c needs to call it in order
+ to figure out if Z-packets are supported or not. Oh, well. */
+unsigned char *
+ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char breakpoint[] =
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ *lenptr = sizeof (breakpoint);
+#if 0
+ *pcptr &= ~0x0f;
+#endif
+ return breakpoint;
+}
+
+CORE_ADDR
+ia64_read_pc (ptid_t ptid)
+{
+ CORE_ADDR psr_value = read_register_pid (IA64_PSR_REGNUM, ptid);
+ CORE_ADDR pc_value = read_register_pid (IA64_IP_REGNUM, ptid);
+ int slot_num = (psr_value >> 41) & 3;
+
+ return pc_value | (slot_num * SLOT_MULTIPLIER);
+}
+
+void
+ia64_write_pc (CORE_ADDR new_pc, ptid_t ptid)
+{
+ int slot_num = (int) (new_pc & 0xf) / SLOT_MULTIPLIER;
+ CORE_ADDR psr_value = read_register_pid (IA64_PSR_REGNUM, ptid);
+ psr_value &= ~(3LL << 41);
+ psr_value |= (CORE_ADDR)(slot_num & 0x3) << 41;
+
+ new_pc &= ~0xfLL;
+
+ write_register_pid (IA64_PSR_REGNUM, psr_value, ptid);
+ write_register_pid (IA64_IP_REGNUM, new_pc, ptid);
+}
+
+#define IS_NaT_COLLECTION_ADDR(addr) ((((addr) >> 3) & 0x3f) == 0x3f)
+
+/* Returns the address of the slot that's NSLOTS slots away from
+ the address ADDR. NSLOTS may be positive or negative. */
+static CORE_ADDR
+rse_address_add(CORE_ADDR addr, int nslots)
+{
+ CORE_ADDR new_addr;
+ int mandatory_nat_slots = nslots / 63;
+ int direction = nslots < 0 ? -1 : 1;
+
+ new_addr = addr + 8 * (nslots + mandatory_nat_slots);
+
+ if ((new_addr >> 9) != ((addr + 8 * 64 * mandatory_nat_slots) >> 9))
+ new_addr += 8 * direction;
+
+ if (IS_NaT_COLLECTION_ADDR(new_addr))
+ new_addr += 8 * direction;
+
+ return new_addr;
+}
+
+/* The IA-64 frame chain is a bit odd. We won't always have a frame
+ pointer, so we use the SP value as the FP for the purpose of
+ creating a frame. There is sometimes a register (not fixed) which
+ is used as a frame pointer. When this register exists, it is not
+ especially hard to determine which one is being used. It isn't
+ even really hard to compute the frame chain, but it can be
+ computationally expensive. So, instead of making life difficult
+ (and slow), we pick a more convenient representation of the frame
+ chain, knowing that we'll have to make some small adjustments
+ in other places. (E.g, note that read_fp() and write_fp() are
+ actually read_sp() and write_sp() below in ia64_gdbarch_init()
+ below.)
+
+ Okay, so what is the frame chain exactly? It'll be the SP value
+ at the time that the function in question was entered.
+
+ Note that this *should* actually the frame pointer for the current
+ function! But as I note above, if we were to attempt to find the
+ address of the beginning of the previous frame, we'd waste a lot
+ of cycles for no good reason. So instead, we simply choose to
+ represent the frame chain as the end of the previous frame instead
+ of the beginning. */
+
+CORE_ADDR
+ia64_frame_chain (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return read_sigcontext_register (frame, sp_regnum);
+ else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ return frame->frame;
+ else
+ {
+ FRAME_INIT_SAVED_REGS (frame);
+ if (frame->saved_regs[IA64_VFP_REGNUM])
+ return read_memory_integer (frame->saved_regs[IA64_VFP_REGNUM], 8);
+ else
+ return frame->frame + frame->extra_info->mem_stack_frame_size;
+ }
+}
+
+CORE_ADDR
+ia64_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return read_sigcontext_register (frame, pc_regnum);
+ else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ return generic_read_register_dummy (frame->pc, frame->frame, pc_regnum);
+ else
+ {
+ FRAME_INIT_SAVED_REGS (frame);
+
+ if (frame->saved_regs[IA64_VRAP_REGNUM])
+ return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8);
+ else if (frame->next && frame->next->signal_handler_caller)
+ return read_sigcontext_register (frame->next, IA64_BR0_REGNUM);
+ else /* either frameless, or not far enough along in the prologue... */
+ return ia64_saved_pc_after_call (frame);
+ }
+}
+
+/* Limit the number of skipped non-prologue instructions since examining
+ of the prologue is expensive. */
+static int max_skip_non_prologue_insns = 10;
+
+/* Given PC representing the starting address of a function, and
+ LIM_PC which is the (sloppy) limit to which to scan when looking
+ for a prologue, attempt to further refine this limit by using
+ the line data in the symbol table. If successful, a better guess
+ on where the prologue ends is returned, otherwise the previous
+ value of lim_pc is returned. TRUST_LIMIT is a pointer to a flag
+ which will be set to indicate whether the returned limit may be
+ used with no further scanning in the event that the function is
+ frameless. */
+
+static CORE_ADDR
+refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
+{
+ struct symtab_and_line prologue_sal;
+ CORE_ADDR start_pc = pc;
+
+ /* Start off not trusting the limit. */
+ *trust_limit = 0;
+
+ prologue_sal = find_pc_line (pc, 0);
+ if (prologue_sal.line != 0)
+ {
+ int i;
+ CORE_ADDR addr = prologue_sal.end;
+
+ /* Handle the case in which compiler's optimizer/scheduler
+ has moved instructions into the prologue. We scan ahead
+ in the function looking for address ranges whose corresponding
+ line number is less than or equal to the first one that we
+ found for the function. (It can be less than when the
+ scheduler puts a body instruction before the first prologue
+ instruction.) */
+ for (i = 2 * max_skip_non_prologue_insns;
+ i > 0 && (lim_pc == 0 || addr < lim_pc);
+ i--)
+ {
+ struct symtab_and_line sal;
+
+ sal = find_pc_line (addr, 0);
+ if (sal.line == 0)
+ break;
+ if (sal.line <= prologue_sal.line
+ && sal.symtab == prologue_sal.symtab)
+ {
+ prologue_sal = sal;
+ }
+ addr = sal.end;
+ }
+
+ if (lim_pc == 0 || prologue_sal.end < lim_pc)
+ {
+ lim_pc = prologue_sal.end;
+ if (start_pc == get_pc_function_start (lim_pc))
+ *trust_limit = 1;
+ }
+ }
+ return lim_pc;
+}
+
+#define isScratch(_regnum_) ((_regnum_) == 2 || (_regnum_) == 3 \
+ || (8 <= (_regnum_) && (_regnum_) <= 11) \
+ || (14 <= (_regnum_) && (_regnum_) <= 31))
+#define imm9(_instr_) \
+ ( ((((_instr_) & 0x01000000000LL) ? -1 : 0) << 8) \
+ | (((_instr_) & 0x00008000000LL) >> 20) \
+ | (((_instr_) & 0x00000001fc0LL) >> 6))
+
+static CORE_ADDR
+examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
+{
+ CORE_ADDR next_pc;
+ CORE_ADDR last_prologue_pc = pc;
+ instruction_type it;
+ long long instr;
+ int do_fsr_stuff = 0;
+
+ int cfm_reg = 0;
+ int ret_reg = 0;
+ int fp_reg = 0;
+ int unat_save_reg = 0;
+ int pr_save_reg = 0;
+ int mem_stack_frame_size = 0;
+ int spill_reg = 0;
+ CORE_ADDR spill_addr = 0;
+ char instores[8];
+ char infpstores[8];
+ int trust_limit;
+
+ memset (instores, 0, sizeof instores);
+ memset (infpstores, 0, sizeof infpstores);
+
+ if (frame && !frame->saved_regs)
+ {
+ frame_saved_regs_zalloc (frame);
+ do_fsr_stuff = 1;
+ }
+
+ if (frame
+ && !do_fsr_stuff
+ && frame->extra_info->after_prologue != 0
+ && frame->extra_info->after_prologue <= lim_pc)
+ return frame->extra_info->after_prologue;
+
+ lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit);
+
+ /* Must start with an alloc instruction */
+ next_pc = fetch_instruction (pc, &it, &instr);
+ if (pc < lim_pc && next_pc
+ && it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL))
+ {
+ /* alloc */
+ int sor = (int) ((instr & 0x00078000000LL) >> 27);
+ int sol = (int) ((instr & 0x00007f00000LL) >> 20);
+ int sof = (int) ((instr & 0x000000fe000LL) >> 13);
+ /* Okay, so sor, sol, and sof aren't used right now; but perhaps
+ we could compare against the size given to us via the cfm as
+ either a sanity check or possibly to see if the frame has been
+ changed by a later alloc instruction... */
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ cfm_reg = rN;
+ last_prologue_pc = next_pc;
+ pc = next_pc;
+ }
+ else
+ {
+ pc = lim_pc; /* Frameless: We're done early. */
+ if (trust_limit)
+ last_prologue_pc = lim_pc;
+ }
+
+ /* Loop, looking for prologue instructions, keeping track of
+ where preserved registers were spilled. */
+ while (pc < lim_pc)
+ {
+ next_pc = fetch_instruction (pc, &it, &instr);
+ if (next_pc == 0)
+ break;
+
+ if ((it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
+ || ((instr & 0x3fLL) != 0LL))
+ {
+ /* Exit loop upon hitting a non-nop branch instruction
+ or a predicated instruction. */
+ break;
+ }
+ else if (it == I && ((instr & 0x1eff8000000LL) == 0x00188000000LL))
+ {
+ /* Move from BR */
+ int b2 = (int) ((instr & 0x0000000e000LL) >> 13);
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ int qp = (int) (instr & 0x0000000003f);
+
+ if (qp == 0 && b2 == 0 && rN >= 32 && ret_reg == 0)
+ {
+ ret_reg = rN;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if ((it == I || it == M)
+ && ((instr & 0x1ee00000000LL) == 0x10800000000LL))
+ {
+ /* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */
+ int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
+ | ((instr & 0x001f8000000LL) >> 20)
+ | ((instr & 0x000000fe000LL) >> 13));
+ int rM = (int) ((instr & 0x00007f00000LL) >> 20);
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ int qp = (int) (instr & 0x0000000003fLL);
+
+ if (qp == 0 && rN >= 32 && imm == 0 && rM == 12 && fp_reg == 0)
+ {
+ /* mov rN, r12 */
+ fp_reg = rN;
+ last_prologue_pc = next_pc;
+ }
+ else if (qp == 0 && rN == 12 && rM == 12)
+ {
+ /* adds r12, -mem_stack_frame_size, r12 */
+ mem_stack_frame_size -= imm;
+ last_prologue_pc = next_pc;
+ }
+ else if (qp == 0 && rN == 2
+ && ((rM == fp_reg && fp_reg != 0) || rM == 12))
+ {
+ /* adds r2, spilloffset, rFramePointer
+ or
+ adds r2, spilloffset, r12
+
+ Get ready for stf.spill or st8.spill instructions.
+ The address to start spilling at is loaded into r2.
+ FIXME: Why r2? That's what gcc currently uses; it
+ could well be different for other compilers. */
+
+ /* Hmm... whether or not this will work will depend on
+ where the pc is. If it's still early in the prologue
+ this'll be wrong. FIXME */
+ spill_addr = (frame ? frame->frame : 0)
+ + (rM == 12 ? 0 : mem_stack_frame_size)
+ + imm;
+ spill_reg = rN;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == M
+ && ( ((instr & 0x1efc0000000LL) == 0x0eec0000000LL)
+ || ((instr & 0x1ffc8000000LL) == 0x0cec0000000LL) ))
+ {
+ /* stf.spill [rN] = fM, imm9
+ or
+ stf.spill [rN] = fM */
+
+ int imm = imm9(instr);
+ int rN = (int) ((instr & 0x00007f00000LL) >> 20);
+ int fM = (int) ((instr & 0x000000fe000LL) >> 13);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && rN == spill_reg && spill_addr != 0
+ && ((2 <= fM && fM <= 5) || (16 <= fM && fM <= 31)))
+ {
+ if (do_fsr_stuff)
+ frame->saved_regs[IA64_FR0_REGNUM + fM] = spill_addr;
+
+ if ((instr & 0x1efc0000000) == 0x0eec0000000)
+ spill_addr += imm;
+ else
+ spill_addr = 0; /* last one; must be done */
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if ((it == M && ((instr & 0x1eff8000000LL) == 0x02110000000LL))
+ || (it == I && ((instr & 0x1eff8000000LL) == 0x00050000000LL)) )
+ {
+ /* mov.m rN = arM
+ or
+ mov.i rN = arM */
+
+ int arM = (int) ((instr & 0x00007f00000LL) >> 20);
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && isScratch (rN) && arM == 36 /* ar.unat */)
+ {
+ /* We have something like "mov.m r3 = ar.unat". Remember the
+ r3 (or whatever) and watch for a store of this register... */
+ unat_save_reg = rN;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == I && ((instr & 0x1eff8000000LL) == 0x00198000000LL))
+ {
+ /* mov rN = pr */
+ int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && isScratch (rN))
+ {
+ pr_save_reg = rN;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == M
+ && ( ((instr & 0x1ffc8000000LL) == 0x08cc0000000LL)
+ || ((instr & 0x1efc0000000LL) == 0x0acc0000000LL)))
+ {
+ /* st8 [rN] = rM
+ or
+ st8 [rN] = rM, imm9 */
+ int rN = (int) ((instr & 0x00007f00000LL) >> 20);
+ int rM = (int) ((instr & 0x000000fe000LL) >> 13);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && rN == spill_reg && spill_addr != 0
+ && (rM == unat_save_reg || rM == pr_save_reg))
+ {
+ /* We've found a spill of either the UNAT register or the PR
+ register. (Well, not exactly; what we've actually found is
+ a spill of the register that UNAT or PR was moved to).
+ Record that fact and move on... */
+ if (rM == unat_save_reg)
+ {
+ /* Track UNAT register */
+ if (do_fsr_stuff)
+ frame->saved_regs[IA64_UNAT_REGNUM] = spill_addr;
+ unat_save_reg = 0;
+ }
+ else
+ {
+ /* Track PR register */
+ if (do_fsr_stuff)
+ frame->saved_regs[IA64_PR_REGNUM] = spill_addr;
+ pr_save_reg = 0;
+ }
+ if ((instr & 0x1efc0000000LL) == 0x0acc0000000LL)
+ /* st8 [rN] = rM, imm9 */
+ spill_addr += imm9(instr);
+ else
+ spill_addr = 0; /* must be done spilling */
+ last_prologue_pc = next_pc;
+ }
+ else if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32])
+ {
+ /* Allow up to one store of each input register. */
+ instores[rM-32] = 1;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == M && ((instr & 0x1ff08000000LL) == 0x08c00000000LL))
+ {
+ /* One of
+ st1 [rN] = rM
+ st2 [rN] = rM
+ st4 [rN] = rM
+ st8 [rN] = rM
+ Note that the st8 case is handled in the clause above.
+
+ Advance over stores of input registers. One store per input
+ register is permitted. */
+ int rM = (int) ((instr & 0x000000fe000LL) >> 13);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32])
+ {
+ instores[rM-32] = 1;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == M && ((instr & 0x1ff88000000LL) == 0x0cc80000000LL))
+ {
+ /* Either
+ stfs [rN] = fM
+ or
+ stfd [rN] = fM
+
+ Advance over stores of floating point input registers. Again
+ one store per register is permitted */
+ int fM = (int) ((instr & 0x000000fe000LL) >> 13);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && 8 <= fM && fM < 16 && !infpstores[fM - 8])
+ {
+ infpstores[fM-8] = 1;
+ last_prologue_pc = next_pc;
+ }
+ }
+ else if (it == M
+ && ( ((instr & 0x1ffc8000000LL) == 0x08ec0000000LL)
+ || ((instr & 0x1efc0000000LL) == 0x0aec0000000LL)))
+ {
+ /* st8.spill [rN] = rM
+ or
+ st8.spill [rN] = rM, imm9 */
+ int rN = (int) ((instr & 0x00007f00000LL) >> 20);
+ int rM = (int) ((instr & 0x000000fe000LL) >> 13);
+ int qp = (int) (instr & 0x0000000003fLL);
+ if (qp == 0 && rN == spill_reg && 4 <= rM && rM <= 7)
+ {
+ /* We've found a spill of one of the preserved general purpose
+ regs. Record the spill address and advance the spill
+ register if appropriate. */
+ if (do_fsr_stuff)
+ frame->saved_regs[IA64_GR0_REGNUM + rM] = spill_addr;
+ if ((instr & 0x1efc0000000LL) == 0x0aec0000000LL)
+ /* st8.spill [rN] = rM, imm9 */
+ spill_addr += imm9(instr);
+ else
+ spill_addr = 0; /* Done spilling */
+ last_prologue_pc = next_pc;
+ }
+ }
+
+ pc = next_pc;
+ }
+
+ if (do_fsr_stuff) {
+ int i;
+ CORE_ADDR addr;
+ int sor, rrb_gr;
+
+ /* Extract the size of the rotating portion of the stack
+ frame and the register rename base from the current
+ frame marker. */
+ sor = ((frame->extra_info->cfm >> 14) & 0xf) * 8;
+ rrb_gr = (frame->extra_info->cfm >> 18) & 0x7f;
+
+ for (i = 0, addr = frame->extra_info->bsp;
+ i < frame->extra_info->sof;
+ i++, addr += 8)
+ {
+ if (IS_NaT_COLLECTION_ADDR (addr))
+ {
+ addr += 8;
+ }
+ if (i < sor)
+ frame->saved_regs[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
+ = addr;
+ else
+ frame->saved_regs[IA64_GR32_REGNUM + i] = addr;
+
+ if (i+32 == cfm_reg)
+ frame->saved_regs[IA64_CFM_REGNUM] = addr;
+ if (i+32 == ret_reg)
+ frame->saved_regs[IA64_VRAP_REGNUM] = addr;
+ if (i+32 == fp_reg)
+ frame->saved_regs[IA64_VFP_REGNUM] = addr;
+ }
+ }
+
+ if (frame && frame->extra_info) {
+ frame->extra_info->after_prologue = last_prologue_pc;
+ frame->extra_info->mem_stack_frame_size = mem_stack_frame_size;
+ frame->extra_info->fp_reg = fp_reg;
+ }
+
+ return last_prologue_pc;
+}
+
+CORE_ADDR
+ia64_skip_prologue (CORE_ADDR pc)
+{
+ return examine_prologue (pc, pc+1024, 0);
+}
+
+void
+ia64_frame_init_saved_regs (struct frame_info *frame)
+{
+ if (frame->saved_regs)
+ return;
+
+ if (frame->signal_handler_caller && SIGCONTEXT_REGISTER_ADDRESS)
+ {
+ int regno;
+
+ frame_saved_regs_zalloc (frame);
+
+ frame->saved_regs[IA64_VRAP_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_IP_REGNUM);
+ frame->saved_regs[IA64_CFM_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CFM_REGNUM);
+ frame->saved_regs[IA64_PSR_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PSR_REGNUM);
+#if 0
+ frame->saved_regs[IA64_BSP_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
+#endif
+ frame->saved_regs[IA64_RNAT_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_RNAT_REGNUM);
+ frame->saved_regs[IA64_CCV_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CCV_REGNUM);
+ frame->saved_regs[IA64_UNAT_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_UNAT_REGNUM);
+ frame->saved_regs[IA64_FPSR_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_FPSR_REGNUM);
+ frame->saved_regs[IA64_PFS_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PFS_REGNUM);
+ frame->saved_regs[IA64_LC_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_LC_REGNUM);
+ for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
+ if (regno != sp_regnum)
+ frame->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
+ frame->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
+ frame->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ }
+ else
+ {
+ CORE_ADDR func_start;
+
+ func_start = get_pc_function_start (frame->pc);
+ examine_prologue (func_start, frame->pc, frame);
+ }
+}
+
+void
+ia64_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval)
+{
+ int is_dummy_frame;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ if (optimized != NULL)
+ *optimized = 0;
+
+ if (addrp != NULL)
+ *addrp = 0;
+
+ if (lval != NULL)
+ *lval = not_lval;
+
+ is_dummy_frame = PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame);
+
+ if (regnum == SP_REGNUM && frame->next)
+ {
+ /* Handle SP values for all frames but the topmost. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame);
+ }
+ else if (regnum == IA64_BSP_REGNUM)
+ {
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ frame->extra_info->bsp);
+ }
+ else if (regnum == IA64_VFP_REGNUM)
+ {
+ /* If the function in question uses an automatic register (r32-r127)
+ for the frame pointer, it'll be found by ia64_find_saved_register()
+ above. If the function lacks one of these frame pointers, we can
+ still provide a value since we know the size of the frame */
+ CORE_ADDR vfp = frame->frame + frame->extra_info->mem_stack_frame_size;
+ store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
+ }
+ else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
+ {
+ char *pr_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ int pr_optim;
+ enum lval_type pr_lval;
+ CORE_ADDR pr_addr;
+ int prN_val;
+ ia64_get_saved_register (pr_raw_buffer, &pr_optim, &pr_addr,
+ frame, IA64_PR_REGNUM, &pr_lval);
+ if (IA64_PR16_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
+ {
+ /* Fetch predicate register rename base from current frame
+ marker for this frame. */
+ int rrb_pr = (frame->extra_info->cfm >> 32) & 0x3f;
+
+ /* Adjust the register number to account for register rotation. */
+ regnum = IA64_PR16_REGNUM
+ + ((regnum - IA64_PR16_REGNUM) + rrb_pr) % 48;
+ }
+ prN_val = extract_bit_field ((unsigned char *) pr_raw_buffer,
+ regnum - IA64_PR0_REGNUM, 1);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), prN_val);
+ }
+ else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
+ {
+ char *unat_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ int unat_optim;
+ enum lval_type unat_lval;
+ CORE_ADDR unat_addr;
+ int unatN_val;
+ ia64_get_saved_register (unat_raw_buffer, &unat_optim, &unat_addr,
+ frame, IA64_UNAT_REGNUM, &unat_lval);
+ unatN_val = extract_bit_field ((unsigned char *) unat_raw_buffer,
+ regnum - IA64_NAT0_REGNUM, 1);
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ unatN_val);
+ }
+ else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
+ {
+ int natval = 0;
+ /* Find address of general register corresponding to nat bit we're
+ interested in. */
+ CORE_ADDR gr_addr = 0;
+
+ if (!is_dummy_frame)
+ {
+ FRAME_INIT_SAVED_REGS (frame);
+ gr_addr = frame->saved_regs[ regnum - IA64_NAT0_REGNUM
+ + IA64_GR0_REGNUM];
+ }
+ if (gr_addr)
+ {
+ /* Compute address of nat collection bits */
+ CORE_ADDR nat_addr = gr_addr | 0x1f8;
+ CORE_ADDR bsp = read_register (IA64_BSP_REGNUM);
+ CORE_ADDR nat_collection;
+ int nat_bit;
+ /* If our nat collection address is bigger than bsp, we have to get
+ the nat collection from rnat. Otherwise, we fetch the nat
+ collection from the computed address. */
+ if (nat_addr >= bsp)
+ nat_collection = read_register (IA64_RNAT_REGNUM);
+ else
+ nat_collection = read_memory_integer (nat_addr, 8);
+ nat_bit = (gr_addr >> 3) & 0x3f;
+ natval = (nat_collection >> nat_bit) & 1;
+ }
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), natval);
+ }
+ else if (regnum == IA64_IP_REGNUM)
+ {
+ CORE_ADDR pc;
+ if (frame->next)
+ {
+ /* FIXME: Set *addrp, *lval when possible. */
+ pc = ia64_frame_saved_pc (frame->next);
+ }
+ else
+ {
+ pc = read_pc ();
+ }
+ store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc);
+ }
+ else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM)
+ {
+ CORE_ADDR addr = 0;
+ if (!is_dummy_frame)
+ {
+ FRAME_INIT_SAVED_REGS (frame);
+ addr = frame->saved_regs[regnum];
+ }
+
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (addrp != NULL)
+ *addrp = addr;
+ read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ /* r32 - r127 must be fetchable via memory. If they aren't,
+ then the register is unavailable */
+ memset (raw_buffer, 0, REGISTER_RAW_SIZE (regnum));
+ }
+ }
+ else
+ {
+ if (IA64_FR32_REGNUM <= regnum && regnum <= IA64_FR127_REGNUM)
+ {
+ /* Fetch floating point register rename base from current
+ frame marker for this frame. */
+ int rrb_fr = (frame->extra_info->cfm >> 25) & 0x7f;
+
+ /* Adjust the floating point register number to account for
+ register rotation. */
+ regnum = IA64_FR32_REGNUM
+ + ((regnum - IA64_FR32_REGNUM) + rrb_fr) % 96;
+ }
+
+ generic_get_saved_register (raw_buffer, optimized, addrp, frame,
+ regnum, lval);
+ }
+}
+
+/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
+ and TYPE is the type (which is known to be struct, union or array). */
+int
+ia64_use_struct_convention (int gcc_p, struct type *type)
+{
+ struct type *float_elt_type;
+
+ /* HFAs are structures (or arrays) consisting entirely of floating
+ point values of the same length. Up to 8 of these are returned
+ in registers. Don't use the struct convention when this is the
+ case. */
+ float_elt_type = is_float_or_hfa_type (type);
+ if (float_elt_type != NULL
+ && TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type) <= 8)
+ return 0;
+
+ /* Other structs of length 32 or less are returned in r8-r11.
+ Don't use the struct convention for those either. */
+ return TYPE_LENGTH (type) > 32;
+}
+
+void
+ia64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ struct type *float_elt_type;
+
+ float_elt_type = is_float_or_hfa_type (type);
+ if (float_elt_type != NULL)
+ {
+ int offset = 0;
+ int regnum = IA64_FR8_REGNUM;
+ int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type);
+
+ while (n-- > 0)
+ {
+ ia64_register_convert_to_virtual (regnum, float_elt_type,
+ &regbuf[REGISTER_BYTE (regnum)], valbuf + offset);
+ offset += TYPE_LENGTH (float_elt_type);
+ regnum++;
+ }
+ }
+ else
+ memcpy (valbuf, &regbuf[REGISTER_BYTE (IA64_GR8_REGNUM)],
+ TYPE_LENGTH (type));
+}
+
+/* FIXME: Turn this into a stack of some sort. Unfortunately, something
+ like this is necessary though since the IA-64 calling conventions specify
+ that r8 is not preserved. */
+static CORE_ADDR struct_return_address;
+
+CORE_ADDR
+ia64_extract_struct_value_address (char *regbuf)
+{
+ /* FIXME: See above. */
+ return struct_return_address;
+}
+
+void
+ia64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ /* FIXME: See above. */
+ /* Note that most of the work was done in ia64_push_arguments() */
+ struct_return_address = addr;
+}
+
+int
+ia64_frameless_function_invocation (struct frame_info *frame)
+{
+ FRAME_INIT_SAVED_REGS (frame);
+ return (frame->extra_info->mem_stack_frame_size == 0);
+}
+
+CORE_ADDR
+ia64_saved_pc_after_call (struct frame_info *frame)
+{
+ return read_register (IA64_BR0_REGNUM);
+}
+
+CORE_ADDR
+ia64_frame_args_address (struct frame_info *frame)
+{
+ /* frame->frame points at the SP for this frame; But we want the start
+ of the frame, not the end. Calling frame chain will get his for us. */
+ return ia64_frame_chain (frame);
+}
+
+CORE_ADDR
+ia64_frame_locals_address (struct frame_info *frame)
+{
+ /* frame->frame points at the SP for this frame; But we want the start
+ of the frame, not the end. Calling frame chain will get his for us. */
+ return ia64_frame_chain (frame);
+}
+
+void
+ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
+{
+ CORE_ADDR bsp, cfm;
+ int next_frame_is_call_dummy = ((frame->next != NULL)
+ && PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame,
+ frame->next->frame));
+
+ frame->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+
+ if (frame->next == 0)
+ {
+ bsp = read_register (IA64_BSP_REGNUM);
+ cfm = read_register (IA64_CFM_REGNUM);
+
+ }
+ else if (frame->next->signal_handler_caller)
+ {
+ bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM);
+ cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM);
+ }
+ else if (next_frame_is_call_dummy)
+ {
+ bsp = generic_read_register_dummy (frame->next->pc, frame->next->frame,
+ IA64_BSP_REGNUM);
+ cfm = generic_read_register_dummy (frame->next->pc, frame->next->frame,
+ IA64_CFM_REGNUM);
+ }
+ else
+ {
+ struct frame_info *frn = frame->next;
+
+ FRAME_INIT_SAVED_REGS (frn);
+
+ if (frn->saved_regs[IA64_CFM_REGNUM] != 0)
+ cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8);
+ else if (frn->next && frn->next->signal_handler_caller)
+ cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
+ else if (frn->next
+ && PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame,
+ frn->next->frame))
+ cfm = generic_read_register_dummy (frn->next->pc, frn->next->frame,
+ IA64_PFS_REGNUM);
+ else
+ cfm = read_register (IA64_PFS_REGNUM);
+
+ bsp = frn->extra_info->bsp;
+ }
+ frame->extra_info->cfm = cfm;
+ frame->extra_info->sof = cfm & 0x7f;
+ frame->extra_info->sol = (cfm >> 7) & 0x7f;
+ if (frame->next == 0
+ || frame->next->signal_handler_caller
+ || next_frame_is_call_dummy)
+ frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
+ else
+ frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sol);
+
+ frame->extra_info->after_prologue = 0;
+ frame->extra_info->mem_stack_frame_size = -1; /* Not yet determined */
+ frame->extra_info->fp_reg = 0;
+}
+
+static int
+is_float_or_hfa_type_recurse (struct type *t, struct type **etp)
+{
+ switch (TYPE_CODE (t))
+ {
+ case TYPE_CODE_FLT:
+ if (*etp)
+ return TYPE_LENGTH (*etp) == TYPE_LENGTH (t);
+ else
+ {
+ *etp = t;
+ return 1;
+ }
+ break;
+ case TYPE_CODE_ARRAY:
+ return
+ is_float_or_hfa_type_recurse (check_typedef (TYPE_TARGET_TYPE (t)),
+ etp);
+ break;
+ case TYPE_CODE_STRUCT:
+ {
+ int i;
+
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ if (!is_float_or_hfa_type_recurse
+ (check_typedef (TYPE_FIELD_TYPE (t, i)), etp))
+ return 0;
+ return 1;
+ }
+ break;
+ default:
+ return 0;
+ break;
+ }
+}
+
+/* Determine if the given type is one of the floating point types or
+ and HFA (which is a struct, array, or combination thereof whose
+ bottom-most elements are all of the same floating point type.) */
+
+static struct type *
+is_float_or_hfa_type (struct type *t)
+{
+ struct type *et = 0;
+
+ return is_float_or_hfa_type_recurse (t, &et) ? et : 0;
+}
+
+
+/* Return 1 if the alignment of T is such that the next even slot
+ should be used. Return 0, if the next available slot should
+ be used. (See section 8.5.1 of the IA-64 Software Conventions
+ and Runtime manual.) */
+
+static int
+slot_alignment_is_next_even (struct type *t)
+{
+ switch (TYPE_CODE (t))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_FLT:
+ if (TYPE_LENGTH (t) > 8)
+ return 1;
+ else
+ return 0;
+ case TYPE_CODE_ARRAY:
+ return
+ slot_alignment_is_next_even (check_typedef (TYPE_TARGET_TYPE (t)));
+ case TYPE_CODE_STRUCT:
+ {
+ int i;
+
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ if (slot_alignment_is_next_even
+ (check_typedef (TYPE_FIELD_TYPE (t, i))))
+ return 1;
+ return 0;
+ }
+ default:
+ return 0;
+ }
+}
+
+/* Attempt to find (and return) the global pointer for the given
+ function.
+
+ This is a rather nasty bit of code searchs for the .dynamic section
+ in the objfile corresponding to the pc of the function we're trying
+ to call. Once it finds the addresses at which the .dynamic section
+ lives in the child process, it scans the Elf64_Dyn entries for a
+ DT_PLTGOT tag. If it finds one of these, the corresponding
+ d_un.d_ptr value is the global pointer. */
+
+static CORE_ADDR
+generic_elf_find_global_pointer (CORE_ADDR faddr)
+{
+ struct obj_section *faddr_sect;
+
+ faddr_sect = find_pc_section (faddr);
+ if (faddr_sect != NULL)
+ {
+ struct obj_section *osect;
+
+ ALL_OBJFILE_OSECTIONS (faddr_sect->objfile, osect)
+ {
+ if (strcmp (osect->the_bfd_section->name, ".dynamic") == 0)
+ break;
+ }
+
+ if (osect < faddr_sect->objfile->sections_end)
+ {
+ CORE_ADDR addr;
+
+ addr = osect->addr;
+ while (addr < osect->endaddr)
+ {
+ int status;
+ LONGEST tag;
+ char buf[8];
+
+ status = target_read_memory (addr, buf, sizeof (buf));
+ if (status != 0)
+ break;
+ tag = extract_signed_integer (buf, sizeof (buf));
+
+ if (tag == DT_PLTGOT)
+ {
+ CORE_ADDR global_pointer;
+
+ status = target_read_memory (addr + 8, buf, sizeof (buf));
+ if (status != 0)
+ break;
+ global_pointer = extract_address (buf, sizeof (buf));
+
+ /* The payoff... */
+ return global_pointer;
+ }
+
+ if (tag == DT_NULL)
+ break;
+
+ addr += 16;
+ }
+ }
+ }
+ return 0;
+}
+
+/* Given a function's address, attempt to find (and return) the
+ corresponding (canonical) function descriptor. Return 0 if
+ not found. */
+static CORE_ADDR
+find_extant_func_descr (CORE_ADDR faddr)
+{
+ struct obj_section *faddr_sect;
+
+ /* Return early if faddr is already a function descriptor */
+ faddr_sect = find_pc_section (faddr);
+ if (faddr_sect && strcmp (faddr_sect->the_bfd_section->name, ".opd") == 0)
+ return faddr;
+
+ if (faddr_sect != NULL)
+ {
+ struct obj_section *osect;
+ ALL_OBJFILE_OSECTIONS (faddr_sect->objfile, osect)
+ {
+ if (strcmp (osect->the_bfd_section->name, ".opd") == 0)
+ break;
+ }
+
+ if (osect < faddr_sect->objfile->sections_end)
+ {
+ CORE_ADDR addr;
+
+ addr = osect->addr;
+ while (addr < osect->endaddr)
+ {
+ int status;
+ LONGEST faddr2;
+ char buf[8];
+
+ status = target_read_memory (addr, buf, sizeof (buf));
+ if (status != 0)
+ break;
+ faddr2 = extract_signed_integer (buf, sizeof (buf));
+
+ if (faddr == faddr2)
+ return addr;
+
+ addr += 16;
+ }
+ }
+ }
+ return 0;
+}
+
+/* Attempt to find a function descriptor corresponding to the
+ given address. If none is found, construct one on the
+ stack using the address at fdaptr */
+
+static CORE_ADDR
+find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr)
+{
+ CORE_ADDR fdesc;
+
+ fdesc = find_extant_func_descr (faddr);
+
+ if (fdesc == 0)
+ {
+ CORE_ADDR global_pointer;
+ char buf[16];
+
+ fdesc = *fdaptr;
+ *fdaptr += 16;
+
+ global_pointer = FIND_GLOBAL_POINTER (faddr);
+
+ if (global_pointer == 0)
+ global_pointer = read_register (IA64_GR1_REGNUM);
+
+ store_address (buf, 8, faddr);
+ store_address (buf + 8, 8, global_pointer);
+
+ write_memory (fdesc, buf, 16);
+ }
+
+ return fdesc;
+}
+
+CORE_ADDR
+ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int argno;
+ struct value *arg;
+ struct type *type;
+ int len, argoffset;
+ int nslots, rseslots, memslots, slotnum, nfuncargs;
+ int floatreg;
+ CORE_ADDR bsp, cfm, pfs, new_bsp, funcdescaddr;
+
+ nslots = 0;
+ nfuncargs = 0;
+ /* Count the number of slots needed for the arguments */
+ for (argno = 0; argno < nargs; argno++)
+ {
+ arg = args[argno];
+ type = check_typedef (VALUE_TYPE (arg));
+ len = TYPE_LENGTH (type);
+
+ if ((nslots & 1) && slot_alignment_is_next_even (type))
+ nslots++;
+
+ if (TYPE_CODE (type) == TYPE_CODE_FUNC)
+ nfuncargs++;
+
+ nslots += (len + 7) / 8;
+ }
+
+ /* Divvy up the slots between the RSE and the memory stack */
+ rseslots = (nslots > 8) ? 8 : nslots;
+ memslots = nslots - rseslots;
+
+ /* Allocate a new RSE frame */
+ cfm = read_register (IA64_CFM_REGNUM);
+
+ bsp = read_register (IA64_BSP_REGNUM);
+ bsp = rse_address_add (bsp, cfm & 0x7f);
+ new_bsp = rse_address_add (bsp, rseslots);
+ write_register (IA64_BSP_REGNUM, new_bsp);
+
+ pfs = read_register (IA64_PFS_REGNUM);
+ pfs &= 0xc000000000000000LL;
+ pfs |= (cfm & 0xffffffffffffLL);
+ write_register (IA64_PFS_REGNUM, pfs);
+
+ cfm &= 0xc000000000000000LL;
+ cfm |= rseslots;
+ write_register (IA64_CFM_REGNUM, cfm);
+
+ /* We will attempt to find function descriptors in the .opd segment,
+ but if we can't we'll construct them ourselves. That being the
+ case, we'll need to reserve space on the stack for them. */
+ funcdescaddr = sp - nfuncargs * 16;
+ funcdescaddr &= ~0xfLL;
+
+ /* Adjust the stack pointer to it's new value. The calling conventions
+ require us to have 16 bytes of scratch, plus whatever space is
+ necessary for the memory slots and our function descriptors */
+ sp = sp - 16 - (memslots + nfuncargs) * 8;
+ sp &= ~0xfLL; /* Maintain 16 byte alignment */
+
+ /* Place the arguments where they belong. The arguments will be
+ either placed in the RSE backing store or on the memory stack.
+ In addition, floating point arguments or HFAs are placed in
+ floating point registers. */
+ slotnum = 0;
+ floatreg = IA64_FR8_REGNUM;
+ for (argno = 0; argno < nargs; argno++)
+ {
+ struct type *float_elt_type;
+
+ arg = args[argno];
+ type = check_typedef (VALUE_TYPE (arg));
+ len = TYPE_LENGTH (type);
+
+ /* Special handling for function parameters */
+ if (len == 8
+ && TYPE_CODE (type) == TYPE_CODE_PTR
+ && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)
+ {
+ char val_buf[8];
+
+ store_address (val_buf, 8,
+ find_func_descr (extract_address (VALUE_CONTENTS (arg), 8),
+ &funcdescaddr));
+ if (slotnum < rseslots)
+ write_memory (rse_address_add (bsp, slotnum), val_buf, 8);
+ else
+ write_memory (sp + 16 + 8 * (slotnum - rseslots), val_buf, 8);
+ slotnum++;
+ continue;
+ }
+
+ /* Normal slots */
+
+ /* Skip odd slot if necessary... */
+ if ((slotnum & 1) && slot_alignment_is_next_even (type))
+ slotnum++;
+
+ argoffset = 0;
+ while (len > 0)
+ {
+ char val_buf[8];
+
+ memset (val_buf, 0, 8);
+ memcpy (val_buf, VALUE_CONTENTS (arg) + argoffset, (len > 8) ? 8 : len);
+
+ if (slotnum < rseslots)
+ write_memory (rse_address_add (bsp, slotnum), val_buf, 8);
+ else
+ write_memory (sp + 16 + 8 * (slotnum - rseslots), val_buf, 8);
+
+ argoffset += 8;
+ len -= 8;
+ slotnum++;
+ }
+
+ /* Handle floating point types (including HFAs) */
+ float_elt_type = is_float_or_hfa_type (type);
+ if (float_elt_type != NULL)
+ {
+ argoffset = 0;
+ len = TYPE_LENGTH (type);
+ while (len > 0 && floatreg < IA64_FR16_REGNUM)
+ {
+ ia64_register_convert_to_raw (
+ float_elt_type,
+ floatreg,
+ VALUE_CONTENTS (arg) + argoffset,
+ &registers[REGISTER_BYTE (floatreg)]);
+ floatreg++;
+ argoffset += TYPE_LENGTH (float_elt_type);
+ len -= TYPE_LENGTH (float_elt_type);
+ }
+ }
+ }
+
+ /* Store the struct return value in r8 if necessary. */
+ if (struct_return)
+ {
+ store_address (&registers[REGISTER_BYTE (IA64_GR8_REGNUM)],
+ REGISTER_RAW_SIZE (IA64_GR8_REGNUM),
+ struct_addr);
+ }
+
+ /* Sync gdb's idea of what the registers are with the target. */
+ target_store_registers (-1);
+
+ /* FIXME: This doesn't belong here! Instead, SAVE_DUMMY_FRAME_TOS needs
+ to be defined to call generic_save_dummy_frame_tos(). But at the
+ time of this writing, SAVE_DUMMY_FRAME_TOS wasn't gdbarch'd, so
+ I chose to put this call here instead of using the old mechanisms.
+ Once SAVE_DUMMY_FRAME_TOS is gdbarch'd, all we need to do is add the
+ line
+
+ set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
+
+ to ia64_gdbarch_init() and remove the line below. */
+ generic_save_dummy_frame_tos (sp);
+
+ return sp;
+}
+
+CORE_ADDR
+ia64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+ CORE_ADDR global_pointer = FIND_GLOBAL_POINTER (pc);
+
+ if (global_pointer != 0)
+ write_register (IA64_GR1_REGNUM, global_pointer);
+
+ write_register (IA64_BR0_REGNUM, CALL_DUMMY_ADDRESS ());
+ return sp;
+}
+
+void
+ia64_store_return_value (struct type *type, char *valbuf)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ ia64_register_convert_to_raw (type, IA64_FR8_REGNUM, valbuf,
+ &registers[REGISTER_BYTE (IA64_FR8_REGNUM)]);
+ target_store_registers (IA64_FR8_REGNUM);
+ }
+ else
+ write_register_bytes (REGISTER_BYTE (IA64_GR8_REGNUM),
+ valbuf, TYPE_LENGTH (type));
+}
+
+void
+ia64_pop_frame (void)
+{
+ generic_pop_current_frame (ia64_pop_frame_regular);
+}
+
+static void
+ia64_pop_frame_regular (struct frame_info *frame)
+{
+ int regno;
+ CORE_ADDR bsp, cfm, pfs;
+
+ FRAME_INIT_SAVED_REGS (frame);
+
+ for (regno = 0; regno < ia64_num_regs; regno++)
+ {
+ if (frame->saved_regs[regno]
+ && (!(IA64_GR32_REGNUM <= regno && regno <= IA64_GR127_REGNUM))
+ && regno != pc_regnum
+ && regno != sp_regnum
+ && regno != IA64_PFS_REGNUM
+ && regno != IA64_CFM_REGNUM
+ && regno != IA64_BSP_REGNUM
+ && regno != IA64_BSPSTORE_REGNUM)
+ {
+ write_register (regno,
+ read_memory_integer (frame->saved_regs[regno],
+ REGISTER_RAW_SIZE (regno)));
+ }
+ }
+
+ write_register (sp_regnum, FRAME_CHAIN (frame));
+ write_pc (FRAME_SAVED_PC (frame));
+
+ cfm = read_register (IA64_CFM_REGNUM);
+
+ if (frame->saved_regs[IA64_PFS_REGNUM])
+ {
+ pfs = read_memory_integer (frame->saved_regs[IA64_PFS_REGNUM],
+ REGISTER_RAW_SIZE (IA64_PFS_REGNUM));
+ }
+ else
+ pfs = read_register (IA64_PFS_REGNUM);
+
+ /* Compute the new bsp by *adding* the difference between the
+ size of the frame and the size of the locals (both wrt the
+ frame that we're going back to). This seems kind of strange,
+ especially since it seems like we ought to be subtracting the
+ size of the locals... and we should; but the Linux kernel
+ wants bsp to be set at the end of all used registers. It's
+ likely that this code will need to be revised to accomodate
+ other operating systems. */
+ bsp = rse_address_add (frame->extra_info->bsp,
+ (pfs & 0x7f) - ((pfs >> 7) & 0x7f));
+ write_register (IA64_BSP_REGNUM, bsp);
+
+ /* FIXME: What becomes of the epilog count in the PFS? */
+ cfm = (cfm & ~0xffffffffffffLL) | (pfs & 0xffffffffffffLL);
+ write_register (IA64_CFM_REGNUM, cfm);
+
+ flush_cached_frames ();
+}
+
+static void
+ia64_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+ CORE_ADDR *targ_addr, int *targ_len)
+{
+ *targ_addr = memaddr;
+ *targ_len = nr_bytes;
+}
+
+static void
+process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
+{
+ int *os_ident_ptr = obj;
+ const char *name;
+ unsigned int sectsize;
+
+ name = bfd_get_section_name (abfd, sect);
+ sectsize = bfd_section_size (abfd, sect);
+ if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
+ {
+ unsigned int name_length, data_length, note_type;
+ char *note = alloca (sectsize);
+
+ bfd_get_section_contents (abfd, sect, note,
+ (file_ptr) 0, (bfd_size_type) sectsize);
+
+ name_length = bfd_h_get_32 (abfd, note);
+ data_length = bfd_h_get_32 (abfd, note + 4);
+ note_type = bfd_h_get_32 (abfd, note + 8);
+
+ if (name_length == 4 && data_length == 16 && note_type == 1
+ && strcmp (note + 12, "GNU") == 0)
+ {
+ int os_number = bfd_h_get_32 (abfd, note + 16);
+
+ /* The case numbers are from abi-tags in glibc */
+ switch (os_number)
+ {
+ case 0 :
+ *os_ident_ptr = ELFOSABI_LINUX;
+ break;
+ case 1 :
+ *os_ident_ptr = ELFOSABI_HURD;
+ break;
+ case 2 :
+ *os_ident_ptr = ELFOSABI_SOLARIS;
+ break;
+ default :
+ internal_error (__FILE__, __LINE__,
+ "process_note_abi_sections: unknown OS number %d", os_number);
+ break;
+ }
+ }
+ }
+}
+
+static struct gdbarch *
+ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
+ int os_ident;
+
+ if (info.abfd != NULL
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
+ {
+ os_ident = elf_elfheader (info.abfd)->e_ident[EI_OSABI];
+
+ /* If os_ident is 0, it is not necessarily the case that we're
+ on a SYSV system. (ELFOSABI_NONE is defined to be 0.)
+ GNU/Linux uses a note section to record OS/ABI info, but
+ leaves e_ident[EI_OSABI] zero. So we have to check for note
+ sections too. */
+ if (os_ident == 0)
+ {
+ bfd_map_over_sections (info.abfd,
+ process_note_abi_tag_sections,
+ &os_ident);
+ }
+ }
+ else
+ os_ident = -1;
+
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep &&tdep->os_ident == os_ident)
+ return arches->gdbarch;
+ }
+
+ tdep = xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
+ tdep->os_ident = os_ident;
+
+
+ /* Set the method of obtaining the sigcontext addresses at which
+ registers are saved. The method of checking to see if
+ native_find_global_pointer is nonzero to indicate that we're
+ on AIX is kind of hokey, but I can't think of a better way
+ to do it. */
+ if (os_ident == ELFOSABI_LINUX)
+ tdep->sigcontext_register_address = ia64_linux_sigcontext_register_address;
+ else if (native_find_global_pointer != 0)
+ tdep->sigcontext_register_address = ia64_aix_sigcontext_register_address;
+ else
+ tdep->sigcontext_register_address = 0;
+
+ /* We know that GNU/Linux won't have to resort to the
+ native_find_global_pointer hackery. But that's the only one we
+ know about so far, so if native_find_global_pointer is set to
+ something non-zero, then use it. Otherwise fall back to using
+ generic_elf_find_global_pointer. This arrangement should (in
+ theory) allow us to cross debug GNU/Linux binaries from an AIX
+ machine. */
+ if (os_ident == ELFOSABI_LINUX)
+ tdep->find_global_pointer = generic_elf_find_global_pointer;
+ else if (native_find_global_pointer != 0)
+ tdep->find_global_pointer = native_find_global_pointer;
+ else
+ tdep->find_global_pointer = generic_elf_find_global_pointer;
+
+ set_gdbarch_short_bit (gdbarch, 16);
+ set_gdbarch_int_bit (gdbarch, 32);
+ set_gdbarch_long_bit (gdbarch, 64);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_float_bit (gdbarch, 32);
+ set_gdbarch_double_bit (gdbarch, 64);
+ set_gdbarch_long_double_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 64);
+
+ set_gdbarch_num_regs (gdbarch, ia64_num_regs);
+ set_gdbarch_sp_regnum (gdbarch, sp_regnum);
+ set_gdbarch_fp_regnum (gdbarch, fp_regnum);
+ set_gdbarch_pc_regnum (gdbarch, pc_regnum);
+ set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM);
+
+ set_gdbarch_register_name (gdbarch, ia64_register_name);
+ set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
+ set_gdbarch_register_byte (gdbarch, ia64_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 16);
+ set_gdbarch_register_virtual_size (gdbarch, ia64_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch, 16);
+ set_gdbarch_register_virtual_type (gdbarch, ia64_register_virtual_type);
+
+ set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue);
+
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frameless_function_invocation (gdbarch, ia64_frameless_function_invocation);
+
+ set_gdbarch_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call);
+
+ set_gdbarch_frame_chain (gdbarch, ia64_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs);
+ set_gdbarch_get_saved_register (gdbarch, ia64_get_saved_register);
+
+ set_gdbarch_register_convertible (gdbarch, ia64_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual);
+ set_gdbarch_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw);
+
+ set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention);
+ set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value);
+
+ set_gdbarch_store_struct_return (gdbarch, ia64_store_struct_return);
+ set_gdbarch_store_return_value (gdbarch, ia64_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
+
+ set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint);
+ set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
+ set_gdbarch_breakpoint_from_pc (gdbarch, ia64_breakpoint_from_pc);
+ set_gdbarch_read_pc (gdbarch, ia64_read_pc);
+ set_gdbarch_write_pc (gdbarch, ia64_write_pc);
+
+ /* Settings for calling functions in the inferior. */
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_push_arguments (gdbarch, ia64_push_arguments);
+ set_gdbarch_push_return_address (gdbarch, ia64_push_return_address);
+ set_gdbarch_pop_frame (gdbarch, ia64_pop_frame);
+
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info);
+ set_gdbarch_frame_args_address (gdbarch, ia64_frame_args_address);
+ set_gdbarch_frame_locals_address (gdbarch, ia64_frame_locals_address);
+
+ /* We won't necessarily have a frame pointer and even if we do,
+ it winds up being extraordinarly messy when attempting to find
+ the frame chain. So for the purposes of creating frames (which
+ is all read_fp() is used for), simply use the stack pointer value
+ instead. */
+ set_gdbarch_read_fp (gdbarch, generic_target_read_sp);
+ set_gdbarch_write_fp (gdbarch, generic_target_write_sp);
+
+ /* Settings that should be unnecessary. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
+ set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
+
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ set_gdbarch_remote_translate_xfer_address (
+ gdbarch, ia64_remote_translate_xfer_address);
+
+ return gdbarch;
+}
+
+void
+_initialize_ia64_tdep (void)
+{
+ register_gdbarch_init (bfd_arch_ia64, ia64_gdbarch_init);
+
+ tm_print_insn = print_insn_ia64;
+ tm_print_insn_info.bytes_per_line = SLOT_MULTIPLIER;
+}
diff --git a/contrib/gdb/gdb/inf-loop.c b/contrib/gdb/gdb/inf-loop.c
new file mode 100644
index 0000000..ed60cc3
--- /dev/null
+++ b/contrib/gdb/gdb/inf-loop.c
@@ -0,0 +1,132 @@
+/* Handling of inferior events for the event loop for GDB, the GNU debugger.
+ Copyright 1999 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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" /* For fetch_inferior_event. */
+#include "target.h" /* For enum inferior_event_type. */
+#include "event-loop.h"
+#include "event-top.h"
+#include "inf-loop.h"
+#include "remote.h"
+
+static int fetch_inferior_event_wrapper (gdb_client_data client_data);
+static void complete_execution (void);
+
+void
+inferior_event_handler_wrapper (gdb_client_data client_data)
+{
+ inferior_event_handler (INF_QUIT_REQ, client_data);
+}
+
+/* General function to handle events in the inferior. So far it just
+ takes care of detecting errors reported by select() or poll(),
+ otherwise it assumes that all is OK, and goes on reading data from
+ the fd. This however may not always be what we want to do. */
+void
+inferior_event_handler (enum inferior_event_type event_type,
+ gdb_client_data client_data)
+{
+ switch (event_type)
+ {
+ case INF_ERROR:
+ printf_unfiltered ("error detected from target.\n");
+ target_async (NULL, 0);
+ pop_target ();
+ discard_all_continuations ();
+ do_exec_error_cleanups (ALL_CLEANUPS);
+ break;
+
+ case INF_REG_EVENT:
+ /* Use catch errors for now, until the inner layers of
+ fetch_inferior_event (i.e. readchar) can return meaningful
+ error status. If an error occurs while getting an event from
+ the target, just get rid of the target. */
+ if (!catch_errors (fetch_inferior_event_wrapper,
+ client_data, "", RETURN_MASK_ALL))
+ {
+ target_async (NULL, 0);
+ pop_target ();
+ discard_all_continuations ();
+ do_exec_error_cleanups (ALL_CLEANUPS);
+ display_gdb_prompt (0);
+ }
+ break;
+
+ case INF_EXEC_COMPLETE:
+ /* Is there anything left to do for the command issued to
+ complete? */
+ do_all_continuations ();
+ /* Reset things after target has stopped for the async commands. */
+ complete_execution ();
+ break;
+
+ case INF_EXEC_CONTINUE:
+ /* Is there anything left to do for the command issued to
+ complete? */
+ do_all_intermediate_continuations ();
+ break;
+
+ case INF_QUIT_REQ:
+ /* FIXME: ezannoni 1999-10-04. This call should really be a
+ target vector entry, so that it can be used for any kind of
+ targets. */
+ async_remote_interrupt_twice (NULL);
+ break;
+
+ case INF_TIMER:
+ default:
+ printf_unfiltered ("Event type not recognized.\n");
+ break;
+ }
+}
+
+static int
+fetch_inferior_event_wrapper (gdb_client_data client_data)
+{
+ fetch_inferior_event (client_data);
+ return 1;
+}
+
+/* Reset proper settings after an asynchronous command has finished.
+ If the execution command was in synchronous mode, register stdin
+ with the event loop, and reset the prompt. */
+
+static void
+complete_execution (void)
+{
+ target_executing = 0;
+
+ /* Unregister the inferior from the event loop. This is done so that
+ when the inferior is not running we don't get distracted by
+ spurious inferior output. */
+ target_async (NULL, 0);
+
+ if (sync_execution)
+ {
+ do_exec_error_cleanups (ALL_CLEANUPS);
+ display_gdb_prompt (0);
+ }
+ else
+ {
+ if (exec_done_display_p)
+ printf_unfiltered ("completed.\n");
+ }
+}
diff --git a/contrib/gdb/gdb/inf-loop.h b/contrib/gdb/gdb/inf-loop.h
new file mode 100644
index 0000000..9f1713c
--- /dev/null
+++ b/contrib/gdb/gdb/inf-loop.h
@@ -0,0 +1,29 @@
+/* Interface to the inferior event handling code for GDB, the GNU debugger.
+ Copyright 1999 Free Software Foundation, Inc.
+ Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 INF_LOOP_H
+#define INF_LOOP_H
+
+extern void inferior_event_handler (enum inferior_event_type event_type,
+ void* client_data);
+extern void inferior_event_handler_wrapper (void *client_data);
+
+#endif /* #ifndef INF_LOOP_H */
diff --git a/contrib/gdb/gdb/infcmd.c b/contrib/gdb/gdb/infcmd.c
index 4add1f0..0238448 100644
--- a/contrib/gdb/gdb/infcmd.c
+++ b/contrib/gdb/gdb/infcmd.c
@@ -1,22 +1,24 @@
/* Memory-access and commands for "inferior" process, for GDB.
- Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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>
@@ -28,75 +30,88 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "environ.h"
#include "value.h"
#include "gdbcmd.h"
+#include "symfile.h"
#include "gdbcore.h"
#include "target.h"
#include "language.h"
#include "symfile.h"
#include "objfiles.h"
+#include "completer.h"
+#include "ui-out.h"
+#include "event-top.h"
+#include "parser-defs.h"
/* Functions exported for general use: */
-void nofp_registers_info PARAMS ((char *, int));
+void nofp_registers_info (char *, int);
-void all_registers_info PARAMS ((char *, int));
+void all_registers_info (char *, int);
-void registers_info PARAMS ((char *, int));
+void registers_info (char *, int);
/* Local functions: */
-void continue_command PARAMS ((char *, int));
+void continue_command (char *, int);
-static void until_next_command PARAMS ((int));
+static void print_return_value (int struct_return, struct type *value_type);
-static void until_command PARAMS ((char *, int));
+static void finish_command_continuation (struct continuation_arg *);
-static void path_info PARAMS ((char *, int));
+static void until_next_command (int);
-static void path_command PARAMS ((char *, int));
+static void until_command (char *, int);
-static void unset_command PARAMS ((char *, int));
+static void path_info (char *, int);
-static void float_info PARAMS ((char *, int));
+static void path_command (char *, int);
-static void detach_command PARAMS ((char *, int));
+static void unset_command (char *, int);
-#if !defined (DO_REGISTERS_INFO)
-static void do_registers_info PARAMS ((int, int));
-#endif
+static void float_info (char *, int);
+
+static void detach_command (char *, int);
+
+static void interrupt_target_command (char *args, int from_tty);
+
+static void unset_environment_command (char *, int);
+
+static void set_environment_command (char *, int);
-static void unset_environment_command PARAMS ((char *, int));
+static void environment_info (char *, int);
-static void set_environment_command PARAMS ((char *, int));
+static void program_info (char *, int);
-static void environment_info PARAMS ((char *, int));
+static void finish_command (char *, int);
-static void program_info PARAMS ((char *, int));
+static void signal_command (char *, int);
-static void finish_command PARAMS ((char *, int));
+static void jump_command (char *, int);
-static void signal_command PARAMS ((char *, int));
+static void step_1 (int, int, char *);
+static void step_once (int skip_subroutines, int single_inst, int count);
+static void step_1_continuation (struct continuation_arg *arg);
-static void jump_command PARAMS ((char *, int));
+void nexti_command (char *, int);
-static void step_1 PARAMS ((int, int, char *));
+void stepi_command (char *, int);
-void nexti_command PARAMS ((char *, int));
+static void next_command (char *, int);
-void stepi_command PARAMS ((char *, int));
+static void step_command (char *, int);
-static void next_command PARAMS ((char *, int));
+static void run_command (char *, int);
-static void step_command PARAMS ((char *, int));
+static void run_no_args_command (char *args, int from_tty);
-static void run_command PARAMS ((char *, int));
+static void go_command (char *line_no, int from_tty);
-void _initialize_infcmd PARAMS ((void));
+static int strip_bg_char (char **);
+
+void _initialize_infcmd (void);
#define GO_USAGE "Usage: go <location>\n"
-#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
-static void breakpoint_auto_delete_contents PARAMS ((PTR));
-#endif
+static void breakpoint_auto_delete_contents (PTR);
#define ERROR_NO_INFERIOR \
if (!target_has_execution) error ("The program is not being run.");
@@ -106,6 +121,12 @@ static void breakpoint_auto_delete_contents PARAMS ((PTR));
static char *inferior_args;
+/* The inferior arguments as a vector. If INFERIOR_ARGC is nonzero,
+ then we must compute INFERIOR_ARGS from this (via the target). */
+
+static int inferior_argc;
+static char **inferior_argv;
+
/* File name for default use for standard in/out in the inferior. */
char *inferior_io_terminal;
@@ -115,7 +136,7 @@ char *inferior_io_terminal;
being debugged it should be nonzero (currently 3 is used) for remote
debugging. */
-int inferior_pid;
+ptid_t inferior_ptid;
/* Last signal that the inferior received (why it stopped). */
@@ -151,8 +172,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,
@@ -164,11 +185,7 @@ CORE_ADDR step_frame_address;
CORE_ADDR step_sp;
-/* 1 means step over all subroutine calls.
- 0 means don't step over calls (used by stepi).
- -1 means step over calls to undebuggable functions. */
-
-int step_over_calls;
+enum step_over_calls_kind step_over_calls;
/* If stepping, nonzero means step count is > 1
so don't print frame next time inferior stops
@@ -180,13 +197,169 @@ int step_multi;
in format described in environ.h. */
struct environ *inferior_environ;
+
+/* Accessor routines. */
+
+char *
+get_inferior_args (void)
+{
+ if (inferior_argc != 0)
+ {
+ char *n, *old;
+
+ n = gdbarch_construct_inferior_arguments (current_gdbarch,
+ inferior_argc, inferior_argv);
+ old = set_inferior_args (n);
+ xfree (old);
+ }
+
+ if (inferior_args == NULL)
+ inferior_args = xstrdup ("");
+
+ return inferior_args;
+}
+
+char *
+set_inferior_args (char *newargs)
+{
+ char *saved_args = inferior_args;
+
+ inferior_args = newargs;
+ inferior_argc = 0;
+ inferior_argv = 0;
+
+ return saved_args;
+}
+
+void
+set_inferior_args_vector (int argc, char **argv)
+{
+ inferior_argc = argc;
+ inferior_argv = argv;
+}
+
+/* Notice when `set args' is run. */
+static void
+notice_args_set (char *args, int from_tty, struct cmd_list_element *c)
+{
+ inferior_argc = 0;
+ inferior_argv = 0;
+}
+
+/* Notice when `show args' is run. */
+static void
+notice_args_read (char *args, int from_tty, struct cmd_list_element *c)
+{
+ /* Might compute the value. */
+ get_inferior_args ();
+}
+/* Compute command-line string given argument vector. This does the
+ same shell processing as fork_inferior. */
+/* ARGSUSED */
+char *
+construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
+{
+ char *result;
+
+ if (STARTUP_WITH_SHELL)
+ {
+ /* This holds all the characters considered special to the
+ typical Unix shells. We include `^' because the SunOS
+ /bin/sh treats it as a synonym for `|'. */
+ char *special = "\"!#$&*()\\|[]{}<>?'\"`~^; \t\n";
+ int i;
+ int length = 0;
+ char *out, *cp;
+
+ /* We over-compute the size. It shouldn't matter. */
+ for (i = 0; i < argc; ++i)
+ length += 2 * strlen (argv[i]) + 1;
+
+ result = (char *) xmalloc (length);
+ out = result;
+
+ for (i = 0; i < argc; ++i)
+ {
+ if (i > 0)
+ *out++ = ' ';
+
+ for (cp = argv[i]; *cp; ++cp)
+ {
+ if (strchr (special, *cp) != NULL)
+ *out++ = '\\';
+ *out++ = *cp;
+ }
+ }
+ *out = '\0';
+ }
+ else
+ {
+ /* In this case we can't handle arguments that contain spaces,
+ tabs, or newlines -- see breakup_args(). */
+ int i;
+ int length = 0;
+
+ for (i = 0; i < argc; ++i)
+ {
+ char *cp = strchr (argv[i], ' ');
+ if (cp == NULL)
+ cp = strchr (argv[i], '\t');
+ if (cp == NULL)
+ cp = strchr (argv[i], '\n');
+ if (cp != NULL)
+ error ("can't handle command-line argument containing whitespace");
+ length += strlen (argv[i]) + 1;
+ }
+
+ result = (char *) xmalloc (length);
+ result[0] = '\0';
+ for (i = 0; i < argc; ++i)
+ {
+ if (i > 0)
+ strcat (result, " ");
+ strcat (result, argv[i]);
+ }
+ }
+
+ return result;
+}
+
+
+/* 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
+strip_bg_char (char **args)
+{
+ char *p = NULL;
+
+ p = strchr (*args, '&');
+
+ if (p)
+ {
+ if (p == (*args + strlen (*args) - 1))
+ {
+ if (strlen (*args) > 1)
+ {
+ do
+ p--;
+ while (*p == ' ' || *p == '\t');
+ *(p + 1) = '\0';
+ }
+ else
+ *args = 0;
+ return 1;
+ }
+ }
+ return 0;
+}
+
/* ARGSUSED */
void
-tty_command (file, from_tty)
- char *file;
- int from_tty;
+tty_command (char *file, int from_tty)
{
if (file == 0)
error_no_arg ("terminal name for running target process");
@@ -195,18 +368,16 @@ tty_command (file, from_tty)
}
static void
-run_command (args, from_tty)
- char *args;
- int from_tty;
+run_command (char *args, int from_tty)
{
char *exec_file;
dont_repeat ();
- if (inferior_pid != 0 && target_has_execution)
+ if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
- if (
- !query ("The program being debugged has been started already.\n\
+ if (from_tty
+ && !query ("The program being debugged has been started already.\n\
Start it from the beginning? "))
error ("Program not restarted.");
target_kill ();
@@ -218,17 +389,23 @@ Start it from the beginning? "))
clear_breakpoint_hit_counts ();
- exec_file = (char *) get_exec_file (0);
-
/* Purge old solib objfiles. */
objfile_purge_solibs ();
do_run_cleanups (NULL);
- /* The exec file is re-read every time we do a generic_mourn_inferior, so
- we just have to worry about the symbol file. */
+ /* The comment here used to read, "The exec file is re-read every
+ time we do a generic_mourn_inferior, so we just have to worry
+ about the symbol file." The `generic_mourn_inferior' function
+ gets called whenever the program exits. However, suppose the
+ program exits, and *then* the executable file changes? We need
+ to check again here. Since reopen_exec_file doesn't do anything
+ if the timestamp hasn't changed, I don't see the harm. */
+ reopen_exec_file ();
reread_symbols ();
+ exec_file = (char *) get_exec_file (0);
+
/* We keep symbols from add-symbol-file, on the grounds that the
user might want to add some symbols before running the program
(right?). But sometimes (dynamic loading where the user manually
@@ -237,49 +414,90 @@ Start it from the beginning? "))
the user has to manually nuke all symbols between runs if they
want them to go away (PR 2207). This is probably reasonable. */
- if (args)
+ if (!args)
+ {
+ if (event_loop_p && target_can_async_p ())
+ async_disable_stdin ();
+ }
+ else
{
- char *cmd;
- cmd = concat ("set args ", args, NULL);
- make_cleanup (free, cmd);
- execute_command (cmd, from_tty);
+ int async_exec = strip_bg_char (&args);
+
+ /* If we get a request for running in the bg but the target
+ doesn't support it, error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ 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. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
+ /* If there were other args, beside '&', process them. */
+ if (args)
+ {
+ char *old_args = set_inferior_args (xstrdup (args));
+ xfree (old_args);
+ }
}
if (from_tty)
{
- puts_filtered("Starting program: ");
+ ui_out_field_string (uiout, NULL, "Starting program");
+ ui_out_text (uiout, ": ");
if (exec_file)
- puts_filtered(exec_file);
- puts_filtered(" ");
- puts_filtered(inferior_args);
- puts_filtered("\n");
- gdb_flush (gdb_stdout);
+ ui_out_field_string (uiout, "execfile", exec_file);
+ ui_out_spaces (uiout, 1);
+ /* We call get_inferior_args() because we might need to compute
+ the value now. */
+ ui_out_field_string (uiout, "infargs", get_inferior_args ());
+ ui_out_text (uiout, "\n");
+ ui_out_flush (uiout);
}
- target_create_inferior (exec_file, inferior_args,
+ /* We call get_inferior_args() because we might need to compute
+ the value now. */
+ target_create_inferior (exec_file, get_inferior_args (),
environ_vector (inferior_environ));
}
static void
-run_no_args_command (args, from_tty)
- char *args;
- int from_tty;
+run_no_args_command (char *args, int from_tty)
{
- execute_command("set args", from_tty);
- run_command((char *)NULL, from_tty);
+ char *old_args = set_inferior_args (xstrdup (""));
+ xfree (old_args);
}
-
+
void
-continue_command (proc_count_exp, from_tty)
- char *proc_count_exp;
- int from_tty;
+continue_command (char *proc_count_exp, int from_tty)
{
+ int async_exec = 0;
ERROR_NO_INFERIOR;
- /* If have argument, set proceed count of breakpoint we stopped at. */
+ /* Find out whether we must run in the background. */
+ if (proc_count_exp != NULL)
+ async_exec = strip_bg_char (&proc_count_exp);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
+ /* If have argument (besides '&'), set proceed count of breakpoint
+ we stopped at. */
if (proc_count_exp != NULL)
{
bpstat bs = stop_bpstat;
@@ -292,7 +510,7 @@ continue_command (proc_count_exp, from_tty)
while (num != 0)
{
set_ignore_count (num,
- parse_and_eval_address (proc_count_exp) - 1,
+ parse_and_eval_long (proc_count_exp) - 1,
from_tty);
/* set_ignore_count prints a message ending with a period.
So print two spaces before "Continuing.". */
@@ -314,9 +532,7 @@ continue_command (proc_count_exp, from_tty)
/* ARGSUSED */
static void
-step_command (count_string, from_tty)
- char *count_string;
- int from_tty;
+step_command (char *count_string, int from_tty)
{
step_1 (0, 0, count_string);
}
@@ -325,9 +541,7 @@ step_command (count_string, from_tty)
/* ARGSUSED */
static void
-next_command (count_string, from_tty)
- char *count_string;
- int from_tty;
+next_command (char *count_string, int from_tty)
{
step_1 (1, 0, count_string);
}
@@ -336,56 +550,199 @@ next_command (count_string, from_tty)
/* ARGSUSED */
void
-stepi_command (count_string, from_tty)
- char *count_string;
- int from_tty;
+stepi_command (char *count_string, int from_tty)
{
step_1 (0, 1, count_string);
}
/* ARGSUSED */
void
-nexti_command (count_string, from_tty)
- char *count_string;
- int from_tty;
+nexti_command (char *count_string, int from_tty)
{
step_1 (1, 1, count_string);
}
static void
-step_1 (skip_subroutines, single_inst, count_string)
- int skip_subroutines;
- int single_inst;
- char *count_string;
+disable_longjmp_breakpoint_cleanup (void *ignore)
+{
+ disable_longjmp_breakpoint ();
+}
+
+static void
+step_1 (int skip_subroutines, int single_inst, char *count_string)
{
register int count = 1;
struct frame_info *frame;
struct cleanup *cleanups = 0;
+ int async_exec = 0;
ERROR_NO_INFERIOR;
- count = count_string ? parse_and_eval_address (count_string) : 1;
- if (!single_inst || skip_subroutines) /* leave si command alone */
+ 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 (event_loop_p && async_exec && !target_can_async_p ())
+ 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. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
{
- enable_longjmp_breakpoint();
- cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint,
- 0);
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
}
- for (; count > 0; count--)
+ count = count_string ? parse_and_eval_long (count_string) : 1;
+
+ if (!single_inst || skip_subroutines) /* leave si command alone */
+ {
+ enable_longjmp_breakpoint ();
+ if (!event_loop_p || !target_can_async_p ())
+ cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/);
+ else
+ make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/);
+ }
+
+ /* In synchronous case, all is well, just use the regular for loop. */
+ if (!event_loop_p || !target_can_async_p ())
+ {
+ for (; count > 0; count--)
+ {
+ clear_proceed_status ();
+
+ frame = get_current_frame ();
+ if (!frame) /* Avoid coredump here. Why tho? */
+ error ("No current frame");
+ step_frame_address = FRAME_FP (frame);
+ step_sp = read_sp ();
+
+ if (!single_inst)
+ {
+ find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
+ if (step_range_end == 0)
+ {
+ char *name;
+ if (find_pc_partial_function (stop_pc, &name, &step_range_start,
+ &step_range_end) == 0)
+ error ("Cannot find bounds of current function");
+
+ target_terminal_ours ();
+ printf_filtered ("\
+Single stepping until exit from function %s, \n\
+which has no line number information.\n", name);
+ }
+ }
+ else
+ {
+ /* Say we are stepping, but stop after one insn whatever it does. */
+ step_range_start = step_range_end = 1;
+ if (!skip_subroutines)
+ /* It is stepi.
+ Don't step over function calls, not even to functions lacking
+ line numbers. */
+ step_over_calls = STEP_OVER_NONE;
+ }
+
+ if (skip_subroutines)
+ step_over_calls = STEP_OVER_ALL;
+
+ step_multi = (count > 1);
+ 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). */
+#if defined (SHIFT_INST_REGS)
+ SHIFT_INST_REGS ();
+#endif
+ }
+
+ if (!single_inst || skip_subroutines)
+ do_cleanups (cleanups);
+ return;
+ }
+ /* In case of asynchronous target things get complicated, do only
+ one step for now, before returning control to the event loop. Let
+ the continuation figure out how many other steps we need to do,
+ and handle them one at the time, through step_once(). */
+ else
+ {
+ if (event_loop_p && target_can_async_p ())
+ step_once (skip_subroutines, single_inst, count);
+ }
+}
+
+/* Called after we are done with one step operation, to check whether
+ we need to step again, before we print the prompt and return control
+ to the user. If count is > 1, we will need to do one more call to
+ proceed(), via step_once(). Basically it is like step_once and
+ step_1_continuation are co-recursive. */
+static void
+step_1_continuation (struct continuation_arg *arg)
+{
+ int count;
+ int skip_subroutines;
+ int single_inst;
+
+ skip_subroutines = arg->data.integer;
+ single_inst = arg->next->data.integer;
+ count = arg->next->next->data.integer;
+
+ if (stop_step)
+ {
+ /* 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). */
+#if defined (SHIFT_INST_REGS)
+ SHIFT_INST_REGS ();
+#endif
+ step_once (skip_subroutines, single_inst, count - 1);
+ }
+ else
+ if (!single_inst || skip_subroutines)
+ do_exec_cleanups (ALL_CLEANUPS);
+}
+
+/* Do just one step operation. If count >1 we will have to set up a
+ continuation to be done after the target stops (after this one
+ step). This is useful to implement the 'step n' kind of commands, in
+ case of asynchronous targets. We had to split step_1 into two parts,
+ one to be done before proceed() and one afterwards. This function is
+ called in case of step n with n>1, after the first step operation has
+ been completed.*/
+static void
+step_once (int skip_subroutines, int single_inst, int count)
+{
+ struct continuation_arg *arg1;
+ struct continuation_arg *arg2;
+ struct continuation_arg *arg3;
+ struct frame_info *frame;
+
+ if (count > 0)
{
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)
+
+ /* If we have no line info, switch to stepi mode. */
+ if (step_range_end == 0 && step_stop_if_no_debug)
+ {
+ step_range_start = step_range_end = 1;
+ }
+ else if (step_range_end == 0)
{
char *name;
if (find_pc_partial_function (stop_pc, &name, &step_range_start,
@@ -406,44 +763,62 @@ which has no line number information.\n", name);
/* It is stepi.
Don't step over function calls, not even to functions lacking
line numbers. */
- step_over_calls = 0;
+ step_over_calls = STEP_OVER_NONE;
}
if (skip_subroutines)
- step_over_calls = 1;
+ step_over_calls = STEP_OVER_ALL;
step_multi = (count > 1);
+ arg1 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg2 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg3 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg1->next = arg2;
+ arg1->data.integer = skip_subroutines;
+ arg2->next = arg3;
+ arg2->data.integer = single_inst;
+ arg3->next = NULL;
+ arg3->data.integer = count;
+ add_intermediate_continuation (step_1_continuation, arg1);
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). */
-#if defined (SHIFT_INST_REGS)
- SHIFT_INST_REGS();
-#endif
}
-
- if (!single_inst || skip_subroutines)
- do_cleanups(cleanups);
}
+
/* Continue program at specified address. */
static void
-jump_command (arg, from_tty)
- char *arg;
- int from_tty;
+jump_command (char *arg, int from_tty)
{
register CORE_ADDR addr;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct symbol *fn;
struct symbol *sfn;
+ int async_exec = 0;
ERROR_NO_INFERIOR;
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
if (!arg)
error_no_arg ("starting address");
@@ -454,12 +829,12 @@ jump_command (arg, from_tty)
}
sal = sals.sals[0];
- free ((PTR)sals.sals);
+ xfree (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 ());
@@ -474,10 +849,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? "))
@@ -488,7 +863,6 @@ jump_command (arg, from_tty)
}
}
-
addr = sal.pc;
if (from_tty)
@@ -501,30 +875,26 @@ jump_command (arg, from_tty)
clear_proceed_status ();
proceed (addr, TARGET_SIGNAL_0, 0);
}
-
+
/* Go to line or address in current procedure */
static void
-go_command(line_no, from_tty)
- char *line_no;
- int from_tty;
+go_command (char *line_no, int from_tty)
{
- if (line_no == (char *)NULL || !*line_no)
- printf_filtered(GO_USAGE);
+ if (line_no == (char *) NULL || !*line_no)
+ printf_filtered (GO_USAGE);
else
{
- tbreak_command(line_no, from_tty);
- jump_command(line_no, from_tty);
+ tbreak_command (line_no, from_tty);
+ jump_command (line_no, from_tty);
}
}
-
+
/* Continue program giving it specified signal. */
static void
-signal_command (signum_exp, from_tty)
- char *signum_exp;
- int from_tty;
+signal_command (char *signum_exp, int from_tty)
{
enum target_signal oursig;
@@ -542,7 +912,7 @@ signal_command (signum_exp, from_tty)
if (oursig == TARGET_SIGNAL_UNKNOWN)
{
/* No, try numeric. */
- int num = parse_and_eval_address (signum_exp);
+ int num = parse_and_eval_long (signum_exp);
if (num == 0)
oursig = TARGET_SIGNAL_0;
@@ -570,16 +940,12 @@ signal_command (signum_exp, from_tty)
/* Call breakpoint_auto_delete on the current contents of the bpstat
pointed to by arg (which is really a bpstat *). */
-#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
-
static void
-breakpoint_auto_delete_contents (arg)
- PTR arg;
+breakpoint_auto_delete_contents (PTR arg)
{
- breakpoint_auto_delete (*(bpstat *)arg);
+ breakpoint_auto_delete (*(bpstat *) arg);
}
-#endif /* CALL_DUMMY_BREAKPOINT_OFFSET */
/* Execute a "stack dummy", a piece of code stored in the stack
by the debugger to be executed in the inferior.
@@ -594,78 +960,90 @@ breakpoint_auto_delete_contents (arg)
The dummy's frame is automatically popped whenever that break is hit.
If that is the first time the program stops, run_stack_dummy
returns to its caller with that frame already gone and returns 0.
- Otherwise, run_stack-dummy returns 1 (the frame will eventually be popped
- when we do hit that breakpoint). */
-
-/* DEBUG HOOK: 4 => return instead of letting the stack dummy run. */
-
-static int stack_dummy_testing = 0;
+
+ Otherwise, run_stack-dummy returns a non-zero value.
+ If the called function receives a random signal, we do not allow the user
+ to continue executing it as this may not work. The dummy frame is poped
+ and we return 1.
+ If we hit a breakpoint, we leave the frame in place and return 2 (the frame
+ will eventually be popped when we do hit the dummy end breakpoint). */
int
-run_stack_dummy (addr, buffer)
- CORE_ADDR addr;
- char buffer[REGISTER_BYTES];
+run_stack_dummy (CORE_ADDR addr, char *buffer)
{
struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
+ int saved_async = 0;
/* Now proceed, having reached the desired place. */
clear_proceed_status ();
- if (stack_dummy_testing & 4)
+
+ if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
{
- POP_FRAME;
- return(0);
+ struct breakpoint *bpt;
+ struct symtab_and_line sal;
+
+ INIT_SAL (&sal); /* initialize to zeroes */
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ sal.pc = CALL_DUMMY_ADDRESS ();
+ }
+ else
+ {
+ sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
+ }
+ sal.section = find_pc_overlay (sal.pc);
+
+ /* Set up a FRAME for the dummy frame so we can pass it to
+ set_momentary_breakpoint. We need to give the breakpoint a
+ frame in case there is only one copy of the dummy (e.g.
+ CALL_DUMMY_LOCATION == AFTER_TEXT_END). */
+ flush_cached_frames ();
+ set_current_frame (create_new_frame (read_fp (), sal.pc));
+
+ /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put
+ a breakpoint instruction. If not, the call dummy already has the
+ breakpoint instruction in it.
+
+ addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
+ so we need to subtract the CALL_DUMMY_START_OFFSET. */
+ bpt = set_momentary_breakpoint (sal,
+ get_current_frame (),
+ bp_call_dummy);
+ bpt->disposition = disp_del;
+
+ /* 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. */
+ make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
}
-#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
- {
- struct breakpoint *bpt;
- struct symtab_and_line sal;
-
- INIT_SAL (&sal); /* initialize to zeroes */
-#if CALL_DUMMY_LOCATION != AT_ENTRY_POINT
- sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
-#else
- sal.pc = CALL_DUMMY_ADDRESS ();
-#endif
- sal.section = find_pc_overlay (sal.pc);
-
- /* Set up a FRAME for the dummy frame so we can pass it to
- set_momentary_breakpoint. We need to give the breakpoint a
- frame in case there is only one copy of the dummy (e.g.
- CALL_DUMMY_LOCATION == AFTER_TEXT_END). */
- flush_cached_frames ();
- set_current_frame (create_new_frame (read_fp (), sal.pc));
-
- /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put
- a breakpoint instruction. If not, the call dummy already has the
- breakpoint instruction in it.
-
- addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
- so we need to subtract the CALL_DUMMY_START_OFFSET. */
- bpt = set_momentary_breakpoint (sal,
- get_current_frame (),
- bp_call_dummy);
- bpt->disposition = 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. */
- make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
- }
-#endif /* CALL_DUMMY_BREAKPOINT_OFFSET. */
disable_watchpoints_before_interactive_call_start ();
proceed_to_finish = 1; /* We want stop_registers, please... */
+
+ if (target_can_async_p ())
+ saved_async = target_async_mask (0);
+
proceed (addr, TARGET_SIGNAL_0, 0);
+
+ if (saved_async)
+ target_async_mask (saved_async);
+
enable_watchpoints_after_interactive_call_stop ();
discard_cleanups (old_cleanups);
- if (!stop_stack_dummy)
+ /* We can stop during an inferior call because a signal is received. */
+ if (stopped_by_random_signal)
return 1;
+
+ /* We may also stop prematurely because we hit a breakpoint in the
+ called routine. */
+ if (!stop_stack_dummy)
+ return 2;
- /* On return, the stack dummy has been popped already. */
+ /* On normal return, the stack dummy has been popped already. */
- memcpy (buffer, stop_registers, sizeof stop_registers);
+ memcpy (buffer, stop_registers, REGISTER_BYTES);
return 0;
}
@@ -679,14 +1057,13 @@ run_stack_dummy (addr, buffer)
/* ARGSUSED */
static void
-until_next_command (from_tty)
- int from_tty;
+until_next_command (int from_tty)
{
struct frame_info *frame;
CORE_ADDR pc;
struct symbol *func;
struct symtab_and_line sal;
-
+
clear_proceed_status ();
frame = get_current_frame ();
@@ -697,60 +1074,188 @@ 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_over_calls = STEP_OVER_ALL;
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);
}
-static void
-until_command (arg, from_tty)
- char *arg;
- int from_tty;
+static void
+until_command (char *arg, int from_tty)
{
+ int async_exec = 0;
+
if (!target_has_execution)
error ("The program is not running.");
+
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
if (arg)
until_break_command (arg, from_tty);
else
until_next_command (from_tty);
}
+
+/* Print the result of a function at the end of a 'finish' command. */
+static void
+print_return_value (int structure_return, struct type *value_type)
+{
+ struct value *value;
+ static struct ui_stream *stb = NULL;
+
+ if (!structure_return)
+ {
+ value = value_being_returned (value_type, stop_registers, structure_return);
+ stb = ui_out_stream_new (uiout);
+ ui_out_text (uiout, "Value returned is ");
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_text (uiout, " = ");
+ value_print (value, stb->stream, 0, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "return-value", stb);
+ ui_out_text (uiout, "\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
+ value = 0;
+ ui_out_text (uiout, "Value returned has type: ");
+ ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
+ ui_out_text (uiout, ".");
+ ui_out_text (uiout, " Cannot determine contents\n");
+#else
+ value = value_being_returned (value_type, stop_registers, structure_return);
+ stb = ui_out_stream_new (uiout);
+ ui_out_text (uiout, "Value returned is ");
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_text (uiout, " = ");
+ value_print (value, stb->stream, 0, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "return-value", stb);
+ ui_out_text (uiout, "\n");
+#endif
+ }
+}
+
+/* Stuff that needs to be done by the finish command after the target
+ has stopped. In asynchronous mode, we wait for the target to stop in
+ the call to poll or select in the event loop, so it is impossible to
+ do all the stuff as part of the finish_command function itself. The
+ only chance we have to complete this command is in
+ fetch_inferior_event, which is called by the event loop as soon as it
+ detects that the target has stopped. This function is called via the
+ cmd_continuation pointer. */
+void
+finish_command_continuation (struct continuation_arg *arg)
+{
+ register struct symbol *function;
+ struct breakpoint *breakpoint;
+ struct cleanup *cleanups;
+
+ breakpoint = (struct breakpoint *) arg->data.pointer;
+ function = (struct symbol *) arg->next->data.pointer;
+ cleanups = (struct cleanup *) arg->next->next->data.pointer;
+
+ if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
+ && function != 0)
+ {
+ struct type *value_type;
+ CORE_ADDR funcaddr;
+ int struct_return;
+
+ value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
+ if (!value_type)
+ internal_error (__FILE__, __LINE__,
+ "finish_command: function has no target type");
+
+ if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
+ {
+ do_exec_cleanups (cleanups);
+ 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)));
+
+ print_return_value (struct_return, value_type);
+ }
+ do_exec_cleanups (cleanups);
+}
+
/* "finish": Set a temporary breakpoint at the place
the selected frame will return to, then continue. */
static void
-finish_command (arg, from_tty)
- char *arg;
- int from_tty;
+finish_command (char *arg, int from_tty)
{
struct symtab_and_line sal;
register struct frame_info *frame;
register struct symbol *function;
struct breakpoint *breakpoint;
struct cleanup *old_chain;
+ struct continuation_arg *arg1, *arg2, *arg3;
+
+ int async_exec = 0;
+
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
if (arg)
error ("The \"finish\" command does not take any arguments.");
@@ -770,7 +1275,10 @@ finish_command (arg, from_tty)
breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
- old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ if (!event_loop_p || !target_can_async_p ())
+ old_chain = make_cleanup_delete_breakpoint (breakpoint);
+ else
+ old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
/* Find the function we will return from. */
@@ -784,73 +1292,74 @@ finish_command (arg, from_tty)
print_stack_frame (selected_frame, selected_frame_level, 0);
}
- proceed_to_finish = 1; /* We want stop_registers, please... */
+ /* If running asynchronously and the target support asynchronous
+ execution, set things up for the rest of the finish command to be
+ completed later on, when gdb has detected that the target has
+ stopped, in fetch_inferior_event. */
+ if (event_loop_p && target_can_async_p ())
+ {
+ arg1 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg2 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg3 =
+ (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+ arg1->next = arg2;
+ arg2->next = arg3;
+ arg3->next = NULL;
+ arg1->data.pointer = breakpoint;
+ arg2->data.pointer = function;
+ arg3->data.pointer = old_chain;
+ add_continuation (finish_command_continuation, arg1);
+ }
+
+ proceed_to_finish = 1; /* We want stop_registers, please... */
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
- /* Did we stop at our breakpoint? */
- if (bpstat_find_breakpoint(stop_bpstat, breakpoint) != NULL
- && function != 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 (!event_loop_p || !target_can_async_p ())
{
- 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");
-
- if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
- return;
+ /* Did we stop at our breakpoint? */
+ if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
+ && function != 0)
+ {
+ struct type *value_type;
+ CORE_ADDR funcaddr;
+ int struct_return;
- funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
+ value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
+ if (!value_type)
+ internal_error (__FILE__, __LINE__,
+ "finish_command: function has no target type");
- struct_return = using_struct_return (value_of_variable (function, NULL),
+ /* FIXME: Shouldn't we do the cleanups before returning? */
+ if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
+ return;
- 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
- {
- /* elz: 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");
-#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
-
- }
+ 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)));
+
+ print_return_value (struct_return, value_type);
+ }
+ do_cleanups (old_chain);
}
- do_cleanups(old_chain);
}
/* ARGSUSED */
static void
-program_info (args, from_tty)
- char *args;
- int from_tty;
+program_info (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");
@@ -859,13 +1368,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)
@@ -893,9 +1402,7 @@ program_info (args, from_tty)
}
static void
-environment_info (var, from_tty)
- char *var;
- int from_tty;
+environment_info (char *var, int from_tty)
{
if (var)
{
@@ -926,9 +1433,7 @@ environment_info (var, from_tty)
}
static void
-set_environment_command (arg, from_tty)
- char *arg;
- int from_tty;
+set_environment_command (char *arg, int from_tty)
{
register char *p, *val, *var;
int nullset = 0;
@@ -943,14 +1448,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;
}
@@ -974,7 +1479,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)
@@ -985,18 +1491,16 @@ set_environment_command (arg, from_tty)
}
else
set_in_environ (inferior_environ, var, val);
- free (var);
+ xfree (var);
}
static void
-unset_environment_command (var, from_tty)
- char *var;
- int from_tty;
+unset_environment_command (char *var, int 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);
@@ -1013,9 +1517,7 @@ static const char path_var_name[] = "PATH";
/* ARGSUSED */
static void
-path_info (args, from_tty)
- char *args;
- int from_tty;
+path_info (char *args, int from_tty)
{
puts_filtered ("Executable and object file path: ");
puts_filtered (get_in_environ (inferior_environ, path_var_name));
@@ -1025,9 +1527,7 @@ path_info (args, from_tty)
/* Add zero or more directories to the front of the execution path. */
static void
-path_command (dirname, from_tty)
- char *dirname;
- int from_tty;
+path_command (char *dirname, int from_tty)
{
char *exec_path;
char *env;
@@ -1036,15 +1536,15 @@ path_command (dirname, from_tty)
/* Can be null if path is not set */
if (!env)
env = "";
- exec_path = strsave (env);
+ exec_path = xstrdup (env);
mod_path (dirname, &exec_path);
set_in_environ (inferior_environ, path_var_name, exec_path);
- free (exec_path);
+ xfree (exec_path);
if (from_tty)
- path_info ((char *)NULL, from_tty);
+ path_info ((char *) NULL, from_tty);
}
-
+
#ifdef REGISTER_NAMES
char *gdb_register_names[] = REGISTER_NAMES;
#endif
@@ -1057,36 +1557,32 @@ 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. */
-
-#if !defined (DO_REGISTERS_INFO)
-
-#define DO_REGISTERS_INFO(regnum, fp) do_registers_info(regnum, fp)
+ to provide that format. */
-static void
-do_registers_info (regnum, fpregs)
- int regnum;
- int fpregs;
+void
+do_registers_info (int regnum, int fpregs)
{
register int i;
- int numregs = ARCH_NUM_REGS;
+ int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
for (i = 0; i < numregs; i++)
{
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
- 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;
@@ -1101,51 +1597,34 @@ do_registers_info (regnum, fpregs)
}
/* Convert raw data to virtual format if necessary. */
-#ifdef REGISTER_CONVERTIBLE
if (REGISTER_CONVERTIBLE (i))
{
REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
raw_buffer, virtual_buffer);
}
else
-#endif
- memcpy (virtual_buffer, raw_buffer,
- REGISTER_VIRTUAL_SIZE (i));
+ {
+ memcpy (virtual_buffer, raw_buffer,
+ REGISTER_VIRTUAL_SIZE (i));
+ }
/* If virtual format is floating, print it that way, and in raw hex. */
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
{
register int j;
-#ifdef INVALID_FLOAT
- if (INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
- printf_filtered ("<invalid float>");
- else
-#endif
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ gdb_stdout, 0, 1, 0, Val_pretty_default);
printf_filtered ("\t(raw 0x");
for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
{
- register int idx = TARGET_BYTE_ORDER == BIG_ENDIAN ? j
- : REGISTER_RAW_SIZE (i) - 1 - j;
- printf_filtered ("%02x", (unsigned char)raw_buffer[idx]);
+ register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
+ : REGISTER_RAW_SIZE (i) - 1 - j;
+ printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
}
printf_filtered (")");
}
-
-/* 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. */
- 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]);
- }
/* Else print as integer in hex and in decimal. */
else
{
@@ -1153,11 +1632,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
@@ -1165,14 +1644,9 @@ do_registers_info (regnum, fpregs)
printf_filtered ("\n");
}
}
-#endif /* no DO_REGISTERS_INFO. */
-
-extern int target_map_name_to_register PARAMS ((char *, int));
void
-registers_info (addr_exp, fpregs)
- char *addr_exp;
- int fpregs;
+registers_info (char *addr_exp, int fpregs)
{
int regnum, numregs;
register char *end;
@@ -1184,56 +1658,53 @@ 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;
while (*end != '\0' && *end != ' ' && *end != '\t')
++end;
- numregs = ARCH_NUM_REGS;
+ numregs = NUM_REGS + NUM_PSEUDO_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
-all_registers_info (addr_exp, from_tty)
- char *addr_exp;
- int from_tty;
+all_registers_info (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 1);
}
void
-nofp_registers_info (addr_exp, from_tty)
- char *addr_exp;
- int from_tty;
+nofp_registers_info (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 0);
}
-
+
/*
* TODO:
* Should save/restore the tty state since it might be that the
@@ -1251,18 +1722,12 @@ nofp_registers_info (addr_exp, from_tty)
and wait for the trace-trap that results from attaching. */
void
-attach_command (args, from_tty)
- char *args;
- int from_tty;
+attach_command (char *args, int from_tty)
{
-#ifdef SOLIB_ADD
- 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)
{
@@ -1285,11 +1750,11 @@ attach_command (args, from_tty)
wait_for_inferior as soon as the target reports a stop. */
init_wait_for_inferior ();
clear_proceed_status ();
- stop_soon_quietly = 1;
/* No traps are generated when attaching to inferior under Mach 3
or GNU hurd. */
#ifndef ATTACH_NO_WAIT
+ stop_soon_quietly = 1;
wait_for_inferior ();
#endif
@@ -1298,39 +1763,41 @@ 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 (PIDGET (inferior_ptid));
+ 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_add_main (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);
- re_enable_breakpoints_in_shlibs ();
- }
+ /* Add shared library symbols from the newly attached process, if any. */
+ SOLIB_ADD ((char *) 0, from_tty, &current_target, auto_solib_add);
+ re_enable_breakpoints_in_shlibs ();
#endif
/* Take any necessary post-attaching actions for this platform.
- */
- target_post_attach (inferior_pid);
+ */
+ target_post_attach (PIDGET (inferior_ptid));
normal_stop ();
+
+ if (attach_hook)
+ attach_hook ();
}
/*
@@ -1345,35 +1812,46 @@ attach_command (args, from_tty)
*/
static void
-detach_command (args, from_tty)
- char *args;
- int from_tty;
+detach_command (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 ();
#endif
+ if (detach_hook)
+ detach_hook ();
+}
+
+/* Stop the execution of the target while running in async mode, in
+ the backgound. */
+
+void
+interrupt_target_command_wrapper (char *args, int from_tty)
+{
+ interrupt_target_command (args, from_tty);
+}
+
+static void
+interrupt_target_command (char *args, int from_tty)
+{
+ if (event_loop_p && target_can_async_p ())
+ {
+ dont_repeat (); /* Not for the faint of heart */
+ target_stop ();
+ }
}
/* ARGSUSED */
static void
-float_info (addr_exp, from_tty)
- char *addr_exp;
- int from_tty;
+float_info (char *addr_exp, int from_tty)
{
-#ifdef FLOAT_INFO
- FLOAT_INFO;
-#else
- printf_filtered ("No floating point info available for this processor.\n");
-#endif
+ PRINT_FLOAT_INFO ();
}
/* ARGSUSED */
static void
-unset_command (args, from_tty)
- char *args;
- int from_tty;
+unset_command (char *args, int from_tty)
{
printf_filtered ("\"unset\" must be followed by the name of ");
printf_filtered ("an unset subcommand.\n");
@@ -1381,20 +1859,23 @@ unset_command (args, from_tty)
}
void
-_initialize_infcmd ()
+_initialize_infcmd (void)
{
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\
+
+ c = add_com ("tty", class_run, tty_command,
+ "Set terminal for future runs of program being debugged.");
+ c->completer = filename_completer;
+
+ c = 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);
+ &setlist);
+ c->completer = filename_completer;
+ set_cmd_sfunc (c, notice_args_set);
+ c = add_show_from_set (c, &showlist);
+ set_cmd_sfunc (c, notice_args_read);
c = add_cmd
("environment", no_class, environment_info,
@@ -1407,11 +1888,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,
@@ -1419,18 +1900,19 @@ 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\
+
+ c = add_com ("path", class_files, path_command,
+ "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->completer = filename_completer;
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\
@@ -1438,8 +1920,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\
@@ -1481,33 +1963,40 @@ 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\
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\
+ c = add_com ("until", class_run, until_command,
+ "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.");
+ c->completer = location_completer;
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\
+
+ c = 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\
for an address to start at.");
+ c->completer = location_completer;
- add_com ("go", class_run, go_command,
- "Usage: go <location>\n\
+ if (xdb_commands)
+ {
+ c = add_com ("go", class_run, go_command,
+ "Usage: go <location>\n\
Continue program being debugged, stopping at specified line or \n\
address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an \n\
expression for an address to start at.\n\
This command is a combination of tbreak and jump.");
+ c->completer = location_completer;
+ }
+
if (xdb_commands)
- add_com_alias("g", "g", 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\
@@ -1517,28 +2006,33 @@ the breakpoint won't break until the Nth time it is reached).");
add_com_alias ("c", "cont", class_run, 1);
add_com_alias ("fg", "cont", class_run, 1);
- add_com ("run", class_run, run_command,
+ c = add_com ("run", class_run, run_command,
"Start debugged program. You may specify arguments to give it.\n\
Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
To cancel previous arguments and run with no arguments,\n\
use \"set args\" without arguments.");
+ c->completer = filename_completer;
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.");
+ add_info_alias ("r", "registers", 1);
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,
@@ -1547,7 +2041,6 @@ Register name as argument means describe only that register.");
add_info ("float", float_info,
"Print the status of the floating point unit\n");
- inferior_args = savestring ("", 1); /* Initially no args */
inferior_environ = make_environ ();
init_environ (inferior_environ);
}
diff --git a/contrib/gdb/gdb/inferior.h b/contrib/gdb/gdb/inferior.h
index fa59c2a..93c8d9b 100644
--- a/contrib/gdb/gdb/inferior.h
+++ b/contrib/gdb/gdb/inferior.h
@@ -1,22 +1,24 @@
/* Variables that describe the inferior process running under GDB:
Where it is, why it stopped, and how to step it.
- Copyright 1986, 1989, 1992, 1996, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -27,79 +29,96 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* For enum target_signal. */
#include "target.h"
-/* Structure in which to save the status of the inferior. Save
+/* Structure in which to save the status of the inferior. Create/Save
through "save_inferior_status", restore through
"restore_inferior_status".
+
This pair of routines should be called around any transfer of
control to the inferior which you don't want showing up in your
control variables. */
-struct inferior_status
- {
- enum target_signal stop_signal;
- CORE_ADDR stop_pc;
- bpstat stop_bpstat;
- int stop_step;
- int stop_stack_dummy;
- int stopped_by_random_signal;
- int trap_expected;
- CORE_ADDR step_range_start;
- CORE_ADDR step_range_end;
- CORE_ADDR step_frame_address;
- int step_over_calls;
- CORE_ADDR step_resume_break_address;
- int stop_after_trap;
- int stop_soon_quietly;
- CORE_ADDR selected_frame_address;
- char stop_registers[REGISTER_BYTES];
-
- /* These are here because if call_function_by_hand has written some
- registers and then decides to call error(), we better not have changed
- any registers. */
- char registers[REGISTER_BYTES];
-
- int selected_level;
- int breakpoint_proceeded;
- int restore_stack_info;
- int proceed_to_finish;
- };
+struct inferior_status;
-/* This macro gives the number of registers actually in use by the
- inferior. This may be less than the total number of registers,
- perhaps depending on the actual CPU in use or program being run. */
+extern struct inferior_status *save_inferior_status (int);
-#ifndef ARCH_NUM_REGS
-#define ARCH_NUM_REGS NUM_REGS
-#endif
+extern void restore_inferior_status (struct inferior_status *);
+
+extern struct cleanup *make_cleanup_restore_inferior_status (struct inferior_status *);
+
+extern void discard_inferior_status (struct inferior_status *);
+
+extern void write_inferior_status_register (struct inferior_status
+ *inf_status, int regno,
+ LONGEST val);
+
+/* The -1 ptid, often used to indicate either an error condition
+ or a "don't care" condition, i.e, "run all threads." */
+extern ptid_t minus_one_ptid;
+
+/* The null or zero ptid, often used to indicate no process. */
+extern ptid_t null_ptid;
-extern void save_inferior_status PARAMS ((struct inferior_status *, int));
+/* Attempt to find and return an existing ptid with the given PID, LWP,
+ and TID components. If none exists, create a new one and return
+ that. */
+ptid_t ptid_build (int pid, long lwp, long tid);
-extern void restore_inferior_status PARAMS ((struct inferior_status *));
+/* Find/Create a ptid from just a pid. */
+ptid_t pid_to_ptid (int pid);
-extern void set_sigint_trap PARAMS ((void));
+/* Fetch the pid (process id) component from a ptid. */
+int ptid_get_pid (ptid_t ptid);
-extern void clear_sigint_trap PARAMS ((void));
+/* Fetch the lwp (lightweight process) component from a ptid. */
+long ptid_get_lwp (ptid_t ptid);
-extern void set_sigio_trap PARAMS ((void));
+/* Fetch the tid (thread id) component from a ptid. */
+long ptid_get_tid (ptid_t ptid);
-extern void clear_sigio_trap PARAMS ((void));
+/* Compare two ptids to see if they are equal */
+extern int ptid_equal (ptid_t p1, ptid_t p2);
+
+/* Save value of inferior_ptid so that it may be restored by
+ a later call to do_cleanups(). Returns the struct cleanup
+ pointer needed for later doing the cleanup. */
+extern struct cleanup * save_inferior_ptid (void);
+
+extern void set_sigint_trap (void);
+
+extern void clear_sigint_trap (void);
+
+extern void set_sigio_trap (void);
+
+extern void clear_sigio_trap (void);
/* File name for default use for standard in/out in the inferior. */
extern char *inferior_io_terminal;
-/* Pid of our debugged inferior, or 0 if no inferior now. */
+/* Collected pid, tid, etc. of the debugged inferior. When there's
+ no inferior, PIDGET (inferior_ptid) will be 0. */
-extern int inferior_pid;
+extern ptid_t inferior_ptid;
-/* This is only valid when inferior_pid is non-zero.
+/* Is the inferior running right now, as a result of a 'run&',
+ 'continue&' etc command? This is used in asycn gdb to determine
+ whether a command that the user enters while the target is running
+ is allowed or not. */
+extern int target_executing;
+
+/* Are we simulating synchronous execution? This is used in async gdb
+ to implement the 'run', 'continue' etc commands, which will not
+ redisplay the prompt until the execution is actually over. */
+extern int sync_execution;
+
+/* This is only valid when inferior_ptid is non-zero.
If this is 0, then exec events should be noticed and responded to
by the debugger (i.e., be reported to the user).
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
@@ -110,87 +129,106 @@ 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. */
extern struct environ *inferior_environ;
-/* Character array containing an image of the inferior programs' registers. */
+extern void clear_proceed_status (void);
+
+extern void proceed (CORE_ADDR, enum target_signal, int);
+
+/* When set, stop the 'step' command if we enter a function which has
+ no line number information. The normal behavior is that we step
+ over such function. */
+extern int step_stop_if_no_debug;
-extern char registers[];
+extern void kill_inferior (void);
-/* Array of validity bits (one per register). Nonzero at position XXX_REGNUM
- means that `registers' contains a valid copy of inferior register XXX.
- -1 if register value is not available. */
+extern void generic_mourn_inferior (void);
-extern SIGNED char register_valid[NUM_REGS];
+extern void terminal_ours (void);
-extern void clear_proceed_status PARAMS ((void));
+extern int run_stack_dummy (CORE_ADDR, char *);
-extern void proceed PARAMS ((CORE_ADDR, enum target_signal, int));
+extern CORE_ADDR read_pc (void);
-extern void kill_inferior PARAMS ((void));
+extern CORE_ADDR read_pc_pid (ptid_t);
-extern void generic_mourn_inferior PARAMS ((void));
+extern CORE_ADDR generic_target_read_pc (ptid_t);
-extern void terminal_ours PARAMS ((void));
+extern void write_pc (CORE_ADDR);
-extern int run_stack_dummy PARAMS ((CORE_ADDR, char[REGISTER_BYTES]));
+extern void write_pc_pid (CORE_ADDR, ptid_t);
-extern CORE_ADDR read_pc PARAMS ((void));
+extern void generic_target_write_pc (CORE_ADDR, ptid_t);
-extern CORE_ADDR read_pc_pid PARAMS ((int));
+extern CORE_ADDR read_sp (void);
-extern void write_pc PARAMS ((CORE_ADDR));
+extern CORE_ADDR generic_target_read_sp (void);
-extern void write_pc_pid PARAMS ((CORE_ADDR, int));
+extern void write_sp (CORE_ADDR);
-extern CORE_ADDR read_sp PARAMS ((void));
+extern void generic_target_write_sp (CORE_ADDR);
-extern void write_sp PARAMS ((CORE_ADDR));
+extern CORE_ADDR read_fp (void);
-extern CORE_ADDR read_fp PARAMS ((void));
+extern CORE_ADDR generic_target_read_fp (void);
-extern void write_fp PARAMS ((CORE_ADDR));
+extern void write_fp (CORE_ADDR);
-extern void wait_for_inferior PARAMS ((void));
+extern void generic_target_write_fp (CORE_ADDR);
-extern void init_wait_for_inferior PARAMS ((void));
+extern CORE_ADDR unsigned_pointer_to_address (struct type *type, void *buf);
-extern void close_exec_file PARAMS ((void));
+extern void unsigned_address_to_pointer (struct type *type, void *buf,
+ CORE_ADDR addr);
+extern CORE_ADDR signed_pointer_to_address (struct type *type, void *buf);
+extern void address_to_signed_pointer (struct type *type, void *buf,
+ CORE_ADDR addr);
-extern void reopen_exec_file PARAMS ((void));
+extern void wait_for_inferior (void);
+
+extern void fetch_inferior_event (void *);
+
+extern void init_wait_for_inferior (void);
+
+extern void close_exec_file (void);
+
+extern void reopen_exec_file (void);
/* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */
-extern void resume PARAMS ((int, enum target_signal));
+extern void resume (int, enum target_signal);
/* From misc files */
-extern void store_inferior_registers PARAMS ((int));
+extern void do_registers_info (int, int);
+
+extern void store_inferior_registers (int);
-extern void fetch_inferior_registers PARAMS ((int));
+extern void fetch_inferior_registers (int);
-extern void solib_create_inferior_hook PARAMS ((void));
+extern void solib_create_inferior_hook (void);
-extern void child_terminal_info PARAMS ((char *, int));
+extern void child_terminal_info (char *, int);
-extern void term_info PARAMS ((char *, int));
+extern void term_info (char *, int);
-extern void terminal_ours_for_output PARAMS ((void));
+extern void terminal_ours_for_output (void);
-extern void terminal_inferior PARAMS ((void));
+extern void terminal_inferior (void);
-extern void terminal_init_inferior PARAMS ((void));
+extern void terminal_init_inferior (void);
-extern void terminal_init_inferior_with_pgrp PARAMS ((int pgrp));
+extern void terminal_init_inferior_with_pgrp (int pgrp);
/* From infptrace.c or infttrace.c */
-extern int attach PARAMS ((int));
+extern int attach (int);
#if !defined(REQUIRE_ATTACH)
#define REQUIRE_ATTACH attach
@@ -200,65 +238,78 @@ extern int attach PARAMS ((int));
#define REQUIRE_DETACH(pid,siggnal) detach (siggnal)
#endif
-extern void detach PARAMS ((int));
+extern void detach (int);
-int ptrace_wait PARAMS ((int, int *));
+/* PTRACE method of waiting for inferior process. */
+int ptrace_wait (ptid_t, int *);
-extern void child_resume PARAMS ((int, int, enum target_signal));
+extern void child_resume (ptid_t, int, enum target_signal);
#ifndef PTRACE_ARG3_TYPE
#define PTRACE_ARG3_TYPE int /* Correct definition for most systems. */
#endif
-extern int call_ptrace PARAMS ((int, int, PTRACE_ARG3_TYPE, int));
+extern int call_ptrace (int, int, PTRACE_ARG3_TYPE, int);
-extern void pre_fork_inferior PARAMS ((void));
+extern void pre_fork_inferior (void);
/* From procfs.c */
-extern int proc_iterate_over_mappings PARAMS ((int (*)(int, CORE_ADDR)));
+extern int proc_iterate_over_mappings (int (*)(int, CORE_ADDR));
-extern int procfs_first_available PARAMS ((void));
-
-extern int procfs_get_pid_fd PARAMS ((int));
+extern ptid_t procfs_first_available (void);
/* From fork-child.c */
-extern void fork_inferior PARAMS ((char *, char *, char **,
- void (*)(void),
- void (*)(int),
- void (*)(void),
- char *));
+extern void fork_inferior (char *, char *, char **,
+ void (*)(void),
+ void (*)(int), void (*)(void), char *);
+
+extern void clone_and_follow_inferior (int, int *);
-extern void
-clone_and_follow_inferior PARAMS ((int, int *));
+extern void startup_inferior (int);
-extern void startup_inferior PARAMS ((int));
+extern char *construct_inferior_arguments (struct gdbarch *, int, char **);
/* From inflow.c */
-extern void new_tty_prefork PARAMS ((char *));
+extern void new_tty_prefork (char *);
-extern int gdb_has_a_terminal PARAMS ((void));
+extern int gdb_has_a_terminal (void);
/* From infrun.c */
-extern void start_remote PARAMS ((void));
+extern void start_remote (void);
+
+extern void normal_stop (void);
+
+extern int signal_stop_state (int);
-extern void normal_stop PARAMS ((void));
+extern int signal_print_state (int);
-extern int signal_stop_state PARAMS ((int));
+extern int signal_pass_state (int);
-extern int signal_print_state PARAMS ((int));
+extern int signal_stop_update (int, int);
-extern int signal_pass_state PARAMS ((int));
+extern int signal_print_update (int, int);
+
+extern int signal_pass_update (int, int);
+
+extern void get_last_target_status(ptid_t *ptid,
+ struct target_waitstatus *status);
/* From infcmd.c */
-extern void tty_command PARAMS ((char *, int));
+extern void tty_command (char *, int);
+
+extern void attach_command (char *, int);
+
+extern char *get_inferior_args (void);
-extern void attach_command PARAMS ((char *, int));
+extern char *set_inferior_args (char *);
+
+extern void set_inferior_args_vector (int, char **);
/* Last signal that the inferior received (why it stopped). */
@@ -300,7 +351,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,
@@ -315,7 +366,14 @@ extern CORE_ADDR step_sp;
/* 1 means step over all subroutine calls.
-1 means step over calls to undebuggable functions. */
-extern int step_over_calls;
+enum step_over_calls_kind
+ {
+ STEP_OVER_NONE,
+ STEP_OVER_ALL,
+ STEP_OVER_UNDEBUGGABLE
+ };
+
+extern enum step_over_calls_kind step_over_calls;
/* If stepping, nonzero means step count is > 1
so don't print frame next time inferior stops
@@ -340,9 +398,9 @@ extern int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-extern char stop_registers[REGISTER_BYTES];
+extern char *stop_registers;
-/* Nonzero if the child process in inferior_pid was attached rather
+/* Nonzero if the child process in inferior_ptid was attached rather
than forked. */
extern int attach_flag;
@@ -376,57 +434,100 @@ extern int attach_flag;
#define AFTER_TEXT_END 3
#define AT_ENTRY_POINT 4
+#if !defined (USE_GENERIC_DUMMY_FRAMES)
+#define USE_GENERIC_DUMMY_FRAMES 0
+#endif
+
#if !defined (CALL_DUMMY_LOCATION)
#define CALL_DUMMY_LOCATION ON_STACK
#endif /* No CALL_DUMMY_LOCATION. */
-/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
- below is for infrun.c, which may give the macro a pc without that
- subtracted out. */
-#if !defined (PC_IN_CALL_DUMMY)
-#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
-extern CORE_ADDR text_end;
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((pc) >= text_end - CALL_DUMMY_LENGTH \
- && (pc) <= text_end + DECR_PC_AFTER_BREAK)
+#if !defined (CALL_DUMMY_ADDRESS)
+#define CALL_DUMMY_ADDRESS() (internal_error (__FILE__, __LINE__, "CALL_DUMMY_ADDRESS"), 0)
+#endif
+#if !defined (CALL_DUMMY_START_OFFSET)
+#define CALL_DUMMY_START_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_START_OFFSET"), 0)
+#endif
+#if !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
+#define CALL_DUMMY_BREAKPOINT_OFFSET_P (0)
+#define CALL_DUMMY_BREAKPOINT_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_BREAKPOINT_OFFSET"), 0)
+#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 (internal_error (__FILE__, __LINE__, "CALL_DUMMY_LENGTH"), 0)
+#endif
+
+#if defined (CALL_DUMMY_STACK_ADJUST)
+#if !defined (CALL_DUMMY_STACK_ADJUST_P)
+#define CALL_DUMMY_STACK_ADJUST_P (1)
+#endif
+#endif
+#if !defined (CALL_DUMMY_STACK_ADJUST)
+#define CALL_DUMMY_STACK_ADJUST (internal_error (__FILE__, __LINE__, "CALL_DUMMY_STACK_ADJUST"), 0)
+#endif
+#if !defined (CALL_DUMMY_STACK_ADJUST_P)
+#define CALL_DUMMY_STACK_ADJUST_P (0)
+#endif
+
+/* FIXME: cagney/2000-04-17: gdbarch should manage this. The default
+ shouldn't be necessary. */
+
+#if !defined (CALL_DUMMY_P)
+#if defined (CALL_DUMMY)
+#define CALL_DUMMY_P 1
+#else
+#define CALL_DUMMY_P 0
+#endif
+#endif
+
+#if !defined PUSH_DUMMY_FRAME
+#define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0)
+#endif
+
+#if !defined FIX_CALL_DUMMY
+#define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0)
+#endif
+
+#if !defined STORE_STRUCT_RETURN
+#define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0)
+#endif
+
+
+/* Are we in a call dummy? */
+
+extern int pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address);
+#if !GDB_MULTI_ARCH
+#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == BEFORE_TEXT_END
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_before_text_end (pc, sp, frame_address)
#endif /* Before text_end. */
+#endif
-#if CALL_DUMMY_LOCATION == AFTER_TEXT_END
-extern CORE_ADDR text_end;
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((pc) >= text_end \
- && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
-#endif /* After text_end. */
-
-#if CALL_DUMMY_LOCATION == ON_STACK
-/* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and
- top of the stack frame which we are checking, where "bottom" and
- "top" refer to some section of memory which contains the code for
- the call dummy. Calls to this macro assume that the contents of
- SP_REGNUM and FP_REGNUM (or the saved values thereof), respectively,
- are the things to pass.
-
- This won't work on the 29k, where SP_REGNUM and FP_REGNUM don't
- have that meaning, but the 29k doesn't use ON_STACK. This could be
- fixed by generalizing this scheme, perhaps by passing in a frame
- and adding a few fields, at least on machines which need them for
- PC_IN_CALL_DUMMY.
-
- Something simpler, like checking for the stack segment, doesn't work,
- since various programs (threads implementations, gcc nested function
- stubs, etc) may either allocate stack frames in another segment, or
- allocate other kinds of code on the stack. */
-
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- (INNER_THAN ((sp), (pc)) && (frame_address != 0) && INNER_THAN ((pc), (frame_address)))
-#endif /* On stack. */
-
-#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((pc) >= CALL_DUMMY_ADDRESS () \
- && (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK))
-#endif /* At entry point. */
-#endif /* No PC_IN_CALL_DUMMY. */
+extern int pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address);
+#if !GDB_MULTI_ARCH
+#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AFTER_TEXT_END
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address)
+#endif
+#endif
+
+extern int pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address);
+#if !GDB_MULTI_ARCH
+#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == ON_STACK
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_on_stack (pc, sp, frame_address)
+#endif
+#endif
+
+extern int pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp,
+ CORE_ADDR frame_address);
+#if !GDB_MULTI_ARCH
+#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
+#endif
+#endif
/* It's often not enough for our clients to know whether the PC is merely
somewhere within the call dummy. They may need to know whether the
@@ -444,7 +545,7 @@ extern CORE_ADDR text_end;
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))
diff --git a/contrib/gdb/gdb/inflow.c b/contrib/gdb/gdb/inflow.c
index 9033675..66671f7 100644
--- a/contrib/gdb/gdb/inflow.c
+++ b/contrib/gdb/gdb/inflow.c
@@ -1,27 +1,28 @@
/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright 1986-87, 1989, 1991-92, 1995, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "command.h"
-#include "signals.h"
#include "serial.h"
#include "terminal.h"
#include "target.h"
@@ -30,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_string.h"
#include <signal.h>
#include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
#endif
#ifdef HAVE_TERMIOS
@@ -51,23 +52,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
#endif /* sgtty */
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
#if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN)
-static void
-handle_sigio PARAMS ((int));
+static void handle_sigio (int);
#endif
-static void
-pass_signal PARAMS ((int));
+extern void _initialize_inflow (void);
-static void
-kill_command PARAMS ((char *, int));
+static void pass_signal (int);
-static void
-terminal_ours_1 PARAMS ((int));
+static void kill_command (char *, int);
+
+static void terminal_ours_1 (int);
/* Record terminal status separately for debugger and inferior. */
-static serial_t stdin_serial;
+static struct serial *stdin_serial;
/* TTY state for the inferior. We save it whenever the inferior stops, and
restore it when it resumes. */
@@ -109,11 +112,15 @@ 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
-gdb_has_a_terminal ()
+gdb_has_a_terminal (void)
{
switch (gdb_has_a_terminal_flag)
{
@@ -122,19 +129,20 @@ gdb_has_a_terminal ()
case no:
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. */
+ /* 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. */
#ifdef F_GETFL
tflags_ours = fcntl (0, F_GETFL, 0);
#endif
gdb_has_a_terminal_flag = no;
- stdin_serial = SERIAL_FDOPEN (0);
+ stdin_serial = serial_fdopen (0);
if (stdin_serial != NULL)
{
- our_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
+ our_ttystate = serial_get_tty_state (stdin_serial);
if (our_ttystate != NULL)
{
@@ -165,45 +173,44 @@ gdb_has_a_terminal ()
fprintf_unfiltered(gdb_stderr, "[%s failed in terminal_inferior: %s]\n", \
what, strerror (errno))
-static void terminal_ours_1 PARAMS ((int));
+static void terminal_ours_1 (int);
/* Initialize the terminal settings we record for the inferior,
before we actually run the inferior. */
void
-terminal_init_inferior_with_pgrp (pgrp)
- int pgrp;
+terminal_init_inferior_with_pgrp (int 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). */
+ /* We could just as well copy our_ttystate (if we felt like
+ adding a new function serial_copy_tty_state()). */
if (inferior_ttystate)
- free (inferior_ttystate);
- inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
+ xfree (inferior_ttystate);
+ inferior_ttystate = serial_get_tty_state (stdin_serial);
#ifdef PROCESS_GROUP_TYPE
inferior_process_group = 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;
}
}
void
-terminal_init_inferior ()
+terminal_init_inferior (void)
{
#ifdef PROCESS_GROUP_TYPE
/* This is for Lynx, and should be cleaned up by having Lynx be a separate
debugging target with a version of target_terminal_init_inferior which
passes in the process group to a generic routine which does all the work
(and the non-threaded child_terminal_init_inferior can just pass in
- inferior_pid to the same routine). */
+ inferior_ptid to the same routine). */
/* We assume INFERIOR_PID is also the child's process group. */
- terminal_init_inferior_with_pgrp (PIDGET (inferior_pid));
+ terminal_init_inferior_with_pgrp (PIDGET (inferior_ptid));
#endif /* PROCESS_GROUP_TYPE */
}
@@ -211,7 +218,7 @@ terminal_init_inferior ()
This is preparation for starting or resuming the inferior. */
void
-terminal_inferior ()
+terminal_inferior (void)
{
if (gdb_has_a_terminal () && terminal_is_ours
&& inferior_thisrun_terminal == 0)
@@ -220,38 +227,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. */
- result = SERIAL_SET_TTY_STATE (stdin_serial, inferior_ttystate);
+ 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)
{
@@ -281,7 +288,7 @@ terminal_inferior ()
should be called to get back to a normal state of affairs. */
void
-terminal_ours_for_output ()
+terminal_ours_for_output (void)
{
terminal_ours_1 (1);
}
@@ -291,7 +298,7 @@ terminal_ours_for_output ()
so they can be restored properly later. */
void
-terminal_ours ()
+terminal_ours (void)
{
terminal_ours_1 (0);
}
@@ -301,8 +308,7 @@ terminal_ours ()
flags. */
static void
-terminal_ours_1 (output_only)
- int output_only;
+terminal_ours_1 (int output_only)
{
/* Checking inferior_thisrun_terminal is necessary so that
if GDB is running in the background, it won't block trying
@@ -313,21 +319,23 @@ terminal_ours_1 (output_only)
if (!terminal_is_ours)
{
+#ifdef SIGTTOU
/* Ignore this signal since it will happen when we try to set the
- pgrp. */
- void (*osigttou) ();
+ pgrp. */
+ void (*osigttou) () = NULL;
+#endif
int result;
terminal_is_ours = 1;
#ifdef SIGTTOU
if (job_control)
- osigttou = (void (*) ()) signal (SIGTTOU, SIG_IGN);
+ osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN);
#endif
if (inferior_ttystate)
- free (inferior_ttystate);
- inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
+ xfree (inferior_ttystate);
+ inferior_ttystate = serial_get_tty_state (stdin_serial);
#ifdef HAVE_TERMIOS
inferior_process_group = tcgetpgrp (0);
#endif
@@ -339,20 +347,20 @@ 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,
+ serial_noflush_set_tty_state (stdin_serial, our_ttystate,
inferior_ttystate);
if (job_control)
@@ -366,7 +374,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 */
@@ -392,30 +400,26 @@ 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 */
}
}
/* ARGSUSED */
void
-term_info (arg, from_tty)
- char *arg;
- int from_tty;
+term_info (char *arg, int from_tty)
{
target_terminal_info (arg, from_tty);
}
/* ARGSUSED */
void
-child_terminal_info (args, from_tty)
- char *args;
- int from_tty;
+child_terminal_info (char *args, int from_tty)
{
if (!gdb_has_a_terminal ())
{
@@ -428,7 +432,7 @@ child_terminal_info (args, from_tty)
/* First the fcntl flags. */
{
int flags;
-
+
flags = tflags_inferior;
printf_filtered ("File descriptor flags = ");
@@ -439,18 +443,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
@@ -476,10 +486,11 @@ child_terminal_info (args, from_tty)
}
#ifdef PROCESS_GROUP_TYPE
- printf_filtered ("Process group = %d\n", inferior_process_group);
+ printf_filtered ("Process group = %d\n",
+ (int) inferior_process_group);
#endif
- SERIAL_PRINT_TTY_STATE (stdin_serial, inferior_ttystate);
+ serial_print_tty_state (stdin_serial, inferior_ttystate, gdb_stdout);
}
/* NEW_TTY_PREFORK is called before forking a new child process,
@@ -492,8 +503,7 @@ child_terminal_info (args, from_tty)
the terminal specified in the NEW_TTY_PREFORK call. */
void
-new_tty_prefork (ttyname)
- char *ttyname;
+new_tty_prefork (char *ttyname)
{
/* Save the name for later, for determining whether we and the child
are sharing a tty. */
@@ -501,7 +511,7 @@ new_tty_prefork (ttyname)
}
void
-new_tty ()
+new_tty (void)
{
register int tty;
@@ -512,72 +522,80 @@ 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 */
}
/* Kill the inferior process. Make us have no inferior. */
/* ARGSUSED */
static void
-kill_command (arg, from_tty)
- char *arg;
- int from_tty;
+kill_command (char *arg, int from_tty)
{
- /* FIXME: This should not really be inferior_pid (or target_has_execution).
+ /* FIXME: This should not really be inferior_ptid (or target_has_execution).
It should be a distinct flag that indicates that a target is active, cuz
some targets don't have processes! */
- if (inferior_pid == 0)
+ if (ptid_equal (inferior_ptid, null_ptid))
error ("The program is not being run.");
if (!query ("Kill the program being debugged? "))
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);
+ }
}
/* Call set_sigint_trap when you need to pass a signal on to an attached
@@ -585,27 +603,26 @@ kill_command (arg, from_tty)
/* ARGSUSED */
static void
-pass_signal (signo)
- int signo;
+pass_signal (int signo)
{
#ifndef _WIN32
- kill (PIDGET (inferior_pid), SIGINT);
+ kill (PIDGET (inferior_ptid), SIGINT);
#endif
}
-static void (*osig)();
+static void (*osig) ();
void
-set_sigint_trap()
+set_sigint_trap (void)
{
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 (void)
{
if (attach_flag || inferior_thisrun_terminal)
{
@@ -617,8 +634,7 @@ clear_sigint_trap()
static void (*old_sigio) ();
static void
-handle_sigio (signo)
- int signo;
+handle_sigio (int signo)
{
int numfds;
fd_set readfds;
@@ -632,7 +648,7 @@ handle_sigio (signo)
{
#ifndef _WIN32
if ((*target_activity_function) ())
- kill (inferior_pid, SIGINT);
+ kill (PIDGET (inferior_ptid), SIGINT);
#endif
}
}
@@ -640,19 +656,19 @@ handle_sigio (signo)
static int old_fcntl_flags;
void
-set_sigio_trap ()
+set_sigio_trap (void)
{
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);
}
}
void
-clear_sigio_trap ()
+clear_sigio_trap (void)
{
if (target_activity_function)
{
@@ -662,17 +678,17 @@ clear_sigio_trap ()
}
#else /* No SIGIO. */
void
-set_sigio_trap ()
+set_sigio_trap (void)
{
if (target_activity_function)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
void
-clear_sigio_trap ()
+clear_sigio_trap (void)
{
if (target_activity_function)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#endif /* No SIGIO. */
@@ -687,40 +703,43 @@ clear_sigio_trap ()
calls setpgrp and a setpgrp which does nothing (any system with job control
will have one or the other). */
int
-gdb_setpgid ()
+gdb_setpgid (void)
{
int retval = 0;
if (job_control)
{
-#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). */
+#if defined (HAVE_TERMIOS) || defined (TIOCGPGRP)
+#ifdef HAVE_SETPGID
+ /* The call 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). */
retval = setpgid (getpid (), getpid ());
#else
-#if defined (TIOCGPGRP)
-#if defined(USG) && !defined(SETPGRP_ARGS)
+#ifdef HAVE_SETPGRP
+#ifdef SETPGRP_VOID
retval = setpgrp ();
#else
retval = setpgrp (getpid (), getpid ());
-#endif /* USG */
-#endif /* TIOCGPGRP. */
-#endif /* NEED_POSIX_SETPGID */
+#endif
+#endif /* HAVE_SETPGRP */
+#endif /* HAVE_SETPGID */
+#endif /* defined (HAVE_TERMIOS) || defined (TIOCGPGRP) */
}
+
return retval;
}
void
-_initialize_inflow ()
+_initialize_inflow (void)
{
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.");
- inferior_pid = 0;
+ inferior_ptid = null_ptid;
terminal_is_ours = 1;
@@ -736,10 +755,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
diff --git a/contrib/gdb/gdb/infrun.c b/contrib/gdb/gdb/infrun.c
index 5fd8fc1..6ae8f7c 100644
--- a/contrib/gdb/gdb/infrun.c
+++ b/contrib/gdb/gdb/infrun.c
@@ -1,22 +1,26 @@
-/* Target-struct-independent code to start (run) and stop an inferior process.
- Copyright 1986, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 1998
- Free Software Foundation, Inc.
+/* Target-struct-independent code to start (run) and stop an inferior
+ process.
-This file is part of GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 "gdb_string.h"
@@ -25,76 +29,92 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "frame.h"
#include "inferior.h"
#include "breakpoint.h"
-#include "wait.h"
+#include "gdb_wait.h"
#include "gdbcore.h"
#include "gdbcmd.h"
+#include "cli/cli-script.h"
#include "target.h"
#include "gdbthread.h"
#include "annotate.h"
-#include "symfile.h" /* for overlay functions */
-
+#include "symfile.h"
+#include "top.h"
#include <signal.h>
+#include "inf-loop.h"
+#include "regcache.h"
+#include "value.h"
/* Prototypes for local functions */
-static void signals_info PARAMS ((char *, int));
+static void signals_info (char *, int);
-static void handle_command PARAMS ((char *, int));
+static void handle_command (char *, int);
-static void sig_print_info PARAMS ((enum target_signal));
+static void sig_print_info (enum target_signal);
-static void sig_print_header PARAMS ((void));
+static void sig_print_header (void);
-static void resume_cleanups PARAMS ((int));
+static void resume_cleanups (void *);
-static int hook_stop_stub PARAMS ((PTR));
+static int hook_stop_stub (void *);
-static void delete_breakpoint_current_contents PARAMS ((PTR));
+static void delete_breakpoint_current_contents (void *);
-int inferior_ignoring_startup_exec_events = 0;
-int inferior_ignoring_leading_exec_events = 0;
+static void set_follow_fork_mode_command (char *arg, int from_tty,
+ struct cmd_list_element * c);
-#ifdef HPUXHPPA
-/* wait_for_inferior and normal_stop use this to notify the user
- when the inferior stopped in a different thread than it had been
- running in. */
-static int switched_from_inferior_pid;
-#endif
+static struct inferior_status *xmalloc_inferior_status (void);
-/* resume and wait_for_inferior use this to ensure that when
- stepping over a hit breakpoint in a threaded application
- only the thread that hit the breakpoint is stepped and the
- other threads don't continue. This prevents having another
- thread run past the breakpoint while it is temporarily
- removed.
+static void free_inferior_status (struct inferior_status *);
- This is not thread-specific, so it isn't saved as part of
- the infrun state.
+static int restore_selected_frame (void *);
- Versions of gdb which don't use the "step == this thread steps
- and others continue" model but instead use the "step == this
- thread steps and others wait" shouldn't do this. */
-static int thread_step_needed = 0;
+static void build_infrun (void);
-void _initialize_infrun PARAMS ((void));
+static void follow_inferior_fork (int parent_pid, int child_pid,
+ int has_forked, int has_vforked);
-/* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the
- program. It needs to examine the jmp_buf argument and extract the PC
- from it. The return value is non-zero on success, zero otherwise. */
+static void follow_fork (int parent_pid, int child_pid);
-#ifndef GET_LONGJMP_TARGET
-#define GET_LONGJMP_TARGET(PC_ADDR) 0
-#endif
+static void follow_vfork (int parent_pid, int child_pid);
+
+static void set_schedlock_func (char *args, int from_tty,
+ struct cmd_list_element * c);
+
+struct execution_control_state;
+
+static int currently_stepping (struct execution_control_state *ecs);
+
+static void xdb_handle_command (char *args, int from_tty);
+
+void _initialize_infrun (void);
+
+int inferior_ignoring_startup_exec_events = 0;
+int inferior_ignoring_leading_exec_events = 0;
+
+/* When set, stop the 'step' command if we enter a function which has
+ no line number information. The normal behavior is that we step
+ over such function. */
+int step_stop_if_no_debug = 0;
+
+/* In asynchronous mode, but simulating synchronous execution. */
+
+int sync_execution = 0;
+
+/* wait_for_inferior and normal_stop use this to notify the user
+ when the inferior stopped in a different thread than it had been
+ running in. */
+static ptid_t previous_inferior_ptid;
-/* Some machines have trampoline code that sits between function callers
- and the actual functions themselves. If this machine doesn't have
- such things, disable their processing. */
+/* This is true for configurations that may follow through execl() and
+ similar functions. At present this is only true for HP-UX native. */
-#ifndef SKIP_TRAMPOLINE_CODE
-#define SKIP_TRAMPOLINE_CODE(pc) 0
+#ifndef MAY_FOLLOW_EXEC
+#define MAY_FOLLOW_EXEC (0)
#endif
+static int may_follow_exec = MAY_FOLLOW_EXEC;
+
/* Dynamic function trampolines are similar to solib trampolines in that they
are between the caller and the callee. The difference is that when you
enter a dynamic trampoline, you can't determine the callee's address. Some
@@ -110,21 +130,51 @@ void _initialize_infrun PARAMS ((void));
#define DYNAMIC_TRAMPOLINE_NEXTPC(pc) 0
#endif
-/* On SVR4 based systems, determining the callee's address is exceedingly
- difficult and depends on the implementation of the run time loader.
- If we are stepping at the source level, we single step until we exit
- the run time loader code and reach the callee's address. */
+/* If the program uses ELF-style shared libraries, then calls to
+ functions in shared libraries go through stubs, which live in a
+ table called the PLT (Procedure Linkage Table). The first time the
+ function is called, the stub sends control to the dynamic linker,
+ which looks up the function's real address, patches the stub so
+ that future calls will go directly to the function, and then passes
+ control to the function.
+
+ If we are stepping at the source level, we don't want to see any of
+ this --- we just want to skip over the stub and the dynamic linker.
+ The simple approach is to single-step until control leaves the
+ dynamic linker.
+
+ However, on some systems (e.g., Red Hat's 5.2 distribution) the
+ dynamic linker calls functions in the shared C library, so you
+ can't tell from the PC alone whether the dynamic linker is still
+ running. In this case, we use a step-resume breakpoint to get us
+ past the dynamic linker, as if we were using "next" to step over a
+ function call.
+
+ IN_SOLIB_DYNSYM_RESOLVE_CODE says whether we're in the dynamic
+ linker code or not. Normally, this means we single-step. However,
+ if SKIP_SOLIB_RESOLVER then returns non-zero, then its value is an
+ address where we can place a step-resume breakpoint to get past the
+ linker's symbol resolution function.
+
+ IN_SOLIB_DYNSYM_RESOLVE_CODE can generally be implemented in a
+ pretty portable way, by comparing the PC against the address ranges
+ of the dynamic linker's sections.
+
+ SKIP_SOLIB_RESOLVER is generally going to be system-specific, since
+ it depends on internal details of the dynamic linker. It's usually
+ not too hard to figure out where to put a breakpoint, but it
+ certainly isn't portable. SKIP_SOLIB_RESOLVER should do plenty of
+ sanity checking. If it can't figure things out, returning zero and
+ getting the (possibly confusing) stepping behavior is better than
+ signalling an error, which will obscure the change in the
+ inferior's state. */
#ifndef IN_SOLIB_DYNSYM_RESOLVE_CODE
#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) 0
#endif
-/* For SVR4 shared libraries, each call goes through a small piece of
- trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
- to nonzero if we are current stopped in one of these. */
-
-#ifndef IN_SOLIB_CALL_TRAMPOLINE
-#define IN_SOLIB_CALL_TRAMPOLINE(pc,name) 0
+#ifndef SKIP_SOLIB_RESOLVER
+#define SKIP_SOLIB_RESOLVER(pc) 0
#endif
/* In some shared library schemes, the return path from a shared library
@@ -164,6 +214,55 @@ void _initialize_infrun PARAMS ((void));
#define INSTRUCTION_NULLIFIED 0
#endif
+/* We can't step off a permanent breakpoint in the ordinary way, because we
+ can't remove it. Instead, we have to advance the PC to the next
+ instruction. This macro should expand to a pointer to a function that
+ does that, or zero if we have no such function. If we don't have a
+ definition for it, we have to report an error. */
+#ifndef SKIP_PERMANENT_BREAKPOINT
+#define SKIP_PERMANENT_BREAKPOINT (default_skip_permanent_breakpoint)
+static void
+default_skip_permanent_breakpoint (void)
+{
+ error ("\
+The program is stopped at a permanent breakpoint, but GDB does not know\n\
+how to step past a permanent breakpoint on this architecture. Try using\n\
+a command like `return' or `jump' to continue execution.");
+}
+#endif
+
+
+/* Convert the #defines into values. This is temporary until wfi control
+ flow is completely sorted out. */
+
+#ifndef HAVE_STEPPABLE_WATCHPOINT
+#define HAVE_STEPPABLE_WATCHPOINT 0
+#else
+#undef HAVE_STEPPABLE_WATCHPOINT
+#define HAVE_STEPPABLE_WATCHPOINT 1
+#endif
+
+#ifndef HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 0
+#else
+#undef HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1
+#endif
+
+#ifndef HAVE_CONTINUABLE_WATCHPOINT
+#define HAVE_CONTINUABLE_WATCHPOINT 0
+#else
+#undef HAVE_CONTINUABLE_WATCHPOINT
+#define HAVE_CONTINUABLE_WATCHPOINT 1
+#endif
+
+#ifndef CANNOT_STEP_HW_WATCHPOINTS
+#define CANNOT_STEP_HW_WATCHPOINTS 0
+#else
+#undef CANNOT_STEP_HW_WATCHPOINTS
+#define CANNOT_STEP_HW_WATCHPOINTS 1
+#endif
+
/* Tables of how to react to signals; the user sets them. */
static unsigned char *signal_stop;
@@ -186,6 +285,9 @@ static unsigned char *signal_program;
(flags)[signum] = 0; \
} while (0)
+/* Value to pass to target_resume() to cause all threads to resume */
+
+#define RESUME_ALL (pid_to_ptid (-1))
/* Command list pointer for the "stop" placeholder. */
@@ -239,7 +341,7 @@ int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-char stop_registers[REGISTER_BYTES];
+char *stop_registers;
/* Nonzero if program stopped due to error trying to insert breakpoints. */
@@ -260,6 +362,12 @@ static struct breakpoint *through_sigtramp_breakpoint = NULL;
currently be running in a syscall. */
static int number_of_threads_in_syscalls;
+/* This is a cached copy of the pid/waitstatus of the last event
+ returned by target_wait()/target_wait_hook(). This information is
+ returned by get_last_target_status(). */
+static ptid_t target_last_wait_ptid;
+static struct target_waitstatus target_last_waitstatus;
+
/* This is used to remember when a fork, vfork or exec event
was caught by a catchpoint, and thus the event is to be
followed at the next resume of the inferior, and not
@@ -289,55 +397,55 @@ pending_follow;
set to 1, a vfork event has been seen, but cannot be followed
until the exec is seen.
- (In the latter case, inferior_pid is still the parent of the
+ (In the latter case, inferior_ptid is still the parent of the
vfork, and pending_follow.fork_event.child_pid is the child. The
appropriate process is followed, according to the setting of
follow-fork-mode.) */
static int follow_vfork_when_exec;
-static char *follow_fork_mode_kind_names[] =
+static const char follow_fork_mode_ask[] = "ask";
+static const char follow_fork_mode_both[] = "both";
+static const char follow_fork_mode_child[] = "child";
+static const char follow_fork_mode_parent[] = "parent";
+
+static const char *follow_fork_mode_kind_names[] =
{
-/* ??rehrauer: The "both" option is broken, by what may be a 10.20
- kernel problem. It's also not terribly useful without a GUI to
- help the user drive two debuggers. So for now, I'm disabling
- the "both" option.
- "parent", "child", "both", "ask" };
- */
- "parent", "child", "ask"};
+ follow_fork_mode_ask,
+ /* ??rehrauer: The "both" option is broken, by what may be a 10.20
+ kernel problem. It's also not terribly useful without a GUI to
+ help the user drive two debuggers. So for now, I'm disabling the
+ "both" option. */
+ /* follow_fork_mode_both, */
+ follow_fork_mode_child,
+ follow_fork_mode_parent,
+ NULL
+};
-static char *follow_fork_mode_string = NULL;
+static const char *follow_fork_mode_string = follow_fork_mode_parent;
-#if defined(HPUXHPPA)
static void
-follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
- int parent_pid;
- int child_pid;
- int has_forked;
- int has_vforked;
+follow_inferior_fork (int parent_pid, int child_pid, int has_forked,
+ int has_vforked)
{
int followed_parent = 0;
int followed_child = 0;
- int ima_clone = 0;
/* Which process did the user want us to follow? */
- char *follow_mode =
- savestring (follow_fork_mode_string, strlen (follow_fork_mode_string));
+ const char *follow_mode = follow_fork_mode_string;
/* Or, did the user not know, and want us to ask? */
- if (STREQ (follow_fork_mode_string, "ask"))
+ if (follow_fork_mode_string == follow_fork_mode_ask)
{
- char requested_mode[100];
-
- free (follow_mode);
- error ("\"ask\" mode NYI");
- follow_mode = savestring (requested_mode, strlen (requested_mode));
+ internal_error (__FILE__, __LINE__,
+ "follow_inferior_fork: \"ask\" mode not implemented");
+ /* follow_mode = follow_fork_mode_...; */
}
/* If we're to be following the parent, then detach from child_pid.
We're already following the parent, so need do nothing explicit
for it. */
- if (STREQ (follow_mode, "parent"))
+ if (follow_mode == follow_fork_mode_parent)
{
followed_parent = 1;
@@ -349,7 +457,9 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
if (!has_vforked || !follow_vfork_when_exec)
{
detach_breakpoints (child_pid);
+#ifdef SOLIB_REMOVE_INFERIOR_HOOK
SOLIB_REMOVE_INFERIOR_HOOK (child_pid);
+#endif
}
/* Detach from the child. */
@@ -359,8 +469,8 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
}
/* If we're to be following the child, then attach to it, detach
- from inferior_pid, and set inferior_pid to child_pid. */
- else if (STREQ (follow_mode, "child"))
+ from inferior_ptid, and set inferior_ptid to child_pid. */
+ else if (follow_mode == follow_fork_mode_child)
{
char child_pid_spelling[100]; /* Arbitrary length. */
@@ -381,14 +491,16 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
remove_breakpoints ();
/* Also reset the solib inferior hook from the parent. */
- SOLIB_REMOVE_INFERIOR_HOOK (inferior_pid);
+#ifdef SOLIB_REMOVE_INFERIOR_HOOK
+ SOLIB_REMOVE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#endif
/* Detach from the parent. */
dont_repeat ();
target_detach (NULL, 1);
/* Attach to the child. */
- inferior_pid = child_pid;
+ inferior_ptid = pid_to_ptid (child_pid);
sprintf (child_pid_spelling, "%d", child_pid);
dont_repeat ();
@@ -420,19 +532,19 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
/* If we're to be following both parent and child, then fork ourselves,
and attach the debugger clone to the child. */
- else if (STREQ (follow_mode, "both"))
+ else if (follow_mode == follow_fork_mode_both)
{
char pid_suffix[100]; /* Arbitrary length. */
/* Clone ourselves to follow the child. This is the end of our
- involvement with child_pid; our clone will take it from here... */
+ involvement with child_pid; our clone will take it from here... */
dont_repeat ();
target_clone_and_follow_inferior (child_pid, &followed_child);
followed_parent = !followed_child;
/* We continue to follow the parent. To help distinguish the two
debuggers, though, both we and our clone will reset our prompts. */
- sprintf (pid_suffix, "[%d] ", inferior_pid);
+ sprintf (pid_suffix, "[%d] ", PIDGET (inferior_ptid));
set_prompt (strcat (get_prompt (), pid_suffix));
}
@@ -460,12 +572,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,
@@ -476,48 +588,44 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
pending_follow.fork_event.saw_parent_fork = 0;
pending_follow.fork_event.saw_child_fork = 0;
-
- free (follow_mode);
}
static void
-follow_fork (parent_pid, child_pid)
- int parent_pid;
- int child_pid;
+follow_fork (int parent_pid, int child_pid)
{
follow_inferior_fork (parent_pid, child_pid, 1, 0);
}
/* Forward declaration. */
-static void follow_exec PARAMS ((int, char *));
+static void follow_exec (int, char *);
static void
-follow_vfork (parent_pid, child_pid)
- int parent_pid;
- int child_pid;
+follow_vfork (int parent_pid, int child_pid)
{
follow_inferior_fork (parent_pid, child_pid, 0, 1);
/* Did we follow the child? Had it exec'd before we saw the parent vfork? */
- if (pending_follow.fork_event.saw_child_exec && (inferior_pid == child_pid))
+ if (pending_follow.fork_event.saw_child_exec
+ && (PIDGET (inferior_ptid) == child_pid))
{
pending_follow.fork_event.saw_child_exec = 0;
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
- follow_exec (inferior_pid, pending_follow.execd_pathname);
- free (pending_follow.execd_pathname);
+ follow_exec (PIDGET (inferior_ptid), pending_follow.execd_pathname);
+ xfree (pending_follow.execd_pathname);
}
}
-#endif /* HPUXHPPA */
+
+/* EXECD_PATHNAME is assumed to be non-NULL. */
static void
-follow_exec (pid, execd_pathname)
- int pid;
- char *execd_pathname;
+follow_exec (int pid, char *execd_pathname)
{
-#ifdef HPUXHPPA
int saved_pid = pid;
- extern struct target_ops child_ops;
+ struct target_ops *tgt;
+
+ if (!may_follow_exec)
+ return;
/* Did this exec() follow a vfork()? If so, we must follow the
vfork now too. Do it before following the exec. */
@@ -525,13 +633,14 @@ follow_exec (pid, execd_pathname)
(pending_follow.kind == TARGET_WAITKIND_VFORKED))
{
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
- follow_vfork (inferior_pid, pending_follow.fork_event.child_pid);
+ follow_vfork (PIDGET (inferior_ptid),
+ pending_follow.fork_event.child_pid);
follow_vfork_when_exec = 0;
- saved_pid = inferior_pid;
+ saved_pid = PIDGET (inferior_ptid);
/* Did we follow the parent? If so, we're done. If we followed
the child then we must also follow its exec(). */
- if (inferior_pid == pending_follow.fork_event.parent_pid)
+ if (PIDGET (inferior_ptid) == pending_follow.fork_event.parent_pid)
return;
}
@@ -571,22 +680,34 @@ follow_exec (pid, execd_pathname)
/* We've followed the inferior through an exec. Therefore, the
inferior has essentially been killed & reborn. */
+
+ /* First collect the run target in effect. */
+ tgt = find_run_target ();
+ /* If we can't find one, things are in a very strange state... */
+ if (tgt == NULL)
+ error ("Could find run target to save before following exec");
+
gdb_flush (gdb_stdout);
target_mourn_inferior ();
- inferior_pid = saved_pid; /* Because mourn_inferior resets inferior_pid. */
- push_target (&child_ops);
+ inferior_ptid = pid_to_ptid (saved_pid);
+ /* Because mourn_inferior resets inferior_ptid. */
+ push_target (tgt);
/* That a.out is now the one to use. */
exec_file_attach (execd_pathname, 0);
/* And also is where symbols can be found. */
- symbol_file_command (execd_pathname, 0);
+ symbol_file_add_main (execd_pathname, 0);
/* Reset the shared library package. This ensures that we get
a shlib event when the child reaches "_start", at which point
the dld will have had a chance to initialize the child. */
+#if defined(SOLIB_RESTART)
SOLIB_RESTART ();
- SOLIB_CREATE_INFERIOR_HOOK (inferior_pid);
+#endif
+#ifdef SOLIB_CREATE_INFERIOR_HOOK
+ SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#endif
/* Reinsert all breakpoints. (Those which were symbolic have
been reset to the proper address in the new a.out, thanks
@@ -597,7 +718,6 @@ follow_exec (pid, execd_pathname)
startup breakpoints. (If the user had also set bp's on
"main" from the old (parent) process, then they'll auto-
matically get reset there in the new process.) */
-#endif
}
/* Non-zero if we just simulating a single-step. This is needed
@@ -609,24 +729,25 @@ static int singlestep_breakpoints_inserted_p = 0;
/* Things to clean up if we QUIT out of resume (). */
/* ARGSUSED */
static void
-resume_cleanups (arg)
- int arg;
+resume_cleanups (void *ignore)
{
normal_stop ();
}
-static char schedlock_off[] = "off";
-static char schedlock_on[] = "on";
-static char schedlock_step[] = "step";
-static char *scheduler_mode = schedlock_off;
-static char *scheduler_enums[] =
-{schedlock_off, schedlock_on, schedlock_step};
+static const char schedlock_off[] = "off";
+static const char schedlock_on[] = "on";
+static const char schedlock_step[] = "step";
+static const char *scheduler_mode = schedlock_off;
+static const char *scheduler_enums[] =
+{
+ schedlock_off,
+ schedlock_on,
+ schedlock_step,
+ NULL
+};
static void
-set_schedlock_func (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
+set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
{
if (c->type == set_cmd)
if (!target_can_lock_scheduler)
@@ -647,27 +768,38 @@ set_schedlock_func (args, from_tty, c)
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
-resume (step, sig)
- int step;
- enum target_signal sig;
+resume (int step, enum target_signal sig)
{
int should_resume = 1;
- struct cleanup *old_cleanups = make_cleanup ((make_cleanup_func)
- resume_cleanups, 0);
+ struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
QUIT;
-#ifdef CANNOT_STEP_BREAKPOINT
- /* Most targets can step a breakpoint instruction, thus executing it
- normally. But if this one cannot, just continue and we will hit
- it anyway. */
- if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
- step = 0;
-#endif
-
- if (SOFTWARE_SINGLE_STEP_P && step)
+ /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */
+
+
+ /* Some targets (e.g. Solaris x86) have a kernel bug when stepping
+ over an instruction that causes a page fault without triggering
+ a hardware watchpoint. The kernel properly notices that it shouldn't
+ stop, because the hardware watchpoint is not triggered, but it forgets
+ the step request and continues the program normally.
+ Work around the problem by removing hardware watchpoints if a step is
+ requested, GDB will check for a hardware watchpoint trigger after the
+ step anyway. */
+ if (CANNOT_STEP_HW_WATCHPOINTS && step && breakpoints_inserted)
+ remove_hw_watchpoints ();
+
+
+ /* Normally, by the time we reach `resume', the breakpoints are either
+ removed or inserted, as appropriate. The exception is if we're sitting
+ at a permanent breakpoint; we need to step over it, but permanent
+ breakpoints can't be removed. So we have to test for it here. */
+ if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
+ SKIP_PERMANENT_BREAKPOINT ();
+
+ 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
@@ -680,14 +812,14 @@ resume (step, sig)
DO_DEFERRED_STORES;
#endif
-#ifdef HPUXHPPA
/* If there were any forks/vforks/execs that were caught and are
now to be followed, then do so. */
switch (pending_follow.kind)
{
case (TARGET_WAITKIND_FORKED):
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
- follow_fork (inferior_pid, pending_follow.fork_event.child_pid);
+ follow_fork (PIDGET (inferior_ptid),
+ pending_follow.fork_event.child_pid);
break;
case (TARGET_WAITKIND_VFORKED):
@@ -695,21 +827,22 @@ resume (step, sig)
int saw_child_exec = pending_follow.fork_event.saw_child_exec;
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
- follow_vfork (inferior_pid, pending_follow.fork_event.child_pid);
+ follow_vfork (PIDGET (inferior_ptid),
+ pending_follow.fork_event.child_pid);
/* Did we follow the child, but not yet see the child's exec event?
- If so, then it actually ought to be waiting for us; we respond to
- parent vfork events. We don't actually want to resume the child
- in this situation; we want to just get its exec event. */
+ If 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))
+ (PIDGET (inferior_ptid) == pending_follow.fork_event.child_pid))
should_resume = 0;
}
break;
case (TARGET_WAITKIND_EXECD):
/* If we saw a vfork event but couldn't follow it until we saw
- an exec, then now might be the time! */
+ 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;
@@ -717,52 +850,43 @@ resume (step, sig)
default:
break;
}
-#endif /* HPUXHPPA */
/* Install inferior's terminal modes. */
target_terminal_inferior ();
if (should_resume)
{
-#ifdef HPUXHPPA
- if (thread_step_needed)
- {
- /* We stopped on a BPT instruction;
- don't continue other threads and
- just step this thread. */
- thread_step_needed = 0;
+ ptid_t resume_ptid;
- if (!breakpoint_here_p (read_pc ()))
- {
- /* Breakpoint deleted: ok to do regular resume
- where all the threads either step or continue. */
- target_resume (-1, step, sig);
- }
- else
- {
- if (!step)
- {
- warning ("Internal error, changing continue to step.");
- remove_breakpoints ();
- breakpoints_inserted = 0;
- trap_expected = 1;
- step = 1;
- }
+ resume_ptid = RESUME_ALL; /* Default */
- target_resume (inferior_pid, step, sig);
- }
- }
- else
-#endif /* HPUXHPPA */
+ if ((step || singlestep_breakpoints_inserted_p) &&
+ !breakpoints_inserted && breakpoint_here_p (read_pc ()))
{
- /* Vanilla resume. */
+ /* Stepping past a breakpoint without inserting breakpoints.
+ Make sure only the current thread gets to step, so that
+ other threads don't sneak past breakpoints while they are
+ not inserted. */
- if ((scheduler_mode == schedlock_on) ||
- (scheduler_mode == schedlock_step && step != 0))
- target_resume (inferior_pid, step, sig);
- else
- target_resume (-1, step, sig);
+ resume_ptid = inferior_ptid;
}
+
+ if ((scheduler_mode == schedlock_on) ||
+ (scheduler_mode == schedlock_step &&
+ (step || singlestep_breakpoints_inserted_p)))
+ {
+ /* User-settable 'scheduler' mode requires solo thread resume. */
+ resume_ptid = inferior_ptid;
+ }
+
+#ifdef CANNOT_STEP_BREAKPOINT
+ /* Most targets can step a breakpoint instruction, thus executing it
+ normally. But if this one cannot, just continue and we will hit
+ it anyway. */
+ if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
+ step = 0;
+#endif
+ target_resume (resume_ptid, step, sig);
}
discard_cleanups (old_cleanups);
@@ -773,13 +897,13 @@ resume (step, sig)
First do this, then set the ones you want, then call `proceed'. */
void
-clear_proceed_status ()
+clear_proceed_status (void)
{
trap_expected = 0;
step_range_start = 0;
step_range_end = 0;
step_frame_address = 0;
- step_over_calls = -1;
+ step_over_calls = STEP_OVER_UNDEBUGGABLE;
stop_after_trap = 0;
stop_soon_quietly = 0;
proceed_to_finish = 0;
@@ -793,19 +917,16 @@ 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. */
void
-proceed (addr, siggnal, step)
- CORE_ADDR addr;
- enum target_signal siggnal;
- int step;
+proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
{
int oneproc = 0;
@@ -814,11 +935,11 @@ proceed (addr, siggnal, step)
if (step < 0)
stop_after_trap = 1;
- if (addr == (CORE_ADDR) - 1)
+ 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 ()))
@@ -829,8 +950,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 ()))
@@ -839,16 +960,6 @@ proceed (addr, siggnal, step)
else
{
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.
-
- 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;
}
#ifdef PREPARE_TO_PROCEED
@@ -863,10 +974,9 @@ proceed (addr, siggnal, step)
PREPARE_TO_PROCEED checks the current thread against the thread
that reported the most recent event. If a step-over is required
it returns TRUE and sets the current thread to the old thread. */
- if (PREPARE_TO_PROCEED () && breakpoint_here_p (read_pc ()))
+ if (PREPARE_TO_PROCEED (1) && breakpoint_here_p (read_pc ()))
{
oneproc = 1;
- thread_step_needed = 1;
}
#endif /* PREPARE_TO_PROCEED */
@@ -875,9 +985,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;
}
@@ -892,9 +1002,11 @@ proceed (addr, siggnal, step)
int temp = insert_breakpoints ();
if (temp)
{
- print_sys_errmsg ("ptrace", temp);
+ print_sys_errmsg ("insert_breakpoints", temp);
error ("Cannot insert breakpoints.\n\
-The same program may be running in another process.");
+The same program may be running in another process,\n\
+or you may have requested too many hardware\n\
+breakpoints and/or watchpoints.\n");
}
breakpoints_inserted = 1;
@@ -918,9 +1030,13 @@ The same program may be running in another process.");
/* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */
-
- wait_for_inferior ();
- normal_stop ();
+ /* Do this only if we are not using the event loop, or if the target
+ does not support asynchronous execution. */
+ if (!event_loop_p || !target_can_async_p ())
+ {
+ wait_for_inferior ();
+ normal_stop ();
+ }
}
/* Record the pc and sp of the program the last time it stopped.
@@ -935,12 +1051,27 @@ static char *prev_func_name;
/* Start remote-debugging of a machine over a serial link. */
void
-start_remote ()
+start_remote (void)
{
init_thread_list ();
init_wait_for_inferior ();
stop_soon_quietly = 1;
trap_expected = 0;
+
+ /* Always go on waiting for the target, regardless of the mode. */
+ /* FIXME: cagney/1999-09-23: At present it isn't possible to
+ indicate to wait_for_inferior that a target should timeout if
+ nothing is returned (instead of just blocking). Because of this,
+ targets expecting an immediate response need to, internally, set
+ things up so that the target_wait() is forced to eventually
+ timeout. */
+ /* FIXME: cagney/1999-09-24: It isn't possible for target_open() to
+ differentiate to its caller what the state of the target is after
+ the initial open has been performed. Here we're assuming that
+ the target has stopped. It should be possible to eventually have
+ target_open() return to the caller an indication that the target
+ is currently running and GDB state should be set to the same as
+ for an async run. */
wait_for_inferior ();
normal_stop ();
}
@@ -948,7 +1079,7 @@ start_remote ()
/* Initialize static vars when a new inferior begins. */
void
-init_wait_for_inferior ()
+init_wait_for_inferior (void)
{
/* These are meaningless until the first time through wait_for_inferior. */
prev_pc = 0;
@@ -977,8 +1108,7 @@ init_wait_for_inferior ()
}
static void
-delete_breakpoint_current_contents (arg)
- PTR arg;
+delete_breakpoint_current_contents (void *arg)
{
struct breakpoint **breakpointp = (struct breakpoint **) arg;
if (*breakpointp != NULL)
@@ -988,6 +1118,80 @@ delete_breakpoint_current_contents (arg)
}
}
+/* This enum encodes possible reasons for doing a target_wait, so that
+ wfi can call target_wait in one place. (Ultimately the call will be
+ moved out of the infinite loop entirely.) */
+
+enum infwait_states
+{
+ infwait_normal_state,
+ infwait_thread_hop_state,
+ infwait_nullified_state,
+ infwait_nonstep_watch_state
+};
+
+/* Why did the inferior stop? Used to print the appropriate messages
+ to the interface from within handle_inferior_event(). */
+enum inferior_stop_reason
+{
+ /* We don't know why. */
+ STOP_UNKNOWN,
+ /* Step, next, nexti, stepi finished. */
+ END_STEPPING_RANGE,
+ /* Found breakpoint. */
+ BREAKPOINT_HIT,
+ /* Inferior terminated by signal. */
+ SIGNAL_EXITED,
+ /* Inferior exited. */
+ EXITED,
+ /* Inferior received signal, and user asked to be notified. */
+ SIGNAL_RECEIVED
+};
+
+/* This structure contains what used to be local variables in
+ 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 */
+ ptid_t ptid;
+ ptid_t saved_inferior_ptid;
+ int update_step_sp;
+ int stepping_through_solib_after_catch;
+ bpstat stepping_through_solib_catchpoints;
+ int enable_hw_watchpoints_after_wait;
+ int stepping_through_sigtramp;
+ int new_thread_event;
+ struct target_waitstatus tmpstatus;
+ enum infwait_states infwait_state;
+ ptid_t waiton_ptid;
+ int wait_some_more;
+ };
+
+void init_execution_control_state (struct execution_control_state * ecs);
+
+void handle_inferior_event (struct execution_control_state * ecs);
+
+static void check_sigtramp2 (struct execution_control_state *ecs);
+static void step_into_function (struct execution_control_state *ecs);
+static void step_over_function (struct execution_control_state *ecs);
+static void stop_stepping (struct execution_control_state *ecs);
+static void prepare_to_wait (struct execution_control_state *ecs);
+static void keep_going (struct execution_control_state *ecs);
+static void print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info);
+
/* Wait for control to return from inferior to debugger.
If inferior gets a signal, we may decide to start it up again
instead of returning. That is why there is a loop in this function.
@@ -995,429 +1199,572 @@ delete_breakpoint_current_contents (arg)
should be left stopped and GDB should read more commands. */
void
-wait_for_inferior ()
+wait_for_inferior (void)
{
struct cleanup *old_cleanups;
- struct target_waitstatus w;
- int another_trap;
- int random_signal = 0;
- CORE_ADDR stop_func_start;
- CORE_ADDR stop_func_end;
- char *stop_func_name;
-#if 0
- CORE_ADDR prologue_pc = 0;
-#endif
- CORE_ADDR tmp;
- struct symtab_and_line sal;
- int remove_breakpoints_on_following_step = 0;
- int current_line;
- struct symtab *current_symtab;
- int handling_longjmp = 0; /* FIXME */
- int pid;
- int saved_inferior_pid;
- int update_step_sp = 0;
- int stepping_through_solib_after_catch = 0;
- bpstat stepping_through_solib_catchpoints = NULL;
- int enable_hw_watchpoints_after_wait = 0;
- int stepping_through_sigtramp = 0;
- int new_thread_event;
-
-#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
- int stepped_after_stopped_by_watchpoint;
-#endif
+ struct execution_control_state ecss;
+ struct execution_control_state *ecs;
- old_cleanups = make_cleanup (delete_breakpoint_current_contents,
+ old_cleanups = make_cleanup (delete_step_resume_breakpoint,
&step_resume_breakpoint);
make_cleanup (delete_breakpoint_current_contents,
&through_sigtramp_breakpoint);
- sal = find_pc_line (prev_pc, 0);
- current_line = sal.line;
- current_symtab = sal.symtab;
-
- /* Are we stepping? */
-#define CURRENTLY_STEPPING() \
- ((through_sigtramp_breakpoint == NULL \
- && !handling_longjmp \
- && ((step_range_end && step_resume_breakpoint == NULL) \
- || trap_expected)) \
- || stepping_through_solib_after_catch \
- || bpstat_should_step ())
- ;
- thread_step_needed = 0;
-
-#ifdef HPUXHPPA
+
+ /* wfi still stays in a loop, so it's OK just to take the address of
+ a local to get the ecs pointer. */
+ ecs = &ecss;
+
+ /* Fill in with reasonable starting values. */
+ init_execution_control_state (ecs);
+
/* We'll update this if & when we switch to a new thread. */
- switched_from_inferior_pid = inferior_pid;
-#endif
+ previous_inferior_ptid = inferior_ptid;
+
+ 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. */
+
+ registers_changed ();
while (1)
{
- extern int overlay_cache_invalid; /* declared in symfile.h */
+ if (target_wait_hook)
+ ecs->ptid = target_wait_hook (ecs->waiton_ptid, ecs->wp);
+ else
+ ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
+
+ /* Now figure out what to do with the result of the result. */
+ handle_inferior_event (ecs);
+
+ if (!ecs->wait_some_more)
+ break;
+ }
+ do_cleanups (old_cleanups);
+}
+
+/* Asynchronous version of wait_for_inferior. It is called by the
+ event loop whenever a change of state is detected on the file
+ descriptor corresponding to the target. It can be called more than
+ once to complete a single execution command. In such cases we need
+ to keep the state in a global variable ASYNC_ECSS. If it is the
+ last time that this function is called for a single execution
+ command, then report to the user that the inferior has stopped, and
+ do the necessary cleanups. */
+
+struct execution_control_state async_ecss;
+struct execution_control_state *async_ecs;
+
+void
+fetch_inferior_event (void *client_data)
+{
+ static struct cleanup *old_cleanups;
+
+ async_ecs = &async_ecss;
+
+ if (!async_ecs->wait_some_more)
+ {
+ old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint,
+ &step_resume_breakpoint);
+ make_exec_cleanup (delete_breakpoint_current_contents,
+ &through_sigtramp_breakpoint);
+
+ /* Fill in with reasonable starting values. */
+ init_execution_control_state (async_ecs);
+
+ /* We'll update this if & when we switch to a new thread. */
+ previous_inferior_ptid = inferior_ptid;
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 ();
+ }
- if (target_wait_hook)
- pid = target_wait_hook (-1, &w);
+ if (target_wait_hook)
+ async_ecs->ptid = target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
+ else
+ async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp);
+
+ /* Now figure out what to do with the result of the result. */
+ handle_inferior_event (async_ecs);
+
+ if (!async_ecs->wait_some_more)
+ {
+ /* Do only the cleanups that have been added by this
+ function. Let the continuations for the commands do the rest,
+ if there are any. */
+ do_exec_cleanups (old_cleanups);
+ normal_stop ();
+ if (step_multi && stop_step)
+ inferior_event_handler (INF_EXEC_CONTINUE, NULL);
else
- pid = target_wait (-1, &w);
+ inferior_event_handler (INF_EXEC_COMPLETE, NULL);
+ }
+}
- /* 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;
+/* Prepare an execution control state for looping through a
+ wait_for_inferior-type loop. */
- /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event is
- serviced in this loop, below. */
- if (enable_hw_watchpoints_after_wait)
- {
- TARGET_ENABLE_HW_WATCHPOINTS (inferior_pid);
- enable_hw_watchpoints_after_wait = 0;
- }
+void
+init_execution_control_state (struct execution_control_state *ecs)
+{
+ /* ecs->another_trap? */
+ ecs->random_signal = 0;
+ ecs->remove_breakpoints_on_following_step = 0;
+ ecs->handling_longjmp = 0; /* FIXME */
+ ecs->update_step_sp = 0;
+ ecs->stepping_through_solib_after_catch = 0;
+ ecs->stepping_through_solib_catchpoints = NULL;
+ ecs->enable_hw_watchpoints_after_wait = 0;
+ ecs->stepping_through_sigtramp = 0;
+ ecs->sal = find_pc_line (prev_pc, 0);
+ ecs->current_line = ecs->sal.line;
+ ecs->current_symtab = ecs->sal.symtab;
+ ecs->infwait_state = infwait_normal_state;
+ ecs->waiton_ptid = pid_to_ptid (-1);
+ ecs->wp = &(ecs->ws);
+}
+/* Call this function before setting step_resume_breakpoint, as a
+ sanity check. There should never be more than one step-resume
+ breakpoint per thread, so we should never be setting a new
+ step_resume_breakpoint when one is already active. */
+static void
+check_for_old_step_resume_breakpoint (void)
+{
+ if (step_resume_breakpoint)
+ warning ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
+}
-#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
- stepped_after_stopped_by_watchpoint = 0;
-#endif
+/* Return the cached copy of the last pid/waitstatus returned by
+ target_wait()/target_wait_hook(). The data is actually cached by
+ handle_inferior_event(), which gets called immediately after
+ target_wait()/target_wait_hook(). */
- /* Gross.
+void
+get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
+{
+ *ptidp = target_last_wait_ptid;
+ *status = target_last_waitstatus;
+}
- We goto this label from elsewhere in wait_for_inferior when we want
- to continue the main loop without calling "wait" and trashing the
- waitstatus contained in W. */
- have_waited:
+/* Switch thread contexts, maintaining "infrun state". */
- flush_cached_frames ();
+static void
+context_switch (struct execution_control_state *ecs)
+{
+ /* Caution: it may happen that the new thread (or the old one!)
+ is not in the thread list. In this case we must not attempt
+ to "switch context", or we run the risk that our context may
+ be lost. This may happen as a result of the target module
+ mishandling thread creation. */
+
+ if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid))
+ { /* Perform infrun state context switch: */
+ /* Save infrun state for the old thread. */
+ save_infrun_state (inferior_ptid, prev_pc,
+ prev_func_start, prev_func_name,
+ 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,
+ ecs->current_line, ecs->current_symtab,
+ step_sp);
+
+ /* Load infrun state for the new thread. */
+ load_infrun_state (ecs->ptid, &prev_pc,
+ &prev_func_start, &prev_func_name,
+ &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,
+ &ecs->current_line, &ecs->current_symtab,
+ &step_sp);
+ }
+ inferior_ptid = ecs->ptid;
+}
- /* If it's a new process, add it to the thread database */
- new_thread_event = ((pid != inferior_pid) && !in_thread_list (pid));
+/* Given an execution control state that has been freshly filled in
+ by an event from the inferior, figure out what it means and take
+ appropriate action. */
- if (w.kind != TARGET_WAITKIND_EXITED
- && w.kind != TARGET_WAITKIND_SIGNALLED
- && new_thread_event)
- {
- add_thread (pid);
+void
+handle_inferior_event (struct execution_control_state *ecs)
+{
+ CORE_ADDR tmp;
+ int stepped_after_stopped_by_watchpoint;
+ /* Cache the last pid/waitstatus. */
+ target_last_wait_ptid = ecs->ptid;
+ target_last_waitstatus = *ecs->wp;
-#ifdef HPUXHPPA
- fprintf_unfiltered (gdb_stderr, "[New %s]\n",
- target_pid_or_tid_to_str (pid));
+ /* Keep this extra brace for now, minimizes diffs. */
+ {
+ switch (ecs->infwait_state)
+ {
+ case infwait_thread_hop_state:
+ /* Cancel the waiton_ptid. */
+ ecs->waiton_ptid = pid_to_ptid (-1);
+ /* Fall thru to the normal_state case. */
+
+ case infwait_normal_state:
+ /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event
+ is serviced in this loop, below. */
+ if (ecs->enable_hw_watchpoints_after_wait)
+ {
+ TARGET_ENABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
+ ecs->enable_hw_watchpoints_after_wait = 0;
+ }
+ stepped_after_stopped_by_watchpoint = 0;
+ break;
-#else
- printf_filtered ("[New %s]\n", target_pid_to_str (pid));
-#endif
+ case infwait_nullified_state:
+ break;
-#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);
- continue;
-#endif
- }
+ case infwait_nonstep_watch_state:
+ insert_breakpoints ();
- switch (w.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)
- {
- extern int auto_solib_add;
+ /* 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;
- /* Remove breakpoints, SOLIB_ADD might adjust
- breakpoint addresses via breakpoint_re_set. */
- if (breakpoints_inserted)
- remove_breakpoints ();
+ flush_cached_frames ();
- /* 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 it's a new process, add it to the thread database */
- /* Reinsert breakpoints and continue. */
- if (breakpoints_inserted)
- insert_breakpoints ();
- }
+ ecs->new_thread_event = (! ptid_equal (ecs->ptid, inferior_ptid)
+ && ! in_thread_list (ecs->ptid));
+
+ if (ecs->ws.kind != TARGET_WAITKIND_EXITED
+ && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
+ && ecs->new_thread_event)
+ {
+ add_thread (ecs->ptid);
+
+ ui_out_text (uiout, "[New ");
+ ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
+ ui_out_text (uiout, "]\n");
+
+#if 0
+ /* NOTE: This block is ONLY meant to be invoked in case of a
+ "thread creation event"! If it is invoked for any other
+ sort of event (such as a new thread landing on a breakpoint),
+ the event will be discarded, which is almost certainly
+ a bad thing!
+
+ To avoid this, the low-level module (eg. target_wait)
+ should call in_thread_list and add_thread, so that the
+ new thread is known by the time we get here. */
+
+ /* We may want to consider not doing a resume here in order
+ to give the user a chance to play with the new thread.
+ It might be good to make that a user-settable option. */
+
+ /* At this point, all threads are stopped (happens
+ automatically in either the OS or the native code).
+ Therefore we need to continue all threads in order to
+ make progress. */
+
+ target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
#endif
- resume (0, TARGET_SIGNAL_0);
- continue;
-
- case TARGET_WAITKIND_SPURIOUS:
- resume (0, TARGET_SIGNAL_0);
- continue;
-
- case TARGET_WAITKIND_EXITED:
- target_terminal_ours (); /* Must do this before mourn anyway */
- annotate_exited (w.value.integer);
- if (w.value.integer)
- printf_filtered ("\nProgram exited with code 0%o.\n",
- (unsigned int) w.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) w.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 = w.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 = w.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 == pid)
- {
- pending_follow.fork_event.saw_parent_fork = 1;
- pending_follow.fork_event.parent_pid = pid;
- pending_follow.fork_event.child_pid = w.value.related_pid;
- continue;
- }
- else
- {
- pending_follow.fork_event.saw_child_fork = 1;
- pending_follow.fork_event.child_pid = pid;
- pending_follow.fork_event.parent_pid = w.value.related_pid;
- }
+ 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 ();
- stop_pc = read_pc_pid (pid);
- saved_inferior_pid = inferior_pid;
- inferior_pid = pid;
- stop_bpstat = bpstat_stop_status
- (&stop_pc,
-#if DECR_PC_AFTER_BREAK
- (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && CURRENTLY_STEPPING ())
-#else /* DECR_PC_AFTER_BREAK zero */
- 0
-#endif /* DECR_PC_AFTER_BREAK zero */
- );
- random_signal = !bpstat_explains_signal (stop_bpstat);
- inferior_pid = 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 = w.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 (pid == inferior_pid)
- {
- pending_follow.fork_event.saw_parent_fork = 1;
- pending_follow.fork_event.parent_pid = pid;
- pending_follow.fork_event.child_pid = w.value.related_pid;
- }
+ /* Check for any newly added shared libraries if we're
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
- /* If 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 = pid;
- pending_follow.fork_event.parent_pid = w.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 (pid, 0, TARGET_SIGNAL_0);
- continue;
- }
- }
+ /* Reinsert breakpoints and continue. */
+ if (breakpoints_inserted)
+ insert_breakpoints ();
+ }
+#endif
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
- stop_pc = read_pc ();
- stop_bpstat = bpstat_stop_status
- (&stop_pc,
-#if DECR_PC_AFTER_BREAK
- (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && CURRENTLY_STEPPING ())
-#else /* DECR_PC_AFTER_BREAK zero */
- 0
-#endif /* DECR_PC_AFTER_BREAK zero */
- );
- 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 (pid, 0, TARGET_SIGNAL_0);
- continue;
- }
- inferior_ignoring_leading_exec_events =
- target_reported_exec_events_per_exec_call () - 1;
+ case TARGET_WAITKIND_SPURIOUS:
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
- pending_follow.execd_pathname = savestring (w.value.execd_pathname,
- strlen (w.value.execd_pathname));
+ case TARGET_WAITKIND_EXITED:
+ target_terminal_ours (); /* Must do this before mourn anyway */
+ print_stop_reason (EXITED, ecs->ws.value.integer);
+
+ /* Record the exit code in the convenience variable $_exitcode, so
+ that the user can inspect this again later. */
+ set_internalvar (lookup_internalvar ("_exitcode"),
+ value_from_longest (builtin_type_int,
+ (LONGEST) ecs->ws.value.integer));
+ gdb_flush (gdb_stdout);
+ target_mourn_inferior ();
+ singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
+ stop_print_frame = 0;
+ stop_stepping (ecs);
+ return;
- /* Did inferior_pid exec, or did a (possibly not-yet-followed)
- child of a vfork exec?
+ case TARGET_WAITKIND_SIGNALLED:
+ stop_print_frame = 0;
+ stop_signal = ecs->ws.value.sig;
+ target_terminal_ours (); /* Must do this before mourn anyway */
+
+ /* Note: By definition of TARGET_WAITKIND_SIGNALLED, we shouldn't
+ reach here unless the inferior is dead. However, for years
+ target_kill() was called here, which hints that fatal signals aren't
+ really fatal on some systems. If that's true, then some changes
+ may be needed. */
+ target_mourn_inferior ();
+
+ print_stop_reason (SIGNAL_EXITED, stop_signal);
+ singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
+ stop_stepping (ecs);
+ return;
- ??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.
+ /* The following are the only cases in which we keep going;
+ the above cases end in a continue or goto. */
+ case TARGET_WAITKIND_FORKED:
+ stop_signal = TARGET_SIGNAL_TRAP;
+ pending_follow.kind = ecs->ws.kind;
+
+ /* Ignore fork events reported for the parent; we're only
+ interested in reacting to forks of the child. Note that
+ we expect the child's fork event to be available if we
+ waited for it now. */
+ if (ptid_equal (inferior_ptid, ecs->ptid))
+ {
+ pending_follow.fork_event.saw_parent_fork = 1;
+ pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
+ pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
+ prepare_to_wait (ecs);
+ return;
+ }
+ else
+ {
+ pending_follow.fork_event.saw_child_fork = 1;
+ pending_follow.fork_event.child_pid = PIDGET (ecs->ptid);
+ pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
+ }
- 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".
+ stop_pc = read_pc_pid (ecs->ptid);
+ ecs->saved_inferior_ptid = inferior_ptid;
+ inferior_ptid = ecs->ptid;
+ /* The second argument of bpstat_stop_status is meant to help
+ distinguish between a breakpoint trap and a singlestep trap.
+ This is only important on targets where DECR_PC_AFTER_BREAK
+ is non-zero. The prev_pc test is meant to distinguish between
+ singlestepping a trap instruction, and singlestepping thru a
+ jump to the instruction following a trap instruction. */
+
+ stop_bpstat = bpstat_stop_status (&stop_pc,
+ currently_stepping (ecs) &&
+ prev_pc !=
+ stop_pc - DECR_PC_AFTER_BREAK);
+ ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
+ inferior_ptid = ecs->saved_inferior_ptid;
+ goto process_event_stop_test;
+
+ /* If this a platform which doesn't allow a debugger to touch a
+ vfork'd inferior until after it exec's, then we'd best keep
+ our fingers entirely off the inferior, other than continuing
+ it. This has the unfortunate side-effect that catchpoints
+ of vforks will be ignored. But since the platform doesn't
+ allow the inferior be touched at vfork time, there's really
+ little choice. */
+ case TARGET_WAITKIND_VFORKED:
+ stop_signal = TARGET_SIGNAL_TRAP;
+ pending_follow.kind = ecs->ws.kind;
+
+ /* Is this a vfork of the parent? If so, then give any
+ vfork catchpoints a chance to trigger now. (It's
+ dangerous to do so if the child canot be touched until
+ it execs, and the child has not yet exec'd. We probably
+ should warn the user to that effect when the catchpoint
+ triggers...) */
+ if (ptid_equal (ecs->ptid, inferior_ptid))
+ {
+ pending_follow.fork_event.saw_parent_fork = 1;
+ pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
+ pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
+ }
- 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 (pid, 1, TARGET_SIGNAL_0);
- /* We expect the parent vfork event to be available now. */
- 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 = PIDGET (ecs->ptid);
+ pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
+ target_post_startup_inferior (
+ pid_to_ptid (pending_follow.fork_event.child_pid));
+ follow_vfork_when_exec = !target_can_follow_vfork_prior_to_exec ();
+ if (follow_vfork_when_exec)
+ {
+ target_resume (ecs->ptid, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+ }
- /* 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 (pid);
- saved_inferior_pid = inferior_pid;
- inferior_pid = pid;
- stop_bpstat = bpstat_stop_status
- (&stop_pc,
-#if DECR_PC_AFTER_BREAK
- (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && CURRENTLY_STEPPING ())
-#else /* DECR_PC_AFTER_BREAK zero */
- 0
-#endif /* DECR_PC_AFTER_BREAK zero */
- );
- random_signal = !bpstat_explains_signal (stop_bpstat);
- inferior_pid = 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);
- continue;
+ stop_pc = read_pc ();
+ /* The second argument of bpstat_stop_status is meant to help
+ distinguish between a breakpoint trap and a singlestep trap.
+ This is only important on targets where DECR_PC_AFTER_BREAK
+ is non-zero. The prev_pc test is meant to distinguish between
+ singlestepping a trap instruction, and singlestepping thru a
+ jump to the instruction following a trap instruction. */
+
+ stop_bpstat = bpstat_stop_status (&stop_pc,
+ currently_stepping (ecs) &&
+ prev_pc !=
+ stop_pc - DECR_PC_AFTER_BREAK);
+ ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
+ goto process_event_stop_test;
+
+ case TARGET_WAITKIND_EXECD:
+ stop_signal = TARGET_SIGNAL_TRAP;
+
+ /* Is this a target which reports multiple exec events per actual
+ call to exec()? (HP-UX using ptrace does, for example.) If so,
+ ignore all but the last one. Just resume the exec'r, and wait
+ for the next exec event. */
+ if (inferior_ignoring_leading_exec_events)
+ {
+ inferior_ignoring_leading_exec_events--;
+ if (pending_follow.kind == TARGET_WAITKIND_VFORKED)
+ ENSURE_VFORKING_PARENT_REMAINS_STOPPED (pending_follow.fork_event.parent_pid);
+ target_resume (ecs->ptid, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+ inferior_ignoring_leading_exec_events =
+ target_reported_exec_events_per_exec_call () - 1;
+
+ pending_follow.execd_pathname =
+ savestring (ecs->ws.value.execd_pathname,
+ strlen (ecs->ws.value.execd_pathname));
+
+ /* Did inferior_ptid exec, or did a (possibly not-yet-followed)
+ child of a vfork exec?
+
+ ??rehrauer: This is unabashedly an HP-UX specific thing. On
+ HP-UX, events associated with a vforking inferior come in
+ threes: a vfork event for the child (always first), followed
+ a vfork event for the parent and an exec event for the child.
+ The latter two can come in either order.
+
+ If we get the parent vfork event first, life's good: We follow
+ either the parent or child, and then the child's exec event is
+ a "don't care".
+
+ But if we get the child's exec event first, then we delay
+ responding to it until we handle the parent's vfork. Because,
+ otherwise we can't satisfy a "catch vfork". */
+ if (pending_follow.kind == TARGET_WAITKIND_VFORKED)
+ {
+ pending_follow.fork_event.saw_child_exec = 1;
+
+ /* On some targets, the child must be resumed before
+ the parent vfork event is delivered. A single-step
+ suffices. */
+ if (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK ())
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
+ /* We expect the parent vfork event to be available now. */
+ prepare_to_wait (ecs);
+ return;
+ }
- /* Before examining the threads further, step this thread to
+ /* This causes the eventpoints and symbol table to be reset. Must
+ do this now, before trying to determine whether to stop. */
+ follow_exec (PIDGET (inferior_ptid), pending_follow.execd_pathname);
+ xfree (pending_follow.execd_pathname);
+
+ stop_pc = read_pc_pid (ecs->ptid);
+ ecs->saved_inferior_ptid = inferior_ptid;
+ inferior_ptid = ecs->ptid;
+ /* The second argument of bpstat_stop_status is meant to help
+ distinguish between a breakpoint trap and a singlestep trap.
+ This is only important on targets where DECR_PC_AFTER_BREAK
+ is non-zero. The prev_pc test is meant to distinguish between
+ singlestepping a trap instruction, and singlestepping thru a
+ jump to the instruction following a trap instruction. */
+
+ stop_bpstat = bpstat_stop_status (&stop_pc,
+ currently_stepping (ecs) &&
+ prev_pc !=
+ stop_pc - DECR_PC_AFTER_BREAK);
+ ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
+ inferior_ptid = ecs->saved_inferior_ptid;
+ goto process_event_stop_test;
+
+ /* These syscall events are returned on HP-UX, as part of its
+ implementation of page-protection-based "hardware" watchpoints.
+ HP-UX has unfortunate interactions between page-protections and
+ some system calls. Our solution is to disable hardware watches
+ when a system call is entered, and reenable them when the syscall
+ completes. The downside of this is that we may miss the precise
+ point at which a watched piece of memory is modified. "Oh well."
+
+ Note that we may have multiple threads running, which may each
+ enter syscalls at roughly the same time. Since we don't have a
+ good notion currently of whether a watched piece of memory is
+ thread-private, we'd best not have any page-protections active
+ when any thread is in a syscall. Thus, we only want to reenable
+ hardware watches when no threads are in a syscall.
+
+ Also, be careful not to try to gather much state about a thread
+ that's in a syscall. It's frequently a losing proposition. */
+ case TARGET_WAITKIND_SYSCALL_ENTRY:
+ number_of_threads_in_syscalls++;
+ if (number_of_threads_in_syscalls == 1)
+ {
+ TARGET_DISABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
+ }
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+
+ /* 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
@@ -1428,120 +1775,142 @@ wait_for_inferior ()
the thread (this causes the next wait on the thread to hang).
Nor can we enable them after stepping until we've done a wait.
- Thus, we simply set the flag enable_hw_watchpoints_after_wait
+ Thus, we simply set the flag ecs->enable_hw_watchpoints_after_wait
here, which will be serviced immediately after the target
is waited on. */
- case TARGET_WAITKIND_SYSCALL_RETURN:
- target_resume (pid, 1, TARGET_SIGNAL_0);
-
- if (number_of_threads_in_syscalls > 0)
- {
- number_of_threads_in_syscalls--;
- enable_hw_watchpoints_after_wait =
- (number_of_threads_in_syscalls == 0);
- }
- continue;
-
- case TARGET_WAITKIND_STOPPED:
- stop_signal = w.value.sig;
- break;
- }
+ case TARGET_WAITKIND_SYSCALL_RETURN:
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
- /* We may want to consider not doing a resume here in order to give
- the user a chance to play with the new thread. It might be good
- to make that a user-settable option. */
-
- /* 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 (new_thread_event)
- {
- target_resume (-1, 0, TARGET_SIGNAL_0);
- 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);
+ }
+ prepare_to_wait (ecs);
+ return;
- stop_pc = read_pc_pid (pid);
+ case TARGET_WAITKIND_STOPPED:
+ stop_signal = ecs->ws.value.sig;
+ break;
+
+ /* We had an event in the inferior, but we are not interested
+ in handling it at this level. The lower layers have already
+ done what needs to be done, if anything. This case can
+ occur only when the target is async or extended-async. One
+ of the circumstamces for this to happen is when the
+ inferior produces output for the console. The inferior has
+ not stopped, and we are ignoring the event. */
+ case TARGET_WAITKIND_IGNORE:
+ ecs->wait_some_more = 1;
+ return;
+ }
- /* See if a thread hit a thread-specific breakpoint that was meant for
- another thread. If so, then step that thread past the breakpoint,
- and continue it. */
+ /* We may want to consider not doing a resume here in order to give
+ the user a chance to play with the new thread. It might be good
+ to make that a user-settable option. */
- if (stop_signal == TARGET_SIGNAL_TRAP)
- {
- if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
- random_signal = 0;
- else if (breakpoints_inserted
- && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
- {
- random_signal = 0;
- if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
- 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, 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, pid);
- }
- else
- { /* Single step */
- target_resume (pid, 1, TARGET_SIGNAL_0);
- /* FIXME: What if a signal arrives instead of the
- single-step happening? */
-
- if (target_wait_hook)
- target_wait_hook (pid, &w);
- else
- target_wait (pid, &w);
- insert_breakpoints ();
- }
+ /* At this point, all threads are stopped (happens automatically in
+ either the OS or the native code). Therefore we need to continue
+ all threads in order to make progress. */
+ if (ecs->new_thread_event)
+ {
+ target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
- /* We need to restart all the threads now. */
- target_resume (-1, 0, TARGET_SIGNAL_0);
- 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
- random_signal = 1;
+ stop_pc = read_pc_pid (ecs->ptid);
- /* 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.
+ /* 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. */
- 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 ((pid != inferior_pid) &&
- (pending_follow.kind == TARGET_WAITKIND_SPURIOUS))
- {
- int printed = 0;
+ 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;
+ if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
+ ecs->ptid))
+ {
+ int remove_status;
+
+ /* Saw a breakpoint, but it was hit by the wrong thread.
+ Just continue. */
+ if (DECR_PC_AFTER_BREAK)
+ write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid);
+
+ remove_status = remove_breakpoints ();
+ /* Did we fail to remove breakpoints? If so, try
+ to set the PC past the bp. (There's at least
+ one situation in which we can fail to remove
+ the bp's: On HP-UX's that use ttrace, we can't
+ change the address space of a vforking child
+ process until the child exits (well, okay, not
+ then either :-) or execs. */
+ if (remove_status != 0)
+ {
+ /* FIXME! This is obviously non-portable! */
+ write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4,
+ ecs->ptid);
+ /* We need to restart all the threads now,
+ * unles we're running in scheduler-locked mode.
+ * Use currently_stepping to determine whether to
+ * step or continue.
+ */
+ /* FIXME MVS: is there any reason not to call resume()? */
+ if (scheduler_mode == schedlock_on)
+ target_resume (ecs->ptid,
+ currently_stepping (ecs),
+ TARGET_SIGNAL_0);
+ else
+ target_resume (RESUME_ALL,
+ currently_stepping (ecs),
+ TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+ else
+ { /* Single step */
+ breakpoints_inserted = 0;
+ if (!ptid_equal (inferior_ptid, ecs->ptid))
+ context_switch (ecs);
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->ws);
+ ecs->another_trap = 1;
+
+ ecs->infwait_state = infwait_thread_hop_state;
+ keep_going (ecs);
+ registers_changed ();
+ return;
+ }
+ }
+ }
+ }
+ else
+ ecs->random_signal = 1;
+
+ /* See if something interesting happened to the non-current thread. If
+ so, then switch to that thread, and eventually give control back to
+ the user.
+
+ Note that if there's any kind of pending follow (i.e., of a fork,
+ vfork or exec), we don't want to do this now. Rather, we'll let
+ the next resume handle it. */
+ if (! ptid_equal (ecs->ptid, inferior_ptid) &&
+ (pending_follow.kind == TARGET_WAITKIND_SPURIOUS))
+ {
+ int printed = 0;
- /* If it's a random signal for a non-current thread, notify user
- if he's expressed an interest. */
- if (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
@@ -1553,1380 +1922,1422 @@ wait_for_inferior ()
For now, remove the message altogether. */
#if 0
- printed = 1;
- target_terminal_ours_for_output ();
- printf_filtered ("\nProgram received signal %s, %s.\n",
- target_signal_to_name (stop_signal),
- target_signal_to_string (stop_signal));
- gdb_flush (gdb_stdout);
+ printed = 1;
+ target_terminal_ours_for_output ();
+ printf_filtered ("\nProgram received signal %s, %s.\n",
+ target_signal_to_name (stop_signal),
+ target_signal_to_string (stop_signal));
+ gdb_flush (gdb_stdout);
#endif
- }
+ }
- /* If it's not SIGTRAP and not a signal we want to stop for, then
- continue the thread. */
+ /* If it's not SIGTRAP and not a signal we want to stop for, then
+ continue the thread. */
- if (stop_signal != TARGET_SIGNAL_TRAP
- && !signal_stop[stop_signal])
- {
- if (printed)
- target_terminal_inferior ();
+ if (stop_signal != TARGET_SIGNAL_TRAP
+ && !signal_stop[stop_signal])
+ {
+ if (printed)
+ target_terminal_inferior ();
- /* Clear the signal if it should not be passed. */
- if (signal_program[stop_signal] == 0)
- stop_signal = TARGET_SIGNAL_0;
+ /* Clear the signal if it should not be passed. */
+ if (signal_program[stop_signal] == 0)
+ stop_signal = TARGET_SIGNAL_0;
- target_resume (pid, 0, stop_signal);
- continue;
- }
+ target_resume (ecs->ptid, 0, stop_signal);
+ prepare_to_wait (ecs);
+ return;
+ }
- /* It's a SIGTRAP or a signal we're interested in. Switch threads,
- and fall into the rest of wait_for_inferior(). */
-
- /* 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, handling_longjmp,
- another_trap,
- stepping_through_solib_after_catch,
- stepping_through_solib_catchpoints,
- stepping_through_sigtramp);
-
-#ifdef HPUXHPPA
- switched_from_inferior_pid = inferior_pid;
-#endif
+ /* It's a SIGTRAP or a signal we're interested in. Switch threads,
+ and fall into the rest of wait_for_inferior(). */
- inferior_pid = 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, &handling_longjmp,
- &another_trap,
- &stepping_through_solib_after_catch,
- &stepping_through_solib_catchpoints,
- &stepping_through_sigtramp);
-
- if (context_hook)
- context_hook (pid_to_thread_id (pid));
-
- printf_filtered ("[Switching to %s]\n", target_pid_to_str (pid));
- flush_cached_frames ();
- }
+ context_switch (ecs);
- if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
- {
- /* Pull the single step breakpoints out of the target. */
- SOFTWARE_SINGLE_STEP (0, 0);
- singlestep_breakpoints_inserted_p = 0;
- }
+ if (context_hook)
+ context_hook (pid_to_thread_id (ecs->ptid));
- /* 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. */
+ flush_cached_frames ();
+ }
-#if 0 /* XXX DEBUG */
- printf ("infrun.c:1607: pc = 0x%x\n", read_pc ());
-#endif
- /* if (INSTRUCTION_NULLIFIED && CURRENTLY_STEPPING ()) */
- if (INSTRUCTION_NULLIFIED)
- {
- struct target_waitstatus tmpstatus;
-#if 0
- all_registers_info ((char *) 0, 0);
-#endif
- registers_changed ();
- target_resume (pid, 1, TARGET_SIGNAL_0);
-
- /* We may have received a signal that we want to pass to
- the inferior; therefore, we must not clobber the waitstatus
- in W. So we call wait ourselves, then continue the loop
- at the "have_waited" label. */
- if (target_wait_hook)
- target_wait_hook (pid, &tmpstatus);
- else
- target_wait (pid, &tmpstatus);
+ 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;
+ }
- goto have_waited;
- }
+ /* 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. */
-#ifdef HAVE_STEPPABLE_WATCHPOINT
- /* 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 (STOPPED_BY_WATCHPOINT (w))
- {
- resume (1, 0);
- continue;
- }
-#endif
+ /* if (INSTRUCTION_NULLIFIED && currently_stepping (ecs)) */
+ if (INSTRUCTION_NULLIFIED)
+ {
+ registers_changed ();
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
-#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
- /* 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 (STOPPED_BY_WATCHPOINT (w))
- {
-/* 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. */
+ /* We may have received a signal that we want to pass to
+ the inferior; therefore, we must not clobber the waitstatus
+ in WS. */
- write_pc (stop_pc - DECR_PC_AFTER_BREAK);
+ ecs->infwait_state = infwait_nullified_state;
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->tmpstatus);
+ prepare_to_wait (ecs);
+ return;
+ }
- remove_breakpoints ();
- registers_changed ();
- target_resume (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);
+ prepare_to_wait (ecs);
+ return;
+ }
- if (target_wait_hook)
- target_wait_hook (pid, &w);
- else
- target_wait (pid, &w);
- insert_breakpoints ();
+ /* It is far more common to need to disable a watchpoint to step
+ the inferior over it. FIXME. What else might a debug
+ register or page protection watchpoint scheme need here? */
+ if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
+ {
+ /* At this point, we are stopped at an instruction which has
+ attempted to write to a piece of memory under control of
+ a watchpoint. The instruction hasn't actually executed
+ yet. If we were to evaluate the watchpoint expression
+ now, we would get the old value, and therefore no change
+ would seem to have occurred.
+
+ In order to make watchpoints work `right', we really need
+ to complete the memory write, and then evaluate the
+ watchpoint expression. The following code does that by
+ removing the watchpoint (actually, all watchpoints and
+ breakpoints), single-stepping the target, re-inserting
+ watchpoints, and then falling through to let normal
+ single-step processing handle proceed. Since this
+ includes evaluating watchpoints, things will come to a
+ stop in the correct manner. */
+
+ if (DECR_PC_AFTER_BREAK)
+ write_pc (stop_pc - DECR_PC_AFTER_BREAK);
- /* 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;
- goto have_waited;
- }
-#endif
+ remove_breakpoints ();
+ registers_changed ();
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); /* Single step */
-#ifdef HAVE_CONTINUABLE_WATCHPOINT
- /* It may be possible to simply continue after a watchpoint. */
- STOPPED_BY_WATCHPOINT (w);
-#endif
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->ws);
+ ecs->infwait_state = infwait_nonstep_watch_state;
+ prepare_to_wait (ecs);
+ return;
+ }
- stop_func_start = 0;
- stop_func_end = 0;
- 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, &stop_func_name, &stop_func_start,
- &stop_func_end);
- stop_func_start += FUNCTION_START_OFFSET;
- another_trap = 0;
- bpstat_clear (&stop_bpstat);
- stop_step = 0;
- stop_stack_dummy = 0;
- stop_print_frame = 1;
- 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 another_trap to 1 to single step once)
- 3) set 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. */
+ /* It may be possible to simply continue after a watchpoint. */
+ if (HAVE_CONTINUABLE_WATCHPOINT)
+ STOPPED_BY_WATCHPOINT (ecs->ws);
+
+ ecs->stop_func_start = 0;
+ ecs->stop_func_end = 0;
+ ecs->stop_func_name = 0;
+ /* Don't care about return value; stop_func_start and stop_func_name
+ will both be 0 if it doesn't work. */
+ find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+ &ecs->stop_func_start, &ecs->stop_func_end);
+ ecs->stop_func_start += FUNCTION_START_OFFSET;
+ ecs->another_trap = 0;
+ bpstat_clear (&stop_bpstat);
+ stop_step = 0;
+ stop_stack_dummy = 0;
+ stop_print_frame = 1;
+ ecs->random_signal = 0;
+ stopped_by_random_signal = 0;
+ breakpoints_failed = 0;
+
+ /* Look at the cause of the stop, and decide what to do.
+ The alternatives are:
+ 1) break; to really stop and return to the debugger,
+ 2) drop through to start up again
+ (set ecs->another_trap to 1 to single step once)
+ 3) set ecs->random_signal to 1, and the decision between 1 and 2
+ will be made according to the signal handling tables. */
+
+ /* First, distinguish signals caused by the debugger from signals
+ that have to do with the program's own actions.
+ Note that breakpoint insns may cause SIGTRAP or SIGILL
+ or SIGEMT, depending on the operating system version.
+ Here we detect when a SIGILL or SIGEMT is really a breakpoint
+ and change it to SIGTRAP. */
+
+ if (stop_signal == TARGET_SIGNAL_TRAP
+ || (breakpoints_inserted &&
+ (stop_signal == TARGET_SIGNAL_ILL
+ || stop_signal == TARGET_SIGNAL_EMT
+ ))
+ || stop_soon_quietly)
+ {
+ if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
+ {
+ stop_print_frame = 0;
+ stop_stepping (ecs);
+ return;
+ }
+ if (stop_soon_quietly)
+ {
+ stop_stepping (ecs);
+ return;
+ }
- 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;
- break;
- }
- if (stop_soon_quietly)
- 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. */
+
+ /* The second argument of bpstat_stop_status is meant to help
+ distinguish between a breakpoint trap and a singlestep trap.
+ This is only important on targets where DECR_PC_AFTER_BREAK
+ is non-zero. The prev_pc test is meant to distinguish between
+ singlestepping a trap instruction, and singlestepping thru a
+ jump to the instruction following a trap instruction. */
+
+ stop_bpstat = bpstat_stop_status
+ (&stop_pc,
+ /* Pass TRUE if our reason for stopping is something other
+ than hitting a breakpoint. We do this by checking that
+ 1) stepping is going on and 2) we didn't hit a breakpoint
+ in a signal handler without an intervening stop in
+ sigtramp, which is detected by a new stack pointer value
+ below any usual function calling stack adjustments. */
+ (currently_stepping (ecs)
+ && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+ && !(step_range_end
+ && INNER_THAN (read_sp (), (step_sp - 16))))
+ );
+ /* Following in case break condition called a
+ function. */
+ stop_print_frame = 1;
+ }
- 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 ()
- && 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)
+ ecs->random_signal
+ = !(bpstat_explains_signal (stop_bpstat)
+ || trap_expected
+ || (!CALL_DUMMY_BREAKPOINT_OFFSET_P
+ && PC_IN_CALL_DUMMY (stop_pc, read_sp (),
+ FRAME_FP (get_current_frame ())))
+ || (step_range_end && step_resume_breakpoint == NULL));
- if (stop_signal == TARGET_SIGNAL_TRAP)
- random_signal
+ else
+ {
+ ecs->random_signal
= !(bpstat_explains_signal (stop_bpstat)
- || trap_expected
-#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
- || PC_IN_CALL_DUMMY (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ()))
-#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
- || (step_range_end && step_resume_breakpoint == NULL));
-
- else
- {
- 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. */
-#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
- || PC_IN_CALL_DUMMY (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ()))
-#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
- );
- if (!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
- 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 (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 (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 (w.kind == TARGET_WAITKIND_FORKED)
- {
- if (random_signal) /* I.e., no catchpoint triggered for this. */
- {
- trap_expected = 1;
- stop_signal = TARGET_SIGNAL_0;
- goto keep_going;
- }
- }
- else if (w.kind == TARGET_WAITKIND_VFORKED)
- {
- if (random_signal) /* I.e., no catchpoint triggered for this. */
- {
- stop_signal = TARGET_SIGNAL_0;
- goto keep_going;
- }
- }
- else if (w.kind == TARGET_WAITKIND_EXECD)
- {
- pending_follow.kind = w.kind;
- if (random_signal) /* I.e., no catchpoint triggered for this. */
- {
- trap_expected = 1;
- stop_signal = TARGET_SIGNAL_0;
- goto keep_going;
- }
- }
-
- /* For the program's own signals, act according to
- the signal handling tables. */
+ /* 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;
+ }
+ }
- if (random_signal)
- {
- /* Signal not for debugging purposes. */
- int printed = 0;
+ /* When we reach this point, we've pretty much decided
+ that the reason for stopping must've been a random
+ (unexpected) signal. */
+
+ else
+ ecs->random_signal = 1;
+ /* If a fork, vfork or exec event was seen, then there are two
+ possible responses we can make:
+
+ 1. If a catchpoint triggers for the event (ecs->random_signal == 0),
+ then we must stop now and issue a prompt. We will resume
+ the inferior when the user tells us to.
+ 2. If no catchpoint triggers for the event (ecs->random_signal == 1),
+ then we must resume the inferior now and keep checking.
+
+ In either case, we must take appropriate steps to "follow" the
+ the fork/vfork/exec when the inferior is resumed. For example,
+ if follow-fork-mode is "child", then we must detach from the
+ parent inferior and follow the new child inferior.
+
+ In either case, setting pending_follow causes the next resume()
+ to take the appropriate following action. */
+ process_event_stop_test:
+ if (ecs->ws.kind == TARGET_WAITKIND_FORKED)
+ {
+ if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */
+ {
+ trap_expected = 1;
+ stop_signal = TARGET_SIGNAL_0;
+ keep_going (ecs);
+ return;
+ }
+ }
+ else if (ecs->ws.kind == TARGET_WAITKIND_VFORKED)
+ {
+ if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */
+ {
+ stop_signal = TARGET_SIGNAL_0;
+ keep_going (ecs);
+ return;
+ }
+ }
+ else if (ecs->ws.kind == TARGET_WAITKIND_EXECD)
+ {
+ pending_follow.kind = ecs->ws.kind;
+ if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */
+ {
+ trap_expected = 1;
+ stop_signal = TARGET_SIGNAL_0;
+ keep_going (ecs);
+ return;
+ }
+ }
- stopped_by_random_signal = 1;
+ /* For the program's own signals, act according to
+ the signal handling tables. */
- 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])
- break;
- /* If not going to stop, give terminal back
- if we took it away. */
- else if (printed)
- target_terminal_inferior ();
+ if (ecs->random_signal)
+ {
+ /* Signal not for debugging purposes. */
+ int printed = 0;
- /* Clear the signal if it should not be passed. */
- if (signal_program[stop_signal] == 0)
- stop_signal = TARGET_SIGNAL_0;
+ stopped_by_random_signal = 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
+ if (signal_print[stop_signal])
+ {
+ printed = 1;
+ target_terminal_ours_for_output ();
+ print_stop_reason (SIGNAL_RECEIVED, stop_signal);
+ }
+ if (signal_stop[stop_signal])
+ {
+ stop_stepping (ecs);
+ return;
+ }
+ /* If not going to stop, give terminal back
+ if we took it away. */
+ else if (printed)
+ target_terminal_inferior ();
- A previous comment here suggested it was possible to change
- this to jump to keep_going in all cases. */
+ /* Clear the signal if it should not be passed. */
+ if (signal_program[stop_signal] == 0)
+ stop_signal = TARGET_SIGNAL_0;
- if (step_over_calls > 0)
- goto step_over_function;
- else
- goto check_sigtramp2;
- }
+ /* I'm not sure whether this needs to be check_sigtramp2 or
+ whether it could/should be keep_going.
+
+ This used to jump to step_over_function if we are stepping,
+ which is wrong.
+
+ Suppose the user does a `next' over a function call, and while
+ that call is in progress, the inferior receives a signal for
+ which GDB does not stop (i.e., signal_stop[SIG] is false). In
+ that case, when we reach this point, there is already a
+ step-resume breakpoint established, right where it should be:
+ immediately after the function call the user is "next"-ing
+ over. If we call step_over_function now, two bad things
+ happen:
+
+ - we'll create a new breakpoint, at wherever the current
+ frame's return address happens to be. That could be
+ anywhere, depending on what function call happens to be on
+ the top of the stack at that point. Point is, it's probably
+ not where we need it.
+
+ - the existing step-resume breakpoint (which is at the correct
+ address) will get orphaned: step_resume_breakpoint will point
+ to the new breakpoint, and the old step-resume breakpoint
+ will never be cleaned up.
+
+ The old behavior was meant to help HP-UX single-step out of
+ sigtramps. It would place the new breakpoint at prev_pc, which
+ was certainly wrong. I don't know the details there, so fixing
+ this probably breaks that. As with anything else, it's up to
+ the HP-UX maintainer to furnish a fix that doesn't break other
+ platforms. --JimB, 20 May 1999 */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- /* Handle cases caused by hitting a breakpoint. */
- {
- CORE_ADDR jmp_buf_pc;
- struct bpstat_what what;
+ /* Handle cases caused by hitting a breakpoint. */
+ {
+ CORE_ADDR jmp_buf_pc;
+ struct bpstat_what what;
- what = bpstat_what (stop_bpstat);
+ what = bpstat_what (stop_bpstat);
- if (what.call_dummy)
- {
- stop_stack_dummy = 1;
+ if (what.call_dummy)
+ {
+ stop_stack_dummy = 1;
#ifdef HP_OS_BUG
- trap_expected_after_continue = 1;
+ trap_expected_after_continue = 1;
#endif
- }
+ }
- switch (what.main_action)
- {
- 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;
+ switch (what.main_action)
+ {
+ case BPSTAT_WHAT_SET_LONGJMP_RESUME:
+ /* If we hit the breakpoint at longjmp, disable it for the
+ duration of this command. Then, install a temporary
+ breakpoint at the target of the jmp_buf. */
+ disable_longjmp_breakpoint ();
+ remove_breakpoints ();
+ breakpoints_inserted = 0;
+ if (!GET_LONGJMP_TARGET_P ()
+ || !GET_LONGJMP_TARGET (&jmp_buf_pc))
+ {
+ keep_going (ecs);
+ return;
+ }
- /* Need to blow away step-resume breakpoint, as it
- interferes with us */
- if (step_resume_breakpoint != NULL)
- {
- delete_breakpoint (step_resume_breakpoint);
- step_resume_breakpoint = NULL;
- }
- /* Not sure whether we need to blow this away too, but probably
- it is like the step-resume breakpoint. */
- if (through_sigtramp_breakpoint != NULL)
- {
- delete_breakpoint (through_sigtramp_breakpoint);
- through_sigtramp_breakpoint = NULL;
- }
+ /* Need to blow away step-resume breakpoint, as it
+ interferes with us */
+ if (step_resume_breakpoint != NULL)
+ {
+ delete_step_resume_breakpoint (&step_resume_breakpoint);
+ }
+ /* Not sure whether we need to blow this away too, but probably
+ it is like the step-resume breakpoint. */
+ if (through_sigtramp_breakpoint != NULL)
+ {
+ delete_breakpoint (through_sigtramp_breakpoint);
+ through_sigtramp_breakpoint = NULL;
+ }
#if 0
- /* FIXME - Need to implement nested temporary breakpoints */
- if (step_over_calls > 0)
- set_longjmp_resume_breakpoint (jmp_buf_pc,
- get_current_frame ());
- else
+ /* 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);
- handling_longjmp = 1; /* FIXME */
- goto keep_going;
+ set_longjmp_resume_breakpoint (jmp_buf_pc, NULL);
+ ecs->handling_longjmp = 1; /* FIXME */
+ keep_going (ecs);
+ return;
- case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME:
- case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
- remove_breakpoints ();
- breakpoints_inserted = 0;
+ 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)))
- {
- another_trap = 1;
- goto keep_going;
- }
+ /* 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;
+ keep_going (ecs);
+ return;
+ }
#endif /* 0 */
- disable_longjmp_breakpoint ();
- handling_longjmp = 0; /* FIXME */
- if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
- break;
- /* else fallthrough */
-
- case BPSTAT_WHAT_SINGLE:
- if (breakpoints_inserted)
- {
- thread_step_needed = 1;
- remove_breakpoints ();
- }
- breakpoints_inserted = 0;
- another_trap = 1;
- /* Still need to check other stuff, at least the case
- where we are stepping and step out of the right range. */
+ disable_longjmp_breakpoint ();
+ ecs->handling_longjmp = 0; /* FIXME */
+ if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
break;
+ /* else fallthrough */
- case BPSTAT_WHAT_STOP_NOISY:
- stop_print_frame = 1;
+ case BPSTAT_WHAT_SINGLE:
+ if (breakpoints_inserted)
+ {
+ remove_breakpoints ();
+ }
+ breakpoints_inserted = 0;
+ ecs->another_trap = 1;
+ /* Still need to check other stuff, at least the case
+ where we are stepping and step out of the right range. */
+ break;
- /* 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. */
+ case BPSTAT_WHAT_STOP_NOISY:
+ stop_print_frame = 1;
- goto stop_stepping;
+ /* 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. */
- case BPSTAT_WHAT_STOP_SILENT:
- stop_print_frame = 0;
+ stop_stepping (ecs);
+ return;
- /* 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. */
+ case BPSTAT_WHAT_STOP_SILENT:
+ stop_print_frame = 0;
- goto stop_stepping;
+ /* 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. */
- case BPSTAT_WHAT_STEP_RESUME:
- /* This proably demands a more elegant solution, but, yeah
- right...
+ stop_stepping (ecs);
+ return;
- 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.
+ case BPSTAT_WHAT_STEP_RESUME:
+ /* This proably demands a more elegant solution, but, yeah
+ right...
- 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;
+ 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.
- case BPSTAT_WHAT_THROUGH_SIGTRAMP:
- if (through_sigtramp_breakpoint)
- delete_breakpoint (through_sigtramp_breakpoint);
- through_sigtramp_breakpoint = NULL;
+ 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 were waiting for a trap, hitting the step_resume_break
- doesn't count as getting it. */
- if (trap_expected)
- another_trap = 1;
- break;
+ Correction: what the code currently does is delete a
+ step-resume bp, but it makes no effort to ensure that
+ the one deleted is the one currently stopped at. MVS */
- case BPSTAT_WHAT_CHECK_SHLIBS:
- case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
-#ifdef SOLIB_ADD
+ if (step_resume_breakpoint == NULL)
{
- extern int auto_solib_add;
+ step_resume_breakpoint =
+ bpstat_find_step_resume_breakpoint (stop_bpstat);
+ }
+ delete_step_resume_breakpoint (&step_resume_breakpoint);
+ break;
- /* 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;
+ case BPSTAT_WHAT_THROUGH_SIGTRAMP:
+ if (through_sigtramp_breakpoint)
+ delete_breakpoint (through_sigtramp_breakpoint);
+ through_sigtramp_breakpoint = NULL;
- /* 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 were waiting for a trap, hitting the step_resume_break
+ doesn't count as getting it. */
+ if (trap_expected)
+ ecs->another_trap = 1;
+ break;
- /* Try to reenable shared library breakpoints, additional
- code segments in shared libraries might be mapped in now. */
- re_enable_breakpoints_in_shlibs ();
+ 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;
- /* 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;
- }
+ /* Check for any newly added shared libraries if we're
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
- /* If 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,
- &stepping_through_solib_catchpoints);
- stepping_through_solib_after_catch = 1;
-
- /* Be sure to lift all breakpoints, so the inferior does
- actually step past this point... */
- another_trap = 1;
- break;
- }
- else
- {
- /* We want to step over this breakpoint, then keep going. */
- another_trap = 1;
- break;
- }
- }
-#endif
- break;
+ /* Try to reenable shared library breakpoints, additional
+ code segments in shared libraries might be mapped in now. */
+ re_enable_breakpoints_in_shlibs ();
- case BPSTAT_WHAT_LAST:
- /* Not a real code, but listed here to shut up gcc -Wall. */
+ /* If requested, stop when the dynamic linker notifies
+ gdb of events. This allows the user to get control
+ and place breakpoints in initializer routines for
+ dynamically loaded objects (among other things). */
+ if (stop_on_solib_events)
+ {
+ stop_stepping (ecs);
+ return;
+ }
- case BPSTAT_WHAT_KEEP_CHECKING:
- break;
+ /* If we stopped due to an explicit catchpoint, then the
+ (see above) call to SOLIB_ADD pulled in any symbols
+ from a newly-loaded library, if appropriate.
+
+ We do want the inferior to stop, but not where it is
+ now, which is in the dynamic linker callback. Rather,
+ we would like it stop in the user's program, just after
+ the call that caused this catchpoint to trigger. That
+ gives the user a more useful vantage from which to
+ examine their program's state. */
+ else if (what.main_action == BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
+ {
+ /* ??rehrauer: If I could figure out how to get the
+ right return PC from here, we could just set a temp
+ breakpoint and resume. I'm not sure we can without
+ cracking open the dld's shared libraries and sniffing
+ their unwind tables and text/data ranges, and that's
+ not a terribly portable notion.
+
+ Until that time, we must step the inferior out of the
+ dld callback, and also out of the dld itself (and any
+ code or stubs in libdld.sl, such as "shl_load" and
+ friends) until we reach non-dld code. At that point,
+ we can stop stepping. */
+ bpstat_get_triggered_catchpoints (stop_bpstat,
+ &ecs->stepping_through_solib_catchpoints);
+ ecs->stepping_through_solib_after_catch = 1;
+
+ /* Be sure to lift all breakpoints, so the inferior does
+ actually step past this point... */
+ ecs->another_trap = 1;
+ break;
+ }
+ else
+ {
+ /* We want to step over this breakpoint, then keep going. */
+ ecs->another_trap = 1;
+ break;
+ }
}
- }
+#endif
+ break;
- /* We 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. */
+ case BPSTAT_WHAT_LAST:
+ /* Not a real code, but listed here to shut up gcc -Wall. */
- /* 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 (stepping_through_solib_after_catch)
- {
-#if defined(SOLIB_ADD)
- /* Have we reached our destination? If not, keep going. */
- if (SOLIB_IN_DYNAMIC_LINKER (pid, stop_pc))
- {
- another_trap = 1;
- goto keep_going;
- }
-#endif
- /* Else, stop and report the catchpoint(s) whose triggering
- caused us to begin stepping. */
- stepping_through_solib_after_catch = 0;
- bpstat_clear (&stop_bpstat);
- stop_bpstat = bpstat_copy (stepping_through_solib_catchpoints);
- bpstat_clear (&stepping_through_solib_catchpoints);
- stop_print_frame = 1;
- goto stop_stepping;
+ case BPSTAT_WHAT_KEEP_CHECKING:
+ break;
}
+ }
-#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
- /* 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. */
+ /* 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. */
- /* 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. */
+ /* Are we stepping to get the inferior out of the dynamic
+ linker's hook (and possibly the dld itself) after catching
+ a shlib event? */
+ if (ecs->stepping_through_solib_after_catch)
+ {
+#if defined(SOLIB_ADD)
+ /* Have we reached our destination? If not, keep going. */
+ if (SOLIB_IN_DYNAMIC_LINKER (PIDGET (ecs->ptid), stop_pc))
+ {
+ ecs->another_trap = 1;
+ keep_going (ecs);
+ return;
+ }
+#endif
+ /* Else, stop and report the catchpoint(s) whose triggering
+ caused us to begin stepping. */
+ ecs->stepping_through_solib_after_catch = 0;
+ bpstat_clear (&stop_bpstat);
+ stop_bpstat = bpstat_copy (ecs->stepping_through_solib_catchpoints);
+ bpstat_clear (&ecs->stepping_through_solib_catchpoints);
+ stop_print_frame = 1;
+ stop_stepping (ecs);
+ return;
+ }
- if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ()))
- && !step_range_end)
- {
- stop_print_frame = 0;
- stop_stack_dummy = 1;
+ 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;
+ trap_expected_after_continue = 1;
#endif
- break;
- }
-#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
+ stop_stepping (ecs);
+ return;
+ }
+ }
- if (step_resume_breakpoint)
+ 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)
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
+
+ if (step_range_end == 0)
+ {
/* Likewise if we aren't even stepping. */
/* I'm not sure whether this needs to be check_sigtramp2 or
whether it could/should be keep_going. */
- 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
-#if 0
-/* I haven't a clue what might trigger this clause, and it seems wrong
- anyway, so I've disabled it until someone complains. -Stu 10/24/95 */
-
- /* The step range might include the start of the
- function, so if we are at the start of the
- step range and either the stack or frame pointers
- just changed, we've stepped outside */
- && !(stop_pc == step_range_start
- && FRAME_FP (get_current_frame ())
- && (INNER_THAN (read_sp (), step_sp)
- || FRAME_FP (get_current_frame ()) != step_frame_address))
-#endif
- )
- {
- /* 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 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;
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- /* 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. */
- update_step_sp = 1;
+ /* If stepping through a line, keep going if still within it.
- /* Did we just take a signal? */
- if (IN_SIGTRAMP (stop_pc, 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 that step_range_end is the address of the first instruction
+ beyond the step range, and NOT the address of the last instruction
+ within it! */
+ if (stop_pc >= step_range_start
+ && stop_pc < step_range_end)
+ {
+ /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
+ So definately need to check for sigtramp here. */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- /* 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 */
+ /* We stepped out of the stepping range. */
+ /* If we are stepping at the source level and entered the runtime
+ loader dynamic symbol resolution code, we keep on single stepping
+ until we exit the run time loader code and reach the callee's
+ address. */
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+ {
+ CORE_ADDR pc_after_resolver = SKIP_SOLIB_RESOLVER (stop_pc);
+ if (pc_after_resolver)
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ /* Set up a step-resume breakpoint at the address
+ indicated by SKIP_SOLIB_RESOLVER. */
+ struct symtab_and_line sr_sal;
+ INIT_SAL (&sr_sal);
+ sr_sal.pc = pc_after_resolver;
- 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. */
-
- /* 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. */
- 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, &stop_func_name,
- &stop_func_start,
- &stop_func_end);
- /* Readjust stepping range */
- step_range_start = stop_func_start;
- step_range_end = stop_func_end;
- stepping_through_sigtramp = 1;
- }
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ if (breakpoints_inserted)
+ insert_breakpoints ();
}
+ keep_going (ecs);
+ return;
+ }
- /* 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;
+ /* 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;
- remove_breakpoints_on_following_step = 1;
- goto keep_going;
- }
+ /* 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. */
-#if 0
- /* I disabled this test because it was too complicated and slow.
- The SKIP_PROLOGUE was especially slow, because it caused
- unnecessary prologue examination on various architectures.
- The code in the #else clause has been tested on the Sparc,
- Mips, PA, and Power architectures, so it's pretty likely to
- be correct. -Stu 10/24/95 */
+ /* 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 */
- /* See if we left the step range due to a subroutine call that
- we should proceed to the end of. */
- if (stop_func_start)
{
- struct symtab *s;
+ CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
- /* Do this after the IN_SIGTRAMP check; it might give
- an error. */
- prologue_pc = stop_func_start;
-
- /* Don't skip the prologue if this is assembly source */
- s = find_pc_symtab (stop_pc);
- if (s && s->language != language_asm)
- SKIP_PROLOGUE (prologue_pc);
- }
+ if (INNER_THAN (current_frame, step_frame_address))
+ {
+ /* We have just taken a signal; go until we are back to
+ the point where we took it and one more. */
- if (!(INNER_THAN (step_sp, read_sp ())) /* don't mistake (sig)return
- as a call */
- && ( /* Might be a non-recursive call. If the symbols are missing
- enough that stop_func_start == prev_func_start even though
- they are really two functions, we will treat some calls as
- jumps. */
- stop_func_start != prev_func_start
-
- /* Might be a recursive call if either we have a prologue
- or the call instruction itself saves the PC on the stack. */
- || prologue_pc != stop_func_start
- || read_sp () != step_sp)
- && ( /* PC is completely out of bounds of any known objfiles. Treat
- like a subroutine call. */
- !stop_func_start
-
- /* If we do a call, we will be at the start of a function... */
- || stop_pc == stop_func_start
-
- /* ...except on the Alpha with -O (and also Irix 5 and
- perhaps others), in which we might call the address
- after the load of gp. Since prologues don't contain
- calls, we can't return to within one, and we don't
- jump back into them, so this check is OK. */
-
- || stop_pc < prologue_pc
-
- /* ...and if it is a leaf function, the prologue might
- consist of gp loading only, so the call transfers to
- the first instruction after the prologue. */
- || (stop_pc == prologue_pc
-
- /* Distinguish this from the case where we jump back
- to the first instruction after the prologue,
- within a function. */
- && stop_func_start != prev_func_start)
-
- /* If we end up in certain places, it means we did a subroutine
- call. I'm not completely sure this is necessary now that we
- have the above checks with stop_func_start (and now that
- find_pc_partial_function is pickier). */
- || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, stop_func_name)
-
- /* If none of the above apply, it is a jump within a function,
- or a return from a subroutine. The other case is longjmp,
- which can no longer happen here as long as the
- handling_longjmp stuff is working. */
- ))
-#else
- /* This test is a much more streamlined, (but hopefully correct)
- replacement for the code above. It's been tested on the Sparc,
- Mips, PA, and Power architectures with good results. */
-
- if (stop_pc == stop_func_start /* Quick test */
- || (in_prologue (stop_pc, stop_func_start) &&
- !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, stop_func_name))
- || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, stop_func_name)
- || stop_func_name == 0)
-#endif
+ /* This code is needed at least in the following case:
+ The user types "next" and then a signal arrives (before
+ the "next" is done). */
- {
- /* It's a subroutine call. */
+ /* 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 (step_over_calls == 0)
- {
- /* 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;
- 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. */
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ if (breakpoints_inserted)
+ insert_breakpoints ();
}
-
- 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)
- 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;
- }
+ /* We just stepped out of a signal handler and into
+ its calling trampoline.
+
+ Normally, we'd call step_over_function from
+ here, but for some reason GDB can't unwind the
+ stack correctly to find the real PC for the point
+ user code where the signal trampoline will return
+ -- FRAME_SAVED_PC fails, at least on HP-UX 10.20.
+ But signal trampolines are pretty small stubs of
+ code, anyway, so it's OK instead to just
+ single-step out. Note: assuming such trampolines
+ don't exhibit recursion on any platform... */
+ find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+ &ecs->stop_func_start,
+ &ecs->stop_func_end);
+ /* Readjust stepping range */
+ step_range_start = ecs->stop_func_start;
+ step_range_end = ecs->stop_func_end;
+ ecs->stepping_through_sigtramp = 1;
}
+ }
- /* If we have line number information for the function we
- are thinking of stepping into, step into it.
- If there are several symtabs at that PC (e.g. with include
- files), just want to know whether *any* of them have line
- numbers. find_pc_line handles this. */
- {
- struct symtab_and_line tmp_sal;
+ /* 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;
- tmp_sal = find_pc_line (stop_func_start, 0);
- if (tmp_sal.line != 0)
- goto step_into_function;
- }
+ ecs->remove_breakpoints_on_following_step = 1;
+ keep_going (ecs);
+ return;
+ }
- step_over_function:
- /* A subroutine call has happened. */
+ if (stop_pc == ecs->stop_func_start /* Quick test */
+ || (in_prologue (stop_pc, ecs->stop_func_start) &&
+ !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+ || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
+ || ecs->stop_func_name == 0)
+ {
+ /* It's a subroutine call. */
+
+ if ((step_over_calls == STEP_OVER_NONE)
+ || ((step_range_end == 1)
+ && in_prologue (prev_pc, ecs->stop_func_start)))
{
- /* Set a special breakpoint after the return */
- struct symtab_and_line sr_sal;
+ /* I presume that step_over_calls is only 0 when we're
+ supposed to be stepping at the assembly language level
+ ("stepi"). Just stop. */
+ /* Also, maybe we just did a "nexti" inside a prolog,
+ so we thought it was a subroutine call but it was not.
+ Stop as well. FENN */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- INIT_SAL (&sr_sal);
- sr_sal.symtab = NULL;
- sr_sal.line = 0;
+ if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
+ {
+ /* We're doing a "next". */
- /* 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 ()));
+ if (IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && INNER_THAN (step_frame_address, read_sp()))
+ /* We stepped out of a signal handler, and into its
+ calling trampoline. This is misdetected as a
+ subroutine call, but stepping over the signal
+ trampoline isn't such a bad idea. In order to do
+ that, we have to ignore the value in
+ step_frame_address, since that doesn't represent the
+ frame that'll reach when we return from the signal
+ trampoline. Otherwise we'll probably continue to the
+ end of the program. */
+ step_frame_address = 0;
+
+ step_over_function (ecs);
+ keep_going (ecs);
+ return;
+ }
- 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 (stepping_through_sigtramp)
+ /* 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)
{
- step_resume_breakpoint->frame = (CORE_ADDR) NULL;
- stepping_through_sigtramp = 0;
+ struct symtab_and_line xxx;
+ /* Why isn't this s_a_l called "sr_sal", like all of the
+ other s_a_l's where this code is duplicated? */
+ INIT_SAL (&xxx); /* initialize to zeroes */
+ xxx.pc = tmp;
+ xxx.section = find_pc_overlay (xxx.pc);
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (xxx, NULL, bp_step_resume);
+ insert_breakpoints ();
+ keep_going (ecs);
+ return;
}
- else if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
- step_resume_breakpoint->frame = step_frame_address;
-
- 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;
+ /* If we have line number information for the function we
+ are thinking of stepping into, step into it.
- s = find_pc_symtab (stop_pc);
- if (s && s->language != language_asm)
- SKIP_PROLOGUE (stop_func_start);
- }
- sal = find_pc_line (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 (sal.end && sal.pc != stop_func_start && sal.end < stop_func_end)
- stop_func_start = sal.end;
-#endif
+ 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;
- if (stop_func_start == stop_pc)
+ tmp_sal = find_pc_line (ecs->stop_func_start, 0);
+ if (tmp_sal.line != 0)
{
- /* We are already there: stop now. */
- stop_step = 1;
- break;
+ step_into_function (ecs);
+ return;
}
- 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 = stop_func_start;
- sr_sal.section = find_pc_overlay (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. */
+ /* If we have no line number and the step-stop-if-no-debug
+ is set, we stop the step so that the user has a chance to
+ switch in assembly mode. */
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
+ {
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- sal = find_pc_line (stop_pc, 0);
+ step_over_function (ecs);
+ keep_going (ecs);
+ return;
- if (step_range_end == 1)
- {
- /* It is stepi or nexti. We always want to stop stepping after
- one instruction. */
- stop_step = 1;
- 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, stop_func_name))
- {
- CORE_ADDR tmp;
+ /* We've wandered out of the step range. */
- /* Determine where this trampoline returns. */
- tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
+ ecs->sal = find_pc_line (stop_pc, 0);
- /* 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;
+ if (step_range_end == 1)
+ {
+ /* It is stepi or nexti. We always want to stop stepping after
+ one instruction. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- 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 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;
- /* Restart without fiddling with the step ranges or
- other state. */
- goto keep_going;
- }
- }
+ /* Determine where this trampoline returns. */
+ tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
- if (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;
- 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;
- if ((stop_pc == sal.pc)
- && (current_line != sal.line || current_symtab != 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;
- break;
- }
+ INIT_SAL (&sr_sal); /* initialize to zeroes */
+ sr_sal.pc = tmp;
+ sr_sal.section = find_pc_overlay (sr_sal.pc);
+ /* Do not specify what the fp should be when we stop
+ since on some machines the prologue
+ is where the new fp value is established. */
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ if (breakpoints_inserted)
+ insert_breakpoints ();
- /* We aren't done stepping.
+ /* Restart without fiddling with the step ranges or
+ other state. */
+ keep_going (ecs);
+ return;
+ }
+ }
- Optimize by setting the stepping range to the line.
- (We might not be in the original line, but if we entered a
- new line in mid-statement, we continue stepping. This makes
- things like for(;;) statements work better.) */
+ if (ecs->sal.line == 0)
+ {
+ /* We have no line number information. That means to stop
+ stepping (does this always happen right after one instruction,
+ when we do "s" in a function with no line numbers,
+ or can this happen as a result of a return or longjmp?). */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- if (stop_func_end && sal.end >= 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;
- break;
- }
- step_range_start = sal.pc;
- step_range_end = sal.end;
- step_frame_address = FRAME_FP (get_current_frame ());
- current_line = sal.line;
- current_symtab = 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 ((stop_pc == ecs->sal.pc)
+ && (ecs->current_line != ecs->sal.line || ecs->current_symtab != ecs->sal.symtab))
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
- if (!(INNER_THAN (current_frame, step_frame_address)))
- step_frame_address = current_frame;
+ /* We are at the start of a different line. So stop. Note that
+ we don't stop if we step into the middle of a different line.
+ That is said to make things like for (;;) statements work
+ better. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
}
+ /* We aren't done stepping.
- goto keep_going;
+ 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.) */
- check_sigtramp2:
- if (trap_expected
- && IN_SIGTRAMP (stop_pc, 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 (ecs->stop_func_end && ecs->sal.end >= ecs->stop_func_end)
+ {
+ /* If this is the last line of the function, don't keep stepping
+ (it would probably step us out of the function).
+ This is particularly necessary for a one-line function,
+ in which after skipping the prologue we better stop even though
+ we will be in mid-line. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
+ step_range_start = ecs->sal.pc;
+ step_range_end = ecs->sal.end;
+ step_frame_address = FRAME_FP (get_current_frame ());
+ ecs->current_line = ecs->sal.line;
+ ecs->current_symtab = ecs->sal.symtab;
+
+ /* In the case where we just stepped out of a function into the middle
+ of a line of the caller, continue stepping, but step_frame_address
+ must be modified to current frame */
+ {
+ CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ if (!(INNER_THAN (current_frame, step_frame_address)))
+ step_frame_address = current_frame;
+ }
- remove_breakpoints_on_following_step = 1;
- another_trap = 1;
- }
+ keep_going (ecs);
- 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 = 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 = stop_func_name;
-
- if (update_step_sp)
- step_sp = read_sp ();
- 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 (), 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
- && remove_breakpoints_on_following_step)
- {
- remove_breakpoints_on_following_step = 0;
- remove_breakpoints ();
- breakpoints_inserted = 0;
- }
- else if (!breakpoints_inserted &&
- (through_sigtramp_breakpoint != NULL || !another_trap))
- {
- breakpoints_failed = insert_breakpoints ();
- if (breakpoints_failed)
- break;
- breakpoints_inserted = 1;
- }
+ } /* extra brace, to preserve old indentation */
+}
- trap_expected = another_trap;
+/* Are we in the middle of stepping? */
- /* Do not deliver SIGNAL_TRAP (except when the user
- explicitly specifies that such a signal should be
- delivered to the target program).
+static int
+currently_stepping (struct execution_control_state *ecs)
+{
+ return ((through_sigtramp_breakpoint == NULL
+ && !ecs->handling_longjmp
+ && ((step_range_end && step_resume_breakpoint == NULL)
+ || trap_expected))
+ || ecs->stepping_through_solib_after_catch
+ || bpstat_should_step ());
+}
- 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. */
+static void
+check_sigtramp2 (struct execution_control_state *ecs)
+{
+ 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 the testsuite,
+ gdb.base/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 ();
+
+ ecs->remove_breakpoints_on_following_step = 1;
+ ecs->another_trap = 1;
+ }
+}
- if (stop_signal == TARGET_SIGNAL_TRAP
- && !signal_program[stop_signal])
- stop_signal = TARGET_SIGNAL_0;
+/* Subroutine call with source code we should not step over. Do step
+ to the first line of code in it. */
-#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 ();
-#endif /* SHIFT_INST_REGS */
+static void
+step_into_function (struct execution_control_state *ecs)
+{
+ struct symtab *s;
+ struct symtab_and_line sr_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
- resume (CURRENTLY_STEPPING (), stop_signal);
- }
+ if (ecs->stop_func_start == stop_pc)
+ {
+ /* We are already there: stop now. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
+ else
+ {
+ /* Put the step-breakpoint there and go until there. */
+ 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. */
+ check_for_old_step_resume_breakpoint ();
+ 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;
}
+ keep_going (ecs);
+}
+
+/* We've just entered a callee, and we wish to resume until it returns
+ to the caller. Setting a step_resume breakpoint on the return
+ address 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 only 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). */
+
+static void
+step_over_function (struct execution_control_state *ecs)
+{
+ struct symtab_and_line sr_sal;
+
+ INIT_SAL (&sr_sal); /* initialize to zeros */
+ sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ sr_sal.section = find_pc_overlay (sr_sal.pc);
-stop_stepping:
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, get_current_frame (), bp_step_resume);
+
+ if (step_frame_address && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
+ step_resume_breakpoint->frame = step_frame_address;
+
+ if (breakpoints_inserted)
+ insert_breakpoints ();
+}
+
+static void
+stop_stepping (struct execution_control_state *ecs)
+{
if (target_has_execution)
{
/* Are we stopping for a vfork event? We only stop when we see
the child's event. However, we may not yet have seen the
- parent's event. And, inferior_pid is still set to the parent's
- pid, until we resume again and follow either the parent or child.
+ parent's event. And, inferior_ptid is still set to the
+ parent's pid, until we resume again and follow either the
+ parent or child.
- To ensure that we can really touch inferior_pid (aka, the
+ To ensure that we can really touch inferior_ptid (aka, the
parent process) -- which calls to functions like read_pc
implicitly do -- wait on the parent if necessary. */
if ((pending_follow.kind == TARGET_WAITKIND_VFORKED)
&& !pending_follow.fork_event.saw_parent_fork)
{
- int parent_pid;
+ ptid_t parent_ptid;
do
{
if (target_wait_hook)
- parent_pid = target_wait_hook (-1, &w);
+ parent_ptid = target_wait_hook (pid_to_ptid (-1), &(ecs->ws));
else
- parent_pid = target_wait (-1, &w);
+ parent_ptid = target_wait (pid_to_ptid (-1), &(ecs->ws));
}
- while (parent_pid != inferior_pid);
+ while (! ptid_equal (parent_ptid, inferior_ptid));
}
-
/* Assuming the inferior still exists, set these up for next
- time, just like we did above if we didn't break out of the
- loop. */
+ time, just like we did above if we didn't break out of the
+ loop. */
prev_pc = read_pc ();
- prev_func_start = stop_func_start;
- prev_func_name = stop_func_name;
+ prev_func_start = ecs->stop_func_start;
+ prev_func_name = ecs->stop_func_name;
}
- do_cleanups (old_cleanups);
-}
-/* This function returns TRUE if ep is an internal breakpoint
- set to catch generic shared library (aka dynamically-linked
- library) events. (This is *NOT* the same as a catchpoint for a
- shlib event. The latter is something a user can set; this is
- something gdb sets for its own use, and isn't ever shown to a
- user.) */
-static int
-is_internal_shlib_eventpoint (ep)
- struct breakpoint *ep;
-{
- return
- (ep->type == bp_shlib_event)
- ;
+ /* Let callers know we don't want to wait for the inferior anymore. */
+ ecs->wait_some_more = 0;
}
-/* This function returns TRUE if bs indicates that the inferior
- stopped due to a shared library (aka dynamically-linked library)
- event. */
-static int
-stopped_for_internal_shlib_event (bs)
- bpstat bs;
+/* This function handles various cases where we need to continue
+ waiting for the inferior. */
+/* (Used to be the keep_going: label in the old wait_for_inferior) */
+
+static void
+keep_going (struct execution_control_state *ecs)
{
- /* Note that multiple eventpoints may've caused the stop. Any
- that are associated with shlib events will be accepted. */
- for (; bs != NULL; bs = bs->next)
+ /* ??rehrauer: ttrace on HP-UX theoretically allows one to debug a
+ vforked child between its creation and subsequent exit or call to
+ exec(). However, I had big problems in this rather creaky exec
+ engine, getting that to work. The fundamental problem is that
+ I'm trying to debug two processes via an engine that only
+ understands a single process with possibly multiple threads.
+
+ Hence, this spot is known to have problems when
+ target_can_follow_vfork_prior_to_exec returns 1. */
+
+ /* Save the pc before execution, to compare with pc after stop. */
+ prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
+ prev_func_start = ecs->stop_func_start; /* Ok, since if DECR_PC_AFTER
+ 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)
{
- if ((bs->breakpoint_at != NULL)
- && is_internal_shlib_eventpoint (bs->breakpoint_at))
- return 1;
+ /* 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)
+ {
+ stop_stepping (ecs);
+ return;
+ }
+ breakpoints_inserted = 1;
+ }
- /* If we get here, then no candidate was found. */
- return 0;
-}
+ trap_expected = ecs->another_trap;
-/* This function returns TRUE if bs indicates that the inferior
- stopped due to a shared library (aka dynamically-linked library)
- event caught by a catchpoint.
+ /* Do not deliver SIGNAL_TRAP (except when the user explicitly
+ specifies that such a signal should be delivered to the
+ target program).
- If TRUE, cp_p is set to point to the catchpoint.
+ 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. */
- Else, the value of cp_p is undefined. */
-static int
-stopped_for_shlib_catchpoint (bs, cp_p)
- bpstat bs;
- struct breakpoint **cp_p;
+ 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 ();
+#endif /* SHIFT_INST_REGS */
+
+ resume (currently_stepping (ecs), stop_signal);
+ }
+
+ prepare_to_wait (ecs);
+}
+
+/* This function normally comes after a resume, before
+ handle_inferior_event exits. It takes care of any last bits of
+ housekeeping, and sets the all-important wait_some_more flag. */
+
+static void
+prepare_to_wait (struct execution_control_state *ecs)
{
- /* Note that multiple eventpoints may've caused the stop. Any
- that are associated with shlib events will be accepted. */
- *cp_p = NULL;
+ 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. */
+
+ registers_changed ();
+ ecs->waiton_ptid = pid_to_ptid (-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;
+}
- for (; bs != NULL; bs = bs->next)
+/* Print why the inferior has stopped. We always print something when
+ the inferior exits, or receives a signal. The rest of the cases are
+ dealt with later on in normal_stop() and print_it_typical(). Ideally
+ there should be a call to this function from handle_inferior_event()
+ each time stop_stepping() is called.*/
+static void
+print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
+{
+ switch (stop_reason)
{
- if ((bs->breakpoint_at != NULL)
- && ep_is_shlib_catchpoint (bs->breakpoint_at))
+ case STOP_UNKNOWN:
+ /* We don't deal with these cases from handle_inferior_event()
+ yet. */
+ break;
+ case END_STEPPING_RANGE:
+ /* We are done with a step/next/si/ni command. */
+ /* For now print nothing. */
+ /* Print a message only if not in the middle of doing a "step n"
+ operation for n > 1 */
+ if (!step_multi || !stop_step)
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "end-stepping-range");
+ break;
+ case BREAKPOINT_HIT:
+ /* We found a breakpoint. */
+ /* For now print nothing. */
+ break;
+ case SIGNAL_EXITED:
+ /* The inferior was terminated by a signal. */
+ annotate_signalled ();
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "exited-signalled");
+ ui_out_text (uiout, "\nProgram terminated with signal ");
+ annotate_signal_name ();
+ ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ annotate_signal_string_end ();
+ ui_out_text (uiout, ".\n");
+ ui_out_text (uiout, "The program no longer exists.\n");
+ break;
+ case EXITED:
+ /* The inferior program is finished. */
+ annotate_exited (stop_info);
+ if (stop_info)
{
- *cp_p = bs->breakpoint_at;
- return 1;
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "exited");
+ ui_out_text (uiout, "\nProgram exited with code ");
+ ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info);
+ ui_out_text (uiout, ".\n");
}
+ else
+ {
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "exited-normally");
+ ui_out_text (uiout, "\nProgram exited normally.\n");
+ }
+ break;
+ case SIGNAL_RECEIVED:
+ /* Signal received. The signal table tells us to print about
+ it. */
+ annotate_signal ();
+ ui_out_text (uiout, "\nProgram received signal ");
+ annotate_signal_name ();
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "reason", "signal-received");
+ ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ annotate_signal_string_end ();
+ ui_out_text (uiout, ".\n");
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "print_stop_reason: unrecognized enum value");
+ break;
}
-
- /* If we get here, then no candidate was found. */
- return 0;
}
@@ -2939,25 +3350,22 @@ stopped_for_shlib_catchpoint (bs, cp_p)
attempting to insert breakpoints. */
void
-normal_stop ()
+normal_stop (void)
{
-
-#ifdef HPUXHPPA
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
the inferior actually stops.
(Note that there's no point in saying anything if the inferior
has exited!) */
- if ((switched_from_inferior_pid != inferior_pid) &&
- target_has_execution)
+ if (! ptid_equal (previous_inferior_ptid, inferior_ptid)
+ && target_has_execution)
{
target_terminal_ours_for_output ();
- printf_filtered ("[Switched to %s]\n",
- target_pid_or_tid_to_str (inferior_pid));
- switched_from_inferior_pid = inferior_pid;
+ printf_filtered ("[Switching to %s]\n",
+ target_pid_or_tid_to_str (inferior_ptid));
+ previous_inferior_ptid = inferior_ptid;
}
-#endif
/* Make sure that the current_frame's pc is correct. This
is a correction for setting up the frame info before doing
@@ -2968,9 +3376,11 @@ normal_stop ()
if (breakpoints_failed)
{
target_terminal_ours_for_output ();
- print_sys_errmsg ("ptrace", breakpoints_failed);
+ print_sys_errmsg ("While inserting breakpoints", breakpoints_failed);
printf_filtered ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process.\n");
+The same program may be running in another process,\n\
+or you may have requested too many hardware breakpoints\n\
+and/or watchpoints.\n");
}
if (target_has_execution && breakpoints_inserted)
@@ -3004,19 +3414,11 @@ The same program may be running in another process.\n");
target_terminal_ours ();
- /* Did we stop because the user set the stop_on_solib_events
- variable? (If so, we report this as a generic, "Stopped due
- to shlib event" message.) */
- if (stopped_for_internal_shlib_event (stop_bpstat))
- {
- printf_filtered ("Stopped due to shared library event\n");
- }
-
/* Look up the hook_stop and run it if it exists. */
- if (stop_command && stop_command->hook)
+ if (stop_command && stop_command->hook_pre)
{
- catch_errors (hook_stop_stub, stop_command->hook,
+ catch_errors (hook_stop_stub, stop_command->hook_pre,
"Error while running hook_stop:\n", RETURN_MASK_ALL);
}
@@ -3036,41 +3438,58 @@ 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)
+ if (stop_print_frame
+ && selected_frame)
{
int bpstat_ret;
int source_flag;
+ int do_frame_printing = 1;
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 */
-
- if (bpstat_ret == -1)
- if (stop_step
- && step_frame_address == FRAME_FP (get_current_frame ())
- && step_start_function == find_pc_function (stop_pc))
- source_flag = -1; /* finished step, just print source line */
- else
- source_flag = 1; /* print location and source line */
- else if (bpstat_ret == 0) /* hit bpt, desire location */
- source_flag = 1; /* print location and source line */
- else /* bpstat_ret == 1, hit bpt, do not desire location */
- source_flag = -1; /* just print source line */
-
+ switch (bpstat_ret)
+ {
+ case PRINT_UNKNOWN:
+ if (stop_step
+ && step_frame_address == FRAME_FP (get_current_frame ())
+ && step_start_function == find_pc_function (stop_pc))
+ source_flag = SRC_LINE; /* finished step, just print source line */
+ else
+ source_flag = SRC_AND_LOC; /* print location and source line */
+ break;
+ case PRINT_SRC_AND_LOC:
+ source_flag = SRC_AND_LOC; /* print location and source line */
+ break;
+ case PRINT_SRC_ONLY:
+ source_flag = SRC_LINE;
+ break;
+ case PRINT_NOTHING:
+ source_flag = SRC_LINE; /* something bogus */
+ do_frame_printing = 0;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "Unknown value.");
+ }
+ /* For mi, have the same behavior every time we stop:
+ print everything but the source line. */
+ if (ui_out_is_mi_like_p (uiout))
+ source_flag = LOC_AND_ADDRESS;
+
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_int (uiout, "thread-id",
+ pid_to_thread_id (inferior_ptid));
/* The behavior of this routine with respect to the source
flag is:
- -1: Print only source line
- 0: Print only location
- 1: Print location and source line */
- show_and_print_stack_frame (selected_frame, -1, source_flag);
+ SRC_LINE: Print only source line
+ LOCATION: Print only location
+ SRC_AND_LOC: Print location and source line */
+ if (do_frame_printing)
+ show_and_print_stack_frame (selected_frame, -1, source_flag);
/* Display the auto-display expressions. */
do_displays ();
@@ -3086,64 +3505,84 @@ 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);
}
-
- TUIDO (((TuiOpaqueFuncPtr) tui_vCheckDataValues, selected_frame));
-
done:
annotate_stopped ();
}
static int
-hook_stop_stub (cmd)
- PTR cmd;
+hook_stop_stub (void *cmd)
{
execute_user_command ((struct cmd_list_element *) cmd, 0);
return (0);
}
-int
-signal_stop_state (signo)
- int signo;
+int
+signal_stop_state (int signo)
{
return signal_stop[signo];
}
-int
-signal_print_state (signo)
- int signo;
+int
+signal_print_state (int signo)
{
return signal_print[signo];
}
-int
-signal_pass_state (signo)
- int signo;
+int
+signal_pass_state (int signo)
{
return signal_program[signo];
}
+int signal_stop_update (signo, state)
+ int signo;
+ int state;
+{
+ int ret = signal_stop[signo];
+ signal_stop[signo] = state;
+ return ret;
+}
+
+int signal_print_update (signo, state)
+ int signo;
+ int state;
+{
+ int ret = signal_print[signo];
+ signal_print[signo] = state;
+ return ret;
+}
+
+int signal_pass_update (signo, state)
+ int signo;
+ int state;
+{
+ int ret = signal_program[signo];
+ signal_program[signo] = state;
+ return ret;
+}
+
static void
-sig_print_header ()
+sig_print_header (void)
{
printf_filtered ("\
Signal Stop\tPrint\tPass to program\tDescription\n");
}
static void
-sig_print_info (oursig)
- enum target_signal oursig;
+sig_print_info (enum target_signal oursig)
{
char *name = target_signal_to_name (oursig);
int name_padding = 13 - strlen (name);
+
if (name_padding <= 0)
name_padding = 0;
@@ -3159,9 +3598,7 @@ sig_print_info (oursig)
/* Specify how various signals in the inferior should be handled. */
static void
-handle_command (args, from_tty)
- char *args;
- int from_tty;
+handle_command (char *args, int from_tty)
{
char **argv;
int digits, wordlen;
@@ -3190,7 +3627,7 @@ handle_command (args, from_tty)
{
nomem (0);
}
- old_chain = make_cleanup ((make_cleanup_func) freeargv, (char *) argv);
+ old_chain = make_cleanup_freeargv (argv);
/* Walk through the args, looking for signal oursigs, signal names, and
actions. Signal numbers and signal names may be interspersed with
@@ -3286,7 +3723,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++)
{
@@ -3324,7 +3761,7 @@ Are you sure you want to change it? ",
argv++;
}
- target_notice_signals (inferior_pid);
+ target_notice_signals (inferior_ptid);
if (from_tty)
{
@@ -3343,9 +3780,7 @@ Are you sure you want to change it? ",
}
static void
-xdb_handle_command (args, from_tty)
- char *args;
- int from_tty;
+xdb_handle_command (char *args, int from_tty)
{
char **argv;
struct cleanup *old_chain;
@@ -3357,7 +3792,7 @@ xdb_handle_command (args, from_tty)
{
nomem (0);
}
- old_chain = make_cleanup ((make_cleanup_func) freeargv, (char *) argv);
+ old_chain = make_cleanup_freeargv (argv);
if (argv[1] != (char *) NULL)
{
char *argBuf;
@@ -3405,7 +3840,7 @@ xdb_handle_command (args, from_tty)
else
printf_filtered ("Invalid signal handling flag.\n");
if (argBuf)
- free (argBuf);
+ xfree (argBuf);
}
}
do_cleanups (old_chain);
@@ -3417,9 +3852,7 @@ xdb_handle_command (args, from_tty)
targets, all signals should be in the signal tables). */
static void
-signals_info (signum_exp, from_tty)
- char *signum_exp;
- int from_tty;
+signals_info (char *signum_exp, int from_tty)
{
enum target_signal oursig;
sig_print_header ();
@@ -3432,7 +3865,7 @@ signals_info (signum_exp, from_tty)
{
/* No, try numeric. */
oursig =
- target_signal_from_command (parse_and_eval_address (signum_exp));
+ target_signal_from_command (parse_and_eval_long (signum_exp));
}
sig_print_info (oursig);
return;
@@ -3455,15 +3888,73 @@ signals_info (signum_exp, from_tty)
printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
}
+struct inferior_status
+{
+ enum target_signal stop_signal;
+ CORE_ADDR stop_pc;
+ bpstat stop_bpstat;
+ int stop_step;
+ int stop_stack_dummy;
+ int stopped_by_random_signal;
+ int trap_expected;
+ CORE_ADDR step_range_start;
+ CORE_ADDR step_range_end;
+ CORE_ADDR step_frame_address;
+ enum step_over_calls_kind step_over_calls;
+ CORE_ADDR step_resume_break_address;
+ int stop_after_trap;
+ int stop_soon_quietly;
+ CORE_ADDR selected_frame_address;
+ char *stop_registers;
+
+ /* These are here because if call_function_by_hand has written some
+ registers and then decides to call error(), we better not have changed
+ any registers. */
+ char *registers;
+
+ int selected_level;
+ int breakpoint_proceeded;
+ int restore_stack_info;
+ int proceed_to_finish;
+};
+
+static struct inferior_status *
+xmalloc_inferior_status (void)
+{
+ struct inferior_status *inf_status;
+ inf_status = xmalloc (sizeof (struct inferior_status));
+ inf_status->stop_registers = xmalloc (REGISTER_BYTES);
+ inf_status->registers = xmalloc (REGISTER_BYTES);
+ return inf_status;
+}
+
+static void
+free_inferior_status (struct inferior_status *inf_status)
+{
+ xfree (inf_status->registers);
+ xfree (inf_status->stop_registers);
+ xfree (inf_status);
+}
+
+void
+write_inferior_status_register (struct inferior_status *inf_status, int regno,
+ LONGEST val)
+{
+ 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);
+}
+
/* Save all of the information associated with the inferior<==>gdb
connection. INF_STATUS is a pointer to a "struct inferior_status"
(defined in inferior.h). */
-void
-save_inferior_status (inf_status, restore_stack_info)
- struct inferior_status *inf_status;
- int restore_stack_info;
+struct inferior_status *
+save_inferior_status (int restore_stack_info)
{
+ struct inferior_status *inf_status = xmalloc_inferior_status ();
+
inf_status->stop_signal = stop_signal;
inf_status->stop_pc = stop_pc;
inf_status->stop_step = stop_step;
@@ -3478,7 +3969,8 @@ save_inferior_status (inf_status, restore_stack_info)
inf_status->stop_soon_quietly = stop_soon_quietly;
/* Save original bpstat chain here; replace it with copy of chain.
If caller's caller is walking the chain, they'll be happier if we
- hand them back the original chain when restore_i_s is called. */
+ hand them back the original chain when restore_inferior_status is
+ called. */
inf_status->stop_bpstat = stop_bpstat;
stop_bpstat = bpstat_copy (stop_bpstat);
inf_status->breakpoint_proceeded = breakpoint_proceeded;
@@ -3491,7 +3983,7 @@ save_inferior_status (inf_status, restore_stack_info)
record_selected_frame (&(inf_status->selected_frame_address),
&(inf_status->selected_level));
- return;
+ return inf_status;
}
struct restore_selected_frame_args
@@ -3500,16 +3992,8 @@ struct restore_selected_frame_args
int level;
};
-static int restore_selected_frame PARAMS ((PTR));
-
-/* Restore the selected frame. args is really a struct
- restore_selected_frame_args * (declared as char * for catch_errors)
- telling us what frame to restore. Returns 1 for success, or 0 for
- failure. An error message will have been printed on error. */
-
static int
-restore_selected_frame (args)
- PTR args;
+restore_selected_frame (void *args)
{
struct restore_selected_frame_args *fr =
(struct restore_selected_frame_args *) args;
@@ -3523,11 +4007,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");
@@ -3540,8 +4024,7 @@ restore_selected_frame (args)
}
void
-restore_inferior_status (inf_status)
- struct inferior_status *inf_status;
+restore_inferior_status (struct inferior_status *inf_status)
{
stop_signal = inf_status->stop_signal;
stop_pc = inf_status->stop_pc;
@@ -3560,6 +4043,7 @@ restore_inferior_status (inf_status)
breakpoint_proceeded = inf_status->breakpoint_proceeded;
proceed_to_finish = inf_status->proceed_to_finish;
+ /* FIXME: Is the restore of stop_registers always needed */
memcpy (stop_registers, inf_status->stop_registers, REGISTER_BYTES);
/* The inferior can be gone if the user types "print exit(0)"
@@ -3567,9 +4051,6 @@ restore_inferior_status (inf_status)
if (target_has_execution)
write_register_bytes (0, inf_status->registers, REGISTER_BYTES);
- /* The inferior can be gone if the user types "print exit(0)"
- (and perhaps other times). */
-
/* FIXME: If we are being called after stopping in a function which
is called from gdb, we should not be trying to restore the
selected frame; it just prints a spurious error message (The
@@ -3583,8 +4064,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)
@@ -3595,36 +4076,133 @@ restore_inferior_status (inf_status)
select_frame (get_current_frame (), 0);
}
+
+ free_inferior_status (inf_status);
}
-
+static void
+do_restore_inferior_status_cleanup (void *sts)
+{
+ restore_inferior_status (sts);
+}
+
+struct cleanup *
+make_cleanup_restore_inferior_status (struct inferior_status *inf_status)
+{
+ return make_cleanup (do_restore_inferior_status_cleanup, inf_status);
+}
void
-set_follow_fork_mode_command (arg, from_tty, c)
- char *arg;
- int from_tty;
- struct cmd_list_element *c;
-{
- if (!STREQ (arg, "parent") &&
- !STREQ (arg, "child") &&
- !STREQ (arg, "both") &&
- !STREQ (arg, "ask"))
- error ("follow-fork-mode must be one of \"parent\", \"child\", \"both\" or \"ask\".");
-
- if (follow_fork_mode_string != NULL)
- free (follow_fork_mode_string);
- follow_fork_mode_string = savestring (arg, strlen (arg));
+discard_inferior_status (struct inferior_status *inf_status)
+{
+ /* See save_inferior_status for info on stop_bpstat. */
+ bpstat_clear (&inf_status->stop_bpstat);
+ free_inferior_status (inf_status);
}
-
+/* Oft used ptids */
+ptid_t null_ptid;
+ptid_t minus_one_ptid;
+
+/* Create a ptid given the necessary PID, LWP, and TID components. */
+
+ptid_t
+ptid_build (int pid, long lwp, long tid)
+{
+ ptid_t ptid;
+
+ ptid.pid = pid;
+ ptid.lwp = lwp;
+ ptid.tid = tid;
+ return ptid;
+}
+
+/* Create a ptid from just a pid. */
+
+ptid_t
+pid_to_ptid (int pid)
+{
+ return ptid_build (pid, 0, 0);
+}
+
+/* Fetch the pid (process id) component from a ptid. */
+
+int
+ptid_get_pid (ptid_t ptid)
+{
+ return ptid.pid;
+}
+
+/* Fetch the lwp (lightweight process) component from a ptid. */
+
+long
+ptid_get_lwp (ptid_t ptid)
+{
+ return ptid.lwp;
+}
+
+/* Fetch the tid (thread id) component from a ptid. */
+
+long
+ptid_get_tid (ptid_t ptid)
+{
+ return ptid.tid;
+}
+
+/* ptid_equal() is used to test equality of two ptids. */
+
+int
+ptid_equal (ptid_t ptid1, ptid_t ptid2)
+{
+ return (ptid1.pid == ptid2.pid && ptid1.lwp == ptid2.lwp
+ && ptid1.tid == ptid2.tid);
+}
+
+/* restore_inferior_ptid() will be used by the cleanup machinery
+ to restore the inferior_ptid value saved in a call to
+ save_inferior_ptid(). */
+
+static void
+restore_inferior_ptid (void *arg)
+{
+ ptid_t *saved_ptid_ptr = arg;
+ inferior_ptid = *saved_ptid_ptr;
+ xfree (arg);
+}
+
+/* Save the value of inferior_ptid so that it may be restored by a
+ later call to do_cleanups(). Returns the struct cleanup pointer
+ needed for later doing the cleanup. */
+
+struct cleanup *
+save_inferior_ptid (void)
+{
+ ptid_t *saved_ptid_ptr;
+
+ saved_ptid_ptr = xmalloc (sizeof (ptid_t));
+ *saved_ptid_ptr = inferior_ptid;
+ return make_cleanup (restore_inferior_ptid, saved_ptid_ptr);
+}
+
+
+static void
+build_infrun (void)
+{
+ stop_registers = xmalloc (REGISTER_BYTES);
+}
void
-_initialize_infrun ()
+_initialize_infrun (void)
{
register int i;
register int numsigs;
struct cmd_list_element *c;
+ build_infrun ();
+
+ register_gdbarch_swap (&stop_registers, sizeof (stop_registers), NULL);
+ register_gdbarch_swap (NULL, 0, build_infrun);
+
add_info ("signals", signals_info,
"What debugger does when program gets various signals.\n\
Specify a signal as argument to print info on that signal only.");
@@ -3711,6 +4289,17 @@ of the program stops.", &cmdlist);
signal_stop[TARGET_SIGNAL_WINCH] = 0;
signal_print[TARGET_SIGNAL_WINCH] = 0;
+ /* These signals are used internally by user-level thread
+ implementations. (See signal(5) on Solaris.) Like the above
+ signals, a healthy program receives and handles them as part of
+ its normal operation. */
+ signal_stop[TARGET_SIGNAL_LWP] = 0;
+ signal_print[TARGET_SIGNAL_LWP] = 0;
+ signal_stop[TARGET_SIGNAL_WAITING] = 0;
+ signal_print[TARGET_SIGNAL_WAITING] = 0;
+ signal_stop[TARGET_SIGNAL_CANCEL] = 0;
+ signal_print[TARGET_SIGNAL_CANCEL] = 0;
+
#ifdef SOLIB_ADD
add_show_from_set
(add_set_cmd ("stop-on-solib-events", class_support, var_zinteger,
@@ -3726,25 +4315,25 @@ to the user would be loading/unloading of a new library.\n",
c = add_set_enum_cmd ("follow-fork-mode",
class_run,
follow_fork_mode_kind_names,
- (char *) &follow_fork_mode_string,
+ &follow_fork_mode_string,
/* ??rehrauer: The "both" option is broken, by what may be a 10.20
kernel problem. It's also not terribly useful without a GUI to
help the user drive two debuggers. So for now, I'm disabling
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\
@@ -3754,14 +4343,11 @@ 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 = ;*/
add_show_from_set (c, &showlist);
- set_follow_fork_mode_command ("parent", 0, NULL);
-
c = add_set_enum_cmd ("scheduler-locking", class_run,
scheduler_enums, /* array of string names */
- (char *) &scheduler_mode, /* current mode */
+ &scheduler_mode, /* current mode */
"Set mode for locking scheduler during execution.\n\
off == no locking (threads may preempt at any time)\n\
on == full locking (no thread except the current thread may run)\n\
@@ -3770,6 +4356,21 @@ step == scheduler locked during every single-step operation.\n\
Other threads may run while stepping over a function call ('next').",
&setlist);
- c->function.sfunc = set_schedlock_func; /* traps on target vector */
+ set_cmd_sfunc (c, set_schedlock_func); /* traps on target vector */
+ add_show_from_set (c, &showlist);
+
+ c = add_set_cmd ("step-mode", class_run,
+ var_boolean, (char*) &step_stop_if_no_debug,
+"Set mode of the step operation. When set, doing a step over a\n\
+function without debug line information will stop at the first\n\
+instruction of that function. Otherwise, the function is skipped and\n\
+the step command stops at a different source line.",
+ &setlist);
add_show_from_set (c, &showlist);
+
+ /* ptid initializations */
+ null_ptid = ptid_build (0, 0, 0);
+ minus_one_ptid = ptid_build (-1, 0, 0);
+ inferior_ptid = null_ptid;
+ target_last_wait_ptid = minus_one_ptid;
}
diff --git a/contrib/gdb/gdb/inftarg.c b/contrib/gdb/gdb/inftarg.c
index af5cd3d..9035310 100644
--- a/contrib/gdb/gdb/inftarg.c
+++ b/contrib/gdb/gdb/inftarg.c
@@ -1,27 +1,30 @@
/* Target-vector operations for controlling Unix child processes, for GDB.
- Copyright 1990-1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+ 2000, 2002
+ 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"
@@ -31,90 +34,64 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <sys/types.h>
#include <fcntl.h>
-#ifdef HAVE_WAIT_H
-# include <wait.h>
-#else
-# ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-# endif
-#endif
-
-/* "wait.h" fills in the gaps left by <wait.h> */
-#include "wait.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "gdb_wait.h"
-extern struct symtab_and_line *
-child_enable_exception_callback PARAMS ((enum exception_event_kind, int));
+extern struct symtab_and_line *child_enable_exception_callback (enum
+ exception_event_kind,
+ int);
-extern struct exception_event_record *
-child_get_current_exception_event PARAMS ((void));
+extern struct exception_event_record
+ *child_get_current_exception_event (void);
-extern void _initialize_inftarg PARAMS ((void));
+extern void _initialize_inftarg (void);
-static void
-child_prepare_to_store PARAMS ((void));
+static void child_prepare_to_store (void);
#ifndef CHILD_WAIT
-static int child_wait PARAMS ((int, struct target_waitstatus *));
+static ptid_t child_wait (ptid_t, struct target_waitstatus *);
#endif /* CHILD_WAIT */
#if !defined(CHILD_POST_WAIT)
-void
-child_post_wait PARAMS ((int, int));
+void child_post_wait (ptid_t, int);
#endif
-static void child_open PARAMS ((char *, int));
+static void child_open (char *, int);
-static void
-child_files_info PARAMS ((struct target_ops *));
+static void child_files_info (struct target_ops *);
-static void
-child_detach PARAMS ((char *, int));
+static void child_detach (char *, int);
-static void
-child_detach_from_process PARAMS ((int, char *, int, int));
+static void child_detach_from_process (int, char *, int, int);
-static void
-child_attach PARAMS ((char *, int));
+static void child_attach (char *, int);
-static void
-child_attach_to_process PARAMS ((char *, int, int));
+static void child_attach_to_process (char *, int, int);
#if !defined(CHILD_POST_ATTACH)
-extern void child_post_attach PARAMS ((int));
+extern void child_post_attach (int);
#endif
-static void
-child_require_attach PARAMS ((char *, int));
+static void child_require_attach (char *, int);
-static void
-child_require_detach PARAMS ((int, char *, int));
+static void child_require_detach (int, char *, int);
-static void
-ptrace_me PARAMS ((void));
+static void ptrace_me (void);
-static void
-ptrace_him PARAMS ((int));
+static void ptrace_him (int);
-static void
-child_create_inferior PARAMS ((char *, char *, char **));
+static void child_create_inferior (char *, char *, char **);
-static void
-child_mourn_inferior PARAMS ((void));
+static void child_mourn_inferior (void);
-static int
-child_can_run PARAMS ((void));
+static int child_can_run (void);
-static void
-child_stop PARAMS ((void));
+static void child_stop (void);
#ifndef CHILD_THREAD_ALIVE
-int child_thread_alive PARAMS ((int));
+int child_thread_alive (ptid_t);
#endif
-static void init_child_ops PARAMS ((void));
+static void init_child_ops (void);
extern char **environ;
@@ -127,140 +104,141 @@ int child_suppress_run = 0; /* Non-zero if inftarg should pretend not to
#ifndef CHILD_WAIT
-/*##*/
+/*## */
/* Enable HACK for ttrace work. In
* infttrace.c/require_notification_of_events,
* this is set to 0 so that the loop in child_wait
* won't loop.
*/
int not_same_real_pid = 1;
-/*##*/
+/*## */
/* Wait for child to do something. Return pid of child, or -1 in case
of error; store status through argument pointer OURSTATUS. */
-static int
-child_wait (pid, ourstatus)
- int pid;
- struct target_waitstatus *ourstatus;
+static ptid_t
+child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
int save_errno;
int status;
- char * execd_pathname;
- 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 ();
-
- pid = ptrace_wait (inferior_pid, &status);
-
- save_errno = errno;
+ char *execd_pathname = NULL;
+ int exit_status;
+ int related_pid;
+ int syscall_id;
+ enum target_waitkind kind;
+ int pid;
+
+ do
+ {
+ set_sigint_trap (); /* Causes SIGINT to be passed on to the
+ attached process. */
+ set_sigio_trap ();
- clear_sigio_trap ();
+ pid = ptrace_wait (inferior_ptid, &status);
- clear_sigint_trap();
+ save_errno = errno;
- if (pid == -1)
- {
- if (save_errno == EINTR)
- continue;
+ clear_sigio_trap ();
- fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
- safe_strerror (save_errno));
+ clear_sigint_trap ();
- /* Claim it exited with unknown signal. */
- ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
- ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
- return -1;
- }
+ if (pid == -1)
+ {
+ if (save_errno == EINTR)
+ continue;
- /* Did it exit?
- */
- if (target_has_exited (pid, status, &exit_status))
- {
- /* ??rehrauer: For now, ignore this. */
- continue;
- }
+ fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
+ safe_strerror (save_errno));
- 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;
- }
+ /* Claim it exited with unknown signal. */
+ ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+ ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+ return pid_to_ptid (-1);
+ }
- 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_to_ptid (pid)))
+ {
+ ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
+ return pid_to_ptid (pid);
+ }
+
+ if (target_has_forked (pid, &related_pid)
+ && ((pid == PIDGET (inferior_ptid))
+ || (related_pid == PIDGET (inferior_ptid))))
+ {
+ ourstatus->kind = TARGET_WAITKIND_FORKED;
+ ourstatus->value.related_pid = related_pid;
+ return pid_to_ptid (pid);
+ }
+
+ if (target_has_vforked (pid, &related_pid)
+ && ((pid == PIDGET (inferior_ptid))
+ || (related_pid == PIDGET (inferior_ptid))))
+ {
+ ourstatus->kind = TARGET_WAITKIND_VFORKED;
+ ourstatus->value.related_pid = related_pid;
+ return pid_to_ptid (pid);
+ }
+
+ if (target_has_execd (pid, &execd_pathname))
+ {
+ /* Are we ignoring initial exec events? (This is likely because
+ we're in the process of starting up the inferior, and another
+ (older) mechanism handles those.) If so, we'll report this
+ as a regular stop, not an exec.
+ */
+ if (inferior_ignoring_startup_exec_events)
+ {
+ inferior_ignoring_startup_exec_events--;
+ }
+ else
+ {
+ ourstatus->kind = TARGET_WAITKIND_EXECD;
+ ourstatus->value.execd_pathname = execd_pathname;
+ return pid_to_ptid (pid);
+ }
+ }
+
+ /* All we must do with these is communicate their occurrence
+ to wait_for_inferior...
+ */
+ if (target_has_syscall_event (pid, &kind, &syscall_id))
+ {
+ ourstatus->kind = kind;
+ ourstatus->value.syscall_id = syscall_id;
+ return pid_to_ptid (pid);
+ }
+
+ /*## } while (pid != PIDGET (inferior_ptid)); ## *//* Some other child died or stopped */
/* hack for thread testing */
- } while( (pid != inferior_pid) && not_same_real_pid );
-/*##*/
+ }
+ while ((pid != PIDGET (inferior_ptid)) && not_same_real_pid);
+/*## */
store_waitstatus (ourstatus, status);
- return pid;
+ return pid_to_ptid (pid);
}
#endif /* CHILD_WAIT */
#if !defined(CHILD_POST_WAIT)
void
-child_post_wait (pid, wait_status)
- int pid;
- int wait_status;
+child_post_wait (ptid_t ptid, int wait_status)
{
/* This version of Unix doesn't require a meaningful "post wait"
operation.
- */
+ */
}
#endif
-
+
#ifndef CHILD_THREAD_ALIVE
@@ -270,19 +248,17 @@ child_post_wait (pid, wait_status)
for now we're going to try and be compatable with the old thread
code. */
int
-child_thread_alive (pid)
- int pid;
+child_thread_alive (ptid_t ptid)
{
+ pid_t pid = PIDGET (ptid);
+
return (kill (pid, 0) != -1);
}
#endif
static void
-child_attach_to_process (args, from_tty, after_fork)
- char * args;
- int from_tty;
- int after_fork;
+child_attach_to_process (char *args, int from_tty, int after_fork)
{
if (!args)
error_no_arg ("process-id to attach");
@@ -301,7 +277,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 +285,14 @@ 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_to_ptid (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_to_ptid (pid)));
+ else
+ printf_unfiltered ("Attaching to %s\n",
+ target_pid_to_str (pid_to_ptid (pid)));
gdb_flush (gdb_stdout);
}
@@ -325,27 +302,24 @@ child_attach_to_process (args, from_tty, after_fork)
else
REQUIRE_ATTACH (pid);
- inferior_pid = pid;
+ inferior_ptid = pid_to_ptid (pid);
push_target (&child_ops);
}
-#endif /* ATTACH_DETACH */
+#endif /* ATTACH_DETACH */
}
/* Attach to process PID, then initialize for debugging it. */
static void
-child_attach (args, from_tty)
- char *args;
- int from_tty;
+child_attach (char *args, int from_tty)
{
child_attach_to_process (args, from_tty, 0);
}
#if !defined(CHILD_POST_ATTACH)
void
-child_post_attach (pid)
- int pid;
+child_post_attach (int pid)
{
/* This version of Unix doesn't require a meaningful "post attach"
operation by a debugger. */
@@ -353,19 +327,13 @@ child_post_attach (pid)
#endif
static void
-child_require_attach (args, from_tty)
- char *args;
- int from_tty;
+child_require_attach (char *args, 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;
+child_detach_from_process (int pid, char *args, int from_tty, int after_fork)
{
#ifdef ATTACH_DETACH
{
@@ -376,12 +344,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_to_ptid (pid)));
+ else
printf_unfiltered ("Detaching from program: %s, %s\n", exec_file,
- target_pid_to_str (pid));
+ target_pid_to_str (pid_to_ptid (pid)));
gdb_flush (gdb_stdout);
}
if (args)
@@ -406,20 +374,15 @@ child_detach_from_process (pid, args, from_tty, after_fork)
started via the normal ptrace (PTRACE_TRACEME). */
static void
-child_detach (args, from_tty)
- char *args;
- int from_tty;
+child_detach (char *args, int from_tty)
{
- child_detach_from_process (inferior_pid, args, from_tty, 0);
- inferior_pid = 0;
+ child_detach_from_process (PIDGET (inferior_ptid), args, from_tty, 0);
+ inferior_ptid = null_ptid;
unpush_target (&child_ops);
}
static void
-child_require_detach (pid, args, from_tty)
- int pid;
- char * args;
- int from_tty;
+child_require_detach (int pid, char *args, int from_tty)
{
child_detach_from_process (pid, args, from_tty, 1);
}
@@ -432,7 +395,7 @@ child_require_detach (pid, args, from_tty)
debugged. */
static void
-child_prepare_to_store ()
+child_prepare_to_store (void)
{
#ifdef CHILD_PREPARE_TO_STORE
CHILD_PREPARE_TO_STORE ();
@@ -442,18 +405,15 @@ child_prepare_to_store ()
/* Print status information about what we're accessing. */
static void
-child_files_info (ignore)
- struct target_ops *ignore;
+child_files_info (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_ptid));
}
/* ARGSUSED */
static void
-child_open (arg, from_tty)
- char *arg;
- int from_tty;
+child_open (char *arg, int from_tty)
{
error ("Use the \"run\" command to start a Unix child process.");
}
@@ -462,7 +422,7 @@ child_open (arg, from_tty)
by its parent process. */
static void
-ptrace_me ()
+ptrace_me (void)
{
/* "Trace me, Dr. Memory!" */
call_ptrace (0, 0, (PTRACE_ARG3_TYPE) 0, 0);
@@ -471,9 +431,8 @@ ptrace_me ()
/* Stub function which causes the GDB that runs it, to start ptrace-ing
the child process. */
-static void
-ptrace_him (pid)
- int pid;
+static void
+ptrace_him (int pid)
{
push_target (&child_ops);
@@ -481,7 +440,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,85 +452,22 @@ 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);
+ */
+ target_post_startup_inferior (pid_to_ptid (pid));
}
-/* Start an inferior Unix child process and sets inferior_pid to its pid.
+/* Start an inferior Unix child process and sets inferior_ptid to its pid.
EXEC_FILE is the file to run.
ALLARGS is a string containing the arguments to the program.
ENV is the environment vector to pass. Errors reported with error(). */
static void
-child_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
+child_create_inferior (char *exec_file, char *allargs, char **env)
{
-
#ifdef HPUXHPPA
- char *tryname;
- char *shell_file;
- char *p;
- char *p1;
- char *path = getenv ("PATH");
- int len;
- struct stat statbuf;
-
- /* On HP-UX, we have a possible bad interaction between
- * the start-up-with-shell code and our catch-fork/catch-exec
- * logic. To avoid the bad interaction, we start up with the
- * C shell ("csh") and pass it the "-f" flag (fast start-up,
- * don't run .cshrc code).
- * See further comments in inferior.h toward the bottom
- * (STARTUP_WITH_SHELL flag) and in fork-child.c
- */
-
- /* Rather than passing in a hard-wired path like "/bin/csh",
- * we look down the PATH to find csh. I took this code from
- * procfs.c, which is the file in the Sun-specific part of GDB
- * analogous to inftarg.c. See procfs.c for more detailed
- * comments. - RT
- */
- shell_file = "csh";
- if (path == NULL)
- path = "/bin:/usr/bin";
- tryname = alloca (strlen (path) + strlen (shell_file) + 2);
- for (p = path; p != NULL; p = p1 ? p1 + 1: NULL)
- {
- p1 = strchr (p, ':');
- if (p1 != NULL)
- len = p1 - p;
- else
- len = strlen (p);
- strncpy (tryname, p, len);
- tryname[len] = '\0';
- strcat (tryname, "/");
- strcat (tryname, shell_file);
- if (access (tryname, X_OK) < 0)
- continue;
- if (stat (tryname, &statbuf) < 0)
- continue;
- if (!S_ISREG (statbuf.st_mode))
- /* We certainly need to reject directories. I'm not quite
- as sure about FIFOs, sockets, etc., but I kind of doubt
- that people want to exec() these things. */
- continue;
- break;
- }
- if (p == NULL)
- /* Not found. I replaced the error() which existed in procfs.c
- * with simply passing in NULL and hoping fork_inferior()
- * can deal with it. - RT
- */
- /* error ("Can't find shell %s in PATH", shell_file); */
- shell_file = NULL;
- else
- shell_file = tryname;
-
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... */
@@ -580,54 +476,49 @@ child_create_inferior (exec_file, allargs, env)
#if !defined(CHILD_POST_STARTUP_INFERIOR)
void
-child_post_startup_inferior (pid)
- int pid;
+child_post_startup_inferior (ptid_t ptid)
{
/* 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;
+child_acknowledge_created_inferior (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;
+child_clone_and_follow_inferior (int child_pid, int *followed_child)
{
clone_and_follow_inferior (child_pid, followed_child);
/* Don't resume CHILD_PID; it's stopped where it ought to be, until
the decision gets made elsewhere how to continue it.
- */
+ */
}
#if !defined(CHILD_POST_FOLLOW_INFERIOR_BY_CLONE)
void
-child_post_follow_inferior_by_clone ()
+child_post_follow_inferior_by_clone (void)
{
/* This version of Unix doesn't require a meaningful "post follow inferior"
operation by a clone debugger.
- */
+ */
}
#endif
#if !defined(CHILD_INSERT_FORK_CATCHPOINT)
int
-child_insert_fork_catchpoint (pid)
- int pid;
+child_insert_fork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of fork events. */
return 0;
@@ -636,8 +527,7 @@ child_insert_fork_catchpoint (pid)
#if !defined(CHILD_REMOVE_FORK_CATCHPOINT)
int
-child_remove_fork_catchpoint (pid)
- int pid;
+child_remove_fork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of fork events. */
return 0;
@@ -646,8 +536,7 @@ child_remove_fork_catchpoint (pid)
#if !defined(CHILD_INSERT_VFORK_CATCHPOINT)
int
-child_insert_vfork_catchpoint (pid)
- int pid;
+child_insert_vfork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of vfork events. */
return 0;
@@ -656,8 +545,7 @@ child_insert_vfork_catchpoint (pid)
#if !defined(CHILD_REMOVE_VFORK_CATCHPOINT)
int
-child_remove_vfork_catchpoint (pid)
- int pid;
+child_remove_vfork_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of vfork events. */
return 0;
@@ -666,9 +554,7 @@ child_remove_vfork_catchpoint (pid)
#if !defined(CHILD_HAS_FORKED)
int
-child_has_forked (pid, child_pid)
- int pid;
- int *child_pid;
+child_has_forked (int pid, int *child_pid)
{
/* This version of Unix doesn't support notification of fork events. */
return 0;
@@ -678,12 +564,10 @@ child_has_forked (pid, child_pid)
#if !defined(CHILD_HAS_VFORKED)
int
-child_has_vforked (pid, child_pid)
- int pid;
- int * child_pid;
+child_has_vforked (int pid, int *child_pid)
{
/* This version of Unix doesn't support notification of vfork events.
- */
+ */
return 0;
}
#endif
@@ -691,12 +575,12 @@ child_has_vforked (pid, child_pid)
#if !defined(CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC)
int
-child_can_follow_vfork_prior_to_exec ()
+child_can_follow_vfork_prior_to_exec (void)
{
/* 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
@@ -704,22 +588,18 @@ 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;
+child_post_follow_vfork (int parent_pid, int followed_parent, int child_pid,
+ int followed_child)
{
/* This version of Unix doesn't require a meaningful "post follow vfork"
operation by a clone debugger.
- */
+ */
}
#endif
#if !defined(CHILD_INSERT_EXEC_CATCHPOINT)
int
-child_insert_exec_catchpoint (pid)
- int pid;
+child_insert_exec_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of exec events. */
return 0;
@@ -728,8 +608,7 @@ child_insert_exec_catchpoint (pid)
#if !defined(CHILD_REMOVE_EXEC_CATCHPOINT)
int
-child_remove_exec_catchpoint (pid)
- int pid;
+child_remove_exec_catchpoint (int pid)
{
/* This version of Unix doesn't support notification of exec events. */
return 0;
@@ -738,12 +617,10 @@ child_remove_exec_catchpoint (pid)
#if !defined(CHILD_HAS_EXECD)
int
-child_has_execd (pid, execd_pathname)
- int pid;
- char ** execd_pathname;
+child_has_execd (int pid, char **execd_pathname)
{
/* This version of Unix doesn't support notification of exec events.
- */
+ */
return 0;
}
#endif
@@ -751,10 +628,10 @@ child_has_execd (pid, execd_pathname)
#if !defined(CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL)
int
-child_reported_exec_events_per_exec_call ()
+child_reported_exec_events_per_exec_call (void)
{
/* This version of Unix doesn't support notification of exec events.
- */
+ */
return 1;
}
#endif
@@ -762,13 +639,10 @@ 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;
+child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id)
{
/* This version of Unix doesn't support notification of syscall events.
- */
+ */
return 0;
}
#endif
@@ -776,10 +650,7 @@ 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;
+child_has_exited (int pid, int wait_status, int *exit_status)
{
if (WIFEXITED (wait_status))
{
@@ -789,12 +660,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;
}
@@ -802,18 +673,14 @@ child_has_exited (pid, wait_status, exit_status)
static void
-child_mourn_inferior ()
+child_mourn_inferior (void)
{
- /* FIXME: Should be in a header file */
- extern void proc_remove_foreign PARAMS ((int));
-
unpush_target (&child_ops);
- proc_remove_foreign (inferior_pid);
generic_mourn_inferior ();
}
static int
-child_can_run ()
+child_can_run (void)
{
/* This variable is controlled by modules that sit atop inftarg that may layer
their own process structure atop that provided here. hpux-thread.c does
@@ -829,7 +696,7 @@ child_can_run ()
killpg() instead of kill (-pgrp). */
static void
-child_stop ()
+child_stop (void)
{
extern pid_t inferior_process_group;
@@ -838,9 +705,7 @@ 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;
+child_enable_exception_callback (enum exception_event_kind kind, int enable)
{
return (struct symtab_and_line *) NULL;
}
@@ -848,7 +713,7 @@ child_enable_exception_callback (kind, enable)
#if !defined(CHILD_GET_CURRENT_EXCEPTION_EVENT)
struct exception_event_record *
-child_get_current_exception_event ()
+child_get_current_exception_event (void)
{
return (struct exception_event_record *) NULL;
}
@@ -857,30 +722,35 @@ child_get_current_exception_event ()
#if !defined(CHILD_PID_TO_EXEC_FILE)
char *
-child_pid_to_exec_file (pid)
- int pid;
+child_pid_to_exec_file (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;
+child_core_file_to_sym_file (char *core)
{
/* The target stratum for a running executable need not support
this operation.
- */
+ */
return NULL;
}
+
+#if !defined(CHILD_PID_TO_STR)
+char *
+child_pid_to_str (ptid_t ptid)
+{
+ return normal_pid_to_str (ptid);
+}
+#endif
-
static void
-init_child_ops ()
+init_child_ops (void)
{
child_ops.to_shortname = "child";
child_ops.to_longname = "Unix child process";
@@ -929,11 +799,11 @@ init_child_ops ()
child_ops.to_mourn_inferior = child_mourn_inferior;
child_ops.to_can_run = child_can_run;
child_ops.to_thread_alive = child_thread_alive;
+ child_ops.to_pid_to_str = child_pid_to_str;
child_ops.to_stop = child_stop;
child_ops.to_enable_exception_callback = child_enable_exception_callback;
child_ops.to_get_current_exception_event = child_get_current_exception_event;
child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
- child_ops.to_core_file_to_sym_file = child_core_file_to_sym_file;
child_ops.to_stratum = process_stratum;
child_ops.to_has_all_memory = 1;
child_ops.to_has_memory = 1;
@@ -943,8 +813,26 @@ init_child_ops ()
child_ops.to_magic = OPS_MAGIC;
}
+/* Take over the 'find_mapped_memory' vector from inftarg.c. */
+extern void
+inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *))
+{
+ child_ops.to_find_memory_regions = func;
+}
+
+/* Take over the 'make_corefile_notes' vector from inftarg.c. */
+extern void
+inftarg_set_make_corefile_notes (char * (*func) (bfd *, int *))
+{
+ child_ops.to_make_corefile_notes = func;
+}
+
void
-_initialize_inftarg ()
+_initialize_inftarg (void)
{
#ifdef HAVE_OPTIONAL_PROC_FS
char procname[32];
diff --git a/contrib/gdb/gdb/infttrace.c b/contrib/gdb/gdb/infttrace.c
index 61723df..7433b7c 100644
--- a/contrib/gdb/gdb/infttrace.c
+++ b/contrib/gdb/gdb/infttrace.c
@@ -1,31 +1,41 @@
/* Low level Unix child interface to ttrace, for GDB when running under HP-UX.
- Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+ 1999, 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "target.h"
#include "gdb_string.h"
-#include "wait.h"
+#include "gdb_wait.h"
#include "command.h"
+/* We need pstat functionality so that we can get the exec file
+ for a process we attach to.
+
+ According to HP, we should use the 64bit interfaces, so we
+ define _PSTAT64 to achieve this. */
+#define _PSTAT64
+#include <sys/pstat.h>
+
/* Some hackery to work around a use of the #define name NO_FLAGS
* in both gdb and HPUX (bfd.h and /usr/include/machine/vmparam.h).
*/
@@ -44,9 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <sys/ioctl.h>
#include <sys/ttrace.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include <sys/mman.h>
#ifndef NO_PTRACE_H
@@ -117,24 +124,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 +156,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 +173,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 +300,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 +332,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,211 +345,220 @@ 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;
+
/****************************************************
* 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 ptid_t saved_real_ptid;
+
/*************************************************
* Debugging support functions *
*************************************************
*/
CORE_ADDR
-get_raw_pc( ttid )
- lwpid_t ttid;
+get_raw_pc (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;
+ 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;
+ else
+ {
+ return (CORE_ADDR) 0;
}
-}
+}
static char *
-get_printable_name_of_stepping_mode( mode )
- stepping_mode_t mode;
+get_printable_name_of_stepping_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
* ttrace event being reported.
*/
char *
-get_printable_name_of_ttrace_event (event)
- ttevents_t event;
+get_printable_name_of_ttrace_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?";
- }
+ }
}
-
+
/* 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;
+get_printable_name_of_ttrace_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?";
- }
+ }
}
-
+
/* 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;
+get_printable_name_of_process_state (process_state_t process_state)
{
- switch (process_state) {
+ switch (process_state)
+ {
case STOPPED:
return "STOPPED";
case FAKE_STEPPING:
@@ -547,176 +571,178 @@ 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;
+clear_ttstate_t (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;
+copy_ttstate_t (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 (void)
{
- 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;
+create_thread_info (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 = xmalloc (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_ptid = inferior_ptid;
}
- 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.
*/
static void
-clear_thread_info ()
+clear_thread_info (void)
{
- 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;
+ xfree (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;
+ xfree (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;
+find_thread_info (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 +753,47 @@ 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 (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 +802,97 @@ 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 (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
-saved_signals_exist ()
+static int
+saved_signals_exist (void)
{
- 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
-is_pseudo_thread (tid)
- lwpid_t tid;
+static int
+is_pseudo_thread (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
-is_terminated (tid)
- lwpid_t tid;
+static int
+is_terminated (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
-is_process_id (pid)
- int pid;
+static int
+is_process_id (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 +904,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);
@@ -886,163 +914,166 @@ is_process_id (pid)
/* Add a thread to our info. Prevent duplicate entries.
*/
static thread_info *
-add_tthread (pid, tid)
- int pid;
- lwpid_t tid;
+add_tthread (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;
+del_tthread (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;
}
}
/* Get the pid for this tid. (Has to be a real TID!).
*/
static int
-get_pid_for (tid)
- lwpid_t tid;
+get_pid_for (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 (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 (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 (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);
@@ -1055,35 +1086,36 @@ clear_handled( tid )
/* Set all threads to unhandled.
*/
static void
-clear_all_handled ()
+clear_all_handled (void)
{
- 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 (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);
@@ -1096,33 +1128,36 @@ clear_stepping_mode( tid )
/* Set all threads to do default continue on resume.
*/
static void
-clear_all_stepping_mode ()
+clear_all_stepping_mode (void)
{
- 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 ()
+set_all_unseen (void)
{
- 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;
}
}
@@ -1130,68 +1165,71 @@ set_all_unseen ()
/* debugging routine.
*/
static void
-print_tthread (p)
- thread_info * p;
+print_tthread (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 (" 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);
- printf( "\n" );
+ 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 ()
+print_tthreads (void)
{
- 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);
- }
+ 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 );
+ 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);
- }
+ for (p = deleted_threads.head; p; p = p->next)
+ {
+ print_tthread (p);
+ }
}
}
#endif
@@ -1199,40 +1237,42 @@ print_tthreads ()
/* Update the thread list based on the "seen" bits.
*/
static void
-update_thread_list ()
+update_thread_list (void)
{
- 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
+ If so, is it inferior_ptid and is a vfork in flight? If yes to
all, then DON'T REMOVE IT! We're in the midst of moving a vfork
operation, which is a multiple step thing, to the point where we
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);
+ }
}
}
-
-
+
+
/************************************************
* O/S call wrappers *
************************************************
@@ -1245,34 +1285,33 @@ 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 (ttreq_t request, pid_t pid, lwpid_t tid, TTRACE_ARG_TYPE addr,
+ TTRACE_ARG_TYPE data, TTRACE_ARG_TYPE 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 +1319,49 @@ 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;
}
-
+
/* 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 (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;
}
-
+
/* 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.
@@ -1333,45 +1370,44 @@ call_real_ttrace_wait( pid, tid, option, tsp, tsp_size )
to iterate over the IDs of all stopped threads of this process.
*/
static lwpid_t
-get_process_first_stopped_thread_id (pid, thread_state)
- int pid;
- ttstate_t * thread_state;
+get_process_first_stopped_thread_id (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_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)
/* Failed somehow.
*/
return 0;
return thread_state->tts_lwpid;
}
-
+
/* 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
@@ -1382,19 +1418,17 @@ get_process_first_stopped_thread_id (pid, thread_state)
to iterate over the IDs of all stopped threads of this process.
*/
static lwpid_t
-get_process_next_stopped_thread_id (pid, thread_state)
- int pid;
- ttstate_t * thread_state;
+get_process_next_stopped_thread_id (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 +1437,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;
}
@@ -1425,10 +1460,9 @@ get_process_next_stopped_thread_id (pid, thread_state)
NOTE: currently not called.
*/
static lwpid_t
-get_active_tid_of_pid (pid)
- int pid;
+get_active_tid_of_pid (int pid)
{
- ttstate_t thread_state;
+ ttstate_t thread_state;
return get_process_first_stopped_thread_id (pid, &thread_state);
}
@@ -1437,50 +1471,50 @@ get_active_tid_of_pid (pid)
* operates upon all threads of a (i.e., the entire) process.
*/
int
-is_process_ttrace_request (tt_request)
- ttreq_t tt_request;
+is_process_ttrace_request (ttreq_t tt_request)
{
return IS_TTRACE_PROCREQ (tt_request);
}
-
+
/* 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 (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;
- }
+ }
}
-
+
/* 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 +1525,36 @@ 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 (ttreq_t request, int gdb_tid, TTRACE_ARG_TYPE addr,
+ TTRACE_ARG_TYPE data, TTRACE_ARG_TYPE 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 +1565,140 @@ 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 (! ptid_equal (saved_real_ptid, null_ptid))
+ {
#ifdef THREAD_DEBUG
- if( debug_on )
- printf( "...using saved pid %d\n", saved_real_pid );
+ if (debug_on)
+ printf ("...using saved pid %d\n",
+ PIDGET (saved_real_ptid));
#endif
- real_pid = saved_real_pid;
- real_tid = gdb_tid;
- }
+ real_pid = PIDGET (saved_real_ptid);
+ 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 (ptid_equal (saved_real_ptid, null_ptid))
+ printf ("...but there's no saved pid\n");
+
+ else
+ {
+ if (gdb_tid != PIDGET (saved_real_ptid))
+ printf ("...but have the wrong pid (%d rather than %d)\n",
+ gdb_tid, PIDGET (saved_real_ptid));
+ }
+ }
#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 +1706,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 +1719,22 @@ 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 (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,18 +1754,16 @@ 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))
+ (((evt) == TTEVT_VFORK) && ((pid) != PIDGET (inferior_ptid)))
#define CHILD_URPED(evt,pid) \
((((evt) == TTEVT_EXEC) || ((evt) == TTEVT_EXIT)) && ((pid) != vforking_child_pid))
#define PARENT_VFORKED(evt,pid) \
- (((evt) == TTEVT_VFORK) && ((pid) == inferior_pid))
+ (((evt) == TTEVT_VFORK) && ((pid) == PIDGET (inferior_ptid)))
static int
-can_touch_threads_of_process (pid, stopping_event)
- int pid;
- ttevents_t stopping_event;
+can_touch_threads_of_process (int pid, ttevents_t stopping_event)
{
if (CHILD_VFORKED (stopping_event, pid))
{
@@ -1726,14 +1772,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 +1790,11 @@ 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
-select_stopped_thread_of_process (pid, tsp)
- int pid;
- ttstate_t * tsp;
+static int
+select_stopped_thread_of_process (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 +1802,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 +1818,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 +1832,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 +1868,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 +1906,101 @@ 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 (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 */
+
/* 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 +2011,7 @@ 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 (int pid, ttwopt_t option, ttstate_t *tsp, size_t tsp_size)
{
/* This holds the actual, for-real, true process ID.
*/
@@ -1967,35 +2021,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 +2064,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 +2151,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 +2174,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_wait( wait_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 +2189,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 +2297,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 ()
+child_reported_exec_events_per_exec_call (void)
{
- return 1; /* ttrace reports the event once per call. */
+ return 1; /* ttrace reports the event once per call. */
}
#endif
+
-
/* 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 +2333,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 ()
+require_memory_page_dictionary (void)
{
- 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 +2369,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;
@@ -2301,9 +2380,9 @@ require_memory_page_dictionary ()
static void
-retire_memory_page_dictionary ()
+retire_memory_page_dictionary (void)
{
- memory_page_dictionary.page_count = (LONGEST) -1;
+ memory_page_dictionary.page_count = (LONGEST) - 1;
}
@@ -2312,22 +2391,20 @@ retire_memory_page_dictionary ()
Returns the original permissions of the page.
*/
static int
-write_protect_page (pid, page_start)
- int pid;
- CORE_ADDR page_start;
+write_protect_page (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 +2412,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 +2428,20 @@ 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;
+unwrite_protect_page (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 +2451,24 @@ 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;
+hppa_enable_page_protection_events (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 +2478,22 @@ 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;
+hppa_disable_page_protection_events (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 +2507,91 @@ 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 (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;
@@ -2530,39 +2605,37 @@ count_unhandled_events( real_pid, real_tid )
* Note: used by core gdb and so uses the pseudo-pid (really tid).
*/
int
-ptrace_wait (pid, status)
- int pid;
- int *status;
+ptrace_wait (ptid_t ptid, 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 PIDGET (inferior_ptid);
+ }
- 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;
+ return PIDGET (inferior_ptid);
}
real_pid = tsp.tts_pid;
@@ -2573,73 +2646,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, PIDGET (inferior_ptid));
#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 +2728,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 +2745,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 +2754,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 +2816,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_ptid = pid_to_ptid (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,21 +2887,21 @@ 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;
}
- target_post_wait (tsp.tts_pid, *status);
+ target_post_wait (pid_to_ptid (tsp.tts_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 +2909,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 = PIDGET (inferior_ptid);
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;
}
-
+
/* 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
@@ -2868,39 +2947,39 @@ ptrace_wait (pid, status)
child_acknowledge_created_inferior.)
*/
int
-parent_attach_all ()
+parent_attach_all (void)
{
- 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 +2988,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 +3006,17 @@ 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 (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 +3036,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 +3047,26 @@ 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 (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 +3082,43 @@ 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);
}
-
+
/* 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;
+child_acknowledge_created_inferior (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 +3131,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_to_ptid (pid)); /* in thread.c */
/* We can now set the child's ttrace event mask.
*/
@@ -3067,8 +3143,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,28 +3159,26 @@ child_acknowledge_created_inferior (pid)
* calling require_notification_of_events.
*/
void
-child_post_startup_inferior ( real_pid)
- int real_pid;
+child_post_startup_inferior (ptid_t ptid)
{
- require_notification_of_events (real_pid);
+ require_notification_of_events (PIDGET (ptid));
}
/* From here on, we should expect tids rather than pids.
*/
static void
-hppa_enable_catch_fork (tid)
- int tid;
+hppa_enable_catch_fork (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,34 +3186,33 @@ 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");
}
static void
-hppa_disable_catch_fork (tid)
- int tid;
+hppa_disable_catch_fork (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 +3221,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");
@@ -3165,13 +3238,12 @@ hppa_disable_catch_fork (tid)
#if defined(CHILD_INSERT_FORK_CATCHPOINT)
int
-child_insert_fork_catchpoint (tid)
- int tid;
+child_insert_fork_catchpoint (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
@@ -3179,32 +3251,30 @@ child_insert_fork_catchpoint (tid)
#if defined(CHILD_REMOVE_FORK_CATCHPOINT)
int
-child_remove_fork_catchpoint (tid)
- int tid;
+child_remove_fork_catchpoint (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
static void
-hppa_enable_catch_vfork (tid)
- int tid;
+hppa_enable_catch_vfork (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 +3283,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");
@@ -3229,18 +3299,17 @@ hppa_enable_catch_vfork (tid)
static void
-hppa_disable_catch_vfork (tid)
- int tid;
+hppa_disable_catch_vfork (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 +3318,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");
@@ -3265,13 +3334,12 @@ hppa_disable_catch_vfork (tid)
#if defined(CHILD_INSERT_VFORK_CATCHPOINT)
int
-child_insert_vfork_catchpoint (tid)
- int tid;
+child_insert_vfork_catchpoint (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
@@ -3279,13 +3347,12 @@ child_insert_vfork_catchpoint (tid)
#if defined(CHILD_REMOVE_VFORK_CATCHPOINT)
int
-child_remove_vfork_catchpoint (tid)
- int tid;
+child_remove_vfork_catchpoint (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 +3360,39 @@ 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;
+child_has_forked (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)
@@ -3345,13 +3411,11 @@ child_has_forked (tid, childpid)
/* See child_has_forked for pid discussion.
*/
int
-child_has_vforked (tid, childpid)
- int tid;
- int * childpid;
+child_has_vforked (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 +3426,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)
@@ -3387,14 +3451,14 @@ child_has_vforked (tid, childpid)
#if defined(CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC)
int
-child_can_follow_vfork_prior_to_exec ()
+child_can_follow_vfork_prior_to_exec (void)
{
/* ttrace does allow this.
??rehrauer: However, I had major-league problems trying to
convince wait_for_inferior to handle that case. Perhaps when
it is rewritten to grok multiple processes in an explicit way...
- */
+ */
return 0;
}
#endif
@@ -3402,13 +3466,12 @@ child_can_follow_vfork_prior_to_exec ()
#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
int
-child_insert_exec_catchpoint (tid)
- int tid;
+child_insert_exec_catchpoint (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
@@ -3416,13 +3479,12 @@ child_insert_exec_catchpoint (tid)
#if defined(CHILD_REMOVE_EXEC_CATCHPOINT)
int
-child_remove_exec_catchpoint (tid)
- int tid;
+child_remove_exec_catchpoint (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
@@ -3430,13 +3492,11 @@ child_remove_exec_catchpoint (tid)
#if defined(CHILD_HAS_EXECD)
int
-child_has_execd (tid, execd_pathname)
- int tid;
- char ** execd_pathname;
+child_has_execd (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 +3507,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;
}
@@ -3476,14 +3536,11 @@ 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;
+child_has_syscall_event (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 +3550,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 +3577,13 @@ child_has_syscall_event (pid, kind, syscall_id)
return 1;
}
#endif
+
-
#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.
@@ -3534,22 +3591,22 @@ child_has_syscall_event (pid, kind, syscall_id)
* May need a FIXME for that reason.
*/
int
-child_thread_alive (gdb_tid)
- lwpid_t gdb_tid;
+child_thread_alive (ptid_t ptid)
{
- lwpid_t tid;
+ lwpid_t gdb_tid = PIDGET (ptid);
+ 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
+
-
/* 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 +3616,30 @@ 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;
+read_from_register_save_state (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;
}
-
+
/* 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 +3648,23 @@ 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;
+write_to_register_save_state (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;
}
-
+
/* 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,165 +3674,162 @@ 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;
+call_ptrace (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!
*/
void
-kill_inferior ()
+kill_inferior (void)
{
- 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)
+ if (PIDGET (inferior_ptid) == 0)
return;
/* Walk the list of "threads", some of which are "pseudo threads",
- aka "processes". For each that is NOT inferior_pid, stop it,
+ aka "processes". For each that is NOT inferior_ptid, stop it,
and detach it.
You see, we may not have just a single process to kill. If we're
@@ -3790,53 +3838,47 @@ kill_inferior ()
But we can't just call target_mourn_inferior() for each, since that
zaps the target vector.
- */
+ */
- paranoia = (thread_info **) malloc( thread_head.count *
- sizeof(thread_info *));
+ paranoia = (thread_info **) xmalloc (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;
- }
+ 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 != PIDGET (inferior_ptid)))
+ {
+ call_ttrace (TT_PROC_EXIT,
+ t->pid,
+ TT_NIL,
+ TT_NIL,
+ TT_NIL);
+ }
+ t = t->next;
}
- 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 );
-
- call_ttrace (TT_PROC_STOP,
- inferior_pid,
- TT_NIL,
- TT_NIL,
- TT_NIL);
+ xfree (paranoia);
+
+ call_ttrace (TT_PROC_EXIT,
+ PIDGET (inferior_ptid),
+ TT_NIL,
+ TT_NIL,
+ TT_NIL);
target_mourn_inferior ();
- clear_thread_info();
+ clear_thread_info ();
}
@@ -3845,398 +3887,416 @@ kill_inferior ()
/* Sanity check a thread about to be continued.
*/
static void
-thread_dropping_event_check( p )
- thread_info *p;
+thread_dropping_event_check (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 (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 ) {
+ /* 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 );
+ /* 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 */
+ /* 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 (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)
+ {
- 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 (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 ));
- }
- }
+ 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));
+ }
+ }
#ifdef THREAD_DEBUG
- if( debug_on )
- if( p->terminated )
- printf( "Why are we continuing a dead thread? (1)\n" );
+ if (debug_on)
+ if (p->terminated)
+ printf ("Why are we continuing a dead thread? (1)\n");
#endif
- p->seen = 1;
+ p->seen = 1;
- scan_tid = get_process_next_stopped_thread_id( real_pid, &state );
+ scan_tid = get_process_next_stopped_thread_id (real_pid, &state);
}
- /* Remove unseen threads from our list.
- */
- update_thread_list();
+ /* Remove unseen threads from our list.
+ */
+ update_thread_list ();
- /* Continue the threads.
- */
- for( p = thread_head.head; p; p = p->next ) {
+ /* Continue the threads.
+ */
+ for (p = thread_head.head; p; p = p->next)
+ {
- /* Sanity check.
- */
- thread_dropping_event_check( p );
+ /* 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 );
- }
+ /* 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 */
+} /* 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 (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 (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 == TARGET_SIGNAL_0)
+ {
+ /* 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 (!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 (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.
@@ -4254,7 +4314,7 @@ threads_continue_one_with_signal( gdb_tid, signal )
* -1 | Step current Continue all threads
* | thread and (but which gets any
* | continue others signal?--We look at
- * | "inferior_pid")
+ * | "inferior_ptid")
* |
* N | Step _this_ thread Continue _this_ thread
* | and leave others and leave others
@@ -4264,98 +4324,103 @@ threads_continue_one_with_signal( gdb_tid, signal )
* | user command.
*/
void
-child_resume( gdb_tid, step, signal )
- lwpid_t gdb_tid;
- int step;
- enum target_signal signal;
+child_resume (ptid_t ptid, 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;
+ lwpid_t gdb_tid = PIDGET (ptid);
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 (PIDGET (inferior_ptid));
+ }
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 +4429,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 +4502,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,120 +4547,126 @@ 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 */
-
+
#ifdef ATTACH_DETACH
/*
* Like it says.
*
- * One worry is that we may not be attaching to "inferior_pid"
+ * One worry is that we may not be attaching to "inferior_ptid"
* and thus may not want to clear out our data. FIXME?
*
*/
static void
-update_thread_state_after_attach( pid, kind_of_go )
- int pid;
- attach_continue_t kind_of_go;
+update_thread_state_after_attach (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.
*/
- if( process_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 +4677,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 +4685,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.
@@ -4623,81 +4704,85 @@ update_thread_state_after_attach( pid, kind_of_go )
*
* We don't need to do mapping here, as we know this
* is the first thread and thus gets the real pid
- * (and is "inferior_pid").
+ * (and is "inferior_ptid").
*
* 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 (pid_to_ptid (pid)); /* 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 +4797,46 @@ 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 */
-
+
#ifdef ATTACH_DETACH
/* Start debugging the process whose number is PID.
* (A _real_ pid).
*/
int
-attach( pid )
- int pid;
+attach (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 +4849,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;
}
@@ -4772,12 +4857,11 @@ attach( pid )
#if defined(CHILD_POST_ATTACH)
void
-child_post_attach (pid)
- int pid;
+child_post_attach (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,31 +4874,30 @@ child_post_attach (pid)
SIGNAL = 0 means just continue it.
*/
void
-detach( signal )
- int signal;
+detach (int signal)
{
errno = 0;
call_ttrace (TT_PROC_DETACH,
- inferior_pid,
- TT_NIL,
- (TTRACE_ARG_TYPE) signal,
- TT_NIL);
+ PIDGET (inferior_ptid),
+ TT_NIL,
+ (TTRACE_ARG_TYPE) signal,
+ TT_NIL);
attach_flag = 0;
- clear_thread_info();
+ clear_thread_info ();
/* Process-state? */
}
#endif /* ATTACH_DETACH */
-
+
/* Default the type of the ttrace transfer to int. */
#ifndef TTRACE_XFER_TYPE
#define TTRACE_XFER_TYPE int
#endif
void
-_initialize_kernel_u_addr ()
+_initialize_kernel_u_addr (void)
{
}
@@ -4827,29 +4910,29 @@ _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.
-
+ WRITE is nonzero. TARGET is ignored.
+
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
anyway. */
int
-child_xfer_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
+child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (TTRACE_XFER_TYPE);
+ register CORE_ADDR addr = memaddr & -(CORE_ADDR) 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. */
+ /* FIXME (alloca): This code, cloned from infptrace.c, is unsafe
+ because it uses alloca to allocate a buffer of arbitrary size.
+ For very large xfers, this could crash GDB's stack. */
register TTRACE_XFER_TYPE *buffer
= (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE));
@@ -4857,23 +4940,24 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
{
/* 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,
+ PIDGET (inferior_ptid),
+ (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);
+ PIDGET (inferior_ptid),
+ ((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 +4972,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);
+ PIDGET (inferior_ptid),
+ (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);
+ PIDGET (inferior_ptid),
+ (TTRACE_ARG_TYPE) addr,
+ (TTRACE_ARG_TYPE) buffer[i],
+ TT_NIL);
}
if (errno)
return 0;
@@ -4914,10 +4998,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);
+ PIDGET (inferior_ptid),
+ (TTRACE_ARG_TYPE) addr,
+ TT_NIL,
+ TT_NIL);
if (errno)
return 0;
QUIT;
@@ -4930,19 +5014,19 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
}
return len;
}
-
+
static void
-udot_info ()
+udot_info (void)
{
- 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 +5049,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);
+ PIDGET (inferior_ptid),
+ (TTRACE_ARG_TYPE) udot_off,
+ TT_NIL,
+ TT_NIL);
if (errno != 0)
{
sprintf (mess, "\nreading user struct at offset 0x%x", udot_off);
@@ -4983,95 +5067,62 @@ udot_info ()
}
#endif /* !defined (CHILD_XFER_MEMORY). */
+
/* TTrace version of "target_pid_to_exec_file"
*/
char *
-child_pid_to_exec_file (tid)
- int tid;
+child_pid_to_exec_file (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;
-
- /* As of 10.x HP-UX, there's an explicit request to get the
- *pathname.
- */
+ int tt_status;
+ static char exec_file_buffer[1024];
+ pid_t pid;
+ static struct pst_status buf;
+
+ /* On various versions of hpux11, this may fail due to a supposed
+ kernel bug. We have alternate methods to get this information
+ (ie pstat). */
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,
+ (uint64_t) exec_file_buffer,
+ sizeof (exec_file_buffer) - 1,
+ 0);
if (tt_status >= 0)
return exec_file_buffer;
- /* ??rehrauer: The above request may or may not be broken. It
- doesn't seem to work when I use it. But, it may be designed
- to only work immediately after an exec event occurs. (I'm
- waiting for COSL to explain.)
-
- 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;
+ /* Try to get process information via pstat and extract the filename
+ from the pst_cmd field within the pst_status structure. */
+ if (pstat_getproc (&buf, sizeof (struct pst_status), 0, tid) != -1)
+ {
+ char *p = buf.pst_cmd;
- /* 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 (*p && *p != ' ')
+ p++;
+ *p = 0;
- if (exec_file_buffer[0] == '\0')
- {
- inferior_pid = saved_inferior_pid;
- return NULL;
+ return (buf.pst_cmd);
}
- inferior_pid = saved_inferior_pid;
- return exec_file_buffer;
+ return (NULL);
}
-
void
-pre_fork_inferior ()
+pre_fork_inferior (void)
{
- 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,
@@ -5084,15 +5135,14 @@ pre_fork_inferior ()
* seems odd--it always fails in our test system.
*/
int
-hppa_require_attach (pid)
- int pid;
+hppa_require_attach (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 +5151,51 @@ 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;
+hppa_require_detach (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 +5204,30 @@ 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;
+get_dictionary_bucket_of_page (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 +5240,33 @@ 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;
+get_dictionary_entry_of_page (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);
+ require_memory_page_dictionary ();
/* 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. */
@@ -5246,9 +5291,7 @@ get_dictionary_entry_of_page (pid, page_start)
static void
-remove_dictionary_entry_of_page (pid, page)
- int pid;
- memory_page_t * page;
+remove_dictionary_entry_of_page (int pid, memory_page_t *page)
{
/* Restore the page's original permissions. */
unwrite_protect_page (pid, page->page_start, page->original_permissions);
@@ -5264,23 +5307,22 @@ remove_dictionary_entry_of_page (pid, page)
memory_page_dictionary.page_count--;
- free (page);
+ xfree (page);
}
static void
-hppa_enable_syscall_events (pid)
- int pid;
+hppa_enable_syscall_events (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,28 +5331,27 @@ 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");
}
static void
-hppa_disable_syscall_events (pid)
- int pid;
+hppa_disable_syscall_events (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 +5360,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 +5374,21 @@ 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;
+hppa_insert_hw_watchpoint (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 +5402,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 +5440,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 +5453,16 @@ 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;
+hppa_remove_hw_watchpoint (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 +5474,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 +5484,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 +5498,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 +5514,9 @@ 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;
+hppa_can_use_hw_watchpoint (enum bptype type, int cnt, enum bptype ot)
{
return (type == bp_hardware_watchpoint);
}
@@ -5495,24 +5526,21 @@ 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;
+hppa_range_profitable_for_hw_watchpoint (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 +5548,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 +5558,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,53 +5566,53 @@ 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;
+hppa_pid_or_tid_to_str (ptid_t ptid)
{
- static char buf[100]; /* Static because address returned. */
+ static char buf[100]; /* Static because address returned. */
+ pid_t id = PIDGET (ptid);
/* Does this appear to be a process? If so, print it that way. */
if (is_process_id (id))
- return hppa_pid_to_str (id);
+ return child_pid_to_str (ptid);
/* Else, print both the GDB thread number and the system thread id. */
- sprintf (buf, "thread %d (", pid_to_thread_id (id));
- strcat (buf, hppa_tid_to_str (id));
+ sprintf (buf, "thread %d (", pid_to_thread_id (ptid));
+ strcat (buf, hppa_tid_to_str (ptid));
strcat (buf, ")\0");
return buf;
}
-
+
/* 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 +5620,11 @@ 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 (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 +5635,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 +5645,34 @@ 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;
+hppa_ensure_vforking_parent_remains_stopped (int pid)
{
/* Nothing to do when using ttrace. Only the ptrace-based implementation
must do real work.
@@ -5651,24 +5681,74 @@ hppa_ensure_vforking_parent_remains_stopped (pid)
int
-hppa_resume_execd_vforking_child_to_get_parent_vfork ()
+hppa_resume_execd_vforking_child_to_get_parent_vfork (void)
{
- return 0; /* No, the parent vfork is available now. */
+ return 0; /* No, the parent vfork is available now. */
}
+
+/* Write a register as a 64bit value. This may be necessary if the
+ native OS is too braindamaged to allow some (or all) registers to
+ be written in 32bit hunks such as hpux11 and the PC queue registers.
+
+ This is horribly gross and disgusting. */
+
+int
+ttrace_write_reg_64 (int gdb_tid, CORE_ADDR dest_addr, CORE_ADDR src_addr)
+{
+ pid_t pid;
+ lwpid_t tid;
+ int tt_status;
+
+ tid = map_from_gdb_tid (gdb_tid);
+ pid = get_pid_for (tid);
+
+ errno = 0;
+ tt_status = ttrace (TT_LWP_WUREGS,
+ pid,
+ tid,
+ (TTRACE_ARG_TYPE) dest_addr,
+ 8,
+ (TTRACE_ARG_TYPE) src_addr );
+
+#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 (TT_LWP_WUREGS),
+ pid, tid, tt_status );
+ }
+ }
+#endif
+
+ return tt_status;
+}
-
void
-_initialize_infttrace ()
+_initialize_infttrace (void)
{
/* 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;
memory_page_dictionary.page_size = sysconf (_SC_PAGE_SIZE);
+ /* We do a lot of casts from pointers to TTRACE_ARG_TYPE; make sure
+ this is okay. */
+ if (sizeof (TTRACE_ARG_TYPE) < sizeof (void *))
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+
if (errno || (memory_page_dictionary.page_size <= 0))
perror_with_name ("sysconf");
}
-
diff --git a/contrib/gdb/gdb/jv-exp.y b/contrib/gdb/gdb/jv-exp.y
index d17c4f3..1b80ab4 100644
--- a/contrib/gdb/gdb/jv-exp.y
+++ b/contrib/gdb/gdb/jv-exp.y
@@ -1,5 +1,5 @@
/* YACC parser for Java expressions, for GDB.
- Copyright (C) 1997, 1998, 1999.
+ Copyright 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GDB.
@@ -99,21 +99,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define YYDEBUG 0 /* Default to no yydebug support */
#endif
-int
-yyparse PARAMS ((void));
+int yyparse (void);
-static int
-yylex PARAMS ((void));
+static int yylex (void);
-void
-yyerror PARAMS ((char *));
+void yyerror (char *);
-static struct type * java_type_from_name PARAMS ((struct stoken));
-static void push_expression_name PARAMS ((struct stoken));
-static void push_fieldnames PARAMS ((struct stoken));
+static struct type *java_type_from_name (struct stoken);
+static void push_expression_name (struct stoken);
+static void push_fieldnames (struct stoken);
-static struct expression *copy_exp PARAMS ((struct expression *, int));
-static void insert_exp PARAMS ((int, struct expression *));
+static struct expression *copy_exp (struct expression *, int);
+static void insert_exp (int, struct expression *);
%}
@@ -145,8 +142,7 @@ static void insert_exp PARAMS ((int, struct expression *));
%{
/* YYSTYPE gets defined by %union */
-static int
-parse_number PARAMS ((char *, int, int, YYSTYPE *));
+static int parse_number (char *, int, int, YYSTYPE *);
%}
%type <lval> rcurly Dims Dims_opt
@@ -768,13 +764,13 @@ parse_number (p, len, parsed_float, putithere)
}
c = p[len-1];
+ /* A paranoid calculation of (1<<64)-1. */
limit = (ULONGEST)0xffffffff;
+ limit = ((limit << 16) << 16) | limit;
if (c == 'l' || c == 'L')
{
type = java_long_type;
len--;
- /* A paranoid calculation of (1<<64)-1. */
- limit = ((limit << 16) << 16) | limit;
}
else
{
@@ -801,9 +797,18 @@ parse_number (p, len, parsed_float, putithere)
n += c;
}
- putithere->typed_val_int.val = n;
- putithere->typed_val_int.type = type;
- return INTEGER_LITERAL;
+ /* If the type is bigger than a 32-bit signed integer can be, implicitly
+ promote to long. Java does not do this, so mark it as builtin_type_uint64
+ rather than java_long_type. 0x80000000 will become -0x80000000 instead
+ of 0x80000000L, because we don't know the sign at this point.
+ */
+ if (type == java_int_type && n > (ULONGEST)0x80000000)
+ type = builtin_type_uint64;
+
+ putithere->typed_val_int.val = n;
+ putithere->typed_val_int.type = type;
+
+ return INTEGER_LITERAL;
}
struct token
@@ -899,7 +904,7 @@ yylex ()
error ("Empty character constant.");
yylval.typed_val_int.val = c;
- yylval.typed_val_int.type = builtin_type_char;
+ yylval.typed_val_int.type = java_char_type;
c = *lexptr++;
if (c != '\'')
diff --git a/contrib/gdb/gdb/jv-lang.c b/contrib/gdb/gdb/jv-lang.c
index a98147a..e221105 100644
--- a/contrib/gdb/gdb/jv-lang.c
+++ b/contrib/gdb/gdb/jv-lang.c
@@ -1,21 +1,22 @@
/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,10 +45,20 @@ struct type *java_float_type;
struct type *java_double_type;
struct type *java_void_type;
-static int java_demangled_signature_length PARAMS ((char*));
-static void java_demangled_signature_copy PARAMS ((char*, char*));
+/* Local functions */
-static void java_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+extern void _initialize_java_language (void);
+
+static int java_demangled_signature_length (char *);
+static void java_demangled_signature_copy (char *, char *);
+
+static struct symtab *get_java_class_symtab (void);
+static char *get_java_utf8_name (struct obstack *obstack, struct value *name);
+static int java_class_is_primitive (struct value *clas);
+static struct type *java_lookup_type (char *signature);
+static struct value *java_value_string (char *ptr, int len);
+
+static void java_emit_char (int c, struct ui_file * stream, int quoter);
/* This objfile contains symtabs that have been dynamically created
to record dynamically loaded Java classes and dynamically
@@ -55,14 +66,14 @@ static void java_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
static struct objfile *dynamics_objfile = NULL;
-static struct type *java_link_class_type PARAMS ((struct type *, value_ptr));
+static struct type *java_link_class_type (struct type *, struct value *);
static struct objfile *
-get_dynamics_objfile ()
+get_dynamics_objfile (void)
{
if (dynamics_objfile == NULL)
{
- dynamics_objfile = allocate_objfile (NULL, 0, 0, 0);
+ dynamics_objfile = allocate_objfile (NULL, 0);
}
return dynamics_objfile;
}
@@ -76,12 +87,12 @@ static struct symtab *class_symtab = NULL;
static int class_symtab_space;
-struct symtab *
-get_java_class_symtab ()
+static struct symtab *
+get_java_class_symtab (void)
{
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);
@@ -104,10 +115,9 @@ get_java_class_symtab ()
/* Allocate GLOBAL_BLOCK. This has to be relocatable. */
class_symtab_space = 128;
- bl = (struct block *)
- mmalloc (objfile->md,
- sizeof (struct block)
- + ((class_symtab_space - 1) * sizeof (struct symbol *)));
+ bl = xmmalloc (objfile->md,
+ sizeof (struct block)
+ + ((class_symtab_space - 1) * sizeof (struct symbol *)));
*bl = *BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = bl;
class_symtab->free_ptr = (char *) bl;
@@ -116,8 +126,7 @@ get_java_class_symtab ()
}
static void
-add_class_symtab_symbol (sym)
- struct symbol *sym;
+add_class_symtab_symbol (struct symbol *sym)
{
struct symtab *symtab = get_java_class_symtab ();
struct blockvector *bv = BLOCKVECTOR (symtab);
@@ -126,24 +135,21 @@ add_class_symtab_symbol (sym)
{
/* Need to re-allocate. */
class_symtab_space *= 2;
- bl = (struct block *)
- mrealloc (symtab->objfile->md, bl,
- sizeof (struct block)
- + ((class_symtab_space - 1) * sizeof (struct symbol *)));
+ bl = xmrealloc (symtab->objfile->md, bl,
+ sizeof (struct block)
+ + ((class_symtab_space - 1) * sizeof (struct symbol *)));
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 (struct type *type, CORE_ADDR addr);
static struct symbol *
-add_class_symbol (type, addr)
- struct type *type;
- CORE_ADDR addr;
+add_class_symbol (struct type *type, CORE_ADDR addr)
{
struct symbol *sym;
sym = (struct symbol *)
@@ -152,7 +158,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;
@@ -161,8 +167,7 @@ add_class_symbol (type, addr)
#endif
struct type *
-java_lookup_class (name)
- char *name;
+java_lookup_class (char *name)
{
struct symbol *sym;
sym = lookup_symbol (name, expression_context_block, STRUCT_NAMESPACE,
@@ -174,7 +179,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;
}
@@ -184,7 +190,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;
@@ -198,62 +204,57 @@ java_lookup_class (name)
a name given by NAME (which has type Utf8Const*). */
char *
-get_java_utf8_name (obstack, name)
- struct obstack *obstack;
- value_ptr name;
+get_java_utf8_name (struct obstack *obstack, struct value *name)
{
char *chrs;
- value_ptr temp = name;
+ struct value *temp = name;
int name_length;
CORE_ADDR data_addr;
temp = value_struct_elt (&temp, NULL, "length", NULL, "structure");
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';
- read_memory_section (data_addr, chrs, name_length, NULL);
+ chrs = obstack_alloc (obstack, name_length + 1);
+ chrs[name_length] = '\0';
+ read_memory (data_addr, chrs, name_length);
return chrs;
}
-value_ptr
-java_class_from_object (obj_val)
- value_ptr obj_val;
+struct value *
+java_class_from_object (struct value *obj_val)
{
/* This is all rather inefficient, since the offsets of vtable and
class are fixed. FIXME */
- value_ptr vtable_val;
+ struct value *vtable_val;
if (TYPE_CODE (VALUE_TYPE (obj_val)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (obj_val))) == 0)
obj_val = value_at (get_java_object_type (),
- value_as_pointer (obj_val), NULL);
+ value_as_address (obj_val), NULL);
vtable_val = value_struct_elt (&obj_val, NULL, "vtable", NULL, "structure");
return value_struct_elt (&vtable_val, NULL, "class", NULL, "structure");
}
/* Check if CLASS_IS_PRIMITIVE(value of clas): */
-int
-java_class_is_primitive (clas)
- value_ptr clas;
+static int
+java_class_is_primitive (struct value *clas)
{
- value_ptr vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct");
- CORE_ADDR i = value_as_pointer (vtable);
+ struct value *vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct");
+ CORE_ADDR i = value_as_address (vtable);
return (int) (i & 0x7fffffff) == (int) 0x7fffffff;
}
/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */
struct type *
-type_from_class (clas)
- value_ptr clas;
+type_from_class (struct value *clas)
{
struct type *type;
char *name;
- value_ptr temp;
+ struct value *temp;
struct objfile *objfile;
- value_ptr utf8_name;
+ struct value *utf8_name;
char *nptr;
CORE_ADDR addr;
struct block *bl;
@@ -272,7 +273,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)
@@ -280,10 +281,10 @@ type_from_class (clas)
}
#endif
- objfile = get_dynamics_objfile();
+ objfile = get_dynamics_objfile ();
if (java_class_is_primitive (clas))
{
- value_ptr sig;
+ struct value *sig;
temp = clas;
sig = value_struct_elt (&temp, NULL, "method_count", NULL, "structure");
return java_primitive_type (value_as_long (sig));
@@ -294,7 +295,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 = '.';
@@ -313,7 +314,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;
@@ -331,23 +332,24 @@ 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)
- struct type *type;
- value_ptr clas;
+java_link_class_type (struct type *type, struct value *clas)
{
- value_ptr temp;
+ struct value *temp;
char *unqualified_name;
char *name = TYPE_TAG_NAME (type);
int ninterfaces, nfields, nmethods;
int type_is_object = 0;
struct fn_field *fn_fields;
struct fn_fieldlist *fn_fieldlists;
- value_ptr fields, field, method, methods;
+ struct value *fields;
+ struct value *methods;
+ struct value *method = NULL;
+ struct value *field = NULL;
int i, j;
- struct objfile *objfile = get_dynamics_objfile();
+ struct objfile *objfile = get_dynamics_objfile ();
struct type *tsuper;
unqualified_name = strrchr (name, '.');
@@ -376,7 +378,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);
@@ -407,10 +409,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
{
@@ -420,14 +422,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;
@@ -438,7 +440,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;
}
@@ -452,26 +454,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
{
@@ -490,14 +492,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;
@@ -508,7 +510,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;
}
@@ -526,11 +528,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];
@@ -538,16 +540,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;
}
@@ -555,22 +558,22 @@ 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;
}
static struct type *java_object_type;
struct type *
-get_java_object_type ()
+get_java_object_type (void)
{
if (java_object_type == NULL)
{
@@ -585,7 +588,7 @@ get_java_object_type ()
}
int
-get_java_object_header_size ()
+get_java_object_header_size (void)
{
struct type *objtype = get_java_object_type ();
if (objtype == NULL)
@@ -595,8 +598,7 @@ get_java_object_header_size ()
}
int
-is_object_type (type)
- struct type *type;
+is_object_type (struct type *type)
{
CHECK_TYPEDEF (type);
if (TYPE_CODE (type) == TYPE_CODE_PTR)
@@ -610,7 +612,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)
@@ -622,20 +624,28 @@ is_object_type (type)
}
struct type *
-java_primitive_type (signature)
- int signature;
+java_primitive_type (int 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);
}
@@ -644,9 +654,7 @@ java_primitive_type (signature)
return that type. Otherwise, return NULL. */
struct type *
-java_primitive_type_from_name (name, namelen)
- char* name;
- int namelen;
+java_primitive_type_from_name (char *name, int namelen)
{
switch (name[0])
{
@@ -691,12 +699,11 @@ java_primitive_type_from_name (name, namelen)
signature string SIGNATURE. */
static int
-java_demangled_signature_length (signature)
- char *signature;
+java_demangled_signature_length (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':
@@ -710,9 +717,7 @@ java_demangled_signature_length (signature)
/* Demangle the Java type signature SIGNATURE, leaving the result in RESULT. */
static void
-java_demangled_signature_copy (result, signature)
- char *result;
- char *signature;
+java_demangled_signature_copy (char *result, char *signature)
{
int array = 0;
char *ptr;
@@ -728,7 +733,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++ = '.';
@@ -754,8 +759,7 @@ java_demangled_signature_copy (result, signature)
as a freshly allocated copy. */
char *
-java_demangle_type_signature (signature)
- char *signature;
+java_demangle_type_signature (char *signature)
{
int length = java_demangled_signature_length (signature);
char *result = xmalloc (length + 1);
@@ -765,8 +769,7 @@ java_demangle_type_signature (signature)
}
struct type *
-java_lookup_type (signature)
- char *signature;
+java_lookup_type (char *signature)
{
switch (signature[0])
{
@@ -782,9 +785,7 @@ java_lookup_type (signature)
If DIMS == 0, TYPE is returned. */
struct type *
-java_array_type (type, dims)
- struct type *type;
- int dims;
+java_array_type (struct type *type, int dims)
{
struct type *range_type;
@@ -800,12 +801,10 @@ java_array_type (type, dims)
/* Create a Java string in the inferior from a (Utf8) literal. */
-value_ptr
-java_value_string (ptr, len)
- char *ptr;
- int len;
+static struct value *
+java_value_string (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
@@ -813,10 +812,7 @@ java_value_string (ptr, len)
characters and strings is language specific. */
static void
-java_emit_char (c, stream, quoter)
- int c;
- GDB_FILE *stream;
- int quoter;
+java_emit_char (int c, struct ui_file *stream, int quoter)
{
switch (c)
{
@@ -848,18 +844,16 @@ java_emit_char (c, stream, quoter)
}
}
-static value_ptr
-evaluate_subexp_java (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+static struct value *
+evaluate_subexp_java (struct type *expect_type, register struct expression *exp,
+ register int *pos, enum noside noside)
{
int pc = *pos;
int i;
char *name;
enum exp_opcode op = exp->elts[*pos].opcode;
- value_ptr arg1, arg2;
+ struct value *arg1;
+ struct value *arg2;
struct type *type;
switch (op)
{
@@ -886,9 +880,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)
@@ -898,18 +892,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 temp = clas;
+ struct value *clas = java_class_from_object (arg1);
+ struct value *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)
@@ -917,7 +911,7 @@ evaluate_subexp_java (expect_type, exp, pos, noside)
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (el_type, VALUE_LVAL (arg1));
- address = value_as_pointer (arg1);
+ address = value_as_address (arg1);
address += JAVA_OBJECT_SIZE;
read_memory (address, buf4, 4);
length = (long) extract_signed_integer (buf4, 4);
@@ -959,26 +953,37 @@ 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);
}
static struct type *
-java_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+java_create_fundamental_type (struct objfile *objfile, int 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);
}
@@ -987,48 +992,50 @@ 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,
type_check_off,
+ case_sensitive_on,
java_parse,
java_error,
evaluate_subexp_java,
@@ -1039,30 +1046,30 @@ 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
};
void
-_initialize_java_language ()
+_initialize_java_language (void)
{
- 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);
}
@@ -1071,11 +1078,13 @@ _initialize_java_language ()
We should use make_run_cleanup to have this be called.
But will that mess up values in value histry? FIXME */
-void java_rerun_cleanup ()
+extern void java_rerun_cleanup (void);
+void
+java_rerun_cleanup (void)
{
if (class_symtab != NULL)
{
- free_symtab (class_symtab); /* ??? */
+ free_symtab (class_symtab); /* ??? */
class_symtab = NULL;
}
if (dynamics_objfile != NULL)
diff --git a/contrib/gdb/gdb/jv-lang.h b/contrib/gdb/gdb/jv-lang.h
index 44c4437..61fb943 100644
--- a/contrib/gdb/gdb/jv-lang.h
+++ b/contrib/gdb/gdb/jv-lang.h
@@ -1,27 +1,31 @@
/* Java language support definitions for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 */
+#ifndef JV_LANG_H
+#define JV_LANG_H
-extern void
-java_error PARAMS ((char *)); /* Defined in jv-exp.y */
+struct value;
+
+extern int java_parse (void); /* Defined in jv-exp.y */
+
+extern void java_error (char *); /* Defined in jv-exp.y */
/* sizeof (struct Object) */
#define JAVA_OBJECT_SIZE (get_java_object_header_size ())
@@ -36,32 +40,34 @@ extern struct type *java_float_type;
extern struct type *java_double_type;
extern struct type *java_void_type;
-extern int
-java_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int java_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
+
+extern int java_value_print (struct value *, struct ui_file *, int,
+ enum val_prettyprint);
-extern int
-java_value_print PARAMS ((struct value *, GDB_FILE *, int,
- enum val_prettyprint));
+extern struct value *java_class_from_object (struct value *);
-extern value_ptr java_class_from_object PARAMS ((value_ptr));
+extern struct type *type_from_class (struct value *);
-extern struct type *type_from_class PARAMS ((struct value *));
+extern struct type *java_primitive_type (int signature);
-extern struct type *java_primitive_type PARAMS ((int signature));
+extern struct type *java_primitive_type_from_name (char *, int);
-extern struct type *java_primitive_type_from_name PARAMS ((char*, int));
+extern struct type *java_array_type (struct type *, int);
-extern struct type *java_array_type PARAMS ((struct type *, int));
+extern struct type *get_java_object_type (void);
+extern int get_java_object_header_size (void);
-extern struct type *get_java_object_type PARAMS ((void));
-extern int get_java_object_header_size PARAMS ((void));
+extern struct type *java_lookup_class (char *);
-extern struct type *java_lookup_class PARAMS((char *));
+extern int is_object_type (struct type *);
-extern int is_object_type PARAMS ((struct type*));
+/* Defined in jv-typeprint.c */
+extern void java_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern void /* Defined in jv-typeprint.c */
-java_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+extern char *java_demangle_type_signature (char *);
-extern char *java_demangle_type_signature PARAMS ((char *));
+#endif
diff --git a/contrib/gdb/gdb/jv-typeprint.c b/contrib/gdb/gdb/jv-typeprint.c
index 59539a0..893082c 100644
--- a/contrib/gdb/gdb/jv-typeprint.c
+++ b/contrib/gdb/gdb/jv-typeprint.c
@@ -1,21 +1,22 @@
/* Support for printing Java types for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,11 +27,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "jv-lang.h"
#include "gdb_string.h"
#include "typeprint.h"
+#include "c-lang.h"
+#include "cp-abi.h"
+
+/* Local functions */
+
+static void java_type_print_base (struct type * type,
+ struct ui_file *stream, int show,
+ int level);
static void
-java_type_print_derivation_info (stream, type)
- GDB_FILE *stream;
- struct type *type;
+java_type_print_derivation_info (struct ui_file *stream, struct type *type)
{
char *name;
int i;
@@ -43,7 +50,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 "
@@ -75,12 +82,9 @@ java_type_print_derivation_info (stream, type)
LEVEL is the number of spaces to indent by.
We increase it for some recursive calls. */
-void
-java_type_print_base (type, stream, show, level)
- struct type *type;
- GDB_FILE *stream;
- int show;
- int level;
+static void
+java_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
{
register int i;
register int len;
@@ -119,7 +123,7 @@ java_type_print_base (type, stream, show, level)
{ /* array type */
char *name = java_demangle_type_signature (TYPE_TAG_NAME (type));
fputs_filtered (name, stream);
- free (name);
+ xfree (name);
break;
}
@@ -144,13 +148,15 @@ 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))
- 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");
+ {
+ if (TYPE_STUB (type))
+ fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
+ else
+ fprintfi_filtered (level + 4, stream, "<no data fields>\n");
+ }
/* If there is a base class for this type,
do not print the field that it occupies. */
@@ -171,12 +177,14 @@ java_type_print_base (type, stream, show, level)
print_spaces_filtered (level + 4, stream);
if (HAVE_CPLUS_STRUCT (type))
- if (TYPE_FIELD_PROTECTED (type, i))
- fprintf_filtered (stream, "protected ");
- else if (TYPE_FIELD_PRIVATE (type, i))
- fprintf_filtered (stream, "private ");
- else
- fprintf_filtered (stream, "public ");
+ {
+ if (TYPE_FIELD_PROTECTED (type, i))
+ fprintf_filtered (stream, "protected ");
+ else if (TYPE_FIELD_PRIVATE (type, i))
+ fprintf_filtered (stream, "private ");
+ else
+ fprintf_filtered (stream, "public ");
+ }
if (TYPE_FIELD_STATIC (type, i))
fprintf_filtered (stream, "static ");
@@ -191,7 +199,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 */
@@ -217,12 +225,9 @@ java_type_print_base (type, stream, show, level)
physname = TYPE_FN_FIELD_PHYSNAME (f, j);
- is_full_physname_constructor =
- ((physname[0] == '_' && physname[1] == '_'
- && strchr ("0123456789Qt", physname[2]))
- || STREQN (physname, "__ct__", 6)
- || DESTRUCTOR_PREFIX_P (physname)
- || STREQN (physname, "__dt__", 6));
+ is_full_physname_constructor
+ = (is_constructor_name (physname)
+ || is_destructor_name (physname));
QUIT;
@@ -250,7 +255,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)
@@ -271,7 +276,7 @@ java_type_print_base (type, stream, show, level)
DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
if (demangled_name == NULL)
- demangled_name = strdup (mangled_name);
+ demangled_name = xstrdup (mangled_name);
{
char *demangled_no_class;
@@ -292,11 +297,11 @@ java_type_print_base (type, stream, show, level)
}
fputs_filtered (demangled_no_class, stream);
- free (demangled_name);
+ xfree (demangled_name);
}
if (TYPE_FN_FIELD_STUB (f, j))
- free (mangled_name);
+ xfree (mangled_name);
fprintf_filtered (stream, ";\n");
}
@@ -306,20 +311,19 @@ 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);
}
}
/* LEVEL is the depth to indent lines by. */
+extern void c_type_print_varspec_suffix (struct type *, struct ui_file *,
+ int, int, int);
+
void
-java_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+java_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
int demangled_args;
@@ -334,6 +338,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);
}
diff --git a/contrib/gdb/gdb/jv-valprint.c b/contrib/gdb/gdb/jv-valprint.c
index 6bfae7e..73fff27 100644
--- a/contrib/gdb/gdb/jv-valprint.c
+++ b/contrib/gdb/gdb/jv-valprint.c
@@ -1,25 +1,27 @@
/* Support for printing Java values for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
+#include "gdbcore.h"
#include "expression.h"
#include "value.h"
#include "demangle.h"
@@ -27,13 +29,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "language.h"
#include "jv-lang.h"
#include "c-lang.h"
+#include "annotate.h"
+
+/* Local functions */
+
+static void java_print_value_fields (struct type * type, char *valaddr,
+ CORE_ADDR address,
+ struct ui_file *stream, int format,
+ int recurse,
+ enum val_prettyprint pretty);
+
int
-java_value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+java_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
struct type *type;
CORE_ADDR address;
@@ -60,17 +69,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;
@@ -81,14 +90,16 @@ java_value_print (val, stream, format, pretty)
if (el_type == NULL)
{
- CORE_ADDR element, next_element;
+ CORE_ADDR element;
+ CORE_ADDR next_element = -1; /* dummy initial value */
- 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)
{
- char buf[TARGET_PTR_BIT / HOST_CHAR_BIT];
+ char *buf;
+ buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
fputs_filtered (", ", stream);
wrap_here (n_spaces (2));
@@ -96,16 +107,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;
}
@@ -118,7 +129,7 @@ java_value_print (val, stream, format, pretty)
if (element == 0)
fprintf_filtered (stream, "null");
else
- fprintf_filtered (stream, "@%x", element);
+ fprintf_filtered (stream, "@%s", paddr_nz (element));
things_printed++;
i += reps;
@@ -126,8 +137,8 @@ java_value_print (val, stream, format, pretty)
}
else
{
- value_ptr v = allocate_value (el_type);
- value_ptr next_v = allocate_value (el_type);
+ struct value *v = allocate_value (el_type);
+ struct value *next_v = allocate_value (el_type);
VALUE_ADDRESS (v) = address + JAVA_OBJECT_SIZE + 4;
VALUE_ADDRESS (next_v) = VALUE_ADDRESS (v);
@@ -139,7 +150,7 @@ java_value_print (val, stream, format, pretty)
if (i > 0)
{
- value_ptr tmp;
+ struct value *tmp;
tmp = next_v;
next_v = v;
@@ -153,7 +164,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);
@@ -190,28 +201,29 @@ java_value_print (val, stream, format, pretty)
&& TYPE_NAME (TYPE_TARGET_TYPE (type))
&& strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
&& (format == 0 || format == 's')
- && address != 0)
+ && address != 0
+ && value_as_address (val) != 0)
{
- value_ptr data_val;
+ struct value *data_val;
CORE_ADDR data;
- value_ptr boffset_val;
+ struct value *boffset_val;
unsigned long boffset;
- value_ptr count_val;
+ struct value *count_val;
unsigned long count;
- value_ptr mark;
+ struct value *mark;
mark = value_mark (); /* Remember start of new values */
data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
- data = value_as_pointer (data_val);
+ data = value_as_address (data_val);
boffset_val = value_struct_elt (&val, NULL, "boffset", NULL, NULL);
- boffset = value_as_pointer (boffset_val);
+ boffset = value_as_address (boffset_val);
count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
- count = value_as_pointer (count_val);
+ count = value_as_address (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);
@@ -228,16 +240,10 @@ java_value_print (val, stream, format, pretty)
DONT_PRINT is an array of baseclass types that we
should not print, or zero if called from top level. */
-void
-java_print_value_fields (type, valaddr, address, stream,
- format, recurse, pretty)
- 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 (struct type *type, char *valaddr, CORE_ADDR address,
+ struct ui_file *stream, int format, int recurse,
+ enum val_prettyprint pretty)
{
int i, len, n_baseclasses;
@@ -257,7 +263,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;
@@ -269,7 +275,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
@@ -280,9 +286,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:
;
}
@@ -327,7 +333,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));
}
@@ -364,32 +370,32 @@ java_print_value_fields (type, valaddr, address, stream,
if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
{
- value_ptr v;
+ struct value *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))
{
- value_ptr v = value_static_field (type, i);
+ struct value *v = value_static_field (type, i);
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
@@ -399,15 +405,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 ();
@@ -436,18 +444,11 @@ java_print_value_fields (type, valaddr, address, stream,
The PRETTY parameter controls prettyprinting. */
int
-java_val_print (type, valaddr, embedded_offset, address, stream, format,
- deref_ref, recurse, pretty)
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+java_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
- 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;
@@ -461,13 +462,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
diff --git a/contrib/gdb/gdb/kod-cisco.c b/contrib/gdb/gdb/kod-cisco.c
new file mode 100644
index 0000000..de2b450
--- /dev/null
+++ b/contrib/gdb/gdb/kod-cisco.c
@@ -0,0 +1,317 @@
+/* Kernel Object Display facility for Cisco
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ Written by Tom Tromey <tromey@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. */
+
+#include "defs.h"
+#include "gdb_string.h"
+#include "kod.h"
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+/* Define this to turn off communication with target. */
+/* #define FAKE_PACKET */
+
+/* Size of buffer used for remote communication. */
+#define PBUFSIZ 400
+
+/* Pointers to gdb callbacks. */
+static void (*gdb_kod_display) (char *);
+static void (*gdb_kod_query) (char *, char *, int *);
+
+
+
+/* Initialize and return library name and version.
+ The gdb side of KOD, kod.c, passes us two functions: one for
+ displaying output (presumably to the user) and the other for
+ querying the target. */
+char *
+cisco_kod_open (kod_display_callback_ftype *display_func,
+ kod_query_callback_ftype *query_func)
+{
+ char buffer[PBUFSIZ];
+ int bufsiz = PBUFSIZ;
+ int i, count;
+
+ gdb_kod_display = display_func;
+ gdb_kod_query = query_func;
+
+ /* Get the OS info, and check the version field. This is the stub
+ version, which we use to see whether we will understand what
+ comes back. This is lame, but the `qKoL' request doesn't
+ actually provide enough configurability.
+
+ Right now the only defined version number is `0.0.0'.
+ This stub supports qKoI and the `a' (any) object requests qKaL
+ and qKaI. Each `a' object is returned as a 4-byte integer ID.
+ An info request on an object returns a pair of 4-byte integers;
+ the first is the object pointer and the second is the thread ID. */
+
+#ifndef FAKE_PACKET
+ (*gdb_kod_query) ("oI;", buffer, &bufsiz);
+#else
+ strcpy (buffer, "Cisco IOS/Classic/13.4 0.0.0");
+#endif
+
+ count = 2;
+ for (i = 0; count && buffer[i] != '\0'; ++i)
+ {
+ if (buffer[i] == ' ')
+ --count;
+ }
+
+ if (buffer[i] == '\0')
+ error ("Remote returned malformed packet\n");
+ if (strcmp (&buffer[i], "0.0.0"))
+ error ("Remote returned unknown stub version: %s\n", &buffer[i]);
+
+ /* Return name, version, and description. I hope we have enough
+ space. */
+ return (xstrdup ("gdbkodcisco v0.0.0 - Cisco Kernel Object Display"));
+}
+
+/* Close the connection. */
+void
+cisco_kod_close (void)
+{
+}
+
+/* Print a "bad packet" message. */
+static void
+bad_packet (void)
+{
+ (*gdb_kod_display) ("Remote target returned malformed packet.\n");
+}
+
+/* Print information about currently known kernel objects.
+ We currently ignore the argument. There is only one mode of
+ querying the Cisco kernel: we ask for a dump of everything, and
+ it returns it. */
+void
+cisco_kod_request (char *arg, int from_tty)
+{
+ char buffer[PBUFSIZ], command[PBUFSIZ];
+ int done = 0, i;
+ int fail = 0;
+
+ char **sync_ids = NULL;
+ int sync_len = 0;
+ int sync_next = 0;
+ char *prev_id = NULL;
+
+ if (! arg || strcmp (arg, "any"))
+ {
+ /* "Top-level" command. This is really silly, but it also seems
+ to be how KOD is defined. */
+ /* Even sillier is the fact that this first line must start
+ with the word "List". See kod.tcl. */
+ (*gdb_kod_display) ("List of Cisco Kernel Objects\n");
+ (*gdb_kod_display) ("Object\tDescription\n");
+ (*gdb_kod_display) ("any\tAny and all objects\n");
+ return;
+ }
+
+ while (! done)
+ {
+ int off = 0; /* Where we are in the string. */
+ long count; /* Number of objects in this packet. */
+ int bufsiz = PBUFSIZ;
+ char *s_end;
+
+ strcpy (command, "aL");
+ if (prev_id)
+ {
+ strcat (command, ",");
+ strcat (command, prev_id);
+ }
+ strcat (command, ";");
+
+#ifndef FAKE_PACKET
+ /* We talk to the target by calling through the query function
+ passed to us when we were initialized. */
+ (*gdb_kod_query) (command, buffer, &bufsiz);
+#else
+ /* Fake up a multi-part packet. */
+ if (! strncmp (&command[3], "a500005a", 8))
+ strcpy (buffer, "KAL,01,1,f500005f;f500005f;");
+ else
+ strcpy (buffer, "KAL,02,0,a500005a;a500005a;de02869f;");
+#endif
+
+ /* Empty response is an error. */
+ if (strlen (buffer) == 0)
+ {
+ (*gdb_kod_display) ("Remote target did not recognize kernel object query command.\n");
+ fail = 1;
+ break;
+ }
+
+ /* If we don't get a `K' response then the buffer holds the
+ target's error message. */
+ if (buffer[0] != 'K')
+ {
+ (*gdb_kod_display) (buffer);
+ fail = 1;
+ break;
+ }
+
+ /* Make sure we get the response we expect. */
+ if (strncmp (buffer, "KAL,", 4))
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ off += 4;
+
+ /* Parse out the count. We expect to convert exactly two
+ characters followed by a comma. */
+ count = strtol (&buffer[off], &s_end, 16);
+ if (s_end - &buffer[off] != 2 || buffer[off + 2] != ',')
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ off += 3;
+
+ /* Parse out the `done' flag. */
+ if ((buffer[off] != '0' && buffer[off] != '1')
+ || buffer[off + 1] != ',')
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ done = buffer[off] == '1';
+ off += 2;
+
+ /* Id of the last item; we might this to construct the next
+ request. */
+ prev_id = &buffer[off];
+ if (strlen (prev_id) < 8 || buffer[off + 8] != ';')
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ buffer[off + 8] = '\0';
+ off += 9;
+
+ sync_len += count;
+ sync_ids = (char **) xrealloc (sync_ids, sync_len * sizeof (char *));
+
+ for (i = 0; i < count; ++i)
+ {
+ if (strlen (&buffer[off]) < 8 || buffer[off + 8] != ';')
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ buffer[off + 8] = '\0';
+ sync_ids[sync_next++] = xstrdup (&buffer[off]);
+ off += 9;
+ }
+
+ if (buffer[off] != '\0')
+ {
+ bad_packet ();
+ fail = 1;
+ break;
+ }
+ }
+
+ /* We've collected all the sync object IDs. Now query to get the
+ specific information, and arrange to print this info. */
+ if (! fail)
+ {
+ (*gdb_kod_display) ("Object ID\tObject Pointer\tThread ID\n");
+
+ for (i = 0; i < sync_next; ++i)
+ {
+ int off = 0;
+ int bufsiz = PBUFSIZ;
+
+ /* For now assume a query can be accomplished in a single
+ transaction. This is implied in the protocol document.
+ See comments above, and the KOD protocol document, to
+ understand the parsing of the return value. */
+ strcpy (command, "aI,");
+ strcat (command, sync_ids[i]);
+ strcat (command, ";");
+
+#ifndef FAKE_PACKET
+ (*gdb_kod_query) (command, buffer, &bufsiz);
+#else
+ strcpy (buffer, "KAI,");
+ strcat (buffer, sync_ids[i]);
+ strcat (buffer, ",ffef00a0,cd00123d;");
+#endif
+
+ if (strlen (buffer) == 0)
+ {
+ (*gdb_kod_display) ("Remote target did not recognize KOD command.\n");
+ break;
+ }
+
+ if (strncmp (buffer, "KAI,", 4))
+ {
+ bad_packet ();
+ break;
+ }
+ off += 4;
+
+ if (strncmp (&buffer[off], sync_ids[i], 8)
+ || buffer[off + 8] != ',')
+ {
+ bad_packet ();
+ break;
+ }
+ off += 9;
+
+ /* Extract thread id and sync object pointer. */
+ if (strlen (&buffer[off]) != 2 * 8 + 2
+ || buffer[off + 8] != ','
+ || buffer[off + 17] != ';')
+ {
+ bad_packet ();
+ break;
+ }
+
+ buffer[off + 8] = '\0';
+ buffer[off + 17] = '\0';
+
+ /* Display the result. */
+ (*gdb_kod_display) (sync_ids[i]);
+ (*gdb_kod_display) ("\t");
+ (*gdb_kod_display) (&buffer[off]);
+ (*gdb_kod_display) ("\t");
+ (*gdb_kod_display) (&buffer[off + 9]);
+ (*gdb_kod_display) ("\n");
+ }
+ }
+
+ /* Free memory. */
+ for (i = 0; i < sync_next; ++i)
+ xfree (sync_ids[i]);
+ xfree (sync_ids);
+}
diff --git a/contrib/gdb/gdb/kod.c b/contrib/gdb/gdb/kod.c
new file mode 100644
index 0000000..2641c38
--- /dev/null
+++ b/contrib/gdb/gdb/kod.c
@@ -0,0 +1,229 @@
+/* Kernel Object Display generic routines and callbacks
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ Written by Fernando Nasser <fnasser@cygnus.com> for Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "command.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "gdb_string.h"
+#include "kod.h"
+
+/* Prototypes for exported functions. */
+void _initialize_kod (void);
+
+/* Prototypes for local functions. */
+static void info_kod_command (char *, int);
+static void load_kod_library (char *);
+
+/* Prototypes for callbacks. These are passed into the KOD modules. */
+static void gdb_kod_display (char *);
+static void gdb_kod_query (char *, char *, int *);
+
+/* These functions are imported from the KOD module.
+
+ gdb_kod_open - initiates the KOD connection to the remote. The
+ first argument is the display function the module should use to
+ communicate with the user. The second argument is the query
+ function the display should use to communicate with the target.
+ This should call error() if there is an error. Otherwise it should
+ return a malloc()d string of the form:
+
+ NAME VERSION - DESCRIPTION
+
+ Neither NAME nor VERSION should contain a hyphen.
+
+
+ gdb_kod_request - This is used when the user enters an "info
+ <module>" request. The remaining arguments are passed as the first
+ argument. The second argument is the standard `from_tty'
+ argument.
+
+
+ gdb_kod_close - This is called when the KOD connection to the
+ remote should be terminated. */
+
+static char *(*gdb_kod_open) (kod_display_callback_ftype *display,
+ kod_query_callback_ftype *query);
+static void (*gdb_kod_request) (char *, int);
+static void (*gdb_kod_close) ();
+
+
+/* Name of inferior's operating system. */
+char *operating_system;
+
+/* We save a copy of the OS so that we can properly reset when
+ switching OS's. */
+static char *old_operating_system;
+
+/* Print a line of data generated by the module. */
+
+static void
+gdb_kod_display (char *arg)
+{
+ printf_filtered ("%s", arg);
+}
+
+/* Queries the target on behalf of the module. */
+
+static void
+gdb_kod_query (char *arg, char *result, int *maxsiz)
+{
+ int bufsiz = 0;
+
+ /* Check if current target has remote_query capabilities.
+ If not, it does not have kod either. */
+ if (! current_target.to_query)
+ {
+ strcpy (result,
+ "ERR: Kernel Object Display not supported by current target\n");
+ return;
+ }
+
+ /* Just get the maximum buffer size. */
+ target_query ((int) 'K', 0, 0, &bufsiz);
+
+ /* Check if *we* were called just for getting the buffer size. */
+ if (*maxsiz == 0)
+ {
+ *maxsiz = bufsiz;
+ strcpy (result, "OK");
+ return;
+ }
+
+ /* Check if caller can handle a buffer this large, if not, adjust. */
+ if (bufsiz > *maxsiz)
+ bufsiz = *maxsiz;
+
+ /* See if buffer can hold the query (usually it can, as the query is
+ short). */
+ if (strlen (arg) >= bufsiz)
+ error ("kod: query argument too long");
+
+ /* Send actual request. */
+ if (target_query ((int) 'K', arg, result, &bufsiz))
+ strcpy (result, "ERR: remote query failed");
+}
+
+/* Print name of kod command after selecting the appropriate kod
+ formatting library module. As a side effect we create a new "info"
+ subcommand which is what the user actually uses to query the OS. */
+
+static void
+kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
+{
+ char *p;
+
+ if (command->type != set_cmd)
+ return;
+
+ /* If we had already had an open OS, close it. */
+ if (gdb_kod_close)
+ (*gdb_kod_close) ();
+
+ /* Also remove the old OS's command. */
+ if (old_operating_system)
+ {
+ delete_cmd (old_operating_system, &infolist);
+ xfree (old_operating_system);
+ }
+ old_operating_system = xstrdup (operating_system);
+
+ if (! operating_system || ! *operating_system)
+ {
+ /* If user set operating system to empty, we want to forget we
+ had a module open. Setting these variables is just nice for
+ debugging and clarity. */
+ gdb_kod_open = NULL;
+ gdb_kod_request = NULL;
+ gdb_kod_close = NULL;
+ }
+ else
+ {
+ char *kodlib;
+
+ load_kod_library (operating_system);
+
+ kodlib = (*gdb_kod_open) (gdb_kod_display, gdb_kod_query);
+
+ /* Add kod related info commands to gdb. */
+ add_info (operating_system, info_kod_command,
+ "Displays information about Kernel Objects.");
+
+ p = strrchr (kodlib, '-');
+ if (p != NULL)
+ p++;
+ else
+ p = "Unknown KOD library";
+ printf_filtered ("%s - %s\n", operating_system, p);
+
+ xfree (kodlib);
+ }
+}
+
+/* Print information about currently known kernel objects of the
+ specified type or a list of all known kernel object types if
+ argument is empty. */
+
+static void
+info_kod_command (char *arg, int from_tty)
+{
+ (*gdb_kod_request) (arg, from_tty);
+}
+
+/* Print name of kod command after selecting the appropriate kod
+ formatting library module. */
+
+static void
+load_kod_library (char *lib)
+{
+#if 0
+ /* FIXME: Don't have the eCos code here. */
+ if (! strcmp (lib, "ecos"))
+ {
+ gdb_kod_open = ecos_kod_open;
+ gdb_kod_request = ecos_kod_request;
+ gdb_kod_close = ecos_kod_close;
+ }
+ else
+#endif /* 0 */
+ if (! strcmp (lib, "cisco"))
+ {
+ gdb_kod_open = cisco_kod_open;
+ gdb_kod_request = cisco_kod_request;
+ gdb_kod_close = cisco_kod_close;
+ }
+ else
+ error ("Unknown operating system: %s\n", operating_system);
+}
+
+void
+_initialize_kod (void)
+{
+ struct cmd_list_element *c;
+
+ c = add_set_cmd ("os", no_class, var_string,
+ (char *) &operating_system,
+ "Set operating system",
+ &setlist);
+ set_cmd_sfunc (c, kod_set_os);
+ add_show_from_set (c, &showlist);
+}
diff --git a/contrib/gdb/gdb/kod.h b/contrib/gdb/gdb/kod.h
new file mode 100644
index 0000000..6c4d03a
--- /dev/null
+++ b/contrib/gdb/gdb/kod.h
@@ -0,0 +1,61 @@
+/* Kernel Object Display facility for Cisco
+ Copyright 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. */
+
+#ifndef KOD_H
+#define KOD_H
+
+typedef void kod_display_callback_ftype (char *);
+typedef void kod_query_callback_ftype (char *, char *, int *);
+
+/* ???/???: Functions imported from the library for all supported
+ OSes. FIXME: we really should do something better, such as
+ dynamically loading the KOD modules. */
+
+/* FIXME: cagney/1999-09-20: The kod-cisco.c et.al. kernel modules
+ should register themselve with kod.c during the _initialization*()
+ phase. With that implemented the extern declarations below would
+ be replaced with the KOD register function that the various kernel
+ modules should call. An example of this mechanism can be seen in
+ gdbarch.c:register_gdbarch_init(). */
+
+#if 0
+/* Don't have ecos code yet. */
+extern char *ecos_kod_open (kod_display_callback_ftype *display_func,
+ kod_query_callback_ftype *query_func);
+extern void ecos_kod_request (char *, int);
+extern void ecos_kod_close (void);
+#endif
+
+/* Initialize and return library name and version. The gdb side of
+ KOD, kod.c, passes us two functions: one for displaying output
+ (presumably to the user) and the other for querying the target. */
+
+extern char *cisco_kod_open (kod_display_callback_ftype *display_func,
+ kod_query_callback_ftype *query_func);
+
+/* Print information about currently known kernel objects. We
+ currently ignore the argument. There is only one mode of querying
+ the Cisco kernel: we ask for a dump of everything, and it returns
+ it. */
+
+extern void cisco_kod_request (char *arg, int from_tty);
+
+extern void cisco_kod_close (void);
+
+#endif
diff --git a/contrib/gdb/gdb/language.c b/contrib/gdb/gdb/language.c
index 225d423..4c4036b 100644
--- a/contrib/gdb/gdb/language.c
+++ b/contrib/gdb/gdb/language.c
@@ -1,23 +1,25 @@
/* Multiple source language support for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
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,
@@ -35,89 +37,81 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbtypes.h"
#include "value.h"
#include "gdbcmd.h"
-#include "frame.h"
#include "expression.h"
#include "language.h"
#include "target.h"
#include "parser-defs.h"
+#include "jv-lang.h"
-static void
-show_language_command PARAMS ((char *, int));
+extern void _initialize_language (void);
-static void
-set_language_command PARAMS ((char *, int));
+static void show_language_command (char *, int);
-static void
-show_type_command PARAMS ((char *, int));
+static void set_language_command (char *, int);
-static void
-set_type_command PARAMS ((char *, int));
+static void show_type_command (char *, int);
-static void
-show_range_command PARAMS ((char *, int));
+static void set_type_command (char *, int);
-static void
-set_range_command PARAMS ((char *, int));
+static void show_range_command (char *, int);
-static void
-set_range_str PARAMS ((void));
+static void set_range_command (char *, int);
-static void
-set_type_str PARAMS ((void));
+static void show_case_command (char *, int);
-static void
-set_lang_str PARAMS ((void));
+static void set_case_command (char *, int);
-static void
-unk_lang_error PARAMS ((char *));
+static void set_case_str (void);
-static int
-unk_lang_parser PARAMS ((void));
+static void set_range_str (void);
-static void
-show_check PARAMS ((char *, int));
+static void set_type_str (void);
-static void
-set_check PARAMS ((char *, int));
+static void set_lang_str (void);
-static void
-set_type_range PARAMS ((void));
+static void unk_lang_error (char *);
-static void
-unk_lang_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+static int unk_lang_parser (void);
-static void
-unk_lang_printchar PARAMS ((int c, GDB_FILE *stream));
+static void show_check (char *, int);
-static void
-unk_lang_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+static void set_check (char *, int);
-static struct type *
-unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
+static void set_type_range_case (void);
-static void
-unk_lang_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
-static int
-unk_lang_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+static void unk_lang_printchar (int c, struct ui_file *stream);
-static int
-unk_lang_value_print PARAMS ((value_ptr, GDB_FILE *, int, enum val_prettyprint));
+static void unk_lang_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+
+static struct type *unk_lang_create_fundamental_type (struct objfile *, int);
+
+static void unk_lang_print_type (struct type *, char *, struct ui_file *,
+ int, int);
+
+static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
+
+static int unk_lang_value_print (struct value *, struct ui_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;
enum type_mode type_mode = type_mode_auto;
enum type_check type_check = type_check_off;
+enum case_mode case_mode = case_mode_auto;
+enum case_sensitivity case_sensitivity = case_sensitive_on;
/* The current language and language_mode (see language.h) */
@@ -145,37 +139,34 @@ static unsigned languages_allocsize;
static char *language;
static char *type;
static char *range;
+static char *case_sensitive;
/* 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.";
+
/* This page contains the functions corresponding to GDB commands
and their helpers. */
/* Show command. Display a warning if the language set
does not match the frame. */
static void
-show_language_command (ignore, from_tty)
- char *ignore;
- int from_tty;
+show_language_command (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;
+set_language_command (char *ignore, int from_tty)
{
int i;
enum language flang;
@@ -183,7 +174,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)
@@ -197,145 +188,190 @@ 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_case ();
+ 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));
- make_cleanup (free, err_lang); /* Free it after error */
- set_language(current_language->la_language);
- error ("Unknown language `%s'.",err_lang);
+ err_lang = savestring (language, strlen (language));
+ make_cleanup (xfree, err_lang); /* Free it after error */
+ 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 (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 (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_case ();
/* Avoid hitting the set_type_str call below. We
- did it in set_type_range. */
+ did it in set_type_range_case. */
return;
- }
- set_type_str();
- show_type_command((char *)NULL, from_tty);
+ }
+ else
+ {
+ warning ("Unrecognized type check setting: \"%s\"", type);
+ }
+ 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 (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 (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_case ();
/* Avoid hitting the set_range_str call below. We
- did it in set_type_range. */
+ did it in set_type_range_case. */
return;
+ }
+ else
+ {
+ warning ("Unrecognized range check setting: \"%s\"", range);
+ }
+ set_range_str ();
+ show_range_command ((char *) 0, from_tty);
+}
+
+/* Show command. Display a warning if the case sensitivity setting does
+ not match the current language. */
+static void
+show_case_command (char *ignore, int from_tty)
+{
+ if (case_sensitivity != current_language->la_case_sensitivity)
+ printf_unfiltered(
+"Warning: the current case sensitivity setting does not match the language.\n");
+}
+
+/* Set command. Change the setting for case sensitivity. */
+static void
+set_case_command (char *ignore, int from_tty)
+{
+ if (STREQ (case_sensitive, "on"))
+ {
+ case_sensitivity = case_sensitive_on;
+ case_mode = case_mode_manual;
+ }
+ else if (STREQ (case_sensitive, "off"))
+ {
+ case_sensitivity = case_sensitive_off;
+ case_mode = case_mode_manual;
+ }
+ else if (STREQ (case_sensitive, "auto"))
+ {
+ case_mode = case_mode_auto;
+ set_type_range_case ();
+ /* Avoid hitting the set_case_str call below. We
+ did it in set_type_range_case. */
+ return;
+ }
+ else
+ {
+ warning ("Unrecognized case-sensitive setting: \"%s\"", case_sensitive);
}
- set_range_str();
- show_range_command((char *)0, from_tty);
+ set_case_str();
+ show_case_command ((char *) NULL, from_tty);
}
-/* Set the status of range and type checking based on
+/* Set the status of range and type checking and case sensitivity based on
the current modes and the current language.
If SHOW is non-zero, then print out the current language,
type and range checking status. */
static void
-set_type_range()
+set_type_range_case (void)
{
if (range_mode == range_mode_auto)
@@ -344,29 +380,34 @@ set_type_range()
if (type_mode == type_mode_auto)
type_check = current_language->la_type_check;
- set_type_str();
- set_range_str();
+ if (case_mode == case_mode_auto)
+ case_sensitivity = current_language->la_case_sensitivity;
+
+ set_type_str ();
+ set_range_str ();
+ set_case_str ();
}
/* Set current language to (enum language) LANG. Returns previous language. */
enum language
-set_language(lang)
- enum language lang;
+set_language (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_case ();
+ set_lang_str ();
+ break;
+ }
}
- }
return prev_language;
}
@@ -374,215 +415,330 @@ set_language(lang)
/* This page contains functions that update the global vars
language, type and range. */
static void
-set_lang_str()
+set_lang_str (void)
{
- char *prefix = "";
+ char *prefix = "";
- free (language);
- if (language_mode == language_mode_auto)
- prefix = "auto; currently ";
+ if (language)
+ xfree (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 (void)
{
- char *tmp, *prefix = "";
+ char *tmp = NULL, *prefix = "";
- free (type);
- if (type_mode==type_mode_auto)
- prefix = "auto; currently ";
+ if (type)
+ xfree (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 (void)
{
- char *tmp, *pref = "";
+ char *tmp, *pref = "";
- free (range);
- if (range_mode==range_mode_auto)
- pref = "auto; currently ";
+ 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);
+ if (range)
+ xfree (range);
+ range = concat (pref, tmp, NULL);
}
+static void
+set_case_str()
+{
+ char *tmp = NULL, *prefix = "";
+
+ if (case_mode==case_mode_auto)
+ prefix = "auto; currently ";
+
+ switch (case_sensitivity)
+ {
+ case case_sensitive_on:
+ tmp = "on";
+ break;
+ case case_sensitive_off:
+ tmp = "off";
+ break;
+ default:
+ error ("Unrecognized case-sensitive setting.");
+ }
+
+ xfree (case_sensitive);
+ case_sensitive = concat (prefix, tmp, NULL);
+}
/* Print out the current language settings: language, range and
type checking. If QUIETLY, print only what has changed. */
void
-language_info (quietly)
- int quietly;
+language_info (int quietly)
{
if (quietly && expected_language == current_language)
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);
+ printf_unfiltered ("Case sensitivity: %s\n", case_sensitive);
+ show_case_command ((char *) 0, 1);
}
}
/* 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;
+binop_result_type (struct value *v1, struct value *v2)
{
- int size,uns;
- struct type *t1 = check_typedef (VALUE_TYPE (v1));
- struct type *t2 = check_typedef (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);
+ 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);
+ 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 */
+ }
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ return (struct type *) 0; /* For lint */
}
-#endif /* 0 */
-
+#endif /* 0 */
+
/* 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 (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;
+local_hex_string (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 LONGEST number to hexadecimal and stores it in a static
+ string. Returns a pointer to this string. */
+char *
+longest_local_hex_string (LONGEST num)
+{
+ return longest_local_hex_string_custom (num, "l");
}
/* 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 (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;
}
+/* Converts a LONGEST number to custom hexadecimal and stores it in a static
+ string. Returns a pointer to this string. Note that the width parameter
+ should end with "l", e.g. "08l" as with calls to local_hex_string_custom */
+
+char *
+longest_local_hex_string_custom (LONGEST num, char *width)
+{
+#define RESULT_BUF_LEN 50
+ static char res2[RESULT_BUF_LEN];
+ char format[RESULT_BUF_LEN];
+#if !defined (PRINTF_HAS_LONG_LONG)
+ int field_width;
+ int num_len;
+ int num_pad_chars;
+ char *pad_char; /* string with one character */
+ int pad_on_left;
+ char *parse_ptr;
+ char temp_nbr_buf[RESULT_BUF_LEN];
+#endif
+
+#ifndef CC_HAS_LONG_LONG
+ /* If there is no long long, then LONGEST should be just long and we
+ can use local_hex_string_custom
+ */
+ return local_hex_string_custom ((unsigned long) num, width);
+#elif defined (PRINTF_HAS_LONG_LONG)
+ /* Just use printf. */
+ strcpy (format, local_hex_format_prefix ()); /* 0x */
+ strcat (format, "%");
+ strcat (format, width); /* e.g. "08l" */
+ strcat (format, "l"); /* need "ll" for long long */
+ strcat (format, local_hex_format_specifier ()); /* "x" */
+ strcat (format, local_hex_format_suffix ()); /* "" */
+ sprintf (res2, format, num);
+ return res2;
+#else /* !defined (PRINTF_HAS_LONG_LONG) */
+ /* Use phex_nz to print the number into a string, then
+ build the result string from local_hex_format_prefix, padding and
+ the hex representation as indicated by "width". */
+ strcpy (temp_nbr_buf, phex_nz (num, sizeof (num)));
+ /* parse width */
+ parse_ptr = width;
+ pad_on_left = 1;
+ pad_char = " ";
+ if (*parse_ptr == '-')
+ {
+ parse_ptr++;
+ pad_on_left = 0;
+ }
+ if (*parse_ptr == '0')
+ {
+ parse_ptr++;
+ if (pad_on_left)
+ pad_char = "0"; /* If padding is on the right, it is blank */
+ }
+ field_width = atoi (parse_ptr);
+ num_len = strlen (temp_nbr_buf);
+ num_pad_chars = field_width - strlen (temp_nbr_buf); /* possibly negative */
+
+ if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars
+ >= RESULT_BUF_LEN) /* paranoia */
+ internal_error (__FILE__, __LINE__,
+ "longest_local_hex_string_custom: insufficient space to store result");
+
+ strcpy (res2, local_hex_format_prefix ());
+ if (pad_on_left)
+ {
+ while (num_pad_chars > 0)
+ {
+ strcat (res2, pad_char);
+ num_pad_chars--;
+ }
+ }
+ strcat (res2, temp_nbr_buf);
+ if (!pad_on_left)
+ {
+ while (num_pad_chars > 0)
+ {
+ strcat (res2, pad_char);
+ num_pad_chars--;
+ }
+ }
+ return res2;
+#endif
+
+} /* longest_local_hex_string_custom */
+
/* Returns the appropriate printf format for octal
numbers. */
char *
-local_octal_format_custom(pre)
- char *pre;
+local_octal_format_custom (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 (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;
}
#if 0
@@ -604,22 +760,22 @@ 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 (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.
@@ -627,193 +783,193 @@ simple_type(type)
properties of "greater than", "less than", etc, or for which the
operations "increment" or "decrement" make sense. */
int
-ordered_type (type)
- struct type *type;
+ordered_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;
+same_type (struct type *arg1, struct type *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;
+integral_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:
+ case language_pascal:
+ 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;
+numeric_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;
+character_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:
+ case language_pascal:
+ 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;
+string_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;
+ switch (current_language->la_language)
+ {
+ case language_chill:
+ case language_m2:
+ case language_pascal:
+ return TYPE_CODE (type) != TYPE_CODE_STRING ? 0 : 1;
- case language_c:
- case language_cplus:
+ 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;
+boolean_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;
+float_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 (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 (struct type *type)
{
CHECK_TYPEDEF (type);
- switch(current_language->la_language)
- {
- case language_c:
- case language_cplus:
+ 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_pascal:
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:
+ 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
struct type *
-lang_bool_type ()
+lang_bool_type (void)
{
struct symbol *sym;
struct type *type;
- switch(current_language->la_language)
+ switch (current_language->la_language)
{
case language_chill:
return builtin_type_chill_bool;
@@ -827,7 +983,11 @@ lang_bool_type ()
}
return builtin_type_f_logical_s2;
case language_cplus:
- sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);
+ case language_pascal:
+ if (current_language->la_language==language_cplus)
+ {sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);}
+ else
+ {sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);}
if (sym)
{
type = SYMBOL_TYPE (sym);
@@ -835,6 +995,15 @@ lang_bool_type ()
return type;
}
return builtin_type_bool;
+ case language_java:
+ sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);
+ if (sym)
+ {
+ type = SYMBOL_TYPE (sym);
+ if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
+ return type;
+ }
+ return java_boolean_type;
default:
return builtin_type_int;
}
@@ -845,8 +1014,7 @@ lang_bool_type ()
/* Returns non-zero if the value VAL represents a true value. */
int
-value_true (val)
- value_ptr val;
+value_true (struct value *val)
{
/* It is possible that we should have some sort of error if a non-boolean
value is used in this context. Possibly dependent on some kind of
@@ -860,158 +1028,171 @@ 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 (struct value *arg1, struct value *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:
+ 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_pascal
+ case language_pascal:
switch(op)
{
case BINOP_DIV:
- if (!float_type(t1) || !float_type(t2))
+ if (!float_type(t1) && !float_type(t2))
type_op_error ("Arguments to %s must be floating point numbers.",op);
break;
case BINOP_INTDIV:
@@ -1022,17 +1203,17 @@ binop_type_check(arg1,arg2,op)
#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 */
+
/* This page contains functions for the printing out of
error messages that occur during type- and range-
checking. */
@@ -1042,96 +1223,86 @@ 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 (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.
- The first argument should be a printf()-style format string, and
- the rest of the arguments should be its arguments. If
- [type|range]_check is [type|range]_check_on, then return_to_top_level()
- is called in the style of error (). Otherwise, the message is prefixed
- by the value of warning_pre_print and we do not return to the top level. */
+/* These are called when a language fails a type- or range-check. The
+ first argument should be a printf()-style format string, and the
+ rest of the arguments should be its arguments. If
+ [type|range]_check is [type|range]_check_on, an error is printed;
+ if [type|range]_check_warn, a warning; otherwise just the
+ message. */
void
-#ifdef ANSI_PROTOTYPES
-type_error (char *string, ...)
-#else
-type_error (va_alist)
- va_dcl
-#endif
+type_error (const char *string,...)
{
- va_list args;
-#ifdef ANSI_PROTOTYPES
- va_start (args, string);
-#else
- char *string;
- va_start (args);
- string = va_arg (args, char *);
-#endif
+ va_list args;
+ va_start (args, string);
- 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);
+ switch (type_check)
+ {
+ case type_check_warn:
+ vwarning (string, args);
+ break;
+ case type_check_on:
+ verror (string, args);
+ break;
+ case type_check_off:
+ /* FIXME: cagney/2002-01-30: Should this function print anything
+ when type error is off? */
+ vfprintf_filtered (gdb_stderr, string, args);
+ fprintf_filtered (gdb_stderr, "\n");
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ va_end (args);
}
void
-#ifdef ANSI_PROTOTYPES
-range_error (char *string, ...)
-#else
-range_error (va_alist)
- va_dcl
-#endif
+range_error (const char *string,...)
{
- va_list args;
-#ifdef ANSI_PROTOTYPES
- va_start (args, string);
-#else
- char *string;
- va_start (args);
- string = va_arg (args, char *);
-#endif
+ va_list args;
+ va_start (args, string);
- 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);
+ switch (range_check)
+ {
+ case range_check_warn:
+ vwarning (string, args);
+ break;
+ case range_check_on:
+ verror (string, args);
+ break;
+ case range_check_off:
+ /* FIXME: cagney/2002-01-30: Should this function print anything
+ when range error is off? */
+ vfprintf_filtered (gdb_stderr, string, args);
+ fprintf_filtered (gdb_stderr, "\n");
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ va_end (args);
}
-
+
/* This page contains miscellaneous functions */
/* Return the language enum for a given language string. */
enum language
-language_enum (str)
- char *str;
+language_enum (char *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;
@@ -1141,63 +1312,60 @@ language_enum (str)
/* Return the language struct for a given language enum. */
const struct language_defn *
-language_def(lang)
- enum language lang;
+language_def (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 (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;
+set_check (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;
+show_check (char *ignore, int from_tty)
{
- cmd_show_list(showchecklist, from_tty, "");
+ cmd_show_list (showchecklist, from_tty, "");
}
/* Add a language to the set of known languages. */
void
-add_language (lang)
- const struct language_defn *lang;
+add_language (const struct language_defn *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);
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
if (!languages)
@@ -1210,7 +1378,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;
}
@@ -1218,102 +1386,81 @@ add_language (lang)
/* Define the language that is no language. */
static int
-unk_lang_parser ()
+unk_lang_parser (void)
{
return 1;
}
static void
-unk_lang_error (msg)
- char *msg;
+unk_lang_error (char *msg)
{
error ("Attempted to parse an expression with unknown language");
}
static void
-unk_lang_emit_char (c, stream, quoter)
- register int c;
- GDB_FILE *stream;
- int quoter;
+unk_lang_emit_char (register int c, struct ui_file *stream, int quoter)
{
error ("internal error - unimplemented function unk_lang_emit_char called.");
}
static void
-unk_lang_printchar (c, stream)
- register int c;
- GDB_FILE *stream;
+unk_lang_printchar (register int c, struct ui_file *stream)
{
error ("internal error - unimplemented function unk_lang_printchar called.");
}
static void
-unk_lang_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+unk_lang_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
error ("internal error - unimplemented function unk_lang_printstr called.");
}
static struct type *
-unk_lang_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+unk_lang_create_fundamental_type (struct objfile *objfile, int typeid)
{
error ("internal error - unimplemented function unk_lang_create_fundamental_type called.");
}
static void
-unk_lang_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+unk_lang_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
error ("internal error - unimplemented function unk_lang_print_type called.");
}
static int
-unk_lang_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
- recurse, pretty)
- 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;
+unk_lang_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
error ("internal error - unimplemented function unk_lang_val_print called.");
}
static int
-unk_lang_value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+unk_lang_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint 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 (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],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
@@ -1324,24 +1471,26 @@ 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],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
@@ -1352,23 +1501,25 @@ 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],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
@@ -1379,73 +1530,80 @@ 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
};
/* Initialize the language routines */
void
-_initialize_language()
+_initialize_language (void)
{
- 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_cmd_cfunc (set, set_language_command);
+ set_cmd_cfunc (show, 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_cmd_cfunc (set, set_type_command);
+ set_cmd_cfunc (show, 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_cmd_cfunc (set, set_range_command);
+ set_cmd_cfunc (show, show_range_command);
+
+ set = add_set_cmd ("case-sensitive", class_support, var_string_noescape,
+ (char *) &case_sensitive,
+ "Set case sensitivity in name search. (on/off/auto)\n\
+For Fortran the default is off; for other languages the default is on.",
+ &setlist);
+ show = add_show_from_set (set, &showlist);
+ set_cmd_cfunc (set, set_case_command);
+ set_cmd_cfunc (show, show_case_command);
+
+ add_language (&unknown_language_defn);
+ add_language (&local_language_defn);
+ add_language (&auto_language_defn);
+
+ language = savestring ("auto", strlen ("auto"));
+ type = savestring ("auto", strlen ("auto"));
+ range = savestring ("auto", strlen ("auto"));
+ case_sensitive = savestring ("auto",strlen ("auto"));
+
+ /* Have the above take effect */
+ set_language (language_auto);
}
diff --git a/contrib/gdb/gdb/language.h b/contrib/gdb/gdb/language.h
index e336869..88375db 100644
--- a/contrib/gdb/gdb/language.h
+++ b/contrib/gdb/gdb/language.h
@@ -1,49 +1,55 @@
/* Source-language-related definitions for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000
+ Free Software Foundation, Inc.
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 */
+/* Forward decls for prototypes */
struct value;
struct objfile;
struct expression;
-/* enum exp_opcode; ANSI's `wisdom' didn't include forward enum decls. */
-#endif
+/* enum exp_opcode; ANSI's `wisdom' didn't include forward enum decls. */
/* This used to be included to configure GDB for one or more specific
- languages. Now it is shortcutted to configure for all of them. FIXME. */
+ languages. Now it is left out to configure for all of them. FIXME. */
/* #include "lang_def.h" */
#define _LANG_c
#define _LANG_m2
#define _LANG_chill
-#define _LANG_fortran
+#define _LANG_fortran
+#define _LANG_pascal
-#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 +57,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 +78,167 @@ 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;
+
+/* case_mode ==
+ case_mode_auto: case_sensitivity set upon selection of scope
+ case_mode_manual: case_sensitivity set only by user. */
+
+extern enum case_mode
+ {
+ case_mode_auto, case_mode_manual
+ }
+case_mode;
+
+/* case_sensitivity ==
+ case_sensitive_on: Case sensitivity in name matching is used
+ case_sensitive_off: Case sensitivity in name matching is not used */
+
+extern enum case_sensitivity
+ {
+ case_sensitive_on, case_sensitive_off
+ }
+case_sensitivity;
/* 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 */
+
+ char *la_name;
+
+ /* its symtab language-enum (defs.h) */
- /* its symtab language-enum (defs.h) */
+ enum language la_language;
- enum language la_language;
+ /* 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. */
- /* 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. */
+ struct type **const *la_builtin_type_vector;
- struct type ** const *la_builtin_type_vector;
+ /* Default range checking */
- /* Default range checking */
+ enum range_check la_range_check;
- enum range_check la_range_check;
+ /* Default type checking */
- /* Default type checking */
+ enum type_check la_type_check;
- enum type_check la_type_check;
+ /* Default case sensitivity */
+ enum case_sensitivity la_case_sensitivity;
- /* Parser function. */
-
- int (*la_parser) PARAMS((void));
+ /* Parser function. */
- /* Parser error function */
+ int (*la_parser) (void);
- void (*la_error) PARAMS ((char *));
+ /* Parser error function */
- /* Evaluate an expression. */
- struct value * (*evaluate_exp) PARAMS ((struct type *, struct expression *,
- int *, enum noside));
+ void (*la_error) (char *);
- void (*la_printchar) PARAMS ((int ch, GDB_FILE *stream));
+ /* Evaluate an expression. */
+ struct value *(*evaluate_exp) (struct type *, struct expression *,
+ int *, enum noside);
- void (*la_printstr) PARAMS ((GDB_FILE *stream, char *string,
- unsigned int length, int width,
- int force_ellipses));
+ void (*la_printchar) (int ch, struct ui_file * stream);
- void (*la_emitchar) PARAMS ((int ch, GDB_FILE *stream, int quoter));
+ void (*la_printstr) (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
- struct type *(*la_fund_type) PARAMS ((struct objfile *, int));
+ void (*la_emitchar) (int ch, struct ui_file * stream, int quoter);
- /* Print a type using syntax appropriate for this language. */
+ struct type *(*la_fund_type) (struct objfile *, int);
- void (*la_print_type) PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+ /* Print a type using syntax appropriate for this language. */
- /* Print a value using syntax appropriate for this language. */
+ void (*la_print_type) (struct type *, char *, struct ui_file *, int,
+ int);
- int (*la_val_print) PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+ /* Print a value using syntax appropriate for this language. */
- /* Print a top-level value using syntax appropriate for this language. */
+ int (*la_val_print) (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
- int (*la_value_print) PARAMS ((struct value *, GDB_FILE *,
- int, enum val_prettyprint));
+ /* Print a top-level value using syntax appropriate for this language. */
- /* Base 2 (binary) formats. */
+ int (*la_value_print) (struct value *, struct ui_file *,
+ int, enum val_prettyprint);
- struct language_format_info la_binary_format;
+ /* Base 2 (binary) formats. */
- /* Base 8 (octal) formats. */
+ struct language_format_info la_binary_format;
- struct language_format_info la_octal_format;
+ /* Base 8 (octal) formats. */
- /* Base 10 (decimal) formats */
+ struct language_format_info la_octal_format;
- struct language_format_info la_decimal_format;
+ /* Base 10 (decimal) formats */
- /* Base 16 (hexadecimal) formats */
+ struct language_format_info la_decimal_format;
- struct language_format_info la_hex_format;
+ /* Base 16 (hexadecimal) formats */
- /* Table for printing expressions */
+ struct language_format_info la_hex_format;
- const struct op_print *la_op_print_tab;
+ /* Table for printing expressions */
- /* Zero if the language has first-class arrays. True if there are no
- array values, and array objects decay to pointers, as in C. */
+ const struct op_print *la_op_print_tab;
- char c_style_arrays;
+ /* Zero if the language has first-class arrays. True if there are no
+ array values, and array objects decay to pointers, as in C. */
- /* Index to use for extracting the first element of a string. */
- char string_lower_bound;
+ char c_style_arrays;
- /* Type of elements of strings. */
- struct type **string_char_type;
+ /* Index to use for extracting the first element of a string. */
+ char string_lower_bound;
- /* Add fields above this point, so the magic number is always last. */
- /* Magic number for compat checking */
+ /* Type of elements of strings. */
+ struct type **string_char_type;
- long la_magic;
+ /* Add fields above this point, so the magic number is always last. */
+ /* Magic number for compat checking */
-};
+ long la_magic;
+
+ };
#define LANG_MAGIC 910823L
@@ -215,7 +256,7 @@ struct language_defn
its own language and we should keep track of that regardless of the
language when symbols are read. If we want some manual setting for
the language of symbol files (e.g. detecting when ".c" files are
- C++), it should be a seprate setting from the current_language. */
+ C++), it should be a separate setting from the current_language. */
extern const struct language_defn *current_language;
@@ -226,11 +267,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;
/* These macros define the behaviour of the expression
evaluator. */
@@ -246,13 +290,11 @@ extern enum language_mode
#define CAST_IS_CONVERSION (current_language->la_language == language_c || \
current_language->la_language == language_cplus)
-extern void
-language_info PARAMS ((int));
-
-extern enum language
-set_language PARAMS ((enum language));
+extern void language_info (int);
+extern enum language set_language (enum language);
+
/* 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
@@ -334,106 +376,95 @@ set_language PARAMS ((enum language));
overwritten by the next call. Takes printf options like "08" or "l"
(to produce e.g. %08x or %lx). */
-extern char *
-local_decimal_format_custom PARAMS ((char *)); /* language.c */
+extern char *local_decimal_format_custom (char *); /* language.c */
-extern char *
-local_octal_format_custom PARAMS ((char *)); /* language.c */
+extern char *local_octal_format_custom (char *); /* language.c */
-extern char *
-local_hex_format_custom PARAMS ((char *)); /* language.c */
+extern char *local_hex_format_custom (char *); /* language.c */
+
+#if 0
+/* FIXME: cagney/2000-03-04: This function does not appear to be used.
+ It can be deleted once 5.0 has been released. */
+/* Return a string that contains the hex digits of the number. No preceeding
+ "0x" */
+
+extern char *longest_raw_hex_string (LONGEST);
+#endif
/* 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". */
+ the next call. Takes printf options like "08l" or "l". */
-extern char *
-local_hex_string PARAMS ((unsigned long)); /* language.c */
+extern char *local_hex_string (unsigned long); /* language.c */
-extern char *
-local_hex_string_custom PARAMS ((unsigned long, char *)); /* language.c */
+extern char *longest_local_hex_string (LONGEST); /* language.c */
+
+extern char *local_hex_string_custom (unsigned long, char *); /* language.c */
+
+extern char *longest_local_hex_string_custom (LONGEST, char *); /* language.c */
/* Type predicates */
-extern int
-simple_type PARAMS ((struct type *));
+extern int simple_type (struct type *);
-extern int
-ordered_type PARAMS ((struct type *));
+extern int ordered_type (struct type *);
-extern int
-same_type PARAMS ((struct type *, struct type *));
+extern int same_type (struct type *, struct type *);
-extern int
-integral_type PARAMS ((struct type *));
+extern int integral_type (struct type *);
-extern int
-numeric_type PARAMS ((struct type *));
+extern int numeric_type (struct type *);
-extern int
-character_type PARAMS ((struct type *));
+extern int character_type (struct type *);
-extern int
-boolean_type PARAMS ((struct type *));
+extern int boolean_type (struct type *);
-extern int
-float_type PARAMS ((struct type *));
+extern int float_type (struct type *);
-extern int
-pointer_type PARAMS ((struct type *));
+extern int pointer_type (struct type *);
-extern int
-structured_type PARAMS ((struct type *));
+extern int structured_type (struct type *);
/* Checks Binary and Unary operations for semantic type correctness */
/* FIXME: Does not appear to be used */
#define unop_type_check(v,o) binop_type_check((v),NULL,(o))
-extern void
-binop_type_check PARAMS ((struct value *, struct value *, int));
+extern void binop_type_check (struct value *, struct value *, int);
/* Error messages */
-extern void
-op_error PARAMS ((char *fmt, enum exp_opcode, int));
+extern void op_error (char *fmt, enum exp_opcode, int);
#define type_op_error(f,o) \
op_error((f),(o),type_check==type_check_on ? 1 : 0)
#define range_op_error(f,o) \
op_error((f),(o),range_check==range_check_on ? 1 : 0)
-extern void
-type_error PARAMS ((char *, ...))
- ATTR_FORMAT(printf, 1, 2);
+extern void type_error (const char *, ...) ATTR_FORMAT (printf, 1, 2);
-void
-range_error PARAMS ((char *, ...))
- ATTR_FORMAT(printf, 1, 2);
+extern void range_error (const 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 (struct value *);
-extern struct type * lang_bool_type PARAMS ((void));
+extern struct type *lang_bool_type (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 const struct language_defn *
-language_def PARAMS ((enum language));
+extern enum language language_enum (char *str);
+
+extern const struct language_defn *language_def (enum language);
-extern char *
-language_str PARAMS ((enum language));
+extern char *language_str (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 (const struct language_defn *);
-extern enum language
-get_frame_language PARAMS ((void)); /* In stack.c */
+extern enum language get_frame_language (void); /* In stack.c */
-#endif /* defined (LANGUAGE_H) */
+#endif /* defined (LANGUAGE_H) */
diff --git a/contrib/gdb/gdb/lin-lwp.c b/contrib/gdb/gdb/lin-lwp.c
new file mode 100644
index 0000000..e39e787
--- /dev/null
+++ b/contrib/gdb/gdb/lin-lwp.c
@@ -0,0 +1,1549 @@
+/* Multi-threaded debugging support for GNU/Linux (LWP layer).
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "gdb_assert.h"
+#include <errno.h>
+#include <signal.h>
+#include <sys/ptrace.h>
+#include "gdb_wait.h"
+
+#include "gdbthread.h"
+#include "inferior.h"
+#include "target.h"
+#include "regcache.h"
+#include "gdbcmd.h"
+
+static int debug_lin_lwp;
+extern const char *strsignal (int sig);
+
+/* On GNU/Linux there are no real LWP's. The closest thing to LWP's
+ are processes sharing the same VM space. A multi-threaded process
+ is basically a group of such processes. However, such a grouping
+ is almost entirely a user-space issue; the kernel doesn't enforce
+ such a grouping at all (this might change in the future). In
+ general, we'll rely on the threads library (i.e. the GNU/Linux
+ Threads library) to provide such a grouping.
+
+ It is perfectly well possible to write a multi-threaded application
+ without the assistance of a threads library, by using the clone
+ system call directly. This module should be able to give some
+ rudimentary support for debugging such applications if developers
+ specify the CLONE_PTRACE flag in the clone system call, and are
+ using the Linux kernel 2.4 or above.
+
+ Note that there are some peculiarities in GNU/Linux that affect
+ this code:
+
+ - In general one should specify the __WCLONE flag to waitpid in
+ order to make it report events for any of the cloned processes
+ (and leave it out for the initial process). However, if a cloned
+ process has exited the exit status is only reported if the
+ __WCLONE flag is absent. Linux kernel 2.4 has a __WALL flag, but
+ we cannot use it since GDB must work on older systems too.
+
+ - When a traced, cloned process exits and is waited for by the
+ debugger, the kernel reassigns it to the original parent and
+ keeps it around as a "zombie". Somehow, the GNU/Linux Threads
+ library doesn't notice this, which leads to the "zombie problem":
+ When debugged a multi-threaded process that spawns a lot of
+ threads will run out of processes, even if the threads exit,
+ because the "zombies" stay around. */
+
+/* Structure describing a LWP. */
+struct lwp_info
+{
+ /* The process id of the LWP. This is a combination of the LWP id
+ and overall process id. */
+ ptid_t ptid;
+
+ /* Non-zero if this LWP is cloned. In this context "cloned" means
+ that the LWP is reporting to its parent using a signal other than
+ SIGCHLD. */
+ int cloned;
+
+ /* Non-zero if we sent this LWP a SIGSTOP (but the LWP didn't report
+ it back yet). */
+ int signalled;
+
+ /* Non-zero if this LWP is stopped. */
+ int stopped;
+
+ /* Non-zero if this LWP will be/has been resumed. Note that an LWP
+ can be marked both as stopped and resumed at the same time. This
+ happens if we try to resume an LWP that has a wait status
+ pending. We shouldn't let the LWP run until that wait status has
+ been processed, but we should not report that wait status if GDB
+ didn't try to let the LWP run. */
+ int resumed;
+
+ /* If non-zero, a pending wait status. */
+ int status;
+
+ /* Non-zero if we were stepping this LWP. */
+ int step;
+
+ /* Next LWP in list. */
+ struct lwp_info *next;
+};
+
+/* List of known LWPs. */
+static struct lwp_info *lwp_list;
+
+/* Number of LWPs in the list. */
+static int num_lwps;
+
+/* Non-zero if we're running in "threaded" mode. */
+static int threaded;
+
+
+#define GET_LWP(ptid) ptid_get_lwp (ptid)
+#define GET_PID(ptid) ptid_get_pid (ptid)
+#define is_lwp(ptid) (GET_LWP (ptid) != 0)
+#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
+
+/* If the last reported event was a SIGTRAP, this variable is set to
+ the process id of the LWP/thread that got it. */
+ptid_t trap_ptid;
+
+
+/* This module's target-specific operations. */
+static struct target_ops lin_lwp_ops;
+
+/* The standard child operations. */
+extern struct target_ops child_ops;
+
+/* Since we cannot wait (in lin_lwp_wait) for the initial process and
+ any cloned processes with a single call to waitpid, we have to use
+ the WNOHANG flag and call waitpid in a loop. To optimize
+ things a bit we use `sigsuspend' to wake us up when a process has
+ something to report (it will send us a SIGCHLD if it has). To make
+ this work we have to juggle with the signal mask. We save the
+ original signal mask such that we can restore it before creating a
+ new process in order to avoid blocking certain signals in the
+ inferior. We then block SIGCHLD during the waitpid/sigsuspend
+ loop. */
+
+/* Original signal mask. */
+static sigset_t normal_mask;
+
+/* Signal mask for use with sigsuspend in lin_lwp_wait, initialized in
+ _initialize_lin_lwp. */
+static sigset_t suspend_mask;
+
+/* Signals to block to make that sigsuspend work. */
+static sigset_t blocked_mask;
+
+
+/* Prototypes for local functions. */
+static int stop_wait_callback (struct lwp_info *lp, void *data);
+
+/* Convert wait status STATUS to a string. Used for printing debug
+ messages only. */
+
+static char *
+status_to_str (int status)
+{
+ static char buf[64];
+
+ if (WIFSTOPPED (status))
+ snprintf (buf, sizeof (buf), "%s (stopped)",
+ strsignal (WSTOPSIG (status)));
+ else if (WIFSIGNALED (status))
+ snprintf (buf, sizeof (buf), "%s (terminated)",
+ strsignal (WSTOPSIG (status)));
+ else
+ snprintf (buf, sizeof (buf), "%d (exited)",
+ WEXITSTATUS (status));
+
+ return buf;
+}
+
+/* Initialize the list of LWPs. Note that this module, contrary to
+ what GDB's generic threads layer does for its thread list,
+ re-initializes the LWP lists whenever we mourn or detach (which
+ doesn't involve mourning) the inferior. */
+
+static void
+init_lwp_list (void)
+{
+ struct lwp_info *lp, *lpnext;
+
+ for (lp = lwp_list; lp; lp = lpnext)
+ {
+ lpnext = lp->next;
+ xfree (lp);
+ }
+
+ lwp_list = NULL;
+ num_lwps = 0;
+ threaded = 0;
+}
+
+/* Add the LWP specified by PID to the list. If this causes the
+ number of LWPs to become larger than one, go into "threaded" mode.
+ Return a pointer to the structure describing the new LWP. */
+
+static struct lwp_info *
+add_lwp (ptid_t ptid)
+{
+ struct lwp_info *lp;
+
+ gdb_assert (is_lwp (ptid));
+
+ lp = (struct lwp_info *) xmalloc (sizeof (struct lwp_info));
+
+ memset (lp, 0, sizeof (struct lwp_info));
+
+ lp->ptid = ptid;
+
+ lp->next = lwp_list;
+ lwp_list = lp;
+ if (++num_lwps > 1)
+ threaded = 1;
+
+ return lp;
+}
+
+/* Remove the LWP specified by PID from the list. */
+
+static void
+delete_lwp (ptid_t ptid)
+{
+ struct lwp_info *lp, *lpprev;
+
+ lpprev = NULL;
+
+ for (lp = lwp_list; lp; lpprev = lp, lp = lp->next)
+ if (ptid_equal (lp->ptid, ptid))
+ break;
+
+ if (!lp)
+ return;
+
+ /* We don't go back to "non-threaded" mode if the number of threads
+ becomes less than two. */
+ num_lwps--;
+
+ if (lpprev)
+ lpprev->next = lp->next;
+ else
+ lwp_list = lp->next;
+
+ xfree (lp);
+}
+
+/* Return a pointer to the structure describing the LWP corresponding
+ to PID. If no corresponding LWP could be found, return NULL. */
+
+static struct lwp_info *
+find_lwp_pid (ptid_t ptid)
+{
+ struct lwp_info *lp;
+ int lwp;
+
+ if (is_lwp (ptid))
+ lwp = GET_LWP (ptid);
+ else
+ lwp = GET_PID (ptid);
+
+ for (lp = lwp_list; lp; lp = lp->next)
+ if (lwp == GET_LWP (lp->ptid))
+ return lp;
+
+ return NULL;
+}
+
+/* Call CALLBACK with its second argument set to DATA for every LWP in
+ the list. If CALLBACK returns 1 for a particular LWP, return a
+ pointer to the structure describing that LWP immediately.
+ Otherwise return NULL. */
+
+struct lwp_info *
+iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data)
+{
+ struct lwp_info *lp, *lpnext;
+
+ for (lp = lwp_list; lp; lp = lpnext)
+ {
+ lpnext = lp->next;
+ if ((*callback) (lp, data))
+ return lp;
+ }
+
+ return NULL;
+}
+
+
+/* Implementation of the PREPARE_TO_PROCEED hook for the GNU/Linux LWP
+ layer.
+
+ Note that this implementation is potentially redundant now that
+ default_prepare_to_proceed() has been added.
+
+ FIXME This may not support switching threads after Ctrl-C
+ correctly. The default implementation does support this. */
+
+int
+lin_lwp_prepare_to_proceed (void)
+{
+ if (! ptid_equal (trap_ptid, null_ptid)
+ && ! ptid_equal (inferior_ptid, trap_ptid))
+ {
+ /* Switched over from TRAP_PID. */
+ CORE_ADDR stop_pc = read_pc ();
+ CORE_ADDR trap_pc;
+
+ /* Avoid switching where it wouldn't do any good, i.e. if both
+ threads are at the same breakpoint. */
+ trap_pc = read_pc_pid (trap_ptid);
+ if (trap_pc != stop_pc && breakpoint_here_p (trap_pc))
+ {
+ /* User hasn't deleted the breakpoint. Return non-zero, and
+ switch back to TRAP_PID. */
+ inferior_ptid = trap_ptid;
+
+ /* FIXME: Is this stuff really necessary? */
+ flush_cached_frames ();
+ registers_changed ();
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+#if 0
+static void
+lin_lwp_open (char *args, int from_tty)
+{
+ push_target (&lin_lwp_ops);
+}
+#endif
+
+/* Attach to the LWP specified by PID. If VERBOSE is non-zero, print
+ a message telling the user that a new LWP has been added to the
+ process. */
+
+void
+lin_lwp_attach_lwp (ptid_t ptid, int verbose)
+{
+ struct lwp_info *lp;
+
+ gdb_assert (is_lwp (ptid));
+
+ /* Make sure SIGCHLD is blocked. We don't want SIGCHLD events
+ to interrupt either the ptrace() or waitpid() calls below. */
+ if (! sigismember (&blocked_mask, SIGCHLD))
+ {
+ sigaddset (&blocked_mask, SIGCHLD);
+ sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+ }
+
+ if (verbose)
+ printf_filtered ("[New %s]\n", target_pid_to_str (ptid));
+
+ lp = find_lwp_pid (ptid);
+ if (lp == NULL)
+ lp = add_lwp (ptid);
+
+ /* We assume that we're already attached to any LWP that has an
+ id equal to the overall process id. */
+ if (GET_LWP (ptid) != GET_PID (ptid))
+ {
+ pid_t pid;
+ int status;
+
+ if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
+ error ("Can't attach %s: %s", target_pid_to_str (ptid),
+ strerror (errno));
+
+ pid = waitpid (GET_LWP (ptid), &status, 0);
+ if (pid == -1 && errno == ECHILD)
+ {
+ /* Try again with __WCLONE to check cloned processes. */
+ pid = waitpid (GET_LWP (ptid), &status, __WCLONE);
+ lp->cloned = 1;
+ }
+
+ gdb_assert (pid == GET_LWP (ptid)
+ && WIFSTOPPED (status) && WSTOPSIG (status));
+
+ lp->stopped = 1;
+ }
+ else
+ {
+ /* We assume that the LWP representing the original process
+ is already stopped. Mark it as stopped in the data structure
+ that the lin-lwp layer uses to keep track of threads. Note
+ that this won't have already been done since the main thread
+ will have, we assume, been stopped by an attach from a
+ different layer. */
+ lp->stopped = 1;
+ }
+}
+
+static void
+lin_lwp_attach (char *args, int from_tty)
+{
+ struct lwp_info *lp;
+ pid_t pid;
+ int status;
+
+ /* FIXME: We should probably accept a list of process id's, and
+ attach all of them. */
+ child_ops.to_attach (args, from_tty);
+
+ /* Add the initial process as the first LWP to the list. */
+ lp = add_lwp (BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)));
+
+ /* Make sure the initial process is stopped. The user-level threads
+ layer might want to poke around in the inferior, and that won't
+ work if things haven't stabilized yet. */
+ pid = waitpid (GET_PID (inferior_ptid), &status, 0);
+ if (pid == -1 && errno == ECHILD)
+ {
+ warning ("%s is a cloned process", target_pid_to_str (inferior_ptid));
+
+ /* Try again with __WCLONE to check cloned processes. */
+ pid = waitpid (GET_PID (inferior_ptid), &status, __WCLONE);
+ lp->cloned = 1;
+ }
+
+ gdb_assert (pid == GET_PID (inferior_ptid)
+ && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP);
+
+ lp->stopped = 1;
+
+ /* Fake the SIGSTOP that core GDB expects. */
+ lp->status = W_STOPCODE (SIGSTOP);
+ lp->resumed = 1;
+}
+
+static int
+detach_callback (struct lwp_info *lp, void *data)
+{
+ gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
+
+ if (debug_lin_lwp && lp->status)
+ fprintf_unfiltered (gdb_stdlog, "Pending %s for LWP %ld on detach.\n",
+ strsignal (WSTOPSIG (lp->status)), GET_LWP (lp->ptid));
+
+ while (lp->signalled && lp->stopped)
+ {
+ if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
+ WSTOPSIG (lp->status)) < 0)
+ error ("Can't continue %s: %s", target_pid_to_str (lp->ptid),
+ strerror (errno));
+
+ lp->stopped = 0;
+ lp->signalled = 0;
+ lp->status = 0;
+ stop_wait_callback (lp, NULL);
+
+ gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
+ }
+
+ /* We don't actually detach from the LWP that has an id equal to the
+ overall process id just yet. */
+ if (GET_LWP (lp->ptid) != GET_PID (lp->ptid))
+ {
+ if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0,
+ WSTOPSIG (lp->status)) < 0)
+ error ("Can't detach %s: %s", target_pid_to_str (lp->ptid),
+ strerror (errno));
+
+ delete_lwp (lp->ptid);
+ }
+
+ return 0;
+}
+
+static void
+lin_lwp_detach (char *args, int from_tty)
+{
+ iterate_over_lwps (detach_callback, NULL);
+
+ /* Only the initial process should be left right now. */
+ gdb_assert (num_lwps == 1);
+
+ trap_ptid = null_ptid;
+
+ /* Destroy LWP info; it's no longer valid. */
+ init_lwp_list ();
+
+ /* Restore the original signal mask. */
+ sigprocmask (SIG_SETMASK, &normal_mask, NULL);
+ sigemptyset (&blocked_mask);
+
+ inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
+ child_ops.to_detach (args, from_tty);
+}
+
+
+struct private_thread_info
+{
+ int lwpid;
+};
+
+/* Return non-zero if TP corresponds to the LWP specified by DATA
+ (which is assumed to be a pointer to a `struct lwp_info'. */
+
+static int
+find_lwp_callback (struct thread_info *tp, void *data)
+{
+ struct lwp_info *lp = data;
+
+ if (tp->private->lwpid == GET_LWP (lp->ptid))
+ return 1;
+
+ return 0;
+}
+
+/* Resume LP. */
+
+static int
+resume_callback (struct lwp_info *lp, void *data)
+{
+ if (lp->stopped && lp->status == 0)
+ {
+ struct thread_info *tp;
+
+#if 0
+ /* FIXME: kettenis/2000-08-26: This should really be handled
+ properly by core GDB. */
+
+ tp = find_thread_pid (lp->ptid);
+ if (tp == NULL)
+ tp = iterate_over_threads (find_lwp_callback, lp);
+ gdb_assert (tp);
+
+ /* If we were previously stepping the thread, and now continue
+ the thread we must invalidate the stepping range. However,
+ if there is a step_resume breakpoint for this thread, we must
+ preserve the stepping range to make it possible to continue
+ stepping once we hit it. */
+ if (tp->step_range_end && tp->step_resume_breakpoint == NULL)
+ {
+ gdb_assert (lp->step);
+ tp->step_range_start = tp->step_range_end = 0;
+ }
+#endif
+
+ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0);
+ lp->stopped = 0;
+ lp->step = 0;
+ }
+
+ return 0;
+}
+
+static int
+resume_clear_callback (struct lwp_info *lp, void *data)
+{
+ lp->resumed = 0;
+ return 0;
+}
+
+static int
+resume_set_callback (struct lwp_info *lp, void *data)
+{
+ lp->resumed = 1;
+ return 0;
+}
+
+static void
+lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo)
+{
+ struct lwp_info *lp;
+ int resume_all;
+
+ /* Apparently the interpretation of PID is dependent on STEP: If
+ STEP is non-zero, a specific PID means `step only this process
+ id'. But if STEP is zero, then PID means `continue *all*
+ processes, but give the signal only to this one'. */
+ resume_all = (PIDGET (ptid) == -1) || !step;
+
+ if (resume_all)
+ iterate_over_lwps (resume_set_callback, NULL);
+ else
+ iterate_over_lwps (resume_clear_callback, NULL);
+
+ /* If PID is -1, it's the current inferior that should be
+ handled specially. */
+ if (PIDGET (ptid) == -1)
+ ptid = inferior_ptid;
+
+ lp = find_lwp_pid (ptid);
+ if (lp)
+ {
+ ptid = pid_to_ptid (GET_LWP (lp->ptid));
+
+ /* Remember if we're stepping. */
+ lp->step = step;
+
+ /* Mark this LWP as resumed. */
+ lp->resumed = 1;
+
+ /* If we have a pending wait status for this thread, there is no
+ point in resuming the process. */
+ if (lp->status)
+ {
+ /* FIXME: What should we do if we are supposed to continue
+ this thread with a signal? */
+ gdb_assert (signo == TARGET_SIGNAL_0);
+ return;
+ }
+
+ /* Mark LWP as not stopped to prevent it from being continued by
+ resume_callback. */
+ lp->stopped = 0;
+ }
+
+ if (resume_all)
+ iterate_over_lwps (resume_callback, NULL);
+
+ child_resume (ptid, step, signo);
+}
+
+
+/* Send a SIGSTOP to LP. */
+
+static int
+stop_callback (struct lwp_info *lp, void *data)
+{
+ if (! lp->stopped && ! lp->signalled)
+ {
+ int ret;
+
+ ret = kill (GET_LWP (lp->ptid), SIGSTOP);
+ gdb_assert (ret == 0);
+
+ lp->signalled = 1;
+ gdb_assert (lp->status == 0);
+ }
+
+ return 0;
+}
+
+/* Wait until LP is stopped. If DATA is non-null it is interpreted as
+ a pointer to a set of signals to be flushed immediately. */
+
+static int
+stop_wait_callback (struct lwp_info *lp, void *data)
+{
+ sigset_t *flush_mask = data;
+
+ if (! lp->stopped && lp->signalled)
+ {
+ pid_t pid;
+ int status;
+
+ gdb_assert (lp->status == 0);
+
+ pid = waitpid (GET_LWP (lp->ptid), &status, lp->cloned ? __WCLONE : 0);
+ if (pid == -1 && errno == ECHILD)
+ /* OK, the proccess has disappeared. We'll catch the actual
+ exit event in lin_lwp_wait. */
+ return 0;
+
+ gdb_assert (pid == GET_LWP (lp->ptid));
+
+ if (WIFEXITED (status) || WIFSIGNALED (status))
+ {
+ gdb_assert (num_lwps > 1);
+
+ if (in_thread_list (lp->ptid))
+ {
+ /* Core GDB cannot deal with us deleting the current
+ thread. */
+ if (!ptid_equal (lp->ptid, inferior_ptid))
+ delete_thread (lp->ptid);
+ printf_unfiltered ("[%s exited]\n",
+ target_pid_to_str (lp->ptid));
+ }
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "%s exited.\n", target_pid_to_str (lp->ptid));
+
+ delete_lwp (lp->ptid);
+ return 0;
+ }
+
+ gdb_assert (WIFSTOPPED (status));
+
+ /* Ignore any signals in FLUSH_MASK. */
+ if (flush_mask && sigismember (flush_mask, WSTOPSIG (status)))
+ {
+ ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+ return stop_wait_callback (lp, flush_mask);
+ }
+
+ if (WSTOPSIG (status) != SIGSTOP)
+ {
+ if (WSTOPSIG (status) == SIGTRAP)
+ {
+ /* If a LWP other than the LWP that we're reporting an
+ event for has hit a GDB breakpoint (as opposed to
+ some random trap signal), then just arrange for it to
+ hit it again later. We don't keep the SIGTRAP status
+ and don't forward the SIGTRAP signal to the LWP. We
+ will handle the current event, eventually we will
+ resume all LWPs, and this one will get its breakpoint
+ trap again.
+
+ If we do not do this, then we run the risk that the
+ user will delete or disable the breakpoint, but the
+ thread will have already tripped on it. */
+
+ /* Now resume this LWP and get the SIGSTOP event. */
+ ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+ if (debug_lin_lwp)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "SWC: Candidate SIGTRAP event in %ld\n",
+ GET_LWP (lp->ptid));
+ }
+ /* Hold the SIGTRAP for handling by lin_lwp_wait. */
+ stop_wait_callback (lp, data);
+ /* If there's another event, throw it back into the queue. */
+ if (lp->status)
+ kill (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
+ /* Save the sigtrap event. */
+ lp->status = status;
+ return 0;
+ }
+ else
+ {
+ /* The thread was stopped with a signal other than
+ SIGSTOP, and didn't accidentally trip a breakpoint. */
+
+ if (debug_lin_lwp)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "SWC: Pending event %d in %ld\n",
+ WSTOPSIG (status), GET_LWP (lp->ptid));
+ }
+ /* Now resume this LWP and get the SIGSTOP event. */
+ ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+
+ /* Hold this event/waitstatus while we check to see if
+ there are any more (we still want to get that SIGSTOP). */
+ stop_wait_callback (lp, data);
+ /* If the lp->status field is still empty, use it to hold
+ this event. If not, then this event must be returned
+ to the event queue of the LWP. */
+ if (lp->status == 0)
+ lp->status = status;
+ else
+ kill (GET_LWP (lp->ptid), WSTOPSIG (status));
+ return 0;
+ }
+ }
+ else
+ {
+ /* We caught the SIGSTOP that we intended to catch, so
+ there's no SIGSTOP pending. */
+ lp->stopped = 1;
+ lp->signalled = 0;
+ }
+ }
+
+ return 0;
+}
+
+/* Return non-zero if LP has a wait status pending. */
+
+static int
+status_callback (struct lwp_info *lp, void *data)
+{
+ /* Only report a pending wait status if we pretend that this has
+ indeed been resumed. */
+ return (lp->status != 0 && lp->resumed);
+}
+
+/* Return non-zero if LP isn't stopped. */
+
+static int
+running_callback (struct lwp_info *lp, void *data)
+{
+ return (lp->stopped == 0);
+}
+
+/* Count the LWP's that have had events. */
+
+static int
+count_events_callback (struct lwp_info *lp, void *data)
+{
+ int *count = data;
+
+ gdb_assert (count != NULL);
+
+ /* Count only LWPs that have a SIGTRAP event pending. */
+ if (lp->status != 0
+ && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
+ (*count)++;
+
+ return 0;
+}
+
+/* Select the LWP (if any) that is currently being single-stepped. */
+
+static int
+select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
+{
+ if (lp->step && lp->status != 0)
+ return 1;
+ else
+ return 0;
+}
+
+/* Select the Nth LWP that has had a SIGTRAP event. */
+
+static int
+select_event_lwp_callback (struct lwp_info *lp, void *data)
+{
+ int *selector = data;
+
+ gdb_assert (selector != NULL);
+
+ /* Select only LWPs that have a SIGTRAP event pending. */
+ if (lp->status != 0
+ && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
+ if ((*selector)-- == 0)
+ return 1;
+
+ return 0;
+}
+
+static int
+cancel_breakpoints_callback (struct lwp_info *lp, void *data)
+{
+ struct lwp_info *event_lp = data;
+
+ /* Leave the LWP that has been elected to receive a SIGTRAP alone. */
+ if (lp == event_lp)
+ return 0;
+
+ /* If a LWP other than the LWP that we're reporting an event for has
+ hit a GDB breakpoint (as opposed to some random trap signal),
+ then just arrange for it to hit it again later. We don't keep
+ the SIGTRAP status and don't forward the SIGTRAP signal to the
+ LWP. We will handle the current event, eventually we will resume
+ all LWPs, and this one will get its breakpoint trap again.
+
+ If we do not do this, then we run the risk that the user will
+ delete or disable the breakpoint, but the LWP will have already
+ tripped on it. */
+
+ if (lp->status != 0
+ && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP
+ && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) -
+ DECR_PC_AFTER_BREAK))
+ {
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "Push back breakpoint for LWP %ld\n",
+ GET_LWP (lp->ptid));
+
+ /* Back up the PC if necessary. */
+ if (DECR_PC_AFTER_BREAK)
+ write_pc_pid (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK, lp->ptid);
+
+ /* Throw away the SIGTRAP. */
+ lp->status = 0;
+ }
+
+ return 0;
+}
+
+/* Select one LWP out of those that have events pending. */
+
+static void
+select_event_lwp (struct lwp_info **orig_lp, int *status)
+{
+ int num_events = 0;
+ int random_selector;
+ struct lwp_info *event_lp;
+
+ /* Record the wait status for the origional LWP. */
+ (*orig_lp)->status = *status;
+
+ /* Give preference to any LWP that is being single-stepped. */
+ event_lp = iterate_over_lwps (select_singlestep_lwp_callback, NULL);
+ if (event_lp != NULL)
+ {
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "Select single-step LWP %ld\n",
+ GET_LWP (event_lp->ptid));
+ }
+ else
+ {
+ /* No single-stepping LWP. Select one at random, out of those
+ which have had SIGTRAP events. */
+
+ /* First see how many SIGTRAP events we have. */
+ iterate_over_lwps (count_events_callback, &num_events);
+
+ /* Now randomly pick a LWP out of those that have had a SIGTRAP. */
+ random_selector = (int)
+ ((num_events * (double) rand ()) / (RAND_MAX + 1.0));
+
+ if (debug_lin_lwp && num_events > 1)
+ fprintf_unfiltered (gdb_stdlog,
+ "Found %d SIGTRAP events, selecting #%d\n",
+ num_events, random_selector);
+
+ event_lp = iterate_over_lwps (select_event_lwp_callback,
+ &random_selector);
+ }
+
+ if (event_lp != NULL)
+ {
+ /* Switch the event LWP. */
+ *orig_lp = event_lp;
+ *status = event_lp->status;
+ }
+
+ /* Flush the wait status for the event LWP. */
+ (*orig_lp)->status = 0;
+}
+
+/* Return non-zero if LP has been resumed. */
+
+static int
+resumed_callback (struct lwp_info *lp, void *data)
+{
+ return lp->resumed;
+}
+
+#ifdef CHILD_WAIT
+
+/* We need to override child_wait to support attaching to cloned
+ processes, since a normal wait (as done by the default version)
+ ignores those processes. */
+
+/* Wait for child PTID to do something. Return id of the child,
+ minus_one_ptid in case of error; store status into *OURSTATUS. */
+
+ptid_t
+child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+{
+ int save_errno;
+ int status;
+ pid_t pid;
+
+ do
+ {
+ set_sigint_trap (); /* Causes SIGINT to be passed on to the
+ attached process. */
+ set_sigio_trap ();
+
+ pid = waitpid (GET_PID (ptid), &status, 0);
+ if (pid == -1 && errno == ECHILD)
+ /* Try again with __WCLONE to check cloned processes. */
+ pid = waitpid (GET_PID (ptid), &status, __WCLONE);
+ save_errno = errno;
+
+ clear_sigio_trap ();
+ clear_sigint_trap ();
+ }
+ while (pid == -1 && errno == EINTR);
+
+ if (pid == -1)
+ {
+ warning ("Child process unexpectedly missing: %s", strerror (errno));
+
+ /* Claim it exited with unknown signal. */
+ ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+ ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+ return minus_one_ptid;
+ }
+
+ store_waitstatus (ourstatus, status);
+ return pid_to_ptid (pid);
+}
+
+#endif
+
+static ptid_t
+lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+{
+ struct lwp_info *lp = NULL;
+ int options = 0;
+ int status = 0;
+ pid_t pid = PIDGET (ptid);
+ sigset_t flush_mask;
+
+ sigemptyset (&flush_mask);
+
+ /* Make sure SIGCHLD is blocked. */
+ if (! sigismember (&blocked_mask, SIGCHLD))
+ {
+ sigaddset (&blocked_mask, SIGCHLD);
+ sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+ }
+
+ retry:
+
+ /* Make sure there is at least one LWP that has been resumed, at
+ least if there are any LWPs at all. */
+ gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
+
+ /* First check if there is a LWP with a wait status pending. */
+ if (pid == -1)
+ {
+ /* Any LWP that's been resumed will do. */
+ lp = iterate_over_lwps (status_callback, NULL);
+ if (lp)
+ {
+ status = lp->status;
+ lp->status = 0;
+
+ if (debug_lin_lwp && status)
+ fprintf_unfiltered (gdb_stdlog,
+ "Using pending wait status %s for LWP %ld.\n",
+ status_to_str (status), GET_LWP (lp->ptid));
+ }
+
+ /* But if we don't fine one, we'll have to wait, and check both
+ cloned and uncloned processes. We start with the cloned
+ processes. */
+ options = __WCLONE | WNOHANG;
+ }
+ else if (is_lwp (ptid))
+ {
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "Waiting for specific LWP %ld.\n",
+ GET_LWP (ptid));
+
+ /* We have a specific LWP to check. */
+ lp = find_lwp_pid (ptid);
+ gdb_assert (lp);
+ status = lp->status;
+ lp->status = 0;
+
+ if (debug_lin_lwp && status)
+ fprintf_unfiltered (gdb_stdlog,
+ "Using pending wait status %s for LWP %ld.\n",
+ status_to_str (status), GET_LWP (lp->ptid));
+
+ /* If we have to wait, take into account whether PID is a cloned
+ process or not. And we have to convert it to something that
+ the layer beneath us can understand. */
+ options = lp->cloned ? __WCLONE : 0;
+ pid = GET_LWP (ptid);
+ }
+
+ if (status && lp->signalled)
+ {
+ /* A pending SIGSTOP may interfere with the normal stream of
+ events. In a typical case where interference is a problem,
+ we have a SIGSTOP signal pending for LWP A while
+ single-stepping it, encounter an event in LWP B, and take the
+ pending SIGSTOP while trying to stop LWP A. After processing
+ the event in LWP B, LWP A is continued, and we'll never see
+ the SIGTRAP associated with the last time we were
+ single-stepping LWP A. */
+
+ /* Resume the thread. It should halt immediately returning the
+ pending SIGSTOP. */
+ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
+ TARGET_SIGNAL_0);
+ lp->stopped = 0;
+ gdb_assert (lp->resumed);
+
+ /* This should catch the pending SIGSTOP. */
+ stop_wait_callback (lp, NULL);
+ }
+
+ set_sigint_trap (); /* Causes SIGINT to be passed on to the
+ attached process. */
+ set_sigio_trap ();
+
+ while (status == 0)
+ {
+ pid_t lwpid;
+
+ lwpid = waitpid (pid, &status, options);
+ if (lwpid > 0)
+ {
+ gdb_assert (pid == -1 || lwpid == pid);
+
+ lp = find_lwp_pid (pid_to_ptid (lwpid));
+ if (! lp)
+ {
+ lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid)));
+ if (options & __WCLONE)
+ lp->cloned = 1;
+
+ if (threaded)
+ {
+ gdb_assert (WIFSTOPPED (status)
+ && WSTOPSIG (status) == SIGSTOP);
+ lp->signalled = 1;
+
+ if (! in_thread_list (inferior_ptid))
+ {
+ inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid),
+ GET_PID (inferior_ptid));
+ add_thread (inferior_ptid);
+ }
+
+ add_thread (lp->ptid);
+ printf_unfiltered ("[New %s]\n",
+ target_pid_to_str (lp->ptid));
+ }
+ }
+
+ /* Make sure we don't report a TARGET_WAITKIND_EXITED or
+ TARGET_WAITKIND_SIGNALLED event if there are still LWP's
+ left in the process. */
+ if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
+ {
+ if (in_thread_list (lp->ptid))
+ {
+ /* Core GDB cannot deal with us deleting the current
+ thread. */
+ if (! ptid_equal (lp->ptid, inferior_ptid))
+ delete_thread (lp->ptid);
+ printf_unfiltered ("[%s exited]\n",
+ target_pid_to_str (lp->ptid));
+ }
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "%s exited.\n",
+ target_pid_to_str (lp->ptid));
+
+ delete_lwp (lp->ptid);
+
+ /* Make sure there is at least one thread running. */
+ gdb_assert (iterate_over_lwps (running_callback, NULL));
+
+ /* Discard the event. */
+ status = 0;
+ continue;
+ }
+
+ /* Make sure we don't report a SIGSTOP that we sent
+ ourselves in an attempt to stop an LWP. */
+ if (lp->signalled && WIFSTOPPED (status)
+ && WSTOPSIG (status) == SIGSTOP)
+ {
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "Delayed SIGSTOP caught for %s.\n",
+ target_pid_to_str (lp->ptid));
+
+ /* This is a delayed SIGSTOP. */
+ lp->signalled = 0;
+
+ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step,
+ TARGET_SIGNAL_0);
+ lp->stopped = 0;
+ gdb_assert (lp->resumed);
+
+ /* Discard the event. */
+ status = 0;
+ continue;
+ }
+
+ break;
+ }
+
+ if (pid == -1)
+ {
+ /* Alternate between checking cloned and uncloned processes. */
+ options ^= __WCLONE;
+
+ /* And suspend every time we have checked both. */
+ if (options & __WCLONE)
+ sigsuspend (&suspend_mask);
+ }
+
+ /* We shouldn't end up here unless we want to try again. */
+ gdb_assert (status == 0);
+ }
+
+ clear_sigio_trap ();
+ clear_sigint_trap ();
+
+ gdb_assert (lp);
+
+ /* Don't report signals that GDB isn't interested in, such as
+ signals that are neither printed nor stopped upon. Stopping all
+ threads can be a bit time-consuming so if we want decent
+ performance with heavily multi-threaded programs, especially when
+ they're using a high frequency timer, we'd better avoid it if we
+ can. */
+
+ if (WIFSTOPPED (status))
+ {
+ int signo = target_signal_from_host (WSTOPSIG (status));
+
+ if (signal_stop_state (signo) == 0
+ && signal_print_state (signo) == 0
+ && signal_pass_state (signo) == 1)
+ {
+ /* FIMXE: kettenis/2001-06-06: Should we resume all threads
+ here? It is not clear we should. GDB may not expect
+ other threads to run. On the other hand, not resuming
+ newly attached threads may cause an unwanted delay in
+ getting them running. */
+ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo);
+ lp->stopped = 0;
+ status = 0;
+ goto retry;
+ }
+
+ if (signo == TARGET_SIGNAL_INT
+ && signal_pass_state (signo) == 0)
+ {
+ /* If ^C/BREAK is typed at the tty/console, SIGINT gets
+ forwarded to the entire process group, that is, all LWP's
+ will receive it. Since we only want to report it once,
+ we try to flush it from all LWPs except this one. */
+ sigaddset (&flush_mask, SIGINT);
+ }
+ }
+
+ /* This LWP is stopped now. */
+ lp->stopped = 1;
+
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog, "Candidate event %s in LWP %ld.\n",
+ status_to_str (status), GET_LWP (lp->ptid));
+
+ /* Now stop all other LWP's ... */
+ iterate_over_lwps (stop_callback, NULL);
+
+ /* ... and wait until all of them have reported back that they're no
+ longer running. */
+ iterate_over_lwps (stop_wait_callback, &flush_mask);
+
+ /* If we're not waiting for a specific LWP, choose an event LWP from
+ among those that have had events. Giving equal priority to all
+ LWPs that have had events helps prevent starvation. */
+ if (pid == -1)
+ select_event_lwp (&lp, &status);
+
+ /* Now that we've selected our final event LWP, cancel any
+ breakpoints in other LWPs that have hit a GDB breakpoint. See
+ the comment in cancel_breakpoints_callback to find out why. */
+ iterate_over_lwps (cancel_breakpoints_callback, lp);
+
+ /* If we're not running in "threaded" mode, we'll report the bare
+ process id. */
+
+ if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP)
+ {
+ trap_ptid = (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog,
+ "LLW: trap_ptid is %ld\n",
+ GET_LWP (trap_ptid));
+ }
+ else
+ trap_ptid = null_ptid;
+
+ store_waitstatus (ourstatus, status);
+ return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
+}
+
+static int
+kill_callback (struct lwp_info *lp, void *data)
+{
+ ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0);
+ return 0;
+}
+
+static int
+kill_wait_callback (struct lwp_info *lp, void *data)
+{
+ pid_t pid;
+
+ /* We must make sure that there are no pending events (delayed
+ SIGSTOPs, pending SIGTRAPs, etc.) to make sure the current
+ program doesn't interfere with any following debugging session. */
+
+ /* For cloned processes we must check both with __WCLONE and
+ without, since the exit status of a cloned process isn't reported
+ with __WCLONE. */
+ if (lp->cloned)
+ {
+ do
+ {
+ pid = waitpid (GET_LWP (lp->ptid), NULL, __WCLONE);
+ }
+ while (pid == GET_LWP (lp->ptid));
+
+ gdb_assert (pid == -1 && errno == ECHILD);
+ }
+
+ do
+ {
+ pid = waitpid (GET_LWP (lp->ptid), NULL, 0);
+ }
+ while (pid == GET_LWP (lp->ptid));
+
+ gdb_assert (pid == -1 && errno == ECHILD);
+ return 0;
+}
+
+static void
+lin_lwp_kill (void)
+{
+ /* Kill all LWP's ... */
+ iterate_over_lwps (kill_callback, NULL);
+
+ /* ... and wait until we've flushed all events. */
+ iterate_over_lwps (kill_wait_callback, NULL);
+
+ target_mourn_inferior ();
+}
+
+static void
+lin_lwp_create_inferior (char *exec_file, char *allargs, char **env)
+{
+ child_ops.to_create_inferior (exec_file, allargs, env);
+}
+
+static void
+lin_lwp_mourn_inferior (void)
+{
+ trap_ptid = null_ptid;
+
+ /* Destroy LWP info; it's no longer valid. */
+ init_lwp_list ();
+
+ /* Restore the original signal mask. */
+ sigprocmask (SIG_SETMASK, &normal_mask, NULL);
+ sigemptyset (&blocked_mask);
+
+ child_ops.to_mourn_inferior ();
+}
+
+static void
+lin_lwp_fetch_registers (int regno)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ if (is_lwp (inferior_ptid))
+ inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
+
+ fetch_inferior_registers (regno);
+
+ do_cleanups (old_chain);
+}
+
+static void
+lin_lwp_store_registers (int regno)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ if (is_lwp (inferior_ptid))
+ inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
+
+ store_inferior_registers (regno);
+
+ do_cleanups (old_chain);
+}
+
+static int
+lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+ int xfer;
+
+ if (is_lwp (inferior_ptid))
+ inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
+
+ xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+
+ do_cleanups (old_chain);
+ return xfer;
+}
+
+static int
+lin_lwp_thread_alive (ptid_t ptid)
+{
+ gdb_assert (is_lwp (ptid));
+
+ errno = 0;
+ ptrace (PTRACE_PEEKUSER, GET_LWP (ptid), 0, 0);
+ if (errno)
+ return 0;
+
+ return 1;
+}
+
+static char *
+lin_lwp_pid_to_str (ptid_t ptid)
+{
+ static char buf[64];
+
+ if (is_lwp (ptid))
+ {
+ snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid));
+ return buf;
+ }
+
+ return normal_pid_to_str (ptid);
+}
+
+static void
+init_lin_lwp_ops (void)
+{
+#if 0
+ lin_lwp_ops.to_open = lin_lwp_open;
+#endif
+ lin_lwp_ops.to_shortname = "lwp-layer";
+ lin_lwp_ops.to_longname = "lwp-layer";
+ lin_lwp_ops.to_doc = "Low level threads support (LWP layer)";
+ lin_lwp_ops.to_attach = lin_lwp_attach;
+ lin_lwp_ops.to_detach = lin_lwp_detach;
+ lin_lwp_ops.to_resume = lin_lwp_resume;
+ lin_lwp_ops.to_wait = lin_lwp_wait;
+ lin_lwp_ops.to_fetch_registers = lin_lwp_fetch_registers;
+ lin_lwp_ops.to_store_registers = lin_lwp_store_registers;
+ lin_lwp_ops.to_xfer_memory = lin_lwp_xfer_memory;
+ lin_lwp_ops.to_kill = lin_lwp_kill;
+ lin_lwp_ops.to_create_inferior = lin_lwp_create_inferior;
+ lin_lwp_ops.to_mourn_inferior = lin_lwp_mourn_inferior;
+ lin_lwp_ops.to_thread_alive = lin_lwp_thread_alive;
+ lin_lwp_ops.to_pid_to_str = lin_lwp_pid_to_str;
+ lin_lwp_ops.to_stratum = thread_stratum;
+ lin_lwp_ops.to_has_thread_control = tc_schedlock;
+ lin_lwp_ops.to_magic = OPS_MAGIC;
+}
+
+static void
+sigchld_handler (int signo)
+{
+ /* Do nothing. The only reason for this handler is that it allows
+ us to use sigsuspend in lin_lwp_wait above to wait for the
+ arrival of a SIGCHLD. */
+}
+
+void
+_initialize_lin_lwp (void)
+{
+ struct sigaction action;
+
+ extern void thread_db_init (struct target_ops *);
+
+ init_lin_lwp_ops ();
+ add_target (&lin_lwp_ops);
+ thread_db_init (&lin_lwp_ops);
+
+ /* Save the original signal mask. */
+ sigprocmask (SIG_SETMASK, NULL, &normal_mask);
+
+ action.sa_handler = sigchld_handler;
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = 0;
+ sigaction (SIGCHLD, &action, NULL);
+
+ /* Make sure we don't block SIGCHLD during a sigsuspend. */
+ sigprocmask (SIG_SETMASK, NULL, &suspend_mask);
+ sigdelset (&suspend_mask, SIGCHLD);
+
+ sigemptyset (&blocked_mask);
+
+ add_show_from_set (add_set_cmd ("lin-lwp", no_class, var_zinteger,
+ (char *) &debug_lin_lwp,
+ "Set debugging of GNU/Linux lwp module.\n\
+Enables printf debugging output.\n",
+ &setdebuglist),
+ &showdebuglist);
+}
+
+
+/* FIXME: kettenis/2000-08-26: The stuff on this page is specific to
+ the GNU/Linux Threads library and therefore doesn't really belong
+ here. */
+
+/* Read variable NAME in the target and return its value if found.
+ Otherwise return zero. It is assumed that the type of the variable
+ is `int'. */
+
+static int
+get_signo (const char *name)
+{
+ struct minimal_symbol *ms;
+ int signo;
+
+ ms = lookup_minimal_symbol (name, NULL, NULL);
+ if (ms == NULL)
+ return 0;
+
+ if (target_read_memory (SYMBOL_VALUE_ADDRESS (ms), (char *) &signo,
+ sizeof (signo)) != 0)
+ return 0;
+
+ return signo;
+}
+
+/* Return the set of signals used by the threads library in *SET. */
+
+void
+lin_thread_get_thread_signals (sigset_t *set)
+{
+ struct sigaction action;
+ int restart, cancel;
+
+ sigemptyset (set);
+
+ restart = get_signo ("__pthread_sig_restart");
+ if (restart == 0)
+ return;
+
+ cancel = get_signo ("__pthread_sig_cancel");
+ if (cancel == 0)
+ return;
+
+ sigaddset (set, restart);
+ sigaddset (set, cancel);
+
+ /* The GNU/Linux Threads library makes terminating threads send a
+ special "cancel" signal instead of SIGCHLD. Make sure we catch
+ those (to prevent them from terminating GDB itself, which is
+ likely to be their default action) and treat them the same way as
+ SIGCHLD. */
+
+ action.sa_handler = sigchld_handler;
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = 0;
+ sigaction (cancel, &action, NULL);
+
+ /* We block the "cancel" signal throughout this code ... */
+ sigaddset (&blocked_mask, cancel);
+ sigprocmask (SIG_BLOCK, &blocked_mask, NULL);
+
+ /* ... except during a sigsuspend. */
+ sigdelset (&suspend_mask, cancel);
+}
diff --git a/contrib/gdb/gdb/linespec.c b/contrib/gdb/gdb/linespec.c
new file mode 100644
index 0000000..ca9d01d
--- /dev/null
+++ b/contrib/gdb/gdb/linespec.c
@@ -0,0 +1,1273 @@
+/* Parser for linespec for the GNU debugger, GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "symtab.h"
+#include "frame.h"
+#include "command.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "demangle.h"
+#include "value.h"
+#include "completer.h"
+#include "cp-abi.h"
+
+/* Prototype for one function in parser-defs.h,
+ instead of including that entire file. */
+
+extern char *find_template_name_end (char *);
+
+/* We share this one with symtab.c, but it is not exported widely. */
+
+extern char *operator_chars (char *, char **);
+
+/* Prototypes for local functions */
+
+static void cplusplus_error (const char *name, const char *fmt, ...) ATTR_FORMAT (printf, 2, 3);
+
+static int total_number_of_methods (struct type *type);
+
+static int find_methods (struct type *, char *, struct symbol **);
+
+static void build_canonical_line_spec (struct symtab_and_line *,
+ char *, char ***);
+
+static char *find_toplevel_char (char *s, char c);
+
+static struct symtabs_and_lines decode_line_2 (struct symbol *[],
+ int, int, char ***);
+
+/* Helper functions. */
+
+/* Issue a helpful hint on using the command completion feature on
+ single quoted demangled C++ symbols as part of the completion
+ error. */
+
+static void
+cplusplus_error (const char *name, const char *fmt, ...)
+{
+ struct ui_file *tmp_stream;
+ tmp_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_stream);
+
+ {
+ va_list args;
+ va_start (args, fmt);
+ vfprintf_unfiltered (tmp_stream, fmt, args);
+ va_end (args);
+ }
+
+ while (*name == '\'')
+ name++;
+ fprintf_unfiltered (tmp_stream,
+ ("Hint: try '%s<TAB> or '%s<ESC-?>\n"
+ "(Note leading single quote.)"),
+ name, name);
+ error_stream (tmp_stream);
+}
+
+/* Return the number of methods described for TYPE, including the
+ methods from types it derives from. This can't be done in the symbol
+ 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 (struct type *type)
+{
+ int n;
+ int count;
+
+ CHECK_TYPEDEF (type);
+ if (TYPE_CPLUS_SPECIFIC (type) == NULL)
+ return 0;
+ count = TYPE_NFN_FIELDS_TOTAL (type);
+
+ for (n = 0; n < TYPE_N_BASECLASSES (type); n++)
+ count += total_number_of_methods (TYPE_BASECLASS (type, n));
+
+ return count;
+}
+
+/* Recursive helper function for decode_line_1.
+ Look for methods named NAME in type T.
+ Return number of matches.
+ Put matches in SYM_ARR, which should have been allocated with
+ a size of total_number_of_methods (T) * sizeof (struct symbol *).
+ Note that this function is g++ specific. */
+
+static int
+find_methods (struct type *t, char *name, struct symbol **sym_arr)
+{
+ int i1 = 0;
+ int ibase;
+ char *class_name = type_name_no_tag (t);
+
+ /* Ignore this class if it doesn't have a name. This is ugly, but
+ unless we figure out how to get the physname without the name of
+ the class, then the loop can't do any good. */
+ if (class_name
+ && (lookup_symbol (class_name, (struct block *) NULL,
+ STRUCT_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL)))
+ {
+ int method_counter;
+
+ CHECK_TYPEDEF (t);
+
+ /* 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. */
+
+ for (method_counter = TYPE_NFN_FIELDS (t) - 1;
+ method_counter >= 0;
+ --method_counter)
+ {
+ int field_counter;
+ char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter);
+ char dem_opname[64];
+
+ 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;
+ else if (cplus_demangle_opname (method_name, dem_opname, 0))
+ method_name = dem_opname;
+ }
+
+ if (strcmp_iw (name, method_name) == 0)
+ /* Find all the overloaded methods with that name. */
+ for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
+ field_counter >= 0;
+ --field_counter)
+ {
+ struct fn_field *f;
+ char *phys_name;
+
+ f = TYPE_FN_FIELDLIST1 (t, method_counter);
+
+ if (TYPE_FN_FIELD_STUB (f, field_counter))
+ {
+ char *tmp_name;
+
+ tmp_name = gdb_mangle_name (t,
+ method_counter,
+ field_counter);
+ phys_name = alloca (strlen (tmp_name) + 1);
+ strcpy (phys_name, tmp_name);
+ xfree (tmp_name);
+ }
+ else
+ phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
+
+ /* Destructor is handled by caller, dont add it to the list */
+ if (is_destructor_name (phys_name) != 0)
+ continue;
+
+ sym_arr[i1] = lookup_symbol (phys_name,
+ NULL, VAR_NAMESPACE,
+ (int *) NULL,
+ (struct symtab **) NULL);
+ if (sym_arr[i1])
+ i1++;
+ else
+ {
+ /* This error message gets printed, but the method
+ still seems to be found
+ fputs_filtered("(Cannot find method ", gdb_stdout);
+ fprintf_symbol_filtered (gdb_stdout, phys_name,
+ language_cplus,
+ DMGL_PARAMS | DMGL_ANSI);
+ fputs_filtered(" - possibly inlined.)\n", gdb_stdout);
+ */
+ }
+ }
+ else if (strcmp_iw (class_name, name) == 0)
+ {
+ /* For GCC 3.x and stabs, constructors and destructors have names
+ like __base_ctor and __complete_dtor. Check the physname for now
+ if we're looking for a constructor. */
+ for (field_counter
+ = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
+ field_counter >= 0;
+ --field_counter)
+ {
+ struct fn_field *f;
+ char *phys_name;
+
+ f = TYPE_FN_FIELDLIST1 (t, method_counter);
+
+ /* GCC 3.x will never produce stabs stub methods, so we don't need
+ to handle this case. */
+ if (TYPE_FN_FIELD_STUB (f, field_counter))
+ continue;
+ phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
+ if (! is_constructor_name (phys_name))
+ continue;
+
+ /* If this method is actually defined, include it in the
+ list. */
+ sym_arr[i1] = lookup_symbol (phys_name,
+ NULL, VAR_NAMESPACE,
+ (int *) NULL,
+ (struct symtab **) NULL);
+ if (sym_arr[i1])
+ i1++;
+ }
+ }
+ }
+ }
+
+ /* Only search baseclasses if there is no match yet, since names in
+ derived classes override those in baseclasses.
+
+ FIXME: The above is not true; it is only true of member functions
+ if they have the same number of arguments (??? - section 13.1 of the
+ ARM says the function members are not in the same scope but doesn't
+ really spell out the rules in a way I understand. In any case, if
+ the number of arguments differ this is a case in which we can overload
+ rather than hiding without any problem, and gcc 2.4.5 does overload
+ rather than hiding in this case). */
+
+ if (i1 == 0)
+ for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
+ i1 += find_methods (TYPE_BASECLASS (t, ibase), name, sym_arr + i1);
+
+ return i1;
+}
+
+/* Helper function for decode_line_1.
+ Build a canonical line spec in CANONICAL if it is non-NULL and if
+ the SAL has a symtab.
+ If SYMNAME is non-NULL the canonical line spec is `filename:symname'.
+ If SYMNAME is NULL the line number from SAL is used and the canonical
+ line spec is `filename:linenum'. */
+
+static void
+build_canonical_line_spec (struct symtab_and_line *sal, char *symname,
+ char ***canonical)
+{
+ char **canonical_arr;
+ char *canonical_name;
+ char *filename;
+ struct symtab *s = sal->symtab;
+
+ if (s == (struct symtab *) NULL
+ || s->filename == (char *) NULL
+ || canonical == (char ***) NULL)
+ return;
+
+ canonical_arr = (char **) xmalloc (sizeof (char *));
+ *canonical = canonical_arr;
+
+ filename = s->filename;
+ if (symname != NULL)
+ {
+ canonical_name = xmalloc (strlen (filename) + strlen (symname) + 2);
+ sprintf (canonical_name, "%s:%s", filename, symname);
+ }
+ else
+ {
+ canonical_name = xmalloc (strlen (filename) + 30);
+ sprintf (canonical_name, "%s:%d", filename, sal->line);
+ }
+ canonical_arr[0] = canonical_name;
+}
+
+
+
+/* Find an instance of the character C in the string S that is outside
+ of all parenthesis pairs, single-quoted strings, and double-quoted
+ strings. */
+static char *
+find_toplevel_char (char *s, char c)
+{
+ int quoted = 0; /* zero if we're not in quotes;
+ '"' if we're in a double-quoted string;
+ '\'' if we're in a single-quoted string. */
+ int depth = 0; /* number of unclosed parens we've seen */
+ char *scan;
+
+ for (scan = s; *scan; scan++)
+ {
+ if (quoted)
+ {
+ if (*scan == quoted)
+ quoted = 0;
+ else if (*scan == '\\' && *(scan + 1))
+ scan++;
+ }
+ else if (*scan == c && ! quoted && depth == 0)
+ return scan;
+ else if (*scan == '"' || *scan == '\'')
+ quoted = *scan;
+ else if (*scan == '(')
+ depth++;
+ else if (*scan == ')' && depth > 0)
+ depth--;
+ }
+
+ return 0;
+}
+
+/* Given a list of NELTS symbols in SYM_ARR, return a list of lines to
+ operate on (ask user if necessary).
+ If CANONICAL is non-NULL return a corresponding array of mangled names
+ as canonical line specs there. */
+
+static struct symtabs_and_lines
+decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
+ char ***canonical)
+{
+ struct symtabs_and_lines values, return_values;
+ char *args, *arg1;
+ int i;
+ char *prompt;
+ char *symname;
+ struct cleanup *old_chain;
+ 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));
+ old_chain = make_cleanup (xfree, return_values.sals);
+
+ if (canonical)
+ {
+ canonical_arr = (char **) xmalloc (nelts * sizeof (char *));
+ make_cleanup (xfree, canonical_arr);
+ memset (canonical_arr, 0, nelts * sizeof (char *));
+ *canonical = canonical_arr;
+ }
+
+ i = 0;
+ printf_unfiltered ("[0] cancel\n[1] all\n");
+ while (i < nelts)
+ {
+ INIT_SAL (&return_values.sals[i]); /* initialize to zeroes */
+ INIT_SAL (&values.sals[i]);
+ if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
+ {
+ values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
+ printf_unfiltered ("[%d] %s at %s:%d\n",
+ (i + 2),
+ SYMBOL_SOURCE_NAME (sym_arr[i]),
+ values.sals[i].symtab->filename,
+ values.sals[i].line);
+ }
+ else
+ 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");
+
+ i = 0;
+ while (*args)
+ {
+ int num;
+
+ arg1 = args;
+ while (*arg1 >= '0' && *arg1 <= '9')
+ arg1++;
+ if (*arg1 && *arg1 != ' ' && *arg1 != '\t')
+ error ("Arguments must be choice numbers.");
+
+ num = atoi (args);
+
+ if (num == 0)
+ error ("canceled");
+ else if (num == 1)
+ {
+ if (canonical_arr)
+ {
+ for (i = 0; i < nelts; i++)
+ {
+ if (canonical_arr[i] == NULL)
+ {
+ symname = SYMBOL_NAME (sym_arr[i]);
+ canonical_arr[i] = savestring (symname, strlen (symname));
+ }
+ }
+ }
+ memcpy (return_values.sals, values.sals,
+ (nelts * sizeof (struct symtab_and_line)));
+ return_values.nelts = nelts;
+ discard_cleanups (old_chain);
+ return return_values;
+ }
+
+ if (num >= nelts + 2)
+ {
+ printf_unfiltered ("No choice number %d.\n", num);
+ }
+ else
+ {
+ num -= 2;
+ if (values.sals[num].pc)
+ {
+ if (canonical_arr)
+ {
+ symname = SYMBOL_NAME (sym_arr[num]);
+ make_cleanup (xfree, symname);
+ canonical_arr[i] = savestring (symname, strlen (symname));
+ }
+ return_values.sals[i++] = values.sals[num];
+ values.sals[num].pc = 0;
+ }
+ else
+ {
+ printf_unfiltered ("duplicate request for %d ignored.\n", num);
+ }
+ }
+
+ args = arg1;
+ while (*args == ' ' || *args == '\t')
+ args++;
+ }
+ return_values.nelts = i;
+ discard_cleanups (old_chain);
+ return return_values;
+}
+
+/* The parser of linespec itself. */
+
+/* Parse a string that specifies a line number.
+ Pass the address of a char * variable; that variable will be
+ advanced over the characters actually parsed.
+
+ The string can be:
+
+ 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.
+ VARIABLE -- line number of definition of that variable.
+ PC returned is 0.
+ FILE:FUNCTION -- likewise, but prefer functions in that file.
+ *EXPR -- line in which address EXPR appears.
+
+ This may all be followed by an "if EXPR", which we ignore.
+
+ FUNCTION may be an undebuggable function found in minimal symbol table.
+
+ If the argument FUNFIRSTLINE is nonzero, we want the first line
+ of real code inside a function when a function is specified, and it is
+ not OK to specify a variable or type to get its line number.
+
+ DEFAULT_SYMTAB specifies the file to use if none is specified.
+ It defaults to current_source_symtab.
+ DEFAULT_LINE specifies the line number to use for relative
+ line numbers (that start with signs). Defaults to current_source_line.
+ If CANONICAL is non-NULL, store an array of strings containing the canonical
+ line specs there if necessary. Currently overloaded member functions and
+ line numbers or static functions without a filename yield a canonical
+ line spec. The array and the line spec strings are allocated on the heap,
+ it is the callers responsibility to free them.
+
+ Note that it is possible to return zero for the symtab
+ if no file is validly specified. Callers must check that.
+ Also, the line number returned may be invalid. */
+
+/* We allow single quotes in various places. This is a hideous
+ kludge, which exists because the completer can't yet deal with the
+ lack of single quotes. FIXME: write a linespec_completer which we
+ can use as appropriate instead of make_symbol_completion_list. */
+
+struct symtabs_and_lines
+decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
+ int default_line, char ***canonical)
+{
+ struct symtabs_and_lines values;
+ struct symtab_and_line val;
+ register char *p, *p1;
+ char *q, *pp, *ii, *p2;
+#if 0
+ char *q1;
+#endif
+ register struct symtab *s;
+
+ register struct symbol *sym;
+ /* The symtab that SYM was found in. */
+ struct symtab *sym_symtab;
+
+ register CORE_ADDR pc;
+ register struct minimal_symbol *msymbol;
+ char *copy;
+ struct symbol *sym_class;
+ int i1;
+ int is_quoted;
+ int is_quote_enclosed;
+ 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 */
+
+ /* Defaults have defaults. */
+
+ if (default_symtab == 0)
+ {
+ default_symtab = current_source_symtab;
+ default_line = current_source_line;
+ }
+
+ /* See if arg is *PC */
+
+ if (**argptr == '*')
+ {
+ (*argptr)++;
+ pc = parse_and_eval_address_1 (argptr);
+
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+
+ values.nelts = 1;
+ values.sals[0] = find_pc_line (pc, 0);
+ values.sals[0].pc = pc;
+ values.sals[0].section = find_pc_overlay (pc);
+
+ return values;
+ }
+
+ /* '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)
+ 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';
+ }
+
+ /* Set various flags.
+ * 'has_parens' is important for overload checking, where
+ * we allow things like:
+ * (gdb) break c::f(int)
+ */
+
+ /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
+
+ is_quoted = (**argptr
+ && strchr (get_gdb_completer_quote_characters (),
+ **argptr) != NULL);
+
+ has_parens = ((pp = strchr (*argptr, '(')) != NULL
+ && (pp = strrchr (pp, ')')) != NULL);
+
+ /* Now that we're safely past the has_parens check,
+ * put back " if (condition)" so outer layers can see it
+ */
+ if (has_if)
+ *ii = ' ';
+
+ /* 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.
+
+ Don't count commas that appear in argument lists of overloaded
+ functions, or in quoted strings. It's stupid to go to this much
+ trouble when the rest of the function is such an obvious roach hotel. */
+ ii = find_toplevel_char (*argptr, ',');
+ has_comma = (ii != 0);
+
+ /* Temporarily zap out second half to not
+ * confuse the code below.
+ * This is undone below. Do not change ii!!
+ */
+ if (has_comma)
+ {
+ *ii = '\0';
+ }
+
+ /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
+ /* May also be CLASS::MEMBER, or NAMESPACE::NAME */
+ /* Look for ':', but ignore inside of <> */
+
+ s = NULL;
+ p = *argptr;
+ if (p[0] == '"')
+ {
+ is_quote_enclosed = 1;
+ (*argptr)++;
+ p++;
+ }
+ else
+ is_quote_enclosed = 0;
+ for (; *p; p++)
+ {
+ if (p[0] == '<')
+ {
+ 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. */
+ {
+ /* Find the *last* '.', since the others are package qualifiers. */
+ for (p1 = p; *p1; p1++)
+ {
+ if (*p1 == '.')
+ p = p1;
+ }
+ break;
+ }
+ }
+ while (p[0] == ' ' || p[0] == '\t')
+ p++;
+
+ /* if the closing double quote was left at the end, remove it */
+ if (is_quote_enclosed)
+ {
+ char *closing_quote = strchr (p - 1, '"');
+ if (closing_quote && closing_quote[1] == '\0')
+ *closing_quote = '\0';
+ }
+
+ /* Now that we've safely parsed the first half,
+ * put back ',' so outer layers can see it
+ */
+ if (has_comma)
+ *ii = ',';
+
+ if ((p[0] == ':' || p[0] == '.') && !has_parens)
+ {
+ /* C++ */
+ /* ... or Java */
+ if (is_quoted)
+ *argptr = *argptr + 1;
+ if (p[0] == '.' || p[1] == ':')
+ {
+ 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 (p[0] == ':'
+ && ((*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 (get_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)
+ {
+ cplusplus_error (saved_arg, "no mangling for \"%s\"\n", tmp);
+ }
+ 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 (get_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 (is_operator_name (copy))
+ {
+ tmp = (char *) alloca (strlen (copy + 3) + 9);
+ strcpy (tmp, "operator ");
+ strcat (tmp, copy + 3);
+ }
+ else
+ tmp = copy;
+ if (tmp[0] == '~')
+ cplusplus_error (saved_arg,
+ "the class `%s' does not have destructor defined\n",
+ SYMBOL_SOURCE_NAME (sym_class));
+ else
+ cplusplus_error (saved_arg,
+ "the class %s does not have any method named %s\n",
+ SYMBOL_SOURCE_NAME (sym_class), tmp);
+ }
+ }
+
+ /* 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 */
+ /* The quotes are important if copy is empty. */
+ cplusplus_error (saved_arg,
+ "Can't find member of namespace, class, struct, or union named \"%s\"\n",
+ copy);
+ }
+ /* end of C++ */
+
+
+ /* Extract the file name. */
+ p1 = 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;
+ }
+ else
+ {
+ memcpy (copy, *argptr, p - *argptr);
+ copy[p - *argptr] = 0;
+ }
+
+ /* Find that file's data. */
+ s = lookup_symtab (copy);
+ if (s == 0)
+ {
+ if (!have_full_symbols () && !have_partial_symbols ())
+ error ("No symbol table is loaded. Use the \"file\" command.");
+ error ("No source file named %s.", copy);
+ }
+
+ /* Discard the file name from the arg. */
+ p = p1 + 1;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ *argptr = p;
+ }
+#if 0
+ /* No one really seems to know why this was added. It certainly
+ breaks the command line, though, whenever the passed
+ name is of the form ClassName::Method. This bit of code
+ singles out the class name, and if funfirstline is set (for
+ 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;
+ }
+ /* 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.
+ arg no longer contains the file name. */
+
+ /* Check whether arg is all digits (and sign) */
+
+ q = *argptr;
+ 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;
+
+ /* 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 */
+
+ if (s == 0 && default_symtab == 0)
+ {
+ select_source_symtab (0);
+ default_symtab = current_source_symtab;
+ default_line = current_source_line;
+ }
+
+ if (**argptr == '+')
+ sign = plus, (*argptr)++;
+ else if (**argptr == '-')
+ sign = minus, (*argptr)++;
+ val.line = atoi (*argptr);
+ switch (sign)
+ {
+ case plus:
+ if (q == *argptr)
+ val.line = 5;
+ if (s == 0)
+ val.line = default_line + val.line;
+ break;
+ case minus:
+ if (q == *argptr)
+ val.line = 15;
+ if (s == 0)
+ val.line = default_line - val.line;
+ else
+ val.line = 1;
+ break;
+ case none:
+ break; /* No need to adjust val.line. */
+ }
+
+ 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. */
+ 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));
+ values.sals[0] = val;
+ values.nelts = 1;
+ if (need_canonical)
+ build_canonical_line_spec (values.sals, NULL, canonical);
+ return values;
+ }
+
+ /* Arg token is not digits => try it as a variable name
+ 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 */
+ else if (is_quoted)
+ {
+ p = skip_quoted (*argptr);
+ if (p[-1] != '\'')
+ error ("Unmatched single quote.");
+ }
+ else if (has_parens)
+ {
+ p = pp + 1;
+ }
+ else
+ {
+ p = skip_quoted (*argptr);
+ }
+
+ copy = (char *) alloca (p - *argptr + 1);
+ memcpy (copy, *argptr, p - *argptr);
+ copy[p - *argptr] = '\0';
+ if (p != *argptr
+ && copy[0]
+ && copy[0] == copy[p - *argptr - 1]
+ && strchr (get_gdb_completer_quote_characters (), copy[0]) != NULL)
+ {
+ copy[p - *argptr - 1] = '\0';
+ copy++;
+ }
+ 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 */
+
+ if (*copy == '$')
+ {
+ struct value *valx;
+ int index = 0;
+ int need_canonical = 0;
+
+ 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, NULL, NULL);
+ /* 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[0] = val;
+ values.nelts = 1;
+
+ if (need_canonical)
+ build_canonical_line_spec (values.sals, NULL, canonical);
+
+ return values;
+ }
+
+
+ /* Look up that token as a variable.
+ If file specified, use that file's per-file block to start with. */
+
+ sym = lookup_symbol (copy,
+ (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" */
+
+ if (sym != NULL)
+ {
+ if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ {
+ /* Arg is the name of a function */
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+ values.sals[0] = find_function_start_sal (sym, funfirstline);
+ values.nelts = 1;
+
+ /* Don't use the SYMBOL_LINE; if used at all it points to
+ the line containing the parameters or thereabouts, not
+ the first line of code. */
+
+ /* We might need a canonical line spec if it is a static
+ function. */
+ if (s == 0)
+ {
+ struct blockvector *bv = BLOCKVECTOR (sym_symtab);
+ struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ if (lookup_block_symbol (b, copy, VAR_NAMESPACE) != NULL)
+ build_canonical_line_spec (values.sals, copy, canonical);
+ }
+ return values;
+ }
+ else
+ {
+ if (funfirstline)
+ error ("\"%s\" is not a function", copy);
+ else if (SYMBOL_LINE (sym) != 0)
+ {
+ /* We know its line number. */
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+ values.nelts = 1;
+ memset (&values.sals[0], 0, sizeof (values.sals[0]));
+ values.sals[0].symtab = sym_symtab;
+ values.sals[0].line = SYMBOL_LINE (sym);
+ return values;
+ }
+ else
+ /* This can happen if it is compiled with a compiler which doesn't
+ put out line numbers for variables. */
+ /* FIXME: Shouldn't we just set .line and .symtab to zero
+ and return? For example, "info line foo" could print
+ the address. */
+ error ("Line number not known for symbol \"%s\"", copy);
+ }
+ }
+
+ msymbol = lookup_minimal_symbol (copy, NULL, NULL);
+
+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].section = SYMBOL_BFD_SECTION (msymbol);
+ if (funfirstline)
+ {
+ values.sals[0].pc += FUNCTION_START_OFFSET;
+ values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
+ }
+ values.nelts = 1;
+ return values;
+ }
+
+ if (!have_full_symbols () &&
+ !have_partial_symbols () && !have_minimal_symbols ())
+ error ("No symbol table is loaded. Use the \"file\" command.");
+
+ error ("Function \"%s\" not defined.", copy);
+ return values; /* for lint */
+}
diff --git a/contrib/gdb/gdb/linespec.h b/contrib/gdb/gdb/linespec.h
new file mode 100644
index 0000000..7c3f90c
--- /dev/null
+++ b/contrib/gdb/gdb/linespec.h
@@ -0,0 +1,27 @@
+/* Header for GDB line completion.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (LINESPEC_H)
+#define LINESPEC_H 1
+
+extern struct symtabs_and_lines
+ decode_line_1 (char **argptr, int funfirstline,
+ struct symtab *default_symtab, int default_line,
+ char ***canonical);
+
+#endif /* defined (LINESPEC_H) */
diff --git a/contrib/gdb/gdb/linux-proc.c b/contrib/gdb/gdb/linux-proc.c
new file mode 100644
index 0000000..d6f88d3
--- /dev/null
+++ b/contrib/gdb/gdb/linux-proc.c
@@ -0,0 +1,556 @@
+/* GNU/Linux specific methods for using the /proc file system.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <sys/procfs.h> /* for elf_gregset etc. */
+#include <sys/stat.h> /* for struct stat */
+#include <ctype.h> /* for isdigit */
+#include "regcache.h" /* for registers_changed */
+#include "gregset.h" /* for gregset */
+#include "gdbcore.h" /* for get_exec_file */
+#include "gdbthread.h" /* for struct thread_info etc. */
+#include "elf-bfd.h" /* for elfcore_write_* */
+#include "cli/cli-decode.h" /* for add_info */
+
+/* Function: child_pid_to_exec_file
+ *
+ * Accepts an integer pid
+ * Returns a string representing a file that can be opened
+ * to get the symbols for the child process.
+ */
+
+char *
+child_pid_to_exec_file (int pid)
+{
+ char *name1, *name2;
+
+ name1 = xmalloc (MAXPATHLEN);
+ name2 = xmalloc (MAXPATHLEN);
+ make_cleanup (xfree, name1);
+ make_cleanup (xfree, name2);
+ memset (name2, 0, MAXPATHLEN);
+
+ sprintf (name1, "/proc/%d/exe", pid);
+ if (readlink (name1, name2, MAXPATHLEN) > 0)
+ return name2;
+ else
+ return name1;
+}
+
+/* Function: read_mappings
+ *
+ * Service function for corefiles and info proc.
+ */
+
+static int
+read_mapping (FILE *mapfile,
+ long long *addr,
+ long long *endaddr,
+ char *permissions,
+ long long *offset,
+ char *device,
+ long long *inode,
+ char *filename)
+{
+ int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx",
+ addr, endaddr, permissions, offset, device, inode);
+
+ if (ret > 0 && ret != EOF && *inode != 0)
+ {
+ ret += fscanf (mapfile, "%s\n", filename);
+ }
+ else
+ {
+ filename[0] = '\0'; /* no filename */
+ fscanf (mapfile, "\n");
+ }
+ return (ret != 0 && ret != EOF);
+}
+
+/* Function: linux_find_memory_regions
+ *
+ * Fills the "to_find_memory_regions" target vector.
+ * Lists the memory regions in the inferior for a corefile.
+ */
+
+static int
+linux_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *obfd)
+{
+ long long pid = PIDGET (inferior_ptid);
+ char mapsfilename[MAXPATHLEN];
+ FILE *mapsfile;
+ long long addr, endaddr, size, offset, inode;
+ char permissions[8], device[8], filename[MAXPATHLEN];
+ int read, write, exec;
+ int ret;
+
+ /* Compose the filename for the /proc memory map, and open it. */
+ sprintf (mapsfilename, "/proc/%lld/maps", pid);
+ if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
+ error ("Could not open %s\n", mapsfilename);
+
+ if (info_verbose)
+ fprintf_filtered (gdb_stdout,
+ "Reading memory regions from %s\n", mapsfilename);
+
+ /* Now iterate until end-of-file. */
+ while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0],
+ &offset, &device[0], &inode, &filename[0]))
+ {
+ size = endaddr - addr;
+
+ /* Get the segment's permissions. */
+ read = (strchr (permissions, 'r') != 0);
+ write = (strchr (permissions, 'w') != 0);
+ exec = (strchr (permissions, 'x') != 0);
+
+ if (info_verbose)
+ {
+ fprintf_filtered (gdb_stdout,
+ "Save segment, %lld bytes at 0x%s (%c%c%c)",
+ size, paddr_nz (addr),
+ read ? 'r' : ' ',
+ write ? 'w' : ' ',
+ exec ? 'x' : ' ');
+ if (filename && filename[0])
+ fprintf_filtered (gdb_stdout,
+ " for %s", filename);
+ fprintf_filtered (gdb_stdout, "\n");
+ }
+
+ /* Invoke the callback function to create the corefile segment. */
+ func (addr, size, read, write, exec, obfd);
+ }
+ fclose (mapsfile);
+ return 0;
+}
+
+/* Function: linux_do_thread_registers
+ *
+ * Records the thread's register state for the corefile note section.
+ */
+
+static char *
+linux_do_thread_registers (bfd *obfd, ptid_t ptid,
+ char *note_data, int *note_size)
+{
+ gdb_gregset_t gregs;
+ gdb_fpregset_t fpregs;
+ unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
+
+ fill_gregset (&gregs, -1);
+ note_data = (char *) elfcore_write_prstatus (obfd,
+ note_data,
+ note_size,
+ merged_pid,
+ stop_signal,
+ &gregs);
+
+ fill_fpregset (&fpregs, -1);
+ note_data = (char *) elfcore_write_prfpreg (obfd,
+ note_data,
+ note_size,
+ &fpregs,
+ sizeof (fpregs));
+ return note_data;
+}
+
+struct linux_corefile_thread_data {
+ bfd *obfd;
+ char *note_data;
+ int *note_size;
+};
+
+/* Function: linux_corefile_thread_callback
+ *
+ * Called by gdbthread.c once per thread.
+ * Records the thread's register state for the corefile note section.
+ */
+
+static int
+linux_corefile_thread_callback (struct thread_info *ti, void *data)
+{
+ struct linux_corefile_thread_data *args = data;
+ ptid_t saved_ptid = inferior_ptid;
+
+ inferior_ptid = ti->ptid;
+ registers_changed ();
+ target_fetch_registers (-1); /* FIXME should not be necessary;
+ fill_gregset should do it automatically. */
+ args->note_data = linux_do_thread_registers (args->obfd,
+ ti->ptid,
+ args->note_data,
+ args->note_size);
+ inferior_ptid = saved_ptid;
+ registers_changed ();
+ target_fetch_registers (-1); /* FIXME should not be necessary;
+ fill_gregset should do it automatically. */
+ return 0;
+}
+
+/* Function: linux_make_note_section
+ *
+ * Fills the "to_make_corefile_note" target vector.
+ * Builds the note section for a corefile, and returns it
+ * in a malloc buffer.
+ */
+
+static char *
+linux_make_note_section (bfd *obfd, int *note_size)
+{
+ struct linux_corefile_thread_data thread_args;
+ struct cleanup *old_chain;
+ char fname[16] = {'\0'};
+ char psargs[80] = {'\0'};
+ char *note_data = NULL;
+ ptid_t current_ptid = inferior_ptid;
+
+ if (get_exec_file (0))
+ {
+ strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname));
+ strncpy (psargs, get_exec_file (0),
+ sizeof (psargs));
+ if (get_inferior_args ())
+ {
+ strncat (psargs, " ",
+ sizeof (psargs) - strlen (psargs));
+ strncat (psargs, get_inferior_args (),
+ sizeof (psargs) - strlen (psargs));
+ }
+ note_data = (char *) elfcore_write_prpsinfo (obfd,
+ note_data,
+ note_size,
+ fname,
+ psargs);
+ }
+
+ /* Dump information for threads. */
+ thread_args.obfd = obfd;
+ thread_args.note_data = note_data;
+ thread_args.note_size = note_size;
+ iterate_over_threads (linux_corefile_thread_callback, &thread_args);
+ if (thread_args.note_data == note_data)
+ {
+ /* iterate_over_threads didn't come up with any threads;
+ just use inferior_ptid. */
+ note_data = linux_do_thread_registers (obfd, inferior_ptid,
+ note_data, note_size);
+ }
+ else
+ {
+ note_data = thread_args.note_data;
+ }
+
+ make_cleanup (xfree, note_data);
+ return note_data;
+}
+
+/*
+ * Function: linux_info_proc_cmd
+ *
+ * Implement the "info proc" command.
+ */
+
+static void
+linux_info_proc_cmd (char *args, int from_tty)
+{
+ long long pid = PIDGET (inferior_ptid);
+ FILE *procfile;
+ char **argv = NULL;
+ char buffer[MAXPATHLEN];
+ char fname1[MAXPATHLEN], fname2[MAXPATHLEN];
+ int cmdline_f = 1;
+ int cwd_f = 1;
+ int exe_f = 1;
+ int mappings_f = 0;
+ int environ_f = 0;
+ int status_f = 0;
+ int stat_f = 0;
+ int all = 0;
+ struct stat dummy;
+
+ if (args)
+ {
+ /* Break up 'args' into an argv array. */
+ if ((argv = buildargv (args)) == NULL)
+ nomem (0);
+ else
+ make_cleanup_freeargv (argv);
+ }
+ while (argv != NULL && *argv != NULL)
+ {
+ if (isdigit (argv[0][0]))
+ {
+ pid = strtoul (argv[0], NULL, 10);
+ }
+ else if (strncmp (argv[0], "mappings", strlen (argv[0])) == 0)
+ {
+ mappings_f = 1;
+ }
+ else if (strcmp (argv[0], "status") == 0)
+ {
+ status_f = 1;
+ }
+ else if (strcmp (argv[0], "stat") == 0)
+ {
+ stat_f = 1;
+ }
+ else if (strcmp (argv[0], "cmd") == 0)
+ {
+ cmdline_f = 1;
+ }
+ else if (strncmp (argv[0], "exe", strlen (argv[0])) == 0)
+ {
+ exe_f = 1;
+ }
+ else if (strcmp (argv[0], "cwd") == 0)
+ {
+ cwd_f = 1;
+ }
+ else if (strncmp (argv[0], "all", strlen (argv[0])) == 0)
+ {
+ all = 1;
+ }
+ else
+ {
+ /* [...] (future options here) */
+ }
+ argv++;
+ }
+ if (pid == 0)
+ error ("No current process: you must name one.");
+
+ sprintf (fname1, "/proc/%lld", pid);
+ if (stat (fname1, &dummy) != 0)
+ error ("No /proc directory: '%s'", fname1);
+
+ printf_filtered ("process %lld\n", pid);
+ if (cmdline_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/cmdline", pid);
+ if ((procfile = fopen (fname1, "r")) > 0)
+ {
+ fgets (buffer, sizeof (buffer), procfile);
+ printf_filtered ("cmdline = '%s'\n", buffer);
+ fclose (procfile);
+ }
+ else
+ warning ("unable to open /proc file '%s'", fname1);
+ }
+ if (cwd_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/cwd", pid);
+ memset (fname2, 0, sizeof (fname2));
+ if (readlink (fname1, fname2, sizeof (fname2)) > 0)
+ printf_filtered ("cwd = '%s'\n", fname2);
+ else
+ warning ("unable to read link '%s'", fname1);
+ }
+ if (exe_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/exe", pid);
+ memset (fname2, 0, sizeof (fname2));
+ if (readlink (fname1, fname2, sizeof (fname2)) > 0)
+ printf_filtered ("exe = '%s'\n", fname2);
+ else
+ warning ("unable to read link '%s'", fname1);
+ }
+ if (mappings_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/maps", pid);
+ if ((procfile = fopen (fname1, "r")) > 0)
+ {
+ long long addr, endaddr, size, offset, inode;
+ char permissions[8], device[8], filename[MAXPATHLEN];
+ char *header_fmt_string, *data_fmt_string;
+
+ if (TARGET_ADDR_BIT == 32)
+ {
+ header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
+ data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
+ }
+ else
+ {
+ header_fmt_string = " %18s %18s %10s %10s %7s\n";
+ data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
+ }
+
+ printf_filtered ("Mapped address spaces:\n\n");
+ printf_filtered (header_fmt_string,
+ "Start Addr",
+ " End Addr",
+ " Size",
+ " Offset",
+ "objfile");
+
+ while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
+ &offset, &device[0], &inode, &filename[0]))
+ {
+ size = endaddr - addr;
+ printf_filtered (data_fmt_string,
+ (unsigned long) addr, /* FIXME: pr_addr */
+ (unsigned long) endaddr,
+ (int) size,
+ (unsigned int) offset,
+ filename[0] ? filename : "");
+
+ }
+
+ fclose (procfile);
+ }
+ else
+ warning ("unable to open /proc file '%s'", fname1);
+ }
+ if (status_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/status", pid);
+ if ((procfile = fopen (fname1, "r")) > 0)
+ {
+ while (fgets (buffer, sizeof (buffer), procfile) != NULL)
+ printf_filtered (buffer);
+ fclose (procfile);
+ }
+ else
+ warning ("unable to open /proc file '%s'", fname1);
+ }
+ if (stat_f || all)
+ {
+ sprintf (fname1, "/proc/%lld/stat", pid);
+ if ((procfile = fopen (fname1, "r")) > 0)
+ {
+ int itmp;
+ char ctmp;
+
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Process: %d\n", itmp);
+ if (fscanf (procfile, "%s ", &buffer[0]) > 0)
+ printf_filtered ("Exec file: %s\n", buffer);
+ if (fscanf (procfile, "%c ", &ctmp) > 0)
+ printf_filtered ("State: %c\n", ctmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Parent process: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Process group: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Session id: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("TTY: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("TTY owner process group: %d\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Flags: 0x%x\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Minor faults (no memory page): %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Minor faults, children: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Major faults (memory page faults): %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Major faults, children: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("utime: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("stime: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("utime, children: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("stime, children: %d\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("jiffies remaining in current time slice: %d\n",
+ itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("'nice' value: %d\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("jiffies until next timeout: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("jiffies until next SIGALRM: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("start time (jiffies since system boot): %d\n",
+ itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Virtual memory size: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Resident set size: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("rlim: %u\n",
+ (unsigned int) itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Start of text: 0x%x\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("End of text: 0x%x\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0)
+ printf_filtered ("Start of stack: 0x%x\n", itmp);
+#if 0 /* Don't know how architecture-dependent the rest is...
+ Anyway the signal bitmap info is available from "status". */
+ if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */
+ printf_filtered ("Kernel stack pointer: 0x%x\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */
+ printf_filtered ("Kernel instr pointer: 0x%x\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Pending signals bitmap: 0x%x\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Blocked signals bitmap: 0x%x\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Ignored signals bitmap: 0x%x\n", itmp);
+ if (fscanf (procfile, "%d ", &itmp) > 0)
+ printf_filtered ("Catched signals bitmap: 0x%x\n", itmp);
+ if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */
+ printf_filtered ("wchan (system call): 0x%x\n", itmp);
+#endif
+ fclose (procfile);
+ }
+ else
+ warning ("unable to open /proc file '%s'", fname1);
+ }
+}
+
+void
+_initialize_linux_proc (void)
+{
+ extern void inftarg_set_find_memory_regions ();
+ extern void inftarg_set_make_corefile_notes ();
+
+ inftarg_set_find_memory_regions (linux_find_memory_regions);
+ inftarg_set_make_corefile_notes (linux_make_note_section);
+
+ add_info ("proc", linux_info_proc_cmd,
+ "Show /proc process information about any running process.\n\
+Specify any process id, or use the program being debugged by default.\n\
+Specify any of the following keywords for detailed info:\n\
+ mappings -- list of mapped memory regions.\n\
+ stat -- list a bunch of random process info.\n\
+ status -- list a different bunch of random process info.\n\
+ all -- list all available /proc info.");
+}
diff --git a/contrib/gdb/gdb/m2-exp.y b/contrib/gdb/gdb/m2-exp.y
index 507e5bc..eaaad5a 100644
--- a/contrib/gdb/gdb/m2-exp.y
+++ b/contrib/gdb/gdb/m2-exp.y
@@ -1,5 +1,6 @@
/* YACC grammar for Modula-2 expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1995
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999,
+ 2000
Free Software Foundation, Inc.
Generated from expread.y (now c-exp.y) and contributed by the Department
of Computer Science at the State University of New York at Buffalo, 1991.
@@ -100,22 +101,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define YYDEBUG 0 /* Default to no yydebug support */
#endif
-int
-yyparse PARAMS ((void));
+int yyparse (void);
-static int
-yylex PARAMS ((void));
+static int yylex (void);
-void
-yyerror PARAMS ((char *));
+void yyerror (char *);
#if 0
-static char *
-make_qualname PARAMS ((char *, char *));
+static char *make_qualname (char *, char *);
#endif
-static int
-parse_number PARAMS ((int));
+static int parse_number (int);
/* The sign of the number being parsed. */
static int number_sign = 1;
@@ -1050,6 +1046,10 @@ yylex ()
case LOC_LABEL:
case LOC_UNRESOLVED:
error("internal: Unforseen case in m2lex()");
+
+ default:
+ error ("unhandled token in m2lex()");
+ break;
}
}
else
diff --git a/contrib/gdb/gdb/m2-lang.c b/contrib/gdb/gdb/m2-lang.c
index f5f38a9..116d850 100644
--- a/contrib/gdb/gdb/m2-lang.c
+++ b/contrib/gdb/gdb/m2-lang.c
@@ -1,21 +1,23 @@
/* Modula 2 language support routines for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -25,11 +27,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "language.h"
#include "m2-lang.h"
#include "c-lang.h"
+#include "valprint.h"
-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_printchar PARAMS ((int, GDB_FILE *));
-static void m2_emit_char PARAMS ((int, GDB_FILE *, int));
+extern void _initialize_m2_language (void);
+static struct type *m2_create_fundamental_type (struct objfile *, int);
+static void m2_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+static void m2_printchar (int, struct ui_file *);
+static void m2_emit_char (int, struct ui_file *, int);
/* 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
@@ -39,10 +45,7 @@ static void m2_emit_char PARAMS ((int, GDB_FILE *, int));
*/
static void
-m2_emit_char (c, stream, quoter)
- register int c;
- GDB_FILE *stream;
- int quoter;
+m2_emit_char (register int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -91,9 +94,7 @@ m2_emit_char (c, stream, quoter)
be replaced with a true Modula version. */
static void
-m2_printchar (c, stream)
- int c;
- GDB_FILE *stream;
+m2_printchar (int c, struct ui_file *stream)
{
fputs_filtered ("'", stream);
LA_EMIT_CHAR (c, stream, '\'');
@@ -108,20 +109,14 @@ m2_printchar (c, stream)
be replaced with a true Modula version. */
static void
-m2_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+m2_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
register unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
extern int inspect_it;
- extern int repeat_count_threshold;
- extern int print_max;
if (length == 0)
{
@@ -132,7 +127,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;
@@ -202,198 +197,197 @@ m2_printstr (stream, string, length, width, force_ellipses)
by an experienced Modula programmer. */
static struct type *
-m2_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+m2_create_fundamental_type (struct objfile *objfile, int typeid)
{
register struct type *type = NULL;
switch (typeid)
{
- default:
- /* FIXME: For now, if we are asked to produce a type not in this
- language, create the equivalent of a C integer type with the
- name "<?type?>". When all the dust settles from the type
- reconstruction work, this should probably become an error. */
- type = init_type (TYPE_CODE_INT,
- 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);
}
-
+
/* 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}
};
/* The built-in types of Modula-2. */
@@ -404,22 +398,24 @@ 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 (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,
range_check_on,
type_check_on,
+ case_sensitive_on,
m2_parse, /* parser */
m2_error, /* parser error function */
evaluate_subexp_standard,
@@ -430,21 +426,21 @@ 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
};
/* Initialization for Modula-2 */
void
-_initialize_m2_language ()
+_initialize_m2_language (void)
{
/* Modula-2 "pervasive" types. NOTE: these can be redefined!!! */
builtin_type_m2_int =
diff --git a/contrib/gdb/gdb/m2-lang.h b/contrib/gdb/gdb/m2-lang.h
index dc627b7..a31c5ae 100644
--- a/contrib/gdb/gdb/m2-lang.h
+++ b/contrib/gdb/gdb/m2-lang.h
@@ -1,31 +1,31 @@
/* Modula 2 language support definitions for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1998, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 */
+extern int m2_parse (void); /* Defined in m2-exp.y */
-extern void
-m2_error PARAMS ((char *)); /* Defined in m2-exp.y */
+extern void m2_error (char *); /* Defined in m2-exp.y */
-extern void /* Defined in m2-typeprint.c */
-m2_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+/* Defined in m2-typeprint.c */
+extern void m2_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-m2_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int m2_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
diff --git a/contrib/gdb/gdb/m2-typeprint.c b/contrib/gdb/gdb/m2-typeprint.c
index 317f401..90aefae 100644
--- a/contrib/gdb/gdb/m2-typeprint.c
+++ b/contrib/gdb/gdb/m2-typeprint.c
@@ -1,24 +1,25 @@
/* Support for printing Modula 2 types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1995, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
@@ -26,24 +27,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
#include "gdbcore.h"
#include "target.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "language.h"
-#include "demangle.h"
#include "m2-lang.h"
-
-#include "gdb_string.h"
#include <errno.h>
void
-m2_print_type (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
- int level;
+m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
{
- extern void c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+ extern void c_print_type (struct type *, char *, struct ui_file *, int,
+ int);
c_print_type (type, varstring, stream, show, level); /* FIXME */
}
diff --git a/contrib/gdb/gdb/m2-valprint.c b/contrib/gdb/gdb/m2-valprint.c
index 12a2f27..ec80301 100644
--- a/contrib/gdb/gdb/m2-valprint.c
+++ b/contrib/gdb/gdb/m2-valprint.c
@@ -1,47 +1,39 @@
/* Support for printing Modula 2 values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1996, 1998, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
-#include "valprint.h"
#include "m2-lang.h"
/* FIXME: For now, just explicitly declare c_val_print and use it instead */
int
-m2_val_print (type, valaddr, embedded_offset, address,
- stream, format, deref_ref, recurse, pretty)
- 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;
+m2_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
- extern int
- c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR,
- GDB_FILE *, int, int, int, enum val_prettyprint));
+ extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
return (c_val_print (type, valaddr, 0, address, stream, format, deref_ref,
recurse, pretty));
}
diff --git a/contrib/gdb/gdb/maint.c b/contrib/gdb/gdb/maint.c
index cf4ceb7e..0d2be09 100644
--- a/contrib/gdb/gdb/maint.c
+++ b/contrib/gdb/gdb/maint.c
@@ -1,28 +1,27 @@
/* Support for GDB maintenance commands.
- Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002
+ 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"
-
-#if MAINTENANCE_CMDS /* Entire rest of file goes away if not including maint cmds */
-
#include <ctype.h>
#include <signal.h>
#include "command.h"
@@ -31,33 +30,35 @@ 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"
#include "value.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+extern void _initialize_maint_cmds (void);
+
+static void maintenance_command (char *, int);
+
+static void maintenance_dump_me (char *, int);
-static void maintenance_command PARAMS ((char *, int));
+static void maintenance_internal_error (char *args, int from_tty);
-static void maintenance_dump_me PARAMS ((char *, int));
+static void maintenance_demangle (char *, int);
-static void maintenance_demangle PARAMS ((char *, int));
+static void maintenance_time_display (char *, int);
-static void maintenance_time_display PARAMS ((char *, int));
+static void maintenance_space_display (char *, int);
-static void maintenance_space_display PARAMS ((char *, int));
+static void maintenance_info_command (char *, int);
-static void maintenance_info_command PARAMS ((char *, int));
+static void print_section_table (bfd *, asection *, void *);
-static void print_section_table PARAMS ((bfd *, asection *, PTR));
+static void maintenance_info_sections (char *, int);
-static void maintenance_info_sections PARAMS ((char *, int));
+static void maintenance_print_command (char *, int);
-static void maintenance_print_command PARAMS ((char *, int));
+static void maintenance_do_deprecate (char *, int);
/* Set this to the maximum number of seconds to wait instead of waiting forever
in target_wait(). If this timer times out, then it generates an error and
@@ -69,22 +70,20 @@ 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)
- char *args;
- int from_tty;
+maintenance_command (char *args, int from_tty)
{
printf_unfiltered ("\"maintenance\" must be followed by the name of a maintenance command.\n");
help_list (maintenancelist, "maintenance ", -1, gdb_stdout);
@@ -93,30 +92,44 @@ maintenance_command (args, from_tty)
#ifndef _WIN32
/* ARGSUSED */
static void
-maintenance_dump_me (args, from_tty)
- char *args;
- int from_tty;
+maintenance_dump_me (char *args, int from_tty)
{
if (query ("Should GDB dump core? "))
{
+#ifdef __DJGPP__
+ /* SIGQUIT by default is ignored, so use SIGABRT instead. */
+ signal (SIGABRT, SIG_DFL);
+ kill (getpid (), SIGABRT);
+#else
signal (SIGQUIT, SIG_DFL);
kill (getpid (), SIGQUIT);
+#endif
}
}
#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) */
+/* Stimulate the internal error mechanism that GDB uses when an
+ internal problem is detected. Allows testing of the mechanism.
+ Also useful when the user wants to drop a core file but not exit
+ GDB. */
static void
-maintenance_demangle (args, from_tty)
- char *args;
- int from_tty;
+maintenance_internal_error (char *args, int from_tty)
+{
+ internal_error (__FILE__, __LINE__,
+ "internal maintenance");
+}
+
+/* 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) */
+
+static void
+maintenance_demangle (char *args, int from_tty)
{
char *demangled;
@@ -130,7 +143,7 @@ maintenance_demangle (args, from_tty)
if (demangled != NULL)
{
printf_unfiltered ("%s\n", demangled);
- free (demangled);
+ xfree (demangled);
}
else
{
@@ -140,9 +153,7 @@ maintenance_demangle (args, from_tty)
}
static void
-maintenance_time_display (args, from_tty)
- char *args;
- int from_tty;
+maintenance_time_display (char *args, int from_tty)
{
extern int display_time;
@@ -153,9 +164,7 @@ maintenance_time_display (args, from_tty)
}
static void
-maintenance_space_display (args, from_tty)
- char *args;
- int from_tty;
+maintenance_space_display (char *args, int from_tty)
{
extern int display_space;
@@ -165,44 +174,94 @@ maintenance_space_display (args, from_tty)
display_space = strtol (args, NULL, 10);
}
-/* The "maintenance info" command is defined as a prefix, with allow_unknown 0.
- Therefore, its own definition is called only for "maintenance info" with
- no args. */
+/* The "maintenance info" command is defined as a prefix, with
+ allow_unknown 0. Therefore, its own definition is called only for
+ "maintenance info" with no args. */
/* ARGSUSED */
static void
-maintenance_info_command (arg, from_tty)
- char *arg;
- int from_tty;
+maintenance_info_command (char *arg, int from_tty)
{
printf_unfiltered ("\"maintenance info\" must be followed by the name of an info command.\n");
help_list (maintenanceinfolist, "maintenance info ", -1, gdb_stdout);
}
-static void
-print_section_table (abfd, asect, ignore)
- bfd *abfd;
- asection *asect;
- PTR ignore;
+/* Mini tokenizing lexer for 'maint info sections' command. */
+
+static int
+match_substring (const char *string, const char *substr)
{
- flagword flags;
+ int substr_len = strlen(substr);
+ const char *tok;
- flags = bfd_get_section_flags (abfd, asect);
+ while ((tok = strstr (string, substr)) != NULL)
+ {
+ /* Got a partial match. Is it a whole word? */
+ if (tok == string
+ || tok[-1] == ' '
+ || tok[-1] == '\t')
+ {
+ /* Token is delimited at the front... */
+ if (tok[substr_len] == ' '
+ || tok[substr_len] == '\t'
+ || tok[substr_len] == '\0')
+ {
+ /* Token is delimited at the rear. Got a whole-word match. */
+ return 1;
+ }
+ }
+ /* Token didn't match as a whole word. Advance and try again. */
+ string = tok + 1;
+ }
+ return 0;
+}
- /* FIXME-32x64: Need print_address_numeric with field width. */
- printf_filtered (" %s",
- local_hex_string_custom
- ((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"));
- printf_filtered (" at %s",
- local_hex_string_custom
- ((unsigned long) asect->filepos, "08l"));
- printf_filtered (": %s", bfd_section_name (abfd, asect));
+static int
+match_bfd_flags (char *string, flagword flags)
+{
+ if (flags & SEC_ALLOC)
+ if (match_substring (string, "ALLOC"))
+ return 1;
+ if (flags & SEC_LOAD)
+ if (match_substring (string, "LOAD"))
+ return 1;
+ if (flags & SEC_RELOC)
+ if (match_substring (string, "RELOC"))
+ return 1;
+ if (flags & SEC_READONLY)
+ if (match_substring (string, "READONLY"))
+ return 1;
+ if (flags & SEC_CODE)
+ if (match_substring (string, "CODE"))
+ return 1;
+ if (flags & SEC_DATA)
+ if (match_substring (string, "DATA"))
+ return 1;
+ if (flags & SEC_ROM)
+ if (match_substring (string, "ROM"))
+ return 1;
+ if (flags & SEC_CONSTRUCTOR)
+ if (match_substring (string, "CONSTRUCTOR"))
+ return 1;
+ if (flags & SEC_HAS_CONTENTS)
+ if (match_substring (string, "HAS_CONTENTS"))
+ return 1;
+ if (flags & SEC_NEVER_LOAD)
+ if (match_substring (string, "NEVER_LOAD"))
+ return 1;
+ if (flags & SEC_COFF_SHARED_LIBRARY)
+ if (match_substring (string, "COFF_SHARED_LIBRARY"))
+ return 1;
+ if (flags & SEC_IS_COMMON)
+ if (match_substring (string, "IS_COMMON"))
+ return 1;
+ return 0;
+}
+
+static void
+print_bfd_flags (flagword flags)
+{
if (flags & SEC_ALLOC)
printf_filtered (" ALLOC");
if (flags & SEC_LOAD)
@@ -227,54 +286,136 @@ print_section_table (abfd, asect, ignore)
printf_filtered (" COFF_SHARED_LIBRARY");
if (flags & SEC_IS_COMMON)
printf_filtered (" IS_COMMON");
+}
+static void
+print_section_info (const char *name, flagword flags,
+ CORE_ADDR addr, CORE_ADDR endaddr,
+ unsigned long filepos)
+{
+ /* FIXME-32x64: Need print_address_numeric with field width. */
+ printf_filtered (" 0x%s", paddr (addr));
+ printf_filtered ("->0x%s", paddr (endaddr));
+ printf_filtered (" at %s",
+ local_hex_string_custom ((unsigned long) filepos, "08l"));
+ printf_filtered (": %s", name);
+ print_bfd_flags (flags);
printf_filtered ("\n");
}
+static void
+print_bfd_section_info (bfd *abfd,
+ asection *asect,
+ void *arg)
+{
+ flagword flags = bfd_get_section_flags (abfd, asect);
+ const char *name = bfd_section_name (abfd, asect);
+
+ if (arg == NULL || *((char *) arg) == '\0'
+ || match_substring ((char *) arg, name)
+ || match_bfd_flags ((char *) arg, flags))
+ {
+ CORE_ADDR addr, endaddr;
+
+ addr = bfd_section_vma (abfd, asect);
+ endaddr = addr + bfd_section_size (abfd, asect);
+ print_section_info (name, flags, addr, endaddr, asect->filepos);
+ }
+}
+
+static void
+print_objfile_section_info (bfd *abfd,
+ struct obj_section *asect,
+ char *string)
+{
+ flagword flags = bfd_get_section_flags (abfd, asect->the_bfd_section);
+ const char *name = bfd_section_name (abfd, asect->the_bfd_section);
+
+ if (string == NULL || *string == '\0'
+ || match_substring (string, name)
+ || match_bfd_flags (string, flags))
+ {
+ print_section_info (name, flags, asect->addr, asect->endaddr,
+ asect->the_bfd_section->filepos);
+ }
+}
+
/* ARGSUSED */
static void
-maintenance_info_sections (arg, from_tty)
- char *arg;
- int from_tty;
+maintenance_info_sections (char *arg, int 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));
+ if (arg && *arg && match_substring (arg, "ALLOBJ"))
+ {
+ struct objfile *ofile;
+ struct obj_section *osect;
+
+ /* Only this function cares about the 'ALLOBJ' argument;
+ if 'ALLOBJ' is the only argument, discard it rather than
+ passing it down to print_objfile_section_info (which
+ wouldn't know how to handle it). */
+ if (strcmp (arg, "ALLOBJ") == 0)
+ arg = NULL;
+
+ ALL_OBJFILES (ofile)
+ {
+ printf_filtered (" Object file: %s\n",
+ bfd_get_filename (ofile->obfd));
+ ALL_OBJFILE_OSECTIONS (ofile, osect)
+ {
+ print_objfile_section_info (ofile->obfd, osect, arg);
+ }
+ }
+ }
+ else
+ bfd_map_over_sections (exec_bfd, print_bfd_section_info, arg);
}
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_bfd_section_info, arg);
}
}
/* ARGSUSED */
void
-maintenance_print_statistics (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_statistics (char *args, int from_tty)
{
print_objfile_statistics ();
print_symbol_bcache_statistics ();
}
-/* The "maintenance print" command is defined as a prefix, with allow_unknown
- 0. Therefore, its own definition is called only for "maintenance print"
- with no args. */
+void
+maintenance_print_architecture (char *args, int from_tty)
+{
+ if (args == NULL)
+ gdbarch_dump (current_gdbarch, gdb_stdout);
+ else
+ {
+ struct ui_file *file = gdb_fopen (args, "w");
+ if (file == NULL)
+ perror_with_name ("maintenance print architecture");
+ gdbarch_dump (current_gdbarch, file);
+ ui_file_delete (file);
+ }
+}
+
+/* The "maintenance print" command is defined as a prefix, with
+ allow_unknown 0. Therefore, its own definition is called only for
+ "maintenance print" with no args. */
/* ARGSUSED */
static void
-maintenance_print_command (arg, from_tty)
- char *arg;
- int from_tty;
+maintenance_print_command (char *arg, int from_tty)
{
printf_unfiltered ("\"maintenance print\" must be followed by the name of a print command.\n");
help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout);
@@ -282,14 +423,12 @@ 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)
- char *arg;
- int from_tty;
+maintenance_translate_address (char *arg, int from_tty)
{
CORE_ADDR address;
asection *sect;
@@ -305,19 +444,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);
@@ -331,23 +471,170 @@ maintenance_translate_address (arg, from_tty)
sym = lookup_minimal_symbol_by_pc (address);
if (sym)
- printf_filtered ("%s+%u\n",
- SYMBOL_SOURCE_NAME (sym),
- address - SYMBOL_VALUE_ADDRESS (sym));
+ printf_filtered ("%s+%s\n",
+ SYMBOL_SOURCE_NAME (sym),
+ paddr_u (address - SYMBOL_VALUE_ADDRESS (sym)));
else if (sect)
- printf_filtered ("no symbol at %s:0x%08x\n", sect->name, address);
+ printf_filtered ("no symbol at %s:0x%s\n", sect->name, paddr (address));
else
- printf_filtered ("no symbol at 0x%08x\n", address);
+ printf_filtered ("no symbol at 0x%s\n", paddr (address));
return;
}
-#endif /* MAINTENANCE_CMDS */
+
+/* When a command is deprecated the user will be warned the first time
+ the command is used. If possible, a replacement will be
+ offered. */
+
+static void
+maintenance_deprecate (char *args, int from_tty)
+{
+ if (args == NULL || *args == '\0')
+ {
+ printf_unfiltered ("\"maintenance deprecate\" takes an argument, \n\
+the command you want to deprecate, and optionally the replacement command \n\
+enclosed in quotes.\n");
+ }
+
+ maintenance_do_deprecate (args, 1);
+
+}
+
+
+static void
+maintenance_undeprecate (char *args, int from_tty)
+{
+ if (args == NULL || *args == '\0')
+ {
+ printf_unfiltered ("\"maintenance undeprecate\" takes an argument, \n\
+the command you want to undeprecate.\n");
+ }
+
+ maintenance_do_deprecate (args, 0);
+
+}
+
+/* You really shouldn't be using this. It is just for the testsuite.
+ Rather, you should use deprecate_cmd() when the command is created
+ in _initialize_blah().
+
+ This function deprecates a command and optionally assigns it a
+ replacement. */
+
+static void
+maintenance_do_deprecate (char *text, int deprecate)
+{
+
+ struct cmd_list_element *alias = NULL;
+ struct cmd_list_element *prefix_cmd = NULL;
+ struct cmd_list_element *cmd = NULL;
+
+ char *start_ptr = NULL;
+ char *end_ptr = NULL;
+ int len;
+ char *replacement = NULL;
+
+ if (text == NULL)
+ return;
+
+ if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
+ {
+ printf_filtered ("Can't find command '%s' to deprecate.\n", text);
+ return;
+ }
+
+ if (deprecate)
+ {
+ /* look for a replacement command */
+ start_ptr = strchr (text, '\"');
+ if (start_ptr != NULL)
+ {
+ start_ptr++;
+ end_ptr = strrchr (start_ptr, '\"');
+ if (end_ptr != NULL)
+ {
+ len = end_ptr - start_ptr;
+ start_ptr[len] = '\0';
+ replacement = xstrdup (start_ptr);
+ }
+ }
+ }
+
+ if (!start_ptr || !end_ptr)
+ replacement = NULL;
+
+
+ /* If they used an alias, we only want to deprecate the alias.
+
+ Note the MALLOCED_REPLACEMENT test. If the command's replacement
+ string was allocated at compile time we don't want to free the
+ memory. */
+ if (alias)
+ {
+
+ if (alias->flags & MALLOCED_REPLACEMENT)
+ xfree (alias->replacement);
+
+ if (deprecate)
+ alias->flags |= (DEPRECATED_WARN_USER | CMD_DEPRECATED);
+ else
+ alias->flags &= ~(DEPRECATED_WARN_USER | CMD_DEPRECATED);
+ alias->replacement = replacement;
+ alias->flags |= MALLOCED_REPLACEMENT;
+ return;
+ }
+ else if (cmd)
+ {
+ if (cmd->flags & MALLOCED_REPLACEMENT)
+ xfree (cmd->replacement);
+
+ if (deprecate)
+ cmd->flags |= (DEPRECATED_WARN_USER | CMD_DEPRECATED);
+ else
+ cmd->flags &= ~(DEPRECATED_WARN_USER | CMD_DEPRECATED);
+ cmd->replacement = replacement;
+ cmd->flags |= MALLOCED_REPLACEMENT;
+ return;
+ }
+}
+
+/* Maintenance set/show framework. */
+
+static struct cmd_list_element *maintenance_set_cmdlist;
+static struct cmd_list_element *maintenance_show_cmdlist;
+
+static void
+maintenance_set_cmd (char *args, int from_tty)
+{
+ printf_unfiltered ("\"maintenance set\" must be followed by the name of a set command.\n");
+ help_list (maintenance_set_cmdlist, "maintenance set ", -1, gdb_stdout);
+}
+
+static void
+maintenance_show_cmd (char *args, int from_tty)
+{
+ cmd_show_list (maintenance_show_cmdlist, from_tty, "");
+}
+
+#ifdef NOTYET
+/* Profiling support. */
+
+static int maintenance_profile_p;
+
+static void
+maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c)
+{
+ maintenance_profile_p = 0;
+ warning ("\"maintenance set profile\" command not supported.\n");
+}
+#endif
void
-_initialize_maint_cmds ()
+_initialize_maint_cmds (void)
{
-#if MAINTENANCE_CMDS /* Entire file goes away if not including maint cmds */
+ struct cmd_list_element *tmpcmd;
+
add_prefix_cmd ("maintenance", class_maintenance, maintenance_command,
"Commands for use by GDB maintainers.\n\
Includes commands to dump specific internal GDB structures in\n\
@@ -359,12 +646,21 @@ 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);
+ add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
add_cmd ("sections", class_maintenance, maintenance_info_sections,
- "List the BFD sections of the exec and core files.",
+ "List the BFD sections of the exec and core files. \n\
+Arguments may be any combination of:\n\
+ [one or more section names]\n\
+ ALLOC LOAD RELOC READONLY CODE DATA ROM CONSTRUCTOR\n\
+ HAS_CONTENTS NEVER_LOAD COFF_SHARED_LIBRARY IS_COMMON\n\
+Sections matching any argument will be listed (no argument\n\
+implies all sections). In addition, the special argument\n\
+ ALLOBJ\n\
+lists all sections from all object files, including shared libraries.",
&maintenanceinfolist);
add_prefix_cmd ("print", class_maintenance, maintenance_print_command,
@@ -372,6 +668,20 @@ to test internal functions such as the C++ demangler, etc.",
&maintenanceprintlist, "maintenance print ", 0,
&maintenancelist);
+ add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, "\
+Set GDB internal variables used by the GDB maintainer.\n\
+Configure variables internal to GDB that aid in GDB's maintenance",
+ &maintenance_set_cmdlist, "maintenance set ",
+ 0/*allow-unknown*/,
+ &maintenancelist);
+
+ add_prefix_cmd ("show", class_maintenance, maintenance_show_cmd, "\
+Show GDB internal variables used by the GDB maintainer.\n\
+Configure variables internal to GDB that aid in GDB's maintenance",
+ &maintenance_show_cmdlist, "maintenance show ",
+ 0/*allow-unknown*/,
+ &maintenancelist);
+
#ifndef _WIN32
add_cmd ("dump-me", class_maintenance, maintenance_dump_me,
"Get fatal error; make debugger dump its core.\n\
@@ -380,6 +690,11 @@ itself a SIGQUIT signal.",
&maintenancelist);
#endif
+ add_cmd ("internal-error", class_maintenance, maintenance_internal_error,
+ "Give GDB an internal error.\n\
+Cause GDB to behave as if an internal error was detected.",
+ &maintenancelist);
+
add_cmd ("demangle", class_maintenance, maintenance_demangle,
"Demangle a C++ mangled name.\n\
Call internal GDB demangler routine to demangle a C++ link name\n\
@@ -430,6 +745,11 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
"Print statistics about internal gdb state.",
&maintenanceprintlist);
+ add_cmd ("architecture", class_maintenance, maintenance_print_architecture,
+ "Print the internal architecture configuration.\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
+
add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
"Check consistency of psymtabs and symtabs.",
&maintenancelist);
@@ -438,12 +758,39 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
"Translate a section name and address to a symbol.",
&maintenancelist);
+ add_cmd ("deprecate", class_maintenance, maintenance_deprecate,
+ "Deprecate a command. Note that this is just in here so the \n\
+testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\
+rather you should use the C function deprecate_cmd(). If you decide you \n\
+want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\
+replacement is optional.", &maintenancelist);
+
+ add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate,
+ "Undeprecate a command. Note that this is just in here so the \n\
+testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\
+If you decide you want to use it: maintenance undeprecate 'commandname'",
+ &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);
-#endif /* MAINTENANCE_CMDS */
+ &showlist);
+
+
+#ifdef NOTYET
+ /* FIXME: cagney/2001-09-24: A patch introducing a
+ add_set_boolean_cmd() is pending, the below should probably use
+ it. A patch implementing profiling is pending, this just sets up
+ the framework. */
+ tmpcmd = add_set_cmd ("profile", class_maintenance,
+ var_boolean, &maintenance_profile_p,
+ "Set internal profiling.\n\
+When enabled GDB is profiled.",
+ &maintenance_set_cmdlist);
+ set_cmd_sfunc (tmpcmd, maintenance_set_profile_cmd);
+ add_show_from_set (tmpcmd, &maintenance_show_cmdlist);
+#endif
}
diff --git a/contrib/gdb/gdb/mdebugread.c b/contrib/gdb/gdb/mdebugread.c
index 1064490..c974c9e 100644
--- a/contrib/gdb/gdb/mdebugread.c
+++ b/contrib/gdb/gdb/mdebugread.c
@@ -1,25 +1,27 @@
/* Read a symbol table in ECOFF format (Third-Eye).
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Original version 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. */
/* This module provides the function mdebug_build_psymtabs. It reads
ECOFF debugging information into partial symbol tables. The
@@ -56,13 +58,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef MIPS_EFI_SYMBOL_NAME
#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"
-extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
+extern void ecoff_relocate_efi (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
@@ -75,8 +79,6 @@ typedef struct mips_extra_func_info {
#include "gdb_stat.h"
#include "gdb_string.h"
-#include "gdb-stabs.h"
-
#include "bfd.h"
#include "coff/ecoff.h" /* COFF-like aspects of ecoff files */
@@ -86,13 +88,9 @@ typedef struct mips_extra_func_info {
#include "aout/stab_gnu.h" /* STABS information */
#include "expression.h"
-#include "language.h" /* Needed inside partial-stab.h */
-
+#include "language.h" /* For local_hex_string() */
-/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
-#ifndef ECOFF_REG_TO_REGNUM
-#define ECOFF_REG_TO_REGNUM(num) (num)
-#endif
+extern void _initialize_mdebugread (void);
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
We use this define in order to know whether we should override a
@@ -100,28 +98,35 @@ typedef struct mips_extra_func_info {
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)
-
+
/* 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;
-};
+ {
+ /* Our running best guess as to the range of text addresses for
+ this psymtab. After we've read everything in, we use this to
+ build pst->text_addrs. */
+ CORE_ADDR textlow, texthigh;
+
+ /* 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 TEXTLOW(p) (PST_PRIVATE(p)->textlow)
+#define TEXTHIGH(p) (PST_PRIVATE(p)->texthigh)
#define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx)
#define CUR_BFD(p) (PST_PRIVATE(p)->cur_bfd)
#define DEBUG_SWAP(p) (PST_PRIVATE(p)->debug_swap)
@@ -138,14 +143,10 @@ struct symloc
|| (sc) == scPData \
|| (sc) == scXData)
#define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon)
-#define SC_IS_BSS(sc) ((sc) == scBss || (sc) == scSBss)
+#define SC_IS_BSS(sc) ((sc) == scBss)
+#define SC_IS_SBSS(sc) ((sc) == scSBss)
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
-
-/* Things we import explicitly from other modules */
-
-extern int info_verbose;
-
/* Various complaints about symbol reading that don't abort the process */
static struct complaint bad_file_number_complaint =
@@ -327,104 +328,54 @@ static int found_ecoff_debugging_info;
/* Forward declarations */
-static void
-add_pending PARAMS ((FDR *, char *, struct type *));
+static int upgrade_type (int, struct type **, int, union aux_ext *,
+ int, char *);
-static struct mdebug_pending *
-is_pending_symbol PARAMS ((FDR *, char *));
+static void parse_partial_symbols (struct objfile *);
-static void
-pop_parse_stack PARAMS ((void));
+static int has_opaque_xref (FDR *, SYMR *);
-static void
-push_parse_stack PARAMS ((void));
+static int cross_ref (int, union aux_ext *, struct type **, enum type_code,
+ char **, int, char *);
-static char *
-fdr_name PARAMS ((FDR *));
+static struct symbol *new_symbol (char *);
-static void
-mdebug_psymtab_to_symtab PARAMS ((struct partial_symtab *));
+static struct type *new_type (char *);
-static int
-upgrade_type PARAMS ((int, struct type **, int, union aux_ext *, int, char *));
+static struct block *new_block (int);
-static void
-parse_partial_symbols PARAMS ((struct objfile *,
- struct section_offsets *));
+static struct symtab *new_symtab (char *, int, int, struct objfile *);
-static FDR
-*get_rfd PARAMS ((int, int));
+static struct linetable *new_linetable (int);
-static int
-has_opaque_xref PARAMS ((FDR *, SYMR *));
+static struct blockvector *new_bvect (int);
-static int
-cross_ref PARAMS ((int, union aux_ext *, struct type **, enum type_code,
- char **, int, char *));
+static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
+ int, char *);
-static struct symbol *
-new_symbol PARAMS ((char *));
+static struct symbol *mylookup_symbol (char *, struct block *, namespace_enum,
+ enum address_class);
-static struct type *
-new_type PARAMS ((char *));
+static struct block *shrink_block (struct block *, struct symtab *);
-static struct block *
-new_block PARAMS ((int));
+static void sort_blocks (struct symtab *);
-static struct symtab *
-new_symtab PARAMS ((char *, int, int, struct objfile *));
+static struct partial_symtab *new_psymtab (char *, struct objfile *);
-static struct linetable *
-new_linetable PARAMS ((int));
+static void psymtab_to_symtab_1 (struct partial_symtab *, char *);
-static struct blockvector *
-new_bvect PARAMS ((int));
+static void add_block (struct block *, struct symtab *);
-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 *));
-
-static struct symbol *
-mylookup_symbol PARAMS ((char *, struct block *, namespace_enum,
- enum address_class));
-
-static struct block *
-shrink_block PARAMS ((struct block *, struct symtab *));
+static void add_symbol (struct symbol *, struct block *);
-static PTR
-xzalloc PARAMS ((unsigned int));
+static int add_line (struct linetable *, int, CORE_ADDR, int);
-static void
-sort_blocks PARAMS ((struct symtab *));
+static struct linetable *shrink_linetable (struct linetable *);
-static int
-compare_blocks PARAMS ((const void *, const void *));
-
-static struct partial_symtab *
-new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
-
-static void
-psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
-
-static void
-add_block PARAMS ((struct block *, struct symtab *));
+static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
+ CORE_ADDR);
-static void
-add_symbol PARAMS ((struct symbol *, struct block *));
-
-static int
-add_line PARAMS ((struct linetable *, int, CORE_ADDR, int));
-
-static 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 *));
+static char *mdebug_next_symbol_text (struct objfile *);
/* Address bounds for the signal trampoline in inferior, if any */
@@ -432,11 +383,10 @@ CORE_ADDR sigtramp_address, sigtramp_end;
/* Allocate zeroed memory */
-static PTR
-xzalloc (size)
- unsigned int size;
+static void *
+xzalloc (unsigned int size)
{
- PTR p = xmalloc (size);
+ void *p = xmalloc (size);
memset (p, 0, size);
return p;
@@ -448,8 +398,7 @@ xzalloc (size)
and reorders the symtab list at the end */
static void
-mdebug_psymtab_to_symtab (pst)
- struct partial_symtab *pst;
+mdebug_psymtab_to_symtab (struct partial_symtab *pst)
{
if (!pst)
@@ -478,8 +427,7 @@ mdebug_psymtab_to_symtab (pst)
/* Find a file descriptor given its index RF relative to a file CF */
static FDR *
-get_rfd (cf, rf)
- int cf, rf;
+get_rfd (int cf, int rf)
{
FDR *fdrs;
register FDR *f;
@@ -491,18 +439,17 @@ 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;
}
/* Return a safer print NAME for a file descriptor */
static char *
-fdr_name (f)
- FDR *f;
+fdr_name (FDR *f)
{
if (f->rss == -1)
return "<stripped file>";
@@ -516,16 +463,19 @@ fdr_name (f)
different sections are relocated via the SECTION_OFFSETS. */
void
-mdebug_build_psymtabs (objfile, swap, info, section_offsets)
- struct objfile *objfile;
- const struct ecoff_debug_swap *swap;
- struct ecoff_debug_info *info;
- struct section_offsets *section_offsets;
+mdebug_build_psymtabs (struct objfile *objfile,
+ const struct ecoff_debug_swap *swap,
+ struct ecoff_debug_info *info)
{
cur_bfd = objfile->obfd;
debug_swap = swap;
debug_info = info;
+ stabsread_new_init ();
+ buildsym_new_init ();
+ free_header_files ();
+ init_header_files ();
+
/* Make sure all the FDR information is swapped in. */
if (info->fdr == (FDR *) NULL)
{
@@ -544,7 +494,20 @@ mdebug_build_psymtabs (objfile, swap, info, section_offsets)
(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
}
- parse_partial_symbols (objfile, section_offsets);
+ parse_partial_symbols (objfile);
+
+ /* Take the text ranges the partial symbol scanner computed for each
+ of the psymtabs and convert it into the canonical form for
+ psymtabs. */
+ {
+ struct partial_symtab *p;
+
+ ALL_OBJFILE_PSYMTABS (objfile, p)
+ {
+ p->textlow = TEXTLOW (p);
+ p->texthigh = TEXTHIGH (p);
+ }
+ }
#if 0
/* Check to make sure file was compiled with -g. If not, warn the
@@ -553,7 +516,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);
}
@@ -578,25 +541,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 */
@@ -604,7 +567,7 @@ static struct parse_stack
/* Enter a new lexical context */
static void
-push_parse_stack ()
+push_parse_stack (void)
{
struct parse_stack *new;
@@ -629,7 +592,7 @@ push_parse_stack ()
/* Exit a lexical context */
static void
-pop_parse_stack ()
+pop_parse_stack (void)
{
if (!top_stack)
return;
@@ -663,9 +626,7 @@ static struct mdebug_pending **pending_list;
/* Check whether we already saw symbol SH in file FH */
static struct mdebug_pending *
-is_pending_symbol (fh, sh)
- FDR *fh;
- char *sh;
+is_pending_symbol (FDR *fh, char *sh)
{
int f_idx = fh - debug_info->fdr;
register struct mdebug_pending *p;
@@ -680,10 +641,7 @@ is_pending_symbol (fh, sh)
/* Add a new symbol SH of type T */
static void
-add_pending (fh, sh, t)
- FDR *fh;
- char *sh;
- struct type *t;
+add_pending (FDR *fh, char *sh, struct type *t)
{
int f_idx = fh - debug_info->fdr;
struct mdebug_pending *p = is_pending_symbol (fh, sh);
@@ -714,16 +672,11 @@ add_pending (fh, sh, t)
SYMR's handled (normally one). */
static int
-parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
- SYMR *sh;
- union aux_ext *ax;
- char *ext_sh;
- int bigend;
- struct section_offsets *section_offsets;
+parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
+ struct section_offsets *section_offsets, struct objfile *objfile)
{
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) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
char *name;
struct symbol *s;
struct block *b;
@@ -746,23 +699,23 @@ 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);
+ sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
- sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA);
+ sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
break;
case scBss:
case scSBss:
- sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS);
+ sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
break;
}
@@ -783,7 +736,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
@@ -814,7 +767,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
@@ -837,21 +790,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;
@@ -874,23 +827,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);
}
}
@@ -923,7 +876,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 ();
@@ -936,7 +889,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;
@@ -957,7 +910,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. */
@@ -988,26 +941,28 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
case stMember:
if (nfields == 0 && type_code == TYPE_CODE_UNDEF)
- /* If the type of the member is Nil (or Void),
- without qualifiers, assume the tag is an
- enumeration.
- 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. */
- if (tsym.index == indexNil
- || (tsym.index == 0 && sh->value == 0))
- type_code = TYPE_CODE_ENUM;
- else
- {
- (*debug_swap->swap_tir_in) (bigend,
- &ax[tsym.index].a_ti,
- &tir);
- if ((tir.bt == btNil || tir.bt == btVoid
- || (tir.bt == btEnum && sh->value == 0))
- && tir.tq0 == tqNil)
- type_code = TYPE_CODE_ENUM;
- }
+ {
+ /* If the type of the member is Nil (or Void),
+ without qualifiers, assume the tag is an
+ enumeration.
+ 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. */
+ if (tsym.index == indexNil
+ || (tsym.index == 0 && sh->value == 0))
+ type_code = TYPE_CODE_ENUM;
+ else
+ {
+ (*debug_swap->swap_tir_in) (bigend,
+ &ax[tsym.index].a_ti,
+ &tir);
+ if ((tir.bt == btNil || tir.bt == btVoid
+ || (tir.bt == btEnum && sh->value == 0))
+ && tir.tq0 == tqNil)
+ type_code = TYPE_CODE_ENUM;
+ }
+ }
nfields++;
if (tsym.value > max_value)
max_value = tsym.value;
@@ -1021,14 +976,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));
@@ -1090,10 +1045,12 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
here.) */
if (type_code == TYPE_CODE_UNDEF)
- if (nfields > 1 && max_value == 0)
- type_code = TYPE_CODE_UNION;
- else
- type_code = TYPE_CODE_STRUCT;
+ {
+ if (nfields > 1 && max_value == 0)
+ type_code = TYPE_CODE_UNION;
+ else
+ type_code = TYPE_CODE_STRUCT;
+ }
/* Create a new type or use the pending type. */
pend = is_pending_symbol (cur_fdr, ext_sh);
@@ -1158,7 +1115,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
enum_sym = ((struct symbol *)
obstack_alloc (&current_objfile->symbol_obstack,
sizeof (struct symbol)));
- memset ((PTR) enum_sym, 0, sizeof (struct symbol));
+ memset (enum_sym, 0, sizeof (struct symbol));
SYMBOL_NAME (enum_sym) =
obsavestring (f->name, strlen (f->name),
&current_objfile->symbol_obstack);
@@ -1208,12 +1165,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)
{
@@ -1230,7 +1187,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;
@@ -1256,7 +1213,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
e = ((struct mips_extra_func_info *)
obstack_alloc (&current_objfile->symbol_obstack,
sizeof (struct mips_extra_func_info)));
- memset ((PTR) e, 0, sizeof (struct mips_extra_func_info));
+ memset (e, 0, sizeof (struct mips_extra_func_info));
SYMBOL_VALUE (s) = (long) e;
e->numargs = top_stack->numargs;
e->pdr.framereg = -1;
@@ -1282,7 +1239,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;
@@ -1292,7 +1249,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);
@@ -1303,6 +1260,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym);
+ TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
iparams++;
break;
default:
@@ -1349,14 +1307,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;
@@ -1364,30 +1322,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;
@@ -1401,30 +1359,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);
@@ -1457,53 +1415,48 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
they are big-endian or little-endian (from fh->fBigendian). */
static struct type *
-parse_type (fd, ax, aux_index, bs, bigend, sym_name)
- int fd;
- union aux_ext *ax;
- unsigned int aux_index;
- int *bs;
- int bigend;
- char *sym_name;
+parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
+ int bigend, char *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 */
};
@@ -1579,8 +1532,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.
@@ -1595,7 +1548,7 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
complain (&bad_fbitfield_complaint, sym_name);
}
else
- *bs = width;
+ *bs = width;
ax++;
}
@@ -1626,7 +1579,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
@@ -1636,8 +1589,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;
@@ -1648,14 +1601,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)
@@ -1683,13 +1636,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);
}
}
@@ -1707,8 +1660,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);
@@ -1747,11 +1700,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++;
}
@@ -1786,7 +1739,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;
}
@@ -1798,13 +1751,8 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
Returns the number of aux symbols we parsed. */
static int
-upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
- int fd;
- struct type **tpp;
- int tq;
- union aux_ext *ax;
- int bigend;
- char *sym_name;
+upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
+ char *sym_name)
{
int off;
struct type *t;
@@ -1849,7 +1797,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);
@@ -1870,21 +1818,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;
@@ -1919,14 +1867,11 @@ upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
to look for the function which contains the MIPS_EFI_SYMBOL_NAME symbol
in question, or NULL to use top_stack->cur_block. */
-static void parse_procedure PARAMS ((PDR *, struct symtab *,
- struct partial_symtab *));
+static void parse_procedure (PDR *, struct symtab *, struct partial_symtab *);
static void
-parse_procedure (pr, search_symtab, pst)
- PDR *pr;
- struct symtab *search_symtab;
- struct partial_symtab *pst;
+parse_procedure (PDR *pr, struct symtab *search_symtab,
+ struct partial_symtab *pst)
{
struct symbol *s, *i;
struct block *b;
@@ -1947,7 +1892,7 @@ parse_procedure (pr, search_symtab, pst)
{
/* external */
EXTR she;
-
+
(*debug_swap->swap_ext_in) (cur_bfd,
((char *) debug_info->external_ext
+ (pr->isym
@@ -1973,12 +1918,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;
@@ -2017,7 +1962,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);
@@ -2033,19 +1978,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 (pst->objfile)).
+ 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);
@@ -2069,7 +2014,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)
@@ -2079,14 +2024,12 @@ parse_procedure (pr, search_symtab, pst)
/* Relocate the extra function info pointed to by the symbol table. */
void
-ecoff_relocate_efi (sym, delta)
- struct symbol *sym;
- CORE_ADDR delta;
+ecoff_relocate_efi (struct symbol *sym, CORE_ADDR delta)
{
struct mips_extra_func_info *e;
e = (struct mips_extra_func_info *) SYMBOL_VALUE (sym);
-
+
e->pdr.adr += delta;
}
@@ -2096,13 +2039,12 @@ ecoff_relocate_efi (sym, delta)
This routine clobbers top_stack->cur_block and ->cur_st. */
-static void parse_external PARAMS ((EXTR *, int, struct section_offsets *));
+static void parse_external (EXTR *, int, struct section_offsets *,
+ struct objfile *);
static void
-parse_external (es, bigend, section_offsets)
- EXTR *es;
- int bigend;
- struct section_offsets *section_offsets;
+parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
+ struct objfile *objfile)
{
union aux_ext *ax;
@@ -2119,7 +2061,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)
@@ -2159,25 +2101,25 @@ 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(). */
- parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets);
+ anyways by parse_symbol(). */
+ parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets, objfile);
break;
default:
break;
@@ -2190,17 +2132,12 @@ parse_external (es, bigend, section_offsets)
numbers can go back and forth, apparently we can live
with that and do not need to reorder our linetables */
-static void parse_lines PARAMS ((FDR *, PDR *, struct linetable *, int,
- struct partial_symtab *, CORE_ADDR));
+static void parse_lines (FDR *, PDR *, struct linetable *, int,
+ struct partial_symtab *, CORE_ADDR);
static void
-parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
- FDR *fh;
- PDR *pr;
- struct linetable *lt;
- int maxlines;
- struct partial_symtab *pst;
- CORE_ADDR lowest_pdr_addr;
+parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
+ struct partial_symtab *pst, CORE_ADDR lowest_pdr_addr)
{
unsigned char *base;
int j, k;
@@ -2223,18 +2160,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;
+ adr = TEXTLOW (pst) + 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;
@@ -2266,19 +2203,14 @@ parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
into a partial_symtab. */
static void
-parse_partial_symbols (objfile, section_offsets)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
+parse_partial_symbols (struct objfile *objfile)
{
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) (bfd *, void *, EXTR *) = debug_swap->swap_ext_in;
+ void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
+ void (*const swap_rfd_in) (bfd *, void *, RFDT *) = debug_swap->swap_rfd_in;
int f_idx, s_idx;
HDRR *hdr = &debug_info->symbolic_header;
/* Running pointers */
@@ -2352,10 +2284,10 @@ parse_partial_symbols (objfile, section_offsets)
Minor hack: -O3 images might claim some global data belongs
to FDR -1. We`ll go along with that */
fdr_to_pst = (struct pst_map *) xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
- old_chain = make_cleanup (free, fdr_to_pst);
+ old_chain = make_cleanup (xfree, fdr_to_pst);
fdr_to_pst++;
{
- struct partial_symtab *pst = new_psymtab ("", objfile, section_offsets);
+ struct partial_symtab *pst = new_psymtab ("", objfile);
fdr_to_pst[-1].pst = pst;
FDR_IDX (pst) = -1;
}
@@ -2365,12 +2297,12 @@ parse_partial_symbols (objfile, section_offsets)
((struct mdebug_pending **)
obstack_alloc (&objfile->psymbol_obstack,
hdr->ifdMax * sizeof (struct mdebug_pending *)));
- memset ((PTR) pending_list, 0,
+ memset (pending_list, 0,
hdr->ifdMax * sizeof (struct mdebug_pending *));
/* Pass 0 over external syms: swap them in. */
ext_block = (EXTR *) xmalloc (hdr->iextMax * sizeof (EXTR));
- make_cleanup (free, ext_block);
+ make_cleanup (xfree, ext_block);
ext_out = (char *) debug_info->external_ext;
ext_out_end = ext_out + hdr->iextMax * external_ext_size;
@@ -2416,124 +2348,170 @@ 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 (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ break;
+ case stStaticProc:
+ /* Load time only static procs */
+ ms_type = mst_file_text;
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ 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 (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ }
+ else if (SC_IS_BSS (ext_in->asym.sc))
+ {
+ ms_type = mst_bss;
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
+ }
+ else if (SC_IS_SBSS (ext_in->asym.sc))
+ {
+ ms_type = mst_bss;
+ svalue += ANOFFSET (objfile->section_offsets,
+ get_section_index (objfile, ".sbss"));
+ }
+ else
+ ms_type = mst_abs;
+ break;
+ case stLabel:
+ /* Label */
+
+ /* On certain platforms, some extra label symbols can be
+ generated by the linker. One possible usage for this kind
+ of symbols is to represent the address of the begining of a
+ given section. For instance, on Tru64 5.1, the address of
+ the _ftext label is the start address of the .text section.
+
+ The storage class of these symbols is usually directly
+ related to the section to which the symbol refers. For
+ instance, on Tru64 5.1, the storage class for the _fdata
+ label is scData, refering to the .data section.
+
+ It is actually possible that the section associated to the
+ storage class of the label does not exist. On True64 5.1
+ for instance, the libm.so shared library does not contain
+ any .data section, although it contains a _fpdata label
+ which storage class is scData... Since these symbols are
+ usually useless for the debugger user anyway, we just
+ discard these symbols.
+ */
+
+ if (SC_IS_TEXT (ext_in->asym.sc))
+ {
+ if (objfile->sect_index_text == -1)
+ continue;
+
+ ms_type = mst_file_text;
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ }
+ else if (SC_IS_DATA (ext_in->asym.sc))
+ {
+ if (objfile->sect_index_data == -1)
+ continue;
+
+ ms_type = mst_file_data;
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ }
+ else if (SC_IS_BSS (ext_in->asym.sc))
+ {
+ if (objfile->sect_index_bss == -1)
+ continue;
+
+ ms_type = mst_file_bss;
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
+ }
+ else if (SC_IS_SBSS (ext_in->asym.sc))
+ {
+ const int sbss_sect_index = get_section_index (objfile, ".sbss");
+
+ if (sbss_sect_index == -1)
+ continue;
+
+ ms_type = mst_file_bss;
+ svalue += ANOFFSET (objfile->section_offsets, sbss_sect_index);
+ }
+ 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++)
@@ -2551,16 +2529,16 @@ 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;
if (relocatable || textlow != 0)
- textlow += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+ textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
}
else
textlow = 0;
- pst = start_psymtab_common (objfile, section_offsets,
+ pst = start_psymtab_common (objfile, objfile->section_offsets,
fdr_name (fh),
textlow,
objfile->global_psymbols.next,
@@ -2568,9 +2546,11 @@ parse_partial_symbols (objfile, section_offsets)
pst->read_symtab_private = ((char *)
obstack_alloc (&objfile->psymbol_obstack,
sizeof (struct symloc)));
- memset ((PTR) pst->read_symtab_private, 0, sizeof (struct symloc));
+ memset (pst->read_symtab_private, 0, sizeof (struct symloc));
save_pst = pst;
+ TEXTLOW (pst) = pst->textlow;
+ TEXTHIGH (pst) = pst->texthigh;
FDR_IDX (pst) = f_idx;
CUR_BFD (pst) = cur_bfd;
DEBUG_SWAP (pst) = debug_swap;
@@ -2582,15 +2562,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)
@@ -2606,14 +2586,14 @@ parse_partial_symbols (objfile, section_offsets)
psymtab_language = prev_language;
PST_PRIVATE (pst)->pst_language = psymtab_language;
- pst->texthigh = pst->textlow;
+ TEXTHIGH (pst) = TEXTLOW (pst);
/* 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)
{
@@ -2634,7 +2614,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))
@@ -2643,8 +2623,8 @@ parse_partial_symbols (objfile, section_offsets)
{
CORE_ADDR procaddr;
long isym;
-
- sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
if (sh.st == stStaticProc)
{
namestring = debug_info->ss + fh->issBase + sh.iss;
@@ -2652,7 +2632,7 @@ parse_partial_symbols (objfile, section_offsets)
sh.value,
mst_file_text,
NULL,
- SECT_OFF_TEXT,
+ SECT_OFF_TEXT (objfile),
NULL,
objfile);
}
@@ -2671,12 +2651,12 @@ 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 = procaddr;
- if (high > pst->texthigh)
- pst->texthigh = high;
+ && (TEXTLOW (pst) == 0 || procaddr < TEXTLOW (pst)))
+ TEXTLOW (pst) = procaddr;
+ if (high > TEXTHIGH (pst))
+ TEXTHIGH (pst) = high;
}
}
else if (sh.st == stStatic)
@@ -2695,12 +2675,12 @@ 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 (objfile->section_offsets, SECT_OFF_DATA (objfile));
prim_record_minimal_symbol_and_info (namestring,
sh.value,
mst_file_data,
NULL,
- SECT_OFF_DATA,
+ SECT_OFF_DATA (objfile),
NULL,
objfile);
break;
@@ -2709,12 +2689,12 @@ 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 (objfile->section_offsets, SECT_OFF_BSS (objfile));
prim_record_minimal_symbol_and_info (namestring,
sh.value,
mst_file_bss,
NULL,
- SECT_OFF_BSS,
+ SECT_OFF_BSS (objfile),
NULL,
objfile);
break;
@@ -2726,7 +2706,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;
@@ -2740,7 +2720,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;
@@ -2748,31 +2728,565 @@ 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);
- strcpy (stabstring, stabstring1);
+ {
+ stabstring = xmalloc (len + len2 + 1);
+ strcpy (stabstring, stabstring1);
+ }
strcpy (stabstring + len, stabstring2);
len += len2;
}
-#define SET_NAMESTRING() \
- namestring = stabstring
-#define CUR_SYMBOL_TYPE type_code
-#define CUR_SYMBOL_VALUE sh.value
-#define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
- pst = save_pst
-#define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set) (void)0
-#define HANDLE_RBRAC(val) \
- if ((val) > save_pst->texthigh) save_pst->texthigh = (val);
-#include "partial-stab.h"
-
- if (stabstring
+ switch (type_code)
+ {
+ static struct complaint function_outside_compilation_unit = {
+ "function `%s' appears to be defined outside of all compilation units", 0, 0
+ };
+ char *p;
+ /*
+ * Standard, external, non-debugger, symbols
+ */
+
+ case N_TEXT | N_EXT:
+ case N_NBTEXT | N_EXT:
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ goto record_it;
+
+ case N_DATA | N_EXT:
+ case N_NBDATA | N_EXT:
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ 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? */
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
+ goto record_it;
+
+ case N_ABS | N_EXT:
+ record_it:
+ continue;
+
+ /* Standard, local, non-debugger, symbols */
+
+ 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. */
+
+ case N_FN:
+ case N_FN_SEQ:
+ case N_TEXT:
+ continue;
+
+ case N_DATA:
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ goto record_it;
+
+ case N_UNDF | N_EXT:
+ continue; /* Just undefined, not COMMON */
+
+ case N_UNDF:
+ 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:
+ {
+ CORE_ADDR valu;
+ static int prev_so_symnum = -10;
+ static int first_so_symnum;
+ char *p;
+ int prev_textlow_not_set;
+
+ valu = sh.value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+
+ 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. */
+
+ if (sh.value == 0)
+ {
+ textlow_not_set = 1;
+ valu = 0;
+ }
+ else
+ textlow_not_set = 0;
+#else
+ textlow_not_set = 0;
+#endif
+ 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)
+ {
+ pst = (struct partial_symtab *) 0;
+ includes_used = 0;
+ dependencies_used = 0;
+ }
+ }
+
+ prev_so_symnum = symnum;
+
+ /* End the current partial symtab and start a new one */
+
+ /* SET_NAMESTRING ();*/
+ namestring = stabstring;
+
+ /* 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 = save_pst;
+ continue;
+ }
+
+ case N_BINCL:
+ continue;
+
+ case N_SOL:
+ {
+ enum language tmp_language;
+ /* Mark down an include file in the current psymtab */
+
+ /* SET_NAMESTRING ();*/
+ namestring = stabstring;
+
+ 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]))
+ {
+ i = -1;
+ break;
+ }
+ if (i == -1)
+ continue;
+ }
+
+ 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). */
+
+ 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. */
+
+ /* SET_NAMESTRING ();*/
+ namestring = stabstring;
+ p = (char *) strchr (namestring, ':');
+ if (!p)
+ continue; /* Not a debugging symbol. */
+
+
+
+ /* Main processing section for debugging symbols which
+ the initial read through the symbol tables needs to worry
+ about. If we reach this point, the symbol which we are
+ considering is definitely one we are interested in.
+ p must also contain the (valid) index into the namestring
+ which indicates the debugging type symbol. */
+
+ switch (p[1])
+ {
+ case 'S':
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+#ifdef STATIC_TRANSFORM_NAME
+ namestring = STATIC_TRANSFORM_NAME (namestring);
+#endif
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_STATIC,
+ &objfile->static_psymbols,
+ 0, sh.value,
+ psymtab_language, objfile);
+ continue;
+ case 'G':
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ /* 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, sh.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,
+ sh.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,
+ sh.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,
+ sh.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,
+ sh.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++;
+ }
+
+ /* 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, sh.value,
+ 0, psymtab_language, objfile);
+ continue;
+
+ case 'f':
+ if (! pst)
+ {
+ int name_len = p - namestring;
+ char *name = xmalloc (name_len + 1);
+ memcpy (name, namestring, name_len);
+ name[name_len] = '\0';
+ complain (&function_outside_compilation_unit, name);
+ xfree (name);
+ }
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_BLOCK,
+ &objfile->static_psymbols,
+ 0, sh.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':
+ if (! pst)
+ {
+ int name_len = p - namestring;
+ char *name = xmalloc (name_len + 1);
+ memcpy (name, namestring, name_len);
+ name[name_len] = '\0';
+ complain (&function_outside_compilation_unit, name);
+ xfree (name);
+ }
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ add_psymbol_to_list (namestring, p - namestring,
+ VAR_NAMESPACE, LOC_BLOCK,
+ &objfile->global_psymbols,
+ 0, sh.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:
+ continue;
+
+ case N_ENDM:
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+ /* Solaris 2 end of module, finish current partial symbol table.
+ END_PSYMTAB will set TEXTHIGH (pst) to the proper value, which
+ is necessary if a module compiled without debugging info
+ follows this module. */
+ if (pst)
+ {
+ pst = (struct partial_symtab *) 0;
+ includes_used = 0;
+ dependencies_used = 0;
+ }
+#endif
+ continue;
+
+ case N_RBRAC:
+ if (sh.value > TEXTHIGH (save_pst))
+ TEXTHIGH (save_pst) = sh.value;
+ continue;
+ 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 (type_code)); /*CUR_SYMBOL_TYPE*/
+ continue;
+ }
+ if (stabstring
&& stabstring != debug_info->ss + fh->issBase + sh.iss)
- free (stabstring);
+ xfree (stabstring);
}
- /* end - Handle continuation */
+ /* end - Handle continuation */
}
}
else
@@ -2795,7 +3309,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)))
{
@@ -2813,18 +3327,18 @@ parse_partial_symbols (objfile, section_offsets)
/* The value of a stEnd symbol is the displacement from the
corresponding start symbol value, do not relocate it. */
if (sh.st != stEnd)
- sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
- sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
break;
case scBss:
case scSBss:
- sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
+ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
break;
}
@@ -2837,7 +3351,7 @@ parse_partial_symbols (objfile, section_offsets)
case stStaticProc:
prim_record_minimal_symbol_and_info (name, sh.value,
mst_file_text, NULL,
- SECT_OFF_TEXT, NULL,
+ SECT_OFF_TEXT (objfile), NULL,
objfile);
/* FALLTHROUGH */
@@ -2858,18 +3372,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 */
}
@@ -2898,35 +3412,35 @@ parse_partial_symbols (objfile, section_offsets)
/* Kludge for Irix 5.2 zero fh->adr. */
if (!relocatable
- && (pst->textlow == 0 || procaddr < pst->textlow))
- pst->textlow = procaddr;
+ && (TEXTLOW (pst) == 0 || procaddr < TEXTLOW (pst)))
+ TEXTLOW (pst) = procaddr;
high = procaddr + sh.value;
- if (high > pst->texthigh)
- pst->texthigh = high;
+ if (high > TEXTHIGH (pst))
+ TEXTHIGH (pst) = high;
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,
+ SECT_OFF_DATA (objfile),
NULL,
objfile);
else
prim_record_minimal_symbol_and_info (name, sh.value,
mst_file_bss, NULL,
- SECT_OFF_BSS,
+ SECT_OFF_BSS (objfile),
NULL,
objfile);
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))
@@ -2941,11 +3455,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)
{
@@ -3009,11 +3523,11 @@ parse_partial_symbols (objfile, section_offsets)
CORE_ADDR svalue;
if (ext_ptr->ifd != f_idx)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
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;
@@ -3021,18 +3535,18 @@ parse_partial_symbols (objfile, section_offsets)
{
case scText:
case scRConst:
- svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
- svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
break;
case scBss:
case scSBss:
- svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
+ svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
break;
}
@@ -3058,7 +3572,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;
@@ -3074,48 +3588,48 @@ 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,
- -1, save_pst->texthigh,
- dependency_list, dependencies_used, textlow_not_set);
+ psymtab_include_list, includes_used,
+ -1, TEXTHIGH (save_pst),
+ dependency_list, dependencies_used, textlow_not_set);
includes_used = 0;
dependencies_used = 0;
- if (objfile->ei.entry_point >= save_pst->textlow &&
- objfile->ei.entry_point < save_pst->texthigh)
+ if (objfile->ei.entry_point >= TEXTLOW (save_pst) &&
+ objfile->ei.entry_point < TEXTHIGH (save_pst))
{
- objfile->ei.entry_file_lowpc = save_pst->textlow;
- objfile->ei.entry_file_highpc = save_pst->texthigh;
+ objfile->ei.entry_file_lowpc = TEXTLOW (save_pst);
+ objfile->ei.entry_file_highpc = TEXTHIGH (save_pst);
}
/* 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
+ && TEXTLOW (save_pst) != 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
+ && TEXTLOW (save_pst) >= TEXTLOW (pst)
+ && TEXTLOW (save_pst) < TEXTHIGH (pst)
+ && TEXTHIGH (save_pst) > TEXTHIGH (pst))
+ {
+ objfile->flags |= OBJF_REORDERED;
+ break;
+ }
+ }
}
}
@@ -3125,7 +3639,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. */
@@ -3133,7 +3647,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 **)
@@ -3159,7 +3673,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;
}
@@ -3179,17 +3693,13 @@ parse_partial_symbols (objfile, section_offsets)
all the the enum constants to the partial symbol table. */
static void
-handle_psymbol_enumerators (objfile, fh, stype, svalue)
- struct objfile *objfile;
- FDR *fh;
- int stype;
- CORE_ADDR svalue;
+handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
+ 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) (bfd *, void *, 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;
@@ -3200,12 +3710,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;
@@ -3238,7 +3748,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,
@@ -3247,9 +3757,10 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
}
}
+/* Get the next symbol. OBJFILE is unused. */
+
static char *
-mdebug_next_symbol_text (objfile)
- struct objfile *objfile; /* argument objfile is currently unused */
+mdebug_next_symbol_text (struct objfile *objfile)
{
SYMR sh;
@@ -3273,19 +3784,18 @@ mdebug_next_symbol_text (objfile)
The flow of control and even the memory allocation differs. FIXME. */
static void
-psymtab_to_symtab_1 (pst, filename)
- struct partial_symtab *pst;
- char *filename;
+psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
{
bfd_size_type external_sym_size;
bfd_size_type external_pdr_size;
- void (*swap_sym_in) PARAMS ((bfd *, PTR, SYMR *));
- void (*swap_pdr_in) PARAMS ((bfd *, PTR, PDR *));
+ void (*swap_sym_in) (bfd *, void *, SYMR *);
+ void (*swap_pdr_in) (bfd *, void *, PDR *);
int i;
- struct symtab *st;
+ struct symtab *st = NULL;
FDR *fh;
struct linetable *lines;
CORE_ADDR lowest_pdr_addr = 0;
+ int last_symtab_ended = 0;
if (pst->readin)
return;
@@ -3318,7 +3828,7 @@ psymtab_to_symtab_1 (pst, filename)
/* Do nothing if this is a dummy psymtab. */
if (pst->n_global_syms == 0 && pst->n_static_syms == 0
- && pst->textlow == 0 && pst->texthigh == 0)
+ && TEXTLOW (pst) == 0 && TEXTHIGH (pst) == 0)
return;
/* Now read the symbols for this symtab */
@@ -3387,12 +3897,34 @@ 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,
- pst->section_offsets, pst->objfile);
+ /* If we found a trailing N_SO with no name, process
+ it here instead of in process_one_symbol, so we
+ can keep a handle to its symtab. The symtab
+ would otherwise be ended twice, once in
+ process_one_symbol, and once after this loop. */
+ if (type_code == N_SO
+ && last_source_file
+ && previous_stab_code != (unsigned char) N_SO
+ && *name == '\000')
+ {
+ valu += ANOFFSET (pst->section_offsets,
+ SECT_OFF_TEXT (pst->objfile));
+ previous_stab_code = N_SO;
+ st = end_symtab (valu, pst->objfile,
+ SECT_OFF_TEXT (pst->objfile));
+ end_stabs ();
+ last_symtab_ended = 1;
+ }
+ else
+ {
+ last_symtab_ended = 0;
+ process_one_symbol (type_code, 0, valu, name,
+ pst->section_offsets, pst->objfile);
+ }
}
/* Similarly a hack. */
else if (name[0] == '#')
@@ -3405,12 +3937,12 @@ 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));
+ memset (e, 0, sizeof (struct mips_extra_func_info));
SYMBOL_NAMESPACE (s) = LABEL_NAMESPACE;
SYMBOL_CLASS (s) = LOC_CONST;
SYMBOL_TYPE (s) = mdebug_type_void;
@@ -3430,7 +3962,7 @@ psymtab_to_symtab_1 (pst, filename)
else
{
/* Handle encoded stab line number. */
- valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT);
+ valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile));
record_line (current_subfile, sh.index, valu);
}
}
@@ -3441,18 +3973,22 @@ psymtab_to_symtab_1 (pst, filename)
else
complain (&stab_unknown_complaint, name);
}
- st = end_symtab (pst->texthigh, pst->objfile, SECT_OFF_TEXT);
- end_stabs ();
+
+ if (! last_symtab_ended)
+ {
+ st = end_symtab (TEXTHIGH (pst), pst->objfile, SECT_OFF_TEXT (pst->objfile));
+ 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)
@@ -3465,7 +4001,7 @@ psymtab_to_symtab_1 (pst, filename)
PDR *pdr_in_end;
pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
- old_chain = make_cleanup (free, pr_block);
+ old_chain = make_cleanup (xfree, pr_block);
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
@@ -3478,7 +4014,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)
@@ -3530,7 +4066,7 @@ psymtab_to_symtab_1 (pst, filename)
top_stack->cur_st = st;
top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (st),
STATIC_BLOCK);
- BLOCK_START (top_stack->cur_block) = pst->textlow;
+ BLOCK_START (top_stack->cur_block) = TEXTLOW (pst);
BLOCK_END (top_stack->cur_block) = 0;
top_stack->blocktype = stFile;
top_stack->maxsyms = 2 * f_max;
@@ -3556,7 +4092,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, pst->objfile);
sym_ptr += c * external_sym_size;
}
@@ -3574,7 +4110,7 @@ psymtab_to_symtab_1 (pst, filename)
pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
- old_chain = make_cleanup (free, pr_block);
+ old_chain = make_cleanup (xfree, pr_block);
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
@@ -3611,8 +4147,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);
@@ -3624,11 +4160,11 @@ psymtab_to_symtab_1 (pst, filename)
ext_ptr = PST_PRIVATE (pst)->extern_tab;
for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
- parse_external (ext_ptr, fh->fBigendian, pst->section_offsets);
+ parse_external (ext_ptr, fh->fBigendian, pst->section_offsets, pst->objfile);
/* 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:",
@@ -3642,7 +4178,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);
@@ -3660,9 +4196,7 @@ psymtab_to_symtab_1 (pst, filename)
to an opaque aggregate type, else 0. */
static int
-has_opaque_xref (fh, sh)
- FDR *fh;
- SYMR *sh;
+has_opaque_xref (FDR *fh, SYMR *sh)
{
TIR tir;
union aux_ext *ax;
@@ -3694,14 +4228,8 @@ has_opaque_xref (fh, sh)
Return value says how many aux symbols we ate. */
static int
-cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
- int fd;
- union aux_ext *ax;
- struct type **tpp;
- enum type_code type_code; /* Use to alloc new type if none is found. */
- char **pname;
- int bigend;
- char *sym_name;
+cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_code, /* Use to alloc new type if none is found. */
+ char **pname, int bigend, char *sym_name)
{
RNDXR rn[1];
unsigned int rf;
@@ -3712,7 +4240,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);
@@ -3733,8 +4261,7 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
if (rf == -1)
{
*pname = "<undefined>";
- *tpp = init_type (type_code, 0, 0, (char *) NULL, current_objfile);
- TYPE_FLAGS (*tpp) |= TYPE_FLAG_STUB;
+ *tpp = init_type (type_code, 0, TYPE_FLAG_STUB, (char *) NULL, current_objfile);
return result;
}
@@ -3776,7 +4303,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>";
@@ -3801,14 +4328,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. */
@@ -3823,7 +4350,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:
@@ -3838,16 +4365,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);
@@ -3873,7 +4400,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);
}
@@ -3898,28 +4425,22 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
keeping the symtab sorted */
static struct symbol *
-mylookup_symbol (name, block, namespace, class)
- char *name;
- register struct block *block;
- namespace_enum namespace;
- enum address_class class;
+mylookup_symbol (char *name, register struct block *block,
+ namespace_enum namespace, enum address_class class)
{
- register int bot, top, inc;
- register struct symbol *sym;
+ int i, inc;
+ struct symbol *sym;
- bot = 0;
- top = BLOCK_NSYMS (block);
inc = name[0];
- while (bot < top)
+ ALL_BLOCK_SYMBOLS (block, i, sym)
{
- sym = BLOCK_SYM (block, bot);
if (SYMBOL_NAME (sym)[0] == inc
&& SYMBOL_NAMESPACE (sym) == namespace
&& SYMBOL_CLASS (sym) == class
&& strcmp (SYMBOL_NAME (sym), name) == 0)
return sym;
- bot++;
}
+
block = BLOCK_SUPERBLOCK (block);
if (block)
return mylookup_symbol (name, block, namespace, class);
@@ -3933,9 +4454,7 @@ mylookup_symbol (name, block, namespace, class)
that's the only time we know how big the block is. FIXME. */
static void
-add_symbol (s, b)
- struct symbol *s;
- struct block *b;
+add_symbol (struct symbol *s, struct block *b)
{
int nsyms = BLOCK_NSYMS (b)++;
struct block *origb;
@@ -3946,13 +4465,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)
@@ -3968,13 +4487,11 @@ add_symbol (s, b)
/* Add a new block B to a symtab S */
static void
-add_block (b, s)
- struct block *b;
- struct symtab *s;
+add_block (struct block *b, struct symtab *s)
{
struct blockvector *bv = BLOCKVECTOR (s);
- bv = (struct blockvector *) xrealloc ((PTR) bv,
+ bv = (struct blockvector *) xrealloc ((void *) bv,
(sizeof (struct blockvector)
+ BLOCKVECTOR_NBLOCKS (bv)
* sizeof (bv->block)));
@@ -4000,11 +4517,7 @@ add_block (b, s)
This is another reason why -ggdb debugging format is preferable. */
static int
-add_line (lt, lineno, adr, last)
- struct linetable *lt;
- int lineno;
- CORE_ADDR adr;
- int last;
+add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
{
/* DEC c89 sometimes produces zero linenos which confuse gdb.
Change them to something sensible. */
@@ -4026,9 +4539,7 @@ add_line (lt, lineno, adr, last)
/* Blocks with a smaller low bound should come first */
static int
-compare_blocks (arg1, arg2)
- const PTR arg1;
- const PTR arg2;
+compare_blocks (const void *arg1, const void *arg2)
{
register int addr_diff;
struct block **b1 = (struct block **) arg1;
@@ -4045,8 +4556,7 @@ compare_blocks (arg1, arg2)
as required by some MI search routines */
static void
-sort_blocks (s)
- struct symtab *s;
+sort_blocks (struct symtab *s)
{
struct blockvector *bv = BLOCKVECTOR (s);
@@ -4097,11 +4607,7 @@ sort_blocks (s)
MAXSYMS and linenumbers MAXLINES we'll put in it */
static struct symtab *
-new_symtab (name, maxsyms, maxlines, objfile)
- char *name;
- int maxsyms;
- int maxlines;
- struct objfile *objfile;
+new_symtab (char *name, int maxsyms, int maxlines, struct objfile *objfile)
{
struct symtab *s = allocate_symtab (name, objfile);
@@ -4116,29 +4622,26 @@ new_symtab (name, maxsyms, maxlines, objfile)
s->free_code = free_linetable;
s->debugformat = obsavestring ("ECOFF", 5,
- &objfile -> symbol_obstack);
+ &objfile->symbol_obstack);
return (s);
}
/* Allocate a new partial_symtab NAME */
static struct partial_symtab *
-new_psymtab (name, objfile, section_offsets)
- char *name;
- struct objfile *objfile;
- struct section_offsets *section_offsets;
+new_psymtab (char *name, struct objfile *objfile)
{
struct partial_symtab *psymtab;
psymtab = allocate_psymtab (name, objfile);
- psymtab->section_offsets = section_offsets;
+ psymtab->section_offsets = objfile->section_offsets;
/* Keep a backpointer to the file's symbols */
psymtab->read_symtab_private = ((char *)
obstack_alloc (&objfile->psymbol_obstack,
sizeof (struct symloc)));
- memset ((PTR) psymtab->read_symtab_private, 0, sizeof (struct symloc));
+ memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
CUR_BFD (psymtab) = cur_bfd;
DEBUG_SWAP (psymtab) = debug_swap;
DEBUG_INFO (psymtab) = debug_info;
@@ -4155,8 +4658,7 @@ new_psymtab (name, objfile, section_offsets)
proper size to allocate. */
static struct linetable *
-new_linetable (size)
- int size;
+new_linetable (int size)
{
struct linetable *l;
@@ -4173,11 +4675,10 @@ new_linetable (size)
calculating the proper size to allocate. */
static struct linetable *
-shrink_linetable (lt)
- struct linetable *lt;
+shrink_linetable (struct linetable *lt)
{
- return (struct linetable *) xrealloc ((PTR) lt,
+ return (struct linetable *) xrealloc ((void *) lt,
(sizeof (struct linetable)
+ ((lt->nitems - 1)
* sizeof (lt->item))));
@@ -4186,8 +4687,7 @@ shrink_linetable (lt)
/* Allocate and zero a new blockvector of NBLOCKS blocks. */
static struct blockvector *
-new_bvect (nblocks)
- int nblocks;
+new_bvect (int nblocks)
{
struct blockvector *bv;
int size;
@@ -4203,8 +4703,7 @@ new_bvect (nblocks)
/* Allocate and zero a new block of MAXSYMS symbols */
static struct block *
-new_block (maxsyms)
- int maxsyms;
+new_block (int maxsyms)
{
int size = sizeof (struct block) + (maxsyms - 1) * sizeof (struct symbol *);
@@ -4215,9 +4714,7 @@ new_block (maxsyms)
Shrink_block can also be used by add_symbol to grow a block. */
static struct block *
-shrink_block (b, s)
- struct block *b;
- struct symtab *s;
+shrink_block (struct block *b, struct symtab *s)
{
struct block *new;
struct blockvector *bv = BLOCKVECTOR (s);
@@ -4225,13 +4722,13 @@ shrink_block (b, s)
/* Just reallocate it and fix references to the old one */
- new = (struct block *) xrealloc ((PTR) b,
+ new = (struct block *) xrealloc ((void *) b,
(sizeof (struct block)
+ ((BLOCK_NSYMS (b) - 1)
* 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++)
@@ -4245,14 +4742,13 @@ shrink_block (b, s)
/* Create a new symbol with printname NAME */
static struct symbol *
-new_symbol (name)
- char *name;
+new_symbol (char *name)
{
struct symbol *s = ((struct symbol *)
obstack_alloc (&current_objfile->symbol_obstack,
sizeof (struct symbol)));
- memset ((PTR) s, 0, sizeof (*s));
+ memset (s, 0, sizeof (*s));
SYMBOL_NAME (s) = obsavestring (name, strlen (name),
&current_objfile->symbol_obstack);
SYMBOL_LANGUAGE (s) = psymtab_language;
@@ -4263,8 +4759,7 @@ new_symbol (name)
/* Create a new type with printname NAME */
static struct type *
-new_type (name)
- char *name;
+new_type (char *name)
{
struct type *t;
@@ -4280,11 +4775,8 @@ new_type (name)
it as normal. */
void
-elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
- struct objfile *objfile;
- const struct ecoff_debug_swap *swap;
- asection *sec;
- struct section_offsets *section_offsets;
+elfmdebug_build_psymtabs (struct objfile *objfile,
+ const struct ecoff_debug_swap *swap, asection *sec)
{
bfd *abfd = objfile->obfd;
struct ecoff_debug_info *info;
@@ -4297,7 +4789,7 @@ elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
error ("Error reading ECOFF debugging information: %s",
bfd_errmsg (bfd_get_error ()));
- mdebug_build_psymtabs (objfile, swap, info, section_offsets);
+ mdebug_build_psymtabs (objfile, swap, info);
}
@@ -4319,7 +4811,7 @@ elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
#ifdef TM_MIPS_H
void
-fixup_sigtramp ()
+fixup_sigtramp (void)
{
struct symbol *s;
struct symtab *st;
@@ -4384,8 +4876,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;
@@ -4418,10 +4910,10 @@ fixup_sigtramp ()
BLOCK_SYM (b, BLOCK_NSYMS (b)++) = s;
}
-#endif /* TM_MIPS_H */
+#endif /* TM_MIPS_H */
void
-_initialize_mdebugread ()
+_initialize_mdebugread (void)
{
mdebug_type_void =
init_type (TYPE_CODE_VOID, 1,
@@ -4479,7 +4971,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);
diff --git a/contrib/gdb/gdb/mem-break.c b/contrib/gdb/gdb/mem-break.c
index b0a1b4f..a67e2a5 100644
--- a/contrib/gdb/gdb/mem-break.c
+++ b/contrib/gdb/gdb/mem-break.c
@@ -1,22 +1,24 @@
/* Simulate breakpoints by patching locations in the target system, for GDB.
- Copyright 1990, 1991, 1995 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000
+ 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"
@@ -39,15 +41,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
for inserting the breakpoint. */
unsigned char *
-memory_breakpoint_from_pc (pcptr, lenptr)
- CORE_ADDR *pcptr;
- int *lenptr;
+memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
/* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
breakpoint. On some machines, breakpoints are handled by the
target environment and we don't have to worry about them here. */
#ifdef BIG_BREAKPOINT
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
static unsigned char big_break_insn[] = BIG_BREAKPOINT;
*lenptr = sizeof (big_break_insn);
@@ -55,7 +55,7 @@ memory_breakpoint_from_pc (pcptr, lenptr)
}
#endif
#ifdef LITTLE_BREAKPOINT
- if (TARGET_BYTE_ORDER != BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
{
static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
*lenptr = sizeof (little_break_insn);
@@ -83,9 +83,7 @@ memory_breakpoint_from_pc (pcptr, lenptr)
is accomplished via BREAKPOINT_MAX). */
int
-memory_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+default_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int val;
unsigned char *bp;
@@ -101,16 +99,14 @@ 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;
}
int
-memory_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+default_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
unsigned char *bp;
int bplen;
@@ -122,3 +118,16 @@ memory_remove_breakpoint (addr, contents_cache)
return target_write_memory (addr, contents_cache, bplen);
}
+
+
+int
+memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
+{
+ return MEMORY_INSERT_BREAKPOINT(addr, contents_cache);
+}
+
+int
+memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
+{
+ return MEMORY_REMOVE_BREAKPOINT(addr, contents_cache);
+}
diff --git a/contrib/gdb/gdb/memattr.c b/contrib/gdb/gdb/memattr.c
new file mode 100644
index 0000000..7387e8d
--- /dev/null
+++ b/contrib/gdb/gdb/memattr.c
@@ -0,0 +1,535 @@
+/* Memory attributes support, for GDB.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "command.h"
+#include "gdbcmd.h"
+#include "memattr.h"
+#include "target.h"
+#include "value.h"
+#include "language.h"
+#include "gdb_string.h"
+
+const struct mem_attrib default_mem_attrib =
+{
+ MEM_RW, /* mode */
+ MEM_WIDTH_UNSPECIFIED,
+ 0, /* hwbreak */
+ 0, /* cache */
+ 0 /* verify */
+};
+
+static struct mem_region *mem_region_chain = NULL;
+static int mem_number = 0;
+
+static struct mem_region *
+create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
+ const struct mem_attrib *attrib)
+{
+ struct mem_region *n, *new;
+
+ /* lo == hi is a useless empty region */
+ if (lo >= hi)
+ {
+ printf_unfiltered ("invalid memory region: low >= high\n");
+ return NULL;
+ }
+
+ n = mem_region_chain;
+ while (n)
+ {
+ /* overlapping node */
+ if ((lo >= n->lo && lo < n->hi) ||
+ (hi > n->lo && hi <= n->hi))
+ {
+ printf_unfiltered ("overlapping memory region\n");
+ return NULL;
+ }
+ n = n->next;
+ }
+
+ new = xmalloc (sizeof (struct mem_region));
+ new->lo = lo;
+ new->hi = hi;
+ new->number = ++mem_number;
+ new->enabled_p = 1;
+ new->attrib = *attrib;
+
+ /* link in new node */
+ new->next = mem_region_chain;
+ mem_region_chain = new;
+
+ return new;
+}
+
+static void
+delete_mem_region (struct mem_region *m)
+{
+ xfree (m);
+}
+
+/*
+ * Look up the memory region cooresponding to ADDR.
+ */
+struct mem_region *
+lookup_mem_region (CORE_ADDR addr)
+{
+ static struct mem_region region;
+ struct mem_region *m;
+ CORE_ADDR lo;
+ CORE_ADDR hi;
+
+ /* First we initialize LO and HI so that they describe the entire
+ memory space. As we process the memory region chain, they are
+ redefined to describe the minimal region containing ADDR. LO
+ and HI are used in the case where no memory region is defined
+ that contains ADDR. If a memory region is disabled, it is
+ treated as if it does not exist. */
+
+ lo = (CORE_ADDR) 0;
+ hi = (CORE_ADDR) ~ 0;
+
+ for (m = mem_region_chain; m; m = m->next)
+ {
+ if (m->enabled_p == 1)
+ {
+ if (addr >= m->lo && addr < m->hi)
+ return m;
+
+ if (addr >= m->hi && lo < m->hi)
+ lo = m->hi;
+
+ if (addr <= m->lo && hi > m->lo)
+ hi = m->lo;
+ }
+ }
+
+ /* Because no region was found, we must cons up one based on what
+ was learned above. */
+ region.lo = lo;
+ region.hi = hi;
+ region.attrib = default_mem_attrib;
+ return &region;
+}
+
+
+static void
+mem_command (char *args, int from_tty)
+{
+ CORE_ADDR lo, hi;
+ char *tok;
+ struct mem_attrib attrib;
+
+ if (!args)
+ error_no_arg ("No mem");
+
+ tok = strtok (args, " \t");
+ if (!tok)
+ error ("no lo address");
+ lo = parse_and_eval_address (tok);
+
+ tok = strtok (NULL, " \t");
+ if (!tok)
+ error ("no hi address");
+ hi = parse_and_eval_address (tok);
+
+ attrib = default_mem_attrib;
+ while ((tok = strtok (NULL, " \t")) != NULL)
+ {
+ if (strcmp (tok, "rw") == 0)
+ attrib.mode = MEM_RW;
+ else if (strcmp (tok, "ro") == 0)
+ attrib.mode = MEM_RO;
+ else if (strcmp (tok, "wo") == 0)
+ attrib.mode = MEM_WO;
+
+ else if (strcmp (tok, "8") == 0)
+ attrib.width = MEM_WIDTH_8;
+ else if (strcmp (tok, "16") == 0)
+ {
+ if ((lo % 2 != 0) || (hi % 2 != 0))
+ error ("region bounds not 16 bit aligned");
+ attrib.width = MEM_WIDTH_16;
+ }
+ else if (strcmp (tok, "32") == 0)
+ {
+ if ((lo % 4 != 0) || (hi % 4 != 0))
+ error ("region bounds not 32 bit aligned");
+ attrib.width = MEM_WIDTH_32;
+ }
+ else if (strcmp (tok, "64") == 0)
+ {
+ if ((lo % 8 != 0) || (hi % 8 != 0))
+ error ("region bounds not 64 bit aligned");
+ attrib.width = MEM_WIDTH_64;
+ }
+
+#if 0
+ else if (strcmp (tok, "hwbreak") == 0)
+ attrib.hwbreak = 1;
+ else if (strcmp (tok, "swbreak") == 0)
+ attrib.hwbreak = 0;
+#endif
+
+ else if (strcmp (tok, "cache") == 0)
+ attrib.cache = 1;
+ else if (strcmp (tok, "nocache") == 0)
+ attrib.cache = 0;
+
+#if 0
+ else if (strcmp (tok, "verify") == 0)
+ attrib.verify = 1;
+ else if (strcmp (tok, "noverify") == 0)
+ attrib.verify = 0;
+#endif
+
+ else
+ error ("unknown attribute: %s", tok);
+ }
+
+ create_mem_region (lo, hi, &attrib);
+}
+
+
+static void
+mem_info_command (char *args, int from_tty)
+{
+ struct mem_region *m;
+ struct mem_attrib *attrib;
+
+ if (!mem_region_chain)
+ {
+ printf_unfiltered ("There are no memory regions defined.\n");
+ return;
+ }
+
+ printf_filtered ("Num ");
+ printf_filtered ("Enb ");
+ printf_filtered ("Low Addr ");
+ if (TARGET_ADDR_BIT > 32)
+ printf_filtered (" ");
+ printf_filtered ("High Addr ");
+ if (TARGET_ADDR_BIT > 32)
+ printf_filtered (" ");
+ printf_filtered ("Attrs ");
+ printf_filtered ("\n");
+
+ for (m = mem_region_chain; m; m = m->next)
+ {
+ char *tmp;
+ printf_filtered ("%-3d %-3c\t",
+ m->number,
+ m->enabled_p ? 'y' : 'n');
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "08l");
+ else
+ tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "016l");
+
+ printf_filtered ("%s ", tmp);
+
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "08l");
+ else
+ tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "016l");
+
+ printf_filtered ("%s ", tmp);
+
+ /* Print a token for each attribute.
+
+ * FIXME: Should we output a comma after each token? It may
+ * make it easier for users to read, but we'd lose the ability
+ * to cut-and-paste the list of attributes when defining a new
+ * region. Perhaps that is not important.
+ *
+ * FIXME: If more attributes are added to GDB, the output may
+ * become cluttered and difficult for users to read. At that
+ * time, we may want to consider printing tokens only if they
+ * are different from the default attribute. */
+
+ attrib = &m->attrib;
+ switch (attrib->mode)
+ {
+ case MEM_RW:
+ printf_filtered ("rw ");
+ break;
+ case MEM_RO:
+ printf_filtered ("ro ");
+ break;
+ case MEM_WO:
+ printf_filtered ("wo ");
+ break;
+ }
+
+ switch (attrib->width)
+ {
+ case MEM_WIDTH_8:
+ printf_filtered ("8 ");
+ break;
+ case MEM_WIDTH_16:
+ printf_filtered ("16 ");
+ break;
+ case MEM_WIDTH_32:
+ printf_filtered ("32 ");
+ break;
+ case MEM_WIDTH_64:
+ printf_filtered ("64 ");
+ break;
+ case MEM_WIDTH_UNSPECIFIED:
+ break;
+ }
+
+#if 0
+ if (attrib->hwbreak)
+ printf_filtered ("hwbreak");
+ else
+ printf_filtered ("swbreak");
+#endif
+
+ if (attrib->cache)
+ printf_filtered ("cache ");
+ else
+ printf_filtered ("nocache ");
+
+#if 0
+ if (attrib->verify)
+ printf_filtered ("verify ");
+ else
+ printf_filtered ("noverify ");
+#endif
+
+ printf_filtered ("\n");
+
+ gdb_flush (gdb_stdout);
+ }
+}
+
+
+/* Enable the memory region number NUM. */
+
+static void
+mem_enable (int num)
+{
+ struct mem_region *m;
+
+ for (m = mem_region_chain; m; m = m->next)
+ if (m->number == num)
+ {
+ m->enabled_p = 1;
+ return;
+ }
+ printf_unfiltered ("No memory region number %d.\n", num);
+}
+
+static void
+mem_enable_command (char *args, int from_tty)
+{
+ char *p = args;
+ char *p1;
+ int num;
+ struct mem_region *m;
+
+ dcache_invalidate (target_dcache);
+
+ if (p == 0)
+ {
+ for (m = mem_region_chain; m; m = m->next)
+ m->enabled_p = 1;
+ }
+ else
+ while (*p)
+ {
+ p1 = p;
+ while (*p1 >= '0' && *p1 <= '9')
+ p1++;
+ if (*p1 && *p1 != ' ' && *p1 != '\t')
+ error ("Arguments must be memory region numbers.");
+
+ num = atoi (p);
+ mem_enable (num);
+
+ p = p1;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ }
+}
+
+
+/* Disable the memory region number NUM. */
+
+static void
+mem_disable (int num)
+{
+ struct mem_region *m;
+
+ for (m = mem_region_chain; m; m = m->next)
+ if (m->number == num)
+ {
+ m->enabled_p = 0;
+ return;
+ }
+ printf_unfiltered ("No memory region number %d.\n", num);
+}
+
+static void
+mem_disable_command (char *args, int from_tty)
+{
+ char *p = args;
+ char *p1;
+ int num;
+ struct mem_region *m;
+
+ dcache_invalidate (target_dcache);
+
+ if (p == 0)
+ {
+ for (m = mem_region_chain; m; m = m->next)
+ m->enabled_p = 0;
+ }
+ else
+ while (*p)
+ {
+ p1 = p;
+ while (*p1 >= '0' && *p1 <= '9')
+ p1++;
+ if (*p1 && *p1 != ' ' && *p1 != '\t')
+ error ("Arguments must be memory region numbers.");
+
+ num = atoi (p);
+ mem_disable (num);
+
+ p = p1;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ }
+}
+
+/* Clear memory region list */
+
+static void
+mem_clear (void)
+{
+ struct mem_region *m;
+
+ while ((m = mem_region_chain) != 0)
+ {
+ mem_region_chain = m->next;
+ delete_mem_region (m);
+ }
+}
+
+/* Delete the memory region number NUM. */
+
+static void
+mem_delete (int num)
+{
+ struct mem_region *m1, *m;
+
+ if (!mem_region_chain)
+ {
+ printf_unfiltered ("No memory region number %d.\n", num);
+ return;
+ }
+
+ if (mem_region_chain->number == num)
+ {
+ m1 = mem_region_chain;
+ mem_region_chain = m1->next;
+ delete_mem_region (m1);
+ }
+ else
+ for (m = mem_region_chain; m->next; m = m->next)
+ {
+ if (m->next->number == num)
+ {
+ m1 = m->next;
+ m->next = m1->next;
+ delete_mem_region (m1);
+ break;
+ }
+ }
+}
+
+static void
+mem_delete_command (char *args, int from_tty)
+{
+ char *p = args;
+ char *p1;
+ int num;
+
+ dcache_invalidate (target_dcache);
+
+ if (p == 0)
+ {
+ if (query ("Delete all memory regions? "))
+ mem_clear ();
+ dont_repeat ();
+ return;
+ }
+
+ while (*p)
+ {
+ p1 = p;
+ while (*p1 >= '0' && *p1 <= '9')
+ p1++;
+ if (*p1 && *p1 != ' ' && *p1 != '\t')
+ error ("Arguments must be memory region numbers.");
+
+ num = atoi (p);
+ mem_delete (num);
+
+ p = p1;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ }
+
+ dont_repeat ();
+}
+
+void
+_initialize_mem ()
+{
+ add_com ("mem", class_vars, mem_command,
+ "Define attributes for memory region.\n\
+Usage: mem <lo addr> <hi addr> [<mode> <width> <cache>], \n\
+where <mode> may be rw (read/write), ro (read-only) or wo (write-only), \n\
+ <width> may be 8, 16, 32, or 64, and \n\
+ <cache> may be cache or nocache");
+
+ add_cmd ("mem", class_vars, mem_enable_command,
+ "Enable memory region.\n\
+Arguments are the code numbers of the memory regions to enable.\n\
+Usage: enable mem <code number>\n\
+Do \"info mem\" to see current list of code numbers.", &enablelist);
+
+ add_cmd ("mem", class_vars, mem_disable_command,
+ "Disable memory region.\n\
+Arguments are the code numbers of the memory regions to disable.\n\
+Usage: disable mem <code number>\n\
+Do \"info mem\" to see current list of code numbers.", &disablelist);
+
+ add_cmd ("mem", class_vars, mem_delete_command,
+ "Delete memory region.\n\
+Arguments are the code numbers of the memory regions to delete.\n\
+Usage: delete mem <code number>\n\
+Do \"info mem\" to see current list of code numbers.", &deletelist);
+
+ add_info ("mem", mem_info_command,
+ "Memory region attributes");
+}
diff --git a/contrib/gdb/gdb/memattr.h b/contrib/gdb/gdb/memattr.h
new file mode 100644
index 0000000..8643a23
--- /dev/null
+++ b/contrib/gdb/gdb/memattr.h
@@ -0,0 +1,91 @@
+/* Memory attributes support, for GDB.
+ Copyright 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MEMATTR_H
+#define MEMATTR_H
+
+enum mem_access_mode
+{
+ MEM_RW, /* read/write */
+ MEM_RO, /* read only */
+ MEM_WO /* write only */
+};
+
+enum mem_access_width
+{
+ MEM_WIDTH_UNSPECIFIED,
+ MEM_WIDTH_8, /* 8 bit accesses */
+ MEM_WIDTH_16, /* 16 " " */
+ MEM_WIDTH_32, /* 32 " " */
+ MEM_WIDTH_64 /* 64 " " */
+};
+
+/* The set of all attributes that can be set for a memory region.
+
+ This structure was created so that memory attributes can be passed
+ to target_ functions without exposing the details of memory region
+ list, which would be necessary if these fields were simply added to
+ the mem_region structure.
+
+ FIXME: It would be useful if there was a mechanism for targets to
+ add their own attributes. For example, the number of wait states. */
+
+struct mem_attrib
+{
+ /* read/write, read-only, or write-only */
+ enum mem_access_mode mode;
+
+ enum mem_access_width width;
+
+ /* enables hardware breakpoints */
+ int hwbreak;
+
+ /* enables host-side caching of memory region data */
+ int cache;
+
+ /* enables memory verification. after a write, memory is re-read
+ to verify that the write was successful. */
+ int verify;
+};
+
+struct mem_region
+{
+ /* FIXME: memory regions are stored in an unsorted singly-linked
+ list. This probably won't scale to handle hundreds of memory
+ regions --- that many could be needed to describe the allowed
+ access modes for memory mapped i/o device registers. */
+ struct mem_region *next;
+
+ CORE_ADDR lo;
+ CORE_ADDR hi;
+
+ /* Item number of this memory region. */
+ int number;
+
+ /* Status of this memory region (enabled if non-zero, otherwise disabled) */
+ int enabled_p;
+
+ /* Attributes for this region */
+ struct mem_attrib attrib;
+};
+
+extern struct mem_region *lookup_mem_region(CORE_ADDR);
+
+#endif /* MEMATTR_H */
diff --git a/contrib/gdb/gdb/mi/ChangeLog b/contrib/gdb/gdb/mi/ChangeLog
new file mode 100644
index 0000000..2bb94d7
--- /dev/null
+++ b/contrib/gdb/gdb/mi/ChangeLog
@@ -0,0 +1,1765 @@
+2002-04-07 Michael Chastain <mec@shout.net>
+
+ Merge from HEAD to fix PR gdb/381:
+
+ 2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Skip end-of-function
+ markers in the line table.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ From wiz at danbala:
+ * gdbmi.texinfo: Fix grammar and typos.
+ Fix PR gdb/287.
+
+2002-02-03 Jim Blandy <jimb@redhat.com>
+
+ * mi-cmd-stack.c (list_args_or_locals): Move declaration of
+ print_me inside the loop body, so it gets re-initialized every
+ iteration. The cases for the different symbol kinds leave
+ print_me unchanged if they don't want the symbol printed.
+
+2002-01-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbmi.texinfo: Remove makeinfo 3.12 hacks.
+
+2002-01-21 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-cmd-stack.c: Remove #else clause of #ifdef UI_OUT.
+ * mi-cmd-break.c: Ditto.
+ * mi-main.c: Ditto.
+
+2001-12-30 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Fix the application of GFDL in the Copyright notice.
+
+2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * mi-cmd-stack.c (list_args_or_locals): Use ALL_BLOCK_SYMBOLS.
+
+2001-09-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_thread_select): Pass uiout to
+ gdb_thread_select.
+ (mi_cmd_thread_list_ids): Pass uiout to gdb_list_thread_ids.
+
+ * mi-cmd-break.c (breakpoint_notify): Pass uiout to
+ gdb_breakpoint_query.
+
+2001-08-17 Keith Seitz <keiths@redhat.com>
+
+ * mi-cmd-var.c (varobj_update_one): Update call to
+ varobj_update to reflect recent api change.
+
+2001-07-26 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c: Include "gdb.h".
+ * mi-cmd-break.c: Include "gdb.h".
+
+2001-07-12 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_execute_command): Flush output after ``(gdb)''
+ prompt. Bug reported by David Whedon.
+ (mi_execute_async_cli_command): Ditto.
+ (mi_exec_async_cli_cmd_continuation): Ditto.
+ (mi_command_loop): Ditto.
+
+2001-07-10 Mark Kettenis <kettenis@gnu.org>
+
+ * mi-out.c (mi_out_new): Initialize suppress_ouput field of newly
+ created `struct ui_out_data'.
+
+2001-07-09 Kevin Buettner <kevinb@redhat.com>
+
+ * mi-main.c (register_changed_p, get_register): Use alloca()
+ to allocate space previously allocated via gcc's
+ variable-length array extension.
+ (mi_cmd_data_write_register_values, mi_cmd_data_write_memory):
+ Change type of ``buffer'' to ``void *''. Don't cast return value
+ from xmalloc(). Add a cleanup to free the xmalloc'd buffer.
+
+2001-07-07 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_evaluate_expression): Replace value_ptr
+ with `struct value *'.
+
+2001-07-08 Kevin Buettner <kevinb@redhat.com>
+
+ * mi-out.c (mi_table_header, mi_field_int, mi_field_skip)
+ (mi_field_string) Make function declarators match earlier
+ declarations.
+
+2001-07-04 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_ui_out_impl): Initialize is_mi_like_p to one.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_table_begin): Include nr_cols and nr_rows in mi1
+ table output.
+ * mi-out.c (mi_table_begin): Only suppress output when mi0. Change
+ the header to a list.
+ (mi_table_body): For mi1, close the header list and open a table
+ body list.
+ (mi_table_end): For mi1, close the body list.
+ (mi_table_header): For mi1, output a tuple containing all the
+ header information.
+ (mi_open, mi_close): Reverse logic of mi_version test.
+ * gdbmi.texinfo (GDB/MI Breakpoint Table Commands): Update.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbmi.texinfo (GDB/MI Output Syntax): Delete reference to query
+ packet.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-cmd-stack.c (list_args_or_locals): Output a list of "args" or
+ "locals" entries.
+ * gdbmi.texinfo (stack-list-locals, stack-list-arguments)
+ (exec-interrupt, target-select, thread-select): Update
+ documentation.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-cmd-stack.c (mi_cmd_stack_list_frames): Output a list of
+ "stack" entries.
+ (mi_cmd_stack_list_args): Ditto for "stack-args".
+ * gdbmi.texinfo (stack-list-frames, stack-list-arguments): Update
+ documentation.
+ (GDB/MI Stack Manipulation Commands): Fix section title. Was
+ Stack Manipulation Commands in GDB/MI.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbmi.texinfo: Update output examples that contain stop reason
+ output, change the args=.... to a list.
+ (exec-return): Ditto.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): Output the memory contents
+ - memory and data - as a list.
+ * gdbmi.texinfo (data-read-memory): Update documentation.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_list_register_values): Output a list of
+ register values.
+ * gdbmi.texinfo (data-list-register-values): Update documentation.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_list_register_names): Output a list of
+ register names.
+ (mi_cmd_data_list_register_names): Include the pseudo registers.
+ (mi_cmd_data_list_register_names): Don't leave holes in the list,
+ output "" for NULL registers.
+ * gdbmi.texinfo (data-list-register-names): Update documentation.
+
+2001-06-23 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_list_changed_registers): Output a list of
+ register numbers.
+ * gdbmi.texinfo (data-list-changed-registers): Update
+ documentation.
+
+2001-06-23 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbmi.texinfo (data-disassemble): Update documentation of
+ output. Produces a list of instructions and a list of source
+ lines.
+
+2001-06-22 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): For "-data-disassemble",
+ output a list instead of a tupple.
+
+2001-06-21 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (struct ui_out_data): Replace field first_header with
+ suppress_output.
+ (mi_begin, mi_end): Check suppress_header.
+ (mi_field_int, mi_field_skip): Ditto.
+ (mi_field_string, mi_field_fmt): Ditto.
+ (mi_table_begin): When nr_rows is zero, set suppress_header else,
+ output the start of the header.
+ (mi_table_body): Clear suppress header.
+
+2001-06-21 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_open): For lists, when mi_version > 0, use ``[''.
+ (mi_close): Ditto for ``]''.
+
+2001-06-20 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_table_header): Add parameter ``col_name''.
+
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c: Include "gdb_assert.h".
+ (mi_table_begin): Add parameter ``nr_rows''.
+
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c: Use strncmp as the "mi" test. Allow "mi", "mi0" and
+ "mi1".
+ (mi_command_loop): Add parameter mi_version, pass to mi_out_new.
+ (mi1_command_loop, mi0_command_loop): New functions.
+ (_initialize_mi_main): Recognize "mi", "mi0" and "mi1".
+ * mi-out.c (mi_out_new): Add parameter mi_version.
+ (struct ui_out_data): Add field mi_version.
+ * mi-out.h (mi_out_new): Update.
+
+2001-06-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbmi.texinfo (GDB/MI Output Syntax): Add tuples and lists to
+ syntax.
+ (GDB/MI Draft Changes to Output Syntax): Delete section.
+
+Mon Jun 11 17:22:25 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-out.c: Fix typo. s/supress/suppress/.
+
+2001-06-09 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_table_end, mi_table_begin, mi_begin, mi_end): Move
+ supress_field_separator updates from here.
+ (mi_open, mi_close): To here.
+ (mi_open): Add parameter name. Output a field_separator.
+ (mi_table_begin): Update.
+ (mi_table_header): Update.
+ (mi_begin): Update.
+
+2001-06-09 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_table_begin): Make char* parameters constant.
+ (mi_table_header): Ditto.
+ (mi_field_int): Ditto.
+ (mi_field_skip): Ditto.
+ (mi_field_string): Ditto.
+ (mi_field_fmt): Ditto.
+ (mi_text): Ditto.
+ (mi_message): Ditto.
+
+2001-05-12 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_close, mi_open): Output ``[]'' when a list.
+
+Fri May 11 13:55:07 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-var.c: Replace ui_out_list_begin, ui_out_list_end and
+ make_cleanup_ui_out_list_end with ui_out_tupple_begin,
+ ui_out_tupple_end and make_cleanup_ui_out_tupple_begin_end.
+ * mi-cmd-stack.c: Ditto.
+ * mi-cmd-disas.c: Ditto.
+ * mi-main.c: Ditto.
+
+2001-05-10 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_open, mi_close): Replace list_open and list_close.
+ (mi_table_begin): Update.
+ (mi_table_header): Update.
+ (mi_begin): Update.
+ (mi_table_body): Update.
+ (mi_table_end): Update.
+ (mi_end): Update.
+
+Thu May 10 16:28:13 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command): Always initialize
+ old_cleanups.
+
+2001-05-08 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_begin, mi_end): Replace mi_list_begin and
+ mi_list_end.
+ (mi_ui_out_impl): Update.
+
+2001-03-28 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): Use xcalloc.
+
+2001-03-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Update copyright. Change Permissions to GFDL.
+
+2001-03-20 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Initialize ``file_string''
+ and ``line_num''. Consolidate declaration of argument variables.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.h: Remove #ifdef __STDC__.
+
+2001-03-08 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_list_register_names): Use NUM_REGS, not
+ ARCH_NUM_REGS.
+ (mi_cmd_data_list_changed_registers): Ditto.
+ (mi_cmd_data_list_register_values): Ditto.
+ (mi_cmd_data_write_register_values): Ditto.
+
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * gdbmi.texinfo, mi-cmd-disas.c, mi-cmd-stack.c, mi-cmd-var.c,
+ mi-cmds.c, mi-cmds.h, mi-console.c, mi-console.h, mi-getopt.c,
+ mi-getopt.h, mi-out.c, mi-out.h, mi-parse.c, mi-parse.h:
+ Update/correct copyright notices.
+
+Wed Feb 7 19:50:37 2001 Andrew Cagney <cagney@redhat.com>
+
+ * mi-getopt.c: Add __FILE__ and __LINE__ parameter to calls to
+ internal_error.
+ * mi-console.c: Ditto.
+ * mi-cmds.c: Ditto.
+ * mi-cmd-break.c: Ditto.
+
+2001-01-27 Fernando Nasser <fnasser@redhat.com>
+
+ From Momchil Velikov <velco@fadata.bg>
+ * mi-cmd-disas.c (gdb_dis_asm_read_memory): Add missing memory
+ attributes argument in the call to `xfer_memory'.
+
+2000-12-14 Kevin Buettner <kevinb@redhat.com>
+
+ * mi-cmd-disas.c, mi-cmd-var.c, mi-console.c, mi-main.c,
+ mi-parse.c: Replace occurrences of free() with xfree().
+
+Fri Nov 17 16:07:23 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c: Replace asprintf with xasprintf.
+ * mi-cmd-var.c (mi_cmd_var_create): Ditto.
+
+2000-10-16 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo (GDB/MI Variable Objects): Dimensions of
+ multitable changed to "@columnfractions .4 .6". Suggested by
+ Dmitry Sivachenko <dima@Chg.RU>.
+
+2000-08-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Change flathead -> @sc{gdb/mi}.
+ Fix typos and markup mistakes (from Dmitry S.
+ Sivachenko <dima@Chg.RU>).
+
+2000-07-24 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Change GDB -> @value{GDBN}, and
+ (gdb) -> (@value{GDBP}). Fix a few typos and some markup. From
+ Dmitry S. Sivachenko <dima@Chg.RU>.
+
+Tue May 16 14:13:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_execute): Use free_current_contents.
+ (free_and_reset): Delete.
+
+Mon May 15 16:17:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_data_assign, mi_cmd_data_evaluate_expression),
+ mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete): Delete
+ make_cleanup_func casts. Not needed.
+
+2000-05-07 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Lots of typos and grammar fixes from Brian
+ Youmans <3diff@flib.gnu.ai.mit.edu>.
+
+Wed Apr 26 18:35:19 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbmi.texinfo (GDB/MI Output Syntax v2.0): Convert Draft 2.0
+ Output Syntax into a new section. Cross reference.
+ (menu): Fix tipo. GDB/MI Compatibility with CLI.
+
+2000-04-23 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbmi.texinfo: Lots of changes, to include this document as part
+ of the GDB manual.
+
+2000-03-13 James Ingham <jingham@leda.cygnus.com>
+
+ * mi-cmd-var.c (mi_cmd_var_create): Add special frame cookie "@"
+ to indicate an "USE_CURRENT_FRAME" variable.
+ (varobj_update_one): Add "in_scope" and "type_changed" to the
+ result.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.h: Export mi_cmd_data_write_register_values.
+
+ * mi-cmds.c (mi_cmds): Implement data-write-register-values with
+ mi_cmd_data_write_register_values.
+
+ * mi-main.c (mi_cmd_data_write_register_values): New
+ function. Write a value into a register.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Update data-disassemble documentation.
+
+2000-03-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Use
+ ui_out_field_core_addr() instead of print_address_numeric(), to
+ maintain consistency throughout MI.
+
+Wed Feb 23 17:09:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-break.c, mi-cmd-disas.c, mi-cmd-stack.c, mi-cmd-var.c,
+ mi-cmds.c, mi-cmds.h, mi-console.c, mi-console.h, mi-getopt.c,
+ mi-getopt.h, mi-main.c, mi-out.c, mi-out.h, mi-parse.c,
+ mi-parse.h: Update copyright information.
+
+Wed Feb 23 13:31:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-disas.c (gdb_dis_asm_read_memory): Change LEN to unsigned
+ long. Match ../include/dis-asm.h change.
+
+Wed Feb 23 10:30:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbmi.texinfo: Update copyright - FSF. Update version
+ information.
+
+ mi-cmd-break.c, mi-cmd-disas.c, mi-cmd-stack.c, mi-cmd-var.c,
+ mi-cmds.h, mi-main.c, mi-parse.c, mi-parse.h: Re-format using GNU
+ indent.
+
+2000-02-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c: Add include of gdbcore.h for write_memory()
+ prototype.
+
+2000-02-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Change syntax of
+ command. Now use options.
+ Instead of printing the symbolic address of instructions via
+ print_address_symbolic(), use build_address_symbolic() and format
+ properly for output.
+ (gdb_do_disassmble): Delete.
+
+2000-02-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble):
+
+2000-02-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_data_write_memory): New function. Write a
+ value into target memory.
+
+ * mi-cmds.h (mi_cmd_data_write_memory): Export.
+
+ * mi-cmds.c (mi_cmds): Hook up data-write-memory to
+ mi_cmd_data_write_memory().
+
+2000-02-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_target_download): Correct error message to
+ report right function name.
+ (mi_cmd_target_select): Add doing exec cleanups at end.
+ (mi_cmd_data_read_memory): Correct typo.
+ (mi_cmd_execute): Do not simply free last_async_command, but reset
+ it to NULL as well.
+ (free_and_reset): New function, free the argument and set it to
+ NULL.
+ (mi_cmd_target_select_continuation): Delete prototype.
+
+Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-disas.c, mi-cmds.h, mi-console.c, mi-console.h,
+ mi-main.c, mi-out.c, mi-out.h: Update to reflect rename of
+ gdb-file / GDB_FILE to ui-file / ``struct ui_file''.
+
+Mon Jan 31 18:33:28 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_command_loop): Delete reference to
+ fputs_unfiltered_hook.
+
+2000-01-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Update entries for
+ mi_cmd_data_list_register_names,
+ mi_cmd_data_list_changed_registers,
+ mi_cmd_data_list_register_values.
+
+ * mi-cmds.h (mi_cmd_data_list_register_names,
+ mi_cmd_data_list_changed_registers,
+ mi_cmd_data_list_register_values): Update to mi_cmd_argv_ftype.
+
+ * mi-main.c (mi_cmd_data_list_register_names,
+ mi_cmd_data_list_changed_registers,
+ mi_cmd_data_list_register_values): Update to use argc, argv
+ parameters.
+
+2000-01-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): Correct the computation of
+ next-row.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmd-var.c (mi_cmd_var_create): Test for NULL type.
+ (mi_cmd_var_set_format, mi_cmd_var_show_format,
+ mi_cmd_var_info_num_children, mi_cmd_var_list_children,
+ mi_cmd_var_info_type, mi_cmd_var_info_expression,
+ mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression,
+ mi_cmd_var_assign, mi_cmd_var_update): Prevent possibility of memory
+ leak on error.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c (mi_field_string): Test for NULL string pointer.
+
+2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-stack.c (mi_cmd_stack_list_frames): Call
+ print_frmae_info() with the correct arguments.
+
+ * mi-main.c (mi_cmd_exec_return): Call
+ show_and_print_stack_frame() with LOC_AND_ADDRESS, so it does the
+ right thing. Update Copyright.
+
+2000-01-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c: Move disassemble commands from here.
+
+ * mi-cmd-disas.c: To here. New file.
+
+2000-01-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-stack.c: Remove include of mi-out.h.
+
+ * mi-main.c (mi_cmd_disassemble): Update function to use argc/argv
+ interface.
+
+ * mi-cmds.h: Ditto.
+
+ * mi-cmds.c: Ditto.
+
+2000-01-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Update stack commands descriptions.
+ Add thread commands descriptions and examples.
+
+ * mi-main.c (mi_cmd_thread_list_ids): Fix typo.
+
+2000-01-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_thread_list_ids): New function, print a list
+ of currently known threads ids, and the total number of threads.
+ (mi_cmd_thread_select): New function. Switch current thread.
+
+ * mi-cmds.c (mi_cmds): Implement thread-list-ids by
+ mi_cmd_thread_list_ids, and thread-select by mi_cmd_thread_select.
+
+ * mi-cmds.h (mi_cmd_thread_select, mi_cmd_thread_list_ids): Export.
+
+2000-01-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c: Move stack commands from here.
+
+ * mi-cmd-stack.c: To here. New file.
+
+2000-01-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (list_args_or_locals): Add a new paramter, the frame
+ for which to display args or locals. Don't use selected_frame
+ anymore, use the new parameter instead. Return void instead of
+ mi_cmd_result, let callers do so.
+ (mi_cmd_stack_list_args): Change interface. Now accept low and
+ high frame numbers to display args for a range of frames. Without
+ these two, display args for the whole stack.
+ (mi_cmd_stack_list_locals): Adapt to new interface for
+ list_args_or_locals.
+
+2000-01-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_stack_info_depth, mi_cmd_stack_list_args,
+ mi_cmd_stack_list_frames, mi_cmd_stack_list_locals,
+ mi_cmd_stack_select_frame): Change to use argv type of parameters.
+
+ * mi-cmds.c (mi_cmds): Change stack-info-depth,
+ stack-list-arguments, stack-list-frames, stack-list-locals,
+ stack-select-frame to use argv parameters.
+
+ * mi-cmds.h (mi_cmd_stack_info_depth, mi_cmd_stack_list_args,
+ mi_cmd_stack_list_frames, mi_cmd_stack_list_locals,
+ mi_cmd_stack_select_frame): Update definitions.
+
+Tue Jan 4 12:38:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_command_loop): Force the MI interface to use seven
+ bit strings.
+ * gdbmi.texinfo: Make it clear that a quoted C string is seven
+ bit.
+
+Thu Dec 30 14:15:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-getopt.c (mi_getopt): Rewrite. Allow long options.
+ * mi-getopt.h (struct mi_opt): Declare.
+ (mi_getopt): Update.
+
+ * mi-main.c (mi_cmd_data_read_memory), mi-cmd-break.c
+ (mi_cmd_break_insert, mi_cmd_break_watch): Update.
+
+Wed Dec 29 23:38:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-break.c (mi_cmd_break_insert): Add support for -c
+ <condition>, -i <ignore-count> and -p <thread>.
+ (breakpoint_notify): New function.
+ (mi_cmd_break_insert): Wrap GDB call with callback hooks so that
+ MI is notified when ever a breakpoint is created.
+
+ * gdbmi.texinfo: Update.
+
+Fri Dec 24 11:23:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (gdb_do_disassemble): Strip out more useless #ifdef
+ UI_OUTs.
+
+1999-12-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (gdb_do_disassemble): Fix output. Lines that have no
+ assembly instructions must still be outputted, to keep the source
+ line numbering correct.
+ Remove #ifdef UI_OUT's, they are useless.
+
+1999-12-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (gdb_do_disassemble): Don't print a new list in mixed
+ mode, every time. Just do it when we actually encounter a new
+ source line.
+
+1999-12-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmd-var.c (mi_cmd_var_list_children): Add test for C++ pseudo
+ variable objects (private, public, protected) as these do not have
+ a type and the -var-list-children operation was dumping core.
+
+Fri Dec 17 20:23:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbmi.texinfo: Document recommended syntax for options.
+
+ * mi-main.c (mi_cmd_data_read_memory): Add support for ``-o
+ <offset>''.
+ * gdbmi.texinfo: Document.
+
+Wed Dec 15 17:43:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-getopt.h (mi_getopt): Change optarg to a char pointer. Check
+ optind.
+ * mi-cmd-break.c (mi_cmd_break_insert): Update.
+
+ * mi-main.c (mi_cmd_data_read_memory): Add fields "next-row-addr",
+ "prev-row-addr", "next-page-addr", "prev-page-addr" and a per row
+ "addr".
+ * gdbmi.texinfo: Update.
+
+Wed Dec 15 01:05:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_result): Add MI_CMD_CAUGHT_ERROR for when the
+ error is caught.
+
+ * mi-main.c (captured_mi_execute_command): When
+ MI_CMD_CAUGHT_ERROR return 0 rethrowing the eror.
+
+1999-12-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-break.c (mi_cmd_break_insert): Remove unused var.
+
+ * mi-cmd-var.c (mi_cmd_var_update): Remove unused variables.
+
+Mon Dec 13 18:43:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-parse.c (mi_parse): Quote the command when printing it.
+ (mi_parse_argv): Fix handling of quoted strings. Was not
+ de-quoting them.
+ (mi_parse_argv): Make static.
+
+Mon Dec 13 18:30:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_break_insert, mi_cmd_break_watch): Change type
+ to mi_cmd_argv_ftype.
+ * mi-cmds.c (mi_cmds): Update.
+ * mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Change
+ to new style of arguments with argc and argv. Parse arguments
+ using mi_getopt.
+
+ * mi-cmd-break.c (mi_cmd_break_insert): Wrap body in #ifdef UI_OUT
+ to avoid non-ui compile problems.
+
+Mon Dec 13 15:08:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-getopt.h, mi-getopt.c: New files. Similar to getopt but with
+ well defined semantics.
+
+Mon Dec 13 14:22:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_break_insert, mi_cmd_break_watch, enum
+ wp_type, enum bp_type): Move from here.
+ * mi-cmd-break.c: To here. New file.
+ (mi_cmd_break_insert, mi_cmd_break_insert, mi_cmd_break_watch):
+ Use error to report problems.
+
+1999-12-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Update description of exec-interrupt.
+
+ * mi-main.c (mi_cmd_exec_interrupt): If the program is not
+ executing, don't try to interrupt it, but error out instead. Make
+ sure previous_async_command is not null before duplicating it into
+ last_async_command.
+
+ * gdbmi.texinfo: Add examples for data-evaluate-expression.
+
+1999-12-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmd-var.c (mi_cmd_var_assign, mi_cmd_var_create,
+ mi_cmd_var_delete, mi_cmd_var_evaluate_expression,
+ mi_cmd_var_info_expression, mi_cmd_var_info_num_children,
+ mi_cmd_var_info_type, mi_cmd_var_list_children,
+ mi_cmd_var_set_format, mi_cmd_var_show_attributes,
+ mi_cmd_var_show_format, mi_cmd_var_update): Change to use new
+ style of arguments with argc and argv.
+ (next_arg): Delete.
+ (which_var): Delete.
+
+ * mi-cmds.c (mi_cmds): Update entries for mi_cmd_var_assign,
+ mi_cmd_var_create, mi_cmd_var_delete,
+ mi_cmd_var_evaluate_expression, mi_cmd_var_info_expression,
+ mi_cmd_var_info_num_children, mi_cmd_var_info_type,
+ mi_cmd_var_list_children, mi_cmd_var_set_format,
+ mi_cmd_var_show_attributes, mi_cmd_var_show_format,
+ mi_cmd_var_update.
+
+ * mi-cmds.h (mi_cmd_var_assign, mi_cmd_var_create,
+ mi_cmd_var_delete, mi_cmd_var_evaluate_expression,
+ mi_cmd_var_info_expression, mi_cmd_var_info_num_children,
+ mi_cmd_var_info_type, mi_cmd_var_list_children,
+ mi_cmd_var_set_format, mi_cmd_var_show_attributes,
+ mi_cmd_var_show_format, mi_cmd_var_update): Update declarations.
+
+1999-12-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Comment out -data-assign command. * mi-main.c
+ (mi_cmd_data_assign): Do not use, comment out. * mi-cmds.h
+ (mi_cmd_data_assign): Remove. * mi-cmds.c: Remove -data-assign
+ command from MI interface.
+
+1999-12-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-parse.c (mi_parse): Add '\n' at end of error messages, so
+ that prompt comes out on new line.
+
+ * gdbmi.texinfo: Update disassembly command output.
+
+1999-12-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (gdb_do_disassemble): Update output for UI_OUT case.
+
+1999-12-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Update exec-until output, including the reason
+ for stopping.
+
+Thu Dec 2 17:17:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.c: Include <string.h> for memset.
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_exec_return): ifdef the references to
+ return_command_wrapper().
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_interrupt,
+ mi_cmd_target_select, mi_execute_async_cli_command,
+ mi_exec_async_cli_cmd_continuation, mi_load_progress): Don't print
+ last_async_command if it is NULL.
+ (mi_cmd_exec_return):
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_exec_return): Reimplement using
+ return_command() instead of mi_execute_async_cli_command().
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.h: Export mi_cmd_data_assign and
+ mi_cmd_data_evaluate_expression.
+
+ * mi-cmds.c (mi_cmds): Hook data-assign to mi_cmd_data_assign and
+ data-evaluate-expression to mi_cmd_data_evaluate_expression.
+
+ * mi-main.c (mi_cmd_data_assign): New function. Implement
+ data-assign command.
+ (mi_cmd_data_evaluate_expression): New function. Implement
+ data-evaluate-expression command.
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Fix some texinfo formatting errors.
+
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Update data-list-register-values description.
+
+ * mi-cmds.h: Export mi_cmd_data_list_register_values.
+
+ * mi-cmds.c (mi_cmds): Hook data-list-register-values to
+ mi_cmd_data_list_register_values.
+
+ * mi-main.c (mi_cmd_data_list_register_values): New
+ function. Implements the -data-list-register-values command.
+ (get_register): New function. Output the contents of a given
+ register.
+
+Wed Dec 1 20:27:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command): Append missing "\n"
+ for synchronous stopped message.
+
+1999-11-30 James Ingham <jingham@leda.cygnus.com>
+
+ * gdbmi.texinfo: Fix obvious typo in @end statement.
+
+Wed Dec 1 12:36:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-var.c: Include "value.h".
+ * mi-console.c: Include <string.h>.
+
+Wed Dec 1 00:21:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (captured_mi_execute_command): For a CLI command, pass
+ "%s" to mi_execute_cli_command to stop core dumps.
+ (captured_mi_execute_command): Echo CLI commands on gdb_stdlog.
+
+Wed Dec 1 00:10:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbmi.texinfo: Explain NR-BYTES and ADDR.
+
+Tue Nov 30 23:31:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete,
+ mi_cmd_var_set_format, mi_cmd_var_show_format,
+ mi_cmd_var_info_num_children, mi_cmd_var_list_children,
+ mi_cmd_var_info_type, mi_cmd_var_info_expression,
+ mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression,
+ mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one, next_arg,
+ which_var): New file. Move varobj commands to here from
+ mi-main.c.
+
+ * mi-console.h, mi-console.c (mi_console_file_new,
+ mi_console_file_delete, mi_console_file_fputs,
+ mi_console_raw_packet, mi_console_file_flush): New files. Move
+ mi_console_file to here from mi-main.c.
+
+Tue Nov 30 19:37:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (captured_mi_execute_command): Use fputstr_unfiltered
+ when printing error messages.
+ (mi_cmd_execute): Ditto.
+
+1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Describe -data-list-changed-registers,
+ -data-list-register-names. Add examples for
+ -exec-next-instruction, exec-step-instruction, -exec-run,
+ -exec-until. Format examples for -data-read-memory.
+ update example for -target-download.
+
+1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Remove mentioning of inaccurate watchpoint hit
+ count.
+
+Mon Nov 29 19:28:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command): Return ``enum
+ mi_cmd_cmd_result''. mi_cmd_exec_run, mi_cmd_exec_next,
+ mi_cmd_exec_step, mi_cmd_exec_step_instruction,
+ mi_cmd_exec_finish, mi_cmd_exec_until, mi_cmd_exec_return,
+ mi_cmd_exec_continue): Update call.
+ (mi_execute_async_cli_command): When target is synchronous, fake
+ asynchronous behavour (ulgh). Allows tests to be run on built-in
+ simulator and native targets.
+
+Mon Nov 29 15:15:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_gdb_exit), mi-cmds.c (mi_cmds), mi-main.c
+ (mi_cmd_gdb_exit): Change function signature to mi_cmd_argv_ftype.
+
+1999-11-28 Andew Cagney <cagney@rat-in-a-hat.cygnus.com>
+
+ * mi-parse.c: Include <ctype.h> and <string.h>
+
+1999-11-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbmi.texinfo: Added watchpoint command descriptions and
+ examples.
+
+ * mi-main.c (mi_load_progress): Add parameter for total sent so far.
+ Print it as well.
+
+Fri Nov 26 10:17:49 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbmi.texinfo (section Output Syntax): For lists, the <string>
+ part of a <result> is optional. Clarify syntax.
+ (appendix Proposed v2.0 Output Syntax): New section. Provide
+ record of discussion of possible changes to syntax.
+
+Wed Nov 24 19:41:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): Simplify. Fix coredump
+ when arguments were bad.
+ (mi_cmd_execute): Change parameter to ``struct mi_parse''. Handle
+ case of argv_func as well as args_func.
+ (captured_mi_execute_command): Update.
+
+ * mi-cmds.c (struct mi_cmd): Add field for mi_cmd_argv_ftype.
+ (mi_cmds): Update mi_cmd_data_read_memory.
+ (mi_lookup): Return
+
+ * mi-cmds.h (mi_cmd_args_ftype): Rename mi_cmd_ftype. Make all
+ functions of type this type.
+ (mi_cmd_argv_ftype): Declare.
+ (mi_cmd_data_read_memory): Change type to mi_cmd_argv_fytpe.
+ (struct mi_cmd): Move declaration to here from mi-cmds.c.
+ (mi_lookup): Return a pointer to ``struct mi_cmd''.
+
+Wed Nov 24 15:03:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-parse.c (mi_parse): Initialize TOKEN when a CLI command.
+
+ * gdbmi.texinfo: Allow a <token> before a CLI command.
+
+ * mi-parse.h (struct mi_parse): Declare.
+ (mi_parse): Change to return a ``struct mi_parse''.
+ (enum mi_command_type): Delete PARSE_ERROR.
+
+ * mi-main.c (struct mi_execute_command_context): Delete.
+ (captured_mi_execute_command): Update
+ (mi_execute_command): Update. Check for mi_parse returning NULL.
+
+Wed Nov 24 12:57:14 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-parse.h: Remove const, from cmd parameter. Causes cascading
+ warnings.
+
+Wed Nov 24 15:03:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-parse.c (mi_parse): New function. Move parse code to here.
+ * mi-main.c (parse): From here. Delete.
+
+Wed Nov 24 12:57:14 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-parse.c, mi-parse.h: New files. Implement mi_parse_env.
+
+Wed Nov 24 11:24:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-out.c (mi_field_string): Make string parameter constant.
+
+1999-11-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_target_download): Export.
+
+ * mi-cmds.c (mi_cmds): Add mi_cmd_target_download.
+
+ * mi-main.c: Include <sys/time.h>.
+ (mi_cmd_target_download): New function, implement the
+ target-download command.
+ (mi_load_progress): New function. Called via the
+ show_load_progress hook. Prints updates every 0.5 secs.
+ (mi_command_loop): Initialize the show_load_progress hook.
+
+1999-11-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_exec_until): New function. Implement until
+ command.
+ (mi_cmd_exec_step_instruction): New function. Implement stepi
+ command.
+ (mi_cmd_exec_next_instruction): New function. Implement nexti
+ command.
+
+ * mi-cmds.c (mi_cmds): Add mi_cmd_exec_step_instruction,
+ mi_cmd_exec_next_instruction, mi_cmd_exec_until.
+
+ * mi-cmds.h (mi_cmd_exec_step_instruction,
+ mi_cmd_exec_next_instruction, mi_cmd_exec_until): Export.
+
+Tue Nov 23 00:30:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi/gdbmi.texinfo: Document -data-read-memory.
+
+ * mi-main.c (mi_cmd_data_read_memory): Fix off-by-one check of
+ argc.
+ (mi_cmd_data_read_memory): Label the output table with "memory".
+
+Thu Nov 18 18:15:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_exec_interrupt, mi_cmd_break_insert,
+ mi_cmd_break_watch, mi_cmd_disassemble, mi_cmd_execute): Replace
+ strdup with xstrdup.
+
+Thu Nov 18 20:50:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_data_read_memory): New function. Implement
+ data-read-memory.
+
+ * mi-cmds.h, mi-cmds.c: Add mi_cmd_data_read_memory.
+ * mi-cmds.c (mi_cmds): Ditto.
+
+1999-11-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_break_watch): Export.
+
+ * mi-cmds.c (mi_cmds): Hook up break-watch to function
+ mi_cmd_break_watch.
+
+ * mi-main.c (wp_type): New enumeration for the possible types of
+ watchpoints.
+ (mi_cmd_break_watch): New function, implements the break-watch
+ command.
+
+1999-11-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_break_insert): Handle case in which the command is
+ just a -break-insert w/o args.
+
+Fri Nov 12 00:01:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-out.c (mi_field_string): Always quote the string.
+
+1999-11-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.h(mi_cmd_data_list_changed_registers,
+ mi_cmd_data_list_register_names): Export.
+
+ * mi-cmds.c (mi_cmds): Hook up data-list-changed-registers to
+ mi_cmd_data_list_changed_registers and data-list-register-names to
+ mi_cmd_data_list_register_names.
+
+ * mi-main.c (mi_cmd_data_list_changed_registers): New function,
+ implements the data-list-changed-registers command.
+ (mi_cmd_data_list_register_names): New function, implements the
+ data-list-register-names command.
+ (register_changed_p): New function. Decide whether the register
+ contents have changed.
+ (setup_architecture_data): New function. Initialize registers
+ memory.
+ (_initialize_mi_main): Call setup_architecture_data(), and
+ register_gdbarch_swap().
+
+Wed Nov 10 18:35:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_command): Correctly quote error messages.
+
+Wed Nov 10 11:05:14 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi/gdbmi.texinfo: Delete <stream-output>. Replaced by
+ <c-string>.
+
+ * mi-main.c (mi_console_raw_packet): Always quote console output.
+
+Tue Nov 9 17:53:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_console_file_new), mi-out.c (mi_out_new): Replace
+ the tui_file with a mem_file. Ya!
+
+ * mi-out.c (do_write): New function, wrapper to gdb_file_write.
+ (mi_out_put): Pass do_write to gdb_file_put.
+
+ * mi-main.c (mi_console_file_flush): Rewrite. Use
+ mi_console_raw_packet to send data to the console.
+ (mi_console_raw_packet): New function. Correctly
+ create quoted C string packets.
+
+1999-11-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Break-insert is now implemented by
+ mi_cmd_break_insert.
+ * mi-cmds.h (mi_cmd_break_insert): Export.
+ * mi-main.c (bp_type): New enumeration.
+ (mi_cmd_break_insert): New function. Implements all flavors of
+ breakpoint insertion.
+
+Mon Nov 8 17:49:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_console_file_flush): Replace gdb_file_get_strbuf
+ with tui_file_get_strbuf.
+
+Fri Nov 5 17:06:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_console_file_delete, mi_console_file_fputs,
+ mi_console_file_flush): Call internal_error instead of error.
+
+Thu Nov 4 19:53:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (captured_mi_execute_command): New function.
+ (mi_execute_command): Rewrite. Replace SET_TOP_LEVEL() with call
+ to captured_mi_execute_command via catch_errors.
+
+Thu Nov 4 20:33:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (clean): Delete.
+ (mi_command_loop): Delete extern declaration of
+ mi_execute_command.
+
+1999-10-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_stack_select_frame): Conditionalize the body
+ on UI_OUT, because select_frame_command_wrapper is only defined if
+ UI_OUT is.
+ (mi_cmd_exec_interrupt): Conditionalize the body on UI_OUT,
+ because interrupt_target_command_wrapper is only defined if UI_OUT is.
+
+ * mi-cmds.c (mi_cmds): Implement command exec-interrupt by
+ mi_cmd_exec_interrupt.
+
+ * mi-main.c (mi_cmd_exec_interrupt): New function. Implements
+ exec-interrupt command.
+ (mi_cmd_execute): If the target is running save execution command
+ token in previous_async_command. If the command is not 'interrupt'
+ and the target is running, reject it.
+ (clean): New function. Free the arg and reset it to NULL.
+
+ * mi-cmds.h (mi_cmd_exec_interrupt):Export.
+
+1999-10-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Implement command stack-select-frame by
+ mi_cmd_stack_select_frame.
+
+ * mi-main.c (mi_cmd_stack_select_frame): New function. Implements
+ stack-select-frame command.
+
+ * mi-cmds.h (mi_cmd_select_frame):Export.
+
+1999-10-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Implement commands stack-list-locals and
+ stack-list-arguments by mi_cmd_stack_list_locals and
+ mi_cmd_stack_list_args.
+
+ * mi-main.c (mi_cmd_stack_list_locals): New function. Implements
+ stack-list-locals command.
+ (mi_cmd_stack_list_args): New function. Implements
+ stack-list-arguments command.
+ (list_args_or_locals): New function. Do all the work for the
+ listing of locals or arguments.
+
+ * mi-cmds.h (mi_cmd_stack_list_args,mi_cmd_stack_list_locals) :
+ Export.
+
+1999-10-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Add new command stack-info-depth.
+
+ * mi-main.c (mi_cmd_stack_info_depth): New function. Implements
+ the stack-info-depth command.
+ * mi-cmds.h (mi_cmd_stack_info_depth): Export.
+
+
+1999-10-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_execute_command): Handle MI_CMD_ERROR case
+ properly, for command that return error code and don't set
+ mi_error_message.
+
+ * mi-cmds.c (mi_cmds): Hook stack-list-frames command to
+ mi_cmd_stack_list_frames function.
+ * mi-cmds.h (mi_cmd_stack_list_frames): Export.
+
+ * mi-main.c (mi_execute_command): Deal with a return code of
+ MI_CMD_ERROR from the execution of mi commands.
+ (mi_error_message): Static string variable, to contain the error
+ message from mi commands.
+ (mi_cmd_stack_list_frames): New function. Prints a backtrace.
+
+1999-10-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_disassemble): Handle the new command line
+ parameter that specifies the number of disassembly lines to be
+ displayed.
+ (gdb_do_disassemble): Add new parameter. Count the number of lines
+ that have been displayed, and stop when limit is reached.
+
+Wed Oct 13 18:04:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_command_loop): Don't initialize ``flush_hook''.
+
+1999-10-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi/gdbmi.texinfo: More reformatting of the grammars.
+
+1999-10-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi/gdbmi.texinfo: More TeX formatting.
+
+1999-10-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi/gdbmi.texinfo: First pass completed. All commands should have
+ some comments/info.
+ Escape '@' output special char.
+ Reformat for TeX.
+
+1999-10-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi/gdbmi.texinfo: Filled in part of file command section, and
+ stack section.
+
+1999-10-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi/gdbmi.texinfo: Filled in some sections about execution
+ commands.
+
+Tue Oct 5 15:27:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h: Sort table
+ * mi-cmds.c: Ditto.
+ (MI_TABLE_SIZE): Increase to 251.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_var_create, mi_cmd_var_delete): Add missing
+ cleanups.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (next_arg): Returns lenght as well.
+ (which_var, mi_cmd_var_create, mi_cmd_var_delete,
+ mi_cmd_var_set_format, mi_cmd_var_update): Do not modify the input
+ string, use allocated storage instead.
+ (mi_cmd_var_assign): Adjust call to next_arg() to include new
+ argument.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_execute_command): Fix handling of errors.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c (mi_out_new): Call tui_sfileopen() instead of
+ deprecated gdb_file_init_astream().
+ * mi-main.c (mi_console_file_new): Ditto.
+
+Mon Oct 4 15:17:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h: Sort function declarations.
+ (mi_lookup): Add extern.
+
+ * mi-cmds.c (mi_lookup): Delete dead code.
+ (build_table): Call internal_error instead of error.
+ (build_table): Send trace output to gdb_stdlog.
+
+1999-10-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command): Don't do the cleanups
+ if target_executing is null.
+
+1999-09-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (async_p): Change var name to event_loop_p.
+
+Mon Sep 27 15:11:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command, mi_execute_command):
+ Replace target_has_async with function target_can_async_p.
+
+Sun Sep 26 00:12:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_target_select_continuation): Delete function.
+ (mi_cmd_target_select): Simplify. target-connect is guarenteed to
+ be synchronous.
+
+Sun Sep 26 00:12:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h (mi_cmd_ftype): Replace mi_impl_ftype.
+ (enum mi_cmd_result): Define.
+ * mi-cmds.c (struct mi_cmd): Update.
+ (mi_lookup): Update.
+ * mi-main.c (mi_cmd_execute): Update.
+
+ * mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_run, mi_cmd_exec_next,
+ mi_cmd_exec_step, mi_cmd_target_select, mi_cmd_exec_continue,
+ mi_cmd_exec_return, mi_cmd_exec_finish, mi_cmd_disassemble,
+ mi_cmd_var_create, mi_cmd_var_delete, mi_cmd_var_set_format,
+ mi_cmd_var_show_format, mi_cmd_var_info_num_children,
+ mi_cmd_var_list_children, mi_cmd_var_info_type,
+ mi_cmd_var_info_expression, mi_cmd_var_show_attributes,
+ mi_cmd_var_evaluate_expression, mi_cmd_var_update): Update.
+ Return MI_CMD_DONE.
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_var_create): Use paddr() to format address
+ on trace output.
+
+1999-09-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_var_create): Test for varobjdebug before
+ printing trace and send it to gdb_stdlog.
+
+Mon Sep 20 13:41:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (mi-out.o): Add dependency list.
+ * mi-out.c: Include "mi-out.h".
+
+1999-09-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (_initialize_mi_main): Events on stadin are now
+ handled by stdin_event_handler.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Add var-* commands.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_var_create, mi_cmd_var_delete,
+ mi_cmd_var_set_format, mi_cmd_var_show_format,
+ mi_cmd_var_info_num_children, mi_cmd_var_list_children,
+ mi_cmd_var_info_type, mi_cmd_var_info_expression,
+ mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression,
+ mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one,
+ which_var, next_arg): New functions. Implement the -var-*
+ commands.
+ * mi-cmds.h: Add prototypes for the above.
+
+1999-09-14 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Add detach command.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (lookup_table): Fix typo.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (mi_cmds): Fix typo and missing command.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c: Properly align function prototypes.
+ (mi_cmd_target_select): Proper check for NULL value.
+
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_execute_async_cli_command): Fix for native targets
+ that do not have async yet.
+
+1999-09-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_disassemble): Remove unused var.
+ (gdb_do_disassemble): Ditto.
+
+1999-08-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c: Replace all the occurrences of 'asynch' in variable
+ or function names with 'async' to make it consistent with the rest
+ of gdb.
+
+Mon Aug 30 18:16:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c: #include <ctype.h> for isspace().
+
+1999-08-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (gdb_do_disassemble): This function returns void, not
+ int.
+
+1999-08-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_disassemble): Don't use atoi() on the high
+ address string, just treat it same as address low.
+ (gdb_do_disassemble): Parse high_address string before seeing if
+ it is zero.
+
+1999-08-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_disassemble): New function to produce
+ disassembly output for mi.
+ (gdb_dis_asm_read_memory): New function. Read the disassembly from
+ the executable file, instead of target memory.
+ (compare_lines): New function. Compare order of disassembly lines.
+ (gdb_do_disassemble): New function. Do the real job of getting the
+ assembly code out.
+
+ * mi-cmds.c (mi_cmds): Do data-disassemble mi command via the
+ mi_cmd_disassemble function.
+
+ * mi-cmds.h: Export new function mi_cmd_disassemble.
+
+Wed Aug 25 15:58:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_command_loop): Remove references to ui-hooks.
+
+1999-08-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_execute_asynch_cli_command): Fix the incorrect
+ usage of strcat(): allocate enough space for the string.
+
+1999-08-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Christopher Faylor <cgf@cygnus.com>
+ * mi-main.c (mi_execute_command): Make sure we flush all the
+ output after each command.
+
+1999-08-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (_initialize_mi_main): Remove casting in call to
+ add_file_handler.
+
+Sun Aug 8 17:20:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_target_select, mi_execute_asynch_cli_command):
+ Replace call to fatal with call to internal_error.
+
+1999-07-26 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_execute): Add return code.
+ (mi_execute_command): Make appropriate changes when calling the
+ function mentioned above.
+ (mi_cmd_gdb_exit, mi_cmd_target_select,
+ mi_cmd_target_select_continuation, mi_execute_command,
+ mi_exec_asynch_cli_cmd, mi_exec_asynch_cli_cmd_continuation):
+ Print token, prefix, class and output (if any) in one single group
+ of statements.
+ (mi_execute_command, mi_cmd_execute): Fix error prefix.
+ (mi_cmd_execute): Use exec cleanup for token.
+ * mi-out.c (mi_out_rewind): New function.
+ * mi-out.h: Prototype for the above.
+
+1999-07-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_gdb_exit): Use buffer for exit message.
+ (mi_cmd_execute): Route error messages to correct file.
+ (mi_execute_asynch_cli_command): Insert line feed after running
+ message.
+
+1999-07-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.h (mi_out_buffered): Add extern declaration.
+ * mi-out.c (mi_out_buffered): New function. Insert a string at the
+ current buffer position.
+ * mi-main.c (mi_cmd_target_select, mi_execute_command,
+ mi_cmd_execute, mi_execute_asynch_cli_command): Use the above
+ function instead of printing to raw_stdout.
+ (mi_cmd_target_select, mi_cmd_target_select_continuation,
+ mi_execute_command, mi_cmd_execute, mi_execute_cli_command,
+ mi_exec_asynch_cli_cmd_continuation): Fix handling of token and
+ prefix.
+ (mi_execute_cli_command): Remove parameter no longer needed.
+
+1999-07-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c (mi_cmd_target_select_continuation): Print the numeric
+ token when we are connected.
+ (mi_execute_command): Don't print the token now, do it later.
+ (mi_execute_cli_command): Add a new parameter for the numeric
+ token. Print the token, the prefix and the class after the
+ command has executed, not before.
+ (mi_execute_asynch_cli_command): Don't print an extra blank line.
+
+1999-07-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_gdb_exit): Add \n at the end.
+
+1999-07-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_cmd_execute): New function. Dispatch a mi operation.
+ (mi_execute_command): Use the above.
+
+1999-07-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c: Fix identation.
+
+1999-07-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-main.c: Include target.h and inferior.h.
+ (mi_cmd_target_select): New function to execute the target-select
+ mi operation.
+ (mi_cmd_target_select_continuation): New function. Continuation
+ for the target-select operation.
+ (mi_execute_command): In case of an MI command which requires
+ asynchronous execution, do not try to display the result now. If
+ the execution has to look synchronous don't display the "(gdb)"
+ prompt.
+ (mi_execute_asynch_cli_command): Invoke real asynchronous
+ commands, set up exec_cleanups, and continuations.
+ (mi_exec_asynch_cli_cmd_continuation): New function. Continuation
+ for all the MI execution commands except 'target-select'.
+ (mi_execute_command): Handle null commands by exiting gdb, instead
+ of core dumping.
+
+ * mi-cmds.c (mi_cmds): Hook up -target-select operation to new mi
+ function.
+
+ * mi-cmds.h (mi_cmd_target_select): Add extern declaration.
+
+Thu Jul 15 10:31:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (struct mi_console_file): Add field ``prefix''.
+ (mi_console_file_new): Add argument prefix. Initialize prefix
+ field.
+ (mi_console_file_flush): Use ``prefix'' instead of "~" as the
+ prefix string.
+ (mi_command_loop): Update stream output prefixes. gdb_stdout ==
+ "~", gdb_stderr / gdb_stdlog == "&", gdb_stdtarg == "@".
+
+1999-07-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (ui_out_data): New field first_header. Fix output when
+ no breakpoints are found.
+ (mi_table_begin, mi_table_body, mi_table_header): Test for
+ first_header.
+ (mi_table_end): Test for supress_field_separator.
+ (mi_message): Remove messages from MI output.
+
+1999-06-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (mi_cmds[]): Delete gdb-cli operation.
+ * mi-main.c (parse): Remove ifdefs for cli commands parsing.
+ (mi-execute-command): Ditto.
+
+Mon Jun 28 13:06:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-out.h: New file.
+ (mi_out_new, mi_out_put): Move mi specific delcarations to here.
+ * ui-out.h: From here.
+
+ * mi-main.c: Include "mi-out.h".
+
+1999-06-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_gdb_version): Add the word HEADLESS when output
+ follows headless format.
+ (print_command_lines): Fix typo.
+
+1999-06-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-loop.h: Export input_fd.
+ * mi-main.c (mi_command_loop): Use the event loop if running
+ asynchronously.
+ (mi_execute_command_wrapper): New function.
+ (_initialize_mi-main): Set things up for running asynchronously.
+
+1999-06-18 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (mi_lookup): Deleted.
+ (lookup_table): New function. Replaces old mi_lookup() for local
+ use.
+ (mi_lookup): New function. External interface for command table
+ searchs.
+ (build_table): New definition.
+ (mi_cmds[]): Add several command implementations and the gdb-cli
+ special operation.
+ (mi_cmd_execute): Deleted.
+ * mi-cmds.h: Add type definition for command implementation
+ function pointers, add declaration for new implementation
+ functions and a declaration for mi_lookup().
+ * mi-main.c (mi_execute_asynch_cli_command): New
+ function. Captures code that was repeated for all asynch
+ operations.
+ (mi_cmd_exec_*): Use the above new function.
+ (mi_gdb_cmd_exit): Fix the output, printing something appropriate.
+ (mi_cmd_exec_finish): New operation implementation function.
+ (mi_cmd_exec_return): Ditto.
+ (parse): Prepare to remove cli commands.
+ (mi_execute_command): Fix the output and change the way mi-cmds is
+ used.
+
+1999-06-18 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c (mi_table_begin): Add missing field separator call.
+
+Thu Jun 17 21:05:40 1999 Fernando Nasser <fnasser@tofu.to.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Remove space in breakpoint table
+ id.
+ (mention): Use ui_out for last new line (forgotten).
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c (mi_console_file_flush): Prevent prefix printing when
+ buffer empty; change prefix to '~'.
+ (mi_cmd_exec_*): Prefix normal output with '^' instead of
+ ','; remove unwanted new lines before "stopped".
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-cmds.c (struct mi_cmds): Updated entries for -exec-continue
+ and exec-next operations.
+ (mi_cmd_execute): New text for error messages.
+ * mi-cmds.h: Add declaration for mi_cmd_exec_next and
+ mi_cmd_exec_continue.
+ * mi-main.c (mi_cmd_exec_next): New function. Implements exec-next
+ operation.
+ (mi_cmd_exec_continue): New function. Implements exec-continue
+ operation.
+ (mi_execute_comand): Add missing space to prompt.
+ (mi_cmd_exec_run): Ditto.
+ (mi_cmd_exec_step): Ditto.
+ * mi-out.c (mi_out_new): Add flags argument to ui_out_new call.
+ (ui_list_end): Reset supress_field_separator flag.
+
+Sat Jun 12 11:49:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h. mi-cmds.c (exec step): Command implemented by
+ mi_cmd_exec_step instead of cli call.
+ * mi-main.c (mi_cmd_exec_step): New function.
+
+ * mi-cmds.h. mi-cmds.c (exec run): Command implemented by
+ mi_cmd_exec_run instead of cli call.
+ * mi-main.c (mi_cmd_exec_run): New function.
+
+ * mi-cmds.h. mi-cmds.c (gdb exit): Command implemented by
+ mi_cmd_gdb_exit instead of quit_force.
+ * mi-main.c (mi_cmd_gdb_exit): New function.
+
+Sat Jun 12 11:33:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_command_loop): Pass mi_input to
+ simplified_command_loop.
+ (mi_input): New function. Calls gdb_readline with no prompt.
+
+Sat Jun 12 11:19:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_console_file_fputs): Re-implement. Use a buffer
+ to accumulate output.
+
+ * mi-main.c (struct mi_console_file): Add a buffer.
+ (mi_console_file_new): Create a buffer.
+ (mi_console_file_flush): New function.
+
+Sat Jun 12 10:59:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-cmds.h (raw_stdout): Declare. Will be moved later.
+ * mi-cmds.c (mi_cmd_execute): Send error messages to RAW stdout.
+ (mi_cmds): Sort by class.
+
+ * mi-main.c (raw_stdout): Make global.
+ * mi-main.c: Remove #ifdef UI_OUT. File assumes UI_OUT is
+ present.
+ * mi-main.c: Include "gdb_string.h".
+ (mi_out_put): Delete declaration.
+
+1999-06-11 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-main.c: Add pre-processor test for UI_OUT.
+ (mi_execute_command): Add pre-processor test for UI_OUT.
+
+Fri Jun 11 23:11:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (raw_stdout): New variable.
+ (mi_execute_command): Write mi-out direct to raw_stdout.
+ (mi_command_loop): Create raw_stdout. Attach gdb_stdout to the
+ console.
+ (mi_console_file_fputs, mi_console_file_delete,
+ mi_console_file_new): New functions.
+ (struct mi_console_file): Declare.
+
+Fri Jun 11 18:34:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_execute_command): Call mi_out_put to display the
+ result.
+ * mi-out.c (mi_out_put): New function.
+ * ui-out.h (mi_out_put): Add declare. Will move later.
+ * Makefile.in (mi-cmds.o, mi-main.o): Add dependency on ui-out.h.
+
+ * mi-out.c (mi_field_string, mi_field_fmt, mi_message, mi_flush,
+ out_field_fmt, list_open, list_close): Replace gdb_stdout with
+ data->buffer.
+ (field_separator, list_open, list_close): Add uiout parameter.
+ (mi_table_begin, mi_table_body, mi_table_end, mi_list_begin,
+ mi_list_end, mi_field_string, mi_field_fmt, out_field_fmt,
+ out_field_fmt): Update.
+
+ * mi-out.c (mi_out_new): Initialize supress_field_separator.
+ (supress_field_separator): Move into mi-out local data object.
+ (mi_table_begin, mi_list_begin, field_separator): Update.
+
+Fri Jun 11 16:08:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-out.c (mi_out_new): New function, replace init_mi_out.
+ * mi-main.c (mi_command_loop): Call mi_out_new().
+
+ * ui-out.h (mi_out_new): Add declaration. Will move later.
+ (mi_ui_out_impl): Delete.
+
+Wed Jun 9 16:42:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c: Include "ui-hooks.h".
+ (mi_init_ui, mi_command_loop): New functions.
+ (_initialize_mi_main): Install ``mi'' as the interpreter when
+ selected.
+
+Mon Jun 7 18:43:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * mi-cmds.c (build_table): Clean up error message.
+ * mi-cmds.c (mi_cmd_execute), mi-main.c (mi_execute_command): Only
+ print debug information when mi_debug_p.
+ * mi-cmds.h (mi_debug_p), mi-main.c: Global, control debug messages.
+
+Thu Jun 3 00:44:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Fernando Nasser <fnasser@totem.to.cygnus.com>:
+ * mi-cmds.c: Add CLI definitions for "exec-arguments",
+ "exec-next", "gdb-exit", "break-list", "break-info", "exec-step"
+ and "stack-list-frames" to mi_cmds.
+ (struct mi_command): Add ``from_tty'' argument to func.
+ * mi-cmds.h (quit_force): Declare.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c (mi_table_end): Remove unwanted "\n".
+
+Thu May 27 14:59:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c: Include "ui-hooks.h".
+ (call_interp_loop): Tempoary. Pass mi_execute_command to
+ simplified_command_loop. Initialize gdb_stdout & gdb_stderr to
+ stdio gdb_file streams. Force all hooks to null.
+
+ * mi-cmds.h, mi-main.c, mi-cmds.c: New files.
+ * Makefile.in (SFILES): Add mi-main.c, mi-cmds.c
+ (COMMON_OBS): Add mi-main.o, mi-cmds.o.
+ (mi_cmds_h): Define.
+
+Wed May 26 12:39:49 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (call_interp_loop): Hack. Add extern declaration for
+ mi_ui_out_impl.
+
+1999-05-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c: New table syntax.
+
+Mon May 24 16:16:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ mi-out.c (_initialize_mi_out): Add external declaration.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c (mi_table_begin): Added missing parameter.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c: Changed table markers and added table id.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * mi-out.c: New file. Implements low-level ui-out primitives for
+ CLI-based interaction.
+
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/gdb/gdb/mi/gdbmi.texinfo b/contrib/gdb/gdb/mi/gdbmi.texinfo
new file mode 100644
index 0000000..f924214
--- /dev/null
+++ b/contrib/gdb/gdb/mi/gdbmi.texinfo
@@ -0,0 +1,3810 @@
+@c \input texinfo @c -*-texinfo-*-
+@c @c %**start of header
+@c @setfilename gdbmi.info
+@c @settitle GDB/MI Machine Interface
+@c @setchapternewpage off
+@c @c %**end of header
+
+@c @ifinfo
+@c This file documents GDB/MI, a Machine Interface to GDB.
+
+@c Copyright 2000, 2001 Free Software Foundation, Inc.
+@c Contributed by Cygnus Solutions.
+
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.1 or
+@c any later version published by the Free Software Foundation; with no
+@c Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
+@c and with the Back-Cover Texts as in (a) below.
+
+@c (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+@c this GNU Manual, like GNU software. Copies published by the Free
+@c Software Foundation raise funds for GNU development.''
+@c @end ifinfo
+
+@c @c This title page illustrates only one of the
+@c @c two methods of forming a title page.
+
+@c @titlepage
+@c @title GDB/MI
+@c @subtitle Version 0.3
+@c @subtitle Apr 2001
+@c @author Andrew Cagney, Fernando Nasser and Elena Zannoni
+
+@c @c The following two commands
+@c @c start the copyright page.
+@c @page
+@c @vskip 0pt plus 1filll
+
+@c Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
+
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.1 or
+@c any later version published by the Free Software Foundation; with no
+@c Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
+@c and with the Back-Cover Texts as in (a) below.
+
+@c (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+@c this GNU Manual, like GNU software. Copies published by the Free
+@c Software Foundation raise funds for GNU development.''
+@c @end titlepage
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI
+@chapter The @sc{gdb/mi} Interface
+
+@unnumberedsec Function and Purpose
+
+@cindex @sc{gdb/mi}, its purpose
+@sc{gdb/mi} is a line based machine oriented text interface to @value{GDBN}. It is
+specifically intended to support the development of systems which use
+the debugger as just one small component of a larger system.
+
+This chapter is a specification of the @sc{gdb/mi} interface. It is written
+in the form of a reference manual.
+
+Note that @sc{gdb/mi} is still under construction, so some of the
+features described below are incomplete and subject to change.
+
+@unnumberedsec Notation and Terminology
+
+@cindex notational conventions, for @sc{gdb/mi}
+This chapter uses the following notation:
+
+@itemize @bullet
+@item
+@code{|} separates two alternatives.
+
+@item
+@code{[ @var{something} ]} indicates that @var{something} is optional:
+it may or may not be given.
+
+@item
+@code{( @var{group} )*} means that @var{group} inside the parentheses
+may repeat zero or more times.
+
+@item
+@code{( @var{group} )+} means that @var{group} inside the parentheses
+may repeat one or more times.
+
+@item
+@code{"@var{string}"} means a literal @var{string}.
+@end itemize
+
+@ignore
+@heading Dependencies
+@end ignore
+
+@heading Acknowledgments
+
+In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
+Elena Zannoni.
+
+@menu
+* GDB/MI Command Syntax::
+* GDB/MI Compatibility with CLI::
+* GDB/MI Output Records::
+* GDB/MI Command Description Format::
+* GDB/MI Breakpoint Table Commands::
+* GDB/MI Data Manipulation::
+* GDB/MI Program Control::
+* GDB/MI Miscellaneous Commands::
+@ignore
+* GDB/MI Kod Commands::
+* GDB/MI Memory Overlay Commands::
+* GDB/MI Signal Handling Commands::
+@end ignore
+* GDB/MI Stack Manipulation::
+* GDB/MI Symbol Query::
+* GDB/MI Target Manipulation::
+* GDB/MI Thread Commands::
+* GDB/MI Tracepoint Commands::
+* GDB/MI Variable Objects::
+@end menu
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Command Syntax
+@section @sc{gdb/mi} Command Syntax
+
+@menu
+* GDB/MI Input Syntax::
+* GDB/MI Output Syntax::
+* GDB/MI Simple Examples::
+@end menu
+
+@node GDB/MI Input Syntax
+@subsection @sc{gdb/mi} Input Syntax
+
+@cindex input syntax for @sc{gdb/mi}
+@cindex @sc{gdb/mi}, input syntax
+@table @code
+@item @var{command} @expansion{}
+@code{@var{cli-command} | @var{mi-command}}
+
+@item @var{cli-command} @expansion{}
+@code{[ @var{token} ] @var{cli-command} @var{nl}}, where
+@var{cli-command} is any existing @value{GDBN} CLI command.
+
+@item @var{mi-command} @expansion{}
+@code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )*
+@code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}}
+
+@item @var{token} @expansion{}
+"any sequence of digits"
+
+@item @var{option} @expansion{}
+@code{"-" @var{parameter} [ " " @var{parameter} ]}
+
+@item @var{parameter} @expansion{}
+@code{@var{non-blank-sequence} | @var{c-string}}
+
+@item @var{operation} @expansion{}
+@emph{any of the operations described in this chapter}
+
+@item @var{non-blank-sequence} @expansion{}
+@emph{anything, provided it doesn't contain special characters such as
+"-", @var{nl}, """ and of course " "}
+
+@item @var{c-string} @expansion{}
+@code{""" @var{seven-bit-iso-c-string-content} """}
+
+@item @var{nl} @expansion{}
+@code{CR | CR-LF}
+@end table
+
+@noindent
+Notes:
+
+@itemize @bullet
+@item
+The CLI commands are still handled by the @sc{mi} interpreter; their
+output is described below.
+
+@item
+The @code{@var{token}}, when present, is passed back when the command
+finishes.
+
+@item
+Some @sc{mi} commands accept optional arguments as part of the parameter
+list. Each option is identified by a leading @samp{-} (dash) and may be
+followed by an optional argument parameter. Options occur first in the
+parameter list and can be delimited from normal parameters using
+@samp{--} (this is useful when some parameters begin with a dash).
+@end itemize
+
+Pragmatics:
+
+@itemize @bullet
+@item
+We want easy access to the existing CLI syntax (for debugging).
+
+@item
+We want it to be easy to spot a @sc{mi} operation.
+@end itemize
+
+@node GDB/MI Output Syntax
+@subsection @sc{gdb/mi} Output Syntax
+
+@cindex output syntax of @sc{gdb/mi}
+@cindex @sc{gdb/mi}, output syntax
+The output from @sc{gdb/mi} consists of zero or more out-of-band records
+followed, optionally, by a single result record. This result record
+is for the most recent command. The sequence of output records is
+terminated by @samp{(@value{GDBP})}.
+
+If an input command was prefixed with a @code{@var{token}} then the
+corresponding output for that command will also be prefixed by that same
+@var{token}.
+
+@table @code
+@item @var{output} @expansion{}
+@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
+
+@item @var{result-record} @expansion{}
+@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
+
+@item @var{out-of-band-record} @expansion{}
+@code{@var{async-record} | @var{stream-record}}
+
+@item @var{async-record} @expansion{}
+@code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}}
+
+@item @var{exec-async-output} @expansion{}
+@code{[ @var{token} ] "*" @var{async-output}}
+
+@item @var{status-async-output} @expansion{}
+@code{[ @var{token} ] "+" @var{async-output}}
+
+@item @var{notify-async-output} @expansion{}
+@code{[ @var{token} ] "=" @var{async-output}}
+
+@item @var{async-output} @expansion{}
+@code{@var{async-class} ( "," @var{result} )* @var{nl}}
+
+@item @var{result-class} @expansion{}
+@code{"done" | "running" | "connected" | "error" | "exit"}
+
+@item @var{async-class} @expansion{}
+@code{"stopped" | @var{others}} (where @var{others} will be added
+depending on the needs---this is still in development).
+
+@item @var{result} @expansion{}
+@code{ @var{variable} "=" @var{value}}
+
+@item @var{variable} @expansion{}
+@code{ @var{string} }
+
+@item @var{value} @expansion{}
+@code{ @var{const} | @var{tuple} | @var{list} }
+
+@item @var{const} @expansion{}
+@code{@var{c-string}}
+
+@item @var{tuple} @expansion{}
+@code{ "@{@}" | "@{" @var{result} ( "," @var{result} )* "@}" }
+
+@item @var{list} @expansion{}
+@code{ "[]" | "[" @var{value} ( "," @var{value} )* "]" | "["
+@var{result} ( "," @var{result} )* "]" }
+
+@item @var{stream-record} @expansion{}
+@code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}}
+
+@item @var{console-stream-output} @expansion{}
+@code{"~" @var{c-string}}
+
+@item @var{target-stream-output} @expansion{}
+@code{"@@" @var{c-string}}
+
+@item @var{log-stream-output} @expansion{}
+@code{"&" @var{c-string}}
+
+@item @var{nl} @expansion{}
+@code{CR | CR-LF}
+
+@item @var{token} @expansion{}
+@emph{any sequence of digits}.
+@end table
+
+@noindent
+Notes:
+
+@itemize @bullet
+@item
+All output sequences end in a single line containing a period.
+
+@item
+The @code{@var{token}} is from the corresponding request. If an execution
+command is interrupted by the @samp{-exec-interrupt} command, the
+@var{token} associated with the @samp{*stopped} message is the one of the
+original execution command, not the one of the interrupt command.
+
+@item
+@cindex status output in @sc{gdb/mi}
+@var{status-async-output} contains on-going status information about the
+progress of a slow operation. It can be discarded. All status output is
+prefixed by @samp{+}.
+
+@item
+@cindex async output in @sc{gdb/mi}
+@var{exec-async-output} contains asynchronous state change on the target
+(stopped, started, disappeared). All async output is prefixed by
+@samp{*}.
+
+@item
+@cindex notify output in @sc{gdb/mi}
+@var{notify-async-output} contains supplementary information that the
+client should handle (e.g., a new breakpoint information). All notify
+output is prefixed by @samp{=}.
+
+@item
+@cindex console output in @sc{gdb/mi}
+@var{console-stream-output} is output that should be displayed as is in the
+console. It is the textual response to a CLI command. All the console
+output is prefixed by @samp{~}.
+
+@item
+@cindex target output in @sc{gdb/mi}
+@var{target-stream-output} is the output produced by the target program.
+All the target output is prefixed by @samp{@@}.
+
+@item
+@cindex log output in @sc{gdb/mi}
+@var{log-stream-output} is output text coming from @value{GDBN}'s internals, for
+instance messages that should be displayed as part of an error log. All
+the log output is prefixed by @samp{&}.
+
+@item
+@cindex list output in @sc{gdb/mi}
+New @sc{gdb/mi} commands should only output @var{lists} containing
+@var{values}.
+
+
+@end itemize
+
+@xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more
+details about the various output records.
+
+@node GDB/MI Simple Examples
+@subsection Simple Examples of @sc{gdb/mi} Interaction
+@cindex @sc{gdb/mi}, simple examples
+
+This subsection presents several simple examples of interaction using
+the @sc{gdb/mi} interface. In these examples, @samp{->} means that the
+following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
+the output received from @sc{gdb/mi}.
+
+@subsubheading Target Stop
+
+Here's an example of stopping the inferior process:
+
+@example
+-> -stop
+<- (@value{GDBP})
+@end example
+
+@noindent
+and later:
+
+@example
+<- *stop,reason="stop",address="0x123",source="a.c:123"
+<- (@value{GDBP})
+@end example
+
+@subsubheading Simple CLI Command
+
+Here's an example of a simple CLI command being passed through
+@sc{gdb/mi} and on to the CLI.
+
+@example
+-> print 1+2
+<- ~3\n
+<- (@value{GDBP})
+@end example
+
+@subsubheading Command With Side Effects
+
+@example
+-> -symbol-file xyz.exe
+<- *breakpoint,nr="3",address="0x123",source="a.c:123"
+<- (@value{GDBP})
+@end example
+
+@subsubheading A Bad Command
+
+Here's what happens if you pass a non-existent command:
+
+@example
+-> -rubbish
+<- error,"Rubbish not found"
+<- (@value{GDBP})
+@end example
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Compatibility with CLI
+@section @sc{gdb/mi} Compatibility with CLI
+
+@cindex compatibility, @sc{gdb/mi} and CLI
+@cindex @sc{gdb/mi}, compatibility with CLI
+To help users familiar with @value{GDBN}'s existing CLI interface, @sc{gdb/mi}
+accepts existing CLI commands. As specified by the syntax, such
+commands can be directly entered into the @sc{gdb/mi} interface and @value{GDBN} will
+respond.
+
+This mechanism is provided as an aid to developers of @sc{gdb/mi}
+clients and not as a reliable interface into the CLI. Since the command
+is being interpreteted in an environment that assumes @sc{gdb/mi}
+behaviour, the exact output of such commands is likely to end up being
+an un-supported hybrid of @sc{gdb/mi} and CLI output.
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Output Records
+@section @sc{gdb/mi} Output Records
+
+@menu
+* GDB/MI Result Records::
+* GDB/MI Stream Records::
+* GDB/MI Out-of-band Records::
+@end menu
+
+@node GDB/MI Result Records
+@subsection @sc{gdb/mi} Result Records
+
+@cindex result records in @sc{gdb/mi}
+@cindex @sc{gdb/mi}, result records
+In addition to a number of out-of-band notifications, the response to a
+@sc{gdb/mi} command includes one of the following result indications:
+
+@table @code
+@findex ^done
+@item "^done" [ "," @var{results} ]
+The synchronous operation was successful, @code{@var{results}} are the return
+values.
+
+@item "^running"
+@findex ^running
+@c Is this one correct? Should it be an out-of-band notification?
+The asynchronous operation was successfully started. The target is
+running.
+
+@item "^error" "," @var{c-string}
+@findex ^error
+The operation failed. The @code{@var{c-string}} contains the corresponding
+error message.
+@end table
+
+@node GDB/MI Stream Records
+@subsection @sc{gdb/mi} Stream Records
+
+@cindex @sc{gdb/mi}, stream records
+@cindex stream records in @sc{gdb/mi}
+@value{GDBN} internally maintains a number of output streams: the console, the
+target, and the log. The output intended for each of these streams is
+funneled through the @sc{gdb/mi} interface using @dfn{stream records}.
+
+Each stream record begins with a unique @dfn{prefix character} which
+identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output
+Syntax}). In addition to the prefix, each stream record contains a
+@code{@var{string-output}}. This is either raw text (with an implicit new
+line) or a quoted C string (which does not contain an implicit newline).
+
+@table @code
+@item "~" @var{string-output}
+The console output stream contains text that should be displayed in the
+CLI console window. It contains the textual responses to CLI commands.
+
+@item "@@" @var{string-output}
+The target output stream contains any textual output from the running
+target.
+
+@item "&" @var{string-output}
+The log stream contains debugging messages being produced by @value{GDBN}'s
+internals.
+@end table
+
+@node GDB/MI Out-of-band Records
+@subsection @sc{gdb/mi} Out-of-band Records
+
+@cindex out-of-band records in @sc{gdb/mi}
+@cindex @sc{gdb/mi}, out-of-band records
+@dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of
+additional changes that have occurred. Those changes can either be a
+consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of
+target activity (e.g., target stopped).
+
+The following is a preliminary list of possible out-of-band records.
+
+@table @code
+@item "*" "stop"
+@end table
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Command Description Format
+@section @sc{gdb/mi} Command Description Format
+
+The remaining sections describe blocks of commands. Each block of
+commands is laid out in a fashion similar to this section.
+
+Note the the line breaks shown in the examples are here only for
+readability. They don't appear in the real output.
+Also note that the commands with a non-available example (N.A.@:) are
+not yet implemented.
+
+@subheading Motivation
+
+The motivation for this collection of commands.
+
+@subheading Introduction
+
+A brief introduction to this collection of commands as a whole.
+
+@subheading Commands
+
+For each command in the block, the following is described:
+
+@subsubheading Synopsis
+
+@example
+ -command @var{args}@dots{}
+@end example
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} CLI command.
+
+@subsubheading Result
+
+@subsubheading Out-of-band
+
+@subsubheading Notes
+
+@subsubheading Example
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Breakpoint Table Commands
+@section @sc{gdb/mi} Breakpoint table commands
+
+@cindex breakpoint commands for @sc{gdb/mi}
+@cindex @sc{gdb/mi}, breakpoint commands
+This section documents @sc{gdb/mi} commands for manipulating
+breakpoints.
+
+@subheading The @code{-break-after} Command
+@findex -break-after
+
+@subsubheading Synopsis
+
+@example
+ -break-after @var{number} @var{count}
+@end example
+
+The breakpoint number @var{number} is not in effect until it has been
+hit @var{count} times. To see how this is reflected in the output of
+the @samp{-break-list} command, see the description of the
+@samp{-break-list} command below.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{ignore}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-insert main
+^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@}
+(@value{GDBP})
+-break-after 1 3
+~
+^done
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
+ignore="3"@}]@}
+(@value{GDBP})
+@end smallexample
+
+@ignore
+@subheading The @code{-break-catch} Command
+@findex -break-catch
+
+@subheading The @code{-break-commands} Command
+@findex -break-commands
+@end ignore
+
+
+@subheading The @code{-break-condition} Command
+@findex -break-condition
+
+@subsubheading Synopsis
+
+@example
+ -break-condition @var{number} @var{expr}
+@end example
+
+Breakpoint @var{number} will stop the program only if the condition in
+@var{expr} is true. The condition becomes part of the
+@samp{-break-list} output (see the description of the @samp{-break-list}
+command below).
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{condition}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-condition 1 1
+^done
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
+times="0",ignore="3"@}]@}
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-break-delete} Command
+@findex -break-delete
+
+@subsubheading Synopsis
+
+@example
+ -break-delete ( @var{breakpoint} )+
+@end example
+
+Delete the breakpoint(s) whose number(s) are specified in the argument
+list. This is obviously reflected in the breakpoint list.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{delete}.
+
+@subsubheading Example
+
+@example
+(@value{GDBP})
+-break-delete 1
+^done
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[]@}
+(@value{GDBP})
+@end example
+
+@subheading The @code{-break-disable} Command
+@findex -break-disable
+
+@subsubheading Synopsis
+
+@example
+ -break-disable ( @var{breakpoint} )+
+@end example
+
+Disable the named @var{breakpoint}(s). The field @samp{enabled} in the
+break list is now set to @samp{n} for the named @var{breakpoint}(s).
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{disable}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-disable 2
+^done
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@}
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-break-enable} Command
+@findex -break-enable
+
+@subsubheading Synopsis
+
+@example
+ -break-enable ( @var{breakpoint} )+
+@end example
+
+Enable (previously disabled) @var{breakpoint}(s).
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{enable}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-enable 2
+^done
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@}
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-break-info} Command
+@findex -break-info
+
+@subsubheading Synopsis
+
+@example
+ -break-info @var{breakpoint}
+@end example
+
+@c REDUNDANT???
+Get information about a single breakpoint.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{info break @var{breakpoint}}.
+
+@subsubheading Example
+N.A.
+
+@subheading The @code{-break-insert} Command
+@findex -break-insert
+
+@subsubheading Synopsis
+
+@example
+ -break-insert [ -t ] [ -h ] [ -r ]
+ [ -c @var{condition} ] [ -i @var{ignore-count} ]
+ [ -p @var{thread} ] [ @var{line} | @var{addr} ]
+@end example
+
+@noindent
+If specified, @var{line}, can be one of:
+
+@itemize @bullet
+@item function
+@c @item +offset
+@c @item -offset
+@c @item linenum
+@item filename:linenum
+@item filename:function
+@item *address
+@end itemize
+
+The possible optional parameters of this command are:
+
+@table @samp
+@item -t
+Insert a tempoary breakpoint.
+@item -h
+Insert a hardware breakpoint.
+@item -c @var{condition}
+Make the breakpoint conditional on @var{condition}.
+@item -i @var{ignore-count}
+Initialize the @var{ignore-count}.
+@item -r
+Insert a regular breakpoint in all the functions whose names match the
+given regular expression. Other flags are not applicable to regular
+expresson.
+@end table
+
+@subsubheading Result
+
+The result is in the form:
+
+@example
+ ^done,bkptno="@var{number}",func="@var{funcname}",
+ file="@var{filename}",line="@var{lineno}"
+@end example
+
+@noindent
+where @var{number} is the @value{GDBN} number for this breakpoint, @var{funcname}
+is the name of the function where the breakpoint was inserted,
+@var{filename} is the name of the source file which contains this
+function, and @var{lineno} is the source line number within that file.
+
+Note: this format is open to change.
+@c An out-of-band breakpoint instead of part of the result?
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak},
+@samp{hbreak}, @samp{thbreak}, and @samp{rbreak}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-insert main
+^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
+(@value{GDBP})
+-break-insert -t foo
+^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@},
+bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
+addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}]@}
+(@value{GDBP})
+-break-insert -r foo.*
+~int foo(int, int);
+^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@}
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-break-list} Command
+@findex -break-list
+
+@subsubheading Synopsis
+
+@example
+ -break-list
+@end example
+
+Displays the list of inserted breakpoints, showing the following fields:
+
+@table @samp
+@item Number
+number of the breakpoint
+@item Type
+type of the breakpoint: @samp{breakpoint} or @samp{watchpoint}
+@item Disposition
+should the breakpoint be deleted or disabled when it is hit: @samp{keep}
+or @samp{nokeep}
+@item Enabled
+is the breakpoint enabled or no: @samp{y} or @samp{n}
+@item Address
+memory location at which the breakpoint is set
+@item What
+logical location of the breakpoint, expressed by function name, file
+name, line number
+@item Times
+number of times the breakpoint has been hit
+@end table
+
+If there are no breakpoints or watchpoints, the @code{BreakpointTable}
+@code{body} field is an empty list.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info break}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
+bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
+addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}]@}
+(@value{GDBP})
+@end smallexample
+
+Here's an example of the result when there are no breakpoints:
+
+@smallexample
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[]@}
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-break-watch} Command
+@findex -break-watch
+
+@subsubheading Synopsis
+
+@example
+ -break-watch [ -a | -r ]
+@end example
+
+Create a watchpoint. With the @samp{-a} option it will create an
+@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a
+read from or on a write to the memory location. With the @samp{-r}
+option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will
+trigger only when the memory location is accessed for reading. Without
+either of the options, the watchpoint created is a regular watchpoint,
+i.e. it will trigger when the memory location is accessed for writing.
+@xref{Set Watchpoints, , Setting watchpoints}.
+
+Note that @samp{-break-list} will report a single list of watchpoints and
+breakpoints inserted.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{watch}, @samp{awatch}, and
+@samp{rwatch}.
+
+@subsubheading Example
+
+Setting a watchpoint on a variable in the @code{main} function:
+
+@smallexample
+(@value{GDBP})
+-break-watch x
+^done,wpt=@{number="2",exp="x"@}
+(@value{GDBP})
+-exec-continue
+^running
+^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
+value=@{old="-268439212",new="55"@},
+frame=@{func="main",args=[],file="recursive2.c",line="5"@}
+(@value{GDBP})
+@end smallexample
+
+Setting a watchpoint on a variable local to a function. @value{GDBN} will stop
+the program execution twice: first for the variable changing value, then
+for the watchpoint going out of scope.
+
+@smallexample
+(@value{GDBP})
+-break-watch C
+^done,wpt=@{number="5",exp="C"@}
+(@value{GDBP})
+-exec-continue
+^running
+^done,reason="watchpoint-trigger",
+wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
+frame=@{func="callee4",args=[],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
+(@value{GDBP})
+-exec-continue
+^running
+^done,reason="watchpoint-scope",wpnum="5",
+frame=@{func="callee3",args=[@{name="strarg",
+value="0x11940 \"A string argument.\""@}],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+(@value{GDBP})
+@end smallexample
+
+Listing breakpoints and watchpoints, at different points in the program
+execution. Note that once the watchpoint goes out of scope, it is
+deleted.
+
+@smallexample
+(@value{GDBP})
+-break-watch C
+^done,wpt=@{number="2",exp="C"@}
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x00010734",func="callee4",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
+bkpt=@{number="2",type="watchpoint",disp="keep",
+enabled="y",addr="",what="C",times="0"@}]@}
+(@value{GDBP})
+-exec-continue
+^running
+^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
+value=@{old="-276895068",new="3"@},
+frame=@{func="callee4",args=[],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x00010734",func="callee4",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
+bkpt=@{number="2",type="watchpoint",disp="keep",
+enabled="y",addr="",what="C",times="-5"@}]@}
+(@value{GDBP})
+-exec-continue
+^running
+^done,reason="watchpoint-scope",wpnum="2",
+frame=@{func="callee3",args=[@{name="strarg",
+value="0x11940 \"A string argument.\""@}],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+(@value{GDBP})
+-break-list
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x00010734",func="callee4",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}]@}
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Data Manipulation
+@section @sc{gdb/mi} Data Manipulation
+
+@cindex data manipulation, in @sc{gdb/mi}
+@cindex @sc{gdb/mi}, data manipulation
+This section describes the @sc{gdb/mi} commands that manipulate data:
+examine memory and registers, evaluate expressions, etc.
+
+@c REMOVED FROM THE INTERFACE.
+@c @subheading -data-assign
+@c Change the value of a program variable. Plenty of side effects.
+@c @subsubheading GDB command
+@c set variable
+@c @subsubheading Example
+@c N.A.
+
+@subheading The @code{-data-disassemble} Command
+@findex -data-disassemble
+
+@subsubheading Synopsis
+
+@example
+ -data-disassemble
+ [ -s @var{start-addr} -e @var{end-addr} ]
+ | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
+ -- @var{mode}
+@end example
+
+@noindent
+Where:
+
+@table @samp
+@item @var{start-addr}
+is the beginning address (or @code{$pc})
+@item @var{end-addr}
+is the end address
+@item @var{filename}
+is the name of the file to disassemble
+@item @var{linenum}
+is the line number to disassemble around
+@item @var{lines}
+is the the number of disassembly lines to be produced. If it is -1,
+the whole function will be disassembled, in case no @var{end-addr} is
+specified. If @var{end-addr} is specified as a non-zero value, and
+@var{lines} is lower than the number of disassembly lines between
+@var{start-addr} and @var{end-addr}, only @var{lines} lines are
+displayed; if @var{lines} is higher than the number of lines between
+@var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr}
+are displayed.
+@item @var{mode}
+is either 0 (meaning only disassembly) or 1 (meaning mixed source and
+disassembly).
+@end table
+
+@subsubheading Result
+
+The output for each instruction is composed of four fields:
+
+@itemize @bullet
+@item Address
+@item Func-name
+@item Offset
+@item Instruction
+@end itemize
+
+Note that whatever included in the instruction field, is not manipulated
+directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format.
+
+@subsubheading @value{GDBN} Command
+
+There's no direct mapping from this command to the CLI.
+
+@subsubheading Example
+
+Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
+
+@smallexample
+(@value{GDBP})
+-data-disassemble -s $pc -e "$pc + 20" -- 0
+^done,
+asm_insns=[
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@},
+@{address="0x000107c8",func-name="main",offset="12",
+inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
+@{address="0x000107cc",func-name="main",offset="16",
+inst="sethi %hi(0x11800), %o2"@},
+@{address="0x000107d0",func-name="main",offset="20",
+inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}]
+(@value{GDBP})
+@end smallexample
+
+Disassemble the whole @code{main} function. Line 32 is part of
+@code{main}.
+
+@smallexample
+-data-disassemble -f basics.c -l 32 -- 0
+^done,asm_insns=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@},
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@},
+[@dots{}]
+@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
+@{address="0x00010820",func-name="main",offset="100",inst="restore "@}]
+(@value{GDBP})
+@end smallexample
+
+Disassemble 3 instructions from the start of @code{main}:
+
+@smallexample
+(@value{GDBP})
+-data-disassemble -f basics.c -l 32 -n 3 -- 0
+^done,asm_insns=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@},
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@}]
+(@value{GDBP})
+@end smallexample
+
+Disassemble 3 instructions from the start of @code{main} in mixed mode:
+
+@smallexample
+(@value{GDBP})
+-data-disassemble -f basics.c -l 32 -n 3 -- 1
+^done,asm_insns=[
+src_and_asm_line=@{line="31",
+file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
+ testsuite/gdb.mi/basics.c",line_asm_insn=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@}]@},
+src_and_asm_line=@{line="32",
+file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
+ testsuite/gdb.mi/basics.c",line_asm_insn=[
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@}]@}]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-data-evaluate-expression} Command
+@findex -data-evaluate-expression
+
+@subsubheading Synopsis
+
+@example
+ -data-evaluate-expression @var{expr}
+@end example
+
+Evaluate @var{expr} as an expression. The expression could contain an
+inferior function call. The function call will execute synchronously.
+If the expression contains spaces, it must be enclosed in double quotes.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{print}, @samp{output}, and
+@samp{call}. In @code{gdbtk} only, there's a corresponding
+@samp{gdb_eval} command.
+
+@subsubheading Example
+
+In the following example, the numbers that precede the commands are the
+@dfn{tokens} described in @ref{GDB/MI Command Syntax, ,@sc{gdb/mi}
+Command Syntax}. Notice how @sc{gdb/mi} returns the same tokens in its
+output.
+
+@smallexample
+211-data-evaluate-expression A
+211^done,value="1"
+(@value{GDBP})
+311-data-evaluate-expression &A
+311^done,value="0xefffeb7c"
+(@value{GDBP})
+411-data-evaluate-expression A+3
+411^done,value="4"
+(@value{GDBP})
+511-data-evaluate-expression "A + 3"
+511^done,value="4"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-data-list-changed-registers} Command
+@findex -data-list-changed-registers
+
+@subsubheading Synopsis
+
+@example
+ -data-list-changed-registers
+@end example
+
+Display a list of the registers that have changed.
+
+@subsubheading @value{GDBN} Command
+
+@value{GDBN} doesn't have a direct analog for this command; @code{gdbtk}
+has the corresponding command @samp{gdb_changed_register_list}.
+
+@subsubheading Example
+
+On a PPC MBX board:
+
+@smallexample
+(@value{GDBP})
+-exec-continue
+^running
+
+(@value{GDBP})
+*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
+args=[],file="try.c",line="5"@}
+(@value{GDBP})
+-data-list-changed-registers
+^done,changed-registers=["0","1","2","4","5","6","7","8","9",
+"10","11","13","14","15","16","17","18","19","20","21","22","23",
+"24","25","26","27","28","30","31","64","65","66","67","69"]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-data-list-register-names} Command
+@findex -data-list-register-names
+
+@subsubheading Synopsis
+
+@example
+ -data-list-register-names [ ( @var{regno} )+ ]
+@end example
+
+Show a list of register names for the current target. If no arguments
+are given, it shows a list of the names of all the registers. If
+integer numbers are given as arguments, it will print a list of the
+names of the registers corresponding to the arguments. To ensure
+consistency between a register name and its number, the output list may
+include empty register names.
+
+@subsubheading @value{GDBN} Command
+
+@value{GDBN} does not have a command which corresponds to
+@samp{-data-list-register-names}. In @code{gdbtk} there is a
+corresponding command @samp{gdb_regnames}.
+
+@subsubheading Example
+
+For the PPC MBX board:
+@smallexample
+(@value{GDBP})
+-data-list-register-names
+^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
+"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
+"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
+"r30","r31","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",
+"", "pc","ps","cr","lr","ctr","xer"]
+(@value{GDBP})
+-data-list-register-names 1 2 3
+^done,register-names=["r1","r2","r3"]
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-data-list-register-values} Command
+@findex -data-list-register-values
+
+@subsubheading Synopsis
+
+@example
+ -data-list-register-values @var{fmt} [ ( @var{regno} )*]
+@end example
+
+Display the registers' contents. @var{fmt} is the format according to
+which the registers' contents are to be returned, followed by an optional
+list of numbers specifying the registers to display. A missing list of
+numbers indicates that the contents of all the registers must be returned.
+
+Allowed formats for @var{fmt} are:
+
+@table @code
+@item x
+Hexadecimal
+@item o
+Octal
+@item t
+Binary
+@item d
+Decimal
+@item r
+Raw
+@item N
+Natural
+@end table
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info
+all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
+
+@subsubheading Example
+
+For a PPC MBX board (note: line breaks are for readability only, they
+don't appear in the actual output):
+
+@smallexample
+(@value{GDBP})
+-data-list-register-values r 64 65
+^done,register-values=[@{number="64",value="0xfe00a300"@},
+@{number="65",value="0x00029002"@}]
+(@value{GDBP})
+-data-list-register-values x
+^done,register-values=[@{number="0",value="0xfe0043c8"@},
+@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
+@{number="3",value="0x0"@},@{number="4",value="0xa"@},
+@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
+@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
+@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
+@{number="11",value="0x1"@},@{number="12",value="0x0"@},
+@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
+@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
+@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
+@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
+@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
+@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
+@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
+@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
+@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
+@{number="31",value="0x0"@},@{number="32",value="0x0"@},
+@{number="33",value="0x0"@},@{number="34",value="0x0"@},
+@{number="35",value="0x0"@},@{number="36",value="0x0"@},
+@{number="37",value="0x0"@},@{number="38",value="0x0"@},
+@{number="39",value="0x0"@},@{number="40",value="0x0"@},
+@{number="41",value="0x0"@},@{number="42",value="0x0"@},
+@{number="43",value="0x0"@},@{number="44",value="0x0"@},
+@{number="45",value="0x0"@},@{number="46",value="0x0"@},
+@{number="47",value="0x0"@},@{number="48",value="0x0"@},
+@{number="49",value="0x0"@},@{number="50",value="0x0"@},
+@{number="51",value="0x0"@},@{number="52",value="0x0"@},
+@{number="53",value="0x0"@},@{number="54",value="0x0"@},
+@{number="55",value="0x0"@},@{number="56",value="0x0"@},
+@{number="57",value="0x0"@},@{number="58",value="0x0"@},
+@{number="59",value="0x0"@},@{number="60",value="0x0"@},
+@{number="61",value="0x0"@},@{number="62",value="0x0"@},
+@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
+@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
+@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
+@{number="69",value="0x20002b03"@}]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-data-read-memory} Command
+@findex -data-read-memory
+
+@subsubheading Synopsis
+
+@example
+ -data-read-memory [ -o @var{byte-offset} ]
+ @var{address} @var{word-format} @var{word-size}
+ @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
+@end example
+
+@noindent
+where:
+
+@table @samp
+@item @var{address}
+An expression specifying the address of the first memory word to be
+read. Complex expressions containing embedded white space should be
+quoted using the C convention.
+
+@item @var{word-format}
+The format to be used to print the memory words. The notation is the
+same as for @value{GDBN}'s @code{print} command (@pxref{Output Formats,
+,Output formats}).
+
+@item @var{word-size}
+The size of each memory word in bytes.
+
+@item @var{nr-rows}
+The number of rows in the output table.
+
+@item @var{nr-cols}
+The number of columns in the output table.
+
+@item @var{aschar}
+If present, indicates that each row should include an @sc{ascii} dump. The
+value of @var{aschar} is used as a padding character when a byte is not a
+member of the printable @sc{ascii} character set (printable @sc{ascii}
+characters are those whose code is between 32 and 126, inclusively).
+
+@item @var{byte-offset}
+An offset to add to the @var{address} before fetching memory.
+@end table
+
+This command displays memory contents as a table of @var{nr-rows} by
+@var{nr-cols} words, each word being @var{word-size} bytes. In total,
+@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
+(returned as @samp{total-bytes}). Should less than the requested number
+of bytes be returned by the target, the missing words are identified
+using @samp{N/A}. The number of bytes read from the target is returned
+in @samp{nr-bytes} and the starting address used to read memory in
+@samp{addr}.
+
+The address of the next/previous row or page is available in
+@samp{next-row} and @samp{prev-row}, @samp{next-page} and
+@samp{prev-page}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has
+@samp{gdb_get_mem} memory read command.
+
+@subsubheading Example
+
+Read six bytes of memory starting at @code{bytes+6} but then offset by
+@code{-6} bytes. Format as three rows of two columns. One byte per
+word. Display each word in hex.
+
+@smallexample
+(@value{GDBP})
+9-data-read-memory -o -6 -- bytes+6 x 1 3 2
+9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
+next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
+prev-page="0x0000138a",memory=[
+@{addr="0x00001390",data=["0x00","0x01"]@},
+@{addr="0x00001392",data=["0x02","0x03"]@},
+@{addr="0x00001394",data=["0x04","0x05"]@}]
+(@value{GDBP})
+@end smallexample
+
+Read two bytes of memory starting at address @code{shorts + 64} and
+display as a single word formatted in decimal.
+
+@smallexample
+(@value{GDBP})
+5-data-read-memory shorts+64 d 2 1 1
+5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
+next-row="0x00001512",prev-row="0x0000150e",
+next-page="0x00001512",prev-page="0x0000150e",memory=[
+@{addr="0x00001510",data=["128"]@}]
+(@value{GDBP})
+@end smallexample
+
+Read thirty two bytes of memory starting at @code{bytes+16} and format
+as eight rows of four columns. Include a string encoding with @samp{x}
+used as the non-printable character.
+
+@smallexample
+(@value{GDBP})
+4-data-read-memory bytes+16 x 1 8 4 x
+4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
+next-row="0x000013c0",prev-row="0x0000139c",
+next-page="0x000013c0",prev-page="0x00001380",memory=[
+@{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"@},
+@{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"@},
+@{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"@},
+@{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"@},
+@{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"@},
+@{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"@},
+@{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"@},
+@{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"@}]
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-display-delete} Command
+@findex -display-delete
+
+@subsubheading Synopsis
+
+@example
+ -display-delete @var{number}
+@end example
+
+Delete the display @var{number}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{delete display}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-display-disable} Command
+@findex -display-disable
+
+@subsubheading Synopsis
+
+@example
+ -display-disable @var{number}
+@end example
+
+Disable display @var{number}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{disable display}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-display-enable} Command
+@findex -display-enable
+
+@subsubheading Synopsis
+
+@example
+ -display-enable @var{number}
+@end example
+
+Enable display @var{number}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{enable display}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-display-insert} Command
+@findex -display-insert
+
+@subsubheading Synopsis
+
+@example
+ -display-insert @var{expression}
+@end example
+
+Display @var{expression} every time the program stops.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{display}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-display-list} Command
+@findex -display-list
+
+@subsubheading Synopsis
+
+@example
+ -display-list
+@end example
+
+List the displays. Do not show the current values.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info display}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-environment-cd} Command
+@findex -environment-cd
+
+@subsubheading Synopsis
+
+@example
+ -environment-cd @var{pathdir}
+@end example
+
+Set @value{GDBN}'s working directory.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{cd}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-environment-directory} Command
+@findex -environment-directory
+
+@subsubheading Synopsis
+
+@example
+ -environment-directory @var{pathdir}
+@end example
+
+Add directory @var{pathdir} to beginning of search path for source files.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{dir}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-environment-path} Command
+@findex -environment-path
+
+@subsubheading Synopsis
+
+@example
+ -environment-path ( @var{pathdir} )+
+@end example
+
+Add directories @var{pathdir} to beginning of search path for object files.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{path}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-environment-pwd} Command
+@findex -environment-pwd
+
+@subsubheading Synopsis
+
+@example
+ -environment-pwd
+@end example
+
+Show the current working directory.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{pwd}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-environment-pwd
+~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
+^done
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Program Control
+@section @sc{gdb/mi} Program control
+
+@subsubheading Program termination
+
+As a result of execution, the inferior program can run to completion, if
+it doesn't encounter any breakpoints. In this case the output will
+include an exit code, if the program has exited exceptionally.
+
+@subsubheading Examples
+
+@noindent
+Program exited normally:
+
+@smallexample
+(@value{GDBP})
+-exec-run
+^running
+(@value{GDBP})
+x = 55
+*stopped,reason="exited-normally"
+(@value{GDBP})
+@end smallexample
+
+@noindent
+Program exited exceptionally:
+
+@smallexample
+(@value{GDBP})
+-exec-run
+^running
+(@value{GDBP})
+x = 55
+*stopped,reason="exited",exit-code="01"
+(@value{GDBP})
+@end smallexample
+
+Another way the program can terminate is if it receives a signal such as
+@code{SIGINT}. In this case, @sc{gdb/mi} displays this:
+
+@smallexample
+(@value{GDBP})
+*stopped,reason="exited-signalled",signal-name="SIGINT",
+signal-meaning="Interrupt"
+@end smallexample
+
+
+@subheading The @code{-exec-abort} Command
+@findex -exec-abort
+
+@subsubheading Synopsis
+
+@example
+ -exec-abort
+@end example
+
+Kill the inferior running program.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{kill}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-exec-arguments} Command
+@findex -exec-arguments
+
+@subsubheading Synopsis
+
+@example
+ -exec-arguments @var{args}
+@end example
+
+Set the inferior program arguments, to be used in the next
+@samp{-exec-run}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{set args}.
+
+@subsubheading Example
+
+@c FIXME!
+Don't have one around.
+
+
+@subheading The @code{-exec-continue} Command
+@findex -exec-continue
+
+@subsubheading Synopsis
+
+@example
+ -exec-continue
+@end example
+
+Asynchronous command. Resumes the execution of the inferior program
+until a breakpoint is encountered, or until the inferior exits.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} corresponding is @samp{continue}.
+
+@subsubheading Example
+
+@smallexample
+-exec-continue
+^running
+(@value{GDBP})
+@@Hello world
+*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
+file="hello.c",line="13"@}
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-finish} Command
+@findex -exec-finish
+
+@subsubheading Synopsis
+
+@example
+ -exec-finish
+@end example
+
+Asynchronous command. Resumes the execution of the inferior program
+until the current function is exited. Displays the results returned by
+the function.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{finish}.
+
+@subsubheading Example
+
+Function returning @code{void}.
+
+@smallexample
+-exec-finish
+^running
+(@value{GDBP})
+@@hello from foo
+*stopped,reason="function-finished",frame=@{func="main",args=[],
+file="hello.c",line="7"@}
+(@value{GDBP})
+@end smallexample
+
+Function returning other than @code{void}. The name of the internal
+@value{GDBN} variable storing the result is printed, together with the
+value itself.
+
+@smallexample
+-exec-finish
+^running
+(@value{GDBP})
+*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
+args=[@{name="a",value="1"],@{name="b",value="9"@}@},
+file="recursive2.c",line="14"@},
+gdb-result-var="$1",return-value="0"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-interrupt} Command
+@findex -exec-interrupt
+
+@subsubheading Synopsis
+
+@example
+ -exec-interrupt
+@end example
+
+Asynchronous command. Interrupts the background execution of the target.
+Note how the token associated with the stop message is the one for the
+execution command that has been interrupted. The token for the interrupt
+itself only appears in the @samp{^done} output. If the user is trying to
+interrupt a non-running program, an error message will be printed.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{interrupt}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+111-exec-continue
+111^running
+
+(@value{GDBP})
+222-exec-interrupt
+222^done
+(@value{GDBP})
+111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
+frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@}
+(@value{GDBP})
+
+(@value{GDBP})
+-exec-interrupt
+^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-next} Command
+@findex -exec-next
+
+@subsubheading Synopsis
+
+@example
+ -exec-next
+@end example
+
+Asynchronous command. Resumes execution of the inferior program, stopping
+when the beginning of the next source line is reached.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{next}.
+
+@subsubheading Example
+
+@smallexample
+-exec-next
+^running
+(@value{GDBP})
+*stopped,reason="end-stepping-range",line="8",file="hello.c"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-next-instruction} Command
+@findex -exec-next-instruction
+
+@subsubheading Synopsis
+
+@example
+ -exec-next-instruction
+@end example
+
+Asynchronous command. Executes one machine instruction. If the
+instruction is a function call continues until the function returns. If
+the program stops at an instruction in the middle of a source line, the
+address will be printed as well.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{nexti}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-exec-next-instruction
+^running
+
+(@value{GDBP})
+*stopped,reason="end-stepping-range",
+addr="0x000100d4",line="5",file="hello.c"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-return} Command
+@findex -exec-return
+
+@subsubheading Synopsis
+
+@example
+ -exec-return
+@end example
+
+Makes current function return immediately. Doesn't execute the inferior.
+Displays the new current frame.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{return}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+200-break-insert callee4
+200^done,bkpt=@{number="1",addr="0x00010734",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
+(@value{GDBP})
+000-exec-run
+000^running
+(@value{GDBP})
+000*stopped,reason="breakpoint-hit",bkptno="1",
+frame=@{func="callee4",args=[],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
+(@value{GDBP})
+205-break-delete
+205^done
+(@value{GDBP})
+111-exec-return
+111^done,frame=@{level="0 ",func="callee3",
+args=[@{name="strarg",
+value="0x11940 \"A string argument.\""@}],
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-run} Command
+@findex -exec-run
+
+@subsubheading Synopsis
+
+@example
+ -exec-run
+@end example
+
+Asynchronous command. Starts execution of the inferior from the
+beginning. The inferior executes until either a breakpoint is
+encountered or the program exits.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{run}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-break-insert main
+^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
+(@value{GDBP})
+-exec-run
+^running
+(@value{GDBP})
+*stopped,reason="breakpoint-hit",bkptno="1",
+frame=@{func="main",args=[],file="recursive2.c",line="4"@}
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-show-arguments} Command
+@findex -exec-show-arguments
+
+@subsubheading Synopsis
+
+@example
+ -exec-show-arguments
+@end example
+
+Print the arguments of the program.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{show args}.
+
+@subsubheading Example
+N.A.
+
+@c @subheading -exec-signal
+
+@subheading The @code{-exec-step} Command
+@findex -exec-step
+
+@subsubheading Synopsis
+
+@example
+ -exec-step
+@end example
+
+Asynchronous command. Resumes execution of the inferior program, stopping
+when the beginning of the next source line is reached, if the next
+source line is not a function call. If it is, stop at the first
+instruction of the called function.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{step}.
+
+@subsubheading Example
+
+Stepping into a function:
+
+@smallexample
+-exec-step
+^running
+(@value{GDBP})
+*stopped,reason="end-stepping-range",
+frame=@{func="foo",args=[@{name="a",value="10"@},
+@{name="b",value="0"@}],file="recursive2.c",line="11"@}
+(@value{GDBP})
+@end smallexample
+
+Regular stepping:
+
+@smallexample
+-exec-step
+^running
+(@value{GDBP})
+*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-step-instruction} Command
+@findex -exec-step-instruction
+
+@subsubheading Synopsis
+
+@example
+ -exec-step-instruction
+@end example
+
+Asynchronous command. Resumes the inferior which executes one machine
+instruction. The output, once @value{GDBN} has stopped, will vary depending on
+whether we have stopped in the middle of a source line or not. In the
+former case, the address at which the program stopped will be printed as
+well.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{stepi}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-exec-step-instruction
+^running
+
+(@value{GDBP})
+*stopped,reason="end-stepping-range",
+frame=@{func="foo",args=[],file="try.c",line="10"@}
+(@value{GDBP})
+-exec-step-instruction
+^running
+
+(@value{GDBP})
+*stopped,reason="end-stepping-range",
+frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@}
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-exec-until} Command
+@findex -exec-until
+
+@subsubheading Synopsis
+
+@example
+ -exec-until [ @var{location} ]
+@end example
+
+Asynchronous command. Executes the inferior until the @var{location}
+specified in the argument is reached. If there is no argument, the inferior
+executes until a source line greater than the current one is reached.
+The reason for stopping in this case will be @samp{location-reached}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{until}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-exec-until recursive2.c:6
+^running
+(@value{GDBP})
+x = 55
+*stopped,reason="location-reached",frame=@{func="main",args=[],
+file="recursive2.c",line="6"@}
+(@value{GDBP})
+@end smallexample
+
+@ignore
+@subheading -file-clear
+Is this going away????
+@end ignore
+
+
+@subheading The @code{-file-exec-and-symbols} Command
+@findex -file-exec-and-symbols
+
+@subsubheading Synopsis
+
+@example
+ -file-exec-and-symbols @var{file}
+@end example
+
+Specify the executable file to be debugged. This file is the one from
+which the symbol table is also read. If no file is specified, the
+command clears the executable and symbol information. If breakpoints
+are set when using this command with no arguments, @value{GDBN} will produce
+error messages. Otherwise, no output is produced, except a completion
+notification.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{file}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-file-exec-file} Command
+@findex -file-exec-file
+
+@subsubheading Synopsis
+
+@example
+ -file-exec-file @var{file}
+@end example
+
+Specify the executable file to be debugged. Unlike
+@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
+from this file. If used without argument, @value{GDBN} clears the information
+about the executable file. No output is produced, except a completion
+notification.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{exec-file}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-file-list-exec-sections} Command
+@findex -file-list-exec-sections
+
+@subsubheading Synopsis
+
+@example
+ -file-list-exec-sections
+@end example
+
+List the sections of the current executable file.
+
+@subsubheading @value{GDBN} Command
+
+The @value{GDBN} command @samp{info file} shows, among the rest, the same
+information as this command. @code{gdbtk} has a corresponding command
+@samp{gdb_load_info}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-file-list-exec-source-files} Command
+@findex -file-list-exec-source-files
+
+@subsubheading Synopsis
+
+@example
+ -file-list-exec-source-files
+@end example
+
+List the source files for the current executable.
+
+@subsubheading @value{GDBN} Command
+
+There's no @value{GDBN} command which directly corresponds to this one.
+@code{gdbtk} has an analogous command @samp{gdb_listfiles}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-file-list-shared-libraries} Command
+@findex -file-list-shared-libraries
+
+@subsubheading Synopsis
+
+@example
+ -file-list-shared-libraries
+@end example
+
+List the shared libraries in the program.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info shared}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-file-list-symbol-files} Command
+@findex -file-list-symbol-files
+
+@subsubheading Synopsis
+
+@example
+ -file-list-symbol-files
+@end example
+
+List symbol files.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info file} (part of it).
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-file-symbol-file} Command
+@findex -file-symbol-file
+
+@subsubheading Synopsis
+
+@example
+ -file-symbol-file @var{file}
+@end example
+
+Read symbol table info from the specified @var{file} argument. When
+used without arguments, clears @value{GDBN}'s symbol table info. No output is
+produced, except for a completion notification.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{symbol-file}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Miscellaneous Commands
+@section Miscellaneous @value{GDBN} commands in @sc{gdb/mi}
+
+@c @subheading -gdb-complete
+
+@subheading The @code{-gdb-exit} Command
+@findex -gdb-exit
+
+@subsubheading Synopsis
+
+@example
+ -gdb-exit
+@end example
+
+Exit @value{GDBN} immediately.
+
+@subsubheading @value{GDBN} Command
+
+Approximately corresponds to @samp{quit}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-gdb-exit
+@end smallexample
+
+@subheading The @code{-gdb-set} Command
+@findex -gdb-set
+
+@subsubheading Synopsis
+
+@example
+ -gdb-set
+@end example
+
+Set an internal @value{GDBN} variable.
+@c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ?????
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{set}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-gdb-set $foo=3
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-gdb-show} Command
+@findex -gdb-show
+
+@subsubheading Synopsis
+
+@example
+ -gdb-show
+@end example
+
+Show the current value of a @value{GDBN} variable.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{show}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-gdb-show annotate
+^done,value="0"
+(@value{GDBP})
+@end smallexample
+
+@c @subheading -gdb-source
+
+
+@subheading The @code{-gdb-version} Command
+@findex -gdb-version
+
+@subsubheading Synopsis
+
+@example
+ -gdb-version
+@end example
+
+Show version information for @value{GDBN}. Used mostly in testing.
+
+@subsubheading @value{GDBN} Command
+
+There's no equivalent @value{GDBN} command. @value{GDBN} by default shows this
+information when you start an interactive session.
+
+@subsubheading Example
+
+@c This example modifies the actual output from GDB to avoid overfull
+@c box in TeX.
+@smallexample
+(@value{GDBP})
+-gdb-version
+~GNU gdb 5.2.1
+~Copyright 2000 Free Software Foundation, Inc.
+~GDB is free software, covered by the GNU General Public License, and
+~you are welcome to change it and/or distribute copies of it under
+~ certain conditions.
+~Type "show copying" to see the conditions.
+~There is absolutely no warranty for GDB. Type "show warranty" for
+~ details.
+~This GDB was configured as
+ "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
+^done
+(@value{GDBP})
+@end smallexample
+
+@ignore
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Kod Commands
+@section @sc{gdb/mi} Kod Commands
+
+The Kod commands are not implemented.
+
+@c @subheading -kod-info
+
+@c @subheading -kod-list
+
+@c @subheading -kod-list-object-types
+
+@c @subheading -kod-show
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Memory Overlay Commands
+@section @sc{gdb/mi} Memory Overlay Commands
+
+The memory overlay commands are not implemented.
+
+@c @subheading -overlay-auto
+
+@c @subheading -overlay-list-mapping-state
+
+@c @subheading -overlay-list-overlays
+
+@c @subheading -overlay-map
+
+@c @subheading -overlay-off
+
+@c @subheading -overlay-on
+
+@c @subheading -overlay-unmap
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Signal Handling Commands
+@section @sc{gdb/mi} Signal Handling Commands
+
+Signal handling commands are not implemented.
+
+@c @subheading -signal-handle
+
+@c @subheading -signal-list-handle-actions
+
+@c @subheading -signal-list-signal-types
+@end ignore
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Stack Manipulation
+@section @sc{gdb/mi} Stack Manipulation Commands
+
+
+@subheading The @code{-stack-info-frame} Command
+@findex -stack-info-frame
+
+@subsubheading Synopsis
+
+@example
+ -stack-info-frame
+@end example
+
+Get info on the current frame.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame}
+(without arguments).
+
+@subsubheading Example
+N.A.
+
+@subheading The @code{-stack-info-depth} Command
+@findex -stack-info-depth
+
+@subsubheading Synopsis
+
+@example
+ -stack-info-depth [ @var{max-depth} ]
+@end example
+
+Return the depth of the stack. If the integer argument @var{max-depth}
+is specified, do not count beyond @var{max-depth} frames.
+
+@subsubheading @value{GDBN} Command
+
+There's no equivalent @value{GDBN} command.
+
+@subsubheading Example
+
+For a stack with frame levels 0 through 11:
+
+@smallexample
+(@value{GDBP})
+-stack-info-depth
+^done,depth="12"
+(@value{GDBP})
+-stack-info-depth 4
+^done,depth="4"
+(@value{GDBP})
+-stack-info-depth 12
+^done,depth="12"
+(@value{GDBP})
+-stack-info-depth 11
+^done,depth="11"
+(@value{GDBP})
+-stack-info-depth 13
+^done,depth="12"
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-stack-list-arguments} Command
+@findex -stack-list-arguments
+
+@subsubheading Synopsis
+
+@example
+ -stack-list-arguments @var{show-values}
+ [ @var{low-frame} @var{high-frame} ]
+@end example
+
+Display a list of the arguments for the frames between @var{low-frame}
+and @var{high-frame} (inclusive). If @var{low-frame} and
+@var{high-frame} are not provided, list the arguments for the whole call
+stack.
+
+The @var{show-values} argument must have a value of 0 or 1. A value of
+0 means that only the names of the arguments are listed, a value of 1
+means that both names and values of the arguments are printed.
+
+@subsubheading @value{GDBN} Command
+
+@value{GDBN} does not have an equivalent command. @code{gdbtk} has a
+@samp{gdb_get_args} command which partially overlaps with the
+functionality of @samp{-stack-list-arguments}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-stack-list-frames
+^done,
+stack=[
+frame=@{level="0 ",addr="0x00010734",func="callee4",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
+frame=@{level="1 ",addr="0x0001076c",func="callee3",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
+frame=@{level="2 ",addr="0x0001078c",func="callee2",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
+frame=@{level="3 ",addr="0x000107b4",func="callee1",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
+frame=@{level="4 ",addr="0x000107e0",func="main",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
+(@value{GDBP})
+-stack-list-arguments 0
+^done,
+stack-args=[
+frame=@{level="0",args=[]@},
+frame=@{level="1",args=[name="strarg"]@},
+frame=@{level="2",args=[name="intarg",name="strarg"]@},
+frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@},
+frame=@{level="4",args=[]@}]
+(@value{GDBP})
+-stack-list-arguments 1
+^done,
+stack-args=[
+frame=@{level="0",args=[]@},
+frame=@{level="1",
+ args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
+frame=@{level="2",args=[
+@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
+@{frame=@{level="3",args=[
+@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@},
+@{name="fltarg",value="3.5"@}]@},
+frame=@{level="4",args=[]@}]
+(@value{GDBP})
+-stack-list-arguments 0 2 2
+^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}]
+(@value{GDBP})
+-stack-list-arguments 1 2 2
+^done,stack-args=[frame=@{level="2",
+args=[@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@}]@}]
+(@value{GDBP})
+@end smallexample
+
+@c @subheading -stack-list-exception-handlers
+
+
+@subheading The @code{-stack-list-frames} Command
+@findex -stack-list-frames
+
+@subsubheading Synopsis
+
+@example
+ -stack-list-frames [ @var{low-frame} @var{high-frame} ]
+@end example
+
+List the frames currently on the stack. For each frame it displays the
+following info:
+
+@table @samp
+@item @var{level}
+The frame number, 0 being the topmost frame, i.e. the innermost function.
+@item @var{addr}
+The @code{$pc} value for that frame.
+@item @var{func}
+Function name.
+@item @var{file}
+File name of the source file where the function lives.
+@item @var{line}
+Line number corresponding to the @code{$pc}.
+@end table
+
+If invoked without arguments, this command prints a backtrace for the
+whole stack. If given two integer arguments, it shows the frames whose
+levels are between the two arguments (inclusive). If the two arguments
+are equal, it shows the single frame at the corresponding level.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{backtrace} and @samp{where}.
+
+@subsubheading Example
+
+Full stack backtrace:
+
+@smallexample
+(@value{GDBP})
+-stack-list-frames
+^done,stack=
+[frame=@{level="0 ",addr="0x0001076c",func="foo",
+ file="recursive2.c",line="11"@},
+frame=@{level="1 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="2 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="3 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="4 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="5 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="6 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="7 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="8 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="9 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="10",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="11",addr="0x00010738",func="main",
+ file="recursive2.c",line="4"@}]
+(@value{GDBP})
+@end smallexample
+
+Show frames between @var{low_frame} and @var{high_frame}:
+
+@smallexample
+(@value{GDBP})
+-stack-list-frames 3 5
+^done,stack=
+[frame=@{level="3 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="4 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@},
+frame=@{level="5 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@}]
+(@value{GDBP})
+@end smallexample
+
+Show a single frame:
+
+@smallexample
+(@value{GDBP})
+-stack-list-frames 3 3
+^done,stack=
+[frame=@{level="3 ",addr="0x000107a4",func="foo",
+ file="recursive2.c",line="14"@}]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-stack-list-locals} Command
+@findex -stack-list-locals
+
+@subsubheading Synopsis
+
+@example
+ -stack-list-locals @var{print-values}
+@end example
+
+Display the local variable names for the current frame. With an
+argument of 0 prints only the names of the variables, with argument of 1
+prints also their values.
+
+@subsubheading @value{GDBN} Command
+
+@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-stack-list-locals 0
+^done,locals=[name="A",name="B",name="C"]
+(@value{GDBP})
+-stack-list-locals 1
+^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@},
+ @{name="C",value="3"@}]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-stack-select-frame} Command
+@findex -stack-select-frame
+
+@subsubheading Synopsis
+
+@example
+ -stack-select-frame @var{framenum}
+@end example
+
+Change the current frame. Select a different frame @var{framenum} on
+the stack.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{frame}, @samp{up},
+@samp{down}, @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-stack-select-frame 2
+^done
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Symbol Query
+@section @sc{gdb/mi} Symbol Query Commands
+
+
+@subheading The @code{-symbol-info-address} Command
+@findex -symbol-info-address
+
+@subsubheading Synopsis
+
+@example
+ -symbol-info-address @var{symbol}
+@end example
+
+Describe where @var{symbol} is stored.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info address}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-info-file} Command
+@findex -symbol-info-file
+
+@subsubheading Synopsis
+
+@example
+ -symbol-info-file
+@end example
+
+Show the file for the symbol.
+
+@subsubheading @value{GDBN} Command
+
+There's no equivalent @value{GDBN} command. @code{gdbtk} has
+@samp{gdb_find_file}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-info-function} Command
+@findex -symbol-info-function
+
+@subsubheading Synopsis
+
+@example
+ -symbol-info-function
+@end example
+
+Show which function the symbol lives in.
+
+@subsubheading @value{GDBN} Command
+
+@samp{gdb_get_function} in @code{gdbtk}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-info-line} Command
+@findex -symbol-info-line
+
+@subsubheading Synopsis
+
+@example
+ -symbol-info-line
+@end example
+
+Show the core addresses of the code for a source line.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} comamnd is @samp{info line}.
+@code{gdbtk} has the @samp{gdb_get_line} and @samp{gdb_get_file} commands.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-info-symbol} Command
+@findex -symbol-info-symbol
+
+@subsubheading Synopsis
+
+@example
+ -symbol-info-symbol @var{addr}
+@end example
+
+Describe what symbol is at location @var{addr}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{info symbol}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-list-functions} Command
+@findex -symbol-list-functions
+
+@subsubheading Synopsis
+
+@example
+ -symbol-list-functions
+@end example
+
+List the functions in the executable.
+
+@subsubheading @value{GDBN} Command
+
+@samp{info functions} in @value{GDBN}, @samp{gdb_listfunc} and
+@samp{gdb_search} in @code{gdbtk}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-list-types} Command
+@findex -symbol-list-types
+
+@subsubheading Synopsis
+
+@example
+ -symbol-list-types
+@end example
+
+List all the type names.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding commands are @samp{info types} in @value{GDBN},
+@samp{gdb_search} in @code{gdbtk}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-list-variables} Command
+@findex -symbol-list-variables
+
+@subsubheading Synopsis
+
+@example
+ -symbol-list-variables
+@end example
+
+List all the global and static variable names.
+
+@subsubheading @value{GDBN} Command
+
+@samp{info variables} in @value{GDBN}, @samp{gdb_search} in @code{gdbtk}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-locate} Command
+@findex -symbol-locate
+
+@subsubheading Synopsis
+
+@example
+ -symbol-locate
+@end example
+
+@subsubheading @value{GDBN} Command
+
+@samp{gdb_loc} in @code{gdbtk}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-symbol-type} Command
+@findex -symbol-type
+
+@subsubheading Synopsis
+
+@example
+ -symbol-type @var{variable}
+@end example
+
+Show type of @var{variable}.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{ptype}, @code{gdbtk} has
+@samp{gdb_obj_variable}.
+
+@subsubheading Example
+N.A.
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Target Manipulation
+@section @sc{gdb/mi} Target Manipulation Commands
+
+
+@subheading The @code{-target-attach} Command
+@findex -target-attach
+
+@subsubheading Synopsis
+
+@example
+ -target-attach @var{pid} | @var{file}
+@end example
+
+Attach to a process @var{pid} or a file @var{file} outside of @value{GDBN}.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{attach}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-compare-sections} Command
+@findex -target-compare-sections
+
+@subsubheading Synopsis
+
+@example
+ -target-compare-sections [ @var{section} ]
+@end example
+
+Compare data of section @var{section} on target to the exec file.
+Without the argument, all sections are compared.
+
+@subsubheading @value{GDBN} Command
+
+The @value{GDBN} equivalent is @samp{compare-sections}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-detach} Command
+@findex -target-detach
+
+@subsubheading Synopsis
+
+@example
+ -target-detach
+@end example
+
+Disconnect from the remote target. There's no output.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{detach}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-target-detach
+^done
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-target-download} Command
+@findex -target-download
+
+@subsubheading Synopsis
+
+@example
+ -target-download
+@end example
+
+Loads the executable onto the remote target.
+It prints out an update message every half second, which includes the fields:
+
+@table @samp
+@item section
+The name of the section.
+@item section-sent
+The size of what has been sent so far for that section.
+@item section-size
+The size of the section.
+@item total-sent
+The total size of what was sent so far (the current and the previous sections).
+@item total-size
+The size of the overall executable to download.
+@end table
+
+@noindent
+Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
+@sc{gdb/mi} Output Syntax}).
+
+In addition, it prints the name and size of the sections, as they are
+downloaded. These messages include the following fields:
+
+@table @samp
+@item section
+The name of the section.
+@item section-size
+The size of the section.
+@item total-size
+The size of the overall executable to download.
+@end table
+
+@noindent
+At the end, a summary is printed.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{load}.
+
+@subsubheading Example
+
+Note: each status message appears on a single line. Here the messages
+have been broken down so that they can fit onto a page.
+
+@smallexample
+(@value{GDBP})
+-target-download
++download,@{section=".text",section-size="6668",total-size="9880"@}
++download,@{section=".text",section-sent="512",section-size="6668",
+total-sent="512",total-size="9880"@}
++download,@{section=".text",section-sent="1024",section-size="6668",
+total-sent="1024",total-size="9880"@}
++download,@{section=".text",section-sent="1536",section-size="6668",
+total-sent="1536",total-size="9880"@}
++download,@{section=".text",section-sent="2048",section-size="6668",
+total-sent="2048",total-size="9880"@}
++download,@{section=".text",section-sent="2560",section-size="6668",
+total-sent="2560",total-size="9880"@}
++download,@{section=".text",section-sent="3072",section-size="6668",
+total-sent="3072",total-size="9880"@}
++download,@{section=".text",section-sent="3584",section-size="6668",
+total-sent="3584",total-size="9880"@}
++download,@{section=".text",section-sent="4096",section-size="6668",
+total-sent="4096",total-size="9880"@}
++download,@{section=".text",section-sent="4608",section-size="6668",
+total-sent="4608",total-size="9880"@}
++download,@{section=".text",section-sent="5120",section-size="6668",
+total-sent="5120",total-size="9880"@}
++download,@{section=".text",section-sent="5632",section-size="6668",
+total-sent="5632",total-size="9880"@}
++download,@{section=".text",section-sent="6144",section-size="6668",
+total-sent="6144",total-size="9880"@}
++download,@{section=".text",section-sent="6656",section-size="6668",
+total-sent="6656",total-size="9880"@}
++download,@{section=".init",section-size="28",total-size="9880"@}
++download,@{section=".fini",section-size="28",total-size="9880"@}
++download,@{section=".data",section-size="3156",total-size="9880"@}
++download,@{section=".data",section-sent="512",section-size="3156",
+total-sent="7236",total-size="9880"@}
++download,@{section=".data",section-sent="1024",section-size="3156",
+total-sent="7748",total-size="9880"@}
++download,@{section=".data",section-sent="1536",section-size="3156",
+total-sent="8260",total-size="9880"@}
++download,@{section=".data",section-sent="2048",section-size="3156",
+total-sent="8772",total-size="9880"@}
++download,@{section=".data",section-sent="2560",section-size="3156",
+total-sent="9284",total-size="9880"@}
++download,@{section=".data",section-sent="3072",section-size="3156",
+total-sent="9796",total-size="9880"@}
+^done,address="0x10004",load-size="9880",transfer-rate="6586",
+write-rate="429"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-target-exec-status} Command
+@findex -target-exec-status
+
+@subsubheading Synopsis
+
+@example
+ -target-exec-status
+@end example
+
+Provide information on the state of the target (whether it is running or
+not, for instance).
+
+@subsubheading @value{GDBN} Command
+
+There's no equivalent @value{GDBN} command.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-list-available-targets} Command
+@findex -target-list-available-targets
+
+@subsubheading Synopsis
+
+@example
+ -target-list-available-targets
+@end example
+
+List the possible targets to connect to.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{help target}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-list-current-targets} Command
+@findex -target-list-current-targets
+
+@subsubheading Synopsis
+
+@example
+ -target-list-current-targets
+@end example
+
+Describe the current target.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding information is printed by @samp{info file} (among
+other things).
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-list-parameters} Command
+@findex -target-list-parameters
+
+@subsubheading Synopsis
+
+@example
+ -target-list-parameters
+@end example
+
+@c ????
+
+@subsubheading @value{GDBN} Command
+
+No equivalent.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-select} Command
+@findex -target-select
+
+@subsubheading Synopsis
+
+@example
+ -target-select @var{type} @var{parameters @dots{}}
+@end example
+
+Connect @value{GDBN} to the remote target. This command takes two args:
+
+@table @samp
+@item @var{type}
+The type of target, for instance @samp{async}, @samp{remote}, etc.
+@item @var{parameters}
+Device names, host names and the like. @xref{Target Commands, ,
+Commands for managing targets}, for more details.
+@end table
+
+The output is a connection notification, followed by the address at
+which the target program is, in the following form:
+
+@smallexample
+^connected,addr="@var{address}",func="@var{function name}",
+ args=[@var{arg list}]
+@end smallexample
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{target}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-target-select async /dev/ttya
+^connected,addr="0xfe00a300",func="??",args=[]
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Thread Commands
+@section @sc{gdb/mi} Thread Commands
+
+
+@subheading The @code{-thread-info} Command
+@findex -thread-info
+
+@subsubheading Synopsis
+
+@example
+ -thread-info
+@end example
+
+@subsubheading @value{GDBN} command
+
+No equivalent.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-thread-list-all-threads} Command
+@findex -thread-list-all-threads
+
+@subsubheading Synopsis
+
+@example
+ -thread-list-all-threads
+@end example
+
+@subsubheading @value{GDBN} Command
+
+The equivalent @value{GDBN} command is @samp{info threads}.
+
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-thread-list-ids} Command
+@findex -thread-list-ids
+
+@subsubheading Synopsis
+
+@example
+ -thread-list-ids
+@end example
+
+Produces a list of the currently known @value{GDBN} thread ids. At the
+end of the list it also prints the total number of such threads.
+
+@subsubheading @value{GDBN} Command
+
+Part of @samp{info threads} supplies the same information.
+
+@subsubheading Example
+
+No threads present, besides the main process:
+
+@smallexample
+(@value{GDBP})
+-thread-list-ids
+^done,thread-ids=@{@},number-of-threads="0"
+(@value{GDBP})
+@end smallexample
+
+
+Several threads:
+
+@smallexample
+(@value{GDBP})
+-thread-list-ids
+^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
+number-of-threads="3"
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-thread-select} Command
+@findex -thread-select
+
+@subsubheading Synopsis
+
+@example
+ -thread-select @var{threadnum}
+@end example
+
+Make @var{threadnum} the current thread. It prints the number of the new
+current thread, and the topmost frame for that thread.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{thread}.
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-exec-next
+^running
+(@value{GDBP})
+*stopped,reason="end-stepping-range",thread-id="2",line="187",
+file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
+(@value{GDBP})
+-thread-list-ids
+^done,
+thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
+number-of-threads="3"
+(@value{GDBP})
+-thread-select 3
+^done,new-thread-id="3",
+frame=@{level="0 ",func="vprintf",
+args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
+@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@}
+(@value{GDBP})
+@end smallexample
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Tracepoint Commands
+@section @sc{gdb/mi} Tracepoint Commands
+
+The tracepoint commands are not yet implemented.
+
+@c @subheading -trace-actions
+
+@c @subheading -trace-delete
+
+@c @subheading -trace-disable
+
+@c @subheading -trace-dump
+
+@c @subheading -trace-enable
+
+@c @subheading -trace-exists
+
+@c @subheading -trace-find
+
+@c @subheading -trace-frame-number
+
+@c @subheading -trace-info
+
+@c @subheading -trace-insert
+
+@c @subheading -trace-list
+
+@c @subheading -trace-pass-count
+
+@c @subheading -trace-save
+
+@c @subheading -trace-start
+
+@c @subheading -trace-stop
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Variable Objects
+@section @sc{gdb/mi} Variable Objects
+
+
+@subheading Motivation for Variable Objects in @sc{gdb/mi}
+
+For the implementation of a variable debugger window (locals, watched
+expressions, etc.), we are proposing the adaptation of the existing code
+used by @code{Insight}.
+
+The two main reasons for that are:
+
+@enumerate 1
+@item
+It has been proven in practice (it is already on its second generation).
+
+@item
+It will shorten development time (needless to say how important it is
+now).
+@end enumerate
+
+The original interface was designed to be used by Tcl code, so it was
+slightly changed so it could be used through @sc{gdb/mi}. This section
+describes the @sc{gdb/mi} operations that will be available and gives some
+hints about their use.
+
+@emph{Note}: In addition to the set of operations described here, we
+expect the @sc{gui} implementation of a variable window to require, at
+least, the following operations:
+
+@itemize @bullet
+@item @code{-gdb-show} @code{output-radix}
+@item @code{-stack-list-arguments}
+@item @code{-stack-list-locals}
+@item @code{-stack-select-frame}
+@end itemize
+
+@subheading Introduction to Variable Objects in @sc{gdb/mi}
+
+@cindex variable objects in @sc{gdb/mi}
+The basic idea behind variable objects is the creation of a named object
+to represent a variable, an expression, a memory location or even a CPU
+register. For each object created, a set of operations is available for
+examining or changing its properties.
+
+Furthermore, complex data types, such as C structures, are represented
+in a tree format. For instance, the @code{struct} type variable is the
+root and the children will represent the struct members. If a child
+is itself of a complex type, it will also have children of its own.
+Appropriate language differences are handled for C, C@t{++} and Java.
+
+When returning the actual values of the objects, this facility allows
+for the individual selection of the display format used in the result
+creation. It can be chosen among: binary, decimal, hexadecimal, octal
+and natural. Natural refers to a default format automatically
+chosen based on the variable type (like decimal for an @code{int}, hex
+for pointers, etc.).
+
+The following is the complete set of @sc{gdb/mi} operations defined to
+access this functionality:
+
+@multitable @columnfractions .4 .6
+@item @strong{Operation}
+@tab @strong{Description}
+
+@item @code{-var-create}
+@tab create a variable object
+@item @code{-var-delete}
+@tab delete the variable object and its children
+@item @code{-var-set-format}
+@tab set the display format of this variable
+@item @code{-var-show-format}
+@tab show the display format of this variable
+@item @code{-var-info-num-children}
+@tab tells how many children this object has
+@item @code{-var-list-children}
+@tab return a list of the object's children
+@item @code{-var-info-type}
+@tab show the type of this variable object
+@item @code{-var-info-expression}
+@tab print what this variable object represents
+@item @code{-var-show-attributes}
+@tab is this variable editable? does it exist here?
+@item @code{-var-evaluate-expression}
+@tab get the value of this variable
+@item @code{-var-assign}
+@tab set the value of this variable
+@item @code{-var-update}
+@tab update the variable and its children
+@end multitable
+
+In the next subsection we describe each operation in detail and suggest
+how it can be used.
+
+@subheading Description And Use of Operations on Variable Objects
+
+@subheading The @code{-var-create} Command
+@findex -var-create
+
+@subsubheading Synopsis
+
+@example
+ -var-create @{@var{name} | "-"@}
+ @{@var{frame-addr} | "*"@} @var{expression}
+@end example
+
+This operation creates a variable object, which allows the monitoring of
+a variable, the result of an expression, a memory cell or a CPU
+register.
+
+The @var{name} parameter is the string by which the object can be
+referenced. It must be unique. If @samp{-} is specified, the varobj
+system will generate a string ``varNNNNNN'' automatically. It will be
+unique provided that one does not specify @var{name} on that format.
+The command fails if a duplicate name is found.
+
+The frame under which the expression should be evaluated can be
+specified by @var{frame-addr}. A @samp{*} indicates that the current
+frame should be used.
+
+@var{expression} is any expression valid on the current language set (must not
+begin with a @samp{*}), or one of the following:
+
+@itemize @bullet
+@item
+@samp{*@var{addr}}, where @var{addr} is the address of a memory cell
+
+@item
+@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD)
+
+@item
+@samp{$@var{regname}} --- a CPU register name
+@end itemize
+
+@subsubheading Result
+
+This operation returns the name, number of children and the type of the
+object created. Type is returned as a string as the ones generated by
+the @value{GDBN} CLI:
+
+@example
+ name="@var{name}",numchild="N",type="@var{type}"
+@end example
+
+
+@subheading The @code{-var-delete} Command
+@findex -var-delete
+
+@subsubheading Synopsis
+
+@example
+ -var-delete @var{name}
+@end example
+
+Deletes a previously created variable object and all of its children.
+
+Returns an error if the object @var{name} is not found.
+
+
+@subheading The @code{-var-set-format} Command
+@findex -var-set-format
+
+@subsubheading Synopsis
+
+@example
+ -var-set-format @var{name} @var{format-spec}
+@end example
+
+Sets the output format for the value of the object @var{name} to be
+@var{format-spec}.
+
+The syntax for the @var{format-spec} is as follows:
+
+@example
+ @var{format-spec} @expansion{}
+ @{binary | decimal | hexadecimal | octal | natural@}
+@end example
+
+
+@subheading The @code{-var-show-format} Command
+@findex -var-show-format
+
+@subsubheading Synopsis
+
+@example
+ -var-show-format @var{name}
+@end example
+
+Returns the format used to display the value of the object @var{name}.
+
+@example
+ @var{format} @expansion{}
+ @var{format-spec}
+@end example
+
+
+@subheading The @code{-var-info-num-children} Command
+@findex -var-info-num-children
+
+@subsubheading Synopsis
+
+@example
+ -var-info-num-children @var{name}
+@end example
+
+Returns the number of children of a variable object @var{name}:
+
+@example
+ numchild=@var{n}
+@end example
+
+
+@subheading The @code{-var-list-children} Command
+@findex -var-list-children
+
+@subsubheading Synopsis
+
+@example
+ -var-list-children @var{name}
+@end example
+
+Returns a list of the children of the specified variable object:
+
+@example
+ numchild=@var{n},children=@{@{name=@var{name},
+ numchild=@var{n},type=@var{type}@},@r{(repeats N times)}@}
+@end example
+
+
+@subheading The @code{-var-info-type} Command
+@findex -var-info-type
+
+@subsubheading Synopsis
+
+@example
+ -var-info-type @var{name}
+@end example
+
+Returns the type of the specified variable @var{name}. The type is
+returned as a string in the same format as it is output by the
+@value{GDBN} CLI:
+
+@example
+ type=@var{typename}
+@end example
+
+
+@subheading The @code{-var-info-expression} Command
+@findex -var-info-expression
+
+@subsubheading Synopsis
+
+@example
+ -var-info-expression @var{name}
+@end example
+
+Returns what is represented by the variable object @var{name}:
+
+@example
+ lang=@var{lang-spec},exp=@var{expression}
+@end example
+
+@noindent
+where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
+
+@subheading The @code{-var-show-attributes} Command
+@findex -var-show-attributes
+
+@subsubheading Synopsis
+
+@example
+ -var-show-attributes @var{name}
+@end example
+
+List attributes of the specified variable object @var{name}:
+
+@example
+ status=@var{attr} [ ( ,@var{attr} )* ]
+@end example
+
+@noindent
+where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
+
+@subheading The @code{-var-evaluate-expression} Command
+@findex -var-evaluate-expression
+
+@subsubheading Synopsis
+
+@example
+ -var-evaluate-expression @var{name}
+@end example
+
+Evaluates the expression that is represented by the specified variable
+object and returns its value as a string in the current format specified
+for the object:
+
+@example
+ value=@var{value}
+@end example
+
+@subheading The @code{-var-assign} Command
+@findex -var-assign
+
+@subsubheading Synopsis
+
+@example
+ -var-assign @var{name} @var{expression}
+@end example
+
+Assigns the value of @var{expression} to the variable object specified
+by @var{name}. The object must be @samp{editable}.
+
+@subheading The @code{-var-update} Command
+@findex -var-update
+
+@subsubheading Synopsis
+
+@example
+ -var-update @{@var{name} | "*"@}
+@end example
+
+Update the value of the variable object @var{name} by evaluating its
+expression after fetching all the new values from memory or registers.
+A @samp{*} causes all existing variable objects to be updated.
diff --git a/contrib/gdb/gdb/mi/mi-cmd-break.c b/contrib/gdb/gdb/mi/mi-cmd-break.c
new file mode 100644
index 0000000..5061392
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmd-break.c
@@ -0,0 +1,245 @@
+/* MI Command Set - breakpoint and watchpoint commands.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "mi-cmds.h"
+#include "ui-out.h"
+#include "mi-out.h"
+#include "breakpoint.h"
+#include "gdb_string.h"
+#include "mi-getopt.h"
+#include "gdb-events.h"
+#include "gdb.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+enum
+ {
+ FROM_TTY = 0
+ };
+
+/* Output a single breakpoint. */
+
+static void
+breakpoint_notify (int b)
+{
+ gdb_breakpoint_query (uiout, b);
+}
+
+
+struct gdb_events breakpoint_hooks =
+{
+ breakpoint_notify,
+ breakpoint_notify,
+ breakpoint_notify,
+};
+
+
+enum bp_type
+ {
+ REG_BP,
+ HW_BP,
+ REGEXP_BP
+ };
+
+/* Insert a breakpoint. The type of breakpoint is specified by the
+ first argument: -break-insert <location> --> insert a regular
+ breakpoint. -break-insert -t <location> --> insert a temporary
+ breakpoint. -break-insert -h <location> --> insert an hardware
+ breakpoint. -break-insert -t -h <location> --> insert a temporary
+ hw bp.
+ -break-insert -r <regexp> --> insert a bp at functions matching
+ <regexp> */
+
+enum mi_cmd_result
+mi_cmd_break_insert (char *command, char **argv, int argc)
+{
+ char *address = NULL;
+ enum bp_type type = REG_BP;
+ int temp_p = 0;
+ int thread = -1;
+ int ignore_count = 0;
+ char *condition = NULL;
+ enum gdb_rc rc;
+ struct gdb_events *old_hooks;
+ enum opt
+ {
+ HARDWARE_OPT, TEMP_OPT /*, REGEXP_OPT */ , CONDITION_OPT,
+ IGNORE_COUNT_OPT, THREAD_OPT
+ };
+ static struct mi_opt opts[] =
+ {
+ {"h", HARDWARE_OPT, 0},
+ {"t", TEMP_OPT, 0},
+ {"c", CONDITION_OPT, 1},
+ {"i", IGNORE_COUNT_OPT, 1},
+ {"p", THREAD_OPT, 1},
+ 0
+ };
+
+ /* Parse arguments. It could be -r or -h or -t, <location> or ``--''
+ to denote the end of the option list. */
+ int optind = 0;
+ char *optarg;
+ while (1)
+ {
+ int opt = mi_getopt ("mi_cmd_break_insert", argc, argv, opts, &optind, &optarg);
+ if (opt < 0)
+ break;
+ switch ((enum opt) opt)
+ {
+ case TEMP_OPT:
+ temp_p = 1;
+ break;
+ case HARDWARE_OPT:
+ type = HW_BP;
+ break;
+#if 0
+ case REGEXP_OPT:
+ type = REGEXP_BP;
+ break;
+#endif
+ case CONDITION_OPT:
+ condition = optarg;
+ break;
+ case IGNORE_COUNT_OPT:
+ ignore_count = atol (optarg);
+ break;
+ case THREAD_OPT:
+ thread = atol (optarg);
+ break;
+ }
+ }
+
+ if (optind >= argc)
+ error ("mi_cmd_break_insert: Missing <location>");
+ if (optind < argc - 1)
+ error ("mi_cmd_break_insert: Garbage following <location>");
+ address = argv[optind];
+
+ /* Now we have what we need, let's insert the breakpoint! */
+ old_hooks = set_gdb_event_hooks (&breakpoint_hooks);
+ switch (type)
+ {
+ case REG_BP:
+ rc = gdb_breakpoint (address, condition,
+ 0 /*hardwareflag */ , temp_p,
+ thread, ignore_count);
+ break;
+ case HW_BP:
+ rc = gdb_breakpoint (address, condition,
+ 1 /*hardwareflag */ , temp_p,
+ thread, ignore_count);
+ break;
+#if 0
+ case REGEXP_BP:
+ if (temp_p)
+ error ("mi_cmd_break_insert: Unsupported tempoary regexp breakpoint");
+ else
+ rbreak_command_wrapper (address, FROM_TTY);
+ return MI_CMD_DONE;
+ break;
+#endif
+ default:
+ internal_error (__FILE__, __LINE__,
+ "mi_cmd_break_insert: Bad switch.");
+ }
+ set_gdb_event_hooks (old_hooks);
+
+ if (rc == GDB_RC_FAIL)
+ return MI_CMD_CAUGHT_ERROR;
+ else
+ return MI_CMD_DONE;
+}
+
+enum wp_type
+{
+ REG_WP,
+ READ_WP,
+ ACCESS_WP
+};
+
+/* Insert a watchpoint. The type of watchpoint is specified by the
+ first argument:
+ -break-watch <expr> --> insert a regular wp.
+ -break-watch -r <expr> --> insert a read watchpoint.
+ -break-watch -a <expr> --> insert an access wp. */
+
+enum mi_cmd_result
+mi_cmd_break_watch (char *command, char **argv, int argc)
+{
+ char *expr = NULL;
+ enum wp_type type = REG_WP;
+ enum opt
+ {
+ READ_OPT, ACCESS_OPT
+ };
+ static struct mi_opt opts[] =
+ {
+ {"r", READ_OPT, 0},
+ {"a", ACCESS_OPT, 0},
+ 0
+ };
+
+ /* Parse arguments. */
+ int optind = 0;
+ char *optarg;
+ while (1)
+ {
+ int opt = mi_getopt ("mi_cmd_break_watch", argc, argv, opts, &optind, &optarg);
+ if (opt < 0)
+ break;
+ switch ((enum opt) opt)
+ {
+ case READ_OPT:
+ type = READ_WP;
+ break;
+ case ACCESS_OPT:
+ type = ACCESS_WP;
+ break;
+ }
+ }
+ if (optind >= argc)
+ error ("mi_cmd_break_watch: Missing <expression>");
+ if (optind < argc - 1)
+ error ("mi_cmd_break_watch: Garbage following <expression>");
+ expr = argv[optind];
+
+ /* Now we have what we need, let's insert the watchpoint! */
+ switch (type)
+ {
+ case REG_WP:
+ watch_command_wrapper (expr, FROM_TTY);
+ break;
+ case READ_WP:
+ rwatch_command_wrapper (expr, FROM_TTY);
+ break;
+ case ACCESS_WP:
+ awatch_command_wrapper (expr, FROM_TTY);
+ break;
+ default:
+ error ("mi_cmd_break_watch: Unknown watchpoint type.");
+ }
+ return MI_CMD_DONE;
+}
diff --git a/contrib/gdb/gdb/mi/mi-cmd-disas.c b/contrib/gdb/gdb/mi/mi-cmd-disas.c
new file mode 100644
index 0000000..7596c06
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmd-disas.c
@@ -0,0 +1,499 @@
+/* MI Command Set - disassemble commands.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "target.h"
+#include "value.h"
+#include "mi-cmds.h"
+#include "mi-getopt.h"
+#include "ui-out.h"
+
+static int gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr, unsigned int len,
+ disassemble_info * info);
+static int compare_lines (const PTR mle1p, const PTR mle2p);
+
+/* Disassemble functions. FIXME: these do not really belong here. We
+ should get rid of all the duplicate code in gdb that does the same
+ thing: disassemble_command() and the gdbtk variation. */
+
+/* This Structure is used in mi_cmd_disassemble.
+ We need a different sort of line table from the normal one cuz we can't
+ depend upon implicit line-end pc's for lines to do the
+ reordering in this function. */
+
+struct dis_line_entry
+ {
+ int line;
+ CORE_ADDR start_pc;
+ CORE_ADDR end_pc;
+ };
+
+/* This variable determines where memory used for disassembly is read from. */
+int gdb_disassemble_from_exec = -1;
+
+/* This is the memory_read_func for gdb_disassemble when we are
+ disassembling from the exec file. */
+static int
+gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr,
+ unsigned int len, disassemble_info * info)
+{
+ extern struct target_ops exec_ops;
+ int res;
+
+ errno = 0;
+ res = xfer_memory (memaddr, myaddr, len, 0, 0, &exec_ops);
+
+ if (res == len)
+ return 0;
+ else if (errno == 0)
+ return EIO;
+ else
+ return errno;
+}
+
+static int
+compare_lines (const PTR mle1p, const PTR mle2p)
+{
+ struct dis_line_entry *mle1, *mle2;
+ int val;
+
+ mle1 = (struct dis_line_entry *) mle1p;
+ mle2 = (struct dis_line_entry *) mle2p;
+
+ val = mle1->line - mle2->line;
+
+ if (val != 0)
+ return val;
+
+ return mle1->start_pc - mle2->start_pc;
+}
+
+/* The arguments to be passed on the command line and parsed here are:
+
+ either:
+
+ START-ADDRESS: address to start the disassembly at.
+ END-ADDRESS: address to end the disassembly at.
+
+ or:
+
+ FILENAME: The name of the file where we want disassemble from.
+ LINE: The line around which we want to disassemble. It will
+ disassemble the function that contins that line.
+ HOW_MANY: Number of disassembly lines to display. In mixed mode, it
+ is the number of disassembly lines only, not counting the source
+ lines.
+
+ always required:
+
+ MODE: 0 or 1 for disassembly only, or mixed source and disassembly,
+ respectively. */
+
+enum mi_cmd_result
+mi_cmd_disassemble (char *command, char **argv, int argc)
+{
+ CORE_ADDR pc;
+ CORE_ADDR start;
+
+ int mixed_source_and_assembly;
+ int num_displayed;
+ static disassemble_info di;
+ static int di_initialized;
+
+ struct symtab *s;
+
+ /* To collect the instruction outputted from opcodes. */
+ static struct ui_stream *stb = NULL;
+
+ /* parts of the symbolic representation of the address */
+ int line;
+ int offset;
+ int unmapped;
+ char *filename = NULL;
+ char *name = NULL;
+
+ /* Which options have we processed ... */
+ int file_seen = 0;
+ int line_seen = 0;
+ int num_seen = 0;
+ int start_seen = 0;
+ int end_seen = 0;
+
+ /* ... and their corresponding value. */
+ char *file_string = NULL;
+ int line_num = -1;
+ int how_many = -1;
+ CORE_ADDR low = 0;
+ CORE_ADDR high = 0;
+
+ /* Options processing stuff. */
+ int optind = 0;
+ char *optarg;
+ enum opt
+ {
+ FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT
+ };
+ static struct mi_opt opts[] =
+ {
+ {"f", FILE_OPT, 1},
+ {"l", LINE_OPT, 1},
+ {"n", NUM_OPT, 1},
+ {"s", START_OPT, 1},
+ {"e", END_OPT, 1},
+ 0
+ };
+
+ /* Get the options with their arguments. Keep track of what we
+ encountered. */
+ while (1)
+ {
+ int opt = mi_getopt ("mi_cmd_disassemble", argc, argv, opts,
+ &optind, &optarg);
+ if (opt < 0)
+ break;
+ switch ((enum opt) opt)
+ {
+ case FILE_OPT:
+ file_string = xstrdup (optarg);
+ file_seen = 1;
+ break;
+ case LINE_OPT:
+ line_num = atoi (optarg);
+ line_seen = 1;
+ break;
+ case NUM_OPT:
+ how_many = atoi (optarg);
+ num_seen = 1;
+ break;
+ case START_OPT:
+ low = parse_and_eval_address (optarg);
+ start_seen = 1;
+ break;
+ case END_OPT:
+ high = parse_and_eval_address (optarg);
+ end_seen = 1;
+ break;
+ }
+ }
+ argv += optind;
+ argc -= optind;
+
+ /* Allow only filename + linenum (with how_many which is not
+ required) OR start_addr + and_addr */
+
+ if (!((line_seen && file_seen && num_seen && !start_seen && !end_seen)
+ || (line_seen && file_seen && !num_seen && !start_seen && !end_seen)
+ || (!line_seen && !file_seen && !num_seen && start_seen && end_seen)))
+ error ("mi_cmd_disassemble: Usage: ( [-f filename -l linenum [-n howmany]] | [-s startaddr -e endaddr]) [--] mixed_mode.");
+
+ if (argc != 1)
+ error ("mi_cmd_disassemble: Usage: [-f filename -l linenum [-n howmany]] [-s startaddr -e endaddr] [--] mixed_mode.");
+
+ mixed_source_and_assembly = atoi (argv[0]);
+ if ((mixed_source_and_assembly != 0) && (mixed_source_and_assembly != 1))
+ error ("mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.");
+
+ /* We must get the function beginning and end where line_num is
+ contained. */
+
+ if (line_seen && file_seen)
+ {
+ s = lookup_symtab (file_string);
+ if (s == NULL)
+ error ("mi_cmd_disassemble: Invalid filename.");
+ if (!find_line_pc (s, line_num, &start))
+ error ("mi_cmd_disassemble: Invalid line number");
+ if (find_pc_partial_function (start, NULL, &low, &high) == 0)
+ error ("mi_cmd_disassemble: No function contains specified address");
+ }
+
+ if (!di_initialized)
+ {
+ /* We don't add a cleanup for this, because the allocation of
+ the stream is done once only for each gdb run, and we need to
+ keep it around until the end. Hopefully there won't be any
+ errors in the init code below, that make this function bail
+ out. */
+ stb = ui_out_stream_new (uiout);
+ INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream,
+ (fprintf_ftype) fprintf_unfiltered);
+ di.flavour = bfd_target_unknown_flavour;
+ di.memory_error_func = dis_asm_memory_error;
+ di.print_address_func = dis_asm_print_address;
+ di_initialized = 1;
+ }
+
+ di.mach = TARGET_PRINT_INSN_INFO->mach;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ di.endian = BFD_ENDIAN_BIG;
+ else
+ di.endian = BFD_ENDIAN_LITTLE;
+
+ /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to
+ determine whether or not to do disassembly from target memory or from the
+ exec file:
+
+ If we're debugging a local process, read target memory, instead of the
+ exec file. This makes disassembly of functions in shared libs work
+ correctly. Also, read target memory if we are debugging native threads.
+
+ Else, we're debugging a remote process, and should disassemble from the
+ exec file for speed. However, this is no good if the target modifies its
+ code (for relocation, or whatever).
+ */
+
+ if (gdb_disassemble_from_exec == -1)
+ {
+ if (strcmp (target_shortname, "child") == 0
+ || strcmp (target_shortname, "procfs") == 0
+ || strcmp (target_shortname, "vxprocess") == 0
+ || strstr (target_shortname, "-threads") != NULL)
+ gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */
+ else
+ gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */
+ }
+
+ if (gdb_disassemble_from_exec)
+ di.read_memory_func = gdb_dis_asm_read_memory;
+ else
+ di.read_memory_func = dis_asm_read_memory;
+
+ /* If just doing straight assembly, all we need to do is disassemble
+ everything between low and high. If doing mixed source/assembly,
+ we've got a totally different path to follow. */
+
+ if (mixed_source_and_assembly)
+ {
+ /* Come here for mixed source/assembly */
+ /* The idea here is to present a source-O-centric view of a
+ function to the user. This means that things are presented
+ in source order, with (possibly) out of order assembly
+ immediately following. */
+ struct symtab *symtab;
+ struct linetable_entry *le;
+ int nlines;
+ int newlines;
+ struct dis_line_entry *mle;
+ struct symtab_and_line sal;
+ int i;
+ int out_of_order;
+ int next_line;
+
+ /* Assume symtab is valid for whole PC range */
+ symtab = find_pc_symtab (low);
+
+ if (!symtab || !symtab->linetable)
+ goto assembly_only;
+
+ /* First, convert the linetable to a bunch of my_line_entry's. */
+
+ le = symtab->linetable->item;
+ nlines = symtab->linetable->nitems;
+
+ if (nlines <= 0)
+ goto assembly_only;
+
+ mle = (struct dis_line_entry *) alloca (nlines * sizeof (struct dis_line_entry));
+
+ out_of_order = 0;
+
+ /* Copy linetable entries for this function into our data
+ structure, creating end_pc's and setting out_of_order as
+ appropriate. */
+
+ /* First, skip all the preceding functions. */
+
+ for (i = 0; i < nlines - 1 && le[i].pc < low; i++);
+
+ /* Now, copy all entries before the end of this function. */
+
+ newlines = 0;
+ for (; i < nlines - 1 && le[i].pc < high; i++)
+ {
+ if (le[i].line == le[i + 1].line
+ && le[i].pc == le[i + 1].pc)
+ continue; /* Ignore duplicates */
+
+ /* Skip any end-of-function markers. */
+ if (le[i].line == 0)
+ continue;
+
+ mle[newlines].line = le[i].line;
+ if (le[i].line > le[i + 1].line)
+ out_of_order = 1;
+ mle[newlines].start_pc = le[i].pc;
+ mle[newlines].end_pc = le[i + 1].pc;
+ newlines++;
+ }
+
+ /* If we're on the last line, and it's part of the function,
+ then we need to get the end pc in a special way. */
+
+ if (i == nlines - 1
+ && le[i].pc < high)
+ {
+ mle[newlines].line = le[i].line;
+ mle[newlines].start_pc = le[i].pc;
+ sal = find_pc_line (le[i].pc, 0);
+ mle[newlines].end_pc = sal.end;
+ newlines++;
+ }
+
+ /* Now, sort mle by line #s (and, then by addresses within
+ lines). */
+
+ if (out_of_order)
+ qsort (mle, newlines, sizeof (struct dis_line_entry), compare_lines);
+
+ /* Now, for each line entry, emit the specified lines (unless
+ they have been emitted before), followed by the assembly code
+ for that line. */
+
+ next_line = 0; /* Force out first line */
+ ui_out_list_begin (uiout, "asm_insns");
+ num_displayed = 0;
+ for (i = 0; i < newlines; i++)
+ {
+ int close_list = 1;
+ /* Print out everything from next_line to the current line. */
+ if (mle[i].line >= next_line)
+ {
+ if (next_line != 0)
+ {
+ /* Just one line to print. */
+ if (next_line == mle[i].line)
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, mle[i].line + 1, 0);
+ }
+ else
+ {
+ /* Several source lines w/o asm instructions associated. */
+ for (; next_line < mle[i].line; next_line++)
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, mle[i].line + 1, 0);
+ ui_out_list_begin (uiout, "line_asm_insn");
+ ui_out_list_end (uiout);
+ ui_out_tuple_end (uiout);
+ }
+ /* Print the last line and leave list open for
+ asm instructions to be added. */
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, mle[i].line + 1, 0);
+ }
+ }
+ else
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0);
+ }
+
+ next_line = mle[i].line + 1;
+ ui_out_list_begin (uiout, "line_asm_insn");
+ if (i + 1 < newlines && mle[i + 1].line <= mle[i].line)
+ close_list = 0;
+ }
+ for (pc = mle[i].start_pc; pc < mle[i].end_pc;)
+ {
+ QUIT;
+ if (how_many >= 0)
+ {
+ if (num_displayed >= how_many)
+ break;
+ else
+ num_displayed++;
+ }
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_core_addr (uiout, "address", pc);
+
+ if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped))
+ {
+ /* We don't care now about line, filename and
+ unmapped, but we might in the future. */
+ ui_out_field_string (uiout, "func-name", name);
+ ui_out_field_int (uiout, "offset", offset);
+ }
+ if (filename != NULL)
+ xfree (filename);
+ if (name != NULL)
+ xfree (name);
+
+ ui_file_rewind (stb->stream);
+ pc += (*tm_print_insn) (pc, &di);
+ ui_out_field_stream (uiout, "inst", stb);
+ ui_file_rewind (stb->stream);
+ ui_out_tuple_end (uiout);
+ }
+ if (close_list)
+ {
+ ui_out_list_end (uiout);
+ ui_out_tuple_end (uiout);
+ close_list = 0;
+ }
+ if (how_many >= 0)
+ if (num_displayed >= how_many)
+ break;
+ }
+ ui_out_list_end (uiout);
+ }
+ else
+ {
+ assembly_only:
+ ui_out_list_begin (uiout, "asm_insns");
+ num_displayed = 0;
+ for (pc = low; pc < high;)
+ {
+ QUIT;
+ if (how_many >= 0)
+ {
+ if (num_displayed >= how_many)
+ break;
+ else
+ num_displayed++;
+ }
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_core_addr (uiout, "address", pc);
+
+ if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped))
+ {
+ /* We don't care now about line, filename and
+ unmapped. But we might in the future. */
+ ui_out_field_string (uiout, "func-name", name);
+ ui_out_field_int (uiout, "offset", offset);
+ }
+ if (filename != NULL)
+ xfree (filename);
+ if (name != NULL)
+ xfree (name);
+
+ ui_file_rewind (stb->stream);
+ pc += (*tm_print_insn) (pc, &di);
+ ui_out_field_stream (uiout, "inst", stb);
+ ui_file_rewind (stb->stream);
+ ui_out_tuple_end (uiout);
+ }
+ ui_out_list_end (uiout);
+ }
+ gdb_flush (gdb_stdout);
+
+ return MI_CMD_DONE;
+}
diff --git a/contrib/gdb/gdb/mi/mi-cmd-stack.c b/contrib/gdb/gdb/mi/mi-cmd-stack.c
new file mode 100644
index 0000000..0e4bdf4
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmd-stack.c
@@ -0,0 +1,309 @@
+/* MI Command Set - stack commands.
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "target.h"
+#include "frame.h"
+#include "value.h"
+#include "mi-cmds.h"
+#include "ui-out.h"
+#include "symtab.h"
+
+/* FIXME: these should go in some .h file but stack.c doesn't have a
+ corresponding .h file. These wrappers will be obsolete anyway, once
+ we pull the plug on the sanitization. */
+extern void select_frame_command_wrapper (char *, int);
+
+static void list_args_or_locals (int locals, int values, struct frame_info *fi);
+
+/* Print a list of the stack frames. Args can be none, in which case
+ we want to print the whole backtrace, or a pair of numbers
+ specifying the frame numbers at which to start and stop the
+ display. If the two numbers are equal, a single frame will be
+ displayed. */
+enum mi_cmd_result
+mi_cmd_stack_list_frames (char *command, char **argv, int argc)
+{
+ int frame_low;
+ int frame_high;
+ int i;
+ struct frame_info *fi;
+
+ if (!target_has_stack)
+ error ("mi_cmd_stack_list_frames: No stack.");
+
+ if (argc > 2 || argc == 1)
+ error ("mi_cmd_stack_list_frames: Usage: [FRAME_LOW FRAME_HIGH]");
+
+ if (argc == 2)
+ {
+ frame_low = atoi (argv[0]);
+ frame_high = atoi (argv[1]);
+ }
+ else
+ {
+ /* Called with no arguments, it means we want the whole
+ backtrace. */
+ frame_low = -1;
+ frame_high = -1;
+ }
+
+ /* Let's position fi on the frame at which to start the
+ display. Could be the innermost frame if the whole stack needs
+ displaying, or if frame_low is 0. */
+ for (i = 0, fi = get_current_frame ();
+ fi && i < frame_low;
+ i++, fi = get_prev_frame (fi));
+
+ if (fi == NULL)
+ error ("mi_cmd_stack_list_frames: Not enough frames in stack.");
+
+ ui_out_list_begin (uiout, "stack");
+
+ /* Now let;s print the frames up to frame_high, or until there are
+ frames in the stack. */
+ for (;
+ fi && (i <= frame_high || frame_high == -1);
+ i++, fi = get_prev_frame (fi))
+ {
+ QUIT;
+ /* level == i: always print the level 'i'
+ source == LOC_AND_ADDRESS: print the location and the address
+ always, even for level 0.
+ args == 0: don't print the arguments. */
+ print_frame_info (fi /* frame info */ ,
+ i /* level */ ,
+ LOC_AND_ADDRESS /* source */ ,
+ 0 /* args */ );
+ }
+
+ ui_out_list_end (uiout);
+ if (i < frame_high)
+ error ("mi_cmd_stack_list_frames: Not enough frames in stack.");
+
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_stack_info_depth (char *command, char **argv, int argc)
+{
+ int frame_high;
+ int i;
+ struct frame_info *fi;
+
+ if (!target_has_stack)
+ error ("mi_cmd_stack_info_depth: No stack.");
+
+ if (argc > 1)
+ error ("mi_cmd_stack_info_depth: Usage: [MAX_DEPTH]");
+
+ if (argc == 1)
+ frame_high = atoi (argv[0]);
+ else
+ /* Called with no arguments, it means we want the real depth of
+ the stack. */
+ frame_high = -1;
+
+ for (i = 0, fi = get_current_frame ();
+ fi && (i < frame_high || frame_high == -1);
+ i++, fi = get_prev_frame (fi))
+ QUIT;
+
+ ui_out_field_int (uiout, "depth", i);
+
+ return MI_CMD_DONE;
+}
+
+/* Print a list of the locals for the current frame. With argument of
+ 0, print only the names, with argument of 1 print also the
+ values. */
+enum mi_cmd_result
+mi_cmd_stack_list_locals (char *command, char **argv, int argc)
+{
+ if (argc != 1)
+ error ("mi_cmd_stack_list_locals: Usage: PRINT_VALUES");
+
+ list_args_or_locals (1, atoi (argv[0]), selected_frame);
+ return MI_CMD_DONE;
+}
+
+/* Print a list of the arguments for the current frame. With argument
+ of 0, print only the names, with argument of 1 print also the
+ values. */
+enum mi_cmd_result
+mi_cmd_stack_list_args (char *command, char **argv, int argc)
+{
+ int frame_low;
+ int frame_high;
+ int i;
+ struct frame_info *fi;
+
+ if (argc < 1 || argc > 3 || argc == 2)
+ error ("mi_cmd_stack_list_args: Usage: PRINT_VALUES [FRAME_LOW FRAME_HIGH]");
+
+ if (argc == 3)
+ {
+ frame_low = atoi (argv[1]);
+ frame_high = atoi (argv[2]);
+ }
+ else
+ {
+ /* Called with no arguments, it means we want args for the whole
+ backtrace. */
+ frame_low = -1;
+ frame_high = -1;
+ }
+
+ /* Let's position fi on the frame at which to start the
+ display. Could be the innermost frame if the whole stack needs
+ displaying, or if frame_low is 0. */
+ for (i = 0, fi = get_current_frame ();
+ fi && i < frame_low;
+ i++, fi = get_prev_frame (fi));
+
+ if (fi == NULL)
+ error ("mi_cmd_stack_list_args: Not enough frames in stack.");
+
+ ui_out_list_begin (uiout, "stack-args");
+
+ /* Now let's print the frames up to frame_high, or until there are
+ frames in the stack. */
+ for (;
+ fi && (i <= frame_high || frame_high == -1);
+ i++, fi = get_prev_frame (fi))
+ {
+ QUIT;
+ ui_out_tuple_begin (uiout, "frame");
+ ui_out_field_int (uiout, "level", i);
+ list_args_or_locals (0, atoi (argv[0]), fi);
+ ui_out_tuple_end (uiout);
+ }
+
+ ui_out_list_end (uiout);
+ if (i < frame_high)
+ error ("mi_cmd_stack_list_args: Not enough frames in stack.");
+
+ return MI_CMD_DONE;
+}
+
+/* Print a list of the locals or the arguments for the currently
+ selected frame. If the argument passed is 0, printonly the names
+ of the variables, if an argument of 1 is passed, print the values
+ as well. */
+static void
+list_args_or_locals (int locals, int values, struct frame_info *fi)
+{
+ struct block *block;
+ struct symbol *sym;
+ int i, nsyms;
+ static struct ui_stream *stb = NULL;
+
+ stb = ui_out_stream_new (uiout);
+
+ block = get_frame_block (fi);
+
+ ui_out_list_begin (uiout, locals ? "locals" : "args");
+
+ while (block != 0)
+ {
+ ALL_BLOCK_SYMBOLS (block, i, sym)
+ {
+ int print_me = 0;
+
+ switch (SYMBOL_CLASS (sym))
+ {
+ default:
+ case LOC_UNDEF: /* catches errors */
+ case LOC_CONST: /* constant */
+ case LOC_TYPEDEF: /* local typedef */
+ case LOC_LABEL: /* local label */
+ case LOC_BLOCK: /* local function */
+ case LOC_CONST_BYTES: /* loc. byte seq. */
+ case LOC_UNRESOLVED: /* unresolved static */
+ case LOC_OPTIMIZED_OUT: /* optimized out */
+ print_me = 0;
+ break;
+
+ case LOC_ARG: /* argument */
+ case LOC_REF_ARG: /* reference arg */
+ case LOC_REGPARM: /* register arg */
+ case LOC_REGPARM_ADDR: /* indirect register arg */
+ case LOC_LOCAL_ARG: /* stack arg */
+ case LOC_BASEREG_ARG: /* basereg arg */
+ if (!locals)
+ print_me = 1;
+ break;
+
+ case LOC_LOCAL: /* stack local */
+ case LOC_BASEREG: /* basereg local */
+ case LOC_STATIC: /* static */
+ case LOC_REGISTER: /* register */
+ if (locals)
+ print_me = 1;
+ break;
+ }
+ if (print_me)
+ {
+ if (values)
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_string (uiout, "name", SYMBOL_NAME (sym));
+
+ if (values)
+ {
+ struct symbol *sym2;
+ if (!locals)
+ sym2 = lookup_symbol (SYMBOL_NAME (sym),
+ block, VAR_NAMESPACE,
+ (int *) NULL,
+ (struct symtab **) NULL);
+ else
+ sym2 = sym;
+ print_variable_value (sym2, fi, stb->stream);
+ ui_out_field_stream (uiout, "value", stb);
+ ui_out_tuple_end (uiout);
+ }
+ }
+ }
+ if (BLOCK_FUNCTION (block))
+ break;
+ else
+ block = BLOCK_SUPERBLOCK (block);
+ }
+ ui_out_list_end (uiout);
+ ui_out_stream_delete (stb);
+}
+
+enum mi_cmd_result
+mi_cmd_stack_select_frame (char *command, char **argv, int argc)
+{
+ if (!target_has_stack)
+ error ("mi_cmd_stack_select_frame: No stack.");
+
+ if (argc > 1)
+ error ("mi_cmd_stack_select_frame: Usage: [FRAME_SPEC]");
+
+ /* with no args, don't change frame */
+ if (argc == 0)
+ select_frame_command_wrapper (0, 1 /* not used */ );
+ else
+ select_frame_command_wrapper (argv[0], 1 /* not used */ );
+ return MI_CMD_DONE;
+}
diff --git a/contrib/gdb/gdb/mi/mi-cmd-var.c b/contrib/gdb/gdb/mi/mi-cmd-var.c
new file mode 100644
index 0000000..0c84064
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmd-var.c
@@ -0,0 +1,501 @@
+/* MI Command Set - varobj commands.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "mi-cmds.h"
+#include "ui-out.h"
+#include "mi-out.h"
+#include "varobj.h"
+#include "value.h"
+#include <ctype.h>
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+extern int varobjdebug; /* defined in varobj.c */
+
+static int varobj_update_one (struct varobj *var);
+
+/* VAROBJ operations */
+
+enum mi_cmd_result
+mi_cmd_var_create (char *command, char **argv, int argc)
+{
+ CORE_ADDR frameaddr = 0;
+ struct varobj *var;
+ char *name;
+ char *frame;
+ char *expr;
+ char *type;
+ struct cleanup *old_cleanups;
+ enum varobj_type var_type;
+
+ if (argc != 3)
+ {
+ /* xasprintf (&mi_error_message,
+ "mi_cmd_var_create: Usage: .");
+ return MI_CMD_ERROR; */
+ error ("mi_cmd_var_create: Usage: NAME FRAME EXPRESSION.");
+ }
+
+ name = xstrdup (argv[0]);
+ /* Add cleanup for name. Must be free_current_contents as
+ name can be reallocated */
+ old_cleanups = make_cleanup (free_current_contents, &name);
+
+ frame = xstrdup (argv[1]);
+ old_cleanups = make_cleanup (xfree, frame);
+
+ expr = xstrdup (argv[2]);
+
+ if (strcmp (name, "-") == 0)
+ {
+ xfree (name);
+ name = varobj_gen_name ();
+ }
+ else if (!isalpha (*name))
+ error ("mi_cmd_var_create: name of object must begin with a letter");
+
+ if (strcmp (frame, "*") == 0)
+ var_type = USE_CURRENT_FRAME;
+ else if (strcmp (frame, "@") == 0)
+ var_type = USE_SELECTED_FRAME;
+ else
+ {
+ var_type = USE_SPECIFIED_FRAME;
+ frameaddr = parse_and_eval_address (frame);
+ }
+
+ if (varobjdebug)
+ fprintf_unfiltered (gdb_stdlog,
+ "Name=\"%s\", Frame=\"%s\" (0x%s), Expression=\"%s\"\n",
+ name, frame, paddr (frameaddr), expr);
+
+ var = varobj_create (name, expr, frameaddr, var_type);
+
+ if (var == NULL)
+ error ("mi_cmd_var_create: unable to create variable object");
+
+ ui_out_field_string (uiout, "name", name);
+ ui_out_field_int (uiout, "numchild", varobj_get_num_children (var));
+ type = varobj_get_type (var);
+ if (type == NULL)
+ ui_out_field_string (uiout, "type", "");
+ else
+ {
+ ui_out_field_string (uiout, "type", type);
+ xfree (type);
+ }
+
+ do_cleanups (old_cleanups);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_delete (char *command, char **argv, int argc)
+{
+ char *name;
+ char *expr;
+ struct varobj *var;
+ int numdel;
+ int children_only_p = 0;
+ struct cleanup *old_cleanups;
+
+ if (argc < 1 || argc > 2)
+ error ("mi_cmd_var_delete: Usage: [-c] EXPRESSION.");
+
+ name = xstrdup (argv[0]);
+ /* Add cleanup for name. Must be free_current_contents as
+ name can be reallocated */
+ old_cleanups = make_cleanup (free_current_contents, &name);
+
+ /* If we have one single argument it cannot be '-c' or any string
+ starting with '-'. */
+ if (argc == 1)
+ {
+ if (strcmp (name, "-c") == 0)
+ error ("mi_cmd_var_delete: Missing required argument after '-c': variable object name");
+ if (*name == '-')
+ error ("mi_cmd_var_delete: Illegal variable object name");
+ }
+
+ /* If we have 2 arguments they must be '-c' followed by a string
+ which would be the variable name. */
+ if (argc == 2)
+ {
+ expr = xstrdup (argv[1]);
+ if (strcmp (name, "-c") != 0)
+ error ("mi_cmd_var_delete: Invalid option.");
+ children_only_p = 1;
+ xfree (name);
+ name = xstrdup (expr);
+ xfree (expr);
+ }
+
+ /* If we didn't error out, now NAME contains the name of the
+ variable. */
+
+ var = varobj_get_handle (name);
+
+ if (var == NULL)
+ error ("mi_cmd_var_delete: Variable object not found.");
+
+ numdel = varobj_delete (var, NULL, children_only_p);
+
+ ui_out_field_int (uiout, "ndeleted", numdel);
+
+ do_cleanups (old_cleanups);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_set_format (char *command, char **argv, int argc)
+{
+ enum varobj_display_formats format;
+ int len;
+ struct varobj *var;
+ char *formspec;
+
+ if (argc != 2)
+ error ("mi_cmd_var_set_format: Usage: NAME FORMAT.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+
+ if (var == NULL)
+ error ("mi_cmd_var_set_format: Variable object not found");
+
+ formspec = xstrdup (argv[1]);
+ if (formspec == NULL)
+ error ("mi_cmd_var_set_format: Must specify the format as: \"natural\", \"binary\", \"decimal\", \"hexadecimal\", or \"octal\"");
+
+ len = strlen (formspec);
+
+ if (STREQN (formspec, "natural", len))
+ format = FORMAT_NATURAL;
+ else if (STREQN (formspec, "binary", len))
+ format = FORMAT_BINARY;
+ else if (STREQN (formspec, "decimal", len))
+ format = FORMAT_DECIMAL;
+ else if (STREQN (formspec, "hexadecimal", len))
+ format = FORMAT_HEXADECIMAL;
+ else if (STREQN (formspec, "octal", len))
+ format = FORMAT_OCTAL;
+ else
+ error ("mi_cmd_var_set_format: Unknown display format: must be: \"natural\", \"binary\", \"decimal\", \"hexadecimal\", or \"octal\"");
+
+ /* Set the format of VAR to given format */
+ varobj_set_display_format (var, format);
+
+ /* Report the new current format */
+ ui_out_field_string (uiout, "format", varobj_format_string[(int) format]);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_show_format (char *command, char **argv, int argc)
+{
+ enum varobj_display_formats format;
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_show_format: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_show_format: Variable object not found");
+
+ format = varobj_get_display_format (var);
+
+ /* Report the current format */
+ ui_out_field_string (uiout, "format", varobj_format_string[(int) format]);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_info_num_children (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_info_num_children: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_info_num_children: Variable object not found");
+
+ ui_out_field_int (uiout, "numchild", varobj_get_num_children (var));
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_list_children (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+ struct varobj **childlist;
+ struct varobj **cc;
+ int numchild;
+ char *type;
+
+ if (argc != 1)
+ error ("mi_cmd_var_list_children: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_list_children: Variable object not found");
+
+ numchild = varobj_list_children (var, &childlist);
+ ui_out_field_int (uiout, "numchild", numchild);
+
+ if (numchild <= 0)
+ return MI_CMD_DONE;
+
+ ui_out_tuple_begin (uiout, "children");
+ cc = childlist;
+ while (*cc != NULL)
+ {
+ ui_out_tuple_begin (uiout, "child");
+ ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
+ ui_out_field_string (uiout, "exp", varobj_get_expression (*cc));
+ ui_out_field_int (uiout, "numchild", varobj_get_num_children (*cc));
+ type = varobj_get_type (*cc);
+ /* C++ pseudo-variables (public, private, protected) do not have a type */
+ if (type)
+ ui_out_field_string (uiout, "type", varobj_get_type (*cc));
+ ui_out_tuple_end (uiout);
+ cc++;
+ }
+ ui_out_tuple_end (uiout);
+ xfree (childlist);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_info_type (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_info_type: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_info_type: Variable object not found");
+
+ ui_out_field_string (uiout, "type", varobj_get_type (var));
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_info_expression (char *command, char **argv, int argc)
+{
+ enum varobj_languages lang;
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_info_expression: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_info_expression: Variable object not found");
+
+ lang = varobj_get_language (var);
+
+ ui_out_field_string (uiout, "lang", varobj_language_string[(int) lang]);
+ ui_out_field_string (uiout, "exp", varobj_get_expression (var));
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_show_attributes (char *command, char **argv, int argc)
+{
+ int attr;
+ char *attstr;
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_show_attributes: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_show_attributes: Variable object not found");
+
+ attr = varobj_get_attributes (var);
+ /* FIXME: define masks for attributes */
+ if (attr & 0x00000001)
+ attstr = "editable";
+ else
+ attstr = "noneditable";
+
+ ui_out_field_string (uiout, "attr", attstr);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_evaluate_expression (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+
+ if (argc != 1)
+ error ("mi_cmd_var_evaluate_expression: Usage: NAME.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_evaluate_expression: Variable object not found");
+
+ ui_out_field_string (uiout, "value", varobj_get_value (var));
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_assign (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+ char *expression;
+
+ if (argc != 2)
+ error ("mi_cmd_var_assign: Usage: NAME EXPRESSION.");
+
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (argv[0]);
+ if (var == NULL)
+ error ("mi_cmd_var_assign: Variable object not found");
+
+ /* FIXME: define masks for attributes */
+ if (!(varobj_get_attributes (var) & 0x00000001))
+ error ("mi_cmd_var_assign: Variable object is not editable");
+
+ expression = xstrdup (argv[1]);
+
+ if (!varobj_set_value (var, expression))
+ error ("mi_cmd_var_assign: Could not assign expression to varible object");
+
+ ui_out_field_string (uiout, "value", varobj_get_value (var));
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_var_update (char *command, char **argv, int argc)
+{
+ struct varobj *var;
+ struct varobj **rootlist;
+ struct varobj **cr;
+ char *name;
+ int nv;
+
+ if (argc != 1)
+ error ("mi_cmd_var_update: Usage: NAME.");
+
+ name = argv[0];
+
+ /* Check if the parameter is a "*" which means that we want
+ to update all variables */
+
+ if ((*name == '*') && (*(name + 1) == '\0'))
+ {
+ nv = varobj_list (&rootlist);
+ ui_out_tuple_begin (uiout, "changelist");
+ if (nv <= 0)
+ {
+ ui_out_tuple_end (uiout);
+ return MI_CMD_DONE;
+ }
+ cr = rootlist;
+ while (*cr != NULL)
+ {
+ varobj_update_one (*cr);
+ cr++;
+ }
+ xfree (rootlist);
+ ui_out_tuple_end (uiout);
+ }
+ else
+ {
+ /* Get varobj handle, if a valid var obj name was specified */
+ var = varobj_get_handle (name);
+ if (var == NULL)
+ error ("mi_cmd_var_update: Variable object not found");
+
+ ui_out_tuple_begin (uiout, "changelist");
+ varobj_update_one (var);
+ ui_out_tuple_end (uiout);
+ }
+ return MI_CMD_DONE;
+}
+
+/* Helper for mi_cmd_var_update() Returns 0 if the update for
+ the variable fails (usually because the variable is out of
+ scope), and 1 if it succeeds. */
+
+static int
+varobj_update_one (struct varobj *var)
+{
+ struct varobj **changelist;
+ struct varobj **cc;
+ int nc;
+
+ nc = varobj_update (&var, &changelist);
+
+ /* nc == 0 means that nothing has changed.
+ nc == -1 means that an error occured in updating the variable.
+ nc == -2 means the variable has changed type. */
+
+ if (nc == 0)
+ return 1;
+ else if (nc == -1)
+ {
+ ui_out_field_string (uiout, "name", varobj_get_objname(var));
+ ui_out_field_string (uiout, "in_scope", "false");
+ return -1;
+ }
+ else if (nc == -2)
+ {
+ ui_out_field_string (uiout, "name", varobj_get_objname (var));
+ ui_out_field_string (uiout, "in_scope", "true");
+ ui_out_field_string (uiout, "new_type", varobj_get_type(var));
+ ui_out_field_int (uiout, "new_num_children",
+ varobj_get_num_children(var));
+ }
+ else
+ {
+
+ cc = changelist;
+ while (*cc != NULL)
+ {
+ ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
+ ui_out_field_string (uiout, "in_scope", "true");
+ ui_out_field_string (uiout, "type_changed", "false");
+ cc++;
+ }
+ xfree (changelist);
+ return 1;
+ }
+ return 1;
+}
diff --git a/contrib/gdb/gdb/mi/mi-cmds.c b/contrib/gdb/gdb/mi/mi-cmds.c
new file mode 100644
index 0000000..233d06b
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmds.c
@@ -0,0 +1,261 @@
+/* MI Command Set.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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"
+#include "mi-cmds.h"
+#include "gdb_string.h"
+
+extern void _initialize_mi_cmds (void);
+struct mi_cmd;
+static struct mi_cmd **lookup_table (const char *command);
+static void build_table (struct mi_cmd *commands);
+
+
+struct mi_cmd mi_cmds[] =
+{
+ {"break-after", "ignore %s", 0},
+ {"break-catch", 0, 0},
+ {"break-commands", 0, 0},
+ {"break-condition", "cond %s", 0},
+ {"break-delete", "delete breakpoint %s", 0},
+ {"break-disable", "disable breakpoint %s", 0},
+ {"break-enable", "enable breakpoint %s", 0},
+ {"break-info", "info break %s", 0},
+ {"break-insert", 0, 0, mi_cmd_break_insert},
+ {"break-list", "info break", 0},
+ {"break-watch", 0, 0, mi_cmd_break_watch},
+ {"data-disassemble", 0, 0, mi_cmd_disassemble},
+ {"data-evaluate-expression", 0, 0, mi_cmd_data_evaluate_expression},
+ {"data-list-changed-registers", 0, 0, mi_cmd_data_list_changed_registers},
+ {"data-list-register-names", 0, 0, mi_cmd_data_list_register_names},
+ {"data-list-register-values", 0, 0, mi_cmd_data_list_register_values},
+ {"data-read-memory", 0, 0, mi_cmd_data_read_memory},
+ {"data-write-memory", 0, 0, mi_cmd_data_write_memory},
+ {"data-write-register-values", 0, 0, mi_cmd_data_write_register_values},
+ {"display-delete", 0, 0},
+ {"display-disable", 0, 0},
+ {"display-enable", 0, 0},
+ {"display-insert", 0, 0},
+ {"display-list", 0, 0},
+ {"environment-cd", "cd %s", 0},
+ {"environment-directory", "dir %s", 0},
+ {"environment-path", "path %s", 0},
+ {"environment-pwd", "pwd", 0},
+ {"exec-abort", 0, 0},
+ {"exec-arguments", "set args %s", 0},
+ {"exec-continue", 0, mi_cmd_exec_continue},
+ {"exec-finish", 0, mi_cmd_exec_finish},
+ {"exec-interrupt", 0, mi_cmd_exec_interrupt},
+ {"exec-next", 0, mi_cmd_exec_next},
+ {"exec-next-instruction", 0, mi_cmd_exec_next_instruction},
+ {"exec-return", 0, mi_cmd_exec_return},
+ {"exec-run", 0, mi_cmd_exec_run},
+ {"exec-show-arguments", 0, 0},
+ {"exec-signal", 0, 0},
+ {"exec-step", 0, mi_cmd_exec_step},
+ {"exec-step-instruction", 0, mi_cmd_exec_step_instruction},
+ {"exec-until", 0, mi_cmd_exec_until},
+ {"file-clear", 0, 0},
+ {"file-exec-and-symbols", "file %s", 0},
+ {"file-exec-file", "exec-file %s", 0},
+ {"file-list-exec-sections", 0, 0},
+ {"file-list-exec-source-files", 0, 0},
+ {"file-list-shared-libraries", 0, 0},
+ {"file-list-symbol-files", 0, 0},
+ {"file-symbol-file", "symbol-file %s", 0},
+ {"gdb-complete", 0, 0},
+ {"gdb-exit", 0, 0, mi_cmd_gdb_exit},
+ {"gdb-set", "set %s", 0},
+ {"gdb-show", "show %s", 0},
+ {"gdb-source", 0, 0},
+ {"gdb-version", "show version", 0},
+ {"kod-info", 0, 0},
+ {"kod-list", 0, 0},
+ {"kod-list-object-types", 0, 0},
+ {"kod-show", 0, 0},
+ {"overlay-auto", 0, 0},
+ {"overlay-list-mapping-state", 0, 0},
+ {"overlay-list-overlays", 0, 0},
+ {"overlay-map", 0, 0},
+ {"overlay-off", 0, 0},
+ {"overlay-on", 0, 0},
+ {"overlay-unmap", 0, 0},
+ {"signal-handle", 0, 0},
+ {"signal-list-handle-actions", 0, 0},
+ {"signal-list-signal-types", 0, 0},
+ {"stack-info-depth", 0, 0, mi_cmd_stack_info_depth},
+ {"stack-info-frame", 0, 0},
+ {"stack-list-arguments", 0, 0, mi_cmd_stack_list_args},
+ {"stack-list-exception-handlers", 0, 0},
+ {"stack-list-frames", 0, 0, mi_cmd_stack_list_frames},
+ {"stack-list-locals", 0, 0, mi_cmd_stack_list_locals},
+ {"stack-select-frame", 0, 0, mi_cmd_stack_select_frame},
+ {"symbol-info-address", 0, 0},
+ {"symbol-info-file", 0, 0},
+ {"symbol-info-function", 0, 0},
+ {"symbol-info-line", 0, 0},
+ {"symbol-info-symbol", 0, 0},
+ {"symbol-list-functions", 0, 0},
+ {"symbol-list-types", 0, 0},
+ {"symbol-list-variables", 0, 0},
+ {"symbol-locate", 0, 0},
+ {"symbol-type", 0, 0},
+ {"target-attach", 0, 0},
+ {"target-compare-sections", 0, 0},
+ {"target-detach", "detach", 0},
+ {"target-download", 0, mi_cmd_target_download},
+ {"target-exec-status", 0, 0},
+ {"target-list-available-targets", 0, 0},
+ {"target-list-current-targets", 0, 0},
+ {"target-list-parameters", 0, 0},
+ {"target-select", 0, mi_cmd_target_select},
+ {"thread-info", 0, 0},
+ {"thread-list-all-threads", 0, 0},
+ {"thread-list-ids", 0, 0, mi_cmd_thread_list_ids},
+ {"thread-select", 0, 0, mi_cmd_thread_select},
+ {"trace-actions", 0, 0},
+ {"trace-delete", 0, 0},
+ {"trace-disable", 0, 0},
+ {"trace-dump", 0, 0},
+ {"trace-enable", 0, 0},
+ {"trace-exists", 0, 0},
+ {"trace-find", 0, 0},
+ {"trace-frame-number", 0, 0},
+ {"trace-info", 0, 0},
+ {"trace-insert", 0, 0},
+ {"trace-list", 0, 0},
+ {"trace-pass-count", 0, 0},
+ {"trace-save", 0, 0},
+ {"trace-start", 0, 0},
+ {"trace-stop", 0, 0},
+ {"var-assign", 0, 0, mi_cmd_var_assign},
+ {"var-create", 0, 0, mi_cmd_var_create},
+ {"var-delete", 0, 0, mi_cmd_var_delete},
+ {"var-evaluate-expression", 0, 0, mi_cmd_var_evaluate_expression},
+ {"var-info-expression", 0, 0, mi_cmd_var_info_expression},
+ {"var-info-num-children", 0, 0, mi_cmd_var_info_num_children},
+ {"var-info-type", 0, 0, mi_cmd_var_info_type},
+ {"var-list-children", 0, 0, mi_cmd_var_list_children},
+ {"var-set-format", 0, 0, mi_cmd_var_set_format},
+ {"var-show-attributes", 0, 0, mi_cmd_var_show_attributes},
+ {"var-show-format", 0, 0, mi_cmd_var_show_format},
+ {"var-update", 0, 0, mi_cmd_var_update},
+ {0,}
+};
+
+/* Pointer to the mi command table (built at run time) */
+
+static struct mi_cmd **mi_table;
+
+/* A prime large enough to accomodate the entire command table */
+enum
+ {
+ MI_TABLE_SIZE = 227
+ };
+
+/* Exported function used to obtain info from the table */
+struct mi_cmd *
+mi_lookup (const char *command)
+{
+ return *lookup_table (command);
+}
+
+/* stat collecting */
+struct mi_cmd_stats
+{
+ int hit;
+ int miss;
+ int rehash;
+};
+struct mi_cmd_stats stats;
+
+/* our lookup function */
+static struct mi_cmd **
+lookup_table (const char *command)
+{
+ const char *chp;
+ unsigned int index = 0;
+ /* compute our hash */
+ for (chp = command; *chp; chp++)
+ {
+ /* some what arbitrary */
+ index = ((index << 6) + (unsigned int) *chp) % MI_TABLE_SIZE;
+ }
+ /* look it up */
+ while (1)
+ {
+ struct mi_cmd **entry = &mi_table[index];
+ if ((*entry) == 0)
+ {
+ /* not found, return pointer to next free. */
+ stats.miss++;
+ return entry;
+ }
+ if (strcmp (command, (*entry)->name) == 0)
+ {
+ stats.hit++;
+ return entry; /* found */
+ }
+ index = (index + 1) % MI_TABLE_SIZE;
+ stats.rehash++;
+ }
+}
+
+static void
+build_table (struct mi_cmd *commands)
+{
+ int nr_rehash = 0;
+ int nr_entries = 0;
+ struct mi_cmd *command;
+ int sizeof_table = sizeof (struct mi_cmd **) * MI_TABLE_SIZE;
+
+ mi_table = xmalloc (sizeof_table);
+ memset (mi_table, 0, sizeof_table);
+ for (command = commands; command->name != 0; command++)
+ {
+ struct mi_cmd **entry = lookup_table (command->name);
+ if (*entry)
+ internal_error (__FILE__, __LINE__,
+ "command `%s' appears to be duplicated",
+ command->name);
+ *entry = command;
+ if (0)
+ {
+ fprintf_unfiltered (gdb_stdlog, "%-30s %2d\n",
+ command->name, stats.rehash - nr_rehash);
+ }
+ nr_entries++;
+ nr_rehash = stats.rehash;
+ }
+ if (0)
+ {
+ fprintf_filtered (gdb_stdlog, "Average %3.1f\n",
+ (double) nr_rehash / (double) nr_entries);
+ }
+}
+
+void
+_initialize_mi_cmds (void)
+{
+ build_table (mi_cmds);
+ memset (&stats, 0, sizeof (stats));
+}
diff --git a/contrib/gdb/gdb/mi/mi-cmds.h b/contrib/gdb/gdb/mi/mi-cmds.h
new file mode 100644
index 0000000..88775e6
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-cmds.h
@@ -0,0 +1,125 @@
+/* MI Command Set.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MI_CMDS_H
+#define MI_CMDS_H
+
+/* An MI command can return any of the following. */
+
+enum mi_cmd_result
+ {
+ /* Report the command as ``done''. Display both the ``NNN^done''
+ message and the completion prompt. */
+ MI_CMD_DONE = 0,
+ /* The command is still running in the forground. Main loop should
+ display the completion prompt. */
+ MI_CMD_FORGROUND,
+ /* An error condition was detected and an error message was
+ asprintf'd into the mi_error_message buffer. The main loop will
+ display the error message and the completion prompt. */
+ MI_CMD_ERROR,
+ /* An error condition was detected and caught. The error message is
+ in the global error message buffer. The main loop will display
+ the error message and the completion prompt. */
+ MI_CMD_CAUGHT_ERROR,
+ /* The MI command has already displayed its completion message.
+ Main loop will not display a completion message but will display
+ the completion prompt. */
+ MI_CMD_QUIET
+ };
+
+typedef enum mi_cmd_result (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
+
+/* Older MI commands have this interface. Retained until all old
+ commands are flushed. */
+
+typedef enum mi_cmd_result (mi_cmd_args_ftype) ( /*ui */ char *args, int from_tty);
+
+/* Function implementing each command */
+extern mi_cmd_argv_ftype mi_cmd_break_insert;
+extern mi_cmd_argv_ftype mi_cmd_break_watch;
+extern mi_cmd_argv_ftype mi_cmd_disassemble;
+extern mi_cmd_argv_ftype mi_cmd_data_evaluate_expression;
+extern mi_cmd_argv_ftype mi_cmd_data_list_register_names;
+extern mi_cmd_argv_ftype mi_cmd_data_list_register_values;
+extern mi_cmd_argv_ftype mi_cmd_data_list_changed_registers;
+extern mi_cmd_argv_ftype mi_cmd_data_read_memory;
+extern mi_cmd_argv_ftype mi_cmd_data_write_memory;
+extern mi_cmd_argv_ftype mi_cmd_data_write_register_values;
+extern mi_cmd_args_ftype mi_cmd_exec_continue;
+extern mi_cmd_args_ftype mi_cmd_exec_finish;
+extern mi_cmd_args_ftype mi_cmd_exec_next;
+extern mi_cmd_args_ftype mi_cmd_exec_next_instruction;
+extern mi_cmd_args_ftype mi_cmd_exec_return;
+extern mi_cmd_args_ftype mi_cmd_exec_run;
+extern mi_cmd_args_ftype mi_cmd_exec_step;
+extern mi_cmd_args_ftype mi_cmd_exec_step_instruction;
+extern mi_cmd_args_ftype mi_cmd_exec_until;
+extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
+extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
+extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
+extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
+extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
+extern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
+extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
+extern mi_cmd_args_ftype mi_cmd_target_download;
+extern mi_cmd_args_ftype mi_cmd_target_select;
+extern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
+extern mi_cmd_argv_ftype mi_cmd_thread_select;
+extern mi_cmd_argv_ftype mi_cmd_var_assign;
+extern mi_cmd_argv_ftype mi_cmd_var_create;
+extern mi_cmd_argv_ftype mi_cmd_var_delete;
+extern mi_cmd_argv_ftype mi_cmd_var_evaluate_expression;
+extern mi_cmd_argv_ftype mi_cmd_var_info_expression;
+extern mi_cmd_argv_ftype mi_cmd_var_info_num_children;
+extern mi_cmd_argv_ftype mi_cmd_var_info_type;
+extern mi_cmd_argv_ftype mi_cmd_var_list_children;
+extern mi_cmd_argv_ftype mi_cmd_var_set_format;
+extern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
+extern mi_cmd_argv_ftype mi_cmd_var_show_format;
+extern mi_cmd_argv_ftype mi_cmd_var_update;
+
+/* Description of a single command. */
+
+struct mi_cmd
+ {
+ /* official name of the command */
+ const char *name;
+ /* If non-null, the corresponding CLI command that can be used to
+ implement this MI command */
+ const char *cli;
+ /* If non-null, the function implementing the MI command */
+ mi_cmd_args_ftype *args_func;
+ /* If non-null, the function implementing the MI command */
+ mi_cmd_argv_ftype *argv_func;
+ };
+
+/* Lookup a command in the mi comand table */
+
+extern struct mi_cmd *mi_lookup (const char *command);
+
+/* Debug flag */
+extern int mi_debug_p;
+
+/* Raw console output - FIXME: should this be a parameter? */
+extern struct ui_file *raw_stdout;
+
+#endif
diff --git a/contrib/gdb/gdb/mi/mi-console.c b/contrib/gdb/gdb/mi/mi-console.c
new file mode 100644
index 0000000..5824f83
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-console.c
@@ -0,0 +1,118 @@
+/* MI Console code.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "mi-console.h"
+#include "gdb_string.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+/* MI-console: send output to std-out but correcty encapsulated */
+
+static ui_file_fputs_ftype mi_console_file_fputs;
+static ui_file_flush_ftype mi_console_file_flush;
+static ui_file_delete_ftype mi_console_file_delete;
+
+struct mi_console_file
+ {
+ int *magic;
+ struct ui_file *raw;
+ struct ui_file *buffer;
+ const char *prefix;
+ };
+
+int mi_console_file_magic;
+
+struct ui_file *
+mi_console_file_new (struct ui_file *raw,
+ const char *prefix)
+{
+ struct ui_file *ui_file = ui_file_new ();
+ struct mi_console_file *mi_console = XMALLOC (struct mi_console_file);
+ mi_console->magic = &mi_console_file_magic;
+ mi_console->raw = raw;
+ mi_console->buffer = mem_fileopen ();
+ mi_console->prefix = prefix;
+ set_ui_file_fputs (ui_file, mi_console_file_fputs);
+ set_ui_file_flush (ui_file, mi_console_file_flush);
+ set_ui_file_data (ui_file, mi_console, mi_console_file_delete);
+ return ui_file;
+}
+
+static void
+mi_console_file_delete (struct ui_file *file)
+{
+ struct mi_console_file *mi_console = ui_file_data (file);
+ if (mi_console->magic != &mi_console_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mi_console_file_delete: bad magic number");
+ xfree (mi_console);
+}
+
+static void
+mi_console_file_fputs (const char *buf,
+ struct ui_file *file)
+{
+ struct mi_console_file *mi_console = ui_file_data (file);
+ if (mi_console->magic != &mi_console_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mi_console_file_fputs: bad magic number");
+ /* Append the text to our internal buffer */
+ fputs_unfiltered (buf, mi_console->buffer);
+ /* Flush when an embedded \n */
+ if (strchr (buf, '\n') != NULL)
+ gdb_flush (file);
+}
+
+/* Transform a byte sequence into a console output packet. */
+static void
+mi_console_raw_packet (void *data,
+ const char *buf,
+ long length_buf)
+{
+ struct mi_console_file *mi_console = data;
+ if (mi_console->magic != &mi_console_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mi_console_file_transform: bad magic number");
+
+ if (length_buf > 0)
+ {
+ fputs_unfiltered (mi_console->prefix, mi_console->raw);
+ fputs_unfiltered ("\"", mi_console->raw);
+ fputstrn_unfiltered (buf, length_buf, '"', mi_console->raw);
+ fputs_unfiltered ("\"\n", mi_console->raw);
+ gdb_flush (mi_console->raw);
+ }
+}
+
+static void
+mi_console_file_flush (struct ui_file *file)
+{
+ struct mi_console_file *mi_console = ui_file_data (file);
+ if (mi_console->magic != &mi_console_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mi_console_file_flush: bad magic number");
+ ui_file_put (mi_console->buffer, mi_console_raw_packet, mi_console);
+ ui_file_rewind (mi_console->buffer);
+}
diff --git a/contrib/gdb/gdb/mi/mi-console.h b/contrib/gdb/gdb/mi/mi-console.h
new file mode 100644
index 0000000..6bd03cb
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-console.h
@@ -0,0 +1,27 @@
+/* MI Command Set - MI Console.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MI_CONSOLE_H
+#define MI_CONSOLE_H
+
+extern struct ui_file *mi_console_file_new (struct ui_file *raw, const char *prefix);
+
+#endif
diff --git a/contrib/gdb/gdb/mi/mi-getopt.c b/contrib/gdb/gdb/mi/mi-getopt.c
new file mode 100644
index 0000000..59ccdf3
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-getopt.c
@@ -0,0 +1,76 @@
+/* MI Command Set - MI Option Parser.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "mi-getopt.h"
+#include "gdb_string.h"
+
+int
+mi_getopt (const char *prefix,
+ int argc, char **argv,
+ struct mi_opt *opts,
+ int *optind, char **optarg)
+{
+ char *arg;
+ struct mi_opt *opt;
+ /* We assume that argv/argc are ok. */
+ if (*optind > argc || *optind < 0)
+ internal_error (__FILE__, __LINE__,
+ "mi_getopt_long: optind out of bounds");
+ if (*optind == argc)
+ return -1;
+ arg = argv[*optind];
+ /* ``--''? */
+ if (strcmp (arg, "--") == 0)
+ {
+ *optind += 1;
+ *optarg = NULL;
+ return -1;
+ }
+ /* End of option list. */
+ if (arg[0] != '-')
+ {
+ *optarg = NULL;
+ return -1;
+ }
+ /* Look the option up. */
+ for (opt = opts; opt->name != NULL; opt++)
+ {
+ if (strcmp (opt->name, arg + 1) != 0)
+ continue;
+ if (opt->arg_p)
+ {
+ /* A non-simple optarg option. */
+ if (argc < *optind + 2)
+ error ("%s: Option %s requires an argument", prefix, arg);
+ *optarg = argv[(*optind) + 1];
+ *optind = (*optind) + 2;
+ return opt->index;
+ }
+ else
+ {
+ *optarg = NULL;
+ *optind = (*optind) + 1;
+ return opt->index;
+ }
+ }
+ error ("%s: Unknown option ``%s''", prefix, arg + 1);
+}
diff --git a/contrib/gdb/gdb/mi/mi-getopt.h b/contrib/gdb/gdb/mi/mi-getopt.h
new file mode 100644
index 0000000..6b31adf
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-getopt.h
@@ -0,0 +1,60 @@
+/* MI Option Parser.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MI_GETOPT_H
+#define MI_GETOPT_H
+
+/* Like getopt() but with simpler semantics.
+
+ An option has the form ``-<name>''. The special option ``--''
+ denotes the end of the option list. An option can be followed by a
+ separate argument (on a per option basis).
+
+ On entry OPTIND contains the index of the next element of ARGV that
+ needs parsing. OPTIND is updated to indicate the index of the next
+ argument before mi_getopt() returns.
+
+ If ARGV[OPTIND] is an option, that options INDEX is returned.
+ OPTARG is set to the options argument or NULL. OPTIND is updated.
+
+ If ARGV[OPTIND] is not an option, -1 is returned and OPTIND updated
+ to specify the non-option argument. OPTARG is set to NULL.
+
+ mi_getopt() calls ``error("%s: Unknown option %c", prefix,
+ option)'' if an unknown option is encountered. */
+
+struct mi_opt;
+extern int mi_getopt (const char *prefix, int argc, char **argv,
+ struct mi_opt *opt, int *optind, char **optarg);
+
+/* The option list. Terminated by NAME==NULL. ARG_P that the option
+ requires an argument. INDEX is returned to identify th option. */
+
+struct mi_opt
+ {
+ const char *name;
+ int index;
+ int arg_p;
+ };
+
+struct mi_opt;
+
+#endif
diff --git a/contrib/gdb/gdb/mi/mi-main.c b/contrib/gdb/gdb/mi/mi-main.c
new file mode 100644
index 0000000..3a59fc8
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-main.c
@@ -0,0 +1,1527 @@
+/* MI Command Set.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Work in progress */
+
+#include "defs.h"
+#include "target.h"
+#include "inferior.h"
+#include "gdb_string.h"
+#include "top.h"
+#include "gdbthread.h"
+#include "mi-cmds.h"
+#include "mi-parse.h"
+#include "mi-getopt.h"
+#include "mi-console.h"
+#include "ui-out.h"
+#include "mi-out.h"
+#include "event-loop.h"
+#include "event-top.h"
+#include "gdbcore.h" /* for write_memory() */
+#include "value.h" /* for write_register_bytes() */
+#include "regcache.h"
+#include "gdb.h"
+#include <ctype.h>
+#include <sys/time.h>
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+enum
+ {
+ FROM_TTY = 0
+ };
+
+
+int mi_debug_p;
+struct ui_file *raw_stdout;
+
+/* The token of the last asynchronous command */
+static char *last_async_command;
+static char *previous_async_command;
+static char *mi_error_message;
+static char *old_regs;
+
+extern void _initialize_mi_main (void);
+static char *mi_input (char *);
+static void mi_execute_command (char *cmd, int from_tty);
+static enum mi_cmd_result mi_cmd_execute (struct mi_parse *parse);
+
+static void mi_execute_cli_command (const char *cli, char *args);
+static enum mi_cmd_result mi_execute_async_cli_command (char *mi, char *args, int from_tty);
+static void mi_execute_command_wrapper (char *cmd);
+
+void mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg);
+
+static int register_changed_p (int regnum);
+static int get_register (int regnum, int format);
+static void mi_load_progress (const char *section_name,
+ unsigned long sent_so_far,
+ unsigned long total_section,
+ unsigned long total_sent,
+ unsigned long grand_total);
+
+/* FIXME: these should go in some .h file, but infcmd.c doesn't have a
+ corresponding .h file. These wrappers will be obsolete anyway, once
+ we pull the plug on the sanitization. */
+extern void interrupt_target_command_wrapper (char *, int);
+extern void return_command_wrapper (char *, int);
+
+/* Command implementations. FIXME: Is this libgdb? No. This is the MI
+ layer that calls libgdb. Any operation used in the below should be
+ formalized. */
+
+enum mi_cmd_result
+mi_cmd_gdb_exit (char *command, char **argv, int argc)
+{
+ /* We have to print everything right here because we never return */
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("^exit\n", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ /* FIXME: The function called is not yet a formal libgdb function */
+ quit_force (NULL, FROM_TTY);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_exec_run (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("run", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_next (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("next", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_next_instruction (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("nexti", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_step (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("step", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_step_instruction (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("stepi", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_finish (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("finish", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_until (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("until", args, from_tty);
+}
+
+enum mi_cmd_result
+mi_cmd_exec_return (char *args, int from_tty)
+{
+ /* This command doesn't really execute the target, it just pops the
+ specified number of frames. */
+ if (*args)
+ /* Call return_command with from_tty argument equal to 0 so as to
+ avoid being queried. */
+ return_command_wrapper (args, 0);
+ else
+ /* Call return_command with from_tty argument equal to 0 so as to
+ avoid being queried. */
+ return_command_wrapper (NULL, 0);
+
+ /* Because we have called return_command with from_tty = 0, we need
+ to print the frame here. */
+ show_and_print_stack_frame (selected_frame,
+ selected_frame_level,
+ LOC_AND_ADDRESS);
+
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_exec_continue (char *args, int from_tty)
+{
+ /* FIXME: Should call a libgdb function, not a cli wrapper */
+ return mi_execute_async_cli_command ("continue", args, from_tty);
+}
+
+/* Interrupt the execution of the target. Note how we must play around
+ with the token varialbes, in order to display the current token in
+ the result of the interrupt command, and the previous execution
+ token when the target finally stops. See comments in
+ mi_cmd_execute. */
+enum mi_cmd_result
+mi_cmd_exec_interrupt (char *args, int from_tty)
+{
+ if (!target_executing)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_exec_interrupt: Inferior not executing.");
+ return MI_CMD_ERROR;
+ }
+ interrupt_target_command_wrapper (args, from_tty);
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("^done", raw_stdout);
+ xfree (last_async_command);
+ if (previous_async_command)
+ last_async_command = xstrdup (previous_async_command);
+ xfree (previous_async_command);
+ previous_async_command = NULL;
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ return MI_CMD_QUIET;
+}
+
+enum mi_cmd_result
+mi_cmd_thread_select (char *command, char **argv, int argc)
+{
+ enum gdb_rc rc;
+
+ if (argc != 1)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_thread_select: USAGE: threadnum.");
+ return MI_CMD_ERROR;
+ }
+ else
+ rc = gdb_thread_select (uiout, argv[0]);
+
+ if (rc == GDB_RC_FAIL)
+ return MI_CMD_CAUGHT_ERROR;
+ else
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_thread_list_ids (char *command, char **argv, int argc)
+{
+ enum gdb_rc rc = MI_CMD_DONE;
+
+ if (argc != 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_thread_list_ids: No arguments required.");
+ return MI_CMD_ERROR;
+ }
+ else
+ rc = gdb_list_thread_ids (uiout);
+
+ if (rc == GDB_RC_FAIL)
+ return MI_CMD_CAUGHT_ERROR;
+ else
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_data_list_register_names (char *command, char **argv, int argc)
+{
+ int regnum, numregs;
+ int i;
+
+ /* Note that the test for a valid register must include checking the
+ REGISTER_NAME because NUM_REGS may be allocated for the union of
+ the register sets within a family of related processors. In this
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged. */
+
+ numregs = NUM_REGS + NUM_PSEUDO_REGS;
+
+ ui_out_list_begin (uiout, "register-names");
+
+ if (argc == 0) /* No args, just do all the regs */
+ {
+ for (regnum = 0;
+ regnum < numregs;
+ regnum++)
+ {
+ if (REGISTER_NAME (regnum) == NULL
+ || *(REGISTER_NAME (regnum)) == '\0')
+ ui_out_field_string (uiout, NULL, "");
+ else
+ ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum));
+ }
+ }
+
+ /* Else, list of register #s, just do listed regs */
+ for (i = 0; i < argc; i++)
+ {
+ regnum = atoi (argv[i]);
+ if (regnum < 0 || regnum >= numregs)
+ {
+ xasprintf (&mi_error_message, "bad register number");
+ return MI_CMD_ERROR;
+ }
+ if (REGISTER_NAME (regnum) == NULL
+ || *(REGISTER_NAME (regnum)) == '\0')
+ ui_out_field_string (uiout, NULL, "");
+ else
+ ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum));
+ }
+ ui_out_list_end (uiout);
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
+{
+ int regnum, numregs, changed;
+ int i;
+
+ /* Note that the test for a valid register must include checking the
+ REGISTER_NAME because NUM_REGS may be allocated for the union of
+ the register sets within a family of related processors. In this
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged. */
+
+ numregs = NUM_REGS;
+
+ ui_out_list_begin (uiout, "changed-registers");
+
+ if (argc == 0) /* No args, just do all the regs */
+ {
+ for (regnum = 0;
+ regnum < numregs;
+ regnum++)
+ {
+ if (REGISTER_NAME (regnum) == NULL
+ || *(REGISTER_NAME (regnum)) == '\0')
+ continue;
+ changed = register_changed_p (regnum);
+ if (changed < 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_list_changed_registers: Unable to read register contents.");
+ return MI_CMD_ERROR;
+ }
+ else if (changed)
+ ui_out_field_int (uiout, NULL, regnum);
+ }
+ }
+
+ /* Else, list of register #s, just do listed regs */
+ for (i = 0; i < argc; i++)
+ {
+ regnum = atoi (argv[i]);
+
+ if (regnum >= 0
+ && regnum < numregs
+ && REGISTER_NAME (regnum) != NULL
+ && *REGISTER_NAME (regnum) != '\000')
+ {
+ changed = register_changed_p (regnum);
+ if (changed < 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_list_register_change: Unable to read register contents.");
+ return MI_CMD_ERROR;
+ }
+ else if (changed)
+ ui_out_field_int (uiout, NULL, regnum);
+ }
+ else
+ {
+ xasprintf (&mi_error_message, "bad register number");
+ return MI_CMD_ERROR;
+ }
+ }
+ ui_out_list_end (uiout);
+ return MI_CMD_DONE;
+}
+
+static int
+register_changed_p (int regnum)
+{
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+
+ if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ return -1;
+
+ if (memcmp (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
+ REGISTER_RAW_SIZE (regnum)) == 0)
+ return 0;
+
+ /* Found a changed register. Return 1. */
+
+ memcpy (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
+ REGISTER_RAW_SIZE (regnum));
+
+ return 1;
+}
+
+/* Return a list of register number and value pairs. The valid
+ arguments expected are: a letter indicating the format in which to
+ display the registers contents. This can be one of: x (hexadecimal), d
+ (decimal), N (natural), t (binary), o (octal), r (raw). After the
+ format argumetn there can be a sequence of numbers, indicating which
+ registers to fetch the content of. If the format is the only argument,
+ a list of all the registers with their values is returned. */
+enum mi_cmd_result
+mi_cmd_data_list_register_values (char *command, char **argv, int argc)
+{
+ int regnum, numregs, format, result;
+ int i;
+
+ /* Note that the test for a valid register must include checking the
+ REGISTER_NAME because NUM_REGS may be allocated for the union of
+ the register sets within a family of related processors. In this
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged. */
+
+ numregs = NUM_REGS;
+
+ if (argc == 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> [<regnum1>...<regnumN>]");
+ return MI_CMD_ERROR;
+ }
+
+ format = (int) argv[0][0];
+
+ if (!target_has_registers)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_list_register_values: No registers.");
+ return MI_CMD_ERROR;
+ }
+
+ ui_out_list_begin (uiout, "register-values");
+
+ if (argc == 1) /* No args, beside the format: do all the regs */
+ {
+ for (regnum = 0;
+ regnum < numregs;
+ regnum++)
+ {
+ if (REGISTER_NAME (regnum) == NULL
+ || *(REGISTER_NAME (regnum)) == '\0')
+ continue;
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_int (uiout, "number", regnum);
+ result = get_register (regnum, format);
+ if (result == -1)
+ return MI_CMD_ERROR;
+ ui_out_tuple_end (uiout);
+ }
+ }
+
+ /* Else, list of register #s, just do listed regs */
+ for (i = 1; i < argc; i++)
+ {
+ regnum = atoi (argv[i]);
+
+ if (regnum >= 0
+ && regnum < numregs
+ && REGISTER_NAME (regnum) != NULL
+ && *REGISTER_NAME (regnum) != '\000')
+ {
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_int (uiout, "number", regnum);
+ result = get_register (regnum, format);
+ if (result == -1)
+ return MI_CMD_ERROR;
+ ui_out_tuple_end (uiout);
+ }
+ else
+ {
+ xasprintf (&mi_error_message, "bad register number");
+ return MI_CMD_ERROR;
+ }
+ }
+ ui_out_list_end (uiout);
+ return MI_CMD_DONE;
+}
+
+/* Output one register's contents in the desired format. */
+static int
+get_register (int regnum, int format)
+{
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ int optim;
+ static struct ui_stream *stb = NULL;
+
+ stb = ui_out_stream_new (uiout);
+
+ if (format == 'N')
+ format = 0;
+
+ /* read_relative_register_raw_bytes returns a virtual frame pointer
+ (FRAME_FP (selected_frame)) if regnum == FP_REGNUM instead
+ of the real contents of the register. To get around this,
+ use get_saved_register instead. */
+ get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, selected_frame,
+ regnum, (enum lval_type *) NULL);
+ if (optim)
+ {
+ xasprintf (&mi_error_message, "Optimized out");
+ return -1;
+ }
+
+ /* Convert raw data to virtual format if necessary. */
+
+ if (REGISTER_CONVERTIBLE (regnum))
+ {
+ REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum),
+ raw_buffer, virtual_buffer);
+ }
+ else
+ memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (regnum));
+
+ if (format == 'r')
+ {
+ int j;
+ char *ptr, buf[1024];
+
+ strcpy (buf, "0x");
+ ptr = buf + 2;
+ for (j = 0; j < REGISTER_RAW_SIZE (regnum); j++)
+ {
+ register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
+ : REGISTER_RAW_SIZE (regnum) - 1 - j;
+ sprintf (ptr, "%02x", (unsigned char) raw_buffer[idx]);
+ ptr += 2;
+ }
+ ui_out_field_string (uiout, "value", buf);
+ /*fputs_filtered (buf, gdb_stdout); */
+ }
+ else
+ {
+ val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0,
+ stb->stream, format, 1, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "value", stb);
+ ui_out_stream_delete (stb);
+ }
+ return 1;
+}
+
+/* Write given values into registers. The registers and values are
+ given as pairs. The corresponding MI command is
+ -data-write-register-values <format> [<regnum1> <value1>...<regnumN> <valueN>]*/
+enum mi_cmd_result
+mi_cmd_data_write_register_values (char *command, char **argv, int argc)
+{
+ int regnum;
+ int i;
+ int numregs;
+ LONGEST value;
+ char format;
+
+ /* Note that the test for a valid register must include checking the
+ REGISTER_NAME because NUM_REGS may be allocated for the union of
+ the register sets within a family of related processors. In this
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged. */
+
+ numregs = NUM_REGS;
+
+ if (argc == 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_write_register_values: Usage: -data-write-register-values <format> [<regnum1> <value1>...<regnumN> <valueN>]");
+ return MI_CMD_ERROR;
+ }
+
+ format = (int) argv[0][0];
+
+ if (!target_has_registers)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_write_register_values: No registers.");
+ return MI_CMD_ERROR;
+ }
+
+ if (!(argc - 1))
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_write_register_values: No regs and values specified.");
+ return MI_CMD_ERROR;
+ }
+
+ if ((argc - 1) % 2)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_write_register_values: Regs and vals are not in pairs.");
+ return MI_CMD_ERROR;
+ }
+
+ for (i = 1; i < argc; i = i + 2)
+ {
+ regnum = atoi (argv[i]);
+
+ if (regnum >= 0
+ && regnum < numregs
+ && REGISTER_NAME (regnum) != NULL
+ && *REGISTER_NAME (regnum) != '\000')
+ {
+ void *buffer;
+ struct cleanup *old_chain;
+
+ /* Get the value as a number */
+ value = parse_and_eval_address (argv[i + 1]);
+ /* Get the value into an array */
+ buffer = xmalloc (REGISTER_SIZE);
+ old_chain = make_cleanup (xfree, buffer);
+ store_signed_integer (buffer, REGISTER_SIZE, value);
+ /* Write it down */
+ write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
+ /* Free the buffer. */
+ do_cleanups (old_chain);
+ }
+ else
+ {
+ xasprintf (&mi_error_message, "bad register number");
+ return MI_CMD_ERROR;
+ }
+ }
+ return MI_CMD_DONE;
+}
+
+#if 0
+/*This is commented out because we decided it was not useful. I leave
+ it, just in case. ezannoni:1999-12-08 */
+
+/* Assign a value to a variable. The expression argument must be in
+ the form A=2 or "A = 2" (I.e. if there are spaces it needs to be
+ quoted. */
+enum mi_cmd_result
+mi_cmd_data_assign (char *command, char **argv, int argc)
+{
+ struct expression *expr;
+ struct cleanup *old_chain;
+
+ if (argc != 1)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_assign: Usage: -data-assign expression");
+ return MI_CMD_ERROR;
+ }
+
+ /* NOTE what follows is a clone of set_command(). FIXME: ezannoni
+ 01-12-1999: Need to decide what to do with this for libgdb purposes. */
+
+ expr = parse_expression (argv[0]);
+ old_chain = make_cleanup (free_current_contents, &expr);
+ evaluate_expression (expr);
+ do_cleanups (old_chain);
+ return MI_CMD_DONE;
+}
+#endif
+
+/* Evaluate the value of the argument. The argument is an
+ expression. If the expression contains spaces it needs to be
+ included in double quotes. */
+enum mi_cmd_result
+mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
+{
+ struct expression *expr;
+ struct cleanup *old_chain = NULL;
+ struct value *val;
+ struct ui_stream *stb = NULL;
+
+ stb = ui_out_stream_new (uiout);
+
+ if (argc != 1)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_evaluate_expression: Usage: -data-evaluate-expression expression");
+ return MI_CMD_ERROR;
+ }
+
+ expr = parse_expression (argv[0]);
+
+ old_chain = make_cleanup (free_current_contents, &expr);
+
+ val = evaluate_expression (expr);
+
+ /* Print the result of the expression evaluation. */
+ val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
+ VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
+ stb->stream, 0, 0, 0, 0);
+
+ ui_out_field_stream (uiout, "value", stb);
+ ui_out_stream_delete (stb);
+
+ do_cleanups (old_chain);
+
+ return MI_CMD_DONE;
+}
+
+enum mi_cmd_result
+mi_cmd_target_download (char *args, int from_tty)
+{
+ char *run;
+ struct cleanup *old_cleanups = NULL;
+
+ xasprintf (&run, "load %s", args);
+ old_cleanups = make_cleanup (xfree, run);
+ execute_command (run, from_tty);
+
+ do_cleanups (old_cleanups);
+ return MI_CMD_DONE;
+}
+
+/* Connect to the remote target. */
+enum mi_cmd_result
+mi_cmd_target_select (char *args, int from_tty)
+{
+ char *run;
+ struct cleanup *old_cleanups = NULL;
+
+ xasprintf (&run, "target %s", args);
+ old_cleanups = make_cleanup (xfree, run);
+
+ /* target-select is always synchronous. once the call has returned
+ we know that we are connected. */
+ /* NOTE: At present all targets that are connected are also
+ (implicitly) talking to a halted target. In the future this may
+ change. */
+ execute_command (run, from_tty);
+
+ do_cleanups (old_cleanups);
+
+ /* Issue the completion message here. */
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("^connected", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ do_exec_cleanups (ALL_CLEANUPS);
+ return MI_CMD_QUIET;
+}
+
+/* DATA-MEMORY-READ:
+
+ ADDR: start address of data to be dumped.
+ WORD-FORMAT: a char indicating format for the ``word''. See
+ the ``x'' command.
+ WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes
+ NR_ROW: Number of rows.
+ NR_COL: The number of colums (words per row).
+ ASCHAR: (OPTIONAL) Append an ascii character dump to each row. Use
+ ASCHAR for unprintable characters.
+
+ Reads SIZE*NR_ROW*NR_COL bytes starting at ADDR from memory and
+ displayes them. Returns:
+
+ {addr="...",rowN={wordN="..." ,... [,ascii="..."]}, ...}
+
+ Returns:
+ The number of bytes read is SIZE*ROW*COL. */
+
+enum mi_cmd_result
+mi_cmd_data_read_memory (char *command, char **argv, int argc)
+{
+ struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
+ CORE_ADDR addr;
+ long total_bytes;
+ long nr_cols;
+ long nr_rows;
+ char word_format;
+ struct type *word_type;
+ long word_size;
+ char word_asize;
+ char aschar;
+ char *mbuf;
+ int nr_bytes;
+ long offset = 0;
+ int optind = 0;
+ char *optarg;
+ enum opt
+ {
+ OFFSET_OPT
+ };
+ static struct mi_opt opts[] =
+ {
+ {"o", OFFSET_OPT, 1},
+ 0
+ };
+
+ while (1)
+ {
+ int opt = mi_getopt ("mi_cmd_data_read_memory", argc, argv, opts,
+ &optind, &optarg);
+ if (opt < 0)
+ break;
+ switch ((enum opt) opt)
+ {
+ case OFFSET_OPT:
+ offset = atol (optarg);
+ break;
+ }
+ }
+ argv += optind;
+ argc -= optind;
+
+ if (argc < 5 || argc > 6)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_read_memory: Usage: ADDR WORD-FORMAT WORD-SIZE NR-ROWS NR-COLS [ASCHAR].");
+ return MI_CMD_ERROR;
+ }
+
+ /* Extract all the arguments. */
+
+ /* Start address of the memory dump. */
+ addr = parse_and_eval_address (argv[0]) + offset;
+ /* The format character to use when displaying a memory word. See
+ the ``x'' command. */
+ word_format = argv[1][0];
+ /* The size of the memory word. */
+ word_size = atol (argv[2]);
+ switch (word_size)
+ {
+ case 1:
+ word_type = builtin_type_int8;
+ word_asize = 'b';
+ break;
+ case 2:
+ word_type = builtin_type_int16;
+ word_asize = 'h';
+ break;
+ case 4:
+ word_type = builtin_type_int32;
+ word_asize = 'w';
+ break;
+ case 8:
+ word_type = builtin_type_int64;
+ word_asize = 'g';
+ break;
+ default:
+ word_type = builtin_type_int8;
+ word_asize = 'b';
+ }
+ /* The number of rows */
+ nr_rows = atol (argv[3]);
+ if (nr_rows <= 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_read_memory: invalid number of rows.");
+ return MI_CMD_ERROR;
+ }
+ /* number of bytes per row. */
+ nr_cols = atol (argv[4]);
+ if (nr_cols <= 0)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_read_memory: invalid number of columns.");
+ }
+ /* The un-printable character when printing ascii. */
+ if (argc == 6)
+ aschar = *argv[5];
+ else
+ aschar = 0;
+
+ /* create a buffer and read it in. */
+ total_bytes = word_size * nr_rows * nr_cols;
+ mbuf = xcalloc (total_bytes, 1);
+ make_cleanup (xfree, mbuf);
+ if (mbuf == NULL)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_read_memory: out of memory.");
+ return MI_CMD_ERROR;
+ }
+ nr_bytes = 0;
+ while (nr_bytes < total_bytes)
+ {
+ int error;
+ long num = target_read_memory_partial (addr + nr_bytes, mbuf + nr_bytes,
+ total_bytes - nr_bytes,
+ &error);
+ if (num <= 0)
+ break;
+ nr_bytes += num;
+ }
+
+ /* output the header information. */
+ ui_out_field_core_addr (uiout, "addr", addr);
+ ui_out_field_int (uiout, "nr-bytes", nr_bytes);
+ ui_out_field_int (uiout, "total-bytes", total_bytes);
+ ui_out_field_core_addr (uiout, "next-row", addr + word_size * nr_cols);
+ ui_out_field_core_addr (uiout, "prev-row", addr - word_size * nr_cols);
+ ui_out_field_core_addr (uiout, "next-page", addr + total_bytes);
+ ui_out_field_core_addr (uiout, "prev-page", addr - total_bytes);
+
+ /* Build the result as a two dimentional table. */
+ {
+ struct ui_stream *stream = ui_out_stream_new (uiout);
+ int row;
+ int row_byte;
+ ui_out_list_begin (uiout, "memory");
+ for (row = 0, row_byte = 0;
+ row < nr_rows;
+ row++, row_byte += nr_cols * word_size)
+ {
+ int col;
+ int col_byte;
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_core_addr (uiout, "addr", addr + row_byte);
+ /* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */
+ ui_out_list_begin (uiout, "data");
+ for (col = 0, col_byte = row_byte;
+ col < nr_cols;
+ col++, col_byte += word_size)
+ {
+ if (col_byte + word_size > nr_bytes)
+ {
+ ui_out_field_string (uiout, NULL, "N/A");
+ }
+ else
+ {
+ ui_file_rewind (stream->stream);
+ print_scalar_formatted (mbuf + col_byte, word_type, word_format,
+ word_asize, stream->stream);
+ ui_out_field_stream (uiout, NULL, stream);
+ }
+ }
+ ui_out_list_end (uiout);
+ if (aschar)
+ {
+ int byte;
+ ui_file_rewind (stream->stream);
+ for (byte = row_byte; byte < row_byte + word_size * nr_cols; byte++)
+ {
+ if (byte >= nr_bytes)
+ {
+ fputc_unfiltered ('X', stream->stream);
+ }
+ else if (mbuf[byte] < 32 || mbuf[byte] > 126)
+ {
+ fputc_unfiltered (aschar, stream->stream);
+ }
+ else
+ fputc_unfiltered (mbuf[byte], stream->stream);
+ }
+ ui_out_field_stream (uiout, "ascii", stream);
+ }
+ ui_out_tuple_end (uiout);
+ }
+ ui_out_stream_delete (stream);
+ ui_out_list_end (uiout);
+ }
+ do_cleanups (cleanups);
+ return MI_CMD_DONE;
+}
+
+/* DATA-MEMORY-WRITE:
+
+ COLUMN_OFFSET: optional argument. Must be preceeded by '-o'. The
+ offset from the beginning of the memory grid row where the cell to
+ be written is.
+ ADDR: start address of the row in the memory grid where the memory
+ cell is, if OFFSET_COLUMN is specified. Otherwise, the address of
+ the location to write to.
+ FORMAT: a char indicating format for the ``word''. See
+ the ``x'' command.
+ WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes
+ VALUE: value to be written into the memory address.
+
+ Writes VALUE into ADDR + (COLUMN_OFFSET * WORD_SIZE).
+
+ Prints nothing. */
+enum mi_cmd_result
+mi_cmd_data_write_memory (char *command, char **argv, int argc)
+{
+ CORE_ADDR addr;
+ char word_format;
+ long word_size;
+ /* FIXME: ezannoni 2000-02-17 LONGEST could possibly not be big
+ enough when using a compiler other than GCC. */
+ LONGEST value;
+ void *buffer;
+ struct cleanup *old_chain;
+ long offset = 0;
+ int optind = 0;
+ char *optarg;
+ enum opt
+ {
+ OFFSET_OPT
+ };
+ static struct mi_opt opts[] =
+ {
+ {"o", OFFSET_OPT, 1},
+ 0
+ };
+
+ while (1)
+ {
+ int opt = mi_getopt ("mi_cmd_data_write_memory", argc, argv, opts,
+ &optind, &optarg);
+ if (opt < 0)
+ break;
+ switch ((enum opt) opt)
+ {
+ case OFFSET_OPT:
+ offset = atol (optarg);
+ break;
+ }
+ }
+ argv += optind;
+ argc -= optind;
+
+ if (argc != 4)
+ {
+ xasprintf (&mi_error_message,
+ "mi_cmd_data_write_memory: Usage: [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE.");
+ return MI_CMD_ERROR;
+ }
+
+ /* Extract all the arguments. */
+ /* Start address of the memory dump. */
+ addr = parse_and_eval_address (argv[0]);
+ /* The format character to use when displaying a memory word. See
+ the ``x'' command. */
+ word_format = argv[1][0];
+ /* The size of the memory word. */
+ word_size = atol (argv[2]);
+
+ /* Calculate the real address of the write destination. */
+ addr += (offset * word_size);
+
+ /* Get the value as a number */
+ value = parse_and_eval_address (argv[3]);
+ /* Get the value into an array */
+ buffer = xmalloc (word_size);
+ old_chain = make_cleanup (xfree, buffer);
+ store_signed_integer (buffer, word_size, value);
+ /* Write it down to memory */
+ write_memory (addr, buffer, word_size);
+ /* Free the buffer. */
+ do_cleanups (old_chain);
+
+ return MI_CMD_DONE;
+}
+
+/* Execute a command within a safe environment. Return >0 for
+ ok. Return <0 for supress prompt. Return 0 to have the error
+ extracted from error_last_message(). */
+
+static int
+captured_mi_execute_command (void *data)
+{
+ struct mi_parse *context = data;
+ enum mi_cmd_result rc;
+
+ switch (context->op)
+ {
+
+ case MI_COMMAND:
+ /* A MI command was read from the input stream */
+ if (mi_debug_p)
+ /* FIXME: gdb_???? */
+ fprintf_unfiltered (raw_stdout, " token=`%s' command=`%s' args=`%s'\n",
+ context->token, context->command, context->args);
+ /* FIXME: cagney/1999-09-25: Rather than this convoluted
+ condition expression, each function should return an
+ indication of what action is required and then switch on
+ that. */
+ rc = mi_cmd_execute (context);
+ if (!target_can_async_p () || !target_executing)
+ {
+ /* print the result if there were no errors */
+ if (rc == MI_CMD_DONE)
+ {
+ fputs_unfiltered (context->token, raw_stdout);
+ fputs_unfiltered ("^done", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ }
+ else if (rc == MI_CMD_ERROR)
+ {
+ if (mi_error_message)
+ {
+ fputs_unfiltered (context->token, raw_stdout);
+ fputs_unfiltered ("^error,msg=\"", raw_stdout);
+ fputstr_unfiltered (mi_error_message, '"', raw_stdout);
+ xfree (mi_error_message);
+ fputs_unfiltered ("\"\n", raw_stdout);
+ }
+ mi_out_rewind (uiout);
+ }
+ else if (rc == MI_CMD_CAUGHT_ERROR)
+ {
+ mi_out_rewind (uiout);
+ return 0;
+ }
+ else
+ mi_out_rewind (uiout);
+ }
+ else if (sync_execution)
+ /* Don't print the prompt. We are executing the target in
+ synchronous mode. */
+ return -1;
+ break;
+
+ case CLI_COMMAND:
+ /* A CLI command was read from the input stream */
+ /* This will be removed as soon as we have a complete set of
+ mi commands */
+ /* echo the command on the console. */
+ fprintf_unfiltered (gdb_stdlog, "%s\n", context->command);
+ /* FIXME: If the command string has something that looks like
+ a format spec (e.g. %s) we will get a core dump */
+ mi_execute_cli_command ("%s", context->command);
+ /* print the result */
+ /* FIXME: Check for errors here. */
+ fputs_unfiltered (context->token, raw_stdout);
+ fputs_unfiltered ("^done", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ break;
+
+ }
+ return 1;
+}
+
+
+void
+mi_execute_command (char *cmd, int from_tty)
+{
+ struct mi_parse *command;
+
+ /* This is to handle EOF (^D). We just quit gdb. */
+ /* FIXME: we should call some API function here. */
+ if (cmd == 0)
+ quit_force (NULL, from_tty);
+
+ command = mi_parse (cmd);
+
+ if (command != NULL)
+ {
+ /* FIXME: cagney/1999-11-04: Can this use of catch_errors either
+ be pushed even further down or even eliminated? */
+ int rc = catch_errors (captured_mi_execute_command, command, "",
+ RETURN_MASK_ALL);
+ if (rc < 0)
+ {
+ /* The command is executing synchronously. Bail out early
+ suppressing the finished prompt. */
+ mi_parse_free (command);
+ return;
+ }
+ if (rc == 0)
+ {
+ char *msg = error_last_message ();
+ struct cleanup *cleanup = make_cleanup (xfree, msg);
+ /* The command execution failed and error() was called
+ somewhere */
+ fputs_unfiltered (command->token, raw_stdout);
+ fputs_unfiltered ("^error,msg=\"", raw_stdout);
+ fputstr_unfiltered (msg, '"', raw_stdout);
+ fputs_unfiltered ("\"\n", raw_stdout);
+ }
+ mi_parse_free (command);
+ }
+
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+ /* print any buffered hook code */
+ /* ..... */
+}
+
+static enum mi_cmd_result
+mi_cmd_execute (struct mi_parse *parse)
+{
+ if (parse->cmd->argv_func != NULL
+ || parse->cmd->args_func != NULL)
+ {
+ /* FIXME: We need to save the token because the command executed
+ may be asynchronous and need to print the token again.
+ In the future we can pass the token down to the func
+ and get rid of the last_async_command */
+ /* The problem here is to keep the token around when we launch
+ the target, and we want to interrupt it later on. The
+ interrupt command will have its own token, but when the
+ target stops, we must display the token corresponding to the
+ last execution command given. So we have another string where
+ we copy the token (previous_async_command), if this was
+ indeed the token of an execution command, and when we stop we
+ print that one. This is possible because the interrupt
+ command, when over, will copy that token back into the
+ default token string (last_async_command). */
+
+ if (target_executing)
+ {
+ if (!previous_async_command)
+ previous_async_command = xstrdup (last_async_command);
+ if (strcmp (parse->command, "exec-interrupt"))
+ {
+ fputs_unfiltered (parse->token, raw_stdout);
+ fputs_unfiltered ("^error,msg=\"", raw_stdout);
+ fputs_unfiltered ("Cannot execute command ", raw_stdout);
+ fputstr_unfiltered (parse->command, '"', raw_stdout);
+ fputs_unfiltered (" while target running", raw_stdout);
+ fputs_unfiltered ("\"\n", raw_stdout);
+ return MI_CMD_ERROR;
+ }
+ }
+ last_async_command = xstrdup (parse->token);
+ make_exec_cleanup (free_current_contents, &last_async_command);
+ /* FIXME: DELETE THIS! */
+ if (parse->cmd->args_func != NULL)
+ return parse->cmd->args_func (parse->args, 0 /*from_tty */ );
+ return parse->cmd->argv_func (parse->command, parse->argv, parse->argc);
+ }
+ else if (parse->cmd->cli != 0)
+ {
+ /* FIXME: DELETE THIS. */
+ /* The operation is still implemented by a cli command */
+ /* Must be a synchronous one */
+ mi_execute_cli_command (parse->cmd->cli, parse->args);
+ return MI_CMD_DONE;
+ }
+ else
+ {
+ /* FIXME: DELETE THIS. */
+ fputs_unfiltered (parse->token, raw_stdout);
+ fputs_unfiltered ("^error,msg=\"", raw_stdout);
+ fputs_unfiltered ("Undefined mi command: ", raw_stdout);
+ fputstr_unfiltered (parse->command, '"', raw_stdout);
+ fputs_unfiltered (" (missing implementation)", raw_stdout);
+ fputs_unfiltered ("\"\n", raw_stdout);
+ return MI_CMD_ERROR;
+ }
+}
+
+static void
+mi_execute_command_wrapper (char *cmd)
+{
+ mi_execute_command (cmd, stdin == instream);
+}
+
+/* FIXME: This is just a hack so we can get some extra commands going.
+ We don't want to channel things through the CLI, but call libgdb directly */
+/* Use only for synchronous commands */
+
+void
+mi_execute_cli_command (const char *cli, char *args)
+{
+ if (cli != 0)
+ {
+ struct cleanup *old_cleanups;
+ char *run;
+ xasprintf (&run, cli, args);
+ if (mi_debug_p)
+ /* FIXME: gdb_???? */
+ fprintf_unfiltered (gdb_stdout, "cli=%s run=%s\n",
+ cli, run);
+ old_cleanups = make_cleanup (xfree, run);
+ execute_command ( /*ui */ run, 0 /*from_tty */ );
+ do_cleanups (old_cleanups);
+ return;
+ }
+}
+
+enum mi_cmd_result
+mi_execute_async_cli_command (char *mi, char *args, int from_tty)
+{
+ struct cleanup *old_cleanups;
+ char *run;
+ char *async_args;
+
+ if (target_can_async_p ())
+ {
+ async_args = (char *) xmalloc (strlen (args) + 2);
+ make_exec_cleanup (free, async_args);
+ strcpy (async_args, args);
+ strcat (async_args, "&");
+ xasprintf (&run, "%s %s", mi, async_args);
+ make_exec_cleanup (free, run);
+ add_continuation (mi_exec_async_cli_cmd_continuation, NULL);
+ old_cleanups = NULL;
+ }
+ else
+ {
+ xasprintf (&run, "%s %s", mi, args);
+ old_cleanups = make_cleanup (xfree, run);
+ }
+
+ if (!target_can_async_p ())
+ {
+ /* NOTE: For synchronous targets asynchronous behavour is faked by
+ printing out the GDB prompt before we even try to execute the
+ command. */
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("^running\n", raw_stdout);
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+ }
+ else
+ {
+ /* FIXME: cagney/1999-11-29: Printing this message before
+ calling execute_command is wrong. It should only be printed
+ once gdb has confirmed that it really has managed to send a
+ run command to the target. */
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("^running\n", raw_stdout);
+ }
+
+ execute_command ( /*ui */ run, 0 /*from_tty */ );
+
+ if (!target_can_async_p ())
+ {
+ /* Do this before doing any printing. It would appear that some
+ print code leaves garbage around in the buffer. */
+ do_cleanups (old_cleanups);
+ /* If the target was doing the operation synchronously we fake
+ the stopped message. */
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("*stopped", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ return MI_CMD_QUIET;
+ }
+ return MI_CMD_DONE;
+}
+
+void
+mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg)
+{
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("*stopped", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ fputs_unfiltered ("\n", raw_stdout);
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+ do_exec_cleanups (ALL_CLEANUPS);
+}
+
+static char *
+mi_input (char *buf)
+{
+ return gdb_readline (NULL);
+}
+
+static void
+mi_load_progress (const char *section_name,
+ unsigned long sent_so_far,
+ unsigned long total_section,
+ unsigned long total_sent,
+ unsigned long grand_total)
+{
+ struct timeval time_now, delta, update_threshold;
+ static struct timeval last_update;
+ static char *previous_sect_name = NULL;
+ int new_section;
+
+ if (!interpreter_p || strncmp (interpreter_p, "mi", 2) != 0)
+ return;
+
+ update_threshold.tv_sec = 0;
+ update_threshold.tv_usec = 500000;
+ gettimeofday (&time_now, NULL);
+
+ delta.tv_usec = time_now.tv_usec - last_update.tv_usec;
+ delta.tv_sec = time_now.tv_sec - last_update.tv_sec;
+
+ if (delta.tv_usec < 0)
+ {
+ delta.tv_sec -= 1;
+ delta.tv_usec += 1000000;
+ }
+
+ new_section = (previous_sect_name ?
+ strcmp (previous_sect_name, section_name) : 1);
+ if (new_section)
+ {
+ xfree (previous_sect_name);
+ previous_sect_name = xstrdup (section_name);
+
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("+download", raw_stdout);
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_string (uiout, "section", section_name);
+ ui_out_field_int (uiout, "section-size", total_section);
+ ui_out_field_int (uiout, "total-size", grand_total);
+ ui_out_tuple_end (uiout);
+ mi_out_put (uiout, raw_stdout);
+ fputs_unfiltered ("\n", raw_stdout);
+ gdb_flush (raw_stdout);
+ }
+
+ if (delta.tv_sec >= update_threshold.tv_sec &&
+ delta.tv_usec >= update_threshold.tv_usec)
+ {
+ last_update.tv_sec = time_now.tv_sec;
+ last_update.tv_usec = time_now.tv_usec;
+ if (last_async_command)
+ fputs_unfiltered (last_async_command, raw_stdout);
+ fputs_unfiltered ("+download", raw_stdout);
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_string (uiout, "section", section_name);
+ ui_out_field_int (uiout, "section-sent", sent_so_far);
+ ui_out_field_int (uiout, "section-size", total_section);
+ ui_out_field_int (uiout, "total-sent", total_sent);
+ ui_out_field_int (uiout, "total-size", grand_total);
+ ui_out_tuple_end (uiout);
+ mi_out_put (uiout, raw_stdout);
+ fputs_unfiltered ("\n", raw_stdout);
+ gdb_flush (raw_stdout);
+ }
+}
+
+static void
+mi_command_loop (int mi_version)
+{
+ /* HACK: Force stdout/stderr to point at the console. This avoids
+ any potential side effects caused by legacy code that is still
+ using the TUI / fputs_unfiltered_hook */
+ raw_stdout = stdio_fileopen (stdout);
+ /* Route normal output through the MIx */
+ gdb_stdout = mi_console_file_new (raw_stdout, "~");
+ /* Route error and log output through the MI */
+ gdb_stderr = mi_console_file_new (raw_stdout, "&");
+ gdb_stdlog = gdb_stderr;
+ /* Route target output through the MI. */
+ gdb_stdtarg = mi_console_file_new (raw_stdout, "@");
+
+ /* HACK: Poke the ui_out table directly. Should we be creating a
+ mi_out object wired up to the above gdb_stdout / gdb_stderr? */
+ uiout = mi_out_new (mi_version);
+
+ /* HACK: Override any other interpreter hooks. We need to create a
+ real event table and pass in that. */
+ init_ui_hook = 0;
+ /* command_loop_hook = 0; */
+ print_frame_info_listing_hook = 0;
+ query_hook = 0;
+ warning_hook = 0;
+ create_breakpoint_hook = 0;
+ delete_breakpoint_hook = 0;
+ modify_breakpoint_hook = 0;
+ interactive_hook = 0;
+ registers_changed_hook = 0;
+ readline_begin_hook = 0;
+ readline_hook = 0;
+ readline_end_hook = 0;
+ register_changed_hook = 0;
+ memory_changed_hook = 0;
+ context_hook = 0;
+ target_wait_hook = 0;
+ call_command_hook = 0;
+ error_hook = 0;
+ error_begin_hook = 0;
+ show_load_progress = mi_load_progress;
+
+ /* Turn off 8 bit strings in quoted output. Any character with the
+ high bit set is printed using C's octal format. */
+ sevenbit_strings = 1;
+
+ /* Tell the world that we're alive */
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+
+ if (!event_loop_p)
+ simplified_command_loop (mi_input, mi_execute_command);
+ else
+ start_event_loop ();
+}
+
+static void
+mi0_command_loop (void)
+{
+ mi_command_loop (0);
+}
+
+static void
+mi1_command_loop (void)
+{
+ mi_command_loop (1);
+}
+
+static void
+setup_architecture_data (void)
+{
+ /* don't trust REGISTER_BYTES to be zero. */
+ old_regs = xmalloc (REGISTER_BYTES + 1);
+ memset (old_regs, 0, REGISTER_BYTES + 1);
+}
+
+static void
+mi_init_ui (char *arg0)
+{
+ /* Eventually this will contain code that takes control of the
+ console. */
+}
+
+void
+_initialize_mi_main (void)
+{
+ if (interpreter_p == NULL)
+ return;
+
+ /* If we're _the_ interpreter, take control. */
+ if (strcmp (interpreter_p, "mi0") == 0)
+ command_loop_hook = mi0_command_loop;
+ else if (strcmp (interpreter_p, "mi") == 0
+ || strcmp (interpreter_p, "mi1") == 0)
+ command_loop_hook = mi1_command_loop;
+ else
+ return;
+
+ init_ui_hook = mi_init_ui;
+ setup_architecture_data ();
+ register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
+ register_gdbarch_swap (NULL, 0, setup_architecture_data);
+ if (event_loop_p)
+ {
+ /* These overwrite some of the initialization done in
+ _intialize_event_loop. */
+ call_readline = gdb_readline2;
+ input_handler = mi_execute_command_wrapper;
+ add_file_handler (input_fd, stdin_event_handler, 0);
+ async_command_editing_p = 0;
+ }
+ /* FIXME: Should we notify main that we are here as a possible
+ interpreter? */
+}
diff --git a/contrib/gdb/gdb/mi/mi-out.c b/contrib/gdb/gdb/mi/mi-out.c
new file mode 100644
index 0000000..a92ccbe
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-out.c
@@ -0,0 +1,456 @@
+/* MI Command Set - output generating routines.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "ui-out.h"
+#include "mi-out.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#ifndef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+#endif
+
+struct ui_out_data
+ {
+ int suppress_field_separator;
+ int suppress_output;
+ int mi_version;
+ struct ui_file *buffer;
+ };
+
+/* These are the MI output functions */
+
+static void mi_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows, const char *tblid);
+static void mi_table_body (struct ui_out *uiout);
+static void mi_table_end (struct ui_out *uiout);
+static void mi_table_header (struct ui_out *uiout, int width,
+ enum ui_align alig, const char *col_name,
+ const char *colhdr);
+static void mi_begin (struct ui_out *uiout, enum ui_out_type type,
+ int level, const char *id);
+static void mi_end (struct ui_out *uiout, enum ui_out_type type, int level);
+static void mi_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname, int value);
+static void mi_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname);
+static void mi_field_string (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig, const char *fldname,
+ const char *string);
+static void mi_field_fmt (struct ui_out *uiout, int fldno,
+ int width, enum ui_align align,
+ const char *fldname, const char *format,
+ va_list args);
+static void mi_spaces (struct ui_out *uiout, int numspaces);
+static void mi_text (struct ui_out *uiout, const char *string);
+static void mi_message (struct ui_out *uiout, int verbosity,
+ const char *format, va_list args);
+static void mi_wrap_hint (struct ui_out *uiout, char *identstring);
+static void mi_flush (struct ui_out *uiout);
+
+/* This is the MI ui-out implementation functions vector */
+
+/* FIXME: This can be initialized dynamically after default is set to
+ handle initial output in main.c */
+
+struct ui_out_impl mi_ui_out_impl =
+{
+ mi_table_begin,
+ mi_table_body,
+ mi_table_end,
+ mi_table_header,
+ mi_begin,
+ mi_end,
+ mi_field_int,
+ mi_field_skip,
+ mi_field_string,
+ mi_field_fmt,
+ mi_spaces,
+ mi_text,
+ mi_message,
+ mi_wrap_hint,
+ mi_flush,
+ 1, /* Needs MI hacks. */
+};
+
+/* Prototypes for local functions */
+
+extern void _initialize_mi_out (void);
+static void field_separator (struct ui_out *uiout);
+static void mi_open (struct ui_out *uiout, const char *name,
+ enum ui_out_type type);
+static void mi_close (struct ui_out *uiout, enum ui_out_type type);
+
+static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
+ char *format,...);
+
+/* Mark beginning of a table */
+
+void
+mi_table_begin (struct ui_out *uiout,
+ int nr_cols,
+ int nr_rows,
+ const char *tblid)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ mi_open (uiout, tblid, ui_out_type_tuple);
+ if (data->mi_version == 0)
+ {
+ if (nr_rows == 0)
+ data->suppress_output = 1;
+ else
+ mi_open (uiout, "hdr", ui_out_type_list);
+ return;
+ }
+ mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
+ "nr_rows", nr_rows);
+ mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
+ "nr_cols", nr_cols);
+ mi_open (uiout, "hdr", ui_out_type_list);
+}
+
+/* Mark beginning of a table body */
+
+void
+mi_table_body (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ /* close the table header line if there were any headers */
+ mi_close (uiout, ui_out_type_list);
+ if (data->mi_version == 0)
+ return;
+ mi_open (uiout, "body", ui_out_type_list);
+}
+
+/* Mark end of a table */
+
+void
+mi_table_end (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ data->suppress_output = 0;
+ if (data->mi_version == 0)
+ {
+ mi_close (uiout, ui_out_type_tuple);
+ return;
+ }
+ mi_close (uiout, ui_out_type_list); /* body */
+ mi_close (uiout, ui_out_type_tuple);
+}
+
+/* Specify table header */
+
+void
+mi_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+ const char *col_name,
+ const char *colhdr)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ if (data->mi_version == 0)
+ {
+ mi_field_string (uiout, 0, width, alignment, 0, colhdr);
+ return;
+ }
+ mi_open (uiout, NULL, ui_out_type_tuple);
+ mi_field_int (uiout, 0, 0, 0, "width", width);
+ mi_field_int (uiout, 0, 0, 0, "alignment", alignment);
+ mi_field_string (uiout, 0, 0, 0, "col_name", col_name);
+ mi_field_string (uiout, 0, width, alignment, "colhdr", colhdr);
+ mi_close (uiout, ui_out_type_tuple);
+}
+
+/* Mark beginning of a list */
+
+void
+mi_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level,
+ const char *id)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ mi_open (uiout, id, type);
+}
+
+/* Mark end of a list */
+
+void
+mi_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ mi_close (uiout, type);
+}
+
+/* output an int field */
+
+void
+mi_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alignment, const char *fldname, int value)
+{
+ char buffer[20]; /* FIXME: how many chars long a %d can become? */
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+
+ sprintf (buffer, "%d", value);
+ mi_field_string (uiout, fldno, width, alignment, fldname, buffer);
+}
+
+/* used to ommit a field */
+
+void
+mi_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alignment, const char *fldname)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ mi_field_string (uiout, fldno, width, alignment, fldname, "");
+}
+
+/* other specific mi_field_* end up here so alignment and field
+ separators are both handled by mi_field_string */
+
+void
+mi_field_string (struct ui_out *uiout,
+ int fldno,
+ int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ field_separator (uiout);
+ if (fldname)
+ fprintf_unfiltered (data->buffer, "%s=", fldname);
+ fprintf_unfiltered (data->buffer, "\"");
+ if (string)
+ fputstr_unfiltered (string, '"', data->buffer);
+ fprintf_unfiltered (data->buffer, "\"");
+}
+
+/* This is the only field function that does not align */
+
+void
+mi_field_fmt (struct ui_out *uiout, int fldno,
+ int width, enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_output)
+ return;
+ field_separator (uiout);
+ if (fldname)
+ fprintf_unfiltered (data->buffer, "%s=\"", fldname);
+ else
+ fputs_unfiltered ("\"", data->buffer);
+ vfprintf_unfiltered (data->buffer, format, args);
+ fputs_unfiltered ("\"", data->buffer);
+}
+
+void
+mi_spaces (struct ui_out *uiout, int numspaces)
+{
+}
+
+void
+mi_text (struct ui_out *uiout, const char *string)
+{
+}
+
+void
+mi_message (struct ui_out *uiout, int verbosity,
+ const char *format,
+ va_list args)
+{
+}
+
+void
+mi_wrap_hint (struct ui_out *uiout, char *identstring)
+{
+ wrap_here (identstring);
+}
+
+void
+mi_flush (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ gdb_flush (data->buffer);
+}
+
+/* local functions */
+
+/* Like mi_field_fmt, but takes a variable number of args
+ and makes a va_list and does not insert a separator */
+
+/* VARARGS */
+static void
+out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
+ char *format,...)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ va_list args;
+
+ field_separator (uiout);
+ if (fldname)
+ fprintf_unfiltered (data->buffer, "%s=\"", fldname);
+ else
+ fputs_unfiltered ("\"", data->buffer);
+
+ va_start (args, format);
+ vfprintf_unfiltered (data->buffer, format, args);
+
+ fputs_unfiltered ("\"", data->buffer);
+
+ va_end (args);
+}
+
+/* access to ui_out format private members */
+
+static void
+field_separator (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ if (data->suppress_field_separator)
+ data->suppress_field_separator = 0;
+ else
+ fputc_unfiltered (',', data->buffer);
+}
+
+static void
+mi_open (struct ui_out *uiout,
+ const char *name,
+ enum ui_out_type type)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ field_separator (uiout);
+ data->suppress_field_separator = 1;
+ if (name)
+ fprintf_unfiltered (data->buffer, "%s=", name);
+ switch (type)
+ {
+ case ui_out_type_tuple:
+ fputc_unfiltered ('{', data->buffer);
+ break;
+ case ui_out_type_list:
+ if (data->mi_version == 0)
+ fputc_unfiltered ('{', data->buffer);
+ else
+ fputc_unfiltered ('[', data->buffer);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+}
+
+static void
+mi_close (struct ui_out *uiout,
+ enum ui_out_type type)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ switch (type)
+ {
+ case ui_out_type_tuple:
+ fputc_unfiltered ('}', data->buffer);
+ break;
+ case ui_out_type_list:
+ if (data->mi_version == 0)
+ fputc_unfiltered ('}', data->buffer);
+ else
+ fputc_unfiltered (']', data->buffer);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ data->suppress_field_separator = 0;
+}
+
+/* add a string to the buffer */
+
+void
+mi_out_buffered (struct ui_out *uiout, char *string)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ fprintf_unfiltered (data->buffer, "%s", string);
+}
+
+/* clear the buffer */
+
+void
+mi_out_rewind (struct ui_out *uiout)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ ui_file_rewind (data->buffer);
+}
+
+/* dump the buffer onto the specified stream */
+
+static void
+do_write (void *data, const char *buffer, long length_buffer)
+{
+ ui_file_write (data, buffer, length_buffer);
+}
+
+void
+mi_out_put (struct ui_out *uiout,
+ struct ui_file *stream)
+{
+ struct ui_out_data *data = ui_out_data (uiout);
+ ui_file_put (data->buffer, do_write, stream);
+ ui_file_rewind (data->buffer);
+}
+
+/* initalize private members at startup */
+
+struct ui_out *
+mi_out_new (int mi_version)
+{
+ int flags = 0;
+ struct ui_out_data *data = XMALLOC (struct ui_out_data);
+ data->suppress_field_separator = 0;
+ data->suppress_output = 0;
+ data->mi_version = mi_version;
+ /* FIXME: This code should be using a ``string_file'' and not the
+ TUI buffer hack. */
+ data->buffer = mem_fileopen ();
+ return ui_out_new (&mi_ui_out_impl, data, flags);
+}
+
+/* standard gdb initialization hook */
+void
+_initialize_mi_out (void)
+{
+ /* nothing happens here */
+}
diff --git a/contrib/gdb/gdb/mi/mi-out.h b/contrib/gdb/gdb/mi/mi-out.h
new file mode 100644
index 0000000..1ae693f
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-out.h
@@ -0,0 +1,33 @@
+/* MI Command Set - MI output generating routines for GDB.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MI_OUT_H
+#define MI_OUT_H 1
+
+struct ui_out;
+struct ui_file;
+
+extern struct ui_out *mi_out_new (int mi_version);
+extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream);
+extern void mi_out_rewind (struct ui_out *uiout);
+extern void mi_out_buffered (struct ui_out *uiout, char *string);
+
+#endif /* MI_OUT_H */
diff --git a/contrib/gdb/gdb/mi/mi-parse.c b/contrib/gdb/gdb/mi/mi-parse.c
new file mode 100644
index 0000000..2ed49b8
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-parse.c
@@ -0,0 +1,239 @@
+/* MI Command Set - MI parser.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "mi-cmds.h"
+#include "mi-parse.h"
+
+#include <ctype.h>
+#include "gdb_string.h"
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+static void
+mi_parse_argv (char *args, struct mi_parse *parse)
+{
+ char *chp = args;
+ int argc = 0;
+ char **argv = xmalloc ((argc + 1) * sizeof (char *));
+ argv[argc] = NULL;
+ while (1)
+ {
+ char *arg;
+ /* skip leading white space */
+ while (isspace (*chp))
+ chp++;
+ /* Three possibilities: EOF, quoted string, or other text. */
+ switch (*chp)
+ {
+ case '\0':
+ parse->argv = argv;
+ parse->argc = argc;
+ return;
+ case '"':
+ {
+ /* A quoted string. */
+ int len;
+ char *start = chp + 1;
+ /* Determine the buffer size. */
+ chp = start;
+ len = 0;
+ while (*chp != '\0' && *chp != '"')
+ {
+ if (*chp == '\\')
+ {
+ chp++;
+ if (parse_escape (&chp) <= 0)
+ {
+ /* Do not allow split lines or "\000" */
+ freeargv (argv);
+ return;
+ }
+ }
+ else
+ chp++;
+ len++;
+ }
+ /* Insist on a closing quote. */
+ if (*chp != '"')
+ {
+ freeargv (argv);
+ return;
+ }
+ /* Insist on trailing white space. */
+ if (chp[1] != '\0' && !isspace (chp[1]))
+ {
+ freeargv (argv);
+ return;
+ }
+ /* create the buffer. */
+ arg = xmalloc ((len + 1) * sizeof (char));
+ /* And copy the characters in. */
+ chp = start;
+ len = 0;
+ while (*chp != '\0' && *chp != '"')
+ {
+ if (*chp == '\\')
+ {
+ chp++;
+ arg[len] = parse_escape (&chp);
+ }
+ else
+ arg[len] = *chp++;
+ len++;
+ }
+ arg[len] = '\0';
+ chp++; /* that closing quote. */
+ break;
+ }
+ default:
+ {
+ /* An unquoted string. Accumulate all non blank
+ characters into a buffer. */
+ int len;
+ char *start = chp;
+ while (*chp != '\0' && !isspace (*chp))
+ {
+ chp++;
+ }
+ len = chp - start;
+ arg = xmalloc ((len + 1) * sizeof (char));
+ strncpy (arg, start, len);
+ arg[len] = '\0';
+ break;
+ }
+ }
+ /* Append arg to argv. */
+ argv = xrealloc (argv, (argc + 2) * sizeof (char *));
+ argv[argc++] = arg;
+ argv[argc] = NULL;
+ }
+}
+
+
+void
+mi_parse_free (struct mi_parse *parse)
+{
+ if (parse == NULL)
+ return;
+ if (parse->command != NULL)
+ xfree (parse->command);
+ if (parse->token != NULL)
+ xfree (parse->token);
+ if (parse->args != NULL)
+ xfree (parse->args);
+ if (parse->argv != NULL)
+ freeargv (parse->argv);
+ xfree (parse);
+}
+
+
+struct mi_parse *
+mi_parse (char *cmd)
+{
+ char *chp;
+ struct mi_parse *parse = XMALLOC (struct mi_parse);
+ memset (parse, 0, sizeof (*parse));
+
+ /* Before starting, skip leading white space. */
+ while (isspace (*cmd))
+ cmd++;
+
+ /* Find/skip any token and then extract it. */
+ for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++)
+ ;
+ parse->token = xmalloc ((chp - cmd + 1) * sizeof (char *));
+ memcpy (parse->token, cmd, (chp - cmd));
+ parse->token[chp - cmd] = '\0';
+
+ /* This wasn't a real MI command. Return it as a CLI_COMMAND. */
+ if (*chp != '-')
+ {
+ while (isspace (*chp))
+ chp++;
+ parse->command = xstrdup (chp);
+ parse->op = CLI_COMMAND;
+ return parse;
+ }
+
+ /* Extract the command. */
+ {
+ char *tmp = chp + 1; /* discard ``-'' */
+ for (; *chp && !isspace (*chp); chp++)
+ ;
+ parse->command = xmalloc ((chp - tmp + 1) * sizeof (char *));
+ memcpy (parse->command, tmp, chp - tmp);
+ parse->command[chp - tmp] = '\0';
+ }
+
+ /* Find the command in the MI table. */
+ parse->cmd = mi_lookup (parse->command);
+ if (parse->cmd == NULL)
+ {
+ /* FIXME: This should be a function call. */
+ fprintf_unfiltered
+ (raw_stdout,
+ "%s^error,msg=\"Undefined MI command: %s\"\n",
+ parse->token, parse->command);
+ mi_parse_free (parse);
+ return NULL;
+ }
+
+ /* Skip white space following the command. */
+ while (isspace (*chp))
+ chp++;
+
+ /* For new argv commands, attempt to return the parsed argument
+ list. */
+ if (parse->cmd->argv_func != NULL)
+ {
+ mi_parse_argv (chp, parse);
+ if (parse->argv == NULL)
+ {
+ /* FIXME: This should be a function call. */
+ fprintf_unfiltered
+ (raw_stdout,
+ "%s^error,msg=\"Problem parsing arguments: %s %s\"\n",
+ parse->token, parse->command, chp);
+ mi_parse_free (parse);
+ return NULL;
+ }
+ }
+
+ /* FIXME: DELETE THIS */
+ /* For CLI and old ARGS commands, also return the remainder of the
+ command line as a single string. */
+ if (parse->cmd->args_func != NULL
+ || parse->cmd->cli != NULL)
+ {
+ parse->args = xstrdup (chp);
+ }
+
+ /* Fully parsed. */
+ parse->op = MI_COMMAND;
+ return parse;
+}
+
+void
+_initialize_mi_parse (void)
+{
+}
diff --git a/contrib/gdb/gdb/mi/mi-parse.h b/contrib/gdb/gdb/mi/mi-parse.h
new file mode 100644
index 0000000..ae9f181
--- /dev/null
+++ b/contrib/gdb/gdb/mi/mi-parse.h
@@ -0,0 +1,55 @@
+/* MI Command Set - MI Command Parser.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions (a Red Hat company).
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef MI_PARSE_H
+#define MI_PARSE_H
+
+/* MI parser */
+
+enum mi_command_type
+ {
+ MI_COMMAND, CLI_COMMAND
+ };
+
+struct mi_parse
+ {
+ enum mi_command_type op;
+ char *command;
+ char *token;
+ const struct mi_cmd *cmd;
+ char *args;
+ char **argv;
+ int argc;
+ };
+
+/* Attempts to parse CMD returning a ``struct mi_command''. If CMD is
+ invalid, an error mesage is reported (MI format) and NULL is
+ returned. For a CLI_COMMAND, COMMAND, TOKEN and OP are initialized.
+ For an MI_COMMAND COMMAND, TOKEN, ARGS and OP are
+ initialized. Un-initialized fields are zero. */
+
+extern struct mi_parse *mi_parse (char *cmd);
+
+/* Free a command returned by mi_parse_command. */
+
+extern void mi_parse_free (struct mi_parse *cmd);
+
+#endif
diff --git a/contrib/gdb/gdb/minsyms.c b/contrib/gdb/gdb/minsyms.c
index a271c91..a4997bf 100644
--- a/contrib/gdb/gdb/minsyms.c
+++ b/contrib/gdb/gdb/minsyms.c
@@ -1,22 +1,24 @@
/* GDB routines for manipulating the minimal symbol tables.
- Copyright 1992, 93, 94, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ 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 +32,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
@@ -38,13 +40,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include <ctype.h>
#include "gdb_string.h"
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "demangle.h"
-#include "gdb-stabs.h"
+#include "value.h"
+#include "cp-abi.h"
/* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
At the end, copy them all into one newly allocated location on an objfile's
@@ -53,10 +57,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. */
@@ -71,13 +75,63 @@ static int msym_bunch_index;
static int msym_count;
-/* Prototypes for local functions. */
+/* Compute a hash code based using the same criteria as `strcmp_iw'. */
-static int
-compare_minimal_symbols PARAMS ((const void *, const void *));
+unsigned int
+msymbol_hash_iw (const char *string)
+{
+ unsigned int hash = 0;
+ while (*string && *string != '(')
+ {
+ while (isspace (*string))
+ ++string;
+ if (*string && *string != '(')
+ {
+ hash = hash * 67 + *string - 113;
+ ++string;
+ }
+ }
+ return hash % MINIMAL_SYMBOL_HASH_SIZE;
+}
+
+/* Compute a hash code for a string. */
+
+unsigned int
+msymbol_hash (const char *string)
+{
+ unsigned int hash = 0;
+ for (; *string; ++string)
+ hash = hash * 67 + *string - 113;
+ return hash % MINIMAL_SYMBOL_HASH_SIZE;
+}
+
+/* Add the minimal symbol SYM to an objfile's minsym hash table, TABLE. */
+void
+add_minsym_to_hash_table (struct minimal_symbol *sym,
+ struct minimal_symbol **table)
+{
+ if (sym->hash_next == NULL)
+ {
+ unsigned int hash = msymbol_hash (SYMBOL_NAME (sym));
+ sym->hash_next = table[hash];
+ table[hash] = sym;
+ }
+}
+
+/* Add the minimal symbol SYM to an objfile's minsym demangled hash table,
+ TABLE. */
+static void
+add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
+ struct minimal_symbol **table)
+{
+ if (sym->demangled_hash_next == NULL)
+ {
+ unsigned int hash = msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym));
+ sym->demangled_hash_next = table[hash];
+ table[hash] = sym;
+ }
+}
-static int
-compact_minimal_symbols PARAMS ((struct minimal_symbol *, int));
/* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME. If OBJF is non-NULL, limit
@@ -91,10 +145,8 @@ compact_minimal_symbols PARAMS ((struct minimal_symbol *, int));
names (the dynamic linker deals with the duplication). */
struct minimal_symbol *
-lookup_minimal_symbol (name, sfile, objf)
- register const char *name;
- const char *sfile;
- struct objfile *objf;
+lookup_minimal_symbol (register const char *name, const char *sfile,
+ struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -102,6 +154,9 @@ lookup_minimal_symbol (name, sfile, objf)
struct minimal_symbol *found_file_symbol = NULL;
struct minimal_symbol *trampoline_symbol = NULL;
+ unsigned int hash = msymbol_hash (name);
+ unsigned int dem_hash = msymbol_hash_iw (name);
+
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
if (sfile != NULL)
{
@@ -113,50 +168,66 @@ 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;
- msymbol != NULL && SYMBOL_NAME (msymbol) != NULL &&
- found_symbol == NULL;
- msymbol++)
+ /* Do two passes: the first over the ordinary hash table,
+ and the second over the demangled hash table. */
+ int pass;
+
+ for (pass = 1; pass <= 2 && found_symbol == NULL; pass++)
{
- if (SYMBOL_MATCHES_NAME (msymbol, name))
+ /* Select hash list according to pass. */
+ if (pass == 1)
+ msymbol = objfile->msymbol_hash[hash];
+ else
+ msymbol = objfile->msymbol_demangled_hash[dem_hash];
+
+ while (msymbol != NULL && found_symbol == NULL)
{
- switch (MSYMBOL_TYPE (msymbol))
+ if (SYMBOL_MATCHES_NAME (msymbol, name))
{
- case mst_file_text:
- case mst_file_data:
- case mst_file_bss:
+ switch (MSYMBOL_TYPE (msymbol))
+ {
+ case mst_file_text:
+ case mst_file_data:
+ case mst_file_bss:
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
- if (sfile == NULL || STREQ (msymbol->filename, sfile))
- found_file_symbol = msymbol;
+ if (sfile == NULL || STREQ (msymbol->filename, sfile))
+ 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). */
- found_file_symbol = msymbol;
+ /* 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). */
+ found_file_symbol = msymbol;
#endif
- break;
-
- 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. */
- if (trampoline_symbol == NULL)
- trampoline_symbol = msymbol;
- break;
-
- case mst_unknown:
- default:
- found_symbol = msymbol;
- break;
+ break;
+
+ 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. */
+ if (trampoline_symbol == NULL)
+ trampoline_symbol = msymbol;
+ break;
+
+ case mst_unknown:
+ default:
+ found_symbol = msymbol;
+ break;
+ }
}
+
+ /* Find the next symbol on the hash chain. */
+ if (pass == 1)
+ msymbol = msymbol->hash_next;
+ else
+ msymbol = msymbol->demangled_hash_next;
}
}
}
@@ -182,13 +253,11 @@ 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;
- const char *sfile;
- struct objfile *objf;
+lookup_minimal_symbol_text (register const char *name, const char *sfile,
+ struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -206,16 +275,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 +296,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,13 +328,11 @@ 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;
- const char *sfile;
- struct objfile *objf;
+lookup_minimal_symbol_solib_trampoline (register const char *name,
+ const char *sfile, struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -282,16 +349,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;
}
@@ -313,9 +380,7 @@ lookup_minimal_symbol_solib_trampoline (name, sfile, objf)
0x40000 and objfile B has .text at 0x234 and .data at 0x40048. */
struct minimal_symbol *
-lookup_minimal_symbol_by_pc_section (pc, section)
- CORE_ADDR pc;
- asection *section;
+lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section)
{
int lo;
int hi;
@@ -332,18 +397,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 +448,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;
@@ -411,12 +476,16 @@ lookup_minimal_symbol_by_pc_section (pc, section)
/* This is the new code that distinguishes it from the old function */
if (section)
while (hi >= 0
+ /* Some types of debug info, such as COFF,
+ don't fill the bfd_section member, so don't
+ throw away symbols on those platforms. */
+ && SYMBOL_BFD_SECTION (&msymbol[hi]) != NULL
&& SYMBOL_BFD_SECTION (&msymbol[hi]) != section)
--hi;
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];
@@ -431,18 +500,15 @@ lookup_minimal_symbol_by_pc_section (pc, section)
for a matching PC (no section given) */
struct minimal_symbol *
-lookup_minimal_symbol_by_pc (pc)
- CORE_ADDR pc;
+lookup_minimal_symbol_by_pc (CORE_ADDR pc)
{
return lookup_minimal_symbol_by_pc_section (pc, find_pc_mapped_section (pc));
}
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
CORE_ADDR
-find_stab_function_addr (namestring, pst, objfile)
- char *namestring;
- struct partial_symtab *pst;
- struct objfile *objfile;
+find_stab_function_addr (char *namestring, char *filename,
+ struct objfile *objfile)
{
struct minimal_symbol *msym;
char *p;
@@ -456,29 +522,43 @@ find_stab_function_addr (namestring, pst, objfile)
strncpy (p, namestring, n);
p[n] = 0;
- msym = lookup_minimal_symbol (p, pst->filename, objfile);
+ msym = lookup_minimal_symbol (p, filename, 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, filename, objfile);
+ }
+
+ if (msym == NULL && filename != NULL)
+ {
+ /* Try again without the filename. */
+ p[n] = 0;
+ msym = lookup_minimal_symbol (p, NULL, objfile);
+ }
+ if (msym == NULL && filename != NULL)
+ {
+ /* And try again for Sun Fortran, but without the filename. */
p[n] = '_';
p[n + 1] = 0;
- msym = lookup_minimal_symbol (p, pst->filename, objfile);
+ msym = lookup_minimal_symbol (p, NULL, objfile);
}
+
return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
}
#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
-
+
/* Return leading symbol character for a BFD. If BFD is NULL,
return the leading symbol character from the main objfile. */
-static int get_symbol_leading_char PARAMS ((bfd *));
+static int get_symbol_leading_char (bfd *);
static int
-get_symbol_leading_char (abfd)
- bfd * abfd;
+get_symbol_leading_char (bfd *abfd)
{
if (abfd != NULL)
return bfd_get_symbol_leading_char (abfd);
@@ -492,7 +572,7 @@ get_symbol_leading_char (abfd)
symbol to allocate the memory for the first bunch. */
void
-init_minimal_symbol_collection ()
+init_minimal_symbol_collection (void)
{
msym_count = 0;
msym_bunch = NULL;
@@ -500,11 +580,9 @@ init_minimal_symbol_collection ()
}
void
-prim_record_minimal_symbol (name, address, ms_type, objfile)
- const char *name;
- CORE_ADDR address;
- enum minimal_symbol_type ms_type;
- struct objfile *objfile;
+prim_record_minimal_symbol (const char *name, CORE_ADDR address,
+ enum minimal_symbol_type ms_type,
+ struct objfile *objfile)
{
int section;
@@ -513,15 +591,15 @@ prim_record_minimal_symbol (name, address, ms_type, objfile)
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
- section = SECT_OFF_TEXT;
+ section = SECT_OFF_TEXT (objfile);
break;
case mst_data:
case mst_file_data:
- section = SECT_OFF_DATA;
+ section = SECT_OFF_DATA (objfile);
break;
case mst_bss:
case mst_file_bss:
- section = SECT_OFF_BSS;
+ section = SECT_OFF_BSS (objfile);
break;
default:
section = -1;
@@ -535,15 +613,11 @@ prim_record_minimal_symbol (name, address, ms_type, objfile)
newly created. */
struct minimal_symbol *
-prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
- bfd_section, objfile)
- const char *name;
- CORE_ADDR address;
- enum minimal_symbol_type ms_type;
- char *info;
- int section;
- asection *bfd_section;
- struct objfile *objfile;
+prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
+ enum minimal_symbol_type ms_type,
+ char *info, int section,
+ asection *bfd_section,
+ struct objfile *objfile)
{
register struct msym_bunch *new;
register struct minimal_symbol *msymbol;
@@ -551,10 +625,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 +647,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 +660,13 @@ 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! */
+
+ /* The hash pointers must be cleared! If they're not,
+ add_minsym_to_hash_table will NOT add this msymbol to the hash table. */
+ msymbol->hash_next = NULL;
+ msymbol->demangled_hash_next = NULL;
+
msym_bunch_index++;
msym_count++;
OBJSTAT (objfile, n_minsyms++);
@@ -598,9 +678,7 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
Within groups with the same address, sort by name. */
static int
-compare_minimal_symbols (fn1p, fn2p)
- const PTR fn1p;
- const PTR fn2p;
+compare_minimal_symbols (const void *fn1p, const void *fn2p)
{
register const struct minimal_symbol *fn1;
register const struct minimal_symbol *fn2;
@@ -610,13 +688,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 +703,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. */
}
}
@@ -640,21 +719,27 @@ compare_minimal_symbols (fn1p, fn2p)
obstack and then simply blow the obstack away when we are done with
it. Is it worth the extra trouble though? */
-/* ARGSUSED */
-void
-discard_minimal_symbols (foo)
- int foo;
+static void
+do_discard_minimal_symbols_cleanup (void *arg)
{
register struct msym_bunch *next;
while (msym_bunch != NULL)
{
- next = msym_bunch -> next;
- free ((PTR)msym_bunch);
+ next = msym_bunch->next;
+ xfree (msym_bunch);
msym_bunch = next;
}
}
+struct cleanup *
+make_cleanup_discard_minimal_symbols (void)
+{
+ return make_cleanup (do_discard_minimal_symbols_cleanup, 0);
+}
+
+
+
/* Compact duplicate entries out of a minimal symbol table by walking
through the table and compacting out entries with duplicate addresses
and matching names. Return the number of entries remaining.
@@ -692,9 +777,8 @@ discard_minimal_symbols (foo)
overwrite its type with the type from the one we are compacting out. */
static int
-compact_minimal_symbols (msymbol, mcount)
- struct minimal_symbol *msymbol;
- int mcount;
+compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
+ struct objfile *objfile)
{
struct minimal_symbol *copyfrom;
struct minimal_symbol *copyto;
@@ -704,20 +788,18 @@ 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);
}
copyfrom++;
}
else
- {
- *copyto++ = *copyfrom++;
- }
+ *copyto++ = *copyfrom++;
}
*copyto++ = *copyfrom++;
mcount = copyto - msymbol;
@@ -725,6 +807,38 @@ compact_minimal_symbols (msymbol, mcount)
return (mcount);
}
+/* Build (or rebuild) the minimal symbol hash tables. This is necessary
+ after compacting or sorting the table since the entries move around
+ thus causing the internal minimal_symbol pointers to become jumbled. */
+
+static void
+build_minimal_symbol_hash_tables (struct objfile *objfile)
+{
+ int i;
+ struct minimal_symbol *msym;
+
+ /* Clear the hash tables. */
+ for (i = 0; i < MINIMAL_SYMBOL_HASH_SIZE; i++)
+ {
+ objfile->msymbol_hash[i] = 0;
+ objfile->msymbol_demangled_hash[i] = 0;
+ }
+
+ /* Now, (re)insert the actual entries. */
+ for (i = objfile->minimal_symbol_count, msym = objfile->msymbols;
+ i > 0;
+ i--, msym++)
+ {
+ msym->hash_next = 0;
+ add_minsym_to_hash_table (msym, objfile->msymbol_hash);
+
+ msym->demangled_hash_next = 0;
+ if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
+ add_minsym_to_demangled_hash_table (msym,
+ objfile->msymbol_demangled_hash);
+ }
+}
+
/* Add the minimal symbols in the existing bunches to the objfile's official
minimal symbol table. In most cases there is no minimal symbol table yet
for this objfile, and the existing bunches are used to create one. Once
@@ -749,8 +863,7 @@ compact_minimal_symbols (msymbol, mcount)
attempts to demangle them if we later add more minimal symbols. */
void
-install_minimal_symbols (objfile)
- struct objfile *objfile;
+install_minimal_symbols (struct objfile *objfile)
{
register int bindex;
register int mcount;
@@ -762,67 +875,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. */
-
- mcount = compact_minimal_symbols (msymbols, mcount);
+ no longer using. */
+
+ mcount = compact_minimal_symbols (msymbols, mcount, objfile);
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,30 +944,49 @@ 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;
+ /* Try to guess the appropriate C++ ABI by looking at the names
+ of the minimal symbols in the table. */
+ {
+ int i;
+
+ for (i = 0; i < mcount; i++)
+ {
+ const char *name = SYMBOL_NAME (&objfile->msymbols[i]);
+ if (name[0] == '_' && name[1] == 'Z')
+ {
+ switch_to_cp_abi ("gnu-v3");
+ break;
+ }
+ }
+ }
+
/* Now walk through all the minimal symbols, selecting the newly added
- ones and attempting to cache their C++ demangled names. */
-
- for ( ; mcount-- > 0 ; msymbols++)
- {
- SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
- }
+ ones and attempting to cache their C++ demangled names. */
+ for (; mcount-- > 0; msymbols++)
+ SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
+
+ /* Now build the hash tables; we can't do this incrementally
+ at an earlier point since we weren't finished with the obstack
+ yet. (And if the msymbol obstack gets moved, all the internal
+ pointers to other msymbols need to be adjusted.) */
+ build_minimal_symbol_hash_tables (objfile);
}
}
/* Sort all the minimal symbols in OBJFILE. */
void
-msymbols_sort (objfile)
- struct objfile *objfile;
+msymbols_sort (struct objfile *objfile)
{
qsort (objfile->msymbols, objfile->minimal_symbol_count,
sizeof (struct minimal_symbol), compare_minimal_symbols);
+ build_minimal_symbol_hash_tables (objfile);
}
/* Check if PC is in a shared library trampoline code stub.
@@ -862,8 +994,7 @@ msymbols_sort (objfile)
in a trampoline code stub. */
struct minimal_symbol *
-lookup_solib_trampoline_symbol_by_pc (pc)
- CORE_ADDR pc;
+lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc)
{
struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc);
@@ -883,8 +1014,7 @@ lookup_solib_trampoline_symbol_by_pc (pc)
a duplicate function in case this matters someday. */
CORE_ADDR
-find_solib_trampoline_target (pc)
- CORE_ADDR pc;
+find_solib_trampoline_target (CORE_ADDR pc)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -893,12 +1023,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;
}
-
diff --git a/contrib/gdb/gdb/mipsread.c b/contrib/gdb/gdb/mipsread.c
index 614c27e..1f869f4 100644
--- a/contrib/gdb/gdb/mipsread.c
+++ b/contrib/gdb/gdb/mipsread.c
@@ -1,24 +1,26 @@
/* Read a symbol table in MIPS' format (Third-Eye).
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 1998
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
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. */
@@ -31,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "objfiles.h"
#include "buildsym.h"
#include "stabsread.h"
-#include "gdb-stabs.h"
#include "coff/sym.h"
#include "coff/internal.h"
@@ -41,22 +42,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf/common.h"
#include "elf/mips.h"
-static void
-mipscoff_new_init PARAMS ((struct objfile *));
+extern void _initialize_mipsread (void);
-static void
-mipscoff_symfile_init PARAMS ((struct objfile *));
+static void mipscoff_new_init (struct objfile *);
-static void
-mipscoff_symfile_read PARAMS ((struct objfile *, struct section_offsets *,
- int));
+static void mipscoff_symfile_init (struct objfile *);
-static void
-mipscoff_symfile_finish PARAMS ((struct objfile *));
+static void mipscoff_symfile_read (struct objfile *, int);
+
+static void mipscoff_symfile_finish (struct objfile *);
static void
-read_alphacoff_dynamic_symtab PARAMS ((struct section_offsets *,
- struct objfile *objfile));
+read_alphacoff_dynamic_symtab (struct section_offsets *,
+ struct objfile *objfile);
/* Initialize anything that needs initializing when a completely new
symbol file is specified (not just adding some symbols from another
@@ -65,8 +63,7 @@ read_alphacoff_dynamic_symtab PARAMS ((struct section_offsets *,
extern CORE_ADDR sigtramp_address;
static void
-mipscoff_new_init (ignore)
- struct objfile *ignore;
+mipscoff_new_init (struct objfile *ignore)
{
sigtramp_address = 0;
stabsread_new_init ();
@@ -76,24 +73,20 @@ mipscoff_new_init (ignore)
/* Initialize to read a symbol file (nothing to do). */
static void
-mipscoff_symfile_init (objfile)
- struct objfile *objfile;
+mipscoff_symfile_init (struct objfile *objfile)
{
}
/* Read a symbol file from a file. */
static void
-mipscoff_symfile_read (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+mipscoff_symfile_read (struct objfile *objfile, 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);
+ back_to = make_cleanup_discard_minimal_symbols ();
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
@@ -103,11 +96,11 @@ mipscoff_symfile_read (objfile, section_offsets, mainline)
error ("Error reading symbol table: %s", bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
- &ecoff_data (abfd)->debug_info, section_offsets);
+ &ecoff_data (abfd)->debug_info);
/* Add alpha coff dynamic symbols. */
- read_alphacoff_dynamic_symtab (section_offsets, objfile);
+ read_alphacoff_dynamic_symtab (objfile->section_offsets, objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
@@ -139,8 +132,7 @@ mipscoff_symfile_read (objfile, section_offsets, mainline)
particular objfile. */
static void
-mipscoff_symfile_finish (objfile)
- struct objfile *objfile;
+mipscoff_symfile_finish (struct objfile *objfile)
{
}
@@ -156,38 +148,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 */
-};
-
-static void
-alphacoff_locate_sections PARAMS ((bfd *, asection *, void *));
+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 */
+ };
/* We are called once per section from read_alphacoff_dynamic_symtab.
We need to examine each section we are passed, check to see
@@ -195,10 +191,7 @@ alphacoff_locate_sections PARAMS ((bfd *, asection *, void *));
if so, stash away some access information for the section. */
static void
-alphacoff_locate_sections (ignore_abfd, sectp, sip)
- bfd *ignore_abfd;
- asection *sectp;
- PTR sip;
+alphacoff_locate_sections (bfd *ignore_abfd, asection *sectp, void *sip)
{
register struct alphacoff_dynsecinfo *si;
@@ -226,9 +219,8 @@ alphacoff_locate_sections (ignore_abfd, sectp, sip)
add them to the minimal symbol table. */
static void
-read_alphacoff_dynamic_symtab (section_offsets, objfile)
- struct section_offsets *section_offsets;
- struct objfile *objfile;
+read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
+ struct objfile *objfile)
{
bfd *abfd = objfile->obfd;
struct alphacoff_dynsecinfo si;
@@ -249,6 +241,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
int got_entry_size = 8;
int dt_mips_local_gotno = -1;
int dt_mips_gotsym = -1;
+ struct cleanup *cleanups;
/* We currently only know how to handle alpha dynamic symbols. */
@@ -257,7 +250,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, (void *) & si);
if (si.sym_sect == NULL
|| si.str_sect == NULL
|| si.dyninfo_sect == NULL
@@ -268,22 +261,26 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
str_secsize = bfd_get_section_size_before_reloc (si.str_sect);
dyninfo_secsize = bfd_get_section_size_before_reloc (si.dyninfo_sect);
got_secsize = bfd_get_section_size_before_reloc (si.got_sect);
- sym_secptr = alloca (sym_secsize);
- str_secptr = alloca (str_secsize);
- dyninfo_secptr = alloca (dyninfo_secsize);
- got_secptr = alloca (got_secsize);
+ sym_secptr = xmalloc (sym_secsize);
+ cleanups = make_cleanup (free, sym_secptr);
+ str_secptr = xmalloc (str_secsize);
+ make_cleanup (free, str_secptr);
+ dyninfo_secptr = xmalloc (dyninfo_secsize);
+ make_cleanup (free, dyninfo_secptr);
+ got_secptr = xmalloc (got_secsize);
+ make_cleanup (free, got_secptr);
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
@@ -292,7 +289,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);
@@ -369,7 +366,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;
@@ -394,7 +391,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
ms_type = mst_text;
else
ms_type = mst_file_text;
- sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+ sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
}
else if (sym_shndx == SHN_MIPS_DATA)
{
@@ -402,7 +399,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
ms_type = mst_data;
else
ms_type = mst_file_data;
- sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA);
+ sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
}
else if (sym_shndx == SHN_MIPS_ACOMMON)
{
@@ -410,7 +407,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
ms_type = mst_bss;
else
ms_type = mst_file_bss;
- sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS);
+ sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
}
else if (sym_shndx == SHN_ABS)
{
@@ -424,6 +421,8 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
prim_record_minimal_symbol (name, sym_value, ms_type, objfile);
}
+
+ do_cleanups (cleanups);
}
/* Initialization */
@@ -440,7 +439,7 @@ static struct sym_fns ecoff_sym_fns =
};
void
-_initialize_mipsread ()
+_initialize_mipsread (void)
{
add_symtab_fns (&ecoff_sym_fns);
}
diff --git a/contrib/gdb/gdb/nlm/Makefile.in b/contrib/gdb/gdb/nlm/Makefile.in
index 5451138..6b3cf8c 100644
--- a/contrib/gdb/gdb/nlm/Makefile.in
+++ b/contrib/gdb/gdb/nlm/Makefile.in
@@ -1,4 +1,5 @@
-#Copyright 1989, 1990, 91, 92, 93, 94, 95, 1999 Free Software Foundation, Inc.
+#Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999
+#Free Software Foundation, Inc.
# This file is part of GDB.
@@ -41,6 +42,7 @@ man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
+htmldir = $(prefix)/html
includedir = @includedir@
SHELL = @SHELL@
@@ -115,6 +117,8 @@ check:
info dvi:
install-info:
clean-info:
+html:
+install-html:
gdbserve.nlm: gdbserve.O $(srcdir)/gdbserve.def
${NLMCONV_FOR_TARGET} -T $(srcdir)/gdbserve.def
diff --git a/contrib/gdb/gdb/nlm/gdbserve.c b/contrib/gdb/gdb/nlm/gdbserve.c
index 62adf3a..990a3f9 100644
--- a/contrib/gdb/gdb/nlm/gdbserve.c
+++ b/contrib/gdb/gdb/nlm/gdbserve.c
@@ -166,7 +166,7 @@ static int __main() {};
that's OK because we will be the only thread running anyhow. */
static int
-getDebugChar ()
+getDebugChar (void)
{
int err;
LONG got;
@@ -191,8 +191,7 @@ getDebugChar ()
non-zero on success. */
static int
-putDebugChar (c)
- unsigned char c;
+putDebugChar (unsigned char c)
{
int err;
LONG put;
@@ -210,8 +209,7 @@ putDebugChar (c)
/* Turn a hex character into a number. */
static int
-hex (ch)
- char ch;
+hex (char ch)
{
if ((ch >= 'a') && (ch <= 'f'))
return (ch-'a'+10);
@@ -226,8 +224,7 @@ hex (ch)
non-zero on success. */
static int
-getpacket (buffer)
- char * buffer;
+getpacket (char *buffer)
{
unsigned char checksum;
unsigned char xmitcsum;
@@ -312,8 +309,7 @@ getpacket (buffer)
success. */
static int
-putpacket (buffer)
- char * buffer;
+putpacket (char *buffer)
{
unsigned char checksum;
int count;
@@ -357,9 +353,7 @@ static char remcomOutBuffer[BUFMAX];
static short error;
static void
-debug_error (format, parm)
- char *format;
- char *parm;
+debug_error (char *format, char *parm)
{
if (remote_debug)
{
@@ -382,16 +376,13 @@ volatile int mem_err = 0;
saved). */
int
-get_char (addr)
- char *addr;
+get_char (char *addr)
{
return *addr;
}
void
-set_char (addr, val)
- char *addr;
- int val;
+set_char (char *addr, int val)
{
*addr = val;
}
@@ -403,11 +394,7 @@ set_char (addr, val)
a fault; if zero treat a fault like any other fault in the stub. */
char *
-mem2hex (mem, buf, count, may_fault)
- void *mem;
- char *buf;
- int count;
- int may_fault;
+mem2hex (void *mem, char *buf, int count, int may_fault)
{
int i;
unsigned char ch;
@@ -431,11 +418,7 @@ mem2hex (mem, buf, count, may_fault)
/* return a pointer to the character AFTER the last byte written */
char *
-hex2mem (buf, mem, count, may_fault)
- char *buf;
- void *mem;
- int count;
- int may_fault;
+hex2mem (char *buf, void *mem, int count, int may_fault)
{
int i;
unsigned char ch;
@@ -458,8 +441,7 @@ hex2mem (buf, mem, count, may_fault)
translate this number into a unix compatible signal value. */
int
-computeSignal (exceptionVector)
- int exceptionVector;
+computeSignal (int exceptionVector)
{
int sigval;
switch (exceptionVector)
@@ -490,9 +472,7 @@ computeSignal (exceptionVector)
/* RETURN NUMBER OF CHARS PROCESSED */
/**********************************************/
static int
-hexToInt(ptr, intValue)
- char **ptr;
- int *intValue;
+hexToInt (char **ptr, int *intValue)
{
int numChars = 0;
int hexValue;
@@ -521,8 +501,7 @@ hexToInt(ptr, intValue)
debugged. */
static LONG
-handle_exception (frame)
- struct StackFrame *frame;
+handle_exception (struct StackFrame *frame)
{
int addr, length;
char *ptr;
@@ -810,9 +789,7 @@ char parity[] = "NOEMS";
to have to figure out how to do that. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int hardware, board, port;
BYTE bitRate;
diff --git a/contrib/gdb/gdb/nlm/i386.c b/contrib/gdb/gdb/nlm/i386.c
index 560198e..b8ab480 100644
--- a/contrib/gdb/gdb/nlm/i386.c
+++ b/contrib/gdb/gdb/nlm/i386.c
@@ -16,16 +16,14 @@ extern char *hex2mem (char *buf, void *mem, int count, int may_fault);
extern int computeSignal (int exceptionVector);
void
-flush_i_cache()
+flush_i_cache (void)
{
}
/* Get the registers out of the frame information. */
void
-frame_to_registers (frame, regs)
- struct StackFrame *frame;
- char *regs;
+frame_to_registers (struct StackFrame *frame, char *regs)
{
/* Copy EAX -> EDI */
mem2hex (&frame->ExceptionEAX, &regs[0 * 4 * 2], 4 * 8, 0);
@@ -46,9 +44,7 @@ frame_to_registers (frame, regs)
/* Put the registers back into the frame information. */
void
-registers_to_frame (regs, frame)
- char *regs;
- struct StackFrame *frame;
+registers_to_frame (char *regs, struct StackFrame *frame)
{
/* Copy EAX -> EDI */
hex2mem (&regs[0 * 4 * 2], &frame->ExceptionEAX, 4 * 8, 0);
@@ -67,23 +63,19 @@ registers_to_frame (regs, frame)
}
void
-set_step_traps (frame)
- struct StackFrame *frame;
+set_step_traps (struct StackFrame *frame)
{
frame->ExceptionSystemFlags |= 0x100;
}
void
-clear_step_traps (frame)
- struct StackFrame *frame;
+clear_step_traps (struct StackFrame *frame)
{
frame->ExceptionSystemFlags &= ~0x100;
}
void
-do_status (ptr, frame)
- char *ptr;
- struct StackFrame *frame;
+do_status (char *ptr, struct StackFrame *frame)
{
int sigval;
diff --git a/contrib/gdb/gdb/nlm/ppc.c b/contrib/gdb/gdb/nlm/ppc.c
index e68397b..c5850abc 100644
--- a/contrib/gdb/gdb/nlm/ppc.c
+++ b/contrib/gdb/gdb/nlm/ppc.c
@@ -24,9 +24,7 @@ flush_i_cache (void)
/* Get the registers out of the frame information. */
void
-frame_to_registers (frame, regs)
- struct StackFrame *frame;
- char *regs;
+frame_to_registers (struct StackFrame *frame, char *regs)
{
mem2hex (&frame->ExceptionState.CsavedRegs, &regs[GP0_REGNUM * 4 * 2], 4 * 32, 0);
@@ -44,9 +42,7 @@ frame_to_registers (frame, regs)
/* Put the registers back into the frame information. */
void
-registers_to_frame (regs, frame)
- char *regs;
- struct StackFrame *frame;
+registers_to_frame (char *regs, struct StackFrame *frame)
{
hex2mem (&regs[GP0_REGNUM * 4 * 2], &frame->ExceptionState.CsavedRegs, 4 * 32, 0);
@@ -68,8 +64,7 @@ extern volatile int mem_err;
extern int ReadByteAltDebugger (char* addr, char *theByte);
extern int WriteByteAltDebugger (char* addr, char theByte);
int
-get_char (addr)
- char *addr;
+get_char (char *addr)
{
char c;
@@ -80,9 +75,7 @@ get_char (addr)
}
void
-set_char (addr, val)
- char *addr;
- int val;
+set_char (char *addr, int val)
{
if (!WriteByteAltDebugger (addr, val))
mem_err = 1;
@@ -90,9 +83,7 @@ set_char (addr, val)
#endif
int
-mem_write (dst, src, len)
- char *dst, *src;
- int len;
+mem_write (char *dst, char *src, int len)
{
while (len-- && !mem_err)
set_char (dst++, *src++);
@@ -142,8 +133,7 @@ static LONG saved_target_inst;
static LONG *saved_target_inst_pc = 0;
void
-set_step_traps (frame)
- struct StackFrame *frame;
+set_step_traps (struct StackFrame *frame)
{
union inst inst;
LONG *target;
@@ -203,8 +193,7 @@ set_step_traps (frame)
set. */
int
-clear_step_traps (frame)
- struct StackFrame *frame;
+clear_step_traps (struct StackFrame *frame)
{
int retcode;
LONG *pc = (LONG *)frame->ExceptionPC;
@@ -230,9 +219,7 @@ clear_step_traps (frame)
}
void
-do_status (ptr, frame)
- char *ptr;
- struct StackFrame *frame;
+do_status (char *ptr, struct StackFrame *frame)
{
int sigval;
diff --git a/contrib/gdb/gdb/nlmread.c b/contrib/gdb/gdb/nlmread.c
index afdea43..eaa9dde 100644
--- a/contrib/gdb/gdb/nlmread.c
+++ b/contrib/gdb/gdb/nlmread.c
@@ -1,47 +1,44 @@
/* Read NLM (NetWare Loadable Module) format executable files for GDB.
- Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ 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"
#include "bfd.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
-#include "gdb-stabs.h"
#include "buildsym.h"
#include "stabsread.h"
-static void
-nlm_new_init PARAMS ((struct objfile *));
+extern void _initialize_nlmread (void);
-static void
-nlm_symfile_init PARAMS ((struct objfile *));
+static void nlm_new_init (struct objfile *);
-static void
-nlm_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
+static void nlm_symfile_init (struct objfile *);
-static void
-nlm_symfile_finish PARAMS ((struct objfile *));
+static void nlm_symfile_read (struct objfile *, int);
-static void
-nlm_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *));
+static void nlm_symfile_finish (struct objfile *);
+
+static void nlm_symtab_read (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
@@ -51,8 +48,7 @@ nlm_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *));
file at some point in the near future. */
static void
-nlm_new_init (ignore)
- struct objfile *ignore;
+nlm_new_init (struct objfile *ignore)
{
stabsread_new_init ();
buildsym_new_init ();
@@ -69,35 +65,31 @@ nlm_new_init (ignore)
just a stub. */
static void
-nlm_symfile_init (ignore)
- struct objfile *ignore;
+nlm_symfile_init (struct objfile *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)
- bfd *abfd;
- CORE_ADDR addr;
- struct objfile *objfile;
+nlm_symtab_read (bfd *abfd, CORE_ADDR addr, struct objfile *objfile)
{
long storage_needed;
asymbol *sym;
@@ -107,7 +99,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),
@@ -115,34 +107,34 @@ nlm_symtab_read (abfd, addr, objfile)
if (storage_needed > 0)
{
symbol_table = (asymbol **) xmalloc (storage_needed);
- back_to = make_cleanup (free, symbol_table);
- number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+ back_to = make_cleanup (xfree, 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);
}
}
@@ -179,35 +171,32 @@ nlm_symtab_read (abfd, addr, objfile)
is not currently used. */
static void
-nlm_symfile_read (objfile, section_offsets, mainline)
- struct objfile *objfile;
- struct section_offsets *section_offsets;
- int mainline;
+nlm_symfile_read (struct objfile *objfile, int mainline)
{
- bfd *abfd = objfile -> obfd;
+ bfd *abfd = objfile->obfd;
struct cleanup *back_to;
CORE_ADDR offset;
struct symbol *mainsym;
init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup_discard_minimal_symbols ();
/* FIXME, should take a section_offsets param, not just an offset. */
- offset = ANOFFSET (section_offsets, 0);
+ offset = ANOFFSET (objfile->section_offsets, 0);
/* Process the NLM export records, which become the bfd's canonical symbol
table. */
nlm_symtab_read (abfd, offset, objfile);
- stabsect_build_psymtabs (objfile, section_offsets, mainline, ".stab",
+ stabsect_build_psymtabs (objfile, mainline, ".stab",
".stabstr", ".text");
- mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL);
+ mainsym = lookup_symbol (main_name (), 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));
@@ -231,12 +220,11 @@ nlm_symfile_read (objfile, section_offsets, mainline)
objfile struct from the global list of known objfiles. */
static void
-nlm_symfile_finish (objfile)
- struct objfile *objfile;
+nlm_symfile_finish (struct objfile *objfile)
{
- if (objfile -> sym_private != NULL)
+ if (objfile->sym_private != NULL)
{
- mfree (objfile -> md, objfile -> sym_private);
+ xmfree (objfile->md, objfile->sym_private);
}
}
@@ -245,17 +233,16 @@ 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 */
- default_symfile_offsets,
- /* sym_offsets: Translate ext. to int. relocation */
- NULL /* next: pointer to next struct sym_fns */
+ 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 */
};
void
-_initialize_nlmread ()
+_initialize_nlmread (void)
{
add_symtab_fns (&nlm_sym_fns);
}
diff --git a/contrib/gdb/gdb/objfiles.h b/contrib/gdb/gdb/objfiles.h
index 2a5df06..992ae71 100644
--- a/contrib/gdb/gdb/objfiles.h
+++ b/contrib/gdb/gdb/objfiles.h
@@ -1,21 +1,23 @@
/* Definitions for symbol file management in GDB.
- Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 +78,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 +123,7 @@ struct entry_info
#define INVALID_ENTRY_LOWPC (3)
#define INVALID_ENTRY_HIGHPC (1)
-};
+ };
/* Sections in an objfile.
@@ -136,45 +138,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
@@ -182,28 +186,23 @@ typedef struct {
per objfile basis, such as information about the number of symbols
read, size of string table (if any), etc. */
-#if MAINTENANCE_CMDS
-
-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
-extern void print_objfile_statistics PARAMS ((void));
-extern void print_symbol_bcache_statistics PARAMS ((void));
-
-#else
+extern void print_objfile_statistics (void);
+extern void print_symbol_bcache_statistics (void);
-#define OBJSTAT(objfile, expr) /* Nothing */
-#define OBJSTATS /* Nothing */
-
-#endif /* MAINTENANCE_CMDS */
+/* Number of entries in the minimal symbol hash table. */
+#define MINIMAL_SYMBOL_HASH_SIZE 2039
/* Master structure for keeping track of each file from which
gdb reads symbols. There are several ways these get allocated: 1.
@@ -214,195 +213,203 @@ 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.
+
+ 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:
- /* All struct objfile's are chained together by their next pointers.
- The global variable "object_files" points to the first link in this
- chain.
+ struct list {struct list *next; struct objfile *objfile};
- 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:
+ where the list structure is completely maintained separately within
+ each gdb process. */
- struct list {struct list *next; struct objfile *objfile};
+ struct objfile *next;
- where the list structure is completely maintained separately within
- each gdb process. */
+ /* The object file's name. Malloc'd; free it if you free this struct. */
- struct objfile *next;
+ char *name;
- /* The object file's name. Malloc'd; free it if you free this struct. */
+ /* Some flag bits for this objfile. */
- char *name;
+ unsigned short flags;
- /* TRUE if this objfile was created because the user explicitly caused
- it (e.g., used the add-symbol-file command).
- */
- int user_loaded;
+ /* 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. */
- /* TRUE if this objfile was explicitly created to represent a solib.
+ struct symtab *symtabs;
- (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;
+ /* Each objfile points to a linked list of partial symtabs derived from
+ this file, one partial symtab structure for each compilation unit
+ (source file). */
- /* Some flag bits for this objfile. */
+ struct partial_symtab *psymtabs;
- unsigned short flags;
+ /* List of freed partial symtabs, available for re-use */
- /* 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 partial_symtab *free_psymtabs;
- struct symtab *symtabs;
+ /* The object file's BFD. Can be null if the objfile contains only
+ minimal symbols, e.g. the run time common symbols for SunOS4. */
- /* Each objfile points to a linked list of partial symtabs derived from
- this file, one partial symtab structure for each compilation unit
- (source file). */
+ bfd *obfd;
- struct partial_symtab *psymtabs;
+ /* The modification timestamp of the object file, as of the last time
+ we read its symbols. */
- /* List of freed partial symtabs, available for re-use */
+ long mtime;
- struct partial_symtab *free_psymtabs;
+ /* Obstacks to hold objects that should be freed when we load a new symbol
+ table from this object file. */
- /* The object file's BFD. Can be null if the objfile contains only
- minimal symbols, e.g. the run time common symbols for SunOS4. */
+ struct obstack psymbol_obstack; /* Partial symbols */
+ struct obstack symbol_obstack; /* Full symbols */
+ struct obstack type_obstack; /* Types */
- bfd *obfd;
+ /* A byte cache where we can stash arbitrary "chunks" of bytes that
+ will not change. */
- /* The modification timestamp of the object file, as of the last time
- we read its symbols. */
+ struct bcache psymbol_cache; /* Byte cache for partial syms */
- long mtime;
+ /* Vectors of all partial symbols read in from file. The actual data
+ is stored in the psymbol_obstack. */
- /* Obstacks to hold objects that should be freed when we load a new symbol
- table from this object file. */
+ struct psymbol_allocation_list global_psymbols;
+ struct psymbol_allocation_list static_psymbols;
- struct obstack psymbol_obstack; /* Partial symbols */
- struct obstack symbol_obstack; /* Full symbols */
- struct obstack type_obstack; /* Types */
+ /* 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. */
- /* A byte cache where we can stash arbitrary "chunks" of bytes that
- will not change. */
+ struct minimal_symbol *msymbols;
+ int minimal_symbol_count;
- struct bcache psymbol_cache; /* Byte cache for partial syms */
+ /* This is a hash table used to index the minimal symbols by name. */
- /* Vectors of all partial symbols read in from file. The actual data
- is stored in the psymbol_obstack. */
+ struct minimal_symbol *msymbol_hash[MINIMAL_SYMBOL_HASH_SIZE];
- struct psymbol_allocation_list global_psymbols;
- struct psymbol_allocation_list static_psymbols;
+ /* This hash table is used to index the minimal symbols by their
+ demangled names. */
- /* 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 *msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE];
- 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;
+ /* Indexes in the section_offsets array. These are initialized by the
+ *_symfile_offsets() family of functions (som_symfile_offsets,
+ xcoff_symfile_offsets, default_symfile_offsets). In theory they
+ should correspond to the section indexes used by bfd for the
+ current objfile. The exception to this for the time being is the
+ SOM version. */
- /* 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). */
+ int sect_index_text;
+ int sect_index_data;
+ int sect_index_bss;
+ int sect_index_rodata;
- struct obj_section
- *sections,
- *sections_end;
+ /* These pointers are used to locate the section table, which
+ among other things, is used to map pc addresses into sections.
+ SECTIONS points to the first entry in the table, and
+ SECTIONS_END points to the first location past the last entry
+ in the table. Currently the table is stored on the
+ psymbol_obstack (which makes no sense, but I'm not sure it's
+ harming anything). */
- /* two auxiliary fields, used to hold the fp of separate symbol files */
- FILE *auxf1, *auxf2;
+ struct obj_section
+ *sections, *sections_end;
- /* Imported symbols */
- ImportEntry * import_list;
- int import_list_size;
+ /* two auxiliary fields, used to hold the fp of separate symbol files */
+ FILE *auxf1, *auxf2;
- /* Exported symbols */
- ExportEntry * export_list;
- int export_list_size;
+ /* Imported symbols */
+ ImportEntry *import_list;
+ int import_list_size;
- /* Place to stash various statistics about this objfile */
- OBJSTATS;
-};
+ /* Exported symbols */
+ ExportEntry *export_list;
+ int export_list_size;
+
+ /* Place to stash various statistics about this objfile */
+ OBJSTATS;
+ };
/* Defines for the objfile flag word. */
@@ -431,11 +438,29 @@ 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 */
+/* Distinguish between an objfile for a shared library and a "vanilla"
+ objfile. (If not set, the objfile may still 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.) */
+
+#define OBJF_SHARED (1 << 3) /* From a shared library */
+
+/* User requested that this objfile be read in it's entirety. */
+
+#define OBJF_READNOW (1 << 4) /* Immediate full read */
+
+/* This objfile was created because the user explicitly caused it
+ (e.g., used the add-symbol-file command). This bit offers a way
+ for run_command to remove old objfile entries which are no longer
+ valid (i.e., are associated with an old inferior), but to preserve
+ ones that the user explicitly loaded via the add-symbol-file
+ command. */
+
+#define OBJF_USERLOADED (1 << 5) /* User loaded */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */
@@ -469,53 +494,45 @@ extern struct objfile *object_files;
/* Declarations for functions defined in objfiles.c */
-extern struct objfile *
-allocate_objfile PARAMS ((bfd *, int, int, int));
+extern struct objfile *allocate_objfile (bfd *, int);
+
+extern int build_objfile_section_table (struct objfile *);
-extern int
-build_objfile_section_table PARAMS ((struct objfile *));
+extern void objfile_to_front (struct objfile *);
-extern void objfile_to_front PARAMS ((struct objfile *));
+extern void unlink_objfile (struct objfile *);
-extern void
-unlink_objfile PARAMS ((struct objfile *));
+extern void free_objfile (struct objfile *);
-extern void
-free_objfile PARAMS ((struct objfile *));
+extern struct cleanup *make_cleanup_free_objfile (struct objfile *);
-extern void
-free_all_objfiles PARAMS ((void));
+extern void free_all_objfiles (void);
-extern void
-objfile_relocate PARAMS ((struct objfile *, struct section_offsets *));
+extern void objfile_relocate (struct objfile *, struct section_offsets *);
-extern int
-have_partial_symbols PARAMS ((void));
+extern int have_partial_symbols (void);
-extern int
-have_full_symbols PARAMS ((void));
+extern int have_full_symbols (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));
+ */
+extern void objfile_purge_solibs (void);
/* Functions for dealing with the minimal symbol table, really a misc
address<->symbol mapping for things we don't have debug symbols for. */
-extern int
-have_minimal_symbols PARAMS ((void));
+extern int have_minimal_symbols (void);
-extern struct obj_section *
-find_pc_section PARAMS((CORE_ADDR pc));
+extern struct obj_section *find_pc_section (CORE_ADDR pc);
-extern struct obj_section *
-find_pc_sect_section PARAMS((CORE_ADDR pc, asection *section));
+extern struct obj_section *find_pc_sect_section (CORE_ADDR pc,
+ asection * section);
-extern int
-in_plt_section PARAMS ((CORE_ADDR, char *));
+extern int in_plt_section (CORE_ADDR, char *);
+
+extern int is_in_import_list (char *, struct objfile *);
/* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete
the objfile during the traversal. */
@@ -569,4 +586,24 @@ in_plt_section PARAMS ((CORE_ADDR, char *));
ALL_OBJFILES (objfile) \
ALL_OBJFILE_OSECTIONS (objfile, osect)
-#endif /* !defined (OBJFILES_H) */
+#define SECT_OFF_DATA(objfile) \
+ ((objfile->sect_index_data == -1) \
+ ? (internal_error (__FILE__, __LINE__, "sect_index_data not initialized"), -1) \
+ : objfile->sect_index_data)
+
+#define SECT_OFF_RODATA(objfile) \
+ ((objfile->sect_index_rodata == -1) \
+ ? (internal_error (__FILE__, __LINE__, "sect_index_rodata not initialized"), -1) \
+ : objfile->sect_index_rodata)
+
+#define SECT_OFF_TEXT(objfile) \
+ ((objfile->sect_index_text == -1) \
+ ? (internal_error (__FILE__, __LINE__, "sect_index_text not initialized"), -1) \
+ : objfile->sect_index_text)
+
+/* Sometimes the .bss section is missing from the objfile, so we don't
+ want to die here. Let the users of SECT_OFF_BSS deal with an
+ uninitialized section index. */
+#define SECT_OFF_BSS(objfile) (objfile)->sect_index_bss
+
+#endif /* !defined (OBJFILES_H) */
diff --git a/contrib/gdb/gdb/ocd.c b/contrib/gdb/gdb/ocd.c
index 343fa62..6834eea 100644
--- a/contrib/gdb/gdb/ocd.c
+++ b/contrib/gdb/gdb/ocd.c
@@ -1,21 +1,24 @@
/* Target communications support for Macraigor Systems' On-Chip Debugging
- Copyright 1996, 1997 Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 "gdbcore.h"
@@ -26,44 +29,42 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "symfile.h"
#include "target.h"
-#include "wait.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
-#include "dcache.h"
#include <sys/types.h>
#include <signal.h>
#include "serial.h"
#include "ocd.h"
+#include "regcache.h"
/* Prototypes for local functions */
-static int ocd_read_bytes PARAMS ((CORE_ADDR memaddr,
- char *myaddr, int len));
+static int ocd_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
-static int ocd_start_remote PARAMS ((PTR dummy));
+static int ocd_start_remote (PTR dummy);
-static int readchar PARAMS ((int timeout));
+static int readchar (int timeout);
-static void reset_packet PARAMS ((void));
+static void reset_packet (void);
-static void output_packet PARAMS ((void));
+static void output_packet (void);
-static int get_quoted_char PARAMS ((int timeout));
+static int get_quoted_char (int timeout);
-static void put_quoted_char PARAMS ((int c));
+static void put_quoted_char (int c);
-static void ocd_interrupt PARAMS ((int signo));
+static void ocd_interrupt (int signo);
-static void ocd_interrupt_twice PARAMS ((int signo));
+static void ocd_interrupt_twice (int signo);
-static void interrupt_query PARAMS ((void));
+static void interrupt_query (void);
-static unsigned char * ocd_do_command PARAMS ((int cmd, int *statusp, int *lenp));
+static unsigned char *ocd_do_command (int cmd, int *statusp, int *lenp);
-static void ocd_put_packet PARAMS ((unsigned char *packet, int pktlen));
+static void ocd_put_packet (unsigned char *packet, int pktlen);
-static unsigned char * ocd_get_packet PARAMS ((int cmd, int *pktlen, int timeout));
+static unsigned char *ocd_get_packet (int cmd, int *pktlen, int timeout);
static struct target_ops *current_ops = NULL;
@@ -83,12 +84,10 @@ static int remote_timeout = 2;
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
ocd_open knows that we don't have a file open when the program
starts. */
-static serial_t ocd_desc = NULL;
+static struct serial *ocd_desc = NULL;
void
-ocd_error (s, error_code)
- char *s;
- int error_code;
+ocd_error (char *s, int error_code)
{
char buf[100];
@@ -97,21 +96,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;
@@ -123,8 +152,7 @@ ocd_error (s, error_code)
/* Return nonzero if the thread TH is still alive on the remote system. */
int
-ocd_thread_alive (th)
- int th;
+ocd_thread_alive (ptid_t th)
{
return 1;
}
@@ -133,19 +161,17 @@ ocd_thread_alive (th)
/* ARGSUSED */
void
-ocd_close (quitting)
- int quitting;
+ocd_close (int quitting)
{
if (ocd_desc)
- SERIAL_CLOSE (ocd_desc);
+ serial_close (ocd_desc);
ocd_desc = NULL;
}
/* Stub for catch_errors. */
static int
-ocd_start_remote (dummy)
- PTR dummy;
+ocd_start_remote (PTR dummy)
{
unsigned char buf[10], *p;
int pktlen;
@@ -154,11 +180,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 */
+ immediate_quit++; /* 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 +215,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. */
@@ -218,7 +244,7 @@ ocd_start_remote (dummy)
ocd_error ("OCD_SET_CTL_FLAGS:", error_code);
#endif
- immediate_quit = 0;
+ immediate_quit--;
/* This is really the job of start_remote however, that makes an assumption
that the target is about to print out a status message of some sort. That
@@ -233,12 +259,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);
@@ -248,17 +274,11 @@ ocd_start_remote (dummy)
/* Open a connection to a remote debugger.
NAME is the filename used for communication. */
-static DCACHE *ocd_dcache;
-
void
-ocd_open (name, from_tty, target_type, ops)
- char *name;
- int from_tty;
- enum ocd_target_type target_type;
- struct target_ops *ops;
+ocd_open (char *name, int from_tty, enum ocd_target_type target_type,
+ struct target_ops *ops)
{
unsigned char buf[10], *p;
- int status;
int pktlen;
if (name == 0)
@@ -271,45 +291,24 @@ device the OCD device is attached to (e.g. /dev/ttya).");
unpush_target (current_ops);
- 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);
- }
+ ocd_desc = serial_open (name);
+ if (!ocd_desc)
+ perror_with_name (name);
if (baud_rate != -1)
{
- if (SERIAL_SETBAUDRATE (ocd_desc, baud_rate))
+ if (serial_setbaudrate (ocd_desc, baud_rate))
{
- SERIAL_CLOSE (ocd_desc);
+ serial_close (ocd_desc);
perror_with_name (name);
}
}
- SERIAL_RAW (ocd_desc);
+ serial_raw (ocd_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 (ocd_desc);
+ serial_flush_input (ocd_desc);
if (from_tty)
{
@@ -326,7 +325,7 @@ device the OCD device is attached to (e.g. /dev/ttya).");
variables, especially since GDB will someday have a notion of debugging
several processes. */
- inferior_pid = 42000;
+ inferior_ptid = pid_to_ptid (42000);
/* 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). */
@@ -334,7 +333,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.");
}
}
@@ -345,9 +344,7 @@ device the OCD device is attached to (e.g. /dev/ttya).");
die when it hits one. */
void
-ocd_detach (args, from_tty)
- char *args;
- int from_tty;
+ocd_detach (char *args, int from_tty)
{
if (args)
error ("Argument given to \"detach\" when remotely debugging.");
@@ -360,14 +357,10 @@ ocd_detach (args, from_tty)
/* Tell the remote machine to resume. */
void
-ocd_resume (pid, step, siggnal)
- int pid, step;
- enum target_signal siggnal;
+ocd_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
int pktlen;
- dcache_flush (ocd_dcache);
-
if (step)
ocd_do_command (OCD_STEP, &last_run_status, &pktlen);
else
@@ -375,7 +368,7 @@ ocd_resume (pid, step, siggnal)
}
void
-ocd_stop ()
+ocd_stop (void)
{
int status;
int pktlen;
@@ -392,12 +385,11 @@ static volatile int ocd_interrupt_flag;
packet. */
static void
-ocd_interrupt (signo)
- int signo;
+ocd_interrupt (int 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,15 +403,14 @@ ocd_interrupt (signo)
}
}
-static void (*ofunc)();
+static void (*ofunc) ();
/* The user typed ^C twice. */
static void
-ocd_interrupt_twice (signo)
- int signo;
+ocd_interrupt_twice (int signo)
{
signal (signo, ofunc);
-
+
interrupt_query ();
signal (signo, ocd_interrupt);
@@ -428,7 +419,7 @@ ocd_interrupt_twice (signo)
/* Ask the user what to do when an interrupt is received. */
static void
-interrupt_query ()
+interrupt_query (void)
{
target_terminal_ours ();
@@ -436,7 +427,7 @@ interrupt_query ()
Give up (and stop debugging it)? "))
{
target_mourn_inferior ();
- return_to_top_level (RETURN_QUIT);
+ throw_exception (RETURN_QUIT);
}
target_terminal_inferior ();
@@ -451,7 +442,7 @@ static int kill_kludge;
means in the case of this target). */
int
-ocd_wait ()
+ocd_wait (void)
{
unsigned char *p;
int error_code;
@@ -499,10 +490,7 @@ ocd_wait ()
Returns a pointer to a static array containing the register contents. */
unsigned char *
-ocd_read_bdm_registers (first_bdm_regno, last_bdm_regno, reglen)
- int first_bdm_regno;
- int last_bdm_regno;
- int *reglen;
+ocd_read_bdm_registers (int first_bdm_regno, int last_bdm_regno, int *reglen)
{
unsigned char buf[10];
int i;
@@ -544,8 +532,7 @@ ocd_read_bdm_registers (first_bdm_regno, last_bdm_regno, reglen)
/* Read register BDM_REGNO and returns its value ala read_register() */
CORE_ADDR
-ocd_read_bdm_register (bdm_regno)
- int bdm_regno;
+ocd_read_bdm_register (int bdm_regno)
{
int reglen;
unsigned char *p;
@@ -558,10 +545,7 @@ ocd_read_bdm_register (bdm_regno)
}
void
-ocd_write_bdm_registers (first_bdm_regno, regptr, reglen)
- int first_bdm_regno;
- unsigned char *regptr;
- int reglen;
+ocd_write_bdm_registers (int first_bdm_regno, unsigned char *regptr, int reglen)
{
unsigned char *buf;
unsigned char *p;
@@ -590,9 +574,7 @@ ocd_write_bdm_registers (first_bdm_regno, regptr, reglen)
}
void
-ocd_write_bdm_register (bdm_regno, reg)
- int bdm_regno;
- CORE_ADDR reg;
+ocd_write_bdm_register (int bdm_regno, CORE_ADDR reg)
{
unsigned char buf[4];
@@ -601,8 +583,8 @@ ocd_write_bdm_register (bdm_regno, reg)
ocd_write_bdm_registers (bdm_regno, buf, 4);
}
-void
-ocd_prepare_to_store ()
+void
+ocd_prepare_to_store (void)
{
}
@@ -617,10 +599,7 @@ ocd_prepare_to_store ()
static int write_mem_command = OCD_WRITE_MEM;
int
-ocd_write_bytes (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+ocd_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{
char buf[256 + 10];
unsigned char *p;
@@ -692,10 +671,7 @@ ocd_write_bytes (memaddr, myaddr, len)
Returns number of bytes transferred, or 0 for error. */
static int
-ocd_read_bytes (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+ocd_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{
char buf[256 + 10];
unsigned char *p;
@@ -760,23 +736,26 @@ ocd_read_bytes (memaddr, myaddr, len)
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
- nonzero. Returns length of data written or read; 0 for error. */
+ nonzero. Returns length of data written or read; 0 for error. TARGET
+ is ignored. */
/* ARGSUSED */
int
-ocd_xfer_memory (memaddr, myaddr, len, should_write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int should_write;
- struct target_ops *target; /* ignored */
+ocd_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int should_write,
+ struct mem_attrib *attrib, struct target_ops *target)
{
- return dcache_xfer_memory (ocd_dcache, memaddr, myaddr, len, should_write);
+ int res;
+
+ if (should_write)
+ res = ocd_write_bytes (memaddr, myaddr, len);
+ else
+ res = ocd_read_bytes (memaddr, myaddr, len);
+
+ return res;
}
void
-ocd_files_info (ignore)
- struct target_ops *ignore;
+ocd_files_info (struct target_ops *ignore)
{
puts_filtered ("Debugging a target over a serial line.\n");
}
@@ -787,12 +766,11 @@ ocd_files_info (ignore)
/* Read a single character from the remote side, handling wierd errors. */
static int
-readchar (timeout)
- int timeout;
+readchar (int timeout)
{
int ch;
- ch = SERIAL_READCHAR (ocd_desc, timeout);
+ ch = serial_readchar (ocd_desc, timeout);
switch (ch)
{
@@ -813,8 +791,7 @@ readchar (timeout)
mistaken for real data). */
static int
-get_quoted_char (timeout)
- int timeout;
+get_quoted_char (int timeout)
{
int ch;
@@ -836,18 +813,18 @@ 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 ()
+reset_packet (void)
{
pktp = pkt;
}
static void
-output_packet ()
+output_packet (void)
{
- if (SERIAL_WRITE (ocd_desc, pkt, pktp - pkt))
+ if (serial_write (ocd_desc, pkt, pktp - pkt))
perror_with_name ("output_packet: write failed");
reset_packet ();
@@ -857,8 +834,7 @@ output_packet ()
through untouched. */
static void
-put_quoted_char (c)
- int c;
+put_quoted_char (int c)
{
switch (c)
{
@@ -881,15 +857,13 @@ put_quoted_char (c)
byte count. */
static void
-stu_put_packet (buf, len)
- unsigned char *buf;
- int len;
+stu_put_packet (unsigned char *buf, int len)
{
unsigned char checksum;
unsigned char c;
if (len == 0 || len > 256)
- abort (); /* Can't represent 0 length packet */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Can't represent 0 length packet */
reset_packet ();
@@ -926,15 +900,13 @@ stu_put_packet (buf, len)
byte count. */
static void
-ocd_put_packet (buf, len)
- unsigned char *buf;
- int len;
+ocd_put_packet (unsigned char *buf, int len)
{
unsigned char checksum;
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;
@@ -950,7 +922,7 @@ ocd_put_packet (buf, len)
}
*packet_ptr++ = -checksum;
- if (SERIAL_WRITE (ocd_desc, packet, packet_ptr - packet))
+ if (serial_write (ocd_desc, packet, packet_ptr - packet))
perror_with_name ("output_packet: write failed");
}
#endif
@@ -960,19 +932,17 @@ 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)
- unsigned char cmd;
- int *lenp;
+stu_get_packet (unsigned char cmd, int *lenp, int timeout)
{
int ch;
int len;
static unsigned char buf[256 + 10], *p;
unsigned char checksum;
- find_packet:
+find_packet:
ch = get_quoted_char (timeout);
@@ -982,7 +952,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,16 +995,13 @@ 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)
- int cmd;
- int *lenp;
+ocd_get_packet (int cmd, int *lenp, int timeout)
{
int ch;
int len;
- int i;
static unsigned char packet[512];
unsigned char *packet_ptr;
unsigned char checksum;
@@ -1086,7 +1053,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 +1063,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 +1136,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
@@ -1178,10 +1145,7 @@ ocd_get_packet (cmd, lenp, timeout)
following the error code. */
static unsigned char *
-ocd_do_command (cmd, statusp, lenp)
- int cmd;
- int *statusp;
- int *lenp;
+ocd_do_command (int cmd, int *statusp, int *lenp)
{
unsigned char buf[100], *p;
int status, error_code;
@@ -1191,7 +1155,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 +1178,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);
@@ -1227,7 +1191,7 @@ ocd_do_command (cmd, statusp, lenp)
}
void
-ocd_kill ()
+ocd_kill (void)
{
/* For some mysterious reason, wait_for_inferior calls kill instead of
mourn after it gets TARGET_WAITKIND_SIGNALLED. Work around it. */
@@ -1244,7 +1208,7 @@ ocd_kill ()
}
void
-ocd_mourn ()
+ocd_mourn (void)
{
unpush_target (current_ops);
generic_mourn_inferior ();
@@ -1254,10 +1218,7 @@ ocd_mourn ()
the program at that point. */
void
-ocd_create_inferior (exec_file, args, env)
- char *exec_file;
- char *args;
- char **env;
+ocd_create_inferior (char *exec_file, char *args, char **env)
{
if (args && (*args != '\000'))
error ("Args are not supported by BDM.");
@@ -1267,13 +1228,11 @@ ocd_create_inferior (exec_file, args, env)
}
void
-ocd_load (args, from_tty)
- char *args;
- int from_tty;
+ocd_load (char *args, int from_tty)
{
generic_load (args, from_tty);
- inferior_pid = 0;
+ inferior_ptid = null_ptid;
/* 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 now that we have loaded
@@ -1287,18 +1246,16 @@ 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 */
int
-ocd_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+ocd_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
static char break_insn[] = BDM_BREAKPOINT;
int val;
@@ -1312,9 +1269,7 @@ ocd_insert_breakpoint (addr, contents_cache)
}
int
-ocd_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+ocd_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
static char break_insn[] = BDM_BREAKPOINT;
int val;
@@ -1325,17 +1280,13 @@ ocd_remove_breakpoint (addr, contents_cache)
}
static void
-bdm_command (args, from_tty)
- char *args;
- int from_tty;
+bdm_command (char *args, int from_tty)
{
error ("bdm command must be followed by `reset'");
}
static void
-bdm_reset_command (args, from_tty)
- char *args;
- int from_tty;
+bdm_reset_command (char *args, int from_tty)
{
int status, pktlen;
@@ -1343,14 +1294,12 @@ bdm_reset_command (args, from_tty)
error ("Not connected to OCD device.");
ocd_do_command (OCD_RESET, &status, &pktlen);
- dcache_flush (ocd_dcache);
+ dcache_invalidate (target_dcache);
registers_changed ();
}
static void
-bdm_restart_command (args, from_tty)
- char *args;
- int from_tty;
+bdm_restart_command (char *args, int from_tty)
{
int status, pktlen;
@@ -1368,19 +1317,16 @@ bdm_restart_command (args, from_tty)
generic_load from trying to set the PC. */
static void
-noop_store_registers (regno)
- int regno;
+noop_store_registers (int regno)
{
}
static void
-bdm_update_flash_command (args, from_tty)
- char *args;
- int from_tty;
+bdm_update_flash_command (char *args, int from_tty)
{
int status, pktlen;
- struct cleanup *old_chain;
- void (*store_registers_tmp) PARAMS ((int));
+ struct cleanup *old_chain;
+ void (*store_registers_tmp) (int);
if (!ocd_desc)
error ("Not connected to OCD device.");
@@ -1388,7 +1334,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,13 +1351,11 @@ 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
-bdm_read_register_command (args, from_tty)
- char *args;
- int from_tty;
+bdm_read_register_command (char *args, int from_tty)
{
/* XXX repeat should go on to the next register */
@@ -1424,14 +1368,14 @@ bdm_read_register_command (args, from_tty)
}
void
-_initialize_remote_ocd ()
+_initialize_remote_ocd (void)
{
extern struct cmd_list_element *cmdlist;
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 +1384,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); */
}
diff --git a/contrib/gdb/gdb/ocd.h b/contrib/gdb/gdb/ocd.h
index 020d3e2..5fa1fb9 100644
--- a/contrib/gdb/gdb/ocd.h
+++ b/contrib/gdb/gdb/ocd.h
@@ -1,21 +1,22 @@
/* Definitions for the Macraigor Systems BDM Wiggler
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,67 +74,66 @@ 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));
+void ocd_open (char *name, int from_tty, enum ocd_target_type,
+ struct target_ops *ops);
-void ocd_close PARAMS ((int quitting));
+void ocd_close (int quitting);
-void ocd_detach PARAMS ((char *args, int from_tty));
+void ocd_detach (char *args, int from_tty);
-void ocd_resume PARAMS ((int pid, int step, enum target_signal siggnal));
+void ocd_resume (ptid_t ptid, int step, enum target_signal siggnal);
-void ocd_prepare_to_store PARAMS ((void));
+void ocd_prepare_to_store (void);
-void ocd_stop PARAMS ((void));
+void ocd_stop (void);
-void ocd_files_info PARAMS ((struct target_ops *ignore));
+void ocd_files_info (struct target_ops *ignore);
-int ocd_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
- int len, int should_write,
- struct target_ops *target));
+int ocd_xfer_memory (CORE_ADDR memaddr, char *myaddr,
+ int len, int should_write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
-void ocd_mourn PARAMS ((void));
+void ocd_mourn (void);
-void ocd_create_inferior PARAMS ((char *exec_file,
- char *args,
- char **env));
+void ocd_create_inferior (char *exec_file, char *args, char **env);
-int ocd_thread_alive PARAMS ((int th));
+int ocd_thread_alive (ptid_t th);
-void ocd_error PARAMS ((char *s, int error_code));
+void ocd_error (char *s, int error_code);
-void ocd_kill PARAMS ((void));
+void ocd_kill (void);
-void ocd_load PARAMS((char *args, int from_tty));
+void ocd_load (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 (int first_bdm_regno,
+ int last_bdm_regno, int *reglen);
-CORE_ADDR ocd_read_bdm_register PARAMS ((int bdm_regno));
+CORE_ADDR ocd_read_bdm_register (int bdm_regno);
-void ocd_write_bdm_registers PARAMS ((int first_bdm_regno,
- unsigned char *regptr,
- int reglen));
+void ocd_write_bdm_registers (int first_bdm_regno,
+ unsigned char *regptr, int reglen);
-void ocd_write_bdm_register PARAMS ((int bdm_regno, CORE_ADDR reg));
+void ocd_write_bdm_register (int bdm_regno, CORE_ADDR reg);
-int ocd_wait PARAMS ((void));
+int ocd_wait (void);
-int ocd_insert_breakpoint PARAMS ((CORE_ADDR addr, char *contents_cache));
-int ocd_remove_breakpoint PARAMS ((CORE_ADDR addr, char *contents_cache));
+int ocd_insert_breakpoint (CORE_ADDR addr, char *contents_cache);
+int ocd_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
-int ocd_write_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+int ocd_write_bytes (CORE_ADDR memaddr, char *myaddr, int len);
#endif /* OCD_H */
diff --git a/contrib/gdb/gdb/p-exp.y b/contrib/gdb/gdb/p-exp.y
new file mode 100644
index 0000000..b0e4daa
--- /dev/null
+++ b/contrib/gdb/gdb/p-exp.y
@@ -0,0 +1,1485 @@
+/* YACC parser for Pascal expressions, for GDB.
+ Copyright 2000
+ Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is derived from c-exp.y */
+
+/* Parse a Pascal expression from text in a string,
+ and return the result as a struct expression pointer.
+ That structure contains arithmetic operations in reverse polish,
+ with constants represented by operations that are followed by special data.
+ See expression.h for the details of the format.
+ What is important here is that it can be built up sequentially
+ during the process of parsing; the lower levels of the tree always
+ come first in the result.
+
+ Note that malloc's and realloc's in this file are transformed to
+ xmalloc and xrealloc respectively by the same sed command in the
+ makefile that remaps any other malloc/realloc inserted by the parser
+ generator. Doing this with #defines and trying to control the interaction
+ with include files (<malloc.h> and <stdlib.h> for example) just became
+ too messy, particularly when such includes can be inserted at random
+ times by the parser generator. */
+
+/* FIXME: there are still 21 shift/reduce conflicts
+ Other known bugs or limitations:
+ - pascal string operations are not supported at all.
+ - there are some problems with boolean types.
+ - Pascal type hexadecimal constants are not supported
+ because they conflict with the internal variables format.
+ Probably also lots of other problems, less well defined PM */
+%{
+
+#include "defs.h"
+#include "gdb_string.h"
+#include <ctype.h>
+#include "expression.h"
+#include "value.h"
+#include "parser-defs.h"
+#include "language.h"
+#include "p-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 */
+
+/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
+ as well as gratuitiously global symbol names, so we can have multiple
+ yacc generated parsers in gdb. Note that these are only the variables
+ produced by yacc. If other parser generators (bison, byacc, etc) produce
+ additional global names that conflict at link time, then those parser
+ generators need to be fixed instead of adding those names to this list. */
+
+#define yymaxdepth pascal_maxdepth
+#define yyparse pascal_parse
+#define yylex pascal_lex
+#define yyerror pascal_error
+#define yylval pascal_lval
+#define yychar pascal_char
+#define yydebug pascal_debug
+#define yypact pascal_pact
+#define yyr1 pascal_r1
+#define yyr2 pascal_r2
+#define yydef pascal_def
+#define yychk pascal_chk
+#define yypgo pascal_pgo
+#define yyact pascal_act
+#define yyexca pascal_exca
+#define yyerrflag pascal_errflag
+#define yynerrs pascal_nerrs
+#define yyps pascal_ps
+#define yypv pascal_pv
+#define yys pascal_s
+#define yy_yys pascal_yys
+#define yystate pascal_state
+#define yytmp pascal_tmp
+#define yyv pascal_v
+#define yy_yyv pascal_yyv
+#define yyval pascal_val
+#define yylloc pascal_lloc
+#define yyreds pascal_reds /* With YYDEBUG defined */
+#define yytoks pascal_toks /* With YYDEBUG defined */
+#define yylhs pascal_yylhs
+#define yylen pascal_yylen
+#define yydefred pascal_yydefred
+#define yydgoto pascal_yydgoto
+#define yysindex pascal_yysindex
+#define yyrindex pascal_yyrindex
+#define yygindex pascal_yygindex
+#define yytable pascal_yytable
+#define yycheck pascal_yycheck
+
+#ifndef YYDEBUG
+#define YYDEBUG 0 /* Default to no yydebug support */
+#endif
+
+int yyparse (void);
+
+static int yylex (void);
+
+void
+yyerror (char *);
+
+static char * uptok (char *, int);
+%}
+
+/* Although the yacc "value" of an expression is not used,
+ since the result is stored in the structure being created,
+ other node types do have values. */
+
+%union
+ {
+ LONGEST lval;
+ struct {
+ LONGEST val;
+ struct type *type;
+ } typed_val_int;
+ struct {
+ DOUBLEST dval;
+ struct type *type;
+ } typed_val_float;
+ struct symbol *sym;
+ struct type *tval;
+ struct stoken sval;
+ struct ttype tsym;
+ struct symtoken ssym;
+ int voidval;
+ struct block *bval;
+ enum exp_opcode opcode;
+ struct internalvar *ivar;
+
+ struct type **tvec;
+ int *ivec;
+ }
+
+%{
+/* YYSTYPE gets defined by %union */
+static int
+parse_number (char *, int, int, YYSTYPE *);
+%}
+
+%type <voidval> exp exp1 type_exp start variable qualified_name
+%type <tval> type typebase
+/* %type <bval> block */
+
+/* Fancy type parsing. */
+%type <tval> ptype
+
+%token <typed_val_int> INT
+%token <typed_val_float> FLOAT
+
+/* Both NAME and TYPENAME tokens represent symbols in the input,
+ and both convey their data as strings.
+ But a TYPENAME is a string that happens to be defined as a typedef
+ or builtin type name (such as int or char)
+ and a NAME is any other symbol.
+ Contexts where this distinction is not important can use the
+ nonterminal "name", which matches either NAME or TYPENAME. */
+
+%token <sval> STRING
+%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */
+%token <tsym> TYPENAME
+%type <sval> name
+%type <ssym> name_not_typename
+
+/* A NAME_OR_INT is a symbol which is not known in the symbol table,
+ but which would parse as a valid number in the current input radix.
+ E.g. "c" when input_radix==16. Depending on the parse, it will be
+ turned into a name or into a number. */
+
+%token <ssym> NAME_OR_INT
+
+%token STRUCT CLASS SIZEOF COLONCOLON
+%token ERROR
+
+/* Special type cases, put in to allow the parser to distinguish different
+ legal basetypes. */
+
+%token <voidval> VARIABLE
+
+
+/* Object pascal */
+%token THIS
+%token <lval> TRUE FALSE
+
+%left ','
+%left ABOVE_COMMA
+%right ASSIGN
+%left NOT
+%left OR
+%left XOR
+%left ANDAND
+%left '=' NOTEQUAL
+%left '<' '>' LEQ GEQ
+%left LSH RSH DIV MOD
+%left '@'
+%left '+' '-'
+%left '*' '/'
+%right UNARY INCREMENT DECREMENT
+%right ARROW '.' '[' '('
+%token <ssym> BLOCKNAME
+%type <bval> block
+%left COLONCOLON
+
+
+%%
+
+start : exp1
+ | type_exp
+ ;
+
+type_exp: type
+ { write_exp_elt_opcode(OP_TYPE);
+ write_exp_elt_type($1);
+ write_exp_elt_opcode(OP_TYPE);}
+ ;
+
+/* Expressions, including the comma operator. */
+exp1 : exp
+ | exp1 ',' exp
+ { write_exp_elt_opcode (BINOP_COMMA); }
+ ;
+
+/* Expressions, not including the comma operator. */
+exp : exp '^' %prec UNARY
+ { write_exp_elt_opcode (UNOP_IND); }
+
+exp : '@' exp %prec UNARY
+ { write_exp_elt_opcode (UNOP_ADDR); }
+
+exp : '-' exp %prec UNARY
+ { write_exp_elt_opcode (UNOP_NEG); }
+ ;
+
+exp : NOT exp %prec UNARY
+ { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
+ ;
+
+exp : INCREMENT '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_PREINCREMENT); }
+ ;
+
+exp : DECREMENT '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_PREDECREMENT); }
+ ;
+
+exp : exp '.' name
+ { write_exp_elt_opcode (STRUCTOP_STRUCT);
+ write_exp_string ($3);
+ write_exp_elt_opcode (STRUCTOP_STRUCT); }
+ ;
+
+exp : exp '[' exp1 ']'
+ { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
+ ;
+
+exp : exp '('
+ /* This is to save the value of arglist_len
+ being accumulated by an outer function call. */
+ { start_arglist (); }
+ arglist ')' %prec ARROW
+ { write_exp_elt_opcode (OP_FUNCALL);
+ write_exp_elt_longcst ((LONGEST) end_arglist ());
+ write_exp_elt_opcode (OP_FUNCALL); }
+ ;
+
+arglist :
+ | exp
+ { arglist_len = 1; }
+ | arglist ',' exp %prec ABOVE_COMMA
+ { arglist_len++; }
+ ;
+
+exp : type '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_CAST);
+ write_exp_elt_type ($1);
+ write_exp_elt_opcode (UNOP_CAST); }
+ ;
+
+exp : '(' exp1 ')'
+ { }
+ ;
+
+/* Binary operators in order of decreasing precedence. */
+
+exp : exp '*' exp
+ { write_exp_elt_opcode (BINOP_MUL); }
+ ;
+
+exp : exp '/' exp
+ { write_exp_elt_opcode (BINOP_DIV); }
+ ;
+
+exp : exp DIV exp
+ { write_exp_elt_opcode (BINOP_INTDIV); }
+ ;
+
+exp : exp MOD exp
+ { write_exp_elt_opcode (BINOP_REM); }
+ ;
+
+exp : exp '+' exp
+ { write_exp_elt_opcode (BINOP_ADD); }
+ ;
+
+exp : exp '-' exp
+ { write_exp_elt_opcode (BINOP_SUB); }
+ ;
+
+exp : exp LSH exp
+ { write_exp_elt_opcode (BINOP_LSH); }
+ ;
+
+exp : exp RSH exp
+ { write_exp_elt_opcode (BINOP_RSH); }
+ ;
+
+exp : exp '=' exp
+ { write_exp_elt_opcode (BINOP_EQUAL); }
+ ;
+
+exp : exp NOTEQUAL exp
+ { write_exp_elt_opcode (BINOP_NOTEQUAL); }
+ ;
+
+exp : exp LEQ exp
+ { write_exp_elt_opcode (BINOP_LEQ); }
+ ;
+
+exp : exp GEQ exp
+ { write_exp_elt_opcode (BINOP_GEQ); }
+ ;
+
+exp : exp '<' exp
+ { write_exp_elt_opcode (BINOP_LESS); }
+ ;
+
+exp : exp '>' exp
+ { write_exp_elt_opcode (BINOP_GTR); }
+ ;
+
+exp : exp ANDAND exp
+ { write_exp_elt_opcode (BINOP_BITWISE_AND); }
+ ;
+
+exp : exp XOR exp
+ { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
+ ;
+
+exp : exp OR exp
+ { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
+ ;
+
+exp : exp ASSIGN exp
+ { write_exp_elt_opcode (BINOP_ASSIGN); }
+ ;
+
+exp : TRUE
+ { write_exp_elt_opcode (OP_BOOL);
+ write_exp_elt_longcst ((LONGEST) $1);
+ write_exp_elt_opcode (OP_BOOL); }
+ ;
+
+exp : FALSE
+ { write_exp_elt_opcode (OP_BOOL);
+ write_exp_elt_longcst ((LONGEST) $1);
+ write_exp_elt_opcode (OP_BOOL); }
+ ;
+
+exp : INT
+ { write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type ($1.type);
+ write_exp_elt_longcst ((LONGEST)($1.val));
+ write_exp_elt_opcode (OP_LONG); }
+ ;
+
+exp : NAME_OR_INT
+ { YYSTYPE val;
+ parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
+ write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type (val.typed_val_int.type);
+ write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
+ write_exp_elt_opcode (OP_LONG);
+ }
+ ;
+
+
+exp : FLOAT
+ { write_exp_elt_opcode (OP_DOUBLE);
+ write_exp_elt_type ($1.type);
+ write_exp_elt_dblcst ($1.dval);
+ write_exp_elt_opcode (OP_DOUBLE); }
+ ;
+
+exp : variable
+ ;
+
+exp : VARIABLE
+ /* Already written by write_dollar_variable. */
+ ;
+
+exp : SIZEOF '(' type ')' %prec UNARY
+ { write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type (builtin_type_int);
+ CHECK_TYPEDEF ($3);
+ write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
+ write_exp_elt_opcode (OP_LONG); }
+ ;
+
+exp : STRING
+ { /* C strings are converted into array constants with
+ an explicit null byte added at the end. Thus
+ the array upper bound is the string length.
+ There is no such thing in C as a completely empty
+ string. */
+ char *sp = $1.ptr; int count = $1.length;
+ while (count-- > 0)
+ {
+ write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type (builtin_type_char);
+ write_exp_elt_longcst ((LONGEST)(*sp++));
+ write_exp_elt_opcode (OP_LONG);
+ }
+ write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type (builtin_type_char);
+ write_exp_elt_longcst ((LONGEST)'\0');
+ write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_opcode (OP_ARRAY);
+ write_exp_elt_longcst ((LONGEST) 0);
+ write_exp_elt_longcst ((LONGEST) ($1.length));
+ write_exp_elt_opcode (OP_ARRAY); }
+ ;
+
+/* Object pascal */
+exp : THIS
+ { write_exp_elt_opcode (OP_THIS);
+ write_exp_elt_opcode (OP_THIS); }
+ ;
+
+/* end of object pascal. */
+
+block : BLOCKNAME
+ {
+ if ($1.sym != 0)
+ $$ = SYMBOL_BLOCK_VALUE ($1.sym);
+ else
+ {
+ struct symtab *tem =
+ lookup_symtab (copy_name ($1.stoken));
+ if (tem)
+ $$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
+ else
+ error ("No file or function \"%s\".",
+ copy_name ($1.stoken));
+ }
+ }
+ ;
+
+block : block COLONCOLON name
+ { struct symbol *tem
+ = lookup_symbol (copy_name ($3), $1,
+ VAR_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL);
+ if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
+ error ("No function \"%s\" in specified context.",
+ copy_name ($3));
+ $$ = SYMBOL_BLOCK_VALUE (tem); }
+ ;
+
+variable: block COLONCOLON name
+ { struct symbol *sym;
+ sym = lookup_symbol (copy_name ($3), $1,
+ VAR_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL);
+ if (sym == 0)
+ error ("No symbol \"%s\" in specified context.",
+ copy_name ($3));
+
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ /* block_found is set by lookup_symbol. */
+ write_exp_elt_block (block_found);
+ write_exp_elt_sym (sym);
+ write_exp_elt_opcode (OP_VAR_VALUE); }
+ ;
+
+qualified_name: typebase COLONCOLON name
+ {
+ struct type *type = $1;
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+ && TYPE_CODE (type) != TYPE_CODE_UNION)
+ error ("`%s' is not defined as an aggregate type.",
+ TYPE_NAME (type));
+
+ write_exp_elt_opcode (OP_SCOPE);
+ write_exp_elt_type (type);
+ write_exp_string ($3);
+ write_exp_elt_opcode (OP_SCOPE);
+ }
+ ;
+
+variable: qualified_name
+ | COLONCOLON name
+ {
+ char *name = copy_name ($2);
+ struct symbol *sym;
+ struct minimal_symbol *msymbol;
+
+ sym =
+ lookup_symbol (name, (const struct block *) NULL,
+ VAR_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL);
+ if (sym)
+ {
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ write_exp_elt_block (NULL);
+ write_exp_elt_sym (sym);
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ break;
+ }
+
+ msymbol = lookup_minimal_symbol (name, NULL, NULL);
+ if (msymbol != NULL)
+ {
+ write_exp_msymbol (msymbol,
+ lookup_function_type (builtin_type_int),
+ builtin_type_int);
+ }
+ 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.", name);
+ }
+ ;
+
+variable: name_not_typename
+ { struct symbol *sym = $1.sym;
+
+ if (sym)
+ {
+ if (symbol_read_needs_frame (sym))
+ {
+ if (innermost_block == 0 ||
+ contained_in (block_found,
+ innermost_block))
+ innermost_block = block_found;
+ }
+
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ /* We want to use the selected frame, not
+ another more inner frame which happens to
+ be in the same block. */
+ write_exp_elt_block (NULL);
+ write_exp_elt_sym (sym);
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ }
+ else if ($1.is_a_field_of_this)
+ {
+ /* Object pascal: it hangs off of `this'. Must
+ not inadvertently convert from a method call
+ to data ref. */
+ if (innermost_block == 0 ||
+ contained_in (block_found, innermost_block))
+ innermost_block = block_found;
+ write_exp_elt_opcode (OP_THIS);
+ write_exp_elt_opcode (OP_THIS);
+ write_exp_elt_opcode (STRUCTOP_PTR);
+ write_exp_string ($1.stoken);
+ write_exp_elt_opcode (STRUCTOP_PTR);
+ }
+ else
+ {
+ struct minimal_symbol *msymbol;
+ register char *arg = copy_name ($1.stoken);
+
+ msymbol =
+ lookup_minimal_symbol (arg, NULL, NULL);
+ if (msymbol != NULL)
+ {
+ write_exp_msymbol (msymbol,
+ lookup_function_type (builtin_type_int),
+ builtin_type_int);
+ }
+ 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.",
+ copy_name ($1.stoken));
+ }
+ }
+ ;
+
+
+ptype : typebase
+ ;
+
+/* We used to try to recognize more pointer to member types here, but
+ that didn't work (shift/reduce conflicts meant that these rules never
+ got executed). The problem is that
+ int (foo::bar::baz::bizzle)
+ is a function type but
+ int (foo::bar::baz::bizzle::*)
+ is a pointer to member type. Stroustrup loses again! */
+
+type : ptype
+ | typebase COLONCOLON '*'
+ { $$ = lookup_member_type (builtin_type_int, $1); }
+ ;
+
+typebase /* Implements (approximately): (type-qualifier)* type-specifier */
+ : TYPENAME
+ { $$ = $1.type; }
+ | STRUCT name
+ { $$ = lookup_struct (copy_name ($2),
+ expression_context_block); }
+ | CLASS name
+ { $$ = lookup_struct (copy_name ($2),
+ expression_context_block); }
+ /* "const" and "volatile" are curently ignored. A type qualifier
+ after the type is handled in the ptype rule. I think these could
+ be too. */
+ ;
+
+name : NAME { $$ = $1.stoken; }
+ | BLOCKNAME { $$ = $1.stoken; }
+ | TYPENAME { $$ = $1.stoken; }
+ | NAME_OR_INT { $$ = $1.stoken; }
+ ;
+
+name_not_typename : NAME
+ | BLOCKNAME
+/* These would be useful if name_not_typename was useful, but it is just
+ a fake for "variable", so these cause reduce/reduce conflicts because
+ the parser can't tell whether NAME_OR_INT is a name_not_typename (=variable,
+ =exp) or just an exp. If name_not_typename was ever used in an lvalue
+ context where only a name could occur, this might be useful.
+ | NAME_OR_INT
+ */
+ ;
+
+%%
+
+/* Take care of parsing a number (anything that starts with a digit).
+ Set yylval and return the token type; update lexptr.
+ LEN is the number of characters in it. */
+
+/*** Needs some error checking for the float case ***/
+
+static int
+parse_number (p, len, parsed_float, putithere)
+ register char *p;
+ register int len;
+ int parsed_float;
+ YYSTYPE *putithere;
+{
+ /* FIXME: Shouldn't these be unsigned? We don't deal with negative values
+ here, and we do kind of silly things like cast to unsigned. */
+ register LONGEST n = 0;
+ register LONGEST prevn = 0;
+ ULONGEST un;
+
+ register int i = 0;
+ register int c;
+ register int base = input_radix;
+ int unsigned_p = 0;
+
+ /* Number of "L" suffixes encountered. */
+ int long_p = 0;
+
+ /* We have found a "L" or "U" suffix. */
+ int found_suffix = 0;
+
+ ULONGEST high_bit;
+ struct type *signed_type;
+ struct type *unsigned_type;
+
+ if (parsed_float)
+ {
+ /* It's a float since it contains a point or an exponent. */
+ char c;
+ int num = 0; /* number of tokens scanned by scanf */
+ char saved_char = p[len];
+
+ p[len] = 0; /* null-terminate the token */
+ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
+ num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c);
+ else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
+ num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c);
+ else
+ {
+#ifdef SCANF_HAS_LONG_DOUBLE
+ num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c);
+#else
+ /* Scan it into a double, then assign it to the long double.
+ This at least wins with values representable in the range
+ of doubles. */
+ double temp;
+ num = sscanf (p, "%lg%c", &temp,&c);
+ putithere->typed_val_float.dval = temp;
+#endif
+ }
+ p[len] = saved_char; /* restore the input stream */
+ if (num != 1) /* check scanf found ONLY a float ... */
+ return ERROR;
+ /* See if it has `f' or `l' suffix (float or long double). */
+
+ c = tolower (p[len - 1]);
+
+ if (c == 'f')
+ putithere->typed_val_float.type = builtin_type_float;
+ else if (c == 'l')
+ putithere->typed_val_float.type = builtin_type_long_double;
+ else if (isdigit (c) || c == '.')
+ putithere->typed_val_float.type = builtin_type_double;
+ else
+ return ERROR;
+
+ return FLOAT;
+ }
+
+ /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
+ if (p[0] == '0')
+ switch (p[1])
+ {
+ case 'x':
+ case 'X':
+ if (len >= 3)
+ {
+ p += 2;
+ base = 16;
+ len -= 2;
+ }
+ break;
+
+ case 't':
+ case 'T':
+ case 'd':
+ case 'D':
+ if (len >= 3)
+ {
+ p += 2;
+ base = 10;
+ len -= 2;
+ }
+ break;
+
+ default:
+ base = 8;
+ break;
+ }
+
+ while (len-- > 0)
+ {
+ c = *p++;
+ if (c >= 'A' && c <= 'Z')
+ c += 'a' - 'A';
+ if (c != 'l' && c != 'u')
+ n *= base;
+ if (c >= '0' && c <= '9')
+ {
+ if (found_suffix)
+ return ERROR;
+ n += i = c - '0';
+ }
+ else
+ {
+ if (base > 10 && c >= 'a' && c <= 'f')
+ {
+ if (found_suffix)
+ return ERROR;
+ n += i = c - 'a' + 10;
+ }
+ else if (c == 'l')
+ {
+ ++long_p;
+ found_suffix = 1;
+ }
+ else if (c == 'u')
+ {
+ unsigned_p = 1;
+ found_suffix = 1;
+ }
+ else
+ return ERROR; /* Char not a digit */
+ }
+ if (i >= base)
+ return ERROR; /* Invalid digit in this base */
+
+ /* Portably test for overflow (only works for nonzero values, so make
+ a second check for zero). FIXME: Can't we just make n and prevn
+ unsigned and avoid this? */
+ if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
+ unsigned_p = 1; /* Try something unsigned */
+
+ /* Portably test for unsigned overflow.
+ FIXME: This check is wrong; for example it doesn't find overflow
+ on 0x123456789 when LONGEST is 32 bits. */
+ if (c != 'l' && c != 'u' && n != 0)
+ {
+ if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
+ error ("Numeric constant too large.");
+ }
+ prevn = n;
+ }
+
+ /* An integer constant is an int, a long, or a long long. An L
+ suffix forces it to be long; an LL suffix forces it to be long
+ long. If not forced to a larger size, it gets the first type of
+ the above that it fits in. To figure out whether it fits, we
+ shift it right and see whether anything remains. Note that we
+ can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
+ operation, because many compilers will warn about such a shift
+ (which always produces a zero result). Sometimes TARGET_INT_BIT
+ or TARGET_LONG_BIT will be that big, sometimes not. To deal with
+ the case where it is we just always shift the value more than
+ once, with fewer bits each time. */
+
+ un = (ULONGEST)n >> 2;
+ if (long_p == 0
+ && (un >> (TARGET_INT_BIT - 2)) == 0)
+ {
+ high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+
+ /* A large decimal (not hex or octal) constant (between INT_MAX
+ and UINT_MAX) is a long or unsigned long, according to ANSI,
+ never an unsigned int, but this code treats it as unsigned
+ int. This probably should be fixed. GCC gives a warning on
+ such constants. */
+
+ unsigned_type = builtin_type_unsigned_int;
+ signed_type = builtin_type_int;
+ }
+ else if (long_p <= 1
+ && (un >> (TARGET_LONG_BIT - 2)) == 0)
+ {
+ high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+ unsigned_type = builtin_type_unsigned_long;
+ signed_type = builtin_type_long;
+ }
+ else
+ {
+ int shift;
+ if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+ /* A long long does not fit in a LONGEST. */
+ shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
+ else
+ shift = (TARGET_LONG_LONG_BIT - 1);
+ high_bit = (ULONGEST) 1 << shift;
+ unsigned_type = builtin_type_unsigned_long_long;
+ signed_type = builtin_type_long_long;
+ }
+
+ putithere->typed_val_int.val = n;
+
+ /* If the high bit of the worked out type is set then this number
+ has to be unsigned. */
+
+ if (unsigned_p || (n & high_bit))
+ {
+ putithere->typed_val_int.type = unsigned_type;
+ }
+ else
+ {
+ putithere->typed_val_int.type = signed_type;
+ }
+
+ return INT;
+}
+
+struct token
+{
+ char *operator;
+ int token;
+ enum exp_opcode opcode;
+};
+
+static const struct token tokentab3[] =
+ {
+ {"shr", RSH, BINOP_END},
+ {"shl", LSH, BINOP_END},
+ {"and", ANDAND, BINOP_END},
+ {"div", DIV, BINOP_END},
+ {"not", NOT, BINOP_END},
+ {"mod", MOD, BINOP_END},
+ {"inc", INCREMENT, BINOP_END},
+ {"dec", DECREMENT, BINOP_END},
+ {"xor", XOR, BINOP_END}
+ };
+
+static const struct token tokentab2[] =
+ {
+ {"or", OR, BINOP_END},
+ {"<>", NOTEQUAL, BINOP_END},
+ {"<=", LEQ, BINOP_END},
+ {">=", GEQ, BINOP_END},
+ {":=", ASSIGN, BINOP_END}
+ };
+
+/* Allocate uppercased var */
+/* make an uppercased copy of tokstart */
+static char * uptok (tokstart, namelen)
+ char *tokstart;
+ int namelen;
+{
+ int i;
+ char *uptokstart = (char *)malloc(namelen+1);
+ for (i = 0;i <= namelen;i++)
+ {
+ if ((tokstart[i]>='a' && tokstart[i]<='z'))
+ uptokstart[i] = tokstart[i]-('a'-'A');
+ else
+ uptokstart[i] = tokstart[i];
+ }
+ uptokstart[namelen]='\0';
+ return uptokstart;
+}
+/* Read one token, getting characters through lexptr. */
+
+
+static int
+yylex ()
+{
+ int c;
+ int namelen;
+ unsigned int i;
+ char *tokstart;
+ char *uptokstart;
+ char *tokptr;
+ char *p;
+ int explen, tempbufindex;
+ static char *tempbuf;
+ static int tempbufsize;
+
+ retry:
+
+ tokstart = lexptr;
+ explen = strlen (lexptr);
+ /* See if it is a special token of length 3. */
+ if (explen > 2)
+ for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
+ if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
+ && (!isalpha (tokentab3[i].operator[0]) || explen == 3
+ || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
+ {
+ lexptr += 3;
+ yylval.opcode = tokentab3[i].opcode;
+ return tokentab3[i].token;
+ }
+
+ /* See if it is a special token of length 2. */
+ if (explen > 1)
+ for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
+ if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
+ && (!isalpha (tokentab2[i].operator[0]) || explen == 2
+ || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
+ {
+ lexptr += 2;
+ yylval.opcode = tokentab2[i].opcode;
+ return tokentab2[i].token;
+ }
+
+ switch (c = *tokstart)
+ {
+ case 0:
+ return 0;
+
+ case ' ':
+ case '\t':
+ case '\n':
+ lexptr++;
+ goto retry;
+
+ case '\'':
+ /* We either have a character constant ('0' or '\177' for example)
+ or we have a quoted symbol reference ('foo(int,int)' in object pascal
+ for example). */
+ lexptr++;
+ c = *lexptr++;
+ if (c == '\\')
+ c = parse_escape (&lexptr);
+ else if (c == '\'')
+ error ("Empty character constant.");
+
+ yylval.typed_val_int.val = c;
+ yylval.typed_val_int.type = builtin_type_char;
+
+ c = *lexptr++;
+ if (c != '\'')
+ {
+ namelen = skip_quoted (tokstart) - tokstart;
+ if (namelen > 2)
+ {
+ lexptr = tokstart + namelen;
+ if (lexptr[-1] != '\'')
+ error ("Unmatched single quote.");
+ namelen -= 2;
+ tokstart++;
+ uptokstart = uptok(tokstart,namelen);
+ goto tryname;
+ }
+ error ("Invalid character constant.");
+ }
+ return INT;
+
+ case '(':
+ paren_depth++;
+ lexptr++;
+ return c;
+
+ case ')':
+ if (paren_depth == 0)
+ return 0;
+ paren_depth--;
+ lexptr++;
+ return c;
+
+ case ',':
+ if (comma_terminates && paren_depth == 0)
+ return 0;
+ lexptr++;
+ return c;
+
+ case '.':
+ /* Might be a floating point number. */
+ if (lexptr[1] < '0' || lexptr[1] > '9')
+ goto symbol; /* Nope, must be a symbol. */
+ /* FALL THRU into number case. */
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ /* It's a number. */
+ int got_dot = 0, got_e = 0, toktype;
+ register char *p = tokstart;
+ int hex = input_radix > 10;
+
+ if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
+ {
+ p += 2;
+ hex = 1;
+ }
+ else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
+ {
+ p += 2;
+ hex = 0;
+ }
+
+ for (;; ++p)
+ {
+ /* This test includes !hex because 'e' is a valid hex digit
+ and thus does not indicate a floating point number when
+ the radix is hex. */
+ if (!hex && !got_e && (*p == 'e' || *p == 'E'))
+ got_dot = got_e = 1;
+ /* This test does not include !hex, because a '.' always indicates
+ a decimal floating point number regardless of the radix. */
+ else if (!got_dot && *p == '.')
+ got_dot = 1;
+ else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
+ && (*p == '-' || *p == '+'))
+ /* This is the sign of the exponent, not the end of the
+ number. */
+ continue;
+ /* We will take any letters or digits. parse_number will
+ complain if past the radix, or if L or U are not final. */
+ else if ((*p < '0' || *p > '9')
+ && ((*p < 'a' || *p > 'z')
+ && (*p < 'A' || *p > 'Z')))
+ break;
+ }
+ toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
+ if (toktype == ERROR)
+ {
+ char *err_copy = (char *) alloca (p - tokstart + 1);
+
+ memcpy (err_copy, tokstart, p - tokstart);
+ err_copy[p - tokstart] = 0;
+ error ("Invalid number \"%s\".", err_copy);
+ }
+ lexptr = p;
+ return toktype;
+ }
+
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '|':
+ case '&':
+ case '^':
+ case '~':
+ case '!':
+ case '@':
+ case '<':
+ case '>':
+ case '[':
+ case ']':
+ case '?':
+ case ':':
+ case '=':
+ case '{':
+ case '}':
+ symbol:
+ lexptr++;
+ return c;
+
+ case '"':
+
+ /* Build the gdb internal form of the input string in tempbuf,
+ translating any standard C escape forms seen. Note that the
+ buffer is null byte terminated *only* for the convenience of
+ debugging gdb itself and printing the buffer contents when
+ the buffer contains no embedded nulls. Gdb does not depend
+ upon the buffer being null byte terminated, it uses the length
+ string instead. This allows gdb to handle C strings (as well
+ as strings in other languages) with embedded null bytes */
+
+ tokptr = ++tokstart;
+ tempbufindex = 0;
+
+ do {
+ /* Grow the static temp buffer if necessary, including allocating
+ the first one on demand. */
+ if (tempbufindex + 1 >= tempbufsize)
+ {
+ tempbuf = (char *) realloc (tempbuf, tempbufsize += 64);
+ }
+ switch (*tokptr)
+ {
+ case '\0':
+ case '"':
+ /* Do nothing, loop will terminate. */
+ break;
+ case '\\':
+ tokptr++;
+ c = parse_escape (&tokptr);
+ if (c == -1)
+ {
+ continue;
+ }
+ tempbuf[tempbufindex++] = c;
+ break;
+ default:
+ tempbuf[tempbufindex++] = *tokptr++;
+ break;
+ }
+ } while ((*tokptr != '"') && (*tokptr != '\0'));
+ if (*tokptr++ != '"')
+ {
+ error ("Unterminated string in expression.");
+ }
+ tempbuf[tempbufindex] = '\0'; /* See note above */
+ yylval.sval.ptr = tempbuf;
+ yylval.sval.length = tempbufindex;
+ lexptr = tokptr;
+ return (STRING);
+ }
+
+ if (!(c == '_' || c == '$'
+ || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
+ /* We must have come across a bad character (e.g. ';'). */
+ error ("Invalid character '%c' in expression.", c);
+
+ /* It's a name. See how long it is. */
+ namelen = 0;
+ for (c = tokstart[namelen];
+ (c == '_' || c == '$' || (c >= '0' && c <= '9')
+ || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
+ {
+ /* Template parameter lists are part of the name.
+ FIXME: This mishandles `print $a<4&&$a>3'. */
+ if (c == '<')
+ {
+ int i = namelen;
+ int nesting_level = 1;
+ while (tokstart[++i])
+ {
+ if (tokstart[i] == '<')
+ nesting_level++;
+ else if (tokstart[i] == '>')
+ {
+ if (--nesting_level == 0)
+ break;
+ }
+ }
+ if (tokstart[i] == '>')
+ namelen = i;
+ else
+ break;
+ }
+
+ /* do NOT uppercase internals because of registers !!! */
+ c = tokstart[++namelen];
+ }
+
+ uptokstart = uptok(tokstart,namelen);
+
+ /* The token "if" terminates the expression and is NOT
+ removed from the input stream. */
+ if (namelen == 2 && uptokstart[0] == 'I' && uptokstart[1] == 'F')
+ {
+ return 0;
+ }
+
+ lexptr += namelen;
+
+ tryname:
+
+ /* Catch specific keywords. Should be done with a data structure. */
+ switch (namelen)
+ {
+ case 6:
+ if (STREQ (uptokstart, "OBJECT"))
+ return CLASS;
+ if (STREQ (uptokstart, "RECORD"))
+ return STRUCT;
+ if (STREQ (uptokstart, "SIZEOF"))
+ return SIZEOF;
+ break;
+ case 5:
+ if (STREQ (uptokstart, "CLASS"))
+ return CLASS;
+ if (STREQ (uptokstart, "FALSE"))
+ {
+ yylval.lval = 0;
+ return FALSE;
+ }
+ break;
+ case 4:
+ if (STREQ (uptokstart, "TRUE"))
+ {
+ yylval.lval = 1;
+ return TRUE;
+ }
+ if (STREQ (uptokstart, "SELF"))
+ {
+ /* here we search for 'this' like
+ inserted in FPC stabs debug info */
+ static const char this_name[] =
+ { /* CPLUS_MARKER,*/ 't', 'h', 'i', 's', '\0' };
+
+ if (lookup_symbol (this_name, expression_context_block,
+ VAR_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL))
+ return THIS;
+ }
+ break;
+ default:
+ break;
+ }
+
+ yylval.sval.ptr = tokstart;
+ yylval.sval.length = namelen;
+
+ if (*tokstart == '$')
+ {
+ /* $ is the normal prefix for pascal hexadecimal values
+ but this conflicts with the GDB use for debugger variables
+ so in expression to enter hexadecimal values
+ we still need to use C syntax with 0xff */
+ write_dollar_variable (yylval.sval);
+ return VARIABLE;
+ }
+
+ /* Use token-type BLOCKNAME for symbols that happen to be defined as
+ functions or symtabs. If this is not so, then ...
+ Use token-type TYPENAME for symbols that happen to be defined
+ currently as names of types; NAME for other symbols.
+ The caller is not constrained to care about the distinction. */
+ {
+ char *tmp = copy_name (yylval.sval);
+ struct symbol *sym;
+ int is_a_field_of_this = 0;
+ int hextype;
+
+ sym = lookup_symbol (tmp, expression_context_block,
+ VAR_NAMESPACE,
+ &is_a_field_of_this,
+ (struct symtab **) NULL);
+ /* second chance uppercased (as Free Pascal does). */
+ if (!sym && !is_a_field_of_this)
+ {
+ for (i = 0; i <= namelen; i++)
+ {
+ if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
+ tmp[i] -= ('a'-'A');
+ }
+ sym = lookup_symbol (tmp, expression_context_block,
+ VAR_NAMESPACE,
+ &is_a_field_of_this,
+ (struct symtab **) NULL);
+ if (sym || is_a_field_of_this)
+ for (i = 0; i <= namelen; i++)
+ {
+ if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
+ tokstart[i] -= ('a'-'A');
+ }
+ }
+ /* Third chance Capitalized (as GPC does). */
+ if (!sym && !is_a_field_of_this)
+ {
+ for (i = 0; i <= namelen; i++)
+ {
+ if (i == 0)
+ {
+ if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
+ tmp[i] -= ('a'-'A');
+ }
+ else
+ if ((tmp[i] >= 'A' && tmp[i] <= 'Z'))
+ tmp[i] -= ('A'-'a');
+ }
+ sym = lookup_symbol (tmp, expression_context_block,
+ VAR_NAMESPACE,
+ &is_a_field_of_this,
+ (struct symtab **) NULL);
+ if (sym || is_a_field_of_this)
+ for (i = 0; i <= namelen; i++)
+ {
+ if (i == 0)
+ {
+ if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
+ tokstart[i] -= ('a'-'A');
+ }
+ else
+ if ((tokstart[i] >= 'A' && tokstart[i] <= 'Z'))
+ tokstart[i] -= ('A'-'a');
+ }
+ }
+ /* Call lookup_symtab, not lookup_partial_symtab, in case there are
+ no psymtabs (coff, xcoff, or some future change to blow away the
+ psymtabs once once symbols are read). */
+ if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
+ lookup_symtab (tmp))
+ {
+ yylval.ssym.sym = sym;
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this;
+ return BLOCKNAME;
+ }
+ if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ {
+#if 1
+ /* Despite the following flaw, we need to keep this code enabled.
+ Because we can get called from check_stub_method, if we don't
+ handle nested types then it screws many operations in any
+ program which uses nested types. */
+ /* In "A::x", if x is a member function of A and there happens
+ to be a type (nested or not, since the stabs don't make that
+ distinction) named x, then this code incorrectly thinks we
+ are dealing with nested types rather than a member function. */
+
+ char *p;
+ char *namestart;
+ struct symbol *best_sym;
+
+ /* Look ahead to detect nested types. This probably should be
+ done in the grammar, but trying seemed to introduce a lot
+ of shift/reduce and reduce/reduce conflicts. It's possible
+ that it could be done, though. Or perhaps a non-grammar, but
+ less ad hoc, approach would work well. */
+
+ /* Since we do not currently have any way of distinguishing
+ a nested type from a non-nested one (the stabs don't tell
+ us whether a type is nested), we just ignore the
+ containing type. */
+
+ p = lexptr;
+ best_sym = sym;
+ while (1)
+ {
+ /* Skip whitespace. */
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ ++p;
+ if (*p == ':' && p[1] == ':')
+ {
+ /* Skip the `::'. */
+ p += 2;
+ /* Skip whitespace. */
+ while (*p == ' ' || *p == '\t' || *p == '\n')
+ ++p;
+ namestart = p;
+ while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
+ || (*p >= 'a' && *p <= 'z')
+ || (*p >= 'A' && *p <= 'Z'))
+ ++p;
+ if (p != namestart)
+ {
+ struct symbol *cur_sym;
+ /* As big as the whole rest of the expression, which is
+ at least big enough. */
+ char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3);
+ char *tmp1;
+
+ tmp1 = ncopy;
+ memcpy (tmp1, tmp, strlen (tmp));
+ tmp1 += strlen (tmp);
+ memcpy (tmp1, "::", 2);
+ tmp1 += 2;
+ memcpy (tmp1, namestart, p - namestart);
+ tmp1[p - namestart] = '\0';
+ cur_sym = lookup_symbol (ncopy, expression_context_block,
+ VAR_NAMESPACE, (int *) NULL,
+ (struct symtab **) NULL);
+ if (cur_sym)
+ {
+ if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
+ {
+ best_sym = cur_sym;
+ lexptr = p;
+ }
+ else
+ break;
+ }
+ else
+ break;
+ }
+ else
+ break;
+ }
+ else
+ break;
+ }
+
+ yylval.tsym.type = SYMBOL_TYPE (best_sym);
+#else /* not 0 */
+ yylval.tsym.type = SYMBOL_TYPE (sym);
+#endif /* not 0 */
+ return TYPENAME;
+ }
+ if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
+ return TYPENAME;
+
+ /* Input names that aren't symbols but ARE valid hex numbers,
+ when the input radix permits them, can be names or numbers
+ depending on the parse. Note we support radixes > 16 here. */
+ if (!sym &&
+ ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
+ (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
+ {
+ YYSTYPE newlval; /* Its value is ignored. */
+ hextype = parse_number (tokstart, namelen, 0, &newlval);
+ if (hextype == INT)
+ {
+ yylval.ssym.sym = sym;
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this;
+ return NAME_OR_INT;
+ }
+ }
+
+ free(uptokstart);
+ /* Any other kind of symbol */
+ yylval.ssym.sym = sym;
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this;
+ return NAME;
+ }
+}
+
+void
+yyerror (msg)
+ char *msg;
+{
+ error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
+}
diff --git a/contrib/gdb/gdb/p-lang.c b/contrib/gdb/gdb/p-lang.c
new file mode 100644
index 0000000..62c8a64
--- /dev/null
+++ b/contrib/gdb/gdb/p-lang.c
@@ -0,0 +1,465 @@
+/* Pascal language support routines for GDB, the GNU debugger.
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is derived from c-lang.c */
+
+#include "defs.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "expression.h"
+#include "parser-defs.h"
+#include "language.h"
+#include "p-lang.h"
+#include "valprint.h"
+#include <ctype.h>
+
+extern void _initialize_pascal_language (void);
+
+
+/* Determines if type TYPE is a pascal string type.
+ Returns 1 if the type is a known pascal type
+ This function is used by p-valprint.c code to allow better string display.
+ If it is a pascal string type, then it also sets info needed
+ to get the length and the data of the string
+ length_pos, length_size and string_pos are given in bytes.
+ char_size gives the element size in bytes.
+ FIXME: if the position or the size of these fields
+ are not multiple of TARGET_CHAR_BIT then the results are wrong
+ but this does not happen for Free Pascal nor for GPC. */
+int
+is_pascal_string_type (struct type *type,int *length_pos,
+ int * length_size, int *string_pos, int *char_size)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ {
+ /* Old Borland type pascal strings from Free Pascal Compiler. */
+ /* Two fields: length and st. */
+ if (TYPE_NFIELDS (type) == 2
+ && strcmp (TYPE_FIELDS (type)[0].name, "length") == 0
+ && strcmp (TYPE_FIELDS (type)[1].name, "st") == 0)
+ {
+ *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
+ *length_size = TYPE_FIELD_TYPE (type, 0)->length;
+ *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *char_size = 1;
+ return 1;
+ };
+ /* GNU pascal strings. */
+ /* Three fields: Capacity, length and schema$ or _p_schema. */
+ if (TYPE_NFIELDS (type) == 3
+ && strcmp (TYPE_FIELDS (type)[0].name, "Capacity") == 0
+ && strcmp (TYPE_FIELDS (type)[1].name, "length") == 0)
+ {
+ *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *length_size = TYPE_FIELD_TYPE (type, 1)->length;
+ *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
+ /* FIXME: how can I detect wide chars in GPC ?? */
+ *char_size = 1;
+ return 1;
+ };
+ }
+ return 0;
+}
+
+static void pascal_one_char (int, struct ui_file *, int *);
+
+/* Print the character C on STREAM as part of the contents of a literal
+ string.
+ In_quotes is reset to 0 if a char is written with #4 notation */
+
+static void
+pascal_one_char (register int c, struct ui_file *stream, int *in_quotes)
+{
+
+ c &= 0xFF; /* Avoid sign bit follies */
+
+ if ((c == '\'') || (PRINT_LITERAL_FORM (c)))
+ {
+ if (!(*in_quotes))
+ fputs_filtered ("'", stream);
+ *in_quotes = 1;
+ if (c == '\'')
+ {
+ fputs_filtered ("''", stream);
+ }
+ else
+ fprintf_filtered (stream, "%c", c);
+ }
+ else
+ {
+ if (*in_quotes)
+ fputs_filtered ("'", stream);
+ *in_quotes = 0;
+ fprintf_filtered (stream, "#%d", (unsigned int) c);
+ }
+}
+
+static void pascal_emit_char (int c, struct ui_file *stream, int quoter);
+
+/* Print the character C on STREAM as part of the contents of a literal
+ string whose delimiter is QUOTER. Note that that format for printing
+ characters and strings is language specific. */
+
+static void
+pascal_emit_char (register int c, struct ui_file *stream, int quoter)
+{
+ int in_quotes = 0;
+ pascal_one_char (c, stream, &in_quotes);
+ if (in_quotes)
+ fputs_filtered ("'", stream);
+}
+
+void
+pascal_printchar (int c, struct ui_file *stream)
+{
+ int in_quotes = 0;
+ pascal_one_char (c, stream, &in_quotes);
+ if (in_quotes)
+ fputs_filtered ("'", stream);
+}
+
+/* Print the character string STRING, printing at most LENGTH characters.
+ Printing stops early if the number hits print_max; repeat counts
+ are printed as appropriate. Print ellipses at the end if we
+ had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */
+
+void
+pascal_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
+{
+ register unsigned int i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+ extern int inspect_it;
+
+ /* If the string was not truncated due to `set print elements', and
+ the last byte of it is a null, we don't print that, in traditional C
+ style. */
+ if ((!force_ellipses) && length > 0 && string[length - 1] == '\0')
+ length--;
+
+ if (length == 0)
+ {
+ fputs_filtered ("''", stream);
+ return;
+ }
+
+ for (i = 0; i < length && things_printed < print_max; ++i)
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+ unsigned int rep1;
+ /* Number of repetitions we have detected so far. */
+ unsigned int reps;
+
+ QUIT;
+
+ if (need_comma)
+ {
+ fputs_filtered (", ", stream);
+ need_comma = 0;
+ }
+
+ rep1 = i + 1;
+ reps = 1;
+ while (rep1 < length && string[rep1] == string[i])
+ {
+ ++rep1;
+ ++reps;
+ }
+
+ if (reps > repeat_count_threshold)
+ {
+ if (in_quotes)
+ {
+ if (inspect_it)
+ fputs_filtered ("\\', ", stream);
+ else
+ fputs_filtered ("', ", stream);
+ in_quotes = 0;
+ }
+ pascal_printchar (string[i], stream);
+ fprintf_filtered (stream, " <repeats %u times>", reps);
+ i = rep1 - 1;
+ things_printed += repeat_count_threshold;
+ need_comma = 1;
+ }
+ else
+ {
+ int c = string[i];
+ if ((!in_quotes) && (PRINT_LITERAL_FORM (c)))
+ {
+ if (inspect_it)
+ fputs_filtered ("\\'", stream);
+ else
+ fputs_filtered ("'", stream);
+ in_quotes = 1;
+ }
+ pascal_one_char (c, stream, &in_quotes);
+ ++things_printed;
+ }
+ }
+
+ /* Terminate the quotes if necessary. */
+ if (in_quotes)
+ {
+ if (inspect_it)
+ fputs_filtered ("\\'", stream);
+ else
+ fputs_filtered ("'", stream);
+ }
+
+ if (force_ellipses || i < length)
+ fputs_filtered ("...", stream);
+}
+
+/* Create a fundamental Pascal type using default reasonable for the current
+ target machine.
+
+ Some object/debugging file formats (DWARF version 1, COFF, etc) do not
+ define fundamental types such as "int" or "double". Others (stabs or
+ DWARF version 2, etc) do define fundamental types. For the formats which
+ don't provide fundamental types, gdb can create such types using this
+ function.
+
+ FIXME: Some compilers distinguish explicitly signed integral types
+ (signed short, signed int, signed long) from "regular" integral types
+ (short, int, long) in the debugging information. There is some dis-
+ agreement as to how useful this feature is. In particular, gcc does
+ not support this. Also, only some debugging formats allow the
+ distinction to be passed on to a debugger. For now, we always just
+ use "short", "int", or "long" as the type name, for both the implicit
+ and explicitly signed types. This also makes life easier for the
+ gdb test suite since we don't have to account for the differences
+ in output depending upon what the compiler and debugging format
+ support. We will probably have to re-examine the issue when gdb
+ starts taking it's fundamental type information directly from the
+ debugging information supplied by the compiler. fnf@cygnus.com */
+
+/* Note there might be some discussion about the choosen correspondance
+ because it mainly reflects Free Pascal Compiler setup for now PM */
+
+
+struct type *
+pascal_create_fundamental_type (struct objfile *objfile, int typeid)
+{
+ register struct type *type = NULL;
+
+ switch (typeid)
+ {
+ default:
+ /* FIXME: For now, if we are asked to produce a type not in this
+ language, create the equivalent of a C integer type with the
+ name "<?type?>". When all the dust settles from the type
+ reconstruction work, this should probably become an error. */
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ 0, "<?type?>", objfile);
+ warning ("internal error: no Pascal fundamental type %d", typeid);
+ break;
+ case FT_VOID:
+ type = init_type (TYPE_CODE_VOID,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "void", objfile);
+ break;
+ case FT_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "char", objfile);
+ break;
+ case FT_SIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "shortint", objfile);
+ break;
+ case FT_UNSIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "byte", objfile);
+ break;
+ case FT_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ 0, "integer", objfile);
+ break;
+ case FT_SIGNED_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ 0, "integer", objfile); /* FIXME-fnf */
+ break;
+ case FT_UNSIGNED_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "word", objfile);
+ break;
+ case FT_INTEGER:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ 0, "longint", objfile);
+ break;
+ case FT_SIGNED_INTEGER:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ 0, "longint", objfile); /* FIXME -fnf */
+ break;
+ case FT_UNSIGNED_INTEGER:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "cardinal", 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, "extended", objfile);
+ break;
+ }
+ return (type);
+}
+
+
+/* Table mapping opcodes into strings for printing operators
+ and precedences of the operators. */
+
+const struct op_print pascal_op_print_tab[] =
+{
+ {",", BINOP_COMMA, PREC_COMMA, 0},
+ {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+ {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
+ {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
+ {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
+ {"=", BINOP_EQUAL, PREC_EQUAL, 0},
+ {"<>", BINOP_NOTEQUAL, PREC_EQUAL, 0},
+ {"<=", BINOP_LEQ, PREC_ORDER, 0},
+ {">=", BINOP_GEQ, PREC_ORDER, 0},
+ {">", BINOP_GTR, PREC_ORDER, 0},
+ {"<", BINOP_LESS, PREC_ORDER, 0},
+ {"shr", BINOP_RSH, PREC_SHIFT, 0},
+ {"shl", 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},
+ {"div", BINOP_INTDIV, PREC_MUL, 0},
+ {"mod", BINOP_REM, PREC_MUL, 0},
+ {"@", BINOP_REPEAT, PREC_REPEAT, 0},
+ {"-", UNOP_NEG, PREC_PREFIX, 0},
+ {"not", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+ {"^", UNOP_IND, PREC_SUFFIX, 1},
+ {"@", UNOP_ADDR, PREC_PREFIX, 0},
+ {"sizeof", UNOP_SIZEOF, PREC_PREFIX, 0},
+ {NULL, 0, 0, 0}
+};
+
+struct type **const (pascal_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
+};
+
+const struct language_defn pascal_language_defn =
+{
+ "pascal", /* Language name */
+ language_pascal,
+ pascal_builtin_types,
+ range_check_on,
+ type_check_on,
+ case_sensitive_on,
+ pascal_parse,
+ pascal_error,
+ evaluate_subexp_standard,
+ pascal_printchar, /* Print a character constant */
+ pascal_printstr, /* Function to print string constant */
+ pascal_emit_char, /* Print a single char */
+ pascal_create_fundamental_type, /* Create fundamental type in this language */
+ pascal_print_type, /* Print a type using appropriate syntax */
+ pascal_val_print, /* Print a value using appropriate syntax */
+ pascal_value_print, /* Print a top-level value */
+ {"", "%", "b", ""}, /* Binary format info */
+ {"0%lo", "0", "o", ""}, /* Octal format info */
+ {"%ld", "", "d", ""}, /* Decimal format info */
+ {"$%lx", "$", "x", ""}, /* Hex format info */
+ pascal_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
+ 0, /* String lower bound */
+ &builtin_type_char, /* Type of string elements */
+ LANG_MAGIC
+};
+
+void
+_initialize_pascal_language (void)
+{
+ add_language (&pascal_language_defn);
+}
diff --git a/contrib/gdb/gdb/p-lang.h b/contrib/gdb/gdb/p-lang.h
new file mode 100644
index 0000000..ca8a0a9
--- /dev/null
+++ b/contrib/gdb/gdb/p-lang.h
@@ -0,0 +1,75 @@
+/* Pascal language support definitions for GDB, the GNU debugger.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is derived from c-lang.h */
+
+struct value;
+
+extern int pascal_parse (void); /* Defined in p-exp.y */
+
+extern void pascal_error (char *); /* Defined in p-exp.y */
+
+/* Defined in p-typeprint.c */
+extern void pascal_print_type (struct type *, char *, struct ui_file *, int, int);
+
+extern int pascal_val_print (struct type *, char *, int, CORE_ADDR, struct ui_file *, int, int,
+ int, enum val_prettyprint);
+
+extern int pascal_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
+
+extern void pascal_type_print_method_args (char *, char *,
+ struct ui_file *);
+
+/* These are in p-lang.c: */
+
+extern int is_pascal_string_type (struct type *, int *, int *, int *, int*);
+
+extern void pascal_printchar (int, struct ui_file *);
+
+extern void pascal_printstr (struct ui_file *, char *, unsigned int, int, int);
+
+extern struct type *pascal_create_fundamental_type (struct objfile *, int);
+
+extern struct type **const (pascal_builtin_types[]);
+
+/* These are in p-typeprint.c: */
+
+extern void
+ pascal_type_print_base (struct type *, struct ui_file *, int, int);
+
+extern void
+ pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int);
+
+/* These are in cp-valprint.c */
+
+extern int vtblprint; /* Controls printing of vtbl's */
+
+extern int static_field_print;
+
+extern void pascal_object_print_class_member (char *, struct type *, struct ui_file *, char *);
+
+extern void pascal_object_print_class_method (char *, struct type *, struct ui_file *);
+
+extern void pascal_object_print_value_fields (struct type *, char *, CORE_ADDR,
+ struct ui_file *, int, int, enum val_prettyprint,
+ struct type **, int);
+
+extern int pascal_object_is_vtbl_ptr_type (struct type *);
+
+extern int pascal_object_is_vtbl_member (struct type *);
diff --git a/contrib/gdb/gdb/p-typeprint.c b/contrib/gdb/gdb/p-typeprint.c
new file mode 100644
index 0000000..f7fc389
--- /dev/null
+++ b/contrib/gdb/gdb/p-typeprint.c
@@ -0,0 +1,809 @@
+/* Support for printing Pascal types for GDB, the GNU debugger.
+ Copyright 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is derived from p-typeprint.c */
+
+#include "defs.h"
+#include "obstack.h"
+#include "bfd.h" /* Binary File Description */
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "expression.h"
+#include "value.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "language.h"
+#include "p-lang.h"
+#include "typeprint.h"
+
+#include "gdb_string.h"
+#include <errno.h>
+#include <ctype.h>
+
+static void pascal_type_print_varspec_suffix (struct type *, struct ui_file *, int, int, int);
+
+static void pascal_type_print_derivation_info (struct ui_file *, struct type *);
+
+void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int);
+
+
+/* LEVEL is the depth to indent lines by. */
+
+void
+pascal_print_type (struct type *type, char *varstring, struct ui_file *stream,
+ int show, int level)
+{
+ register enum type_code code;
+ int demangled_args;
+
+ code = TYPE_CODE (type);
+
+ if (show > 0)
+ CHECK_TYPEDEF (type);
+
+ if ((code == TYPE_CODE_FUNC ||
+ code == TYPE_CODE_METHOD))
+ {
+ pascal_type_print_varspec_prefix (type, stream, show, 0);
+ }
+ /* first the name */
+ fputs_filtered (varstring, stream);
+
+ if ((varstring != NULL && *varstring != '\0') &&
+ !(code == TYPE_CODE_FUNC ||
+ code == TYPE_CODE_METHOD))
+ {
+ fputs_filtered (" : ", stream);
+ }
+
+ if (!(code == TYPE_CODE_FUNC ||
+ code == TYPE_CODE_METHOD))
+ {
+ pascal_type_print_varspec_prefix (type, stream, show, 0);
+ }
+
+ pascal_type_print_base (type, 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 ? strchr (varstring, '(') != NULL : 0;
+ pascal_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; };
+
+ Print the type of class C as:
+
+ 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;
+ }
+
+ In general, gdb should try to print the types as closely as possible to
+ the form that they appear in the source code. */
+
+static void
+pascal_type_print_derivation_info (struct ui_file *stream, struct type *type)
+{
+ char *name;
+ int i;
+
+ for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
+ {
+ fputs_filtered (i == 0 ? ": " : ", ", stream);
+ fprintf_filtered (stream, "%s%s ",
+ BASETYPE_VIA_PUBLIC (type, i) ? "public" : "private",
+ BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
+ name = type_name_no_tag (TYPE_BASECLASS (type, i));
+ fprintf_filtered (stream, "%s", name ? name : "(null)");
+ }
+ if (i > 0)
+ {
+ fputs_filtered (" ", stream);
+ }
+}
+
+/* Print the Pascal method arguments ARGS to the file STREAM. */
+
+void
+pascal_type_print_method_args (char *physname, char *methodname,
+ struct ui_file *stream)
+{
+ int is_constructor = STREQN (physname, "__ct__", 6);
+ int is_destructor = STREQN (physname, "__dt__", 6);
+
+ if (is_constructor || is_destructor)
+ {
+ physname += 6;
+ }
+
+ fputs_filtered (methodname, stream);
+
+ if (physname && (*physname != 0))
+ {
+ int i = 0;
+ int len = 0;
+ char storec;
+ char *argname;
+ fputs_filtered (" (", stream);
+ /* we must demangle this */
+ while (isdigit (physname[0]))
+ {
+ while (isdigit (physname[len]))
+ {
+ len++;
+ }
+ i = strtol (physname, &argname, 0);
+ physname += len;
+ storec = physname[i];
+ physname[i] = 0;
+ fputs_filtered (physname, stream);
+ physname[i] = storec;
+ physname += i;
+ if (physname[0] != 0)
+ {
+ fputs_filtered (", ", stream);
+ }
+ }
+ fputs_filtered (")", stream);
+ }
+}
+
+/* Print any asterisks or open-parentheses needed before the
+ variable name (to describe its type).
+
+ On outermost call, pass 0 for PASSED_A_PTR.
+ On outermost call, SHOW > 0 means should ignore
+ any typename for TYPE and show its details.
+ SHOW is always zero on recursive calls. */
+
+void
+pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr)
+{
+ char *name;
+ if (type == 0)
+ return;
+
+ if (TYPE_NAME (type) && show <= 0)
+ return;
+
+ QUIT;
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_PTR:
+ fprintf_filtered (stream, "^");
+ pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
+ break; /* pointer should be handled normally in pascal */
+
+ case TYPE_CODE_MEMBER:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, "(");
+ pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ fprintf_filtered (stream, " ");
+ name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
+ if (name)
+ fputs_filtered (name, stream);
+ else
+ pascal_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
+ fprintf_filtered (stream, "::");
+ break;
+
+ case TYPE_CODE_METHOD:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, "(");
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
+ {
+ fprintf_filtered (stream, "function ");
+ }
+ else
+ {
+ fprintf_filtered (stream, "procedure ");
+ }
+
+ if (passed_a_ptr)
+ {
+ fprintf_filtered (stream, " ");
+ pascal_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
+ fprintf_filtered (stream, "::");
+ }
+ break;
+
+ case TYPE_CODE_REF:
+ pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
+ fprintf_filtered (stream, "&");
+ break;
+
+ case TYPE_CODE_FUNC:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, "(");
+
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
+ {
+ fprintf_filtered (stream, "function ");
+ }
+ else
+ {
+ fprintf_filtered (stream, "procedure ");
+ }
+
+ break;
+
+ case TYPE_CODE_ARRAY:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, "(");
+ fprintf_filtered (stream, "array ");
+ if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
+ && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ fprintf_filtered (stream, "[%d..%d] ",
+ TYPE_ARRAY_LOWER_BOUND_VALUE (type),
+ TYPE_ARRAY_UPPER_BOUND_VALUE (type)
+ );
+ fprintf_filtered (stream, "of ");
+ break;
+
+ case TYPE_CODE_UNDEF:
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_INT:
+ case TYPE_CODE_FLT:
+ case TYPE_CODE_VOID:
+ case TYPE_CODE_ERROR:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_SET:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_STRING:
+ case TYPE_CODE_BITSTRING:
+ case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_TEMPLATE:
+ /* These types need no prefix. They are listed here so that
+ gcc -Wall will reveal any types that haven't been handled. */
+ break;
+ default:
+ error ("type not handled in pascal_type_print_varspec_prefix()");
+ break;
+ }
+}
+
+static void
+pascal_print_func_args (struct type *type, struct ui_file *stream)
+{
+ int i, len = TYPE_NFIELDS (type);
+ if (len)
+ {
+ fprintf_filtered (stream, "(");
+ }
+ for (i = 0; i < len; i++)
+ {
+ if (i > 0)
+ {
+ fputs_filtered (", ", stream);
+ wrap_here (" ");
+ }
+ /* can we find if it is a var parameter ??
+ if ( TYPE_FIELD(type, i) == )
+ {
+ fprintf_filtered (stream, "var ");
+ } */
+ pascal_print_type (TYPE_FIELD_TYPE (type, i), "" /* TYPE_FIELD_NAME seems invalid ! */
+ ,stream, -1, 0);
+ }
+ if (len)
+ {
+ fprintf_filtered (stream, ")");
+ }
+}
+
+/* Print any array sizes, function arguments or close parentheses
+ needed after the variable name (to describe its type).
+ Args work like pascal_type_print_varspec_prefix. */
+
+static void
+pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr,
+ int demangled_args)
+{
+ if (type == 0)
+ return;
+
+ if (TYPE_NAME (type) && show <= 0)
+ return;
+
+ QUIT;
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+ break;
+
+ case TYPE_CODE_MEMBER:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+ pascal_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
+ break;
+
+ case TYPE_CODE_METHOD:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+ pascal_type_print_method_args ("",
+ "",
+ stream);
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
+ {
+ fprintf_filtered (stream, " : ");
+ pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
+ pascal_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+ passed_a_ptr, 0);
+ }
+ break;
+
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_REF:
+ pascal_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
+ break;
+
+ case TYPE_CODE_FUNC:
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+ if (!demangled_args)
+ pascal_print_func_args (type, stream);
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
+ {
+ fprintf_filtered (stream, " : ");
+ pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
+ pascal_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+ passed_a_ptr, 0);
+ }
+ break;
+
+ case TYPE_CODE_UNDEF:
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_INT:
+ case TYPE_CODE_FLT:
+ case TYPE_CODE_VOID:
+ case TYPE_CODE_ERROR:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_SET:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_STRING:
+ case TYPE_CODE_BITSTRING:
+ case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_TEMPLATE:
+ /* These types do not need a suffix. They are listed so that
+ gcc -Wall will report types that may not have been considered. */
+ break;
+ default:
+ error ("type not handled in pascal_type_print_varspec_suffix()");
+ break;
+ }
+}
+
+/* Print the name of the type (or the ultimate pointer target,
+ function value or array element), or the description of a
+ structure or union.
+
+ SHOW positive means print details about the type (e.g. enum values),
+ and print structure elements passing SHOW - 1 for show.
+ SHOW negative means just print the type name or struct tag if there is one.
+ If there is no name, print something sensible but concise like
+ "struct {...}".
+ SHOW zero means just print the type name or struct tag if there is one.
+ If there is no name, print something sensible but not as concise like
+ "struct {int x; int y;}".
+
+ LEVEL is the number of spaces to indent by.
+ We increase it for some recursive calls. */
+
+void
+pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
+{
+ register int i;
+ register int len;
+ register int lastval;
+ enum
+ {
+ s_none, s_public, s_private, s_protected
+ }
+ section_type;
+ QUIT;
+
+ wrap_here (" ");
+ if (type == NULL)
+ {
+ fputs_filtered ("<type unknown>", stream);
+ return;
+ }
+
+ /* void pointer */
+ if ((TYPE_CODE (type) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID))
+ {
+ fprintf_filtered (stream,
+ TYPE_NAME (type) ? TYPE_NAME (type) : "pointer");
+ return;
+ }
+ /* When SHOW is zero or less, and there is a valid type name, then always
+ just print the type name directly from the type. */
+
+ if (show <= 0
+ && TYPE_NAME (type) != NULL)
+ {
+ fputs_filtered (TYPE_NAME (type), stream);
+ return;
+ }
+
+ CHECK_TYPEDEF (type);
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_MEMBER:
+ case TYPE_CODE_REF:
+ /* case TYPE_CODE_FUNC:
+ case TYPE_CODE_METHOD: */
+ pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ break;
+
+ case TYPE_CODE_ARRAY:
+ /* pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ pascal_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0); */
+ pascal_print_type (TYPE_TARGET_TYPE (type), NULL, stream, 0, 0);
+ break;
+
+ case TYPE_CODE_FUNC:
+ case TYPE_CODE_METHOD:
+ /*
+ pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ only after args !! */
+ break;
+ case TYPE_CODE_STRUCT:
+ if (TYPE_TAG_NAME (type) != NULL)
+ {
+ fputs_filtered (TYPE_TAG_NAME (type), stream);
+ fputs_filtered (" = ", stream);
+ }
+ if (HAVE_CPLUS_STRUCT (type))
+ {
+ fprintf_filtered (stream, "class ");
+ }
+ else
+ {
+ fprintf_filtered (stream, "record ");
+ }
+ goto struct_union;
+
+ case TYPE_CODE_UNION:
+ if (TYPE_TAG_NAME (type) != NULL)
+ {
+ fputs_filtered (TYPE_TAG_NAME (type), stream);
+ fputs_filtered (" = ", stream);
+ }
+ fprintf_filtered (stream, "case <?> of ");
+
+ struct_union:
+ wrap_here (" ");
+ if (show < 0)
+ {
+ /* If we just printed a tag name, no need to print anything else. */
+ if (TYPE_TAG_NAME (type) == NULL)
+ fprintf_filtered (stream, "{...}");
+ }
+ else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
+ {
+ pascal_type_print_derivation_info (stream, type);
+
+ fprintf_filtered (stream, "\n");
+ if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
+ {
+ if (TYPE_STUB (type))
+ fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
+ else
+ fprintfi_filtered (level + 4, stream, "<no data fields>\n");
+ }
+
+ /* Start off with no specific section type, so we can print
+ one for the first field we find, and use that section type
+ thereafter until we find another type. */
+
+ section_type = s_none;
+
+ /* If there is a base class for this type,
+ do not print the field that it occupies. */
+
+ len = TYPE_NFIELDS (type);
+ for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+ {
+ QUIT;
+ /* Don't print out virtual function table. */
+ if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
+ && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
+ continue;
+
+ /* If this is a pascal object or class we can print the
+ various section labels. */
+
+ if (HAVE_CPLUS_STRUCT (type))
+ {
+ if (TYPE_FIELD_PROTECTED (type, i))
+ {
+ if (section_type != s_protected)
+ {
+ section_type = s_protected;
+ fprintfi_filtered (level + 2, stream,
+ "protected\n");
+ }
+ }
+ else if (TYPE_FIELD_PRIVATE (type, i))
+ {
+ if (section_type != s_private)
+ {
+ section_type = s_private;
+ fprintfi_filtered (level + 2, stream, "private\n");
+ }
+ }
+ else
+ {
+ if (section_type != s_public)
+ {
+ section_type = s_public;
+ fprintfi_filtered (level + 2, stream, "public\n");
+ }
+ }
+ }
+
+ print_spaces_filtered (level + 4, stream);
+ if (TYPE_FIELD_STATIC (type, i))
+ {
+ fprintf_filtered (stream, "static ");
+ }
+ pascal_print_type (TYPE_FIELD_TYPE (type, i),
+ TYPE_FIELD_NAME (type, i),
+ stream, show - 1, level + 4);
+ if (!TYPE_FIELD_STATIC (type, i)
+ && TYPE_FIELD_PACKED (type, i))
+ {
+ /* It is a bitfield. This code does not attempt
+ to look at the bitpos and reconstruct filler,
+ unnamed fields. This would lead to misleading
+ results if the compiler does not put out fields
+ for such things (I don't know what it does). */
+ fprintf_filtered (stream, " : %d",
+ TYPE_FIELD_BITSIZE (type, i));
+ }
+ fprintf_filtered (stream, ";\n");
+ }
+
+ /* 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");
+
+ /* Pbject pascal: print out the methods */
+
+ for (i = 0; i < len; i++)
+ {
+ struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
+ 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);
+ /* this is GNU C++ specific
+ how can we know constructor/destructor?
+ It might work for GNU pascal */
+ for (j = 0; j < len2; j++)
+ {
+ char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+
+ int is_constructor = STREQN (physname, "__ct__", 6);
+ int is_destructor = STREQN (physname, "__dt__", 6);
+
+ QUIT;
+ if (TYPE_FN_FIELD_PROTECTED (f, j))
+ {
+ if (section_type != s_protected)
+ {
+ section_type = s_protected;
+ fprintfi_filtered (level + 2, stream,
+ "protected\n");
+ }
+ }
+ else if (TYPE_FN_FIELD_PRIVATE (f, j))
+ {
+ if (section_type != s_private)
+ {
+ section_type = s_private;
+ fprintfi_filtered (level + 2, stream, "private\n");
+ }
+ }
+ else
+ {
+ if (section_type != s_public)
+ {
+ section_type = s_public;
+ fprintfi_filtered (level + 2, stream, "public\n");
+ }
+ }
+
+ print_spaces_filtered (level + 4, stream);
+ if (TYPE_FN_FIELD_STATIC_P (f, j))
+ fprintf_filtered (stream, "static ");
+ if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
+ {
+ /* Keep GDB from crashing here. */
+ fprintf_filtered (stream, "<undefined type> %s;\n",
+ TYPE_FN_FIELD_PHYSNAME (f, j));
+ break;
+ }
+
+ if (is_constructor)
+ {
+ fprintf_filtered (stream, "constructor ");
+ }
+ else if (is_destructor)
+ {
+ fprintf_filtered (stream, "destructor ");
+ }
+ else if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0 &&
+ TYPE_CODE (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID)
+ {
+ fprintf_filtered (stream, "function ");
+ }
+ else
+ {
+ fprintf_filtered (stream, "procedure ");
+ }
+ /* this does not work, no idea why !! */
+
+ pascal_type_print_method_args (physname,
+ method_name,
+ stream);
+
+ if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0 &&
+ TYPE_CODE (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID)
+ {
+ fputs_filtered (" : ", stream);
+ type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
+ "", stream, -1);
+ }
+ if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
+ fprintf_filtered (stream, "; virtual");
+
+ fprintf_filtered (stream, ";\n");
+ }
+ }
+ fprintfi_filtered (level, stream, "end");
+ }
+ break;
+
+ case TYPE_CODE_ENUM:
+ if (TYPE_TAG_NAME (type) != NULL)
+ {
+ fputs_filtered (TYPE_TAG_NAME (type), stream);
+ if (show > 0)
+ fputs_filtered (" ", stream);
+ }
+ /* enum is just defined by
+ type enume_name = (enum_member1,enum_member2,...) */
+ fprintf_filtered (stream, " = ");
+ wrap_here (" ");
+ if (show < 0)
+ {
+ /* If we just printed a tag name, no need to print anything else. */
+ if (TYPE_TAG_NAME (type) == NULL)
+ fprintf_filtered (stream, "(...)");
+ }
+ else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
+ {
+ fprintf_filtered (stream, "(");
+ len = TYPE_NFIELDS (type);
+ lastval = 0;
+ for (i = 0; i < len; i++)
+ {
+ QUIT;
+ if (i)
+ fprintf_filtered (stream, ", ");
+ wrap_here (" ");
+ fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
+ if (lastval != TYPE_FIELD_BITPOS (type, i))
+ {
+ fprintf_filtered (stream, " := %d", TYPE_FIELD_BITPOS (type, i));
+ lastval = TYPE_FIELD_BITPOS (type, i);
+ }
+ lastval++;
+ }
+ fprintf_filtered (stream, ")");
+ }
+ break;
+
+ case TYPE_CODE_VOID:
+ fprintf_filtered (stream, "void");
+ break;
+
+ case TYPE_CODE_UNDEF:
+ fprintf_filtered (stream, "record <unknown>");
+ break;
+
+ case TYPE_CODE_ERROR:
+ fprintf_filtered (stream, "<unknown type>");
+ break;
+
+ /* this probably does not work for enums */
+ case TYPE_CODE_RANGE:
+ {
+ struct type *target = TYPE_TARGET_TYPE (type);
+ if (target == NULL)
+ target = builtin_type_long;
+ print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
+ fputs_filtered ("..", stream);
+ print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
+ }
+ break;
+
+ case TYPE_CODE_SET:
+ fputs_filtered ("set of ", stream);
+ pascal_print_type (TYPE_INDEX_TYPE (type), "", stream,
+ show - 1, level);
+ 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
+ {
+ /* At least for dump_symtab, it is important that this not be
+ an error (). */
+ fprintf_filtered (stream, "<invalid unnamed pascal type code %d>",
+ TYPE_CODE (type));
+ }
+ break;
+ }
+}
diff --git a/contrib/gdb/gdb/p-valprint.c b/contrib/gdb/gdb/p-valprint.c
new file mode 100644
index 0000000..0b89c72
--- /dev/null
+++ b/contrib/gdb/gdb/p-valprint.c
@@ -0,0 +1,1117 @@
+/* Support for printing Pascal values for GDB, the GNU debugger.
+ Copyright 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is derived from c-valprint.c */
+
+#include "defs.h"
+#include "obstack.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "expression.h"
+#include "value.h"
+#include "command.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "demangle.h"
+#include "valprint.h"
+#include "typeprint.h"
+#include "language.h"
+#include "target.h"
+#include "annotate.h"
+#include "p-lang.h"
+#include "cp-abi.h"
+
+
+
+
+/* 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
+pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
+{
+ register unsigned int i = 0; /* Number of characters printed */
+ unsigned len;
+ struct type *elttype;
+ unsigned eltlen;
+ int length_pos, length_size, string_pos;
+ int char_size;
+ LONGEST val;
+ CORE_ADDR addr;
+
+ CHECK_TYPEDEF (type);
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
+ {
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ eltlen = TYPE_LENGTH (elttype);
+ len = TYPE_LENGTH (type) / eltlen;
+ if (prettyprint_arrays)
+ {
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ /* For an array of chars, print with string syntax. */
+ if (eltlen == 1 &&
+ ((TYPE_CODE (elttype) == TYPE_CODE_INT)
+ || ((current_language->la_language == language_m2)
+ && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
+ && (format == 0 || format == 's'))
+ {
+ /* If requested, look for the first null char and only print
+ elements up to it. */
+ if (stop_print_at_null)
+ {
+ unsigned int temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+ (valaddr + embedded_offset)[temp_len]
+ && temp_len < len && temp_len < print_max;
+ temp_len++);
+ len = temp_len;
+ }
+
+ LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0);
+ i = len;
+ }
+ else
+ {
+ fprintf_filtered (stream, "{");
+ /* If this is a virtual function table, print the 0th
+ entry specially, and the rest of the members normally. */
+ if (pascal_object_is_vtbl_ptr_type (elttype))
+ {
+ i = 1;
+ fprintf_filtered (stream, "%d vtable entries", len - 1);
+ }
+ else
+ {
+ i = 0;
+ }
+ val_print_array_elements (type, valaddr + embedded_offset, address, stream,
+ format, deref_ref, recurse, pretty, i);
+ fprintf_filtered (stream, "}");
+ }
+ break;
+ }
+ /* Array of unspecified length: treat like pointer to first elt. */
+ addr = address;
+ goto print_unpacked_pointer;
+
+ case TYPE_CODE_PTR:
+ if (format && format != 's')
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ break;
+ }
+ if (vtblprint && pascal_object_is_vtbl_ptr_type (type))
+ {
+ /* 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);
+ break;
+ }
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ if (TYPE_CODE (elttype) == TYPE_CODE_METHOD)
+ {
+ pascal_object_print_class_method (valaddr + embedded_offset, type, stream);
+ }
+ else if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
+ {
+ pascal_object_print_class_member (valaddr + embedded_offset,
+ TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type)),
+ stream, "&");
+ }
+ else
+ {
+ addr = unpack_pointer (type, valaddr + embedded_offset);
+ print_unpacked_pointer:
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+
+ if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
+ {
+ /* Try to print what function it points to. */
+ print_address_demangle (addr, stream, demangle);
+ /* Return value is irrelevant except for string pointers. */
+ return (0);
+ }
+
+ if (addressprint && format != 's')
+ {
+ print_address_numeric (addr, 1, stream);
+ }
+
+ /* For a pointer to char or unsigned char, also print the string
+ pointed to, unless pointer is null. */
+ if (TYPE_LENGTH (elttype) == 1
+ && TYPE_CODE (elttype) == TYPE_CODE_INT
+ && (format == 0 || format == 's')
+ && addr != 0)
+ {
+ /* no wide string yet */
+ i = val_print_string (addr, -1, 1, stream);
+ }
+ /* also for pointers to pascal strings */
+ /* Note: this is Free Pascal specific:
+ as GDB does not recognize stabs pascal strings
+ Pascal strings are mapped to records
+ with lowercase names PM */
+ if (is_pascal_string_type (elttype, &length_pos,
+ &length_size, &string_pos, &char_size)
+ && addr != 0)
+ {
+ ULONGEST string_length;
+ void *buffer;
+ buffer = xmalloc (length_size);
+ read_memory (addr + length_pos, buffer, length_size);
+ string_length = extract_unsigned_integer (buffer, length_size);
+ xfree (buffer);
+ i = val_print_string (addr + string_pos, string_length, char_size, stream);
+ }
+ else if (pascal_object_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);
+ if ((msymbol != NULL)
+ && (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
+ {
+ fputs_filtered (" <", stream);
+ fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
+ fputs_filtered (">", stream);
+ }
+ if (vt_address && vtblprint)
+ {
+ struct value *vt_val;
+ struct symbol *wsym = (struct symbol *) NULL;
+ struct type *wtype;
+ struct symtab *s;
+ 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);
+
+ if (wsym)
+ {
+ wtype = SYMBOL_TYPE (wsym);
+ }
+ else
+ {
+ wtype = TYPE_TARGET_TYPE (type);
+ }
+ vt_val = value_at (wtype, vt_address, NULL);
+ val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
+ VALUE_ADDRESS (vt_val), stream, format,
+ deref_ref, recurse + 1, pretty);
+ if (pretty)
+ {
+ 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
+ the terminating '\0' if necessary. */
+ return i;
+ }
+ break;
+
+ case TYPE_CODE_MEMBER:
+ error ("not implemented: member type in pascal_val_print");
+ break;
+
+ case TYPE_CODE_REF:
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
+ {
+ pascal_object_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)
+ {
+ struct value *deref_val =
+ 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 + 1, pretty);
+ }
+ else
+ fputs_filtered ("???", stream);
+ }
+ break;
+
+ case TYPE_CODE_UNION:
+ if (recurse && !unionprint)
+ {
+ fprintf_filtered (stream, "{...}");
+ break;
+ }
+ /* Fall through. */
+ case TYPE_CODE_STRUCT:
+ if (vtblprint && pascal_object_is_vtbl_ptr_type (type))
+ {
+ /* 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);
+ }
+ else
+ {
+ if (is_pascal_string_type (type, &length_pos, &length_size,
+ &string_pos, &char_size))
+ {
+ len = extract_unsigned_integer (valaddr + embedded_offset + length_pos, length_size);
+ LA_PRINT_STRING (stream, valaddr + embedded_offset + string_pos, len, char_size, 0);
+ }
+ else
+ pascal_object_print_value_fields (type, valaddr + embedded_offset, address, stream, format,
+ recurse, pretty, NULL, 0);
+ }
+ break;
+
+ case TYPE_CODE_ENUM:
+ if (format)
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ break;
+ }
+ len = TYPE_NFIELDS (type);
+ val = unpack_long (type, valaddr + embedded_offset);
+ for (i = 0; i < len; i++)
+ {
+ QUIT;
+ if (val == TYPE_FIELD_BITPOS (type, i))
+ {
+ break;
+ }
+ }
+ if (i < len)
+ {
+ fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
+ }
+ else
+ {
+ print_longest (stream, 'd', 0, val);
+ }
+ break;
+
+ case TYPE_CODE_FUNC:
+ if (format)
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ break;
+ }
+ /* FIXME, we should consider, at least for ANSI C language, eliminating
+ 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_BOOL:
+ format = format ? format : output_format;
+ if (format)
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ else
+ {
+ val = unpack_long (type, valaddr + embedded_offset);
+ if (val == 0)
+ fputs_filtered ("false", stream);
+ else if (val == 1)
+ fputs_filtered ("true", stream);
+ else
+ {
+ fputs_filtered ("true (", stream);
+ fprintf_filtered (stream, "%ld)", (long int) val);
+ }
+ }
+ break;
+
+ 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. */
+ /* 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). */
+ /* FALLTHROUGH */
+
+ case TYPE_CODE_INT:
+ format = format ? format : output_format;
+ if (format)
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ }
+ else
+ {
+ val_print_type_code_int (type, valaddr + embedded_offset, stream);
+ }
+ break;
+
+ case TYPE_CODE_CHAR:
+ format = format ? format : output_format;
+ if (format)
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ }
+ else
+ {
+ val = unpack_long (type, valaddr + embedded_offset);
+ if (TYPE_UNSIGNED (type))
+ fprintf_filtered (stream, "%u", (unsigned int) val);
+ else
+ fprintf_filtered (stream, "%d", (int) val);
+ fputs_filtered (" ", stream);
+ LA_PRINT_CHAR ((unsigned char) val, stream);
+ }
+ break;
+
+ case TYPE_CODE_FLT:
+ if (format)
+ {
+ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ }
+ else
+ {
+ print_floating (valaddr + embedded_offset, type, stream);
+ }
+ break;
+
+ case TYPE_CODE_BITSTRING:
+ case TYPE_CODE_SET:
+ elttype = TYPE_INDEX_TYPE (type);
+ CHECK_TYPEDEF (elttype);
+ if (TYPE_STUB (elttype))
+ {
+ fprintf_filtered (stream, "<incomplete type>");
+ gdb_flush (stream);
+ break;
+ }
+ else
+ {
+ struct type *range = elttype;
+ LONGEST low_bound, high_bound;
+ int i;
+ int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING;
+ int need_comma = 0;
+
+ if (is_bitstring)
+ fputs_filtered ("B'", stream);
+ else
+ fputs_filtered ("[", stream);
+
+ i = get_discrete_bounds (range, &low_bound, &high_bound);
+ maybe_bad_bstring:
+ if (i < 0)
+ {
+ fputs_filtered ("<error value>", stream);
+ goto done;
+ }
+
+ for (i = low_bound; i <= high_bound; i++)
+ {
+ int element = value_bit_index (type, valaddr + embedded_offset, i);
+ if (element < 0)
+ {
+ i = element;
+ goto maybe_bad_bstring;
+ }
+ if (is_bitstring)
+ fprintf_filtered (stream, "%d", element);
+ else if (element)
+ {
+ if (need_comma)
+ fputs_filtered (", ", stream);
+ print_type_scalar (range, i, stream);
+ need_comma = 1;
+
+ if (i + 1 <= high_bound && value_bit_index (type, valaddr + embedded_offset, ++i))
+ {
+ int j = i;
+ fputs_filtered ("..", stream);
+ while (i + 1 <= high_bound
+ && value_bit_index (type, valaddr + embedded_offset, ++i))
+ j = i;
+ print_type_scalar (range, j, stream);
+ }
+ }
+ }
+ done:
+ if (is_bitstring)
+ fputs_filtered ("'", stream);
+ else
+ fputs_filtered ("]", stream);
+ }
+ break;
+
+ case TYPE_CODE_VOID:
+ fprintf_filtered (stream, "void");
+ break;
+
+ case TYPE_CODE_ERROR:
+ fprintf_filtered (stream, "<error type>");
+ break;
+
+ case TYPE_CODE_UNDEF:
+ /* This happens (without TYPE_FLAG_STUB set) on systems which don't use
+ dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
+ and no complete type for struct foo in that file. */
+ fprintf_filtered (stream, "<incomplete type>");
+ break;
+
+ default:
+ error ("Invalid pascal type code %d in symbol table.", TYPE_CODE (type));
+ }
+ gdb_flush (stream);
+ return (0);
+}
+
+int
+pascal_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
+{
+ struct type *type = VALUE_TYPE (val);
+
+ /* If it is a pointer, indicate what it points to.
+
+ Print type also if it is a reference.
+
+ Object pascal: if it is a member pointer, we will take care
+ of that when we print it. */
+ if (TYPE_CODE (type) == TYPE_CODE_PTR ||
+ TYPE_CODE (type) == TYPE_CODE_REF)
+ {
+ /* Hack: remove (char *) for char strings. Their
+ type is indicated by the quoted string anyway. */
+ if (TYPE_CODE (type) == TYPE_CODE_PTR &&
+ TYPE_NAME (type) == NULL &&
+ TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL &&
+ STREQ (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char"))
+ {
+ /* Print nothing */
+ }
+ else
+ {
+ fprintf_filtered (stream, "(");
+ type_print (type, "", stream, -1);
+ fprintf_filtered (stream, ") ");
+ }
+ }
+ return val_print (type, VALUE_CONTENTS (val), VALUE_EMBEDDED_OFFSET (val),
+ VALUE_ADDRESS (val) + VALUE_OFFSET (val),
+ stream, format, 1, 0, pretty);
+}
+
+
+/******************************************************************************
+ Inserted from cp-valprint
+******************************************************************************/
+
+extern int vtblprint; /* Controls printing of vtbl's */
+extern int objectprint; /* Controls looking up an object's derived type
+ using what we find in its vtables. */
+static int pascal_static_field_print; /* Controls printing of static fields. */
+
+static struct obstack dont_print_vb_obstack;
+static struct obstack dont_print_statmem_obstack;
+
+static void pascal_object_print_static_field (struct type *, struct value *,
+ struct ui_file *, int, int,
+ enum val_prettyprint);
+
+static void
+ pascal_object_print_value (struct type *, char *, CORE_ADDR, struct ui_file *,
+ int, int, enum val_prettyprint, struct type **);
+
+void
+pascal_object_print_class_method (char *valaddr, struct type *type,
+ struct ui_file *stream)
+{
+ struct type *domain;
+ struct fn_field *f = NULL;
+ int j = 0;
+ int len2;
+ int offset;
+ char *kind = "";
+ CORE_ADDR addr;
+ struct symbol *sym;
+ unsigned len;
+ unsigned int i;
+ struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
+
+ domain = TYPE_DOMAIN_TYPE (target_type);
+ if (domain == (struct type *) NULL)
+ {
+ fprintf_filtered (stream, "<unknown>");
+ return;
+ }
+ addr = unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr);
+ if (METHOD_PTR_IS_VIRTUAL (addr))
+ {
+ offset = METHOD_PTR_TO_VOFFSET (addr);
+ len = TYPE_NFN_FIELDS (domain);
+ for (i = 0; i < len; i++)
+ {
+ f = TYPE_FN_FIELDLIST1 (domain, i);
+ len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
+
+ for (j = 0; j < len2; j++)
+ {
+ QUIT;
+ if (TYPE_FN_FIELD_VOFFSET (f, j) == offset)
+ {
+ if (TYPE_FN_FIELD_STUB (f, j))
+ check_stub_method (domain, i, j);
+ kind = "virtual ";
+ goto common;
+ }
+ }
+ }
+ }
+ else
+ {
+ sym = find_pc_function (addr);
+ if (sym == 0)
+ {
+ error ("invalid pointer to member function");
+ }
+ len = TYPE_NFN_FIELDS (domain);
+ for (i = 0; i < len; i++)
+ {
+ f = TYPE_FN_FIELDLIST1 (domain, i);
+ len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
+
+ for (j = 0; j < len2; j++)
+ {
+ QUIT;
+ if (TYPE_FN_FIELD_STUB (f, j))
+ check_stub_method (domain, i, j);
+ if (STREQ (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j)))
+ {
+ goto common;
+ }
+ }
+ }
+ }
+common:
+ if (i < len)
+ {
+ char *demangled_name;
+
+ fprintf_filtered (stream, "&");
+ fprintf_filtered (stream, kind);
+ demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j),
+ DMGL_ANSI | DMGL_PARAMS);
+ if (demangled_name == NULL)
+ fprintf_filtered (stream, "<badly mangled name %s>",
+ TYPE_FN_FIELD_PHYSNAME (f, j));
+ else
+ {
+ fputs_filtered (demangled_name, stream);
+ xfree (demangled_name);
+ }
+ }
+ else
+ {
+ fprintf_filtered (stream, "(");
+ type_print (type, "", stream, -1);
+ fprintf_filtered (stream, ") %d", (int) addr >> 3);
+ }
+}
+
+/* It was changed to this after 2.4.5. */
+const char pascal_vtbl_ptr_name[] =
+{'_', '_', 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_', 't', 'y', 'p', 'e', 0};
+
+/* Return truth value for assertion that TYPE is of the type
+ "pointer to virtual function". */
+
+int
+pascal_object_is_vtbl_ptr_type (struct type *type)
+{
+ char *typename = type_name_no_tag (type);
+
+ return (typename != NULL
+ && (STREQ (typename, pascal_vtbl_ptr_name)));
+}
+
+/* Return truth value for the assertion that TYPE is of the type
+ "pointer to virtual function table". */
+
+int
+pascal_object_is_vtbl_member (struct type *type)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ {
+ type = TYPE_TARGET_TYPE (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 */
+ {
+ /* Virtual functions tables are full of pointers
+ to virtual functions. */
+ return pascal_object_is_vtbl_ptr_type (type);
+ }
+ }
+ }
+ return 0;
+}
+
+/* Mutually recursive subroutines of pascal_object_print_value and c_val_print to
+ print out a structure's fields: pascal_object_print_value_fields and pascal_object_print_value.
+
+ TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
+ same meanings as in pascal_object_print_value and c_val_print.
+
+ DONT_PRINT is an array of baseclass types that we
+ should not print, or zero if called from top level. */
+
+void
+pascal_object_print_value_fields (struct type *type, char *valaddr,
+ CORE_ADDR address, struct ui_file *stream,
+ int format, int recurse,
+ enum val_prettyprint pretty,
+ struct type **dont_print_vb,
+ int dont_print_statmem)
+{
+ int i, len, n_baseclasses;
+ struct obstack tmp_obstack;
+ char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
+
+ CHECK_TYPEDEF (type);
+
+ fprintf_filtered (stream, "{");
+ len = TYPE_NFIELDS (type);
+ n_baseclasses = TYPE_N_BASECLASSES (type);
+
+ /* Print out baseclasses such that we don't print
+ duplicates of virtual baseclasses. */
+ if (n_baseclasses > 0)
+ pascal_object_print_value (type, valaddr, address, stream,
+ format, recurse + 1, pretty, dont_print_vb);
+
+ if (!len && n_baseclasses == 1)
+ fprintf_filtered (stream, "<No data fields>");
+ else
+ {
+ extern int inspect_it;
+ int fields_seen = 0;
+
+ if (dont_print_statmem == 0)
+ {
+ /* If we're at top level, carve out a completely fresh
+ chunk of the obstack and use that until this particular
+ invocation returns. */
+ tmp_obstack = dont_print_statmem_obstack;
+ obstack_finish (&dont_print_statmem_obstack);
+ }
+
+ for (i = n_baseclasses; i < len; i++)
+ {
+ /* If requested, skip printing of static fields. */
+ if (!pascal_static_field_print && TYPE_FIELD_STATIC (type, i))
+ continue;
+ if (fields_seen)
+ fprintf_filtered (stream, ", ");
+ else if (n_baseclasses > 0)
+ {
+ if (pretty)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ fputs_filtered ("members of ", stream);
+ fputs_filtered (type_name_no_tag (type), stream);
+ fputs_filtered (": ", stream);
+ }
+ }
+ fields_seen = 1;
+
+ if (pretty)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ else
+ {
+ wrap_here (n_spaces (2 + 2 * recurse));
+ }
+ if (inspect_it)
+ {
+ if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
+ fputs_filtered ("\"( ptr \"", stream);
+ else
+ fputs_filtered ("\"( nodef \"", stream);
+ if (TYPE_FIELD_STATIC (type, i))
+ fputs_filtered ("static ", stream);
+ fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
+ language_cplus,
+ DMGL_PARAMS | DMGL_ANSI);
+ fputs_filtered ("\" \"", stream);
+ fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
+ language_cplus,
+ DMGL_PARAMS | DMGL_ANSI);
+ fputs_filtered ("\") \"", stream);
+ }
+ else
+ {
+ annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+
+ if (TYPE_FIELD_STATIC (type, i))
+ fputs_filtered ("static ", stream);
+ fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
+ language_cplus,
+ DMGL_PARAMS | DMGL_ANSI);
+ annotate_field_name_end ();
+ fputs_filtered (" = ", stream);
+ annotate_field_value ();
+ }
+
+ if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
+ {
+ struct value *v;
+
+ /* Bitfields require special handling, especially due to byte
+ order problems. */
+ if (TYPE_FIELD_IGNORE (type, i))
+ {
+ fputs_filtered ("<optimized out or zero length>", stream);
+ }
+ else
+ {
+ 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);
+ }
+ }
+ else
+ {
+ if (TYPE_FIELD_IGNORE (type, i))
+ {
+ fputs_filtered ("<optimized out or zero length>", stream);
+ }
+ else if (TYPE_FIELD_STATIC (type, i))
+ {
+ /* struct value *v = value_static_field (type, i); v4.17 specific */
+ struct value *v;
+ v = value_from_longest (TYPE_FIELD_TYPE (type, i),
+ unpack_field_as_long (type, valaddr, i));
+
+ if (v == NULL)
+ fputs_filtered ("<optimized out>", stream);
+ else
+ pascal_object_print_static_field (TYPE_FIELD_TYPE (type, i), v,
+ stream, format, recurse + 1,
+ pretty);
+ }
+ else
+ {
+ /* val_print (TYPE_FIELD_TYPE (type, i),
+ valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
+ address + TYPE_FIELD_BITPOS (type, i) / 8, 0,
+ stream, format, 0, recurse + 1, pretty); */
+ val_print (TYPE_FIELD_TYPE (type, i),
+ valaddr, TYPE_FIELD_BITPOS (type, i) / 8,
+ address + TYPE_FIELD_BITPOS (type, i) / 8,
+ stream, format, 0, recurse + 1, pretty);
+ }
+ }
+ annotate_field_end ();
+ }
+
+ if (dont_print_statmem == 0)
+ {
+ /* Free the space used to deal with the printing
+ of the members from top level. */
+ obstack_free (&dont_print_statmem_obstack, last_dont_print);
+ dont_print_statmem_obstack = tmp_obstack;
+ }
+
+ if (pretty)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 * recurse, stream);
+ }
+ }
+ fprintf_filtered (stream, "}");
+}
+
+/* Special val_print routine to avoid printing multiple copies of virtual
+ baseclasses. */
+
+void
+pascal_object_print_value (struct type *type, char *valaddr, CORE_ADDR address,
+ struct ui_file *stream, int format, int recurse,
+ enum val_prettyprint pretty,
+ struct type **dont_print_vb)
+{
+ struct obstack tmp_obstack;
+ struct type **last_dont_print
+ = (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. */
+ tmp_obstack = dont_print_vb_obstack;
+ /* Bump up the high-water mark. Now alpha is omega. */
+ obstack_finish (&dont_print_vb_obstack);
+ }
+
+ for (i = 0; i < n_baseclasses; i++)
+ {
+ int boffset;
+ struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+ char *basename = TYPE_NAME (baseclass);
+ char *base_valaddr;
+
+ if (BASETYPE_VIA_VIRTUAL (type, i))
+ {
+ struct type **first_dont_print
+ = (struct type **) obstack_base (&dont_print_vb_obstack);
+
+ int j = (struct type **) obstack_next_free (&dont_print_vb_obstack)
+ - first_dont_print;
+
+ while (--j >= 0)
+ if (baseclass == first_dont_print[j])
+ goto flush_it;
+
+ obstack_ptr_grow (&dont_print_vb_obstack, baseclass);
+ }
+
+ boffset = baseclass_offset (type, i, valaddr, address);
+
+ if (pretty)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 * recurse, stream);
+ }
+ fputs_filtered ("<", stream);
+ /* Not sure what the best notation is in the case where there is no
+ baseclass name. */
+
+ fputs_filtered (basename ? basename : "", stream);
+ fputs_filtered ("> = ", stream);
+
+ /* 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 < 0 || boffset >= TYPE_LENGTH (type)))
+ {
+ /* FIXME (alloc): not safe is baseclass is really really big. */
+ base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
+ if (target_read_memory (address + boffset, base_valaddr,
+ TYPE_LENGTH (baseclass)) != 0)
+ boffset = -1;
+ }
+ else
+ base_valaddr = valaddr + boffset;
+
+ if (boffset == -1)
+ fprintf_filtered (stream, "<invalid address>");
+ else
+ pascal_object_print_value_fields (baseclass, base_valaddr, address + boffset,
+ stream, format, recurse, pretty,
+ (struct type **) obstack_base (&dont_print_vb_obstack),
+ 0);
+ fputs_filtered (", ", stream);
+
+ flush_it:
+ ;
+ }
+
+ if (dont_print_vb == 0)
+ {
+ /* Free the space used to deal with the printing
+ 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. */
+ dont_print_vb_obstack = tmp_obstack;
+ }
+}
+
+/* Print value of a static member.
+ To avoid infinite recursion when printing a class that contains
+ a static instance of the class, we keep the addresses of all printed
+ static member classes in an obstack and refuse to print them more
+ than once.
+
+ VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY
+ have the same meanings as in c_val_print. */
+
+static void
+pascal_object_print_static_field (struct type *type, struct value *val,
+ struct ui_file *stream, int format,
+ int recurse, enum val_prettyprint pretty)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ {
+ CORE_ADDR *first_dont_print;
+ int i;
+
+ first_dont_print
+ = (CORE_ADDR *) obstack_base (&dont_print_statmem_obstack);
+ i = (CORE_ADDR *) obstack_next_free (&dont_print_statmem_obstack)
+ - first_dont_print;
+
+ while (--i >= 0)
+ {
+ if (VALUE_ADDRESS (val) == first_dont_print[i])
+ {
+ fputs_filtered ("<same as static member of an already seen type>",
+ stream);
+ return;
+ }
+ }
+
+ obstack_grow (&dont_print_statmem_obstack, (char *) &VALUE_ADDRESS (val),
+ sizeof (CORE_ADDR));
+
+ CHECK_TYPEDEF (type);
+ pascal_object_print_value_fields (type, VALUE_CONTENTS (val), VALUE_ADDRESS (val),
+ stream, format, recurse, pretty, NULL, 1);
+ return;
+ }
+ val_print (type, VALUE_CONTENTS (val), 0, VALUE_ADDRESS (val),
+ stream, format, 0, recurse, pretty);
+}
+
+void
+pascal_object_print_class_member (char *valaddr, struct type *domain,
+ struct ui_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. */
+ int extra = 0;
+ int bits = 0;
+ register unsigned int i;
+ unsigned len = TYPE_NFIELDS (domain);
+ /* @@ Make VAL into bit offset */
+ LONGEST val = unpack_long (builtin_type_int, valaddr) << 3;
+ for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
+ {
+ int bitpos = TYPE_FIELD_BITPOS (domain, i);
+ QUIT;
+ if (val == bitpos)
+ break;
+ if (val < bitpos && i != 0)
+ {
+ /* Somehow pointing into a field. */
+ i -= 1;
+ extra = (val - TYPE_FIELD_BITPOS (domain, i));
+ if (extra & 0x7)
+ bits = 1;
+ else
+ extra >>= 3;
+ break;
+ }
+ }
+ if (i < len)
+ {
+ char *name;
+ fprintf_filtered (stream, prefix);
+ name = type_name_no_tag (domain);
+ if (name)
+ fputs_filtered (name, stream);
+ else
+ pascal_type_print_base (domain, stream, 0, 0);
+ fprintf_filtered (stream, "::");
+ fputs_filtered (TYPE_FIELD_NAME (domain, i), stream);
+ if (extra)
+ fprintf_filtered (stream, " + %d bytes", extra);
+ if (bits)
+ fprintf_filtered (stream, " (offset in bits)");
+ }
+ else
+ fprintf_filtered (stream, "%ld", (long int) (val >> 3));
+}
+
+
+void
+_initialize_pascal_valprint (void)
+{
+ add_show_from_set
+ (add_set_cmd ("pascal_static-members", class_support, var_boolean,
+ (char *) &pascal_static_field_print,
+ "Set printing of pascal static members.",
+ &setprintlist),
+ &showprintlist);
+ /* Turn on printing of static fields. */
+ pascal_static_field_print = 1;
+
+}
diff --git a/contrib/gdb/gdb/parse.c b/contrib/gdb/gdb/parse.c
index af68fbf..b3fbe19 100644
--- a/contrib/gdb/gdb/parse.c
+++ b/contrib/gdb/gdb/parse.c
@@ -1,23 +1,25 @@
/* Parse expressions for GDB.
- Copyright (C) 1986, 89, 90, 91, 94, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
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,10 +29,11 @@ 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"
#include "gdb_string.h"
-#include <ctype.h>
#include "symtab.h"
#include "gdbtypes.h"
#include "frame.h"
@@ -40,7 +43,26 @@ 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 */
+#include "inferior.h" /* for NUM_PSEUDO_REGS. NOTE: replace
+ with "gdbarch.h" when appropriate. */
+#include "doublest.h"
+
+
+/* Symbols which architectures can redefine. */
+
+/* Some systems have routines whose names start with `$'. Giving this
+ macro a non-zero value tells GDB's expression parser to check for
+ such routines when parsing tokens that begin with `$'.
+
+ On HP-UX, certain system routines (millicode) have names beginning
+ with `$' or `$$'. For example, `$$dyncall' is a millicode routine
+ that handles inter-space procedure calls on PA-RISC. */
+#ifndef SYMBOLS_CAN_START_WITH_DOLLAR
+#define SYMBOLS_CAN_START_WITH_DOLLAR (0)
+#endif
+
+
/* Global variables declared in parser-defs.h (and commented there). */
struct expression *expout;
@@ -56,20 +78,18 @@ char *namecopy;
int paren_depth;
int comma_terminates;
-#ifdef MAINTENANCE_CMDS
static int expressiondebug = 0;
-#endif
extern int hp_som_som_object_present;
-static void
-free_funcalls PARAMS ((void));
+static void free_funcalls (void *ignore);
-static void
-prefixify_expression PARAMS ((struct expression *));
+static void prefixify_expression (struct expression *);
static void
-prefixify_subexp PARAMS ((struct expression *, struct expression *, int, int));
+prefixify_subexp (struct expression *, struct expression *, int, int);
+
+void _initialize_parse (void);
/* Data structure for saving values of arglist_len for function calls whose
arguments contain other function calls. */
@@ -85,60 +105,27 @@ static struct funcall *funcall_chain;
/* Assign machine-independent names to certain registers
(unless overridden by the REGISTER_NAMES table) */
-#ifdef NO_STD_REGS
unsigned num_std_regs = 0;
-struct std_regs std_regs[1];
-#else
-struct std_regs std_regs[] = {
-
-#ifdef PC_REGNUM
- { "pc", PC_REGNUM },
-#endif
-#ifdef FP_REGNUM
- { "fp", FP_REGNUM },
-#endif
-#ifdef SP_REGNUM
- { "sp", SP_REGNUM },
-#endif
-#ifdef PS_REGNUM
- { "ps", PS_REGNUM },
-#endif
-
-};
-
-unsigned num_std_regs = (sizeof std_regs / sizeof std_regs[0]);
-
-#endif
+struct std_regs *std_regs;
/* The generic method for targets to specify how their registers are
named. The mapping can be derived from three sources:
REGISTER_NAME; std_regs; or a target specific alias hook. */
int
-target_map_name_to_register (str, len)
- char *str;
- int len;
+target_map_name_to_register (char *str, int len)
{
int i;
- /* First try target specific aliases. We try these first because on some
- 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);
- if (i >= 0)
- return i;
-#endif
-
- /* Search architectural register name space. */
- for (i = 0; i < NUM_REGS; i++)
+ /* Search register name space. */
+ for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
if (REGISTER_NAME (i) && len == strlen (REGISTER_NAME (i))
&& STREQN (str, REGISTER_NAME (i), len))
{
return i;
}
- /* Try standard aliases */
+ /* Try standard aliases. */
for (i = 0; i < num_std_regs; i++)
if (std_regs[i].name && len == strlen (std_regs[i].name)
&& STREQN (str, std_regs[i].name, len))
@@ -153,7 +140,7 @@ target_map_name_to_register (str, len)
saving the data about any containing call. */
void
-start_arglist ()
+start_arglist (void)
{
register struct funcall *new;
@@ -168,13 +155,13 @@ start_arglist ()
and restore the data for the containing function call. */
int
-end_arglist ()
+end_arglist (void)
{
register int val = arglist_len;
register struct funcall *call = funcall_chain;
funcall_chain = call->next;
arglist_len = call->arglist_len;
- free ((PTR)call);
+ xfree (call);
return val;
}
@@ -182,14 +169,14 @@ end_arglist ()
Used when there is an error inside parsing. */
static void
-free_funcalls ()
+free_funcalls (void *ignore)
{
register struct funcall *call, *next;
for (call = funcall_chain; call; call = next)
{
next = call->next;
- free ((PTR)call);
+ xfree (call);
}
}
@@ -202,8 +189,7 @@ free_funcalls ()
a register through here */
void
-write_exp_elt (expelt)
- union exp_element expelt;
+write_exp_elt (union exp_element expelt)
{
if (expout_ptr >= expout_size)
{
@@ -216,8 +202,7 @@ write_exp_elt (expelt)
}
void
-write_exp_elt_opcode (expelt)
- enum exp_opcode expelt;
+write_exp_elt_opcode (enum exp_opcode expelt)
{
union exp_element tmp;
@@ -227,8 +212,7 @@ write_exp_elt_opcode (expelt)
}
void
-write_exp_elt_sym (expelt)
- struct symbol *expelt;
+write_exp_elt_sym (struct symbol *expelt)
{
union exp_element tmp;
@@ -238,8 +222,7 @@ write_exp_elt_sym (expelt)
}
void
-write_exp_elt_block (b)
- struct block *b;
+write_exp_elt_block (struct block *b)
{
union exp_element tmp;
tmp.block = b;
@@ -247,8 +230,7 @@ write_exp_elt_block (b)
}
void
-write_exp_elt_longcst (expelt)
- LONGEST expelt;
+write_exp_elt_longcst (LONGEST expelt)
{
union exp_element tmp;
@@ -258,8 +240,7 @@ write_exp_elt_longcst (expelt)
}
void
-write_exp_elt_dblcst (expelt)
- DOUBLEST expelt;
+write_exp_elt_dblcst (DOUBLEST expelt)
{
union exp_element tmp;
@@ -269,8 +250,7 @@ write_exp_elt_dblcst (expelt)
}
void
-write_exp_elt_type (expelt)
- struct type *expelt;
+write_exp_elt_type (struct type *expelt)
{
union exp_element tmp;
@@ -280,8 +260,7 @@ write_exp_elt_type (expelt)
}
void
-write_exp_elt_intern (expelt)
- struct internalvar *expelt;
+write_exp_elt_intern (struct internalvar *expelt)
{
union exp_element tmp;
@@ -312,8 +291,7 @@ write_exp_elt_intern (expelt)
void
-write_exp_string (str)
- struct stoken str;
+write_exp_string (struct stoken str)
{
register int len = str.length;
register int lenelt;
@@ -362,8 +340,7 @@ write_exp_string (str)
either end of the bitstring. */
void
-write_exp_bitstring (str)
- struct stoken str;
+write_exp_bitstring (struct stoken str)
{
register int bits = str.length; /* length in bits */
register int len = (bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
@@ -410,25 +387,25 @@ static struct type *msym_data_symbol_type;
static struct type *msym_unknown_symbol_type;
void
-write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
- struct minimal_symbol *msymbol;
- struct type *text_symbol_type;
- struct type *data_symbol_type;
+write_exp_msymbol (struct minimal_symbol *msymbol,
+ struct type *text_symbol_type,
+ struct type *data_symbol_type)
{
CORE_ADDR addr;
write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (lookup_pointer_type (builtin_type_void));
+ /* Let's make the type big enough to hold a 64-bit address. */
+ write_exp_elt_type (builtin_type_CORE_ADDR);
addr = SYMBOL_VALUE_ADDRESS (msymbol);
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:
@@ -452,37 +429,33 @@ write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
/* 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)
- struct stoken str;
+write_dollar_variable (struct stoken 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;
-
int negate = 0;
int i = 1;
/* Double dollar means negate the number and add -1 as well.
@@ -495,7 +468,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? */
@@ -506,54 +479,63 @@ 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
- with $ or $$, e.g. $$dyncall, which handles inter-space procedure
- calls on PA-RISC. Check for those, first. */
-
- sym = lookup_symbol (copy_name (str), (struct block *) NULL,
- VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
- if (sym)
+ if (SYMBOLS_CAN_START_WITH_DOLLAR)
{
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_block (block_found); /* set by lookup_symbol */
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- return;
+ struct symbol *sym = NULL;
+ struct minimal_symbol *msym = NULL;
+
+ /* On HP-UX, certain system routines (millicode) have names beginning
+ with $ or $$, e.g. $$dyncall, which handles inter-space procedure
+ calls on PA-RISC. Check for those, first. */
+
+ /* This code is not enabled on non HP-UX systems, since worst case
+ symbol table lookup performance is awful, to put it mildly. */
+
+ sym = lookup_symbol (copy_name (str), (struct block *) 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_sym (sym);
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ return;
+ }
+ msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
+ if (msym)
+ {
+ write_exp_msymbol (msym,
+ lookup_function_type (builtin_type_int),
+ builtin_type_int);
+ return;
+ }
}
- msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
- if (msym)
- {
- write_exp_msymbol (msym,
- 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;
}
@@ -581,20 +563,17 @@ 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;
+parse_nested_classes_for_hpacc (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).
@@ -614,18 +593,16 @@ 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 int i;
- int colons_found = 0;
+ register char *p;
+ char *start, *end;
+ char *prefix = NULL;
+ char *tmp;
+ struct symbol *sym_class = NULL;
+ struct symbol *sym_var = NULL;
+ struct type *t;
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
@@ -636,99 +613,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);
-
-#if 0 /* DEBUGGING */
- printf ("Searching for nested class spec: Prefix is %s\n", prefix);
-#endif
/* 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 */
@@ -740,80 +718,76 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
if (argptr)
*argptr = done ? p : end;
-#if 0 /* DEBUGGING */
- printf ("Searching for nested class spec: Token is %s, class_prefix %d\n", *token, *class_prefix);
-#endif
-
- return sym_var ? sym_var : sym_class; /* found */
+ return sym_var ? sym_var : sym_class; /* found */
}
char *
-find_template_name_end (p)
- char * p;
+find_template_name_end (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;
}
+
-
/* Return a null-terminated temporary copy of the name
of a string token. */
char *
-copy_name (token)
- struct stoken token;
+copy_name (struct stoken token)
{
memcpy (namecopy, token.ptr, token.length);
namecopy[token.length] = 0;
@@ -824,11 +798,10 @@ copy_name (token)
to prefix form (in which we can conveniently print or execute it). */
static void
-prefixify_expression (expr)
- register struct expression *expr;
+prefixify_expression (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;
@@ -844,9 +817,7 @@ prefixify_expression (expr)
whose last exp_element is at index ENDPOS - 1 in EXPR. */
int
-length_of_subexp (expr, endpos)
- register struct expression *expr;
- register int endpos;
+length_of_subexp (register struct expression *expr, register int endpos)
{
register int oplen = 1;
register int args = 0;
@@ -880,9 +851,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:
@@ -895,9 +866,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;
@@ -947,9 +918,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:
@@ -980,11 +951,8 @@ length_of_subexp (expr, endpos)
In the process, convert it from suffix to prefix form. */
static void
-prefixify_subexp (inexpr, outexpr, inend, outbeg)
- register struct expression *inexpr;
- struct expression *outexpr;
- register int inend;
- int outbeg;
+prefixify_subexp (register struct expression *inexpr,
+ struct expression *outexpr, register int inend, int outbeg)
{
register int oplen = 1;
register int args = 0;
@@ -1020,9 +988,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:
@@ -1049,8 +1017,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:
@@ -1091,7 +1059,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;
@@ -1149,10 +1117,7 @@ prefixify_subexp (inexpr, outexpr, inend, outbeg)
If COMMA is nonzero, stop if a comma is reached. */
struct expression *
-parse_exp_1 (stringptr, block, comma)
- char **stringptr;
- struct block *block;
- int comma;
+parse_exp_1 (char **stringptr, struct block *block, int comma)
{
struct cleanup *old_chain;
@@ -1166,7 +1131,7 @@ parse_exp_1 (stringptr, block, comma)
if (lexptr == 0 || *lexptr == 0)
error_no_arg ("expression to compute");
- old_chain = make_cleanup ((make_cleanup_func) free_funcalls, 0);
+ old_chain = make_cleanup (free_funcalls, 0 /*ignore*/);
funcall_chain = 0;
expression_context_block = block ? block : get_selected_block ();
@@ -1177,7 +1142,7 @@ parse_exp_1 (stringptr, block, comma)
expout = (struct expression *)
xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
expout->language_defn = current_language;
- make_cleanup ((make_cleanup_func) free_current_contents, &expout);
+ make_cleanup (free_current_contents, &expout);
if (current_language->la_parser ())
current_language->la_error (NULL);
@@ -1196,19 +1161,15 @@ parse_exp_1 (stringptr, block, comma)
/* Convert expression from postfix form as generated by yacc
parser, to a prefix form. */
-#ifdef MAINTENANCE_CMDS
if (expressiondebug)
- dump_prefix_expression (expout, gdb_stdout,
+ dump_prefix_expression (expout, gdb_stdlog,
"before conversion to prefix form");
-#endif /* MAINTENANCE_CMDS */
prefixify_expression (expout);
-#ifdef MAINTENANCE_CMDS
if (expressiondebug)
- dump_postfix_expression (expout, gdb_stdout,
+ dump_postfix_expression (expout, gdb_stdlog,
"after conversion to prefix form");
-#endif /* MAINTENANCE_CMDS */
*stringptr = lexptr;
return expout;
@@ -1218,8 +1179,7 @@ parse_exp_1 (stringptr, block, comma)
to use up all of the contents of STRING. */
struct expression *
-parse_expression (string)
- char *string;
+parse_expression (char *string)
{
register struct expression *exp;
exp = parse_exp_1 (&string, 0, 0);
@@ -1231,9 +1191,8 @@ 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
-push_type (tp)
- enum type_pieces tp;
+static void
+check_type_stack_depth (void)
{
if (type_stack_depth == type_stack_size)
{
@@ -1241,24 +1200,30 @@ push_type (tp)
type_stack = (union type_stack_elt *)
xrealloc ((char *) type_stack, type_stack_size * sizeof (*type_stack));
}
+}
+
+void
+push_type (enum type_pieces tp)
+{
+ check_type_stack_depth ();
type_stack[type_stack_depth++].piece = tp;
}
void
-push_type_int (n)
- int n;
+push_type_int (int n)
{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc ((char *) type_stack, type_stack_size * sizeof (*type_stack));
- }
+ check_type_stack_depth ();
type_stack[type_stack_depth++].int_val = n;
}
-enum type_pieces
-pop_type ()
+void
+push_type_address_space (char *string)
+{
+ push_type_int (address_space_name_to_int (string));
+}
+
+enum type_pieces
+pop_type (void)
{
if (type_stack_depth)
return type_stack[--type_stack_depth].piece;
@@ -1266,7 +1231,7 @@ pop_type ()
}
int
-pop_type_int ()
+pop_type_int (void)
{
if (type_stack_depth)
return type_stack[--type_stack_depth].int_val;
@@ -1277,10 +1242,12 @@ pop_type_int ()
/* Pop the type stack and return the type which corresponds to FOLLOW_TYPE
as modified by all the stuff on the stack. */
struct type *
-follow_types (follow_type)
- struct type *follow_type;
+follow_types (struct type *follow_type)
{
int done = 0;
+ int make_const = 0;
+ int make_volatile = 0;
+ int make_addr_space = 0;
int array_size;
struct type *range_type;
@@ -1289,12 +1256,60 @@ follow_types (follow_type)
{
case tp_end:
done = 1;
+ if (make_const)
+ follow_type = make_cv_type (make_const,
+ TYPE_VOLATILE (follow_type),
+ follow_type, 0);
+ if (make_volatile)
+ follow_type = make_cv_type (TYPE_CONST (follow_type),
+ make_volatile,
+ follow_type, 0);
+ if (make_addr_space)
+ follow_type = make_type_with_address_space (follow_type,
+ make_addr_space);
+ make_const = make_volatile = 0;
+ make_addr_space = 0;
+ break;
+ case tp_const:
+ make_const = 1;
+ break;
+ case tp_volatile:
+ make_volatile = 1;
+ break;
+ case tp_space_identifier:
+ make_addr_space = pop_type_int ();
break;
case tp_pointer:
follow_type = lookup_pointer_type (follow_type);
+ if (make_const)
+ follow_type = make_cv_type (make_const,
+ TYPE_VOLATILE (follow_type),
+ follow_type, 0);
+ if (make_volatile)
+ follow_type = make_cv_type (TYPE_CONST (follow_type),
+ make_volatile,
+ follow_type, 0);
+ if (make_addr_space)
+ follow_type = make_type_with_address_space (follow_type,
+ make_addr_space);
+ make_const = make_volatile = 0;
+ make_addr_space = 0;
break;
case tp_reference:
follow_type = lookup_reference_type (follow_type);
+ if (make_const)
+ follow_type = make_cv_type (make_const,
+ TYPE_VOLATILE (follow_type),
+ follow_type, 0);
+ if (make_volatile)
+ follow_type = make_cv_type (TYPE_CONST (follow_type),
+ make_volatile,
+ follow_type, 0);
+ if (make_addr_space)
+ follow_type = make_type_with_address_space (follow_type,
+ make_addr_space);
+ make_const = make_volatile = 0;
+ make_addr_space = 0;
break;
case tp_array:
array_size = pop_type_int ();
@@ -1308,7 +1323,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:
@@ -1320,13 +1335,11 @@ follow_types (follow_type)
return follow_type;
}
-void
-_initialize_parse ()
+static void build_parse (void);
+static void
+build_parse (void)
{
- type_stack_size = 80;
- type_stack_depth = 0;
- type_stack = (union type_stack_elt *)
- xmalloc (type_stack_size * sizeof (*type_stack));
+ int i;
msym_text_symbol_type =
init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
@@ -1339,13 +1352,90 @@ _initialize_parse ()
"<variable (not text or data), no debug info>",
NULL);
-#ifdef MAINTENANCE_CMDS
+ /* create the std_regs table */
+
+ num_std_regs = 0;
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef SP_REGNUM
+ if (SP_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef PS_REGNUM
+ if (PS_REGNUM >= 0)
+ num_std_regs++;
+#endif
+ /* create an empty table */
+ std_regs = xmalloc ((num_std_regs + 1) * sizeof *std_regs);
+ i = 0;
+ /* fill it in */
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ {
+ std_regs[i].name = "pc";
+ std_regs[i].regnum = PC_REGNUM;
+ i++;
+ }
+#endif
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ {
+ std_regs[i].name = "fp";
+ std_regs[i].regnum = FP_REGNUM;
+ i++;
+ }
+#endif
+#ifdef SP_REGNUM
+ if (SP_REGNUM >= 0)
+ {
+ std_regs[i].name = "sp";
+ std_regs[i].regnum = SP_REGNUM;
+ i++;
+ }
+#endif
+#ifdef PS_REGNUM
+ if (PS_REGNUM >= 0)
+ {
+ std_regs[i].name = "ps";
+ std_regs[i].regnum = PS_REGNUM;
+ i++;
+ }
+#endif
+ memset (&std_regs[i], 0, sizeof (std_regs[i]));
+}
+
+void
+_initialize_parse (void)
+{
+ type_stack_size = 80;
+ type_stack_depth = 0;
+ type_stack = (union type_stack_elt *)
+ xmalloc (type_stack_size * sizeof (*type_stack));
+
+ build_parse ();
+
+ /* 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 (&msym_text_symbol_type, sizeof (msym_text_symbol_type), NULL);
+ register_gdbarch_swap (&msym_data_symbol_type, sizeof (msym_data_symbol_type), NULL);
+ register_gdbarch_swap (&msym_unknown_symbol_type, sizeof (msym_unknown_symbol_type), NULL);
+
+ register_gdbarch_swap (&num_std_regs, sizeof (std_regs), NULL);
+ register_gdbarch_swap (&std_regs, sizeof (std_regs), NULL);
+ 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 ("expression", class_maintenance, var_zinteger,
+ (char *) &expressiondebug,
+ "Set expression debugging.\n\
When non-zero, the internal representation of expressions will be printed.",
- &setlist),
- &showlist);
-#endif
+ &setdebuglist),
+ &showdebuglist);
}
diff --git a/contrib/gdb/gdb/parser-defs.h b/contrib/gdb/gdb/parser-defs.h
index 3226fdd..66e929f 100644
--- a/contrib/gdb/gdb/parser-defs.h
+++ b/contrib/gdb/gdb/parser-defs.h
@@ -1,33 +1,38 @@
/* Parser definitions for GDB.
- Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000 Free Software Foundation, Inc.
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;
-};
+#include "doublest.h"
-extern struct std_regs std_regs[];
+struct std_regs
+ {
+ char *name;
+ int regnum;
+ };
+
+extern struct std_regs *std_regs;
extern unsigned num_std_regs;
extern struct expression *expout;
@@ -78,69 +83,74 @@ 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,
+ tp_const,
+ tp_volatile,
+ tp_space_identifier
+ };
/* 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;
-extern void write_exp_elt PARAMS ((union exp_element));
+extern void write_exp_elt (union exp_element);
+
+extern void write_exp_elt_opcode (enum exp_opcode);
-extern void write_exp_elt_opcode PARAMS ((enum exp_opcode));
+extern void write_exp_elt_sym (struct symbol *);
-extern void write_exp_elt_sym PARAMS ((struct symbol *));
+extern void write_exp_elt_longcst (LONGEST);
-extern void write_exp_elt_longcst PARAMS ((LONGEST));
+extern void write_exp_elt_dblcst (DOUBLEST);
-extern void write_exp_elt_dblcst PARAMS ((DOUBLEST));
+extern void write_exp_elt_type (struct type *);
-extern void write_exp_elt_type PARAMS ((struct type *));
+extern void write_exp_elt_intern (struct internalvar *);
-extern void write_exp_elt_intern PARAMS ((struct internalvar *));
+extern void write_exp_string (struct stoken);
-extern void write_exp_string PARAMS ((struct stoken));
+extern void write_exp_bitstring (struct stoken);
-extern void write_exp_bitstring PARAMS ((struct stoken));
+extern void write_exp_elt_block (struct block *);
-extern void write_exp_elt_block PARAMS ((struct block *));
+extern void write_exp_msymbol (struct minimal_symbol *,
+ struct type *, struct type *);
-extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
- struct type *, struct type *));
+extern void write_dollar_variable (struct stoken str);
-extern void write_dollar_variable PARAMS ((struct stoken str));
+extern struct symbol *parse_nested_classes_for_hpacc (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 (char *);
-extern char * find_template_name_end PARAMS ((char *));
+extern void start_arglist (void);
-extern void
-start_arglist PARAMS ((void));
+extern int end_arglist (void);
-extern int
-end_arglist PARAMS ((void));
+extern char *copy_name (struct stoken);
-extern char *
-copy_name PARAMS ((struct stoken));
+extern void push_type (enum type_pieces);
-extern void
-push_type PARAMS ((enum type_pieces));
+extern void push_type_int (int);
-extern void
-push_type_int PARAMS ((int));
+extern void push_type_address_space (char *);
-extern enum type_pieces
-pop_type PARAMS ((void));
+extern enum type_pieces pop_type (void);
-extern int
-pop_type_int PARAMS ((void));
+extern int pop_type_int (void);
-extern int
-length_of_subexp PARAMS ((struct expression *, int));
+extern int length_of_subexp (struct expression *, int);
-extern struct type *follow_types PARAMS ((struct type *));
+extern struct type *follow_types (struct type *);
/* During parsing of a C expression, the pointer to the next character
is in this variable. */
@@ -175,24 +185,32 @@ 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;
-};
-
-#endif /* PARSER_DEFS_H */
+ {
+ 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:
+ REGISTER_NAME; std_regs; or a target specific alias hook. */
+
+extern int target_map_name_to_register (char *, int);
+
+#endif /* PARSER_DEFS_H */
diff --git a/contrib/gdb/gdb/ppc-bdm.c b/contrib/gdb/gdb/ppc-bdm.c
index e6b6adfd..b2287ea 100644
--- a/contrib/gdb/gdb/ppc-bdm.c
+++ b/contrib/gdb/gdb/ppc-bdm.c
@@ -1,22 +1,24 @@
/* Remote target communications for the Macraigor Systems BDM Wiggler
talking to a Motorola PPC 8xx ADS board
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -27,27 +29,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "symfile.h"
#include "target.h"
-#include "wait.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
#include <sys/types.h>
-#include <signal.h>
#include "serial.h"
#include "ocd.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
-static void bdm_ppc_open PARAMS ((char *name, int from_tty));
+static void bdm_ppc_open (char *name, int from_tty);
-static int bdm_ppc_wait PARAMS ((int pid,
- struct target_waitstatus *target_status));
+static ptid_t bdm_ppc_wait (ptid_t ptid,
+ struct target_waitstatus *target_status);
-static void bdm_ppc_fetch_registers PARAMS ((int regno));
+static void bdm_ppc_fetch_registers (int regno);
-static void bdm_ppc_store_registers PARAMS ((int regno));
+static void bdm_ppc_store_registers (int regno);
extern struct target_ops bdm_ppc_ops; /* Forward decl */
-/*#define BDM_NUM_REGS 71*/
+/*#define BDM_NUM_REGS 71 */
#define BDM_NUM_REGS 24
#define BDM_REGMAP \
@@ -67,18 +69,17 @@ 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) */
-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. */
static void
-bdm_ppc_open (name, from_tty)
- char *name;
- int from_tty;
+bdm_ppc_open (char *name, int from_tty)
{
CORE_ADDR watchdogaddr = 0xff000004;
@@ -97,10 +98,8 @@ bdm_ppc_open (name, from_tty)
Returns "pid" (though it's not clear what, if anything, that
means in the case of this target). */
-static int
-bdm_ppc_wait (pid, target_status)
- int pid;
- struct target_waitstatus *target_status;
+static ptid_t
+bdm_ppc_wait (ptid_t ptid, struct target_waitstatus *target_status)
{
int stop_reason;
@@ -111,48 +110,48 @@ bdm_ppc_wait (pid, target_status)
if (stop_reason)
{
target_status->value.sig = TARGET_SIGNAL_INT;
- return inferior_pid;
+ return inferior_ptid;
}
- 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
- return inferior_pid;
+ return inferior_ptid;
}
-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
-bdm_ppc_fetch_registers (regno)
- int regno;
+bdm_ppc_fetch_registers (int regno)
{
int i;
unsigned char *regs, *beginregs, *endregs, *almostregs;
@@ -183,8 +182,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)
@@ -201,27 +200,28 @@ bdm_ppc_fetch_registers (regno)
/* printf("Asking for register %d\n", first_regno); */
/* if asking for an invalid register */
- if ((first_regno == MQ_REGNUM) ||
- ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
+ if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_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 +236,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 +247,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 */
}
}
@@ -255,8 +255,7 @@ bdm_ppc_fetch_registers (regno)
of REGISTERS. FIXME: ignores errors. */
static void
-bdm_ppc_store_registers (regno)
- int regno;
+bdm_ppc_store_registers (int regno)
{
int i;
int first_regno, last_regno;
@@ -275,8 +274,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 +285,101 @@ 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)))
+ if ((i != gdbarch_tdep (current_gdbarch)->ppc_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 == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
+ printf("don't write invalid reg %d (PPC_MQ_REGNUM)\n", bdm_regno);
+ else
+ printf("don't write invalid reg %d\n", bdm_regno);
+ */
}
}
/* 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_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 ()
+_initialize_bdm_ppc (void)
{
- init_bdm_ppc_ops() ;
+ init_bdm_ppc_ops ();
add_target (&bdm_ppc_ops);
}
diff --git a/contrib/gdb/gdb/ppc-linux-nat.c b/contrib/gdb/gdb/ppc-linux-nat.c
new file mode 100644
index 0000000..e4bb868
--- /dev/null
+++ b/contrib/gdb/gdb/ppc-linux-nat.c
@@ -0,0 +1,532 @@
+/* PPC GNU/Linux native support.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <signal.h>
+#include <sys/user.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <sys/procfs.h>
+#include <sys/ptrace.h>
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+#include "ppc-tdep.h"
+
+#ifndef PT_READ_U
+#define PT_READ_U PTRACE_PEEKUSR
+#endif
+#ifndef PT_WRITE_U
+#define PT_WRITE_U PTRACE_POKEUSR
+#endif
+
+/* Default the type of the ptrace transfer to int. */
+#ifndef PTRACE_XFER_TYPE
+#define PTRACE_XFER_TYPE int
+#endif
+
+/* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
+ configure time check. Some older glibc's (for instance 2.2.1)
+ don't have a specific powerpc version of ptrace.h, and fall back on
+ a generic one. In such cases, sys/ptrace.h defines
+ PTRACE_GETFPXREGS and PTRACE_SETFPXREGS to the same numbers that
+ ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and
+ PTRACE_SETVRREGS to be. This also makes a configury check pretty
+ much useless. */
+
+/* These definitions should really come from the glibc header files,
+ but Glibc doesn't know about the vrregs yet. */
+#ifndef PTRACE_GETVRREGS
+#define PTRACE_GETVRREGS 18
+#define PTRACE_SETVRREGS 19
+#endif
+
+/* This oddity is because the Linux kernel defines elf_vrregset_t as
+ an array of 33 16 bytes long elements. I.e. it leaves out vrsave.
+ However the PTRACE_GETVRREGS and PTRACE_SETVRREGS requests return
+ the vrsave as an extra 4 bytes at the end. I opted for creating a
+ flat array of chars, so that it is easier to manipulate for gdb.
+
+ There are 32 vector registers 16 bytes longs, plus a VSCR register
+ which is only 4 bytes long, but is fetched as a 16 bytes
+ quantity. Up to here we have the elf_vrregset_t structure.
+ Appended to this there is space for the VRSAVE register: 4 bytes.
+ Even though this vrsave register is not included in the regset
+ typedef, it is handled by the ptrace requests.
+
+ Note that GNU/Linux doesn't support little endian PPC hardware,
+ therefore the offset at which the real value of the VSCR register
+ is located will be always 12 bytes.
+
+ The layout is like this (where x is the actual value of the vscr reg): */
+
+/* *INDENT-OFF* */
+/*
+ |.|.|.|.|.....|.|.|.|.||.|.|.|x||.|
+ <-------> <-------><-------><->
+ VR0 VR31 VSCR VRSAVE
+*/
+/* *INDENT-ON* */
+
+#define SIZEOF_VRREGS 33*16+4
+
+typedef char gdb_vrregset_t[SIZEOF_VRREGS];
+
+/* For runtime check of ptrace support for VRREGS. */
+int have_ptrace_getvrregs = 1;
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
+/* *INDENT-OFF* */
+/* registers layout, as presented by the ptrace interface:
+PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
+PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_R13, PT_R14, PT_R15,
+PT_R16, PT_R17, PT_R18, PT_R19, PT_R20, PT_R21, PT_R22, PT_R23,
+PT_R24, PT_R25, PT_R26, PT_R27, PT_R28, PT_R29, PT_R30, PT_R31,
+PT_FPR0, PT_FPR0 + 2, PT_FPR0 + 4, PT_FPR0 + 6, PT_FPR0 + 8, PT_FPR0 + 10, PT_FPR0 + 12, PT_FPR0 + 14,
+PT_FPR0 + 16, PT_FPR0 + 18, PT_FPR0 + 20, PT_FPR0 + 22, PT_FPR0 + 24, PT_FPR0 + 26, PT_FPR0 + 28, PT_FPR0 + 30,
+PT_FPR0 + 32, PT_FPR0 + 34, PT_FPR0 + 36, PT_FPR0 + 38, PT_FPR0 + 40, PT_FPR0 + 42, PT_FPR0 + 44, PT_FPR0 + 46,
+PT_FPR0 + 48, PT_FPR0 + 50, PT_FPR0 + 52, PT_FPR0 + 54, PT_FPR0 + 56, PT_FPR0 + 58, PT_FPR0 + 60, PT_FPR0 + 62,
+PT_NIP, PT_MSR, PT_CCR, PT_LNK, PT_CTR, PT_XER, PT_MQ */
+/* *INDENT_ON * */
+
+static int
+ppc_register_u_addr (int regno)
+{
+ int u_addr = -1;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* General purpose registers occupy 1 slot each in the buffer */
+ if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum )
+ u_addr = ((PT_R0 + regno) * 4);
+
+ /* Floating point regs: 2 slots each */
+ if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
+ u_addr = ((PT_FPR0 + (regno - FP0_REGNUM) * 2) * 4);
+
+ /* UISA special purpose registers: 1 slot each */
+ if (regno == PC_REGNUM)
+ u_addr = PT_NIP * 4;
+ if (regno == tdep->ppc_lr_regnum)
+ u_addr = PT_LNK * 4;
+ if (regno == tdep->ppc_cr_regnum)
+ u_addr = PT_CCR * 4;
+ if (regno == tdep->ppc_xer_regnum)
+ u_addr = PT_XER * 4;
+ if (regno == tdep->ppc_ctr_regnum)
+ u_addr = PT_CTR * 4;
+ if (regno == tdep->ppc_mq_regnum)
+ u_addr = PT_MQ * 4;
+ if (regno == tdep->ppc_ps_regnum)
+ u_addr = PT_MSR * 4;
+
+ return u_addr;
+}
+
+static int
+ppc_ptrace_cannot_fetch_store_register (int regno)
+{
+ return (ppc_register_u_addr (regno) == -1);
+}
+
+/* The Linux kernel ptrace interface for AltiVec registers uses the
+ registers set mechanism, as opposed to the interface for all the
+ other registers, that stores/fetches each register individually. */
+static void
+fetch_altivec_register (int tid, int regno)
+{
+ int ret;
+ int offset = 0;
+ gdb_vrregset_t regs;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int vrregsize = REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+
+ ret = ptrace (PTRACE_GETVRREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getvrregs = 0;
+ return;
+ }
+ perror_with_name ("Unable to fetch AltiVec register");
+ }
+
+ /* VSCR is fetched as a 16 bytes quantity, but it is really 4 bytes
+ long on the hardware. We deal only with the lower 4 bytes of the
+ vector. VRSAVE is at the end of the array in a 4 bytes slot, so
+ there is no need to define an offset for it. */
+ if (regno == (tdep->ppc_vrsave_regnum - 1))
+ offset = vrregsize - REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+
+ supply_register (regno,
+ regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
+}
+
+static void
+fetch_register (int tid, int regno)
+{
+ /* This isn't really an address. But ptrace thinks of it as one. */
+ char mess[128]; /* For messages */
+ register int i;
+ unsigned int offset; /* Offset of registers within the u area. */
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ CORE_ADDR regaddr = ppc_register_u_addr (regno);
+
+ if (altivec_register_p (regno))
+ {
+ /* If this is the first time through, or if it is not the first
+ time through, and we have comfirmed that there is kernel
+ support for such a ptrace request, then go and fetch the
+ register. */
+ if (have_ptrace_getvrregs)
+ {
+ fetch_altivec_register (tid, regno);
+ return;
+ }
+ /* If we have discovered that there is no ptrace support for
+ AltiVec registers, fall through and return zeroes, because
+ regaddr will be -1 in this case. */
+ }
+
+ if (regaddr == -1)
+ {
+ memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
+ supply_register (regno, buf);
+ return;
+ }
+
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
+ (PTRACE_ARG3_TYPE) regaddr, 0);
+ regaddr += sizeof (PTRACE_XFER_TYPE);
+ if (errno != 0)
+ {
+ sprintf (mess, "reading register %s (#%d)",
+ REGISTER_NAME (regno), regno);
+ perror_with_name (mess);
+ }
+ }
+ supply_register (regno, buf);
+}
+
+static void
+supply_vrregset (gdb_vrregset_t *vrregsetp)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int num_of_vrregs = tdep->ppc_vrsave_regnum - tdep->ppc_vr0_regnum + 1;
+ int vrregsize = REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+ int offset = vrregsize - REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+
+ for (i = 0; i < num_of_vrregs; i++)
+ {
+ /* The last 2 registers of this set are only 32 bit long, not
+ 128. However an offset is necessary only for VSCR because it
+ occupies a whole vector, while VRSAVE occupies a full 4 bytes
+ slot. */
+ if (i == (num_of_vrregs - 2))
+ supply_register (tdep->ppc_vr0_regnum + i,
+ *vrregsetp + i * vrregsize + offset);
+ else
+ supply_register (tdep->ppc_vr0_regnum + i, *vrregsetp + i * vrregsize);
+ }
+}
+
+static void
+fetch_altivec_registers (int tid)
+{
+ int ret;
+ gdb_vrregset_t regs;
+
+ ret = ptrace (PTRACE_GETVRREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getvrregs = 0;
+ return;
+ }
+ perror_with_name ("Unable to fetch AltiVec registers");
+ }
+ supply_vrregset (&regs);
+}
+
+static void
+fetch_ppc_registers (int tid)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (i = 0; i <= tdep->ppc_mq_regnum; i++)
+ fetch_register (tid, i);
+ if (have_ptrace_getvrregs)
+ if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
+ fetch_altivec_registers (tid);
+}
+
+/* Fetch registers from the child process. Fetch all registers if
+ regno == -1, otherwise fetch all general registers or all floating
+ point registers depending upon the value of regno. */
+void
+fetch_inferior_registers (int regno)
+{
+ /* Overload thread id onto process id */
+ int tid = TIDGET (inferior_ptid);
+
+ /* No thread id, just use process id */
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid);
+
+ if (regno == -1)
+ fetch_ppc_registers (tid);
+ else
+ fetch_register (tid, regno);
+}
+
+/* Store one register. */
+static void
+store_altivec_register (int tid, int regno)
+{
+ int ret;
+ int offset = 0;
+ gdb_vrregset_t regs;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int vrregsize = REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+
+ ret = ptrace (PTRACE_GETVRREGS, tid, 0, &regs);
+ if (ret < 0)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getvrregs = 0;
+ return;
+ }
+ perror_with_name ("Unable to fetch AltiVec register");
+ }
+
+ /* VSCR is fetched as a 16 bytes quantity, but it is really 4 bytes
+ long on the hardware. */
+ if (regno == (tdep->ppc_vrsave_regnum - 1))
+ offset = vrregsize - REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+
+ regcache_collect (regno,
+ regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
+
+ ret = ptrace (PTRACE_SETVRREGS, tid, 0, &regs);
+ if (ret < 0)
+ perror_with_name ("Unable to store AltiVec register");
+}
+
+static void
+store_register (int tid, int regno)
+{
+ /* This isn't really an address. But ptrace thinks of it as one. */
+ CORE_ADDR regaddr = ppc_register_u_addr (regno);
+ char mess[128]; /* For messages */
+ register int i;
+ unsigned int offset; /* Offset of registers within the u area. */
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ if (altivec_register_p (regno))
+ {
+ store_altivec_register (tid, regno);
+ return;
+ }
+
+ if (regaddr == -1)
+ return;
+
+ regcache_collect (regno, buf);
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ {
+ errno = 0;
+ ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
+ *(PTRACE_XFER_TYPE *) & buf[i]);
+ regaddr += sizeof (PTRACE_XFER_TYPE);
+ if (errno != 0)
+ {
+ sprintf (mess, "writing register %s (#%d)",
+ REGISTER_NAME (regno), regno);
+ perror_with_name (mess);
+ }
+ }
+}
+
+static void
+fill_vrregset (gdb_vrregset_t *vrregsetp)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int num_of_vrregs = tdep->ppc_vrsave_regnum - tdep->ppc_vr0_regnum + 1;
+ int vrregsize = REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+ int offset = vrregsize - REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+
+ for (i = 0; i < num_of_vrregs; i++)
+ {
+ /* The last 2 registers of this set are only 32 bit long, not
+ 128, but only VSCR is fetched as a 16 bytes quantity. */
+ if (i == (num_of_vrregs - 2))
+ regcache_collect (tdep->ppc_vr0_regnum + i,
+ *vrregsetp + i * vrregsize + offset);
+ else
+ regcache_collect (tdep->ppc_vr0_regnum + i, *vrregsetp + i * vrregsize);
+ }
+}
+
+static void
+store_altivec_registers (int tid)
+{
+ int ret;
+ gdb_vrregset_t regs;
+
+ ret = ptrace (PTRACE_GETVRREGS, tid, 0, (int) &regs);
+ if (ret < 0)
+ {
+ if (errno == EIO)
+ {
+ have_ptrace_getvrregs = 0;
+ return;
+ }
+ perror_with_name ("Couldn't get AltiVec registers");
+ }
+
+ fill_vrregset (&regs);
+
+ if (ptrace (PTRACE_SETVRREGS, tid, 0, (int) &regs) < 0)
+ perror_with_name ("Couldn't write AltiVec registers");
+}
+
+static void
+store_ppc_registers (int tid)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (i = 0; i <= tdep->ppc_mq_regnum; i++)
+ store_register (tid, i);
+ if (have_ptrace_getvrregs)
+ if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
+ store_altivec_registers (tid);
+}
+
+void
+store_inferior_registers (int regno)
+{
+ /* Overload thread id onto process id */
+ int tid = TIDGET (inferior_ptid);
+
+ /* No thread id, just use process id */
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid);
+
+ if (regno >= 0)
+ store_register (tid, regno);
+ else
+ store_ppc_registers (tid);
+}
+
+void
+supply_gregset (gdb_gregset_t *gregsetp)
+{
+ int regi;
+ register elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (regi, (char *) (regp + regi));
+
+ supply_register (PC_REGNUM, (char *) (regp + PT_NIP));
+ supply_register (tdep->ppc_lr_regnum, (char *) (regp + PT_LNK));
+ supply_register (tdep->ppc_cr_regnum, (char *) (regp + PT_CCR));
+ supply_register (tdep->ppc_xer_regnum, (char *) (regp + PT_XER));
+ supply_register (tdep->ppc_ctr_regnum, (char *) (regp + PT_CTR));
+ supply_register (tdep->ppc_mq_regnum, (char *) (regp + PT_MQ));
+ supply_register (tdep->ppc_ps_regnum, (char *) (regp + PT_MSR));
+}
+
+void
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
+{
+ int regi;
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (regi = 0; regi < 32; regi++)
+ {
+ if ((regno == -1) || regno == regi)
+ regcache_collect (regi, regp + PT_R0 + regi);
+ }
+
+ if ((regno == -1) || regno == PC_REGNUM)
+ regcache_collect (PC_REGNUM, regp + PT_NIP);
+ if ((regno == -1) || regno == tdep->ppc_lr_regnum)
+ regcache_collect (tdep->ppc_lr_regnum, regp + PT_LNK);
+ if ((regno == -1) || regno == tdep->ppc_cr_regnum)
+ regcache_collect (tdep->ppc_cr_regnum, regp + PT_CCR);
+ if ((regno == -1) || regno == tdep->ppc_xer_regnum)
+ regcache_collect (tdep->ppc_xer_regnum, regp + PT_XER);
+ if ((regno == -1) || regno == tdep->ppc_ctr_regnum)
+ regcache_collect (tdep->ppc_ctr_regnum, regp + PT_CTR);
+ if ((regno == -1) || regno == tdep->ppc_mq_regnum)
+ regcache_collect (tdep->ppc_mq_regnum, regp + PT_MQ);
+ if ((regno == -1) || regno == tdep->ppc_ps_regnum)
+ regcache_collect (tdep->ppc_ps_regnum, regp + PT_MSR);
+}
+
+void
+supply_fpregset (gdb_fpregset_t * fpregsetp)
+{
+ int regi;
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
+}
+
+/* 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. */
+void
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+{
+ int regi;
+
+ for (regi = 0; regi < 32; regi++)
+ {
+ if ((regno == -1) || (regno == FP0_REGNUM + regi))
+ regcache_collect (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
+ }
+}
diff --git a/contrib/gdb/gdb/ppc-linux-tdep.c b/contrib/gdb/gdb/ppc-linux-tdep.c
new file mode 100644
index 0000000..b12cffd
--- /dev/null
+++ b/contrib/gdb/gdb/ppc-linux-tdep.c
@@ -0,0 +1,814 @@
+/* Target-dependent code for GDB, the GNU debugger.
+
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "inferior.h"
+#include "symtab.h"
+#include "target.h"
+#include "gdbcore.h"
+#include "gdbcmd.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "value.h"
+
+#include "solib-svr4.h"
+#include "ppc-tdep.h"
+
+/* The following two instructions are used in the signal trampoline
+ code on GNU/Linux PPC. */
+#define INSTR_LI_R0_0x7777 0x38007777
+#define INSTR_SC 0x44000002
+
+/* Since the *-tdep.c files are platform independent (i.e, they may be
+ used to build cross platform debuggers), we can't include system
+ headers. Therefore, details concerning the sigcontext structure
+ must be painstakingly rerecorded. What's worse, if these details
+ ever change in the header files, they'll have to be changed here
+ as well. */
+
+/* __SIGNAL_FRAMESIZE from <asm/ptrace.h> */
+#define PPC_LINUX_SIGNAL_FRAMESIZE 64
+
+/* From <asm/sigcontext.h>, offsetof(struct sigcontext_struct, regs) == 0x1c */
+#define PPC_LINUX_REGS_PTR_OFFSET (PPC_LINUX_SIGNAL_FRAMESIZE + 0x1c)
+
+/* From <asm/sigcontext.h>,
+ offsetof(struct sigcontext_struct, handler) == 0x14 */
+#define PPC_LINUX_HANDLER_PTR_OFFSET (PPC_LINUX_SIGNAL_FRAMESIZE + 0x14)
+
+/* From <asm/ptrace.h>, values for PT_NIP, PT_R1, and PT_LNK */
+#define PPC_LINUX_PT_R0 0
+#define PPC_LINUX_PT_R1 1
+#define PPC_LINUX_PT_R2 2
+#define PPC_LINUX_PT_R3 3
+#define PPC_LINUX_PT_R4 4
+#define PPC_LINUX_PT_R5 5
+#define PPC_LINUX_PT_R6 6
+#define PPC_LINUX_PT_R7 7
+#define PPC_LINUX_PT_R8 8
+#define PPC_LINUX_PT_R9 9
+#define PPC_LINUX_PT_R10 10
+#define PPC_LINUX_PT_R11 11
+#define PPC_LINUX_PT_R12 12
+#define PPC_LINUX_PT_R13 13
+#define PPC_LINUX_PT_R14 14
+#define PPC_LINUX_PT_R15 15
+#define PPC_LINUX_PT_R16 16
+#define PPC_LINUX_PT_R17 17
+#define PPC_LINUX_PT_R18 18
+#define PPC_LINUX_PT_R19 19
+#define PPC_LINUX_PT_R20 20
+#define PPC_LINUX_PT_R21 21
+#define PPC_LINUX_PT_R22 22
+#define PPC_LINUX_PT_R23 23
+#define PPC_LINUX_PT_R24 24
+#define PPC_LINUX_PT_R25 25
+#define PPC_LINUX_PT_R26 26
+#define PPC_LINUX_PT_R27 27
+#define PPC_LINUX_PT_R28 28
+#define PPC_LINUX_PT_R29 29
+#define PPC_LINUX_PT_R30 30
+#define PPC_LINUX_PT_R31 31
+#define PPC_LINUX_PT_NIP 32
+#define PPC_LINUX_PT_MSR 33
+#define PPC_LINUX_PT_CTR 35
+#define PPC_LINUX_PT_LNK 36
+#define PPC_LINUX_PT_XER 37
+#define PPC_LINUX_PT_CCR 38
+#define PPC_LINUX_PT_MQ 39
+#define PPC_LINUX_PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
+#define PPC_LINUX_PT_FPR31 (PPC_LINUX_PT_FPR0 + 2*31)
+#define PPC_LINUX_PT_FPSCR (PPC_LINUX_PT_FPR0 + 2*32 + 1)
+
+static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
+
+/* Determine if pc is in a signal trampoline...
+
+ Ha! That's not what this does at all. wait_for_inferior in
+ infrun.c calls IN_SIGTRAMP in order to detect entry into a signal
+ trampoline just after delivery of a signal. But on GNU/Linux,
+ signal trampolines are used for the return path only. The kernel
+ sets things up so that the signal handler is called directly.
+
+ If we use in_sigtramp2() in place of in_sigtramp() (see below)
+ we'll (often) end up with stop_pc in the trampoline and prev_pc in
+ the (now exited) handler. The code there will cause a temporary
+ breakpoint to be set on prev_pc which is not very likely to get hit
+ again.
+
+ If this is confusing, think of it this way... the code in
+ wait_for_inferior() needs to be able to detect entry into a signal
+ trampoline just after a signal is delivered, not after the handler
+ has been run.
+
+ So, we define in_sigtramp() below to return 1 if the following is
+ true:
+
+ 1) The previous frame is a real signal trampoline.
+
+ - and -
+
+ 2) pc is at the first or second instruction of the corresponding
+ handler.
+
+ Why the second instruction? It seems that wait_for_inferior()
+ never sees the first instruction when single stepping. When a
+ signal is delivered while stepping, the next instruction that
+ would've been stepped over isn't, instead a signal is delivered and
+ the first instruction of the handler is stepped over instead. That
+ puts us on the second instruction. (I added the test for the
+ first instruction long after the fact, just in case the observed
+ behavior is ever fixed.)
+
+ IN_SIGTRAMP is called from blockframe.c as well in order to set
+ the signal_handler_caller flag. Because of our strange definition
+ of in_sigtramp below, we can't rely on signal_handler_caller getting
+ set correctly from within blockframe.c. This is why we take pains
+ to set it in init_extra_frame_info(). */
+
+int
+ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ CORE_ADDR lr;
+ CORE_ADDR sp;
+ CORE_ADDR tramp_sp;
+ char buf[4];
+ CORE_ADDR handler;
+
+ lr = read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum);
+ if (!ppc_linux_at_sigtramp_return_path (lr))
+ return 0;
+
+ sp = read_register (SP_REGNUM);
+
+ if (target_read_memory (sp, buf, sizeof (buf)) != 0)
+ return 0;
+
+ tramp_sp = extract_unsigned_integer (buf, 4);
+
+ if (target_read_memory (tramp_sp + PPC_LINUX_HANDLER_PTR_OFFSET, buf,
+ sizeof (buf)) != 0)
+ return 0;
+
+ handler = extract_unsigned_integer (buf, 4);
+
+ return (pc == handler || pc == handler + 4);
+}
+
+/*
+ * The signal handler trampoline is on the stack and consists of exactly
+ * two instructions. The easiest and most accurate way of determining
+ * whether the pc is in one of these trampolines is by inspecting the
+ * instructions. It'd be faster though if we could find a way to do this
+ * via some simple address comparisons.
+ */
+static int
+ppc_linux_at_sigtramp_return_path (CORE_ADDR pc)
+{
+ char buf[12];
+ unsigned long pcinsn;
+ if (target_read_memory (pc - 4, buf, sizeof (buf)) != 0)
+ return 0;
+
+ /* extract the instruction at the pc */
+ pcinsn = extract_unsigned_integer (buf + 4, 4);
+
+ return (
+ (pcinsn == INSTR_LI_R0_0x7777
+ && extract_unsigned_integer (buf + 8, 4) == INSTR_SC)
+ ||
+ (pcinsn == INSTR_SC
+ && extract_unsigned_integer (buf, 4) == INSTR_LI_R0_0x7777));
+}
+
+CORE_ADDR
+ppc_linux_skip_trampoline_code (CORE_ADDR pc)
+{
+ char buf[4];
+ struct obj_section *sect;
+ struct objfile *objfile;
+ unsigned long insn;
+ CORE_ADDR plt_start = 0;
+ CORE_ADDR symtab = 0;
+ CORE_ADDR strtab = 0;
+ int num_slots = -1;
+ int reloc_index = -1;
+ CORE_ADDR plt_table;
+ CORE_ADDR reloc;
+ CORE_ADDR sym;
+ long symidx;
+ char symname[1024];
+ struct minimal_symbol *msymbol;
+
+ /* Find the section pc is in; return if not in .plt */
+ sect = find_pc_section (pc);
+ if (!sect || strcmp (sect->the_bfd_section->name, ".plt") != 0)
+ return 0;
+
+ objfile = sect->objfile;
+
+ /* Pick up the instruction at pc. It had better be of the
+ form
+ li r11, IDX
+
+ where IDX is an index into the plt_table. */
+
+ if (target_read_memory (pc, buf, 4) != 0)
+ return 0;
+ insn = extract_unsigned_integer (buf, 4);
+
+ if ((insn & 0xffff0000) != 0x39600000 /* li r11, VAL */ )
+ return 0;
+
+ reloc_index = (insn << 16) >> 16;
+
+ /* Find the objfile that pc is in and obtain the information
+ necessary for finding the symbol name. */
+ for (sect = objfile->sections; sect < objfile->sections_end; ++sect)
+ {
+ const char *secname = sect->the_bfd_section->name;
+ if (strcmp (secname, ".plt") == 0)
+ plt_start = sect->addr;
+ else if (strcmp (secname, ".rela.plt") == 0)
+ num_slots = ((int) sect->endaddr - (int) sect->addr) / 12;
+ else if (strcmp (secname, ".dynsym") == 0)
+ symtab = sect->addr;
+ else if (strcmp (secname, ".dynstr") == 0)
+ strtab = sect->addr;
+ }
+
+ /* Make sure we have all the information we need. */
+ if (plt_start == 0 || num_slots == -1 || symtab == 0 || strtab == 0)
+ return 0;
+
+ /* Compute the value of the plt table */
+ plt_table = plt_start + 72 + 8 * num_slots;
+
+ /* Get address of the relocation entry (Elf32_Rela) */
+ if (target_read_memory (plt_table + reloc_index, buf, 4) != 0)
+ return 0;
+ reloc = extract_address (buf, 4);
+
+ sect = find_pc_section (reloc);
+ if (!sect)
+ return 0;
+
+ if (strcmp (sect->the_bfd_section->name, ".text") == 0)
+ return reloc;
+
+ /* Now get the r_info field which is the relocation type and symbol
+ index. */
+ if (target_read_memory (reloc + 4, buf, 4) != 0)
+ return 0;
+ symidx = extract_unsigned_integer (buf, 4);
+
+ /* Shift out the relocation type leaving just the symbol index */
+ /* symidx = ELF32_R_SYM(symidx); */
+ symidx = symidx >> 8;
+
+ /* compute the address of the symbol */
+ sym = symtab + symidx * 4;
+
+ /* Fetch the string table index */
+ if (target_read_memory (sym, buf, 4) != 0)
+ return 0;
+ symidx = extract_unsigned_integer (buf, 4);
+
+ /* Fetch the string; we don't know how long it is. Is it possible
+ that the following will fail because we're trying to fetch too
+ much? */
+ if (target_read_memory (strtab + symidx, symname, sizeof (symname)) != 0)
+ return 0;
+
+ /* This might not work right if we have multiple symbols with the
+ same name; the only way to really get it right is to perform
+ the same sort of lookup as the dynamic linker. */
+ msymbol = lookup_minimal_symbol_text (symname, NULL, NULL);
+ if (!msymbol)
+ return 0;
+
+ return SYMBOL_VALUE_ADDRESS (msymbol);
+}
+
+/* The rs6000 version of FRAME_SAVED_PC will almost work for us. The
+ signal handler details are different, so we'll handle those here
+ and call the rs6000 version to do the rest. */
+CORE_ADDR
+ppc_linux_frame_saved_pc (struct frame_info *fi)
+{
+ if (fi->signal_handler_caller)
+ {
+ CORE_ADDR regs_addr =
+ read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
+ /* return the NIP in the regs array */
+ return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_NIP, 4);
+ }
+ else if (fi->next && fi->next->signal_handler_caller)
+ {
+ CORE_ADDR regs_addr =
+ read_memory_integer (fi->next->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
+ /* return LNK in the regs array */
+ return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_LNK, 4);
+ }
+ else
+ return rs6000_frame_saved_pc (fi);
+}
+
+void
+ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ rs6000_init_extra_frame_info (fromleaf, fi);
+
+ if (fi->next != 0)
+ {
+ /* We're called from get_prev_frame_info; check to see if
+ this is a signal frame by looking to see if the pc points
+ at trampoline code */
+ if (ppc_linux_at_sigtramp_return_path (fi->pc))
+ fi->signal_handler_caller = 1;
+ else
+ fi->signal_handler_caller = 0;
+ }
+}
+
+int
+ppc_linux_frameless_function_invocation (struct frame_info *fi)
+{
+ /* We'll find the wrong thing if we let
+ rs6000_frameless_function_invocation () search for a signal trampoline */
+ if (ppc_linux_at_sigtramp_return_path (fi->pc))
+ return 0;
+ else
+ return rs6000_frameless_function_invocation (fi);
+}
+
+void
+ppc_linux_frame_init_saved_regs (struct frame_info *fi)
+{
+ if (fi->signal_handler_caller)
+ {
+ CORE_ADDR regs_addr;
+ int i;
+ if (fi->saved_regs)
+ return;
+
+ frame_saved_regs_zalloc (fi);
+
+ regs_addr =
+ read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4);
+ fi->saved_regs[PC_REGNUM] = regs_addr + 4 * PPC_LINUX_PT_NIP;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_ps_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_MSR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_cr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_CCR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_lr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_LNK;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_CTR;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_xer_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_XER;
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_mq_regnum] =
+ regs_addr + 4 * PPC_LINUX_PT_MQ;
+ for (i = 0; i < 32; i++)
+ fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + i] =
+ regs_addr + 4 * PPC_LINUX_PT_R0 + 4 * i;
+ for (i = 0; i < 32; i++)
+ fi->saved_regs[FP0_REGNUM + i] = regs_addr + 4 * PPC_LINUX_PT_FPR0 + 8 * i;
+ }
+ else
+ rs6000_frame_init_saved_regs (fi);
+}
+
+CORE_ADDR
+ppc_linux_frame_chain (struct frame_info *thisframe)
+{
+ /* Kernel properly constructs the frame chain for the handler */
+ if (thisframe->signal_handler_caller)
+ return read_memory_integer ((thisframe)->frame, 4);
+ else
+ return rs6000_frame_chain (thisframe);
+}
+
+/* FIXME: Move the following to rs6000-tdep.c (or some other file where
+ it may be used generically by ports which use either the SysV ABI or
+ the EABI */
+
+/* round2 rounds x up to the nearest multiple of s assuming that s is a
+ power of 2 */
+
+#undef round2
+#define round2(x,s) ((((long) (x) - 1) & ~(long)((s)-1)) + (s))
+
+/* Pass the arguments in either registers, or in the stack. Using the
+ ppc sysv ABI, the first eight words of the argument list (that might
+ be less than eight parameters if some parameters occupy more than one
+ word) are passed in r3..r10 registers. float and double parameters are
+ passed in fpr's, in addition to that. Rest of the parameters if any
+ are passed in user stack.
+
+ If the function is returning a structure, then the return address is passed
+ in r3, then the first 7 words of the parametes can be passed in registers,
+ starting from r4. */
+
+CORE_ADDR
+ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int argno;
+ int greg, freg;
+ int argstkspace;
+ int structstkspace;
+ int argoffset;
+ int structoffset;
+ struct value *arg;
+ struct type *type;
+ int len;
+ char old_sp_buf[4];
+ CORE_ADDR saved_sp;
+
+ greg = struct_return ? 4 : 3;
+ freg = 1;
+ argstkspace = 0;
+ structstkspace = 0;
+
+ /* Figure out how much new stack space is required for arguments
+ which don't fit in registers. Unlike the PowerOpen ABI, the
+ SysV ABI doesn't reserve any extra space for parameters which
+ are put in registers. */
+ for (argno = 0; argno < nargs; argno++)
+ {
+ arg = args[argno];
+ type = check_typedef (VALUE_TYPE (arg));
+ len = TYPE_LENGTH (type);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ if (freg <= 8)
+ freg++;
+ else
+ {
+ /* SysV ABI converts floats to doubles when placed in
+ memory and requires 8 byte alignment */
+ if (argstkspace & 0x4)
+ argstkspace += 4;
+ argstkspace += 8;
+ }
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */
+ {
+ if (greg > 9)
+ {
+ greg = 11;
+ if (argstkspace & 0x4)
+ argstkspace += 4;
+ argstkspace += 8;
+ }
+ else
+ {
+ if ((greg & 1) == 0)
+ greg++;
+ greg += 2;
+ }
+ }
+ else
+ {
+ if (len > 4
+ || TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* Rounding to the nearest multiple of 8 may not be necessary,
+ but it is safe. Particularly since we don't know the
+ field types of the structure */
+ structstkspace += round2 (len, 8);
+ }
+ if (greg <= 10)
+ greg++;
+ else
+ argstkspace += 4;
+ }
+ }
+
+ /* Get current SP location */
+ saved_sp = read_sp ();
+
+ sp -= argstkspace + structstkspace;
+
+ /* Allocate space for backchain and callee's saved lr */
+ sp -= 8;
+
+ /* Make sure that we maintain 16 byte alignment */
+ sp &= ~0x0f;
+
+ /* Update %sp before proceeding any further */
+ write_register (SP_REGNUM, sp);
+
+ /* write the backchain */
+ store_address (old_sp_buf, 4, saved_sp);
+ write_memory (sp, old_sp_buf, 4);
+
+ argoffset = 8;
+ structoffset = argoffset + argstkspace;
+ freg = 1;
+ greg = 3;
+ /* Fill in r3 with the return structure, if any */
+ if (struct_return)
+ {
+ char val_buf[4];
+ store_address (val_buf, 4, struct_addr);
+ memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
+ greg++;
+ }
+ /* Now fill in the registers and stack... */
+ for (argno = 0; argno < nargs; argno++)
+ {
+ arg = args[argno];
+ type = check_typedef (VALUE_TYPE (arg));
+ len = TYPE_LENGTH (type);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ if (freg <= 8)
+ {
+ if (len > 8)
+ printf_unfiltered (
+ "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
+ memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + freg)],
+ VALUE_CONTENTS (arg), len);
+ freg++;
+ }
+ else
+ {
+ /* SysV ABI converts floats to doubles when placed in
+ memory and requires 8 byte alignment */
+ /* FIXME: Convert floats to doubles */
+ if (argoffset & 0x4)
+ argoffset += 4;
+ write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len);
+ argoffset += 8;
+ }
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */
+ {
+ if (greg > 9)
+ {
+ greg = 11;
+ if (argoffset & 0x4)
+ argoffset += 4;
+ write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len);
+ argoffset += 8;
+ }
+ else
+ {
+ if ((greg & 1) == 0)
+ greg++;
+
+ memcpy (&registers[REGISTER_BYTE (greg)],
+ VALUE_CONTENTS (arg), 4);
+ memcpy (&registers[REGISTER_BYTE (greg + 1)],
+ VALUE_CONTENTS (arg) + 4, 4);
+ greg += 2;
+ }
+ }
+ else
+ {
+ char val_buf[4];
+ if (len > 4
+ || TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ write_memory (sp + structoffset, VALUE_CONTENTS (arg), len);
+ store_address (val_buf, 4, sp + structoffset);
+ structoffset += round2 (len, 8);
+ }
+ else
+ {
+ memset (val_buf, 0, 4);
+ memcpy (val_buf, VALUE_CONTENTS (arg), len);
+ }
+ if (greg <= 10)
+ {
+ *(int *) &registers[REGISTER_BYTE (greg)] = 0;
+ memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
+ greg++;
+ }
+ else
+ {
+ write_memory (sp + argoffset, val_buf, 4);
+ argoffset += 4;
+ }
+ }
+ }
+
+ target_store_registers (-1);
+ return sp;
+}
+
+/* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint
+ in much the same fashion as memory_remove_breakpoint in mem-break.c,
+ but is careful not to write back the previous contents if the code
+ in question has changed in between inserting the breakpoint and
+ removing it.
+
+ Here is the problem that we're trying to solve...
+
+ Once upon a time, before introducing this function to remove
+ breakpoints from the inferior, setting a breakpoint on a shared
+ library function prior to running the program would not work
+ properly. In order to understand the problem, it is first
+ necessary to understand a little bit about dynamic linking on
+ this platform.
+
+ A call to a shared library function is accomplished via a bl
+ (branch-and-link) instruction whose branch target is an entry
+ in the procedure linkage table (PLT). The PLT in the object
+ file is uninitialized. To gdb, prior to running the program, the
+ entries in the PLT are all zeros.
+
+ Once the program starts running, the shared libraries are loaded
+ and the procedure linkage table is initialized, but the entries in
+ the table are not (necessarily) resolved. Once a function is
+ actually called, the code in the PLT is hit and the function is
+ resolved. In order to better illustrate this, an example is in
+ order; the following example is from the gdb testsuite.
+
+ We start the program shmain.
+
+ [kev@arroyo testsuite]$ ../gdb gdb.base/shmain
+ [...]
+
+ We place two breakpoints, one on shr1 and the other on main.
+
+ (gdb) b shr1
+ Breakpoint 1 at 0x100409d4
+ (gdb) b main
+ Breakpoint 2 at 0x100006a0: file gdb.base/shmain.c, line 44.
+
+ Examine the instruction (and the immediatly following instruction)
+ upon which the breakpoint was placed. Note that the PLT entry
+ for shr1 contains zeros.
+
+ (gdb) x/2i 0x100409d4
+ 0x100409d4 <shr1>: .long 0x0
+ 0x100409d8 <shr1+4>: .long 0x0
+
+ Now run 'til main.
+
+ (gdb) r
+ Starting program: gdb.base/shmain
+ Breakpoint 1 at 0xffaf790: file gdb.base/shr1.c, line 19.
+
+ Breakpoint 2, main ()
+ at gdb.base/shmain.c:44
+ 44 g = 1;
+
+ Examine the PLT again. Note that the loading of the shared
+ library has initialized the PLT to code which loads a constant
+ (which I think is an index into the GOT) into r11 and then
+ branchs a short distance to the code which actually does the
+ resolving.
+
+ (gdb) x/2i 0x100409d4
+ 0x100409d4 <shr1>: li r11,4
+ 0x100409d8 <shr1+4>: b 0x10040984 <sg+4>
+ (gdb) c
+ Continuing.
+
+ Breakpoint 1, shr1 (x=1)
+ at gdb.base/shr1.c:19
+ 19 l = 1;
+
+ Now we've hit the breakpoint at shr1. (The breakpoint was
+ reset from the PLT entry to the actual shr1 function after the
+ shared library was loaded.) Note that the PLT entry has been
+ resolved to contain a branch that takes us directly to shr1.
+ (The real one, not the PLT entry.)
+
+ (gdb) x/2i 0x100409d4
+ 0x100409d4 <shr1>: b 0xffaf76c <shr1>
+ 0x100409d8 <shr1+4>: b 0x10040984 <sg+4>
+
+ The thing to note here is that the PLT entry for shr1 has been
+ changed twice.
+
+ Now the problem should be obvious. GDB places a breakpoint (a
+ trap instruction) on the zero value of the PLT entry for shr1.
+ Later on, after the shared library had been loaded and the PLT
+ initialized, GDB gets a signal indicating this fact and attempts
+ (as it always does when it stops) to remove all the breakpoints.
+
+ The breakpoint removal was causing the former contents (a zero
+ word) to be written back to the now initialized PLT entry thus
+ destroying a portion of the initialization that had occurred only a
+ short time ago. When execution continued, the zero word would be
+ executed as an instruction an an illegal instruction trap was
+ generated instead. (0 is not a legal instruction.)
+
+ The fix for this problem was fairly straightforward. The function
+ memory_remove_breakpoint from mem-break.c was copied to this file,
+ modified slightly, and renamed to ppc_linux_memory_remove_breakpoint.
+ In tm-linux.h, MEMORY_REMOVE_BREAKPOINT is defined to call this new
+ function.
+
+ The differences between ppc_linux_memory_remove_breakpoint () and
+ memory_remove_breakpoint () are minor. All that the former does
+ that the latter does not is check to make sure that the breakpoint
+ location actually contains a breakpoint (trap instruction) prior
+ to attempting to write back the old contents. If it does contain
+ a trap instruction, we allow the old contents to be written back.
+ Otherwise, we silently do nothing.
+
+ The big question is whether memory_remove_breakpoint () should be
+ changed to have the same functionality. The downside is that more
+ traffic is generated for remote targets since we'll have an extra
+ fetch of a memory word each time a breakpoint is removed.
+
+ For the time being, we'll leave this self-modifying-code-friendly
+ version in ppc-linux-tdep.c, but it ought to be migrated somewhere
+ else in the event that some other platform has similar needs with
+ regard to removing breakpoints in some potentially self modifying
+ code. */
+int
+ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
+{
+ unsigned char *bp;
+ int val;
+ int bplen;
+ char old_contents[BREAKPOINT_MAX];
+
+ /* Determine appropriate breakpoint contents and size for this address. */
+ bp = BREAKPOINT_FROM_PC (&addr, &bplen);
+ if (bp == NULL)
+ error ("Software breakpoints not implemented for this target.");
+
+ val = target_read_memory (addr, old_contents, bplen);
+
+ /* If our breakpoint is no longer at the address, this means that the
+ program modified the code on us, so it is wrong to put back the
+ old value */
+ if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
+ val = target_write_memory (addr, contents_cache, bplen);
+
+ return val;
+}
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+ structure for GNU/Linux PPC targets using the struct offsets
+ defined in link.h (but without actual reference to that file).
+
+ This makes it possible to access GNU/Linux PPC shared libraries
+ from a GDB that was not built on an GNU/Linux PPC host (for cross
+ debugging). */
+
+struct link_map_offsets *
+ppc_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
+ this is all we need. */
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* The actual size is 560 bytes, but
+ this is all we need. */
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
diff --git a/contrib/gdb/gdb/ppc-tdep.h b/contrib/gdb/gdb/ppc-tdep.h
new file mode 100644
index 0000000..029f87c
--- /dev/null
+++ b/contrib/gdb/gdb/ppc-tdep.h
@@ -0,0 +1,69 @@
+/* Target-dependent code for GDB, the GNU debugger.
+ Copyright 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef PPC_TDEP_H
+#define PPC_TDEP_H
+
+struct frame_info;
+struct value;
+
+/* From ppc-linux-tdep.c... */
+CORE_ADDR ppc_linux_frame_saved_pc (struct frame_info *fi);
+void ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *);
+int ppc_linux_frameless_function_invocation (struct frame_info *);
+void ppc_linux_frame_init_saved_regs (struct frame_info *);
+CORE_ADDR ppc_linux_frame_chain (struct frame_info *);
+CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int,
+ CORE_ADDR);
+int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
+struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
+
+
+/* From rs6000-tdep.c... */
+CORE_ADDR rs6000_frame_saved_pc (struct frame_info *fi);
+void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *);
+int rs6000_frameless_function_invocation (struct frame_info *);
+void rs6000_frame_init_saved_regs (struct frame_info *);
+CORE_ADDR rs6000_frame_chain (struct frame_info *);
+int altivec_register_p (int regno);
+
+/* Private data that this module attaches to struct gdbarch. */
+
+struct gdbarch_tdep
+ {
+ int wordsize; /* size in bytes of fixed-point word */
+ int osabi; /* OS / ABI from ELF header */
+ int *regoff; /* byte offsets in register arrays */
+ const struct reg *regs; /* from current variant */
+ int ppc_gp0_regnum; /* GPR register 0 */
+ int ppc_gplast_regnum; /* GPR register 31 */
+ int ppc_toc_regnum; /* TOC register */
+ int ppc_ps_regnum; /* Processor (or machine) status (%msr) */
+ int ppc_cr_regnum; /* Condition register */
+ int ppc_lr_regnum; /* Link register */
+ int ppc_ctr_regnum; /* Count register */
+ int ppc_xer_regnum; /* Integer exception register */
+ int ppc_mq_regnum; /* Multiply/Divide extension register */
+ int ppc_vr0_regnum; /* First AltiVec register */
+ int ppc_vrsave_regnum; /* Last AltiVec register */
+};
+
+#endif
diff --git a/contrib/gdb/gdb/ppcnbsd-nat.c b/contrib/gdb/gdb/ppcnbsd-nat.c
new file mode 100644
index 0000000..55acf95
--- /dev/null
+++ b/contrib/gdb/gdb/ppcnbsd-nat.c
@@ -0,0 +1,145 @@
+/* Native-dependent code for PowerPC's running NetBSD, for GDB.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+#include <machine/frame.h>
+
+#include "defs.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
+
+#define RF(dst, src) \
+ memcpy(&registers[REGISTER_BYTE(dst)], &src, sizeof(src))
+
+#define RS(src, dst) \
+ memcpy(&dst, &registers[REGISTER_BYTE(src)], sizeof(dst))
+
+void
+fetch_inferior_registers (int regno)
+{
+ struct reg inferior_registers;
+#ifdef PT_GETFPREGS
+ struct fpreg inferior_fp_registers;
+#endif
+ int i;
+
+ ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+ for (i = 0; i < 32; i++)
+ RF (i, inferior_registers.fixreg[i]);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum, inferior_registers.lr);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_cr_regnum, inferior_registers.cr);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_xer_regnum, inferior_registers.xer);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum, inferior_registers.ctr);
+ RF (PC_REGNUM, inferior_registers.pc);
+
+#ifdef PT_GETFPREGS
+ ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ for (i = 0; i < 32; i++)
+ RF (FP0_REGNUM + i, inferior_fp_registers.fpreg[i]);
+#endif
+
+ registers_fetched ();
+}
+
+void
+store_inferior_registers (int regno)
+{
+ struct reg inferior_registers;
+#ifdef PT_SETFPREGS
+ struct fpreg inferior_fp_registers;
+#endif
+ int i;
+
+ for (i = 0; i < 32; i++)
+ RS (i, inferior_registers.fixreg[i]);
+ RS (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum, inferior_registers.lr);
+ RS (gdbarch_tdep (current_gdbarch)->ppc_cr_regnum, inferior_registers.cr);
+ RS (gdbarch_tdep (current_gdbarch)->ppc_xer_regnum, inferior_registers.xer);
+ RS (gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum, inferior_registers.ctr);
+ RS (PC_REGNUM, inferior_registers.pc);
+
+ ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+
+#ifdef PT_SETFPREGS
+ for (i = 0; i < 32; i++)
+ RS (FP0_REGNUM + i, inferior_fp_registers.fpreg[i]);
+ ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+#endif
+}
+
+struct md_core
+{
+ struct reg intreg;
+#ifdef PT_GETFPREGS
+ struct fpreg freg;
+#endif
+};
+
+void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ struct md_core *core_reg = (struct md_core *) core_reg_sect;
+ int i;
+
+ /* Integer registers */
+ for (i = 0; i < 32; i++)
+ RF (i, core_reg->intreg.fixreg[i]);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum, core_reg->intreg.lr);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_cr_regnum, core_reg->intreg.cr);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_xer_regnum, core_reg->intreg.xer);
+ RF (gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum, core_reg->intreg.ctr);
+ RF (PC_REGNUM, core_reg->intreg.pc);
+
+#ifdef PT_FPGETREGS
+ /* Floating point registers */
+ for (i = 0; i < 32; i++)
+ RF (FP0_REGNUM + i, core_reg->freg.fpreg[i]);
+#endif
+
+ registers_fetched ();
+}
+
+/* Register that we are able to handle ppcnbsd core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns ppcnbsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_ppcnbsd_nat (void)
+{
+ add_core_fns (&ppcnbsd_core_fns);
+}
diff --git a/contrib/gdb/gdb/printcmd.c b/contrib/gdb/gdb/printcmd.c
index 0f0b8ab..0315227 100644
--- a/contrib/gdb/gdb/printcmd.c
+++ b/contrib/gdb/gdb/printcmd.c
@@ -1,22 +1,25 @@
/* Print values for GNU debugger GDB.
- Copyright 1986, 87, 88, 89, 90, 91, 93, 94, 95, 1998
- Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 "gdb_string.h"
@@ -33,18 +36,20 @@ 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 */
+#include "completer.h" /* for completion functions */
+#include "ui-out.h"
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. */
@@ -69,7 +74,7 @@ static CORE_ADDR last_examine_address;
/* Contents of last address examined.
This is not valid past the end of the `x' command! */
-static value_ptr last_examine_value;
+static struct value *last_examine_value;
/* Largest offset between a symbolic value and an address, that will be
printed as `0x1234 <symbol+offset>'. */
@@ -94,20 +99,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) */
+ int enabled_p;
+ };
/* Chain of expressions whose values should be displayed
automatically each time the program stops. */
@@ -118,62 +123,63 @@ static int display_number;
/* Prototypes for exported functions. */
-void output_command PARAMS ((char *, int));
+void output_command (char *, int);
-void _initialize_printcmd PARAMS ((void));
+void _initialize_printcmd (void);
/* Prototypes for local functions. */
-static void delete_display PARAMS ((int));
+static void delete_display (int);
-static void enable_display PARAMS ((char *, int));
+static void enable_display (char *, int);
-static void disable_display_command PARAMS ((char *, int));
+static void disable_display_command (char *, int);
-static void disassemble_command PARAMS ((char *, int));
+static void disassemble_command (char *, int);
-static void printf_command PARAMS ((char *, int));
+static void printf_command (char *, int);
-static void print_frame_nameless_args PARAMS ((struct frame_info *, long,
- int, int, GDB_FILE *));
+static void print_frame_nameless_args (struct frame_info *, long,
+ int, int, struct ui_file *);
-static void display_info PARAMS ((char *, int));
+static void display_info (char *, int);
-static void do_one_display PARAMS ((struct display *));
+static void do_one_display (struct display *);
-static void undisplay_command PARAMS ((char *, int));
+static void undisplay_command (char *, int);
-static void free_display PARAMS ((struct display *));
+static void free_display (struct display *);
-static void display_command PARAMS ((char *, int));
+static void display_command (char *, int);
-void x_command PARAMS ((char *, int));
+void x_command (char *, int);
-static void address_info PARAMS ((char *, int));
+static void address_info (char *, int);
-static void set_command PARAMS ((char *, int));
+static void set_command (char *, int);
-static void call_command PARAMS ((char *, int));
+static void call_command (char *, int);
-static void inspect_command PARAMS ((char *, int));
+static void inspect_command (char *, int);
-static void print_command PARAMS ((char *, int));
+static void print_command (char *, int);
-static void print_command_1 PARAMS ((char *, int, int));
+static void print_command_1 (char *, int, int);
-static void validate_format PARAMS ((struct format_data, char *));
+static void validate_format (struct format_data, char *);
-static void do_examine PARAMS ((struct format_data, CORE_ADDR addr, asection *section));
+static void do_examine (struct format_data, CORE_ADDR addr,
+ asection * section);
-static void print_formatted PARAMS ((value_ptr, int, int));
+static void print_formatted (struct value *, int, int, struct ui_file *);
-static struct format_data decode_format PARAMS ((char **, int, int));
+static struct format_data decode_format (char **, int, int);
-static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
-
-static void sym_info PARAMS ((char *, int));
+static int print_insn (CORE_ADDR, struct ui_file *);
+static void sym_info (char *, int);
+
/* 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.
@@ -185,10 +191,7 @@ static void sym_info PARAMS ((char *, int));
past the specification and past all whitespace following it. */
static struct format_data
-decode_format (string_ptr, oformat, osize)
- char **string_ptr;
- int oformat;
- int osize;
+decode_format (char **string_ptr, int oformat, int osize)
{
struct format_data val;
register char *p = *string_ptr;
@@ -199,7 +202,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 +217,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. */
@@ -244,7 +249,7 @@ decode_format (string_ptr, oformat, osize)
val.size = osize ? 'h' : osize;
else
/* Bad value for TARGET_PTR_BIT */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
break;
case 'f':
/* Floating point has to be word or giantword. */
@@ -267,17 +272,15 @@ decode_format (string_ptr, oformat, osize)
return val;
}
-/* Print value VAL on gdb_stdout according to FORMAT, a letter or 0.
+/* Print value VAL on stream according to FORMAT, a letter or 0.
Do not end with a newline.
0 means print VAL according to its own type.
SIZE is the letter for the size of datum being printed.
This is used to pad hex numbers so they line up. */
static void
-print_formatted (val, format, size)
- register value_ptr val;
- register int format;
- int size;
+print_formatted (struct value *val, register int format, int size,
+ struct ui_file *stream)
{
struct type *type = check_typedef (VALUE_TYPE (val));
int len = TYPE_LENGTH (type);
@@ -293,21 +296,21 @@ print_formatted (val, format, size)
case 's':
/* FIXME: Need to handle wchar_t's here... */
next_address = VALUE_ADDRESS (val)
- + val_print_string (VALUE_ADDRESS (val), -1, 1, gdb_stdout);
+ + val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
next_section = VALUE_BFD_SECTION (val);
break;
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 (" ");
next_address = VALUE_ADDRESS (val)
- + print_insn (VALUE_ADDRESS (val), gdb_stdout);
+ + print_insn (VALUE_ADDRESS (val), stream);
next_section = VALUE_BFD_SECTION (val);
break;
@@ -317,18 +320,18 @@ 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.
- */
- value_print (val, gdb_stdout, format, Val_pretty_default);
+ /* 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, stream, 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);
+ format, size, stream);
}
}
@@ -340,12 +343,8 @@ print_formatted (val, format, size)
with a format. */
void
-print_scalar_formatted (valaddr, type, format, size, stream)
- char *valaddr;
- struct type *type;
- int format;
- int size;
- GDB_FILE *stream;
+print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
+ struct ui_file *stream)
{
LONGEST val_long;
unsigned int len = TYPE_LENGTH (type);
@@ -358,8 +357,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 +368,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;
}
@@ -391,6 +389,12 @@ print_scalar_formatted (valaddr, type, format, size, stream)
else if (format != 'f')
val_long = unpack_long (type, valaddr);
+ /* If the value is a pointer, and pointers and addresses are not the
+ same, then at this point, the value's length is TARGET_ADDR_BIT, not
+ TYPE_LENGTH (type). */
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ len = TARGET_ADDR_BIT;
+
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
(if shorts are 16 bits) instead of 4294967295). */
@@ -438,37 +442,42 @@ print_scalar_formatted (valaddr, type, format, size, stream)
break;
case 'a':
- print_address (unpack_pointer (type, valaddr), stream);
+ {
+ CORE_ADDR addr = unpack_pointer (type, valaddr);
+ print_address (addr, stream);
+ }
break;
case 'c':
- value_print (value_from_longest (builtin_type_char, val_long), stream, 0,
- Val_pretty_default);
+ value_print (value_from_longest (builtin_type_true_char, val_long),
+ stream, 0, Val_pretty_default);
break;
case 'f':
- if (len == sizeof (float))
- type = builtin_type_float;
- else if (len == sizeof (double))
- type = builtin_type_double;
+ if (len == TYPE_LENGTH (builtin_type_float))
+ type = builtin_type_float;
+ else if (len == TYPE_LENGTH (builtin_type_double))
+ type = builtin_type_double;
+ else if (len == TYPE_LENGTH (builtin_type_long_double))
+ type = builtin_type_long_double;
print_floating (valaddr, type, stream);
break;
case 0:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
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 +495,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 +508,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;
@@ -515,15 +524,14 @@ print_scalar_formatted (valaddr, type, format, size, stream)
`info lines' uses this. */
void
-set_next_address (addr)
- CORE_ADDR addr;
+set_next_address (CORE_ADDR addr)
{
next_address = addr;
/* Make address available to the user as $_. */
set_internalvar (lookup_internalvar ("_"),
- value_from_longest (lookup_pointer_type (builtin_type_void),
- (LONGEST) addr));
+ value_from_pointer (lookup_pointer_type (builtin_type_void),
+ addr));
}
/* Optionally print address ADDR symbolically as <SYMBOL+OFFSET> on STREAM,
@@ -535,27 +543,84 @@ set_next_address (addr)
settings of the demangle and asm_demangle variables. */
void
-print_address_symbolic (addr, stream, do_demangle, leadin)
- CORE_ADDR addr;
- GDB_FILE *stream;
- int do_demangle;
- char *leadin;
+print_address_symbolic (CORE_ADDR addr, struct ui_file *stream, int do_demangle,
+ char *leadin)
+{
+ char *name = NULL;
+ char *filename = NULL;
+ int unmapped = 0;
+ int offset = 0;
+ int line = 0;
+
+ /* throw away both name and filename */
+ struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &name);
+ make_cleanup (free_current_contents, &filename);
+
+ if (build_address_symbolic (addr, do_demangle, &name, &offset, &filename, &line, &unmapped))
+ {
+ do_cleanups (cleanup_chain);
+ return;
+ }
+
+ fputs_filtered (leadin, stream);
+ if (unmapped)
+ fputs_filtered ("<*", stream);
+ else
+ fputs_filtered ("<", stream);
+ fputs_filtered (name, stream);
+ if (offset != 0)
+ fprintf_filtered (stream, "+%u", (unsigned int) offset);
+
+ /* Append source filename and line number if desired. Give specific
+ line # of this addr, if we have it; else line # of the nearest symbol. */
+ if (print_symbol_filename && filename != NULL)
+ {
+ if (line != -1)
+ fprintf_filtered (stream, " at %s:%d", filename, line);
+ else
+ fprintf_filtered (stream, " in %s", filename);
+ }
+ if (unmapped)
+ fputs_filtered ("*>", stream);
+ else
+ fputs_filtered (">", stream);
+
+ do_cleanups (cleanup_chain);
+}
+
+/* Given an address ADDR return all the elements needed to print the
+ address in a symbolic form. NAME can be mangled or not depending
+ on DO_DEMANGLE (and also on the asm_demangle global variable,
+ manipulated via ''set print asm-demangle''). Return 0 in case of
+ success, when all the info in the OUT paramters is valid. Return 1
+ otherwise. */
+int
+build_address_symbolic (CORE_ADDR addr, /* IN */
+ int do_demangle, /* IN */
+ char **name, /* OUT */
+ int *offset, /* OUT */
+ char **filename, /* OUT */
+ int *line, /* OUT */
+ int *unmapped) /* OUT */
{
struct minimal_symbol *msymbol;
struct symbol *symbol;
struct symtab *symtab = 0;
CORE_ADDR name_location = 0;
- char *name = "";
asection *section = 0;
- int unmapped = 0;
+ char *name_temp = "";
+
+ /* Let's say it is unmapped. */
+ *unmapped = 0;
- /* Determine if the address is in an overlay, and whether it is mapped. */
+ /* Determine if the address is in an overlay, and whether it is
+ mapped. */
if (overlay_debugging)
{
section = find_pc_overlay (addr);
if (pc_in_unmapped_range (addr, section))
{
- unmapped = 1;
+ *unmapped = 1;
addr = overlay_mapped_address (addr, section);
}
}
@@ -585,9 +650,9 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
{
name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol));
if (do_demangle)
- name = SYMBOL_SOURCE_NAME (symbol);
+ name_temp = SYMBOL_SOURCE_NAME (symbol);
else
- name = SYMBOL_LINKAGE_NAME (symbol);
+ name_temp = SYMBOL_LINKAGE_NAME (symbol);
}
if (msymbol != NULL)
@@ -600,13 +665,13 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
symtab = 0;
name_location = SYMBOL_VALUE_ADDRESS (msymbol);
if (do_demangle)
- name = SYMBOL_SOURCE_NAME (msymbol);
+ name_temp = SYMBOL_SOURCE_NAME (msymbol);
else
- name = SYMBOL_LINKAGE_NAME (msymbol);
+ name_temp = SYMBOL_LINKAGE_NAME (msymbol);
}
}
if (symbol == NULL && msymbol == NULL)
- return;
+ return 1;
/* On some targets, mask out extra "flag" bits from PC for handsome
disassembly. */
@@ -625,19 +690,12 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
of the address space back to the beginning, giving bogus comparison. */
if (addr > name_location + max_symbolic_offset
&& name_location + max_symbolic_offset > name_location)
- return;
+ return 1;
- fputs_filtered (leadin, stream);
- if (unmapped)
- fputs_filtered ("<*", stream);
- else
- fputs_filtered ("<", stream);
- fputs_filtered (name, stream);
- if (addr != name_location)
- fprintf_filtered (stream, "+%u", (unsigned int)(addr - name_location));
+ *offset = addr - name_location;
+
+ *name = xstrdup (name_temp);
- /* Append source filename and line number if desired. Give specific
- line # of this addr, if we have it; else line # of the nearest symbol. */
if (print_symbol_filename)
{
struct symtab_and_line sal;
@@ -645,29 +703,42 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
sal = find_pc_sect_line (addr, section, 0);
if (sal.symtab)
- fprintf_filtered (stream, " at %s:%d", sal.symtab->filename, sal.line);
+ {
+ *filename = xstrdup (sal.symtab->filename);
+ *line = sal.line;
+ }
else if (symtab && symbol && symbol->line)
- fprintf_filtered (stream, " at %s:%d", symtab->filename, symbol->line);
+ {
+ *filename = xstrdup (symtab->filename);
+ *line = symbol->line;
+ }
else if (symtab)
- fprintf_filtered (stream, " in %s", symtab->filename);
+ {
+ *filename = xstrdup (symtab->filename);
+ *line = -1;
+ }
}
- if (unmapped)
- fputs_filtered ("*>", stream);
- else
- fputs_filtered (">", stream);
+ return 0;
}
-
/* Print address ADDR on STREAM. USE_LOCAL means the same thing as for
print_longest. */
void
-print_address_numeric (addr, use_local, stream)
- CORE_ADDR addr;
- int use_local;
- GDB_FILE *stream;
+print_address_numeric (CORE_ADDR addr, int use_local, struct ui_file *stream)
{
- /* This assumes a CORE_ADDR can fit in a LONGEST. Probably a safe
- assumption. */
+ /* Truncate address to the size of a target address, avoiding shifts
+ larger or equal than the width of a CORE_ADDR. The local
+ variable ADDR_BIT stops the compiler reporting a shift overflow
+ when it won't occur. */
+ /* NOTE: This assumes that the significant address information is
+ kept in the least significant bits of ADDR - the upper bits were
+ either zero or sign extended. Should ADDRESS_TO_POINTER() or
+ some ADDRESS_TO_PRINTABLE() be used to do the conversion? */
+
+ int addr_bit = TARGET_ADDR_BIT;
+
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+ addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
print_longest (stream, 'x', use_local, (ULONGEST) addr);
}
@@ -676,9 +747,7 @@ print_address_numeric (addr, use_local, stream)
<SYMBOL + OFFSET> after the number. */
void
-print_address (addr, stream)
- CORE_ADDR addr;
- GDB_FILE *stream;
+print_address (CORE_ADDR addr, struct ui_file *stream)
{
print_address_numeric (addr, 1, stream);
print_address_symbolic (addr, stream, asm_demangle, " ");
@@ -690,10 +759,7 @@ print_address (addr, stream)
or not. */
void
-print_address_demangle (addr, stream, do_demangle)
- CORE_ADDR addr;
- GDB_FILE *stream;
- int do_demangle;
+print_address_demangle (CORE_ADDR addr, struct ui_file *stream, int do_demangle)
{
if (addr == 0)
{
@@ -725,10 +791,7 @@ static struct type *examine_g_type;
Fetch it from memory and print on gdb_stdout. */
static void
-do_examine (fmt, addr, sect)
- struct format_data fmt;
- CORE_ADDR addr;
- asection *sect;
+do_examine (struct format_data fmt, CORE_ADDR addr, asection *sect)
{
register char format = 0;
register char size;
@@ -788,20 +851,20 @@ 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)
release_value (last_examine_value);
- print_formatted (last_examine_value, format, size);
+ print_formatted (last_examine_value, format, size, gdb_stdout);
}
printf_filtered ("\n");
gdb_flush (gdb_stdout);
@@ -809,9 +872,7 @@ do_examine (fmt, addr, sect)
}
static void
-validate_format (fmt, cmdname)
- struct format_data fmt;
- char *cmdname;
+validate_format (struct format_data fmt, char *cmdname)
{
if (fmt.size != 0)
error ("Size letters are meaningless in \"%s\" command.", cmdname);
@@ -824,20 +885,17 @@ 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)
- char *exp;
- int inspect;
- int voidprint;
+print_command_1 (char *exp, int inspect, int voidprint)
{
struct expression *expr;
register struct cleanup *old_chain = 0;
register char format = 0;
- register value_ptr val;
+ struct value *val;
struct format_data fmt;
int cleanup = 0;
@@ -860,11 +918,9 @@ print_command_1 (exp, inspect, voidprint)
if (exp && *exp)
{
- extern int objectprint;
struct type *type;
expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
- &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);
cleanup = 1;
val = evaluate_expression (expr);
@@ -872,12 +928,12 @@ 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;
+ struct value *v;
v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
if (v != 0)
@@ -891,7 +947,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);
@@ -902,13 +958,13 @@ 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 ();
- print_formatted (val, format, fmt.size);
+ print_formatted (val, format, fmt.size, gdb_stdout);
printf_filtered ("\n");
if (histindex >= 0)
@@ -917,19 +973,17 @@ 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 */
static void
-print_command (exp, from_tty)
- char *exp;
- int from_tty;
+print_command (char *exp, int from_tty)
{
print_command_1 (exp, 0, 1);
}
@@ -937,9 +991,7 @@ print_command (exp, from_tty)
/* Same as print, except in epoch, it gets its own window */
/* ARGSUSED */
static void
-inspect_command (exp, from_tty)
- char *exp;
- int from_tty;
+inspect_command (char *exp, int from_tty)
{
extern int epoch_interface;
@@ -949,23 +1001,19 @@ inspect_command (exp, from_tty)
/* Same as print, except it doesn't print void results. */
/* ARGSUSED */
static void
-call_command (exp, from_tty)
- char *exp;
- int from_tty;
+call_command (char *exp, int from_tty)
{
print_command_1 (exp, 0, 0);
}
/* ARGSUSED */
void
-output_command (exp, from_tty)
- char *exp;
- int from_tty;
+output_command (char *exp, int from_tty)
{
struct expression *expr;
register struct cleanup *old_chain;
register char format = 0;
- register value_ptr val;
+ struct value *val;
struct format_data fmt;
if (exp && *exp == '/')
@@ -977,84 +1025,81 @@ output_command (exp, from_tty)
}
expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
annotate_value_begin (VALUE_TYPE (val));
- print_formatted (val, format, fmt.size);
+ print_formatted (val, format, fmt.size, gdb_stdout);
annotate_value_end ();
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
+
do_cleanups (old_chain);
}
/* ARGSUSED */
static void
-set_command (exp, from_tty)
- char *exp;
- int from_tty;
+set_command (char *exp, int from_tty)
{
struct expression *expr = parse_expression (exp);
- register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ register struct cleanup *old_chain =
+ make_cleanup (free_current_contents, &expr);
evaluate_expression (expr);
do_cleanups (old_chain);
}
/* ARGSUSED */
static void
-sym_info (arg, from_tty)
- char *arg;
- int from_tty;
+sym_info (char *arg, 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);
}
/* ARGSUSED */
static void
-address_info (exp, from_tty)
- char *exp;
- int from_tty;
+address_info (char *exp, int from_tty)
{
register struct symbol *sym;
register struct minimal_symbol *msymbol;
@@ -1068,8 +1113,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)
@@ -1112,7 +1157,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);
@@ -1125,7 +1170,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))
{
@@ -1142,7 +1187,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))
{
@@ -1193,12 +1238,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:
@@ -1209,10 +1254,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))
@@ -1235,7 +1280,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))
{
@@ -1250,14 +1295,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;
@@ -1266,9 +1311,7 @@ address_info (exp, from_tty)
}
void
-x_command (exp, from_tty)
- char *exp;
- int from_tty;
+x_command (char *exp, int from_tty)
{
struct expression *expr;
struct format_data fmt;
@@ -1291,23 +1334,22 @@ 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 (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);
+ next_address = value_as_address (val);
if (VALUE_BFD_SECTION (val))
next_section = VALUE_BFD_SECTION (val);
do_cleanups (old_chain);
@@ -1323,13 +1365,14 @@ 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. */
+ struct type *pointer_type
+ = lookup_pointer_type (VALUE_TYPE (last_examine_value));
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_pointer (pointer_type,
+ 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))
@@ -1339,15 +1382,13 @@ x_command (exp, from_tty)
set_internalvar (lookup_internalvar ("__"), last_examine_value);
}
}
-
+
/* Add an expression to the auto-display chain.
Specify the expression. */
static void
-display_command (exp, from_tty)
- char *exp;
- int from_tty;
+display_command (char *exp, int from_tty)
{
struct format_data fmt;
register struct expression *expr;
@@ -1356,8 +1397,7 @@ display_command (exp, from_tty)
#if defined(TUI)
if (tui_version && *exp == '$')
- display_it = ((TuiStatus)tuiDo(
- (TuiOpaqueFuncPtr)tui_vSetLayoutTo, exp) == TUI_FAILURE);
+ display_it = (tui_set_layout (exp) == TUI_FAILURE);
#endif
if (display_it)
@@ -1394,7 +1434,7 @@ display_command (exp, from_tty)
new->next = display_chain;
new->number = ++display_number;
new->format = fmt;
- new->status = enabled;
+ new->enabled_p = 1;
display_chain = new;
if (from_tty && target_has_execution)
@@ -1405,11 +1445,10 @@ display_command (exp, from_tty)
}
static void
-free_display (d)
- struct display *d;
+free_display (struct display *d)
{
- free ((PTR)d->exp);
- free ((PTR)d);
+ xfree (d->exp);
+ xfree (d);
}
/* Clear out the display_chain.
@@ -1417,23 +1456,22 @@ free_display (d)
the types stored in many expressions. */
void
-clear_displays ()
+clear_displays (void)
{
register struct display *d;
while ((d = display_chain) != NULL)
{
- free ((PTR)d->exp);
+ xfree (d->exp);
display_chain = d->next;
- free ((PTR)d);
+ xfree (d);
}
}
/* Delete the auto-display number NUM. */
static void
-delete_display (num)
- int num;
+delete_display (int num)
{
register struct display *d1, *d;
@@ -1447,7 +1485,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);
@@ -1465,9 +1503,7 @@ delete_display (num)
Specify the element numbers. */
static void
-undisplay_command (args, from_tty)
- char *args;
- int from_tty;
+undisplay_command (char *args, int from_tty)
{
register char *p = args;
register char *p1;
@@ -1484,7 +1520,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.");
@@ -1493,7 +1530,8 @@ undisplay_command (args, from_tty)
delete_display (num);
p = p1;
- while (*p == ' ' || *p == '\t') p++;
+ while (*p == ' ' || *p == '\t')
+ p++;
}
dont_repeat ();
}
@@ -1503,12 +1541,11 @@ undisplay_command (args, from_tty)
or if the display is disabled. */
static void
-do_one_display (d)
- struct display *d;
+do_one_display (struct display *d)
{
int within_current_scope;
- if (d->status == disabled)
+ if (d->enabled_p == 0)
return;
if (d->block)
@@ -1527,7 +1564,7 @@ do_one_display (d)
if (d->format.size)
{
CORE_ADDR addr;
- value_ptr val;
+ struct value *val;
annotate_display_format ();
@@ -1548,9 +1585,9 @@ do_one_display (d)
printf_filtered ("\n");
else
printf_filtered (" ");
-
+
val = evaluate_expression (d->exp);
- addr = value_as_pointer (val);
+ addr = value_as_address (val);
if (d->format.format == 'i')
addr = ADDR_BITS_REMOVE (addr);
@@ -1575,7 +1612,7 @@ do_one_display (d)
annotate_display_expression ();
print_formatted (evaluate_expression (d->exp),
- d->format.format, d->format.size);
+ d->format.format, d->format.size, gdb_stdout);
printf_filtered ("\n");
}
@@ -1589,7 +1626,7 @@ do_one_display (d)
evaluated in the current scope. */
void
-do_displays ()
+do_displays (void)
{
register struct display *d;
@@ -1601,51 +1638,48 @@ do_displays ()
This is done when there is an error or a signal. */
void
-disable_display (num)
- int num;
+disable_display (int num)
{
register struct display *d;
for (d = display_chain; d; d = d->next)
if (d->number == num)
{
- d->status = disabled;
+ d->enabled_p = 0;
return;
}
printf_unfiltered ("No display number %d.\n", num);
}
-
+
void
-disable_current_display ()
+disable_current_display (void)
{
if (current_display_number >= 0)
{
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;
}
static void
-display_info (ignore, from_tty)
- char *ignore;
- int from_tty;
+display_info (char *ignore, int from_tty)
{
register struct display *d;
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->enabled_p]);
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);
@@ -1657,9 +1691,7 @@ Num Enb Expression\n");
}
static void
-enable_display (args, from_tty)
- char *args;
- int from_tty;
+enable_display (char *args, int from_tty)
{
register char *p = args;
register char *p1;
@@ -1669,7 +1701,7 @@ enable_display (args, from_tty)
if (p == 0)
{
for (d = display_chain; d; d = d->next)
- d->status = enabled;
+ d->enabled_p = 1;
}
else
while (*p)
@@ -1679,13 +1711,13 @@ 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)
{
- d->status = enabled;
+ d->enabled_p = 1;
goto win;
}
printf_unfiltered ("No display number %d.\n", num);
@@ -1698,9 +1730,7 @@ enable_display (args, from_tty)
/* ARGSUSED */
static void
-disable_display_command (args, from_tty)
- char *args;
- int from_tty;
+disable_display_command (char *args, int from_tty)
{
register char *p = args;
register char *p1;
@@ -1709,7 +1739,7 @@ disable_display_command (args, from_tty)
if (p == 0)
{
for (d = display_chain; d; d = d->next)
- d->status = disabled;
+ d->enabled_p = 0;
}
else
while (*p)
@@ -1719,7 +1749,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;
@@ -1727,18 +1757,16 @@ disable_display_command (args, from_tty)
p++;
}
}
-
+
/* Print the value in stack frame FRAME of a variable
specified by a struct symbol. */
void
-print_variable_value (var, frame, stream)
- struct symbol *var;
- struct frame_info *frame;
- GDB_FILE *stream;
+print_variable_value (struct symbol *var, struct frame_info *frame,
+ struct ui_file *stream)
{
- value_ptr val = read_var_value (var, frame);
+ struct value *val = read_var_value (var, frame);
value_print (val, stream, 0, Val_pretty_default);
}
@@ -1752,18 +1780,14 @@ print_variable_value (var, frame, stream)
according to the stack frame". At least for VAX, i386, isi. */
void
-print_frame_args (func, fi, num, stream)
- struct symbol *func;
- struct frame_info *fi;
- int num;
- GDB_FILE *stream;
+print_frame_args (struct symbol *func, struct frame_info *fi, int num,
+ struct ui_file *stream)
{
struct block *b = NULL;
- int nsyms = 0;
int first = 1;
register int i;
register struct symbol *sym;
- register value_ptr val;
+ struct value *val;
/* Offset of next stack argument beyond the one we have seen that is
at the highest offset.
-1 if we haven't come to a stack argument yet. */
@@ -1771,146 +1795,151 @@ print_frame_args (func, fi, num, stream)
int arg_size;
/* Number of ints of arguments that we have printed so far. */
int args_printed = 0;
+ struct cleanup *old_chain, *list_chain;
+ struct ui_stream *stb;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
if (func)
{
b = SYMBOL_BLOCK_VALUE (func);
- nsyms = BLOCK_NSYMS (b);
- }
-
- for (i = 0; i < nsyms; i++)
- {
- QUIT;
- sym = BLOCK_SYM (b, i);
+ ALL_BLOCK_SYMBOLS (b, i, sym)
+ {
+ QUIT;
- /* Keep track of the highest stack argument offset seen, and
- skip over any kinds of symbols we don't care about. */
+ /* Keep track of the highest stack argument offset seen, and
+ skip over any kinds of symbols we don't care about. */
- switch (SYMBOL_CLASS (sym)) {
- 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);
- }
+ switch (SYMBOL_CLASS (sym))
+ {
+ 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). */
- /* 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? */
-
- if (*SYMBOL_NAME (sym))
- {
- struct symbol *nsym;
- nsym = lookup_symbol
- (SYMBOL_NAME (sym),
- b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
- if (SYMBOL_CLASS (nsym) == LOC_REGISTER)
+ /* 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). */
+ /* 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? */
+
+ if (*SYMBOL_NAME (sym))
{
- /* 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. */
-
- /* Leave sym (the LOC_ARG) alone. */
- ;
+ struct symbol *nsym;
+ nsym = lookup_symbol
+ (SYMBOL_NAME (sym),
+ 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. */
+
+ /* Leave sym (the LOC_ARG) alone. */
+ ;
+ }
+ else
+ sym = nsym;
}
- else
- sym = nsym;
- }
- /* Print the current arg. */
- if (! first)
- fprintf_filtered (stream, ", ");
- wrap_here (" ");
+ /* Print the current arg. */
+ if (!first)
+ ui_out_text (uiout, ", ");
+ ui_out_wrap_hint (uiout, " ");
- annotate_arg_begin ();
+ annotate_arg_begin ();
- fprintf_symbol_filtered (stream, SYMBOL_SOURCE_NAME (sym),
- SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
- annotate_arg_name_end ();
- fputs_filtered ("=", stream);
+ list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ fprintf_symbol_filtered (stb->stream, SYMBOL_SOURCE_NAME (sym),
+ SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
+ ui_out_field_stream (uiout, "name", stb);
+ annotate_arg_name_end ();
+ ui_out_text (uiout, "=");
- /* 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. */
- val = read_var_value (sym, fi);
+ /* 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. */
+ val = read_var_value (sym, fi);
- annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val));
+ annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val));
- if (val)
- {
-#ifdef GDB_TARGET_IS_D10V
- if (SYMBOL_CLASS(sym) == LOC_REGPARM && TYPE_CODE(VALUE_TYPE(val)) == TYPE_CODE_PTR)
- TYPE_LENGTH(VALUE_TYPE(val)) = 2;
-#endif
- val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
- VALUE_ADDRESS (val),
- stream, 0, 0, 2, Val_no_prettyprint);
- }
- else
- fputs_filtered ("???", stream);
+ if (val)
+ {
+ val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
+ VALUE_ADDRESS (val),
+ stb->stream, 0, 0, 2, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "value", stb);
+ }
+ else
+ ui_out_text (uiout, "???");
- annotate_arg_end ();
+ /* Invoke ui_out_tuple_end. */
+ do_cleanups (list_chain);
- first = 0;
+ annotate_arg_end ();
+
+ first = 0;
+ }
}
/* Don't print nameless args in situations where we don't know
@@ -1927,6 +1956,7 @@ print_frame_args (func, fi, num, stream)
print_frame_nameless_args (fi, start, num - args_printed,
first, stream);
}
+ do_cleanups (old_chain);
}
/* Print nameless args on STREAM.
@@ -1936,12 +1966,8 @@ print_frame_args (func, fi, num, stream)
the first nameless arg). */
static void
-print_frame_nameless_args (fi, start, num, first, stream)
- struct frame_info *fi;
- long start;
- int num;
- int first;
- GDB_FILE *stream;
+print_frame_nameless_args (struct frame_info *fi, long start, int num,
+ int first, struct ui_file *stream)
{
int i;
CORE_ADDR argsaddr;
@@ -1979,29 +2005,28 @@ print_frame_nameless_args (fi, start, num, first, stream)
/* ARGSUSED */
static void
-printf_command (arg, from_tty)
- char *arg;
- int from_tty;
+printf_command (char *arg, int from_tty)
{
register char *f = NULL;
register char *s = arg;
char *string = NULL;
- value_ptr *val_args;
+ struct value **val_args;
char *substrings;
char *current_substring;
int nargs = 0;
int allocated_args = 20;
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);
+ val_args = (struct value **) xmalloc (allocated_args
+ * sizeof (struct value *));
+ old_cleanups = make_cleanup (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++ != '"')
@@ -2027,11 +2052,7 @@ printf_command (arg, from_tty)
*f++ = '\\';
break;
case 'a':
-#ifdef __STDC__
*f++ = '\a';
-#else
- *f++ = '\007'; /* Bell */
-#endif
break;
case 'b':
*f++ = '\b';
@@ -2069,13 +2090,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);
@@ -2086,7 +2110,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;
@@ -2102,7 +2129,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++;
@@ -2155,29 +2182,29 @@ printf_command (arg, from_tty)
{
char *s1;
if (nargs == allocated_args)
- val_args = (value_ptr *) xrealloc ((char *) val_args,
- (allocated_args *= 2)
- * sizeof (value_ptr));
+ val_args = (struct value **) xrealloc ((char *) val_args,
+ (allocated_args *= 2)
+ * sizeof (struct value *));
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");
@@ -2192,22 +2219,22 @@ printf_command (arg, from_tty)
char *str;
CORE_ADDR tem;
int j;
- tem = value_as_pointer (val_args[i]);
+ tem = value_as_address (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;
- read_memory_section (tem + j, &c, 1,
- VALUE_BFD_SECTION (val_args[i]));
+ read_memory (tem + j, &c, 1);
if (c == 0)
break;
}
/* Copy the string contents into a string inside GDB. */
str = (char *) alloca (j + 1);
- read_memory_section (tem, str, j, VALUE_BFD_SECTION (val_args[i]));
+ if (j != 0)
+ read_memory (tem, str, j);
str[j] = 0;
printf_filtered (current_substring, str);
@@ -2236,8 +2263,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;
@@ -2257,9 +2284,7 @@ printf_command (arg, from_tty)
/* ARGSUSED */
static void
-disassemble_command (arg, from_tty)
- char *arg;
- int from_tty;
+disassemble_command (char *arg, int from_tty)
{
CORE_ADDR low, high;
char *name;
@@ -2280,9 +2305,7 @@ 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 = tuiGetLowDisassemblyAddress (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
@@ -2294,23 +2317,7 @@ 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);
-#endif
-#if 0
- if (overlay_debugging)
- {
- section = find_pc_overlay (pc);
- 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);
- high = overlay_unmapped_address (high, section);
- }
- }
+ low = tuiGetLowDisassemblyAddress (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
@@ -2323,8 +2330,7 @@ disassemble_command (arg, from_tty)
}
#if defined(TUI)
- if (!tui_version ||
- m_winPtrIsNull(disassemWin) || !disassemWin->generic.isVisible)
+ if (!tui_is_window_visible (DISASSEM_WIN))
#endif
{
printf_filtered ("Dump of assembler code ");
@@ -2372,8 +2378,7 @@ disassemble_command (arg, from_tty)
#if defined(TUI)
else
{
- tuiDo((TuiOpaqueFuncPtr)tui_vAddWinToLayout, DISASSEM_WIN);
- tuiDo((TuiOpaqueFuncPtr)tui_vUpdateSourceWindowsWithAddr, low);
+ tui_show_assembly (low);
}
#endif
}
@@ -2382,11 +2387,9 @@ disassemble_command (arg, from_tty)
on STREAM. Returns length of the instruction, in bytes. */
static int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- GDB_FILE *stream;
+print_insn (CORE_ADDR memaddr, struct ui_file *stream)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
else
TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_LITTLE;
@@ -2395,19 +2398,23 @@ print_insn (memaddr, stream)
TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
/* else: should set .mach=0 but some disassemblers don't grok this */
+ TARGET_PRINT_INSN_INFO->stream = stream;
+
return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
}
-
+
void
-_initialize_printcmd ()
+_initialize_printcmd (void)
{
+ struct cmd_list_element *c;
+
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).");
@@ -2417,26 +2424,27 @@ 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\
Default count is 1. Default address is following last thing printed\n\
with this command or \"print\".", NULL));
- add_com ("disassemble", class_vars, disassemble_command,
- "Disassemble a specified section of memory.\n\
+ c = add_com ("disassemble", class_vars, disassemble_command,
+ "Disassemble a specified section of memory.\n\
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.");
+ c->completer = location_completer;
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.");
@@ -2446,7 +2454,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\
@@ -2456,28 +2464,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,
@@ -2485,43 +2493,44 @@ 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));
/* "call" is the same as "set", but handy for dbx users to call fns. */
- add_com ("call", class_vars, call_command,
- "Call a function in the program.\n\
+ c = add_com ("call", class_vars, call_command,
+ "Call a function in the program.\n\
The argument is the function name and arguments, in the notation of the\n\
current working language. The result is printed and saved in the value\n\
history, if it is not void.");
+ c->completer = location_completer;
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,
+ c = add_com ("print", class_vars, print_command,
concat ("Print value of expression EXP.\n\
Variables accessible are those of the lexical environment of the selected\n\
stack frame, plus all those whose scope is global or an entire file.\n\
@@ -2529,7 +2538,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",
@@ -2543,24 +2552,26 @@ resides in memory.\n",
"\n\
EXP may be preceded with /FMT, where FMT is a format letter\n\
but no count or size letter (see \"x\" command).", NULL));
+ c->completer = location_completer;
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\
+ c = add_com ("inspect", class_vars, inspect_command,
+ "Same as \"print\" command, except that if you are running in the epoch\n\
environment, the value is printed in its own window.");
+ c->completer = location_completer;
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
diff --git a/contrib/gdb/gdb/proc-api.c b/contrib/gdb/gdb/proc-api.c
new file mode 100755
index 0000000..986691d
--- /dev/null
+++ b/contrib/gdb/gdb/proc-api.c
@@ -0,0 +1,789 @@
+/* Machine independent support for SVR4 /proc (process file system) for GDB.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Michael Snyder at Cygnus Solutions.
+ Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/*
+ * Pretty-print trace of api calls to the /proc api
+ * (ioctl or read/write calls).
+ *
+ */
+
+#include "defs.h"
+#include "gdbcmd.h"
+#include "completer.h"
+
+#if defined (NEW_PROC_API)
+#define _STRUCTURED_PROC 1
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+#include <sys/proc.h> /* for struct proc */
+#ifdef HAVE_SYS_USER_H
+#include <sys/user.h> /* for struct user */
+#endif
+#include <fcntl.h> /* for O_RDWR etc. */
+#include <sys/wait.h>
+
+#include "proc-utils.h"
+
+/* 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 {
+ long value; /* The numeric value */
+ char *name; /* The equivalent symbolic value */
+ char *desc; /* Short description of value */
+};
+
+static int procfs_trace = 0;
+static FILE *procfs_file = NULL;
+static char *procfs_filename = "procfs_trace";
+
+static void
+prepare_to_trace (void)
+{
+ if (procfs_trace) /* if procfs tracing turned on */
+ if (procfs_file == NULL) /* if output file not yet open */
+ if (procfs_filename != NULL) /* if output filename known */
+ procfs_file = fopen (procfs_filename, "a"); /* open output file */
+}
+
+static void
+set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
+{
+#if 0 /* not sure what I might actually need to do here, if anything */
+ if (procfs_file)
+ fflush (procfs_file);
+#endif
+}
+
+static void
+set_procfs_file_cmd (char *args, int from_tty, struct cmd_list_element *c)
+{
+ /* Just changed the filename for procfs tracing.
+ If a file was already open, close it. */
+ if (procfs_file)
+ fclose (procfs_file);
+ procfs_file = NULL;
+}
+
+
+#ifndef NEW_PROC_API
+
+static struct trans ioctl_table[] = {
+#ifdef PIOCACINFO /* irix */
+ { PIOCACINFO, "PIOCACINFO", "get process account info" },
+#endif
+ { PIOCACTION, "PIOCACTION", "get signal action structs" },
+#ifdef PIOCARGUMENTS /* osf */
+ { PIOCARGUMENTS, "PIOCARGUMENTS", "command line args" },
+#endif
+#ifdef PIOCAUXV /* solaris aux vectors */
+ { PIOCAUXV, "PIOCAUXV", "get aux vector" },
+ { PIOCNAUXV, "PIOCNAUXV", "get number of aux vector entries" },
+#endif /* AUXV */
+ { PIOCCFAULT, "PIOCCFAULT", "clear current fault" },
+ { PIOCCRED, "PIOCCRED", "get process credentials" },
+#ifdef PIOCENEVCTRS /* irix event counters */
+ { PIOCENEVCTRS, "PIOCENEVCTRS", "acquire and start event counters" },
+ { PIOCGETEVCTRL, "PIOCGETEVCTRL", "get control info of event counters" },
+ { PIOCGETEVCTRS, "PIOCGETEVCTRS", "dump event counters" },
+ { PIOCGETPREVCTRS, "PIOCGETPREVCTRS", "dump event counters & prusage info" },
+ { PIOCRELEVCTRS, "PIOCRELEVCTRS", "release/stop event counters" },
+ { PIOCSETEVCTRL, "PIOCSETEVCTRL", "set control info of event counters" },
+ { PIOCGETPTIMER, "PIOCGETPTIMER", "get process timers" },
+#endif /* irix event counters */
+ { PIOCGENTRY, "PIOCGENTRY", "get traced syscall entry set" },
+#if defined (PIOCGETPR)
+ { PIOCGETPR, "PIOCGETPR", "read struct proc" },
+#endif
+#if defined (PIOCGETU)
+ { PIOCGETU, "PIOCGETU", "read user area" },
+#endif
+#if defined (PIOCGETUTK) && (defined(KERNEL) || defined(SHOW_UTT)) /* osf */
+ { PIOCGETUTK, "PIOCGETUTK", "get the utask struct" },
+#endif
+ { PIOCGEXIT, "PIOCGEXIT", "get traced syscall exit set" },
+ { PIOCGFAULT, "PIOCGFAULT", "get traced fault set" },
+#ifdef PIOCGFPCR /* osf */
+ { PIOCGFPCR, "PIOCGFPCR", "get FP control register" },
+ { PIOCSFPCR, "PIOCSFPCR", "set FP conrtol register" },
+#endif
+ { PIOCGFPREG, "PIOCGFPREG", "get floating point registers" },
+ { PIOCGHOLD, "PIOCGHOLD", "get held signal set" },
+ { PIOCGREG, "PIOCGREG", "get general registers" },
+ { PIOCGROUPS, "PIOCGROUPS", "get supplementary groups" },
+#ifdef PIOCGSPCACT /* osf */
+ { PIOCGSPCACT, "PIOCGSPCACT", "get special action" },
+ { PIOCSSPCACT, "PIOCSSPCACT", "set special action" },
+#endif
+ { PIOCGTRACE, "PIOCGTRACE", "get traced signal set" },
+#ifdef PIOCGWATCH /* irix watchpoints */
+ { PIOCGWATCH, "PIOCGWATCH", "get watchpoint" },
+ { PIOCSWATCH, "PIOCSWATCH", "set watchpoint" },
+ { PIOCNWATCH, "PIOCNWATCH", "get number of watchpoints" },
+#endif /* irix watchpoints */
+#ifdef PIOCGWIN /* solaris sparc */
+ { PIOCGWIN, "PIOCGWIN", "get gwindows_t" },
+#endif
+#ifdef PIOCGXREG /* solaris sparc extra regs */
+ { PIOCGXREGSIZE, "PIOCXREGSIZE", "get extra register state size" },
+ { PIOCGXREG, "PIOCGXREG", "get extra register state" },
+ { PIOCSXREG, "PIOCSXREG", "set extra register state" },
+#endif /* XREG */
+ { PIOCKILL, "PIOCKILL", "send signal" },
+#ifdef PIOCLDT /* solaris i386 */
+ { PIOCLDT, "PIOCLDT", "get LDT" },
+ { PIOCNLDT, "PIOCNLDT", "get number of LDT entries" },
+#endif
+#ifdef PIOCLSTATUS /* solaris and unixware */
+ { PIOCLSTATUS, "PIOCLSTATUS", "get status of all lwps" },
+ { PIOCLUSAGE, "PIOCLUSAGE", "get resource usage of all lwps" },
+ { PIOCOPENLWP, "PIOCOPENLWP", "get lwp file descriptor" },
+ { PIOCLWPIDS, "PIOCLWPIDS", "get lwp identifiers" },
+#endif /* LWP */
+ { PIOCMAP, "PIOCMAP", "get memory map information" },
+ { PIOCMAXSIG, "PIOCMAXSIG", "get max signal number" },
+ { PIOCNICE, "PIOCNICE", "set nice priority" },
+ { PIOCNMAP, "PIOCNMAP", "get number of memory mappings" },
+ { PIOCOPENM, "PIOCOPENM", "open mapped object for reading" },
+#ifdef PIOCOPENMOBS /* osf */
+ { PIOCOPENMOBS, "PIOCOPENMOBS", "open mapped object" },
+#endif
+#ifdef PIOCOPENPD /* solaris */
+ { PIOCOPENPD, "PIOCOPENPD", "get page data file descriptor" },
+#endif
+ { PIOCPSINFO, "PIOCPSINFO", "get ps(1) information" },
+ { PIOCRESET, "PIOCRESET", "reset process flags" },
+ { PIOCRFORK, "PIOCRFORK", "reset inherit-on-fork flag" },
+ { PIOCRRLC, "PIOCRRLC", "reset run-on-last-close flag" },
+ { PIOCRUN, "PIOCRUN", "make process runnable" },
+#ifdef PIOCSAVECCNTRS /* irix */
+ { PIOCSAVECCNTRS, "PIOCSAVECCNTRS", "parent gets child cntrs" },
+#endif
+ { PIOCSENTRY, "PIOCSENTRY", "set traced syscall entry set" },
+ { PIOCSET, "PIOCSET", "set process flags" },
+ { PIOCSEXIT, "PIOCSEXIT", "set traced syscall exit set" },
+ { PIOCSFAULT, "PIOCSFAULT", "set traced fault set" },
+ { PIOCSFORK, "PIOCSFORK", "set inherit-on-fork flag" },
+ { PIOCSFPREG, "PIOCSFPREG", "set floating point registers" },
+ { PIOCSHOLD, "PIOCSHOLD", "set held signal set" },
+ { PIOCSREG, "PIOCSREG", "set general registers" },
+ { PIOCSRLC, "PIOCSRLC", "set run-on-last-close flag" },
+ { PIOCSSIG, "PIOCSSIG", "set current signal" },
+ { PIOCSTATUS, "PIOCSTATUS", "get process status" },
+ { PIOCSTOP, "PIOCSTOP", "post stop request" },
+ { PIOCSTRACE, "PIOCSTRACE", "set traced signal set" },
+ { PIOCUNKILL, "PIOCUNKILL", "delete a signal" },
+#ifdef PIOCUSAGE /* solaris */
+ { PIOCUSAGE, "PIOCUSAGE", "get resource usage" },
+#endif
+ { PIOCWSTOP, "PIOCWSTOP", "wait for process to stop" },
+
+#ifdef PIOCNTHR /* osf threads */
+ { PIOCNTHR, "PIOCNTHR", "get thread count" },
+ { PIOCRTINH, "PIOCRTINH", "reset inherit-on-thread-creation" },
+ { PIOCSTINH, "PIOCSTINH", "set inherit-on-thread-creation" },
+ { PIOCTLIST, "PIOCTLIST", "get thread ids" },
+ { PIOCXPTH, "PIOCXPTH", "translate port to thread handle" },
+ { PIOCTRUN, "PIOCTRUN", "make thread runnable" },
+ { PIOCTSTATUS, "PIOCTSTATUS", "get thread status" },
+ { PIOCTSTOP, "PIOCTSTOP", "stop a thread" },
+ /* ... TGTRACE TSTRACE TSSIG TKILL TUNKILL TCFAULT TGFAULT TSFAULT
+ TGFPREG TSFPREG TGREG TSREG TACTION TTERM TABRUN TGENTRY TSENTRY
+ TGEXIT TSEXIT TSHOLD ... thread functions */
+#endif /* osf threads */
+ { -1, NULL, NULL }
+};
+
+int
+ioctl_with_trace (int fd, long opcode, void *ptr, char *file, int line)
+{
+ int i = 0;
+ int ret;
+ int arg1;
+
+ prepare_to_trace ();
+
+ if (procfs_trace)
+ {
+ for (i = 0; ioctl_table[i].name != NULL; i++)
+ if (ioctl_table[i].value == opcode)
+ break;
+
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+ switch (opcode) {
+ case PIOCSET:
+ arg1 = ptr ? *(long *) ptr : 0;
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCSET, %s) %s\n",
+ arg1 == PR_FORK ? "PR_FORK" :
+ arg1 == PR_RLC ? "PR_RLC" :
+#ifdef PR_ASYNC
+ arg1 == PR_ASYNC ? "PR_ASYNC" :
+#endif
+ "<unknown flag>",
+ info_verbose ? ioctl_table[i].desc : "");
+ break;
+ case PIOCRESET:
+ arg1 = ptr ? *(long *) ptr : 0;
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCRESET, %s) %s\n",
+ arg1 == PR_FORK ? "PR_FORK" :
+ arg1 == PR_RLC ? "PR_RLC" :
+#ifdef PR_ASYNC
+ arg1 == PR_ASYNC ? "PR_ASYNC" :
+#endif
+ "<unknown flag>",
+ info_verbose ? ioctl_table[i].desc : "");
+ break;
+ case PIOCSTRACE:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCSTRACE) ");
+ proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
+ (sigset_t *) ptr, 0);
+ break;
+ case PIOCSFAULT:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (%s) ",
+ opcode == PIOCSFAULT ? "PIOCSFAULT" : "PIOCGFAULT");
+ proc_prettyfprint_faultset (procfs_file ? procfs_file : stdout,
+ (fltset_t *) ptr, 0);
+ break;
+ case PIOCSENTRY:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (%s) ",
+ opcode == PIOCSENTRY ? "PIOCSENTRY" : "PIOCGENTRY");
+ proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
+ (sysset_t *) ptr, 0);
+ break;
+ case PIOCSEXIT:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (%s) ",
+ opcode == PIOCSEXIT ? "PIOCSEXIT" : "PIOCGEXIT");
+ proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
+ (sysset_t *) ptr, 0);
+ break;
+ case PIOCSHOLD:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (%s) ",
+ opcode == PIOCSHOLD ? "PIOCSHOLD" : "PIOCGHOLD");
+ proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
+ (sigset_t *) ptr, 0);
+ break;
+ case PIOCSSIG:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCSSIG) ");
+ proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
+ ptr ? ((siginfo_t *) ptr)->si_signo : 0,
+ 0);
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+ case PIOCRUN:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCRUN) ");
+
+ arg1 = ptr ? *(long *) ptr : 0;
+ if (arg1 & PRCSIG)
+ fprintf (procfs_file ? procfs_file : stdout, "clearSig ");
+ if (arg1 & PRCFAULT)
+ fprintf (procfs_file ? procfs_file : stdout, "clearFlt ");
+ if (arg1 & PRSTRACE)
+ fprintf (procfs_file ? procfs_file : stdout, "setTrace ");
+ if (arg1 & PRSHOLD)
+ fprintf (procfs_file ? procfs_file : stdout, "setHold ");
+ if (arg1 & PRSFAULT)
+ fprintf (procfs_file ? procfs_file : stdout, "setFlt ");
+ if (arg1 & PRSVADDR)
+ fprintf (procfs_file ? procfs_file : stdout, "setVaddr ");
+ if (arg1 & PRSTEP)
+ fprintf (procfs_file ? procfs_file : stdout, "step ");
+ if (arg1 & PRSABORT)
+ fprintf (procfs_file ? procfs_file : stdout, "syscallAbort ");
+ if (arg1 & PRSTOP)
+ fprintf (procfs_file ? procfs_file : stdout, "stopReq ");
+
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+ case PIOCKILL:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCKILL) ");
+ proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
+ ptr ? *(long *) ptr : 0, 0);
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+#ifdef PIOCSSPCACT
+ case PIOCSSPCACT:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (PIOCSSPCACT) ");
+ arg1 = ptr ? *(long *) ptr : 0;
+ if (arg1 & PRFS_STOPFORK)
+ fprintf (procfs_file ? procfs_file : stdout, "stopFork ");
+ if (arg1 & PRFS_STOPEXEC)
+ fprintf (procfs_file ? procfs_file : stdout, "stopExec ");
+ if (arg1 & PRFS_STOPTERM)
+ fprintf (procfs_file ? procfs_file : stdout, "stopTerm ");
+ if (arg1 & PRFS_STOPTCR)
+ fprintf (procfs_file ? procfs_file : stdout, "stopThreadCreate ");
+ if (arg1 & PRFS_STOPTTERM)
+ fprintf (procfs_file ? procfs_file : stdout, "stopThreadTerm ");
+ if (arg1 & PRFS_KOLC)
+ fprintf (procfs_file ? procfs_file : stdout, "killOnLastClose ");
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+#endif /* PIOCSSPCACT */
+ default:
+ if (ioctl_table[i].name)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (%s) %s\n",
+ ioctl_table[i].name,
+ info_verbose ? ioctl_table[i].desc : "");
+ else
+ fprintf (procfs_file ? procfs_file : stdout,
+ "ioctl (<unknown %ld (0x%lx)) \n", opcode, opcode);
+ break;
+ }
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+ errno = 0;
+ ret = ioctl (fd, opcode, ptr);
+ if (procfs_trace && ret < 0)
+ {
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[ioctl (%s) FAILED! (%s)]\n",
+ ioctl_table[i].name != NULL ?
+ ioctl_table[i].name : "<unknown>",
+ safe_strerror (errno));
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+
+ return ret;
+}
+
+#else /* NEW_PROC_API */
+
+static struct trans rw_table[] = {
+#ifdef PCAGENT /* solaris */
+ { PCAGENT, "PCAGENT", "create agent lwp with regs from argument" },
+#endif
+ { PCCFAULT, "PCCFAULT", "clear current fault" },
+#ifdef PCCSIG /* solaris */
+ { PCCSIG, "PCCSIG", "clear current signal" },
+#endif
+ { PCDSTOP, "PCDSTOP", "post stop request" },
+ { PCKILL, "PCKILL", "post a signal" },
+ { PCNICE, "PCNICE", "set nice priority" },
+#ifdef PCREAD /* solaris */
+ { PCREAD, "PCREAD", "read from the address space" },
+ { PCWRITE, "PCWRITE", "write to the address space" },
+#endif
+#ifdef PCRESET /* unixware */
+ { PCRESET, "PCRESET", "unset modes" },
+#endif
+ { PCRUN, "PCRUN", "make process/lwp runnable" },
+#ifdef PCSASRS /* solaris 2.7 only */
+ { PCSASRS, "PCSASRS", "set ancillary state registers" },
+#endif
+#ifdef PCSCRED /* solaris */
+ { PCSCRED, "PCSCRED", "set process credentials" },
+#endif
+ { PCSENTRY, "PCSENTRY", "set traced syscall entry set" },
+ { PCSET, "PCSET", "set modes" },
+ { PCSEXIT, "PCSEXIT", "set traced syscall exit set" },
+ { PCSFAULT, "PCSFAULT", "set traced fault set" },
+ { PCSFPREG, "PCSFPREG", "set floating point registers" },
+ { PCSHOLD, "PCSHOLD", "set signal mask" },
+ { PCSREG, "PCSREG", "set general registers" },
+ { PCSSIG, "PCSSIG", "set current signal" },
+ { PCSTOP, "PCSTOP", "post stop request and wait" },
+ { PCSTRACE, "PCSTRACE", "set traced signal set" },
+#ifdef PCSVADDR /* solaris */
+ { PCSVADDR, "PCSVADDR", "set pc virtual address" },
+#endif
+#ifdef PCSXREG /* solaris sparc only */
+ { PCSXREG, "PCSXREG", "set extra registers" },
+#endif
+#ifdef PCTWSTOP /* solaris */
+ { PCTWSTOP, "PCTWSTOP", "wait for stop, with timeout arg" },
+#endif
+ { PCUNKILL, "PCUNKILL", "delete a pending signal" },
+#ifdef PCUNSET /* solaris */
+ { PCUNSET, "PCUNSET", "unset modes" },
+#endif
+#ifdef PCWATCH /* solaris */
+ { PCWATCH, "PCWATCH", "set/unset watched memory area" },
+#endif
+ { PCWSTOP, "PCWSTOP", "wait for process/lwp to stop, no timeout" },
+ { 0, NULL, NULL }
+};
+
+static off_t lseek_offset;
+
+int
+write_with_trace (int fd, void *varg, size_t len, char *file, int line)
+{
+ int i;
+ int ret;
+ procfs_ctl_t *arg = (procfs_ctl_t *) varg;
+
+ prepare_to_trace ();
+ if (procfs_trace)
+ {
+ procfs_ctl_t opcode = arg[0];
+ for (i = 0; rw_table[i].name != NULL; i++)
+ if (rw_table[i].value == opcode)
+ break;
+
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+ switch (opcode) {
+ case PCSET:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSET, %s) %s\n",
+ arg[1] == PR_FORK ? "PR_FORK" :
+ arg[1] == PR_RLC ? "PR_RLC" :
+#ifdef PR_ASYNC
+ arg[1] == PR_ASYNC ? "PR_ASYNC" :
+#endif
+ "<unknown flag>",
+ info_verbose ? rw_table[i].desc : "");
+ break;
+#ifdef PCUNSET
+ case PCUNSET:
+#endif
+#ifdef PCRESET
+#if PCRESET != PCUNSET
+ case PCRESET:
+#endif
+#endif
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCRESET, %s) %s\n",
+ arg[1] == PR_FORK ? "PR_FORK" :
+ arg[1] == PR_RLC ? "PR_RLC" :
+#ifdef PR_ASYNC
+ arg[1] == PR_ASYNC ? "PR_ASYNC" :
+#endif
+ "<unknown flag>",
+ info_verbose ? rw_table[i].desc : "");
+ break;
+ case PCSTRACE:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSTRACE) ");
+ proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
+ (sigset_t *) &arg[1], 0);
+ break;
+ case PCSFAULT:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSFAULT) ");
+ proc_prettyfprint_faultset (procfs_file ? procfs_file : stdout,
+ (fltset_t *) &arg[1], 0);
+ break;
+ case PCSENTRY:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSENTRY) ");
+ proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
+ (sysset_t *) &arg[1], 0);
+ break;
+ case PCSEXIT:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSEXIT) ");
+ proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
+ (sysset_t *) &arg[1], 0);
+ break;
+ case PCSHOLD:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSHOLD) ");
+ proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
+ (sigset_t *) &arg[1], 0);
+ break;
+ case PCSSIG:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSSIG) ");
+ proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
+ arg[1] ? ((siginfo_t *) &arg[1])->si_signo
+ : 0,
+ 0);
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+ case PCRUN:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCRUN) ");
+ if (arg[1] & PRCSIG)
+ fprintf (procfs_file ? procfs_file : stdout, "clearSig ");
+ if (arg[1] & PRCFAULT)
+ fprintf (procfs_file ? procfs_file : stdout, "clearFlt ");
+ if (arg[1] & PRSTEP)
+ fprintf (procfs_file ? procfs_file : stdout, "step ");
+ if (arg[1] & PRSABORT)
+ fprintf (procfs_file ? procfs_file : stdout, "syscallAbort ");
+ if (arg[1] & PRSTOP)
+ fprintf (procfs_file ? procfs_file : stdout, "stopReq ");
+
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+ case PCKILL:
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCKILL) ");
+ proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
+ arg[1], 0);
+ fprintf (procfs_file ? procfs_file : stdout, "\n");
+ break;
+ default:
+ {
+#ifdef BREAKPOINT
+ static unsigned char break_insn[] = BREAKPOINT;
+
+ if (len == sizeof (break_insn) &&
+ memcmp (arg, &break_insn, len) == 0)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (<breakpoint at 0x%08lx>) \n",
+ (unsigned long) lseek_offset);
+ else
+#endif
+ if (rw_table[i].name)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (%s) %s\n",
+ rw_table[i].name,
+ info_verbose ? rw_table[i].desc : "");
+ else
+ {
+ if (lseek_offset != -1)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (<unknown>, %lud bytes at 0x%08lx) \n",
+ (unsigned long) len, (unsigned long) lseek_offset);
+ else
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (<unknown>, %lud bytes) \n",
+ (unsigned long) len);
+ }
+ break;
+ }
+ }
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+ errno = 0;
+ ret = write (fd, (void *) arg, len);
+ if (procfs_trace && ret != len)
+ {
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[write (%s) FAILED! (%s)]\n",
+ rw_table[i].name != NULL ?
+ rw_table[i].name : "<unknown>",
+ safe_strerror (errno));
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+
+ lseek_offset = -1;
+ return ret;
+}
+
+off_t
+lseek_with_trace (int fd, off_t offset, int whence, char *file, int line)
+{
+ off_t ret;
+
+ prepare_to_trace ();
+ errno = 0;
+ ret = lseek (fd, offset, whence);
+ lseek_offset = ret;
+ if (procfs_trace && (ret == -1 || errno != 0))
+ {
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[lseek (0x%08lx) FAILED! (%s)]\n",
+ (unsigned long) offset, safe_strerror (errno));
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+
+ return ret;
+}
+
+#endif /* NEW_PROC_API */
+
+int
+open_with_trace (char *filename, int mode, char *file, int line)
+{
+ int ret;
+
+ prepare_to_trace ();
+ errno = 0;
+ ret = open (filename, mode);
+ if (procfs_trace)
+ {
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+
+ if (errno)
+ {
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[open FAILED! (%s) line %d]\\n",
+ safe_strerror (errno), line);
+ }
+ else
+ {
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%d = open (%s, ", ret, filename);
+ if (mode == O_RDONLY)
+ fprintf (procfs_file ? procfs_file : stdout, "O_RDONLY) %d\n",
+ line);
+ else if (mode == O_WRONLY)
+ fprintf (procfs_file ? procfs_file : stdout, "O_WRONLY) %d\n",
+ line);
+ else if (mode == O_RDWR)
+ fprintf (procfs_file ? procfs_file : stdout, "O_RDWR) %d\n",
+ line);
+ }
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+
+ return ret;
+}
+
+int
+close_with_trace (int fd, char *file, int line)
+{
+ int ret;
+
+ prepare_to_trace ();
+ errno = 0;
+ ret = close (fd);
+ if (procfs_trace)
+ {
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+ if (errno)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[close FAILED! (%s)]\n", safe_strerror (errno));
+ else
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%d = close (%d)\n", ret, fd);
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+
+ return ret;
+}
+
+pid_t
+wait_with_trace (int *wstat, char *file, int line)
+{
+ int ret, lstat = 0;
+
+ prepare_to_trace ();
+ if (procfs_trace)
+ {
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+ fprintf (procfs_file ? procfs_file : stdout,
+ "wait (line %d) ", line);
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+ errno = 0;
+ ret = wait (&lstat);
+ if (procfs_trace)
+ {
+ if (errno)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[wait FAILED! (%s)]\n", safe_strerror (errno));
+ else
+ fprintf (procfs_file ? procfs_file : stdout,
+ "returned pid %d, status 0x%x\n", ret, lstat);
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+ if (wstat)
+ *wstat = lstat;
+
+ return ret;
+}
+
+void
+procfs_note (char *msg, char *file, int line)
+{
+ prepare_to_trace ();
+ if (procfs_trace)
+ {
+ if (info_verbose)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "%s:%d -- ", file, line);
+ fprintf (procfs_file ? procfs_file : stdout, msg);
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+}
+
+void
+proc_prettyfprint_status (long flags, int why, int what, int thread)
+{
+ prepare_to_trace ();
+ if (procfs_trace)
+ {
+ if (thread)
+ fprintf (procfs_file ? procfs_file : stdout,
+ "Thread %d: ", thread);
+
+ proc_prettyfprint_flags (procfs_file ? procfs_file : stdout,
+ flags, 0);
+
+ if (flags & (PR_STOPPED | PR_ISTOP))
+ proc_prettyfprint_why (procfs_file ? procfs_file : stdout,
+ why, what, 0);
+ if (procfs_file)
+ fflush (procfs_file);
+ }
+}
+
+
+void
+_initialize_proc_api (void)
+{
+ struct cmd_list_element *c;
+
+ c = add_set_cmd ("procfs-trace", no_class,
+ var_boolean, (char *) &procfs_trace,
+ "Set tracing for /proc api calls.\n", &setlist);
+
+ add_show_from_set (c, &showlist);
+ set_cmd_sfunc (c, set_procfs_trace_cmd);
+ c->completer = filename_completer;
+
+ c = add_set_cmd ("procfs-file", no_class, var_filename,
+ (char *) &procfs_filename,
+ "Set filename for /proc tracefile.\n", &setlist);
+
+ add_show_from_set (c, &showlist);
+ set_cmd_sfunc (c, set_procfs_file_cmd);
+}
diff --git a/contrib/gdb/gdb/proc-events.c b/contrib/gdb/gdb/proc-events.c
new file mode 100755
index 0000000..5365fef
--- /dev/null
+++ b/contrib/gdb/gdb/proc-events.c
@@ -0,0 +1,1777 @@
+/* Machine independent support for SVR4 /proc (process file system) for GDB.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Written by Michael Snyder at Cygnus Solutions.
+ Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/*
+ * Pretty-print "events of interest".
+ *
+ * This module includes pretty-print routines for:
+ * faults (hardware exceptions):
+ * signals (software interrupts):
+ * syscalls
+ *
+ * FIXME: At present, the syscall translation table must be initialized,
+ * which is not true of the other translation tables.
+ */
+
+#include "defs.h"
+
+#if defined (NEW_PROC_API)
+#define _STRUCTURED_PROC 1
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
+#ifdef HAVE_SYS_FAULT_H
+#include <sys/fault.h>
+#endif
+
+/* 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 */
+};
+
+/*
+ * pretty print syscalls
+ */
+
+/* Ugh -- Unixware and Solaris spell these differently! */
+
+#ifdef SYS_lwpcreate
+#define SYS_lwp_create SYS_lwpcreate
+#endif
+
+#ifdef SYS_lwpexit
+#define SYS_lwp_exit SYS_lwpexit
+#endif
+
+#ifdef SYS_lwpwait
+#define SYS_lwp_wait SYS_lwpwait
+#endif
+
+#ifdef SYS_lwpself
+#define SYS_lwp_self SYS_lwpself
+#endif
+
+#ifdef SYS_lwpinfo
+#define SYS_lwp_info SYS_lwpinfo
+#endif
+
+#ifdef SYS_lwpprivate
+#define SYS_lwp_private SYS_lwpprivate
+#endif
+
+#ifdef SYS_lwpkill
+#define SYS_lwp_kill SYS_lwpkill
+#endif
+
+#ifdef SYS_lwpsuspend
+#define SYS_lwp_suspend SYS_lwpsuspend
+#endif
+
+#ifdef SYS_lwpcontinue
+#define SYS_lwp_continue SYS_lwpcontinue
+#endif
+
+
+/* Syscall translation table. */
+
+#define MAX_SYSCALLS 262 /* pretty arbitrary */
+static char * syscall_table[MAX_SYSCALLS];
+
+void
+init_syscall_table (void)
+{
+#if defined (SYS_BSD_getime)
+ syscall_table[SYS_BSD_getime] = "BSD_getime";
+#endif
+#if defined (SYS_BSDgetpgrp)
+ syscall_table[SYS_BSDgetpgrp] = "BSDgetpgrp";
+#endif
+#if defined (SYS_BSDsetpgrp)
+ syscall_table[SYS_BSDsetpgrp] = "BSDsetpgrp";
+#endif
+#if defined (SYS_acancel)
+ syscall_table[SYS_acancel] = "acancel";
+#endif
+#if defined (SYS_accept)
+ syscall_table[SYS_accept] = "accept";
+#endif
+#if defined (SYS_access)
+ syscall_table[SYS_access] = "access";
+#endif
+#if defined (SYS_acct)
+ syscall_table[SYS_acct] = "acct";
+#endif
+#if defined (SYS_acl)
+ syscall_table[SYS_acl] = "acl";
+#endif
+#if defined (SYS_aclipc)
+ syscall_table[SYS_aclipc] = "aclipc";
+#endif
+#if defined (SYS_adjtime)
+ syscall_table[SYS_adjtime] = "adjtime";
+#endif
+#if defined (SYS_afs_syscall)
+ syscall_table[SYS_afs_syscall] = "afs_syscall";
+#endif
+#if defined (SYS_alarm)
+ syscall_table[SYS_alarm] = "alarm";
+#endif
+#if defined (SYS_alt_plock)
+ syscall_table[SYS_alt_plock] = "alt_plock";
+#endif
+#if defined (SYS_alt_sigpending)
+ syscall_table[SYS_alt_sigpending] = "alt_sigpending";
+#endif
+#if defined (SYS_async)
+ syscall_table[SYS_async] = "async";
+#endif
+#if defined (SYS_async_daemon)
+ syscall_table[SYS_async_daemon] = "async_daemon";
+#endif
+#if defined (SYS_audcntl)
+ syscall_table[SYS_audcntl] = "audcntl";
+#endif
+#if defined (SYS_audgen)
+ syscall_table[SYS_audgen] = "audgen";
+#endif
+#if defined (SYS_auditbuf)
+ syscall_table[SYS_auditbuf] = "auditbuf";
+#endif
+#if defined (SYS_auditctl)
+ syscall_table[SYS_auditctl] = "auditctl";
+#endif
+#if defined (SYS_auditdmp)
+ syscall_table[SYS_auditdmp] = "auditdmp";
+#endif
+#if defined (SYS_auditevt)
+ syscall_table[SYS_auditevt] = "auditevt";
+#endif
+#if defined (SYS_auditlog)
+ syscall_table[SYS_auditlog] = "auditlog";
+#endif
+#if defined (SYS_auditsys)
+ syscall_table[SYS_auditsys] = "auditsys";
+#endif
+#if defined (SYS_bind)
+ syscall_table[SYS_bind] = "bind";
+#endif
+#if defined (SYS_block)
+ syscall_table[SYS_block] = "block";
+#endif
+#if defined (SYS_brk)
+ syscall_table[SYS_brk] = "brk";
+#endif
+#if defined (SYS_cachectl)
+ syscall_table[SYS_cachectl] = "cachectl";
+#endif
+#if defined (SYS_cacheflush)
+ syscall_table[SYS_cacheflush] = "cacheflush";
+#endif
+#if defined (SYS_cancelblock)
+ syscall_table[SYS_cancelblock] = "cancelblock";
+#endif
+#if defined (SYS_cg_bind)
+ syscall_table[SYS_cg_bind] = "cg_bind";
+#endif
+#if defined (SYS_cg_current)
+ syscall_table[SYS_cg_current] = "cg_current";
+#endif
+#if defined (SYS_cg_ids)
+ syscall_table[SYS_cg_ids] = "cg_ids";
+#endif
+#if defined (SYS_cg_info)
+ syscall_table[SYS_cg_info] = "cg_info";
+#endif
+#if defined (SYS_cg_memloc)
+ syscall_table[SYS_cg_memloc] = "cg_memloc";
+#endif
+#if defined (SYS_cg_processors)
+ syscall_table[SYS_cg_processors] = "cg_processors";
+#endif
+#if defined (SYS_chdir)
+ syscall_table[SYS_chdir] = "chdir";
+#endif
+#if defined (SYS_chflags)
+ syscall_table[SYS_chflags] = "chflags";
+#endif
+#if defined (SYS_chmod)
+ syscall_table[SYS_chmod] = "chmod";
+#endif
+#if defined (SYS_chown)
+ syscall_table[SYS_chown] = "chown";
+#endif
+#if defined (SYS_chroot)
+ syscall_table[SYS_chroot] = "chroot";
+#endif
+#if defined (SYS_clocal)
+ syscall_table[SYS_clocal] = "clocal";
+#endif
+#if defined (SYS_clock_getres)
+ syscall_table[SYS_clock_getres] = "clock_getres";
+#endif
+#if defined (SYS_clock_gettime)
+ syscall_table[SYS_clock_gettime] = "clock_gettime";
+#endif
+#if defined (SYS_clock_settime)
+ syscall_table[SYS_clock_settime] = "clock_settime";
+#endif
+#if defined (SYS_close)
+ syscall_table[SYS_close] = "close";
+#endif
+#if defined (SYS_connect)
+ syscall_table[SYS_connect] = "connect";
+#endif
+#if defined (SYS_context)
+ syscall_table[SYS_context] = "context";
+#endif
+#if defined (SYS_creat)
+ syscall_table[SYS_creat] = "creat";
+#endif
+#if defined (SYS_creat64)
+ syscall_table[SYS_creat64] = "creat64";
+#endif
+#if defined (SYS_devstat)
+ syscall_table[SYS_devstat] = "devstat";
+#endif
+#if defined (SYS_dmi)
+ syscall_table[SYS_dmi] = "dmi";
+#endif
+#if defined (SYS_door)
+ syscall_table[SYS_door] = "door";
+#endif
+#if defined (SYS_dshmsys)
+ syscall_table[SYS_dshmsys] = "dshmsys";
+#endif
+#if defined (SYS_dup)
+ syscall_table[SYS_dup] = "dup";
+#endif
+#if defined (SYS_dup2)
+ syscall_table[SYS_dup2] = "dup2";
+#endif
+#if defined (SYS_evsys)
+ syscall_table[SYS_evsys] = "evsys";
+#endif
+#if defined (SYS_evtrapret)
+ syscall_table[SYS_evtrapret] = "evtrapret";
+#endif
+#if defined (SYS_exec)
+ syscall_table[SYS_exec] = "exec";
+#endif
+#if defined (SYS_exec_with_loader)
+ syscall_table[SYS_exec_with_loader] = "exec_with_loader";
+#endif
+#if defined (SYS_execv)
+ syscall_table[SYS_execv] = "execv";
+#endif
+#if defined (SYS_execve)
+ syscall_table[SYS_execve] = "execve";
+#endif
+#if defined (SYS_exit)
+ syscall_table[SYS_exit] = "exit";
+#endif
+#if defined (SYS_exportfs)
+ syscall_table[SYS_exportfs] = "exportfs";
+#endif
+#if defined (SYS_facl)
+ syscall_table[SYS_facl] = "facl";
+#endif
+#if defined (SYS_fchdir)
+ syscall_table[SYS_fchdir] = "fchdir";
+#endif
+#if defined (SYS_fchflags)
+ syscall_table[SYS_fchflags] = "fchflags";
+#endif
+#if defined (SYS_fchmod)
+ syscall_table[SYS_fchmod] = "fchmod";
+#endif
+#if defined (SYS_fchown)
+ syscall_table[SYS_fchown] = "fchown";
+#endif
+#if defined (SYS_fchroot)
+ syscall_table[SYS_fchroot] = "fchroot";
+#endif
+#if defined (SYS_fcntl)
+ syscall_table[SYS_fcntl] = "fcntl";
+#endif
+#if defined (SYS_fdatasync)
+ syscall_table[SYS_fdatasync] = "fdatasync";
+#endif
+#if defined (SYS_fdevstat)
+ syscall_table[SYS_fdevstat] = "fdevstat";
+#endif
+#if defined (SYS_fdsync)
+ syscall_table[SYS_fdsync] = "fdsync";
+#endif
+#if defined (SYS_filepriv)
+ syscall_table[SYS_filepriv] = "filepriv";
+#endif
+#if defined (SYS_flock)
+ syscall_table[SYS_flock] = "flock";
+#endif
+#if defined (SYS_flvlfile)
+ syscall_table[SYS_flvlfile] = "flvlfile";
+#endif
+#if defined (SYS_fork)
+ syscall_table[SYS_fork] = "fork";
+#endif
+#if defined (SYS_fork1)
+ syscall_table[SYS_fork1] = "fork1";
+#endif
+#if defined (SYS_forkall)
+ syscall_table[SYS_forkall] = "forkall";
+#endif
+#if defined (SYS_fpathconf)
+ syscall_table[SYS_fpathconf] = "fpathconf";
+#endif
+#if defined (SYS_fstat)
+ syscall_table[SYS_fstat] = "fstat";
+#endif
+#if defined (SYS_fstat64)
+ syscall_table[SYS_fstat64] = "fstat64";
+#endif
+#if defined (SYS_fstatfs)
+ syscall_table[SYS_fstatfs] = "fstatfs";
+#endif
+#if defined (SYS_fstatvfs)
+ syscall_table[SYS_fstatvfs] = "fstatvfs";
+#endif
+#if defined (SYS_fstatvfs64)
+ syscall_table[SYS_fstatvfs64] = "fstatvfs64";
+#endif
+#if defined (SYS_fsync)
+ syscall_table[SYS_fsync] = "fsync";
+#endif
+#if defined (SYS_ftruncate)
+ syscall_table[SYS_ftruncate] = "ftruncate";
+#endif
+#if defined (SYS_ftruncate64)
+ syscall_table[SYS_ftruncate64] = "ftruncate64";
+#endif
+#if defined (SYS_fuser)
+ syscall_table[SYS_fuser] = "fuser";
+#endif
+#if defined (SYS_fxstat)
+ syscall_table[SYS_fxstat] = "fxstat";
+#endif
+#if defined (SYS_get_sysinfo)
+ syscall_table[SYS_get_sysinfo] = "get_sysinfo";
+#endif
+#if defined (SYS_getaddressconf)
+ syscall_table[SYS_getaddressconf] = "getaddressconf";
+#endif
+#if defined (SYS_getcontext)
+ syscall_table[SYS_getcontext] = "getcontext";
+#endif
+#if defined (SYS_getdents)
+ syscall_table[SYS_getdents] = "getdents";
+#endif
+#if defined (SYS_getdents64)
+ syscall_table[SYS_getdents64] = "getdents64";
+#endif
+#if defined (SYS_getdirentries)
+ syscall_table[SYS_getdirentries] = "getdirentries";
+#endif
+#if defined (SYS_getdomainname)
+ syscall_table[SYS_getdomainname] = "getdomainname";
+#endif
+#if defined (SYS_getdtablesize)
+ syscall_table[SYS_getdtablesize] = "getdtablesize";
+#endif
+#if defined (SYS_getfh)
+ syscall_table[SYS_getfh] = "getfh";
+#endif
+#if defined (SYS_getfsstat)
+ syscall_table[SYS_getfsstat] = "getfsstat";
+#endif
+#if defined (SYS_getgid)
+ syscall_table[SYS_getgid] = "getgid";
+#endif
+#if defined (SYS_getgroups)
+ syscall_table[SYS_getgroups] = "getgroups";
+#endif
+#if defined (SYS_gethostid)
+ syscall_table[SYS_gethostid] = "gethostid";
+#endif
+#if defined (SYS_gethostname)
+ syscall_table[SYS_gethostname] = "gethostname";
+#endif
+#if defined (SYS_getitimer)
+ syscall_table[SYS_getitimer] = "getitimer";
+#endif
+#if defined (SYS_getksym)
+ syscall_table[SYS_getksym] = "getksym";
+#endif
+#if defined (SYS_getlogin)
+ syscall_table[SYS_getlogin] = "getlogin";
+#endif
+#if defined (SYS_getmnt)
+ syscall_table[SYS_getmnt] = "getmnt";
+#endif
+#if defined (SYS_getmsg)
+ syscall_table[SYS_getmsg] = "getmsg";
+#endif
+#if defined (SYS_getpagesize)
+ syscall_table[SYS_getpagesize] = "getpagesize";
+#endif
+#if defined (SYS_getpeername)
+ syscall_table[SYS_getpeername] = "getpeername";
+#endif
+#if defined (SYS_getpgid)
+ syscall_table[SYS_getpgid] = "getpgid";
+#endif
+#if defined (SYS_getpgrp)
+ syscall_table[SYS_getpgrp] = "getpgrp";
+#endif
+#if defined (SYS_getpid)
+ syscall_table[SYS_getpid] = "getpid";
+#endif
+#if defined (SYS_getpmsg)
+ syscall_table[SYS_getpmsg] = "getpmsg";
+#endif
+#if defined (SYS_getpriority)
+ syscall_table[SYS_getpriority] = "getpriority";
+#endif
+#if defined (SYS_getrlimit)
+ syscall_table[SYS_getrlimit] = "getrlimit";
+#endif
+#if defined (SYS_getrlimit64)
+ syscall_table[SYS_getrlimit64] = "getrlimit64";
+#endif
+#if defined (SYS_getrusage)
+ syscall_table[SYS_getrusage] = "getrusage";
+#endif
+#if defined (SYS_getsid)
+ syscall_table[SYS_getsid] = "getsid";
+#endif
+#if defined (SYS_getsockname)
+ syscall_table[SYS_getsockname] = "getsockname";
+#endif
+#if defined (SYS_getsockopt)
+ syscall_table[SYS_getsockopt] = "getsockopt";
+#endif
+#if defined (SYS_gettimeofday)
+ syscall_table[SYS_gettimeofday] = "gettimeofday";
+#endif
+#if defined (SYS_getuid)
+ syscall_table[SYS_getuid] = "getuid";
+#endif
+#if defined (SYS_gtty)
+ syscall_table[SYS_gtty] = "gtty";
+#endif
+#if defined (SYS_hrtsys)
+ syscall_table[SYS_hrtsys] = "hrtsys";
+#endif
+#if defined (SYS_inst_sync)
+ syscall_table[SYS_inst_sync] = "inst_sync";
+#endif
+#if defined (SYS_install_utrap)
+ syscall_table[SYS_install_utrap] = "install_utrap";
+#endif
+#if defined (SYS_invlpg)
+ syscall_table[SYS_invlpg] = "invlpg";
+#endif
+#if defined (SYS_ioctl)
+ syscall_table[SYS_ioctl] = "ioctl";
+#endif
+#if defined (SYS_kaio)
+ syscall_table[SYS_kaio] = "kaio";
+#endif
+#if defined (SYS_keyctl)
+ syscall_table[SYS_keyctl] = "keyctl";
+#endif
+#if defined (SYS_kill)
+ syscall_table[SYS_kill] = "kill";
+#endif
+#if defined (SYS_killpg)
+ syscall_table[SYS_killpg] = "killpg";
+#endif
+#if defined (SYS_kloadcall)
+ syscall_table[SYS_kloadcall] = "kloadcall";
+#endif
+#if defined (SYS_kmodcall)
+ syscall_table[SYS_kmodcall] = "kmodcall";
+#endif
+#if defined (SYS_ksigaction)
+ syscall_table[SYS_ksigaction] = "ksigaction";
+#endif
+#if defined (SYS_ksigprocmask)
+ syscall_table[SYS_ksigprocmask] = "ksigprocmask";
+#endif
+#if defined (SYS_ksigqueue)
+ syscall_table[SYS_ksigqueue] = "ksigqueue";
+#endif
+#if defined (SYS_lchown)
+ syscall_table[SYS_lchown] = "lchown";
+#endif
+#if defined (SYS_link)
+ syscall_table[SYS_link] = "link";
+#endif
+#if defined (SYS_listen)
+ syscall_table[SYS_listen] = "listen";
+#endif
+#if defined (SYS_llseek)
+ syscall_table[SYS_llseek] = "llseek";
+#endif
+#if defined (SYS_lseek)
+ syscall_table[SYS_lseek] = "lseek";
+#endif
+#if defined (SYS_lseek64)
+ syscall_table[SYS_lseek64] = "lseek64";
+#endif
+#if defined (SYS_lstat)
+ syscall_table[SYS_lstat] = "lstat";
+#endif
+#if defined (SYS_lstat64)
+ syscall_table[SYS_lstat64] = "lstat64";
+#endif
+#if defined (SYS_lvldom)
+ syscall_table[SYS_lvldom] = "lvldom";
+#endif
+#if defined (SYS_lvlequal)
+ syscall_table[SYS_lvlequal] = "lvlequal";
+#endif
+#if defined (SYS_lvlfile)
+ syscall_table[SYS_lvlfile] = "lvlfile";
+#endif
+#if defined (SYS_lvlipc)
+ syscall_table[SYS_lvlipc] = "lvlipc";
+#endif
+#if defined (SYS_lvlproc)
+ syscall_table[SYS_lvlproc] = "lvlproc";
+#endif
+#if defined (SYS_lvlvfs)
+ syscall_table[SYS_lvlvfs] = "lvlvfs";
+#endif
+#if defined (SYS_lwp_alarm)
+ syscall_table[SYS_lwp_alarm] = "lwp_alarm";
+#endif
+#if defined (SYS_lwp_cond_broadcast)
+ syscall_table[SYS_lwp_cond_broadcast] = "lwp_cond_broadcast";
+#endif
+#if defined (SYS_lwp_cond_signal)
+ syscall_table[SYS_lwp_cond_signal] = "lwp_cond_signal";
+#endif
+#if defined (SYS_lwp_cond_wait)
+ syscall_table[SYS_lwp_cond_wait] = "lwp_cond_wait";
+#endif
+#if defined (SYS_lwp_continue)
+ syscall_table[SYS_lwp_continue] = "lwp_continue";
+#endif
+#if defined (SYS_lwp_create)
+ syscall_table[SYS_lwp_create] = "lwp_create";
+#endif
+#if defined (SYS_lwp_exit)
+ syscall_table[SYS_lwp_exit] = "lwp_exit";
+#endif
+#if defined (SYS_lwp_getprivate)
+ syscall_table[SYS_lwp_getprivate] = "lwp_getprivate";
+#endif
+#if defined (SYS_lwp_info)
+ syscall_table[SYS_lwp_info] = "lwp_info";
+#endif
+#if defined (SYS_lwp_kill)
+ syscall_table[SYS_lwp_kill] = "lwp_kill";
+#endif
+#if defined (SYS_lwp_mutex_init)
+ syscall_table[SYS_lwp_mutex_init] = "lwp_mutex_init";
+#endif
+#if defined (SYS_lwp_mutex_lock)
+ syscall_table[SYS_lwp_mutex_lock] = "lwp_mutex_lock";
+#endif
+#if defined (SYS_lwp_mutex_trylock)
+ syscall_table[SYS_lwp_mutex_trylock] = "lwp_mutex_trylock";
+#endif
+#if defined (SYS_lwp_mutex_unlock)
+ syscall_table[SYS_lwp_mutex_unlock] = "lwp_mutex_unlock";
+#endif
+#if defined (SYS_lwp_private)
+ syscall_table[SYS_lwp_private] = "lwp_private";
+#endif
+#if defined (SYS_lwp_self)
+ syscall_table[SYS_lwp_self] = "lwp_self";
+#endif
+#if defined (SYS_lwp_sema_post)
+ syscall_table[SYS_lwp_sema_post] = "lwp_sema_post";
+#endif
+#if defined (SYS_lwp_sema_trywait)
+ syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
+#endif
+#if defined (SYS_lwp_sema_wait)
+ syscall_table[SYS_lwp_sema_wait] = "lwp_sema_wait";
+#endif
+#if defined (SYS_lwp_setprivate)
+ syscall_table[SYS_lwp_setprivate] = "lwp_setprivate";
+#endif
+#if defined (SYS_lwp_sigredirect)
+ syscall_table[SYS_lwp_sigredirect] = "lwp_sigredirect";
+#endif
+#if defined (SYS_lwp_suspend)
+ syscall_table[SYS_lwp_suspend] = "lwp_suspend";
+#endif
+#if defined (SYS_lwp_wait)
+ syscall_table[SYS_lwp_wait] = "lwp_wait";
+#endif
+#if defined (SYS_lxstat)
+ syscall_table[SYS_lxstat] = "lxstat";
+#endif
+#if defined (SYS_madvise)
+ syscall_table[SYS_madvise] = "madvise";
+#endif
+#if defined (SYS_memcntl)
+ syscall_table[SYS_memcntl] = "memcntl";
+#endif
+#if defined (SYS_mincore)
+ syscall_table[SYS_mincore] = "mincore";
+#endif
+#if defined (SYS_mincore)
+ syscall_table[SYS_mincore] = "mincore";
+#endif
+#if defined (SYS_mkdir)
+ syscall_table[SYS_mkdir] = "mkdir";
+#endif
+#if defined (SYS_mkmld)
+ syscall_table[SYS_mkmld] = "mkmld";
+#endif
+#if defined (SYS_mknod)
+ syscall_table[SYS_mknod] = "mknod";
+#endif
+#if defined (SYS_mldmode)
+ syscall_table[SYS_mldmode] = "mldmode";
+#endif
+#if defined (SYS_mmap)
+ syscall_table[SYS_mmap] = "mmap";
+#endif
+#if defined (SYS_mmap64)
+ syscall_table[SYS_mmap64] = "mmap64";
+#endif
+#if defined (SYS_modadm)
+ syscall_table[SYS_modadm] = "modadm";
+#endif
+#if defined (SYS_modctl)
+ syscall_table[SYS_modctl] = "modctl";
+#endif
+#if defined (SYS_modload)
+ syscall_table[SYS_modload] = "modload";
+#endif
+#if defined (SYS_modpath)
+ syscall_table[SYS_modpath] = "modpath";
+#endif
+#if defined (SYS_modstat)
+ syscall_table[SYS_modstat] = "modstat";
+#endif
+#if defined (SYS_moduload)
+ syscall_table[SYS_moduload] = "moduload";
+#endif
+#if defined (SYS_mount)
+ syscall_table[SYS_mount] = "mount";
+#endif
+#if defined (SYS_mprotect)
+ syscall_table[SYS_mprotect] = "mprotect";
+#endif
+#if defined (SYS_mremap)
+ syscall_table[SYS_mremap] = "mremap";
+#endif
+#if defined (SYS_msfs_syscall)
+ syscall_table[SYS_msfs_syscall] = "msfs_syscall";
+#endif
+#if defined (SYS_msgctl)
+ syscall_table[SYS_msgctl] = "msgctl";
+#endif
+#if defined (SYS_msgget)
+ syscall_table[SYS_msgget] = "msgget";
+#endif
+#if defined (SYS_msgrcv)
+ syscall_table[SYS_msgrcv] = "msgrcv";
+#endif
+#if defined (SYS_msgsnd)
+ syscall_table[SYS_msgsnd] = "msgsnd";
+#endif
+#if defined (SYS_msgsys)
+ syscall_table[SYS_msgsys] = "msgsys";
+#endif
+#if defined (SYS_msleep)
+ syscall_table[SYS_msleep] = "msleep";
+#endif
+#if defined (SYS_msync)
+ syscall_table[SYS_msync] = "msync";
+#endif
+#if defined (SYS_munmap)
+ syscall_table[SYS_munmap] = "munmap";
+#endif
+#if defined (SYS_mvalid)
+ syscall_table[SYS_mvalid] = "mvalid";
+#endif
+#if defined (SYS_mwakeup)
+ syscall_table[SYS_mwakeup] = "mwakeup";
+#endif
+#if defined (SYS_naccept)
+ syscall_table[SYS_naccept] = "naccept";
+#endif
+#if defined (SYS_nanosleep)
+ syscall_table[SYS_nanosleep] = "nanosleep";
+#endif
+#if defined (SYS_nfssvc)
+ syscall_table[SYS_nfssvc] = "nfssvc";
+#endif
+#if defined (SYS_nfssys)
+ syscall_table[SYS_nfssys] = "nfssys";
+#endif
+#if defined (SYS_ngetpeername)
+ syscall_table[SYS_ngetpeername] = "ngetpeername";
+#endif
+#if defined (SYS_ngetsockname)
+ syscall_table[SYS_ngetsockname] = "ngetsockname";
+#endif
+#if defined (SYS_nice)
+ syscall_table[SYS_nice] = "nice";
+#endif
+#if defined (SYS_nrecvfrom)
+ syscall_table[SYS_nrecvfrom] = "nrecvfrom";
+#endif
+#if defined (SYS_nrecvmsg)
+ syscall_table[SYS_nrecvmsg] = "nrecvmsg";
+#endif
+#if defined (SYS_nsendmsg)
+ syscall_table[SYS_nsendmsg] = "nsendmsg";
+#endif
+#if defined (SYS_ntp_adjtime)
+ syscall_table[SYS_ntp_adjtime] = "ntp_adjtime";
+#endif
+#if defined (SYS_ntp_gettime)
+ syscall_table[SYS_ntp_gettime] = "ntp_gettime";
+#endif
+#if defined (SYS_nuname)
+ syscall_table[SYS_nuname] = "nuname";
+#endif
+#if defined (SYS_obreak)
+ syscall_table[SYS_obreak] = "obreak";
+#endif
+#if defined (SYS_old_accept)
+ syscall_table[SYS_old_accept] = "old_accept";
+#endif
+#if defined (SYS_old_fstat)
+ syscall_table[SYS_old_fstat] = "old_fstat";
+#endif
+#if defined (SYS_old_getpeername)
+ syscall_table[SYS_old_getpeername] = "old_getpeername";
+#endif
+#if defined (SYS_old_getpgrp)
+ syscall_table[SYS_old_getpgrp] = "old_getpgrp";
+#endif
+#if defined (SYS_old_getsockname)
+ syscall_table[SYS_old_getsockname] = "old_getsockname";
+#endif
+#if defined (SYS_old_killpg)
+ syscall_table[SYS_old_killpg] = "old_killpg";
+#endif
+#if defined (SYS_old_lstat)
+ syscall_table[SYS_old_lstat] = "old_lstat";
+#endif
+#if defined (SYS_old_recv)
+ syscall_table[SYS_old_recv] = "old_recv";
+#endif
+#if defined (SYS_old_recvfrom)
+ syscall_table[SYS_old_recvfrom] = "old_recvfrom";
+#endif
+#if defined (SYS_old_recvmsg)
+ syscall_table[SYS_old_recvmsg] = "old_recvmsg";
+#endif
+#if defined (SYS_old_send)
+ syscall_table[SYS_old_send] = "old_send";
+#endif
+#if defined (SYS_old_sendmsg)
+ syscall_table[SYS_old_sendmsg] = "old_sendmsg";
+#endif
+#if defined (SYS_old_sigblock)
+ syscall_table[SYS_old_sigblock] = "old_sigblock";
+#endif
+#if defined (SYS_old_sigsetmask)
+ syscall_table[SYS_old_sigsetmask] = "old_sigsetmask";
+#endif
+#if defined (SYS_old_sigvec)
+ syscall_table[SYS_old_sigvec] = "old_sigvec";
+#endif
+#if defined (SYS_old_stat)
+ syscall_table[SYS_old_stat] = "old_stat";
+#endif
+#if defined (SYS_old_vhangup)
+ syscall_table[SYS_old_vhangup] = "old_vhangup";
+#endif
+#if defined (SYS_old_wait)
+ syscall_table[SYS_old_wait] = "old_wait";
+#endif
+#if defined (SYS_oldquota)
+ syscall_table[SYS_oldquota] = "oldquota";
+#endif
+#if defined (SYS_online)
+ syscall_table[SYS_online] = "online";
+#endif
+#if defined (SYS_open)
+ syscall_table[SYS_open] = "open";
+#endif
+#if defined (SYS_open64)
+ syscall_table[SYS_open64] = "open64";
+#endif
+#if defined (SYS_ovadvise)
+ syscall_table[SYS_ovadvise] = "ovadvise";
+#endif
+#if defined (SYS_p_online)
+ syscall_table[SYS_p_online] = "p_online";
+#endif
+#if defined (SYS_pagelock)
+ syscall_table[SYS_pagelock] = "pagelock";
+#endif
+#if defined (SYS_pathconf)
+ syscall_table[SYS_pathconf] = "pathconf";
+#endif
+#if defined (SYS_pause)
+ syscall_table[SYS_pause] = "pause";
+#endif
+#if defined (SYS_pgrpsys)
+ syscall_table[SYS_pgrpsys] = "pgrpsys";
+#endif
+#if defined (SYS_pid_block)
+ syscall_table[SYS_pid_block] = "pid_block";
+#endif
+#if defined (SYS_pid_unblock)
+ syscall_table[SYS_pid_unblock] = "pid_unblock";
+#endif
+#if defined (SYS_pipe)
+ syscall_table[SYS_pipe] = "pipe";
+#endif
+#if defined (SYS_plock)
+ syscall_table[SYS_plock] = "plock";
+#endif
+#if defined (SYS_poll)
+ syscall_table[SYS_poll] = "poll";
+#endif
+#if defined (SYS_prctl)
+ syscall_table[SYS_prctl] = "prctl";
+#endif
+#if defined (SYS_pread)
+ syscall_table[SYS_pread] = "pread";
+#endif
+#if defined (SYS_pread64)
+ syscall_table[SYS_pread64] = "pread64";
+#endif
+#if defined (SYS_pread64)
+ syscall_table[SYS_pread64] = "pread64";
+#endif
+#if defined (SYS_prepblock)
+ syscall_table[SYS_prepblock] = "prepblock";
+#endif
+#if defined (SYS_priocntl)
+ syscall_table[SYS_priocntl] = "priocntl";
+#endif
+#if defined (SYS_priocntllst)
+ syscall_table[SYS_priocntllst] = "priocntllst";
+#endif
+#if defined (SYS_priocntlset)
+ syscall_table[SYS_priocntlset] = "priocntlset";
+#endif
+#if defined (SYS_priocntlsys)
+ syscall_table[SYS_priocntlsys] = "priocntlsys";
+#endif
+#if defined (SYS_procblk)
+ syscall_table[SYS_procblk] = "procblk";
+#endif
+#if defined (SYS_processor_bind)
+ syscall_table[SYS_processor_bind] = "processor_bind";
+#endif
+#if defined (SYS_processor_exbind)
+ syscall_table[SYS_processor_exbind] = "processor_exbind";
+#endif
+#if defined (SYS_processor_info)
+ syscall_table[SYS_processor_info] = "processor_info";
+#endif
+#if defined (SYS_procpriv)
+ syscall_table[SYS_procpriv] = "procpriv";
+#endif
+#if defined (SYS_profil)
+ syscall_table[SYS_profil] = "profil";
+#endif
+#if defined (SYS_proplist_syscall)
+ syscall_table[SYS_proplist_syscall] = "proplist_syscall";
+#endif
+#if defined (SYS_pset)
+ syscall_table[SYS_pset] = "pset";
+#endif
+#if defined (SYS_ptrace)
+ syscall_table[SYS_ptrace] = "ptrace";
+#endif
+#if defined (SYS_putmsg)
+ syscall_table[SYS_putmsg] = "putmsg";
+#endif
+#if defined (SYS_putpmsg)
+ syscall_table[SYS_putpmsg] = "putpmsg";
+#endif
+#if defined (SYS_pwrite)
+ syscall_table[SYS_pwrite] = "pwrite";
+#endif
+#if defined (SYS_pwrite64)
+ syscall_table[SYS_pwrite64] = "pwrite64";
+#endif
+#if defined (SYS_quotactl)
+ syscall_table[SYS_quotactl] = "quotactl";
+#endif
+#if defined (SYS_rdblock)
+ syscall_table[SYS_rdblock] = "rdblock";
+#endif
+#if defined (SYS_read)
+ syscall_table[SYS_read] = "read";
+#endif
+#if defined (SYS_readlink)
+ syscall_table[SYS_readlink] = "readlink";
+#endif
+#if defined (SYS_readv)
+ syscall_table[SYS_readv] = "readv";
+#endif
+#if defined (SYS_reboot)
+ syscall_table[SYS_reboot] = "reboot";
+#endif
+#if defined (SYS_recv)
+ syscall_table[SYS_recv] = "recv";
+#endif
+#if defined (SYS_recvfrom)
+ syscall_table[SYS_recvfrom] = "recvfrom";
+#endif
+#if defined (SYS_recvmsg)
+ syscall_table[SYS_recvmsg] = "recvmsg";
+#endif
+#if defined (SYS_rename)
+ syscall_table[SYS_rename] = "rename";
+#endif
+#if defined (SYS_resolvepath)
+ syscall_table[SYS_resolvepath] = "resolvepath";
+#endif
+#if defined (SYS_revoke)
+ syscall_table[SYS_revoke] = "revoke";
+#endif
+#if defined (SYS_rfsys)
+ syscall_table[SYS_rfsys] = "rfsys";
+#endif
+#if defined (SYS_rmdir)
+ syscall_table[SYS_rmdir] = "rmdir";
+#endif
+#if defined (SYS_rpcsys)
+ syscall_table[SYS_rpcsys] = "rpcsys";
+#endif
+#if defined (SYS_sbrk)
+ syscall_table[SYS_sbrk] = "sbrk";
+#endif
+#if defined (SYS_schedctl)
+ syscall_table[SYS_schedctl] = "schedctl";
+#endif
+#if defined (SYS_secadvise)
+ syscall_table[SYS_secadvise] = "secadvise";
+#endif
+#if defined (SYS_secsys)
+ syscall_table[SYS_secsys] = "secsys";
+#endif
+#if defined (SYS_security)
+ syscall_table[SYS_security] = "security";
+#endif
+#if defined (SYS_select)
+ syscall_table[SYS_select] = "select";
+#endif
+#if defined (SYS_semctl)
+ syscall_table[SYS_semctl] = "semctl";
+#endif
+#if defined (SYS_semget)
+ syscall_table[SYS_semget] = "semget";
+#endif
+#if defined (SYS_semop)
+ syscall_table[SYS_semop] = "semop";
+#endif
+#if defined (SYS_semsys)
+ syscall_table[SYS_semsys] = "semsys";
+#endif
+#if defined (SYS_send)
+ syscall_table[SYS_send] = "send";
+#endif
+#if defined (SYS_sendmsg)
+ syscall_table[SYS_sendmsg] = "sendmsg";
+#endif
+#if defined (SYS_sendto)
+ syscall_table[SYS_sendto] = "sendto";
+#endif
+#if defined (SYS_set_program_attributes)
+ syscall_table[SYS_set_program_attributes] = "set_program_attributes";
+#endif
+#if defined (SYS_set_speculative)
+ syscall_table[SYS_set_speculative] = "set_speculative";
+#endif
+#if defined (SYS_set_sysinfo)
+ syscall_table[SYS_set_sysinfo] = "set_sysinfo";
+#endif
+#if defined (SYS_setcontext)
+ syscall_table[SYS_setcontext] = "setcontext";
+#endif
+#if defined (SYS_setdomainname)
+ syscall_table[SYS_setdomainname] = "setdomainname";
+#endif
+#if defined (SYS_setegid)
+ syscall_table[SYS_setegid] = "setegid";
+#endif
+#if defined (SYS_seteuid)
+ syscall_table[SYS_seteuid] = "seteuid";
+#endif
+#if defined (SYS_setgid)
+ syscall_table[SYS_setgid] = "setgid";
+#endif
+#if defined (SYS_setgroups)
+ syscall_table[SYS_setgroups] = "setgroups";
+#endif
+#if defined (SYS_sethostid)
+ syscall_table[SYS_sethostid] = "sethostid";
+#endif
+#if defined (SYS_sethostname)
+ syscall_table[SYS_sethostname] = "sethostname";
+#endif
+#if defined (SYS_setitimer)
+ syscall_table[SYS_setitimer] = "setitimer";
+#endif
+#if defined (SYS_setlogin)
+ syscall_table[SYS_setlogin] = "setlogin";
+#endif
+#if defined (SYS_setpgid)
+ syscall_table[SYS_setpgid] = "setpgid";
+#endif
+#if defined (SYS_setpgrp)
+ syscall_table[SYS_setpgrp] = "setpgrp";
+#endif
+#if defined (SYS_setpriority)
+ syscall_table[SYS_setpriority] = "setpriority";
+#endif
+#if defined (SYS_setregid)
+ syscall_table[SYS_setregid] = "setregid";
+#endif
+#if defined (SYS_setreuid)
+ syscall_table[SYS_setreuid] = "setreuid";
+#endif
+#if defined (SYS_setrlimit)
+ syscall_table[SYS_setrlimit] = "setrlimit";
+#endif
+#if defined (SYS_setrlimit64)
+ syscall_table[SYS_setrlimit64] = "setrlimit64";
+#endif
+#if defined (SYS_setsid)
+ syscall_table[SYS_setsid] = "setsid";
+#endif
+#if defined (SYS_setsockopt)
+ syscall_table[SYS_setsockopt] = "setsockopt";
+#endif
+#if defined (SYS_settimeofday)
+ syscall_table[SYS_settimeofday] = "settimeofday";
+#endif
+#if defined (SYS_setuid)
+ syscall_table[SYS_setuid] = "setuid";
+#endif
+#if defined (SYS_sgi)
+ syscall_table[SYS_sgi] = "sgi";
+#endif
+#if defined (SYS_sgifastpath)
+ syscall_table[SYS_sgifastpath] = "sgifastpath";
+#endif
+#if defined (SYS_sgikopt)
+ syscall_table[SYS_sgikopt] = "sgikopt";
+#endif
+#if defined (SYS_sginap)
+ syscall_table[SYS_sginap] = "sginap";
+#endif
+#if defined (SYS_shmat)
+ syscall_table[SYS_shmat] = "shmat";
+#endif
+#if defined (SYS_shmctl)
+ syscall_table[SYS_shmctl] = "shmctl";
+#endif
+#if defined (SYS_shmdt)
+ syscall_table[SYS_shmdt] = "shmdt";
+#endif
+#if defined (SYS_shmget)
+ syscall_table[SYS_shmget] = "shmget";
+#endif
+#if defined (SYS_shmsys)
+ syscall_table[SYS_shmsys] = "shmsys";
+#endif
+#if defined (SYS_shutdown)
+ syscall_table[SYS_shutdown] = "shutdown";
+#endif
+#if defined (SYS_sigaction)
+ syscall_table[SYS_sigaction] = "sigaction";
+#endif
+#if defined (SYS_sigaltstack)
+ syscall_table[SYS_sigaltstack] = "sigaltstack";
+#endif
+#if defined (SYS_sigaltstack)
+ syscall_table[SYS_sigaltstack] = "sigaltstack";
+#endif
+#if defined (SYS_sigblock)
+ syscall_table[SYS_sigblock] = "sigblock";
+#endif
+#if defined (SYS_signal)
+ syscall_table[SYS_signal] = "signal";
+#endif
+#if defined (SYS_signotify)
+ syscall_table[SYS_signotify] = "signotify";
+#endif
+#if defined (SYS_signotifywait)
+ syscall_table[SYS_signotifywait] = "signotifywait";
+#endif
+#if defined (SYS_sigpending)
+ syscall_table[SYS_sigpending] = "sigpending";
+#endif
+#if defined (SYS_sigpoll)
+ syscall_table[SYS_sigpoll] = "sigpoll";
+#endif
+#if defined (SYS_sigprocmask)
+ syscall_table[SYS_sigprocmask] = "sigprocmask";
+#endif
+#if defined (SYS_sigqueue)
+ syscall_table[SYS_sigqueue] = "sigqueue";
+#endif
+#if defined (SYS_sigreturn)
+ syscall_table[SYS_sigreturn] = "sigreturn";
+#endif
+#if defined (SYS_sigsendset)
+ syscall_table[SYS_sigsendset] = "sigsendset";
+#endif
+#if defined (SYS_sigsendsys)
+ syscall_table[SYS_sigsendsys] = "sigsendsys";
+#endif
+#if defined (SYS_sigsetmask)
+ syscall_table[SYS_sigsetmask] = "sigsetmask";
+#endif
+#if defined (SYS_sigstack)
+ syscall_table[SYS_sigstack] = "sigstack";
+#endif
+#if defined (SYS_sigsuspend)
+ syscall_table[SYS_sigsuspend] = "sigsuspend";
+#endif
+#if defined (SYS_sigvec)
+ syscall_table[SYS_sigvec] = "sigvec";
+#endif
+#if defined (SYS_sigwait)
+ syscall_table[SYS_sigwait] = "sigwait";
+#endif
+#if defined (SYS_sigwaitprim)
+ syscall_table[SYS_sigwaitprim] = "sigwaitprim";
+#endif
+#if defined (SYS_sleep)
+ syscall_table[SYS_sleep] = "sleep";
+#endif
+#if defined (SYS_so_socket)
+ syscall_table[SYS_so_socket] = "so_socket";
+#endif
+#if defined (SYS_so_socketpair)
+ syscall_table[SYS_so_socketpair] = "so_socketpair";
+#endif
+#if defined (SYS_sockconfig)
+ syscall_table[SYS_sockconfig] = "sockconfig";
+#endif
+#if defined (SYS_socket)
+ syscall_table[SYS_socket] = "socket";
+#endif
+#if defined (SYS_socketpair)
+ syscall_table[SYS_socketpair] = "socketpair";
+#endif
+#if defined (SYS_sproc)
+ syscall_table[SYS_sproc] = "sproc";
+#endif
+#if defined (SYS_sprocsp)
+ syscall_table[SYS_sprocsp] = "sprocsp";
+#endif
+#if defined (SYS_sstk)
+ syscall_table[SYS_sstk] = "sstk";
+#endif
+#if defined (SYS_stat)
+ syscall_table[SYS_stat] = "stat";
+#endif
+#if defined (SYS_stat64)
+ syscall_table[SYS_stat64] = "stat64";
+#endif
+#if defined (SYS_statfs)
+ syscall_table[SYS_statfs] = "statfs";
+#endif
+#if defined (SYS_statvfs)
+ syscall_table[SYS_statvfs] = "statvfs";
+#endif
+#if defined (SYS_statvfs64)
+ syscall_table[SYS_statvfs64] = "statvfs64";
+#endif
+#if defined (SYS_stime)
+ syscall_table[SYS_stime] = "stime";
+#endif
+#if defined (SYS_stty)
+ syscall_table[SYS_stty] = "stty";
+#endif
+#if defined (SYS_subsys_info)
+ syscall_table[SYS_subsys_info] = "subsys_info";
+#endif
+#if defined (SYS_swapctl)
+ syscall_table[SYS_swapctl] = "swapctl";
+#endif
+#if defined (SYS_swapon)
+ syscall_table[SYS_swapon] = "swapon";
+#endif
+#if defined (SYS_symlink)
+ syscall_table[SYS_symlink] = "symlink";
+#endif
+#if defined (SYS_sync)
+ syscall_table[SYS_sync] = "sync";
+#endif
+#if defined (SYS_sys3b)
+ syscall_table[SYS_sys3b] = "sys3b";
+#endif
+#if defined (SYS_syscall)
+ syscall_table[SYS_syscall] = "syscall";
+#endif
+#if defined (SYS_sysconfig)
+ syscall_table[SYS_sysconfig] = "sysconfig";
+#endif
+#if defined (SYS_sysfs)
+ syscall_table[SYS_sysfs] = "sysfs";
+#endif
+#if defined (SYS_sysi86)
+ syscall_table[SYS_sysi86] = "sysi86";
+#endif
+#if defined (SYS_sysinfo)
+ syscall_table[SYS_sysinfo] = "sysinfo";
+#endif
+#if defined (SYS_sysmips)
+ syscall_table[SYS_sysmips] = "sysmips";
+#endif
+#if defined (SYS_syssun)
+ syscall_table[SYS_syssun] = "syssun";
+#endif
+#if defined (SYS_systeminfo)
+ syscall_table[SYS_systeminfo] = "systeminfo";
+#endif
+#if defined (SYS_table)
+ syscall_table[SYS_table] = "table";
+#endif
+#if defined (SYS_time)
+ syscall_table[SYS_time] = "time";
+#endif
+#if defined (SYS_timedwait)
+ syscall_table[SYS_timedwait] = "timedwait";
+#endif
+#if defined (SYS_timer_create)
+ syscall_table[SYS_timer_create] = "timer_create";
+#endif
+#if defined (SYS_timer_delete)
+ syscall_table[SYS_timer_delete] = "timer_delete";
+#endif
+#if defined (SYS_timer_getoverrun)
+ syscall_table[SYS_timer_getoverrun] = "timer_getoverrun";
+#endif
+#if defined (SYS_timer_gettime)
+ syscall_table[SYS_timer_gettime] = "timer_gettime";
+#endif
+#if defined (SYS_timer_settime)
+ syscall_table[SYS_timer_settime] = "timer_settime";
+#endif
+#if defined (SYS_times)
+ syscall_table[SYS_times] = "times";
+#endif
+#if defined (SYS_truncate)
+ syscall_table[SYS_truncate] = "truncate";
+#endif
+#if defined (SYS_truncate64)
+ syscall_table[SYS_truncate64] = "truncate64";
+#endif
+#if defined (SYS_tsolsys)
+ syscall_table[SYS_tsolsys] = "tsolsys";
+#endif
+#if defined (SYS_uadmin)
+ syscall_table[SYS_uadmin] = "uadmin";
+#endif
+#if defined (SYS_ulimit)
+ syscall_table[SYS_ulimit] = "ulimit";
+#endif
+#if defined (SYS_umask)
+ syscall_table[SYS_umask] = "umask";
+#endif
+#if defined (SYS_umount)
+ syscall_table[SYS_umount] = "umount";
+#endif
+#if defined (SYS_uname)
+ syscall_table[SYS_uname] = "uname";
+#endif
+#if defined (SYS_unblock)
+ syscall_table[SYS_unblock] = "unblock";
+#endif
+#if defined (SYS_unlink)
+ syscall_table[SYS_unlink] = "unlink";
+#endif
+#if defined (SYS_unmount)
+ syscall_table[SYS_unmount] = "unmount";
+#endif
+#if defined (SYS_usleep_thread)
+ syscall_table[SYS_usleep_thread] = "usleep_thread";
+#endif
+#if defined (SYS_uswitch)
+ syscall_table[SYS_uswitch] = "uswitch";
+#endif
+#if defined (SYS_utc_adjtime)
+ syscall_table[SYS_utc_adjtime] = "utc_adjtime";
+#endif
+#if defined (SYS_utc_gettime)
+ syscall_table[SYS_utc_gettime] = "utc_gettime";
+#endif
+#if defined (SYS_utime)
+ syscall_table[SYS_utime] = "utime";
+#endif
+#if defined (SYS_utimes)
+ syscall_table[SYS_utimes] = "utimes";
+#endif
+#if defined (SYS_utssys)
+ syscall_table[SYS_utssys] = "utssys";
+#endif
+#if defined (SYS_vfork)
+ syscall_table[SYS_vfork] = "vfork";
+#endif
+#if defined (SYS_vhangup)
+ syscall_table[SYS_vhangup] = "vhangup";
+#endif
+#if defined (SYS_vtrace)
+ syscall_table[SYS_vtrace] = "vtrace";
+#endif
+#if defined (SYS_wait)
+ syscall_table[SYS_wait] = "wait";
+#endif
+#if defined (SYS_waitid)
+ syscall_table[SYS_waitid] = "waitid";
+#endif
+#if defined (SYS_waitsys)
+ syscall_table[SYS_waitsys] = "waitsys";
+#endif
+#if defined (SYS_write)
+ syscall_table[SYS_write] = "write";
+#endif
+#if defined (SYS_writev)
+ syscall_table[SYS_writev] = "writev";
+#endif
+#if defined (SYS_xenix)
+ syscall_table[SYS_xenix] = "xenix";
+#endif
+#if defined (SYS_xmknod)
+ syscall_table[SYS_xmknod] = "xmknod";
+#endif
+#if defined (SYS_xstat)
+ syscall_table[SYS_xstat] = "xstat";
+#endif
+#if defined (SYS_yield)
+ syscall_table[SYS_yield] = "yield";
+#endif
+}
+
+/*
+ * Prettyprint a single syscall by number.
+ */
+
+void
+proc_prettyfprint_syscall (FILE *file, int num, int verbose)
+{
+ if (syscall_table[num])
+ fprintf (file, "SYS_%s ", syscall_table[num]);
+ else
+ fprintf (file, "<Unknown syscall %d> ", num);
+}
+
+void
+proc_prettyprint_syscall (int num, int verbose)
+{
+ proc_prettyfprint_syscall (stdout, num, verbose);
+}
+
+/*
+ * Prettyprint all of the syscalls in a sysset_t set.
+ */
+
+void
+proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose)
+{
+ int i;
+
+ for (i = 0; i < MAX_SYSCALLS; i++)
+ if (prismember (sysset, i))
+ {
+ proc_prettyfprint_syscall (file, i, verbose);
+ }
+ fprintf (file, "\n");
+}
+
+void
+proc_prettyprint_syscalls (sysset_t *sysset, int verbose)
+{
+ proc_prettyfprint_syscalls (stdout, sysset, verbose);
+}
+
+/* FIXME: add real-time signals */
+
+static struct trans signal_table[] =
+{
+ { 0, "<no signal>", "no signal" },
+#ifdef SIGHUP
+ { SIGHUP, "SIGHUP", "Hangup" },
+#endif
+#ifdef SIGINT
+ { SIGINT, "SIGINT", "Interrupt (rubout)" },
+#endif
+#ifdef SIGQUIT
+ { SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
+#endif
+#ifdef SIGILL
+ { SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
+#endif
+#ifdef SIGTRAP
+ { SIGTRAP, "SIGTRAP", "Trace trap" }, /* not reset when caught */
+#endif
+#ifdef SIGABRT
+ { SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
+#endif
+#ifdef SIGIOT
+ { SIGIOT, "SIGIOT", "IOT instruction" },
+#endif
+#ifdef SIGEMT
+ { SIGEMT, "SIGEMT", "EMT instruction" },
+#endif
+#ifdef SIGFPE
+ { SIGFPE, "SIGFPE", "Floating point exception" },
+#endif
+#ifdef SIGKILL
+ { SIGKILL, "SIGKILL", "Kill" }, /* Solaris: cannot be caught/ignored */
+#endif
+#ifdef SIGBUS
+ { SIGBUS, "SIGBUS", "Bus error" },
+#endif
+#ifdef SIGSEGV
+ { SIGSEGV, "SIGSEGV", "Segmentation violation" },
+#endif
+#ifdef SIGSYS
+ { SIGSYS, "SIGSYS", "Bad argument to system call" },
+#endif
+#ifdef SIGPIPE
+ { SIGPIPE, "SIGPIPE", "Write to pipe with no one to read it" },
+#endif
+#ifdef SIGALRM
+ { SIGALRM, "SIGALRM", "Alarm clock" },
+#endif
+#ifdef SIGTERM
+ { SIGTERM, "SIGTERM", "Software termination signal from kill" },
+#endif
+#ifdef SIGUSR1
+ { SIGUSR1, "SIGUSR1", "User defined signal 1" },
+#endif
+#ifdef SIGUSR2
+ { SIGUSR2, "SIGUSR2", "User defined signal 2" },
+#endif
+#ifdef SIGCHLD
+ { SIGCHLD, "SIGCHLD", "Child status changed" }, /* Posix version */
+#endif
+#ifdef SIGCLD
+ { SIGCLD, "SIGCLD", "Child status changed" }, /* Solaris version */
+#endif
+#ifdef SIGPWR
+ { SIGPWR, "SIGPWR", "Power-fail restart" },
+#endif
+#ifdef SIGWINCH
+ { SIGWINCH, "SIGWINCH", "Window size change" },
+#endif
+#ifdef SIGURG
+ { SIGURG, "SIGURG", "Urgent socket condition" },
+#endif
+#ifdef SIGPOLL
+ { SIGPOLL, "SIGPOLL", "Pollable event" },
+#endif
+#ifdef SIGIO
+ { SIGIO, "SIGIO", "Socket I/O possible" }, /* alias for SIGPOLL */
+#endif
+#ifdef SIGSTOP
+ { SIGSTOP, "SIGSTOP", "Stop, not from tty" }, /* cannot be caught or ignored */
+#endif
+#ifdef SIGTSTP
+ { SIGTSTP, "SIGTSTP", "User stop from tty" },
+#endif
+#ifdef SIGCONT
+ { SIGCONT, "SIGCONT", "Stopped process has been continued" },
+#endif
+#ifdef SIGTTIN
+ { SIGTTIN, "SIGTTIN", "Background tty read attempted" },
+#endif
+#ifdef SIGTTOU
+ { SIGTTOU, "SIGTTOU", "Background tty write attempted" },
+#endif
+#ifdef SIGVTALRM
+ { SIGVTALRM, "SIGVTALRM", "Virtual timer expired" },
+#endif
+#ifdef SIGPROF
+ { SIGPROF, "SIGPROF", "Profiling timer expired" },
+#endif
+#ifdef SIGXCPU
+ { SIGXCPU, "SIGXCPU", "Exceeded CPU limit" },
+#endif
+#ifdef SIGXFSZ
+ { SIGXFSZ, "SIGXFSZ", "Exceeded file size limit" },
+#endif
+#ifdef SIGWAITING
+ { SIGWAITING, "SIGWAITING", "Process's LWPs are blocked" },
+#endif
+#ifdef SIGLWP
+ { SIGLWP, "SIGLWP", "Used by thread library" },
+#endif
+#ifdef SIGFREEZE
+ { SIGFREEZE, "SIGFREEZE", "Used by CPR" },
+#endif
+#ifdef SIGTHAW
+ { SIGTHAW, "SIGTHAW", "Used by CPR" },
+#endif
+#ifdef SIGCANCEL
+ { SIGCANCEL, "SIGCANCEL", "Used by libthread" },
+#endif
+#ifdef SIGLOST
+ { SIGLOST, "SIGLOST", "Resource lost" },
+#endif
+#ifdef SIG32
+ { SIG32, "SIG32", "Reserved for kernel usage (Irix)" },
+#endif
+#ifdef SIGPTINTR
+ { SIGPTINTR, "SIGPTINTR", "Posix 1003.1b" },
+#endif
+#ifdef SIGTRESCHED
+ { SIGTRESCHED, "SIGTRESCHED", "Posix 1003.1b" },
+#endif
+#ifdef SIGINFO
+ { SIGINFO, "SIGINFO", "Information request" },
+#endif
+#ifdef SIGRESV
+ { SIGRESV, "SIGRESV", "Reserved by Digital for future use" },
+#endif
+#ifdef SIGAIO
+ { SIGAIO, "SIGAIO", "Asynchronous I/O signal" },
+#endif
+};
+
+/*
+ * Prettyprint a single signal by number.
+ * Accepts a signal number and finds it in the signal table,
+ * then pretty-prints it.
+ */
+
+void
+proc_prettyfprint_signal (FILE *file, int signo, int verbose)
+{
+ int i;
+
+ for (i = 0; i < sizeof (signal_table) / sizeof (signal_table[0]); i++)
+ if (signo == signal_table[i].value)
+ {
+ fprintf (file, "%s", signal_table[i].name);
+ if (verbose)
+ fprintf (file, ": %s\n", signal_table[i].desc);
+ else
+ fprintf (file, " ");
+ return;
+ }
+ fprintf (file, "Unknown signal %d%c", signo, verbose ? '\n' : ' ');
+}
+
+void
+proc_prettyprint_signal (int signo, int verbose)
+{
+ proc_prettyfprint_signal (stdout, signo, verbose);
+}
+
+/*
+ * Prettyprint all of the signals in a sigset_t set.
+ *
+ * This function loops over all signal numbers from 0 to NSIG,
+ * uses them as indexes for prismember, and prints them pretty.
+ *
+ * It does not loop over the signal table, as is done with the
+ * fault table, because the signal table may contain aliases.
+ * If it did, both aliases would be printed.
+ */
+
+void
+proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose)
+{
+ int i;
+
+ for (i = 0; i < NSIG; i++)
+ if (prismember (sigset, i))
+ proc_prettyfprint_signal (file, i, verbose);
+
+ if (!verbose)
+ fprintf (file, "\n");
+}
+
+void
+proc_prettyprint_signalset (sigset_t *sigset, int verbose)
+{
+ proc_prettyfprint_signalset (stdout, sigset, verbose);
+}
+
+/* Hardware fault translation table. */
+
+static struct trans fault_table[] =
+{
+#if defined (FLTILL)
+ { FLTILL, "FLTILL", "Illegal instruction" },
+#endif
+#if defined (FLTPRIV)
+ { FLTPRIV, "FLTPRIV", "Privileged instruction" },
+#endif
+#if defined (FLTBPT)
+ { FLTBPT, "FLTBPT", "Breakpoint trap" },
+#endif
+#if defined (FLTTRACE)
+ { FLTTRACE, "FLTTRACE", "Trace trap" },
+#endif
+#if defined (FLTACCESS)
+ { FLTACCESS, "FLTACCESS", "Memory access fault" },
+#endif
+#if defined (FLTBOUNDS)
+ { FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
+#endif
+#if defined (FLTIOVF)
+ { FLTIOVF, "FLTIOVF", "Integer overflow" },
+#endif
+#if defined (FLTIZDIV)
+ { FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
+#endif
+#if defined (FLTFPE)
+ { FLTFPE, "FLTFPE", "Floating-point exception" },
+#endif
+#if defined (FLTSTACK)
+ { FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
+#endif
+#if defined (FLTPAGE)
+ { FLTPAGE, "FLTPAGE", "Recoverable page fault" },
+#endif
+#if defined (FLTPCINVAL)
+ { FLTPCINVAL, "FLTPCINVAL", "Invalid PC exception" },
+#endif
+#if defined (FLTWATCH)
+ { FLTWATCH, "FLTWATCH", "User watchpoint" },
+#endif
+#if defined (FLTKWATCH)
+ { FLTKWATCH, "FLTKWATCH", "Kernel watchpoint" },
+#endif
+#if defined (FLTSCWATCH)
+ { FLTSCWATCH, "FLTSCWATCH", "Hit a store conditional on a watched page" },
+#endif
+};
+
+/*
+ * Work horse. Accepts an index into the fault table, prints it pretty.
+ */
+
+static void
+prettyfprint_faulttable_entry (FILE *file, int i, int verbose)
+{
+ fprintf (file, "%s", fault_table[i].name);
+ if (verbose)
+ fprintf (file, ": %s\n", fault_table[i].desc);
+ else
+ fprintf (file, " ");
+}
+
+/*
+ * Prettyprint a hardware fault by number.
+ */
+
+void
+proc_prettyfprint_fault (FILE *file, int faultno, int verbose)
+{
+ int i;
+
+ for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
+ if (faultno == fault_table[i].value)
+ {
+ prettyfprint_faulttable_entry (file, i, verbose);
+ return;
+ }
+
+ fprintf (file, "Unknown hardware fault %d%c",
+ faultno, verbose ? '\n' : ' ');
+}
+
+void
+proc_prettyprint_fault (int faultno, int verbose)
+{
+ proc_prettyfprint_fault (stdout, faultno, verbose);
+}
+
+/*
+ * Prettyprint all the faults in a fltset_t set.
+ *
+ * This function loops thru the fault table,
+ * using the value field as the index to prismember.
+ * The fault table had better not contain aliases,
+ * for if it does they will both be printed.
+ */
+
+void
+proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose)
+{
+ int i;
+
+ for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
+ if (prismember (fltset, fault_table[i].value))
+ prettyfprint_faulttable_entry (file, i, verbose);
+
+ if (!verbose)
+ fprintf (file, "\n");
+}
+
+void
+proc_prettyprint_faultset (fltset_t *fltset, int verbose)
+{
+ proc_prettyfprint_faultset (stdout, fltset, verbose);
+}
+
+/*
+ * Todo: actions, holds...
+ */
+
+void
+proc_prettyprint_actionset (struct sigaction *actions, int verbose)
+{
+}
+
+void
+_initialize_proc_events (void)
+{
+ init_syscall_table ();
+}
diff --git a/contrib/gdb/gdb/proc-flags.c b/contrib/gdb/gdb/proc-flags.c
new file mode 100755
index 0000000..6e737d1
--- /dev/null
+++ b/contrib/gdb/gdb/proc-flags.c
@@ -0,0 +1,291 @@
+/* Machine independent support for SVR4 /proc (process file system) for GDB.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Written by Michael Snyder at Cygnus Solutions.
+ Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/*
+ * Pretty-print the prstatus flags.
+ *
+ * Arguments: unsigned long flags, int verbose
+ *
+ */
+
+#include "defs.h"
+
+#if defined (NEW_PROC_API)
+#define _STRUCTURED_PROC 1
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+
+/* 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 */
+};
+
+/* Translate bits in the pr_flags member of the prstatus structure,
+ into the names and desc information. */
+
+static struct trans pr_flag_table[] =
+{
+#if defined (PR_STOPPED)
+ /* Sol2.5: lwp is stopped
+ * Sol2.6: lwp is stopped
+ * Sol2.7: lwp is stopped
+ * IRIX6: process is stopped
+ * OSF: task/thread is stopped
+ * UW: LWP is stopped
+ */
+ { PR_STOPPED, "PR_STOPPED", "Process (LWP) is stopped" },
+#endif
+#if defined (PR_ISTOP)
+ /* Sol2.5: lwp is stopped on an event of interest
+ * Sol2.6: lwp is stopped on an event of interest
+ * Sol2.7: lwp is stopped on an event of interest
+ * IRIX6: process is stopped on event of interest
+ * OSF: task/thread stopped on event of interest
+ * UW: LWP stopped on an event of interest
+ */
+ { PR_ISTOP, "PR_ISTOP", "Stopped on an event of interest" },
+#endif
+#if defined (PR_DSTOP)
+ /* Sol2.5: lwp has a stop directive in effect
+ * Sol2.6: lwp has a stop directive in effect
+ * Sol2.7: lwp has a stop directive in effect
+ * IRIX6: process has stop directive in effect
+ * OSF: task/thread has stop directive in effect
+ * UW: A stop directive is in effect
+ */
+ { PR_DSTOP, "PR_DSTOP", "A stop directive is in effect" },
+#endif
+#if defined (PR_STEP)
+ /* Sol2.5: lwp has a single-step directive in effect
+ * Sol2.6: lwp has a single-step directive in effect
+ * Sol2.7: lwp has a single-step directive in effect
+ * IRIX6: process has single step pending
+ */
+ { PR_STEP, "PR_STEP", "A single step directive is in effect" },
+#endif
+#if defined (PR_ASLEEP)
+ /* Sol2.5: lwp is sleeping in a system call
+ * Sol2.6: lwp is sleeping in a system call
+ * Sol2.7: lwp is sleeping in a system call
+ * IRIX6: process is in an interruptible sleep
+ * OSF: task/thread is asleep within a system call
+ * UW: LWP is sleep()ing in a system call
+ */
+ { PR_ASLEEP, "PR_ASLEEP", "Sleeping in an (interruptible) system call" },
+#endif
+#if defined (PR_PCINVAL)
+ /* Sol2.5: contents of pr_instr undefined
+ * Sol2.6: contents of pr_instr undefined
+ * Sol2.7: contents of pr_instr undefined
+ * IRIX6: current pc is invalid
+ * OSF: program counter contains invalid address
+ * UW: %pc refers to an invalid virtual address
+ */
+ { PR_PCINVAL, "PR_PCINVAL", "PC (pr_instr) is invalid" },
+#endif
+#if defined (PR_ASLWP)
+ /* Sol2.5: this lwp is the aslwp
+ * Sol2.6: this lwp is the aslwp
+ * Sol2.7: this lwp is the aslwp
+ */
+ { PR_ASLWP, "PR_ASLWP", "This is the asynchronous signal LWP" },
+#endif
+#if defined (PR_AGENT)
+ /* Sol2.6: this lwp is the /proc agent lwp
+ * Sol2.7: this lwp is the /proc agent lwp
+ */
+ { PR_AGENT, "PR_AGENT", "This is the /proc agent LWP" },
+#endif
+#if defined (PR_ISSYS)
+ /* Sol2.5: system process
+ * Sol2.6: this is a system process
+ * Sol2.7: this is a system process
+ * IRIX6: process is a system process
+ * OSF: task/thread is a system task/thread
+ * UW: System process
+ */
+ { PR_ISSYS, "PR_ISSYS", "Is a system process/thread" },
+#endif
+#if defined (PR_VFORKP)
+ /* Sol2.6: process is the parent of a vfork()d child
+ * Sol2.7: process is the parent of a vfork()d child
+ */
+ { PR_VFORKP, "PR_VFORKP", "Process is the parent of a vforked child" },
+#endif
+#ifdef PR_ORPHAN
+ /* Sol2.6: process's process group is orphaned
+ * Sol2.7: process's process group is orphaned
+ */
+ { PR_ORPHAN, "PR_ORPHAN", "Process's process group is orphaned" },
+#endif
+#if defined (PR_FORK)
+ /* Sol2.5: inherit-on-fork is in effect
+ * Sol2.6: inherit-on-fork is in effect
+ * Sol2.7: inherit-on-fork is in effect
+ * IRIX6: process has inherit-on-fork flag set
+ * OSF: task/thread has inherit-on-fork flag set
+ * UW: inherit-on-fork is in effect
+ */
+ { PR_FORK, "PR_FORK", "Inherit-on-fork is in effect" },
+#endif
+#if defined (PR_RLC)
+ /* Sol2.5: run-on-last-close is in effect
+ * Sol2.6: run-on-last-close is in effect
+ * Sol2.7: run-on-last-close is in effect
+ * IRIX6: process has run-on-last-close flag set
+ * OSF: task/thread has run-on-last-close flag set
+ * UW: Run-on-last-close is in effect
+ */
+ { PR_RLC, "PR_RLC", "Run-on-last-close is in effect" },
+#endif
+#if defined (PR_KLC)
+ /* Sol2.5: kill-on-last-close is in effect
+ * Sol2.6: kill-on-last-close is in effect
+ * Sol2.7: kill-on-last-close is in effect
+ * IRIX6: process has kill-on-last-close flag set
+ * OSF: kill-on-last-close, superceeds RLC
+ * UW: kill-on-last-close is in effect
+ */
+ { PR_KLC, "PR_KLC", "Kill-on-last-close is in effect" },
+#endif
+#if defined (PR_ASYNC)
+ /* Sol2.5: asynchronous-stop is in effect
+ * Sol2.6: asynchronous-stop is in effect
+ * Sol2.7: asynchronous-stop is in effect
+ * OSF: asynchronous stop mode is in effect
+ * UW: asynchronous stop mode is in effect
+ */
+ { PR_ASYNC, "PR_ASYNC", "Asynchronous stop is in effect" },
+#endif
+#if defined (PR_MSACCT)
+ /* Sol2.5: micro-state usage accounting is in effect
+ * Sol2.6: micro-state usage accounting is in effect
+ * Sol2.7: micro-state usage accounting is in effect
+ */
+ { PR_MSACCT, "PR_MSACCT", "Microstate accounting enabled" },
+#endif
+#if defined (PR_BPTADJ)
+ /* Sol2.5: breakpoint trap pc adjustment is in effect
+ * Sol2.6: breakpoint trap pc adjustment is in effect
+ * Sol2.7: breakpoint trap pc adjustment is in effect
+ */
+ { PR_BPTADJ, "PR_BPTADJ", "Breakpoint PC adjustment in effect" },
+#endif
+#if defined (PR_PTRACE)
+ /* Note: different meanings on Solaris and Irix 6
+ * Sol2.5: obsolete, never set in SunOS5.0
+ * Sol2.6: ptrace-compatibility mode is in effect
+ * Sol2.7: ptrace-compatibility mode is in effect
+ * IRIX6: process is traced with ptrace() too
+ * OSF: task/thread is being traced by ptrace
+ * UW: Process is being controlled by ptrace(2)
+ */
+ { PR_PTRACE, "PR_PTRACE", "Process is being controlled by ptrace" },
+#endif
+#if defined (PR_PCOMPAT)
+ /* Note: PCOMPAT on Sol2.5 means same thing as PTRACE on Sol2.6
+ * Sol2.5 (only): ptrace-compatibility mode is in effect
+ */
+ { PR_PCOMPAT, "PR_PCOMPAT", "Ptrace compatibility mode in effect" },
+#endif
+#ifdef PR_MSFORK
+ /* Sol2.6: micro-state accounting inherited on fork
+ * Sol2.7: micro-state accounting inherited on fork
+ */
+ { PR_MSFORK, "PR_PCOMPAT", "Micro-state accounting inherited on fork" },
+#endif
+
+#ifdef PR_ISKTHREAD
+ /* Irix6: process is a kernel thread */
+ { PR_ISKTHREAD, "PR_KTHREAD", "Process is a kernel thread" },
+#endif
+
+#ifdef PR_ABORT
+ /* OSF (only): abort the current stop condition */
+ { PR_ABORT, "PR_ABORT", "Abort the current stop condition" },
+#endif
+
+#ifdef PR_TRACING
+ /* OSF: task is traced */
+ { PR_TRACING, "PR_TRACING", "Task is traced" },
+#endif
+
+#ifdef PR_STOPFORK
+ /* OSF: stop child on fork */
+ { PR_STOPFORK, "PR_STOPFORK", "Stop child on fork" },
+#endif
+
+#ifdef PR_STOPEXEC
+ /* OSF: stop on exec */
+ { PR_STOPEXEC, "PR_STOPEXEC", "Stop on exec" },
+#endif
+
+#ifdef PR_STOPTERM
+ /* OSF: stop on task exit */
+ { PR_STOPTERM, "PR_STOPTERM", "Stop on task exit" },
+#endif
+
+#ifdef PR_STOPTCR
+ /* OSF: stop on thread creation */
+ { PR_STOPTCR, "PR_STOPTCR", "Stop on thread creation" },
+#endif
+
+#ifdef PR_STOPTTERM
+ /* OSF: stop on thread exit */
+ { PR_STOPTTERM, "PR_STOPTTERM", "Stop on thread exit" },
+#endif
+
+#ifdef PR_USCHED
+ /* OSF: user level scheduling is in effect */
+ { PR_USCHED, "PR_USCHED", "User level scheduling is in effect" },
+#endif
+};
+
+void
+proc_prettyfprint_flags (FILE *file, unsigned long flags, int verbose)
+{
+ int i;
+
+ for (i = 0; i < sizeof (pr_flag_table) / sizeof (pr_flag_table[0]); i++)
+ if (flags & pr_flag_table[i].value)
+ {
+ fprintf (file, "%s ", pr_flag_table[i].name);
+ if (verbose)
+ fprintf (file, "%s\n", pr_flag_table[i].desc);
+ }
+ if (!verbose)
+ fprintf (file, "\n");
+}
+
+void
+proc_prettyprint_flags (unsigned long flags, int verbose)
+{
+ proc_prettyfprint_flags (stdout, flags, verbose);
+}
diff --git a/contrib/gdb/gdb/proc-service.c b/contrib/gdb/gdb/proc-service.c
new file mode 100644
index 0000000..d7cd1aa
--- /dev/null
+++ b/contrib/gdb/gdb/proc-service.c
@@ -0,0 +1,312 @@
+/* <proc_service.h> implementation.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "gdb_proc_service.h"
+#include <sys/procfs.h>
+
+#include "inferior.h"
+#include "symtab.h"
+#include "target.h"
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+
+/* Fix-up some broken systems. */
+
+/* The prototypes in <proc_service.h> are slightly different on older
+ systems. Compensate for the discrepancies. */
+
+#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 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 size_t gdb_ps_size_t;
+#endif
+
+
+/* Building process ids. */
+
+#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
+
+
+/* Helper functions. */
+
+/* Transfer LEN bytes of memory between BUF and address ADDR in the
+ process specified by PH. If WRITE, transfer them to the process,
+ else transfer them from the process. Returns PS_OK for success,
+ PS_ERR on failure.
+
+ This is a helper function for ps_pdread, ps_pdwrite, ps_ptread and
+ ps_ptwrite. */
+
+static ps_err_e
+ps_xfer_memory (const struct ps_prochandle *ph, paddr_t addr,
+ char *buf, size_t len, int write)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+ int ret;
+
+ inferior_ptid = pid_to_ptid (ph->pid);
+
+ if (write)
+ ret = target_write_memory (addr, buf, len);
+ else
+ ret = target_read_memory (addr, buf, len);
+
+ do_cleanups (old_chain);
+
+ return (ret == 0 ? PS_OK : PS_ERR);
+}
+
+
+/* Stop the target process PH. */
+
+ps_err_e
+ps_pstop (gdb_ps_prochandle_t ph)
+{
+ /* The process is always stopped when under control of GDB. */
+ return PS_OK;
+}
+
+/* Resume the target process PH. */
+
+ps_err_e
+ps_pcontinue (gdb_ps_prochandle_t ph)
+{
+ /* Pretend we did successfully continue the process. GDB will take
+ care of it later on. */
+ return PS_OK;
+}
+
+/* Stop the lightweight process LWPID within the target process PH. */
+
+ps_err_e
+ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid)
+{
+ /* All lightweight processes are stopped when under control of GDB. */
+ return PS_OK;
+}
+
+/* Resume the lightweight process (LWP) LWPID within the target
+ process PH. */
+
+ps_err_e
+ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
+{
+ /* Pretend we did successfully continue LWPID. GDB will take care
+ of it later on. */
+ return PS_OK;
+}
+
+/* Get the size of the architecture-dependent extra state registers
+ for LWP LWPID within the target process PH and return it in
+ *XREGSIZE. */
+
+ps_err_e
+ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
+{
+ /* FIXME: Not supported yet. */
+ return PS_OK;
+}
+
+/* Get the extra state registers of LWP LWPID within the target
+ process PH and store them in XREGSET. */
+
+ps_err_e
+ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
+{
+ /* FIXME: Not supported yet. */
+ return PS_OK;
+}
+
+/* Set the extra state registers of LWP LWPID within the target
+ process PH from XREGSET. */
+
+ps_err_e
+ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
+{
+ /* FIXME: Not supported yet. */
+ return PS_OK;
+}
+
+/* Log (additional) diognostic information. */
+
+void
+ps_plog (const char *fmt, ...)
+{
+ va_list args;
+
+ va_start (args, fmt);
+ vfprintf_filtered (gdb_stderr, fmt, args);
+}
+
+/* Search for the symbol named NAME within the object named OBJ within
+ the target process PH. If the symbol is found the address of the
+ symbol is stored in SYM_ADDR. */
+
+ps_err_e
+ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
+ const char *name, paddr_t *sym_addr)
+{
+ struct minimal_symbol *ms;
+
+ /* FIXME: kettenis/2000-09-03: What should we do with OBJ? */
+ ms = lookup_minimal_symbol (name, NULL, NULL);
+ if (ms == NULL)
+ return PS_NOSYM;
+
+ *sym_addr = SYMBOL_VALUE_ADDRESS (ms);
+ return PS_OK;
+}
+
+/* Read SIZE bytes from the target process PH at address ADDR and copy
+ them into BUF. */
+
+ps_err_e
+ps_pdread (gdb_ps_prochandle_t ph, paddr_t addr,
+ gdb_ps_read_buf_t buf, gdb_ps_size_t size)
+{
+ return ps_xfer_memory (ph, addr, buf, size, 0);
+}
+
+/* Write SIZE bytes from BUF into the target process PH at address ADDR. */
+
+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 ps_xfer_memory (ph, addr, (char *) buf, size, 1);
+}
+
+/* Read SIZE bytes from the target process PH at address ADDR and copy
+ them into BUF. */
+
+ps_err_e
+ps_ptread (gdb_ps_prochandle_t ph, paddr_t addr,
+ gdb_ps_read_buf_t buf, gdb_ps_size_t size)
+{
+ return ps_xfer_memory (ph, addr, buf, size, 0);
+}
+
+/* Write SIZE bytes from BUF into the target process PH at address ADDR. */
+
+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 ps_xfer_memory (ph, addr, (char *) buf, size, 1);
+}
+
+/* Get the general registers of LWP LWPID within the target process PH
+ and store them in GREGSET. */
+
+ps_err_e
+ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+
+ target_fetch_registers (-1);
+ fill_gregset ((gdb_gregset_t *) gregset, -1);
+
+ do_cleanups (old_chain);
+ return PS_OK;
+}
+
+/* Set the general registers of LWP LWPID within the target process PH
+ from GREGSET. */
+
+ps_err_e
+ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+
+ /* FIXME: We should really make supply_gregset const-correct. */
+ supply_gregset ((gdb_gregset_t *) gregset);
+ target_store_registers (-1);
+
+ do_cleanups (old_chain);
+ return PS_OK;
+}
+
+/* Get the floating-point registers of LWP LWPID within the target
+ process PH and store them in FPREGSET. */
+
+ps_err_e
+ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ gdb_prfpregset_t *fpregset)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+
+ target_fetch_registers (-1);
+ fill_fpregset ((gdb_fpregset_t *) fpregset, -1);
+
+ do_cleanups (old_chain);
+ return PS_OK;
+}
+
+/* Set the floating-point registers of LWP LWPID within the target
+ process PH from FPREGSET. */
+
+ps_err_e
+ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ const gdb_prfpregset_t *fpregset)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+
+ /* FIXME: We should really make supply_fpregset const-correct. */
+ supply_fpregset ((gdb_fpregset_t *) fpregset);
+ target_store_registers (-1);
+
+ do_cleanups (old_chain);
+ return PS_OK;
+}
+
+/* Return overall process id of the target PH. Special for GNU/Linux
+ -- not used on Solaris. */
+
+pid_t
+ps_getpid (gdb_ps_prochandle_t ph)
+{
+ return ph->pid;
+}
+
+void
+_initialize_proc_service (void)
+{
+ /* This function solely exists to make sure this module is linked
+ into the final binary. */
+}
diff --git a/contrib/gdb/gdb/proc-utils.h b/contrib/gdb/gdb/proc-utils.h
new file mode 100644
index 0000000..1c41964
--- /dev/null
+++ b/contrib/gdb/gdb/proc-utils.h
@@ -0,0 +1,102 @@
+/* Machine independent support for SVR4 /proc (process file system) for GDB.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+/*
+ * Pretty-print functions for /proc data
+ */
+
+extern void
+proc_prettyprint_why (unsigned long why, unsigned long what, int verbose);
+
+extern void
+proc_prettyprint_syscalls (sysset_t *sysset, int verbose);
+
+extern void
+proc_prettyprint_syscall (int num, int verbose);
+
+extern void proc_prettyprint_flags (unsigned long flags, int verbose);
+
+extern void
+proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose);
+
+extern void
+proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose);
+
+extern void
+proc_prettyfprint_syscall (FILE *file, int num, int verbose);
+
+extern void
+proc_prettyfprint_signal (FILE *file, int signo, int verbose);
+
+extern void
+proc_prettyfprint_flags (FILE *file, unsigned long flags, int verbose);
+
+extern void
+proc_prettyfprint_why (FILE *file, unsigned long why,
+ unsigned long what, int verbose);
+
+extern void
+proc_prettyfprint_fault (FILE *file, int faultno, int verbose);
+
+extern void
+proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose);
+
+extern void
+proc_prettyfprint_status (long, int, int, int);
+
+/*
+ * Trace functions for /proc api.
+ */
+
+extern int write_with_trace (int, void *, size_t, char *, int);
+extern off_t lseek_with_trace (int, off_t, int, char *, int);
+extern int ioctl_with_trace (int, long, void *, char *, int);
+extern pid_t wait_with_trace (int *, char *, int);
+extern int open_with_trace (char *, int, char *, int);
+extern int close_with_trace (int, char *, int);
+extern void procfs_note (char *, char *, int);
+
+#ifdef PROCFS_TRACE
+/*
+ * Debugging code:
+ *
+ * These macros allow me to trace the system calls that we make
+ * to control the child process. This is quite handy for comparing
+ * with the older version of procfs.
+ */
+
+#define write(X,Y,Z) write_with_trace (X, Y, Z, __FILE__, __LINE__)
+#define lseek(X,Y,Z) lseek_with_trace (X, Y, Z, __FILE__, __LINE__)
+#define ioctl(X,Y,Z) ioctl_with_trace (X, Y, Z, __FILE__, __LINE__)
+#define open(X,Y) open_with_trace (X, Y, __FILE__, __LINE__)
+#define close(X) close_with_trace (X, __FILE__, __LINE__)
+#define wait(X) wait_with_trace (X, __FILE__, __LINE__)
+#endif
+#define PROCFS_NOTE(X) procfs_note (X, __FILE__, __LINE__)
+#define PROC_PRETTYFPRINT_STATUS(X,Y,Z,T) \
+ proc_prettyfprint_status (X, Y, Z, T)
+
+/* Define the type (and more importantly the width) of the control
+ word used to write to the /proc/PID/ctl file. */
+#if defined (PROC_CTL_WORD_TYPE)
+typedef PROC_CTL_WORD_TYPE procfs_ctl_t;
+#else
+typedef long procfs_ctl_t;
+#endif
diff --git a/contrib/gdb/gdb/proc-why.c b/contrib/gdb/gdb/proc-why.c
new file mode 100755
index 0000000..15af16c
--- /dev/null
+++ b/contrib/gdb/gdb/proc-why.c
@@ -0,0 +1,175 @@
+/* Machine independent support for SVR4 /proc (process file system) for GDB.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Written by Michael Snyder at Cygnus Solutions.
+ Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/*
+ * Pretty-print the pr_why value.
+ *
+ * Arguments: unsigned long flags, int verbose
+ *
+ */
+
+#include "defs.h"
+
+#if defined(NEW_PROC_API)
+#define _STRUCTURED_PROC 1
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+
+#include "proc-utils.h"
+
+/* 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 */
+};
+
+/* Translate values in the pr_why field of the prstatus struct. */
+
+static struct trans pr_why_table[] =
+{
+#if defined (PR_REQUESTED)
+ /* All platforms */
+ { PR_REQUESTED, "PR_REQUESTED",
+ "Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP" },
+#endif
+#if defined (PR_SIGNALLED)
+ /* All platforms */
+ { PR_SIGNALLED, "PR_SIGNALLED", "Receipt of a traced signal" },
+#endif
+#if defined (PR_SYSENTRY)
+ /* All platforms */
+ { PR_SYSENTRY, "PR_SYSENTRY", "Entry to a traced system call" },
+#endif
+#if defined (PR_SYSEXIT)
+ /* All platforms */
+ { PR_SYSEXIT, "PR_SYSEXIT", "Exit from a traced system call" },
+#endif
+#if defined (PR_JOBCONTROL)
+ /* All platforms */
+ { PR_JOBCONTROL, "PR_JOBCONTROL", "Default job control stop signal action" },
+#endif
+#if defined (PR_FAULTED)
+ /* All platforms */
+ { PR_FAULTED, "PR_FAULTED", "Incurred a traced hardware fault" },
+#endif
+#if defined (PR_SUSPENDED)
+ /* Solaris and UnixWare */
+ { PR_SUSPENDED, "PR_SUSPENDED", "Process suspended" },
+#endif
+#if defined (PR_CHECKPOINT)
+ /* Solaris only */
+ { PR_CHECKPOINT, "PR_CHECKPOINT", "Process stopped at checkpoint" },
+#endif
+#if defined (PR_FORKSTOP)
+ /* OSF only */
+ { PR_FORKSTOP, "PR_FORKSTOP", "Process stopped at end of fork call" },
+#endif
+#if defined (PR_TCRSTOP)
+ /* OSF only */
+ { PR_TCRSTOP, "PR_TCRSTOP", "Process stopped on thread creation" },
+#endif
+#if defined (PR_TTSTOP)
+ /* OSF only */
+ { PR_TTSTOP, "PR_TTSTOP", "Process stopped on thread termination" },
+#endif
+#if defined (PR_DEAD)
+ /* OSF only */
+ { PR_DEAD, "PR_DEAD", "Process stopped in exit system call" },
+#endif
+};
+
+void
+proc_prettyfprint_why (FILE *file, unsigned long why, unsigned long what,
+ int verbose)
+{
+ int i;
+
+ if (why == 0)
+ return;
+
+ for (i = 0; i < sizeof (pr_why_table) / sizeof (pr_why_table[0]); i++)
+ if (why == pr_why_table[i].value)
+ {
+ fprintf (file, "%s ", pr_why_table[i].name);
+ if (verbose)
+ fprintf (file, ": %s ", pr_why_table[i].desc);
+
+ switch (why) {
+#ifdef PR_REQUESTED
+ case PR_REQUESTED:
+ break; /* Nothing more to print. */
+#endif
+#ifdef PR_SIGNALLED
+ case PR_SIGNALLED:
+ proc_prettyfprint_signal (file, what, verbose);
+ break;
+#endif
+#ifdef PR_FAULTED
+ case PR_FAULTED:
+ proc_prettyfprint_fault (file, what, verbose);
+ break;
+#endif
+#ifdef PR_SYSENTRY
+ case PR_SYSENTRY:
+ fprintf (file, "Entry to ");
+ proc_prettyfprint_syscall (file, what, verbose);
+ break;
+#endif
+#ifdef PR_SYSEXIT
+ case PR_SYSEXIT:
+ fprintf (file, "Exit from ");
+ proc_prettyfprint_syscall (file, what, verbose);
+ break;
+#endif
+#ifdef PR_JOBCONTROL
+ case PR_JOBCONTROL:
+ proc_prettyfprint_signal (file, what, verbose);
+ break;
+#endif
+#ifdef PR_DEAD
+ case PR_DEAD:
+ fprintf (file, "Exit status: %d\n", what);
+ break;
+#endif
+ default:
+ fprintf (file, "Unknown why %ld, what %ld\n", why, what);
+ break;
+ }
+ fprintf (file, "\n");
+
+ return;
+ }
+ fprintf (file, "Unknown pr_why.\n");
+}
+
+void
+proc_prettyprint_why (unsigned long why, unsigned long what, int verbose)
+{
+ proc_prettyfprint_why (stdout, why, what, verbose);
+}
diff --git a/contrib/gdb/gdb/regcache.c b/contrib/gdb/gdb/regcache.c
new file mode 100644
index 0000000..2885904
--- /dev/null
+++ b/contrib/gdb/gdb/regcache.c
@@ -0,0 +1,817 @@
+/* Cache and manage the values of registers for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "target.h"
+#include "gdbarch.h"
+#include "gdbcmd.h"
+#include "regcache.h"
+#include "gdb_assert.h"
+
+/*
+ * DATA STRUCTURE
+ *
+ * Here is the actual register cache.
+ */
+
+/* NOTE: this is a write-through cache. There is no "dirty" bit for
+ recording if the register values have been changed (eg. by the
+ user). Therefore all registers must be written back to the
+ target when appropriate. */
+
+/* REGISTERS contains the cached register values (in target byte order). */
+
+char *registers;
+
+/* REGISTER_VALID is 0 if the register needs to be fetched,
+ 1 if it has been fetched, and
+ -1 if the register value was not available.
+ "Not available" means don't try to fetch it again. */
+
+signed char *register_valid;
+
+/* The thread/process associated with the current set of registers. */
+
+static ptid_t registers_ptid;
+
+/*
+ * FUNCTIONS:
+ */
+
+/* REGISTER_CACHED()
+
+ Returns 0 if the value is not in the cache (needs fetch).
+ >0 if the value is in the cache.
+ <0 if the value is permanently unavailable (don't ask again). */
+
+int
+register_cached (int regnum)
+{
+ return register_valid[regnum];
+}
+
+/* Record that REGNUM's value is cached if STATE is >0, uncached but
+ fetchable if STATE is 0, and uncached and unfetchable if STATE is <0. */
+
+void
+set_register_cached (int regnum, int state)
+{
+ register_valid[regnum] = state;
+}
+
+/* REGISTER_CHANGED
+
+ invalidate a single register REGNUM in the cache */
+void
+register_changed (int regnum)
+{
+ set_register_cached (regnum, 0);
+}
+
+/* If REGNUM >= 0, return a pointer to register REGNUM's cache buffer area,
+ else return a pointer to the start of the cache buffer. */
+
+static char *
+register_buffer (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
+ return &registers[REGISTER_BYTE (regnum)];
+}
+
+/* Return whether register REGNUM is a real register. */
+
+static int
+real_register (int regnum)
+{
+ return regnum >= 0 && regnum < NUM_REGS;
+}
+
+/* Return whether register REGNUM is a pseudo register. */
+
+static int
+pseudo_register (int regnum)
+{
+ return regnum >= NUM_REGS && regnum < NUM_REGS + NUM_PSEUDO_REGS;
+}
+
+/* Fetch register REGNUM into the cache. */
+
+static void
+fetch_register (int regnum)
+{
+ /* NOTE: cagney/2001-12-04: Legacy targets were using fetch/store
+ pseudo-register as a way of handling registers that needed to be
+ constructed from one or more raw registers. New targets instead
+ use gdbarch register read/write. */
+ if (FETCH_PSEUDO_REGISTER_P ()
+ && pseudo_register (regnum))
+ FETCH_PSEUDO_REGISTER (regnum);
+ else
+ target_fetch_registers (regnum);
+}
+
+/* Write register REGNUM cached value to the target. */
+
+static void
+store_register (int regnum)
+{
+ /* NOTE: cagney/2001-12-04: Legacy targets were using fetch/store
+ pseudo-register as a way of handling registers that needed to be
+ constructed from one or more raw registers. New targets instead
+ use gdbarch register read/write. */
+ if (STORE_PSEUDO_REGISTER_P ()
+ && pseudo_register (regnum))
+ STORE_PSEUDO_REGISTER (regnum);
+ else
+ target_store_registers (regnum);
+}
+
+/* Low level examining and depositing of registers.
+
+ The caller is responsible for making sure that the inferior is
+ stopped before calling the fetching routines, or it will get
+ garbage. (a change from GDB version 3, in which the caller got the
+ value from the last stop). */
+
+/* REGISTERS_CHANGED ()
+
+ Indicate that registers may have changed, so invalidate the cache. */
+
+void
+registers_changed (void)
+{
+ int i;
+
+ registers_ptid = pid_to_ptid (-1);
+
+ /* Force cleanup of any alloca areas if using C alloca instead of
+ a builtin alloca. This particular call is used to clean up
+ areas allocated by low level target code which may build up
+ during lengthy interactions between gdb and the target before
+ gdb gives control to the user (ie watchpoints). */
+ alloca (0);
+
+ for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
+ set_register_cached (i, 0);
+
+ if (registers_changed_hook)
+ registers_changed_hook ();
+}
+
+/* REGISTERS_FETCHED ()
+
+ Indicate that all registers have been fetched, so mark them all valid. */
+
+/* NOTE: cagney/2001-12-04: This function does not set valid on the
+ pseudo-register range since pseudo registers are always supplied
+ using supply_register(). */
+/* FIXME: cagney/2001-12-04: This function is DEPRECATED. The target
+ code was blatting the registers[] array and then calling this.
+ Since targets should only be using supply_register() the need for
+ this function/hack is eliminated. */
+
+void
+registers_fetched (void)
+{
+ int i;
+
+ for (i = 0; i < NUM_REGS; i++)
+ set_register_cached (i, 1);
+ /* Do not assume that the pseudo-regs have also been fetched.
+ Fetching all real regs NEVER accounts for pseudo-regs. */
+}
+
+/* read_register_bytes and write_register_bytes are generally a *BAD*
+ idea. 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 and write_register_gen
+ if you want to get at the raw register contents, as it only takes a
+ regnum as an argument, and therefore can't do a partial register
+ update.
+
+ Prior to the recent fixes to check for partial updates, both read
+ and write_register_bytes always checked to see if any registers
+ were stale, and then called target_fetch_registers (-1) to update
+ the whole set. This caused really slowed things down for remote
+ targets. */
+
+/* Copy INLEN bytes of consecutive data from registers
+ starting with the INREGBYTE'th byte of register data
+ into memory at MYADDR. */
+
+void
+read_register_bytes (int in_start, char *in_buf, int in_len)
+{
+ int in_end = in_start + in_len;
+ int regnum;
+ char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ /* See if we are trying to read bytes from out-of-date registers. If so,
+ update just those registers. */
+
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ int reg_start;
+ int reg_end;
+ int reg_len;
+ int start;
+ int end;
+ int byte;
+
+ reg_start = REGISTER_BYTE (regnum);
+ reg_len = REGISTER_RAW_SIZE (regnum);
+ reg_end = reg_start + reg_len;
+
+ if (reg_end <= in_start || in_end <= reg_start)
+ /* The range the user wants to read doesn't overlap with regnum. */
+ continue;
+
+ if (REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\0')
+ /* Force the cache to fetch the entire register. */
+ read_register_gen (regnum, reg_buf);
+ else
+ /* Legacy note: even though this register is ``invalid'' we
+ still need to return something. It would appear that some
+ code relies on apparent gaps in the register array also
+ being returned. */
+ /* FIXME: cagney/2001-08-18: This is just silly. It defeats
+ the entire register read/write flow of control. Must
+ resist temptation to return 0xdeadbeef. */
+ memcpy (reg_buf, registers + reg_start, reg_len);
+
+ /* Legacy note: This function, for some reason, allows a NULL
+ input buffer. If the buffer is NULL, the registers are still
+ fetched, just the final transfer is skipped. */
+ if (in_buf == NULL)
+ continue;
+
+ /* start = max (reg_start, in_start) */
+ if (reg_start > in_start)
+ start = reg_start;
+ else
+ start = in_start;
+
+ /* end = min (reg_end, in_end) */
+ if (reg_end < in_end)
+ end = reg_end;
+ else
+ end = in_end;
+
+ /* Transfer just the bytes common to both IN_BUF and REG_BUF */
+ for (byte = start; byte < end; byte++)
+ {
+ in_buf[byte - in_start] = reg_buf[byte - reg_start];
+ }
+ }
+}
+
+/* Read register REGNUM into memory at MYADDR, which must be large
+ enough for REGISTER_RAW_BYTES (REGNUM). Target byte-order. If the
+ register is known to be the size of a CORE_ADDR or smaller,
+ read_register can be used instead. */
+
+static void
+legacy_read_register_gen (int regnum, char *myaddr)
+{
+ gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
+ if (! ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+
+ if (!register_cached (regnum))
+ fetch_register (regnum);
+
+ memcpy (myaddr, register_buffer (regnum),
+ REGISTER_RAW_SIZE (regnum));
+}
+
+void
+regcache_read (int rawnum, char *buf)
+{
+ gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
+ /* For moment, just use underlying legacy code. Ulgh!!! */
+ legacy_read_register_gen (rawnum, buf);
+}
+
+void
+read_register_gen (int regnum, char *buf)
+{
+ if (! gdbarch_register_read_p (current_gdbarch))
+ {
+ legacy_read_register_gen (regnum, buf);
+ return;
+ }
+ gdbarch_register_read (current_gdbarch, regnum, buf);
+}
+
+
+/* Write register REGNUM at MYADDR to the target. MYADDR points at
+ REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */
+
+static void
+legacy_write_register_gen (int regnum, char *myaddr)
+{
+ int size;
+ gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
+
+ /* On the sparc, writing %g0 is a no-op, so we don't even want to
+ change the registers array if something writes to this register. */
+ if (CANNOT_STORE_REGISTER (regnum))
+ return;
+
+ if (! ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+
+ size = REGISTER_RAW_SIZE (regnum);
+
+ if (real_register (regnum))
+ {
+ /* If we have a valid copy of the register, and new value == old
+ value, then don't bother doing the actual store. */
+ if (register_cached (regnum)
+ && memcmp (register_buffer (regnum), myaddr, size) == 0)
+ return;
+ else
+ target_prepare_to_store ();
+ }
+
+ memcpy (register_buffer (regnum), myaddr, size);
+
+ set_register_cached (regnum, 1);
+ store_register (regnum);
+}
+
+void
+regcache_write (int rawnum, char *buf)
+{
+ gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
+ /* For moment, just use underlying legacy code. Ulgh!!! */
+ legacy_write_register_gen (rawnum, buf);
+}
+
+void
+write_register_gen (int regnum, char *buf)
+{
+ if (! gdbarch_register_write_p (current_gdbarch))
+ {
+ legacy_write_register_gen (regnum, buf);
+ return;
+ }
+ gdbarch_register_write (current_gdbarch, regnum, buf);
+}
+
+/* Copy INLEN bytes of consecutive data from memory at MYADDR
+ into registers starting with the MYREGSTART'th byte of register data. */
+
+void
+write_register_bytes (int myregstart, char *myaddr, int inlen)
+{
+ int myregend = myregstart + inlen;
+ int regnum;
+
+ target_prepare_to_store ();
+
+ /* Scan through the registers updating any that are covered by the
+ range myregstart<=>myregend using write_register_gen, which does
+ nice things like handling threads, and avoiding updates when the
+ new and old contents are the same. */
+
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ int regstart, regend;
+
+ regstart = REGISTER_BYTE (regnum);
+ regend = regstart + REGISTER_RAW_SIZE (regnum);
+
+ /* Is this register completely outside the range the user is writing? */
+ if (myregend <= regstart || regend <= myregstart)
+ /* do nothing */ ;
+
+ /* Is this register completely within the range the user is writing? */
+ else if (myregstart <= regstart && regend <= myregend)
+ write_register_gen (regnum, myaddr + (regstart - myregstart));
+
+ /* The register partially overlaps the range being written. */
+ else
+ {
+ char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ /* What's the overlap between this register's bytes and
+ those the caller wants to write? */
+ int overlapstart = max (regstart, myregstart);
+ int overlapend = min (regend, myregend);
+
+ /* We may be doing a partial update of an invalid register.
+ Update it from the target before scribbling on it. */
+ read_register_gen (regnum, regbuf);
+
+ memcpy (registers + overlapstart,
+ myaddr + (overlapstart - myregstart),
+ overlapend - overlapstart);
+
+ store_register (regnum);
+ }
+ }
+}
+
+
+/* Return the contents of register REGNUM as an unsigned integer. */
+
+ULONGEST
+read_register (int regnum)
+{
+ char *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ read_register_gen (regnum, buf);
+ return (extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum)));
+}
+
+ULONGEST
+read_register_pid (int regnum, ptid_t ptid)
+{
+ ptid_t save_ptid;
+ int save_pid;
+ CORE_ADDR retval;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ return read_register (regnum);
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ retval = read_register (regnum);
+
+ inferior_ptid = save_ptid;
+
+ return retval;
+}
+
+/* Return the contents of register REGNUM as a signed integer. */
+
+LONGEST
+read_signed_register (int regnum)
+{
+ void *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ read_register_gen (regnum, buf);
+ return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
+}
+
+LONGEST
+read_signed_register_pid (int regnum, ptid_t ptid)
+{
+ ptid_t save_ptid;
+ LONGEST retval;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ return read_signed_register (regnum);
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ retval = read_signed_register (regnum);
+
+ inferior_ptid = save_ptid;
+
+ return retval;
+}
+
+/* Store VALUE into the raw contents of register number REGNUM. */
+
+void
+write_register (int regnum, LONGEST val)
+{
+ void *buf;
+ int size;
+ size = REGISTER_RAW_SIZE (regnum);
+ buf = alloca (size);
+ store_signed_integer (buf, size, (LONGEST) val);
+ write_register_gen (regnum, buf);
+}
+
+void
+write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid)
+{
+ ptid_t save_ptid;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ {
+ write_register (regnum, val);
+ return;
+ }
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ write_register (regnum, val);
+
+ inferior_ptid = save_ptid;
+}
+
+/* SUPPLY_REGISTER()
+
+ Record that register REGNUM contains VAL. This is used when the
+ value is obtained from the inferior or core dump, so there is no
+ need to store the value there.
+
+ If VAL is a NULL pointer, then it's probably an unsupported register.
+ We just set its 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 (int regnum, char *val)
+{
+#if 1
+ if (! ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+#endif
+
+ set_register_cached (regnum, 1);
+ if (val)
+ memcpy (register_buffer (regnum), val,
+ REGISTER_RAW_SIZE (regnum));
+ else
+ memset (register_buffer (regnum), '\000',
+ REGISTER_RAW_SIZE (regnum));
+
+ /* 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. */
+
+ /* NOTE: cagney/2001-03-16: The macro CLEAN_UP_REGISTER_VALUE is
+ going to be deprecated. Instead architectures will leave the raw
+ register value as is and instead clean things up as they pass
+ through the method gdbarch_register_read() clean up the
+ values. */
+
+#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
+ DEPRECATED_CLEAN_UP_REGISTER_VALUE (regnum, register_buffer (regnum));
+#endif
+}
+
+void
+regcache_collect (int regnum, void *buf)
+{
+ memcpy (buf, register_buffer (regnum), REGISTER_RAW_SIZE (regnum));
+}
+
+
+/* read_pc, write_pc, read_sp, write_sp, read_fp, write_fp, etc.
+ Special handling for registers PC, SP, and FP. */
+
+/* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(),
+ read_pc_pid(), read_pc(), generic_target_write_pc(),
+ write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(),
+ generic_target_write_sp(), write_sp(), generic_target_read_fp(),
+ read_fp(), generic_target_write_fp(), write_fp will eventually be
+ moved out of the reg-cache into either frame.[hc] or to the
+ multi-arch framework. The are not part of the raw register cache. */
+
+/* This routine is getting awfully cluttered with #if's. It's probably
+ time to turn this into READ_PC and define it in the tm.h file.
+ Ditto for write_pc.
+
+ 1999-06-08: The following were re-written so that it assumes the
+ existence of a TARGET_READ_PC et.al. macro. A default generic
+ version of that macro is made available where needed.
+
+ Since the ``TARGET_READ_PC'' et.al. macro is going to be controlled
+ by the multi-arch framework, it will eventually be possible to
+ eliminate the intermediate read_pc_pid(). The client would call
+ TARGET_READ_PC directly. (cagney). */
+
+CORE_ADDR
+generic_target_read_pc (ptid_t ptid)
+{
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ {
+ CORE_ADDR pc_val = ADDR_BITS_REMOVE ((CORE_ADDR) read_register_pid (PC_REGNUM, ptid));
+ return pc_val;
+ }
+#endif
+ internal_error (__FILE__, __LINE__,
+ "generic_target_read_pc");
+ return 0;
+}
+
+CORE_ADDR
+read_pc_pid (ptid_t ptid)
+{
+ ptid_t saved_inferior_ptid;
+ CORE_ADDR pc_val;
+
+ /* In case ptid != inferior_ptid. */
+ saved_inferior_ptid = inferior_ptid;
+ inferior_ptid = ptid;
+
+ pc_val = TARGET_READ_PC (ptid);
+
+ inferior_ptid = saved_inferior_ptid;
+ return pc_val;
+}
+
+CORE_ADDR
+read_pc (void)
+{
+ return read_pc_pid (inferior_ptid);
+}
+
+void
+generic_target_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ write_register_pid (PC_REGNUM, pc, ptid);
+ if (NPC_REGNUM >= 0)
+ write_register_pid (NPC_REGNUM, pc + 4, ptid);
+ if (NNPC_REGNUM >= 0)
+ write_register_pid (NNPC_REGNUM, pc + 8, ptid);
+#else
+ internal_error (__FILE__, __LINE__,
+ "generic_target_write_pc");
+#endif
+}
+
+void
+write_pc_pid (CORE_ADDR pc, ptid_t ptid)
+{
+ ptid_t saved_inferior_ptid;
+
+ /* In case ptid != inferior_ptid. */
+ saved_inferior_ptid = inferior_ptid;
+ inferior_ptid = ptid;
+
+ TARGET_WRITE_PC (pc, ptid);
+
+ inferior_ptid = saved_inferior_ptid;
+}
+
+void
+write_pc (CORE_ADDR pc)
+{
+ write_pc_pid (pc, inferior_ptid);
+}
+
+/* Cope with strage ways of getting to the stack and frame pointers */
+
+CORE_ADDR
+generic_target_read_sp (void)
+{
+#ifdef SP_REGNUM
+ if (SP_REGNUM >= 0)
+ return read_register (SP_REGNUM);
+#endif
+ internal_error (__FILE__, __LINE__,
+ "generic_target_read_sp");
+}
+
+CORE_ADDR
+read_sp (void)
+{
+ return TARGET_READ_SP ();
+}
+
+void
+generic_target_write_sp (CORE_ADDR val)
+{
+#ifdef SP_REGNUM
+ if (SP_REGNUM >= 0)
+ {
+ write_register (SP_REGNUM, val);
+ return;
+ }
+#endif
+ internal_error (__FILE__, __LINE__,
+ "generic_target_write_sp");
+}
+
+void
+write_sp (CORE_ADDR val)
+{
+ TARGET_WRITE_SP (val);
+}
+
+CORE_ADDR
+generic_target_read_fp (void)
+{
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ return read_register (FP_REGNUM);
+#endif
+ internal_error (__FILE__, __LINE__,
+ "generic_target_read_fp");
+}
+
+CORE_ADDR
+read_fp (void)
+{
+ return TARGET_READ_FP ();
+}
+
+void
+generic_target_write_fp (CORE_ADDR val)
+{
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ {
+ write_register (FP_REGNUM, val);
+ return;
+ }
+#endif
+ internal_error (__FILE__, __LINE__,
+ "generic_target_write_fp");
+}
+
+void
+write_fp (CORE_ADDR val)
+{
+ TARGET_WRITE_FP (val);
+}
+
+/* ARGSUSED */
+static void
+reg_flush_command (char *command, int from_tty)
+{
+ /* Force-flush the register cache. */
+ registers_changed ();
+ if (from_tty)
+ printf_filtered ("Register cache flushed.\n");
+}
+
+static void
+build_regcache (void)
+{
+ int i;
+ int sizeof_register_valid;
+ /* Come up with the real size of the registers buffer. */
+ int sizeof_registers = REGISTER_BYTES; /* OK use. */
+ for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
+ {
+ long regend;
+ /* Keep extending the buffer so that there is always enough
+ space for all registers. The comparison is necessary since
+ legacy code is free to put registers in random places in the
+ buffer separated by holes. Once REGISTER_BYTE() is killed
+ this can be greatly simplified. */
+ /* FIXME: cagney/2001-12-04: This code shouldn't need to use
+ REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
+ buffer out so that certain registers just happen to overlap.
+ Ulgh! New targets use gdbarch's register read/write and
+ entirely avoid this uglyness. */
+ regend = REGISTER_BYTE (i) + REGISTER_RAW_SIZE (i);
+ if (sizeof_registers < regend)
+ sizeof_registers = regend;
+ }
+ registers = xmalloc (sizeof_registers);
+ sizeof_register_valid = ((NUM_REGS + NUM_PSEUDO_REGS)
+ * sizeof (*register_valid));
+ register_valid = xmalloc (sizeof_register_valid);
+ memset (register_valid, 0, sizeof_register_valid);
+}
+
+void
+_initialize_regcache (void)
+{
+ build_regcache ();
+
+ register_gdbarch_swap (&registers, sizeof (registers), NULL);
+ register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
+ register_gdbarch_swap (NULL, 0, build_regcache);
+
+ add_com ("flushregs", class_maintenance, reg_flush_command,
+ "Force gdb to flush its register cache (maintainer command)");
+
+ /* Initialize the thread/process associated with the current set of
+ registers. For now, -1 is special, and means `no current process'. */
+ registers_ptid = pid_to_ptid (-1);
+}
diff --git a/contrib/gdb/gdb/regcache.h b/contrib/gdb/gdb/regcache.h
new file mode 100644
index 0000000..4e854d3
--- /dev/null
+++ b/contrib/gdb/gdb/regcache.h
@@ -0,0 +1,82 @@
+/* Cache and manage the values of registers for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 REGCACHE_H
+#define REGCACHE_H
+
+/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
+ regcache. */
+
+void regcache_read (int rawnum, char *buf);
+void regcache_write (int rawnum, char *buf);
+
+/* Transfer a raw register [0..NUM_REGS) between the regcache and the
+ target. These functions are called by the target in response to a
+ target_fetch_registers() or target_store_registers(). */
+
+extern void supply_register (int regnum, char *val);
+extern void regcache_collect (int regnum, void *buf);
+
+
+/* DEPRECATED: Character array containing an image of the inferior
+ programs' registers for the most recently referenced thread. */
+
+extern char *registers;
+
+/* DEPRECATED: Character array containing the current state of each
+ register (unavailable<0, invalid=0, valid>0) for the most recently
+ referenced thread. */
+
+extern signed char *register_valid;
+
+extern int register_cached (int regnum);
+
+extern void set_register_cached (int regnum, int state);
+
+extern void register_changed (int regnum);
+
+extern void registers_changed (void);
+
+extern void registers_fetched (void);
+
+extern void read_register_bytes (int regbyte, char *myaddr, int len);
+
+extern void read_register_gen (int regnum, char *myaddr);
+
+extern void write_register_gen (int regnum, char *myaddr);
+
+extern void write_register_bytes (int regbyte, char *myaddr, int len);
+
+/* Rename to read_unsigned_register()? */
+extern ULONGEST read_register (int regnum);
+
+/* Rename to read_unsigned_register_pid()? */
+extern ULONGEST read_register_pid (int regnum, ptid_t ptid);
+
+extern LONGEST read_signed_register (int regnum);
+
+extern LONGEST read_signed_register_pid (int regnum, ptid_t ptid);
+
+extern void write_register (int regnum, LONGEST val);
+
+extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid);
+
+#endif /* REGCACHE_H */
diff --git a/contrib/gdb/gdb/regformats/reg-arm.dat b/contrib/gdb/gdb/regformats/reg-arm.dat
new file mode 100644
index 0000000..5a60025
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-arm.dat
@@ -0,0 +1,28 @@
+name:arm
+expedite:r11,sp,pc
+32:r0
+32:r1
+32:r2
+32:r3
+32:r4
+32:r5
+32:r6
+32:r7
+32:r8
+32:r9
+32:r10
+32:r11
+32:r12
+32:sp
+32:lr
+32:pc
+96:f0
+96:f1
+96:f2
+96:f3
+96:f4
+96:f5
+96:f6
+96:f7
+32:fps
+32:cpsr
diff --git a/contrib/gdb/gdb/regformats/reg-i386-linux.dat b/contrib/gdb/gdb/regformats/reg-i386-linux.dat
new file mode 100644
index 0000000..91baa8f
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-i386-linux.dat
@@ -0,0 +1,44 @@
+name:i386_linux
+expedite:ebp,esp,eip
+32:eax
+32:ecx
+32:edx
+32:ebx
+32:esp
+32:ebp
+32:esi
+32:edi
+32:eip
+32:eflags
+32:cs
+32:ss
+32:ds
+32:es
+32:fs
+32:gs
+80:st0
+80:st1
+80:st2
+80:st3
+80:st4
+80:st5
+80:st6
+80:st7
+32:fctrl
+32:fstat
+32:ftag
+32:fiseg
+32:fioff
+32:foseg
+32:fooff
+32:fop
+128:xmm0
+128:xmm1
+128:xmm2
+128:xmm3
+128:xmm4
+128:xmm5
+128:xmm6
+128:xmm7
+32:mxcsr
+32:orig_eax
diff --git a/contrib/gdb/gdb/regformats/reg-i386.dat b/contrib/gdb/gdb/regformats/reg-i386.dat
new file mode 100644
index 0000000..69c2d90
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-i386.dat
@@ -0,0 +1,43 @@
+name:i386
+expedite:ebp,esp,eip
+32:eax
+32:ecx
+32:edx
+32:ebx
+32:esp
+32:ebp
+32:esi
+32:edi
+32:eip
+32:eflags
+32:cs
+32:ss
+32:ds
+32:es
+32:fs
+32:gs
+80:st0
+80:st1
+80:st2
+80:st3
+80:st4
+80:st5
+80:st6
+80:st7
+32:fctrl
+32:fstat
+32:ftag
+32:fiseg
+32:fioff
+32:foseg
+32:fooff
+32:fop
+128:xmm0
+128:xmm1
+128:xmm2
+128:xmm3
+128:xmm4
+128:xmm5
+128:xmm6
+128:xmm7
+32:mxcsr
diff --git a/contrib/gdb/gdb/regformats/reg-ia64.dat b/contrib/gdb/gdb/regformats/reg-ia64.dat
new file mode 100644
index 0000000..125902d
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-ia64.dat
@@ -0,0 +1,603 @@
+name:ia64
+expedite:ip,psr,r12,bsp,cfm
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:r32
+64:r33
+64:r34
+64:r35
+64:r36
+64:r37
+64:r38
+64:r39
+64:r40
+64:r41
+64:r42
+64:r43
+64:r44
+64:r45
+64:r46
+64:r47
+64:r48
+64:r49
+64:r50
+64:r51
+64:r52
+64:r53
+64:r54
+64:r55
+64:r56
+64:r57
+64:r58
+64:r59
+64:r60
+64:r61
+64:r62
+64:r63
+64:r64
+64:r65
+64:r66
+64:r67
+64:r68
+64:r69
+64:r70
+64:r71
+64:r72
+64:r73
+64:r74
+64:r75
+64:r76
+64:r77
+64:r78
+64:r79
+64:r80
+64:r81
+64:r82
+64:r83
+64:r84
+64:r85
+64:r86
+64:r87
+64:r88
+64:r89
+64:r90
+64:r91
+64:r92
+64:r93
+64:r94
+64:r95
+64:r96
+64:r97
+64:r98
+64:r99
+64:r100
+64:r101
+64:r102
+64:r103
+64:r104
+64:r105
+64:r106
+64:r107
+64:r108
+64:r109
+64:r110
+64:r111
+64:r112
+64:r113
+64:r114
+64:r115
+64:r116
+64:r117
+64:r118
+64:r119
+64:r120
+64:r121
+64:r122
+64:r123
+64:r124
+64:r125
+64:r126
+64:r127
+
+128:f0
+128:f1
+128:f2
+128:f3
+128:f4
+128:f5
+128:f6
+128:f7
+128:f8
+128:f9
+128:f10
+128:f11
+128:f12
+128:f13
+128:f14
+128:f15
+128:f16
+128:f17
+128:f18
+128:f19
+128:f20
+128:f21
+128:f22
+128:f23
+128:f24
+128:f25
+128:f26
+128:f27
+128:f28
+128:f29
+128:f30
+128:f31
+128:f32
+128:f33
+128:f34
+128:f35
+128:f36
+128:f37
+128:f38
+128:f39
+128:f40
+128:f41
+128:f42
+128:f43
+128:f44
+128:f45
+128:f46
+128:f47
+128:f48
+128:f49
+128:f50
+128:f51
+128:f52
+128:f53
+128:f54
+128:f55
+128:f56
+128:f57
+128:f58
+128:f59
+128:f60
+128:f61
+128:f62
+128:f63
+128:f64
+128:f65
+128:f66
+128:f67
+128:f68
+128:f69
+128:f70
+128:f71
+128:f72
+128:f73
+128:f74
+128:f75
+128:f76
+128:f77
+128:f78
+128:f79
+128:f80
+128:f81
+128:f82
+128:f83
+128:f84
+128:f85
+128:f86
+128:f87
+128:f88
+128:f89
+128:f90
+128:f91
+128:f92
+128:f93
+128:f94
+128:f95
+128:f96
+128:f97
+128:f98
+128:f99
+128:f100
+128:f101
+128:f102
+128:f103
+128:f104
+128:f105
+128:f106
+128:f107
+128:f108
+128:f109
+128:f110
+128:f111
+128:f112
+128:f113
+128:f114
+128:f115
+128:f116
+128:f117
+128:f118
+128:f119
+128:f120
+128:f121
+128:f122
+128:f123
+128:f124
+128:f125
+128:f126
+128:f127
+
+64:p0
+64:p1
+64:p2
+64:p3
+64:p4
+64:p5
+64:p6
+64:p7
+64:p8
+64:p9
+64:p10
+64:p11
+64:p12
+64:p13
+64:p14
+64:p15
+64:p16
+64:p17
+64:p18
+64:p19
+64:p20
+64:p21
+64:p22
+64:p23
+64:p24
+64:p25
+64:p26
+64:p27
+64:p28
+64:p29
+64:p30
+64:p31
+64:p32
+64:p33
+64:p34
+64:p35
+64:p36
+64:p37
+64:p38
+64:p39
+64:p40
+64:p41
+64:p42
+64:p43
+64:p44
+64:p45
+64:p46
+64:p47
+64:p48
+64:p49
+64:p50
+64:p51
+64:p52
+64:p53
+64:p54
+64:p55
+64:p56
+64:p57
+64:p58
+64:p59
+64:p60
+64:p61
+64:p62
+64:p63
+
+64:b0
+64:b1
+64:b2
+64:b3
+64:b4
+64:b5
+64:b6
+64:b7
+
+64:vfp
+64:vrap
+
+64:pr
+64:ip
+64:psr
+64:cfm
+
+64:kr0
+64:kr1
+64:kr2
+64:kr3
+64:kr4
+64:kr5
+64:kr6
+64:kr7
+
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+
+64:rsc
+64:bsp
+64:bspstore
+64:rnat
+
+64:
+64:fcr
+64:
+64:
+
+64:eflag
+64:csd
+64:ssd
+64:cflg
+64:fsr
+64:fir
+64:fdr
+64:
+64:ccv
+64:
+64:
+64:
+64:unat
+64:
+64:
+64:
+64:fpsr
+64:
+64:
+64:
+64:itc
+
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:pfs
+64:lc
+64:ec
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:
+64:nat0
+64:nat1
+64:nat2
+64:nat3
+64:nat4
+64:nat5
+64:nat6
+64:nat7
+64:nat8
+64:nat9
+64:nat10
+64:nat11
+64:nat12
+64:nat13
+64:nat14
+64:nat15
+64:nat16
+64:nat17
+64:nat18
+64:nat19
+64:nat20
+64:nat21
+64:nat22
+64:nat23
+64:nat24
+64:nat25
+64:nat26
+64:nat27
+64:nat28
+64:nat29
+64:nat30
+64:nat31
+64:nat32
+64:nat33
+64:nat34
+64:nat35
+64:nat36
+64:nat37
+64:nat38
+64:nat39
+64:nat40
+64:nat41
+64:nat42
+64:nat43
+64:nat44
+64:nat45
+64:nat46
+64:nat47
+64:nat48
+64:nat49
+64:nat50
+64:nat51
+64:nat52
+64:nat53
+64:nat54
+64:nat55
+64:nat56
+64:nat57
+64:nat58
+64:nat59
+64:nat60
+64:nat61
+64:nat62
+64:nat63
+64:nat64
+64:nat65
+64:nat66
+64:nat67
+64:nat68
+64:nat69
+64:nat70
+64:nat71
+64:nat72
+64:nat73
+64:nat74
+64:nat75
+64:nat76
+64:nat77
+64:nat78
+64:nat79
+64:nat80
+64:nat81
+64:nat82
+64:nat83
+64:nat84
+64:nat85
+64:nat86
+64:nat87
+64:nat88
+64:nat89
+64:nat90
+64:nat91
+64:nat92
+64:nat93
+64:nat94
+64:nat95
+64:nat96
+64:nat97
+64:nat98
+64:nat99
+64:nat100
+64:nat101
+64:nat102
+64:nat103
+64:nat104
+64:nat105
+64:nat106
+64:nat107
+64:nat108
+64:nat109
+64:nat110
+64:nat111
+64:nat112
+64:nat113
+64:nat114
+64:nat115
+64:nat116
+64:nat117
+64:nat118
+64:nat119
+64:nat120
+64:nat121
+64:nat122
+64:nat123
+64:nat124
+64:nat125
+64:nat126
+64:nat127
diff --git a/contrib/gdb/gdb/regformats/reg-ppc.dat b/contrib/gdb/gdb/regformats/reg-ppc.dat
new file mode 100644
index 0000000..d915996
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-ppc.dat
@@ -0,0 +1,76 @@
+name:ppc
+expedite:r1,pc
+32:r0
+32:r1
+32:r2
+32:r3
+32:r4
+32:r5
+32:r6
+32:r7
+32:r8
+32:r9
+32:r10
+32:r11
+32:r12
+32:r13
+32:r14
+32:r15
+32:r16
+32:r17
+32:r18
+32:r19
+32:r20
+32:r21
+32:r22
+32:r23
+32:r24
+32:r25
+32:r26
+32:r27
+32:r28
+32:r29
+32:r30
+32:r31
+
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+
+32:pc
+32:ps
+
+32:cr
+32:lr
+32:ctr
+32:xer
+0:
diff --git a/contrib/gdb/gdb/regformats/reg-x86-64.dat b/contrib/gdb/gdb/regformats/reg-x86-64.dat
new file mode 100644
index 0000000..a8a2e8c
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/reg-x86-64.dat
@@ -0,0 +1,53 @@
+name:x86_64
+expedite:rbp,rsp,rip
+64:rax
+64:rdx
+64:rcx
+64:rbx
+64:rsi
+64:rdi
+64:rbp
+64:rsp
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:rip
+32:eflags
+80:st0
+80:st1
+80:st2
+80:st3
+80:st4
+80:st5
+80:st6
+80:st7
+32:fctrl
+32:fstat
+32:ftag
+32:fiseg
+32:fioff
+32:foseg
+32:fooff
+32:fop
+128:xmm0
+128:xmm1
+128:xmm2
+128:xmm3
+128:xmm4
+128:xmm5
+128:xmm6
+128:xmm7
+128:xmm8
+128:xmm9
+128:xmm10
+128:xmm11
+128:xmm12
+128:xmm13
+128:xmm14
+128:xmm15
+32:mxcsr
diff --git a/contrib/gdb/gdb/regformats/regdat.sh b/contrib/gdb/gdb/regformats/regdat.sh
new file mode 100755
index 0000000..9035b3d
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/regdat.sh
@@ -0,0 +1,169 @@
+#!/bin/sh -u
+
+# Register protocol definitions for GDB, the GNU debugger.
+# Copyright 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+move_if_change ()
+{
+ file=$1
+ if test -r ${file} && cmp -s "${file}" new-"${file}"
+ then
+ echo "${file} unchanged." 1>&2
+ else
+ mv new-"${file}" "${file}"
+ echo "${file} updated." 1>&2
+ fi
+}
+
+# Format of the input files
+read="type entry"
+
+do_read ()
+{
+ type=""
+ entry=""
+ while read line
+ do
+ if test "${line}" = ""
+ then
+ continue
+ elif test "${line}" = "#" -a "${comment}" = ""
+ then
+ continue
+ elif expr "${line}" : "#" > /dev/null
+ then
+ comment="${comment}
+${line}"
+ else
+
+ # The semantics of IFS varies between different SH's. Some
+ # treat ``::' as three fields while some treat it as just too.
+ # Work around this by eliminating ``::'' ....
+ line="`echo "${line}" | sed -e 's/::/: :/g' -e 's/::/: :/g'`"
+
+ OFS="${IFS}" ; IFS="[:]"
+ eval read ${read} <<EOF
+${line}
+EOF
+ IFS="${OFS}"
+
+ # .... and then going back through each field and strip out those
+ # that ended up with just that space character.
+ for r in ${read}
+ do
+ if eval test \"\${${r}}\" = \"\ \"
+ then
+ eval ${r}=""
+ fi
+ done
+
+ break
+ fi
+ done
+ if [ -n "${type}" ]
+ then
+ true
+ else
+ false
+ fi
+}
+
+if test ! -r $1; then
+ echo "$0: Could not open $1." 1>&2
+ exit 1
+fi
+
+copyright ()
+{
+cat <<EOF
+/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
+
+/* A register protocol for GDB, the GNU debugger.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This file was created with the aid of \`\`regdat.sh'' and \`\`$1''. */
+
+EOF
+}
+
+
+exec > new-$2
+copyright $1
+echo '#include "regdef.h"'
+echo '#include "regcache.h"'
+echo
+offset=0
+i=0
+name=x
+expedite=x
+exec < $1
+while do_read
+do
+ if test "${type}" = "name"; then
+ name="${entry}"
+ echo "struct reg regs_${name}[] = {"
+ continue
+ elif test "${type}" = "expedite"; then
+ expedite="${entry}"
+ continue
+ elif test "${name}" = x; then
+ echo "$0: $1 does not specify \`\`name''." 1>&2
+ exit 1
+ else
+ echo " { \"${entry}\", ${offset}, ${type} },"
+ offset=`expr ${offset} + ${type}`
+ i=`expr $i + 1`
+ fi
+done
+
+echo "};"
+echo
+echo "const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };"
+echo
+
+cat <<EOF
+void
+init_registers ()
+{
+ set_register_cache (regs_${name},
+ sizeof (regs_${name}) / sizeof (regs_${name}[0]));
+ gdbserver_expedite_regs = expedite_regs_${name};
+}
+EOF
+
+# close things off
+exec 1>&2
+move_if_change $2
diff --git a/contrib/gdb/gdb/regformats/regdef.h b/contrib/gdb/gdb/regformats/regdef.h
new file mode 100644
index 0000000..c1f862c
--- /dev/null
+++ b/contrib/gdb/gdb/regformats/regdef.h
@@ -0,0 +1,46 @@
+/* Register protocol definition structures for the GNU Debugger
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef REGDEF_H
+#define REGDEF_H
+
+struct reg
+{
+ /* The name of this register - NULL for pad entries. */
+ const char *name;
+
+ /* At the moment, both of the following bit counts must be divisible
+ by eight (to match the representation as two hex digits) and divisible
+ by the size of a byte (to match the layout of each register in
+ memory). */
+
+ /* The offset (in bits) of the value of this register in the buffer. */
+ int offset;
+
+ /* The size (in bits) of the value of this register, as transmitted. */
+ int size;
+};
+
+/* Set the current remote protocol and register cache according to the array
+ ``regs'', with ``n'' elements. */
+
+void set_register_cache (struct reg *regs, int n);
+
+#endif /* REGDEF_H */
diff --git a/contrib/gdb/gdb/remote-rdi.c b/contrib/gdb/gdb/remote-rdi.c
index dba920e..db51dcb 100644
--- a/contrib/gdb/gdb/remote-rdi.c
+++ b/contrib/gdb/gdb/remote-rdi.c
@@ -1,21 +1,24 @@
/* GDB interface to ARM RDI library.
- Copyright 1997, 1998 Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 "gdb_string.h"
@@ -25,12 +28,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "symfile.h"
#include "target.h"
-#include "wait.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
#include "gdbthread.h"
#include "gdbcore.h"
+#include "breakpoint.h"
+#include "completer.h"
+#include "regcache.h"
+#include "arm-tdep.h"
#ifdef USG
#include <sys/types.h>
@@ -42,57 +48,57 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "rdi-share/adp.h"
#include "rdi-share/hsys.h"
-extern int isascii PARAMS ((int));
+extern int isascii (int);
/* Prototypes for local functions */
-static void arm_rdi_files_info PARAMS ((struct target_ops *ignore));
+static void arm_rdi_files_info (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));
+static int arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr,
+ int len, int should_write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
-static void arm_rdi_prepare_to_store PARAMS ((void));
+static void arm_rdi_prepare_to_store (void);
-static void arm_rdi_fetch_registers PARAMS ((int regno));
+static void arm_rdi_fetch_registers (int regno);
-static void arm_rdi_resume PARAMS ((int pid, int step,
- enum target_signal siggnal));
+static void arm_rdi_resume (ptid_t pid, int step,
+ enum target_signal siggnal);
-static int arm_rdi_start_remote PARAMS ((char *dummy));
+static int arm_rdi_start_remote (char *dummy);
-static void arm_rdi_open PARAMS ((char *name, int from_tty));
+static void arm_rdi_open (char *name, int from_tty);
-static void arm_rdi_create_inferior PARAMS ((char *exec_file, char *args,
- char **env));
+static void arm_rdi_create_inferior (char *exec_file, char *args, char **env);
-static void arm_rdi_close PARAMS ((int quitting));
+static void arm_rdi_close (int quitting);
-static void arm_rdi_store_registers PARAMS ((int regno));
+static void arm_rdi_store_registers (int regno);
-static void arm_rdi_mourn PARAMS ((void));
+static void arm_rdi_mourn (void);
-static void arm_rdi_send PARAMS ((char *buf));
+static void arm_rdi_send (char *buf);
-static int arm_rdi_wait PARAMS ((int pid, struct target_waitstatus *status));
+static ptid_t arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status);
-static void arm_rdi_kill PARAMS ((void));
+static void arm_rdi_kill (void);
-static void arm_rdi_detach PARAMS ((char *args, int from_tty));
+static void arm_rdi_detach (char *args, int from_tty);
-static void arm_rdi_interrupt PARAMS ((int signo));
+static void arm_rdi_interrupt (int signo);
-static void arm_rdi_interrupt_twice PARAMS ((int signo));
+static void arm_rdi_interrupt_twice (int signo);
-static void interrupt_query PARAMS ((void));
+static void interrupt_query (void);
-static int arm_rdi_insert_breakpoint PARAMS ((CORE_ADDR, char *));
+static int arm_rdi_insert_breakpoint (CORE_ADDR, char *);
-static int arm_rdi_remove_breakpoint PARAMS ((CORE_ADDR, char *));
+static int arm_rdi_remove_breakpoint (CORE_ADDR, char *);
-static char *rdi_error_message PARAMS ((int err));
+static char *rdi_error_message (int err);
-static enum target_signal rdi_error_signal PARAMS ((int err));
+static enum target_signal rdi_error_signal (int err);
/* Global variables. */
@@ -106,20 +112,33 @@ static int max_load_size;
static int execute_status;
-/* A little list of breakpoints that have been set. */
+/* Send heatbeat packets? */
+static int rdi_heartbeat = 0;
-static struct local_bp_list_entry {
- CORE_ADDR addr;
- PointHandle point;
- struct local_bp_list_entry *next;
-} *local_bp_list;
+/* Target has ROM at address 0. */
+static int rom_at_zero = 0;
+
+/* Enable logging? */
+static int log_enable = 0;
+/* Name of the log file. Default is "rdi.log". */
+static char *log_filename;
+
+/* 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;
+
/* Stub for catch_errors. */
static int
-arm_rdi_start_remote (dummy)
- char *dummy;
+arm_rdi_start_remote (char *dummy)
{
return 1;
}
@@ -128,54 +147,45 @@ arm_rdi_start_remote (dummy)
these to forward output from the target system and so forth. */
void
-voiddummy ()
+voiddummy (void *dummy)
{
fprintf_unfiltered (gdb_stdout, "void dummy\n");
}
static void
-myprint (arg, format, ap)
- PTR arg;
- const char *format;
- va_list ap;
+myprint (PTR arg, const char *format, va_list ap)
{
vfprintf_unfiltered (gdb_stdout, format, ap);
}
static void
-mywritec (arg, c)
- PTR arg;
- int c;
+mywritec (PTR arg, int c)
{
if (isascii (c))
fputc_unfiltered (c, gdb_stdout);
}
static int
-mywrite (arg, buffer, len)
- PTR arg;
- char const *buffer;
- int len;
+mywrite (PTR arg, char const *buffer, int len)
{
int i;
char *e;
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;
}
static void
-mypause (arg)
- PTR arg;
+mypause (PTR arg)
{
}
@@ -183,19 +193,15 @@ mypause (arg)
being interrupted more carefully */
static int
-myreadc (arg)
- PTR arg;
-{
+myreadc (PTR arg)
+{
return fgetc (stdin);
}
static char *
-mygets (arg, buffer, len)
- PTR arg;
- char *buffer;
- int len;
+mygets (PTR arg, char *buffer, int len)
{
- return fgets(buffer, len, stdin);
+ return fgets (buffer, len, stdin);
}
/* Prevent multiple calls to angel_RDI_close(). */
@@ -205,25 +211,42 @@ static int closed_already = 1;
for communication. */
static void
-arm_rdi_open (name, from_tty)
- char *name;
- int from_tty;
+arm_rdi_open (char *name, int from_tty)
{
int rslt, i;
unsigned long arg1, arg2;
+ char *openArgs = NULL;
+ char *devName = NULL;
+ char *p;
if (name == NULL)
error ("To open an RDI connection, you need to specify what serial\n\
device is attached to the remote system (e.g. /dev/ttya).");
+ /* split name after whitespace, pass tail as arg to open command */
+
+ devName = xstrdup (name);
+ p = strchr (devName, ' ');
+ if (p)
+ {
+ *p = '\0';
+ ++p;
+
+ while (*p == ' ')
+ ++p;
+
+ openArgs = p;
+ }
+
/* Make the basic low-level connection. */
- rslt = Adp_OpenDevice (name, NULL, 1);
+ arm_rdi_close (0);
+ rslt = Adp_OpenDevice (devName, openArgs, rdi_heartbeat);
if (rslt != adp_ok)
error ("Could not open device \"%s\"", name);
- gdb_config.bytesex = 2 | (TARGET_BYTE_ORDER == BIG_ENDIAN ? 1 : 0);
+ gdb_config.bytesex = 2 | (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 1 : 0);
gdb_config.fpe = 1;
gdb_config.rditype = 2;
gdb_config.heartbeat_on = 1;
@@ -241,10 +264,12 @@ 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));
+ Adp_CloseDevice ();
+ error ("RDI_open failed\n");
}
rslt = angel_RDI_info (RDIInfo_Target, &arg1, &arg2);
@@ -290,7 +315,8 @@ device is attached to the remote system (e.g. /dev/ttya).");
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
}
- arg1 = 0x13b;
+ arg1 = rom_at_zero ? 0x0 : 0x13b;
+
rslt = angel_RDI_info (RDIVector_Catch, &arg1, &arg2);
if (rslt)
{
@@ -311,16 +337,16 @@ device is attached to the remote system (e.g. /dev/ttya).");
for (entry = local_bp_list; entry != NULL; entry = entry->next)
{
if (preventry)
- free (preventry);
+ xfree (preventry);
}
}
printf_filtered ("Connected to ARM RDI target.\n");
closed_already = 0;
- inferior_pid = 42;
+ inferior_ptid = pid_to_ptid (42);
}
-/* Start an inferior process and set inferior_pid to its pid.
+/* Start an inferior process and set inferior_ptid to its pid.
EXEC_FILE is the file to run.
ARGS is a string containing the arguments to the program.
ENV is the environment vector to pass. Errors reported with error().
@@ -329,10 +355,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
user types "run" after having attached. */
static void
-arm_rdi_create_inferior (exec_file, args, env)
- char *exec_file;
- char *args;
- char **env;
+arm_rdi_create_inferior (char *exec_file, char *args, char **env)
{
int len, rslt;
unsigned long arg1, arg2;
@@ -340,23 +363,23 @@ 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);
strcat (arg_buf, " ");
strcat (arg_buf, args);
- inferior_pid = 42;
- insert_breakpoints (); /* Needed to get correct instruction in cache */
+ inferior_ptid = pid_to_ptid (42);
+ insert_breakpoints (); /* Needed to get correct instruction in cache */
if (env != NULL)
{
@@ -370,9 +393,9 @@ arm_rdi_create_inferior (exec_file, args, env)
/* Set up memory limit */
top_of_memory = strtoul (*env + sizeof ("MEMSIZE=") - 1,
&end_of_num, 0);
- printf_filtered ("Setting top-of-memory to 0x%x\n",
+ printf_filtered ("Setting top-of-memory to 0x%lx\n",
top_of_memory);
-
+
rslt = angel_RDI_info (RDIInfo_SetTopMem, &top_of_memory, &arg2);
if (rslt)
{
@@ -384,7 +407,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));
@@ -399,9 +422,7 @@ arm_rdi_create_inferior (exec_file, args, env)
die when it hits one. */
static void
-arm_rdi_detach (args, from_tty)
- char *args;
- int from_tty;
+arm_rdi_detach (char *args, int from_tty)
{
pop_target ();
}
@@ -409,12 +430,11 @@ arm_rdi_detach (args, from_tty)
/* Clean up connection to a remote debugger. */
static void
-arm_rdi_close (quitting)
- int quitting;
+arm_rdi_close (int quitting)
{
int rslt;
- if (! closed_already)
+ if (!closed_already)
{
rslt = angel_RDI_close ();
if (rslt)
@@ -422,21 +442,21 @@ arm_rdi_close (quitting)
printf_filtered ("RDI_close: %s\n", rdi_error_message (rslt));
}
closed_already = 1;
- inferior_pid = 0;
+ inferior_ptid = null_ptid;
+ Adp_CloseDevice ();
+ generic_mourn_inferior ();
}
}
/* Tell the remote machine to resume. */
static void
-arm_rdi_resume (pid, step, siggnal)
- int pid, step;
- enum target_signal siggnal;
+arm_rdi_resume (ptid_t ptid, int step, enum target_signal 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)
@@ -451,7 +471,7 @@ arm_rdi_resume (pid, step, siggnal)
if (step)
{
- pc = read_register (PC_REGNUM);
+ pc = read_register (ARM_PC_REGNUM);
pc = arm_get_next_pc (pc);
arm_rdi_insert_breakpoint (pc, handle);
}
@@ -473,24 +493,22 @@ arm_rdi_resume (pid, step, siggnal)
packet. */
static void
-arm_rdi_interrupt (signo)
- int signo;
+arm_rdi_interrupt (int signo)
{
}
-static void (*ofunc)();
+static void (*ofunc) ();
/* The user typed ^C twice. */
static void
-arm_rdi_interrupt_twice (signo)
- int signo;
+arm_rdi_interrupt_twice (int signo)
{
}
/* Ask the user what to do when an interrupt is received. */
static void
-interrupt_query ()
+interrupt_query (void)
{
}
@@ -498,32 +516,29 @@ interrupt_query ()
STATUS just as `wait' would. Returns "pid" (though it's not clear
what, if anything, that means in the case of this target). */
-static int
-arm_rdi_wait (pid, status)
- int pid;
- struct target_waitstatus *status;
+static ptid_t
+arm_rdi_wait (ptid_t ptid, 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);
- return inferior_pid;
+ return inferior_ptid;
}
/* Read the remote registers into the block REGS. */
/* ARGSUSED */
static void
-arm_rdi_fetch_registers (regno)
- int regno;
+arm_rdi_fetch_registers (int regno)
{
int rslt, rdi_regmask;
unsigned long rawreg, rawregs[32];
char cookedreg[4];
- if (regno == -1)
+ if (regno == -1)
{
rslt = angel_RDI_CPUread (255, 0x27fff, rawregs);
if (rslt)
@@ -537,14 +552,14 @@ arm_rdi_fetch_registers (regno)
supply_register (regno, (char *) cookedreg);
}
store_unsigned_integer (cookedreg, 4, rawregs[15]);
- supply_register (PS_REGNUM, (char *) cookedreg);
- arm_rdi_fetch_registers (PC_REGNUM);
+ supply_register (ARM_PS_REGNUM, (char *) cookedreg);
+ arm_rdi_fetch_registers (ARM_PC_REGNUM);
}
else
{
- if (regno == PC_REGNUM)
+ if (regno == ARM_PC_REGNUM)
rdi_regmask = RDIReg_PC;
- else if (regno == PS_REGNUM)
+ else if (regno == ARM_PS_REGNUM)
rdi_regmask = RDIReg_CPSR;
else if (regno < 0 || regno > 15)
{
@@ -565,8 +580,8 @@ arm_rdi_fetch_registers (regno)
}
}
-static void
-arm_rdi_prepare_to_store ()
+static void
+arm_rdi_prepare_to_store (void)
{
/* Nothing to do. */
}
@@ -575,15 +590,14 @@ arm_rdi_prepare_to_store ()
of REGISTERS. FIXME: ignores errors. */
static void
-arm_rdi_store_registers (regno)
- int regno;
+arm_rdi_store_registers (int regno)
{
int rslt, rdi_regmask;
/* 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);
@@ -594,9 +608,9 @@ arm_rdi_store_registers (regno)
/* RDI manipulates data in host byte order, so convert now. */
store_unsigned_integer (rawerreg, 4, rawreg[0]);
- if (regno == PC_REGNUM)
+ if (regno == ARM_PC_REGNUM)
rdi_regmask = RDIReg_PC;
- else if (regno == PS_REGNUM)
+ else if (regno == ARM_PS_REGNUM)
rdi_regmask = RDIReg_CPSR;
else if (regno < 0 || regno > 15)
return;
@@ -614,16 +628,13 @@ arm_rdi_store_registers (regno)
/* Read or write LEN bytes from inferior memory at MEMADDR,
transferring to or from debugger address MYADDR. Write to inferior
if SHOULD_WRITE is nonzero. Returns length of data written or
- read; 0 for error. */
+ read; 0 for error. TARGET is unused. */
/* ARGSUSED */
static int
-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 */
+arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+ int should_write, struct mem_attrib *attrib,
+ struct target_ops *target)
{
int rslt, i;
@@ -635,7 +646,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)
@@ -650,8 +661,7 @@ arm_rdi_xfer_memory(memaddr, myaddr, len, should_write, target)
/* Display random info collected from the target. */
static void
-arm_rdi_files_info (ignore)
- struct target_ops *ignore;
+arm_rdi_files_info (struct target_ops *ignore)
{
char *file = "nothing";
int rslt;
@@ -668,7 +678,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)
{
@@ -686,7 +696,7 @@ arm_rdi_files_info (ignore)
}
static void
-arm_rdi_kill ()
+arm_rdi_kill (void)
{
int rslt;
@@ -698,8 +708,14 @@ arm_rdi_kill ()
}
static void
-arm_rdi_mourn_inferior ()
+arm_rdi_mourn_inferior (void)
{
+ /* We remove the inserted breakpoints in case the user wants to
+ issue another target and load commands to rerun his application;
+ This is something that wouldn't work on a native target, for instance,
+ as the process goes away when the inferior exits, but it works with
+ some remote targets like this one. That is why this is done here. */
+ remove_breakpoints();
unpush_target (&arm_rdi_ops);
generic_mourn_inferior ();
}
@@ -710,9 +726,7 @@ arm_rdi_mourn_inferior ()
here. */
static int
-arm_rdi_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+arm_rdi_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int rslt;
PointHandle point;
@@ -736,9 +750,7 @@ arm_rdi_insert_breakpoint (addr, contents_cache)
}
static int
-arm_rdi_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+arm_rdi_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int rslt;
PointHandle point;
@@ -768,18 +780,17 @@ arm_rdi_remove_breakpoint (addr, contents_cache)
{
preventry->next = entry->next;
}
- free (entry);
+ xfree (entry);
}
return 0;
}
static char *
-rdi_error_message (err)
- int err;
+rdi_error_message (int err)
{
switch (err)
{
- case RDIError_NoError:
+ case RDIError_NoError:
return "no error";
case RDIError_Reset:
return "debuggee reset";
@@ -858,22 +869,21 @@ 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";
}
}
/* Convert the ARM error messages to signals that GDB knows about. */
static enum target_signal
-rdi_error_signal (err)
- int err;
+rdi_error_signal (int err)
{
switch (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,51 +933,153 @@ rdi_error_signal (err)
case RDIError_UnimplementedMessage:
case RDIError_UndefinedMessage:
default:
- return TARGET_SIGNAL_UNKNOWN;
+ return TARGET_SIGNAL_UNKNOWN;
}
}
+
+static void
+arm_rdi_stop(void)
+{
+ angel_RDI_stop_request();
+}
+
/* Define the target operations structure. */
static void
-init_rdi_ops ()
+init_rdi_ops (void)
{
- 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_stop = arm_rdi_stop;
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;
+}
+
+static void
+rdilogfile_command (char *arg, int from_tty)
+{
+ if (!arg || strlen (arg) == 0)
+ {
+ printf_filtered ("rdi log file is '%s'\n", log_filename);
+ return;
+ }
+
+ if (log_filename)
+ xfree (log_filename);
+
+ log_filename = xstrdup (arg);
+
+ Adp_SetLogfile (log_filename);
+}
+
+static void
+rdilogenable_command (char *args, int from_tty)
+{
+ if (!args || strlen (args) == 0)
+ {
+ printf_filtered ("rdi log is %s\n", log_enable ? "enabled" : "disabled");
+ return;
+ }
+
+ if (!strcasecmp (args, "1") ||
+ !strcasecmp (args, "y") ||
+ !strcasecmp (args, "yes") ||
+ !strcasecmp (args, "on") ||
+ !strcasecmp (args, "t") ||
+ !strcasecmp (args, "true"))
+ Adp_SetLogEnable (log_enable = 1);
+ else if (!strcasecmp (args, "0") ||
+ !strcasecmp (args, "n") ||
+ !strcasecmp (args, "no") ||
+ !strcasecmp (args, "off") ||
+ !strcasecmp (args, "f") ||
+ !strcasecmp (args, "false"))
+ Adp_SetLogEnable (log_enable = 0);
+ else
+ printf_filtered ("rdilogenable: unrecognized argument '%s'\n"
+ " try y or n\n", args);
}
void
-_initialize_remote_rdi ()
+_initialize_remote_rdi (void)
{
- init_rdi_ops () ;
+ struct cmd_list_element *c;
+
+ init_rdi_ops ();
add_target (&arm_rdi_ops);
+
+ log_filename = xstrdup ("rdi.log");
+ Adp_SetLogfile (log_filename);
+ Adp_SetLogEnable (log_enable);
+
+ c = add_cmd ("rdilogfile", class_maintenance,
+ rdilogfile_command,
+ "Set filename for ADP packet log.\n\
+This file is used to log Angel Debugger Protocol packets.\n\
+With a single argument, sets the logfile name to that value.\n\
+Without an argument, shows the current logfile name.\n\
+See also: rdilogenable\n",
+ &maintenancelist);
+ c->completer = filename_completer;
+
+ add_cmd ("rdilogenable", class_maintenance,
+ rdilogenable_command,
+ "Set enable logging of ADP packets.\n\
+This will log ADP packets exchanged between gdb and the\n\
+rdi target device.\n\
+An argument of 1,t,true,y,yes will enable.\n\
+An argument of 0,f,false,n,no will disabled.\n\
+Withough an argument, it will display current state.\n",
+ &maintenancelist);
+
+ add_show_from_set
+ (add_set_cmd ("rdiromatzero", no_class,
+ var_boolean, (char *) &rom_at_zero,
+ "Set target has ROM at addr 0.\n\
+A true value disables vector catching, false enables vector catching.\n\
+This is evaluated at the time the 'target rdi' command is executed\n",
+ &setlist),
+ &showlist);
+
+ add_show_from_set
+ (add_set_cmd ("rdiheartbeat", no_class,
+ var_boolean, (char *) &rdi_heartbeat,
+ "Set enable for ADP heartbeat packets.\n\
+I don't know why you would want this. If you enable them,\n\
+it will confuse ARM and EPI JTAG interface boxes as well\n\
+as the Angel Monitor.\n",
+ &setlist),
+ &showlist);
}
/* A little dummy to make linking with the library succeed. */
-int Fail() { return 0; }
+int
+Fail (void)
+{
+ return 0;
+}
diff --git a/contrib/gdb/gdb/remote-utils.c b/contrib/gdb/gdb/remote-utils.c
index 7219255..e703f3d 100644
--- a/contrib/gdb/gdb/remote-utils.c
+++ b/contrib/gdb/gdb/remote-utils.c
@@ -1,43 +1,45 @@
/* Generic support for remote debugging interfaces.
- Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1998, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,42 +48,42 @@ 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"
+#include "regcache.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.
-*/
+void _initialize_sr_support (void);
- 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;
-static void usage PARAMS ((char *, char *));
-static void sr_com PARAMS ((char *, int));
+static void usage (char *, char *);
+static void sr_com (char *, int);
static void
-usage(proto, junk)
- char *proto;
- char *junk;
+usage (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,9 +103,7 @@ where DEVICE is the name of a device or HOST:PORT", proto, proto);
}
void
-sr_scan_args(proto, args)
- char *proto;
- char *args;
+sr_scan_args (char *proto, char *args)
{
int n;
char *p, *q;
@@ -113,61 +113,56 @@ 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 (void)
{
- sr_write_cr("");
- gr_expect_prompt();
+ sr_write_cr ("");
+ gr_expect_prompt ();
}
void
-gr_open(args, from_tty, gr)
- char *args;
- int from_tty;
- struct gr_settings *gr;
+gr_open (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));
-
- 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 +172,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 ());
+ 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 +208,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;
}
@@ -223,35 +218,35 @@ gr_open(args, from_tty, gr)
and doing all the fancy timeout stuff. */
int
-sr_readchar ()
+sr_readchar (void)
{
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 (void)
{
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;
@@ -260,12 +255,11 @@ sr_pollchar()
/* Keep discarding input from the remote system, until STRING is found.
Let the user break out immediately. */
void
-sr_expect (string)
- char *string;
+sr_expect (char *string)
{
char *p = string;
- immediate_quit = 1;
+ immediate_quit++;
while (1)
{
if (sr_readchar () == *p)
@@ -273,7 +267,7 @@ sr_expect (string)
p++;
if (*p == '\0')
{
- immediate_quit = 0;
+ immediate_quit--;
return;
}
}
@@ -283,16 +277,14 @@ sr_expect (string)
}
void
-sr_write (a, l)
- char *a;
- int l;
+sr_write (char *a, int 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]);
@@ -300,8 +292,7 @@ sr_write (a, l)
}
void
-sr_write_cr (s)
- char *s;
+sr_write_cr (char *s)
{
sr_write (s, strlen (s));
sr_write ("\r", 1);
@@ -309,9 +300,7 @@ sr_write_cr (s)
}
int
-sr_timed_read (buf, n)
- char *buf;
- int n;
+sr_timed_read (char *buf, int n)
{
int i;
char c;
@@ -334,8 +323,7 @@ sr_timed_read (buf, n)
ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
int
-sr_get_hex_digit (ignore_space)
- int ignore_space;
+sr_get_hex_digit (int ignore_space)
{
int ch;
@@ -359,8 +347,7 @@ sr_get_hex_digit (ignore_space)
/* Get a byte from the remote and put it in *BYT. Accept any number
leading spaces. */
void
-sr_get_hex_byte (byt)
- char *byt;
+sr_get_hex_byte (char *byt)
{
int val;
@@ -371,7 +358,7 @@ sr_get_hex_byte (byt)
/* Read a 32-bit hex word from the remote, preceded by a space */
long
-sr_get_hex_word ()
+sr_get_hex_word (void)
{
long val;
int j;
@@ -389,9 +376,7 @@ sr_get_hex_word ()
FIXME: Can't handle commands that take input. */
static void
-sr_com (args, fromtty)
- char *args;
- int fromtty;
+sr_com (char *args, int fromtty)
{
sr_check_open ();
@@ -407,15 +392,14 @@ sr_com (args, fromtty)
}
void
-gr_close(quitting)
- int quitting;
+gr_close (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 +414,12 @@ gr_close(quitting)
with your gdb. */
void
-gr_detach(args, from_tty)
- char *args;
- int from_tty;
+gr_detach (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,16 +427,15 @@ gr_detach(args, from_tty)
puts_filtered ("Ending remote debugging.\n");
return;
-}
+}
void
-gr_files_info (ops)
- struct target_ops *ops;
+gr_files_info (struct target_ops *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");
@@ -469,15 +450,15 @@ gr_files_info (ops)
}
void
-gr_mourn ()
+gr_mourn (void)
{
gr_clear_all_breakpoints ();
- unpush_target (gr_get_ops());
+ unpush_target (gr_get_ops ());
generic_mourn_inferior ();
}
void
-gr_kill ()
+gr_kill (void)
{
return;
}
@@ -485,10 +466,7 @@ gr_kill ()
/* This is called not only when we first attach, but also when the
user types "run" after having attached. */
void
-gr_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
+gr_create_inferior (char *execfile, char *args, char **env)
{
int entry_pt;
@@ -505,7 +483,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);
@@ -519,12 +497,10 @@ gr_create_inferior (execfile, args, env)
pass non-matching data on. */
int
-gr_multi_scan (list, passthrough)
- char *list[];
- int passthrough;
+gr_multi_scan (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 +515,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 +523,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 +547,7 @@ gr_multi_scan (list, passthrough)
{
++plist[i];
if (*plist[i] == '\0')
- return(i);
+ return (i);
if (!ch_handled)
*swallowed_p++ = ch;
@@ -600,7 +576,7 @@ gr_multi_scan (list, passthrough)
}
#if 0
/* Never reached. */
- return(-1);
+ return (-1);
#endif
}
@@ -611,38 +587,17 @@ gr_multi_scan (list, passthrough)
debugged. */
void
-gr_prepare_to_store ()
+gr_prepare_to_store (void)
{
/* Do nothing, since we assume we can store individual regs */
}
-/* Read a word from remote address ADDR and return it.
- * This goes through the data cache.
- */
-int
-gr_fetch_word (addr)
- CORE_ADDR addr;
-{
- return dcache_fetch (gr_get_dcache(), addr);
-}
-
-/* Write a word WORD into remote address ADDR.
- This goes through the data cache. */
-
-void
-gr_store_word (addr, word)
- CORE_ADDR addr;
- int word;
-{
- dcache_poke (gr_get_dcache(), addr, word);
-}
-
void
-_initialize_sr_support ()
+_initialize_sr_support (void)
{
/* 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),
diff --git a/contrib/gdb/gdb/remote-utils.h b/contrib/gdb/gdb/remote-utils.h
index d4fcd0e..3ca3bb4 100644
--- a/contrib/gdb/gdb/remote-utils.h
+++ b/contrib/gdb/gdb/remote-utils.h
@@ -1,42 +1,43 @@
/* Generic support for remote debugging interfaces.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
-#include "serial.h"
#include "target.h"
-#include "dcache.h"
+struct serial;
/* 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;
+ struct serial *desc;
-};
+ };
extern struct _sr_settings sr_settings;
@@ -52,7 +53,7 @@ extern struct _sr_settings sr_settings;
#define sr_get_device() (sr_settings.device)
#define sr_set_device(newval) \
{ \
- if (sr_settings.device) free(sr_settings.device); \
+ if (sr_settings.device) xfree (sr_settings.device); \
sr_settings.device = (newval); \
}
@@ -69,23 +70,16 @@ 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
+ {
+ char *prompt;
+ struct target_ops *ops;
+ int (*clear_all_breakpoints) (void);
+ void (*checkin) (void);
+ };
extern struct gr_settings *gr_settings;
-/* get and set dcache. */
-#define gr_get_dcache() (gr_settings->dcache)
-#define gr_set_dcache(newval) (gr_settings->dcache = (newval))
-
/* get and set prompt. */
#define gr_get_prompt() (gr_settings->prompt)
#define gr_set_prompt(newval) (gr_settings->prompt = (newval))
@@ -114,29 +108,26 @@ 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_multi_scan (char *list[], int passthrough);
+int sr_get_hex_digit (int ignore_space);
+int sr_pollchar (void);
+int sr_readchar (void);
+int sr_timed_read (char *buf, int n);
+long sr_get_hex_word (void);
+void gr_close (int quitting);
+void gr_create_inferior (char *execfile, char *args, char **env);
+void gr_detach (char *args, int from_tty);
+void gr_files_info (struct target_ops *ops);
+void gr_generic_checkin (void);
+void gr_kill (void);
+void gr_mourn (void);
+void gr_prepare_to_store (void);
+void sr_expect (char *string);
+void sr_get_hex_byte (char *byt);
+void sr_scan_args (char *proto, char *args);
+void sr_write (char *a, int l);
+void sr_write_cr (char *s);
+
+void gr_open (char *args, int from_tty, struct gr_settings *gr_settings);
+void gr_load_image (char *, int from_tty);
#endif /* REMOTE_UTILS_H */
diff --git a/contrib/gdb/gdb/remote.h b/contrib/gdb/gdb/remote.h
new file mode 100644
index 0000000..e2171b2
--- /dev/null
+++ b/contrib/gdb/gdb/remote.h
@@ -0,0 +1,57 @@
+/* Remote target communications for serial-line targets in custom GDB protocol
+ Copyright 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. */
+
+#ifndef REMOTE_H
+#define REMOTE_H
+
+/* FIXME?: move this interface down to tgt vector) */
+
+/* Read a packet from the remote machine, with error checking, and
+ store it in BUF. BUF is expected to be of size PBUFSIZ. If
+ FOREVER, wait forever rather than timing out; this is used while
+ the target is executing user code. */
+
+extern void getpkt (char *buf, long sizeof_buf, int forever);
+
+/* Send a packet to the remote machine, with error checking. The data
+ of the packet is in BUF. The string in BUF can be at most PBUFSIZ
+ - 5 to account for the $, # and checksum, and for a possible /0 if
+ we are debugging (remote_debug) and want to print the sent packet
+ as a string */
+
+extern int putpkt (char *buf);
+
+/* Send HEX encoded string to the target console. (gdb_stdtarg) */
+
+extern void remote_console_output (char *);
+
+
+/* FIXME: cagney/1999-09-20: The remote cisco stuff in remote.c needs
+ to be broken out into a separate file (remote-cisco.[hc]?). Before
+ that can happen, a remote protocol stack framework needs to be
+ implemented. */
+
+extern void remote_cisco_objfile_relocate (bfd_signed_vma text_off,
+ bfd_signed_vma data_off,
+ bfd_signed_vma bss_off);
+
+extern void async_remote_interrupt_twice (void *arg);
+
+#endif
diff --git a/contrib/gdb/gdb/reply_mig_hack.awk b/contrib/gdb/gdb/reply_mig_hack.awk
index 310a40c..85c935d 100644
--- a/contrib/gdb/gdb/reply_mig_hack.awk
+++ b/contrib/gdb/gdb/reply_mig_hack.awk
@@ -1,6 +1,6 @@
# Reply server mig-output massager
#
-# Copyright (C) 1995 Free Software Foundation, Inc.
+# Copyright 1995, 1996, 1999 Free Software Foundation, Inc.
#
# Written by Miles Bader <miles@gnu.ai.mit.edu>
#
@@ -16,7 +16,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., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# This awk script hacks the output of mig-generated reply server code
# so that it allows replies with just the error-code in them (as this is
diff --git a/contrib/gdb/gdb/scm-exp.c b/contrib/gdb/gdb/scm-exp.c
index 6399563..7464ecf 100644
--- a/contrib/gdb/gdb/scm-exp.c
+++ b/contrib/gdb/gdb/scm-exp.c
@@ -1,21 +1,22 @@
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -30,63 +31,80 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define USE_EXPRSTRING 0
-static void scm_lreadparen PARAMS ((int));
-static int scm_skip_ws PARAMS ((void));
-static void scm_read_token PARAMS ((int, int));
-static LONGEST scm_istring2number PARAMS ((char *, int, int));
-static LONGEST scm_istr2int PARAMS ((char *, int, int));
-static void scm_lreadr PARAMS ((int));
+static void scm_lreadparen (int);
+static int scm_skip_ws (void);
+static void scm_read_token (int, int);
+static LONGEST scm_istring2number (char *, int, int);
+static LONGEST scm_istr2int (char *, int, int);
+static void scm_lreadr (int);
static LONGEST
-scm_istr2int(str, len, radix)
- char *str;
- int len;
- int radix;
+scm_istr2int (char *str, int len, int radix)
{
int i = 0;
LONGEST inum = 0;
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)
- char *str;
- int len;
- int radix;
+scm_istring2number (char *str, int len, int radix)
{
int i = 0;
char ex = 0;
@@ -94,40 +112,73 @@ 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;
}
static void
-scm_read_token (c, weird)
- int c;
- int weird;
+scm_read_token (int c, int weird)
{
while (1)
{
@@ -140,11 +191,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,8 +234,8 @@ scm_read_token (c, weird)
}
}
-static int
-scm_skip_ws ()
+static int
+scm_skip_ws (void)
{
register int c;
while (1)
@@ -201,7 +255,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;
@@ -209,8 +267,7 @@ scm_skip_ws ()
}
static void
-scm_lreadparen (skipping)
- int skipping;
+scm_lreadparen (int skipping)
{
for (;;)
{
@@ -225,13 +282,12 @@ scm_lreadparen (skipping)
}
static void
-scm_lreadr (skipping)
- int skipping;
+scm_lreadr (int skipping)
{
int c, j;
struct stoken str;
LONGEST svalue = 0;
- tryagain:
+tryagain:
c = *lexptr++;
switch (c)
{
@@ -252,7 +308,7 @@ scm_lreadr (skipping)
scm_lreadr (skipping);
if (!skipping)
{
- value_ptr val = scm_evaluate_string (str.ptr, lexptr - str.ptr);
+ struct value *val = scm_evaluate_string (str.ptr, lexptr - str.ptr);
if (!is_scmvalue_type (VALUE_TYPE (val)))
error ("quoted scm form yields non-SCM value");
svalue = extract_signed_integer (VALUE_CONTENTS (val),
@@ -274,28 +330,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 +416,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 +449,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 +466,7 @@ scm_lreadr (skipping)
}
return;
}
- handle_immediate:
+handle_immediate:
if (!skipping)
{
write_exp_elt_opcode (OP_LONG);
@@ -405,9 +477,9 @@ scm_lreadr (skipping)
}
int
-scm_parse ()
+scm_parse (void)
{
- char* start;
+ char *start;
while (*lexptr == ' ')
lexptr++;
start = lexptr;
diff --git a/contrib/gdb/gdb/scm-lang.c b/contrib/gdb/gdb/scm-lang.c
index 7f31ba4..30ca763 100644
--- a/contrib/gdb/gdb/scm-lang.c
+++ b/contrib/gdb/gdb/scm-lang.c
@@ -1,21 +1,23 @@
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1998, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -30,38 +32,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_string.h"
#include "gdbcore.h"
-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));
+extern void _initialize_scheme_language (void);
+static struct value *evaluate_subexp_scm (struct type *, struct expression *,
+ int *, enum noside);
+static struct value *scm_lookup_name (char *);
+static int in_eval_c (void);
+static void scm_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
-extern struct type ** CONST_PTR (c_builtin_types[]);
+extern struct type **const (c_builtin_types[]);
struct type *builtin_type_scm;
void
-scm_printchar (c, stream)
- int c;
- GDB_FILE *stream;
+scm_printchar (int c, struct ui_file *stream)
{
fprintf_filtered (stream, "#\\%c", c);
}
static void
-scm_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
- char *string;
- unsigned int length;
- int width;
- int force_ellipses;
+scm_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int width, int force_ellipses)
{
fprintf_filtered (stream, "\"%s\"", string);
}
int
-is_scmvalue_type (type)
- struct type *type;
+is_scmvalue_type (struct type *type)
{
if (TYPE_CODE (type) == TYPE_CODE_INT
&& TYPE_NAME (type) && strcmp (TYPE_NAME (type), "SCM") == 0)
@@ -75,9 +73,7 @@ is_scmvalue_type (type)
of the 0'th one. */
LONGEST
-scm_get_field (svalue, index)
- LONGEST svalue;
- int index;
+scm_get_field (LONGEST svalue, int index)
{
char buffer[20];
read_memory (SCM2PTR (svalue) + index * TYPE_LENGTH (builtin_type_scm),
@@ -90,10 +86,7 @@ scm_get_field (svalue, index)
or Boolean (CONTEXT == TYPE_CODE_BOOL). */
LONGEST
-scm_unpack (type, valaddr, context)
- struct type *type;
- char *valaddr;
- enum type_code context;
+scm_unpack (struct type *type, char *valaddr, enum type_code context)
{
if (is_scmvalue_type (type))
{
@@ -107,10 +100,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))
{
@@ -137,7 +131,7 @@ scm_unpack (type, valaddr, context)
/* True if we're correctly in Guile's eval.c (the evaluator and apply). */
static int
-in_eval_c ()
+in_eval_c (void)
{
if (current_source_symtab && current_source_symtab->filename)
{
@@ -153,13 +147,13 @@ in_eval_c ()
First lookup in Scheme context (using the scm_lookup_cstr inferior
function), then try lookup_symbol for compiled variables. */
-static value_ptr
-scm_lookup_name (str)
- char *str;
+static struct value *
+scm_lookup_name (char *str)
{
- value_ptr args[3];
+ struct value *args[3];
int len = strlen (str);
- value_ptr func, val;
+ struct value *func;
+ struct value *val;
struct symbol *sym;
args[0] = value_allocate_space_in_inferior (len);
args[1] = value_from_longest (builtin_type_int, len);
@@ -189,12 +183,11 @@ scm_lookup_name (str)
error ("No symbol \"%s\" in current context.");
}
-value_ptr
-scm_evaluate_string (str, len)
- char *str; int len;
+struct value *
+scm_evaluate_string (char *str, int len)
{
- value_ptr func;
- value_ptr addr = value_allocate_space_in_inferior (len + 1);
+ struct value *func;
+ struct value *addr = value_allocate_space_in_inferior (len + 1);
LONGEST iaddr = value_as_long (addr);
write_memory (iaddr, str, len);
/* FIXME - should find and pass env */
@@ -203,15 +196,13 @@ scm_evaluate_string (str, len)
return call_function_by_hand (func, 1, &addr);
}
-static value_ptr
-evaluate_subexp_scm (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+static struct value *
+evaluate_subexp_scm (struct type *expect_type, register struct expression *exp,
+ register int *pos, 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:
@@ -230,19 +221,21 @@ 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,
range_check_off,
type_check_off,
+ case_sensitive_off,
scm_parse,
c_error,
evaluate_subexp_scm,
@@ -253,19 +246,19 @@ 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
};
void
-_initialize_scheme_language ()
+_initialize_scheme_language (void)
{
add_language (&scm_language_defn);
builtin_type_scm = init_type (TYPE_CODE_INT,
diff --git a/contrib/gdb/gdb/scm-lang.h b/contrib/gdb/gdb/scm-lang.h
index 878a2ab..713b030 100644
--- a/contrib/gdb/gdb/scm-lang.h
+++ b/contrib/gdb/gdb/scm-lang.h
@@ -1,3 +1,23 @@
+/* Scheme/Guile language support routines for GDB, the GNU debugger.
+ Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
#define SICP
#include "scm-tags.h"
#undef SCM_NCELLP
@@ -22,29 +42,29 @@
#define SCM_CODE(x) SCM_CAR(SCM_CLOSCAR (x))
#define SCM_MAKINUM(x) (((x)<<2)+2L)
-#ifdef __STDC__ /* Forward decls for prototypes */
+/* Forward decls for prototypes */
struct value;
-#endif
-extern int scm_value_print PARAMS ((struct value *, GDB_FILE*,
- int, enum val_prettyprint));
+extern int scm_value_print (struct value *, struct ui_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 (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern LONGEST scm_get_field PARAMS ((LONGEST, int));
+extern LONGEST scm_get_field (LONGEST, int);
-extern void scm_scmval_print PARAMS ((LONGEST, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+extern void scm_scmval_print (LONGEST, struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int is_scmvalue_type PARAMS ((struct type*));
+extern int is_scmvalue_type (struct type *);
-extern void scm_printchar PARAMS ((int, GDB_FILE*));
+extern void scm_printchar (int, struct ui_file *);
-extern struct value * scm_evaluate_string PARAMS ((char*, int));
+extern struct value *scm_evaluate_string (char *, int);
extern struct type *builtin_type_scm;
-extern int scm_parse PARAMS ((void));
+extern int scm_parse (void);
-extern LONGEST scm_unpack PARAMS ((struct type *, char *, enum type_code));
+extern LONGEST scm_unpack (struct type *, char *, enum type_code);
diff --git a/contrib/gdb/gdb/scm-tags.h b/contrib/gdb/gdb/scm-tags.h
index fbe45cc..4fa5ce2 100644
--- a/contrib/gdb/gdb/scm-tags.h
+++ b/contrib/gdb/gdb/scm-tags.h
@@ -3,8 +3,8 @@
#ifndef TAGSH
#define TAGSH
-/* Copyright (C) 1995 Free Software Foundation, Inc.
- *
+/* Copyright 1995, 1999 Free Software Foundation, Inc.
+
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -48,37 +48,37 @@
/** This file defines the format of SCM values and cons pairs.
** It is here that tag bits are assigned for various purposes.
**/
-
+
/* 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.
*/
-
+
#define scm_tc3_cons 0
#define scm_tc3_cons_gloc 1
#define scm_tc3_closure 3
@@ -173,9 +173,9 @@
#define scm_tcs_symbols scm_tc7_ssymbol:case scm_tc7_msymbol
#define scm_tcs_bignums tc16_bigpos:case tc16_bigneg
-
+
/* 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 */
-
+
/* Immediate? Predicates
*/
#define SCM_IMP(x) (6 & (int)(x))
#define SCM_NIMP(x) (!SCM_IMP(x))
-
+
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)
+
-
/* 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))
-
+
/* Immediate Symbols, Special Symbols, Flags (various constants).
*/
@@ -287,22 +287,22 @@ enum scm_tags
#endif
#define SCM_UNSPECIFIED SCM_MAKIFLAG(SCM_NUM_ISYMS+5)
-
+
/* 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))
+
-
#define SCM_UNBNDP(x) (SCM_UNDEFINED==(x))
-
+
/* 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)
-
+
/* 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))
-
+
/* Two slightly extensible types: smobs and ptobs.
- *
+
*/
#define SCM_SMOBNUM(x) (0x0ff & (CAR(x)>>8));
#define SCM_PTOBNUM(x) (0x0ff & (CAR(x)>>8));
+
-
#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)))
-
+
/* Lvectors
*/
#define SCM_LVECTORP(x) (TYP7(x)==tc7_lvector)
-
+
#if 0
/* 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)
-
+
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)
-
+
#define SCM_MALLOCDATA(obj) ((char *)CDR(obj))
#define SCM_MALLOCLEN(obj) (((unsigned long)CAR (obj)) >> 16)
#define SCM_WORDDATA(obj) (CDR (obj))
@@ -368,18 +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
-
+
#define SCM_FREEP(x) (CAR(x)==tc_free_cell)
#define SCM_NFREEP(x) (!FREEP(x))
-#endif /* 0*/
+#endif /* 0 */
-#ifdef __STDC__
-
-#else /* STDC */
-
-#endif /* STDC */
-
-#endif /* TAGSH */
+#endif /* TAGSH */
diff --git a/contrib/gdb/gdb/scm-valprint.c b/contrib/gdb/gdb/scm-valprint.c
index 71acc69..737bafa 100644
--- a/contrib/gdb/gdb/scm-valprint.c
+++ b/contrib/gdb/gdb/scm-valprint.c
@@ -1,21 +1,23 @@
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,28 +31,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
/* FIXME: Should be in a header file that we import. */
-extern int
-c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-static void scm_ipruk PARAMS ((char *, LONGEST, GDB_FILE *));
-static void scm_scmlist_print PARAMS ((LONGEST, GDB_FILE *, int, int,
- int, enum val_prettyprint));
-static int scm_inferior_print PARAMS ((LONGEST, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+static void scm_ipruk (char *, LONGEST, struct ui_file *);
+static void scm_scmlist_print (LONGEST, struct ui_file *, int, int,
+ int, enum val_prettyprint);
+static int scm_inferior_print (LONGEST, struct ui_file *, int, int,
+ int, enum val_prettyprint);
/* Prints the SCM value VALUE by invoking the inferior, if appropraite.
Returns >= 0 on succes; retunr -1 if the inferior cannot/should not
print VALUE. */
static int
-scm_inferior_print (value, stream, format, deref_ref, recurse, pretty)
- LONGEST value;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+scm_inferior_print (LONGEST value, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
return -1;
}
@@ -95,13 +92,8 @@ static char *scm_isymnames[] =
};
static void
-scm_scmlist_print (svalue, stream, format, deref_ref, recurse, pretty)
- LONGEST svalue;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+scm_scmlist_print (LONGEST svalue, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
unsigned int more = print_max;
if (recurse > 6)
@@ -134,29 +126,21 @@ scm_scmlist_print (svalue, stream, format, deref_ref, recurse, pretty)
}
static void
-scm_ipruk (hdr, ptr, stream)
- char *hdr;
- LONGEST ptr;
- GDB_FILE *stream;
+scm_ipruk (char *hdr, LONGEST ptr, struct ui_file *stream)
{
fprintf_filtered (stream, "#<unknown-%s", hdr);
#define SCM_SIZE TYPE_LENGTH (builtin_type_scm)
if (SCM_CELLP (ptr))
fprintf_filtered (stream, " (0x%lx . 0x%lx) @",
(long) SCM_CAR (ptr), (long) SCM_CDR (ptr));
- fprintf_filtered (stream, " 0x%x>", ptr);
+ fprintf_filtered (stream, " 0x%s>", paddr_nz (ptr));
}
void
-scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
- LONGEST svalue;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+scm_scmval_print (LONGEST svalue, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
- taloop:
+taloop:
switch (7 & (int) svalue)
{
case 2:
@@ -210,13 +194,13 @@ 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);
+ fprintf_filtered (stream, " #X%s>", paddr_nz (svalue));
break;
}
case scm_tcs_cons_imcar:
@@ -248,7 +232,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 +251,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 +262,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 +283,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 +315,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
@@ -375,17 +359,9 @@ 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)
- 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;
+scm_val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
if (is_scmvalue_type (type))
{
@@ -397,7 +373,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);
@@ -411,11 +387,8 @@ scm_val_print (type, valaddr, embedded_offset, address,
}
int
-scm_value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+scm_value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
diff --git a/contrib/gdb/gdb/ser-pipe.c b/contrib/gdb/gdb/ser-pipe.c
new file mode 100644
index 0000000..bca0e54
--- /dev/null
+++ b/contrib/gdb/gdb/ser-pipe.c
@@ -0,0 +1,161 @@
+/* Serial interface for a pipe to a separate program
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Contributed by Cygnus Solutions.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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"
+#include "ser-unix.h"
+
+#include "gdb_vfork.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <fcntl.h>
+#include "gdb_string.h"
+
+#include <signal.h>
+
+static int pipe_open (struct serial *scb, const char *name);
+static void pipe_close (struct serial *scb);
+
+extern void _initialize_ser_pipe (void);
+
+struct pipe_state
+ {
+ int pid;
+ };
+
+/* Open up a raw pipe */
+
+static int
+pipe_open (struct serial *scb, const char *name)
+{
+#if !HAVE_SOCKETPAIR
+ return -1;
+#else
+ struct pipe_state *state;
+ /* This chunk: */
+ /* Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software written by Ken Arnold and
+ * published in UNIX Review, Vol. 6, No. 8.
+ */
+ int pdes[2];
+ int pid;
+ if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
+ return -1;
+
+ /* Create the child process to run the command in. Note that the
+ apparent call to vfork() below *might* actually be a call to
+ fork() due to the fact that autoconf will ``#define vfork fork''
+ on certain platforms. */
+ pid = vfork ();
+
+ /* Error. */
+ if (pid == -1)
+ {
+ close (pdes[0]);
+ close (pdes[1]);
+ return -1;
+ }
+
+ /* Child. */
+ if (pid == 0)
+ {
+ /* re-wire pdes[1] to stdin/stdout */
+ close (pdes[0]);
+ if (pdes[1] != STDOUT_FILENO)
+ {
+ dup2 (pdes[1], STDOUT_FILENO);
+ close (pdes[1]);
+ }
+ dup2 (STDOUT_FILENO, STDIN_FILENO);
+#if 0
+ /* close any stray FD's - FIXME - how? */
+ /* POSIX.2 B.3.2.2 "popen() shall ensure that any streams
+ from previous popen() calls that remain open in the
+ parent process are closed in the new child process. */
+ for (old = pidlist; old; old = old->next)
+ close (fileno (old->fp)); /* don't allow a flush */
+#endif
+ execl ("/bin/sh", "sh", "-c", name, NULL);
+ _exit (127);
+ }
+
+ /* Parent. */
+ close (pdes[1]);
+ /* :end chunk */
+ state = XMALLOC (struct pipe_state);
+ state->pid = pid;
+ scb->fd = pdes[0];
+ scb->state = state;
+
+ /* If we don't do this, GDB simply exits when the remote side dies. */
+ signal (SIGPIPE, SIG_IGN);
+ return 0;
+#endif
+}
+
+static void
+pipe_close (struct serial *scb)
+{
+ struct pipe_state *state = scb->state;
+ if (state != NULL)
+ {
+ int pid = state->pid;
+ close (scb->fd);
+ scb->fd = -1;
+ xfree (state);
+ scb->state = NULL;
+ kill (pid, SIGTERM);
+ /* Might be useful to check that the child does die. */
+ }
+}
+
+static struct serial_ops pipe_ops;
+
+void
+_initialize_ser_pipe (void)
+{
+ struct serial_ops *ops = XMALLOC (struct serial_ops);
+ memset (ops, sizeof (struct serial_ops), 0);
+ ops->name = "pipe";
+ ops->next = 0;
+ ops->open = pipe_open;
+ ops->close = pipe_close;
+ ops->readchar = ser_unix_readchar;
+ ops->write = ser_unix_write;
+ ops->flush_output = ser_unix_nop_flush_output;
+ ops->flush_input = ser_unix_flush_input;
+ ops->send_break = ser_unix_nop_send_break;
+ ops->go_raw = ser_unix_nop_raw;
+ ops->get_tty_state = ser_unix_nop_get_tty_state;
+ ops->set_tty_state = ser_unix_nop_set_tty_state;
+ ops->print_tty_state = ser_unix_nop_print_tty_state;
+ ops->noflush_set_tty_state = ser_unix_nop_noflush_set_tty_state;
+ ops->setbaudrate = ser_unix_nop_setbaudrate;
+ ops->setstopbits = ser_unix_nop_setstopbits;
+ ops->drain_output = ser_unix_nop_drain_output;
+ ops->async = ser_unix_async;
+ serial_add_interface (ops);
+}
diff --git a/contrib/gdb/gdb/ser-tcp.c b/contrib/gdb/gdb/ser-tcp.c
index c551337..6dc8284 100644
--- a/contrib/gdb/gdb/ser-tcp.c
+++ b/contrib/gdb/gdb/ser-tcp.c
@@ -1,89 +1,82 @@
/* Serial interface for raw TCP connections on Un*x like systems
- Copyright 1992, 1993, 1998 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
+#include "ser-unix.h"
+
#include <sys/types.h>
+
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h> /* For FIONBIO. */
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h> /* For FIONBIO. */
+#endif
+
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
-
-#ifndef __CYGWIN32__
#include <netinet/tcp.h>
-#endif
-#include "signals.h"
+#include <signal.h>
#include "gdb_string.h"
-struct tcp_ttystate
-{
- int bogus;
-};
-
-static int tcp_open PARAMS ((serial_t scb, const char *name));
-static void tcp_raw PARAMS ((serial_t scb));
-static int wait_for PARAMS ((serial_t scb, int timeout));
-static int tcp_readchar PARAMS ((serial_t scb, int timeout));
-static int tcp_setbaudrate PARAMS ((serial_t scb, int rate));
-static int tcp_setstopbits PARAMS ((serial_t scb, int num));
-static int tcp_write PARAMS ((serial_t scb, const char *str, int len));
-/* FIXME: static void tcp_restore PARAMS ((serial_t scb)); */
-static void tcp_close PARAMS ((serial_t scb));
-static serial_ttystate tcp_get_tty_state PARAMS ((serial_t scb));
-static int tcp_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
-static int tcp_return_0 PARAMS ((serial_t));
-static int tcp_noflush_set_tty_state PARAMS ((serial_t, serial_ttystate,
- serial_ttystate));
-static void tcp_print_tty_state PARAMS ((serial_t, serial_ttystate));
+static int tcp_open (struct serial *scb, const char *name);
+static void tcp_close (struct serial *scb);
+extern int (*ui_loop_hook) (int);
+void _initialize_ser_tcp (void);
-void _initialize_ser_tcp PARAMS ((void));
+/* seconds to wait for connect */
+#define TIMEOUT 15
+/* how many times per second to poll ui_loop_hook */
+#define POLL_INTERVAL 2
-/* Open up a raw tcp socket */
+/* Open a tcp socket */
static int
-tcp_open(scb, name)
- serial_t scb;
- const char *name;
+tcp_open (struct serial *scb, const char *name)
{
- char *port_str;
- int port;
+ char *port_str, hostname[100];
+ int n, port, tmp;
struct hostent *hostent;
struct sockaddr_in sockaddr;
- int tmp;
- char hostname[100];
- struct protoent *protoent;
- int i;
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);
- hostent = gethostbyname (hostname);
+ /* default hostname is localhost */
+ if (!hostname[0])
+ strcpy (hostname, "localhost");
+ hostent = gethostbyname (hostname);
if (!hostent)
{
fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname);
@@ -91,268 +84,131 @@ tcp_open(scb, name)
return -1;
}
- for (i = 1; i <= 15; i++)
- {
- scb->fd = socket (PF_INET, SOCK_STREAM, 0);
- if (scb->fd < 0)
- return -1;
-
- /* Allow rapid reuse of this port. */
- tmp = 1;
- 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));
-
- sockaddr.sin_family = PF_INET;
- 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)))
- break;
-
- close (scb->fd);
- scb->fd = -1;
-
-/* We retry for ECONNREFUSED because that is often a temporary condition, which
- happens when the server is being restarted. */
-
- if (errno != ECONNREFUSED)
- return -1;
-
- sleep (1);
- }
-
- protoent = getprotobyname ("tcp");
- if (!protoent)
+ scb->fd = socket (PF_INET, SOCK_STREAM, 0);
+ if (scb->fd < 0)
return -1;
+
+ sockaddr.sin_family = PF_INET;
+ sockaddr.sin_port = htons (port);
+ memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr,
+ sizeof (struct in_addr));
+ /* set socket nonblocking */
tmp = 1;
- if (setsockopt (scb->fd, protoent->p_proto, TCP_NODELAY,
- (char *)&tmp, sizeof(tmp)))
- return -1;
-
- 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)
- serial_t scb;
-{
- struct tcp_ttystate *state;
-
- state = (struct tcp_ttystate *)xmalloc(sizeof *state);
-
- return (serial_ttystate)state;
-}
-
-static int
-tcp_set_tty_state(scb, ttystate)
- serial_t scb;
- serial_ttystate ttystate;
-{
- struct tcp_ttystate *state;
-
- state = (struct tcp_ttystate *)ttystate;
-
- return 0;
-}
-
-static int
-tcp_return_0 (scb)
- serial_t scb;
-{
- return 0;
-}
-
-static void
-tcp_raw(scb)
- serial_t scb;
-{
- return; /* Always in raw mode */
-}
+ ioctl (scb->fd, FIONBIO, &tmp);
-/* Wait for input on scb, with timeout seconds. Returns 0 on success,
- otherwise SERIAL_TIMEOUT or SERIAL_ERROR.
+ /* Use Non-blocking connect. connect() will return 0 if connected already. */
+ n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr));
- For termio{s}, we actually just setup VTIME if necessary, and let the
- timeout occur in the read() in tcp_read().
- */
-
-static int
-wait_for (scb, timeout)
- serial_t scb;
- int timeout;
-{
- int numfds;
- struct timeval tv;
- fd_set readfds, exceptfds;
-
- FD_ZERO (&readfds);
- FD_ZERO (&exceptfds);
-
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
- FD_SET(scb->fd, &readfds);
- FD_SET(scb->fd, &exceptfds);
-
- while (1)
+ if (n < 0 && errno != EINPROGRESS)
{
- if (timeout >= 0)
- numfds = select(scb->fd+1, &readfds, 0, &exceptfds, &tv);
- else
- 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;
- }
-}
-
-/* Read a character with user-specified timeout. TIMEOUT is number of seconds
- to wait, or -1 to wait forever. Use timeout of 0 to effect a poll. Returns
- char if successful. Returns -2 if timeout expired, EOF if line dropped
- dead, or -3 for any other error (see errno in that case). */
-
-static int
-tcp_readchar (scb, timeout)
- serial_t scb;
- int timeout;
-{
- int status;
-
- if (scb->bufcnt-- > 0)
- return *scb->bufp++;
-
- status = wait_for(scb, timeout);
-
- if (status < 0)
- return status;
-
- while (1)
- {
- scb->bufcnt = read(scb->fd, scb->buf, BUFSIZ);
- if (scb->bufcnt != -1 || errno != EINTR)
- break;
+ tcp_close (scb);
+ return -1;
}
- if (scb->bufcnt <= 0)
+ if (n)
{
- if (scb->bufcnt == 0)
- return SERIAL_TIMEOUT; /* 0 chars means timeout [may need to
- distinguish between EOF & timeouts
- someday] */
- else
- return SERIAL_ERROR; /* Got an error from read */
+ /* looks like we need to wait for the connect */
+ struct timeval t;
+ fd_set rset, wset;
+ int polls = 0;
+ FD_ZERO (&rset);
+
+ do
+ {
+ /* While we wait for the connect to complete
+ poll the UI so it can update or the user can
+ interrupt. */
+ if (ui_loop_hook)
+ {
+ if (ui_loop_hook (0))
+ {
+ errno = EINTR;
+ tcp_close (scb);
+ return -1;
+ }
+ }
+
+ FD_SET (scb->fd, &rset);
+ wset = rset;
+ t.tv_sec = 0;
+ t.tv_usec = 1000000 / POLL_INTERVAL;
+
+ n = select (scb->fd + 1, &rset, &wset, NULL, &t);
+ polls++;
+ }
+ while (n == 0 && polls <= TIMEOUT * POLL_INTERVAL);
+ if (n < 0 || polls > TIMEOUT * POLL_INTERVAL)
+ {
+ if (polls > TIMEOUT * POLL_INTERVAL)
+ errno = ETIMEDOUT;
+ tcp_close (scb);
+ return -1;
+ }
}
- scb->bufcnt--;
- scb->bufp = scb->buf;
- return *scb->bufp++;
-}
-
-static int
-tcp_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
- serial_t scb;
- serial_ttystate new_ttystate;
- serial_ttystate old_ttystate;
-{
- return 0;
-}
-
-static void
-tcp_print_tty_state (scb, ttystate)
- serial_t scb;
- serial_ttystate ttystate;
-{
- /* Nothing to print. */
- return;
-}
-
-static int
-tcp_setbaudrate(scb, rate)
- serial_t scb;
- int rate;
-{
- return 0; /* Never fails! */
-}
-
-static int
-tcp_setstopbits(scb, num)
- serial_t scb;
- int num;
-{
- return 0; /* Never fails! */
-}
-
-static int
-tcp_write(scb, str, len)
- serial_t scb;
- const char *str;
- int len;
-{
- int cc;
-
- while (len > 0)
- {
- cc = write(scb->fd, str, len);
+ /* Got something. Is it an error? */
+ {
+ int res, err, len;
+ len = sizeof(err);
+ res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, &err, &len);
+ if (res < 0 || err)
+ {
+ if (err)
+ errno = err;
+ tcp_close (scb);
+ return -1;
+ }
+ }
+
+ /* turn off nonblocking */
+ tmp = 0;
+ ioctl (scb->fd, FIONBIO, &tmp);
+
+ /* Disable Nagle algorithm. Needed in some cases. */
+ tmp = 1;
+ setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY,
+ (char *)&tmp, sizeof (tmp));
+
+ /* If we don't do this, then GDB simply exits
+ when the remote side dies. */
+ signal (SIGPIPE, SIG_IGN);
- if (cc < 0)
- return 1;
- len -= cc;
- str += cc;
- }
return 0;
}
static void
-tcp_close(scb)
- serial_t scb;
+tcp_close (struct serial *scb)
{
if (scb->fd < 0)
return;
- close(scb->fd);
+ close (scb->fd);
scb->fd = -1;
}
-static struct serial_ops tcp_ops =
-{
- "tcp",
- 0,
- tcp_open,
- tcp_close,
- tcp_readchar,
- tcp_write,
- 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,
- tcp_print_tty_state,
- tcp_noflush_set_tty_state,
- tcp_setbaudrate,
- tcp_setstopbits,
- tcp_return_0, /* wait for output to drain */
-};
-
void
-_initialize_ser_tcp ()
-{
- serial_add_interface (&tcp_ops);
+_initialize_ser_tcp (void)
+{
+ struct serial_ops *ops = XMALLOC (struct serial_ops);
+ memset (ops, sizeof (struct serial_ops), 0);
+ ops->name = "tcp";
+ ops->next = 0;
+ ops->open = tcp_open;
+ ops->close = tcp_close;
+ ops->readchar = ser_unix_readchar;
+ ops->write = ser_unix_write;
+ ops->flush_output = ser_unix_nop_flush_output;
+ ops->flush_input = ser_unix_flush_input;
+ ops->send_break = ser_unix_nop_send_break;
+ ops->go_raw = ser_unix_nop_raw;
+ ops->get_tty_state = ser_unix_nop_get_tty_state;
+ ops->set_tty_state = ser_unix_nop_set_tty_state;
+ ops->print_tty_state = ser_unix_nop_print_tty_state;
+ ops->noflush_set_tty_state = ser_unix_nop_noflush_set_tty_state;
+ ops->setbaudrate = ser_unix_nop_setbaudrate;
+ ops->setstopbits = ser_unix_nop_setstopbits;
+ ops->drain_output = ser_unix_nop_drain_output;
+ ops->async = ser_unix_async;
+ serial_add_interface (ops);
}
diff --git a/contrib/gdb/gdb/ser-unix.h b/contrib/gdb/gdb/ser-unix.h
new file mode 100644
index 0000000..861694f
--- /dev/null
+++ b/contrib/gdb/gdb/ser-unix.h
@@ -0,0 +1,53 @@
+/* Serial interface for UN*X file-descriptor based connection.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef SER_UNIX_H
+#define SER_UNIX_H
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+/* Generic UNIX/FD functions */
+
+extern int ser_unix_nop_flush_output (struct serial *scb);
+extern int ser_unix_flush_input (struct serial *scb);
+extern int ser_unix_nop_send_break (struct serial *scb);
+extern void ser_unix_nop_raw (struct serial *scb);
+extern serial_ttystate ser_unix_nop_get_tty_state (struct serial *scb);
+extern int ser_unix_nop_set_tty_state (struct serial *scb,
+ serial_ttystate ttystate);
+extern void ser_unix_nop_print_tty_state (struct serial *scb,
+ serial_ttystate ttystate,
+ struct ui_file *stream);
+extern int ser_unix_nop_noflush_set_tty_state (struct serial *scb,
+ serial_ttystate new_ttystate,
+ serial_ttystate old_ttystate);
+extern int ser_unix_nop_setbaudrate (struct serial *scb, int rate);
+extern int ser_unix_nop_setstopbits (struct serial *scb, int rate);
+extern int ser_unix_nop_drain_output (struct serial *scb);
+
+extern int ser_unix_wait_for (struct serial *scb, int timeout);
+extern int ser_unix_readchar (struct serial *scb, int timeout);
+
+extern int ser_unix_write (struct serial *scb, const char *str, int len);
+
+extern void ser_unix_async (struct serial *scb, int async_p);
+
+#endif
diff --git a/contrib/gdb/gdb/serial.c b/contrib/gdb/gdb/serial.c
index ce420ee..22964eb 100644
--- a/contrib/gdb/gdb/serial.c
+++ b/contrib/gdb/gdb/serial.c
@@ -1,21 +1,24 @@
/* Generic serial interface routines
- Copyright 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ 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 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 <ctype.h>
@@ -23,33 +26,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_string.h"
#include "gdbcmd.h"
+extern void _initialize_serial (void);
+
+/* Is serial being debugged? */
+
+static int global_serial_debug_p;
+
/* Linked list of serial I/O handlers */
static struct serial_ops *serial_ops_list = NULL;
/* This is the last serial stream opened. Used by connect command. */
-static serial_t last_serial_opened = NULL;
+static struct serial *last_serial_opened = NULL;
/* Pointer to list of scb's. */
-static serial_t scb_base;
+static struct serial *scb_base;
/* Non-NULL gives filename which contains a recording of the remote session,
suitable for playback by gdbserver. */
static char *serial_logfile = NULL;
-static GDB_FILE *serial_logfp = NULL;
-
-static struct serial_ops *serial_interface_lookup PARAMS ((char *));
-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 *serial_logbase = logbase_ascii;
-
+static struct ui_file *serial_logfp = NULL;
+
+static struct serial_ops *serial_interface_lookup (char *);
+static void serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout);
+static const char logbase_hex[] = "hex";
+static const char logbase_octal[] = "octal";
+static const char logbase_ascii[] = "ascii";
+static const char *logbase_enums[] =
+{logbase_hex, logbase_octal, logbase_ascii, NULL};
+static const char *serial_logbase = logbase_ascii;
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
static int serial_current_type = 0;
/* Log char CH of type CHTYPE, with TIMEOUT */
@@ -59,57 +72,69 @@ static int serial_current_type = 0;
#define SERIAL_BREAK 1235
static void
-serial_logchar (ch_type, ch, timeout)
- int ch_type;
- int ch;
- int timeout;
+serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout)
{
if (ch_type != serial_current_type)
{
- fprintf_unfiltered (serial_logfp, "\n%c ", ch_type);
+ fprintf_unfiltered (stream, "\n%c ", ch_type);
serial_current_type = ch_type;
}
if (serial_logbase != logbase_ascii)
- fputc_unfiltered (' ', serial_logfp);
+ fputc_unfiltered (' ', stream);
switch (ch)
{
case SERIAL_TIMEOUT:
- fprintf_unfiltered (serial_logfp, "<Timeout: %d seconds>", timeout);
+ fprintf_unfiltered (stream, "<Timeout: %d seconds>", timeout);
return;
case SERIAL_ERROR:
- fprintf_unfiltered (serial_logfp, "<Error: %s>", safe_strerror (errno));
+ fprintf_unfiltered (stream, "<Error: %s>", safe_strerror (errno));
return;
case SERIAL_EOF:
- fputs_unfiltered ("<Eof>", serial_logfp);
+ fputs_unfiltered ("<Eof>", stream);
return;
case SERIAL_BREAK:
- fputs_unfiltered ("<Break>", serial_logfp);
+ fputs_unfiltered ("<Break>", stream);
return;
default:
if (serial_logbase == logbase_hex)
- fprintf_unfiltered (serial_logfp, "%02x", ch & 0xff);
+ fprintf_unfiltered (stream, "%02x", ch & 0xff);
else if (serial_logbase == logbase_octal)
- fprintf_unfiltered (serial_logfp, "%03o", ch & 0xff);
+ fprintf_unfiltered (stream, "%03o", ch & 0xff);
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 ("\\\\", stream);
+ break;
+ case '\b':
+ fputs_unfiltered ("\\b", stream);
+ break;
+ case '\f':
+ fputs_unfiltered ("\\f", stream);
+ break;
+ case '\n':
+ fputs_unfiltered ("\\n", stream);
+ break;
+ case '\r':
+ fputs_unfiltered ("\\r", stream);
+ break;
+ case '\t':
+ fputs_unfiltered ("\\t", stream);
+ break;
+ case '\v':
+ fputs_unfiltered ("\\v", stream);
+ break;
+ default:
+ fprintf_unfiltered (stream, isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF);
+ break;
}
}
}
void
-serial_log_command (cmd)
- const char *cmd;
+serial_log_command (const char *cmd)
{
if (!serial_logfp)
return;
@@ -124,60 +149,9 @@ serial_log_command (cmd)
gdb_flush (serial_logfp);
}
-int
-serial_write (scb, str, len)
- serial_t scb;
- const char *str;
- int len;
-{
- if (serial_logfp != NULL)
- {
- int count;
-
- for (count = 0; count < len; count++)
- 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. */
- gdb_flush (serial_logfp);
- }
-
- return (scb -> ops -> write (scb, str, len));
-}
-
-int
-serial_readchar (scb, timeout)
- serial_t scb;
- int timeout;
-{
- int ch;
-
- 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. */
- gdb_flush (serial_logfp);
- }
-
- return (ch);
-}
-
-int
-serial_send_break (scb)
- serial_t scb;
-{
- if (serial_logfp != NULL)
- serial_logchar ('w', SERIAL_BREAK, 0);
-
- return (scb -> ops -> send_break (scb));
-}
-
+
static struct serial_ops *
-serial_interface_lookup (name)
- char *name;
+serial_interface_lookup (char *name)
{
struct serial_ops *ops;
@@ -189,8 +163,7 @@ serial_interface_lookup (name)
}
void
-serial_add_interface(optable)
- struct serial_ops *optable;
+serial_add_interface (struct serial_ops *optable)
{
optable->next = serial_ops_list;
serial_ops_list = optable;
@@ -198,12 +171,12 @@ serial_add_interface(optable)
/* Open up a device or a network socket, depending upon the syntax of NAME. */
-serial_t
-serial_open (name)
- const char *name;
+struct serial *
+serial_open (const char *name)
{
- serial_t scb;
+ struct serial *scb;
struct serial_ops *ops;
+ const char *open_name = name;
for (scb = scb_base; scb; scb = scb->next)
if (scb->name && strcmp (scb->name, name) == 0)
@@ -212,36 +185,43 @@ serial_open (name)
return scb;
}
- if (strcmp (name, "ocd") == 0)
- ops = serial_interface_lookup ("ocd");
- else if (strcmp (name, "pc") == 0)
+ if (strcmp (name, "pc") == 0)
ops = serial_interface_lookup ("pc");
else if (strchr (name, ':'))
ops = serial_interface_lookup ("tcp");
else if (strncmp (name, "lpt", 3) == 0)
ops = serial_interface_lookup ("parallel");
+ else if (strncmp (name, "|", 1) == 0)
+ {
+ ops = serial_interface_lookup ("pipe");
+ open_name = name + 1; /* discard ``|'' */
+ }
else
ops = serial_interface_lookup ("hardwire");
if (!ops)
return NULL;
- scb = (serial_t)xmalloc (sizeof (struct _serial_t));
+ scb = XMALLOC (struct serial);
scb->ops = ops;
scb->bufcnt = 0;
scb->bufp = scb->buf;
- if (scb->ops->open(scb, name))
+ if (scb->ops->open (scb, open_name))
{
- free (scb);
+ xfree (scb);
return NULL;
}
- scb->name = strsave (name);
+ scb->name = xstrdup (name);
scb->next = scb_base;
scb->refcnt = 1;
+ scb->debug_p = 0;
+ scb->async_state = 0;
+ scb->async_handler = NULL;
+ scb->async_context = NULL;
scb_base = scb;
last_serial_opened = scb;
@@ -256,11 +236,10 @@ serial_open (name)
return scb;
}
-serial_t
-serial_fdopen (fd)
- const int fd;
+struct serial *
+serial_fdopen (const int fd)
{
- serial_t scb;
+ struct serial *scb;
struct serial_ops *ops;
for (scb = scb_base; scb; scb = scb->next)
@@ -275,7 +254,7 @@ serial_fdopen (fd)
if (!ops)
return NULL;
- scb = (serial_t)xmalloc (sizeof (struct _serial_t));
+ scb = XMALLOC (struct serial);
scb->ops = ops;
@@ -287,6 +266,10 @@ serial_fdopen (fd)
scb->name = NULL;
scb->next = scb_base;
scb->refcnt = 1;
+ scb->debug_p = 0;
+ scb->async_state = 0;
+ scb->async_handler = NULL;
+ scb->async_context = NULL;
scb_base = scb;
last_serial_opened = scb;
@@ -294,12 +277,10 @@ serial_fdopen (fd)
return scb;
}
-void
-serial_close (scb, really_close)
- serial_t scb;
- int really_close;
+static void
+do_serial_close (struct serial *scb, int really_close)
{
- serial_t tmp_scb;
+ struct serial *tmp_scb;
last_serial_opened = NULL;
@@ -309,7 +290,7 @@ serial_close (scb, really_close)
serial_current_type = 0;
/* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
- gdb_fclose (&serial_logfp);
+ ui_file_delete (serial_logfp);
serial_logfp = NULL;
}
@@ -323,11 +304,15 @@ serial_close (scb, really_close)
if (scb->refcnt > 0)
return;
+ /* ensure that the FD has been taken out of async mode */
+ if (scb->async_handler != NULL)
+ serial_async (scb, NULL, NULL);
+
if (really_close)
scb->ops->close (scb);
if (scb->name)
- free (scb->name);
+ xfree (scb->name);
if (scb_base == scb)
scb_base = scb_base->next;
@@ -341,65 +326,259 @@ serial_close (scb, really_close)
break;
}
- free(scb);
+ xfree (scb);
+}
+
+void
+serial_close (struct serial *scb)
+{
+ do_serial_close (scb, 1);
+}
+
+void
+serial_un_fdopen (struct serial *scb)
+{
+ do_serial_close (scb, 0);
+}
+
+int
+serial_readchar (struct serial *scb, int timeout)
+{
+ int ch;
+
+ /* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC
+ code is finished. */
+ if (0 && serial_is_async_p (scb) && timeout < 0)
+ internal_error (__FILE__, __LINE__,
+ "serial_readchar: blocking read in async mode");
+
+ ch = scb->ops->readchar (scb, timeout);
+ if (serial_logfp != NULL)
+ {
+ serial_logchar (serial_logfp, '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. */
+ gdb_flush (serial_logfp);
+ }
+ if (serial_debug_p (scb))
+ {
+ fprintf_unfiltered (gdb_stdlog, "[");
+ serial_logchar (gdb_stdlog, 'r', ch, timeout);
+ fprintf_unfiltered (gdb_stdlog, "]");
+ gdb_flush (gdb_stdlog);
+ }
+
+ return (ch);
+}
+
+int
+serial_write (struct serial *scb, const char *str, int len)
+{
+ if (serial_logfp != NULL)
+ {
+ int count;
+
+ for (count = 0; count < len; count++)
+ serial_logchar (serial_logfp, '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. */
+ gdb_flush (serial_logfp);
+ }
+
+ return (scb->ops->write (scb, str, len));
+}
+
+void
+serial_printf (struct serial *desc, const char *format,...)
+{
+ va_list args;
+ char *buf;
+ va_start (args, format);
+
+ xvasprintf (&buf, format, args);
+ serial_write (desc, buf, strlen (buf));
+
+ xfree (buf);
+ va_end (args);
+}
+
+int
+serial_drain_output (struct serial *scb)
+{
+ return scb->ops->drain_output (scb);
+}
+
+int
+serial_flush_output (struct serial *scb)
+{
+ return scb->ops->flush_output (scb);
+}
+
+int
+serial_flush_input (struct serial *scb)
+{
+ return scb->ops->flush_input (scb);
+}
+
+int
+serial_send_break (struct serial *scb)
+{
+ if (serial_logfp != NULL)
+ serial_logchar (serial_logfp, 'w', SERIAL_BREAK, 0);
+
+ return (scb->ops->send_break (scb));
+}
+
+void
+serial_raw (struct serial *scb)
+{
+ scb->ops->go_raw (scb);
+}
+
+serial_ttystate
+serial_get_tty_state (struct serial *scb)
+{
+ return scb->ops->get_tty_state (scb);
+}
+
+int
+serial_set_tty_state (struct serial *scb, serial_ttystate ttystate)
+{
+ return scb->ops->set_tty_state (scb, ttystate);
+}
+
+void
+serial_print_tty_state (struct serial *scb,
+ serial_ttystate ttystate,
+ struct ui_file *stream)
+{
+ scb->ops->print_tty_state (scb, ttystate, stream);
+}
+
+int
+serial_noflush_set_tty_state (struct serial *scb,
+ serial_ttystate new_ttystate,
+ serial_ttystate old_ttystate)
+{
+ return scb->ops->noflush_set_tty_state (scb, new_ttystate, old_ttystate);
+}
+
+int
+serial_setbaudrate (struct serial *scb, int rate)
+{
+ return scb->ops->setbaudrate (scb, rate);
+}
+
+int
+serial_setstopbits (struct serial *scb, int num)
+{
+ return scb->ops->setstopbits (scb, num);
}
+int
+serial_can_async_p (struct serial *scb)
+{
+ return (scb->ops->async != NULL);
+}
+
+int
+serial_is_async_p (struct serial *scb)
+{
+ return (scb->ops->async != NULL) && (scb->async_handler != NULL);
+}
+
+void
+serial_async (struct serial *scb,
+ serial_event_ftype *handler,
+ void *context)
+{
+ /* Only change mode if there is a need. */
+ if ((scb->async_handler == NULL)
+ != (handler == NULL))
+ scb->ops->async (scb, handler != NULL);
+ scb->async_handler = handler;
+ scb->async_context = context;
+}
+
+int
+deprecated_serial_fd (struct serial *scb)
+{
+ /* FIXME: should this output a warning that deprecated code is being
+ called? */
+ if (scb->fd < 0)
+ {
+ internal_error (__FILE__, __LINE__,
+ "serial: FD not valid");
+ }
+ return scb->fd; /* sigh */
+}
+
+void
+serial_debug (struct serial *scb, int debug_p)
+{
+ scb->debug_p = debug_p;
+}
+
+int
+serial_debug_p (struct serial *scb)
+{
+ return scb->debug_p || global_serial_debug_p;
+}
+
+
#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:
-
- 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
-*/
+/* The connect command is #if 0 because I hadn't thought of an elegant
+ way to wait for I/O on two `struct serial *'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.
+
+ 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 struct serial *tty_desc; /* Controlling terminal */
static void
-cleanup_tty(ttystate)
- serial_ttystate ttystate;
+cleanup_tty (serial_ttystate ttystate)
{
printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
- SERIAL_SET_TTY_STATE (tty_desc, ttystate);
- free (ttystate);
- SERIAL_CLOSE (tty_desc);
+ serial_set_tty_state (tty_desc, ttystate);
+ xfree (ttystate);
+ serial_close (tty_desc);
}
static void
-connect_command (args, fromtty)
- char *args;
- int fromtty;
+connect_command (char *args, int fromtty)
{
int c;
char cur_esc = 0;
serial_ttystate ttystate;
- serial_t port_desc; /* TTY port */
+ struct serial *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);
+ tty_desc = serial_fdopen (0);
port_desc = last_serial_opened;
- ttystate = SERIAL_GET_TTY_STATE (tty_desc);
+ ttystate = serial_get_tty_state (tty_desc);
- SERIAL_RAW (tty_desc);
- SERIAL_RAW (port_desc);
+ serial_raw (tty_desc);
+ serial_raw (port_desc);
make_cleanup (cleanup_tty, ttystate);
@@ -407,7 +586,7 @@ connect_command (args, fromtty)
{
int mask;
- mask = SERIAL_WAIT_2 (tty_desc, port_desc, -1);
+ mask = serial_wait_2 (tty_desc, port_desc, -1);
if (mask & 2)
{ /* tty input */
@@ -415,16 +594,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)
{
@@ -453,54 +632,44 @@ 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);
}
}
}
}
#endif /* 0 */
-/* VARARGS */
-void
-#ifdef ANSI_PROTOTYPES
-serial_printf (serial_t desc, const char *format, ...)
-#else
-serial_printf (va_alist)
- va_dcl
-#endif
-{
- va_list args;
- char *buf;
-#ifdef ANSI_PROTOTYPES
- va_start (args, format);
-#else
- serial_t desc;
- char *format;
+/* Serial set/show framework. */
- va_start (args);
- desc = va_arg (args, serial_t);
- format = va_arg (args, char *);
-#endif
+static struct cmd_list_element *serial_set_cmdlist;
+static struct cmd_list_element *serial_show_cmdlist;
- vasprintf (&buf, format, args);
- SERIAL_WRITE (desc, buf, strlen (buf));
+static void
+serial_set_cmd (char *args, int from_tty)
+{
+ printf_unfiltered ("\"set serial\" must be followed by the name of a command.\n");
+ help_list (serial_set_cmdlist, "set serial ", -1, gdb_stdout);
+}
- free (buf);
- va_end (args);
+static void
+serial_show_cmd (char *args, int from_tty)
+{
+ cmd_show_list (serial_show_cmdlist, from_tty, "");
}
+
void
-_initialize_serial ()
+_initialize_serial (void)
{
#if 0
add_com ("connect", class_obscure, connect_command,
@@ -508,19 +677,39 @@ _initialize_serial ()
Use <CR>~. or <CR>~^D to break out.");
#endif /* 0 */
- add_show_from_set
+ add_prefix_cmd ("serial", class_maintenance, serial_set_cmd, "\
+Set default serial/parallel port configuration.",
+ &serial_set_cmdlist, "set serial ",
+ 0/*allow-unknown*/,
+ &setlist);
+
+ add_prefix_cmd ("serial", class_maintenance, serial_show_cmd, "\
+Show default serial/parallel port configuration.",
+ &serial_show_cmdlist, "show serial ",
+ 0/*allow-unknown*/,
+ &showlist);
+
+ 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,
+ logbase_enums, &serial_logbase,
"Set numerical base for remote session logging",
&setlist),
&showlist);
+
+ add_show_from_set (add_set_cmd ("serial",
+ class_maintenance,
+ var_zinteger,
+ (char *)&global_serial_debug_p,
+ "Set serial debugging.\n\
+When non-zero, serial port debugging is enabled.", &setdebuglist),
+ &showdebuglist);
}
diff --git a/contrib/gdb/gdb/serial.h b/contrib/gdb/gdb/serial.h
index 04332bc..97d68f3 100644
--- a/contrib/gdb/gdb/serial.h
+++ b/contrib/gdb/gdb/serial.h
@@ -1,191 +1,241 @@
/* Remote serial support interface definitions for GDB, the GNU Debugger.
- Copyright 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
-/* Terminal state pointer. This is specific to each type of interface. */
-
-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 */
-};
+/* For most routines, if a failure is indicated, then errno should be
+ examined. */
-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));
-};
+/* Terminal state pointer. This is specific to each type of
+ interface. */
-/* Add a new serial interface to the interface list */
+typedef void *serial_ttystate;
+struct serial;
-void serial_add_interface PARAMS ((struct serial_ops *optable));
+/* Try to open NAME. Returns a new `struct serial *' on success, NULL
+ on failure. Note that some open calls can block and, if possible,
+ should be written to be non-blocking, with calls to ui_look_hook
+ so they can be cancelled. An async interface for open could be
+ added to GDB if necessary. */
-serial_t serial_open PARAMS ((const char *name));
+extern struct serial *serial_open (const char *name);
-serial_t serial_fdopen PARAMS ((const int fd));
+/* Open a new serial stream using a file handle. */
-/* For most routines, if a failure is indicated, then errno should be
- examined. */
+extern struct serial *serial_fdopen (const int fd);
-/* Try to open NAME. Returns a new serial_t on success, NULL on failure.
- */
+/* Push out all buffers, close the device and destroy SCB. */
-#define SERIAL_OPEN(NAME) serial_open(NAME)
+extern void serial_close (struct serial *scb);
-/* Open a new serial stream using a file handle. */
+/* Push out all buffers and destroy SCB without closing the device. */
+
+extern void serial_un_fdopen (struct serial *scb);
+
+/* Read one char from the serial device with TIMEOUT seconds to wait
+ or -1 to wait forever. Use timeout of 0 to effect a poll.
+ Infinite waits are not permitted. Returns unsigned char if ok, else
+ one of the following codes. Note that all error return-codes are
+ guaranteed to be < 0. */
+
+enum serial_rc {
+ SERIAL_ERROR = -1, /* General error. */
+ SERIAL_TIMEOUT = -2, /* Timeout or data-not-ready during read.
+ Unfortunately, through ui_loop_hook(), this
+ can also be a QUIT indication. */
+ SERIAL_EOF = -3 /* General end-of-file or remote target
+ connection closed, indication. Includes
+ things like the line dropping dead. */
+};
+
+extern int serial_readchar (struct serial *scb, int timeout);
+
+/* Write LEN chars from STRING to the port SCB. Returns 0 for
+ success, non-zero for failure. */
+
+extern int serial_write (struct serial *scb, const char *str, int len);
+
+/* Write a printf style string onto the serial port. */
-#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
+extern void serial_printf (struct serial *desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
/* Allow pending output to drain. */
-#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). */
+extern int serial_drain_output (struct serial *);
-#define SERIAL_FLUSH_OUTPUT(SERIAL_T) \
- ((SERIAL_T)->ops->flush_output((SERIAL_T)))
+/* Flush (discard) pending output. Might also flush input (if this
+ system can't flush only output). */
-/* Flush pending input. Might also flush output (if this system can't flush
- only input). */
+extern int serial_flush_output (struct serial *);
-#define SERIAL_FLUSH_INPUT(SERIAL_T)\
- ((*(SERIAL_T)->ops->flush_input) ((SERIAL_T)))
+/* Flush pending input. Might also flush output (if this system can't
+ flush only input). */
-/* Send a break between 0.25 and 0.5 seconds long. */
+extern int serial_flush_input (struct serial *);
-extern int serial_send_break PARAMS ((serial_t scb));
+/* Send a break between 0.25 and 0.5 seconds long. */
-#define SERIAL_SEND_BREAK(SERIAL_T) serial_send_break (SERIAL_T)
+extern int serial_send_break (struct serial *scb);
/* Turn the port into raw mode. */
-#define SERIAL_RAW(SERIAL_T) (SERIAL_T)->ops->go_raw((SERIAL_T))
+extern void serial_raw (struct serial *scb);
/* Return a pointer to a newly malloc'd ttystate containing the state
of the tty. */
-#define SERIAL_GET_TTY_STATE(SERIAL_T) (SERIAL_T)->ops->get_tty_state((SERIAL_T))
+
+extern serial_ttystate serial_get_tty_state (struct serial *scb);
/* Set the state of the tty to TTYSTATE. The change is immediate.
When changing to or from raw mode, input might be discarded.
- Returns 0 for success, negative value for error (in which case errno
- contains the error). */
-#define SERIAL_SET_TTY_STATE(SERIAL_T, TTYSTATE) (SERIAL_T)->ops->set_tty_state((SERIAL_T), (TTYSTATE))
+ Returns 0 for success, negative value for error (in which case
+ errno contains the error). */
-/* printf_filtered a user-comprehensible description of ttystate. */
-#define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE) \
- ((*((SERIAL_T)->ops->print_tty_state)) ((SERIAL_T), (TTYSTATE)))
+extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
-/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
- current state (generally obtained from a recent call to
- SERIAL_GET_TTY_STATE), but be careful not to discard any input.
- This means that we never switch in or out of raw mode, even
- if NEW_TTYSTATE specifies a switch. */
-#define SERIAL_NOFLUSH_SET_TTY_STATE(SERIAL_T, NEW_TTYSTATE, OLD_TTYSTATE) \
- ((*((SERIAL_T)->ops->noflush_set_tty_state)) \
- ((SERIAL_T), (NEW_TTYSTATE), (OLD_TTYSTATE)))
+/* printf_filtered a user-comprehensible description of ttystate on
+ the specified STREAM. FIXME: At present this sends output to the
+ default stream - GDB_STDOUT. */
-/* Read one char from the serial device with TIMEOUT seconds to wait
- or -1 to wait forever. Use timeout of 0 to effect a poll. Returns
- char if ok, else one of the following codes. Note that all error
- codes are guaranteed to be < 0. */
-
-#define SERIAL_ERROR -1 /* General error, see errno for details */
-#define SERIAL_TIMEOUT -2
-#define SERIAL_EOF -3
+extern void serial_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *);
-extern int serial_readchar PARAMS ((serial_t scb, int timeout));
+/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
+ current state (generally obtained from a recent call to
+ serial_get_tty_state()), but be careful not to discard any input.
+ This means that we never switch in or out of raw mode, even if
+ NEW_TTYSTATE specifies a switch. */
-#define SERIAL_READCHAR(SERIAL_T, TIMEOUT) serial_readchar (SERIAL_T, TIMEOUT)
+extern int serial_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
-/* Set the baudrate to the decimal value supplied. Returns 0 for success,
- -1 for failure. */
+/* Set the baudrate to the decimal value supplied. Returns 0 for
+ success, -1 for failure. */
-#define SERIAL_SETBAUDRATE(SERIAL_T, RATE) ((SERIAL_T)->ops->setbaudrate((SERIAL_T), RATE))
+extern int serial_setbaudrate (struct serial *scb, int rate);
-/* Set the number of stop bits to the value specified. Returns 0 for success,
- -1 for failure. */
+/* Set the number of stop bits to the value specified. Returns 0 for
+ success, -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))
+extern int serial_setstopbits (struct serial *scb, int num);
+
+/* Asynchronous serial interface: */
+
+/* Can the serial device support asynchronous mode? */
+
+extern int serial_can_async_p (struct serial *scb);
+
+/* Has the serial device been put in asynchronous mode? */
+
+extern int serial_is_async_p (struct serial *scb);
+
+/* For ASYNC enabled devices, register a callback and enable
+ asynchronous mode. To disable asynchronous mode, register a NULL
+ callback. */
+
+typedef void (serial_event_ftype) (struct serial *scb, void *context);
+extern void serial_async (struct serial *scb, serial_event_ftype *handler, void *context);
+
+/* Provide direct access to the underlying FD (if any) used to
+ implement the serial device. This interface is clearly
+ deprecated. Will call internal_error() if the operation isn't
+ applicable to the current serial device. */
+
+extern int deprecated_serial_fd (struct serial *scb);
+
+/* Trace/debug mechanism.
+
+ serial_debug() enables/disables internal debugging.
+ serial_debug_p() indicates the current debug state. */
+
+extern void serial_debug (struct serial *scb, int debug_p);
+
+extern int serial_debug_p (struct serial *scb);
+
+
+/* Details of an instance of a serial object */
+
+struct serial
+ {
+ int fd; /* File descriptor */
+ struct serial_ops *ops; /* Function vector */
+ void *state; /* Local context info for open FD */
+ serial_ttystate ttystate; /* Not used (yet) */
+ int bufcnt; /* Amount of data remaining in receive
+ buffer. -ve for sticky errors. */
+ unsigned char *bufp; /* Current byte */
+ unsigned char buf[BUFSIZ]; /* Da buffer itself */
+ int current_timeout; /* (ser-unix.c termio{,s} only), last
+ value of VTIME */
+ int timeout_remaining; /* (ser-unix.c termio{,s} only), we
+ still need to wait for this many
+ more seconds. */
+ char *name; /* The name of the device or host */
+ struct serial *next; /* Pointer to the next `struct serial *' */
+ int refcnt; /* Number of pointers to this block */
+ int debug_p; /* Trace this serial devices operation. */
+ int async_state; /* Async internal state. */
+ void *async_context; /* Async event thread's context */
+ serial_event_ftype *async_handler;/* Async event handler */
+ };
+
+struct serial_ops
+ {
+ char *name;
+ struct serial_ops *next;
+ int (*open) (struct serial *, const char *name);
+ void (*close) (struct serial *);
+ int (*readchar) (struct serial *, int timeout);
+ int (*write) (struct serial *, const char *str, int len);
+ /* Discard pending output */
+ int (*flush_output) (struct serial *);
+ /* Discard pending input */
+ int (*flush_input) (struct serial *);
+ int (*send_break) (struct serial *);
+ void (*go_raw) (struct serial *);
+ serial_ttystate (*get_tty_state) (struct serial *);
+ int (*set_tty_state) (struct serial *, serial_ttystate);
+ void (*print_tty_state) (struct serial *, serial_ttystate,
+ struct ui_file *);
+ int (*noflush_set_tty_state) (struct serial *, serial_ttystate,
+ serial_ttystate);
+ int (*setbaudrate) (struct serial *, int rate);
+ int (*setstopbits) (struct serial *, int num);
+ /* Wait for output to drain */
+ int (*drain_output) (struct serial *);
+ /* Change the serial device into/out of asynchronous mode, call
+ the specified function when ever there is something
+ interesting. */
+ void (*async) (struct serial *scb, int async_p);
+ };
-/* Write LEN chars from STRING to the port SERIAL_T. Returns 0 for
- success, non-zero for failure. */
-
-extern int serial_write PARAMS ((serial_t scb, const char *str, int len));
-
-#define SERIAL_WRITE(SERIAL_T, STRING,LEN) serial_write (SERIAL_T, STRING, LEN)
-
-/* Push out all buffers, close the device and destroy SERIAL_T. */
-
-extern void serial_close PARAMS ((serial_t, int));
-
-#define SERIAL_CLOSE(SERIAL_T) serial_close(SERIAL_T, 1)
-
-/* Push out all buffers and destroy SERIAL_T without closing the device. */
-
-#define SERIAL_UN_FDOPEN(SERIAL_T) serial_close(SERIAL_T, 0)
+/* Add a new serial interface to the interface list */
-extern void serial_printf PARAMS ((serial_t desc, const char *, ...))
- ATTR_FORMAT(printf, 2, 3);
+extern void serial_add_interface (struct serial_ops * optable);
/* File in which to record the remote debugging session */
-extern void serial_log_command PARAMS ((const char *));
+extern void serial_log_command (const char *);
#endif /* SERIAL_H */
diff --git a/contrib/gdb/gdb/signals.c b/contrib/gdb/gdb/signals.c
new file mode 100644
index 0000000..d37ec06
--- /dev/null
+++ b/contrib/gdb/gdb/signals.c
@@ -0,0 +1,837 @@
+/* Target signal translation functions for GDB.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Support.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "target.h"
+#include <signal.h>
+
+/* This table must match in order and size the signals in enum target_signal
+ in target.h. */
+/* *INDENT-OFF* */
+static struct {
+ char *name;
+ char *string;
+ } signals [] =
+{
+ {"0", "Signal 0"},
+ {"SIGHUP", "Hangup"},
+ {"SIGINT", "Interrupt"},
+ {"SIGQUIT", "Quit"},
+ {"SIGILL", "Illegal instruction"},
+ {"SIGTRAP", "Trace/breakpoint trap"},
+ {"SIGABRT", "Aborted"},
+ {"SIGEMT", "Emulation trap"},
+ {"SIGFPE", "Arithmetic exception"},
+ {"SIGKILL", "Killed"},
+ {"SIGBUS", "Bus error"},
+ {"SIGSEGV", "Segmentation fault"},
+ {"SIGSYS", "Bad system call"},
+ {"SIGPIPE", "Broken pipe"},
+ {"SIGALRM", "Alarm clock"},
+ {"SIGTERM", "Terminated"},
+ {"SIGURG", "Urgent I/O condition"},
+ {"SIGSTOP", "Stopped (signal)"},
+ {"SIGTSTP", "Stopped (user)"},
+ {"SIGCONT", "Continued"},
+ {"SIGCHLD", "Child status changed"},
+ {"SIGTTIN", "Stopped (tty input)"},
+ {"SIGTTOU", "Stopped (tty output)"},
+ {"SIGIO", "I/O possible"},
+ {"SIGXCPU", "CPU time limit exceeded"},
+ {"SIGXFSZ", "File size limit exceeded"},
+ {"SIGVTALRM", "Virtual timer expired"},
+ {"SIGPROF", "Profiling timer expired"},
+ {"SIGWINCH", "Window size changed"},
+ {"SIGLOST", "Resource lost"},
+ {"SIGUSR1", "User defined signal 1"},
+ {"SIGUSR2", "User defined signal 2"},
+ {"SIGPWR", "Power fail/restart"},
+ {"SIGPOLL", "Pollable event occurred"},
+ {"SIGWIND", "SIGWIND"},
+ {"SIGPHONE", "SIGPHONE"},
+ {"SIGWAITING", "Process's LWPs are blocked"},
+ {"SIGLWP", "Signal LWP"},
+ {"SIGDANGER", "Swap space dangerously low"},
+ {"SIGGRANT", "Monitor mode granted"},
+ {"SIGRETRACT", "Need to relinquish monitor mode"},
+ {"SIGMSG", "Monitor mode data available"},
+ {"SIGSOUND", "Sound completed"},
+ {"SIGSAK", "Secure attention"},
+ {"SIGPRIO", "SIGPRIO"},
+ {"SIG33", "Real-time event 33"},
+ {"SIG34", "Real-time event 34"},
+ {"SIG35", "Real-time event 35"},
+ {"SIG36", "Real-time event 36"},
+ {"SIG37", "Real-time event 37"},
+ {"SIG38", "Real-time event 38"},
+ {"SIG39", "Real-time event 39"},
+ {"SIG40", "Real-time event 40"},
+ {"SIG41", "Real-time event 41"},
+ {"SIG42", "Real-time event 42"},
+ {"SIG43", "Real-time event 43"},
+ {"SIG44", "Real-time event 44"},
+ {"SIG45", "Real-time event 45"},
+ {"SIG46", "Real-time event 46"},
+ {"SIG47", "Real-time event 47"},
+ {"SIG48", "Real-time event 48"},
+ {"SIG49", "Real-time event 49"},
+ {"SIG50", "Real-time event 50"},
+ {"SIG51", "Real-time event 51"},
+ {"SIG52", "Real-time event 52"},
+ {"SIG53", "Real-time event 53"},
+ {"SIG54", "Real-time event 54"},
+ {"SIG55", "Real-time event 55"},
+ {"SIG56", "Real-time event 56"},
+ {"SIG57", "Real-time event 57"},
+ {"SIG58", "Real-time event 58"},
+ {"SIG59", "Real-time event 59"},
+ {"SIG60", "Real-time event 60"},
+ {"SIG61", "Real-time event 61"},
+ {"SIG62", "Real-time event 62"},
+ {"SIG63", "Real-time event 63"},
+ {"SIGCANCEL", "LWP internal signal"},
+ {"SIG32", "Real-time event 32"},
+ {"SIG64", "Real-time event 64"},
+ {"SIG65", "Real-time event 65"},
+ {"SIG66", "Real-time event 66"},
+ {"SIG67", "Real-time event 67"},
+ {"SIG68", "Real-time event 68"},
+ {"SIG69", "Real-time event 69"},
+ {"SIG70", "Real-time event 70"},
+ {"SIG71", "Real-time event 71"},
+ {"SIG72", "Real-time event 72"},
+ {"SIG73", "Real-time event 73"},
+ {"SIG74", "Real-time event 74"},
+ {"SIG75", "Real-time event 75"},
+ {"SIG76", "Real-time event 76"},
+ {"SIG77", "Real-time event 77"},
+ {"SIG78", "Real-time event 78"},
+ {"SIG79", "Real-time event 79"},
+ {"SIG80", "Real-time event 80"},
+ {"SIG81", "Real-time event 81"},
+ {"SIG82", "Real-time event 82"},
+ {"SIG83", "Real-time event 83"},
+ {"SIG84", "Real-time event 84"},
+ {"SIG85", "Real-time event 85"},
+ {"SIG86", "Real-time event 86"},
+ {"SIG87", "Real-time event 87"},
+ {"SIG88", "Real-time event 88"},
+ {"SIG89", "Real-time event 89"},
+ {"SIG90", "Real-time event 90"},
+ {"SIG91", "Real-time event 91"},
+ {"SIG92", "Real-time event 92"},
+ {"SIG93", "Real-time event 93"},
+ {"SIG94", "Real-time event 94"},
+ {"SIG95", "Real-time event 95"},
+ {"SIG96", "Real-time event 96"},
+ {"SIG97", "Real-time event 97"},
+ {"SIG98", "Real-time event 98"},
+ {"SIG99", "Real-time event 99"},
+ {"SIG100", "Real-time event 100"},
+ {"SIG101", "Real-time event 101"},
+ {"SIG102", "Real-time event 102"},
+ {"SIG103", "Real-time event 103"},
+ {"SIG104", "Real-time event 104"},
+ {"SIG105", "Real-time event 105"},
+ {"SIG106", "Real-time event 106"},
+ {"SIG107", "Real-time event 107"},
+ {"SIG108", "Real-time event 108"},
+ {"SIG109", "Real-time event 109"},
+ {"SIG110", "Real-time event 110"},
+ {"SIG111", "Real-time event 111"},
+ {"SIG112", "Real-time event 112"},
+ {"SIG113", "Real-time event 113"},
+ {"SIG114", "Real-time event 114"},
+ {"SIG115", "Real-time event 115"},
+ {"SIG116", "Real-time event 116"},
+ {"SIG117", "Real-time event 117"},
+ {"SIG118", "Real-time event 118"},
+ {"SIG119", "Real-time event 119"},
+ {"SIG120", "Real-time event 120"},
+ {"SIG121", "Real-time event 121"},
+ {"SIG122", "Real-time event 122"},
+ {"SIG123", "Real-time event 123"},
+ {"SIG124", "Real-time event 124"},
+ {"SIG125", "Real-time event 125"},
+ {"SIG126", "Real-time event 126"},
+ {"SIG127", "Real-time event 127"},
+
+#if defined(MACH) || defined(__MACH__)
+ /* Mach exceptions */
+ {"EXC_BAD_ACCESS", "Could not access memory"},
+ {"EXC_BAD_INSTRUCTION", "Illegal instruction/operand"},
+ {"EXC_ARITHMETIC", "Arithmetic exception"},
+ {"EXC_EMULATION", "Emulation instruction"},
+ {"EXC_SOFTWARE", "Software generated exception"},
+ {"EXC_BREAKPOINT", "Breakpoint"},
+#endif
+ {"SIGINFO", "Information request"},
+
+ {NULL, "Unknown signal"},
+ {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"},
+
+ /* Last entry, used to check whether the table is the right size. */
+ {NULL, "TARGET_SIGNAL_MAGIC"}
+};
+/* *INDENT-ON* */
+
+
+
+/* Return the string for a signal. */
+char *
+target_signal_to_string (enum target_signal sig)
+{
+ if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
+ return signals[sig].string;
+ else
+ return signals[TARGET_SIGNAL_UNKNOWN].string;
+}
+
+/* Return the name for a signal. */
+char *
+target_signal_to_name (enum target_signal sig)
+{
+ if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
+ && signals[sig].name != NULL)
+ return signals[sig].name;
+ else
+ /* I think the code which prints this will always print it along
+ with the string, so no need to be verbose (very old comment). */
+ return "?";
+}
+
+/* Given a name, return its signal. */
+enum target_signal
+target_signal_from_name (char *name)
+{
+ enum target_signal sig;
+
+ /* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
+ for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
+ questionable; seems like by now people should call it SIGABRT
+ instead. */
+
+ /* 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))
+ if (STREQ (name, signals[sig].name))
+ return sig;
+ return TARGET_SIGNAL_UNKNOWN;
+}
+
+/* The following functions are to help certain targets deal
+ with the signal/waitstatus stuff. They could just as well be in
+ a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
+
+/* Convert host signal to our signals. */
+enum target_signal
+target_signal_from_host (int 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 defined (SIGHUP)
+ if (hostsig == SIGHUP)
+ return TARGET_SIGNAL_HUP;
+#endif
+#if defined (SIGINT)
+ if (hostsig == SIGINT)
+ return TARGET_SIGNAL_INT;
+#endif
+#if defined (SIGQUIT)
+ if (hostsig == SIGQUIT)
+ return TARGET_SIGNAL_QUIT;
+#endif
+#if defined (SIGILL)
+ if (hostsig == SIGILL)
+ return TARGET_SIGNAL_ILL;
+#endif
+#if defined (SIGTRAP)
+ if (hostsig == SIGTRAP)
+ return TARGET_SIGNAL_TRAP;
+#endif
+#if defined (SIGABRT)
+ if (hostsig == SIGABRT)
+ return TARGET_SIGNAL_ABRT;
+#endif
+#if defined (SIGEMT)
+ if (hostsig == SIGEMT)
+ return TARGET_SIGNAL_EMT;
+#endif
+#if defined (SIGFPE)
+ if (hostsig == SIGFPE)
+ return TARGET_SIGNAL_FPE;
+#endif
+#if defined (SIGKILL)
+ if (hostsig == SIGKILL)
+ return TARGET_SIGNAL_KILL;
+#endif
+#if defined (SIGBUS)
+ if (hostsig == SIGBUS)
+ return TARGET_SIGNAL_BUS;
+#endif
+#if defined (SIGSEGV)
+ if (hostsig == SIGSEGV)
+ return TARGET_SIGNAL_SEGV;
+#endif
+#if defined (SIGSYS)
+ if (hostsig == SIGSYS)
+ return TARGET_SIGNAL_SYS;
+#endif
+#if defined (SIGPIPE)
+ if (hostsig == SIGPIPE)
+ return TARGET_SIGNAL_PIPE;
+#endif
+#if defined (SIGALRM)
+ if (hostsig == SIGALRM)
+ return TARGET_SIGNAL_ALRM;
+#endif
+#if defined (SIGTERM)
+ if (hostsig == SIGTERM)
+ return TARGET_SIGNAL_TERM;
+#endif
+#if defined (SIGUSR1)
+ if (hostsig == SIGUSR1)
+ return TARGET_SIGNAL_USR1;
+#endif
+#if defined (SIGUSR2)
+ if (hostsig == SIGUSR2)
+ return TARGET_SIGNAL_USR2;
+#endif
+#if defined (SIGCLD)
+ if (hostsig == SIGCLD)
+ return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGCHLD)
+ if (hostsig == SIGCHLD)
+ return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGPWR)
+ if (hostsig == SIGPWR)
+ return TARGET_SIGNAL_PWR;
+#endif
+#if defined (SIGWINCH)
+ if (hostsig == SIGWINCH)
+ return TARGET_SIGNAL_WINCH;
+#endif
+#if defined (SIGURG)
+ if (hostsig == SIGURG)
+ return TARGET_SIGNAL_URG;
+#endif
+#if defined (SIGIO)
+ if (hostsig == SIGIO)
+ return TARGET_SIGNAL_IO;
+#endif
+#if defined (SIGPOLL)
+ if (hostsig == SIGPOLL)
+ return TARGET_SIGNAL_POLL;
+#endif
+#if defined (SIGSTOP)
+ if (hostsig == SIGSTOP)
+ return TARGET_SIGNAL_STOP;
+#endif
+#if defined (SIGTSTP)
+ if (hostsig == SIGTSTP)
+ return TARGET_SIGNAL_TSTP;
+#endif
+#if defined (SIGCONT)
+ if (hostsig == SIGCONT)
+ return TARGET_SIGNAL_CONT;
+#endif
+#if defined (SIGTTIN)
+ if (hostsig == SIGTTIN)
+ return TARGET_SIGNAL_TTIN;
+#endif
+#if defined (SIGTTOU)
+ if (hostsig == SIGTTOU)
+ return TARGET_SIGNAL_TTOU;
+#endif
+#if defined (SIGVTALRM)
+ if (hostsig == SIGVTALRM)
+ return TARGET_SIGNAL_VTALRM;
+#endif
+#if defined (SIGPROF)
+ if (hostsig == SIGPROF)
+ return TARGET_SIGNAL_PROF;
+#endif
+#if defined (SIGXCPU)
+ if (hostsig == SIGXCPU)
+ return TARGET_SIGNAL_XCPU;
+#endif
+#if defined (SIGXFSZ)
+ if (hostsig == SIGXFSZ)
+ return TARGET_SIGNAL_XFSZ;
+#endif
+#if defined (SIGWIND)
+ if (hostsig == SIGWIND)
+ return TARGET_SIGNAL_WIND;
+#endif
+#if defined (SIGPHONE)
+ if (hostsig == SIGPHONE)
+ return TARGET_SIGNAL_PHONE;
+#endif
+#if defined (SIGLOST)
+ if (hostsig == SIGLOST)
+ return TARGET_SIGNAL_LOST;
+#endif
+#if defined (SIGWAITING)
+ if (hostsig == SIGWAITING)
+ return TARGET_SIGNAL_WAITING;
+#endif
+#if defined (SIGCANCEL)
+ if (hostsig == SIGCANCEL)
+ return TARGET_SIGNAL_CANCEL;
+#endif
+#if defined (SIGLWP)
+ if (hostsig == SIGLWP)
+ return TARGET_SIGNAL_LWP;
+#endif
+#if defined (SIGDANGER)
+ if (hostsig == SIGDANGER)
+ return TARGET_SIGNAL_DANGER;
+#endif
+#if defined (SIGGRANT)
+ if (hostsig == SIGGRANT)
+ return TARGET_SIGNAL_GRANT;
+#endif
+#if defined (SIGRETRACT)
+ if (hostsig == SIGRETRACT)
+ return TARGET_SIGNAL_RETRACT;
+#endif
+#if defined (SIGMSG)
+ if (hostsig == SIGMSG)
+ return TARGET_SIGNAL_MSG;
+#endif
+#if defined (SIGSOUND)
+ if (hostsig == SIGSOUND)
+ return TARGET_SIGNAL_SOUND;
+#endif
+#if defined (SIGSAK)
+ if (hostsig == SIGSAK)
+ return TARGET_SIGNAL_SAK;
+#endif
+#if defined (SIGPRIO)
+ 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;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+ if (hostsig == _NSIG + EXC_BREAKPOINT)
+ return TARGET_EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+ if (hostsig == SIGINFO)
+ return TARGET_SIGNAL_INFO;
+#endif
+
+#if defined (REALTIME_LO)
+ if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
+ {
+ /* This block of TARGET_SIGNAL_REALTIME value is in order. */
+ if (33 <= hostsig && hostsig <= 63)
+ return (enum target_signal)
+ (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ else if (hostsig == 32)
+ return TARGET_SIGNAL_REALTIME_32;
+ else if (64 <= hostsig && hostsig <= 127)
+ return (enum target_signal)
+ (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
+ else
+ error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+ }
+#endif
+
+#if defined (SIGRTMIN)
+ if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX)
+ {
+ /* This block of TARGET_SIGNAL_REALTIME value is in order. */
+ if (33 <= hostsig && hostsig <= 63)
+ return (enum target_signal)
+ (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ else if (hostsig == 64)
+ return TARGET_SIGNAL_REALTIME_64;
+ else
+ error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+ }
+#endif
+ return TARGET_SIGNAL_UNKNOWN;
+}
+
+/* Convert a OURSIG (an enum target_signal) to the form used by the
+ target operating system (refered to as the ``host'') or zero if the
+ equivalent host signal is not available. Set/clear OURSIG_OK
+ accordingly. */
+
+static int
+do_target_signal_to_host (enum target_signal oursig,
+ int *oursig_ok)
+{
+ *oursig_ok = 1;
+ switch (oursig)
+ {
+ case TARGET_SIGNAL_0:
+ return 0;
+
+#if defined (SIGHUP)
+ case TARGET_SIGNAL_HUP:
+ return SIGHUP;
+#endif
+#if defined (SIGINT)
+ case TARGET_SIGNAL_INT:
+ return SIGINT;
+#endif
+#if defined (SIGQUIT)
+ case TARGET_SIGNAL_QUIT:
+ return SIGQUIT;
+#endif
+#if defined (SIGILL)
+ case TARGET_SIGNAL_ILL:
+ return SIGILL;
+#endif
+#if defined (SIGTRAP)
+ case TARGET_SIGNAL_TRAP:
+ return SIGTRAP;
+#endif
+#if defined (SIGABRT)
+ case TARGET_SIGNAL_ABRT:
+ return SIGABRT;
+#endif
+#if defined (SIGEMT)
+ case TARGET_SIGNAL_EMT:
+ return SIGEMT;
+#endif
+#if defined (SIGFPE)
+ case TARGET_SIGNAL_FPE:
+ return SIGFPE;
+#endif
+#if defined (SIGKILL)
+ case TARGET_SIGNAL_KILL:
+ return SIGKILL;
+#endif
+#if defined (SIGBUS)
+ case TARGET_SIGNAL_BUS:
+ return SIGBUS;
+#endif
+#if defined (SIGSEGV)
+ case TARGET_SIGNAL_SEGV:
+ return SIGSEGV;
+#endif
+#if defined (SIGSYS)
+ case TARGET_SIGNAL_SYS:
+ return SIGSYS;
+#endif
+#if defined (SIGPIPE)
+ case TARGET_SIGNAL_PIPE:
+ return SIGPIPE;
+#endif
+#if defined (SIGALRM)
+ case TARGET_SIGNAL_ALRM:
+ return SIGALRM;
+#endif
+#if defined (SIGTERM)
+ case TARGET_SIGNAL_TERM:
+ return SIGTERM;
+#endif
+#if defined (SIGUSR1)
+ case TARGET_SIGNAL_USR1:
+ return SIGUSR1;
+#endif
+#if defined (SIGUSR2)
+ case TARGET_SIGNAL_USR2:
+ return SIGUSR2;
+#endif
+#if defined (SIGCHLD) || defined (SIGCLD)
+ case TARGET_SIGNAL_CHLD:
+#if defined (SIGCHLD)
+ return SIGCHLD;
+#else
+ return SIGCLD;
+#endif
+#endif /* SIGCLD or SIGCHLD */
+#if defined (SIGPWR)
+ case TARGET_SIGNAL_PWR:
+ return SIGPWR;
+#endif
+#if defined (SIGWINCH)
+ case TARGET_SIGNAL_WINCH:
+ return SIGWINCH;
+#endif
+#if defined (SIGURG)
+ case TARGET_SIGNAL_URG:
+ return SIGURG;
+#endif
+#if defined (SIGIO)
+ case TARGET_SIGNAL_IO:
+ return SIGIO;
+#endif
+#if defined (SIGPOLL)
+ case TARGET_SIGNAL_POLL:
+ return SIGPOLL;
+#endif
+#if defined (SIGSTOP)
+ case TARGET_SIGNAL_STOP:
+ return SIGSTOP;
+#endif
+#if defined (SIGTSTP)
+ case TARGET_SIGNAL_TSTP:
+ return SIGTSTP;
+#endif
+#if defined (SIGCONT)
+ case TARGET_SIGNAL_CONT:
+ return SIGCONT;
+#endif
+#if defined (SIGTTIN)
+ case TARGET_SIGNAL_TTIN:
+ return SIGTTIN;
+#endif
+#if defined (SIGTTOU)
+ case TARGET_SIGNAL_TTOU:
+ return SIGTTOU;
+#endif
+#if defined (SIGVTALRM)
+ case TARGET_SIGNAL_VTALRM:
+ return SIGVTALRM;
+#endif
+#if defined (SIGPROF)
+ case TARGET_SIGNAL_PROF:
+ return SIGPROF;
+#endif
+#if defined (SIGXCPU)
+ case TARGET_SIGNAL_XCPU:
+ return SIGXCPU;
+#endif
+#if defined (SIGXFSZ)
+ case TARGET_SIGNAL_XFSZ:
+ return SIGXFSZ;
+#endif
+#if defined (SIGWIND)
+ case TARGET_SIGNAL_WIND:
+ return SIGWIND;
+#endif
+#if defined (SIGPHONE)
+ case TARGET_SIGNAL_PHONE:
+ return SIGPHONE;
+#endif
+#if defined (SIGLOST)
+ case TARGET_SIGNAL_LOST:
+ return SIGLOST;
+#endif
+#if defined (SIGWAITING)
+ case TARGET_SIGNAL_WAITING:
+ return SIGWAITING;
+#endif
+#if defined (SIGCANCEL)
+ case TARGET_SIGNAL_CANCEL:
+ return SIGCANCEL;
+#endif
+#if defined (SIGLWP)
+ case TARGET_SIGNAL_LWP:
+ return SIGLWP;
+#endif
+#if defined (SIGDANGER)
+ case TARGET_SIGNAL_DANGER:
+ return SIGDANGER;
+#endif
+#if defined (SIGGRANT)
+ case TARGET_SIGNAL_GRANT:
+ return SIGGRANT;
+#endif
+#if defined (SIGRETRACT)
+ case TARGET_SIGNAL_RETRACT:
+ return SIGRETRACT;
+#endif
+#if defined (SIGMSG)
+ case TARGET_SIGNAL_MSG:
+ return SIGMSG;
+#endif
+#if defined (SIGSOUND)
+ case TARGET_SIGNAL_SOUND:
+ return SIGSOUND;
+#endif
+#if defined (SIGSAK)
+ case TARGET_SIGNAL_SAK:
+ return SIGSAK;
+#endif
+#if defined (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;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+ case TARGET_EXC_EMULATION:
+ return _NSIG + EXC_EMULATION;
+#endif
+#if defined (EXC_SOFTWARE) && defined (_NSIG)
+ case TARGET_EXC_SOFTWARE:
+ return _NSIG + EXC_SOFTWARE;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+ case TARGET_EXC_BREAKPOINT:
+ return _NSIG + EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+ case TARGET_SIGNAL_INFO:
+ return SIGINFO;
+#endif
+
+ default:
+#if defined (REALTIME_LO)
+ if (oursig >= TARGET_SIGNAL_REALTIME_33
+ && oursig <= TARGET_SIGNAL_REALTIME_63)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+ if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+ return retsig;
+ }
+#if (REALTIME_LO < 33)
+ else if (oursig == TARGET_SIGNAL_REALTIME_32)
+ {
+ /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
+ TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */
+ return 32;
+ }
+#endif
+#if (REALTIME_HI > 64)
+ if (oursig >= TARGET_SIGNAL_REALTIME_64
+ && oursig <= TARGET_SIGNAL_REALTIME_127)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_64 is 64 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
+ if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+ return retsig;
+ }
+
+#endif
+#endif
+
+#if defined (SIGRTMIN)
+ if (oursig >= TARGET_SIGNAL_REALTIME_33
+ && oursig <= TARGET_SIGNAL_REALTIME_63)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+ if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
+ return retsig;
+ }
+ else if (oursig == TARGET_SIGNAL_REALTIME_64)
+ return 64;
+#endif
+ *oursig_ok = 0;
+ return 0;
+ }
+}
+
+int
+target_signal_to_host_p (enum target_signal oursig)
+{
+ int oursig_ok;
+ do_target_signal_to_host (oursig, &oursig_ok);
+ return oursig_ok;
+}
+
+int
+target_signal_to_host (enum target_signal oursig)
+{
+ int oursig_ok;
+ int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
+ if (!oursig_ok)
+ {
+ /* The user might be trying to do "signal SIGSAK" where this system
+ doesn't have SIGSAK. */
+ warning ("Signal %s does not exist on this system.\n",
+ target_signal_to_name (oursig));
+ return 0;
+ }
+ else
+ return targ_signo;
+}
+
+/* In some circumstances we allow a command to specify a numeric
+ signal. The idea is to keep these circumstances limited so that
+ users (and scripts) develop portable habits. For comparison,
+ POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
+ numeric signal at all is obsolescent. We are slightly more
+ lenient and allow 1-15 which should match host signal numbers on
+ most systems. Use of symbolic signal names is strongly encouraged. */
+
+enum target_signal
+target_signal_from_command (int num)
+{
+ if (num >= 1 && num <= 15)
+ 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.");
+}
+
+void
+_initialize_signals (void)
+{
+ if (!STREQ (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC"))
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+}
diff --git a/contrib/gdb/gdb/signals/signals.c b/contrib/gdb/gdb/signals/signals.c
new file mode 100644
index 0000000..774d70a
--- /dev/null
+++ b/contrib/gdb/gdb/signals/signals.c
@@ -0,0 +1,844 @@
+/* Target signal translation functions for GDB.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001, 2002 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. */
+
+#ifdef GDBSERVER
+#include "server.h"
+#else
+#include "defs.h"
+#include "target.h"
+#endif
+
+#include <signal.h>
+
+/* This table must match in order and size the signals in enum target_signal
+ in target.h. */
+/* *INDENT-OFF* */
+static struct {
+ char *name;
+ char *string;
+ } signals [] =
+{
+ {"0", "Signal 0"},
+ {"SIGHUP", "Hangup"},
+ {"SIGINT", "Interrupt"},
+ {"SIGQUIT", "Quit"},
+ {"SIGILL", "Illegal instruction"},
+ {"SIGTRAP", "Trace/breakpoint trap"},
+ {"SIGABRT", "Aborted"},
+ {"SIGEMT", "Emulation trap"},
+ {"SIGFPE", "Arithmetic exception"},
+ {"SIGKILL", "Killed"},
+ {"SIGBUS", "Bus error"},
+ {"SIGSEGV", "Segmentation fault"},
+ {"SIGSYS", "Bad system call"},
+ {"SIGPIPE", "Broken pipe"},
+ {"SIGALRM", "Alarm clock"},
+ {"SIGTERM", "Terminated"},
+ {"SIGURG", "Urgent I/O condition"},
+ {"SIGSTOP", "Stopped (signal)"},
+ {"SIGTSTP", "Stopped (user)"},
+ {"SIGCONT", "Continued"},
+ {"SIGCHLD", "Child status changed"},
+ {"SIGTTIN", "Stopped (tty input)"},
+ {"SIGTTOU", "Stopped (tty output)"},
+ {"SIGIO", "I/O possible"},
+ {"SIGXCPU", "CPU time limit exceeded"},
+ {"SIGXFSZ", "File size limit exceeded"},
+ {"SIGVTALRM", "Virtual timer expired"},
+ {"SIGPROF", "Profiling timer expired"},
+ {"SIGWINCH", "Window size changed"},
+ {"SIGLOST", "Resource lost"},
+ {"SIGUSR1", "User defined signal 1"},
+ {"SIGUSR2", "User defined signal 2"},
+ {"SIGPWR", "Power fail/restart"},
+ {"SIGPOLL", "Pollable event occurred"},
+ {"SIGWIND", "SIGWIND"},
+ {"SIGPHONE", "SIGPHONE"},
+ {"SIGWAITING", "Process's LWPs are blocked"},
+ {"SIGLWP", "Signal LWP"},
+ {"SIGDANGER", "Swap space dangerously low"},
+ {"SIGGRANT", "Monitor mode granted"},
+ {"SIGRETRACT", "Need to relinquish monitor mode"},
+ {"SIGMSG", "Monitor mode data available"},
+ {"SIGSOUND", "Sound completed"},
+ {"SIGSAK", "Secure attention"},
+ {"SIGPRIO", "SIGPRIO"},
+ {"SIG33", "Real-time event 33"},
+ {"SIG34", "Real-time event 34"},
+ {"SIG35", "Real-time event 35"},
+ {"SIG36", "Real-time event 36"},
+ {"SIG37", "Real-time event 37"},
+ {"SIG38", "Real-time event 38"},
+ {"SIG39", "Real-time event 39"},
+ {"SIG40", "Real-time event 40"},
+ {"SIG41", "Real-time event 41"},
+ {"SIG42", "Real-time event 42"},
+ {"SIG43", "Real-time event 43"},
+ {"SIG44", "Real-time event 44"},
+ {"SIG45", "Real-time event 45"},
+ {"SIG46", "Real-time event 46"},
+ {"SIG47", "Real-time event 47"},
+ {"SIG48", "Real-time event 48"},
+ {"SIG49", "Real-time event 49"},
+ {"SIG50", "Real-time event 50"},
+ {"SIG51", "Real-time event 51"},
+ {"SIG52", "Real-time event 52"},
+ {"SIG53", "Real-time event 53"},
+ {"SIG54", "Real-time event 54"},
+ {"SIG55", "Real-time event 55"},
+ {"SIG56", "Real-time event 56"},
+ {"SIG57", "Real-time event 57"},
+ {"SIG58", "Real-time event 58"},
+ {"SIG59", "Real-time event 59"},
+ {"SIG60", "Real-time event 60"},
+ {"SIG61", "Real-time event 61"},
+ {"SIG62", "Real-time event 62"},
+ {"SIG63", "Real-time event 63"},
+ {"SIGCANCEL", "LWP internal signal"},
+ {"SIG32", "Real-time event 32"},
+ {"SIG64", "Real-time event 64"},
+ {"SIG65", "Real-time event 65"},
+ {"SIG66", "Real-time event 66"},
+ {"SIG67", "Real-time event 67"},
+ {"SIG68", "Real-time event 68"},
+ {"SIG69", "Real-time event 69"},
+ {"SIG70", "Real-time event 70"},
+ {"SIG71", "Real-time event 71"},
+ {"SIG72", "Real-time event 72"},
+ {"SIG73", "Real-time event 73"},
+ {"SIG74", "Real-time event 74"},
+ {"SIG75", "Real-time event 75"},
+ {"SIG76", "Real-time event 76"},
+ {"SIG77", "Real-time event 77"},
+ {"SIG78", "Real-time event 78"},
+ {"SIG79", "Real-time event 79"},
+ {"SIG80", "Real-time event 80"},
+ {"SIG81", "Real-time event 81"},
+ {"SIG82", "Real-time event 82"},
+ {"SIG83", "Real-time event 83"},
+ {"SIG84", "Real-time event 84"},
+ {"SIG85", "Real-time event 85"},
+ {"SIG86", "Real-time event 86"},
+ {"SIG87", "Real-time event 87"},
+ {"SIG88", "Real-time event 88"},
+ {"SIG89", "Real-time event 89"},
+ {"SIG90", "Real-time event 90"},
+ {"SIG91", "Real-time event 91"},
+ {"SIG92", "Real-time event 92"},
+ {"SIG93", "Real-time event 93"},
+ {"SIG94", "Real-time event 94"},
+ {"SIG95", "Real-time event 95"},
+ {"SIG96", "Real-time event 96"},
+ {"SIG97", "Real-time event 97"},
+ {"SIG98", "Real-time event 98"},
+ {"SIG99", "Real-time event 99"},
+ {"SIG100", "Real-time event 100"},
+ {"SIG101", "Real-time event 101"},
+ {"SIG102", "Real-time event 102"},
+ {"SIG103", "Real-time event 103"},
+ {"SIG104", "Real-time event 104"},
+ {"SIG105", "Real-time event 105"},
+ {"SIG106", "Real-time event 106"},
+ {"SIG107", "Real-time event 107"},
+ {"SIG108", "Real-time event 108"},
+ {"SIG109", "Real-time event 109"},
+ {"SIG110", "Real-time event 110"},
+ {"SIG111", "Real-time event 111"},
+ {"SIG112", "Real-time event 112"},
+ {"SIG113", "Real-time event 113"},
+ {"SIG114", "Real-time event 114"},
+ {"SIG115", "Real-time event 115"},
+ {"SIG116", "Real-time event 116"},
+ {"SIG117", "Real-time event 117"},
+ {"SIG118", "Real-time event 118"},
+ {"SIG119", "Real-time event 119"},
+ {"SIG120", "Real-time event 120"},
+ {"SIG121", "Real-time event 121"},
+ {"SIG122", "Real-time event 122"},
+ {"SIG123", "Real-time event 123"},
+ {"SIG124", "Real-time event 124"},
+ {"SIG125", "Real-time event 125"},
+ {"SIG126", "Real-time event 126"},
+ {"SIG127", "Real-time event 127"},
+
+#if defined(MACH) || defined(__MACH__)
+ /* Mach exceptions */
+ {"EXC_BAD_ACCESS", "Could not access memory"},
+ {"EXC_BAD_INSTRUCTION", "Illegal instruction/operand"},
+ {"EXC_ARITHMETIC", "Arithmetic exception"},
+ {"EXC_EMULATION", "Emulation instruction"},
+ {"EXC_SOFTWARE", "Software generated exception"},
+ {"EXC_BREAKPOINT", "Breakpoint"},
+#endif
+ {"SIGINFO", "Information request"},
+
+ {NULL, "Unknown signal"},
+ {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"},
+
+ /* Last entry, used to check whether the table is the right size. */
+ {NULL, "TARGET_SIGNAL_MAGIC"}
+};
+/* *INDENT-ON* */
+
+
+
+/* Return the string for a signal. */
+char *
+target_signal_to_string (enum target_signal sig)
+{
+ if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
+ return signals[sig].string;
+ else
+ return signals[TARGET_SIGNAL_UNKNOWN].string;
+}
+
+/* Return the name for a signal. */
+char *
+target_signal_to_name (enum target_signal sig)
+{
+ if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
+ && signals[sig].name != NULL)
+ return signals[sig].name;
+ else
+ /* I think the code which prints this will always print it along
+ with the string, so no need to be verbose (very old comment). */
+ return "?";
+}
+
+/* Given a name, return its signal. */
+enum target_signal
+target_signal_from_name (char *name)
+{
+ enum target_signal sig;
+
+ /* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
+ for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
+ questionable; seems like by now people should call it SIGABRT
+ instead. */
+
+ /* 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))
+ if (strcmp (name, signals[sig].name) == 0)
+ return sig;
+ return TARGET_SIGNAL_UNKNOWN;
+}
+
+/* The following functions are to help certain targets deal
+ with the signal/waitstatus stuff. They could just as well be in
+ a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
+
+/* Convert host signal to our signals. */
+enum target_signal
+target_signal_from_host (int 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 defined (SIGHUP)
+ if (hostsig == SIGHUP)
+ return TARGET_SIGNAL_HUP;
+#endif
+#if defined (SIGINT)
+ if (hostsig == SIGINT)
+ return TARGET_SIGNAL_INT;
+#endif
+#if defined (SIGQUIT)
+ if (hostsig == SIGQUIT)
+ return TARGET_SIGNAL_QUIT;
+#endif
+#if defined (SIGILL)
+ if (hostsig == SIGILL)
+ return TARGET_SIGNAL_ILL;
+#endif
+#if defined (SIGTRAP)
+ if (hostsig == SIGTRAP)
+ return TARGET_SIGNAL_TRAP;
+#endif
+#if defined (SIGABRT)
+ if (hostsig == SIGABRT)
+ return TARGET_SIGNAL_ABRT;
+#endif
+#if defined (SIGEMT)
+ if (hostsig == SIGEMT)
+ return TARGET_SIGNAL_EMT;
+#endif
+#if defined (SIGFPE)
+ if (hostsig == SIGFPE)
+ return TARGET_SIGNAL_FPE;
+#endif
+#if defined (SIGKILL)
+ if (hostsig == SIGKILL)
+ return TARGET_SIGNAL_KILL;
+#endif
+#if defined (SIGBUS)
+ if (hostsig == SIGBUS)
+ return TARGET_SIGNAL_BUS;
+#endif
+#if defined (SIGSEGV)
+ if (hostsig == SIGSEGV)
+ return TARGET_SIGNAL_SEGV;
+#endif
+#if defined (SIGSYS)
+ if (hostsig == SIGSYS)
+ return TARGET_SIGNAL_SYS;
+#endif
+#if defined (SIGPIPE)
+ if (hostsig == SIGPIPE)
+ return TARGET_SIGNAL_PIPE;
+#endif
+#if defined (SIGALRM)
+ if (hostsig == SIGALRM)
+ return TARGET_SIGNAL_ALRM;
+#endif
+#if defined (SIGTERM)
+ if (hostsig == SIGTERM)
+ return TARGET_SIGNAL_TERM;
+#endif
+#if defined (SIGUSR1)
+ if (hostsig == SIGUSR1)
+ return TARGET_SIGNAL_USR1;
+#endif
+#if defined (SIGUSR2)
+ if (hostsig == SIGUSR2)
+ return TARGET_SIGNAL_USR2;
+#endif
+#if defined (SIGCLD)
+ if (hostsig == SIGCLD)
+ return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGCHLD)
+ if (hostsig == SIGCHLD)
+ return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGPWR)
+ if (hostsig == SIGPWR)
+ return TARGET_SIGNAL_PWR;
+#endif
+#if defined (SIGWINCH)
+ if (hostsig == SIGWINCH)
+ return TARGET_SIGNAL_WINCH;
+#endif
+#if defined (SIGURG)
+ if (hostsig == SIGURG)
+ return TARGET_SIGNAL_URG;
+#endif
+#if defined (SIGIO)
+ if (hostsig == SIGIO)
+ return TARGET_SIGNAL_IO;
+#endif
+#if defined (SIGPOLL)
+ if (hostsig == SIGPOLL)
+ return TARGET_SIGNAL_POLL;
+#endif
+#if defined (SIGSTOP)
+ if (hostsig == SIGSTOP)
+ return TARGET_SIGNAL_STOP;
+#endif
+#if defined (SIGTSTP)
+ if (hostsig == SIGTSTP)
+ return TARGET_SIGNAL_TSTP;
+#endif
+#if defined (SIGCONT)
+ if (hostsig == SIGCONT)
+ return TARGET_SIGNAL_CONT;
+#endif
+#if defined (SIGTTIN)
+ if (hostsig == SIGTTIN)
+ return TARGET_SIGNAL_TTIN;
+#endif
+#if defined (SIGTTOU)
+ if (hostsig == SIGTTOU)
+ return TARGET_SIGNAL_TTOU;
+#endif
+#if defined (SIGVTALRM)
+ if (hostsig == SIGVTALRM)
+ return TARGET_SIGNAL_VTALRM;
+#endif
+#if defined (SIGPROF)
+ if (hostsig == SIGPROF)
+ return TARGET_SIGNAL_PROF;
+#endif
+#if defined (SIGXCPU)
+ if (hostsig == SIGXCPU)
+ return TARGET_SIGNAL_XCPU;
+#endif
+#if defined (SIGXFSZ)
+ if (hostsig == SIGXFSZ)
+ return TARGET_SIGNAL_XFSZ;
+#endif
+#if defined (SIGWIND)
+ if (hostsig == SIGWIND)
+ return TARGET_SIGNAL_WIND;
+#endif
+#if defined (SIGPHONE)
+ if (hostsig == SIGPHONE)
+ return TARGET_SIGNAL_PHONE;
+#endif
+#if defined (SIGLOST)
+ if (hostsig == SIGLOST)
+ return TARGET_SIGNAL_LOST;
+#endif
+#if defined (SIGWAITING)
+ if (hostsig == SIGWAITING)
+ return TARGET_SIGNAL_WAITING;
+#endif
+#if defined (SIGCANCEL)
+ if (hostsig == SIGCANCEL)
+ return TARGET_SIGNAL_CANCEL;
+#endif
+#if defined (SIGLWP)
+ if (hostsig == SIGLWP)
+ return TARGET_SIGNAL_LWP;
+#endif
+#if defined (SIGDANGER)
+ if (hostsig == SIGDANGER)
+ return TARGET_SIGNAL_DANGER;
+#endif
+#if defined (SIGGRANT)
+ if (hostsig == SIGGRANT)
+ return TARGET_SIGNAL_GRANT;
+#endif
+#if defined (SIGRETRACT)
+ if (hostsig == SIGRETRACT)
+ return TARGET_SIGNAL_RETRACT;
+#endif
+#if defined (SIGMSG)
+ if (hostsig == SIGMSG)
+ return TARGET_SIGNAL_MSG;
+#endif
+#if defined (SIGSOUND)
+ if (hostsig == SIGSOUND)
+ return TARGET_SIGNAL_SOUND;
+#endif
+#if defined (SIGSAK)
+ if (hostsig == SIGSAK)
+ return TARGET_SIGNAL_SAK;
+#endif
+#if defined (SIGPRIO)
+ 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;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+ if (hostsig == _NSIG + EXC_BREAKPOINT)
+ return TARGET_EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+ if (hostsig == SIGINFO)
+ return TARGET_SIGNAL_INFO;
+#endif
+
+#if defined (REALTIME_LO)
+ if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
+ {
+ /* This block of TARGET_SIGNAL_REALTIME value is in order. */
+ if (33 <= hostsig && hostsig <= 63)
+ return (enum target_signal)
+ (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ else if (hostsig == 32)
+ return TARGET_SIGNAL_REALTIME_32;
+ else if (64 <= hostsig && hostsig <= 127)
+ return (enum target_signal)
+ (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
+ else
+ error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+ }
+#endif
+
+#if defined (SIGRTMIN)
+ if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX)
+ {
+ /* This block of TARGET_SIGNAL_REALTIME value is in order. */
+ if (33 <= hostsig && hostsig <= 63)
+ return (enum target_signal)
+ (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ else if (hostsig == 64)
+ return TARGET_SIGNAL_REALTIME_64;
+ else
+ error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+ }
+#endif
+ return TARGET_SIGNAL_UNKNOWN;
+}
+
+/* Convert a OURSIG (an enum target_signal) to the form used by the
+ target operating system (refered to as the ``host'') or zero if the
+ equivalent host signal is not available. Set/clear OURSIG_OK
+ accordingly. */
+
+static int
+do_target_signal_to_host (enum target_signal oursig,
+ int *oursig_ok)
+{
+ *oursig_ok = 1;
+ switch (oursig)
+ {
+ case TARGET_SIGNAL_0:
+ return 0;
+
+#if defined (SIGHUP)
+ case TARGET_SIGNAL_HUP:
+ return SIGHUP;
+#endif
+#if defined (SIGINT)
+ case TARGET_SIGNAL_INT:
+ return SIGINT;
+#endif
+#if defined (SIGQUIT)
+ case TARGET_SIGNAL_QUIT:
+ return SIGQUIT;
+#endif
+#if defined (SIGILL)
+ case TARGET_SIGNAL_ILL:
+ return SIGILL;
+#endif
+#if defined (SIGTRAP)
+ case TARGET_SIGNAL_TRAP:
+ return SIGTRAP;
+#endif
+#if defined (SIGABRT)
+ case TARGET_SIGNAL_ABRT:
+ return SIGABRT;
+#endif
+#if defined (SIGEMT)
+ case TARGET_SIGNAL_EMT:
+ return SIGEMT;
+#endif
+#if defined (SIGFPE)
+ case TARGET_SIGNAL_FPE:
+ return SIGFPE;
+#endif
+#if defined (SIGKILL)
+ case TARGET_SIGNAL_KILL:
+ return SIGKILL;
+#endif
+#if defined (SIGBUS)
+ case TARGET_SIGNAL_BUS:
+ return SIGBUS;
+#endif
+#if defined (SIGSEGV)
+ case TARGET_SIGNAL_SEGV:
+ return SIGSEGV;
+#endif
+#if defined (SIGSYS)
+ case TARGET_SIGNAL_SYS:
+ return SIGSYS;
+#endif
+#if defined (SIGPIPE)
+ case TARGET_SIGNAL_PIPE:
+ return SIGPIPE;
+#endif
+#if defined (SIGALRM)
+ case TARGET_SIGNAL_ALRM:
+ return SIGALRM;
+#endif
+#if defined (SIGTERM)
+ case TARGET_SIGNAL_TERM:
+ return SIGTERM;
+#endif
+#if defined (SIGUSR1)
+ case TARGET_SIGNAL_USR1:
+ return SIGUSR1;
+#endif
+#if defined (SIGUSR2)
+ case TARGET_SIGNAL_USR2:
+ return SIGUSR2;
+#endif
+#if defined (SIGCHLD) || defined (SIGCLD)
+ case TARGET_SIGNAL_CHLD:
+#if defined (SIGCHLD)
+ return SIGCHLD;
+#else
+ return SIGCLD;
+#endif
+#endif /* SIGCLD or SIGCHLD */
+#if defined (SIGPWR)
+ case TARGET_SIGNAL_PWR:
+ return SIGPWR;
+#endif
+#if defined (SIGWINCH)
+ case TARGET_SIGNAL_WINCH:
+ return SIGWINCH;
+#endif
+#if defined (SIGURG)
+ case TARGET_SIGNAL_URG:
+ return SIGURG;
+#endif
+#if defined (SIGIO)
+ case TARGET_SIGNAL_IO:
+ return SIGIO;
+#endif
+#if defined (SIGPOLL)
+ case TARGET_SIGNAL_POLL:
+ return SIGPOLL;
+#endif
+#if defined (SIGSTOP)
+ case TARGET_SIGNAL_STOP:
+ return SIGSTOP;
+#endif
+#if defined (SIGTSTP)
+ case TARGET_SIGNAL_TSTP:
+ return SIGTSTP;
+#endif
+#if defined (SIGCONT)
+ case TARGET_SIGNAL_CONT:
+ return SIGCONT;
+#endif
+#if defined (SIGTTIN)
+ case TARGET_SIGNAL_TTIN:
+ return SIGTTIN;
+#endif
+#if defined (SIGTTOU)
+ case TARGET_SIGNAL_TTOU:
+ return SIGTTOU;
+#endif
+#if defined (SIGVTALRM)
+ case TARGET_SIGNAL_VTALRM:
+ return SIGVTALRM;
+#endif
+#if defined (SIGPROF)
+ case TARGET_SIGNAL_PROF:
+ return SIGPROF;
+#endif
+#if defined (SIGXCPU)
+ case TARGET_SIGNAL_XCPU:
+ return SIGXCPU;
+#endif
+#if defined (SIGXFSZ)
+ case TARGET_SIGNAL_XFSZ:
+ return SIGXFSZ;
+#endif
+#if defined (SIGWIND)
+ case TARGET_SIGNAL_WIND:
+ return SIGWIND;
+#endif
+#if defined (SIGPHONE)
+ case TARGET_SIGNAL_PHONE:
+ return SIGPHONE;
+#endif
+#if defined (SIGLOST)
+ case TARGET_SIGNAL_LOST:
+ return SIGLOST;
+#endif
+#if defined (SIGWAITING)
+ case TARGET_SIGNAL_WAITING:
+ return SIGWAITING;
+#endif
+#if defined (SIGCANCEL)
+ case TARGET_SIGNAL_CANCEL:
+ return SIGCANCEL;
+#endif
+#if defined (SIGLWP)
+ case TARGET_SIGNAL_LWP:
+ return SIGLWP;
+#endif
+#if defined (SIGDANGER)
+ case TARGET_SIGNAL_DANGER:
+ return SIGDANGER;
+#endif
+#if defined (SIGGRANT)
+ case TARGET_SIGNAL_GRANT:
+ return SIGGRANT;
+#endif
+#if defined (SIGRETRACT)
+ case TARGET_SIGNAL_RETRACT:
+ return SIGRETRACT;
+#endif
+#if defined (SIGMSG)
+ case TARGET_SIGNAL_MSG:
+ return SIGMSG;
+#endif
+#if defined (SIGSOUND)
+ case TARGET_SIGNAL_SOUND:
+ return SIGSOUND;
+#endif
+#if defined (SIGSAK)
+ case TARGET_SIGNAL_SAK:
+ return SIGSAK;
+#endif
+#if defined (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;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+ 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;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+ case TARGET_EXC_EMULATION:
+ return _NSIG + EXC_EMULATION;
+#endif
+#if defined (EXC_SOFTWARE) && defined (_NSIG)
+ case TARGET_EXC_SOFTWARE:
+ return _NSIG + EXC_SOFTWARE;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+ case TARGET_EXC_BREAKPOINT:
+ return _NSIG + EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+ case TARGET_SIGNAL_INFO:
+ return SIGINFO;
+#endif
+
+ default:
+#if defined (REALTIME_LO)
+ if (oursig >= TARGET_SIGNAL_REALTIME_33
+ && oursig <= TARGET_SIGNAL_REALTIME_63)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+ if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+ return retsig;
+ }
+#if (REALTIME_LO < 33)
+ else if (oursig == TARGET_SIGNAL_REALTIME_32)
+ {
+ /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
+ TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */
+ return 32;
+ }
+#endif
+#if (REALTIME_HI > 64)
+ if (oursig >= TARGET_SIGNAL_REALTIME_64
+ && oursig <= TARGET_SIGNAL_REALTIME_127)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_64 is 64 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
+ if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+ return retsig;
+ }
+
+#endif
+#endif
+
+#if defined (SIGRTMIN)
+ if (oursig >= TARGET_SIGNAL_REALTIME_33
+ && oursig <= TARGET_SIGNAL_REALTIME_63)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+ if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
+ return retsig;
+ }
+ else if (oursig == TARGET_SIGNAL_REALTIME_64)
+ return 64;
+#endif
+ *oursig_ok = 0;
+ return 0;
+ }
+}
+
+int
+target_signal_to_host_p (enum target_signal oursig)
+{
+ int oursig_ok;
+ do_target_signal_to_host (oursig, &oursig_ok);
+ return oursig_ok;
+}
+
+int
+target_signal_to_host (enum target_signal oursig)
+{
+ int oursig_ok;
+ int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
+ if (!oursig_ok)
+ {
+ /* The user might be trying to do "signal SIGSAK" where this system
+ doesn't have SIGSAK. */
+ warning ("Signal %s does not exist on this system.\n",
+ target_signal_to_name (oursig));
+ return 0;
+ }
+ else
+ return targ_signo;
+}
+
+/* In some circumstances we allow a command to specify a numeric
+ signal. The idea is to keep these circumstances limited so that
+ users (and scripts) develop portable habits. For comparison,
+ POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
+ numeric signal at all is obsolescent. We are slightly more
+ lenient and allow 1-15 which should match host signal numbers on
+ most systems. Use of symbolic signal names is strongly encouraged. */
+
+enum target_signal
+target_signal_from_command (int num)
+{
+ if (num >= 1 && num <= 15)
+ 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.");
+}
+
+#ifndef GDBSERVER
+void
+_initialize_signals (void)
+{
+ if (strcmp (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC") != 0)
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+}
+#endif
diff --git a/contrib/gdb/gdb/sol-thread.c b/contrib/gdb/gdb/sol-thread.c
index 3fe6268..50caed3 100644
--- a/contrib/gdb/gdb/sol-thread.c
+++ b/contrib/gdb/gdb/sol-thread.c
@@ -1,21 +1,23 @@
/* Low level interface for debugging Solaris threads for GDB, the GNU debugger.
- Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -53,13 +55,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "inferior.h"
#include <fcntl.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "regcache.h"
+#include "symfile.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,160 +72,156 @@ 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 char *procfs_pid_to_str PARAMS ((int pid));
-
-/* Note that these prototypes differ slightly from those used in procfs.c
- for of two reasons. One, we can't use gregset_t, as that's got a whole
- different meaning under Solaris (also, see above). Two, we can't use the
- pointer form here as these are actually arrays of ints (for Sparc's at
- least), and are automatically coerced into pointers to ints when used as
- parameters. That makes it impossible to avoid a compiler warning when
- passing pr{g fp}regset_t's from a parameter to an argument of one of
- these functions. */
-
-extern void supply_gregset PARAMS ((const prgregset_t));
-extern void fill_gregset PARAMS ((prgregset_t, int));
-extern void supply_fpregset PARAMS ((const prfpregset_t *));
-extern void fill_fpregset PARAMS ((prfpregset_t *, int));
+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 (ptid_t ptid);
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
/* This struct is defined by us, but mainly used for the proc_service interface.
We don't have much use for it, except as a handy place to get a real pid
for memory accesses. */
struct ps_prochandle
-{
- pid_t pid;
-};
+ {
+ ptid_t ptid;
+ };
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 void restore_inferior_pid PARAMS ((int 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 void sol_thread_resume PARAMS ((int pid, int step,
- enum target_signal signo));
-static int lwp_to_thread PARAMS ((int lwp));
-static int sol_thread_alive PARAMS ((int pid));
-static void sol_core_close PARAMS ((int quitting));
-
-static void init_sol_thread_ops PARAMS ((void));
-static void init_sol_core_ops PARAMS ((void));
-
-#define THREAD_FLAG 0x80000000
-#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
-#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
-#define GET_LWP(LWP_ID) (TIDGET(LWP_ID))
-#define GET_THREAD(THREAD_ID) (((THREAD_ID) >> 16) & 0x7fff)
-#define BUILD_LWP(LWP_ID, PID) ((LWP_ID) << 16 | (PID))
-#define BUILD_THREAD(THREAD_ID, PID) (THREAD_FLAG | BUILD_LWP (THREAD_ID, PID))
+static char *td_err_string (td_err_e errcode);
+static char *td_state_string (td_thr_state_e statecode);
+static ptid_t thread_to_lwp (ptid_t thread_id, int default_lwp);
+static void sol_thread_resume (ptid_t ptid, int step, enum target_signal signo);
+static ptid_t lwp_to_thread (ptid_t lwp);
+static int sol_thread_alive (ptid_t ptid);
+static void sol_core_close (int quitting);
+
+static void init_sol_thread_ops (void);
+static void init_sol_core_ops (void);
+
+/* Default definitions: These must be defined in tm.h
+ if they are to be shared with a process module such as procfs. */
+
+#define GET_PID(ptid) ptid_get_pid (ptid)
+#define GET_LWP(ptid) ptid_get_lwp (ptid)
+#define GET_THREAD(ptid) ptid_get_tid (ptid)
+
+#define is_lwp(ptid) (GET_LWP (ptid) != 0)
+#define is_thread(ptid) (GET_THREAD (ptid) != 0)
+
+#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
+#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid)
/* Pointers to routines from lithread_db resolved by dlopen() */
-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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-static td_err_e
- (*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);
-
+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);
+static td_err_e (*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);
+static td_err_e (*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);
+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);
+static td_err_e (*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);
+static td_err_e (*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);
+static td_err_e (*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);
+static td_err_e (*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);
+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);
+static td_err_e (*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);
+static td_err_e (*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);
+static td_err_e (*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);
+
/*
-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.
*/
static char *
-td_err_string (errcode)
- td_err_e errcode;
+td_err_string (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 written/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 +229,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,36 +237,36 @@ td_err_string (errcode)
/*
-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.
*/
static char *
-td_state_string (statecode)
- td_thr_state_e statecode;
+td_state_string (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 +274,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,56 +282,54 @@ td_state_string (statecode)
/*
-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)
+ tpid_t 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()...
*/
-static int
-thread_to_lwp (thread_id, default_lwp)
- int thread_id;
- int default_lwp;
+static ptid_t
+thread_to_lwp (ptid_t thread_id, int default_lwp)
{
td_thrinfo_t ti;
td_thrhandle_t th;
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 pid_to_ptid (-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 pid_to_ptid (-1); /* thread must have terminated */
else if (val != TD_OK)
error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val));
if (ti.ti_state != TD_THR_ACTIVE)
{
if (default_lwp != -1)
- return default_lwp;
+ return pid_to_ptid (default_lwp);
error ("thread_to_lwp: thread state not active: %s",
td_state_string (ti.ti_state));
}
@@ -341,28 +339,27 @@ thread_to_lwp (thread_id, default_lwp)
/*
-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()...
*/
-static int
-lwp_to_thread (lwp)
- int lwp;
+static ptid_t
+lwp_to_thread (ptid_t lwp)
{
td_thrinfo_t ti;
td_thrhandle_t th;
@@ -374,70 +371,30 @@ lwp_to_thread (lwp)
/* It's an lwp. Convert it to a thread id. */
if (!sol_thread_alive (lwp))
- return -1; /* defunct lwp */
+ return pid_to_ptid (-1); /* defunct lwp */
val = p_td_ta_map_lwp2thr (main_ta, GET_LWP (lwp), &th);
if (val == TD_NOTHR)
- return -1; /* thread must have terminated */
+ return pid_to_ptid (-1); /* thread must have terminated */
else if (val != TD_OK)
error ("lwp_to_thread: td_ta_map_lwp2thr: %s.", td_err_string (val));
val = p_td_thr_validate (&th);
if (val == TD_NOTHR)
- return lwp; /* libthread doesn't know about it, just return lwp */
+ return lwp; /* libthread doesn't know about it;
+ just return lwp */
else if (val != TD_OK)
error ("lwp_to_thread: td_thr_validate: %s.", td_err_string (val));
val = p_td_thr_get_info (&th, &ti);
if (val == TD_NOTHR)
- return -1; /* thread must have terminated */
+ return pid_to_ptid (-1); /* thread must have terminated */
else if (val != TD_OK)
error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
return BUILD_THREAD (ti.ti_tid, PIDGET (lwp));
}
-/*
-
-LOCAL FUNCTION
-
- save_inferior_pid - Save inferior_pid on the cleanup list
- restore_inferior_pid - Restore inferior_pid from the cleanup list
-
-SYNOPSIS
-
- struct cleanup *save_inferior_pid ()
- void restore_inferior_pid (int pid)
-
-DESCRIPTION
-
- These two functions act in unison to restore inferior_pid in
- case of an error.
-
-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.
-
- */
-
-
-static struct cleanup *
-save_inferior_pid ()
-{
- return make_cleanup (restore_inferior_pid, inferior_pid);
-}
-
-static void
-restore_inferior_pid (pid)
- int pid;
-{
- inferior_pid = pid;
-}
-
/* Most target vector functions from here on actually just pass through to
procfs.c, as they don't need to do anything specific for threads. */
@@ -445,9 +402,7 @@ restore_inferior_pid (pid)
/* ARGSUSED */
static void
-sol_thread_open (arg, from_tty)
- char *arg;
- int from_tty;
+sol_thread_open (char *arg, int from_tty)
{
procfs_ops.to_open (arg, from_tty);
}
@@ -456,23 +411,23 @@ sol_thread_open (arg, from_tty)
and wait for the trace-trap that results from attaching. */
static void
-sol_thread_attach (args, from_tty)
- char *args;
- int from_tty;
+sol_thread_attach (char *args, int 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, auto_solib_add);
+
if (sol_thread_active)
{
printf_filtered ("sol-thread active.\n");
- main_ph.pid = inferior_pid; /* Save for xfer_memory */
+ main_ph.ptid = inferior_ptid; /* Save for xfer_memory */
push_target (&sol_thread_ops);
- inferior_pid = lwp_to_thread (inferior_pid);
- if (inferior_pid == -1)
- inferior_pid = main_ph.pid;
+ inferior_ptid = lwp_to_thread (inferior_ptid);
+ if (PIDGET (inferior_ptid) == -1)
+ inferior_ptid = main_ph.ptid;
else
- add_thread (inferior_pid);
+ add_thread (inferior_ptid);
}
/* XXX - might want to iterate over all the threads and register them. */
}
@@ -486,10 +441,9 @@ sol_thread_attach (args, from_tty)
started via the normal ptrace (PTRACE_TRACEME). */
static void
-sol_thread_detach (args, from_tty)
- char *args;
- int from_tty;
+sol_thread_detach (char *args, int from_tty)
{
+ inferior_ptid = pid_to_ptid (PIDGET (main_ph.ptid));
unpush_target (&sol_thread_ops);
procfs_ops.to_detach (args, from_tty);
}
@@ -500,32 +454,29 @@ sol_thread_detach (args, from_tty)
for procfs. */
static void
-sol_thread_resume (pid, step, signo)
- int pid;
- int step;
- enum target_signal signo;
+sol_thread_resume (ptid_t ptid, int step, enum target_signal signo)
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = thread_to_lwp (inferior_pid, main_ph.pid);
- if (inferior_pid == -1)
- inferior_pid = procfs_first_available ();
+ inferior_ptid = thread_to_lwp (inferior_ptid, PIDGET (main_ph.ptid));
+ if (PIDGET (inferior_ptid) == -1)
+ inferior_ptid = procfs_first_available ();
- if (pid != -1)
+ if (PIDGET (ptid) != -1)
{
- int save_pid = pid;
+ ptid_t save_ptid = ptid;
- pid = thread_to_lwp (pid, -2);
- if (pid == -2) /* Inactive thread */
+ ptid = thread_to_lwp (ptid, -2);
+ if (PIDGET (ptid) == -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",
- GET_THREAD (save_pid));
+ if (info_verbose && PIDGET (ptid) == -1)
+ warning ("Specified thread %ld seems to have terminated",
+ GET_THREAD (save_ptid));
}
- procfs_ops.to_resume (pid, step, signo);
+ procfs_ops.to_resume (ptid, step, signo);
do_cleanups (old_chain);
}
@@ -533,46 +484,44 @@ sol_thread_resume (pid, step, signo)
/* Wait for any threads to stop. We may have to convert PID from a thread id
to a LWP id, and vice versa on the way out. */
-static int
-sol_thread_wait (pid, ourstatus)
- int pid;
- struct target_waitstatus *ourstatus;
+static ptid_t
+sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
- int rtnval;
- int save_pid;
+ ptid_t rtnval;
+ ptid_t save_ptid;
struct cleanup *old_chain;
- save_pid = inferior_pid;
- old_chain = save_inferior_pid ();
+ save_ptid = inferior_ptid;
+ old_chain = save_inferior_ptid ();
- inferior_pid = thread_to_lwp (inferior_pid, main_ph.pid);
- if (inferior_pid == -1)
- inferior_pid = procfs_first_available ();
+ inferior_ptid = thread_to_lwp (inferior_ptid, PIDGET (main_ph.ptid));
+ if (PIDGET (inferior_ptid) == -1)
+ inferior_ptid = procfs_first_available ();
- if (pid != -1)
+ if (PIDGET (ptid) != -1)
{
- int save_pid = pid;
+ ptid_t save_ptid = ptid;
- pid = thread_to_lwp (pid, -2);
- if (pid == -2) /* Inactive thread */
+ ptid = thread_to_lwp (ptid, -2);
+ if (PIDGET (ptid) == -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",
- GET_THREAD (save_pid));
+ if (info_verbose && PIDGET (ptid) == -1)
+ warning ("Specified thread %ld seems to have terminated",
+ GET_THREAD (save_ptid));
}
- rtnval = procfs_ops.to_wait (pid, ourstatus);
+ rtnval = procfs_ops.to_wait (ptid, ourstatus);
if (ourstatus->kind != TARGET_WAITKIND_EXITED)
{
/* Map the LWP of interest back to the appropriate thread ID */
rtnval = lwp_to_thread (rtnval);
- if (rtnval == -1)
- rtnval = save_pid;
+ if (PIDGET (rtnval) == -1)
+ rtnval = save_ptid;
/* See if we have a new thread */
if (is_thread (rtnval)
- && rtnval != save_pid
+ && !ptid_equal (rtnval, save_ptid)
&& !in_thread_list (rtnval))
{
printf_filtered ("[New %s]\n", target_pid_to_str (rtnval));
@@ -590,8 +539,7 @@ sol_thread_wait (pid, ourstatus)
}
static void
-sol_thread_fetch_registers (regno)
- int regno;
+sol_thread_fetch_registers (int regno)
{
thread_t thread;
td_thrhandle_t thandle;
@@ -603,8 +551,8 @@ sol_thread_fetch_registers (regno)
caddr_t xregset;
#endif
- if (!is_thread (inferior_pid))
- { /* LWP: pass the request on to procfs.c */
+ if (!is_thread (inferior_ptid))
+ { /* LWP: pass the request on to procfs.c */
if (target_has_execution)
procfs_ops.to_fetch_registers (regno);
else
@@ -612,9 +560,9 @@ sol_thread_fetch_registers (regno)
return;
}
- /* Solaris thread: convert inferior_pid into a td_thrhandle_t */
+ /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */
- thread = GET_THREAD (inferior_pid);
+ thread = GET_THREAD (inferior_ptid);
if (thread == 0)
error ("sol_thread_fetch_registers: thread == 0");
@@ -647,8 +595,8 @@ sol_thread_fetch_registers (regno)
because the td routines call ps_lget* which affect the values stored in the
registers array. */
- supply_gregset (gregset);
- supply_fpregset (&fpregset);
+ supply_gregset ((gdb_gregset_t *) &gregset);
+ supply_fpregset ((gdb_fpregset_t *) &fpregset);
#if 0
/* thread_db doesn't seem to handle this right */
@@ -669,28 +617,27 @@ sol_thread_fetch_registers (regno)
}
static void
-sol_thread_store_registers (regno)
- int regno;
+sol_thread_store_registers (int regno)
{
thread_t thread;
td_thrhandle_t thandle;
td_err_e val;
- prgregset_t regset;
+ prgregset_t gregset;
prfpregset_t fpregset;
#if 0
int xregsize;
caddr_t xregset;
#endif
- if (!is_thread (inferior_pid))
- { /* LWP: pass the request on to procfs.c */
+ if (!is_thread (inferior_ptid))
+ { /* LWP: pass the request on to procfs.c */
procfs_ops.to_store_registers (regno);
return;
}
- /* Solaris thread: convert inferior_pid into a td_thrhandle_t */
+ /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */
- thread = GET_THREAD (inferior_pid);
+ thread = GET_THREAD (inferior_ptid);
val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
@@ -700,10 +647,10 @@ sol_thread_store_registers (regno)
if (regno != -1)
{ /* Not writing all the regs */
/* save new register value */
- char old_value[REGISTER_SIZE];
- memcpy(old_value, & registers[REGISTER_BYTE(regno)], REGISTER_SIZE);
+ char* old_value = (char*) alloca (REGISTER_SIZE);
+ memcpy (old_value, &registers[REGISTER_BYTE (regno)], REGISTER_SIZE);
- val = p_td_thr_getgregs (&thandle, regset);
+ val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getgregs %s",
td_err_string (val));
@@ -713,7 +660,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 */
@@ -733,10 +680,10 @@ sol_thread_store_registers (regno)
#endif
}
- fill_gregset (regset, regno);
- fill_fpregset (&fpregset, regno);
+ fill_gregset ((gdb_gregset_t *) &gregset, regno);
+ fill_fpregset ((gdb_fpregset_t *) &fpregset, regno);
- val = p_td_thr_setgregs (&thandle, regset);
+ val = p_td_thr_setgregs (&thandle, gregset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_setgregs %s",
td_err_string (val));
@@ -764,34 +711,38 @@ sol_thread_store_registers (regno)
debugged. */
static void
-sol_thread_prepare_to_store ()
+sol_thread_prepare_to_store (void)
{
procfs_ops.to_prepare_to_store ();
}
+/* Transfer LEN bytes between GDB address MYADDR and target address
+ MEMADDR. If DOWRITE is non-zero, transfer them to the target,
+ otherwise transfer them from the target. TARGET is unused.
+
+ Returns the number of bytes transferred. */
+
static int
-sol_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int dowrite;
- struct target_ops *target; /* ignored */
+sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
+ struct mem_attrib *attrib,
+ struct target_ops *target)
{
int retval;
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- 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. */
+ if (is_thread (inferior_ptid) || /* A thread */
+ !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */
+ inferior_ptid = procfs_first_available (); /* Find any live lwp. */
/* Note: don't need to call switch_to_thread; we're just reading memory. */
if (target_has_execution)
- retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, target);
+ retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
+ dowrite, attrib, target);
else
retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len,
- dowrite, target);
+ dowrite, attrib, target);
do_cleanups (old_chain);
@@ -801,46 +752,42 @@ sol_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
/* Print status information about what we're accessing. */
static void
-sol_thread_files_info (ignore)
- struct target_ops *ignore;
+sol_thread_files_info (struct target_ops *ignore)
{
procfs_ops.to_files_info (ignore);
}
static void
-sol_thread_kill_inferior ()
+sol_thread_kill_inferior (void)
{
procfs_ops.to_kill ();
}
static void
-sol_thread_notice_signals (pid)
- int pid;
+sol_thread_notice_signals (ptid_t ptid)
{
- procfs_ops.to_notice_signals (PIDGET (pid));
+ procfs_ops.to_notice_signals (pid_to_ptid (PIDGET (ptid)));
}
/* Fork an inferior process, and start debugging it with /proc. */
static void
-sol_thread_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
+sol_thread_create_inferior (char *exec_file, char *allargs, char **env)
{
procfs_ops.to_create_inferior (exec_file, allargs, env);
- if (sol_thread_active && inferior_pid != 0)
+ if (sol_thread_active && !ptid_equal (inferior_ptid, null_ptid))
{
- main_ph.pid = inferior_pid; /* Save for xfer_memory */
+ main_ph.ptid = inferior_ptid; /* Save for xfer_memory */
push_target (&sol_thread_ops);
- inferior_pid = lwp_to_thread (inferior_pid);
- if (inferior_pid == -1)
- inferior_pid = main_ph.pid;
+ inferior_ptid = lwp_to_thread (inferior_ptid);
+ if (PIDGET (inferior_ptid) == -1)
+ inferior_ptid = main_ph.ptid;
- add_thread (inferior_pid);
+ if (!in_thread_list (inferior_ptid))
+ add_thread (inferior_ptid);
}
}
@@ -850,22 +797,27 @@ sol_thread_create_inferior (exec_file, allargs, env)
those variables don't show up until the library gets mapped and the symbol
table is read in. */
+/* This new_objfile event is now managed by a chained function pointer.
+ * It is the callee's responsability to call the next client on the chain.
+ */
+
+/* Saved pointer to previous owner of the new_objfile event. */
+static void (*target_new_objfile_chain) (struct objfile *);
+
void
-sol_thread_new_objfile (objfile)
- struct objfile *objfile;
+sol_thread_new_objfile (struct objfile *objfile)
{
td_err_e val;
if (!objfile)
{
sol_thread_active = 0;
-
- return;
+ goto quit;
}
/* don't do anything if init failed to resolve the libthread_db library */
if (!procfs_suppress_run)
- return;
+ goto quit;
/* Now, initialize the thread debugging library. This needs to be done after
the shared libraries are located because it needs information from the
@@ -873,21 +825,31 @@ sol_thread_new_objfile (objfile)
val = p_td_init ();
if (val != TD_OK)
- error ("target_new_objfile: td_init: %s", td_err_string (val));
+ {
+ warning ("sol_thread_new_objfile: td_init: %s", td_err_string (val));
+ goto quit;
+ }
val = p_td_ta_new (&main_ph, &main_ta);
if (val == TD_NOLIBTHREAD)
- return;
+ goto quit;
else if (val != TD_OK)
- error ("target_new_objfile: td_ta_new: %s", td_err_string (val));
+ {
+ warning ("sol_thread_new_objfile: td_ta_new: %s", td_err_string (val));
+ goto quit;
+ }
sol_thread_active = 1;
+quit:
+ /* Call predecessor on chain, if any. */
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
}
/* Clean up after the inferior dies. */
static void
-sol_thread_mourn_inferior ()
+sol_thread_mourn_inferior (void)
{
unpush_target (&sol_thread_ops);
procfs_ops.to_mourn_inferior ();
@@ -896,54 +858,55 @@ sol_thread_mourn_inferior ()
/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
static int
-sol_thread_can_run ()
+sol_thread_can_run (void)
{
return procfs_suppress_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 (ptid_t ptid);
-DESCRIPTION
+ DESCRIPTION
- returns true if thread still active in inferior.
+ returns true if thread still active in inferior.
*/
static int
-sol_thread_alive (pid)
- int pid;
+sol_thread_alive (ptid_t ptid)
{
- if (is_thread (pid)) /* non-kernel thread */
+ if (is_thread (ptid)) /* non-kernel thread */
{
td_err_e val;
td_thrhandle_t th;
+ int pid;
- pid = GET_THREAD (pid);
+ pid = GET_THREAD (ptid);
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);
+ return procfs_ops.to_thread_alive (ptid);
else
- return orig_core_ops.to_thread_alive (pid);
+ return orig_core_ops.to_thread_alive (ptid);
}
}
static void
-sol_thread_stop ()
+sol_thread_stop (void)
{
procfs_ops.to_stop ();
}
@@ -954,11 +917,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,15 +930,17 @@ 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;
+typedef paddr_t gdb_ps_addr_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;
+typedef psaddr_t gdb_ps_addr_t;
#endif
@@ -984,33 +949,43 @@ typedef size_t gdb_ps_size_t;
by the time we call anything in thread_db, these routines need to do
nothing. */
+/* Process stop */
+
ps_err_e
ps_pstop (gdb_ps_prochandle_t ph)
{
return PS_OK;
}
+/* Process continue */
+
ps_err_e
ps_pcontinue (gdb_ps_prochandle_t ph)
{
return PS_OK;
}
+/* LWP stop */
+
ps_err_e
ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid)
{
return PS_OK;
}
+/* LWP continue */
+
ps_err_e
ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
{
return PS_OK;
}
+/* Looks up the symbol LD_SYMBOL_NAME in the debugger's symbol table. */
+
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, gdb_ps_addr_t * ld_symbol_addr)
{
struct minimal_symbol *ms;
@@ -1027,26 +1002,36 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
/* Common routine for reading and writing memory. */
static ps_err_e
-rw_common (int dowrite, const struct ps_prochandle *ph, paddr_t addr,
+rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
char *buf, int size)
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- 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. */
+ if (is_thread (inferior_ptid) || /* A thread */
+ !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */
+ inferior_ptid = procfs_first_available (); /* Find any live lwp. */
/* Note: don't need to call switch_to_thread; we're just reading memory. */
+#if defined (__sparcv9)
+ /* For Sparc64 cross Sparc32, make sure the address has not been
+ accidentally sign-extended (or whatever) to beyond 32 bits. */
+ if (bfd_get_arch_size (exec_bfd) == 32)
+ addr &= 0xffffffff;
+#endif
+
while (size > 0)
{
int cc;
+ /* FIXME: passing 0 as attrib argument. */
if (target_has_execution)
- cc = procfs_ops.to_xfer_memory (addr, buf, size, dowrite, &procfs_ops);
+ cc = procfs_ops.to_xfer_memory (addr, buf, size,
+ dowrite, 0, &procfs_ops);
else
- cc = orig_core_ops.to_xfer_memory (addr, buf, size, dowrite, &core_ops);
+ cc = orig_core_ops.to_xfer_memory (addr, buf, size,
+ dowrite, 0, &core_ops);
if (cc < 0)
{
@@ -1059,6 +1044,20 @@ rw_common (int dowrite, const struct ps_prochandle *ph, paddr_t addr,
return PS_ERR;
}
+ else if (cc == 0)
+ {
+ if (dowrite == 0)
+ warning ("rw_common (): unable to read at addr 0x%lx",
+ (long) addr);
+ else
+ warning ("rw_common (): unable to write at addr 0x%lx",
+ (long) addr);
+
+ do_cleanups (old_chain);
+
+ return PS_ERR;
+ }
+
size -= cc;
buf += cc;
}
@@ -1068,35 +1067,43 @@ rw_common (int dowrite, const struct ps_prochandle *ph, paddr_t addr,
return PS_OK;
}
+/* Copies SIZE bytes from target process .data segment to debugger memory. */
+
ps_err_e
-ps_pdread (gdb_ps_prochandle_t ph, paddr_t addr,
+ps_pdread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr,
gdb_ps_read_buf_t buf, gdb_ps_size_t size)
{
return rw_common (0, ph, addr, buf, size);
}
+/* Copies SIZE bytes from debugger memory .data segment to target process. */
+
ps_err_e
-ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
+ps_pdwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_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);
}
+/* Copies SIZE bytes from target process .text segment to debugger memory. */
+
ps_err_e
-ps_ptread (gdb_ps_prochandle_t ph, paddr_t addr,
+ps_ptread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr,
gdb_ps_read_buf_t buf, gdb_ps_size_t size)
{
return rw_common (0, ph, addr, buf, size);
}
+/* Copies SIZE bytes from debugger memory .text segment to target process. */
+
ps_err_e
-ps_ptwrite (gdb_ps_prochandle_t ph, paddr_t addr,
+ps_ptwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_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 */
+/* Get integer regs for LWP */
ps_err_e
ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@@ -1104,22 +1111,22 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-
if (target_has_execution)
procfs_ops.to_fetch_registers (-1);
else
orig_core_ops.to_fetch_registers (-1);
- fill_gregset (gregset, -1);
+ fill_gregset ((gdb_gregset_t *) gregset, -1);
do_cleanups (old_chain);
return PS_OK;
}
-/* Set integer regs */
+/* Set integer regs for LWP */
ps_err_e
ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@@ -1127,11 +1134,11 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-
- supply_gregset (gregset);
+ inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
+
+ supply_gregset ((gdb_gregset_t *) gregset);
if (target_has_execution)
procfs_ops.to_store_registers (-1);
else
@@ -1142,8 +1149,10 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
+/* Log a message (sends to gdb_stderr). */
+
void
-ps_plog (const char *fmt, ...)
+ps_plog (const char *fmt,...)
{
va_list args;
@@ -1226,42 +1235,42 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
return PS_OK;
}
-/* Get floating-point regs. */
+/* Get floating-point regs for LWP */
ps_err_e
ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
- prfpregset_t *fpregset)
+ prfpregset_t * fpregset)
{
struct cleanup *old_chain;
- old_chain = save_inferior_pid ();
+ old_chain = save_inferior_ptid ();
- inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
+ inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
if (target_has_execution)
procfs_ops.to_fetch_registers (-1);
else
orig_core_ops.to_fetch_registers (-1);
- fill_fpregset (fpregset, -1);
+ fill_fpregset ((gdb_fpregset_t *) fpregset, -1);
do_cleanups (old_chain);
return PS_OK;
}
-/* Set floating-point regs. */
+/* Set floating-point regs for LWP */
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 ();
+ old_chain = save_inferior_ptid ();
+
+ inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
- inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-
- supply_fpregset (fpregset);
+ supply_fpregset ((gdb_fpregset_t *) fpregset);
if (target_has_execution)
procfs_ops.to_store_registers (-1);
else
@@ -1272,93 +1281,83 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
-#ifdef TM_I386SOL2_H
+#ifdef PR_MODEL_LP64
+/* Identify process as 32-bit or 64-bit.
+ At the moment I'm using bfd to do this.
+ There might be a more solaris-specific (eg. procfs) method,
+ but this ought to work. */
+
+ps_err_e
+ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model)
+{
+ if (exec_bfd == 0)
+ *data_model = PR_MODEL_UNKNOWN;
+ else if (bfd_get_arch_size (exec_bfd) == 32)
+ *data_model = PR_MODEL_ILP32;
+ else
+ *data_model = PR_MODEL_LP64;
-/* Get local descriptor table. */
+ return PS_OK;
+}
+#endif /* PR_MODEL_LP64 */
-#include <sys/procfs.h>
-#include <sys/reg.h>
-#include <sys/sysi86.h>
+#ifdef TM_I386SOL2_H
-static int nldt_allocated = 0;
-static struct ssd *ldt_bufp = NULL;
+/* Reads the local descriptor table of a LWP. */
ps_err_e
ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
struct ssd *pldt)
{
- gregset_t gregset;
- int lwp_fd;
- ps_err_e val;
- int nldt;
- int i;
+ /* NOTE: only used on Solaris, therefore OK to refer to procfs.c */
+ extern struct ssd *procfs_find_LDT_entry (ptid_t);
+ struct ssd *ret;
- /* Get procfs file descriptor for the LWP. */
- lwp_fd = procfs_get_pid_fd (BUILD_LWP (lwpid, PIDGET (inferior_pid)));
- if (lwp_fd < 0)
- return PS_BADLID;
+ /* FIXME: can't I get the process ID from the prochandle or something?
+ */
- /* Fetch registers und LDT descriptors. */
- if (ioctl (lwp_fd, PIOCGREG, &gregset) == -1)
- return PS_ERR;
-
- if (ioctl (lwp_fd, PIOCNLDT, &nldt) == -1)
- return PS_ERR;
+ if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0)
+ return PS_BADLID;
- if (nldt_allocated < nldt)
+ ret = procfs_find_LDT_entry (BUILD_LWP (lwpid, PIDGET (inferior_ptid)));
+ if (ret)
{
- ldt_bufp
- = (struct ssd *) xrealloc (ldt_bufp, (nldt + 1) * sizeof (struct ssd));
- nldt_allocated = nldt;
+ memcpy (pldt, ret, sizeof (struct ssd));
+ return PS_OK;
}
-
- if (ioctl (lwp_fd, PIOCLDT, ldt_bufp) == -1)
+ else /* LDT not found. */
return PS_ERR;
-
- /* Search LDT for the LWP via register GS. */
- for (i = 0; i < nldt; i++)
- {
- if (ldt_bufp[i].sel == (gregset[GS] & 0xffff))
- {
- *pldt = ldt_bufp[i];
- return PS_OK;
- }
- }
-
- /* LDT not found. */
- return PS_ERR;
-}
+}
#endif /* TM_I386SOL2_H */
/* Convert a pid to printable form. */
char *
-solaris_pid_to_str (pid)
- int pid;
+solaris_pid_to_str (ptid_t ptid)
{
static char buf[100];
/* in case init failed to resolve the libthread_db library */
if (!procfs_suppress_run)
- return procfs_pid_to_str (pid);
+ return procfs_pid_to_str (ptid);
- if (is_thread (pid))
+ if (is_thread (ptid))
{
- int lwp;
+ ptid_t lwp;
- lwp = thread_to_lwp (pid, -2);
+ lwp = thread_to_lwp (ptid, -2);
- if (lwp == -1)
- sprintf (buf, "Thread %d (defunct)", GET_THREAD (pid));
- else if (lwp != -2)
- sprintf (buf, "Thread %d (LWP %d)", GET_THREAD (pid), GET_LWP (lwp));
+ if (PIDGET (lwp) == -1)
+ sprintf (buf, "Thread %ld (defunct)", GET_THREAD (ptid));
+ else if (PIDGET (lwp) != -2)
+ sprintf (buf, "Thread %ld (LWP %ld)", GET_THREAD (ptid), GET_LWP (lwp));
else
- sprintf (buf, "Thread %d ", GET_THREAD (pid));
+ sprintf (buf, "Thread %ld ", GET_THREAD (ptid));
}
- else if (GET_LWP (pid) != 0)
- sprintf (buf, "LWP %d ", GET_LWP (pid));
+ else if (GET_LWP (ptid) != 0)
+ sprintf (buf, "LWP %ld ", GET_LWP (ptid));
else
- sprintf (buf, "process %d ", PIDGET (pid));
+ sprintf (buf, "process %d ", PIDGET (ptid));
return buf;
}
@@ -1369,116 +1368,127 @@ solaris_pid_to_str (pid)
kernel) thread. */
static int
-sol_find_new_threads_callback(th, ignored)
- const td_thrhandle_t *th;
- void *ignored;
+sol_find_new_threads_callback (const td_thrhandle_t *th, void *ignored)
{
td_err_e retval;
td_thrinfo_t ti;
- int pid;
+ ptid_t ptid;
- 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);
+ ptid = BUILD_THREAD (ti.ti_tid, PIDGET (inferior_ptid));
+ if (!in_thread_list (ptid))
+ add_thread (ptid);
return 0;
}
-void
-sol_find_new_threads()
+static void
+sol_find_new_threads (void)
{
/* don't do anything if init failed to resolve the libthread_db library */
if (!procfs_suppress_run)
return;
- if (inferior_pid == -1)
+ if (PIDGET (inferior_ptid) == -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,
+ procfs_ops.to_find_new_threads (); /* first find new kernel threads */
+ 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);
}
static void
-sol_core_open (filename, from_tty)
- char *filename;
- int from_tty;
+sol_core_open (char *filename, int from_tty)
{
orig_core_ops.to_open (filename, from_tty);
}
static void
-sol_core_close (quitting)
- int quitting;
+sol_core_close (int quitting)
{
orig_core_ops.to_close (quitting);
}
static void
-sol_core_detach (args, from_tty)
- char *args;
- int from_tty;
+sol_core_detach (char *args, int from_tty)
{
unpush_target (&core_ops);
orig_core_ops.to_detach (args, from_tty);
}
static void
-sol_core_files_info (t)
- struct target_ops *t;
+sol_core_files_info (struct target_ops *t)
{
orig_core_ops.to_files_info (t);
}
-#ifdef MAINTENANCE_CMDS
/* Worker bee for info sol-thread command. This is a callback function that
gets called once for each Solaris thread (ie. not kernel thread) in the
inferior. Print anything interesting that we can think of. */
-static int
-info_cb (th, s)
- const td_thrhandle_t *th;
- void *s;
+static int
+info_cb (const td_thrhandle_t *th, void *s)
{
td_err_e ret;
td_thrinfo_t ti;
- struct minimal_symbol *msym;
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))
- printf_filtered (" startfunc: %s\n", SYMBOL_NAME (msym));
- else
- printf_filtered (" startfunc: 0x%08x\n", ti.ti_startfunc);
+ {
+ struct minimal_symbol *msym;
+ msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc);
+ if (msym)
+ printf_filtered (" startfunc: %s\n", SYMBOL_NAME (msym));
+ else
+ printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc));
+ }
/* If thread is asleep, print function that went to sleep: */
if (ti.ti_state == TD_THR_SLEEP)
- if (msym = lookup_minimal_symbol_by_pc (ti.ti_pc))
- printf_filtered (" - Sleep func: %s\n", SYMBOL_NAME (msym));
- else
- printf_filtered (" - Sleep func: 0x%08x\n", ti.ti_startfunc);
+ {
+ struct minimal_symbol *msym;
+ msym = lookup_minimal_symbol_by_pc (ti.ti_pc);
+ if (msym)
+ printf_filtered (" - Sleep func: %s\n", SYMBOL_NAME (msym));
+ else
+ printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc));
+ }
/* Wrap up line, if necessary */
if (ti.ti_state != TD_THR_SLEEP && ti.ti_startfunc == 0)
@@ -1487,33 +1497,44 @@ 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. */
static void
-info_solthreads (args, from_tty)
- char *args;
- int from_tty;
+info_solthreads (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);
}
-#endif /* MAINTENANCE_CMDS */
static int
-ignore (addr, contents)
- CORE_ADDR addr;
- char *contents;
+sol_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *data)
+{
+ return procfs_ops.to_find_memory_regions (func, data);
+}
+
+static char *
+sol_make_note_section (bfd *obfd, int *note_size)
+{
+ return procfs_ops.to_make_corefile_notes (obfd, note_size);
+}
+
+static int
+ignore (CORE_ADDR addr, char *contents)
{
return 0;
}
static void
-init_sol_thread_ops ()
+init_sol_thread_ops (void)
{
sol_thread_ops.to_shortname = "solaris-threads";
sol_thread_ops.to_longname = "Solaris threads and pthread.";
@@ -1544,6 +1565,8 @@ init_sol_thread_ops ()
sol_thread_ops.to_can_run = sol_thread_can_run;
sol_thread_ops.to_notice_signals = sol_thread_notice_signals;
sol_thread_ops.to_thread_alive = sol_thread_alive;
+ sol_thread_ops.to_pid_to_str = solaris_pid_to_str;
+ sol_thread_ops.to_find_new_threads = sol_find_new_threads;
sol_thread_ops.to_stop = sol_thread_stop;
sol_thread_ops.to_stratum = process_stratum;
sol_thread_ops.to_has_all_memory = 1;
@@ -1554,29 +1577,31 @@ init_sol_thread_ops ()
sol_thread_ops.to_has_thread_control = tc_none;
sol_thread_ops.to_sections = 0;
sol_thread_ops.to_sections_end = 0;
+ sol_thread_ops.to_find_memory_regions = sol_find_memory_regions;
+ sol_thread_ops.to_make_corefile_notes = sol_make_note_section;
sol_thread_ops.to_magic = OPS_MAGIC;
}
static void
-init_sol_core_ops ()
+init_sol_core_ops (void)
{
- 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; */
@@ -1585,17 +1610,24 @@ 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_thread_alive = sol_thread_alive;
+ sol_core_ops.to_pid_to_str = solaris_pid_to_str;
+ /* On Solaris/x86, when debugging a threaded core file from process <n>,
+ the following causes "info threads" to produce "procfs: couldn't find pid
+ <n> in procinfo list" where <n> is the pid of the process that produced
+ the core file. Disable it for now. */
+ /* sol_core_ops.to_find_new_threads = sol_find_new_threads; */
+ 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
@@ -1605,7 +1637,7 @@ init_sol_core_ops ()
int coreops_suppress_target = 1;
void
-_initialize_sol_thread ()
+_initialize_sol_thread (void)
{
void *dlhandle;
@@ -1648,18 +1680,19 @@ _initialize_sol_thread ()
procfs_suppress_run = 1;
-#ifdef MAINTENANCE_CMDS
- add_cmd ("sol-threads", class_maintenance, info_solthreads,
- "Show info on Solaris user threads.\n", &maintenanceinfolist);
-#endif /* MAINTENANCE_CMDS */
+ 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);
+ /* Hook into new_objfile notification. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = sol_thread_new_objfile;
return;
- die:
+die:
fprintf_unfiltered (gdb_stderr, "[GDB will not be able to debug user-mode threads: %s]\n", dlerror ());
@@ -1667,7 +1700,7 @@ _initialize_sol_thread ()
dlclose (dlhandle);
/* allow the user to debug non-threaded core files */
- add_target(&core_ops);
+ add_target (&core_ops);
return;
}
diff --git a/contrib/gdb/gdb/solib-legacy.c b/contrib/gdb/gdb/solib-legacy.c
new file mode 100644
index 0000000..ca730c4
--- /dev/null
+++ b/contrib/gdb/gdb/solib-legacy.c
@@ -0,0 +1,152 @@
+/* Provide legacy r_debug and link_map support for SVR4-like native targets.
+ Copyright 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#define _SYSCALL32 /* for Sparc64 cross Sparc32 */
+#include "defs.h"
+#include "gdbcore.h"
+#include "solib-svr4.h"
+
+#ifdef HAVE_LINK_H
+
+#ifdef HAVE_NLIST_H
+/* nlist.h needs to be included before link.h on some older *BSD systems. */
+#include <nlist.h>
+#endif
+
+#include <link.h>
+
+/* Fetch (and possibly build) an appropriate link_map_offsets structure
+ for native targets using struct definitions from link.h. */
+
+static struct link_map_offsets *
+legacy_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = 0;
+#if defined (HAVE_STRUCT_LINK_MAP32)
+ static struct link_map_offsets lmo32;
+ static struct link_map_offsets *lmp32 = 0;
+#endif
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+#define fieldsize(TYPE, MEMBER) (sizeof (((TYPE *)0)->MEMBER))
+
+ if (lmp == 0)
+ {
+ lmp = &lmo;
+
+#ifdef HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS
+ lmo.r_debug_size = sizeof (struct r_debug);
+
+ lmo.r_map_offset = offsetof (struct r_debug, r_map);
+ lmo.r_map_size = fieldsize (struct r_debug, r_map);
+
+ lmo.link_map_size = sizeof (struct link_map);
+
+ lmo.l_addr_offset = offsetof (struct link_map, l_addr);
+ lmo.l_addr_size = fieldsize (struct link_map, l_addr);
+
+ lmo.l_next_offset = offsetof (struct link_map, l_next);
+ lmo.l_next_size = fieldsize (struct link_map, l_next);
+
+ lmo.l_prev_offset = offsetof (struct link_map, l_prev);
+ lmo.l_prev_size = fieldsize (struct link_map, l_prev);
+
+ lmo.l_name_offset = offsetof (struct link_map, l_name);
+ lmo.l_name_size = fieldsize (struct link_map, l_name);
+#else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS) */
+#ifdef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS
+ lmo.link_map_size = sizeof (struct link_map);
+
+ lmo.l_addr_offset = offsetof (struct link_map, lm_addr);
+ lmo.l_addr_size = fieldsize (struct link_map, lm_addr);
+
+ lmo.l_next_offset = offsetof (struct link_map, lm_next);
+ lmo.l_next_size = fieldsize (struct link_map, lm_next);
+
+ lmo.l_name_offset = offsetof (struct link_map, lm_name);
+ lmo.l_name_size = fieldsize (struct link_map, lm_name);
+#else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS) */
+#if HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
+ lmo.link_map_size = sizeof (struct so_map);
+
+ lmo.l_addr_offset = offsetof (struct so_map, som_addr);
+ lmo.l_addr_size = fieldsize (struct so_map, som_addr);
+
+ lmo.l_next_offset = offsetof (struct so_map, som_next);
+ lmo.l_next_size = fieldsize (struct so_map, som_next);
+
+ lmo.l_name_offset = offsetof (struct so_map, som_path);
+ lmo.l_name_size = fieldsize (struct so_map, som_path);
+#endif /* HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
+#endif /* HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
+#endif /* HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS */
+ }
+
+#if defined (HAVE_STRUCT_LINK_MAP32)
+ if (lmp32 == 0)
+ {
+ lmp32 = &lmo32;
+
+ lmo32.r_debug_size = sizeof (struct r_debug32);
+
+ lmo32.r_map_offset = offsetof (struct r_debug32, r_map);
+ lmo32.r_map_size = fieldsize (struct r_debug32, r_map);
+
+ lmo32.link_map_size = sizeof (struct link_map32);
+
+ lmo32.l_addr_offset = offsetof (struct link_map32, l_addr);
+ lmo32.l_addr_size = fieldsize (struct link_map32, l_addr);
+
+ lmo32.l_next_offset = offsetof (struct link_map32, l_next);
+ lmo32.l_next_size = fieldsize (struct link_map32, l_next);
+
+ lmo32.l_prev_offset = offsetof (struct link_map32, l_prev);
+ lmo32.l_prev_size = fieldsize (struct link_map32, l_prev);
+
+ lmo32.l_name_offset = offsetof (struct link_map32, l_name);
+ lmo32.l_name_size = fieldsize (struct link_map32, l_name);
+ }
+#endif /* defined (HAVE_STRUCT_LINK_MAP32) */
+
+#if defined (HAVE_STRUCT_LINK_MAP32)
+ if (exec_bfd != NULL)
+ {
+ if (bfd_get_arch_size (exec_bfd) == 32)
+ return lmp32;
+ }
+ if (TARGET_PTR_BIT == 32)
+ return lmp32;
+#endif
+ return lmp;
+}
+
+#endif /* HAVE_LINK_H */
+
+void
+_initialize_svr4_lm (void)
+{
+#ifdef HAVE_LINK_H
+ legacy_svr4_fetch_link_map_offsets_hook = legacy_svr4_fetch_link_map_offsets;
+#endif /* HAVE_LINK_H */
+}
diff --git a/contrib/gdb/gdb/solib-osf.c b/contrib/gdb/gdb/solib-osf.c
new file mode 100644
index 0000000..a00e488
--- /dev/null
+++ b/contrib/gdb/gdb/solib-osf.c
@@ -0,0 +1,616 @@
+/* Handle OSF/1, Digital UNIX, and Tru64 shared libraries
+ for GDB, the GNU Debugger.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* When handling shared libraries, GDB has to find out the pathnames
+ of all shared libraries that are currently loaded (to read in their
+ symbols) and where the shared libraries are loaded in memory
+ (to relocate them properly from their prelinked addresses to the
+ current load address).
+
+ 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.
+
+ 2) Use the libxproc.a library, which contains the equivalent ldr_*
+ routines. The library is documented in Tru64 5.x, but as of 5.1, it
+ only allows a process to examine itself. On earlier versions, it
+ may require that the GDB executable be dynamically linked and that
+ NAT_CLIBS include -lxproc -Wl,-expect_unresolved,ldr_process_context
+ for GDB and all applications that are using libgdb.
+
+ We will use the peeking approach until libxproc.a works for other
+ processes. */
+
+#include "defs.h"
+
+#include <sys/types.h>
+#include <signal.h>
+#include "gdb_string.h"
+
+#include "bfd.h"
+#include "symtab.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "target.h"
+#include "inferior.h"
+#include "solist.h"
+
+#ifdef USE_LDR_ROUTINES
+# include <loader.h>
+#endif
+
+#ifndef USE_LDR_ROUTINES
+/* Definition of runtime loader structures, found by experimentation. */
+#define RLD_CONTEXT_ADDRESS 0x3ffc0000000
+
+/* Per-module information structure referenced by ldr_context_t.head. */
+
+typedef struct
+ {
+ CORE_ADDR next;
+ CORE_ADDR previous;
+ CORE_ADDR unknown1;
+ CORE_ADDR module_name;
+ CORE_ADDR modinfo_addr; /* used by next_link_map_member() to detect
+ the end of the shared module list */
+ long module_id;
+ CORE_ADDR unknown2;
+ CORE_ADDR unknown3;
+ long region_count;
+ CORE_ADDR regioninfo_addr;
+ }
+ldr_module_info_t;
+
+/* Per-region structure referenced by ldr_module_info_t.regioninfo_addr. */
+
+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;
+
+/* Structure at RLD_CONTEXT_ADDRESS specifying the start and finish addresses
+ of the shared module list. */
+
+typedef struct
+ {
+ CORE_ADDR unknown1;
+ CORE_ADDR unknown2;
+ CORE_ADDR head;
+ CORE_ADDR tail;
+ }
+ldr_context_t;
+#endif /* !USE_LDR_ROUTINES */
+
+/* Per-section information, stored in struct lm_info.secs. */
+
+struct lm_sec
+ {
+ CORE_ADDR offset; /* difference between default and actual
+ virtual addresses of section .name */
+ CORE_ADDR nameaddr; /* address in inferior of section name */
+ const char *name; /* name of section, null if not fetched */
+ };
+
+/* Per-module information, stored in struct so_list.lm_info. */
+
+struct lm_info
+ {
+ int isloader; /* whether the module is /sbin/loader */
+ int nsecs; /* length of .secs */
+ struct lm_sec secs[1]; /* variable-length array of sections, sorted
+ by name */
+ };
+
+/* Context for iterating through the inferior's shared module list. */
+
+struct read_map_ctxt
+ {
+#ifdef USE_LDR_ROUTINES
+ ldr_process_t proc;
+ ldr_module_t next;
+#else
+ CORE_ADDR next; /* next element in module list */
+ CORE_ADDR tail; /* last element in module list */
+#endif
+ };
+
+/* Forward declaration for this module's autoinit function. */
+
+extern void _initialize_osf_solib (void);
+
+#ifdef USE_LDR_ROUTINES
+# if 0
+/* This routine is intended to be called by ldr_* routines to read memory from
+ the current target. Usage:
+
+ ldr_process = ldr_core_process ();
+ ldr_set_core_reader (ldr_read_memory);
+ ldr_xdetach (ldr_process);
+ ldr_xattach (ldr_process);
+
+ ldr_core_process() and ldr_read_memory() are neither documented nor
+ declared in system header files. They work with OSF/1 2.x, and they might
+ work with later versions as well. */
+
+static int
+ldr_read_memory (CORE_ADDR memaddr, char *myaddr, int len, int readstring)
+{
+ int result;
+ char *buffer;
+
+ if (readstring)
+ {
+ target_read_string (memaddr, &buffer, len, &result);
+ if (result == 0)
+ strcpy (myaddr, buffer);
+ xfree (buffer);
+ }
+ else
+ result = target_read_memory (memaddr, myaddr, len);
+
+ if (result != 0)
+ result = -result;
+ return result;
+}
+# endif /* 0 */
+#endif /* USE_LDR_ROUTINES */
+
+/* Comparison for qsort() and bsearch(): return -1, 0, or 1 according to
+ whether lm_sec *P1's name is lexically less than, equal to, or greater
+ than that of *P2. */
+
+static int
+lm_sec_cmp (const void *p1, const void *p2)
+{
+ const struct lm_sec *lms1 = p1, *lms2 = p2;
+ return strcmp (lms1->name, lms2->name);
+}
+
+/* Sort LMI->secs so that osf_relocate_section_addresses() can binary-search
+ it. */
+
+static void
+lm_secs_sort (struct lm_info *lmi)
+{
+ qsort (lmi->secs, lmi->nsecs, sizeof *lmi->secs, lm_sec_cmp);
+}
+
+/* Populate name fields of LMI->secs. */
+
+static void
+fetch_sec_names (struct lm_info *lmi)
+{
+#ifndef USE_LDR_ROUTINES
+ int i, errcode;
+ struct lm_sec *lms;
+ char *name;
+
+ for (i = 0; i < lmi->nsecs; i++)
+ {
+ lms = lmi->secs + i;
+ target_read_string (lms->nameaddr, &name, PATH_MAX, &errcode);
+ if (errcode != 0)
+ {
+ warning ("unable to read shared sec name at 0x%lx", lms->nameaddr);
+ name = xstrdup ("");
+ }
+ lms->name = name;
+ }
+ lm_secs_sort (lmi);
+#endif
+}
+
+/* target_so_ops callback. Adjust SEC's addresses after it's been mapped into
+ the process. */
+
+static void
+osf_relocate_section_addresses (struct so_list *so,
+ struct section_table *sec)
+{
+ struct lm_info *lmi;
+ struct lm_sec lms_key, *lms;
+
+ /* Fetch SO's section names if we haven't done so already. */
+ lmi = so->lm_info;
+ if (lmi->nsecs && !lmi->secs[0].name)
+ fetch_sec_names (lmi);
+
+ /* Binary-search for offset information corresponding to SEC. */
+ lms_key.name = sec->the_bfd_section->name;
+ lms = bsearch (&lms_key, lmi->secs, lmi->nsecs, sizeof *lms, lm_sec_cmp);
+ if (lms)
+ {
+ sec->addr += lms->offset;
+ sec->endaddr += lms->offset;
+ }
+}
+
+/* target_so_ops callback. Free parts of SO allocated by this file. */
+
+static void
+osf_free_so (struct so_list *so)
+{
+ int i;
+ const char *name;
+
+ for (i = 0; i < so->lm_info->nsecs; i++)
+ {
+ name = so->lm_info->secs[i].name;
+ if (name)
+ xfree ((void *) name);
+ }
+ xfree (so->lm_info);
+}
+
+/* target_so_ops callback. Discard information accumulated by this file and
+ not freed by osf_free_so(). */
+
+static void
+osf_clear_solib (void)
+{
+ return;
+}
+
+/* target_so_ops callback. Prepare to handle shared libraries after the
+ inferior process has been created but before it's executed any
+ instructions.
+
+ For a statically bound executable, the inferior's 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. */
+
+static void
+osf_solib_create_inferior_hook (void)
+{
+ /* Nothing to do for statically bound executables. */
+
+ if (symfile_objfile == NULL
+ || symfile_objfile->obfd == NULL
+ || ((bfd_get_file_flags (symfile_objfile->obfd) & DYNAMIC) == 0))
+ return;
+
+ /* Now run the target. It will eventually get a SIGTRAP, at
+ 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;
+ do
+ {
+ target_resume (minus_one_ptid, 0, stop_signal);
+ wait_for_inferior ();
+ }
+ 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. */
+ solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
+ stop_soon_quietly = 0;
+
+ /* Enable breakpoints disabled (unnecessarily) by clear_solib(). */
+ re_enable_breakpoints_in_shlibs ();
+}
+
+/* target_so_ops callback. Do additional symbol handling, lookup, etc. after
+ symbols for a shared object have been loaded. */
+
+static void
+osf_special_symbol_handling (void)
+{
+ return;
+}
+
+/* Initialize CTXT in preparation for iterating through the inferior's module
+ list using read_map(). Return success. */
+
+static int
+open_map (struct read_map_ctxt *ctxt)
+{
+#ifdef USE_LDR_ROUTINES
+ ctxt->proc = ldr_my_process ();
+ if (ldr_xattach (ctxt->proc) != 0)
+ return 0;
+ ctxt->next = LDR_NULL_MODULE;
+#else
+ CORE_ADDR ldr_context_addr, prev, next;
+ ldr_context_t ldr_context;
+
+ if (target_read_memory ((CORE_ADDR) RLD_CONTEXT_ADDRESS,
+ (char *) &ldr_context_addr,
+ sizeof (CORE_ADDR)) != 0)
+ return 0;
+ if (target_read_memory (ldr_context_addr,
+ (char *) &ldr_context,
+ sizeof (ldr_context_t)) != 0)
+ return 0;
+ ctxt->next = ldr_context.head;
+ ctxt->tail = ldr_context.tail;
+#endif
+ return 1;
+}
+
+/* Initialize SO to have module NAME, /sbin/loader indicator ISLOADR, and
+ space for NSECS sections. */
+
+static void
+init_so (struct so_list *so, char *name, int isloader, int nsecs)
+{
+ int namelen, i;
+
+ /* solib.c requires various fields to be initialized to 0. */
+ memset (so, 0, sizeof *so);
+
+ /* Copy the name. */
+ namelen = strlen (name);
+ if (namelen >= SO_NAME_MAX_PATH_SIZE)
+ namelen = SO_NAME_MAX_PATH_SIZE - 1;
+
+ memcpy (so->so_original_name, name, namelen);
+ so->so_original_name[namelen] = '\0';
+ memcpy (so->so_name, so->so_original_name, namelen + 1);
+
+ /* Allocate section space. */
+ so->lm_info = xmalloc ((unsigned) &(((struct lm_info *)0)->secs) +
+ nsecs * sizeof *so->lm_info);
+ so->lm_info->isloader = isloader;
+ so->lm_info->nsecs = nsecs;
+ for (i = 0; i < nsecs; i++)
+ so->lm_info->secs[i].name = NULL;
+}
+
+/* Initialize SO's section SECIDX with name address NAMEADDR, name string
+ NAME, default virtual address VADDR, and actual virtual address
+ MAPADDR. */
+
+static void
+init_sec (struct so_list *so, int secidx, CORE_ADDR nameaddr,
+ const char *name, CORE_ADDR vaddr, CORE_ADDR mapaddr)
+{
+ struct lm_sec *lms;
+
+ lms = so->lm_info->secs + secidx;
+ lms->nameaddr = nameaddr;
+ lms->name = name;
+ lms->offset = mapaddr - vaddr;
+}
+
+/* If there are more elements starting at CTXT in inferior's module list,
+ store the next element in SO, advance CTXT to the next element, and return
+ 1, else return 0. */
+
+static int
+read_map (struct read_map_ctxt *ctxt, struct so_list *so)
+{
+ ldr_module_info_t minf;
+ ldr_region_info_t rinf;
+
+#ifdef USE_LDR_ROUTINES
+ size_t size;
+ ldr_region_t i;
+
+ /* Retrieve the next element. */
+ if (ldr_next_module (ctxt->proc, &ctxt->next) != 0)
+ return 0;
+ if (ctxt->next == LDR_NULL_MODULE)
+ return 0;
+ if (ldr_inq_module (ctxt->proc, ctxt->next, &minf, sizeof minf, &size) != 0)
+ return 0;
+
+ /* Initialize the module name and section count. */
+ init_so (so, minf.lmi_name, 0, minf.lmi_nregion);
+
+ /* Retrieve section names and offsets. */
+ for (i = 0; i < minf.lmi_nregion; i++)
+ {
+ if (ldr_inq_region (ctxt->proc, ctxt->next, i, &rinf,
+ sizeof rinf, &size) != 0)
+ goto err;
+ init_sec (so, (int) i, 0, xstrdup (rinf.lri_name),
+ (CORE_ADDR) rinf.lri_vaddr, (CORE_ADDR) rinf.lri_mapaddr);
+ }
+ lm_secs_sort (so->lm_info);
+#else
+ char *name;
+ int errcode, i;
+
+ /* Retrieve the next element. */
+ if (!ctxt->next)
+ return 0;
+ if (target_read_memory (ctxt->next, (char *) &minf, sizeof minf) != 0)
+ return 0;
+ if (ctxt->next == ctxt->tail)
+ ctxt->next = 0;
+ else
+ ctxt->next = minf.next;
+
+ /* Initialize the module name and section count. */
+ target_read_string (minf.module_name, &name, PATH_MAX, &errcode);
+ if (errcode != 0)
+ return 0;
+ init_so (so, name, !minf.modinfo_addr, minf.region_count);
+ xfree (name);
+
+ /* Retrieve section names and offsets. */
+ for (i = 0; i < minf.region_count; i++)
+ {
+ if (target_read_memory (minf.regioninfo_addr + i * sizeof rinf,
+ (char *) &rinf, sizeof rinf) != 0)
+ goto err;
+ init_sec (so, i, rinf.regionname_addr, NULL, rinf.vaddr, rinf.mapaddr);
+ }
+#endif /* !USE_LDR_ROUTINES */
+ return 1;
+
+ err:
+ osf_free_so (so);
+ return 0;
+}
+
+/* Free resources allocated by open_map (CTXT). */
+
+static void
+close_map (struct read_map_ctxt *ctxt)
+{
+#ifdef USE_LDR_ROUTINES
+ ldr_xdetach (ctxt->proc);
+#endif
+}
+
+/* target_so_ops callback. Return a list of shared objects currently loaded
+ in the inferior. */
+
+static struct so_list *
+osf_current_sos (void)
+{
+ struct so_list *head = NULL, *tail, *newtail, so;
+ struct read_map_ctxt ctxt;
+ int skipped_main;
+
+ if (!open_map (&ctxt))
+ return NULL;
+
+ /* Read subsequent elements. */
+ for (skipped_main = 0;;)
+ {
+ if (!read_map (&ctxt, &so))
+ break;
+
+ /* Skip the main program module, which is first in the list after
+ /sbin/loader. */
+ if (!so.lm_info->isloader && !skipped_main)
+ {
+ osf_free_so (&so);
+ skipped_main = 1;
+ continue;
+ }
+
+ newtail = xmalloc (sizeof *newtail);
+ if (!head)
+ head = newtail;
+ else
+ tail->next = newtail;
+ tail = newtail;
+
+ memcpy (tail, &so, sizeof so);
+ tail->next = NULL;
+ }
+
+ done:
+ close_map (&ctxt);
+ return head;
+}
+
+/* target_so_ops callback. Attempt to locate and open the main symbol
+ file. */
+
+static int
+osf_open_symbol_file_object (void *from_ttyp)
+{
+ struct read_map_ctxt ctxt;
+ struct so_list so;
+ int found;
+
+ if (symfile_objfile)
+ if (!query ("Attempt to reload symbols from process? "))
+ return 0;
+
+ /* The first module after /sbin/loader is the main program. */
+ if (!open_map (&ctxt))
+ return 0;
+ for (found = 0; !found;)
+ {
+ if (!read_map (&ctxt, &so))
+ break;
+ found = !so.lm_info->isloader;
+ osf_free_so (&so);
+ }
+ close_map (&ctxt);
+
+ if (found)
+ symbol_file_add_main (so.so_name, *(int *) from_ttyp);
+ return found;
+}
+
+/* target_so_ops callback. Return whether PC is in the dynamic linker. */
+
+static int
+osf_in_dynsym_resolve_code (CORE_ADDR pc)
+{
+ /* This function currently always return False. This is a temporary
+ solution which only consequence is to introduce a minor incovenience
+ for the user: When stepping inside a subprogram located in a shared
+ library, gdb might stop inside the dynamic loader code instead of
+ inside the subprogram itself. See the explanations in infrun.c about
+ the IN_SOLIB_DYNSYM_RESOLVE_CODE macro for more details. */
+ return 0;
+}
+
+static struct target_so_ops osf_so_ops;
+
+void
+_initialize_osf_solib (void)
+{
+ osf_so_ops.relocate_section_addresses = osf_relocate_section_addresses;
+ osf_so_ops.free_so = osf_free_so;
+ osf_so_ops.clear_solib = osf_clear_solib;
+ osf_so_ops.solib_create_inferior_hook = osf_solib_create_inferior_hook;
+ osf_so_ops.special_symbol_handling = osf_special_symbol_handling;
+ osf_so_ops.current_sos = osf_current_sos;
+ osf_so_ops.open_symbol_file_object = osf_open_symbol_file_object;
+ osf_so_ops.in_dynsym_resolve_code = osf_in_dynsym_resolve_code;
+
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ current_target_so_ops = &osf_so_ops;
+}
diff --git a/contrib/gdb/gdb/solib-sunos.c b/contrib/gdb/gdb/solib-sunos.c
new file mode 100644
index 0000000..0f81d05
--- /dev/null
+++ b/contrib/gdb/gdb/solib-sunos.c
@@ -0,0 +1,895 @@
+/* Handle SunOS shared libraries for GDB, the GNU Debugger.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include <sys/types.h>
+#include <signal.h>
+#include "gdb_string.h"
+#include <sys/param.h>
+#include <fcntl.h>
+
+ /* SunOS shared libs need the nlist structure. */
+#include <a.out.h>
+#include <link.h>
+
+#include "symtab.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "solist.h"
+
+/* Link map info to include in an allocated so_list entry */
+
+struct lm_info
+ {
+ /* Pointer to copy of link map from inferior. The type is char *
+ rather than void *, so that we may use byte offsets to find the
+ various fields without the need for a cast. */
+ char *lm;
+ };
+
+
+/* Symbols which are used to locate the base of the link map structures. */
+
+static char *debug_base_symbols[] =
+{
+ "_DYNAMIC",
+ "_DYNAMIC__MGC",
+ NULL
+};
+
+static char *main_name_list[] =
+{
+ "main_$main",
+ NULL
+};
+
+/* Macro to extract an address from a solib structure.
+ When GDB is configured for some 32-bit targets (e.g. Solaris 2.7
+ sparc), BFD is configured to handle 64-bit targets, so CORE_ADDR is
+ 64 bits. We have to extract only the significant bits of addresses
+ to get the right address when accessing the core file BFD. */
+
+#define SOLIB_EXTRACT_ADDRESS(MEMBER) \
+ extract_address (&(MEMBER), sizeof (MEMBER))
+
+/* local data declarations */
+
+static struct link_dynamic dynamic_copy;
+static struct link_dynamic_2 ld_2_copy;
+static struct ld_debug debug_copy;
+static CORE_ADDR debug_addr;
+static CORE_ADDR flag_addr;
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+#define fieldsize(TYPE, MEMBER) (sizeof (((TYPE *)0)->MEMBER))
+
+/* link map access functions */
+
+static CORE_ADDR
+LM_ADDR (struct so_list *so)
+{
+ int lm_addr_offset = offsetof (struct link_map, lm_addr);
+ int lm_addr_size = fieldsize (struct link_map, lm_addr);
+
+ return (CORE_ADDR) extract_signed_integer (so->lm_info->lm + lm_addr_offset,
+ lm_addr_size);
+}
+
+static CORE_ADDR
+LM_NEXT (struct so_list *so)
+{
+ int lm_next_offset = offsetof (struct link_map, lm_next);
+ int lm_next_size = fieldsize (struct link_map, lm_next);
+
+ return extract_address (so->lm_info->lm + lm_next_offset, lm_next_size);
+}
+
+static CORE_ADDR
+LM_NAME (struct so_list *so)
+{
+ int lm_name_offset = offsetof (struct link_map, lm_name);
+ int lm_name_size = fieldsize (struct link_map, lm_name);
+
+ return extract_address (so->lm_info->lm + lm_name_offset, lm_name_size);
+}
+
+static CORE_ADDR debug_base; /* Base of dynamic linker structures */
+
+/* Local function prototypes */
+
+static int match_main (char *);
+
+/* Allocate the runtime common object file. */
+
+static void
+allocate_rt_common_objfile (void)
+{
+ struct objfile *objfile;
+ struct objfile *last_one;
+
+ objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
+ memset (objfile, 0, sizeof (struct objfile));
+ objfile->md = NULL;
+ obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
+ xmalloc, xfree);
+ obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
+ xfree);
+ obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
+ xfree);
+ obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
+ xfree);
+ objfile->name = mstrsave (objfile->md, "rt_common");
+
+ /* Add this file onto the tail of the linked list of other such files. */
+
+ 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;
+ }
+
+ rt_common_objfile = objfile;
+}
+
+/* Read all dynamically loaded common symbol definitions from the inferior
+ and put them into the minimal symbol table for the runtime common
+ objfile. */
+
+static void
+solib_add_common_symbols (CORE_ADDR rtc_symp)
+{
+ struct rtc_symb inferior_rtc_symb;
+ struct nlist inferior_rtc_nlist;
+ int len;
+ char *name;
+
+ /* Remove any runtime common symbols from previous runs. */
+
+ 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,
+ xmalloc, xfree);
+ rt_common_objfile->minimal_symbol_count = 0;
+ rt_common_objfile->msymbols = NULL;
+ }
+
+ init_minimal_symbol_collection ();
+ make_cleanup_discard_minimal_symbols ();
+
+ while (rtc_symp)
+ {
+ read_memory (rtc_symp,
+ (char *) &inferior_rtc_symb,
+ sizeof (inferior_rtc_symb));
+ read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb.rtc_sp),
+ (char *) &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
+ current implementation the common symbol is allocated immediately
+ behind the name of the symbol. */
+ len = inferior_rtc_nlist.n_value - inferior_rtc_nlist.n_un.n_strx;
+
+ name = xmalloc (len);
+ read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_nlist.n_un.n_name),
+ name, len);
+
+ /* Allocate the runtime common objfile if necessary. */
+ if (rt_common_objfile == NULL)
+ allocate_rt_common_objfile ();
+
+ prim_record_minimal_symbol (name, inferior_rtc_nlist.n_value,
+ mst_bss, rt_common_objfile);
+ xfree (name);
+ }
+ rtc_symp = SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb.rtc_next);
+ }
+
+ /* Install any minimal symbols that have been collected as the current
+ minimal symbols for the runtime common objfile. */
+
+ install_minimal_symbols (rt_common_objfile);
+}
+
+
+/*
+
+ LOCAL FUNCTION
+
+ locate_base -- locate the base address of dynamic linker structs
+
+ SYNOPSIS
+
+ CORE_ADDR locate_base (void)
+
+ DESCRIPTION
+
+ For both the SunOS and SVR4 shared library implementations, if the
+ inferior executable has been linked dynamically, there is a single
+ address somewhere in the inferior's data space which is the key to
+ locating all of the dynamic linker's runtime structures. This
+ address is the value of the 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.
+
+ 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.
+
+ */
+
+static CORE_ADDR
+locate_base (void)
+{
+ struct minimal_symbol *msymbol;
+ CORE_ADDR address = 0;
+ char **symbolp;
+
+ /* For SunOS, we want to limit the search for the debug base symbol to the
+ executable being debugged, since there is a duplicate named symbol in the
+ shared library. We don't want the shared library versions. */
+
+ for (symbolp = debug_base_symbols; *symbolp != NULL; symbolp++)
+ {
+ msymbol = lookup_minimal_symbol (*symbolp, NULL, symfile_objfile);
+ if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ {
+ address = SYMBOL_VALUE_ADDRESS (msymbol);
+ return (address);
+ }
+ }
+ return (0);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ first_link_map_member -- locate first member in dynamic linker's map
+
+ SYNOPSIS
+
+ static CORE_ADDR first_link_map_member (void)
+
+ DESCRIPTION
+
+ Find the first element in the inferior's dynamic link map, and
+ return its address in the inferior. This function doesn't copy the
+ link map entry itself into our address space; current_sos actually
+ does the reading. */
+
+static CORE_ADDR
+first_link_map_member (void)
+{
+ CORE_ADDR lm = 0;
+
+ read_memory (debug_base, (char *) &dynamic_copy, sizeof (dynamic_copy));
+ 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. */
+ read_memory (SOLIB_EXTRACT_ADDRESS (dynamic_copy.ld_un.ld_2),
+ (char *) &ld_2_copy, sizeof (struct link_dynamic_2));
+ lm = SOLIB_EXTRACT_ADDRESS (ld_2_copy.ld_loaded);
+ }
+ return (lm);
+}
+
+static int
+open_symbol_file_object (void *from_ttyp)
+{
+ return 1;
+}
+
+
+/* LOCAL FUNCTION
+
+ current_sos -- build a list of currently loaded shared objects
+
+ SYNOPSIS
+
+ struct so_list *current_sos ()
+
+ DESCRIPTION
+
+ Build a list of `struct so_list' objects describing the shared
+ objects currently loaded in the inferior. This list does not
+ include an entry for the main executable file.
+
+ Note that we only gather information directly available from the
+ inferior --- we don't examine any of the shared library files
+ themselves. The declaration of `struct so_list' says which fields
+ we provide values for. */
+
+static struct so_list *
+sunos_current_sos (void)
+{
+ CORE_ADDR lm;
+ struct so_list *head = 0;
+ struct so_list **link_ptr = &head;
+ int errcode;
+ char *buffer;
+
+ /* Make sure we've looked up the inferior's dynamic linker's base
+ structure. */
+ if (! debug_base)
+ {
+ debug_base = locate_base ();
+
+ /* If we can't find the dynamic linker's base structure, this
+ must not be a dynamically linked executable. Hmm. */
+ if (! debug_base)
+ return 0;
+ }
+
+ /* Walk the inferior's link map list, and build our list of
+ `struct so_list' nodes. */
+ lm = first_link_map_member ();
+ while (lm)
+ {
+ struct so_list *new
+ = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct cleanup *old_chain = make_cleanup (xfree, new);
+
+ memset (new, 0, sizeof (*new));
+
+ new->lm_info = xmalloc (sizeof (struct lm_info));
+ make_cleanup (xfree, new->lm_info);
+
+ new->lm_info->lm = xmalloc (sizeof (struct link_map));
+ make_cleanup (xfree, new->lm_info->lm);
+ memset (new->lm_info->lm, 0, sizeof (struct link_map));
+
+ read_memory (lm, new->lm_info->lm, sizeof (struct link_map));
+
+ lm = LM_NEXT (new);
+
+ /* Extract this shared object's name. */
+ target_read_string (LM_NAME (new), &buffer,
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+ if (errcode != 0)
+ {
+ warning ("current_sos: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ }
+ else
+ {
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (buffer);
+ strcpy (new->so_original_name, new->so_name);
+ }
+
+ /* If this entry has no name, or its name matches the name
+ for the main executable, don't include it in the list. */
+ if (! new->so_name[0]
+ || match_main (new->so_name))
+ free_so (new);
+ else
+ {
+ new->next = 0;
+ *link_ptr = new;
+ link_ptr = &new->next;
+ }
+
+ discard_cleanups (old_chain);
+ }
+
+ return head;
+}
+
+
+/* On some systems, the only way to recognize the link map entry for
+ the main executable file is by looking at its name. Return
+ non-zero iff SONAME matches one of the known main executable names. */
+
+static int
+match_main (char *soname)
+{
+ char **mainp;
+
+ for (mainp = main_name_list; *mainp != NULL; mainp++)
+ {
+ if (strcmp (soname, *mainp) == 0)
+ return (1);
+ }
+
+ return (0);
+}
+
+
+static int
+sunos_in_dynsym_resolve_code (CORE_ADDR pc)
+{
+ return 0;
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ disable_break -- remove the "mapping changed" breakpoint
+
+ SYNOPSIS
+
+ static int disable_break ()
+
+ DESCRIPTION
+
+ Removes the breakpoint that gets hit when the dynamic linker
+ completes a mapping change.
+
+ */
+
+static int
+disable_break (void)
+{
+ CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
+
+ 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
+ contents back. */
+
+ read_memory (debug_addr, (char *) &debug_copy, sizeof (debug_copy));
+
+ /* Set `in_debugger' to zero now. */
+
+ write_memory (flag_addr, (char *) &in_debugger, sizeof (in_debugger));
+
+ breakpoint_addr = SOLIB_EXTRACT_ADDRESS (debug_copy.ldd_bp_addr);
+ write_memory (breakpoint_addr, (char *) &debug_copy.ldd_bp_inst,
+ sizeof (debug_copy.ldd_bp_inst));
+
+ /* For the SVR4 version, we always know the breakpoint address. For the
+ SunOS version we don't know it until the above code is executed.
+ Grumble if we are stopped anywhere besides the breakpoint address. */
+
+ if (stop_pc != breakpoint_addr)
+ {
+ warning ("stopped at unknown breakpoint while handling shared libraries");
+ }
+
+ return 1;
+}
+
+
+/*
+
+ 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 (void)
+{
+ int success = 0;
+ int j;
+ int in_debugger;
+
+ /* Get link_dynamic structure */
+
+ j = target_read_memory (debug_base, (char *) &dynamic_copy,
+ sizeof (dynamic_copy));
+ if (j)
+ {
+ /* unreadable */
+ return (0);
+ }
+
+ /* Calc address of debugger interface structure */
+
+ debug_addr = SOLIB_EXTRACT_ADDRESS (dynamic_copy.ldd);
+
+ /* Calc address of `in_debugger' member of debugger interface structure */
+
+ flag_addr = debug_addr + (CORE_ADDR) ((char *) &debug_copy.ldd_in_debugger -
+ (char *) &debug_copy);
+
+ /* Write a value of 1 to this member. */
+
+ in_debugger = 1;
+ write_memory (flag_addr, (char *) &in_debugger, sizeof (in_debugger));
+ success = 1;
+
+ return (success);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ special_symbol_handling -- additional shared library symbol handling
+
+ SYNOPSIS
+
+ void special_symbol_handling ()
+
+ DESCRIPTION
+
+ Once the symbols from a shared object have been loaded in the usual
+ way, we are called to do any system specific symbol handling that
+ is needed.
+
+ For SunOS4, this 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
+sunos_special_symbol_handling (void)
+{
+ int j;
+
+ if (debug_addr == 0)
+ {
+ /* Get link_dynamic structure */
+
+ j = target_read_memory (debug_base, (char *) &dynamic_copy,
+ sizeof (dynamic_copy));
+ if (j)
+ {
+ /* unreadable */
+ return;
+ }
+
+ /* Calc address of debugger interface structure */
+ /* FIXME, this needs work for cross-debugging of core files
+ (byteorder, size, alignment, etc). */
+
+ debug_addr = SOLIB_EXTRACT_ADDRESS (dynamic_copy.ldd);
+ }
+
+ /* Read the debugger structure from the inferior, just to make sure
+ we have a current copy. */
+
+ j = target_read_memory (debug_addr, (char *) &debug_copy,
+ sizeof (debug_copy));
+ if (j)
+ return; /* unreadable */
+
+ /* Get common symbol definitions for the loaded object. */
+
+ if (debug_copy.ldd_cp)
+ {
+ solib_add_common_symbols (SOLIB_EXTRACT_ADDRESS (debug_copy.ldd_cp));
+ }
+}
+
+/* Relocate the main executable. This function should be called upon
+ stopping the inferior process at the entry point to the program.
+ The entry point from BFD is compared to the PC and if they are
+ different, the main executable is relocated by the proper amount.
+
+ As written it will only attempt to relocate executables which
+ lack interpreter sections. It seems likely that only dynamic
+ linker executables will get relocated, though it should work
+ properly for a position-independent static executable as well. */
+
+static void
+sunos_relocate_main_executable (void)
+{
+ asection *interp_sect;
+ CORE_ADDR pc = read_pc ();
+
+ /* Decide if the objfile needs to be relocated. As indicated above,
+ we will only be here when execution is stopped at the beginning
+ of the program. Relocation is necessary if the address at which
+ we are presently stopped differs from the start address stored in
+ the executable AND there's no interpreter section. The condition
+ regarding the interpreter section is very important because if
+ there *is* an interpreter section, execution will begin there
+ instead. When there is an interpreter section, the start address
+ is (presumably) used by the interpreter at some point to start
+ execution of the program.
+
+ If there is an interpreter, it is normal for it to be set to an
+ arbitrary address at the outset. The job of finding it is
+ handled in enable_break().
+
+ So, to summarize, relocations are necessary when there is no
+ interpreter section and the start address obtained from the
+ executable is different from the address at which GDB is
+ currently stopped.
+
+ [ The astute reader will note that we also test to make sure that
+ the executable in question has the DYNAMIC flag set. It is my
+ opinion that this test is unnecessary (undesirable even). It
+ was added to avoid inadvertent relocation of an executable
+ whose e_type member in the ELF header is not ET_DYN. There may
+ be a time in the future when it is desirable to do relocations
+ on other types of files as well in which case this condition
+ should either be removed or modified to accomodate the new file
+ type. (E.g, an ET_EXEC executable which has been built to be
+ position-independent could safely be relocated by the OS if
+ desired. It is true that this violates the ABI, but the ABI
+ has been known to be bent from time to time.) - Kevin, Nov 2000. ]
+ */
+
+ interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
+ if (interp_sect == NULL
+ && (bfd_get_file_flags (exec_bfd) & DYNAMIC) != 0
+ && bfd_get_start_address (exec_bfd) != pc)
+ {
+ struct cleanup *old_chain;
+ struct section_offsets *new_offsets;
+ int i, changed;
+ CORE_ADDR displacement;
+
+ /* It is necessary to relocate the objfile. The amount to
+ relocate by is simply the address at which we are stopped
+ minus the starting address from the executable.
+
+ We relocate all of the sections by the same amount. This
+ behavior is mandated by recent editions of the System V ABI.
+ According to the System V Application Binary Interface,
+ Edition 4.1, page 5-5:
+
+ ... Though the system chooses virtual addresses for
+ individual processes, it maintains the segments' relative
+ positions. Because position-independent code uses relative
+ addressesing between segments, the difference between
+ virtual addresses in memory must match the difference
+ between virtual addresses in the file. The difference
+ between the virtual address of any segment in memory and
+ the corresponding virtual address in the file is thus a
+ single constant value for any one executable or shared
+ object in a given process. This difference is the base
+ address. One use of the base address is to relocate the
+ memory image of the program during dynamic linking.
+
+ The same language also appears in Edition 4.0 of the System V
+ ABI and is left unspecified in some of the earlier editions. */
+
+ displacement = pc - bfd_get_start_address (exec_bfd);
+ changed = 0;
+
+ new_offsets = xcalloc (symfile_objfile->num_sections,
+ sizeof (struct section_offsets));
+ old_chain = make_cleanup (xfree, new_offsets);
+
+ for (i = 0; i < symfile_objfile->num_sections; i++)
+ {
+ if (displacement != ANOFFSET (symfile_objfile->section_offsets, i))
+ changed = 1;
+ new_offsets->offsets[i] = displacement;
+ }
+
+ if (changed)
+ objfile_relocate (symfile_objfile, new_offsets);
+
+ do_cleanups (old_chain);
+ }
+}
+
+/*
+
+ GLOBAL FUNCTION
+
+ sunos_solib_create_inferior_hook -- shared library startup support
+
+ SYNOPSIS
+
+ void sunos_solib_create_inferior_hook()
+
+ DESCRIPTION
+
+ When gdb starts up the inferior, it nurses it along (through the
+ shell) until it is ready to execute it's first instruction. At this
+ point, this function gets called via expansion of the macro
+ SOLIB_CREATE_INFERIOR_HOOK.
+
+ For SunOS executables, this first instruction is typically the
+ one at "_start", or a similar text label, regardless of whether
+ the executable is statically or dynamically linked. The runtime
+ startup code takes care of dynamically linking in any shared
+ libraries, once gdb allows the inferior to continue.
+
+ For SVR4 executables, this first instruction is either the first
+ instruction in the dynamic linker (for dynamically linked
+ executables) or the instruction at "start" for statically linked
+ executables. For dynamically linked executables, the system
+ first exec's /lib/libc.so.N, which contains the dynamic linker,
+ and starts it running. The dynamic linker maps in any needed
+ shared libraries, maps in the actual user executable, and then
+ jumps to "start" in the user executable.
+
+ For both SunOS shared libraries, and SVR4 shared libraries, we
+ can arrange to cooperate with the dynamic linker to discover the
+ names of shared libraries that are dynamically linked, and the
+ base addresses to which they are linked.
+
+ This function is responsible for discovering those names and
+ addresses, and saving sufficient information about them to allow
+ their symbols to be read at a later time.
+
+ FIXME
+
+ Between enable_break() and disable_break(), this code does not
+ properly handle hitting breakpoints which the user might have
+ set in the startup code or in the dynamic linker itself. Proper
+ handling will probably have to wait until the implementation is
+ changed to use the "breakpoint handler function" method.
+
+ Also, what if child has exit()ed? Must exit loop somehow.
+ */
+
+static void
+sunos_solib_create_inferior_hook (void)
+{
+ /* Relocate the main executable if necessary. */
+ sunos_relocate_main_executable ();
+
+ if ((debug_base = locate_base ()) == 0)
+ {
+ /* Can't find the symbol or the executable is statically linked. */
+ return;
+ }
+
+ if (!enable_break ())
+ {
+ warning ("shared library handler failed to enable breakpoint");
+ return;
+ }
+
+ /* SCO and SunOS need the loop below, other systems should be using the
+ special shared library breakpoints and the shared library breakpoint
+ service routine.
+
+ Now run the target. It will eventually hit the breakpoint, at
+ which point all of the libraries will have been mapped in and we
+ can go groveling around in the dynamic linker structures to find
+ out what we need to know about them. */
+
+ clear_proceed_status ();
+ stop_soon_quietly = 1;
+ stop_signal = TARGET_SIGNAL_0;
+ do
+ {
+ target_resume (pid_to_ptid (-1), 0, stop_signal);
+ wait_for_inferior ();
+ }
+ while (stop_signal != TARGET_SIGNAL_TRAP);
+ stop_soon_quietly = 0;
+
+ /* We are now either at the "mapping complete" breakpoint (or somewhere
+ else, a condition we aren't prepared to deal with anyway), so adjust
+ the PC as necessary after a breakpoint, disable the breakpoint, and
+ add any shared libraries that were mapped in. */
+
+ if (DECR_PC_AFTER_BREAK)
+ {
+ stop_pc -= DECR_PC_AFTER_BREAK;
+ write_register (PC_REGNUM, stop_pc);
+ }
+
+ if (!disable_break ())
+ {
+ warning ("shared library handler failed to disable breakpoint");
+ }
+
+ solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
+}
+
+static void
+sunos_clear_solib (void)
+{
+ debug_base = 0;
+}
+
+static void
+sunos_free_so (struct so_list *so)
+{
+ xfree (so->lm_info->lm);
+ xfree (so->lm_info);
+}
+
+static void
+sunos_relocate_section_addresses (struct so_list *so,
+ struct section_table *sec)
+{
+ sec->addr += LM_ADDR (so);
+ sec->endaddr += LM_ADDR (so);
+}
+
+static struct target_so_ops sunos_so_ops;
+
+void
+_initialize_sunos_solib (void)
+{
+ sunos_so_ops.relocate_section_addresses = sunos_relocate_section_addresses;
+ sunos_so_ops.free_so = sunos_free_so;
+ sunos_so_ops.clear_solib = sunos_clear_solib;
+ sunos_so_ops.solib_create_inferior_hook = sunos_solib_create_inferior_hook;
+ sunos_so_ops.special_symbol_handling = sunos_special_symbol_handling;
+ sunos_so_ops.current_sos = sunos_current_sos;
+ sunos_so_ops.open_symbol_file_object = open_symbol_file_object;
+ sunos_so_ops.in_dynsym_resolve_code = sunos_in_dynsym_resolve_code;
+
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ current_target_so_ops = &sunos_so_ops;
+}
diff --git a/contrib/gdb/gdb/solib-svr4.c b/contrib/gdb/gdb/solib-svr4.c
new file mode 100644
index 0000000..9c71509
--- /dev/null
+++ b/contrib/gdb/gdb/solib-svr4.c
@@ -0,0 +1,1359 @@
+/* Handle SVR4 shared libraries for GDB, the GNU Debugger.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "elf/external.h"
+#include "elf/common.h"
+#include "elf/mips.h"
+
+#include "symtab.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "inferior.h"
+
+#include "solist.h"
+#include "solib-svr4.h"
+
+#ifndef SVR4_FETCH_LINK_MAP_OFFSETS
+#define SVR4_FETCH_LINK_MAP_OFFSETS() svr4_fetch_link_map_offsets ()
+#endif
+
+static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
+static struct link_map_offsets *legacy_fetch_link_map_offsets (void);
+
+/* fetch_link_map_offsets_gdbarch_data is a handle used to obtain the
+ architecture specific link map offsets fetching function. */
+
+static struct gdbarch_data *fetch_link_map_offsets_gdbarch_data;
+
+/* legacy_svr4_fetch_link_map_offsets_hook is a pointer to a function
+ which is used to fetch link map offsets. It will only be set
+ by solib-legacy.c, if at all. */
+
+struct link_map_offsets *(*legacy_svr4_fetch_link_map_offsets_hook)(void) = 0;
+
+/* Link map info to include in an allocated so_list entry */
+
+struct lm_info
+ {
+ /* Pointer to copy of link map from inferior. The type is char *
+ rather than void *, so that we may use byte offsets to find the
+ various fields without the need for a cast. */
+ char *lm;
+ };
+
+/* On SVR4 systems, a list of symbols in the dynamic linker where
+ GDB can try to place a breakpoint to monitor shared library
+ events.
+
+ If none of these symbols are found, or other errors occur, then
+ SVR4 systems will fall back to using a symbol as the "startup
+ mapping complete" breakpoint address. */
+
+static char *solib_break_names[] =
+{
+ "r_debug_state",
+ "_r_debug_state",
+ "_dl_debug_state",
+ "rtld_db_dlactivity",
+ "_rtld_debug_state",
+ NULL
+};
+
+#define BKPT_AT_SYMBOL 1
+
+#if defined (BKPT_AT_SYMBOL)
+static char *bkpt_names[] =
+{
+#ifdef SOLIB_BKPT_NAME
+ SOLIB_BKPT_NAME, /* Prefer configured name if it exists. */
+#endif
+ "_start",
+ "main",
+ NULL
+};
+#endif
+
+static char *main_name_list[] =
+{
+ "main_$main",
+ NULL
+};
+
+/* Macro to extract an address from a solib structure.
+ When GDB is configured for some 32-bit targets (e.g. Solaris 2.7
+ sparc), BFD is configured to handle 64-bit targets, so CORE_ADDR is
+ 64 bits. We have to extract only the significant bits of addresses
+ to get the right address when accessing the core file BFD. */
+
+#define SOLIB_EXTRACT_ADDRESS(MEMBER) \
+ extract_address (&(MEMBER), sizeof (MEMBER))
+
+/* local data declarations */
+
+/* link map access functions */
+
+static CORE_ADDR
+LM_ADDR (struct so_list *so)
+{
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+
+ return (CORE_ADDR) extract_signed_integer (so->lm_info->lm + lmo->l_addr_offset,
+ lmo->l_addr_size);
+}
+
+static CORE_ADDR
+LM_NEXT (struct so_list *so)
+{
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+
+ return extract_address (so->lm_info->lm + lmo->l_next_offset, lmo->l_next_size);
+}
+
+static CORE_ADDR
+LM_NAME (struct so_list *so)
+{
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+
+ return extract_address (so->lm_info->lm + lmo->l_name_offset, lmo->l_name_size);
+}
+
+static int
+IGNORE_FIRST_LINK_MAP_ENTRY (struct so_list *so)
+{
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+
+ return extract_address (so->lm_info->lm + lmo->l_prev_offset,
+ lmo->l_prev_size) == 0;
+}
+
+static CORE_ADDR debug_base; /* Base of dynamic linker structures */
+static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
+
+/* Local function prototypes */
+
+static int match_main (char *);
+
+static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
+
+/*
+
+ LOCAL FUNCTION
+
+ bfd_lookup_symbol -- lookup the value for a specific symbol
+
+ SYNOPSIS
+
+ CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname)
+
+ 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.
+
+ Note that 0 is specifically allowed as an error return (no
+ such symbol).
+ */
+
+static CORE_ADDR
+bfd_lookup_symbol (bfd *abfd, char *symname)
+{
+ long storage_needed;
+ asymbol *sym;
+ asymbol **symbol_table;
+ unsigned int number_of_symbols;
+ 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 (xfree, (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))
+ {
+ /* Bfd symbols are section relative. */
+ symaddr = sym->value + sym->section->vma;
+ break;
+ }
+ }
+ do_cleanups (back_to);
+ }
+
+ if (symaddr)
+ return symaddr;
+
+ /* On FreeBSD, the dynamic linker is stripped by default. So we'll
+ have to check the dynamic string table too. */
+
+ storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
+
+ if (storage_needed > 0)
+ {
+ symbol_table = (asymbol **) xmalloc (storage_needed);
+ back_to = make_cleanup (xfree, (PTR) symbol_table);
+ number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
+
+ for (i = 0; i < number_of_symbols; i++)
+ {
+ sym = *symbol_table++;
+ if (STREQ (sym->name, symname))
+ {
+ /* Bfd symbols are section relative. */
+ symaddr = sym->value + sym->section->vma;
+ break;
+ }
+ }
+ do_cleanups (back_to);
+ }
+
+ return symaddr;
+}
+
+#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 */
+ NULL
+};
+
+static int look_for_base (int, CORE_ADDR);
+
+/*
+
+ LOCAL FUNCTION
+
+ look_for_base -- examine file for each mapped address segment
+
+ SYNOPSYS
+
+ static int look_for_base (int fd, CORE_ADDR baseaddr)
+
+ 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.
+
+ 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.
+ */
+
+static int
+look_for_base (int fd, CORE_ADDR baseaddr)
+{
+ bfd *interp_bfd;
+ CORE_ADDR address = 0;
+ char **symbolp;
+
+ /* If the fd is -1, then there is no file that corresponds to this
+ mapped memory segment, so skip it. Also, if the fd corresponds
+ to the exec file, skip it as well. */
+
+ if (fd == -1
+ || (exec_bfd != NULL
+ && fdmatch (fileno ((FILE *) (exec_bfd->iostream)), fd)))
+ {
+ return (0);
+ }
+
+ /* Try to open whatever random file this fd corresponds to. Note that
+ we have no way currently to find the filename. Don't gripe about
+ any problems we might have, just fail. */
+
+ if ((interp_bfd = bfd_fdopenr ("unnamed", gnutarget, fd)) == NULL)
+ {
+ return (0);
+ }
+ if (!bfd_check_format (interp_bfd, bfd_object))
+ {
+ /* FIXME-leak: on failure, might not free all memory associated with
+ interp_bfd. */
+ bfd_close (interp_bfd);
+ return (0);
+ }
+
+ /* Now try to find our debug base symbol in this file, which we at
+ least know to be a valid ELF executable or shared library. */
+
+ for (symbolp = debug_base_symbols; *symbolp != NULL; symbolp++)
+ {
+ address = bfd_lookup_symbol (interp_bfd, *symbolp);
+ if (address != 0)
+ {
+ break;
+ }
+ }
+ if (address == 0)
+ {
+ /* FIXME-leak: on failure, might not free all memory associated with
+ interp_bfd. */
+ bfd_close (interp_bfd);
+ return (0);
+ }
+
+ /* Eureka! We found the symbol. But now we may need to relocate it
+ by the base address. If the symbol's value is less than the base
+ address of the shared library, then it hasn't yet been relocated
+ by the dynamic linker, and we have to do it ourself. FIXME: Note
+ that we make the assumption that the first segment that corresponds
+ to the shared library has the base address to which the library
+ was relocated. */
+
+ if (address < baseaddr)
+ {
+ address += baseaddr;
+ }
+ debug_base = address;
+ /* FIXME-leak: on failure, might not free all memory associated with
+ interp_bfd. */
+ bfd_close (interp_bfd);
+ return (1);
+}
+#endif /* HANDLE_SVR4_EXEC_EMULATORS */
+
+/*
+
+ LOCAL FUNCTION
+
+ elf_locate_base -- locate the base address of dynamic linker structs
+ for SVR4 elf targets.
+
+ SYNOPSIS
+
+ CORE_ADDR elf_locate_base (void)
+
+ 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.
+
+ */
+
+static CORE_ADDR
+elf_locate_base (void)
+{
+ sec_ptr dyninfo_sect;
+ int dyninfo_sect_size;
+ CORE_ADDR dyninfo_addr;
+ char *buf;
+ char *bufend;
+ int arch_size;
+
+ /* Find the start address of the .dynamic section. */
+ dyninfo_sect = bfd_get_section_by_name (exec_bfd, ".dynamic");
+ if (dyninfo_sect == NULL)
+ return 0;
+ dyninfo_addr = bfd_section_vma (exec_bfd, dyninfo_sect);
+
+ /* Read in .dynamic section, silently ignore errors. */
+ dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect);
+ buf = alloca (dyninfo_sect_size);
+ if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size))
+ return 0;
+
+ /* Find the DT_DEBUG entry in the the .dynamic section.
+ For mips elf we look for DT_MIPS_RLD_MAP, mips elf apparently has
+ no DT_DEBUG entries. */
+
+ arch_size = bfd_get_arch_size (exec_bfd);
+ if (arch_size == -1) /* failure */
+ return 0;
+
+ if (arch_size == 32)
+ { /* 32-bit elf */
+ for (bufend = buf + dyninfo_sect_size;
+ buf < bufend;
+ buf += sizeof (Elf32_External_Dyn))
+ {
+ Elf32_External_Dyn *x_dynp = (Elf32_External_Dyn *) buf;
+ long dyn_tag;
+ CORE_ADDR dyn_ptr;
+
+ dyn_tag = bfd_h_get_32 (exec_bfd, (bfd_byte *) x_dynp->d_tag);
+ if (dyn_tag == DT_NULL)
+ break;
+ else if (dyn_tag == DT_DEBUG)
+ {
+ dyn_ptr = bfd_h_get_32 (exec_bfd,
+ (bfd_byte *) x_dynp->d_un.d_ptr);
+ return dyn_ptr;
+ }
+ else if (dyn_tag == DT_MIPS_RLD_MAP)
+ {
+ char *pbuf;
+
+ pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
+ /* DT_MIPS_RLD_MAP contains a pointer to the address
+ of the dynamic link structure. */
+ dyn_ptr = bfd_h_get_32 (exec_bfd,
+ (bfd_byte *) x_dynp->d_un.d_ptr);
+ if (target_read_memory (dyn_ptr, pbuf, sizeof (pbuf)))
+ return 0;
+ return extract_unsigned_integer (pbuf, sizeof (pbuf));
+ }
+ }
+ }
+ else /* 64-bit elf */
+ {
+ for (bufend = buf + dyninfo_sect_size;
+ buf < bufend;
+ buf += sizeof (Elf64_External_Dyn))
+ {
+ Elf64_External_Dyn *x_dynp = (Elf64_External_Dyn *) buf;
+ long dyn_tag;
+ CORE_ADDR dyn_ptr;
+
+ dyn_tag = bfd_h_get_64 (exec_bfd, (bfd_byte *) x_dynp->d_tag);
+ if (dyn_tag == DT_NULL)
+ break;
+ else if (dyn_tag == DT_DEBUG)
+ {
+ dyn_ptr = bfd_h_get_64 (exec_bfd,
+ (bfd_byte *) x_dynp->d_un.d_ptr);
+ return dyn_ptr;
+ }
+ }
+ }
+
+ /* DT_DEBUG entry not found. */
+ return 0;
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ locate_base -- locate the base address of dynamic linker structs
+
+ SYNOPSIS
+
+ CORE_ADDR locate_base (void)
+
+ DESCRIPTION
+
+ For both the SunOS and SVR4 shared library implementations, if the
+ inferior executable has been linked dynamically, there is a single
+ address somewhere in the inferior's data space which is the key to
+ locating all of the dynamic linker's runtime structures. This
+ address is the value of the 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.
+
+ 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.
+
+ */
+
+static CORE_ADDR
+locate_base (void)
+{
+ /* 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
+ we have no cached address, try to locate it in the dynamic info
+ section for ELF executables. */
+
+ if (debug_base == 0)
+ {
+ if (exec_bfd != NULL
+ && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour)
+ debug_base = elf_locate_base ();
+#ifdef HANDLE_SVR4_EXEC_EMULATORS
+ /* Try it the hard way for emulated executables. */
+ else if (!ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
+ proc_iterate_over_mappings (look_for_base);
+#endif
+ }
+ return (debug_base);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ first_link_map_member -- locate first member in dynamic linker's map
+
+ SYNOPSIS
+
+ static CORE_ADDR first_link_map_member (void)
+
+ DESCRIPTION
+
+ Find the first element in the inferior's dynamic link map, and
+ return its address in the inferior. This function doesn't copy the
+ link map entry itself into our address space; current_sos actually
+ does the reading. */
+
+static CORE_ADDR
+first_link_map_member (void)
+{
+ CORE_ADDR lm = 0;
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+ char *r_map_buf = xmalloc (lmo->r_map_size);
+ struct cleanup *cleanups = make_cleanup (xfree, r_map_buf);
+
+ read_memory (debug_base + lmo->r_map_offset, r_map_buf, lmo->r_map_size);
+
+ lm = extract_address (r_map_buf, lmo->r_map_size);
+
+ /* FIXME: Perhaps we should validate the info somehow, perhaps by
+ checking r_version for a known version number, or r_state for
+ RT_CONSISTENT. */
+
+ do_cleanups (cleanups);
+
+ return (lm);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ open_symbol_file_object
+
+ SYNOPSIS
+
+ void open_symbol_file_object (void *from_tty)
+
+ DESCRIPTION
+
+ If no open symbol file, attempt to locate and open the main symbol
+ file. On SVR4 systems, this is the first link map entry. If its
+ name is here, we can open it. Useful when attaching to a process
+ without first loading its symbol file.
+
+ If FROM_TTYP dereferences to a non-zero integer, allow messages to
+ be printed. This parameter is a pointer rather than an int because
+ open_symbol_file_object() is called via catch_errors() and
+ catch_errors() requires a pointer argument. */
+
+static int
+open_symbol_file_object (void *from_ttyp)
+{
+ CORE_ADDR lm, l_name;
+ char *filename;
+ int errcode;
+ int from_tty = *(int *)from_ttyp;
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+ char *l_name_buf = xmalloc (lmo->l_name_size);
+ struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);
+
+ if (symfile_objfile)
+ if (!query ("Attempt to reload symbols from process? "))
+ return 0;
+
+ if ((debug_base = locate_base ()) == 0)
+ return 0; /* failed somehow... */
+
+ /* First link map member should be the executable. */
+ if ((lm = first_link_map_member ()) == 0)
+ return 0; /* failed somehow... */
+
+ /* Read address of name from target memory to GDB. */
+ read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
+
+ /* Convert the address to host format. */
+ l_name = extract_address (l_name_buf, lmo->l_name_size);
+
+ /* Free l_name_buf. */
+ do_cleanups (cleanups);
+
+ if (l_name == 0)
+ return 0; /* No filename. */
+
+ /* Now fetch the filename from target memory. */
+ target_read_string (l_name, &filename, SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+
+ if (errcode)
+ {
+ warning ("failed to read exec filename from attached file: %s",
+ safe_strerror (errcode));
+ return 0;
+ }
+
+ make_cleanup (xfree, filename);
+ /* Have a pathname: read the symbol file. */
+ symbol_file_add_main (filename, from_tty);
+
+ return 1;
+}
+
+/* LOCAL FUNCTION
+
+ current_sos -- build a list of currently loaded shared objects
+
+ SYNOPSIS
+
+ struct so_list *current_sos ()
+
+ DESCRIPTION
+
+ Build a list of `struct so_list' objects describing the shared
+ objects currently loaded in the inferior. This list does not
+ include an entry for the main executable file.
+
+ Note that we only gather information directly available from the
+ inferior --- we don't examine any of the shared library files
+ themselves. The declaration of `struct so_list' says which fields
+ we provide values for. */
+
+static struct so_list *
+svr4_current_sos (void)
+{
+ CORE_ADDR lm;
+ struct so_list *head = 0;
+ struct so_list **link_ptr = &head;
+
+ /* Make sure we've looked up the inferior's dynamic linker's base
+ structure. */
+ if (! debug_base)
+ {
+ debug_base = locate_base ();
+
+ /* If we can't find the dynamic linker's base structure, this
+ must not be a dynamically linked executable. Hmm. */
+ if (! debug_base)
+ return 0;
+ }
+
+ /* Walk the inferior's link map list, and build our list of
+ `struct so_list' nodes. */
+ lm = first_link_map_member ();
+ while (lm)
+ {
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+ struct so_list *new
+ = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct cleanup *old_chain = make_cleanup (xfree, new);
+
+ memset (new, 0, sizeof (*new));
+
+ new->lm_info = xmalloc (sizeof (struct lm_info));
+ make_cleanup (xfree, new->lm_info);
+
+ new->lm_info->lm = xmalloc (lmo->link_map_size);
+ make_cleanup (xfree, new->lm_info->lm);
+ memset (new->lm_info->lm, 0, lmo->link_map_size);
+
+ read_memory (lm, new->lm_info->lm, lmo->link_map_size);
+
+ lm = LM_NEXT (new);
+
+ /* 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))
+ free_so (new);
+ else
+ {
+ int errcode;
+ char *buffer;
+
+ /* Extract this shared object's name. */
+ target_read_string (LM_NAME (new), &buffer,
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+ if (errcode != 0)
+ {
+ warning ("current_sos: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ }
+ else
+ {
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (buffer);
+ strcpy (new->so_original_name, new->so_name);
+ }
+
+ /* If this entry has no name, or its name matches the name
+ for the main executable, don't include it in the list. */
+ if (! new->so_name[0]
+ || match_main (new->so_name))
+ free_so (new);
+ else
+ {
+ new->next = 0;
+ *link_ptr = new;
+ link_ptr = &new->next;
+ }
+ }
+
+ discard_cleanups (old_chain);
+ }
+
+ return head;
+}
+
+
+/* On some systems, the only way to recognize the link map entry for
+ the main executable file is by looking at its name. Return
+ non-zero iff SONAME matches one of the known main executable names. */
+
+static int
+match_main (char *soname)
+{
+ char **mainp;
+
+ for (mainp = main_name_list; *mainp != NULL; mainp++)
+ {
+ if (strcmp (soname, *mainp) == 0)
+ return (1);
+ }
+
+ return (0);
+}
+
+/* Return 1 if PC lies in the dynamic symbol resolution code of the
+ SVR4 run time loader. */
+static CORE_ADDR interp_text_sect_low;
+static CORE_ADDR interp_text_sect_high;
+static CORE_ADDR interp_plt_sect_low;
+static CORE_ADDR interp_plt_sect_high;
+
+static int
+svr4_in_dynsym_resolve_code (CORE_ADDR pc)
+{
+ return ((pc >= interp_text_sect_low && pc < interp_text_sect_high)
+ || (pc >= interp_plt_sect_low && pc < interp_plt_sect_high)
+ || in_plt_section (pc, NULL));
+}
+
+
+/*
+
+ 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 (void)
+{
+ int success = 0;
+
+#ifdef BKPT_AT_SYMBOL
+
+ struct minimal_symbol *msymbol;
+ char **bkpt_namep;
+ asection *interp_sect;
+
+ /* First, remove all the solib event breakpoints. Their addresses
+ may have changed since the last time we ran the program. */
+ remove_solib_event_breakpoints ();
+
+ interp_text_sect_low = interp_text_sect_high = 0;
+ interp_plt_sect_low = interp_plt_sect_high = 0;
+
+ /* Find the .interp section; if not found, warn the user and drop
+ into the old breakpoint at symbol code. */
+ interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
+ if (interp_sect)
+ {
+ unsigned int interp_sect_size;
+ char *buf;
+ CORE_ADDR load_addr = 0;
+ int load_addr_found = 0;
+ struct so_list *inferior_sos;
+ bfd *tmp_bfd = NULL;
+ int tmp_fd = -1;
+ char *tmp_pathname = NULL;
+ 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. */
+ 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.
+
+ 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_fd = solib_open (buf, &tmp_pathname);
+ if (tmp_fd >= 0)
+ tmp_bfd = bfd_fdopenr (tmp_pathname, gnutarget, tmp_fd);
+
+ if (tmp_bfd == NULL)
+ goto bkpt_at_symbol;
+
+ /* Make sure the dynamic linker's really a useful object. */
+ if (!bfd_check_format (tmp_bfd, bfd_object))
+ {
+ warning ("Unable to grok dynamic linker %s as an object file", buf);
+ bfd_close (tmp_bfd);
+ goto bkpt_at_symbol;
+ }
+
+ /* If the entry in _DYNAMIC for the dynamic linker has already
+ been filled in, we can read its base address from there. */
+ inferior_sos = svr4_current_sos ();
+ if (inferior_sos)
+ {
+ /* Connected to a running target. Update our shared library table. */
+ solib_add (NULL, 0, NULL, auto_solib_add);
+ }
+ while (inferior_sos)
+ {
+ if (strcmp (buf, inferior_sos->so_original_name) == 0)
+ {
+ load_addr_found = 1;
+ load_addr = LM_ADDR (inferior_sos);
+ break;
+ }
+ inferior_sos = inferior_sos->next;
+ }
+
+ /* Otherwise we find the dynamic linker's base address by examining
+ the current pc (which should point at the entry point for the
+ dynamic linker) and subtracting the offset of the entry point. */
+ if (!load_addr_found)
+ load_addr = read_pc () - tmp_bfd->start_address;
+
+ /* Record the relocated start and end address of the dynamic linker
+ text and plt section for svr4_in_dynsym_resolve_code. */
+ interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
+ if (interp_sect)
+ {
+ interp_text_sect_low =
+ bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
+ interp_text_sect_high =
+ interp_text_sect_low + bfd_section_size (tmp_bfd, interp_sect);
+ }
+ interp_sect = bfd_get_section_by_name (tmp_bfd, ".plt");
+ if (interp_sect)
+ {
+ interp_plt_sect_low =
+ bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
+ interp_plt_sect_high =
+ interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect);
+ }
+
+ /* Now try to set a breakpoint in the dynamic linker. */
+ for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
+ {
+ sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep);
+ if (sym_addr != 0)
+ break;
+ }
+
+ /* We're done with the temporary bfd. */
+ bfd_close (tmp_bfd);
+
+ if (sym_addr != 0)
+ {
+ create_solib_event_breakpoint (load_addr + sym_addr);
+ return 1;
+ }
+
+ /* For whatever reason we couldn't set a breakpoint in the dynamic
+ 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.");
+ }
+
+ /* Scan through the list of symbols, trying to look up the symbol and
+ set a breakpoint there. Terminate loop when we/if we succeed. */
+
+ breakpoint_addr = 0;
+ for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
+ {
+ msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
+ if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ {
+ create_solib_event_breakpoint (SYMBOL_VALUE_ADDRESS (msymbol));
+ return 1;
+ }
+ }
+
+ /* Nothing good happened. */
+ success = 0;
+
+#endif /* BKPT_AT_SYMBOL */
+
+ return (success);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ special_symbol_handling -- additional shared library symbol handling
+
+ SYNOPSIS
+
+ void special_symbol_handling ()
+
+ DESCRIPTION
+
+ Once the symbols from a shared object have been loaded in the usual
+ way, we are called to do any system specific symbol handling that
+ is needed.
+
+ For SunOS4, this consisted of grunging around in the dynamic
+ linkers structures to find symbol definitions for "common" symbols
+ and adding them to the minimal symbol table for the runtime common
+ objfile.
+
+ However, for SVR4, there's nothing to do.
+
+ */
+
+static void
+svr4_special_symbol_handling (void)
+{
+}
+
+/* Relocate the main executable. This function should be called upon
+ stopping the inferior process at the entry point to the program.
+ The entry point from BFD is compared to the PC and if they are
+ different, the main executable is relocated by the proper amount.
+
+ As written it will only attempt to relocate executables which
+ lack interpreter sections. It seems likely that only dynamic
+ linker executables will get relocated, though it should work
+ properly for a position-independent static executable as well. */
+
+static void
+svr4_relocate_main_executable (void)
+{
+ asection *interp_sect;
+ CORE_ADDR pc = read_pc ();
+
+ /* Decide if the objfile needs to be relocated. As indicated above,
+ we will only be here when execution is stopped at the beginning
+ of the program. Relocation is necessary if the address at which
+ we are presently stopped differs from the start address stored in
+ the executable AND there's no interpreter section. The condition
+ regarding the interpreter section is very important because if
+ there *is* an interpreter section, execution will begin there
+ instead. When there is an interpreter section, the start address
+ is (presumably) used by the interpreter at some point to start
+ execution of the program.
+
+ If there is an interpreter, it is normal for it to be set to an
+ arbitrary address at the outset. The job of finding it is
+ handled in enable_break().
+
+ So, to summarize, relocations are necessary when there is no
+ interpreter section and the start address obtained from the
+ executable is different from the address at which GDB is
+ currently stopped.
+
+ [ The astute reader will note that we also test to make sure that
+ the executable in question has the DYNAMIC flag set. It is my
+ opinion that this test is unnecessary (undesirable even). It
+ was added to avoid inadvertent relocation of an executable
+ whose e_type member in the ELF header is not ET_DYN. There may
+ be a time in the future when it is desirable to do relocations
+ on other types of files as well in which case this condition
+ should either be removed or modified to accomodate the new file
+ type. (E.g, an ET_EXEC executable which has been built to be
+ position-independent could safely be relocated by the OS if
+ desired. It is true that this violates the ABI, but the ABI
+ has been known to be bent from time to time.) - Kevin, Nov 2000. ]
+ */
+
+ interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
+ if (interp_sect == NULL
+ && (bfd_get_file_flags (exec_bfd) & DYNAMIC) != 0
+ && bfd_get_start_address (exec_bfd) != pc)
+ {
+ struct cleanup *old_chain;
+ struct section_offsets *new_offsets;
+ int i, changed;
+ CORE_ADDR displacement;
+
+ /* It is necessary to relocate the objfile. The amount to
+ relocate by is simply the address at which we are stopped
+ minus the starting address from the executable.
+
+ We relocate all of the sections by the same amount. This
+ behavior is mandated by recent editions of the System V ABI.
+ According to the System V Application Binary Interface,
+ Edition 4.1, page 5-5:
+
+ ... Though the system chooses virtual addresses for
+ individual processes, it maintains the segments' relative
+ positions. Because position-independent code uses relative
+ addressesing between segments, the difference between
+ virtual addresses in memory must match the difference
+ between virtual addresses in the file. The difference
+ between the virtual address of any segment in memory and
+ the corresponding virtual address in the file is thus a
+ single constant value for any one executable or shared
+ object in a given process. This difference is the base
+ address. One use of the base address is to relocate the
+ memory image of the program during dynamic linking.
+
+ The same language also appears in Edition 4.0 of the System V
+ ABI and is left unspecified in some of the earlier editions. */
+
+ displacement = pc - bfd_get_start_address (exec_bfd);
+ changed = 0;
+
+ new_offsets = xcalloc (symfile_objfile->num_sections,
+ sizeof (struct section_offsets));
+ old_chain = make_cleanup (xfree, new_offsets);
+
+ for (i = 0; i < symfile_objfile->num_sections; i++)
+ {
+ if (displacement != ANOFFSET (symfile_objfile->section_offsets, i))
+ changed = 1;
+ new_offsets->offsets[i] = displacement;
+ }
+
+ if (changed)
+ objfile_relocate (symfile_objfile, new_offsets);
+
+ do_cleanups (old_chain);
+ }
+}
+
+/*
+
+ GLOBAL FUNCTION
+
+ svr4_solib_create_inferior_hook -- shared library startup support
+
+ SYNOPSIS
+
+ void svr4_solib_create_inferior_hook()
+
+ DESCRIPTION
+
+ When gdb starts up the inferior, it nurses it along (through the
+ shell) until it is ready to execute it's first instruction. At this
+ point, this function gets called via expansion of the macro
+ SOLIB_CREATE_INFERIOR_HOOK.
+
+ For SunOS executables, this first instruction is typically the
+ one at "_start", or a similar text label, regardless of whether
+ the executable is statically or dynamically linked. The runtime
+ startup code takes care of dynamically linking in any shared
+ libraries, once gdb allows the inferior to continue.
+
+ For SVR4 executables, this first instruction is either the first
+ instruction in the dynamic linker (for dynamically linked
+ executables) or the instruction at "start" for statically linked
+ executables. For dynamically linked executables, the system
+ first exec's /lib/libc.so.N, which contains the dynamic linker,
+ and starts it running. The dynamic linker maps in any needed
+ shared libraries, maps in the actual user executable, and then
+ jumps to "start" in the user executable.
+
+ For both SunOS shared libraries, and SVR4 shared libraries, we
+ can arrange to cooperate with the dynamic linker to discover the
+ names of shared libraries that are dynamically linked, and the
+ base addresses to which they are linked.
+
+ This function is responsible for discovering those names and
+ addresses, and saving sufficient information about them to allow
+ their symbols to be read at a later time.
+
+ FIXME
+
+ Between enable_break() and disable_break(), this code does not
+ properly handle hitting breakpoints which the user might have
+ set in the startup code or in the dynamic linker itself. Proper
+ handling will probably have to wait until the implementation is
+ changed to use the "breakpoint handler function" method.
+
+ Also, what if child has exit()ed? Must exit loop somehow.
+ */
+
+static void
+svr4_solib_create_inferior_hook (void)
+{
+ /* Relocate the main executable if necessary. */
+ svr4_relocate_main_executable ();
+
+ if (!enable_break ())
+ {
+ warning ("shared library handler failed to enable breakpoint");
+ return;
+ }
+
+#if defined(_SCO_DS)
+ /* SCO needs the loop below, other systems should be using the
+ special shared library breakpoints and the shared library breakpoint
+ service routine.
+
+ Now run the target. It will eventually hit the breakpoint, at
+ which point all of the libraries will have been mapped in and we
+ can go groveling around in the dynamic linker structures to find
+ out what we need to know about them. */
+
+ clear_proceed_status ();
+ stop_soon_quietly = 1;
+ stop_signal = TARGET_SIGNAL_0;
+ do
+ {
+ target_resume (pid_to_ptid (-1), 0, stop_signal);
+ wait_for_inferior ();
+ }
+ while (stop_signal != TARGET_SIGNAL_TRAP);
+ stop_soon_quietly = 0;
+#endif /* defined(_SCO_DS) */
+}
+
+static void
+svr4_clear_solib (void)
+{
+ debug_base = 0;
+}
+
+static void
+svr4_free_so (struct so_list *so)
+{
+ xfree (so->lm_info->lm);
+ xfree (so->lm_info);
+}
+
+
+/* Clear any bits of ADDR that wouldn't fit in a target-format
+ data pointer. "Data pointer" here refers to whatever sort of
+ address the dynamic linker uses to manage its sections. At the
+ moment, we don't support shared libraries on any processors where
+ code and data pointers are different sizes.
+
+ This isn't really the right solution. What we really need here is
+ a way to do arithmetic on CORE_ADDR values that respects the
+ natural pointer/address correspondence. (For example, on the MIPS,
+ converting a 32-bit pointer to a 64-bit CORE_ADDR requires you to
+ sign-extend the value. There, simply truncating the bits above
+ TARGET_PTR_BIT, as we do below, is no good.) This should probably
+ be a new gdbarch method or something. */
+static CORE_ADDR
+svr4_truncate_ptr (CORE_ADDR addr)
+{
+ if (TARGET_PTR_BIT == sizeof (CORE_ADDR) * 8)
+ /* We don't need to truncate anything, and the bit twiddling below
+ will fail due to overflow problems. */
+ return addr;
+ else
+ return addr & (((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1);
+}
+
+
+static void
+svr4_relocate_section_addresses (struct so_list *so,
+ struct section_table *sec)
+{
+ sec->addr = svr4_truncate_ptr (sec->addr + LM_ADDR (so));
+ sec->endaddr = svr4_truncate_ptr (sec->endaddr + LM_ADDR (so));
+}
+
+
+/* Fetch a link_map_offsets structure for native targets using struct
+ definitions from link.h. See solib-legacy.c for the function
+ which does the actual work.
+
+ Note: For non-native targets (i.e. cross-debugging situations),
+ a target specific fetch_link_map_offsets() function should be
+ defined and registered via set_solib_svr4_fetch_link_map_offsets(). */
+
+static struct link_map_offsets *
+legacy_fetch_link_map_offsets (void)
+{
+ if (legacy_svr4_fetch_link_map_offsets_hook)
+ return legacy_svr4_fetch_link_map_offsets_hook ();
+ else
+ {
+ internal_error (__FILE__, __LINE__,
+ "legacy_fetch_link_map_offsets called without legacy "
+ "link_map support enabled.");
+ return 0;
+ }
+}
+
+/* Fetch a link_map_offsets structure using the method registered in the
+ architecture vector. */
+
+static struct link_map_offsets *
+svr4_fetch_link_map_offsets (void)
+{
+ struct link_map_offsets *(*flmo)(void) =
+ gdbarch_data (fetch_link_map_offsets_gdbarch_data);
+
+ if (flmo == NULL)
+ {
+ internal_error (__FILE__, __LINE__,
+ "svr4_fetch_link_map_offsets: fetch_link_map_offsets "
+ "method not defined for this architecture.");
+ return 0;
+ }
+ else
+ return (flmo ());
+}
+
+/* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
+ a <arch>_gdbarch_init() function. It is used to establish an
+ architecture specific link_map_offsets fetcher for the architecture
+ being defined. */
+
+void
+set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch,
+ struct link_map_offsets *(*flmo) (void))
+{
+ set_gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data, flmo);
+}
+
+/* Initialize the architecture specific link_map_offsets fetcher.
+ This is called after <arch>_gdbarch_init() has set up its struct
+ gdbarch for the new architecture, so care must be taken to use the
+ value set by set_solib_svr4_fetch_link_map_offsets(), above. We
+ do, however, attempt to provide a reasonable alternative (for
+ native targets anyway) if the <arch>_gdbarch_init() fails to call
+ set_solib_svr4_fetch_link_map_offsets(). */
+
+static void *
+init_fetch_link_map_offsets (struct gdbarch *gdbarch)
+{
+ struct link_map_offsets *(*flmo) =
+ gdbarch_data (fetch_link_map_offsets_gdbarch_data);
+
+ if (flmo == NULL)
+ return legacy_fetch_link_map_offsets;
+ else
+ return flmo;
+}
+
+static struct target_so_ops svr4_so_ops;
+
+void
+_initialize_svr4_solib (void)
+{
+ fetch_link_map_offsets_gdbarch_data =
+ register_gdbarch_data (init_fetch_link_map_offsets, 0);
+
+ svr4_so_ops.relocate_section_addresses = svr4_relocate_section_addresses;
+ svr4_so_ops.free_so = svr4_free_so;
+ svr4_so_ops.clear_solib = svr4_clear_solib;
+ svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook;
+ svr4_so_ops.special_symbol_handling = svr4_special_symbol_handling;
+ svr4_so_ops.current_sos = svr4_current_sos;
+ svr4_so_ops.open_symbol_file_object = open_symbol_file_object;
+ svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
+
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ current_target_so_ops = &svr4_so_ops;
+}
diff --git a/contrib/gdb/gdb/solib-svr4.h b/contrib/gdb/gdb/solib-svr4.h
new file mode 100644
index 0000000..8611dff
--- /dev/null
+++ b/contrib/gdb/gdb/solib-svr4.h
@@ -0,0 +1,78 @@
+/* Handle shared libraries for GDB, the GNU Debugger.
+ Copyright 2000
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Critical offsets and sizes which describe struct r_debug and
+ struct link_map on SVR4-like targets. All offsets and sizes are
+ in bytes unless otherwise specified. */
+
+struct link_map_offsets
+ {
+ /* Size of struct r_debug (or equivalent), or at least enough of it to
+ be able to obtain the r_map field. */
+ int r_debug_size;
+
+ /* Offset to the r_map field in struct r_debug. */
+ int r_map_offset;
+
+ /* Size of the r_map field in struct r_debug. */
+ int r_map_size;
+
+ /* Size of struct link_map (or equivalent), or at least enough of it
+ to be able to obtain the fields below. */
+ int link_map_size;
+
+ /* Offset to l_addr field in struct link_map. */
+ int l_addr_offset;
+
+ /* Size of l_addr field in struct link_map. */
+ int l_addr_size;
+
+ /* Offset to l_next field in struct link_map. */
+ int l_next_offset;
+
+ /* Size of l_next field in struct link_map. */
+ int l_next_size;
+
+ /* Offset to l_prev field in struct link_map. */
+ int l_prev_offset;
+
+ /* Size of l_prev field in struct link_map. */
+ int l_prev_size;
+
+ /* Offset to l_name field in struct link_map. */
+ int l_name_offset;
+
+ /* Size of l_name field in struct link_map. */
+ int l_name_size;
+ };
+
+/* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
+ a <arch>_gdbarch_init() function. It is used to establish an
+ architecture specific link_map_offsets fetcher for the architecture
+ being defined. */
+
+extern void set_solib_svr4_fetch_link_map_offsets
+ (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void));
+
+/* legacy_svr4_fetch_link_map_offsets_hook is a pointer to a function
+ which is used to fetch link map offsets. It will only be set
+ by solib-legacy.c, if at all. */
+extern struct link_map_offsets *(*legacy_svr4_fetch_link_map_offsets_hook)(void);
diff --git a/contrib/gdb/gdb/solib.h b/contrib/gdb/gdb/solib.h
index eafef48..76f287b 100644
--- a/contrib/gdb/gdb/solib.h
+++ b/contrib/gdb/gdb/solib.h
@@ -1,41 +1,40 @@
/* Shared library declarations for GDB, the GNU Debugger.
- Copyright (C) 1992, 1998 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1995, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 */
+/* Forward decl's for prototypes */
struct target_ops;
-#endif
/* Called when we free all symtabs, to free the shared library information
as well. */
#define CLEAR_SOLIB clear_solib
-extern void
-clear_solib PARAMS ((void));
+extern void clear_solib (void);
/* Called to add symbols from a shared library to gdb's symbol table. */
-#define SOLIB_ADD(filename, from_tty, targ) \
- solib_add (filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
+ solib_add (filename, from_tty, targ, readsyms)
-extern void
-solib_add PARAMS ((char *, int, struct target_ops *));
+extern void solib_add (char *, int, struct target_ops *, int);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
@@ -50,18 +49,17 @@ 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 */
+extern void solib_create_inferior_hook (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 +68,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 +79,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 +101,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 +118,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 +139,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 +157,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 +172,7 @@ solib_create_inferior_hook PARAMS((void)); /* solib.c */
any symbol tables.
Presently, this functionality is not implemented.
- */
+ */
#define SOLIB_RESTART() \
(0)
@@ -183,21 +181,19 @@ 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 */
+extern char *solib_address (CORE_ADDR); /* solib.c */
/* If ADDR lies in a shared library, return its name. */
#define PC_SOLIB(addr) solib_address (addr)
-#ifdef SVR4_SHARED_LIBS
-
/* Return 1 if PC lies in the dynamic symbol resolution code of the
- SVR4 run time loader. */
+ run time loader. */
+
+#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc)
-#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_svr4_dynsym_resolve_code (pc)
+extern int in_solib_dynsym_resolve_code (CORE_ADDR); /* solib.c */
-extern int
-in_svr4_dynsym_resolve_code PARAMS ((CORE_ADDR));
+/* Discard symbols that were auto-loaded from shared libraries. */
-#endif
+extern void no_shared_libraries (char *ignored, int from_tty);
diff --git a/contrib/gdb/gdb/solist.h b/contrib/gdb/gdb/solist.h
new file mode 100644
index 0000000..dd1100c
--- /dev/null
+++ b/contrib/gdb/gdb/solist.h
@@ -0,0 +1,126 @@
+/* Shared library declarations for GDB, the GNU Debugger.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef SOLIST_H
+#define SOLIST_H
+
+#define SO_NAME_MAX_PATH_SIZE 512 /* FIXME: Should be dynamic */
+
+/* Forward declaration for target specific link map information. This
+ struct is opaque to all but the target specific file. */
+struct lm_info;
+
+struct so_list
+ {
+ /* The following fields of the structure come directly from the
+ dynamic linker's tables in the inferior, and are initialized by
+ current_sos. */
+
+ struct so_list *next; /* next structure in linked list */
+
+ /* A pointer to target specific link map information. Often this
+ will be a copy of struct link_map from the user process, but
+ it need not be; it can be any collection of data needed to
+ traverse the dynamic linker's data structures. */
+ struct lm_info *lm_info;
+
+ /* Shared object file name, exactly as it appears in the
+ inferior's link map. This may be a relative path, or something
+ which needs to be looked up in LD_LIBRARY_PATH, etc. We use it
+ to tell which entries in the inferior's dynamic linker's link
+ map we've already loaded. */
+ char so_original_name[SO_NAME_MAX_PATH_SIZE];
+
+ /* shared object file name, expanded to something GDB can open */
+ char so_name[SO_NAME_MAX_PATH_SIZE];
+
+ /* The following fields of the structure are built from
+ information gathered from the shared object file itself, and
+ are set when we actually add it to our symbol tables.
+
+ current_sos must initialize these fields to 0. */
+
+ bfd *abfd;
+ 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;
+ };
+
+struct target_so_ops
+ {
+ /* Adjust the section binding addresses by the base address at
+ which the object was actually mapped. */
+ void (*relocate_section_addresses) (struct so_list *so,
+ struct section_table *);
+
+ /* Free the the link map info and any other private data
+ structures associated with a so_list entry. */
+ void (*free_so) (struct so_list *so);
+
+ /* Reset or free private data structures not associated with
+ so_list entries. */
+ void (*clear_solib) (void);
+
+ /* Target dependent code to run after child process fork. */
+ void (*solib_create_inferior_hook) (void);
+
+ /* Do additional symbol handling, lookup, etc. after symbols
+ for a shared object have been loaded. */
+ void (*special_symbol_handling) (void);
+
+ /* Construct a list of the currently loaded shared objects. */
+ struct so_list *(*current_sos) (void);
+
+ /* Find, open, and read the symbols for the main executable. */
+ int (*open_symbol_file_object) (void *from_ttyp);
+
+ /* Determine if PC lies in the dynamic symbol resolution code of
+ the run time loader */
+ int (*in_dynsym_resolve_code) (CORE_ADDR pc);
+ };
+
+void free_so (struct so_list *so);
+
+/* Find solib binary file and open it. */
+extern int solib_open (char *in_pathname, char **found_pathname);
+
+/* FIXME: gdbarch needs to control this variable */
+extern struct target_so_ops *current_target_so_ops;
+
+#define TARGET_SO_RELOCATE_SECTION_ADDRESSES \
+ (current_target_so_ops->relocate_section_addresses)
+#define TARGET_SO_FREE_SO (current_target_so_ops->free_so)
+#define TARGET_SO_CLEAR_SOLIB (current_target_so_ops->clear_solib)
+#define TARGET_SO_SOLIB_CREATE_INFERIOR_HOOK \
+ (current_target_so_ops->solib_create_inferior_hook)
+#define TARGET_SO_SPECIAL_SYMBOL_HANDLING \
+ (current_target_so_ops->special_symbol_handling)
+#define TARGET_SO_CURRENT_SOS (current_target_so_ops->current_sos)
+#define TARGET_SO_OPEN_SYMBOL_FILE_OBJECT \
+ (current_target_so_ops->open_symbol_file_object)
+#define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \
+ (current_target_so_ops->in_dynsym_resolve_code)
+
+#endif
diff --git a/contrib/gdb/gdb/source.c b/contrib/gdb/gdb/source.c
index 9fe9742..ee4998d 100644
--- a/contrib/gdb/gdb/source.c
+++ b/contrib/gdb/gdb/source.c
@@ -1,28 +1,31 @@
/* List lines of source files for GDB, the GNU debugger.
- Copyright 1986, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
#include "expression.h"
#include "language.h"
#include "command.h"
+#include "source.h"
#include "gdbcmd.h"
#include "frame.h"
#include "value.h"
@@ -31,15 +34,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdb_string.h"
#include "gdb_stat.h"
#include <fcntl.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include "gdbcore.h"
-#include "gnu-regex.h"
+#include "gdb_regex.h"
#include "symfile.h"
#include "objfiles.h"
#include "annotate.h"
#include "gdbtypes.h"
+#include "linespec.h"
+#include "filenames.h" /* for DOSish file names */
+#include "completer.h"
+#include "ui-out.h"
#ifdef CRLF_SOURCE_FILES
@@ -61,33 +65,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* ! defined (CRLF_SOURCE_FILES) */
-/* Forward declarations */
-
-int open_source_file PARAMS ((struct symtab *));
-
-void find_source_lines PARAMS ((struct symtab *, int));
-
/* Prototypes for exported functions. */
-void _initialize_source PARAMS ((void));
+void _initialize_source (void);
/* Prototypes for local functions. */
-static int get_filename_and_charpos PARAMS ((struct symtab *, char **));
+static int get_filename_and_charpos (struct symtab *, char **);
-static void reverse_search_command PARAMS ((char *, int));
+static void reverse_search_command (char *, int);
-static void forward_search_command PARAMS ((char *, int));
+static void forward_search_command (char *, int);
-static void line_info PARAMS ((char *, int));
+static void line_info (char *, int);
-static void list_command PARAMS ((char *, int));
+static void list_command (char *, int);
-static void ambiguous_line_spec PARAMS ((struct symtabs_and_lines *));
+static void ambiguous_line_spec (struct symtabs_and_lines *);
-static void source_info PARAMS ((char *, int));
+static void source_info (char *, int);
-static void show_directories PARAMS ((char *, int));
+static void show_directories (char *, int);
/* Path of directories to search for source files.
Same format as the PATH environment variable's value. */
@@ -124,8 +122,8 @@ static int first_line_listed;
static struct symtab *last_source_visited = NULL;
static int last_source_error = 0;
-
+
/* 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
@@ -135,15 +133,14 @@ static int last_source_error = 0;
before we need to would make things slower than necessary. */
void
-select_source_symtab (s)
- register struct symtab *s;
+select_source_symtab (register struct symtab *s)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct partial_symtab *ps;
struct partial_symtab *cs_pst = 0;
struct objfile *ofp;
-
+
if (s)
{
current_source_symtab = s;
@@ -156,28 +153,28 @@ select_source_symtab (s)
/* Make the default place to list be the function `main'
if one exists. */
- if (lookup_symbol ("main", 0, VAR_NAMESPACE, 0, NULL))
+ if (lookup_symbol (main_name (), 0, VAR_NAMESPACE, 0, NULL))
{
- sals = decode_line_spec ("main", 1);
+ sals = decode_line_spec (main_name (), 1);
sal = sals.sals[0];
- free (sals.sals);
+ xfree (sals.sals);
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 +185,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,9 +199,11 @@ 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.");
+ internal_error (__FILE__, __LINE__,
+ "select_source_symtab: "
+ "readin pst found and no symtabs.");
}
else
{
@@ -218,9 +217,7 @@ select_source_symtab (s)
}
static void
-show_directories (ignore, from_tty)
- char *ignore;
- int from_tty;
+show_directories (char *ignore, int from_tty)
{
puts_filtered ("Source directories searched: ");
puts_filtered (source_path);
@@ -232,53 +229,61 @@ show_directories (ignore, from_tty)
may be found in a different directory now. */
void
-forget_cached_source_info ()
+forget_cached_source_info (void)
{
register struct symtab *s;
register struct objfile *objfile;
+ struct partial_symtab *pst;
- 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;
+ xmfree (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;
+ xmfree (objfile->md, s->fullname);
+ s->fullname = NULL;
}
}
+
+ ALL_OBJFILE_PSYMTABS (objfile, pst)
+ {
+ if (pst->fullname != NULL)
+ {
+ xfree (pst->fullname);
+ pst->fullname = NULL;
+ }
+ }
}
}
void
-init_source_path ()
+init_source_path (void)
{
char buf[20];
sprintf (buf, "$cdir%c$cwd", DIRNAME_SEPARATOR);
- source_path = strsave (buf);
+ source_path = xstrdup (buf);
forget_cached_source_info ();
}
/* Add zero or more directories to the front of the source path. */
-
+
void
-directory_command (dirname, from_tty)
- char *dirname;
- int from_tty;
+directory_command (char *dirname, int from_tty)
{
dont_repeat ();
/* FIXME, this goes to "delete dir"... */
if (dirname == 0)
{
- if (query ("Reinitialize source path to empty? "))
+ if (from_tty && query ("Reinitialize source path to empty? "))
{
- free (source_path);
+ xfree (source_path);
init_source_path ();
}
}
@@ -288,16 +293,14 @@ 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 ();
}
/* Add zero or more directories to the front of an arbitrary path. */
void
-mod_path (dirname, which_path)
- char *dirname;
- char **which_path;
+mod_path (char *dirname, char **which_path)
{
char *old = *which_path;
int prefix = 0;
@@ -305,8 +308,8 @@ mod_path (dirname, which_path)
if (dirname == 0)
return;
- dirname = strsave (dirname);
- make_cleanup (free, dirname);
+ dirname = xstrdup (dirname);
+ make_cleanup (xfree, dirname);
do
{
@@ -319,7 +322,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,15 +341,17 @@ mod_path (dirname, which_path)
}
}
-#ifndef _WIN32
- /* On win32 h:\ is different to h: */
- if (SLASH_P (p[-1]))
+ if (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ /* On MS-DOS and MS-Windows, h:\ is different from h: */
+ && !(p == name + 3 && name[1] == ':') /* "d:/" */
+#endif
+ && IS_DIR_SEPARATOR (p[-1]))
/* Sigh. "foo/" => "foo" */
--p;
-#endif
*p = '\0';
- while (p[-1] == '.')
+ while (p > name && p[-1] == '.')
{
if (p - name == 1)
{
@@ -354,7 +359,7 @@ mod_path (dirname, which_path)
name = current_directory;
goto append;
}
- else if (SLASH_P (p[-2]))
+ else if (p > name + 1 && IS_DIR_SEPARATOR (p[-2]))
{
if (p - name == 2)
{
@@ -376,32 +381,37 @@ 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);
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */
+ name = concat (name, ".", NULL);
+#endif
+ else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$')
+ name = concat (current_directory, SLASH_STRING, name, NULL);
else
name = savestring (name, p - name);
- make_cleanup (free, name);
+ make_cleanup (xfree, 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:
{
@@ -410,15 +420,23 @@ mod_path (dirname, which_path)
p = *which_path;
while (1)
{
+ /* FIXME: strncmp loses in interesting ways on MS-DOS and
+ MS-Windows because of case-insensitivity and two different
+ but functionally identical slash characters. We need a
+ special filesystem-dependent file-name comparison function.
+
+ Actually, even on Unix I would use realpath() or its work-
+ alike before comparing. Then all the code above which
+ removes excess slashes and dots could simply go away. */
if (!strncmp (p, name, len)
&& (p[len] == '\0' || p[len] == DIRNAME_SEPARATOR))
{
/* 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 +451,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;
@@ -444,32 +462,31 @@ mod_path (dirname, which_path)
old[prefix] = c;
*which_path = concat (temp, "", &old[prefix], NULL);
prefix = strlen (temp);
- free (temp);
+ xfree (temp);
}
else
{
*which_path = concat (name, (old[0] ? tinybuf : old), old, NULL);
prefix = strlen (name);
}
- free (old);
+ xfree (old);
old = *which_path;
}
}
- skip_dup: ;
- } while (*dirname != '\0');
+ skip_dup:;
+ }
+ while (*dirname != '\0');
}
static void
-source_info (ignore, from_tty)
- char *ignore;
- int from_tty;
+source_info (char *ignore, int from_tty)
{
register struct symtab *s = current_source_symtab;
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 +501,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);
}
+
-
/* 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.
@@ -496,7 +513,7 @@ source_info (ignore, from_tty)
so that "exec-file ./foo" or "symbol-file ./foo" insures that you
get that particular version of foo or an error message).
- If FILENAMED_OPENED is non-null, set it to a newly allocated string naming
+ If FILENAME_OPENED is non-null, set it to a newly allocated string naming
the actual file opened (this string will always start with a "/". We
have to take special pains to avoid doubling the "/" between the directory
and the file, sigh! Emacs gets confuzzed by this when we print the
@@ -506,125 +523,113 @@ 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;
- int try_cwd_first;
- char *string;
- int mode;
- int prot;
- char **filename_opened;
+openp (const char *path, int try_cwd_first, const char *string,
+ int mode, int prot,
+ char **filename_opened)
{
register int fd;
register char *filename;
- register char *p, *p1;
+ const char *p;
+ const char *p1;
register int len;
int alloclen;
if (!path)
path = ".";
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
mode |= O_BINARY;
#endif
- if (try_cwd_first || SLASH_P (string[0]))
+ if (try_cwd_first || IS_ABSOLUTE_PATH (string))
{
int i;
- filename = string;
+ filename = alloca (strlen (string) + 1);
+ strcpy (filename, string);
fd = open (filename, mode, prot);
if (fd >= 0)
goto done;
for (i = 0; string[i]; i++)
- if (SLASH_P (string[i]))
+ if (IS_DIR_SEPARATOR (string[i]))
goto done;
}
/* ./foo => foo */
- while (string[0] == '.' && SLASH_P (string[1]))
+ while (string[0] == '.' && IS_DIR_SEPARATOR (string[1]))
string += 2;
alloclen = strlen (path) + strlen (string) + 2;
- filename = (char *) alloca (alloclen);
+ filename = alloca (alloclen);
fd = -1;
for (p = path; p; p = p1 ? p1 + 1 : 0)
{
- p1 = (char *) strchr (p, DIRNAME_SEPARATOR);
+ p1 = strchr (p, DIRNAME_SEPARATOR);
if (p1)
len = p1 - p;
else
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 = 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 && IS_DIR_SEPARATOR (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)
- *filename_opened = (char *) 0;
- else if (ROOTED_P (filename))
- *filename_opened = savestring (filename, strlen (filename));
+ *filename_opened = NULL;
+ else if (IS_ABSOLUTE_PATH (filename))
+ *filename_opened = gdb_realpath (filename);
else
{
/* Beware the // my son, the Emacs barfs, the botch that catch... */
-
- *filename_opened = concat (current_directory,
- SLASH_CHAR
- == current_directory[strlen(current_directory)-1]
- ? "": SLASH_STRING,
+
+ char *f = concat (current_directory,
+ IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
+ ? "" : SLASH_STRING,
filename, NULL);
- }
+ *filename_opened = gdb_realpath (f);
+ xfree (f);
+ }
}
-#ifdef MPW
- /* This is a debugging hack that can go away when all combinations
- of Mac and Unix names are handled reasonably. */
- {
- extern int debug_openp;
-
- if (debug_openp)
- {
- 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");
- }
- }
-#endif /* MPW */
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 +641,11 @@ 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;
+source_full_path_of (char *filename, char **full_pathname)
{
- int fd;
+ int fd;
fd = openp (source_path, 1, filename, O_RDONLY, 0, full_pathname);
if (fd < 0)
@@ -660,22 +663,21 @@ source_full_path_of (filename, full_pathname)
negative number for error. */
int
-open_source_file (s)
- struct symtab *s;
+open_source_file (struct symtab *s)
{
char *path = source_path;
- char *p;
+ const char *p;
int result;
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);
+ xmfree (s->objfile->md, s->fullname);
s->fullname = NULL;
}
@@ -684,19 +686,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 */
}
}
@@ -704,32 +706,16 @@ open_source_file (s)
if (result < 0)
{
/* Didn't work. Try using just the basename. */
- p = basename (s->filename);
- if (p != s->filename)
- result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname);
- }
-#ifdef MPW
- if (result < 0)
- {
- /* Didn't work. Try using just the MPW basename. */
- p = (char *) mpw_basename (s->filename);
- if (p != s->filename)
- result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname);
- }
- if (result < 0)
- {
- /* Didn't work. Try using the mixed Unix/MPW basename. */
- p = (char *) mpw_mixed_basename (s->filename);
+ p = lbasename (s->filename);
if (p != s->filename)
result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname);
}
-#endif /* MPW */
if (result >= 0)
{
fullname = s->fullname;
s->fullname = mstrsave (s->objfile->md, s->fullname);
- free (fullname);
+ xfree (fullname);
}
return result;
}
@@ -738,8 +724,7 @@ open_source_file (s)
if no symtab. */
char *
-symtab_to_filename (s)
- struct symtab *s;
+symtab_to_filename (struct symtab *s)
{
int fd;
@@ -762,17 +747,15 @@ symtab_to_filename (s)
close (fd);
return s->fullname;
}
-
+
/* 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.
All set S->nlines to the number of such lines. */
void
-find_source_lines (s, desc)
- struct symtab *s;
- int desc;
+find_source_lines (struct symtab *s, int desc)
{
struct stat st;
register char *data, *p, *end;
@@ -782,21 +765,19 @@ 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 +788,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);
@@ -833,7 +814,7 @@ find_source_lines (s, desc)
/* Use malloc, not alloca, because this may be pretty large, and we may
run into various kinds of limits on stack size. */
data = (char *) xmalloc (size);
- old_cleanups = make_cleanup (free, data);
+ old_cleanups = make_cleanup (xfree, data);
/* Reassign `size' to result of read for systems where \r\n -> \n. */
size = myread (desc, data, size);
@@ -846,14 +827,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 +845,23 @@ 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;
+source_line_charpos (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];
@@ -889,17 +870,16 @@ source_line_charpos (s, line)
/* Return the line number of character position POS in symtab S. */
int
-source_charpos_line (s, chr)
- register struct symtab *s;
- register int chr;
+source_charpos_line (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,32 +889,32 @@ source_charpos_line (s, chr)
return line;
}
-#endif /* 0 */
-
+#endif /* 0 */
+
/* 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',
or to 0 if the file is not found. */
static int
-get_filename_and_charpos (s, fullname)
- struct symtab *s;
- char **fullname;
+get_filename_and_charpos (struct symtab *s, 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;
}
@@ -949,14 +929,11 @@ get_filename_and_charpos (s, fullname)
Return 1 if successful, 0 if could not find the file. */
int
-identify_source_line (s, line, mid_statement, pc)
- struct symtab *s;
- int line;
- int mid_statement;
- CORE_ADDR pc;
+identify_source_line (struct symtab *s, int line, int mid_statement,
+ 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,16 +948,15 @@ identify_source_line (s, line, mid_statement, pc)
current_source_symtab = s;
return 1;
}
-
+
/* 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 (struct symtab *s, int line, int stopline,
+ int noerror);
static void
-print_source_lines_base (s, line, stopline, noerror)
- struct symtab *s;
- int line, stopline;
- int noerror;
+print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
{
register int c;
register int desc;
@@ -992,16 +968,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))
+ /* If printing of source lines is disabled, just print file and line number */
+ if (ui_out_test_flags (uiout, ui_source_list))
{
- last_source_visited = s;
- desc = open_source_file (s);
+ /* 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;
+ }
}
else
{
- desc = last_source_error;
+ desc = -1;
noerror = 1;
}
@@ -1009,14 +993,17 @@ print_source_lines_base (s, line, stopline, noerror)
{
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);
}
else
- printf_filtered ("%d\tin %s\n", line, s->filename);
+ ui_out_field_int (uiout, "line", line);
+ ui_out_text (uiout, "\tin ");
+ ui_out_field_string (uiout, "file", s->filename);
+ ui_out_text (uiout, "\n");
return;
}
@@ -1044,25 +1031,42 @@ print_source_lines_base (s, line, stopline, noerror)
while (nlines-- > 0)
{
+ char buf[20];
+
c = fgetc (stream);
- if (c == EOF) break;
+ if (c == EOF)
+ break;
last_line_listed = current_source_line;
- printf_filtered ("%d\t", current_source_line++);
+ sprintf (buf, "%d\t", current_source_line++);
+ ui_out_text (uiout, buf);
do
{
if (c < 040 && c != '\t' && c != '\n' && c != '\r')
- printf_filtered ("^%c", c + 0100);
+ {
+ sprintf (buf, "^%c", c + 0100);
+ ui_out_text (uiout, buf);
+ }
else if (c == 0177)
- printf_filtered ("^?");
+ ui_out_text (uiout, "^?");
#ifdef CRLF_SOURCE_FILES
else if (c == '\r')
{
- /* Just skip \r characters. */
+ /* Skip a \r character, but only before a \n. */
+ int c1 = fgetc (stream);
+
+ if (c1 != '\n')
+ printf_filtered ("^%c", c + 0100);
+ if (c1 != EOF)
+ ungetc (c1, stream);
}
#endif
else
- printf_filtered ("%c", c);
- } while (c != '\n' && (c = fgetc (stream)) >= 0);
+ {
+ sprintf (buf, "%c", c);
+ ui_out_text (uiout, buf);
+ }
+ }
+ while (c != '\n' && (c = fgetc (stream)) >= 0);
}
fclose (stream);
@@ -1073,60 +1077,31 @@ 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
-print_source_lines (s, line, stopline, noerror)
- struct symtab *s;
- int line, stopline, noerror;
+void
+print_source_lines (struct symtab *s, int line, int stopline, int noerror)
{
-#if defined(TUI)
- if (!tui_version ||
- m_winPtrIsNull(srcWin) || !srcWin->generic.isVisible )
- print_source_lines_base(s, line, stopline, noerror);
- else
- {
- 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;
-
- /* 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);
- }
-#else
- print_source_lines_base(s, line, stopline, noerror);
-#endif
+ print_source_lines_base (s, line, stopline, noerror);
}
/* 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)
- struct symtabs_and_lines *sals;
+ambiguous_line_spec (struct symtabs_and_lines *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
-list_command (arg, from_tty)
- char *arg;
- int from_tty;
+list_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals, sals_end;
struct symtab_and_line sal, sal_end;
@@ -1138,7 +1113,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 */
@@ -1181,16 +1156,17 @@ 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);
- free (sals.sals);
+ xfree (sals.sals);
return;
}
sal = sals.sals[0];
- free (sals.sals);
+ xfree (sals.sals);
}
/* Record whether the BEG arg is all digits. */
@@ -1214,16 +1190,16 @@ 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)
{
ambiguous_line_spec (&sals_end);
- free (sals_end.sals);
+ xfree (sals_end.sals);
return;
}
sal_end = sals_end.sals[0];
- free (sals_end.sals);
+ xfree (sals_end.sals);
}
}
@@ -1235,7 +1211,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
@@ -1245,7 +1221,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)
{
@@ -1266,7 +1242,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,
@@ -1284,19 +1260,14 @@ list_command (arg, from_tty)
else if (sal.symtab == 0)
error ("No default source file yet. Do \"help list\".");
else if (no_end)
- 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);
- else
- /* If lines_to_list is odd, then we round down in
- * one of the lines_to_list/2 computations, round up in
- * the other, so the total window size around the specified
- * line comes out right.
- */
- print_source_lines (sal.symtab,
- max (sal.line - (lines_to_list / 2), 1),
- sal.line + ((1+lines_to_list) / 2), 0);
+ {
+ int first_line = sal.line - lines_to_list / 2;
+
+ if (first_line < 1) first_line = 1;
+
+ print_source_lines (sal.symtab, first_line, first_line + lines_to_list,
+ 0);
+ }
else
print_source_lines (sal.symtab, sal.line,
(dummy_end
@@ -1308,16 +1279,14 @@ list_command (arg, from_tty)
/* Print info on range of pc's in a specified line. */
static void
-line_info (arg, from_tty)
- char *arg;
- int from_tty;
+line_info (char *arg, int from_tty)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
CORE_ADDR start_pc, end_pc;
int i;
- INIT_SAL (&sal); /* initialize to zeroes */
+ INIT_SAL (&sal); /* initialize to zeroes */
if (arg == 0)
{
@@ -1331,7 +1300,7 @@ line_info (arg, from_tty)
else
{
sals = decode_line_spec_1 (arg, 0);
-
+
dont_repeat ();
}
@@ -1340,15 +1309,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);
@@ -1401,16 +1370,14 @@ line_info (arg, from_tty)
printf_filtered ("Line number %d is out of range for \"%s\".\n",
sal.line, sal.symtab->filename);
}
- free (sals.sals);
+ xfree (sals.sals);
}
/* Commands to search the source file for a regexp. */
/* ARGSUSED */
static void
-forward_search_command (regex, from_tty)
- char *regex;
- int from_tty;
+forward_search_command (char *regex, int from_tty)
{
register int c;
register int desc;
@@ -1418,29 +1385,7 @@ forward_search_command (regex, from_tty)
int line;
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 (!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;
- else
- {
- printf_filtered("No source displayed.\nExpression not found.\n");
- return;
- }
- }
- line++;
-#else
line = last_line_listed + 1;
-#endif
msg = (char *) re_comp (regex);
if (msg)
@@ -1470,46 +1415,57 @@ 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++;
- }
+#ifdef CRLF_SOURCE_FILES
+ /* Remove the \r, if any, at the end of the line, otherwise
+ regular expressions that end with $ or \n won't work. */
+ if (p - buf > 1 && p[-2] == '\r')
+ {
+ p--;
+ p[-1] = '\n';
+ }
+#endif
+
+ /* we now have a source line in buf, null terminate and match */
+ *p = 0;
+ if (re_exec (buf) > 0)
+ {
+ /* Match! */
+ fclose (stream);
+ 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);
@@ -1517,38 +1473,15 @@ forward_search_command (regex, from_tty)
/* ARGSUSED */
static void
-reverse_search_command (regex, from_tty)
- char *regex;
- int from_tty;
+reverse_search_command (char *regex, int from_tty)
{
register int c;
register int desc;
register FILE *stream;
int line;
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 (!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;
- else
- {
- printf_filtered("No source displayed.\nExpression not found.\n");
- return;
- }
- }
- line--;
-#else
+
line = last_line_listed - 1;
-#endif
msg = (char *) re_comp (regex);
if (msg)
@@ -1587,9 +1520,21 @@ 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);
+
+#ifdef CRLF_SOURCE_FILES
+ /* Remove the \r, if any, at the end of the line, otherwise
+ regular expressions that end with $ or \n won't work. */
+ if (p - buf > 1 && p[-2] == '\r')
+ {
+ p--;
+ p[-1] = '\n';
+ }
+#endif
/* We now have a source line in buf; null terminate and match. */
*p = 0;
@@ -1597,9 +1542,7 @@ 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);
+ print_source_lines (current_source_symtab, line, line + 1, 0);
set_internalvar (lookup_internalvar ("_"),
value_from_longest (builtin_type_int,
(LONGEST) line));
@@ -1620,7 +1563,7 @@ reverse_search_command (regex, from_tty)
}
void
-_initialize_source ()
+_initialize_source (void)
{
struct cmd_list_element *c;
current_source_symtab = 0;
@@ -1633,7 +1576,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\
@@ -1641,7 +1584,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;
@@ -1653,12 +1596,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,
@@ -1688,8 +1631,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,
@@ -1717,8 +1660,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);
}
diff --git a/contrib/gdb/gdb/source.h b/contrib/gdb/gdb/source.h
new file mode 100644
index 0000000..8dbf851
--- /dev/null
+++ b/contrib/gdb/gdb/source.h
@@ -0,0 +1,34 @@
+/* List lines of source files for GDB, the GNU debugger.
+ Copyright 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. */
+
+#ifndef SOURCE_H
+#define SOURCE_H
+
+/* Open a source file given a symtab S. Returns a file descriptor or
+ negative number for error. */
+extern int open_source_file (struct symtab *s);
+
+/* 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. All set S->nlines to the number of such
+ lines. */
+extern void find_source_lines (struct symtab *s, int desc);
+
+#endif
diff --git a/contrib/gdb/gdb/sparc-linux-nat.c b/contrib/gdb/gdb/sparc-linux-nat.c
new file mode 100644
index 0000000..ba418b6
--- /dev/null
+++ b/contrib/gdb/gdb/sparc-linux-nat.c
@@ -0,0 +1,100 @@
+/* Native-dependent code for GNU/Linux SPARC.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "regcache.h"
+
+#include <sys/procfs.h>
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+void
+supply_gregset (elf_gregset_t *gregsetp)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = G0_REGNUM; i <= I7_REGNUM; i++)
+ supply_register (i, (char *) (regp + (i - G0_REGNUM)));
+
+ supply_register (PS_REGNUM, (char *) (regp + 32));
+
+ supply_register (PC_REGNUM, (char *) (regp + 33));
+ supply_register (NPC_REGNUM, (char *) (regp + 34));
+ supply_register (Y_REGNUM, (char *) (regp + 35));
+
+ supply_register (WIM_REGNUM, (char *) (regp + 36));
+ supply_register (TBR_REGNUM, (char *) (regp + 37));
+
+ /* Fill inaccessible registers with zero. */
+ supply_register (CPS_REGNUM, NULL);
+}
+
+void
+fill_gregset (elf_gregset_t *gregsetp, int regno)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = G0_REGNUM; i <= I7_REGNUM; i++)
+ if (regno == -1 || regno == i)
+ regcache_collect (i, regp + (i - G0_REGNUM));
+
+ if (regno == -1 || regno == PS_REGNUM)
+ regcache_collect (PS_REGNUM, regp + 32);
+
+ if (regno == -1 || regno == PC_REGNUM)
+ regcache_collect (PC_REGNUM, regp + 33);
+ if (regno == -1 || regno == NPC_REGNUM)
+ regcache_collect (NPC_REGNUM, regp + 34);
+ if (regno == -1 || regno == Y_REGNUM)
+ regcache_collect (Y_REGNUM, regp + 35);
+
+ if (regno == -1 || regno == WIM_REGNUM)
+ regcache_collect (WIM_REGNUM, regp + 36);
+ if (regno == -1 || regno == TBR_REGNUM)
+ regcache_collect (TBR_REGNUM, regp + 37);
+}
+
+void
+supply_fpregset (elf_fpregset_t *fpregsetp)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < FP0_REGNUM + 32; i++)
+ supply_register (i, (char *) &fpregsetp->pr_fr.pr_regs[i - FP0_REGNUM]);
+
+ supply_register (FPS_REGNUM, (char *) &fpregsetp->pr_fsr);
+}
+
+void
+fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
+{
+ int i;
+
+ for (i = FP0_REGNUM; i < FP0_REGNUM + 32; i++)
+ if (regno == -1 || regno == i)
+ regcache_collect (i, &fpregsetp->pr_fr.pr_regs[i - FP0_REGNUM]);
+
+ if (regno == -1 || regno == FPS_REGNUM)
+ regcache_collect (FPS_REGNUM, &fpregsetp->pr_fsr);
+}
diff --git a/contrib/gdb/gdb/sparc-nat.c b/contrib/gdb/gdb/sparc-nat.c
new file mode 100644
index 0000000..7069c3a
--- /dev/null
+++ b/contrib/gdb/gdb/sparc-nat.c
@@ -0,0 +1,347 @@
+/* Functions specific to running gdb native on a SPARC running SunOS4.
+ Copyright 1989, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "target.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <signal.h>
+#include <sys/ptrace.h>
+#include <sys/wait.h>
+#ifdef __linux__
+#include <asm/reg.h>
+#else
+#include <machine/reg.h>
+#endif
+#include <sys/user.h>
+
+/* We don't store all registers immediately when requested, since they
+ get sent over in large chunks anyway. Instead, we accumulate most
+ of the changes and send them over once. "deferred_stores" keeps
+ track of which sets of registers we have locally-changed copies of,
+ so we only need send the groups that have changed. */
+
+#define INT_REGS 1
+#define STACK_REGS 2
+#define FP_REGS 4
+
+/* Fetch one or more registers from the inferior. REGNO == -1 to get
+ them all. We actually fetch more than requested, when convenient,
+ marking them as valid so we won't fetch them again. */
+
+void
+fetch_inferior_registers (int regno)
+{
+ struct regs inferior_registers;
+ struct fp_status inferior_fp_registers;
+ int i;
+
+ /* 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)
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+
+ DO_DEFERRED_STORES;
+
+ /* Global and Out regs are fetched directly, as well as the control
+ registers. If we're getting one of the in or local regs,
+ 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 */
+ || regno >= Y_REGNUM
+ || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
+ {
+ if (0 != ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
+ (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;
+
+ for (i = G0_REGNUM; i <= O7_REGNUM; i++)
+ register_valid[i] = 1;
+ register_valid[Y_REGNUM] = 1;
+ register_valid[PS_REGNUM] = 1;
+ 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. */
+ 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 */
+ }
+
+ /* Floating point registers */
+ if (regno == -1 ||
+ regno == FPS_REGNUM ||
+ (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
+ {
+ if (0 != ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers,
+ 0))
+ 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++)
+ register_valid[i] = 1;
+ register_valid[FPS_REGNUM] = 1;
+ }
+
+ /* These regs are saved on the stack by the kernel. Only read them
+ all (16 ptrace calls!) if we really need them. */
+ if (regno == -1)
+ {
+ CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
+ target_read_memory (sp, &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 = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
+ i = REGISTER_BYTE (regno);
+ if (register_valid[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;
+ }
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+void
+store_inferior_registers (int regno)
+{
+ struct regs inferior_registers;
+ struct fp_status inferior_fp_registers;
+ int wanna_store = INT_REGS + STACK_REGS + FP_REGS;
+
+ /* First decide which pieces of machine-state we need to modify.
+ Default for regno == -1 case is all pieces. */
+ if (regno >= 0)
+ if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
+ {
+ wanna_store = FP_REGS;
+ }
+ else
+ {
+ if (regno == SP_REGNUM)
+ wanna_store = INT_REGS + STACK_REGS;
+ else if (regno < L0_REGNUM || regno > I7_REGNUM)
+ wanna_store = INT_REGS;
+ else if (regno == FPS_REGNUM)
+ wanna_store = FP_REGS;
+ else
+ wanna_store = STACK_REGS;
+ }
+
+ /* See if we're forcing the stores to happen now, or deferring. */
+ if (regno == -2)
+ {
+ wanna_store = deferred_stores;
+ deferred_stores = 0;
+ }
+ else
+ {
+ if (wanna_store == STACK_REGS)
+ {
+ /* Fall through and just store one stack reg. If we deferred
+ it, we'd have to store them all, or remember more info. */
+ }
+ else
+ {
+ deferred_stores |= wanna_store;
+ return;
+ }
+ }
+
+ if (wanna_store & STACK_REGS)
+ {
+ CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
+
+ if (regno < 0 || regno == SP_REGNUM)
+ {
+ if (!register_valid[L0_REGNUM + 5])
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ target_write_memory (sp,
+ &registers[REGISTER_BYTE (L0_REGNUM)],
+ 16 * REGISTER_RAW_SIZE (L0_REGNUM));
+ }
+ else
+ {
+ if (!register_valid[regno])
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ 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])
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+
+ 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)];
+ inferior_registers.r_pc =
+ *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ inferior_registers.r_npc =
+ *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
+ inferior_registers.r_y =
+ *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
+
+ if (0 != ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_registers, 0))
+ perror ("ptrace_setregs");
+ }
+
+ if (wanna_store & FP_REGS)
+ {
+ if (!register_valid[FP0_REGNUM + 9])
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ sizeof inferior_fp_registers.fpu_fr);
+ memcpy (&inferior_fp_registers.Fpu_fsr,
+ &registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
+ if (0 !=
+ ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
+ perror ("ptrace_setfpregs");
+ }
+}
+
+/* Provide registers to GDB from a core file.
+
+ CORE_REG_SECT points to an array of bytes, which are the contents
+ of a `note' from a core file which BFD thinks might contain
+ register contents. CORE_REG_SIZE is its size.
+
+ WHICH says which register set corelow suspects this is:
+ 0 --- the general-purpose register set
+ 2 --- the floating-point register set
+
+ IGNORE is unused. */
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR ignore)
+{
+
+ if (which == 0)
+ {
+
+ /* 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;
+
+ 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)
+ {
+
+ /* 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");
+ }
+}
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
+
+/* Register that we are able to handle sparc core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns sparc_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_core_sparc (void)
+{
+ add_core_fns (&sparc_core_fns);
+}
diff --git a/contrib/gdb/gdb/sparc-stub.c b/contrib/gdb/gdb/sparc-stub.c
new file mode 100644
index 0000000..1e6298a
--- /dev/null
+++ b/contrib/gdb/gdb/sparc-stub.c
@@ -0,0 +1,778 @@
+/****************************************************************************
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ HP offers the following for use in the public domain. HP makes no
+ warranty with regard to the software or it's performance and the
+ user accepts the software "AS IS" with all faults.
+
+ HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
+ TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+****************************************************************************/
+
+/****************************************************************************
+ * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ *
+ * Module name: remcom.c $
+ * Revision: 1.34 $
+ * Date: 91/03/09 12:29:49 $
+ * Contributor: Lake Stevens Instrument Division$
+ *
+ * Description: low level support for gdb debugger. $
+ *
+ * Considerations: only works on target hardware $
+ *
+ * Written by: Glenn Engel $
+ * ModuleState: Experimental $
+ *
+ * NOTES: See Below $
+ *
+ * Modified for SPARC by Stu Grossman, Cygnus Support.
+ *
+ * This code has been extensively tested on the Fujitsu SPARClite demo board.
+ *
+ * To enable debugger support, two things need to happen. One, a
+ * call to set_debug_traps() is necessary in order to allow any breakpoints
+ * or error conditions to be properly intercepted and reported to gdb.
+ * Two, a breakpoint needs to be generated to begin communication. This
+ * is most easily accomplished by a call to breakpoint(). Breakpoint()
+ * simulates a breakpoint by executing a trap #1.
+ *
+ *************
+ *
+ * The following gdb commands are supported:
+ *
+ * command function Return value
+ *
+ * g return the value of the CPU registers hex data or ENN
+ * G set the value of the CPU registers OK or ENN
+ *
+ * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
+ * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
+ *
+ * c Resume at current address SNN ( signal NN)
+ * cAA..AA Continue at address AA..AA SNN
+ *
+ * s Step one instruction SNN
+ * sAA..AA Step one instruction from AA..AA SNN
+ *
+ * k kill
+ *
+ * ? What was the last sigval ? SNN (signal NN)
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum. A packet consists of
+ *
+ * $<packet info>#<checksum>.
+ *
+ * where
+ * <packet info> :: <characters representing the command or response>
+ * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
+ *
+ * When a packet is received, it is first acknowledged with either '+' or '-'.
+ * '+' indicates a successful transfer. '-' indicates a failed transfer.
+ *
+ * Example:
+ *
+ * Host: Reply:
+ * $m0,10#2a +$00010203040506070809101112131415#42
+ *
+ ****************************************************************************/
+
+#include <string.h>
+#include <signal.h>
+
+/************************************************************************
+ *
+ * external low-level support routines
+ */
+
+extern void putDebugChar(); /* write a single character */
+extern int getDebugChar(); /* read and return a single char */
+
+/************************************************************************/
+/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
+/* at least NUMREGBYTES*2 are needed for register packets */
+#define BUFMAX 2048
+
+static int initialized = 0; /* !0 means we've been initialized */
+
+static void set_mem_fault_trap();
+
+static const char hexchars[]="0123456789abcdef";
+
+#define NUMREGS 72
+
+/* Number of bytes of registers. */
+#define NUMREGBYTES (NUMREGS * 4)
+enum regnames {G0, G1, G2, G3, G4, G5, G6, G7,
+ O0, O1, O2, O3, O4, O5, SP, O7,
+ L0, L1, L2, L3, L4, L5, L6, L7,
+ I0, I1, I2, I3, I4, I5, FP, I7,
+
+ 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,
+ Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR };
+
+/*************************** ASSEMBLY CODE MACROS *************************/
+/* */
+
+extern void trap_low();
+
+asm("
+ .reserve trapstack, 1000 * 4, \"bss\", 8
+
+ .data
+ .align 4
+
+in_trap_handler:
+ .word 0
+
+ .text
+ .align 4
+
+! This function is called when any SPARC trap (except window overflow or
+! underflow) occurs. It makes sure that the invalid register window is still
+! available before jumping into C code. It will also restore the world if you
+! return from handle_exception.
+
+ .globl _trap_low
+_trap_low:
+ mov %psr, %l0
+ mov %wim, %l3
+
+ srl %l3, %l0, %l4 ! wim >> cwp
+ cmp %l4, 1
+ bne window_fine ! Branch if not in the invalid window
+ nop
+
+! Handle window overflow
+
+ mov %g1, %l4 ! Save g1, we use it to hold the wim
+ srl %l3, 1, %g1 ! Rotate wim right
+ tst %g1
+ bg good_wim ! Branch if new wim is non-zero
+ nop
+
+! At this point, we need to bring a 1 into the high order bit of the wim.
+! Since we don't want to make any assumptions about the number of register
+! windows, we figure it out dynamically so as to setup the wim correctly.
+
+ not %g1 ! Fill g1 with ones
+ mov %g1, %wim ! Fill the wim with ones
+ nop
+ nop
+ nop
+ mov %wim, %g1 ! Read back the wim
+ inc %g1 ! Now g1 has 1 just to left of wim
+ srl %g1, 1, %g1 ! Now put 1 at top of wim
+ mov %g0, %wim ! Clear wim so that subsequent save
+ nop ! won't trap
+ nop
+ nop
+
+good_wim:
+ save %g0, %g0, %g0 ! Slip into next window
+ mov %g1, %wim ! Install the new wim
+
+ std %l0, [%sp + 0 * 4] ! save L & I registers
+ std %l2, [%sp + 2 * 4]
+ std %l4, [%sp + 4 * 4]
+ std %l6, [%sp + 6 * 4]
+
+ std %i0, [%sp + 8 * 4]
+ std %i2, [%sp + 10 * 4]
+ std %i4, [%sp + 12 * 4]
+ std %i6, [%sp + 14 * 4]
+
+ restore ! Go back to trap window.
+ mov %l4, %g1 ! Restore %g1
+
+window_fine:
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ tst %l5
+ bg recursive_trap
+ inc %l5
+
+ set trapstack+1000*4, %sp ! Switch to trap stack
+
+recursive_trap:
+ st %l5, [%lo(in_trap_handler) + %l4]
+ sub %sp,(16+1+6+1+72)*4,%sp ! Make room for input & locals
+ ! + hidden arg + arg spill
+ ! + doubleword alignment
+ ! + registers[72] local var
+
+ std %g0, [%sp + (24 + 0) * 4] ! registers[Gx]
+ std %g2, [%sp + (24 + 2) * 4]
+ std %g4, [%sp + (24 + 4) * 4]
+ std %g6, [%sp + (24 + 6) * 4]
+
+ std %i0, [%sp + (24 + 8) * 4] ! registers[Ox]
+ std %i2, [%sp + (24 + 10) * 4]
+ std %i4, [%sp + (24 + 12) * 4]
+ std %i6, [%sp + (24 + 14) * 4]
+ ! F0->F31 not implemented
+ mov %y, %l4
+ mov %tbr, %l5
+ st %l4, [%sp + (24 + 64) * 4] ! Y
+ st %l0, [%sp + (24 + 65) * 4] ! PSR
+ st %l3, [%sp + (24 + 66) * 4] ! WIM
+ st %l5, [%sp + (24 + 67) * 4] ! TBR
+ st %l1, [%sp + (24 + 68) * 4] ! PC
+ st %l2, [%sp + (24 + 69) * 4] ! NPC
+
+ ! CPSR and FPSR not impl
+
+ or %l0, 0xf20, %l4
+ mov %l4, %psr ! Turn on traps, disable interrupts
+
+ call _handle_exception
+ add %sp, 24 * 4, %o0 ! Pass address of registers
+
+! Reload all of the registers that aren't on the stack
+
+ ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx]
+ ldd [%sp + (24 + 2) * 4], %g2
+ ldd [%sp + (24 + 4) * 4], %g4
+ ldd [%sp + (24 + 6) * 4], %g6
+
+ ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox]
+ ldd [%sp + (24 + 10) * 4], %i2
+ ldd [%sp + (24 + 12) * 4], %i4
+ ldd [%sp + (24 + 14) * 4], %i6
+
+ ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR
+ ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC
+
+ restore ! Ensure that previous window is valid
+ save %g0, %g0, %g0 ! by causing a window_underflow trap
+
+ mov %l0, %y
+ mov %l1, %psr ! Make sure that traps are disabled
+ ! for rett
+
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ dec %l5
+ st %l5, [%lo(in_trap_handler) + %l4]
+
+ jmpl %l2, %g0 ! Restore old PC
+ rett %l3 ! Restore old nPC
+");
+
+/* Convert ch from a hex digit to an int */
+
+static int
+hex (unsigned char ch)
+{
+ if (ch >= 'a' && ch <= 'f')
+ return ch-'a'+10;
+ if (ch >= '0' && ch <= '9')
+ return ch-'0';
+ if (ch >= 'A' && ch <= 'F')
+ return ch-'A'+10;
+ return -1;
+}
+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
+
+/* scan for the sequence $<data>#<checksum> */
+
+unsigned char *
+getpacket (void)
+{
+ unsigned char *buffer = &remcomInBuffer[0];
+ unsigned char checksum;
+ unsigned char xmitcsum;
+ int count;
+ char ch;
+
+ while (1)
+ {
+ /* wait around for the start character, ignore all other characters */
+ while ((ch = getDebugChar ()) != '$')
+ ;
+
+retry:
+ checksum = 0;
+ xmitcsum = -1;
+ count = 0;
+
+ /* now, read until a # or end of buffer is found */
+ while (count < BUFMAX)
+ {
+ ch = getDebugChar ();
+ if (ch == '$')
+ goto retry;
+ if (ch == '#')
+ break;
+ checksum = checksum + ch;
+ buffer[count] = ch;
+ count = count + 1;
+ }
+ buffer[count] = 0;
+
+ if (ch == '#')
+ {
+ ch = getDebugChar ();
+ xmitcsum = hex (ch) << 4;
+ ch = getDebugChar ();
+ xmitcsum += hex (ch);
+
+ if (checksum != xmitcsum)
+ {
+ putDebugChar ('-'); /* failed checksum */
+ }
+ else
+ {
+ putDebugChar ('+'); /* successful transfer */
+
+ /* if a sequence char is present, reply the sequence ID */
+ if (buffer[2] == ':')
+ {
+ putDebugChar (buffer[0]);
+ putDebugChar (buffer[1]);
+
+ return &buffer[3];
+ }
+
+ return &buffer[0];
+ }
+ }
+ }
+}
+
+/* send the packet in buffer. */
+
+static void
+putpacket (unsigned char *buffer)
+{
+ unsigned char checksum;
+ int count;
+ unsigned char ch;
+
+ /* $<packet info>#<checksum>. */
+ do
+ {
+ putDebugChar('$');
+ checksum = 0;
+ count = 0;
+
+ while (ch = buffer[count])
+ {
+ putDebugChar(ch);
+ checksum += ch;
+ count += 1;
+ }
+
+ putDebugChar('#');
+ putDebugChar(hexchars[checksum >> 4]);
+ putDebugChar(hexchars[checksum & 0xf]);
+
+ }
+ while (getDebugChar() != '+');
+}
+
+/* Indicate to caller of mem2hex or hex2mem that there has been an
+ error. */
+static volatile int mem_err = 0;
+
+/* Convert the memory pointed to by mem into hex, placing result in buf.
+ * Return a pointer to the last char put in buf (null), in case of mem fault,
+ * return 0.
+ * If MAY_FAULT is non-zero, then we will handle memory faults by returning
+ * a 0, else treat a fault like any other fault in the stub.
+ */
+
+static unsigned char *
+mem2hex (unsigned char *mem, unsigned char *buf, int count, int may_fault)
+{
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ while (count-- > 0)
+ {
+ ch = *mem++;
+ if (mem_err)
+ return 0;
+ *buf++ = hexchars[ch >> 4];
+ *buf++ = hexchars[ch & 0xf];
+ }
+
+ *buf = 0;
+
+ set_mem_fault_trap(0);
+
+ return buf;
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem
+ * return a pointer to the character AFTER the last byte written */
+
+static char *
+hex2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
+{
+ int i;
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ for (i=0; i<count; i++)
+ {
+ ch = hex(*buf++) << 4;
+ ch |= hex(*buf++);
+ *mem++ = ch;
+ if (mem_err)
+ return 0;
+ }
+
+ set_mem_fault_trap(0);
+
+ return mem;
+}
+
+/* This table contains the mapping between SPARC hardware trap types, and
+ signals, which are primarily what GDB understands. It also indicates
+ which hardware traps we need to commandeer when initializing the stub. */
+
+static struct hard_trap_info
+{
+ unsigned char tt; /* Trap type code for SPARClite */
+ unsigned char signo; /* Signal that we map this trap into */
+} hard_trap_info[] = {
+ {1, SIGSEGV}, /* instruction access error */
+ {2, SIGILL}, /* privileged instruction */
+ {3, SIGILL}, /* illegal instruction */
+ {4, SIGEMT}, /* fp disabled */
+ {36, SIGEMT}, /* cp disabled */
+ {7, SIGBUS}, /* mem address not aligned */
+ {9, SIGSEGV}, /* data access exception */
+ {10, SIGEMT}, /* tag overflow */
+ {128+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */
+ {0, 0} /* Must be last */
+};
+
+/* Set up exception handlers for tracing and breakpoints */
+
+void
+set_debug_traps (void)
+{
+ struct hard_trap_info *ht;
+
+ for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+ exceptionHandler(ht->tt, trap_low);
+
+ initialized = 1;
+}
+
+asm ("
+! Trap handler for memory errors. This just sets mem_err to be non-zero. It
+! assumes that %l1 is non-zero. This should be safe, as it is doubtful that
+! 0 would ever contain code that could mem fault. This routine will skip
+! past the faulting instruction after setting mem_err.
+
+ .text
+ .align 4
+
+_fltr_set_mem_err:
+ sethi %hi(_mem_err), %l0
+ st %l1, [%l0 + %lo(_mem_err)]
+ jmpl %l2, %g0
+ rett %l2+4
+");
+
+static void
+set_mem_fault_trap (int enable)
+{
+ extern void fltr_set_mem_err();
+ mem_err = 0;
+
+ if (enable)
+ exceptionHandler(9, fltr_set_mem_err);
+ else
+ exceptionHandler(9, trap_low);
+}
+
+/* Convert the SPARC hardware trap type code to a unix signal number. */
+
+static int
+computeSignal (int tt)
+{
+ struct hard_trap_info *ht;
+
+ for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+ if (ht->tt == tt)
+ return ht->signo;
+
+ return SIGHUP; /* default for things we don't know about */
+}
+
+/*
+ * While we find nice hex chars, build an int.
+ * Return number of chars processed.
+ */
+
+static int
+hexToInt(char **ptr, int *intValue)
+{
+ int numChars = 0;
+ int hexValue;
+
+ *intValue = 0;
+
+ while (**ptr)
+ {
+ hexValue = hex(**ptr);
+ if (hexValue < 0)
+ break;
+
+ *intValue = (*intValue << 4) | hexValue;
+ numChars ++;
+
+ (*ptr)++;
+ }
+
+ return (numChars);
+}
+
+/*
+ * This function does all command procesing for interfacing to gdb. It
+ * returns 1 if you should skip the instruction at the trap address, 0
+ * otherwise.
+ */
+
+extern void breakinst();
+
+static void
+handle_exception (unsigned long *registers)
+{
+ int tt; /* Trap type */
+ int sigval;
+ int addr;
+ int length;
+ char *ptr;
+ unsigned long *sp;
+
+/* First, we must force all of the windows to be spilled out */
+
+ asm(" save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+");
+
+ if (registers[PC] == (unsigned long)breakinst)
+ {
+ registers[PC] = registers[NPC];
+ registers[NPC] += 4;
+ }
+
+ sp = (unsigned long *)registers[SP];
+
+ tt = (registers[TBR] >> 4) & 0xff;
+
+ /* reply to host that an exception has occurred */
+ sigval = computeSignal(tt);
+ ptr = remcomOutBuffer;
+
+ *ptr++ = 'T';
+ *ptr++ = hexchars[sigval >> 4];
+ *ptr++ = hexchars[sigval & 0xf];
+
+ *ptr++ = hexchars[PC >> 4];
+ *ptr++ = hexchars[PC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[FP >> 4];
+ *ptr++ = hexchars[FP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[SP >> 4];
+ *ptr++ = hexchars[SP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&sp, ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[NPC >> 4];
+ *ptr++ = hexchars[NPC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[NPC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[O7 >> 4];
+ *ptr++ = hexchars[O7 & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[O7], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = 0;
+
+ putpacket(remcomOutBuffer);
+
+ while (1)
+ {
+ remcomOutBuffer[0] = 0;
+
+ ptr = getpacket();
+ switch (*ptr++)
+ {
+ case '?':
+ remcomOutBuffer[0] = 'S';
+ remcomOutBuffer[1] = hexchars[sigval >> 4];
+ remcomOutBuffer[2] = hexchars[sigval & 0xf];
+ remcomOutBuffer[3] = 0;
+ break;
+
+ case 'd': /* toggle debug flag */
+ break;
+
+ case 'g': /* return the value of the CPU registers */
+ {
+ ptr = remcomOutBuffer;
+ ptr = mem2hex((char *)registers, ptr, 16 * 4, 0); /* G & O regs */
+ ptr = mem2hex(sp + 0, ptr, 16 * 4, 0); /* L & I regs */
+ memset(ptr, '0', 32 * 8); /* Floating point */
+ mem2hex((char *)&registers[Y],
+ ptr + 32 * 4 * 2,
+ 8 * 4,
+ 0); /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */
+ }
+ break;
+
+ case 'G': /* set the value of the CPU registers - return OK */
+ {
+ unsigned long *newsp, psr;
+
+ psr = registers[PSR];
+
+ hex2mem(ptr, (char *)registers, 16 * 4, 0); /* G & O regs */
+ hex2mem(ptr + 16 * 4 * 2, sp + 0, 16 * 4, 0); /* L & I regs */
+ hex2mem(ptr + 64 * 4 * 2, (char *)&registers[Y],
+ 8 * 4, 0); /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */
+
+ /* See if the stack pointer has moved. If so, then copy the saved
+ locals and ins to the new location. This keeps the window
+ overflow and underflow routines happy. */
+
+ newsp = (unsigned long *)registers[SP];
+ if (sp != newsp)
+ sp = memcpy(newsp, sp, 16 * 4);
+
+ /* Don't allow CWP to be modified. */
+
+ if (psr != registers[PSR])
+ registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f);
+
+ strcpy(remcomOutBuffer,"OK");
+ }
+ break;
+
+ case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
+ /* Try to read %x,%x. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length))
+ {
+ if (mem2hex((char *)addr, remcomOutBuffer, length, 1))
+ break;
+
+ strcpy (remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer,"E01");
+ break;
+
+ case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
+ /* Try to read '%x,%x:'. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length)
+ && *ptr++ == ':')
+ {
+ if (hex2mem(ptr, (char *)addr, length, 1))
+ strcpy(remcomOutBuffer, "OK");
+ else
+ strcpy(remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer, "E02");
+ break;
+
+ case 'c': /* cAA..AA Continue at address AA..AA(optional) */
+ /* try to read optional parameter, pc unchanged if no parm */
+
+ if (hexToInt(&ptr, &addr))
+ {
+ registers[PC] = addr;
+ registers[NPC] = addr + 4;
+ }
+
+/* Need to flush the instruction cache here, as we may have deposited a
+ breakpoint, and the icache probably has no way of knowing that a data ref to
+ some location may have changed something that is in the instruction cache.
+ */
+
+ flush_i_cache();
+ return;
+
+ /* kill the program */
+ case 'k' : /* do nothing */
+ break;
+#if 0
+ case 't': /* Test feature */
+ asm (" std %f30,[%sp]");
+ break;
+#endif
+ case 'r': /* Reset */
+ asm ("call 0
+ nop ");
+ break;
+ } /* switch */
+
+ /* reply to the request */
+ putpacket(remcomOutBuffer);
+ }
+}
+
+/* This function will generate a breakpoint exception. It is used at the
+ beginning of a program to sync up with a debugger and can be used
+ otherwise as a quick means to stop program execution and "break" into
+ the debugger. */
+
+void
+breakpoint (void)
+{
+ if (!initialized)
+ return;
+
+ asm(" .globl _breakinst
+
+ _breakinst: ta 1
+ ");
+}
diff --git a/contrib/gdb/gdb/sparc-tdep.c b/contrib/gdb/gdb/sparc-tdep.c
new file mode 100644
index 0000000..b2380b4
--- /dev/null
+++ b/contrib/gdb/gdb/sparc-tdep.c
@@ -0,0 +1,3209 @@
+/* Target-dependent code for the SPARC for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* ??? Support for calling functions from gdb in sparc64 is unfinished. */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "frame.h"
+#include "inferior.h"
+#include "obstack.h"
+#include "target.h"
+#include "value.h"
+#include "bfd.h"
+#include "gdb_string.h"
+#include "regcache.h"
+
+#ifdef USE_PROC_FS
+#include <sys/procfs.h>
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+#endif
+
+#include "gdbcore.h"
+
+#include "symfile.h" /* for 'entry_point_address' */
+
+/*
+ * Some local macros that have multi-arch and non-multi-arch versions:
+ */
+
+#if (GDB_MULTI_ARCH > 0)
+
+/* Does the target have Floating Point registers? */
+#define SPARC_HAS_FPU (gdbarch_tdep (current_gdbarch)->has_fpu)
+/* Number of bytes devoted to Floating Point registers: */
+#define FP_REGISTER_BYTES (gdbarch_tdep (current_gdbarch)->fp_register_bytes)
+/* Highest numbered Floating Point register. */
+#define FP_MAX_REGNUM (gdbarch_tdep (current_gdbarch)->fp_max_regnum)
+/* Size of a general (integer) register: */
+#define SPARC_INTREG_SIZE (gdbarch_tdep (current_gdbarch)->intreg_size)
+/* Offset within the call dummy stack of the saved registers. */
+#define DUMMY_REG_SAVE_OFFSET (gdbarch_tdep (current_gdbarch)->reg_save_offset)
+
+#else /* non-multi-arch */
+
+
+/* Does the target have Floating Point registers? */
+#if defined(TARGET_SPARCLET) || defined(TARGET_SPARCLITE)
+#define SPARC_HAS_FPU 0
+#else
+#define SPARC_HAS_FPU 1
+#endif
+
+/* Number of bytes devoted to Floating Point registers: */
+#if (GDB_TARGET_IS_SPARC64)
+#define FP_REGISTER_BYTES (64 * 4)
+#else
+#if (SPARC_HAS_FPU)
+#define FP_REGISTER_BYTES (32 * 4)
+#else
+#define FP_REGISTER_BYTES 0
+#endif
+#endif
+
+/* Highest numbered Floating Point register. */
+#if (GDB_TARGET_IS_SPARC64)
+#define FP_MAX_REGNUM (FP0_REGNUM + 48)
+#else
+#define FP_MAX_REGNUM (FP0_REGNUM + 32)
+#endif
+
+/* Size of a general (integer) register: */
+#define SPARC_INTREG_SIZE (REGISTER_RAW_SIZE (G0_REGNUM))
+
+/* Offset within the call dummy stack of the saved registers. */
+#if (GDB_TARGET_IS_SPARC64)
+#define DUMMY_REG_SAVE_OFFSET (128 + 16)
+#else
+#define DUMMY_REG_SAVE_OFFSET 0x60
+#endif
+
+#endif /* GDB_MULTI_ARCH */
+
+struct gdbarch_tdep
+ {
+ int has_fpu;
+ int fp_register_bytes;
+ int y_regnum;
+ int fp_max_regnum;
+ int intreg_size;
+ int reg_save_offset;
+ int call_dummy_call_offset;
+ int print_insn_mach;
+ };
+
+/* Now make GDB_TARGET_IS_SPARC64 a runtime test. */
+/* FIXME MVS: or try testing bfd_arch_info.arch and bfd_arch_info.mach ...
+ * define GDB_TARGET_IS_SPARC64 \
+ * (TARGET_ARCHITECTURE->arch == bfd_arch_sparc && \
+ * (TARGET_ARCHITECTURE->mach == bfd_mach_sparc_v9 || \
+ * TARGET_ARCHITECTURE->mach == bfd_mach_sparc_v9a))
+ */
+
+/* From infrun.c */
+extern int stop_after_trap;
+
+/* We don't store all registers immediately when requested, since they
+ get sent over in large chunks anyway. Instead, we accumulate most
+ of the changes and send them over once. "deferred_stores" keeps
+ track of which sets of registers we have locally-changed copies of,
+ so we only need send the groups that have changed. */
+
+int deferred_stores = 0; /* Accumulated stores we want to do eventually. */
+
+
+/* Some machines, such as Fujitsu SPARClite 86x, have a bi-endian mode
+ where instructions are big-endian and data are little-endian.
+ This flag is set when we detect that the target is of this type. */
+
+int bi_endian = 0;
+
+
+/* Fetch a single instruction. Even on bi-endian machines
+ such as sparc86x, instructions are always big-endian. */
+
+static unsigned long
+fetch_instruction (CORE_ADDR pc)
+{
+ unsigned long retval;
+ int i;
+ unsigned char buf[4];
+
+ read_memory (pc, buf, sizeof (buf));
+
+ /* Start at the most significant end of the integer, and work towards
+ the least significant. */
+ retval = 0;
+ for (i = 0; i < sizeof (buf); ++i)
+ retval = (retval << 8) | buf[i];
+ return retval;
+}
+
+
+/* Branches with prediction are treated like their non-predicting cousins. */
+/* FIXME: What about floating point branches? */
+
+/* Macros to extract fields from sparc instructions. */
+#define X_OP(i) (((i) >> 30) & 0x3)
+#define X_RD(i) (((i) >> 25) & 0x1f)
+#define X_A(i) (((i) >> 29) & 1)
+#define X_COND(i) (((i) >> 25) & 0xf)
+#define X_OP2(i) (((i) >> 22) & 0x7)
+#define X_IMM22(i) ((i) & 0x3fffff)
+#define X_OP3(i) (((i) >> 19) & 0x3f)
+#define X_RS1(i) (((i) >> 14) & 0x1f)
+#define X_I(i) (((i) >> 13) & 1)
+#define X_IMM13(i) ((i) & 0x1fff)
+/* Sign extension macros. */
+#define X_SIMM13(i) ((X_IMM13 (i) ^ 0x1000) - 0x1000)
+#define X_DISP22(i) ((X_IMM22 (i) ^ 0x200000) - 0x200000)
+#define X_CC(i) (((i) >> 20) & 3)
+#define X_P(i) (((i) >> 19) & 1)
+#define X_DISP19(i) ((((i) & 0x7ffff) ^ 0x40000) - 0x40000)
+#define X_RCOND(i) (((i) >> 25) & 7)
+#define X_DISP16(i) ((((((i) >> 6) && 0xc000) | ((i) & 0x3fff)) ^ 0x8000) - 0x8000)
+#define X_FCN(i) (((i) >> 25) & 31)
+
+typedef enum
+{
+ Error, not_branch, bicc, bicca, ba, baa, ticc, ta, done_retry
+} branch_type;
+
+/* Simulate single-step ptrace call for sun4. Code written by Gary
+ Beihl (beihl@mcc.com). */
+
+/* npc4 and next_pc describe the situation at the time that the
+ step-breakpoint was set, not necessary the current value of NPC_REGNUM. */
+static CORE_ADDR next_pc, npc4, target;
+static int brknpc4, brktrg;
+typedef char binsn_quantum[BREAKPOINT_MAX];
+static binsn_quantum break_mem[3];
+
+static branch_type isbranch (long, CORE_ADDR, CORE_ADDR *);
+
+/* single_step() is called just before we want to resume the inferior,
+ if we want to single-step it but there is no hardware or kernel single-step
+ support (as on all SPARCs). We find all the possible targets of the
+ coming instruction and breakpoint them.
+
+ single_step is also called just after the inferior stops. If we had
+ set up a simulated single-step, we undo our damage. */
+
+void
+sparc_software_single_step (enum target_signal ignore, /* pid, but we don't need it */
+ int insert_breakpoints_p)
+{
+ branch_type br;
+ CORE_ADDR pc;
+ long pc_instruction;
+
+ if (insert_breakpoints_p)
+ {
+ /* Always set breakpoint for NPC. */
+ next_pc = read_register (NPC_REGNUM);
+ npc4 = next_pc + 4; /* branch not taken */
+
+ target_insert_breakpoint (next_pc, break_mem[0]);
+ /* printf_unfiltered ("set break at %x\n",next_pc); */
+
+ pc = read_register (PC_REGNUM);
+ pc_instruction = fetch_instruction (pc);
+ br = isbranch (pc_instruction, pc, &target);
+ brknpc4 = brktrg = 0;
+
+ if (br == bicca)
+ {
+ /* Conditional annulled branch will either end up at
+ npc (if taken) or at npc+4 (if not taken).
+ Trap npc+4. */
+ brknpc4 = 1;
+ target_insert_breakpoint (npc4, break_mem[1]);
+ }
+ else if (br == baa && target != next_pc)
+ {
+ /* Unconditional annulled branch will always end up at
+ the target. */
+ brktrg = 1;
+ target_insert_breakpoint (target, break_mem[2]);
+ }
+ else if (GDB_TARGET_IS_SPARC64 && br == done_retry)
+ {
+ brktrg = 1;
+ target_insert_breakpoint (target, break_mem[2]);
+ }
+ }
+ else
+ {
+ /* Remove breakpoints */
+ target_remove_breakpoint (next_pc, break_mem[0]);
+
+ if (brknpc4)
+ target_remove_breakpoint (npc4, break_mem[1]);
+
+ if (brktrg)
+ target_remove_breakpoint (target, break_mem[2]);
+ }
+}
+
+struct frame_extra_info
+{
+ CORE_ADDR bottom;
+ int in_prologue;
+ int flat;
+ /* Following fields only relevant for flat frames. */
+ CORE_ADDR pc_addr;
+ CORE_ADDR fp_addr;
+ /* Add this to ->frame to get the value of the stack pointer at the
+ time of the register saves. */
+ int sp_offset;
+};
+
+/* Call this for each newly created frame. For SPARC, we need to
+ calculate the bottom of the frame, and do some extra work if the
+ prologue has been generated via the -mflat option to GCC. In
+ particular, we need to know where the previous fp and the pc have
+ been stashed, since their exact position within the frame may vary. */
+
+void
+sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ char *name;
+ CORE_ADDR prologue_start, prologue_end;
+ int insn;
+
+ fi->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+ frame_saved_regs_zalloc (fi);
+
+ fi->extra_info->bottom =
+ (fi->next ?
+ (fi->frame == fi->next->frame ? fi->next->extra_info->bottom :
+ fi->next->frame) : read_sp ());
+
+ /* If fi->next is NULL, then we already set ->frame by passing read_fp()
+ to create_new_frame. */
+ if (fi->next)
+ {
+ char *buf;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ /* Compute ->frame as if not flat. If it is flat, we'll change
+ it later. */
+ if (fi->next->next != NULL
+ && (fi->next->next->signal_handler_caller
+ || frame_in_dummy (fi->next->next))
+ && frameless_look_for_prologue (fi->next))
+ {
+ /* A frameless function interrupted by a signal did not change
+ the frame pointer, fix up frame pointer accordingly. */
+ fi->frame = FRAME_FP (fi->next);
+ fi->extra_info->bottom = fi->next->extra_info->bottom;
+ }
+ else
+ {
+ /* Should we adjust for stack bias here? */
+ get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0);
+ fi->frame = extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM));
+
+ if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
+ fi->frame += 2047;
+ }
+ }
+
+ /* Decide whether this is a function with a ``flat register window''
+ frame. For such functions, the frame pointer is actually in %i7. */
+ fi->extra_info->flat = 0;
+ fi->extra_info->in_prologue = 0;
+ 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. */
+ insn = fetch_instruction (prologue_start);
+ if (X_OP (insn) == 2 && X_RD (insn) == 14 && X_OP3 (insn) == 0
+ && X_I (insn) && X_SIMM13 (insn) < 0)
+ {
+ int offset = X_SIMM13 (insn);
+
+ /* Then look for a save of %i7 into the frame. */
+ insn = fetch_instruction (prologue_start + 4);
+ if (X_OP (insn) == 3
+ && X_RD (insn) == 31
+ && X_OP3 (insn) == 4
+ && X_RS1 (insn) == 14)
+ {
+ char *buf;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ /* We definitely have a flat frame now. */
+ fi->extra_info->flat = 1;
+
+ fi->extra_info->sp_offset = offset;
+
+ /* Overwrite the frame's address with the value in %i7. */
+ get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
+ fi->frame = extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM));
+
+ if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
+ fi->frame += 2047;
+
+ /* Record where the fp got saved. */
+ fi->extra_info->fp_addr =
+ fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+
+ /* Also try to collect where the pc got saved to. */
+ fi->extra_info->pc_addr = 0;
+ insn = fetch_instruction (prologue_start + 12);
+ if (X_OP (insn) == 3
+ && X_RD (insn) == 15
+ && X_OP3 (insn) == 4
+ && X_RS1 (insn) == 14)
+ fi->extra_info->pc_addr =
+ fi->frame + fi->extra_info->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->extra_info->in_prologue = 1;
+ fi->frame = read_register (SP_REGNUM);
+ }
+ }
+ }
+ }
+ if (fi->next && fi->frame == 0)
+ {
+ /* Kludge to cause init_prev_frame_info to destroy the new frame. */
+ fi->frame = fi->next->frame;
+ fi->pc = fi->next->pc;
+ }
+}
+
+CORE_ADDR
+sparc_frame_chain (struct frame_info *frame)
+{
+ /* Value that will cause FRAME_CHAIN_VALID to not worry about the chain
+ value. If it really is zero, we detect it later in
+ sparc_init_prev_frame. */
+ return (CORE_ADDR) 1;
+}
+
+CORE_ADDR
+sparc_extract_struct_value_address (char *regbuf)
+{
+ return extract_address (regbuf + REGISTER_BYTE (O0_REGNUM),
+ REGISTER_RAW_SIZE (O0_REGNUM));
+}
+
+/* Find the pc saved in frame FRAME. */
+
+CORE_ADDR
+sparc_frame_saved_pc (struct frame_info *frame)
+{
+ char *buf;
+ CORE_ADDR addr;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
+ if (frame->signal_handler_caller)
+ {
+ /* This is the signal trampoline frame.
+ Get the saved PC from the sigcontext structure. */
+
+#ifndef SIGCONTEXT_PC_OFFSET
+#define SIGCONTEXT_PC_OFFSET 12
+#endif
+
+ CORE_ADDR sigcontext_addr;
+ char *scbuf;
+ int saved_pc_offset = SIGCONTEXT_PC_OFFSET;
+ char *name = NULL;
+
+ scbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
+
+ /* Solaris2 ucbsigvechandler passes a pointer to a sigcontext
+ 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);
+ 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);
+ 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. */
+ target_read_memory (sigcontext_addr + saved_pc_offset,
+ scbuf, sizeof (scbuf));
+ return extract_address (scbuf, sizeof (scbuf));
+ }
+ else if (frame->extra_info->in_prologue ||
+ (frame->next != NULL &&
+ (frame->next->signal_handler_caller ||
+ 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);
+ return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
+ }
+ if (frame->extra_info->flat)
+ addr = frame->extra_info->pc_addr;
+ else
+ addr = frame->extra_info->bottom + FRAME_SAVED_I0 +
+ SPARC_INTREG_SIZE * (I7_REGNUM - I0_REGNUM);
+
+ if (addr == 0)
+ /* A flat frame leaf function might not save the PC anywhere,
+ just leave it in %o7. */
+ return PC_ADJUST (read_register (O7_REGNUM));
+
+ read_memory (addr, buf, SPARC_INTREG_SIZE);
+ return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
+}
+
+/* Since an individual frame in the frame cache is defined by two
+ arguments (a frame pointer and a stack pointer), we need two
+ arguments to get info for an arbitrary stack frame. This routine
+ takes two arguments and makes the cached frames look as if these
+ two arguments defined a frame on the cache. This allows the rest
+ of info frame to extract the important arguments without
+ difficulty. */
+
+struct frame_info *
+setup_arbitrary_frame (int argc, CORE_ADDR *argv)
+{
+ struct frame_info *frame;
+
+ if (argc != 2)
+ error ("Sparc frame specifications require two arguments: fp and sp");
+
+ frame = create_new_frame (argv[0], 0);
+
+ if (!frame)
+ internal_error (__FILE__, __LINE__,
+ "create_new_frame returned invalid frame");
+
+ frame->extra_info->bottom = argv[1];
+ frame->pc = FRAME_SAVED_PC (frame);
+ return frame;
+}
+
+/* Given a pc value, skip it forward past the function prologue by
+ disassembling instructions that appear to be a prologue.
+
+ If FRAMELESS_P is set, we are only testing to see if the function
+ is frameless. This allows a quicker answer.
+
+ This routine should be more specific in its actions; making sure
+ that it uses the same register in the initial prologue section. */
+
+static CORE_ADDR examine_prologue (CORE_ADDR, int, struct frame_info *,
+ CORE_ADDR *);
+
+static CORE_ADDR
+examine_prologue (CORE_ADDR start_pc, int frameless_p, struct frame_info *fi,
+ CORE_ADDR *saved_regs)
+{
+ int insn;
+ int dest = -1;
+ CORE_ADDR pc = start_pc;
+ int is_flat = 0;
+
+ insn = fetch_instruction (pc);
+
+ /* Recognize the `sethi' insn and record its destination. */
+ if (X_OP (insn) == 0 && X_OP2 (insn) == 4)
+ {
+ dest = X_RD (insn);
+ pc += 4;
+ insn = fetch_instruction (pc);
+ }
+
+ /* Recognize an add immediate value to register to either %g1 or
+ the destination register recorded above. Actually, this might
+ well recognize several different arithmetic operations.
+ It doesn't check that rs1 == rd because in theory "sub %g0, 5, %g1"
+ followed by "save %sp, %g1, %sp" is a valid prologue (Not that
+ I imagine any compiler really does that, however). */
+ if (X_OP (insn) == 2
+ && X_I (insn)
+ && (X_RD (insn) == 1 || X_RD (insn) == dest))
+ {
+ pc += 4;
+ insn = fetch_instruction (pc);
+ }
+
+ /* Recognize any SAVE insn. */
+ 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 */
+ 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 */
+ is_flat = 1;
+ insn = fetch_instruction (pc);
+ /* Recognize store of frame pointer (i7). */
+ if (X_OP (insn) == 3
+ && X_RD (insn) == 31
+ && X_OP3 (insn) == 4
+ && X_RS1 (insn) == 14)
+ {
+ pc += 4;
+ insn = fetch_instruction (pc);
+
+ /* Recognize sub %sp, <anything>, %i7. */
+ if (X_OP (insn) == 2
+ && X_OP3 (insn) == 4
+ && X_RS1 (insn) == 14
+ && X_RD (insn) == 31)
+ {
+ pc += 4;
+ insn = fetch_instruction (pc);
+ }
+ else
+ return pc;
+ }
+ else
+ return pc;
+ }
+ else
+ /* Without a save or add instruction, it's not a prologue. */
+ return start_pc;
+
+ while (1)
+ {
+ /* Recognize stores into the frame from the input registers.
+ This recognizes all non alternate stores of an input register,
+ into a location offset from the frame pointer between
+ +68 and +92. */
+
+ /* The above will fail for arguments that are promoted
+ (eg. shorts to ints or floats to doubles), because the compiler
+ will pass them in positive-offset frame space, but the prologue
+ will save them (after conversion) in negative frame space at an
+ unpredictable offset. Therefore I am going to remove the
+ restriction on the target-address of the save, on the theory
+ that any unbroken sequence of saves from input registers must
+ be part of the prologue. In un-optimized code (at least), I'm
+ fairly sure that the compiler would emit SOME other instruction
+ (eg. a move or add) before emitting another save that is actually
+ a part of the function body.
+
+ Besides, the reserved stack space is different for SPARC64 anyway.
+
+ MVS 4/23/2000 */
+
+ 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_RS1 (insn) == 30) /* Off of frame pointer. */
+ ; /* empty statement -- fall thru to end of loop */
+ else if (GDB_TARGET_IS_SPARC64
+ && X_OP (insn) == 3
+ && (X_OP3 (insn) & 0x3c) == 12 /* store, extended (64-bit) */
+ && (X_RD (insn) & 0x18) == 0x18 /* input register */
+ && X_I (insn) /* immediate mode */
+ && X_RS1 (insn) == 30) /* off of frame pointer */
+ ; /* empty statement -- fall thru to end of loop */
+ else if (X_OP (insn) == 3
+ && (X_OP3 (insn) & 0x3c) == 36 /* store, floating-point */
+ && X_I (insn) /* immediate mode */
+ && X_RS1 (insn) == 30) /* off of frame pointer */
+ ; /* empty statement -- fall thru to end of loop */
+ else if (is_flat
+ && X_OP (insn) == 3
+ && X_OP3 (insn) == 4 /* store? */
+ && X_RS1 (insn) == 14) /* off of frame pointer */
+ {
+ if (saved_regs && X_I (insn))
+ saved_regs[X_RD (insn)] =
+ fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ }
+ else
+ break;
+ pc += 4;
+ insn = fetch_instruction (pc);
+ }
+
+ return pc;
+}
+
+CORE_ADDR
+sparc_skip_prologue (CORE_ADDR start_pc, int frameless_p)
+{
+ return examine_prologue (start_pc, frameless_p, NULL, NULL);
+}
+
+/* Check instruction at ADDR to see if it is a branch.
+ All non-annulled instructions will go to NPC or will trap.
+ Set *TARGET if we find a candidate branch; set to zero if not.
+
+ This isn't static as it's used by remote-sa.sparc.c. */
+
+static branch_type
+isbranch (long instruction, CORE_ADDR addr, CORE_ADDR *target)
+{
+ branch_type val = not_branch;
+ long int offset = 0; /* Must be signed for sign-extend. */
+
+ *target = 0;
+
+ if (X_OP (instruction) == 0
+ && (X_OP2 (instruction) == 2
+ || X_OP2 (instruction) == 6
+ || X_OP2 (instruction) == 1
+ || X_OP2 (instruction) == 3
+ || X_OP2 (instruction) == 5
+ || (GDB_TARGET_IS_SPARC64 && X_OP2 (instruction) == 7)))
+ {
+ if (X_COND (instruction) == 8)
+ val = X_A (instruction) ? baa : ba;
+ else
+ val = X_A (instruction) ? bicca : bicc;
+ switch (X_OP2 (instruction))
+ {
+ case 7:
+ if (!GDB_TARGET_IS_SPARC64)
+ break;
+ /* else fall thru */
+ case 2:
+ case 6:
+ offset = 4 * X_DISP22 (instruction);
+ break;
+ case 1:
+ case 5:
+ offset = 4 * X_DISP19 (instruction);
+ break;
+ case 3:
+ offset = 4 * X_DISP16 (instruction);
+ break;
+ }
+ *target = addr + offset;
+ }
+ else if (GDB_TARGET_IS_SPARC64
+ && X_OP (instruction) == 2
+ && X_OP3 (instruction) == 62)
+ {
+ if (X_FCN (instruction) == 0)
+ {
+ /* done */
+ *target = read_register (TNPC_REGNUM);
+ val = done_retry;
+ }
+ else if (X_FCN (instruction) == 1)
+ {
+ /* retry */
+ *target = read_register (TPC_REGNUM);
+ val = done_retry;
+ }
+ }
+
+ return val;
+}
+
+/* Find register number REGNUM relative to FRAME and put its
+ (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
+ was optimized out (and thus can't be fetched). If the variable
+ was fetched from memory, set *ADDRP to where it was fetched from,
+ otherwise it was fetched from a register.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+
+void
+sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
+ struct frame_info *frame, int regnum,
+ enum lval_type *lval)
+{
+ struct frame_info *frame1;
+ CORE_ADDR addr;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ if (optimized)
+ *optimized = 0;
+
+ addr = 0;
+
+ /* FIXME This code extracted from infcmd.c; should put elsewhere! */
+ if (frame == NULL)
+ {
+ /* error ("No selected frame."); */
+ if (!target_has_registers)
+ 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);
+ if (frame == 0)
+ error ("Cmd not meaningful in the outermost frame.");
+ }
+
+
+ frame1 = frame->next;
+
+ /* Get saved PC from the frame info if not in innermost frame. */
+ if (regnum == PC_REGNUM && frame1 != NULL)
+ {
+ if (lval != NULL)
+ *lval = not_lval;
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+
+ while (frame1 != NULL)
+ {
+ /* FIXME MVS: wrong test for dummy frame at entry. */
+
+ if (frame1->pc >= (frame1->extra_info->bottom ?
+ frame1->extra_info->bottom : read_sp ())
+ && frame1->pc <= FRAME_FP (frame1))
+ {
+ /* Dummy frame. All but the window regs are in there somewhere.
+ The window registers are saved on the stack, just like in a
+ normal frame. */
+ if (regnum >= G1_REGNUM && regnum < G1_REGNUM + 7)
+ addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
+ - (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE);
+ else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
+ addr = (frame1->prev->extra_info->bottom
+ + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_I0);
+ else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
+ addr = (frame1->prev->extra_info->bottom
+ + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_L0);
+ else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
+ addr = frame1->frame + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
+ - (FP_REGISTER_BYTES + 16 * SPARC_INTREG_SIZE);
+ else if (SPARC_HAS_FPU &&
+ regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32)
+ addr = frame1->frame + (regnum - FP0_REGNUM) * 4
+ - (FP_REGISTER_BYTES);
+ else if (GDB_TARGET_IS_SPARC64 && SPARC_HAS_FPU &&
+ regnum >= FP0_REGNUM + 32 && regnum < FP_MAX_REGNUM)
+ addr = frame1->frame + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8
+ - (FP_REGISTER_BYTES);
+ else if (regnum >= Y_REGNUM && regnum < NUM_REGS)
+ addr = frame1->frame + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+ - (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE);
+ }
+ else if (frame1->extra_info->flat)
+ {
+
+ if (regnum == RP_REGNUM)
+ addr = frame1->extra_info->pc_addr;
+ else if (regnum == I7_REGNUM)
+ addr = frame1->extra_info->fp_addr;
+ else
+ {
+ CORE_ADDR func_start;
+ CORE_ADDR *regs;
+
+ regs = alloca (NUM_REGS * sizeof (CORE_ADDR));
+ memset (regs, 0, NUM_REGS * sizeof (CORE_ADDR));
+
+ find_pc_partial_function (frame1->pc, NULL, &func_start, NULL);
+ examine_prologue (func_start, 0, frame1, regs);
+ addr = regs[regnum];
+ }
+ }
+ else
+ {
+ /* Normal frame. Local and In registers are saved on stack. */
+ if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
+ addr = (frame1->prev->extra_info->bottom
+ + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_I0);
+ else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
+ addr = (frame1->prev->extra_info->bottom
+ + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_L0);
+ else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
+ {
+ /* Outs become ins. */
+ get_saved_register (raw_buffer, optimized, addrp, frame1,
+ (regnum - O0_REGNUM + I0_REGNUM), lval);
+ return;
+ }
+ }
+ if (addr != 0)
+ break;
+ frame1 = frame1->next;
+ }
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), addr);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+ if (raw_buffer != NULL)
+ read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ if (lval != NULL)
+ *lval = lval_register;
+ addr = REGISTER_BYTE (regnum);
+ if (raw_buffer != NULL)
+ read_register_gen (regnum, raw_buffer);
+ }
+ if (addrp != NULL)
+ *addrp = addr;
+}
+
+/* Push an empty stack frame, and record in it the current PC, regs, etc.
+
+ We save the non-windowed registers and the ins. The locals and outs
+ are new; they don't need to be saved. The i's and l's of
+ the last frame were already saved on the stack. */
+
+/* Definitely see tm-sparc.h for more doc of the frame format here. */
+
+/* See tm-sparc.h for how this is calculated. */
+
+#define DUMMY_STACK_REG_BUF_SIZE \
+ (((8+8+8) * SPARC_INTREG_SIZE) + FP_REGISTER_BYTES)
+#define DUMMY_STACK_SIZE \
+ (DUMMY_STACK_REG_BUF_SIZE + DUMMY_REG_SAVE_OFFSET)
+
+void
+sparc_push_dummy_frame (void)
+{
+ CORE_ADDR sp, old_sp;
+ char *register_temp;
+
+ register_temp = alloca (DUMMY_STACK_SIZE);
+
+ old_sp = sp = read_sp ();
+
+ if (GDB_TARGET_IS_SPARC64)
+ {
+ /* PC, NPC, CCR, FSR, FPRS, Y, ASI */
+ read_register_bytes (REGISTER_BYTE (PC_REGNUM), &register_temp[0],
+ REGISTER_RAW_SIZE (PC_REGNUM) * 7);
+ read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
+ &register_temp[7 * SPARC_INTREG_SIZE],
+ REGISTER_RAW_SIZE (PSTATE_REGNUM));
+ /* FIXME: not sure what needs to be saved here. */
+ }
+ else
+ {
+ /* Y, PS, WIM, TBR, PC, NPC, FPS, CPS regs */
+ read_register_bytes (REGISTER_BYTE (Y_REGNUM), &register_temp[0],
+ REGISTER_RAW_SIZE (Y_REGNUM) * 8);
+ }
+
+ read_register_bytes (REGISTER_BYTE (O0_REGNUM),
+ &register_temp[8 * SPARC_INTREG_SIZE],
+ SPARC_INTREG_SIZE * 8);
+
+ read_register_bytes (REGISTER_BYTE (G0_REGNUM),
+ &register_temp[16 * SPARC_INTREG_SIZE],
+ SPARC_INTREG_SIZE * 8);
+
+ if (SPARC_HAS_FPU)
+ read_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ &register_temp[24 * SPARC_INTREG_SIZE],
+ FP_REGISTER_BYTES);
+
+ sp -= DUMMY_STACK_SIZE;
+
+ write_sp (sp);
+
+ write_memory (sp + DUMMY_REG_SAVE_OFFSET, &register_temp[0],
+ DUMMY_STACK_REG_BUF_SIZE);
+
+ if (strcmp (target_shortname, "sim") != 0)
+ {
+ write_fp (old_sp);
+
+ /* Set return address register for the call dummy to the current PC. */
+ 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));
+
+ /* The call dummy will write this value to FP after executing
+ the 'save'. */
+ 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);
+
+ /* Set the FP that the call dummy will be using after the 'save'.
+ This makes backtraces from an inferior function call work properly. */
+ write_register (FP_REGNUM, old_sp);
+ }
+}
+
+/* sparc_frame_find_saved_regs (). This function is here only because
+ pop_frame uses it. Note there is an interesting corner case which
+ I think few ports of GDB get right--if you are popping a frame
+ which does not save some register that *is* saved by a more inner
+ frame (such a frame will never be a dummy frame because dummy
+ frames save all registers). Rewriting pop_frame to use
+ get_saved_register would solve this problem and also get rid of the
+ ugly duplication between sparc_frame_find_saved_regs and
+ get_saved_register.
+
+ Stores, into an array of CORE_ADDR,
+ the addresses of the saved registers of frame described by FRAME_INFO.
+ This includes special registers such as pc and fp saved in special
+ ways in the stack frame. sp is even more special:
+ the address we return for it IS the sp for the next frame.
+
+ Note that on register window machines, we are currently making the
+ assumption that window registers are being saved somewhere in the
+ frame in which they are being used. If they are stored in an
+ inferior frame, find_saved_register will break.
+
+ On the Sun 4, the only time all registers are saved is when
+ a dummy frame is involved. Otherwise, the only saved registers
+ are the LOCAL and IN registers which are saved as a result
+ of the "save/restore" opcodes. This condition is determined
+ by address rather than by value.
+
+ The "pc" is not stored in a frame on the SPARC. (What is stored
+ is a return address minus 8.) sparc_pop_frame knows how to
+ deal with that. Other routines might or might not.
+
+ See tm-sparc.h (PUSH_DUMMY_FRAME and friends) for CRITICAL information
+ about how this works. */
+
+static void sparc_frame_find_saved_regs (struct frame_info *, CORE_ADDR *);
+
+static void
+sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
+{
+ register int regnum;
+ CORE_ADDR frame_addr = FRAME_FP (fi);
+
+ if (!fi)
+ internal_error (__FILE__, __LINE__,
+ "Bad frame info struct in FRAME_FIND_SAVED_REGS");
+
+ memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));
+
+ if (fi->pc >= (fi->extra_info->bottom ?
+ fi->extra_info->bottom : 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++)
+ saved_regs_addr[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++)
+ saved_regs_addr[regnum] =
+ frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ - DUMMY_STACK_REG_BUF_SIZE + 8 * SPARC_INTREG_SIZE;
+
+ if (SPARC_HAS_FPU)
+ for (regnum = FP0_REGNUM; regnum < FP_MAX_REGNUM; regnum++)
+ saved_regs_addr[regnum] = frame_addr + (regnum - FP0_REGNUM) * 4
+ - DUMMY_STACK_REG_BUF_SIZE + 24 * SPARC_INTREG_SIZE;
+
+ if (GDB_TARGET_IS_SPARC64)
+ {
+ for (regnum = PC_REGNUM; regnum < PC_REGNUM + 7; regnum++)
+ {
+ saved_regs_addr[regnum] =
+ frame_addr + (regnum - PC_REGNUM) * SPARC_INTREG_SIZE
+ - DUMMY_STACK_REG_BUF_SIZE;
+ }
+ saved_regs_addr[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[regnum] =
+ frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+ - DUMMY_STACK_REG_BUF_SIZE;
+
+ frame_addr = fi->extra_info->bottom ?
+ fi->extra_info->bottom : read_sp ();
+ }
+ else if (fi->extra_info->flat)
+ {
+ CORE_ADDR func_start;
+ find_pc_partial_function (fi->pc, NULL, &func_start, NULL);
+ examine_prologue (func_start, 0, fi, saved_regs_addr);
+
+ /* Flat register window frame. */
+ saved_regs_addr[RP_REGNUM] = fi->extra_info->pc_addr;
+ saved_regs_addr[I7_REGNUM] = fi->extra_info->fp_addr;
+ }
+ else
+ {
+ /* Normal frame. Just Local and In registers */
+ frame_addr = fi->extra_info->bottom ?
+ fi->extra_info->bottom : read_sp ();
+ for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; regnum++)
+ saved_regs_addr[regnum] =
+ (frame_addr + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_L0);
+ for (regnum = I0_REGNUM; regnum < I0_REGNUM + 8; regnum++)
+ saved_regs_addr[regnum] =
+ (frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_I0);
+ }
+ if (fi->next)
+ {
+ if (fi->extra_info->flat)
+ {
+ saved_regs_addr[O7_REGNUM] = fi->extra_info->pc_addr;
+ }
+ else
+ {
+ /* Pull off either the next frame pointer or the stack pointer */
+ CORE_ADDR next_next_frame_addr =
+ (fi->next->extra_info->bottom ?
+ fi->next->extra_info->bottom : read_sp ());
+ for (regnum = O0_REGNUM; regnum < O0_REGNUM + 8; regnum++)
+ saved_regs_addr[regnum] =
+ (next_next_frame_addr
+ + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
+ + FRAME_SAVED_I0);
+ }
+ }
+ /* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */
+ /* FIXME -- should this adjust for the sparc64 offset? */
+ saved_regs_addr[SP_REGNUM] = FRAME_FP (fi);
+}
+
+/* Discard from the stack the innermost frame, restoring all saved registers.
+
+ Note that the values stored in fsr by get_frame_saved_regs are *in
+ the context of the called frame*. What this means is that the i
+ regs of fsr must be restored into the o regs of the (calling) frame that
+ we pop into. We don't care about the output regs of the calling frame,
+ since unless it's a dummy frame, it won't have any output regs in it.
+
+ We never have to bother with %l (local) regs, since the called routine's
+ locals get tossed, and the calling routine's locals are already saved
+ on its stack. */
+
+/* Definitely see tm-sparc.h for more doc of the frame format here. */
+
+void
+sparc_pop_frame (void)
+{
+ register struct frame_info *frame = get_current_frame ();
+ register CORE_ADDR pc;
+ CORE_ADDR *fsr;
+ char *raw_buffer;
+ int regnum;
+
+ fsr = alloca (NUM_REGS * sizeof (CORE_ADDR));
+ raw_buffer = alloca (REGISTER_BYTES);
+ sparc_frame_find_saved_regs (frame, &fsr[0]);
+ if (SPARC_HAS_FPU)
+ {
+ if (fsr[FP0_REGNUM])
+ {
+ read_memory (fsr[FP0_REGNUM], raw_buffer, FP_REGISTER_BYTES);
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ raw_buffer, FP_REGISTER_BYTES);
+ }
+ if (!(GDB_TARGET_IS_SPARC64))
+ {
+ if (fsr[FPS_REGNUM])
+ {
+ read_memory (fsr[FPS_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
+ write_register_gen (FPS_REGNUM, raw_buffer);
+ }
+ if (fsr[CPS_REGNUM])
+ {
+ read_memory (fsr[CPS_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
+ write_register_gen (CPS_REGNUM, raw_buffer);
+ }
+ }
+ }
+ if (fsr[G1_REGNUM])
+ {
+ read_memory (fsr[G1_REGNUM], raw_buffer, 7 * SPARC_INTREG_SIZE);
+ write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer,
+ 7 * SPARC_INTREG_SIZE);
+ }
+
+ if (frame->extra_info->flat)
+ {
+ /* Each register might or might not have been saved, need to test
+ individually. */
+ for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; ++regnum)
+ if (fsr[regnum])
+ write_register (regnum, read_memory_integer (fsr[regnum],
+ SPARC_INTREG_SIZE));
+ for (regnum = I0_REGNUM; regnum < I0_REGNUM + 8; ++regnum)
+ if (fsr[regnum])
+ write_register (regnum, read_memory_integer (fsr[regnum],
+ SPARC_INTREG_SIZE));
+
+ /* Handle all outs except stack pointer (o0-o5; o7). */
+ for (regnum = O0_REGNUM; regnum < O0_REGNUM + 6; ++regnum)
+ if (fsr[regnum])
+ write_register (regnum, read_memory_integer (fsr[regnum],
+ SPARC_INTREG_SIZE));
+ if (fsr[O0_REGNUM + 7])
+ write_register (O0_REGNUM + 7,
+ read_memory_integer (fsr[O0_REGNUM + 7],
+ SPARC_INTREG_SIZE));
+
+ write_sp (frame->frame);
+ }
+ else if (fsr[I0_REGNUM])
+ {
+ CORE_ADDR sp;
+
+ char *reg_temp;
+
+ reg_temp = alloca (REGISTER_BYTES);
+
+ read_memory (fsr[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. */
+ sp = fsr[SP_REGNUM];
+
+ if (GDB_TARGET_IS_SPARC64 && (sp & 1))
+ sp += 2047;
+
+ read_memory (sp, reg_temp, SPARC_INTREG_SIZE * 16);
+
+ /* Restore the out registers.
+ Among other things this writes the new stack pointer. */
+ write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer,
+ SPARC_INTREG_SIZE * 8);
+
+ write_register_bytes (REGISTER_BYTE (L0_REGNUM), reg_temp,
+ SPARC_INTREG_SIZE * 16);
+ }
+
+ if (!(GDB_TARGET_IS_SPARC64))
+ if (fsr[PS_REGNUM])
+ write_register (PS_REGNUM,
+ read_memory_integer (fsr[PS_REGNUM],
+ REGISTER_RAW_SIZE (PS_REGNUM)));
+
+ if (fsr[Y_REGNUM])
+ write_register (Y_REGNUM,
+ read_memory_integer (fsr[Y_REGNUM],
+ REGISTER_RAW_SIZE (Y_REGNUM)));
+ if (fsr[PC_REGNUM])
+ {
+ /* Explicitly specified PC (and maybe NPC) -- just restore them. */
+ write_register (PC_REGNUM,
+ read_memory_integer (fsr[PC_REGNUM],
+ REGISTER_RAW_SIZE (PC_REGNUM)));
+ if (fsr[NPC_REGNUM])
+ write_register (NPC_REGNUM,
+ read_memory_integer (fsr[NPC_REGNUM],
+ REGISTER_RAW_SIZE (NPC_REGNUM)));
+ }
+ else if (frame->extra_info->flat)
+ {
+ if (frame->extra_info->pc_addr)
+ pc = PC_ADJUST ((CORE_ADDR)
+ read_memory_integer (frame->extra_info->pc_addr,
+ REGISTER_RAW_SIZE (PC_REGNUM)));
+ else
+ {
+ /* I think this happens only in the innermost frame, if so then
+ it is a complicated way of saying
+ "pc = read_register (O7_REGNUM);". */
+ char *buf;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
+ get_saved_register (buf, 0, 0, frame, O7_REGNUM, 0);
+ pc = PC_ADJUST (extract_address
+ (buf, REGISTER_RAW_SIZE (O7_REGNUM)));
+ }
+
+ write_register (PC_REGNUM, pc);
+ write_register (NPC_REGNUM, pc + 4);
+ }
+ else if (fsr[I7_REGNUM])
+ {
+ /* Return address in %i7 -- adjust it, then restore PC and NPC from it */
+ pc = PC_ADJUST ((CORE_ADDR) read_memory_integer (fsr[I7_REGNUM],
+ SPARC_INTREG_SIZE));
+ write_register (PC_REGNUM, pc);
+ write_register (NPC_REGNUM, pc + 4);
+ }
+ flush_cached_frames ();
+}
+
+/* On the Sun 4 under SunOS, the compile will leave a fake insn which
+ encodes the structure size being returned. If we detect such
+ a fake insn, step past it. */
+
+CORE_ADDR
+sparc_pc_adjust (CORE_ADDR pc)
+{
+ unsigned long insn;
+ char buf[4];
+ int err;
+
+ err = target_read_memory (pc + 8, buf, 4);
+ insn = extract_unsigned_integer (buf, 4);
+ if ((err == 0) && (insn & 0xffc00000) == 0)
+ return pc + 12;
+ else
+ 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)
+ and removes the corresponding jump table relocation entry in the
+ dynamic relocations.
+ find_solib_trampoline_target relies on the presence of the jump
+ table relocation entry, so we have to detect these jump instructions
+ by hand. */
+
+CORE_ADDR
+sunos4_skip_trampoline_code (CORE_ADDR pc)
+{
+ unsigned long insn1;
+ char buf[4];
+ int err;
+
+ err = target_read_memory (pc, buf, 4);
+ insn1 = extract_unsigned_integer (buf, 4);
+ if (err == 0 && (insn1 & 0xffc00000) == 0x03000000)
+ {
+ unsigned long insn2;
+
+ err = target_read_memory (pc + 4, buf, 4);
+ insn2 = extract_unsigned_integer (buf, 4);
+ if (err == 0 && (insn2 & 0xffffe000) == 0x81c06000)
+ {
+ CORE_ADDR target_pc = (insn1 & 0x3fffff) << 10;
+ int delta = insn2 & 0x1fff;
+
+ /* Sign extend the displacement. */
+ if (delta & 0x1000)
+ delta |= ~0x1fff;
+ return target_pc + delta;
+ }
+ }
+ return find_solib_trampoline_target (pc);
+}
+
+#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
+ 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 sparc for example, the general register set is typically defined
+ by:
+
+ typedef int gregset_t[38];
+
+ #define R_G0 0
+ ...
+ #define R_TBR 37
+
+ and the floating point set by:
+
+ typedef struct prfpregset {
+ union {
+ u_long pr_regs[32];
+ double pr_dregs[16];
+ } pr_fr;
+ void * pr_filler;
+ u_long pr_fsr;
+ u_char pr_qcnt;
+ u_char pr_q_entrysize;
+ u_char pr_en;
+ u_long pr_q[64];
+ } prfpregset_t;
+
+ These routines provide the packing and unpacking of gregset_t and
+ fpregset_t formatted data.
+
+ */
+/* *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 (gdb_gregset_t *gregsetp)
+{
+ prgreg_t *regp = (prgreg_t *) gregsetp;
+ int regi, offset = 0;
+
+ /* If the host is 64-bit sparc, but the target is 32-bit sparc,
+ then the gregset may contain 64-bit ints while supply_register
+ is expecting 32-bit ints. Compensate. */
+ if (sizeof (regp[0]) == 8 && SPARC_INTREG_SIZE == 4)
+ offset = 4;
+
+ /* GDB register numbers for Gn, On, Ln, In all match /proc reg numbers. */
+ /* FIXME MVS: assumes the order of the first 32 elements... */
+ for (regi = G0_REGNUM; regi <= I7_REGNUM; regi++)
+ {
+ supply_register (regi, ((char *) (regp + regi)) + offset);
+ }
+
+ /* These require a bit more care. */
+ supply_register (PC_REGNUM, ((char *) (regp + R_PC)) + offset);
+ supply_register (NPC_REGNUM, ((char *) (regp + R_nPC)) + offset);
+ supply_register (Y_REGNUM, ((char *) (regp + R_Y)) + offset);
+
+ if (GDB_TARGET_IS_SPARC64)
+ {
+#ifdef R_CCR
+ supply_register (CCR_REGNUM, ((char *) (regp + R_CCR)) + offset);
+#else
+ supply_register (CCR_REGNUM, NULL);
+#endif
+#ifdef R_FPRS
+ supply_register (FPRS_REGNUM, ((char *) (regp + R_FPRS)) + offset);
+#else
+ supply_register (FPRS_REGNUM, NULL);
+#endif
+#ifdef R_ASI
+ supply_register (ASI_REGNUM, ((char *) (regp + R_ASI)) + offset);
+#else
+ supply_register (ASI_REGNUM, NULL);
+#endif
+ }
+ else /* sparc32 */
+ {
+#ifdef R_PS
+ supply_register (PS_REGNUM, ((char *) (regp + R_PS)) + offset);
+#else
+ supply_register (PS_REGNUM, NULL);
+#endif
+
+ /* For 64-bit hosts, R_WIM and R_TBR may not be defined.
+ Steal R_ASI and R_FPRS, and hope for the best! */
+
+#if !defined (R_WIM) && defined (R_ASI)
+#define R_WIM R_ASI
+#endif
+
+#if !defined (R_TBR) && defined (R_FPRS)
+#define R_TBR R_FPRS
+#endif
+
+#if defined (R_WIM)
+ supply_register (WIM_REGNUM, ((char *) (regp + R_WIM)) + offset);
+#else
+ supply_register (WIM_REGNUM, NULL);
+#endif
+
+#if defined (R_TBR)
+ supply_register (TBR_REGNUM, ((char *) (regp + R_TBR)) + offset);
+#else
+ supply_register (TBR_REGNUM, NULL);
+#endif
+ }
+
+ /* Fill inaccessible registers with zero. */
+ if (GDB_TARGET_IS_SPARC64)
+ {
+ /*
+ * don't know how to get value of any of the following:
+ */
+ supply_register (VER_REGNUM, NULL);
+ supply_register (TICK_REGNUM, NULL);
+ supply_register (PIL_REGNUM, NULL);
+ supply_register (PSTATE_REGNUM, NULL);
+ supply_register (TSTATE_REGNUM, NULL);
+ supply_register (TBA_REGNUM, NULL);
+ supply_register (TL_REGNUM, NULL);
+ supply_register (TT_REGNUM, NULL);
+ supply_register (TPC_REGNUM, NULL);
+ supply_register (TNPC_REGNUM, NULL);
+ supply_register (WSTATE_REGNUM, NULL);
+ supply_register (CWP_REGNUM, NULL);
+ supply_register (CANSAVE_REGNUM, NULL);
+ supply_register (CANRESTORE_REGNUM, NULL);
+ supply_register (CLEANWIN_REGNUM, NULL);
+ supply_register (OTHERWIN_REGNUM, NULL);
+ supply_register (ASR16_REGNUM, NULL);
+ supply_register (ASR17_REGNUM, NULL);
+ supply_register (ASR18_REGNUM, NULL);
+ supply_register (ASR19_REGNUM, NULL);
+ supply_register (ASR20_REGNUM, NULL);
+ supply_register (ASR21_REGNUM, NULL);
+ supply_register (ASR22_REGNUM, NULL);
+ supply_register (ASR23_REGNUM, NULL);
+ supply_register (ASR24_REGNUM, NULL);
+ supply_register (ASR25_REGNUM, NULL);
+ supply_register (ASR26_REGNUM, NULL);
+ supply_register (ASR27_REGNUM, NULL);
+ supply_register (ASR28_REGNUM, NULL);
+ supply_register (ASR29_REGNUM, NULL);
+ supply_register (ASR30_REGNUM, NULL);
+ supply_register (ASR31_REGNUM, NULL);
+ supply_register (ICC_REGNUM, NULL);
+ supply_register (XCC_REGNUM, NULL);
+ }
+ else
+ {
+ supply_register (CPS_REGNUM, NULL);
+ }
+}
+
+void
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
+{
+ prgreg_t *regp = (prgreg_t *) gregsetp;
+ int regi, offset = 0;
+
+ /* If the host is 64-bit sparc, but the target is 32-bit sparc,
+ then the gregset may contain 64-bit ints while supply_register
+ is expecting 32-bit ints. Compensate. */
+ if (sizeof (regp[0]) == 8 && SPARC_INTREG_SIZE == 4)
+ offset = 4;
+
+ for (regi = 0; regi <= R_I7; regi++)
+ if ((regno == -1) || (regno == regi))
+ read_register_gen (regi, (char *) (regp + regi) + offset);
+
+ if ((regno == -1) || (regno == PC_REGNUM))
+ read_register_gen (PC_REGNUM, (char *) (regp + R_PC) + offset);
+
+ if ((regno == -1) || (regno == NPC_REGNUM))
+ read_register_gen (NPC_REGNUM, (char *) (regp + R_nPC) + offset);
+
+ if ((regno == -1) || (regno == Y_REGNUM))
+ read_register_gen (Y_REGNUM, (char *) (regp + R_Y) + offset);
+
+ if (GDB_TARGET_IS_SPARC64)
+ {
+#ifdef R_CCR
+ if (regno == -1 || regno == CCR_REGNUM)
+ read_register_gen (CCR_REGNUM, ((char *) (regp + R_CCR)) + offset);
+#endif
+#ifdef R_FPRS
+ if (regno == -1 || regno == FPRS_REGNUM)
+ read_register_gen (FPRS_REGNUM, ((char *) (regp + R_FPRS)) + offset);
+#endif
+#ifdef R_ASI
+ if (regno == -1 || regno == ASI_REGNUM)
+ read_register_gen (ASI_REGNUM, ((char *) (regp + R_ASI)) + offset);
+#endif
+ }
+ else /* sparc32 */
+ {
+#ifdef R_PS
+ if (regno == -1 || regno == PS_REGNUM)
+ read_register_gen (PS_REGNUM, ((char *) (regp + R_PS)) + offset);
+#endif
+
+ /* For 64-bit hosts, R_WIM and R_TBR may not be defined.
+ Steal R_ASI and R_FPRS, and hope for the best! */
+
+#if !defined (R_WIM) && defined (R_ASI)
+#define R_WIM R_ASI
+#endif
+
+#if !defined (R_TBR) && defined (R_FPRS)
+#define R_TBR R_FPRS
+#endif
+
+#if defined (R_WIM)
+ if (regno == -1 || regno == WIM_REGNUM)
+ read_register_gen (WIM_REGNUM, ((char *) (regp + R_WIM)) + offset);
+#else
+ if (regno == -1 || regno == WIM_REGNUM)
+ read_register_gen (WIM_REGNUM, NULL);
+#endif
+
+#if defined (R_TBR)
+ if (regno == -1 || regno == TBR_REGNUM)
+ read_register_gen (TBR_REGNUM, ((char *) (regp + R_TBR)) + offset);
+#else
+ if (regno == -1 || regno == TBR_REGNUM)
+ read_register_gen (TBR_REGNUM, NULL);
+#endif
+ }
+}
+
+/* Given a pointer to a floating point register set in /proc format
+ (fpregset_t *), unpack the register contents and supply them as gdb's
+ idea of the current floating point register values. */
+
+void
+supply_fpregset (gdb_fpregset_t *fpregsetp)
+{
+ register int regi;
+ char *from;
+
+ if (!SPARC_HAS_FPU)
+ return;
+
+ for (regi = FP0_REGNUM; regi < FP_MAX_REGNUM; regi++)
+ {
+ from = (char *) &fpregsetp->pr_fr.pr_regs[regi - FP0_REGNUM];
+ supply_register (regi, from);
+ }
+
+ if (GDB_TARGET_IS_SPARC64)
+ {
+ /*
+ * don't know how to get value of the following.
+ */
+ supply_register (FSR_REGNUM, NULL); /* zero it out for now */
+ supply_register (FCC0_REGNUM, NULL);
+ supply_register (FCC1_REGNUM, NULL); /* don't know how to get value */
+ supply_register (FCC2_REGNUM, NULL); /* don't know how to get value */
+ supply_register (FCC3_REGNUM, NULL); /* don't know how to get value */
+ }
+ else
+ {
+ 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. */
+/* This will probably need some changes for sparc64. */
+
+void
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+{
+ int regi;
+ char *to;
+ char *from;
+
+ if (!SPARC_HAS_FPU)
+ return;
+
+ 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];
+ memcpy (to, from, REGISTER_RAW_SIZE (regi));
+ }
+ }
+
+ if (!(GDB_TARGET_IS_SPARC64)) /* FIXME: does Sparc64 have this register? */
+ if ((regno == -1) || (regno == FPS_REGNUM))
+ {
+ from = (char *)&registers[REGISTER_BYTE (FPS_REGNUM)];
+ to = (char *) &fpregsetp->pr_fsr;
+ memcpy (to, from, REGISTER_RAW_SIZE (FPS_REGNUM));
+ }
+}
+
+#endif /* USE_PROC_FS */
+
+/* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test
+ for a definition of JB_PC. */
+#ifdef JB_PC
+
+/* Figure out where the longjmp will land. 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. %o0 (O0_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 (CORE_ADDR *pc)
+{
+ CORE_ADDR jb_addr;
+#define LONGJMP_TARGET_SIZE 4
+ char buf[LONGJMP_TARGET_SIZE];
+
+ jb_addr = read_register (O0_REGNUM);
+
+ if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
+ LONGJMP_TARGET_SIZE))
+ return 0;
+
+ *pc = extract_address (buf, LONGJMP_TARGET_SIZE);
+
+ return 1;
+}
+#endif /* GET_LONGJMP_TARGET */
+
+#ifdef STATIC_TRANSFORM_NAME
+/* SunPRO (3.0 at least), encodes the static variables. This is not
+ related to C++ mangling, it is done for C too. */
+
+char *
+sunpro_static_transform_name (char *name)
+{
+ char *p;
+ 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. */
+ p = strrchr (name, '.');
+ if (p != NULL)
+ name = p + 1;
+ }
+ return name;
+}
+#endif /* STATIC_TRANSFORM_NAME */
+
+
+/* Utilities for printing registers.
+ Page numbers refer to the SPARC Architecture Manual. */
+
+static void dump_ccreg (char *, int);
+
+static void
+dump_ccreg (char *reg, int 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");
+}
+
+static char *
+decode_asi (int 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;
+ }
+}
+
+/* PRINT_REGISTER_HOOK routine.
+ Pretty print various registers. */
+/* FIXME: Would be nice if this did some fancy things for 32 bit sparc. */
+
+void
+sparc_print_register_hook (int regno)
+{
+ ULONGEST val;
+
+ /* Handle double/quad versions of lower 32 fp regs. */
+ if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32
+ && (regno & 1) == 0)
+ {
+ char value[16];
+
+ if (!read_relative_register_raw_bytes (regno, value)
+ && !read_relative_register_raw_bytes (regno + 1, value + 4))
+ {
+ printf_unfiltered ("\t");
+ print_floating (value, builtin_type_double, gdb_stdout);
+ }
+#if 0 /* FIXME: gdb doesn't handle long doubles */
+ if ((regno & 3) == 0)
+ {
+ if (!read_relative_register_raw_bytes (regno + 2, value + 8)
+ && !read_relative_register_raw_bytes (regno + 3, value + 12))
+ {
+ printf_unfiltered ("\t");
+ print_floating (value, builtin_type_long_double, gdb_stdout);
+ }
+ }
+#endif
+ return;
+ }
+
+#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. */
+ && (regno & 1) == 0)
+ {
+ char value[16];
+
+ if (!read_relative_register_raw_bytes (regno, value)
+ && !read_relative_register_raw_bytes (regno + 1, value + 8))
+ {
+ printf_unfiltered ("\t");
+ print_floating (value, builtin_type_long_double, gdb_stdout);
+ }
+ return;
+ }
+#endif
+
+ /* FIXME: Some of these are priviledged registers.
+ Not sure how they should be handled. */
+
+#define BITS(n, mask) ((int) (((val) >> (n)) & (mask)))
+
+ val = read_register (regno);
+
+ /* pages 40 - 60 */
+ if (GDB_TARGET_IS_SPARC64)
+ switch (regno)
+ {
+ case CCR_REGNUM:
+ printf_unfiltered ("\t");
+ dump_ccreg ("xcc", val >> 4);
+ printf_unfiltered (", ");
+ dump_ccreg ("icc", val & 15);
+ break;
+ case FPRS_REGNUM:
+ printf ("\tfef:%d, du:%d, dl:%d",
+ BITS (2, 1), BITS (1, 1), BITS (0, 1));
+ break;
+ case FSR_REGNUM:
+ {
+ static char *fcc[4] =
+ {"=", "<", ">", "?"};
+ static char *rd[4] =
+ {"N", "0", "+", "-"};
+ /* Long, but I'd rather leave it as is and use a wide screen. */
+ printf_filtered ("\t0:%s, 1:%s, 2:%s, 3:%s, rd:%s, tem:%d, ",
+ fcc[BITS (10, 3)], fcc[BITS (32, 3)],
+ fcc[BITS (34, 3)], fcc[BITS (36, 3)],
+ rd[BITS (30, 3)], BITS (23, 31));
+ printf_filtered ("ns:%d, ver:%d, ftt:%d, qne:%d, aexc:%d, cexc:%d",
+ BITS (22, 1), BITS (17, 7), BITS (14, 7),
+ BITS (13, 1), BITS (5, 31), BITS (0, 31));
+ break;
+ }
+ case ASI_REGNUM:
+ {
+ char *asi = decode_asi (val);
+ if (asi != NULL)
+ printf ("\t%s", asi);
+ break;
+ }
+ 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:
+ {
+ static char *mm[4] =
+ {"tso", "pso", "rso", "?"};
+ printf_filtered ("\tcle:%d, tle:%d, mm:%s, red:%d, ",
+ BITS (9, 1), BITS (8, 1),
+ mm[BITS (6, 3)], BITS (5, 1));
+ printf_filtered ("pef:%d, am:%d, priv:%d, ie:%d, ag:%d",
+ BITS (4, 1), BITS (3, 1), BITS (2, 1),
+ BITS (1, 1), BITS (0, 1));
+ break;
+ }
+ case TSTATE_REGNUM:
+ /* FIXME: print all 4? */
+ break;
+ case TT_REGNUM:
+ /* FIXME: print all 4? */
+ break;
+ case TPC_REGNUM:
+ /* FIXME: print all 4? */
+ break;
+ case TNPC_REGNUM:
+ /* FIXME: print all 4? */
+ break;
+ case WSTATE_REGNUM:
+ printf ("\tother:%d, normal:%d", BITS (3, 7), BITS (0, 7));
+ break;
+ case CWP_REGNUM:
+ printf ("\t%d", BITS (0, 31));
+ break;
+ case CANSAVE_REGNUM:
+ printf ("\t%-2d before spill", BITS (0, 31));
+ break;
+ case CANRESTORE_REGNUM:
+ printf ("\t%-2d before fill", BITS (0, 31));
+ break;
+ case CLEANWIN_REGNUM:
+ printf ("\t%-2d before clean", BITS (0, 31));
+ break;
+ case OTHERWIN_REGNUM:
+ printf ("\t%d", BITS (0, 31));
+ break;
+ }
+ else /* Sparc32 */
+ switch (regno)
+ {
+ case PS_REGNUM:
+ printf ("\ticc:%c%c%c%c, pil:%d, s:%d, ps:%d, et:%d, cwp:%d",
+ BITS (23, 1) ? 'N' : '-', BITS (22, 1) ? 'Z' : '-',
+ BITS (21, 1) ? 'V' : '-', BITS (20, 1) ? 'C' : '-',
+ BITS (8, 15), BITS (7, 1), BITS (6, 1), BITS (5, 1),
+ BITS (0, 31));
+ break;
+ case FPS_REGNUM:
+ {
+ static char *fcc[4] =
+ {"=", "<", ">", "?"};
+ static char *rd[4] =
+ {"N", "0", "+", "-"};
+ /* Long, 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",
+ rd[BITS (30, 3)], BITS (23, 31), BITS (22, 1), BITS (17, 7),
+ BITS (14, 7), BITS (13, 1), fcc[BITS (10, 3)], BITS (5, 31),
+ BITS (0, 31));
+ break;
+ }
+ }
+
+#undef BITS
+}
+
+int
+gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
+{
+ /* It's necessary to override mach again because print_insn messes it up. */
+ info->mach = TARGET_ARCHITECTURE->mach;
+ return print_insn_sparc (memaddr, info);
+}
+
+/* The SPARC passes the arguments on the stack; arguments smaller
+ than an int are promoted to an int. The first 6 words worth of
+ args are also passed in registers o0 - o5. */
+
+CORE_ADDR
+sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int i, j, oregnum;
+ int accumulate_size = 0;
+ struct sparc_arg
+ {
+ char *contents;
+ int len;
+ int offset;
+ };
+ struct sparc_arg *sparc_args =
+ (struct sparc_arg *) alloca (nargs * sizeof (struct sparc_arg));
+ struct sparc_arg *m_arg;
+
+ /* Promote arguments if necessary, and calculate their stack offsets
+ and sizes. */
+ for (i = 0, m_arg = sparc_args; i < nargs; i++, m_arg++)
+ {
+ struct value *arg = args[i];
+ struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ /* Cast argument to long if necessary as the compiler does it too. */
+ switch (TYPE_CODE (arg_type))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_ENUM:
+ if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
+ {
+ arg_type = builtin_type_long;
+ arg = value_cast (arg_type, arg);
+ }
+ break;
+ default:
+ break;
+ }
+ 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);
+ }
+
+ /* Make room for the arguments on the stack. */
+ accumulate_size += CALL_DUMMY_STACK_ADJUST;
+ sp = ((sp - accumulate_size) & ~7) + CALL_DUMMY_STACK_ADJUST;
+
+ /* `Push' arguments on the stack. */
+ for (i = 0, oregnum = 0, m_arg = sparc_args;
+ i < nargs;
+ i++, m_arg++)
+ {
+ write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len);
+ for (j = 0;
+ j < m_arg->len && oregnum < 6;
+ j += SPARC_INTREG_SIZE, oregnum++)
+ write_register_gen (O0_REGNUM + oregnum, m_arg->contents + j);
+ }
+
+ return sp;
+}
+
+
+/* Extract from an array REGBUF containing the (raw) register state
+ a function return value of type TYPE, and copy that, in virtual format,
+ into VALBUF. */
+
+void
+sparc32_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ int typelen = TYPE_LENGTH (type);
+ 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);
+ else
+ memcpy (valbuf,
+ &regbuf[O0_REGNUM * regsize +
+ (typelen >= regsize
+ || TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE ? 0
+ : regsize - typelen)],
+ typelen);
+}
+
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. On SPARCs with FPUs,
+ float values are returned in %f0 (and %f1). In all other cases,
+ values are returned in register %o0. */
+
+void
+sparc_store_return_value (struct type *type, char *valbuf)
+{
+ int regno;
+ char *buffer;
+
+ buffer = alloca (MAX_REGISTER_RAW_SIZE);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
+ /* Floating-point values are returned in the register pair */
+ /* formed by %f0 and %f1 (doubles are, anyway). */
+ regno = FP0_REGNUM;
+ else
+ /* Other values are returned in register %o0. */
+ regno = O0_REGNUM;
+
+ /* Add leading zeros to the value. */
+ if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (regno))
+ {
+ memset (buffer, 0, REGISTER_RAW_SIZE (regno));
+ memcpy (buffer + REGISTER_RAW_SIZE (regno) - TYPE_LENGTH (type), valbuf,
+ TYPE_LENGTH (type));
+ write_register_gen (regno, buffer);
+ }
+ else
+ write_register_bytes (REGISTER_BYTE (regno), valbuf, TYPE_LENGTH (type));
+}
+
+extern void
+sparclet_store_return_value (struct type *type, char *valbuf)
+{
+ /* Other values are returned in register %o0. */
+ write_register_bytes (REGISTER_BYTE (O0_REGNUM), valbuf,
+ TYPE_LENGTH (type));
+}
+
+
+#ifndef CALL_DUMMY_CALL_OFFSET
+#define CALL_DUMMY_CALL_OFFSET \
+ (gdbarch_tdep (current_gdbarch)->call_dummy_call_offset)
+#endif /* CALL_DUMMY_CALL_OFFSET */
+
+/* Insert the function address into a call dummy instruction sequence
+ stored at DUMMY.
+
+ For structs and unions, if the function was compiled with Sun cc,
+ it expects 'unimp' after the call. But gcc doesn't use that
+ (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
+ can assume it is operating on a pristine CALL_DUMMY, not one that
+ has already been customized for a different function). */
+
+void
+sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
+ struct type *value_type, int using_gcc)
+{
+ int i;
+
+ /* Store the relative adddress of the target function into the
+ 'call' instruction. */
+ store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET, 4,
+ (0x40000000
+ | (((fun - (pc + CALL_DUMMY_CALL_OFFSET)) >> 2)
+ & 0x3fffffff)));
+
+ /* If the called function returns an aggregate value, fill in the UNIMP
+ instruction containing the size of the returned aggregate return value,
+ which follows the call instruction.
+ For details see the SPARC Architecture Manual Version 8, Appendix D.3.
+
+ Adjust the call_dummy_breakpoint_offset for the bp_call_dummy breakpoint
+ to the proper address in the call dummy, so that `finish' after a stop
+ in a call dummy works.
+ Tweeking current_gdbarch is not an optimal solution, but the call to
+ sparc_fix_call_dummy is immediately followed by a call to run_stack_dummy,
+ which is the only function where dummy_breakpoint_offset is actually
+ used, if it is non-zero. */
+ if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (value_type) == TYPE_CODE_UNION)
+ {
+ store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4,
+ TYPE_LENGTH (value_type) & 0x1fff);
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x30);
+ }
+ else
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x2c);
+
+ if (!(GDB_TARGET_IS_SPARC64))
+ {
+ /* If this is not a simulator target, change the first four
+ instructions of the call dummy to NOPs. Those instructions
+ include a 'save' instruction and are designed to work around
+ problems with register window flushing in the simulator. */
+
+ if (strcmp (target_shortname, "sim") != 0)
+ {
+ for (i = 0; i < 4; i++)
+ store_unsigned_integer (dummy + (i * 4), 4, 0x01000000);
+ }
+ }
+
+ /* If this is a bi-endian target, GDB has written the call dummy
+ in little-endian order. We must byte-swap it back to big-endian. */
+ if (bi_endian)
+ {
+ 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;
+ }
+ }
+}
+
+
+/* Set target byte order based on machine type. */
+
+static int
+sparc_target_architecture_hook (const bfd_arch_info_type *ap)
+{
+ int i, j;
+
+ if (ap->mach == bfd_mach_sparc_sparclite_le)
+ {
+ target_byte_order = BFD_ENDIAN_LITTLE;
+ bi_endian = 1;
+ }
+ else
+ bi_endian = 0;
+ return 1;
+}
+
+
+/*
+ * Module "constructor" function.
+ */
+
+static struct gdbarch * sparc_gdbarch_init (struct gdbarch_info info,
+ struct gdbarch_list *arches);
+
+void
+_initialize_sparc_tdep (void)
+{
+ /* Hook us into the gdbarch mechanism. */
+ register_gdbarch_init (bfd_arch_sparc, sparc_gdbarch_init);
+
+ tm_print_insn = gdb_print_insn_sparc;
+ tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
+ target_architecture_hook = sparc_target_architecture_hook;
+}
+
+/* Compensate for stack bias. Note that we currently don't handle
+ mixed 32/64 bit code. */
+
+CORE_ADDR
+sparc64_read_sp (void)
+{
+ CORE_ADDR sp = read_register (SP_REGNUM);
+
+ if (sp & 1)
+ sp += 2047;
+ return sp;
+}
+
+CORE_ADDR
+sparc64_read_fp (void)
+{
+ CORE_ADDR fp = read_register (FP_REGNUM);
+
+ if (fp & 1)
+ fp += 2047;
+ return fp;
+}
+
+void
+sparc64_write_sp (CORE_ADDR val)
+{
+ CORE_ADDR oldsp = read_register (SP_REGNUM);
+ if (oldsp & 1)
+ write_register (SP_REGNUM, val - 2047);
+ else
+ write_register (SP_REGNUM, val);
+}
+
+void
+sparc64_write_fp (CORE_ADDR val)
+{
+ CORE_ADDR oldfp = read_register (FP_REGNUM);
+ if (oldfp & 1)
+ write_register (FP_REGNUM, val - 2047);
+ else
+ write_register (FP_REGNUM, val);
+}
+
+/* The SPARC 64 ABI passes floating-point arguments in FP0 to FP31,
+ and all other arguments in O0 to O5. They are also copied onto
+ the stack in the correct places. Apparently (empirically),
+ structs of less than 16 bytes are passed member-by-member in
+ separate registers, but I am unable to figure out the algorithm.
+ Some members go in floating point regs, but I don't know which.
+
+ FIXME: Handle small structs (less than 16 bytes containing floats).
+
+ The counting regimen for using both integer and FP registers
+ for argument passing is rather odd -- a single counter is used
+ for both; this means that if the arguments alternate between
+ int and float, we will waste every other register of both types. */
+
+CORE_ADDR
+sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_retaddr)
+{
+ int i, j, register_counter = 0;
+ CORE_ADDR tempsp;
+ struct type *sparc_intreg_type =
+ TYPE_LENGTH (builtin_type_long) == SPARC_INTREG_SIZE ?
+ builtin_type_long : builtin_type_long_long;
+
+ sp = (sp & ~(((unsigned long) SPARC_INTREG_SIZE) - 1UL));
+
+ /* Figure out how much space we'll need. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ int len = TYPE_LENGTH (check_typedef (VALUE_TYPE (args[i])));
+ struct value *copyarg = args[i];
+ int copylen = len;
+
+ if (copylen < SPARC_INTREG_SIZE)
+ {
+ copyarg = value_cast (sparc_intreg_type, copyarg);
+ copylen = SPARC_INTREG_SIZE;
+ }
+ sp -= copylen;
+ }
+
+ /* Round down. */
+ sp = sp & ~7;
+ tempsp = sp;
+
+ /* if STRUCT_RETURN, then first argument is the struct return location. */
+ if (struct_return)
+ write_register (O0_REGNUM + register_counter++, struct_retaddr);
+
+ /* Now write the arguments onto the stack, while writing FP
+ arguments into the FP registers, and other arguments into the
+ first six 'O' registers. */
+
+ for (i = 0; i < nargs; i++)
+ {
+ int len = TYPE_LENGTH (check_typedef (VALUE_TYPE (args[i])));
+ struct value *copyarg = args[i];
+ enum type_code typecode = TYPE_CODE (VALUE_TYPE (args[i]));
+ int copylen = len;
+
+ if (typecode == TYPE_CODE_INT ||
+ typecode == TYPE_CODE_BOOL ||
+ typecode == TYPE_CODE_CHAR ||
+ typecode == TYPE_CODE_RANGE ||
+ typecode == TYPE_CODE_ENUM)
+ if (len < SPARC_INTREG_SIZE)
+ {
+ /* Small ints will all take up the size of one intreg on
+ the stack. */
+ copyarg = value_cast (sparc_intreg_type, copyarg);
+ copylen = SPARC_INTREG_SIZE;
+ }
+
+ write_memory (tempsp, VALUE_CONTENTS (copyarg), copylen);
+ tempsp += copylen;
+
+ /* Corner case: Structs consisting of a single float member are floats.
+ * FIXME! I don't know about structs containing multiple floats!
+ * Structs containing mixed floats and ints are even more weird.
+ */
+
+
+
+ /* Separate float args from all other args. */
+ if (typecode == TYPE_CODE_FLT && SPARC_HAS_FPU)
+ {
+ if (register_counter < 16)
+ {
+ /* This arg gets copied into a FP register. */
+ int fpreg;
+
+ switch (len) {
+ case 4: /* Single-precision (float) */
+ fpreg = FP0_REGNUM + 2 * register_counter + 1;
+ register_counter += 1;
+ break;
+ case 8: /* Double-precision (double) */
+ fpreg = FP0_REGNUM + 2 * register_counter;
+ register_counter += 1;
+ break;
+ case 16: /* Quad-precision (long double) */
+ fpreg = FP0_REGNUM + 2 * register_counter;
+ register_counter += 2;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ write_register_bytes (REGISTER_BYTE (fpreg),
+ VALUE_CONTENTS (args[i]),
+ len);
+ }
+ }
+ else /* all other args go into the first six 'o' registers */
+ {
+ for (j = 0;
+ j < len && register_counter < 6;
+ j += SPARC_INTREG_SIZE)
+ {
+ int oreg = O0_REGNUM + register_counter;
+
+ write_register_gen (oreg, VALUE_CONTENTS (copyarg) + j);
+ register_counter += 1;
+ }
+ }
+ }
+ return sp;
+}
+
+/* Values <= 32 bytes are returned in o0-o3 (floating-point values are
+ returned in f0-f3). */
+
+void
+sp64_extract_return_value (struct type *type, char *regbuf, char *valbuf,
+ int bitoffset)
+{
+ int typelen = TYPE_LENGTH (type);
+ 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);
+ return;
+ }
+
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+ || (TYPE_LENGTH (type) > 32))
+ {
+ memcpy (valbuf,
+ &regbuf[O0_REGNUM * regsize +
+ (typelen >= regsize ? 0 : regsize - typelen)],
+ typelen);
+ return;
+ }
+ else
+ {
+ char *o0 = &regbuf[O0_REGNUM * regsize];
+ char *f0 = &regbuf[FP0_REGNUM * regsize];
+ int x;
+
+ for (x = 0; x < TYPE_NFIELDS (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;
+ int where = (f->loc.bitpos + bitoffset) / 8;
+ int size = TYPE_LENGTH (f->type);
+ int typecode = TYPE_CODE (f->type);
+
+ if (typecode == TYPE_CODE_STRUCT)
+ {
+ sp64_extract_return_value (f->type,
+ regbuf,
+ valbuf,
+ bitoffset + f->loc.bitpos);
+ }
+ else if (typecode == TYPE_CODE_FLT && SPARC_HAS_FPU)
+ {
+ memcpy (valbuf + where, &f0[whichreg * 4] + remainder, size);
+ }
+ else
+ {
+ memcpy (valbuf + where, &o0[whichreg * 4] + remainder, size);
+ }
+ }
+ }
+}
+
+extern void
+sparc64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ sp64_extract_return_value (type, regbuf, valbuf, 0);
+}
+
+extern void
+sparclet_extract_return_value (struct type *type,
+ char *regbuf,
+ char *valbuf)
+{
+ regbuf += REGISTER_RAW_SIZE (O0_REGNUM) * 8;
+ if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (O0_REGNUM))
+ regbuf += REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH (type);
+
+ memcpy ((void *) valbuf, regbuf, TYPE_LENGTH (type));
+}
+
+
+extern CORE_ADDR
+sparc32_stack_align (CORE_ADDR addr)
+{
+ return ((addr + 7) & -8);
+}
+
+extern CORE_ADDR
+sparc64_stack_align (CORE_ADDR addr)
+{
+ return ((addr + 15) & -16);
+}
+
+extern void
+sparc_print_extra_frame_info (struct frame_info *fi)
+{
+ if (fi && fi->extra_info && fi->extra_info->flat)
+ printf_filtered (" flat, pc saved at 0x%s, fp saved at 0x%s\n",
+ paddr_nz (fi->extra_info->pc_addr),
+ paddr_nz (fi->extra_info->fp_addr));
+}
+
+/* MULTI_ARCH support */
+
+static char *
+sparc32_register_name (int regno)
+{
+ static char *register_names[] =
+ { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
+ "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
+ "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
+
+ "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",
+
+ "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr"
+ };
+
+ if (regno < 0 ||
+ regno >= (sizeof (register_names) / sizeof (register_names[0])))
+ return NULL;
+ else
+ return register_names[regno];
+}
+
+static char *
+sparc64_register_name (int regno)
+{
+ static char *register_names[] =
+ { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
+ "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
+ "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
+
+ "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",
+ "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46",
+ "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62",
+
+ "pc", "npc", "ccr", "fsr", "fprs", "y", "asi", "ver",
+ "tick", "pil", "pstate", "tstate", "tba", "tl", "tt", "tpc",
+ "tnpc", "wstate", "cwp", "cansave", "canrestore", "cleanwin", "otherwin",
+ "asr16", "asr17", "asr18", "asr19", "asr20", "asr21", "asr22", "asr23",
+ "asr24", "asr25", "asr26", "asr27", "asr28", "asr29", "asr30", "asr31",
+ /* These are here at the end to simplify removing them if we have to. */
+ "icc", "xcc", "fcc0", "fcc1", "fcc2", "fcc3"
+ };
+
+ if (regno < 0 ||
+ regno >= (sizeof (register_names) / sizeof (register_names[0])))
+ return NULL;
+ else
+ return register_names[regno];
+}
+
+static char *
+sparclite_register_name (int regno)
+{
+ static char *register_names[] =
+ { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
+ "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
+ "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
+
+ "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",
+
+ "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr",
+ "dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr"
+ };
+
+ if (regno < 0 ||
+ regno >= (sizeof (register_names) / sizeof (register_names[0])))
+ return NULL;
+ else
+ return register_names[regno];
+}
+
+static char *
+sparclet_register_name (int regno)
+{
+ static char *register_names[] =
+ { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
+ "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
+ "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7",
+
+ "", "", "", "", "", "", "", "", /* no floating point registers */
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+
+ "y", "psr", "wim", "tbr", "pc", "npc", "", "", /* no FPSR or CPSR */
+ "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
+
+ /* ASR15 ASR19 (don't display them) */
+ "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22"
+ /* None of the rest get displayed */
+#if 0
+ "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
+ "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
+ "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
+ "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
+ "apsr"
+#endif /* 0 */
+ };
+
+ if (regno < 0 ||
+ regno >= (sizeof (register_names) / sizeof (register_names[0])))
+ return NULL;
+ else
+ return register_names[regno];
+}
+
+CORE_ADDR
+sparc_push_return_address (CORE_ADDR pc_unused, CORE_ADDR sp)
+{
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ /* The return PC of the dummy_frame is the former 'current' PC
+ (where we were before we made the target function call).
+ This is saved in %i7 by push_dummy_frame.
+
+ We will save the 'call dummy location' (ie. the address
+ to which the target function will return) in %o7.
+ This address will actually be the program's entry point.
+ There will be a special call_dummy breakpoint there. */
+
+ write_register (O7_REGNUM,
+ CALL_DUMMY_ADDRESS () - 8);
+ }
+
+ return sp;
+}
+
+/* Should call_function allocate stack space for a struct return? */
+
+static int
+sparc64_use_struct_convention (int gcc_p, struct type *type)
+{
+ return (TYPE_LENGTH (type) > 32);
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function_by_hand.
+ The ultimate mystery is, tho, what is the value "16"?
+
+ MVS: That's the offset from where the sp is now, to where the
+ subroutine is gonna expect to find the struct return address. */
+
+static void
+sparc32_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ char *val;
+ CORE_ADDR o7;
+
+ val = alloca (SPARC_INTREG_SIZE);
+ store_unsigned_integer (val, SPARC_INTREG_SIZE, addr);
+ write_memory (sp + (16 * SPARC_INTREG_SIZE), val, SPARC_INTREG_SIZE);
+
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ /* Now adjust the value of the link register, which was previously
+ stored by push_return_address. Functions that return structs are
+ peculiar in that they return to link register + 12, rather than
+ link register + 8. */
+
+ o7 = read_register (O7_REGNUM);
+ write_register (O7_REGNUM, o7 - 4);
+ }
+}
+
+static void
+sparc64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ /* FIXME: V9 uses %o0 for this. */
+ /* FIXME MVS: Only for small enough structs!!! */
+
+ target_write_memory (sp + (16 * SPARC_INTREG_SIZE),
+ (char *) &addr, SPARC_INTREG_SIZE);
+#if 0
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ /* Now adjust the value of the link register, which was previously
+ stored by push_return_address. Functions that return structs are
+ peculiar in that they return to link register + 12, rather than
+ link register + 8. */
+
+ write_register (O7_REGNUM, read_register (O7_REGNUM) - 4);
+ }
+#endif
+}
+
+/* Default target data type for register REGNO. */
+
+static struct type *
+sparc32_register_virtual_type (int regno)
+{
+ if (regno == PC_REGNUM ||
+ regno == FP_REGNUM ||
+ regno == SP_REGNUM)
+ return builtin_type_unsigned_int;
+ if (regno < 32)
+ return builtin_type_int;
+ if (regno < 64)
+ return builtin_type_float;
+ return builtin_type_int;
+}
+
+static struct type *
+sparc64_register_virtual_type (int regno)
+{
+ if (regno == PC_REGNUM ||
+ regno == FP_REGNUM ||
+ regno == SP_REGNUM)
+ return builtin_type_unsigned_long_long;
+ if (regno < 32)
+ return builtin_type_long_long;
+ if (regno < 64)
+ return builtin_type_float;
+ if (regno < 80)
+ return builtin_type_double;
+ return builtin_type_long_long;
+}
+
+/* Number of bytes of storage in the actual machine representation for
+ register REGNO. */
+
+static int
+sparc32_register_size (int regno)
+{
+ return 4;
+}
+
+static int
+sparc64_register_size (int regno)
+{
+ return (regno < 32 ? 8 : regno < 64 ? 4 : 8);
+}
+
+/* Index within the `registers' buffer of the first byte of the space
+ for register REGNO. */
+
+static int
+sparc32_register_byte (int regno)
+{
+ return (regno * 4);
+}
+
+static int
+sparc64_register_byte (int regno)
+{
+ if (regno < 32)
+ return regno * 8;
+ else if (regno < 64)
+ return 32 * 8 + (regno - 32) * 4;
+ else if (regno < 80)
+ return 32 * 8 + 32 * 4 + (regno - 64) * 8;
+ else
+ return 64 * 8 + (regno - 80) * 8;
+}
+
+/* Advance PC across any function entry prologue instructions to reach
+ some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances the PC past
+ some of the prologue, but stops as soon as it knows that the
+ function has a frame. Its result is equal to its input PC if the
+ function is frameless, unequal otherwise. */
+
+static CORE_ADDR
+sparc_gdbarch_skip_prologue (CORE_ADDR ip)
+{
+ return examine_prologue (ip, 0, NULL, NULL);
+}
+
+/* Immediately after a function call, return the saved pc.
+ Can't go through the frames for this because on some machines
+ the new frame is not set up until the new function executes
+ some instructions. */
+
+static CORE_ADDR
+sparc_saved_pc_after_call (struct frame_info *fi)
+{
+ return sparc_pc_adjust (read_register (RP_REGNUM));
+}
+
+/* Convert registers between 'raw' and 'virtual' formats.
+ They are the same on sparc, so there's nothing to do. */
+
+static void
+sparc_convert_to_virtual (int regnum, struct type *type, char *from, char *to)
+{ /* do nothing (should never be called) */
+}
+
+static void
+sparc_convert_to_raw (struct type *type, int regnum, char *from, char *to)
+{ /* do nothing (should never be called) */
+}
+
+/* Init saved regs: nothing to do, just a place-holder function. */
+
+static void
+sparc_frame_init_saved_regs (struct frame_info *fi_ignored)
+{ /* no-op */
+}
+
+/* gdbarch fix call dummy:
+ All this function does is rearrange the arguments before calling
+ sparc_fix_call_dummy (which does the real work). */
+
+static void
+sparc_gdbarch_fix_call_dummy (char *dummy,
+ CORE_ADDR pc,
+ CORE_ADDR fun,
+ int nargs,
+ struct value **args,
+ struct type *type,
+ int gcc_p)
+{
+ if (CALL_DUMMY_LOCATION == ON_STACK)
+ sparc_fix_call_dummy (dummy, pc, fun, type, gcc_p);
+}
+
+/* Coerce float to double: a no-op. */
+
+static int
+sparc_coerce_float_to_double (struct type *formal, struct type *actual)
+{
+ return 1;
+}
+
+/* CALL_DUMMY_ADDRESS: fetch the breakpoint address for a call dummy. */
+
+static CORE_ADDR
+sparc_call_dummy_address (void)
+{
+ return (CALL_DUMMY_START_OFFSET) + CALL_DUMMY_BREAKPOINT_OFFSET;
+}
+
+/* Supply the Y register number to those that need it. */
+
+int
+sparc_y_regnum (void)
+{
+ return gdbarch_tdep (current_gdbarch)->y_regnum;
+}
+
+int
+sparc_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ if (GDB_TARGET_IS_SPARC64)
+ return (TYPE_LENGTH (type) > 32);
+ else
+ return (gcc_p != 1);
+}
+
+int
+sparc_intreg_size (void)
+{
+ return SPARC_INTREG_SIZE;
+}
+
+static int
+sparc_return_value_on_stack (struct type *type)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_FLT &&
+ TYPE_LENGTH (type) > 8)
+ return 1;
+ else
+ return 0;
+}
+
+/*
+ * Gdbarch "constructor" function.
+ */
+
+#define SPARC32_CALL_DUMMY_ON_STACK
+
+#define SPARC_SP_REGNUM 14
+#define SPARC_FP_REGNUM 30
+#define SPARC_FP0_REGNUM 32
+#define SPARC32_NPC_REGNUM 69
+#define SPARC32_PC_REGNUM 68
+#define SPARC32_Y_REGNUM 64
+#define SPARC64_PC_REGNUM 80
+#define SPARC64_NPC_REGNUM 81
+#define SPARC64_Y_REGNUM 85
+
+static struct gdbarch *
+sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
+
+ static LONGEST call_dummy_32[] =
+ { 0xbc100001, 0x9de38000, 0xbc100002, 0xbe100003,
+ 0xda03a058, 0xd803a054, 0xd603a050, 0xd403a04c,
+ 0xd203a048, 0x40000000, 0xd003a044, 0x01000000,
+ 0x91d02001, 0x01000000
+ };
+ static LONGEST call_dummy_64[] =
+ { 0x9de3bec0fd3fa7f7LL, 0xf93fa7eff53fa7e7LL,
+ 0xf13fa7dfed3fa7d7LL, 0xe93fa7cfe53fa7c7LL,
+ 0xe13fa7bfdd3fa7b7LL, 0xd93fa7afd53fa7a7LL,
+ 0xd13fa79fcd3fa797LL, 0xc93fa78fc53fa787LL,
+ 0xc13fa77fcc3fa777LL, 0xc83fa76fc43fa767LL,
+ 0xc03fa75ffc3fa757LL, 0xf83fa74ff43fa747LL,
+ 0xf03fa73f01000000LL, 0x0100000001000000LL,
+ 0x0100000091580000LL, 0xd027a72b93500000LL,
+ 0xd027a72791480000LL, 0xd027a72391400000LL,
+ 0xd027a71fda5ba8a7LL, 0xd85ba89fd65ba897LL,
+ 0xd45ba88fd25ba887LL, 0x9fc02000d05ba87fLL,
+ 0x0100000091d02001LL, 0x0100000001000000LL
+ };
+ static LONGEST call_dummy_nil[] = {0};
+
+ /* First see if there is already a gdbarch that can satisfy the request. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return arches->gdbarch;
+
+ /* None found: is the request for a sparc architecture? */
+ if (info.bfd_arch_info->arch != bfd_arch_sparc)
+ return NULL; /* No; then it's not for us. */
+
+ /* Yes: create a new gdbarch for the specified machine type. */
+ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ /* First set settings that are common for all sparc architectures. */
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+ set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc);
+ set_gdbarch_coerce_float_to_double (gdbarch,
+ sparc_coerce_float_to_double);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 1);
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ sparc_extract_struct_value_address);
+ set_gdbarch_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
+ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM);
+ set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM);
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_chain (gdbarch, sparc_frame_chain);
+ set_gdbarch_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frame_saved_pc (gdbarch, sparc_frame_saved_pc);
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ frameless_look_for_prologue);
+ set_gdbarch_get_saved_register (gdbarch, sparc_get_saved_register);
+ set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info);
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
+ set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_pop_frame (gdbarch, sparc_pop_frame);
+ set_gdbarch_push_return_address (gdbarch, sparc_push_return_address);
+ set_gdbarch_push_dummy_frame (gdbarch, sparc_push_dummy_frame);
+ set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
+ set_gdbarch_register_convert_to_raw (gdbarch, sparc_convert_to_raw);
+ set_gdbarch_register_convert_to_virtual (gdbarch,
+ sparc_convert_to_virtual);
+ set_gdbarch_register_convertible (gdbarch,
+ generic_register_convertible_not);
+ set_gdbarch_reg_struct_has_addr (gdbarch, sparc_reg_struct_has_addr);
+ set_gdbarch_return_value_on_stack (gdbarch, sparc_return_value_on_stack);
+ set_gdbarch_saved_pc_after_call (gdbarch, sparc_saved_pc_after_call);
+ set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_skip_prologue (gdbarch, sparc_gdbarch_skip_prologue);
+ set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM);
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+ set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
+
+ /*
+ * Settings that depend only on 32/64 bit word size
+ */
+
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_sparc:
+ case bfd_mach_sparc_sparclet:
+ case bfd_mach_sparc_sparclite:
+ case bfd_mach_sparc_v8plus:
+ case bfd_mach_sparc_v8plusa:
+ case bfd_mach_sparc_sparclite_le:
+ /* 32-bit machine types: */
+
+#ifdef SPARC32_CALL_DUMMY_ON_STACK
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+ set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30);
+ set_gdbarch_call_dummy_length (gdbarch, 0x38);
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_32);
+#else
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
+#endif
+ set_gdbarch_call_dummy_stack_adjust (gdbarch, 68);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_frame_args_skip (gdbarch, 68);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_npc_regnum (gdbarch, SPARC32_NPC_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM);
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_push_arguments (gdbarch, sparc32_push_arguments);
+ set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
+ set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
+
+ set_gdbarch_register_byte (gdbarch, sparc32_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, sparc32_register_size);
+ set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_register_virtual_size (gdbarch, sparc32_register_size);
+ set_gdbarch_register_virtual_type (gdbarch,
+ sparc32_register_virtual_type);
+#ifdef SPARC32_CALL_DUMMY_ON_STACK
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32));
+#else
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+#endif
+ set_gdbarch_stack_align (gdbarch, sparc32_stack_align);
+ set_gdbarch_store_struct_return (gdbarch, sparc32_store_struct_return);
+ set_gdbarch_use_struct_convention (gdbarch,
+ generic_use_struct_convention);
+ set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
+ set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
+ tdep->y_regnum = SPARC32_Y_REGNUM;
+ tdep->fp_max_regnum = SPARC_FP0_REGNUM + 32;
+ tdep->intreg_size = 4;
+ tdep->reg_save_offset = 0x60;
+ tdep->call_dummy_call_offset = 0x24;
+ break;
+
+ case bfd_mach_sparc_v9:
+ case bfd_mach_sparc_v9a:
+ /* 64-bit machine types: */
+ default: /* Any new machine type is likely to be 64-bit. */
+
+#ifdef SPARC64_CALL_DUMMY_ON_STACK
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+ set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
+ set_gdbarch_call_dummy_length (gdbarch, 192);
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 148);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_64);
+#else
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
+#endif
+ set_gdbarch_call_dummy_stack_adjust (gdbarch, 128);
+ set_gdbarch_frame_args_skip (gdbarch, 136);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM);
+ set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_push_arguments (gdbarch, sparc64_push_arguments);
+ /* NOTE different for at_entry */
+ set_gdbarch_read_fp (gdbarch, sparc64_read_fp);
+ set_gdbarch_read_sp (gdbarch, sparc64_read_sp);
+ /* Some of the registers aren't 64 bits, but it's a lot simpler just
+ to assume they all are (since most of them are). */
+ set_gdbarch_register_byte (gdbarch, sparc64_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, sparc64_register_size);
+ set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_register_virtual_size (gdbarch, sparc64_register_size);
+ set_gdbarch_register_virtual_type (gdbarch,
+ sparc64_register_virtual_type);
+#ifdef SPARC64_CALL_DUMMY_ON_STACK
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64));
+#else
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+#endif
+ set_gdbarch_stack_align (gdbarch, sparc64_stack_align);
+ set_gdbarch_store_struct_return (gdbarch, sparc64_store_struct_return);
+ set_gdbarch_use_struct_convention (gdbarch,
+ sparc64_use_struct_convention);
+ set_gdbarch_write_fp (gdbarch, sparc64_write_fp);
+ set_gdbarch_write_sp (gdbarch, sparc64_write_sp);
+ tdep->y_regnum = SPARC64_Y_REGNUM;
+ tdep->fp_max_regnum = SPARC_FP0_REGNUM + 48;
+ tdep->intreg_size = 8;
+ tdep->reg_save_offset = 0x90;
+ tdep->call_dummy_call_offset = 148 + 4 * 5;
+ break;
+ }
+
+ /*
+ * Settings that vary per-architecture:
+ */
+
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_sparc:
+ set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 72);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparc32_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 32 * 4;
+ tdep->print_insn_mach = bfd_mach_sparc;
+ break;
+ case bfd_mach_sparc_sparclet:
+ set_gdbarch_extract_return_value (gdbarch,
+ sparclet_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparclet_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparclet_store_return_value);
+ tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 0;
+ tdep->print_insn_mach = bfd_mach_sparc_sparclet;
+ break;
+ case bfd_mach_sparc_sparclite:
+ set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 80);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparclite_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 0;
+ tdep->print_insn_mach = bfd_mach_sparc_sparclite;
+ break;
+ case bfd_mach_sparc_v8plus:
+ set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 72);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparc32_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->print_insn_mach = bfd_mach_sparc;
+ tdep->fp_register_bytes = 32 * 4;
+ tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
+ break;
+ case bfd_mach_sparc_v8plusa:
+ set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 72);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparc32_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 32 * 4;
+ tdep->print_insn_mach = bfd_mach_sparc;
+ break;
+ case bfd_mach_sparc_sparclite_le:
+ set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 80);
+ set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
+ set_gdbarch_register_name (gdbarch, sparclite_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 0;
+ tdep->print_insn_mach = bfd_mach_sparc_sparclite;
+ break;
+ case bfd_mach_sparc_v9:
+ set_gdbarch_extract_return_value (gdbarch, sparc64_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 125);
+ set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
+ set_gdbarch_register_name (gdbarch, sparc64_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 64 * 4;
+ tdep->print_insn_mach = bfd_mach_sparc_v9a;
+ break;
+ case bfd_mach_sparc_v9a:
+ set_gdbarch_extract_return_value (gdbarch, sparc64_extract_return_value);
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ set_gdbarch_num_regs (gdbarch, 125);
+ set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
+ set_gdbarch_register_name (gdbarch, sparc64_register_name);
+ set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
+ tdep->fp_register_bytes = 64 * 4;
+ tdep->print_insn_mach = bfd_mach_sparc_v9a;
+ break;
+ }
+
+ return gdbarch;
+}
+
diff --git a/contrib/gdb/gdb/sparcl-stub.c b/contrib/gdb/gdb/sparcl-stub.c
new file mode 100644
index 0000000..3fcdc0a
--- /dev/null
+++ b/contrib/gdb/gdb/sparcl-stub.c
@@ -0,0 +1,946 @@
+/****************************************************************************
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ HP offers the following for use in the public domain. HP makes no
+ warranty with regard to the software or it's performance and the
+ user accepts the software "AS IS" with all faults.
+
+ HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
+ TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+****************************************************************************/
+
+/****************************************************************************
+ * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ *
+ * Module name: remcom.c $
+ * Revision: 1.34 $
+ * Date: 91/03/09 12:29:49 $
+ * Contributor: Lake Stevens Instrument Division$
+ *
+ * Description: low level support for gdb debugger. $
+ *
+ * Considerations: only works on target hardware $
+ *
+ * Written by: Glenn Engel $
+ * ModuleState: Experimental $
+ *
+ * NOTES: See Below $
+ *
+ * Modified for SPARC by Stu Grossman, Cygnus Support.
+ * Based on sparc-stub.c, it's modified for SPARClite Debug Unit hardware
+ * breakpoint support to create sparclite-stub.c, by Kung Hsu, Cygnus Support.
+ *
+ * This code has been extensively tested on the Fujitsu SPARClite demo board.
+ *
+ * To enable debugger support, two things need to happen. One, a
+ * call to set_debug_traps() is necessary in order to allow any breakpoints
+ * or error conditions to be properly intercepted and reported to gdb.
+ * Two, a breakpoint needs to be generated to begin communication. This
+ * is most easily accomplished by a call to breakpoint(). Breakpoint()
+ * simulates a breakpoint by executing a trap #1.
+ *
+ *************
+ *
+ * The following gdb commands are supported:
+ *
+ * command function Return value
+ *
+ * g return the value of the CPU registers hex data or ENN
+ * G set the value of the CPU registers OK or ENN
+ * P set the value of a single CPU register OK or ENN
+ *
+ * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
+ * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
+ *
+ * c Resume at current address SNN ( signal NN)
+ * cAA..AA Continue at address AA..AA SNN
+ *
+ * s Step one instruction SNN
+ * sAA..AA Step one instruction from AA..AA SNN
+ *
+ * k kill
+ *
+ * ? What was the last sigval ? SNN (signal NN)
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum. A packet consists of
+ *
+ * $<packet info>#<checksum>.
+ *
+ * where
+ * <packet info> :: <characters representing the command or response>
+ * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
+ *
+ * When a packet is received, it is first acknowledged with either '+' or '-'.
+ * '+' indicates a successful transfer. '-' indicates a failed transfer.
+ *
+ * Example:
+ *
+ * Host: Reply:
+ * $m0,10#2a +$00010203040506070809101112131415#42
+ *
+ ****************************************************************************/
+
+#include <string.h>
+#include <signal.h>
+#include <sparclite.h>
+
+/************************************************************************
+ *
+ * external low-level support routines
+ */
+
+extern void putDebugChar (int c); /* write a single character */
+extern int getDebugChar (void); /* read and return a single char */
+
+/************************************************************************/
+/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
+/* at least NUMREGBYTES*2 are needed for register packets */
+#define BUFMAX 2048
+
+static int initialized = 0; /* !0 means we've been initialized */
+
+extern void breakinst ();
+static void set_mem_fault_trap (int enable);
+static void get_in_break_mode (void);
+
+static const char hexchars[]="0123456789abcdef";
+
+#define NUMREGS 80
+
+/* Number of bytes of registers. */
+#define NUMREGBYTES (NUMREGS * 4)
+enum regnames {G0, G1, G2, G3, G4, G5, G6, G7,
+ O0, O1, O2, O3, O4, O5, SP, O7,
+ L0, L1, L2, L3, L4, L5, L6, L7,
+ I0, I1, I2, I3, I4, I5, FP, I7,
+
+ 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,
+ Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR,
+ DIA1, DIA2, DDA1, DDA2, DDV1, DDV2, DCR, DSR };
+
+/*************************** ASSEMBLY CODE MACROS *************************/
+/* */
+
+extern void trap_low();
+
+/* Create private copies of common functions used by the stub. This prevents
+ nasty interactions between app code and the stub (for instance if user steps
+ into strlen, etc..) */
+
+static char *
+strcpy (char *dst, const char *src)
+{
+ char *retval = dst;
+
+ while ((*dst++ = *src++) != '\000');
+
+ return retval;
+}
+
+static void *
+memcpy (void *vdst, const void *vsrc, int n)
+{
+ char *dst = vdst;
+ const char *src = vsrc;
+ char *retval = dst;
+
+ while (n-- > 0)
+ *dst++ = *src++;
+
+ return retval;
+}
+
+asm("
+ .reserve trapstack, 1000 * 4, \"bss\", 8
+
+ .data
+ .align 4
+
+in_trap_handler:
+ .word 0
+
+ .text
+ .align 4
+
+! This function is called when any SPARC trap (except window overflow or
+! underflow) occurs. It makes sure that the invalid register window is still
+! available before jumping into C code. It will also restore the world if you
+! return from handle_exception.
+!
+! On entry, trap_low expects l1 and l2 to contain pc and npc respectivly.
+! Register usage throughout the routine is as follows:
+!
+! l0 - psr
+! l1 - pc
+! l2 - npc
+! l3 - wim
+! l4 - scratch and y reg
+! l5 - scratch and tbr
+! l6 - unused
+! l7 - unused
+
+ .globl _trap_low
+_trap_low:
+ mov %psr, %l0
+ mov %wim, %l3
+
+ srl %l3, %l0, %l4 ! wim >> cwp
+ cmp %l4, 1
+ bne window_fine ! Branch if not in the invalid window
+ nop
+
+! Handle window overflow
+
+ mov %g1, %l4 ! Save g1, we use it to hold the wim
+ srl %l3, 1, %g1 ! Rotate wim right
+ tst %g1
+ bg good_wim ! Branch if new wim is non-zero
+ nop
+
+! At this point, we need to bring a 1 into the high order bit of the wim.
+! Since we don't want to make any assumptions about the number of register
+! windows, we figure it out dynamically so as to setup the wim correctly.
+
+ not %g1 ! Fill g1 with ones
+ mov %g1, %wim ! Fill the wim with ones
+ nop
+ nop
+ nop
+ mov %wim, %g1 ! Read back the wim
+ inc %g1 ! Now g1 has 1 just to left of wim
+ srl %g1, 1, %g1 ! Now put 1 at top of wim
+ mov %g0, %wim ! Clear wim so that subsequent save
+ nop ! won't trap
+ nop
+ nop
+
+good_wim:
+ save %g0, %g0, %g0 ! Slip into next window
+ mov %g1, %wim ! Install the new wim
+
+ std %l0, [%sp + 0 * 4] ! save L & I registers
+ std %l2, [%sp + 2 * 4]
+ std %l4, [%sp + 4 * 4]
+ std %l6, [%sp + 6 * 4]
+
+ std %i0, [%sp + 8 * 4]
+ std %i2, [%sp + 10 * 4]
+ std %i4, [%sp + 12 * 4]
+ std %i6, [%sp + 14 * 4]
+
+ restore ! Go back to trap window.
+ mov %l4, %g1 ! Restore %g1
+
+window_fine:
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ tst %l5
+ bg recursive_trap
+ inc %l5
+
+ set trapstack+1000*4, %sp ! Switch to trap stack
+
+recursive_trap:
+ st %l5, [%lo(in_trap_handler) + %l4]
+ sub %sp,(16+1+6+1+80)*4,%sp ! Make room for input & locals
+ ! + hidden arg + arg spill
+ ! + doubleword alignment
+ ! + registers[72] local var
+
+ std %g0, [%sp + (24 + 0) * 4] ! registers[Gx]
+ std %g2, [%sp + (24 + 2) * 4]
+ std %g4, [%sp + (24 + 4) * 4]
+ std %g6, [%sp + (24 + 6) * 4]
+
+ std %i0, [%sp + (24 + 8) * 4] ! registers[Ox]
+ std %i2, [%sp + (24 + 10) * 4]
+ std %i4, [%sp + (24 + 12) * 4]
+ std %i6, [%sp + (24 + 14) * 4]
+
+ mov %y, %l4
+ mov %tbr, %l5
+ st %l4, [%sp + (24 + 64) * 4] ! Y
+ st %l0, [%sp + (24 + 65) * 4] ! PSR
+ st %l3, [%sp + (24 + 66) * 4] ! WIM
+ st %l5, [%sp + (24 + 67) * 4] ! TBR
+ st %l1, [%sp + (24 + 68) * 4] ! PC
+ st %l2, [%sp + (24 + 69) * 4] ! NPC
+
+ or %l0, 0xf20, %l4
+ mov %l4, %psr ! Turn on traps, disable interrupts
+
+ set 0x1000, %l1
+ btst %l1, %l0 ! FP enabled?
+ be no_fpstore
+ nop
+
+! Must save fsr first, to flush the FQ. This may cause a deferred fp trap, so
+! traps must be enabled to allow the trap handler to clean things up.
+
+ st %fsr, [%sp + (24 + 70) * 4]
+
+ std %f0, [%sp + (24 + 32) * 4]
+ std %f2, [%sp + (24 + 34) * 4]
+ std %f4, [%sp + (24 + 36) * 4]
+ std %f6, [%sp + (24 + 38) * 4]
+ std %f8, [%sp + (24 + 40) * 4]
+ std %f10, [%sp + (24 + 42) * 4]
+ std %f12, [%sp + (24 + 44) * 4]
+ std %f14, [%sp + (24 + 46) * 4]
+ std %f16, [%sp + (24 + 48) * 4]
+ std %f18, [%sp + (24 + 50) * 4]
+ std %f20, [%sp + (24 + 52) * 4]
+ std %f22, [%sp + (24 + 54) * 4]
+ std %f24, [%sp + (24 + 56) * 4]
+ std %f26, [%sp + (24 + 58) * 4]
+ std %f28, [%sp + (24 + 60) * 4]
+ std %f30, [%sp + (24 + 62) * 4]
+no_fpstore:
+
+ call _handle_exception
+ add %sp, 24 * 4, %o0 ! Pass address of registers
+
+! Reload all of the registers that aren't on the stack
+
+ ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx]
+ ldd [%sp + (24 + 2) * 4], %g2
+ ldd [%sp + (24 + 4) * 4], %g4
+ ldd [%sp + (24 + 6) * 4], %g6
+
+ ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox]
+ ldd [%sp + (24 + 10) * 4], %i2
+ ldd [%sp + (24 + 12) * 4], %i4
+ ldd [%sp + (24 + 14) * 4], %i6
+
+
+ ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR
+ ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC
+
+ set 0x1000, %l5
+ btst %l5, %l1 ! FP enabled?
+ be no_fpreload
+ nop
+
+ ldd [%sp + (24 + 32) * 4], %f0
+ ldd [%sp + (24 + 34) * 4], %f2
+ ldd [%sp + (24 + 36) * 4], %f4
+ ldd [%sp + (24 + 38) * 4], %f6
+ ldd [%sp + (24 + 40) * 4], %f8
+ ldd [%sp + (24 + 42) * 4], %f10
+ ldd [%sp + (24 + 44) * 4], %f12
+ ldd [%sp + (24 + 46) * 4], %f14
+ ldd [%sp + (24 + 48) * 4], %f16
+ ldd [%sp + (24 + 50) * 4], %f18
+ ldd [%sp + (24 + 52) * 4], %f20
+ ldd [%sp + (24 + 54) * 4], %f22
+ ldd [%sp + (24 + 56) * 4], %f24
+ ldd [%sp + (24 + 58) * 4], %f26
+ ldd [%sp + (24 + 60) * 4], %f28
+ ldd [%sp + (24 + 62) * 4], %f30
+
+ ld [%sp + (24 + 70) * 4], %fsr
+no_fpreload:
+
+ restore ! Ensure that previous window is valid
+ save %g0, %g0, %g0 ! by causing a window_underflow trap
+
+ mov %l0, %y
+ mov %l1, %psr ! Make sure that traps are disabled
+ ! for rett
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ dec %l5
+ st %l5, [%lo(in_trap_handler) + %l4]
+
+ jmpl %l2, %g0 ! Restore old PC
+ rett %l3 ! Restore old nPC
+");
+
+/* Convert ch from a hex digit to an int */
+
+static int
+hex (unsigned char ch)
+{
+ if (ch >= 'a' && ch <= 'f')
+ return ch-'a'+10;
+ if (ch >= '0' && ch <= '9')
+ return ch-'0';
+ if (ch >= 'A' && ch <= 'F')
+ return ch-'A'+10;
+ return -1;
+}
+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
+
+/* scan for the sequence $<data>#<checksum> */
+
+unsigned char *
+getpacket (void)
+{
+ unsigned char *buffer = &remcomInBuffer[0];
+ unsigned char checksum;
+ unsigned char xmitcsum;
+ int count;
+ char ch;
+
+ while (1)
+ {
+ /* wait around for the start character, ignore all other characters */
+ while ((ch = getDebugChar ()) != '$')
+ ;
+
+retry:
+ checksum = 0;
+ xmitcsum = -1;
+ count = 0;
+
+ /* now, read until a # or end of buffer is found */
+ while (count < BUFMAX)
+ {
+ ch = getDebugChar ();
+ if (ch == '$')
+ goto retry;
+ if (ch == '#')
+ break;
+ checksum = checksum + ch;
+ buffer[count] = ch;
+ count = count + 1;
+ }
+ buffer[count] = 0;
+
+ if (ch == '#')
+ {
+ ch = getDebugChar ();
+ xmitcsum = hex (ch) << 4;
+ ch = getDebugChar ();
+ xmitcsum += hex (ch);
+
+ if (checksum != xmitcsum)
+ {
+ putDebugChar ('-'); /* failed checksum */
+ }
+ else
+ {
+ putDebugChar ('+'); /* successful transfer */
+
+ /* if a sequence char is present, reply the sequence ID */
+ if (buffer[2] == ':')
+ {
+ putDebugChar (buffer[0]);
+ putDebugChar (buffer[1]);
+
+ return &buffer[3];
+ }
+
+ return &buffer[0];
+ }
+ }
+ }
+}
+
+/* send the packet in buffer. */
+
+static void
+putpacket (unsigned char *buffer)
+{
+ unsigned char checksum;
+ int count;
+ unsigned char ch;
+
+ /* $<packet info>#<checksum>. */
+ do
+ {
+ putDebugChar('$');
+ checksum = 0;
+ count = 0;
+
+ while (ch = buffer[count])
+ {
+ putDebugChar (ch);
+ checksum += ch;
+ count += 1;
+ }
+
+ putDebugChar('#');
+ putDebugChar(hexchars[checksum >> 4]);
+ putDebugChar(hexchars[checksum & 0xf]);
+
+ }
+ while (getDebugChar() != '+');
+}
+
+/* Indicate to caller of mem2hex or hex2mem that there has been an
+ error. */
+static volatile int mem_err = 0;
+
+/* Convert the memory pointed to by mem into hex, placing result in buf.
+ * Return a pointer to the last char put in buf (null), in case of mem fault,
+ * return 0.
+ * If MAY_FAULT is non-zero, then we will handle memory faults by returning
+ * a 0, else treat a fault like any other fault in the stub.
+ */
+
+static unsigned char *
+mem2hex (unsigned char *mem, unsigned char *buf, int count, int may_fault)
+{
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ while (count-- > 0)
+ {
+ ch = *mem++;
+ if (mem_err)
+ return 0;
+ *buf++ = hexchars[ch >> 4];
+ *buf++ = hexchars[ch & 0xf];
+ }
+
+ *buf = 0;
+
+ set_mem_fault_trap(0);
+
+ return buf;
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem
+ * return a pointer to the character AFTER the last byte written */
+
+static char *
+hex2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
+{
+ int i;
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ for (i=0; i<count; i++)
+ {
+ ch = hex(*buf++) << 4;
+ ch |= hex(*buf++);
+ *mem++ = ch;
+ if (mem_err)
+ return 0;
+ }
+
+ set_mem_fault_trap(0);
+
+ return mem;
+}
+
+/* This table contains the mapping between SPARC hardware trap types, and
+ signals, which are primarily what GDB understands. It also indicates
+ which hardware traps we need to commandeer when initializing the stub. */
+
+static struct hard_trap_info
+{
+ unsigned char tt; /* Trap type code for SPARClite */
+ unsigned char signo; /* Signal that we map this trap into */
+} hard_trap_info[] = {
+ {0x01, SIGSEGV}, /* instruction access error */
+ {0x02, SIGILL}, /* privileged instruction */
+ {0x03, SIGILL}, /* illegal instruction */
+ {0x04, SIGEMT}, /* fp disabled */
+ {0x07, SIGBUS}, /* mem address not aligned */
+ {0x09, SIGSEGV}, /* data access exception */
+ {0x0a, SIGEMT}, /* tag overflow */
+ {0x20, SIGBUS}, /* r register access error */
+ {0x21, SIGBUS}, /* instruction access error */
+ {0x24, SIGEMT}, /* cp disabled */
+ {0x29, SIGBUS}, /* data access error */
+ {0x2a, SIGFPE}, /* divide by zero */
+ {0x2b, SIGBUS}, /* data store error */
+ {0x80+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */
+ {0xff, SIGTRAP}, /* hardware breakpoint */
+ {0, 0} /* Must be last */
+};
+
+/* Set up exception handlers for tracing and breakpoints */
+
+void
+set_debug_traps (void)
+{
+ struct hard_trap_info *ht;
+
+/* Only setup fp traps if the FP is disabled. */
+
+ for (ht = hard_trap_info;
+ ht->tt != 0 && ht->signo != 0;
+ ht++)
+ if (ht->tt != 4 || ! (read_psr () & 0x1000))
+ exceptionHandler(ht->tt, trap_low);
+
+ initialized = 1;
+}
+
+asm ("
+! Trap handler for memory errors. This just sets mem_err to be non-zero. It
+! assumes that %l1 is non-zero. This should be safe, as it is doubtful that
+! 0 would ever contain code that could mem fault. This routine will skip
+! past the faulting instruction after setting mem_err.
+
+ .text
+ .align 4
+
+_fltr_set_mem_err:
+ sethi %hi(_mem_err), %l0
+ st %l1, [%l0 + %lo(_mem_err)]
+ jmpl %l2, %g0
+ rett %l2+4
+");
+
+static void
+set_mem_fault_trap (int enable)
+{
+ extern void fltr_set_mem_err();
+ mem_err = 0;
+
+ if (enable)
+ exceptionHandler(9, fltr_set_mem_err);
+ else
+ exceptionHandler(9, trap_low);
+}
+
+asm ("
+ .text
+ .align 4
+
+_dummy_hw_breakpoint:
+ jmpl %l2, %g0
+ rett %l2+4
+ nop
+ nop
+");
+
+static void
+get_in_break_mode (void)
+{
+ extern void dummy_hw_breakpoint();
+
+ exceptionHandler (255, dummy_hw_breakpoint);
+
+ asm ("ta 255");
+
+ exceptionHandler (255, trap_low);
+}
+
+/* Convert the SPARC hardware trap type code to a unix signal number. */
+
+static int
+computeSignal (int tt)
+{
+ struct hard_trap_info *ht;
+
+ for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+ if (ht->tt == tt)
+ return ht->signo;
+
+ return SIGHUP; /* default for things we don't know about */
+}
+
+/*
+ * While we find nice hex chars, build an int.
+ * Return number of chars processed.
+ */
+
+static int
+hexToInt(char **ptr, int *intValue)
+{
+ int numChars = 0;
+ int hexValue;
+
+ *intValue = 0;
+
+ while (**ptr)
+ {
+ hexValue = hex(**ptr);
+ if (hexValue < 0)
+ break;
+
+ *intValue = (*intValue << 4) | hexValue;
+ numChars ++;
+
+ (*ptr)++;
+ }
+
+ return (numChars);
+}
+
+/*
+ * This function does all command procesing for interfacing to gdb. It
+ * returns 1 if you should skip the instruction at the trap address, 0
+ * otherwise.
+ */
+
+static void
+handle_exception (unsigned long *registers)
+{
+ int tt; /* Trap type */
+ int sigval;
+ int addr;
+ int length;
+ char *ptr;
+ unsigned long *sp;
+ unsigned long dsr;
+
+/* First, we must force all of the windows to be spilled out */
+
+ asm(" save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ save %sp, -64, %sp
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+");
+
+ get_in_break_mode (); /* Enable DSU register writes */
+
+ registers[DIA1] = read_asi (1, 0xff00);
+ registers[DIA2] = read_asi (1, 0xff04);
+ registers[DDA1] = read_asi (1, 0xff08);
+ registers[DDA2] = read_asi (1, 0xff0c);
+ registers[DDV1] = read_asi (1, 0xff10);
+ registers[DDV2] = read_asi (1, 0xff14);
+ registers[DCR] = read_asi (1, 0xff18);
+ registers[DSR] = read_asi (1, 0xff1c);
+
+ if (registers[PC] == (unsigned long)breakinst)
+ {
+ registers[PC] = registers[NPC];
+ registers[NPC] += 4;
+ }
+ sp = (unsigned long *)registers[SP];
+
+ dsr = (unsigned long)registers[DSR];
+ if (dsr & 0x3c)
+ tt = 255;
+ else
+ tt = (registers[TBR] >> 4) & 0xff;
+
+ /* reply to host that an exception has occurred */
+ sigval = computeSignal(tt);
+ ptr = remcomOutBuffer;
+
+ *ptr++ = 'T';
+ *ptr++ = hexchars[sigval >> 4];
+ *ptr++ = hexchars[sigval & 0xf];
+
+ *ptr++ = hexchars[PC >> 4];
+ *ptr++ = hexchars[PC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[FP >> 4];
+ *ptr++ = hexchars[FP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[SP >> 4];
+ *ptr++ = hexchars[SP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&sp, ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[NPC >> 4];
+ *ptr++ = hexchars[NPC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[NPC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[O7 >> 4];
+ *ptr++ = hexchars[O7 & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[O7], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = 0;
+
+ putpacket(remcomOutBuffer);
+
+ while (1)
+ {
+ remcomOutBuffer[0] = 0;
+
+ ptr = getpacket();
+ switch (*ptr++)
+ {
+ case '?':
+ remcomOutBuffer[0] = 'S';
+ remcomOutBuffer[1] = hexchars[sigval >> 4];
+ remcomOutBuffer[2] = hexchars[sigval & 0xf];
+ remcomOutBuffer[3] = 0;
+ break;
+
+ case 'd':
+ /* toggle debug flag */
+ break;
+
+ case 'g': /* return the value of the CPU registers */
+ memcpy (&registers[L0], sp, 16 * 4); /* Copy L & I regs from stack */
+ mem2hex ((char *)registers, remcomOutBuffer, NUMREGBYTES, 0);
+ break;
+
+ case 'G': /* Set the value of all registers */
+ case 'P': /* Set the value of one register */
+ {
+ unsigned long *newsp, psr;
+
+ psr = registers[PSR];
+
+ if (ptr[-1] == 'P')
+ {
+ int regno;
+
+ if (hexToInt (&ptr, &regno)
+ && *ptr++ == '=')
+ if (regno >= L0 && regno <= I7)
+ hex2mem (ptr, sp + regno - L0, 4, 0);
+ else
+ hex2mem (ptr, (char *)&registers[regno], 4, 0);
+ else
+ {
+ strcpy (remcomOutBuffer, "E01");
+ break;
+ }
+ }
+ else
+ {
+ hex2mem (ptr, (char *)registers, NUMREGBYTES, 0);
+ memcpy (sp, &registers[L0], 16 * 4); /* Copy L & I regs to stack */
+ }
+
+ /* See if the stack pointer has moved. If so, then copy the saved
+ locals and ins to the new location. This keeps the window
+ overflow and underflow routines happy. */
+
+ newsp = (unsigned long *)registers[SP];
+ if (sp != newsp)
+ sp = memcpy(newsp, sp, 16 * 4);
+
+ /* Don't allow CWP to be modified. */
+
+ if (psr != registers[PSR])
+ registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f);
+
+ strcpy(remcomOutBuffer,"OK");
+ }
+ break;
+
+ case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
+ /* Try to read %x,%x. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length))
+ {
+ if (mem2hex((char *)addr, remcomOutBuffer, length, 1))
+ break;
+
+ strcpy (remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer,"E01");
+ break;
+
+ case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
+ /* Try to read '%x,%x:'. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length)
+ && *ptr++ == ':')
+ {
+ if (hex2mem(ptr, (char *)addr, length, 1))
+ strcpy(remcomOutBuffer, "OK");
+ else
+ strcpy(remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer, "E02");
+ break;
+
+ case 'c': /* cAA..AA Continue at address AA..AA(optional) */
+ /* try to read optional parameter, pc unchanged if no parm */
+ if (hexToInt(&ptr, &addr))
+ {
+ registers[PC] = addr;
+ registers[NPC] = addr + 4;
+ }
+
+/* Need to flush the instruction cache here, as we may have deposited a
+ breakpoint, and the icache probably has no way of knowing that a data ref to
+ some location may have changed something that is in the instruction cache.
+ */
+
+ flush_i_cache ();
+
+ if (!(registers[DSR] & 0x1) /* DSU enabled? */
+ && !(registers[DCR] & 0x200)) /* Are we in break state? */
+ { /* Yes, set the DSU regs */
+ write_asi (1, 0xff00, registers[DIA1]);
+ write_asi (1, 0xff04, registers[DIA2]);
+ write_asi (1, 0xff08, registers[DDA1]);
+ write_asi (1, 0xff0c, registers[DDA2]);
+ write_asi (1, 0xff10, registers[DDV1]);
+ write_asi (1, 0xff14, registers[DDV2]);
+ write_asi (1, 0xff1c, registers[DSR]);
+ write_asi (1, 0xff18, registers[DCR] | 0x200); /* Clear break */
+ }
+
+ return;
+
+ /* kill the program */
+ case 'k' : /* do nothing */
+ break;
+#if 0
+ case 't': /* Test feature */
+ asm (" std %f30,[%sp]");
+ break;
+#endif
+ case 'r': /* Reset */
+ asm ("call 0
+ nop ");
+ break;
+ } /* switch */
+
+ /* reply to the request */
+ putpacket(remcomOutBuffer);
+ }
+}
+
+/* This function will generate a breakpoint exception. It is used at the
+ beginning of a program to sync up with a debugger and can be used
+ otherwise as a quick means to stop program execution and "break" into
+ the debugger. */
+
+void
+breakpoint (void)
+{
+ if (!initialized)
+ return;
+
+ asm(" .globl _breakinst
+
+ _breakinst: ta 1
+ ");
+}
diff --git a/contrib/gdb/gdb/sparcl-tdep.c b/contrib/gdb/gdb/sparcl-tdep.c
new file mode 100644
index 0000000..87351f1
--- /dev/null
+++ b/contrib/gdb/gdb/sparcl-tdep.c
@@ -0,0 +1,869 @@
+/* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger.
+ Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "breakpoint.h"
+#include "target.h"
+#include "serial.h"
+#include "regcache.h"
+#include <sys/types.h>
+
+#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
+#define HAVE_SOCKETS
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#endif
+
+static struct target_ops sparclite_ops;
+
+static char *remote_target_name = NULL;
+static struct serial *remote_desc = NULL;
+static int serial_flag;
+#ifdef HAVE_SOCKETS
+static int udp_fd = -1;
+#endif
+
+static struct serial *open_tty (char *name);
+static int send_resp (struct serial *desc, char c);
+static void close_tty (void * ignore);
+#ifdef HAVE_SOCKETS
+static int recv_udp_buf (int fd, unsigned char *buf, int len, int timeout);
+static int send_udp_buf (int fd, unsigned char *buf, int len);
+#endif
+static void sparclite_open (char *name, int from_tty);
+static void sparclite_close (int quitting);
+static void download (char *target_name, char *args, int from_tty,
+ void (*write_routine) (bfd * from_bfd,
+ asection * from_sec,
+ file_ptr from_addr,
+ bfd_vma to_addr, int len),
+ void (*start_routine) (bfd_vma entry));
+static void sparclite_serial_start (bfd_vma entry);
+static void sparclite_serial_write (bfd * from_bfd, asection * from_sec,
+ file_ptr from_addr,
+ bfd_vma to_addr, int len);
+#ifdef HAVE_SOCKETS
+static unsigned short calc_checksum (unsigned char *buffer, int count);
+static void sparclite_udp_start (bfd_vma entry);
+static void sparclite_udp_write (bfd * from_bfd, asection * from_sec,
+ file_ptr from_addr, bfd_vma to_addr,
+ int len);
+#endif
+static void sparclite_download (char *filename, int from_tty);
+
+#define DDA2_SUP_ASI 0xb000000
+#define DDA1_SUP_ASI 0xb0000
+
+#define DDA2_ASI_MASK 0xff000000
+#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 DDV_TYPE_MASK 0xc
+#define DDV_TYPE_LOAD 0x0
+#define DDV_TYPE_STORE 0x4
+#define DDV_TYPE_ACCESS 0x8
+#define DDV_TYPE_ALWAYS 0xc
+#define DDV_COND 0x2
+#define DDV_MASK 0x1
+
+int
+sparclite_insert_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ CORE_ADDR dcr;
+
+ dcr = read_register (DCR_REGNUM);
+
+ if (!(dcr & DDA1_ENABLE))
+ {
+ write_register (DDA1_REGNUM, addr);
+ dcr &= ~(DDA1_ASI_MASK | DDV_TYPE_MASK);
+ dcr |= (DDA1_SUP_ASI | DDA1_ENABLE);
+ if (type == 1)
+ {
+ 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);
+ write_register (DDV2_REGNUM, 0xffffffff);
+ dcr |= (DDV_TYPE_STORE & (~DDV_COND & ~DDV_MASK));
+ }
+ else
+ {
+ write_register (DDV1_REGNUM, 0);
+ write_register (DDV2_REGNUM, 0xffffffff);
+ dcr |= (DDV_TYPE_ACCESS);
+ }
+ write_register (DCR_REGNUM, dcr);
+ }
+ else if (!(dcr & DDA2_ENABLE))
+ {
+ write_register (DDA2_REGNUM, addr);
+ dcr &= ~(DDA2_ASI_MASK & DDV_TYPE_MASK);
+ dcr |= (DDA2_SUP_ASI | DDA2_ENABLE);
+ if (type == 1)
+ {
+ 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);
+ write_register (DDV2_REGNUM, 0xffffffff);
+ dcr |= (DDV_TYPE_STORE & ~DDV_COND & ~DDV_MASK);
+ }
+ else
+ {
+ write_register (DDV1_REGNUM, 0);
+ write_register (DDV2_REGNUM, 0xffffffff);
+ dcr |= (DDV_TYPE_ACCESS);
+ }
+ write_register (DCR_REGNUM, dcr);
+ }
+ else
+ return -1;
+
+ return 0;
+}
+
+int
+sparclite_remove_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ CORE_ADDR dcr, dda1, dda2;
+
+ dcr = read_register (DCR_REGNUM);
+ dda1 = read_register (DDA1_REGNUM);
+ dda2 = read_register (DDA2_REGNUM);
+
+ if ((dcr & DDA1_ENABLE) && addr == dda1)
+ write_register (DCR_REGNUM, (dcr & ~DDA1_ENABLE));
+ else if ((dcr & DDA2_ENABLE) && addr == dda2)
+ write_register (DCR_REGNUM, (dcr & ~DDA2_ENABLE));
+ else
+ return -1;
+
+ return 0;
+}
+
+int
+sparclite_insert_hw_breakpoint (CORE_ADDR addr, int len)
+{
+ CORE_ADDR dcr;
+
+ dcr = read_register (DCR_REGNUM);
+
+ if (!(dcr & DIA1_ENABLE))
+ {
+ write_register (DIA1_REGNUM, addr);
+ write_register (DCR_REGNUM, (dcr | DIA1_ENABLE | DIA1_SUP_MODE));
+ }
+ else if (!(dcr & DIA2_ENABLE))
+ {
+ write_register (DIA2_REGNUM, addr);
+ write_register (DCR_REGNUM, (dcr | DIA2_ENABLE | DIA2_SUP_MODE));
+ }
+ else
+ return -1;
+
+ return 0;
+}
+
+int
+sparclite_remove_hw_breakpoint (CORE_ADDR addr, int shadow)
+{
+ CORE_ADDR dcr, dia1, dia2;
+
+ 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)
+ write_register (DCR_REGNUM, (dcr & ~DIA2_ENABLE));
+ else
+ return -1;
+
+ return 0;
+}
+
+int
+sparclite_check_watch_resources (int type, int cnt, int ot)
+{
+ /* Watchpoints not supported on simulator. */
+ if (strcmp (target_shortname, "sim") == 0)
+ return 0;
+
+ if (type == bp_hardware_breakpoint)
+ {
+ if (TARGET_HW_BREAK_LIMIT == 0)
+ return 0;
+ else if (cnt <= TARGET_HW_BREAK_LIMIT)
+ return 1;
+ }
+ else
+ {
+ if (TARGET_HW_WATCH_LIMIT == 0)
+ return 0;
+ else if (ot)
+ return -1;
+ else if (cnt <= TARGET_HW_WATCH_LIMIT)
+ return 1;
+ }
+ return -1;
+}
+
+CORE_ADDR
+sparclite_stopped_data_address (void)
+{
+ CORE_ADDR dsr, dda1, dda2;
+
+ dsr = read_register (DSR_REGNUM);
+ dda1 = read_register (DDA1_REGNUM);
+ dda2 = read_register (DDA2_REGNUM);
+
+ if (dsr & 0x10)
+ return dda1;
+ else if (dsr & 0x20)
+ return dda2;
+ else
+ return 0;
+}
+
+static struct serial *
+open_tty (char *name)
+{
+ struct serial *desc;
+
+ desc = serial_open (name);
+ if (!desc)
+ perror_with_name (name);
+
+ if (baud_rate != -1)
+ {
+ if (serial_setbaudrate (desc, baud_rate))
+ {
+ serial_close (desc);
+ perror_with_name (name);
+ }
+ }
+
+ serial_raw (desc);
+
+ serial_flush_input (desc);
+
+ return desc;
+}
+
+/* Read a single character from the remote end, masking it down to 7 bits. */
+
+static int
+readchar (struct serial *desc, int timeout)
+{
+ int ch;
+ char s[10];
+
+ ch = serial_readchar (desc, timeout);
+
+ switch (ch)
+ {
+ case SERIAL_EOF:
+ error ("SPARClite remote connection closed");
+ case SERIAL_ERROR:
+ perror_with_name ("SPARClite communication error");
+ case SERIAL_TIMEOUT:
+ error ("SPARClite remote timeout");
+ default:
+ if (remote_debug > 0)
+ {
+ sprintf (s, "[%02x]", ch & 0xff);
+ puts_debug ("read -->", s, "<--");
+ }
+ return ch;
+ }
+}
+
+static void
+debug_serial_write (struct serial *desc, char *buf, int len)
+{
+ char s[10];
+
+ serial_write (desc, buf, len);
+ if (remote_debug > 0)
+ {
+ while (len-- > 0)
+ {
+ sprintf (s, "[%02x]", *buf & 0xff);
+ puts_debug ("Sent -->", s, "<--");
+ buf++;
+ }
+ }
+}
+
+
+static int
+send_resp (struct serial *desc, char c)
+{
+ debug_serial_write (desc, &c, 1);
+ return readchar (desc, remote_timeout);
+}
+
+static void
+close_tty (void *ignore)
+{
+ if (!remote_desc)
+ return;
+
+ serial_close (remote_desc);
+
+ remote_desc = NULL;
+}
+
+#ifdef HAVE_SOCKETS
+static int
+recv_udp_buf (int fd, unsigned char *buf, int len, int timeout)
+{
+ int cc;
+ fd_set readfds;
+
+ FD_ZERO (&readfds);
+ FD_SET (fd, &readfds);
+
+ if (timeout >= 0)
+ {
+ struct timeval timebuf;
+
+ timebuf.tv_sec = timeout;
+ timebuf.tv_usec = 0;
+ cc = select (fd + 1, &readfds, 0, 0, &timebuf);
+ }
+ else
+ cc = select (fd + 1, &readfds, 0, 0, 0);
+
+ if (cc == 0)
+ return 0;
+
+ if (cc != 1)
+ perror_with_name ("recv_udp_buf: Bad return value from select:");
+
+ cc = recv (fd, buf, len, 0);
+
+ if (cc < 0)
+ perror_with_name ("Got an error from recv: ");
+}
+
+static int
+send_udp_buf (int fd, unsigned char *buf, int len)
+{
+ int cc;
+
+ cc = send (fd, buf, len, 0);
+
+ if (cc == len)
+ return;
+
+ if (cc < 0)
+ perror_with_name ("Got an error from send: ");
+
+ error ("Short count in send: tried %d, sent %d\n", len, cc);
+}
+#endif /* HAVE_SOCKETS */
+
+static void
+sparclite_open (char *name, int from_tty)
+{
+ struct cleanup *old_chain;
+ int c;
+ char *p;
+
+ if (!name)
+ error ("You need to specify what device or hostname is associated with the SparcLite board.");
+
+ target_preopen (from_tty);
+
+ unpush_target (&sparclite_ops);
+
+ if (remote_target_name)
+ xfree (remote_target_name);
+
+ remote_target_name = xstrdup (name);
+
+ /* We need a 'serial' or 'udp' keyword to disambiguate host:port, which can
+ mean either a serial port on a terminal server, or the IP address of a
+ SPARClite demo board. If there's no colon, then it pretty much has to be
+ a local device (except for DOS... grrmble) */
+
+ p = strchr (name, ' ');
+
+ if (p)
+ {
+ *p++ = '\000';
+ while ((*p != '\000') && isspace (*p))
+ p++;
+
+ if (strncmp (name, "serial", strlen (name)) == 0)
+ serial_flag = 1;
+ else if (strncmp (name, "udp", strlen (name)) == 0)
+ serial_flag = 0;
+ else
+ error ("Must specify either `serial' or `udp'.");
+ }
+ else
+ {
+ p = name;
+
+ if (!strchr (name, ':'))
+ serial_flag = 1; /* No colon is unambiguous (local device) */
+ else
+ error ("Usage: target sparclite serial /dev/ttyb\n\
+or: target sparclite udp host");
+ }
+
+ if (serial_flag)
+ {
+ remote_desc = open_tty (p);
+
+ old_chain = make_cleanup (close_tty, 0 /*ignore*/);
+
+ c = send_resp (remote_desc, 0x00);
+
+ if (c != 0xaa)
+ error ("Unknown response (0x%x) from SparcLite. Try resetting the board.",
+ c);
+
+ c = send_resp (remote_desc, 0x55);
+
+ if (c != 0x55)
+ error ("Sparclite appears to be ill.");
+ }
+ else
+ {
+#ifdef HAVE_SOCKETS
+ struct hostent *he;
+ struct sockaddr_in sockaddr;
+ unsigned char buffer[100];
+ int cc;
+
+ /* Setup the socket. Must be raw UDP. */
+
+ he = gethostbyname (p);
+
+ if (!he)
+ error ("No such host %s.", p);
+
+ udp_fd = socket (PF_INET, SOCK_DGRAM, 0);
+
+ old_chain = make_cleanup (close, udp_fd);
+
+ sockaddr.sin_family = PF_INET;
+ 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)))
+ 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 */
+ if (cc == 0)
+ error ("SPARClite isn't responding.");
+
+ if (cc < 3)
+ error ("SPARClite appears to be ill.");
+#else
+ error ("UDP downloading is not supported for DOS hosts.");
+#endif /* HAVE_SOCKETS */
+ }
+
+ printf_unfiltered ("[SPARClite appears to be alive]\n");
+
+ push_target (&sparclite_ops);
+
+ discard_cleanups (old_chain);
+
+ return;
+}
+
+static void
+sparclite_close (int quitting)
+{
+ if (serial_flag)
+ close_tty (0);
+#ifdef HAVE_SOCKETS
+ else if (udp_fd != -1)
+ close (udp_fd);
+#endif
+}
+
+#define LOAD_ADDRESS 0x40000000
+
+static void
+download (char *target_name, char *args, int from_tty,
+ void (*write_routine) (bfd *from_bfd, asection *from_sec,
+ file_ptr from_addr, bfd_vma to_addr, int len),
+ void (*start_routine) (bfd_vma entry))
+{
+ struct cleanup *old_chain;
+ asection *section;
+ bfd *pbfd;
+ bfd_vma entry;
+ int i;
+#define WRITESIZE 1024
+ char *filename;
+ int quiet;
+ int nostart;
+
+ quiet = 0;
+ nostart = 0;
+ filename = NULL;
+
+ while (*args != '\000')
+ {
+ char *arg;
+
+ while (isspace (*args))
+ args++;
+
+ arg = args;
+
+ while ((*args != '\000') && !isspace (*args))
+ args++;
+
+ if (*args != '\000')
+ *args++ = '\000';
+
+ if (*arg != '-')
+ filename = arg;
+ else if (strncmp (arg, "-quiet", strlen (arg)) == 0)
+ quiet = 1;
+ else if (strncmp (arg, "-nostart", strlen (arg)) == 0)
+ nostart = 1;
+ else
+ error ("unknown option `%s'", arg);
+ }
+
+ if (!filename)
+ filename = get_exec_file (1);
+
+ pbfd = bfd_openr (filename, gnutarget);
+ if (pbfd == NULL)
+ {
+ perror_with_name (filename);
+ return;
+ }
+ old_chain = make_cleanup_bfd_close (pbfd);
+
+ 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)
+ {
+ if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
+ {
+ bfd_vma section_address;
+ bfd_size_type section_size;
+ file_ptr fptr;
+ const char *section_name;
+
+ section_name = bfd_get_section_name (pbfd, section);
+
+ section_address = bfd_get_section_vma (pbfd, section);
+
+ /* Adjust sections from a.out files, since they don't
+ carry their addresses with. */
+ if (bfd_get_flavour (pbfd) == bfd_target_aout_flavour)
+ {
+ if (strcmp (section_name, ".text") == 0)
+ section_address = bfd_get_start_address (pbfd);
+ else if (strcmp (section_name, ".data") == 0)
+ {
+ /* Read the first 8 bytes of the data section.
+ 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;
+ bfd_get_section_contents (pbfd, section, &marker, 0,
+ sizeof (marker));
+ if (strncmp (marker.signature, "DaTa", 4) == 0)
+ {
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ section_address = bfd_getb32 (marker.sdata);
+ else
+ section_address = bfd_getl32 (marker.sdata);
+ }
+ }
+ }
+
+ section_size = bfd_get_section_size_before_reloc (section);
+
+ if (!quiet)
+ printf_filtered ("[Loading section %s at 0x%x (%d bytes)]\n",
+ bfd_get_section_name (pbfd, section),
+ section_address,
+ section_size);
+
+ fptr = 0;
+ while (section_size > 0)
+ {
+ int count;
+ static char inds[] = "|/-\\";
+ static int k = 0;
+
+ QUIT;
+
+ count = min (section_size, WRITESIZE);
+
+ write_routine (pbfd, section, fptr, section_address, count);
+
+ if (!quiet)
+ {
+ printf_unfiltered ("\r%c", inds[k++ % 4]);
+ gdb_flush (gdb_stdout);
+ }
+
+ section_address += count;
+ fptr += count;
+ section_size -= count;
+ }
+ }
+ }
+
+ if (!nostart)
+ {
+ entry = bfd_get_start_address (pbfd);
+
+ if (!quiet)
+ printf_unfiltered ("[Starting %s at 0x%x]\n", filename, entry);
+
+ start_routine (entry);
+ }
+
+ do_cleanups (old_chain);
+}
+
+static void
+sparclite_serial_start (bfd_vma entry)
+{
+ char buffer[5];
+ int i;
+
+ buffer[0] = 0x03;
+ store_unsigned_integer (buffer + 1, 4, entry);
+
+ debug_serial_write (remote_desc, buffer, 1 + 4);
+ i = readchar (remote_desc, remote_timeout);
+ if (i != 0x55)
+ error ("Can't start SparcLite. Error code %d\n", i);
+}
+
+static void
+sparclite_serial_write (bfd *from_bfd, asection *from_sec, file_ptr from_addr,
+ bfd_vma to_addr, int len)
+{
+ 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 */
+
+ bfd_get_section_contents (from_bfd, from_sec, buffer + 8, from_addr, len);
+
+ checksum = 0;
+ for (i = 0; i < len; i++)
+ checksum += buffer[8 + i];
+
+ i = send_resp (remote_desc, 0x01);
+
+ if (i != 0x5a)
+ error ("Bad response from load command (0x%x)", i);
+
+ debug_serial_write (remote_desc, buffer, 4 + 4 + len);
+ i = readchar (remote_desc, remote_timeout);
+
+ if (i != checksum)
+ error ("Bad checksum from load command (0x%x)", i);
+}
+
+#ifdef HAVE_SOCKETS
+
+static unsigned short
+calc_checksum (unsigned char *buffer, int count)
+{
+ unsigned short checksum;
+
+ checksum = 0;
+ for (; count > 0; count -= 2, buffer += 2)
+ checksum += (*buffer << 8) | *(buffer + 1);
+
+ if (count != 0)
+ checksum += *buffer << 8;
+
+ return checksum;
+}
+
+static void
+sparclite_udp_start (bfd_vma entry)
+{
+ unsigned char buffer[6];
+ int i;
+
+ buffer[0] = 0x3;
+ buffer[1] = 0;
+ buffer[2] = entry >> 24;
+ buffer[3] = entry >> 16;
+ 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 */
+
+ if (i < 1 || buffer[0] != 0x55)
+ error ("Failed to take start address.");
+}
+
+static void
+sparclite_udp_write (bfd *from_bfd, asection *from_sec, file_ptr from_addr,
+ bfd_vma to_addr, int len)
+{
+ unsigned char buffer[2000];
+ unsigned short checksum;
+ static int pkt_num = 0;
+ static unsigned long old_addr = -1;
+ int i;
+
+ while (1)
+ {
+ if (to_addr != old_addr)
+ {
+ buffer[0] = 0x1; /* Load command */
+ buffer[1] = 0x1; /* Loading address */
+ buffer[2] = to_addr >> 24;
+ buffer[3] = to_addr >> 16;
+ buffer[4] = to_addr >> 8;
+ buffer[5] = to_addr;
+
+ checksum = 0;
+ for (i = 0; i < 6; i++)
+ checksum += buffer[i];
+ checksum &= 0xff;
+
+ send_udp_buf (udp_fd, buffer, 6);
+ i = recv_udp_buf (udp_fd, buffer, sizeof buffer, -1);
+
+ if (i < 1)
+ error ("Got back short checksum for load addr.");
+
+ if (checksum != buffer[0])
+ error ("Got back bad checksum for load addr.");
+
+ pkt_num = 0; /* Load addr resets packet seq # */
+ old_addr = to_addr;
+ }
+
+ bfd_get_section_contents (from_bfd, from_sec, buffer + 6, from_addr,
+ len);
+
+ checksum = calc_checksum (buffer + 6, len);
+
+ buffer[0] = 0x1; /* Load command */
+ buffer[1] = 0x2; /* Loading data */
+ buffer[2] = pkt_num >> 8;
+ buffer[3] = pkt_num;
+ buffer[4] = checksum >> 8;
+ buffer[5] = checksum;
+
+ send_udp_buf (udp_fd, buffer, len + 6);
+ i = recv_udp_buf (udp_fd, buffer, sizeof buffer, 3);
+
+ if (i == 0)
+ {
+ fprintf_unfiltered (gdb_stderr, "send_data: timeout sending %d bytes to address 0x%x retrying\n", len, to_addr);
+ continue;
+ }
+
+ if (buffer[0] != 0xff)
+ error ("Got back bad response for load data.");
+
+ old_addr += len;
+ pkt_num++;
+
+ return;
+ }
+}
+
+#endif /* HAVE_SOCKETS */
+
+static void
+sparclite_download (char *filename, int from_tty)
+{
+ if (!serial_flag)
+#ifdef HAVE_SOCKETS
+ download (remote_target_name, filename, from_tty, sparclite_udp_write,
+ sparclite_udp_start);
+#else
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* sparclite_open should prevent this! */
+#endif
+ else
+ download (remote_target_name, filename, from_tty, sparclite_serial_write,
+ sparclite_serial_start);
+}
+
+/* Set up the sparclite target vector. */
+
+static void
+init_sparclite_ops (void)
+{
+ sparclite_ops.to_shortname = "sparclite";
+ sparclite_ops.to_longname = "SPARClite download target";
+ sparclite_ops.to_doc = "Download to a remote SPARClite target board via serial of UDP.\n\
+Specify the device it is connected to (e.g. /dev/ttya).";
+ sparclite_ops.to_open = sparclite_open;
+ sparclite_ops.to_close = sparclite_close;
+ sparclite_ops.to_load = sparclite_download;
+ sparclite_ops.to_stratum = download_stratum;
+ sparclite_ops.to_magic = OPS_MAGIC;
+}
+
+void
+_initialize_sparcl_tdep (void)
+{
+ init_sparclite_ops ();
+ add_target (&sparclite_ops);
+}
diff --git a/contrib/gdb/gdb/sparclet-rom.c b/contrib/gdb/gdb/sparclet-rom.c
new file mode 100644
index 0000000..fa2ca1e
--- /dev/null
+++ b/contrib/gdb/gdb/sparclet-rom.c
@@ -0,0 +1,316 @@
+/* Remote target glue for the SPARC Sparclet ROM monitor.
+
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "monitor.h"
+#include "serial.h"
+#include "srec.h"
+#include "symtab.h"
+#include "symfile.h" /* for generic_load */
+#include "regcache.h"
+#include <time.h>
+
+extern void report_transfer_performance (unsigned long, time_t, time_t);
+
+static struct target_ops sparclet_ops;
+
+static void sparclet_open (char *args, int from_tty);
+
+/* This array of registers need to match the indexes used by GDB.
+ This exists because the various ROM monitors use different strings
+ than does GDB, and don't necessarily support all the registers
+ 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
+ */
+/* these correspond to the offsets from tm-* files from config directories */
+
+/* is wim part of psr?? */
+/* monitor wants lower case */
+static char *sparclet_regnames[] = {
+ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
+ "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
+ "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7",
+
+ "", "", "", "", "", "", "", "", /* no FPU regs */
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ /* no CPSR, FPSR */
+ "y", "psr", "wim", "tbr", "pc", "npc", "", "",
+
+ "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
+
+ /* ASR15 ASR19 (don't display them) */
+ "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22",
+/*
+ "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
+ "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
+ "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
+ "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
+ "apsr",
+ */
+};
+
+
+
+/* Function: sparclet_supply_register
+ Just returns with no action.
+ This function is required, because parse_register_dump (monitor.c)
+ expects to be able to call it. If we don't supply something, it will
+ call a null pointer and core-dump. Since this function does not
+ actually do anything, GDB will request the registers individually. */
+
+static void
+sparclet_supply_register (char *regname, int regnamelen, char *val, int vallen)
+{
+ return;
+}
+
+static void
+sparclet_load (struct serial *desc, char *file, int hashmark)
+{
+ bfd *abfd;
+ asection *s;
+ int i;
+ CORE_ADDR load_offset;
+ time_t start_time, end_time;
+ unsigned long data_count = 0;
+
+ /* enable user to specify address for downloading as 2nd arg to load */
+
+ i = sscanf (file, "%*s 0x%lx", &load_offset);
+ if (i >= 1)
+ {
+ char *p;
+
+ for (p = file; *p != '\000' && !isspace (*p); p++);
+
+ *p = '\000';
+ }
+ else
+ load_offset = 0;
+
+ abfd = bfd_openr (file, 0);
+ if (!abfd)
+ {
+ 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;
+ }
+
+ start_time = time (NULL);
+
+ for (s = abfd->sections; s; s = s->next)
+ if (s->flags & SEC_LOAD)
+ {
+ bfd_size_type section_size;
+ bfd_vma vma;
+
+ vma = bfd_get_section_vma (abfd, s) + load_offset;
+ section_size = bfd_section_size (abfd, s);
+
+ data_count += section_size;
+
+ printf_filtered ("%s\t: 0x%4x .. 0x%4x ",
+ bfd_get_section_name (abfd, s), vma,
+ vma + section_size);
+ gdb_flush (gdb_stdout);
+
+ monitor_printf ("load c r %x %x\r", vma, section_size);
+
+ monitor_expect ("load: loading ", NULL, 0);
+ monitor_expect ("\r", NULL, 0);
+
+ for (i = 0; i < section_size; i += 2048)
+ {
+ int numbytes;
+ char buf[2048];
+
+ numbytes = min (sizeof buf, section_size - i);
+
+ bfd_get_section_contents (abfd, s, buf, i, numbytes);
+
+ serial_write (desc, buf, numbytes);
+
+ if (hashmark)
+ {
+ putchar_unfiltered ('#');
+ gdb_flush (gdb_stdout);
+ }
+ } /* Per-packet (or S-record) loop */
+
+ monitor_expect_prompt (NULL, 0);
+
+ putchar_unfiltered ('\n');
+ } /* Loadable sections */
+
+ monitor_printf ("reg pc %x\r", bfd_get_start_address (abfd));
+ monitor_expect_prompt (NULL, 0);
+ monitor_printf ("reg npc %x\r", bfd_get_start_address (abfd) + 4);
+ monitor_expect_prompt (NULL, 0);
+
+ monitor_printf ("run\r");
+
+ end_time = time (NULL);
+
+ if (hashmark)
+ putchar_unfiltered ('\n');
+
+ report_transfer_performance (data_count, start_time, end_time);
+
+ pop_target ();
+ push_remote_target (monitor_get_dev_name (), 1);
+
+ throw_exception (RETURN_QUIT);
+}
+
+/* Define the monitor command strings. Since these are passed directly
+ through to a printf style function, we may include formatting
+ strings. We also need a CR or LF on the end. */
+
+/* need to pause the monitor for timing reasons, so slow it down */
+
+static char *sparclet_inits[] =
+{"\n\r\r\n", NULL};
+
+static struct monitor_ops sparclet_cmds;
+
+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) */
+ /* 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 */
+ /* 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 */
+ /* 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 */
+};
+
+static void
+sparclet_open (char *args, int from_tty)
+{
+ monitor_open (args, &sparclet_cmds, from_tty);
+}
+
+void
+_initialize_sparclet (void)
+{
+ int i;
+ 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[0] = 0; /* mon won't report %G0 */
+
+ init_monitor_ops (&sparclet_ops);
+ 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_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);
+}
diff --git a/contrib/gdb/gdb/sparclet-stub.c b/contrib/gdb/gdb/sparclet-stub.c
new file mode 100644
index 0000000..f593df7
--- /dev/null
+++ b/contrib/gdb/gdb/sparclet-stub.c
@@ -0,0 +1,1167 @@
+/****************************************************************************
+
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
+ HP offers the following for use in the public domain. HP makes no
+ warranty with regard to the software or it's performance and the
+ user accepts the software "AS IS" with all faults.
+
+ HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
+ TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+****************************************************************************/
+
+/****************************************************************************
+ * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ *
+ * Module name: remcom.c $
+ * Revision: 1.34 $
+ * Date: 91/03/09 12:29:49 $
+ * Contributor: Lake Stevens Instrument Division$
+ *
+ * Description: low level support for gdb debugger. $
+ *
+ * Considerations: only works on target hardware $
+ *
+ * Written by: Glenn Engel $
+ * ModuleState: Experimental $
+ *
+ * NOTES: See Below $
+ *
+ * Modified for SPARC by Stu Grossman, Cygnus Support.
+ * Based on sparc-stub.c, it's modified for SPARClite Debug Unit hardware
+ * breakpoint support to create sparclite-stub.c, by Kung Hsu, Cygnus Support.
+ *
+ * This code has been extensively tested on the Fujitsu SPARClite demo board.
+ *
+ * To enable debugger support, two things need to happen. One, a
+ * call to set_debug_traps() is necessary in order to allow any breakpoints
+ * or error conditions to be properly intercepted and reported to gdb.
+ * Two, a breakpoint needs to be generated to begin communication. This
+ * is most easily accomplished by a call to breakpoint(). Breakpoint()
+ * simulates a breakpoint by executing a trap #1.
+ *
+ *************
+ *
+ * The following gdb commands are supported:
+ *
+ * command function Return value
+ *
+ * g return the value of the CPU registers hex data or ENN
+ * G set the value of the CPU registers OK or ENN
+ * P set the value of a single CPU register OK or ENN
+ *
+ * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
+ * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
+ *
+ * c Resume at current address SNN ( signal NN)
+ * cAA..AA Continue at address AA..AA SNN
+ *
+ * s Step one instruction SNN
+ * sAA..AA Step one instruction from AA..AA SNN
+ *
+ * k kill
+ *
+ * ? What was the last sigval ? SNN (signal NN)
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum. A packet consists of
+ *
+ * $<packet info>#<checksum>.
+ *
+ * where
+ * <packet info> :: <characters representing the command or response>
+ * <checksum> :: <two hex digits computed as modulo 256 sum of <packetinfo>>
+ *
+ * When a packet is received, it is first acknowledged with either '+' or '-'.
+ * '+' indicates a successful transfer. '-' indicates a failed transfer.
+ *
+ * Example:
+ *
+ * Host: Reply:
+ * $m0,10#2a +$00010203040506070809101112131415#42
+ *
+ ****************************************************************************/
+
+#include <string.h>
+#include <signal.h>
+
+/************************************************************************
+ *
+ * external low-level support routines
+ */
+
+extern void putDebugChar(); /* write a single character */
+extern int getDebugChar(); /* read and return a single char */
+
+/************************************************************************/
+/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
+/* at least NUMREGBYTES*2 are needed for register packets */
+#define BUFMAX 2048
+
+static int initialized = 0; /* !0 means we've been initialized */
+static int remote_debug = 0; /* turn on verbose debugging */
+
+extern void breakinst();
+void _cprint();
+static void hw_breakpoint();
+static void set_mem_fault_trap();
+static void get_in_break_mode();
+static unsigned char *mem2hex();
+
+static const char hexchars[]="0123456789abcdef";
+
+#define NUMREGS 121
+
+static unsigned long saved_stack_pointer;
+
+/* Number of bytes of registers. */
+#define NUMREGBYTES (NUMREGS * 4)
+enum regnames { G0, G1, G2, G3, G4, G5, G6, G7,
+ O0, O1, O2, O3, O4, O5, SP, O7,
+ L0, L1, L2, L3, L4, L5, L6, L7,
+ I0, I1, I2, I3, I4, I5, FP, I7,
+
+ 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,
+
+ Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR,
+ CCSR, CCPR, CCCRCR, CCOR, CCOBR, CCIBR, CCIR, UNUSED1,
+
+ ASR1, ASR15, ASR17, ASR18, ASR19, ASR20, ASR21, ASR22,
+ /* the following not actually implemented */
+ AWR0, AWR1, AWR2, AWR3, AWR4, AWR5, AWR6, AWR7,
+ AWR8, AWR9, AWR10, AWR11, AWR12, AWR13, AWR14, AWR15,
+ AWR16, AWR17, AWR18, AWR19, AWR20, AWR21, AWR22, AWR23,
+ AWR24, AWR25, AWR26, AWR27, AWR28, AWR29, AWR30, AWR31,
+ APSR
+};
+
+/*************************** ASSEMBLY CODE MACROS *************************/
+/* */
+
+extern void trap_low();
+
+asm("
+ .reserve trapstack, 1000 * 4, \"bss\", 8
+
+ .data
+ .align 4
+
+in_trap_handler:
+ .word 0
+
+ .text
+ .align 4
+
+! This function is called when any SPARC trap (except window overflow or
+! underflow) occurs. It makes sure that the invalid register window is still
+! available before jumping into C code. It will also restore the world if you
+! return from handle_exception.
+!
+! On entry, trap_low expects l1 and l2 to contain pc and npc respectivly.
+
+ .globl _trap_low
+_trap_low:
+ mov %psr, %l0
+ mov %wim, %l3
+
+ srl %l3, %l0, %l4 ! wim >> cwp
+ and %l4, 0xff, %l4 ! Mask off windows 28, 29
+ cmp %l4, 1
+ bne window_fine ! Branch if not in the invalid window
+ nop
+
+! Handle window overflow
+
+ mov %g1, %l4 ! Save g1, we use it to hold the wim
+ srl %l3, 1, %g1 ! Rotate wim right
+ and %g1, 0xff, %g1 ! Mask off windows 28, 29
+ tst %g1
+ bg good_wim ! Branch if new wim is non-zero
+ nop
+
+! At this point, we need to bring a 1 into the high order bit of the wim.
+! Since we don't want to make any assumptions about the number of register
+! windows, we figure it out dynamically so as to setup the wim correctly.
+
+ ! The normal way doesn't work on the sparclet as register windows
+ ! 28 and 29 are special purpose windows.
+ !not %g1 ! Fill g1 with ones
+ !mov %g1, %wim ! Fill the wim with ones
+ !nop
+ !nop
+ !nop
+ !mov %wim, %g1 ! Read back the wim
+ !inc %g1 ! Now g1 has 1 just to left of wim
+ !srl %g1, 1, %g1 ! Now put 1 at top of wim
+
+ mov 0x80, %g1 ! Hack for sparclet
+
+ ! This doesn't work on the sparclet.
+ !mov %g0, %wim ! Clear wim so that subsequent save
+ ! won't trap
+ andn %l3, 0xff, %l5 ! Clear wim but not windows 28, 29
+ mov %l5, %wim
+ nop
+ nop
+ nop
+
+good_wim:
+ save %g0, %g0, %g0 ! Slip into next window
+ mov %g1, %wim ! Install the new wim
+
+ std %l0, [%sp + 0 * 4] ! save L & I registers
+ std %l2, [%sp + 2 * 4]
+ std %l4, [%sp + 4 * 4]
+ std %l6, [%sp + 6 * 4]
+
+ std %i0, [%sp + 8 * 4]
+ std %i2, [%sp + 10 * 4]
+ std %i4, [%sp + 12 * 4]
+ std %i6, [%sp + 14 * 4]
+
+ restore ! Go back to trap window.
+ mov %l4, %g1 ! Restore %g1
+
+window_fine:
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ tst %l5
+ bg recursive_trap
+ inc %l5
+
+ set trapstack+1000*4, %sp ! Switch to trap stack
+
+recursive_trap:
+ st %l5, [%lo(in_trap_handler) + %l4]
+ sub %sp,(16+1+6+1+88)*4,%sp ! Make room for input & locals
+ ! + hidden arg + arg spill
+ ! + doubleword alignment
+ ! + registers[121]
+
+ std %g0, [%sp + (24 + 0) * 4] ! registers[Gx]
+ std %g2, [%sp + (24 + 2) * 4]
+ std %g4, [%sp + (24 + 4) * 4]
+ std %g6, [%sp + (24 + 6) * 4]
+
+ std %i0, [%sp + (24 + 8) * 4] ! registers[Ox]
+ std %i2, [%sp + (24 + 10) * 4]
+ std %i4, [%sp + (24 + 12) * 4]
+ std %i6, [%sp + (24 + 14) * 4]
+
+ ! FP regs (sparclet doesn't have fpu)
+
+ mov %y, %l4
+ mov %tbr, %l5
+ st %l4, [%sp + (24 + 64) * 4] ! Y
+ st %l0, [%sp + (24 + 65) * 4] ! PSR
+ st %l3, [%sp + (24 + 66) * 4] ! WIM
+ st %l5, [%sp + (24 + 67) * 4] ! TBR
+ st %l1, [%sp + (24 + 68) * 4] ! PC
+ st %l2, [%sp + (24 + 69) * 4] ! NPC
+ ! CPSR and FPSR not impl
+ or %l0, 0xf20, %l4
+ mov %l4, %psr ! Turn on traps, disable interrupts
+ nop
+ nop
+ nop
+
+! Save coprocessor state.
+! See SK/demo/hdlc_demo/ldc_swap_context.S.
+
+ mov %psr, %l0
+ sethi %hi(0x2000), %l5 ! EC bit in PSR
+ or %l5, %l0, %l5
+ mov %l5, %psr ! enable coprocessor
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+ crdcxt %ccsr, %l1 ! capture CCSR
+ mov 0x6, %l2
+ cwrcxt %l2, %ccsr ! set CCP state machine for CCFR
+ crdcxt %ccfr, %l2 ! capture CCOR
+ cwrcxt %l2, %ccfr ! tickle CCFR
+ crdcxt %ccfr, %l3 ! capture CCOBR
+ cwrcxt %l3, %ccfr ! tickle CCFR
+ crdcxt %ccfr, %l4 ! capture CCIBR
+ cwrcxt %l4, %ccfr ! tickle CCFR
+ crdcxt %ccfr, %l5 ! capture CCIR
+ cwrcxt %l5, %ccfr ! tickle CCFR
+ crdcxt %ccpr, %l6 ! capture CCPR
+ crdcxt %cccrcr, %l7 ! capture CCCRCR
+ st %l1, [%sp + (24 + 72) * 4] ! save CCSR
+ st %l2, [%sp + (24 + 75) * 4] ! save CCOR
+ st %l3, [%sp + (24 + 76) * 4] ! save CCOBR
+ st %l4, [%sp + (24 + 77) * 4] ! save CCIBR
+ st %l5, [%sp + (24 + 78) * 4] ! save CCIR
+ st %l6, [%sp + (24 + 73) * 4] ! save CCPR
+ st %l7, [%sp + (24 + 74) * 4] ! save CCCRCR
+ mov %l0, %psr ! restore original PSR
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+
+! End of saving coprocessor state.
+! Save asr regs
+
+! Part of this is silly -- we should not display ASR15 or ASR19 at all.
+
+ sethi %hi(0x01000000), %l6
+ st %l6, [%sp + (24 + 81) * 4] ! ASR15 == NOP
+ sethi %hi(0xdeadc0de), %l6
+ or %l6, %lo(0xdeadc0de), %l6
+ st %l6, [%sp + (24 + 84) * 4] ! ASR19 == DEADC0DE
+
+ rd %asr1, %l4
+ st %l4, [%sp + (24 + 80) * 4]
+! rd %asr15, %l4 ! must not read ASR15
+! st %l4, [%sp + (24 + 81) * 4] ! (illegal instr trap)
+ rd %asr17, %l4
+ st %l4, [%sp + (24 + 82) * 4]
+ rd %asr18, %l4
+ st %l4, [%sp + (24 + 83) * 4]
+! rd %asr19, %l4 ! must not read asr19
+! st %l4, [%sp + (24 + 84) * 4] ! (halts the CPU)
+ rd %asr20, %l4
+ st %l4, [%sp + (24 + 85) * 4]
+ rd %asr21, %l4
+ st %l4, [%sp + (24 + 86) * 4]
+ rd %asr22, %l4
+ st %l4, [%sp + (24 + 87) * 4]
+
+! End of saving asr regs
+
+ call _handle_exception
+ add %sp, 24 * 4, %o0 ! Pass address of registers
+
+! Reload all of the registers that aren't on the stack
+
+ ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx]
+ ldd [%sp + (24 + 2) * 4], %g2
+ ldd [%sp + (24 + 4) * 4], %g4
+ ldd [%sp + (24 + 6) * 4], %g6
+
+ ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox]
+ ldd [%sp + (24 + 10) * 4], %i2
+ ldd [%sp + (24 + 12) * 4], %i4
+ ldd [%sp + (24 + 14) * 4], %i6
+
+ ! FP regs (sparclet doesn't have fpu)
+
+! Update the coprocessor registers.
+! See SK/demo/hdlc_demo/ldc_swap_context.S.
+
+ mov %psr, %l0
+ sethi %hi(0x2000), %l5 ! EC bit in PSR
+ or %l5, %l0, %l5
+ mov %l5, %psr ! enable coprocessor
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+
+ mov 0x6, %l2
+ cwrcxt %l2, %ccsr ! set CCP state machine for CCFR
+
+ ld [%sp + (24 + 72) * 4], %l1 ! saved CCSR
+ ld [%sp + (24 + 75) * 4], %l2 ! saved CCOR
+ ld [%sp + (24 + 76) * 4], %l3 ! saved CCOBR
+ ld [%sp + (24 + 77) * 4], %l4 ! saved CCIBR
+ ld [%sp + (24 + 78) * 4], %l5 ! saved CCIR
+ ld [%sp + (24 + 73) * 4], %l6 ! saved CCPR
+ ld [%sp + (24 + 74) * 4], %l7 ! saved CCCRCR
+
+ cwrcxt %l2, %ccfr ! restore CCOR
+ cwrcxt %l3, %ccfr ! restore CCOBR
+ cwrcxt %l4, %ccfr ! restore CCIBR
+ cwrcxt %l5, %ccfr ! restore CCIR
+ cwrcxt %l6, %ccpr ! restore CCPR
+ cwrcxt %l7, %cccrcr ! restore CCCRCR
+ cwrcxt %l1, %ccsr ! restore CCSR
+
+ mov %l0, %psr ! restore PSR
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+
+! End of coprocessor handling stuff.
+! Update asr regs
+
+ ld [%sp + (24 + 80) * 4], %l4
+ wr %l4, %asr1
+! ld [%sp + (24 + 81) * 4], %l4 ! can't write asr15
+! wr %l4, %asr15
+ ld [%sp + (24 + 82) * 4], %l4
+ wr %l4, %asr17
+ ld [%sp + (24 + 83) * 4], %l4
+ wr %l4, %asr18
+! ld [%sp + (24 + 84) * 4], %l4 ! can't write asr19
+! wr %l4, %asr19
+! ld [%sp + (24 + 85) * 4], %l4 ! can't write asr20
+! wr %l4, %asr20
+! ld [%sp + (24 + 86) * 4], %l4 ! can't write asr21
+! wr %l4, %asr21
+ ld [%sp + (24 + 87) * 4], %l4
+ wr %l4, %asr22
+
+! End of restoring asr regs
+
+
+ ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR
+ ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC
+
+ restore ! Ensure that previous window is valid
+ save %g0, %g0, %g0 ! by causing a window_underflow trap
+
+ mov %l0, %y
+ mov %l1, %psr ! Make sure that traps are disabled
+ ! for rett
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+
+ sethi %hi(in_trap_handler), %l4
+ ld [%lo(in_trap_handler) + %l4], %l5
+ dec %l5
+ st %l5, [%lo(in_trap_handler) + %l4]
+
+ jmpl %l2, %g0 ! Restore old PC
+ rett %l3 ! Restore old nPC
+");
+
+/* Convert ch from a hex digit to an int */
+
+static int
+hex (unsigned char ch)
+{
+ if (ch >= 'a' && ch <= 'f')
+ return ch-'a'+10;
+ if (ch >= '0' && ch <= '9')
+ return ch-'0';
+ if (ch >= 'A' && ch <= 'F')
+ return ch-'A'+10;
+ return -1;
+}
+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
+
+/* scan for the sequence $<data>#<checksum> */
+
+unsigned char *
+getpacket (void)
+{
+ unsigned char *buffer = &remcomInBuffer[0];
+ unsigned char checksum;
+ unsigned char xmitcsum;
+ int count;
+ char ch;
+
+ while (1)
+ {
+ /* wait around for the start character, ignore all other characters */
+ while ((ch = getDebugChar ()) != '$')
+ ;
+
+retry:
+ checksum = 0;
+ xmitcsum = -1;
+ count = 0;
+
+ /* now, read until a # or end of buffer is found */
+ while (count < BUFMAX)
+ {
+ ch = getDebugChar ();
+ if (ch == '$')
+ goto retry;
+ if (ch == '#')
+ break;
+ checksum = checksum + ch;
+ buffer[count] = ch;
+ count = count + 1;
+ }
+ buffer[count] = 0;
+
+ if (ch == '#')
+ {
+ ch = getDebugChar ();
+ xmitcsum = hex (ch) << 4;
+ ch = getDebugChar ();
+ xmitcsum += hex (ch);
+
+ if (checksum != xmitcsum)
+ {
+ putDebugChar ('-'); /* failed checksum */
+ }
+ else
+ {
+ putDebugChar ('+'); /* successful transfer */
+
+ /* if a sequence char is present, reply the sequence ID */
+ if (buffer[2] == ':')
+ {
+ putDebugChar (buffer[0]);
+ putDebugChar (buffer[1]);
+
+ return &buffer[3];
+ }
+
+ return &buffer[0];
+ }
+ }
+ }
+}
+
+/* send the packet in buffer. */
+
+static void
+putpacket (unsigned char *buffer)
+{
+ unsigned char checksum;
+ int count;
+ unsigned char ch;
+
+ /* $<packet info>#<checksum>. */
+ do
+ {
+ putDebugChar('$');
+ checksum = 0;
+ count = 0;
+
+ while (ch = buffer[count])
+ {
+ putDebugChar(ch);
+ checksum += ch;
+ count += 1;
+ }
+
+ putDebugChar('#');
+ putDebugChar(hexchars[checksum >> 4]);
+ putDebugChar(hexchars[checksum & 0xf]);
+
+ }
+ while (getDebugChar() != '+');
+}
+
+/* Indicate to caller of mem2hex or hex2mem that there has been an
+ error. */
+static volatile int mem_err = 0;
+
+/* Convert the memory pointed to by mem into hex, placing result in buf.
+ * Return a pointer to the last char put in buf (null), in case of mem fault,
+ * return 0.
+ * If MAY_FAULT is non-zero, then we will handle memory faults by returning
+ * a 0, else treat a fault like any other fault in the stub.
+ */
+
+static unsigned char *
+mem2hex (unsigned char *mem, unsigned char *buf, int count, int may_fault)
+{
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ while (count-- > 0)
+ {
+ ch = *mem++;
+ if (mem_err)
+ return 0;
+ *buf++ = hexchars[ch >> 4];
+ *buf++ = hexchars[ch & 0xf];
+ }
+
+ *buf = 0;
+
+ set_mem_fault_trap(0);
+
+ return buf;
+}
+
+/* convert the hex array pointed to by buf into binary to be placed in mem
+ * return a pointer to the character AFTER the last byte written */
+
+static char *
+hex2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
+{
+ int i;
+ unsigned char ch;
+
+ set_mem_fault_trap(may_fault);
+
+ for (i=0; i<count; i++)
+ {
+ ch = hex(*buf++) << 4;
+ ch |= hex(*buf++);
+ *mem++ = ch;
+ if (mem_err)
+ return 0;
+ }
+
+ set_mem_fault_trap(0);
+
+ return mem;
+}
+
+/* This table contains the mapping between SPARC hardware trap types, and
+ signals, which are primarily what GDB understands. It also indicates
+ which hardware traps we need to commandeer when initializing the stub. */
+
+static struct hard_trap_info
+{
+ unsigned char tt; /* Trap type code for SPARClite */
+ unsigned char signo; /* Signal that we map this trap into */
+} hard_trap_info[] = {
+ {1, SIGSEGV}, /* instruction access exception */
+ {0x3b, SIGSEGV}, /* instruction access error */
+ {2, SIGILL}, /* illegal instruction */
+ {3, SIGILL}, /* privileged instruction */
+ {4, SIGEMT}, /* fp disabled */
+ {0x24, SIGEMT}, /* cp disabled */
+ {7, SIGBUS}, /* mem address not aligned */
+ {0x29, SIGSEGV}, /* data access exception */
+ {10, SIGEMT}, /* tag overflow */
+ {128+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */
+ {0, 0} /* Must be last */
+};
+
+/* Set up exception handlers for tracing and breakpoints */
+
+void
+set_debug_traps (void)
+{
+ struct hard_trap_info *ht;
+
+ for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+ exceptionHandler(ht->tt, trap_low);
+
+ initialized = 1;
+}
+
+asm ("
+! Trap handler for memory errors. This just sets mem_err to be non-zero. It
+! assumes that %l1 is non-zero. This should be safe, as it is doubtful that
+! 0 would ever contain code that could mem fault. This routine will skip
+! past the faulting instruction after setting mem_err.
+
+ .text
+ .align 4
+
+_fltr_set_mem_err:
+ sethi %hi(_mem_err), %l0
+ st %l1, [%l0 + %lo(_mem_err)]
+ jmpl %l2, %g0
+ rett %l2+4
+");
+
+static void
+set_mem_fault_trap (int enable)
+{
+ extern void fltr_set_mem_err();
+ mem_err = 0;
+
+ if (enable)
+ exceptionHandler(0x29, fltr_set_mem_err);
+ else
+ exceptionHandler(0x29, trap_low);
+}
+
+asm ("
+ .text
+ .align 4
+
+_dummy_hw_breakpoint:
+ jmpl %l2, %g0
+ rett %l2+4
+ nop
+ nop
+");
+
+static void
+set_hw_breakpoint_trap (int enable)
+{
+ extern void dummy_hw_breakpoint();
+
+ if (enable)
+ exceptionHandler(255, dummy_hw_breakpoint);
+ else
+ exceptionHandler(255, trap_low);
+}
+
+static void
+get_in_break_mode (void)
+{
+#if 0
+ int x;
+ mesg("get_in_break_mode, sp = ");
+ phex(&x);
+#endif
+ set_hw_breakpoint_trap(1);
+
+ asm("
+ sethi %hi(0xff10), %l4
+ or %l4, %lo(0xff10), %l4
+ sta %g0, [%l4]0x1
+ nop
+ nop
+ nop
+ ");
+
+ set_hw_breakpoint_trap(0);
+}
+
+/* Convert the SPARC hardware trap type code to a unix signal number. */
+
+static int
+computeSignal (int tt)
+{
+ struct hard_trap_info *ht;
+
+ for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
+ if (ht->tt == tt)
+ return ht->signo;
+
+ return SIGHUP; /* default for things we don't know about */
+}
+
+/*
+ * While we find nice hex chars, build an int.
+ * Return number of chars processed.
+ */
+
+static int
+hexToInt(char **ptr, int *intValue)
+{
+ int numChars = 0;
+ int hexValue;
+
+ *intValue = 0;
+
+ while (**ptr)
+ {
+ hexValue = hex(**ptr);
+ if (hexValue < 0)
+ break;
+
+ *intValue = (*intValue << 4) | hexValue;
+ numChars ++;
+
+ (*ptr)++;
+ }
+
+ return (numChars);
+}
+
+/*
+ * This function does all command procesing for interfacing to gdb. It
+ * returns 1 if you should skip the instruction at the trap address, 0
+ * otherwise.
+ */
+
+static void
+handle_exception (unsigned long *registers)
+{
+ int tt; /* Trap type */
+ int sigval;
+ int addr;
+ int length;
+ char *ptr;
+ unsigned long *sp;
+ unsigned long dsr;
+
+/* First, we must force all of the windows to be spilled out */
+
+ asm("
+ ! Ugh. sparclet has broken save
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ !save %sp, -64, %sp
+ save
+ add %fp,-64,%sp
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+ restore
+");
+
+ if (registers[PC] == (unsigned long)breakinst)
+ {
+ registers[PC] = registers[NPC];
+ registers[NPC] += 4;
+ }
+ sp = (unsigned long *)registers[SP];
+
+ tt = (registers[TBR] >> 4) & 0xff;
+
+ /* reply to host that an exception has occurred */
+ sigval = computeSignal(tt);
+ ptr = remcomOutBuffer;
+
+ *ptr++ = 'T';
+ *ptr++ = hexchars[sigval >> 4];
+ *ptr++ = hexchars[sigval & 0xf];
+
+ *ptr++ = hexchars[PC >> 4];
+ *ptr++ = hexchars[PC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[FP >> 4];
+ *ptr++ = hexchars[FP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[SP >> 4];
+ *ptr++ = hexchars[SP & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&sp, ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[NPC >> 4];
+ *ptr++ = hexchars[NPC & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[NPC], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = hexchars[O7 >> 4];
+ *ptr++ = hexchars[O7 & 0xf];
+ *ptr++ = ':';
+ ptr = mem2hex((char *)&registers[O7], ptr, 4, 0);
+ *ptr++ = ';';
+
+ *ptr++ = 0;
+
+ putpacket(remcomOutBuffer);
+
+ while (1)
+ {
+ remcomOutBuffer[0] = 0;
+
+ ptr = getpacket();
+ switch (*ptr++)
+ {
+ case '?':
+ remcomOutBuffer[0] = 'S';
+ remcomOutBuffer[1] = hexchars[sigval >> 4];
+ remcomOutBuffer[2] = hexchars[sigval & 0xf];
+ remcomOutBuffer[3] = 0;
+ break;
+
+ case 'd':
+ remote_debug = !(remote_debug); /* toggle debug flag */
+ break;
+
+ case 'g': /* return the value of the CPU registers */
+ {
+ ptr = remcomOutBuffer;
+ ptr = mem2hex((char *)registers, ptr, 16 * 4, 0); /* G & O regs */
+ ptr = mem2hex(sp + 0, ptr, 16 * 4, 0); /* L & I regs */
+ memset(ptr, '0', 32 * 8); /* Floating point */
+ ptr = mem2hex((char *)&registers[Y],
+ ptr + 32 * 4 * 2,
+ 8 * 4,
+ 0); /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */
+ ptr = mem2hex((char *)&registers[CCSR],
+ ptr,
+ 8 * 4,
+ 0); /* CCSR, CCPR, CCCRCR, CCOR, CCOBR, CCIBR, CCIR */
+ ptr = mem2hex((char *)&registers[ASR1],
+ ptr,
+ 8 * 4,
+ 0); /* ASR1,ASR15,ASR17,ASR18,ASR19,ASR20,ASR21,ASR22 */
+#if 0 /* not implemented */
+ ptr = mem2hex((char *) &registers[AWR0],
+ ptr,
+ 32 * 4,
+ 0); /* Alternate Window Registers */
+#endif
+ }
+ break;
+
+ case 'G': /* set value of all the CPU registers - return OK */
+ case 'P': /* set value of one CPU register - return OK */
+ {
+ unsigned long *newsp, psr;
+
+ psr = registers[PSR];
+
+ if (ptr[-1] == 'P') /* do a single register */
+ {
+ int regno;
+
+ if (hexToInt (&ptr, &regno)
+ && *ptr++ == '=')
+ if (regno >= L0 && regno <= I7)
+ hex2mem (ptr, sp + regno - L0, 4, 0);
+ else
+ hex2mem (ptr, (char *)&registers[regno], 4, 0);
+ else
+ {
+ strcpy (remcomOutBuffer, "E01");
+ break;
+ }
+ }
+ else
+ {
+ hex2mem(ptr, (char *)registers, 16 * 4, 0); /* G & O regs */
+ hex2mem(ptr + 16 * 4 * 2, sp + 0, 16 * 4, 0); /* L & I regs */
+ hex2mem(ptr + 64 * 4 * 2, (char *)&registers[Y],
+ 8 * 4, 0); /* Y,PSR,WIM,TBR,PC,NPC,FPSR,CPSR */
+ hex2mem(ptr + 72 * 4 * 2, (char *)&registers[CCSR],
+ 8 * 4, 0); /* CCSR,CCPR,CCCRCR,CCOR,CCOBR,CCIBR,CCIR */
+ hex2mem(ptr + 80 * 4 * 2, (char *)&registers[ASR1],
+ 8 * 4, 0); /* ASR1 ... ASR22 */
+#if 0 /* not implemented */
+ hex2mem(ptr + 88 * 4 * 2, (char *)&registers[AWR0],
+ 8 * 4, 0); /* Alternate Window Registers */
+#endif
+ }
+ /* See if the stack pointer has moved. If so, then copy the saved
+ locals and ins to the new location. This keeps the window
+ overflow and underflow routines happy. */
+
+ newsp = (unsigned long *)registers[SP];
+ if (sp != newsp)
+ sp = memcpy(newsp, sp, 16 * 4);
+
+ /* Don't allow CWP to be modified. */
+
+ if (psr != registers[PSR])
+ registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f);
+
+ strcpy(remcomOutBuffer,"OK");
+ }
+ break;
+
+ case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
+ /* Try to read %x,%x. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length))
+ {
+ if (mem2hex((char *)addr, remcomOutBuffer, length, 1))
+ break;
+
+ strcpy (remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer,"E01");
+ break;
+
+ case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
+ /* Try to read '%x,%x:'. */
+
+ if (hexToInt(&ptr, &addr)
+ && *ptr++ == ','
+ && hexToInt(&ptr, &length)
+ && *ptr++ == ':')
+ {
+ if (hex2mem(ptr, (char *)addr, length, 1))
+ strcpy(remcomOutBuffer, "OK");
+ else
+ strcpy(remcomOutBuffer, "E03");
+ }
+ else
+ strcpy(remcomOutBuffer, "E02");
+ break;
+
+ case 'c': /* cAA..AA Continue at address AA..AA(optional) */
+ /* try to read optional parameter, pc unchanged if no parm */
+
+ if (hexToInt(&ptr, &addr))
+ {
+ registers[PC] = addr;
+ registers[NPC] = addr + 4;
+ }
+
+/* Need to flush the instruction cache here, as we may have deposited a
+ breakpoint, and the icache probably has no way of knowing that a data ref to
+ some location may have changed something that is in the instruction cache.
+ */
+
+ flush_i_cache();
+ return;
+
+ /* kill the program */
+ case 'k' : /* do nothing */
+ break;
+#if 0
+ case 't': /* Test feature */
+ asm (" std %f30,[%sp]");
+ break;
+#endif
+ case 'r': /* Reset */
+ asm ("call 0
+ nop ");
+ break;
+ } /* switch */
+
+ /* reply to the request */
+ putpacket(remcomOutBuffer);
+ }
+}
+
+/* This function will generate a breakpoint exception. It is used at the
+ beginning of a program to sync up with a debugger and can be used
+ otherwise as a quick means to stop program execution and "break" into
+ the debugger. */
+
+void
+breakpoint (void)
+{
+ if (!initialized)
+ return;
+
+ asm(" .globl _breakinst
+
+ _breakinst: ta 1
+ ");
+}
+
+static void
+hw_breakpoint (void)
+{
+ asm("
+ ta 127
+ ");
+}
+
+#if 0 /* experimental and never finished, left here for reference */
+static void
+splet_temp(void)
+{
+ asm(" sub %sp,(16+1+6+1+121)*4,%sp ! Make room for input & locals
+ ! + hidden arg + arg spill
+ ! + doubleword alignment
+ ! + registers[121]
+
+! Leave a trail of breadcrumbs! (save register save area for debugging)
+ mov %sp, %l0
+ add %l0, 24*4, %l0
+ sethi %hi(_debug_registers), %l1
+ st %l0, [%lo(_debug_registers) + %l1]
+
+! Save the Alternate Register Set: (not implemented yet)
+! To save the Alternate Register set, we must:
+! 1) Save the current SP in some global location.
+! 2) Swap the register sets.
+! 3) Save the Alternate SP in the Y register
+! 4) Fetch the SP that we saved in step 1.
+! 5) Use that to save the rest of the regs (not forgetting ASP in Y)
+! 6) Restore the Alternate SP from Y
+! 7) Swap the registers back.
+
+! 1) Copy the current stack pointer to global _SAVED_STACK_POINTER:
+ sethi %hi(_saved_stack_pointer), %l0
+ st %sp, [%lo(_saved_stack_pointer) + %l0]
+
+! 2) Swap the register sets:
+ mov %psr, %l1
+ sethi %hi(0x10000), %l2
+ xor %l1, %l2, %l1
+ mov %l1, %psr
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+
+! 3) Save Alternate L0 in Y
+ wr %l0, 0, %y
+
+! 4) Load former SP into alternate SP, using L0
+ sethi %hi(_saved_stack_pointer), %l0
+ or %lo(_saved_stack_pointer), %l0, %l0
+ swap [%l0], %sp
+
+! 4.5) Restore alternate L0
+ rd %y, %l0
+
+! 5) Save the Alternate Window Registers
+ st %r0, [%sp + (24 + 88) * 4] ! AWR0
+ st %r1, [%sp + (24 + 89) * 4] ! AWR1
+ st %r2, [%sp + (24 + 90) * 4] ! AWR2
+ st %r3, [%sp + (24 + 91) * 4] ! AWR3
+ st %r4, [%sp + (24 + 92) * 4] ! AWR4
+ st %r5, [%sp + (24 + 93) * 4] ! AWR5
+ st %r6, [%sp + (24 + 94) * 4] ! AWR6
+ st %r7, [%sp + (24 + 95) * 4] ! AWR7
+ st %r8, [%sp + (24 + 96) * 4] ! AWR8
+ st %r9, [%sp + (24 + 97) * 4] ! AWR9
+ st %r10, [%sp + (24 + 98) * 4] ! AWR10
+ st %r11, [%sp + (24 + 99) * 4] ! AWR11
+ st %r12, [%sp + (24 + 100) * 4] ! AWR12
+ st %r13, [%sp + (24 + 101) * 4] ! AWR13
+! st %r14, [%sp + (24 + 102) * 4] ! AWR14 (SP)
+ st %r15, [%sp + (24 + 103) * 4] ! AWR15
+ st %r16, [%sp + (24 + 104) * 4] ! AWR16
+ st %r17, [%sp + (24 + 105) * 4] ! AWR17
+ st %r18, [%sp + (24 + 106) * 4] ! AWR18
+ st %r19, [%sp + (24 + 107) * 4] ! AWR19
+ st %r20, [%sp + (24 + 108) * 4] ! AWR20
+ st %r21, [%sp + (24 + 109) * 4] ! AWR21
+ st %r22, [%sp + (24 + 110) * 4] ! AWR22
+ st %r23, [%sp + (24 + 111) * 4] ! AWR23
+ st %r24, [%sp + (24 + 112) * 4] ! AWR24
+ st %r25, [%sp + (24 + 113) * 4] ! AWR25
+ st %r26, [%sp + (24 + 114) * 4] ! AWR26
+ st %r27, [%sp + (24 + 115) * 4] ! AWR27
+ st %r28, [%sp + (24 + 116) * 4] ! AWR28
+ st %r29, [%sp + (24 + 117) * 4] ! AWR29
+ st %r30, [%sp + (24 + 118) * 4] ! AWR30
+ st %r31, [%sp + (24 + 119) * 4] ! AWR21
+
+! Get the Alternate PSR (I hope...)
+
+ rd %psr, %l2
+ st %l2, [%sp + (24 + 120) * 4] ! APSR
+
+! Don't forget the alternate stack pointer
+
+ rd %y, %l3
+ st %l3, [%sp + (24 + 102) * 4] ! AWR14 (SP)
+
+! 6) Restore the Alternate SP (saved in Y)
+
+ rd %y, %o6
+
+
+! 7) Swap the registers back:
+
+ mov %psr, %l1
+ sethi %hi(0x10000), %l2
+ xor %l1, %l2, %l1
+ mov %l1, %psr
+ nop ! 3 nops after write to %psr (needed?)
+ nop
+ nop
+");
+}
+
+#endif
diff --git a/contrib/gdb/gdb/stabsread.c b/contrib/gdb/gdb/stabsread.c
index c5d31e1..5b11546 100644
--- a/contrib/gdb/gdb/stabsread.c
+++ b/contrib/gdb/gdb/stabsread.c
@@ -1,22 +1,24 @@
/* 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.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -41,14 +43,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "demangle.h"
#include "language.h"
+#include "doublest.h"
#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
+extern void _initialize_stabsread (void);
+
/* The routines that read and process a complete stabs for a C struct or
C++ class pass lists of data member fields and lists of member function
fields in an instance of a field_info structure, as defined below.
@@ -56,191 +62,184 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
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 *));
+read_one_struct_field (struct field_info *, char **, char *,
+ struct type *, struct objfile *);
-static char *
-get_substring PARAMS ((char **, int));
+static char *get_substring (char **, int);
-static struct type *
-dbx_alloc_type PARAMS ((int [2], struct objfile *));
+static struct type *dbx_alloc_type (int[2], struct objfile *);
-static long read_huge_number PARAMS ((char **, int, int *));
+static long read_huge_number (char **, int, int *);
-static struct type *error_type PARAMS ((char **, struct objfile *));
+static struct type *error_type (char **, struct objfile *);
static void
-patch_block_stabs PARAMS ((struct pending *, struct pending_stabs *,
- struct objfile *));
+patch_block_stabs (struct pending *, struct pending_stabs *,
+ struct objfile *);
-static void
-fix_common_block PARAMS ((struct symbol *, int));
+static void fix_common_block (struct symbol *, int);
-static int
-read_type_number PARAMS ((char **, int *));
+static int read_type_number (char **, int *);
-static struct type *
-read_range_type PARAMS ((char **, int [2], struct objfile *));
+static struct type *read_range_type (char **, int[2], struct objfile *);
-static struct type *
-read_sun_builtin_type PARAMS ((char **, int [2], struct objfile *));
+static struct type *read_sun_builtin_type (char **, int[2], struct objfile *);
-static struct type *
-read_sun_floating_type PARAMS ((char **, int [2], struct objfile *));
+static struct type *read_sun_floating_type (char **, int[2],
+ struct objfile *);
-static struct type *
-read_enum_type PARAMS ((char **, struct type *, struct objfile *));
+static struct type *read_enum_type (char **, struct type *, struct objfile *);
-static struct type *
-rs6000_builtin_type PARAMS ((int));
+static struct type *rs6000_builtin_type (int);
static int
-read_member_functions PARAMS ((struct field_info *, char **, struct type *,
- struct objfile *));
+read_member_functions (struct field_info *, char **, struct type *,
+ struct objfile *);
static int
-read_struct_fields PARAMS ((struct field_info *, char **, struct type *,
- struct objfile *));
+read_struct_fields (struct field_info *, char **, struct type *,
+ struct objfile *);
static int
-read_baseclasses PARAMS ((struct field_info *, char **, struct type *,
- struct objfile *));
+read_baseclasses (struct field_info *, char **, struct type *,
+ struct objfile *);
static int
-read_tilde_fields PARAMS ((struct field_info *, char **, struct type *,
- struct objfile *));
+read_tilde_fields (struct field_info *, char **, struct type *,
+ struct objfile *);
-static int
-attach_fn_fields_to_type PARAMS ((struct field_info *, struct type *));
+static int attach_fn_fields_to_type (struct field_info *, struct type *);
static int
-attach_fields_to_type PARAMS ((struct field_info *, struct type *,
- struct objfile *));
+attach_fields_to_type (struct field_info *, struct type *, struct objfile *);
-static struct type *
-read_struct_type PARAMS ((char **, struct type *, struct objfile *));
+static struct type *read_struct_type (char **, struct type *,
+ struct objfile *);
-static struct type *
-read_array_type PARAMS ((char **, struct type *, struct objfile *));
+static struct type *read_array_type (char **, struct type *,
+ struct objfile *);
-static struct type **
-read_args PARAMS ((char **, int, struct objfile *));
+static struct type **read_args (char **, int, struct objfile *);
static int
-read_cpp_abbrev PARAMS ((struct field_info *, char **, struct type *,
- struct objfile *));
+read_cpp_abbrev (struct field_info *, char **, struct type *,
+ struct objfile *);
/* new functions added for cfront support */
static int
-copy_cfront_struct_fields PARAMS ((struct field_info *, struct type *,
- struct objfile *));
+copy_cfront_struct_fields (struct field_info *, struct type *,
+ struct objfile *);
-static char *
-get_cfront_method_physname PARAMS ((char *));
+static char *get_cfront_method_physname (char *);
static int
-read_cfront_baseclasses PARAMS ((struct field_info *, char **,
- struct type *, struct objfile *));
+read_cfront_baseclasses (struct field_info *, char **,
+ struct type *, struct objfile *);
static int
-read_cfront_static_fields PARAMS ((struct field_info *, char**,
- struct type *, struct objfile *));
+read_cfront_static_fields (struct field_info *, char **,
+ struct type *, struct objfile *);
static int
-read_cfront_member_functions PARAMS ((struct field_info *, char **,
- struct type *, struct objfile *));
+read_cfront_member_functions (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 *,
- CORE_ADDR, CORE_ADDR));
+add_live_range (struct objfile *, struct symbol *, CORE_ADDR, CORE_ADDR);
-static int
-resolve_live_range PARAMS ((struct objfile *, struct symbol *, char *));
+static int resolve_live_range (struct objfile *, struct symbol *, char *);
-static int
-process_reference PARAMS ((char **string));
+static int process_reference (char **string);
-static CORE_ADDR
-ref_search_value PARAMS ((int refnum));
+static CORE_ADDR ref_search_value (int refnum);
static int
-resolve_symbol_reference PARAMS ((struct objfile *, struct symbol *, char *));
+resolve_symbol_reference (struct objfile *, struct symbol *, char *);
+
+void stabsread_clear_cache (void);
-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
address of the corresponding int, which is not the same on a
big-endian machine. */
-#ifndef BELIEVE_PCC_PROMOTION
+#if !defined (BELIEVE_PCC_PROMOTION)
#define BELIEVE_PCC_PROMOTION 0
#endif
+#if !defined (BELIEVE_PCC_PROMOTION_TYPE)
+#define BELIEVE_PCC_PROMOTION_TYPE 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};
+{"couldn't parse type; debugger out of date?", 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. */
@@ -258,30 +257,30 @@ static struct symbol *current_symbol = NULL;
/* 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 (struct type **);
static void
-os9k_init_type_vector(tv)
- struct type **tv;
+os9k_init_type_vector (struct type **tv)
{
- int i;
- for (i=0; i<sizeof(os9k_type_vector)/sizeof(struct type **); i++)
+ unsigned int i;
+ for (i = 0; i < sizeof (os9k_type_vector) / sizeof (struct type **); i++)
tv[i] = (os9k_type_vector[i] == 0 ? 0 : *(os9k_type_vector[i]));
}
@@ -293,8 +292,7 @@ os9k_init_type_vector(tv)
or for associating a new type with the pair. */
struct type **
-dbx_lookup_type (typenums)
- int typenums[2];
+dbx_lookup_type (int typenums[2])
{
register int filenum = typenums[0];
register int index = typenums[1];
@@ -308,9 +306,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;
}
@@ -326,12 +325,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;
@@ -400,9 +399,7 @@ Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
put into the type vector, and so may not be referred to by number. */
static struct type *
-dbx_alloc_type (typenums, objfile)
- int typenums[2];
- struct objfile *objfile;
+dbx_alloc_type (int typenums[2], struct objfile *objfile)
{
register struct type **type_addr;
@@ -428,10 +425,8 @@ dbx_alloc_type (typenums, objfile)
and fix their symbols in given symbol vector. */
static void
-patch_block_stabs (symbols, stabs, objfile)
- struct pending *symbols;
- struct pending_stabs *stabs;
- struct objfile *objfile;
+patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
+ struct objfile *objfile)
{
int ii;
char *name;
@@ -440,33 +435,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));
@@ -477,7 +472,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.
@@ -494,7 +489,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));
@@ -507,8 +502,8 @@ patch_block_stabs (symbols, stabs, objfile)
}
}
}
-
+
/* 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).
@@ -518,32 +513,29 @@ patch_block_stabs (symbols, stabs, objfile)
Returns 0 for success, -1 for error. */
static int
-read_type_number (pp, typenums)
- register char **pp;
- register int *typenums;
+read_type_number (register char **pp, register int *typenums)
{
int nbits;
if (**pp == '(')
{
(*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;
}
-
-#if !defined (REG_STRUCT_HAS_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) 0
-#endif
#define VISIBILITY_PRIVATE '0' /* Stabs character for private field */
#define VISIBILITY_PROTECTED '1' /* Stabs character for protected fld */
@@ -558,20 +550,18 @@ read_type_number (pp, typenums)
/* Get substring from string up to char c, advance string pointer past
suibstring. */
-static char *
-get_substring (p, c)
- char ** p;
- int c;
+static char *
+get_substring (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;
}
@@ -581,23 +571,22 @@ 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 *
-get_cfront_method_physname (fname)
- char *fname;
+static char *
+get_cfront_method_physname (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))
@@ -612,27 +601,26 @@ 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 (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
- 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;
@@ -648,12 +636,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 */
{
@@ -668,89 +656,90 @@ read_cfront_baseclasses (fip, pp, type, objfile)
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
- make_cleanup (free, new);
+ make_cleanup (xfree, 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,
@@ -763,17 +752,14 @@ 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)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_cfront_member_functions (struct field_info *fip, char **pp,
+ struct type *type, struct objfile *objfile)
{
/* This code extracted from read_member_functions
so as to do the similar thing for our funcs */
@@ -789,171 +775,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));
- make_cleanup (free, new_fnlist);
+ xmalloc (sizeof (struct next_fnfieldlist));
+ make_cleanup (xfree, 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 (xfree, 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_STUB (new_sublist->fn_field.type))
+ {
+ 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;
}
@@ -975,13 +963,11 @@ read_cfront_member_functions (fip, pp, type, objfile)
to add information such as methods to classes.
Examples of "p": "sA;;__ct__1AFv foo__1AFv ;;;" */
int
-resolve_cfront_continuation (objfile, sym, p)
- struct objfile * objfile;
- struct symbol * sym;
- char * p;
+resolve_cfront_continuation (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;
@@ -990,7 +976,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.
@@ -998,23 +984,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++
@@ -1023,22 +1009,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 */
@@ -1047,29 +1033,26 @@ resolve_cfront_continuation (objfile, sym, p)
symbol definition. Returns 0 on failure, non-zero on success. */
static int
-resolve_symbol_reference (objfile, sym, p)
- struct objfile *objfile;
- struct symbol *sym;
- char *p;
+resolve_symbol_reference (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. */
@@ -1091,26 +1074,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));
@@ -1139,11 +1122,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;
@@ -1163,24 +1146,30 @@ 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;
+/* This file maintains a cache of stabs aliases found in the symbol
+ table. If the symbol table changes, this cache must be cleared
+ or we are left holding onto data in invalid obstacks. */
+void
+stabsread_clear_cache (void)
+{
+ ref_count = 0;
+ ref_chunk = 0;
+}
+
/* Create array of pointers mapping refids to symbols and stab strings.
Add pointers to reference definition symbols and/or their values as we
find them, using their reference numbers as our index.
These will be used later when we resolve references. */
void
-ref_add (refnum, sym, stabs, value)
- int refnum;
- struct symbol *sym;
- char *stabs;
- CORE_ADDR value;
+ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
{
if (ref_count == 0)
ref_chunk = 0;
@@ -1188,7 +1177,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));
@@ -1202,8 +1191,7 @@ ref_add (refnum, sym, stabs, value)
/* Return defined sym for the reference REFNUM. */
struct symbol *
-ref_search (refnum)
- int refnum;
+ref_search (int refnum)
{
if (refnum < 0 || refnum > ref_count)
return 0;
@@ -1213,27 +1201,25 @@ ref_search (refnum)
/* Return value for the reference REFNUM. */
static CORE_ADDR
-ref_search_value (refnum)
- int refnum;
+ref_search_value (int refnum)
{
if (refnum < 0 || refnum > ref_count)
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
-process_reference (string)
- char **string;
+static int
+process_reference (char **string)
{
char *p;
int refnum = 0;
- if (**string != '#')
- return 0;
-
+ if (**string != '#')
+ return 0;
+
/* Advance beyond the initial '#'. */
p = *string + 1;
@@ -1251,8 +1237,7 @@ process_reference (string)
definition for later use. Return the reference number. */
int
-symbol_reference_defined (string)
- char **string;
+symbol_reference_defined (char **string)
{
char *p = *string;
int refnum = 0;
@@ -1260,9 +1245,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;
}
@@ -1277,12 +1262,8 @@ symbol_reference_defined (string)
/* ARGSUSED */
struct symbol *
-define_symbol (valu, string, desc, type, objfile)
- CORE_ADDR valu;
- char *string;
- int desc;
- int type;
- struct objfile *objfile;
+define_symbol (CORE_ADDR valu, char *string, int desc, int type,
+ struct objfile *objfile)
{
register struct symbol *sym;
char *p = (char *) strchr (string, ':');
@@ -1307,40 +1288,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 (objfile);
break;
case N_DATA:
- SYMBOL_SECTION(sym) = SECT_OFF_DATA;
+ SYMBOL_SECTION (sym) = SECT_OFF_DATA (objfile);
break;
case N_BSS:
- SYMBOL_SECTION(sym) = SECT_OFF_BSS;
+ SYMBOL_SECTION (sym) = SECT_OFF_BSS (objfile);
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]))
@@ -1348,33 +1329,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] == '#')
@@ -1384,26 +1365,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);
@@ -1413,8 +1393,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);
@@ -1426,14 +1406,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);
@@ -1445,9 +1425,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);
}
@@ -1474,11 +1454,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;
@@ -1509,9 +1489,9 @@ 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);
+ store_typed_floating (dbl_valu, SYMBOL_TYPE (sym), d);
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
}
@@ -1539,7 +1519,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;
@@ -1599,8 +1579,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));
@@ -1635,20 +1615,21 @@ 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;
+ TYPE_FIELD_TYPE (ftype, nparams) = ptype;
+ TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
}
TYPE_NFIELDS (ftype) = nparams;
TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED;
@@ -1665,28 +1646,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);
@@ -1705,13 +1686,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
@@ -1721,7 +1702,7 @@ define_symbol (valu, string, desc, type, objfile)
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
add_symbol_to_list (sym, &local_symbols);
- if (TARGET_BYTE_ORDER != BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
{
/* On little-endian machines, this crud is never necessary,
and, if the extra bytes contain garbage, is harmful. */
@@ -1732,80 +1713,80 @@ define_symbol (valu, string, desc, type, objfile)
if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION)
break;
-#if !BELIEVE_PCC_PROMOTION
- {
- /* This is the signed type which arguments get promoted to. */
- 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 defined(BELIEVE_PCC_PROMOTION_TYPE)
- /* This macro 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. */
-
- 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))
- {
- SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type)
- - TYPE_LENGTH (SYMBOL_TYPE (sym));
- }
- break;
-
-#else /* no BELIEVE_PCC_PROMOTION_TYPE. */
-
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
- && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
- {
- SYMBOL_TYPE (sym) =
- TYPE_UNSIGNED (SYMBOL_TYPE (sym))
- ? pcc_unsigned_promotion_type
- : pcc_promotion_type;
- }
- break;
-
-#endif /* no BELIEVE_PCC_PROMOTION_TYPE. */
- }
-#endif /* !BELIEVE_PCC_PROMOTION. */
+ if (!BELIEVE_PCC_PROMOTION)
+ {
+ /* This is the signed type which arguments get promoted to. */
+ 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. */
+
+ 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))
+ {
+ SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type)
+ - TYPE_LENGTH (SYMBOL_TYPE (sym));
+ }
+ break;
+ }
+ else
+ {
+ /* If PCC says a parameter is a short or a char,
+ it is really an int. */
+ if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
+ && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
+ {
+ SYMBOL_TYPE (sym) =
+ TYPE_UNSIGNED (SYMBOL_TYPE (sym))
+ ? pcc_unsigned_promotion_type
+ : pcc_promotion_type;
+ }
+ break;
+ }
+ }
case 'P':
/* acc seems to use P to declare the prototypes of functions that
@@ -1816,18 +1797,19 @@ 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. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- if (SYMBOL_VALUE (sym) >= NUM_REGS)
+ if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
+ complain (&reg_value_complaint, SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_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);
@@ -1838,11 +1820,12 @@ define_symbol (valu, string, desc, type, objfile)
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGISTER;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- if (SYMBOL_VALUE (sym) >= NUM_REGS)
+ if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
+ complain (&reg_value_complaint, SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_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)
@@ -1860,13 +1843,14 @@ 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. */
if (local_symbols
&& local_symbols->nsyms > 0
#ifndef USE_REGISTER_NOT_ARG
+ && REG_STRUCT_HAS_ADDR_P ()
&& REG_STRUCT_HAS_ADDR (processing_gcc_compilation,
SYMBOL_TYPE (sym))
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
@@ -1874,13 +1858,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
@@ -1891,10 +1875,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':
@@ -1904,15 +1888,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);
@@ -1922,16 +1906,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)
@@ -1956,23 +1941,44 @@ 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. */
+ /* ezannoni: 2000-10-26. This seems to apply for
+ versions of gcc older than 2.8. This was the original
+ problem: with the following code gdb would tell that
+ the type for name1 is caddr_t, and func is char()
+ typedef char *caddr_t;
+ char *name2;
+ struct x
+ {
+ char *name1;
+ } xx;
+ char *func()
+ {
+ }
+ main () {}
+ */
+
+ /* Pascal accepts names for pointer types. */
+ if (current_subfile->language == language_pascal)
+ {
+ TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NAME (sym);
+ }
}
else
TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NAME (sym);
@@ -1983,44 +1989,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;
@@ -2032,15 +2039,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)
@@ -2063,11 +2070,12 @@ define_symbol (valu, string, desc, type, objfile)
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- if (SYMBOL_VALUE (sym) >= NUM_REGS)
+ if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
+ complain (&reg_value_complaint, SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_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);
@@ -2075,9 +2083,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;
@@ -2085,25 +2093,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 */
@@ -2122,7 +2130,8 @@ define_symbol (valu, string, desc, type, objfile)
/* When passing structures to a function, some systems sometimes pass
the address in a register, not the structure itself. */
- if (REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
+ if (REG_STRUCT_HAS_ADDR_P ()
+ && REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
&& (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
{
struct type *symbol_type = check_typedef (SYMBOL_TYPE (sym));
@@ -2147,10 +2156,10 @@ define_symbol (valu, string, desc, type, objfile)
while (*p && *p == ';')
{
p++;
- if (*p && *p == 'l')
- {
- /* GNU extensions for live range splitting may be appended to
- the end of the stab string. eg. "l(#1,#2);l(#3,#5)" */
+ 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)" */
/* Resolve the live range and add it to SYM's live range list. */
if (!resolve_live_range (objfile, sym, p))
@@ -2158,13 +2167,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;
}
@@ -2173,10 +2182,7 @@ define_symbol (valu, string, desc, type, objfile)
non-zero on success, zero otherwise. */
static int
-resolve_live_range (objfile, sym, p)
- struct objfile *objfile;
- struct symbol *sym;
- char *p;
+resolve_live_range (struct objfile *objfile, struct symbol *sym, char *p)
{
int refnum;
CORE_ADDR start, end;
@@ -2195,7 +2201,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
@@ -2244,10 +2250,8 @@ resolve_live_range (objfile, sym, p)
in objfile OBJFILE. */
static void
-add_live_range (objfile, sym, start, end)
- struct objfile *objfile;
- struct symbol *sym;
- CORE_ADDR start, end;
+add_live_range (struct objfile *objfile, struct symbol *sym, CORE_ADDR start,
+ CORE_ADDR end)
{
struct range_list *r, *rs;
@@ -2259,7 +2263,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;
@@ -2276,8 +2280,8 @@ add_live_range (objfile, sym, start, end)
rs->next = r;
}
}
-
+
/* Skip rest of this symbol and return an error type.
General notes on error recovery: error_type always skips to the
@@ -2285,7 +2289,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
@@ -2293,24 +2297,22 @@ 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
debugger will be able to read the new symbol tables. */
static struct type *
-error_type (pp, objfile)
- char **pp;
- struct objfile *objfile;
+error_type (char **pp, struct objfile *objfile)
{
complain (&error_type_complaint);
while (1)
@@ -2333,8 +2335,8 @@ error_type (pp, objfile)
}
return (builtin_type_error);
}
-
+
/* 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
@@ -2342,9 +2344,7 @@ error_type (pp, objfile)
deciding whether to call read_type. */
struct type *
-read_type (pp, objfile)
- register char **pp;
- struct objfile *objfile;
+read_type (register char **pp, struct objfile *objfile)
{
register struct type *type = 0;
struct type *type1;
@@ -2367,27 +2367,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)
{
@@ -2398,13 +2398,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])
{
@@ -2422,13 +2422,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)
@@ -2449,15 +2449,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;
@@ -2479,7 +2479,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;
}
@@ -2493,14 +2493,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':
@@ -2515,13 +2515,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". */
@@ -2530,7 +2531,13 @@ read_type (pp, objfile)
}
else if (type_size >= 0 || is_string)
{
- *type = *xtype;
+ /* This is the absolute wrong way to construct types. Every
+ other debug format has found a way around this problem and
+ the related problems with unnecessarily stubbed types;
+ someone motivated should attempt to clean up the issue
+ here as well. Once a type pointed to has been created it
+ should not be modified. */
+ replace_type (type, xtype);
TYPE_NAME (type) = NULL;
TYPE_TAG_NAME (type) = NULL;
}
@@ -2542,24 +2549,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.
@@ -2569,38 +2576,116 @@ 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 'g': /* Prototyped function. (Sun) */
+ {
+ /* Unresolved questions:
+
+ - According to Sun's ``STABS Interface Manual'', for 'f'
+ and 'F' symbol descriptors, a `0' in the argument type list
+ indicates a varargs function. But it doesn't say how 'g'
+ type descriptors represent that info. Someone with access
+ to Sun's toolchain should try it out.
+
+ - According to the comment in define_symbol (search for
+ `process_prototype_types:'), Sun emits integer arguments as
+ types which ref themselves --- like `void' types. Do we
+ have to deal with that here, too? Again, someone with
+ access to Sun's toolchain should try it out and let us
+ know. */
+
+ const char *type_start = (*pp) - 1;
+ struct type *return_type = read_type (pp, objfile);
+ struct type *func_type
+ = make_function_type (return_type, dbx_lookup_type (typenums));
+ struct type_list {
+ struct type *type;
+ struct type_list *next;
+ } *arg_types = 0;
+ int num_args = 0;
+
+ while (**pp && **pp != '#')
+ {
+ struct type *arg_type = read_type (pp, objfile);
+ struct type_list *new = alloca (sizeof (*new));
+ new->type = arg_type;
+ new->next = arg_types;
+ arg_types = new;
+ num_args++;
+ }
+ if (**pp == '#')
+ ++*pp;
+ else
+ {
+ static struct complaint msg = {
+ "Prototyped function type didn't end arguments with `#':\n%s",
+ 0, 0
+ };
+ complain (&msg, type_start);
+ }
+
+ /* If there is just one argument whose type is `void', then
+ that's just an empty argument list. */
+ if (arg_types
+ && ! arg_types->next
+ && TYPE_CODE (arg_types->type) == TYPE_CODE_VOID)
+ num_args = 0;
+
+ TYPE_FIELDS (func_type)
+ = (struct field *) TYPE_ALLOC (func_type,
+ num_args * sizeof (struct field));
+ memset (TYPE_FIELDS (func_type), 0, num_args * sizeof (struct field));
+ {
+ int i;
+ struct type_list *t;
+
+ /* We stuck each argument type onto the front of the list
+ when we read it, so the list is reversed. Build the
+ fields array right-to-left. */
+ for (t = arg_types, i = num_args - 1; t; t = t->next, i--)
+ TYPE_FIELD_TYPE (func_type, i) = t->type;
+ }
+ TYPE_NFIELDS (func_type) = num_args;
+ TYPE_FLAGS (func_type) |= TYPE_FLAG_PROTOTYPED;
+
+ type = func_type;
+ break;
+ }
+
+ 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. */
+ type = make_cv_type (1, TYPE_VOLATILE (type), type,
+ dbx_lookup_type (typenums));
break;
- case 'B': /* Volatile qual on some type (Sun) */
- case 'i': /* Volatile qual on some type (OS9000) */
+ 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);
- /* FIXME! For now, we ignore const and volatile qualifiers. */
+ type = make_cv_type (TYPE_CONST (type), 1, type,
+ dbx_lookup_type (typenums));
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);
@@ -2615,7 +2700,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. */
@@ -2624,7 +2710,7 @@ read_type (pp, objfile)
if (**pp == '\0')
return error_type (pp, objfile);
else
- ++*pp; /* Skip the semicolon. */
+ ++ * pp; /* Skip the semicolon. */
switch (*attr)
{
@@ -2640,7 +2726,7 @@ read_type (pp, objfile)
default:
/* Ignore unrecognized type attributes, so future compilers
- can invent new ones. */
+ can invent new ones. */
break;
}
++*pp;
@@ -2648,7 +2734,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. */
@@ -2681,7 +2767,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;
@@ -2700,39 +2786,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)
@@ -2741,7 +2827,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)
@@ -2750,7 +2836,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);
}
@@ -2771,8 +2857,7 @@ read_type (pp, objfile)
Return the proper type node for a given builtin type number. */
static struct type *
-rs6000_builtin_type (typenum)
- int typenum;
+rs6000_builtin_type (int typenum)
{
/* We recognize types numbered from -NUMBER_RECOGNIZED to -1. */
#define NUMBER_RECOGNIZED 34
@@ -2789,7 +2874,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
@@ -2800,10 +2885,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:
@@ -2850,8 +2935,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:
@@ -2934,11 +3019,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
@@ -2947,14 +3032,12 @@ rs6000_builtin_type (typenum)
Returns 1 for success, 0 for failure. */
static int
-read_member_functions (fip, pp, type, objfile)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_member_functions (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
int nfn_fields = 0;
int length = 0;
+ int skip_method;
/* Total number of member functions defined in this class. If the class
defines two `f' functions, and one `g' function, then this will have
the value 3. */
@@ -2964,21 +3047,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 != ':')
{
@@ -2992,12 +3076,42 @@ read_member_functions (fip, pp, type, objfile)
sublist = NULL;
look_ahead_type = NULL;
length = 0;
-
+
+ skip_method = 0;
+ if (p - *pp == strlen ("__base_ctor")
+ && strncmp (*pp, "__base_ctor", strlen ("__base_ctor")) == 0)
+ skip_method = 1;
+ else if (p - *pp == strlen ("__base_dtor")
+ && strncmp (*pp, "__base_dtor", strlen ("__base_dtor")) == 0)
+ skip_method = 1;
+ else if (p - *pp == strlen ("__deleting_dtor")
+ && strncmp (*pp, "__deleting_dtor",
+ strlen ("__deleting_dtor")) == 0)
+ skip_method = 1;
+
+ if (skip_method)
+ {
+ /* Skip past '::'. */
+ *pp = p + 2;
+ /* Read the type. */
+ read_type (pp, objfile);
+ /* Skip past the colon, mangled name, semicolon, flags, and final
+ semicolon. */
+ while (**pp != ';')
+ (*pp) ++;
+ (*pp) ++;
+ while (**pp != ';')
+ (*pp) ++;
+ (*pp) ++;
+
+ continue;
+ }
+
new_fnlist = (struct next_fnfieldlist *)
xmalloc (sizeof (struct next_fnfieldlist));
- make_cleanup (free, new_fnlist);
+ make_cleanup (xfree, 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
@@ -3009,9 +3123,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;
@@ -3031,22 +3146,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);
+ make_cleanup (xfree, 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. */
@@ -3056,93 +3171,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_STUB (new_sublist->fn_field.type))
{
- 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
{
@@ -3156,7 +3271,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;
@@ -3170,50 +3285,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);
@@ -3239,11 +3354,8 @@ read_member_functions (fip, pp, type, objfile)
keep parsing and it's time for error_type(). */
static int
-read_cpp_abbrev (fip, pp, type, objfile)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
register char *p;
char *name;
@@ -3259,40 +3371,45 @@ 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 */
+ name = type_name_no_tag (context);
+ if (name == NULL)
+ {
+ name = "";
+ }
+ fip->list->field.name =
+ obconcat (&objfile->type_obstack, vptr_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;
+ 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] != ':')
@@ -3302,7 +3419,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;
@@ -3320,25 +3437,21 @@ 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;
}
static void
-read_one_struct_field (fip, pp, p, type, objfile)
- struct field_info *fip;
- char **pp;
- char *p;
- struct type *type;
- struct objfile *objfile;
+read_one_struct_field (struct field_info *fip, char **pp, char *p,
+ struct type *type, struct objfile *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;
@@ -3347,40 +3460,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);
@@ -3388,12 +3501,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++;
}
@@ -3431,28 +3545,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));
@@ -3463,11 +3577,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)
{
@@ -3479,7 +3593,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.
@@ -3488,21 +3602,18 @@ 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.
Returns 1 for success, 0 for failure. */
static int
-read_struct_fields (fip, pp, type, objfile)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_struct_fields (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
register char *p;
struct nextfield *new;
@@ -3514,25 +3625,28 @@ read_struct_fields (fip, pp, type, objfile)
/* Read each data member type until we find the terminating ';' at the end of
the data member list, or break for some other reason such as finding the
start of the member function list. */
+ /* Stab string for structure/union does not end with two ';' in
+ SUN C compiler 5.3 i.e. F6U2, hence check for end of string. */
- while (**pp != ';')
+ while (**pp != ';' && **pp != '\0')
{
- 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);
+ make_cleanup (xfree, 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] != '_')
{
@@ -3542,11 +3656,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++;
}
@@ -3563,12 +3677,12 @@ 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
called when we encounter the baseclass marker, and slurps up all the
@@ -3592,13 +3706,13 @@ read_struct_fields (fip, pp, type, objfile)
Type number of base class ____________________________________|
Return 1 for success, 0 for (error-type-inducing) failure. */
+/* *INDENT-ON* */
+
+
static int
-read_baseclasses (fip, pp, type, objfile)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_baseclasses (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
int i;
struct nextfield *new;
@@ -3641,52 +3755,55 @@ read_baseclasses (fip, pp, type, objfile)
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
- make_cleanup (free, new);
+ make_cleanup (xfree, 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. */
@@ -3697,11 +3814,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 == ';')
@@ -3721,11 +3838,8 @@ read_baseclasses (fip, pp, type, objfile)
so we can look for the vptr base class info. */
static int
-read_tilde_fields (fip, pp, type, objfile)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
+ struct objfile *objfile)
{
register char *p;
@@ -3771,16 +3885,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;
@@ -3795,7 +3909,7 @@ read_tilde_fields (fip, pp, type, objfile)
TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t);
}
- gotit:
+ gotit:
*pp = p + 1;
}
}
@@ -3803,18 +3917,16 @@ read_tilde_fields (fip, pp, type, objfile)
}
static int
-attach_fn_fields_to_type (fip, type)
- struct field_info *fip;
- register struct type *type;
+attach_fn_fields_to_type (struct field_info *fip, register struct type *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;
}
@@ -3822,25 +3934,22 @@ 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)
- struct field_info *fip;
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_cfront_static_fields (struct field_info *fip, char **pp, 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;
@@ -3849,33 +3958,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);
+ make_cleanup (xfree, 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)));
@@ -3884,26 +3994,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);
+ }
+ 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 */
+ } /* end of code for cfront work around */
+ } /* loop again for next static field */
return 1;
}
@@ -3914,43 +4024,41 @@ read_cfront_static_fields (fip, pp, type, objfile)
once we have collected all the class members. */
static int
-copy_cfront_struct_fields (fip, type, objfile)
- struct field_info *fip;
- struct type *type;
- struct objfile *objfile;
+copy_cfront_struct_fields (struct field_info *fip, 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);
+ make_cleanup (xfree, 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;
@@ -3961,10 +4069,8 @@ copy_cfront_struct_fields (fip, type, objfile)
for this class's virtual functions. */
static int
-attach_fields_to_type (fip, type, objfile)
- struct field_info *fip;
- register struct type *type;
- struct objfile *objfile;
+attach_fields_to_type (struct field_info *fip, register struct type *type,
+ struct objfile *objfile)
{
register int nfields = 0;
register int non_public_fields = 0;
@@ -3975,10 +4081,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++;
}
@@ -4016,34 +4122,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;
}
@@ -4060,13 +4167,10 @@ 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)
- char **pp;
- struct type *type;
- struct objfile *objfile;
+read_struct_type (char **pp, struct type *type, struct objfile *objfile)
{
struct cleanup *back_to;
struct field_info fi;
@@ -4103,6 +4207,8 @@ read_struct_type (pp, type, objfile)
type = error_type (pp, objfile);
}
+ /* Fix up any cv-qualified versions of this type. */
+ finish_cv_type (type);
do_cleanups (back_to);
return (type);
}
@@ -4113,10 +4219,8 @@ read_struct_type (pp, type, objfile)
array. */
static struct type *
-read_array_type (pp, type, objfile)
- register char **pp;
- register struct type *type;
- struct objfile *objfile;
+read_array_type (register char **pp, register struct type *type,
+ struct objfile *objfile)
{
struct type *index_type, *element_type, *range_type;
int lower, upper;
@@ -4158,7 +4262,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)
@@ -4180,10 +4284,8 @@ read_array_type (pp, type, objfile)
Also defines the symbols that represent the values of the type. */
static struct type *
-read_enum_type (pp, type, objfile)
- register char **pp;
- register struct type *type;
- struct objfile *objfile;
+read_enum_type (register char **pp, register struct type *type,
+ struct objfile *objfile)
{
register char *p;
char *name;
@@ -4211,8 +4313,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);
@@ -4224,7 +4326,7 @@ read_enum_type (pp, type, objfile)
{
/* Skip over the type. */
while (**pp != ':')
- (*pp)++;
+ (*pp)++;
/* Skip over the colon. */
(*pp)++;
@@ -4237,18 +4339,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;
@@ -4303,21 +4406,18 @@ 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,
FIXME. */
static struct type *
-read_sun_builtin_type (pp, typenums, objfile)
- char **pp;
- int typenums[2];
- struct objfile *objfile;
+read_sun_builtin_type (char **pp, int typenums[2], struct objfile *objfile)
{
int type_bits;
int nbits;
@@ -4326,14 +4426,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)++;
@@ -4379,20 +4479,17 @@ 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);
}
static struct type *
-read_sun_floating_type (pp, typenums, objfile)
- char **pp;
- int typenums[2];
- struct objfile *objfile;
+read_sun_floating_type (char **pp, int typenums[2], struct objfile *objfile)
{
int nbits;
int details;
@@ -4431,10 +4528,7 @@ read_sun_floating_type (pp, typenums, objfile)
If encounter garbage, set *BITS to -1 and return 0. */
static long
-read_huge_number (pp, end, bits)
- char **pp;
- int end;
- int *bits;
+read_huge_number (char **pp, int end, int *bits)
{
char *p = *pp;
int sign = 1;
@@ -4444,7 +4538,7 @@ read_huge_number (pp, end, bits)
int nbits = 0;
int c;
long upper_limit;
-
+
if (*p == '-')
{
sign = -1;
@@ -4473,9 +4567,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)
@@ -4517,9 +4611,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)
@@ -4536,10 +4630,7 @@ read_huge_number (pp, end, bits)
}
static struct type *
-read_range_type (pp, typenums, objfile)
- char **pp;
- int typenums[2];
- struct objfile *objfile;
+read_range_type (char **pp, int typenums[2], struct objfile *objfile)
{
char *orig_pp = *pp;
int rangenums[2];
@@ -4592,8 +4683,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)
@@ -4631,14 +4722,18 @@ read_range_type (pp, typenums, objfile)
if (n3 == 0 && n2 > 0)
{
+ struct type *float_type
+ = init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile);
+
if (self_subrange)
{
- return init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile);
+ struct type *complex_type =
+ init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile);
+ TYPE_TARGET_TYPE (complex_type) = float_type;
+ return complex_type;
}
else
- {
- return init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile);
- }
+ return float_type;
}
/* If the upper bound is -1, it must really be an unsigned int. */
@@ -4647,7 +4742,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);
}
@@ -4664,27 +4759,39 @@ read_range_type (pp, typenums, objfile)
/* We used to do this only for subrange of self or subrange of int. */
else if (n2 == 0)
{
+ /* -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. */
+
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);
- if (n3 == 0xffff)
- 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. */
+ /* Is n3 == 2**(8n)-1 for some integer n? Then it's an
+ unsigned n-byte integer. But do require n to be a power of
+ two; we don't want 3- and 5-byte integers flying around. */
+ {
+ int bytes;
+ unsigned long bits;
+
+ bits = n3;
+ for (bytes = 0; (bits & 0xff) == 0xff; bytes++)
+ bits >>= 8;
+ if (bits == 0
+ && ((bytes - 1) & bytes) == 0) /* "bytes is a power of two" */
+ return init_type (TYPE_CODE_INT, bytes, TYPE_FLAG_UNSIGNED, NULL,
+ objfile);
+ }
}
/* 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);
@@ -4696,7 +4803,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;
@@ -4726,20 +4833,17 @@ read_range_type (pp, typenums, objfile)
**)-1 if there is an error. */
static struct type **
-read_args (pp, end, objfile)
- char **pp;
- int end;
- struct objfile *objfile;
+read_args (char **pp, int end, 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);
@@ -4750,7 +4854,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 *));
@@ -4783,13 +4887,12 @@ static char *common_block_name;
to remain after this function returns. */
void
-common_block_start (name, objfile)
- char *name;
- struct objfile *objfile;
+common_block_start (char *name, struct objfile *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);
@@ -4797,14 +4900,13 @@ 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. */
void
-common_block_end (objfile)
- struct objfile *objfile;
+common_block_end (struct objfile *objfile)
{
/* Symbols declared since the BCOMM are to have the common block
start address added in when we know it. common_block and
@@ -4819,13 +4921,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;
@@ -4866,29 +4969,26 @@ common_block_end (objfile)
the common block name). */
static void
-fix_common_block (sym, valu)
- struct symbol *sym;
- int valu;
+fix_common_block (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;
}
}
+
-
/* 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
once this file has been read in. */
void
-add_undefined_type (type)
- struct type *type;
+add_undefined_type (struct type *type)
{
if (undef_types_length == undef_types_allocated)
{
@@ -4904,13 +5004,13 @@ 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 ()
+cleanup_undefined_types (void)
{
struct type **type;
@@ -4919,15 +5019,15 @@ 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
C though not C++) case of several types with the same name
in different source files. */
- if (TYPE_FLAGS (*type) & TYPE_FLAG_STUB)
+ if (TYPE_STUB (*type))
{
struct pending *ppt;
int i;
@@ -4936,7 +5036,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;
}
@@ -4945,7 +5046,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)) ==
@@ -4963,7 +5064,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));
}
@@ -4979,8 +5081,7 @@ GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
to. Get these symbols from the minimal symbol table. */
void
-scan_file_globals (objfile)
- struct objfile *objfile;
+scan_file_globals (struct objfile *objfile)
{
int hash;
struct minimal_symbol *msymbol;
@@ -5000,7 +5101,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])
@@ -5009,7 +5110,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++)
{
@@ -5036,7 +5137,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;
@@ -5051,7 +5152,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. */
@@ -5059,7 +5160,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;
@@ -5086,7 +5187,7 @@ scan_file_globals (objfile)
rsym = NULL;
}
-
+
if (prev)
{
sym = SYMBOL_VALUE_CHAIN (prev);
@@ -5127,7 +5228,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));
@@ -5138,7 +5239,7 @@ scan_file_globals (objfile)
to a psymtab. */
void
-stabsread_init ()
+stabsread_init (void)
{
}
@@ -5147,7 +5248,7 @@ stabsread_init ()
file, e.g. a shared library). */
void
-stabsread_new_init ()
+stabsread_new_init (void)
{
/* Empty the hash table of global syms looking for values. */
memset (global_sym_chain, 0, sizeof (global_sym_chain));
@@ -5156,7 +5257,8 @@ stabsread_new_init ()
/* Initialize anything that needs initializing at the same time as
start_symtab() is called. */
-void start_stabs ()
+void
+start_stabs (void)
{
global_stabs = NULL; /* AIX COFF */
/* Leave FILENUM of 0 free for builtin types and this file's types. */
@@ -5172,11 +5274,12 @@ void start_stabs ()
/* Call after end_symtab() */
-void end_stabs ()
+void
+end_stabs (void)
{
if (type_vector)
{
- free ((char *) type_vector);
+ xfree (type_vector);
}
type_vector = 0;
type_vector_length = 0;
@@ -5184,13 +5287,12 @@ void end_stabs ()
}
void
-finish_global_stabs (objfile)
- struct objfile *objfile;
+finish_global_stabs (struct objfile *objfile)
{
if (global_stabs)
{
patch_block_stabs (global_symbols, global_stabs, objfile);
- free ((PTR) global_stabs);
+ xfree (global_stabs);
global_stabs = NULL;
}
}
@@ -5198,7 +5300,7 @@ finish_global_stabs (objfile)
/* Initializer for this module */
void
-_initialize_stabsread ()
+_initialize_stabsread (void)
{
undef_types_allocated = 20;
undef_types_length = 0;
diff --git a/contrib/gdb/gdb/stabsread.h b/contrib/gdb/gdb/stabsread.h
index 77ea291..59504da 100644
--- a/contrib/gdb/gdb/stabsread.h
+++ b/contrib/gdb/gdb/stabsread.h
@@ -1,21 +1,23 @@
/* Include file for stabs debugging format support functions.
- Copyright 1986-1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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.
@@ -29,12 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EXTERN extern
#endif
-/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
-
-#ifndef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(VALUE) (VALUE)
-#endif
-
/* Hash table of global symbols whose values are not known yet.
They are chained thru the SYMBOL_VALUE_CHAIN, since we don't
have the correct data for that slot yet.
@@ -45,17 +41,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
EXTERN struct symbol *global_sym_chain[HASHSIZE];
-extern void common_block_start PARAMS ((char *, struct objfile *));
-extern void common_block_end PARAMS ((struct objfile *));
+extern void common_block_start (char *, struct objfile *);
+extern void common_block_end (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 +81,26 @@ EXTERN int previous_stab_code;
used to match header-file references to their corresponding data. */
struct header_file
-{
+ {
+
+ /* Name of header file */
- /* Name of header file */
-
- char *name;
+ char *name;
- /* Numeric code distinguishing instances of one header file that produced
- different results when included. It comes from the N_BINCL or N_EXCL. */
+ /* Numeric code distinguishing instances of one header file that produced
+ different results when included. It comes from the N_BINCL or N_EXCL. */
- int instance;
+ int instance;
- /* Pointer to vector of types */
+ /* Pointer to vector of types */
- struct type **vector;
+ struct type **vector;
- /* Allocated length (# elts) of that vector */
+ /* Allocated length (# elts) of that vector */
- int length;
+ int length;
-};
+ };
/* The table of header_files of this OBJFILE. */
#define HEADER_FILES(OBJFILE) (DBX_SYMFILE_INFO (OBJFILE)->header_files)
@@ -135,115 +131,96 @@ EXTERN int n_allocated_this_object_header_files;
extern struct complaint unknown_symtype_complaint;
extern struct complaint unknown_symchar_complaint;
-extern struct type *
-read_type PARAMS ((char **, struct objfile *));
+extern struct type *read_type (char **, struct objfile *);
-extern void
-cleanup_undefined_types PARAMS ((void));
+extern void cleanup_undefined_types (void);
-extern struct type **
-dbx_lookup_type PARAMS ((int [2]));
+extern struct type **dbx_lookup_type (int[2]);
-extern long
-read_number PARAMS ((char **, int));
+extern long read_number (char **, int);
-extern void
-add_undefined_type PARAMS ((struct type *));
+extern void add_undefined_type (struct type *);
-extern struct symbol *
-define_symbol PARAMS ((CORE_ADDR, char *, int, int, struct objfile *));
+extern struct symbol *define_symbol (CORE_ADDR, char *, int, int,
+ struct objfile *);
-extern void
-stabsread_init PARAMS ((void));
+extern void stabsread_init (void);
-extern void
-stabsread_new_init PARAMS ((void));
+extern void stabsread_new_init (void);
-extern void
-start_stabs PARAMS ((void));
-
-extern void
-end_stabs PARAMS ((void));
+extern void start_stabs (void);
-extern void
-finish_global_stabs PARAMS ((struct objfile *objfile));
+extern void end_stabs (void);
+extern void finish_global_stabs (struct objfile *objfile);
+
EXTERN int os9k_stabs;
/* 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;
+ };
/* 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 **));
-
-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));
+extern struct partial_symtab *end_psymtab (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 *));
+process_one_symbol (int, int, CORE_ADDR, char *,
+ struct section_offsets *, struct objfile *);
extern void elfstab_build_psymtabs
- PARAMS ((struct objfile *objfile,
- struct section_offsets *section_offsets,
- int mainline,
- file_ptr staboff, unsigned int stabsize,
- file_ptr stabstroffset,
- unsigned int stabstrsize));
+ (struct objfile *objfile,
+ 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,
- int mainline,
- CORE_ADDR textaddr, unsigned int textsize,
- struct stab_section_list *stabs,
- file_ptr stabstroffset,
- unsigned int stabstrsize));
+ (struct objfile *objfile,
+ int mainline,
+ CORE_ADDR textaddr, unsigned int textsize,
+ 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,
- int mainline,
- char *stab_name,
- char *stabstr_name,
- char *text_name));
+ (struct objfile *objfile,
+ int mainline, char *stab_name, char *stabstr_name, char *text_name);
+
+extern void elfstab_offset_sections (struct objfile *,
+ struct partial_symtab *);
+
+extern void process_later
+ (struct symbol *, char *,
+ int (*f) (struct objfile *, struct symbol *, char *));
-extern void elfstab_offset_sections PARAMS ((struct objfile *,
- struct partial_symtab *));
+extern int symbol_reference_defined (char **);
-extern void process_later
- PARAMS ((struct symbol *, char *,
- int (*f) PARAMS ((struct objfile *, struct symbol *, char *))));
+extern void ref_add (int, struct symbol *, char *, CORE_ADDR);
-extern int symbol_reference_defined PARAMS ((char **));
+extern struct symbol *ref_search (int);
-extern void ref_add PARAMS ((int, struct symbol *, char *, CORE_ADDR));
+extern int resolve_cfront_continuation
+ (struct objfile *objfile, struct symbol *sym, char *p);
-extern struct symbol * ref_search PARAMS ((int));
+extern void free_header_files (void);
-extern int resolve_cfront_continuation
- PARAMS ((struct objfile * objfile, struct symbol * sym, char * p));
+extern void init_header_files (void);
#undef EXTERN
diff --git a/contrib/gdb/gdb/stack.c b/contrib/gdb/gdb/stack.c
index e36316e..68f16b6 100644
--- a/contrib/gdb/gdb/stack.c
+++ b/contrib/gdb/gdb/stack.c
@@ -1,22 +1,25 @@
/* Print and select stack frames for GDB, the GNU debugger.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 98, 1999
- Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 <ctype.h>
#include "defs.h"
@@ -34,73 +37,77 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "demangle.h"
#include "inferior.h"
#include "annotate.h"
-#include "symfile.h"
-#include "objfiles.h"
+#include "ui-out.h"
/* Prototypes for exported functions. */
-void args_info PARAMS ((char *, int));
+void args_info (char *, int);
-void locals_info PARAMS ((char *, int));
+void locals_info (char *, int);
-void (*selected_frame_level_changed_hook) PARAMS ((int));
+void (*selected_frame_level_changed_hook) (int);
-void _initialize_stack PARAMS ((void));
+void _initialize_stack (void);
/* Prototypes for local functions. */
-static void return_command PARAMS ((char *, int));
+static void return_command (char *, int);
+
+static void down_command (char *, int);
+
+static void down_silently_base (char *);
+
+static void down_silently_command (char *, int);
-static void down_command PARAMS ((char *, int));
+static void up_command (char *, int);
-static void down_silently_base PARAMS ((char *));
+static void up_silently_base (char *);
-static void down_silently_command PARAMS ((char *, int));
+static void up_silently_command (char *, int);
-static void up_command PARAMS ((char *, int));
+void frame_command (char *, int);
-static void up_silently_base PARAMS ((char *));
+static void current_frame_command (char *, int);
-static void up_silently_command PARAMS ((char *, int));
+static void select_frame_command (char *, int);
-void frame_command PARAMS ((char *, int));
+static void print_frame_arg_vars (struct frame_info *, struct ui_file *);
-static void select_frame_command PARAMS ((char *, int));
+static void catch_info (char *, int);
-static void print_frame_arg_vars PARAMS ((struct frame_info *, GDB_FILE *));
+static void args_plus_locals_info (char *, int);
-static void catch_info PARAMS ((char *, int));
+static void print_frame_label_vars (struct frame_info *, int,
+ struct ui_file *);
-static void args_plus_locals_info PARAMS ((char *, int));
+static void print_frame_local_vars (struct frame_info *, int,
+ struct ui_file *);
-static void print_frame_label_vars PARAMS ((struct frame_info *,
- int,
- GDB_FILE *));
+static int print_block_frame_labels (struct block *, int *,
+ struct ui_file *);
-static void print_frame_local_vars PARAMS ((struct frame_info *,
- int,
- GDB_FILE *));
+static int print_block_frame_locals (struct block *,
+ struct frame_info *,
+ int,
+ struct ui_file *);
-static int print_block_frame_labels PARAMS ((struct block *, int *,
- GDB_FILE *));
+static void print_frame (struct frame_info *fi,
+ int level,
+ int source,
+ int args,
+ struct symtab_and_line sal);
-static int print_block_frame_locals PARAMS ((struct block *,
- struct frame_info *,
- int,
- GDB_FILE *));
+static void print_frame_info_base (struct frame_info *, int, int, int);
-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 print_stack_frame_base (struct frame_info *, int, int);
-static void backtrace_command PARAMS ((char *, int));
+static void backtrace_command (char *, int);
-struct frame_info *parse_frame_specification PARAMS ((char *));
+struct frame_info *parse_frame_specification (char *);
-static void frame_info PARAMS ((char *, int));
+static void frame_info (char *, int);
extern int addressprint; /* Print addresses, or stay symbolic only? */
-extern int info_verbose; /* Verbosity of symbol reading msgs */
extern int lines_to_list; /* # of lines "list" command shows by default */
/* The "selected" stack frame is used by default for local and arg access.
@@ -121,30 +128,26 @@ int selected_frame_level;
cases and in a slightly different syntax. */
int annotation_level = 0;
-
-struct print_stack_frame_args {
- struct frame_info *fi;
- int level;
- int source;
- int args;
-};
-static int print_stack_frame_base_stub PARAMS ((char *));
+struct print_stack_frame_args
+ {
+ struct frame_info *fi;
+ int level;
+ int source;
+ int args;
+ };
+
+static int print_stack_frame_base_stub (char *);
/* Show and print the frame arguments.
Pass the args the way catch_errors wants them. */
+static int show_and_print_stack_frame_stub (void *args);
static int
-show_and_print_stack_frame_stub (args)
- char *args;
+show_and_print_stack_frame_stub (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
- */
- if (tui_version)
- print_frame_info_base (p->fi, p->level, p->source, p->args);
print_frame_info (p->fi, p->level, p->source, p->args);
return 0;
@@ -152,16 +155,13 @@ show_and_print_stack_frame_stub (args)
/* Show or print the frame arguments.
Pass the args the way catch_errors wants them. */
+static int print_stack_frame_stub (void *args);
static int
-print_stack_frame_stub (args)
- char *args;
+print_stack_frame_stub (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);
- else
- print_frame_info_base (p->fi, p->level, p->source, p->args);
+ print_frame_info_base (p->fi, p->level, p->source, p->args);
return 0;
}
@@ -171,10 +171,9 @@ print_stack_frame_stub (args)
/* Pass the args the way catch_errors wants them. */
static int
-print_stack_frame_base_stub (args)
- char *args;
+print_stack_frame_base_stub (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;
@@ -182,11 +181,11 @@ print_stack_frame_base_stub (args)
/* print the frame arguments to the terminal.
Pass the args the way catch_errors wants them. */
+static int print_only_stack_frame_stub (void *);
static int
-print_only_stack_frame_stub (args)
- char *args;
+print_only_stack_frame_stub (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;
@@ -203,10 +202,7 @@ print_only_stack_frame_stub (args)
If SOURCE is -1, print ONLY the source line. */
static void
-print_stack_frame_base (fi, level, source)
- struct frame_info *fi;
- int level;
- int source;
+print_stack_frame_base (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
@@ -215,7 +211,7 @@ print_stack_frame_base (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, &args, "", RETURN_MASK_ALL);
}
/* Show and print a stack frame briefly. FRAME_INFI should be the frame info
@@ -229,10 +225,7 @@ print_stack_frame_base (fi, level, source)
If SOURCE is -1, print ONLY the source line. */
void
-show_and_print_stack_frame (fi, level, source)
- struct frame_info *fi;
- int level;
- int source;
+show_and_print_stack_frame (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
@@ -241,7 +234,7 @@ show_and_print_stack_frame (fi, level, source)
args.source = source;
args.args = 1;
- catch_errors (show_and_print_stack_frame_stub, (char *)&args, "", RETURN_MASK_ALL);
+ catch_errors (show_and_print_stack_frame_stub, &args, "", RETURN_MASK_ALL);
}
@@ -256,10 +249,7 @@ show_and_print_stack_frame (fi, level, source)
If SOURCE is -1, print ONLY the source line. */
void
-print_stack_frame (fi, level, source)
- struct frame_info *fi;
- int level;
- int source;
+print_stack_frame (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
@@ -268,7 +258,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
@@ -282,10 +272,7 @@ print_stack_frame (fi, level, source)
If SOURCE is -1, print ONLY the source line. */
void
-print_only_stack_frame (fi, level, source)
- struct frame_info *fi;
- int level;
- int source;
+print_only_stack_frame (struct frame_info *fi, int level, int source)
{
struct print_stack_frame_args args;
@@ -294,52 +281,47 @@ print_only_stack_frame (fi, level, source)
args.source = source;
args.args = 1;
- catch_errors (print_only_stack_frame_stub,
- (char *)&args, "", RETURN_MASK_ALL);
+ 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;
+ struct ui_file *stream;
};
-static int print_args_stub PARAMS ((PTR));
+static int print_args_stub (PTR);
/* Pass the args the way catch_errors wants them. */
static int
-print_args_stub (args)
- PTR args;
+print_args_stub (PTR args)
{
int numargs;
- struct print_args_args *p = (struct print_args_args *)args;
+ struct print_args_args *p = (struct print_args_args *) args;
- FRAME_NUM_ARGS (numargs, (p->fi));
- print_frame_args (p->func, p->fi, numargs, gdb_stdout);
+ numargs = FRAME_NUM_ARGS (p->fi);
+ print_frame_args (p->func, p->fi, numargs, p->stream);
return 0;
}
/* Print information about a frame for frame "fi" at level "level".
- * Used in "where" output, also used to emit breakpoint or step messages.
- * LEVEL is the level of the frame, or -1 if it is the innermost frame
- * but we don't want to print the level.
- * The meaning of the SOURCE argument is:
- * -1: Print only source line
- * 0: Print only location
- * 1: Print location and source line
- */
+ Used in "where" output, also used to emit breakpoint or step
+ messages.
+ LEVEL is the level of the frame, or -1 if it is the
+ innermost frame but we don't want to print the level.
+ The meaning of the SOURCE argument is:
+ SRC_LINE: Print only source line
+ LOCATION: Print only location
+ LOC_AND_SRC: Print location and source line. */
static void
-print_frame_info_base (fi, level, source, args)
- struct frame_info *fi;
- int level;
- int source;
- int args;
+print_frame_info_base (struct frame_info *fi, int level, int source, int args)
{
struct symtab_and_line sal;
- struct symbol *func;
- register char *funname = 0;
- enum language funlang = language_unknown;
+ int source_print;
+ int location_print;
#if 0
char buf[MAX_REGISTER_RAW_SIZE];
@@ -348,8 +330,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
@@ -364,7 +346,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 ();
@@ -377,7 +359,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 ();
@@ -398,28 +380,99 @@ print_frame_info_base (fi, level, source, args)
&& !fi->next->signal_handler_caller
&& !frame_in_dummy (fi->next));
+ location_print = (source == LOCATION
+ || source == LOC_AND_ADDRESS
+ || source == SRC_AND_LOC);
+
+ if (location_print || !sal.symtab)
+ print_frame (fi, level, source, args, sal);
+
+ source_print = (source == SRC_LINE || source == SRC_AND_LOC);
+
+ if (source_print && sal.symtab)
+ {
+ int done = 0;
+ int mid_statement = (source == SRC_LINE) && (fi->pc != sal.pc);
+
+ if (annotation_level)
+ done = identify_source_line (sal.symtab, sal.line, mid_statement,
+ fi->pc);
+ if (!done)
+ {
+ if (print_frame_info_listing_hook)
+ {
+ print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
+ current_source_symtab = sal.symtab;
+ }
+ else
+ {
+ /* We used to do this earlier, but that is clearly
+ wrong. This function is used by many different
+ parts of gdb, including normal_stop in infrun.c,
+ which uses this to print out the current PC
+ when we stepi/nexti into the middle of a source
+ line. Only the command line really wants this
+ behavior. Other UIs probably would like the
+ ability to decide for themselves if it is desired. */
+ if (addressprint && mid_statement)
+ {
+ ui_out_field_core_addr (uiout, "addr", fi->pc);
+ ui_out_text (uiout, "\t");
+ }
+
+ print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
+ }
+ }
+ current_source_line = max (sal.line - lines_to_list / 2, 1);
+ }
+
+ if (source != 0)
+ set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
+
+ annotate_frame_end ();
+
+ gdb_flush (gdb_stdout);
+}
+
+static void
+print_frame (struct frame_info *fi,
+ int level,
+ int source,
+ int args,
+ struct symtab_and_line sal)
+{
+ struct symbol *func;
+ register char *funname = 0;
+ enum language funlang = language_unknown;
+ struct ui_stream *stb;
+ struct cleanup *old_chain;
+ struct cleanup *list_chain;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
+
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). 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
@@ -438,31 +491,29 @@ 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. (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
@@ -475,181 +526,150 @@ print_frame_info_base (fi, level, source, args)
}
}
- if (source >= 0 || !sal.symtab)
- {
- annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
+ annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
- if (level >= 0)
- printf_filtered ("#%-2d ", level);
- if (addressprint)
- if (fi->pc != sal.pc || !sal.symtab)
- {
- annotate_frame_address ();
- print_address_numeric (fi->pc, 1, gdb_stdout);
- annotate_frame_address_end ();
- printf_filtered (" in ");
- }
- annotate_frame_function_name ();
- fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
- DMGL_ANSI);
- wrap_here (" ");
- annotate_frame_args ();
- fputs_filtered (" (", gdb_stdout);
- if (args)
- {
- struct print_args_args args;
- args.fi = fi;
- args.func = func;
- catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
- QUIT;
- }
- printf_filtered (")");
- if (sal.symtab && sal.symtab->filename)
- {
- annotate_frame_source_begin ();
- wrap_here (" ");
- printf_filtered (" at ");
- annotate_frame_source_file ();
- printf_filtered ("%s", sal.symtab->filename);
- annotate_frame_source_file_end ();
- printf_filtered (":");
- annotate_frame_source_line ();
- printf_filtered ("%d", sal.line);
- annotate_frame_source_end ();
- }
+ list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
-#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 (!funname)
- {
- annotate_frame_where ();
- wrap_here (" ");
- printf_filtered (" from %s", PC_LOAD_SEGMENT (fi->pc));
- }
-#endif
-#ifdef PC_SOLIB
- if (!funname || (!sal.symtab || !sal.symtab->filename))
- {
- char *lib = PC_SOLIB (fi->pc);
- if (lib)
- {
- annotate_frame_where ();
- wrap_here (" ");
- printf_filtered (" from %s", lib);
- }
- }
-#endif
- printf_filtered ("\n");
+ if (level >= 0)
+ {
+ ui_out_text (uiout, "#");
+ ui_out_field_fmt (uiout, "level", "%-2d", level);
+ ui_out_spaces (uiout, 1);
+ }
+ if (addressprint)
+ if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
+ {
+ annotate_frame_address ();
+ ui_out_field_core_addr (uiout, "addr", fi->pc);
+ annotate_frame_address_end ();
+ ui_out_text (uiout, " in ");
+ }
+ annotate_frame_function_name ();
+ fprintf_symbol_filtered (stb->stream, funname ? funname : "??", funlang,
+ DMGL_ANSI);
+ ui_out_field_stream (uiout, "func", stb);
+ ui_out_wrap_hint (uiout, " ");
+ annotate_frame_args ();
+
+ ui_out_text (uiout, " (");
+ if (args)
+ {
+ struct print_args_args args;
+ struct cleanup *args_list_chain;
+ args.fi = fi;
+ args.func = func;
+ args.stream = gdb_stdout;
+ args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
+ catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
+ /* FIXME: args must be a list. If one argument is a string it will
+ have " that will not be properly escaped. */
+ /* Invoke ui_out_tuple_end. */
+ do_cleanups (args_list_chain);
+ QUIT;
+ }
+ ui_out_text (uiout, ")");
+ if (sal.symtab && sal.symtab->filename)
+ {
+ annotate_frame_source_begin ();
+ ui_out_wrap_hint (uiout, " ");
+ ui_out_text (uiout, " at ");
+ annotate_frame_source_file ();
+ ui_out_field_string (uiout, "file", sal.symtab->filename);
+ annotate_frame_source_file_end ();
+ ui_out_text (uiout, ":");
+ annotate_frame_source_line ();
+ ui_out_field_int (uiout, "line", sal.line);
+ annotate_frame_source_end ();
}
- if ((source != 0) && sal.symtab)
+#ifdef PC_SOLIB
+ if (!funname || (!sal.symtab || !sal.symtab->filename))
{
- int done = 0;
- int mid_statement = source < 0 && fi->pc != sal.pc;
- if (annotation_level)
- done = identify_source_line (sal.symtab, sal.line, mid_statement,
- fi->pc);
- if (!done)
+ char *lib = PC_SOLIB (fi->pc);
+ if (lib)
{
- if (addressprint && mid_statement && !tui_version)
- {
- print_address_numeric (fi->pc, 1, gdb_stdout);
- printf_filtered ("\t");
- }
- if (print_frame_info_listing_hook)
- print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
- else if (!tui_version)
- print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
+ annotate_frame_where ();
+ ui_out_wrap_hint (uiout, " ");
+ ui_out_text (uiout, " from ");
+ ui_out_field_string (uiout, "from", lib);
}
- current_source_line = max (sal.line - lines_to_list/2, 1);
}
- if (source != 0)
- set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
-
- annotate_frame_end ();
+#endif /* PC_SOLIB */
- gdb_flush (gdb_stdout);
+ /* do_cleanups will call ui_out_tuple_end() for us. */
+ do_cleanups (list_chain);
+ ui_out_text (uiout, "\n");
+ do_cleanups (old_chain);
}
-void
-stack_publish_stopped_with_no_frame()
-{
- TUIDO(((TuiOpaqueFuncPtr)tuiUpdateOnEnd));
-
- return;
-}
-
/* 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)
- struct frame_info *fi;
- register int level;
- int source;
- int args;
+print_frame_info (struct frame_info *fi, register int level, int source,
+ int args)
{
- if (!tui_version)
- 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));
- }
- }
+ print_frame_info_base (fi, level, source, args);
}
/* 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)
- struct frame_info *fi;
+show_stack_frame (struct frame_info *fi)
{
- TUIDO(((TuiOpaqueFuncPtr)tui_vShowFrameInfo, fi));
}
-
+
/* 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). */
struct frame_info *
-parse_frame_specification (frame_exp)
- char *frame_exp;
+parse_frame_specification (char *frame_exp)
{
int numargs = 0;
#define MAXARGS 4
CORE_ADDR args[MAXARGS];
-
+ int level;
+
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);
- args[numargs++] = parse_and_eval_address (addr_string);
+ struct value *vp;
+
+ tmp_cleanup = make_cleanup (xfree, addr_string);
+
+ /* NOTE: we call parse_and_eval and then both
+ value_as_long and value_as_address rather than calling
+ parse_and_eval_long and parse_and_eval_address because
+ of the issue of potential side effects from evaluating
+ the expression. */
+ vp = parse_and_eval (addr_string);
+ if (numargs == 0)
+ level = value_as_long (vp);
+
+ args[numargs++] = value_as_address (vp);
do_cleanups (tmp_cleanup);
}
/* Skip spaces, move to possible next arg. */
- while (*p == ' ') p++;
+ while (*p == ' ')
+ p++;
frame_exp = p;
}
}
@@ -663,9 +683,8 @@ parse_frame_specification (frame_exp)
/* NOTREACHED */
case 1:
{
- 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)
@@ -700,17 +719,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");
@@ -734,9 +753,7 @@ parse_frame_specification (frame_exp)
This means absolutely all information in the frame is printed. */
static void
-frame_info (addr_exp, from_tty)
- char *addr_exp;
- int from_tty;
+frame_info (char *addr_exp, int from_tty)
{
struct frame_info *fi;
struct symtab_and_line sal;
@@ -759,7 +776,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
@@ -775,19 +792,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
{
@@ -832,10 +849,8 @@ frame_info (addr_exp, from_tty)
printf_filtered ("\n");
{
- int frameless = 0;
-#ifdef FRAMELESS_FUNCTION_INVOCATION
- FRAMELESS_FUNCTION_INVOCATION (fi, frameless);
-#endif
+ int frameless;
+ frameless = FRAMELESS_FUNCTION_INVOCATION (fi);
if (frameless)
printf_filtered (" (FRAMELESS),");
}
@@ -876,7 +891,7 @@ frame_info (addr_exp, from_tty)
print_address_numeric (arg_list, 1, gdb_stdout);
printf_filtered (",");
- FRAME_NUM_ARGS (numargs, fi);
+ numargs = FRAME_NUM_ARGS (fi);
if (numargs < 0)
puts_filtered (" args: ");
else if (numargs == 0)
@@ -907,12 +922,12 @@ 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");
count = 0;
- numregs = ARCH_NUM_REGS;
+ numregs = NUM_REGS + NUM_PSEUDO_REGS;
for (i = 0; i < numregs; i++)
if (fi->saved_regs[i] && i != SP_REGNUM)
{
@@ -931,9 +946,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");
}
}
@@ -945,11 +960,9 @@ frame_info (addr_exp, from_tty)
static int backtrace_limit;
static void
-set_backtrace_limit_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
+set_backtrace_limit_command (char *count_exp, int from_tty)
{
- int count = parse_and_eval_address (count_exp);
+ int count = parse_and_eval_long (count_exp);
if (count < 0)
error ("Negative argument not meaningful as backtrace limit.");
@@ -958,9 +971,7 @@ set_backtrace_limit_command (count_exp, from_tty)
}
static void
-backtrace_limit_info (arg, from_tty)
- char *arg;
- int from_tty;
+backtrace_limit_info (char *arg, int from_tty)
{
if (arg)
error ("\"Info backtrace-limit\" takes no arguments.");
@@ -971,11 +982,10 @@ backtrace_limit_info (arg, from_tty)
/* Print briefly all stack frames or just the innermost COUNT frames. */
+static void backtrace_command_1 (char *count_exp, int show_locals,
+ int from_tty);
static void
-backtrace_command_1 (count_exp, show_locals, from_tty)
- char *count_exp;
- int show_locals;
- int from_tty;
+backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
{
struct frame_info *fi;
register int count;
@@ -991,10 +1001,16 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
printing. Second, it must set the variable count to the number
of frames which we should print, or -1 if all of them. */
trailing = get_current_frame ();
+
+ /* The target can be in a state where there is no valid frames
+ (e.g., just connected). */
+ if (trailing == NULL)
+ error ("No stack.");
+
trailing_level = 0;
if (count_exp)
{
- count = parse_and_eval_address (count_exp);
+ count = parse_and_eval_long (count_exp);
if (count < 0)
{
struct frame_info *current;
@@ -1007,7 +1023,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)
@@ -1017,7 +1033,7 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
current = get_prev_frame (current);
trailing_level++;
}
-
+
count = -1;
}
}
@@ -1027,12 +1043,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--;
@@ -1052,12 +1068,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. */
@@ -1066,101 +1082,91 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
}
static void
-backtrace_command (arg, from_tty)
- char *arg;
- int from_tty;
+backtrace_command (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);
- old_chain = make_cleanup ((make_cleanup_func) freeargv, (char *)argv);
+ 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 && subsetCompare(argv[i], "full"))
- argIndicatingFullTrace = argc;
- else
- {
- argc++;
- totArgLen += strlen(argv[i]);
- }
- }
+ for (i = 0; (argv[i] != (char *) NULL); i++)
+ {
+ unsigned 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);
+ xfree (argPtr);
if (old_chain)
- do_cleanups(old_chain);
+ do_cleanups (old_chain);
}
+static void backtrace_full_command (char *arg, int from_tty);
static void
-backtrace_full_command (arg, from_tty)
- char *arg;
- int from_tty;
+backtrace_full_command (char *arg, int from_tty)
{
backtrace_command_1 (arg, 1, from_tty);
}
-
+
/* Print the local variables of a block B active in FRAME.
Return 1 if any variables were printed; 0 otherwise. */
static int
-print_block_frame_locals (b, fi, num_tabs, stream)
- struct block *b;
- register struct frame_info *fi;
- int num_tabs;
- register GDB_FILE *stream;
+print_block_frame_locals (struct block *b, register struct frame_info *fi,
+ int num_tabs, register struct ui_file *stream)
{
- int nsyms;
register int i, j;
register struct symbol *sym;
register int values_printed = 0;
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
+ ALL_BLOCK_SYMBOLS (b, i, sym)
{
- sym = BLOCK_SYM (b, i);
switch (SYMBOL_CLASS (sym))
{
case LOC_LOCAL:
@@ -1169,7 +1175,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);
@@ -1187,21 +1193,15 @@ print_block_frame_locals (b, fi, num_tabs, stream)
/* Same, but print labels. */
static int
-print_block_frame_labels (b, have_default, stream)
- struct block *b;
- int *have_default;
- register GDB_FILE *stream;
+print_block_frame_labels (struct block *b, int *have_default,
+ register struct ui_file *stream)
{
- int nsyms;
register int i;
register struct symbol *sym;
register int values_printed = 0;
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
+ ALL_BLOCK_SYMBOLS (b, i, sym)
{
- sym = BLOCK_SYM (b, i);
if (STREQ (SYMBOL_NAME (sym), "default"))
{
if (*have_default)
@@ -1235,10 +1235,8 @@ print_block_frame_labels (b, have_default, stream)
on the function running in FRAME. */
static void
-print_frame_local_vars (fi, num_tabs, stream)
- register struct frame_info *fi;
- register int num_tabs;
- register GDB_FILE *stream;
+print_frame_local_vars (register struct frame_info *fi, register int num_tabs,
+ register struct ui_file *stream)
{
register struct block *block = get_frame_block (fi);
register int values_printed = 0;
@@ -1248,14 +1246,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);
@@ -1270,10 +1268,8 @@ print_frame_local_vars (fi, num_tabs, stream)
/* Same, but print labels. */
static void
-print_frame_label_vars (fi, this_level_only, stream)
- register struct frame_info *fi;
- int this_level_only;
- register GDB_FILE *stream;
+print_frame_label_vars (register struct frame_info *fi, int this_level_only,
+ register struct ui_file *stream)
{
register struct blockvector *bl;
register struct block *block = get_frame_block (fi);
@@ -1326,8 +1322,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);
@@ -1341,9 +1337,7 @@ print_frame_label_vars (fi, this_level_only, stream)
/* ARGSUSED */
void
-locals_info (args, from_tty)
- char *args;
- int from_tty;
+locals_info (char *args, int from_tty)
{
if (!selected_frame)
error ("No frame selected.");
@@ -1351,13 +1345,11 @@ locals_info (args, from_tty)
}
static void
-catch_info (ignore, from_tty)
- char *ignore;
- int from_tty;
+catch_info (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)
{
@@ -1366,28 +1358,26 @@ 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);
}
}
static void
-print_frame_arg_vars (fi, stream)
- register struct frame_info *fi;
- register GDB_FILE *stream;
+print_frame_arg_vars (register struct frame_info *fi,
+ register struct ui_file *stream)
{
struct symbol *func = get_frame_function (fi);
register struct block *b;
- int nsyms;
register int i;
register struct symbol *sym, *sym2;
register int values_printed = 0;
@@ -1399,11 +1389,8 @@ print_frame_arg_vars (fi, stream)
}
b = SYMBOL_BLOCK_VALUE (func);
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
+ ALL_BLOCK_SYMBOLS (b, i, sym)
{
- sym = BLOCK_SYM (b, i);
switch (SYMBOL_CLASS (sym))
{
case LOC_ARG:
@@ -1428,7 +1415,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;
@@ -1438,7 +1425,6 @@ print_frame_arg_vars (fi, stream)
break;
}
}
-
if (!values_printed)
{
fprintf_filtered (stream, "No arguments.\n");
@@ -1446,9 +1432,7 @@ print_frame_arg_vars (fi, stream)
}
void
-args_info (ignore, from_tty)
- char *ignore;
- int from_tty;
+args_info (char *ignore, int from_tty)
{
if (!selected_frame)
error ("No frame selected.");
@@ -1457,22 +1441,18 @@ args_info (ignore, from_tty)
static void
-args_plus_locals_info (ignore, from_tty)
- char *ignore;
- int from_tty;
+args_plus_locals_info (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);
}
-
+
/* Select frame FI, and note that its stack level is LEVEL.
LEVEL may be -1 if an actual level number is not known. */
void
-select_frame (fi, level)
- struct frame_info *fi;
- int level;
+select_frame (struct frame_info *fi, int level)
{
register struct symtab *s;
@@ -1484,63 +1464,37 @@ 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));
- }
- }
}
-
+
/* 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)
- struct frame_info *fi;
- int level;
+select_and_print_frame (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);
}
}
-
-/* Select frame FI, noting that its stack level is LEVEL. Be silent if
- not the TUI */
-void
-select_and_maybe_print_frame (fi, level)
- struct frame_info *fi;
- int level;
-{
- if (!tui_version)
- select_frame(fi, level);
- else
- select_and_print_frame(fi, level);
-}
-
/* Store the selected frame and its level into *FRAMEP and *LEVELP.
If there is no selected frame, *FRAMEP is set to NULL. */
void
-record_selected_frame (frameaddrp, levelp)
- CORE_ADDR *frameaddrp;
- int *levelp;
+record_selected_frame (CORE_ADDR *frameaddrp, int *levelp)
{
*frameaddrp = selected_frame ? selected_frame->frame : 0;
*levelp = selected_frame_level;
@@ -1550,7 +1504,7 @@ record_selected_frame (frameaddrp, levelp)
Can return zero under various legitimate circumstances. */
struct block *
-get_selected_block ()
+get_selected_block (void)
{
if (!target_has_stack)
return 0;
@@ -1570,9 +1524,8 @@ get_selected_block ()
how much farther the original request asked to go. */
struct frame_info *
-find_relative_frame (frame, level_offset_ptr)
- register struct frame_info *frame;
- register int *level_offset_ptr;
+find_relative_frame (register struct frame_info *frame,
+ register int *level_offset_ptr)
{
register struct frame_info *prev;
register struct frame_info *frame1;
@@ -1590,13 +1543,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;
}
@@ -1608,10 +1562,14 @@ find_relative_frame (frame, level_offset_ptr)
frame expressions. */
/* ARGSUSED */
+void
+select_frame_command_wrapper (char *level_exp, int from_tty)
+{
+ select_frame_command (level_exp, from_tty);
+}
+
static void
-select_frame_command (level_exp, from_tty)
- char *level_exp;
- int from_tty;
+select_frame_command (char *level_exp, int from_tty)
{
register struct frame_info *frame, *frame1;
unsigned int level = 0;
@@ -1624,12 +1582,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;
@@ -1642,9 +1601,7 @@ select_frame_command (level_exp, from_tty)
frame. */
void
-frame_command (level_exp, from_tty)
- char *level_exp;
- int from_tty;
+frame_command (char *level_exp, int from_tty)
{
select_frame_command (level_exp, from_tty);
show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
@@ -1652,30 +1609,27 @@ frame_command (level_exp, from_tty)
/* The XDB Compatibility command to print the current frame. */
-void
-current_frame_command (level_exp, from_tty)
- char *level_exp;
- int from_tty;
+static void
+current_frame_command (char *level_exp, int from_tty)
{
if (target_has_stack == 0 || selected_frame == 0)
- error ("No stack.");
- print_only_stack_frame (selected_frame, selected_frame_level, 1);
- }
+ error ("No stack.");
+ print_only_stack_frame (selected_frame, selected_frame_level, 1);
+}
/* Select the frame up one or COUNT stack levels
from the previously selected frame, and print it briefly. */
/* ARGSUSED */
static void
-up_silently_base (count_exp)
- char *count_exp;
+up_silently_base (char *count_exp)
{
register struct frame_info *fi;
int count = 1, count1;
if (count_exp)
- count = parse_and_eval_address (count_exp);
+ count = parse_and_eval_long (count_exp);
count1 = count;
-
+
if (target_has_stack == 0 || selected_frame == 0)
error ("No stack.");
@@ -1686,19 +1640,13 @@ up_silently_base (count_exp)
}
static void
-up_silently_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
+up_silently_command (char *count_exp, int from_tty)
{
- up_silently_base(count_exp);
- if (tui_version)
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ up_silently_base (count_exp);
}
static void
-up_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
+up_command (char *count_exp, int from_tty)
{
up_silently_base (count_exp);
show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
@@ -1709,15 +1657,14 @@ up_command (count_exp, from_tty)
/* ARGSUSED */
static void
-down_silently_base (count_exp)
- char *count_exp;
+down_silently_base (char *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_long (count_exp);
count1 = count;
-
+
if (target_has_stack == 0 || selected_frame == 0)
error ("No stack.");
@@ -1726,9 +1673,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.");
}
@@ -1738,34 +1685,32 @@ down_silently_base (count_exp)
/* ARGSUSED */
static void
-down_silently_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
+down_silently_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
- if (tui_version)
- print_stack_frame (selected_frame, selected_frame_level, 1);
}
static void
-down_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
+down_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
}
+void
+return_command_wrapper (char *retval_exp, int from_tty)
+{
+ return_command (retval_exp, from_tty);
+}
+
static void
-return_command (retval_exp, from_tty)
- char *retval_exp;
- int from_tty;
+return_command (char *retval_exp, int from_tty)
{
struct symbol *thisfun;
CORE_ADDR selected_frame_addr;
CORE_ADDR selected_frame_pc;
struct frame_info *frame;
- value_ptr return_value = NULL;
+ struct value *return_value = NULL;
if (selected_frame == NULL)
error ("No selected frame.");
@@ -1789,7 +1734,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);
}
@@ -1806,9 +1751,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
@@ -1816,7 +1760,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;
@@ -1830,6 +1774,12 @@ return_command (retval_exp, from_tty)
if (retval_exp)
set_return_value (return_value);
+ /* If we are at the end of a call dummy now, pop the dummy frame too. */
+
+ if (CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (),
+ FRAME_FP (get_current_frame ())))
+ POP_FRAME;
+
/* If interactive, print the frame that is now current. */
if (from_tty)
@@ -1846,10 +1796,9 @@ struct function_bounds
CORE_ADDR low, high;
};
+static void func_command (char *arg, int from_tty);
static void
-func_command (arg, from_tty)
- char *arg;
- int from_tty;
+func_command (char *arg, int from_tty)
{
struct frame_info *fp;
int found = 0;
@@ -1892,7 +1841,7 @@ func_command (arg, from_tty)
while (!found && level == 0);
if (func_bounds)
- free (func_bounds);
+ xfree (func_bounds);
if (!found)
printf_filtered ("'%s' not within current stack frame.\n", arg);
@@ -1903,14 +1852,14 @@ func_command (arg, from_tty)
/* Gets the language of the current frame. */
enum language
-get_frame_language ()
+get_frame_language (void)
{
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
@@ -1923,9 +1872,9 @@ get_frame_language ()
}
void
-_initialize_stack ()
+_initialize_stack (void)
{
-#if 0
+#if 0
backtrace_limit = 30;
#endif
@@ -1963,8 +1912,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,
@@ -1981,7 +1930,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");
@@ -1999,21 +1948,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
}
diff --git a/contrib/gdb/gdb/symfile.h b/contrib/gdb/gdb/symfile.h
index 0363e1e..39eb308 100644
--- a/contrib/gdb/gdb/symfile.h
+++ b/contrib/gdb/gdb/symfile.h
@@ -1,22 +1,24 @@
/* Definitions for reading symbol files into GDB.
- Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,270 +33,296 @@ 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;
+ };
+
+/* Define an array of addresses to accommodate non-contiguous dynamic
+ loading of modules. This is for use when entering commands, so we
+ can keep track of the section names until we read the file and
+ can map them to bfd sections. This structure is also used by
+ solib.c to communicate the section addresses in shared objects to
+ symbol_file_add (). */
+
+#define MAX_SECTIONS 64
+struct section_addr_info
+{
+ /* Sections whose names are file format dependent. */
+ struct other_sections
+ {
+ CORE_ADDR addr;
+ char *name;
+ int sectindex;
+ } other[MAX_SECTIONS];
};
/* 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) (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) (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, mainline)
+ Reads a symbol file into a psymtab (or possibly a symtab).
+ OBJFILE is the objfile struct for the file we are reading.
+ 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) (struct objfile *, 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) (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. */
- /* 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. */
+ void (*sym_offsets) (struct objfile *, struct section_addr_info *);
- 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));
+extern void
+default_symfile_offsets (struct objfile *objfile, struct section_addr_info *);
extern void
-extend_psymbol_list PARAMS ((struct psymbol_allocation_list *,
- struct objfile *));
+extend_psymbol_list (struct psymbol_allocation_list *, struct objfile *);
/* Add any kind of symbol to a psymbol_allocation_list. */
/* #include "demangle.h" */
extern void
-add_psymbol_to_list PARAMS ((char *, int, namespace_enum, enum address_class,
- struct psymbol_allocation_list *, long, CORE_ADDR,
- enum language, struct objfile *));
+add_psymbol_to_list (char *, int, namespace_enum, enum address_class,
+ 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 (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));
+extern void init_psymbol_list (struct objfile *, int);
-extern void
-sort_pst_symbols PARAMS ((struct partial_symtab *));
+extern void sort_pst_symbols (struct partial_symtab *);
-extern struct symtab *
-allocate_symtab PARAMS ((char *, struct objfile *));
+extern struct symtab *allocate_symtab (char *, struct objfile *);
-extern int
-free_named_symtabs PARAMS ((char *));
+extern int free_named_symtabs (char *);
-extern void
-fill_in_vptr_fieldno PARAMS ((struct type *));
+extern void fill_in_vptr_fieldno (struct type *);
-extern void
-add_symtab_fns PARAMS ((struct sym_fns *));
+extern void add_symtab_fns (struct sym_fns *);
-extern void
-init_entry_point_info PARAMS ((struct objfile *));
+extern void init_entry_point_info (struct objfile *);
extern void
-syms_from_objfile PARAMS ((struct objfile *, CORE_ADDR, int, int));
+syms_from_objfile (struct objfile *, struct section_addr_info *, int, int);
+
+extern void new_symfile_objfile (struct objfile *, int, int);
+
+extern struct objfile *symbol_file_add (char *, int,
+ struct section_addr_info *, int, int);
+
+/* Build (allocate and populate) a section_addr_info struct from
+ an existing section table. */
+
+struct section_table;
+extern struct section_addr_info *
+build_section_addr_info_from_section_table (const struct section_table *start,
+ const struct section_table *end);
+
+/* Free all memory allocated by build_section_addr_info_from_section_table. */
extern void
-new_symfile_objfile PARAMS ((struct objfile *, int, int));
+free_section_addr_info (struct section_addr_info *);
-extern struct partial_symtab *
-start_psymtab_common PARAMS ((struct objfile *, struct section_offsets *,
- char *, CORE_ADDR,
- struct partial_symbol **,
- struct partial_symbol **));
+
+extern struct partial_symtab *start_psymtab_common (struct objfile *,
+ struct section_offsets *,
+ char *, CORE_ADDR,
+ struct partial_symbol **,
+ struct partial_symbol **);
/* Sorting your symbols for fast lookup or alphabetical printing. */
-extern void
-sort_block_syms PARAMS ((struct block *));
+extern void sort_block_syms (struct block *);
-extern void
-sort_symtab_syms PARAMS ((struct symtab *));
+extern void sort_symtab_syms (struct symtab *);
/* Make a copy of the string at PTR with SIZE characters in the symbol obstack
(and add a null character at the end in the copy).
Returns the address of the copy. */
-extern char *
-obsavestring PARAMS ((char *, int, struct obstack *));
+extern char *obsavestring (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 *));
+extern char *obconcat (struct obstack *obstackp, const char *, const char *,
+ const char *);
/* Variables */
-/* whether to auto load solibs at startup time: 0/1.
-
- On all platforms, 0 means "don't auto load".
+/* If non-zero, shared library symbols will be added automatically
+ when the inferior is created, new libraries are loaded, or when
+ attaching to the inferior. This is almost always what users will
+ want to have happen; but for very large programs, the startup time
+ will be excessive, and so if this is a problem, the user can clear
+ this flag and then add the shared library symbols as needed. Note
+ that there is a potential for confusion, since if the shared
+ library symbols are not loaded, commands like "info fun" will *not*
+ report all the functions that are actually present. */
- On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
- be auto loaded. When the cumulative size of solib symbol table exceeds
- this threshhold, solibs' symbol tables will not be loaded.
+extern int auto_solib_add;
- On other platforms, > 0 means, "always auto load".
- */
+/* For systems that support it, a threshold size in megabytes. If
+ automatically adding a new library's symbol table to those already
+ known to the debugger would cause the total shared library symbol
+ size to exceed this threshhold, then the shlib's symbols are not
+ added. The threshold is ignored if the user explicitly asks for a
+ shlib to be added, such as when using the "sharedlibrary"
+ command. */
-extern int auto_solib_add;
+extern int auto_solib_limit;
/* From symfile.c */
-extern CORE_ADDR
-entry_point_address PARAMS ((void));
+extern CORE_ADDR entry_point_address (void);
-extern struct partial_symtab *
-allocate_psymtab PARAMS ((char *, struct objfile *));
+extern struct partial_symtab *allocate_psymtab (char *, struct objfile *);
-extern void
-discard_psymtab PARAMS ((struct partial_symtab *));
+extern void discard_psymtab (struct partial_symtab *);
-extern void find_lowest_section PARAMS ((bfd *, asection *, PTR));
+extern void find_lowest_section (bfd *, asection *, PTR);
-extern bfd * symfile_bfd_open PARAMS ((char *));
+extern bfd *symfile_bfd_open (char *);
-/* Remote targets may wish to use this as their load function. */
-extern void generic_load PARAMS ((char *name, int from_tty));
+extern int get_section_index (struct objfile *, char *);
/* Utility functions for overlay sections: */
-extern int overlay_debugging;
+extern enum overlay_debugging_state {
+ ovly_off,
+ ovly_on,
+ ovly_auto
+} 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 (CORE_ADDR);
/* return any overlay section containing the PC (even in its LMA region) */
-extern asection *
-find_pc_overlay PARAMS ((CORE_ADDR));
+extern asection *find_pc_overlay (CORE_ADDR);
/* return true if the section is an overlay */
-extern int
-section_is_overlay PARAMS ((asection *));
+extern int section_is_overlay (asection *);
/* return true if the overlay section is currently "mapped" */
-extern int
-section_is_mapped PARAMS ((asection *));
+extern int section_is_mapped (asection *);
/* return true if pc belongs to section's VMA */
-extern CORE_ADDR
-pc_in_mapped_range PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR pc_in_mapped_range (CORE_ADDR, asection *);
/* return true if pc belongs to section's LMA */
-extern CORE_ADDR
-pc_in_unmapped_range PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR pc_in_unmapped_range (CORE_ADDR, asection *);
/* map an address from a section's LMA to its VMA */
-extern CORE_ADDR
-overlay_mapped_address PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR overlay_mapped_address (CORE_ADDR, asection *);
/* map an address from a section's VMA to its LMA */
-extern CORE_ADDR
-overlay_unmapped_address PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR overlay_unmapped_address (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 (CORE_ADDR, asection *);
+
+/* Load symbols from a file. */
+extern void symbol_file_add_main (char *args, int from_tty);
+
+/* Clear GDB symbol tables. */
+extern void symbol_file_clear (int from_tty);
/* From dwarfread.c */
extern void
-dwarf_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int,
- file_ptr, unsigned int, file_ptr, unsigned int));
+dwarf_build_psymtabs (struct objfile *, 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 (bfd * abfd);
+
+extern void dwarf2_build_psymtabs (struct objfile *, int);
+extern void dwarf2_build_frame_info (struct objfile *);
-extern void dwarf2_build_psymtabs PARAMS ((struct objfile *,
- struct section_offsets *,
- int));
/* From mdebugread.c */
/* 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 *,
- struct ecoff_debug_info *,
- struct section_offsets *));
+mdebug_build_psymtabs (struct objfile *,
+ const struct ecoff_debug_swap *,
+ struct ecoff_debug_info *);
extern void
-elfmdebug_build_psymtabs PARAMS ((struct objfile *,
- const struct ecoff_debug_swap *,
- asection *,
- struct section_offsets *));
+elfmdebug_build_psymtabs (struct objfile *,
+ const struct ecoff_debug_swap *, asection *);
-#endif /* !defined(SYMFILE_H) */
+#endif /* !defined(SYMFILE_H) */
diff --git a/contrib/gdb/gdb/symmisc.c b/contrib/gdb/gdb/symmisc.c
index 97d2f6e..3c12988 100644
--- a/contrib/gdb/gdb/symmisc.c
+++ b/contrib/gdb/gdb/symmisc.c
@@ -1,22 +1,23 @@
/* Do various things to symbol tables (other than lookup), for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 1998
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,52 +49,50 @@ FILE *std_err;
/* Prototypes for local functions */
-static void dump_symtab PARAMS ((struct objfile *, struct symtab *,
- GDB_FILE *));
+static void dump_symtab (struct objfile *, struct symtab *,
+ struct ui_file *);
-static void dump_psymtab PARAMS ((struct objfile *, struct partial_symtab *,
- GDB_FILE *));
+static void dump_psymtab (struct objfile *, struct partial_symtab *,
+ struct ui_file *);
-static void dump_msymbols PARAMS ((struct objfile *, GDB_FILE *));
+static void dump_msymbols (struct objfile *, struct ui_file *);
-static void dump_objfile PARAMS ((struct objfile *));
+static void dump_objfile (struct objfile *);
-static int block_depth PARAMS ((struct block *));
+static int block_depth (struct block *);
-static void print_partial_symbols PARAMS ((struct partial_symbol **, int,
- char *, GDB_FILE *));
+static void print_partial_symbols (struct partial_symbol **, int,
+ char *, struct ui_file *);
-static void free_symtab_block PARAMS ((struct objfile *, struct block *));
+static void free_symtab_block (struct objfile *, struct block *);
-void _initialize_symmisc PARAMS ((void));
+void _initialize_symmisc (void);
-struct print_symbol_args {
- struct symbol *symbol;
- int depth;
- GDB_FILE *outfile;
-};
-
-static int print_symbol PARAMS ((PTR));
+struct print_symbol_args
+ {
+ struct symbol *symbol;
+ int depth;
+ struct ui_file *outfile;
+ };
-static void
-free_symtab_block PARAMS ((struct objfile *, struct block *));
+static int print_symbol (PTR);
+static void free_symtab_block (struct objfile *, struct block *);
+
/* Free a struct block <- B and all the symbols defined in that block. */
static void
-free_symtab_block (objfile, b)
- struct objfile *objfile;
- struct block *b;
+free_symtab_block (struct objfile *objfile, struct block *b)
{
register int i, n;
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));
+ xmfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
+ xmfree (objfile->md, (PTR) BLOCK_SYM (b, i));
}
- mfree (objfile -> md, (PTR) b);
+ xmfree (objfile->md, (PTR) b);
}
/* Free all the storage associated with the struct symtab <- S.
@@ -105,8 +104,7 @@ free_symtab_block (objfile, b)
It is s->free_code that says which alternative to use. */
void
-free_symtab (s)
- register struct symtab *s;
+free_symtab (register struct symtab *s)
{
register int i, n;
register struct blockvector *bv;
@@ -115,127 +113,124 @@ 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);
+ xmfree (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));
+ xmfree (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)
+ xmfree (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)
+ xmfree (s->objfile->md, (PTR) s->line_charpos);
+ if (s->fullname != NULL)
+ xmfree (s->objfile->md, s->fullname);
+ if (s->debugformat != NULL)
+ xmfree (s->objfile->md, s->debugformat);
+ xmfree (s->objfile->md, (PTR) s);
}
-#if MAINTENANCE_CMDS
-
void
-print_symbol_bcache_statistics ()
+print_symbol_bcache_statistics (void)
{
struct objfile *objfile;
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--;
}
void
-print_objfile_statistics ()
+print_objfile_statistics (void)
{
struct objfile *objfile;
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
-dump_objfile (objfile)
- struct objfile *objfile;
+static void
+dump_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);
+ gdb_print_host_address (objfile, gdb_stdout);
printf_filtered (", bfd at ");
- gdb_print_address (objfile->obfd, gdb_stdout);
+ gdb_print_host_address (objfile->obfd, gdb_stdout);
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);
- gdb_print_address (psymtab, gdb_stdout);
+ psymtab->filename);
+ gdb_print_host_address (psymtab, gdb_stdout);
printf_filtered (", ");
- if (psymtab -> objfile != objfile)
+ if (psymtab->objfile != objfile)
{
printf_filtered ("NOT ON CHAIN! ");
}
@@ -244,17 +239,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);
- gdb_print_address (symtab, gdb_stdout);
+ printf_filtered ("%s at ", symtab->filename);
+ gdb_print_host_address (symtab, gdb_stdout);
printf_filtered (", ");
- if (symtab -> objfile != objfile)
+ if (symtab->objfile != objfile)
{
printf_filtered ("NOT ON CHAIN! ");
}
@@ -265,57 +260,55 @@ dump_objfile (objfile)
}
/* Print minimal symbols from this objfile. */
-
-static void
-dump_msymbols (objfile, outfile)
- struct objfile *objfile;
- GDB_FILE *outfile;
+
+static void
+dump_msymbols (struct objfile *objfile, struct ui_file *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);
@@ -334,39 +327,37 @@ 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");
}
static void
-dump_psymtab (objfile, psymtab, outfile)
- struct objfile *objfile;
- struct partial_symtab *psymtab;
- GDB_FILE *outfile;
+dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
+ struct ui_file *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);
+ gdb_print_host_address (psymtab, outfile);
fprintf_filtered (outfile, ")\n\n");
fprintf_unfiltered (outfile, " Read from object file %s (",
- objfile -> name);
- gdb_print_address (objfile, outfile);
+ objfile->name);
+ gdb_print_host_address (objfile, outfile);
fprintf_unfiltered (outfile, ")\n");
- if (psymtab -> readin)
+ if (psymtab->readin)
{
fprintf_filtered (outfile,
- " Full symtab was read (at ");
- gdb_print_address (psymtab->symtab, outfile);
+ " Full symtab was read (at ");
+ gdb_print_host_address (psymtab->symtab, outfile);
fprintf_filtered (outfile, " by function at ");
- gdb_print_address ((PTR)psymtab->read_symtab, outfile);
+ gdb_print_host_address ((PTR) psymtab->read_symtab, outfile);
fprintf_filtered (outfile, ")\n");
}
@@ -388,39 +379,38 @@ 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_host_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
-dump_symtab (objfile, symtab, outfile)
- struct objfile *objfile;
- struct symtab *symtab;
- GDB_FILE *outfile;
+static void
+dump_symtab (struct objfile *objfile, struct symtab *symtab,
+ struct ui_file *outfile)
{
register int i, j;
int len, blen;
register struct linetable *l;
struct blockvector *bv;
+ struct symbol *sym;
register struct block *b;
int depth;
@@ -429,7 +419,7 @@ dump_symtab (objfile, symtab, outfile)
fprintf_filtered (outfile, "Compilation directory is %s\n",
symtab->dirname);
fprintf_filtered (outfile, "Read from object file %s (", objfile->name);
- gdb_print_address (objfile, outfile);
+ gdb_print_host_address (objfile, outfile);
fprintf_filtered (outfile, ")\n");
fprintf_filtered (outfile, "Language: %s\n", language_str (symtab->language));
@@ -448,7 +438,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);
@@ -459,11 +449,11 @@ dump_symtab (objfile, symtab, outfile)
depth = block_depth (b) * 2;
print_spaces (depth, outfile);
fprintf_filtered (outfile, "block #%03d, object at ", i);
- gdb_print_address (b, outfile);
+ gdb_print_host_address (b, outfile);
if (BLOCK_SUPERBLOCK (b))
{
fprintf_filtered (outfile, " under ");
- gdb_print_address (BLOCK_SUPERBLOCK (b), outfile);
+ gdb_print_host_address (BLOCK_SUPERBLOCK (b), outfile);
}
blen = BLOCK_NSYMS (b);
fprintf_filtered (outfile, ", %d syms in ", blen);
@@ -476,17 +466,18 @@ 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++)
+ /* Now print each symbol in this block. */
+ /* FIXMED: Sort? */
+ ALL_BLOCK_SYMBOLS (b, j, sym)
{
struct print_symbol_args s;
- s.symbol = BLOCK_SYM (b, j);
+ s.symbol = sym;
s.depth = depth + 1;
s.outfile = outfile;
catch_errors (print_symbol, &s, "Error printing symbol:\n",
@@ -502,12 +493,10 @@ dump_symtab (objfile, symtab, outfile)
}
void
-maintenance_print_symbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_symbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
@@ -525,7 +514,7 @@ Arguments missing: an output file name and an optional symbol file name");
{
nomem (0);
}
- cleanups = make_cleanup ((make_cleanup_func) freeargv, (char *) argv);
+ cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
{
@@ -538,17 +527,17 @@ Arguments missing: an output file name and an optional symbol file name");
}
filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
+ make_cleanup (xfree, filename);
+
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, (char *) &outfile);
+ make_cleanup_ui_file_delete (outfile);
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);
}
@@ -559,12 +548,11 @@ Arguments missing: an output file name and an optional symbol file name");
1 for success. */
static int
-print_symbol (args)
- PTR args;
+print_symbol (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;
+ struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
print_spaces (depth, outfile);
if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
@@ -573,8 +561,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;
@@ -588,11 +576,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");
@@ -629,13 +617,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
@@ -645,7 +633,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;
@@ -660,7 +648,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:
@@ -682,12 +670,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:
@@ -705,7 +693,7 @@ print_symbol (args)
case LOC_BLOCK:
fprintf_filtered (outfile, "block object ");
- gdb_print_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
+ gdb_print_host_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
fprintf_filtered (outfile, ", ");
print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)),
1,
@@ -729,7 +717,7 @@ print_symbol (args)
fprintf_filtered (outfile, "optimized out");
break;
- default:
+ default:
fprintf_filtered (outfile, "botched symbol class %x",
SYMBOL_CLASS (symbol));
break;
@@ -740,12 +728,10 @@ print_symbol (args)
}
void
-maintenance_print_psymbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_psymbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
@@ -762,7 +748,7 @@ maintenance_print_psymbols (args, from_tty)
{
nomem (0);
}
- cleanups = make_cleanup ((make_cleanup_func) freeargv, (char *) argv);
+ cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
{
@@ -775,32 +761,29 @@ maintenance_print_psymbols (args, from_tty)
}
filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
+ make_cleanup (xfree, filename);
+
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, &outfile);
+ make_cleanup_ui_file_delete (outfile);
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);
}
static void
-print_partial_symbols (p, count, what, outfile)
- struct partial_symbol **p;
- int count;
- char *what;
- GDB_FILE *outfile;
+print_partial_symbols (struct partial_symbol **p, int count, char *what,
+ struct ui_file *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));
@@ -889,12 +872,10 @@ print_partial_symbols (p, count, what, outfile)
}
void
-maintenance_print_msymbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_msymbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *filename = DEV_TTY;
char *symname = NULL;
@@ -910,7 +891,7 @@ maintenance_print_msymbols (args, from_tty)
{
nomem (0);
}
- cleanups = make_cleanup ((make_cleanup_func) freeargv, argv);
+ cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
{
@@ -923,26 +904,24 @@ maintenance_print_msymbols (args, from_tty)
}
filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
+ make_cleanup (xfree, filename);
+
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, &outfile);
+ make_cleanup_ui_file_delete (outfile);
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);
}
void
-maintenance_print_objfiles (ignore, from_tty)
- char *ignore;
- int from_tty;
+maintenance_print_objfiles (char *ignore, int from_tty)
{
struct objfile *objfile;
@@ -957,9 +936,7 @@ maintenance_print_objfiles (ignore, from_tty)
/* Check consistency of psymtabs and symtabs. */
void
-maintenance_check_symtabs (ignore, from_tty)
- char *ignore;
- int from_tty;
+maintenance_check_symtabs (char *ignore, int from_tty)
{
register struct symbol *sym;
register struct partial_symbol **psym;
@@ -971,114 +948,110 @@ 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");
+ }
+ }
}
-
+
/* Return the nexting depth of a block within other blocks in its symtab. */
static int
-block_depth (block)
- struct block *block;
+block_depth (struct block *block)
{
register int i = 0;
- while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
+ while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
{
i++;
}
return i;
}
-
-#endif /* MAINTENANCE_CMDS */
-
+
/* Increase the space allocated for LISTP, which is probably
global_psymbols or static_psymbols. This space will eventually
be freed in free_objfile(). */
void
-extend_psymbol_list (listp, objfile)
- register struct psymbol_allocation_list *listp;
- struct objfile *objfile;
+extend_psymbol_list (register struct psymbol_allocation_list *listp,
+ struct objfile *objfile)
{
int new_size;
if (listp->size == 0)
{
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
@@ -1090,9 +1063,9 @@ extend_psymbol_list (listp, objfile)
/* Do early runtime initializations. */
void
-_initialize_symmisc ()
+_initialize_symmisc (void)
{
- std_in = stdin;
+ std_in = stdin;
std_out = stdout;
std_err = stderr;
}
diff --git a/contrib/gdb/gdb/symtab.h b/contrib/gdb/gdb/symtab.h
index 67e6bed..75470e6 100644
--- a/contrib/gdb/gdb/symtab.h
+++ b/contrib/gdb/gdb/symtab.h
@@ -1,22 +1,24 @@
/* Symbol table definitions for GDB.
- Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
- Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -25,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
+#define obstack_chunk_free xfree
#include "bcache.h"
/* Don't do this; it means that if some .o's are compiled with GNU C
@@ -36,7 +38,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 +50,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 (CORE_ADDR, asection *);
#define SYMBOL_NAME(symbol) (symbol)->ginfo.name
#define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue
@@ -166,6 +171,8 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
do { \
char *demangled = NULL; \
+ if (SYMBOL_LANGUAGE (symbol) == language_unknown) \
+ SYMBOL_LANGUAGE (symbol) = language_auto; \
if (SYMBOL_LANGUAGE (symbol) == language_cplus \
|| SYMBOL_LANGUAGE (symbol) == language_auto) \
{ \
@@ -176,7 +183,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
SYMBOL_LANGUAGE (symbol) = language_cplus; \
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = \
obsavestring (demangled, strlen (demangled), (obstack)); \
- free (demangled); \
+ xfree (demangled); \
} \
else \
{ \
@@ -193,7 +200,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
SYMBOL_LANGUAGE (symbol) = language_java; \
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = \
obsavestring (demangled, strlen (demangled), (obstack)); \
- free (demangled); \
+ xfree (demangled); \
} \
else \
{ \
@@ -211,17 +218,13 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
SYMBOL_LANGUAGE (symbol) = language_chill; \
SYMBOL_CHILL_DEMANGLED_NAME (symbol) = \
obsavestring (demangled, strlen (demangled), (obstack)); \
- free (demangled); \
+ xfree (demangled); \
} \
else \
{ \
SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; \
} \
} \
- if (SYMBOL_LANGUAGE (symbol) == language_auto) \
- { \
- SYMBOL_LANGUAGE (symbol) = language_unknown; \
- } \
} while (0)
/* Macro that returns the demangled name for a symbol based on the language
@@ -270,7 +273,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 +283,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 +297,82 @@ 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;
+
+ /* Minimal symbols with the same hash key are kept on a linked
+ list. This is the link. */
+
+ struct minimal_symbol *hash_next;
+
+ /* Minimal symbols are stored in two different hash tables. This is
+ the `next' pointer for the demangled hash table. */
+
+ struct minimal_symbol *demangled_hash_next;
+ };
#define MSYMBOL_INFO(msymbol) (msymbol)->info
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
+
/* 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 +400,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 +417,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
@@ -452,204 +467,213 @@ struct block
#define BLOCK_SUPERBLOCK(bl) (bl)->superblock
#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag
+/* Macro to loop through all symbols in a block BL.
+ i counts which symbol we are looking at, and sym points to the current
+ symbol. */
+#define ALL_BLOCK_SYMBOLS(bl, i, sym) \
+ for ((i) = 0, (sym) = BLOCK_SYM ((bl), (i)); \
+ (i) < BLOCK_NSYMS ((bl)); \
+ ++(i), (sym) = BLOCK_SYM ((bl), (i)))
+
/* Nonzero if symbols of block BL should be sorted alphabetically.
Don't sort a block which corresponds to a function. If we did the
sorting would have to preserve the order of the symbols for the
arguments. */
#define BLOCK_SHOULD_SORT(bl) ((bl)->nsyms >= 40 && BLOCK_FUNCTION (bl) == NULL)
-
+
/* 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. */
- /* VAR_NAMESPACE is the usual namespace. In C, this contains variables,
- function names, typedef names and enum type values. */
+ UNDEF_NAMESPACE,
- VAR_NAMESPACE,
+ /* VAR_NAMESPACE is the usual namespace. In C, this contains variables,
+ function names, typedef names and enum type values. */
- /* 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. */
+ VAR_NAMESPACE,
- 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. */
- /* LABEL_NAMESPACE may be used for names of labels (for gotos);
- currently it is not used and labels are not recorded at all. */
+ STRUCT_NAMESPACE,
- LABEL_NAMESPACE,
+ /* LABEL_NAMESPACE may be used for names of labels (for gotos);
+ currently it is not used and labels are not recorded at all. */
- /* Searching namespaces. These overlap with VAR_NAMESPACE, providing
- some granularity with the search_symbols function. */
+ LABEL_NAMESPACE,
- /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
- METHODS_NAMESPACE */
- VARIABLES_NAMESPACE,
+ /* Searching namespaces. These overlap with VAR_NAMESPACE, providing
+ some granularity with the search_symbols function. */
- /* All functions -- for some reason not methods, though. */
- FUNCTIONS_NAMESPACE,
+ /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
+ METHODS_NAMESPACE */
+ VARIABLES_NAMESPACE,
- /* All defined types */
- TYPES_NAMESPACE,
+ /* All functions -- for some reason not methods, though. */
+ FUNCTIONS_NAMESPACE,
- /* All class methods -- why is this separated out? */
- METHODS_NAMESPACE
+ /* All defined types */
+ TYPES_NAMESPACE,
-} namespace_enum;
+ /* All class methods -- why is this separated out? */
+ METHODS_NAMESPACE
+
+ }
+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 +683,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;
- unsigned short line;
-
- /* Some symbols require an additional value to be recorded on a per-
- symbol basis. Stash those values here. */
+ /* 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;
+ 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 +749,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
-
+
/* Source-file information. This describes the relation between source files,
- ine numbers and addresses in the program text. */
+ line 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 +784,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 +796,33 @@ 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.
- */
+ If an entry has a line number of zero, it marks the start of a PC
+ range for which no line number information is available. It is
+ acceptable, though wasteful of table space, for such a range to be
+ zero length. */
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,18 +836,20 @@ 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])
+#define ANOFFSET(secoff, whichone) \
+ ((whichone == -1) \
+ ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
+ : secoff->offsets[whichone])
/* The maximum possible size of a section_offsets table. */
-
+
#define SIZEOF_SECTION_OFFSETS \
(sizeof (struct section_offsets) \
+ sizeof (((struct section_offsets *) 0)->offsets) * (SECT_OFF_MAX-1))
-
/* Each source file or header is represented by a struct symtab.
These objects are chained through the `next' field. */
@@ -848,7 +877,7 @@ struct symtab
int block_line_section;
/* If several symtabs share a blockvector, exactly one of them
- should be designed the primary, so that the blockvector
+ should be designated the primary, so that the blockvector
is relocated exactly once by objfile_relocate. */
int primary;
@@ -864,19 +893,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 +946,8 @@ struct symtab
#define BLOCKVECTOR(symtab) (symtab)->blockvector
#define LINETABLE(symtab) (symtab)->linetable
-
+
/* 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 +960,94 @@ 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;
+
+ /* Full path of the source file. NULL if not known. */
+
+ char *fullname;
- /* 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) (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))
-
+
/* The virtual function table is now an array of structures which have the
form { int16 offset, delta; void *pfn; }.
@@ -1025,36 +1058,9 @@ 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
- names. If you leave out the parenthesis here you will lose!
- Currently 'o' 'p' CPLUS_MARKER is used for both the symbol in the
- symbol-file and the names in gdb's symbol table.
- Note that this macro is g++ specific (FIXME). */
-
-#define OPNAME_PREFIX_P(NAME) \
- ((NAME)[0] == 'o' && (NAME)[1] == 'p' && is_cplus_marker ((NAME)[2]))
-/* Macro that yields non-zero value iff NAME is the prefix for C++ vtbl
- names. Note that this macro is g++ specific (FIXME).
- '_vt$' is the old cfront-style vtables; '_VT$' is the new
- style, using thunks (where '$' is really CPLUS_MARKER). */
-
-#define VTBL_PREFIX_P(NAME) \
- ((NAME)[0] == '_' \
- && (((NAME)[1] == 'V' && (NAME)[2] == 'T') \
- || ((NAME)[1] == 'v' && (NAME)[2] == 't')) \
- && is_cplus_marker ((NAME)[3]))
-
-/* Macro that yields non-zero value iff NAME is the prefix for C++ destructor
- names. Note that this macro is g++ specific (FIXME). */
-
-#define DESTRUCTOR_PREFIX_P(NAME) \
- ((NAME)[0] == '_' && is_cplus_marker ((NAME)[1]) && (NAME)[2] == '_')
+#define VTBL_FNADDR_OFFSET 2
-
/* External variables and functions for the objects described above. */
/* This symtab variable specifies the current file for printing source lines */
@@ -1081,110 +1087,91 @@ extern int asm_demangle;
/* lookup a symbol table by source file name */
-extern struct symtab *
-lookup_symtab PARAMS ((char *));
+extern struct symtab *lookup_symtab (const 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 **));
+extern struct symbol *lookup_symbol (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));
+
+extern struct symbol *lookup_block_symbol (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 *));
+extern struct type *lookup_struct (char *, struct block *);
-extern struct type *
-lookup_union PARAMS ((char *, struct block *));
+extern struct type *lookup_union (char *, struct block *);
-extern struct type *
-lookup_enum PARAMS ((char *, struct block *));
+extern struct type *lookup_enum (char *, struct block *);
/* lookup the function corresponding to the block */
-extern struct symbol *
-block_function PARAMS ((struct block *));
+extern struct symbol *block_function (struct block *);
/* from blockframe.c: */
/* lookup the function symbol corresponding to the address */
-extern struct symbol *
-find_pc_function PARAMS ((CORE_ADDR));
+extern struct symbol *find_pc_function (CORE_ADDR);
/* lookup the function corresponding to the address and section */
-extern struct symbol *
-find_pc_sect_function PARAMS ((CORE_ADDR, asection *));
-
+extern struct symbol *find_pc_sect_function (CORE_ADDR, asection *);
+
/* lookup function from address, return name, start addr and end addr */
-extern int
-find_pc_partial_function PARAMS ((CORE_ADDR, char **,
- CORE_ADDR *, CORE_ADDR *));
+extern int
+find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, CORE_ADDR *);
-extern void
-clear_pc_function_cache PARAMS ((void));
+extern void clear_pc_function_cache (void);
-extern int
-find_pc_sect_partial_function PARAMS ((CORE_ADDR, asection *,
- char **, CORE_ADDR *, CORE_ADDR *));
+extern int
+find_pc_sect_partial_function (CORE_ADDR, asection *,
+ char **, CORE_ADDR *, CORE_ADDR *);
/* from symtab.c: */
/* lookup partial symbol table by filename */
-extern struct partial_symtab *
-lookup_partial_symtab PARAMS ((char *));
+extern struct partial_symtab *lookup_partial_symtab (const char *);
/* lookup partial symbol table by address */
-extern struct partial_symtab *
-find_pc_psymtab PARAMS ((CORE_ADDR));
+extern struct partial_symtab *find_pc_psymtab (CORE_ADDR);
/* lookup partial symbol table by address and section */
-extern struct partial_symtab *
-find_pc_sect_psymtab PARAMS ((CORE_ADDR, asection *));
+extern struct partial_symtab *find_pc_sect_psymtab (CORE_ADDR, asection *);
/* lookup full symbol table by address */
-extern struct symtab *
-find_pc_symtab PARAMS ((CORE_ADDR));
+extern struct symtab *find_pc_symtab (CORE_ADDR);
/* lookup full symbol table by address and section */
-extern struct symtab *
-find_pc_sect_symtab PARAMS ((CORE_ADDR, asection *));
+extern struct symtab *find_pc_sect_symtab (CORE_ADDR, asection *);
/* lookup partial symbol by address */
-extern struct partial_symbol *
-find_pc_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR));
+extern struct partial_symbol *find_pc_psymbol (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 *));
+extern struct partial_symbol *find_pc_sect_psymbol (struct partial_symtab *,
+ CORE_ADDR, asection *);
-extern int
-find_pc_line_pc_range PARAMS ((CORE_ADDR, CORE_ADDR *, CORE_ADDR *));
+extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
-extern int
-contained_in PARAMS ((struct block *, struct block *));
+extern int contained_in (struct block *, struct block *);
-extern void
-reread_symbols PARAMS ((void));
+extern void reread_symbols (void);
-extern struct type *
-lookup_transparent_type PARAMS ((const char *));
+extern struct type *lookup_transparent_type (const char *);
/* Macro for name of symbol to indicate a file compiled with gcc. */
@@ -1200,71 +1187,73 @@ lookup_transparent_type PARAMS ((const char *));
/* Functions for dealing with the minimal symbol table, really a misc
address<->symbol mapping for things we don't have debug symbols for. */
-extern void prim_record_minimal_symbol PARAMS ((const char *, CORE_ADDR,
- enum minimal_symbol_type,
- struct objfile *));
+extern void prim_record_minimal_symbol (const char *, CORE_ADDR,
+ enum minimal_symbol_type,
+ struct objfile *);
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,
- struct objfile *));
+ (const char *, CORE_ADDR,
+ enum minimal_symbol_type,
+ char *info, int section, asection * bfd_section, struct objfile *);
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
-extern CORE_ADDR find_stab_function_addr PARAMS ((char *,
- struct partial_symtab *,
- struct objfile *));
+extern CORE_ADDR find_stab_function_addr (char *, char *, struct objfile *);
#endif
-extern struct minimal_symbol *
-lookup_minimal_symbol PARAMS ((const char *, const char *, struct objfile *));
+extern unsigned int msymbol_hash_iw (const char *);
-extern struct minimal_symbol *
-lookup_minimal_symbol_text PARAMS ((const char *, const char *, struct objfile *));
+extern unsigned int msymbol_hash (const char *);
-struct minimal_symbol *
-lookup_minimal_symbol_solib_trampoline PARAMS ((const char *,
- const char *,
- struct objfile *));
+extern void
+add_minsym_to_hash_table (struct minimal_symbol *sym,
+ struct minimal_symbol **table);
-extern struct minimal_symbol *
-lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR));
+extern struct minimal_symbol *lookup_minimal_symbol (const char *,
+ const char *,
+ struct objfile *);
-extern struct minimal_symbol *
-lookup_minimal_symbol_by_pc_section PARAMS ((CORE_ADDR, asection *));
+extern struct minimal_symbol *lookup_minimal_symbol_text (const char *,
+ const char *,
+ struct objfile *);
-extern struct minimal_symbol *
-lookup_solib_trampoline_symbol_by_pc PARAMS ((CORE_ADDR));
+struct minimal_symbol *lookup_minimal_symbol_solib_trampoline (const char *,
+ const char *,
+ struct objfile
+ *);
-extern CORE_ADDR
-find_solib_trampoline_target PARAMS ((CORE_ADDR));
+extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
-extern void
-init_minimal_symbol_collection PARAMS ((void));
+extern struct minimal_symbol *lookup_minimal_symbol_by_pc_section (CORE_ADDR,
+ asection
+ *);
-extern void
-discard_minimal_symbols PARAMS ((int));
+extern struct minimal_symbol
+ *lookup_solib_trampoline_symbol_by_pc (CORE_ADDR);
-extern void
-install_minimal_symbols PARAMS ((struct objfile *));
+extern CORE_ADDR find_solib_trampoline_target (CORE_ADDR);
+
+extern void init_minimal_symbol_collection (void);
+
+extern struct cleanup *make_cleanup_discard_minimal_symbols (void);
+
+extern void install_minimal_symbols (struct objfile *);
/* Sort all the minimal symbols in OBJFILE. */
-extern void msymbols_sort PARAMS ((struct objfile *objfile));
+extern void msymbols_sort (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 +1264,36 @@ struct symtab_and_line
}
struct symtabs_and_lines
-{
- struct symtab_and_line *sals;
- int nelts;
-};
+ {
+ struct symtab_and_line *sals;
+ int nelts;
+ };
+
-
/* 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)
@@ -1318,160 +1309,144 @@ struct exception_event_record {
/* Given a pc value, return line number it is in. Second arg nonzero means
if pc is on the boundary use the previous statement's line number. */
-extern struct symtab_and_line
-find_pc_line PARAMS ((CORE_ADDR, int));
+extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
/* Same function, but specify a section as well as an address */
-extern struct symtab_and_line
-find_pc_sect_line PARAMS ((CORE_ADDR, asection *, int));
+extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, asection *, int);
/* Given an address, return the nearest symbol at or below it in memory.
Optionally return the symtab it's from through 2nd arg, and the
address in inferior memory of the symbol through 3rd arg. */
-extern struct symbol *
-find_addr_symbol PARAMS ((CORE_ADDR, struct symtab **, CORE_ADDR *));
+extern struct symbol *find_addr_symbol (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 find_line_pc (struct symtab *, int, CORE_ADDR *);
-extern int
-find_line_pc_range PARAMS ((struct symtab_and_line,
- CORE_ADDR *, CORE_ADDR *));
+extern int
+find_line_pc_range (struct symtab_and_line, CORE_ADDR *, CORE_ADDR *);
-extern void
-resolve_sal_pc PARAMS ((struct symtab_and_line *));
+extern void resolve_sal_pc (struct symtab_and_line *);
/* Given a string, return the line specified by it. For commands like "list"
and "breakpoint". */
-extern struct symtabs_and_lines
-decode_line_spec PARAMS ((char *, int));
-
-extern struct symtabs_and_lines
-decode_line_spec_1 PARAMS ((char *, int));
-
-extern struct symtabs_and_lines
-decode_line_1 PARAMS ((char **, int, struct symtab *, int, char ***));
+extern struct symtabs_and_lines decode_line_spec (char *, int);
-#if MAINTENANCE_CMDS
+extern struct symtabs_and_lines decode_line_spec_1 (char *, int);
/* Symmisc.c */
-void
-maintenance_print_symbols PARAMS ((char *, int));
+void maintenance_print_symbols (char *, int);
-void
-maintenance_print_psymbols PARAMS ((char *, int));
+void maintenance_print_psymbols (char *, int);
-void
-maintenance_print_msymbols PARAMS ((char *, int));
+void maintenance_print_msymbols (char *, int);
-void
-maintenance_print_objfiles PARAMS ((char *, int));
+void maintenance_print_objfiles (char *, int);
-void
-maintenance_check_symtabs PARAMS ((char *, int));
+void maintenance_check_symtabs (char *, int);
/* maint.c */
-void
-maintenance_print_statistics PARAMS ((char *, int));
+void maintenance_print_statistics (char *, int);
-#endif
-
-extern void
-free_symtab PARAMS ((struct symtab *));
+extern void free_symtab (struct symtab *);
/* Symbol-reading stuff in symfile.c and solib.c. */
-extern struct symtab *
-psymtab_to_symtab PARAMS ((struct partial_symtab *));
+extern struct symtab *psymtab_to_symtab (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));
+extern void clear_solib (void);
/* source.c */
-extern int
-identify_source_line PARAMS ((struct symtab *, int, int, CORE_ADDR));
+extern int identify_source_line (struct symtab *, int, int, CORE_ADDR);
-extern void
-print_source_lines PARAMS ((struct symtab *, int, int, int));
+extern void print_source_lines (struct symtab *, int, int, int);
-extern void
-forget_cached_source_info PARAMS ((void));
+extern void forget_cached_source_info (void);
-extern void
-select_source_symtab PARAMS ((struct symtab *));
+extern void select_source_symtab (struct symtab *);
+
+extern char **make_symbol_completion_list (char *, char *);
+
+extern char **make_file_symbol_completion_list (char *, char *, char *);
-extern char **make_symbol_completion_list PARAMS ((char *, char *));
+extern struct symbol **make_symbol_overload_list (struct symbol *);
-extern struct symbol **
-make_symbol_overload_list PARAMS ((struct symbol *));
+extern char **make_source_files_completion_list (char *, char *);
/* symtab.c */
-extern struct partial_symtab *
-find_main_psymtab PARAMS ((void));
+extern struct partial_symtab *find_main_psymtab (void);
+
+extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
+
+extern struct symtab_and_line find_function_start_sal (struct symbol *sym, int);
/* blockframe.c */
-extern struct blockvector *
-blockvector_for_pc PARAMS ((CORE_ADDR, int *));
+extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *);
-extern struct blockvector *
-blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *,
- struct symtab *));
+extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *,
+ int *, struct symtab *);
/* symfile.c */
-extern void
-clear_symtab_users PARAMS ((void));
+extern void clear_symtab_users (void);
-extern enum language
-deduce_language_from_filename PARAMS ((char *));
+extern enum language deduce_language_from_filename (char *);
/* symtab.c */
-extern int
-in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start));
+extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
-extern struct symbol *
-fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
+extern struct symbol *fixup_symbol_section (struct symbol *,
+ struct objfile *);
+
+extern struct partial_symbol *fixup_psymbol_section (struct partial_symbol
+ *psym,
+ struct objfile *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! */
+ Callers must free the search list using free_search_symbols! */
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 *));
+extern void search_symbols (char *, namespace_enum, int, char **,
+ struct symbol_search **);
+extern void free_search_symbols (struct symbol_search *);
+extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search *);
+
+/* The name of the ``main'' function.
+ FIXME: cagney/2001-03-20: Can't make main_name() const since some
+ of the calling code currently assumes that the string isn't
+ const. */
+extern void set_main_name (const char *name);
+extern /*const*/ char *main_name (void);
#endif /* !defined(SYMTAB_H) */
diff --git a/contrib/gdb/gdb/terminal.h b/contrib/gdb/gdb/terminal.h
index e7fb2cb..cb16451 100644
--- a/contrib/gdb/gdb/terminal.h
+++ b/contrib/gdb/gdb/terminal.h
@@ -1,21 +1,23 @@
/* Terminal interface definitions for GDB, the GNU Debugger.
- Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
@@ -29,8 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
nothing has already defined the one of the names, and do the right
thing. */
-/* nothing works with go32, and the headers aren't complete */
-#if !defined (__GO32__)
#if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY)
#if defined(HAVE_TERMIOS_H)
#define HAVE_TERMIOS
@@ -44,13 +44,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* ! defined (HAVE_TERMIO_H) */
#endif /* ! defined (HAVE_TERMIOS_H) */
#endif /* !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY) */
-#endif /* ! defined (__GO32__) */
#if defined(HAVE_TERMIOS)
#include <termios.h>
#endif
-#if !defined(__GO32__) && !defined(_WIN32) && !defined (HAVE_TERMIOS)
+#if !defined(_WIN32) && !defined (HAVE_TERMIOS)
/* Define a common set of macros -- BSD based -- and redefine whatever
the system offers to make it look like that. FIXME: serial.h and
@@ -79,7 +78,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* sgtty */
#endif
-extern void new_tty PARAMS ((void));
+extern void new_tty (void);
/* Do we have job control? Can be assumed to always be the same within
a given run of GDB. In inflow.c. */
@@ -87,6 +86,6 @@ extern int job_control;
/* Set the process group of the caller to its own pid, or do nothing if
we lack job control. */
-extern int gdb_setpgid PARAMS ((void));
+extern int gdb_setpgid (void);
-#endif /* !defined (TERMINAL_H) */
+#endif /* !defined (TERMINAL_H) */
diff --git a/contrib/gdb/gdb/thread-db.c b/contrib/gdb/gdb/thread-db.c
new file mode 100644
index 0000000..2e7620e
--- /dev/null
+++ b/contrib/gdb/gdb/thread-db.c
@@ -0,0 +1,1044 @@
+/* libthread_db assisted debugging support, generic parts.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "gdb_assert.h"
+#include <dlfcn.h>
+#include "gdb_proc_service.h"
+#include "gdb_thread_db.h"
+
+#include "bfd.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "target.h"
+#include "regcache.h"
+
+#ifndef LIBTHREAD_DB_SO
+#define LIBTHREAD_DB_SO "libthread_db.so.1"
+#endif
+
+/* If we're running on GNU/Linux, we must explicitly attach to any new
+ threads. */
+
+/* FIXME: There is certainly some room for improvements:
+ - Cache LWP ids.
+ - Bypass libthread_db when fetching or storing registers for
+ threads bound to a LWP. */
+
+/* This module's target vector. */
+static struct target_ops thread_db_ops;
+
+/* The target vector that we call for things this module can't handle. */
+static struct target_ops *target_beneath;
+
+/* Pointer to the next function on the objfile event chain. */
+static void (*target_new_objfile_chain) (struct objfile *objfile);
+
+/* Non-zero if we're using this module's target vector. */
+static int using_thread_db;
+
+/* Non-zero if we have to keep this module's target vector active
+ across re-runs. */
+static int keep_thread_db;
+
+/* Non-zero if we have determined the signals used by the threads
+ library. */
+static int thread_signals;
+static sigset_t thread_stop_set;
+static sigset_t thread_print_set;
+
+/* Structure that identifies the child process for the
+ <proc_service.h> interface. */
+static struct ps_prochandle proc_handle;
+
+/* Connection to the libthread_db library. */
+static td_thragent_t *thread_agent;
+
+/* Pointers to the libthread_db functions. */
+
+static td_err_e (*td_init_p) (void);
+
+static td_err_e (*td_ta_new_p) (struct ps_prochandle *ps, td_thragent_t **ta);
+static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
+ td_thrhandle_t *__th);
+static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, lwpid_t lwpid,
+ td_thrhandle_t *th);
+static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
+ td_thr_iter_f *callback,
+ void *cbdata_p, td_thr_state_e state,
+ int ti_pri, sigset_t *ti_sigmask_p,
+ unsigned int ti_user_flags);
+static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
+ td_event_e event, td_notify_t *ptr);
+static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
+ td_thr_events_t *event);
+static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
+ td_event_msg_t *msg);
+
+static td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th);
+static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
+ td_thrinfo_t *infop);
+static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
+ gdb_prfpregset_t *regset);
+static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
+ prgregset_t gregs);
+static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
+ const gdb_prfpregset_t *fpregs);
+static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
+ prgregset_t gregs);
+static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
+
+/* Location of the thread creation event breakpoint. The code at this
+ location in the child process will be called by the pthread library
+ whenever a new thread is created. By setting a special breakpoint
+ at this location, GDB can detect when a new thread is created. We
+ obtain this location via the td_ta_event_addr call. */
+static CORE_ADDR td_create_bp_addr;
+
+/* Location of the thread death event breakpoint. */
+static CORE_ADDR td_death_bp_addr;
+
+/* Prototypes for local functions. */
+static void thread_db_find_new_threads (void);
+
+
+/* Building process ids. */
+
+#define GET_PID(ptid) ptid_get_pid (ptid)
+#define GET_LWP(ptid) ptid_get_lwp (ptid)
+#define GET_THREAD(ptid) ptid_get_tid (ptid)
+
+#define is_lwp(ptid) (GET_LWP (ptid) != 0)
+#define is_thread(ptid) (GET_THREAD (ptid) != 0)
+
+#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0)
+#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid)
+
+
+struct private_thread_info
+{
+ /* Cached LWP id. Must come first, see lin-lwp.c. */
+ lwpid_t lwpid;
+};
+
+
+static char *
+thread_db_err_str (td_err_e err)
+{
+ static char buf[64];
+
+ switch (err)
+ {
+ case TD_OK:
+ return "generic 'call succeeded'";
+ case TD_ERR:
+ return "generic error";
+ case TD_NOTHR:
+ return "no thread to satisfy query";
+ case TD_NOSV:
+ return "no sync handle to satisfy query";
+ case TD_NOLWP:
+ return "no LWP to satisfy query";
+ case TD_BADPH:
+ return "invalid process handle";
+ case TD_BADTH:
+ return "invalid thread handle";
+ case TD_BADSH:
+ return "invalid synchronization handle";
+ case TD_BADTA:
+ return "invalid thread agent";
+ case TD_BADKEY:
+ return "invalid key";
+ case TD_NOMSG:
+ return "no event message for getmsg";
+ case TD_NOFPREGS:
+ return "FPU register set not available";
+ case TD_NOLIBTHREAD:
+ return "application not linked with libthread";
+ case TD_NOEVENT:
+ return "requested event is not supported";
+ case TD_NOCAPAB:
+ return "capability not available";
+ case TD_DBERR:
+ return "debugger service failed";
+ case TD_NOAPLIC:
+ return "operation not applicable to";
+ case TD_NOTSD:
+ return "no thread-specific data for this thread";
+ case TD_MALLOC:
+ return "malloc failed";
+ case TD_PARTIALREG:
+ return "only part of register set was written/read";
+ case TD_NOXREGS:
+ return "X register set not available for this thread";
+ default:
+ snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err);
+ return buf;
+ }
+}
+
+static char *
+thread_db_state_str (td_thr_state_e state)
+{
+ static char buf[64];
+
+ switch (state)
+ {
+ case TD_THR_STOPPED:
+ return "stopped by debugger";
+ case TD_THR_RUN:
+ return "runnable";
+ case TD_THR_ACTIVE:
+ return "active";
+ case TD_THR_ZOMBIE:
+ return "zombie";
+ case TD_THR_SLEEP:
+ return "sleeping";
+ case TD_THR_STOPPED_ASLEEP:
+ return "stopped by debugger AND blocked";
+ default:
+ snprintf (buf, sizeof (buf), "unknown thread_db state %d", state);
+ return buf;
+ }
+}
+
+
+/* Convert between user-level thread ids and LWP ids. */
+
+static ptid_t
+thread_from_lwp (ptid_t ptid)
+{
+ td_thrinfo_t ti;
+ td_thrhandle_t th;
+ td_err_e err;
+
+ if (GET_LWP (ptid) == 0)
+ ptid = BUILD_LWP (GET_PID (ptid), GET_PID (ptid));
+
+ gdb_assert (is_lwp (ptid));
+
+ err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find user-level thread for LWP %d: %s",
+ GET_LWP (ptid), thread_db_err_str (err));
+
+ err = td_thr_get_info_p (&th, &ti);
+ if (err != TD_OK)
+ error ("Cannot get thread info: %s", thread_db_err_str (err));
+
+ return BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
+}
+
+static ptid_t
+lwp_from_thread (ptid_t ptid)
+{
+ td_thrinfo_t ti;
+ td_thrhandle_t th;
+ td_err_e err;
+
+ if (!is_thread (ptid))
+ return ptid;
+
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (ptid), thread_db_err_str (err));
+
+ err = td_thr_get_info_p (&th, &ti);
+ if (err != TD_OK)
+ error ("Cannot get thread info: %s", thread_db_err_str (err));
+
+ return BUILD_LWP (ti.ti_lid, GET_PID (ptid));
+}
+
+
+void
+thread_db_init (struct target_ops *target)
+{
+ target_beneath = target;
+}
+
+static int
+thread_db_load (void)
+{
+ void *handle;
+ td_err_e err;
+
+ handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW);
+ if (handle == NULL)
+ return 0;
+
+ /* Initialize pointers to the dynamic library functions we will use.
+ Essential functions first. */
+
+ td_init_p = dlsym (handle, "td_init");
+ if (td_init_p == NULL)
+ return 0;
+
+ td_ta_new_p = dlsym (handle, "td_ta_new");
+ if (td_ta_new_p == NULL)
+ return 0;
+
+ td_ta_map_id2thr_p = dlsym (handle, "td_ta_map_id2thr");
+ if (td_ta_map_id2thr_p == NULL)
+ return 0;
+
+ td_ta_map_lwp2thr_p = dlsym (handle, "td_ta_map_lwp2thr");
+ if (td_ta_map_lwp2thr_p == NULL)
+ return 0;
+
+ td_ta_thr_iter_p = dlsym (handle, "td_ta_thr_iter");
+ if (td_ta_thr_iter_p == NULL)
+ return 0;
+
+ td_thr_validate_p = dlsym (handle, "td_thr_validate");
+ if (td_thr_validate_p == NULL)
+ return 0;
+
+ td_thr_get_info_p = dlsym (handle, "td_thr_get_info");
+ if (td_thr_get_info_p == NULL)
+ return 0;
+
+ td_thr_getfpregs_p = dlsym (handle, "td_thr_getfpregs");
+ if (td_thr_getfpregs_p == NULL)
+ return 0;
+
+ td_thr_getgregs_p = dlsym (handle, "td_thr_getgregs");
+ if (td_thr_getgregs_p == NULL)
+ return 0;
+
+ td_thr_setfpregs_p = dlsym (handle, "td_thr_setfpregs");
+ if (td_thr_setfpregs_p == NULL)
+ return 0;
+
+ td_thr_setgregs_p = dlsym (handle, "td_thr_setgregs");
+ if (td_thr_setgregs_p == NULL)
+ return 0;
+
+ /* Initialize the library. */
+ err = td_init_p ();
+ if (err != TD_OK)
+ {
+ warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err));
+ return 0;
+ }
+
+ /* These are not essential. */
+ td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
+ td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
+ td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
+ td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
+
+ return 1;
+}
+
+static void
+enable_thread_event_reporting (void)
+{
+ td_thr_events_t events;
+ td_notify_t notify;
+ td_err_e err;
+
+ /* We cannot use the thread event reporting facility if these
+ functions aren't available. */
+ if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL
+ || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL)
+ return;
+
+ /* Set the process wide mask saying which events we're interested in. */
+ td_event_emptyset (&events);
+ td_event_addset (&events, TD_CREATE);
+#if 0
+ /* FIXME: kettenis/2000-04-23: The event reporting facility is
+ broken for TD_DEATH events in glibc 2.1.3, so don't enable it for
+ now. */
+ td_event_addset (&events, TD_DEATH);
+#endif
+
+ err = td_ta_set_event_p (thread_agent, &events);
+ if (err != TD_OK)
+ {
+ warning ("Unable to set global thread event mask: %s",
+ thread_db_err_str (err));
+ return;
+ }
+
+ /* Delete previous thread event breakpoints, if any. */
+ remove_thread_event_breakpoints ();
+
+ /* Get address for thread creation breakpoint. */
+ err = td_ta_event_addr_p (thread_agent, TD_CREATE, &notify);
+ if (err != TD_OK)
+ {
+ warning ("Unable to get location for thread creation breakpoint: %s",
+ thread_db_err_str (err));
+ return;
+ }
+
+ /* Set up the breakpoint. */
+ td_create_bp_addr = (CORE_ADDR) notify.u.bptaddr;
+ create_thread_event_breakpoint (td_create_bp_addr);
+
+ /* Get address for thread death breakpoint. */
+ err = td_ta_event_addr_p (thread_agent, TD_DEATH, &notify);
+ if (err != TD_OK)
+ {
+ warning ("Unable to get location for thread death breakpoint: %s",
+ thread_db_err_str (err));
+ return;
+ }
+
+ /* Set up the breakpoint. */
+ td_death_bp_addr = (CORE_ADDR) notify.u.bptaddr;
+ create_thread_event_breakpoint (td_death_bp_addr);
+}
+
+static void
+disable_thread_event_reporting (void)
+{
+ td_thr_events_t events;
+
+ /* Set the process wide mask saying we aren't interested in any
+ events anymore. */
+ td_event_emptyset (&events);
+ td_ta_set_event_p (thread_agent, &events);
+
+ /* Delete thread event breakpoints, if any. */
+ remove_thread_event_breakpoints ();
+ td_create_bp_addr = 0;
+ td_death_bp_addr = 0;
+}
+
+static void
+check_thread_signals (void)
+{
+#ifdef GET_THREAD_SIGNALS
+ if (!thread_signals)
+ {
+ sigset_t mask;
+ int i;
+
+ GET_THREAD_SIGNALS (&mask);
+ sigemptyset (&thread_stop_set);
+ sigemptyset (&thread_print_set);
+
+ for (i = 1; i < NSIG; i++)
+ {
+ if (sigismember (&mask, i))
+ {
+ if (signal_stop_update (target_signal_from_host (i), 0))
+ sigaddset (&thread_stop_set, i);
+ if (signal_print_update (target_signal_from_host (i), 0))
+ sigaddset (&thread_print_set, i);
+ thread_signals = 1;
+ }
+ }
+ }
+#endif
+}
+
+static void
+disable_thread_signals (void)
+{
+#ifdef GET_THREAD_SIGNALS
+ if (thread_signals)
+ {
+ int i;
+
+ for (i = 1; i < NSIG; i++)
+ {
+ if (sigismember (&thread_stop_set, i))
+ signal_stop_update (target_signal_from_host (i), 1);
+ if (sigismember (&thread_print_set, i))
+ signal_print_update (target_signal_from_host (i), 1);
+ }
+
+ thread_signals = 0;
+ }
+#endif
+}
+
+static void
+thread_db_new_objfile (struct objfile *objfile)
+{
+ td_err_e err;
+
+ /* Don't attempt to use thread_db on targets which can not run
+ (core files). */
+ if (objfile == NULL || !target_has_execution)
+ {
+ /* All symbols have been discarded. If the thread_db target is
+ active, deactivate it now. */
+ if (using_thread_db)
+ {
+ gdb_assert (proc_handle.pid == 0);
+ unpush_target (&thread_db_ops);
+ using_thread_db = 0;
+ }
+
+ keep_thread_db = 0;
+
+ goto quit;
+ }
+
+ if (using_thread_db)
+ /* Nothing to do. The thread library was already detected and the
+ target vector was already activated. */
+ goto quit;
+
+ /* Initialize the structure that identifies the child process. Note
+ that at this point there is no guarantee that we actually have a
+ child process. */
+ proc_handle.pid = GET_PID (inferior_ptid);
+
+ /* Now attempt to open a connection to the thread library. */
+ err = td_ta_new_p (&proc_handle, &thread_agent);
+ switch (err)
+ {
+ case TD_NOLIBTHREAD:
+ /* No thread library was detected. */
+ break;
+
+ case TD_OK:
+ /* The thread library was detected. Activate the thread_db target. */
+ push_target (&thread_db_ops);
+ using_thread_db = 1;
+
+ /* If the thread library was detected in the main symbol file
+ itself, we assume that the program was statically linked
+ against the thread library and well have to keep this
+ module's target vector activated until forever... Well, at
+ least until all symbols have been discarded anyway (see
+ above). */
+ if (objfile == symfile_objfile)
+ {
+ gdb_assert (proc_handle.pid == 0);
+ keep_thread_db = 1;
+ }
+
+ /* We can only poke around if there actually is a child process.
+ If there is no child process alive, postpone the steps below
+ until one has been created. */
+ if (proc_handle.pid != 0)
+ {
+ enable_thread_event_reporting ();
+ thread_db_find_new_threads ();
+ }
+ break;
+
+ default:
+ warning ("Cannot initialize thread debugging library: %s",
+ thread_db_err_str (err));
+ break;
+ }
+
+ quit:
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
+}
+
+static void
+attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
+ const td_thrinfo_t *ti_p, int verbose)
+{
+ struct thread_info *tp;
+ td_err_e err;
+
+ check_thread_signals ();
+
+ if (verbose)
+ printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid));
+
+ /* Add the thread to GDB's thread list. */
+ tp = add_thread (ptid);
+ tp->private = xmalloc (sizeof (struct private_thread_info));
+ tp->private->lwpid = ti_p->ti_lid;
+
+ if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
+ return; /* A zombie thread -- do not attach. */
+
+ /* Under GNU/Linux, we have to attach to each and every thread. */
+#ifdef ATTACH_LWP
+ ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0);
+#endif
+
+ /* Enable thread event reporting for this thread. */
+ err = td_thr_event_enable_p (th_p, 1);
+ if (err != TD_OK)
+ error ("Cannot enable thread event reporting for %s: %s",
+ target_pid_to_str (ptid), thread_db_err_str (err));
+}
+
+static void
+thread_db_attach (char *args, int from_tty)
+{
+ target_beneath->to_attach (args, from_tty);
+
+ /* Destroy thread info; it's no longer valid. */
+ init_thread_list ();
+
+ /* The child process is now the actual multi-threaded
+ program. Snatch its process ID... */
+ proc_handle.pid = GET_PID (inferior_ptid);
+
+ /* ...and perform the remaining initialization steps. */
+ enable_thread_event_reporting ();
+ thread_db_find_new_threads();
+}
+
+static void
+detach_thread (ptid_t ptid, int verbose)
+{
+ if (verbose)
+ printf_unfiltered ("[%s exited]\n", target_pid_to_str (ptid));
+}
+
+static void
+thread_db_detach (char *args, int from_tty)
+{
+ disable_thread_event_reporting ();
+
+ /* There's no need to save & restore inferior_ptid here, since the
+ inferior is supposed to be survive this function call. */
+ inferior_ptid = lwp_from_thread (inferior_ptid);
+
+ /* Forget about the child's process ID. We shouldn't need it
+ anymore. */
+ proc_handle.pid = 0;
+
+ target_beneath->to_detach (args, from_tty);
+}
+
+static void
+thread_db_resume (ptid_t ptid, int step, enum target_signal signo)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+
+ if (GET_PID (ptid) == -1)
+ inferior_ptid = lwp_from_thread (inferior_ptid);
+ else if (is_thread (ptid))
+ ptid = lwp_from_thread (ptid);
+
+ target_beneath->to_resume (ptid, step, signo);
+
+ do_cleanups (old_chain);
+}
+
+/* Check if PID is currently stopped at the location of a thread event
+ breakpoint location. If it is, read the event message and act upon
+ the event. */
+
+static void
+check_event (ptid_t ptid)
+{
+ td_event_msg_t msg;
+ td_thrinfo_t ti;
+ td_err_e err;
+ CORE_ADDR stop_pc;
+
+ /* Bail out early if we're not at a thread event breakpoint. */
+ stop_pc = read_pc_pid (ptid) - DECR_PC_AFTER_BREAK;
+ if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr)
+ return;
+
+ err = td_ta_event_getmsg_p (thread_agent, &msg);
+ if (err != TD_OK)
+ {
+ if (err == TD_NOMSG)
+ return;
+
+ error ("Cannot get thread event message: %s", thread_db_err_str (err));
+ }
+
+ err = td_thr_get_info_p (msg.th_p, &ti);
+ if (err != TD_OK)
+ error ("Cannot get thread info: %s", thread_db_err_str (err));
+
+ ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid));
+
+ switch (msg.event)
+ {
+ case TD_CREATE:
+#if 0
+ /* FIXME: kettenis/2000-08-26: Since we use td_ta_event_getmsg,
+ there is no guarantee that the breakpoint will match the
+ event. Should we use td_thr_event_getmsg instead? */
+
+ if (stop_pc != td_create_bp_addr)
+ error ("Thread creation event doesn't match breakpoint.");
+#endif
+
+ /* We may already know about this thread, for instance when the
+ user has issued the `info threads' command before the SIGTRAP
+ for hitting the thread creation breakpoint was reported. */
+ if (!in_thread_list (ptid))
+ attach_thread (ptid, msg.th_p, &ti, 1);
+ return;
+
+ case TD_DEATH:
+#if 0
+ /* FIXME: See TD_CREATE. */
+
+ if (stop_pc != td_death_bp_addr)
+ error ("Thread death event doesn't match breakpoint.");
+#endif
+
+ if (!in_thread_list (ptid))
+ error ("Spurious thread death event.");
+
+ detach_thread (ptid, 1);
+ return;
+
+ default:
+ error ("Spurious thread event.");
+ }
+}
+
+static ptid_t
+thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+{
+ extern ptid_t trap_ptid;
+
+ if (GET_PID (ptid) != -1 && is_thread (ptid))
+ ptid = lwp_from_thread (ptid);
+
+ ptid = target_beneath->to_wait (ptid, ourstatus);
+
+ if (proc_handle.pid == 0)
+ /* The current child process isn't the actual multi-threaded
+ program yet, so don't try to do any special thread-specific
+ post-processing and bail out early. */
+ return ptid;
+
+ if (ourstatus->kind == TARGET_WAITKIND_EXITED)
+ return pid_to_ptid (-1);
+
+ if (ourstatus->kind == TARGET_WAITKIND_STOPPED
+ && ourstatus->value.sig == TARGET_SIGNAL_TRAP)
+ /* Check for a thread event. */
+ check_event (ptid);
+
+ if (!ptid_equal (trap_ptid, null_ptid))
+ trap_ptid = thread_from_lwp (trap_ptid);
+
+ return thread_from_lwp (ptid);
+}
+
+static int
+thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target)
+{
+ struct cleanup *old_chain = save_inferior_ptid ();
+ int xfer;
+
+ if (is_thread (inferior_ptid))
+ {
+ /* FIXME: This seems to be necessary to make sure breakpoints
+ are removed. */
+ if (!target_thread_alive (inferior_ptid))
+ inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
+ else
+ inferior_ptid = lwp_from_thread (inferior_ptid);
+ }
+
+ xfer = target_beneath->to_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+
+ do_cleanups (old_chain);
+ return xfer;
+}
+
+static void
+thread_db_fetch_registers (int regno)
+{
+ td_thrhandle_t th;
+ prgregset_t gregset;
+ gdb_prfpregset_t fpregset;
+ td_err_e err;
+
+ if (!is_thread (inferior_ptid))
+ {
+ /* Pass the request to the target beneath us. */
+ target_beneath->to_fetch_registers (regno);
+ return;
+ }
+
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+
+ err = td_thr_getgregs_p (&th, gregset);
+ if (err != TD_OK)
+ error ("Cannot fetch general-purpose registers for thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+
+ err = td_thr_getfpregs_p (&th, &fpregset);
+ if (err != TD_OK)
+ error ("Cannot get floating-point registers for thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+
+ /* Note that we must call supply_gregset after calling the thread_db
+ routines because the thread_db routines call ps_lgetgregs and
+ friends which clobber GDB's register cache. */
+ supply_gregset ((gdb_gregset_t *) gregset);
+ supply_fpregset (&fpregset);
+}
+
+static void
+thread_db_store_registers (int regno)
+{
+ td_thrhandle_t th;
+ prgregset_t gregset;
+ gdb_prfpregset_t fpregset;
+ td_err_e err;
+
+ if (!is_thread (inferior_ptid))
+ {
+ /* Pass the request to the target beneath us. */
+ target_beneath->to_store_registers (regno);
+ return;
+ }
+
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (inferior_ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+
+ if (regno != -1)
+ {
+ char raw[MAX_REGISTER_RAW_SIZE];
+
+ read_register_gen (regno, raw);
+ thread_db_fetch_registers (-1);
+ supply_register (regno, raw);
+ }
+
+ fill_gregset ((gdb_gregset_t *) gregset, -1);
+ fill_fpregset (&fpregset, -1);
+
+ err = td_thr_setgregs_p (&th, gregset);
+ if (err != TD_OK)
+ error ("Cannot store general-purpose registers for thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+ err = td_thr_setfpregs_p (&th, &fpregset);
+ if (err != TD_OK)
+ error ("Cannot store floating-point registers for thread %ld: %s",
+ (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
+}
+
+static void
+thread_db_kill (void)
+{
+ /* There's no need to save & restore inferior_ptid here, since the
+ inferior isn't supposed to survive this function call. */
+ inferior_ptid = lwp_from_thread (inferior_ptid);
+ target_beneath->to_kill ();
+}
+
+static void
+thread_db_create_inferior (char *exec_file, char *allargs, char **env)
+{
+ if (!keep_thread_db)
+ {
+ unpush_target (&thread_db_ops);
+ using_thread_db = 0;
+ }
+
+ target_beneath->to_create_inferior (exec_file, allargs, env);
+}
+
+static void
+thread_db_post_startup_inferior (ptid_t ptid)
+{
+ if (proc_handle.pid == 0)
+ {
+ /* The child process is now the actual multi-threaded
+ program. Snatch its process ID... */
+ proc_handle.pid = GET_PID (ptid);
+
+ /* ...and perform the remaining initialization steps. */
+ enable_thread_event_reporting ();
+ thread_db_find_new_threads ();
+ }
+}
+
+static void
+thread_db_mourn_inferior (void)
+{
+ remove_thread_event_breakpoints ();
+
+ /* Forget about the child's process ID. We shouldn't need it
+ anymore. */
+ proc_handle.pid = 0;
+
+ target_beneath->to_mourn_inferior ();
+}
+
+static int
+thread_db_thread_alive (ptid_t ptid)
+{
+ td_thrhandle_t th;
+ td_thrinfo_t ti;
+ td_err_e err;
+
+ if (is_thread (ptid))
+ {
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
+ if (err != TD_OK)
+ return 0;
+
+ err = td_thr_validate_p (&th);
+ if (err != TD_OK)
+ return 0;
+
+ err = td_thr_get_info_p (&th, &ti);
+ if (err != TD_OK)
+ return 0;
+
+ if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
+ return 0; /* A zombie thread. */
+
+ return 1;
+ }
+
+ if (target_beneath->to_thread_alive)
+ return target_beneath->to_thread_alive (ptid);
+
+ return 0;
+}
+
+static int
+find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
+{
+ td_thrinfo_t ti;
+ td_err_e err;
+ ptid_t ptid;
+
+ err = td_thr_get_info_p (th_p, &ti);
+ if (err != TD_OK)
+ error ("Cannot get thread info: %s", thread_db_err_str (err));
+
+ if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
+ return 0; /* A zombie -- ignore. */
+
+ ptid = BUILD_THREAD (ti.ti_tid, GET_PID (inferior_ptid));
+
+ if (!in_thread_list (ptid))
+ attach_thread (ptid, th_p, &ti, 1);
+
+ return 0;
+}
+
+static void
+thread_db_find_new_threads (void)
+{
+ td_err_e err;
+
+ /* Iterate over all user-space threads to discover new threads. */
+ err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
+ TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
+ TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
+ if (err != TD_OK)
+ error ("Cannot find new threads: %s", thread_db_err_str (err));
+}
+
+static char *
+thread_db_pid_to_str (ptid_t ptid)
+{
+ if (is_thread (ptid))
+ {
+ static char buf[64];
+ td_thrhandle_t th;
+ td_thrinfo_t ti;
+ td_err_e err;
+
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (ptid), thread_db_err_str (err));
+
+ err = td_thr_get_info_p (&th, &ti);
+ if (err != TD_OK)
+ error ("Cannot get thread info for thread %ld: %s",
+ (long) GET_THREAD (ptid), thread_db_err_str (err));
+
+ if (ti.ti_state == TD_THR_ACTIVE && ti.ti_lid != 0)
+ {
+ snprintf (buf, sizeof (buf), "Thread %ld (LWP %d)",
+ (long) ti.ti_tid, ti.ti_lid);
+ }
+ else
+ {
+ snprintf (buf, sizeof (buf), "Thread %ld (%s)",
+ (long) ti.ti_tid, thread_db_state_str (ti.ti_state));
+ }
+
+ return buf;
+ }
+
+ if (target_beneath->to_pid_to_str (ptid))
+ return target_beneath->to_pid_to_str (ptid);
+
+ return normal_pid_to_str (ptid);
+}
+
+static void
+init_thread_db_ops (void)
+{
+ thread_db_ops.to_shortname = "multi-thread";
+ thread_db_ops.to_longname = "multi-threaded child process.";
+ thread_db_ops.to_doc = "Threads and pthreads support.";
+ thread_db_ops.to_attach = thread_db_attach;
+ thread_db_ops.to_detach = thread_db_detach;
+ thread_db_ops.to_resume = thread_db_resume;
+ thread_db_ops.to_wait = thread_db_wait;
+ thread_db_ops.to_fetch_registers = thread_db_fetch_registers;
+ thread_db_ops.to_store_registers = thread_db_store_registers;
+ thread_db_ops.to_xfer_memory = thread_db_xfer_memory;
+ thread_db_ops.to_kill = thread_db_kill;
+ thread_db_ops.to_create_inferior = thread_db_create_inferior;
+ thread_db_ops.to_post_startup_inferior = thread_db_post_startup_inferior;
+ thread_db_ops.to_mourn_inferior = thread_db_mourn_inferior;
+ thread_db_ops.to_thread_alive = thread_db_thread_alive;
+ thread_db_ops.to_find_new_threads = thread_db_find_new_threads;
+ thread_db_ops.to_pid_to_str = thread_db_pid_to_str;
+ thread_db_ops.to_stratum = thread_stratum;
+ thread_db_ops.to_has_thread_control = tc_schedlock;
+ thread_db_ops.to_magic = OPS_MAGIC;
+}
+
+void
+_initialize_thread_db (void)
+{
+ /* Only initialize the module if we can load libthread_db. */
+ if (thread_db_load ())
+ {
+ init_thread_db_ops ();
+ add_target (&thread_db_ops);
+
+ /* Add ourselves to objfile event chain. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = thread_db_new_objfile;
+ }
+}
diff --git a/contrib/gdb/gdb/top.h b/contrib/gdb/gdb/top.h
index fe7002b..ca0b3d1 100644
--- a/contrib/gdb/gdb/top.h
+++ b/contrib/gdb/gdb/top.h
@@ -1,22 +1,26 @@
/* Top level stuff for GDB, the GNU debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996,
+ 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 TOP_H
+#define TOP_H
/* From top.c. */
extern char *line;
@@ -27,41 +31,44 @@ extern int inhibit_gdbinit;
extern int epoch_interface;
extern char gdbinit[];
-/* Generally one should use catch_errors rather than manipulating these
- directly. The exception is main(). */
-#if defined(HAVE_SIGSETJMP)
-#define SIGJMP_BUF sigjmp_buf
-#define SIGSETJMP(buf) sigsetjmp(buf, 1)
-#define SIGLONGJMP(buf,val) siglongjmp(buf,val)
-#else
-#define SIGJMP_BUF jmp_buf
-#define SIGSETJMP(buf) setjmp(buf)
-#define SIGLONGJMP(buf,val) longjmp(buf,val)
-#endif
-
-extern SIGJMP_BUF error_return;
-extern SIGJMP_BUF quit_return;
+extern void print_gdb_version (struct ui_file *);
-extern void print_gdb_version PARAMS ((GDB_FILE *));
-
-extern void source_command PARAMS ((char *, int));
-extern void cd_command PARAMS ((char *, int));
-extern void read_command_file PARAMS ((FILE *));
-extern void init_history PARAMS ((void));
-extern void command_loop PARAMS ((void));
-extern int quit_confirm PARAMS ((void));
-extern void quit_force PARAMS ((char *, int));
-extern void quit_command PARAMS ((char *, int));
+extern void source_command (char *, int);
+extern void cd_command (char *, int);
+extern void read_command_file (FILE *);
+extern void init_history (void);
+extern void command_loop (void);
+extern void simplified_command_loop (char *(*read_input_func) (char *),
+ void (*execute_command_func) (char *,
+ int));
+extern int quit_confirm (void);
+extern void quit_force (char *, int);
+extern void quit_command (char *, int);
+extern int quit_cover (void *);
+extern void execute_command (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 (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 *));
+extern void set_prompt (char *);
/* From random places. */
extern int mapped_symbol_files;
extern int readnow_symbol_files;
-#define ALL_CLEANUPS ((struct cleanup *)0)
+
+/* Perform _initialize initialization */
+extern void gdb_init (char *);
+
+/* For use by event-top.c */
+/* Variables from top.c. */
+extern int source_line_number;
+extern char *source_file_name;
+extern char *source_error;
+extern char *source_pre_error;
+extern int history_expansion_p;
+extern int server_command;
+
+#endif
diff --git a/contrib/gdb/gdb/tracepoint.c b/contrib/gdb/gdb/tracepoint.c
index 9f03617..860b483 100644
--- a/contrib/gdb/gdb/tracepoint.c
+++ b/contrib/gdb/gdb/tracepoint.c
@@ -1,26 +1,28 @@
/* Tracing functionality for remote targets in custom GDB protocol
- Copyright 1997, 1998 Free Software Foundation, Inc.
-This file is part of GDB.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 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 "symtab.h"
#include "frame.h"
-#include "tracepoint.h"
#include "gdbtypes.h"
#include "expression.h"
#include "gdbcmd.h"
@@ -28,6 +30,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "language.h"
#include "gdb_string.h"
+#include "inferior.h"
+#include "tracepoint.h"
+#include "remote.h"
+#include "linespec.h"
+#include "regcache.h"
+#include "completer.h"
+#include "gdb-events.h"
#include "ax.h"
#include "ax-gdb.h"
@@ -48,18 +57,26 @@ 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_end_hook) PARAMS ((void));
-extern void x_command PARAMS ((char *, int));
-extern int addressprint; /* Print machine addresses? */
+extern void (*readline_begin_hook) (char *, ...);
+extern char *(*readline_hook) (char *);
+extern void (*readline_end_hook) (void);
+extern void x_command (char *, int);
+extern int addressprint; /* Print machine addresses? */
+
+/* GDB commands implemented in other modules:
+ */
+
+extern void output_command (char *, int);
+extern void registers_info (char *, int);
+extern void args_info (char *, int);
+extern void locals_info (char *, int);
+
/* If this definition isn't overridden by the header files, assume
that isatty and fileno exist on this system. */
@@ -90,7 +107,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,35 +134,42 @@ 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_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_command (char *, int);
+static void tracepoints_info (char *, int);
+static void delete_trace_command (char *, int);
+static void enable_trace_command (char *, int);
+static void disable_trace_command (char *, int);
+static void trace_pass_command (char *, int);
+static void trace_actions_command (char *, int);
+static void trace_start_command (char *, int);
+static void trace_stop_command (char *, int);
+static void trace_status_command (char *, int);
+static void trace_find_command (char *, int);
+static void trace_find_pc_command (char *, int);
+static void trace_find_tracepoint_command (char *, int);
+static void trace_find_line_command (char *, int);
+static void trace_find_range_command (char *, int);
+static void trace_find_outside_command (char *, int);
+static void tracepoint_save_command (char *, int);
+static void trace_dump_command (char *, int);
/* support routines */
-static void trace_mention PARAMS ((struct tracepoint *));
+static void trace_mention (struct tracepoint *);
struct collection_list;
-static void add_aexpr PARAMS ((struct collection_list *, struct agent_expr *));
-static unsigned char *mem2hex(unsigned char *, unsigned char *, int);
+static void add_aexpr (struct collection_list *, struct agent_expr *);
+static unsigned char *mem2hex (unsigned char *, unsigned char *, int);
+static void add_register (struct collection_list *collection,
+ unsigned int regno);
+static struct cleanup *make_cleanup_free_actions (struct tracepoint *t);
+static void free_actions_list (char **actions_list);
+static void free_actions_list_cleanup_wrapper (void *);
+
+extern void _initialize_tracepoint (void);
/* Utility: returns true if "target remote" */
static int
-target_is_remote ()
+target_is_remote (void)
{
if (current_target.to_shortname &&
strcmp (current_target.to_shortname, "remote") == 0)
@@ -155,19 +179,18 @@ target_is_remote ()
}
/* Utility: generate error from an incoming stub packet. */
-static void
-trace_error (buf)
- char *buf;
+static void
+trace_error (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);
@@ -178,13 +201,13 @@ trace_error (buf)
/* Utility: wait for reply from stub, while accepting "O" packets */
static char *
-remote_get_noisy_reply (buf)
- char *buf;
+remote_get_noisy_reply (char *buf,
+ long sizeof_buf)
{
- do /* loop on reply from remote stub */
+ do /* loop on reply from remote stub */
{
- QUIT; /* allow user to bail out with ^C */
- getpkt (buf, 0);
+ QUIT; /* allow user to bail out with ^C */
+ getpkt (buf, sizeof_buf, 0);
if (buf[0] == 0)
error ("Target does not support this command.");
else if (buf[0] == 'E')
@@ -193,14 +216,14 @@ 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. */
static void
-set_tracepoint_count (num)
- int num;
+set_tracepoint_count (int num)
{
tracepoint_count = num;
set_internalvar (lookup_internalvar ("tpnum"),
@@ -209,8 +232,7 @@ set_tracepoint_count (num)
/* Set traceframe number to NUM. */
static void
-set_traceframe_num (num)
- int num;
+set_traceframe_num (int num)
{
traceframe_number = num;
set_internalvar (lookup_internalvar ("trace_frame"),
@@ -219,8 +241,7 @@ set_traceframe_num (num)
/* Set tracepoint number to NUM. */
static void
-set_tracepoint_num (num)
- int num;
+set_tracepoint_num (int num)
{
tracepoint_number = num;
set_internalvar (lookup_internalvar ("tracepoint"),
@@ -231,29 +252,29 @@ set_tracepoint_num (num)
the traceframe context (line, function, file) */
static void
-set_traceframe_context (trace_pc)
- CORE_ADDR trace_pc;
+set_traceframe_context (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;
+ struct value *func_val;
+ struct value *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"),
- value_from_longest (charstar, (LONGEST) 0));
- set_internalvar (lookup_internalvar ("trace_file"),
- value_from_longest (charstar, (LONGEST) 0));
+ set_internalvar (lookup_internalvar ("trace_func"),
+ value_from_pointer (charstar, (LONGEST) 0));
+ set_internalvar (lookup_internalvar ("trace_file"),
+ value_from_pointer (charstar, (LONGEST) 0));
set_internalvar (lookup_internalvar ("trace_line"),
- value_from_longest (builtin_type_int, (LONGEST) -1));
+ value_from_pointer (builtin_type_int, (LONGEST) - 1));
return;
}
@@ -263,46 +284,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"),
- value_from_longest (charstar, (LONGEST) 0));
+ set_internalvar (lookup_internalvar ("trace_func"),
+ value_from_pointer (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"),
- value_from_longest (charstar, (LONGEST) 0));
+ set_internalvar (lookup_internalvar ("trace_file"),
+ value_from_pointer (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);
@@ -319,30 +340,29 @@ set_traceframe_context (trace_pc)
your arguments BEFORE calling this routine! */
static struct tracepoint *
-set_raw_tracepoint (sal)
- struct symtab_and_line sal;
+set_raw_tracepoint (struct symtab_and_line sal)
{
register struct tracepoint *t, *tc;
struct cleanup *old_chain;
t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
- old_chain = make_cleanup (free, t);
+ old_chain = make_cleanup (xfree, t);
memset (t, 0, sizeof (*t));
t->address = sal.pc;
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_p = 1;
+ t->next = 0;
+ t->step_count = 0;
+ t->pass_count = 0;
t->addr_string = NULL;
/* Add this tracepoint to the end of the chain
@@ -364,11 +384,9 @@ set_raw_tracepoint (sal)
/* Set a tracepoint according to ARG (function, linenum or *address) */
static void
-trace_command (arg, from_tty)
- char *arg;
- int from_tty;
+trace_command (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;
@@ -382,10 +400,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++)
@@ -401,17 +419,13 @@ 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);
trace_mention (t);
-
- /* Let the UI know of any additions */
- if (create_tracepoint_hook)
- create_tracepoint_hook (t);
}
if (sals.nelts > 1)
@@ -424,8 +438,7 @@ trace_command (arg, from_tty)
/* Tell the user we have just set a tracepoint TP. */
static void
-trace_mention (tp)
- struct tracepoint *tp;
+trace_mention (struct tracepoint *tp)
{
printf_filtered ("Tracepoint %d", tp->number);
@@ -444,9 +457,7 @@ trace_mention (tp)
/* Print information on tracepoint number TPNUM_EXP, or all if omitted. */
static void
-tracepoints_info (tpnum_exp, from_tty)
- char *tpnum_exp;
- int from_tty;
+tracepoints_info (char *tpnum_exp, int from_tty)
{
struct tracepoint *t;
struct action_line *action;
@@ -456,183 +467,190 @@ tracepoints_info (tpnum_exp, from_tty)
int tpnum = -1;
if (tpnum_exp)
- tpnum = parse_and_eval_address (tpnum_exp);
+ tpnum = parse_and_eval_long (tpnum_exp);
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)
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ printf_filtered ("Address ");
+ else
+ printf_filtered ("Address ");
+ }
+ printf_filtered ("PassC StepC What\n");
+ }
+ strcpy (wrap_indent, " ");
+ if (addressprint)
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ strcat (wrap_indent, " ");
+ else
+ strcat (wrap_indent, " ");
+ }
- 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 ("%-3d %-3s ", t->number,
+ t->enabled_p ? "y" : "n");
+ if (addressprint)
+ {
+ char *tmp;
+
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom (t->address
+ & (CORE_ADDR) 0xffffffff,
+ "08l");
+ else
+ tmp = longest_local_hex_string_custom (t->address, "016l");
+
+ printf_filtered ("%s ", tmp);
+ }
+ printf_filtered ("%-5d %-5ld ", 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);
+ }
+ }
+ }
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,
- disable,
- delete
+ enable_op,
+ disable_op,
+ delete_op
};
-/* This function implements enable, disable and delete. */
+/* This function implements enable, disable and delete commands. */
static void
-tracepoint_operation (t, from_tty, opcode)
- struct tracepoint *t;
- int from_tty;
- enum tracepoint_opcode opcode;
+tracepoint_operation (struct tracepoint *t, int from_tty,
+ enum tracepoint_opcode 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;
+ if (t == NULL) /* no tracepoint operand */
+ return;
- ALL_TRACEPOINTS (t2)
- if (t2->next == t)
+ switch (opcode)
+ {
+ case enable_op:
+ t->enabled_p = 1;
+ tracepoint_modify_event (t->number);
+ break;
+ case disable_op:
+ t->enabled_p = 0;
+ tracepoint_modify_event (t->number);
+ break;
+ case delete_op:
+ if (tracepoint_chain == t)
+ tracepoint_chain = t->next;
+
+ ALL_TRACEPOINTS (t2)
+ if (t2->next == t)
{
+ tracepoint_delete_event (t2->number);
t2->next = t->next;
break;
}
- /* Let the UI know of any deletions */
- if (delete_tracepoint_hook)
- delete_tracepoint_hook (t);
+ if (t->addr_string)
+ xfree (t->addr_string);
+ if (t->source_file)
+ xfree (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;
- }
+ xfree (t);
+ break;
+ }
}
-/* Utility: parse a tracepoint number and look it up in the list. */
+/* Utility: parse a tracepoint number and look it up in the list.
+ If MULTI_P is true, there might be a range of tracepoints in ARG.
+ if OPTIONAL_P is true, then if the argument is missing, the most
+ recent tracepoint (tracepoint_count) is returned. */
struct tracepoint *
-get_tracepoint_by_number (arg)
- char **arg;
+get_tracepoint_by_number (char **arg, int multi_p, int optional_p)
{
struct tracepoint *t;
- char *end, *copy;
- value_ptr val;
int tpnum;
+ char *instring = arg == NULL ? NULL : *arg;
- if (arg == 0)
- error ("Bad tracepoint argument");
-
- if (*arg == 0 || **arg == 0) /* empty arg means refer to last tp */
- tpnum = tracepoint_count;
- else if (**arg == '$') /* handle convenience variable */
+ if (arg == NULL || *arg == NULL || ! **arg)
{
- /* Make a copy of the name, so we can null-terminate it
- to pass to lookup_internalvar(). */
- end = *arg + 1;
- while (isalnum(*end) || *end == '_')
- end++;
- copy = (char *) alloca (end - *arg);
- strncpy (copy, *arg + 1, (end - *arg - 1));
- copy[end - *arg - 1] = '\0';
- *arg = end;
-
- val = value_of_internalvar (lookup_internalvar (copy));
- if (TYPE_CODE( VALUE_TYPE (val)) != TYPE_CODE_INT)
- error ("Convenience variable must have integral type.");
- tpnum = (int) value_as_long (val);
+ if (optional_p)
+ tpnum = tracepoint_count;
+ else
+ error_no_arg ("tracepoint number");
}
- else /* handle tracepoint number */
+ else
+ tpnum = multi_p ? get_number_or_range (arg) : get_number (arg);
+
+ if (tpnum <= 0)
{
- tpnum = strtol (*arg, arg, 0);
- if (tpnum == 0) /* possible strtol failure */
- while (**arg && !isspace (**arg))
- (*arg)++; /* advance to next white space, if any */
+ if (instring && *instring)
+ printf_filtered ("bad tracepoint number at or near '%s'\n", instring);
+ else
+ printf_filtered ("Tracepoint argument missing and no previous tracepoint\n");
+ return NULL;
}
+
ALL_TRACEPOINTS (t)
if (t->number == tpnum)
- {
- return t;
- }
+ {
+ return t;
+ }
+
+ /* FIXME: if we are in the middle of a range we don't want to give
+ a message. The current interface to get_number_or_range doesn't
+ allow us to discover this. */
printf_unfiltered ("No tracepoint number %d.\n", tpnum);
return NULL;
}
/* Utility: parse a list of tracepoint numbers, and call a func for each. */
static void
-map_args_over_tracepoints (args, from_tty, opcode)
- char *args;
- int from_tty;
- enum tracepoint_opcode opcode;
+map_args_over_tracepoints (char *args, int from_tty,
+ enum tracepoint_opcode opcode)
{
struct tracepoint *t, *tmp;
- int tpnum;
- char *cp;
if (args == 0 || *args == 0) /* do them all */
ALL_TRACEPOINTS_SAFE (t, tmp)
@@ -640,9 +658,9 @@ map_args_over_tracepoints (args, from_tty, opcode)
else
while (*args)
{
- QUIT; /* give user option to bail out with ^C */
- if (t = get_tracepoint_by_number (&args))
- tracepoint_operation (t, from_tty, opcode);
+ QUIT; /* give user option to bail out with ^C */
+ t = get_tracepoint_by_number (&args, 1, 0);
+ tracepoint_operation (t, from_tty, opcode);
while (*args == ' ' || *args == '\t')
args++;
}
@@ -650,38 +668,32 @@ map_args_over_tracepoints (args, from_tty, opcode)
/* The 'enable trace' command enables tracepoints. Not supported by all targets. */
static void
-enable_trace_command (args, from_tty)
- char *args;
- int from_tty;
+enable_trace_command (char *args, int from_tty)
{
dont_repeat ();
- map_args_over_tracepoints (args, from_tty, enable);
+ map_args_over_tracepoints (args, from_tty, enable_op);
}
/* The 'disable trace' command enables tracepoints. Not supported by all targets. */
static void
-disable_trace_command (args, from_tty)
- char *args;
- int from_tty;
+disable_trace_command (char *args, int from_tty)
{
dont_repeat ();
- map_args_over_tracepoints (args, from_tty, disable);
+ map_args_over_tracepoints (args, from_tty, disable_op);
}
/* Remove a tracepoint (or all if no argument) */
static void
-delete_trace_command (args, from_tty)
- char *args;
- int from_tty;
+delete_trace_command (char *args, int 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;
- map_args_over_tracepoints (args, from_tty, delete);
+ map_args_over_tracepoints (args, from_tty, delete_op);
}
/* Set passcount for tracepoint.
@@ -691,99 +703,92 @@ delete_trace_command (args, from_tty)
Also accepts special argument "all". */
static void
-trace_pass_command (args, from_tty)
- char *args;
- int from_tty;
+trace_pass_command (char *args, int from_tty)
{
struct tracepoint *t1 = (struct tracepoint *) -1, *t2;
- unsigned long count;
+ unsigned int count;
+ int all = 0;
if (args == 0 || *args == 0)
- error ("PASS command requires an argument (count + optional TP num)");
+ error ("passcount command requires an argument (count + optional TP num)");
count = strtoul (args, &args, 10); /* count comes first, then TP num */
- while (*args && isspace (*args))
+ while (*args && isspace ((int) *args))
args++;
if (*args && strncasecmp (args, "all", 3) == 0)
- args += 3; /* skip special argument "all" */
+ {
+ args += 3; /* skip special argument "all" */
+ all = 1;
+ if (*args)
+ error ("Junk at end of arguments.");
+ }
else
- t1 = get_tracepoint_by_number (&args);
-
- if (*args)
- error ("Junk at end of arguments.");
-
- if (t1 == NULL)
- return; /* error, bad tracepoint number */
+ t1 = get_tracepoint_by_number (&args, 1, 1);
- 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);
- }
+ do
+ {
+ if (t1)
+ {
+ ALL_TRACEPOINTS (t2)
+ if (t1 == (struct tracepoint *) -1 || t1 == t2)
+ {
+ t2->pass_count = count;
+ tracepoint_modify_event (t2->number);
+ if (from_tty)
+ printf_filtered ("Setting tracepoint %d's passcount to %d\n",
+ t2->number, count);
+ }
+ if (! all && *args)
+ t1 = get_tracepoint_by_number (&args, 1, 0);
+ }
+ }
+ while (*args);
}
/* ACTIONS functions: */
/* Prototypes for action-parsing utility commands */
-static void read_actions PARAMS((struct tracepoint *));
-static char *parse_and_eval_memrange PARAMS ((char *,
- CORE_ADDR,
- long *,
- bfd_signed_vma *,
- long *));
+static void read_actions (struct tracepoint *);
/* 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
-end_actions_pseudocommand (args, from_tty)
- char *args;
- int from_tty;
+static void
+end_actions_pseudocommand (char *args, int from_tty)
{
error ("This command cannot be used at the top level.");
}
static void
-while_stepping_pseudocommand (args, from_tty)
- char *args;
- int from_tty;
+while_stepping_pseudocommand (char *args, int from_tty)
{
error ("This command can only be used in a tracepoint actions list.");
}
static void
-collect_pseudocommand (args, from_tty)
- char *args;
- int from_tty;
+collect_pseudocommand (char *args, int from_tty)
{
error ("This command can only be used in a tracepoint actions list.");
}
/* Enter a list of actions for a tracepoint. */
static void
-trace_actions_command (args, from_tty)
- char *args;
- int from_tty;
+trace_actions_command (char *args, int from_tty)
{
struct tracepoint *t;
- char *actions;
char tmpbuf[128];
char *end_msg = "End with a line saying just \"end\".";
- if (t = get_tracepoint_by_number (&args))
+ t = get_tracepoint_by_number (&args, 0, 1);
+ if (t)
{
sprintf (tmpbuf, "Enter actions for tracepoint %d, one per line.",
t->number);
@@ -802,16 +807,14 @@ trace_actions_command (args, from_tty)
if (readline_end_hook)
(*readline_end_hook) ();
-
/* tracepoints_changed () */
}
- /* else error, just return; */
+ /* else just return */
}
/* worker function */
static void
-read_actions (t)
- struct tracepoint *t;
+read_actions (struct tracepoint *t)
{
char *line;
char *prompt1 = "> ", *prompt2 = " > ";
@@ -824,15 +827,25 @@ read_actions (t)
/* Control-C quits instantly if typed while in this loop
since it should not wait until the user types a newline. */
immediate_quit++;
+ /* FIXME: kettenis/20010823: Something is wrong here. In this file
+ STOP_SIGNAL is never defined. So this code has been left out, at
+ least for quite a while now. Replacing STOP_SIGNAL with SIGTSTP
+ leads to compilation failures since the variable job_control
+ isn't declared. Leave this alone for now. */
#ifdef STOP_SIGNAL
if (job_control)
- signal (STOP_SIGNAL, stop_sig);
+ {
+ if (event_loop_p)
+ signal (STOP_SIGNAL, handle_stop_sig);
+ else
+ signal (STOP_SIGNAL, stop_sig);
+ }
#endif
- old_chain = make_cleanup ((make_cleanup_func) free_actions, (void *) t);
+ old_chain = make_cleanup_free_actions (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);
@@ -842,7 +855,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
@@ -850,7 +863,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;
@@ -865,57 +878,58 @@ read_actions (t)
}
if (linetype == STEPPING) /* begin "while-stepping" */
- if (prompt == prompt2)
- {
- warning ("Already processing 'while-stepping'");
- continue;
- }
- else
- prompt = prompt2; /* change prompt for stepping actions */
+ {
+ if (prompt == prompt2)
+ {
+ warning ("Already processing 'while-stepping'");
+ continue;
+ }
+ else
+ prompt = prompt2; /* change prompt for stepping actions */
+ }
else if (linetype == END)
- if (prompt == prompt2)
- {
- prompt = prompt1; /* end of single-stepping actions */
- }
- else
- { /* end of actions */
- if (t->actions->next == NULL)
- {
- /* an "end" all by itself with no other actions means
- this tracepoint has no actions. Discard empty list. */
- free_actions (t);
- }
- break;
- }
+ {
+ if (prompt == prompt2)
+ {
+ prompt = prompt1; /* end of single-stepping actions */
+ }
+ else
+ { /* end of actions */
+ if (t->actions->next == NULL)
+ {
+ /* an "end" all by itself with no other actions means
+ this tracepoint has no actions. Discard empty list. */
+ free_actions (t);
+ }
+ break;
+ }
+ }
}
#ifdef STOP_SIGNAL
if (job_control)
signal (STOP_SIGNAL, SIG_DFL);
#endif
- immediate_quit = 0;
+ immediate_quit--;
discard_cleanups (old_chain);
}
/* worker function */
enum actionline_type
-validate_actionline (line, t)
- char **line;
- struct tracepoint *t;
+validate_actionline (char **line, struct tracepoint *t)
{
struct cmd_list_element *c;
struct expression *exp = NULL;
- value_ptr temp, temp2;
struct cleanup *old_chain = NULL;
char *p;
- for (p = *line; isspace (*p); )
+ for (p = *line; isspace ((int) *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);
@@ -924,91 +938,91 @@ 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)
+
+ if (cmd_cfunc_eq (c, 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++;
-
- 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);
+ do
+ { /* repeat over a comma-separated list */
+ QUIT; /* allow user to bail out with ^C */
+ while (isspace ((int) *p))
+ p++;
- if (exp->elts[0].opcode == OP_VAR_VALUE)
- if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
+ if (*p == '$') /* look for special pseudo-symbols */
{
- warning ("%s is constant (value %d): will not be collected.",
- SYMBOL_NAME (exp->elts[2].symbol),
- SYMBOL_VALUE (exp->elts[2].symbol));
- return BADLINE;
+ 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! */
}
- else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT)
+ exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
+ old_chain = make_cleanup (free_current_contents, &exp);
+
+ if (exp->elts[0].opcode == OP_VAR_VALUE)
{
- warning ("%s is optimized away and cannot be collected.",
- SYMBOL_NAME (exp->elts[2].symbol));
- return BADLINE;
+ if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
+ {
+ warning ("constant %s (value %ld) 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);
+ make_cleanup_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 (xfree, 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)
+ else if (cmd_cfunc_eq (c, while_stepping_pseudocommand))
{
- char *steparg; /* in case warning is necessary */
+ char *steparg; /* in case warning is necessary */
- while (isspace (*p))
+ while (isspace ((int) *p))
p++;
steparg = p;
if (*p == '\0' ||
(t->step_count = strtol (p, &p, 0)) == 0)
{
- warning ("bad step-count: command ignored.", *line);
+ warning ("'%s': bad step-count; command ignored.", *line);
return BADLINE;
}
return STEPPING;
}
- else if (c->function.cfunc == end_actions_pseudocommand)
+ else if (cmd_cfunc_eq (c, end_actions_pseudocommand))
return END;
else
{
@@ -1018,85 +1032,98 @@ validate_actionline (line, t)
}
/* worker function */
-void
-free_actions (t)
- struct tracepoint *t;
+void
+free_actions (struct tracepoint *t)
{
struct action_line *line, *next;
for (line = t->actions; line; line = next)
{
next = line->next;
- if (line->action)
- free (line->action);
- free (line);
+ if (line->action)
+ xfree (line->action);
+ xfree (line);
}
t->actions = NULL;
}
-struct memrange {
+static void
+do_free_actions_cleanup (void *t)
+{
+ free_actions (t);
+}
+
+static struct cleanup *
+make_cleanup_free_actions (struct tracepoint *t)
+{
+ return make_cleanup (do_free_actions_cleanup, t);
+}
+
+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: */
-static int memrange_cmp PARAMS ((const void *, const void *));
+static int memrange_cmp (const void *, const void *);
/* compare memranges for qsort */
static int
-memrange_cmp (va, vb)
- const void *va;
- const void *vb;
+memrange_cmp (const void *va, const void *vb)
{
const struct memrange *a = va, *b = 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;
}
/* Sort the memrange list using qsort, and merge adjacent memranges */
static void
-memrange_sortmerge (memranges)
- struct collection_list *memranges;
+memrange_sortmerge (struct collection_list *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. */
@@ -1106,7 +1133,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;
@@ -1114,192 +1141,198 @@ memrange_sortmerge (memranges)
}
/* Add a register to a collection list */
-void
-add_register (collection, regno)
- struct collection_list *collection;
- unsigned long regno;
+static void
+add_register (struct collection_list *collection, unsigned int regno)
{
if (info_verbose)
printf_filtered ("collect register %d\n", 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 */
static void
-add_memrange (memranges, type, base, len)
- struct collection_list *memranges;
- int type;
- bfd_signed_vma base;
- unsigned long len;
+add_memrange (struct collection_list *memranges, int type, bfd_signed_vma base,
+ unsigned long len)
{
if (info_verbose)
- printf_filtered ("(%d,0x%x,%d)\n", type, base, len);
+ {
+ printf_filtered ("(%d,", type);
+ printf_vma (base);
+ printf_filtered (",%ld)\n", 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);
}
/* Add a symbol to a collection list */
static void
-collect_symbol (collect, sym, frame_regno, frame_offset)
- struct collection_list *collect;
- struct symbol *sym;
- long frame_regno;
- long frame_offset;
+collect_symbol (struct collection_list *collect, struct symbol *sym,
+ long frame_regno, long frame_offset)
{
- unsigned long len;
- unsigned long reg;
+ unsigned long len;
+ unsigned int 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 ("constant %s (value %ld) will not be collected.\n",
+ SYMBOL_NAME (sym), SYMBOL_VALUE (sym));
+ break;
+ case LOC_STATIC:
+ offset = SYMBOL_VALUE_ADDRESS (sym);
+ if (info_verbose)
+ {
+ char tmp[40];
+
+ sprintf_vma (tmp, offset);
+ printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
+ SYMBOL_NAME (sym), len, tmp /* address */);
+ }
+ 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 %ld bytes at offset ",
+ SYMBOL_NAME (sym), len);
+ printf_vma (offset);
+ printf_filtered (" from frame ptr reg %d\n", 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 %ld bytes at offset ",
+ SYMBOL_NAME (sym), len);
+ printf_vma (offset);
+ printf_filtered (" from reg %d\n", 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 %ld bytes at offset ",
+ SYMBOL_NAME (sym), len);
+ printf_vma (offset);
+ printf_filtered (" from frame ptr reg %d\n", 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 %ld bytes at offset ",
+ SYMBOL_NAME (sym), len);
+ printf_vma (offset);
+ printf_filtered (" from basereg %d\n", 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 existence.\n",
+ SYMBOL_NAME (sym));
+ break;
+ }
}
/* Add all locals (or args) symbols to collection list */
static void
-add_local_symbols (collect, pc, frame_regno, frame_offset, type)
- struct collection_list *collect;
- CORE_ADDR pc;
- long frame_regno;
- long frame_offset;
- int type;
+add_local_symbols (struct collection_list *collect, CORE_ADDR pc,
+ long frame_regno, long frame_offset, int type)
{
struct symbol *sym;
- struct block *block;
- int i, nsyms, count = 0;
+ struct block *block;
+ int i, count = 0;
block = block_for_pc (pc);
while (block != 0)
{
- 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 */
+ ALL_BLOCK_SYMBOLS (block, i, sym)
{
- 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))
+ {
+ default:
+ warning ("don't know how to trace local symbol %s",
+ SYMBOL_NAME (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;
@@ -1312,15 +1345,14 @@ add_local_symbols (collect, pc, frame_regno, frame_offset, type)
/* worker function */
static void
-clear_collection_list (list)
- struct collection_list *list;
+clear_collection_list (struct collection_list *list)
{
int ndx;
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;
@@ -1329,19 +1361,18 @@ clear_collection_list (list)
/* reduce a collection list to string form (for gdb protocol) */
static char **
-stringify_collection_list (list, string)
- struct collection_list *list;
- char *string;
+stringify_collection_list (struct collection_list *list, char *string)
{
char temp_buf[2048];
+ char tmp2[40];
int count;
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 */
@@ -1351,16 +1382,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)
@@ -1370,24 +1401,29 @@ stringify_collection_list (list, string)
for (i = 0, count = 0, end = temp_buf; i < list->next_memrange; i++)
{
QUIT; /* allow user to bail out with ^C */
+ sprintf_vma (tmp2, list->list[i].start);
if (info_verbose)
- printf_filtered ("(%d, 0x%x, %d)\n",
- list->list[i].type,
- list->list[i].start,
- list->list[i].end - list->list[i].start);
+ {
+ printf_filtered ("(%d, %s, %ld)\n",
+ list->list[i].type,
+ tmp2,
+ (long) (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,
- list->list[i].end - list->list[i].start);
+
+ sprintf (end, "M%X,%s,%lX",
+ list->list[i].type,
+ tmp2,
+ (long) (list->list[i].end - list->list[i].start));
+
count += strlen (end);
- end += strlen (end);
+ end += count;
}
for (i = 0; i < list->next_aexpr_elt; i++)
@@ -1395,7 +1431,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;
@@ -1404,13 +1440,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;
@@ -1423,9 +1459,14 @@ stringify_collection_list (list, string)
return *str_list;
}
-void
-free_actions_list(actions_list)
- char **actions_list;
+static void
+free_actions_list_cleanup_wrapper (void *al)
+{
+ free_actions_list (al);
+}
+
+static void
+free_actions_list (char **actions_list)
{
int ndx;
@@ -1433,29 +1474,27 @@ free_actions_list(actions_list)
return;
for (ndx = 0; actions_list[ndx]; ndx++)
- free(actions_list[ndx]);
+ xfree (actions_list[ndx]);
- free(actions_list);
+ xfree (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;
+encode_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;
+ int i;
+ struct value *tempval;
+ struct collection_list *collect;
struct cmd_list_element *cmd;
struct agent_expr *aexpr;
- long frame_reg, frame_offset;
+ int frame_reg;
+ LONGEST frame_offset;
clear_collection_list (&tracepoint_list);
@@ -1471,7 +1510,7 @@ encode_actions (t, tdp_actions, stepping_actions)
{
QUIT; /* allow user to bail out with ^C */
action_exp = action->action;
- while (isspace (*action_exp))
+ while (isspace ((int) *action_exp))
action_exp++;
if (*action_exp == '#') /* comment line */
@@ -1481,143 +1520,143 @@ encode_actions (t, tdp_actions, stepping_actions)
if (cmd == 0)
error ("Bad action list item: %s", action_exp);
- if (cmd->function.cfunc == collect_pseudocommand)
+ if (cmd_cfunc_eq (cmd, 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 ((int) *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;
- for (ndx1 = 0; ndx1 < areqs.reg_mask_len; ndx1++)
+ exp = parse_exp_1 (&action_exp,
+ block_for_pc (t->address), 1);
+ old_chain = make_cleanup (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_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 */
- else if (cmd->function.cfunc == while_stepping_pseudocommand)
+ break;
+ } /* switch */
+ do_cleanups (old_chain);
+ } /* do */
+ }
+ while (action_exp && *action_exp++ == ',');
+ } /* if */
+ else if (cmd_cfunc_eq (cmd, while_stepping_pseudocommand))
{
collect = &stepping_list;
}
- else if (cmd->function.cfunc == end_actions_pseudocommand)
+ else if (cmd_cfunc_eq (cmd, end_actions_pseudocommand))
{
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)
- struct collection_list *collect;
- struct agent_expr *aexpr;
+add_aexpr (struct collection_list *collect, struct agent_expr *aexpr)
{
if (collect->next_aexpr_elt >= collect->aexpr_listsize)
{
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;
@@ -1643,43 +1682,43 @@ 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];
+ char tmp1[40], tmp2[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);
+ sprintf_vma (tmp1, lma);
+ sprintf_vma (tmp2, lma + size);
+ sprintf (target_buf + strlen (target_buf),
+ ":%s,%s", tmp1, tmp2);
}
if (anysecs)
{
putpkt (target_buf);
- getpkt (target_buf, 0);
+ getpkt (target_buf, sizeof (target_buf), 0);
}
}
/* 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,
Tell target to start a new trace experiment. */
static void
-trace_start_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM MOSTLY_IMPLEMENTED */
+trace_start_command (char *args, int from_tty)
+{ /* STUB_COMM MOSTLY_IMPLEMENTED */
struct tracepoint *t;
char buf[2048];
char **tdp_actions;
@@ -1687,89 +1726,90 @@ 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");
- remote_get_noisy_reply (target_buf);
+ remote_get_noisy_reply (target_buf, sizeof (target_buf));
if (strcmp (target_buf, "OK"))
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, tdp_actions);
- (void) make_cleanup (free_actions_list, stepping_actions);
+ {
+ char tmp[40];
- /* 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.");
- }
- }
+ sprintf_vma (tmp, t->address);
+ sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", t->number, tmp, /* address */
+ t->enabled_p ? 'E' : 'D',
+ t->step_count, t->pass_count);
- do_cleanups (old_chain);
- }
- }
+ if (t->actions)
+ strcat (buf, "-");
+ putpkt (buf);
+ remote_get_noisy_reply (target_buf, sizeof (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:%s:%s%c",
+ t->number, tmp, /* address */
+ tdp_actions[ndx],
+ ((tdp_actions[ndx + 1] || stepping_actions)
+ ? '-' : 0));
+ putpkt (buf);
+ remote_get_noisy_reply (target_buf, sizeof (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:%s:%s%s%s",
+ t->number, tmp, /* address */
+ ((ndx == 0) ? "S" : ""),
+ stepping_actions[ndx],
+ (stepping_actions[ndx + 1] ? "-" : ""));
+ putpkt (buf);
+ remote_get_noisy_reply (target_buf, sizeof (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 */
putpkt ("QTStart");
- remote_get_noisy_reply (target_buf);
+ remote_get_noisy_reply (target_buf, sizeof (target_buf));
if (strcmp (target_buf, "OK"))
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.");
@@ -1777,19 +1817,17 @@ trace_start_command (args, from_tty)
/* tstop command */
static void
-trace_stop_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM IS_IMPLEMENTED */
+trace_stop_command (char *args, int from_tty)
+{ /* STUB_COMM IS_IMPLEMENTED */
if (target_is_remote ())
{
putpkt ("QTStop");
- remote_get_noisy_reply (target_buf);
+ remote_get_noisy_reply (target_buf, sizeof (target_buf));
if (strcmp (target_buf, "OK"))
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.");
@@ -1799,14 +1837,12 @@ unsigned long trace_running_p;
/* tstatus command */
static void
-trace_status_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM IS_IMPLEMENTED */
+trace_status_command (char *args, int from_tty)
+{ /* STUB_COMM IS_IMPLEMENTED */
if (target_is_remote ())
{
putpkt ("qTStatus");
- remote_get_noisy_reply (target_buf);
+ remote_get_noisy_reply (target_buf, sizeof (target_buf));
if (target_buf[0] != 'T' ||
(target_buf[1] != '0' && target_buf[1] != '1'))
@@ -1821,9 +1857,9 @@ trace_status_command (args, from_tty)
/* Worker function for the various flavors of the tfind command */
static void
-finish_tfind_command (msg, from_tty)
- char *msg;
- int from_tty;
+finish_tfind_command (char *msg,
+ long sizeof_msg,
+ int from_tty)
{
int target_frameno = -1, target_tracept = -1;
CORE_ADDR old_frame_addr;
@@ -1831,63 +1867,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);
+ reply = remote_get_noisy_reply (msg, sizeof_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 ();
@@ -1904,22 +1941,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 ();
@@ -1936,27 +1973,24 @@ 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 */
+trace_find_command (char *args, int from_tty)
+{ /* STUB_COMM PART_IMPLEMENTED */
/* this should only be called with a numeric argument */
int frameno = -1;
- char *tmp;
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
@@ -1972,13 +2006,13 @@ trace_find_command (args, from_tty)
frameno = traceframe_number - 1;
}
else
- frameno = parse_and_eval_address (args);
+ frameno = parse_and_eval_long (args);
if (frameno < -1)
error ("invalid input (%d is less than zero)", frameno);
sprintf (target_buf, "QTFrame:%x", frameno);
- finish_tfind_command (target_buf, from_tty);
+ finish_tfind_command (target_buf, sizeof (target_buf), from_tty);
}
else
error ("Trace can only be run on remote targets.");
@@ -1986,39 +2020,31 @@ trace_find_command (args, from_tty)
/* tfind end */
static void
-trace_find_end_command (args, from_tty)
- char *args;
- int from_tty;
+trace_find_end_command (char *args, int from_tty)
{
trace_find_command ("-1", from_tty);
}
/* tfind none */
static void
-trace_find_none_command (args, from_tty)
- char *args;
- int from_tty;
+trace_find_none_command (char *args, int from_tty)
{
trace_find_command ("-1", from_tty);
}
/* tfind start */
static void
-trace_find_start_command (args, from_tty)
- char *args;
- int from_tty;
+trace_find_start_command (char *args, int from_tty)
{
trace_find_command ("0", from_tty);
}
/* tfind pc command */
static void
-trace_find_pc_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+trace_find_pc_command (char *args, int from_tty)
+{ /* STUB_COMM PART_IMPLEMENTED */
CORE_ADDR pc;
- char *tmp;
+ char tmp[40];
if (target_is_remote ())
{
@@ -2027,8 +2053,9 @@ trace_find_pc_command (args, from_tty)
else
pc = parse_and_eval_address (args);
- sprintf (target_buf, "QTFrame:pc:%x", pc);
- finish_tfind_command (target_buf, from_tty);
+ sprintf_vma (tmp, pc);
+ sprintf (target_buf, "QTFrame:pc:%s", tmp);
+ finish_tfind_command (target_buf, sizeof (target_buf), from_tty);
}
else
error ("Trace can only be run on remote targets.");
@@ -2036,12 +2063,9 @@ trace_find_pc_command (args, from_tty)
/* tfind tracepoint command */
static void
-trace_find_tracepoint_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+trace_find_tracepoint_command (char *args, int from_tty)
+{ /* STUB_COMM PART_IMPLEMENTED */
int tdp;
- char buf[40], *tmp;
if (target_is_remote ())
{
@@ -2051,33 +2075,31 @@ trace_find_tracepoint_command (args, from_tty)
else
tdp = tracepoint_number; /* default is current TDP */
else
- tdp = parse_and_eval_address (args);
+ tdp = parse_and_eval_long (args);
sprintf (target_buf, "QTFrame:tdp:%x", tdp);
- finish_tfind_command (target_buf, from_tty);
+ finish_tfind_command (target_buf, sizeof (target_buf), from_tty);
}
else
error ("Trace can only be run on remote targets.");
}
/* 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. */
static void
-trace_find_line_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+trace_find_line_command (char *args, int from_tty)
+{ /* STUB_COMM PART_IMPLEMENTED */
static CORE_ADDR start_pc, end_pc;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
- char *tmp;
struct cleanup *old_chain;
+ char startpc_str[40], endpc_str[40];
if (target_is_remote ())
{
@@ -2092,18 +2114,18 @@ 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);
+ old_chain = make_cleanup (xfree, sals.sals);
if (sal.symtab == 0)
{
printf_filtered ("TFIND: 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);
@@ -2112,7 +2134,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
@@ -2144,104 +2166,107 @@ trace_find_line_command (args, from_tty)
error ("Line number %d is out of range for \"%s\".\n",
sal.line, sal.symtab->filename);
+ sprintf_vma (startpc_str, start_pc);
+ sprintf_vma (endpc_str, end_pc - 1);
if (args && *args) /* find within range of stated line */
- sprintf (target_buf, "QTFrame:range:%x:%x", start_pc, end_pc - 1);
+ sprintf (target_buf, "QTFrame:range:%s:%s", startpc_str, endpc_str);
else /* find OUTSIDE OF range of CURRENT line */
- sprintf (target_buf, "QTFrame:outside:%x:%x", start_pc, end_pc - 1);
- finish_tfind_command (target_buf, from_tty);
+ sprintf (target_buf, "QTFrame:outside:%s:%s", startpc_str, endpc_str);
+ finish_tfind_command (target_buf, sizeof (target_buf), 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 */
static void
-trace_find_range_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+trace_find_range_command (char *args, int from_tty)
+{
static CORE_ADDR start, stop;
+ char start_str[40], stop_str[40];
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))
+ while (isspace ((int) *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);
+ sprintf_vma (start_str, start);
+ sprintf_vma (stop_str, stop);
+ sprintf (target_buf, "QTFrame:range:%s:%s", start_str, stop_str);
+ finish_tfind_command (target_buf, sizeof (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 */
static void
-trace_find_outside_command (args, from_tty)
- char *args;
- int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+trace_find_outside_command (char *args, int from_tty)
+{
CORE_ADDR start, stop;
+ char start_str[40], stop_str[40];
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))
+ while (isspace ((int) *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);
+ sprintf_vma (start_str, start);
+ sprintf_vma (stop_str, stop);
+ sprintf (target_buf, "QTFrame:outside:%s:%s", start_str, stop_str);
+ finish_tfind_command (target_buf, sizeof (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 */
static void
-tracepoint_save_command (args, from_tty)
- char *args;
- int from_tty;
+tracepoint_save_command (char *args, int from_tty)
{
- struct tracepoint *tp;
+ struct tracepoint *tp;
struct action_line *line;
FILE *fp;
char *i1 = " ", *i2 = " ";
- char *indent, *actionline;
+ char *indent, *actionline, *pathname;
+ char tmp[40];
if (args == 0 || *args == 0)
error ("Argument required (file name in which to save tracepoints");
@@ -2252,46 +2277,52 @@ tracepoint_save_command (args, from_tty)
return;
}
- if (!(fp = fopen (args, "w")))
- error ("Unable to open file '%s' for saving tracepoints");
-
+ pathname = tilde_expand (args);
+ if (!(fp = fopen (pathname, "w")))
+ error ("Unable to open file '%s' for saving tracepoints (%s)",
+ args, strerror (errno));
+ xfree (pathname);
+
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
+ {
+ sprintf_vma (tmp, tp->address);
+ fprintf (fp, "trace *0x%s\n", tmp);
+ }
- 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 ((int) *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_cfunc_eq (cmd, while_stepping_pseudocommand))
+ indent = i2;
+ else if (cmd_cfunc_eq (cmd, end_actions_pseudocommand))
+ indent = i1;
+ }
+ }
+ }
+ }
fclose (fp);
if (from_tty)
printf_filtered ("Tracepoints saved to file '%s'.\n", args);
@@ -2300,24 +2331,21 @@ tracepoint_save_command (args, from_tty)
/* info scope command: list the locals for a scope. */
static void
-scope_info (args, from_tty)
- char *args;
- int from_tty;
+scope_info (char *args, int from_tty)
{
- struct symtab_and_line sal;
struct symtabs_and_lines sals;
struct symbol *sym;
struct minimal_symbol *msym;
struct block *block;
char **canonical, *symname, *save_args = args;
- int i, j, nsyms, count = 0;
+ int i, j, count = 0;
if (args == 0 || *args == 0)
error ("requires an argument (function, line or *addr) to define a scope");
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]);
@@ -2325,107 +2353,107 @@ scope_info (args, from_tty)
while (block != 0)
{
- 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 */
+ ALL_BLOCK_SYMBOLS (block, i, sym)
{
- 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 %ld (0x%lx)",
+ 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 %ld from register $%s",
+ SYMBOL_VALUE (sym),
+ REGISTER_NAME (SYMBOL_BASEREG (sym)));
+ break;
+ case LOC_BASEREG_ARG:
+ printf_filtered ("an argument at offset %ld 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;
@@ -2439,24 +2467,22 @@ scope_info (args, from_tty)
/* worker function (cleanup) */
static void
-replace_comma (comma)
- char *comma;
+replace_comma (void *data)
{
+ char *comma = data;
*comma = ',';
}
/* tdump command */
static void
-trace_dump_command (args, from_tty)
- char *args;
- int from_tty;
+trace_dump_command (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 ())
{
@@ -2472,34 +2498,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))
+ while (isspace ((int) *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;
@@ -2508,11 +2534,11 @@ trace_dump_command (args, from_tty)
if (cmd == 0)
error ("Bad action list item: %s", action_exp);
- if (cmd->function.cfunc == while_stepping_pseudocommand)
+ if (cmd_cfunc_eq (cmd, while_stepping_pseudocommand))
stepping_actions = 1;
- else if (cmd->function.cfunc == end_actions_pseudocommand)
+ else if (cmd_cfunc_eq (cmd, end_actions_pseudocommand))
stepping_actions = 0;
- else if (cmd->function.cfunc == collect_pseudocommand)
+ else if (cmd_cfunc_eq (cmd, collect_pseudocommand))
{
/* Display the collected data.
For the trap frame, display only what was collected at the trap.
@@ -2521,36 +2547,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 ((int) *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 == ',');
}
}
}
@@ -2562,13 +2590,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)
- unsigned char *mem;
- unsigned char *buf;
- int count;
+mem2hex (unsigned char *mem, unsigned char *buf, int count)
{
unsigned char ch;
@@ -2585,30 +2610,33 @@ mem2hex(mem, buf, count)
return buf;
}
-int get_traceframe_number()
+int
+get_traceframe_number (void)
{
- return traceframe_number;
+ return traceframe_number;
}
/* module initialization */
void
-_initialize_tracepoint ()
+_initialize_tracepoint (void)
{
- tracepoint_chain = 0;
- tracepoint_count = 0;
+ struct cmd_list_element *c;
+
+ 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)
@@ -2621,7 +2649,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));
}
@@ -2632,11 +2660,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, NULL,
+ "Tracing of program execution without stopping the program.",
&cmdlist);
add_info ("tracepoints", tracepoints_info,
@@ -2646,26 +2674,27 @@ last tracepoint set.");
add_info_alias ("tp", "tracepoints", 1);
- add_com ("save-tracepoints", class_trace, tracepoint_save_command,
- "Save current tracepoint definitions as a script.\n\
+ c = 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.");
+ c->completer = filename_completer;
- 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,
@@ -2698,16 +2727,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\
@@ -2728,10 +2757,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\
@@ -2747,34 +2776,34 @@ 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.",
&enablelist);
- add_com ("trace", class_trace, trace_command,
- "Set a tracepoint at a specified line or function or address.\n\
+ c = add_com ("trace", class_trace, trace_command,
+ "Set a tracepoint at a specified line or function or address.\n\
Argument may be a line number, function name, or '*' plus an address.\n\
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.");
+ c->completer = location_completer;
- 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);
}
-
diff --git a/contrib/gdb/gdb/tracepoint.h b/contrib/gdb/gdb/tracepoint.h
index 4c1ee82..c464ae1 100644
--- a/contrib/gdb/gdb/tracepoint.h
+++ b/contrib/gdb/gdb/tracepoint.h
@@ -1,109 +1,107 @@
/* Data structures associated with tracepoints in GDB.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 };
-#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;
+ int enabled_p;
#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;
- /* 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;
+ /* Chain of action lines to execute when this tracepoint is hit. */
+ struct action_line *actions;
- /* Conditional (MVS ?). */
- struct expression *cond;
+ /* Conditional (MVS ?). */
+ struct expression *cond;
- /* String we used to set the tracepoint (malloc'd). Only matters if
- address is non-NULL. */
- char *addr_string;
+ /* String we used to set the tracepoint (malloc'd). Only matters if
+ address is non-NULL. */
+ char *addr_string;
- /* Language we used to set the tracepoint. */
- enum language language;
+ /* Language we used to set the tracepoint. */
+ enum language language;
- /* Input radix we used to set the tracepoint. */
- int input_radix;
+ /* Input radix we used to set the tracepoint. */
+ int input_radix;
- /* 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;
+ /* 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;
- /* Thread number for thread-specific tracepoint, or -1 if don't care */
- int thread;
+ /* 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;
-};
+ /* 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 */
+/* The tracepoint chain of all tracepoints */
extern struct tracepoint *tracepoint_chain;
@@ -111,17 +109,16 @@ extern unsigned long trace_running_p;
/* A hook used to notify the UI of tracepoint operations */
-void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
-void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
-void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *));
-void (*trace_find_hook) PARAMS ((char *arg, int from_tty));
-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 (*create_tracepoint_hook) (struct tracepoint *);
+void (*delete_tracepoint_hook) (struct tracepoint *);
+void (*modify_tracepoint_hook) (struct tracepoint *);
+void (*trace_find_hook) (char *arg, int from_tty);
+void (*trace_start_stop_hook) (int start, int from_tty);
+
+struct tracepoint *get_tracepoint_by_number (char **, int, int);
+int get_traceframe_number (void);
+void free_actions (struct tracepoint *);
+enum actionline_type validate_actionline (char **, struct tracepoint *);
/* Walk the following statement or block through all tracepoints.
diff --git a/contrib/gdb/gdb/typeprint.c b/contrib/gdb/gdb/typeprint.c
index 1a4877b..b56610d 100644
--- a/contrib/gdb/gdb/typeprint.c
+++ b/contrib/gdb/gdb/typeprint.c
@@ -1,21 +1,23 @@
/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright 1986, 88, 89, 91, 92, 93, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -29,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcmd.h"
#include "target.h"
#include "language.h"
-#include "demangle.h"
+#include "cp-abi.h"
#include "gdb_string.h"
#include <errno.h>
@@ -38,17 +40,70 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern int objectprint; /* Controls looking up an object's derived type
using what we find in its vtables. */
-static void
-ptype_command PARAMS ((char *, int));
+extern void _initialize_typeprint (void);
-static struct type *
-ptype_eval PARAMS ((struct expression *));
+static void ptype_command (char *, int);
-static void
-whatis_command PARAMS ((char *, int));
+static struct type *ptype_eval (struct expression *);
-static void
-whatis_exp PARAMS ((char *, int));
+static void whatis_command (char *, int);
+
+static void whatis_exp (char *, int);
+
+/* 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
+typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
+{
+ CHECK_TYPEDEF (type);
+ 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));
+ 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));
+ else
+ fprintf_filtered (stream, "<builtin> = ");
+ type_print (type, "", stream, 0);
+ break;
+#endif
+#ifdef _LANG_pascal
+ case language_pascal:
+ fprintf_filtered (stream, "type ");
+ fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
+ type_print (type, "", stream, 0);
+ break;
+#endif
+#ifdef _LANG_chill
+ case language_chill:
+ fprintf_filtered (stream, "SYNMODE ");
+ if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
+ !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
+ fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
+ else
+ fprintf_filtered (stream, "<builtin> = ");
+ type_print (type, "", stream, 0);
+ break;
+#endif
+ default:
+ error ("Language not supported.");
+ }
+ fprintf_filtered (stream, ";\n");
+}
/* Print a description of a type TYPE in the form of a declaration of a
variable named VARSTRING. (VARSTRING is demangled if necessary.)
@@ -58,11 +113,8 @@ whatis_exp PARAMS ((char *, int));
If SHOW is negative, we never show the details of elements' types. */
void
-type_print (type, varstring, stream, show)
- struct type *type;
- char *varstring;
- GDB_FILE *stream;
- int show;
+type_print (struct type *type, char *varstring, struct ui_file *stream,
+ int show)
{
LA_PRINT_TYPE (type, varstring, stream, show, 0);
}
@@ -71,14 +123,13 @@ type_print (type, varstring, stream, show)
show is passed to type_print. */
static void
-whatis_exp (exp, show)
- char *exp;
- int show;
+whatis_exp (char *exp, int show)
{
struct expression *expr;
- register value_ptr val;
+ struct value *val;
register struct cleanup *old_chain = NULL;
- struct type * real_type = NULL;
+ struct type *real_type = NULL;
+ struct type *type;
int full = 0;
int top = -1;
int using_enc = 0;
@@ -86,24 +137,46 @@ 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 (free_current_contents, &expr);
val = evaluate_type (expr);
}
else
val = access_value_history (0);
+ type = VALUE_TYPE (val);
+
+ if (objectprint)
+ {
+ if (((TYPE_CODE (type) == TYPE_CODE_PTR) ||
+ (TYPE_CODE (type) == TYPE_CODE_REF))
+ &&
+ (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+ {
+ real_type = value_rtti_target_type (val, &full, &top, &using_enc);
+ if (real_type)
+ {
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ real_type = lookup_pointer_type (real_type);
+ else
+ real_type = lookup_reference_type (real_type);
+ }
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
real_type = value_rtti_type (val, &full, &top, &using_enc);
+ }
printf_filtered ("type = ");
- if (real_type && objectprint)
- printf_filtered ("/* real type = %s%s */\n",
- TYPE_NAME (real_type),
- full ? "" : " (incomplete object)");
- /* FIXME: maybe better to use type_print (real_type, "", gdb_stdout, -1); */
+ if (real_type)
+ {
+ printf_filtered ("/* real type = ");
+ type_print (real_type, "", gdb_stdout, -1);
+ if (! full)
+ printf_filtered (" (incomplete object)");
+ printf_filtered (" */\n");
+ }
- type_print (VALUE_TYPE (val), "", gdb_stdout, show);
+ type_print (type, "", gdb_stdout, show);
printf_filtered ("\n");
if (exp)
@@ -112,9 +185,7 @@ whatis_exp (exp, show)
/* ARGSUSED */
static void
-whatis_command (exp, from_tty)
- char *exp;
- int from_tty;
+whatis_command (char *exp, int from_tty)
{
/* Most of the time users do not want to see all the fields
in a structure. If they do they can use the "ptype" command.
@@ -125,8 +196,7 @@ whatis_command (exp, from_tty)
/* Simple subroutine for ptype_command. */
static struct type *
-ptype_eval (exp)
- struct expression *exp;
+ptype_eval (struct expression *exp)
{
if (exp->elts[0].opcode == OP_TYPE)
{
@@ -142,9 +212,7 @@ ptype_eval (exp)
/* ARGSUSED */
static void
-ptype_command (typename, from_tty)
- char *typename;
- int from_tty;
+ptype_command (char *typename, int from_tty)
{
register struct type *type;
struct expression *expr;
@@ -158,8 +226,7 @@ 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 (free_current_contents, &expr);
type = ptype_eval (expr);
if (type != NULL)
{
@@ -191,10 +258,7 @@ ptype_command (typename, from_tty)
that come from the inferior in target byte order and target size. */
void
-print_type_scalar (type, val, stream)
- struct type *type;
- LONGEST val;
- GDB_FILE *stream;
+print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
{
unsigned int i;
unsigned len;
@@ -262,51 +326,45 @@ print_type_scalar (type, val, stream)
gdb_flush (stream);
}
-#if MAINTENANCE_CMDS
-
/* Dump details of a type specified either directly or indirectly.
Uses the same sort of type lookup mechanism as ptype_command()
and whatis_command(). */
void
-maintenance_print_type (typename, from_tty)
- char *typename;
- int from_tty;
+maintenance_print_type (char *typename, int from_tty)
{
- register value_ptr val;
+ struct value *val;
register struct type *type;
register struct cleanup *old_chain;
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 (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);
+ }
}
-
-#endif /* MAINTENANCE_CMDS */
-
+
void
-_initialize_typeprint ()
+_initialize_typeprint (void)
{
add_com ("ptype", class_vars, ptype_command,
diff --git a/contrib/gdb/gdb/typeprint.h b/contrib/gdb/gdb/typeprint.h
index be4d81a..c57cc58 100644
--- a/contrib/gdb/gdb/typeprint.h
+++ b/contrib/gdb/gdb/typeprint.h
@@ -1,25 +1,29 @@
/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1999
+ Copyright 1986, 1988, 1989, 1991-1993, 1999, 2000
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 *));
+#ifndef TYPEPRINT_H
+#define TYPEPRINT_H
-void
-c_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *, int, int, int));
+void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
+
+void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
+ int, int);
+#endif
diff --git a/contrib/gdb/gdb/ui-file.c b/contrib/gdb/gdb/ui-file.c
new file mode 100644
index 0000000..86655e9
--- /dev/null
+++ b/contrib/gdb/gdb/ui-file.c
@@ -0,0 +1,487 @@
+/* UI_FILE - a generic STDIO like output stream.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Implement the ``struct ui_file'' object. */
+
+#include "defs.h"
+#include "ui-file.h"
+#include "gdb_string.h"
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+static ui_file_isatty_ftype null_file_isatty;
+static ui_file_write_ftype null_file_write;
+static ui_file_fputs_ftype null_file_fputs;
+static ui_file_flush_ftype null_file_flush;
+static ui_file_delete_ftype null_file_delete;
+static ui_file_rewind_ftype null_file_rewind;
+static ui_file_put_ftype null_file_put;
+
+struct ui_file
+ {
+ int *magic;
+ ui_file_flush_ftype *to_flush;
+ ui_file_write_ftype *to_write;
+ ui_file_fputs_ftype *to_fputs;
+ ui_file_delete_ftype *to_delete;
+ ui_file_isatty_ftype *to_isatty;
+ ui_file_rewind_ftype *to_rewind;
+ ui_file_put_ftype *to_put;
+ void *to_data;
+ };
+int ui_file_magic;
+
+struct ui_file *
+ui_file_new (void)
+{
+ struct ui_file *file = xmalloc (sizeof (struct ui_file));
+ file->magic = &ui_file_magic;
+ set_ui_file_data (file, NULL, null_file_delete);
+ set_ui_file_flush (file, null_file_flush);
+ set_ui_file_write (file, null_file_write);
+ set_ui_file_fputs (file, null_file_fputs);
+ set_ui_file_isatty (file, null_file_isatty);
+ set_ui_file_rewind (file, null_file_rewind);
+ set_ui_file_put (file, null_file_put);
+ return file;
+}
+
+void
+ui_file_delete (struct ui_file *file)
+{
+ file->to_delete (file);
+ xfree (file);
+}
+
+static int
+null_file_isatty (struct ui_file *file)
+{
+ return 0;
+}
+
+static void
+null_file_rewind (struct ui_file *file)
+{
+ return;
+}
+
+static void
+null_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ return;
+}
+
+static void
+null_file_flush (struct ui_file *file)
+{
+ return;
+}
+
+static void
+null_file_write (struct ui_file *file,
+ const char *buf,
+ long sizeof_buf)
+{
+ if (file->to_fputs == null_file_fputs)
+ /* Both the write and fputs methods are null. Discard the
+ request. */
+ return;
+ else
+ {
+ /* The fputs method isn't null, slowly pass the write request
+ onto that. FYI, this isn't as bad as it may look - the
+ current (as of 1999-11-07) printf_* function calls fputc and
+ fputc does exactly the below. By having a write function it
+ is possible to clean up that code. */
+ int i;
+ char b[2];
+ b[1] = '\0';
+ for (i = 0; i < sizeof_buf; i++)
+ {
+ b[0] = buf[i];
+ file->to_fputs (b, file);
+ }
+ return;
+ }
+}
+
+static void
+null_file_fputs (const char *buf, struct ui_file *file)
+{
+ if (file->to_write == null_file_write)
+ /* Both the write and fputs methods are null. Discard the
+ request. */
+ return;
+ else
+ {
+ /* The write method was implemented, use that. */
+ file->to_write (file, buf, strlen (buf));
+ }
+}
+
+static void
+null_file_delete (struct ui_file *file)
+{
+ return;
+}
+
+void *
+ui_file_data (struct ui_file *file)
+{
+ if (file->magic != &ui_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "ui_file_data: bad magic number");
+ return file->to_data;
+}
+
+void
+gdb_flush (struct ui_file *file)
+{
+ file->to_flush (file);
+}
+
+int
+ui_file_isatty (struct ui_file *file)
+{
+ return file->to_isatty (file);
+}
+
+void
+ui_file_rewind (struct ui_file *file)
+{
+ file->to_rewind (file);
+}
+
+void
+ui_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ file->to_put (file, write, dest);
+}
+
+void
+ui_file_write (struct ui_file *file,
+ const char *buf,
+ long length_buf)
+{
+ file->to_write (file, buf, length_buf);
+}
+
+void
+fputs_unfiltered (const char *buf, struct ui_file *file)
+{
+ file->to_fputs (buf, file);
+}
+
+void
+set_ui_file_flush (struct ui_file *file, ui_file_flush_ftype *flush)
+{
+ file->to_flush = flush;
+}
+
+void
+set_ui_file_isatty (struct ui_file *file, ui_file_isatty_ftype *isatty)
+{
+ file->to_isatty = isatty;
+}
+
+void
+set_ui_file_rewind (struct ui_file *file, ui_file_rewind_ftype *rewind)
+{
+ file->to_rewind = rewind;
+}
+
+void
+set_ui_file_put (struct ui_file *file, ui_file_put_ftype *put)
+{
+ file->to_put = put;
+}
+
+void
+set_ui_file_write (struct ui_file *file,
+ ui_file_write_ftype *write)
+{
+ file->to_write = write;
+}
+
+void
+set_ui_file_fputs (struct ui_file *file, ui_file_fputs_ftype *fputs)
+{
+ file->to_fputs = fputs;
+}
+
+void
+set_ui_file_data (struct ui_file *file, void *data,
+ ui_file_delete_ftype *delete)
+{
+ file->to_data = data;
+ file->to_delete = delete;
+}
+
+/* ui_file utility function for converting a ``struct ui_file'' into
+ a memory buffer''. */
+
+struct accumulated_ui_file
+{
+ char *buffer;
+ long length;
+};
+
+static void
+do_ui_file_xstrdup (void *context, const char *buffer, long length)
+{
+ struct accumulated_ui_file *acc = context;
+ if (acc->buffer == NULL)
+ acc->buffer = xmalloc (length + 1);
+ else
+ acc->buffer = xrealloc (acc->buffer, acc->length + length + 1);
+ memcpy (acc->buffer + acc->length, buffer, length);
+ acc->length += length;
+ acc->buffer[acc->length] = '\0';
+}
+
+char *
+ui_file_xstrdup (struct ui_file *file,
+ long *length)
+{
+ struct accumulated_ui_file acc;
+ acc.buffer = NULL;
+ acc.length = 0;
+ ui_file_put (file, do_ui_file_xstrdup, &acc);
+ if (acc.buffer == NULL)
+ acc.buffer = xstrdup ("");
+ *length = acc.length;
+ return acc.buffer;
+}
+
+/* A pure memory based ``struct ui_file'' that can be used an output
+ buffer. The buffers accumulated contents are available via
+ ui_file_put(). */
+
+struct mem_file
+ {
+ int *magic;
+ char *buffer;
+ int sizeof_buffer;
+ int length_buffer;
+ };
+
+static ui_file_rewind_ftype mem_file_rewind;
+static ui_file_put_ftype mem_file_put;
+static ui_file_write_ftype mem_file_write;
+static ui_file_delete_ftype mem_file_delete;
+static struct ui_file *mem_file_new (void);
+static int mem_file_magic;
+
+static struct ui_file *
+mem_file_new (void)
+{
+ struct mem_file *stream = XMALLOC (struct mem_file);
+ struct ui_file *file = ui_file_new ();
+ set_ui_file_data (file, stream, mem_file_delete);
+ set_ui_file_rewind (file, mem_file_rewind);
+ set_ui_file_put (file, mem_file_put);
+ set_ui_file_write (file, mem_file_write);
+ stream->magic = &mem_file_magic;
+ stream->buffer = NULL;
+ stream->sizeof_buffer = 0;
+ stream->length_buffer = 0;
+ return file;
+}
+
+static void
+mem_file_delete (struct ui_file *file)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mem_file_delete: bad magic number");
+ if (stream->buffer != NULL)
+ xfree (stream->buffer);
+ xfree (stream);
+}
+
+struct ui_file *
+mem_fileopen (void)
+{
+ return mem_file_new ();
+}
+
+static void
+mem_file_rewind (struct ui_file *file)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mem_file_rewind: bad magic number");
+ stream->length_buffer = 0;
+}
+
+static void
+mem_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mem_file_put: bad magic number");
+ if (stream->length_buffer > 0)
+ write (dest, stream->buffer, stream->length_buffer);
+}
+
+void
+mem_file_write (struct ui_file *file,
+ const char *buffer,
+ long length_buffer)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "mem_file_write: bad magic number");
+ if (stream->buffer == NULL)
+ {
+ stream->length_buffer = length_buffer;
+ stream->sizeof_buffer = length_buffer;
+ stream->buffer = xmalloc (stream->sizeof_buffer);
+ memcpy (stream->buffer, buffer, length_buffer);
+ }
+ else
+ {
+ int new_length = stream->length_buffer + length_buffer;
+ if (new_length >= stream->sizeof_buffer)
+ {
+ stream->sizeof_buffer = new_length;
+ stream->buffer = xrealloc (stream->buffer, stream->sizeof_buffer);
+ }
+ memcpy (stream->buffer + stream->length_buffer, buffer, length_buffer);
+ stream->length_buffer = new_length;
+ }
+}
+
+/* ``struct ui_file'' implementation that maps directly onto
+ <stdio.h>'s FILE. */
+
+static ui_file_write_ftype stdio_file_write;
+static ui_file_fputs_ftype stdio_file_fputs;
+static ui_file_isatty_ftype stdio_file_isatty;
+static ui_file_delete_ftype stdio_file_delete;
+static struct ui_file *stdio_file_new (FILE * file, int close_p);
+static ui_file_flush_ftype stdio_file_flush;
+
+static int stdio_file_magic;
+
+struct stdio_file
+ {
+ int *magic;
+ FILE *file;
+ int close_p;
+ };
+
+static struct ui_file *
+stdio_file_new (FILE *file, int close_p)
+{
+ struct ui_file *ui_file = ui_file_new ();
+ struct stdio_file *stdio = xmalloc (sizeof (struct stdio_file));
+ stdio->magic = &stdio_file_magic;
+ stdio->file = file;
+ stdio->close_p = close_p;
+ set_ui_file_data (ui_file, stdio, stdio_file_delete);
+ set_ui_file_flush (ui_file, stdio_file_flush);
+ set_ui_file_write (ui_file, stdio_file_write);
+ set_ui_file_fputs (ui_file, stdio_file_fputs);
+ set_ui_file_isatty (ui_file, stdio_file_isatty);
+ return ui_file;
+}
+
+static void
+stdio_file_delete (struct ui_file *file)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "stdio_file_delete: bad magic number");
+ if (stdio->close_p)
+ {
+ fclose (stdio->file);
+ }
+ xfree (stdio);
+}
+
+static void
+stdio_file_flush (struct ui_file *file)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "stdio_file_flush: bad magic number");
+ fflush (stdio->file);
+}
+
+static void
+stdio_file_write (struct ui_file *file, const char *buf, long length_buf)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "stdio_file_write: bad magic number");
+ fwrite (buf, length_buf, 1, stdio->file);
+}
+
+static void
+stdio_file_fputs (const char *linebuffer, struct ui_file *file)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "stdio_file_fputs: bad magic number");
+ fputs (linebuffer, stdio->file);
+}
+
+static int
+stdio_file_isatty (struct ui_file *file)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "stdio_file_isatty: bad magic number");
+ return (isatty (fileno (stdio->file)));
+}
+
+/* Like fdopen(). Create a ui_file from a previously opened FILE. */
+
+struct ui_file *
+stdio_fileopen (FILE *file)
+{
+ return stdio_file_new (file, 0);
+}
+
+struct ui_file *
+gdb_fopen (char *name, char *mode)
+{
+ FILE *f = fopen (name, mode);
+ if (f == NULL)
+ return NULL;
+ return stdio_file_new (f, 1);
+}
diff --git a/contrib/gdb/gdb/ui-file.h b/contrib/gdb/gdb/ui-file.h
new file mode 100644
index 0000000..3c35193
--- /dev/null
+++ b/contrib/gdb/gdb/ui-file.h
@@ -0,0 +1,93 @@
+/* UI_FILE - a generic STDIO like output stream.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef UI_FILE_H
+#define UI_FILE_H
+
+struct ui_file;
+
+/* Create a generic ui_file object with null methods. */
+
+extern struct ui_file *ui_file_new (void);
+
+/* Override methods used by specific implementations of a UI_FILE
+ object. */
+
+typedef void (ui_file_flush_ftype) (struct ui_file * stream);
+extern void set_ui_file_flush (struct ui_file *stream, ui_file_flush_ftype * flush);
+
+/* NOTE: Both fputs and write methods are available. Default
+ implementations that mapping one onto the other are included. */
+typedef void (ui_file_write_ftype) (struct ui_file * stream, const char *buf, long length_buf);
+extern void set_ui_file_write (struct ui_file *stream, ui_file_write_ftype *fputs);
+
+typedef void (ui_file_fputs_ftype) (const char *, struct ui_file * stream);
+extern void set_ui_file_fputs (struct ui_file *stream, ui_file_fputs_ftype * fputs);
+
+typedef int (ui_file_isatty_ftype) (struct ui_file * stream);
+extern void set_ui_file_isatty (struct ui_file *stream, ui_file_isatty_ftype * isatty);
+
+typedef void (ui_file_rewind_ftype) (struct ui_file * stream);
+extern void set_ui_file_rewind (struct ui_file *stream, ui_file_rewind_ftype * rewind);
+
+typedef void (ui_file_put_method_ftype) (void *object, const char *buffer, long length_buffer);
+typedef void (ui_file_put_ftype) (struct ui_file *stream, ui_file_put_method_ftype * method, void *context);
+extern void set_ui_file_put (struct ui_file *stream, ui_file_put_ftype * put);
+
+typedef void (ui_file_delete_ftype) (struct ui_file * stream);
+extern void set_ui_file_data (struct ui_file *stream, void *data, ui_file_delete_ftype * delete);
+
+extern void *ui_file_data (struct ui_file *file);
+
+
+extern void gdb_flush (struct ui_file *);
+
+extern void ui_file_delete (struct ui_file *stream);
+
+extern void ui_file_rewind (struct ui_file *stream);
+
+extern int ui_file_isatty (struct ui_file *);
+
+extern void ui_file_write (struct ui_file *file, const char *buf, long length_buf);
+
+/* NOTE: copies left to right */
+extern void ui_file_put (struct ui_file *src, ui_file_put_method_ftype *write, void *dest);
+
+/* Returns a freshly allocated buffer containing the entire contents
+ of FILE (as determined by ui_file_put()) with a NUL character
+ appended. LENGTH is set to the size of the buffer minus that
+ appended NUL. */
+extern char *ui_file_xstrdup (struct ui_file *file, long *length);
+
+
+
+/* Create/open a memory based file. Can be used as a scratch buffer
+ for collecting output. */
+extern struct ui_file *mem_fileopen (void);
+
+
+
+/* Open/create a an STDIO based UI_FILE using the already open FILE. */
+extern struct ui_file *stdio_fileopen (FILE *file);
+
+/* Open NAME returning an STDIO based UI_FILE. */
+extern struct ui_file *gdb_fopen (char *name, char *mode);
+
+#endif
diff --git a/contrib/gdb/gdb/ui-out.c b/contrib/gdb/gdb/ui-out.c
new file mode 100644
index 0000000..06db646
--- /dev/null
+++ b/contrib/gdb/gdb/ui-out.c
@@ -0,0 +1,1147 @@
+/* Output generating routines for GDB.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+ Written by Fernando Nasser 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. */
+
+#include "defs.h"
+#include "gdb_string.h"
+#include "expression.h" /* For language.h */
+#include "language.h"
+#include "ui-out.h"
+#include "gdb_assert.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+
+/* table header structures */
+
+struct ui_out_hdr
+ {
+ int colno;
+ int width;
+ int alignment;
+ char *col_name;
+ char *colhdr;
+ struct ui_out_hdr *next;
+ };
+
+/* Maintain a stack so that the info applicable to the inner most list
+ is always available. Stack/nested level 0 is reserved for the
+ top-level result. */
+
+enum { MAX_UI_OUT_LEVELS = 5 };
+
+struct ui_out_level
+ {
+ /* Count each field; the first element is for non-list fields */
+ int field_count;
+ /* The type of this level. */
+ enum ui_out_type type;
+ };
+
+/* Tables are special. Maintain a separate structure that tracks
+ their state. At present an output can only contain a single table
+ but that restriction might eventually be lifted. */
+
+struct ui_out_table
+{
+ /* If on, a table is being generated. */
+ int flag;
+
+ /* If on, the body of a table is being generated. If off, the table
+ header is being generated. */
+ int body_flag;
+
+ /* The level at which each entry of the table is to be found. A row
+ (a tuple) is made up of entries. Consequently ENTRY_LEVEL is one
+ above that of the table. */
+ int entry_level;
+
+ /* Number of table columns (as specified in the table_begin call). */
+ int columns;
+
+ /* String identifying the table (as specified in the table_begin
+ call). */
+ char *id;
+
+ /* Points to the first table header (if any). */
+ struct ui_out_hdr *header_first;
+
+ /* Points to the last table header (if any). */
+ struct ui_out_hdr *header_last;
+
+ /* Points to header of NEXT column to format. */
+ struct ui_out_hdr *header_next;
+
+};
+
+
+/* The ui_out structure */
+/* Any change here requires a corresponding one in the initialization
+ of the default uiout, which is statically initialized */
+
+struct ui_out
+ {
+ int flags;
+ /* specific implementation of ui-out */
+ struct ui_out_impl *impl;
+ struct ui_out_data *data;
+
+ /* Sub structure tracking the ui-out depth. */
+ int level;
+ struct ui_out_level levels[MAX_UI_OUT_LEVELS];
+
+ /* A table, if any. At present only a single table is supported. */
+ struct ui_out_table table;
+ };
+
+/* The current (inner most) level. */
+static struct ui_out_level *
+current_level (struct ui_out *uiout)
+{
+ return &uiout->levels[uiout->level];
+}
+
+/* Create a new level, of TYPE. Return the new level's index. */
+static int
+push_level (struct ui_out *uiout,
+ enum ui_out_type type,
+ const char *id)
+{
+ struct ui_out_level *current;
+ /* We had better not overflow the buffer. */
+ uiout->level++;
+ gdb_assert (uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS);
+ current = current_level (uiout);
+ current->field_count = 0;
+ current->type = type;
+ return uiout->level;
+}
+
+/* Discard the current level, return the discarded level's index.
+ TYPE is the type of the level being discarded. */
+static int
+pop_level (struct ui_out *uiout,
+ enum ui_out_type type)
+{
+ /* We had better not underflow the buffer. */
+ gdb_assert (uiout->level > 0 && uiout->level < MAX_UI_OUT_LEVELS);
+ gdb_assert (current_level (uiout)->type == type);
+ uiout->level--;
+ return uiout->level + 1;
+}
+
+
+/* These are the default implementation functions */
+
+static void default_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows, const char *tblid);
+static void default_table_body (struct ui_out *uiout);
+static void default_table_end (struct ui_out *uiout);
+static void default_table_header (struct ui_out *uiout, int width,
+ enum ui_align alig, const char *col_name,
+ const char *colhdr);
+static void default_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level, const char *id);
+static void default_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level);
+static void default_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig,
+ const char *fldname,
+ int value);
+static void default_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align alig,
+ const char *fldname);
+static void default_field_string (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string);
+static void default_field_fmt (struct ui_out *uiout, int fldno,
+ int width, enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args);
+static void default_spaces (struct ui_out *uiout, int numspaces);
+static void default_text (struct ui_out *uiout, const char *string);
+static void default_message (struct ui_out *uiout, int verbosity,
+ const char *format,
+ va_list args);
+static void default_wrap_hint (struct ui_out *uiout, char *identstring);
+static void default_flush (struct ui_out *uiout);
+
+/* This is the default ui-out implementation functions vector */
+
+struct ui_out_impl default_ui_out_impl =
+{
+ default_table_begin,
+ default_table_body,
+ default_table_end,
+ default_table_header,
+ default_begin,
+ default_end,
+ default_field_int,
+ default_field_skip,
+ default_field_string,
+ default_field_fmt,
+ default_spaces,
+ default_text,
+ default_message,
+ default_wrap_hint,
+ default_flush,
+ 0, /* Does not need MI hacks. */
+};
+
+/* The default ui_out */
+
+struct ui_out def_uiout =
+{
+ 0, /* flags */
+ &default_ui_out_impl, /* impl */
+};
+
+/* Pointer to current ui_out */
+/* FIXME: This should not be a global, but something passed down from main.c
+ or top.c */
+
+struct ui_out *uiout = &def_uiout;
+
+/* These are the interfaces to implementation functions */
+
+static void uo_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows, const char *tblid);
+static void uo_table_body (struct ui_out *uiout);
+static void uo_table_end (struct ui_out *uiout);
+static void uo_table_header (struct ui_out *uiout, int width,
+ enum ui_align align, const char *col_name,
+ const char *colhdr);
+static void uo_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level, const char *id);
+static void uo_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level);
+static void uo_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align, const char *fldname, int value);
+static void uo_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align, const char *fldname);
+static void uo_field_string (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align, const char *fldname,
+ const char *string);
+static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align, const char *fldname,
+ const char *format, va_list args);
+static void uo_spaces (struct ui_out *uiout, int numspaces);
+static void uo_text (struct ui_out *uiout, const char *string);
+static void uo_message (struct ui_out *uiout, int verbosity,
+ const char *format, va_list args);
+static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
+static void uo_flush (struct ui_out *uiout);
+
+/* Prototypes for local functions */
+
+extern void _initialize_ui_out (void);
+static void append_header_to_list (struct ui_out *uiout, int width,
+ int alignment, const char *col_name,
+ const char *colhdr);
+static int get_next_header (struct ui_out *uiout, int *colno, int *width,
+ int *alignment, char **colhdr);
+static void clear_header_list (struct ui_out *uiout);
+static void verify_field (struct ui_out *uiout, int *fldno, int *width,
+ int *align);
+
+static void init_ui_out_state (struct ui_out *uiout);
+
+/* exported functions (ui_out API) */
+
+/* Mark beginning of a table */
+
+void
+ui_out_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows,
+ const char *tblid)
+{
+ if (uiout->table.flag)
+ internal_error (__FILE__, __LINE__,
+ "tables cannot be nested; table_begin found before \
+previous table_end.");
+
+ uiout->table.flag = 1;
+ uiout->table.body_flag = 0;
+ uiout->table.entry_level = uiout->level + 1;
+ uiout->table.columns = nbrofcols;
+ if (tblid != NULL)
+ uiout->table.id = xstrdup (tblid);
+ else
+ uiout->table.id = NULL;
+ clear_header_list (uiout);
+
+ uo_table_begin (uiout, nbrofcols, nr_rows, uiout->table.id);
+}
+
+void
+ui_out_table_body (struct ui_out *uiout)
+{
+ if (!uiout->table.flag)
+ internal_error (__FILE__, __LINE__,
+ "table_body outside a table is not valid; it must be \
+after a table_begin and before a table_end.");
+ if (uiout->table.body_flag)
+ internal_error (__FILE__, __LINE__,
+ "extra table_body call not allowed; there must be \
+only one table_body after a table_begin and before a table_end.");
+ if (uiout->table.header_next->colno != uiout->table.columns)
+ internal_error (__FILE__, __LINE__,
+ "number of headers differ from number of table \
+columns.");
+
+ uiout->table.body_flag = 1;
+ uiout->table.header_next = uiout->table.header_first;
+
+ uo_table_body (uiout);
+}
+
+void
+ui_out_table_end (struct ui_out *uiout)
+{
+ if (!uiout->table.flag)
+ internal_error (__FILE__, __LINE__,
+ "misplaced table_end or missing table_begin.");
+
+ uiout->table.entry_level = 0;
+ uiout->table.body_flag = 0;
+ uiout->table.flag = 0;
+
+ uo_table_end (uiout);
+
+ if (uiout->table.id)
+ xfree (uiout->table.id);
+ clear_header_list (uiout);
+}
+
+void
+ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+ const char *col_name,
+ const char *colhdr)
+{
+ if (!uiout->table.flag || uiout->table.body_flag)
+ internal_error (__FILE__, __LINE__,
+ "table header must be specified after table_begin \
+and before table_body.");
+
+ append_header_to_list (uiout, width, alignment, col_name, colhdr);
+
+ uo_table_header (uiout, width, alignment, col_name, colhdr);
+}
+
+void
+ui_out_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ const char *id)
+{
+ int new_level;
+ if (uiout->table.flag && !uiout->table.body_flag)
+ internal_error (__FILE__, __LINE__,
+ "table header or table_body expected; lists must be \
+specified after table_body.");
+
+ /* Be careful to verify the ``field'' before the new tuple/list is
+ pushed onto the stack. That way the containing list/table/row is
+ verified and not the newly created tuple/list. This verification
+ is needed (at least) for the case where a table row entry
+ contains either a tuple/list. For that case bookkeeping such as
+ updating the column count or advancing to the next heading still
+ needs to be performed. */
+ {
+ int fldno;
+ int width;
+ int align;
+ verify_field (uiout, &fldno, &width, &align);
+ }
+
+ new_level = push_level (uiout, type, id);
+
+ /* If the push puts us at the same level as a table row entry, we've
+ got a new table row. Put the header pointer back to the start. */
+ if (uiout->table.body_flag
+ && uiout->table.entry_level == new_level)
+ uiout->table.header_next = uiout->table.header_first;
+
+ uo_begin (uiout, type, new_level, id);
+}
+
+void
+ui_out_list_begin (struct ui_out *uiout,
+ const char *id)
+{
+ ui_out_begin (uiout, ui_out_type_list, id);
+}
+
+void
+ui_out_tuple_begin (struct ui_out *uiout, const char *id)
+{
+ ui_out_begin (uiout, ui_out_type_tuple, id);
+}
+
+void
+ui_out_end (struct ui_out *uiout,
+ enum ui_out_type type)
+{
+ int old_level = pop_level (uiout, type);
+ uo_end (uiout, type, old_level);
+}
+
+void
+ui_out_list_end (struct ui_out *uiout)
+{
+ ui_out_end (uiout, ui_out_type_list);
+}
+
+void
+ui_out_tuple_end (struct ui_out *uiout)
+{
+ ui_out_end (uiout, ui_out_type_tuple);
+}
+
+struct ui_out_end_cleanup_data
+{
+ struct ui_out *uiout;
+ enum ui_out_type type;
+};
+
+static void
+do_cleanup_end (void *data)
+{
+ struct ui_out_end_cleanup_data *end_cleanup_data = data;
+ ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
+ xfree (end_cleanup_data);
+}
+
+static struct cleanup *
+make_cleanup_ui_out_end (struct ui_out *uiout,
+ enum ui_out_type type)
+{
+ struct ui_out_end_cleanup_data *end_cleanup_data;
+ end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
+ end_cleanup_data->uiout = uiout;
+ end_cleanup_data->type = type;
+ return make_cleanup (do_cleanup_end, end_cleanup_data);
+}
+
+struct cleanup *
+make_cleanup_ui_out_begin_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ const char *id)
+{
+ ui_out_begin (uiout, type, id);
+ return make_cleanup_ui_out_end (uiout, type);
+}
+
+struct cleanup *
+make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
+ const char *id)
+{
+ ui_out_tuple_begin (uiout, id);
+ return make_cleanup_ui_out_end (uiout, ui_out_type_tuple);
+}
+
+struct cleanup *
+make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
+ const char *id)
+{
+ ui_out_list_begin (uiout, id);
+ return make_cleanup_ui_out_end (uiout, ui_out_type_list);
+}
+
+void
+ui_out_field_int (struct ui_out *uiout,
+ const char *fldname,
+ int value)
+{
+ int fldno;
+ int width;
+ int align;
+ struct ui_out_level *current = current_level (uiout);
+
+ verify_field (uiout, &fldno, &width, &align);
+
+ uo_field_int (uiout, fldno, width, align, fldname, value);
+}
+
+void
+ui_out_field_core_addr (struct ui_out *uiout,
+ const char *fldname,
+ CORE_ADDR address)
+{
+ char addstr[20];
+
+ /* FIXME-32x64: need a print_address_numeric with field width */
+ /* print_address_numeric (address, 1, local_stream); */
+ strcpy (addstr, local_hex_string_custom ((unsigned long) address, "08l"));
+
+ ui_out_field_string (uiout, fldname, addstr);
+}
+
+void
+ui_out_field_stream (struct ui_out *uiout,
+ const char *fldname,
+ struct ui_stream *buf)
+{
+ long length;
+ char *buffer = ui_file_xstrdup (buf->stream, &length);
+ struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
+ if (length > 0)
+ ui_out_field_string (uiout, fldname, buffer);
+ else
+ ui_out_field_skip (uiout, fldname);
+ ui_file_rewind (buf->stream);
+ do_cleanups (old_cleanup);
+}
+
+/* used to ommit a field */
+
+void
+ui_out_field_skip (struct ui_out *uiout,
+ const char *fldname)
+{
+ int fldno;
+ int width;
+ int align;
+
+ verify_field (uiout, &fldno, &width, &align);
+
+ uo_field_skip (uiout, fldno, width, align, fldname);
+}
+
+void
+ui_out_field_string (struct ui_out *uiout,
+ const char *fldname,
+ const char *string)
+{
+ int fldno;
+ int width;
+ int align;
+
+ verify_field (uiout, &fldno, &width, &align);
+
+ uo_field_string (uiout, fldno, width, align, fldname, string);
+}
+
+/* VARARGS */
+void
+ui_out_field_fmt (struct ui_out *uiout,
+ const char *fldname,
+ const char *format, ...)
+{
+ va_list args;
+ int fldno;
+ int width;
+ int align;
+
+ /* will not align, but has to call anyway */
+ verify_field (uiout, &fldno, &width, &align);
+
+ va_start (args, format);
+
+ uo_field_fmt (uiout, fldno, width, align, fldname, format, args);
+
+ va_end (args);
+}
+
+void
+ui_out_spaces (struct ui_out *uiout, int numspaces)
+{
+ uo_spaces (uiout, numspaces);
+}
+
+void
+ui_out_text (struct ui_out *uiout,
+ const char *string)
+{
+ uo_text (uiout, string);
+}
+
+void
+ui_out_message (struct ui_out *uiout, int verbosity,
+ const char *format,...)
+{
+ va_list args;
+
+ va_start (args, format);
+
+ uo_message (uiout, verbosity, format, args);
+
+ va_end (args);
+}
+
+struct ui_stream *
+ui_out_stream_new (struct ui_out *uiout)
+{
+ struct ui_stream *tempbuf;
+
+ tempbuf = XMALLOC (struct ui_stream);
+ tempbuf->uiout = uiout;
+ tempbuf->stream = mem_fileopen ();
+ return tempbuf;
+}
+
+void
+ui_out_stream_delete (struct ui_stream *buf)
+{
+ ui_file_delete (buf->stream);
+ xfree (buf);
+}
+
+static void
+do_stream_delete (void *buf)
+{
+ ui_out_stream_delete (buf);
+}
+
+struct cleanup *
+make_cleanup_ui_out_stream_delete (struct ui_stream *buf)
+{
+ return make_cleanup (do_stream_delete, buf);
+}
+
+
+void
+ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
+{
+ uo_wrap_hint (uiout, identstring);
+}
+
+void
+ui_out_flush (struct ui_out *uiout)
+{
+ uo_flush (uiout);
+}
+
+/* set the flags specified by the mask given */
+int
+ui_out_set_flags (struct ui_out *uiout, int mask)
+{
+ int oldflags = uiout->flags;
+
+ uiout->flags |= mask;
+
+ return oldflags;
+}
+
+/* clear the flags specified by the mask given */
+int
+ui_out_clear_flags (struct ui_out *uiout, int mask)
+{
+ int oldflags = uiout->flags;
+
+ uiout->flags &= ~mask;
+
+ return oldflags;
+}
+
+/* test the flags against the mask given */
+int
+ui_out_test_flags (struct ui_out *uiout, int mask)
+{
+ return (uiout->flags & mask);
+}
+
+/* obtain the current verbosity level (as stablished by the
+ 'set verbositylevel' command */
+
+int
+ui_out_get_verblvl (struct ui_out *uiout)
+{
+ /* FIXME: not implemented yet */
+ return 0;
+}
+
+#if 0
+void
+ui_out_result_begin (struct ui_out *uiout, char *class)
+{
+}
+
+void
+ui_out_result_end (struct ui_out *uiout)
+{
+}
+
+void
+ui_out_info_begin (struct ui_out *uiout, char *class)
+{
+}
+
+void
+ui_out_info_end (struct ui_out *uiout)
+{
+}
+
+void
+ui_out_notify_begin (struct ui_out *uiout, char *class)
+{
+}
+
+void
+ui_out_notify_end (struct ui_out *uiout)
+{
+}
+
+void
+ui_out_error_begin (struct ui_out *uiout, char *class)
+{
+}
+
+void
+ui_out_error_end (struct ui_out *uiout)
+{
+}
+#endif
+
+#if 0
+void
+gdb_error (ui_out * uiout, int severity, char *format,...)
+{
+ va_list args;
+}
+
+void
+gdb_query (struct ui_out *uiout, int qflags, char *qprompt)
+{
+}
+#endif
+
+int
+ui_out_is_mi_like_p (struct ui_out *uiout)
+{
+ return uiout->impl->is_mi_like_p;
+}
+
+/* default gdb-out hook functions */
+
+static void
+default_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows,
+ const char *tblid)
+{
+}
+
+static void
+default_table_body (struct ui_out *uiout)
+{
+}
+
+static void
+default_table_end (struct ui_out *uiout)
+{
+}
+
+static void
+default_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+ const char *col_name,
+ const char *colhdr)
+{
+}
+
+static void
+default_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level,
+ const char *id)
+{
+}
+
+static void
+default_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level)
+{
+}
+
+static void
+default_field_int (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname, int value)
+{
+}
+
+static void
+default_field_skip (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align, const char *fldname)
+{
+}
+
+static void
+default_field_string (struct ui_out *uiout,
+ int fldno,
+ int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string)
+{
+}
+
+static void
+default_field_fmt (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args)
+{
+}
+
+static void
+default_spaces (struct ui_out *uiout, int numspaces)
+{
+}
+
+static void
+default_text (struct ui_out *uiout, const char *string)
+{
+}
+
+static void
+default_message (struct ui_out *uiout, int verbosity,
+ const char *format,
+ va_list args)
+{
+}
+
+static void
+default_wrap_hint (struct ui_out *uiout, char *identstring)
+{
+}
+
+static void
+default_flush (struct ui_out *uiout)
+{
+}
+
+/* Interface to the implementation functions */
+
+void
+uo_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows,
+ const char *tblid)
+{
+ if (!uiout->impl->table_begin)
+ return;
+ uiout->impl->table_begin (uiout, nbrofcols, nr_rows, tblid);
+}
+
+void
+uo_table_body (struct ui_out *uiout)
+{
+ if (!uiout->impl->table_body)
+ return;
+ uiout->impl->table_body (uiout);
+}
+
+void
+uo_table_end (struct ui_out *uiout)
+{
+ if (!uiout->impl->table_end)
+ return;
+ uiout->impl->table_end (uiout);
+}
+
+void
+uo_table_header (struct ui_out *uiout, int width, enum ui_align align,
+ const char *col_name,
+ const char *colhdr)
+{
+ if (!uiout->impl->table_header)
+ return;
+ uiout->impl->table_header (uiout, width, align, col_name, colhdr);
+}
+
+void
+uo_begin (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level,
+ const char *id)
+{
+ if (uiout->impl->begin == NULL)
+ return;
+ uiout->impl->begin (uiout, type, level, id);
+}
+
+void
+uo_end (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level)
+{
+ if (uiout->impl->end == NULL)
+ return;
+ uiout->impl->end (uiout, type, level);
+}
+
+void
+uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align,
+ const char *fldname,
+ int value)
+{
+ if (!uiout->impl->field_int)
+ return;
+ uiout->impl->field_int (uiout, fldno, width, align, fldname, value);
+}
+
+void
+uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align,
+ const char *fldname)
+{
+ if (!uiout->impl->field_skip)
+ return;
+ uiout->impl->field_skip (uiout, fldno, width, align, fldname);
+}
+
+void
+uo_field_string (struct ui_out *uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string)
+{
+ if (!uiout->impl->field_string)
+ return;
+ uiout->impl->field_string (uiout, fldno, width, align, fldname, string);
+}
+
+void
+uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args)
+{
+ if (!uiout->impl->field_fmt)
+ return;
+ uiout->impl->field_fmt (uiout, fldno, width, align, fldname, format, args);
+}
+
+void
+uo_spaces (struct ui_out *uiout, int numspaces)
+{
+ if (!uiout->impl->spaces)
+ return;
+ uiout->impl->spaces (uiout, numspaces);
+}
+
+void
+uo_text (struct ui_out *uiout,
+ const char *string)
+{
+ if (!uiout->impl->text)
+ return;
+ uiout->impl->text (uiout, string);
+}
+
+void
+uo_message (struct ui_out *uiout, int verbosity,
+ const char *format,
+ va_list args)
+{
+ if (!uiout->impl->message)
+ return;
+ uiout->impl->message (uiout, verbosity, format, args);
+}
+
+void
+uo_wrap_hint (struct ui_out *uiout, char *identstring)
+{
+ if (!uiout->impl->wrap_hint)
+ return;
+ uiout->impl->wrap_hint (uiout, identstring);
+}
+
+void
+uo_flush (struct ui_out *uiout)
+{
+ if (!uiout->impl->flush)
+ return;
+ uiout->impl->flush (uiout);
+}
+
+/* local functions */
+
+/* list of column headers manipulation routines */
+
+static void
+clear_header_list (struct ui_out *uiout)
+{
+ while (uiout->table.header_first != NULL)
+ {
+ uiout->table.header_next = uiout->table.header_first;
+ uiout->table.header_first = uiout->table.header_first->next;
+ if (uiout->table.header_next->colhdr != NULL)
+ xfree (uiout->table.header_next->colhdr);
+ xfree (uiout->table.header_next);
+ }
+ gdb_assert (uiout->table.header_first == NULL);
+ uiout->table.header_last = NULL;
+ uiout->table.header_next = NULL;
+}
+
+static void
+append_header_to_list (struct ui_out *uiout,
+ int width,
+ int alignment,
+ const char *col_name,
+ const char *colhdr)
+{
+ struct ui_out_hdr *temphdr;
+
+ temphdr = XMALLOC (struct ui_out_hdr);
+ temphdr->width = width;
+ temphdr->alignment = alignment;
+ /* we have to copy the column title as the original may be an automatic */
+ if (colhdr != NULL)
+ temphdr->colhdr = xstrdup (colhdr);
+ else
+ temphdr->colhdr = NULL;
+ if (col_name != NULL)
+ temphdr->col_name = xstrdup (colhdr);
+ else
+ temphdr->col_name = xstrdup (colhdr);
+ temphdr->next = NULL;
+ if (uiout->table.header_first == NULL)
+ {
+ temphdr->colno = 1;
+ uiout->table.header_first = temphdr;
+ uiout->table.header_last = temphdr;
+ }
+ else
+ {
+ temphdr->colno = uiout->table.header_last->colno + 1;
+ uiout->table.header_last->next = temphdr;
+ uiout->table.header_last = temphdr;
+ }
+ uiout->table.header_next = uiout->table.header_last;
+}
+
+/* Extract the format information for the NEXT header and and advance
+ the header pointer. Return 0 if there was no next header. */
+
+static int
+get_next_header (struct ui_out *uiout,
+ int *colno,
+ int *width,
+ int *alignment,
+ char **colhdr)
+{
+ /* There may be no headers at all or we may have used all columns. */
+ if (uiout->table.header_next == NULL)
+ return 0;
+ *colno = uiout->table.header_next->colno;
+ *width = uiout->table.header_next->width;
+ *alignment = uiout->table.header_next->alignment;
+ *colhdr = uiout->table.header_next->colhdr;
+ /* Advance the header pointer to the next entry. */
+ uiout->table.header_next = uiout->table.header_next->next;
+ return 1;
+}
+
+
+/* Verify that the field/tuple/list is correctly positioned. Return
+ the field number and corresponding alignment (if
+ available/applicable). */
+
+static void
+verify_field (struct ui_out *uiout, int *fldno, int *width, int *align)
+{
+ struct ui_out_level *current = current_level (uiout);
+ char *text;
+
+ if (uiout->table.flag)
+ {
+ if (!uiout->table.body_flag)
+ internal_error (__FILE__, __LINE__,
+ "table_body missing; table fields must be \
+specified after table_body and inside a list.");
+ /* NOTE: cagney/2001-12-08: There was a check here to ensure
+ that this code was only executed when uiout->level was
+ greater than zero. That no longer applies - this code is run
+ before each table row tuple is started and at that point the
+ level is zero. */
+ }
+
+ current->field_count += 1;
+
+ if (uiout->table.body_flag
+ && uiout->table.entry_level == uiout->level
+ && get_next_header (uiout, fldno, width, align, &text))
+ {
+ if (*fldno != current->field_count)
+ internal_error (__FILE__, __LINE__,
+ "ui-out internal error in handling headers.");
+ }
+ else
+ {
+ *width = 0;
+ *align = ui_noalign;
+ *fldno = current->field_count;
+ }
+}
+
+
+/* access to ui_out format private members */
+
+void
+ui_out_get_field_separator (struct ui_out *uiout)
+{
+}
+
+/* Access to ui-out members data */
+
+struct ui_out_data *
+ui_out_data (struct ui_out *uiout)
+{
+ return uiout->data;
+}
+
+/* initalize private members at startup */
+
+struct ui_out *
+ui_out_new (struct ui_out_impl *impl,
+ struct ui_out_data *data,
+ int flags)
+{
+ struct ui_out *uiout = XMALLOC (struct ui_out);
+ uiout->data = data;
+ uiout->impl = impl;
+ uiout->flags = flags;
+ uiout->table.flag = 0;
+ uiout->table.body_flag = 0;
+ uiout->level = 0;
+ memset (uiout->levels, 0, sizeof (uiout->levels));
+ uiout->table.header_first = NULL;
+ uiout->table.header_last = NULL;
+ uiout->table.header_next = NULL;
+ return uiout;
+}
+
+/* standard gdb initialization hook */
+
+void
+_initialize_ui_out (void)
+{
+ /* nothing needs to be done */
+}
diff --git a/contrib/gdb/gdb/ui-out.h b/contrib/gdb/gdb/ui-out.h
new file mode 100644
index 0000000..797c2fe
--- /dev/null
+++ b/contrib/gdb/gdb/ui-out.h
@@ -0,0 +1,275 @@
+/* Output generating routines for GDB.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+ Written by Fernando Nasser 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. */
+
+#ifndef UI_OUT_H
+#define UI_OUT_H 1
+
+/* The ui_out structure */
+
+struct ui_out;
+struct ui_out_data;
+
+
+/* the current ui_out */
+
+/* FIXME: This should not be a global but something passed down from main.c
+ or top.c */
+extern struct ui_out *uiout;
+
+/* alignment enum */
+enum ui_align
+ {
+ ui_left = -1,
+ ui_center,
+ ui_right,
+ ui_noalign
+ };
+
+/* flags enum */
+enum ui_flags
+ {
+ ui_from_tty = 1,
+ ui_source_list = 2
+ };
+
+
+/* The ui_out stream structure. */
+/* NOTE: cagney/2000-02-01: The ui_stream object can be subsumed by
+ the more generic ui_file object. */
+
+struct ui_stream
+ {
+ struct ui_out *uiout;
+ struct ui_file *stream;
+ };
+
+
+/* Prototypes for ui-out API. */
+
+/* A result is a recursive data structure consisting of lists and
+ tuples. */
+
+enum ui_out_type
+ {
+ ui_out_type_tuple,
+ ui_out_type_list
+ };
+
+extern void ui_out_begin (struct ui_out *uiout,
+ enum ui_out_type level_type,
+ const char *id);
+
+extern void ui_out_end (struct ui_out *uiout, enum ui_out_type type);
+
+extern struct cleanup *ui_out_begin_cleanup_end (struct ui_out *uiout,
+ enum ui_out_type level_type,
+ const char *id);
+
+/* A table can be considered a special tuple/list combination with the
+ implied structure: ``table = { hdr = { header, ... } , body = [ {
+ field, ... }, ... ] }''. If NR_ROWS is negative then there is at
+ least one row. */
+
+extern void ui_out_table_begin (struct ui_out *uiout, int nbrofcols,
+ int nr_rows, const char *tblid);
+
+extern void ui_out_table_header (struct ui_out *uiout, int width,
+ enum ui_align align, const char *col_name,
+ const char *colhdr);
+
+extern void ui_out_table_body (struct ui_out *uiout);
+
+extern void ui_out_table_end (struct ui_out *uiout);
+
+/* Compatibility wrappers. */
+
+extern void ui_out_list_begin (struct ui_out *uiout, const char *id);
+
+extern void ui_out_list_end (struct ui_out *uiout);
+
+extern struct cleanup *make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
+ const char *id);
+
+extern void ui_out_tuple_begin (struct ui_out *uiout, const char *id);
+
+extern void ui_out_tuple_end (struct ui_out *uiout);
+
+extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
+ const char *id);
+
+extern void ui_out_field_int (struct ui_out *uiout, const char *fldname,
+ int value);
+
+extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname,
+ CORE_ADDR address);
+
+extern void ui_out_field_string (struct ui_out * uiout, const char *fldname,
+ const char *string);
+
+extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
+ struct ui_stream *buf);
+
+extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
+ const char *format, ...);
+
+extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
+
+extern void ui_out_spaces (struct ui_out *uiout, int numspaces);
+
+extern void ui_out_text (struct ui_out *uiout, const char *string);
+
+extern void ui_out_message (struct ui_out *uiout, int verbosity,
+ const char *format, ...);
+
+extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout);
+
+extern void ui_out_stream_delete (struct ui_stream *buf);
+
+struct cleanup *make_cleanup_ui_out_stream_delete (struct ui_stream *buf);
+
+extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
+
+extern void ui_out_flush (struct ui_out *uiout);
+
+extern void ui_out_get_field_separator (struct ui_out *uiout);
+
+extern int ui_out_set_flags (struct ui_out *uiout, int mask);
+
+extern int ui_out_clear_flags (struct ui_out *uiout, int mask);
+
+extern int ui_out_get_verblvl (struct ui_out *uiout);
+
+extern int ui_out_test_flags (struct ui_out *uiout, int mask);
+
+#if 0
+extern void ui_out_result_begin (struct ui_out *uiout, char *class);
+
+extern void ui_out_result_end (struct ui_out *uiout);
+
+extern void ui_out_info_begin (struct ui_out *uiout, char *class);
+
+extern void ui_out_info_end (struct ui_out *uiout);
+
+extern void ui_out_notify_begin (struct ui_out *uiout, char *class);
+
+extern void ui_out_notify_end (struct ui_out *uiout);
+
+extern void ui_out_error_begin (struct ui_out *uiout, char *class);
+
+extern void ui_out_error_end (struct ui_out *uiout);
+#endif
+
+#if 0
+extern void gdb_error (struct ui_out *uiout, int severity, char *format, ...);
+
+extern void gdb_query (struct ui_out *uiout, int qflags, char *qprompt);
+#endif
+
+/* HACK: Code in GDB is currently checking to see the type of ui_out
+ builder when determining which output to produce. This function is
+ a hack to encapsulate that test. Once GDB manages to separate the
+ CLI/MI from the core of GDB the problem should just go away .... */
+
+extern int ui_out_is_mi_like_p (struct ui_out *uiout);
+
+/* From here on we have things that are only needed by implementation
+ routines and main.c. We should pehaps have a separate file for that,
+ like a ui-out-impl.h file */
+
+/* User Interface Output Implementation Function Table */
+
+/* Type definition of all implementation functions. */
+
+typedef void (table_begin_ftype) (struct ui_out * uiout,
+ int nbrofcols, int nr_rows,
+ const char *tblid);
+typedef void (table_body_ftype) (struct ui_out * uiout);
+typedef void (table_end_ftype) (struct ui_out * uiout);
+typedef void (table_header_ftype) (struct ui_out * uiout, int width,
+ enum ui_align align, const char *col_name,
+ const char *colhdr);
+/* Note: level 0 is the top-level so LEVEL is always greater than
+ zero. */
+typedef void (ui_out_begin_ftype) (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level, const char *id);
+typedef void (ui_out_end_ftype) (struct ui_out *uiout,
+ enum ui_out_type type,
+ int level);
+typedef void (field_int_ftype) (struct ui_out * uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname, int value);
+typedef void (field_skip_ftype) (struct ui_out * uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname);
+typedef void (field_string_ftype) (struct ui_out * uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *string);
+typedef void (field_fmt_ftype) (struct ui_out * uiout, int fldno, int width,
+ enum ui_align align,
+ const char *fldname,
+ const char *format,
+ va_list args);
+typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces);
+typedef void (text_ftype) (struct ui_out * uiout,
+ const char *string);
+typedef void (message_ftype) (struct ui_out * uiout, int verbosity,
+ const char *format, va_list args);
+typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring);
+typedef void (flush_ftype) (struct ui_out * uiout);
+
+/* ui-out-impl */
+
+/* IMPORTANT: If you change this structure, make sure to change the default
+ initialization in ui-out.c */
+
+struct ui_out_impl
+ {
+ table_begin_ftype *table_begin;
+ table_body_ftype *table_body;
+ table_end_ftype *table_end;
+ table_header_ftype *table_header;
+ ui_out_begin_ftype *begin;
+ ui_out_end_ftype *end;
+ field_int_ftype *field_int;
+ field_skip_ftype *field_skip;
+ field_string_ftype *field_string;
+ field_fmt_ftype *field_fmt;
+ spaces_ftype *spaces;
+ text_ftype *text;
+ message_ftype *message;
+ wrap_hint_ftype *wrap_hint;
+ flush_ftype *flush;
+ int is_mi_like_p;
+ };
+
+extern struct ui_out_data *ui_out_data (struct ui_out *uiout);
+
+
+/* Create a ui_out object */
+
+extern struct ui_out *ui_out_new (struct ui_out_impl *impl,
+ struct ui_out_data *data,
+ int flags);
+
+#endif /* UI_OUT_H */
diff --git a/contrib/gdb/gdb/uw-thread.c b/contrib/gdb/gdb/uw-thread.c
new file mode 100755
index 0000000..617cfbd
--- /dev/null
+++ b/contrib/gdb/gdb/uw-thread.c
@@ -0,0 +1,1059 @@
+/* Low level interface for debugging UnixWare user-mode threads for
+ GDB, the GNU debugger.
+
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Nick Duffek <nsd@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. */
+
+
+/* Like many systems, UnixWare implements two classes of threads:
+ kernel-mode threads, which are scheduled by the kernel; and
+ user-mode threads, which are scheduled by a library. UnixWare
+ calls these two classes lightweight processes (LWPs) and threads,
+ respectively.
+
+ This module deals with user-mode threads. It calls procfs_ops
+ functions to deal with LWPs and processes and core_ops functions to
+ deal with core files.
+
+ As of this writing, the user-mode thread debugging interface is not
+ documented beyond the comments in <thread.h>. The following
+ description has been gleaned from experience and from information
+ provided by SCO.
+
+ libthread.so, against which all UnixWare user-mode thread programs
+ link, provides a global thread_debug structure named _thr_debug.
+ It has three fields:
+
+ (1) thr_map is a pointer to a pointer to an element of a
+ thread_map ring. A thread_map contains a single thread's id
+ number, state, LWP pointer, recent register state, and other
+ useful information.
+
+ (2) thr_brk is a pointer to a stub function that libthread.so
+ calls when it changes a thread's state, e.g. by creating it,
+ switching it to an LWP, or causing it to exit.
+
+ (3) thr_debug_on controls whether libthread.so calls thr_brk().
+
+ Debuggers are able to track thread activity by setting a private
+ breakpoint on thr_brk() and setting thr_debug_on to 1.
+
+ thr_brk() receives two arguments:
+
+ (1) a pointer to a thread_map describing the thread being
+ changed; and
+
+ (2) an enum thread_change specifying one of the following
+ changes:
+
+ invalid unknown
+ thread_create thread has just been created
+ thread_exit thread has just exited
+ switch_begin thread will be switched to an LWP
+ switch_complete thread has been switched to an LWP
+ cancel_complete thread wasn't switched to an LWP
+ thread_suspend thread has been thr_suspend()ed
+ thread_suspend_pending thread will be thr_suspend()ed
+ thread_continue thread has been thr_continue()d
+
+ The thread_map argument to thr_brk() is NULL under the following
+ circumstances:
+
+ - The main thread is being acted upon. The main thread always
+ has id 1, so its thread_map is easy to find by scanning through
+ _thr_debug.thr_map.
+
+ - A "switch_complete" change is occurring, which means that the
+ thread specified in the most recent "switch_begin" change has
+ moved to an LWP.
+
+ - A "cancel_complete" change is occurring, which means that the
+ thread specified in the most recent "switch_begin" change has
+ not moved to an LWP after all.
+
+ - A spurious "switch_begin" change is occurring after a
+ "thread_exit" change.
+
+ Between switch_begin and switch_complete or cancel_complete, the
+ affected thread's LWP pointer is not reliable. It is possible that
+ other parts of the thread's thread_map are also unreliable during
+ that time. */
+
+
+#include "defs.h"
+#include "gdbthread.h"
+#include "target.h"
+#include "inferior.h"
+#include "regcache.h"
+#include <fcntl.h>
+
+/* <thread.h> includes <sys/priocntl.h>, which requires boolean_t from
+ <sys/types.h>, which doesn't typedef boolean_t with gcc. */
+
+#define boolean_t int
+#include <thread.h>
+#undef boolean_t
+
+#include <synch.h> /* for UnixWare 2.x */
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+/* Whether to emit debugging output. */
+
+#define DEBUG 0
+
+/* Default debugging output file, overridden by envvar UWTHR_DEBUG. */
+
+#define DEBUG_FILE "/dev/tty"
+
+/* #if DEBUG, write string S to the debugging output channel. */
+
+#if !DEBUG
+# define DBG(fmt_and_args)
+# define DBG2(fmt_and_args)
+#else
+# define DBG(fmt_and_args) dbg fmt_and_args
+# define DBG2(fmt_and_args)
+#endif
+
+/* Back end to CALL_BASE() and TRY_BASE(): evaluate CALL, then convert
+ inferior_ptid to a composite thread/process id. */
+
+#define CALL_BASE_1(call) \
+do { \
+ DBG2(("CALL_BASE(" #call ")")); \
+ call; \
+ do_cleanups (infpid_cleanup); \
+} while (0)
+
+/* If inferior_ptid can be converted to a composite lwp/process id, do so,
+ evaluate base_ops function CALL, and then convert inferior_ptid back to a
+ composite thread/process id.
+
+ Otherwise, issue an error message and return nonlocally. */
+
+#define CALL_BASE(call) \
+do { \
+ if (!lwp_infpid ()) \
+ error ("uw-thread: no lwp"); \
+ CALL_BASE_1 (call); \
+} while (0)
+
+/* Like CALL_BASE(), but instead of returning nonlocally on error, set
+ *CALLED to whether the inferior_ptid conversion was successful. */
+
+#define TRY_BASE(call, called) \
+do { \
+ if ((*(called) = lwp_infpid ())) \
+ CALL_BASE_1 (call); \
+} while (0)
+
+/* Information passed by thread_iter() to its callback parameter. */
+
+typedef struct {
+ struct thread_map map;
+ __lwp_desc_t lwp;
+ CORE_ADDR mapp;
+} iter_t;
+
+/* Private thread data for the thread_info struct. */
+
+struct private_thread_info {
+ int stable; /* 0 if libthread.so is modifying thread map */
+ int thrid; /* thread id assigned by libthread.so */
+ int lwpid; /* thread's lwp if .stable, 0 means no lwp */
+ CORE_ADDR mapp; /* address of thread's map structure */
+};
+
+
+/* procfs.c's target-specific operations. */
+extern struct target_ops procfs_ops;
+
+/* Flag to prevent procfs.c from starting inferior processes. */
+extern int procfs_suppress_run;
+
+/* This module's target-specific operations. */
+static struct target_ops uw_thread_ops;
+
+/* Copy of the target over which uw_thread_ops is pushed. This is
+ more convenient than a pointer to procfs_ops or core_ops, because
+ they lack current_target's default callbacks. */
+static struct target_ops base_ops;
+
+/* Saved pointer to previous owner of target_new_objfile_hook. */
+static void (*target_new_objfile_chain)(struct objfile *);
+
+/* Whether we are debugging a user-space thread program. This isn't
+ set until after libthread.so is loaded by the program being
+ debugged.
+
+ Except for module one-time intialization and where otherwise
+ documented, no functions in this module get called when
+ !uw_thread_active. */
+static int uw_thread_active;
+
+/* For efficiency, cache the addresses of libthread.so's _thr_debug
+ structure, its thr_brk stub function, and the main thread's map. */
+static CORE_ADDR thr_debug_addr;
+static CORE_ADDR thr_brk_addr;
+static CORE_ADDR thr_map_main;
+
+/* Remember the thread most recently marked as switching. Necessary because
+ libthread.so passes null map when calling stub with tc_*_complete. */
+static struct thread_info *switchto_thread;
+
+/* Cleanup chain for safely restoring inferior_ptid after CALL_BASE. */
+static struct cleanup *infpid_cleanup;
+
+
+#if DEBUG
+/* Helper function for DBG() macro: if printf-style FMT is non-null, format it
+ with args and display the result on the debugging output channel. */
+
+static void
+dbg (char *fmt, ...)
+{
+ static int fd = -1, len;
+ va_list args;
+ char buf[1024];
+ char *path;
+
+ if (!fmt)
+ return;
+
+ if (fd < 0)
+ {
+ path = getenv ("UWTHR_DEBUG");
+ if (!path)
+ path = DEBUG_FILE;
+ if ((fd = open (path, O_WRONLY | O_CREAT | O_TRUNC, 0664)) < 0)
+ error ("can't open %s\n", path);
+ }
+
+ va_start (args, fmt);
+ vsprintf (buf, fmt, args);
+ va_end (args);
+
+ len = strlen (buf);
+ buf[len] = '\n';
+ (void)write (fd, buf, len + 1);
+}
+
+#if 0
+/* Return a string representing composite PID's components. */
+
+static char *
+dbgpid (ptid_t ptid)
+{
+ static char *buf, buf1[80], buf2[80];
+ if (!buf || buf == buf2)
+ buf = buf1;
+ else
+ buf = buf2;
+
+ if (PIDGET (ptid) <= 0)
+ sprintf (buf, "%d", PIDGET (ptid));
+ else
+ sprintf (buf, "%s %ld/%d", ISTID (pid) ? "thr" : "lwp",
+ TIDGET (pid), PIDGET (pid));
+
+ return buf;
+}
+
+/* Return a string representing thread state CHANGE. */
+
+static char *
+dbgchange (enum thread_change change)
+{
+ switch (change) {
+ case tc_invalid: return "invalid";
+ case tc_thread_create: return "thread_create";
+ case tc_thread_exit: return "thread_exit";
+ case tc_switch_begin: return "switch_begin";
+ case tc_switch_complete: return "switch_complete";
+ case tc_cancel_complete: return "cancel_complete";
+ case tc_thread_suspend: return "thread_suspend";
+ case tc_thread_suspend_pending: return "thread_suspend_pending";
+ case tc_thread_continue: return "thread_continue";
+ default: return "unknown";
+ }
+}
+
+/* Return a string representing thread STATE. */
+
+static char *
+dbgstate (int state)
+{
+ switch (state) {
+ case TS_ONPROC: return "running";
+ case TS_SLEEP: return "sleeping";
+ case TS_RUNNABLE: return "runnable";
+ case TS_ZOMBIE: return "zombie";
+ case TS_SUSPENDED: return "suspended";
+#ifdef TS_FORK
+ case TS_FORK: return "forking";
+#endif
+ default: return "confused";
+ }
+}
+#endif /* 0 */
+#endif /* DEBUG */
+
+
+/* Read the contents of _thr_debug into *DEBUGP. Return success. */
+
+static int
+read_thr_debug (struct thread_debug *debugp)
+{
+ return base_ops.to_xfer_memory (thr_debug_addr, (char *)debugp,
+ sizeof (*debugp), 0, NULL, &base_ops);
+}
+
+/* Read into MAP the contents of the thread map at inferior process address
+ MAPP. Return success. */
+
+static int
+read_map (CORE_ADDR mapp, struct thread_map *map)
+{
+ return base_ops.to_xfer_memory ((CORE_ADDR)THR_MAP (mapp), (char *)map,
+ sizeof (*map), 0, NULL, &base_ops);
+}
+
+/* Read into LWP the contents of the lwp decriptor at inferior process address
+ LWPP. Return success. */
+
+static int
+read_lwp (CORE_ADDR lwpp, __lwp_desc_t *lwp)
+{
+ return base_ops.to_xfer_memory (lwpp, (char *)lwp,
+ sizeof (*lwp), 0, NULL, &base_ops);
+}
+
+/* Iterate through all user threads, applying FUNC(<map>, <lwp>, DATA) until
+ (a) FUNC returns nonzero,
+ (b) FUNC has been applied to all threads, or
+ (c) an error occurs,
+ where <map> is the thread's struct thread_map and <lwp> if non-null is the
+ thread's current __lwp_desc_t.
+
+ If a call to FUNC returns nonzero, return that value; otherwise, return 0. */
+
+static int
+thread_iter (int (*func)(iter_t *, void *), void *data)
+{
+ struct thread_debug debug;
+ CORE_ADDR first, mapp;
+ iter_t iter;
+ int ret;
+
+ if (!read_thr_debug (&debug))
+ return 0;
+ if (!base_ops.to_xfer_memory ((CORE_ADDR)debug.thr_map, (char *)&mapp,
+ sizeof (mapp), 0, NULL, &base_ops))
+ return 0;
+ if (!mapp)
+ return 0;
+
+ for (first = mapp;;)
+ {
+ if (!read_map (mapp, &iter.map))
+ return 0;
+
+ if (iter.map.thr_lwpp)
+ if (!read_lwp ((CORE_ADDR)iter.map.thr_lwpp, &iter.lwp))
+ return 0;
+
+ iter.mapp = mapp;
+ if ((ret = func (&iter, data)))
+ return ret;
+
+ mapp = (CORE_ADDR)iter.map.thr_next;
+ if (mapp == first)
+ return 0;
+ }
+}
+
+/* Deactivate user-mode thread support. */
+
+static void
+deactivate_uw_thread (void)
+{
+ remove_thread_event_breakpoints ();
+ uw_thread_active = 0;
+ unpush_target (&uw_thread_ops);
+}
+
+/* Return the composite lwp/process id corresponding to composite
+ id PID. If PID is a thread with no lwp, return 0. */
+
+static ptid_t
+thr_to_lwp (ptid_t ptid)
+{
+ struct thread_info *info;
+ ptid_t lid;
+
+ if (!ISTID (ptid))
+ lid = ptid;
+ else if (!(info = find_thread_pid (ptid)))
+ lid = null_ptid;
+ else if (!info->private->lwpid)
+ lid = null_ptid;
+ else
+ lid = MKLID (PIDGET (ptid), info->private->lwpid);
+
+ DBG2((" thr_to_lwp(%s) = %s", dbgpid (pid), dbgpid (lid)));
+ return lid;
+}
+
+/* find_thread_lwp() callback: return whether TP describes a thread
+ associated with lwp id DATA. */
+
+static int
+find_thread_lwp_callback (struct thread_info *tp, void *data)
+{
+ int lwpid = (int)data;
+
+ if (!ISTID (tp->ptid))
+ return 0;
+ if (!tp->private->stable)
+ return 0;
+ if (lwpid != tp->private->lwpid)
+ return 0;
+
+ /* match */
+ return 1;
+}
+
+/* If a thread is associated with lwp id LWPID, return the corresponding
+ member of the global thread list; otherwise, return null. */
+
+static struct thread_info *
+find_thread_lwp (int lwpid)
+{
+ return iterate_over_threads (find_thread_lwp_callback, (void *)lwpid);
+}
+
+/* Return the composite thread/process id corresponding to composite
+ id PID. If PID is an lwp with no thread, return PID. */
+
+static ptid_t
+lwp_to_thr (ptid_t ptid)
+{
+ struct thread_info *info;
+ int lwpid;
+ ptid_t tid = ptid;
+
+ if (ISTID (ptid))
+ goto done;
+ if (!(lwpid = LIDGET (ptid)))
+ goto done;
+ if (!(info = find_thread_lwp (lwpid)))
+ goto done;
+ tid = MKTID (PIDGET (ptid), info->private->thrid);
+
+ done:
+ DBG2((ISTID (tid) ? NULL : "lwp_to_thr: no thr for %s", dbgpid (ptid)));
+ return tid;
+}
+
+/* do_cleanups() callback: convert inferior_ptid to a composite
+ thread/process id after having made a procfs call. */
+
+static void
+thr_infpid (void *unused)
+{
+ ptid_t ptid = lwp_to_thr (inferior_ptid);
+ DBG2((" inferior_ptid from procfs: %s => %s",
+ dbgpid (inferior_ptid), dbgpid (ptid)));
+ inferior_ptid = ptid;
+}
+
+/* If possible, convert inferior_ptid to a composite lwp/process id in
+ preparation for making a procfs call. Return success. */
+
+static int
+lwp_infpid (void)
+{
+ ptid_t ptid = thr_to_lwp (inferior_ptid);
+ DBG2((" inferior_ptid to procfs: %s => %s",
+ dbgpid (inferior_ptid), dbgpid (ptid)));
+
+ if (ptid_equal (ptid, null_ptid))
+ return 0;
+
+ inferior_ptid = ptid;
+ infpid_cleanup = make_cleanup (thr_infpid, NULL);
+ return 1;
+}
+
+/* Add to the global thread list a new user-mode thread with system id THRID,
+ lwp id LWPID, map address MAPP, and composite thread/process PID. */
+
+static void
+add_thread_uw (int thrid, int lwpid, CORE_ADDR mapp, ptid_t ptid)
+{
+ struct thread_info *newthread;
+
+ if ((newthread = add_thread (ptid)) == NULL)
+ error ("failed to create new thread structure");
+
+ newthread->private = xmalloc (sizeof (struct private_thread_info));
+ newthread->private->stable = 1;
+ newthread->private->thrid = thrid;
+ newthread->private->lwpid = lwpid;
+ newthread->private->mapp = mapp;
+
+ if (target_has_execution)
+ printf_unfiltered ("[New %s]\n", target_pid_to_str (ptid));
+}
+
+/* notice_threads() and find_main() callback: if the thread list doesn't
+ already contain the thread described by ITER, add it if it's the main
+ thread or if !DATA. */
+
+static int
+notice_thread (iter_t *iter, void *data)
+{
+ int thrid = iter->map.thr_tid;
+ int lwpid = !iter->map.thr_lwpp ? 0 : iter->lwp.lwp_id;
+ ptid_t ptid = MKTID (PIDGET (inferior_ptid), thrid);
+
+ if (!find_thread_pid (ptid) && (!data || thrid == 1))
+ add_thread_uw (thrid, lwpid, iter->mapp, ptid);
+
+ return 0;
+}
+
+/* Add to the thread list any threads it doesn't already contain. */
+
+static void
+notice_threads (void)
+{
+ thread_iter (notice_thread, NULL);
+}
+
+/* Return the address of the main thread's map. On error, return 0. */
+
+static CORE_ADDR
+find_main (void)
+{
+ if (!thr_map_main)
+ {
+ struct thread_info *info;
+ thread_iter (notice_thread, (void *)1);
+ if ((info = find_thread_pid (MKTID (PIDGET (inferior_ptid), 1))))
+ thr_map_main = info->private->mapp;
+ }
+ return thr_map_main;
+}
+
+/* Attach to process specified by ARGS, then initialize for debugging it
+ and wait for the trace-trap that results from attaching.
+
+ This function only gets called with uw_thread_active == 0. */
+
+static void
+uw_thread_attach (char *args, int from_tty)
+{
+ procfs_ops.to_attach (args, from_tty);
+ if (uw_thread_active)
+ thr_infpid (NULL);
+}
+
+/* Detach from the process attached to by uw_thread_attach(). */
+
+static void
+uw_thread_detach (char *args, int from_tty)
+{
+ deactivate_uw_thread ();
+ base_ops.to_detach (args, from_tty);
+}
+
+/* Tell the inferior process to continue running thread PID if >= 0
+ and all threads otherwise. */
+
+static void
+uw_thread_resume (ptid_t ptid, int step, enum target_signal signo)
+{
+ if (PIDGET (ptid) > 0)
+ {
+ ptid = thr_to_lwp (ptid);
+ if (ptid_equal (ptid, null_ptid))
+ ptid = pid_to_ptid (-1);
+ }
+
+ CALL_BASE (base_ops.to_resume (ptid, step, signo));
+}
+
+/* If the trap we just received from lwp PID was due to a breakpoint
+ on the libthread.so debugging stub, update this module's state
+ accordingly. */
+
+static void
+libthread_stub (ptid_t ptid)
+{
+ CORE_ADDR sp, mapp, mapp_main;
+ enum thread_change change;
+ struct thread_map map;
+ __lwp_desc_t lwp;
+ int lwpid;
+ ptid_t tid = null_ptid;
+ struct thread_info *info;
+
+ /* Check for stub breakpoint. */
+ if (read_pc_pid (ptid) - DECR_PC_AFTER_BREAK != thr_brk_addr)
+ return;
+
+ /* Retrieve stub args. */
+ sp = read_register_pid (SP_REGNUM, ptid);
+ if (!base_ops.to_xfer_memory (sp + SP_ARG0, (char *)&mapp,
+ sizeof (mapp), 0, NULL, &base_ops))
+ goto err;
+ if (!base_ops.to_xfer_memory (sp + SP_ARG0 + sizeof (mapp), (char *)&change,
+ sizeof (change), 0, NULL, &base_ops))
+ goto err;
+
+ /* create_inferior() may not have finished yet, so notice the main
+ thread to ensure that it's displayed first by add_thread(). */
+ mapp_main = find_main ();
+
+ /* Notice thread creation, deletion, or stability change. */
+ switch (change) {
+ case tc_switch_begin:
+ if (!mapp) /* usually means main thread */
+ mapp = mapp_main;
+ /* fall through */
+
+ case tc_thread_create:
+ case tc_thread_exit:
+ if (!mapp)
+ break;
+ if (!read_map (mapp, &map))
+ goto err;
+ tid = MKTID (PIDGET (ptid), map.thr_tid);
+
+ switch (change) {
+ case tc_thread_create: /* new thread */
+ if (!map.thr_lwpp)
+ lwpid = 0;
+ else if (!read_lwp ((CORE_ADDR)map.thr_lwpp, &lwp))
+ goto err;
+ else
+ lwpid = lwp.lwp_id;
+ add_thread_uw (map.thr_tid, lwpid, mapp, tid);
+ break;
+
+ case tc_thread_exit: /* thread has exited */
+ printf_unfiltered ("[Exited %s]\n", target_pid_to_str (tid));
+ delete_thread (tid);
+ if (ptid_equal (tid, inferior_ptid))
+ inferior_ptid = ptid;
+ break;
+
+ case tc_switch_begin: /* lwp is switching threads */
+ if (switchto_thread)
+ goto err;
+ if (!(switchto_thread = find_thread_pid (tid)))
+ goto err;
+ switchto_thread->private->stable = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case tc_switch_complete: /* lwp has switched threads */
+ case tc_cancel_complete: /* lwp didn't switch threads */
+ if (!switchto_thread)
+ goto err;
+
+ if (change == tc_switch_complete)
+ {
+ /* If switchto_thread is the main thread, then (a) the corresponding
+ tc_switch_begin probably received a null map argument and therefore
+ (b) it may have been a spurious switch following a tc_thread_exit.
+
+ Therefore, explicitly query the thread's lwp before caching it in
+ its thread list entry. */
+
+ if (!read_map (switchto_thread->private->mapp, &map))
+ goto err;
+ if (map.thr_lwpp)
+ {
+ if (!read_lwp ((CORE_ADDR)map.thr_lwpp, &lwp))
+ goto err;
+ if ((info = find_thread_lwp (lwp.lwp_id)))
+ info->private->lwpid = 0;
+ switchto_thread->private->lwpid = lwp.lwp_id;
+ }
+ }
+
+ switchto_thread->private->stable = 1;
+ switchto_thread = NULL;
+ break;
+
+ case tc_invalid:
+ case tc_thread_suspend:
+ case tc_thread_suspend_pending:
+ case tc_thread_continue:
+ err:
+ DBG(("unexpected condition in libthread_stub()"));
+ break;
+ }
+
+ DBG2(("libthread_stub(%s): %s %s %s", dbgpid (pid), dbgpid (tid),
+ dbgchange (change), tid ? dbgstate (map.thr_state) : ""));
+}
+
+/* Wait for thread/lwp/process ID if >= 0 or for any thread otherwise. */
+
+static ptid_t
+uw_thread_wait (ptid_t ptid, struct target_waitstatus *status)
+{
+ if (PIDGET (ptid) > 0)
+ ptid = thr_to_lwp (ptid);
+ if (PIDGET (ptid) <= 0)
+ ptid = pid_to_ptid (-1);
+
+ CALL_BASE (ptid = base_ops.to_wait (ptid, status));
+
+ if (status->kind == TARGET_WAITKIND_STOPPED &&
+ status->value.sig == TARGET_SIGNAL_TRAP)
+ libthread_stub (ptid);
+
+ return lwp_to_thr (ptid);
+}
+
+/* Tell gdb about the registers in the thread/lwp/process specified by
+ inferior_ptid. */
+
+static void
+uw_thread_fetch_registers (int regno)
+{
+ int called;
+ struct thread_info *info;
+ struct thread_map map;
+
+ TRY_BASE (base_ops.to_fetch_registers (regno), &called);
+ if (called)
+ return;
+
+ if (!(info = find_thread_pid (inferior_ptid)))
+ return;
+ if (!read_map (info->private->mapp, &map))
+ return;
+
+ supply_gregset (&map.thr_ucontext.uc_mcontext.gregs);
+ supply_fpregset (&map.thr_ucontext.uc_mcontext.fpregs);
+}
+
+/* Store gdb's current view of the register set into the thread/lwp/process
+ specified by inferior_ptid. */
+
+static void
+uw_thread_store_registers (int regno)
+{
+ CALL_BASE (base_ops.to_store_registers (regno));
+}
+
+/* Prepare to modify the registers array. */
+
+static void
+uw_thread_prepare_to_store (void)
+{
+ CALL_BASE (base_ops.to_prepare_to_store ());
+}
+
+/* Fork an inferior process and start debugging it.
+
+ This function only gets called with uw_thread_active == 0. */
+
+static void
+uw_thread_create_inferior (char *exec_file, char *allargs, char **env)
+{
+ if (uw_thread_active)
+ deactivate_uw_thread ();
+
+ procfs_ops.to_create_inferior (exec_file, allargs, env);
+ if (uw_thread_active)
+ {
+ find_main ();
+ thr_infpid (NULL);
+ }
+}
+
+/* Kill and forget about the inferior process. */
+
+static void
+uw_thread_kill (void)
+{
+ base_ops.to_kill ();
+}
+
+/* Clean up after the inferior exits. */
+
+static void
+uw_thread_mourn_inferior (void)
+{
+ deactivate_uw_thread ();
+ base_ops.to_mourn_inferior ();
+}
+
+/* Return whether this module can attach to and run processes.
+
+ This function only gets called with uw_thread_active == 0. */
+
+static int
+uw_thread_can_run (void)
+{
+ return procfs_suppress_run;
+}
+
+/* Return whether thread PID is still valid. */
+
+static int
+uw_thread_alive (ptid_t ptid)
+{
+ if (!ISTID (ptid))
+ return base_ops.to_thread_alive (ptid);
+
+ /* If it's in the thread list, it's valid, because otherwise
+ libthread_stub() would have deleted it. */
+ return in_thread_list (ptid);
+}
+
+/* Add to the thread list any threads and lwps it doesn't already contain. */
+
+static void
+uw_thread_find_new_threads (void)
+{
+ CALL_BASE (if (base_ops.to_find_new_threads)
+ base_ops.to_find_new_threads ());
+ notice_threads ();
+}
+
+/* Return a string for pretty-printing PID in "info threads" output.
+ This may be called by either procfs.c or by generic gdb. */
+
+static char *
+uw_thread_pid_to_str (ptid_t ptid)
+{
+#define FMT "Thread %ld"
+ static char buf[sizeof (FMT) + 3 * sizeof (long)];
+
+ if (!ISTID (ptid))
+ /* core_ops says "process foo", so call procfs_ops explicitly. */
+ return procfs_ops.to_pid_to_str (ptid);
+
+ sprintf (buf, FMT, TIDGET (ptid));
+#undef FMT
+ return buf;
+}
+
+/* Return a string displaying INFO state information in "info threads"
+ output. */
+
+static char *
+uw_extra_thread_info (struct thread_info *info)
+{
+ static char buf[80];
+ struct thread_map map;
+ __lwp_desc_t lwp;
+ int lwpid;
+ char *name;
+
+ if (!ISTID (info->ptid))
+ return NULL;
+
+ if (!info->private->stable)
+ return "switching";
+
+ if (!read_map (info->private->mapp, &map))
+ return NULL;
+
+ if (!map.thr_lwpp || !read_lwp ((CORE_ADDR)map.thr_lwpp, &lwp))
+ lwpid = 0;
+ else
+ lwpid = lwp.lwp_id;
+
+ switch (map.thr_state) {
+ case TS_ONPROC: name = "running"; break;
+ case TS_SLEEP: name = "sleeping"; break;
+ case TS_RUNNABLE: name = "runnable"; break;
+ case TS_ZOMBIE: name = "zombie"; break;
+ case TS_SUSPENDED: name = "suspended"; break;
+#ifdef TS_FORK
+ case TS_FORK: name = "forking"; break;
+#endif
+ default: name = "confused"; break;
+ }
+
+ if (!lwpid)
+ return name;
+
+ sprintf (buf, "%s, LWP %d", name, lwpid);
+ return buf;
+}
+
+/* Check whether libthread.so has just been loaded, and if so, try to
+ initialize user-space thread debugging support.
+
+ libthread.so loading happens while (a) an inferior process is being
+ started by procfs and (b) a core image is being loaded.
+
+ This function often gets called with uw_thread_active == 0. */
+
+static void
+libthread_init (void)
+{
+ struct minimal_symbol *ms;
+ struct thread_debug debug;
+ CORE_ADDR onp;
+ struct breakpoint *b;
+ int one = 1;
+
+ /* Don't initialize twice. */
+ if (uw_thread_active)
+ return;
+
+ /* Check whether libthread.so has been loaded. */
+ if (!(ms = lookup_minimal_symbol ("_thr_debug", NULL, NULL)))
+ return;
+
+ /* Cache _thr_debug's address. */
+ if (!(thr_debug_addr = SYMBOL_VALUE_ADDRESS (ms)))
+ return;
+
+ /* Initialize base_ops.to_xfer_memory(). */
+ base_ops = current_target;
+
+ /* Load _thr_debug's current contents. */
+ if (!read_thr_debug (&debug))
+ return;
+
+ /* User code (e.g. my test programs) may dereference _thr_debug,
+ making it availble to GDB before shared libs are loaded. */
+ if (!debug.thr_map)
+ return;
+
+ /* libthread.so has been loaded, and the current_target should now
+ reflect core_ops or procfs_ops. */
+ push_target (&uw_thread_ops); /* must precede notice_threads() */
+ uw_thread_active = 1;
+
+ if (!target_has_execution)
+
+ /* Locate threads in core file. */
+ notice_threads ();
+
+ else
+ {
+ /* Set a breakpoint on the stub function provided by libthread.so. */
+ thr_brk_addr = (CORE_ADDR)debug.thr_brk;
+ if (!(b = create_thread_event_breakpoint (thr_brk_addr)))
+ goto err;
+
+ /* Activate the stub function. */
+ onp = (CORE_ADDR)&((struct thread_debug *)thr_debug_addr)->thr_debug_on;
+ if (!base_ops.to_xfer_memory ((CORE_ADDR)onp, (char *)&one,
+ sizeof (one), 1, NULL, &base_ops))
+ {
+ delete_breakpoint (b);
+ goto err;
+ }
+
+ /* Prepare for finding the main thread, which doesn't yet exist. */
+ thr_map_main = 0;
+ }
+
+ return;
+
+ err:
+ warning ("uw-thread: unable to initialize user-mode thread debugging\n");
+ deactivate_uw_thread ();
+}
+
+/* target_new_objfile_hook callback.
+
+ If OBJFILE is non-null, check whether libthread.so was just loaded,
+ and if so, prepare for user-mode thread debugging.
+
+ If OBJFILE is null, libthread.so has gone away, so stop debugging
+ user-mode threads.
+
+ This function often gets called with uw_thread_active == 0. */
+
+static void
+uw_thread_new_objfile (struct objfile *objfile)
+{
+ if (objfile)
+ libthread_init ();
+
+ else if (uw_thread_active)
+ deactivate_uw_thread ();
+
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
+}
+
+/* Initialize uw_thread_ops. */
+
+static void
+init_uw_thread_ops (void)
+{
+ uw_thread_ops.to_shortname = "unixware-threads";
+ uw_thread_ops.to_longname = "UnixWare threads and pthread.";
+ uw_thread_ops.to_doc = "UnixWare threads and pthread support.";
+ uw_thread_ops.to_attach = uw_thread_attach;
+ uw_thread_ops.to_detach = uw_thread_detach;
+ uw_thread_ops.to_resume = uw_thread_resume;
+ uw_thread_ops.to_wait = uw_thread_wait;
+ uw_thread_ops.to_fetch_registers = uw_thread_fetch_registers;
+ uw_thread_ops.to_store_registers = uw_thread_store_registers;
+ uw_thread_ops.to_prepare_to_store = uw_thread_prepare_to_store;
+ uw_thread_ops.to_create_inferior = uw_thread_create_inferior;
+ uw_thread_ops.to_kill = uw_thread_kill;
+ uw_thread_ops.to_mourn_inferior = uw_thread_mourn_inferior;
+ uw_thread_ops.to_can_run = uw_thread_can_run;
+ uw_thread_ops.to_thread_alive = uw_thread_alive;
+ uw_thread_ops.to_find_new_threads = uw_thread_find_new_threads;
+ uw_thread_ops.to_pid_to_str = uw_thread_pid_to_str;
+ uw_thread_ops.to_extra_thread_info = uw_extra_thread_info;
+ uw_thread_ops.to_stratum = thread_stratum;
+ uw_thread_ops.to_magic = OPS_MAGIC;
+}
+
+/* Module startup initialization function, automagically called by
+ init.c. */
+
+void
+_initialize_uw_thread (void)
+{
+ init_uw_thread_ops ();
+ add_target (&uw_thread_ops);
+
+ procfs_suppress_run = 1;
+
+ /* Notice when libthread.so gets loaded. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = uw_thread_new_objfile;
+}
diff --git a/contrib/gdb/gdb/valarith.c b/contrib/gdb/gdb/valarith.c
index 0a3aa4d..5852ac6 100644
--- a/contrib/gdb/gdb/valarith.c
+++ b/contrib/gdb/gdb/valarith.c
@@ -1,22 +1,24 @@
/* Perform arithmetic and other operations on values, for GDB.
- Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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"
@@ -25,8 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "expression.h"
#include "target.h"
#include "language.h"
-#include "demangle.h"
#include "gdb_string.h"
+#include "doublest.h"
+#include <math.h>
/* Define whether or not the C operator '/' truncates towards zero for
differently signed operands (truncation direction is undefined in C). */
@@ -35,16 +38,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
#endif
-static value_ptr value_subscripted_rvalue PARAMS ((value_ptr, value_ptr, int));
-
-void _initialize_valarith PARAMS ((void));
+static struct value *value_subscripted_rvalue (struct value *, struct value *, int);
+void _initialize_valarith (void);
-value_ptr
-value_add (arg1, arg2)
- value_ptr arg1, arg2;
+
+struct value *
+value_add (struct value *arg1, struct value *arg2)
{
- register value_ptr valint, valptr;
+ struct value *valint;
+ struct value *valptr;
register int len;
struct type *type1, *type2, *valptrtype;
@@ -60,7 +63,7 @@ value_add (arg1, arg2)
|| TYPE_CODE (type2) == TYPE_CODE_INT))
/* Exactly one argument is a pointer, and one is an integer. */
{
- value_ptr retval;
+ struct value *retval;
if (TYPE_CODE (type1) == TYPE_CODE_PTR)
{
@@ -77,8 +80,8 @@ value_add (arg1, arg2)
len = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (valptrtype)));
if (len == 0)
len = 1; /* For (void *) */
- retval = value_from_longest (valptrtype,
- value_as_long (valptr)
+ retval = value_from_pointer (valptrtype,
+ value_as_address (valptr)
+ (len * value_as_long (valint)));
VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (valptr);
return retval;
@@ -87,9 +90,8 @@ value_add (arg1, arg2)
return value_binop (arg1, arg2, BINOP_ADD);
}
-value_ptr
-value_sub (arg1, arg2)
- value_ptr arg1, arg2;
+struct value *
+value_sub (struct value *arg1, struct value *arg2)
{
struct type *type1, *type2;
COERCE_NUMBER (arg1);
@@ -103,18 +105,18 @@ value_sub (arg1, arg2)
{
/* pointer - integer. */
LONGEST sz = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1)));
- return value_from_longest
- (VALUE_TYPE (arg1),
- value_as_long (arg1) - (sz * value_as_long (arg2)));
+ return value_from_pointer (type1,
+ (value_as_address (arg1)
+ - (sz * value_as_long (arg2))));
}
else if (TYPE_CODE (type2) == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (type1))
- == TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
+ && TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1)))
+ == TYPE_LENGTH (check_typedef (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
@@ -134,11 +136,10 @@ an integer nor a pointer of the same type.");
FIXME: Perhaps we should validate that the index is valid and if
verbosity is set, warn about invalid indices (but still use them). */
-value_ptr
-value_subscript (array, idx)
- value_ptr array, idx;
+struct value *
+value_subscript (struct value *array, struct value *idx)
{
- value_ptr bound;
+ struct value *bound;
int c_style = current_language->c_style_arrays;
struct type *tarray;
@@ -179,7 +180,7 @@ value_subscript (array, idx)
{
struct type *range_type = TYPE_INDEX_TYPE (tarray);
LONGEST index = value_as_long (idx);
- value_ptr v;
+ struct value *v;
int offset, byte, bit_index;
LONGEST lowerbound, upperbound;
get_discrete_bounds (range_type, &lowerbound, &upperbound);
@@ -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);
@@ -211,17 +212,15 @@ value_subscript (array, idx)
(eg, a vector register). This routine used to promote floats
to doubles, but no longer does. */
-static value_ptr
-value_subscripted_rvalue (array, idx, lowerbound)
- value_ptr array, idx;
- int lowerbound;
+static struct value *
+value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound)
{
struct type *array_type = check_typedef (VALUE_TYPE (array));
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
unsigned int elt_size = TYPE_LENGTH (elt_type);
LONGEST index = value_as_long (idx);
unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
- value_ptr v;
+ struct value *v;
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
error ("no such vector element");
@@ -248,9 +247,7 @@ value_subscripted_rvalue (array, idx, lowerbound)
For now, we do not overload the `=' operator. */
int
-binop_user_defined_p (op, arg1, arg2)
- enum exp_opcode op;
- value_ptr arg1, arg2;
+binop_user_defined_p (enum exp_opcode op, struct value *arg1, struct value *arg2)
{
struct type *type1, *type2;
if (op == BINOP_ASSIGN || op == BINOP_CONCAT)
@@ -271,9 +268,8 @@ binop_user_defined_p (op, arg1, arg2)
For now, we do not overload the `&' operator. */
-int unop_user_defined_p (op, arg1)
- enum exp_opcode op;
- value_ptr arg1;
+int
+unop_user_defined_p (enum exp_opcode op, struct value *arg1)
{
struct type *type1;
if (op == UNOP_ADDR)
@@ -299,13 +295,11 @@ int unop_user_defined_p (op, arg1)
is the opcode saying how to modify it. Otherwise, OTHEROP is
unused. */
-value_ptr
-value_x_binop (arg1, arg2, op, otherop, noside)
- value_ptr arg1, arg2;
- enum exp_opcode op, otherop;
- enum noside noside;
+struct value *
+value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
+ enum exp_opcode otherop, enum noside noside)
{
- value_ptr * argvec;
+ struct value **argvec;
char *ptr;
char tstr[13];
int static_memfuncp;
@@ -319,63 +313,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 = (struct value **) alloca (sizeof (struct value *) * 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)
@@ -404,16 +458,13 @@ value_x_binop (arg1, arg2, op, otherop, noside)
and return that value (where '@' is (almost) any unary operator which
is legal for GNU C++). */
-value_ptr
-value_x_unop (arg1, op, noside)
- value_ptr arg1;
- enum exp_opcode op;
- enum noside noside;
+struct value *
+value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
- value_ptr * argvec;
+ struct value **argvec;
char *ptr, *mangle_ptr;
char tstr[13], mangle_tstr[13];
- int static_memfuncp;
+ int static_memfuncp, nargs;
COERCE_REF (arg1);
COERCE_ENUM (arg1);
@@ -422,38 +473,63 @@ 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 = (struct value **) alloca (sizeof (struct value *) * 4);
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;
+ nargs = 1;
+
+ /* 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, "++");
+ argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[3] = 0;
+ nargs ++;
+ break;
+ case UNOP_POSTDECREMENT:
+ strcpy (ptr, "--");
+ argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[3] = 0;
+ nargs ++;
+ 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])
{
if (static_memfuncp)
{
argvec[1] = argvec[0];
+ nargs --;
argvec++;
}
if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -463,39 +539,40 @@ value_x_unop (arg1, op, noside)
= TYPE_TARGET_TYPE (check_typedef (VALUE_TYPE (argvec[0])));
return value_zero (return_type, VALUE_LVAL (arg1));
}
- return call_function_by_hand (argvec[0], 1 - static_memfuncp, argvec + 1);
+ return call_function_by_hand (argvec[0], nargs, argvec + 1);
}
error ("member function %s not found", tstr);
- return 0; /* For lint -- never reached */
+ return 0; /* For lint -- never reached */
}
-
+
/* 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)
- value_ptr arg1, arg2;
+struct value *
+value_concat (struct value *arg1, struct value *arg2)
{
- register value_ptr inval1, inval2, outval;
+ struct value *inval1;
+ struct value *inval2;
+ struct value *outval = NULL;
int inval1len, inval2len;
int count, idx;
char *ptr;
@@ -531,7 +608,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 +645,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 +666,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 +685,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,21 +693,19 @@ value_concat (arg1, arg2)
}
return (outval);
}
-
+
/* Perform a binary operation on two operands which have reasonable
representations as integers or floats. This includes booleans,
characters, integers, or floats.
Does not support addition and subtraction on pointers;
use value_add or value_sub if you want to handle those possibilities. */
-value_ptr
-value_binop (arg1, arg2, op)
- value_ptr arg1, arg2;
- enum exp_opcode op;
+struct value *
+value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
{
- register value_ptr val;
+ struct value *val;
struct type *type1, *type2;
COERCE_REF (arg1);
@@ -658,9 +733,9 @@ 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. */
- DOUBLEST v1, v2, v;
+ in target format. real.c in GCC probably has the necessary
+ code. */
+ DOUBLEST v1, v2, v = 0;
v1 = value_as_double (arg1);
v2 = value_as_double (arg2);
switch (op)
@@ -681,53 +756,66 @@ value_binop (arg1, arg2, op)
v = v1 / v2;
break;
+ case BINOP_EXP:
+ v = pow (v1, v2);
+ if (errno)
+ error ("Cannot perform exponentiation: %s", strerror (errno));
+ break;
+
default:
error ("Integer-only operation on floating point number.");
}
/* 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);
- store_floating (VALUE_CONTENTS_RAW (val), TYPE_LENGTH (VALUE_TYPE (val)),
- v);
+ store_typed_floating (VALUE_CONTENTS_RAW (val), VALUE_TYPE (val), v);
}
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 = 0;
+ 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;
+
+ case BINOP_EQUAL:
+ v = v1 == v2;
+ break;
+
+ case BINOP_NOTEQUAL:
+ 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 +830,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 +843,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;
@@ -777,7 +865,7 @@ value_binop (arg1, arg2, op)
if (unsigned_operation)
{
- ULONGEST v1, v2, v;
+ ULONGEST v1, v2, v = 0;
v1 = (ULONGEST) value_as_long (arg1);
v2 = (ULONGEST) value_as_long (arg2);
@@ -787,34 +875,40 @@ 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_EXP:
+ v = pow (v1, v2);
+ if (errno)
+ error ("Cannot perform exponentiation: %s", strerror (errno));
+ 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 +919,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;
@@ -871,10 +965,14 @@ value_binop (arg1, arg2, op)
v = v1 == v2;
break;
+ case BINOP_NOTEQUAL:
+ v = v1 != v2;
+ break;
+
case BINOP_LESS:
v = v1 < v2;
break;
-
+
default:
error ("Invalid binary operation on numbers.");
}
@@ -898,37 +996,43 @@ value_binop (arg1, arg2, op)
}
else
{
- LONGEST v1, v2, v;
+ LONGEST v1, v2, v = 0;
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_EXP:
+ v = pow (v1, v2);
+ if (errno)
+ error ("Cannot perform exponentiation: %s", strerror (errno));
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 +1043,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 +1052,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 +1096,7 @@ value_binop (arg1, arg2, op)
case BINOP_LESS:
v = v1 < v2;
break;
-
+
default:
error ("Invalid binary operation on numbers.");
}
@@ -1022,8 +1126,7 @@ value_binop (arg1, arg2, op)
/* Simulate the C operator ! -- return 1 if ARG1 contains zero. */
int
-value_logical_not (arg1)
- value_ptr arg1;
+value_logical_not (struct value *arg1)
{
register int len;
register char *p;
@@ -1047,13 +1150,41 @@ value_logical_not (arg1)
return len < 0;
}
+/* Perform a comparison on two string values (whose content are not
+ necessarily null terminated) based on their length */
+
+static int
+value_strcmp (struct value *arg1, struct value *arg2)
+{
+ int len1 = TYPE_LENGTH (VALUE_TYPE (arg1));
+ int len2 = TYPE_LENGTH (VALUE_TYPE (arg2));
+ char *s1 = VALUE_CONTENTS (arg1);
+ char *s2 = VALUE_CONTENTS (arg2);
+ int i, len = len1 < len2 ? len1 : len2;
+
+ for (i = 0; i < len; i++)
+ {
+ if (s1[i] < s2[i])
+ return -1;
+ else if (s1[i] > s2[i])
+ return 1;
+ else
+ continue;
+ }
+
+ if (len1 < len2)
+ return -1;
+ else if (len1 > len2)
+ return 1;
+ else
+ return 0;
+}
+
/* Simulate the C operator == by returning a 1
iff ARG1 and ARG2 have equal contents. */
int
-value_equal (arg1, arg2)
- register value_ptr arg1, arg2;
-
+value_equal (struct value *arg1, struct value *arg2)
{
register int len;
register char *p1, *p2;
@@ -1080,9 +1211,9 @@ value_equal (arg1, arg2)
/* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
is bigger. */
else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
- return value_as_pointer (arg1) == (CORE_ADDR) value_as_long (arg2);
+ return value_as_address (arg1) == (CORE_ADDR) value_as_long (arg2);
else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
- return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
+ return (CORE_ADDR) value_as_long (arg1) == value_as_address (arg2);
else if (code1 == code2
&& ((len = (int) TYPE_LENGTH (type1))
@@ -1097,10 +1228,14 @@ value_equal (arg1, arg2)
}
return len < 0;
}
+ else if (code1 == TYPE_CODE_STRING && code2 == TYPE_CODE_STRING)
+ {
+ return value_strcmp (arg1, arg2) == 0;
+ }
else
{
error ("Invalid type combination in equality test.");
- return 0; /* For lint -- never reached */
+ return 0; /* For lint -- never reached */
}
}
@@ -1108,8 +1243,7 @@ value_equal (arg1, arg2)
iff ARG1's contents are less than ARG2's. */
int
-value_less (arg1, arg2)
- register value_ptr arg1, arg2;
+value_less (struct value *arg1, struct value *arg2)
{
register enum type_code code1;
register enum type_code code2;
@@ -1131,15 +1265,16 @@ value_less (arg1, arg2)
&& (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
return value_as_double (arg1) < value_as_double (arg2);
else if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR)
- return value_as_pointer (arg1) < value_as_pointer (arg2);
+ return value_as_address (arg1) < value_as_address (arg2);
/* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
is bigger. */
else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
- return value_as_pointer (arg1) < (CORE_ADDR) value_as_long (arg2);
+ return value_as_address (arg1) < (CORE_ADDR) value_as_long (arg2);
else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
- return (CORE_ADDR) value_as_long (arg1) < value_as_pointer (arg2);
-
+ return (CORE_ADDR) value_as_long (arg1) < value_as_address (arg2);
+ else if (code1 == TYPE_CODE_STRING && code2 == TYPE_CODE_STRING)
+ return value_strcmp (arg1, arg2) < 0;
else
{
error ("Invalid type combination in ordering comparison.");
@@ -1149,9 +1284,8 @@ value_less (arg1, arg2)
/* The unary operators - and ~. Both free the argument ARG1. */
-value_ptr
-value_neg (arg1)
- register value_ptr arg1;
+struct value *
+value_neg (struct value *arg1)
{
register struct type *type;
register struct type *result_type = VALUE_TYPE (arg1);
@@ -1162,29 +1296,29 @@ 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
-value_complement (arg1)
- register value_ptr arg1;
+struct value *
+value_complement (struct value *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 +1334,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));
}
/* The INDEX'th bit of SET value whose VALUE_TYPE is TYPE,
@@ -1208,10 +1342,7 @@ value_complement (arg1)
Return -1 if out of range, -2 other error. */
int
-value_bit_index (type, valaddr, index)
- struct type *type;
- char *valaddr;
- int index;
+value_bit_index (struct type *type, char *valaddr, int index)
{
LONGEST low_bound, high_bound;
LONGEST word;
@@ -1230,9 +1361,8 @@ value_bit_index (type, valaddr, index)
return (word >> rel_index) & 1;
}
-value_ptr
-value_in (element, set)
- value_ptr element, set;
+struct value *
+value_in (struct value *element, struct value *set)
{
int member;
struct type *settype = check_typedef (VALUE_TYPE (set));
@@ -1254,6 +1384,6 @@ value_in (element, set)
}
void
-_initialize_valarith ()
+_initialize_valarith (void)
{
}
diff --git a/contrib/gdb/gdb/valops.c b/contrib/gdb/gdb/valops.c
index 77d2396..4532da7 100644
--- a/contrib/gdb/gdb/valops.c
+++ b/contrib/gdb/gdb/valops.c
@@ -1,22 +1,24 @@
/* Perform non-arithmetic operations on values, for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,58 +31,47 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "demangle.h"
#include "language.h"
#include "gdbcmd.h"
+#include "regcache.h"
+#include "cp-abi.h"
#include <errno.h>
#include "gdb_string.h"
-/* Default to coercing float to double in function calls only when there is
- no prototype. Otherwise on targets where the debug information is incorrect
- for either the prototype or non-prototype case, we can force it by defining
- COERCE_FLOAT_TO_DOUBLE in the target configuration file. */
-
-#ifndef COERCE_FLOAT_TO_DOUBLE
-#define COERCE_FLOAT_TO_DOUBLE (param_type == NULL)
-#endif
-
/* Flag indicating HP compilers were used; needed to correctly handle some
value operations with HP aCC code/runtime. */
extern int hp_som_som_object_present;
-
+extern int overload_debug;
/* Local functions. */
-static int typecmp PARAMS ((int staticp, struct type *t1[], value_ptr t2[]));
-
-#ifdef CALL_DUMMY
-static CORE_ADDR find_function_addr PARAMS ((value_ptr, struct type **));
-static value_ptr value_arg_coerce PARAMS ((value_ptr, struct type *, int));
-#endif
+static int typecmp (int staticp, struct type *t1[], struct value *t2[]);
+static CORE_ADDR find_function_addr (struct value *, struct type **);
+static struct value *value_arg_coerce (struct value *, struct type *, int);
-#ifndef PUSH_ARGUMENTS
-static CORE_ADDR value_push PARAMS ((CORE_ADDR, value_ptr));
-#endif
-static value_ptr search_struct_field PARAMS ((char *, value_ptr, int,
- struct type *, int));
+static CORE_ADDR value_push (CORE_ADDR, struct value *);
-static value_ptr search_struct_field_aux PARAMS ((char *, value_ptr, int,
- struct type *, int, int *, char *,
- struct type **));
+static struct value *search_struct_field (char *, struct value *, int,
+ struct type *, int);
-static value_ptr search_struct_method PARAMS ((char *, value_ptr *,
- value_ptr *,
- int, int *, struct type *));
+static struct value *search_struct_method (char *, struct value **,
+ struct value **,
+ int, int *, struct type *);
-static int check_field_in PARAMS ((struct type *, const char *));
+static int check_field_in (struct type *, const char *);
-static CORE_ADDR allocate_space_in_inferior PARAMS ((int));
+static CORE_ADDR allocate_space_in_inferior (int);
-static value_ptr cast_into_complex PARAMS ((struct type *, value_ptr));
+static struct value *cast_into_complex (struct type *, struct value *);
-void _initialize_valops PARAMS ((void));
+static struct fn_field *find_method_list (struct value ** argp, char *method,
+ int offset, int *static_memfuncp,
+ struct type *type, int *num_fns,
+ struct type **basetype,
+ int *boffset);
-#define VALUE_SUBSTRING_START(VAL) VALUE_FRAME(VAL)
+void _initialize_valops (void);
/* Flag for whether we want to abandon failed expression evals by default. */
@@ -90,13 +81,19 @@ static int auto_abandon = 0;
int overload_resolution = 0;
+/* This boolean tells what gdb should do if a signal is received while in
+ a function called from gdb (call dummy). If set, gdb unwinds the stack
+ and restore the context to what as it was before the call.
+ The default is to stop in the frame where the signal was received. */
+int unwind_on_signal_p = 0;
+
+
/* Find the address of function name NAME in the inferior. */
-value_ptr
-find_function_in_inferior (name)
- char *name;
+struct value *
+find_function_in_inferior (char *name)
{
register struct symbol *sym;
sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
@@ -111,22 +108,22 @@ 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;
- LONGEST maddr;
+ CORE_ADDR maddr;
type = lookup_pointer_type (builtin_type_char);
type = lookup_function_type (type);
type = lookup_pointer_type (type);
- maddr = (LONGEST) SYMBOL_VALUE_ADDRESS (msymbol);
- return value_from_longest (type, maddr);
+ maddr = SYMBOL_VALUE_ADDRESS (msymbol);
+ return value_from_pointer (type, maddr);
}
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);
}
}
@@ -135,28 +132,26 @@ find_function_in_inferior (name)
/* Allocate NBYTES of space in the inferior using the inferior's malloc
and return a value that is a pointer to the allocated space. */
-value_ptr
-value_allocate_space_in_inferior (len)
- int len;
+struct value *
+value_allocate_space_in_inferior (int len)
{
- value_ptr blocklen;
- register value_ptr val = find_function_in_inferior ("malloc");
+ struct value *blocklen;
+ struct value *val = find_function_in_inferior ("malloc");
blocklen = value_from_longest (builtin_type_int, (LONGEST) len);
val = call_function_by_hand (val, 1, &blocklen);
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;
}
static CORE_ADDR
-allocate_space_in_inferior (len)
- int len;
+allocate_space_in_inferior (int len)
{
return value_as_long (value_allocate_space_in_inferior (len));
}
@@ -166,10 +161,8 @@ allocate_space_in_inferior (len)
and if ARG2 is an lvalue it can be cast into anything at all. */
/* In C++, casts may change pointer or object representations. */
-value_ptr
-value_cast (type, arg2)
- struct type *type;
- register value_ptr arg2;
+struct value *
+value_cast (struct type *type, struct value *arg2)
{
register enum type_code code1;
register enum type_code code2;
@@ -177,13 +170,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,
@@ -194,7 +187,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);
@@ -203,7 +196,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,
@@ -242,14 +235,14 @@ 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. */
- value_ptr v = search_struct_field (type_name_no_tag (type),
+ type of the target as a superclass. If so, we'll need to
+ offset the object in addition to changing its type. */
+ struct value *v = search_struct_field (type_name_no_tag (type),
arg2, 0, type2, 1);
if (v)
{
@@ -264,32 +257,70 @@ 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 */
- }
- }
- longest = value_as_long (arg2);
- return value_from_longest (type, convert_to_boolean ? (LONGEST) (longest ? 1 : 0) : longest);
+
+ if (hp_som_som_object_present && /* if target compiled by HP aCC */
+ (code2 == TYPE_CODE_PTR))
+ {
+ unsigned int *ptr;
+ struct value *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));
+ /* force evaluation */
+ ptr = (unsigned int *) VALUE_CONTENTS (retvalp);
+ *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 */
+ }
+ }
+
+ /* When we cast pointers to integers, we mustn't use
+ POINTER_TO_ADDRESS to find the address the pointer
+ represents, as value_as_long would. GDB should evaluate
+ expressions just as the compiler would --- and the compiler
+ sees a cast as a simple reinterpretation of the pointer's
+ bits. */
+ if (code2 == TYPE_CODE_PTR)
+ longest = extract_unsigned_integer (VALUE_CONTENTS (arg2),
+ TYPE_LENGTH (type2));
+ else
+ longest = value_as_long (arg2);
+ return value_from_longest (type, convert_to_boolean ?
+ (LONGEST) (longest ? 1 : 0) : longest);
+ }
+ else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT ||
+ code2 == TYPE_CODE_ENUM ||
+ code2 == TYPE_CODE_RANGE))
+ {
+ /* TYPE_LENGTH (type) is the length of a pointer, but we really
+ want the length of an address! -- we are really dealing with
+ addresses (i.e., gdb representations) not pointers (i.e.,
+ target representations) here.
+
+ This allows things like "print *(int *)0x01000234" to work
+ without printing a misleading message -- which would
+ otherwise occur when dealing with a target having two byte
+ pointers and four byte addresses. */
+
+ int addr_bit = TARGET_ADDR_BIT;
+
+ LONGEST longest = value_as_long (arg2);
+ if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
+ {
+ if (longest >= ((LONGEST) 1 << addr_bit)
+ || longest <= -((LONGEST) 1 << addr_bit))
+ warning ("value truncated");
+ }
+ return value_from_longest (type, longest);
}
else if (TYPE_LENGTH (type) == TYPE_LENGTH (type2))
{
@@ -297,15 +328,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;
+ struct value *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),
@@ -319,18 +350,24 @@ 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);
+ struct value *v2 = value_ind (arg2);
VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v)
- + VALUE_OFFSET (v);
+ + VALUE_OFFSET (v);
+
+ /* JYG: adjust the new pointer value and
+ embedded offset. */
+ v2->aligner.contents[0] -= VALUE_EMBEDDED_OFFSET (v);
+ VALUE_EMBEDDED_OFFSET (v2) = 0;
+
v2 = value_addr (v2);
VALUE_TYPE (v2) = type;
return v2;
@@ -340,14 +377,14 @@ 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 */
+ arg2 = value_change_enclosing_type (arg2, type);
+ VALUE_POINTED_TO_OFFSET (arg2) = 0; /* pai: chk_val */
return arg2;
}
else if (chill_varying_type (type))
{
struct type *range1, *range2, *eltype1, *eltype2;
- value_ptr val;
+ struct value *val;
int count1, count2;
LONGEST low_bound, high_bound;
char *valaddr, *valaddr_data;
@@ -359,7 +396,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);
@@ -368,7 +405,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)
@@ -405,12 +442,10 @@ value_cast (type, arg2)
/* Create a value of type TYPE that is zero, and return it. */
-value_ptr
-value_zero (type, lv)
- struct type *type;
- enum lval_type lv;
+struct value *
+value_zero (struct type *type, enum lval_type lv)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
memset (VALUE_CONTENTS (val), 0, TYPE_LENGTH (check_typedef (type)));
VALUE_LVAL (val) = lv;
@@ -418,55 +453,29 @@ value_zero (type, lv)
return val;
}
-/* Return a value with type TYPE located at ADDR.
+/* Return a value with type TYPE located at ADDR.
Call value_at only if the data needs to be fetched immediately;
if we can be 'lazy' and defer the fetch, perhaps indefinately, call
value_at_lazy instead. value_at_lazy simply records the address of
- the data and sets the lazy-evaluation-required flag. The lazy flag
- is tested in the VALUE_CONTENTS macro, which is used if and when
- the contents are actually required.
+ the data and sets the lazy-evaluation-required flag. The lazy flag
+ is tested in the VALUE_CONTENTS macro, which is used if and when
+ the contents are actually required.
Note: value_at does *NOT* handle embedded offsets; perform such
adjustments before or after calling it. */
-value_ptr
-value_at (type, addr, sect)
- struct type *type;
- CORE_ADDR addr;
- asection *sect;
+struct value *
+value_at (struct type *type, CORE_ADDR addr, asection *sect)
{
- register value_ptr val;
+ struct value *val;
if (TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
error ("Attempt to dereference a generic pointer.");
val = allocate_value (type);
-#ifdef GDB_TARGET_IS_D10V
- if (TYPE_CODE (type) == TYPE_CODE_PTR
- && TYPE_TARGET_TYPE (type)
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC))
- {
- /* pointer to function */
- 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);
- }
- else if (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);
- }
- else
-#endif
- read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), TYPE_LENGTH (type), sect);
+ read_memory (addr, VALUE_CONTENTS_ALL_RAW (val), TYPE_LENGTH (type));
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr;
@@ -477,13 +486,10 @@ value_at (type, addr, sect)
/* Return a lazy value with type TYPE located at ADDR (cf. value_at). */
-value_ptr
-value_at_lazy (type, addr, sect)
- struct type *type;
- CORE_ADDR addr;
- asection *sect;
+struct value *
+value_at_lazy (struct type *type, CORE_ADDR addr, asection *sect)
{
- register value_ptr val;
+ struct value *val;
if (TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
error ("Attempt to dereference a generic pointer.");
@@ -498,9 +504,9 @@ value_at_lazy (type, addr, sect)
return val;
}
-/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
- if the current data for a variable needs to be loaded into
- VALUE_CONTENTS(VAL). Fetches the data from the user's process, and
+/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
+ if the current data for a variable needs to be loaded into
+ VALUE_CONTENTS(VAL). Fetches the data from the user's process, and
clears the lazy flag to indicate that the data in the buffer is valid.
If the value is zero-length, we avoid calling read_memory, which would
@@ -511,40 +517,15 @@ value_at_lazy (type, addr, sect)
value is ignored. */
int
-value_fetch_lazy (val)
- register value_ptr val;
+value_fetch_lazy (struct value *val)
{
CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val));
-#ifdef GDB_TARGET_IS_D10V
- struct type *type = VALUE_TYPE(val);
- if (TYPE_CODE (type) == TYPE_CODE_PTR
- && TYPE_TARGET_TYPE (type)
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC))
- {
- /* pointer to function */
- 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);
- }
- else if (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);
- }
- else
-#endif
-
+ struct type *type = VALUE_TYPE (val);
if (length)
- read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), length,
- VALUE_BFD_SECTION (val));
+ read_memory (addr, VALUE_CONTENTS_ALL_RAW (val), length);
+
VALUE_LAZY (val) = 0;
return 0;
}
@@ -553,13 +534,12 @@ value_fetch_lazy (val)
/* Store the contents of FROMVAL into the location of TOVAL.
Return a new value with the location of TOVAL and contents of FROMVAL. */
-value_ptr
-value_assign (toval, fromval)
- register value_ptr toval, fromval;
+struct value *
+value_assign (struct value *toval, struct value *fromval)
{
register struct type *type;
- register value_ptr val;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ struct value *val;
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
int use_buffer = 0;
if (!toval->modifiable)
@@ -579,9 +559,7 @@ value_assign (toval, fromval)
convert FROMVAL's contents now, with result in `raw_buffer',
and set USE_BUFFER to the number of bytes to write. */
-#ifdef REGISTER_CONVERTIBLE
- if (VALUE_REGNO (toval) >= 0
- && REGISTER_CONVERTIBLE (VALUE_REGNO (toval)))
+ if (VALUE_REGNO (toval) >= 0)
{
int regno = VALUE_REGNO (toval);
if (REGISTER_CONVERTIBLE (regno))
@@ -592,14 +570,13 @@ value_assign (toval, fromval)
use_buffer = REGISTER_RAW_SIZE (regno);
}
}
-#endif
switch (VALUE_LVAL (toval))
{
case lval_internalvar:
set_internalvar (VALUE_INTERNALVAR (toval), fromval);
val = value_copy (VALUE_INTERNALVAR (toval)->value);
- VALUE_ENCLOSING_TYPE (val) = VALUE_ENCLOSING_TYPE (fromval);
+ val = value_change_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;
@@ -615,18 +592,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.",
@@ -662,7 +639,8 @@ 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)) - VALUE_OFFSET (toval);
if (len > (int) sizeof (LONGEST))
error ("Can't handle bitfields in registers larger than %d bits.",
@@ -672,38 +650,38 @@ value_assign (toval, fromval)
> len * HOST_CHAR_BIT)
/* Getting this right would involve being very careful about
byte order. */
- 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);
+ error ("Can't assign to bitfields that cross register "
+ "boundaries.");
+
+ 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;
@@ -719,6 +697,7 @@ Can't handle bitfield which doesn't fit in a single register.");
int amount_copied;
/* Make the buffer large enough in all cases. */
+ /* FIXME (alloca): Not safe for very large data types. */
char *buffer = (char *) alloca (amount_to_copy
+ sizeof (LONGEST)
+ MAX_REGISTER_RAW_SIZE);
@@ -744,8 +723,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. */
@@ -770,9 +749,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)
@@ -787,7 +766,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.");
@@ -812,21 +791,19 @@ Can't handle bitfield which doesn't fit in a single register.");
memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval),
TYPE_LENGTH (type));
VALUE_TYPE (val) = type;
- VALUE_ENCLOSING_TYPE (val) = VALUE_ENCLOSING_TYPE (fromval);
+ val = value_change_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;
}
/* Extend a value VAL to COUNT repetitions of its type. */
-value_ptr
-value_repeat (arg1, count)
- value_ptr arg1;
- int count;
+struct value *
+value_repeat (struct value *arg1, int count)
{
- register value_ptr val;
+ struct value *val;
if (VALUE_LVAL (arg1) != lval_memory)
error ("Only values in memory can be extended with '@'.");
@@ -844,12 +821,10 @@ value_repeat (arg1, count)
return val;
}
-value_ptr
-value_of_variable (var, b)
- struct symbol *var;
- struct block *b;
+struct value *
+value_of_variable (struct symbol *var, struct block *b)
{
- value_ptr val;
+ struct value *val;
struct frame_info *frame = NULL;
if (!b)
@@ -858,14 +833,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);
@@ -896,53 +871,50 @@ 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)
- value_ptr arg1;
+struct value *
+value_coerce_array (struct value *arg1)
{
register struct type *type = check_typedef (VALUE_TYPE (arg1));
if (VALUE_LVAL (arg1) != lval_memory)
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)));
+ return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+ (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
}
/* Given a value which is a function, return a value which is a pointer
to it. */
-value_ptr
-value_coerce_function (arg1)
- value_ptr arg1;
+struct value *
+value_coerce_function (struct value *arg1)
{
- value_ptr retval;
+ struct value *retval;
if (VALUE_LVAL (arg1) != lval_memory)
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)));
+ retval = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
+ (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. */
-value_ptr
-value_addr (arg1)
- value_ptr arg1;
+struct value *
+value_addr (struct value *arg1)
{
- value_ptr arg2;
+ struct value *arg2;
struct type *type = check_typedef (VALUE_TYPE (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;
@@ -953,30 +925,28 @@ value_addr (arg1)
if (VALUE_LVAL (arg1) != lval_memory)
error ("Attempt to take address of value not located in memory.");
- /* 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)));
+ /* Get target memory address */
+ arg2 = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
+ (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 ... */
- 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);
+ full derived object's type ... */
+ arg2 = value_change_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);
VALUE_BFD_SECTION (arg2) = VALUE_BFD_SECTION (arg1);
return arg2;
}
/* Given a value of a pointer type, apply the C unary * operator to it. */
-value_ptr
-value_ind (arg1)
- value_ptr arg1;
+struct value *
+value_ind (struct value *arg1)
{
struct type *base_type;
- value_ptr arg2;
- value_ptr real_val;
+ struct value *arg2;
COERCE_ARRAY (arg1);
@@ -997,17 +967,17 @@ 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_address (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;
+ arg2 = value_change_enclosing_type (arg2, enc_type);
VALUE_EMBEDDED_OFFSET (arg2) = VALUE_POINTED_TO_OFFSET (arg1);
/* We may be pointing to an object of some derived type */
@@ -1016,7 +986,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 */
}
/* Pushing small parts of stack frames. */
@@ -1024,12 +994,10 @@ value_ind (arg1)
/* Push one word (the size of object that a register holds). */
CORE_ADDR
-push_word (sp, word)
- CORE_ADDR sp;
- ULONGEST word;
+push_word (CORE_ADDR sp, ULONGEST word)
{
register int len = REGISTER_SIZE;
- char buffer[MAX_REGISTER_RAW_SIZE];
+ char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
store_unsigned_integer (buffer, len, word);
if (INNER_THAN (1, 2))
@@ -1051,10 +1019,7 @@ push_word (sp, word)
/* Push LEN bytes with data at BUFFER. */
CORE_ADDR
-push_bytes (sp, buffer, len)
- CORE_ADDR sp;
- char *buffer;
- int len;
+push_bytes (CORE_ADDR sp, char *buffer, int len)
{
if (INNER_THAN (1, 2))
{
@@ -1072,47 +1037,110 @@ push_bytes (sp, buffer, len)
return sp;
}
-/* Push onto the stack the specified value VALUE. */
+#ifndef PARM_BOUNDARY
+#define PARM_BOUNDARY (0)
+#endif
-#ifndef PUSH_ARGUMENTS
+/* Push onto the stack the specified value VALUE. Pad it correctly for
+ it to be an argument to a function. */
static CORE_ADDR
-value_push (sp, arg)
- register CORE_ADDR sp;
- value_ptr arg;
+value_push (register CORE_ADDR sp, struct value *arg)
{
register int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+ register int container_len = len;
+ register int offset;
+
+ /* How big is the container we're going to put this value in? */
+ if (PARM_BOUNDARY)
+ container_len = ((len + PARM_BOUNDARY / TARGET_CHAR_BIT - 1)
+ & ~(PARM_BOUNDARY / TARGET_CHAR_BIT - 1));
+
+ /* Are we going to put it at the high or low end of the container? */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = container_len - len;
+ else
+ offset = 0;
if (INNER_THAN (1, 2))
{
/* stack grows downward */
- sp -= len;
- write_memory (sp, VALUE_CONTENTS_ALL (arg), len);
+ sp -= container_len;
+ write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
}
else
{
/* stack grows upward */
- write_memory (sp, VALUE_CONTENTS_ALL (arg), len);
- sp += len;
+ write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
+ sp += container_len;
}
return sp;
}
-#endif /* !PUSH_ARGUMENTS */
+CORE_ADDR
+default_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ /* ASSERT ( !struct_return); */
+ int i;
+ for (i = nargs - 1; i >= 0; i--)
+ sp = value_push (sp, args[i]);
+ return sp;
+}
+
+
+/* Functions to use for the COERCE_FLOAT_TO_DOUBLE gdbarch method.
+
+ How you should pass arguments to a function depends on whether it
+ was defined in K&R style or prototype style. If you define a
+ function using the K&R syntax that takes a `float' argument, then
+ callers must pass that argument as a `double'. If you define the
+ function using the prototype syntax, then you must pass the
+ argument as a `float', with no promotion.
+
+ Unfortunately, on certain older platforms, the debug info doesn't
+ indicate reliably how each function was defined. A function type's
+ TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
+ defined in prototype style. When calling a function whose
+ TYPE_FLAG_PROTOTYPED flag is clear, GDB consults the
+ COERCE_FLOAT_TO_DOUBLE gdbarch method to decide what to do.
+
+ For modern targets, it is proper to assume that, if the prototype
+ flag is clear, that can be trusted: `float' arguments should be
+ promoted to `double'. You should register the function
+ `standard_coerce_float_to_double' to get this behavior.
+
+ For some older targets, if the prototype flag is clear, that
+ doesn't tell us anything. So we guess that, if we don't have a
+ type for the formal parameter (i.e., the first argument to
+ COERCE_FLOAT_TO_DOUBLE is null), then we should promote it;
+ otherwise, we should leave it alone. The function
+ `default_coerce_float_to_double' provides this behavior; it is the
+ default value, for compatibility with older configurations. */
+int
+default_coerce_float_to_double (struct type *formal, struct type *actual)
+{
+ return formal == NULL;
+}
+
+
+int
+standard_coerce_float_to_double (struct type *formal, struct type *actual)
+{
+ return 1;
+}
+
-#ifdef CALL_DUMMY
/* Perform the standard coercions that are specified
for arguments to be passed to C functions.
If PARAM_TYPE is non-NULL, it is the expected parameter type.
IS_PROTOTYPED is non-zero if the function declaration is prototyped. */
-static value_ptr
-value_arg_coerce (arg, param_type, is_prototyped)
- value_ptr arg;
- struct type *param_type;
- int is_prototyped;
+static struct value *
+value_arg_coerce (struct value *arg, struct type *param_type,
+ int is_prototyped)
{
register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
register struct type *type
@@ -1121,7 +1149,8 @@ value_arg_coerce (arg, param_type, is_prototyped)
switch (TYPE_CODE (type))
{
case TYPE_CODE_REF:
- if (TYPE_CODE (arg_type) != TYPE_CODE_REF)
+ if (TYPE_CODE (arg_type) != TYPE_CODE_REF
+ && TYPE_CODE (arg_type) != TYPE_CODE_PTR)
{
arg = value_addr (arg);
VALUE_TYPE (arg) = param_type;
@@ -1139,17 +1168,17 @@ 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. */
- if (!is_prototyped && COERCE_FLOAT_TO_DOUBLE)
+ 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 (param_type, arg_type))
{
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
type = builtin_type_double;
@@ -1184,13 +1213,11 @@ value_arg_coerce (arg, param_type, is_prototyped)
return value_cast (type, arg);
}
-/* Determine a function's address and its return type from its value.
+/* Determine a function's address and its return type from its value.
Calls error() if the function is not valid for calling. */
static CORE_ADDR
-find_function_addr (function, retval_type)
- value_ptr function;
- struct type **retval_type;
+find_function_addr (struct value *function, struct type **retval_type)
{
register struct type *ftype = check_typedef (VALUE_TYPE (function));
register enum type_code code = TYPE_CODE (ftype);
@@ -1208,17 +1235,12 @@ find_function_addr (function, retval_type)
}
else if (code == TYPE_CODE_PTR)
{
- funaddr = value_as_pointer (function);
+ funaddr = value_as_address (function);
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
{
-#ifdef CONVERT_FROM_FUNC_PTR_ADDR
- /* FIXME: This is a workaround for the unusual function
- pointer representation on the RS/6000, see comment
- in config/rs6000/tm-rs6000.h */
funaddr = CONVERT_FROM_FUNC_PTR_ADDR (funaddr);
-#endif
value_type = TYPE_TARGET_TYPE (ftype);
}
else
@@ -1227,9 +1249,9 @@ 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));
+ funaddr = value_as_address (value_addr (function));
else
/* Handle integer used as address of a function. */
funaddr = (CORE_ADDR) value_as_long (function);
@@ -1261,46 +1283,53 @@ find_function_addr (function, retval_type)
ARGS is modified to contain coerced values. */
-value_ptr
-call_function_by_hand (function, nargs, args)
- value_ptr function;
- int nargs;
- value_ptr *args;
+static struct value *
+hand_function_call (struct value *function, int nargs, struct value **args)
{
register CORE_ADDR sp;
register int i;
+ int rc;
CORE_ADDR start_sp;
/* CALL_DUMMY is an array of words (REGISTER_SIZE), but each word
is in host byte order. Before calling FIX_CALL_DUMMY, we byteswap it
and remove any extra bytes which might exist because ULONGEST is
- bigger than REGISTER_SIZE.
+ 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).
- static ULONGEST dummy[] = CALL_DUMMY;
- char dummy1[REGISTER_SIZE * sizeof dummy / sizeof (ULONGEST)];
+ NOTE: This is pretty stupid. CALL_DUMMY should be in strict
+ target byte order. */
+
+ static ULONGEST *dummy;
+ int sizeof_dummy1;
+ char *dummy1;
CORE_ADDR old_sp;
struct type *value_type;
unsigned char struct_return;
CORE_ADDR struct_addr = 0;
- struct inferior_status inf_status;
+ 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));
+ int n_method_args = 0;
+
+ dummy = alloca (SIZEOF_CALL_DUMMY_WORDS);
+ sizeof_dummy1 = REGISTER_SIZE * SIZEOF_CALL_DUMMY_WORDS / sizeof (ULONGEST);
+ dummy1 = alloca (sizeof_dummy1);
+ memcpy (dummy, CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS);
if (!target_has_execution)
- noprocess();
+ noprocess ();
- save_inferior_status (&inf_status, 1);
- old_chain = make_cleanup ((make_cleanup_func) restore_inferior_status,
- &inf_status);
+ inf_status = save_inferior_status (1);
+ old_chain = make_cleanup_restore_inferior_status (inf_status);
/* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
(and POP_FRAME for restoring them). (At least on most machines)
@@ -1312,14 +1341,14 @@ call_function_by_hand (function, nargs, args)
if (INNER_THAN (1, 2))
{
/* Stack grows down */
- sp -= sizeof dummy1;
+ sp -= sizeof_dummy1;
start_sp = sp;
}
else
{
/* Stack grows up */
start_sp = sp;
- sp += sizeof dummy1;
+ sp += sizeof_dummy1;
}
funaddr = find_function_addr (function, &value_type);
@@ -1339,10 +1368,10 @@ call_function_by_hand (function, nargs, args)
/* Create a call sequence customized for this function
and the number of arguments for it. */
- for (i = 0; i < (int) (sizeof (dummy) / sizeof (dummy[0])); i++)
+ 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,
@@ -1353,164 +1382,175 @@ call_function_by_hand (function, nargs, args)
real_pc = start_sp;
#endif
-#if CALL_DUMMY_LOCATION == ON_STACK
- write_memory (start_sp, (char *)dummy1, sizeof dummy1);
-#endif /* On stack. */
+ if (CALL_DUMMY_LOCATION == ON_STACK)
+ {
+ write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
+ }
-#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
- /* Convex Unix prohibits executing in the stack segment. */
- /* Hope there is empty room at the top of the text segment. */
- {
- extern CORE_ADDR text_end;
- static checked = 0;
- if (!checked)
- for (start_sp = text_end - sizeof dummy1; start_sp < text_end; ++start_sp)
- if (read_memory_integer (start_sp, 1) != 0)
- error ("text segment full -- no place to put call");
- checked = 1;
- sp = old_sp;
- real_pc = text_end - sizeof dummy1;
- write_memory (real_pc, (char *)dummy1, sizeof dummy1);
- }
-#endif /* Before text_end. */
+ if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END)
+ {
+ /* Convex Unix prohibits executing in the stack segment. */
+ /* Hope there is empty room at the top of the text segment. */
+ extern CORE_ADDR text_end;
+ static int checked = 0;
+ if (!checked)
+ for (start_sp = text_end - sizeof_dummy1; start_sp < text_end; ++start_sp)
+ if (read_memory_integer (start_sp, 1) != 0)
+ error ("text segment full -- no place to put call");
+ checked = 1;
+ sp = old_sp;
+ real_pc = text_end - 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);
- if (errcode != 0)
- error ("Cannot write text segment -- call_function failed");
- }
-#endif /* After text_end. */
+ 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);
+ if (errcode != 0)
+ error ("Cannot write text segment -- call_function failed");
+ }
-#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
- real_pc = funaddr;
-#endif /* At entry point. */
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ {
+ real_pc = funaddr;
+ }
#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))
+ if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
+ {
+ i = 0;
+ while (TYPE_CODE (TYPE_ARG_TYPES (ftype)[i]) != TYPE_CODE_VOID)
+ i++;
+ n_method_args = i;
+ if (nargs < i)
+ error ("too few arguments in method call");
+ }
+ else if (nargs < TYPE_NFIELDS (ftype))
error ("too few arguments in function call");
for (i = nargs - 1; i >= 0; i--)
{
+ /* Assume that methods are always prototyped, unless they are off the
+ end (which we should only be allowing if there is a ``...'').
+ FIXME. */
+ if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
+ {
+ if (i < n_method_args)
+ args[i] = value_arg_coerce (args[i], TYPE_ARG_TYPES (ftype)[i], 1);
+ else
+ args[i] = value_arg_coerce (args[i], NULL, 0);
+ }
+
/* 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);
-
- args[i] = value_arg_coerce (args[i], param_type, is_prototyped);
+ args[i] = value_arg_coerce (args[i], param_type, TYPE_PROTOTYPED (ftype));
}
- /*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. */
+ /*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. */
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*/
+ /* 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 */
/* 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)
- {
- /* This is a machine like the sparc, where we may need to pass a pointer
- to the structure, not the structure itself. */
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *arg_type = check_typedef (VALUE_TYPE (args[i]));
- if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
- || TYPE_CODE (arg_type) == TYPE_CODE_UNION
- || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY
- || TYPE_CODE (arg_type) == TYPE_CODE_STRING
- || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING
- || 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))
- {
- 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);
+ if (REG_STRUCT_HAS_ADDR_P ())
+ {
+ /* This is a machine like the sparc, where we may need to pass a
+ pointer to the structure, not the structure itself. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *arg_type = check_typedef (VALUE_TYPE (args[i]));
+ if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (arg_type) == TYPE_CODE_UNION
+ || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (arg_type) == TYPE_CODE_STRING
+ || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING
+ || 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))
+ {
+ 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);
+
+ if (STACK_ALIGN_P ())
+ /* 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;
+ if (INNER_THAN (1, 2))
+ {
+ /* stack grows downward */
+ sp -= aligned_len;
+ /* ... so the address of the thing we push is the
+ stack pointer after we push it. */
+ addr = sp;
+ }
+ else
+ {
+ /* The stack grows up, so the address of the thing
+ we push is the stack pointer before we push it. */
+ addr = sp;
+ sp += aligned_len;
+ }
+ /* Push the structure. */
+ write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len);
+ /* 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_pointer (lookup_pointer_type (arg_type),
+ addr);
+ }
+ }
+ }
-#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. */
- aligned_len = STACK_ALIGN (len);
-#else
- aligned_len = len;
-#endif
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= aligned_len;
- }
- else
- {
- /* The stack grows up, so the address of the thing we push
- is the stack pointer before we push it. */
- addr = sp;
- }
- /* Push the structure. */
- write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
- if (INNER_THAN (1, 2))
- {
- /* The stack grows down, so the address of the thing we push
- is the stack pointer after we push it. */
- addr = sp;
- }
- else
- {
- /* stack grows upward */
- sp += aligned_len;
- }
- /* 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);
- }
- }
- }
-#endif /* REG_STRUCT_HAS_ADDR. */
/* Reserve space for the return structure to be written on the
stack, if necessary */
@@ -1518,12 +1558,11 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
if (struct_return)
{
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. */
- len = STACK_ALIGN (len);
-#endif
+ if (STACK_ALIGN_P ())
+ /* 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);
if (INNER_THAN (1, 2))
{
/* stack grows downward */
@@ -1538,75 +1577,63 @@ 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*/
-#ifndef NO_EXTRA_ALIGNMENT_NEEDED
-
-#if defined(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. */
- if (INNER_THAN (1, 2))
+ /* 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 */
+ if (EXTRA_STACK_ALIGNMENT_NEEDED)
{
- /* If stack grows down, we must leave a hole at the top. */
- int len = 0;
-
- for (i = nargs - 1; i >= 0; i--)
- len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
-#ifdef CALL_DUMMY_STACK_ADJUST
- len += CALL_DUMMY_STACK_ADJUST;
-#endif
- sp -= STACK_ALIGN (len) - len;
+ /* 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. */
+ if (STACK_ALIGN_P () && INNER_THAN (1, 2))
+ {
+ /* If stack grows down, we must leave a hole at the top. */
+ int len = 0;
+
+ for (i = nargs - 1; i >= 0; i--)
+ len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
+ if (CALL_DUMMY_STACK_ADJUST_P)
+ len += CALL_DUMMY_STACK_ADJUST;
+ sp -= STACK_ALIGN (len) - len;
+ }
}
-#endif /* STACK_ALIGN */
-#endif /* NO_EXTRA_ALIGNMENT_NEEDED */
-#ifdef PUSH_ARGUMENTS
- PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr);
-#else /* !PUSH_ARGUMENTS */
- for (i = nargs - 1; i >= 0; i--)
- sp = value_push (sp, args[i]);
-#endif /* !PUSH_ARGUMENTS */
-
-#ifdef PUSH_RETURN_ADDRESS /* for targets that use no CALL_DUMMY */
- /* There are a number of targets now which actually don't write any
- CALL_DUMMY instructions into the target, but instead just save the
- machine state, push the arguments, and jump directly to the callee
- function. Since this doesn't actually involve executing a JSR/BSR
- instruction, the return address must be set up by hand, either by
- pushing onto the stack or copying into a return-address register
- 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 */
-
-#if defined(STACK_ALIGN)
- if (! INNER_THAN (1, 2))
+ sp = PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr);
+
+ if (PUSH_RETURN_ADDRESS_P ())
+ /* for targets that use no CALL_DUMMY */
+ /* There are a number of targets now which actually don't write
+ any CALL_DUMMY instructions into the target, but instead just
+ save the machine state, push the arguments, and jump directly
+ to the callee function. Since this doesn't actually involve
+ executing a JSR/BSR instruction, the return address must be set
+ up by hand, either by pushing onto the stack or copying into a
+ return-address register 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);
+
+ if (STACK_ALIGN_P () && !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! */
-#ifdef CALL_DUMMY_STACK_ADJUST
- sp += CALL_DUMMY_STACK_ADJUST;
-#endif
+ that sp already has been advanced for the arguments! */
+ if (CALL_DUMMY_STACK_ADJUST_P)
+ sp += CALL_DUMMY_STACK_ADJUST;
sp = STACK_ALIGN (sp);
}
-#endif /* STACK_ALIGN */
/* XXX This seems wrong. For stacks that grow down we shouldn't do
anything here! */
/* 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. */
-#ifdef CALL_DUMMY_STACK_ADJUST
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= CALL_DUMMY_STACK_ADJUST;
- }
-#endif /* CALL_DUMMY_STACK_ADJUST */
+ if (CALL_DUMMY_STACK_ADJUST_P)
+ if (INNER_THAN (1, 2))
+ {
+ /* stack grows downward */
+ sp -= CALL_DUMMY_STACK_ADJUST;
+ }
/* Store the address at which the structure is supposed to be
written. Note that this (and the code which reserved the space
@@ -1614,7 +1641,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
it doesn't cost us anything but space and if the function is pcc
it will ignore this value, we will make that assumption.
- Also note that on some machines (like the sparc) pcc uses a
+ Also note that on some machines (like the sparc) pcc uses a
convention like gcc's. */
if (struct_return)
@@ -1626,8 +1653,11 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */
write_sp (sp);
+ if (SAVE_DUMMY_FRAME_TOS_P ())
+ SAVE_DUMMY_FRAME_TOS (sp);
+
{
- char retbuf[REGISTER_BYTES];
+ char *retbuf = (char*) alloca (REGISTER_BYTES);
char *name;
struct symbol *symbol;
@@ -1659,17 +1689,61 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
/* Execute the stack dummy routine, calling FUNCTION.
When it is done, discard the empty frame
after storing the contents of all regs into retbuf. */
- if (run_stack_dummy (real_pc + CALL_DUMMY_START_OFFSET, retbuf))
+ rc = run_stack_dummy (real_pc + CALL_DUMMY_START_OFFSET, retbuf);
+
+ if (rc == 1)
{
- /* We stopped somewhere besides the call dummy. */
+ /* We stopped inside the FUNCTION because of a random signal.
+ Further execution of the FUNCTION is not allowed. */
+
+ if (unwind_on_signal_p)
+ {
+ /* The user wants the context restored. */
- /* If we did the cleanups, we would print a spurious error message
- (Unable to restore previously selected frame), would write the
- registers from the inf_status (which is wrong), and would do other
- wrong things (like set stop_bpstat to the wrong thing). */
+ /* We must get back to the frame we were before the dummy call. */
+ POP_FRAME;
+
+ /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
+ a C++ name with arguments and stuff. */
+ error ("\
+The program being debugged was signaled while in a function called from GDB.\n\
+GDB has restored the context to what it was before the call.\n\
+To change this behavior use \"set unwindonsignal off\"\n\
+Evaluation of the expression containing the function (%s) will be abandoned.",
+ name);
+ }
+ else
+ {
+ /* The user wants to stay in the frame where we stopped (default).*/
+
+ /* If we did the cleanups, we would print a spurious error
+ message (Unable to restore previously selected frame),
+ would write the registers from the inf_status (which is
+ wrong), and would do other wrong things. */
+ discard_cleanups (old_chain);
+ discard_inferior_status (inf_status);
+
+ /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
+ a C++ name with arguments and stuff. */
+ error ("\
+The program being debugged was signaled while in a function called from GDB.\n\
+GDB remains in the frame where the signal was received.\n\
+To change this behavior use \"set unwindonsignal on\"\n\
+Evaluation of the expression containing the function (%s) will be abandoned.",
+ name);
+ }
+ }
+
+ if (rc == 2)
+ {
+ /* We hit a breakpoint inside the FUNCTION. */
+
+ /* If we did the cleanups, we would print a spurious error
+ message (Unable to restore previously selected frame),
+ would write the registers from the inf_status (which is
+ wrong), and would do other wrong things. */
discard_cleanups (old_chain);
- /* Prevent memory leak. */
- bpstat_clear (&inf_status.stop_bpstat);
+ discard_inferior_status (inf_status);
/* The following error message used to say "The expression
which contained the function call has been discarded." It
@@ -1687,6 +1761,7 @@ stop (instead of continuing to evaluate the expression containing\n\
the function call).", name);
}
+ /* If we get here the called FUNCTION run to completion. */
do_cleanups (old_chain);
/* Figure out the value returned by the function. */
@@ -1696,28 +1771,32 @@ 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)
- return (value_ptr) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
+ return (struct value *) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
#endif
return value_being_returned (value_type, retbuf, struct_return);
}
}
-#else /* no CALL_DUMMY. */
-value_ptr
-call_function_by_hand (function, nargs, args)
- value_ptr function;
- int nargs;
- value_ptr *args;
+
+struct value *
+call_function_by_hand (struct value *function, int nargs, struct value **args)
{
- error ("Cannot invoke functions on this machine.");
+ if (CALL_DUMMY_P)
+ {
+ return hand_function_call (function, nargs, args);
+ }
+ else
+ {
+ error ("Cannot invoke functions on this machine.");
+ }
}
-#endif /* no CALL_DUMMY. */
-
+
+
/* 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.
@@ -1728,16 +1807,13 @@ call_function_by_hand (function, nargs, args)
first element, and all elements must have the same size (though we
don't currently enforce any restriction on their types). */
-value_ptr
-value_array (lowbound, highbound, elemvec)
- int lowbound;
- int highbound;
- value_ptr *elemvec;
+struct value *
+value_array (int lowbound, int highbound, struct value **elemvec)
{
int nelem;
int idx;
unsigned int typelength;
- value_ptr val;
+ struct value *val;
struct type *rangetype;
struct type *arraytype;
CORE_ADDR addr;
@@ -1761,8 +1837,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)
{
@@ -1803,18 +1879,16 @@ value_array (lowbound, highbound, elemvec)
zero and an upper bound of LEN - 1. Also note that the string may contain
embedded null bytes. */
-value_ptr
-value_string (ptr, len)
- char *ptr;
- int len;
+struct value *
+value_string (char *ptr, int len)
{
- value_ptr val;
+ struct value *val;
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_string_type ((struct type *) NULL, rangetype);
+ = create_string_type ((struct type *) NULL, rangetype);
CORE_ADDR addr;
if (current_language->c_style_arrays == 0)
@@ -1835,15 +1909,13 @@ value_string (ptr, len)
return (val);
}
-value_ptr
-value_bitstring (ptr, len)
- char *ptr;
- int len;
+struct value *
+value_bitstring (char *ptr, int len)
{
- value_ptr val;
+ struct value *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));
@@ -1866,10 +1938,7 @@ value_bitstring (ptr, len)
requested operation is type secure, shouldn't we? FIXME. */
static int
-typecmp (staticp, t1, t2)
- int staticp;
- struct type *t1[];
- value_ptr t2[];
+typecmp (int staticp, struct type *t1[], struct value *t2[])
{
int i;
@@ -1879,17 +1948,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)
@@ -1899,24 +1970,36 @@ typecmp (staticp, t1, t2)
continue;
}
- while (TYPE_CODE (tt1) == TYPE_CODE_PTR
- && ( TYPE_CODE (tt2) == TYPE_CODE_ARRAY
- || TYPE_CODE (tt2) == TYPE_CODE_PTR))
+ /* djb - 20000715 - Until the new type structure is in the
+ place, and we can attempt things like implicit conversions,
+ we need to do this so you can take something like a map<const
+ char *>, and properly access map["hello"], because the
+ argument to [] will be a reference to a pointer to a char,
+ and the argument will be a pointer to a char. */
+ while ( TYPE_CODE(tt1) == TYPE_CODE_REF ||
+ TYPE_CODE (tt1) == TYPE_CODE_PTR)
+ {
+ tt1 = check_typedef( TYPE_TARGET_TYPE(tt1) );
+ }
+ while ( TYPE_CODE(tt2) == TYPE_CODE_ARRAY ||
+ TYPE_CODE(tt2) == TYPE_CODE_PTR ||
+ TYPE_CODE(tt2) == TYPE_CODE_REF)
{
- tt1 = check_typedef (TYPE_TARGET_TYPE(tt1));
- tt2 = check_typedef (TYPE_TARGET_TYPE(tt2));
+ 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.
@@ -1927,40 +2010,36 @@ typecmp (staticp, t1, t2)
If LOOKING_FOR_BASECLASS, then instead of looking for struct fields,
look for a baseclass named NAME. */
-static value_ptr
-search_struct_field (name, arg1, offset, type, looking_for_baseclass)
- char *name;
- register value_ptr arg1;
- int offset;
- register struct type *type;
- int looking_for_baseclass;
+static struct value *
+search_struct_field (char *name, struct value *arg1, int offset,
+ register struct type *type, int looking_for_baseclass)
{
int i;
int nbases = TYPE_N_BASECLASSES (type);
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);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
- value_ptr v;
+ struct value *v;
if (TYPE_FIELD_STATIC (type, i))
v = value_static_field (type, i);
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;
}
if (t_field_name
&& (t_field_name[0] == '\0'
|| (TYPE_CODE (type) == TYPE_CODE_UNION
- && STREQ (t_field_name, "else"))))
+ && (strcmp_iw (t_field_name, "else") == 0))))
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION
@@ -1974,8 +2053,8 @@ 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;
+
+ struct value *v;
int new_offset = offset;
/* This is pretty gross. In G++, the offset in an anonymous
@@ -1996,26 +2075,26 @@ 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 value *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)));
+ && (strcmp_iw (name, TYPE_BASECLASS_NAME (type, i)) == 0));
if (BASETYPE_VIA_VIRTUAL (type, i))
{
int boffset;
- value_ptr v2 = allocate_value (basetype);
+ struct value *v2 = allocate_value (basetype);
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");
@@ -2027,7 +2106,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)
@@ -2057,9 +2136,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;
}
@@ -2084,37 +2164,32 @@ 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 (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 */
+
+ struct value *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;
@@ -2124,17 +2199,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.");
@@ -2144,12 +2220,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 */
+
+ /* pai: FIXME -- 32x64 problem, if word = 8 bytes, change multiplier
+ & 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;
@@ -2163,15 +2239,13 @@ find_rt_vbase_offset(type, basetype, valaddr, offset, boffset_p, skip_p)
If found, return value, else if name matched and args not return (value)-1,
else return NULL. */
-static value_ptr
-search_struct_method (name, arg1p, args, offset, static_memfuncp, type)
- char *name;
- register value_ptr *arg1p, *args;
- int offset, *static_memfuncp;
- register struct type *type;
+static struct value *
+search_struct_method (char *name, struct value **arg1p,
+ struct value **args, int offset,
+ int *static_memfuncp, register struct type *type)
{
int i;
- value_ptr v;
+ struct value *v;
int name_matched = 0;
char dem_opname[64];
@@ -2180,39 +2254,49 @@ 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))
+ if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
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);
- while (j >= 0)
+ else if (j == 0 && args == 0)
{
if (TYPE_FN_FIELD_STUB (f, j))
check_stub_method (type, i, j);
- if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
- TYPE_FN_FIELD_ARGS (f, j), args))
- {
- if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
- return value_virtual_fn_field (arg1p, f, j, type, offset);
- 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;
- }
- j--;
+ v = value_fn_field (arg1p, f, j, type, offset);
+ if (v != NULL)
+ return v;
}
+ else
+ while (j >= 0)
+ {
+ if (TYPE_FN_FIELD_STUB (f, j))
+ check_stub_method (type, i, j);
+ if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
+ TYPE_FN_FIELD_ARGS (f, j), args))
+ {
+ if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
+ return value_virtual_fn_field (arg1p, f, j, type, offset);
+ 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;
+ }
+ j--;
+ }
}
}
@@ -2222,66 +2306,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 == (struct value *) - 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 (struct value *) - 1;
+ else
+ return NULL;
}
/* Given *ARGP, a value of type (pointer to a)* structure/union,
@@ -2298,15 +2384,12 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type)
ERR is an error message to be printed in case the field is not found. */
-value_ptr
-value_struct_elt (argp, args, name, static_memfuncp, err)
- register value_ptr *argp, *args;
- char *name;
- int *static_memfuncp;
- char *err;
+struct value *
+value_struct_elt (struct value **argp, struct value **args,
+ char *name, int *static_memfuncp, char *err)
{
register struct type *t;
- value_ptr v;
+ struct value *v;
COERCE_ARRAY (*argp);
@@ -2326,20 +2409,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;
@@ -2352,7 +2435,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 == (struct value *) - 1)
error ("Cannot take address of a method");
else if (v == 0)
{
@@ -2389,16 +2472,16 @@ 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 == (struct value *) - 1)
{
- error("Argument list of %s mismatch with component in the structure.", name);
+ error ("One of the arguments you tried to pass to %s could not be converted to what the function wants.", 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);
}
@@ -2420,77 +2503,72 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
* BASETYPE is set to the actual type of the subobject where the method is found
* BOFFSET is the offset of the base subobject where the method is found */
-struct fn_field *
-find_method_list (argp, method, offset, static_memfuncp, type, num_fns, basetype, boffset)
- 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 (struct value **argp, char *method, int offset,
+ 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);
- 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);
- }
+ char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+ if (fn_field_name && (strcmp_iw (fn_field_name, method) == 0))
+ {
+ *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.
@@ -2503,21 +2581,15 @@ find_method_list (argp, method, offset, static_memfuncp, type, num_fns, basetype
* BOFFSET is the offset of the base subobject which defines the method */
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_find_oload_method_list (struct value **argp, char *method, int offset,
+ int *static_memfuncp, int *num_fns,
+ struct type **basetype, int *boffset)
{
- struct type * t;
- value_ptr v;
+ struct type *t;
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);
@@ -2526,20 +2598,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
@@ -2568,201 +2640,249 @@ 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;
+find_overload_match (struct type **arg_types, int nargs, char *name, int method,
+ int lax, struct value **objp, struct symbol *fsym,
+ struct value **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 */
-
- 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 value *obj = (objp ? *objp : NULL);
+
+ 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 */
+
+ struct value *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;
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)
{
+ int i;
+ int len;
+ struct type *domain;
obj_type_name = TYPE_NAME (VALUE_TYPE (obj));
/* 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);
+ domain = TYPE_DOMAIN_TYPE (fns_ptr[0].type);
+ len = TYPE_NFN_FIELDS (domain);
+ /* NOTE: dan/2000-03-10: This stuff is for STABS, which won't
+ give us the info we need directly in the types. We have to
+ use the method stub conversion to get it. Be aware that this
+ is by no means perfect, and if you use STABS, please move to
+ DWARF-2, or something like it, because trying to improve
+ overloading using STABS is really a waste of time. */
+ for (i = 0; i < len; i++)
+ {
+ int j;
+ struct fn_field *f = TYPE_FN_FIELDLIST1 (domain, i);
+ int len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
+
+ for (j = 0; j < len2; j++)
+ {
+ if (TYPE_FN_FIELD_STUB (f, j) && (!strcmp_iw (TYPE_FN_FIELDLIST_NAME (domain,i),name)))
+ check_stub_method (domain, i, j);
+ }
+ }
}
else
{
int i = -1;
func_name = cplus_demangle (SYMBOL_NAME (fsym), DMGL_NO_OPTS);
+ /* If the name is NULL this must be a C-style function.
+ Just return the same symbol. */
+ if (!func_name)
+ {
+ *symp = fsym;
+ return 0;
+ }
+
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;
+ if (method)
+ {
+ /* For static member functions, we won't have a this pointer, but nothing
+ else seems to handle them right now, so we just pretend ourselves */
+ nparms=0;
- /* Number of parameters for current candidate */
- nparms = method ? TYPE_NFIELDS (fns_ptr[ix].type)
- : TYPE_NFIELDS (SYMBOL_TYPE (oload_syms[ix]));
+ if (TYPE_FN_FIELD_ARGS(fns_ptr,ix))
+ {
+ while (TYPE_CODE(TYPE_FN_FIELD_ARGS(fns_ptr,ix)[nparms]) != TYPE_CODE_VOID)
+ nparms++;
+ }
+ }
+ else
+ {
+ /* If it's not a method, this is the proper place */
+ nparms=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_FN_FIELD_ARGS (fns_ptr, ix)[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;
- }
- 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;
- }
- free (parm_types);
-#ifdef DEBUG_OLOAD
- if (method)
- printf("Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
+ {
+ oload_champ_bv = bv;
+ oload_champ = 0;
+ champ_nparms = nparms;
+ }
else
- 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);
-#endif
- } /* end loop over all candidates */
-
+ /* 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;
+ }
+ xfree (parm_types);
+ if (overload_debug)
+ {
+ if (method)
+ fprintf_filtered (gdb_stderr,"Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
+ else
+ fprintf_filtered (gdb_stderr,"Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME (oload_syms[ix]), nparms);
+ for (jj = 0; jj < nargs; jj++)
+ fprintf_filtered (gdb_stderr,"...Badness @ %d : %d\n", jj, bv->rank[jj]);
+ fprintf_filtered (gdb_stderr,"Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
+ }
+ } /* end loop over all candidates */
+ /* NOTE: dan/2000-03-10: Seems to be a better idea to just pick one
+ if they have the exact same goodness. This is because there is no
+ way to differentiate based on return type, which we need to in
+ cases like overloads of .begin() <It's both const and non-const> */
+#if 0
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);
}
+#endif
- /* 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;
- }
+ if (oload_champ_bv->rank[ix] >= 100)
+ oload_incompatible = 1; /* truly mismatched types */
+
+ else if (oload_champ_bv->rank[ix] >= 10)
+ oload_non_standard = 1; /* non-standard type conversions needed */
}
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
{
*symp = oload_syms[oload_champ];
- free (func_name);
+ xfree (func_name);
}
+ if (objp)
+ {
+ if (TYPE_CODE (VALUE_TYPE (temp)) != TYPE_CODE_PTR
+ && TYPE_CODE (VALUE_TYPE (*objp)) == TYPE_CODE_PTR)
+ {
+ temp = value_addr (temp);
+ }
+ *objp = temp;
+ }
return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0);
}
@@ -2770,9 +2890,7 @@ find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp,
of type TYPE. If TYPE does not have a destructor, or
if NAME is inappropriate for TYPE, an error is signaled. */
int
-destructor_name_p (name, type)
- const char *name;
- const struct type *type;
+destructor_name_p (const char *name, const struct type *type)
{
/* destructors are a special case. */
@@ -2800,16 +2918,14 @@ destructor_name_p (name, type)
target structure/union is defined, otherwise, return 0. */
static int
-check_field_in (type, name)
- register struct type *type;
- const char *name;
+check_field_in (register struct type *type, const char *name)
{
register int i;
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
return 1;
}
@@ -2826,14 +2942,14 @@ check_field_in (type, name)
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
{
- if (STREQ (TYPE_FN_FIELDLIST_NAME (type, i), name))
+ if (strcmp_iw (TYPE_FN_FIELDLIST_NAME (type, i), name) == 0)
return 1;
}
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
if (check_field_in (TYPE_BASECLASS (type, i), name))
return 1;
-
+
return 0;
}
@@ -2843,9 +2959,7 @@ check_field_in (type, name)
target structure/union is defined, otherwise, return 0. */
int
-check_field (arg1, name)
- register value_ptr arg1;
- const char *name;
+check_field (struct value *arg1, const char *name)
{
register struct type *t;
@@ -2866,7 +2980,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");
@@ -2880,24 +2994,23 @@ check_field (arg1, name)
"pointers to member functions". This function is used
to resolve user expressions of the form "DOMAIN::NAME". */
-value_ptr
-value_struct_elt_for_reference (domain, offset, curtype, name, intype)
- struct type *domain, *curtype, *intype;
- int offset;
- char *name;
+struct value *
+value_struct_elt_for_reference (struct type *domain, int offset,
+ struct type *curtype, char *name,
+ struct type *intype)
{
register struct type *t = curtype;
register int i;
- value_ptr v;
+ struct value *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))
@@ -2910,7 +3023,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)),
@@ -2936,20 +3049,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)
@@ -2962,7 +3075,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))
@@ -2996,7 +3109,7 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
}
for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
{
- value_ptr v;
+ struct value *v;
int base_offset;
if (BASETYPE_VIA_VIRTUAL (t, i))
@@ -3015,149 +3128,15 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
}
-/* Find the real run-time type of a value using RTTI.
- * V is a pointer to the value.
- * A pointer to the struct type entry of the run-time type
- * is returneed.
- * FULL is a flag that is set only if the value V includes
- * the entire contents of an object of the RTTI type.
- * TOP is the offset to the top of the enclosing object of
- * the real run-time type. This offset may be for the embedded
- * object, or for the enclosing object of V.
- * USING_ENC is the flag that distinguishes the two cases.
- * If it is 1, then the offset is for the enclosing object,
- * otherwise for the embedded object.
- *
- * This currently works only for RTTI information generated
- * by the HP ANSI C++ compiler (aCC). g++ today (1997-06-10)
- * does not appear to support RTTI. This function returns a
- * NULL value for objects in the g++ runtime model. */
-
-struct type *
-value_rtti_type (v, full, top, using_enc)
- value_ptr v;
- int * full;
- int * top;
- int * using_enc;
-{
- struct type * known_type;
- struct type * rtti_type;
- CORE_ADDR coreptr;
- value_ptr vp;
- int using_enclosing = 0;
- long top_offset = 0;
- char rtti_type_name[256];
-
- if (full)
- *full = 0;
- if (top)
- *top = -1;
- if (using_enc)
- *using_enc = 0;
-
- /* Get declared type */
- known_type = VALUE_TYPE (v);
- CHECK_TYPEDEF (known_type);
- /* RTTI works only or class objects */
- if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
- return NULL;
-
- /* If neither the declared type nor the enclosing type of the
- * value structure has a HP ANSI C++ style virtual table,
- * we can't do anything. */
- if (!TYPE_HAS_VTABLE (known_type))
- {
- 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 */
- CHECK_TYPEDEF (known_type);
- using_enclosing = 1;
- }
-
- if (using_enclosing && 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)));
- if (coreptr == 0)
- return NULL; /* return silently -- maybe called on gdb-generated value */
-
- /* 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));
- top_offset = value_as_long (vp);
- if (top)
- *top = top_offset;
-
- /* Fetch the typeinfo pointer */
- /* FIXME possible 32x64 problem with pointer size & arithmetic */
- 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));
- 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 */
-
- 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);
-#endif
-
- /* Check whether we have the entire object */
- 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))))
-
- *full = 1;
-
- return rtti_type;
-}
-
/* Given a pointer value V, find the real (RTTI) type
of the object it points to.
Other parameters FULL, TOP, USING_ENC as with value_rtti_type()
and refer to the values computed for the object pointed to. */
struct type *
-value_rtti_target_type (v, full, top, using_enc)
- value_ptr v;
- int * full;
- int * top;
- int * using_enc;
+value_rtti_target_type (struct value *v, int *full, int *top, int *using_enc)
{
- value_ptr target;
+ struct value *target;
target = value_ind (v);
@@ -3174,20 +3153,15 @@ value_rtti_target_type (v, full, top, using_enc)
they can be supplied and a second call to value_rtti_type() is avoided.
(Pass RTYPE == NULL if they're not available */
-value_ptr
-value_full_object (argp, rtype, xfull, xtop, xusing_enc)
- value_ptr argp;
- struct type * rtype;
- int xfull;
- int xtop;
- int xusing_enc;
-
+struct value *
+value_full_object (struct value *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;
- value_ptr new_val;
+ struct value *new_val;
if (rtype)
{
@@ -3204,10 +3178,10 @@ 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;
+ argp = value_change_enclosing_type (argp, real_type);
return argp;
}
@@ -3215,17 +3189,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;
@@ -3238,21 +3212,21 @@ value_full_object (argp, rtype, xfull, xtop, xusing_enc)
Flag COMPLAIN signals an error if the request is made in an
inappropriate context. */
-value_ptr
-value_of_this (complain)
- int complain;
+struct value *
+value_of_this (int complain)
{
struct symbol *func, *sym;
struct block *b;
int i;
static const char funny_this[] = "this";
- value_ptr this;
+ struct value *this;
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);
@@ -3260,7 +3234,8 @@ value_of_this (complain)
{
if (complain)
error ("no `this' in nameless context");
- else return 0;
+ else
+ return 0;
}
b = SYMBOL_BLOCK_VALUE (func);
@@ -3268,8 +3243,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
@@ -3293,14 +3269,12 @@ value_of_this (complain)
long, starting at LOWBOUND. The result has the same lower bound as
the original ARRAY. */
-value_ptr
-value_slice (array, lowbound, length)
- value_ptr array;
- int lowbound, length;
+struct value *
+value_slice (struct value *array, int lowbound, int length)
{
struct type *slice_range_type, *slice_type, *range_type;
LONGEST lowerbound, upperbound, offset;
- value_ptr slice;
+ struct value *slice;
struct type *array_type;
array_type = check_typedef (VALUE_TYPE (array));
COERCE_VARYING_ARRAY (array, array_type);
@@ -3313,19 +3287,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++)
@@ -3344,15 +3318,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);
@@ -3374,9 +3348,8 @@ value_slice (array, lowbound, length)
/* Assuming chill_varying_type (VARRAY) is true, return an equivalent
value as a fixed-length array. */
-value_ptr
-varying_to_slice (varray)
- value_ptr varray;
+struct value *
+varying_to_slice (struct value *varray)
{
struct type *vtype = check_typedef (VALUE_TYPE (varray));
LONGEST length = unpack_long (TYPE_FIELD_TYPE (vtype, 0),
@@ -3385,19 +3358,16 @@ varying_to_slice (varray)
return value_slice (value_primitive_field (varray, 0, 1, vtype), 0, length);
}
-/* Create a value for a FORTRAN complex number. Currently most of
- 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 */
-
-value_ptr
-value_literal_complex (arg1, arg2, type)
- value_ptr arg1;
- value_ptr arg2;
- struct type *type;
+/* Create a value for a FORTRAN complex number. Currently most of
+ 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 */
+
+struct value *
+value_literal_complex (struct value *arg1, struct value *arg2, struct type *type)
{
- register value_ptr val;
+ struct value *val;
struct type *real_type = TYPE_TARGET_TYPE (type);
val = allocate_value (type);
@@ -3413,23 +3383,21 @@ value_literal_complex (arg1, arg2, type)
/* Cast a value into the appropriate complex data type. */
-static value_ptr
-cast_into_complex (type, val)
- struct type *type;
- register value_ptr val;
+static struct value *
+cast_into_complex (struct type *type, struct value *val)
{
struct type *real_type = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_COMPLEX)
{
struct type *val_real_type = TYPE_TARGET_TYPE (VALUE_TYPE (val));
- value_ptr re_val = allocate_value (val_real_type);
- value_ptr im_val = allocate_value (val_real_type);
+ struct value *re_val = allocate_value (val_real_type);
+ struct value *im_val = allocate_value (val_real_type);
memcpy (VALUE_CONTENTS_RAW (re_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);
}
@@ -3441,21 +3409,30 @@ cast_into_complex (type, val)
}
void
-_initialize_valops ()
+_initialize_valops (void)
{
#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);
overload_resolution = 1;
+ add_show_from_set (
+ add_set_cmd ("unwindonsignal", no_class, var_boolean,
+ (char *) &unwind_on_signal_p,
+"Set unwinding of stack if a signal is received while in a call dummy.\n\
+The unwindonsignal lets the user determine what gdb should do if a signal\n\
+is received while in a function called from gdb (call dummy). If set, gdb\n\
+unwinds the stack and restore the context to what as it was before the call.\n\
+The default is to stop in the frame where the signal was received.", &setlist),
+ &showlist);
}
diff --git a/contrib/gdb/gdb/valprint.c b/contrib/gdb/gdb/valprint.c
index b09da9b..131769b 100644
--- a/contrib/gdb/gdb/valprint.c
+++ b/contrib/gdb/gdb/valprint.c
@@ -1,22 +1,24 @@
/* Print values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1998
- Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,34 +30,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "obstack.h"
#include "language.h"
-#include "demangle.h"
#include "annotate.h"
#include "valprint.h"
+#include "floatformat.h"
+#include "doublest.h"
#include <errno.h>
/* Prototypes for local functions */
-static void print_hex_chars PARAMS ((GDB_FILE *, unsigned char *,
- unsigned int));
+static int partial_memory_read (CORE_ADDR memaddr, char *myaddr,
+ int len, int *errnoptr);
-static void show_print PARAMS ((char *, int));
+static void print_hex_chars (struct ui_file *, unsigned char *,
+ unsigned int);
-static void set_print PARAMS ((char *, int));
+static void show_print (char *, int);
-static void set_radix PARAMS ((char *, int));
+static void set_print (char *, int);
-static void show_radix PARAMS ((char *, int));
+static void set_radix (char *, int);
-static void set_input_radix PARAMS ((char *, int, struct cmd_list_element *));
+static void show_radix (char *, int);
-static void set_input_radix_1 PARAMS ((int, unsigned));
+static void set_input_radix (char *, int, struct cmd_list_element *);
-static void set_output_radix PARAMS ((char *, int, struct cmd_list_element *));
+static void set_input_radix_1 (int, unsigned);
-static void set_output_radix_1 PARAMS ((int, unsigned));
+static void set_output_radix (char *, int, struct cmd_list_element *);
-void _initialize_valprint PARAMS ((void));
+static void set_output_radix_1 (int, unsigned);
+
+void _initialize_valprint (void);
/* Maximum number of chars to print for a string pointer value or vector
contents, or UINT_MAX for no limit. Note that "set print elements 0"
@@ -97,8 +103,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 */
-
+
/* 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).
@@ -120,39 +126,31 @@ int addressprint; /* Controls printing of machine addresses */
int
-val_print (type, valaddr, embedded_offset, address,
- stream, format, deref_ref, recurse, pretty)
- 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;
+val_print (struct type *type, char *valaddr, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format, int deref_ref,
+ int recurse, enum val_prettyprint pretty)
{
struct type *real_type = check_typedef (type);
if (pretty == Val_pretty_default)
{
pretty = prettyprint_structs ? Val_prettyprint : Val_no_prettyprint;
}
-
+
QUIT;
/* Ensure that the type is complete and not just a stub. If the type is
only a stub and we can't find and substitute its complete type, then
print appropriate string and return. */
- if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB)
+ if (TYPE_STUB (real_type))
{
fprintf_filtered (stream, "<incomplete type>");
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.
@@ -161,11 +159,8 @@ val_print (type, valaddr, embedded_offset, address,
the number of string bytes printed. */
int
-value_print (val, stream, format, pretty)
- value_ptr val;
- GDB_FILE *stream;
- int format;
- enum val_prettyprint pretty;
+value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
if (val == 0)
{
@@ -185,10 +180,8 @@ value_print (val, stream, format, pretty)
value. STREAM is where to print the value. */
void
-val_print_type_code_int (type, valaddr, stream)
- struct type *type;
- char *valaddr;
- GDB_FILE *stream;
+val_print_type_code_int (struct type *type, char *valaddr,
+ struct ui_file *stream)
{
if (TYPE_LENGTH (type) > sizeof (LONGEST))
{
@@ -233,15 +226,14 @@ 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 (struct ui_file * stream, char *sign,
+ int use_local, ULONGEST val_ulong);
static void
-print_decimal (stream, sign, use_local, val_ulong)
- GDB_FILE *stream;
- char *sign;
- int use_local;
- ULONGEST val_ulong;
+print_decimal (struct ui_file *stream, char *sign, int use_local,
+ ULONGEST val_ulong)
{
unsigned long temp[3];
int i = 0;
@@ -267,18 +259,15 @@ print_decimal (stream, sign, use_local, val_ulong)
sign, temp[2], temp[1], temp[0]);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
return;
}
#endif
void
-print_longest (stream, format, use_local, val_long)
- GDB_FILE *stream;
- int format;
- int use_local;
- LONGEST val_long;
+print_longest (struct ui_file *stream, int format, int use_local,
+ LONGEST val_long)
{
#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG)
if (sizeof (long) < sizeof (LONGEST))
@@ -342,7 +331,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':
@@ -351,13 +340,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':
@@ -373,9 +362,9 @@ print_longest (stream, format, use_local, val_long)
fprintf_filtered (stream, local_hex_format_custom ("016ll"), val_long);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
-#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. */
@@ -385,7 +374,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':
@@ -394,13 +383,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':
@@ -420,19 +409,17 @@ print_longest (stream, format, use_local, val_long)
(unsigned long) val_long);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#endif /* CC_HAS_LONG_LONG || PRINTF_HAS_LONG_LONG */
}
+#if 0
void
-strcat_longest (format, use_local, val_long, buf, buflen)
- int format;
- int use_local;
- LONGEST val_long;
- char *buf;
- int buflen; /* ignored, for now */
+strcat_longest (int format, int use_local, LONGEST val_long, char *buf,
+ int buflen)
{
+/* FIXME: Use buflen to avoid buffer overflow. */
#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG)
long vtop, vbot;
@@ -440,7 +427,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;
@@ -452,37 +439,37 @@ 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 ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#else /* !PRINTF_HAS_LONG_LONG */
/* In the following it is important to coerce (val_long) to a long. It does
@@ -492,30 +479,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':
@@ -523,11 +510,12 @@ strcat_longest (format, use_local, val_long, buf, buflen)
((long) val_long));
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
-
+
#endif /* !PRINTF_HAS_LONG_LONG */
}
+#endif
/* This used to be a macro, but I don't think it is called often enough
to merit such treatment. */
@@ -536,8 +524,7 @@ strcat_longest (format, use_local, val_long, buf, buflen)
where the value must not be larger than can fit in an int. */
int
-longest_to_int (arg)
- LONGEST arg;
+longest_to_int (LONGEST arg)
{
/* Let the compiler do the work */
int rtnval = (int) arg;
@@ -553,92 +540,40 @@ longest_to_int (arg)
return (rtnval);
}
-/* Print a floating point value of type TYPE, pointed to in GDB by VALADDR,
- on STREAM. */
+/* Print a floating point value of type TYPE (not always a
+ TYPE_CODE_FLT), pointed to in GDB by VALADDR, on STREAM. */
void
-print_floating (valaddr, type, stream)
- char *valaddr;
- struct type *type;
- GDB_FILE *stream;
+print_floating (char *valaddr, struct type *type, struct ui_file *stream)
{
DOUBLEST doub;
int inv;
+ const struct floatformat *fmt = NULL;
unsigned len = TYPE_LENGTH (type);
-
-#if defined (IEEE_FLOAT)
-
- /* Check for NaN's. Note that this code does not depend on us being
- on an IEEE conforming system. It only depends on the target
- machine using IEEE representation. This means (a)
- cross-debugging works right, and (2) IEEE_FLOAT can (and should)
- be defined for systems like the 68881, which uses IEEE
- representation, but is not IEEE conforming. */
-
- {
- unsigned long low, high;
- /* Is the sign bit 0? */
- int nonnegative;
- /* Is it is a NaN (i.e. the exponent is all ones and
- the fraction is nonzero)? */
- int is_nan;
-
- /* For lint, initialize these two variables to suppress warning: */
- low = high = nonnegative = 0;
- if (len == 4)
- {
- /* It's single precision. */
- /* Assume that floating point byte order is the same as
- integer byte order. */
- low = extract_unsigned_integer (valaddr, 4);
- nonnegative = ((low & 0x80000000) == 0);
- is_nan = ((((low >> 23) & 0xFF) == 0xFF)
- && 0 != (low & 0x7FFFFF));
- low &= 0x7fffff;
- high = 0;
- }
- else if (len == 8)
- {
- /* It's double precision. Get the high and low words. */
-
- /* Assume that floating point byte order is the same as
- integer byte order. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
- {
- low = extract_unsigned_integer (valaddr + 4, 4);
- high = extract_unsigned_integer (valaddr, 4);
- }
- else
- {
- low = extract_unsigned_integer (valaddr, 4);
- high = extract_unsigned_integer (valaddr + 4, 4);
- }
- nonnegative = ((high & 0x80000000) == 0);
- is_nan = (((high >> 20) & 0x7ff) == 0x7ff
- && ! ((((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. */
- is_nan = 0;
-
- if (is_nan)
- {
- /* The meaning of the sign and fraction is not defined by IEEE.
- But the user might know what they mean. For example, they
- (in an implementation-defined manner) distinguish between
- signaling and quiet NaN's. */
- if (high)
- fprintf_filtered (stream, "-NaN(0x%lx%.8lx)" + nonnegative,
- high, low);
- else
- fprintf_filtered (stream, "-NaN(0x%lx)" + nonnegative, low);
- return;
- }
- }
-#endif /* IEEE_FLOAT. */
+
+ /* If it is a floating-point, check for obvious problems. */
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ fmt = floatformat_from_type (type);
+ if (fmt != NULL && floatformat_is_nan (fmt, valaddr))
+ {
+ if (floatformat_is_negative (fmt, valaddr))
+ fprintf_filtered (stream, "-");
+ fprintf_filtered (stream, "nan(");
+ fprintf_filtered (stream, local_hex_format_prefix ());
+ fprintf_filtered (stream, floatformat_mantissa (fmt, valaddr));
+ fprintf_filtered (stream, local_hex_format_suffix ());
+ fprintf_filtered (stream, ")");
+ return;
+ }
+
+ /* NOTE: cagney/2002-01-15: The TYPE passed into print_floating()
+ isn't necessarily a TYPE_CODE_FLT. Consequently, unpack_double
+ needs to be used as that takes care of any necessary type
+ conversions. Such conversions are of course direct to DOUBLEST
+ and disregard any possible target floating point limitations.
+ For instance, a u64 would be converted and displayed exactly on a
+ host with 80 bit DOUBLEST but with loss of information on a host
+ with 64 bit DOUBLEST. */
doub = unpack_double (type, valaddr, &inv);
if (inv)
@@ -647,57 +582,65 @@ print_floating (valaddr, type, stream)
return;
}
+ /* FIXME: kettenis/2001-01-20: The following code makes too much
+ assumptions about the host and target floating point format. */
+
+ /* NOTE: cagney/2002-02-03: Since the TYPE of what was passed in may
+ not necessarially be a TYPE_CODE_FLT, the below ignores that and
+ instead uses the type's length to determine the precision of the
+ floating-point value being printed. */
+
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);
#else
- /* This at least wins with values that are representable as doubles */
+ /* This at least wins with values that are representable as
+ doubles. */
fprintf_filtered (stream, "%.17g", (double) doub);
#endif
}
-void
-print_binary_chars (stream, valaddr, len)
- GDB_FILE *stream;
- unsigned char *valaddr;
- unsigned len;
+void
+print_binary_chars (struct ui_file *stream, unsigned char *valaddr,
+ unsigned len)
{
#define BITS_IN_BYTES 8
unsigned char *p;
- int i;
- int b;
+ unsigned 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. */
fprintf_filtered (stream, local_binary_format_prefix ());
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
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
@@ -706,14 +649,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 ());
@@ -723,15 +667,12 @@ print_binary_chars (stream, valaddr, len)
* Print it in octal on stream or format it in buf.
*/
void
-print_octal_chars (stream, valaddr, len)
- GDB_FILE *stream;
- unsigned char *valaddr;
- unsigned len;
+print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned 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. */
@@ -767,55 +708,56 @@ 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)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
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
@@ -824,44 +766,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;
}
}
@@ -872,44 +815,41 @@ print_octal_chars (stream, valaddr, len)
* Print it in decimal on stream or format it in buf.
*/
void
-print_decimal_chars (stream, valaddr, len)
- GDB_FILE *stream;
- unsigned char *valaddr;
- unsigned len;
+print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
+ unsigned 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 \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? valaddr : valaddr + len - 1)
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1)
#define NOT_END_P \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? (p < valaddr + len) : (p >= valaddr))
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
#define NEXT_P \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? p++ : p-- )
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? p++ : p-- )
#define LOW_NIBBLE( x ) ( (x) & 0x00F)
#define HIGH_NIBBLE( x ) (((x) & 0x0F0) >> 4)
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 = xmalloc (decimal_len);
- for( i = 0; i < decimal_len; i++ ) {
+ for (i = 0; i < decimal_len; i++)
+ {
digits[i] = 0;
- }
+ }
fprintf_filtered (stream, local_decimal_format_prefix ());
@@ -926,38 +866,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
@@ -968,56 +912,56 @@ 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]);
+ }
+ xfree (digits);
+
fprintf_filtered (stream, local_decimal_format_suffix ());
}
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
static void
-print_hex_chars (stream, valaddr, len)
- GDB_FILE *stream;
- unsigned char *valaddr;
- unsigned len;
+print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
{
unsigned char *p;
/* FIXME: We should be not printing leading zeroes in most cases. */
fprintf_filtered (stream, local_hex_format_prefix ());
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
p < valaddr + len;
@@ -1039,26 +983,19 @@ 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,
- recurse, pretty, i)
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- GDB_FILE *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
- unsigned int i;
+val_print_array_elements (struct type *type, char *valaddr, CORE_ADDR address,
+ struct ui_file *stream, int format, int deref_ref,
+ int recurse, enum val_prettyprint pretty,
+ unsigned int i)
{
unsigned int things_printed = 0;
unsigned len;
@@ -1069,7 +1006,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;
@@ -1094,7 +1031,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;
@@ -1127,20 +1064,57 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
}
}
+/* Read LEN bytes of target memory at address MEMADDR, placing the
+ results in GDB's memory at MYADDR. Returns a count of the bytes
+ actually read, and optionally an errno value in the location
+ pointed to by ERRNOPTR if ERRNOPTR is non-null. */
+
+/* FIXME: cagney/1999-10-14: Only used by val_print_string. Can this
+ function be eliminated. */
+
+static int
+partial_memory_read (CORE_ADDR memaddr, char *myaddr, int len, int *errnoptr)
+{
+ int nread; /* Number of bytes actually read. */
+ int errcode; /* Error from last read. */
+
+ /* First try a complete read. */
+ errcode = target_read_memory (memaddr, myaddr, len);
+ if (errcode == 0)
+ {
+ /* Got it all. */
+ nread = len;
+ }
+ else
+ {
+ /* Loop, reading one byte at a time until we get as much as we can. */
+ for (errcode = 0, nread = 0; len > 0 && errcode == 0; nread++, len--)
+ {
+ errcode = target_read_memory (memaddr++, myaddr++, 1);
+ }
+ /* If an error, the last read was unsuccessful, so adjust count. */
+ if (errcode != 0)
+ {
+ nread--;
+ }
+ }
+ if (errnoptr != NULL)
+ {
+ *errnoptr = errcode;
+ }
+ return (nread);
+}
+
/* 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;
+val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
{
int force_ellipsis = 0; /* Force ellipsis to be printed if nonzero. */
int errcode; /* Errno returned from bad reads. */
@@ -1150,7 +1124,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
@@ -1184,9 +1158,9 @@ val_print_string (addr, len, width, stream)
{
buffer = (char *) xmalloc (len * width);
bufptr = buffer;
- old_chain = make_cleanup (free, buffer);
+ old_chain = make_cleanup (xfree, buffer);
- nfetch = target_read_memory_partial (addr, bufptr, len * width, &errcode)
+ nfetch = partial_memory_read (addr, bufptr, len * width, &errcode)
/ width;
addr += nfetch * width;
bufptr += nfetch * width;
@@ -1207,13 +1181,13 @@ val_print_string (addr, len, width, stream)
buffer = (char *) xrealloc (buffer, (nfetch + bufsize) * width);
}
- old_chain = make_cleanup (free, buffer);
+ old_chain = make_cleanup (xfree, buffer);
bufptr = buffer + bufsize * width;
bufsize += nfetch;
/* Read as much as we can. */
- nfetch = target_read_memory_partial (addr, bufptr, nfetch * width, &errcode)
- / width;
+ nfetch = partial_memory_read (addr, bufptr, nfetch * width, &errcode)
+ / 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
@@ -1239,9 +1213,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! */
@@ -1260,8 +1234,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);
@@ -1269,11 +1243,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;
}
@@ -1288,7 +1262,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)
@@ -1308,29 +1282,24 @@ val_print_string (addr, len, width, stream)
}
gdb_flush (stream);
do_cleanups (old_chain);
- return ((bufptr - buffer)/width);
+ return ((bufptr - buffer) / width);
}
-
+
/* 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! */
/* ARGSUSED */
static void
-set_input_radix (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
+set_input_radix (char *args, 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 */
static void
-set_input_radix_1 (from_tty, radix)
- int from_tty;
- unsigned radix;
+set_input_radix_1 (int from_tty, unsigned radix)
{
/* We don't currently disallow any input radix except 0 or 1, which don't
make any mathematical sense. In theory, we can deal with any input
@@ -1354,31 +1323,26 @@ set_input_radix_1 (from_tty, radix)
/* ARGSUSED */
static void
-set_output_radix (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
+set_output_radix (char *args, 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
-set_output_radix_1 (from_tty, radix)
- int from_tty;
- unsigned radix;
+set_output_radix_1 (int from_tty, unsigned radix)
{
/* Validate the radix and disallow ones that we aren't prepared to
handle correctly, leaving the radix unchanged. */
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.",
@@ -1401,13 +1365,11 @@ set_output_radix_1 (from_tty, radix)
the 'set input-radix' command. */
static void
-set_radix (arg, from_tty)
- char *arg;
- int from_tty;
+set_radix (char *arg, int from_tty)
{
unsigned radix;
- radix = (arg == NULL) ? 10 : parse_and_eval_address (arg);
+ radix = (arg == NULL) ? 10 : parse_and_eval_long (arg);
set_output_radix_1 (0, radix);
set_input_radix_1 (0, radix);
if (from_tty)
@@ -1419,11 +1381,9 @@ set_radix (arg, from_tty)
/* Show both the input and output radices. */
-/*ARGSUSED*/
+/*ARGSUSED */
static void
-show_radix (arg, from_tty)
- char *arg;
- int from_tty;
+show_radix (char *arg, int from_tty)
{
if (from_tty)
{
@@ -1441,48 +1401,44 @@ show_radix (arg, from_tty)
}
}
}
-
-/*ARGSUSED*/
+
+/*ARGSUSED */
static void
-set_print (arg, from_tty)
- char *arg;
- int from_tty;
+set_print (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;
- int from_tty;
+show_print (char *args, int from_tty)
{
cmd_show_list (showprintlist, from_tty, "");
}
void
-_initialize_valprint ()
+_initialize_valprint (void)
{
struct cmd_list_element *c;
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),
@@ -1490,14 +1446,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),
@@ -1505,43 +1461,43 @@ _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;
+ set_cmd_sfunc (c, 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;
+ set_cmd_sfunc (c, set_output_radix);
/* The "set radix" and "show radix" commands are special in that they are
like normal set and show commands but allow two normally independent
diff --git a/contrib/gdb/gdb/valprint.h b/contrib/gdb/gdb/valprint.h
index e6edb15..52314aa 100644
--- a/contrib/gdb/gdb/valprint.h
+++ b/contrib/gdb/gdb/valprint.h
@@ -1,23 +1,25 @@
/* Declarations for value printing routines for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991-1994, 2000 Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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 VALPRINT_H
+#define VALPRINT_H
extern int prettyprint_arrays; /* Controls pretty printing of arrays. */
extern int prettyprint_structs; /* Controls pretty printing of structures */
@@ -31,24 +33,28 @@ extern int objectprint; /* Controls looking up an object's derived type
extern unsigned int print_max; /* Max # of chars for strings/vectors */
+/* Print repeat counts if there are more than this many repetitions of an
+ element in an array. Referenced by the low level language dependent
+ print routines. */
+extern unsigned int repeat_count_threshold;
+
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 (struct type *, char *, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint, unsigned int);
-extern void
-val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint,
- unsigned int));
+extern void val_print_type_code_int (struct type *, char *,
+ struct ui_file *);
-extern void
-val_print_type_code_int PARAMS ((struct type *, char *, GDB_FILE *));
+extern void print_binary_chars (struct ui_file *, unsigned char *,
+ unsigned int);
-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));
+extern void print_octal_chars (struct ui_file *, unsigned char *,
+ unsigned int);
+extern void print_decimal_chars (struct ui_file *, unsigned char *,
+ unsigned int);
+#endif
diff --git a/contrib/gdb/gdb/value.h b/contrib/gdb/gdb/value.h
index 44c70de..d6fa9ff 100644
--- a/contrib/gdb/gdb/value.h
+++ b/contrib/gdb/gdb/value.h
@@ -1,47 +1,35 @@
/* Definitions for values of C expressions, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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
+#include "doublest.h"
+
/*
* The structure which defines the type of a value. It should never
* 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
-};
struct value
{
@@ -53,18 +41,23 @@ struct value
/* Location of value (if lval). */
union
{
- /* Address in inferior or byte of registers structure. */
+ /* If lval == lval_memory, this is the address in the inferior.
+ If lval == lval_register, this is the byte offset into the
+ registers structure. */
CORE_ADDR address;
/* Pointer to internal variable. */
struct internalvar *internalvar;
/* 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;
+ If lval == lval_memory, this is an offset to the address.
+ If lval == lval_register, this is a further offset from
+ location.address within the registers structure.
+ Note also the member embedded_offset below. */
+ int offset;
/* Only used for bitfields; number of bits contained in them. */
int bitsize;
/* Only used for bitfields; position of start of field.
@@ -77,16 +70,55 @@ struct value
at the same place in memory. This will be described in the
lval enum above as "lval_reg_frame_relative". */
CORE_ADDR frame_addr;
+
/* Type of the value. */
struct type *type;
- /* Type of the enclosing object if this is an embedded subobject.
- The member embedded_offset gives the real position of the subobject
- if type is not the same as enclosing_type.
- If the type field is a pointer type, then enclosing_type is
- a pointer type pointing to the real (enclosing) type of the target
- object. */
+ /* If a value represents a C++ object, then the `type' field gives
+ the object's compile-time type. If the object actually belongs
+ to some class derived from `type', perhaps with other base
+ classes and additional members, then `type' is just a subobject
+ of the real thing, and the full object is probably larger than
+ `type' would suggest.
+
+ If `type' is a dynamic class (i.e. one with a vtable), then GDB
+ can actually determine the object's run-time type by looking at
+ the run-time type information in the vtable. When this
+ information is available, we may elect to read in the entire
+ object, for several reasons:
+
+ - When printing the value, the user would probably rather see
+ the full object, not just the limited portion apparent from
+ the compile-time type.
+
+ - If `type' has virtual base classes, then even printing
+ `type' alone may require reaching outside the `type'
+ portion of the object to wherever the virtual base class
+ has been stored.
+
+ When we store the entire object, `enclosing_type' is the
+ run-time type --- the complete object --- and `embedded_offset'
+ is the offset of `type' within that larger type, in bytes. The
+ VALUE_CONTENTS macro takes `embedded_offset' into account, so
+ most GDB code continues to see the `type' portion of the value,
+ just as the inferior would.
+
+ If `type' is a pointer to an object, then `enclosing_type' is a
+ pointer to the object's run-time type, and `pointed_to_offset'
+ is the offset in bytes from the full object to the pointed-to
+ object --- that is, the value `embedded_offset' would have if
+ we followed the pointer and fetched the complete object. (I
+ don't really see the point. Why not just determine the
+ run-time type when you indirect, and avoid the special case?
+ The contents don't matter until you indirect anyway.)
+
+ If we're not doing anything fancy, `enclosing_type' is equal to
+ `type', and `embedded_offset' is zero, so everything works
+ normally. */
struct type *enclosing_type;
+ int embedded_offset;
+ int pointed_to_offset;
+
/* Values are stored in a chain, so that they can be deleted
easily over calls to the inferior. Values assigned to internal
variables or put into the value history are taken off this
@@ -94,10 +126,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
@@ -106,26 +140,22 @@ struct value
/* If zero, contents of this value are in the contents field.
If nonzero, contents are in inferior memory at address
in the location.address field plus the offset field
- (and the lval field should be lval_memory). */
+ (and the lval field should be lval_memory).
+
+ WARNING: This field is used by the code which handles
+ watchpoints (see breakpoint.c) to decide whether a particular
+ value can be watched by hardware watchpoints. If the lazy flag
+ is set for some member of a value chain, it is assumed that
+ this member of the chain doesn't need to be watched as part of
+ watching the value itself. This is how GDB avoids watching the
+ entire struct or array when the user wants to watch a single
+ struct member or array element. If you ever change the way
+ lazy flag is set and reset, be sure to consider this use as
+ well! */
char lazy;
/* If nonzero, this is the value of a variable which does not
actually exist in the program. */
char optimized_out;
- /* If this value represents an object that is embedded inside a
- larger object (e.g., a base subobject in C++), this gives the
- offset (in bytes) from the start of the contents buffer where
- the embedded object begins. This is required because some C++
- runtime implementations lay out objects (especially virtual bases
- with possibly negative offsets to ancestors).
- Note: This may be positive or negative! Also note that this offset
- is not used when retrieving contents from target memory; the entire
- enclosing object has to be retrieved always, and the offset for
- that is given by the member offset above. */
- int embedded_offset;
- /* If this value represents a pointer to an object that is embedded
- in another object, this gives the embedded_offset of the object
- that is pointed to. */
- int pointed_to_offset;
/* The BFD section associated with this value. */
asection *bfd_section;
/* Actual contents of the value. For use of this value; setting
@@ -133,17 +163,17 @@ 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 */
};
-typedef struct value *value_ptr;
-
#define VALUE_TYPE(val) (val)->type
#define VALUE_ENCLOSING_TYPE(val) (val)->enclosing_type
#define VALUE_LAZY(val) (val)->lazy
@@ -164,13 +194,13 @@ 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));
+
+
+extern int value_fetch_lazy (struct value *val);
#define VALUE_LVAL(val) (val)->lval
#define VALUE_ADDRESS(val) (val)->location.address
@@ -193,8 +223,8 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\
if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
- unpack_long (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg)), \
+ unpack_pointer (VALUE_TYPE (arg), \
+ VALUE_CONTENTS (arg)), \
VALUE_BFD_SECTION (arg)); \
} while (0)
@@ -231,338 +261,315 @@ 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;
+ struct value *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))
-
+
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
-#ifdef __STDC__
struct frame_info;
struct fn_field;
-#endif
-extern void
-print_address_demangle PARAMS ((CORE_ADDR, GDB_FILE *, int));
+extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
-extern LONGEST value_as_long PARAMS ((value_ptr val));
+extern LONGEST value_as_long (struct value *val);
-extern DOUBLEST value_as_double PARAMS ((value_ptr val));
+extern DOUBLEST value_as_double (struct value *val);
-extern CORE_ADDR value_as_pointer PARAMS ((value_ptr val));
+extern CORE_ADDR value_as_address (struct value *val);
-extern LONGEST unpack_long PARAMS ((struct type *type, char *valaddr));
+extern LONGEST unpack_long (struct type *type, char *valaddr);
-extern DOUBLEST unpack_double PARAMS ((struct type *type, char *valaddr,
- int *invp));
+extern DOUBLEST unpack_double (struct type *type, char *valaddr, int *invp);
-extern CORE_ADDR unpack_pointer PARAMS ((struct type *type, char *valaddr));
+extern CORE_ADDR unpack_pointer (struct type *type, char *valaddr);
-extern LONGEST unpack_field_as_long PARAMS ((struct type *type, char *valaddr,
- int fieldno));
+extern LONGEST unpack_field_as_long (struct type *type, char *valaddr,
+ int fieldno);
-extern value_ptr value_from_longest PARAMS ((struct type *type, LONGEST num));
+extern struct value *value_from_longest (struct type *type, LONGEST num);
-extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
+extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
-extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
+extern struct value *value_from_double (struct type *type, DOUBLEST num);
-extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
+extern struct value *value_from_string (char *string);
-extern value_ptr value_from_register PARAMS ((struct type *type, int regnum,
- struct frame_info * frame));
+extern struct value *value_at (struct type *type, CORE_ADDR addr,
+ asection * sect);
-extern value_ptr value_of_variable PARAMS ((struct symbol *var,
- struct block *b));
+extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
+ asection * sect);
-extern value_ptr value_of_register PARAMS ((int regnum));
+extern struct value *value_from_register (struct type *type, int regnum,
+ struct frame_info *frame);
-extern int symbol_read_needs_frame PARAMS ((struct symbol *));
+extern struct value *value_of_variable (struct symbol *var, struct block *b);
-extern value_ptr read_var_value PARAMS ((struct symbol *var,
- struct frame_info *frame));
+extern struct value *value_of_register (int regnum);
-extern value_ptr locate_var_value PARAMS ((struct symbol *var,
- struct frame_info *frame));
+extern int symbol_read_needs_frame (struct symbol *);
-extern value_ptr allocate_value PARAMS ((struct type *type));
+extern struct value *read_var_value (struct symbol *var,
+ struct frame_info *frame);
-extern value_ptr allocate_repeat_value PARAMS ((struct type *type, int count));
+extern struct value *locate_var_value (struct symbol *var,
+ struct frame_info *frame);
-extern value_ptr value_mark PARAMS ((void));
+extern struct value *allocate_value (struct type *type);
-extern void value_free_to_mark PARAMS ((value_ptr mark));
+extern struct value *allocate_repeat_value (struct type *type, int count);
-extern value_ptr value_string PARAMS ((char *ptr, int len));
-extern value_ptr value_bitstring PARAMS ((char *ptr, int len));
+extern struct value *value_change_enclosing_type (struct value *val,
+ struct type *new_type);
-extern value_ptr value_array PARAMS ((int lowbound, int highbound,
- value_ptr *elemvec));
+extern struct value *value_mark (void);
-extern value_ptr value_concat PARAMS ((value_ptr arg1, value_ptr arg2));
+extern void value_free_to_mark (struct value *mark);
-extern value_ptr value_binop PARAMS ((value_ptr arg1, value_ptr arg2,
- enum exp_opcode op));
+extern struct value *value_string (char *ptr, int len);
+extern struct value *value_bitstring (char *ptr, int len);
-extern value_ptr value_add PARAMS ((value_ptr arg1, value_ptr arg2));
+extern struct value *value_array (int lowbound, int highbound,
+ struct value ** elemvec);
-extern value_ptr value_sub PARAMS ((value_ptr arg1, value_ptr arg2));
+extern struct value *value_concat (struct value *arg1, struct value *arg2);
-extern value_ptr value_coerce_array PARAMS ((value_ptr arg1));
+extern struct value *value_binop (struct value *arg1, struct value *arg2,
+ enum exp_opcode op);
-extern value_ptr value_coerce_function PARAMS ((value_ptr arg1));
+extern struct value *value_add (struct value *arg1, struct value *arg2);
-extern value_ptr value_ind PARAMS ((value_ptr arg1));
+extern struct value *value_sub (struct value *arg1, struct value *arg2);
-extern value_ptr value_addr PARAMS ((value_ptr arg1));
+extern struct value *value_coerce_array (struct value *arg1);
-extern value_ptr value_assign PARAMS ((value_ptr toval, value_ptr fromval));
+extern struct value *value_coerce_function (struct value *arg1);
-extern value_ptr value_neg PARAMS ((value_ptr arg1));
+extern struct value *value_ind (struct value *arg1);
-extern value_ptr value_complement PARAMS ((value_ptr arg1));
+extern struct value *value_addr (struct value *arg1);
-extern value_ptr value_struct_elt PARAMS ((value_ptr *argp, value_ptr *args,
- char *name,
- int *static_memfuncp, char *err));
+extern struct value *value_assign (struct value *toval, struct value *fromval);
-extern value_ptr value_struct_elt_for_reference PARAMS ((struct type *domain,
- int offset,
- struct type *curtype,
- char *name,
- struct type *intype));
+extern struct value *value_neg (struct value *arg1);
-extern value_ptr value_static_field PARAMS ((struct type *type, int fieldno));
+extern struct value *value_complement (struct value *arg1);
-extern struct fn_field *
-value_find_oload_method_list PARAMS ((value_ptr *, char *, int, int *, int *, struct type **, int *));
+extern struct value *value_struct_elt (struct value **argp,
+ struct value **args,
+ char *name, int *static_memfuncp,
+ char *err);
-extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
+extern struct value *value_struct_elt_for_reference (struct type *domain,
+ int offset,
+ struct type *curtype,
+ char *name,
+ struct type *intype);
-extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
- int fieldno,
- struct type *arg_type));
+extern struct value *value_static_field (struct type *type, int fieldno);
-extern struct type *
-value_rtti_type PARAMS ((value_ptr, int *, int *, int *));
+extern struct fn_field *value_find_oload_method_list (struct value **, char *,
+ int, int *, int *,
+ struct type **, int *);
-extern struct type *
-value_rtti_target_type PARAMS ((value_ptr, int *, int *, int *));
+extern int find_overload_match (struct type **arg_types, int nargs,
+ char *name, int method, int lax,
+ struct value **objp, struct symbol *fsym,
+ struct value **valp, struct symbol **symp,
+ int *staticp);
-extern value_ptr
-value_full_object PARAMS ((value_ptr, struct type *, int, int, int));
+extern struct value *value_field (struct value *arg1, int fieldno);
-extern value_ptr value_cast PARAMS ((struct type *type, value_ptr arg2));
+extern struct value *value_primitive_field (struct value *arg1, int offset,
+ int fieldno,
+ struct type *arg_type);
-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 struct type *value_rtti_target_type (struct value *, int *, int *,
+ int *);
-extern value_ptr value_subscript PARAMS ((value_ptr array, value_ptr idx));
+extern struct value *value_full_object (struct value *, struct type *, int,
+ int, int);
-extern value_ptr value_from_vtable_info PARAMS ((value_ptr arg,
- struct type *type));
+extern struct value *value_cast (struct type *type, struct value *arg2);
-extern value_ptr value_being_returned PARAMS ((struct type *valtype,
- char retbuf[REGISTER_BYTES],
- int struct_return));
+extern struct value *value_zero (struct type *type, enum lval_type lv);
-extern value_ptr value_in PARAMS ((value_ptr element, value_ptr set));
+extern struct value *value_repeat (struct value *arg1, int count);
-extern int value_bit_index PARAMS ((struct type *type, char *addr, int index));
+extern struct value *value_subscript (struct value *array, struct value *idx);
-extern int using_struct_return PARAMS ((value_ptr function, CORE_ADDR funcaddr,
- struct type *value_type, int gcc_p));
+extern struct value *value_from_vtable_info (struct value *arg,
+ struct type *type);
-extern void set_return_value PARAMS ((value_ptr val));
+extern struct value *value_being_returned (struct type *valtype,
+ char *retbuf, int struct_return);
-extern value_ptr evaluate_expression PARAMS ((struct expression *exp));
+extern struct value *value_in (struct value *element, struct value *set);
-extern value_ptr evaluate_type PARAMS ((struct expression *exp));
+extern int value_bit_index (struct type *type, char *addr, int index);
-extern value_ptr evaluate_subexp_with_coercion PARAMS ((struct expression *,
- int *, enum noside));
+extern int using_struct_return (struct value *function, CORE_ADDR funcaddr,
+ struct type *value_type, int gcc_p);
-extern value_ptr parse_and_eval PARAMS ((char *exp));
+extern void set_return_value (struct value *val);
-extern value_ptr parse_to_comma_and_eval PARAMS ((char **expp));
+extern struct value *evaluate_expression (struct expression *exp);
-extern struct type *parse_and_eval_type PARAMS ((char *p, int length));
+extern struct value *evaluate_type (struct expression *exp);
-extern CORE_ADDR parse_and_eval_address PARAMS ((char *exp));
+extern struct value *evaluate_subexp_with_coercion (struct expression *,
+ int *, enum noside);
-extern CORE_ADDR parse_and_eval_address_1 PARAMS ((char **expptr));
+extern struct value *parse_and_eval (char *exp);
-extern value_ptr access_value_history PARAMS ((int num));
+extern struct value *parse_to_comma_and_eval (char **expp);
-extern value_ptr value_of_internalvar PARAMS ((struct internalvar *var));
+extern struct type *parse_and_eval_type (char *p, int length);
-extern void set_internalvar PARAMS ((struct internalvar *var, value_ptr val));
+extern CORE_ADDR parse_and_eval_address (char *exp);
-extern void set_internalvar_component PARAMS ((struct internalvar *var,
- int offset,
- int bitpos, int bitsize,
- value_ptr newvalue));
+extern CORE_ADDR parse_and_eval_address_1 (char **expptr);
-extern struct internalvar *lookup_internalvar PARAMS ((char *name));
+extern LONGEST parse_and_eval_long (char *exp);
-extern int value_equal PARAMS ((value_ptr arg1, value_ptr arg2));
+extern struct value *access_value_history (int num);
-extern int value_less PARAMS ((value_ptr arg1, value_ptr arg2));
+extern struct value *value_of_internalvar (struct internalvar *var);
-extern int value_logical_not PARAMS ((value_ptr arg1));
-
-/* C++ */
+extern void set_internalvar (struct internalvar *var, struct value *val);
-extern value_ptr value_of_this PARAMS ((int complain));
+extern void set_internalvar_component (struct internalvar *var,
+ int offset,
+ int bitpos, int bitsize,
+ struct value *newvalue);
-extern value_ptr value_x_binop PARAMS ((value_ptr arg1, value_ptr arg2,
- enum exp_opcode op,
- enum exp_opcode otherop,
- enum noside noside));
+extern struct internalvar *lookup_internalvar (char *name);
-extern value_ptr value_x_unop PARAMS ((value_ptr arg1, enum exp_opcode op,
- enum noside noside));
+extern int value_equal (struct value *arg1, struct value *arg2);
-extern value_ptr value_fn_field PARAMS ((value_ptr *arg1p, struct fn_field *f,
- int j,
- struct type* type, int offset));
+extern int value_less (struct value *arg1, struct value *arg2);
-extern value_ptr value_virtual_fn_field PARAMS ((value_ptr *arg1p,
- struct fn_field *f, int j,
- struct type *type,
- int offset));
+extern int value_logical_not (struct value *arg1);
-extern int binop_user_defined_p PARAMS ((enum exp_opcode op,
- value_ptr arg1, value_ptr arg2));
-
-extern int unop_user_defined_p PARAMS ((enum exp_opcode op, value_ptr arg1));
+/* C++ */
-extern int destructor_name_p PARAMS ((const char *name,
- const struct type *type));
+extern struct value *value_of_this (int complain);
-#define value_free(val) free ((PTR)val)
+extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
+ enum exp_opcode op,
+ enum exp_opcode otherop,
+ enum noside noside);
-extern void free_all_values PARAMS ((void));
+extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op,
+ enum noside noside);
-extern void release_value PARAMS ((value_ptr val));
+extern struct value *value_fn_field (struct value ** arg1p, struct fn_field *f,
+ int j, struct type *type, int offset);
-extern int record_latest_value PARAMS ((value_ptr val));
+extern int binop_user_defined_p (enum exp_opcode op, struct value *arg1,
+ struct value *arg2);
-extern void registers_changed PARAMS ((void));
+extern int unop_user_defined_p (enum exp_opcode op, struct value *arg1);
-extern void read_register_bytes PARAMS ((int regbyte, char *myaddr, int len));
+extern int destructor_name_p (const char *name, const struct type *type);
-extern void write_register_bytes PARAMS ((int regbyte, char *myaddr, int len));
+#define value_free(val) xfree (val)
-extern void
-read_register_gen PARAMS ((int regno, char *myaddr));
+extern void free_all_values (void);
-extern CORE_ADDR
-read_register PARAMS ((int regno));
+extern void release_value (struct value *val);
-extern CORE_ADDR
-read_register_pid PARAMS ((int regno, int pid));
+extern int record_latest_value (struct value *val);
extern void
-write_register PARAMS ((int regno, LONGEST val));
+modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize);
-extern void
-write_register_pid PARAMS ((int regno, CORE_ADDR val, int pid));
+extern void type_print (struct type * type, char *varstring,
+ struct ui_file * stream, int show);
-extern void
-supply_register PARAMS ((int regno, char *val));
+extern char *baseclass_addr (struct type *type, int index, char *valaddr,
+ struct value **valuep, int *errp);
-extern void
-get_saved_register PARAMS ((char *raw_buffer, int *optimized,
- CORE_ADDR *addrp, struct frame_info *frame,
- int regnum, enum lval_type *lval));
+extern void print_longest (struct ui_file * stream, int format,
+ int use_local, LONGEST val);
-extern void
-modify_field PARAMS ((char *addr, LONGEST fieldval, int bitpos, int bitsize));
+extern void print_floating (char *valaddr, struct type * type,
+ struct ui_file * stream);
-extern void
-type_print PARAMS ((struct type *type, char *varstring, GDB_FILE *stream,
- int show));
+extern int value_print (struct value *val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty);
-extern char *baseclass_addr PARAMS ((struct type *type, int index,
- char *valaddr,
- value_ptr *valuep, int *errp));
+extern void value_print_array_elements (struct value *val,
+ struct ui_file *stream, int format,
+ enum val_prettyprint pretty);
-extern void
-print_longest PARAMS ((GDB_FILE *stream, int format, int use_local,
- LONGEST val));
+extern struct value *value_release_to_mark (struct value *mark);
-extern void
-print_floating PARAMS ((char *valaddr, struct type *type, GDB_FILE *stream));
+extern int val_print (struct type * type, char *valaddr,
+ int embedded_offset, CORE_ADDR address,
+ struct ui_file * stream, int format,
+ int deref_ref, int recurse,
+ enum val_prettyprint pretty);
-extern int value_print PARAMS ((value_ptr val, GDB_FILE *stream, int format,
- enum val_prettyprint pretty));
+extern int val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream);
-extern void
-value_print_array_elements PARAMS ((value_ptr val, GDB_FILE* stream,
- int format, enum val_prettyprint pretty));
+extern void print_variable_value (struct symbol * var,
+ struct frame_info * frame,
+ struct ui_file *stream);
-extern value_ptr
-value_release_to_mark PARAMS ((value_ptr mark));
+extern int check_field (struct value *, const char *);
-extern int
-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 void typedef_print (struct type * type, struct symbol * news,
+ struct ui_file * stream);
-extern int
-val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE *stream));
+extern char *internalvar_name (struct internalvar *var);
-extern void
-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 clear_value_history (void);
-extern void
-c_typedef_print PARAMS ((struct type *type, struct symbol *news, GDB_FILE *stream));
+extern void clear_internalvars (void);
-extern char *
-internalvar_name PARAMS ((struct internalvar *var));
-
-extern void
-clear_value_history PARAMS ((void));
+/* From values.c */
-extern void
-clear_internalvars PARAMS ((void));
+extern struct value *value_copy (struct value *);
-/* From values.c */
+/* From valops.c */
-extern value_ptr value_copy PARAMS ((value_ptr));
+extern struct value *varying_to_slice (struct value *);
-extern int baseclass_offset PARAMS ((struct type *, int, char *, CORE_ADDR));
+extern struct value *value_slice (struct value *, int, int);
-/* From valops.c */
+extern struct value *call_function_by_hand (struct value *, int,
+ struct value **);
-extern value_ptr varying_to_slice PARAMS ((value_ptr));
+extern int default_coerce_float_to_double (struct type *, struct type *);
-extern value_ptr value_slice PARAMS ((value_ptr, int, int));
+extern int standard_coerce_float_to_double (struct type *, struct type *);
-extern value_ptr call_function_by_hand PARAMS ((value_ptr, int, value_ptr *));
+extern struct value *value_literal_complex (struct value *, struct value *,
+ struct type *);
-extern value_ptr value_literal_complex PARAMS ((value_ptr, value_ptr, struct type*));
+extern void find_rt_vbase_offset (struct type *, struct type *, char *, int,
+ int *, int *);
-extern void find_rt_vbase_offset PARAMS ((struct type *, struct type *, char *, int, int *, int *));
+extern struct value *find_function_in_inferior (char *);
-extern value_ptr find_function_in_inferior PARAMS ((char *));
+extern struct value *value_allocate_space_in_inferior (int);
-extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
+extern CORE_ADDR default_push_arguments (int nargs, struct value ** args,
+ CORE_ADDR sp, int struct_return,
+ CORE_ADDR struct_addr);
-#endif /* !defined (VALUE_H) */
+#endif /* !defined (VALUE_H) */
diff --git a/contrib/gdb/gdb/values.c b/contrib/gdb/gdb/values.c
index c7053b8..9445d9c 100644
--- a/contrib/gdb/gdb/values.c
+++ b/contrib/gdb/gdb/values.c
@@ -1,22 +1,24 @@
/* Low level packing and unpacking of values for GDB, the GNU Debugger.
- Copyright 1986, 87, 89, 91, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2002.
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ 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,28 +26,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbtypes.h"
#include "value.h"
#include "gdbcore.h"
-#include "frame.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "language.h"
#include "scm-lang.h"
#include "demangle.h"
+#include "doublest.h"
+#include "gdb_assert.h"
/* Prototypes for exported functions. */
-void _initialize_values PARAMS ((void));
+void _initialize_values (void);
/* Prototypes for local functions. */
-static value_ptr value_headof PARAMS ((value_ptr, struct type *,
- struct type *));
+static struct value *value_headof (struct value *, struct type *, struct type *);
-static void show_values PARAMS ((char *, int));
+static void show_values (char *, int);
-static void show_convenience PARAMS ((char *, int));
+static void show_convenience (char *, int);
-static int vb_match PARAMS ((struct type *, int, struct type *));
/* The value-history records all the values printed
by print commands during this session. Each chunk
@@ -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;
+ struct value *values[VALUE_HISTORY_CHUNK];
+ };
/* Chain of chunks now in use. */
@@ -71,15 +72,14 @@ static int value_history_count; /* Abs number of last entry stored */
(except for those released by calls to release_value)
This is so they can be freed after each command. */
-static value_ptr all_values;
+static struct value *all_values;
/* Allocate a value that has the correct length for type TYPE. */
-value_ptr
-allocate_value (type)
- struct type *type;
+struct value *
+allocate_value (struct type *type)
{
- register value_ptr val;
+ struct value *val;
struct type *atype = check_typedef (type);
val = (struct value *) xmalloc (sizeof (struct value) + TYPE_LENGTH (atype));
@@ -106,17 +106,15 @@ allocate_value (type)
/* Allocate a value that has the correct length
for COUNT repetitions type TYPE. */
-value_ptr
-allocate_repeat_value (type, count)
- struct type *type;
- int count;
+struct value *
+allocate_repeat_value (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,
@@ -126,8 +124,8 @@ allocate_repeat_value (type, count)
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
if a subsequent value_free_to_mark is passed the mark. */
-value_ptr
-value_mark ()
+struct value *
+value_mark (void)
{
return all_values;
}
@@ -135,10 +133,10 @@ value_mark ()
/* Free all values allocated since MARK was obtained by value_mark
(except for those released). */
void
-value_free_to_mark (mark)
- value_ptr mark;
+value_free_to_mark (struct value *mark)
{
- value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = all_values; val && val != mark; val = next)
{
@@ -152,9 +150,10 @@ value_free_to_mark (mark)
Called after each command, successful or not. */
void
-free_all_values ()
+free_all_values (void)
{
- register value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = all_values; val; val = next)
{
@@ -169,10 +168,9 @@ free_all_values ()
so it will not be freed automatically. */
void
-release_value (val)
- register value_ptr val;
+release_value (struct value *val)
{
- register value_ptr v;
+ struct value *v;
if (all_values == val)
{
@@ -191,11 +189,11 @@ release_value (val)
}
/* Release all values up to mark */
-value_ptr
-value_release_to_mark (mark)
- value_ptr mark;
+struct value *
+value_release_to_mark (struct value *mark)
{
- value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = next = all_values; next; next = VALUE_NEXT (next))
if (VALUE_NEXT (next) == mark)
@@ -212,12 +210,11 @@ value_release_to_mark (mark)
It contains the same contents, for same memory address,
but it's a different block of storage. */
-value_ptr
-value_copy (arg)
- value_ptr arg;
+struct value *
+value_copy (struct value *arg)
{
register struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
- register value_ptr val = allocate_value (encl_type);
+ struct value *val = allocate_value (encl_type);
VALUE_TYPE (val) = VALUE_TYPE (arg);
VALUE_LVAL (val) = VALUE_LVAL (arg);
VALUE_ADDRESS (val) = VALUE_ADDRESS (arg);
@@ -249,8 +246,7 @@ value_copy (arg)
value history index of this new item. */
int
-record_latest_value (val)
- value_ptr val;
+record_latest_value (struct value *val)
{
int i;
@@ -272,9 +268,9 @@ record_latest_value (val)
i = value_history_count % VALUE_HISTORY_CHUNK;
if (i == 0)
{
- register struct value_history_chunk *new
- = (struct value_history_chunk *)
- xmalloc (sizeof (struct value_history_chunk));
+ struct value_history_chunk *new
+ = (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;
@@ -290,11 +286,10 @@ record_latest_value (val)
/* Return a copy of the value in the history with sequence number NUM. */
-value_ptr
-access_value_history (num)
- int num;
+struct value *
+access_value_history (int num)
{
- register struct value_history_chunk *chunk;
+ struct value_history_chunk *chunk;
register int i;
register int absnum = num;
@@ -330,39 +325,37 @@ access_value_history (num)
because the type pointers become invalid. */
void
-clear_value_history ()
+clear_value_history (void)
{
- register struct value_history_chunk *next;
+ struct value_history_chunk *next;
register int i;
- register value_ptr val;
+ struct value *val;
while (value_history_chain)
{
for (i = 0; i < VALUE_HISTORY_CHUNK; i++)
if ((val = value_history_chain->values[i]) != NULL)
- free ((PTR)val);
+ xfree (val);
next = value_history_chain->next;
- free ((PTR)value_history_chain);
+ xfree (value_history_chain);
value_history_chain = next;
}
value_history_count = 0;
}
static void
-show_values (num_exp, from_tty)
- char *num_exp;
- int from_tty;
+show_values (char *num_exp, int from_tty)
{
register int i;
- register value_ptr val;
+ struct value *val;
static int num = 1;
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;
+ num = parse_and_eval_long (num_exp) - 5;
}
else
{
@@ -408,8 +401,7 @@ static struct internalvar *internalvars;
one is created, with a void value. */
struct internalvar *
-lookup_internalvar (name)
- char *name;
+lookup_internalvar (char *name)
{
register struct internalvar *var;
@@ -426,16 +418,15 @@ lookup_internalvar (name)
return var;
}
-value_ptr
-value_of_internalvar (var)
- struct internalvar *var;
+struct value *
+value_of_internalvar (struct internalvar *var)
{
- register value_ptr val;
+ struct value *val;
#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))
@@ -446,10 +437,8 @@ value_of_internalvar (var)
}
void
-set_internalvar_component (var, offset, bitpos, bitsize, newval)
- struct internalvar *var;
- int offset, bitpos, bitsize;
- value_ptr newval;
+set_internalvar_component (struct internalvar *var, int offset, int bitpos,
+ int bitsize, struct value *newval)
{
register char *addr = VALUE_CONTENTS (var->value) + offset;
@@ -466,11 +455,9 @@ set_internalvar_component (var, offset, bitpos, bitsize, newval)
}
void
-set_internalvar (var, val)
- struct internalvar *var;
- value_ptr val;
+set_internalvar (struct internalvar *var, struct value *val)
{
- value_ptr newval;
+ struct value *newval;
#ifdef IS_TRAPPED_INTERNALVAR
if (IS_TRAPPED_INTERNALVAR (var->name))
@@ -492,15 +479,14 @@ 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);
+ xfree (var->value);
var->value = newval;
release_value (newval);
/* End code which must not call error(). */
}
char *
-internalvar_name (var)
- struct internalvar *var;
+internalvar_name (struct internalvar *var)
{
return var->name;
}
@@ -509,7 +495,7 @@ internalvar_name (var)
because that makes the values invalid. */
void
-clear_internalvars ()
+clear_internalvars (void)
{
register struct internalvar *var;
@@ -517,16 +503,14 @@ clear_internalvars ()
{
var = internalvars;
internalvars = var->next;
- free ((PTR)var->name);
- free ((PTR)var->value);
- free ((PTR)var);
+ xfree (var->name);
+ xfree (var->value);
+ xfree (var);
}
}
static void
-show_convenience (ignore, from_tty)
- char *ignore;
- int from_tty;
+show_convenience (char *ignore, int from_tty)
{
register struct internalvar *var;
int varseen = 0;
@@ -557,8 +541,7 @@ use \"set\" as in \"set $foo = 5\" to define them.\n");
Does not deallocate the value. */
LONGEST
-value_as_long (val)
- register value_ptr val;
+value_as_long (struct value *val)
{
/* This coerces arrays and functions, which is necessary (e.g.
in disassemble_command). It also dereferences references, which
@@ -568,22 +551,21 @@ value_as_long (val)
}
DOUBLEST
-value_as_double (val)
- register value_ptr val;
+value_as_double (struct value *val)
{
DOUBLEST foo;
int inv;
-
+
foo = unpack_double (VALUE_TYPE (val), VALUE_CONTENTS (val), &inv);
if (inv)
error ("Invalid floating value found in program.");
return foo;
}
-/* Extract a value as a C pointer.
- Does not deallocate the value. */
+/* Extract a value as a C pointer. Does not deallocate the value.
+ Note that val's type may not actually be a pointer; value_as_long
+ handles all the cases. */
CORE_ADDR
-value_as_pointer (val)
- value_ptr val;
+value_as_address (struct value *val)
{
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
@@ -591,9 +573,95 @@ 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);
+
+ /* There are several targets (IA-64, PowerPC, and others) which
+ don't represent pointers to functions as simply the address of
+ the function's entry point. For example, on the IA-64, a
+ function pointer points to a two-word descriptor, generated by
+ the linker, which contains the function's entry point, and the
+ value the IA-64 "global pointer" register should have --- to
+ support position-independent code. The linker generates
+ descriptors only for those functions whose addresses are taken.
+
+ On such targets, it's difficult for GDB to convert an arbitrary
+ function address into a function pointer; it has to either find
+ an existing descriptor for that function, or call malloc and
+ build its own. On some targets, it is impossible for GDB to
+ build a descriptor at all: the descriptor must contain a jump
+ instruction; data memory cannot be executed; and code memory
+ cannot be modified.
+
+ Upon entry to this function, if VAL is a value of type `function'
+ (that is, TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC), then
+ VALUE_ADDRESS (val) is the address of the function. This is what
+ you'll get if you evaluate an expression like `main'. The call
+ to COERCE_ARRAY below actually does all the usual unary
+ conversions, which includes converting values of type `function'
+ to `pointer to function'. This is the challenging conversion
+ discussed above. Then, `unpack_long' will convert that pointer
+ back into an address.
+
+ So, suppose the user types `disassemble foo' on an architecture
+ with a strange function pointer representation, on which GDB
+ cannot build its own descriptors, and suppose further that `foo'
+ has no linker-built descriptor. The address->pointer conversion
+ will signal an error and prevent the command from running, even
+ though the next step would have been to convert the pointer
+ directly back into the same address.
+
+ The following shortcut avoids this whole mess. If VAL is a
+ function, just return its address directly. */
+ if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
+ || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_METHOD)
+ return VALUE_ADDRESS (val);
+
+ COERCE_ARRAY (val);
+
+ /* Some architectures (e.g. Harvard), map instruction and data
+ addresses onto a single large unified address space. For
+ instance: An architecture may consider a large integer in the
+ range 0x10000000 .. 0x1000ffff to already represent a data
+ addresses (hence not need a pointer to address conversion) while
+ a small integer would still need to be converted integer to
+ pointer to address. Just assume such architectures handle all
+ integer conversions in a single function. */
+
+ /* JimB writes:
+
+ I think INTEGER_TO_ADDRESS is a good idea as proposed --- but we
+ must admonish GDB hackers to make sure its behavior matches the
+ compiler's, whenever possible.
+
+ In general, I think GDB should evaluate expressions the same way
+ the compiler does. When the user copies an expression out of
+ their source code and hands it to a `print' command, they should
+ get the same value the compiler would have computed. Any
+ deviation from this rule can cause major confusion and annoyance,
+ and needs to be justified carefully. In other words, GDB doesn't
+ really have the freedom to do these conversions in clever and
+ useful ways.
+
+ AndrewC pointed out that users aren't complaining about how GDB
+ casts integers to pointers; they are complaining that they can't
+ take an address from a disassembly listing and give it to `x/i'.
+ This is certainly important.
+
+ Adding an architecture method like INTEGER_TO_ADDRESS certainly
+ makes it possible for GDB to "get it right" in all circumstances
+ --- the target has complete control over how things get done, so
+ people can Do The Right Thing for their target without breaking
+ anyone else. The standard doesn't specify how integers get
+ converted to pointers; usually, the ABI doesn't either, but
+ ABI-specific code is a more reasonable place to handle it. */
+
+ if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_PTR
+ && TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_REF
+ && INTEGER_TO_ADDRESS_P ())
+ return INTEGER_TO_ADDRESS (VALUE_TYPE (val), VALUE_CONTENTS (val));
+
+ return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val));
#endif
}
@@ -612,9 +680,7 @@ value_as_pointer (val)
to an INT (or some size). After all, it is only an offset. */
LONGEST
-unpack_long (type, valaddr)
- struct type *type;
- char *valaddr;
+unpack_long (struct type *type, char *valaddr)
{
register enum type_code code = TYPE_CODE (type);
register int len = TYPE_LENGTH (type);
@@ -639,17 +705,13 @@ unpack_long (type, valaddr)
return extract_signed_integer (valaddr, len);
case TYPE_CODE_FLT:
- return extract_floating (valaddr, len);
+ return extract_typed_floating (valaddr, type);
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. */
-#ifdef GDB_TARGET_IS_D10V
- if (len == 2)
- return D10V_MAKE_DADDR(extract_address (valaddr, len));
-#endif
- return extract_address (valaddr, len);
+ whether we want this to be true eventually. */
+ return extract_typed_address (valaddr, type);
case TYPE_CODE_MEMBER:
error ("not implemented: member types in unpack_long");
@@ -657,7 +719,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.
@@ -667,10 +729,7 @@ unpack_long (type, valaddr)
format, result is in host format. */
DOUBLEST
-unpack_double (type, valaddr, invp)
- struct type *type;
- char *valaddr;
- int *invp;
+unpack_double (struct type *type, char *valaddr, int *invp)
{
enum type_code code;
int len;
@@ -683,24 +742,28 @@ unpack_double (type, valaddr, invp)
nosign = TYPE_UNSIGNED (type);
if (code == TYPE_CODE_FLT)
{
-#ifdef INVALID_FLOAT
- if (INVALID_FLOAT (valaddr, len))
- {
- *invp = 1;
- return 1.234567891011121314;
- }
-#endif
- return extract_floating (valaddr, len);
+ /* NOTE: cagney/2002-02-19: There was a test here to see if the
+ floating-point value was valid (using the macro
+ INVALID_FLOAT). That test/macro have been removed.
+
+ It turns out that only the VAX defined this macro and then
+ only in a non-portable way. Fixing the portability problem
+ wouldn't help since the VAX floating-point code is also badly
+ bit-rotten. The target needs to add definitions for the
+ methods TARGET_FLOAT_FORMAT and TARGET_DOUBLE_FORMAT - these
+ exactly describe the target floating-point format. The
+ problem here is that the corresponding floatformat_vax_f and
+ floatformat_vax_d values these methods should be set to are
+ also not defined either. Oops!
+
+ Hopefully someone will add both the missing floatformat
+ definitions and floatformat_is_invalid() function. */
+ return extract_typed_floating (valaddr, type);
}
else if (nosign)
{
/* Unsigned -- be sure we compensate for signed LONGEST. */
-#if !defined (_MSC_VER) || (_MSC_VER > 900)
return (ULONGEST) unpack_long (type, valaddr);
-#else
- /* FIXME!!! msvc22 doesn't support unsigned __int64 -> double */
- return (LONGEST) unpack_long (type, valaddr);
-#endif /* _MSC_VER */
}
else
{
@@ -715,7 +778,7 @@ unpack_double (type, valaddr, invp)
host byte order.
If you want functions and arrays to be coerced to pointers, and
- references to be dereferenced, call value_as_pointer() instead.
+ references to be dereferenced, call value_as_address() instead.
C++: It is assumed that the front-end has taken care of
all matters concerning pointers to members. A pointer
@@ -723,21 +786,18 @@ unpack_double (type, valaddr, invp)
to an INT (or some size). After all, it is only an offset. */
CORE_ADDR
-unpack_pointer (type, valaddr)
- struct type *type;
- char *valaddr;
+unpack_pointer (struct type *type, char *valaddr)
{
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
return unpack_long (type, valaddr);
}
+
/* Get the value of the FIELDN'th field (which must be static) of TYPE. */
-value_ptr
-value_static_field (type, fieldno)
- struct type *type;
- int fieldno;
+struct value *
+value_static_field (struct type *type, int fieldno)
{
CORE_ADDR addr;
asection *sect;
@@ -753,39 +813,87 @@ 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);
}
}
else
{
- addr = SYMBOL_VALUE_ADDRESS (sym);
- sect = SYMBOL_BFD_SECTION (sym);
- }
+ /* Anything static that isn't a constant, has an address */
+ if (SYMBOL_CLASS (sym) != LOC_CONST)
+ {
+ addr = SYMBOL_VALUE_ADDRESS (sym);
+ sect = SYMBOL_BFD_SECTION (sym);
+ }
+ /* However, static const's do not, the value is already known. */
+ else
+ {
+ return value_from_longest (TYPE_FIELD_TYPE (type, fieldno), SYMBOL_VALUE (sym));
+ }
+ }
SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno), addr);
}
return value_at (TYPE_FIELD_TYPE (type, fieldno), addr, sect);
}
+/* Change the enclosing type of a value object VAL to NEW_ENCL_TYPE.
+ You have to be careful here, since the size of the data area for the value
+ is set by the length of the enclosing type. So if NEW_ENCL_TYPE is bigger
+ than the old enclosing type, you have to allocate more space for the data.
+ The return value is a pointer to the new version of this value structure. */
+
+struct value *
+value_change_enclosing_type (struct value *val, struct type *new_encl_type)
+{
+ if (TYPE_LENGTH (new_encl_type) <= TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)))
+ {
+ VALUE_ENCLOSING_TYPE (val) = new_encl_type;
+ return val;
+ }
+ else
+ {
+ struct value *new_val;
+ struct value *prev;
+
+ new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type));
+
+ /* We have to make sure this ends up in the same place in the value
+ chain as the original copy, so it's clean-up behavior is the same.
+ If the value has been released, this is a waste of time, but there
+ is no way to tell that in advance, so... */
+
+ if (val != all_values)
+ {
+ for (prev = all_values; prev != NULL; prev = prev->next)
+ {
+ if (prev->next == val)
+ {
+ prev->next = new_val;
+ break;
+ }
+ }
+ }
+
+ return new_val;
+ }
+}
+
/* Given a value ARG1 (offset by OFFSET bytes)
of a struct or union type ARG_TYPE,
extract and return the value of one of its (non-static) fields.
FIELDNO says which field. */
-value_ptr
-value_primitive_field (arg1, offset, fieldno, arg_type)
- register value_ptr arg1;
- int offset;
- register int fieldno;
- register struct type *arg_type;
+struct value *
+value_primitive_field (struct value *arg1, int offset,
+ register int fieldno, register struct type *arg_type)
{
- register value_ptr v;
+ struct value *v;
register struct type *type;
CHECK_TYPEDEF (arg_type);
@@ -798,10 +906,12 @@ 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);
+ VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
+ + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
}
else if (fieldno < TYPE_N_BASECLASSES (arg_type))
{
@@ -809,7 +919,7 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
entire object's contents for later references to virtual
bases, etc. */
v = allocate_value (VALUE_ENCLOSING_TYPE (arg1));
- VALUE_TYPE (v) = arg_type;
+ VALUE_TYPE (v) = type;
if (VALUE_LAZY (arg1))
VALUE_LAZY (v) = 1;
else
@@ -817,9 +927,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
{
@@ -832,14 +942,16 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
memcpy (VALUE_CONTENTS_RAW (v),
VALUE_CONTENTS_RAW (arg1) + offset,
TYPE_LENGTH (type));
- VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset;
+ VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
+ + VALUE_EMBEDDED_OFFSET (arg1);
}
VALUE_LVAL (v) = VALUE_LVAL (arg1);
if (VALUE_LVAL (arg1) == lval_internalvar)
VALUE_LVAL (v) = lval_internalvar_component;
VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
+ VALUE_REGNO (v) = VALUE_REGNO (arg1);
/* VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
- + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
+ + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
return v;
}
@@ -847,251 +959,65 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
extract and return the value of one of its (non-static) fields.
FIELDNO says which field. */
-value_ptr
-value_field (arg1, fieldno)
- register value_ptr arg1;
- register int fieldno;
+struct value *
+value_field (struct value *arg1, register int fieldno)
{
return value_primitive_field (arg1, 0, fieldno, VALUE_TYPE (arg1));
}
/* Return a non-virtual function as a value.
F is the list of member functions which contains the desired method.
- J is an index into F which provides the desired method. */
-
-value_ptr
-value_fn_field (arg1p, f, j, type, offset)
- value_ptr *arg1p;
- struct fn_field *f;
- int j;
- struct type *type;
- int offset;
+ J is an index into F which provides the desired method.
+
+ We only use the symbol for its address, so be happy with either a
+ full symbol or a minimal symbol.
+ */
+
+struct value *
+value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type,
+ int offset)
{
- register value_ptr v;
+ struct value *v;
register struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
+ char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
struct symbol *sym;
+ struct minimal_symbol *msym;
- sym = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
- 0, VAR_NAMESPACE, 0, NULL);
- if (! sym)
+ sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
+ if (sym != NULL)
+ {
+ msym = NULL;
+ }
+ else
+ {
+ gdb_assert (sym == NULL);
+ msym = lookup_minimal_symbol (physname, NULL, NULL);
+ if (msym == NULL)
return NULL;
-/*
- 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;
- */
}
- return v;
-}
-
-/* Return a virtual function as a value.
- ARG1 is the object which provides the virtual function
- table pointer. *ARG1P is side-effected in calling this function.
- F is the list of member functions which contains the desired virtual
- function.
- J is an index into F which provides the desired virtual function.
-
- TYPE is the type in which F is located. */
-value_ptr
-value_virtual_fn_field (arg1p, f, j, type, offset)
- value_ptr *arg1p;
- struct fn_field *f;
- int j;
- struct type *type;
- int offset;
-{
- value_ptr arg1 = *arg1p;
- struct type *type1 = check_typedef (VALUE_TYPE (arg1));
-
- if (TYPE_HAS_VTABLE (type))
+ v = allocate_value (ftype);
+ if (sym)
{
- /* 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 */
-
- argp = value_cast (type, *arg1p);
-
- if (VALUE_ADDRESS (argp) == 0)
- 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)); */
-
- if (!coreptr)
- 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. */
- }
- 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.) */
-
- }
-
- if (!coreptr)
- error ("Address of virtual function is null; error in virtual table?");
-
- /* 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;
+ VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
+ }
+ else
+ {
+ VALUE_ADDRESS (v) = SYMBOL_VALUE_ADDRESS (msym);
}
- 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));
- 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);
- 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));
- }
-
- context = type1;
- /* Now context is the basetype containing the vtbl. */
-
- /* This type may have been defined before its virtual function table
- 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);
-
- /* 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. */
- if (TYPE_CODE (VALUE_TYPE (vtbl)) == TYPE_CODE_PTR
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (vtbl))) == TYPE_CODE_ARRAY)
- {
- /* Handle the case where the vtbl field points to an
- array of structures. */
- vtbl = value_ind (vtbl);
-
- /* Index into the virtual function table. This is hard-coded because
- looking up a field is not cheap, and it may be important to save
- time, e.g. if the user has set a conditional breakpoint calling
- a virtual function. */
- entry = value_subscript (vtbl, vi);
- }
- else
- {
- /* Handle the case where the vtbl field points directly to a structure. */
- vtbl = value_add (vtbl, vi);
- entry = value_ind (vtbl);
- }
-
- 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);
- }
- else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
- vfn = entry;
- else
- 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));
+ if (arg1p)
+ {
+ if (type != VALUE_TYPE (*arg1p))
+ *arg1p = value_ind (value_cast (lookup_pointer_type (type),
+ value_addr (*arg1p)));
- *arg1p = arg1;
- return vfn;
+ /* Move the `this' pointer according to the offset.
+ VALUE_OFFSET (*arg1p) += offset;
+ */
}
+
+ return v;
}
/* ARG is a pointer to an object we know to be at least
@@ -1101,20 +1027,20 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
return the most derived type we find. The caller must
be satisfied when the return value == DTYPE.
- FIXME-tiemann: should work with dossier entries as well. */
+ FIXME-tiemann: should work with dossier entries as well.
+ NOTICE - djb: I see no good reason at all to keep this function now that
+ we have RTTI support. It's used in literally one place, and it's
+ hard to keep this function up to date when it's purpose is served
+ by value_rtti_type efficiently.
+ Consider it gone for 5.1. */
-static value_ptr
-value_headof (in_arg, btype, dtype)
- value_ptr in_arg;
- struct type *btype, *dtype;
+static struct value *
+value_headof (struct value *in_arg, struct type *btype, struct type *dtype)
{
/* First collect the vtables we must look at for this object. */
- /* FIXME-tiemann: right now, just look at top-most vtable. */
- value_ptr arg, vtbl, entry, best_entry = 0;
- int i, nelems;
- int offset, best_offset = 0;
+ struct value *arg;
+ struct value *vtbl;
struct symbol *sym;
- CORE_ADDR pc_for_sym;
char *demangled_name;
struct minimal_symbol *msymbol;
@@ -1122,71 +1048,45 @@ value_headof (in_arg, btype, dtype)
CHECK_TYPEDEF (btype);
arg = in_arg;
if (btype != dtype)
- arg = value_cast (lookup_pointer_type (btype), arg);
+ arg = value_cast (lookup_pointer_type (btype), arg);
+ if (TYPE_CODE (VALUE_TYPE (arg)) == 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.
+ */
+ arg = value_copy (arg);
+ VALUE_TYPE (arg) = lookup_pointer_type (TYPE_TARGET_TYPE (VALUE_TYPE (arg)));
+ }
+ if (VALUE_ADDRESS(value_field (value_ind(arg), TYPE_VPTR_FIELDNO (btype)))==0)
+ return arg;
+
vtbl = value_ind (value_field (value_ind (arg), TYPE_VPTR_FIELDNO (btype)));
+ /* Turn vtable into typeinfo function */
+ VALUE_OFFSET(vtbl)+=4;
- /* Check that VTBL looks like it points to a virtual function table. */
- msymbol = lookup_minimal_symbol_by_pc (VALUE_ADDRESS (vtbl));
+ msymbol = lookup_minimal_symbol_by_pc ( value_as_address(value_ind(vtbl)) );
if (msymbol == NULL
- || (demangled_name = SYMBOL_NAME (msymbol)) == NULL
- || !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));
- memcpy (error_type, VALUE_TYPE (in_arg), sizeof (struct type));
- TYPE_NAME (error_type) = savestring ("suspicious *", sizeof ("suspicious *"));
- VALUE_TYPE (in_arg) = error_type;
- return in_arg;
- }
+ || (demangled_name = SYMBOL_NAME (msymbol)) == NULL)
+ {
+ /* 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));
+ memcpy (error_type, VALUE_TYPE (in_arg), sizeof (struct type));
+ TYPE_NAME (error_type) = savestring ("suspicious *", sizeof ("suspicious *"));
+ VALUE_TYPE (in_arg) = error_type;
+ return in_arg;
+ }
+ demangled_name = cplus_demangle(demangled_name,DMGL_ANSI);
+ *(strchr (demangled_name, ' ')) = '\0';
- /* Now search through the virtual function table. */
- entry = value_ind (vtbl);
- 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));
- /* This won't work if we're using thunks. */
- if (TYPE_CODE (check_typedef (VALUE_TYPE (entry))) != TYPE_CODE_STRUCT)
- break;
- offset = longest_to_int (value_as_long (value_field (entry, 0)));
- /* If we use '<=' we can handle single inheritance
- * where all offsets are zero - just use the first entry found. */
- if (offset <= best_offset)
- {
- best_offset = offset;
- best_entry = entry;
- }
- }
- /* Move the pointer according to BEST_ENTRY's offset, and figure
- out what type we should return as the new pointer. */
- if (best_entry == 0)
- {
- /* An alternative method (which should no longer be necessary).
- * 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. */
- }
- else
- {
- pc_for_sym = value_as_pointer (value_field (best_entry, 2));
- sym = find_pc_function (pc_for_sym);
- demangled_name = cplus_demangle (SYMBOL_NAME (sym), DMGL_ANSI);
- *(strchr (demangled_name, ':')) = '\0';
- }
sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0);
if (sym == NULL)
- error ("could not find type declaration for `%s'", demangled_name);
- if (best_entry)
- {
- free (demangled_name);
- arg = value_add (value_cast (builtin_type_int, arg),
- value_field (best_entry, 0));
- }
- else arg = in_arg;
+ error ("could not find type declaration for `%s'", demangled_name);
+
+ arg = in_arg;
VALUE_TYPE (arg) = lookup_pointer_type (SYMBOL_TYPE (sym));
return arg;
}
@@ -1196,10 +1096,8 @@ value_headof (in_arg, btype, dtype)
of its baseclasses) to figure out the most derived type that ARG
could actually be a pointer to. */
-value_ptr
-value_from_vtable_info (arg, type)
- value_ptr arg;
- struct type *type;
+struct value *
+value_from_vtable_info (struct value *arg, struct type *type)
{
/* Take care of preliminaries. */
if (TYPE_VPTR_FIELDNO (type) < 0)
@@ -1209,107 +1107,6 @@ value_from_vtable_info (arg, type)
return value_headof (arg, 0, type);
}
-
-/* Return true if the INDEXth field of TYPE is a virtual baseclass
- pointer which is for the base class whose type is BASECLASS. */
-
-static int
-vb_match (type, index, basetype)
- struct type *type;
- int index;
- struct type *basetype;
-{
- struct type *fieldtype;
- char *name = TYPE_FIELD_NAME (type, index);
- char *field_class_name = NULL;
-
- if (*name != '_')
- return 0;
- /* gcc 2.4 uses _vb$. */
- if (name[1] == 'v' && name[2] == 'b' && is_cplus_marker (name[3]))
- field_class_name = name + 4;
- /* gcc 2.5 will use __vb_. */
- if (name[1] == '_' && name[2] == 'v' && name[3] == 'b' && name[4] == '_')
- field_class_name = name + 5;
-
- if (field_class_name == NULL)
- /* This field is not a virtual base class pointer. */
- return 0;
-
- /* It's a virtual baseclass pointer, now we just need to find out whether
- it is for this baseclass. */
- fieldtype = TYPE_FIELD_TYPE (type, index);
- if (fieldtype == NULL
- || TYPE_CODE (fieldtype) != TYPE_CODE_PTR)
- /* "Can't happen". */
- return 0;
-
- /* What we check for is that either the types are equal (needed for
- nameless types) or have the same name. This is ugly, and a more
- elegant solution should be devised (which would probably just push
- the ugliness into symbol reading unless we change the stabs format). */
- if (TYPE_TARGET_TYPE (fieldtype) == basetype)
- return 1;
-
- if (TYPE_NAME (basetype) != NULL
- && TYPE_NAME (TYPE_TARGET_TYPE (fieldtype)) != NULL
- && STREQ (TYPE_NAME (basetype),
- TYPE_NAME (TYPE_TARGET_TYPE (fieldtype))))
- return 1;
- return 0;
-}
-
-/* Compute the offset of the baseclass which is
- the INDEXth baseclass of class TYPE,
- for value at VALADDR (in host) at ADDRESS (in target).
- The result is the offset of the baseclass value relative
- to (the address of)(ARG) + OFFSET.
-
- -1 is returned on error. */
-
-int
-baseclass_offset (type, index, valaddr, address)
- struct type *type;
- int index;
- char *valaddr;
- CORE_ADDR address;
-{
- struct type *basetype = TYPE_BASECLASS (type, index);
-
- if (BASETYPE_VIA_VIRTUAL (type, index))
- {
- /* Must hunt for the pointer to this virtual baseclass. */
- register int i, len = TYPE_NFIELDS (type);
- register int n_baseclasses = TYPE_N_BASECLASSES (type);
-
- /* First look for the virtual baseclass pointer
- 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));
-
- return addr - (LONGEST) address;
- }
- }
- /* Not in the fields, so try looking through the baseclasses. */
- for (i = index+1; i < n_baseclasses; i++)
- {
- int boffset =
- baseclass_offset (type, i, valaddr, address);
- if (boffset)
- return boffset;
- }
- /* Not found. */
- return -1;
- }
-
- /* Baseclass is easily computed. */
- return TYPE_BASECLASS_BITPOS (type, index) / 8;
-}
/* Unpack a field FIELDNO of the specified TYPE, from the anonymous object at
VALADDR.
@@ -1326,10 +1123,7 @@ baseclass_offset (type, index, valaddr, address)
If the field is signed, we also do sign extension. */
LONGEST
-unpack_field_as_long (type, valaddr, fieldno)
- struct type *type;
- char *valaddr;
- int fieldno;
+unpack_field_as_long (struct type *type, char *valaddr, int fieldno)
{
ULONGEST val;
ULONGEST valmask;
@@ -1374,10 +1168,7 @@ unpack_field_as_long (type, valaddr, fieldno)
indicate which bits (in target bit order) comprise the bitfield. */
void
-modify_field (addr, fieldval, bitpos, bitsize)
- char *addr;
- LONGEST fieldval;
- int bitpos, bitsize;
+modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize)
{
LONGEST oword;
@@ -1389,10 +1180,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. */
@@ -1407,9 +1198,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);
@@ -1417,15 +1208,13 @@ modify_field (addr, fieldval, bitpos, bitsize)
/* Convert C numbers into newly allocated values */
-value_ptr
-value_from_longest (type, num)
- struct type *type;
- register LONGEST num;
+struct value *
+value_from_longest (struct type *type, register LONGEST num)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
register enum type_code code;
register int len;
- retry:
+retry:
code = TYPE_CODE (type);
len = TYPE_LENGTH (type);
@@ -1441,33 +1230,66 @@ 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. */
- store_address (VALUE_CONTENTS_RAW (val), len, (CORE_ADDR) num);
+ store_typed_address (VALUE_CONTENTS_RAW (val), type, (CORE_ADDR) num);
break;
-
+
default:
error ("Unexpected type (%d) encountered for integer constant.", code);
}
return val;
}
-value_ptr
-value_from_double (type, num)
- struct type *type;
- DOUBLEST num;
+
+/* Create a value representing a pointer of type TYPE to the address
+ ADDR. */
+struct value *
+value_from_pointer (struct type *type, CORE_ADDR addr)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
+ store_typed_address (VALUE_CONTENTS_RAW (val), type, addr);
+ return val;
+}
+
+
+/* Create a value for a string constant to be stored locally
+ (not in the inferior's memory space, but in GDB memory).
+ This is analogous to value_from_longest, which also does not
+ use inferior memory. String shall NOT contain embedded nulls. */
+
+struct value *
+value_from_string (char *ptr)
+{
+ struct value *val;
+ 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);
+
+ val = allocate_value (stringtype);
+ memcpy (VALUE_CONTENTS_RAW (val), ptr, len);
+ return val;
+}
+
+struct value *
+value_from_double (struct type *type, DOUBLEST num)
+{
+ struct value *val = allocate_value (type);
struct type *base_type = check_typedef (type);
register enum type_code code = TYPE_CODE (base_type);
register int len = TYPE_LENGTH (base_type);
if (code == TYPE_CODE_FLT)
{
- store_floating (VALUE_CONTENTS_RAW (val), len, num);
+ store_typed_floating (VALUE_CONTENTS_RAW (val), base_type, num);
}
else
error ("Unexpected type encountered for floating constant.");
@@ -1489,25 +1311,22 @@ value_from_double (type, num)
0 when it is using the value returning conventions (this often
means returning pointer to where structure is vs. returning value). */
-value_ptr
-value_being_returned (valtype, retbuf, struct_return)
- register struct type *valtype;
- char retbuf[REGISTER_BYTES];
- int struct_return;
- /*ARGSUSED*/
+/* ARGSUSED */
+struct value *
+value_being_returned (struct type *valtype, char *retbuf, int struct_return)
{
- register value_ptr val;
+ struct value *val;
CORE_ADDR addr;
-#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
- if (struct_return) {
- addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
- if (!addr)
- error ("Function return value unknown");
- return value_at (valtype, addr, NULL);
- }
-#endif
+ if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
+ if (struct_return)
+ {
+ addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
+ if (!addr)
+ error ("Function return value unknown.");
+ return value_at (valtype, addr, NULL);
+ }
val = allocate_value (valtype);
CHECK_TYPEDEF (valtype);
@@ -1532,29 +1351,15 @@ value_being_returned (valtype, retbuf, struct_return)
handled wrong. */
int
-generic_use_struct_convention (gcc_p, value_type)
- int gcc_p;
- struct type *value_type;
-{
+generic_use_struct_convention (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
-#define USE_STRUCT_CONVENTION(gcc_p,type) generic_use_struct_convention (gcc_p, type)
-#endif
-
-/* Some fundamental types (such as long double) are returned on the stack for
- certain architectures. This macro should return true for any type besides
- struct, union or array that gets returned on the stack. */
-
-#ifndef RETURN_VALUE_ON_STACK
-#define RETURN_VALUE_ON_STACK(TYPE) 0
-#endif
-
/* Return true if the function specified is using the structure returning
convention on this machine to return arguments, or 0 if it is using
the value returning convention. FUNCTION is the value representing
@@ -1562,13 +1367,10 @@ generic_use_struct_convention (gcc_p, value_type)
is the type returned by the function. GCC_P is nonzero if compiled
with GCC. */
+/* ARGSUSED */
int
-using_struct_return (function, funcaddr, value_type, gcc_p)
- value_ptr function;
- CORE_ADDR funcaddr;
- struct type *value_type;
- int gcc_p;
- /*ARGSUSED*/
+using_struct_return (struct value *function, CORE_ADDR funcaddr,
+ struct type *value_type, int gcc_p)
{
register enum type_code code = TYPE_CODE (value_type);
@@ -1589,8 +1391,7 @@ using_struct_return (function, funcaddr, value_type, gcc_p)
function wants to return. */
void
-set_return_value (val)
- value_ptr val;
+set_return_value (struct value *val)
{
struct type *type = check_typedef (VALUE_TYPE (val));
register enum type_code code = TYPE_CODE (type);
@@ -1598,7 +1399,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.");
@@ -1606,10 +1407,10 @@ set_return_value (val)
}
void
-_initialize_values ()
+_initialize_values (void)
{
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\
diff --git a/contrib/gdb/gdb/varobj.c b/contrib/gdb/gdb/varobj.c
new file mode 100644
index 0000000..f56b7aa
--- /dev/null
+++ b/contrib/gdb/gdb/varobj.c
@@ -0,0 +1,2492 @@
+/* Implementation of the GDB variable objects API.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "expression.h"
+#include "frame.h"
+#include "language.h"
+#include "wrapper.h"
+#include "gdbcmd.h"
+#include <math.h>
+
+#include "varobj.h"
+
+/* Non-zero if we want to see trace of varobj level stuff. */
+
+int varobjdebug = 0;
+
+/* String representations of gdb's format codes */
+char *varobj_format_string[] =
+ { "natural", "binary", "decimal", "hexadecimal", "octal" };
+
+/* String representations of gdb's known languages */
+char *varobj_language_string[] = { "unknown", "C", "C++", "Java" };
+
+/* Data structures */
+
+/* Every root variable has one of these structures saved in its
+ varobj. Members which must be free'd are noted. */
+struct varobj_root
+{
+
+ /* Alloc'd expression for this parent. */
+ struct expression *exp;
+
+ /* Block for which this expression is valid */
+ struct block *valid_block;
+
+ /* The frame for this expression */
+ CORE_ADDR frame;
+
+ /* If 1, "update" always recomputes the frame & valid block
+ using the currently selected frame. */
+ int use_selected_frame;
+
+ /* Language info for this variable and its children */
+ struct language_specific *lang;
+
+ /* The varobj for this root node. */
+ struct varobj *rootvar;
+
+ /* Next root variable */
+ struct varobj_root *next;
+};
+
+/* Every variable in the system has a structure of this type defined
+ for it. This structure holds all information necessary to manipulate
+ a particular object variable. Members which must be freed are noted. */
+struct varobj
+{
+
+ /* Alloc'd name of the variable for this object.. If this variable is a
+ child, then this name will be the child's source name.
+ (bar, not foo.bar) */
+ /* NOTE: This is the "expression" */
+ char *name;
+
+ /* The alloc'd name for this variable's object. This is here for
+ convenience when constructing this object's children. */
+ char *obj_name;
+
+ /* Index of this variable in its parent or -1 */
+ int index;
+
+ /* The type of this variable. This may NEVER be NULL. */
+ struct type *type;
+
+ /* The value of this expression or subexpression. This may be NULL. */
+ struct value *value;
+
+ /* Did an error occur evaluating the expression or getting its value? */
+ int error;
+
+ /* The number of (immediate) children this variable has */
+ int num_children;
+
+ /* If this object is a child, this points to its immediate parent. */
+ struct varobj *parent;
+
+ /* A list of this object's children */
+ struct varobj_child *children;
+
+ /* Description of the root variable. Points to root variable for children. */
+ struct varobj_root *root;
+
+ /* The format of the output for this object */
+ enum varobj_display_formats format;
+};
+
+/* Every variable keeps a linked list of its children, described
+ by the following structure. */
+/* FIXME: Deprecated. All should use vlist instead */
+
+struct varobj_child
+{
+
+ /* Pointer to the child's data */
+ struct varobj *child;
+
+ /* Pointer to the next child */
+ struct varobj_child *next;
+};
+
+/* A stack of varobjs */
+/* FIXME: Deprecated. All should use vlist instead */
+
+struct vstack
+{
+ struct varobj *var;
+ struct vstack *next;
+};
+
+struct cpstack
+{
+ char *name;
+ struct cpstack *next;
+};
+
+/* A list of varobjs */
+
+struct vlist
+{
+ struct varobj *var;
+ struct vlist *next;
+};
+
+/* Private function prototypes */
+
+/* Helper functions for the above subcommands. */
+
+static int delete_variable (struct cpstack **, struct varobj *, int);
+
+static void delete_variable_1 (struct cpstack **, int *,
+ struct varobj *, int, int);
+
+static int install_variable (struct varobj *);
+
+static void uninstall_variable (struct varobj *);
+
+static struct varobj *child_exists (struct varobj *, char *);
+
+static struct varobj *create_child (struct varobj *, int, char *);
+
+static void save_child_in_parent (struct varobj *, struct varobj *);
+
+static void remove_child_from_parent (struct varobj *, struct varobj *);
+
+/* Utility routines */
+
+static struct varobj *new_variable (void);
+
+static struct varobj *new_root_variable (void);
+
+static void free_variable (struct varobj *var);
+
+static struct cleanup *make_cleanup_free_variable (struct varobj *var);
+
+static struct type *get_type (struct varobj *var);
+
+static struct type *get_type_deref (struct varobj *var);
+
+static struct type *get_target_type (struct type *);
+
+static enum varobj_display_formats variable_default_display (struct varobj *);
+
+static int my_value_equal (struct value *, struct value *, int *);
+
+static void vpush (struct vstack **pstack, struct varobj *var);
+
+static struct varobj *vpop (struct vstack **pstack);
+
+static void cppush (struct cpstack **pstack, char *name);
+
+static char *cppop (struct cpstack **pstack);
+
+/* Language-specific routines. */
+
+static enum varobj_languages variable_language (struct varobj *var);
+
+static int number_of_children (struct varobj *);
+
+static char *name_of_variable (struct varobj *);
+
+static char *name_of_child (struct varobj *, int);
+
+static struct value *value_of_root (struct varobj **var_handle, int *);
+
+static struct value *value_of_child (struct varobj *parent, int index);
+
+static struct type *type_of_child (struct varobj *var);
+
+static int variable_editable (struct varobj *var);
+
+static char *my_value_of_variable (struct varobj *var);
+
+static int type_changeable (struct varobj *var);
+
+/* C implementation */
+
+static int c_number_of_children (struct varobj *var);
+
+static char *c_name_of_variable (struct varobj *parent);
+
+static char *c_name_of_child (struct varobj *parent, int index);
+
+static struct value *c_value_of_root (struct varobj **var_handle);
+
+static struct value *c_value_of_child (struct varobj *parent, int index);
+
+static struct type *c_type_of_child (struct varobj *parent, int index);
+
+static int c_variable_editable (struct varobj *var);
+
+static char *c_value_of_variable (struct varobj *var);
+
+/* C++ implementation */
+
+static int cplus_number_of_children (struct varobj *var);
+
+static void cplus_class_num_children (struct type *type, int children[3]);
+
+static char *cplus_name_of_variable (struct varobj *parent);
+
+static char *cplus_name_of_child (struct varobj *parent, int index);
+
+static struct value *cplus_value_of_root (struct varobj **var_handle);
+
+static struct value *cplus_value_of_child (struct varobj *parent, int index);
+
+static struct type *cplus_type_of_child (struct varobj *parent, int index);
+
+static int cplus_variable_editable (struct varobj *var);
+
+static char *cplus_value_of_variable (struct varobj *var);
+
+/* Java implementation */
+
+static int java_number_of_children (struct varobj *var);
+
+static char *java_name_of_variable (struct varobj *parent);
+
+static char *java_name_of_child (struct varobj *parent, int index);
+
+static struct value *java_value_of_root (struct varobj **var_handle);
+
+static struct value *java_value_of_child (struct varobj *parent, int index);
+
+static struct type *java_type_of_child (struct varobj *parent, int index);
+
+static int java_variable_editable (struct varobj *var);
+
+static char *java_value_of_variable (struct varobj *var);
+
+/* The language specific vector */
+
+struct language_specific
+{
+
+ /* The language of this variable */
+ enum varobj_languages language;
+
+ /* The number of children of PARENT. */
+ int (*number_of_children) (struct varobj * parent);
+
+ /* The name (expression) of a root varobj. */
+ char *(*name_of_variable) (struct varobj * parent);
+
+ /* The name of the INDEX'th child of PARENT. */
+ char *(*name_of_child) (struct varobj * parent, int index);
+
+ /* The ``struct value *'' of the root variable ROOT. */
+ struct value *(*value_of_root) (struct varobj ** root_handle);
+
+ /* The ``struct value *'' of the INDEX'th child of PARENT. */
+ struct value *(*value_of_child) (struct varobj * parent, int index);
+
+ /* The type of the INDEX'th child of PARENT. */
+ struct type *(*type_of_child) (struct varobj * parent, int index);
+
+ /* Is VAR editable? */
+ int (*variable_editable) (struct varobj * var);
+
+ /* The current value of VAR. */
+ char *(*value_of_variable) (struct varobj * var);
+};
+
+/* Array of known source language routines. */
+static struct language_specific
+ languages[vlang_end][sizeof (struct language_specific)] = {
+ /* Unknown (try treating as C */
+ {
+ vlang_unknown,
+ c_number_of_children,
+ c_name_of_variable,
+ c_name_of_child,
+ c_value_of_root,
+ c_value_of_child,
+ c_type_of_child,
+ c_variable_editable,
+ c_value_of_variable}
+ ,
+ /* C */
+ {
+ vlang_c,
+ c_number_of_children,
+ c_name_of_variable,
+ c_name_of_child,
+ c_value_of_root,
+ c_value_of_child,
+ c_type_of_child,
+ c_variable_editable,
+ c_value_of_variable}
+ ,
+ /* C++ */
+ {
+ vlang_cplus,
+ cplus_number_of_children,
+ cplus_name_of_variable,
+ cplus_name_of_child,
+ cplus_value_of_root,
+ cplus_value_of_child,
+ cplus_type_of_child,
+ cplus_variable_editable,
+ cplus_value_of_variable}
+ ,
+ /* Java */
+ {
+ vlang_java,
+ java_number_of_children,
+ java_name_of_variable,
+ java_name_of_child,
+ java_value_of_root,
+ java_value_of_child,
+ java_type_of_child,
+ java_variable_editable,
+ java_value_of_variable}
+};
+
+/* A little convenience enum for dealing with C++/Java */
+enum vsections
+{
+ v_public = 0, v_private, v_protected
+};
+
+/* Private data */
+
+/* Mappings of varobj_display_formats enums to gdb's format codes */
+static int format_code[] = { 0, 't', 'd', 'x', 'o' };
+
+/* Header of the list of root variable objects */
+static struct varobj_root *rootlist;
+static int rootcount = 0; /* number of root varobjs in the list */
+
+/* Prime number indicating the number of buckets in the hash table */
+/* A prime large enough to avoid too many colisions */
+#define VAROBJ_TABLE_SIZE 227
+
+/* Pointer to the varobj hash table (built at run time) */
+static struct vlist **varobj_table;
+
+/* Is the variable X one of our "fake" children? */
+#define CPLUS_FAKE_CHILD(x) \
+((x) != NULL && (x)->type == NULL && (x)->value == NULL)
+
+
+/* API Implementation */
+
+/* Creates a varobj (not its children) */
+
+struct varobj *
+varobj_create (char *objname,
+ char *expression, CORE_ADDR frame, enum varobj_type type)
+{
+ struct varobj *var;
+ struct frame_info *fi;
+ struct frame_info *old_fi = NULL;
+ struct block *block;
+ struct cleanup *old_chain;
+
+ /* Fill out a varobj structure for the (root) variable being constructed. */
+ var = new_root_variable ();
+ old_chain = make_cleanup_free_variable (var);
+
+ if (expression != NULL)
+ {
+ char *p;
+ enum varobj_languages lang;
+
+ /* Parse and evaluate the expression, filling in as much
+ of the variable's data as possible */
+
+ /* Allow creator to specify context of variable */
+ if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
+ fi = selected_frame;
+ else
+ fi = find_frame_addr_in_frame_chain (frame);
+
+ /* frame = -2 means always use selected frame */
+ if (type == USE_SELECTED_FRAME)
+ var->root->use_selected_frame = 1;
+
+ block = NULL;
+ if (fi != NULL)
+ block = get_frame_block (fi);
+
+ p = expression;
+ innermost_block = NULL;
+ /* Wrap the call to parse expression, so we can
+ return a sensible error. */
+ if (!gdb_parse_exp_1 (&p, block, 0, &var->root->exp))
+ {
+ return NULL;
+ }
+
+ /* Don't allow variables to be created for types. */
+ if (var->root->exp->elts[0].opcode == OP_TYPE)
+ {
+ do_cleanups (old_chain);
+ fprintf_unfiltered (gdb_stderr,
+ "Attempt to use a type name as an expression.");
+ return NULL;
+ }
+
+ var->format = variable_default_display (var);
+ var->root->valid_block = innermost_block;
+ var->name = savestring (expression, strlen (expression));
+
+ /* When the frame is different from the current frame,
+ we must select the appropriate frame before parsing
+ the expression, otherwise the value will not be current.
+ Since select_frame is so benign, just call it for all cases. */
+ if (fi != NULL)
+ {
+ var->root->frame = FRAME_FP (fi);
+ old_fi = selected_frame;
+ select_frame (fi, -1);
+ }
+
+ /* We definitively need to catch errors here.
+ If evaluate_expression succeeds we got the value we wanted.
+ But if it fails, we still go on with a call to evaluate_type() */
+ if (gdb_evaluate_expression (var->root->exp, &var->value))
+ {
+ /* no error */
+ release_value (var->value);
+ if (VALUE_LAZY (var->value))
+ gdb_value_fetch_lazy (var->value);
+ }
+ else
+ var->value = evaluate_type (var->root->exp);
+
+ var->type = VALUE_TYPE (var->value);
+
+ /* Set language info */
+ lang = variable_language (var);
+ var->root->lang = languages[lang];
+
+ /* Set ourselves as our root */
+ var->root->rootvar = var;
+
+ /* Reset the selected frame */
+ if (fi != NULL)
+ select_frame (old_fi, -1);
+ }
+
+ /* If the variable object name is null, that means this
+ is a temporary variable, so don't install it. */
+
+ if ((var != NULL) && (objname != NULL))
+ {
+ var->obj_name = savestring (objname, strlen (objname));
+
+ /* If a varobj name is duplicated, the install will fail so
+ we must clenup */
+ if (!install_variable (var))
+ {
+ do_cleanups (old_chain);
+ return NULL;
+ }
+ }
+
+ discard_cleanups (old_chain);
+ return var;
+}
+
+/* Generates an unique name that can be used for a varobj */
+
+char *
+varobj_gen_name (void)
+{
+ static int id = 0;
+ char obj_name[31];
+
+ /* generate a name for this object */
+ id++;
+ sprintf (obj_name, "var%d", id);
+
+ return xstrdup (obj_name);
+}
+
+/* Given an "objname", returns the pointer to the corresponding varobj
+ or NULL if not found */
+
+struct varobj *
+varobj_get_handle (char *objname)
+{
+ struct vlist *cv;
+ const char *chp;
+ unsigned int index = 0;
+ unsigned int i = 1;
+
+ for (chp = objname; *chp; chp++)
+ {
+ index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+ }
+
+ cv = *(varobj_table + index);
+ while ((cv != NULL) && (strcmp (cv->var->obj_name, objname) != 0))
+ cv = cv->next;
+
+ if (cv == NULL)
+ error ("Variable object not found");
+
+ return cv->var;
+}
+
+/* Given the handle, return the name of the object */
+
+char *
+varobj_get_objname (struct varobj *var)
+{
+ return var->obj_name;
+}
+
+/* Given the handle, return the expression represented by the object */
+
+char *
+varobj_get_expression (struct varobj *var)
+{
+ return name_of_variable (var);
+}
+
+/* Deletes a varobj and all its children if only_children == 0,
+ otherwise deletes only the children; returns a malloc'ed list of all the
+ (malloc'ed) names of the variables that have been deleted (NULL terminated) */
+
+int
+varobj_delete (struct varobj *var, char ***dellist, int only_children)
+{
+ int delcount;
+ int mycount;
+ struct cpstack *result = NULL;
+ char **cp;
+
+ /* Initialize a stack for temporary results */
+ cppush (&result, NULL);
+
+ if (only_children)
+ /* Delete only the variable children */
+ delcount = delete_variable (&result, var, 1 /* only the children */ );
+ else
+ /* Delete the variable and all its children */
+ delcount = delete_variable (&result, var, 0 /* parent+children */ );
+
+ /* We may have been asked to return a list of what has been deleted */
+ if (dellist != NULL)
+ {
+ *dellist = xmalloc ((delcount + 1) * sizeof (char *));
+
+ cp = *dellist;
+ mycount = delcount;
+ *cp = cppop (&result);
+ while ((*cp != NULL) && (mycount > 0))
+ {
+ mycount--;
+ cp++;
+ *cp = cppop (&result);
+ }
+
+ if (mycount || (*cp != NULL))
+ warning ("varobj_delete: assertion failed - mycount(=%d) <> 0",
+ mycount);
+ }
+
+ return delcount;
+}
+
+/* Set/Get variable object display format */
+
+enum varobj_display_formats
+varobj_set_display_format (struct varobj *var,
+ enum varobj_display_formats format)
+{
+ switch (format)
+ {
+ case FORMAT_NATURAL:
+ case FORMAT_BINARY:
+ case FORMAT_DECIMAL:
+ case FORMAT_HEXADECIMAL:
+ case FORMAT_OCTAL:
+ var->format = format;
+ break;
+
+ default:
+ var->format = variable_default_display (var);
+ }
+
+ return var->format;
+}
+
+enum varobj_display_formats
+varobj_get_display_format (struct varobj *var)
+{
+ return var->format;
+}
+
+int
+varobj_get_num_children (struct varobj *var)
+{
+ if (var->num_children == -1)
+ var->num_children = number_of_children (var);
+
+ return var->num_children;
+}
+
+/* Creates a list of the immediate children of a variable object;
+ the return code is the number of such children or -1 on error */
+
+int
+varobj_list_children (struct varobj *var, struct varobj ***childlist)
+{
+ struct varobj *child;
+ char *name;
+ int i;
+
+ /* sanity check: have we been passed a pointer? */
+ if (childlist == NULL)
+ return -1;
+
+ *childlist = NULL;
+
+ if (var->num_children == -1)
+ var->num_children = number_of_children (var);
+
+ /* List of children */
+ *childlist = xmalloc ((var->num_children + 1) * sizeof (struct varobj *));
+
+ for (i = 0; i < var->num_children; i++)
+ {
+ /* Mark as the end in case we bail out */
+ *((*childlist) + i) = NULL;
+
+ /* check if child exists, if not create */
+ name = name_of_child (var, i);
+ child = child_exists (var, name);
+ if (child == NULL)
+ child = create_child (var, i, name);
+
+ *((*childlist) + i) = child;
+ }
+
+ /* End of list is marked by a NULL pointer */
+ *((*childlist) + i) = NULL;
+
+ return var->num_children;
+}
+
+/* Obtain the type of an object Variable as a string similar to the one gdb
+ prints on the console */
+
+char *
+varobj_get_type (struct varobj *var)
+{
+ struct value *val;
+ struct cleanup *old_chain;
+ struct ui_file *stb;
+ char *thetype;
+ long length;
+
+ /* For the "fake" variables, do not return a type. (It's type is
+ NULL, too.) */
+ if (CPLUS_FAKE_CHILD (var))
+ return NULL;
+
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
+
+ /* To print the type, we simply create a zero ``struct value *'' and
+ cast it to our type. We then typeprint this variable. */
+ val = value_zero (var->type, not_lval);
+ type_print (VALUE_TYPE (val), "", stb, -1);
+
+ thetype = ui_file_xstrdup (stb, &length);
+ do_cleanups (old_chain);
+ return thetype;
+}
+
+enum varobj_languages
+varobj_get_language (struct varobj *var)
+{
+ return variable_language (var);
+}
+
+int
+varobj_get_attributes (struct varobj *var)
+{
+ int attributes = 0;
+
+ if (variable_editable (var))
+ /* FIXME: define masks for attributes */
+ attributes |= 0x00000001; /* Editable */
+
+ return attributes;
+}
+
+char *
+varobj_get_value (struct varobj *var)
+{
+ return my_value_of_variable (var);
+}
+
+/* Set the value of an object variable (if it is editable) to the
+ value of the given expression */
+/* Note: Invokes functions that can call error() */
+
+int
+varobj_set_value (struct varobj *var, char *expression)
+{
+ struct value *val;
+ int offset = 0;
+
+ /* The argument "expression" contains the variable's new value.
+ We need to first construct a legal expression for this -- ugh! */
+ /* Does this cover all the bases? */
+ struct expression *exp;
+ struct value *value;
+ int saved_input_radix = input_radix;
+
+ if (var->value != NULL && variable_editable (var) && !var->error)
+ {
+ char *s = expression;
+ int i;
+
+ input_radix = 10; /* ALWAYS reset to decimal temporarily */
+ if (!gdb_parse_exp_1 (&s, 0, 0, &exp))
+ /* We cannot proceed without a well-formed expression. */
+ return 0;
+ if (!gdb_evaluate_expression (exp, &value))
+ {
+ /* We cannot proceed without a valid expression. */
+ xfree (exp);
+ return 0;
+ }
+
+ if (!gdb_value_assign (var->value, value, &val))
+ return 0;
+ value_free (var->value);
+ release_value (val);
+ var->value = val;
+ input_radix = saved_input_radix;
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Returns a malloc'ed list with all root variable objects */
+int
+varobj_list (struct varobj ***varlist)
+{
+ struct varobj **cv;
+ struct varobj_root *croot;
+ int mycount = rootcount;
+
+ /* Alloc (rootcount + 1) entries for the result */
+ *varlist = xmalloc ((rootcount + 1) * sizeof (struct varobj *));
+
+ cv = *varlist;
+ croot = rootlist;
+ while ((croot != NULL) && (mycount > 0))
+ {
+ *cv = croot->rootvar;
+ mycount--;
+ cv++;
+ croot = croot->next;
+ }
+ /* Mark the end of the list */
+ *cv = NULL;
+
+ if (mycount || (croot != NULL))
+ warning
+ ("varobj_list: assertion failed - wrong tally of root vars (%d:%d)",
+ rootcount, mycount);
+
+ return rootcount;
+}
+
+/* Update the values for a variable and its children. This is a
+ two-pronged attack. First, re-parse the value for the root's
+ expression to see if it's changed. Then go all the way
+ through its children, reconstructing them and noting if they've
+ changed.
+ Return value:
+ -1 if there was an error updating the varobj
+ -2 if the type changed
+ Otherwise it is the number of children + parent changed
+
+ Only root variables can be updated...
+
+ NOTE: This function may delete the caller's varobj. If it
+ returns -2, then it has done this and VARP will be modified
+ to point to the new varobj. */
+
+int
+varobj_update (struct varobj **varp, struct varobj ***changelist)
+{
+ int changed = 0;
+ int type_changed;
+ int i;
+ int vleft;
+ int error2;
+ struct varobj *v;
+ struct varobj **cv;
+ struct varobj **templist = NULL;
+ struct value *new;
+ struct vstack *stack = NULL;
+ struct vstack *result = NULL;
+ struct frame_info *old_fi;
+
+ /* sanity check: have we been passed a pointer? */
+ if (changelist == NULL)
+ return -1;
+
+ /* Only root variables can be updated... */
+ if ((*varp)->root->rootvar != *varp)
+ /* Not a root var */
+ return -1;
+
+ /* Save the selected stack frame, since we will need to change it
+ in order to evaluate expressions. */
+ old_fi = selected_frame;
+
+ /* Update the root variable. value_of_root can return NULL
+ if the variable is no longer around, i.e. we stepped out of
+ the frame in which a local existed. We are letting the
+ value_of_root variable dispose of the varobj if the type
+ has changed. */
+ type_changed = 1;
+ new = value_of_root (varp, &type_changed);
+ if (new == NULL)
+ {
+ (*varp)->error = 1;
+ return -1;
+ }
+
+ /* Initialize a stack for temporary results */
+ vpush (&result, NULL);
+
+ /* If this is a "use_selected_frame" varobj, and its type has changed,
+ them note that it's changed. */
+ if (type_changed)
+ {
+ vpush (&result, *varp);
+ changed++;
+ }
+ /* If values are not equal, note that it's changed.
+ There a couple of exceptions here, though.
+ We don't want some types to be reported as "changed". */
+ else if (type_changeable (*varp)
+ && !my_value_equal ((*varp)->value, new, &error2))
+ {
+ vpush (&result, *varp);
+ changed++;
+ /* error2 replaces var->error since this new value
+ WILL replace the old one. */
+ (*varp)->error = error2;
+ }
+
+ /* We must always keep around the new value for this root
+ variable expression, or we lose the updated children! */
+ value_free ((*varp)->value);
+ (*varp)->value = new;
+
+ /* Initialize a stack */
+ vpush (&stack, NULL);
+
+ /* Push the root's children */
+ if ((*varp)->children != NULL)
+ {
+ struct varobj_child *c;
+ for (c = (*varp)->children; c != NULL; c = c->next)
+ vpush (&stack, c->child);
+ }
+
+ /* Walk through the children, reconstructing them all. */
+ v = vpop (&stack);
+ while (v != NULL)
+ {
+ /* Push any children */
+ if (v->children != NULL)
+ {
+ struct varobj_child *c;
+ for (c = v->children; c != NULL; c = c->next)
+ vpush (&stack, c->child);
+ }
+
+ /* Update this variable */
+ new = value_of_child (v->parent, v->index);
+ if (type_changeable (v) && !my_value_equal (v->value, new, &error2))
+ {
+ /* Note that it's changed */
+ vpush (&result, v);
+ changed++;
+ }
+ /* error2 replaces v->error since this new value
+ WILL replace the old one. */
+ v->error = error2;
+
+ /* We must always keep new values, since children depend on it. */
+ if (v->value != NULL)
+ value_free (v->value);
+ v->value = new;
+
+ /* Get next child */
+ v = vpop (&stack);
+ }
+
+ /* Alloc (changed + 1) list entries */
+ /* FIXME: add a cleanup for the allocated list(s)
+ because one day the select_frame called below can longjump */
+ *changelist = xmalloc ((changed + 1) * sizeof (struct varobj *));
+ if (changed > 1)
+ {
+ templist = xmalloc ((changed + 1) * sizeof (struct varobj *));
+ cv = templist;
+ }
+ else
+ cv = *changelist;
+
+ /* Copy from result stack to list */
+ vleft = changed;
+ *cv = vpop (&result);
+ while ((*cv != NULL) && (vleft > 0))
+ {
+ vleft--;
+ cv++;
+ *cv = vpop (&result);
+ }
+ if (vleft)
+ warning ("varobj_update: assertion failed - vleft <> 0");
+
+ if (changed > 1)
+ {
+ /* Now we revert the order. */
+ for (i = 0; i < changed; i++)
+ *(*changelist + i) = *(templist + changed - 1 - i);
+ *(*changelist + changed) = NULL;
+ }
+
+ /* Restore selected frame */
+ select_frame (old_fi, -1);
+
+ if (type_changed)
+ return -2;
+ else
+ return changed;
+}
+
+
+/* Helper functions */
+
+/*
+ * Variable object construction/destruction
+ */
+
+static int
+delete_variable (struct cpstack **resultp, struct varobj *var,
+ int only_children_p)
+{
+ int delcount = 0;
+
+ delete_variable_1 (resultp, &delcount, var,
+ only_children_p, 1 /* remove_from_parent_p */ );
+
+ return delcount;
+}
+
+/* Delete the variable object VAR and its children */
+/* IMPORTANT NOTE: If we delete a variable which is a child
+ and the parent is not removed we dump core. It must be always
+ initially called with remove_from_parent_p set */
+static void
+delete_variable_1 (struct cpstack **resultp, int *delcountp,
+ struct varobj *var, int only_children_p,
+ int remove_from_parent_p)
+{
+ struct varobj_child *vc;
+ struct varobj_child *next;
+
+ /* Delete any children of this variable, too. */
+ for (vc = var->children; vc != NULL; vc = next)
+ {
+ if (!remove_from_parent_p)
+ vc->child->parent = NULL;
+ delete_variable_1 (resultp, delcountp, vc->child, 0, only_children_p);
+ next = vc->next;
+ xfree (vc);
+ }
+
+ /* if we were called to delete only the children we are done here */
+ if (only_children_p)
+ return;
+
+ /* Otherwise, add it to the list of deleted ones and proceed to do so */
+ /* If the name is null, this is a temporary variable, that has not
+ yet been installed, don't report it, it belongs to the caller... */
+ if (var->obj_name != NULL)
+ {
+ cppush (resultp, xstrdup (var->obj_name));
+ *delcountp = *delcountp + 1;
+ }
+
+ /* If this variable has a parent, remove it from its parent's list */
+ /* OPTIMIZATION: if the parent of this variable is also being deleted,
+ (as indicated by remove_from_parent_p) we don't bother doing an
+ expensive list search to find the element to remove when we are
+ discarding the list afterwards */
+ if ((remove_from_parent_p) && (var->parent != NULL))
+ {
+ remove_child_from_parent (var->parent, var);
+ }
+
+ if (var->obj_name != NULL)
+ uninstall_variable (var);
+
+ /* Free memory associated with this variable */
+ free_variable (var);
+}
+
+/* Install the given variable VAR with the object name VAR->OBJ_NAME. */
+static int
+install_variable (struct varobj *var)
+{
+ struct vlist *cv;
+ struct vlist *newvl;
+ const char *chp;
+ unsigned int index = 0;
+ unsigned int i = 1;
+
+ for (chp = var->obj_name; *chp; chp++)
+ {
+ index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+ }
+
+ cv = *(varobj_table + index);
+ while ((cv != NULL) && (strcmp (cv->var->obj_name, var->obj_name) != 0))
+ cv = cv->next;
+
+ if (cv != NULL)
+ error ("Duplicate variable object name");
+
+ /* Add varobj to hash table */
+ newvl = xmalloc (sizeof (struct vlist));
+ newvl->next = *(varobj_table + index);
+ newvl->var = var;
+ *(varobj_table + index) = newvl;
+
+ /* If root, add varobj to root list */
+ if (var->root->rootvar == var)
+ {
+ /* Add to list of root variables */
+ if (rootlist == NULL)
+ var->root->next = NULL;
+ else
+ var->root->next = rootlist;
+ rootlist = var->root;
+ rootcount++;
+ }
+
+ return 1; /* OK */
+}
+
+/* Unistall the object VAR. */
+static void
+uninstall_variable (struct varobj *var)
+{
+ struct vlist *cv;
+ struct vlist *prev;
+ struct varobj_root *cr;
+ struct varobj_root *prer;
+ const char *chp;
+ unsigned int index = 0;
+ unsigned int i = 1;
+
+ /* Remove varobj from hash table */
+ for (chp = var->obj_name; *chp; chp++)
+ {
+ index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+ }
+
+ cv = *(varobj_table + index);
+ prev = NULL;
+ while ((cv != NULL) && (strcmp (cv->var->obj_name, var->obj_name) != 0))
+ {
+ prev = cv;
+ cv = cv->next;
+ }
+
+ if (varobjdebug)
+ fprintf_unfiltered (gdb_stdlog, "Deleting %s\n", var->obj_name);
+
+ if (cv == NULL)
+ {
+ warning
+ ("Assertion failed: Could not find variable object \"%s\" to delete",
+ var->obj_name);
+ return;
+ }
+
+ if (prev == NULL)
+ *(varobj_table + index) = cv->next;
+ else
+ prev->next = cv->next;
+
+ xfree (cv);
+
+ /* If root, remove varobj from root list */
+ if (var->root->rootvar == var)
+ {
+ /* Remove from list of root variables */
+ if (rootlist == var->root)
+ rootlist = var->root->next;
+ else
+ {
+ prer = NULL;
+ cr = rootlist;
+ while ((cr != NULL) && (cr->rootvar != var))
+ {
+ prer = cr;
+ cr = cr->next;
+ }
+ if (cr == NULL)
+ {
+ warning
+ ("Assertion failed: Could not find varobj \"%s\" in root list",
+ var->obj_name);
+ return;
+ }
+ if (prer == NULL)
+ rootlist = NULL;
+ else
+ prer->next = cr->next;
+ }
+ rootcount--;
+ }
+
+}
+
+/* Does a child with the name NAME exist in VAR? If so, return its data.
+ If not, return NULL. */
+static struct varobj *
+child_exists (struct varobj *var, char *name)
+{
+ struct varobj_child *vc;
+
+ for (vc = var->children; vc != NULL; vc = vc->next)
+ {
+ if (STREQ (vc->child->name, name))
+ return vc->child;
+ }
+
+ return NULL;
+}
+
+/* Create and install a child of the parent of the given name */
+static struct varobj *
+create_child (struct varobj *parent, int index, char *name)
+{
+ struct varobj *child;
+ char *childs_name;
+
+ child = new_variable ();
+
+ /* name is allocated by name_of_child */
+ child->name = name;
+ child->index = index;
+ child->value = value_of_child (parent, index);
+ if ((!CPLUS_FAKE_CHILD(child) && child->value == NULL) || parent->error)
+ child->error = 1;
+ child->parent = parent;
+ child->root = parent->root;
+ childs_name =
+ (char *) xmalloc ((strlen (parent->obj_name) + strlen (name) + 2) *
+ sizeof (char));
+ sprintf (childs_name, "%s.%s", parent->obj_name, name);
+ child->obj_name = childs_name;
+ install_variable (child);
+
+ /* Save a pointer to this child in the parent */
+ save_child_in_parent (parent, child);
+
+ /* Note the type of this child */
+ child->type = type_of_child (child);
+
+ return child;
+}
+
+/* FIXME: This should be a generic add to list */
+/* Save CHILD in the PARENT's data. */
+static void
+save_child_in_parent (struct varobj *parent, struct varobj *child)
+{
+ struct varobj_child *vc;
+
+ /* Insert the child at the top */
+ vc = parent->children;
+ parent->children =
+ (struct varobj_child *) xmalloc (sizeof (struct varobj_child));
+
+ parent->children->next = vc;
+ parent->children->child = child;
+}
+
+/* FIXME: This should be a generic remove from list */
+/* Remove the CHILD from the PARENT's list of children. */
+static void
+remove_child_from_parent (struct varobj *parent, struct varobj *child)
+{
+ struct varobj_child *vc, *prev;
+
+ /* Find the child in the parent's list */
+ prev = NULL;
+ for (vc = parent->children; vc != NULL;)
+ {
+ if (vc->child == child)
+ break;
+ prev = vc;
+ vc = vc->next;
+ }
+
+ if (prev == NULL)
+ parent->children = vc->next;
+ else
+ prev->next = vc->next;
+
+}
+
+
+/*
+ * Miscellaneous utility functions.
+ */
+
+/* Allocate memory and initialize a new variable */
+static struct varobj *
+new_variable (void)
+{
+ struct varobj *var;
+
+ var = (struct varobj *) xmalloc (sizeof (struct varobj));
+ var->name = NULL;
+ var->obj_name = NULL;
+ var->index = -1;
+ var->type = NULL;
+ var->value = NULL;
+ var->error = 0;
+ var->num_children = -1;
+ var->parent = NULL;
+ var->children = NULL;
+ var->format = 0;
+ var->root = NULL;
+
+ return var;
+}
+
+/* Allocate memory and initialize a new root variable */
+static struct varobj *
+new_root_variable (void)
+{
+ struct varobj *var = new_variable ();
+ var->root = (struct varobj_root *) xmalloc (sizeof (struct varobj_root));;
+ var->root->lang = NULL;
+ var->root->exp = NULL;
+ var->root->valid_block = NULL;
+ var->root->frame = (CORE_ADDR) -1;
+ var->root->use_selected_frame = 0;
+ var->root->rootvar = NULL;
+
+ return var;
+}
+
+/* Free any allocated memory associated with VAR. */
+static void
+free_variable (struct varobj *var)
+{
+ /* Free the expression if this is a root variable. */
+ if (var->root->rootvar == var)
+ {
+ free_current_contents ((char **) &var->root->exp);
+ xfree (var->root);
+ }
+
+ xfree (var->name);
+ xfree (var->obj_name);
+ xfree (var);
+}
+
+static void
+do_free_variable_cleanup (void *var)
+{
+ free_variable (var);
+}
+
+static struct cleanup *
+make_cleanup_free_variable (struct varobj *var)
+{
+ return make_cleanup (do_free_variable_cleanup, var);
+}
+
+/* This returns the type of the variable. This skips past typedefs
+ and returns the real type of the variable. It also dereferences
+ pointers and references. */
+static struct type *
+get_type (struct varobj *var)
+{
+ struct type *type;
+ type = var->type;
+
+ while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ type = TYPE_TARGET_TYPE (type);
+
+ return type;
+}
+
+/* This returns the type of the variable, dereferencing pointers, too. */
+static struct type *
+get_type_deref (struct varobj *var)
+{
+ struct type *type;
+
+ type = get_type (var);
+
+ if (type != NULL && (TYPE_CODE (type) == TYPE_CODE_PTR
+ || TYPE_CODE (type) == TYPE_CODE_REF))
+ type = get_target_type (type);
+
+ return type;
+}
+
+/* This returns the target type (or NULL) of TYPE, also skipping
+ past typedefs, just like get_type (). */
+static struct type *
+get_target_type (struct type *type)
+{
+ if (type != NULL)
+ {
+ type = TYPE_TARGET_TYPE (type);
+ while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ type = TYPE_TARGET_TYPE (type);
+ }
+
+ return type;
+}
+
+/* What is the default display for this variable? We assume that
+ everything is "natural". Any exceptions? */
+static enum varobj_display_formats
+variable_default_display (struct varobj *var)
+{
+ return FORMAT_NATURAL;
+}
+
+/* This function is similar to gdb's value_equal, except that this
+ one is "safe" -- it NEVER longjmps. It determines if the VAR's
+ value is the same as VAL2. */
+static int
+my_value_equal (struct value *val1, struct value *val2, int *error2)
+{
+ int r, err1, err2;
+
+ *error2 = 0;
+ /* Special case: NULL values. If both are null, say
+ they're equal. */
+ if (val1 == NULL && val2 == NULL)
+ return 1;
+ else if (val1 == NULL || val2 == NULL)
+ return 0;
+
+ /* This is bogus, but unfortunately necessary. We must know
+ exactly what caused an error -- reading val1 or val2 -- so
+ that we can really determine if we think that something has changed. */
+ err1 = 0;
+ err2 = 0;
+ /* We do need to catch errors here because the whole purpose
+ is to test if value_equal() has errored */
+ if (!gdb_value_equal (val1, val1, &r))
+ err1 = 1;
+
+ if (!gdb_value_equal (val2, val2, &r))
+ *error2 = err2 = 1;
+
+ if (err1 != err2)
+ return 0;
+
+ if (!gdb_value_equal (val1, val2, &r))
+ {
+ /* An error occurred, this could have happened if
+ either val1 or val2 errored. ERR1 and ERR2 tell
+ us which of these it is. If both errored, then
+ we assume nothing has changed. If one of them is
+ valid, though, then something has changed. */
+ if (err1 == err2)
+ {
+ /* both the old and new values caused errors, so
+ we say the value did not change */
+ /* This is indeterminate, though. Perhaps we should
+ be safe and say, yes, it changed anyway?? */
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ return r;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static void
+vpush (struct vstack **pstack, struct varobj *var)
+{
+ struct vstack *s;
+
+ s = (struct vstack *) xmalloc (sizeof (struct vstack));
+ s->var = var;
+ s->next = *pstack;
+ *pstack = s;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static struct varobj *
+vpop (struct vstack **pstack)
+{
+ struct vstack *s;
+ struct varobj *v;
+
+ if ((*pstack)->var == NULL && (*pstack)->next == NULL)
+ return NULL;
+
+ s = *pstack;
+ v = s->var;
+ *pstack = (*pstack)->next;
+ xfree (s);
+
+ return v;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static void
+cppush (struct cpstack **pstack, char *name)
+{
+ struct cpstack *s;
+
+ s = (struct cpstack *) xmalloc (sizeof (struct cpstack));
+ s->name = name;
+ s->next = *pstack;
+ *pstack = s;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static char *
+cppop (struct cpstack **pstack)
+{
+ struct cpstack *s;
+ char *v;
+
+ if ((*pstack)->name == NULL && (*pstack)->next == NULL)
+ return NULL;
+
+ s = *pstack;
+ v = s->name;
+ *pstack = (*pstack)->next;
+ xfree (s);
+
+ return v;
+}
+
+/*
+ * Language-dependencies
+ */
+
+/* Common entry points */
+
+/* Get the language of variable VAR. */
+static enum varobj_languages
+variable_language (struct varobj *var)
+{
+ enum varobj_languages lang;
+
+ switch (var->root->exp->language_defn->la_language)
+ {
+ default:
+ case language_c:
+ lang = vlang_c;
+ break;
+ case language_cplus:
+ lang = vlang_cplus;
+ break;
+ case language_java:
+ lang = vlang_java;
+ break;
+ }
+
+ return lang;
+}
+
+/* Return the number of children for a given variable.
+ The result of this function is defined by the language
+ implementation. The number of children returned by this function
+ is the number of children that the user will see in the variable
+ display. */
+static int
+number_of_children (struct varobj *var)
+{
+ return (*var->root->lang->number_of_children) (var);;
+}
+
+/* What is the expression for the root varobj VAR? Returns a malloc'd string. */
+static char *
+name_of_variable (struct varobj *var)
+{
+ return (*var->root->lang->name_of_variable) (var);
+}
+
+/* What is the name of the INDEX'th child of VAR? Returns a malloc'd string. */
+static char *
+name_of_child (struct varobj *var, int index)
+{
+ return (*var->root->lang->name_of_child) (var, index);
+}
+
+/* What is the ``struct value *'' of the root variable VAR?
+ TYPE_CHANGED controls what to do if the type of a
+ use_selected_frame = 1 variable changes. On input,
+ TYPE_CHANGED = 1 means discard the old varobj, and replace
+ it with this one. TYPE_CHANGED = 0 means leave it around.
+ NB: In both cases, var_handle will point to the new varobj,
+ so if you use TYPE_CHANGED = 0, you will have to stash the
+ old varobj pointer away somewhere before calling this.
+ On return, TYPE_CHANGED will be 1 if the type has changed, and
+ 0 otherwise. */
+static struct value *
+value_of_root (struct varobj **var_handle, int *type_changed)
+{
+ struct varobj *var;
+
+ if (var_handle == NULL)
+ return NULL;
+
+ var = *var_handle;
+
+ /* This should really be an exception, since this should
+ only get called with a root variable. */
+
+ if (var->root->rootvar != var)
+ return NULL;
+
+ if (var->root->use_selected_frame)
+ {
+ struct varobj *tmp_var;
+ char *old_type, *new_type;
+ old_type = varobj_get_type (var);
+ tmp_var = varobj_create (NULL, var->name, (CORE_ADDR) 0,
+ USE_SELECTED_FRAME);
+ if (tmp_var == NULL)
+ {
+ return NULL;
+ }
+ new_type = varobj_get_type (tmp_var);
+ if (strcmp (old_type, new_type) == 0)
+ {
+ varobj_delete (tmp_var, NULL, 0);
+ *type_changed = 0;
+ }
+ else
+ {
+ if (*type_changed)
+ {
+ tmp_var->obj_name =
+ savestring (var->obj_name, strlen (var->obj_name));
+ varobj_delete (var, NULL, 0);
+ }
+ else
+ {
+ tmp_var->obj_name = varobj_gen_name ();
+ }
+ install_variable (tmp_var);
+ *var_handle = tmp_var;
+ var = *var_handle;
+ *type_changed = 1;
+ }
+ }
+ else
+ {
+ *type_changed = 0;
+ }
+
+ return (*var->root->lang->value_of_root) (var_handle);
+}
+
+/* What is the ``struct value *'' for the INDEX'th child of PARENT? */
+static struct value *
+value_of_child (struct varobj *parent, int index)
+{
+ struct value *value;
+
+ value = (*parent->root->lang->value_of_child) (parent, index);
+
+ /* If we're being lazy, fetch the real value of the variable. */
+ if (value != NULL && VALUE_LAZY (value))
+ {
+ /* If we fail to fetch the value of the child, return
+ NULL so that callers notice that we're leaving an
+ error message. */
+ if (!gdb_value_fetch_lazy (value))
+ value = NULL;
+ }
+
+ return value;
+}
+
+/* What is the type of VAR? */
+static struct type *
+type_of_child (struct varobj *var)
+{
+
+ /* If the child had no evaluation errors, var->value
+ will be non-NULL and contain a valid type. */
+ if (var->value != NULL)
+ return VALUE_TYPE (var->value);
+
+ /* Otherwise, we must compute the type. */
+ return (*var->root->lang->type_of_child) (var->parent, var->index);
+}
+
+/* Is this variable editable? Use the variable's type to make
+ this determination. */
+static int
+variable_editable (struct varobj *var)
+{
+ return (*var->root->lang->variable_editable) (var);
+}
+
+/* GDB already has a command called "value_of_variable". Sigh. */
+static char *
+my_value_of_variable (struct varobj *var)
+{
+ return (*var->root->lang->value_of_variable) (var);
+}
+
+/* Is VAR something that can change? Depending on language,
+ some variable's values never change. For example,
+ struct and unions never change values. */
+static int
+type_changeable (struct varobj *var)
+{
+ int r;
+ struct type *type;
+
+ if (CPLUS_FAKE_CHILD (var))
+ return 0;
+
+ type = get_type (var);
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_ARRAY:
+ r = 0;
+ break;
+
+ default:
+ r = 1;
+ }
+
+ return r;
+}
+
+/* C */
+static int
+c_number_of_children (struct varobj *var)
+{
+ struct type *type;
+ struct type *target;
+ int children;
+
+ type = get_type (var);
+ target = get_target_type (type);
+ children = 0;
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (target) > 0
+ && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ children = TYPE_LENGTH (type) / TYPE_LENGTH (target);
+ else
+ children = -1;
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ children = TYPE_NFIELDS (type);
+ break;
+
+ case TYPE_CODE_PTR:
+ /* This is where things get compilcated. All pointers have one child.
+ Except, of course, for struct and union ptr, which we automagically
+ dereference for the user and function ptrs, which have no children.
+ We also don't dereference void* as we don't know what to show.
+ We can show char* so we allow it to be dereferenced. If you decide
+ to test for it, please mind that a little magic is necessary to
+ properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
+ TYPE_NAME == "char" */
+
+ switch (TYPE_CODE (target))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ children = TYPE_NFIELDS (target);
+ break;
+
+ case TYPE_CODE_FUNC:
+ case TYPE_CODE_VOID:
+ children = 0;
+ break;
+
+ default:
+ children = 1;
+ }
+ break;
+
+ default:
+ /* Other types have no children */
+ break;
+ }
+
+ return children;
+}
+
+static char *
+c_name_of_variable (struct varobj *parent)
+{
+ return savestring (parent->name, strlen (parent->name));
+}
+
+static char *
+c_name_of_child (struct varobj *parent, int index)
+{
+ struct type *type;
+ struct type *target;
+ char *name;
+ char *string;
+
+ type = get_type (parent);
+ target = get_target_type (type);
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ {
+ /* We never get here unless parent->num_children is greater than 0... */
+ int len = 1;
+ while ((int) pow ((double) 10, (double) len) < index)
+ len++;
+ name = (char *) xmalloc (1 + len * sizeof (char));
+ sprintf (name, "%d", index);
+ }
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ string = TYPE_FIELD_NAME (type, index);
+ name = savestring (string, strlen (string));
+ break;
+
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (target))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ string = TYPE_FIELD_NAME (target, index);
+ name = savestring (string, strlen (string));
+ break;
+
+ default:
+ name =
+ (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
+ sprintf (name, "*%s", parent->name);
+ break;
+ }
+ break;
+
+ default:
+ /* This should not happen */
+ name = xstrdup ("???");
+ }
+
+ return name;
+}
+
+static struct value *
+c_value_of_root (struct varobj **var_handle)
+{
+ struct value *new_val;
+ struct varobj *var = *var_handle;
+ struct frame_info *fi;
+ int within_scope;
+
+ /* Only root variables can be updated... */
+ if (var->root->rootvar != var)
+ /* Not a root var */
+ return NULL;
+
+
+ /* Determine whether the variable is still around. */
+ if (var->root->valid_block == NULL)
+ within_scope = 1;
+ else
+ {
+ reinit_frame_cache ();
+
+
+ fi = find_frame_addr_in_frame_chain (var->root->frame);
+
+ within_scope = fi != NULL;
+ /* FIXME: select_frame could fail */
+ if (within_scope)
+ select_frame (fi, -1);
+ }
+
+ if (within_scope)
+ {
+ /* We need to catch errors here, because if evaluate
+ expression fails we just want to make val->error = 1 and
+ go on */
+ if (gdb_evaluate_expression (var->root->exp, &new_val))
+ {
+ if (VALUE_LAZY (new_val))
+ {
+ /* We need to catch errors because if
+ value_fetch_lazy fails we still want to continue
+ (after making val->error = 1) */
+ /* FIXME: Shouldn't be using VALUE_CONTENTS? The
+ comment on value_fetch_lazy() says it is only
+ called from the macro... */
+ if (!gdb_value_fetch_lazy (new_val))
+ var->error = 1;
+ else
+ var->error = 0;
+ }
+ }
+ else
+ var->error = 1;
+
+ release_value (new_val);
+ return new_val;
+ }
+
+ return NULL;
+}
+
+static struct value *
+c_value_of_child (struct varobj *parent, int index)
+{
+ struct value *value;
+ struct value *temp;
+ struct value *indval;
+ struct type *type, *target;
+ char *name;
+
+ type = get_type (parent);
+ target = get_target_type (type);
+ name = name_of_child (parent, index);
+ temp = parent->value;
+ value = NULL;
+
+ if (temp != NULL)
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+#if 0
+ /* This breaks if the array lives in a (vector) register. */
+ value = value_slice (temp, index, 1);
+ temp = value_coerce_array (value);
+ gdb_value_ind (temp, &value);
+#else
+ indval = value_from_longest (builtin_type_int, (LONGEST) index);
+ gdb_value_subscript (temp, indval, &value);
+#endif
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ break;
+
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (target))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ break;
+
+ default:
+ gdb_value_ind (temp, &value);
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (value != NULL)
+ release_value (value);
+
+ xfree (name);
+ return value;
+}
+
+static struct type *
+c_type_of_child (struct varobj *parent, int index)
+{
+ struct type *type;
+ char *name = name_of_child (parent, index);
+
+ switch (TYPE_CODE (parent->type))
+ {
+ case TYPE_CODE_ARRAY:
+ type = TYPE_TARGET_TYPE (parent->type);
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ type = lookup_struct_elt_type (parent->type, name, 0);
+ break;
+
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (TYPE_TARGET_TYPE (parent->type)))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ type = lookup_struct_elt_type (parent->type, name, 0);
+ break;
+
+ default:
+ type = TYPE_TARGET_TYPE (parent->type);
+ break;
+ }
+ break;
+
+ default:
+ /* This should not happen as only the above types have children */
+ warning ("Child of parent whose type does not allow children");
+ /* FIXME: Can we still go on? */
+ type = NULL;
+ break;
+ }
+
+ xfree (name);
+ return type;
+}
+
+static int
+c_variable_editable (struct varobj *var)
+{
+ switch (TYPE_CODE (get_type (var)))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_ARRAY:
+ case TYPE_CODE_FUNC:
+ case TYPE_CODE_MEMBER:
+ case TYPE_CODE_METHOD:
+ return 0;
+ break;
+
+ default:
+ return 1;
+ break;
+ }
+}
+
+static char *
+c_value_of_variable (struct varobj *var)
+{
+ struct type *type;
+
+ /* BOGUS: if val_print sees a struct/class, it will print out its
+ children instead of "{...}" */
+ type = get_type (var);
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ return xstrdup ("{...}");
+ /* break; */
+
+ case TYPE_CODE_ARRAY:
+ {
+ char number[18];
+ sprintf (number, "[%d]", var->num_children);
+ return xstrdup (number);
+ }
+ /* break; */
+
+ default:
+ {
+ long dummy;
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *old_chain = make_cleanup_ui_file_delete (stb);
+ char *thevalue;
+
+ if (var->value == NULL)
+ {
+ /* This can happen if we attempt to get the value of a struct
+ member when the parent is an invalid pointer. This is an
+ error condition, so we should tell the caller. */
+ return NULL;
+ }
+ else
+ {
+ if (VALUE_LAZY (var->value))
+ gdb_value_fetch_lazy (var->value);
+ val_print (VALUE_TYPE (var->value), VALUE_CONTENTS_RAW (var->value), 0,
+ VALUE_ADDRESS (var->value),
+ stb, format_code[(int) var->format], 1, 0, 0);
+ thevalue = ui_file_xstrdup (stb, &dummy);
+ do_cleanups (old_chain);
+ }
+
+ return thevalue;
+ }
+ /* break; */
+ }
+}
+
+
+/* C++ */
+
+static int
+cplus_number_of_children (struct varobj *var)
+{
+ struct type *type;
+ int children, dont_know;
+
+ dont_know = 1;
+ children = 0;
+
+ if (!CPLUS_FAKE_CHILD (var))
+ {
+ type = get_type_deref (var);
+
+ if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
+ ((TYPE_CODE (type)) == TYPE_CODE_UNION))
+ {
+ int kids[3];
+
+ cplus_class_num_children (type, kids);
+ if (kids[v_public] != 0)
+ children++;
+ if (kids[v_private] != 0)
+ children++;
+ if (kids[v_protected] != 0)
+ children++;
+
+ /* Add any baseclasses */
+ children += TYPE_N_BASECLASSES (type);
+ dont_know = 0;
+
+ /* FIXME: save children in var */
+ }
+ }
+ else
+ {
+ int kids[3];
+
+ type = get_type_deref (var->parent);
+
+ cplus_class_num_children (type, kids);
+ if (STREQ (var->name, "public"))
+ children = kids[v_public];
+ else if (STREQ (var->name, "private"))
+ children = kids[v_private];
+ else
+ children = kids[v_protected];
+ dont_know = 0;
+ }
+
+ if (dont_know)
+ children = c_number_of_children (var);
+
+ return children;
+}
+
+/* Compute # of public, private, and protected variables in this class.
+ That means we need to descend into all baseclasses and find out
+ how many are there, too. */
+static void
+cplus_class_num_children (struct type *type, int children[3])
+{
+ int i;
+
+ children[v_public] = 0;
+ children[v_private] = 0;
+ children[v_protected] = 0;
+
+ for (i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++)
+ {
+ /* If we have a virtual table pointer, omit it. */
+ if (TYPE_VPTR_BASETYPE (type) == type && TYPE_VPTR_FIELDNO (type) == i)
+ continue;
+
+ if (TYPE_FIELD_PROTECTED (type, i))
+ children[v_protected]++;
+ else if (TYPE_FIELD_PRIVATE (type, i))
+ children[v_private]++;
+ else
+ children[v_public]++;
+ }
+}
+
+static char *
+cplus_name_of_variable (struct varobj *parent)
+{
+ return c_name_of_variable (parent);
+}
+
+static char *
+cplus_name_of_child (struct varobj *parent, int index)
+{
+ char *name;
+ struct type *type;
+ int children[3];
+
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ /* Looking for children of public, private, or protected. */
+ type = get_type_deref (parent->parent);
+ }
+ else
+ type = get_type_deref (parent);
+
+ name = NULL;
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ cplus_class_num_children (type, children);
+
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ int i;
+
+ /* Skip over vptr, if it exists. */
+ if (TYPE_VPTR_BASETYPE (type) == type
+ && index >= TYPE_VPTR_FIELDNO (type))
+ index++;
+
+ /* FIXME: This assumes that type orders
+ inherited, public, private, protected */
+ i = index + TYPE_N_BASECLASSES (type);
+ if (STREQ (parent->name, "private") || STREQ (parent->name, "protected"))
+ i += children[v_public];
+ if (STREQ (parent->name, "protected"))
+ i += children[v_private];
+
+ name = TYPE_FIELD_NAME (type, i);
+ }
+ else if (index < TYPE_N_BASECLASSES (type))
+ name = TYPE_FIELD_NAME (type, index);
+ else
+ {
+ /* Everything beyond the baseclasses can
+ only be "public", "private", or "protected" */
+ index -= TYPE_N_BASECLASSES (type);
+ switch (index)
+ {
+ case 0:
+ if (children[v_public] != 0)
+ {
+ name = "public";
+ break;
+ }
+ case 1:
+ if (children[v_private] != 0)
+ {
+ name = "private";
+ break;
+ }
+ case 2:
+ if (children[v_protected] != 0)
+ {
+ name = "protected";
+ break;
+ }
+ default:
+ /* error! */
+ break;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (name == NULL)
+ return c_name_of_child (parent, index);
+ else
+ {
+ if (name != NULL)
+ name = savestring (name, strlen (name));
+ }
+
+ return name;
+}
+
+static struct value *
+cplus_value_of_root (struct varobj **var_handle)
+{
+ return c_value_of_root (var_handle);
+}
+
+static struct value *
+cplus_value_of_child (struct varobj *parent, int index)
+{
+ struct type *type;
+ struct value *value;
+
+ if (CPLUS_FAKE_CHILD (parent))
+ type = get_type_deref (parent->parent);
+ else
+ type = get_type_deref (parent);
+
+ value = NULL;
+
+ if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
+ ((TYPE_CODE (type)) == TYPE_CODE_UNION))
+ {
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ char *name;
+ struct value *temp = parent->parent->value;
+
+ if (temp == NULL)
+ return NULL;
+
+ name = name_of_child (parent, index);
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "cplus_structure");
+ if (value != NULL)
+ release_value (value);
+
+ xfree (name);
+ }
+ else if (index >= TYPE_N_BASECLASSES (type))
+ {
+ /* public, private, or protected */
+ return NULL;
+ }
+ else
+ {
+ /* Baseclass */
+ if (parent->value != NULL)
+ {
+ struct value *temp = NULL;
+
+ if (TYPE_CODE (VALUE_TYPE (parent->value)) == TYPE_CODE_PTR
+ || TYPE_CODE (VALUE_TYPE (parent->value)) == TYPE_CODE_REF)
+ {
+ if (!gdb_value_ind (parent->value, &temp))
+ return NULL;
+ }
+ else
+ temp = parent->value;
+
+ if (temp != NULL)
+ {
+ value = value_cast (TYPE_FIELD_TYPE (type, index), temp);
+ release_value (value);
+ }
+ else
+ {
+ /* We failed to evaluate the parent's value, so don't even
+ bother trying to evaluate this child. */
+ return NULL;
+ }
+ }
+ }
+ }
+
+ if (value == NULL)
+ return c_value_of_child (parent, index);
+
+ return value;
+}
+
+static struct type *
+cplus_type_of_child (struct varobj *parent, int index)
+{
+ struct type *type, *t;
+
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ /* Looking for the type of a child of public, private, or protected. */
+ t = get_type_deref (parent->parent);
+ }
+ else
+ t = get_type_deref (parent);
+
+ type = NULL;
+ switch (TYPE_CODE (t))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ char *name = cplus_name_of_child (parent, index);
+ type = lookup_struct_elt_type (t, name, 0);
+ xfree (name);
+ }
+ else if (index < TYPE_N_BASECLASSES (t))
+ type = TYPE_FIELD_TYPE (t, index);
+ else
+ {
+ /* special */
+ return NULL;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (type == NULL)
+ return c_type_of_child (parent, index);
+
+ return type;
+}
+
+static int
+cplus_variable_editable (struct varobj *var)
+{
+ if (CPLUS_FAKE_CHILD (var))
+ return 0;
+
+ return c_variable_editable (var);
+}
+
+static char *
+cplus_value_of_variable (struct varobj *var)
+{
+
+ /* If we have one of our special types, don't print out
+ any value. */
+ if (CPLUS_FAKE_CHILD (var))
+ return xstrdup ("");
+
+ return c_value_of_variable (var);
+}
+
+/* Java */
+
+static int
+java_number_of_children (struct varobj *var)
+{
+ return cplus_number_of_children (var);
+}
+
+static char *
+java_name_of_variable (struct varobj *parent)
+{
+ char *p, *name;
+
+ name = cplus_name_of_variable (parent);
+ /* If the name has "-" in it, it is because we
+ needed to escape periods in the name... */
+ p = name;
+
+ while (*p != '\000')
+ {
+ if (*p == '-')
+ *p = '.';
+ p++;
+ }
+
+ return name;
+}
+
+static char *
+java_name_of_child (struct varobj *parent, int index)
+{
+ char *name, *p;
+
+ name = cplus_name_of_child (parent, index);
+ /* Escape any periods in the name... */
+ p = name;
+
+ while (*p != '\000')
+ {
+ if (*p == '.')
+ *p = '-';
+ p++;
+ }
+
+ return name;
+}
+
+static struct value *
+java_value_of_root (struct varobj **var_handle)
+{
+ return cplus_value_of_root (var_handle);
+}
+
+static struct value *
+java_value_of_child (struct varobj *parent, int index)
+{
+ return cplus_value_of_child (parent, index);
+}
+
+static struct type *
+java_type_of_child (struct varobj *parent, int index)
+{
+ return cplus_type_of_child (parent, index);
+}
+
+static int
+java_variable_editable (struct varobj *var)
+{
+ return cplus_variable_editable (var);
+}
+
+static char *
+java_value_of_variable (struct varobj *var)
+{
+ return cplus_value_of_variable (var);
+}
+
+extern void _initialize_varobj (void);
+void
+_initialize_varobj (void)
+{
+ int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE;
+
+ varobj_table = xmalloc (sizeof_table);
+ memset (varobj_table, 0, sizeof_table);
+
+ add_show_from_set (add_set_cmd ("debugvarobj", class_maintenance, var_zinteger, (char *) &varobjdebug, "Set varobj debugging.\n\
+When non-zero, varobj debugging is enabled.", &setlist),
+ &showlist);
+}
diff --git a/contrib/gdb/gdb/varobj.h b/contrib/gdb/gdb/varobj.h
new file mode 100644
index 0000000..cd30233
--- /dev/null
+++ b/contrib/gdb/gdb/varobj.h
@@ -0,0 +1,100 @@
+/* GDB variable objects API.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef VAROBJ_H
+#define VAROBJ_H 1
+
+#include "symtab.h"
+#include "gdbtypes.h"
+
+/* Enumeration for the format types */
+enum varobj_display_formats
+ {
+ FORMAT_NATURAL, /* What gdb actually calls 'natural' */
+ FORMAT_BINARY, /* Binary display */
+ FORMAT_DECIMAL, /* Decimal display */
+ FORMAT_HEXADECIMAL, /* Hex display */
+ FORMAT_OCTAL /* Octal display */
+ };
+
+enum varobj_type
+ {
+ USE_SPECIFIED_FRAME, /* Use the frame passed to varobj_create */
+ USE_CURRENT_FRAME, /* Use the current frame */
+ USE_SELECTED_FRAME /* Always reevaluate in selected frame */
+ };
+
+/* String representations of gdb's format codes (defined in varobj.c) */
+extern char *varobj_format_string[];
+
+/* Languages supported by this variable objects system. */
+enum varobj_languages
+ {
+ vlang_unknown = 0, vlang_c, vlang_cplus, vlang_java, vlang_end
+ };
+
+/* String representations of gdb's known languages (defined in varobj.c) */
+extern char *varobj_language_string[];
+
+/* Struct thar describes a variable object instance */
+struct varobj;
+
+/* API functions */
+
+extern struct varobj *varobj_create (char *objname,
+ char *expression, CORE_ADDR frame,
+ enum varobj_type type);
+
+extern char *varobj_gen_name (void);
+
+extern struct varobj *varobj_get_handle (char *name);
+
+extern char *varobj_get_objname (struct varobj *var);
+
+extern char *varobj_get_expression (struct varobj *var);
+
+extern int varobj_delete (struct varobj *var, char ***dellist,
+ int only_children);
+
+extern enum varobj_display_formats varobj_set_display_format (
+ struct varobj *var,
+ enum varobj_display_formats format);
+
+extern enum varobj_display_formats varobj_get_display_format (
+ struct varobj *var);
+
+extern int varobj_get_num_children (struct varobj *var);
+
+extern int varobj_list_children (struct varobj *var,
+ struct varobj ***childlist);
+
+extern char *varobj_get_type (struct varobj *var);
+
+extern enum varobj_languages varobj_get_language (struct varobj *var);
+
+extern int varobj_get_attributes (struct varobj *var);
+
+extern char *varobj_get_value (struct varobj *var);
+
+extern int varobj_set_value (struct varobj *var, char *expression);
+
+extern int varobj_list (struct varobj ***rootlist);
+
+extern int varobj_update (struct varobj **varp, struct varobj ***changelist);
+
+#endif /* VAROBJ_H */
diff --git a/contrib/gdb/gdb/version.h b/contrib/gdb/gdb/version.h
new file mode 100644
index 0000000..b324af9
--- /dev/null
+++ b/contrib/gdb/gdb/version.h
@@ -0,0 +1,33 @@
+/* Version information for GDB.
+ Copyright 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. */
+
+#ifndef VERSION_H
+#define VERSION_H
+
+/* Version number of GDB, as a string. */
+extern const char version[];
+
+/* Canonical host name as a string. */
+extern const char host_name[];
+
+/* Canonical target name as a string. */
+extern const char target_name[];
+
+#endif /* #ifndef VERSION_H */
diff --git a/contrib/gdb/gdb/version.in b/contrib/gdb/gdb/version.in
new file mode 100644
index 0000000..954676d
--- /dev/null
+++ b/contrib/gdb/gdb/version.in
@@ -0,0 +1 @@
+5.2.0_2002-06-27-cvs
diff --git a/contrib/gdb/gdb/wrapper.c b/contrib/gdb/gdb/wrapper.c
new file mode 100644
index 0000000..6c9c6d6
--- /dev/null
+++ b/contrib/gdb/gdb/wrapper.c
@@ -0,0 +1,333 @@
+/* Longjump free calls to gdb internal routines.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "value.h"
+#include "wrapper.h"
+
+/* Use this struct to pass arguments to wrapper routines. We assume
+ (arbitrarily) that no gdb function takes more than ten arguments. */
+struct gdb_wrapper_arguments
+ {
+
+ /* Pointer to some result from the gdb function call, if any */
+ union wrapper_results
+ {
+ int integer;
+ void *pointer;
+ } result;
+
+
+ /* The list of arguments. */
+ union wrapper_args
+ {
+ int integer;
+ void *pointer;
+ } args[10];
+ };
+
+struct captured_value_struct_elt_args
+{
+ struct value **argp;
+ struct value **args;
+ char *name;
+ int *static_memfuncp;
+ char *err;
+ struct value **result_ptr;
+};
+
+static int wrap_parse_exp_1 (char *);
+
+static int wrap_evaluate_expression (char *);
+
+static int wrap_value_fetch_lazy (char *);
+
+static int wrap_value_equal (char *);
+
+static int wrap_value_assign (char *);
+
+static int wrap_value_subscript (char *);
+
+static int wrap_value_ind (char *opaque_arg);
+
+static int do_captured_value_struct_elt (struct ui_out *uiout, void *data);
+
+static int wrap_parse_and_eval_type (char *);
+
+int
+gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
+ struct expression **expression)
+{
+ struct gdb_wrapper_arguments args;
+ args.args[0].pointer = stringptr;
+ args.args[1].pointer = block;
+ args.args[2].integer = comma;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_parse_exp_1, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *expression = (struct expression *) args.result.pointer;
+ return 1;
+
+}
+
+static int
+wrap_parse_exp_1 (char *argptr)
+{
+ struct gdb_wrapper_arguments *args
+ = (struct gdb_wrapper_arguments *) argptr;
+ args->result.pointer = parse_exp_1((char **) args->args[0].pointer,
+ (struct block *) args->args[1].pointer,
+ args->args[2].integer);
+ return 1;
+}
+
+int
+gdb_evaluate_expression (struct expression *exp, struct value **value)
+{
+ struct gdb_wrapper_arguments args;
+ args.args[0].pointer = exp;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_evaluate_expression, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *value = (struct value *) args.result.pointer;
+ return 1;
+}
+
+static int
+wrap_evaluate_expression (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+
+ (args)->result.pointer =
+ (char *) evaluate_expression ((struct expression *) args->args[0].pointer);
+ return 1;
+}
+
+int
+gdb_value_fetch_lazy (struct value *value)
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = value;
+ return catch_errors ((catch_errors_ftype *) wrap_value_fetch_lazy, &args,
+ "", RETURN_MASK_ERROR);
+}
+
+static int
+wrap_value_fetch_lazy (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+
+ value_fetch_lazy ((struct value *) (args)->args[0].pointer);
+ return 1;
+}
+
+int
+gdb_value_equal (struct value *val1, struct value *val2, int *result)
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = val1;
+ args.args[1].pointer = val2;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_equal, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *result = args.result.integer;
+ return 1;
+}
+
+static int
+wrap_value_equal (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+ struct value *val1;
+ struct value *val2;
+
+ val1 = (struct value *) (args)->args[0].pointer;
+ val2 = (struct value *) (args)->args[1].pointer;
+
+ (args)->result.integer = value_equal (val1, val2);
+ return 1;
+}
+
+int
+gdb_value_assign (struct value *val1, struct value *val2, struct value **result)
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = val1;
+ args.args[1].pointer = val2;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_assign, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *result = (struct value *) args.result.pointer;
+ return 1;
+}
+
+static int
+wrap_value_assign (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+ struct value *val1;
+ struct value *val2;
+
+ val1 = (struct value *) (args)->args[0].pointer;
+ val2 = (struct value *) (args)->args[1].pointer;
+
+ (args)->result.pointer = value_assign (val1, val2);
+ return 1;
+}
+
+int
+gdb_value_subscript (struct value *val1, struct value *val2, struct value **rval)
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = val1;
+ args.args[1].pointer = val2;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_subscript, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *rval = (struct value *) args.result.pointer;
+ return 1;
+}
+
+static int
+wrap_value_subscript (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+ struct value *val1;
+ struct value *val2;
+
+ val1 = (struct value *) (args)->args[0].pointer;
+ val2 = (struct value *) (args)->args[1].pointer;
+
+ (args)->result.pointer = value_subscript (val1, val2);
+ return 1;
+}
+
+int
+gdb_value_ind (struct value *val, struct value **rval)
+{
+ struct gdb_wrapper_arguments args;
+
+ args.args[0].pointer = val;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_ind, &args,
+ "", RETURN_MASK_ERROR))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *rval = (struct value *) args.result.pointer;
+ return 1;
+}
+
+static int
+wrap_value_ind (char *opaque_arg)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) opaque_arg;
+ struct value *val;
+
+ val = (struct value *) (args)->args[0].pointer;
+ (args)->result.pointer = value_ind (val);
+ return 1;
+}
+
+int
+gdb_parse_and_eval_type (char *p, int length, struct type **type)
+{
+ struct gdb_wrapper_arguments args;
+ args.args[0].pointer = p;
+ args.args[1].integer = length;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_parse_and_eval_type, &args,
+ "", RETURN_MASK_ALL))
+ {
+ /* An error occurred */
+ return 0;
+ }
+
+ *type = (struct type *) args.result.pointer;
+ return 1;
+}
+
+static int
+wrap_parse_and_eval_type (char *a)
+{
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+
+ char *p = (char *) args->args[0].pointer;
+ int length = args->args[1].integer;
+
+ args->result.pointer = (char *) parse_and_eval_type (p, length);
+
+ return 1;
+}
+
+enum gdb_rc
+gdb_value_struct_elt (struct ui_out *uiout, struct value **result, struct value **argp,
+ struct value **args, char *name, int *static_memfuncp,
+ char *err)
+{
+ struct captured_value_struct_elt_args cargs;
+ cargs.argp = argp;
+ cargs.args = args;
+ cargs.name = name;
+ cargs.static_memfuncp = static_memfuncp;
+ cargs.err = err;
+ cargs.result_ptr = result;
+ return catch_exceptions (uiout, do_captured_value_struct_elt, &cargs,
+ NULL, RETURN_MASK_ALL);
+}
+
+static int
+do_captured_value_struct_elt (struct ui_out *uiout, void *data)
+{
+ struct captured_value_struct_elt_args *cargs = data;
+ *cargs->result_ptr = value_struct_elt (cargs->argp, cargs->args, cargs->name,
+ cargs->static_memfuncp, cargs->err);
+ return GDB_RC_OK;
+}
+
diff --git a/contrib/gdb/gdb/wrapper.h b/contrib/gdb/gdb/wrapper.h
new file mode 100644
index 0000000..977a77d
--- /dev/null
+++ b/contrib/gdb/gdb/wrapper.h
@@ -0,0 +1,49 @@
+/* Longjump free calls to gdb internal routines.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef WRAPPER_H
+#define WRAPPER_H 1
+#include "gdb.h"
+
+struct value;
+
+/* Use this struct to pass arguments to wrapper routines. */
+struct gdb_wrapper_arguments;
+
+extern int gdb_parse_exp_1 (char **, struct block *,
+ int, struct expression **);
+
+extern int gdb_evaluate_expression (struct expression *, struct value **);
+
+extern int gdb_value_fetch_lazy (struct value *);
+
+extern int gdb_value_equal (struct value *, struct value *, int *);
+
+extern int gdb_value_assign (struct value *, struct value *, struct value **);
+
+extern int gdb_value_subscript (struct value *, struct value *, struct value **);
+
+extern enum gdb_rc gdb_value_struct_elt (struct ui_out *uiout, struct value **result_ptr,
+ struct value **argp, struct value **args,
+ char *name, int *static_memfuncp, char *err);
+
+extern int gdb_value_ind (struct value *val, struct value ** rval);
+
+extern int gdb_parse_and_eval_type (char *, int, struct type **);
+
+#endif /* WRAPPER_H */
diff --git a/contrib/gdb/gdb/x86-64-linux-nat.c b/contrib/gdb/gdb/x86-64-linux-nat.c
new file mode 100644
index 0000000..fd70572
--- /dev/null
+++ b/contrib/gdb/gdb/x86-64-linux-nat.c
@@ -0,0 +1,449 @@
+/* Native-dependent code for GNU/Linux x86-64.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ Contributed by Jiri Smid, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "regcache.h"
+#include "i387-nat.h"
+#include "gdb_assert.h"
+#include "x86-64-tdep.h"
+
+#include <sys/ptrace.h>
+#include <sys/debugreg.h>
+#include <sys/syscall.h>
+#include <sys/procfs.h>
+#include <sys/reg.h>
+
+/* Mapping between the general-purpose registers in `struct user'
+ format and GDB's register array layout. */
+
+static int x86_64_regmap[] = {
+ RAX, RBX, RCX, RDX,
+ RSI, RDI, RBP, RSP,
+ R8, R9, R10, R11,
+ R12, R13, R14, R15,
+ RIP, EFLAGS,
+ DS, ES, FS, GS
+};
+
+static unsigned long
+x86_64_linux_dr_get (int regnum)
+{
+ int tid;
+ unsigned long value;
+
+ /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
+ multi-threaded processes here. For now, pretend there is just
+ one thread. */
+ tid = PIDGET (inferior_ptid);
+
+ /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
+ ptrace call fails breaks debugging remote targets. The correct
+ way to fix this is to add the hardware breakpoint and watchpoint
+ stuff to the target vectore. For now, just return zero if the
+ ptrace call fails. */
+ errno = 0;
+ value = ptrace (PT_READ_U, tid,
+ offsetof (struct user, u_debugreg[regnum]), 0);
+ if (errno != 0)
+#if 0
+ perror_with_name ("Couldn't read debug register");
+#else
+ return 0;
+#endif
+
+ return value;
+}
+
+static void
+x86_64_linux_dr_set (int regnum, unsigned long value)
+{
+ int tid;
+
+ /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
+ multi-threaded processes here. For now, pretend there is just
+ one thread. */
+ tid = PIDGET (inferior_ptid);
+
+ errno = 0;
+ ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
+ if (errno != 0)
+ perror_with_name ("Couldn't write debug register");
+}
+
+void
+x86_64_linux_dr_set_control (unsigned long control)
+{
+ x86_64_linux_dr_set (DR_CONTROL, control);
+}
+
+void
+x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+{
+ gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+
+ x86_64_linux_dr_set (DR_FIRSTADDR + regnum, addr);
+}
+
+void
+x86_64_linux_dr_reset_addr (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+
+ x86_64_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
+}
+
+unsigned long
+x86_64_linux_dr_get_status (void)
+{
+ return x86_64_linux_dr_get (DR_STATUS);
+}
+
+
+/* The register sets used in GNU/Linux ELF core-dumps are identical to
+ the register sets used by `ptrace'. */
+
+#define GETREGS_SUPPLIES(regno) \
+ (0 <= (regno) && (regno) < x86_64_num_gregs)
+#define GETFPREGS_SUPPLIES(regno) \
+ (FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
+
+
+/* Transfering the general-purpose registers between GDB, inferiors
+ and core files. */
+
+/* Fill GDB's register array with the general-purpose register values
+ in *GREGSETP. */
+
+void
+supply_gregset (elf_gregset_t * gregsetp)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < x86_64_num_gregs; i++)
+ supply_register (i, (char *) (regp + x86_64_regmap[i]));
+}
+
+/* Fill register REGNO (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_gregset (elf_gregset_t * gregsetp, int regno)
+{
+ elf_greg_t *regp = (elf_greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < x86_64_num_gregs; i++)
+ if ((regno == -1 || regno == i))
+ read_register_gen (i, regp + x86_64_regmap[i]);
+}
+
+/* Fetch all general-purpose registers from process/thread TID and
+ store their values in GDB's register array. */
+
+static void
+fetch_regs (int tid)
+{
+ elf_gregset_t regs;
+
+ if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
+ perror_with_name ("Couldn't get registers");
+
+ supply_gregset (&regs);
+}
+
+/* Store all valid general-purpose registers in GDB's register array
+ into the process/thread specified by TID. */
+
+static void
+store_regs (int tid, int regno)
+{
+ elf_gregset_t regs;
+
+ if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
+ perror_with_name ("Couldn't get registers");
+
+ fill_gregset (&regs, regno);
+
+ if (ptrace (PTRACE_SETREGS, tid, 0, (long) &regs) < 0)
+ perror_with_name ("Couldn't write registers");
+}
+
+
+/* Transfering floating-point registers between GDB, inferiors and cores. */
+
+/* Fill GDB's register array with the floating-point register values in
+ *FPREGSETP. */
+
+void
+supply_fpregset (elf_fpregset_t * fpregsetp)
+{
+ i387_supply_fxsave ((char *) fpregsetp);
+}
+
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_fpregset (elf_fpregset_t * fpregsetp, int regno)
+{
+ i387_fill_fxsave ((char *) fpregsetp, regno);
+}
+
+/* Fetch all floating-point registers from process/thread TID and store
+ thier values in GDB's register array. */
+
+static void
+fetch_fpregs (int tid)
+{
+ elf_fpregset_t fpregs;
+
+ if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0)
+ perror_with_name ("Couldn't get floating point status");
+
+ supply_fpregset (&fpregs);
+}
+
+/* Store all valid floating-point registers in GDB's register array
+ into the process/thread specified by TID. */
+
+static void
+store_fpregs (int tid, int regno)
+{
+ elf_fpregset_t fpregs;
+
+ if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0)
+ perror_with_name ("Couldn't get floating point status");
+
+ fill_fpregset (&fpregs, regno);
+
+ if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0)
+ perror_with_name ("Couldn't write floating point status");
+}
+
+
+/* Transferring arbitrary registers between GDB and inferior. */
+
+/* Fetch register REGNO from the child process. If REGNO is -1, do
+ this for all registers (including the floating point and SSE
+ registers). */
+
+void
+fetch_inferior_registers (int regno)
+{
+ int tid;
+
+ /* GNU/Linux LWP ID's are process ID's. */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+
+ if (regno == -1)
+ {
+ fetch_regs (tid);
+ fetch_fpregs (tid);
+ return;
+ }
+
+ if (GETREGS_SUPPLIES (regno))
+ {
+ fetch_regs (tid);
+ return;
+ }
+
+ if (GETFPREGS_SUPPLIES (regno))
+ {
+ fetch_fpregs (tid);
+ return;
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "Got request for bad register number %d.", regno);
+}
+
+/* Store register REGNO back into the child process. If REGNO is -1,
+ do this for all registers (including the floating point and SSE
+ registers). */
+void
+store_inferior_registers (int regno)
+{
+ int tid;
+
+ /* GNU/Linux LWP ID's are process ID's. */
+ if ((tid = TIDGET (inferior_ptid)) == 0)
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
+
+ if (regno == -1)
+ {
+ store_regs (tid, regno);
+ store_fpregs (tid, regno);
+ return;
+ }
+
+ if (GETREGS_SUPPLIES (regno))
+ {
+ store_regs (tid, regno);
+ return;
+ }
+
+ if (GETFPREGS_SUPPLIES (regno))
+ {
+ store_fpregs (tid, regno);
+ return;
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "Got request to store bad register number %d.", regno);
+}
+
+
+static const unsigned char linux_syscall[] = { 0x0f, 0x05 };
+
+#define LINUX_SYSCALL_LEN (sizeof linux_syscall)
+
+/* The system call number is stored in the %rax register. */
+#define LINUX_SYSCALL_REGNUM 0 /* %rax */
+
+/* We are specifically interested in the sigreturn and rt_sigreturn
+ system calls. */
+
+#ifndef SYS_sigreturn
+#define SYS_sigreturn __NR_sigreturn
+#endif
+#ifndef SYS_rt_sigreturn
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#endif
+
+/* Offset to saved processor flags, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_EFLAGS_OFFSET (152)
+/* Offset to saved processor registers from <asm/ucontext.h> */
+#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET (36)
+
+/* Interpreting register set info found in core files. */
+/* Provide registers to GDB from a core file.
+
+ CORE_REG_SECT points to an array of bytes, which are the contents
+ of a `note' from a core file which BFD thinks might contain
+ register contents. CORE_REG_SIZE is its size.
+
+ WHICH says which register set corelow suspects this is:
+ 0 --- the general-purpose register set, in elf_gregset_t format
+ 2 --- the floating-point register set, in elf_fpregset_t format
+
+ REG_ADDR isn't used on GNU/Linux. */
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR reg_addr)
+{
+ elf_gregset_t gregset;
+ elf_fpregset_t fpregset;
+ switch (which)
+ {
+ case 0:
+ if (core_reg_size != sizeof (gregset))
+ warning ("Wrong size gregset in core file.");
+ else
+ {
+ memcpy (&gregset, core_reg_sect, sizeof (gregset));
+ supply_gregset (&gregset);
+ }
+ break;
+
+ case 2:
+ if (core_reg_size != sizeof (fpregset))
+ warning ("Wrong size fpregset in core file.");
+ else
+ {
+ memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
+ supply_fpregset (&fpregset);
+ }
+ break;
+
+ default:
+ /* We've covered all the kinds of registers we know about here,
+ so this must be something we wouldn't know what to do with
+ anyway. Just ignore it. */
+ break;
+ }
+}
+
+/* Register that we are able to handle GNU/Linux ELF core file formats. */
+
+static struct core_fns linux_elf_core_fns = {
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+
+#if !defined (offsetof)
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+
+/* Record the value of the debug control register. */
+static long debug_control_mirror;
+
+/* Record which address associates with which register. */
+static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1];
+
+/* Return the address of register REGNUM. BLOCKEND is the value of
+ u.u_ar0, which should point to the registers. */
+CORE_ADDR
+x86_64_register_u_addr (CORE_ADDR blockend, int regnum)
+{
+ struct user u;
+ CORE_ADDR fpstate;
+ CORE_ADDR ubase;
+ ubase = blockend;
+ if (IS_FP_REGNUM (regnum))
+ {
+ fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u);
+ return (fpstate + 16 * (regnum - FP0_REGNUM));
+ }
+ else if (IS_SSE_REGNUM (regnum))
+ {
+ fpstate = ubase + ((char *) &u.i387.xmm_space - (char *) &u);
+ return (fpstate + 16 * (regnum - XMM0_REGNUM));
+ }
+ else
+ return (ubase + 8 * x86_64_regmap[regnum]);
+}
+
+void
+_initialize_x86_64_linux_nat (void)
+{
+ add_core_fns (&linux_elf_core_fns);
+}
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+
diff --git a/contrib/gdb/gdb/x86-64-linux-tdep.c b/contrib/gdb/gdb/x86-64-linux-tdep.c
new file mode 100644
index 0000000..171ec9c
--- /dev/null
+++ b/contrib/gdb/gdb/x86-64-linux-tdep.c
@@ -0,0 +1,136 @@
+/* Target-dependent code for GNU/Linux running on x86-64, for GDB.
+
+ Copyright 2001 Free Software Foundation, Inc.
+
+ Contributed by Jiri Smid, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "regcache.h"
+#include "x86-64-tdep.h"
+#include "dwarf2cfi.h"
+
+#define LINUX_SIGTRAMP_INSN0 (0x48) /* mov $NNNNNNNN,%rax */
+#define LINUX_SIGTRAMP_OFFSET0 (0)
+#define LINUX_SIGTRAMP_INSN1 (0x0f) /* syscall */
+#define LINUX_SIGTRAMP_OFFSET1 (7)
+
+static const unsigned char linux_sigtramp_code[] = {
+ LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x89, 0x00, 0x00, 0x00, /* mov $0x89,%rax */
+ LINUX_SIGTRAMP_INSN1, 0x05 /* syscall */
+};
+
+#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
+
+/* If PC is in a sigtramp routine, return the address of the start of
+ the routine. Otherwise, return 0. */
+
+static CORE_ADDR
+x86_64_linux_sigtramp_start (CORE_ADDR pc)
+{
+ unsigned char buf[LINUX_SIGTRAMP_LEN];
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ if (buf[0] != LINUX_SIGTRAMP_INSN0)
+ {
+ if (buf[0] != LINUX_SIGTRAMP_INSN1)
+ return 0;
+
+ pc -= LINUX_SIGTRAMP_OFFSET1;
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+ }
+
+ if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ return pc;
+}
+
+#define LINUX_SIGINFO_SIZE 128
+
+/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
+#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET (36)
+
+/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
+ address of the associated sigcontext structure. */
+CORE_ADDR
+x86_64_linux_sigcontext_addr (struct frame_info *frame)
+{
+ CORE_ADDR pc;
+
+ pc = x86_64_linux_sigtramp_start (frame->pc);
+ if (pc)
+ {
+ if (frame->next)
+ /* If this isn't the top frame, the next frame must be for the
+ signal handler itself. The sigcontext structure is part of
+ the user context. */
+ return frame->next->frame + LINUX_SIGINFO_SIZE +
+ LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+
+
+ /* This is the top frame. */
+ return read_register (SP_REGNUM) + LINUX_SIGINFO_SIZE +
+ LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+
+ }
+
+ error ("Couldn't recognize signal trampoline.");
+ return 0;
+}
+
+/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_PC_OFFSET (136)
+
+/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
+ saved program counter. */
+
+CORE_ADDR
+x86_64_linux_sigtramp_saved_pc (struct frame_info *frame)
+{
+ CORE_ADDR addr;
+
+ addr = x86_64_linux_sigcontext_addr (frame);
+ return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8);
+}
+
+/* Immediately after a function call, return the saved pc. */
+
+CORE_ADDR
+x86_64_linux_saved_pc_after_call (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return x86_64_linux_sigtramp_saved_pc (frame);
+
+ return read_memory_integer (read_register (SP_REGNUM), 8);
+}
+
+/* Saved Pc. Get it from sigcontext if within sigtramp. */
+CORE_ADDR
+x86_64_linux_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return x86_64_linux_sigtramp_saved_pc (frame);
+ return cfi_get_ra (frame);
+}
diff --git a/contrib/gdb/gdb/x86-64-tdep.c b/contrib/gdb/gdb/x86-64-tdep.c
new file mode 100644
index 0000000..3ebc1b2
--- /dev/null
+++ b/contrib/gdb/gdb/x86-64-tdep.c
@@ -0,0 +1,1102 @@
+/* Target-dependent code for the x86-64 for GDB, the GNU debugger.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+
+ Contributed by Jiri Smid, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ 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 "gdbcmd.h"
+#include "arch-utils.h"
+#include "regcache.h"
+#include "symfile.h"
+#include "x86-64-tdep.h"
+#include "dwarf2cfi.h"
+#include "gdb_assert.h"
+
+/* Register numbers of various important registers. */
+#define RAX_REGNUM 0
+#define RDX_REGNUM 3
+#define RDI_REGNUM 5
+#define EFLAGS_REGNUM 17
+#define XMM1_REGNUM 39
+
+struct register_info
+{
+ int size;
+ char *name;
+ struct type **type;
+};
+
+/* x86_64_register_raw_size_table[i] is the number of bytes of storage in
+ GDB's register array occupied by register i. */
+static struct register_info x86_64_register_info_table[] = {
+ {8, "rax", &builtin_type_int64},
+ {8, "rbx", &builtin_type_int64},
+ {8, "rcx", &builtin_type_int64},
+ {8, "rdx", &builtin_type_int64},
+ {8, "rsi", &builtin_type_int64},
+ {8, "rdi", &builtin_type_int64},
+ {8, "rbp", &builtin_type_void_func_ptr},
+ {8, "rsp", &builtin_type_void_func_ptr},
+ {8, "r8", &builtin_type_int64},
+ {8, "r9", &builtin_type_int64},
+ {8, "r10", &builtin_type_int64},
+ {8, "r11", &builtin_type_int64},
+ {8, "r12", &builtin_type_int64},
+ {8, "r13", &builtin_type_int64},
+ {8, "r14", &builtin_type_int64},
+ {8, "r15", &builtin_type_int64},
+ {8, "rip", &builtin_type_void_func_ptr},
+ {4, "eflags", &builtin_type_int32},
+ {4, "ds", &builtin_type_int32},
+ {4, "es", &builtin_type_int32},
+ {4, "fs", &builtin_type_int32},
+ {4, "gs", &builtin_type_int32},
+ {10, "st0", &builtin_type_i387_ext},
+ {10, "st1", &builtin_type_i387_ext},
+ {10, "st2", &builtin_type_i387_ext},
+ {10, "st3", &builtin_type_i387_ext},
+ {10, "st4", &builtin_type_i387_ext},
+ {10, "st5", &builtin_type_i387_ext},
+ {10, "st6", &builtin_type_i387_ext},
+ {10, "st7", &builtin_type_i387_ext},
+ {4, "fctrl", &builtin_type_int32},
+ {4, "fstat", &builtin_type_int32},
+ {4, "ftag", &builtin_type_int32},
+ {4, "fiseg", &builtin_type_int32},
+ {4, "fioff", &builtin_type_int32},
+ {4, "foseg", &builtin_type_int32},
+ {4, "fooff", &builtin_type_int32},
+ {4, "fop", &builtin_type_int32},
+ {16, "xmm0", &builtin_type_v4sf},
+ {16, "xmm1", &builtin_type_v4sf},
+ {16, "xmm2", &builtin_type_v4sf},
+ {16, "xmm3", &builtin_type_v4sf},
+ {16, "xmm4", &builtin_type_v4sf},
+ {16, "xmm5", &builtin_type_v4sf},
+ {16, "xmm6", &builtin_type_v4sf},
+ {16, "xmm7", &builtin_type_v4sf},
+ {16, "xmm8", &builtin_type_v4sf},
+ {16, "xmm9", &builtin_type_v4sf},
+ {16, "xmm10", &builtin_type_v4sf},
+ {16, "xmm11", &builtin_type_v4sf},
+ {16, "xmm12", &builtin_type_v4sf},
+ {16, "xmm13", &builtin_type_v4sf},
+ {16, "xmm14", &builtin_type_v4sf},
+ {16, "xmm15", &builtin_type_v4sf},
+ {4, "mxcsr", &builtin_type_int32}
+};
+
+/* Number of all registers */
+#define X86_64_NUM_REGS (sizeof (x86_64_register_info_table) / \
+ sizeof (x86_64_register_info_table[0]))
+
+/* Number of general registers. */
+#define X86_64_NUM_GREGS (22)
+
+int x86_64_num_regs = X86_64_NUM_REGS;
+int x86_64_num_gregs = X86_64_NUM_GREGS;
+
+/* Did we already print a note about frame pointer? */
+int omit_fp_note_printed = 0;
+
+/* Number of bytes of storage in the actual machine representation for
+ register REGNO. */
+int
+x86_64_register_raw_size (int regno)
+{
+ return x86_64_register_info_table[regno].size;
+}
+
+/* x86_64_register_byte_table[i] is the offset into the register file of the
+ start of register number i. We initialize this from
+ x86_64_register_info_table. */
+int x86_64_register_byte_table[X86_64_NUM_REGS];
+
+/* Index within `registers' of the first byte of the space for register REGNO. */
+int
+x86_64_register_byte (int regno)
+{
+ return x86_64_register_byte_table[regno];
+}
+
+/* Return the GDB type object for the "standard" data type of data in
+ register N. */
+static struct type *
+x86_64_register_virtual_type (int regno)
+{
+ return *x86_64_register_info_table[regno].type;
+}
+
+/* x86_64_register_convertible is true if register N's virtual format is
+ different from its raw format. Note that this definition assumes
+ that the host supports IEEE 32-bit floats, since it doesn't say
+ that SSE registers need conversion. Even if we can't find a
+ counterexample, this is still sloppy. */
+int
+x86_64_register_convertible (int regno)
+{
+ return IS_FP_REGNUM (regno);
+}
+
+/* Convert data from raw format for register REGNUM in buffer FROM to
+ virtual format with type TYPE in buffer TO. In principle both
+ formats are identical except that the virtual format has two extra
+ bytes appended that aren't used. We set these to zero. */
+void
+x86_64_register_convert_to_virtual (int regnum, struct type *type,
+ char *from, char *to)
+{
+ char buf[12];
+ DOUBLEST d;
+ /* We only support floating-point values. */
+ if (TYPE_CODE (type) != TYPE_CODE_FLT)
+ {
+ warning ("Cannot convert floating-point register value "
+ "to non-floating-point type.");
+ memset (to, 0, TYPE_LENGTH (type));
+ return;
+ }
+ /* First add the necessary padding. */
+ memcpy (buf, from, FPU_REG_RAW_SIZE);
+ memset (buf + FPU_REG_RAW_SIZE, 0, sizeof buf - FPU_REG_RAW_SIZE);
+ /* Convert to TYPE. This should be a no-op, if TYPE is equivalent
+ to the extended floating-point format used by the FPU. */
+ convert_typed_floating (to, type, buf,
+ x86_64_register_virtual_type (regnum));
+}
+
+/* Convert data from virtual format with type TYPE in buffer FROM to
+ raw format for register REGNUM in buffer TO. Simply omit the two
+ unused bytes. */
+
+void
+x86_64_register_convert_to_raw (struct type *type, int regnum,
+ char *from, char *to)
+{
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 12);
+ /* Simply omit the two unused bytes. */
+ memcpy (to, from, FPU_REG_RAW_SIZE);
+}
+
+/* This is the variable that is set with "set disassembly-flavour", and
+ its legitimate values. */
+static const char att_flavour[] = "att";
+static const char intel_flavour[] = "intel";
+static const char *valid_flavours[] = {
+ att_flavour,
+ intel_flavour,
+ NULL
+};
+static const char *disassembly_flavour = att_flavour;
+
+static CORE_ADDR
+x86_64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+ char buf[8];
+
+ store_unsigned_integer (buf, 8, CALL_DUMMY_ADDRESS ());
+
+ write_memory (sp - 8, buf, 8);
+ return sp - 8;
+}
+
+void
+x86_64_pop_frame (void)
+{
+ generic_pop_current_frame (cfi_pop_frame);
+}
+
+
+/* The returning of values is done according to the special algorithm.
+ Some types are returned in registers an some (big structures) in memory.
+ See ABI for details.
+ */
+
+#define MAX_CLASSES 4
+
+enum x86_64_reg_class
+{
+ X86_64_NO_CLASS,
+ X86_64_INTEGER_CLASS,
+ X86_64_INTEGERSI_CLASS,
+ X86_64_SSE_CLASS,
+ X86_64_SSESF_CLASS,
+ X86_64_SSEDF_CLASS,
+ X86_64_SSEUP_CLASS,
+ X86_64_X87_CLASS,
+ X86_64_X87UP_CLASS,
+ X86_64_MEMORY_CLASS
+};
+
+/* Return the union class of CLASS1 and CLASS2.
+ See the x86-64 ABI for details. */
+
+static enum x86_64_reg_class
+merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
+{
+ /* Rule #1: If both classes are equal, this is the resulting class. */
+ if (class1 == class2)
+ return class1;
+
+ /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
+ the other class. */
+ if (class1 == X86_64_NO_CLASS)
+ return class2;
+ if (class2 == X86_64_NO_CLASS)
+ return class1;
+
+ /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */
+ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
+ return X86_64_MEMORY_CLASS;
+
+ /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */
+ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
+ || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
+ return X86_64_INTEGERSI_CLASS;
+ if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
+ || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
+ return X86_64_INTEGER_CLASS;
+
+ /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */
+ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS
+ || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS)
+ return X86_64_MEMORY_CLASS;
+
+ /* Rule #6: Otherwise class SSE is used. */
+ return X86_64_SSE_CLASS;
+}
+
+
+/* Classify the argument type.
+ CLASSES will be filled by the register class used to pass each word
+ of the operand. The number of words is returned. In case the parameter
+ should be passed in memory, 0 is returned. As a special case for zero
+ sized containers, classes[0] will be NO_CLASS and 1 is returned.
+
+ See the x86-64 PS ABI for details.
+*/
+
+static int
+classify_argument (struct type *type,
+ enum x86_64_reg_class classes[MAX_CLASSES], int bit_offset)
+{
+ int bytes = TYPE_LENGTH (type);
+ int words = (bytes + 8 - 1) / 8;
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ {
+ int i;
+ enum x86_64_reg_class subclasses[MAX_CLASSES];
+
+ /* On x86-64 we pass structures larger than 16 bytes on the stack. */
+ if (bytes > 16)
+ return 0;
+
+ for (i = 0; i < words; i++)
+ classes[i] = X86_64_NO_CLASS;
+
+ /* Zero sized arrays or structures are NO_CLASS. We return 0 to
+ signalize memory class, so handle it as special case. */
+ if (!words)
+ {
+ classes[0] = X86_64_NO_CLASS;
+ return 1;
+ }
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT:
+ {
+ int j;
+ for (j = 0; j < type->nfields; ++j)
+ {
+ int num = classify_argument (type->fields[j].type,
+ subclasses,
+ (type->fields[j].loc.bitpos
+ + bit_offset) % 256);
+ if (!num)
+ return 0;
+ for (i = 0; i < num; i++)
+ {
+ int pos =
+ (type->fields[j].loc.bitpos + bit_offset) / 8 / 8;
+ classes[i + pos] =
+ merge_classes (subclasses[i], classes[i + pos]);
+ }
+ }
+ }
+ break;
+ case TYPE_CODE_ARRAY:
+ {
+ int num;
+
+ num = classify_argument (type->target_type,
+ subclasses, bit_offset);
+ if (!num)
+ return 0;
+
+ /* The partial classes are now full classes. */
+ if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4)
+ subclasses[0] = X86_64_SSE_CLASS;
+ if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4)
+ subclasses[0] = X86_64_INTEGER_CLASS;
+
+ for (i = 0; i < words; i++)
+ classes[i] = subclasses[i % num];
+ }
+ break;
+ case TYPE_CODE_UNION:
+ {
+ int j;
+ {
+ for (j = 0; j < type->nfields; ++j)
+ {
+ int num;
+ num = classify_argument (type->fields[j].type,
+ subclasses, bit_offset);
+ if (!num)
+ return 0;
+ for (i = 0; i < num; i++)
+ classes[i] = merge_classes (subclasses[i], classes[i]);
+ }
+ }
+ }
+ break;
+ }
+ /* Final merger cleanup. */
+ for (i = 0; i < words; i++)
+ {
+ /* If one class is MEMORY, everything should be passed in
+ memory. */
+ if (classes[i] == X86_64_MEMORY_CLASS)
+ return 0;
+
+ /* The X86_64_SSEUP_CLASS should be always preceeded by
+ X86_64_SSE_CLASS. */
+ if (classes[i] == X86_64_SSEUP_CLASS
+ && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS))
+ classes[i] = X86_64_SSE_CLASS;
+
+ /* X86_64_X87UP_CLASS should be preceeded by X86_64_X87_CLASS. */
+ if (classes[i] == X86_64_X87UP_CLASS
+ && (i == 0 || classes[i - 1] != X86_64_X87_CLASS))
+ classes[i] = X86_64_SSE_CLASS;
+ }
+ return words;
+ }
+ break;
+ case TYPE_CODE_FLT:
+ switch (bytes)
+ {
+ case 4:
+ if (!(bit_offset % 64))
+ classes[0] = X86_64_SSESF_CLASS;
+ else
+ classes[0] = X86_64_SSE_CLASS;
+ return 1;
+ case 8:
+ classes[0] = X86_64_SSEDF_CLASS;
+ return 1;
+ case 16:
+ classes[0] = X86_64_X87_CLASS;
+ classes[1] = X86_64_X87UP_CLASS;
+ return 2;
+ }
+ break;
+ case TYPE_CODE_INT:
+ case TYPE_CODE_PTR:
+ switch (bytes)
+ {
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ if (bytes * 8 + bit_offset <= 32)
+ classes[0] = X86_64_INTEGERSI_CLASS;
+ else
+ classes[0] = X86_64_INTEGER_CLASS;
+ return 1;
+ case 16:
+ classes[0] = classes[1] = X86_64_INTEGER_CLASS;
+ return 2;
+ default:
+ break;
+ }
+ case TYPE_CODE_VOID:
+ return 0;
+ }
+ internal_error (__FILE__, __LINE__,
+ "classify_argument: unknown argument type");
+}
+
+/* Examine the argument and return set number of register required in each
+ class. Return 0 ifif parameter should be passed in memory. */
+
+static int
+examine_argument (enum x86_64_reg_class classes[MAX_CLASSES],
+ int n, int *int_nregs, int *sse_nregs)
+{
+ *int_nregs = 0;
+ *sse_nregs = 0;
+ if (!n)
+ return 0;
+ for (n--; n >= 0; n--)
+ switch (classes[n])
+ {
+ case X86_64_INTEGER_CLASS:
+ case X86_64_INTEGERSI_CLASS:
+ (*int_nregs)++;
+ break;
+ case X86_64_SSE_CLASS:
+ case X86_64_SSESF_CLASS:
+ case X86_64_SSEDF_CLASS:
+ (*sse_nregs)++;
+ break;
+ case X86_64_NO_CLASS:
+ case X86_64_SSEUP_CLASS:
+ case X86_64_X87_CLASS:
+ case X86_64_X87UP_CLASS:
+ break;
+ case X86_64_MEMORY_CLASS:
+ internal_error (__FILE__, __LINE__,
+ "examine_argument: unexpected memory class");
+ }
+ return 1;
+}
+
+#define RET_INT_REGS 2
+#define RET_SSE_REGS 2
+
+/* Check if the structure in value_type is returned in registers or in
+ memory. If this function returns 1, gdb will call STORE_STRUCT_RETURN and
+ EXTRACT_STRUCT_VALUE_ADDRESS else STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE
+ will be used. */
+int
+x86_64_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ enum x86_64_reg_class class[MAX_CLASSES];
+ int n = classify_argument (value_type, class, 0);
+ int needed_intregs;
+ int needed_sseregs;
+
+ return (!n ||
+ !examine_argument (class, n, &needed_intregs, &needed_sseregs) ||
+ needed_intregs > RET_INT_REGS || needed_sseregs > RET_SSE_REGS);
+}
+
+
+/* Extract from an array REGBUF containing the (raw) register state, a
+ function return value of TYPE, and copy that, in virtual format,
+ into VALBUF. */
+
+void
+x86_64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ enum x86_64_reg_class class[MAX_CLASSES];
+ int n = classify_argument (type, class, 0);
+ int needed_intregs;
+ int needed_sseregs;
+ int intreg = 0;
+ int ssereg = 0;
+ int offset = 0;
+ int ret_int_r[RET_INT_REGS] = { RAX_REGNUM, RDX_REGNUM };
+ int ret_sse_r[RET_SSE_REGS] = { XMM0_REGNUM, XMM1_REGNUM };
+
+ if (!n ||
+ !examine_argument (class, n, &needed_intregs, &needed_sseregs) ||
+ needed_intregs > RET_INT_REGS || needed_sseregs > RET_SSE_REGS)
+ { /* memory class */
+ CORE_ADDR addr;
+ memcpy (&addr, regbuf, REGISTER_RAW_SIZE (RAX_REGNUM));
+ read_memory (addr, valbuf, TYPE_LENGTH (type));
+ return;
+ }
+ else
+ {
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ switch (class[i])
+ {
+ case X86_64_NO_CLASS:
+ break;
+ case X86_64_INTEGER_CLASS:
+ memcpy (valbuf + offset,
+ regbuf + REGISTER_BYTE (ret_int_r[(intreg + 1) / 2]),
+ 8);
+ offset += 8;
+ intreg += 2;
+ break;
+ case X86_64_INTEGERSI_CLASS:
+ memcpy (valbuf + offset,
+ regbuf + REGISTER_BYTE (ret_int_r[intreg / 2]), 4);
+ offset += 8;
+ intreg++;
+ break;
+ case X86_64_SSEDF_CLASS:
+ case X86_64_SSESF_CLASS:
+ case X86_64_SSE_CLASS:
+ memcpy (valbuf + offset,
+ regbuf + REGISTER_BYTE (ret_sse_r[(ssereg + 1) / 2]),
+ 8);
+ offset += 8;
+ ssereg += 2;
+ break;
+ case X86_64_SSEUP_CLASS:
+ memcpy (valbuf + offset + 8,
+ regbuf + REGISTER_BYTE (ret_sse_r[ssereg / 2]), 8);
+ offset += 8;
+ ssereg++;
+ break;
+ case X86_64_X87_CLASS:
+ memcpy (valbuf + offset, regbuf + REGISTER_BYTE (FP0_REGNUM),
+ 8);
+ offset += 8;
+ break;
+ case X86_64_X87UP_CLASS:
+ memcpy (valbuf + offset,
+ regbuf + REGISTER_BYTE (FP0_REGNUM) + 8, 8);
+ offset += 8;
+ break;
+ case X86_64_MEMORY_CLASS:
+ default:
+ internal_error (__FILE__, __LINE__,
+ "Unexpected argument class");
+ }
+ }
+ }
+}
+
+/* Handled by unwind informations. */
+static void
+x86_64_frame_init_saved_regs (struct frame_info *fi)
+{
+}
+
+#define INT_REGS 6
+#define SSE_REGS 16
+
+CORE_ADDR
+x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int intreg = 0;
+ int ssereg = 0;
+ int i;
+ static int int_parameter_registers[INT_REGS] = {
+ 5 /* RDI */ , 4 /* RSI */ ,
+ 3 /* RDX */ , 2 /* RCX */ ,
+ 8 /* R8 */ , 9 /* R9 */
+ };
+ /* XMM0 - XMM15 */
+ static int sse_parameter_registers[SSE_REGS] = {
+ XMM1_REGNUM - 1, XMM1_REGNUM, XMM1_REGNUM + 1, XMM1_REGNUM + 2,
+ XMM1_REGNUM + 3, XMM1_REGNUM + 4, XMM1_REGNUM + 5, XMM1_REGNUM + 6,
+ XMM1_REGNUM + 7, XMM1_REGNUM + 8, XMM1_REGNUM + 9, XMM1_REGNUM + 10,
+ XMM1_REGNUM + 11, XMM1_REGNUM + 12, XMM1_REGNUM + 13, XMM1_REGNUM + 14
+ };
+ int stack_values_count = 0;
+ int *stack_values;
+ stack_values = alloca (nargs * sizeof (int));
+ for (i = 0; i < nargs; i++)
+ {
+ enum x86_64_reg_class class[MAX_CLASSES];
+ int n = classify_argument (args[i]->type, class, 0);
+ int needed_intregs;
+ int needed_sseregs;
+
+ if (!n ||
+ !examine_argument (class, n, &needed_intregs, &needed_sseregs)
+ || intreg / 2 + needed_intregs > INT_REGS
+ || ssereg / 2 + needed_sseregs > SSE_REGS)
+ { /* memory class */
+ stack_values[stack_values_count++] = i;
+ }
+ else
+ {
+ int j;
+ for (j = 0; j < n; j++)
+ {
+ int offset = 0;
+ switch (class[j])
+ {
+ case X86_64_NO_CLASS:
+ break;
+ case X86_64_INTEGER_CLASS:
+ write_register_gen (int_parameter_registers
+ [(intreg + 1) / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
+ offset += 8;
+ intreg += 2;
+ break;
+ case X86_64_INTEGERSI_CLASS:
+ write_register_gen (int_parameter_registers[intreg / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
+ offset += 8;
+ intreg++;
+ break;
+ case X86_64_SSEDF_CLASS:
+ case X86_64_SSESF_CLASS:
+ case X86_64_SSE_CLASS:
+ write_register_gen (sse_parameter_registers
+ [(ssereg + 1) / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
+ offset += 8;
+ ssereg += 2;
+ break;
+ case X86_64_SSEUP_CLASS:
+ write_register_gen (sse_parameter_registers[ssereg / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
+ offset += 8;
+ ssereg++;
+ break;
+ case X86_64_X87_CLASS:
+ case X86_64_MEMORY_CLASS:
+ stack_values[stack_values_count++] = i;
+ break;
+ case X86_64_X87UP_CLASS:
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "Unexpected argument class");
+ }
+ intreg += intreg % 2;
+ ssereg += ssereg % 2;
+ }
+ }
+ }
+ while (--stack_values_count >= 0)
+ {
+ struct value *arg = args[stack_values[stack_values_count]];
+ int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+ len += 7;
+ len -= len % 8;
+ sp -= len;
+ write_memory (sp, VALUE_CONTENTS_ALL (arg), len);
+ }
+ return sp;
+}
+
+/* Write into the appropriate registers a function return value stored
+ in VALBUF of type TYPE, given in virtual format. */
+void
+x86_64_store_return_value (struct type *type, char *valbuf)
+{
+ int len = TYPE_LENGTH (type);
+
+ if (TYPE_CODE_FLT == TYPE_CODE (type))
+ {
+ /* Floating-point return values can be found in %st(0). */
+ if (len == TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT
+ && TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext)
+ {
+ /* Copy straight over. */
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), valbuf,
+ FPU_REG_RAW_SIZE);
+ }
+ else
+ {
+ char buf[FPU_REG_RAW_SIZE];
+ DOUBLEST val;
+
+ /* Convert the value found in VALBUF to the extended
+ floating point format used by the FPU. This is probably
+ not exactly how it would happen on the target itself, but
+ it is the best we can do. */
+ val = extract_floating (valbuf, TYPE_LENGTH (type));
+ floatformat_from_doublest (&floatformat_i387_ext, &val, buf);
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf,
+ FPU_REG_RAW_SIZE);
+ }
+ }
+ else
+ {
+ int low_size = REGISTER_RAW_SIZE (0);
+ int high_size = REGISTER_RAW_SIZE (1);
+
+ if (len <= low_size)
+ write_register_bytes (REGISTER_BYTE (0), valbuf, len);
+ else if (len <= (low_size + high_size))
+ {
+ write_register_bytes (REGISTER_BYTE (0), valbuf, low_size);
+ write_register_bytes (REGISTER_BYTE (1),
+ valbuf + low_size, len - low_size);
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+ "Cannot store return value of %d bytes long.", len);
+ }
+}
+
+
+static char *
+x86_64_register_name (int reg_nr)
+{
+ if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS)
+ return NULL;
+ return x86_64_register_info_table[reg_nr].name;
+}
+
+
+
+/* We have two flavours of disassembly. The machinery on this page
+ deals with switching between those. */
+
+static int
+gdb_print_insn_x86_64 (bfd_vma memaddr, disassemble_info * info)
+{
+ if (disassembly_flavour == att_flavour)
+ return print_insn_i386_att (memaddr, info);
+ else if (disassembly_flavour == intel_flavour)
+ return print_insn_i386_intel (memaddr, info);
+ /* Never reached -- disassembly_flavour is always either att_flavour
+ or intel_flavour. */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+}
+
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+void
+x86_64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (RDI_REGNUM, addr);
+}
+
+int
+x86_64_frameless_function_invocation (struct frame_info *frame)
+{
+ return 0;
+}
+
+/* If a function with debugging information and known beginning
+ is detected, we will return pc of the next line in the source
+ code. With this approach we effectively skip the prolog. */
+
+#define PROLOG_BUFSIZE 4
+CORE_ADDR
+x86_64_skip_prologue (CORE_ADDR pc)
+{
+ int i, firstline, currline;
+ struct symtab_and_line v_sal;
+ struct symbol *v_function;
+ CORE_ADDR salendaddr = 0, endaddr = 0;
+
+ /* We will handle only functions beginning with:
+ 55 pushq %rbp
+ 48 89 e5 movq %rsp,%rbp
+ */
+ unsigned char prolog_expect[PROLOG_BUFSIZE] = { 0x55, 0x48, 0x89, 0xe5 },
+ prolog_buf[PROLOG_BUFSIZE];
+
+ read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
+
+ /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */
+ for (i = 0; i < PROLOG_BUFSIZE; i++)
+ if (prolog_expect[i] != prolog_buf[i])
+ return pc; /* ... no, it doesn't. Nothing to skip. */
+
+ /* OK, we have found the prologue and want PC of the first
+ non-prologue instruction. */
+ pc += PROLOG_BUFSIZE;
+
+ v_function = find_pc_function (pc);
+ v_sal = find_pc_line (pc, 0);
+
+ /* If pc doesn't point to a function with debuginfo,
+ some of the following may be NULL. */
+ if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab)
+ return pc;
+
+ firstline = v_sal.line;
+ currline = firstline;
+ salendaddr = v_sal.end;
+ endaddr = v_function->ginfo.value.block->endaddr;
+
+ for (i = 0; i < v_sal.symtab->linetable->nitems; i++)
+ if (v_sal.symtab->linetable->item[i].line > firstline
+ && v_sal.symtab->linetable->item[i].pc >= salendaddr
+ && v_sal.symtab->linetable->item[i].pc < endaddr)
+ {
+ pc = v_sal.symtab->linetable->item[i].pc;
+ currline = v_sal.symtab->linetable->item[i].line;
+ break;
+ }
+
+ return pc;
+}
+
+/* Sequence of bytes for breakpoint instruction. */
+static unsigned char *
+x86_64_breakpoint_from_pc (CORE_ADDR * pc, int *lenptr)
+{
+ static unsigned char breakpoint[] = { 0xcc };
+ *lenptr = 1;
+ return breakpoint;
+}
+
+static struct gdbarch *
+i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
+ int i, sum;
+
+ /* Find a candidate among the list of pre-declared architectures. */
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_x86_64:
+ case bfd_mach_x86_64_intel_syntax:
+ switch (gdbarch_bfd_arch_info (arches->gdbarch)->mach)
+ {
+ case bfd_mach_x86_64:
+ case bfd_mach_x86_64_intel_syntax:
+ return arches->gdbarch;
+ case bfd_mach_i386_i386:
+ case bfd_mach_i386_i8086:
+ case bfd_mach_i386_i386_intel_syntax:
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "i386_gdbarch_init: unknown machine type");
+ }
+ break;
+ case bfd_mach_i386_i386:
+ case bfd_mach_i386_i8086:
+ case bfd_mach_i386_i386_intel_syntax:
+ switch (gdbarch_bfd_arch_info (arches->gdbarch)->mach)
+ {
+ case bfd_mach_x86_64:
+ case bfd_mach_x86_64_intel_syntax:
+ break;
+ case bfd_mach_i386_i386:
+ case bfd_mach_i386_i8086:
+ case bfd_mach_i386_i386_intel_syntax:
+ return arches->gdbarch;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "i386_gdbarch_init: unknown machine type");
+ }
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "i386_gdbarch_init: unknown machine type");
+ }
+ }
+
+ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_x86_64:
+ case bfd_mach_x86_64_intel_syntax:
+ tdep->num_xmm_regs = 16;
+ break;
+ case bfd_mach_i386_i386:
+ case bfd_mach_i386_i8086:
+ case bfd_mach_i386_i386_intel_syntax:
+ /* This is place for definition of i386 target vector. */
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "i386_gdbarch_init: unknown machine type");
+ }
+
+ set_gdbarch_long_bit (gdbarch, 64);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 64);
+
+ set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
+
+ set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS);
+ set_gdbarch_register_name (gdbarch, x86_64_register_name);
+ set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 16);
+ set_gdbarch_register_byte (gdbarch, x86_64_register_byte);
+
+ /* Total amount of space needed to store our copies of the machine's register
+ (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS) */
+ for (i = 0, sum = 0; i < X86_64_NUM_REGS; i++)
+ sum += x86_64_register_info_table[i].size;
+ set_gdbarch_register_bytes (gdbarch, sum);
+ set_gdbarch_register_virtual_size (gdbarch, generic_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch, 16);
+
+ set_gdbarch_register_virtual_type (gdbarch, x86_64_register_virtual_type);
+
+ set_gdbarch_register_convertible (gdbarch, x86_64_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch,
+ x86_64_register_convert_to_virtual);
+ set_gdbarch_register_convert_to_raw (gdbarch,
+ x86_64_register_convert_to_raw);
+
+/* Register numbers of various important registers. */
+ set_gdbarch_sp_regnum (gdbarch, 7); /* (rsp) Contains address of top of stack. */
+ set_gdbarch_fp_regnum (gdbarch, 6); /* (rbp) */
+ set_gdbarch_pc_regnum (gdbarch, 16); /* (rip) Contains program counter. */
+
+ set_gdbarch_fp0_regnum (gdbarch, X86_64_NUM_GREGS); /* First FPU floating-point register. */
+
+ set_gdbarch_read_fp (gdbarch, cfi_read_fp);
+ set_gdbarch_write_fp (gdbarch, cfi_write_fp);
+
+/* Discard from the stack the innermost frame, restoring all registers. */
+ set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame);
+
+ /* FRAME_CHAIN takes a frame's nominal address and produces the frame's
+ chain-pointer. */
+ set_gdbarch_frame_chain (gdbarch, cfi_frame_chain);
+
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ x86_64_frameless_function_invocation);
+ set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
+
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
+
+/* Return number of bytes at start of arglist that are not really args. */
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs);
+
+/* Frame pc initialization is handled by unwind informations. */
+ set_gdbarch_init_frame_pc (gdbarch, cfi_init_frame_pc);
+
+/* Initialization of unwind informations. */
+ set_gdbarch_init_extra_frame_info (gdbarch, cfi_init_extra_frame_info);
+
+/* Getting saved registers is handled by unwind informations. */
+ set_gdbarch_get_saved_register (gdbarch, cfi_get_saved_register);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs);
+
+/* Cons up virtual frame pointer for trace */
+ set_gdbarch_virtual_frame_pointer (gdbarch, cfi_virtual_frame_pointer);
+
+
+ set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
+
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+ set_gdbarch_call_dummy_words (gdbarch, 0);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+ set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address);
+ set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments);
+
+/* Return number of args passed to a frame, no way to tell. */
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+/* Don't use default structure extract routine */
+ set_gdbarch_extract_struct_value_address (gdbarch, 0);
+
+/* If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
+ and EXTRACT_RETURN_VALUE to store/fetch the functions return value. It is
+ the case when structure is returned in registers. */
+ set_gdbarch_use_struct_convention (gdbarch, x86_64_use_struct_convention);
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+ set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return);
+
+/* Extract from an array REGBUF containing the (raw) register state
+ a function return value of type TYPE, and copy that, in virtual format,
+ into VALBUF. */
+ set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value);
+
+
+/* Write into the appropriate registers a function return value stored
+ in VALBUF of type TYPE, given in virtual format. */
+ set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value);
+
+
+/* Offset from address of function to start of its code. */
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue);
+
+ set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
+
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc);
+
+
+/* Amount PC must be decremented by after a breakpoint. This is often the
+ number of bytes in BREAKPOINT but not always. */
+ set_gdbarch_decr_pc_after_break (gdbarch, 1);
+
+/* Use dwarf2 debug frame informations. */
+ set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
+ return gdbarch;
+}
+
+void
+_initialize_x86_64_tdep (void)
+{
+ register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init);
+
+ /* Initialize the table saying where each register starts in the
+ register file. */
+ {
+ int i, offset;
+
+ offset = 0;
+ for (i = 0; i < X86_64_NUM_REGS; i++)
+ {
+ x86_64_register_byte_table[i] = offset;
+ offset += x86_64_register_info_table[i].size;
+ }
+ }
+
+ tm_print_insn = gdb_print_insn_x86_64;
+ tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 3)->mach;
+
+ /* Add the variable that controls the disassembly flavour. */
+ {
+ struct cmd_list_element *new_cmd;
+
+ new_cmd = add_set_enum_cmd ("disassembly-flavour", no_class,
+ valid_flavours, &disassembly_flavour, "\
+Set the disassembly flavour, the valid values are \"att\" and \"intel\", \
+and the default value is \"att\".", &setlist);
+ add_show_from_set (new_cmd, &showlist);
+ }
+}
diff --git a/contrib/gdb/gdb/x86-64-tdep.h b/contrib/gdb/gdb/x86-64-tdep.h
new file mode 100644
index 0000000..d15b8e7
--- /dev/null
+++ b/contrib/gdb/gdb/x86-64-tdep.h
@@ -0,0 +1,34 @@
+/* Target-dependent code for GDB, the GNU debugger.
+ Copyright 2001
+ Free Software Foundation, Inc.
+ Contributed by Jiri Smid, SuSE Labs.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 X86_64_TDEP_H
+#define X86_64_TDEP_H
+
+#include "i386-tdep.h"
+
+extern int x86_64_num_regs;
+extern int x86_64_num_gregs;
+
+gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
+gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
+
+#endif
diff --git a/contrib/gdb/gdb/xcoffsolib.h b/contrib/gdb/gdb/xcoffsolib.h
index 77d691b..d8370fa 100644
--- a/contrib/gdb/gdb/xcoffsolib.h
+++ b/contrib/gdb/gdb/xcoffsolib.h
@@ -1,21 +1,23 @@
/* Data structures for RS/6000 shared libraries, for GDB.
- Copyright 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2000
+ Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public 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,34 +27,40 @@ 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;
-};
+#ifndef XCOFFSOLIB_H
+#define XCOFFSOLIB_H
+
+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;
-/* Hook for symbol table relocation at runtime. */
+/* Add symbols for a vmap. */
+extern int vmap_add_symbols (struct vmap *vp);
-extern void (*xcoff_relocate_symtab_hook) PARAMS ((unsigned int));
+#endif
OpenPOWER on IntegriCloud